DaniGoua commited on
Commit
5563d55
·
verified ·
1 Parent(s): 91440dd

Add 1 files

Browse files
Files changed (1) hide show
  1. index.html +279 -39
index.html CHANGED
@@ -11,6 +11,7 @@
11
  height: 500px;
12
  overflow-y: auto;
13
  border: 1px solid #e5e7eb;
 
14
  }
15
  .chat-container {
16
  height: 400px;
@@ -34,10 +35,40 @@
34
  border: 2px dashed rgba(59, 130, 246, 0.5);
35
  background-color: rgba(59, 130, 246, 0.2);
36
  z-index: 10;
 
37
  }
38
  #zoneCreator {
39
  position: relative;
40
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  </style>
42
  </head>
43
  <body class="bg-gray-50">
@@ -97,32 +128,54 @@
97
  <!-- Zone Creator (hidden by default) -->
98
  <div id="zoneCreator" class="hidden bg-white rounded-lg shadow p-4 mb-6">
99
  <h2 class="text-xl font-semibold mb-4 text-blue-700">Définition des Zones de Contrôle</h2>
100
- <div class="mb-4">
101
- <label class="block text-sm font-medium text-gray-700 mb-1">Type de document</label>
102
- <select id="docType" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md">
103
- <option value="lettre">Lettre du Président</option>
104
- <option value="lexique">Lexique</option>
105
- <option value="attestation_alloc">Attestation Fiscale Allocataire</option>
106
- <option value="attestation_cotis">Attestation Fiscale Cotisant</option>
107
- <option value="releve">Relevé de Situation</option>
108
- <option value="contact">Page de Contact</option>
109
- </select>
110
- </div>
111
- <div class="mb-4">
112
- <label class="block text-sm font-medium text-gray-700 mb-1">Nom de la zone</label>
113
- <input type="text" id="zoneName" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
114
- </div>
115
- <div class="mb-4">
116
- <label class="block text-sm font-medium text-gray-700 mb-1">Page</label>
117
- <input type="number" id="zonePage" min="1" value="1" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
118
- </div>
119
- <div class="flex space-x-4">
120
- <button id="saveZoneBtn" class="bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-4 rounded">
121
- Enregistrer la zone
122
- </button>
123
- <button id="cancelZoneBtn" class="bg-gray-600 hover:bg-gray-700 text-white font-medium py-2 px-4 rounded">
124
- Annuler
125
- </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  </div>
127
  </div>
128
 
@@ -198,6 +251,10 @@
198
  let chatHistory = [];
199
  let detectedAnomalies = [];
200
  let detectedDocTypes = [];
 
 
 
 
201
 
202
  // DOM elements
203
  const referenceFileInput = document.getElementById('referenceFile');
@@ -369,6 +426,16 @@
369
  startX = e.clientX - rect.left;
370
  startY = e.clientY - rect.top;
371
 
 
 
 
 
 
 
 
 
 
 
372
  // Remove any existing temporary zone
373
  if (currentZone) {
374
  currentZone.remove();
@@ -386,13 +453,53 @@
386
  document.getElementById('referenceViewer').appendChild(currentZone);
387
  }
388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  function drawZone(e) {
390
- if (!isCreatingZone || !currentZone) return;
391
 
392
  const rect = referenceCanvas.getBoundingClientRect();
393
  const currentX = e.clientX - rect.left;
394
  const currentY = e.clientY - rect.top;
395
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  const width = currentX - startX;
397
  const height = currentY - startY;
398
 
@@ -408,16 +515,62 @@
408
  }
409
 
410
  function endZoneDrawing() {
411
- if (!isCreatingZone || !currentZone) return;
 
 
 
 
 
 
 
 
 
 
 
412
 
413
  // Clean up event listeners
414
  referenceCanvas.removeEventListener('mousemove', drawZone);
415
  referenceCanvas.removeEventListener('mouseup', endZoneDrawing);
416
  }
417
 
418
- function saveZone() {
419
  if (!currentZone) return;
420
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
  const rect = currentZone.getBoundingClientRect();
422
  const canvasRect = referenceCanvas.getBoundingClientRect();
423
 
@@ -427,9 +580,20 @@
427
  const width = rect.width;
428
  const height = rect.height;
429
 
 
 
 
 
 
 
 
 
 
 
 
430
  const zone = {
431
  type: docTypeSelect.value,
432
- name: zoneNameInput.value || 'Zone sans nom',
433
  page: parseInt(zonePageInput.value),
434
  x: x,
435
  y: y,
@@ -440,18 +604,21 @@
440
  referenceZones.push(zone);
441
 
442
  // Clean up
443
- currentZone.remove();
444
- currentZone = null;
 
 
445
  isCreatingZone = false;
446
 
447
  // Reset UI
448
  referenceCanvas.style.cursor = 'default';
449
- zoneCreator.classList.add('hidden');
450
- defineZonesBtn.classList.remove('hidden');
451
 
452
  // Display saved zones
453
  displayZonesForPage(parseInt(zonePageInput.value));
454
 
 
 
 
455
  addChatMessage("Système", `Zone "${zone.name}" enregistrée pour le type "${docTypeSelect.options[docTypeSelect.selectedIndex].text}".`);
456
  }
457
 
@@ -462,36 +629,106 @@
462
  }
463
 
464
  isCreatingZone = false;
 
 
465
  referenceCanvas.style.cursor = 'default';
466
  zoneCreator.classList.add('hidden');
467
  defineZonesBtn.classList.remove('hidden');
468
 
 
 
 
 
 
469
  addChatMessage("Système", "Création de zone annulée.");
470
  }
471
 
472
  function displayZonesForPage(pageNum) {
473
- // Remove all existing zone displays
474
  document.querySelectorAll('.control-zone').forEach(zone => {
475
  if (zone !== currentZone) zone.remove();
476
  });
477
 
 
 
 
 
 
478
  // Display zones for this page
479
- referenceZones.filter(zone => zone.page === pageNum).forEach(zone => {
480
  const zoneElement = document.createElement('div');
481
  zoneElement.className = 'control-zone';
482
  zoneElement.style.left = zone.x + 'px';
483
  zoneElement.style.top = zone.y + 'px';
484
  zoneElement.style.width = zone.width + 'px';
485
  zoneElement.style.height = zone.height + 'px';
486
- zoneElement.title = `${zone.name} (${zone.type})`;
 
 
 
 
 
 
 
 
 
 
 
 
487
 
488
  document.getElementById('referenceViewer').appendChild(zoneElement);
 
 
 
 
 
 
 
 
 
 
 
489
  });
490
  }
491
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  async function startControlProcess() {
493
- if (!referencePdf || !controlPdf || referenceZones.length === 0) {
494
- addChatMessage("Erreur", "Veuillez charger les deux documents et définir des zones de contrôle avant de lancer le processus.");
 
 
 
 
 
495
  return;
496
  }
497
 
@@ -733,6 +970,8 @@
733
  currentZone = null;
734
  }
735
  isCreatingZone = false;
 
 
736
  referenceCanvas.style.cursor = 'default';
737
  zoneCreator.classList.add('hidden');
738
  defineZonesBtn.classList.add('hidden');
@@ -740,6 +979,7 @@
740
  // Clear zones
741
  referenceZones = [];
742
  document.querySelectorAll('.control-zone').forEach(zone => zone.remove());
 
743
 
744
  // Reset results
745
  detectedAnomalies = [];
 
11
  height: 500px;
12
  overflow-y: auto;
13
  border: 1px solid #e5e7eb;
14
+ position: relative;
15
  }
16
  .chat-container {
17
  height: 400px;
 
35
  border: 2px dashed rgba(59, 130, 246, 0.5);
36
  background-color: rgba(59, 130, 246, 0.2);
37
  z-index: 10;
38
+ cursor: move;
39
  }
40
  #zoneCreator {
41
  position: relative;
42
  }
43
+ .zone-tooltip {
44
+ position: absolute;
45
+ background: white;
46
+ padding: 5px;
47
+ border-radius: 4px;
48
+ box-shadow: 0 2px 5px rgba(0,0,0,0.2);
49
+ z-index: 20;
50
+ font-size: 12px;
51
+ pointer-events: none;
52
+ }
53
+ .zone-actions {
54
+ position: absolute;
55
+ top: -25px;
56
+ right: 0;
57
+ display: flex;
58
+ gap: 5px;
59
+ }
60
+ .zone-action-btn {
61
+ background: white;
62
+ border: 1px solid #e5e7eb;
63
+ border-radius: 4px;
64
+ width: 20px;
65
+ height: 20px;
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ cursor: pointer;
70
+ font-size: 12px;
71
+ }
72
  </style>
73
  </head>
74
  <body class="bg-gray-50">
 
128
  <!-- Zone Creator (hidden by default) -->
129
  <div id="zoneCreator" class="hidden bg-white rounded-lg shadow p-4 mb-6">
130
  <h2 class="text-xl font-semibold mb-4 text-blue-700">Définition des Zones de Contrôle</h2>
131
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
132
+ <div>
133
+ <div class="mb-4">
134
+ <label class="block text-sm font-medium text-gray-700 mb-1">Type de document</label>
135
+ <select id="docType" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md">
136
+ <option value="lettre">Lettre du Président</option>
137
+ <option value="lexique">Lexique</option>
138
+ <option value="attestation_alloc">Attestation Fiscale Allocataire</option>
139
+ <option value="attestation_cotis">Attestation Fiscale Cotisant</option>
140
+ <option value="releve">Relevé de Situation</option>
141
+ <option value="contact">Page de Contact</option>
142
+ </select>
143
+ </div>
144
+ <div class="mb-4">
145
+ <label class="block text-sm font-medium text-gray-700 mb-1">Nom de la zone</label>
146
+ <input type="text" id="zoneName" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm" placeholder="Ex: En-tête, Logo, Adresse...">
147
+ </div>
148
+ <div class="mb-4">
149
+ <label class="block text-sm font-medium text-gray-700 mb-1">Page</label>
150
+ <input type="number" id="zonePage" min="1" value="1" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
151
+ </div>
152
+ <div class="flex space-x-4">
153
+ <button id="saveZoneBtn" class="bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-4 rounded">
154
+ Enregistrer la zone
155
+ </button>
156
+ <button id="cancelZoneBtn" class="bg-gray-600 hover:bg-gray-700 text-white font-medium py-2 px-4 rounded">
157
+ Annuler
158
+ </button>
159
+ </div>
160
+ </div>
161
+ <div class="bg-gray-50 p-4 rounded-lg">
162
+ <h3 class="font-medium text-gray-800 mb-3">Instructions</h3>
163
+ <ol class="list-decimal list-inside text-sm text-gray-700 space-y-2">
164
+ <li>Cliquez et glissez pour dessiner une zone sur le document de référence</li>
165
+ <li>Ajustez la taille et la position si nécessaire</li>
166
+ <li>Remplissez les informations sur la zone (type, nom, page)</li>
167
+ <li>Cliquez sur "Enregistrer la zone" pour la sauvegarder</li>
168
+ <li>Répétez pour toutes les zones à contrôler</li>
169
+ </ol>
170
+ <div class="mt-4 p-3 bg-blue-50 rounded-lg">
171
+ <h4 class="font-medium text-blue-800 mb-2">Conseils :</h4>
172
+ <ul class="list-disc list-inside text-sm text-blue-700 space-y-1">
173
+ <li>Nommez clairement vos zones pour les retrouver facilement</li>
174
+ <li>Créez des zones suffisamment larges pour couvrir le texte</li>
175
+ <li>Vérifiez que la page indiquée correspond bien à la zone</li>
176
+ </ul>
177
+ </div>
178
+ </div>
179
  </div>
180
  </div>
181
 
 
251
  let chatHistory = [];
252
  let detectedAnomalies = [];
253
  let detectedDocTypes = [];
254
+ let activeZoneIndex = -1;
255
+ let isDraggingZone = false;
256
+ let dragOffsetX = 0;
257
+ let dragOffsetY = 0;
258
 
259
  // DOM elements
260
  const referenceFileInput = document.getElementById('referenceFile');
 
426
  startX = e.clientX - rect.left;
427
  startY = e.clientY - rect.top;
428
 
429
+ // Check if we're clicking on an existing zone
430
+ const existingZone = findZoneAtPosition(startX, startY);
431
+ if (existingZone) {
432
+ activeZoneIndex = existingZone.index;
433
+ isDraggingZone = true;
434
+ dragOffsetX = startX - existingZone.zone.x;
435
+ dragOffsetY = startY - existingZone.zone.y;
436
+ return;
437
+ }
438
+
439
  // Remove any existing temporary zone
440
  if (currentZone) {
441
  currentZone.remove();
 
453
  document.getElementById('referenceViewer').appendChild(currentZone);
454
  }
455
 
456
+ function findZoneAtPosition(x, y) {
457
+ const zones = document.querySelectorAll('.control-zone');
458
+ for (let i = 0; i < zones.length; i++) {
459
+ const zone = zones[i];
460
+ const zoneRect = zone.getBoundingClientRect();
461
+ const canvasRect = referenceCanvas.getBoundingClientRect();
462
+
463
+ const zoneX = zoneRect.left - canvasRect.left;
464
+ const zoneY = zoneRect.top - canvasRect.top;
465
+ const zoneWidth = zoneRect.width;
466
+ const zoneHeight = zoneRect.height;
467
+
468
+ if (x >= zoneX && x <= zoneX + zoneWidth && y >= zoneY && y <= zoneY + zoneHeight) {
469
+ // Find the corresponding zone in our referenceZones array
470
+ for (let j = 0; j < referenceZones.length; j++) {
471
+ if (Math.abs(referenceZones[j].x - zoneX) < 5 &&
472
+ Math.abs(referenceZones[j].y - zoneY) < 5 &&
473
+ Math.abs(referenceZones[j].width - zoneWidth) < 5 &&
474
+ Math.abs(referenceZones[j].height - zoneHeight) < 5) {
475
+ return { index: j, zone: referenceZones[j] };
476
+ }
477
+ }
478
+ }
479
+ }
480
+ return null;
481
+ }
482
+
483
  function drawZone(e) {
484
+ if (!isCreatingZone) return;
485
 
486
  const rect = referenceCanvas.getBoundingClientRect();
487
  const currentX = e.clientX - rect.left;
488
  const currentY = e.clientY - rect.top;
489
 
490
+ if (isDraggingZone && activeZoneIndex >= 0) {
491
+ // Update zone position
492
+ const zone = referenceZones[activeZoneIndex];
493
+ zone.x = currentX - dragOffsetX;
494
+ zone.y = currentY - dragOffsetY;
495
+
496
+ // Update zone display
497
+ displayZonesForPage(parseInt(refCurrentPage.textContent));
498
+ return;
499
+ }
500
+
501
+ if (!currentZone) return;
502
+
503
  const width = currentX - startX;
504
  const height = currentY - startY;
505
 
 
515
  }
516
 
517
  function endZoneDrawing() {
518
+ if (!isCreatingZone) return;
519
+
520
+ if (isDraggingZone) {
521
+ isDraggingZone = false;
522
+ activeZoneIndex = -1;
523
+ return;
524
+ }
525
+
526
+ if (currentZone) {
527
+ // Show zone info tooltip
528
+ showZoneInfoTooltip();
529
+ }
530
 
531
  // Clean up event listeners
532
  referenceCanvas.removeEventListener('mousemove', drawZone);
533
  referenceCanvas.removeEventListener('mouseup', endZoneDrawing);
534
  }
535
 
536
+ function showZoneInfoTooltip() {
537
  if (!currentZone) return;
538
 
539
+ const tooltip = document.createElement('div');
540
+ tooltip.className = 'zone-tooltip';
541
+ tooltip.innerHTML = `
542
+ <div class="font-medium mb-1">Nouvelle zone</div>
543
+ <div class="text-xs">Remplissez les détails à droite</div>
544
+ `;
545
+
546
+ const rect = currentZone.getBoundingClientRect();
547
+ tooltip.style.left = (rect.left + rect.width/2 - 75) + 'px';
548
+ tooltip.style.top = (rect.top - 60) + 'px';
549
+
550
+ document.body.appendChild(tooltip);
551
+
552
+ // Remove tooltip after 3 seconds or when user starts interacting
553
+ setTimeout(() => {
554
+ if (tooltip.parentNode) {
555
+ tooltip.parentNode.removeChild(tooltip);
556
+ }
557
+ }, 3000);
558
+
559
+ // Also remove when user clicks anywhere
560
+ document.addEventListener('click', function removeTooltip() {
561
+ if (tooltip.parentNode) {
562
+ tooltip.parentNode.removeChild(tooltip);
563
+ }
564
+ document.removeEventListener('click', removeTooltip);
565
+ }, { once: true });
566
+ }
567
+
568
+ function saveZone() {
569
+ if (!currentZone) {
570
+ addChatMessage("Erreur", "Veuillez d'abord créer une zone en cliquant et glissant sur le document.");
571
+ return;
572
+ }
573
+
574
  const rect = currentZone.getBoundingClientRect();
575
  const canvasRect = referenceCanvas.getBoundingClientRect();
576
 
 
580
  const width = rect.width;
581
  const height = rect.height;
582
 
583
+ if (width < 10 || height < 10) {
584
+ addChatMessage("Erreur", "La zone est trop petite. Veuillez créer une zone plus grande.");
585
+ return;
586
+ }
587
+
588
+ if (!zoneNameInput.value.trim()) {
589
+ addChatMessage("Erreur", "Veuillez donner un nom à la zone.");
590
+ zoneNameInput.focus();
591
+ return;
592
+ }
593
+
594
  const zone = {
595
  type: docTypeSelect.value,
596
+ name: zoneNameInput.value.trim(),
597
  page: parseInt(zonePageInput.value),
598
  x: x,
599
  y: y,
 
604
  referenceZones.push(zone);
605
 
606
  // Clean up
607
+ if (currentZone) {
608
+ currentZone.remove();
609
+ currentZone = null;
610
+ }
611
  isCreatingZone = false;
612
 
613
  // Reset UI
614
  referenceCanvas.style.cursor = 'default';
 
 
615
 
616
  // Display saved zones
617
  displayZonesForPage(parseInt(zonePageInput.value));
618
 
619
+ // Reset form
620
+ zoneNameInput.value = '';
621
+
622
  addChatMessage("Système", `Zone "${zone.name}" enregistrée pour le type "${docTypeSelect.options[docTypeSelect.selectedIndex].text}".`);
623
  }
624
 
 
629
  }
630
 
631
  isCreatingZone = false;
632
+ isDraggingZone = false;
633
+ activeZoneIndex = -1;
634
  referenceCanvas.style.cursor = 'default';
635
  zoneCreator.classList.add('hidden');
636
  defineZonesBtn.classList.remove('hidden');
637
 
638
+ // Re-enable zone creation mode if there are zones to edit
639
+ if (referenceZones.length > 0) {
640
+ defineZonesBtn.click();
641
+ }
642
+
643
  addChatMessage("Système", "Création de zone annulée.");
644
  }
645
 
646
  function displayZonesForPage(pageNum) {
647
+ // Remove all existing zone displays except the current one being created
648
  document.querySelectorAll('.control-zone').forEach(zone => {
649
  if (zone !== currentZone) zone.remove();
650
  });
651
 
652
+ // Remove all zone action buttons
653
+ document.querySelectorAll('.zone-actions').forEach(actions => {
654
+ actions.remove();
655
+ });
656
+
657
  // Display zones for this page
658
+ referenceZones.filter(zone => zone.page === pageNum).forEach((zone, index) => {
659
  const zoneElement = document.createElement('div');
660
  zoneElement.className = 'control-zone';
661
  zoneElement.style.left = zone.x + 'px';
662
  zoneElement.style.top = zone.y + 'px';
663
  zoneElement.style.width = zone.width + 'px';
664
  zoneElement.style.height = zone.height + 'px';
665
+ zoneElement.dataset.index = index;
666
+
667
+ // Add actions buttons
668
+ const actions = document.createElement('div');
669
+ actions.className = 'zone-actions';
670
+ actions.innerHTML = `
671
+ <button class="zone-action-btn edit-zone" title="Modifier">✏️</button>
672
+ <button class="zone-action-btn delete-zone" title="Supprimer">🗑️</button>
673
+ `;
674
+ zoneElement.appendChild(actions);
675
+
676
+ // Position actions
677
+ actions.style.left = (zone.width - actions.offsetWidth) + 'px';
678
 
679
  document.getElementById('referenceViewer').appendChild(zoneElement);
680
+
681
+ // Add event listeners to action buttons
682
+ zoneElement.querySelector('.edit-zone').addEventListener('click', (e) => {
683
+ e.stopPropagation();
684
+ editZone(index);
685
+ });
686
+
687
+ zoneElement.querySelector('.delete-zone').addEventListener('click', (e) => {
688
+ e.stopPropagation();
689
+ deleteZone(index);
690
+ });
691
  });
692
  }
693
 
694
+ function editZone(index) {
695
+ const zone = referenceZones[index];
696
+
697
+ // Fill the form with zone data
698
+ docTypeSelect.value = zone.type;
699
+ zoneNameInput.value = zone.name;
700
+ zonePageInput.value = zone.page;
701
+
702
+ // Highlight the zone
703
+ document.querySelectorAll('.control-zone').forEach(z => {
704
+ z.style.borderColor = 'rgba(59, 130, 246, 0.5)';
705
+ });
706
+
707
+ const zoneElement = document.querySelector(`.control-zone[data-index="${index}"]`);
708
+ if (zoneElement) {
709
+ zoneElement.style.borderColor = 'rgba(255, 165, 0, 0.8)';
710
+ }
711
+
712
+ addChatMessage("Système", `Modification de la zone "${zone.name}". Vous pouvez ajuster ses propriétés ou la déplacer directement sur le document.`);
713
+ }
714
+
715
+ function deleteZone(index) {
716
+ const zoneName = referenceZones[index].name;
717
+ if (confirm(`Voulez-vous vraiment supprimer la zone "${zoneName}" ?`)) {
718
+ referenceZones.splice(index, 1);
719
+ displayZonesForPage(parseInt(refCurrentPage.textContent));
720
+ addChatMessage("Système", `Zone "${zoneName}" supprimée.`);
721
+ }
722
+ }
723
+
724
  async function startControlProcess() {
725
+ if (!referencePdf || !controlPdf) {
726
+ addChatMessage("Erreur", "Veuillez charger les deux documents avant de lancer le processus.");
727
+ return;
728
+ }
729
+
730
+ if (referenceZones.length === 0) {
731
+ addChatMessage("Erreur", "Veuillez définir des zones de contrôle avant de lancer le processus.");
732
  return;
733
  }
734
 
 
970
  currentZone = null;
971
  }
972
  isCreatingZone = false;
973
+ isDraggingZone = false;
974
+ activeZoneIndex = -1;
975
  referenceCanvas.style.cursor = 'default';
976
  zoneCreator.classList.add('hidden');
977
  defineZonesBtn.classList.add('hidden');
 
979
  // Clear zones
980
  referenceZones = [];
981
  document.querySelectorAll('.control-zone').forEach(zone => zone.remove());
982
+ document.querySelectorAll('.zone-actions').forEach(actions => actions.remove());
983
 
984
  // Reset results
985
  detectedAnomalies = [];