microboard-temp 0.4.57 → 0.4.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/node.js CHANGED
@@ -1271,8 +1271,8 @@ var require_tinyqueue = __commonJS((exports, module) => {
1271
1271
  }
1272
1272
  }
1273
1273
  };
1274
- TinyQueue.prototype.push = function push(item) {
1275
- this.data.push(item);
1274
+ TinyQueue.prototype.push = function push(item2) {
1275
+ this.data.push(item2);
1276
1276
  this.length++;
1277
1277
  this._up(this.length - 1);
1278
1278
  };
@@ -1296,24 +1296,24 @@ var require_tinyqueue = __commonJS((exports, module) => {
1296
1296
  var ref = this;
1297
1297
  var data = ref.data;
1298
1298
  var compare = ref.compare;
1299
- var item = data[pos];
1299
+ var item2 = data[pos];
1300
1300
  while (pos > 0) {
1301
1301
  var parent = pos - 1 >> 1;
1302
1302
  var current = data[parent];
1303
- if (compare(item, current) >= 0) {
1303
+ if (compare(item2, current) >= 0) {
1304
1304
  break;
1305
1305
  }
1306
1306
  data[pos] = current;
1307
1307
  pos = parent;
1308
1308
  }
1309
- data[pos] = item;
1309
+ data[pos] = item2;
1310
1310
  };
1311
1311
  TinyQueue.prototype._down = function _down(pos) {
1312
1312
  var ref = this;
1313
1313
  var data = ref.data;
1314
1314
  var compare = ref.compare;
1315
1315
  var halfLength = this.length >> 1;
1316
- var item = data[pos];
1316
+ var item2 = data[pos];
1317
1317
  while (pos < halfLength) {
1318
1318
  var left = (pos << 1) + 1;
1319
1319
  var best = data[left];
@@ -1322,13 +1322,13 @@ var require_tinyqueue = __commonJS((exports, module) => {
1322
1322
  left = right;
1323
1323
  best = data[right];
1324
1324
  }
1325
- if (compare(best, item) >= 0) {
1325
+ if (compare(best, item2) >= 0) {
1326
1326
  break;
1327
1327
  }
1328
1328
  data[pos] = best;
1329
1329
  pos = left;
1330
1330
  }
1331
- data[pos] = item;
1331
+ data[pos] = item2;
1332
1332
  };
1333
1333
  function defaultCompare2(a, b) {
1334
1334
  return a < b ? -1 : a > b ? 1 : 0;
@@ -1419,8 +1419,8 @@ class BoardCommand {
1419
1419
  switch (operation.method) {
1420
1420
  case "bringToFront": {
1421
1421
  for (const id in operation.prevZIndex) {
1422
- const item = this.board.items.getById(id);
1423
- if (!item) {
1422
+ const item2 = this.board.items.getById(id);
1423
+ if (!item2) {
1424
1424
  delete operation.prevZIndex.id;
1425
1425
  }
1426
1426
  }
@@ -1432,8 +1432,8 @@ class BoardCommand {
1432
1432
  }
1433
1433
  case "sendToBack": {
1434
1434
  for (const id in operation.prevZIndex) {
1435
- const item = this.board.items.getById(id);
1436
- if (!item) {
1435
+ const item2 = this.board.items.getById(id);
1436
+ if (!item2) {
1437
1437
  delete operation.prevZIndex.id;
1438
1438
  }
1439
1439
  }
@@ -1447,11 +1447,11 @@ class BoardCommand {
1447
1447
  case "moveSecondBeforeFirst":
1448
1448
  case "moveToZIndex": {
1449
1449
  const items = this.board.items;
1450
- const item = items.getById(operation.item);
1451
- if (!item) {
1450
+ const item2 = items.getById(operation.item);
1451
+ if (!item2) {
1452
1452
  throw new Error("Get reverse board operation. Item not found");
1453
1453
  }
1454
- const zIndex = this.board.getZIndex(item);
1454
+ const zIndex = this.board.getZIndex(item2);
1455
1455
  return {
1456
1456
  class: "Board",
1457
1457
  method: "moveToZIndex",
@@ -1461,8 +1461,8 @@ class BoardCommand {
1461
1461
  }
1462
1462
  case "moveManyToZIndex": {
1463
1463
  for (const id in operation.item) {
1464
- const item = this.board.items.getById(id);
1465
- if (!item) {
1464
+ const item2 = this.board.items.getById(id);
1465
+ if (!item2) {
1466
1466
  delete operation.item.id;
1467
1467
  }
1468
1468
  }
@@ -1479,15 +1479,15 @@ class BoardCommand {
1479
1479
  const items = this.board.items;
1480
1480
  const reverse = [];
1481
1481
  for (const itemId of operation.item) {
1482
- const item = items.getById(itemId);
1483
- if (!item) {
1482
+ const item2 = items.getById(itemId);
1483
+ if (!item2) {
1484
1484
  throw new Error("Get reverse board operation. Item not found");
1485
1485
  }
1486
1486
  reverse.push({
1487
1487
  class: "Board",
1488
1488
  method: "add",
1489
1489
  item: itemId,
1490
- data: item.serialize()
1490
+ data: item2.serialize()
1491
1491
  });
1492
1492
  }
1493
1493
  return reverse;
@@ -1510,32 +1510,32 @@ class BoardCommand {
1510
1510
  const items = this.board.items;
1511
1511
  const reverse = [];
1512
1512
  for (const itemId of operation.item) {
1513
- const item = items.getById(itemId);
1514
- if (!item || item.itemType !== "Group") {
1513
+ const item2 = items.getById(itemId);
1514
+ if (!item2 || item2.itemType !== "Group") {
1515
1515
  throw new Error("Get reverse board operation. Item not found");
1516
1516
  }
1517
1517
  reverse.push({
1518
1518
  class: "Board",
1519
1519
  method: "addLockedGroup",
1520
1520
  item: itemId,
1521
- data: item.serialize()
1521
+ data: item2.serialize()
1522
1522
  });
1523
1523
  }
1524
1524
  return reverse;
1525
1525
  }
1526
1526
  case "duplicate":
1527
1527
  case "paste": {
1528
- const item = [];
1528
+ const item2 = [];
1529
1529
  const map = operation.itemsMap;
1530
1530
  for (const key in map) {
1531
1531
  if (map.hasOwnProperty(key)) {
1532
- item.push(key);
1532
+ item2.push(key);
1533
1533
  }
1534
1534
  }
1535
1535
  return {
1536
1536
  class: "Board",
1537
1537
  method: "remove",
1538
- item
1538
+ item: item2
1539
1539
  };
1540
1540
  }
1541
1541
  }
@@ -7853,11 +7853,11 @@ class SubjectOperation {
7853
7853
  }
7854
7854
 
7855
7855
  // src/Items/ItemsCommandUtils.ts
7856
- function mapItemsByOperation(item, getCallback) {
7857
- const items = Array.isArray(item) ? item : [item];
7858
- return items.map((item2) => {
7859
- const operation = getCallback(item2);
7860
- return { item: item2, operation };
7856
+ function mapItemsByOperation(item2, getCallback) {
7857
+ const items = Array.isArray(item2) ? item2 : [item2];
7858
+ return items.map((item3) => {
7859
+ const operation = getCallback(item3);
7860
+ return { item: item3, operation };
7861
7861
  });
7862
7862
  }
7863
7863
 
@@ -7882,8 +7882,8 @@ class TransformationCommand {
7882
7882
  }
7883
7883
  }
7884
7884
  revert() {
7885
- this.reverse.forEach(({ item, operation }) => {
7886
- item.apply(operation);
7885
+ this.reverse.forEach(({ item: item2, operation }) => {
7886
+ item2.apply(operation);
7887
7887
  });
7888
7888
  }
7889
7889
  getReverse() {
@@ -8625,8 +8625,8 @@ class Path {
8625
8625
  }
8626
8626
  getIntersectionPoints(segment) {
8627
8627
  let intersections = [];
8628
- for (const item of this.segments) {
8629
- intersections = intersections.concat(item.getIntersectionPoints(segment));
8628
+ for (const item2 of this.segments) {
8629
+ intersections = intersections.concat(item2.getIntersectionPoints(segment));
8630
8630
  }
8631
8631
  return intersections;
8632
8632
  }
@@ -8691,8 +8691,8 @@ class Path {
8691
8691
  }
8692
8692
  isOpenEnclosedOrCrossedBy(rectangle) {
8693
8693
  let is = false;
8694
- for (const item of this.segments) {
8695
- is = is || item.isEnclosedOrCrossedBy(rectangle);
8694
+ for (const item2 of this.segments) {
8695
+ is = is || item2.isEnclosedOrCrossedBy(rectangle);
8696
8696
  }
8697
8697
  return is;
8698
8698
  }
@@ -9105,8 +9105,8 @@ class ConnectorCommand {
9105
9105
  }
9106
9106
  }
9107
9107
  revert() {
9108
- for (const { item, operation } of this.reverse) {
9109
- item.apply(operation);
9108
+ for (const { item: item2, operation } of this.reverse) {
9109
+ item2.apply(operation);
9110
9110
  }
9111
9111
  }
9112
9112
  getReverse() {
@@ -9263,11 +9263,11 @@ class SessionStorage {
9263
9263
  }
9264
9264
  get(key) {
9265
9265
  const boardId = this.getBoardId() || "";
9266
- const item = _sessionStorage.getItem(boardId + "_" + key);
9267
- if (!item) {
9266
+ const item2 = _sessionStorage.getItem(boardId + "_" + key);
9267
+ if (!item2) {
9268
9268
  return;
9269
9269
  }
9270
- return JSON.parse(item);
9270
+ return JSON.parse(item2);
9271
9271
  }
9272
9272
  remove(key) {
9273
9273
  const boardId = this.getBoardId() || "";
@@ -10052,8 +10052,8 @@ class LinkToCommand {
10052
10052
  }
10053
10053
  }
10054
10054
  revert() {
10055
- this.reverse.forEach(({ item, operation }) => {
10056
- item.apply(operation);
10055
+ this.reverse.forEach(({ item: item2, operation }) => {
10056
+ item2.apply(operation);
10057
10057
  });
10058
10058
  }
10059
10059
  getReverse() {
@@ -11390,9 +11390,9 @@ function handleSplitListItem(editor) {
11390
11390
  Transforms2.insertNodes(editor, {
11391
11391
  type: listType,
11392
11392
  listLevel: listNode.listLevel || 0,
11393
- children: itemsAfter.map((item) => ({
11393
+ children: itemsAfter.map((item2) => ({
11394
11394
  type: "list_item",
11395
- children: item.children
11395
+ children: item2.children
11396
11396
  }))
11397
11397
  }, { at: newListPath });
11398
11398
  }
@@ -15250,10 +15250,10 @@ function initializeDocument(effects) {
15250
15250
  return start;
15251
15251
  function start(code) {
15252
15252
  if (continued < stack.length) {
15253
- const item = stack[continued];
15254
- self2.containerState = item[1];
15255
- ok(item[0].continuation, "expected `continuation` to be defined on container construct");
15256
- return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code);
15253
+ const item2 = stack[continued];
15254
+ self2.containerState = item2[1];
15255
+ ok(item2[0].continuation, "expected `continuation` to be defined on container construct");
15256
+ return effects.attempt(item2[0].continuation, documentContinue, checkNewContainers)(code);
15257
15257
  }
15258
15258
  return checkNewContainers(code);
15259
15259
  }
@@ -16229,17 +16229,17 @@ class SpliceBuffer {
16229
16229
  this.setCursor(Number.POSITIVE_INFINITY);
16230
16230
  return this.left.pop();
16231
16231
  }
16232
- push(item) {
16232
+ push(item2) {
16233
16233
  this.setCursor(Number.POSITIVE_INFINITY);
16234
- this.left.push(item);
16234
+ this.left.push(item2);
16235
16235
  }
16236
16236
  pushMany(items) {
16237
16237
  this.setCursor(Number.POSITIVE_INFINITY);
16238
16238
  chunkedPush(this.left, items);
16239
16239
  }
16240
- unshift(item) {
16240
+ unshift(item2) {
16241
16241
  this.setCursor(0);
16242
- this.right.push(item);
16242
+ this.right.push(item2);
16243
16243
  }
16244
16244
  unshiftMany(items) {
16245
16245
  this.setCursor(0);
@@ -18270,8 +18270,8 @@ function initializeFactory(field) {
18270
18270
  if (list2) {
18271
18271
  ok(Array.isArray(list2), "expected `disable.null` to be populated");
18272
18272
  while (++index2 < list2.length) {
18273
- const item = list2[index2];
18274
- if (!item.previous || item.previous.call(self2, self2.previous)) {
18273
+ const item2 = list2[index2];
18274
+ if (!item2.previous || item2.previous.call(self2, self2.previous)) {
18275
18275
  return true;
18276
18276
  }
18277
18277
  }
@@ -19102,14 +19102,14 @@ function compiler(options) {
19102
19102
  length++;
19103
19103
  }
19104
19104
  if (event[1].type === types.listItemPrefix) {
19105
- const item = {
19105
+ const item2 = {
19106
19106
  type: "listItem",
19107
19107
  _spread: false,
19108
19108
  start: Object.assign({}, event[1].start),
19109
19109
  end: undefined
19110
19110
  };
19111
- listItem2 = item;
19112
- events.splice(index2, 0, ["enter", item, event[2]]);
19111
+ listItem2 = item2;
19112
+ events.splice(index2, 0, ["enter", item2, event[2]]);
19113
19113
  index2++;
19114
19114
  length++;
19115
19115
  firstBlankLineIndex = undefined;
@@ -19741,14 +19741,14 @@ class MarkdownProcessor {
19741
19741
  if (err || !file) {
19742
19742
  throw err;
19743
19743
  }
19744
- const nodes = file.result.map((item) => {
19744
+ const nodes = file.result.map((item2) => {
19745
19745
  setNodeStyles({
19746
- node: item,
19746
+ node: item2,
19747
19747
  editor: this.editor,
19748
19748
  horisontalAlignment: "left",
19749
- isPaddingTopNeeded: item.type !== "code_block"
19749
+ isPaddingTopNeeded: item2.type !== "code_block"
19750
19750
  });
19751
- return item;
19751
+ return item2;
19752
19752
  });
19753
19753
  if (isNewParagraphNeeded) {
19754
19754
  nodes.push(createParagraphNode("", this.editor));
@@ -20726,8 +20726,8 @@ class ShapeCommand {
20726
20726
  }
20727
20727
  }
20728
20728
  revert() {
20729
- for (const { item, operation } of this.reverse) {
20730
- item.apply(operation);
20729
+ for (const { item: item2, operation } of this.reverse) {
20730
+ item2.apply(operation);
20731
20731
  }
20732
20732
  }
20733
20733
  getReverse() {
@@ -20809,8 +20809,8 @@ class RichTextCommand {
20809
20809
  }
20810
20810
  }
20811
20811
  revert() {
20812
- for (const { item, operation } of this.reverse) {
20813
- const richText = this.board.items.getById(item);
20812
+ for (const { item: item2, operation } of this.reverse) {
20813
+ const richText = this.board.items.getById(item2);
20814
20814
  if (!richText) {
20815
20815
  continue;
20816
20816
  }
@@ -20829,12 +20829,12 @@ class RichTextCommand {
20829
20829
  case "setSelectionFontColor":
20830
20830
  case "setSelectionBlockType":
20831
20831
  const inverseOps = this.operation.ops.map((op) => Operation2.inverse(op)).reverse();
20832
- return items.map((item) => {
20832
+ return items.map((item2) => {
20833
20833
  const operation = {
20834
20834
  ...this.operation,
20835
20835
  ops: inverseOps
20836
20836
  };
20837
- return { item, operation };
20837
+ return { item: item2, operation };
20838
20838
  });
20839
20839
  case "setFontColor":
20840
20840
  return items.map((id) => ({
@@ -20926,13 +20926,13 @@ class RichTextGroupCommand {
20926
20926
  this.reverseOps = this.getReverse();
20927
20927
  }
20928
20928
  apply() {
20929
- for (const { item, operation } of this.forwardOps) {
20930
- item.applyCommand(operation);
20929
+ for (const { item: item2, operation } of this.forwardOps) {
20930
+ item2.applyCommand(operation);
20931
20931
  }
20932
20932
  }
20933
20933
  revert() {
20934
- for (const { item, operation } of this.reverseOps) {
20935
- item.applyCommand(operation);
20934
+ for (const { item: item2, operation } of this.reverseOps) {
20935
+ item2.applyCommand(operation);
20936
20936
  }
20937
20937
  }
20938
20938
  getForward() {
@@ -21047,8 +21047,8 @@ class DrawingCommand {
21047
21047
  item;
21048
21048
  operation;
21049
21049
  reverse;
21050
- constructor(item, operation) {
21051
- this.item = item;
21050
+ constructor(item2, operation) {
21051
+ this.item = item2;
21052
21052
  this.operation = operation;
21053
21053
  this.reverse = this.getReverse();
21054
21054
  }
@@ -21057,52 +21057,52 @@ class DrawingCommand {
21057
21057
  return this;
21058
21058
  }
21059
21059
  apply() {
21060
- for (const item of this.item) {
21061
- item.apply(this.operation);
21060
+ for (const item2 of this.item) {
21061
+ item2.apply(this.operation);
21062
21062
  }
21063
21063
  }
21064
21064
  revert() {
21065
- for (const { item, operation } of this.reverse) {
21066
- item.apply(operation);
21065
+ for (const { item: item2, operation } of this.reverse) {
21066
+ item2.apply(operation);
21067
21067
  }
21068
21068
  }
21069
21069
  getReverse() {
21070
21070
  const reverse = [];
21071
- for (const item of this.item) {
21072
- reverse.push({ item, operation: this.getReverseOperation(item) });
21071
+ for (const item2 of this.item) {
21072
+ reverse.push({ item: item2, operation: this.getReverseOperation(item2) });
21073
21073
  }
21074
21074
  return reverse;
21075
21075
  }
21076
- getReverseOperation(item) {
21076
+ getReverseOperation(item2) {
21077
21077
  switch (this.operation.method) {
21078
21078
  case "setStrokeColor":
21079
21079
  return {
21080
21080
  class: "Drawing",
21081
21081
  method: "setStrokeColor",
21082
- item: [item.getId()],
21083
- color: item.getStrokeColor()
21082
+ item: [item2.getId()],
21083
+ color: item2.getStrokeColor()
21084
21084
  };
21085
21085
  case "setStrokeWidth":
21086
21086
  return {
21087
21087
  class: "Drawing",
21088
21088
  method: "setStrokeWidth",
21089
- item: [item.getId()],
21089
+ item: [item2.getId()],
21090
21090
  width: this.operation.prevWidth,
21091
- prevWidth: item.getStrokeWidth()
21091
+ prevWidth: item2.getStrokeWidth()
21092
21092
  };
21093
21093
  case "setStrokeOpacity":
21094
21094
  return {
21095
21095
  class: "Drawing",
21096
21096
  method: "setStrokeOpacity",
21097
- item: [item.getId()],
21098
- opacity: item.getStrokeOpacity()
21097
+ item: [item2.getId()],
21098
+ opacity: item2.getStrokeOpacity()
21099
21099
  };
21100
21100
  case "setStrokeStyle":
21101
21101
  return {
21102
21102
  class: "Drawing",
21103
21103
  method: "setStrokeStyle",
21104
- item: [item.getId()],
21105
- style: item.getBorderStyle()
21104
+ item: [item2.getId()],
21105
+ style: item2.getBorderStyle()
21106
21106
  };
21107
21107
  }
21108
21108
  }
@@ -21124,8 +21124,8 @@ class StickerCommand {
21124
21124
  }
21125
21125
  }
21126
21126
  revert() {
21127
- for (const { item, operation } of this.reverse) {
21128
- item.apply(operation);
21127
+ for (const { item: item2, operation } of this.reverse) {
21128
+ item2.apply(operation);
21129
21129
  }
21130
21130
  }
21131
21131
  getReverse() {
@@ -21157,8 +21157,8 @@ class FrameCommand {
21157
21157
  }
21158
21158
  }
21159
21159
  revert() {
21160
- for (const { item, operation } of this.reverse) {
21161
- item.apply(operation);
21160
+ for (const { item: item2, operation } of this.reverse) {
21161
+ item2.apply(operation);
21162
21162
  }
21163
21163
  }
21164
21164
  getReverse() {
@@ -21199,6 +21199,22 @@ class FrameCommand {
21199
21199
  children: frame2.getChildrenIds()
21200
21200
  };
21201
21201
  });
21202
+ default:
21203
+ const op = this.operation;
21204
+ let newData = {};
21205
+ if (op.prevData) {
21206
+ newData = { ...op.prevData };
21207
+ } else {
21208
+ Object.keys(op.newData).forEach((key) => {
21209
+ if (item[key]) {
21210
+ newData[key] = item[key];
21211
+ }
21212
+ });
21213
+ }
21214
+ return {
21215
+ ...op,
21216
+ newData
21217
+ };
21202
21218
  }
21203
21219
  }
21204
21220
  }
@@ -21219,8 +21235,8 @@ class CommentCommand {
21219
21235
  }
21220
21236
  }
21221
21237
  revert() {
21222
- this.reverse.forEach(({ item, operation }) => {
21223
- item.apply(operation);
21238
+ this.reverse.forEach(({ item: item2, operation }) => {
21239
+ item2.apply(operation);
21224
21240
  });
21225
21241
  }
21226
21242
  getReverse() {
@@ -21681,8 +21697,8 @@ class GroupCommand {
21681
21697
  }
21682
21698
  }
21683
21699
  revert() {
21684
- for (const { item, operation } of this.reverse) {
21685
- item.apply(operation);
21700
+ for (const { item: item2, operation } of this.reverse) {
21701
+ item2.apply(operation);
21686
21702
  }
21687
21703
  }
21688
21704
  getReverse() {
@@ -21735,8 +21751,8 @@ class PlaceholderCommand {
21735
21751
  }
21736
21752
  }
21737
21753
  revert() {
21738
- for (const { item, operation } of this.reverse) {
21739
- item.apply(operation);
21754
+ for (const { item: item2, operation } of this.reverse) {
21755
+ item2.apply(operation);
21740
21756
  }
21741
21757
  }
21742
21758
  getReverse() {
@@ -21830,26 +21846,26 @@ class BaseCommand {
21830
21846
  return this;
21831
21847
  }
21832
21848
  apply() {
21833
- for (const item of this.items) {
21834
- item.apply(this.operation);
21849
+ for (const item2 of this.items) {
21850
+ item2.apply(this.operation);
21835
21851
  }
21836
21852
  }
21837
21853
  revert() {
21838
- for (const { item, operation } of this.reverse) {
21839
- item.apply(operation);
21854
+ for (const { item: item2, operation } of this.reverse) {
21855
+ item2.apply(operation);
21840
21856
  }
21841
21857
  }
21842
21858
  getReverse() {
21843
21859
  const items = this.items;
21844
- return mapItemsByOperation(items, (item) => {
21860
+ return mapItemsByOperation(items, (item2) => {
21845
21861
  const op = this.operation;
21846
21862
  let newData = {};
21847
21863
  if (op.prevData) {
21848
21864
  newData = { ...op.prevData };
21849
21865
  } else {
21850
21866
  Object.keys(op.newData).forEach((key) => {
21851
- if (item[key]) {
21852
- newData[key] = item[key];
21867
+ if (item2[key]) {
21868
+ newData[key] = item2[key];
21853
21869
  }
21854
21870
  });
21855
21871
  }
@@ -21877,37 +21893,37 @@ var itemCommandFactories = {
21877
21893
  LinkTo: createLinkToCommand
21878
21894
  };
21879
21895
  function createConnectorCommand(items, operation) {
21880
- return new ConnectorCommand(items.filter((item) => item.itemType === "Connector"), operation);
21896
+ return new ConnectorCommand(items.filter((item2) => item2.itemType === "Connector"), operation);
21881
21897
  }
21882
21898
  function createShapeCommand(items, operation) {
21883
- return new ShapeCommand(items.filter((item) => item.itemType === "Shape"), operation);
21899
+ return new ShapeCommand(items.filter((item2) => item2.itemType === "Shape"), operation);
21884
21900
  }
21885
21901
  function createDrawingCommand(items, operation) {
21886
- return new DrawingCommand(items.filter((item) => item.itemType === "Drawing"), operation);
21902
+ return new DrawingCommand(items.filter((item2) => item2.itemType === "Drawing"), operation);
21887
21903
  }
21888
21904
  function createCommentCommand(items, operation) {
21889
- return new CommentCommand(items.filter((item) => item.itemType === "Comment"), operation);
21905
+ return new CommentCommand(items.filter((item2) => item2.itemType === "Comment"), operation);
21890
21906
  }
21891
21907
  function createStickerCommand(items, operation) {
21892
- return new StickerCommand(items.filter((item) => item.itemType === "Sticker"), operation);
21908
+ return new StickerCommand(items.filter((item2) => item2.itemType === "Sticker"), operation);
21893
21909
  }
21894
21910
  function createFrameCommand(items, operation) {
21895
- return new FrameCommand(items.filter((item) => item.itemType === "Frame"), operation);
21911
+ return new FrameCommand(items.filter((item2) => item2.itemType === "Frame"), operation);
21896
21912
  }
21897
21913
  function createPlaceholderCommand(items, operation) {
21898
- return new PlaceholderCommand(items.filter((item) => item.itemType === "Placeholder"), operation);
21914
+ return new PlaceholderCommand(items.filter((item2) => item2.itemType === "Placeholder"), operation);
21899
21915
  }
21900
21916
  function createGroupCommand(items, operation) {
21901
- return new GroupCommand(items.filter((item) => item.itemType === "Group"), operation);
21917
+ return new GroupCommand(items.filter((item2) => item2.itemType === "Group"), operation);
21902
21918
  }
21903
21919
  function createImageCommand(items, operation) {
21904
- return new ImageCommand(items.filter((item) => item.itemType === "Image"), operation);
21920
+ return new ImageCommand(items.filter((item2) => item2.itemType === "Image"), operation);
21905
21921
  }
21906
21922
  function createVideoCommand(items, operation) {
21907
- return new VideoCommand(items.filter((item) => item.itemType === "Video"), operation);
21923
+ return new VideoCommand(items.filter((item2) => item2.itemType === "Video"), operation);
21908
21924
  }
21909
21925
  function createAudioCommand(items, operation) {
21910
- return new AudioCommand(items.filter((item) => item.itemType === "Audio"), operation);
21926
+ return new AudioCommand(items.filter((item2) => item2.itemType === "Audio"), operation);
21911
21927
  }
21912
21928
  function createRichTextCommand(items, operation, board) {
21913
21929
  if (!board) {
@@ -21915,8 +21931,8 @@ function createRichTextCommand(items, operation, board) {
21915
21931
  }
21916
21932
  if (operation.method === "groupEdit") {
21917
21933
  const texts = [];
21918
- for (const { item } of operation.itemsOps) {
21919
- const found = board.items.findById(item);
21934
+ for (const { item: item2 } of operation.itemsOps) {
21935
+ const found = board.items.findById(item2);
21920
21936
  const text3 = found?.getRichText();
21921
21937
  if (text3) {
21922
21938
  texts.push(text3);
@@ -21924,14 +21940,14 @@ function createRichTextCommand(items, operation, board) {
21924
21940
  }
21925
21941
  return new RichTextGroupCommand(texts, operation);
21926
21942
  } else {
21927
- return new RichTextCommand(board, items.map((item) => item.getId()), operation);
21943
+ return new RichTextCommand(board, items.map((item2) => item2.getId()), operation);
21928
21944
  }
21929
21945
  }
21930
21946
  function createTransformationCommand(items, operation) {
21931
- return new TransformationCommand(items.map((item) => item.transformation), operation);
21947
+ return new TransformationCommand(items.map((item2) => item2.transformation), operation);
21932
21948
  }
21933
21949
  function createLinkToCommand(items, operation) {
21934
- return new LinkToCommand(items.map((item) => item.linkTo), operation);
21950
+ return new LinkToCommand(items.map((item2) => item2.linkTo), operation);
21935
21951
  }
21936
21952
  function createCommand(board, operation) {
21937
21953
  try {
@@ -21949,13 +21965,13 @@ function createCommand(board, operation) {
21949
21965
  default: {
21950
21966
  const itemType = operation.class;
21951
21967
  const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : operation.itemsOps.map((itemOp) => itemOp.item);
21952
- const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item) => {
21953
- if (typeof item === "string") {
21954
- console.warn(`Item with ID ${item} not found for operation ${operation.class}.${operation.method}`);
21968
+ const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item2) => {
21969
+ if (typeof item2 === "string") {
21970
+ console.warn(`Item with ID ${item2} not found for operation ${operation.class}.${operation.method}`);
21955
21971
  return false;
21956
21972
  }
21957
- if (operation.class !== "Transformation" && operation.class !== "RichText" && operation.class !== "LinkTo" && item.itemType !== operation.class) {
21958
- console.warn(`Item with ID ${item} is not of operation type: ${itemType}.`);
21973
+ if (operation.class !== "Transformation" && operation.class !== "RichText" && operation.class !== "LinkTo" && item2.itemType !== operation.class) {
21974
+ console.warn(`Item with ID ${item2} is not of operation type: ${itemType}.`);
21959
21975
  return false;
21960
21976
  }
21961
21977
  return true;
@@ -22256,20 +22272,20 @@ class RBush {
22256
22272
  }
22257
22273
  return this;
22258
22274
  }
22259
- insert(item) {
22260
- if (item)
22261
- this._insert(item, this.data.height - 1);
22275
+ insert(item2) {
22276
+ if (item2)
22277
+ this._insert(item2, this.data.height - 1);
22262
22278
  return this;
22263
22279
  }
22264
22280
  clear() {
22265
22281
  this.data = createNode([]);
22266
22282
  return this;
22267
22283
  }
22268
- remove(item, equalsFn) {
22269
- if (!item)
22284
+ remove(item2, equalsFn) {
22285
+ if (!item2)
22270
22286
  return this;
22271
22287
  let node2 = this.data;
22272
- const bbox = this.toBBox(item);
22288
+ const bbox = this.toBBox(item2);
22273
22289
  const path2 = [];
22274
22290
  const indexes = [];
22275
22291
  let i, parent, goingUp;
@@ -22281,7 +22297,7 @@ class RBush {
22281
22297
  goingUp = true;
22282
22298
  }
22283
22299
  if (node2.leaf) {
22284
- const index2 = findItem(item, node2.children, equalsFn);
22300
+ const index2 = findItem(item2, node2.children, equalsFn);
22285
22301
  if (index2 !== -1) {
22286
22302
  node2.children.splice(index2, 1);
22287
22303
  path2.push(node2);
@@ -22304,8 +22320,8 @@ class RBush {
22304
22320
  }
22305
22321
  return this;
22306
22322
  }
22307
- toBBox(item) {
22308
- return item;
22323
+ toBBox(item2) {
22324
+ return item2;
22309
22325
  }
22310
22326
  compareMinX(a, b) {
22311
22327
  return a.minX - b.minX;
@@ -22388,11 +22404,11 @@ class RBush {
22388
22404
  }
22389
22405
  return node2;
22390
22406
  }
22391
- _insert(item, level, isNode) {
22392
- const bbox = isNode ? item : this.toBBox(item);
22407
+ _insert(item2, level, isNode) {
22408
+ const bbox = isNode ? item2 : this.toBBox(item2);
22393
22409
  const insertPath = [];
22394
22410
  const node2 = this._chooseSubtree(bbox, this.data, level, insertPath);
22395
- node2.children.push(item);
22411
+ node2.children.push(item2);
22396
22412
  extend2(node2, bbox);
22397
22413
  while (level >= 0) {
22398
22414
  if (insertPath[level].children.length > this._maxEntries) {
@@ -22491,11 +22507,11 @@ class RBush {
22491
22507
  }
22492
22508
  }
22493
22509
  }
22494
- function findItem(item, items, equalsFn) {
22510
+ function findItem(item2, items, equalsFn) {
22495
22511
  if (!equalsFn)
22496
- return items.indexOf(item);
22512
+ return items.indexOf(item2);
22497
22513
  for (let i = 0;i < items.length; i++) {
22498
- if (equalsFn(item, items[i]))
22514
+ if (equalsFn(item2, items[i]))
22499
22515
  return i;
22500
22516
  }
22501
22517
  return -1;
@@ -22657,10 +22673,10 @@ class RTreeIndex {
22657
22673
  return container ? container.item : undefined;
22658
22674
  }
22659
22675
  remove(id) {
22660
- const item = this.map.get(id);
22661
- if (item) {
22676
+ const item2 = this.map.get(id);
22677
+ if (item2) {
22662
22678
  this.map.delete(id);
22663
- this.tree.remove(item);
22679
+ this.tree.remove(item2);
22664
22680
  }
22665
22681
  }
22666
22682
  list() {
@@ -22732,11 +22748,11 @@ class Container extends Mbr {
22732
22748
  item;
22733
22749
  layer;
22734
22750
  zIndex;
22735
- constructor(id, item, layer, zIndex) {
22736
- const rect = item.getMbrWithChildren();
22751
+ constructor(id, item2, layer, zIndex) {
22752
+ const rect = item2.getMbrWithChildren();
22737
22753
  super(rect.left, rect.top, rect.right, rect.bottom);
22738
22754
  this.id = id;
22739
- this.item = item;
22755
+ this.item = item2;
22740
22756
  this.layer = layer;
22741
22757
  this.zIndex = zIndex;
22742
22758
  }
@@ -22753,7 +22769,7 @@ class LayeredIndex {
22753
22769
  this.getZIndex = this.getZIndex.bind(this);
22754
22770
  this.layers.newOnTop();
22755
22771
  }
22756
- isT(item) {
22772
+ isT(item2) {
22757
22773
  return true;
22758
22774
  }
22759
22775
  findById(id) {
@@ -22817,8 +22833,8 @@ class LayeredIndex {
22817
22833
  }
22818
22834
  getContainersFromItems(items) {
22819
22835
  const containers = [];
22820
- for (const item of items) {
22821
- const container = this.map.get(item.getId());
22836
+ for (const item2 of items) {
22837
+ const container = this.map.get(item2.getId());
22822
22838
  if (container) {
22823
22839
  containers.push(container);
22824
22840
  }
@@ -22895,9 +22911,9 @@ class LayeredIndex {
22895
22911
  }
22896
22912
  }
22897
22913
  }
22898
- insert(item) {
22899
- const toInsert = new Container(item.getId(), item, 0, this.getZIndex(item));
22900
- const bounds = item.getMbrWithChildren();
22914
+ insert(item2) {
22915
+ const toInsert = new Container(item2.getId(), item2, 0, this.getZIndex(item2));
22916
+ const bounds = item2.getMbrWithChildren();
22901
22917
  const inBounds = this.getRectsEnclosedOrCrossedBy(bounds);
22902
22918
  if (inBounds.length === 0) {
22903
22919
  return this.insertContainer(toInsert);
@@ -22964,20 +22980,20 @@ class LayeredIndex {
22964
22980
  }
22965
22981
  }
22966
22982
  }
22967
- change(item) {
22968
- const id = item.getId();
22983
+ change(item2) {
22984
+ const id = item2.getId();
22969
22985
  const container = this.map.get(id);
22970
22986
  if (container) {
22971
22987
  const layer = this.layers.get(container.layer);
22972
22988
  if (layer) {
22973
22989
  layer.remove(id);
22974
22990
  this.map.delete(id);
22975
- this.insert(item);
22991
+ this.insert(item2);
22976
22992
  }
22977
22993
  }
22978
22994
  }
22979
- remove(item) {
22980
- const id = item.getId();
22995
+ remove(item2) {
22996
+ const id = item2.getId();
22981
22997
  const container = this.map.get(id);
22982
22998
  if (container) {
22983
22999
  const layer = this.layers.get(container.layer);
@@ -23003,13 +23019,13 @@ class LayeredIndex {
23003
23019
  return items;
23004
23020
  }
23005
23021
  batchInsert(items) {
23006
- for (const item of items) {
23007
- this.insert(item);
23022
+ for (const item2 of items) {
23023
+ this.insert(item2);
23008
23024
  }
23009
23025
  }
23010
23026
  batchChange(items) {
23011
- for (const item of items) {
23012
- this.change(item);
23027
+ for (const item2 of items) {
23028
+ this.change(item2);
23013
23029
  }
23014
23030
  }
23015
23031
  }
@@ -23018,8 +23034,8 @@ class LayeredIndex {
23018
23034
  class SpatialIndex {
23019
23035
  subject = new Subject;
23020
23036
  itemsArray = [];
23021
- itemsIndex = new LayeredIndex((item) => {
23022
- return this.itemsArray.indexOf(item);
23037
+ itemsIndex = new LayeredIndex((item2) => {
23038
+ return this.itemsArray.indexOf(item2);
23023
23039
  });
23024
23040
  Mbr = new Mbr;
23025
23041
  items;
@@ -23028,79 +23044,79 @@ class SpatialIndex {
23028
23044
  }
23029
23045
  clear() {
23030
23046
  this.itemsArray = [];
23031
- this.itemsIndex = new LayeredIndex((item) => {
23032
- return this.itemsArray.indexOf(item);
23047
+ this.itemsIndex = new LayeredIndex((item2) => {
23048
+ return this.itemsArray.indexOf(item2);
23033
23049
  });
23034
23050
  this.Mbr = new Mbr;
23035
23051
  }
23036
- insert(item) {
23037
- this.itemsArray.push(item);
23038
- this.itemsIndex.insert(item);
23052
+ insert(item2) {
23053
+ this.itemsArray.push(item2);
23054
+ this.itemsIndex.insert(item2);
23039
23055
  if (conf.isNode()) {
23040
23056
  return;
23041
23057
  }
23042
23058
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
23043
- this.Mbr = item.getMbr().copy();
23059
+ this.Mbr = item2.getMbr().copy();
23044
23060
  } else {
23045
- this.Mbr.combine([item.getMbr()]);
23061
+ this.Mbr.combine([item2.getMbr()]);
23046
23062
  }
23047
- item.subject.subscribe(this.change);
23063
+ item2.subject.subscribe(this.change);
23048
23064
  this.subject.publish(this.items);
23049
23065
  }
23050
- change = (item) => {
23051
- this.itemsIndex.change(item);
23066
+ change = (item2) => {
23067
+ this.itemsIndex.change(item2);
23052
23068
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
23053
- this.Mbr = item.getMbrWithChildren().copy();
23069
+ this.Mbr = item2.getMbrWithChildren().copy();
23054
23070
  } else {
23055
- this.Mbr.combine([item.getMbrWithChildren()]);
23071
+ this.Mbr.combine([item2.getMbrWithChildren()]);
23056
23072
  }
23057
23073
  this.subject.publish(this.items);
23058
23074
  };
23059
- remove(item) {
23060
- if ("index" in item && item.index) {
23061
- item.removeChildItems(item.index.list());
23075
+ remove(item2) {
23076
+ if ("index" in item2 && item2.index) {
23077
+ item2.removeChildItems(item2.index.list());
23062
23078
  }
23063
- this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
23064
- this.itemsIndex.remove(item);
23079
+ this.itemsArray.splice(this.itemsArray.indexOf(item2), 1);
23080
+ this.itemsIndex.remove(item2);
23065
23081
  this.Mbr = new Mbr;
23066
- this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbrWithChildren()]));
23082
+ this.itemsArray.forEach((item3) => this.Mbr.combine([item3.getMbrWithChildren()]));
23067
23083
  this.subject.publish(this.items);
23068
23084
  }
23069
23085
  copy() {
23070
- return this.getItemsWithIncludedChildren(this.itemsArray).map((item) => ({
23071
- ...item.serialize(true),
23072
- id: item.getId()
23086
+ return this.getItemsWithIncludedChildren(this.itemsArray).map((item2) => ({
23087
+ ...item2.serialize(true),
23088
+ id: item2.getId()
23073
23089
  }));
23074
23090
  }
23075
23091
  getItemsWithIncludedChildren(items) {
23076
- return items.flatMap((item) => {
23077
- if ("index" in item && item.index) {
23078
- return [item, ...item.index.list()];
23092
+ return items.flatMap((item2) => {
23093
+ if ("index" in item2 && item2.index) {
23094
+ return [item2, ...item2.index.list()];
23079
23095
  }
23080
- return item;
23096
+ return item2;
23081
23097
  });
23082
23098
  }
23083
- getItemChildren(item) {
23084
- if ("index" in item && item.index) {
23085
- return item.index.list();
23099
+ getItemChildren(item2) {
23100
+ if ("index" in item2 && item2.index) {
23101
+ return item2.index.list();
23086
23102
  }
23087
23103
  return [];
23088
23104
  }
23089
- getItemParent(item) {
23090
- if (item.parent === "Board") {
23105
+ getItemParent(item2) {
23106
+ if (item2.parent === "Board") {
23091
23107
  return;
23092
23108
  }
23093
- return this.getById(item.parent);
23109
+ return this.getById(item2.parent);
23094
23110
  }
23095
- moveToZIndex(item, zIndex) {
23096
- const index2 = this.itemsArray.indexOf(item);
23111
+ moveToZIndex(item2, zIndex) {
23112
+ const index2 = this.itemsArray.indexOf(item2);
23097
23113
  this.itemsArray.splice(index2, 1);
23098
- this.itemsArray.splice(zIndex, 0, item);
23099
- this.change(item);
23114
+ this.itemsArray.splice(zIndex, 0, item2);
23115
+ this.change(item2);
23100
23116
  this.subject.publish(this.items);
23101
23117
  }
23102
23118
  moveManyToZIndex(itemsRecord) {
23103
- const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item) => item !== undefined);
23119
+ const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item2) => item2 !== undefined);
23104
23120
  const zIndex = Object.values(itemsRecord);
23105
23121
  for (let i = 0;i < zIndex.length; i++) {
23106
23122
  const index2 = zIndex[i];
@@ -23108,39 +23124,39 @@ class SpatialIndex {
23108
23124
  }
23109
23125
  this.itemsArray.forEach(this.change.bind(this));
23110
23126
  }
23111
- sendToBack(item, shouldPublish = true) {
23112
- const index2 = this.itemsArray.indexOf(item);
23127
+ sendToBack(item2, shouldPublish = true) {
23128
+ const index2 = this.itemsArray.indexOf(item2);
23113
23129
  this.itemsArray.splice(index2, 1);
23114
- this.itemsArray.unshift(item);
23115
- this.itemsIndex.change(item);
23130
+ this.itemsArray.unshift(item2);
23131
+ this.itemsIndex.change(item2);
23116
23132
  if (shouldPublish) {
23117
23133
  this.subject.publish(this.items);
23118
23134
  }
23119
23135
  }
23120
23136
  sendManyToBack(items) {
23121
23137
  const newItems = [...items];
23122
- this.itemsArray.forEach((item) => {
23123
- if (!items.includes(item)) {
23124
- newItems.push(item);
23138
+ this.itemsArray.forEach((item2) => {
23139
+ if (!items.includes(item2)) {
23140
+ newItems.push(item2);
23125
23141
  }
23126
23142
  });
23127
23143
  this.itemsArray = newItems;
23128
23144
  this.itemsArray.forEach(this.change.bind(this));
23129
23145
  }
23130
- bringToFront(item, shouldPublish = true) {
23131
- const index2 = this.itemsArray.indexOf(item);
23146
+ bringToFront(item2, shouldPublish = true) {
23147
+ const index2 = this.itemsArray.indexOf(item2);
23132
23148
  this.itemsArray.splice(index2, 1);
23133
- this.itemsArray.push(item);
23134
- this.itemsIndex.change(item);
23149
+ this.itemsArray.push(item2);
23150
+ this.itemsIndex.change(item2);
23135
23151
  if (shouldPublish) {
23136
23152
  this.subject.publish(this.items);
23137
23153
  }
23138
23154
  }
23139
23155
  bringManyToFront(items) {
23140
23156
  const newItems = [];
23141
- this.itemsArray.forEach((item) => {
23142
- if (!items.includes(item)) {
23143
- newItems.push(item);
23157
+ this.itemsArray.forEach((item2) => {
23158
+ if (!items.includes(item2)) {
23159
+ newItems.push(item2);
23144
23160
  }
23145
23161
  });
23146
23162
  newItems.push(...items);
@@ -23166,9 +23182,9 @@ class SpatialIndex {
23166
23182
  this.subject.publish(this.items);
23167
23183
  }
23168
23184
  getById(id) {
23169
- const item = this.getItemsWithIncludedChildren(this.itemsArray).find((item2) => item2.getId() === id);
23170
- if (item) {
23171
- return item;
23185
+ const item2 = this.getItemsWithIncludedChildren(this.itemsArray).find((item3) => item3.getId() === id);
23186
+ if (item2) {
23187
+ return item2;
23172
23188
  }
23173
23189
  }
23174
23190
  findById(id) {
@@ -23178,10 +23194,10 @@ class SpatialIndex {
23178
23194
  const mbr = new Mbr(left, top, right, bottom);
23179
23195
  const items = this.itemsIndex.getEnclosed(mbr);
23180
23196
  const children = [];
23181
- const clearItems = items.filter((item) => {
23182
- if ("index" in item && item.index) {
23183
- children.push(...item.index.getEnclosed(left, top, right, bottom));
23184
- if (!item.getMbr().isEnclosedBy(mbr)) {
23197
+ const clearItems = items.filter((item2) => {
23198
+ if ("index" in item2 && item2.index) {
23199
+ children.push(...item2.index.getEnclosed(left, top, right, bottom));
23200
+ if (!item2.getMbr().isEnclosedBy(mbr)) {
23185
23201
  return false;
23186
23202
  }
23187
23203
  }
@@ -23193,10 +23209,10 @@ class SpatialIndex {
23193
23209
  const mbr = new Mbr(left, top, right, bottom);
23194
23210
  const items = this.itemsIndex.getEnclosedOrCrossedBy(mbr);
23195
23211
  const children = [];
23196
- const clearItems = items.filter((item) => {
23197
- if ("index" in item && item.index) {
23198
- children.push(...item.index.getEnclosedOrCrossed(left, top, right, bottom));
23199
- if (!item.getMbr().isEnclosedOrCrossedBy(mbr)) {
23212
+ const clearItems = items.filter((item2) => {
23213
+ if ("index" in item2 && item2.index) {
23214
+ children.push(...item2.index.getEnclosedOrCrossed(left, top, right, bottom));
23215
+ if (!item2.getMbr().isEnclosedOrCrossedBy(mbr)) {
23200
23216
  return false;
23201
23217
  }
23202
23218
  }
@@ -23207,10 +23223,10 @@ class SpatialIndex {
23207
23223
  getUnderPoint(point3, tolerance = 5) {
23208
23224
  const items = this.itemsIndex.getUnderPoint(point3, tolerance);
23209
23225
  const children = [];
23210
- const clearItems = items.filter((item) => {
23211
- if ("index" in item && item.index) {
23212
- children.push(...item.index.getUnderPoint(point3, tolerance));
23213
- if (!item.getMbr().isUnderPoint(point3)) {
23226
+ const clearItems = items.filter((item2) => {
23227
+ if ("index" in item2 && item2.index) {
23228
+ children.push(...item2.index.getUnderPoint(point3, tolerance));
23229
+ if (!item2.getMbr().isUnderPoint(point3)) {
23214
23230
  return false;
23215
23231
  }
23216
23232
  }
@@ -23222,10 +23238,10 @@ class SpatialIndex {
23222
23238
  const mbr = new Mbr(left, top, right, bottom);
23223
23239
  const items = this.itemsIndex.getRectsEnclosedOrCrossedBy(mbr);
23224
23240
  const children = [];
23225
- const clearItems = items.filter((item) => {
23226
- if ("index" in item && item.index) {
23227
- children.push(...item.index.getEnclosedOrCrossed(left, top, right, bottom));
23228
- if (!item.getMbr().isEnclosedOrCrossedBy(mbr)) {
23241
+ const clearItems = items.filter((item2) => {
23242
+ if ("index" in item2 && item2.index) {
23243
+ children.push(...item2.index.getEnclosedOrCrossed(left, top, right, bottom));
23244
+ if (!item2.getMbr().isEnclosedOrCrossedBy(mbr)) {
23229
23245
  return false;
23230
23246
  }
23231
23247
  }
@@ -23237,26 +23253,26 @@ class SpatialIndex {
23237
23253
  return this.getRectsEnclosedOrCrossed(left, top, right, bottom);
23238
23254
  }
23239
23255
  getComments() {
23240
- return this.itemsArray.filter((item) => item instanceof Comment);
23256
+ return this.itemsArray.filter((item2) => item2 instanceof Comment);
23241
23257
  }
23242
23258
  getMbr() {
23243
23259
  return this.Mbr;
23244
23260
  }
23245
23261
  getNearestTo(point3, maxItems, filter, maxDistance) {
23246
23262
  const allItems = this.getItemsWithIncludedChildren(this.itemsArray);
23247
- const filtered = allItems.filter((item) => filter(item));
23248
- const withDistance = filtered.map((item) => ({
23249
- item,
23250
- distance: point3.getDistance(item.getMbr().getCenter())
23263
+ const filtered = allItems.filter((item2) => filter(item2));
23264
+ const withDistance = filtered.map((item2) => ({
23265
+ item: item2,
23266
+ distance: point3.getDistance(item2.getMbr().getCenter())
23251
23267
  })).filter(({ distance }) => distance <= maxDistance);
23252
23268
  withDistance.sort((a, b) => a.distance - b.distance);
23253
- return withDistance.slice(0, maxItems).map(({ item }) => item);
23269
+ return withDistance.slice(0, maxItems).map(({ item: item2 }) => item2);
23254
23270
  }
23255
23271
  list() {
23256
23272
  return this.getItemsWithIncludedChildren(this.itemsArray).concat();
23257
23273
  }
23258
- getZIndex(item) {
23259
- const index2 = this.itemsArray.indexOf(item);
23274
+ getZIndex(item2) {
23275
+ const index2 = this.itemsArray.indexOf(item2);
23260
23276
  if (index2 === -1) {
23261
23277
  return this.getLastZIndex();
23262
23278
  }
@@ -23286,14 +23302,14 @@ class Items {
23286
23302
  this.pointer = pointer;
23287
23303
  this.subject = subject;
23288
23304
  }
23289
- update(item) {
23290
- this.index.change(item);
23305
+ update(item2) {
23306
+ this.index.change(item2);
23291
23307
  }
23292
23308
  listAll() {
23293
23309
  return this.index.list();
23294
23310
  }
23295
23311
  listGroupItems() {
23296
- return this.index.list().filter((item) => ("index" in item) && item.index);
23312
+ return this.index.list().filter((item2) => ("index" in item2) && item2.index);
23297
23313
  }
23298
23314
  getById(id) {
23299
23315
  return this.index.getById(id);
@@ -23308,7 +23324,7 @@ class Items {
23308
23324
  return this.index.getEnclosedOrCrossed(left, top, right, bottom);
23309
23325
  }
23310
23326
  getGroupItemsEnclosedOrCrossed(left, top, right, bottom) {
23311
- return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.index);
23327
+ return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item2) => item2 instanceof BaseItem && item2.index);
23312
23328
  }
23313
23329
  getUnderPoint(point3, tolerance = 5) {
23314
23330
  return this.index.getUnderPoint(point3, tolerance);
@@ -23336,28 +23352,28 @@ class Items {
23336
23352
  const unmodifiedSize = size;
23337
23353
  size = 16;
23338
23354
  const tolerated = this.index.getEnclosedOrCrossed(x - size, y - size, x + size, y + size);
23339
- const groups = tolerated.filter((item) => item.itemType === "Group");
23355
+ const groups = tolerated.filter((item2) => item2.itemType === "Group");
23340
23356
  if (groups.length > 0) {
23341
23357
  return groups;
23342
23358
  }
23343
- let enclosed = tolerated.some((item) => item instanceof Connector2) ? tolerated : this.index.getEnclosedOrCrossed(x, y, x, y);
23359
+ let enclosed = tolerated.some((item2) => item2 instanceof Connector2) ? tolerated : this.index.getEnclosedOrCrossed(x, y, x, y);
23344
23360
  const underPointer = this.getUnderPoint(new Point(x, y), size);
23345
23361
  if (enclosed.length === 0) {
23346
23362
  enclosed = underPointer;
23347
23363
  }
23348
- if (underPointer.some((item) => item.itemType === "Drawing")) {
23364
+ if (underPointer.some((item2) => item2.itemType === "Drawing")) {
23349
23365
  enclosed = [...underPointer, ...enclosed];
23350
23366
  }
23351
- const { nearest } = enclosed.reduce((acc, item) => {
23352
- const area = item.getMbr().getHeight() * item.getMbr().getWidth();
23353
- if (item.itemType === "Drawing" && !item.isPointNearLine(this.pointer.point)) {
23367
+ const { nearest } = enclosed.reduce((acc, item2) => {
23368
+ const area = item2.getMbr().getHeight() * item2.getMbr().getWidth();
23369
+ if (item2.itemType === "Drawing" && !item2.isPointNearLine(this.pointer.point)) {
23354
23370
  return acc;
23355
23371
  }
23356
- const isItemTransparent = item instanceof Shape && item?.getBackgroundColor() === "none";
23357
- const itemZIndex = this.getZIndex(item);
23372
+ const isItemTransparent = item2 instanceof Shape && item2?.getBackgroundColor() === "none";
23373
+ const itemZIndex = this.getZIndex(item2);
23358
23374
  const accZIndex = this.getZIndex(acc.nearest);
23359
23375
  if (itemZIndex > accZIndex && (!isItemTransparent || area === acc.area) || area < acc.area) {
23360
- return { nearest: item, area };
23376
+ return { nearest: item2, area };
23361
23377
  }
23362
23378
  return acc;
23363
23379
  }, { nearest: undefined, area: Infinity });
@@ -23369,8 +23385,8 @@ class Items {
23369
23385
  getNearPointer(maxDistance = 100, maxItems = 10, filter = () => true) {
23370
23386
  return this.index.getNearestTo(this.pointer.point, maxItems, filter, maxDistance);
23371
23387
  }
23372
- getZIndex(item) {
23373
- return this.index.getZIndex(item);
23388
+ getZIndex(item2) {
23389
+ return this.index.getZIndex(item2);
23374
23390
  }
23375
23391
  getByZIndex(index2) {
23376
23392
  return this.index.getByZIndex(index2);
@@ -23379,11 +23395,11 @@ class Items {
23379
23395
  return this.index.getLastZIndex();
23380
23396
  }
23381
23397
  getLinkedConnectorsById(id) {
23382
- return this.listAll().filter((item) => {
23383
- if (!(item instanceof Connector2)) {
23398
+ return this.listAll().filter((item2) => {
23399
+ if (!(item2 instanceof Connector2)) {
23384
23400
  return false;
23385
23401
  }
23386
- const { startItem, endItem } = item.getConnectedItems();
23402
+ const { startItem, endItem } = item2.getConnectedItems();
23387
23403
  if (startItem?.getId() === id || endItem?.getId() === id) {
23388
23404
  return true;
23389
23405
  }
@@ -23394,11 +23410,11 @@ class Items {
23394
23410
  if (!startPointerItemId && !endPointerItemId) {
23395
23411
  return [];
23396
23412
  }
23397
- return this.listAll().filter((item) => {
23398
- if (!(item instanceof Connector2) || !item.isConnected()) {
23413
+ return this.listAll().filter((item2) => {
23414
+ if (!(item2 instanceof Connector2) || !item2.isConnected()) {
23399
23415
  return false;
23400
23416
  }
23401
- const { startItem, endItem } = item.getConnectedItems();
23417
+ const { startItem, endItem } = item2.getConnectedItems();
23402
23418
  if (startPointerItemId && endPointerItemId) {
23403
23419
  if (startPointerItemId && startItem && startItem.getId() === startPointerItemId && endPointerItemId && endItem && endItem.getId() === endPointerItemId) {
23404
23420
  return true;
@@ -23416,9 +23432,9 @@ class Items {
23416
23432
  }
23417
23433
  render(context) {
23418
23434
  const items = this.getItemsInView();
23419
- items.forEach((item) => {
23420
- if (item.parent === "Board") {
23421
- item.render(context);
23435
+ items.forEach((item2) => {
23436
+ if (item2.parent === "Board") {
23437
+ item2.render(context);
23422
23438
  }
23423
23439
  });
23424
23440
  }
@@ -23431,17 +23447,17 @@ class Items {
23431
23447
  return this.getHTML(documentFactory, items);
23432
23448
  }
23433
23449
  getHTML(documentFactory, items) {
23434
- const lowestCoordinates = items.map((item) => item.getMbr()).reduce((acc, mbr) => ({
23450
+ const lowestCoordinates = items.map((item2) => item2.getMbr()).reduce((acc, mbr) => ({
23435
23451
  left: Math.min(acc.left, mbr.left),
23436
23452
  top: Math.min(acc.top, mbr.top)
23437
23453
  }), { left: 0, top: 0 });
23438
23454
  const groups = [];
23439
23455
  const rest = [];
23440
- items.forEach((item) => {
23441
- if ("index" in item && item.index) {
23442
- groups.push(item);
23456
+ items.forEach((item2) => {
23457
+ if ("index" in item2 && item2.index) {
23458
+ groups.push(item2);
23443
23459
  } else {
23444
- rest.push(item);
23460
+ rest.push(item2);
23445
23461
  }
23446
23462
  });
23447
23463
  const childrenMap = new Map;
@@ -23451,34 +23467,34 @@ class Items {
23451
23467
  translateElementBy(html, -lowestCoordinates.left, -lowestCoordinates.top);
23452
23468
  return html;
23453
23469
  });
23454
- const restHTML = rest.map((item) => ("renderHTML" in item) && item.renderHTML(documentFactory)).filter((item) => !!item).map((item) => {
23455
- if (item.tagName.toLowerCase() === "connector-item") {
23456
- const startX = parseFloat(item.getAttribute("data-start-point-x") || "0");
23457
- const startY = parseFloat(item.getAttribute("data-start-point-y") || "0");
23458
- const endX = parseFloat(item.getAttribute("data-end-point-x") || "0");
23459
- const endY = parseFloat(item.getAttribute("data-end-point-y") || "0");
23460
- item.setAttribute("data-start-point-x", (startX - lowestCoordinates.left).toString());
23461
- item.setAttribute("data-start-point-y", (startY - lowestCoordinates.top).toString());
23462
- item.setAttribute("data-end-point-x", (endX - lowestCoordinates.left).toString());
23463
- item.setAttribute("data-end-point-y", (endY - lowestCoordinates.top).toString());
23464
- }
23465
- return translateElementBy(item, -lowestCoordinates.left, -lowestCoordinates.top);
23466
- });
23467
- for (const item of restHTML) {
23468
- const parentFrameId = childrenMap.get(item.id);
23470
+ const restHTML = rest.map((item2) => ("renderHTML" in item2) && item2.renderHTML(documentFactory)).filter((item2) => !!item2).map((item2) => {
23471
+ if (item2.tagName.toLowerCase() === "connector-item") {
23472
+ const startX = parseFloat(item2.getAttribute("data-start-point-x") || "0");
23473
+ const startY = parseFloat(item2.getAttribute("data-start-point-y") || "0");
23474
+ const endX = parseFloat(item2.getAttribute("data-end-point-x") || "0");
23475
+ const endY = parseFloat(item2.getAttribute("data-end-point-y") || "0");
23476
+ item2.setAttribute("data-start-point-x", (startX - lowestCoordinates.left).toString());
23477
+ item2.setAttribute("data-start-point-y", (startY - lowestCoordinates.top).toString());
23478
+ item2.setAttribute("data-end-point-x", (endX - lowestCoordinates.left).toString());
23479
+ item2.setAttribute("data-end-point-y", (endY - lowestCoordinates.top).toString());
23480
+ }
23481
+ return translateElementBy(item2, -lowestCoordinates.left, -lowestCoordinates.top);
23482
+ });
23483
+ for (const item2 of restHTML) {
23484
+ const parentFrameId = childrenMap.get(item2.id);
23469
23485
  const group = GroupsHTML.find((el) => parentFrameId !== undefined && el.id === parentFrameId);
23470
23486
  if (group) {
23471
- positionRelatively(item, group);
23472
- group.appendChild(item);
23487
+ positionRelatively(item2, group);
23488
+ group.appendChild(item2);
23473
23489
  }
23474
23490
  }
23475
23491
  let result = "";
23476
23492
  for (const group of GroupsHTML) {
23477
23493
  result += group.outerHTML;
23478
23494
  }
23479
- for (const item of restHTML) {
23480
- if (!childrenMap.get(item.id)) {
23481
- result += item.outerHTML;
23495
+ for (const item2 of restHTML) {
23496
+ if (!childrenMap.get(item2.id)) {
23497
+ result += item2.outerHTML;
23482
23498
  }
23483
23499
  }
23484
23500
  return result;
@@ -23498,52 +23514,52 @@ class SimpleSpatialIndex {
23498
23514
  this.itemsArray = [];
23499
23515
  this.Mbr = new Mbr;
23500
23516
  }
23501
- insert(item) {
23502
- this.itemsArray.push(item);
23517
+ insert(item2) {
23518
+ this.itemsArray.push(item2);
23503
23519
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
23504
- this.Mbr = item.getMbr().copy();
23520
+ this.Mbr = item2.getMbr().copy();
23505
23521
  } else {
23506
- this.Mbr.combine([item.getMbr()]);
23522
+ this.Mbr.combine([item2.getMbr()]);
23507
23523
  }
23508
- item.subject.subscribe(this.change);
23524
+ item2.subject.subscribe(this.change);
23509
23525
  this.subject.publish(this.items);
23510
23526
  }
23511
- change = (item) => {
23527
+ change = (item2) => {
23512
23528
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
23513
- this.Mbr = item.getMbr().copy();
23529
+ this.Mbr = item2.getMbr().copy();
23514
23530
  } else {
23515
- this.Mbr.combine([item.getMbr()]);
23531
+ this.Mbr.combine([item2.getMbr()]);
23516
23532
  }
23517
23533
  this.subject.publish(this.items);
23518
23534
  };
23519
- remove(item) {
23520
- if ("index" in item && item.index) {
23521
- item.removeChildItems(item.index.list());
23535
+ remove(item2) {
23536
+ if ("index" in item2 && item2.index) {
23537
+ item2.removeChildItems(item2.index.list());
23522
23538
  }
23523
- if (item.parent !== "Board") {
23524
- const parentFrame = this.items.getById(item.parent);
23525
- parentFrame?.removeChildItems(item);
23539
+ if (item2.parent !== "Board") {
23540
+ const parentFrame = this.items.getById(item2.parent);
23541
+ parentFrame?.removeChildItems(item2);
23526
23542
  }
23527
- this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
23543
+ this.itemsArray.splice(this.itemsArray.indexOf(item2), 1);
23528
23544
  this.Mbr = new Mbr;
23529
- this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
23545
+ this.itemsArray.forEach((item3) => this.Mbr.combine([item3.getMbr()]));
23530
23546
  this.subject.publish(this.items);
23531
23547
  }
23532
23548
  copy() {
23533
- return this.itemsArray.map((item) => ({
23534
- ...item.serialize(true),
23535
- id: item.getId()
23549
+ return this.itemsArray.map((item2) => ({
23550
+ ...item2.serialize(true),
23551
+ id: item2.getId()
23536
23552
  }));
23537
23553
  }
23538
- moveToZIndex(item, zIndex) {
23539
- const index2 = this.itemsArray.indexOf(item);
23554
+ moveToZIndex(item2, zIndex) {
23555
+ const index2 = this.itemsArray.indexOf(item2);
23540
23556
  this.itemsArray.splice(index2, 1);
23541
- this.itemsArray.splice(zIndex, 0, item);
23542
- this.change(item);
23557
+ this.itemsArray.splice(zIndex, 0, item2);
23558
+ this.change(item2);
23543
23559
  this.subject.publish(this.items);
23544
23560
  }
23545
23561
  moveManyToZIndex(itemsRecord) {
23546
- const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item) => item !== undefined);
23562
+ const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item2) => item2 !== undefined);
23547
23563
  const zIndex = Object.values(itemsRecord);
23548
23564
  for (let i = 0;i < zIndex.length; i++) {
23549
23565
  const index2 = zIndex[i];
@@ -23551,37 +23567,37 @@ class SimpleSpatialIndex {
23551
23567
  }
23552
23568
  this.itemsArray.forEach(this.change.bind(this));
23553
23569
  }
23554
- sendToBack(item, shouldPublish = true) {
23555
- const index2 = this.itemsArray.indexOf(item);
23570
+ sendToBack(item2, shouldPublish = true) {
23571
+ const index2 = this.itemsArray.indexOf(item2);
23556
23572
  this.itemsArray.splice(index2, 1);
23557
- this.itemsArray.unshift(item);
23573
+ this.itemsArray.unshift(item2);
23558
23574
  if (shouldPublish) {
23559
23575
  this.subject.publish(this.items);
23560
23576
  }
23561
23577
  }
23562
23578
  sendManyToBack(items) {
23563
23579
  const newItems = [...items];
23564
- this.itemsArray.forEach((item) => {
23565
- if (!items.includes(item)) {
23566
- newItems.push(item);
23580
+ this.itemsArray.forEach((item2) => {
23581
+ if (!items.includes(item2)) {
23582
+ newItems.push(item2);
23567
23583
  }
23568
23584
  });
23569
23585
  this.itemsArray = newItems;
23570
23586
  this.itemsArray.forEach(this.change.bind(this));
23571
23587
  }
23572
- bringToFront(item, shouldPublish = true) {
23573
- const index2 = this.itemsArray.indexOf(item);
23588
+ bringToFront(item2, shouldPublish = true) {
23589
+ const index2 = this.itemsArray.indexOf(item2);
23574
23590
  this.itemsArray.splice(index2, 1);
23575
- this.itemsArray.push(item);
23591
+ this.itemsArray.push(item2);
23576
23592
  if (shouldPublish) {
23577
23593
  this.subject.publish(this.items);
23578
23594
  }
23579
23595
  }
23580
23596
  bringManyToFront(items) {
23581
23597
  const newItems = [];
23582
- this.itemsArray.forEach((item) => {
23583
- if (!items.includes(item)) {
23584
- newItems.push(item);
23598
+ this.itemsArray.forEach((item2) => {
23599
+ if (!items.includes(item2)) {
23600
+ newItems.push(item2);
23585
23601
  }
23586
23602
  });
23587
23603
  newItems.push(...items);
@@ -23607,9 +23623,9 @@ class SimpleSpatialIndex {
23607
23623
  this.subject.publish(this.items);
23608
23624
  }
23609
23625
  getById(id) {
23610
- const item = this.itemsArray.find((item2) => item2.getId() === id);
23611
- if (item) {
23612
- return item;
23626
+ const item2 = this.itemsArray.find((item3) => item3.getId() === id);
23627
+ if (item2) {
23628
+ return item2;
23613
23629
  }
23614
23630
  }
23615
23631
  findById(id) {
@@ -23618,9 +23634,9 @@ class SimpleSpatialIndex {
23618
23634
  getEnclosed(left, top, right, bottom) {
23619
23635
  const mbr = new Mbr(left, top, right, bottom);
23620
23636
  const items = [];
23621
- this.itemsArray.forEach((item) => {
23622
- if (item.isEnclosedBy(mbr)) {
23623
- items.push(item);
23637
+ this.itemsArray.forEach((item2) => {
23638
+ if (item2.isEnclosedBy(mbr)) {
23639
+ items.push(item2);
23624
23640
  }
23625
23641
  });
23626
23642
  return items;
@@ -23628,18 +23644,18 @@ class SimpleSpatialIndex {
23628
23644
  getEnclosedOrCrossed(left, top, right, bottom) {
23629
23645
  const mbr = new Mbr(left, top, right, bottom);
23630
23646
  const items = [];
23631
- this.itemsArray.forEach((item) => {
23632
- if (item.isEnclosedOrCrossedBy(mbr)) {
23633
- items.push(item);
23647
+ this.itemsArray.forEach((item2) => {
23648
+ if (item2.isEnclosedOrCrossedBy(mbr)) {
23649
+ items.push(item2);
23634
23650
  }
23635
23651
  });
23636
23652
  return items;
23637
23653
  }
23638
23654
  getUnderPoint(point3, tolerace = 5) {
23639
23655
  const items = [];
23640
- this.itemsArray.forEach((item) => {
23641
- if (item.isUnderPoint(point3, tolerace)) {
23642
- items.push(item);
23656
+ this.itemsArray.forEach((item2) => {
23657
+ if (item2.isUnderPoint(point3, tolerace)) {
23658
+ items.push(item2);
23643
23659
  }
23644
23660
  });
23645
23661
  return items;
@@ -23650,8 +23666,8 @@ class SimpleSpatialIndex {
23650
23666
  list() {
23651
23667
  return this.itemsArray.concat();
23652
23668
  }
23653
- getZIndex(item) {
23654
- return this.itemsArray.indexOf(item);
23669
+ getZIndex(item2) {
23670
+ return this.itemsArray.indexOf(item2);
23655
23671
  }
23656
23672
  getLastZIndex() {
23657
23673
  return this.itemsArray.length - 1;
@@ -23665,8 +23681,8 @@ class SimpleSpatialIndex {
23665
23681
  }
23666
23682
  }
23667
23683
  render(context) {
23668
- this.itemsArray.forEach((item) => {
23669
- item.render(context);
23684
+ this.itemsArray.forEach((item2) => {
23685
+ item2.render(context);
23670
23686
  });
23671
23687
  }
23672
23688
  }
@@ -23717,7 +23733,7 @@ class BaseItem extends Mbr {
23717
23733
  if (!this.index) {
23718
23734
  return null;
23719
23735
  }
23720
- return this.index.items.listAll().map((item) => item.getId());
23736
+ return this.index.items.listAll().map((item2) => item2.getId());
23721
23737
  }
23722
23738
  addChildItems(children) {
23723
23739
  if (!this.index) {
@@ -23755,17 +23771,17 @@ class BaseItem extends Mbr {
23755
23771
  this.addChildItems(itemsToAdd);
23756
23772
  this.removeChildItems(itemsToRemove);
23757
23773
  }
23758
- handleNesting(item, options) {
23759
- const isItem = "itemType" in item;
23760
- const itemMbr = isItem ? item.getMbr() : item;
23761
- if (item instanceof BaseItem && !item.canBeNested) {
23774
+ handleNesting(item2, options) {
23775
+ const isItem = "itemType" in item2;
23776
+ const itemMbr = isItem ? item2.getMbr() : item2;
23777
+ if (item2 instanceof BaseItem && !item2.canBeNested) {
23762
23778
  return false;
23763
23779
  }
23764
- if (options?.cancelIfChild && isItem && item.parent !== "Board") {
23780
+ if (options?.cancelIfChild && isItem && item2.parent !== "Board") {
23765
23781
  return false;
23766
23782
  }
23767
23783
  const mbr = this.getMbr().copy();
23768
- if (item.isEnclosedOrCrossedBy(mbr)) {
23784
+ if (item2.isEnclosedOrCrossedBy(mbr)) {
23769
23785
  if (mbr.isInside(itemMbr.getCenter())) {
23770
23786
  if (!options || !options.onlyForOut) {
23771
23787
  return true;
@@ -26062,8 +26078,8 @@ function isChild(value) {
26062
26078
  if (!Array.isArray(value2))
26063
26079
  return true;
26064
26080
  const list2 = value2;
26065
- for (const item of list2) {
26066
- if (typeof item !== "number" && typeof item !== "string") {
26081
+ for (const item2 of list2) {
26082
+ if (typeof item2 !== "number" && typeof item2 !== "string") {
26067
26083
  return true;
26068
26084
  }
26069
26085
  }
@@ -26102,8 +26118,8 @@ function addProperty(schema, properties, key, value) {
26102
26118
  }
26103
26119
  if (Array.isArray(result)) {
26104
26120
  const finalResult = [];
26105
- for (const item of result) {
26106
- finalResult.push(parsePrimitive(info, info.property, item));
26121
+ for (const item2 of result) {
26122
+ finalResult.push(parsePrimitive(info, info.property, item2));
26107
26123
  }
26108
26124
  result = finalResult;
26109
26125
  }
@@ -37170,8 +37186,8 @@ function list5(node2, parent, state, info) {
37170
37186
  if (checkRule(state) === bullet && firstListItem) {
37171
37187
  let index2 = -1;
37172
37188
  while (++index2 < node2.children.length) {
37173
- const item = node2.children[index2];
37174
- if (item && item.type === "listItem" && item.children && item.children[0] && item.children[0].type === "thematicBreak") {
37189
+ const item2 = node2.children[index2];
37190
+ if (item2 && item2.type === "listItem" && item2.children && item2.children[0] && item2.children[0].type === "thematicBreak") {
37175
37191
  useDifferentMarker = true;
37176
37192
  break;
37177
37193
  }
@@ -37832,12 +37848,12 @@ async function convertMarkdownToSlate(text5) {
37832
37848
  ...nodes.filter((node2) => node2.type !== "list_item")
37833
37849
  ];
37834
37850
  }
37835
- return nodes.map((item) => {
37851
+ return nodes.map((item2) => {
37836
37852
  setNodeStyles({
37837
- node: item,
37838
- isPaddingTopNeeded: item.type !== "code_block"
37853
+ node: item2,
37854
+ isPaddingTopNeeded: item2.type !== "code_block"
37839
37855
  });
37840
- return item;
37856
+ return item2;
37841
37857
  });
37842
37858
  }
37843
37859
  function detectListType(text5) {
@@ -38250,17 +38266,17 @@ class FloatingPoint extends Point {
38250
38266
  relativePoint;
38251
38267
  pointType = "Floating";
38252
38268
  edge;
38253
- constructor(item, relativePoint) {
38269
+ constructor(item2, relativePoint) {
38254
38270
  super();
38255
- this.item = item;
38271
+ this.item = item2;
38256
38272
  this.relativePoint = relativePoint;
38257
38273
  if (relativePoint.y <= 0) {
38258
38274
  this.edge = "top";
38259
- } else if (relativePoint.y >= item.getMbr().getHeight()) {
38275
+ } else if (relativePoint.y >= item2.getMbr().getHeight()) {
38260
38276
  this.edge = "bottom";
38261
38277
  } else if (relativePoint.x <= 0) {
38262
38278
  this.edge = "left";
38263
- } else if (relativePoint.x >= item.getMbr().getWidth()) {
38279
+ } else if (relativePoint.x >= item2.getMbr().getWidth()) {
38264
38280
  this.edge = "right";
38265
38281
  }
38266
38282
  this.recalculatePoint();
@@ -38291,17 +38307,17 @@ class FixedPoint extends Point {
38291
38307
  relativePoint;
38292
38308
  pointType = "Fixed";
38293
38309
  edge;
38294
- constructor(item, relativePoint) {
38310
+ constructor(item2, relativePoint) {
38295
38311
  super();
38296
- this.item = item;
38312
+ this.item = item2;
38297
38313
  this.relativePoint = relativePoint;
38298
38314
  if (relativePoint.y <= 0) {
38299
38315
  this.edge = "top";
38300
- } else if (relativePoint.y >= item.getMbr().getHeight()) {
38316
+ } else if (relativePoint.y >= item2.getMbr().getHeight()) {
38301
38317
  this.edge = "bottom";
38302
38318
  } else if (relativePoint.x <= 0) {
38303
38319
  this.edge = "left";
38304
- } else if (relativePoint.x >= item.getMbr().getWidth()) {
38320
+ } else if (relativePoint.x >= item2.getMbr().getWidth()) {
38305
38321
  this.edge = "right";
38306
38322
  }
38307
38323
  this.recalculatePoint();
@@ -38332,16 +38348,16 @@ class FixedConnectorPoint extends Point {
38332
38348
  tangent;
38333
38349
  segmentIndex;
38334
38350
  pointType = "FixedConnector";
38335
- constructor(item, tangent, segmentIndex) {
38351
+ constructor(item2, tangent, segmentIndex) {
38336
38352
  super();
38337
- this.item = item;
38353
+ this.item = item2;
38338
38354
  this.tangent = tangent;
38339
38355
  this.segmentIndex = segmentIndex;
38340
38356
  this.recalculatePoint();
38341
38357
  }
38342
38358
  recalculatePoint() {
38343
- const item = this.item;
38344
- const segments = item.getPaths().getSegments();
38359
+ const item2 = this.item;
38360
+ const segments = item2.getPaths().getSegments();
38345
38361
  const segment = segments.length > this.segmentIndex ? segments[this.segmentIndex] : segments[segments.length - 1];
38346
38362
  const point5 = segment.getPoint(this.tangent);
38347
38363
  this.x = point5.x;
@@ -38366,38 +38382,38 @@ function getControlPoint(data, findItem2) {
38366
38382
  if (data.pointType === "Board") {
38367
38383
  return new BoardPoint(Math.round(data.x), Math.round(data.y));
38368
38384
  } else {
38369
- const item = findItem2(data.itemId);
38370
- if (!item) {
38385
+ const item2 = findItem2(data.itemId);
38386
+ if (!item2) {
38371
38387
  console.warn(`getControlPoint(): item not found for ${data.itemId}`);
38372
38388
  return new BoardPoint(0, 0);
38373
38389
  }
38374
38390
  switch (data.pointType) {
38375
38391
  case "FixedConnector":
38376
- if (item instanceof Connector2) {
38377
- return new FixedConnectorPoint(item, data.tangent, data.segment);
38392
+ if (item2 instanceof Connector2) {
38393
+ return new FixedConnectorPoint(item2, data.tangent, data.segment);
38378
38394
  } else {
38379
38395
  throw new Error(`getControlPoint(): item must be a connector`);
38380
38396
  }
38381
38397
  case "Floating":
38382
- return new FloatingPoint(item, new Point(data.relativeX, data.relativeY));
38398
+ return new FloatingPoint(item2, new Point(data.relativeX, data.relativeY));
38383
38399
  case "Fixed":
38384
- return new FixedPoint(item, new Point(data.relativeX, data.relativeY));
38400
+ return new FixedPoint(item2, new Point(data.relativeX, data.relativeY));
38385
38401
  }
38386
38402
  }
38387
38403
  }
38388
- function toRelativePoint(point5, item) {
38389
- const matrix = item.transformation?.matrix || new Matrix2;
38404
+ function toRelativePoint(point5, item2) {
38405
+ const matrix = item2.transformation?.matrix || new Matrix2;
38390
38406
  const inverse = matrix.getInverse();
38391
38407
  point5 = point5.copy();
38392
38408
  point5.transform(inverse);
38393
38409
  return point5;
38394
38410
  }
38395
- function fromRelativePoint(relativePoint, item, edge) {
38396
- const matrix = item.transformation?.matrix.copy() || new Matrix2;
38411
+ function fromRelativePoint(relativePoint, item2, edge) {
38412
+ const matrix = item2.transformation?.matrix.copy() || new Matrix2;
38397
38413
  const point5 = relativePoint.copy();
38398
38414
  point5.transform(matrix);
38399
- if (item instanceof RichText || item instanceof AINode) {
38400
- const itemMbr = item.getMbr();
38415
+ if (item2 instanceof RichText || item2 instanceof AINode) {
38416
+ const itemMbr = item2.getMbr();
38401
38417
  const { x: centerX, y: centerY } = itemMbr.getCenter();
38402
38418
  switch (edge) {
38403
38419
  case "left":
@@ -38409,7 +38425,7 @@ function fromRelativePoint(relativePoint, item, edge) {
38409
38425
  case "bottom":
38410
38426
  return new Point(centerX, itemMbr.bottom);
38411
38427
  default:
38412
- return item.getMbr().getClosestEdgeCenterPoint(point5);
38428
+ return item2.getMbr().getClosestEdgeCenterPoint(point5);
38413
38429
  }
38414
38430
  }
38415
38431
  return point5;
@@ -39758,7 +39774,7 @@ class Connector2 extends BaseItem {
39758
39774
  return this;
39759
39775
  }
39760
39776
  getConnectorById(items, connectorId) {
39761
- return items.find((item) => item instanceof Connector2 && item.getId() === connectorId);
39777
+ return items.find((item2) => item2 instanceof Connector2 && item2.getId() === connectorId);
39762
39778
  }
39763
39779
  updateTitle() {
39764
39780
  const selection = this.board.selection;
@@ -42395,8 +42411,8 @@ async function exportBoardSnapshot({
42395
42411
  context.matrix.applyToContext(context.ctx);
42396
42412
  const { left, top, right, bottom } = selection;
42397
42413
  const inView = board.items.index.getRectsEnclosedOrCrossed(left, top, right, bottom);
42398
- for (const item of inView) {
42399
- item.render(context);
42414
+ for (const item2 of inView) {
42415
+ item2.render(context);
42400
42416
  }
42401
42417
  const blob = await offscreenCanvas.convertToBlob({ type: "image/png" });
42402
42418
  const dataUrl = await convertBlobToDataUrl(blob);
@@ -42594,7 +42610,7 @@ class Frame2 extends BaseItem {
42594
42610
  return this.id;
42595
42611
  }
42596
42612
  getChildrenIds() {
42597
- return this.index?.list().map((item) => item.getId()) || [];
42613
+ return this.index?.list().map((item2) => item2.getId()) || [];
42598
42614
  }
42599
42615
  updateMbr() {
42600
42616
  const rect = this.path.getMbr().copy();
@@ -42829,11 +42845,11 @@ class Frame2 extends BaseItem {
42829
42845
  }
42830
42846
  });
42831
42847
  const currMbr = this.getMbr();
42832
- this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item) => {
42833
- if (item.parent === "Board") {
42834
- if (this.handleNesting(item)) {
42835
- this.applyAddChildren([item.getId()]);
42836
- item.parent = this.getId();
42848
+ this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item2) => {
42849
+ if (item2.parent === "Board") {
42850
+ if (this.handleNesting(item2)) {
42851
+ this.applyAddChildren([item2.getId()]);
42852
+ item2.parent = this.getId();
42837
42853
  }
42838
42854
  }
42839
42855
  });
@@ -45031,9 +45047,9 @@ class Group extends BaseItem {
45031
45047
  if (data.children) {
45032
45048
  data.children.forEach((childId) => {
45033
45049
  this.applyAddChild(childId);
45034
- const item = this.board.items.getById(childId);
45035
- if (item) {
45036
- item.parent = this.getId();
45050
+ const item2 = this.board.items.getById(childId);
45051
+ if (item2) {
45052
+ item2.parent = this.getId();
45037
45053
  }
45038
45054
  });
45039
45055
  }
@@ -45063,11 +45079,11 @@ class Group extends BaseItem {
45063
45079
  let right = Number.MIN_SAFE_INTEGER;
45064
45080
  let bottom = Number.MIN_SAFE_INTEGER;
45065
45081
  const mbrs = this.children.flatMap((childId) => {
45066
- const item = this.board.items.getById(childId);
45067
- if (!item) {
45082
+ const item2 = this.board.items.getById(childId);
45083
+ if (!item2) {
45068
45084
  return [];
45069
45085
  }
45070
- const mbr2 = item.getMbr();
45086
+ const mbr2 = item2.getMbr();
45071
45087
  if (!mbr2) {
45072
45088
  return [];
45073
45089
  }
@@ -45102,7 +45118,7 @@ class Group extends BaseItem {
45102
45118
  return this.children;
45103
45119
  }
45104
45120
  getChildren() {
45105
- return this.children.map((itemId) => this.board.items.getById(itemId)).filter((item) => item !== undefined);
45121
+ return this.children.map((itemId) => this.board.items.getById(itemId)).filter((item2) => item2 !== undefined);
45106
45122
  }
45107
45123
  updateMbr() {
45108
45124
  const rect = this.getMbr();
@@ -45115,9 +45131,9 @@ class Group extends BaseItem {
45115
45131
  setChildren(items) {
45116
45132
  items.forEach((itemId) => {
45117
45133
  this.addChild(itemId);
45118
- const item = this.board.items.getById(itemId);
45119
- if (item) {
45120
- item.parent = this.getId();
45134
+ const item2 = this.board.items.getById(itemId);
45135
+ if (item2) {
45136
+ item2.parent = this.getId();
45121
45137
  }
45122
45138
  });
45123
45139
  this.updateMbr();
@@ -45125,9 +45141,9 @@ class Group extends BaseItem {
45125
45141
  removeChildren() {
45126
45142
  this.children.forEach((itemId) => {
45127
45143
  this.removeChild(itemId);
45128
- const item = this.board.items.getById(itemId);
45129
- if (item) {
45130
- item.parent = this.parent;
45144
+ const item2 = this.board.items.getById(itemId);
45145
+ if (item2) {
45146
+ item2.parent = this.parent;
45131
45147
  }
45132
45148
  });
45133
45149
  this.updateMbr();
@@ -45460,16 +45476,16 @@ class Anchor extends Mbr {
45460
45476
  }
45461
45477
  }
45462
45478
  // src/Items/Connector/ConnectorSnap.ts
45463
- function getFixedPoint(item, point5) {
45464
- if (item instanceof Connector2) {
45465
- const nearestSegmentData = item.getPaths().getNearestEdgeAndPointTo(point5);
45479
+ function getFixedPoint(item2, point5) {
45480
+ if (item2 instanceof Connector2) {
45481
+ const nearestSegmentData = item2.getPaths().getNearestEdgeAndPointTo(point5);
45466
45482
  const segment = nearestSegmentData.segment;
45467
45483
  const index2 = nearestSegmentData.index;
45468
45484
  const tangent = segment.getParameter(point5);
45469
- return new FixedConnectorPoint(item, tangent, index2);
45485
+ return new FixedConnectorPoint(item2, tangent, index2);
45470
45486
  } else {
45471
- const relativePoint = toRelativePoint(point5, item);
45472
- return new FixedPoint(item, relativePoint);
45487
+ const relativePoint = toRelativePoint(point5, item2);
45488
+ return new FixedPoint(item2, relativePoint);
45473
45489
  }
45474
45490
  }
45475
45491
 
@@ -45522,20 +45538,20 @@ class ConnectorSnap {
45522
45538
  }
45523
45539
  this.setSnap();
45524
45540
  const pointer = this.board.pointer.point;
45525
- const { anchor, item, point: point5 } = this.snap;
45526
- if (!item) {
45541
+ const { anchor, item: item2, point: point5 } = this.snap;
45542
+ if (!item2) {
45527
45543
  const pointer2 = this.board.pointer.point;
45528
45544
  this.controlPoint = new BoardPoint(pointer2.x, pointer2.y);
45529
45545
  } else if (anchor) {
45530
- this.controlPoint = getFixedPoint(item, anchor.getCenter());
45546
+ this.controlPoint = getFixedPoint(item2, anchor.getCenter());
45531
45547
  } else if (point5) {
45532
- const nearest2 = item.getNearestEdgePointTo(pointer);
45533
- this.controlPoint = getFixedPoint(item, nearest2);
45548
+ const nearest2 = item2.getNearestEdgePointTo(pointer);
45549
+ this.controlPoint = getFixedPoint(item2, nearest2);
45534
45550
  } else {
45535
45551
  if (this.hover.isTimeoutElapsed) {
45536
- this.controlPoint = getFixedPoint(item, pointer);
45552
+ this.controlPoint = getFixedPoint(item2, pointer);
45537
45553
  } else {
45538
- this.controlPoint = getFixedPoint(item, pointer);
45554
+ this.controlPoint = getFixedPoint(item2, pointer);
45539
45555
  }
45540
45556
  }
45541
45557
  }
@@ -45596,23 +45612,23 @@ class ConnectorSnap {
45596
45612
  }
45597
45613
  return nearest;
45598
45614
  }
45599
- getClosestPointOnItem(item, position4) {
45600
- const nearestEdgePoint = item.getNearestEdgePointTo(position4);
45601
- return getFixedPoint(item, nearestEdgePoint);
45615
+ getClosestPointOnItem(item2, position4) {
45616
+ const nearestEdgePoint = item2.getNearestEdgePointTo(position4);
45617
+ return getFixedPoint(item2, nearestEdgePoint);
45602
45618
  }
45603
- isNearBorder(item) {
45604
- if (!item) {
45619
+ isNearBorder(item2) {
45620
+ if (!item2) {
45605
45621
  return false;
45606
45622
  }
45607
45623
  const pointer = this.board.pointer.point;
45608
- const point5 = item.getNearestEdgePointTo(pointer);
45624
+ const point5 = item2.getNearestEdgePointTo(pointer);
45609
45625
  const distance = pointer.getDistance(point5);
45610
45626
  return distance < this.distance.border / this.board.camera.getScale();
45611
45627
  }
45612
45628
  setSnap() {
45613
- const item = this.snap.item;
45614
- const path2 = item && "getPath" in item ? item?.getPath() : null;
45615
- if (!item || !path2) {
45629
+ const item2 = this.snap.item;
45630
+ const path2 = item2 && "getPath" in item2 ? item2?.getPath() : null;
45631
+ if (!item2 || !path2) {
45616
45632
  this.snap.path = null;
45617
45633
  this.snap.anchors = [];
45618
45634
  this.snap.anchor = null;
@@ -45623,11 +45639,11 @@ class ConnectorSnap {
45623
45639
  if (this.snap.item === this.hover.item && !this.hover.isTimeoutElapsed) {
45624
45640
  path2.setBackgroundColor(this.color.snapBackgroundHighlight);
45625
45641
  }
45626
- this.setAnchors(item);
45642
+ this.setAnchors(item2);
45627
45643
  }
45628
45644
  }
45629
- setAnchors(item) {
45630
- const points = item.getSnapAnchorPoints();
45645
+ setAnchors(item2) {
45646
+ const points = item2.getSnapAnchorPoints();
45631
45647
  if (!points) {
45632
45648
  return;
45633
45649
  }
@@ -45661,10 +45677,10 @@ class ConnectorSnap {
45661
45677
  }
45662
45678
  setPoint() {
45663
45679
  const pointer = this.board.pointer.point;
45664
- const { item, anchor } = this.snap;
45665
- if (item) {
45680
+ const { item: item2, anchor } = this.snap;
45681
+ if (item2) {
45666
45682
  if (!anchor) {
45667
- const point5 = item.getNearestEdgePointTo(pointer);
45683
+ const point5 = item2.getNearestEdgePointTo(pointer);
45668
45684
  if (point5.getDistance(pointer) < this.distance.border || !this.hover.isTimeoutElapsed) {
45669
45685
  this.snap.point = new Anchor(point5.x, point5.y, 5, this.color.pointBorder, this.color.pointBackground, 1);
45670
45686
  } else {
@@ -46037,12 +46053,12 @@ class NestingHighlighter extends Tool {
46037
46053
  this.toHighlight.push({ groupItem, children: array });
46038
46054
  }
46039
46055
  }
46040
- addSingleItem(item) {
46041
- this.toHighlight.push({ children: [item] });
46056
+ addSingleItem(item2) {
46057
+ this.toHighlight.push({ children: [item2] });
46042
46058
  }
46043
- remove(item) {
46059
+ remove(item2) {
46044
46060
  this.toHighlight.forEach((group) => {
46045
- group.children = group.children.filter((child) => child !== item);
46061
+ group.children = group.children.filter((child) => child !== item2);
46046
46062
  });
46047
46063
  this.toHighlight = this.toHighlight.filter((group) => group.children.length > 0);
46048
46064
  }
@@ -46109,7 +46125,7 @@ class AddFrame extends BoardTool {
46109
46125
  this.mbr.borderColor = "blue";
46110
46126
  this.nestingHighlighter.clear();
46111
46127
  const enclosedOrCrossed = this.board.items.getEnclosedOrCrossed(this.mbr.left, this.mbr.top, this.mbr.right, this.mbr.bottom);
46112
- const inside = enclosedOrCrossed.filter((item) => !(item instanceof Frame2) && item.parent === "Board" && this.mbr.isInside(item.getMbr().getCenter()));
46128
+ const inside = enclosedOrCrossed.filter((item2) => !(item2 instanceof Frame2) && item2.parent === "Board" && this.mbr.isInside(item2.getMbr().getCenter()));
46113
46129
  this.nestingHighlighter.add(this.frame, inside);
46114
46130
  this.initTransformation();
46115
46131
  this.board.tools.publish();
@@ -46130,7 +46146,7 @@ class AddFrame extends BoardTool {
46130
46146
  localStorage.setItem("lastFrameScale", JSON.stringify(this.frame.transformation.getScale()));
46131
46147
  }
46132
46148
  const currMbr = this.frame.getMbr();
46133
- const frameChildren = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board").filter((item) => this.frame.handleNesting(item));
46149
+ const frameChildren = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item2) => item2.parent === "Board").filter((item2) => this.frame.handleNesting(item2));
46134
46150
  this.applyAddChildren(frameChildren);
46135
46151
  if (this.shape !== "Custom") {
46136
46152
  this.applyCanChangeRatio(false);
@@ -46146,7 +46162,7 @@ class AddFrame extends BoardTool {
46146
46162
  return true;
46147
46163
  }
46148
46164
  addNextTo() {
46149
- const framesInView = this.board.items.getItemsInView().filter((item) => item instanceof Frame2);
46165
+ const framesInView = this.board.items.getItemsInView().filter((item2) => item2 instanceof Frame2);
46150
46166
  if (framesInView.length === 0) {
46151
46167
  if (this.shape === "Custom") {
46152
46168
  const { x, y } = this.frame.getLastFrameScale();
@@ -46184,7 +46200,7 @@ class AddFrame extends BoardTool {
46184
46200
  this.board.camera.viewRectangle(this.frame.getMbr());
46185
46201
  }
46186
46202
  const frameMbr = this.frame.getMbr();
46187
- this.board.items.getEnclosedOrCrossed(frameMbr.left, frameMbr.top, frameMbr.right, frameMbr.bottom).filter((item) => item.parent === "Board").filter((item) => this.frame.handleNesting(item)).forEach((item) => this.applyAddChildren([item]));
46203
+ this.board.items.getEnclosedOrCrossed(frameMbr.left, frameMbr.top, frameMbr.right, frameMbr.bottom).filter((item2) => item2.parent === "Board").filter((item2) => this.frame.handleNesting(item2)).forEach((item2) => this.applyAddChildren([item2]));
46188
46204
  const frame = this.board.add(this.frame);
46189
46205
  frame.text.editor.moveCursorToEndOfTheText();
46190
46206
  this.nestingHighlighter.clear();
@@ -46689,13 +46705,13 @@ class Eraser extends BoardTool {
46689
46705
  }
46690
46706
  removeUnderPointOrLine() {
46691
46707
  const segments = this.drawing.getLines();
46692
- const items = this.board.items.getUnderPointer(this.strokeWidth / 2).filter((item) => {
46693
- return item.itemType === "Drawing" && item.getLines().find((line) => {
46694
- return line.getDistance(this.board.pointer.point) <= item.strokeWidth / 2 + this.strokeWidth / 2;
46708
+ const items = this.board.items.getUnderPointer(this.strokeWidth / 2).filter((item2) => {
46709
+ return item2.itemType === "Drawing" && item2.getLines().find((line) => {
46710
+ return line.getDistance(this.board.pointer.point) <= item2.strokeWidth / 2 + this.strokeWidth / 2;
46695
46711
  });
46696
46712
  });
46697
- items.push(...this.board.items.getEnclosedOrCrossed(this.drawing.points[0].x, this.drawing.points[0].y, this.board.pointer.point.x, this.board.pointer.point.y).filter((item) => {
46698
- return item.itemType === "Drawing" && item.getLines().some((line) => {
46713
+ items.push(...this.board.items.getEnclosedOrCrossed(this.drawing.points[0].x, this.drawing.points[0].y, this.board.pointer.point.x, this.board.pointer.point.y).filter((item2) => {
46714
+ return item2.itemType === "Drawing" && item2.getLines().some((line) => {
46699
46715
  return segments.some((segment) => segment.hasIntersectionPoint(line));
46700
46716
  });
46701
46717
  }));
@@ -47147,20 +47163,20 @@ function createCanvasDrawer(board) {
47147
47163
  context.ctx.setTransform(board2.camera.getMatrix().scaleX, 0, 0, board2.camera.getMatrix().scaleY, 0, 0);
47148
47164
  context.matrix.applyToContext(context.ctx);
47149
47165
  const items = Object.keys(translation).map((id) => {
47150
- const item = board2.items.getById(id);
47151
- if (item) {
47152
- if (item.itemType !== "Frame") {
47153
- return item;
47166
+ const item2 = board2.items.getById(id);
47167
+ if (item2) {
47168
+ if (item2.itemType !== "Frame") {
47169
+ return item2;
47154
47170
  }
47155
- item.render(context);
47156
- return item;
47171
+ item2.render(context);
47172
+ return item2;
47157
47173
  }
47158
47174
  return;
47159
- }).filter((item) => !!item);
47160
- items.forEach((item) => {
47161
- if (item.itemType !== "Frame") {
47162
- item.render(context);
47163
- board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
47175
+ }).filter((item2) => !!item2);
47176
+ items.forEach((item2) => {
47177
+ if (item2.itemType !== "Frame") {
47178
+ item2.render(context);
47179
+ board2.selection.renderItemMbr(context, item2, board2.camera.getMatrix().scaleX);
47164
47180
  }
47165
47181
  });
47166
47182
  return { canvas: container, items };
@@ -47221,10 +47237,10 @@ function createCanvasDrawer(board) {
47221
47237
  if (lastTranslationKeys) {
47222
47238
  board.selection.shouldPublish = false;
47223
47239
  lastTranslationKeys.forEach((id) => {
47224
- const item = board.items.getById(id);
47225
- if (item) {
47226
- item.transformationRenderBlock = undefined;
47227
- item.subject.publish(item);
47240
+ const item2 = board.items.getById(id);
47241
+ if (item2) {
47242
+ item2.transformationRenderBlock = undefined;
47243
+ item2.subject.publish(item2);
47228
47244
  }
47229
47245
  });
47230
47246
  lastTranslationKeys = undefined;
@@ -47256,9 +47272,9 @@ function createCanvasDrawer(board) {
47256
47272
  lastCreatedCanvas = cnvs;
47257
47273
  lastTranslationKeys = Object.keys(translation);
47258
47274
  lastTranslationKeys.forEach((id) => {
47259
- const item = board.items.getById(id);
47260
- if (item) {
47261
- item.transformationRenderBlock = true;
47275
+ const item2 = board.items.getById(id);
47276
+ if (item2) {
47277
+ item2.transformationRenderBlock = true;
47262
47278
  }
47263
47279
  });
47264
47280
  board.selection.transformationRenderBlock = true;
@@ -47268,14 +47284,14 @@ function createCanvasDrawer(board) {
47268
47284
  }
47269
47285
  function countSumMbr(translation) {
47270
47286
  return Object.keys(translation).reduce((mbr, id) => {
47271
- const item = board.items.getById(id);
47272
- if (item) {
47287
+ const item2 = board.items.getById(id);
47288
+ if (item2) {
47273
47289
  if (!mbr) {
47274
- mbr = item.getMbr();
47290
+ mbr = item2.getMbr();
47275
47291
  } else {
47276
- mbr.combine(item.getMbr());
47277
- if (item.itemType === "Frame") {
47278
- mbr.combine(item.getRichText().getMbr());
47292
+ mbr.combine(item2.getMbr());
47293
+ if (item2.itemType === "Frame") {
47294
+ mbr.combine(item2.getRichText().getMbr());
47279
47295
  }
47280
47296
  }
47281
47297
  }
@@ -47306,8 +47322,8 @@ function createCanvasDrawer(board) {
47306
47322
  }
47307
47323
  function highlightNesting() {
47308
47324
  const container = getLastCreatedCanvas();
47309
- const drawnItemsMap = drawnItems?.reduce((acc, item) => {
47310
- acc.set(item.getId(), { item, mbr: item.getMbr() });
47325
+ const drawnItemsMap = drawnItems?.reduce((acc, item2) => {
47326
+ acc.set(item2.getId(), { item: item2, mbr: item2.getMbr() });
47311
47327
  return acc;
47312
47328
  }, new Map);
47313
47329
  if (!container || !drawnItems) {
@@ -47342,11 +47358,11 @@ function createCanvasDrawer(board) {
47342
47358
  mbr.transform(currMatrix);
47343
47359
  });
47344
47360
  groups.forEach((group) => {
47345
- drawnItemsMap?.forEach(({ mbr, item }, key) => {
47346
- if ("canBeNested" in item && !item.canBeNested) {
47361
+ drawnItemsMap?.forEach(({ mbr, item: item2 }, key) => {
47362
+ if ("canBeNested" in item2 && !item2.canBeNested) {
47347
47363
  return;
47348
47364
  }
47349
- if (lastCreatedCanvas && (!drawnItemsMap.get(group.getId()) || item.parent !== group.getId()) && group.handleNesting(mbr)) {
47365
+ if (lastCreatedCanvas && (!drawnItemsMap.get(group.getId()) || item2.parent !== group.getId()) && group.handleNesting(mbr)) {
47350
47366
  const div = createBorderDivForItem(mbr, lastCreatedCanvas);
47351
47367
  removeHighlighted(key);
47352
47368
  highlightedDivs.set(key, div);
@@ -47407,10 +47423,10 @@ function createCanvasDrawer(board) {
47407
47423
  }
47408
47424
 
47409
47425
  // src/Selection/QuickAddButtons/quickAddHelpers.ts
47410
- function getControlPointData(item, index2, isRichText = false) {
47411
- const itemScale = isRichText ? { x: 1, y: 1 } : item.transformation.getScale();
47412
- const width2 = item.getPathMbr().getWidth();
47413
- let height3 = item.getPathMbr().getHeight();
47426
+ function getControlPointData(item2, index2, isRichText = false) {
47427
+ const itemScale = isRichText ? { x: 1, y: 1 } : item2.transformation.getScale();
47428
+ const width2 = item2.getPathMbr().getWidth();
47429
+ let height3 = item2.getPathMbr().getHeight();
47414
47430
  const adjMapScaled = {
47415
47431
  0: { x: 0, y: height3 / 2 / itemScale.y },
47416
47432
  1: {
@@ -47425,7 +47441,7 @@ function getControlPointData(item, index2, isRichText = false) {
47425
47441
  };
47426
47442
  return {
47427
47443
  pointType: "Fixed",
47428
- itemId: item.getId(),
47444
+ itemId: item2.getId(),
47429
47445
  relativeX: adjMapScaled[index2].x,
47430
47446
  relativeY: adjMapScaled[index2].y
47431
47447
  };
@@ -47560,10 +47576,10 @@ function getQuickAddButtons(selection, board) {
47560
47576
  let newHeight = height3;
47561
47577
  let itemData;
47562
47578
  if (selectedItem.itemType === "AINode" || selectedItem.itemType === "RichText") {
47563
- const item = selectedItem.itemType === "AINode" ? createAINode2(board, index2, selectedItem.getId()) : createRichText2(board);
47564
- newWidth = item.getMbr().getWidth();
47565
- newHeight = item.getMbr().getHeight();
47566
- itemData = item.serialize();
47579
+ const item2 = selectedItem.itemType === "AINode" ? createAINode2(board, index2, selectedItem.getId()) : createRichText2(board);
47580
+ newWidth = item2.getMbr().getWidth();
47581
+ newHeight = item2.getMbr().getHeight();
47582
+ itemData = item2.serialize();
47567
47583
  const { minX, minY, maxY, maxX } = offsets;
47568
47584
  offsetX = Math.min(offsetX, maxX);
47569
47585
  offsetX = Math.max(offsetX, minX);
@@ -47596,7 +47612,7 @@ function getQuickAddButtons(selection, board) {
47596
47612
  }
47597
47613
  const newMbr = new Mbr(newItemData.transformation?.translateX, newItemData.transformation?.translateY, (newItemData.transformation?.translateX || 0) + newWidth, (newItemData.transformation?.translateY || 0) + newHeight);
47598
47614
  let step = 1;
47599
- while (board.index.getItemsEnclosedOrCrossed(newMbr.left, newMbr.top, newMbr.right, newMbr.bottom).filter((item) => item.itemType !== "Connector").length > 0) {
47615
+ while (board.index.getItemsEnclosedOrCrossed(newMbr.left, newMbr.top, newMbr.right, newMbr.bottom).filter((item2) => item2.itemType !== "Connector").length > 0) {
47600
47616
  const xDirection = step % 2 === 0 ? -1 : 1;
47601
47617
  const yDirection = newItemData.itemType === "AINode" ? -1 : xDirection;
47602
47618
  newMbr.transform(new Matrix2(iterAdjustment[index2].x * xDirection * step, iterAdjustment[index2].y * yDirection * (newItemData.itemType === "AINode" ? 1 : step)));
@@ -47729,7 +47745,7 @@ function getQuickAddButtons(selection, board) {
47729
47745
  clear();
47730
47746
  return;
47731
47747
  }
47732
- const { positions, item } = position4;
47748
+ const { positions, item: item2 } = position4;
47733
47749
  const cameraMatrix = board.camera.getMatrix();
47734
47750
  const cameraMbr = board.camera.getMbr();
47735
47751
  const positionAdjustments = {
@@ -47757,7 +47773,7 @@ function getQuickAddButtons(selection, board) {
47757
47773
  };
47758
47774
  const button = document.createElement("button");
47759
47775
  button.classList.add("microboard-quickAddButton");
47760
- if (item.itemType === "AINode" && index2 === 2) {
47776
+ if (item2.itemType === "AINode" && index2 === 2) {
47761
47777
  button.classList.add("microboard-invisible");
47762
47778
  }
47763
47779
  button.classList.add(`microboard-${adjustment.rotate}`);
@@ -47773,7 +47789,7 @@ function getQuickAddButtons(selection, board) {
47773
47789
  clearTimeout(timeoutId);
47774
47790
  }
47775
47791
  if (button.isMouseDown) {
47776
- board.tools.addConnector(true, item, pos);
47792
+ board.tools.addConnector(true, item2, pos);
47777
47793
  } else {
47778
47794
  quickAddItems = undefined;
47779
47795
  selection.subject.publish(selection);
@@ -47880,11 +47896,11 @@ class AlignmentHelper {
47880
47896
  return baseThickness / (zoom / 100);
47881
47897
  }
47882
47898
  combineMBRs(items) {
47883
- return items.reduce((acc, item, i) => {
47899
+ return items.reduce((acc, item2, i) => {
47884
47900
  if (i === 0) {
47885
47901
  return acc;
47886
47902
  }
47887
- const itemMbr = item.getPathMbr();
47903
+ const itemMbr = item2.getPathMbr();
47888
47904
  return acc.combine(itemMbr);
47889
47905
  }, items[0].getMbr());
47890
47906
  }
@@ -47898,7 +47914,7 @@ class AlignmentHelper {
47898
47914
  const scale = this.board.camera.getScale();
47899
47915
  const dynamicAlignThreshold = Math.min(this.alignThreshold / scale, 8);
47900
47916
  const childrenIds = "index" in movingItem && movingItem.index ? movingItem.getChildrenIds() : [];
47901
- const nearbyItems = this.canvasDrawer.getLastCreatedCanvas() ? this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (item) => !excludeItems.includes(item), Math.ceil(cameraWidth)) : this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (otherItem) => otherItem !== movingMBR && otherItem.itemType !== "Connector" && otherItem.itemType !== "Drawing" && otherItem.isInView(camera) && !childrenIds.includes(otherItem.getId()), Math.ceil(cameraWidth)).filter((item) => Array.isArray(movingItem) ? !movingItem.includes(item) : true);
47917
+ const nearbyItems = this.canvasDrawer.getLastCreatedCanvas() ? this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (item2) => !excludeItems.includes(item2), Math.ceil(cameraWidth)) : this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (otherItem) => otherItem !== movingMBR && otherItem.itemType !== "Connector" && otherItem.itemType !== "Drawing" && otherItem.isInView(camera) && !childrenIds.includes(otherItem.getId()), Math.ceil(cameraWidth)).filter((item2) => Array.isArray(movingItem) ? !movingItem.includes(item2) : true);
47902
47918
  const verticalAlignments = new Map;
47903
47919
  const horizontalAlignments = new Map;
47904
47920
  const addVerticalAlignment = (x, minY, maxY) => {
@@ -47919,11 +47935,11 @@ class AlignmentHelper {
47919
47935
  horizontalAlignments.set(y, { minX, maxX });
47920
47936
  }
47921
47937
  };
47922
- nearbyItems.forEach((item) => {
47923
- if (item === movingItem || item.itemType === "Comment") {
47938
+ nearbyItems.forEach((item2) => {
47939
+ if (item2 === movingItem || item2.itemType === "Comment") {
47924
47940
  return;
47925
47941
  }
47926
- const itemMbr = item.itemType === "Shape" ? item.getPath().getMbr() : item.getMbr();
47942
+ const itemMbr = item2.itemType === "Shape" ? item2.getPath().getMbr() : item2.getMbr();
47927
47943
  const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
47928
47944
  const centerXItem = (itemMbr.left + itemMbr.right) / 2;
47929
47945
  const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
@@ -48190,20 +48206,20 @@ class AlignmentHelper {
48190
48206
  }
48191
48207
  return false;
48192
48208
  }
48193
- translateItems(item, x, y, timeStamp) {
48209
+ translateItems(item2, x, y, timeStamp) {
48194
48210
  if (this.canvasDrawer.getLastCreatedCanvas()) {
48195
48211
  return;
48196
48212
  }
48197
- if (Array.isArray(item)) {
48213
+ if (Array.isArray(item2)) {
48198
48214
  const translation = this.board.selection.getManyItemsTranslation(x, y);
48199
48215
  this.board.selection.transformMany(translation, timeStamp);
48200
48216
  return;
48201
48217
  }
48202
- if (item.itemType === "Frame") {
48218
+ if (item2.itemType === "Frame") {
48203
48219
  const translation = this.board.selection.getManyItemsTranslation(x, y);
48204
48220
  this.board.selection.transformMany(translation, timeStamp);
48205
48221
  } else {
48206
- const id = item.getId();
48222
+ const id = item2.getId();
48207
48223
  const transformMap = {};
48208
48224
  transformMap[id] = {
48209
48225
  class: "Transformation",
@@ -48331,12 +48347,12 @@ class Select extends Tool {
48331
48347
  this.debounceUpd.setFalse();
48332
48348
  this.snapLines = { verticalLines: [], horizontalLines: [] };
48333
48349
  }
48334
- handleSnapping(item) {
48350
+ handleSnapping(item2) {
48335
48351
  if (this.board.keyboard.isShift) {
48336
48352
  return false;
48337
48353
  }
48338
- const increasedSnapThreshold = Array.isArray(item) ? 40 : 35;
48339
- this.isSnapped = this.alignmentHelper.snapToClosestLine(item, this.snapLines, this.beginTimeStamp, this.board.pointer.point);
48354
+ const increasedSnapThreshold = Array.isArray(item2) ? 40 : 35;
48355
+ this.isSnapped = this.alignmentHelper.snapToClosestLine(item2, this.snapLines, this.beginTimeStamp, this.board.pointer.point);
48340
48356
  if (this.isSnapped) {
48341
48357
  if (!this.snapCursorPos) {
48342
48358
  this.snapCursorPos = new Point(this.board.pointer.point.x, this.board.pointer.point.y);
@@ -48346,10 +48362,10 @@ class Select extends Tool {
48346
48362
  if ((cursorDiffX > increasedSnapThreshold || cursorDiffY > increasedSnapThreshold) && this.initialCursorPos) {
48347
48363
  this.isSnapped = false;
48348
48364
  this.snapCursorPos = null;
48349
- const itemCenter = Array.isArray(item) ? this.alignmentHelper.combineMBRs(item).getCenter() : item.getMbr().getCenter();
48365
+ const itemCenter = Array.isArray(item2) ? this.alignmentHelper.combineMBRs(item2).getCenter() : item2.getMbr().getCenter();
48350
48366
  const translateX = this.board.pointer.point.x - this.initialCursorPos.x - itemCenter.x;
48351
48367
  const translateY = this.board.pointer.point.y - this.initialCursorPos.y - itemCenter.y;
48352
- this.alignmentHelper.translateItems(item, translateX, translateY, this.beginTimeStamp);
48368
+ this.alignmentHelper.translateItems(item2, translateX, translateY, this.beginTimeStamp);
48353
48369
  }
48354
48370
  }
48355
48371
  return false;
@@ -48399,10 +48415,10 @@ class Select extends Tool {
48399
48415
  angleDiff = angleDiff < 0 ? angleDiff + 360 : angleDiff;
48400
48416
  return Math.min(angleDiff, 360 - angleDiff);
48401
48417
  }
48402
- handleShiftGuidelines(item, mousePosition) {
48403
- if (item) {
48418
+ handleShiftGuidelines(item2, mousePosition) {
48419
+ if (item2) {
48404
48420
  if (!this.originalCenter) {
48405
- this.originalCenter = Array.isArray(item) ? this.board.selection.getMbr()?.getCenter().copy() : item.getMbr().getCenter().copy();
48421
+ this.originalCenter = Array.isArray(item2) ? this.board.selection.getMbr()?.getCenter().copy() : item2.getMbr().getCenter().copy();
48406
48422
  this.guidelines = this.alignmentHelper.generateGuidelines(this.originalCenter).lines;
48407
48423
  }
48408
48424
  this.mainLine = new Line(this.originalCenter, mousePosition);
@@ -48423,13 +48439,13 @@ class Select extends Tool {
48423
48439
  const newEndX = this.originalCenter.x + snapDirectionX * mainLineLength;
48424
48440
  const newEndY = this.originalCenter.y + snapDirectionY * mainLineLength;
48425
48441
  const threshold = Infinity;
48426
- const translateX = newEndX - (Array.isArray(item) ? this.board.selection.getMbr()?.getCenter().x : item.getMbr().getCenter().x);
48427
- const translateY = newEndY - (Array.isArray(item) ? this.board.selection.getMbr()?.getCenter().y : item.getMbr().getCenter().y);
48428
- if (Array.isArray(item)) {
48442
+ const translateX = newEndX - (Array.isArray(item2) ? this.board.selection.getMbr()?.getCenter().x : item2.getMbr().getCenter().x);
48443
+ const translateY = newEndY - (Array.isArray(item2) ? this.board.selection.getMbr()?.getCenter().y : item2.getMbr().getCenter().y);
48444
+ if (Array.isArray(item2)) {
48429
48445
  const translation = this.board.selection.getManyItemsTranslation(translateX, translateY);
48430
48446
  this.board.selection.transformMany(translation, this.beginTimeStamp);
48431
48447
  } else {
48432
- item.transformation.translateBy(translateX, translateY, this.beginTimeStamp);
48448
+ item2.transformation.translateBy(translateX, translateY, this.beginTimeStamp);
48433
48449
  }
48434
48450
  }
48435
48451
  }
@@ -48472,7 +48488,7 @@ class Select extends Tool {
48472
48488
  return false;
48473
48489
  }
48474
48490
  this.isDownOnBoard = hover.length === 0;
48475
- this.isDrawingRectangle = hover.filter((item) => !(item instanceof Frame2)).length === 0 && hover.filter((item) => item instanceof Frame2).filter((frame) => frame.isTextUnderPoint(pointer.point)).length === 0;
48491
+ this.isDrawingRectangle = hover.filter((item2) => !(item2 instanceof Frame2)).length === 0 && hover.filter((item2) => item2 instanceof Frame2).filter((frame) => frame.isTextUnderPoint(pointer.point)).length === 0;
48476
48492
  if (this.isDrawingRectangle) {
48477
48493
  const { x, y } = pointer.point;
48478
48494
  this.line = new Line(new Point(x, y), new Point(x, y));
@@ -48492,7 +48508,7 @@ class Select extends Tool {
48492
48508
  });
48493
48509
  return false;
48494
48510
  }
48495
- const isHoverLocked = hover.every((item) => item.transformation.isLocked);
48511
+ const isHoverLocked = hover.every((item2) => item2.transformation.isLocked);
48496
48512
  if (isHoverLocked) {
48497
48513
  return false;
48498
48514
  }
@@ -48626,7 +48642,7 @@ class Select extends Tool {
48626
48642
  const translation = selection.getManyItemsTranslation(x, y);
48627
48643
  const translationKeys = Object.keys(translation);
48628
48644
  const commentsSet = new Set(this.board.items.getComments().map((comment2) => comment2.getId()));
48629
- if (translationKeys.filter((item) => !commentsSet.has(item)).length > 10) {
48645
+ if (translationKeys.filter((item2) => !commentsSet.has(item2)).length > 10) {
48630
48646
  const selectedMbr = this.board.selection.getMbr()?.copy();
48631
48647
  const sumMbr = this.canvasDrawer.countSumMbr(translation);
48632
48648
  if (sumMbr) {
@@ -48653,7 +48669,7 @@ class Select extends Tool {
48653
48669
  return false;
48654
48670
  }
48655
48671
  const draggingMbr = draggingItem.getMbr();
48656
- const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => item instanceof Frame2);
48672
+ const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item2) => item2 instanceof Frame2);
48657
48673
  frames.forEach((frame) => {
48658
48674
  if (frame.handleNesting(draggingItem)) {
48659
48675
  this.nestingHighlighter.add(frame, draggingItem);
@@ -48663,7 +48679,7 @@ class Select extends Tool {
48663
48679
  });
48664
48680
  }
48665
48681
  const hover = items.getUnderPointer();
48666
- this.isHoverUnselectedItem = hover.filter((item) => item.itemType === "Placeholder").length === 1;
48682
+ this.isHoverUnselectedItem = hover.filter((item2) => item2.itemType === "Placeholder").length === 1;
48667
48683
  if (this.isHoverUnselectedItem && !this.isDraggingUnselectedItem && selection.getContext() === "None") {
48668
48684
  selection.setContext("HoverUnderPointer");
48669
48685
  return false;
@@ -48707,15 +48723,15 @@ class Select extends Tool {
48707
48723
  }
48708
48724
  }
48709
48725
  updateFramesNesting(selectionMbr, selection) {
48710
- const frames = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => item instanceof Frame2).filter((frame) => !selection.items.list().includes(frame));
48711
- const draggingFramesIds = selection.list().filter((item) => item instanceof Frame2).map((frame) => frame.getId());
48712
- selection.list().forEach((item) => {
48713
- if (!(item instanceof Frame2) && !draggingFramesIds.includes(item.parent)) {
48726
+ const frames = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item2) => item2 instanceof Frame2).filter((frame) => !selection.items.list().includes(frame));
48727
+ const draggingFramesIds = selection.list().filter((item2) => item2 instanceof Frame2).map((frame) => frame.getId());
48728
+ selection.list().forEach((item2) => {
48729
+ if (!(item2 instanceof Frame2) && !draggingFramesIds.includes(item2.parent)) {
48714
48730
  frames.forEach((frame) => {
48715
- if (frame.handleNesting(item)) {
48716
- this.nestingHighlighter.add(frame, item);
48731
+ if (frame.handleNesting(item2)) {
48732
+ this.nestingHighlighter.add(frame, item2);
48717
48733
  } else {
48718
- this.nestingHighlighter.remove(item);
48734
+ this.nestingHighlighter.remove(item2);
48719
48735
  }
48720
48736
  });
48721
48737
  }
@@ -48807,7 +48823,7 @@ class Select extends Tool {
48807
48823
  const childrenIds = underPointer.getChildrenIds();
48808
48824
  console.log("UNDERPOINTER", underPointer);
48809
48825
  console.log("CHILDREN", childrenIds);
48810
- const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => childrenIds && childrenIds.includes(item.getId()));
48826
+ const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item2) => childrenIds && childrenIds.includes(item2.getId()));
48811
48827
  this.board.selection.add(itemsInFrame);
48812
48828
  }
48813
48829
  this.board.selection.setContext("EditUnderPointer");
@@ -49047,8 +49063,8 @@ class ShapeTool extends CustomTool {
49047
49063
  resizeType = "leftBottom";
49048
49064
  bounds = new Mbr;
49049
49065
  isDown = false;
49050
- constructor(board, name, item, settings) {
49051
- super(board, name, item);
49066
+ constructor(board, name, item2, settings) {
49067
+ super(board, name, item2);
49052
49068
  this.settings = settings;
49053
49069
  this.setCursor();
49054
49070
  }
@@ -49131,8 +49147,8 @@ class ShapeTool extends CustomTool {
49131
49147
 
49132
49148
  class StickerTool extends CustomTool {
49133
49149
  settings;
49134
- constructor(board, name, item, settings) {
49135
- super(board, name, item);
49150
+ constructor(board, name, item2, settings) {
49151
+ super(board, name, item2);
49136
49152
  this.settings = settings;
49137
49153
  this.setCursor();
49138
49154
  }
@@ -49438,7 +49454,7 @@ class Tools extends ToolContext {
49438
49454
  this.subject.publish(this);
49439
49455
  }
49440
49456
  sortFrames() {
49441
- const frames = this.board.items.listAll().filter((item) => item instanceof Frame2);
49457
+ const frames = this.board.items.listAll().filter((item2) => item2 instanceof Frame2);
49442
49458
  const sortedFrames = frames.sort((fr1, fr2) => {
49443
49459
  const mbr1 = fr1.getMbr();
49444
49460
  const mbr2 = fr2.getMbr();
@@ -49664,24 +49680,24 @@ function validateGroupData(groupData) {
49664
49680
  }
49665
49681
  // src/Items/RegisterItem.ts
49666
49682
  function registerItem({
49667
- item,
49683
+ item: item2,
49668
49684
  defaultData: defaultData2,
49669
49685
  toolData
49670
49686
  }) {
49671
49687
  const { itemType } = defaultData2;
49672
- itemFactories[itemType] = createItemFactory(item, defaultData2);
49688
+ itemFactories[itemType] = createItemFactory(item2, defaultData2);
49673
49689
  itemValidators[itemType] = createItemValidator(defaultData2);
49674
49690
  if (toolData) {
49675
49691
  registeredTools[toolData.name] = toolData.tool;
49676
49692
  }
49677
49693
  itemCommandFactories[itemType] = createItemCommandFactory(itemType);
49678
49694
  }
49679
- function createItemFactory(item, defaultData2) {
49695
+ function createItemFactory(item2, defaultData2) {
49680
49696
  return function itemFactory(id, data, board) {
49681
49697
  if (data.itemType !== defaultData2.itemType) {
49682
49698
  throw new Error(`Invalid data for ${defaultData2.itemType}`);
49683
49699
  }
49684
- return new item(board, id, defaultData2).setId(id).deserialize(data);
49700
+ return new item2(board, id, defaultData2).setId(id).deserialize(data);
49685
49701
  };
49686
49702
  }
49687
49703
  function createItemValidator(defaultData2) {
@@ -49696,7 +49712,7 @@ function createItemValidator(defaultData2) {
49696
49712
  }
49697
49713
  function createItemCommandFactory(itemType) {
49698
49714
  return function itemCommandFactory(items, operation) {
49699
- return new BaseCommand(items.filter((item) => item.itemType === itemType), operation);
49715
+ return new BaseCommand(items.filter((item2) => item2.itemType === itemType), operation);
49700
49716
  };
49701
49717
  }
49702
49718
  // src/Items/Examples/Star/AddStar.ts
@@ -50721,8 +50737,8 @@ class Camera {
50721
50737
  this.observableItem = null;
50722
50738
  }
50723
50739
  }
50724
- subscribeToItem(item) {
50725
- this.observableItem = item;
50740
+ subscribeToItem(item2) {
50741
+ this.observableItem = item2;
50726
50742
  this.observableItem.subject.subscribe(this.observeItem);
50727
50743
  }
50728
50744
  observeItem = () => {
@@ -50948,7 +50964,7 @@ class Camera {
50948
50964
  }
50949
50965
  addToView(mbr, inView) {
50950
50966
  if (!mbr.isEnclosedBy(this.getMbr())) {
50951
- this.viewRectangle(inView.reduce((acc, item) => acc.combine(item.getMbr()), inView[0]?.getMbr() ?? new Mbr).combine(mbr));
50967
+ this.viewRectangle(inView.reduce((acc, item2) => acc.combine(item2.getMbr()), inView[0]?.getMbr() ?? new Mbr).combine(mbr));
50952
50968
  }
50953
50969
  }
50954
50970
  viewRectangle(mbr, offsetInPercent = 10, duration = 500) {
@@ -52557,8 +52573,8 @@ class Presence {
52557
52573
  <path fill-rule="evenodd" clip-rule="evenodd" d="M3.28421 4.30174C3.55182 4.02741 3.95268 3.93015 4.31625 4.05135L20.3163 9.38468C20.7064 9.51472 20.9771 9.8703 20.9987 10.2809C21.0202 10.6916 20.7882 11.0736 20.4138 11.2437L20.36 11.2682L20.2042 11.3396C20.069 11.4015 19.8742 11.4912 19.636 11.6017C19.1595 11.8227 18.5109 12.1262 17.8216 12.4571C16.4106 13.1344 14.9278 13.8797 14.3325 14.2765C14.3325 14.2765 14.3258 14.2809 14.308 14.2965C14.2906 14.3118 14.2673 14.3339 14.2382 14.3646C14.1791 14.4267 14.1072 14.5123 14.0231 14.6243C13.8542 14.8496 13.6622 15.1471 13.4541 15.5039C13.0384 16.2164 12.5946 17.1024 12.1833 17.98C11.7735 18.8541 11.4038 19.7031 11.136 20.3348C11.0023 20.6502 10.8944 20.9105 10.8201 21.0915C10.783 21.182 10.7543 21.2525 10.735 21.3002L10.7132 21.3542L10.7066 21.3707C10.5524 21.7561 10.1759 22.0069 9.76082 21.9999C9.34577 21.9928 8.97824 21.7301 8.83725 21.3397L3.05947 5.33967C2.92931 4.97922 3.0166 4.57607 3.28421 4.30174Z" fill="${color2}"/>
52558
52574
  </svg>`;
52559
52575
  }
52560
- renderItemMbr(context, item, color2, customScale) {
52561
- const mbr = item.getMbr();
52576
+ renderItemMbr(context, item2, color2, customScale) {
52577
+ const mbr = item2.getMbr();
52562
52578
  mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
52563
52579
  mbr.borderColor = color2;
52564
52580
  mbr.render(context);
@@ -52698,8 +52714,8 @@ class Presence {
52698
52714
  selectionMbr.strokeWidth = 1 / context.matrix.scaleX;
52699
52715
  selectionMbr.borderColor = selection.color;
52700
52716
  selectionMbr.render(context);
52701
- for (const item of selection.selection) {
52702
- this.renderItemMbr(context, item, selection.color);
52717
+ for (const item2 of selection.selection) {
52718
+ this.renderItemMbr(context, item2, selection.color);
52703
52719
  }
52704
52720
  }
52705
52721
  }
@@ -52732,14 +52748,14 @@ class SelectionItems {
52732
52748
  items = new Map;
52733
52749
  add(value) {
52734
52750
  if (Array.isArray(value)) {
52735
- value.forEach((item) => this.items.set(item.getId(), item));
52751
+ value.forEach((item2) => this.items.set(item2.getId(), item2));
52736
52752
  } else {
52737
52753
  this.items.set(value.getId(), value);
52738
52754
  }
52739
52755
  }
52740
52756
  remove(value) {
52741
52757
  if (Array.isArray(value)) {
52742
- value.forEach((item) => this.items.delete(item.getId()));
52758
+ value.forEach((item2) => this.items.delete(item2.getId()));
52743
52759
  } else {
52744
52760
  this.items.delete(value.getId());
52745
52761
  }
@@ -52769,8 +52785,8 @@ class SelectionItems {
52769
52785
  if (this.isEmpty()) {
52770
52786
  return false;
52771
52787
  }
52772
- for (const item of this.items.values()) {
52773
- if (item.itemType !== "RichText") {
52788
+ for (const item2 of this.items.values()) {
52789
+ if (item2.itemType !== "RichText") {
52774
52790
  return false;
52775
52791
  }
52776
52792
  }
@@ -52780,14 +52796,14 @@ class SelectionItems {
52780
52796
  if (this.isEmpty()) {
52781
52797
  return false;
52782
52798
  }
52783
- return Array.from(this.items).every(([, item]) => item.itemType === itemType);
52799
+ return Array.from(this.items).every(([, item2]) => item2.itemType === itemType);
52784
52800
  }
52785
52801
  isItemTypes(itemTypes) {
52786
52802
  if (this.isEmpty()) {
52787
52803
  return false;
52788
52804
  }
52789
- for (const item of this.items.values()) {
52790
- if (!itemTypes.includes(item.itemType)) {
52805
+ for (const item2 of this.items.values()) {
52806
+ if (!itemTypes.includes(item2.itemType)) {
52791
52807
  return false;
52792
52808
  }
52793
52809
  }
@@ -52795,16 +52811,16 @@ class SelectionItems {
52795
52811
  }
52796
52812
  getItemTypes() {
52797
52813
  const itemTypes = new Set;
52798
- this.items.forEach((item) => itemTypes.add(item.itemType));
52814
+ this.items.forEach((item2) => itemTypes.add(item2.itemType));
52799
52815
  return Array.from(itemTypes);
52800
52816
  }
52801
52817
  getItemsByItemTypes(itemTypes) {
52802
- return Array.from(this.items.values()).filter((item) => itemTypes.includes(item.itemType));
52818
+ return Array.from(this.items.values()).filter((item2) => itemTypes.includes(item2.itemType));
52803
52819
  }
52804
52820
  getIdsByItemTypes(itemTypes) {
52805
52821
  const ids = [];
52806
- this.items.forEach((item, id) => {
52807
- if (itemTypes.includes(item.itemType)) {
52822
+ this.items.forEach((item2, id) => {
52823
+ if (itemTypes.includes(item2.itemType)) {
52808
52824
  ids.push(id);
52809
52825
  }
52810
52826
  });
@@ -52814,7 +52830,7 @@ class SelectionItems {
52814
52830
  return this.isSingle() ? this.items.values().next().value || null : null;
52815
52831
  }
52816
52832
  listByIds(itemIdList) {
52817
- return itemIdList.map((id) => this.items.get(id)).filter((item) => item !== undefined);
52833
+ return itemIdList.map((id) => this.items.get(id)).filter((item2) => item2 !== undefined);
52818
52834
  }
52819
52835
  ids() {
52820
52836
  return Array.from(this.items.keys());
@@ -52825,7 +52841,7 @@ class SelectionItems {
52825
52841
  return;
52826
52842
  }
52827
52843
  const mbr = items[0].getMbr();
52828
- items.slice(1).forEach((item) => mbr.combine(item.getMbr()));
52844
+ items.slice(1).forEach((item2) => mbr.combine(item2.getMbr()));
52829
52845
  return mbr;
52830
52846
  }
52831
52847
  }
@@ -53030,33 +53046,33 @@ function handleMultipleItemsResize({
53030
53046
  const translation = {};
53031
53047
  const items = itemsToResize ? itemsToResize : board.selection.items.list();
53032
53048
  board.items.getComments().forEach((comment2) => {
53033
- if (items.some((item) => item.getId() === comment2.getItemToFollow())) {
53049
+ if (items.some((item2) => item2.getId() === comment2.getItemToFollow())) {
53034
53050
  items.push(comment2);
53035
53051
  }
53036
53052
  });
53037
- for (const item of items) {
53038
- let itemX = item.getMbr().left;
53039
- let itemY = item.getMbr().top;
53040
- if (item.itemType === "Drawing") {
53041
- itemX = item.transformation.matrix.translateX;
53042
- itemY = item.transformation.matrix.translateY;
53053
+ for (const item2 of items) {
53054
+ let itemX = item2.getMbr().left;
53055
+ let itemY = item2.getMbr().top;
53056
+ if (item2.itemType === "Drawing") {
53057
+ itemX = item2.transformation.matrix.translateX;
53058
+ itemY = item2.transformation.matrix.translateY;
53043
53059
  }
53044
53060
  const deltaX = itemX - initMbr.left;
53045
53061
  const translateX = deltaX * matrix.scaleX - deltaX + matrix.translateX;
53046
53062
  const deltaY = itemY - initMbr.top;
53047
53063
  const translateY = deltaY * matrix.scaleY - deltaY + matrix.translateY;
53048
- if (item instanceof RichText) {
53049
- translation[item.getId()] = getRichTextTranslation({
53050
- item,
53064
+ if (item2 instanceof RichText) {
53065
+ translation[item2.getId()] = getRichTextTranslation({
53066
+ item: item2,
53051
53067
  isWidth,
53052
53068
  isHeight,
53053
53069
  matrix,
53054
53070
  translateX,
53055
53071
  translateY
53056
53072
  });
53057
- } else if (item instanceof AINode) {
53058
- translation[item.getId()] = getAINodeTranslation({
53059
- item,
53073
+ } else if (item2 instanceof AINode) {
53074
+ translation[item2.getId()] = getAINodeTranslation({
53075
+ item: item2,
53060
53076
  isWidth,
53061
53077
  isHeight,
53062
53078
  matrix,
@@ -53064,8 +53080,8 @@ function handleMultipleItemsResize({
53064
53080
  translateY
53065
53081
  });
53066
53082
  } else {
53067
- translation[item.getId()] = getItemTranslation({
53068
- item,
53083
+ translation[item2.getId()] = getItemTranslation({
53084
+ item: item2,
53069
53085
  isWidth,
53070
53086
  isHeight,
53071
53087
  matrix,
@@ -53078,7 +53094,7 @@ function handleMultipleItemsResize({
53078
53094
  return translation;
53079
53095
  }
53080
53096
  function getRichTextTranslation({
53081
- item,
53097
+ item: item2,
53082
53098
  isWidth,
53083
53099
  isHeight,
53084
53100
  matrix,
@@ -53086,11 +53102,11 @@ function getRichTextTranslation({
53086
53102
  translateY
53087
53103
  }) {
53088
53104
  if (isWidth) {
53089
- item.editor.setMaxWidth(item.getWidth() / item.transformation.getScale().x * matrix.scaleX);
53105
+ item2.editor.setMaxWidth(item2.getWidth() / item2.transformation.getScale().x * matrix.scaleX);
53090
53106
  return {
53091
53107
  class: "Transformation",
53092
53108
  method: "scaleByTranslateBy",
53093
- item: [item.getId()],
53109
+ item: [item2.getId()],
53094
53110
  translate: { x: matrix.translateX, y: 0 },
53095
53111
  scale: { x: matrix.scaleX, y: matrix.scaleX }
53096
53112
  };
@@ -53098,7 +53114,7 @@ function getRichTextTranslation({
53098
53114
  return {
53099
53115
  class: "Transformation",
53100
53116
  method: "scaleByTranslateBy",
53101
- item: [item.getId()],
53117
+ item: [item2.getId()],
53102
53118
  translate: { x: translateX, y: translateY },
53103
53119
  scale: { x: 1, y: 1 }
53104
53120
  };
@@ -53106,14 +53122,14 @@ function getRichTextTranslation({
53106
53122
  return {
53107
53123
  class: "Transformation",
53108
53124
  method: "scaleByTranslateBy",
53109
- item: [item.getId()],
53125
+ item: [item2.getId()],
53110
53126
  translate: { x: translateX, y: translateY },
53111
53127
  scale: { x: matrix.scaleX, y: matrix.scaleX }
53112
53128
  };
53113
53129
  }
53114
53130
  }
53115
53131
  function getAINodeTranslation({
53116
- item,
53132
+ item: item2,
53117
53133
  isWidth,
53118
53134
  isHeight,
53119
53135
  matrix,
@@ -53121,11 +53137,11 @@ function getAINodeTranslation({
53121
53137
  translateY
53122
53138
  }) {
53123
53139
  if (isWidth) {
53124
- item.text.editor.setMaxWidth(item.text.getWidth() / item.transformation.getScale().x * matrix.scaleX);
53140
+ item2.text.editor.setMaxWidth(item2.text.getWidth() / item2.transformation.getScale().x * matrix.scaleX);
53125
53141
  return {
53126
53142
  class: "Transformation",
53127
53143
  method: "scaleByTranslateBy",
53128
- item: [item.getId()],
53144
+ item: [item2.getId()],
53129
53145
  translate: { x: matrix.translateX, y: 0 },
53130
53146
  scale: { x: matrix.scaleX, y: matrix.scaleX }
53131
53147
  };
@@ -53133,7 +53149,7 @@ function getAINodeTranslation({
53133
53149
  return {
53134
53150
  class: "Transformation",
53135
53151
  method: "scaleByTranslateBy",
53136
- item: [item.getId()],
53152
+ item: [item2.getId()],
53137
53153
  translate: { x: translateX, y: translateY },
53138
53154
  scale: { x: 1, y: 1 }
53139
53155
  };
@@ -53141,14 +53157,14 @@ function getAINodeTranslation({
53141
53157
  return {
53142
53158
  class: "Transformation",
53143
53159
  method: "scaleByTranslateBy",
53144
- item: [item.getId()],
53160
+ item: [item2.getId()],
53145
53161
  translate: { x: translateX, y: translateY },
53146
53162
  scale: { x: matrix.scaleX, y: matrix.scaleX }
53147
53163
  };
53148
53164
  }
53149
53165
  }
53150
53166
  function getItemTranslation({
53151
- item,
53167
+ item: item2,
53152
53168
  isWidth,
53153
53169
  isHeight,
53154
53170
  matrix,
@@ -53156,22 +53172,22 @@ function getItemTranslation({
53156
53172
  translateY,
53157
53173
  isShiftPressed
53158
53174
  }) {
53159
- if (item instanceof Sticker && (isWidth || isHeight)) {
53175
+ if (item2 instanceof Sticker && (isWidth || isHeight)) {
53160
53176
  return {
53161
53177
  class: "Transformation",
53162
53178
  method: "scaleByTranslateBy",
53163
- item: [item.getId()],
53179
+ item: [item2.getId()],
53164
53180
  translate: { x: translateX, y: translateY },
53165
53181
  scale: { x: 1, y: 1 }
53166
53182
  };
53167
53183
  } else {
53168
- if (item instanceof Frame2 && item.getCanChangeRatio() && isShiftPressed && item.getFrameType() !== "Custom") {
53169
- item.setFrameType("Custom");
53184
+ if (item2 instanceof Frame2 && item2.getCanChangeRatio() && isShiftPressed && item2.getFrameType() !== "Custom") {
53185
+ item2.setFrameType("Custom");
53170
53186
  }
53171
53187
  return {
53172
53188
  class: "Transformation",
53173
53189
  method: "scaleByTranslateBy",
53174
- item: [item.getId()],
53190
+ item: [item2.getId()],
53175
53191
  translate: { x: translateX, y: translateY },
53176
53192
  scale: { x: matrix.scaleX, y: matrix.scaleY }
53177
53193
  };
@@ -53444,11 +53460,11 @@ function transformItems({
53444
53460
  setSnapCursorPos
53445
53461
  }) {
53446
53462
  const items = selection.items.list();
53447
- const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio");
53463
+ const includesProportionalItem = items.some((item2) => item2.itemType === "Sticker" || item2.itemType === "RichText" || item2.itemType === "AINode" || item2.itemType === "Video" || item2.itemType === "Audio");
53448
53464
  if (includesProportionalItem && (isWidth || isHeight)) {
53449
53465
  return null;
53450
53466
  }
53451
- const isIncludesFixedFrame = items.some((item) => item instanceof Frame2 && !item.getCanChangeRatio());
53467
+ const isIncludesFixedFrame = items.some((item2) => item2 instanceof Frame2 && !item2.getCanChangeRatio());
53452
53468
  const shouldBeProportionalResize = isIncludesFixedFrame || includesProportionalItem || isShiftPressed || !isWidth && !isHeight;
53453
53469
  const resize = shouldBeProportionalResize ? getProportionalResize(resizeType, board.pointer.point, mbr, oppositePoint) : getResize(resizeType, board.pointer.point, mbr, oppositePoint);
53454
53470
  if (canvasDrawer.getLastCreatedCanvas() && !debounceUpd.shouldUpd()) {
@@ -53526,23 +53542,23 @@ function updateFrameChildren({
53526
53542
  nestingHighlighter
53527
53543
  }) {
53528
53544
  const groups = board.items.getGroupItemsEnclosedOrCrossed(mbr.left, mbr.top, mbr.right, mbr.bottom);
53529
- board.selection.items.list().forEach((item) => {
53530
- if ("getChildrenIds" in item && item.getChildrenIds()) {
53531
- const currMbr = item.getMbr();
53545
+ board.selection.items.list().forEach((item2) => {
53546
+ if ("getChildrenIds" in item2 && item2.getChildrenIds()) {
53547
+ const currMbr = item2.getMbr();
53532
53548
  const itemsToCheck = board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom);
53533
53549
  itemsToCheck.forEach((currItem) => {
53534
- if (item.handleNesting(currItem) && (currItem.parent === "Board" || currItem.parent === item.getId())) {
53535
- nestingHighlighter.add(item, currItem);
53550
+ if (item2.handleNesting(currItem) && (currItem.parent === "Board" || currItem.parent === item2.getId())) {
53551
+ nestingHighlighter.add(item2, currItem);
53536
53552
  } else {
53537
53553
  nestingHighlighter.remove(currItem);
53538
53554
  }
53539
53555
  });
53540
53556
  } else {
53541
53557
  groups.forEach((group) => {
53542
- if (group.handleNesting(item)) {
53543
- nestingHighlighter.add(group, item);
53558
+ if (group.handleNesting(item2)) {
53559
+ nestingHighlighter.add(group, item2);
53544
53560
  } else {
53545
- nestingHighlighter.remove(item);
53561
+ nestingHighlighter.remove(item2);
53546
53562
  }
53547
53563
  });
53548
53564
  }
@@ -53610,9 +53626,9 @@ class Transformer extends Tool {
53610
53626
  const pointer = this.board.pointer;
53611
53627
  const camera = this.board.camera;
53612
53628
  const items = this.selection.items;
53613
- const item = items.getSingle();
53629
+ const item2 = items.getSingle();
53614
53630
  let resizeType;
53615
- if (item && (item.itemType === "RichText" || item.itemType === "Sticker")) {
53631
+ if (item2 && (item2.itemType === "RichText" || item2.itemType === "Sticker")) {
53616
53632
  resizeType = getTextResizeType(pointer.point, camera.getScale(), mbr);
53617
53633
  } else {
53618
53634
  resizeType = getResizeType(pointer.point, camera.getScale(), mbr);
@@ -53866,8 +53882,8 @@ class SelectionTransformer extends Tool {
53866
53882
  return;
53867
53883
  }
53868
53884
  if (this.selection.items.isSingle()) {
53869
- const item = this.selection.items.getSingle();
53870
- if (item?.itemType === "Connector") {
53885
+ const item2 = this.selection.items.getSingle();
53886
+ if (item2?.itemType === "Connector") {
53871
53887
  this.tool = this.connectorTransformerTool;
53872
53888
  return;
53873
53889
  } else {
@@ -53950,16 +53966,16 @@ class BoardSelection {
53950
53966
  this.quickAddButtons = getQuickAddButtons(this, board);
53951
53967
  }
53952
53968
  serialize() {
53953
- const selectedItems = this.items.list().map((item) => item.getId());
53969
+ const selectedItems = this.items.list().map((item2) => item2.getId());
53954
53970
  return JSON.stringify(selectedItems);
53955
53971
  }
53956
53972
  deserialize(serializedData) {
53957
53973
  const selectedItems = JSON.parse(serializedData);
53958
53974
  this.removeAll();
53959
53975
  selectedItems.forEach((itemId) => {
53960
- const item = this.board.items.getById(itemId);
53961
- if (item) {
53962
- this.items.add(item);
53976
+ const item2 = this.board.items.getById(itemId);
53977
+ if (item2) {
53978
+ this.items.add(item2);
53963
53979
  }
53964
53980
  });
53965
53981
  }
@@ -54037,19 +54053,19 @@ class BoardSelection {
54037
54053
  this.updateQueue.clear();
54038
54054
  safeRequestAnimationFrame(this.updateScheduledObservers);
54039
54055
  };
54040
- itemObserver = (item) => {
54056
+ itemObserver = (item2) => {
54041
54057
  if (!this.shouldPublish) {
54042
54058
  return;
54043
54059
  }
54044
54060
  this.subject.publish(this);
54045
- this.itemSubject.publish(item);
54061
+ this.itemSubject.publish(item2);
54046
54062
  };
54047
54063
  decoratedItemObserver = this.decorateObserverToScheduleUpdate(this.itemObserver);
54048
54064
  add(value) {
54049
54065
  this.items.add(value);
54050
54066
  if (Array.isArray(value)) {
54051
- for (const item of value) {
54052
- item.subject.subscribe(this.itemObserver);
54067
+ for (const item2 of value) {
54068
+ item2.subject.subscribe(this.itemObserver);
54053
54069
  }
54054
54070
  } else {
54055
54071
  value.subject.subscribe(this.itemObserver);
@@ -54058,15 +54074,15 @@ class BoardSelection {
54058
54074
  this.itemsSubject.publish([]);
54059
54075
  }
54060
54076
  addAll() {
54061
- const items = this.board.items.listAll().filter((item) => !item.transformation.isLocked);
54077
+ const items = this.board.items.listAll().filter((item2) => !item2.transformation.isLocked);
54062
54078
  this.add(items);
54063
54079
  this.setContext("SelectByRect");
54064
54080
  }
54065
54081
  remove(value) {
54066
54082
  this.items.remove(value);
54067
54083
  if (Array.isArray(value)) {
54068
- for (const item of value) {
54069
- item.subject.unsubscribe(this.itemObserver);
54084
+ for (const item2 of value) {
54085
+ item2.subject.unsubscribe(this.itemObserver);
54070
54086
  }
54071
54087
  } else {
54072
54088
  value.subject.unsubscribe(this.itemObserver);
@@ -54160,11 +54176,11 @@ class BoardSelection {
54160
54176
  if (!this.items.isSingle()) {
54161
54177
  return;
54162
54178
  }
54163
- const item = this.items.getSingle();
54164
- if (!item) {
54179
+ const item2 = this.items.getSingle();
54180
+ if (!item2) {
54165
54181
  return;
54166
54182
  }
54167
- const text5 = item.getRichText();
54183
+ const text5 = item2.getRichText();
54168
54184
  if (!text5) {
54169
54185
  return;
54170
54186
  }
@@ -54175,7 +54191,7 @@ class BoardSelection {
54175
54191
  if (shouldReplace || moveCursorToEnd) {
54176
54192
  text5.editor.moveCursorToEndOfTheText();
54177
54193
  }
54178
- this.setTextToEdit(item);
54194
+ this.setTextToEdit(item2);
54179
54195
  this.setContext("EditTextUnderPointer");
54180
54196
  if (shouldSelect) {
54181
54197
  text5.editor.selectWholeText();
@@ -54185,13 +54201,13 @@ class BoardSelection {
54185
54201
  editUnderPointer() {
54186
54202
  this.removeAll();
54187
54203
  const stack = this.board.items.getUnderPointer();
54188
- const item = stack.pop();
54189
- if (item) {
54190
- this.add(item);
54204
+ const item2 = stack.pop();
54205
+ if (item2) {
54206
+ this.add(item2);
54191
54207
  this.setTextToEdit(undefined);
54192
- const text5 = item.getRichText();
54208
+ const text5 = item2.getRichText();
54193
54209
  if (text5) {
54194
- this.setTextToEdit(item);
54210
+ this.setTextToEdit(item2);
54195
54211
  text5.editor.selectWholeText();
54196
54212
  this.board.items.subject.publish(this.board.items);
54197
54213
  }
@@ -54200,26 +54216,26 @@ class BoardSelection {
54200
54216
  this.setContext("None");
54201
54217
  }
54202
54218
  }
54203
- setTextToEdit(item) {
54219
+ setTextToEdit(item2) {
54204
54220
  if (this.textToEdit) {
54205
54221
  this.textToEdit.updateElement();
54206
54222
  this.textToEdit.enableRender();
54207
54223
  }
54208
- if (!(item && item.getRichText())) {
54224
+ if (!(item2 && item2.getRichText())) {
54209
54225
  this.textToEdit = undefined;
54210
54226
  return;
54211
54227
  }
54212
- const text5 = item.getRichText();
54228
+ const text5 = item2.getRichText();
54213
54229
  if (!text5) {
54214
54230
  return;
54215
54231
  }
54216
54232
  if (text5.isEmpty()) {
54217
- const textColor = tempStorage.getFontColor(item.itemType);
54218
- const textSize = tempStorage.getFontSize(item.itemType);
54219
- const highlightColor = tempStorage.getFontHighlight(item.itemType);
54220
- const styles = tempStorage.getFontStyles(item.itemType);
54221
- const horizontalAlignment = tempStorage.getHorizontalAlignment(item.itemType);
54222
- const verticalAlignment = tempStorage.getVerticalAlignment(item.itemType);
54233
+ const textColor = tempStorage.getFontColor(item2.itemType);
54234
+ const textSize = tempStorage.getFontSize(item2.itemType);
54235
+ const highlightColor = tempStorage.getFontHighlight(item2.itemType);
54236
+ const styles = tempStorage.getFontStyles(item2.itemType);
54237
+ const horizontalAlignment = tempStorage.getHorizontalAlignment(item2.itemType);
54238
+ const verticalAlignment = tempStorage.getVerticalAlignment(item2.itemType);
54223
54239
  if (textColor) {
54224
54240
  text5.setSelectionFontColor(textColor, "None");
54225
54241
  }
@@ -54227,7 +54243,7 @@ class BoardSelection {
54227
54243
  this.emit({
54228
54244
  class: "RichText",
54229
54245
  method: "setFontSize",
54230
- item: [item.getId()],
54246
+ item: [item2.getId()],
54231
54247
  fontSize: textSize,
54232
54248
  context: this.getContext()
54233
54249
  });
@@ -54239,10 +54255,10 @@ class BoardSelection {
54239
54255
  const stylesArr = styles;
54240
54256
  text5.setSelectionFontStyle(stylesArr, "None");
54241
54257
  }
54242
- if (horizontalAlignment && !(item instanceof Sticker)) {
54258
+ if (horizontalAlignment && !(item2 instanceof Sticker)) {
54243
54259
  text5.setSelectionHorisontalAlignment(horizontalAlignment);
54244
54260
  }
54245
- if (verticalAlignment && !(item instanceof Sticker)) {
54261
+ if (verticalAlignment && !(item2 instanceof Sticker)) {
54246
54262
  this.setVerticalAlignment(verticalAlignment);
54247
54263
  }
54248
54264
  }
@@ -54275,8 +54291,8 @@ class BoardSelection {
54275
54291
  }
54276
54292
  selectEnclosedOrCrossedBy(rect) {
54277
54293
  this.removeAll();
54278
- const enclosedFrames = this.board.items.getEnclosed(rect.left, rect.top, rect.right, rect.bottom).filter((item) => !item.transformation.isLocked);
54279
- const list6 = this.board.items.getEnclosedOrCrossed(rect.left, rect.top, rect.right, rect.bottom).filter((item) => (!(item instanceof Frame2) || enclosedFrames.includes(item)) && !item.transformation.isLocked);
54294
+ const enclosedFrames = this.board.items.getEnclosed(rect.left, rect.top, rect.right, rect.bottom).filter((item2) => !item2.transformation.isLocked);
54295
+ const list6 = this.board.items.getEnclosedOrCrossed(rect.left, rect.top, rect.right, rect.bottom).filter((item2) => (!(item2 instanceof Frame2) || enclosedFrames.includes(item2)) && !item2.transformation.isLocked);
54280
54296
  if (list6.length !== 0) {
54281
54297
  this.add(list6);
54282
54298
  this.setContext("SelectByRect");
@@ -54290,14 +54306,14 @@ class BoardSelection {
54290
54306
  canChangeText() {
54291
54307
  return Boolean(this.items.isSingle() && this.items.getSingle()?.getRichText());
54292
54308
  }
54293
- handleItemCopy(item, copiedItemsMap) {
54294
- const serializedData = item.serialize(true);
54295
- const zIndex = this.board.items.index.getZIndex(item);
54296
- if (item.itemType === "Comment") {
54309
+ handleItemCopy(item2, copiedItemsMap) {
54310
+ const serializedData = item2.serialize(true);
54311
+ const zIndex = this.board.items.index.getZIndex(item2);
54312
+ if (item2.itemType === "Comment") {
54297
54313
  return;
54298
54314
  }
54299
- if (item.itemType === "Connector" && serializedData.itemType === "Connector") {
54300
- const connector = item;
54315
+ if (item2.itemType === "Connector" && serializedData.itemType === "Connector") {
54316
+ const connector = item2;
54301
54317
  const startPoint = connector.getStartPoint();
54302
54318
  const endPoint = connector.getEndPoint();
54303
54319
  const startItemId = startPoint.pointType !== "Board" ? startPoint.item.getId() : null;
@@ -54313,19 +54329,19 @@ class BoardSelection {
54313
54329
  serializedData.endPoint = new BoardPoint(endPoint.x, endPoint.y).serialize();
54314
54330
  }
54315
54331
  }
54316
- const textItem = item.getRichText()?.getTextString();
54332
+ const textItem = item2.getRichText()?.getTextString();
54317
54333
  const copyText = conf.i18n.t("frame.copy");
54318
54334
  const isCopyTextExist = textItem?.includes(copyText);
54319
- const isChangeCopiedFrameText = item.itemType === "Frame" && serializedData.itemType === "Frame" && textItem !== "" && !isCopyTextExist;
54335
+ const isChangeCopiedFrameText = item2.itemType === "Frame" && serializedData.itemType === "Frame" && textItem !== "" && !isCopyTextExist;
54320
54336
  if (isChangeCopiedFrameText) {
54321
54337
  const copiedFrameText = copyText + (textItem || serializedData.text?.placeholderText);
54322
- item.getRichText()?.editor.clearText();
54323
- item.getRichText()?.editor.addText(copiedFrameText);
54324
- serializedData.text = item.getRichText()?.serialize();
54325
- item.getRichText()?.editor.clearText();
54326
- item.getRichText()?.editor.addText(textItem || "");
54338
+ item2.getRichText()?.editor.clearText();
54339
+ item2.getRichText()?.editor.addText(copiedFrameText);
54340
+ serializedData.text = item2.getRichText()?.serialize();
54341
+ item2.getRichText()?.editor.clearText();
54342
+ item2.getRichText()?.editor.addText(textItem || "");
54327
54343
  }
54328
- copiedItemsMap[item.getId()] = { ...serializedData, zIndex };
54344
+ copiedItemsMap[item2.getId()] = { ...serializedData, zIndex };
54329
54345
  }
54330
54346
  copy(skipImageBlobCopy) {
54331
54347
  const copiedItemsMap = {};
@@ -54334,12 +54350,12 @@ class BoardSelection {
54334
54350
  this.handleItemCopy(single, copiedItemsMap);
54335
54351
  return { imageElement: single.image, imageData: copiedItemsMap };
54336
54352
  }
54337
- this.list().forEach((item) => {
54338
- this.handleItemCopy(item, copiedItemsMap);
54353
+ this.list().forEach((item2) => {
54354
+ this.handleItemCopy(item2, copiedItemsMap);
54339
54355
  });
54340
- this.list().flatMap((item) => {
54341
- if (item instanceof Frame2) {
54342
- return item.getChildrenIds();
54356
+ this.list().flatMap((item2) => {
54357
+ if (item2 instanceof Frame2) {
54358
+ return item2.getChildrenIds();
54343
54359
  }
54344
54360
  return [];
54345
54361
  }).forEach((id) => {
@@ -54367,11 +54383,11 @@ class BoardSelection {
54367
54383
  let maxRichText = null;
54368
54384
  let minRichText = null;
54369
54385
  const itemType = items[0].itemType;
54370
- for (const item of items) {
54371
- if (item.itemType !== itemType) {
54386
+ for (const item2 of items) {
54387
+ if (item2.itemType !== itemType) {
54372
54388
  return null;
54373
54389
  }
54374
- const richText = item.getRichText();
54390
+ const richText = item2.getRichText();
54375
54391
  if (richText) {
54376
54392
  if (!maxRichText || richText.getFontSize() > maxRichText.getFontSize()) {
54377
54393
  maxRichText = richText;
@@ -54477,22 +54493,22 @@ class BoardSelection {
54477
54493
  }
54478
54494
  nestSelectedItems(unselectedItem, checkFrames = true) {
54479
54495
  const selected = this.board.selection.items.list();
54480
- if (unselectedItem && !selected.find((item) => item.getId() === unselectedItem.getId())) {
54496
+ if (unselectedItem && !selected.find((item2) => item2.getId() === unselectedItem.getId())) {
54481
54497
  selected.push(unselectedItem);
54482
54498
  }
54483
- const selectedMbr = selected.reduce((acc, item) => {
54499
+ const selectedMbr = selected.reduce((acc, item2) => {
54484
54500
  if (!acc) {
54485
- return item.getMbr();
54501
+ return item2.getMbr();
54486
54502
  }
54487
- return acc.combine(item.getMbr());
54503
+ return acc.combine(item2.getMbr());
54488
54504
  }, undefined);
54489
54505
  if (selectedMbr) {
54490
- const selectedMap = Object.fromEntries(selected.map((item) => [item.getId(), { item, nested: false }]));
54506
+ const selectedMap = Object.fromEntries(selected.map((item2) => [item2.getId(), { item: item2, nested: false }]));
54491
54507
  const enclosedGroups = this.board.items.getGroupItemsEnclosedOrCrossed(selectedMbr?.left, selectedMbr?.top, selectedMbr?.right, selectedMbr?.bottom);
54492
54508
  enclosedGroups.forEach((group) => {
54493
- selected.forEach((item) => {
54494
- if (group.handleNesting(item)) {
54495
- selectedMap[item.getId()].nested = group;
54509
+ selected.forEach((item2) => {
54510
+ if (group.handleNesting(item2)) {
54511
+ selectedMap[item2.getId()].nested = group;
54496
54512
  }
54497
54513
  });
54498
54514
  });
@@ -54516,11 +54532,11 @@ class BoardSelection {
54516
54532
  if (childrenIds && checkFrames) {
54517
54533
  const currGroup = val.item;
54518
54534
  const currMbr = currGroup.getMbr();
54519
- const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item) => !!item);
54520
- const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board" || item.parent === currGroup.getId());
54535
+ const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item2) => !!item2);
54536
+ const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item2) => item2.parent === "Board" || item2.parent === currGroup.getId());
54521
54537
  const uniqueItems = new Set;
54522
- const toCheck = [...children, ...underGroup].filter((item) => {
54523
- const id = item.getId();
54538
+ const toCheck = [...children, ...underGroup].filter((item2) => {
54539
+ const id = item2.getId();
54524
54540
  if (uniqueItems.has(id)) {
54525
54541
  return false;
54526
54542
  }
@@ -54561,8 +54577,8 @@ class BoardSelection {
54561
54577
  addItemToTranslation(childId);
54562
54578
  }
54563
54579
  }
54564
- const createTranslationWithComments = (item) => {
54565
- const followedComments = this.board.items.getComments().filter((comment2) => comment2.getItemToFollow() === item.getId());
54580
+ const createTranslationWithComments = (item2) => {
54581
+ const followedComments = this.board.items.getComments().filter((comment2) => comment2.getItemToFollow() === item2.getId());
54566
54582
  for (const comment2 of followedComments) {
54567
54583
  translation[comment2.getId()] = {
54568
54584
  class: "Transformation",
@@ -54623,21 +54639,21 @@ class BoardSelection {
54623
54639
  newData: { borderColor }
54624
54640
  };
54625
54641
  const operations2 = {};
54626
- this.items.list().forEach((item) => {
54627
- if (!operations2[item.itemType]) {
54642
+ this.items.list().forEach((item2) => {
54643
+ if (!operations2[item2.itemType]) {
54628
54644
  const operationCopy = { ...operation };
54629
- if (item.itemType === "Connector") {
54645
+ if (item2.itemType === "Connector") {
54630
54646
  operationCopy.method = "setLineColor";
54631
54647
  operationCopy.lineColor = borderColor;
54632
- } else if (item.itemType === "Drawing") {
54648
+ } else if (item2.itemType === "Drawing") {
54633
54649
  operationCopy.method = "setStrokeColor";
54634
54650
  operationCopy.color = borderColor;
54635
54651
  } else {
54636
54652
  operationCopy.borderColor = borderColor;
54637
54653
  }
54638
- operations2[item.itemType] = { ...operationCopy, class: item.itemType, item: [item.getId()] };
54654
+ operations2[item2.itemType] = { ...operationCopy, class: item2.itemType, item: [item2.getId()] };
54639
54655
  } else {
54640
- operations2[item.itemType].item.push(item.getId());
54656
+ operations2[item2.itemType].item.push(item2.getId());
54641
54657
  }
54642
54658
  });
54643
54659
  Object.values(operations2).forEach((op) => {
@@ -54652,13 +54668,13 @@ class BoardSelection {
54652
54668
  newData: { borderWidth: width2 }
54653
54669
  };
54654
54670
  const operations2 = {};
54655
- this.items.list().forEach((item) => {
54656
- if (!operations2[item.itemType]) {
54671
+ this.items.list().forEach((item2) => {
54672
+ if (!operations2[item2.itemType]) {
54657
54673
  const operationCopy = { ...operation };
54658
- if (item.itemType === "Connector") {
54674
+ if (item2.itemType === "Connector") {
54659
54675
  operationCopy.method = "setLineWidth";
54660
54676
  operationCopy.lineWidth = width2;
54661
- } else if (item.itemType === "Drawing") {
54677
+ } else if (item2.itemType === "Drawing") {
54662
54678
  operationCopy.method = "setStrokeWidth";
54663
54679
  operationCopy.width = width2;
54664
54680
  operationCopy.prevWidth = this.getStrokeWidth();
@@ -54666,9 +54682,9 @@ class BoardSelection {
54666
54682
  operationCopy.borderWidth = width2;
54667
54683
  operationCopy.prevBorderWidth = this.getStrokeWidth();
54668
54684
  }
54669
- operations2[item.itemType] = { ...operationCopy, class: item.itemType, item: [item.getId()] };
54685
+ operations2[item2.itemType] = { ...operationCopy, class: item2.itemType, item: [item2.getId()] };
54670
54686
  } else {
54671
- operations2[item.itemType].item.push(item.getId());
54687
+ operations2[item2.itemType].item.push(item2.getId());
54672
54688
  }
54673
54689
  });
54674
54690
  Object.values(operations2).forEach((op) => {
@@ -54684,11 +54700,11 @@ class BoardSelection {
54684
54700
  newData: { backgroundColor }
54685
54701
  };
54686
54702
  const operations2 = {};
54687
- this.items.list().forEach((item) => {
54688
- if (!operations2[item.itemType]) {
54689
- operations2[item.itemType] = { ...operation, class: item.itemType, item: [item.getId()] };
54703
+ this.items.list().forEach((item2) => {
54704
+ if (!operations2[item2.itemType]) {
54705
+ operations2[item2.itemType] = { ...operation, class: item2.itemType, item: [item2.getId()] };
54690
54706
  } else {
54691
- operations2[item.itemType].item.push(item.getId());
54707
+ operations2[item2.itemType].item.push(item2.getId());
54692
54708
  }
54693
54709
  });
54694
54710
  Object.values(operations2).forEach((op) => {
@@ -54712,9 +54728,9 @@ class BoardSelection {
54712
54728
  }
54713
54729
  setFrameType(frameType) {
54714
54730
  const items = this.items.list();
54715
- items.forEach((item) => {
54716
- if (item instanceof Frame2) {
54717
- item.setFrameType(frameType);
54731
+ items.forEach((item2) => {
54732
+ if (item2 instanceof Frame2) {
54733
+ item2.setFrameType(frameType);
54718
54734
  }
54719
54735
  });
54720
54736
  }
@@ -54733,21 +54749,21 @@ class BoardSelection {
54733
54749
  setFontSize(size) {
54734
54750
  const fontSize = size === "auto" ? size : toFiniteNumber(size);
54735
54751
  const itemsOps = [];
54736
- for (const item of this.items.list()) {
54737
- const text5 = item.getRichText();
54752
+ for (const item2 of this.items.list()) {
54753
+ const text5 = item2.getRichText();
54738
54754
  if (!text5) {
54739
54755
  continue;
54740
54756
  }
54741
54757
  const ops = text5.setSelectionFontSize(fontSize, this.context);
54742
54758
  itemsOps.push({
54743
- item: item.getId(),
54759
+ item: item2.getId(),
54744
54760
  selection: text5.editor.getSelection(),
54745
54761
  ops
54746
54762
  });
54747
- if (item.itemType === "Sticker" && fontSize === "auto") {
54748
- tempStorage.remove(`fontSize_${item.itemType}`);
54749
- } else if (item.itemType !== "AINode") {
54750
- tempStorage.setFontSize(item.itemType, fontSize);
54763
+ if (item2.itemType === "Sticker" && fontSize === "auto") {
54764
+ tempStorage.remove(`fontSize_${item2.itemType}`);
54765
+ } else if (item2.itemType !== "AINode") {
54766
+ tempStorage.setFontSize(item2.itemType, fontSize);
54751
54767
  }
54752
54768
  }
54753
54769
  const emptyOps = itemsOps.filter((op) => !op.ops.length);
@@ -54770,8 +54786,8 @@ class BoardSelection {
54770
54786
  setFontStyle(fontStyle) {
54771
54787
  const isMultiple = !this.items.isSingle();
54772
54788
  const itemsOps = [];
54773
- for (const item of this.items.list()) {
54774
- const text5 = item.getRichText();
54789
+ for (const item2 of this.items.list()) {
54790
+ const text5 = item2.getRichText();
54775
54791
  if (!text5) {
54776
54792
  continue;
54777
54793
  }
@@ -54780,12 +54796,12 @@ class BoardSelection {
54780
54796
  }
54781
54797
  const ops = text5.setSelectionFontStyle(fontStyle, this.context);
54782
54798
  itemsOps.push({
54783
- item: item.getId(),
54799
+ item: item2.getId(),
54784
54800
  selection: text5.editor.getSelection(),
54785
54801
  ops
54786
54802
  });
54787
- if (item.itemType !== "AINode") {
54788
- tempStorage.setFontStyles(item.itemType, text5.getFontStyles());
54803
+ if (item2.itemType !== "AINode") {
54804
+ tempStorage.setFontStyles(item2.itemType, text5.getFontStyles());
54789
54805
  }
54790
54806
  }
54791
54807
  this.emitApplied({
@@ -54797,8 +54813,8 @@ class BoardSelection {
54797
54813
  setFontColor(fontColor) {
54798
54814
  const isMultiple = !this.items.isSingle();
54799
54815
  const itemsOps = [];
54800
- for (const item of this.items.list()) {
54801
- const text5 = item.getRichText();
54816
+ for (const item2 of this.items.list()) {
54817
+ const text5 = item2.getRichText();
54802
54818
  if (!text5) {
54803
54819
  continue;
54804
54820
  }
@@ -54807,11 +54823,11 @@ class BoardSelection {
54807
54823
  }
54808
54824
  const ops = text5.setSelectionFontColor(fontColor, this.context);
54809
54825
  itemsOps.push({
54810
- item: item.getId(),
54826
+ item: item2.getId(),
54811
54827
  selection: text5.editor.getSelection(),
54812
54828
  ops
54813
54829
  });
54814
- tempStorage.setFontColor(item.itemType, fontColor);
54830
+ tempStorage.setFontColor(item2.itemType, fontColor);
54815
54831
  }
54816
54832
  this.emitApplied({
54817
54833
  class: "RichText",
@@ -54840,8 +54856,8 @@ class BoardSelection {
54840
54856
  setFontHighlight(fontHighlight) {
54841
54857
  const isMultiple = !this.items.isSingle();
54842
54858
  const itemsOps = [];
54843
- for (const item of this.items.list()) {
54844
- const text5 = item.getRichText();
54859
+ for (const item2 of this.items.list()) {
54860
+ const text5 = item2.getRichText();
54845
54861
  if (!text5) {
54846
54862
  continue;
54847
54863
  }
@@ -54850,12 +54866,12 @@ class BoardSelection {
54850
54866
  }
54851
54867
  const ops = text5.setSelectionFontHighlight(fontHighlight, this.context);
54852
54868
  itemsOps.push({
54853
- item: item.getId(),
54869
+ item: item2.getId(),
54854
54870
  selection: text5.editor.getSelection(),
54855
54871
  ops
54856
54872
  });
54857
- if (item.itemType !== "AINode") {
54858
- tempStorage.setFontHighlight(item.itemType, fontHighlight);
54873
+ if (item2.itemType !== "AINode") {
54874
+ tempStorage.setFontHighlight(item2.itemType, fontHighlight);
54859
54875
  }
54860
54876
  }
54861
54877
  this.emitApplied({
@@ -54867,8 +54883,8 @@ class BoardSelection {
54867
54883
  setHorisontalAlignment(horisontalAlignment) {
54868
54884
  const isMultiple = !this.items.isSingle();
54869
54885
  const itemsOps = [];
54870
- for (const item of this.items.list()) {
54871
- const text5 = item.getRichText();
54886
+ for (const item2 of this.items.list()) {
54887
+ const text5 = item2.getRichText();
54872
54888
  if (!text5) {
54873
54889
  continue;
54874
54890
  }
@@ -54877,11 +54893,11 @@ class BoardSelection {
54877
54893
  }
54878
54894
  const ops = text5.setSelectionHorisontalAlignment(horisontalAlignment, this.context);
54879
54895
  itemsOps.push({
54880
- item: item.getId(),
54896
+ item: item2.getId(),
54881
54897
  selection: text5.editor.getSelection(),
54882
54898
  ops
54883
54899
  });
54884
- tempStorage.setHorizontalAlignment(item.itemType, horisontalAlignment);
54900
+ tempStorage.setHorizontalAlignment(item2.itemType, horisontalAlignment);
54885
54901
  }
54886
54902
  this.emitApplied({
54887
54903
  class: "RichText",
@@ -54897,23 +54913,23 @@ class BoardSelection {
54897
54913
  verticalAlignment
54898
54914
  });
54899
54915
  if (this.items.isSingle()) {
54900
- const item = this.items.getSingle();
54901
- if (!item) {
54916
+ const item2 = this.items.getSingle();
54917
+ if (!item2) {
54902
54918
  return;
54903
54919
  }
54904
- const text5 = item.getRichText();
54920
+ const text5 = item2.getRichText();
54905
54921
  if (!text5) {
54906
54922
  return;
54907
54923
  }
54908
- tempStorage.setVerticalAlignment(item.itemType, verticalAlignment);
54909
- if (item instanceof RichText) {
54910
- item.setEditorFocus(this.context);
54924
+ tempStorage.setVerticalAlignment(item2.itemType, verticalAlignment);
54925
+ if (item2 instanceof RichText) {
54926
+ item2.setEditorFocus(this.context);
54911
54927
  }
54912
54928
  text5.setEditorFocus(this.context);
54913
54929
  }
54914
54930
  }
54915
54931
  removeFromBoard() {
54916
- const isLocked = this.items.list().some((item) => item.transformation.isLocked);
54932
+ const isLocked = this.items.list().some((item2) => item2.transformation.isLocked);
54917
54933
  if (isLocked) {
54918
54934
  return;
54919
54935
  }
@@ -54936,7 +54952,7 @@ class BoardSelection {
54936
54952
  }
54937
54953
  getIsLockedSelection() {
54938
54954
  const items = this.list();
54939
- return items.some((item) => item.transformation.isLocked);
54955
+ return items.some((item2) => item2.transformation.isLocked);
54940
54956
  }
54941
54957
  isLocked() {
54942
54958
  return false;
@@ -54963,9 +54979,9 @@ class BoardSelection {
54963
54979
  }
54964
54980
  async duplicate() {
54965
54981
  const mediaIds = [];
54966
- this.items.list().forEach((item) => {
54967
- if ("getStorageId" in item) {
54968
- const storageId = item.getStorageId();
54982
+ this.items.list().forEach((item2) => {
54983
+ if ("getStorageId" in item2) {
54984
+ const storageId = item2.getStorageId();
54969
54985
  if (storageId) {
54970
54986
  mediaIds.push(storageId);
54971
54987
  }
@@ -54975,7 +54991,7 @@ class BoardSelection {
54975
54991
  if (!canDuplicate) {
54976
54992
  return;
54977
54993
  }
54978
- const filteredItemMap = Object.fromEntries(Object.entries(this.copy(true)).filter(([_, item]) => item.itemType !== "Group"));
54994
+ const filteredItemMap = Object.fromEntries(Object.entries(this.copy(true)).filter(([_, item2]) => item2.itemType !== "Group"));
54979
54995
  this.board.duplicate(filteredItemMap);
54980
54996
  this.setContext("EditUnderPointer");
54981
54997
  }
@@ -55009,10 +55025,10 @@ class BoardSelection {
55009
55025
  lastAssistantMessageId
55010
55026
  };
55011
55027
  }
55012
- renderItemMbr(context, item, customScale) {
55013
- const mbr = item.getMbr();
55028
+ renderItemMbr(context, item2, customScale) {
55029
+ const mbr = item2.getMbr();
55014
55030
  mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
55015
- const selectionColor = item.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
55031
+ const selectionColor = item2.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
55016
55032
  mbr.borderColor = selectionColor;
55017
55033
  mbr.render(context);
55018
55034
  }
@@ -55028,8 +55044,8 @@ class BoardSelection {
55028
55044
  }
55029
55045
  if (!this.transformationRenderBlock) {
55030
55046
  if (this.shouldRenderItemsMbr) {
55031
- for (const item of this.items.list()) {
55032
- this.renderItemMbr(context, item);
55047
+ for (const item2 of this.items.list()) {
55048
+ this.renderItemMbr(context, item2);
55033
55049
  }
55034
55050
  }
55035
55051
  this.tool.render(context);
@@ -55041,7 +55057,7 @@ class BoardSelection {
55041
55057
  if (single && single instanceof AINode) {
55042
55058
  const contextItemsIds = single.getContextItems();
55043
55059
  if (contextItemsIds.length) {
55044
- const newContextItems = this.board.items.listAll().filter((item) => contextItemsIds.includes(item.getId()));
55060
+ const newContextItems = this.board.items.listAll().filter((item2) => contextItemsIds.includes(item2.getId()));
55045
55061
  contextItems.push(...newContextItems);
55046
55062
  }
55047
55063
  }
@@ -55059,15 +55075,15 @@ class BoardSelection {
55059
55075
  }
55060
55076
  }
55061
55077
  }
55062
- contextItems.forEach((item) => {
55063
- if (item instanceof AINode) {
55064
- const path2 = item.getPath();
55078
+ contextItems.forEach((item2) => {
55079
+ if (item2 instanceof AINode) {
55080
+ const path2 = item2.getPath();
55065
55081
  path2.setBorderColor(CONTEXT_NODE_HIGHLIGHT_COLOR);
55066
55082
  path2.setBorderWidth(2);
55067
55083
  path2.setBackgroundColor("none");
55068
55084
  path2.render(context);
55069
55085
  } else {
55070
- const itemRect = item.getMbr();
55086
+ const itemRect = item2.getMbr();
55071
55087
  itemRect.borderColor = CONTEXT_NODE_HIGHLIGHT_COLOR;
55072
55088
  itemRect.strokeWidth = 2;
55073
55089
  itemRect.render(context);
@@ -55568,16 +55584,16 @@ class Board {
55568
55584
  applyBoardOperation(op) {
55569
55585
  switch (op.method) {
55570
55586
  case "moveToZIndex": {
55571
- const item = this.index.getById(op.item);
55572
- if (!item) {
55587
+ const item2 = this.index.getById(op.item);
55588
+ if (!item2) {
55573
55589
  return;
55574
55590
  }
55575
- return this.index.moveToZIndex(item, op.zIndex);
55591
+ return this.index.moveToZIndex(item2, op.zIndex);
55576
55592
  }
55577
55593
  case "moveManyToZIndex": {
55578
55594
  for (const id in op.item) {
55579
- const item = this.items.getById(id);
55580
- if (!item) {
55595
+ const item2 = this.items.getById(id);
55596
+ if (!item2) {
55581
55597
  delete op.item.id;
55582
55598
  }
55583
55599
  }
@@ -55599,11 +55615,11 @@ class Board {
55599
55615
  }
55600
55616
  return this.index.moveSecondAfterFirst(first, second);
55601
55617
  case "bringToFront": {
55602
- const items = op.item.map((item) => this.items.getById(item)).filter((item) => item !== undefined);
55618
+ const items = op.item.map((item2) => this.items.getById(item2)).filter((item2) => item2 !== undefined);
55603
55619
  return this.index.bringManyToFront(items);
55604
55620
  }
55605
55621
  case "sendToBack": {
55606
- const items = op.item.map((item) => this.items.getById(item)).filter((item) => item !== undefined);
55622
+ const items = op.item.map((item2) => this.items.getById(item2)).filter((item2) => item2 !== undefined);
55607
55623
  return this.index.sendManyToBack(items);
55608
55624
  }
55609
55625
  case "add":
@@ -55627,82 +55643,82 @@ class Board {
55627
55643
  applyAddItems(op) {
55628
55644
  if (Array.isArray(op.item)) {
55629
55645
  const data = op.data;
55630
- const items = op.item.map((item2) => {
55631
- const created = this.createItem(item2, data[item2]);
55646
+ const items = op.item.map((item3) => {
55647
+ const created = this.createItem(item3, data[item3]);
55632
55648
  this.index.insert(created);
55633
55649
  return created;
55634
55650
  });
55635
- items.forEach((item2) => {
55636
- if (item2 instanceof Connector2 && data[item2.getId()]) {
55637
- const connectorData = data[item2.getId()];
55638
- item2.applyStartPoint(connectorData.startPoint);
55639
- item2.applyEndPoint(connectorData.endPoint);
55651
+ items.forEach((item3) => {
55652
+ if (item3 instanceof Connector2 && data[item3.getId()]) {
55653
+ const connectorData = data[item3.getId()];
55654
+ item3.applyStartPoint(connectorData.startPoint);
55655
+ item3.applyEndPoint(connectorData.endPoint);
55640
55656
  }
55641
55657
  });
55642
55658
  return;
55643
55659
  }
55644
- const item = this.createItem(op.item, op.data);
55645
- return this.index.insert(item);
55660
+ const item2 = this.createItem(op.item, op.data);
55661
+ return this.index.insert(item2);
55646
55662
  }
55647
55663
  applyAddLockedGroupOperation(op) {
55648
- const item = this.createItem(op.item, op.data);
55649
- const groupChildrenIds = item.getChildrenIds();
55650
- this.index.insert(item);
55664
+ const item2 = this.createItem(op.item, op.data);
55665
+ const groupChildrenIds = item2.getChildrenIds();
55666
+ this.index.insert(item2);
55651
55667
  const lastChildrenId = this.index.getById(groupChildrenIds[groupChildrenIds.length - 1]);
55652
55668
  if (lastChildrenId) {
55653
55669
  const zIndex = this.index.getZIndex(lastChildrenId) + 1;
55654
- this.index.moveToZIndex(item, zIndex);
55670
+ this.index.moveToZIndex(item2, zIndex);
55655
55671
  }
55656
- item.getChildren().forEach((item2) => {
55657
- item2.transformation.isLocked = true;
55672
+ item2.getChildren().forEach((item3) => {
55673
+ item3.transformation.isLocked = true;
55658
55674
  });
55659
- item.transformation.isLocked = true;
55675
+ item2.transformation.isLocked = true;
55660
55676
  }
55661
55677
  applyRemoveOperation(op) {
55662
55678
  const removedItems = [];
55663
- this.findItemAndApply(op.item, (item) => {
55664
- this.index.remove(item);
55665
- this.selection.remove(item);
55666
- if (item instanceof Connector2) {
55667
- item.clearObservedItems();
55679
+ this.findItemAndApply(op.item, (item2) => {
55680
+ this.index.remove(item2);
55681
+ this.selection.remove(item2);
55682
+ if (item2 instanceof Connector2) {
55683
+ item2.clearObservedItems();
55668
55684
  }
55669
- removedItems.push(item);
55685
+ removedItems.push(item2);
55670
55686
  });
55671
55687
  }
55672
55688
  applyRemoveLockedGroupOperation(op) {
55673
- const item = this.index.getById(op.item[0]);
55674
- if (!item || !(item instanceof Group)) {
55689
+ const item2 = this.index.getById(op.item[0]);
55690
+ if (!item2 || !(item2 instanceof Group)) {
55675
55691
  return;
55676
55692
  }
55677
- item.getChildren().forEach((item2) => {
55678
- item2.transformation.isLocked = false;
55679
- item2.parent = "Board";
55693
+ item2.getChildren().forEach((item3) => {
55694
+ item3.transformation.isLocked = false;
55695
+ item3.parent = "Board";
55680
55696
  });
55681
- item.transformation.isLocked = false;
55697
+ item2.transformation.isLocked = false;
55682
55698
  const removedItems = [];
55683
- this.findItemAndApply(op.item, (item2) => {
55684
- this.index.remove(item2);
55685
- this.selection.remove(item2);
55686
- removedItems.push(item2);
55699
+ this.findItemAndApply(op.item, (item3) => {
55700
+ this.index.remove(item3);
55701
+ this.selection.remove(item3);
55702
+ removedItems.push(item3);
55687
55703
  });
55688
55704
  }
55689
55705
  applyItemOperation(op) {
55690
55706
  if ("item" in op) {
55691
- this.findItemAndApply(op.item, (item) => {
55692
- item.apply(op);
55707
+ this.findItemAndApply(op.item, (item2) => {
55708
+ item2.apply(op);
55693
55709
  });
55694
55710
  }
55695
55711
  }
55696
- findItemAndApply(item, apply) {
55697
- if (Array.isArray(item)) {
55698
- for (const itemId of item) {
55712
+ findItemAndApply(item2, apply) {
55713
+ if (Array.isArray(item2)) {
55714
+ for (const itemId of item2) {
55699
55715
  const found = this.items.findById(itemId);
55700
55716
  if (found) {
55701
55717
  apply(found);
55702
55718
  }
55703
55719
  }
55704
55720
  } else {
55705
- const found = this.items.findById(item);
55721
+ const found = this.items.findById(item2);
55706
55722
  if (found) {
55707
55723
  apply(found);
55708
55724
  }
@@ -55711,9 +55727,9 @@ class Board {
55711
55727
  handleNesting(items) {
55712
55728
  const arrayed = Array.isArray(items) ? items : [items];
55713
55729
  const groupsMap = new Map;
55714
- arrayed.forEach((item) => {
55715
- const itemCenter = item.getMbr().getCenter();
55716
- const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
55730
+ arrayed.forEach((item2) => {
55731
+ const itemCenter = item2.getMbr().getCenter();
55732
+ const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item2)).reduce((acc, groupItem2) => {
55717
55733
  if (!acc || groupItem2.getDistanceToPoint(itemCenter) > acc.getDistanceToPoint(itemCenter)) {
55718
55734
  acc = groupItem2;
55719
55735
  }
@@ -55723,7 +55739,7 @@ class Board {
55723
55739
  if (!groupsMap.has(groupItem)) {
55724
55740
  groupsMap.set(groupItem, []);
55725
55741
  }
55726
- groupsMap.get(groupItem)?.push(item);
55742
+ groupsMap.get(groupItem)?.push(item2);
55727
55743
  }
55728
55744
  });
55729
55745
  groupsMap.forEach((items2, group) => {
@@ -55744,13 +55760,13 @@ class Board {
55744
55760
  }
55745
55761
  return parser(el);
55746
55762
  }
55747
- add(item, timeStamp) {
55763
+ add(item2, timeStamp) {
55748
55764
  const id = this.getNewItemId();
55749
55765
  this.emit({
55750
55766
  class: "Board",
55751
55767
  method: "add",
55752
55768
  item: id,
55753
- data: item.serialize(),
55769
+ data: item2.serialize(),
55754
55770
  timeStamp
55755
55771
  });
55756
55772
  const newItem = this.items.getById(id);
@@ -55760,13 +55776,13 @@ class Board {
55760
55776
  this.handleNesting(newItem);
55761
55777
  return newItem;
55762
55778
  }
55763
- addLockedGroup(item) {
55779
+ addLockedGroup(item2) {
55764
55780
  const id = this.getNewItemId();
55765
55781
  this.emit({
55766
55782
  class: "Board",
55767
55783
  method: "addLockedGroup",
55768
55784
  item: id,
55769
- data: item.serialize()
55785
+ data: item2.serialize()
55770
55786
  });
55771
55787
  const newItem = this.items.getById(id);
55772
55788
  if (!newItem) {
@@ -55775,32 +55791,32 @@ class Board {
55775
55791
  this.handleNesting(newItem);
55776
55792
  return newItem;
55777
55793
  }
55778
- remove(item, withConnectors = true) {
55794
+ remove(item2, withConnectors = true) {
55779
55795
  let connectors = [];
55780
55796
  if (withConnectors) {
55781
- connectors = this.items.getLinkedConnectorsById(item.getId()).map((connector) => connector.getId());
55797
+ connectors = this.items.getLinkedConnectorsById(item2.getId()).map((connector) => connector.getId());
55782
55798
  }
55783
- if ("onRemove" in item) {
55784
- item.onRemove();
55799
+ if ("onRemove" in item2) {
55800
+ item2.onRemove();
55785
55801
  }
55786
55802
  this.emit({
55787
55803
  class: "Board",
55788
55804
  method: "remove",
55789
- item: [item.getId(), ...connectors]
55805
+ item: [item2.getId(), ...connectors]
55790
55806
  });
55791
55807
  }
55792
- removeLockedGroup(item) {
55808
+ removeLockedGroup(item2) {
55793
55809
  this.emit({
55794
55810
  class: "Board",
55795
55811
  method: "removeLockedGroup",
55796
- item: [item.getId()]
55812
+ item: [item2.getId()]
55797
55813
  });
55798
55814
  }
55799
55815
  getByZIndex(index2) {
55800
55816
  return this.index.getByZIndex(index2);
55801
55817
  }
55802
- getZIndex(item) {
55803
- return this.index.getZIndex(item);
55818
+ getZIndex(item2) {
55819
+ return this.index.getZIndex(item2);
55804
55820
  }
55805
55821
  getLastZIndex() {
55806
55822
  return this.index.getLastZIndex();
@@ -55812,11 +55828,11 @@ class Board {
55812
55828
  item: items
55813
55829
  });
55814
55830
  }
55815
- moveToZIndex(item, zIndex) {
55831
+ moveToZIndex(item2, zIndex) {
55816
55832
  this.emit({
55817
55833
  class: "Board",
55818
55834
  method: "moveToZIndex",
55819
- item: item.getId(),
55835
+ item: item2.getId(),
55820
55836
  zIndex
55821
55837
  });
55822
55838
  }
@@ -55844,8 +55860,8 @@ class Board {
55844
55860
  this.emit({
55845
55861
  class: "Board",
55846
55862
  method: "bringToFront",
55847
- item: items.map((item) => item.getId()),
55848
- prevZIndex: Object.fromEntries(boardItems.map((item) => [item.getId(), boardItems.indexOf(item)]))
55863
+ item: items.map((item2) => item2.getId()),
55864
+ prevZIndex: Object.fromEntries(boardItems.map((item2) => [item2.getId(), boardItems.indexOf(item2)]))
55849
55865
  });
55850
55866
  }
55851
55867
  sendToBack(items) {
@@ -55856,8 +55872,8 @@ class Board {
55856
55872
  this.emit({
55857
55873
  class: "Board",
55858
55874
  method: "sendToBack",
55859
- item: items.map((item) => item.getId()),
55860
- prevZIndex: Object.fromEntries(boardItems.map((item) => [item.getId(), boardItems.indexOf(item)]))
55875
+ item: items.map((item2) => item2.getId()),
55876
+ prevZIndex: Object.fromEntries(boardItems.map((item2) => [item2.getId(), boardItems.indexOf(item2)]))
55861
55877
  });
55862
55878
  }
55863
55879
  copy() {
@@ -55934,7 +55950,7 @@ class Board {
55934
55950
  return added;
55935
55951
  });
55936
55952
  addedFrame.addChildItems(addedChildren);
55937
- parsedData.data.children = addedChildren.map((item) => item.getId());
55953
+ parsedData.data.children = addedChildren.map((item2) => item2.getId());
55938
55954
  idsMap[parsedData.data.id] = addedFrame.getId();
55939
55955
  } else {
55940
55956
  const added = this.add(this.createItem(this.getNewItemId(), parsedData));
@@ -55975,15 +55991,15 @@ class Board {
55975
55991
  const createdConnectors = {};
55976
55992
  const createdFrames = {};
55977
55993
  const addItem = (itemData) => {
55978
- const item = this.createItem(itemData.id, itemData);
55979
- if (item instanceof Connector2) {
55980
- createdConnectors[itemData.id] = { item, itemData };
55994
+ const item2 = this.createItem(itemData.id, itemData);
55995
+ if (item2 instanceof Connector2) {
55996
+ createdConnectors[itemData.id] = { item: item2, itemData };
55981
55997
  }
55982
- if (item instanceof Frame2) {
55983
- createdFrames[item.getId()] = { item, itemData };
55998
+ if (item2 instanceof Frame2) {
55999
+ createdFrames[item2.getId()] = { item: item2, itemData };
55984
56000
  }
55985
- this.index.insert(item);
55986
- return item;
56001
+ this.index.insert(item2);
56002
+ return item2;
55987
56003
  };
55988
56004
  for (const itemData of items) {
55989
56005
  if ("childrenMap" in itemData) {
@@ -55994,13 +56010,13 @@ class Board {
55994
56010
  }
55995
56011
  }
55996
56012
  for (const key in createdConnectors) {
55997
- const { item, itemData } = createdConnectors[key];
55998
- item.applyStartPoint(itemData.startPoint);
55999
- item.applyEndPoint(itemData.endPoint);
56013
+ const { item: item2, itemData } = createdConnectors[key];
56014
+ item2.applyStartPoint(itemData.startPoint);
56015
+ item2.applyEndPoint(itemData.endPoint);
56000
56016
  }
56001
56017
  for (const key in createdFrames) {
56002
- const { item, itemData } = createdFrames[key];
56003
- item.applyAddChildren(itemData.children);
56018
+ const { item: item2, itemData } = createdFrames[key];
56019
+ item2.applyAddChildren(itemData.children);
56004
56020
  }
56005
56021
  }
56006
56022
  deserialize(snapshot) {
@@ -56010,33 +56026,33 @@ class Board {
56010
56026
  const createdFrames = {};
56011
56027
  if (Array.isArray(items)) {
56012
56028
  for (const itemData of items) {
56013
- const item = this.createItem(itemData.id, itemData);
56014
- if (item instanceof Connector2) {
56015
- createdConnectors[itemData.id] = { item, itemData };
56029
+ const item2 = this.createItem(itemData.id, itemData);
56030
+ if (item2 instanceof Connector2) {
56031
+ createdConnectors[itemData.id] = { item: item2, itemData };
56016
56032
  }
56017
- if (item instanceof Frame2) {
56018
- createdFrames[item.getId()] = { item, itemData };
56033
+ if (item2 instanceof Frame2) {
56034
+ createdFrames[item2.getId()] = { item: item2, itemData };
56019
56035
  }
56020
- this.index.insert(item);
56036
+ this.index.insert(item2);
56021
56037
  }
56022
56038
  } else {
56023
56039
  for (const key in items) {
56024
56040
  const itemData = items[key];
56025
- const item = this.createItem(key, itemData);
56026
- if (item instanceof Connector2) {
56027
- createdConnectors[key] = { item, itemData };
56041
+ const item2 = this.createItem(key, itemData);
56042
+ if (item2 instanceof Connector2) {
56043
+ createdConnectors[key] = { item: item2, itemData };
56028
56044
  }
56029
- this.index.insert(item);
56045
+ this.index.insert(item2);
56030
56046
  }
56031
56047
  }
56032
56048
  for (const key in createdConnectors) {
56033
- const { item, itemData } = createdConnectors[key];
56034
- item.applyStartPoint(itemData.startPoint);
56035
- item.applyEndPoint(itemData.endPoint);
56049
+ const { item: item2, itemData } = createdConnectors[key];
56050
+ item2.applyStartPoint(itemData.startPoint);
56051
+ item2.applyEndPoint(itemData.endPoint);
56036
56052
  }
56037
56053
  for (const key in createdFrames) {
56038
- const { item, itemData } = createdFrames[key];
56039
- item.applyAddChildren(itemData.children);
56054
+ const { item: item2, itemData } = createdFrames[key];
56055
+ item2.applyAddChildren(itemData.children);
56040
56056
  }
56041
56057
  this.events?.log.deserialize(events);
56042
56058
  }
@@ -56274,7 +56290,7 @@ class Board {
56274
56290
  itemsMap: newMap,
56275
56291
  select: select2
56276
56292
  });
56277
- const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
56293
+ const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item2) => typeof item2 !== "undefined");
56278
56294
  this.handleNesting(items);
56279
56295
  this.selection.removeAll();
56280
56296
  this.selection.add(items);
@@ -56282,8 +56298,8 @@ class Board {
56282
56298
  return;
56283
56299
  }
56284
56300
  removeVoidComments() {
56285
- const voidComments = this.items.listAll().filter((item) => {
56286
- return item instanceof Comment && !item.getThread().length;
56301
+ const voidComments = this.items.listAll().filter((item2) => {
56302
+ return item2 instanceof Comment && !item2.getThread().length;
56287
56303
  });
56288
56304
  if (voidComments) {
56289
56305
  for (const comment2 of voidComments) {
@@ -56357,7 +56373,7 @@ class Board {
56357
56373
  }
56358
56374
  const mbr = this.selection.getMbr();
56359
56375
  const selectedItems = this.selection.items.list();
56360
- const isSelectedItemsMinWidth = selectedItems.some((item) => item.getMbr().getWidth() === 0);
56376
+ const isSelectedItemsMinWidth = selectedItems.some((item2) => item2.getMbr().getWidth() === 0);
56361
56377
  const right = mbr ? mbr.right : 0;
56362
56378
  const top = mbr ? mbr.top : 0;
56363
56379
  const width2 = mbr ? mbr.getWidth() / 10 : 10;
@@ -56399,7 +56415,7 @@ class Board {
56399
56415
  method: "duplicate",
56400
56416
  itemsMap: newMap
56401
56417
  });
56402
- const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
56418
+ const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item2) => typeof item2 !== "undefined");
56403
56419
  this.handleNesting(items);
56404
56420
  this.selection.removeAll();
56405
56421
  this.selection.add(items);
@@ -56420,9 +56436,9 @@ class Board {
56420
56436
  if (data.itemType === "Frame") {
56421
56437
  data.text.placeholderText = `Frame ${this.getMaxFrameSerial() + 1}`;
56422
56438
  }
56423
- const item = this.createItem(itemId, data);
56424
- this.index.insert(item);
56425
- items.push(item);
56439
+ const item2 = this.createItem(itemId, data);
56440
+ this.index.insert(item2);
56441
+ items.push(item2);
56426
56442
  };
56427
56443
  sortedItemsMap.map(([id, data]) => {
56428
56444
  if (data.itemType === "Connector") {
@@ -56437,8 +56453,8 @@ class Board {
56437
56453
  return;
56438
56454
  });
56439
56455
  }
56440
- isOnBoard(item) {
56441
- return this.items.findById(item.getId()) !== undefined;
56456
+ isOnBoard(item2) {
56457
+ return this.items.findById(item2.getId()) !== undefined;
56442
56458
  }
56443
56459
  getMaxFrameSerial() {
56444
56460
  const existingNames = this.items.listGroupItems().map((frame) => frame.getRichText()?.getTextString().length === 0 ? frame.getRichText()?.placeholderText || "" : frame.getRichText()?.getTextString() || "");
@@ -56484,7 +56500,7 @@ function areItemsTheSame(opA, opB) {
56484
56500
  const itemsB = Object.keys(opB.items);
56485
56501
  const setA = new Set(itemsA);
56486
56502
  const setB = new Set(itemsB);
56487
- const areArraysEqual = setA.size === setB.size && [...setA].every((item) => setB.has(item));
56503
+ const areArraysEqual = setA.size === setB.size && [...setA].every((item2) => setB.has(item2));
56488
56504
  return areArraysEqual;
56489
56505
  }
56490
56506
  if (!(Array.isArray(opA.item) && Array.isArray(opB.item))) {
@@ -58143,9 +58159,9 @@ function insertEventsFromOtherConnectionsIntoList(value, list6, board) {
58143
58159
  list6.applyUnconfirmed(filter);
58144
58160
  const hasAnyOverlap = (arr1, arr2) => {
58145
58161
  const lookup9 = new Set(arr1);
58146
- return arr2.some((item) => lookup9.has(item));
58162
+ return arr2.some((item2) => lookup9.has(item2));
58147
58163
  };
58148
- const currSelection = board.selection.list().map((item) => item.getId());
58164
+ const currSelection = board.selection.list().map((item2) => item2.getId());
58149
58165
  if (hasAnyOverlap(currSelection, createdItems) || hasAnyOverlap(currSelection, updatedText)) {
58150
58166
  board.selection.applyMemoizedCaretOrRange();
58151
58167
  }
@@ -58467,27 +58483,27 @@ function handleAiChatMassage(message, board) {
58467
58483
  }
58468
58484
  }
58469
58485
  function handleChatChunk(chunk, board) {
58470
- const item = board.items.getById(chunk.itemId);
58486
+ const item2 = board.items.getById(chunk.itemId);
58471
58487
  switch (chunk.type) {
58472
58488
  case "chunk":
58473
- if (!item || item.itemType !== "AINode") {
58489
+ if (!item2 || item2.itemType !== "AINode") {
58474
58490
  return;
58475
58491
  }
58476
- item.getRichText()?.editor.markdownProcessor.processMarkdown(chunk.content || "");
58492
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown(chunk.content || "");
58477
58493
  break;
58478
58494
  case "done":
58479
- if (!item || item.itemType !== "AINode") {
58495
+ if (!item2 || item2.itemType !== "AINode") {
58480
58496
  board.aiGeneratingOnItem = undefined;
58481
58497
  return;
58482
58498
  }
58483
- item.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
58499
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
58484
58500
  break;
58485
58501
  case "end":
58486
- if (!item || item.itemType !== "AINode") {
58502
+ if (!item2 || item2.itemType !== "AINode") {
58487
58503
  board.aiGeneratingOnItem = undefined;
58488
58504
  return;
58489
58505
  }
58490
- item.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
58506
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
58491
58507
  break;
58492
58508
  case "error":
58493
58509
  default:
@@ -58504,7 +58520,7 @@ function handleChatChunk(chunk, board) {
58504
58520
  if (board.aiGeneratingOnItem && generatingItem) {
58505
58521
  board.selection.removeAll();
58506
58522
  board.selection.add(generatingItem);
58507
- const rt = item?.getRichText();
58523
+ const rt = item2?.getRichText();
58508
58524
  if (generatingItem.itemType === "AINode" && rt) {
58509
58525
  const editor = rt.editor;
58510
58526
  editor.markdownProcessor.setStopProcessingMarkDownCb(null);
@@ -58637,14 +58653,14 @@ function handleImageGenerate(response, board) {
58637
58653
  console.error("Image generation error:", response.message);
58638
58654
  if (response.isExternalApiError) {
58639
58655
  if (board.aiGeneratingOnItem) {
58640
- const item = board.items.getById(board.aiGeneratingOnItem);
58641
- if (item) {
58656
+ const item2 = board.items.getById(board.aiGeneratingOnItem);
58657
+ if (item2) {
58642
58658
  board.selection.removeAll();
58643
- board.selection.add(item);
58644
- const editor = item.getRichText()?.editor;
58659
+ board.selection.add(item2);
58660
+ const editor = item2.getRichText()?.editor;
58645
58661
  editor?.clearText();
58646
58662
  editor?.insertCopiedText(conf.i18n.t("AIInput.nodeErrorText"));
58647
- board.camera.zoomToFit(item.getMbr(), 20);
58663
+ board.camera.zoomToFit(item2.getMbr(), 20);
58648
58664
  }
58649
58665
  }
58650
58666
  } else {