@inweb/viewer-visualize 26.1.3 → 26.1.4

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.
@@ -39,7 +39,7 @@
39
39
  }
40
40
  const {handler: handler, thisArg: thisArg} = command;
41
41
  const result = handler.apply(thisArg, [ viewer, ...args ]);
42
- viewer === null || viewer === undefined ? undefined : viewer.emit({
42
+ viewer === null || viewer === void 0 ? void 0 : viewer.emit({
43
43
  type: "command",
44
44
  data: id,
45
45
  args: args
@@ -484,7 +484,7 @@
484
484
  hasRequiredGlobal = 1;
485
485
  (function (exports) {
486
486
  Object.defineProperty(exports, "__esModule", { value: true });
487
- exports._registerNode = exports.Konva = exports.glob = undefined;
487
+ exports._registerNode = exports.Konva = exports.glob = void 0;
488
488
  const PI_OVER_180 = Math.PI / 180;
489
489
  function detectBrowser() {
490
490
  return (typeof window !== 'undefined' &&
@@ -500,7 +500,7 @@
500
500
  : {};
501
501
  exports.Konva = {
502
502
  _global: exports.glob,
503
- version: '9.3.18',
503
+ version: '9.3.16',
504
504
  isBrowser: detectBrowser(),
505
505
  isUnminified: /param/.test(function (param) { }.toString()),
506
506
  dblClickWindow: 400,
@@ -532,7 +532,7 @@
532
532
  },
533
533
  isTransforming() {
534
534
  var _a;
535
- return (_a = exports.Konva['Transformer']) === null || _a === undefined ? undefined : _a.isTransforming();
535
+ return (_a = exports.Konva['Transformer']) === null || _a === void 0 ? void 0 : _a.isTransforming();
536
536
  },
537
537
  isDragReady() {
538
538
  return !!exports.Konva['DD'].node;
@@ -561,7 +561,7 @@
561
561
  hasRequiredUtil = 1;
562
562
  (function (exports) {
563
563
  Object.defineProperty(exports, "__esModule", { value: true });
564
- exports.Util = exports.Transform = undefined;
564
+ exports.Util = exports.Transform = void 0;
565
565
  const Global_1 = requireGlobal();
566
566
  class Transform {
567
567
  constructor(m = [1, 0, 0, 1, 0, 0]) {
@@ -710,7 +710,7 @@
710
710
  }
711
711
  }
712
712
  exports.Transform = Transform;
713
- const OBJECT_ARRAY = '[object Array]', OBJECT_NUMBER = '[object Number]', OBJECT_STRING = '[object String]', OBJECT_BOOLEAN = '[object Boolean]', PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH = '#', EMPTY_STRING = '', ZERO = '0', KONVA_WARNING = 'Konva warning: ', KONVA_ERROR = 'Konva error: ', RGB_PAREN = 'rgb(', COLORS = {
713
+ let OBJECT_ARRAY = '[object Array]', OBJECT_NUMBER = '[object Number]', OBJECT_STRING = '[object String]', OBJECT_BOOLEAN = '[object Boolean]', PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH = '#', EMPTY_STRING = '', ZERO = '0', KONVA_WARNING = 'Konva warning: ', KONVA_ERROR = 'Konva error: ', RGB_PAREN = 'rgb(', COLORS = {
714
714
  aliceblue: [240, 248, 255],
715
715
  antiquewhite: [250, 235, 215],
716
716
  aqua: [0, 255, 255],
@@ -860,8 +860,7 @@
860
860
  whitesmoke: [245, 245, 245],
861
861
  yellow: [255, 255, 0],
862
862
  yellowgreen: [154, 205, 5],
863
- }, RGB_REGEX = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;
864
- let animQueue = [];
863
+ }, RGB_REGEX = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/, animQueue = [];
865
864
  const req = (typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame) ||
866
865
  function (f) {
867
866
  setTimeout(f, 60);
@@ -1258,19 +1257,19 @@
1258
1257
  return pc;
1259
1258
  },
1260
1259
  _prepareArrayForTween(startArray, endArray, isClosed) {
1261
- const start = [], end = [];
1260
+ let n, start = [], end = [];
1262
1261
  if (startArray.length > endArray.length) {
1263
1262
  const temp = endArray;
1264
1263
  endArray = startArray;
1265
1264
  startArray = temp;
1266
1265
  }
1267
- for (let n = 0; n < startArray.length; n += 2) {
1266
+ for (n = 0; n < startArray.length; n += 2) {
1268
1267
  start.push({
1269
1268
  x: startArray[n],
1270
1269
  y: startArray[n + 1],
1271
1270
  });
1272
1271
  }
1273
- for (let n = 0; n < endArray.length; n += 2) {
1272
+ for (n = 0; n < endArray.length; n += 2) {
1274
1273
  end.push({
1275
1274
  x: endArray[n],
1276
1275
  y: endArray[n + 1],
@@ -1439,8 +1438,8 @@
1439
1438
  function getNumberOrArrayOfNumbersValidator(noOfElements) {
1440
1439
  if (Global_1.Konva.isUnminified) {
1441
1440
  return function (val, attr) {
1442
- let isNumber = Util_1.Util._isNumber(val);
1443
- let isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;
1441
+ const isNumber = Util_1.Util._isNumber(val);
1442
+ const isValidArray = Util_1.Util._isArray(val) && val.length == noOfElements;
1444
1443
  if (!isNumber && !isValidArray) {
1445
1444
  Util_1.Util.warn(_formatValue(val) +
1446
1445
  ' is a not valid value for "' +
@@ -1456,8 +1455,8 @@
1456
1455
  function getNumberOrAutoValidator() {
1457
1456
  if (Global_1.Konva.isUnminified) {
1458
1457
  return function (val, attr) {
1459
- var isNumber = Util_1.Util._isNumber(val);
1460
- var isAuto = val === 'auto';
1458
+ const isNumber = Util_1.Util._isNumber(val);
1459
+ const isAuto = val === 'auto';
1461
1460
  if (!(isNumber || isAuto)) {
1462
1461
  Util_1.Util.warn(_formatValue(val) +
1463
1462
  ' is a not valid value for "' +
@@ -1486,7 +1485,7 @@
1486
1485
  return function (val, attr) {
1487
1486
  const isString = Util_1.Util._isString(val);
1488
1487
  const isGradient = Object.prototype.toString.call(val) === '[object CanvasGradient]' ||
1489
- (val && val['addColorStop']);
1488
+ (val && val.addColorStop);
1490
1489
  if (!(isString || isGradient)) {
1491
1490
  Util_1.Util.warn(_formatValue(val) +
1492
1491
  ' is a not valid value for "' +
@@ -1541,7 +1540,7 @@
1541
1540
  function getBooleanValidator() {
1542
1541
  if (Global_1.Konva.isUnminified) {
1543
1542
  return function (val, attr) {
1544
- var isBool = val === true || val === false;
1543
+ const isBool = val === true || val === false;
1545
1544
  if (!isBool) {
1546
1545
  Util_1.Util.warn(_formatValue(val) +
1547
1546
  ' is a not valid value for "' +
@@ -1579,11 +1578,10 @@
1579
1578
  hasRequiredFactory = 1;
1580
1579
  (function (exports) {
1581
1580
  Object.defineProperty(exports, "__esModule", { value: true });
1582
- exports.Factory = undefined;
1581
+ exports.Factory = void 0;
1583
1582
  const Util_1 = requireUtil();
1584
1583
  const Validators_1 = requireValidators();
1585
- const GET = 'get';
1586
- const SET = 'set';
1584
+ const GET = 'get', SET = 'set';
1587
1585
  exports.Factory = {
1588
1586
  addGetterSetter(constructor, attr, def, validator, after) {
1589
1587
  exports.Factory.addGetter(constructor, attr, def);
@@ -1591,7 +1589,7 @@
1591
1589
  exports.Factory.addOverloadedGetterSetter(constructor, attr);
1592
1590
  },
1593
1591
  addGetter(constructor, attr, def) {
1594
- var method = GET + Util_1.Util._capitalize(attr);
1592
+ const method = GET + Util_1.Util._capitalize(attr);
1595
1593
  constructor.prototype[method] =
1596
1594
  constructor.prototype[method] ||
1597
1595
  function () {
@@ -1600,13 +1598,13 @@
1600
1598
  };
1601
1599
  },
1602
1600
  addSetter(constructor, attr, validator, after) {
1603
- var method = SET + Util_1.Util._capitalize(attr);
1601
+ const method = SET + Util_1.Util._capitalize(attr);
1604
1602
  if (!constructor.prototype[method]) {
1605
1603
  exports.Factory.overWriteSetter(constructor, attr, validator, after);
1606
1604
  }
1607
1605
  },
1608
1606
  overWriteSetter(constructor, attr, validator, after) {
1609
- var method = SET + Util_1.Util._capitalize(attr);
1607
+ const method = SET + Util_1.Util._capitalize(attr);
1610
1608
  constructor.prototype[method] = function (val) {
1611
1609
  if (validator && val !== undefined && val !== null) {
1612
1610
  val = validator.call(this, val, attr);
@@ -1619,25 +1617,25 @@
1619
1617
  };
1620
1618
  },
1621
1619
  addComponentsGetterSetter(constructor, attr, components, validator, after) {
1622
- const len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr);
1620
+ let len = components.length, capitalize = Util_1.Util._capitalize, getter = GET + capitalize(attr), setter = SET + capitalize(attr), n, component;
1623
1621
  constructor.prototype[getter] = function () {
1624
1622
  const ret = {};
1625
- for (let n = 0; n < len; n++) {
1626
- const component = components[n];
1623
+ for (n = 0; n < len; n++) {
1624
+ component = components[n];
1627
1625
  ret[component] = this.getAttr(attr + capitalize(component));
1628
1626
  }
1629
1627
  return ret;
1630
1628
  };
1631
1629
  const basicValidator = (0, Validators_1.getComponentValidator)(components);
1632
1630
  constructor.prototype[setter] = function (val) {
1633
- const oldVal = this.attrs[attr];
1631
+ let oldVal = this.attrs[attr], key;
1634
1632
  if (validator) {
1635
- val = validator.call(this, val, attr);
1633
+ val = validator.call(this, val);
1636
1634
  }
1637
1635
  if (basicValidator) {
1638
1636
  basicValidator.call(this, val, attr);
1639
1637
  }
1640
- for (const key in val) {
1638
+ for (key in val) {
1641
1639
  if (!val.hasOwnProperty(key)) {
1642
1640
  continue;
1643
1641
  }
@@ -1657,7 +1655,7 @@
1657
1655
  exports.Factory.addOverloadedGetterSetter(constructor, attr);
1658
1656
  },
1659
1657
  addOverloadedGetterSetter(constructor, attr) {
1660
- var capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;
1658
+ const capitalizedAttr = Util_1.Util._capitalize(attr), setter = SET + capitalizedAttr, getter = GET + capitalizedAttr;
1661
1659
  constructor.prototype[attr] = function () {
1662
1660
  if (arguments.length) {
1663
1661
  this[setter](arguments[0]);
@@ -1717,13 +1715,13 @@
1717
1715
  if (hasRequiredContext) return Context;
1718
1716
  hasRequiredContext = 1;
1719
1717
  Object.defineProperty(Context, "__esModule", { value: true });
1720
- Context.HitContext = Context.SceneContext = Context.Context = undefined;
1718
+ Context.HitContext = Context.SceneContext = Context.Context = void 0;
1721
1719
  const Util_1 = requireUtil();
1722
1720
  const Global_1 = requireGlobal();
1723
1721
  function simplifyArray(arr) {
1724
- const retArr = [], len = arr.length, util = Util_1.Util;
1725
- for (let n = 0; n < len; n++) {
1726
- let val = arr[n];
1722
+ let retArr = [], len = arr.length, util = Util_1.Util, n, val;
1723
+ for (n = 0; n < len; n++) {
1724
+ val = arr[n];
1727
1725
  if (util._isNumber(val)) {
1728
1726
  val = Math.round(val * 1000) / 1000;
1729
1727
  }
@@ -2206,7 +2204,7 @@
2206
2204
  }
2207
2205
  _applyShadow(shape) {
2208
2206
  var _a, _b, _c;
2209
- const color = (_a = shape.getShadowRGBA()) !== null && _a !== undefined ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== undefined ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== undefined ? _c : {
2207
+ const color = (_a = shape.getShadowRGBA()) !== null && _a !== void 0 ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== void 0 ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {
2210
2208
  x: 0,
2211
2209
  y: 0,
2212
2210
  }, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;
@@ -2265,7 +2263,7 @@
2265
2263
  if (hasRequiredCanvas) return Canvas;
2266
2264
  hasRequiredCanvas = 1;
2267
2265
  Object.defineProperty(Canvas, "__esModule", { value: true });
2268
- Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas = undefined;
2266
+ Canvas.HitCanvas = Canvas.SceneCanvas = Canvas.Canvas = void 0;
2269
2267
  const Util_1 = requireUtil();
2270
2268
  const Context_1 = requireContext();
2271
2269
  const Global_1 = requireGlobal();
@@ -2391,7 +2389,7 @@
2391
2389
  hasRequiredDragAndDrop = 1;
2392
2390
  (function (exports) {
2393
2391
  Object.defineProperty(exports, "__esModule", { value: true });
2394
- exports.DD = undefined;
2392
+ exports.DD = void 0;
2395
2393
  const Global_1 = requireGlobal();
2396
2394
  const Util_1 = requireUtil();
2397
2395
  exports.DD = {
@@ -2512,7 +2510,7 @@
2512
2510
  if (hasRequiredNode) return Node;
2513
2511
  hasRequiredNode = 1;
2514
2512
  Object.defineProperty(Node, "__esModule", { value: true });
2515
- Node.Node = undefined;
2513
+ Node.Node = void 0;
2516
2514
  const Util_1 = requireUtil();
2517
2515
  const Factory_1 = requireFactory();
2518
2516
  const Canvas_1 = requireCanvas();
@@ -3417,7 +3415,7 @@
3417
3415
  var _a, _b;
3418
3416
  const m = this._cache.get(TRANSFORM) || new Util_1.Transform();
3419
3417
  m.reset();
3420
- const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== undefined ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== undefined ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;
3418
+ const x = this.x(), y = this.y(), rotation = Global_1.Konva.getAngle(this.rotation()), scaleX = (_a = this.attrs.scaleX) !== null && _a !== void 0 ? _a : 1, scaleY = (_b = this.attrs.scaleY) !== null && _b !== void 0 ? _b : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;
3421
3419
  if (x !== 0 || y !== 0) {
3422
3420
  m.translate(x, y);
3423
3421
  }
@@ -3619,7 +3617,7 @@
3619
3617
  _requestDraw() {
3620
3618
  if (Global_1.Konva.autoDrawEnabled) {
3621
3619
  const drawNode = this.getLayer() || this.getStage();
3622
- drawNode === null || drawNode === undefined ? undefined : drawNode.batchDraw();
3620
+ drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();
3623
3621
  }
3624
3622
  }
3625
3623
  _setAttr(key, val) {
@@ -3680,13 +3678,13 @@
3680
3678
  }
3681
3679
  _getProtoListeners(eventType) {
3682
3680
  var _a, _b, _c;
3683
- const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== undefined ? _a : {};
3684
- let events = allListeners === null || allListeners === undefined ? undefined : allListeners[eventType];
3681
+ const allListeners = (_a = this._cache.get(ALL_LISTENERS)) !== null && _a !== void 0 ? _a : {};
3682
+ let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];
3685
3683
  if (events === undefined) {
3686
3684
  events = [];
3687
3685
  let obj = Object.getPrototypeOf(this);
3688
3686
  while (obj) {
3689
- const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === undefined ? undefined : _b[eventType]) !== null && _c !== undefined ? _c : [];
3687
+ const hierarchyEvents = (_c = (_b = obj.eventListeners) === null || _b === void 0 ? void 0 : _b[eventType]) !== null && _c !== void 0 ? _c : [];
3690
3688
  events.push(...hierarchyEvents);
3691
3689
  obj = Object.getPrototypeOf(obj);
3692
3690
  }
@@ -3922,12 +3920,12 @@
3922
3920
  Factory_1.Factory.addComponentsGetterSetter(Node$1, 'offset', ['x', 'y']);
3923
3921
  addGetterSetter(Node$1, 'offsetX', 0, (0, Validators_1.getNumberValidator)());
3924
3922
  addGetterSetter(Node$1, 'offsetY', 0, (0, Validators_1.getNumberValidator)());
3925
- addGetterSetter(Node$1, 'dragDistance', undefined, (0, Validators_1.getNumberValidator)());
3923
+ addGetterSetter(Node$1, 'dragDistance', null, (0, Validators_1.getNumberValidator)());
3926
3924
  addGetterSetter(Node$1, 'width', 0, (0, Validators_1.getNumberValidator)());
3927
3925
  addGetterSetter(Node$1, 'height', 0, (0, Validators_1.getNumberValidator)());
3928
3926
  addGetterSetter(Node$1, 'listening', true, (0, Validators_1.getBooleanValidator)());
3929
3927
  addGetterSetter(Node$1, 'preventDefault', true, (0, Validators_1.getBooleanValidator)());
3930
- addGetterSetter(Node$1, 'filters', undefined, function (val) {
3928
+ addGetterSetter(Node$1, 'filters', null, function (val) {
3931
3929
  this._filterUpToDate = false;
3932
3930
  return val;
3933
3931
  });
@@ -3952,7 +3950,7 @@
3952
3950
  if (hasRequiredContainer) return Container;
3953
3951
  hasRequiredContainer = 1;
3954
3952
  Object.defineProperty(Container, "__esModule", { value: true });
3955
- Container.Container = undefined;
3953
+ Container.Container = void 0;
3956
3954
  const Factory_1 = requireFactory();
3957
3955
  const Node_1 = requireNode();
3958
3956
  const Validators_1 = requireValidators();
@@ -4109,13 +4107,13 @@
4109
4107
  if (this.isCached()) {
4110
4108
  return;
4111
4109
  }
4112
- (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (node) {
4110
+ (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (node) {
4113
4111
  node._clearSelfAndDescendantCache(attr);
4114
4112
  });
4115
4113
  }
4116
4114
  _setChildrenIndices() {
4117
4115
  var _a;
4118
- (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child, n) {
4116
+ (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child, n) {
4119
4117
  child.index = n;
4120
4118
  });
4121
4119
  this._requestDraw();
@@ -4186,7 +4184,7 @@
4186
4184
  context.save();
4187
4185
  context._applyGlobalCompositeOperation(this);
4188
4186
  }
4189
- (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child) {
4187
+ (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
4190
4188
  child[drawMethod](canvas, top, bufferCanvas);
4191
4189
  });
4192
4190
  if (hasComposition) {
@@ -4208,7 +4206,7 @@
4208
4206
  height: 0,
4209
4207
  };
4210
4208
  const that = this;
4211
- (_a = this.children) === null || _a === undefined ? undefined : _a.forEach(function (child) {
4209
+ (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
4212
4210
  if (!child.visible()) {
4213
4211
  return;
4214
4212
  }
@@ -4340,7 +4338,7 @@
4340
4338
  hasRequiredStage = 1;
4341
4339
  (function (exports) {
4342
4340
  Object.defineProperty(exports, "__esModule", { value: true });
4343
- exports.Stage = exports.stages = undefined;
4341
+ exports.Stage = exports.stages = void 0;
4344
4342
  const Util_1 = requireUtil();
4345
4343
  const Factory_1 = requireFactory();
4346
4344
  const Container_1 = requireContainer();
@@ -4498,8 +4496,8 @@
4498
4496
  return true;
4499
4497
  }
4500
4498
  clear() {
4501
- const layers = this.children, len = layers.length;
4502
- for (let n = 0; n < len; n++) {
4499
+ let layers = this.children, len = layers.length, n;
4500
+ for (n = 0; n < len; n++) {
4503
4501
  layers[n].clear();
4504
4502
  }
4505
4503
  return this;
@@ -4577,8 +4575,8 @@
4577
4575
  if (!pos) {
4578
4576
  return null;
4579
4577
  }
4580
- const layers = this.children, len = layers.length, end = len - 1;
4581
- for (let n = end; n >= 0; n--) {
4578
+ let layers = this.children, len = layers.length, end = len - 1, n;
4579
+ for (n = end; n >= 0; n--) {
4582
4580
  const shape = layers[n].getIntersection(pos);
4583
4581
  if (shape) {
4584
4582
  return shape;
@@ -4891,7 +4889,7 @@
4891
4889
  });
4892
4890
  }
4893
4891
  Global_1.Konva['_' + eventType + 'ListenClick'] = false;
4894
- if (evt.cancelable && eventType !== 'touch' && eventType !== 'pointer') {
4892
+ if (evt.cancelable && eventType !== 'touch') {
4895
4893
  evt.preventDefault();
4896
4894
  }
4897
4895
  }
@@ -4936,8 +4934,7 @@
4936
4934
  PointerEvents.releaseCapture(evt.pointerId);
4937
4935
  }
4938
4936
  setPointersPositions(evt) {
4939
- const contentPosition = this._getContentPosition();
4940
- let x = null, y = null;
4937
+ let contentPosition = this._getContentPosition(), x = null, y = null;
4941
4938
  evt = evt ? evt : window.event;
4942
4939
  if (evt.touches !== undefined) {
4943
4940
  this._pointerPositions = [];
@@ -5057,7 +5054,7 @@
5057
5054
  hasRequiredShape = 1;
5058
5055
  (function (exports) {
5059
5056
  Object.defineProperty(exports, "__esModule", { value: true });
5060
- exports.Shape = exports.shapes = undefined;
5057
+ exports.Shape = exports.shapes = void 0;
5061
5058
  const Global_1 = requireGlobal();
5062
5059
  const Util_1 = requireUtil();
5063
5060
  const Factory_1 = requireFactory();
@@ -5290,7 +5287,7 @@
5290
5287
  }
5291
5288
  _useBufferCanvas(forceFill) {
5292
5289
  var _a;
5293
- const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== undefined ? _a : true;
5290
+ const perfectDrawEnabled = (_a = this.attrs.perfectDrawEnabled) !== null && _a !== void 0 ? _a : true;
5294
5291
  if (!perfectDrawEnabled) {
5295
5292
  return false;
5296
5293
  }
@@ -5459,16 +5456,16 @@
5459
5456
  return this;
5460
5457
  }
5461
5458
  drawHitFromCache(alphaThreshold = 0) {
5462
- const cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight();
5459
+ let cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;
5463
5460
  hitContext.clear();
5464
5461
  hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight);
5465
5462
  try {
5466
- const hitImageData = hitContext.getImageData(0, 0, hitWidth, hitHeight);
5467
- const hitData = hitImageData.data;
5468
- const len = hitData.length;
5469
- const rgbColorKey = Util_1.Util._hexToRgb(this.colorKey);
5470
- for (let i = 0; i < len; i += 4) {
5471
- const alpha = hitData[i + 3];
5463
+ hitImageData = hitContext.getImageData(0, 0, hitWidth, hitHeight);
5464
+ hitData = hitImageData.data;
5465
+ len = hitData.length;
5466
+ rgbColorKey = Util_1.Util._hexToRgb(this.colorKey);
5467
+ for (i = 0; i < len; i += 4) {
5468
+ alpha = hitData[i + 3];
5472
5469
  if (alpha > alphaThreshold) {
5473
5470
  hitData[i] = rgbColorKey.r;
5474
5471
  hitData[i + 1] = rgbColorKey.g;
@@ -5610,7 +5607,7 @@
5610
5607
  if (hasRequiredLayer) return Layer;
5611
5608
  hasRequiredLayer = 1;
5612
5609
  Object.defineProperty(Layer, "__esModule", { value: true });
5613
- Layer.Layer = undefined;
5610
+ Layer.Layer = void 0;
5614
5611
  const Util_1 = requireUtil();
5615
5612
  const Container_1 = requireContainer();
5616
5613
  const Node_1 = requireNode();
@@ -5928,7 +5925,7 @@
5928
5925
  if (hasRequiredFastLayer) return FastLayer;
5929
5926
  hasRequiredFastLayer = 1;
5930
5927
  Object.defineProperty(FastLayer, "__esModule", { value: true });
5931
- FastLayer.FastLayer = undefined;
5928
+ FastLayer.FastLayer = void 0;
5932
5929
  const Util_1 = requireUtil();
5933
5930
  const Layer_1 = requireLayer();
5934
5931
  const Global_1 = requireGlobal();
@@ -5953,7 +5950,7 @@
5953
5950
  if (hasRequiredGroup) return Group;
5954
5951
  hasRequiredGroup = 1;
5955
5952
  Object.defineProperty(Group, "__esModule", { value: true });
5956
- Group.Group = undefined;
5953
+ Group.Group = void 0;
5957
5954
  const Util_1 = requireUtil();
5958
5955
  const Container_1 = requireContainer();
5959
5956
  const Global_1 = requireGlobal();
@@ -5979,7 +5976,7 @@
5979
5976
  if (hasRequiredAnimation) return Animation;
5980
5977
  hasRequiredAnimation = 1;
5981
5978
  Object.defineProperty(Animation, "__esModule", { value: true });
5982
- Animation.Animation = undefined;
5979
+ Animation.Animation = void 0;
5983
5980
  const Global_1 = requireGlobal();
5984
5981
  const Util_1 = requireUtil();
5985
5982
  const now = (function () {
@@ -6135,19 +6132,18 @@
6135
6132
  hasRequiredTween = 1;
6136
6133
  (function (exports) {
6137
6134
  Object.defineProperty(exports, "__esModule", { value: true });
6138
- exports.Easings = exports.Tween = undefined;
6135
+ exports.Easings = exports.Tween = void 0;
6139
6136
  const Util_1 = requireUtil();
6140
6137
  const Animation_1 = requireAnimation();
6141
6138
  const Node_1 = requireNode();
6142
6139
  const Global_1 = requireGlobal();
6143
- const blacklist = {
6140
+ let blacklist = {
6144
6141
  node: 1,
6145
6142
  duration: 1,
6146
6143
  easing: 1,
6147
6144
  onFinish: 1,
6148
6145
  yoyo: 1,
6149
- }, PAUSED = 1, PLAYING = 2, REVERSING = 3, colorAttrs = ['fill', 'stroke', 'shadowColor'];
6150
- let idCounter = 0;
6146
+ }, PAUSED = 1, PLAYING = 2, REVERSING = 3, idCounter = 0, colorAttrs = ['fill', 'stroke', 'shadowColor'];
6151
6147
  class TweenEngine {
6152
6148
  constructor(prop, propFunc, func, begin, finish, duration, yoyo) {
6153
6149
  this.prop = prop;
@@ -6264,8 +6260,7 @@
6264
6260
  }
6265
6261
  class Tween {
6266
6262
  constructor(config) {
6267
- const that = this, node = config.node, nodeId = node._id, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo;
6268
- let duration, key;
6263
+ let that = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key;
6269
6264
  if (typeof config.duration === 'undefined') {
6270
6265
  duration = 0.3;
6271
6266
  }
@@ -6309,13 +6304,12 @@
6309
6304
  this.onUpdate = config.onUpdate;
6310
6305
  }
6311
6306
  _addAttr(key, end) {
6312
- const node = this.node, nodeId = node._id;
6313
- let diff, len, trueEnd, trueStart, endRGBA;
6314
- const tweenId = Tween.tweens[nodeId][key];
6307
+ let node = this.node, nodeId = node._id, start, diff, tweenId, n, len, trueEnd, trueStart, endRGBA;
6308
+ tweenId = Tween.tweens[nodeId][key];
6315
6309
  if (tweenId) {
6316
6310
  delete Tween.attrs[nodeId][tweenId][key];
6317
6311
  }
6318
- let start = node.getAttr(key);
6312
+ start = node.getAttr(key);
6319
6313
  if (Util_1.Util._isArray(end)) {
6320
6314
  diff = [];
6321
6315
  len = Math.max(end.length, start.length);
@@ -6330,7 +6324,7 @@
6330
6324
  }
6331
6325
  }
6332
6326
  if (key.indexOf('fill') === 0) {
6333
- for (let n = 0; n < len; n++) {
6327
+ for (n = 0; n < len; n++) {
6334
6328
  if (n % 2 === 0) {
6335
6329
  diff.push(end[n] - start[n]);
6336
6330
  }
@@ -6348,7 +6342,7 @@
6348
6342
  }
6349
6343
  }
6350
6344
  else {
6351
- for (let n = 0; n < len; n++) {
6345
+ for (n = 0; n < len; n++) {
6352
6346
  diff.push(end[n] - start[n]);
6353
6347
  }
6354
6348
  }
@@ -6376,8 +6370,7 @@
6376
6370
  Tween.tweens[nodeId][key] = this._id;
6377
6371
  }
6378
6372
  _tweenFunc(i) {
6379
- const node = this.node, attrs = Tween.attrs[node._id][this._id];
6380
- let key, attr, start, diff, newVal, n, len, end;
6373
+ let node = this.node, attrs = Tween.attrs[node._id][this._id], key, attr, start, diff, newVal, n, len, end;
6381
6374
  for (key in attrs) {
6382
6375
  attr = attrs[key];
6383
6376
  start = attr.start;
@@ -6489,9 +6482,9 @@
6489
6482
  return this;
6490
6483
  }
6491
6484
  destroy() {
6492
- const nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId];
6485
+ let nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId], key;
6493
6486
  this.pause();
6494
- for (const key in attrs) {
6487
+ for (key in attrs) {
6495
6488
  delete Tween.tweens[nodeId][key];
6496
6489
  }
6497
6490
  delete Tween.attrs[nodeId][thisId];
@@ -6668,7 +6661,7 @@
6668
6661
  hasRequired_CoreInternals = 1;
6669
6662
  (function (exports) {
6670
6663
  Object.defineProperty(exports, "__esModule", { value: true });
6671
- exports.Konva = undefined;
6664
+ exports.Konva = void 0;
6672
6665
  const Global_1 = requireGlobal();
6673
6666
  const Util_1 = requireUtil();
6674
6667
  const Node_1 = requireNode();
@@ -6715,7 +6708,7 @@
6715
6708
  if (hasRequiredArc) return Arc;
6716
6709
  hasRequiredArc = 1;
6717
6710
  Object.defineProperty(Arc, "__esModule", { value: true });
6718
- Arc.Arc = undefined;
6711
+ Arc.Arc = void 0;
6719
6712
  const Factory_1 = requireFactory();
6720
6713
  const Shape_1 = requireShape();
6721
6714
  const Global_1 = requireGlobal();
@@ -6785,7 +6778,7 @@
6785
6778
  if (hasRequiredLine) return Line;
6786
6779
  hasRequiredLine = 1;
6787
6780
  Object.defineProperty(Line, "__esModule", { value: true });
6788
- Line.Line = undefined;
6781
+ Line.Line = void 0;
6789
6782
  const Factory_1 = requireFactory();
6790
6783
  const Global_1 = requireGlobal();
6791
6784
  const Shape_1 = requireShape();
@@ -6956,342 +6949,342 @@
6956
6949
  hasRequiredBezierFunctions = 1;
6957
6950
  (function (exports) {
6958
6951
  Object.defineProperty(exports, "__esModule", { value: true });
6959
- exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = undefined;
6952
+ exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;
6960
6953
  exports.tValues = [
6961
6954
  [],
6962
6955
  [],
6963
6956
  [
6964
- -0.5773502691896257,
6957
+ -0.5773502691896257645091487805019574556476,
6965
6958
  0.5773502691896257645091487805019574556476,
6966
6959
  ],
6967
6960
  [
6968
- 0, -0.7745966692414834,
6961
+ 0, -0.7745966692414833770358530799564799221665,
6969
6962
  0.7745966692414833770358530799564799221665,
6970
6963
  ],
6971
6964
  [
6972
- -0.33998104358485626,
6965
+ -0.3399810435848562648026657591032446872005,
6973
6966
  0.3399810435848562648026657591032446872005,
6974
- -0.8611363115940526,
6967
+ -0.8611363115940525752239464888928095050957,
6975
6968
  0.8611363115940525752239464888928095050957,
6976
6969
  ],
6977
6970
  [
6978
- 0, -0.5384693101056831,
6971
+ 0, -0.5384693101056830910363144207002088049672,
6979
6972
  0.5384693101056830910363144207002088049672,
6980
- -0.906179845938664,
6973
+ -0.9061798459386639927976268782993929651256,
6981
6974
  0.9061798459386639927976268782993929651256,
6982
6975
  ],
6983
6976
  [
6984
6977
  0.6612093864662645136613995950199053470064,
6985
- -0.6612093864662645,
6986
- -0.2386191860831969,
6978
+ -0.6612093864662645136613995950199053470064,
6979
+ -0.2386191860831969086305017216807119354186,
6987
6980
  0.2386191860831969086305017216807119354186,
6988
- -0.932469514203152,
6981
+ -0.9324695142031520278123015544939946091347,
6989
6982
  0.9324695142031520278123015544939946091347,
6990
6983
  ],
6991
6984
  [
6992
6985
  0, 0.4058451513773971669066064120769614633473,
6993
- -0.4058451513773972,
6994
- -0.7415311855993945,
6986
+ -0.4058451513773971669066064120769614633473,
6987
+ -0.7415311855993944398638647732807884070741,
6995
6988
  0.7415311855993944398638647732807884070741,
6996
- -0.9491079123427585,
6989
+ -0.9491079123427585245261896840478512624007,
6997
6990
  0.9491079123427585245261896840478512624007,
6998
6991
  ],
6999
6992
  [
7000
- -0.1834346424956498,
6993
+ -0.1834346424956498049394761423601839806667,
7001
6994
  0.1834346424956498049394761423601839806667,
7002
- -0.525532409916329,
6995
+ -0.5255324099163289858177390491892463490419,
7003
6996
  0.5255324099163289858177390491892463490419,
7004
- -0.7966664774136267,
6997
+ -0.7966664774136267395915539364758304368371,
7005
6998
  0.7966664774136267395915539364758304368371,
7006
- -0.9602898564975363,
6999
+ -0.9602898564975362316835608685694729904282,
7007
7000
  0.9602898564975362316835608685694729904282,
7008
7001
  ],
7009
7002
  [
7010
- 0, -0.8360311073266358,
7003
+ 0, -0.8360311073266357942994297880697348765441,
7011
7004
  0.8360311073266357942994297880697348765441,
7012
- -0.9681602395076261,
7005
+ -0.9681602395076260898355762029036728700494,
7013
7006
  0.9681602395076260898355762029036728700494,
7014
- -0.3242534234038089,
7007
+ -0.3242534234038089290385380146433366085719,
7015
7008
  0.3242534234038089290385380146433366085719,
7016
- -0.6133714327005904,
7009
+ -0.6133714327005903973087020393414741847857,
7017
7010
  0.6133714327005903973087020393414741847857,
7018
7011
  ],
7019
7012
  [
7020
- -0.14887433898163122,
7013
+ -0.1488743389816312108848260011297199846175,
7021
7014
  0.1488743389816312108848260011297199846175,
7022
- -0.4333953941292472,
7015
+ -0.4333953941292471907992659431657841622,
7023
7016
  0.4333953941292471907992659431657841622,
7024
- -0.6794095682990244,
7017
+ -0.6794095682990244062343273651148735757692,
7025
7018
  0.6794095682990244062343273651148735757692,
7026
- -0.8650633666889845,
7019
+ -0.8650633666889845107320966884234930485275,
7027
7020
  0.8650633666889845107320966884234930485275,
7028
- -0.9739065285171717,
7021
+ -0.9739065285171717200779640120844520534282,
7029
7022
  0.9739065285171717200779640120844520534282,
7030
7023
  ],
7031
7024
  [
7032
- 0, -0.26954315595234496,
7025
+ 0, -0.2695431559523449723315319854008615246796,
7033
7026
  0.2695431559523449723315319854008615246796,
7034
- -0.5190961292068118,
7027
+ -0.5190961292068118159257256694586095544802,
7035
7028
  0.5190961292068118159257256694586095544802,
7036
- -0.7301520055740494,
7029
+ -0.7301520055740493240934162520311534580496,
7037
7030
  0.7301520055740493240934162520311534580496,
7038
- -0.8870625997680953,
7031
+ -0.8870625997680952990751577693039272666316,
7039
7032
  0.8870625997680952990751577693039272666316,
7040
- -0.978228658146057,
7033
+ -0.9782286581460569928039380011228573907714,
7041
7034
  0.9782286581460569928039380011228573907714,
7042
7035
  ],
7043
7036
  [
7044
- -0.1252334085114689,
7037
+ -0.1252334085114689154724413694638531299833,
7045
7038
  0.1252334085114689154724413694638531299833,
7046
- -0.3678314989981802,
7039
+ -0.3678314989981801937526915366437175612563,
7047
7040
  0.3678314989981801937526915366437175612563,
7048
- -0.5873179542866175,
7041
+ -0.587317954286617447296702418940534280369,
7049
7042
  0.587317954286617447296702418940534280369,
7050
- -0.7699026741943047,
7043
+ -0.7699026741943046870368938332128180759849,
7051
7044
  0.7699026741943046870368938332128180759849,
7052
- -0.9041172563704749,
7045
+ -0.9041172563704748566784658661190961925375,
7053
7046
  0.9041172563704748566784658661190961925375,
7054
- -0.9815606342467192,
7047
+ -0.9815606342467192506905490901492808229601,
7055
7048
  0.9815606342467192506905490901492808229601,
7056
7049
  ],
7057
7050
  [
7058
- 0, -0.2304583159551348,
7051
+ 0, -0.2304583159551347940655281210979888352115,
7059
7052
  0.2304583159551347940655281210979888352115,
7060
- -0.44849275103644687,
7053
+ -0.4484927510364468528779128521276398678019,
7061
7054
  0.4484927510364468528779128521276398678019,
7062
- -0.6423493394403402,
7055
+ -0.6423493394403402206439846069955156500716,
7063
7056
  0.6423493394403402206439846069955156500716,
7064
- -0.8015780907333099,
7057
+ -0.8015780907333099127942064895828598903056,
7065
7058
  0.8015780907333099127942064895828598903056,
7066
- -0.9175983992229779,
7059
+ -0.9175983992229779652065478365007195123904,
7067
7060
  0.9175983992229779652065478365007195123904,
7068
- -0.9841830547185881,
7061
+ -0.9841830547185881494728294488071096110649,
7069
7062
  0.9841830547185881494728294488071096110649,
7070
7063
  ],
7071
7064
  [
7072
- -0.10805494870734367,
7065
+ -0.1080549487073436620662446502198347476119,
7073
7066
  0.1080549487073436620662446502198347476119,
7074
- -0.31911236892788974,
7067
+ -0.3191123689278897604356718241684754668342,
7075
7068
  0.3191123689278897604356718241684754668342,
7076
- -0.5152486363581541,
7069
+ -0.5152486363581540919652907185511886623088,
7077
7070
  0.5152486363581540919652907185511886623088,
7078
- -0.6872929048116855,
7071
+ -0.6872929048116854701480198030193341375384,
7079
7072
  0.6872929048116854701480198030193341375384,
7080
- -0.827201315069765,
7073
+ -0.8272013150697649931897947426503949610397,
7081
7074
  0.8272013150697649931897947426503949610397,
7082
- -0.9284348836635735,
7075
+ -0.928434883663573517336391139377874264477,
7083
7076
  0.928434883663573517336391139377874264477,
7084
- -0.9862838086968123,
7077
+ -0.986283808696812338841597266704052801676,
7085
7078
  0.986283808696812338841597266704052801676,
7086
7079
  ],
7087
7080
  [
7088
- 0, -0.20119409399743451,
7081
+ 0, -0.2011940939974345223006283033945962078128,
7089
7082
  0.2011940939974345223006283033945962078128,
7090
- -0.3941513470775634,
7083
+ -0.3941513470775633698972073709810454683627,
7091
7084
  0.3941513470775633698972073709810454683627,
7092
- -0.5709721726085388,
7085
+ -0.5709721726085388475372267372539106412383,
7093
7086
  0.5709721726085388475372267372539106412383,
7094
- -0.7244177313601701,
7087
+ -0.7244177313601700474161860546139380096308,
7095
7088
  0.7244177313601700474161860546139380096308,
7096
- -0.8482065834104272,
7089
+ -0.8482065834104272162006483207742168513662,
7097
7090
  0.8482065834104272162006483207742168513662,
7098
- -0.937273392400706,
7091
+ -0.9372733924007059043077589477102094712439,
7099
7092
  0.9372733924007059043077589477102094712439,
7100
- -0.9879925180204854,
7093
+ -0.9879925180204854284895657185866125811469,
7101
7094
  0.9879925180204854284895657185866125811469,
7102
7095
  ],
7103
7096
  [
7104
- -0.09501250983763744,
7097
+ -0.0950125098376374401853193354249580631303,
7105
7098
  0.0950125098376374401853193354249580631303,
7106
- -0.2816035507792589,
7099
+ -0.281603550779258913230460501460496106486,
7107
7100
  0.281603550779258913230460501460496106486,
7108
- -0.45801677765722737,
7101
+ -0.45801677765722738634241944298357757354,
7109
7102
  0.45801677765722738634241944298357757354,
7110
- -0.6178762444026438,
7103
+ -0.6178762444026437484466717640487910189918,
7111
7104
  0.6178762444026437484466717640487910189918,
7112
- -0.755404408355003,
7105
+ -0.7554044083550030338951011948474422683538,
7113
7106
  0.7554044083550030338951011948474422683538,
7114
- -0.8656312023878318,
7107
+ -0.8656312023878317438804678977123931323873,
7115
7108
  0.8656312023878317438804678977123931323873,
7116
- -0.9445750230732326,
7109
+ -0.9445750230732325760779884155346083450911,
7117
7110
  0.9445750230732325760779884155346083450911,
7118
- -0.9894009349916499,
7111
+ -0.9894009349916499325961541734503326274262,
7119
7112
  0.9894009349916499325961541734503326274262,
7120
7113
  ],
7121
7114
  [
7122
- 0, -0.17848418149584785,
7115
+ 0, -0.1784841814958478558506774936540655574754,
7123
7116
  0.1784841814958478558506774936540655574754,
7124
- -0.3512317634538763,
7117
+ -0.3512317634538763152971855170953460050405,
7125
7118
  0.3512317634538763152971855170953460050405,
7126
- -0.5126905370864769,
7119
+ -0.5126905370864769678862465686295518745829,
7127
7120
  0.5126905370864769678862465686295518745829,
7128
- -0.6576711592166907,
7121
+ -0.6576711592166907658503022166430023351478,
7129
7122
  0.6576711592166907658503022166430023351478,
7130
- -0.7815140038968014,
7123
+ -0.7815140038968014069252300555204760502239,
7131
7124
  0.7815140038968014069252300555204760502239,
7132
- -0.8802391537269859,
7125
+ -0.8802391537269859021229556944881556926234,
7133
7126
  0.8802391537269859021229556944881556926234,
7134
- -0.9506755217687678,
7127
+ -0.9506755217687677612227169578958030214433,
7135
7128
  0.9506755217687677612227169578958030214433,
7136
- -0.9905754753144174,
7129
+ -0.9905754753144173356754340199406652765077,
7137
7130
  0.9905754753144173356754340199406652765077,
7138
7131
  ],
7139
7132
  [
7140
- -0.0847750130417353,
7133
+ -0.0847750130417353012422618529357838117333,
7141
7134
  0.0847750130417353012422618529357838117333,
7142
- -0.2518862256915055,
7135
+ -0.2518862256915055095889728548779112301628,
7143
7136
  0.2518862256915055095889728548779112301628,
7144
- -0.41175116146284263,
7137
+ -0.4117511614628426460359317938330516370789,
7145
7138
  0.4117511614628426460359317938330516370789,
7146
- -0.5597708310739475,
7139
+ -0.5597708310739475346078715485253291369276,
7147
7140
  0.5597708310739475346078715485253291369276,
7148
- -0.6916870430603532,
7141
+ -0.6916870430603532078748910812888483894522,
7149
7142
  0.6916870430603532078748910812888483894522,
7150
- -0.8037049589725231,
7143
+ -0.8037049589725231156824174550145907971032,
7151
7144
  0.8037049589725231156824174550145907971032,
7152
- -0.8926024664975557,
7145
+ -0.8926024664975557392060605911271455154078,
7153
7146
  0.8926024664975557392060605911271455154078,
7154
- -0.9558239495713977,
7147
+ -0.9558239495713977551811958929297763099728,
7155
7148
  0.9558239495713977551811958929297763099728,
7156
- -0.9915651684209309,
7149
+ -0.9915651684209309467300160047061507702525,
7157
7150
  0.9915651684209309467300160047061507702525,
7158
7151
  ],
7159
7152
  [
7160
- 0, -0.16035864564022537,
7153
+ 0, -0.1603586456402253758680961157407435495048,
7161
7154
  0.1603586456402253758680961157407435495048,
7162
- -0.31656409996362983,
7155
+ -0.3165640999636298319901173288498449178922,
7163
7156
  0.3165640999636298319901173288498449178922,
7164
- -0.46457074137596094,
7157
+ -0.4645707413759609457172671481041023679762,
7165
7158
  0.4645707413759609457172671481041023679762,
7166
- -0.600545304661681,
7159
+ -0.6005453046616810234696381649462392798683,
7167
7160
  0.6005453046616810234696381649462392798683,
7168
- -0.7209661773352294,
7161
+ -0.7209661773352293786170958608237816296571,
7169
7162
  0.7209661773352293786170958608237816296571,
7170
- -0.8227146565371428,
7163
+ -0.8227146565371428249789224867127139017745,
7171
7164
  0.8227146565371428249789224867127139017745,
7172
- -0.9031559036148179,
7165
+ -0.9031559036148179016426609285323124878093,
7173
7166
  0.9031559036148179016426609285323124878093,
7174
- -0.96020815213483,
7167
+ -0.960208152134830030852778840687651526615,
7175
7168
  0.960208152134830030852778840687651526615,
7176
- -0.9924068438435844,
7169
+ -0.9924068438435844031890176702532604935893,
7177
7170
  0.9924068438435844031890176702532604935893,
7178
7171
  ],
7179
7172
  [
7180
- -0.07652652113349734,
7173
+ -0.0765265211334973337546404093988382110047,
7181
7174
  0.0765265211334973337546404093988382110047,
7182
- -0.22778585114164507,
7175
+ -0.227785851141645078080496195368574624743,
7183
7176
  0.227785851141645078080496195368574624743,
7184
- -0.37370608871541955,
7177
+ -0.3737060887154195606725481770249272373957,
7185
7178
  0.3737060887154195606725481770249272373957,
7186
- -0.5108670019508271,
7179
+ -0.5108670019508270980043640509552509984254,
7187
7180
  0.5108670019508270980043640509552509984254,
7188
- -0.636053680726515,
7181
+ -0.6360536807265150254528366962262859367433,
7189
7182
  0.6360536807265150254528366962262859367433,
7190
- -0.7463319064601508,
7183
+ -0.7463319064601507926143050703556415903107,
7191
7184
  0.7463319064601507926143050703556415903107,
7192
- -0.8391169718222188,
7185
+ -0.8391169718222188233945290617015206853296,
7193
7186
  0.8391169718222188233945290617015206853296,
7194
- -0.912234428251326,
7187
+ -0.9122344282513259058677524412032981130491,
7195
7188
  0.9122344282513259058677524412032981130491,
7196
- -0.9639719272779138,
7189
+ -0.963971927277913791267666131197277221912,
7197
7190
  0.963971927277913791267666131197277221912,
7198
- -0.9931285991850949,
7191
+ -0.9931285991850949247861223884713202782226,
7199
7192
  0.9931285991850949247861223884713202782226,
7200
7193
  ],
7201
7194
  [
7202
- 0, -0.1455618541608951,
7195
+ 0, -0.1455618541608950909370309823386863301163,
7203
7196
  0.1455618541608950909370309823386863301163,
7204
- -0.2880213168024011,
7197
+ -0.288021316802401096600792516064600319909,
7205
7198
  0.288021316802401096600792516064600319909,
7206
- -0.4243421202074388,
7199
+ -0.4243421202074387835736688885437880520964,
7207
7200
  0.4243421202074387835736688885437880520964,
7208
- -0.5516188358872198,
7201
+ -0.551618835887219807059018796724313286622,
7209
7202
  0.551618835887219807059018796724313286622,
7210
- -0.6671388041974123,
7203
+ -0.667138804197412319305966669990339162597,
7211
7204
  0.667138804197412319305966669990339162597,
7212
- -0.7684399634756779,
7205
+ -0.7684399634756779086158778513062280348209,
7213
7206
  0.7684399634756779086158778513062280348209,
7214
- -0.8533633645833173,
7207
+ -0.8533633645833172836472506385875676702761,
7215
7208
  0.8533633645833172836472506385875676702761,
7216
- -0.9200993341504008,
7209
+ -0.9200993341504008287901871337149688941591,
7217
7210
  0.9200993341504008287901871337149688941591,
7218
- -0.9672268385663063,
7211
+ -0.9672268385663062943166222149076951614246,
7219
7212
  0.9672268385663062943166222149076951614246,
7220
- -0.9937521706203895,
7213
+ -0.9937521706203895002602420359379409291933,
7221
7214
  0.9937521706203895002602420359379409291933,
7222
7215
  ],
7223
7216
  [
7224
- -0.06973927331972223,
7217
+ -0.0697392733197222212138417961186280818222,
7225
7218
  0.0697392733197222212138417961186280818222,
7226
- -0.20786042668822127,
7219
+ -0.2078604266882212854788465339195457342156,
7227
7220
  0.2078604266882212854788465339195457342156,
7228
- -0.34193582089208424,
7221
+ -0.3419358208920842251581474204273796195591,
7229
7222
  0.3419358208920842251581474204273796195591,
7230
- -0.469355837986757,
7223
+ -0.4693558379867570264063307109664063460953,
7231
7224
  0.4693558379867570264063307109664063460953,
7232
- -0.5876404035069116,
7225
+ -0.5876404035069115929588769276386473488776,
7233
7226
  0.5876404035069115929588769276386473488776,
7234
- -0.6944872631866827,
7227
+ -0.6944872631866827800506898357622567712673,
7235
7228
  0.6944872631866827800506898357622567712673,
7236
- -0.7878168059792081,
7229
+ -0.7878168059792081620042779554083515213881,
7237
7230
  0.7878168059792081620042779554083515213881,
7238
- -0.8658125777203002,
7231
+ -0.8658125777203001365364256370193787290847,
7239
7232
  0.8658125777203001365364256370193787290847,
7240
- -0.926956772187174,
7233
+ -0.9269567721871740005206929392590531966353,
7241
7234
  0.9269567721871740005206929392590531966353,
7242
- -0.9700604978354287,
7235
+ -0.9700604978354287271239509867652687108059,
7243
7236
  0.9700604978354287271239509867652687108059,
7244
- -0.9942945854823992,
7237
+ -0.994294585482399292073031421161298980393,
7245
7238
  0.994294585482399292073031421161298980393,
7246
7239
  ],
7247
7240
  [
7248
- 0, -0.1332568242984661,
7241
+ 0, -0.1332568242984661109317426822417661370104,
7249
7242
  0.1332568242984661109317426822417661370104,
7250
- -0.26413568097034495,
7243
+ -0.264135680970344930533869538283309602979,
7251
7244
  0.264135680970344930533869538283309602979,
7252
- -0.3903010380302908,
7245
+ -0.390301038030290831421488872880605458578,
7253
7246
  0.390301038030290831421488872880605458578,
7254
- -0.5095014778460075,
7247
+ -0.5095014778460075496897930478668464305448,
7255
7248
  0.5095014778460075496897930478668464305448,
7256
- -0.6196098757636461,
7249
+ -0.6196098757636461563850973116495956533871,
7257
7250
  0.6196098757636461563850973116495956533871,
7258
- -0.7186613631319502,
7251
+ -0.7186613631319501944616244837486188483299,
7259
7252
  0.7186613631319501944616244837486188483299,
7260
- -0.8048884016188399,
7253
+ -0.8048884016188398921511184069967785579414,
7261
7254
  0.8048884016188398921511184069967785579414,
7262
- -0.8767523582704416,
7255
+ -0.8767523582704416673781568859341456716389,
7263
7256
  0.8767523582704416673781568859341456716389,
7264
- -0.9329710868260161,
7257
+ -0.9329710868260161023491969890384229782357,
7265
7258
  0.9329710868260161023491969890384229782357,
7266
- -0.9725424712181152,
7259
+ -0.9725424712181152319560240768207773751816,
7267
7260
  0.9725424712181152319560240768207773751816,
7268
- -0.9947693349975522,
7261
+ -0.9947693349975521235239257154455743605736,
7269
7262
  0.9947693349975521235239257154455743605736,
7270
7263
  ],
7271
7264
  [
7272
- -0.06405689286260563,
7265
+ -0.0640568928626056260850430826247450385909,
7273
7266
  0.0640568928626056260850430826247450385909,
7274
- -0.1911188674736163,
7267
+ -0.1911188674736163091586398207570696318404,
7275
7268
  0.1911188674736163091586398207570696318404,
7276
- -0.3150426796961634,
7269
+ -0.3150426796961633743867932913198102407864,
7277
7270
  0.3150426796961633743867932913198102407864,
7278
- -0.4337935076260451,
7271
+ -0.4337935076260451384870842319133497124524,
7279
7272
  0.4337935076260451384870842319133497124524,
7280
- -0.5454214713888396,
7273
+ -0.5454214713888395356583756172183723700107,
7281
7274
  0.5454214713888395356583756172183723700107,
7282
- -0.6480936519369755,
7275
+ -0.6480936519369755692524957869107476266696,
7283
7276
  0.6480936519369755692524957869107476266696,
7284
- -0.7401241915785544,
7277
+ -0.7401241915785543642438281030999784255232,
7285
7278
  0.7401241915785543642438281030999784255232,
7286
- -0.820001985973903,
7279
+ -0.8200019859739029219539498726697452080761,
7287
7280
  0.8200019859739029219539498726697452080761,
7288
- -0.8864155270044011,
7281
+ -0.8864155270044010342131543419821967550873,
7289
7282
  0.8864155270044010342131543419821967550873,
7290
- -0.9382745520027328,
7283
+ -0.9382745520027327585236490017087214496548,
7291
7284
  0.9382745520027327585236490017087214496548,
7292
- -0.9747285559713095,
7285
+ -0.9747285559713094981983919930081690617411,
7293
7286
  0.9747285559713094981983919930081690617411,
7294
- -0.9951872199970213,
7287
+ -0.9951872199970213601799974097007368118745,
7295
7288
  0.9951872199970213601799974097007368118745,
7296
7289
  ],
7297
7290
  ];
@@ -7754,7 +7747,7 @@
7754
7747
  if (hasRequiredPath) return Path;
7755
7748
  hasRequiredPath = 1;
7756
7749
  Object.defineProperty(Path, "__esModule", { value: true });
7757
- Path.Path = undefined;
7750
+ Path.Path = void 0;
7758
7751
  const Factory_1 = requireFactory();
7759
7752
  const Shape_1 = requireShape();
7760
7753
  const Global_1 = requireGlobal();
@@ -7937,8 +7930,8 @@
7937
7930
  return null;
7938
7931
  }
7939
7932
  static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
7940
- fromX = fromX !== null && fromX !== undefined ? fromX : P1x;
7941
- fromY = fromY !== null && fromY !== undefined ? fromY : P1y;
7933
+ fromX = fromX !== null && fromX !== void 0 ? fromX : P1x;
7934
+ fromY = fromY !== null && fromY !== void 0 ? fromY : P1y;
7942
7935
  const len = this.getLineLength(P1x, P1y, P2x, P2y);
7943
7936
  if (len < 1e-10) {
7944
7937
  return { x: P1x, y: P1y };
@@ -8367,7 +8360,7 @@
8367
8360
  if (hasRequiredArrow) return Arrow;
8368
8361
  hasRequiredArrow = 1;
8369
8362
  Object.defineProperty(Arrow, "__esModule", { value: true });
8370
- Arrow.Arrow = undefined;
8363
+ Arrow.Arrow = void 0;
8371
8364
  const Factory_1 = requireFactory();
8372
8365
  const Line_1 = requireLine();
8373
8366
  const Validators_1 = requireValidators();
@@ -8454,9 +8447,9 @@
8454
8447
  const lineRect = super.getSelfRect();
8455
8448
  const offset = this.pointerWidth() / 2;
8456
8449
  return {
8457
- x: lineRect.x,
8450
+ x: lineRect.x - offset,
8458
8451
  y: lineRect.y - offset,
8459
- width: lineRect.width,
8452
+ width: lineRect.width + offset * 2,
8460
8453
  height: lineRect.height + offset * 2,
8461
8454
  };
8462
8455
  }
@@ -8479,7 +8472,7 @@
8479
8472
  if (hasRequiredCircle) return Circle;
8480
8473
  hasRequiredCircle = 1;
8481
8474
  Object.defineProperty(Circle, "__esModule", { value: true });
8482
- Circle.Circle = undefined;
8475
+ Circle.Circle = void 0;
8483
8476
  const Factory_1 = requireFactory();
8484
8477
  const Shape_1 = requireShape();
8485
8478
  const Validators_1 = requireValidators();
@@ -8525,7 +8518,7 @@
8525
8518
  if (hasRequiredEllipse) return Ellipse;
8526
8519
  hasRequiredEllipse = 1;
8527
8520
  Object.defineProperty(Ellipse, "__esModule", { value: true });
8528
- Ellipse.Ellipse = undefined;
8521
+ Ellipse.Ellipse = void 0;
8529
8522
  const Factory_1 = requireFactory();
8530
8523
  const Shape_1 = requireShape();
8531
8524
  const Validators_1 = requireValidators();
@@ -8575,7 +8568,7 @@
8575
8568
  if (hasRequiredImage) return Image$1;
8576
8569
  hasRequiredImage = 1;
8577
8570
  Object.defineProperty(Image$1, "__esModule", { value: true });
8578
- Image$1.Image = undefined;
8571
+ Image$1.Image = void 0;
8579
8572
  const Util_1 = requireUtil();
8580
8573
  const Factory_1 = requireFactory();
8581
8574
  const Shape_1 = requireShape();
@@ -8666,11 +8659,11 @@
8666
8659
  }
8667
8660
  getWidth() {
8668
8661
  var _a, _b;
8669
- return (_a = this.attrs.width) !== null && _a !== undefined ? _a : (_b = this.image()) === null || _b === undefined ? undefined : _b.width;
8662
+ return (_a = this.attrs.width) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.width;
8670
8663
  }
8671
8664
  getHeight() {
8672
8665
  var _a, _b;
8673
- return (_a = this.attrs.height) !== null && _a !== undefined ? _a : (_b = this.image()) === null || _b === undefined ? undefined : _b.height;
8666
+ return (_a = this.attrs.height) !== null && _a !== void 0 ? _a : (_b = this.image()) === null || _b === void 0 ? void 0 : _b.height;
8674
8667
  }
8675
8668
  static fromURL(url, callback, onError = null) {
8676
8669
  const img = Util_1.Util.createImageElement();
@@ -8706,7 +8699,7 @@
8706
8699
  if (hasRequiredLabel) return Label;
8707
8700
  hasRequiredLabel = 1;
8708
8701
  Object.defineProperty(Label, "__esModule", { value: true });
8709
- Label.Tag = Label.Label = undefined;
8702
+ Label.Tag = Label.Label = void 0;
8710
8703
  const Factory_1 = requireFactory();
8711
8704
  const Shape_1 = requireShape();
8712
8705
  const Group_1 = requireGroup();
@@ -8893,7 +8886,7 @@
8893
8886
  if (hasRequiredRect) return Rect;
8894
8887
  hasRequiredRect = 1;
8895
8888
  Object.defineProperty(Rect, "__esModule", { value: true });
8896
- Rect.Rect = undefined;
8889
+ Rect.Rect = void 0;
8897
8890
  const Factory_1 = requireFactory();
8898
8891
  const Shape_1 = requireShape();
8899
8892
  const Global_1 = requireGlobal();
@@ -8928,7 +8921,7 @@
8928
8921
  if (hasRequiredRegularPolygon) return RegularPolygon;
8929
8922
  hasRequiredRegularPolygon = 1;
8930
8923
  Object.defineProperty(RegularPolygon, "__esModule", { value: true });
8931
- RegularPolygon.RegularPolygon = undefined;
8924
+ RegularPolygon.RegularPolygon = void 0;
8932
8925
  const Factory_1 = requireFactory();
8933
8926
  const Shape_1 = requireShape();
8934
8927
  const Validators_1 = requireValidators();
@@ -9006,7 +8999,7 @@
9006
8999
  if (hasRequiredRing) return Ring;
9007
9000
  hasRequiredRing = 1;
9008
9001
  Object.defineProperty(Ring, "__esModule", { value: true });
9009
- Ring.Ring = undefined;
9002
+ Ring.Ring = void 0;
9010
9003
  const Factory_1 = requireFactory();
9011
9004
  const Shape_1 = requireShape();
9012
9005
  const Validators_1 = requireValidators();
@@ -9052,7 +9045,7 @@
9052
9045
  if (hasRequiredSprite) return Sprite;
9053
9046
  hasRequiredSprite = 1;
9054
9047
  Object.defineProperty(Sprite, "__esModule", { value: true });
9055
- Sprite.Sprite = undefined;
9048
+ Sprite.Sprite = void 0;
9056
9049
  const Factory_1 = requireFactory();
9057
9050
  const Shape_1 = requireShape();
9058
9051
  const Animation_1 = requireAnimation();
@@ -9173,7 +9166,7 @@
9173
9166
  if (hasRequiredStar) return Star;
9174
9167
  hasRequiredStar = 1;
9175
9168
  Object.defineProperty(Star, "__esModule", { value: true });
9176
- Star.Star = undefined;
9169
+ Star.Star = void 0;
9177
9170
  const Factory_1 = requireFactory();
9178
9171
  const Shape_1 = requireShape();
9179
9172
  const Validators_1 = requireValidators();
@@ -9224,7 +9217,7 @@
9224
9217
  if (hasRequiredText) return Text;
9225
9218
  hasRequiredText = 1;
9226
9219
  Object.defineProperty(Text, "__esModule", { value: true });
9227
- Text.Text = undefined;
9220
+ Text.Text = void 0;
9228
9221
  Text.stringToArray = stringToArray;
9229
9222
  const Util_1 = requireUtil();
9230
9223
  const Factory_1 = requireFactory();
@@ -9234,15 +9227,8 @@
9234
9227
  const Global_2 = requireGlobal();
9235
9228
  function stringToArray(string) {
9236
9229
  return [...string].reduce((acc, char, index, array) => {
9237
- if (/\p{Emoji}/u.test(char)) {
9238
- const nextChar = array[index + 1];
9239
- if (nextChar && /\p{Emoji_Modifier}|\u200D/u.test(nextChar)) {
9240
- acc.push(char + nextChar);
9241
- array[index + 1] = '';
9242
- }
9243
- else {
9244
- acc.push(char);
9245
- }
9230
+ if (/\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?(?:\u200D\p{Emoji_Presentation})+/u.test(char)) {
9231
+ acc.push(char);
9246
9232
  }
9247
9233
  else if (/\p{Regional_Indicator}{2}/u.test(char + (array[index + 1] || ''))) {
9248
9234
  acc.push(char + array[index + 1]);
@@ -9250,7 +9236,7 @@
9250
9236
  else if (index > 0 && /\p{Mn}|\p{Me}|\p{Mc}/u.test(char)) {
9251
9237
  acc[acc.length - 1] += char;
9252
9238
  }
9253
- else if (char) {
9239
+ else {
9254
9240
  acc.push(char);
9255
9241
  }
9256
9242
  return acc;
@@ -9355,7 +9341,7 @@
9355
9341
  for (n = 0; n < textArrLen; n++) {
9356
9342
  var lineTranslateX = 0;
9357
9343
  var lineTranslateY = 0;
9358
- var obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber, lineWidth;
9344
+ var obj = textArr[n], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber, oneWord, lineWidth;
9359
9345
  context.save();
9360
9346
  if (align === RIGHT) {
9361
9347
  lineTranslateX += totalWidth - width - padding * 2;
@@ -9373,6 +9359,7 @@
9373
9359
  const y = translateY + lineTranslateY + yOffset;
9374
9360
  context.moveTo(x, y);
9375
9361
  spacesNumber = text.split(' ').length - 1;
9362
+ oneWord = spacesNumber === 0;
9376
9363
  lineWidth =
9377
9364
  align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
9378
9365
  context.lineTo(x + Math.round(lineWidth), y);
@@ -9388,8 +9375,11 @@
9388
9375
  const yOffset = Global_1.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0;
9389
9376
  context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset);
9390
9377
  spacesNumber = text.split(' ').length - 1;
9378
+ oneWord = spacesNumber === 0;
9391
9379
  lineWidth =
9392
- align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
9380
+ align === JUSTIFY && lastLine && !oneWord
9381
+ ? totalWidth - padding * 2
9382
+ : width;
9393
9383
  context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + yOffset);
9394
9384
  context.lineWidth = fontSize / 15;
9395
9385
  const gradient = this._getLinearGradient();
@@ -9470,17 +9460,17 @@
9470
9460
  _context.restore();
9471
9461
  const scaleFactor = fontSize / 100;
9472
9462
  return {
9473
- actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== undefined ? _a : 71.58203125 * scaleFactor,
9474
- actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== undefined ? _b : 0,
9475
- actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== undefined ? _c : -7.421875 * scaleFactor,
9476
- actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== undefined ? _d : 75.732421875 * scaleFactor,
9477
- alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== undefined ? _e : 0,
9478
- emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== undefined ? _f : 100 * scaleFactor,
9479
- emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== undefined ? _g : -20 * scaleFactor,
9480
- fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== undefined ? _h : 91 * scaleFactor,
9481
- fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== undefined ? _j : 21 * scaleFactor,
9482
- hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== undefined ? _k : 72.80000305175781 * scaleFactor,
9483
- ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== undefined ? _l : -21 * scaleFactor,
9463
+ actualBoundingBoxAscent: (_a = metrics.actualBoundingBoxAscent) !== null && _a !== void 0 ? _a : 71.58203125 * scaleFactor,
9464
+ actualBoundingBoxDescent: (_b = metrics.actualBoundingBoxDescent) !== null && _b !== void 0 ? _b : 0,
9465
+ actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== void 0 ? _c : -7.421875 * scaleFactor,
9466
+ actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== void 0 ? _d : 75.732421875 * scaleFactor,
9467
+ alphabeticBaseline: (_e = metrics.alphabeticBaseline) !== null && _e !== void 0 ? _e : 0,
9468
+ emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== void 0 ? _f : 100 * scaleFactor,
9469
+ emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== void 0 ? _g : -20 * scaleFactor,
9470
+ fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== void 0 ? _h : 91 * scaleFactor,
9471
+ fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== void 0 ? _j : 21 * scaleFactor,
9472
+ hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== void 0 ? _k : 72.80000305175781 * scaleFactor,
9473
+ ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== void 0 ? _l : -21 * scaleFactor,
9484
9474
  width: metrics.width,
9485
9475
  height: fontSize,
9486
9476
  };
@@ -9508,23 +9498,22 @@
9508
9498
  _getTextWidth(text) {
9509
9499
  const letterSpacing = this.letterSpacing();
9510
9500
  const length = text.length;
9511
- return getDummyContext().measureText(text).width + letterSpacing * length;
9501
+ return (getDummyContext().measureText(text).width +
9502
+ (length ? letterSpacing * (length - 1) : 0));
9512
9503
  }
9513
9504
  _setTextData() {
9514
9505
  let lines = this.text().split('\n'), fontSize = +this.fontSize(), textWidth = 0, lineHeightPx = this.lineHeight() * fontSize, width = this.attrs.width, height = this.attrs.height, fixedWidth = width !== AUTO && width !== undefined, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxWidth = width - padding * 2, maxHeightPx = height - padding * 2, currentHeightPx = 0, wrap = this.wrap(), shouldWrap = wrap !== NONE, wrapAtWord = wrap !== CHAR && shouldWrap, shouldAddEllipsis = this.ellipsis();
9515
9506
  this.textArr = [];
9516
9507
  getDummyContext().font = this._getContextFont();
9517
- const additionalWidth = shouldAddEllipsis
9518
- ? this._getTextWidth(ELLIPSIS)
9519
- : 0;
9508
+ const additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;
9520
9509
  for (let i = 0, max = lines.length; i < max; ++i) {
9521
9510
  let line = lines[i];
9522
9511
  let lineWidth = this._getTextWidth(line);
9523
9512
  if (fixedWidth && lineWidth > maxWidth) {
9524
9513
  while (line.length > 0) {
9525
- let low = 0, high = stringToArray(line).length, match = '', matchWidth = 0;
9514
+ let low = 0, high = line.length, match = '', matchWidth = 0;
9526
9515
  while (low < high) {
9527
- const mid = (low + high) >>> 1, lineArray = stringToArray(line), substr = lineArray.slice(0, mid + 1).join(''), substrWidth = this._getTextWidth(substr) + additionalWidth;
9516
+ const mid = (low + high) >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth;
9528
9517
  if (substrWidth <= maxWidth) {
9529
9518
  low = mid + 1;
9530
9519
  match = substr;
@@ -9536,22 +9525,20 @@
9536
9525
  }
9537
9526
  if (match) {
9538
9527
  if (wrapAtWord) {
9539
- const lineArray = stringToArray(line);
9540
- const matchArray = stringToArray(match);
9541
- const nextChar = lineArray[matchArray.length];
9528
+ var wrapIndex;
9529
+ const nextChar = line[match.length];
9542
9530
  const nextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH;
9543
- let wrapIndex;
9544
9531
  if (nextIsSpaceOrDash && matchWidth <= maxWidth) {
9545
- wrapIndex = matchArray.length;
9532
+ wrapIndex = match.length;
9546
9533
  }
9547
9534
  else {
9548
- const lastSpaceIndex = matchArray.lastIndexOf(SPACE);
9549
- const lastDashIndex = matchArray.lastIndexOf(DASH);
9550
- wrapIndex = Math.max(lastSpaceIndex, lastDashIndex) + 1;
9535
+ wrapIndex =
9536
+ Math.max(match.lastIndexOf(SPACE), match.lastIndexOf(DASH)) +
9537
+ 1;
9551
9538
  }
9552
9539
  if (wrapIndex > 0) {
9553
9540
  low = wrapIndex;
9554
- match = lineArray.slice(0, low).join('');
9541
+ match = match.slice(0, low);
9555
9542
  matchWidth = this._getTextWidth(match);
9556
9543
  }
9557
9544
  }
@@ -9564,8 +9551,8 @@
9564
9551
  this._tryToAddEllipsisToLastLine();
9565
9552
  break;
9566
9553
  }
9567
- const lineArray = stringToArray(line);
9568
- line = lineArray.slice(low).join('').trimLeft();
9554
+ line = line.slice(low);
9555
+ line = line.trimLeft();
9569
9556
  if (line.length > 0) {
9570
9557
  lineWidth = this._getTextWidth(line);
9571
9558
  if (lineWidth <= maxWidth) {
@@ -9672,7 +9659,7 @@
9672
9659
  if (hasRequiredTextPath) return TextPath;
9673
9660
  hasRequiredTextPath = 1;
9674
9661
  Object.defineProperty(TextPath, "__esModule", { value: true });
9675
- TextPath.TextPath = undefined;
9662
+ TextPath.TextPath = void 0;
9676
9663
  const Util_1 = requireUtil();
9677
9664
  const Factory_1 = requireFactory();
9678
9665
  const Shape_1 = requireShape();
@@ -9909,8 +9896,8 @@
9909
9896
  Factory_1.Factory.addGetterSetter(TextPath$1, 'textBaseline', 'middle');
9910
9897
  Factory_1.Factory.addGetterSetter(TextPath$1, 'fontVariant', NORMAL);
9911
9898
  Factory_1.Factory.addGetterSetter(TextPath$1, 'text', EMPTY_STRING);
9912
- Factory_1.Factory.addGetterSetter(TextPath$1, 'textDecoration', '');
9913
- Factory_1.Factory.addGetterSetter(TextPath$1, 'kerningFunc', undefined);
9899
+ Factory_1.Factory.addGetterSetter(TextPath$1, 'textDecoration', null);
9900
+ Factory_1.Factory.addGetterSetter(TextPath$1, 'kerningFunc', null);
9914
9901
  return TextPath;
9915
9902
  }
9916
9903
 
@@ -9922,7 +9909,7 @@
9922
9909
  if (hasRequiredTransformer) return Transformer;
9923
9910
  hasRequiredTransformer = 1;
9924
9911
  Object.defineProperty(Transformer, "__esModule", { value: true });
9925
- Transformer.Transformer = undefined;
9912
+ Transformer.Transformer = void 0;
9926
9913
  const Util_1 = requireUtil();
9927
9914
  const Factory_1 = requireFactory();
9928
9915
  const Node_1 = requireNode();
@@ -10022,6 +10009,7 @@
10022
10009
  'bottom-center',
10023
10010
  'bottom-right',
10024
10011
  ];
10012
+ const MAX_SAFE_INTEGER = 100000000;
10025
10013
  function getCenter(shape) {
10026
10014
  return {
10027
10015
  x: shape.x +
@@ -10217,8 +10205,8 @@
10217
10205
  const node = this.getNode();
10218
10206
  if (!node) {
10219
10207
  return {
10220
- x: -1e8,
10221
- y: -1e8,
10208
+ x: -MAX_SAFE_INTEGER,
10209
+ y: -MAX_SAFE_INTEGER,
10222
10210
  width: 0,
10223
10211
  height: 0,
10224
10212
  rotation: 0,
@@ -10597,12 +10585,12 @@
10597
10585
  const node = this.getNode();
10598
10586
  activeTransformersCount--;
10599
10587
  this._fire('transformend', { evt: e, target: node });
10600
- (_a = this.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10588
+ (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10601
10589
  if (node) {
10602
10590
  this._nodes.forEach((target) => {
10603
10591
  var _a;
10604
10592
  target._fire('transformend', { evt: e, target });
10605
- (_a = target.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10593
+ (_a = target.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10606
10594
  });
10607
10595
  }
10608
10596
  this._movingAnchorName = null;
@@ -10715,7 +10703,7 @@
10715
10703
  .multiply(localTransform);
10716
10704
  const attrs = newLocalTransform.decompose();
10717
10705
  node.setAttrs(attrs);
10718
- (_a = node.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10706
+ (_a = node.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10719
10707
  });
10720
10708
  this.rotation(Util_1.Util._getRotation(newAttrs.rotation));
10721
10709
  this._nodes.forEach((node) => {
@@ -10830,7 +10818,7 @@
10830
10818
  styleFunc(node);
10831
10819
  });
10832
10820
  }
10833
- (_a = this.getLayer()) === null || _a === undefined ? undefined : _a.batchDraw();
10821
+ (_a = this.getLayer()) === null || _a === void 0 ? void 0 : _a.batchDraw();
10834
10822
  }
10835
10823
  isTransforming() {
10836
10824
  return this._transforming;
@@ -10914,8 +10902,8 @@
10914
10902
  Factory_1.Factory.addGetterSetter(Transformer$1, 'centeredScaling', false);
10915
10903
  Factory_1.Factory.addGetterSetter(Transformer$1, 'ignoreStroke', false);
10916
10904
  Factory_1.Factory.addGetterSetter(Transformer$1, 'padding', 0, (0, Validators_1.getNumberValidator)());
10917
- Factory_1.Factory.addGetterSetter(Transformer$1, 'nodes');
10918
10905
  Factory_1.Factory.addGetterSetter(Transformer$1, 'node');
10906
+ Factory_1.Factory.addGetterSetter(Transformer$1, 'nodes');
10919
10907
  Factory_1.Factory.addGetterSetter(Transformer$1, 'boundBoxFunc');
10920
10908
  Factory_1.Factory.addGetterSetter(Transformer$1, 'anchorDragBoundFunc');
10921
10909
  Factory_1.Factory.addGetterSetter(Transformer$1, 'anchorStyleFunc');
@@ -10937,7 +10925,7 @@
10937
10925
  if (hasRequiredWedge) return Wedge;
10938
10926
  hasRequiredWedge = 1;
10939
10927
  Object.defineProperty(Wedge, "__esModule", { value: true });
10940
- Wedge.Wedge = undefined;
10928
+ Wedge.Wedge = void 0;
10941
10929
  const Factory_1 = requireFactory();
10942
10930
  const Shape_1 = requireShape();
10943
10931
  const Global_1 = requireGlobal();
@@ -10988,7 +10976,7 @@
10988
10976
  if (hasRequiredBlur) return Blur;
10989
10977
  hasRequiredBlur = 1;
10990
10978
  Object.defineProperty(Blur, "__esModule", { value: true });
10991
- Blur.Blur = undefined;
10979
+ Blur.Blur = void 0;
10992
10980
  const Factory_1 = requireFactory();
10993
10981
  const Node_1 = requireNode();
10994
10982
  const Validators_1 = requireValidators();
@@ -11037,8 +11025,7 @@
11037
11025
  function filterGaussBlurRGBA(imageData, radius) {
11038
11026
  const pixels = imageData.data, width = imageData.width, height = imageData.height;
11039
11027
  let x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg, pb, pa, rbs;
11040
- const div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = (radiusPlus1 * (radiusPlus1 + 1)) / 2, stackStart = new BlurStack(), mul_sum = mul_table[radius], shg_sum = shg_table[radius];
11041
- let stackEnd = null, stack = stackStart, stackIn = null, stackOut = null;
11028
+ let div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = (radiusPlus1 * (radiusPlus1 + 1)) / 2, stackStart = new BlurStack(), stackEnd = null, stack = stackStart, stackIn = null, stackOut = null, mul_sum = mul_table[radius], shg_sum = shg_table[radius];
11042
11029
  for (i = 1; i < div; i++) {
11043
11030
  stack = stack.next = new BlurStack();
11044
11031
  if (i === radiusPlus1) {
@@ -11236,13 +11223,13 @@
11236
11223
  if (hasRequiredBrighten) return Brighten;
11237
11224
  hasRequiredBrighten = 1;
11238
11225
  Object.defineProperty(Brighten, "__esModule", { value: true });
11239
- Brighten.Brighten = undefined;
11226
+ Brighten.Brighten = void 0;
11240
11227
  const Factory_1 = requireFactory();
11241
11228
  const Node_1 = requireNode();
11242
11229
  const Validators_1 = requireValidators();
11243
11230
  const Brighten$1 = function (imageData) {
11244
- const brightness = this.brightness() * 255, data = imageData.data, len = data.length;
11245
- for (let i = 0; i < len; i += 4) {
11231
+ let brightness = this.brightness() * 255, data = imageData.data, len = data.length, i;
11232
+ for (i = 0; i < len; i += 4) {
11246
11233
  data[i] += brightness;
11247
11234
  data[i + 1] += brightness;
11248
11235
  data[i + 2] += brightness;
@@ -11261,15 +11248,14 @@
11261
11248
  if (hasRequiredContrast) return Contrast;
11262
11249
  hasRequiredContrast = 1;
11263
11250
  Object.defineProperty(Contrast, "__esModule", { value: true });
11264
- Contrast.Contrast = undefined;
11251
+ Contrast.Contrast = void 0;
11265
11252
  const Factory_1 = requireFactory();
11266
11253
  const Node_1 = requireNode();
11267
11254
  const Validators_1 = requireValidators();
11268
11255
  const Contrast$1 = function (imageData) {
11269
11256
  const adjust = Math.pow((this.contrast() + 100) / 100, 2);
11270
- const data = imageData.data, nPixels = data.length;
11271
- let red = 150, green = 150, blue = 150;
11272
- for (let i = 0; i < nPixels; i += 4) {
11257
+ let data = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i;
11258
+ for (i = 0; i < nPixels; i += 4) {
11273
11259
  red = data[i];
11274
11260
  green = data[i + 1];
11275
11261
  blue = data[i + 2];
@@ -11309,14 +11295,13 @@
11309
11295
  if (hasRequiredEmboss) return Emboss;
11310
11296
  hasRequiredEmboss = 1;
11311
11297
  Object.defineProperty(Emboss, "__esModule", { value: true });
11312
- Emboss.Emboss = undefined;
11298
+ Emboss.Emboss = void 0;
11313
11299
  const Factory_1 = requireFactory();
11314
11300
  const Node_1 = requireNode();
11315
11301
  const Util_1 = requireUtil();
11316
11302
  const Validators_1 = requireValidators();
11317
11303
  const Emboss$1 = function (imageData) {
11318
- const strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4;
11319
- let dirY = 0, dirX = 0, y = h;
11304
+ let strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), dirY = 0, dirX = 0, data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4, y = h;
11320
11305
  switch (direction) {
11321
11306
  case 'top-left':
11322
11307
  dirY = -1;
@@ -11412,8 +11397,8 @@
11412
11397
  Emboss.Emboss = Emboss$1;
11413
11398
  Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossStrength', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
11414
11399
  Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossWhiteLevel', 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
11415
- Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left', undefined, Factory_1.Factory.afterSetFilter);
11416
- Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false, undefined, Factory_1.Factory.afterSetFilter);
11400
+ Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossDirection', 'top-left', null, Factory_1.Factory.afterSetFilter);
11401
+ Factory_1.Factory.addGetterSetter(Node_1.Node, 'embossBlend', false, null, Factory_1.Factory.afterSetFilter);
11417
11402
  return Emboss;
11418
11403
  }
11419
11404
 
@@ -11425,30 +11410,29 @@
11425
11410
  if (hasRequiredEnhance) return Enhance;
11426
11411
  hasRequiredEnhance = 1;
11427
11412
  Object.defineProperty(Enhance, "__esModule", { value: true });
11428
- Enhance.Enhance = undefined;
11413
+ Enhance.Enhance = void 0;
11429
11414
  const Factory_1 = requireFactory();
11430
11415
  const Node_1 = requireNode();
11431
11416
  const Validators_1 = requireValidators();
11432
11417
  function remap(fromValue, fromMin, fromMax, toMin, toMax) {
11433
- const fromRange = fromMax - fromMin, toRange = toMax - toMin;
11418
+ let fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;
11434
11419
  if (fromRange === 0) {
11435
11420
  return toMin + toRange / 2;
11436
11421
  }
11437
11422
  if (toRange === 0) {
11438
11423
  return toMin;
11439
11424
  }
11440
- let toValue = (fromValue - fromMin) / fromRange;
11425
+ toValue = (fromValue - fromMin) / fromRange;
11441
11426
  toValue = toRange * toValue + toMin;
11442
11427
  return toValue;
11443
11428
  }
11444
11429
  const Enhance$1 = function (imageData) {
11445
- const data = imageData.data, nSubPixels = data.length;
11446
- let rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b;
11430
+ let data = imageData.data, nSubPixels = data.length, rMin = data[0], rMax = rMin, r, gMin = data[1], gMax = gMin, g, bMin = data[2], bMax = bMin, b, i;
11447
11431
  const enhanceAmount = this.enhance();
11448
11432
  if (enhanceAmount === 0) {
11449
11433
  return;
11450
11434
  }
11451
- for (let i = 0; i < nSubPixels; i += 4) {
11435
+ for (i = 0; i < nSubPixels; i += 4) {
11452
11436
  r = data[i + 0];
11453
11437
  if (r < rMin) {
11454
11438
  rMin = r;
@@ -11503,7 +11487,7 @@
11503
11487
  bGoalMax = bMax + enhanceAmount * (bMax - bMid);
11504
11488
  bGoalMin = bMin + enhanceAmount * (bMin - bMid);
11505
11489
  }
11506
- for (let i = 0; i < nSubPixels; i += 4) {
11490
+ for (i = 0; i < nSubPixels; i += 4) {
11507
11491
  data[i + 0] = remap(data[i + 0], rMin, rMax, rGoalMin, rGoalMax);
11508
11492
  data[i + 1] = remap(data[i + 1], gMin, gMax, gGoalMin, gGoalMax);
11509
11493
  data[i + 2] = remap(data[i + 2], bMin, bMax, bGoalMin, bGoalMax);
@@ -11522,11 +11506,11 @@
11522
11506
  if (hasRequiredGrayscale) return Grayscale;
11523
11507
  hasRequiredGrayscale = 1;
11524
11508
  Object.defineProperty(Grayscale, "__esModule", { value: true });
11525
- Grayscale.Grayscale = undefined;
11509
+ Grayscale.Grayscale = void 0;
11526
11510
  const Grayscale$1 = function (imageData) {
11527
- const data = imageData.data, len = data.length;
11528
- for (let i = 0; i < len; i += 4) {
11529
- const brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];
11511
+ let data = imageData.data, len = data.length, i, brightness;
11512
+ for (i = 0; i < len; i += 4) {
11513
+ brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];
11530
11514
  data[i] = brightness;
11531
11515
  data[i + 1] = brightness;
11532
11516
  data[i + 2] = brightness;
@@ -11544,7 +11528,7 @@
11544
11528
  if (hasRequiredHSL) return HSL;
11545
11529
  hasRequiredHSL = 1;
11546
11530
  Object.defineProperty(HSL, "__esModule", { value: true });
11547
- HSL.HSL = undefined;
11531
+ HSL.HSL = void 0;
11548
11532
  const Factory_1 = requireFactory();
11549
11533
  const Node_1 = requireNode();
11550
11534
  const Validators_1 = requireValidators();
@@ -11552,13 +11536,13 @@
11552
11536
  Factory_1.Factory.addGetterSetter(Node_1.Node, 'saturation', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
11553
11537
  Factory_1.Factory.addGetterSetter(Node_1.Node, 'luminance', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
11554
11538
  const HSL$1 = function (imageData) {
11555
- const data = imageData.data, nPixels = data.length, v = 1, s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, l = this.luminance() * 127;
11539
+ let data = imageData.data, nPixels = data.length, v = 1, s = Math.pow(2, this.saturation()), h = Math.abs(this.hue() + 360) % 360, l = this.luminance() * 127, i;
11556
11540
  const vsu = v * s * Math.cos((h * Math.PI) / 180), vsw = v * s * Math.sin((h * Math.PI) / 180);
11557
11541
  const rr = 0.299 * v + 0.701 * vsu + 0.167 * vsw, rg = 0.587 * v - 0.587 * vsu + 0.33 * vsw, rb = 0.114 * v - 0.114 * vsu - 0.497 * vsw;
11558
11542
  const gr = 0.299 * v - 0.299 * vsu - 0.328 * vsw, gg = 0.587 * v + 0.413 * vsu + 0.035 * vsw, gb = 0.114 * v - 0.114 * vsu + 0.293 * vsw;
11559
11543
  const br = 0.299 * v - 0.3 * vsu + 1.25 * vsw, bg = 0.587 * v - 0.586 * vsu - 1.05 * vsw, bb = 0.114 * v + 0.886 * vsu - 0.2 * vsw;
11560
11544
  let r, g, b, a;
11561
- for (let i = 0; i < nPixels; i += 4) {
11545
+ for (i = 0; i < nPixels; i += 4) {
11562
11546
  r = data[i + 0];
11563
11547
  g = data[i + 1];
11564
11548
  b = data[i + 2];
@@ -11581,7 +11565,7 @@
11581
11565
  if (hasRequiredHSV) return HSV;
11582
11566
  hasRequiredHSV = 1;
11583
11567
  Object.defineProperty(HSV, "__esModule", { value: true });
11584
- HSV.HSV = undefined;
11568
+ HSV.HSV = void 0;
11585
11569
  const Factory_1 = requireFactory();
11586
11570
  const Node_1 = requireNode();
11587
11571
  const Validators_1 = requireValidators();
@@ -11618,10 +11602,10 @@
11618
11602
  if (hasRequiredInvert) return Invert;
11619
11603
  hasRequiredInvert = 1;
11620
11604
  Object.defineProperty(Invert, "__esModule", { value: true });
11621
- Invert.Invert = undefined;
11605
+ Invert.Invert = void 0;
11622
11606
  const Invert$1 = function (imageData) {
11623
- const data = imageData.data, len = data.length;
11624
- for (let i = 0; i < len; i += 4) {
11607
+ let data = imageData.data, len = data.length, i;
11608
+ for (i = 0; i < len; i += 4) {
11625
11609
  data[i] = 255 - data[i];
11626
11610
  data[i + 1] = 255 - data[i + 1];
11627
11611
  data[i + 2] = 255 - data[i + 2];
@@ -11639,31 +11623,31 @@
11639
11623
  if (hasRequiredKaleidoscope) return Kaleidoscope;
11640
11624
  hasRequiredKaleidoscope = 1;
11641
11625
  Object.defineProperty(Kaleidoscope, "__esModule", { value: true });
11642
- Kaleidoscope.Kaleidoscope = undefined;
11626
+ Kaleidoscope.Kaleidoscope = void 0;
11643
11627
  const Factory_1 = requireFactory();
11644
11628
  const Node_1 = requireNode();
11645
11629
  const Util_1 = requireUtil();
11646
11630
  const Validators_1 = requireValidators();
11647
11631
  const ToPolar = function (src, dst, opt) {
11648
- const srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2;
11649
- let rMax = Math.sqrt(xMid * xMid + yMid * yMid);
11650
- let x = xSize - xMid;
11651
- let y = ySize - yMid;
11652
- const rad = Math.sqrt(x * x + y * y);
11632
+ let srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, r = 0, g = 0, b = 0, a = 0;
11633
+ let rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);
11634
+ x = xSize - xMid;
11635
+ y = ySize - yMid;
11636
+ rad = Math.sqrt(x * x + y * y);
11653
11637
  rMax = rad > rMax ? rad : rMax;
11654
- const rSize = ySize, tSize = xSize;
11655
- const conversion = ((360 / tSize) * Math.PI) / 180;
11656
- for (let theta = 0; theta < tSize; theta += 1) {
11657
- const sin = Math.sin(theta * conversion);
11658
- const cos = Math.cos(theta * conversion);
11659
- for (let radius = 0; radius < rSize; radius += 1) {
11638
+ let rSize = ySize, tSize = xSize, radius, theta;
11639
+ let conversion = ((360 / tSize) * Math.PI) / 180, sin, cos;
11640
+ for (theta = 0; theta < tSize; theta += 1) {
11641
+ sin = Math.sin(theta * conversion);
11642
+ cos = Math.cos(theta * conversion);
11643
+ for (radius = 0; radius < rSize; radius += 1) {
11660
11644
  x = Math.floor(xMid + ((rMax * radius) / rSize) * cos);
11661
11645
  y = Math.floor(yMid + ((rMax * radius) / rSize) * sin);
11662
- let i = (y * xSize + x) * 4;
11663
- const r = srcPixels[i + 0];
11664
- const g = srcPixels[i + 1];
11665
- const b = srcPixels[i + 2];
11666
- const a = srcPixels[i + 3];
11646
+ i = (y * xSize + x) * 4;
11647
+ r = srcPixels[i + 0];
11648
+ g = srcPixels[i + 1];
11649
+ b = srcPixels[i + 2];
11650
+ a = srcPixels[i + 3];
11667
11651
  i = (theta + radius * xSize) * 4;
11668
11652
  dstPixels[i + 0] = r;
11669
11653
  dstPixels[i + 1] = g;
@@ -11673,28 +11657,28 @@
11673
11657
  }
11674
11658
  };
11675
11659
  const FromPolar = function (src, dst, opt) {
11676
- const srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2;
11677
- let rMax = Math.sqrt(xMid * xMid + yMid * yMid);
11678
- let x = xSize - xMid;
11679
- let y = ySize - yMid;
11680
- const rad = Math.sqrt(x * x + y * y);
11660
+ let srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x, y, dx, dy, r = 0, g = 0, b = 0, a = 0;
11661
+ let rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);
11662
+ x = xSize - xMid;
11663
+ y = ySize - yMid;
11664
+ rad = Math.sqrt(x * x + y * y);
11681
11665
  rMax = rad > rMax ? rad : rMax;
11682
- const rSize = ySize, tSize = xSize, phaseShift = 0;
11666
+ let rSize = ySize, tSize = xSize, radius, theta, phaseShift = 0;
11683
11667
  let x1, y1;
11684
11668
  for (x = 0; x < xSize; x += 1) {
11685
11669
  for (y = 0; y < ySize; y += 1) {
11686
- const dx = x - xMid;
11687
- const dy = y - yMid;
11688
- const radius = (Math.sqrt(dx * dx + dy * dy) * rSize) / rMax;
11689
- let theta = ((Math.atan2(dy, dx) * 180) / Math.PI + 360 + phaseShift) % 360;
11670
+ dx = x - xMid;
11671
+ dy = y - yMid;
11672
+ radius = (Math.sqrt(dx * dx + dy * dy) * rSize) / rMax;
11673
+ theta = ((Math.atan2(dy, dx) * 180) / Math.PI + 360 + phaseShift) % 360;
11690
11674
  theta = (theta * tSize) / 360;
11691
11675
  x1 = Math.floor(theta);
11692
11676
  y1 = Math.floor(radius);
11693
- let i = (y1 * xSize + x1) * 4;
11694
- const r = srcPixels[i + 0];
11695
- const g = srcPixels[i + 1];
11696
- const b = srcPixels[i + 2];
11697
- const a = srcPixels[i + 3];
11677
+ i = (y1 * xSize + x1) * 4;
11678
+ r = srcPixels[i + 0];
11679
+ g = srcPixels[i + 1];
11680
+ b = srcPixels[i + 2];
11681
+ a = srcPixels[i + 3];
11698
11682
  i = (y * xSize + x) * 4;
11699
11683
  dstPixels[i + 0] = r;
11700
11684
  dstPixels[i + 1] = g;
@@ -11769,7 +11753,7 @@
11769
11753
  sectionSize *= 2;
11770
11754
  }
11771
11755
  }
11772
- FromPolar(scratchData, imageData, { });
11756
+ FromPolar(scratchData, imageData, { polarRotation: 0 });
11773
11757
  };
11774
11758
  Kaleidoscope.Kaleidoscope = Kaleidoscope$1;
11775
11759
  Factory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopePower', 2, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
@@ -11785,7 +11769,7 @@
11785
11769
  if (hasRequiredMask) return Mask;
11786
11770
  hasRequiredMask = 1;
11787
11771
  Object.defineProperty(Mask, "__esModule", { value: true });
11788
- Mask.Mask = undefined;
11772
+ Mask.Mask = void 0;
11789
11773
  const Factory_1 = requireFactory();
11790
11774
  const Node_1 = requireNode();
11791
11775
  const Validators_1 = requireValidators();
@@ -11916,8 +11900,7 @@
11916
11900
  return maskResult;
11917
11901
  }
11918
11902
  const Mask$1 = function (imageData) {
11919
- const threshold = this.threshold();
11920
- let mask = backgroundMask(imageData, threshold);
11903
+ let threshold = this.threshold(), mask = backgroundMask(imageData, threshold);
11921
11904
  if (mask) {
11922
11905
  mask = erodeMask(mask, imageData.width, imageData.height);
11923
11906
  mask = dilateMask(mask, imageData.width, imageData.height);
@@ -11939,7 +11922,7 @@
11939
11922
  if (hasRequiredNoise) return Noise;
11940
11923
  hasRequiredNoise = 1;
11941
11924
  Object.defineProperty(Noise, "__esModule", { value: true });
11942
- Noise.Noise = undefined;
11925
+ Noise.Noise = void 0;
11943
11926
  const Factory_1 = requireFactory();
11944
11927
  const Node_1 = requireNode();
11945
11928
  const Validators_1 = requireValidators();
@@ -11964,7 +11947,7 @@
11964
11947
  if (hasRequiredPixelate) return Pixelate;
11965
11948
  hasRequiredPixelate = 1;
11966
11949
  Object.defineProperty(Pixelate, "__esModule", { value: true });
11967
- Pixelate.Pixelate = undefined;
11950
+ Pixelate.Pixelate = void 0;
11968
11951
  const Factory_1 = requireFactory();
11969
11952
  const Util_1 = requireUtil();
11970
11953
  const Node_1 = requireNode();
@@ -12037,13 +12020,13 @@
12037
12020
  if (hasRequiredPosterize) return Posterize;
12038
12021
  hasRequiredPosterize = 1;
12039
12022
  Object.defineProperty(Posterize, "__esModule", { value: true });
12040
- Posterize.Posterize = undefined;
12023
+ Posterize.Posterize = void 0;
12041
12024
  const Factory_1 = requireFactory();
12042
12025
  const Node_1 = requireNode();
12043
12026
  const Validators_1 = requireValidators();
12044
12027
  const Posterize$1 = function (imageData) {
12045
- const levels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels;
12046
- for (let i = 0; i < len; i += 1) {
12028
+ let levels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels, i;
12029
+ for (i = 0; i < len; i += 1) {
12047
12030
  data[i] = Math.floor(data[i] / scale) * scale;
12048
12031
  }
12049
12032
  };
@@ -12060,14 +12043,15 @@
12060
12043
  if (hasRequiredRGB) return RGB;
12061
12044
  hasRequiredRGB = 1;
12062
12045
  Object.defineProperty(RGB, "__esModule", { value: true });
12063
- RGB.RGB = undefined;
12046
+ RGB.RGB = void 0;
12064
12047
  const Factory_1 = requireFactory();
12065
12048
  const Node_1 = requireNode();
12066
12049
  const Validators_1 = requireValidators();
12067
12050
  const RGB$1 = function (imageData) {
12068
- const data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue();
12069
- for (let i = 0; i < nPixels; i += 4) {
12070
- const brightness = (0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]) / 255;
12051
+ let data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), i, brightness;
12052
+ for (i = 0; i < nPixels; i += 4) {
12053
+ brightness =
12054
+ (0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]) / 255;
12071
12055
  data[i] = brightness * red;
12072
12056
  data[i + 1] = brightness * green;
12073
12057
  data[i + 2] = brightness * blue;
@@ -12111,7 +12095,7 @@
12111
12095
  if (hasRequiredRGBA) return RGBA;
12112
12096
  hasRequiredRGBA = 1;
12113
12097
  Object.defineProperty(RGBA, "__esModule", { value: true });
12114
- RGBA.RGBA = undefined;
12098
+ RGBA.RGBA = void 0;
12115
12099
  const Factory_1 = requireFactory();
12116
12100
  const Node_1 = requireNode();
12117
12101
  const Validators_1 = requireValidators();
@@ -12173,13 +12157,13 @@
12173
12157
  if (hasRequiredSepia) return Sepia;
12174
12158
  hasRequiredSepia = 1;
12175
12159
  Object.defineProperty(Sepia, "__esModule", { value: true });
12176
- Sepia.Sepia = undefined;
12160
+ Sepia.Sepia = void 0;
12177
12161
  const Sepia$1 = function (imageData) {
12178
- const data = imageData.data, nPixels = data.length;
12179
- for (let i = 0; i < nPixels; i += 4) {
12180
- const r = data[i + 0];
12181
- const g = data[i + 1];
12182
- const b = data[i + 2];
12162
+ let data = imageData.data, nPixels = data.length, i, r, g, b;
12163
+ for (i = 0; i < nPixels; i += 4) {
12164
+ r = data[i + 0];
12165
+ g = data[i + 1];
12166
+ b = data[i + 2];
12183
12167
  data[i + 0] = Math.min(255, r * 0.393 + g * 0.769 + b * 0.189);
12184
12168
  data[i + 1] = Math.min(255, r * 0.349 + g * 0.686 + b * 0.168);
12185
12169
  data[i + 2] = Math.min(255, r * 0.272 + g * 0.534 + b * 0.131);
@@ -12197,7 +12181,7 @@
12197
12181
  if (hasRequiredSolarize) return Solarize;
12198
12182
  hasRequiredSolarize = 1;
12199
12183
  Object.defineProperty(Solarize, "__esModule", { value: true });
12200
- Solarize.Solarize = undefined;
12184
+ Solarize.Solarize = void 0;
12201
12185
  const Solarize$1 = function (imageData) {
12202
12186
  const data = imageData.data, w = imageData.width, h = imageData.height, w4 = w * 4;
12203
12187
  let y = h;
@@ -12236,7 +12220,7 @@
12236
12220
  if (hasRequiredThreshold) return Threshold;
12237
12221
  hasRequiredThreshold = 1;
12238
12222
  Object.defineProperty(Threshold, "__esModule", { value: true });
12239
- Threshold.Threshold = undefined;
12223
+ Threshold.Threshold = void 0;
12240
12224
  const Factory_1 = requireFactory();
12241
12225
  const Node_1 = requireNode();
12242
12226
  const Validators_1 = requireValidators();
@@ -12257,7 +12241,7 @@
12257
12241
  if (hasRequired_FullInternals) return _FullInternals;
12258
12242
  hasRequired_FullInternals = 1;
12259
12243
  Object.defineProperty(_FullInternals, "__esModule", { value: true });
12260
- _FullInternals.Konva = undefined;
12244
+ _FullInternals.Konva = void 0;
12261
12245
  const _CoreInternals_1 = require_CoreInternals();
12262
12246
  const Arc_1 = requireArc();
12263
12247
  const Arrow_1 = requireArrow();
@@ -12427,8 +12411,8 @@
12427
12411
  const konvaPoints = [];
12428
12412
  params.points.forEach((point => konvaPoints.push(point.x, point.y)));
12429
12413
  this._ref = new Konva.Line({
12430
- stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12431
- strokeWidth: (_b = params.width) !== null && _b !== undefined ? _b : 4,
12414
+ stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12415
+ strokeWidth: (_b = params.width) !== null && _b !== void 0 ? _b : 4,
12432
12416
  globalCompositeOperation: "source-over",
12433
12417
  lineCap: "round",
12434
12418
  lineJoin: "round",
@@ -12535,12 +12519,12 @@
12535
12519
  x: params.position.x,
12536
12520
  y: params.position.y,
12537
12521
  text: params.text,
12538
- fontSize: (_a = params.fontSize) !== null && _a !== undefined ? _a : 34,
12522
+ fontSize: (_a = params.fontSize) !== null && _a !== void 0 ? _a : 34,
12539
12523
  fontFamily: this.TEXT_FONT_FAMILY,
12540
- fill: (_b = params.color) !== null && _b !== undefined ? _b : "#ff0000",
12524
+ fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
12541
12525
  align: "left",
12542
12526
  draggable: true,
12543
- rotation: (_c = params.rotation) !== null && _c !== undefined ? _c : 0
12527
+ rotation: (_c = params.rotation) !== null && _c !== void 0 ? _c : 0
12544
12528
  });
12545
12529
  this._ref.width(this._ref.getTextWidth());
12546
12530
  this._ref.on("transform", (e => {
@@ -12638,15 +12622,15 @@
12638
12622
  y: 100
12639
12623
  };
12640
12624
  this._ref = new Konva.Rect({
12641
- stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12642
- strokeWidth: (_b = params.lineWidth) !== null && _b !== undefined ? _b : 4,
12625
+ stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12626
+ strokeWidth: (_b = params.lineWidth) !== null && _b !== void 0 ? _b : 4,
12643
12627
  globalCompositeOperation: "source-over",
12644
12628
  lineCap: "round",
12645
12629
  lineJoin: "round",
12646
12630
  x: params.position.x,
12647
12631
  y: params.position.y,
12648
- width: (_c = params.width) !== null && _c !== undefined ? _c : 200,
12649
- height: (_d = params.height) !== null && _d !== undefined ? _d : 200,
12632
+ width: (_c = params.width) !== null && _c !== void 0 ? _c : 200,
12633
+ height: (_d = params.height) !== null && _d !== void 0 ? _d : 200,
12650
12634
  draggable: true,
12651
12635
  strokeScaleEnabled: false
12652
12636
  });
@@ -12756,8 +12740,8 @@
12756
12740
  y: 25
12757
12741
  };
12758
12742
  this._ref = new Konva.Ellipse({
12759
- stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12760
- strokeWidth: (_b = params.lineWidth) !== null && _b !== undefined ? _b : 4,
12743
+ stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12744
+ strokeWidth: (_b = params.lineWidth) !== null && _b !== void 0 ? _b : 4,
12761
12745
  globalCompositeOperation: "source-over",
12762
12746
  lineCap: "round",
12763
12747
  lineJoin: "round",
@@ -12886,8 +12870,8 @@
12886
12870
  y: 100
12887
12871
  };
12888
12872
  this._ref = new Konva.Arrow({
12889
- stroke: (_a = params.color) !== null && _a !== undefined ? _a : "#ff0000",
12890
- fill: (_b = params.color) !== null && _b !== undefined ? _b : "#ff0000",
12873
+ stroke: (_a = params.color) !== null && _a !== void 0 ? _a : "#ff0000",
12874
+ fill: (_b = params.color) !== null && _b !== void 0 ? _b : "#ff0000",
12891
12875
  strokeWidth: 4,
12892
12876
  globalCompositeOperation: "source-over",
12893
12877
  lineCap: "round",
@@ -13027,8 +13011,8 @@
13027
13011
  x: params.position.x,
13028
13012
  y: params.position.y,
13029
13013
  image: this._canvasImage,
13030
- width: (_a = params.width) !== null && _a !== undefined ? _a : 0,
13031
- height: (_b = params.height) !== null && _b !== undefined ? _b : 0,
13014
+ width: (_a = params.width) !== null && _a !== void 0 ? _a : 0,
13015
+ height: (_b = params.height) !== null && _b !== void 0 ? _b : 0,
13032
13016
  draggable: true
13033
13017
  });
13034
13018
  this._ref.on("transform", (e => {
@@ -13138,10 +13122,10 @@
13138
13122
  this._ref = new Konva.Shape({
13139
13123
  x: params.position.x,
13140
13124
  y: params.position.y,
13141
- width: (_a = params.width) !== null && _a !== undefined ? _a : 200,
13142
- height: (_b = params.height) !== null && _b !== undefined ? _b : 200,
13143
- stroke: (_c = params.color) !== null && _c !== undefined ? _c : "#ff0000",
13144
- strokeWidth: (_d = params.lineWidth) !== null && _d !== undefined ? _d : 4,
13125
+ width: (_a = params.width) !== null && _a !== void 0 ? _a : 200,
13126
+ height: (_b = params.height) !== null && _b !== void 0 ? _b : 200,
13127
+ stroke: (_c = params.color) !== null && _c !== void 0 ? _c : "#ff0000",
13128
+ strokeWidth: (_d = params.lineWidth) !== null && _d !== void 0 ? _d : 4,
13145
13129
  draggable: true,
13146
13130
  strokeScaleEnabled: false,
13147
13131
  globalCompositeOperation: "source-over",
@@ -13390,9 +13374,9 @@
13390
13374
  initialize(container, containerEvents, viewer, worldTransformer) {
13391
13375
  if (!Konva) throw new Error('Markup error: Konva is not initialized. Forgot to add <script src="https://unpkg.com/konva@9/konva.min.js"><\/script> to your page?');
13392
13376
  this._viewer = viewer;
13393
- this._worldTransformer = worldTransformer !== null && worldTransformer !== undefined ? worldTransformer : new WorldTransform;
13377
+ this._worldTransformer = worldTransformer !== null && worldTransformer !== void 0 ? worldTransformer : new WorldTransform;
13394
13378
  this._container = container;
13395
- this._containerEvents = containerEvents !== null && containerEvents !== undefined ? containerEvents : [];
13379
+ this._containerEvents = containerEvents !== null && containerEvents !== void 0 ? containerEvents : [];
13396
13380
  this._markupContainer = document.createElement("div");
13397
13381
  this._markupContainer.id = "markup-container";
13398
13382
  this._markupContainer.style.position = "absolute";
@@ -13420,9 +13404,9 @@
13420
13404
  this._viewer.removeEventListener("changeactivedragger", this.changeActiveDragger);
13421
13405
  }
13422
13406
  this.destroyKonva();
13423
- (_a = this._resizeObserver) === null || _a === undefined ? undefined : _a.disconnect();
13407
+ (_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
13424
13408
  this._resizeObserver = undefined;
13425
- (_b = this._markupContainer) === null || _b === undefined ? undefined : _b.remove();
13409
+ (_b = this._markupContainer) === null || _b === void 0 ? void 0 : _b.remove();
13426
13410
  this._markupContainer = undefined;
13427
13411
  this._container = undefined;
13428
13412
  this._viewer = undefined;
@@ -13454,14 +13438,14 @@
13454
13438
  const hexColor = new MarkupColor(r, g, b).asHex();
13455
13439
  this.getObjects().filter((obj => {
13456
13440
  var _a;
13457
- return (_a = obj.setColor) === null || _a === undefined ? undefined : _a.call(obj, hexColor);
13441
+ return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor);
13458
13442
  }));
13459
13443
  }
13460
13444
  colorizeSelectedMarkups(r, g, b) {
13461
13445
  const hexColor = new MarkupColor(r, g, b).asHex();
13462
13446
  this.getSelectedObjects().filter((obj => {
13463
13447
  var _a;
13464
- return (_a = obj.setColor) === null || _a === undefined ? undefined : _a.call(obj, hexColor);
13448
+ return (_a = obj.setColor) === null || _a === void 0 ? void 0 : _a.call(obj, hexColor);
13465
13449
  }));
13466
13450
  }
13467
13451
  setViewpoint(viewpoint) {
@@ -13477,13 +13461,13 @@
13477
13461
  x: 0,
13478
13462
  y: 0
13479
13463
  });
13480
- const markupColor = ((_a = viewpoint.custom_fields) === null || _a === undefined ? undefined : _a.markup_color) || {
13464
+ const markupColor = ((_a = viewpoint.custom_fields) === null || _a === void 0 ? void 0 : _a.markup_color) || {
13481
13465
  r: 255,
13482
13466
  g: 0,
13483
13467
  b: 0
13484
13468
  };
13485
13469
  this.setMarkupColor(markupColor.r, markupColor.g, markupColor.b);
13486
- (_b = viewpoint.lines) === null || _b === undefined ? undefined : _b.forEach((line => {
13470
+ (_b = viewpoint.lines) === null || _b === void 0 ? void 0 : _b.forEach((line => {
13487
13471
  const linePoints = [];
13488
13472
  line.points.forEach((point => {
13489
13473
  const screenPoint = this._worldTransformer.worldToScreen(point);
@@ -13492,28 +13476,28 @@
13492
13476
  }));
13493
13477
  this.addLine(linePoints, line.color, line.type, line.width, line.id);
13494
13478
  }));
13495
- (_c = viewpoint.texts) === null || _c === undefined ? undefined : _c.forEach((text => {
13479
+ (_c = viewpoint.texts) === null || _c === void 0 ? void 0 : _c.forEach((text => {
13496
13480
  const screenPoint = this._worldTransformer.worldToScreen(text.position);
13497
13481
  this.addText(text.text, screenPoint, text.angle, text.color, text.text_size, text.font_size, text.id);
13498
13482
  }));
13499
- (_d = viewpoint.rectangles) === null || _d === undefined ? undefined : _d.forEach((rect => {
13483
+ (_d = viewpoint.rectangles) === null || _d === void 0 ? void 0 : _d.forEach((rect => {
13500
13484
  const screenPoint = this._worldTransformer.worldToScreen(rect.position);
13501
13485
  this.addRectangle(screenPoint, rect.width, rect.height, rect.line_width, rect.color, rect.id);
13502
13486
  }));
13503
- (_e = viewpoint.ellipses) === null || _e === undefined ? undefined : _e.forEach((ellipse => {
13487
+ (_e = viewpoint.ellipses) === null || _e === void 0 ? void 0 : _e.forEach((ellipse => {
13504
13488
  const screenPoint = this._worldTransformer.worldToScreen(ellipse.position);
13505
13489
  this.addEllipse(screenPoint, ellipse.radius, ellipse.line_width, ellipse.color, ellipse.id);
13506
13490
  }));
13507
- (_f = viewpoint.arrows) === null || _f === undefined ? undefined : _f.forEach((arrow => {
13491
+ (_f = viewpoint.arrows) === null || _f === void 0 ? void 0 : _f.forEach((arrow => {
13508
13492
  const startPoint = this._worldTransformer.worldToScreen(arrow.start);
13509
13493
  const endPoint = this._worldTransformer.worldToScreen(arrow.end);
13510
13494
  this.addArrow(startPoint, endPoint, arrow.color, arrow.id);
13511
13495
  }));
13512
- (_g = viewpoint.clouds) === null || _g === undefined ? undefined : _g.forEach((cloud => {
13496
+ (_g = viewpoint.clouds) === null || _g === void 0 ? void 0 : _g.forEach((cloud => {
13513
13497
  const screenPoint = this._worldTransformer.worldToScreen(cloud.position);
13514
13498
  this.addCloud(screenPoint, cloud.width, cloud.height, cloud.line_width, cloud.color, cloud.id);
13515
13499
  }));
13516
- (_h = viewpoint.images) === null || _h === undefined ? undefined : _h.forEach((image => {
13500
+ (_h = viewpoint.images) === null || _h === void 0 ? void 0 : _h.forEach((image => {
13517
13501
  const screenPoint = this._worldTransformer.worldToScreen(image.position);
13518
13502
  this.addImage(screenPoint, image.src, image.width, image.height, image.id);
13519
13503
  }));
@@ -13807,7 +13791,7 @@
13807
13791
  this.removeTextInput();
13808
13792
  this.removeImageInput();
13809
13793
  this.clearOverlay();
13810
- (_a = this._konvaStage) === null || _a === undefined ? undefined : _a.destroy();
13794
+ (_a = this._konvaStage) === null || _a === void 0 ? void 0 : _a.destroy();
13811
13795
  this._groupImages = undefined;
13812
13796
  this._groupGeometry = undefined;
13813
13797
  this._groupTexts = undefined;
@@ -14057,7 +14041,7 @@
14057
14041
  }
14058
14042
  removeTextInput() {
14059
14043
  var _a;
14060
- (_a = this._textInputRef) === null || _a === undefined ? undefined : _a.remove();
14044
+ (_a = this._textInputRef) === null || _a === void 0 ? void 0 : _a.remove();
14061
14045
  this._textInputRef = null;
14062
14046
  this._textInputPos = null;
14063
14047
  this._textInputAngle = 0;
@@ -14100,14 +14084,14 @@
14100
14084
  }
14101
14085
  removeImageInput() {
14102
14086
  var _a;
14103
- (_a = this._imageInputRef) === null || _a === undefined ? undefined : _a.remove();
14087
+ (_a = this._imageInputRef) === null || _a === void 0 ? void 0 : _a.remove();
14104
14088
  this._imageInputRef = null;
14105
14089
  this._imageInputPos = null;
14106
14090
  }
14107
14091
  addText(text, position, angle, color, textSize, fontSize, id) {
14108
14092
  var _a;
14109
14093
  if (!text) return;
14110
- (_a = this.getSelectedObjects().at(0)) === null || _a === undefined ? undefined : _a.delete();
14094
+ (_a = this.getSelectedObjects().at(0)) === null || _a === void 0 ? void 0 : _a.delete();
14111
14095
  this.clearSelected();
14112
14096
  this.removeTextInput();
14113
14097
  const tolerance = 1e-6;
@@ -14182,7 +14166,7 @@
14182
14166
  addImage(position, src, width, height, id) {
14183
14167
  var _a;
14184
14168
  if (!position || !src) return;
14185
- (_a = this.getSelectedObjects().at(0)) === null || _a === undefined ? undefined : _a.delete();
14169
+ (_a = this.getSelectedObjects().at(0)) === null || _a === void 0 ? void 0 : _a.delete();
14186
14170
  this.clearSelected();
14187
14171
  this.removeImageInput();
14188
14172
  const konvaImage = new KonvaImage({
@@ -14205,7 +14189,7 @@
14205
14189
  var _a;
14206
14190
  const extView = this.m_module.getViewer().getActiveTvExtendedView();
14207
14191
  extView.setView(params.position, params.target, params.upVector, params.viewFieldWidth, params.viewFieldHeight, params.perspective);
14208
- (_a = extView.delete) === null || _a === undefined ? undefined : _a.call(extView);
14192
+ (_a = extView.delete) === null || _a === void 0 ? void 0 : _a.call(extView);
14209
14193
  };
14210
14194
  this.getViewParams = () => {
14211
14195
  var _a;
@@ -14218,7 +14202,7 @@
14218
14202
  viewFieldHeight: view.viewFieldHeight,
14219
14203
  perspective: view.perspective,
14220
14204
  };
14221
- (_a = view.delete) === null || _a === undefined ? undefined : _a.call(view);
14205
+ (_a = view.delete) === null || _a === void 0 ? void 0 : _a.call(view);
14222
14206
  return obj;
14223
14207
  };
14224
14208
  this.m_module = module;
@@ -14451,7 +14435,7 @@
14451
14435
  deleteAll(objects) {
14452
14436
  var _a;
14453
14437
  for (const obj of objects) {
14454
- (_a = obj === null || obj === undefined ? undefined : obj.delete) === null || _a === undefined ? undefined : _a.call(obj);
14438
+ (_a = obj === null || obj === void 0 ? void 0 : obj.delete) === null || _a === void 0 ? void 0 : _a.call(obj);
14455
14439
  }
14456
14440
  }
14457
14441
  updatePreview() { }
@@ -14819,7 +14803,7 @@
14819
14803
  };
14820
14804
  this.items = [];
14821
14805
  this.canvasEvents.push("resize");
14822
- this.oldRulerUnit = (_a = subject.options.rulerUnit) !== null && _a !== undefined ? _a : "Default";
14806
+ this.oldRulerUnit = (_a = subject.options.rulerUnit) !== null && _a !== void 0 ? _a : "Default";
14823
14807
  this.optionsChange = this.optionsChange.bind(this);
14824
14808
  }
14825
14809
  initialize() {
@@ -14933,7 +14917,7 @@
14933
14917
  optionsChange(event) {
14934
14918
  var _a;
14935
14919
  const options = event.data;
14936
- const toUnitName = (_a = options.rulerUnit) !== null && _a !== undefined ? _a : "Default";
14920
+ const toUnitName = (_a = options.rulerUnit) !== null && _a !== void 0 ? _a : "Default";
14937
14921
  if (this.oldRulerUnit === toUnitName)
14938
14922
  return;
14939
14923
  this.oldRulerUnit = toUnitName;
@@ -15053,7 +15037,7 @@
15053
15037
  const model = this.viewer.getActiveModel();
15054
15038
  model.removeEntity(this.cameraId);
15055
15039
  model.delete();
15056
- (_a = this.cameraWalker) === null || _a === undefined ? undefined : _a.delete();
15040
+ (_a = this.cameraWalker) === null || _a === void 0 ? void 0 : _a.delete();
15057
15041
  }
15058
15042
  if (this.viewParams) {
15059
15043
  this.setViewParams(this.viewParams);
@@ -15451,7 +15435,7 @@
15451
15435
  const extView = this.getViewer().getActiveTvExtendedView();
15452
15436
  extView.setView(viewParams.position, viewParams.target, viewParams.upVector, viewParams.viewFieldWidth, viewParams.viewFieldHeight, viewParams.perspective);
15453
15437
  extView.delete();
15454
- (_b = (_a = this._subject.activeDragger()) === null || _a === undefined ? undefined : _a.updatePreview) === null || _b === undefined ? undefined : _b.call(_a);
15438
+ (_b = (_a = this._subject.activeDragger()) === null || _a === void 0 ? void 0 : _a.updatePreview) === null || _b === void 0 ? void 0 : _b.call(_a);
15455
15439
  }
15456
15440
  endAction() {
15457
15441
  this._endInteractivity();
@@ -15560,7 +15544,7 @@
15560
15544
  deleteAll(objects) {
15561
15545
  var _a;
15562
15546
  for (const obj of objects) {
15563
- (_a = obj === null || obj === undefined ? undefined : obj.delete) === null || _a === undefined ? undefined : _a.call(obj);
15547
+ (_a = obj === null || obj === void 0 ? void 0 : obj.delete) === null || _a === void 0 ? void 0 : _a.call(obj);
15564
15548
  }
15565
15549
  }
15566
15550
  }
@@ -15646,7 +15630,7 @@
15646
15630
  targetWithDelta.delete();
15647
15631
  position.delete();
15648
15632
  positionWithDelta.delete();
15649
- (_b = (_a = this._subject.activeDragger()) === null || _a === undefined ? undefined : _a.updatePreview) === null || _b === undefined ? undefined : _b.call(_a);
15633
+ (_b = (_a = this._subject.activeDragger()) === null || _a === void 0 ? void 0 : _a.updatePreview) === null || _b === void 0 ? void 0 : _b.call(_a);
15650
15634
  this._subject.emitEvent({
15651
15635
  type: "pan",
15652
15636
  x: absoluteX,
@@ -15718,7 +15702,7 @@
15718
15702
  const viewer = this._m_module.getViewer();
15719
15703
  viewer.zoomAt(zoomFactor, x, y);
15720
15704
  this._subject.deviceAutoRegeneration();
15721
- (_b = (_a = this._subject.activeDragger()) === null || _a === undefined ? undefined : _a.updatePreview) === null || _b === undefined ? undefined : _b.call(_a);
15705
+ (_b = (_a = this._subject.activeDragger()) === null || _a === void 0 ? void 0 : _a.updatePreview) === null || _b === void 0 ? void 0 : _b.call(_a);
15722
15706
  this._subject.emitEvent({
15723
15707
  type: "zoomat",
15724
15708
  data: zoomFactor,
@@ -16131,41 +16115,35 @@
16131
16115
  *
16132
16116
  * 1. Define a dragger class implements {@link IDragger}.
16133
16117
  * 2. Define a constructor with a `viewer` parameter and add mouse event listeners for the specified viewer.
16134
- * 3. Define the dragger logic in the event listeners. For example, listen for the `mousemove` event and
16135
- * zoom in/out when the left mouse button is pressed.
16118
+ * 3. Define the dragger logic in the event listeners. For example, listen for the `mousemove`
16119
+ * event and zoom in/out when the left mouse button is pressed.
16136
16120
  * 4. Override {@link IDragger.dispose} and remove mouse event listeners from the viewer.
16137
16121
  * 5. Register dragger provider in the draggers registry by calling the {@link draggers.registerDragger}.
16138
16122
  *
16139
- * @example Implementing a custom dragger.
16123
+ * @example <caption>Implementing a custom dragger.</caption>
16124
+ * import { IDragger, draggers, Viewer } from "@inweb/viewer-visualize";
16140
16125
  *
16141
- * ```javascript
16142
- * import { IDragger, draggers, Viewer } from "@inweb/viewer-visualize";
16126
+ * class MyDragger implements IDragger {
16127
+ * protected viewer: Viewer;
16143
16128
  *
16144
- * class MyDragger implements IDragger {
16145
- * protected viewer: Viewer;
16129
+ * constructor(viewer: Viewer) {
16130
+ * this.viewer = viewer;
16131
+ * this.viewer.addEventListener("pointermove", this.onPointerMove);
16132
+ * }
16146
16133
  *
16147
- * constructor(viewer: Viewer) {
16148
- * this.viewer = viewer;
16149
- * this.viewer.addEventListener("pointermove", this.onPointerMove);
16150
- * }
16134
+ * override dispose() {
16135
+ * this.viewer.removeEventListener("pointermove", this.onPointerMove);
16136
+ * }
16151
16137
  *
16152
- * override dispose() {
16153
- * this.viewer.removeEventListener("pointermove", this.onPointerMove);
16138
+ * onPointerMove = (event: PointerEvent) => {
16139
+ * // place custom logic here
16140
+ * };
16154
16141
  * }
16155
16142
  *
16156
- * onPointerMove = (event: PointerEvent) => {
16157
- * // place custom logic here
16158
- * };
16159
- * }
16160
- *
16161
- * draggers.registerDragger("MyDragger", (viewer): IDragger => new MyDragger(viewer));
16162
- * ```
16143
+ * draggers.registerDragger("MyDragger", (viewer): IDragger => new MyDragger(viewer));
16163
16144
  *
16164
- * @example Activating a custom dragger.
16165
- *
16166
- * ```javascript
16167
- * viewer.setActiveDragger("MyDragger");
16168
- * ```
16145
+ * @example <caption>Activating a custom dragger.</caption>
16146
+ * viewer.setActiveDragger("MyDragger");
16169
16147
  */
16170
16148
  const draggers = draggersRegistry("visualizejs");
16171
16149
  // build-in draggers
@@ -16233,7 +16211,7 @@
16233
16211
  }
16234
16212
  }
16235
16213
  modelItr.delete();
16236
- (_a = visViewer.clearViewExtentsCache) === null || _a === undefined ? undefined : _a.call(visViewer);
16214
+ (_a = visViewer.clearViewExtentsCache) === null || _a === void 0 ? void 0 : _a.call(visViewer);
16237
16215
  viewer.update();
16238
16216
  }
16239
16217
 
@@ -16346,7 +16324,7 @@
16346
16324
  var _a;
16347
16325
  if (!viewer.visualizeJs)
16348
16326
  return "";
16349
- return ((_a = viewer.canvas) === null || _a === undefined ? undefined : _a.toDataURL(type, encoderOptions)) || "";
16327
+ return ((_a = viewer.canvas) === null || _a === void 0 ? void 0 : _a.toDataURL(type, encoderOptions)) || "";
16350
16328
  }
16351
16329
 
16352
16330
  ///////////////////////////////////////////////////////////////////////////////
@@ -16786,7 +16764,7 @@
16786
16764
  const visLib = viewer.visLib();
16787
16765
  const visViewer = visLib.getViewer();
16788
16766
  const selectionSet = new visLib.OdTvSelectionSet();
16789
- handles === null || handles === undefined ? undefined : handles.forEach((handle) => {
16767
+ handles === null || handles === void 0 ? void 0 : handles.forEach((handle) => {
16790
16768
  const entityId = visViewer.getEntityByOriginalHandle(handle + "");
16791
16769
  if (!entityId.isNull())
16792
16770
  selectionSet.appendEntity(entityId);
@@ -16898,7 +16876,7 @@
16898
16876
  if (!entityId.isNull())
16899
16877
  selectionSet.appendEntity(entityId);
16900
16878
  });
16901
- (_a = visViewer.zoomToObjects) === null || _a === undefined ? undefined : _a.call(visViewer, selectionSet);
16879
+ (_a = visViewer.zoomToObjects) === null || _a === void 0 ? void 0 : _a.call(visViewer, selectionSet);
16902
16880
  viewer.deviceAutoRegeneration();
16903
16881
  viewer.update();
16904
16882
  viewer.emitEvent({ type: "zoom" });
@@ -16933,7 +16911,7 @@
16933
16911
  return;
16934
16912
  const visViewer = viewer.visViewer();
16935
16913
  const selectionSet = visViewer.getSelected();
16936
- (_a = visViewer.zoomToObjects) === null || _a === undefined ? undefined : _a.call(visViewer, selectionSet);
16914
+ (_a = visViewer.zoomToObjects) === null || _a === void 0 ? void 0 : _a.call(visViewer, selectionSet);
16937
16915
  viewer.deviceAutoRegeneration();
16938
16916
  viewer.update();
16939
16917
  viewer.emitEvent({ type: "zoom" });
@@ -17014,7 +16992,7 @@
17014
16992
  modelPtr.delete();
17015
16993
  }
17016
16994
  modelItr.delete();
17017
- (_a = visViewer.clearViewExtentsCache) === null || _a === undefined ? undefined : _a.call(visViewer);
16995
+ (_a = visViewer.clearViewExtentsCache) === null || _a === void 0 ? void 0 : _a.call(visViewer);
17018
16996
  viewer.update();
17019
16997
  }
17020
16998
 
@@ -17048,23 +17026,17 @@
17048
17026
  * 1. Define a command handler with a first `viewer` parameter.
17049
17027
  * 2. Register command handler in the commands registry by calling the {@link commands.registerCommand}.
17050
17028
  *
17051
- * @example Implementing a custom command.
17052
- *
17053
- * ```javascript
17054
- * import { commands, Viewer } from "@inweb/viewer-visualize";
17029
+ * @example <caption>Implementing a custom command.</caption>
17030
+ * import { commands, Viewer } from "@inweb/viewer-visualize";
17055
17031
  *
17056
- * function commandHandler(viewer: Viewer, name = "world"): void {
17057
- * console.log(`Hello ${name}!!!`);
17058
- * }
17059
- *
17060
- * commands.registerCommand("sayHello", commandHandler);
17061
- * ```
17032
+ * function commandHandler(viewer: Viewer, name = "world"): void {
17033
+ * console.log(`Hello ${name}!!!`);
17034
+ * }
17062
17035
  *
17063
- * @example Calling a custom command.
17036
+ * commands.registerCommand("sayHello", commandHandler);
17064
17037
  *
17065
- * ```javascript
17066
- * viewer.executeCommand("sayHello", "user");
17067
- * ```
17038
+ * @example <caption>Calling a custom command.</caption>
17039
+ * viewer.executeCommand("sayHello", "user");
17068
17040
  */
17069
17041
  const commands = commandsRegistry("visualizejs");
17070
17042
  // build-in commands
@@ -17476,36 +17448,36 @@
17476
17448
  *
17477
17449
  * 1. Define a component class implements {@link IComponent}.
17478
17450
  * 2. Define a constructor with a `viewer` parameter and add mouse event listeners for the specified viewer.
17479
- * 3. Define the component logic in the event listeners. For example, listen for the `mousedown` event and
17480
- * select objects when the left mouse button is pressed.
17451
+ * 3. Define the component logic in the event listeners. For example, listen for the `mousedown`
17452
+ * event and select objects when the left mouse button is pressed.
17481
17453
  * 4. Override {@link IComponent.dispose} and remove mouse event listeners from the viewer.
17482
17454
  * 5. Register component provider in the components registry by calling the
17483
17455
  * {@link components.registerComponent}.
17484
17456
  *
17485
- * @example Implementing a custom component.
17457
+ * @example <caption>Implementing a custom component.</caption>
17458
+ * import { IComponent, components, Viewer } from "@inweb/viewer-visualize";
17486
17459
  *
17487
- * ```javascript
17488
- * import { IComponent, components, Viewer } from "@inweb/viewer-visualize";
17460
+ * class MyComponent implements IComponent {
17461
+ * protected viewer: Viewer;
17489
17462
  *
17490
- * class MyComponent implements IComponent {
17491
- * protected viewer: Viewer;
17463
+ * constructor(viewer: Viewer) {
17464
+ * this.viewer = viewer;
17465
+ * this.viewer.addEventListener("mousedown", this.onMouseDown);
17466
+ * }
17492
17467
  *
17493
- * constructor(viewer: Viewer) {
17494
- * this.viewer = viewer;
17495
- * this.viewer.addEventListener("mousedown", this.onMouseDown);
17496
- * }
17468
+ * override dispose() {
17469
+ * this.viewer.removeEventListener("mousedown", this.onMouseDown);
17470
+ * }
17497
17471
  *
17498
- * override dispose() {
17499
- * this.viewer.removeEventListener("mousedown", this.onMouseDown);
17472
+ * onMouseDown = (event: PointerEvent) => {
17473
+ * // place custom logic here
17474
+ * };
17500
17475
  * }
17501
17476
  *
17502
- * onMouseDown = (event: PointerEvent) => {
17503
- * // place custom logic here
17504
- * };
17505
- * }
17506
- *
17507
- * components.registerComponent( "MyComponent", (viewer): IComponent => new MyComponent(viewer));
17508
- * ```
17477
+ * components.registerComponent(
17478
+ * "MyComponent",
17479
+ * (viewer): IComponent => new MyComponent(viewer)
17480
+ * );
17509
17481
  */
17510
17482
  const components = componentsRegistry("visualizejs");
17511
17483
  // build-in components
@@ -18146,7 +18118,7 @@
18146
18118
  dispose() {
18147
18119
  var _a;
18148
18120
  super.dispose();
18149
- (_a = this.textRef) === null || _a === undefined ? undefined : _a.remove();
18121
+ (_a = this.textRef) === null || _a === void 0 ? void 0 : _a.remove();
18150
18122
  this.textRef = null;
18151
18123
  }
18152
18124
  _finishInput() {
@@ -18154,7 +18126,7 @@
18154
18126
  if (this.textRef && this.textRef.value.trimLeft()) {
18155
18127
  this._updateFrame();
18156
18128
  }
18157
- (_a = this.textRef) === null || _a === undefined ? undefined : _a.remove();
18129
+ (_a = this.textRef) === null || _a === void 0 ? void 0 : _a.remove();
18158
18130
  this.textRef = null;
18159
18131
  }
18160
18132
  start(x, y, absoluteX, absoluteY) {
@@ -18199,7 +18171,7 @@
18199
18171
  const projMtrx = view.projectionMatrix;
18200
18172
  const mtrxNumber = projMtrx.get(1, 1);
18201
18173
  const tol = 1.0e-6;
18202
- if (!(mtrxNumber < tol && mtrxNumber > -1e-6)) {
18174
+ if (!(mtrxNumber < tol && mtrxNumber > -tol)) {
18203
18175
  textScale = 1 / mtrxNumber;
18204
18176
  }
18205
18177
  const geomData = entityPtr.appendText(this.toGePoint(this.m_center), this.textRef.value.trimLeft());
@@ -18449,23 +18421,23 @@
18449
18421
  const OVERLAY_VIEW_NAME = "$OVERLAY_VIEW_NAME";
18450
18422
  const isExist = (value) => value !== undefined && value !== null;
18451
18423
  /**
18452
- * 3D viewer powered by {@link https://cloud.opendesign.com/docs/index.html#/visualizejs | VisualizeJS}
18453
- * library.
18424
+ * 3D viewer powered by
18425
+ * {@link https://cloud.opendesign.com/docs/index.html#/visualizejs | VisualizeJS} library.
18454
18426
  */
18455
18427
  class Viewer extends EventEmitter2 {
18456
18428
  /**
18457
- * @param client - The `Client` instance that is used to load model reference files from the Open Cloud
18458
- * Server. Do not specify `Client` if you need a standalone viewer instance to view `VSFX` files from
18459
- * the web or from local computer.
18429
+ * @param client - The `Client` instance that is used to load model reference files from the
18430
+ * Open Cloud Server. Do not specify `Client` if you need a standalone viewer instance to
18431
+ * view `VSFX` files from the web or from local computer.
18460
18432
  * @param params - An object containing viewer configuration parameters.
18461
- * @param params.visualizeJsUrl - `VisualizeJS` library URL. Set this URL to use your own library
18462
- * instance, or specify `undefined` or blank to use the default URL defined by `Viewer.visualize`
18463
- * library you are using.
18464
- * @param params.enableAutoUpdate - Enable auto-update of the viewer after any changes. If the
18465
- * auto-update is disabled, you need to register an `update` event handler and update the
18466
- * `VisualizeJS` viewer and active dragger manually. Default is `true`.
18467
- * @param params.markupType - The type of the markup core: `Visualize` (deprecated) or `Konva`. Default
18468
- * is `Konva`.
18433
+ * @param params.visualizeJsUrl - `VisualizeJS` library URL. Set this URL to use your own
18434
+ * library instance, or specify `undefined` or blank to use the default URL defined by
18435
+ * `Viewer.visualize` library you are using.
18436
+ * @param params.enableAutoUpdate - Enable auto-update of the viewer after any changes. If
18437
+ * the auto-update is disabled, you need to register an `update` event handler and update
18438
+ * the `VisualizeJS` viewer and active dragger manually. Default is `true`.
18439
+ * @param params.markupType - The type of the markup core: `Visualize` (deprecated) or
18440
+ * `Konva`. Default is `Konva`.
18469
18441
  */
18470
18442
  constructor(client, params = {}) {
18471
18443
  var _a;
@@ -18479,7 +18451,7 @@
18479
18451
  this._renderTime = 0;
18480
18452
  this.canvasEvents = CANVAS_EVENTS.slice();
18481
18453
  this.canvaseventlistener = (event) => this.emit(event);
18482
- this._enableAutoUpdate = (_a = params.enableAutoUpdate) !== null && _a !== undefined ? _a : true;
18454
+ this._enableAutoUpdate = (_a = params.enableAutoUpdate) !== null && _a !== void 0 ? _a : true;
18483
18455
  this._isNeedRender = false;
18484
18456
  this._isRunAsyncUpdate = false;
18485
18457
  this.render = this.render.bind(this);
@@ -18512,12 +18484,12 @@
18512
18484
  * Changes the viewer parameters.
18513
18485
  *
18514
18486
  * @param params - An object containing new parameters.
18515
- * @param params.visualizeJsUrl - `VisualizeJS` library URL. Set this URL to use your own library
18516
- * instance or specify `undefined` or blank to use the default URL defined by `Viewer.visualize`
18517
- * library you are using.
18487
+ * @param params.visualizeJsUrl - `VisualizeJS` library URL. Set this URL to use your own
18488
+ * library instance or specify `undefined` or blank to use the default URL defined by
18489
+ * `Viewer.visualize` library you are using.
18518
18490
  */
18519
18491
  configure(params) {
18520
- this._visualizeJsUrl = params.visualizeJsUrl || "https://public-fhemb7e3embacwec.z02.azurefd.net/libs/visualizejs/master/Visualize.js";
18492
+ this._visualizeJsUrl = params.visualizeJsUrl || "https://public-fhemb7e3embacwec.z02.azurefd.net/libs/visualizejs/26.1/Visualize.js";
18521
18493
  return this;
18522
18494
  }
18523
18495
  /**
@@ -18530,10 +18502,10 @@
18530
18502
  * - {@link InitializeProgressEvent | initializeprogress}
18531
18503
  *
18532
18504
  * @param canvas -
18533
- * {@link https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement | HTMLCanvasElement} for
18534
- * `VisualizeJS`.
18535
- * @param onProgress - A callback function that handles events measuring progress of loading of the
18536
- * `VisualizeJS` library.
18505
+ * {@link https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement | HTMLCanvasElement}
18506
+ * for `VisualizeJS`.
18507
+ * @param onProgress - A callback function that handles events measuring progress of loading
18508
+ * of the `VisualizeJS` library.
18537
18509
  */
18538
18510
  async initialize(canvas, onProgress) {
18539
18511
  this.addEventListener("optionschange", (event) => this.syncOptions(event.data));
@@ -18562,7 +18534,7 @@
18562
18534
  this.canvas = canvas;
18563
18535
  this.canvasEvents.forEach((x) => canvas.addEventListener(x, this.canvaseventlistener));
18564
18536
  this._markup.initialize(this.canvas, this.canvasEvents, this, this);
18565
- for (const name of components.getComponents().keys()) {
18537
+ for (let name of components.getComponents().keys()) {
18566
18538
  this._components.push(components.createComponent(name, this));
18567
18539
  }
18568
18540
  this.syncOpenCloudVisualStyle(true);
@@ -18607,7 +18579,7 @@
18607
18579
  const visViewer = this.visualizeJs.getViewer();
18608
18580
  if (visViewer.isRunningAnimation() || this._isNeedRender) {
18609
18581
  visViewer.update();
18610
- (_b = (_a = this._activeDragger) === null || _a === undefined ? undefined : _a.updatePreview) === null || _b === undefined ? undefined : _b.call(_a);
18582
+ (_b = (_a = this._activeDragger) === null || _a === void 0 ? void 0 : _a.updatePreview) === null || _b === void 0 ? void 0 : _b.call(_a);
18611
18583
  this._isNeedRender = !visViewer.getActiveDevice().isValid();
18612
18584
  const deltaTime = (time - this._renderTime) / 1000;
18613
18585
  this._renderTime = time;
@@ -18631,22 +18603,22 @@
18631
18603
  /**
18632
18604
  * Updates the viewer.
18633
18605
  *
18634
- * Do nothing if the auto-update mode is disabled in the constructor. In this case, register an
18635
- * `update` event handler and update the `Visualize` viewer and active dragger manually.
18606
+ * Do nothing if the auto-update mode is disabled in the constructor. In this case, register
18607
+ * an `update` event handler and update the `Visualize` viewer and active dragger manually.
18636
18608
  *
18637
18609
  * Fires:
18638
18610
  *
18639
18611
  * - {@link UpdateEvent | update}
18640
18612
  *
18641
- * @param force - If `true` updates the viewer immidietly. Otherwise updates on next animation frame.
18642
- * Default is `false`.
18613
+ * @param force - If `true` updates the viewer immidietly. Otherwise updates on next
18614
+ * animation frame. Default is `false`.
18643
18615
  */
18644
18616
  update(force = false) {
18645
18617
  var _a, _b, _c;
18646
18618
  if (this._enableAutoUpdate) {
18647
18619
  if (force) {
18648
- (_a = this.visViewer()) === null || _a === undefined ? undefined : _a.update();
18649
- (_c = (_b = this._activeDragger) === null || _b === undefined ? undefined : _b.updatePreview) === null || _c === undefined ? undefined : _c.call(_b);
18620
+ (_a = this.visViewer()) === null || _a === void 0 ? void 0 : _a.update();
18621
+ (_c = (_b = this._activeDragger) === null || _b === void 0 ? void 0 : _b.updatePreview) === null || _c === void 0 ? void 0 : _c.call(_b);
18650
18622
  }
18651
18623
  else {
18652
18624
  this._isNeedRender = true;
@@ -18674,11 +18646,11 @@
18674
18646
  });
18675
18647
  }
18676
18648
  /**
18677
- * Updates the viewer asynchronously without locking the user interface. Used to update the viewer
18678
- * after changes that require a long rendering time.
18649
+ * Updates the viewer asynchronously without locking the user interface. Used to update the
18650
+ * viewer after changes that require a long rendering time.
18679
18651
  *
18680
- * Do nothing if the auto-update mode is disabled in the constructor. In this case, register an
18681
- * `update` event handler and update the `VisualizeJS` viewer and active dragger manually.
18652
+ * Do nothing if the auto-update mode is disabled in the constructor. In this case, register
18653
+ * an `update` event handler and update the `VisualizeJS` viewer and active dragger manually.
18682
18654
  *
18683
18655
  * Fires:
18684
18656
  *
@@ -18704,26 +18676,26 @@
18704
18676
  }
18705
18677
  }
18706
18678
  /**
18707
- * Returns `VisualizeJS` {@link https://cloud.opendesign.com/docs/index.html#/visualizejs_api | module}
18708
- * instance.
18679
+ * Returns `VisualizeJS`
18680
+ * {@link https://cloud.opendesign.com/docs/index.html#/visualizejs_api | module} instance.
18709
18681
  */
18710
18682
  get visualizeJs() {
18711
18683
  return this._visualizeJs;
18712
18684
  }
18713
18685
  /**
18714
- * Returns `VisualizeJS` {@link https://cloud.opendesign.com/docs/index.html#/visualizejs_api | module}
18715
- * instance.
18686
+ * Returns `VisualizeJS`
18687
+ * {@link https://cloud.opendesign.com/docs/index.html#/visualizejs_api | module} instance.
18716
18688
  */
18717
18689
  visLib() {
18718
18690
  return this.visualizeJs;
18719
18691
  }
18720
18692
  /**
18721
- * Returns `VisualizeJS` {@link https://cloud.opendesign.com/docs/index.html#/vis/Viewer | Viewer}
18722
- * instance.
18693
+ * Returns `VisualizeJS`
18694
+ * {@link https://cloud.opendesign.com/docs/index.html#/vis/Viewer | Viewer} instance.
18723
18695
  */
18724
18696
  visViewer() {
18725
18697
  var _a;
18726
- return (_a = this.visualizeJs) === null || _a === undefined ? undefined : _a.getViewer();
18698
+ return (_a = this.visualizeJs) === null || _a === void 0 ? void 0 : _a.getViewer();
18727
18699
  }
18728
18700
  // update the VisualizeJS options
18729
18701
  syncOpenCloudVisualStyle(isInitializing) {
@@ -18885,7 +18857,7 @@
18885
18857
  newDragger = draggers.createDragger(name, this);
18886
18858
  if (newDragger) {
18887
18859
  this._activeDragger = newDragger;
18888
- (_b = (_a = this._activeDragger).initialize) === null || _b === undefined ? undefined : _b.call(_a);
18860
+ (_b = (_a = this._activeDragger).initialize) === null || _b === void 0 ? void 0 : _b.call(_a);
18889
18861
  }
18890
18862
  }
18891
18863
  const canvas = this.canvas;
@@ -18984,13 +18956,13 @@
18984
18956
  const projMatrix = this.visViewer().activeView.projectionMatrix;
18985
18957
  const tolerance = 1.0e-6;
18986
18958
  const x = projMatrix.get(0, 0);
18987
- if (x > tolerance || x < -1e-6)
18959
+ if (x > tolerance || x < -tolerance)
18988
18960
  result.x = 1 / x;
18989
18961
  const y = projMatrix.get(1, 1);
18990
- if (y > tolerance || y < -1e-6)
18962
+ if (y > tolerance || y < -tolerance)
18991
18963
  result.y = 1 / y;
18992
18964
  const z = projMatrix.get(2, 2);
18993
- if (z > tolerance || z < -1e-6)
18965
+ if (z > tolerance || z < -tolerance)
18994
18966
  result.z = 1 / z;
18995
18967
  return result;
18996
18968
  }
@@ -19026,7 +18998,7 @@
19026
18998
  if (!this.client)
19027
18999
  return this;
19028
19000
  const abortController = new AbortController();
19029
- (_a = this._abortControllerForReferences) === null || _a === undefined ? undefined : _a.abort();
19001
+ (_a = this._abortControllerForReferences) === null || _a === void 0 ? void 0 : _a.abort();
19030
19002
  this._abortControllerForReferences = abortController;
19031
19003
  let references = [];
19032
19004
  await model
@@ -19036,7 +19008,7 @@
19036
19008
  for (const file of references) {
19037
19009
  await this.client
19038
19010
  .downloadFile(file.id, undefined, abortController.signal)
19039
- .then((arrayBuffer) => { var _a; return (_a = this.visualizeJs) === null || _a === undefined ? undefined : _a.getViewer().addEmbeddedFile(file.name, new Uint8Array(arrayBuffer)); })
19011
+ .then((arrayBuffer) => { var _a; return (_a = this.visualizeJs) === null || _a === void 0 ? void 0 : _a.getViewer().addEmbeddedFile(file.name, new Uint8Array(arrayBuffer)); })
19040
19012
  .catch((e) => console.error(`Cannot load reference file ${file.name}.`, e));
19041
19013
  }
19042
19014
  return this;
@@ -19064,15 +19036,15 @@
19064
19036
  *
19065
19037
  * The file geometry data on the server must be converted to `VSFX` format.
19066
19038
  *
19067
- * To open a large file, enable {@link IOptions.enablePartialMode | partial streaming} mode before
19068
- * opening (see example below).
19039
+ * To open a large file, enable {@link IOptions.enablePartialMode | partial streaming} mode
19040
+ * before opening (see example below).
19069
19041
  *
19070
- * This method requires a `Client` instance to be specified when creating the viewer to load model
19071
- * reference files from the Open Cloud Server. For a standalone viewer instance use
19042
+ * This method requires a `Client` instance to be specified when creating the viewer to load
19043
+ * model reference files from the Open Cloud Server. For a standalone viewer instance use
19072
19044
  * {@link openVsfFile | openVsfFile()} or {@link openVsfxFile | openVsfxFile()}.
19073
19045
  *
19074
- * If there was an active dragger before opening the file, it will be deactivated. After opening the
19075
- * file, you must manually activate the required dragger.
19046
+ * If there was an active dragger before opening the file, it will be deactivated. After
19047
+ * opening the file, you must manually activate the required dragger.
19076
19048
  *
19077
19049
  * Fires:
19078
19050
  *
@@ -19084,17 +19056,14 @@
19084
19056
  * - {@link GeometryEndEvent | geometryend}
19085
19057
  * - {@link GeometryErrorEvent | geometryerror}
19086
19058
  *
19087
- * @example Using partial streaming mode to open a large file from a server.
19088
- *
19089
- * ```javascript
19090
- * viewer.options.enableStreamingMode = true;
19091
- * viewer.options.enablePartialMode = true;
19092
- * await viewer.open(file);
19093
- * ```
19059
+ * @example <caption>Using partial streaming mode to open a large file from a server.</caption>
19060
+ * viewer.options.enableStreamingMode = true;
19061
+ * viewer.options.enablePartialMode = true;
19062
+ * await viewer.open(file);
19094
19063
  *
19095
- * @param file - File, assembly or specific model to load. If a `File` instance with multiple models is
19096
- * specified, the default model will be loaded. If there is no default model, first availiable model
19097
- * will be loaded.
19064
+ * @param file - File, assembly or specific model to load. If a `File` instance with multiple
19065
+ * models is specified, the default model will be loaded. If there is no default model,
19066
+ * first availiable model will be loaded.
19098
19067
  */
19099
19068
  async open(file) {
19100
19069
  if (!this.visualizeJs)
@@ -19132,8 +19101,8 @@
19132
19101
  * This method does not support {@link IOptions.enableStreamingMode | streaming} or
19133
19102
  * {@link IOptions.enablePartialMode | partial streaming} mode.
19134
19103
  *
19135
- * If there was an active dragger before opening the file, it will be deactivated. After opening the
19136
- * file, you must manually activate the required dragger.
19104
+ * If there was an active dragger before opening the file, it will be deactivated. After
19105
+ * opening the file, you must manually activate the required dragger.
19137
19106
  *
19138
19107
  * Fires:
19139
19108
  *
@@ -19178,8 +19147,8 @@
19178
19147
  * This method does not support {@link IOptions.enableStreamingMode | streaming} or
19179
19148
  * {@link IOptions.enablePartialMode | partial streaming} mode.
19180
19149
  *
19181
- * If there was an active dragger before opening the file, it will be deactivated. After opening the
19182
- * file, you must manually activate the required dragger.
19150
+ * If there was an active dragger before opening the file, it will be deactivated. After
19151
+ * opening the file, you must manually activate the required dragger.
19183
19152
  *
19184
19153
  * Fires:
19185
19154
  *
@@ -19220,11 +19189,11 @@
19220
19189
  }
19221
19190
  cancel() {
19222
19191
  var _a, _b, _c;
19223
- (_a = this._abortControllerForReferences) === null || _a === undefined ? undefined : _a.abort();
19192
+ (_a = this._abortControllerForReferences) === null || _a === void 0 ? void 0 : _a.abort();
19224
19193
  this._abortControllerForReferences = undefined;
19225
- (_b = this._abortController) === null || _b === undefined ? undefined : _b.abort();
19194
+ (_b = this._abortController) === null || _b === void 0 ? void 0 : _b.abort();
19226
19195
  this._abortController = undefined;
19227
- (_c = this._abortControllerForRequestMap) === null || _c === undefined ? undefined : _c.forEach((controller) => controller.abort());
19196
+ (_c = this._abortControllerForRequestMap) === null || _c === void 0 ? void 0 : _c.forEach((controller) => controller.abort());
19228
19197
  this._abortControllerForRequestMap = undefined;
19229
19198
  this.emitEvent({ type: "cancel" });
19230
19199
  return this;
@@ -19297,7 +19266,7 @@
19297
19266
  var _a;
19298
19267
  if (!this.visualizeJs)
19299
19268
  return;
19300
- const draggerName = (_a = this._activeDragger) === null || _a === undefined ? undefined : _a.name;
19269
+ const draggerName = (_a = this._activeDragger) === null || _a === void 0 ? void 0 : _a.name;
19301
19270
  this.setActiveDragger();
19302
19271
  this.clearSlices();
19303
19272
  this.clearOverlay();
@@ -19339,7 +19308,6 @@
19339
19308
  up_vector: this.getPoint3dFromArray(activeView.upVector),
19340
19309
  field_width: activeView.viewFieldWidth,
19341
19310
  field_height: activeView.viewFieldHeight,
19342
- view_to_world_scale: 1,
19343
19311
  };
19344
19312
  }
19345
19313
  setOrthogonalCameraSettings(settings) {
@@ -19380,11 +19348,11 @@
19380
19348
  return this.getSelected().map((handle) => ({ handle }));
19381
19349
  }
19382
19350
  setSelection(selection) {
19383
- this.setSelected(selection === null || selection === undefined ? undefined : selection.map((component) => component.handle));
19351
+ this.setSelected(selection === null || selection === void 0 ? void 0 : selection.map((component) => component.handle));
19384
19352
  }
19385
19353
  /**
19386
- * Executes the command denoted by the given command. If the command is not found, tries to set active
19387
- * dragger with the specified name.
19354
+ * Executes the command denoted by the given command. If the command is not found, tries to
19355
+ * set active dragger with the specified name.
19388
19356
  *
19389
19357
  * The following commands are available by default:
19390
19358
  *
@@ -19416,8 +19384,8 @@
19416
19384
  *
19417
19385
  * @param id - Command ID or dragger name.
19418
19386
  * @param args - Parameters passed to the command handler function.
19419
- * @returns Returns the result of the command handler function or new active dragger instance. Returns
19420
- * `undefined` if neither the command nor the dragger exists.
19387
+ * @returns Returns the result of the command handler function or new active dragger
19388
+ * instance. Returns `undefined` if neither the command nor the dragger exists.
19421
19389
  */
19422
19390
  executeCommand(id, ...args) {
19423
19391
  return commands.executeCommand(id, this, ...args);