luis-poe commited on
Commit
a41e33b
·
verified ·
1 Parent(s): caf198d

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +953 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Tendextraction
3
- emoji: 💻
4
- colorFrom: indigo
5
- colorTo: pink
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: tendextraction
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: yellow
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,953 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Tender RfP Extraction Tool</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .tab-content {
11
+ display: none;
12
+ }
13
+ .tab-content.active {
14
+ display: block;
15
+ animation: fadeIn 0.3s ease-in-out;
16
+ }
17
+ @keyframes fadeIn {
18
+ from { opacity: 0; transform: translateY(10px); }
19
+ to { opacity: 1; transform: translateY(0); }
20
+ }
21
+ .file-drop-area {
22
+ border: 2px dashed #3b82f6;
23
+ border-radius: 0.5rem;
24
+ transition: all 0.2s ease;
25
+ }
26
+ .file-drop-area.active {
27
+ border-color: #10b981;
28
+ background-color: #f0fdf4;
29
+ }
30
+ .progress-bar {
31
+ transition: width 0.3s ease;
32
+ }
33
+ .json-viewer {
34
+ font-family: monospace;
35
+ white-space: pre;
36
+ overflow-x: auto;
37
+ }
38
+ .highlight {
39
+ background-color: #fef08a;
40
+ padding: 0.2rem;
41
+ border-radius: 0.2rem;
42
+ }
43
+ </style>
44
+ </head>
45
+ <body class="bg-gray-50 min-h-screen">
46
+ <div class="container mx-auto px-4 py-8">
47
+ <header class="mb-8">
48
+ <div class="flex items-center justify-between">
49
+ <div>
50
+ <h1 class="text-3xl font-bold text-gray-800">Tender RfP Extraction Tool</h1>
51
+ <p class="text-gray-600">Extract structured information from Excel and PDF tender documents</p>
52
+ </div>
53
+ <div class="flex items-center space-x-4">
54
+ <div class="bg-blue-100 text-blue-800 px-4 py-2 rounded-full flex items-center">
55
+ <i class="fas fa-cloud mr-2"></i>
56
+ <span>Connected to Azure AI</span>
57
+ </div>
58
+ <button class="bg-gray-200 hover:bg-gray-300 px-4 py-2 rounded-full flex items-center">
59
+ <i class="fas fa-cog mr-2"></i>
60
+ <span>Settings</span>
61
+ </button>
62
+ </div>
63
+ </div>
64
+ </header>
65
+
66
+ <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
67
+ <div class="border-b border-gray-200">
68
+ <nav class="flex -mb-px">
69
+ <button class="tab-btn py-4 px-6 text-center border-b-2 font-medium text-sm border-blue-500 text-blue-600" data-tab="extraction">
70
+ <i class="fas fa-file-import mr-2"></i>Document Extraction
71
+ </button>
72
+ <button class="tab-btn py-4 px-6 text-center border-b-2 font-medium text-sm border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300" data-tab="results">
73
+ <i class="fas fa-database mr-2"></i>Extraction Results
74
+ </button>
75
+ <button class="tab-btn py-4 px-6 text-center border-b-2 font-medium text-sm border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300" data-tab="llm-config">
76
+ <i class="fas fa-brain mr-2"></i>LLM Configuration
77
+ </button>
78
+ <button class="tab-btn py-4 px-6 text-center border-b-2 font-medium text-sm border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300" data-tab="history">
79
+ <i class="fas fa-history mr-2"></i>Processing History
80
+ </button>
81
+ </nav>
82
+ </div>
83
+
84
+ <!-- Document Extraction Tab -->
85
+ <div id="extraction" class="tab-content active p-6">
86
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
87
+ <div>
88
+ <h2 class="text-xl font-semibold mb-4 text-gray-800">Upload Documents</h2>
89
+ <div class="file-drop-area p-8 text-center mb-6" id="dropArea">
90
+ <i class="fas fa-cloud-upload-alt text-4xl text-blue-500 mb-4"></i>
91
+ <p class="text-gray-600 mb-2">Drag & drop your Excel and PDF files here</p>
92
+ <p class="text-sm text-gray-500 mb-4">or</p>
93
+ <input type="file" id="fileInput" class="hidden" multiple accept=".xlsx,.xls,.pdf">
94
+ <label for="fileInput" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-full cursor-pointer inline-block">
95
+ <i class="fas fa-folder-open mr-2"></i>Browse Files
96
+ </label>
97
+ </div>
98
+
99
+ <div class="mb-6">
100
+ <h3 class="font-medium text-gray-700 mb-2">Selected Files</h3>
101
+ <div class="border rounded-lg overflow-hidden">
102
+ <div class="divide-y divide-gray-200 max-h-60 overflow-y-auto" id="fileList">
103
+ <div class="p-3 text-sm text-gray-500 italic">No files selected</div>
104
+ </div>
105
+ </div>
106
+ </div>
107
+
108
+ <div class="flex justify-end">
109
+ <button id="clearFiles" class="text-gray-500 hover:text-gray-700 mr-4">
110
+ <i class="fas fa-trash-alt mr-1"></i>Clear All
111
+ </button>
112
+ <button id="uploadBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-full disabled:opacity-50" disabled>
113
+ <i class="fas fa-upload mr-2"></i>Upload & Process
114
+ </button>
115
+ </div>
116
+ </div>
117
+
118
+ <div>
119
+ <h2 class="text-xl font-semibold mb-4 text-gray-800">Processing Options</h2>
120
+ <div class="bg-gray-50 p-6 rounded-lg mb-6">
121
+ <div class="mb-4">
122
+ <label class="block text-gray-700 font-medium mb-2">Target Format</label>
123
+ <select class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-blue-500 focus:border-blue-500">
124
+ <option>Construction Tender v1.0</option>
125
+ <option>Electrical Tender v2.1</option>
126
+ <option>Mechanical Tender v1.5</option>
127
+ <option selected>Custom Format</option>
128
+ </select>
129
+ </div>
130
+
131
+ <div class="mb-4">
132
+ <label class="block text-gray-700 font-medium mb-2">Mapping Template</label>
133
+ <div class="flex items-center">
134
+ <select class="flex-1 border border-gray-300 rounded-lg px-4 py-2 focus:ring-blue-500 focus:border-blue-500 mr-2">
135
+ <option>Default Mapping</option>
136
+ <option>Advanced Technical Mapping</option>
137
+ <option selected>Custom Mapping</option>
138
+ </select>
139
+ <button class="bg-gray-200 hover:bg-gray-300 px-4 py-2 rounded-lg">
140
+ <i class="fas fa-edit"></i>
141
+ </button>
142
+ </div>
143
+ </div>
144
+
145
+ <div class="mb-4">
146
+ <label class="flex items-center">
147
+ <input type="checkbox" class="rounded text-blue-600 focus:ring-blue-500" checked>
148
+ <span class="ml-2 text-gray-700">Extract technical drawings from PDF</span>
149
+ </label>
150
+ </div>
151
+
152
+ <div class="mb-4">
153
+ <label class="flex items-center">
154
+ <input type="checkbox" class="rounded text-blue-600 focus:ring-blue-500" checked>
155
+ <span class="ml-2 text-gray-700">Validate extracted data</span>
156
+ </label>
157
+ </div>
158
+
159
+ <div class="mb-4">
160
+ <label class="flex items-center">
161
+ <input type="checkbox" class="rounded text-blue-600 focus:ring-blue-500">
162
+ <span class="ml-2 text-gray-700">Cross-reference with previous tenders</span>
163
+ </label>
164
+ </div>
165
+ </div>
166
+
167
+ <div class="bg-yellow-50 border-l-4 border-yellow-400 p-4 mb-6">
168
+ <div class="flex">
169
+ <div class="flex-shrink-0">
170
+ <i class="fas fa-exclamation-circle text-yellow-500"></i>
171
+ </div>
172
+ <div class="ml-3">
173
+ <p class="text-sm text-yellow-700">
174
+ <span class="font-medium">Note:</span> For best results, upload both Excel (containing position data) and PDF (containing technical drawings) files from the same tender.
175
+ </p>
176
+ </div>
177
+ </div>
178
+ </div>
179
+ </div>
180
+ </div>
181
+ </div>
182
+
183
+ <!-- Extraction Results Tab -->
184
+ <div id="results" class="tab-content p-6">
185
+ <div class="flex justify-between items-center mb-6">
186
+ <h2 class="text-xl font-semibold text-gray-800">Extraction Results</h2>
187
+ <div class="flex space-x-2">
188
+ <button class="bg-gray-200 hover:bg-gray-300 px-4 py-2 rounded-lg">
189
+ <i class="fas fa-download mr-2"></i>Export JSON
190
+ </button>
191
+ <button class="bg-gray-200 hover:bg-gray-300 px-4 py-2 rounded-lg">
192
+ <i class="fas fa-file-excel mr-2"></i>Export Excel
193
+ </button>
194
+ <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg">
195
+ <i class="fas fa-sync-alt mr-2"></i>Refresh
196
+ </button>
197
+ </div>
198
+ </div>
199
+
200
+ <div class="bg-gray-50 p-4 rounded-lg mb-6">
201
+ <div class="flex items-center justify-between mb-2">
202
+ <div class="flex items-center">
203
+ <span class="bg-green-500 text-white text-xs px-2 py-1 rounded-full mr-2">Completed</span>
204
+ <span class="font-medium">Tender_2023_Construction_Renovation</span>
205
+ </div>
206
+ <span class="text-sm text-gray-500">Processed: 2 minutes ago</span>
207
+ </div>
208
+ <div class="grid grid-cols-3 gap-4 text-sm">
209
+ <div>
210
+ <span class="text-gray-600">Files:</span>
211
+ <span class="font-medium">3 (2 Excel, 1 PDF)</span>
212
+ </div>
213
+ <div>
214
+ <span class="text-gray-600">Entities extracted:</span>
215
+ <span class="font-medium">147</span>
216
+ </div>
217
+ <div>
218
+ <span class="text-gray-600">Confidence score:</span>
219
+ <span class="font-medium">92%</span>
220
+ </div>
221
+ </div>
222
+ </div>
223
+
224
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
225
+ <div class="lg:col-span-2">
226
+ <div class="bg-white border border-gray-200 rounded-lg overflow-hidden">
227
+ <div class="border-b border-gray-200 bg-gray-50 px-4 py-3">
228
+ <h3 class="font-medium text-gray-800">Structured Data Output</h3>
229
+ </div>
230
+ <div class="p-4">
231
+ <div class="json-viewer bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto max-h-96">
232
+ {
233
+ "tender": {
234
+ "metadata": {
235
+ "referenceNumber": "TND-2023-0456",
236
+ "title": "Office Building Renovation Project",
237
+ "publicationDate": "2023-06-15",
238
+ "deadline": "2023-07-20",
239
+ "estimatedValue": 1250000,
240
+ "currency": "EUR"
241
+ },
242
+ "positions": [
243
+ {
244
+ "id": "POS-001",
245
+ "description": "Demolition of existing interior walls",
246
+ "quantity": 320,
247
+ "unit": "sqm",
248
+ "unitPrice": 45.00,
249
+ "totalPrice": 14400.00,
250
+ "specifications": {
251
+ "material": "Existing drywall",
252
+ "disposal": "Included",
253
+ "drawingReference": "DRW-001-A"
254
+ }
255
+ },
256
+ {
257
+ "id": "POS-002",
258
+ "description": "Installation of new electrical wiring",
259
+ "quantity": 850,
260
+ "unit": "lm",
261
+ "unitPrice": 12.50,
262
+ "totalPrice": 10625.00,
263
+ "specifications": {
264
+ "cableType": "NYM-J 3x1.5mm²",
265
+ "protection": "PVC conduit",
266
+ "drawingReference": "DRW-002-B"
267
+ }
268
+ }
269
+ ],
270
+ "drawings": [
271
+ {
272
+ "reference": "DRW-001-A",
273
+ "description": "Demolition plan - Level 1",
274
+ "sourcePage": 5,
275
+ "confidenceScore": 0.94
276
+ },
277
+ {
278
+ "reference": "DRW-002-B",
279
+ "description": "Electrical installation diagram",
280
+ "sourcePage": 8,
281
+ "confidenceScore": 0.89
282
+ }
283
+ ]
284
+ }
285
+ }
286
+ </div>
287
+ </div>
288
+ </div>
289
+ </div>
290
+
291
+ <div>
292
+ <div class="bg-white border border-gray-200 rounded-lg overflow-hidden mb-6">
293
+ <div class="border-b border-gray-200 bg-gray-50 px-4 py-3">
294
+ <h3 class="font-medium text-gray-800">Extraction Statistics</h3>
295
+ </div>
296
+ <div class="p-4">
297
+ <div class="space-y-4">
298
+ <div>
299
+ <div class="flex justify-between text-sm mb-1">
300
+ <span class="text-gray-600">Excel data extraction</span>
301
+ <span class="font-medium">96%</span>
302
+ </div>
303
+ <div class="w-full bg-gray-200 rounded-full h-2">
304
+ <div class="bg-green-500 h-2 rounded-full" style="width: 96%"></div>
305
+ </div>
306
+ </div>
307
+ <div>
308
+ <div class="flex justify-between text-sm mb-1">
309
+ <span class="text-gray-600">PDF drawing extraction</span>
310
+ <span class="font-medium">89%</span>
311
+ </div>
312
+ <div class="w-full bg-gray-200 rounded-full h-2">
313
+ <div class="bg-blue-500 h-2 rounded-full" style="width: 89%"></div>
314
+ </div>
315
+ </div>
316
+ <div>
317
+ <div class="flex justify-between text-sm mb-1">
318
+ <span class="text-gray-600">Data validation</span>
319
+ <span class="font-medium">92%</span>
320
+ </div>
321
+ <div class="w-full bg-gray-200 rounded-full h-2">
322
+ <div class="bg-purple-500 h-2 rounded-full" style="width: 92%"></div>
323
+ </div>
324
+ </div>
325
+ </div>
326
+ </div>
327
+ </div>
328
+
329
+ <div class="bg-white border border-gray-200 rounded-lg overflow-hidden">
330
+ <div class="border-b border-gray-200 bg-gray-50 px-4 py-3">
331
+ <h3 class="font-medium text-gray-800">Extraction Log</h3>
332
+ </div>
333
+ <div class="p-4">
334
+ <div class="space-y-3 text-sm max-h-60 overflow-y-auto">
335
+ <div class="flex">
336
+ <div class="text-green-500 mr-2">✓</div>
337
+ <div>Successfully processed Excel file: Tender_Positions.xlsx</div>
338
+ </div>
339
+ <div class="flex">
340
+ <div class="text-green-500 mr-2">✓</div>
341
+ <div>Identified 24 position items in Excel</div>
342
+ </div>
343
+ <div class="flex">
344
+ <div class="text-green-500 mr-2">✓</div>
345
+ <div>Successfully processed PDF file: Technical_Drawings.pdf</div>
346
+ </div>
347
+ <div class="flex">
348
+ <div class="text-green-500 mr-2">✓</div>
349
+ <div>Extracted 5 technical drawings from PDF</div>
350
+ </div>
351
+ <div class="flex">
352
+ <div class="text-yellow-500 mr-2">!</div>
353
+ <div>Low confidence (72%) on drawing reference for position POS-012</div>
354
+ </div>
355
+ <div class="flex">
356
+ <div class="text-green-500 mr-2">✓</div>
357
+ <div>Cross-referenced all positions with drawings</div>
358
+ </div>
359
+ <div class="flex">
360
+ <div class="text-green-500 mr-2">✓</div>
361
+ <div>Validation completed with 92% confidence</div>
362
+ </div>
363
+ </div>
364
+ </div>
365
+ </div>
366
+ </div>
367
+ </div>
368
+ </div>
369
+
370
+ <!-- LLM Configuration Tab -->
371
+ <div id="llm-config" class="tab-content p-6">
372
+ <div class="flex justify-between items-center mb-6">
373
+ <h2 class="text-xl font-semibold text-gray-800">LLM Configuration</h2>
374
+ <div class="flex space-x-2">
375
+ <button class="bg-gray-200 hover:bg-gray-300 px-4 py-2 rounded-lg">
376
+ <i class="fas fa-save mr-2"></i>Save Configuration
377
+ </button>
378
+ <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg">
379
+ <i class="fas fa-bolt mr-2"></i>Test Configuration
380
+ </button>
381
+ </div>
382
+ </div>
383
+
384
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
385
+ <div class="lg:col-span-2">
386
+ <div class="bg-white border border-gray-200 rounded-lg overflow-hidden mb-6">
387
+ <div class="border-b border-gray-200 bg-gray-50 px-4 py-3">
388
+ <h3 class="font-medium text-gray-800">Azure AI Settings</h3>
389
+ </div>
390
+ <div class="p-4">
391
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
392
+ <div>
393
+ <label class="block text-gray-700 font-medium mb-1">Endpoint</label>
394
+ <input type="text" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-blue-500 focus:border-blue-500" value="https://your-azure-endpoint.cognitiveservices.azure.com/">
395
+ </div>
396
+ <div>
397
+ <label class="block text-gray-700 font-medium mb-1">API Key</label>
398
+ <div class="relative">
399
+ <input type="password" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-blue-500 focus:border-blue-500 pr-10" value="a1b2c3d4e5f6g7h8i9j0">
400
+ <button class="absolute right-3 top-2.5 text-gray-500 hover:text-gray-700">
401
+ <i class="far fa-eye"></i>
402
+ </button>
403
+ </div>
404
+ </div>
405
+ </div>
406
+
407
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
408
+ <div>
409
+ <label class="block text-gray-700 font-medium mb-1">Model</label>
410
+ <select class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-blue-500 focus:border-blue-500">
411
+ <option>gpt-4</option>
412
+ <option selected>gpt-4-turbo</option>
413
+ <option>gpt-3.5-turbo</option>
414
+ </select>
415
+ </div>
416
+ <div>
417
+ <label class="block text-gray-700 font-medium mb-1">Temperature</label>
418
+ <input type="range" min="0" max="1" step="0.1" value="0.3" class="w-full">
419
+ <div class="text-sm text-gray-600 text-right">0.3</div>
420
+ </div>
421
+ </div>
422
+
423
+ <div class="mb-4">
424
+ <label class="block text-gray-700 font-medium mb-1">Max Tokens</label>
425
+ <input type="number" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-blue-500 focus:border-blue-500" value="2000">
426
+ </div>
427
+
428
+ <div class="mb-4">
429
+ <label class="block text-gray-700 font-medium mb-1">System Prompt</label>
430
+ <textarea class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-blue-500 focus:border-blue-500 h-32">You are an expert tender document processor. Extract structured information from the provided documents following the specified format. Pay special attention to matching position descriptions with technical drawings from the PDF files. When in doubt, flag the item for manual review.</textarea>
431
+ </div>
432
+ </div>
433
+ </div>
434
+
435
+ <div class="bg-white border border-gray-200 rounded-lg overflow-hidden">
436
+ <div class="border-b border-gray-200 bg-gray-50 px-4 py-3">
437
+ <h3 class="font-medium text-gray-800">Target Format Mapping</h3>
438
+ </div>
439
+ <div class="p-4">
440
+ <div class="overflow-x-auto">
441
+ <table class="min-w-full divide-y divide-gray-200">
442
+ <thead class="bg-gray-50">
443
+ <tr>
444
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Key</th>
445
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Term</th>
446
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Synonyms</th>
447
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
448
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Description</th>
449
+ </tr>
450
+ </thead>
451
+ <tbody class="bg-white divide-y divide-gray-200 text-sm">
452
+ <tr>
453
+ <td class="px-6 py-4 whitespace-nowrap font-medium">position.id</td>
454
+ <td class="px-6 py-4 whitespace-nowrap">Position ID</td>
455
+ <td class="px-6 py-4">Item No., Pos. No., Ref. No.</td>
456
+ <td class="px-6 py-4 whitespace-nowrap">String</td>
457
+ <td class="px-6 py-4">Unique identifier for the position</td>
458
+ </tr>
459
+ <tr class="bg-gray-50">
460
+ <td class="px-6 py-4 whitespace-nowrap font-medium">position.description</td>
461
+ <td class="px-6 py-4">Description</td>
462
+ <td class="px-6 py-4">Item Description, Scope, Work Description</td>
463
+ <td class="px-6 py-4 whitespace-nowrap">String</td>
464
+ <td class="px-6 py-4">Detailed description of the work item</td>
465
+ </tr>
466
+ <tr>
467
+ <td class="px-6 py-4 whitespace-nowrap font-medium">position.quantity</td>
468
+ <td class="px-6 py-4">Quantity</td>
469
+ <td class="px-6 py-4">Qty, Amount, Volume</td>
470
+ <td class="px-6 py-4 whitespace-nowrap">Number</td>
471
+ <td class="px-6 py-4">Numerical quantity of the item</td>
472
+ </tr>
473
+ <tr class="bg-gray-50">
474
+ <td class="px-6 py-4 whitespace-nowrap font-medium">position.unit</td>
475
+ <td class="px-6 py-4">Unit</td>
476
+ <td class="px-6 py-4">Unit of Measure, UOM</td>
477
+ <td class="px-6 py-4 whitespace-nowrap">String</td>
478
+ <td class="px-6 py-4">Measurement unit (sqm, lm, kg, etc.)</td>
479
+ </tr>
480
+ <tr>
481
+ <td class="px-6 py-4 whitespace-nowrap font-medium">drawing.reference</td>
482
+ <td class="px-6 py-4">Drawing Ref.</td>
483
+ <td class="px-6 py-4">Plan Ref., Diagram No., DRW No.</td>
484
+ <td class="px-6 py-4 whitespace-nowrap">String</td>
485
+ <td class="px-6 py-4">Reference to technical drawing</td>
486
+ </tr>
487
+ </tbody>
488
+ </table>
489
+ </div>
490
+ </div>
491
+ </div>
492
+ </div>
493
+
494
+ <div>
495
+ <div class="bg-white border border-gray-200 rounded-lg overflow-hidden mb-6">
496
+ <div class="border-b border-gray-200 bg-gray-50 px-4 py-3">
497
+ <h3 class="font-medium text-gray-800">Configuration Status</h3>
498
+ </div>
499
+ <div class="p-4">
500
+ <div class="space-y-4">
501
+ <div>
502
+ <div class="flex items-center mb-2">
503
+ <div class="w-8 h-8 rounded-full bg-green-100 flex items-center justify-center mr-3">
504
+ <i class="fas fa-check text-green-600"></i>
505
+ </div>
506
+ <div>
507
+ <h4 class="font-medium">Azure Connection</h4>
508
+ <p class="text-sm text-gray-600">Connected to endpoint</p>
509
+ </div>
510
+ </div>
511
+ </div>
512
+ <div>
513
+ <div class="flex items-center mb-2">
514
+ <div class="w-8 h-8 rounded-full bg-green-100 flex items-center justify-center mr-3">
515
+ <i class="fas fa-check text-green-600"></i>
516
+ </div>
517
+ <div>
518
+ <h4 class="font-medium">Model Availability</h4>
519
+ <p class="text-sm text-gray-600">gpt-4-turbo available</p>
520
+ </div>
521
+ </div>
522
+ </div>
523
+ <div>
524
+ <div class="flex items-center mb-2">
525
+ <div class="w-8 h-8 rounded-full bg-yellow-100 flex items-center justify-center mr-3">
526
+ <i class="fas fa-exclamation text-yellow-600"></i>
527
+ </div>
528
+ <div>
529
+ <h4 class="font-medium">Mapping Validation</h4>
530
+ <p class="text-sm text-gray-600">3 optional fields not mapped</p>
531
+ </div>
532
+ </div>
533
+ </div>
534
+ <div>
535
+ <div class="flex items-center mb-2">
536
+ <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-3">
537
+ <i class="fas fa-info-circle text-blue-600"></i>
538
+ </div>
539
+ <div>
540
+ <h4 class="font-medium">Last Test</h4>
541
+ <p class="text-sm text-gray-600">2 days ago - 89% accuracy</p>
542
+ </div>
543
+ </div>
544
+ </div>
545
+ </div>
546
+
547
+ <div class="mt-6">
548
+ <h4 class="font-medium mb-2">Configuration Notes</h4>
549
+ <textarea class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-blue-500 focus:border-blue-500 h-24" placeholder="Add notes about this configuration..."></textarea>
550
+ </div>
551
+ </div>
552
+ </div>
553
+
554
+ <div class="bg-white border border-gray-200 rounded-lg overflow-hidden">
555
+ <div class="border-b border-gray-200 bg-gray-50 px-4 py-3">
556
+ <h3 class="font-medium text-gray-800">Test Configuration</h3>
557
+ </div>
558
+ <div class="p-4">
559
+ <div class="mb-4">
560
+ <label class="block text-gray-700 font-medium mb-1">Test Document</label>
561
+ <select class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:ring-blue-500 focus:border-blue-500">
562
+ <option>Sample Construction Tender</option>
563
+ <option>Sample Electrical Tender</option>
564
+ <option>Custom Test File...</option>
565
+ </select>
566
+ </div>
567
+ <button class="w-full bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg mb-4">
568
+ <i class="fas fa-play mr-2"></i>Run Test
569
+ </button>
570
+ <div class="border-t pt-4">
571
+ <h4 class="font-medium mb-2">Last Test Results</h4>
572
+ <div class="text-sm space-y-2">
573
+ <div class="flex items-center">
574
+ <div class="w-4 h-4 rounded-full bg-green-500 mr-2"></div>
575
+ <span>Position extraction: 94% accuracy</span>
576
+ </div>
577
+ <div class="flex items-center">
578
+ <div class="w-4 h-4 rounded-full bg-green-500 mr-2"></div>
579
+ <span>Drawing matching: 87% accuracy</span>
580
+ </div>
581
+ <div class="flex items-center">
582
+ <div class="w-4 h-4 rounded-full bg-yellow-500 mr-2"></div>
583
+ <span>Unit conversion: 3 issues</span>
584
+ </div>
585
+ </div>
586
+ </div>
587
+ </div>
588
+ </div>
589
+ </div>
590
+ </div>
591
+ </div>
592
+
593
+ <!-- Processing History Tab -->
594
+ <div id="history" class="tab-content p-6">
595
+ <div class="flex justify-between items-center mb-6">
596
+ <h2 class="text-xl font-semibold text-gray-800">Processing History</h2>
597
+ <div class="flex space-x-2">
598
+ <button class="bg-gray-200 hover:bg-gray-300 px-4 py-2 rounded-lg">
599
+ <i class="fas fa-filter mr-2"></i>Filter
600
+ </button>
601
+ <button class="bg-gray-200 hover:bg-gray-300 px-4 py-2 rounded-lg">
602
+ <i class="fas fa-download mr-2"></i>Export
603
+ </button>
604
+ </div>
605
+ </div>
606
+
607
+ <div class="bg-white border border-gray-200 rounded-lg overflow-hidden">
608
+ <div class="overflow-x-auto">
609
+ <table class="min-w-full divide-y divide-gray-200">
610
+ <thead class="bg-gray-50">
611
+ <tr>
612
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
613
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Project</th>
614
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Files</th>
615
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
616
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Confidence</th>
617
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
618
+ </tr>
619
+ </thead>
620
+ <tbody class="bg-white divide-y divide-gray-200">
621
+ <tr>
622
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">2023-06-15 14:32</td>
623
+ <td class="px-6 py-4 whitespace-nowrap">
624
+ <div class="font-medium">Office Renovation Project</div>
625
+ <div class="text-sm text-gray-500">TND-2023-0456</div>
626
+ </td>
627
+ <td class="px-6 py-4 whitespace-nowrap">
628
+ <div class="flex items-center">
629
+ <i class="fas fa-file-excel text-green-600 mr-2"></i>
630
+ <span class="text-sm">2</span>
631
+ <i class="fas fa-file-pdf text-red-600 mx-2"></i>
632
+ <span class="text-sm">1</span>
633
+ </div>
634
+ </td>
635
+ <td class="px-6 py-4 whitespace-nowrap">
636
+ <span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Completed</span>
637
+ </td>
638
+ <td class="px-6 py-4 whitespace-nowrap">
639
+ <div class="flex items-center">
640
+ <div class="w-16 bg-gray-200 rounded-full h-2 mr-2">
641
+ <div class="bg-green-500 h-2 rounded-full" style="width: 92%"></div>
642
+ </div>
643
+ <span class="text-sm">92%</span>
644
+ </div>
645
+ </td>
646
+ <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
647
+ <button class="text-blue-600 hover:text-blue-900 mr-3">View</button>
648
+ <button class="text-gray-600 hover:text-gray-900">Export</button>
649
+ </td>
650
+ </tr>
651
+ <tr>
652
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">2023-06-10 09:15</td>
653
+ <td class="px-6 py-4 whitespace-nowrap">
654
+ <div class="font-medium">Electrical Upgrade</div>
655
+ <div class="text-sm text-gray-500">TND-2023-0382</div>
656
+ </td>
657
+ <td class="px-6 py-4 whitespace-nowrap">
658
+ <div class="flex items-center">
659
+ <i class="fas fa-file-excel text-green-600 mr-2"></i>
660
+ <span class="text-sm">1</span>
661
+ <i class="fas fa-file-pdf text-red-600 mx-2"></i>
662
+ <span class="text-sm">3</span>
663
+ </div>
664
+ </td>
665
+ <td class="px-6 py-4 whitespace-nowrap">
666
+ <span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Completed</span>
667
+ </td>
668
+ <td class="px-6 py-4 whitespace-nowrap">
669
+ <div class="flex items-center">
670
+ <div class="w-16 bg-gray-200 rounded-full h-2 mr-2">
671
+ <div class="bg-green-500 h-2 rounded-full" style="width: 88%"></div>
672
+ </div>
673
+ <span class="text-sm">88%</span>
674
+ </div>
675
+ </td>
676
+ <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
677
+ <button class="text-blue-600 hover:text-blue-900 mr-3">View</button>
678
+ <button class="text-gray-600 hover:text-gray-900">Export</button>
679
+ </td>
680
+ </tr>
681
+ <tr>
682
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">2023-06-05 16:42</td>
683
+ <td class="px-6 py-4 whitespace-nowrap">
684
+ <div class="font-medium">HVAC Installation</div>
685
+ <div class="text-sm text-gray-500">TND-2023-0321</div>
686
+ </td>
687
+ <td class="px-6 py-4 whitespace-nowrap">
688
+ <div class="flex items-center">
689
+ <i class="fas fa-file-excel text-green-600 mr-2"></i>
690
+ <span class="text-sm">1</span>
691
+ <i class="fas fa-file-pdf text-red-600 mx-2"></i>
692
+ <span class="text-sm">2</span>
693
+ </div>
694
+ </td>
695
+ <td class="px-6 py-4 whitespace-nowrap">
696
+ <span class="px-2 py-1 text-xs font-semibold rounded-full bg-yellow-100 text-yellow-800">Review Needed</span>
697
+ </td>
698
+ <td class="px-6 py-4 whitespace-nowrap">
699
+ <div class="flex items-center">
700
+ <div class="w-16 bg-gray-200 rounded-full h-2 mr-2">
701
+ <div class="bg-yellow-500 h-2 rounded-full" style="width: 72%"></div>
702
+ </div>
703
+ <span class="text-sm">72%</span>
704
+ </div>
705
+ </td>
706
+ <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
707
+ <button class="text-blue-600 hover:text-blue-900 mr-3">Review</button>
708
+ <button class="text-gray-600 hover:text-gray-900">Export</button>
709
+ </td>
710
+ </tr>
711
+ <tr>
712
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">2023-05-28 11:07</td>
713
+ <td class="px-6 py-4 whitespace-nowrap">
714
+ <div class="font-medium">Facade Renovation</div>
715
+ <div class="text-sm text-gray-500">TND-2023-0289</div>
716
+ </td>
717
+ <td class="px-6 py-4 whitespace-nowrap">
718
+ <div class="flex items-center">
719
+ <i class="fas fa-file-excel text-green-600 mr-2"></i>
720
+ <span class="text-sm">3</span>
721
+ <i class="fas fa-file-pdf text-red-600 mx-2"></i>
722
+ <span class="text-sm">5</span>
723
+ </div>
724
+ </td>
725
+ <td class="px-6 py-4 whitespace-nowrap">
726
+ <span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Completed</span>
727
+ </td>
728
+ <td class="px-6 py-4 whitespace-nowrap">
729
+ <div class="flex items-center">
730
+ <div class="w-16 bg-gray-200 rounded-full h-2 mr-2">
731
+ <div class="bg-green-500 h-2 rounded-full" style="width: 95%"></div>
732
+ </div>
733
+ <span class="text-sm">95%</span>
734
+ </div>
735
+ </td>
736
+ <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
737
+ <button class="text-blue-600 hover:text-blue-900 mr-3">View</button>
738
+ <button class="text-gray-600 hover:text-gray-900">Export</button>
739
+ </td>
740
+ </tr>
741
+ </tbody>
742
+ </table>
743
+ </div>
744
+ <div class="bg-gray-50 px-6 py-3 flex items-center justify-between border-t border-gray-200">
745
+ <div class="flex-1 flex justify-between sm:hidden">
746
+ <button class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
747
+ Previous
748
+ </button>
749
+ <button class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
750
+ Next
751
+ </button>
752
+ </div>
753
+ <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
754
+ <div>
755
+ <p class="text-sm text-gray-700">
756
+ Showing <span class="font-medium">1</span> to <span class="font-medium">4</span> of <span class="font-medium">12</span> results
757
+ </p>
758
+ </div>
759
+ <div>
760
+ <nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
761
+ <button class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
762
+ <span class="sr-only">Previous</span>
763
+ <i class="fas fa-chevron-left"></i>
764
+ </button>
765
+ <button aria-current="page" class="z-10 bg-blue-50 border-blue-500 text-blue-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
766
+ 1
767
+ </button>
768
+ <button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
769
+ 2
770
+ </button>
771
+ <button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
772
+ 3
773
+ </button>
774
+ <span class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700">
775
+ ...
776
+ </span>
777
+ <button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium">
778
+ 8
779
+ </button>
780
+ <button class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
781
+ <span class="sr-only">Next</span>
782
+ <i class="fas fa-chevron-right"></i>
783
+ </button>
784
+ </nav>
785
+ </div>
786
+ </div>
787
+ </div>
788
+ </div>
789
+ </div>
790
+ </div>
791
+ </div>
792
+
793
+ <script>
794
+ // Tab switching functionality
795
+ document.querySelectorAll('.tab-btn').forEach(btn => {
796
+ btn.addEventListener('click', () => {
797
+ // Remove active class from all tabs and buttons
798
+ document.querySelectorAll('.tab-btn').forEach(b => {
799
+ b.classList.remove('border-blue-500', 'text-blue-600');
800
+ b.classList.add('border-transparent', 'text-gray-500');
801
+ });
802
+
803
+ document.querySelectorAll('.tab-content').forEach(tab => {
804
+ tab.classList.remove('active');
805
+ });
806
+
807
+ // Add active class to clicked tab and button
808
+ btn.classList.remove('border-transparent', 'text-gray-500');
809
+ btn.classList.add('border-blue-500', 'text-blue-600');
810
+
811
+ const tabId = btn.getAttribute('data-tab');
812
+ document.getElementById(tabId).classList.add('active');
813
+ });
814
+ });
815
+
816
+ // File upload functionality
817
+ const dropArea = document.getElementById('dropArea');
818
+ const fileInput = document.getElementById('fileInput');
819
+ const fileList = document.getElementById('fileList');
820
+ const uploadBtn = document.getElementById('uploadBtn');
821
+ const clearFiles = document.getElementById('clearFiles');
822
+
823
+ let files = [];
824
+
825
+ // Handle drag and drop events
826
+ ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
827
+ dropArea.addEventListener(eventName, preventDefaults, false);
828
+ });
829
+
830
+ function preventDefaults(e) {
831
+ e.preventDefault();
832
+ e.stopPropagation();
833
+ }
834
+
835
+ ['dragenter', 'dragover'].forEach(eventName => {
836
+ dropArea.addEventListener(eventName, highlight, false);
837
+ });
838
+
839
+ ['dragleave', 'drop'].forEach(eventName => {
840
+ dropArea.addEventListener(eventName, unhighlight, false);
841
+ });
842
+
843
+ function highlight() {
844
+ dropArea.classList.add('active');
845
+ }
846
+
847
+ function unhighlight() {
848
+ dropArea.classList.remove('active');
849
+ }
850
+
851
+ dropArea.addEventListener('drop', handleDrop, false);
852
+
853
+ function handleDrop(e) {
854
+ const dt = e.dataTransfer;
855
+ const newFiles = dt.files;
856
+ handleFiles(newFiles);
857
+ }
858
+
859
+ fileInput.addEventListener('change', function() {
860
+ handleFiles(this.files);
861
+ });
862
+
863
+ function handleFiles(newFiles) {
864
+ files = [...files, ...Array.from(newFiles)];
865
+ updateFileList();
866
+ uploadBtn.disabled = files.length === 0;
867
+ }
868
+
869
+ function updateFileList() {
870
+ if (files.length === 0) {
871
+ fileList.innerHTML = '<div class="p-3 text-sm text-gray-500 italic">No files selected</div>';
872
+ return;
873
+ }
874
+
875
+ fileList.innerHTML = '';
876
+
877
+ files.forEach((file, index) => {
878
+ const fileElement = document.createElement('div');
879
+ fileElement.className = 'flex items-center justify-between p-3';
880
+
881
+ const fileInfo = document.createElement('div');
882
+ fileInfo.className = 'flex items-center';
883
+
884
+ const icon = document.createElement('i');
885
+ icon.className = file.type.includes('sheet') ? 'fas fa-file-excel text-green-600 mr-3' :
886
+ file.type.includes('pdf') ? 'fas fa-file-pdf text-red-600 mr-3' :
887
+ 'fas fa-file-alt text-gray-500 mr-3';
888
+
889
+ const fileName = document.createElement('span');
890
+ fileName.className = 'text-sm text-gray-700';
891
+ fileName.textContent = file.name;
892
+
893
+ const fileSize = document.createElement('span');
894
+ fileSize.className = 'text-xs text-gray-500 ml-2';
895
+ fileSize.textContent = `(${formatFileSize(file.size)})`;
896
+
897
+ const removeBtn = document.createElement('button');
898
+ removeBtn.className = 'text-red-500 hover:text-red-700';
899
+ removeBtn.innerHTML = '<i class="fas fa-times"></i>';
900
+ removeBtn.addEventListener('click', () => removeFile(index));
901
+
902
+ fileInfo.appendChild(icon);
903
+ fileInfo.appendChild(fileName);
904
+ fileInfo.appendChild(fileSize);
905
+
906
+ fileElement.appendChild(fileInfo);
907
+ fileElement.appendChild(removeBtn);
908
+
909
+ fileList.appendChild(fileElement);
910
+ });
911
+ }
912
+
913
+ function formatFileSize(bytes) {
914
+ if (bytes === 0) return '0 Bytes';
915
+ const k = 1024;
916
+ const sizes = ['Bytes', 'KB', 'MB', 'GB'];
917
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
918
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
919
+ }
920
+
921
+ function removeFile(index) {
922
+ files.splice(index, 1);
923
+ updateFileList();
924
+ uploadBtn.disabled = files.length === 0;
925
+ }
926
+
927
+ clearFiles.addEventListener('click', () => {
928
+ files = [];
929
+ updateFileList();
930
+ uploadBtn.disabled = true;
931
+ });
932
+
933
+ uploadBtn.addEventListener('click', () => {
934
+ // Simulate upload process
935
+ uploadBtn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i>Processing...';
936
+ uploadBtn.disabled = true;
937
+
938
+ setTimeout(() => {
939
+ uploadBtn.innerHTML = '<i class="fas fa-check mr-2"></i>Processing Complete';
940
+
941
+ // Switch to results tab after processing
942
+ document.querySelector('[data-tab="results"]').click();
943
+
944
+ // Reset upload button after delay
945
+ setTimeout(() => {
946
+ uploadBtn.innerHTML = '<i class="fas fa-upload mr-2"></i>Upload & Process';
947
+ uploadBtn.disabled = false;
948
+ }, 2000);
949
+ }, 3000);
950
+ });
951
+ </script>
952
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - <a href="https://enzostvs-deepsite.hf.space?remix=luis-poe/tendextraction" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
953
+ </html>