File size: 15,285 Bytes
86b4aeb
 
6f093ab
 
86b4aeb
6f093ab
 
 
 
 
 
 
 
 
 
 
 
 
463dbc3
24822a7
 
86b4aeb
 
24822a7
 
86b4aeb
24822a7
 
86b4aeb
24822a7
 
 
 
6f093ab
86b4aeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73566f6
86b4aeb
 
 
 
 
 
 
 
 
 
73566f6
86b4aeb
 
 
 
 
 
 
 
 
73566f6
86b4aeb
 
73566f6
86b4aeb
 
 
 
 
 
 
73566f6
86b4aeb
 
73566f6
86b4aeb
 
 
 
 
 
 
73566f6
86b4aeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73566f6
86b4aeb
 
73566f6
86b4aeb
 
 
 
 
 
 
 
73566f6
86b4aeb
 
73566f6
 
 
6f093ab
86b4aeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
463dbc3
6f093ab
86b4aeb
 
 
 
24822a7
86b4aeb
 
 
 
 
 
24822a7
 
 
86b4aeb
24822a7
86b4aeb
 
 
 
24822a7
86b4aeb
 
 
 
24822a7
86b4aeb
 
 
 
24822a7
86b4aeb
 
 
 
 
 
24822a7
86b4aeb
 
 
 
 
24822a7
6f093ab
463dbc3
86b4aeb
24822a7
 
86b4aeb
 
 
 
 
 
24822a7
 
 
86b4aeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24822a7
 
 
86b4aeb
 
6f093ab
86b4aeb
6f093ab
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<!-- Header -->
<header class="site-header">
  <div class="header-inner">
    <div class="logo-cluster">
      <span (click)="navigateHome()" style="cursor:pointer">
        <img src="/assets/pykara-logo.png" alt="PyDetect Logo" class="logo-img-header" />
      </span>
      <div class="py-detect-title-header">
        <span class="py-letter p">P</span>
        <span class="py-letter y">Y</span>
        <span class="py-shape"></span>
        <span class="py-letter d">D</span>
        <span class="py-letter e">E</span>
        <span class="py-letter t">T</span>
        <span class="py-letter e2">E</span>
        <span class="py-letter c">C</span>
        <span class="py-letter t2">T</span>
      </div>
    </div>
    <div class="header-actions-right-group">
      <button class="back-btn" (click)="navigateBackToCaseDetails()">
        <i class="fas fa-arrow-left"></i>
        <span>Back to Case Details</span>
      </button>
      <div class="header-actions-icons">
        <button class="evidence-btn" (click)="showEvidencePanel = !showEvidencePanel" title="Upload Evidence">
          <i class="fas fa-file-upload"></i>
        </button>
        <button class="summary-btn" (click)="showSummaryPanel = !showSummaryPanel" title="Investigation Summary">
          <i class="fas fa-clipboard-list"></i>
        </button>
      </div>
    </div>
  </div>
</header>

<!-- Main Content Card -->
<div class="main-content-card">
  <div class="card-inner">
    <div class="content-grid">
      <!-- Left Column -->
      <div class="left-panel">
        <!-- Guidance Banner -->
        <div *ngIf="currentQuestionIndex < 0" class="guidance-banner">
          <div class="guidance-content">
            <div class="guidance-icon">
              <i class="fas fa-lightbulb"></i>
            </div>
            <div class="guidance-text">
              <h3>Ready to Begin Investigation</h3>
              <p>Click "Start Investigation" to activate camera and begin questioning</p>
            </div>
          </div>
        </div>

        <!-- Start Investigation Button -->
        <button class="start-investigation-btn" (click)="onStartInvestigation()">
          <i class="fas fa-search"></i>
          Start Investigation
        </button>

        <!-- Question Section -->
        <div class="question-section">
          <div class="question-header">
            <div class="question-badge">Question {{ currentQuestionIndex + 1 }}</div>
            <div class="status-indicator" *ngIf="infoText">
              <i class="fas fa-info-circle"></i>
              {{ infoText }}
            </div>
          </div>
          <div class="question-content">
            <h3>Current Question</h3>
            <div class="question-text">
              <ng-container *ngIf="questions.length > 0 && currentQuestionIndex >= 0">
                {{ questions[currentQuestionIndex] }}
              </ng-container>
              <ng-container *ngIf="!questions.length || currentQuestionIndex < 0">
                <span *ngIf="currentQuestionText">{{ currentQuestionText }}</span>
                <span *ngIf="!currentQuestionText" class="no-question">
                  Awaiting first question. Click "Start Investigation" to begin.
                </span>
              </ng-container>
            </div>
          </div>
        </div>

        <!-- Answer Section -->
        <div class="answer-section">
          <h3>Your Answer</h3>
          <textarea id="answerInput"
                    [(ngModel)]="textAnswer"
                    (focus)="captureTextStart()"
                    class="answer-input"
                    placeholder="Type or speak your answer here..."
                    rows="5"
                    maxlength="3000">
          </textarea>

          <div class="answer-actions">
            <button (click)="submitCombinedAnswer()" class="btn-primary">
              <i class="fas fa-paper-plane"></i>
              Submit Answer
            </button>
            <button (click)="toggleVoiceRecording()" class="btn-secondary">
              <i class="fas fa-microphone"></i>
              <span *ngIf="!isVoiceRecording">Start Recording</span>
              <span *ngIf="isVoiceRecording">Stop Recording</span>
            </button>
          </div>

          <div *ngIf="isVoiceRecording" class="recording-status">
            <div class="recording-dot"></div>
            <span>Recording... Speak now</span>
          </div>
        </div>

        <!-- Results Section -->
        <div class="results-section">
          <!-- Truth Score -->
          <div *ngIf="truthScore !== null" class="result-card">
            <div class="result-header">
              <div class="result-icon truth">
                <i class="fas fa-check-circle"></i>
              </div>
              <div class="result-title">Truth Score</div>
              <div class="result-value">{{ truthScore }}</div>
            </div>
          </div>

          <!-- Face Detection -->
          <div *ngIf="faceDetectionScore !== null" class="result-card">
            <div class="result-header">
              <div class="result-icon face">
                <i class="fas fa-user-check"></i>
              </div>
              <div class="result-title">Face Detection</div>
              <div class="result-value">{{ faceDetectionScore }}</div>
            </div>
          </div>

          <!-- Involvement Score -->
          <div *ngIf="involvementScore !== null" class="result-card">
            <div class="result-header">
              <div class="result-icon involvement">
                <i class="fas fa-user-tag"></i>
              </div>
              <div class="result-title">Involvement Score</div>
              <div class="result-value">{{ involvementScore | number:'1.1-1' }}</div>
            </div>
            <div class="progress-bar">
              <div class="progress-fill" [style.width]="involvementScore + '%'"></div>
            </div>

            <div *ngIf="involvementCues.length" class="cues-container">
              <span *ngFor="let cue of involvementCues" class="cue-tag">
                {{ cue.replace('_cue','').replace('_',' ') }}
              </span>
            </div>

            <div *ngIf="bodyLanguageMeaning || bodyLanguageExplanation" style="margin-top: 12px; font-size: 12px; color: #64748b;">
              <div *ngIf="bodyLanguageMeaning" style="margin-bottom: 4px;">
                <strong>Body Language:</strong> {{ bodyLanguageMeaning }}
              </div>
              <div *ngIf="bodyLanguageExplanation">
                <strong>Analysis:</strong> {{ bodyLanguageExplanation }}
              </div>
            </div>
          </div>

          <!-- FER Emotion -->
          <div *ngIf="ferEmotion" class="result-card">
            <div class="result-header">
              <div class="result-icon emotion">
                <i class="fas fa-smile"></i>
              </div>
              <div class="result-title">Emotion (FER)</div>
              <div class="result-value">{{ ferEmotion }}</div>
            </div>
          </div>
        </div>
      </div>

      <!-- Right Column -->
      <div class="right-panel">
        <!-- Camera Section -->
        <div class="camera-section">
          <ng-container *ngIf="!videoStream">
            <div class="camera-placeholder">
              <div class="camera-icon">
                <i class="fas fa-video"></i>
              </div>
              <h3>Camera Inactive</h3>
              <p>Click "Start Investigation" to begin video recording and analysis</p>
            </div>
          </ng-container>

          <ng-container *ngIf="videoStream">
            <div class="video-active">
              <video #videoElement [srcObject]="videoStream" autoplay muted playsinline class="camera-video"></video>
              <div *ngIf="isRecording && currentQuestionIndex >= 0 && currentQuestionIndex < totalQuestions" class="recording-overlay">
                <i class="fas fa-circle" style="font-size: 8px;"></i>
                LIVE RECORDING
              </div>
            </div>
          </ng-container>
        </div>

        <!-- Transcription Section -->
        <div class="transcription-section">
          <div class="transcription-header">
            <h3>
              <i class="fas fa-comments"></i>
              Transcription
              <span class="live-badge">LIVE</span>
            </h3>
          </div>
          <div class="transcription-content">
            <div *ngFor="let line of transcriptLines" class="transcription-line">
              {{ line }}
            </div>
            <div *ngIf="!transcriptLines.length" class="transcription-line" style="text-align: center; color: #94a3b8;">
              <i class="fas fa-microphone-alt"></i>
              <div style="margin-top: 8px;">Waiting for speech input...</div>
            </div>
          </div>
        </div>

        <!-- Final Action -->
        <div class="final-action">
          <button class="evaluate-btn" (click)="navigateToValidationPage()">
            <i class="fas fa-check-circle"></i>
            Submit & Evaluate
          </button>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- Evidence Sidebar -->
<div class="evidence-sidebar" [class.open]="showEvidencePanel">
  <div class="sidebar-header">
    <div class="sidebar-title">
      <i class="fas fa-file-upload"></i>
      Evidence Panel
    </div>
    <button class="close-btn" (click)="showEvidencePanel = false" title="Close">
      <i class="fas fa-times"></i>
    </button>
  </div>
  <div class="sidebar-content">
    <form class="evidence-upload-form" (submit)="$event.preventDefault(); uploadDocument()">
      <div style="margin-bottom: 24px;">
        <label style="display: block; margin-bottom: 8px; font-weight: 600; color: #1e293b;">Upload Document</label>
        <input type="file" (change)="onEvidenceFileSelect($event, 'document')"
               style="width: 100%; padding: 12px; border: 2px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; cursor: pointer;">
      </div>
      <div style="margin-bottom: 24px;">
        <label style="display: block; margin-bottom: 8px; font-weight: 600; color: #1e293b;">Upload Photo</label>
        <input type="file" accept="image/*" (change)="onEvidenceFileSelect($event, 'photo')"
               style="width: 100%; padding: 12px; border: 2px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; cursor: pointer;">
      </div>
      <div style="margin-bottom: 24px;">
        <label style="display: block; margin-bottom: 8px; font-weight: 600; color: #1e293b;">Upload Recording</label>
        <input type="file" accept="audio/*,video/*" (change)="onEvidenceFileSelect($event, 'recording')"
               style="width: 100%; padding: 12px; border: 2px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; cursor: pointer;">
      </div>

      <div style="margin-bottom: 24px;">
        <label style="display: block; margin-bottom: 8px; font-weight: 600; color: #1e293b;">Remarks</label>
        <textarea [(ngModel)]="evidenceSummary" [ngModelOptions]="{standalone: true}"
                  rows="4" placeholder="Enter any additional remarks..."
                  style="width: 100%; padding: 12px; border: 2px solid #cbd5e1; border-radius: 10px; background: white; font-family: inherit;"></textarea>
      </div>

      <button type="submit" class="btn-primary" style="width: 100%;">
        <i class="fas fa-paper-plane"></i>
        Submit Evidence
      </button>
    </form>
  </div>
</div>

<!-- Summary Sidebar -->
<div class="summary-sidebar" [class.open]="showSummaryPanel">
  <div class="sidebar-header">
    <div class="sidebar-title">
      <i class="fas fa-clipboard-list"></i>
      Investigation Summary
    </div>
    <button class="close-btn" (click)="showSummaryPanel = false" title="Close">
      <i class="fas fa-times"></i>
    </button>
  </div>
  <div class="sidebar-content">
    <div style="margin-bottom: 24px;">
      <h4 style="color: #2563eb; margin-bottom: 12px; font-size: 14px; font-weight: 600;">Case Details</h4>
      <div style="background: #f0f9ff; border-radius: 10px; padding: 16px;">
        <div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
          <span style="color: #475569; font-size: 13px;">Case ID:</span>
          <span style="font-weight: 600; color: #1e293b;">{{ caseId }}</span>
        </div>
        <div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
          <span style="color: #475569; font-size: 13px;">Crime Type:</span>
          <span style="font-weight: 600; color: #1e293b;">{{ crimeType }}</span>
        </div>
        <div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
          <span style="color: #475569; font-size: 13px;">Date & Time:</span>
          <span style="font-weight: 600; color: #1e293b;">{{ dateTime }}</span>
        </div>
        <div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
          <span style="color: #475569; font-size: 13px;">Location:</span>
          <span style="font-weight: 600; color: #1e293b;">{{ location }}</span>
        </div>
      </div>
    </div>

    <div style="margin-bottom: 24px;">
      <h4 style="color: #2563eb; margin-bottom: 12px; font-size: 14px; font-weight: 600;">Person Details</h4>
      <div style="background: #f0f9ff; border-radius: 10px; padding: 16px;">
        <div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
          <span style="color: #475569; font-size: 13px;">Suspect Name:</span>
          <span style="font-weight: 600; color: #1e293b;">{{ suspectName }}</span>
        </div>
        <div style="display: flex; justify-content: space-between;">
          <span style="color: #475569; font-size: 13px;">Investigation Officer:</span>
          <span style="font-weight: 600; color: #1e293b;">{{ investigationOfficer }}</span>
        </div>
      </div>
    </div>

    <div>
      <h4 style="color: #2563eb; margin-bottom: 12px; font-size: 14px; font-weight: 600;">Progress Details</h4>
      <div style="background: #f0f9ff; border-radius: 10px; padding: 16px;">
        <div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
          <span style="color: #475569; font-size: 13px;">Status:</span>
          <span style="font-weight: 600; color: #1e293b;">{{ statusText }}</span>
        </div>
        <div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
          <span style="color: #475569; font-size: 13px;">Progress:</span>
          <span style="font-weight: 600; color: #1e293b;">{{progress}}% ({{ progressStage }})</span>
        </div>
        <div style="display: flex; justify-content: space-between;">
          <span style="color: #475569; font-size: 13px;">Session Time:</span>
          <span style="font-weight: 600; color: #1e293b;">{{ sessionTime }}</span>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- Blur Background -->
<div class="blur-bg" [class.active]="showEvidencePanel || showSummaryPanel"></div>

<!-- Footer -->
<footer>
  <p>© 2025 Pykara Technologies Pvt. Ltd. All rights reserved.</p>
</footer>