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.
@@ -801,8 +801,8 @@ class BoardCommand {
801
801
  switch (operation.method) {
802
802
  case "bringToFront": {
803
803
  for (const id in operation.prevZIndex) {
804
- const item = this.board.items.getById(id);
805
- if (!item) {
804
+ const item2 = this.board.items.getById(id);
805
+ if (!item2) {
806
806
  delete operation.prevZIndex.id;
807
807
  }
808
808
  }
@@ -814,8 +814,8 @@ class BoardCommand {
814
814
  }
815
815
  case "sendToBack": {
816
816
  for (const id in operation.prevZIndex) {
817
- const item = this.board.items.getById(id);
818
- if (!item) {
817
+ const item2 = this.board.items.getById(id);
818
+ if (!item2) {
819
819
  delete operation.prevZIndex.id;
820
820
  }
821
821
  }
@@ -829,11 +829,11 @@ class BoardCommand {
829
829
  case "moveSecondBeforeFirst":
830
830
  case "moveToZIndex": {
831
831
  const items = this.board.items;
832
- const item = items.getById(operation.item);
833
- if (!item) {
832
+ const item2 = items.getById(operation.item);
833
+ if (!item2) {
834
834
  throw new Error("Get reverse board operation. Item not found");
835
835
  }
836
- const zIndex = this.board.getZIndex(item);
836
+ const zIndex = this.board.getZIndex(item2);
837
837
  return {
838
838
  class: "Board",
839
839
  method: "moveToZIndex",
@@ -843,8 +843,8 @@ class BoardCommand {
843
843
  }
844
844
  case "moveManyToZIndex": {
845
845
  for (const id in operation.item) {
846
- const item = this.board.items.getById(id);
847
- if (!item) {
846
+ const item2 = this.board.items.getById(id);
847
+ if (!item2) {
848
848
  delete operation.item.id;
849
849
  }
850
850
  }
@@ -861,15 +861,15 @@ class BoardCommand {
861
861
  const items = this.board.items;
862
862
  const reverse = [];
863
863
  for (const itemId of operation.item) {
864
- const item = items.getById(itemId);
865
- if (!item) {
864
+ const item2 = items.getById(itemId);
865
+ if (!item2) {
866
866
  throw new Error("Get reverse board operation. Item not found");
867
867
  }
868
868
  reverse.push({
869
869
  class: "Board",
870
870
  method: "add",
871
871
  item: itemId,
872
- data: item.serialize()
872
+ data: item2.serialize()
873
873
  });
874
874
  }
875
875
  return reverse;
@@ -892,32 +892,32 @@ class BoardCommand {
892
892
  const items = this.board.items;
893
893
  const reverse = [];
894
894
  for (const itemId of operation.item) {
895
- const item = items.getById(itemId);
896
- if (!item || item.itemType !== "Group") {
895
+ const item2 = items.getById(itemId);
896
+ if (!item2 || item2.itemType !== "Group") {
897
897
  throw new Error("Get reverse board operation. Item not found");
898
898
  }
899
899
  reverse.push({
900
900
  class: "Board",
901
901
  method: "addLockedGroup",
902
902
  item: itemId,
903
- data: item.serialize()
903
+ data: item2.serialize()
904
904
  });
905
905
  }
906
906
  return reverse;
907
907
  }
908
908
  case "duplicate":
909
909
  case "paste": {
910
- const item = [];
910
+ const item2 = [];
911
911
  const map = operation.itemsMap;
912
912
  for (const key in map) {
913
913
  if (map.hasOwnProperty(key)) {
914
- item.push(key);
914
+ item2.push(key);
915
915
  }
916
916
  }
917
917
  return {
918
918
  class: "Board",
919
919
  method: "remove",
920
- item
920
+ item: item2
921
921
  };
922
922
  }
923
923
  }
@@ -7235,11 +7235,11 @@ class SubjectOperation {
7235
7235
  }
7236
7236
 
7237
7237
  // src/Items/ItemsCommandUtils.ts
7238
- function mapItemsByOperation(item, getCallback) {
7239
- const items = Array.isArray(item) ? item : [item];
7240
- return items.map((item2) => {
7241
- const operation = getCallback(item2);
7242
- return { item: item2, operation };
7238
+ function mapItemsByOperation(item2, getCallback) {
7239
+ const items = Array.isArray(item2) ? item2 : [item2];
7240
+ return items.map((item3) => {
7241
+ const operation = getCallback(item3);
7242
+ return { item: item3, operation };
7243
7243
  });
7244
7244
  }
7245
7245
 
@@ -7264,8 +7264,8 @@ class TransformationCommand {
7264
7264
  }
7265
7265
  }
7266
7266
  revert() {
7267
- this.reverse.forEach(({ item, operation }) => {
7268
- item.apply(operation);
7267
+ this.reverse.forEach(({ item: item2, operation }) => {
7268
+ item2.apply(operation);
7269
7269
  });
7270
7270
  }
7271
7271
  getReverse() {
@@ -8007,8 +8007,8 @@ class Path {
8007
8007
  }
8008
8008
  getIntersectionPoints(segment) {
8009
8009
  let intersections = [];
8010
- for (const item of this.segments) {
8011
- intersections = intersections.concat(item.getIntersectionPoints(segment));
8010
+ for (const item2 of this.segments) {
8011
+ intersections = intersections.concat(item2.getIntersectionPoints(segment));
8012
8012
  }
8013
8013
  return intersections;
8014
8014
  }
@@ -8073,8 +8073,8 @@ class Path {
8073
8073
  }
8074
8074
  isOpenEnclosedOrCrossedBy(rectangle) {
8075
8075
  let is = false;
8076
- for (const item of this.segments) {
8077
- is = is || item.isEnclosedOrCrossedBy(rectangle);
8076
+ for (const item2 of this.segments) {
8077
+ is = is || item2.isEnclosedOrCrossedBy(rectangle);
8078
8078
  }
8079
8079
  return is;
8080
8080
  }
@@ -8487,8 +8487,8 @@ class ConnectorCommand {
8487
8487
  }
8488
8488
  }
8489
8489
  revert() {
8490
- for (const { item, operation } of this.reverse) {
8491
- item.apply(operation);
8490
+ for (const { item: item2, operation } of this.reverse) {
8491
+ item2.apply(operation);
8492
8492
  }
8493
8493
  }
8494
8494
  getReverse() {
@@ -8645,11 +8645,11 @@ class SessionStorage {
8645
8645
  }
8646
8646
  get(key) {
8647
8647
  const boardId = this.getBoardId() || "";
8648
- const item = _sessionStorage.getItem(boardId + "_" + key);
8649
- if (!item) {
8648
+ const item2 = _sessionStorage.getItem(boardId + "_" + key);
8649
+ if (!item2) {
8650
8650
  return;
8651
8651
  }
8652
- return JSON.parse(item);
8652
+ return JSON.parse(item2);
8653
8653
  }
8654
8654
  remove(key) {
8655
8655
  const boardId = this.getBoardId() || "";
@@ -9429,8 +9429,8 @@ class LinkToCommand {
9429
9429
  }
9430
9430
  }
9431
9431
  revert() {
9432
- this.reverse.forEach(({ item, operation }) => {
9433
- item.apply(operation);
9432
+ this.reverse.forEach(({ item: item2, operation }) => {
9433
+ item2.apply(operation);
9434
9434
  });
9435
9435
  }
9436
9436
  getReverse() {
@@ -10727,9 +10727,9 @@ function handleSplitListItem(editor) {
10727
10727
  import_slate5.Transforms.insertNodes(editor, {
10728
10728
  type: listType,
10729
10729
  listLevel: listNode.listLevel || 0,
10730
- children: itemsAfter.map((item) => ({
10730
+ children: itemsAfter.map((item2) => ({
10731
10731
  type: "list_item",
10732
- children: item.children
10732
+ children: item2.children
10733
10733
  }))
10734
10734
  }, { at: newListPath });
10735
10735
  }
@@ -12706,10 +12706,10 @@ function initializeDocument(effects) {
12706
12706
  return start;
12707
12707
  function start(code) {
12708
12708
  if (continued < stack.length) {
12709
- const item = stack[continued];
12710
- self2.containerState = item[1];
12711
- ok(item[0].continuation, "expected `continuation` to be defined on container construct");
12712
- return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code);
12709
+ const item2 = stack[continued];
12710
+ self2.containerState = item2[1];
12711
+ ok(item2[0].continuation, "expected `continuation` to be defined on container construct");
12712
+ return effects.attempt(item2[0].continuation, documentContinue, checkNewContainers)(code);
12713
12713
  }
12714
12714
  return checkNewContainers(code);
12715
12715
  }
@@ -13685,17 +13685,17 @@ class SpliceBuffer {
13685
13685
  this.setCursor(Number.POSITIVE_INFINITY);
13686
13686
  return this.left.pop();
13687
13687
  }
13688
- push(item) {
13688
+ push(item2) {
13689
13689
  this.setCursor(Number.POSITIVE_INFINITY);
13690
- this.left.push(item);
13690
+ this.left.push(item2);
13691
13691
  }
13692
13692
  pushMany(items) {
13693
13693
  this.setCursor(Number.POSITIVE_INFINITY);
13694
13694
  chunkedPush(this.left, items);
13695
13695
  }
13696
- unshift(item) {
13696
+ unshift(item2) {
13697
13697
  this.setCursor(0);
13698
- this.right.push(item);
13698
+ this.right.push(item2);
13699
13699
  }
13700
13700
  unshiftMany(items) {
13701
13701
  this.setCursor(0);
@@ -15726,8 +15726,8 @@ function initializeFactory(field) {
15726
15726
  if (list2) {
15727
15727
  ok(Array.isArray(list2), "expected `disable.null` to be populated");
15728
15728
  while (++index2 < list2.length) {
15729
- const item = list2[index2];
15730
- if (!item.previous || item.previous.call(self2, self2.previous)) {
15729
+ const item2 = list2[index2];
15730
+ if (!item2.previous || item2.previous.call(self2, self2.previous)) {
15731
15731
  return true;
15732
15732
  }
15733
15733
  }
@@ -16558,14 +16558,14 @@ function compiler(options) {
16558
16558
  length++;
16559
16559
  }
16560
16560
  if (event[1].type === types.listItemPrefix) {
16561
- const item = {
16561
+ const item2 = {
16562
16562
  type: "listItem",
16563
16563
  _spread: false,
16564
16564
  start: Object.assign({}, event[1].start),
16565
16565
  end: undefined
16566
16566
  };
16567
- listItem2 = item;
16568
- events.splice(index2, 0, ["enter", item, event[2]]);
16567
+ listItem2 = item2;
16568
+ events.splice(index2, 0, ["enter", item2, event[2]]);
16569
16569
  index2++;
16570
16570
  length++;
16571
16571
  firstBlankLineIndex = undefined;
@@ -17363,14 +17363,14 @@ class MarkdownProcessor {
17363
17363
  if (err || !file) {
17364
17364
  throw err;
17365
17365
  }
17366
- const nodes = file.result.map((item) => {
17366
+ const nodes = file.result.map((item2) => {
17367
17367
  setNodeStyles({
17368
- node: item,
17368
+ node: item2,
17369
17369
  editor: this.editor,
17370
17370
  horisontalAlignment: "left",
17371
- isPaddingTopNeeded: item.type !== "code_block"
17371
+ isPaddingTopNeeded: item2.type !== "code_block"
17372
17372
  });
17373
- return item;
17373
+ return item2;
17374
17374
  });
17375
17375
  if (isNewParagraphNeeded) {
17376
17376
  nodes.push(createParagraphNode("", this.editor));
@@ -18348,8 +18348,8 @@ class ShapeCommand {
18348
18348
  }
18349
18349
  }
18350
18350
  revert() {
18351
- for (const { item, operation } of this.reverse) {
18352
- item.apply(operation);
18351
+ for (const { item: item2, operation } of this.reverse) {
18352
+ item2.apply(operation);
18353
18353
  }
18354
18354
  }
18355
18355
  getReverse() {
@@ -18431,8 +18431,8 @@ class RichTextCommand {
18431
18431
  }
18432
18432
  }
18433
18433
  revert() {
18434
- for (const { item, operation } of this.reverse) {
18435
- const richText = this.board.items.getById(item);
18434
+ for (const { item: item2, operation } of this.reverse) {
18435
+ const richText = this.board.items.getById(item2);
18436
18436
  if (!richText) {
18437
18437
  continue;
18438
18438
  }
@@ -18451,12 +18451,12 @@ class RichTextCommand {
18451
18451
  case "setSelectionFontColor":
18452
18452
  case "setSelectionBlockType":
18453
18453
  const inverseOps = this.operation.ops.map((op) => import_slate34.Operation.inverse(op)).reverse();
18454
- return items.map((item) => {
18454
+ return items.map((item2) => {
18455
18455
  const operation = {
18456
18456
  ...this.operation,
18457
18457
  ops: inverseOps
18458
18458
  };
18459
- return { item, operation };
18459
+ return { item: item2, operation };
18460
18460
  });
18461
18461
  case "setFontColor":
18462
18462
  return items.map((id) => ({
@@ -18548,13 +18548,13 @@ class RichTextGroupCommand {
18548
18548
  this.reverseOps = this.getReverse();
18549
18549
  }
18550
18550
  apply() {
18551
- for (const { item, operation } of this.forwardOps) {
18552
- item.applyCommand(operation);
18551
+ for (const { item: item2, operation } of this.forwardOps) {
18552
+ item2.applyCommand(operation);
18553
18553
  }
18554
18554
  }
18555
18555
  revert() {
18556
- for (const { item, operation } of this.reverseOps) {
18557
- item.applyCommand(operation);
18556
+ for (const { item: item2, operation } of this.reverseOps) {
18557
+ item2.applyCommand(operation);
18558
18558
  }
18559
18559
  }
18560
18560
  getForward() {
@@ -18669,8 +18669,8 @@ class DrawingCommand {
18669
18669
  item;
18670
18670
  operation;
18671
18671
  reverse;
18672
- constructor(item, operation) {
18673
- this.item = item;
18672
+ constructor(item2, operation) {
18673
+ this.item = item2;
18674
18674
  this.operation = operation;
18675
18675
  this.reverse = this.getReverse();
18676
18676
  }
@@ -18679,52 +18679,52 @@ class DrawingCommand {
18679
18679
  return this;
18680
18680
  }
18681
18681
  apply() {
18682
- for (const item of this.item) {
18683
- item.apply(this.operation);
18682
+ for (const item2 of this.item) {
18683
+ item2.apply(this.operation);
18684
18684
  }
18685
18685
  }
18686
18686
  revert() {
18687
- for (const { item, operation } of this.reverse) {
18688
- item.apply(operation);
18687
+ for (const { item: item2, operation } of this.reverse) {
18688
+ item2.apply(operation);
18689
18689
  }
18690
18690
  }
18691
18691
  getReverse() {
18692
18692
  const reverse = [];
18693
- for (const item of this.item) {
18694
- reverse.push({ item, operation: this.getReverseOperation(item) });
18693
+ for (const item2 of this.item) {
18694
+ reverse.push({ item: item2, operation: this.getReverseOperation(item2) });
18695
18695
  }
18696
18696
  return reverse;
18697
18697
  }
18698
- getReverseOperation(item) {
18698
+ getReverseOperation(item2) {
18699
18699
  switch (this.operation.method) {
18700
18700
  case "setStrokeColor":
18701
18701
  return {
18702
18702
  class: "Drawing",
18703
18703
  method: "setStrokeColor",
18704
- item: [item.getId()],
18705
- color: item.getStrokeColor()
18704
+ item: [item2.getId()],
18705
+ color: item2.getStrokeColor()
18706
18706
  };
18707
18707
  case "setStrokeWidth":
18708
18708
  return {
18709
18709
  class: "Drawing",
18710
18710
  method: "setStrokeWidth",
18711
- item: [item.getId()],
18711
+ item: [item2.getId()],
18712
18712
  width: this.operation.prevWidth,
18713
- prevWidth: item.getStrokeWidth()
18713
+ prevWidth: item2.getStrokeWidth()
18714
18714
  };
18715
18715
  case "setStrokeOpacity":
18716
18716
  return {
18717
18717
  class: "Drawing",
18718
18718
  method: "setStrokeOpacity",
18719
- item: [item.getId()],
18720
- opacity: item.getStrokeOpacity()
18719
+ item: [item2.getId()],
18720
+ opacity: item2.getStrokeOpacity()
18721
18721
  };
18722
18722
  case "setStrokeStyle":
18723
18723
  return {
18724
18724
  class: "Drawing",
18725
18725
  method: "setStrokeStyle",
18726
- item: [item.getId()],
18727
- style: item.getBorderStyle()
18726
+ item: [item2.getId()],
18727
+ style: item2.getBorderStyle()
18728
18728
  };
18729
18729
  }
18730
18730
  }
@@ -18746,8 +18746,8 @@ class StickerCommand {
18746
18746
  }
18747
18747
  }
18748
18748
  revert() {
18749
- for (const { item, operation } of this.reverse) {
18750
- item.apply(operation);
18749
+ for (const { item: item2, operation } of this.reverse) {
18750
+ item2.apply(operation);
18751
18751
  }
18752
18752
  }
18753
18753
  getReverse() {
@@ -18779,8 +18779,8 @@ class FrameCommand {
18779
18779
  }
18780
18780
  }
18781
18781
  revert() {
18782
- for (const { item, operation } of this.reverse) {
18783
- item.apply(operation);
18782
+ for (const { item: item2, operation } of this.reverse) {
18783
+ item2.apply(operation);
18784
18784
  }
18785
18785
  }
18786
18786
  getReverse() {
@@ -18821,6 +18821,22 @@ class FrameCommand {
18821
18821
  children: frame2.getChildrenIds()
18822
18822
  };
18823
18823
  });
18824
+ default:
18825
+ const op = this.operation;
18826
+ let newData = {};
18827
+ if (op.prevData) {
18828
+ newData = { ...op.prevData };
18829
+ } else {
18830
+ Object.keys(op.newData).forEach((key) => {
18831
+ if (item[key]) {
18832
+ newData[key] = item[key];
18833
+ }
18834
+ });
18835
+ }
18836
+ return {
18837
+ ...op,
18838
+ newData
18839
+ };
18824
18840
  }
18825
18841
  }
18826
18842
  }
@@ -18841,8 +18857,8 @@ class CommentCommand {
18841
18857
  }
18842
18858
  }
18843
18859
  revert() {
18844
- this.reverse.forEach(({ item, operation }) => {
18845
- item.apply(operation);
18860
+ this.reverse.forEach(({ item: item2, operation }) => {
18861
+ item2.apply(operation);
18846
18862
  });
18847
18863
  }
18848
18864
  getReverse() {
@@ -19304,8 +19320,8 @@ class GroupCommand {
19304
19320
  }
19305
19321
  }
19306
19322
  revert() {
19307
- for (const { item, operation } of this.reverse) {
19308
- item.apply(operation);
19323
+ for (const { item: item2, operation } of this.reverse) {
19324
+ item2.apply(operation);
19309
19325
  }
19310
19326
  }
19311
19327
  getReverse() {
@@ -19358,8 +19374,8 @@ class PlaceholderCommand {
19358
19374
  }
19359
19375
  }
19360
19376
  revert() {
19361
- for (const { item, operation } of this.reverse) {
19362
- item.apply(operation);
19377
+ for (const { item: item2, operation } of this.reverse) {
19378
+ item2.apply(operation);
19363
19379
  }
19364
19380
  }
19365
19381
  getReverse() {
@@ -19453,26 +19469,26 @@ class BaseCommand {
19453
19469
  return this;
19454
19470
  }
19455
19471
  apply() {
19456
- for (const item of this.items) {
19457
- item.apply(this.operation);
19472
+ for (const item2 of this.items) {
19473
+ item2.apply(this.operation);
19458
19474
  }
19459
19475
  }
19460
19476
  revert() {
19461
- for (const { item, operation } of this.reverse) {
19462
- item.apply(operation);
19477
+ for (const { item: item2, operation } of this.reverse) {
19478
+ item2.apply(operation);
19463
19479
  }
19464
19480
  }
19465
19481
  getReverse() {
19466
19482
  const items = this.items;
19467
- return mapItemsByOperation(items, (item) => {
19483
+ return mapItemsByOperation(items, (item2) => {
19468
19484
  const op = this.operation;
19469
19485
  let newData = {};
19470
19486
  if (op.prevData) {
19471
19487
  newData = { ...op.prevData };
19472
19488
  } else {
19473
19489
  Object.keys(op.newData).forEach((key) => {
19474
- if (item[key]) {
19475
- newData[key] = item[key];
19490
+ if (item2[key]) {
19491
+ newData[key] = item2[key];
19476
19492
  }
19477
19493
  });
19478
19494
  }
@@ -19500,37 +19516,37 @@ var itemCommandFactories = {
19500
19516
  LinkTo: createLinkToCommand
19501
19517
  };
19502
19518
  function createConnectorCommand(items, operation) {
19503
- return new ConnectorCommand(items.filter((item) => item.itemType === "Connector"), operation);
19519
+ return new ConnectorCommand(items.filter((item2) => item2.itemType === "Connector"), operation);
19504
19520
  }
19505
19521
  function createShapeCommand(items, operation) {
19506
- return new ShapeCommand(items.filter((item) => item.itemType === "Shape"), operation);
19522
+ return new ShapeCommand(items.filter((item2) => item2.itemType === "Shape"), operation);
19507
19523
  }
19508
19524
  function createDrawingCommand(items, operation) {
19509
- return new DrawingCommand(items.filter((item) => item.itemType === "Drawing"), operation);
19525
+ return new DrawingCommand(items.filter((item2) => item2.itemType === "Drawing"), operation);
19510
19526
  }
19511
19527
  function createCommentCommand(items, operation) {
19512
- return new CommentCommand(items.filter((item) => item.itemType === "Comment"), operation);
19528
+ return new CommentCommand(items.filter((item2) => item2.itemType === "Comment"), operation);
19513
19529
  }
19514
19530
  function createStickerCommand(items, operation) {
19515
- return new StickerCommand(items.filter((item) => item.itemType === "Sticker"), operation);
19531
+ return new StickerCommand(items.filter((item2) => item2.itemType === "Sticker"), operation);
19516
19532
  }
19517
19533
  function createFrameCommand(items, operation) {
19518
- return new FrameCommand(items.filter((item) => item.itemType === "Frame"), operation);
19534
+ return new FrameCommand(items.filter((item2) => item2.itemType === "Frame"), operation);
19519
19535
  }
19520
19536
  function createPlaceholderCommand(items, operation) {
19521
- return new PlaceholderCommand(items.filter((item) => item.itemType === "Placeholder"), operation);
19537
+ return new PlaceholderCommand(items.filter((item2) => item2.itemType === "Placeholder"), operation);
19522
19538
  }
19523
19539
  function createGroupCommand(items, operation) {
19524
- return new GroupCommand(items.filter((item) => item.itemType === "Group"), operation);
19540
+ return new GroupCommand(items.filter((item2) => item2.itemType === "Group"), operation);
19525
19541
  }
19526
19542
  function createImageCommand(items, operation) {
19527
- return new ImageCommand(items.filter((item) => item.itemType === "Image"), operation);
19543
+ return new ImageCommand(items.filter((item2) => item2.itemType === "Image"), operation);
19528
19544
  }
19529
19545
  function createVideoCommand(items, operation) {
19530
- return new VideoCommand(items.filter((item) => item.itemType === "Video"), operation);
19546
+ return new VideoCommand(items.filter((item2) => item2.itemType === "Video"), operation);
19531
19547
  }
19532
19548
  function createAudioCommand(items, operation) {
19533
- return new AudioCommand(items.filter((item) => item.itemType === "Audio"), operation);
19549
+ return new AudioCommand(items.filter((item2) => item2.itemType === "Audio"), operation);
19534
19550
  }
19535
19551
  function createRichTextCommand(items, operation, board) {
19536
19552
  if (!board) {
@@ -19538,8 +19554,8 @@ function createRichTextCommand(items, operation, board) {
19538
19554
  }
19539
19555
  if (operation.method === "groupEdit") {
19540
19556
  const texts = [];
19541
- for (const { item } of operation.itemsOps) {
19542
- const found = board.items.findById(item);
19557
+ for (const { item: item2 } of operation.itemsOps) {
19558
+ const found = board.items.findById(item2);
19543
19559
  const text3 = found?.getRichText();
19544
19560
  if (text3) {
19545
19561
  texts.push(text3);
@@ -19547,14 +19563,14 @@ function createRichTextCommand(items, operation, board) {
19547
19563
  }
19548
19564
  return new RichTextGroupCommand(texts, operation);
19549
19565
  } else {
19550
- return new RichTextCommand(board, items.map((item) => item.getId()), operation);
19566
+ return new RichTextCommand(board, items.map((item2) => item2.getId()), operation);
19551
19567
  }
19552
19568
  }
19553
19569
  function createTransformationCommand(items, operation) {
19554
- return new TransformationCommand(items.map((item) => item.transformation), operation);
19570
+ return new TransformationCommand(items.map((item2) => item2.transformation), operation);
19555
19571
  }
19556
19572
  function createLinkToCommand(items, operation) {
19557
- return new LinkToCommand(items.map((item) => item.linkTo), operation);
19573
+ return new LinkToCommand(items.map((item2) => item2.linkTo), operation);
19558
19574
  }
19559
19575
  function createCommand(board, operation) {
19560
19576
  try {
@@ -19572,13 +19588,13 @@ function createCommand(board, operation) {
19572
19588
  default: {
19573
19589
  const itemType = operation.class;
19574
19590
  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);
19575
- const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item) => {
19576
- if (typeof item === "string") {
19577
- console.warn(`Item with ID ${item} not found for operation ${operation.class}.${operation.method}`);
19591
+ const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item2) => {
19592
+ if (typeof item2 === "string") {
19593
+ console.warn(`Item with ID ${item2} not found for operation ${operation.class}.${operation.method}`);
19578
19594
  return false;
19579
19595
  }
19580
- if (operation.class !== "Transformation" && operation.class !== "RichText" && operation.class !== "LinkTo" && item.itemType !== operation.class) {
19581
- console.warn(`Item with ID ${item} is not of operation type: ${itemType}.`);
19596
+ if (operation.class !== "Transformation" && operation.class !== "RichText" && operation.class !== "LinkTo" && item2.itemType !== operation.class) {
19597
+ console.warn(`Item with ID ${item2} is not of operation type: ${itemType}.`);
19582
19598
  return false;
19583
19599
  }
19584
19600
  return true;
@@ -19879,20 +19895,20 @@ class RBush {
19879
19895
  }
19880
19896
  return this;
19881
19897
  }
19882
- insert(item) {
19883
- if (item)
19884
- this._insert(item, this.data.height - 1);
19898
+ insert(item2) {
19899
+ if (item2)
19900
+ this._insert(item2, this.data.height - 1);
19885
19901
  return this;
19886
19902
  }
19887
19903
  clear() {
19888
19904
  this.data = createNode([]);
19889
19905
  return this;
19890
19906
  }
19891
- remove(item, equalsFn) {
19892
- if (!item)
19907
+ remove(item2, equalsFn) {
19908
+ if (!item2)
19893
19909
  return this;
19894
19910
  let node2 = this.data;
19895
- const bbox = this.toBBox(item);
19911
+ const bbox = this.toBBox(item2);
19896
19912
  const path2 = [];
19897
19913
  const indexes = [];
19898
19914
  let i, parent, goingUp;
@@ -19904,7 +19920,7 @@ class RBush {
19904
19920
  goingUp = true;
19905
19921
  }
19906
19922
  if (node2.leaf) {
19907
- const index2 = findItem(item, node2.children, equalsFn);
19923
+ const index2 = findItem(item2, node2.children, equalsFn);
19908
19924
  if (index2 !== -1) {
19909
19925
  node2.children.splice(index2, 1);
19910
19926
  path2.push(node2);
@@ -19927,8 +19943,8 @@ class RBush {
19927
19943
  }
19928
19944
  return this;
19929
19945
  }
19930
- toBBox(item) {
19931
- return item;
19946
+ toBBox(item2) {
19947
+ return item2;
19932
19948
  }
19933
19949
  compareMinX(a, b) {
19934
19950
  return a.minX - b.minX;
@@ -20011,11 +20027,11 @@ class RBush {
20011
20027
  }
20012
20028
  return node2;
20013
20029
  }
20014
- _insert(item, level, isNode) {
20015
- const bbox = isNode ? item : this.toBBox(item);
20030
+ _insert(item2, level, isNode) {
20031
+ const bbox = isNode ? item2 : this.toBBox(item2);
20016
20032
  const insertPath = [];
20017
20033
  const node2 = this._chooseSubtree(bbox, this.data, level, insertPath);
20018
- node2.children.push(item);
20034
+ node2.children.push(item2);
20019
20035
  extend2(node2, bbox);
20020
20036
  while (level >= 0) {
20021
20037
  if (insertPath[level].children.length > this._maxEntries) {
@@ -20114,11 +20130,11 @@ class RBush {
20114
20130
  }
20115
20131
  }
20116
20132
  }
20117
- function findItem(item, items, equalsFn) {
20133
+ function findItem(item2, items, equalsFn) {
20118
20134
  if (!equalsFn)
20119
- return items.indexOf(item);
20135
+ return items.indexOf(item2);
20120
20136
  for (let i = 0;i < items.length; i++) {
20121
- if (equalsFn(item, items[i]))
20137
+ if (equalsFn(item2, items[i]))
20122
20138
  return i;
20123
20139
  }
20124
20140
  return -1;
@@ -20209,8 +20225,8 @@ class TinyQueue {
20209
20225
  this._down(i);
20210
20226
  }
20211
20227
  }
20212
- push(item) {
20213
- this.data.push(item);
20228
+ push(item2) {
20229
+ this.data.push(item2);
20214
20230
  this.length++;
20215
20231
  this._up(this.length - 1);
20216
20232
  }
@@ -20231,21 +20247,21 @@ class TinyQueue {
20231
20247
  }
20232
20248
  _up(pos) {
20233
20249
  const { data, compare } = this;
20234
- const item = data[pos];
20250
+ const item2 = data[pos];
20235
20251
  while (pos > 0) {
20236
20252
  const parent = pos - 1 >> 1;
20237
20253
  const current = data[parent];
20238
- if (compare(item, current) >= 0)
20254
+ if (compare(item2, current) >= 0)
20239
20255
  break;
20240
20256
  data[pos] = current;
20241
20257
  pos = parent;
20242
20258
  }
20243
- data[pos] = item;
20259
+ data[pos] = item2;
20244
20260
  }
20245
20261
  _down(pos) {
20246
20262
  const { data, compare } = this;
20247
20263
  const halfLength = this.length >> 1;
20248
- const item = data[pos];
20264
+ const item2 = data[pos];
20249
20265
  while (pos < halfLength) {
20250
20266
  let left = (pos << 1) + 1;
20251
20267
  let best = data[left];
@@ -20254,12 +20270,12 @@ class TinyQueue {
20254
20270
  left = right;
20255
20271
  best = data[right];
20256
20272
  }
20257
- if (compare(best, item) >= 0)
20273
+ if (compare(best, item2) >= 0)
20258
20274
  break;
20259
20275
  data[pos] = best;
20260
20276
  pos = left;
20261
20277
  }
20262
- data[pos] = item;
20278
+ data[pos] = item2;
20263
20279
  }
20264
20280
  }
20265
20281
  function defaultCompare2(a, b) {
@@ -20347,10 +20363,10 @@ class RTreeIndex {
20347
20363
  return container ? container.item : undefined;
20348
20364
  }
20349
20365
  remove(id) {
20350
- const item = this.map.get(id);
20351
- if (item) {
20366
+ const item2 = this.map.get(id);
20367
+ if (item2) {
20352
20368
  this.map.delete(id);
20353
- this.tree.remove(item);
20369
+ this.tree.remove(item2);
20354
20370
  }
20355
20371
  }
20356
20372
  list() {
@@ -20422,11 +20438,11 @@ class Container extends Mbr {
20422
20438
  item;
20423
20439
  layer;
20424
20440
  zIndex;
20425
- constructor(id, item, layer, zIndex) {
20426
- const rect = item.getMbrWithChildren();
20441
+ constructor(id, item2, layer, zIndex) {
20442
+ const rect = item2.getMbrWithChildren();
20427
20443
  super(rect.left, rect.top, rect.right, rect.bottom);
20428
20444
  this.id = id;
20429
- this.item = item;
20445
+ this.item = item2;
20430
20446
  this.layer = layer;
20431
20447
  this.zIndex = zIndex;
20432
20448
  }
@@ -20443,7 +20459,7 @@ class LayeredIndex {
20443
20459
  this.getZIndex = this.getZIndex.bind(this);
20444
20460
  this.layers.newOnTop();
20445
20461
  }
20446
- isT(item) {
20462
+ isT(item2) {
20447
20463
  return true;
20448
20464
  }
20449
20465
  findById(id) {
@@ -20507,8 +20523,8 @@ class LayeredIndex {
20507
20523
  }
20508
20524
  getContainersFromItems(items) {
20509
20525
  const containers = [];
20510
- for (const item of items) {
20511
- const container = this.map.get(item.getId());
20526
+ for (const item2 of items) {
20527
+ const container = this.map.get(item2.getId());
20512
20528
  if (container) {
20513
20529
  containers.push(container);
20514
20530
  }
@@ -20585,9 +20601,9 @@ class LayeredIndex {
20585
20601
  }
20586
20602
  }
20587
20603
  }
20588
- insert(item) {
20589
- const toInsert = new Container(item.getId(), item, 0, this.getZIndex(item));
20590
- const bounds = item.getMbrWithChildren();
20604
+ insert(item2) {
20605
+ const toInsert = new Container(item2.getId(), item2, 0, this.getZIndex(item2));
20606
+ const bounds = item2.getMbrWithChildren();
20591
20607
  const inBounds = this.getRectsEnclosedOrCrossedBy(bounds);
20592
20608
  if (inBounds.length === 0) {
20593
20609
  return this.insertContainer(toInsert);
@@ -20654,20 +20670,20 @@ class LayeredIndex {
20654
20670
  }
20655
20671
  }
20656
20672
  }
20657
- change(item) {
20658
- const id = item.getId();
20673
+ change(item2) {
20674
+ const id = item2.getId();
20659
20675
  const container = this.map.get(id);
20660
20676
  if (container) {
20661
20677
  const layer = this.layers.get(container.layer);
20662
20678
  if (layer) {
20663
20679
  layer.remove(id);
20664
20680
  this.map.delete(id);
20665
- this.insert(item);
20681
+ this.insert(item2);
20666
20682
  }
20667
20683
  }
20668
20684
  }
20669
- remove(item) {
20670
- const id = item.getId();
20685
+ remove(item2) {
20686
+ const id = item2.getId();
20671
20687
  const container = this.map.get(id);
20672
20688
  if (container) {
20673
20689
  const layer = this.layers.get(container.layer);
@@ -20693,13 +20709,13 @@ class LayeredIndex {
20693
20709
  return items;
20694
20710
  }
20695
20711
  batchInsert(items) {
20696
- for (const item of items) {
20697
- this.insert(item);
20712
+ for (const item2 of items) {
20713
+ this.insert(item2);
20698
20714
  }
20699
20715
  }
20700
20716
  batchChange(items) {
20701
- for (const item of items) {
20702
- this.change(item);
20717
+ for (const item2 of items) {
20718
+ this.change(item2);
20703
20719
  }
20704
20720
  }
20705
20721
  }
@@ -20708,8 +20724,8 @@ class LayeredIndex {
20708
20724
  class SpatialIndex {
20709
20725
  subject = new Subject;
20710
20726
  itemsArray = [];
20711
- itemsIndex = new LayeredIndex((item) => {
20712
- return this.itemsArray.indexOf(item);
20727
+ itemsIndex = new LayeredIndex((item2) => {
20728
+ return this.itemsArray.indexOf(item2);
20713
20729
  });
20714
20730
  Mbr = new Mbr;
20715
20731
  items;
@@ -20718,79 +20734,79 @@ class SpatialIndex {
20718
20734
  }
20719
20735
  clear() {
20720
20736
  this.itemsArray = [];
20721
- this.itemsIndex = new LayeredIndex((item) => {
20722
- return this.itemsArray.indexOf(item);
20737
+ this.itemsIndex = new LayeredIndex((item2) => {
20738
+ return this.itemsArray.indexOf(item2);
20723
20739
  });
20724
20740
  this.Mbr = new Mbr;
20725
20741
  }
20726
- insert(item) {
20727
- this.itemsArray.push(item);
20728
- this.itemsIndex.insert(item);
20742
+ insert(item2) {
20743
+ this.itemsArray.push(item2);
20744
+ this.itemsIndex.insert(item2);
20729
20745
  if (conf.isNode()) {
20730
20746
  return;
20731
20747
  }
20732
20748
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
20733
- this.Mbr = item.getMbr().copy();
20749
+ this.Mbr = item2.getMbr().copy();
20734
20750
  } else {
20735
- this.Mbr.combine([item.getMbr()]);
20751
+ this.Mbr.combine([item2.getMbr()]);
20736
20752
  }
20737
- item.subject.subscribe(this.change);
20753
+ item2.subject.subscribe(this.change);
20738
20754
  this.subject.publish(this.items);
20739
20755
  }
20740
- change = (item) => {
20741
- this.itemsIndex.change(item);
20756
+ change = (item2) => {
20757
+ this.itemsIndex.change(item2);
20742
20758
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
20743
- this.Mbr = item.getMbrWithChildren().copy();
20759
+ this.Mbr = item2.getMbrWithChildren().copy();
20744
20760
  } else {
20745
- this.Mbr.combine([item.getMbrWithChildren()]);
20761
+ this.Mbr.combine([item2.getMbrWithChildren()]);
20746
20762
  }
20747
20763
  this.subject.publish(this.items);
20748
20764
  };
20749
- remove(item) {
20750
- if ("index" in item && item.index) {
20751
- item.removeChildItems(item.index.list());
20765
+ remove(item2) {
20766
+ if ("index" in item2 && item2.index) {
20767
+ item2.removeChildItems(item2.index.list());
20752
20768
  }
20753
- this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
20754
- this.itemsIndex.remove(item);
20769
+ this.itemsArray.splice(this.itemsArray.indexOf(item2), 1);
20770
+ this.itemsIndex.remove(item2);
20755
20771
  this.Mbr = new Mbr;
20756
- this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbrWithChildren()]));
20772
+ this.itemsArray.forEach((item3) => this.Mbr.combine([item3.getMbrWithChildren()]));
20757
20773
  this.subject.publish(this.items);
20758
20774
  }
20759
20775
  copy() {
20760
- return this.getItemsWithIncludedChildren(this.itemsArray).map((item) => ({
20761
- ...item.serialize(true),
20762
- id: item.getId()
20776
+ return this.getItemsWithIncludedChildren(this.itemsArray).map((item2) => ({
20777
+ ...item2.serialize(true),
20778
+ id: item2.getId()
20763
20779
  }));
20764
20780
  }
20765
20781
  getItemsWithIncludedChildren(items) {
20766
- return items.flatMap((item) => {
20767
- if ("index" in item && item.index) {
20768
- return [item, ...item.index.list()];
20782
+ return items.flatMap((item2) => {
20783
+ if ("index" in item2 && item2.index) {
20784
+ return [item2, ...item2.index.list()];
20769
20785
  }
20770
- return item;
20786
+ return item2;
20771
20787
  });
20772
20788
  }
20773
- getItemChildren(item) {
20774
- if ("index" in item && item.index) {
20775
- return item.index.list();
20789
+ getItemChildren(item2) {
20790
+ if ("index" in item2 && item2.index) {
20791
+ return item2.index.list();
20776
20792
  }
20777
20793
  return [];
20778
20794
  }
20779
- getItemParent(item) {
20780
- if (item.parent === "Board") {
20795
+ getItemParent(item2) {
20796
+ if (item2.parent === "Board") {
20781
20797
  return;
20782
20798
  }
20783
- return this.getById(item.parent);
20799
+ return this.getById(item2.parent);
20784
20800
  }
20785
- moveToZIndex(item, zIndex) {
20786
- const index2 = this.itemsArray.indexOf(item);
20801
+ moveToZIndex(item2, zIndex) {
20802
+ const index2 = this.itemsArray.indexOf(item2);
20787
20803
  this.itemsArray.splice(index2, 1);
20788
- this.itemsArray.splice(zIndex, 0, item);
20789
- this.change(item);
20804
+ this.itemsArray.splice(zIndex, 0, item2);
20805
+ this.change(item2);
20790
20806
  this.subject.publish(this.items);
20791
20807
  }
20792
20808
  moveManyToZIndex(itemsRecord) {
20793
- const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item) => item !== undefined);
20809
+ const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item2) => item2 !== undefined);
20794
20810
  const zIndex = Object.values(itemsRecord);
20795
20811
  for (let i = 0;i < zIndex.length; i++) {
20796
20812
  const index2 = zIndex[i];
@@ -20798,39 +20814,39 @@ class SpatialIndex {
20798
20814
  }
20799
20815
  this.itemsArray.forEach(this.change.bind(this));
20800
20816
  }
20801
- sendToBack(item, shouldPublish = true) {
20802
- const index2 = this.itemsArray.indexOf(item);
20817
+ sendToBack(item2, shouldPublish = true) {
20818
+ const index2 = this.itemsArray.indexOf(item2);
20803
20819
  this.itemsArray.splice(index2, 1);
20804
- this.itemsArray.unshift(item);
20805
- this.itemsIndex.change(item);
20820
+ this.itemsArray.unshift(item2);
20821
+ this.itemsIndex.change(item2);
20806
20822
  if (shouldPublish) {
20807
20823
  this.subject.publish(this.items);
20808
20824
  }
20809
20825
  }
20810
20826
  sendManyToBack(items) {
20811
20827
  const newItems = [...items];
20812
- this.itemsArray.forEach((item) => {
20813
- if (!items.includes(item)) {
20814
- newItems.push(item);
20828
+ this.itemsArray.forEach((item2) => {
20829
+ if (!items.includes(item2)) {
20830
+ newItems.push(item2);
20815
20831
  }
20816
20832
  });
20817
20833
  this.itemsArray = newItems;
20818
20834
  this.itemsArray.forEach(this.change.bind(this));
20819
20835
  }
20820
- bringToFront(item, shouldPublish = true) {
20821
- const index2 = this.itemsArray.indexOf(item);
20836
+ bringToFront(item2, shouldPublish = true) {
20837
+ const index2 = this.itemsArray.indexOf(item2);
20822
20838
  this.itemsArray.splice(index2, 1);
20823
- this.itemsArray.push(item);
20824
- this.itemsIndex.change(item);
20839
+ this.itemsArray.push(item2);
20840
+ this.itemsIndex.change(item2);
20825
20841
  if (shouldPublish) {
20826
20842
  this.subject.publish(this.items);
20827
20843
  }
20828
20844
  }
20829
20845
  bringManyToFront(items) {
20830
20846
  const newItems = [];
20831
- this.itemsArray.forEach((item) => {
20832
- if (!items.includes(item)) {
20833
- newItems.push(item);
20847
+ this.itemsArray.forEach((item2) => {
20848
+ if (!items.includes(item2)) {
20849
+ newItems.push(item2);
20834
20850
  }
20835
20851
  });
20836
20852
  newItems.push(...items);
@@ -20856,9 +20872,9 @@ class SpatialIndex {
20856
20872
  this.subject.publish(this.items);
20857
20873
  }
20858
20874
  getById(id) {
20859
- const item = this.getItemsWithIncludedChildren(this.itemsArray).find((item2) => item2.getId() === id);
20860
- if (item) {
20861
- return item;
20875
+ const item2 = this.getItemsWithIncludedChildren(this.itemsArray).find((item3) => item3.getId() === id);
20876
+ if (item2) {
20877
+ return item2;
20862
20878
  }
20863
20879
  }
20864
20880
  findById(id) {
@@ -20868,10 +20884,10 @@ class SpatialIndex {
20868
20884
  const mbr = new Mbr(left, top, right, bottom);
20869
20885
  const items = this.itemsIndex.getEnclosed(mbr);
20870
20886
  const children = [];
20871
- const clearItems = items.filter((item) => {
20872
- if ("index" in item && item.index) {
20873
- children.push(...item.index.getEnclosed(left, top, right, bottom));
20874
- if (!item.getMbr().isEnclosedBy(mbr)) {
20887
+ const clearItems = items.filter((item2) => {
20888
+ if ("index" in item2 && item2.index) {
20889
+ children.push(...item2.index.getEnclosed(left, top, right, bottom));
20890
+ if (!item2.getMbr().isEnclosedBy(mbr)) {
20875
20891
  return false;
20876
20892
  }
20877
20893
  }
@@ -20883,10 +20899,10 @@ class SpatialIndex {
20883
20899
  const mbr = new Mbr(left, top, right, bottom);
20884
20900
  const items = this.itemsIndex.getEnclosedOrCrossedBy(mbr);
20885
20901
  const children = [];
20886
- const clearItems = items.filter((item) => {
20887
- if ("index" in item && item.index) {
20888
- children.push(...item.index.getEnclosedOrCrossed(left, top, right, bottom));
20889
- if (!item.getMbr().isEnclosedOrCrossedBy(mbr)) {
20902
+ const clearItems = items.filter((item2) => {
20903
+ if ("index" in item2 && item2.index) {
20904
+ children.push(...item2.index.getEnclosedOrCrossed(left, top, right, bottom));
20905
+ if (!item2.getMbr().isEnclosedOrCrossedBy(mbr)) {
20890
20906
  return false;
20891
20907
  }
20892
20908
  }
@@ -20897,10 +20913,10 @@ class SpatialIndex {
20897
20913
  getUnderPoint(point3, tolerance = 5) {
20898
20914
  const items = this.itemsIndex.getUnderPoint(point3, tolerance);
20899
20915
  const children = [];
20900
- const clearItems = items.filter((item) => {
20901
- if ("index" in item && item.index) {
20902
- children.push(...item.index.getUnderPoint(point3, tolerance));
20903
- if (!item.getMbr().isUnderPoint(point3)) {
20916
+ const clearItems = items.filter((item2) => {
20917
+ if ("index" in item2 && item2.index) {
20918
+ children.push(...item2.index.getUnderPoint(point3, tolerance));
20919
+ if (!item2.getMbr().isUnderPoint(point3)) {
20904
20920
  return false;
20905
20921
  }
20906
20922
  }
@@ -20912,10 +20928,10 @@ class SpatialIndex {
20912
20928
  const mbr = new Mbr(left, top, right, bottom);
20913
20929
  const items = this.itemsIndex.getRectsEnclosedOrCrossedBy(mbr);
20914
20930
  const children = [];
20915
- const clearItems = items.filter((item) => {
20916
- if ("index" in item && item.index) {
20917
- children.push(...item.index.getEnclosedOrCrossed(left, top, right, bottom));
20918
- if (!item.getMbr().isEnclosedOrCrossedBy(mbr)) {
20931
+ const clearItems = items.filter((item2) => {
20932
+ if ("index" in item2 && item2.index) {
20933
+ children.push(...item2.index.getEnclosedOrCrossed(left, top, right, bottom));
20934
+ if (!item2.getMbr().isEnclosedOrCrossedBy(mbr)) {
20919
20935
  return false;
20920
20936
  }
20921
20937
  }
@@ -20927,26 +20943,26 @@ class SpatialIndex {
20927
20943
  return this.getRectsEnclosedOrCrossed(left, top, right, bottom);
20928
20944
  }
20929
20945
  getComments() {
20930
- return this.itemsArray.filter((item) => item instanceof Comment);
20946
+ return this.itemsArray.filter((item2) => item2 instanceof Comment);
20931
20947
  }
20932
20948
  getMbr() {
20933
20949
  return this.Mbr;
20934
20950
  }
20935
20951
  getNearestTo(point3, maxItems, filter, maxDistance) {
20936
20952
  const allItems = this.getItemsWithIncludedChildren(this.itemsArray);
20937
- const filtered = allItems.filter((item) => filter(item));
20938
- const withDistance = filtered.map((item) => ({
20939
- item,
20940
- distance: point3.getDistance(item.getMbr().getCenter())
20953
+ const filtered = allItems.filter((item2) => filter(item2));
20954
+ const withDistance = filtered.map((item2) => ({
20955
+ item: item2,
20956
+ distance: point3.getDistance(item2.getMbr().getCenter())
20941
20957
  })).filter(({ distance }) => distance <= maxDistance);
20942
20958
  withDistance.sort((a, b) => a.distance - b.distance);
20943
- return withDistance.slice(0, maxItems).map(({ item }) => item);
20959
+ return withDistance.slice(0, maxItems).map(({ item: item2 }) => item2);
20944
20960
  }
20945
20961
  list() {
20946
20962
  return this.getItemsWithIncludedChildren(this.itemsArray).concat();
20947
20963
  }
20948
- getZIndex(item) {
20949
- const index2 = this.itemsArray.indexOf(item);
20964
+ getZIndex(item2) {
20965
+ const index2 = this.itemsArray.indexOf(item2);
20950
20966
  if (index2 === -1) {
20951
20967
  return this.getLastZIndex();
20952
20968
  }
@@ -20976,14 +20992,14 @@ class Items {
20976
20992
  this.pointer = pointer;
20977
20993
  this.subject = subject;
20978
20994
  }
20979
- update(item) {
20980
- this.index.change(item);
20995
+ update(item2) {
20996
+ this.index.change(item2);
20981
20997
  }
20982
20998
  listAll() {
20983
20999
  return this.index.list();
20984
21000
  }
20985
21001
  listGroupItems() {
20986
- return this.index.list().filter((item) => ("index" in item) && item.index);
21002
+ return this.index.list().filter((item2) => ("index" in item2) && item2.index);
20987
21003
  }
20988
21004
  getById(id) {
20989
21005
  return this.index.getById(id);
@@ -20998,7 +21014,7 @@ class Items {
20998
21014
  return this.index.getEnclosedOrCrossed(left, top, right, bottom);
20999
21015
  }
21000
21016
  getGroupItemsEnclosedOrCrossed(left, top, right, bottom) {
21001
- return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.index);
21017
+ return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item2) => item2 instanceof BaseItem && item2.index);
21002
21018
  }
21003
21019
  getUnderPoint(point3, tolerance = 5) {
21004
21020
  return this.index.getUnderPoint(point3, tolerance);
@@ -21026,28 +21042,28 @@ class Items {
21026
21042
  const unmodifiedSize = size;
21027
21043
  size = 16;
21028
21044
  const tolerated = this.index.getEnclosedOrCrossed(x - size, y - size, x + size, y + size);
21029
- const groups = tolerated.filter((item) => item.itemType === "Group");
21045
+ const groups = tolerated.filter((item2) => item2.itemType === "Group");
21030
21046
  if (groups.length > 0) {
21031
21047
  return groups;
21032
21048
  }
21033
- let enclosed = tolerated.some((item) => item instanceof Connector2) ? tolerated : this.index.getEnclosedOrCrossed(x, y, x, y);
21049
+ let enclosed = tolerated.some((item2) => item2 instanceof Connector2) ? tolerated : this.index.getEnclosedOrCrossed(x, y, x, y);
21034
21050
  const underPointer = this.getUnderPoint(new Point(x, y), size);
21035
21051
  if (enclosed.length === 0) {
21036
21052
  enclosed = underPointer;
21037
21053
  }
21038
- if (underPointer.some((item) => item.itemType === "Drawing")) {
21054
+ if (underPointer.some((item2) => item2.itemType === "Drawing")) {
21039
21055
  enclosed = [...underPointer, ...enclosed];
21040
21056
  }
21041
- const { nearest } = enclosed.reduce((acc, item) => {
21042
- const area = item.getMbr().getHeight() * item.getMbr().getWidth();
21043
- if (item.itemType === "Drawing" && !item.isPointNearLine(this.pointer.point)) {
21057
+ const { nearest } = enclosed.reduce((acc, item2) => {
21058
+ const area = item2.getMbr().getHeight() * item2.getMbr().getWidth();
21059
+ if (item2.itemType === "Drawing" && !item2.isPointNearLine(this.pointer.point)) {
21044
21060
  return acc;
21045
21061
  }
21046
- const isItemTransparent = item instanceof Shape && item?.getBackgroundColor() === "none";
21047
- const itemZIndex = this.getZIndex(item);
21062
+ const isItemTransparent = item2 instanceof Shape && item2?.getBackgroundColor() === "none";
21063
+ const itemZIndex = this.getZIndex(item2);
21048
21064
  const accZIndex = this.getZIndex(acc.nearest);
21049
21065
  if (itemZIndex > accZIndex && (!isItemTransparent || area === acc.area) || area < acc.area) {
21050
- return { nearest: item, area };
21066
+ return { nearest: item2, area };
21051
21067
  }
21052
21068
  return acc;
21053
21069
  }, { nearest: undefined, area: Infinity });
@@ -21059,8 +21075,8 @@ class Items {
21059
21075
  getNearPointer(maxDistance = 100, maxItems = 10, filter = () => true) {
21060
21076
  return this.index.getNearestTo(this.pointer.point, maxItems, filter, maxDistance);
21061
21077
  }
21062
- getZIndex(item) {
21063
- return this.index.getZIndex(item);
21078
+ getZIndex(item2) {
21079
+ return this.index.getZIndex(item2);
21064
21080
  }
21065
21081
  getByZIndex(index2) {
21066
21082
  return this.index.getByZIndex(index2);
@@ -21069,11 +21085,11 @@ class Items {
21069
21085
  return this.index.getLastZIndex();
21070
21086
  }
21071
21087
  getLinkedConnectorsById(id) {
21072
- return this.listAll().filter((item) => {
21073
- if (!(item instanceof Connector2)) {
21088
+ return this.listAll().filter((item2) => {
21089
+ if (!(item2 instanceof Connector2)) {
21074
21090
  return false;
21075
21091
  }
21076
- const { startItem, endItem } = item.getConnectedItems();
21092
+ const { startItem, endItem } = item2.getConnectedItems();
21077
21093
  if (startItem?.getId() === id || endItem?.getId() === id) {
21078
21094
  return true;
21079
21095
  }
@@ -21084,11 +21100,11 @@ class Items {
21084
21100
  if (!startPointerItemId && !endPointerItemId) {
21085
21101
  return [];
21086
21102
  }
21087
- return this.listAll().filter((item) => {
21088
- if (!(item instanceof Connector2) || !item.isConnected()) {
21103
+ return this.listAll().filter((item2) => {
21104
+ if (!(item2 instanceof Connector2) || !item2.isConnected()) {
21089
21105
  return false;
21090
21106
  }
21091
- const { startItem, endItem } = item.getConnectedItems();
21107
+ const { startItem, endItem } = item2.getConnectedItems();
21092
21108
  if (startPointerItemId && endPointerItemId) {
21093
21109
  if (startPointerItemId && startItem && startItem.getId() === startPointerItemId && endPointerItemId && endItem && endItem.getId() === endPointerItemId) {
21094
21110
  return true;
@@ -21106,9 +21122,9 @@ class Items {
21106
21122
  }
21107
21123
  render(context) {
21108
21124
  const items = this.getItemsInView();
21109
- items.forEach((item) => {
21110
- if (item.parent === "Board") {
21111
- item.render(context);
21125
+ items.forEach((item2) => {
21126
+ if (item2.parent === "Board") {
21127
+ item2.render(context);
21112
21128
  }
21113
21129
  });
21114
21130
  }
@@ -21121,17 +21137,17 @@ class Items {
21121
21137
  return this.getHTML(documentFactory, items);
21122
21138
  }
21123
21139
  getHTML(documentFactory, items) {
21124
- const lowestCoordinates = items.map((item) => item.getMbr()).reduce((acc, mbr) => ({
21140
+ const lowestCoordinates = items.map((item2) => item2.getMbr()).reduce((acc, mbr) => ({
21125
21141
  left: Math.min(acc.left, mbr.left),
21126
21142
  top: Math.min(acc.top, mbr.top)
21127
21143
  }), { left: 0, top: 0 });
21128
21144
  const groups = [];
21129
21145
  const rest = [];
21130
- items.forEach((item) => {
21131
- if ("index" in item && item.index) {
21132
- groups.push(item);
21146
+ items.forEach((item2) => {
21147
+ if ("index" in item2 && item2.index) {
21148
+ groups.push(item2);
21133
21149
  } else {
21134
- rest.push(item);
21150
+ rest.push(item2);
21135
21151
  }
21136
21152
  });
21137
21153
  const childrenMap = new Map;
@@ -21141,34 +21157,34 @@ class Items {
21141
21157
  translateElementBy(html, -lowestCoordinates.left, -lowestCoordinates.top);
21142
21158
  return html;
21143
21159
  });
21144
- const restHTML = rest.map((item) => ("renderHTML" in item) && item.renderHTML(documentFactory)).filter((item) => !!item).map((item) => {
21145
- if (item.tagName.toLowerCase() === "connector-item") {
21146
- const startX = parseFloat(item.getAttribute("data-start-point-x") || "0");
21147
- const startY = parseFloat(item.getAttribute("data-start-point-y") || "0");
21148
- const endX = parseFloat(item.getAttribute("data-end-point-x") || "0");
21149
- const endY = parseFloat(item.getAttribute("data-end-point-y") || "0");
21150
- item.setAttribute("data-start-point-x", (startX - lowestCoordinates.left).toString());
21151
- item.setAttribute("data-start-point-y", (startY - lowestCoordinates.top).toString());
21152
- item.setAttribute("data-end-point-x", (endX - lowestCoordinates.left).toString());
21153
- item.setAttribute("data-end-point-y", (endY - lowestCoordinates.top).toString());
21154
- }
21155
- return translateElementBy(item, -lowestCoordinates.left, -lowestCoordinates.top);
21156
- });
21157
- for (const item of restHTML) {
21158
- const parentFrameId = childrenMap.get(item.id);
21160
+ const restHTML = rest.map((item2) => ("renderHTML" in item2) && item2.renderHTML(documentFactory)).filter((item2) => !!item2).map((item2) => {
21161
+ if (item2.tagName.toLowerCase() === "connector-item") {
21162
+ const startX = parseFloat(item2.getAttribute("data-start-point-x") || "0");
21163
+ const startY = parseFloat(item2.getAttribute("data-start-point-y") || "0");
21164
+ const endX = parseFloat(item2.getAttribute("data-end-point-x") || "0");
21165
+ const endY = parseFloat(item2.getAttribute("data-end-point-y") || "0");
21166
+ item2.setAttribute("data-start-point-x", (startX - lowestCoordinates.left).toString());
21167
+ item2.setAttribute("data-start-point-y", (startY - lowestCoordinates.top).toString());
21168
+ item2.setAttribute("data-end-point-x", (endX - lowestCoordinates.left).toString());
21169
+ item2.setAttribute("data-end-point-y", (endY - lowestCoordinates.top).toString());
21170
+ }
21171
+ return translateElementBy(item2, -lowestCoordinates.left, -lowestCoordinates.top);
21172
+ });
21173
+ for (const item2 of restHTML) {
21174
+ const parentFrameId = childrenMap.get(item2.id);
21159
21175
  const group = GroupsHTML.find((el) => parentFrameId !== undefined && el.id === parentFrameId);
21160
21176
  if (group) {
21161
- positionRelatively(item, group);
21162
- group.appendChild(item);
21177
+ positionRelatively(item2, group);
21178
+ group.appendChild(item2);
21163
21179
  }
21164
21180
  }
21165
21181
  let result = "";
21166
21182
  for (const group of GroupsHTML) {
21167
21183
  result += group.outerHTML;
21168
21184
  }
21169
- for (const item of restHTML) {
21170
- if (!childrenMap.get(item.id)) {
21171
- result += item.outerHTML;
21185
+ for (const item2 of restHTML) {
21186
+ if (!childrenMap.get(item2.id)) {
21187
+ result += item2.outerHTML;
21172
21188
  }
21173
21189
  }
21174
21190
  return result;
@@ -21188,52 +21204,52 @@ class SimpleSpatialIndex {
21188
21204
  this.itemsArray = [];
21189
21205
  this.Mbr = new Mbr;
21190
21206
  }
21191
- insert(item) {
21192
- this.itemsArray.push(item);
21207
+ insert(item2) {
21208
+ this.itemsArray.push(item2);
21193
21209
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
21194
- this.Mbr = item.getMbr().copy();
21210
+ this.Mbr = item2.getMbr().copy();
21195
21211
  } else {
21196
- this.Mbr.combine([item.getMbr()]);
21212
+ this.Mbr.combine([item2.getMbr()]);
21197
21213
  }
21198
- item.subject.subscribe(this.change);
21214
+ item2.subject.subscribe(this.change);
21199
21215
  this.subject.publish(this.items);
21200
21216
  }
21201
- change = (item) => {
21217
+ change = (item2) => {
21202
21218
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
21203
- this.Mbr = item.getMbr().copy();
21219
+ this.Mbr = item2.getMbr().copy();
21204
21220
  } else {
21205
- this.Mbr.combine([item.getMbr()]);
21221
+ this.Mbr.combine([item2.getMbr()]);
21206
21222
  }
21207
21223
  this.subject.publish(this.items);
21208
21224
  };
21209
- remove(item) {
21210
- if ("index" in item && item.index) {
21211
- item.removeChildItems(item.index.list());
21225
+ remove(item2) {
21226
+ if ("index" in item2 && item2.index) {
21227
+ item2.removeChildItems(item2.index.list());
21212
21228
  }
21213
- if (item.parent !== "Board") {
21214
- const parentFrame = this.items.getById(item.parent);
21215
- parentFrame?.removeChildItems(item);
21229
+ if (item2.parent !== "Board") {
21230
+ const parentFrame = this.items.getById(item2.parent);
21231
+ parentFrame?.removeChildItems(item2);
21216
21232
  }
21217
- this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
21233
+ this.itemsArray.splice(this.itemsArray.indexOf(item2), 1);
21218
21234
  this.Mbr = new Mbr;
21219
- this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
21235
+ this.itemsArray.forEach((item3) => this.Mbr.combine([item3.getMbr()]));
21220
21236
  this.subject.publish(this.items);
21221
21237
  }
21222
21238
  copy() {
21223
- return this.itemsArray.map((item) => ({
21224
- ...item.serialize(true),
21225
- id: item.getId()
21239
+ return this.itemsArray.map((item2) => ({
21240
+ ...item2.serialize(true),
21241
+ id: item2.getId()
21226
21242
  }));
21227
21243
  }
21228
- moveToZIndex(item, zIndex) {
21229
- const index2 = this.itemsArray.indexOf(item);
21244
+ moveToZIndex(item2, zIndex) {
21245
+ const index2 = this.itemsArray.indexOf(item2);
21230
21246
  this.itemsArray.splice(index2, 1);
21231
- this.itemsArray.splice(zIndex, 0, item);
21232
- this.change(item);
21247
+ this.itemsArray.splice(zIndex, 0, item2);
21248
+ this.change(item2);
21233
21249
  this.subject.publish(this.items);
21234
21250
  }
21235
21251
  moveManyToZIndex(itemsRecord) {
21236
- const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item) => item !== undefined);
21252
+ const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item2) => item2 !== undefined);
21237
21253
  const zIndex = Object.values(itemsRecord);
21238
21254
  for (let i = 0;i < zIndex.length; i++) {
21239
21255
  const index2 = zIndex[i];
@@ -21241,37 +21257,37 @@ class SimpleSpatialIndex {
21241
21257
  }
21242
21258
  this.itemsArray.forEach(this.change.bind(this));
21243
21259
  }
21244
- sendToBack(item, shouldPublish = true) {
21245
- const index2 = this.itemsArray.indexOf(item);
21260
+ sendToBack(item2, shouldPublish = true) {
21261
+ const index2 = this.itemsArray.indexOf(item2);
21246
21262
  this.itemsArray.splice(index2, 1);
21247
- this.itemsArray.unshift(item);
21263
+ this.itemsArray.unshift(item2);
21248
21264
  if (shouldPublish) {
21249
21265
  this.subject.publish(this.items);
21250
21266
  }
21251
21267
  }
21252
21268
  sendManyToBack(items) {
21253
21269
  const newItems = [...items];
21254
- this.itemsArray.forEach((item) => {
21255
- if (!items.includes(item)) {
21256
- newItems.push(item);
21270
+ this.itemsArray.forEach((item2) => {
21271
+ if (!items.includes(item2)) {
21272
+ newItems.push(item2);
21257
21273
  }
21258
21274
  });
21259
21275
  this.itemsArray = newItems;
21260
21276
  this.itemsArray.forEach(this.change.bind(this));
21261
21277
  }
21262
- bringToFront(item, shouldPublish = true) {
21263
- const index2 = this.itemsArray.indexOf(item);
21278
+ bringToFront(item2, shouldPublish = true) {
21279
+ const index2 = this.itemsArray.indexOf(item2);
21264
21280
  this.itemsArray.splice(index2, 1);
21265
- this.itemsArray.push(item);
21281
+ this.itemsArray.push(item2);
21266
21282
  if (shouldPublish) {
21267
21283
  this.subject.publish(this.items);
21268
21284
  }
21269
21285
  }
21270
21286
  bringManyToFront(items) {
21271
21287
  const newItems = [];
21272
- this.itemsArray.forEach((item) => {
21273
- if (!items.includes(item)) {
21274
- newItems.push(item);
21288
+ this.itemsArray.forEach((item2) => {
21289
+ if (!items.includes(item2)) {
21290
+ newItems.push(item2);
21275
21291
  }
21276
21292
  });
21277
21293
  newItems.push(...items);
@@ -21297,9 +21313,9 @@ class SimpleSpatialIndex {
21297
21313
  this.subject.publish(this.items);
21298
21314
  }
21299
21315
  getById(id) {
21300
- const item = this.itemsArray.find((item2) => item2.getId() === id);
21301
- if (item) {
21302
- return item;
21316
+ const item2 = this.itemsArray.find((item3) => item3.getId() === id);
21317
+ if (item2) {
21318
+ return item2;
21303
21319
  }
21304
21320
  }
21305
21321
  findById(id) {
@@ -21308,9 +21324,9 @@ class SimpleSpatialIndex {
21308
21324
  getEnclosed(left, top, right, bottom) {
21309
21325
  const mbr = new Mbr(left, top, right, bottom);
21310
21326
  const items = [];
21311
- this.itemsArray.forEach((item) => {
21312
- if (item.isEnclosedBy(mbr)) {
21313
- items.push(item);
21327
+ this.itemsArray.forEach((item2) => {
21328
+ if (item2.isEnclosedBy(mbr)) {
21329
+ items.push(item2);
21314
21330
  }
21315
21331
  });
21316
21332
  return items;
@@ -21318,18 +21334,18 @@ class SimpleSpatialIndex {
21318
21334
  getEnclosedOrCrossed(left, top, right, bottom) {
21319
21335
  const mbr = new Mbr(left, top, right, bottom);
21320
21336
  const items = [];
21321
- this.itemsArray.forEach((item) => {
21322
- if (item.isEnclosedOrCrossedBy(mbr)) {
21323
- items.push(item);
21337
+ this.itemsArray.forEach((item2) => {
21338
+ if (item2.isEnclosedOrCrossedBy(mbr)) {
21339
+ items.push(item2);
21324
21340
  }
21325
21341
  });
21326
21342
  return items;
21327
21343
  }
21328
21344
  getUnderPoint(point3, tolerace = 5) {
21329
21345
  const items = [];
21330
- this.itemsArray.forEach((item) => {
21331
- if (item.isUnderPoint(point3, tolerace)) {
21332
- items.push(item);
21346
+ this.itemsArray.forEach((item2) => {
21347
+ if (item2.isUnderPoint(point3, tolerace)) {
21348
+ items.push(item2);
21333
21349
  }
21334
21350
  });
21335
21351
  return items;
@@ -21340,8 +21356,8 @@ class SimpleSpatialIndex {
21340
21356
  list() {
21341
21357
  return this.itemsArray.concat();
21342
21358
  }
21343
- getZIndex(item) {
21344
- return this.itemsArray.indexOf(item);
21359
+ getZIndex(item2) {
21360
+ return this.itemsArray.indexOf(item2);
21345
21361
  }
21346
21362
  getLastZIndex() {
21347
21363
  return this.itemsArray.length - 1;
@@ -21355,8 +21371,8 @@ class SimpleSpatialIndex {
21355
21371
  }
21356
21372
  }
21357
21373
  render(context) {
21358
- this.itemsArray.forEach((item) => {
21359
- item.render(context);
21374
+ this.itemsArray.forEach((item2) => {
21375
+ item2.render(context);
21360
21376
  });
21361
21377
  }
21362
21378
  }
@@ -21407,7 +21423,7 @@ class BaseItem extends Mbr {
21407
21423
  if (!this.index) {
21408
21424
  return null;
21409
21425
  }
21410
- return this.index.items.listAll().map((item) => item.getId());
21426
+ return this.index.items.listAll().map((item2) => item2.getId());
21411
21427
  }
21412
21428
  addChildItems(children) {
21413
21429
  if (!this.index) {
@@ -21445,17 +21461,17 @@ class BaseItem extends Mbr {
21445
21461
  this.addChildItems(itemsToAdd);
21446
21462
  this.removeChildItems(itemsToRemove);
21447
21463
  }
21448
- handleNesting(item, options) {
21449
- const isItem = "itemType" in item;
21450
- const itemMbr = isItem ? item.getMbr() : item;
21451
- if (item instanceof BaseItem && !item.canBeNested) {
21464
+ handleNesting(item2, options) {
21465
+ const isItem = "itemType" in item2;
21466
+ const itemMbr = isItem ? item2.getMbr() : item2;
21467
+ if (item2 instanceof BaseItem && !item2.canBeNested) {
21452
21468
  return false;
21453
21469
  }
21454
- if (options?.cancelIfChild && isItem && item.parent !== "Board") {
21470
+ if (options?.cancelIfChild && isItem && item2.parent !== "Board") {
21455
21471
  return false;
21456
21472
  }
21457
21473
  const mbr = this.getMbr().copy();
21458
- if (item.isEnclosedOrCrossedBy(mbr)) {
21474
+ if (item2.isEnclosedOrCrossedBy(mbr)) {
21459
21475
  if (mbr.isInside(itemMbr.getCenter())) {
21460
21476
  if (!options || !options.onlyForOut) {
21461
21477
  return true;
@@ -23752,8 +23768,8 @@ function isChild(value) {
23752
23768
  if (!Array.isArray(value2))
23753
23769
  return true;
23754
23770
  const list2 = value2;
23755
- for (const item of list2) {
23756
- if (typeof item !== "number" && typeof item !== "string") {
23771
+ for (const item2 of list2) {
23772
+ if (typeof item2 !== "number" && typeof item2 !== "string") {
23757
23773
  return true;
23758
23774
  }
23759
23775
  }
@@ -23792,8 +23808,8 @@ function addProperty(schema, properties, key, value) {
23792
23808
  }
23793
23809
  if (Array.isArray(result)) {
23794
23810
  const finalResult = [];
23795
- for (const item of result) {
23796
- finalResult.push(parsePrimitive(info, info.property, item));
23811
+ for (const item2 of result) {
23812
+ finalResult.push(parsePrimitive(info, info.property, item2));
23797
23813
  }
23798
23814
  result = finalResult;
23799
23815
  }
@@ -34860,8 +34876,8 @@ function list5(node2, parent, state, info) {
34860
34876
  if (checkRule(state) === bullet && firstListItem) {
34861
34877
  let index2 = -1;
34862
34878
  while (++index2 < node2.children.length) {
34863
- const item = node2.children[index2];
34864
- if (item && item.type === "listItem" && item.children && item.children[0] && item.children[0].type === "thematicBreak") {
34879
+ const item2 = node2.children[index2];
34880
+ if (item2 && item2.type === "listItem" && item2.children && item2.children[0] && item2.children[0].type === "thematicBreak") {
34865
34881
  useDifferentMarker = true;
34866
34882
  break;
34867
34883
  }
@@ -35521,12 +35537,12 @@ async function convertMarkdownToSlate(text5) {
35521
35537
  ...nodes.filter((node2) => node2.type !== "list_item")
35522
35538
  ];
35523
35539
  }
35524
- return nodes.map((item) => {
35540
+ return nodes.map((item2) => {
35525
35541
  setNodeStyles({
35526
- node: item,
35527
- isPaddingTopNeeded: item.type !== "code_block"
35542
+ node: item2,
35543
+ isPaddingTopNeeded: item2.type !== "code_block"
35528
35544
  });
35529
- return item;
35545
+ return item2;
35530
35546
  });
35531
35547
  }
35532
35548
  function detectListType(text5) {
@@ -35939,17 +35955,17 @@ class FloatingPoint extends Point {
35939
35955
  relativePoint;
35940
35956
  pointType = "Floating";
35941
35957
  edge;
35942
- constructor(item, relativePoint) {
35958
+ constructor(item2, relativePoint) {
35943
35959
  super();
35944
- this.item = item;
35960
+ this.item = item2;
35945
35961
  this.relativePoint = relativePoint;
35946
35962
  if (relativePoint.y <= 0) {
35947
35963
  this.edge = "top";
35948
- } else if (relativePoint.y >= item.getMbr().getHeight()) {
35964
+ } else if (relativePoint.y >= item2.getMbr().getHeight()) {
35949
35965
  this.edge = "bottom";
35950
35966
  } else if (relativePoint.x <= 0) {
35951
35967
  this.edge = "left";
35952
- } else if (relativePoint.x >= item.getMbr().getWidth()) {
35968
+ } else if (relativePoint.x >= item2.getMbr().getWidth()) {
35953
35969
  this.edge = "right";
35954
35970
  }
35955
35971
  this.recalculatePoint();
@@ -35980,17 +35996,17 @@ class FixedPoint extends Point {
35980
35996
  relativePoint;
35981
35997
  pointType = "Fixed";
35982
35998
  edge;
35983
- constructor(item, relativePoint) {
35999
+ constructor(item2, relativePoint) {
35984
36000
  super();
35985
- this.item = item;
36001
+ this.item = item2;
35986
36002
  this.relativePoint = relativePoint;
35987
36003
  if (relativePoint.y <= 0) {
35988
36004
  this.edge = "top";
35989
- } else if (relativePoint.y >= item.getMbr().getHeight()) {
36005
+ } else if (relativePoint.y >= item2.getMbr().getHeight()) {
35990
36006
  this.edge = "bottom";
35991
36007
  } else if (relativePoint.x <= 0) {
35992
36008
  this.edge = "left";
35993
- } else if (relativePoint.x >= item.getMbr().getWidth()) {
36009
+ } else if (relativePoint.x >= item2.getMbr().getWidth()) {
35994
36010
  this.edge = "right";
35995
36011
  }
35996
36012
  this.recalculatePoint();
@@ -36021,16 +36037,16 @@ class FixedConnectorPoint extends Point {
36021
36037
  tangent;
36022
36038
  segmentIndex;
36023
36039
  pointType = "FixedConnector";
36024
- constructor(item, tangent, segmentIndex) {
36040
+ constructor(item2, tangent, segmentIndex) {
36025
36041
  super();
36026
- this.item = item;
36042
+ this.item = item2;
36027
36043
  this.tangent = tangent;
36028
36044
  this.segmentIndex = segmentIndex;
36029
36045
  this.recalculatePoint();
36030
36046
  }
36031
36047
  recalculatePoint() {
36032
- const item = this.item;
36033
- const segments = item.getPaths().getSegments();
36048
+ const item2 = this.item;
36049
+ const segments = item2.getPaths().getSegments();
36034
36050
  const segment = segments.length > this.segmentIndex ? segments[this.segmentIndex] : segments[segments.length - 1];
36035
36051
  const point5 = segment.getPoint(this.tangent);
36036
36052
  this.x = point5.x;
@@ -36055,38 +36071,38 @@ function getControlPoint(data, findItem2) {
36055
36071
  if (data.pointType === "Board") {
36056
36072
  return new BoardPoint(Math.round(data.x), Math.round(data.y));
36057
36073
  } else {
36058
- const item = findItem2(data.itemId);
36059
- if (!item) {
36074
+ const item2 = findItem2(data.itemId);
36075
+ if (!item2) {
36060
36076
  console.warn(`getControlPoint(): item not found for ${data.itemId}`);
36061
36077
  return new BoardPoint(0, 0);
36062
36078
  }
36063
36079
  switch (data.pointType) {
36064
36080
  case "FixedConnector":
36065
- if (item instanceof Connector2) {
36066
- return new FixedConnectorPoint(item, data.tangent, data.segment);
36081
+ if (item2 instanceof Connector2) {
36082
+ return new FixedConnectorPoint(item2, data.tangent, data.segment);
36067
36083
  } else {
36068
36084
  throw new Error(`getControlPoint(): item must be a connector`);
36069
36085
  }
36070
36086
  case "Floating":
36071
- return new FloatingPoint(item, new Point(data.relativeX, data.relativeY));
36087
+ return new FloatingPoint(item2, new Point(data.relativeX, data.relativeY));
36072
36088
  case "Fixed":
36073
- return new FixedPoint(item, new Point(data.relativeX, data.relativeY));
36089
+ return new FixedPoint(item2, new Point(data.relativeX, data.relativeY));
36074
36090
  }
36075
36091
  }
36076
36092
  }
36077
- function toRelativePoint(point5, item) {
36078
- const matrix = item.transformation?.matrix || new Matrix2;
36093
+ function toRelativePoint(point5, item2) {
36094
+ const matrix = item2.transformation?.matrix || new Matrix2;
36079
36095
  const inverse = matrix.getInverse();
36080
36096
  point5 = point5.copy();
36081
36097
  point5.transform(inverse);
36082
36098
  return point5;
36083
36099
  }
36084
- function fromRelativePoint(relativePoint, item, edge) {
36085
- const matrix = item.transformation?.matrix.copy() || new Matrix2;
36100
+ function fromRelativePoint(relativePoint, item2, edge) {
36101
+ const matrix = item2.transformation?.matrix.copy() || new Matrix2;
36086
36102
  const point5 = relativePoint.copy();
36087
36103
  point5.transform(matrix);
36088
- if (item instanceof RichText || item instanceof AINode) {
36089
- const itemMbr = item.getMbr();
36104
+ if (item2 instanceof RichText || item2 instanceof AINode) {
36105
+ const itemMbr = item2.getMbr();
36090
36106
  const { x: centerX, y: centerY } = itemMbr.getCenter();
36091
36107
  switch (edge) {
36092
36108
  case "left":
@@ -36098,7 +36114,7 @@ function fromRelativePoint(relativePoint, item, edge) {
36098
36114
  case "bottom":
36099
36115
  return new Point(centerX, itemMbr.bottom);
36100
36116
  default:
36101
- return item.getMbr().getClosestEdgeCenterPoint(point5);
36117
+ return item2.getMbr().getClosestEdgeCenterPoint(point5);
36102
36118
  }
36103
36119
  }
36104
36120
  return point5;
@@ -37447,7 +37463,7 @@ class Connector2 extends BaseItem {
37447
37463
  return this;
37448
37464
  }
37449
37465
  getConnectorById(items, connectorId) {
37450
- return items.find((item) => item instanceof Connector2 && item.getId() === connectorId);
37466
+ return items.find((item2) => item2 instanceof Connector2 && item2.getId() === connectorId);
37451
37467
  }
37452
37468
  updateTitle() {
37453
37469
  const selection = this.board.selection;
@@ -40084,8 +40100,8 @@ async function exportBoardSnapshot({
40084
40100
  context.matrix.applyToContext(context.ctx);
40085
40101
  const { left, top, right, bottom } = selection;
40086
40102
  const inView = board.items.index.getRectsEnclosedOrCrossed(left, top, right, bottom);
40087
- for (const item of inView) {
40088
- item.render(context);
40103
+ for (const item2 of inView) {
40104
+ item2.render(context);
40089
40105
  }
40090
40106
  const blob = await offscreenCanvas.convertToBlob({ type: "image/png" });
40091
40107
  const dataUrl = await convertBlobToDataUrl(blob);
@@ -40283,7 +40299,7 @@ class Frame2 extends BaseItem {
40283
40299
  return this.id;
40284
40300
  }
40285
40301
  getChildrenIds() {
40286
- return this.index?.list().map((item) => item.getId()) || [];
40302
+ return this.index?.list().map((item2) => item2.getId()) || [];
40287
40303
  }
40288
40304
  updateMbr() {
40289
40305
  const rect = this.path.getMbr().copy();
@@ -40518,11 +40534,11 @@ class Frame2 extends BaseItem {
40518
40534
  }
40519
40535
  });
40520
40536
  const currMbr = this.getMbr();
40521
- this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item) => {
40522
- if (item.parent === "Board") {
40523
- if (this.handleNesting(item)) {
40524
- this.applyAddChildren([item.getId()]);
40525
- item.parent = this.getId();
40537
+ this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item2) => {
40538
+ if (item2.parent === "Board") {
40539
+ if (this.handleNesting(item2)) {
40540
+ this.applyAddChildren([item2.getId()]);
40541
+ item2.parent = this.getId();
40526
40542
  }
40527
40543
  }
40528
40544
  });
@@ -42720,9 +42736,9 @@ class Group extends BaseItem {
42720
42736
  if (data.children) {
42721
42737
  data.children.forEach((childId) => {
42722
42738
  this.applyAddChild(childId);
42723
- const item = this.board.items.getById(childId);
42724
- if (item) {
42725
- item.parent = this.getId();
42739
+ const item2 = this.board.items.getById(childId);
42740
+ if (item2) {
42741
+ item2.parent = this.getId();
42726
42742
  }
42727
42743
  });
42728
42744
  }
@@ -42752,11 +42768,11 @@ class Group extends BaseItem {
42752
42768
  let right = Number.MIN_SAFE_INTEGER;
42753
42769
  let bottom = Number.MIN_SAFE_INTEGER;
42754
42770
  const mbrs = this.children.flatMap((childId) => {
42755
- const item = this.board.items.getById(childId);
42756
- if (!item) {
42771
+ const item2 = this.board.items.getById(childId);
42772
+ if (!item2) {
42757
42773
  return [];
42758
42774
  }
42759
- const mbr2 = item.getMbr();
42775
+ const mbr2 = item2.getMbr();
42760
42776
  if (!mbr2) {
42761
42777
  return [];
42762
42778
  }
@@ -42791,7 +42807,7 @@ class Group extends BaseItem {
42791
42807
  return this.children;
42792
42808
  }
42793
42809
  getChildren() {
42794
- return this.children.map((itemId) => this.board.items.getById(itemId)).filter((item) => item !== undefined);
42810
+ return this.children.map((itemId) => this.board.items.getById(itemId)).filter((item2) => item2 !== undefined);
42795
42811
  }
42796
42812
  updateMbr() {
42797
42813
  const rect = this.getMbr();
@@ -42804,9 +42820,9 @@ class Group extends BaseItem {
42804
42820
  setChildren(items) {
42805
42821
  items.forEach((itemId) => {
42806
42822
  this.addChild(itemId);
42807
- const item = this.board.items.getById(itemId);
42808
- if (item) {
42809
- item.parent = this.getId();
42823
+ const item2 = this.board.items.getById(itemId);
42824
+ if (item2) {
42825
+ item2.parent = this.getId();
42810
42826
  }
42811
42827
  });
42812
42828
  this.updateMbr();
@@ -42814,9 +42830,9 @@ class Group extends BaseItem {
42814
42830
  removeChildren() {
42815
42831
  this.children.forEach((itemId) => {
42816
42832
  this.removeChild(itemId);
42817
- const item = this.board.items.getById(itemId);
42818
- if (item) {
42819
- item.parent = this.parent;
42833
+ const item2 = this.board.items.getById(itemId);
42834
+ if (item2) {
42835
+ item2.parent = this.parent;
42820
42836
  }
42821
42837
  });
42822
42838
  this.updateMbr();
@@ -43149,16 +43165,16 @@ class Anchor extends Mbr {
43149
43165
  }
43150
43166
  }
43151
43167
  // src/Items/Connector/ConnectorSnap.ts
43152
- function getFixedPoint(item, point5) {
43153
- if (item instanceof Connector2) {
43154
- const nearestSegmentData = item.getPaths().getNearestEdgeAndPointTo(point5);
43168
+ function getFixedPoint(item2, point5) {
43169
+ if (item2 instanceof Connector2) {
43170
+ const nearestSegmentData = item2.getPaths().getNearestEdgeAndPointTo(point5);
43155
43171
  const segment = nearestSegmentData.segment;
43156
43172
  const index2 = nearestSegmentData.index;
43157
43173
  const tangent = segment.getParameter(point5);
43158
- return new FixedConnectorPoint(item, tangent, index2);
43174
+ return new FixedConnectorPoint(item2, tangent, index2);
43159
43175
  } else {
43160
- const relativePoint = toRelativePoint(point5, item);
43161
- return new FixedPoint(item, relativePoint);
43176
+ const relativePoint = toRelativePoint(point5, item2);
43177
+ return new FixedPoint(item2, relativePoint);
43162
43178
  }
43163
43179
  }
43164
43180
 
@@ -43211,20 +43227,20 @@ class ConnectorSnap {
43211
43227
  }
43212
43228
  this.setSnap();
43213
43229
  const pointer = this.board.pointer.point;
43214
- const { anchor, item, point: point5 } = this.snap;
43215
- if (!item) {
43230
+ const { anchor, item: item2, point: point5 } = this.snap;
43231
+ if (!item2) {
43216
43232
  const pointer2 = this.board.pointer.point;
43217
43233
  this.controlPoint = new BoardPoint(pointer2.x, pointer2.y);
43218
43234
  } else if (anchor) {
43219
- this.controlPoint = getFixedPoint(item, anchor.getCenter());
43235
+ this.controlPoint = getFixedPoint(item2, anchor.getCenter());
43220
43236
  } else if (point5) {
43221
- const nearest2 = item.getNearestEdgePointTo(pointer);
43222
- this.controlPoint = getFixedPoint(item, nearest2);
43237
+ const nearest2 = item2.getNearestEdgePointTo(pointer);
43238
+ this.controlPoint = getFixedPoint(item2, nearest2);
43223
43239
  } else {
43224
43240
  if (this.hover.isTimeoutElapsed) {
43225
- this.controlPoint = getFixedPoint(item, pointer);
43241
+ this.controlPoint = getFixedPoint(item2, pointer);
43226
43242
  } else {
43227
- this.controlPoint = getFixedPoint(item, pointer);
43243
+ this.controlPoint = getFixedPoint(item2, pointer);
43228
43244
  }
43229
43245
  }
43230
43246
  }
@@ -43285,23 +43301,23 @@ class ConnectorSnap {
43285
43301
  }
43286
43302
  return nearest;
43287
43303
  }
43288
- getClosestPointOnItem(item, position4) {
43289
- const nearestEdgePoint = item.getNearestEdgePointTo(position4);
43290
- return getFixedPoint(item, nearestEdgePoint);
43304
+ getClosestPointOnItem(item2, position4) {
43305
+ const nearestEdgePoint = item2.getNearestEdgePointTo(position4);
43306
+ return getFixedPoint(item2, nearestEdgePoint);
43291
43307
  }
43292
- isNearBorder(item) {
43293
- if (!item) {
43308
+ isNearBorder(item2) {
43309
+ if (!item2) {
43294
43310
  return false;
43295
43311
  }
43296
43312
  const pointer = this.board.pointer.point;
43297
- const point5 = item.getNearestEdgePointTo(pointer);
43313
+ const point5 = item2.getNearestEdgePointTo(pointer);
43298
43314
  const distance = pointer.getDistance(point5);
43299
43315
  return distance < this.distance.border / this.board.camera.getScale();
43300
43316
  }
43301
43317
  setSnap() {
43302
- const item = this.snap.item;
43303
- const path2 = item && "getPath" in item ? item?.getPath() : null;
43304
- if (!item || !path2) {
43318
+ const item2 = this.snap.item;
43319
+ const path2 = item2 && "getPath" in item2 ? item2?.getPath() : null;
43320
+ if (!item2 || !path2) {
43305
43321
  this.snap.path = null;
43306
43322
  this.snap.anchors = [];
43307
43323
  this.snap.anchor = null;
@@ -43312,11 +43328,11 @@ class ConnectorSnap {
43312
43328
  if (this.snap.item === this.hover.item && !this.hover.isTimeoutElapsed) {
43313
43329
  path2.setBackgroundColor(this.color.snapBackgroundHighlight);
43314
43330
  }
43315
- this.setAnchors(item);
43331
+ this.setAnchors(item2);
43316
43332
  }
43317
43333
  }
43318
- setAnchors(item) {
43319
- const points = item.getSnapAnchorPoints();
43334
+ setAnchors(item2) {
43335
+ const points = item2.getSnapAnchorPoints();
43320
43336
  if (!points) {
43321
43337
  return;
43322
43338
  }
@@ -43350,10 +43366,10 @@ class ConnectorSnap {
43350
43366
  }
43351
43367
  setPoint() {
43352
43368
  const pointer = this.board.pointer.point;
43353
- const { item, anchor } = this.snap;
43354
- if (item) {
43369
+ const { item: item2, anchor } = this.snap;
43370
+ if (item2) {
43355
43371
  if (!anchor) {
43356
- const point5 = item.getNearestEdgePointTo(pointer);
43372
+ const point5 = item2.getNearestEdgePointTo(pointer);
43357
43373
  if (point5.getDistance(pointer) < this.distance.border || !this.hover.isTimeoutElapsed) {
43358
43374
  this.snap.point = new Anchor(point5.x, point5.y, 5, this.color.pointBorder, this.color.pointBackground, 1);
43359
43375
  } else {
@@ -43726,12 +43742,12 @@ class NestingHighlighter extends Tool {
43726
43742
  this.toHighlight.push({ groupItem, children: array });
43727
43743
  }
43728
43744
  }
43729
- addSingleItem(item) {
43730
- this.toHighlight.push({ children: [item] });
43745
+ addSingleItem(item2) {
43746
+ this.toHighlight.push({ children: [item2] });
43731
43747
  }
43732
- remove(item) {
43748
+ remove(item2) {
43733
43749
  this.toHighlight.forEach((group) => {
43734
- group.children = group.children.filter((child) => child !== item);
43750
+ group.children = group.children.filter((child) => child !== item2);
43735
43751
  });
43736
43752
  this.toHighlight = this.toHighlight.filter((group) => group.children.length > 0);
43737
43753
  }
@@ -43798,7 +43814,7 @@ class AddFrame extends BoardTool {
43798
43814
  this.mbr.borderColor = "blue";
43799
43815
  this.nestingHighlighter.clear();
43800
43816
  const enclosedOrCrossed = this.board.items.getEnclosedOrCrossed(this.mbr.left, this.mbr.top, this.mbr.right, this.mbr.bottom);
43801
- const inside = enclosedOrCrossed.filter((item) => !(item instanceof Frame2) && item.parent === "Board" && this.mbr.isInside(item.getMbr().getCenter()));
43817
+ const inside = enclosedOrCrossed.filter((item2) => !(item2 instanceof Frame2) && item2.parent === "Board" && this.mbr.isInside(item2.getMbr().getCenter()));
43802
43818
  this.nestingHighlighter.add(this.frame, inside);
43803
43819
  this.initTransformation();
43804
43820
  this.board.tools.publish();
@@ -43819,7 +43835,7 @@ class AddFrame extends BoardTool {
43819
43835
  localStorage.setItem("lastFrameScale", JSON.stringify(this.frame.transformation.getScale()));
43820
43836
  }
43821
43837
  const currMbr = this.frame.getMbr();
43822
- 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));
43838
+ 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));
43823
43839
  this.applyAddChildren(frameChildren);
43824
43840
  if (this.shape !== "Custom") {
43825
43841
  this.applyCanChangeRatio(false);
@@ -43835,7 +43851,7 @@ class AddFrame extends BoardTool {
43835
43851
  return true;
43836
43852
  }
43837
43853
  addNextTo() {
43838
- const framesInView = this.board.items.getItemsInView().filter((item) => item instanceof Frame2);
43854
+ const framesInView = this.board.items.getItemsInView().filter((item2) => item2 instanceof Frame2);
43839
43855
  if (framesInView.length === 0) {
43840
43856
  if (this.shape === "Custom") {
43841
43857
  const { x, y } = this.frame.getLastFrameScale();
@@ -43873,7 +43889,7 @@ class AddFrame extends BoardTool {
43873
43889
  this.board.camera.viewRectangle(this.frame.getMbr());
43874
43890
  }
43875
43891
  const frameMbr = this.frame.getMbr();
43876
- 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]));
43892
+ 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]));
43877
43893
  const frame = this.board.add(this.frame);
43878
43894
  frame.text.editor.moveCursorToEndOfTheText();
43879
43895
  this.nestingHighlighter.clear();
@@ -44378,13 +44394,13 @@ class Eraser extends BoardTool {
44378
44394
  }
44379
44395
  removeUnderPointOrLine() {
44380
44396
  const segments = this.drawing.getLines();
44381
- const items = this.board.items.getUnderPointer(this.strokeWidth / 2).filter((item) => {
44382
- return item.itemType === "Drawing" && item.getLines().find((line) => {
44383
- return line.getDistance(this.board.pointer.point) <= item.strokeWidth / 2 + this.strokeWidth / 2;
44397
+ const items = this.board.items.getUnderPointer(this.strokeWidth / 2).filter((item2) => {
44398
+ return item2.itemType === "Drawing" && item2.getLines().find((line) => {
44399
+ return line.getDistance(this.board.pointer.point) <= item2.strokeWidth / 2 + this.strokeWidth / 2;
44384
44400
  });
44385
44401
  });
44386
- 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) => {
44387
- return item.itemType === "Drawing" && item.getLines().some((line) => {
44402
+ 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) => {
44403
+ return item2.itemType === "Drawing" && item2.getLines().some((line) => {
44388
44404
  return segments.some((segment) => segment.hasIntersectionPoint(line));
44389
44405
  });
44390
44406
  }));
@@ -44836,20 +44852,20 @@ function createCanvasDrawer(board) {
44836
44852
  context.ctx.setTransform(board2.camera.getMatrix().scaleX, 0, 0, board2.camera.getMatrix().scaleY, 0, 0);
44837
44853
  context.matrix.applyToContext(context.ctx);
44838
44854
  const items = Object.keys(translation).map((id) => {
44839
- const item = board2.items.getById(id);
44840
- if (item) {
44841
- if (item.itemType !== "Frame") {
44842
- return item;
44855
+ const item2 = board2.items.getById(id);
44856
+ if (item2) {
44857
+ if (item2.itemType !== "Frame") {
44858
+ return item2;
44843
44859
  }
44844
- item.render(context);
44845
- return item;
44860
+ item2.render(context);
44861
+ return item2;
44846
44862
  }
44847
44863
  return;
44848
- }).filter((item) => !!item);
44849
- items.forEach((item) => {
44850
- if (item.itemType !== "Frame") {
44851
- item.render(context);
44852
- board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
44864
+ }).filter((item2) => !!item2);
44865
+ items.forEach((item2) => {
44866
+ if (item2.itemType !== "Frame") {
44867
+ item2.render(context);
44868
+ board2.selection.renderItemMbr(context, item2, board2.camera.getMatrix().scaleX);
44853
44869
  }
44854
44870
  });
44855
44871
  return { canvas: container, items };
@@ -44910,10 +44926,10 @@ function createCanvasDrawer(board) {
44910
44926
  if (lastTranslationKeys) {
44911
44927
  board.selection.shouldPublish = false;
44912
44928
  lastTranslationKeys.forEach((id) => {
44913
- const item = board.items.getById(id);
44914
- if (item) {
44915
- item.transformationRenderBlock = undefined;
44916
- item.subject.publish(item);
44929
+ const item2 = board.items.getById(id);
44930
+ if (item2) {
44931
+ item2.transformationRenderBlock = undefined;
44932
+ item2.subject.publish(item2);
44917
44933
  }
44918
44934
  });
44919
44935
  lastTranslationKeys = undefined;
@@ -44945,9 +44961,9 @@ function createCanvasDrawer(board) {
44945
44961
  lastCreatedCanvas = cnvs;
44946
44962
  lastTranslationKeys = Object.keys(translation);
44947
44963
  lastTranslationKeys.forEach((id) => {
44948
- const item = board.items.getById(id);
44949
- if (item) {
44950
- item.transformationRenderBlock = true;
44964
+ const item2 = board.items.getById(id);
44965
+ if (item2) {
44966
+ item2.transformationRenderBlock = true;
44951
44967
  }
44952
44968
  });
44953
44969
  board.selection.transformationRenderBlock = true;
@@ -44957,14 +44973,14 @@ function createCanvasDrawer(board) {
44957
44973
  }
44958
44974
  function countSumMbr(translation) {
44959
44975
  return Object.keys(translation).reduce((mbr, id) => {
44960
- const item = board.items.getById(id);
44961
- if (item) {
44976
+ const item2 = board.items.getById(id);
44977
+ if (item2) {
44962
44978
  if (!mbr) {
44963
- mbr = item.getMbr();
44979
+ mbr = item2.getMbr();
44964
44980
  } else {
44965
- mbr.combine(item.getMbr());
44966
- if (item.itemType === "Frame") {
44967
- mbr.combine(item.getRichText().getMbr());
44981
+ mbr.combine(item2.getMbr());
44982
+ if (item2.itemType === "Frame") {
44983
+ mbr.combine(item2.getRichText().getMbr());
44968
44984
  }
44969
44985
  }
44970
44986
  }
@@ -44995,8 +45011,8 @@ function createCanvasDrawer(board) {
44995
45011
  }
44996
45012
  function highlightNesting() {
44997
45013
  const container = getLastCreatedCanvas();
44998
- const drawnItemsMap = drawnItems?.reduce((acc, item) => {
44999
- acc.set(item.getId(), { item, mbr: item.getMbr() });
45014
+ const drawnItemsMap = drawnItems?.reduce((acc, item2) => {
45015
+ acc.set(item2.getId(), { item: item2, mbr: item2.getMbr() });
45000
45016
  return acc;
45001
45017
  }, new Map);
45002
45018
  if (!container || !drawnItems) {
@@ -45031,11 +45047,11 @@ function createCanvasDrawer(board) {
45031
45047
  mbr.transform(currMatrix);
45032
45048
  });
45033
45049
  groups.forEach((group) => {
45034
- drawnItemsMap?.forEach(({ mbr, item }, key) => {
45035
- if ("canBeNested" in item && !item.canBeNested) {
45050
+ drawnItemsMap?.forEach(({ mbr, item: item2 }, key) => {
45051
+ if ("canBeNested" in item2 && !item2.canBeNested) {
45036
45052
  return;
45037
45053
  }
45038
- if (lastCreatedCanvas && (!drawnItemsMap.get(group.getId()) || item.parent !== group.getId()) && group.handleNesting(mbr)) {
45054
+ if (lastCreatedCanvas && (!drawnItemsMap.get(group.getId()) || item2.parent !== group.getId()) && group.handleNesting(mbr)) {
45039
45055
  const div = createBorderDivForItem(mbr, lastCreatedCanvas);
45040
45056
  removeHighlighted(key);
45041
45057
  highlightedDivs.set(key, div);
@@ -45096,10 +45112,10 @@ function createCanvasDrawer(board) {
45096
45112
  }
45097
45113
 
45098
45114
  // src/Selection/QuickAddButtons/quickAddHelpers.ts
45099
- function getControlPointData(item, index2, isRichText = false) {
45100
- const itemScale = isRichText ? { x: 1, y: 1 } : item.transformation.getScale();
45101
- const width2 = item.getPathMbr().getWidth();
45102
- let height3 = item.getPathMbr().getHeight();
45115
+ function getControlPointData(item2, index2, isRichText = false) {
45116
+ const itemScale = isRichText ? { x: 1, y: 1 } : item2.transformation.getScale();
45117
+ const width2 = item2.getPathMbr().getWidth();
45118
+ let height3 = item2.getPathMbr().getHeight();
45103
45119
  const adjMapScaled = {
45104
45120
  0: { x: 0, y: height3 / 2 / itemScale.y },
45105
45121
  1: {
@@ -45114,7 +45130,7 @@ function getControlPointData(item, index2, isRichText = false) {
45114
45130
  };
45115
45131
  return {
45116
45132
  pointType: "Fixed",
45117
- itemId: item.getId(),
45133
+ itemId: item2.getId(),
45118
45134
  relativeX: adjMapScaled[index2].x,
45119
45135
  relativeY: adjMapScaled[index2].y
45120
45136
  };
@@ -45249,10 +45265,10 @@ function getQuickAddButtons(selection, board) {
45249
45265
  let newHeight = height3;
45250
45266
  let itemData;
45251
45267
  if (selectedItem.itemType === "AINode" || selectedItem.itemType === "RichText") {
45252
- const item = selectedItem.itemType === "AINode" ? createAINode2(board, index2, selectedItem.getId()) : createRichText2(board);
45253
- newWidth = item.getMbr().getWidth();
45254
- newHeight = item.getMbr().getHeight();
45255
- itemData = item.serialize();
45268
+ const item2 = selectedItem.itemType === "AINode" ? createAINode2(board, index2, selectedItem.getId()) : createRichText2(board);
45269
+ newWidth = item2.getMbr().getWidth();
45270
+ newHeight = item2.getMbr().getHeight();
45271
+ itemData = item2.serialize();
45256
45272
  const { minX, minY, maxY, maxX } = offsets;
45257
45273
  offsetX = Math.min(offsetX, maxX);
45258
45274
  offsetX = Math.max(offsetX, minX);
@@ -45285,7 +45301,7 @@ function getQuickAddButtons(selection, board) {
45285
45301
  }
45286
45302
  const newMbr = new Mbr(newItemData.transformation?.translateX, newItemData.transformation?.translateY, (newItemData.transformation?.translateX || 0) + newWidth, (newItemData.transformation?.translateY || 0) + newHeight);
45287
45303
  let step = 1;
45288
- while (board.index.getItemsEnclosedOrCrossed(newMbr.left, newMbr.top, newMbr.right, newMbr.bottom).filter((item) => item.itemType !== "Connector").length > 0) {
45304
+ while (board.index.getItemsEnclosedOrCrossed(newMbr.left, newMbr.top, newMbr.right, newMbr.bottom).filter((item2) => item2.itemType !== "Connector").length > 0) {
45289
45305
  const xDirection = step % 2 === 0 ? -1 : 1;
45290
45306
  const yDirection = newItemData.itemType === "AINode" ? -1 : xDirection;
45291
45307
  newMbr.transform(new Matrix2(iterAdjustment[index2].x * xDirection * step, iterAdjustment[index2].y * yDirection * (newItemData.itemType === "AINode" ? 1 : step)));
@@ -45418,7 +45434,7 @@ function getQuickAddButtons(selection, board) {
45418
45434
  clear();
45419
45435
  return;
45420
45436
  }
45421
- const { positions, item } = position4;
45437
+ const { positions, item: item2 } = position4;
45422
45438
  const cameraMatrix = board.camera.getMatrix();
45423
45439
  const cameraMbr = board.camera.getMbr();
45424
45440
  const positionAdjustments = {
@@ -45446,7 +45462,7 @@ function getQuickAddButtons(selection, board) {
45446
45462
  };
45447
45463
  const button = document.createElement("button");
45448
45464
  button.classList.add("microboard-quickAddButton");
45449
- if (item.itemType === "AINode" && index2 === 2) {
45465
+ if (item2.itemType === "AINode" && index2 === 2) {
45450
45466
  button.classList.add("microboard-invisible");
45451
45467
  }
45452
45468
  button.classList.add(`microboard-${adjustment.rotate}`);
@@ -45462,7 +45478,7 @@ function getQuickAddButtons(selection, board) {
45462
45478
  clearTimeout(timeoutId);
45463
45479
  }
45464
45480
  if (button.isMouseDown) {
45465
- board.tools.addConnector(true, item, pos);
45481
+ board.tools.addConnector(true, item2, pos);
45466
45482
  } else {
45467
45483
  quickAddItems = undefined;
45468
45484
  selection.subject.publish(selection);
@@ -45569,11 +45585,11 @@ class AlignmentHelper {
45569
45585
  return baseThickness / (zoom / 100);
45570
45586
  }
45571
45587
  combineMBRs(items) {
45572
- return items.reduce((acc, item, i) => {
45588
+ return items.reduce((acc, item2, i) => {
45573
45589
  if (i === 0) {
45574
45590
  return acc;
45575
45591
  }
45576
- const itemMbr = item.getPathMbr();
45592
+ const itemMbr = item2.getPathMbr();
45577
45593
  return acc.combine(itemMbr);
45578
45594
  }, items[0].getMbr());
45579
45595
  }
@@ -45587,7 +45603,7 @@ class AlignmentHelper {
45587
45603
  const scale = this.board.camera.getScale();
45588
45604
  const dynamicAlignThreshold = Math.min(this.alignThreshold / scale, 8);
45589
45605
  const childrenIds = "index" in movingItem && movingItem.index ? movingItem.getChildrenIds() : [];
45590
- 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);
45606
+ 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);
45591
45607
  const verticalAlignments = new Map;
45592
45608
  const horizontalAlignments = new Map;
45593
45609
  const addVerticalAlignment = (x, minY, maxY) => {
@@ -45608,11 +45624,11 @@ class AlignmentHelper {
45608
45624
  horizontalAlignments.set(y, { minX, maxX });
45609
45625
  }
45610
45626
  };
45611
- nearbyItems.forEach((item) => {
45612
- if (item === movingItem || item.itemType === "Comment") {
45627
+ nearbyItems.forEach((item2) => {
45628
+ if (item2 === movingItem || item2.itemType === "Comment") {
45613
45629
  return;
45614
45630
  }
45615
- const itemMbr = item.itemType === "Shape" ? item.getPath().getMbr() : item.getMbr();
45631
+ const itemMbr = item2.itemType === "Shape" ? item2.getPath().getMbr() : item2.getMbr();
45616
45632
  const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
45617
45633
  const centerXItem = (itemMbr.left + itemMbr.right) / 2;
45618
45634
  const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
@@ -45879,20 +45895,20 @@ class AlignmentHelper {
45879
45895
  }
45880
45896
  return false;
45881
45897
  }
45882
- translateItems(item, x, y, timeStamp) {
45898
+ translateItems(item2, x, y, timeStamp) {
45883
45899
  if (this.canvasDrawer.getLastCreatedCanvas()) {
45884
45900
  return;
45885
45901
  }
45886
- if (Array.isArray(item)) {
45902
+ if (Array.isArray(item2)) {
45887
45903
  const translation = this.board.selection.getManyItemsTranslation(x, y);
45888
45904
  this.board.selection.transformMany(translation, timeStamp);
45889
45905
  return;
45890
45906
  }
45891
- if (item.itemType === "Frame") {
45907
+ if (item2.itemType === "Frame") {
45892
45908
  const translation = this.board.selection.getManyItemsTranslation(x, y);
45893
45909
  this.board.selection.transformMany(translation, timeStamp);
45894
45910
  } else {
45895
- const id = item.getId();
45911
+ const id = item2.getId();
45896
45912
  const transformMap = {};
45897
45913
  transformMap[id] = {
45898
45914
  class: "Transformation",
@@ -46020,12 +46036,12 @@ class Select extends Tool {
46020
46036
  this.debounceUpd.setFalse();
46021
46037
  this.snapLines = { verticalLines: [], horizontalLines: [] };
46022
46038
  }
46023
- handleSnapping(item) {
46039
+ handleSnapping(item2) {
46024
46040
  if (this.board.keyboard.isShift) {
46025
46041
  return false;
46026
46042
  }
46027
- const increasedSnapThreshold = Array.isArray(item) ? 40 : 35;
46028
- this.isSnapped = this.alignmentHelper.snapToClosestLine(item, this.snapLines, this.beginTimeStamp, this.board.pointer.point);
46043
+ const increasedSnapThreshold = Array.isArray(item2) ? 40 : 35;
46044
+ this.isSnapped = this.alignmentHelper.snapToClosestLine(item2, this.snapLines, this.beginTimeStamp, this.board.pointer.point);
46029
46045
  if (this.isSnapped) {
46030
46046
  if (!this.snapCursorPos) {
46031
46047
  this.snapCursorPos = new Point(this.board.pointer.point.x, this.board.pointer.point.y);
@@ -46035,10 +46051,10 @@ class Select extends Tool {
46035
46051
  if ((cursorDiffX > increasedSnapThreshold || cursorDiffY > increasedSnapThreshold) && this.initialCursorPos) {
46036
46052
  this.isSnapped = false;
46037
46053
  this.snapCursorPos = null;
46038
- const itemCenter = Array.isArray(item) ? this.alignmentHelper.combineMBRs(item).getCenter() : item.getMbr().getCenter();
46054
+ const itemCenter = Array.isArray(item2) ? this.alignmentHelper.combineMBRs(item2).getCenter() : item2.getMbr().getCenter();
46039
46055
  const translateX = this.board.pointer.point.x - this.initialCursorPos.x - itemCenter.x;
46040
46056
  const translateY = this.board.pointer.point.y - this.initialCursorPos.y - itemCenter.y;
46041
- this.alignmentHelper.translateItems(item, translateX, translateY, this.beginTimeStamp);
46057
+ this.alignmentHelper.translateItems(item2, translateX, translateY, this.beginTimeStamp);
46042
46058
  }
46043
46059
  }
46044
46060
  return false;
@@ -46088,10 +46104,10 @@ class Select extends Tool {
46088
46104
  angleDiff = angleDiff < 0 ? angleDiff + 360 : angleDiff;
46089
46105
  return Math.min(angleDiff, 360 - angleDiff);
46090
46106
  }
46091
- handleShiftGuidelines(item, mousePosition) {
46092
- if (item) {
46107
+ handleShiftGuidelines(item2, mousePosition) {
46108
+ if (item2) {
46093
46109
  if (!this.originalCenter) {
46094
- this.originalCenter = Array.isArray(item) ? this.board.selection.getMbr()?.getCenter().copy() : item.getMbr().getCenter().copy();
46110
+ this.originalCenter = Array.isArray(item2) ? this.board.selection.getMbr()?.getCenter().copy() : item2.getMbr().getCenter().copy();
46095
46111
  this.guidelines = this.alignmentHelper.generateGuidelines(this.originalCenter).lines;
46096
46112
  }
46097
46113
  this.mainLine = new Line(this.originalCenter, mousePosition);
@@ -46112,13 +46128,13 @@ class Select extends Tool {
46112
46128
  const newEndX = this.originalCenter.x + snapDirectionX * mainLineLength;
46113
46129
  const newEndY = this.originalCenter.y + snapDirectionY * mainLineLength;
46114
46130
  const threshold = Infinity;
46115
- const translateX = newEndX - (Array.isArray(item) ? this.board.selection.getMbr()?.getCenter().x : item.getMbr().getCenter().x);
46116
- const translateY = newEndY - (Array.isArray(item) ? this.board.selection.getMbr()?.getCenter().y : item.getMbr().getCenter().y);
46117
- if (Array.isArray(item)) {
46131
+ const translateX = newEndX - (Array.isArray(item2) ? this.board.selection.getMbr()?.getCenter().x : item2.getMbr().getCenter().x);
46132
+ const translateY = newEndY - (Array.isArray(item2) ? this.board.selection.getMbr()?.getCenter().y : item2.getMbr().getCenter().y);
46133
+ if (Array.isArray(item2)) {
46118
46134
  const translation = this.board.selection.getManyItemsTranslation(translateX, translateY);
46119
46135
  this.board.selection.transformMany(translation, this.beginTimeStamp);
46120
46136
  } else {
46121
- item.transformation.translateBy(translateX, translateY, this.beginTimeStamp);
46137
+ item2.transformation.translateBy(translateX, translateY, this.beginTimeStamp);
46122
46138
  }
46123
46139
  }
46124
46140
  }
@@ -46161,7 +46177,7 @@ class Select extends Tool {
46161
46177
  return false;
46162
46178
  }
46163
46179
  this.isDownOnBoard = hover.length === 0;
46164
- this.isDrawingRectangle = hover.filter((item) => !(item instanceof Frame2)).length === 0 && hover.filter((item) => item instanceof Frame2).filter((frame) => frame.isTextUnderPoint(pointer.point)).length === 0;
46180
+ this.isDrawingRectangle = hover.filter((item2) => !(item2 instanceof Frame2)).length === 0 && hover.filter((item2) => item2 instanceof Frame2).filter((frame) => frame.isTextUnderPoint(pointer.point)).length === 0;
46165
46181
  if (this.isDrawingRectangle) {
46166
46182
  const { x, y } = pointer.point;
46167
46183
  this.line = new Line(new Point(x, y), new Point(x, y));
@@ -46181,7 +46197,7 @@ class Select extends Tool {
46181
46197
  });
46182
46198
  return false;
46183
46199
  }
46184
- const isHoverLocked = hover.every((item) => item.transformation.isLocked);
46200
+ const isHoverLocked = hover.every((item2) => item2.transformation.isLocked);
46185
46201
  if (isHoverLocked) {
46186
46202
  return false;
46187
46203
  }
@@ -46315,7 +46331,7 @@ class Select extends Tool {
46315
46331
  const translation = selection.getManyItemsTranslation(x, y);
46316
46332
  const translationKeys = Object.keys(translation);
46317
46333
  const commentsSet = new Set(this.board.items.getComments().map((comment2) => comment2.getId()));
46318
- if (translationKeys.filter((item) => !commentsSet.has(item)).length > 10) {
46334
+ if (translationKeys.filter((item2) => !commentsSet.has(item2)).length > 10) {
46319
46335
  const selectedMbr = this.board.selection.getMbr()?.copy();
46320
46336
  const sumMbr = this.canvasDrawer.countSumMbr(translation);
46321
46337
  if (sumMbr) {
@@ -46342,7 +46358,7 @@ class Select extends Tool {
46342
46358
  return false;
46343
46359
  }
46344
46360
  const draggingMbr = draggingItem.getMbr();
46345
- const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => item instanceof Frame2);
46361
+ const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item2) => item2 instanceof Frame2);
46346
46362
  frames.forEach((frame) => {
46347
46363
  if (frame.handleNesting(draggingItem)) {
46348
46364
  this.nestingHighlighter.add(frame, draggingItem);
@@ -46352,7 +46368,7 @@ class Select extends Tool {
46352
46368
  });
46353
46369
  }
46354
46370
  const hover = items.getUnderPointer();
46355
- this.isHoverUnselectedItem = hover.filter((item) => item.itemType === "Placeholder").length === 1;
46371
+ this.isHoverUnselectedItem = hover.filter((item2) => item2.itemType === "Placeholder").length === 1;
46356
46372
  if (this.isHoverUnselectedItem && !this.isDraggingUnselectedItem && selection.getContext() === "None") {
46357
46373
  selection.setContext("HoverUnderPointer");
46358
46374
  return false;
@@ -46396,15 +46412,15 @@ class Select extends Tool {
46396
46412
  }
46397
46413
  }
46398
46414
  updateFramesNesting(selectionMbr, selection) {
46399
- 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));
46400
- const draggingFramesIds = selection.list().filter((item) => item instanceof Frame2).map((frame) => frame.getId());
46401
- selection.list().forEach((item) => {
46402
- if (!(item instanceof Frame2) && !draggingFramesIds.includes(item.parent)) {
46415
+ 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));
46416
+ const draggingFramesIds = selection.list().filter((item2) => item2 instanceof Frame2).map((frame) => frame.getId());
46417
+ selection.list().forEach((item2) => {
46418
+ if (!(item2 instanceof Frame2) && !draggingFramesIds.includes(item2.parent)) {
46403
46419
  frames.forEach((frame) => {
46404
- if (frame.handleNesting(item)) {
46405
- this.nestingHighlighter.add(frame, item);
46420
+ if (frame.handleNesting(item2)) {
46421
+ this.nestingHighlighter.add(frame, item2);
46406
46422
  } else {
46407
- this.nestingHighlighter.remove(item);
46423
+ this.nestingHighlighter.remove(item2);
46408
46424
  }
46409
46425
  });
46410
46426
  }
@@ -46496,7 +46512,7 @@ class Select extends Tool {
46496
46512
  const childrenIds = underPointer.getChildrenIds();
46497
46513
  console.log("UNDERPOINTER", underPointer);
46498
46514
  console.log("CHILDREN", childrenIds);
46499
- const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => childrenIds && childrenIds.includes(item.getId()));
46515
+ const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item2) => childrenIds && childrenIds.includes(item2.getId()));
46500
46516
  this.board.selection.add(itemsInFrame);
46501
46517
  }
46502
46518
  this.board.selection.setContext("EditUnderPointer");
@@ -46736,8 +46752,8 @@ class ShapeTool extends CustomTool {
46736
46752
  resizeType = "leftBottom";
46737
46753
  bounds = new Mbr;
46738
46754
  isDown = false;
46739
- constructor(board, name, item, settings) {
46740
- super(board, name, item);
46755
+ constructor(board, name, item2, settings) {
46756
+ super(board, name, item2);
46741
46757
  this.settings = settings;
46742
46758
  this.setCursor();
46743
46759
  }
@@ -46820,8 +46836,8 @@ class ShapeTool extends CustomTool {
46820
46836
 
46821
46837
  class StickerTool extends CustomTool {
46822
46838
  settings;
46823
- constructor(board, name, item, settings) {
46824
- super(board, name, item);
46839
+ constructor(board, name, item2, settings) {
46840
+ super(board, name, item2);
46825
46841
  this.settings = settings;
46826
46842
  this.setCursor();
46827
46843
  }
@@ -47127,7 +47143,7 @@ class Tools extends ToolContext {
47127
47143
  this.subject.publish(this);
47128
47144
  }
47129
47145
  sortFrames() {
47130
- const frames = this.board.items.listAll().filter((item) => item instanceof Frame2);
47146
+ const frames = this.board.items.listAll().filter((item2) => item2 instanceof Frame2);
47131
47147
  const sortedFrames = frames.sort((fr1, fr2) => {
47132
47148
  const mbr1 = fr1.getMbr();
47133
47149
  const mbr2 = fr2.getMbr();
@@ -47353,24 +47369,24 @@ function validateGroupData(groupData) {
47353
47369
  }
47354
47370
  // src/Items/RegisterItem.ts
47355
47371
  function registerItem({
47356
- item,
47372
+ item: item2,
47357
47373
  defaultData: defaultData2,
47358
47374
  toolData
47359
47375
  }) {
47360
47376
  const { itemType } = defaultData2;
47361
- itemFactories[itemType] = createItemFactory(item, defaultData2);
47377
+ itemFactories[itemType] = createItemFactory(item2, defaultData2);
47362
47378
  itemValidators[itemType] = createItemValidator(defaultData2);
47363
47379
  if (toolData) {
47364
47380
  registeredTools[toolData.name] = toolData.tool;
47365
47381
  }
47366
47382
  itemCommandFactories[itemType] = createItemCommandFactory(itemType);
47367
47383
  }
47368
- function createItemFactory(item, defaultData2) {
47384
+ function createItemFactory(item2, defaultData2) {
47369
47385
  return function itemFactory(id, data, board) {
47370
47386
  if (data.itemType !== defaultData2.itemType) {
47371
47387
  throw new Error(`Invalid data for ${defaultData2.itemType}`);
47372
47388
  }
47373
- return new item(board, id, defaultData2).setId(id).deserialize(data);
47389
+ return new item2(board, id, defaultData2).setId(id).deserialize(data);
47374
47390
  };
47375
47391
  }
47376
47392
  function createItemValidator(defaultData2) {
@@ -47385,7 +47401,7 @@ function createItemValidator(defaultData2) {
47385
47401
  }
47386
47402
  function createItemCommandFactory(itemType) {
47387
47403
  return function itemCommandFactory(items, operation) {
47388
- return new BaseCommand(items.filter((item) => item.itemType === itemType), operation);
47404
+ return new BaseCommand(items.filter((item2) => item2.itemType === itemType), operation);
47389
47405
  };
47390
47406
  }
47391
47407
  // src/Items/Examples/Star/AddStar.ts
@@ -48410,8 +48426,8 @@ class Camera {
48410
48426
  this.observableItem = null;
48411
48427
  }
48412
48428
  }
48413
- subscribeToItem(item) {
48414
- this.observableItem = item;
48429
+ subscribeToItem(item2) {
48430
+ this.observableItem = item2;
48415
48431
  this.observableItem.subject.subscribe(this.observeItem);
48416
48432
  }
48417
48433
  observeItem = () => {
@@ -48637,7 +48653,7 @@ class Camera {
48637
48653
  }
48638
48654
  addToView(mbr, inView) {
48639
48655
  if (!mbr.isEnclosedBy(this.getMbr())) {
48640
- this.viewRectangle(inView.reduce((acc, item) => acc.combine(item.getMbr()), inView[0]?.getMbr() ?? new Mbr).combine(mbr));
48656
+ this.viewRectangle(inView.reduce((acc, item2) => acc.combine(item2.getMbr()), inView[0]?.getMbr() ?? new Mbr).combine(mbr));
48641
48657
  }
48642
48658
  }
48643
48659
  viewRectangle(mbr, offsetInPercent = 10, duration = 500) {
@@ -50246,8 +50262,8 @@ class Presence {
50246
50262
  <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}"/>
50247
50263
  </svg>`;
50248
50264
  }
50249
- renderItemMbr(context, item, color2, customScale) {
50250
- const mbr = item.getMbr();
50265
+ renderItemMbr(context, item2, color2, customScale) {
50266
+ const mbr = item2.getMbr();
50251
50267
  mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
50252
50268
  mbr.borderColor = color2;
50253
50269
  mbr.render(context);
@@ -50387,8 +50403,8 @@ class Presence {
50387
50403
  selectionMbr.strokeWidth = 1 / context.matrix.scaleX;
50388
50404
  selectionMbr.borderColor = selection.color;
50389
50405
  selectionMbr.render(context);
50390
- for (const item of selection.selection) {
50391
- this.renderItemMbr(context, item, selection.color);
50406
+ for (const item2 of selection.selection) {
50407
+ this.renderItemMbr(context, item2, selection.color);
50392
50408
  }
50393
50409
  }
50394
50410
  }
@@ -50421,14 +50437,14 @@ class SelectionItems {
50421
50437
  items = new Map;
50422
50438
  add(value) {
50423
50439
  if (Array.isArray(value)) {
50424
- value.forEach((item) => this.items.set(item.getId(), item));
50440
+ value.forEach((item2) => this.items.set(item2.getId(), item2));
50425
50441
  } else {
50426
50442
  this.items.set(value.getId(), value);
50427
50443
  }
50428
50444
  }
50429
50445
  remove(value) {
50430
50446
  if (Array.isArray(value)) {
50431
- value.forEach((item) => this.items.delete(item.getId()));
50447
+ value.forEach((item2) => this.items.delete(item2.getId()));
50432
50448
  } else {
50433
50449
  this.items.delete(value.getId());
50434
50450
  }
@@ -50458,8 +50474,8 @@ class SelectionItems {
50458
50474
  if (this.isEmpty()) {
50459
50475
  return false;
50460
50476
  }
50461
- for (const item of this.items.values()) {
50462
- if (item.itemType !== "RichText") {
50477
+ for (const item2 of this.items.values()) {
50478
+ if (item2.itemType !== "RichText") {
50463
50479
  return false;
50464
50480
  }
50465
50481
  }
@@ -50469,14 +50485,14 @@ class SelectionItems {
50469
50485
  if (this.isEmpty()) {
50470
50486
  return false;
50471
50487
  }
50472
- return Array.from(this.items).every(([, item]) => item.itemType === itemType);
50488
+ return Array.from(this.items).every(([, item2]) => item2.itemType === itemType);
50473
50489
  }
50474
50490
  isItemTypes(itemTypes) {
50475
50491
  if (this.isEmpty()) {
50476
50492
  return false;
50477
50493
  }
50478
- for (const item of this.items.values()) {
50479
- if (!itemTypes.includes(item.itemType)) {
50494
+ for (const item2 of this.items.values()) {
50495
+ if (!itemTypes.includes(item2.itemType)) {
50480
50496
  return false;
50481
50497
  }
50482
50498
  }
@@ -50484,16 +50500,16 @@ class SelectionItems {
50484
50500
  }
50485
50501
  getItemTypes() {
50486
50502
  const itemTypes = new Set;
50487
- this.items.forEach((item) => itemTypes.add(item.itemType));
50503
+ this.items.forEach((item2) => itemTypes.add(item2.itemType));
50488
50504
  return Array.from(itemTypes);
50489
50505
  }
50490
50506
  getItemsByItemTypes(itemTypes) {
50491
- return Array.from(this.items.values()).filter((item) => itemTypes.includes(item.itemType));
50507
+ return Array.from(this.items.values()).filter((item2) => itemTypes.includes(item2.itemType));
50492
50508
  }
50493
50509
  getIdsByItemTypes(itemTypes) {
50494
50510
  const ids = [];
50495
- this.items.forEach((item, id) => {
50496
- if (itemTypes.includes(item.itemType)) {
50511
+ this.items.forEach((item2, id) => {
50512
+ if (itemTypes.includes(item2.itemType)) {
50497
50513
  ids.push(id);
50498
50514
  }
50499
50515
  });
@@ -50503,7 +50519,7 @@ class SelectionItems {
50503
50519
  return this.isSingle() ? this.items.values().next().value || null : null;
50504
50520
  }
50505
50521
  listByIds(itemIdList) {
50506
- return itemIdList.map((id) => this.items.get(id)).filter((item) => item !== undefined);
50522
+ return itemIdList.map((id) => this.items.get(id)).filter((item2) => item2 !== undefined);
50507
50523
  }
50508
50524
  ids() {
50509
50525
  return Array.from(this.items.keys());
@@ -50514,7 +50530,7 @@ class SelectionItems {
50514
50530
  return;
50515
50531
  }
50516
50532
  const mbr = items[0].getMbr();
50517
- items.slice(1).forEach((item) => mbr.combine(item.getMbr()));
50533
+ items.slice(1).forEach((item2) => mbr.combine(item2.getMbr()));
50518
50534
  return mbr;
50519
50535
  }
50520
50536
  }
@@ -50719,33 +50735,33 @@ function handleMultipleItemsResize({
50719
50735
  const translation = {};
50720
50736
  const items = itemsToResize ? itemsToResize : board.selection.items.list();
50721
50737
  board.items.getComments().forEach((comment2) => {
50722
- if (items.some((item) => item.getId() === comment2.getItemToFollow())) {
50738
+ if (items.some((item2) => item2.getId() === comment2.getItemToFollow())) {
50723
50739
  items.push(comment2);
50724
50740
  }
50725
50741
  });
50726
- for (const item of items) {
50727
- let itemX = item.getMbr().left;
50728
- let itemY = item.getMbr().top;
50729
- if (item.itemType === "Drawing") {
50730
- itemX = item.transformation.matrix.translateX;
50731
- itemY = item.transformation.matrix.translateY;
50742
+ for (const item2 of items) {
50743
+ let itemX = item2.getMbr().left;
50744
+ let itemY = item2.getMbr().top;
50745
+ if (item2.itemType === "Drawing") {
50746
+ itemX = item2.transformation.matrix.translateX;
50747
+ itemY = item2.transformation.matrix.translateY;
50732
50748
  }
50733
50749
  const deltaX = itemX - initMbr.left;
50734
50750
  const translateX = deltaX * matrix.scaleX - deltaX + matrix.translateX;
50735
50751
  const deltaY = itemY - initMbr.top;
50736
50752
  const translateY = deltaY * matrix.scaleY - deltaY + matrix.translateY;
50737
- if (item instanceof RichText) {
50738
- translation[item.getId()] = getRichTextTranslation({
50739
- item,
50753
+ if (item2 instanceof RichText) {
50754
+ translation[item2.getId()] = getRichTextTranslation({
50755
+ item: item2,
50740
50756
  isWidth,
50741
50757
  isHeight,
50742
50758
  matrix,
50743
50759
  translateX,
50744
50760
  translateY
50745
50761
  });
50746
- } else if (item instanceof AINode) {
50747
- translation[item.getId()] = getAINodeTranslation({
50748
- item,
50762
+ } else if (item2 instanceof AINode) {
50763
+ translation[item2.getId()] = getAINodeTranslation({
50764
+ item: item2,
50749
50765
  isWidth,
50750
50766
  isHeight,
50751
50767
  matrix,
@@ -50753,8 +50769,8 @@ function handleMultipleItemsResize({
50753
50769
  translateY
50754
50770
  });
50755
50771
  } else {
50756
- translation[item.getId()] = getItemTranslation({
50757
- item,
50772
+ translation[item2.getId()] = getItemTranslation({
50773
+ item: item2,
50758
50774
  isWidth,
50759
50775
  isHeight,
50760
50776
  matrix,
@@ -50767,7 +50783,7 @@ function handleMultipleItemsResize({
50767
50783
  return translation;
50768
50784
  }
50769
50785
  function getRichTextTranslation({
50770
- item,
50786
+ item: item2,
50771
50787
  isWidth,
50772
50788
  isHeight,
50773
50789
  matrix,
@@ -50775,11 +50791,11 @@ function getRichTextTranslation({
50775
50791
  translateY
50776
50792
  }) {
50777
50793
  if (isWidth) {
50778
- item.editor.setMaxWidth(item.getWidth() / item.transformation.getScale().x * matrix.scaleX);
50794
+ item2.editor.setMaxWidth(item2.getWidth() / item2.transformation.getScale().x * matrix.scaleX);
50779
50795
  return {
50780
50796
  class: "Transformation",
50781
50797
  method: "scaleByTranslateBy",
50782
- item: [item.getId()],
50798
+ item: [item2.getId()],
50783
50799
  translate: { x: matrix.translateX, y: 0 },
50784
50800
  scale: { x: matrix.scaleX, y: matrix.scaleX }
50785
50801
  };
@@ -50787,7 +50803,7 @@ function getRichTextTranslation({
50787
50803
  return {
50788
50804
  class: "Transformation",
50789
50805
  method: "scaleByTranslateBy",
50790
- item: [item.getId()],
50806
+ item: [item2.getId()],
50791
50807
  translate: { x: translateX, y: translateY },
50792
50808
  scale: { x: 1, y: 1 }
50793
50809
  };
@@ -50795,14 +50811,14 @@ function getRichTextTranslation({
50795
50811
  return {
50796
50812
  class: "Transformation",
50797
50813
  method: "scaleByTranslateBy",
50798
- item: [item.getId()],
50814
+ item: [item2.getId()],
50799
50815
  translate: { x: translateX, y: translateY },
50800
50816
  scale: { x: matrix.scaleX, y: matrix.scaleX }
50801
50817
  };
50802
50818
  }
50803
50819
  }
50804
50820
  function getAINodeTranslation({
50805
- item,
50821
+ item: item2,
50806
50822
  isWidth,
50807
50823
  isHeight,
50808
50824
  matrix,
@@ -50810,11 +50826,11 @@ function getAINodeTranslation({
50810
50826
  translateY
50811
50827
  }) {
50812
50828
  if (isWidth) {
50813
- item.text.editor.setMaxWidth(item.text.getWidth() / item.transformation.getScale().x * matrix.scaleX);
50829
+ item2.text.editor.setMaxWidth(item2.text.getWidth() / item2.transformation.getScale().x * matrix.scaleX);
50814
50830
  return {
50815
50831
  class: "Transformation",
50816
50832
  method: "scaleByTranslateBy",
50817
- item: [item.getId()],
50833
+ item: [item2.getId()],
50818
50834
  translate: { x: matrix.translateX, y: 0 },
50819
50835
  scale: { x: matrix.scaleX, y: matrix.scaleX }
50820
50836
  };
@@ -50822,7 +50838,7 @@ function getAINodeTranslation({
50822
50838
  return {
50823
50839
  class: "Transformation",
50824
50840
  method: "scaleByTranslateBy",
50825
- item: [item.getId()],
50841
+ item: [item2.getId()],
50826
50842
  translate: { x: translateX, y: translateY },
50827
50843
  scale: { x: 1, y: 1 }
50828
50844
  };
@@ -50830,14 +50846,14 @@ function getAINodeTranslation({
50830
50846
  return {
50831
50847
  class: "Transformation",
50832
50848
  method: "scaleByTranslateBy",
50833
- item: [item.getId()],
50849
+ item: [item2.getId()],
50834
50850
  translate: { x: translateX, y: translateY },
50835
50851
  scale: { x: matrix.scaleX, y: matrix.scaleX }
50836
50852
  };
50837
50853
  }
50838
50854
  }
50839
50855
  function getItemTranslation({
50840
- item,
50856
+ item: item2,
50841
50857
  isWidth,
50842
50858
  isHeight,
50843
50859
  matrix,
@@ -50845,22 +50861,22 @@ function getItemTranslation({
50845
50861
  translateY,
50846
50862
  isShiftPressed
50847
50863
  }) {
50848
- if (item instanceof Sticker && (isWidth || isHeight)) {
50864
+ if (item2 instanceof Sticker && (isWidth || isHeight)) {
50849
50865
  return {
50850
50866
  class: "Transformation",
50851
50867
  method: "scaleByTranslateBy",
50852
- item: [item.getId()],
50868
+ item: [item2.getId()],
50853
50869
  translate: { x: translateX, y: translateY },
50854
50870
  scale: { x: 1, y: 1 }
50855
50871
  };
50856
50872
  } else {
50857
- if (item instanceof Frame2 && item.getCanChangeRatio() && isShiftPressed && item.getFrameType() !== "Custom") {
50858
- item.setFrameType("Custom");
50873
+ if (item2 instanceof Frame2 && item2.getCanChangeRatio() && isShiftPressed && item2.getFrameType() !== "Custom") {
50874
+ item2.setFrameType("Custom");
50859
50875
  }
50860
50876
  return {
50861
50877
  class: "Transformation",
50862
50878
  method: "scaleByTranslateBy",
50863
- item: [item.getId()],
50879
+ item: [item2.getId()],
50864
50880
  translate: { x: translateX, y: translateY },
50865
50881
  scale: { x: matrix.scaleX, y: matrix.scaleY }
50866
50882
  };
@@ -51133,11 +51149,11 @@ function transformItems({
51133
51149
  setSnapCursorPos
51134
51150
  }) {
51135
51151
  const items = selection.items.list();
51136
- const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio");
51152
+ const includesProportionalItem = items.some((item2) => item2.itemType === "Sticker" || item2.itemType === "RichText" || item2.itemType === "AINode" || item2.itemType === "Video" || item2.itemType === "Audio");
51137
51153
  if (includesProportionalItem && (isWidth || isHeight)) {
51138
51154
  return null;
51139
51155
  }
51140
- const isIncludesFixedFrame = items.some((item) => item instanceof Frame2 && !item.getCanChangeRatio());
51156
+ const isIncludesFixedFrame = items.some((item2) => item2 instanceof Frame2 && !item2.getCanChangeRatio());
51141
51157
  const shouldBeProportionalResize = isIncludesFixedFrame || includesProportionalItem || isShiftPressed || !isWidth && !isHeight;
51142
51158
  const resize = shouldBeProportionalResize ? getProportionalResize(resizeType, board.pointer.point, mbr, oppositePoint) : getResize(resizeType, board.pointer.point, mbr, oppositePoint);
51143
51159
  if (canvasDrawer.getLastCreatedCanvas() && !debounceUpd.shouldUpd()) {
@@ -51215,23 +51231,23 @@ function updateFrameChildren({
51215
51231
  nestingHighlighter
51216
51232
  }) {
51217
51233
  const groups = board.items.getGroupItemsEnclosedOrCrossed(mbr.left, mbr.top, mbr.right, mbr.bottom);
51218
- board.selection.items.list().forEach((item) => {
51219
- if ("getChildrenIds" in item && item.getChildrenIds()) {
51220
- const currMbr = item.getMbr();
51234
+ board.selection.items.list().forEach((item2) => {
51235
+ if ("getChildrenIds" in item2 && item2.getChildrenIds()) {
51236
+ const currMbr = item2.getMbr();
51221
51237
  const itemsToCheck = board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom);
51222
51238
  itemsToCheck.forEach((currItem) => {
51223
- if (item.handleNesting(currItem) && (currItem.parent === "Board" || currItem.parent === item.getId())) {
51224
- nestingHighlighter.add(item, currItem);
51239
+ if (item2.handleNesting(currItem) && (currItem.parent === "Board" || currItem.parent === item2.getId())) {
51240
+ nestingHighlighter.add(item2, currItem);
51225
51241
  } else {
51226
51242
  nestingHighlighter.remove(currItem);
51227
51243
  }
51228
51244
  });
51229
51245
  } else {
51230
51246
  groups.forEach((group) => {
51231
- if (group.handleNesting(item)) {
51232
- nestingHighlighter.add(group, item);
51247
+ if (group.handleNesting(item2)) {
51248
+ nestingHighlighter.add(group, item2);
51233
51249
  } else {
51234
- nestingHighlighter.remove(item);
51250
+ nestingHighlighter.remove(item2);
51235
51251
  }
51236
51252
  });
51237
51253
  }
@@ -51299,9 +51315,9 @@ class Transformer extends Tool {
51299
51315
  const pointer = this.board.pointer;
51300
51316
  const camera = this.board.camera;
51301
51317
  const items = this.selection.items;
51302
- const item = items.getSingle();
51318
+ const item2 = items.getSingle();
51303
51319
  let resizeType;
51304
- if (item && (item.itemType === "RichText" || item.itemType === "Sticker")) {
51320
+ if (item2 && (item2.itemType === "RichText" || item2.itemType === "Sticker")) {
51305
51321
  resizeType = getTextResizeType(pointer.point, camera.getScale(), mbr);
51306
51322
  } else {
51307
51323
  resizeType = getResizeType(pointer.point, camera.getScale(), mbr);
@@ -51555,8 +51571,8 @@ class SelectionTransformer extends Tool {
51555
51571
  return;
51556
51572
  }
51557
51573
  if (this.selection.items.isSingle()) {
51558
- const item = this.selection.items.getSingle();
51559
- if (item?.itemType === "Connector") {
51574
+ const item2 = this.selection.items.getSingle();
51575
+ if (item2?.itemType === "Connector") {
51560
51576
  this.tool = this.connectorTransformerTool;
51561
51577
  return;
51562
51578
  } else {
@@ -51639,16 +51655,16 @@ class BoardSelection {
51639
51655
  this.quickAddButtons = getQuickAddButtons(this, board);
51640
51656
  }
51641
51657
  serialize() {
51642
- const selectedItems = this.items.list().map((item) => item.getId());
51658
+ const selectedItems = this.items.list().map((item2) => item2.getId());
51643
51659
  return JSON.stringify(selectedItems);
51644
51660
  }
51645
51661
  deserialize(serializedData) {
51646
51662
  const selectedItems = JSON.parse(serializedData);
51647
51663
  this.removeAll();
51648
51664
  selectedItems.forEach((itemId) => {
51649
- const item = this.board.items.getById(itemId);
51650
- if (item) {
51651
- this.items.add(item);
51665
+ const item2 = this.board.items.getById(itemId);
51666
+ if (item2) {
51667
+ this.items.add(item2);
51652
51668
  }
51653
51669
  });
51654
51670
  }
@@ -51726,19 +51742,19 @@ class BoardSelection {
51726
51742
  this.updateQueue.clear();
51727
51743
  safeRequestAnimationFrame(this.updateScheduledObservers);
51728
51744
  };
51729
- itemObserver = (item) => {
51745
+ itemObserver = (item2) => {
51730
51746
  if (!this.shouldPublish) {
51731
51747
  return;
51732
51748
  }
51733
51749
  this.subject.publish(this);
51734
- this.itemSubject.publish(item);
51750
+ this.itemSubject.publish(item2);
51735
51751
  };
51736
51752
  decoratedItemObserver = this.decorateObserverToScheduleUpdate(this.itemObserver);
51737
51753
  add(value) {
51738
51754
  this.items.add(value);
51739
51755
  if (Array.isArray(value)) {
51740
- for (const item of value) {
51741
- item.subject.subscribe(this.itemObserver);
51756
+ for (const item2 of value) {
51757
+ item2.subject.subscribe(this.itemObserver);
51742
51758
  }
51743
51759
  } else {
51744
51760
  value.subject.subscribe(this.itemObserver);
@@ -51747,15 +51763,15 @@ class BoardSelection {
51747
51763
  this.itemsSubject.publish([]);
51748
51764
  }
51749
51765
  addAll() {
51750
- const items = this.board.items.listAll().filter((item) => !item.transformation.isLocked);
51766
+ const items = this.board.items.listAll().filter((item2) => !item2.transformation.isLocked);
51751
51767
  this.add(items);
51752
51768
  this.setContext("SelectByRect");
51753
51769
  }
51754
51770
  remove(value) {
51755
51771
  this.items.remove(value);
51756
51772
  if (Array.isArray(value)) {
51757
- for (const item of value) {
51758
- item.subject.unsubscribe(this.itemObserver);
51773
+ for (const item2 of value) {
51774
+ item2.subject.unsubscribe(this.itemObserver);
51759
51775
  }
51760
51776
  } else {
51761
51777
  value.subject.unsubscribe(this.itemObserver);
@@ -51849,11 +51865,11 @@ class BoardSelection {
51849
51865
  if (!this.items.isSingle()) {
51850
51866
  return;
51851
51867
  }
51852
- const item = this.items.getSingle();
51853
- if (!item) {
51868
+ const item2 = this.items.getSingle();
51869
+ if (!item2) {
51854
51870
  return;
51855
51871
  }
51856
- const text5 = item.getRichText();
51872
+ const text5 = item2.getRichText();
51857
51873
  if (!text5) {
51858
51874
  return;
51859
51875
  }
@@ -51864,7 +51880,7 @@ class BoardSelection {
51864
51880
  if (shouldReplace || moveCursorToEnd) {
51865
51881
  text5.editor.moveCursorToEndOfTheText();
51866
51882
  }
51867
- this.setTextToEdit(item);
51883
+ this.setTextToEdit(item2);
51868
51884
  this.setContext("EditTextUnderPointer");
51869
51885
  if (shouldSelect) {
51870
51886
  text5.editor.selectWholeText();
@@ -51874,13 +51890,13 @@ class BoardSelection {
51874
51890
  editUnderPointer() {
51875
51891
  this.removeAll();
51876
51892
  const stack = this.board.items.getUnderPointer();
51877
- const item = stack.pop();
51878
- if (item) {
51879
- this.add(item);
51893
+ const item2 = stack.pop();
51894
+ if (item2) {
51895
+ this.add(item2);
51880
51896
  this.setTextToEdit(undefined);
51881
- const text5 = item.getRichText();
51897
+ const text5 = item2.getRichText();
51882
51898
  if (text5) {
51883
- this.setTextToEdit(item);
51899
+ this.setTextToEdit(item2);
51884
51900
  text5.editor.selectWholeText();
51885
51901
  this.board.items.subject.publish(this.board.items);
51886
51902
  }
@@ -51889,26 +51905,26 @@ class BoardSelection {
51889
51905
  this.setContext("None");
51890
51906
  }
51891
51907
  }
51892
- setTextToEdit(item) {
51908
+ setTextToEdit(item2) {
51893
51909
  if (this.textToEdit) {
51894
51910
  this.textToEdit.updateElement();
51895
51911
  this.textToEdit.enableRender();
51896
51912
  }
51897
- if (!(item && item.getRichText())) {
51913
+ if (!(item2 && item2.getRichText())) {
51898
51914
  this.textToEdit = undefined;
51899
51915
  return;
51900
51916
  }
51901
- const text5 = item.getRichText();
51917
+ const text5 = item2.getRichText();
51902
51918
  if (!text5) {
51903
51919
  return;
51904
51920
  }
51905
51921
  if (text5.isEmpty()) {
51906
- const textColor = tempStorage.getFontColor(item.itemType);
51907
- const textSize = tempStorage.getFontSize(item.itemType);
51908
- const highlightColor = tempStorage.getFontHighlight(item.itemType);
51909
- const styles = tempStorage.getFontStyles(item.itemType);
51910
- const horizontalAlignment = tempStorage.getHorizontalAlignment(item.itemType);
51911
- const verticalAlignment = tempStorage.getVerticalAlignment(item.itemType);
51922
+ const textColor = tempStorage.getFontColor(item2.itemType);
51923
+ const textSize = tempStorage.getFontSize(item2.itemType);
51924
+ const highlightColor = tempStorage.getFontHighlight(item2.itemType);
51925
+ const styles = tempStorage.getFontStyles(item2.itemType);
51926
+ const horizontalAlignment = tempStorage.getHorizontalAlignment(item2.itemType);
51927
+ const verticalAlignment = tempStorage.getVerticalAlignment(item2.itemType);
51912
51928
  if (textColor) {
51913
51929
  text5.setSelectionFontColor(textColor, "None");
51914
51930
  }
@@ -51916,7 +51932,7 @@ class BoardSelection {
51916
51932
  this.emit({
51917
51933
  class: "RichText",
51918
51934
  method: "setFontSize",
51919
- item: [item.getId()],
51935
+ item: [item2.getId()],
51920
51936
  fontSize: textSize,
51921
51937
  context: this.getContext()
51922
51938
  });
@@ -51928,10 +51944,10 @@ class BoardSelection {
51928
51944
  const stylesArr = styles;
51929
51945
  text5.setSelectionFontStyle(stylesArr, "None");
51930
51946
  }
51931
- if (horizontalAlignment && !(item instanceof Sticker)) {
51947
+ if (horizontalAlignment && !(item2 instanceof Sticker)) {
51932
51948
  text5.setSelectionHorisontalAlignment(horizontalAlignment);
51933
51949
  }
51934
- if (verticalAlignment && !(item instanceof Sticker)) {
51950
+ if (verticalAlignment && !(item2 instanceof Sticker)) {
51935
51951
  this.setVerticalAlignment(verticalAlignment);
51936
51952
  }
51937
51953
  }
@@ -51964,8 +51980,8 @@ class BoardSelection {
51964
51980
  }
51965
51981
  selectEnclosedOrCrossedBy(rect) {
51966
51982
  this.removeAll();
51967
- const enclosedFrames = this.board.items.getEnclosed(rect.left, rect.top, rect.right, rect.bottom).filter((item) => !item.transformation.isLocked);
51968
- 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);
51983
+ const enclosedFrames = this.board.items.getEnclosed(rect.left, rect.top, rect.right, rect.bottom).filter((item2) => !item2.transformation.isLocked);
51984
+ 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);
51969
51985
  if (list6.length !== 0) {
51970
51986
  this.add(list6);
51971
51987
  this.setContext("SelectByRect");
@@ -51979,14 +51995,14 @@ class BoardSelection {
51979
51995
  canChangeText() {
51980
51996
  return Boolean(this.items.isSingle() && this.items.getSingle()?.getRichText());
51981
51997
  }
51982
- handleItemCopy(item, copiedItemsMap) {
51983
- const serializedData = item.serialize(true);
51984
- const zIndex = this.board.items.index.getZIndex(item);
51985
- if (item.itemType === "Comment") {
51998
+ handleItemCopy(item2, copiedItemsMap) {
51999
+ const serializedData = item2.serialize(true);
52000
+ const zIndex = this.board.items.index.getZIndex(item2);
52001
+ if (item2.itemType === "Comment") {
51986
52002
  return;
51987
52003
  }
51988
- if (item.itemType === "Connector" && serializedData.itemType === "Connector") {
51989
- const connector = item;
52004
+ if (item2.itemType === "Connector" && serializedData.itemType === "Connector") {
52005
+ const connector = item2;
51990
52006
  const startPoint = connector.getStartPoint();
51991
52007
  const endPoint = connector.getEndPoint();
51992
52008
  const startItemId = startPoint.pointType !== "Board" ? startPoint.item.getId() : null;
@@ -52002,19 +52018,19 @@ class BoardSelection {
52002
52018
  serializedData.endPoint = new BoardPoint(endPoint.x, endPoint.y).serialize();
52003
52019
  }
52004
52020
  }
52005
- const textItem = item.getRichText()?.getTextString();
52021
+ const textItem = item2.getRichText()?.getTextString();
52006
52022
  const copyText = conf.i18n.t("frame.copy");
52007
52023
  const isCopyTextExist = textItem?.includes(copyText);
52008
- const isChangeCopiedFrameText = item.itemType === "Frame" && serializedData.itemType === "Frame" && textItem !== "" && !isCopyTextExist;
52024
+ const isChangeCopiedFrameText = item2.itemType === "Frame" && serializedData.itemType === "Frame" && textItem !== "" && !isCopyTextExist;
52009
52025
  if (isChangeCopiedFrameText) {
52010
52026
  const copiedFrameText = copyText + (textItem || serializedData.text?.placeholderText);
52011
- item.getRichText()?.editor.clearText();
52012
- item.getRichText()?.editor.addText(copiedFrameText);
52013
- serializedData.text = item.getRichText()?.serialize();
52014
- item.getRichText()?.editor.clearText();
52015
- item.getRichText()?.editor.addText(textItem || "");
52027
+ item2.getRichText()?.editor.clearText();
52028
+ item2.getRichText()?.editor.addText(copiedFrameText);
52029
+ serializedData.text = item2.getRichText()?.serialize();
52030
+ item2.getRichText()?.editor.clearText();
52031
+ item2.getRichText()?.editor.addText(textItem || "");
52016
52032
  }
52017
- copiedItemsMap[item.getId()] = { ...serializedData, zIndex };
52033
+ copiedItemsMap[item2.getId()] = { ...serializedData, zIndex };
52018
52034
  }
52019
52035
  copy(skipImageBlobCopy) {
52020
52036
  const copiedItemsMap = {};
@@ -52023,12 +52039,12 @@ class BoardSelection {
52023
52039
  this.handleItemCopy(single, copiedItemsMap);
52024
52040
  return { imageElement: single.image, imageData: copiedItemsMap };
52025
52041
  }
52026
- this.list().forEach((item) => {
52027
- this.handleItemCopy(item, copiedItemsMap);
52042
+ this.list().forEach((item2) => {
52043
+ this.handleItemCopy(item2, copiedItemsMap);
52028
52044
  });
52029
- this.list().flatMap((item) => {
52030
- if (item instanceof Frame2) {
52031
- return item.getChildrenIds();
52045
+ this.list().flatMap((item2) => {
52046
+ if (item2 instanceof Frame2) {
52047
+ return item2.getChildrenIds();
52032
52048
  }
52033
52049
  return [];
52034
52050
  }).forEach((id) => {
@@ -52056,11 +52072,11 @@ class BoardSelection {
52056
52072
  let maxRichText = null;
52057
52073
  let minRichText = null;
52058
52074
  const itemType = items[0].itemType;
52059
- for (const item of items) {
52060
- if (item.itemType !== itemType) {
52075
+ for (const item2 of items) {
52076
+ if (item2.itemType !== itemType) {
52061
52077
  return null;
52062
52078
  }
52063
- const richText = item.getRichText();
52079
+ const richText = item2.getRichText();
52064
52080
  if (richText) {
52065
52081
  if (!maxRichText || richText.getFontSize() > maxRichText.getFontSize()) {
52066
52082
  maxRichText = richText;
@@ -52166,22 +52182,22 @@ class BoardSelection {
52166
52182
  }
52167
52183
  nestSelectedItems(unselectedItem, checkFrames = true) {
52168
52184
  const selected = this.board.selection.items.list();
52169
- if (unselectedItem && !selected.find((item) => item.getId() === unselectedItem.getId())) {
52185
+ if (unselectedItem && !selected.find((item2) => item2.getId() === unselectedItem.getId())) {
52170
52186
  selected.push(unselectedItem);
52171
52187
  }
52172
- const selectedMbr = selected.reduce((acc, item) => {
52188
+ const selectedMbr = selected.reduce((acc, item2) => {
52173
52189
  if (!acc) {
52174
- return item.getMbr();
52190
+ return item2.getMbr();
52175
52191
  }
52176
- return acc.combine(item.getMbr());
52192
+ return acc.combine(item2.getMbr());
52177
52193
  }, undefined);
52178
52194
  if (selectedMbr) {
52179
- const selectedMap = Object.fromEntries(selected.map((item) => [item.getId(), { item, nested: false }]));
52195
+ const selectedMap = Object.fromEntries(selected.map((item2) => [item2.getId(), { item: item2, nested: false }]));
52180
52196
  const enclosedGroups = this.board.items.getGroupItemsEnclosedOrCrossed(selectedMbr?.left, selectedMbr?.top, selectedMbr?.right, selectedMbr?.bottom);
52181
52197
  enclosedGroups.forEach((group) => {
52182
- selected.forEach((item) => {
52183
- if (group.handleNesting(item)) {
52184
- selectedMap[item.getId()].nested = group;
52198
+ selected.forEach((item2) => {
52199
+ if (group.handleNesting(item2)) {
52200
+ selectedMap[item2.getId()].nested = group;
52185
52201
  }
52186
52202
  });
52187
52203
  });
@@ -52205,11 +52221,11 @@ class BoardSelection {
52205
52221
  if (childrenIds && checkFrames) {
52206
52222
  const currGroup = val.item;
52207
52223
  const currMbr = currGroup.getMbr();
52208
- const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item) => !!item);
52209
- const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board" || item.parent === currGroup.getId());
52224
+ const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item2) => !!item2);
52225
+ const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item2) => item2.parent === "Board" || item2.parent === currGroup.getId());
52210
52226
  const uniqueItems = new Set;
52211
- const toCheck = [...children, ...underGroup].filter((item) => {
52212
- const id = item.getId();
52227
+ const toCheck = [...children, ...underGroup].filter((item2) => {
52228
+ const id = item2.getId();
52213
52229
  if (uniqueItems.has(id)) {
52214
52230
  return false;
52215
52231
  }
@@ -52250,8 +52266,8 @@ class BoardSelection {
52250
52266
  addItemToTranslation(childId);
52251
52267
  }
52252
52268
  }
52253
- const createTranslationWithComments = (item) => {
52254
- const followedComments = this.board.items.getComments().filter((comment2) => comment2.getItemToFollow() === item.getId());
52269
+ const createTranslationWithComments = (item2) => {
52270
+ const followedComments = this.board.items.getComments().filter((comment2) => comment2.getItemToFollow() === item2.getId());
52255
52271
  for (const comment2 of followedComments) {
52256
52272
  translation[comment2.getId()] = {
52257
52273
  class: "Transformation",
@@ -52312,21 +52328,21 @@ class BoardSelection {
52312
52328
  newData: { borderColor }
52313
52329
  };
52314
52330
  const operations2 = {};
52315
- this.items.list().forEach((item) => {
52316
- if (!operations2[item.itemType]) {
52331
+ this.items.list().forEach((item2) => {
52332
+ if (!operations2[item2.itemType]) {
52317
52333
  const operationCopy = { ...operation };
52318
- if (item.itemType === "Connector") {
52334
+ if (item2.itemType === "Connector") {
52319
52335
  operationCopy.method = "setLineColor";
52320
52336
  operationCopy.lineColor = borderColor;
52321
- } else if (item.itemType === "Drawing") {
52337
+ } else if (item2.itemType === "Drawing") {
52322
52338
  operationCopy.method = "setStrokeColor";
52323
52339
  operationCopy.color = borderColor;
52324
52340
  } else {
52325
52341
  operationCopy.borderColor = borderColor;
52326
52342
  }
52327
- operations2[item.itemType] = { ...operationCopy, class: item.itemType, item: [item.getId()] };
52343
+ operations2[item2.itemType] = { ...operationCopy, class: item2.itemType, item: [item2.getId()] };
52328
52344
  } else {
52329
- operations2[item.itemType].item.push(item.getId());
52345
+ operations2[item2.itemType].item.push(item2.getId());
52330
52346
  }
52331
52347
  });
52332
52348
  Object.values(operations2).forEach((op) => {
@@ -52341,13 +52357,13 @@ class BoardSelection {
52341
52357
  newData: { borderWidth: width2 }
52342
52358
  };
52343
52359
  const operations2 = {};
52344
- this.items.list().forEach((item) => {
52345
- if (!operations2[item.itemType]) {
52360
+ this.items.list().forEach((item2) => {
52361
+ if (!operations2[item2.itemType]) {
52346
52362
  const operationCopy = { ...operation };
52347
- if (item.itemType === "Connector") {
52363
+ if (item2.itemType === "Connector") {
52348
52364
  operationCopy.method = "setLineWidth";
52349
52365
  operationCopy.lineWidth = width2;
52350
- } else if (item.itemType === "Drawing") {
52366
+ } else if (item2.itemType === "Drawing") {
52351
52367
  operationCopy.method = "setStrokeWidth";
52352
52368
  operationCopy.width = width2;
52353
52369
  operationCopy.prevWidth = this.getStrokeWidth();
@@ -52355,9 +52371,9 @@ class BoardSelection {
52355
52371
  operationCopy.borderWidth = width2;
52356
52372
  operationCopy.prevBorderWidth = this.getStrokeWidth();
52357
52373
  }
52358
- operations2[item.itemType] = { ...operationCopy, class: item.itemType, item: [item.getId()] };
52374
+ operations2[item2.itemType] = { ...operationCopy, class: item2.itemType, item: [item2.getId()] };
52359
52375
  } else {
52360
- operations2[item.itemType].item.push(item.getId());
52376
+ operations2[item2.itemType].item.push(item2.getId());
52361
52377
  }
52362
52378
  });
52363
52379
  Object.values(operations2).forEach((op) => {
@@ -52373,11 +52389,11 @@ class BoardSelection {
52373
52389
  newData: { backgroundColor }
52374
52390
  };
52375
52391
  const operations2 = {};
52376
- this.items.list().forEach((item) => {
52377
- if (!operations2[item.itemType]) {
52378
- operations2[item.itemType] = { ...operation, class: item.itemType, item: [item.getId()] };
52392
+ this.items.list().forEach((item2) => {
52393
+ if (!operations2[item2.itemType]) {
52394
+ operations2[item2.itemType] = { ...operation, class: item2.itemType, item: [item2.getId()] };
52379
52395
  } else {
52380
- operations2[item.itemType].item.push(item.getId());
52396
+ operations2[item2.itemType].item.push(item2.getId());
52381
52397
  }
52382
52398
  });
52383
52399
  Object.values(operations2).forEach((op) => {
@@ -52401,9 +52417,9 @@ class BoardSelection {
52401
52417
  }
52402
52418
  setFrameType(frameType) {
52403
52419
  const items = this.items.list();
52404
- items.forEach((item) => {
52405
- if (item instanceof Frame2) {
52406
- item.setFrameType(frameType);
52420
+ items.forEach((item2) => {
52421
+ if (item2 instanceof Frame2) {
52422
+ item2.setFrameType(frameType);
52407
52423
  }
52408
52424
  });
52409
52425
  }
@@ -52422,21 +52438,21 @@ class BoardSelection {
52422
52438
  setFontSize(size) {
52423
52439
  const fontSize = size === "auto" ? size : toFiniteNumber(size);
52424
52440
  const itemsOps = [];
52425
- for (const item of this.items.list()) {
52426
- const text5 = item.getRichText();
52441
+ for (const item2 of this.items.list()) {
52442
+ const text5 = item2.getRichText();
52427
52443
  if (!text5) {
52428
52444
  continue;
52429
52445
  }
52430
52446
  const ops = text5.setSelectionFontSize(fontSize, this.context);
52431
52447
  itemsOps.push({
52432
- item: item.getId(),
52448
+ item: item2.getId(),
52433
52449
  selection: text5.editor.getSelection(),
52434
52450
  ops
52435
52451
  });
52436
- if (item.itemType === "Sticker" && fontSize === "auto") {
52437
- tempStorage.remove(`fontSize_${item.itemType}`);
52438
- } else if (item.itemType !== "AINode") {
52439
- tempStorage.setFontSize(item.itemType, fontSize);
52452
+ if (item2.itemType === "Sticker" && fontSize === "auto") {
52453
+ tempStorage.remove(`fontSize_${item2.itemType}`);
52454
+ } else if (item2.itemType !== "AINode") {
52455
+ tempStorage.setFontSize(item2.itemType, fontSize);
52440
52456
  }
52441
52457
  }
52442
52458
  const emptyOps = itemsOps.filter((op) => !op.ops.length);
@@ -52459,8 +52475,8 @@ class BoardSelection {
52459
52475
  setFontStyle(fontStyle) {
52460
52476
  const isMultiple = !this.items.isSingle();
52461
52477
  const itemsOps = [];
52462
- for (const item of this.items.list()) {
52463
- const text5 = item.getRichText();
52478
+ for (const item2 of this.items.list()) {
52479
+ const text5 = item2.getRichText();
52464
52480
  if (!text5) {
52465
52481
  continue;
52466
52482
  }
@@ -52469,12 +52485,12 @@ class BoardSelection {
52469
52485
  }
52470
52486
  const ops = text5.setSelectionFontStyle(fontStyle, this.context);
52471
52487
  itemsOps.push({
52472
- item: item.getId(),
52488
+ item: item2.getId(),
52473
52489
  selection: text5.editor.getSelection(),
52474
52490
  ops
52475
52491
  });
52476
- if (item.itemType !== "AINode") {
52477
- tempStorage.setFontStyles(item.itemType, text5.getFontStyles());
52492
+ if (item2.itemType !== "AINode") {
52493
+ tempStorage.setFontStyles(item2.itemType, text5.getFontStyles());
52478
52494
  }
52479
52495
  }
52480
52496
  this.emitApplied({
@@ -52486,8 +52502,8 @@ class BoardSelection {
52486
52502
  setFontColor(fontColor) {
52487
52503
  const isMultiple = !this.items.isSingle();
52488
52504
  const itemsOps = [];
52489
- for (const item of this.items.list()) {
52490
- const text5 = item.getRichText();
52505
+ for (const item2 of this.items.list()) {
52506
+ const text5 = item2.getRichText();
52491
52507
  if (!text5) {
52492
52508
  continue;
52493
52509
  }
@@ -52496,11 +52512,11 @@ class BoardSelection {
52496
52512
  }
52497
52513
  const ops = text5.setSelectionFontColor(fontColor, this.context);
52498
52514
  itemsOps.push({
52499
- item: item.getId(),
52515
+ item: item2.getId(),
52500
52516
  selection: text5.editor.getSelection(),
52501
52517
  ops
52502
52518
  });
52503
- tempStorage.setFontColor(item.itemType, fontColor);
52519
+ tempStorage.setFontColor(item2.itemType, fontColor);
52504
52520
  }
52505
52521
  this.emitApplied({
52506
52522
  class: "RichText",
@@ -52529,8 +52545,8 @@ class BoardSelection {
52529
52545
  setFontHighlight(fontHighlight) {
52530
52546
  const isMultiple = !this.items.isSingle();
52531
52547
  const itemsOps = [];
52532
- for (const item of this.items.list()) {
52533
- const text5 = item.getRichText();
52548
+ for (const item2 of this.items.list()) {
52549
+ const text5 = item2.getRichText();
52534
52550
  if (!text5) {
52535
52551
  continue;
52536
52552
  }
@@ -52539,12 +52555,12 @@ class BoardSelection {
52539
52555
  }
52540
52556
  const ops = text5.setSelectionFontHighlight(fontHighlight, this.context);
52541
52557
  itemsOps.push({
52542
- item: item.getId(),
52558
+ item: item2.getId(),
52543
52559
  selection: text5.editor.getSelection(),
52544
52560
  ops
52545
52561
  });
52546
- if (item.itemType !== "AINode") {
52547
- tempStorage.setFontHighlight(item.itemType, fontHighlight);
52562
+ if (item2.itemType !== "AINode") {
52563
+ tempStorage.setFontHighlight(item2.itemType, fontHighlight);
52548
52564
  }
52549
52565
  }
52550
52566
  this.emitApplied({
@@ -52556,8 +52572,8 @@ class BoardSelection {
52556
52572
  setHorisontalAlignment(horisontalAlignment) {
52557
52573
  const isMultiple = !this.items.isSingle();
52558
52574
  const itemsOps = [];
52559
- for (const item of this.items.list()) {
52560
- const text5 = item.getRichText();
52575
+ for (const item2 of this.items.list()) {
52576
+ const text5 = item2.getRichText();
52561
52577
  if (!text5) {
52562
52578
  continue;
52563
52579
  }
@@ -52566,11 +52582,11 @@ class BoardSelection {
52566
52582
  }
52567
52583
  const ops = text5.setSelectionHorisontalAlignment(horisontalAlignment, this.context);
52568
52584
  itemsOps.push({
52569
- item: item.getId(),
52585
+ item: item2.getId(),
52570
52586
  selection: text5.editor.getSelection(),
52571
52587
  ops
52572
52588
  });
52573
- tempStorage.setHorizontalAlignment(item.itemType, horisontalAlignment);
52589
+ tempStorage.setHorizontalAlignment(item2.itemType, horisontalAlignment);
52574
52590
  }
52575
52591
  this.emitApplied({
52576
52592
  class: "RichText",
@@ -52586,23 +52602,23 @@ class BoardSelection {
52586
52602
  verticalAlignment
52587
52603
  });
52588
52604
  if (this.items.isSingle()) {
52589
- const item = this.items.getSingle();
52590
- if (!item) {
52605
+ const item2 = this.items.getSingle();
52606
+ if (!item2) {
52591
52607
  return;
52592
52608
  }
52593
- const text5 = item.getRichText();
52609
+ const text5 = item2.getRichText();
52594
52610
  if (!text5) {
52595
52611
  return;
52596
52612
  }
52597
- tempStorage.setVerticalAlignment(item.itemType, verticalAlignment);
52598
- if (item instanceof RichText) {
52599
- item.setEditorFocus(this.context);
52613
+ tempStorage.setVerticalAlignment(item2.itemType, verticalAlignment);
52614
+ if (item2 instanceof RichText) {
52615
+ item2.setEditorFocus(this.context);
52600
52616
  }
52601
52617
  text5.setEditorFocus(this.context);
52602
52618
  }
52603
52619
  }
52604
52620
  removeFromBoard() {
52605
- const isLocked = this.items.list().some((item) => item.transformation.isLocked);
52621
+ const isLocked = this.items.list().some((item2) => item2.transformation.isLocked);
52606
52622
  if (isLocked) {
52607
52623
  return;
52608
52624
  }
@@ -52625,7 +52641,7 @@ class BoardSelection {
52625
52641
  }
52626
52642
  getIsLockedSelection() {
52627
52643
  const items = this.list();
52628
- return items.some((item) => item.transformation.isLocked);
52644
+ return items.some((item2) => item2.transformation.isLocked);
52629
52645
  }
52630
52646
  isLocked() {
52631
52647
  return false;
@@ -52652,9 +52668,9 @@ class BoardSelection {
52652
52668
  }
52653
52669
  async duplicate() {
52654
52670
  const mediaIds = [];
52655
- this.items.list().forEach((item) => {
52656
- if ("getStorageId" in item) {
52657
- const storageId = item.getStorageId();
52671
+ this.items.list().forEach((item2) => {
52672
+ if ("getStorageId" in item2) {
52673
+ const storageId = item2.getStorageId();
52658
52674
  if (storageId) {
52659
52675
  mediaIds.push(storageId);
52660
52676
  }
@@ -52664,7 +52680,7 @@ class BoardSelection {
52664
52680
  if (!canDuplicate) {
52665
52681
  return;
52666
52682
  }
52667
- const filteredItemMap = Object.fromEntries(Object.entries(this.copy(true)).filter(([_, item]) => item.itemType !== "Group"));
52683
+ const filteredItemMap = Object.fromEntries(Object.entries(this.copy(true)).filter(([_, item2]) => item2.itemType !== "Group"));
52668
52684
  this.board.duplicate(filteredItemMap);
52669
52685
  this.setContext("EditUnderPointer");
52670
52686
  }
@@ -52698,10 +52714,10 @@ class BoardSelection {
52698
52714
  lastAssistantMessageId
52699
52715
  };
52700
52716
  }
52701
- renderItemMbr(context, item, customScale) {
52702
- const mbr = item.getMbr();
52717
+ renderItemMbr(context, item2, customScale) {
52718
+ const mbr = item2.getMbr();
52703
52719
  mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
52704
- const selectionColor = item.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
52720
+ const selectionColor = item2.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
52705
52721
  mbr.borderColor = selectionColor;
52706
52722
  mbr.render(context);
52707
52723
  }
@@ -52717,8 +52733,8 @@ class BoardSelection {
52717
52733
  }
52718
52734
  if (!this.transformationRenderBlock) {
52719
52735
  if (this.shouldRenderItemsMbr) {
52720
- for (const item of this.items.list()) {
52721
- this.renderItemMbr(context, item);
52736
+ for (const item2 of this.items.list()) {
52737
+ this.renderItemMbr(context, item2);
52722
52738
  }
52723
52739
  }
52724
52740
  this.tool.render(context);
@@ -52730,7 +52746,7 @@ class BoardSelection {
52730
52746
  if (single && single instanceof AINode) {
52731
52747
  const contextItemsIds = single.getContextItems();
52732
52748
  if (contextItemsIds.length) {
52733
- const newContextItems = this.board.items.listAll().filter((item) => contextItemsIds.includes(item.getId()));
52749
+ const newContextItems = this.board.items.listAll().filter((item2) => contextItemsIds.includes(item2.getId()));
52734
52750
  contextItems.push(...newContextItems);
52735
52751
  }
52736
52752
  }
@@ -52748,15 +52764,15 @@ class BoardSelection {
52748
52764
  }
52749
52765
  }
52750
52766
  }
52751
- contextItems.forEach((item) => {
52752
- if (item instanceof AINode) {
52753
- const path2 = item.getPath();
52767
+ contextItems.forEach((item2) => {
52768
+ if (item2 instanceof AINode) {
52769
+ const path2 = item2.getPath();
52754
52770
  path2.setBorderColor(CONTEXT_NODE_HIGHLIGHT_COLOR);
52755
52771
  path2.setBorderWidth(2);
52756
52772
  path2.setBackgroundColor("none");
52757
52773
  path2.render(context);
52758
52774
  } else {
52759
- const itemRect = item.getMbr();
52775
+ const itemRect = item2.getMbr();
52760
52776
  itemRect.borderColor = CONTEXT_NODE_HIGHLIGHT_COLOR;
52761
52777
  itemRect.strokeWidth = 2;
52762
52778
  itemRect.render(context);
@@ -53257,16 +53273,16 @@ class Board {
53257
53273
  applyBoardOperation(op) {
53258
53274
  switch (op.method) {
53259
53275
  case "moveToZIndex": {
53260
- const item = this.index.getById(op.item);
53261
- if (!item) {
53276
+ const item2 = this.index.getById(op.item);
53277
+ if (!item2) {
53262
53278
  return;
53263
53279
  }
53264
- return this.index.moveToZIndex(item, op.zIndex);
53280
+ return this.index.moveToZIndex(item2, op.zIndex);
53265
53281
  }
53266
53282
  case "moveManyToZIndex": {
53267
53283
  for (const id in op.item) {
53268
- const item = this.items.getById(id);
53269
- if (!item) {
53284
+ const item2 = this.items.getById(id);
53285
+ if (!item2) {
53270
53286
  delete op.item.id;
53271
53287
  }
53272
53288
  }
@@ -53288,11 +53304,11 @@ class Board {
53288
53304
  }
53289
53305
  return this.index.moveSecondAfterFirst(first, second);
53290
53306
  case "bringToFront": {
53291
- const items = op.item.map((item) => this.items.getById(item)).filter((item) => item !== undefined);
53307
+ const items = op.item.map((item2) => this.items.getById(item2)).filter((item2) => item2 !== undefined);
53292
53308
  return this.index.bringManyToFront(items);
53293
53309
  }
53294
53310
  case "sendToBack": {
53295
- const items = op.item.map((item) => this.items.getById(item)).filter((item) => item !== undefined);
53311
+ const items = op.item.map((item2) => this.items.getById(item2)).filter((item2) => item2 !== undefined);
53296
53312
  return this.index.sendManyToBack(items);
53297
53313
  }
53298
53314
  case "add":
@@ -53316,82 +53332,82 @@ class Board {
53316
53332
  applyAddItems(op) {
53317
53333
  if (Array.isArray(op.item)) {
53318
53334
  const data = op.data;
53319
- const items = op.item.map((item2) => {
53320
- const created = this.createItem(item2, data[item2]);
53335
+ const items = op.item.map((item3) => {
53336
+ const created = this.createItem(item3, data[item3]);
53321
53337
  this.index.insert(created);
53322
53338
  return created;
53323
53339
  });
53324
- items.forEach((item2) => {
53325
- if (item2 instanceof Connector2 && data[item2.getId()]) {
53326
- const connectorData = data[item2.getId()];
53327
- item2.applyStartPoint(connectorData.startPoint);
53328
- item2.applyEndPoint(connectorData.endPoint);
53340
+ items.forEach((item3) => {
53341
+ if (item3 instanceof Connector2 && data[item3.getId()]) {
53342
+ const connectorData = data[item3.getId()];
53343
+ item3.applyStartPoint(connectorData.startPoint);
53344
+ item3.applyEndPoint(connectorData.endPoint);
53329
53345
  }
53330
53346
  });
53331
53347
  return;
53332
53348
  }
53333
- const item = this.createItem(op.item, op.data);
53334
- return this.index.insert(item);
53349
+ const item2 = this.createItem(op.item, op.data);
53350
+ return this.index.insert(item2);
53335
53351
  }
53336
53352
  applyAddLockedGroupOperation(op) {
53337
- const item = this.createItem(op.item, op.data);
53338
- const groupChildrenIds = item.getChildrenIds();
53339
- this.index.insert(item);
53353
+ const item2 = this.createItem(op.item, op.data);
53354
+ const groupChildrenIds = item2.getChildrenIds();
53355
+ this.index.insert(item2);
53340
53356
  const lastChildrenId = this.index.getById(groupChildrenIds[groupChildrenIds.length - 1]);
53341
53357
  if (lastChildrenId) {
53342
53358
  const zIndex = this.index.getZIndex(lastChildrenId) + 1;
53343
- this.index.moveToZIndex(item, zIndex);
53359
+ this.index.moveToZIndex(item2, zIndex);
53344
53360
  }
53345
- item.getChildren().forEach((item2) => {
53346
- item2.transformation.isLocked = true;
53361
+ item2.getChildren().forEach((item3) => {
53362
+ item3.transformation.isLocked = true;
53347
53363
  });
53348
- item.transformation.isLocked = true;
53364
+ item2.transformation.isLocked = true;
53349
53365
  }
53350
53366
  applyRemoveOperation(op) {
53351
53367
  const removedItems = [];
53352
- this.findItemAndApply(op.item, (item) => {
53353
- this.index.remove(item);
53354
- this.selection.remove(item);
53355
- if (item instanceof Connector2) {
53356
- item.clearObservedItems();
53368
+ this.findItemAndApply(op.item, (item2) => {
53369
+ this.index.remove(item2);
53370
+ this.selection.remove(item2);
53371
+ if (item2 instanceof Connector2) {
53372
+ item2.clearObservedItems();
53357
53373
  }
53358
- removedItems.push(item);
53374
+ removedItems.push(item2);
53359
53375
  });
53360
53376
  }
53361
53377
  applyRemoveLockedGroupOperation(op) {
53362
- const item = this.index.getById(op.item[0]);
53363
- if (!item || !(item instanceof Group)) {
53378
+ const item2 = this.index.getById(op.item[0]);
53379
+ if (!item2 || !(item2 instanceof Group)) {
53364
53380
  return;
53365
53381
  }
53366
- item.getChildren().forEach((item2) => {
53367
- item2.transformation.isLocked = false;
53368
- item2.parent = "Board";
53382
+ item2.getChildren().forEach((item3) => {
53383
+ item3.transformation.isLocked = false;
53384
+ item3.parent = "Board";
53369
53385
  });
53370
- item.transformation.isLocked = false;
53386
+ item2.transformation.isLocked = false;
53371
53387
  const removedItems = [];
53372
- this.findItemAndApply(op.item, (item2) => {
53373
- this.index.remove(item2);
53374
- this.selection.remove(item2);
53375
- removedItems.push(item2);
53388
+ this.findItemAndApply(op.item, (item3) => {
53389
+ this.index.remove(item3);
53390
+ this.selection.remove(item3);
53391
+ removedItems.push(item3);
53376
53392
  });
53377
53393
  }
53378
53394
  applyItemOperation(op) {
53379
53395
  if ("item" in op) {
53380
- this.findItemAndApply(op.item, (item) => {
53381
- item.apply(op);
53396
+ this.findItemAndApply(op.item, (item2) => {
53397
+ item2.apply(op);
53382
53398
  });
53383
53399
  }
53384
53400
  }
53385
- findItemAndApply(item, apply) {
53386
- if (Array.isArray(item)) {
53387
- for (const itemId of item) {
53401
+ findItemAndApply(item2, apply) {
53402
+ if (Array.isArray(item2)) {
53403
+ for (const itemId of item2) {
53388
53404
  const found = this.items.findById(itemId);
53389
53405
  if (found) {
53390
53406
  apply(found);
53391
53407
  }
53392
53408
  }
53393
53409
  } else {
53394
- const found = this.items.findById(item);
53410
+ const found = this.items.findById(item2);
53395
53411
  if (found) {
53396
53412
  apply(found);
53397
53413
  }
@@ -53400,9 +53416,9 @@ class Board {
53400
53416
  handleNesting(items) {
53401
53417
  const arrayed = Array.isArray(items) ? items : [items];
53402
53418
  const groupsMap = new Map;
53403
- arrayed.forEach((item) => {
53404
- const itemCenter = item.getMbr().getCenter();
53405
- const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
53419
+ arrayed.forEach((item2) => {
53420
+ const itemCenter = item2.getMbr().getCenter();
53421
+ const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item2)).reduce((acc, groupItem2) => {
53406
53422
  if (!acc || groupItem2.getDistanceToPoint(itemCenter) > acc.getDistanceToPoint(itemCenter)) {
53407
53423
  acc = groupItem2;
53408
53424
  }
@@ -53412,7 +53428,7 @@ class Board {
53412
53428
  if (!groupsMap.has(groupItem)) {
53413
53429
  groupsMap.set(groupItem, []);
53414
53430
  }
53415
- groupsMap.get(groupItem)?.push(item);
53431
+ groupsMap.get(groupItem)?.push(item2);
53416
53432
  }
53417
53433
  });
53418
53434
  groupsMap.forEach((items2, group) => {
@@ -53433,13 +53449,13 @@ class Board {
53433
53449
  }
53434
53450
  return parser(el);
53435
53451
  }
53436
- add(item, timeStamp) {
53452
+ add(item2, timeStamp) {
53437
53453
  const id = this.getNewItemId();
53438
53454
  this.emit({
53439
53455
  class: "Board",
53440
53456
  method: "add",
53441
53457
  item: id,
53442
- data: item.serialize(),
53458
+ data: item2.serialize(),
53443
53459
  timeStamp
53444
53460
  });
53445
53461
  const newItem = this.items.getById(id);
@@ -53449,13 +53465,13 @@ class Board {
53449
53465
  this.handleNesting(newItem);
53450
53466
  return newItem;
53451
53467
  }
53452
- addLockedGroup(item) {
53468
+ addLockedGroup(item2) {
53453
53469
  const id = this.getNewItemId();
53454
53470
  this.emit({
53455
53471
  class: "Board",
53456
53472
  method: "addLockedGroup",
53457
53473
  item: id,
53458
- data: item.serialize()
53474
+ data: item2.serialize()
53459
53475
  });
53460
53476
  const newItem = this.items.getById(id);
53461
53477
  if (!newItem) {
@@ -53464,32 +53480,32 @@ class Board {
53464
53480
  this.handleNesting(newItem);
53465
53481
  return newItem;
53466
53482
  }
53467
- remove(item, withConnectors = true) {
53483
+ remove(item2, withConnectors = true) {
53468
53484
  let connectors = [];
53469
53485
  if (withConnectors) {
53470
- connectors = this.items.getLinkedConnectorsById(item.getId()).map((connector) => connector.getId());
53486
+ connectors = this.items.getLinkedConnectorsById(item2.getId()).map((connector) => connector.getId());
53471
53487
  }
53472
- if ("onRemove" in item) {
53473
- item.onRemove();
53488
+ if ("onRemove" in item2) {
53489
+ item2.onRemove();
53474
53490
  }
53475
53491
  this.emit({
53476
53492
  class: "Board",
53477
53493
  method: "remove",
53478
- item: [item.getId(), ...connectors]
53494
+ item: [item2.getId(), ...connectors]
53479
53495
  });
53480
53496
  }
53481
- removeLockedGroup(item) {
53497
+ removeLockedGroup(item2) {
53482
53498
  this.emit({
53483
53499
  class: "Board",
53484
53500
  method: "removeLockedGroup",
53485
- item: [item.getId()]
53501
+ item: [item2.getId()]
53486
53502
  });
53487
53503
  }
53488
53504
  getByZIndex(index2) {
53489
53505
  return this.index.getByZIndex(index2);
53490
53506
  }
53491
- getZIndex(item) {
53492
- return this.index.getZIndex(item);
53507
+ getZIndex(item2) {
53508
+ return this.index.getZIndex(item2);
53493
53509
  }
53494
53510
  getLastZIndex() {
53495
53511
  return this.index.getLastZIndex();
@@ -53501,11 +53517,11 @@ class Board {
53501
53517
  item: items
53502
53518
  });
53503
53519
  }
53504
- moveToZIndex(item, zIndex) {
53520
+ moveToZIndex(item2, zIndex) {
53505
53521
  this.emit({
53506
53522
  class: "Board",
53507
53523
  method: "moveToZIndex",
53508
- item: item.getId(),
53524
+ item: item2.getId(),
53509
53525
  zIndex
53510
53526
  });
53511
53527
  }
@@ -53533,8 +53549,8 @@ class Board {
53533
53549
  this.emit({
53534
53550
  class: "Board",
53535
53551
  method: "bringToFront",
53536
- item: items.map((item) => item.getId()),
53537
- prevZIndex: Object.fromEntries(boardItems.map((item) => [item.getId(), boardItems.indexOf(item)]))
53552
+ item: items.map((item2) => item2.getId()),
53553
+ prevZIndex: Object.fromEntries(boardItems.map((item2) => [item2.getId(), boardItems.indexOf(item2)]))
53538
53554
  });
53539
53555
  }
53540
53556
  sendToBack(items) {
@@ -53545,8 +53561,8 @@ class Board {
53545
53561
  this.emit({
53546
53562
  class: "Board",
53547
53563
  method: "sendToBack",
53548
- item: items.map((item) => item.getId()),
53549
- prevZIndex: Object.fromEntries(boardItems.map((item) => [item.getId(), boardItems.indexOf(item)]))
53564
+ item: items.map((item2) => item2.getId()),
53565
+ prevZIndex: Object.fromEntries(boardItems.map((item2) => [item2.getId(), boardItems.indexOf(item2)]))
53550
53566
  });
53551
53567
  }
53552
53568
  copy() {
@@ -53623,7 +53639,7 @@ class Board {
53623
53639
  return added;
53624
53640
  });
53625
53641
  addedFrame.addChildItems(addedChildren);
53626
- parsedData.data.children = addedChildren.map((item) => item.getId());
53642
+ parsedData.data.children = addedChildren.map((item2) => item2.getId());
53627
53643
  idsMap[parsedData.data.id] = addedFrame.getId();
53628
53644
  } else {
53629
53645
  const added = this.add(this.createItem(this.getNewItemId(), parsedData));
@@ -53664,15 +53680,15 @@ class Board {
53664
53680
  const createdConnectors = {};
53665
53681
  const createdFrames = {};
53666
53682
  const addItem = (itemData) => {
53667
- const item = this.createItem(itemData.id, itemData);
53668
- if (item instanceof Connector2) {
53669
- createdConnectors[itemData.id] = { item, itemData };
53683
+ const item2 = this.createItem(itemData.id, itemData);
53684
+ if (item2 instanceof Connector2) {
53685
+ createdConnectors[itemData.id] = { item: item2, itemData };
53670
53686
  }
53671
- if (item instanceof Frame2) {
53672
- createdFrames[item.getId()] = { item, itemData };
53687
+ if (item2 instanceof Frame2) {
53688
+ createdFrames[item2.getId()] = { item: item2, itemData };
53673
53689
  }
53674
- this.index.insert(item);
53675
- return item;
53690
+ this.index.insert(item2);
53691
+ return item2;
53676
53692
  };
53677
53693
  for (const itemData of items) {
53678
53694
  if ("childrenMap" in itemData) {
@@ -53683,13 +53699,13 @@ class Board {
53683
53699
  }
53684
53700
  }
53685
53701
  for (const key in createdConnectors) {
53686
- const { item, itemData } = createdConnectors[key];
53687
- item.applyStartPoint(itemData.startPoint);
53688
- item.applyEndPoint(itemData.endPoint);
53702
+ const { item: item2, itemData } = createdConnectors[key];
53703
+ item2.applyStartPoint(itemData.startPoint);
53704
+ item2.applyEndPoint(itemData.endPoint);
53689
53705
  }
53690
53706
  for (const key in createdFrames) {
53691
- const { item, itemData } = createdFrames[key];
53692
- item.applyAddChildren(itemData.children);
53707
+ const { item: item2, itemData } = createdFrames[key];
53708
+ item2.applyAddChildren(itemData.children);
53693
53709
  }
53694
53710
  }
53695
53711
  deserialize(snapshot) {
@@ -53699,33 +53715,33 @@ class Board {
53699
53715
  const createdFrames = {};
53700
53716
  if (Array.isArray(items)) {
53701
53717
  for (const itemData of items) {
53702
- const item = this.createItem(itemData.id, itemData);
53703
- if (item instanceof Connector2) {
53704
- createdConnectors[itemData.id] = { item, itemData };
53718
+ const item2 = this.createItem(itemData.id, itemData);
53719
+ if (item2 instanceof Connector2) {
53720
+ createdConnectors[itemData.id] = { item: item2, itemData };
53705
53721
  }
53706
- if (item instanceof Frame2) {
53707
- createdFrames[item.getId()] = { item, itemData };
53722
+ if (item2 instanceof Frame2) {
53723
+ createdFrames[item2.getId()] = { item: item2, itemData };
53708
53724
  }
53709
- this.index.insert(item);
53725
+ this.index.insert(item2);
53710
53726
  }
53711
53727
  } else {
53712
53728
  for (const key in items) {
53713
53729
  const itemData = items[key];
53714
- const item = this.createItem(key, itemData);
53715
- if (item instanceof Connector2) {
53716
- createdConnectors[key] = { item, itemData };
53730
+ const item2 = this.createItem(key, itemData);
53731
+ if (item2 instanceof Connector2) {
53732
+ createdConnectors[key] = { item: item2, itemData };
53717
53733
  }
53718
- this.index.insert(item);
53734
+ this.index.insert(item2);
53719
53735
  }
53720
53736
  }
53721
53737
  for (const key in createdConnectors) {
53722
- const { item, itemData } = createdConnectors[key];
53723
- item.applyStartPoint(itemData.startPoint);
53724
- item.applyEndPoint(itemData.endPoint);
53738
+ const { item: item2, itemData } = createdConnectors[key];
53739
+ item2.applyStartPoint(itemData.startPoint);
53740
+ item2.applyEndPoint(itemData.endPoint);
53725
53741
  }
53726
53742
  for (const key in createdFrames) {
53727
- const { item, itemData } = createdFrames[key];
53728
- item.applyAddChildren(itemData.children);
53743
+ const { item: item2, itemData } = createdFrames[key];
53744
+ item2.applyAddChildren(itemData.children);
53729
53745
  }
53730
53746
  this.events?.log.deserialize(events);
53731
53747
  }
@@ -53963,7 +53979,7 @@ class Board {
53963
53979
  itemsMap: newMap,
53964
53980
  select: select2
53965
53981
  });
53966
- const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
53982
+ const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item2) => typeof item2 !== "undefined");
53967
53983
  this.handleNesting(items);
53968
53984
  this.selection.removeAll();
53969
53985
  this.selection.add(items);
@@ -53971,8 +53987,8 @@ class Board {
53971
53987
  return;
53972
53988
  }
53973
53989
  removeVoidComments() {
53974
- const voidComments = this.items.listAll().filter((item) => {
53975
- return item instanceof Comment && !item.getThread().length;
53990
+ const voidComments = this.items.listAll().filter((item2) => {
53991
+ return item2 instanceof Comment && !item2.getThread().length;
53976
53992
  });
53977
53993
  if (voidComments) {
53978
53994
  for (const comment2 of voidComments) {
@@ -54046,7 +54062,7 @@ class Board {
54046
54062
  }
54047
54063
  const mbr = this.selection.getMbr();
54048
54064
  const selectedItems = this.selection.items.list();
54049
- const isSelectedItemsMinWidth = selectedItems.some((item) => item.getMbr().getWidth() === 0);
54065
+ const isSelectedItemsMinWidth = selectedItems.some((item2) => item2.getMbr().getWidth() === 0);
54050
54066
  const right = mbr ? mbr.right : 0;
54051
54067
  const top = mbr ? mbr.top : 0;
54052
54068
  const width2 = mbr ? mbr.getWidth() / 10 : 10;
@@ -54088,7 +54104,7 @@ class Board {
54088
54104
  method: "duplicate",
54089
54105
  itemsMap: newMap
54090
54106
  });
54091
- const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
54107
+ const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item2) => typeof item2 !== "undefined");
54092
54108
  this.handleNesting(items);
54093
54109
  this.selection.removeAll();
54094
54110
  this.selection.add(items);
@@ -54109,9 +54125,9 @@ class Board {
54109
54125
  if (data.itemType === "Frame") {
54110
54126
  data.text.placeholderText = `Frame ${this.getMaxFrameSerial() + 1}`;
54111
54127
  }
54112
- const item = this.createItem(itemId, data);
54113
- this.index.insert(item);
54114
- items.push(item);
54128
+ const item2 = this.createItem(itemId, data);
54129
+ this.index.insert(item2);
54130
+ items.push(item2);
54115
54131
  };
54116
54132
  sortedItemsMap.map(([id, data]) => {
54117
54133
  if (data.itemType === "Connector") {
@@ -54126,8 +54142,8 @@ class Board {
54126
54142
  return;
54127
54143
  });
54128
54144
  }
54129
- isOnBoard(item) {
54130
- return this.items.findById(item.getId()) !== undefined;
54145
+ isOnBoard(item2) {
54146
+ return this.items.findById(item2.getId()) !== undefined;
54131
54147
  }
54132
54148
  getMaxFrameSerial() {
54133
54149
  const existingNames = this.items.listGroupItems().map((frame) => frame.getRichText()?.getTextString().length === 0 ? frame.getRichText()?.placeholderText || "" : frame.getRichText()?.getTextString() || "");
@@ -54173,7 +54189,7 @@ function areItemsTheSame(opA, opB) {
54173
54189
  const itemsB = Object.keys(opB.items);
54174
54190
  const setA = new Set(itemsA);
54175
54191
  const setB = new Set(itemsB);
54176
- const areArraysEqual = setA.size === setB.size && [...setA].every((item) => setB.has(item));
54192
+ const areArraysEqual = setA.size === setB.size && [...setA].every((item2) => setB.has(item2));
54177
54193
  return areArraysEqual;
54178
54194
  }
54179
54195
  if (!(Array.isArray(opA.item) && Array.isArray(opB.item))) {
@@ -55832,9 +55848,9 @@ function insertEventsFromOtherConnectionsIntoList(value, list6, board) {
55832
55848
  list6.applyUnconfirmed(filter);
55833
55849
  const hasAnyOverlap = (arr1, arr2) => {
55834
55850
  const lookup9 = new Set(arr1);
55835
- return arr2.some((item) => lookup9.has(item));
55851
+ return arr2.some((item2) => lookup9.has(item2));
55836
55852
  };
55837
- const currSelection = board.selection.list().map((item) => item.getId());
55853
+ const currSelection = board.selection.list().map((item2) => item2.getId());
55838
55854
  if (hasAnyOverlap(currSelection, createdItems) || hasAnyOverlap(currSelection, updatedText)) {
55839
55855
  board.selection.applyMemoizedCaretOrRange();
55840
55856
  }
@@ -56156,27 +56172,27 @@ function handleAiChatMassage(message, board) {
56156
56172
  }
56157
56173
  }
56158
56174
  function handleChatChunk(chunk, board) {
56159
- const item = board.items.getById(chunk.itemId);
56175
+ const item2 = board.items.getById(chunk.itemId);
56160
56176
  switch (chunk.type) {
56161
56177
  case "chunk":
56162
- if (!item || item.itemType !== "AINode") {
56178
+ if (!item2 || item2.itemType !== "AINode") {
56163
56179
  return;
56164
56180
  }
56165
- item.getRichText()?.editor.markdownProcessor.processMarkdown(chunk.content || "");
56181
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown(chunk.content || "");
56166
56182
  break;
56167
56183
  case "done":
56168
- if (!item || item.itemType !== "AINode") {
56184
+ if (!item2 || item2.itemType !== "AINode") {
56169
56185
  board.aiGeneratingOnItem = undefined;
56170
56186
  return;
56171
56187
  }
56172
- item.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
56188
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
56173
56189
  break;
56174
56190
  case "end":
56175
- if (!item || item.itemType !== "AINode") {
56191
+ if (!item2 || item2.itemType !== "AINode") {
56176
56192
  board.aiGeneratingOnItem = undefined;
56177
56193
  return;
56178
56194
  }
56179
- item.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
56195
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
56180
56196
  break;
56181
56197
  case "error":
56182
56198
  default:
@@ -56193,7 +56209,7 @@ function handleChatChunk(chunk, board) {
56193
56209
  if (board.aiGeneratingOnItem && generatingItem) {
56194
56210
  board.selection.removeAll();
56195
56211
  board.selection.add(generatingItem);
56196
- const rt = item?.getRichText();
56212
+ const rt = item2?.getRichText();
56197
56213
  if (generatingItem.itemType === "AINode" && rt) {
56198
56214
  const editor = rt.editor;
56199
56215
  editor.markdownProcessor.setStopProcessingMarkDownCb(null);
@@ -56326,14 +56342,14 @@ function handleImageGenerate(response, board) {
56326
56342
  console.error("Image generation error:", response.message);
56327
56343
  if (response.isExternalApiError) {
56328
56344
  if (board.aiGeneratingOnItem) {
56329
- const item = board.items.getById(board.aiGeneratingOnItem);
56330
- if (item) {
56345
+ const item2 = board.items.getById(board.aiGeneratingOnItem);
56346
+ if (item2) {
56331
56347
  board.selection.removeAll();
56332
- board.selection.add(item);
56333
- const editor = item.getRichText()?.editor;
56348
+ board.selection.add(item2);
56349
+ const editor = item2.getRichText()?.editor;
56334
56350
  editor?.clearText();
56335
56351
  editor?.insertCopiedText(conf.i18n.t("AIInput.nodeErrorText"));
56336
- board.camera.zoomToFit(item.getMbr(), 20);
56352
+ board.camera.zoomToFit(item2.getMbr(), 20);
56337
56353
  }
56338
56354
  }
56339
56355
  } else {