@testgorilla/tgo-ui 11.22.3 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs +335 -229
- package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs +547 -465
- package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs +160 -75
- package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +678 -278
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +337 -274
- package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs +351 -192
- package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs +1950 -960
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +1206 -1044
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +328 -182
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs +383 -203
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs +553 -261
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs +709 -739
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs +219 -184
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +515 -458
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs +423 -162
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs +10784 -10996
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs +810 -533
- package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs +473 -116
- package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs +1149 -540
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-divider.mjs +148 -84
- package/fesm2022/testgorilla-tgo-ui-components-divider.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs +239 -142
- package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +599 -467
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs +126 -70
- package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +324 -329
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs +969 -648
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs +553 -419
- package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +847 -452
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs +398 -302
- package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs +162 -95
- package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs +1825 -1795
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs +1018 -672
- package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +758 -368
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +204 -212
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs +183 -48
- package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs +243 -79
- package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs +751 -361
- package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs +1122 -385
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs +689 -413
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs +227 -92
- package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +174 -113
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs +367 -165
- package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs +253 -118
- package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs +730 -444
- package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs +533 -221
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs +274 -76
- package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +184 -124
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +1223 -574
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +249 -160
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +447 -439
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +226 -150
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs +255 -67
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +205 -162
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +245 -153
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +274 -140
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs +319 -147
- package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs +286 -84
- package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs +660 -208
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs +579 -320
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs +419 -200
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs +132 -80
- package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +741 -390
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +455 -329
- package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs +543 -514
- package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +193 -104
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs +760 -524
- package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-table.mjs +714 -415
- package/fesm2022/testgorilla-tgo-ui-components-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs +847 -438
- package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +535 -275
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +316 -246
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs +404 -284
- package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs +664 -383
- package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +201 -112
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +1014 -458
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui.mjs +147 -155
- package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
- package/mcp/catalog.json +1 -1
- package/package.json +16 -17
- package/projects/tgo-canopy-ui/theme/_palette.scss +23 -18
- package/types/testgorilla-tgo-ui-components-accordion.d.ts +214 -158
- package/types/testgorilla-tgo-ui-components-ai-audio-circle.d.ts +93 -69
- package/types/testgorilla-tgo-ui-components-ai-caveat.d.ts +37 -34
- package/types/testgorilla-tgo-ui-components-ai-feedback.d.ts +126 -86
- package/types/testgorilla-tgo-ui-components-alert-banner.d.ts +260 -185
- package/types/testgorilla-tgo-ui-components-audio-waveform.d.ts +96 -67
- package/types/testgorilla-tgo-ui-components-autocomplete-v2.d.ts +455 -256
- package/types/testgorilla-tgo-ui-components-autocomplete.d.ts +545 -390
- package/types/testgorilla-tgo-ui-components-avatar.d.ts +128 -102
- package/types/testgorilla-tgo-ui-components-badge.d.ts +191 -139
- package/types/testgorilla-tgo-ui-components-breadcrumb.d.ts +100 -62
- package/types/testgorilla-tgo-ui-components-button.d.ts +479 -340
- package/types/testgorilla-tgo-ui-components-card.d.ts +153 -114
- package/types/testgorilla-tgo-ui-components-checkbox.d.ts +299 -223
- package/types/testgorilla-tgo-ui-components-checklist.d.ts +149 -97
- package/types/testgorilla-tgo-ui-components-core.d.ts +307 -295
- package/types/testgorilla-tgo-ui-components-datepicker.d.ts +404 -299
- package/types/testgorilla-tgo-ui-components-device-control.d.ts +151 -81
- package/types/testgorilla-tgo-ui-components-dialog.d.ts +442 -329
- package/types/testgorilla-tgo-ui-components-divider.d.ts +64 -51
- package/types/testgorilla-tgo-ui-components-donut-chart.d.ts +41 -37
- package/types/testgorilla-tgo-ui-components-dropdown.d.ts +335 -241
- package/types/testgorilla-tgo-ui-components-elevation-shadow.d.ts +48 -43
- package/types/testgorilla-tgo-ui-components-empty-state.d.ts +317 -215
- package/types/testgorilla-tgo-ui-components-field.d.ts +559 -388
- package/types/testgorilla-tgo-ui-components-file-upload.d.ts +230 -168
- package/types/testgorilla-tgo-ui-components-filter-button.d.ts +263 -206
- package/types/testgorilla-tgo-ui-components-gaussian-chart.d.ts +107 -94
- package/types/testgorilla-tgo-ui-components-icon-label.d.ts +84 -61
- package/types/testgorilla-tgo-ui-components-icon.d.ts +137 -110
- package/types/testgorilla-tgo-ui-components-infinite-scroll-table.d.ts +429 -303
- package/types/testgorilla-tgo-ui-components-inline-field.d.ts +338 -254
- package/types/testgorilla-tgo-ui-components-logo.d.ts +119 -101
- package/types/testgorilla-tgo-ui-components-media-card.d.ts +51 -35
- package/types/testgorilla-tgo-ui-components-media-dialog.d.ts +40 -45
- package/types/testgorilla-tgo-ui-components-multi-input.d.ts +283 -194
- package/types/testgorilla-tgo-ui-components-navbar.d.ts +326 -208
- package/types/testgorilla-tgo-ui-components-overflow-menu.d.ts +276 -204
- package/types/testgorilla-tgo-ui-components-page-header.d.ts +67 -50
- package/types/testgorilla-tgo-ui-components-paginator.d.ts +103 -70
- package/types/testgorilla-tgo-ui-components-password-criteria.d.ts +67 -58
- package/types/testgorilla-tgo-ui-components-password-strength.d.ts +66 -57
- package/types/testgorilla-tgo-ui-components-phone-input.d.ts +217 -175
- package/types/testgorilla-tgo-ui-components-popover.d.ts +94 -53
- package/types/testgorilla-tgo-ui-components-popup-tip.d.ts +81 -44
- package/types/testgorilla-tgo-ui-components-progress-bar.d.ts +115 -84
- package/types/testgorilla-tgo-ui-components-prompt.d.ts +315 -219
- package/types/testgorilla-tgo-ui-components-radial-progress.d.ts +146 -107
- package/types/testgorilla-tgo-ui-components-radio-button.d.ts +296 -219
- package/types/testgorilla-tgo-ui-components-rating.d.ts +134 -95
- package/types/testgorilla-tgo-ui-components-scale-table.d.ts +67 -47
- package/types/testgorilla-tgo-ui-components-scale.d.ts +91 -66
- package/types/testgorilla-tgo-ui-components-segmented-bar.d.ts +118 -89
- package/types/testgorilla-tgo-ui-components-segmented-button.d.ts +107 -80
- package/types/testgorilla-tgo-ui-components-segmented-toggle.d.ts +138 -105
- package/types/testgorilla-tgo-ui-components-selectable-card.d.ts +90 -56
- package/types/testgorilla-tgo-ui-components-side-navigation.d.ts +183 -107
- package/types/testgorilla-tgo-ui-components-side-panel.d.ts +156 -145
- package/types/testgorilla-tgo-ui-components-side-sheet.d.ts +98 -89
- package/types/testgorilla-tgo-ui-components-skeleton.d.ts +50 -33
- package/types/testgorilla-tgo-ui-components-slider.d.ts +278 -198
- package/types/testgorilla-tgo-ui-components-snackbar.d.ts +211 -159
- package/types/testgorilla-tgo-ui-components-spider-chart.d.ts +140 -121
- package/types/testgorilla-tgo-ui-components-spinner.d.ts +93 -72
- package/types/testgorilla-tgo-ui-components-stepper.d.ts +480 -338
- package/types/testgorilla-tgo-ui-components-table.d.ts +280 -233
- package/types/testgorilla-tgo-ui-components-tabs.d.ts +282 -183
- package/types/testgorilla-tgo-ui-components-tag.d.ts +266 -193
- package/types/testgorilla-tgo-ui-components-toggle.d.ts +180 -132
- package/types/testgorilla-tgo-ui-components-tooltip.d.ts +142 -105
- package/types/testgorilla-tgo-ui-components-universal-skills.d.ts +165 -144
- package/types/testgorilla-tgo-ui-components-validation-error.d.ts +70 -51
- package/types/testgorilla-tgo-ui-components-write-with-ai.d.ts +210 -133
- package/types/testgorilla-tgo-ui.d.ts +52 -45
|
@@ -1,468 +1,550 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { Color } from
|
|
4
|
-
import { CommonModule } from
|
|
5
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, NgModule, ViewChild, computed, effect, input, model, signal } from "@angular/core";
|
|
3
|
+
import { Color } from "@testgorilla/tgo-ui/components/core";
|
|
4
|
+
import { CommonModule } from "@angular/common";
|
|
6
5
|
var InterviewState;
|
|
7
|
-
(function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
(function(InterviewState) {
|
|
7
|
+
InterviewState["CandidateSpeaking"] = "candidate-speaking";
|
|
8
|
+
InterviewState["AiListening"] = "ai-listening";
|
|
9
|
+
InterviewState["AiSpeaking"] = "ai-speaking";
|
|
10
|
+
InterviewState["Static"] = "static";
|
|
12
11
|
})(InterviewState || (InterviewState = {}));
|
|
13
|
-
class AiAudioCircleComponent {
|
|
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
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
class
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
12
|
+
var AiAudioCircleComponent = class AiAudioCircleComponent {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.audioTrack = input(...ngDevMode ? [void 0, { debugName: "audioTrack" }] : /* istanbul ignore next */ []);
|
|
15
|
+
this.candidateAudioTrack = input(...ngDevMode ? [void 0, { debugName: "candidateAudioTrack" }] : /* istanbul ignore next */ []);
|
|
16
|
+
this.state = model(InterviewState.AiListening, ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
17
|
+
this.canvasSize = input(350, ...ngDevMode ? [{ debugName: "canvasSize" }] : /* istanbul ignore next */ []);
|
|
18
|
+
this.animated = input(true, ...ngDevMode ? [{ debugName: "animated" }] : /* istanbul ignore next */ []);
|
|
19
|
+
this.isSpeaking = signal(false, ...ngDevMode ? [{ debugName: "isSpeaking" }] : /* istanbul ignore next */ []);
|
|
20
|
+
this.scaleValue = signal(1, ...ngDevMode ? [{ debugName: "scaleValue" }] : /* istanbul ignore next */ []);
|
|
21
|
+
this.currentAmp = .02;
|
|
22
|
+
this.simTime = 0;
|
|
23
|
+
this.baseRadius = computed(() => this.canvasSize() * .28, ...ngDevMode ? [{ debugName: "baseRadius" }] : /* istanbul ignore next */ []);
|
|
24
|
+
this.AI_SPEAKING_THRESHOLD = .02;
|
|
25
|
+
this.CANDIDATE_SPEAKING_THRESHOLD = .5;
|
|
26
|
+
this.SHADOW_COLOR_RGB = this.hexToRgb(Color.BRAND_50);
|
|
27
|
+
this.pulseTime = 0;
|
|
28
|
+
this.pulseScale = 1;
|
|
29
|
+
this.pulseTargetScale = 1;
|
|
30
|
+
this.blobs = [];
|
|
31
|
+
effect(() => {
|
|
32
|
+
if (this.audioTrack()) this.setupAudioAnalysis();
|
|
33
|
+
});
|
|
34
|
+
effect(() => {
|
|
35
|
+
if (this.candidateAudioTrack()) this.setupCandidateAudioAnalysis();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
ngAfterViewInit() {
|
|
39
|
+
this.initializeCanvas();
|
|
40
|
+
this.initializeBlobs();
|
|
41
|
+
this.startAnimations();
|
|
42
|
+
}
|
|
43
|
+
initializeCanvas() {
|
|
44
|
+
if (!this.pulseCanvasRef) return;
|
|
45
|
+
const pulseCanvas = this.pulseCanvasRef.nativeElement;
|
|
46
|
+
const dpr = window.devicePixelRatio || 1;
|
|
47
|
+
const size = this.canvasSize();
|
|
48
|
+
pulseCanvas.width = size * dpr;
|
|
49
|
+
pulseCanvas.height = size * dpr;
|
|
50
|
+
pulseCanvas.style.width = `${size}px`;
|
|
51
|
+
pulseCanvas.style.height = `${size}px`;
|
|
52
|
+
const ctx = pulseCanvas.getContext("2d");
|
|
53
|
+
if (!ctx) {
|
|
54
|
+
console.error("[AI_AUDIO_CIRCLE] Failed to get 2d context");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.pulseCtx = ctx;
|
|
58
|
+
this.pulseCtx.scale(dpr, dpr);
|
|
59
|
+
}
|
|
60
|
+
initializeBlobs() {
|
|
61
|
+
const size = this.canvasSize();
|
|
62
|
+
const centerX = size / 2;
|
|
63
|
+
const centerY = size / 2;
|
|
64
|
+
const baseRadius = this.baseRadius();
|
|
65
|
+
const colors = [
|
|
66
|
+
{
|
|
67
|
+
color: Color.INFORMATIVE_30,
|
|
68
|
+
opacity: .8
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
color: Color.INFORMATIVE_20,
|
|
72
|
+
opacity: .7
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
color: Color.BRAND_50,
|
|
76
|
+
opacity: .75
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
color: Color.BRAND_20,
|
|
80
|
+
opacity: .6
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
color: Color.INFORMATIVE_30,
|
|
84
|
+
opacity: .65
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
const seedVelocities = [
|
|
88
|
+
.12,
|
|
89
|
+
-.08,
|
|
90
|
+
.15,
|
|
91
|
+
-.1,
|
|
92
|
+
.06
|
|
93
|
+
];
|
|
94
|
+
const seedRadii = [
|
|
95
|
+
.72,
|
|
96
|
+
.65,
|
|
97
|
+
.8,
|
|
98
|
+
.68,
|
|
99
|
+
.76
|
|
100
|
+
];
|
|
101
|
+
this.blobs = colors.map((c, i) => {
|
|
102
|
+
const angle = i / colors.length * Math.PI * 2;
|
|
103
|
+
const dist = baseRadius * .25;
|
|
104
|
+
return {
|
|
105
|
+
x: centerX + Math.cos(angle) * dist,
|
|
106
|
+
y: centerY + Math.sin(angle) * dist,
|
|
107
|
+
vx: this.animated() ? (Math.random() - .5) * .4 : seedVelocities[i],
|
|
108
|
+
vy: this.animated() ? (Math.random() - .5) * .4 : seedVelocities[(i + 2) % 5],
|
|
109
|
+
radius: baseRadius * (this.animated() ? .6 + Math.random() * .4 : seedRadii[i]),
|
|
110
|
+
color: c.color,
|
|
111
|
+
opacity: c.opacity
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
setupAudioAnalysis() {
|
|
116
|
+
const audioTrack = this.audioTrack();
|
|
117
|
+
if (!audioTrack) return;
|
|
118
|
+
try {
|
|
119
|
+
this.audioContext ??= new AudioContext();
|
|
120
|
+
this.analyser = this.audioContext.createAnalyser();
|
|
121
|
+
this.analyser.fftSize = 256;
|
|
122
|
+
this.analyser.smoothingTimeConstant = .8;
|
|
123
|
+
const bufferLength = this.analyser.frequencyBinCount;
|
|
124
|
+
this.dataArray = new Uint8Array(bufferLength);
|
|
125
|
+
const stream = new MediaStream([audioTrack]);
|
|
126
|
+
this.source = this.audioContext.createMediaStreamSource(stream);
|
|
127
|
+
this.source.connect(this.analyser);
|
|
128
|
+
this.analyzeAudio();
|
|
129
|
+
} catch (error) {
|
|
130
|
+
console.error("[AI_AUDIO_CIRCLE] Error setting up audio analysis:", error);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
setupCandidateAudioAnalysis() {
|
|
134
|
+
const candidateAudioTrack = this.candidateAudioTrack();
|
|
135
|
+
if (!candidateAudioTrack) return;
|
|
136
|
+
try {
|
|
137
|
+
this.audioContext ??= new AudioContext();
|
|
138
|
+
this.candidateAnalyser = this.audioContext.createAnalyser();
|
|
139
|
+
this.candidateAnalyser.fftSize = 256;
|
|
140
|
+
this.candidateAnalyser.smoothingTimeConstant = .8;
|
|
141
|
+
const bufferLength = this.candidateAnalyser.frequencyBinCount;
|
|
142
|
+
this.candidateDataArray = new Uint8Array(bufferLength);
|
|
143
|
+
const stream = new MediaStream([candidateAudioTrack]);
|
|
144
|
+
this.candidateSource = this.audioContext.createMediaStreamSource(stream);
|
|
145
|
+
this.candidateSource.connect(this.candidateAnalyser);
|
|
146
|
+
} catch (error) {
|
|
147
|
+
console.error("[AI_AUDIO_CIRCLE] Error setting up candidate audio analysis:", error);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
analyzeAudio() {
|
|
151
|
+
if (!this.analyser || !this.dataArray) return;
|
|
152
|
+
const analyze = () => {
|
|
153
|
+
if (!this.analyser || !this.dataArray) return;
|
|
154
|
+
this.analyser.getByteFrequencyData(this.dataArray);
|
|
155
|
+
const aiVolume = Array.from(this.dataArray).reduce((a, b) => a + b, 0) / this.dataArray.length / 255;
|
|
156
|
+
let candidateVolume = 0;
|
|
157
|
+
if (this.candidateAnalyser && this.candidateDataArray) {
|
|
158
|
+
this.candidateAnalyser.getByteFrequencyData(this.candidateDataArray);
|
|
159
|
+
candidateVolume = Array.from(this.candidateDataArray).reduce((a, b) => a + b, 0) / this.candidateDataArray.length / 255;
|
|
160
|
+
}
|
|
161
|
+
const aiSpeaking = aiVolume > this.AI_SPEAKING_THRESHOLD;
|
|
162
|
+
if (candidateVolume > this.CANDIDATE_SPEAKING_THRESHOLD) this.state.set(InterviewState.CandidateSpeaking);
|
|
163
|
+
else if (aiSpeaking) this.state.set(InterviewState.AiSpeaking);
|
|
164
|
+
else this.state.set(InterviewState.AiListening);
|
|
165
|
+
this.isSpeaking.set(aiSpeaking);
|
|
166
|
+
const currentStateValue = this.state();
|
|
167
|
+
if (currentStateValue === InterviewState.AiSpeaking && aiSpeaking) {
|
|
168
|
+
const target = Math.pow(aiVolume, .75) * 1.8;
|
|
169
|
+
this.currentAmp += (target - this.currentAmp) * .5;
|
|
170
|
+
} else if (currentStateValue === InterviewState.CandidateSpeaking) {
|
|
171
|
+
const target = .55;
|
|
172
|
+
this.currentAmp += (target - this.currentAmp) * .1;
|
|
173
|
+
} else {
|
|
174
|
+
const fixedBase = .2;
|
|
175
|
+
this.currentAmp += (fixedBase - this.currentAmp) * .05;
|
|
176
|
+
}
|
|
177
|
+
this.animationFrameId = requestAnimationFrame(analyze);
|
|
178
|
+
};
|
|
179
|
+
this.animationFrameId = requestAnimationFrame(analyze);
|
|
180
|
+
}
|
|
181
|
+
startAnimations() {
|
|
182
|
+
this.animatePulse = this.animatePulse.bind(this);
|
|
183
|
+
this.mainLoop = this.mainLoop.bind(this);
|
|
184
|
+
if (!this.animated()) {
|
|
185
|
+
this.animatePulse();
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
this.animatePulse();
|
|
189
|
+
this.mainLoop();
|
|
190
|
+
}
|
|
191
|
+
mainLoop() {
|
|
192
|
+
this.simTime += .05;
|
|
193
|
+
const currentStateValue = this.state();
|
|
194
|
+
if (currentStateValue === InterviewState.Static) {} else if (currentStateValue === InterviewState.AiSpeaking) {
|
|
195
|
+
if (this.analyser && this.dataArray) {} else {
|
|
196
|
+
const target = (Math.sin(this.simTime * .8) * .5 + .5) * (Math.random() * .9);
|
|
197
|
+
this.currentAmp += (target - this.currentAmp) * .25;
|
|
198
|
+
}
|
|
199
|
+
} else if (currentStateValue === InterviewState.CandidateSpeaking) {
|
|
200
|
+
const target = .55;
|
|
201
|
+
this.currentAmp += (target - this.currentAmp) * .1;
|
|
202
|
+
} else {
|
|
203
|
+
const fixedBase = .2;
|
|
204
|
+
this.currentAmp += (fixedBase - this.currentAmp) * .05;
|
|
205
|
+
}
|
|
206
|
+
requestAnimationFrame(this.mainLoop);
|
|
207
|
+
}
|
|
208
|
+
animatePulse() {
|
|
209
|
+
if (!this.pulseCtx) return;
|
|
210
|
+
const ctx = this.pulseCtx;
|
|
211
|
+
this.pulseTime += .016;
|
|
212
|
+
const size = this.canvasSize();
|
|
213
|
+
const centerX = size / 2;
|
|
214
|
+
const centerY = size / 2;
|
|
215
|
+
const baseRadius = this.baseRadius();
|
|
216
|
+
ctx.clearRect(0, 0, size, size);
|
|
217
|
+
const currentStateValue = this.state();
|
|
218
|
+
const effectiveAmp = this.currentAmp;
|
|
219
|
+
const isListening = currentStateValue === InterviewState.AiListening;
|
|
220
|
+
const isCandidate = currentStateValue === InterviewState.CandidateSpeaking;
|
|
221
|
+
const isAiSpeaking = currentStateValue === InterviewState.AiSpeaking;
|
|
222
|
+
const isStatic = currentStateValue === InterviewState.Static;
|
|
223
|
+
if (isStatic) {
|
|
224
|
+
this.pulseTargetScale = 1;
|
|
225
|
+
this.pulseScale = 1;
|
|
226
|
+
} else if (isCandidate) {
|
|
227
|
+
this.pulseTargetScale = 1.15;
|
|
228
|
+
const breathing = 0;
|
|
229
|
+
this.pulseScale += (this.pulseTargetScale + breathing - this.pulseScale) * .08;
|
|
230
|
+
} else {
|
|
231
|
+
this.pulseTargetScale = 1 + effectiveAmp * .5;
|
|
232
|
+
let breathing;
|
|
233
|
+
if (isListening) breathing = Math.sin(this.pulseTime * 1.5) * .035;
|
|
234
|
+
else if (isAiSpeaking) breathing = Math.sin(this.pulseTime * 2.7) * .055 + Math.cos(this.pulseTime * 1.9) * .04 + Math.sin(this.pulseTime * 4.1 + 1) * .025;
|
|
235
|
+
else breathing = 0;
|
|
236
|
+
const smoothing = isAiSpeaking ? .11 : .06;
|
|
237
|
+
this.pulseScale += (this.pulseTargetScale + breathing - this.pulseScale) * smoothing;
|
|
238
|
+
}
|
|
239
|
+
const currentRadius = baseRadius * this.pulseScale;
|
|
240
|
+
if (!isStatic) for (let i = 3; i >= 1; i--) {
|
|
241
|
+
const shadowRadius = currentRadius + i * 10;
|
|
242
|
+
const shadowOpacity = .35 - i * .06;
|
|
243
|
+
const shadowGradient = ctx.createRadialGradient(centerX, centerY, currentRadius * .98, centerX, centerY, shadowRadius);
|
|
244
|
+
shadowGradient.addColorStop(0, `rgba(${this.SHADOW_COLOR_RGB}, ${shadowOpacity})`);
|
|
245
|
+
shadowGradient.addColorStop(.6, `rgba(${this.SHADOW_COLOR_RGB}, ${shadowOpacity * .5})`);
|
|
246
|
+
shadowGradient.addColorStop(1, `rgba(${this.SHADOW_COLOR_RGB}, 0)`);
|
|
247
|
+
ctx.beginPath();
|
|
248
|
+
ctx.arc(centerX, centerY, shadowRadius, 0, Math.PI * 2);
|
|
249
|
+
ctx.fillStyle = shadowGradient;
|
|
250
|
+
ctx.fill();
|
|
251
|
+
}
|
|
252
|
+
ctx.save();
|
|
253
|
+
ctx.beginPath();
|
|
254
|
+
ctx.arc(centerX, centerY, currentRadius, 0, Math.PI * 2);
|
|
255
|
+
ctx.clip();
|
|
256
|
+
const bgGradient = ctx.createLinearGradient(centerX - currentRadius, centerY - currentRadius, centerX + currentRadius, centerY + currentRadius);
|
|
257
|
+
bgGradient.addColorStop(0, Color.BRAND_50);
|
|
258
|
+
bgGradient.addColorStop(.5, Color.INFORMATIVE_20);
|
|
259
|
+
bgGradient.addColorStop(1, Color.INFORMATIVE_30);
|
|
260
|
+
ctx.beginPath();
|
|
261
|
+
ctx.arc(centerX, centerY, currentRadius, 0, Math.PI * 2);
|
|
262
|
+
ctx.fillStyle = bgGradient;
|
|
263
|
+
ctx.fill();
|
|
264
|
+
let speedMultiplier;
|
|
265
|
+
let chaosStrength;
|
|
266
|
+
if (isCandidate) {
|
|
267
|
+
speedMultiplier = 3;
|
|
268
|
+
chaosStrength = 1;
|
|
269
|
+
} else if (isListening) {
|
|
270
|
+
speedMultiplier = 2;
|
|
271
|
+
chaosStrength = 1;
|
|
272
|
+
} else {
|
|
273
|
+
speedMultiplier = 1.5 + effectiveAmp * 3;
|
|
274
|
+
chaosStrength = isAiSpeaking ? 1.8 : 1;
|
|
275
|
+
}
|
|
276
|
+
this.blobs.forEach((blob, index) => {
|
|
277
|
+
if (!isStatic) {
|
|
278
|
+
let chaos1 = Math.sin(this.pulseTime * .6 + index * 2.5 + blob.x * .02) * .15;
|
|
279
|
+
let chaos2 = Math.cos(this.pulseTime * .4 + index * 1.8 + blob.y * .015) * .12;
|
|
280
|
+
let chaos3 = Math.sin(this.pulseTime + index * .7) * .08;
|
|
281
|
+
if (isAiSpeaking) {
|
|
282
|
+
chaos1 += Math.sin(this.pulseTime * 3.2 + index * 1.3) * .18;
|
|
283
|
+
chaos2 += Math.cos(this.pulseTime * 2.5 + index * 2.1) * .14;
|
|
284
|
+
chaos3 += Math.sin(this.pulseTime * 4 + index * .5) * .1;
|
|
285
|
+
}
|
|
286
|
+
const force = .045 * speedMultiplier * chaosStrength;
|
|
287
|
+
blob.vx += (chaos1 + chaos3 * Math.cos(this.pulseTime * 1.5 + index)) * force;
|
|
288
|
+
blob.vy += (chaos2 + chaos3 * Math.sin(this.pulseTime * 1.2 + index)) * force;
|
|
289
|
+
const friction = isAiSpeaking ? .985 : .98;
|
|
290
|
+
blob.vx *= friction;
|
|
291
|
+
blob.vy *= friction;
|
|
292
|
+
const maxVel = (isListening ? 3 : isAiSpeaking ? 6 : 4.5) * speedMultiplier;
|
|
293
|
+
const vel = Math.sqrt(blob.vx * blob.vx + blob.vy * blob.vy);
|
|
294
|
+
if (vel > maxVel) {
|
|
295
|
+
blob.vx = blob.vx / vel * maxVel;
|
|
296
|
+
blob.vy = blob.vy / vel * maxVel;
|
|
297
|
+
}
|
|
298
|
+
blob.x += blob.vx;
|
|
299
|
+
blob.y += blob.vy;
|
|
300
|
+
const dx = blob.x - centerX;
|
|
301
|
+
const dy = blob.y - centerY;
|
|
302
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
303
|
+
const maxDist = currentRadius * .55;
|
|
304
|
+
if (dist > maxDist) {
|
|
305
|
+
const angle = Math.atan2(dy, dx);
|
|
306
|
+
blob.x = centerX + Math.cos(angle) * maxDist;
|
|
307
|
+
blob.y = centerY + Math.sin(angle) * maxDist;
|
|
308
|
+
blob.vx -= dx * .065;
|
|
309
|
+
blob.vy -= dy * .065;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
const rgb = this.hexToRgb(blob.color);
|
|
313
|
+
const blurRadius = blob.radius * 1.3;
|
|
314
|
+
const outerGlow = ctx.createRadialGradient(blob.x, blob.y, 0, blob.x, blob.y, blurRadius);
|
|
315
|
+
outerGlow.addColorStop(0, `rgba(${rgb}, ${blob.opacity * .9})`);
|
|
316
|
+
outerGlow.addColorStop(.2, `rgba(${rgb}, ${blob.opacity * .7})`);
|
|
317
|
+
outerGlow.addColorStop(.4, `rgba(${rgb}, ${blob.opacity * .5})`);
|
|
318
|
+
outerGlow.addColorStop(.6, `rgba(${rgb}, ${blob.opacity * .3})`);
|
|
319
|
+
outerGlow.addColorStop(.8, `rgba(${rgb}, ${blob.opacity * .1})`);
|
|
320
|
+
outerGlow.addColorStop(1, `rgba(${rgb}, 0)`);
|
|
321
|
+
ctx.beginPath();
|
|
322
|
+
ctx.arc(blob.x, blob.y, blurRadius, 0, Math.PI * 2);
|
|
323
|
+
ctx.fillStyle = outerGlow;
|
|
324
|
+
ctx.fill();
|
|
325
|
+
});
|
|
326
|
+
const highlightGradient = ctx.createRadialGradient(centerX - currentRadius * .3, centerY - currentRadius * .3, 0, centerX - currentRadius * .3, centerY - currentRadius * .3, currentRadius * .6);
|
|
327
|
+
highlightGradient.addColorStop(0, "rgba(255, 255, 255, 0.12)");
|
|
328
|
+
highlightGradient.addColorStop(.5, "rgba(255, 255, 255, 0.03)");
|
|
329
|
+
highlightGradient.addColorStop(1, "rgba(255, 255, 255, 0)");
|
|
330
|
+
ctx.beginPath();
|
|
331
|
+
ctx.arc(centerX, centerY, currentRadius, 0, Math.PI * 2);
|
|
332
|
+
ctx.fillStyle = highlightGradient;
|
|
333
|
+
ctx.fill();
|
|
334
|
+
ctx.restore();
|
|
335
|
+
if (this.animated()) this.pulseAnimationId = requestAnimationFrame(this.animatePulse);
|
|
336
|
+
}
|
|
337
|
+
hexToRgb(hex) {
|
|
338
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
339
|
+
if (!result) return "0, 0, 0";
|
|
340
|
+
return `${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}`;
|
|
341
|
+
}
|
|
342
|
+
cleanup() {
|
|
343
|
+
if (this.animationFrameId) {
|
|
344
|
+
cancelAnimationFrame(this.animationFrameId);
|
|
345
|
+
this.animationFrameId = void 0;
|
|
346
|
+
}
|
|
347
|
+
if (this.pulseAnimationId) {
|
|
348
|
+
cancelAnimationFrame(this.pulseAnimationId);
|
|
349
|
+
this.pulseAnimationId = void 0;
|
|
350
|
+
}
|
|
351
|
+
if (this.source) {
|
|
352
|
+
this.source.disconnect();
|
|
353
|
+
this.source = void 0;
|
|
354
|
+
}
|
|
355
|
+
if (this.candidateSource) {
|
|
356
|
+
this.candidateSource.disconnect();
|
|
357
|
+
this.candidateSource = void 0;
|
|
358
|
+
}
|
|
359
|
+
if (this.audioContext && this.audioContext.state !== "closed") {
|
|
360
|
+
this.audioContext.close();
|
|
361
|
+
this.audioContext = void 0;
|
|
362
|
+
}
|
|
363
|
+
this.analyser = void 0;
|
|
364
|
+
this.candidateAnalyser = void 0;
|
|
365
|
+
this.dataArray = void 0;
|
|
366
|
+
this.candidateDataArray = void 0;
|
|
367
|
+
}
|
|
368
|
+
ngOnDestroy() {
|
|
369
|
+
this.cleanup();
|
|
370
|
+
}
|
|
371
|
+
static {
|
|
372
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
373
|
+
minVersion: "12.0.0",
|
|
374
|
+
version: "22.2.4",
|
|
375
|
+
ngImport: i0,
|
|
376
|
+
type: AiAudioCircleComponent,
|
|
377
|
+
deps: [],
|
|
378
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
static {
|
|
382
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
383
|
+
minVersion: "17.1.0",
|
|
384
|
+
version: "22.2.4",
|
|
385
|
+
type: AiAudioCircleComponent,
|
|
386
|
+
isStandalone: true,
|
|
387
|
+
selector: "ui-ai-audio-circle",
|
|
388
|
+
inputs: {
|
|
389
|
+
audioTrack: {
|
|
390
|
+
classPropertyName: "audioTrack",
|
|
391
|
+
publicName: "audioTrack",
|
|
392
|
+
isSignal: true,
|
|
393
|
+
isRequired: false,
|
|
394
|
+
transformFunction: null
|
|
395
|
+
},
|
|
396
|
+
candidateAudioTrack: {
|
|
397
|
+
classPropertyName: "candidateAudioTrack",
|
|
398
|
+
publicName: "candidateAudioTrack",
|
|
399
|
+
isSignal: true,
|
|
400
|
+
isRequired: false,
|
|
401
|
+
transformFunction: null
|
|
402
|
+
},
|
|
403
|
+
state: {
|
|
404
|
+
classPropertyName: "state",
|
|
405
|
+
publicName: "state",
|
|
406
|
+
isSignal: true,
|
|
407
|
+
isRequired: false,
|
|
408
|
+
transformFunction: null
|
|
409
|
+
},
|
|
410
|
+
canvasSize: {
|
|
411
|
+
classPropertyName: "canvasSize",
|
|
412
|
+
publicName: "canvasSize",
|
|
413
|
+
isSignal: true,
|
|
414
|
+
isRequired: false,
|
|
415
|
+
transformFunction: null
|
|
416
|
+
},
|
|
417
|
+
animated: {
|
|
418
|
+
classPropertyName: "animated",
|
|
419
|
+
publicName: "animated",
|
|
420
|
+
isSignal: true,
|
|
421
|
+
isRequired: false,
|
|
422
|
+
transformFunction: null
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
outputs: { state: "stateChange" },
|
|
426
|
+
viewQueries: [{
|
|
427
|
+
propertyName: "pulseCanvasRef",
|
|
428
|
+
first: true,
|
|
429
|
+
predicate: ["pulseCanvas"],
|
|
430
|
+
descendants: true
|
|
431
|
+
}],
|
|
432
|
+
ngImport: i0,
|
|
433
|
+
template: "<div class=\"ai-audio-visualizer\">\n <div class=\"canvas-container\">\n <canvas #pulseCanvas></canvas>\n </div>\n</div>\n",
|
|
434
|
+
styles: [".ai-audio-visualizer{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.canvas-container{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center}canvas{display:block}\n"],
|
|
435
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
440
|
+
minVersion: "12.0.0",
|
|
441
|
+
version: "22.2.4",
|
|
442
|
+
ngImport: i0,
|
|
443
|
+
type: AiAudioCircleComponent,
|
|
444
|
+
decorators: [{
|
|
445
|
+
type: Component,
|
|
446
|
+
args: [{
|
|
447
|
+
selector: "ui-ai-audio-circle",
|
|
448
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
449
|
+
template: "<div class=\"ai-audio-visualizer\">\n <div class=\"canvas-container\">\n <canvas #pulseCanvas></canvas>\n </div>\n</div>\n",
|
|
450
|
+
styles: [".ai-audio-visualizer{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.canvas-container{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center}canvas{display:block}\n"]
|
|
451
|
+
}]
|
|
452
|
+
}],
|
|
453
|
+
ctorParameters: () => [],
|
|
454
|
+
propDecorators: {
|
|
455
|
+
pulseCanvasRef: [{
|
|
456
|
+
type: ViewChild,
|
|
457
|
+
args: ["pulseCanvas", { static: false }]
|
|
458
|
+
}],
|
|
459
|
+
audioTrack: [{
|
|
460
|
+
type: i0.Input,
|
|
461
|
+
args: [{
|
|
462
|
+
isSignal: true,
|
|
463
|
+
alias: "audioTrack",
|
|
464
|
+
required: false
|
|
465
|
+
}]
|
|
466
|
+
}],
|
|
467
|
+
candidateAudioTrack: [{
|
|
468
|
+
type: i0.Input,
|
|
469
|
+
args: [{
|
|
470
|
+
isSignal: true,
|
|
471
|
+
alias: "candidateAudioTrack",
|
|
472
|
+
required: false
|
|
473
|
+
}]
|
|
474
|
+
}],
|
|
475
|
+
state: [{
|
|
476
|
+
type: i0.Input,
|
|
477
|
+
args: [{
|
|
478
|
+
isSignal: true,
|
|
479
|
+
alias: "state",
|
|
480
|
+
required: false
|
|
481
|
+
}]
|
|
482
|
+
}, {
|
|
483
|
+
type: i0.Output,
|
|
484
|
+
args: ["stateChange"]
|
|
485
|
+
}],
|
|
486
|
+
canvasSize: [{
|
|
487
|
+
type: i0.Input,
|
|
488
|
+
args: [{
|
|
489
|
+
isSignal: true,
|
|
490
|
+
alias: "canvasSize",
|
|
491
|
+
required: false
|
|
492
|
+
}]
|
|
493
|
+
}],
|
|
494
|
+
animated: [{
|
|
495
|
+
type: i0.Input,
|
|
496
|
+
args: [{
|
|
497
|
+
isSignal: true,
|
|
498
|
+
alias: "animated",
|
|
499
|
+
required: false
|
|
500
|
+
}]
|
|
501
|
+
}]
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
var AiAudioCircleModule = class AiAudioCircleModule {
|
|
505
|
+
static {
|
|
506
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
507
|
+
minVersion: "12.0.0",
|
|
508
|
+
version: "22.2.4",
|
|
509
|
+
ngImport: i0,
|
|
510
|
+
type: AiAudioCircleModule,
|
|
511
|
+
deps: [],
|
|
512
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
static {
|
|
516
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
517
|
+
minVersion: "14.0.0",
|
|
518
|
+
version: "22.2.4",
|
|
519
|
+
ngImport: i0,
|
|
520
|
+
type: AiAudioCircleModule,
|
|
521
|
+
imports: [CommonModule, AiAudioCircleComponent],
|
|
522
|
+
exports: [AiAudioCircleComponent]
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
static {
|
|
526
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
527
|
+
minVersion: "12.0.0",
|
|
528
|
+
version: "22.2.4",
|
|
529
|
+
ngImport: i0,
|
|
530
|
+
type: AiAudioCircleModule,
|
|
531
|
+
imports: [CommonModule]
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
536
|
+
minVersion: "12.0.0",
|
|
537
|
+
version: "22.2.4",
|
|
538
|
+
ngImport: i0,
|
|
539
|
+
type: AiAudioCircleModule,
|
|
540
|
+
decorators: [{
|
|
541
|
+
type: NgModule,
|
|
542
|
+
args: [{
|
|
543
|
+
imports: [CommonModule, AiAudioCircleComponent],
|
|
544
|
+
exports: [AiAudioCircleComponent]
|
|
545
|
+
}]
|
|
546
|
+
}]
|
|
547
|
+
});
|
|
467
548
|
export { AiAudioCircleComponent, AiAudioCircleModule, InterviewState };
|
|
468
|
-
|
|
549
|
+
|
|
550
|
+
//# sourceMappingURL=testgorilla-tgo-ui-components-ai-audio-circle.mjs.map
|