interview-widget 1.0.3 → 1.0.5
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/dist/widget.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import { createPortal as
|
|
6
|
-
var
|
|
1
|
+
var qe = Object.defineProperty;
|
|
2
|
+
var Be = (i, r, t) => r in i ? qe(i, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[r] = t;
|
|
3
|
+
var F = (i, r, t) => Be(i, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import ge, { createContext as Te, useContext as ne, useSyncExternalStore as Ce, useRef as E, useCallback as T, useMemo as ee, useState as k, useEffect as C, forwardRef as We, useImperativeHandle as Ge } from "react";
|
|
5
|
+
import { createPortal as Ve } from "react-dom";
|
|
6
|
+
var Se = { exports: {} }, ae = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
9
9
|
* react-jsx-runtime.production.js
|
|
@@ -13,27 +13,27 @@ var ke = { exports: {} }, se = {};
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
17
|
-
function
|
|
16
|
+
var ze = Symbol.for("react.transitional.element"), He = Symbol.for("react.fragment");
|
|
17
|
+
function Ie(i, r, t) {
|
|
18
18
|
var s = null;
|
|
19
|
-
if (
|
|
20
|
-
|
|
19
|
+
if (t !== void 0 && (s = "" + t), r.key !== void 0 && (s = "" + r.key), "key" in r) {
|
|
20
|
+
t = {};
|
|
21
21
|
for (var n in r)
|
|
22
|
-
n !== "key" && (
|
|
23
|
-
} else
|
|
24
|
-
return r =
|
|
25
|
-
$$typeof:
|
|
26
|
-
type:
|
|
22
|
+
n !== "key" && (t[n] = r[n]);
|
|
23
|
+
} else t = r;
|
|
24
|
+
return r = t.ref, {
|
|
25
|
+
$$typeof: ze,
|
|
26
|
+
type: i,
|
|
27
27
|
key: s,
|
|
28
28
|
ref: r !== void 0 ? r : null,
|
|
29
|
-
props:
|
|
29
|
+
props: t
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var e =
|
|
32
|
+
ae.Fragment = He;
|
|
33
|
+
ae.jsx = Ie;
|
|
34
|
+
ae.jsxs = Ie;
|
|
35
|
+
Se.exports = ae;
|
|
36
|
+
var e = Se.exports;
|
|
37
37
|
const $ = {
|
|
38
38
|
api: {
|
|
39
39
|
baseUrl: "/api",
|
|
@@ -65,57 +65,120 @@ const $ = {
|
|
|
65
65
|
enabled: !0
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
},
|
|
69
|
-
|
|
68
|
+
}, xe = "iw-storage";
|
|
69
|
+
function Ye() {
|
|
70
|
+
return typeof import.meta < "u" ? "your-secure-encryption-seed-here" : typeof process < "u" && process.env.NEXT_PUBLIC_IW_SECRET ? process.env.NEXT_PUBLIC_IW_SECRET : typeof window < "u" && window.__IW_SECRET__ ? window.__IW_SECRET__ : "proctoring-data-seed";
|
|
71
|
+
}
|
|
72
|
+
const Re = Ye(), pe = "AES-GCM", fe = 12;
|
|
73
|
+
async function Ae(i) {
|
|
74
|
+
const t = new TextEncoder().encode(i), s = await crypto.subtle.digest("SHA-256", t);
|
|
75
|
+
return crypto.subtle.importKey("raw", s, pe, !1, [
|
|
76
|
+
"encrypt",
|
|
77
|
+
"decrypt"
|
|
78
|
+
]);
|
|
79
|
+
}
|
|
80
|
+
function Qe() {
|
|
81
|
+
return crypto.getRandomValues(new Uint8Array(fe));
|
|
82
|
+
}
|
|
83
|
+
async function Ke(i, r = "default-seed") {
|
|
84
|
+
try {
|
|
85
|
+
const t = typeof i == "string" ? i : JSON.stringify(i), n = new TextEncoder().encode(t), o = await Ae(r), a = Qe(), l = await crypto.subtle.encrypt(
|
|
86
|
+
{ name: pe, iv: a },
|
|
87
|
+
o,
|
|
88
|
+
n
|
|
89
|
+
), w = new Uint8Array(a.length + l.byteLength);
|
|
90
|
+
return w.set(new Uint8Array(a), 0), w.set(new Uint8Array(l), a.length), btoa(String.fromCharCode(...Array.from(w)));
|
|
91
|
+
} catch (t) {
|
|
92
|
+
throw console.error("Encryption failed:", t), new Error("Failed to encrypt data");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async function Je(i, r = "default-seed") {
|
|
96
|
+
try {
|
|
97
|
+
const t = atob(i), s = new Uint8Array(t.length);
|
|
98
|
+
for (let d = 0; d < t.length; d++)
|
|
99
|
+
s[d] = t.charCodeAt(d);
|
|
100
|
+
const n = s.slice(0, fe), o = s.slice(fe), a = await Ae(r), l = await crypto.subtle.decrypt(
|
|
101
|
+
{ name: pe, iv: n },
|
|
102
|
+
a,
|
|
103
|
+
o
|
|
104
|
+
);
|
|
105
|
+
return new TextDecoder().decode(l);
|
|
106
|
+
} catch (t) {
|
|
107
|
+
throw console.error("Decryption failed:", t), new Error("Failed to decrypt data");
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async function Xe(i, r = "default-seed") {
|
|
111
|
+
return Ke(i, r);
|
|
112
|
+
}
|
|
113
|
+
async function Ze(i, r = "default-seed") {
|
|
114
|
+
const t = await Je(i, r);
|
|
115
|
+
try {
|
|
116
|
+
return JSON.parse(t);
|
|
117
|
+
} catch {
|
|
118
|
+
return t;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const oe = Te(null), et = async () => {
|
|
122
|
+
var i, r;
|
|
70
123
|
try {
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
const s =
|
|
124
|
+
const t = sessionStorage.getItem(xe);
|
|
125
|
+
if (t) {
|
|
126
|
+
const s = await Ze(t, Re);
|
|
74
127
|
return {
|
|
75
|
-
logViolations: ((
|
|
128
|
+
logViolations: ((i = s.state) == null ? void 0 : i.logViolations) || [],
|
|
76
129
|
totalViolations: ((r = s.state) == null ? void 0 : r.totalViolations) || 0
|
|
77
130
|
};
|
|
78
131
|
}
|
|
79
|
-
} catch (
|
|
132
|
+
} catch (t) {
|
|
80
133
|
console.error(
|
|
81
134
|
"Failed to load proctoring data from session storage:",
|
|
82
|
-
|
|
135
|
+
t
|
|
83
136
|
);
|
|
84
137
|
}
|
|
85
138
|
return { logViolations: [], totalViolations: 0 };
|
|
86
|
-
},
|
|
139
|
+
}, je = async (i) => {
|
|
87
140
|
try {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
state: t,
|
|
141
|
+
const r = await Xe(
|
|
142
|
+
{
|
|
143
|
+
state: i,
|
|
92
144
|
version: 0
|
|
93
|
-
}
|
|
145
|
+
},
|
|
146
|
+
Re
|
|
94
147
|
);
|
|
148
|
+
sessionStorage.setItem(xe, r);
|
|
95
149
|
} catch (r) {
|
|
96
150
|
console.error("Failed to save proctoring data to session storage:", r);
|
|
97
151
|
}
|
|
98
|
-
},
|
|
99
|
-
children:
|
|
152
|
+
}, tt = ({
|
|
153
|
+
children: i
|
|
100
154
|
}) => {
|
|
101
|
-
const r =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
(
|
|
155
|
+
const r = E({
|
|
156
|
+
logViolations: [],
|
|
157
|
+
totalViolations: 0
|
|
158
|
+
}), t = E(/* @__PURE__ */ new Set());
|
|
159
|
+
ge.useEffect(() => {
|
|
160
|
+
et().then((d) => {
|
|
161
|
+
r.current = d, s();
|
|
162
|
+
});
|
|
163
|
+
}, []);
|
|
164
|
+
const s = T(() => {
|
|
165
|
+
t.current.forEach((d) => d());
|
|
166
|
+
}, []), n = T((d) => (t.current.add(d), () => {
|
|
167
|
+
t.current.delete(d);
|
|
168
|
+
}), []), o = T(() => r.current, []), a = T(
|
|
169
|
+
(d) => {
|
|
107
170
|
r.current = {
|
|
108
|
-
logViolations: [...r.current.logViolations,
|
|
171
|
+
logViolations: [...r.current.logViolations, d],
|
|
109
172
|
totalViolations: r.current.totalViolations + 1
|
|
110
|
-
},
|
|
173
|
+
}, je(r.current), s();
|
|
111
174
|
},
|
|
112
175
|
[s]
|
|
113
|
-
), l =
|
|
176
|
+
), l = T(() => {
|
|
114
177
|
r.current = {
|
|
115
178
|
logViolations: [],
|
|
116
179
|
totalViolations: 0
|
|
117
|
-
},
|
|
118
|
-
}, [s]),
|
|
180
|
+
}, je(r.current), s();
|
|
181
|
+
}, [s]), w = ee(
|
|
119
182
|
() => ({
|
|
120
183
|
getState: o,
|
|
121
184
|
addViolation: a,
|
|
@@ -124,96 +187,96 @@ const $ = {
|
|
|
124
187
|
}),
|
|
125
188
|
[o, a, l, n]
|
|
126
189
|
);
|
|
127
|
-
return /* @__PURE__ */ e.jsx(
|
|
128
|
-
},
|
|
129
|
-
const
|
|
130
|
-
if (!
|
|
190
|
+
return /* @__PURE__ */ e.jsx(oe.Provider, { value: w, children: i });
|
|
191
|
+
}, it = () => {
|
|
192
|
+
const i = ne(oe);
|
|
193
|
+
if (!i)
|
|
131
194
|
throw new Error("useViolations must be used within a ProctoringProvider");
|
|
132
|
-
return
|
|
133
|
-
|
|
134
|
-
() =>
|
|
135
|
-
() =>
|
|
195
|
+
return Ce(
|
|
196
|
+
i.subscribe,
|
|
197
|
+
() => i.getState().logViolations,
|
|
198
|
+
() => i.getState().logViolations
|
|
136
199
|
);
|
|
137
|
-
},
|
|
138
|
-
const
|
|
139
|
-
if (!
|
|
200
|
+
}, rt = () => {
|
|
201
|
+
const i = ne(oe);
|
|
202
|
+
if (!i)
|
|
140
203
|
throw new Error(
|
|
141
204
|
"useTotalViolations must be used within a ProctoringProvider"
|
|
142
205
|
);
|
|
143
|
-
return
|
|
144
|
-
|
|
145
|
-
() =>
|
|
146
|
-
() =>
|
|
206
|
+
return Ce(
|
|
207
|
+
i.subscribe,
|
|
208
|
+
() => i.getState().totalViolations,
|
|
209
|
+
() => i.getState().totalViolations
|
|
147
210
|
);
|
|
148
|
-
},
|
|
149
|
-
const
|
|
150
|
-
if (!
|
|
211
|
+
}, st = () => {
|
|
212
|
+
const i = ne(oe);
|
|
213
|
+
if (!i)
|
|
151
214
|
throw new Error(
|
|
152
215
|
"useProctoringActions must be used within a ProctoringProvider"
|
|
153
216
|
);
|
|
154
217
|
return {
|
|
155
|
-
addViolation:
|
|
156
|
-
clearViolations:
|
|
218
|
+
addViolation: i.addViolation,
|
|
219
|
+
clearViolations: i.clearViolations
|
|
157
220
|
};
|
|
158
|
-
},
|
|
221
|
+
}, Me = Te(
|
|
159
222
|
null
|
|
160
223
|
);
|
|
161
|
-
function
|
|
162
|
-
config:
|
|
224
|
+
function nt({
|
|
225
|
+
config: i = {},
|
|
163
226
|
children: r
|
|
164
227
|
}) {
|
|
165
228
|
var s, n, o, a;
|
|
166
|
-
const
|
|
229
|
+
const t = {
|
|
167
230
|
api: {
|
|
168
231
|
...$.api,
|
|
169
|
-
...
|
|
232
|
+
...i.api,
|
|
170
233
|
retryConfig: {
|
|
171
234
|
...$.api.retryConfig,
|
|
172
|
-
...(s =
|
|
235
|
+
...(s = i.api) == null ? void 0 : s.retryConfig
|
|
173
236
|
}
|
|
174
237
|
},
|
|
175
238
|
ui: {
|
|
176
239
|
...$.ui,
|
|
177
|
-
...
|
|
240
|
+
...i.ui
|
|
178
241
|
},
|
|
179
242
|
interview: {
|
|
180
243
|
...$.interview,
|
|
181
|
-
...
|
|
244
|
+
...i.interview,
|
|
182
245
|
timers: {
|
|
183
246
|
...$.interview.timers,
|
|
184
|
-
...(n =
|
|
247
|
+
...(n = i.interview) == null ? void 0 : n.timers
|
|
185
248
|
},
|
|
186
249
|
stt: {
|
|
187
250
|
...$.interview.stt,
|
|
188
|
-
...(o =
|
|
251
|
+
...(o = i.interview) == null ? void 0 : o.stt
|
|
189
252
|
},
|
|
190
253
|
tts: {
|
|
191
254
|
...$.interview.tts,
|
|
192
|
-
...(a =
|
|
255
|
+
...(a = i.interview) == null ? void 0 : a.tts
|
|
193
256
|
}
|
|
194
257
|
}
|
|
195
258
|
};
|
|
196
|
-
return /* @__PURE__ */ e.jsx(
|
|
259
|
+
return /* @__PURE__ */ e.jsx(Me.Provider, { value: t, children: /* @__PURE__ */ e.jsx(tt, { children: r }) });
|
|
197
260
|
}
|
|
198
|
-
function
|
|
199
|
-
const
|
|
200
|
-
if (!
|
|
261
|
+
function le() {
|
|
262
|
+
const i = ne(Me);
|
|
263
|
+
if (!i)
|
|
201
264
|
throw new Error(
|
|
202
265
|
"useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>"
|
|
203
266
|
);
|
|
204
|
-
return
|
|
267
|
+
return i;
|
|
205
268
|
}
|
|
206
|
-
function
|
|
207
|
-
return
|
|
269
|
+
function De() {
|
|
270
|
+
return le().api || $.api;
|
|
208
271
|
}
|
|
209
|
-
function
|
|
210
|
-
return
|
|
272
|
+
function te() {
|
|
273
|
+
return le().ui || $.ui;
|
|
211
274
|
}
|
|
212
|
-
function
|
|
213
|
-
return
|
|
275
|
+
function at() {
|
|
276
|
+
return le().interview || $.interview;
|
|
214
277
|
}
|
|
215
|
-
const
|
|
216
|
-
className:
|
|
278
|
+
const _e = ({
|
|
279
|
+
className: i,
|
|
217
280
|
...r
|
|
218
281
|
}) => /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(
|
|
219
282
|
"svg",
|
|
@@ -227,7 +290,7 @@ const Ie = ({
|
|
|
227
290
|
strokeWidth: "2",
|
|
228
291
|
strokeLinecap: "round",
|
|
229
292
|
strokeLinejoin: "round",
|
|
230
|
-
className: `iw-animate-spin ${
|
|
293
|
+
className: `iw-animate-spin ${i}`,
|
|
231
294
|
...r,
|
|
232
295
|
children: [
|
|
233
296
|
/* @__PURE__ */ e.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
@@ -241,17 +304,17 @@ const Ie = ({
|
|
|
241
304
|
/* @__PURE__ */ e.jsx("path", { d: "M7.75 7.75l-2.15 -2.15" })
|
|
242
305
|
]
|
|
243
306
|
}
|
|
244
|
-
) }),
|
|
245
|
-
children:
|
|
307
|
+
) }), Pe = ({
|
|
308
|
+
children: i,
|
|
246
309
|
variant: r = "primary",
|
|
247
|
-
size:
|
|
310
|
+
size: t = "md",
|
|
248
311
|
fullWidth: s = !1,
|
|
249
312
|
isLoading: n = !1,
|
|
250
313
|
disabled: o,
|
|
251
314
|
className: a = "",
|
|
252
315
|
...l
|
|
253
316
|
}) => {
|
|
254
|
-
const
|
|
317
|
+
const w = "iw-inline-flex iw-items-center iw-justify-center iw-rounded-md iw-font-medium iw-transition-colors iw-focus:outline-none iw-focus:ring-2 iw-focus:ring-primary-500 iw-focus:ring-offset-2", d = {
|
|
255
318
|
primary: "iw-bg-primary-600 iw-text-white iw-hover:bg-primary-700 iw-border iw-border-transparent",
|
|
256
319
|
secondary: "iw-bg-primary-100 iw-text-primary-700 iw-hover:bg-primary-200 iw-border iw-border-transparent",
|
|
257
320
|
outline: "iw-bg-transparent iw-text-primary-700 iw-border iw-border-primary-500 iw-hover:bg-primary-50",
|
|
@@ -265,52 +328,52 @@ const Ie = ({
|
|
|
265
328
|
return /* @__PURE__ */ e.jsxs(
|
|
266
329
|
"button",
|
|
267
330
|
{
|
|
268
|
-
className: `${
|
|
331
|
+
className: `${w} ${d[r]} ${u[t]} ${m} ${h} ${a}`,
|
|
269
332
|
disabled: o || n,
|
|
270
333
|
...l,
|
|
271
334
|
children: [
|
|
272
|
-
n && /* @__PURE__ */ e.jsx(
|
|
273
|
-
|
|
335
|
+
n && /* @__PURE__ */ e.jsx(_e, { height: 16, width: 16, style: { marginRight: "3px" } }),
|
|
336
|
+
i
|
|
274
337
|
]
|
|
275
338
|
}
|
|
276
339
|
);
|
|
277
340
|
};
|
|
278
|
-
function
|
|
279
|
-
const r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(
|
|
341
|
+
function ot(i) {
|
|
342
|
+
const r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);
|
|
280
343
|
return r ? {
|
|
281
344
|
r: parseInt(r[1], 16),
|
|
282
345
|
g: parseInt(r[2], 16),
|
|
283
346
|
b: parseInt(r[3], 16)
|
|
284
347
|
} : null;
|
|
285
348
|
}
|
|
286
|
-
function
|
|
287
|
-
return "#" + [
|
|
349
|
+
function lt(i, r, t) {
|
|
350
|
+
return "#" + [i, r, t].map((s) => {
|
|
288
351
|
const n = Math.round(s).toString(16);
|
|
289
352
|
return n.length === 1 ? "0" + n : n;
|
|
290
353
|
}).join("");
|
|
291
354
|
}
|
|
292
|
-
function
|
|
293
|
-
const
|
|
294
|
-
if (!
|
|
295
|
-
const s =
|
|
296
|
-
return
|
|
355
|
+
function Fe(i, r) {
|
|
356
|
+
const t = ot(i);
|
|
357
|
+
if (!t) return i;
|
|
358
|
+
const s = t.r + (255 - t.r) * r, n = t.g + (255 - t.g) * r, o = t.b + (255 - t.b) * r;
|
|
359
|
+
return lt(s, n, o);
|
|
297
360
|
}
|
|
298
|
-
function
|
|
361
|
+
function ct(i, r = 0.8) {
|
|
299
362
|
return {
|
|
300
|
-
background: `linear-gradient(to bottom, ${
|
|
363
|
+
background: `linear-gradient(to bottom, ${Fe(i, r)}, #ffffff)`,
|
|
301
364
|
color: "#1f2937"
|
|
302
365
|
};
|
|
303
366
|
}
|
|
304
|
-
function
|
|
305
|
-
return new Promise((r) => setTimeout(r,
|
|
367
|
+
function dt(i) {
|
|
368
|
+
return new Promise((r) => setTimeout(r, i));
|
|
306
369
|
}
|
|
307
|
-
function
|
|
308
|
-
return `linear-gradient(to left, ${
|
|
370
|
+
function Le(i) {
|
|
371
|
+
return `linear-gradient(to left, ${Fe(i, 0.4)}, ${i})`;
|
|
309
372
|
}
|
|
310
|
-
const
|
|
311
|
-
function
|
|
373
|
+
const wt = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
374
|
+
function ut(i) {
|
|
312
375
|
try {
|
|
313
|
-
const r =
|
|
376
|
+
const r = i.split(".");
|
|
314
377
|
if (r.length !== 3 || !r[1])
|
|
315
378
|
throw new Error("Invalid JWT token");
|
|
316
379
|
const s = r[1].replace(/-/g, "+").replace(/_/g, "/"), n = s.padEnd(
|
|
@@ -322,7 +385,7 @@ function Ze(t) {
|
|
|
322
385
|
return console.error("Error decoding JWT:", r), null;
|
|
323
386
|
}
|
|
324
387
|
}
|
|
325
|
-
const
|
|
388
|
+
const $e = (i) => /* @__PURE__ */ e.jsxs(
|
|
326
389
|
"svg",
|
|
327
390
|
{
|
|
328
391
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -334,13 +397,13 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
334
397
|
strokeWidth: "2",
|
|
335
398
|
strokeLinecap: "round",
|
|
336
399
|
strokeLinejoin: "round",
|
|
337
|
-
...
|
|
400
|
+
...i,
|
|
338
401
|
children: [
|
|
339
402
|
/* @__PURE__ */ e.jsx("path", { d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }),
|
|
340
403
|
/* @__PURE__ */ e.jsx("path", { d: "m9 12 2 2 4-4" })
|
|
341
404
|
]
|
|
342
405
|
}
|
|
343
|
-
),
|
|
406
|
+
), Oe = (i) => /* @__PURE__ */ e.jsxs(
|
|
344
407
|
"svg",
|
|
345
408
|
{
|
|
346
409
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -352,14 +415,14 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
352
415
|
strokeWidth: "2",
|
|
353
416
|
strokeLinecap: "round",
|
|
354
417
|
strokeLinejoin: "round",
|
|
355
|
-
...
|
|
418
|
+
...i,
|
|
356
419
|
children: [
|
|
357
420
|
/* @__PURE__ */ e.jsx("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
|
|
358
421
|
/* @__PURE__ */ e.jsx("line", { x1: "8", x2: "16", y1: "21", y2: "21" }),
|
|
359
422
|
/* @__PURE__ */ e.jsx("line", { x1: "12", x2: "12", y1: "17", y2: "21" })
|
|
360
423
|
]
|
|
361
424
|
}
|
|
362
|
-
),
|
|
425
|
+
), ht = (i) => /* @__PURE__ */ e.jsxs(
|
|
363
426
|
"svg",
|
|
364
427
|
{
|
|
365
428
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -371,39 +434,39 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
371
434
|
strokeWidth: "2",
|
|
372
435
|
strokeLinecap: "round",
|
|
373
436
|
strokeLinejoin: "round",
|
|
374
|
-
...
|
|
437
|
+
...i,
|
|
375
438
|
children: [
|
|
376
439
|
/* @__PURE__ */ e.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
377
440
|
/* @__PURE__ */ e.jsx("path", { d: "M15 8a5 5 0 0 1 0 8" }),
|
|
378
441
|
/* @__PURE__ */ e.jsx("path", { d: "M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a.8 .8 0 0 1 1.5 .5v14a.8 .8 0 0 1 -1.5 .5l-3.5 -4.5" })
|
|
379
442
|
]
|
|
380
443
|
}
|
|
381
|
-
),
|
|
382
|
-
const { baseColor: r, borderRadius:
|
|
444
|
+
), V = (i) => {
|
|
445
|
+
const { baseColor: r, borderRadius: t } = te(), { loading: s, children: n, ...o } = i;
|
|
383
446
|
return /* @__PURE__ */ e.jsx(
|
|
384
|
-
|
|
447
|
+
Pe,
|
|
385
448
|
{
|
|
386
449
|
style: {
|
|
387
|
-
background:
|
|
388
|
-
borderRadius:
|
|
450
|
+
background: Le(r),
|
|
451
|
+
borderRadius: t
|
|
389
452
|
},
|
|
390
453
|
...o,
|
|
391
|
-
children: s ? /* @__PURE__ */ e.jsx(
|
|
454
|
+
children: s ? /* @__PURE__ */ e.jsx(_e, {}) : n
|
|
392
455
|
}
|
|
393
456
|
);
|
|
394
|
-
},
|
|
457
|
+
}, mt = [
|
|
395
458
|
"Do not refresh or reload the page during your assessment",
|
|
396
459
|
"Refrain from switching tabs or opening other applications while the session is in progress",
|
|
397
460
|
"Ensure your face remains clearly visible on camera at all times",
|
|
398
461
|
"Avoid frequent distractions or leaving your seat during the session",
|
|
399
462
|
"Do not disable or interfere with audio/video monitoring"
|
|
400
|
-
],
|
|
401
|
-
isOpen:
|
|
463
|
+
], gt = ({
|
|
464
|
+
isOpen: i,
|
|
402
465
|
onStart: r,
|
|
403
|
-
onClose:
|
|
466
|
+
onClose: t
|
|
404
467
|
}) => {
|
|
405
|
-
var
|
|
406
|
-
const s =
|
|
468
|
+
var A;
|
|
469
|
+
const s = E(null), n = E(null), { baseColor: o, borderRadius: a } = te(), [l, w] = k(!1), [d, u] = k(null), [h, m] = k(!1), c = o ?? "#2563eb", x = Le(c), b = a ?? 18, j = (f, M) => f.startsWith("#") && f.length === 7 ? `${f}${M}` : f, g = [
|
|
407
470
|
`radial-gradient(120% 85% at 50% 125%, ${j(
|
|
408
471
|
c,
|
|
409
472
|
"34"
|
|
@@ -423,7 +486,7 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
423
486
|
c,
|
|
424
487
|
"14"
|
|
425
488
|
)} 16px, transparent 16px, transparent 32px)`
|
|
426
|
-
].join(", "),
|
|
489
|
+
].join(", "), v = l ? {
|
|
427
490
|
label: "Camera & microphone ready",
|
|
428
491
|
toneClass: "iw-bg-white/15 iw-text-white",
|
|
429
492
|
dotClass: "iw-bg-emerald-400"
|
|
@@ -450,50 +513,50 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
450
513
|
toneClass: "iw-bg-rose-50 iw-text-rose-600",
|
|
451
514
|
cameraCopy: "Grant camera access to continue with the interview.",
|
|
452
515
|
micCopy: "Enable microphone access so we can capture your answers."
|
|
453
|
-
},
|
|
516
|
+
}, N = [
|
|
454
517
|
{
|
|
455
518
|
label: "Camera feed",
|
|
456
519
|
description: S.cameraCopy,
|
|
457
520
|
status: S.badge,
|
|
458
521
|
toneClass: S.toneClass,
|
|
459
|
-
Icon:
|
|
522
|
+
Icon: Oe
|
|
460
523
|
},
|
|
461
524
|
{
|
|
462
525
|
label: "Microphone input",
|
|
463
526
|
description: S.micCopy,
|
|
464
527
|
status: S.badge,
|
|
465
528
|
toneClass: S.toneClass,
|
|
466
|
-
Icon:
|
|
529
|
+
Icon: ht
|
|
467
530
|
}
|
|
468
|
-
],
|
|
469
|
-
n.current && (n.current.getTracks().forEach((
|
|
470
|
-
},
|
|
531
|
+
], _ = () => {
|
|
532
|
+
n.current && (n.current.getTracks().forEach((f) => f.stop()), n.current = null);
|
|
533
|
+
}, y = async () => {
|
|
471
534
|
m(!0), u(null);
|
|
472
535
|
try {
|
|
473
|
-
const
|
|
536
|
+
const f = await navigator.mediaDevices.getUserMedia({
|
|
474
537
|
video: { width: { ideal: 1280 }, height: { ideal: 720 } },
|
|
475
538
|
audio: !0
|
|
476
539
|
});
|
|
477
|
-
n.current =
|
|
478
|
-
} catch (
|
|
479
|
-
console.error("Media permission error:",
|
|
480
|
-
let
|
|
481
|
-
(
|
|
540
|
+
n.current = f, s.current && (s.current.srcObject = f), w(!0);
|
|
541
|
+
} catch (f) {
|
|
542
|
+
console.error("Media permission error:", f);
|
|
543
|
+
let M = "Unable to access camera or microphone.";
|
|
544
|
+
(f == null ? void 0 : f.name) === "NotAllowedError" ? M = "Permissions denied. Please allow access to camera and microphone." : (f == null ? void 0 : f.name) === "NotFoundError" ? M = "No camera/microphone found. Please connect a device and retry." : f != null && f.message && (M = f.message), w(!1), u(M);
|
|
482
545
|
} finally {
|
|
483
546
|
m(!1);
|
|
484
547
|
}
|
|
485
548
|
};
|
|
486
549
|
if (C(() => {
|
|
487
|
-
if (!
|
|
488
|
-
|
|
550
|
+
if (!i) {
|
|
551
|
+
_();
|
|
489
552
|
return;
|
|
490
553
|
}
|
|
491
|
-
return
|
|
492
|
-
|
|
554
|
+
return y(), () => {
|
|
555
|
+
_();
|
|
493
556
|
};
|
|
494
|
-
}, [
|
|
495
|
-
const
|
|
496
|
-
r(),
|
|
557
|
+
}, [i]), !i) return null;
|
|
558
|
+
const R = () => {
|
|
559
|
+
r(), _();
|
|
497
560
|
};
|
|
498
561
|
return /* @__PURE__ */ e.jsx("div", { className: "iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-gray-900/25 iw-backdrop-blur-md iw-p-4", children: /* @__PURE__ */ e.jsxs("div", { className: " iw-w-full iw-max-w-[920px] iw-max-h-[96vh] iw-overflow-auto iw-rounded-3xl iw-bg-white iw-shadow-[0_40px_80px_-28px_rgba(15,23,42,0.25)]", children: [
|
|
499
562
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -534,7 +597,7 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
534
597
|
),
|
|
535
598
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-relative iw-grid md:iw-grid-cols-[minmax(0,1fr)_auto] iw-items-start iw-gap-6 iw-px-6 iw-py-7", children: [
|
|
536
599
|
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-flex-col iw-gap-4 iw-text-white", children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-start iw-gap-4", children: [
|
|
537
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-12 iw-w-12 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-white/15 iw-shadow-inner", children: /* @__PURE__ */ e.jsx(
|
|
600
|
+
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-12 iw-w-12 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-white/15 iw-shadow-inner", children: /* @__PURE__ */ e.jsx($e, { className: "iw-h-6 iw-w-6" }) }),
|
|
538
601
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
539
602
|
/* @__PURE__ */ e.jsx("p", { className: "iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-white/70", children: "Pre-interview checklist" }),
|
|
540
603
|
/* @__PURE__ */ e.jsx("h2", { className: "iw-mt-1 iw-text-xl iw-font-semibold iw-leading-tight", children: "Final checks before you go live" }),
|
|
@@ -544,25 +607,25 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
544
607
|
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-items-start iw-justify-end", children: /* @__PURE__ */ e.jsxs(
|
|
545
608
|
"div",
|
|
546
609
|
{
|
|
547
|
-
className: `iw-inline-flex iw-items-center iw-gap-2 iw-rounded-full iw-bg-white/10 iw-px-4 iw-py-1.5 iw-text-xs iw-font-medium iw-text-white/85 iw-backdrop-blur-sm ${
|
|
610
|
+
className: `iw-inline-flex iw-items-center iw-gap-2 iw-rounded-full iw-bg-white/10 iw-px-4 iw-py-1.5 iw-text-xs iw-font-medium iw-text-white/85 iw-backdrop-blur-sm ${v.toneClass}`,
|
|
548
611
|
children: [
|
|
549
612
|
/* @__PURE__ */ e.jsx(
|
|
550
613
|
"span",
|
|
551
614
|
{
|
|
552
|
-
className: `iw-inline-flex iw-h-2 iw-w-2 iw-rounded-full ${
|
|
615
|
+
className: `iw-inline-flex iw-h-2 iw-w-2 iw-rounded-full ${v.dotClass}`
|
|
553
616
|
}
|
|
554
617
|
),
|
|
555
|
-
|
|
618
|
+
v.label
|
|
556
619
|
]
|
|
557
620
|
}
|
|
558
621
|
) }),
|
|
559
|
-
|
|
622
|
+
t && /* @__PURE__ */ e.jsx(
|
|
560
623
|
"button",
|
|
561
624
|
{
|
|
562
625
|
"aria-label": "Close",
|
|
563
626
|
className: "iw-absolute iw-top-5 iw-right-5 iw-text-white/70 transition-colors hover:iw-text-white",
|
|
564
627
|
onClick: () => {
|
|
565
|
-
|
|
628
|
+
_(), t == null || t();
|
|
566
629
|
},
|
|
567
630
|
children: "✕"
|
|
568
631
|
}
|
|
@@ -578,7 +641,7 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
578
641
|
/* @__PURE__ */ e.jsx("h3", { className: "iw-text-sm iw-font-semibold iw-text-slate-900", children: "Proctoring guidelines" }),
|
|
579
642
|
/* @__PURE__ */ e.jsx("span", { className: "iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-slate-400", children: "Required" })
|
|
580
643
|
] }),
|
|
581
|
-
/* @__PURE__ */ e.jsx("ul", { className: "iw-mt-5 iw-flex iw-flex-col iw-gap-4", children:
|
|
644
|
+
/* @__PURE__ */ e.jsx("ul", { className: "iw-mt-5 iw-flex iw-flex-col iw-gap-4", children: mt.map((f, M) => /* @__PURE__ */ e.jsx(
|
|
582
645
|
"li",
|
|
583
646
|
{
|
|
584
647
|
className: "iw-group iw-overflow-hidden iw-rounded-xl iw-border iw-border-slate-100 iw-bg-slate-50/60 iw-p-4 iw-transition-all hover:iw-border-slate-200 hover:iw-bg-white",
|
|
@@ -588,13 +651,13 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
588
651
|
{
|
|
589
652
|
className: "iw-flex iw-h-8 iw-w-8 iw-flex-none iw-items-center iw-justify-center iw-rounded-full iw-text-sm iw-font-semibold iw-text-white",
|
|
590
653
|
style: { background: x },
|
|
591
|
-
children:
|
|
654
|
+
children: M + 1
|
|
592
655
|
}
|
|
593
656
|
),
|
|
594
|
-
/* @__PURE__ */ e.jsx("span", { className: "iw-text-sm iw-text-slate-600", children:
|
|
657
|
+
/* @__PURE__ */ e.jsx("span", { className: "iw-text-sm iw-text-slate-600", children: f })
|
|
595
658
|
] })
|
|
596
659
|
},
|
|
597
|
-
|
|
660
|
+
f
|
|
598
661
|
)) })
|
|
599
662
|
] }) }),
|
|
600
663
|
/* @__PURE__ */ e.jsxs("section", { className: "iw-flex iw-flex-col iw-gap-5", children: [
|
|
@@ -602,7 +665,7 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
602
665
|
"div",
|
|
603
666
|
{
|
|
604
667
|
className: "iw-relative iw-flex iw-flex-col iw-gap-6 iw-overflow-hidden iw-rounded-3xl iw-bg-white ",
|
|
605
|
-
style: { borderRadius:
|
|
668
|
+
style: { borderRadius: b },
|
|
606
669
|
children: [
|
|
607
670
|
/* @__PURE__ */ e.jsx("div", { className: "iw-relative iw-z-10 iw-rounded-2xl iw-border iw-border-slate-200 iw-bg-slate-50/80 iw-p-3", children: /* @__PURE__ */ e.jsx(
|
|
608
671
|
"video",
|
|
@@ -614,31 +677,31 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
614
677
|
className: "iw-h-64 iw-w-full iw-rounded-2xl iw-object-cover",
|
|
615
678
|
style: {
|
|
616
679
|
transform: "scaleX(-1)",
|
|
617
|
-
borderRadius:
|
|
680
|
+
borderRadius: b
|
|
618
681
|
}
|
|
619
682
|
}
|
|
620
683
|
) }),
|
|
621
684
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-relative iw-grid iw-grid-cols-2 iw-gap-4 iw-px-1", children: [
|
|
622
685
|
/* @__PURE__ */ e.jsx(
|
|
623
|
-
|
|
686
|
+
Pe,
|
|
624
687
|
{
|
|
625
|
-
onClick:
|
|
688
|
+
onClick: y,
|
|
626
689
|
disabled: h,
|
|
627
690
|
variant: "outline",
|
|
628
691
|
size: "sm",
|
|
629
692
|
className: "iw-font-medium",
|
|
630
693
|
style: {
|
|
631
694
|
borderColor: c,
|
|
632
|
-
borderRadius:
|
|
695
|
+
borderRadius: b,
|
|
633
696
|
color: c
|
|
634
697
|
},
|
|
635
698
|
children: l ? "Recheck permissions" : "Enable camera & mic"
|
|
636
699
|
}
|
|
637
700
|
),
|
|
638
701
|
/* @__PURE__ */ e.jsx(
|
|
639
|
-
|
|
702
|
+
V,
|
|
640
703
|
{
|
|
641
|
-
onClick:
|
|
704
|
+
onClick: R,
|
|
642
705
|
disabled: !l,
|
|
643
706
|
className: "iw-h-10 iw-px-6 iw-text-sm",
|
|
644
707
|
style: {
|
|
@@ -651,21 +714,21 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
651
714
|
]
|
|
652
715
|
}
|
|
653
716
|
),
|
|
654
|
-
/* @__PURE__ */ e.jsx("ul", { className: "iw-grid sm:iw-grid-cols-1 iw-gap-3", children:
|
|
655
|
-
({ Icon:
|
|
717
|
+
/* @__PURE__ */ e.jsx("ul", { className: "iw-grid sm:iw-grid-cols-1 iw-gap-3", children: N.map(
|
|
718
|
+
({ Icon: f, label: M, description: L, status: O, toneClass: q }) => /* @__PURE__ */ e.jsx(
|
|
656
719
|
"li",
|
|
657
720
|
{
|
|
658
721
|
className: "iw-rounded-2xl iw-border iw-border-slate-200/65 iw-bg-white iw-p-4 iw-shadow-sm iw-transition-all hover:iw-border-slate-200",
|
|
659
722
|
children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-start iw-gap-3", children: [
|
|
660
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-10 iw-w-10 iw-flex-none iw-items-center iw-justify-center iw-rounded-xl iw-bg-slate-100", children: /* @__PURE__ */ e.jsx(
|
|
723
|
+
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-10 iw-w-10 iw-flex-none iw-items-center iw-justify-center iw-rounded-xl iw-bg-slate-100", children: /* @__PURE__ */ e.jsx(f, { className: "iw-h-5 iw-w-5 iw-text-slate-600" }) }),
|
|
661
724
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex-1", children: [
|
|
662
725
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between iw-gap-3", children: [
|
|
663
|
-
/* @__PURE__ */ e.jsx("p", { className: "iw-text-sm iw-font-medium iw-text-slate-800", children:
|
|
726
|
+
/* @__PURE__ */ e.jsx("p", { className: "iw-text-sm iw-font-medium iw-text-slate-800", children: M }),
|
|
664
727
|
/* @__PURE__ */ e.jsx(
|
|
665
728
|
"span",
|
|
666
729
|
{
|
|
667
|
-
className: `iw-rounded-full iw-px-3 iw-py-1 iw-text-[11px] iw-font-semibold ${
|
|
668
|
-
children:
|
|
730
|
+
className: `iw-rounded-full iw-px-3 iw-py-1 iw-text-[11px] iw-font-semibold ${q}`,
|
|
731
|
+
children: O
|
|
669
732
|
}
|
|
670
733
|
)
|
|
671
734
|
] }),
|
|
@@ -673,11 +736,11 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
673
736
|
] })
|
|
674
737
|
] })
|
|
675
738
|
},
|
|
676
|
-
|
|
739
|
+
M
|
|
677
740
|
)
|
|
678
741
|
) }),
|
|
679
|
-
|
|
680
|
-
!((
|
|
742
|
+
d && /* @__PURE__ */ e.jsx("div", { className: "iw-rounded-lg iw-border iw-border-rose-200 iw-bg-rose-50 iw-px-3 iw-py-2 iw-text-xs iw-text-rose-600", children: d }),
|
|
743
|
+
!((A = navigator.mediaDevices) != null && A.getUserMedia) && /* @__PURE__ */ e.jsx("div", { className: "iw-rounded-lg iw-border iw-border-amber-200 iw-bg-amber-50 iw-px-3 iw-py-2 iw-text-xs iw-text-amber-700", children: "Your browser does not support media devices. Please use a modern browser like Chrome, Edge, or Firefox." })
|
|
681
744
|
] })
|
|
682
745
|
] }),
|
|
683
746
|
/* @__PURE__ */ e.jsx("div", { className: " iw-rounded-2xl iw-border iw-border-dashed iw-border-slate-200 iw-bg-slate-50/85 iw-px-5 iw-py-4 iw-text-center", children: /* @__PURE__ */ e.jsx("div", { className: "iw-text-xs iw-text-slate-500", children: "Your session is monitored to protect exam integrity. Continuing confirms you have reviewed and accept these safeguards." }) }),
|
|
@@ -687,7 +750,7 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
687
750
|
"aria-hidden": !0,
|
|
688
751
|
className: "iw-pointer-events-none iw-absolute iw-inset-x-0 iw-bottom-1 iw-h-20",
|
|
689
752
|
style: {
|
|
690
|
-
backgroundImage:
|
|
753
|
+
backgroundImage: g,
|
|
691
754
|
backgroundSize: "100% 120%, 100% 120%, 100% 120%, 32px 32px",
|
|
692
755
|
backgroundPosition: "center bottom, left 95% bottom, right 95% bottom, center bottom",
|
|
693
756
|
backgroundRepeat: "no-repeat, no-repeat, no-repeat, repeat",
|
|
@@ -701,12 +764,12 @@ const De = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
701
764
|
] })
|
|
702
765
|
] }) });
|
|
703
766
|
};
|
|
704
|
-
var
|
|
705
|
-
const
|
|
767
|
+
var D = /* @__PURE__ */ ((i) => (i.IDLE = "idle", i.FETCHING_QUESTION = "fetching_question", i.READING_QUESTION = "reading_question", i.THINKING = "thinking", i.ANSWERING = "answering", i.TRANSCRIBING = "transcribing", i.EDITING = "editing", i.SUBMITTING = "submitting", i.COMPLETED = "completed", i))(D || {});
|
|
768
|
+
const ft = {
|
|
706
769
|
thinkingDuration: 30,
|
|
707
770
|
answeringDuration: 120,
|
|
708
771
|
editingDuration: 30
|
|
709
|
-
},
|
|
772
|
+
}, xt = {
|
|
710
773
|
idle: {
|
|
711
774
|
next: "fetching_question"
|
|
712
775
|
/* FETCHING_QUESTION */
|
|
@@ -735,14 +798,14 @@ const rt = {
|
|
|
735
798
|
/* COMPLETED */
|
|
736
799
|
}
|
|
737
800
|
};
|
|
738
|
-
class
|
|
739
|
-
constructor(r = {},
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
this.config = { ...
|
|
801
|
+
class pt {
|
|
802
|
+
constructor(r = {}, t = {}) {
|
|
803
|
+
F(this, "config");
|
|
804
|
+
F(this, "state");
|
|
805
|
+
F(this, "phaseIntervalId", null);
|
|
806
|
+
F(this, "globalIntervalId", null);
|
|
807
|
+
F(this, "callbacks");
|
|
808
|
+
this.config = { ...ft, ...r }, this.callbacks = t, this.state = {
|
|
746
809
|
phase: "idle",
|
|
747
810
|
currentPhaseTimeRemaining: 0,
|
|
748
811
|
totalTimeElapsed: 0,
|
|
@@ -765,18 +828,18 @@ class nt {
|
|
|
765
828
|
* Move to next phase
|
|
766
829
|
*/
|
|
767
830
|
nextPhase() {
|
|
768
|
-
const r = this.state.phase,
|
|
769
|
-
if (!
|
|
770
|
-
this.stopPhaseTimer(), this.state.phase =
|
|
771
|
-
const s = this.getDurationForPhase(
|
|
831
|
+
const r = this.state.phase, t = xt[r];
|
|
832
|
+
if (!t) return;
|
|
833
|
+
this.stopPhaseTimer(), this.state.phase = t.next;
|
|
834
|
+
const s = this.getDurationForPhase(t.next);
|
|
772
835
|
s > 0 ? (this.state.currentPhaseTimeRemaining = s, this.startPhaseTimer()) : this.state.currentPhaseTimeRemaining = 0, this.notifyChange();
|
|
773
836
|
}
|
|
774
837
|
/**
|
|
775
838
|
* Manually complete the interview
|
|
776
839
|
*/
|
|
777
840
|
completeInterview() {
|
|
778
|
-
var r,
|
|
779
|
-
this.stopGlobalTimer(), this.stopPhaseTimer(), this.state.phase = "completed", (
|
|
841
|
+
var r, t;
|
|
842
|
+
this.stopGlobalTimer(), this.stopPhaseTimer(), this.state.phase = "completed", (t = (r = this.callbacks).onInterviewEnd) == null || t.call(r), this.notifyChange();
|
|
780
843
|
}
|
|
781
844
|
/**
|
|
782
845
|
* Cleanup
|
|
@@ -804,8 +867,8 @@ class nt {
|
|
|
804
867
|
*/
|
|
805
868
|
startGlobalTimer() {
|
|
806
869
|
this.globalIntervalId = setInterval(() => {
|
|
807
|
-
var r,
|
|
808
|
-
this.state.totalTimeElapsed++, (
|
|
870
|
+
var r, t;
|
|
871
|
+
this.state.totalTimeElapsed++, (t = (r = this.callbacks).onTick) == null || t.call(r, this.getState());
|
|
809
872
|
}, 1e3);
|
|
810
873
|
}
|
|
811
874
|
/**
|
|
@@ -832,61 +895,61 @@ class nt {
|
|
|
832
895
|
* Notify phase change
|
|
833
896
|
*/
|
|
834
897
|
notifyChange() {
|
|
835
|
-
var r,
|
|
836
|
-
(
|
|
898
|
+
var r, t;
|
|
899
|
+
(t = (r = this.callbacks).onPhaseChange) == null || t.call(r, this.state.phase, this.getState());
|
|
837
900
|
}
|
|
838
901
|
}
|
|
839
|
-
function
|
|
840
|
-
const { config: r = {}, callbacks:
|
|
841
|
-
s.current || (s.current = new
|
|
842
|
-
const n = s.current, [o, a] = k(n.getState()), l =
|
|
902
|
+
function bt(i = {}) {
|
|
903
|
+
const { config: r = {}, callbacks: t = {} } = i, s = E(null);
|
|
904
|
+
s.current || (s.current = new pt(r, {}));
|
|
905
|
+
const n = s.current, [o, a] = k(n.getState()), l = T(() => {
|
|
843
906
|
a(n.getState());
|
|
844
907
|
}, [n]);
|
|
845
908
|
C(() => {
|
|
846
909
|
const h = {
|
|
847
910
|
onPhaseChange: (m, c) => {
|
|
848
911
|
var x;
|
|
849
|
-
l(), (x =
|
|
912
|
+
l(), (x = t.onPhaseChange) == null || x.call(t, m, c);
|
|
850
913
|
},
|
|
851
914
|
onTick: (m) => {
|
|
852
915
|
var c;
|
|
853
|
-
l(), (c =
|
|
916
|
+
l(), (c = t.onTick) == null || c.call(t, m);
|
|
854
917
|
},
|
|
855
918
|
onInterviewEnd: () => {
|
|
856
919
|
var m;
|
|
857
|
-
l(), (m =
|
|
920
|
+
l(), (m = t.onInterviewEnd) == null || m.call(t);
|
|
858
921
|
}
|
|
859
922
|
};
|
|
860
923
|
n.callbacks = h;
|
|
861
|
-
}, [n,
|
|
924
|
+
}, [n, t, l]), C(() => () => {
|
|
862
925
|
n.destroy();
|
|
863
926
|
}, [n]);
|
|
864
|
-
const
|
|
927
|
+
const w = T(() => {
|
|
865
928
|
n.startQuestion(), l();
|
|
866
|
-
}, [n, l]),
|
|
929
|
+
}, [n, l]), d = T(() => {
|
|
867
930
|
n.nextPhase(), l();
|
|
868
|
-
}, [n, l]), u =
|
|
931
|
+
}, [n, l]), u = T(() => {
|
|
869
932
|
n.completeInterview(), l();
|
|
870
933
|
}, [n, l]);
|
|
871
934
|
return {
|
|
872
935
|
state: o,
|
|
873
|
-
startQuestion:
|
|
874
|
-
nextPhase:
|
|
936
|
+
startQuestion: w,
|
|
937
|
+
nextPhase: d,
|
|
875
938
|
completeInterview: u,
|
|
876
939
|
timerService: n
|
|
877
940
|
};
|
|
878
941
|
}
|
|
879
|
-
function
|
|
880
|
-
const [
|
|
942
|
+
function yt(i, r = {}) {
|
|
943
|
+
const [t, s] = k({
|
|
881
944
|
data: null,
|
|
882
945
|
loading: !1,
|
|
883
946
|
error: null
|
|
884
|
-
}), n =
|
|
947
|
+
}), n = T(
|
|
885
948
|
async (...o) => {
|
|
886
|
-
var a, l,
|
|
949
|
+
var a, l, w, d;
|
|
887
950
|
s((u) => ({ ...u, loading: !0, error: null }));
|
|
888
951
|
try {
|
|
889
|
-
const u = await
|
|
952
|
+
const u = await i(...o);
|
|
890
953
|
s((h) => ({
|
|
891
954
|
...h,
|
|
892
955
|
data: u,
|
|
@@ -905,46 +968,46 @@ function ot(t, r = {}) {
|
|
|
905
968
|
...m,
|
|
906
969
|
loading: !1,
|
|
907
970
|
error: h
|
|
908
|
-
})), (
|
|
971
|
+
})), (w = r.onError) == null || w.call(r, h), (d = r.onSettled) == null || d.call(r, null, h);
|
|
909
972
|
}
|
|
910
973
|
},
|
|
911
|
-
[
|
|
974
|
+
[i, r]
|
|
912
975
|
);
|
|
913
976
|
return {
|
|
914
|
-
...
|
|
977
|
+
...t,
|
|
915
978
|
execute: n
|
|
916
979
|
};
|
|
917
980
|
}
|
|
918
|
-
const
|
|
919
|
-
const [r,
|
|
981
|
+
const vt = (i) => {
|
|
982
|
+
const [r, t] = k(null), [s, n] = k(!1), o = document, a = () => !!(o.fullscreenEnabled || o.webkitFullscreenEnabled || o.mozFullScreenEnabled || o.msFullscreenEnabled), l = () => o.fullscreenElement || o.webkitFullscreenElement || o.mozFullScreenElement || o.msFullscreenElement, w = async (c) => {
|
|
920
983
|
var x;
|
|
921
984
|
try {
|
|
922
985
|
if (!a())
|
|
923
986
|
throw new Error("Fullscreen is not supported in this environment");
|
|
924
987
|
c.requestFullscreen ? await c.requestFullscreen() : c.webkitRequestFullscreen ? await c.webkitRequestFullscreen() : c.mozRequestFullScreen ? await c.mozRequestFullScreen() : c.msRequestFullscreen && await c.msRequestFullscreen();
|
|
925
|
-
} catch (
|
|
988
|
+
} catch (b) {
|
|
926
989
|
const j = {
|
|
927
990
|
name: "FullscreenError",
|
|
928
|
-
message:
|
|
991
|
+
message: b instanceof Error ? b.message : "Failed to enter fullscreen"
|
|
929
992
|
};
|
|
930
|
-
|
|
993
|
+
t(j), (x = i == null ? void 0 : i.onError) == null || x.call(i, j);
|
|
931
994
|
}
|
|
932
|
-
},
|
|
995
|
+
}, d = async () => {
|
|
933
996
|
var c;
|
|
934
997
|
try {
|
|
935
998
|
o.exitFullscreen ? await o.exitFullscreen() : o.webkitExitFullscreen ? await o.webkitExitFullscreen() : o.mozCancelFullScreen ? await o.mozCancelFullScreen() : o.msExitFullscreen && await o.msExitFullscreen();
|
|
936
999
|
} catch (x) {
|
|
937
|
-
const
|
|
1000
|
+
const b = {
|
|
938
1001
|
name: "FullscreenError",
|
|
939
1002
|
message: x instanceof Error ? x.message : "Failed to exit fullscreen"
|
|
940
1003
|
};
|
|
941
|
-
|
|
1004
|
+
t(b), (c = i == null ? void 0 : i.onError) == null || c.call(i, b);
|
|
942
1005
|
}
|
|
943
|
-
}, u =
|
|
1006
|
+
}, u = T(() => {
|
|
944
1007
|
var x;
|
|
945
1008
|
const c = !!l();
|
|
946
|
-
n(c), (x =
|
|
947
|
-
}, [
|
|
1009
|
+
n(c), (x = i == null ? void 0 : i.onFullScreenChange) == null || x.call(i, c);
|
|
1010
|
+
}, [i]);
|
|
948
1011
|
C(() => {
|
|
949
1012
|
const c = [
|
|
950
1013
|
"fullscreenchange",
|
|
@@ -961,21 +1024,21 @@ const lt = (t) => {
|
|
|
961
1024
|
};
|
|
962
1025
|
}, [u]);
|
|
963
1026
|
const h = async (c) => {
|
|
964
|
-
|
|
1027
|
+
t(null);
|
|
965
1028
|
const x = c ?? document.documentElement;
|
|
966
|
-
await
|
|
1029
|
+
await w(x);
|
|
967
1030
|
};
|
|
968
1031
|
return {
|
|
969
1032
|
isFullScreen: s,
|
|
970
1033
|
toggleFullScreen: async (c) => {
|
|
971
|
-
s ? await
|
|
1034
|
+
s ? await d() : await h(c);
|
|
972
1035
|
},
|
|
973
1036
|
enterFullScreen: h,
|
|
974
|
-
exitFullScreen:
|
|
1037
|
+
exitFullScreen: d,
|
|
975
1038
|
error: r
|
|
976
1039
|
};
|
|
977
1040
|
};
|
|
978
|
-
function
|
|
1041
|
+
function jt(i) {
|
|
979
1042
|
var r;
|
|
980
1043
|
if (!navigator.onLine)
|
|
981
1044
|
return {
|
|
@@ -984,57 +1047,57 @@ function ct(t) {
|
|
|
984
1047
|
retryable: !0,
|
|
985
1048
|
userMessage: "Please check your internet connection and try again."
|
|
986
1049
|
};
|
|
987
|
-
if (
|
|
1050
|
+
if (i.name === "AbortError" || (r = i.message) != null && r.includes("timeout"))
|
|
988
1051
|
return {
|
|
989
1052
|
type: "timeout",
|
|
990
1053
|
message: "Request timed out",
|
|
991
1054
|
retryable: !0,
|
|
992
1055
|
userMessage: "The request is taking longer than expected. Please try again."
|
|
993
1056
|
};
|
|
994
|
-
if (
|
|
995
|
-
const { status:
|
|
996
|
-
if (
|
|
1057
|
+
if (i.status) {
|
|
1058
|
+
const { status: t } = i;
|
|
1059
|
+
if (t === 401 || t === 403)
|
|
997
1060
|
return {
|
|
998
1061
|
type: "auth",
|
|
999
|
-
status:
|
|
1062
|
+
status: t,
|
|
1000
1063
|
message: "Authentication failed",
|
|
1001
1064
|
retryable: !1,
|
|
1002
1065
|
userMessage: "Your session has expired. Please refresh the page."
|
|
1003
1066
|
};
|
|
1004
|
-
if (
|
|
1067
|
+
if (t === 429)
|
|
1005
1068
|
return {
|
|
1006
1069
|
type: "rate-limit",
|
|
1007
|
-
status:
|
|
1070
|
+
status: t,
|
|
1008
1071
|
message: "Too many requests",
|
|
1009
1072
|
retryable: !0,
|
|
1010
1073
|
userMessage: "Please wait a moment before trying again."
|
|
1011
1074
|
};
|
|
1012
|
-
if (
|
|
1075
|
+
if (t >= 500)
|
|
1013
1076
|
return {
|
|
1014
1077
|
type: "server",
|
|
1015
|
-
status:
|
|
1016
|
-
message: `Server error: ${
|
|
1078
|
+
status: t,
|
|
1079
|
+
message: `Server error: ${t}`,
|
|
1017
1080
|
retryable: !0,
|
|
1018
1081
|
userMessage: "Our servers are experiencing issues. Please try again in a few moments."
|
|
1019
1082
|
};
|
|
1020
|
-
if (
|
|
1083
|
+
if (t >= 400)
|
|
1021
1084
|
return {
|
|
1022
1085
|
type: "client",
|
|
1023
|
-
status:
|
|
1024
|
-
message: `Client error: ${
|
|
1086
|
+
status: t,
|
|
1087
|
+
message: `Client error: ${t}`,
|
|
1025
1088
|
retryable: !1,
|
|
1026
1089
|
userMessage: "There was an issue with your request. Please check your input."
|
|
1027
1090
|
};
|
|
1028
1091
|
}
|
|
1029
1092
|
return {
|
|
1030
1093
|
type: "unknown",
|
|
1031
|
-
message:
|
|
1094
|
+
message: i.message || "Unknown error occurred",
|
|
1032
1095
|
retryable: !0,
|
|
1033
1096
|
userMessage: "Something unexpected happened. Please try again.",
|
|
1034
|
-
originalError:
|
|
1097
|
+
originalError: i
|
|
1035
1098
|
};
|
|
1036
1099
|
}
|
|
1037
|
-
async function
|
|
1100
|
+
async function be(i, r = {}, t = {
|
|
1038
1101
|
attempts: 3,
|
|
1039
1102
|
backoff: "exponential",
|
|
1040
1103
|
baseDelay: 1e3,
|
|
@@ -1042,9 +1105,9 @@ async function he(t, r = {}, i = {
|
|
|
1042
1105
|
jitter: !0
|
|
1043
1106
|
}) {
|
|
1044
1107
|
let s;
|
|
1045
|
-
for (let n = 1; n <=
|
|
1108
|
+
for (let n = 1; n <= t.attempts; n++)
|
|
1046
1109
|
try {
|
|
1047
|
-
const o = new AbortController(), a = setTimeout(() => o.abort(), 6e4), l = await fetch(
|
|
1110
|
+
const o = new AbortController(), a = setTimeout(() => o.abort(), 6e4), l = await fetch(i, {
|
|
1048
1111
|
...r,
|
|
1049
1112
|
signal: o.signal
|
|
1050
1113
|
});
|
|
@@ -1055,24 +1118,24 @@ async function he(t, r = {}, i = {
|
|
|
1055
1118
|
return l;
|
|
1056
1119
|
} catch (o) {
|
|
1057
1120
|
s = o;
|
|
1058
|
-
const a =
|
|
1059
|
-
if (!a.retryable || n ===
|
|
1121
|
+
const a = jt(o);
|
|
1122
|
+
if (!a.retryable || n === t.attempts)
|
|
1060
1123
|
throw a;
|
|
1061
|
-
const l =
|
|
1124
|
+
const l = Nt(n, t);
|
|
1062
1125
|
console.warn(
|
|
1063
|
-
`API request failed (attempt ${n}/${
|
|
1126
|
+
`API request failed (attempt ${n}/${t.attempts}), retrying in ${l}ms:`,
|
|
1064
1127
|
a.message
|
|
1065
|
-
), await new Promise((
|
|
1128
|
+
), await new Promise((w) => setTimeout(w, l));
|
|
1066
1129
|
}
|
|
1067
1130
|
throw s;
|
|
1068
1131
|
}
|
|
1069
|
-
function
|
|
1070
|
-
let
|
|
1071
|
-
return r.backoff === "exponential" ?
|
|
1132
|
+
function Nt(i, r) {
|
|
1133
|
+
let t;
|
|
1134
|
+
return r.backoff === "exponential" ? t = r.baseDelay * Math.pow(2, i - 1) : t = r.baseDelay, t = Math.min(t, r.maxDelay), r.jitter && (t = t * (0.5 + Math.random() * 0.5)), Math.round(t);
|
|
1072
1135
|
}
|
|
1073
|
-
class
|
|
1136
|
+
class kt {
|
|
1074
1137
|
constructor(r = {}) {
|
|
1075
|
-
|
|
1138
|
+
F(this, "config");
|
|
1076
1139
|
this.config = r;
|
|
1077
1140
|
}
|
|
1078
1141
|
/**
|
|
@@ -1085,11 +1148,11 @@ class wt {
|
|
|
1085
1148
|
* Get default headers for API requests
|
|
1086
1149
|
*/
|
|
1087
1150
|
getHeaders() {
|
|
1088
|
-
var
|
|
1151
|
+
var t;
|
|
1089
1152
|
const r = {
|
|
1090
1153
|
"Content-Type": "application/json"
|
|
1091
1154
|
};
|
|
1092
|
-
return (
|
|
1155
|
+
return (t = this.config) != null && t.authToken && (r.Authorization = `Bearer ${this.config.authToken}`), r;
|
|
1093
1156
|
}
|
|
1094
1157
|
/**
|
|
1095
1158
|
* Get base URL from config with fallback
|
|
@@ -1103,20 +1166,20 @@ class wt {
|
|
|
1103
1166
|
*/
|
|
1104
1167
|
async generateQuestion({
|
|
1105
1168
|
interviewId: r,
|
|
1106
|
-
isInterviewDone:
|
|
1169
|
+
isInterviewDone: t = !1,
|
|
1107
1170
|
qnaId: s,
|
|
1108
1171
|
question: n,
|
|
1109
1172
|
answer: o,
|
|
1110
1173
|
answerDuration: a
|
|
1111
1174
|
}) {
|
|
1112
|
-
const l = await
|
|
1175
|
+
const l = await be(
|
|
1113
1176
|
`${this.getBaseUrl()}/questions/next`,
|
|
1114
1177
|
{
|
|
1115
1178
|
method: "POST",
|
|
1116
1179
|
headers: this.getHeaders(),
|
|
1117
1180
|
body: JSON.stringify({
|
|
1118
1181
|
interview_id: r,
|
|
1119
|
-
is_interview_done:
|
|
1182
|
+
is_interview_done: t,
|
|
1120
1183
|
qna_id: s,
|
|
1121
1184
|
question: n,
|
|
1122
1185
|
answer: o,
|
|
@@ -1130,31 +1193,31 @@ class wt {
|
|
|
1130
1193
|
return await l.json();
|
|
1131
1194
|
}
|
|
1132
1195
|
}
|
|
1133
|
-
function
|
|
1134
|
-
const
|
|
1135
|
-
return
|
|
1136
|
-
const
|
|
1137
|
-
return new
|
|
1138
|
-
}, [
|
|
1196
|
+
function Et() {
|
|
1197
|
+
const i = le();
|
|
1198
|
+
return ee(() => {
|
|
1199
|
+
const t = i.api || {};
|
|
1200
|
+
return new kt(t);
|
|
1201
|
+
}, [i.api]);
|
|
1139
1202
|
}
|
|
1140
|
-
const
|
|
1203
|
+
const Tt = (i) => {
|
|
1141
1204
|
C(() => {
|
|
1142
1205
|
const r = (s) => {
|
|
1143
|
-
(s.ctrlKey || s.metaKey) && ["c", "v", "a", "t", "n", "w", "r", "s", "p"].includes(s.key.toLowerCase()) && (s.preventDefault(),
|
|
1206
|
+
(s.ctrlKey || s.metaKey) && ["c", "v", "a", "t", "n", "w", "r", "s", "p"].includes(s.key.toLowerCase()) && (s.preventDefault(), i({
|
|
1144
1207
|
type: "blocked_shortcut",
|
|
1145
1208
|
severity: "low",
|
|
1146
1209
|
details: {
|
|
1147
1210
|
action: "shortcut_pressed",
|
|
1148
1211
|
reason: `Attempted to use a blocked keyboard shortcut: Ctrl + ${s.key}`
|
|
1149
1212
|
}
|
|
1150
|
-
})), s.key.startsWith("F") && s.key.length <= 3 && (s.preventDefault(),
|
|
1213
|
+
})), s.key.startsWith("F") && s.key.length <= 3 && (s.preventDefault(), i({
|
|
1151
1214
|
type: "blocked_function_key",
|
|
1152
1215
|
severity: "low",
|
|
1153
1216
|
details: {
|
|
1154
1217
|
action: "function_key_pressed",
|
|
1155
1218
|
reason: `Attempted to use a blocked function key: ${s.key}`
|
|
1156
1219
|
}
|
|
1157
|
-
})), s.altKey && s.key === "Tab" && (s.preventDefault(),
|
|
1220
|
+
})), s.altKey && s.key === "Tab" && (s.preventDefault(), i({
|
|
1158
1221
|
type: "alt_tab_attempt",
|
|
1159
1222
|
severity: "medium",
|
|
1160
1223
|
details: {
|
|
@@ -1162,8 +1225,8 @@ const ht = (t) => {
|
|
|
1162
1225
|
reason: "Attempted to use the Alt + Tab shortcut"
|
|
1163
1226
|
}
|
|
1164
1227
|
}));
|
|
1165
|
-
},
|
|
1166
|
-
s.preventDefault(),
|
|
1228
|
+
}, t = (s) => {
|
|
1229
|
+
s.preventDefault(), i({
|
|
1167
1230
|
type: "right_click_attempt",
|
|
1168
1231
|
severity: "low",
|
|
1169
1232
|
details: {
|
|
@@ -1172,23 +1235,23 @@ const ht = (t) => {
|
|
|
1172
1235
|
}
|
|
1173
1236
|
});
|
|
1174
1237
|
};
|
|
1175
|
-
return document.addEventListener("keydown", r), document.addEventListener("contextmenu",
|
|
1176
|
-
document.removeEventListener("keydown", r), document.removeEventListener("contextmenu",
|
|
1238
|
+
return document.addEventListener("keydown", r), document.addEventListener("contextmenu", t), () => {
|
|
1239
|
+
document.removeEventListener("keydown", r), document.removeEventListener("contextmenu", t);
|
|
1177
1240
|
};
|
|
1178
|
-
}, [
|
|
1241
|
+
}, [i]);
|
|
1179
1242
|
};
|
|
1180
|
-
class
|
|
1181
|
-
constructor(r,
|
|
1182
|
-
super(r), this.code =
|
|
1243
|
+
class I extends Error {
|
|
1244
|
+
constructor(r, t, s = !1) {
|
|
1245
|
+
super(r), this.code = t, this.recoverable = s, this.name = "STTError";
|
|
1183
1246
|
}
|
|
1184
1247
|
}
|
|
1185
|
-
class
|
|
1248
|
+
class Ct {
|
|
1186
1249
|
constructor(r = {}) {
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1250
|
+
F(this, "config");
|
|
1251
|
+
F(this, "mediaRecorder", null);
|
|
1252
|
+
F(this, "audioChunks", []);
|
|
1253
|
+
F(this, "recordingStream", null);
|
|
1254
|
+
F(this, "autoStopTimeoutId", null);
|
|
1192
1255
|
this.config = {
|
|
1193
1256
|
baseUrl: "http://localhost:8000",
|
|
1194
1257
|
provider: "groq",
|
|
@@ -1214,16 +1277,16 @@ class mt {
|
|
|
1214
1277
|
/**
|
|
1215
1278
|
* Start recording audio from user's microphone
|
|
1216
1279
|
*/
|
|
1217
|
-
async startRecording(r,
|
|
1280
|
+
async startRecording(r, t) {
|
|
1218
1281
|
var s;
|
|
1219
1282
|
if (!this.isRecordingSupported())
|
|
1220
|
-
throw new
|
|
1283
|
+
throw new I(
|
|
1221
1284
|
"Audio recording is not supported in this browser",
|
|
1222
1285
|
"RECORDING_NOT_SUPPORTED",
|
|
1223
1286
|
!1
|
|
1224
1287
|
);
|
|
1225
1288
|
if (this.isRecording())
|
|
1226
|
-
throw new
|
|
1289
|
+
throw new I(
|
|
1227
1290
|
"Recording is already in progress",
|
|
1228
1291
|
"ALREADY_RECORDING",
|
|
1229
1292
|
!0
|
|
@@ -1241,33 +1304,33 @@ class mt {
|
|
|
1241
1304
|
mimeType: n
|
|
1242
1305
|
}), this.mediaRecorder.ondataavailable = (o) => {
|
|
1243
1306
|
var a;
|
|
1244
|
-
o.data.size > 0 && (this.audioChunks.push(o.data), (a =
|
|
1307
|
+
o.data.size > 0 && (this.audioChunks.push(o.data), (a = t == null ? void 0 : t.onDataAvailable) == null || a.call(t, o.data));
|
|
1245
1308
|
}, this.mediaRecorder.onstop = () => {
|
|
1246
1309
|
var o;
|
|
1247
|
-
(o =
|
|
1310
|
+
(o = t == null ? void 0 : t.onStop) == null || o.call(t);
|
|
1248
1311
|
}, this.mediaRecorder.onerror = (o) => {
|
|
1249
1312
|
var l;
|
|
1250
|
-
const a = new
|
|
1313
|
+
const a = new I(
|
|
1251
1314
|
`Recording failed: ${o.error}`,
|
|
1252
1315
|
"RECORDING_ERROR",
|
|
1253
1316
|
!0
|
|
1254
1317
|
);
|
|
1255
|
-
(l =
|
|
1256
|
-
}, this.mediaRecorder.start(100), (s =
|
|
1318
|
+
(l = t == null ? void 0 : t.onError) == null || l.call(t, a), this.cleanup();
|
|
1319
|
+
}, this.mediaRecorder.start(100), (s = t == null ? void 0 : t.onStart) == null || s.call(t), r && r > 0 && (this.autoStopTimeoutId = setTimeout(() => {
|
|
1257
1320
|
this.isRecording() && this.stopRecording();
|
|
1258
1321
|
}, r * 1e3));
|
|
1259
1322
|
} catch (n) {
|
|
1260
1323
|
if (this.cleanup(), n instanceof Error) {
|
|
1261
1324
|
if (n.name === "NotAllowedError" || n.name === "PermissionDeniedError")
|
|
1262
|
-
throw new
|
|
1325
|
+
throw new I(
|
|
1263
1326
|
"Microphone permission was denied",
|
|
1264
1327
|
"PERMISSION_DENIED",
|
|
1265
1328
|
!1
|
|
1266
1329
|
);
|
|
1267
1330
|
if (n.name === "NotFoundError")
|
|
1268
|
-
throw new
|
|
1331
|
+
throw new I("No microphone found", "NO_MICROPHONE", !1);
|
|
1269
1332
|
}
|
|
1270
|
-
throw new
|
|
1333
|
+
throw new I(
|
|
1271
1334
|
`Failed to start recording: ${n instanceof Error ? n.message : String(n)}`,
|
|
1272
1335
|
"START_RECORDING_FAILED",
|
|
1273
1336
|
!0
|
|
@@ -1279,15 +1342,15 @@ class mt {
|
|
|
1279
1342
|
*/
|
|
1280
1343
|
async stopRecording() {
|
|
1281
1344
|
if (this.autoStopTimeoutId && (clearTimeout(this.autoStopTimeoutId), this.autoStopTimeoutId = null), !this.mediaRecorder || !this.isRecording())
|
|
1282
|
-
throw new
|
|
1345
|
+
throw new I(
|
|
1283
1346
|
"No active recording to stop",
|
|
1284
1347
|
"NO_ACTIVE_RECORDING",
|
|
1285
1348
|
!1
|
|
1286
1349
|
);
|
|
1287
|
-
return new Promise((r,
|
|
1350
|
+
return new Promise((r, t) => {
|
|
1288
1351
|
if (!this.mediaRecorder) {
|
|
1289
|
-
|
|
1290
|
-
new
|
|
1352
|
+
t(
|
|
1353
|
+
new I("MediaRecorder is null", "MEDIARECORDER_NULL", !1)
|
|
1291
1354
|
);
|
|
1292
1355
|
return;
|
|
1293
1356
|
}
|
|
@@ -1296,8 +1359,8 @@ class mt {
|
|
|
1296
1359
|
const o = s.mimeType || "audio/webm", a = new Blob(this.audioChunks, { type: o });
|
|
1297
1360
|
this.cleanup(), r(a);
|
|
1298
1361
|
} catch (o) {
|
|
1299
|
-
|
|
1300
|
-
new
|
|
1362
|
+
t(
|
|
1363
|
+
new I(
|
|
1301
1364
|
`Failed to create audio blob: ${o instanceof Error ? o.message : String(o)}`,
|
|
1302
1365
|
"BLOB_CREATION_FAILED",
|
|
1303
1366
|
!1
|
|
@@ -1313,24 +1376,24 @@ class mt {
|
|
|
1313
1376
|
*/
|
|
1314
1377
|
async transcribe(r) {
|
|
1315
1378
|
const {
|
|
1316
|
-
audioBlob:
|
|
1379
|
+
audioBlob: t,
|
|
1317
1380
|
model: s = this.config.model,
|
|
1318
1381
|
language: n = this.config.language,
|
|
1319
1382
|
includeTimestamps: o = this.config.includeTimestamps,
|
|
1320
1383
|
temperature: a = this.config.temperature
|
|
1321
1384
|
} = r;
|
|
1322
|
-
if (!
|
|
1323
|
-
throw new
|
|
1385
|
+
if (!t || t.size === 0)
|
|
1386
|
+
throw new I(
|
|
1324
1387
|
"Audio blob is empty or invalid",
|
|
1325
1388
|
"INVALID_AUDIO",
|
|
1326
1389
|
!1
|
|
1327
1390
|
);
|
|
1328
1391
|
try {
|
|
1329
|
-
const l = new FormData(),
|
|
1330
|
-
type:
|
|
1392
|
+
const l = new FormData(), w = new File([t], "recording.wav", {
|
|
1393
|
+
type: t.type || "audio/wav"
|
|
1331
1394
|
});
|
|
1332
|
-
l.append("file",
|
|
1333
|
-
const
|
|
1395
|
+
l.append("file", w), l.append("model", s || "whisper-large-v3-turbo"), l.append("language", n || "en"), l.append("include_timestamps", String(o || !1)), l.append("temperature", String(a || 0));
|
|
1396
|
+
const d = await be(
|
|
1334
1397
|
`${this.config.baseUrl}/speech/transcribe`,
|
|
1335
1398
|
{
|
|
1336
1399
|
method: "POST",
|
|
@@ -1351,26 +1414,26 @@ class mt {
|
|
|
1351
1414
|
jitter: !0
|
|
1352
1415
|
}
|
|
1353
1416
|
);
|
|
1354
|
-
if (!
|
|
1355
|
-
const h = await
|
|
1356
|
-
let m = `STT request failed: ${
|
|
1417
|
+
if (!d.ok) {
|
|
1418
|
+
const h = await d.text();
|
|
1419
|
+
let m = `STT request failed: ${d.status} ${d.statusText}`;
|
|
1357
1420
|
try {
|
|
1358
1421
|
const c = JSON.parse(h);
|
|
1359
1422
|
m = c.message || c.error || m;
|
|
1360
1423
|
} catch {
|
|
1361
1424
|
m = h || m;
|
|
1362
1425
|
}
|
|
1363
|
-
throw new
|
|
1426
|
+
throw new I(
|
|
1364
1427
|
m,
|
|
1365
|
-
`HTTP_${
|
|
1366
|
-
|
|
1428
|
+
`HTTP_${d.status}`,
|
|
1429
|
+
d.status >= 500
|
|
1367
1430
|
);
|
|
1368
1431
|
}
|
|
1369
1432
|
return {
|
|
1370
|
-
transcript: (await
|
|
1433
|
+
transcript: (await d.json()).data.text ?? ""
|
|
1371
1434
|
};
|
|
1372
1435
|
} catch (l) {
|
|
1373
|
-
throw l instanceof
|
|
1436
|
+
throw l instanceof I ? l : new I(
|
|
1374
1437
|
`Transcription failed: ${l instanceof Error ? l.message : String(l)}`,
|
|
1375
1438
|
"TRANSCRIPTION_FAILED",
|
|
1376
1439
|
!0
|
|
@@ -1400,9 +1463,9 @@ class mt {
|
|
|
1400
1463
|
"audio/mp4",
|
|
1401
1464
|
"audio/wav"
|
|
1402
1465
|
];
|
|
1403
|
-
for (const
|
|
1404
|
-
if (MediaRecorder.isTypeSupported(
|
|
1405
|
-
return
|
|
1466
|
+
for (const t of r)
|
|
1467
|
+
if (MediaRecorder.isTypeSupported(t))
|
|
1468
|
+
return t;
|
|
1406
1469
|
return "audio/webm";
|
|
1407
1470
|
}
|
|
1408
1471
|
/**
|
|
@@ -1412,70 +1475,70 @@ class mt {
|
|
|
1412
1475
|
this.recordingStream && (this.recordingStream.getTracks().forEach((r) => r.stop()), this.recordingStream = null), this.mediaRecorder = null, this.audioChunks = [], this.autoStopTimeoutId && (clearTimeout(this.autoStopTimeoutId), this.autoStopTimeoutId = null);
|
|
1413
1476
|
}
|
|
1414
1477
|
}
|
|
1415
|
-
const
|
|
1416
|
-
const [r,
|
|
1417
|
-
|
|
1418
|
-
const h =
|
|
1478
|
+
const Z = new Ct(), St = (i = {}) => {
|
|
1479
|
+
const [r, t] = k(!1), [s, n] = k(!1), [o, a] = k(null), [l, w] = k(null), [d, u] = k(null);
|
|
1480
|
+
i.config && Z.updateConfig(i.config);
|
|
1481
|
+
const h = T(async (b) => {
|
|
1419
1482
|
var j;
|
|
1420
1483
|
try {
|
|
1421
|
-
|
|
1484
|
+
w(null), a(null), u(null), await Z.startRecording(b, {
|
|
1422
1485
|
onStart: () => {
|
|
1423
|
-
var
|
|
1424
|
-
|
|
1486
|
+
var g;
|
|
1487
|
+
t(!0), (g = i.onStart) == null || g.call(i);
|
|
1425
1488
|
},
|
|
1426
1489
|
onStop: () => {
|
|
1427
|
-
var
|
|
1428
|
-
|
|
1490
|
+
var g;
|
|
1491
|
+
t(!1), (g = i.onStop) == null || g.call(i);
|
|
1429
1492
|
},
|
|
1430
|
-
onError: (
|
|
1493
|
+
onError: (g) => {
|
|
1431
1494
|
var S;
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1495
|
+
const v = g instanceof I ? g : new I(g.message, "RECORDING_ERROR", !0);
|
|
1496
|
+
w(v), t(!1), (S = i.onError) == null || S.call(i, v);
|
|
1434
1497
|
}
|
|
1435
1498
|
});
|
|
1436
|
-
} catch (
|
|
1437
|
-
const
|
|
1438
|
-
|
|
1499
|
+
} catch (g) {
|
|
1500
|
+
const v = g instanceof I ? g : new I(
|
|
1501
|
+
g instanceof Error ? g.message : String(g),
|
|
1439
1502
|
"START_FAILED",
|
|
1440
1503
|
!1
|
|
1441
1504
|
);
|
|
1442
|
-
throw
|
|
1505
|
+
throw w(v), t(!1), (j = i.onError) == null || j.call(i, v), v;
|
|
1443
1506
|
}
|
|
1444
|
-
}, []), m =
|
|
1445
|
-
var
|
|
1507
|
+
}, []), m = T(async () => {
|
|
1508
|
+
var b, j;
|
|
1446
1509
|
try {
|
|
1447
|
-
const
|
|
1448
|
-
return u(
|
|
1449
|
-
} catch (
|
|
1450
|
-
const
|
|
1451
|
-
|
|
1510
|
+
const g = await Z.stopRecording();
|
|
1511
|
+
return u(g), t(!1), (b = i.onStop) == null || b.call(i), g;
|
|
1512
|
+
} catch (g) {
|
|
1513
|
+
const v = g instanceof I ? g : new I(
|
|
1514
|
+
g instanceof Error ? g.message : String(g),
|
|
1452
1515
|
"STOP_FAILED",
|
|
1453
1516
|
!1
|
|
1454
1517
|
);
|
|
1455
|
-
throw
|
|
1518
|
+
throw w(v), t(!1), (j = i.onError) == null || j.call(i, v), v;
|
|
1456
1519
|
}
|
|
1457
|
-
}, []), c =
|
|
1458
|
-
async (
|
|
1459
|
-
var
|
|
1520
|
+
}, []), c = T(
|
|
1521
|
+
async (b, j = {}) => {
|
|
1522
|
+
var g, v;
|
|
1460
1523
|
try {
|
|
1461
|
-
|
|
1524
|
+
w(null), n(!0);
|
|
1462
1525
|
const S = {
|
|
1463
|
-
audioBlob:
|
|
1526
|
+
audioBlob: b,
|
|
1464
1527
|
...j
|
|
1465
|
-
},
|
|
1466
|
-
return a(
|
|
1528
|
+
}, N = await Z.transcribe(S);
|
|
1529
|
+
return a(N.transcript), n(!1), (g = i.onTranscriptionComplete) == null || g.call(i, N), N;
|
|
1467
1530
|
} catch (S) {
|
|
1468
|
-
const
|
|
1531
|
+
const N = S instanceof I ? S : new I(
|
|
1469
1532
|
S instanceof Error ? S.message : String(S),
|
|
1470
1533
|
"TRANSCRIPTION_FAILED",
|
|
1471
1534
|
!0
|
|
1472
1535
|
);
|
|
1473
|
-
throw
|
|
1536
|
+
throw w(N), n(!1), (v = i.onError) == null || v.call(i, N), N;
|
|
1474
1537
|
}
|
|
1475
1538
|
},
|
|
1476
1539
|
[]
|
|
1477
|
-
), x =
|
|
1478
|
-
|
|
1540
|
+
), x = T(() => {
|
|
1541
|
+
Z.cancelRecording(), t(!1), u(null);
|
|
1479
1542
|
}, []);
|
|
1480
1543
|
return {
|
|
1481
1544
|
startRecording: h,
|
|
@@ -1486,13 +1549,13 @@ const J = new mt(), gt = (t = {}) => {
|
|
|
1486
1549
|
isTranscribing: s,
|
|
1487
1550
|
transcript: o,
|
|
1488
1551
|
error: l,
|
|
1489
|
-
audioBlob:
|
|
1552
|
+
audioBlob: d
|
|
1490
1553
|
};
|
|
1491
|
-
},
|
|
1492
|
-
const r =
|
|
1554
|
+
}, It = (i) => {
|
|
1555
|
+
const r = E(null), t = E(!1);
|
|
1493
1556
|
C(() => {
|
|
1494
1557
|
const s = () => {
|
|
1495
|
-
document.hidden && (
|
|
1558
|
+
document.hidden && (t.current = !0, r.current && (clearTimeout(r.current), r.current = null), i({
|
|
1496
1559
|
type: "tab_switch",
|
|
1497
1560
|
severity: "high",
|
|
1498
1561
|
details: {
|
|
@@ -1500,11 +1563,11 @@ const J = new mt(), gt = (t = {}) => {
|
|
|
1500
1563
|
reason: "Attempted to switch tabs or applications"
|
|
1501
1564
|
}
|
|
1502
1565
|
}), setTimeout(() => {
|
|
1503
|
-
|
|
1566
|
+
t.current = !1;
|
|
1504
1567
|
}, 100));
|
|
1505
1568
|
}, n = () => {
|
|
1506
|
-
|
|
1507
|
-
|
|
1569
|
+
t.current || (r.current = setTimeout(() => {
|
|
1570
|
+
t.current || i({
|
|
1508
1571
|
type: "focus_loss",
|
|
1509
1572
|
severity: "medium",
|
|
1510
1573
|
details: {
|
|
@@ -1517,11 +1580,11 @@ const J = new mt(), gt = (t = {}) => {
|
|
|
1517
1580
|
return document.addEventListener("visibilitychange", s), window.addEventListener("blur", n), () => {
|
|
1518
1581
|
document.removeEventListener("visibilitychange", s), window.removeEventListener("blur", n), r.current && clearTimeout(r.current);
|
|
1519
1582
|
};
|
|
1520
|
-
}, [
|
|
1521
|
-
},
|
|
1583
|
+
}, [i]);
|
|
1584
|
+
}, Rt = () => {
|
|
1522
1585
|
C(() => {
|
|
1523
|
-
const
|
|
1524
|
-
return
|
|
1586
|
+
const i = document.createElement("style");
|
|
1587
|
+
return i.textContent = `
|
|
1525
1588
|
* {
|
|
1526
1589
|
-webkit-user-select: none !important;
|
|
1527
1590
|
-moz-user-select: none !important;
|
|
@@ -1534,15 +1597,15 @@ const J = new mt(), gt = (t = {}) => {
|
|
|
1534
1597
|
-ms-user-select: text !important;
|
|
1535
1598
|
user-select: text !important;
|
|
1536
1599
|
}
|
|
1537
|
-
`, document.head.appendChild(
|
|
1538
|
-
document.head.removeChild(
|
|
1600
|
+
`, document.head.appendChild(i), () => {
|
|
1601
|
+
document.head.removeChild(i);
|
|
1539
1602
|
};
|
|
1540
1603
|
}, []);
|
|
1541
1604
|
};
|
|
1542
|
-
class
|
|
1605
|
+
class At {
|
|
1543
1606
|
constructor(r = {}) {
|
|
1544
|
-
|
|
1545
|
-
|
|
1607
|
+
F(this, "config");
|
|
1608
|
+
F(this, "currentAudio", null);
|
|
1546
1609
|
this.config = {
|
|
1547
1610
|
baseUrl: "http://localhost:8000",
|
|
1548
1611
|
provider: "piper",
|
|
@@ -1562,12 +1625,12 @@ class pt {
|
|
|
1562
1625
|
*/
|
|
1563
1626
|
async synthesizeSpeech(r) {
|
|
1564
1627
|
const {
|
|
1565
|
-
text:
|
|
1628
|
+
text: t,
|
|
1566
1629
|
voice: s = this.config.voice,
|
|
1567
1630
|
speed: n = this.config.speed
|
|
1568
1631
|
} = r, o = new URLSearchParams();
|
|
1569
|
-
o.append("text",
|
|
1570
|
-
const a = await
|
|
1632
|
+
o.append("text", t), o.append("voice", s || "string"), o.append("speed", (n == null ? void 0 : n.toString()) || "1");
|
|
1633
|
+
const a = await be(
|
|
1571
1634
|
`${this.config.baseUrl}/speech/synthesize`,
|
|
1572
1635
|
{
|
|
1573
1636
|
method: "POST",
|
|
@@ -1597,8 +1660,8 @@ class pt {
|
|
|
1597
1660
|
if (l && l.includes("audio/"))
|
|
1598
1661
|
return a.blob();
|
|
1599
1662
|
try {
|
|
1600
|
-
const
|
|
1601
|
-
throw new Error(`TTS Error: ${JSON.stringify(
|
|
1663
|
+
const w = await a.json();
|
|
1664
|
+
throw new Error(`TTS Error: ${JSON.stringify(w)}`);
|
|
1602
1665
|
} catch {
|
|
1603
1666
|
throw new Error("TTS request failed with unknown error");
|
|
1604
1667
|
}
|
|
@@ -1606,35 +1669,35 @@ class pt {
|
|
|
1606
1669
|
/**
|
|
1607
1670
|
* Speak text and return a promise that resolves when playback completes
|
|
1608
1671
|
*/
|
|
1609
|
-
async speak(r,
|
|
1672
|
+
async speak(r, t) {
|
|
1610
1673
|
var s, n;
|
|
1611
1674
|
try {
|
|
1612
|
-
this.stop(), (s =
|
|
1675
|
+
this.stop(), (s = t == null ? void 0 : t.onStart) == null || s.call(t);
|
|
1613
1676
|
const o = await this.synthesizeSpeech(r), a = URL.createObjectURL(o);
|
|
1614
|
-
return this.currentAudio = new Audio(a), new Promise((l,
|
|
1677
|
+
return this.currentAudio = new Audio(a), new Promise((l, w) => {
|
|
1615
1678
|
if (!this.currentAudio) {
|
|
1616
|
-
|
|
1679
|
+
w(new Error("Audio element not created"));
|
|
1617
1680
|
return;
|
|
1618
1681
|
}
|
|
1619
|
-
const
|
|
1620
|
-
|
|
1682
|
+
const d = this.currentAudio;
|
|
1683
|
+
d.onended = () => {
|
|
1621
1684
|
var u;
|
|
1622
|
-
URL.revokeObjectURL(a), this.currentAudio = null, (u =
|
|
1623
|
-
},
|
|
1685
|
+
URL.revokeObjectURL(a), this.currentAudio = null, (u = t == null ? void 0 : t.onEnd) == null || u.call(t), l();
|
|
1686
|
+
}, d.onerror = (u) => {
|
|
1624
1687
|
var m;
|
|
1625
1688
|
URL.revokeObjectURL(a), this.currentAudio = null;
|
|
1626
1689
|
const h = new Error(`Audio playback failed: ${u}`);
|
|
1627
|
-
(m =
|
|
1628
|
-
},
|
|
1690
|
+
(m = t == null ? void 0 : t.onError) == null || m.call(t, h), w(h);
|
|
1691
|
+
}, d.play().catch((u) => {
|
|
1629
1692
|
var m;
|
|
1630
1693
|
URL.revokeObjectURL(a), this.currentAudio = null;
|
|
1631
1694
|
const h = new Error(`Failed to play audio: ${u.message}`);
|
|
1632
|
-
(m =
|
|
1695
|
+
(m = t == null ? void 0 : t.onError) == null || m.call(t, h), w(h);
|
|
1633
1696
|
});
|
|
1634
1697
|
});
|
|
1635
1698
|
} catch (o) {
|
|
1636
1699
|
const a = o instanceof Error ? o : new Error(`TTS Error: ${String(o)}`);
|
|
1637
|
-
throw (n =
|
|
1700
|
+
throw (n = t == null ? void 0 : t.onError) == null || n.call(t, a), a;
|
|
1638
1701
|
}
|
|
1639
1702
|
}
|
|
1640
1703
|
/**
|
|
@@ -1650,86 +1713,86 @@ class pt {
|
|
|
1650
1713
|
return this.currentAudio !== null && !this.currentAudio.paused;
|
|
1651
1714
|
}
|
|
1652
1715
|
}
|
|
1653
|
-
const
|
|
1654
|
-
const [r,
|
|
1655
|
-
|
|
1656
|
-
const l =
|
|
1657
|
-
async (
|
|
1716
|
+
const he = new At(), Mt = (i = {}) => {
|
|
1717
|
+
const [r, t] = k(!1), [s, n] = k(!1), [o, a] = k(null);
|
|
1718
|
+
i.config && he.updateConfig(i.config);
|
|
1719
|
+
const l = T(
|
|
1720
|
+
async (d, u = {}) => {
|
|
1658
1721
|
var h;
|
|
1659
1722
|
try {
|
|
1660
1723
|
a(null), n(!0);
|
|
1661
1724
|
const m = {
|
|
1662
|
-
text:
|
|
1725
|
+
text: d,
|
|
1663
1726
|
...u
|
|
1664
1727
|
};
|
|
1665
|
-
await
|
|
1728
|
+
await he.speak(m, {
|
|
1666
1729
|
onStart: () => {
|
|
1667
1730
|
var c;
|
|
1668
|
-
n(!1),
|
|
1731
|
+
n(!1), t(!0), (c = i.onStart) == null || c.call(i);
|
|
1669
1732
|
},
|
|
1670
1733
|
onEnd: () => {
|
|
1671
1734
|
var c;
|
|
1672
|
-
|
|
1735
|
+
t(!1), (c = i.onEnd) == null || c.call(i);
|
|
1673
1736
|
},
|
|
1674
1737
|
onError: (c) => {
|
|
1675
1738
|
var x;
|
|
1676
|
-
|
|
1739
|
+
t(!1), n(!1), a(c), (x = i.onError) == null || x.call(i, c);
|
|
1677
1740
|
}
|
|
1678
1741
|
});
|
|
1679
1742
|
} catch (m) {
|
|
1680
1743
|
const c = m instanceof Error ? m : new Error(String(m));
|
|
1681
|
-
throw a(c),
|
|
1744
|
+
throw a(c), t(!1), n(!1), (h = i.onError) == null || h.call(i, c), c;
|
|
1682
1745
|
}
|
|
1683
1746
|
},
|
|
1684
|
-
[
|
|
1685
|
-
),
|
|
1686
|
-
|
|
1747
|
+
[i]
|
|
1748
|
+
), w = T(() => {
|
|
1749
|
+
he.stop(), t(!1), n(!1);
|
|
1687
1750
|
}, []);
|
|
1688
1751
|
return {
|
|
1689
1752
|
speak: l,
|
|
1690
|
-
stop:
|
|
1753
|
+
stop: w,
|
|
1691
1754
|
isPlaying: r,
|
|
1692
1755
|
isLoading: s,
|
|
1693
1756
|
error: o
|
|
1694
1757
|
};
|
|
1695
|
-
},
|
|
1696
|
-
onViolation:
|
|
1758
|
+
}, Dt = ({
|
|
1759
|
+
onViolation: i,
|
|
1697
1760
|
onEnd: r,
|
|
1698
|
-
maxViolations:
|
|
1761
|
+
maxViolations: t = 5
|
|
1699
1762
|
}) => {
|
|
1700
|
-
const { addViolation: s } =
|
|
1763
|
+
const { addViolation: s } = st(), n = it(), o = rt(), a = E(o);
|
|
1701
1764
|
C(() => {
|
|
1702
1765
|
a.current = o;
|
|
1703
1766
|
}, [o]);
|
|
1704
|
-
const l =
|
|
1705
|
-
(
|
|
1706
|
-
r && r(
|
|
1767
|
+
const l = T(
|
|
1768
|
+
(d) => {
|
|
1769
|
+
r && r(d, a.current);
|
|
1707
1770
|
},
|
|
1708
1771
|
[r]
|
|
1709
1772
|
);
|
|
1710
1773
|
return {
|
|
1711
|
-
logViolation:
|
|
1712
|
-
({ type:
|
|
1774
|
+
logViolation: T(
|
|
1775
|
+
({ type: d, severity: u, details: h }) => {
|
|
1713
1776
|
const m = {
|
|
1714
|
-
id:
|
|
1715
|
-
type:
|
|
1777
|
+
id: wt(),
|
|
1778
|
+
type: d,
|
|
1716
1779
|
severity: u,
|
|
1717
1780
|
details: h,
|
|
1718
1781
|
timestamp: Date.now()
|
|
1719
1782
|
};
|
|
1720
1783
|
s(m);
|
|
1721
1784
|
const c = a.current + 1;
|
|
1722
|
-
|
|
1785
|
+
i && i(m, c), c >= t && l("excessive_violations");
|
|
1723
1786
|
},
|
|
1724
|
-
[s,
|
|
1787
|
+
[s, i, t, l]
|
|
1725
1788
|
),
|
|
1726
1789
|
onInterviewEnd: l,
|
|
1727
1790
|
violationCount: o,
|
|
1728
1791
|
logList: n
|
|
1729
1792
|
};
|
|
1730
|
-
},
|
|
1793
|
+
}, _t = () => {
|
|
1731
1794
|
C(() => {
|
|
1732
|
-
function
|
|
1795
|
+
function i() {
|
|
1733
1796
|
console.clear(), console.log(
|
|
1734
1797
|
`
|
|
1735
1798
|
%c
|
|
@@ -1765,11 +1828,11 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
1765
1828
|
), console.log(
|
|
1766
1829
|
`
|
|
1767
1830
|
%c
|
|
1768
|
-
|
|
1831
|
+
◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆
|
|
1769
1832
|
◇ ◇
|
|
1770
1833
|
◆ 🔒 INTERVIEW INTEGRITY SYSTEM ACTIVATED 🔒 ◆
|
|
1771
1834
|
◇ ◇
|
|
1772
|
-
|
|
1835
|
+
◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆
|
|
1773
1836
|
|
|
1774
1837
|
`,
|
|
1775
1838
|
"color: #4ecdc4; font-size: 16px; font-weight: bold; text-shadow: 0 0 10px #4ecdc4;"
|
|
@@ -1790,8 +1853,8 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
1790
1853
|
"color: #ffd93d; font-size: 14px; font-family: monospace; background: rgba(255, 217, 61, 0.1); padding: 10px;"
|
|
1791
1854
|
);
|
|
1792
1855
|
}
|
|
1793
|
-
const r = { open: !1, orientation: null },
|
|
1794
|
-
window.outerHeight - window.innerHeight >
|
|
1856
|
+
const r = { open: !1, orientation: null }, t = 160, s = setInterval(() => {
|
|
1857
|
+
window.outerHeight - window.innerHeight > t || window.outerWidth - window.innerWidth > t ? r.open || (r.open = !0, r.orientation = window.outerWidth - window.innerWidth > t ? "vertical" : "horizontal", i()) : r.open && (r.open = !1, console.log(
|
|
1795
1858
|
"%c🌟 Developer tools closed. Interview continues smoothly! ✨",
|
|
1796
1859
|
"color: #4ecdc4; font-weight: bold; text-shadow: 0 0 10px #4ecdc4;"
|
|
1797
1860
|
));
|
|
@@ -1809,7 +1872,7 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
1809
1872
|
clearInterval(s), document.removeEventListener("keydown", n), document.removeEventListener("contextmenu", o), delete window.showStats, delete window.interviewTips;
|
|
1810
1873
|
};
|
|
1811
1874
|
}, []);
|
|
1812
|
-
},
|
|
1875
|
+
}, ye = (i) => /* @__PURE__ */ e.jsxs(
|
|
1813
1876
|
"svg",
|
|
1814
1877
|
{
|
|
1815
1878
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1821,7 +1884,7 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
1821
1884
|
strokeWidth: "2",
|
|
1822
1885
|
strokeLinecap: "round",
|
|
1823
1886
|
strokeLinejoin: "round",
|
|
1824
|
-
...
|
|
1887
|
+
...i,
|
|
1825
1888
|
children: [
|
|
1826
1889
|
/* @__PURE__ */ e.jsx("path", { d: "M12 2a10 10 0 0 1 7.38 16.75" }),
|
|
1827
1890
|
/* @__PURE__ */ e.jsx("path", { d: "M12 6v6l4 2" }),
|
|
@@ -1831,36 +1894,36 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
1831
1894
|
/* @__PURE__ */ e.jsx("path", { d: "M8.644 21.42a10 10 0 0 0 7.631-.38" })
|
|
1832
1895
|
]
|
|
1833
1896
|
}
|
|
1834
|
-
),
|
|
1835
|
-
const r = Math.max(0, Math.floor(
|
|
1836
|
-
return `${
|
|
1837
|
-
},
|
|
1838
|
-
total:
|
|
1897
|
+
), Pt = (i, r, t) => Math.max(r, Math.min(t, i)), Ne = (i) => {
|
|
1898
|
+
const r = Math.max(0, Math.floor(i)), t = Math.floor(r / 60).toString().padStart(2, "0"), s = (r % 60).toString().padStart(2, "0");
|
|
1899
|
+
return `${t}:${s}`;
|
|
1900
|
+
}, ve = ({
|
|
1901
|
+
total: i,
|
|
1839
1902
|
remaining: r,
|
|
1840
|
-
size:
|
|
1903
|
+
size: t = 64,
|
|
1841
1904
|
strokeWidth: s = 6,
|
|
1842
1905
|
className: n = "",
|
|
1843
1906
|
showLabel: o = !0
|
|
1844
1907
|
}) => {
|
|
1845
|
-
const a = Math.max(1,
|
|
1846
|
-
const x = (
|
|
1847
|
-
return { radius: x, circumference:
|
|
1848
|
-
}, [
|
|
1908
|
+
const a = Math.max(1, i || 1), l = Pt(r / a, 0, 1), { radius: w, circumference: d, dashOffset: u, center: h } = ee(() => {
|
|
1909
|
+
const x = (t - s) / 2, b = 2 * Math.PI * x, j = b * (1 - l), g = Math.round(s) % 2 === 1, v = t / 2 + (g ? 0.5 : 0);
|
|
1910
|
+
return { radius: x, circumference: b, dashOffset: j, center: v };
|
|
1911
|
+
}, [t, s, l]), m = ee(() => l <= 0.25 ? "iw-stroke-red-500" : l <= 0.5 ? "iw-stroke-yellow-500" : "iw-stroke-green-500", [l]), c = l <= 0.25 ? "iw-animate-pulse" : "";
|
|
1849
1912
|
return /* @__PURE__ */ e.jsxs(
|
|
1850
1913
|
"div",
|
|
1851
1914
|
{
|
|
1852
1915
|
className: `iw-relative iw-inline-flex iw-items-center iw-justify-center iw-rounded-full iw-bg-white ${n}`,
|
|
1853
|
-
style: { width:
|
|
1854
|
-
"aria-label": `Time remaining ${
|
|
1916
|
+
style: { width: t, height: t },
|
|
1917
|
+
"aria-label": `Time remaining ${Ne(r)}`,
|
|
1855
1918
|
role: "timer",
|
|
1856
1919
|
"aria-live": "polite",
|
|
1857
1920
|
children: [
|
|
1858
1921
|
/* @__PURE__ */ e.jsx(
|
|
1859
1922
|
"svg",
|
|
1860
1923
|
{
|
|
1861
|
-
width:
|
|
1862
|
-
height:
|
|
1863
|
-
viewBox: `0 0 ${
|
|
1924
|
+
width: t,
|
|
1925
|
+
height: t,
|
|
1926
|
+
viewBox: `0 0 ${t} ${t}`,
|
|
1864
1927
|
preserveAspectRatio: "xMidYMid meet",
|
|
1865
1928
|
children: /* @__PURE__ */ e.jsxs("g", { transform: `rotate(-90 ${h} ${h})`, children: [
|
|
1866
1929
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1868,7 +1931,7 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
1868
1931
|
{
|
|
1869
1932
|
cx: h,
|
|
1870
1933
|
cy: h,
|
|
1871
|
-
r:
|
|
1934
|
+
r: w,
|
|
1872
1935
|
className: "iw-stroke-gray-200",
|
|
1873
1936
|
strokeWidth: s,
|
|
1874
1937
|
fill: "none",
|
|
@@ -1881,12 +1944,12 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
1881
1944
|
{
|
|
1882
1945
|
cx: h,
|
|
1883
1946
|
cy: h,
|
|
1884
|
-
r:
|
|
1947
|
+
r: w,
|
|
1885
1948
|
className: `${m} ${c}`,
|
|
1886
1949
|
strokeWidth: s,
|
|
1887
1950
|
strokeLinecap: "round",
|
|
1888
1951
|
fill: "none",
|
|
1889
|
-
strokeDasharray:
|
|
1952
|
+
strokeDasharray: d,
|
|
1890
1953
|
strokeDashoffset: u,
|
|
1891
1954
|
shapeRendering: "geometricPrecision",
|
|
1892
1955
|
vectorEffect: "non-scaling-stroke",
|
|
@@ -1902,39 +1965,39 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
1902
1965
|
"span",
|
|
1903
1966
|
{
|
|
1904
1967
|
className: `iw-text-[11px] iw-font-semibold iw-tabular-nums ${l <= 0.25 ? "iw-text-red-600" : l <= 0.5 ? "iw-text-yellow-600" : "iw-text-green-600"}`,
|
|
1905
|
-
children:
|
|
1968
|
+
children: Ne(r)
|
|
1906
1969
|
}
|
|
1907
1970
|
) })
|
|
1908
1971
|
]
|
|
1909
1972
|
}
|
|
1910
1973
|
);
|
|
1911
|
-
},
|
|
1912
|
-
label:
|
|
1974
|
+
}, Ft = ({
|
|
1975
|
+
label: i,
|
|
1913
1976
|
error: r,
|
|
1914
|
-
fullWidth:
|
|
1977
|
+
fullWidth: t = !1,
|
|
1915
1978
|
className: s = "",
|
|
1916
1979
|
id: n,
|
|
1917
1980
|
...o
|
|
1918
1981
|
}) => {
|
|
1919
|
-
const a = n || `textarea-${Math.random().toString(36).substring(2, 9)}`, l = "iw-block iw-rounded-md iw-border iw-border-gray-300 iw-shadow-sm iw-px-4 iw-py-2 iw-text-sm iw-transition-all",
|
|
1982
|
+
const a = n || `textarea-${Math.random().toString(36).substring(2, 9)}`, l = "iw-block iw-rounded-md iw-border iw-border-gray-300 iw-shadow-sm iw-px-4 iw-py-2 iw-text-sm iw-transition-all", w = r ? "iw-border-red-500 iw-focus:border-red-500 iw-focus:ring-red-500" : "", d = t ? "iw-w-full" : "", u = s.includes("iw-h-full") || t ? "iw-h-full" : "";
|
|
1920
1983
|
return /* @__PURE__ */ e.jsxs(
|
|
1921
1984
|
"div",
|
|
1922
1985
|
{
|
|
1923
|
-
className: `iw-h-full iw-flex iw-flex-col ${
|
|
1986
|
+
className: `iw-h-full iw-flex iw-flex-col ${t ? "iw-w-full" : ""}`,
|
|
1924
1987
|
children: [
|
|
1925
|
-
|
|
1988
|
+
i && /* @__PURE__ */ e.jsx(
|
|
1926
1989
|
"label",
|
|
1927
1990
|
{
|
|
1928
1991
|
htmlFor: a,
|
|
1929
1992
|
className: "iw-block iw-text-sm iw-font-medium iw-text-gray-700 iw-mb-1",
|
|
1930
|
-
children:
|
|
1993
|
+
children: i
|
|
1931
1994
|
}
|
|
1932
1995
|
),
|
|
1933
1996
|
/* @__PURE__ */ e.jsx(
|
|
1934
1997
|
"textarea",
|
|
1935
1998
|
{
|
|
1936
1999
|
id: a,
|
|
1937
|
-
className: `${l} ${
|
|
2000
|
+
className: `${l} ${w} ${d} ${u} ${s}`,
|
|
1938
2001
|
"aria-invalid": r ? "true" : "false",
|
|
1939
2002
|
...o
|
|
1940
2003
|
}
|
|
@@ -1943,27 +2006,27 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
1943
2006
|
]
|
|
1944
2007
|
}
|
|
1945
2008
|
);
|
|
1946
|
-
},
|
|
1947
|
-
value:
|
|
2009
|
+
}, Lt = ({
|
|
2010
|
+
value: i,
|
|
1948
2011
|
onChange: r,
|
|
1949
|
-
onSubmit:
|
|
2012
|
+
onSubmit: t,
|
|
1950
2013
|
isSubmitDisabled: s,
|
|
1951
2014
|
state: n,
|
|
1952
2015
|
editingTime: o
|
|
1953
2016
|
}) => {
|
|
1954
2017
|
const a = (l) => {
|
|
1955
|
-
l.key === "Enter" && (l.ctrlKey || l.metaKey) && !s && (l.preventDefault(),
|
|
2018
|
+
l.key === "Enter" && (l.ctrlKey || l.metaKey) && !s && (l.preventDefault(), t());
|
|
1956
2019
|
};
|
|
1957
2020
|
return /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-h-full ", children: [
|
|
1958
2021
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between", children: [
|
|
1959
2022
|
/* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Your Answer" }),
|
|
1960
2023
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
|
|
1961
2024
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
|
|
1962
|
-
/* @__PURE__ */ e.jsx(
|
|
2025
|
+
/* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
|
|
1963
2026
|
/* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to edit: " })
|
|
1964
2027
|
] }),
|
|
1965
2028
|
/* @__PURE__ */ e.jsx(
|
|
1966
|
-
|
|
2029
|
+
ve,
|
|
1967
2030
|
{
|
|
1968
2031
|
total: o,
|
|
1969
2032
|
remaining: n.currentPhaseTimeRemaining,
|
|
@@ -1975,9 +2038,9 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
1975
2038
|
] }),
|
|
1976
2039
|
/* @__PURE__ */ e.jsxs("div", { className: " iw-overflow-hidden iw-flex iw-flex-col iw-h-full iw-mt-2", children: [
|
|
1977
2040
|
/* @__PURE__ */ e.jsx(
|
|
1978
|
-
|
|
2041
|
+
Ft,
|
|
1979
2042
|
{
|
|
1980
|
-
value:
|
|
2043
|
+
value: i,
|
|
1981
2044
|
onChange: r,
|
|
1982
2045
|
onKeyDown: a,
|
|
1983
2046
|
placeholder: "Type your answer here...",
|
|
@@ -1989,12 +2052,12 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
1989
2052
|
onDragOver: (l) => l.preventDefault()
|
|
1990
2053
|
}
|
|
1991
2054
|
),
|
|
1992
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1 iw-mt-4", children: /* @__PURE__ */ e.jsx(
|
|
2055
|
+
/* @__PURE__ */ e.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1 iw-mt-4", children: /* @__PURE__ */ e.jsx(V, { onClick: t, disabled: s, children: "Submit Answer" }) })
|
|
1993
2056
|
] })
|
|
1994
2057
|
] });
|
|
1995
|
-
},
|
|
2058
|
+
}, $t = ({ className: i = "" }) => {
|
|
1996
2059
|
var n;
|
|
1997
|
-
const { authToken: r } =
|
|
2060
|
+
const { authToken: r } = De(), t = r ? ut(r) : null, s = E(null);
|
|
1998
2061
|
return C(() => {
|
|
1999
2062
|
let o = null;
|
|
2000
2063
|
return (async () => {
|
|
@@ -2009,7 +2072,7 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
2009
2072
|
})(), () => {
|
|
2010
2073
|
o && o.getTracks().forEach((l) => l.stop());
|
|
2011
2074
|
};
|
|
2012
|
-
}, []), /* @__PURE__ */ e.jsxs("div", { className: `iw-relative ${
|
|
2075
|
+
}, []), /* @__PURE__ */ e.jsxs("div", { className: `iw-relative ${i}`, children: [
|
|
2013
2076
|
/* @__PURE__ */ e.jsx(
|
|
2014
2077
|
"video",
|
|
2015
2078
|
{
|
|
@@ -2027,18 +2090,18 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
2027
2090
|
/* @__PURE__ */ e.jsx("div", { className: "iw-size-2 iw-animate-pulse iw-rounded-full iw-bg-red-500" }),
|
|
2028
2091
|
/* @__PURE__ */ e.jsx("span", { className: "iw-font-medium iw-text-white", children: "Recording" })
|
|
2029
2092
|
] }),
|
|
2030
|
-
((n =
|
|
2093
|
+
((n = t == null ? void 0 : t.data) == null ? void 0 : n.user_name) && /* @__PURE__ */ e.jsx("div", { className: "iw-absolute iw-bottom-4 iw-right-4 iw-inline-flex iw-items-center iw-gap-2 iw-rounded-lg iw-border iw-border-white/10 iw-bg-black/40 iw-px-4 iw-py-2 iw-backdrop-blur-md", children: /* @__PURE__ */ e.jsx("span", { className: "iw-font-medium iw-text-white", children: t.data.user_name }) })
|
|
2031
2094
|
] });
|
|
2032
|
-
},
|
|
2033
|
-
question:
|
|
2095
|
+
}, Ot = ({
|
|
2096
|
+
question: i,
|
|
2034
2097
|
isLoading: r = !1
|
|
2035
2098
|
}) => {
|
|
2036
|
-
const { baseColor:
|
|
2099
|
+
const { baseColor: t } = te();
|
|
2037
2100
|
return /* @__PURE__ */ e.jsx(
|
|
2038
2101
|
"div",
|
|
2039
2102
|
{
|
|
2040
2103
|
className: "iw-rounded-xl iw-mb-4 message-animation iw-text-gray-800 iw-p-6 ",
|
|
2041
|
-
style:
|
|
2104
|
+
style: ct(t, 0.85),
|
|
2042
2105
|
children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-8", children: [
|
|
2043
2106
|
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-flex-col iw-items-center iw-relative iw-h-32 iw-w-32 iw-shrink-0 iw-shadow iw-rounded-lg iw-bg-white", children: /* @__PURE__ */ e.jsx("div", { className: "iw-mt-2", children: /* @__PURE__ */ e.jsx(
|
|
2044
2107
|
"img",
|
|
@@ -2051,37 +2114,37 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
2051
2114
|
r ? /* @__PURE__ */ e.jsxs("div", { className: "iw-animate-pulse iw-w-full iw-space-y-3 iw-mr-10", children: [
|
|
2052
2115
|
/* @__PURE__ */ e.jsx("div", { className: "iw-h-5 iw-bg-gray-200 iw-rounded iw-w-full" }),
|
|
2053
2116
|
/* @__PURE__ */ e.jsx("div", { className: "iw-h-5 iw-bg-gray-200 iw-rounded iw-w-3/4" })
|
|
2054
|
-
] }) : /* @__PURE__ */ e.jsx("p", { className: "iw-text-lg iw-leading-8", children:
|
|
2117
|
+
] }) : /* @__PURE__ */ e.jsx("p", { className: "iw-text-lg iw-leading-8", children: i == null ? void 0 : i.question })
|
|
2055
2118
|
] })
|
|
2056
2119
|
}
|
|
2057
2120
|
);
|
|
2058
|
-
},
|
|
2059
|
-
currentQuestion:
|
|
2121
|
+
}, ke = ({
|
|
2122
|
+
currentQuestion: i,
|
|
2060
2123
|
phase: r,
|
|
2061
|
-
className:
|
|
2124
|
+
className: t = "",
|
|
2062
2125
|
children: s
|
|
2063
2126
|
}) => /* @__PURE__ */ e.jsxs(
|
|
2064
2127
|
"div",
|
|
2065
2128
|
{
|
|
2066
|
-
className: `iw-p-4 iw-space-y-4 iw-pb-6 ${
|
|
2129
|
+
className: `iw-p-4 iw-space-y-4 iw-pb-6 ${t} iw-min-h-[calc(100vh_-_3.8rem)] iw-flex iw-flex-col iw-justify-between`,
|
|
2067
2130
|
children: [
|
|
2068
2131
|
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-items-start iw-justify-between iw-gap-3", children: /* @__PURE__ */ e.jsx("div", { className: "iw-flex-1", children: /* @__PURE__ */ e.jsx(
|
|
2069
|
-
|
|
2132
|
+
Ot,
|
|
2070
2133
|
{
|
|
2071
|
-
question:
|
|
2072
|
-
isLoading: r ===
|
|
2134
|
+
question: i,
|
|
2135
|
+
isLoading: r === D.FETCHING_QUESTION || r === D.IDLE
|
|
2073
2136
|
}
|
|
2074
2137
|
) }) }),
|
|
2075
2138
|
/* @__PURE__ */ e.jsxs("div", { className: "iw iw-bg-[#F6F6F6] iw-grid iw-grid-cols-2 iw-rounded-[14px] iw-p-6", children: [
|
|
2076
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-min-h-[400px] iw-max-h-[600px]", children: /* @__PURE__ */ e.jsx(
|
|
2139
|
+
/* @__PURE__ */ e.jsx("div", { className: "iw-min-h-[400px] iw-max-h-[600px]", children: /* @__PURE__ */ e.jsx($t, {}) }),
|
|
2077
2140
|
/* @__PURE__ */ e.jsx("div", { className: "iw-bg-white iw-rounded-r-xl iw-shadow iw-p-6", children: s })
|
|
2078
2141
|
] })
|
|
2079
2142
|
]
|
|
2080
2143
|
}
|
|
2081
|
-
),
|
|
2082
|
-
isOpen:
|
|
2144
|
+
), Ue = ({
|
|
2145
|
+
isOpen: i,
|
|
2083
2146
|
onClose: r,
|
|
2084
|
-
children:
|
|
2147
|
+
children: t,
|
|
2085
2148
|
title: s,
|
|
2086
2149
|
showCloseButton: n = !0,
|
|
2087
2150
|
closeOnOverlayClick: o = !0,
|
|
@@ -2089,22 +2152,22 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
2089
2152
|
className: l = ""
|
|
2090
2153
|
}) => {
|
|
2091
2154
|
if (C(() => {
|
|
2092
|
-
if (!
|
|
2155
|
+
if (!i || !a) return;
|
|
2093
2156
|
const u = (h) => {
|
|
2094
2157
|
h.key === "Escape" && r();
|
|
2095
2158
|
};
|
|
2096
2159
|
return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
|
|
2097
|
-
}, [
|
|
2160
|
+
}, [i, a, r]), C(() => (i ? (document.body.style.overflow = "hidden", document.body.classList.add("interview-widget-container")) : (document.body.style.overflow = "unset", document.body.classList.remove("interview-widget-container")), () => {
|
|
2098
2161
|
document.body.style.overflow = "unset", document.body.classList.remove("interview-widget-container");
|
|
2099
|
-
}), [
|
|
2100
|
-
const
|
|
2162
|
+
}), [i]), !i) return null;
|
|
2163
|
+
const w = (u) => {
|
|
2101
2164
|
o && u.target === u.currentTarget && r();
|
|
2102
|
-
},
|
|
2165
|
+
}, d = /* @__PURE__ */ e.jsxs("div", { className: "iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center", children: [
|
|
2103
2166
|
/* @__PURE__ */ e.jsx(
|
|
2104
2167
|
"div",
|
|
2105
2168
|
{
|
|
2106
2169
|
className: "iw-fixed iw-inset-0 iw-bg-black iw-bg-opacity-50 iw-transition-opacity",
|
|
2107
|
-
onClick:
|
|
2170
|
+
onClick: w
|
|
2108
2171
|
}
|
|
2109
2172
|
),
|
|
2110
2173
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2151,21 +2214,21 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
2151
2214
|
}
|
|
2152
2215
|
)
|
|
2153
2216
|
] }),
|
|
2154
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-p-4 iw-overflow-y-auto", children:
|
|
2217
|
+
/* @__PURE__ */ e.jsx("div", { className: "iw-p-4 iw-overflow-y-auto", children: t })
|
|
2155
2218
|
]
|
|
2156
2219
|
}
|
|
2157
2220
|
)
|
|
2158
2221
|
] });
|
|
2159
|
-
return
|
|
2160
|
-
},
|
|
2161
|
-
confirmExitInterview:
|
|
2222
|
+
return Ve(d, document.body);
|
|
2223
|
+
}, Ut = ({
|
|
2224
|
+
confirmExitInterview: i,
|
|
2162
2225
|
isOpen: r,
|
|
2163
|
-
onClose:
|
|
2226
|
+
onClose: t
|
|
2164
2227
|
}) => /* @__PURE__ */ e.jsx(
|
|
2165
|
-
|
|
2228
|
+
Ue,
|
|
2166
2229
|
{
|
|
2167
2230
|
isOpen: r,
|
|
2168
|
-
onClose:
|
|
2231
|
+
onClose: t,
|
|
2169
2232
|
title: "Exit Interview",
|
|
2170
2233
|
closeOnOverlayClick: !1,
|
|
2171
2234
|
children: /* @__PURE__ */ e.jsxs("div", { className: "iw-space-y-5", children: [
|
|
@@ -2181,7 +2244,7 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
2181
2244
|
"button",
|
|
2182
2245
|
{
|
|
2183
2246
|
className: "iw-inline-flex iw-items-center iw-justify-center iw-rounded-lg iw-border iw-border-slate-200 iw-bg-white iw-px-4 iw-py-2 iw-text-sm iw-font-medium iw-text-slate-600 iw-shadow-sm iw-transition hover:iw-bg-slate-50",
|
|
2184
|
-
onClick:
|
|
2247
|
+
onClick: t,
|
|
2185
2248
|
children: "Stay in interview"
|
|
2186
2249
|
}
|
|
2187
2250
|
),
|
|
@@ -2193,15 +2256,15 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
2193
2256
|
background: "linear-gradient(to right, rgba(244, 63, 94, 0.8), rgba(225, 29, 72, 0.8))",
|
|
2194
2257
|
boxShadow: "0 12px 30px -16px rgba(244, 63, 94, 0.65)"
|
|
2195
2258
|
},
|
|
2196
|
-
onClick:
|
|
2259
|
+
onClick: i,
|
|
2197
2260
|
children: "Confirm exit"
|
|
2198
2261
|
}
|
|
2199
2262
|
)
|
|
2200
2263
|
] })
|
|
2201
2264
|
] })
|
|
2202
2265
|
}
|
|
2203
|
-
),
|
|
2204
|
-
const { baseColor:
|
|
2266
|
+
), Ee = ({ title: i, onExit: r }) => {
|
|
2267
|
+
const { baseColor: t } = te(), [s, n] = k(!1);
|
|
2205
2268
|
return /* @__PURE__ */ e.jsxs("header", { className: "iw-w-full iw-text-gray-900", children: [
|
|
2206
2269
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-mx-auto iw-flex iw-items-center iw-justify-between iw-px-4 iw-pb-4 iw-pt-2", children: [
|
|
2207
2270
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-space-x-2", children: [
|
|
@@ -2209,13 +2272,13 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
2209
2272
|
"div",
|
|
2210
2273
|
{
|
|
2211
2274
|
className: "iw-h-7 iw-w-7 iw-rounded-md iw-flex iw-items-center iw-justify-center iw-text-white iw-font-semibold",
|
|
2212
|
-
style: { backgroundColor:
|
|
2275
|
+
style: { backgroundColor: t },
|
|
2213
2276
|
children: "N"
|
|
2214
2277
|
}
|
|
2215
2278
|
),
|
|
2216
2279
|
/* @__PURE__ */ e.jsx("p", { className: "iw-text-sm iw-font-medium", children: "Novara" })
|
|
2217
2280
|
] }),
|
|
2218
|
-
/* @__PURE__ */ e.jsx("h1", { className: "iw-text-base iw-font-bold", children:
|
|
2281
|
+
/* @__PURE__ */ e.jsx("h1", { className: "iw-text-base iw-font-bold", children: i }),
|
|
2219
2282
|
/* @__PURE__ */ e.jsx(
|
|
2220
2283
|
"button",
|
|
2221
2284
|
{
|
|
@@ -2230,7 +2293,7 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
2230
2293
|
] }),
|
|
2231
2294
|
/* @__PURE__ */ e.jsx("div", { className: "iw-h-px iw-bg-gray-200" }),
|
|
2232
2295
|
/* @__PURE__ */ e.jsx(
|
|
2233
|
-
|
|
2296
|
+
Ut,
|
|
2234
2297
|
{
|
|
2235
2298
|
isOpen: s,
|
|
2236
2299
|
confirmExitInterview: () => {
|
|
@@ -2240,111 +2303,111 @@ const we = new pt(), bt = (t = {}) => {
|
|
|
2240
2303
|
}
|
|
2241
2304
|
)
|
|
2242
2305
|
] });
|
|
2243
|
-
},
|
|
2244
|
-
className:
|
|
2306
|
+
}, qt = ({
|
|
2307
|
+
className: i = "",
|
|
2245
2308
|
width: r,
|
|
2246
|
-
height:
|
|
2309
|
+
height: t = 56,
|
|
2247
2310
|
barWidth: s = 3,
|
|
2248
2311
|
gap: n = 2,
|
|
2249
2312
|
fftSize: o = 1024,
|
|
2250
2313
|
smoothingTimeConstant: a = 0.8,
|
|
2251
2314
|
mediaStream: l,
|
|
2252
|
-
startOnMount:
|
|
2315
|
+
startOnMount: w = !0
|
|
2253
2316
|
}) => {
|
|
2254
|
-
const { baseColor:
|
|
2317
|
+
const { baseColor: d } = te(), u = E(null), h = E(null), m = E(null), c = E(null), x = E(null), b = E(null), j = E(!1), [g, v] = k(null);
|
|
2255
2318
|
C(() => {
|
|
2256
2319
|
if (r || !h.current) return;
|
|
2257
|
-
const
|
|
2258
|
-
const
|
|
2259
|
-
if (!
|
|
2260
|
-
const
|
|
2261
|
-
|
|
2262
|
-
},
|
|
2263
|
-
return
|
|
2264
|
-
}, [r,
|
|
2320
|
+
const N = h.current, _ = () => {
|
|
2321
|
+
const R = u.current;
|
|
2322
|
+
if (!R) return;
|
|
2323
|
+
const A = N.clientWidth, f = t;
|
|
2324
|
+
R.width = Math.max(1, Math.floor(A * window.devicePixelRatio || 1)), R.height = Math.max(1, Math.floor(f * window.devicePixelRatio || 1));
|
|
2325
|
+
}, y = new ResizeObserver(_);
|
|
2326
|
+
return y.observe(N), _(), () => y.disconnect();
|
|
2327
|
+
}, [r, t]), C(() => {
|
|
2265
2328
|
if (!r) return;
|
|
2266
|
-
const
|
|
2267
|
-
|
|
2329
|
+
const N = u.current;
|
|
2330
|
+
N && (N.width = Math.max(
|
|
2268
2331
|
1,
|
|
2269
2332
|
Math.floor(r * (window.devicePixelRatio || 1))
|
|
2270
|
-
),
|
|
2333
|
+
), N.height = Math.max(
|
|
2271
2334
|
1,
|
|
2272
|
-
Math.floor(
|
|
2335
|
+
Math.floor(t * (window.devicePixelRatio || 1))
|
|
2273
2336
|
));
|
|
2274
|
-
}, [r,
|
|
2275
|
-
let
|
|
2337
|
+
}, [r, t]), C(() => {
|
|
2338
|
+
let N = !1;
|
|
2276
2339
|
return (async () => {
|
|
2277
2340
|
try {
|
|
2278
|
-
const
|
|
2279
|
-
m.current =
|
|
2280
|
-
let
|
|
2281
|
-
if (!
|
|
2282
|
-
if (!
|
|
2283
|
-
|
|
2341
|
+
const y = new (window.AudioContext || window.webkitAudioContext)();
|
|
2342
|
+
m.current = y;
|
|
2343
|
+
let R = l;
|
|
2344
|
+
if (!R) {
|
|
2345
|
+
if (!w) return;
|
|
2346
|
+
R = await navigator.mediaDevices.getUserMedia({
|
|
2284
2347
|
audio: !0,
|
|
2285
2348
|
video: !1
|
|
2286
2349
|
}), j.current = !0;
|
|
2287
2350
|
}
|
|
2288
|
-
if (
|
|
2289
|
-
const
|
|
2290
|
-
|
|
2291
|
-
const
|
|
2292
|
-
x.current =
|
|
2293
|
-
} catch (
|
|
2294
|
-
|
|
2351
|
+
if (N) return;
|
|
2352
|
+
const A = y.createAnalyser();
|
|
2353
|
+
A.fftSize = o, A.smoothingTimeConstant = a, c.current = A;
|
|
2354
|
+
const f = y.createMediaStreamSource(R);
|
|
2355
|
+
x.current = f, f.connect(A), S();
|
|
2356
|
+
} catch (y) {
|
|
2357
|
+
v((y == null ? void 0 : y.message) || "Failed to initialize microphone");
|
|
2295
2358
|
}
|
|
2296
2359
|
})(), () => {
|
|
2297
|
-
var
|
|
2298
|
-
|
|
2360
|
+
var y, R, A, f;
|
|
2361
|
+
N = !0, b.current && cancelAnimationFrame(b.current);
|
|
2299
2362
|
try {
|
|
2300
|
-
(
|
|
2363
|
+
(y = x.current) == null || y.disconnect();
|
|
2301
2364
|
} catch {
|
|
2302
2365
|
}
|
|
2303
2366
|
try {
|
|
2304
|
-
(
|
|
2367
|
+
(R = c.current) == null || R.disconnect();
|
|
2305
2368
|
} catch {
|
|
2306
2369
|
}
|
|
2307
|
-
j.current && ((
|
|
2370
|
+
j.current && ((f = ((A = x.current) == null ? void 0 : A.mediaStream) || void 0) == null || f.getTracks().forEach((M) => M.stop())), m.current && m.current.state !== "closed" && m.current.close();
|
|
2308
2371
|
};
|
|
2309
|
-
}, [l, o, a,
|
|
2372
|
+
}, [l, o, a, w]);
|
|
2310
2373
|
const S = () => {
|
|
2311
|
-
const
|
|
2312
|
-
if (!
|
|
2313
|
-
const
|
|
2314
|
-
if (!
|
|
2315
|
-
const
|
|
2316
|
-
|
|
2317
|
-
const
|
|
2318
|
-
for (let
|
|
2319
|
-
const
|
|
2320
|
-
|
|
2321
|
-
const
|
|
2322
|
-
|
|
2374
|
+
const N = u.current, _ = c.current;
|
|
2375
|
+
if (!N || !_) return;
|
|
2376
|
+
const y = N.getContext("2d");
|
|
2377
|
+
if (!y) return;
|
|
2378
|
+
const R = window.devicePixelRatio || 1, A = N.width, f = N.height, M = _.frequencyBinCount, L = new Uint8Array(M), O = () => {
|
|
2379
|
+
b.current = requestAnimationFrame(O), _.getByteTimeDomainData(L), y.clearRect(0, 0, A, f), y.fillStyle = "rgba(0,0,0,0)", y.fillRect(0, 0, A, f);
|
|
2380
|
+
const q = Math.max(1, Math.floor(s * R)), z = Math.max(1, Math.floor(n * R)), H = q + z, Y = Math.max(8, Math.floor((A + z) / H)), B = Math.floor(L.length / Y);
|
|
2381
|
+
for (let U = 0; U < Y; U++) {
|
|
2382
|
+
const P = Math.min(L.length - 1, U * B), Q = L[P] / 128 - 1, W = Math.abs(Q), ce = Math.pow(W, 0.6), K = Math.max(f * 0.06, ce * (f * 0.9)), de = U * H, we = (f - K) / 2, ue = 140 - Math.min(140, 140 * W), J = 85, ie = 48 + Math.floor(12 * (1 - W));
|
|
2383
|
+
y.fillStyle = `${d}`, y.shadowColor = `hsla(${ue}, ${J}%, ${ie}%, ${0.25 * W})`, y.shadowBlur = 8 * W;
|
|
2384
|
+
const p = Math.min(q / 2, K / 2);
|
|
2385
|
+
Bt(y, de, we, q, K, p), y.fill();
|
|
2323
2386
|
}
|
|
2324
2387
|
};
|
|
2325
|
-
|
|
2388
|
+
O();
|
|
2326
2389
|
};
|
|
2327
2390
|
return /* @__PURE__ */ e.jsxs(
|
|
2328
2391
|
"div",
|
|
2329
2392
|
{
|
|
2330
2393
|
ref: h,
|
|
2331
|
-
className: `iw-relative iw-w-full iw-overflow-hidden iw-rounded-md iw-bg-gray-50 ${
|
|
2332
|
-
style: { height:
|
|
2394
|
+
className: `iw-relative iw-w-full iw-overflow-hidden iw-rounded-md iw-bg-gray-50 ${i}`,
|
|
2395
|
+
style: { height: t },
|
|
2333
2396
|
children: [
|
|
2334
2397
|
/* @__PURE__ */ e.jsx("canvas", { ref: u, className: "iw-w-full iw-h-full" }),
|
|
2335
|
-
|
|
2398
|
+
g && /* @__PURE__ */ e.jsx("div", { className: "iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center", children: /* @__PURE__ */ e.jsx("span", { className: "iw-text-xs iw-text-red-600 iw-bg-red-50 iw-border iw-border-red-200 iw-px-2 iw-py-1 iw-rounded", children: g }) })
|
|
2336
2399
|
]
|
|
2337
2400
|
}
|
|
2338
2401
|
);
|
|
2339
2402
|
};
|
|
2340
|
-
function
|
|
2403
|
+
function Bt(i, r, t, s, n, o) {
|
|
2341
2404
|
const a = Math.min(o, s / 2, n / 2);
|
|
2342
|
-
|
|
2405
|
+
i.beginPath(), i.moveTo(r + a, t), i.lineTo(r + s - a, t), i.quadraticCurveTo(r + s, t, r + s, t + a), i.lineTo(r + s, t + n - a), i.quadraticCurveTo(r + s, t + n, r + s - a, t + n), i.lineTo(r + a, t + n), i.quadraticCurveTo(r, t + n, r, t + n - a), i.lineTo(r, t + a), i.quadraticCurveTo(r, t, r + a, t), i.closePath();
|
|
2343
2406
|
}
|
|
2344
|
-
const
|
|
2345
|
-
state:
|
|
2407
|
+
const Wt = ({
|
|
2408
|
+
state: i,
|
|
2346
2409
|
answeringTime: r,
|
|
2347
|
-
nextPhase:
|
|
2410
|
+
nextPhase: t,
|
|
2348
2411
|
sttError: s
|
|
2349
2412
|
}) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-justify-between iw-h-full ", children: [
|
|
2350
2413
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
@@ -2352,14 +2415,14 @@ const Rt = ({
|
|
|
2352
2415
|
/* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "You may start speaking now. We're listening...." }),
|
|
2353
2416
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
|
|
2354
2417
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
|
|
2355
|
-
/* @__PURE__ */ e.jsx(
|
|
2418
|
+
/* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
|
|
2356
2419
|
/* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to talk: " })
|
|
2357
2420
|
] }),
|
|
2358
2421
|
/* @__PURE__ */ e.jsx(
|
|
2359
|
-
|
|
2422
|
+
ve,
|
|
2360
2423
|
{
|
|
2361
2424
|
total: r,
|
|
2362
|
-
remaining:
|
|
2425
|
+
remaining: i.currentPhaseTimeRemaining,
|
|
2363
2426
|
size: 50,
|
|
2364
2427
|
strokeWidth: 4
|
|
2365
2428
|
}
|
|
@@ -2369,24 +2432,24 @@ const Rt = ({
|
|
|
2369
2432
|
/* @__PURE__ */ e.jsx("p", { className: "iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: "Done talking? Click the button to review your answer." })
|
|
2370
2433
|
] }),
|
|
2371
2434
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2372
|
-
/* @__PURE__ */ e.jsx(
|
|
2435
|
+
/* @__PURE__ */ e.jsx(qt, {}),
|
|
2373
2436
|
s && /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
|
|
2374
2437
|
"Recording error: ",
|
|
2375
2438
|
s.message
|
|
2376
2439
|
] })
|
|
2377
2440
|
] }),
|
|
2378
2441
|
/* @__PURE__ */ e.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1", children: /* @__PURE__ */ e.jsx(
|
|
2379
|
-
|
|
2442
|
+
V,
|
|
2380
2443
|
{
|
|
2381
2444
|
onClick: () => {
|
|
2382
|
-
|
|
2445
|
+
t();
|
|
2383
2446
|
},
|
|
2384
2447
|
children: "Transcribe My Answer"
|
|
2385
2448
|
}
|
|
2386
2449
|
) })
|
|
2387
2450
|
] });
|
|
2388
|
-
function
|
|
2389
|
-
const [
|
|
2451
|
+
function Gt() {
|
|
2452
|
+
const [i, r] = k(!0), t = ee(
|
|
2390
2453
|
() => [0, 1, 2].map((s) => ({ id: s })),
|
|
2391
2454
|
[]
|
|
2392
2455
|
);
|
|
@@ -2396,8 +2459,8 @@ function Mt() {
|
|
|
2396
2459
|
}, 1500);
|
|
2397
2460
|
return () => clearInterval(s);
|
|
2398
2461
|
}, []), /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-h-full", children: [
|
|
2399
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-relative iw-w-80 iw-h-48 ", "aria-hidden": !0, children:
|
|
2400
|
-
const o = n * 50, a =
|
|
2462
|
+
/* @__PURE__ */ e.jsx("div", { className: "iw-relative iw-w-80 iw-h-48 ", "aria-hidden": !0, children: t.map((s, n) => {
|
|
2463
|
+
const o = n * 50, a = i ? o : o + 12, l = i ? 1 : 0.08, w = n * 140;
|
|
2401
2464
|
return /* @__PURE__ */ e.jsx(
|
|
2402
2465
|
"div",
|
|
2403
2466
|
{
|
|
@@ -2407,7 +2470,7 @@ function Mt() {
|
|
|
2407
2470
|
top: 0,
|
|
2408
2471
|
transform: `translateY(${a}px)`,
|
|
2409
2472
|
opacity: l,
|
|
2410
|
-
transition: `transform 600ms cubic-bezier(.2,.9,.3,1) ${
|
|
2473
|
+
transition: `transform 600ms cubic-bezier(.2,.9,.3,1) ${w}ms, opacity 400ms ease ${w}ms`
|
|
2411
2474
|
},
|
|
2412
2475
|
children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-gap-3 iw-items-center", children: [
|
|
2413
2476
|
/* @__PURE__ */ e.jsx("div", { className: "iw-w-10 iw-h-10 iw-bg-gray-300 iw-rounded iw-flex-shrink-0" }),
|
|
@@ -2423,10 +2486,10 @@ function Mt() {
|
|
|
2423
2486
|
/* @__PURE__ */ e.jsx("div", { className: "iw-text-center", children: /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-500 iw-font-medium", children: "Preparing your question..." }) })
|
|
2424
2487
|
] });
|
|
2425
2488
|
}
|
|
2426
|
-
const
|
|
2427
|
-
size:
|
|
2489
|
+
const Vt = ({
|
|
2490
|
+
size: i = "192px",
|
|
2428
2491
|
className: r,
|
|
2429
|
-
colors:
|
|
2492
|
+
colors: t,
|
|
2430
2493
|
animationDuration: s = 20
|
|
2431
2494
|
}) => {
|
|
2432
2495
|
const o = { ...{
|
|
@@ -2437,14 +2500,14 @@ const At = ({
|
|
|
2437
2500
|
// Pastel blue
|
|
2438
2501
|
c3: "oklch(78% 0.14 280)"
|
|
2439
2502
|
// Pastel purple/lavender
|
|
2440
|
-
}, ...
|
|
2503
|
+
}, ...t }, a = parseInt(i.replace("px", ""), 10), l = a < 50 ? Math.max(a * 8e-3, 1) : Math.max(a * 0.015, 4), w = a < 50 ? Math.max(a * 4e-3, 1.2) : Math.max(a * 8e-3, 1.5), d = a < 50 ? Math.max(a * 4e-3, 0.05) : Math.max(a * 8e-3, 0.1), u = a < 50 ? Math.max(a * 4e-3, 0.5) : Math.max(a * 8e-3, 2), h = a < 30 ? "0%" : a < 50 ? "5%" : a < 100 ? "15%" : "25%", m = a < 30 ? 1.1 : a < 50 ? Math.max(w * 1.2, 1.3) : w;
|
|
2441
2504
|
return /* @__PURE__ */ e.jsx(
|
|
2442
2505
|
"div",
|
|
2443
2506
|
{
|
|
2444
2507
|
className: `siri-orb ${r}`,
|
|
2445
2508
|
style: {
|
|
2446
|
-
width:
|
|
2447
|
-
height:
|
|
2509
|
+
width: i,
|
|
2510
|
+
height: i,
|
|
2448
2511
|
"--bg": o.bg,
|
|
2449
2512
|
"--c1": o.c1,
|
|
2450
2513
|
"--c2": o.c2,
|
|
@@ -2452,7 +2515,7 @@ const At = ({
|
|
|
2452
2515
|
"--animation-duration": `${s}s`,
|
|
2453
2516
|
"--blur-amount": `${l}px`,
|
|
2454
2517
|
"--contrast-amount": m,
|
|
2455
|
-
"--dot-size": `${
|
|
2518
|
+
"--dot-size": `${d}px`,
|
|
2456
2519
|
"--shadow-spread": `${u}px`,
|
|
2457
2520
|
"--mask-radius": h
|
|
2458
2521
|
},
|
|
@@ -2565,46 +2628,46 @@ const At = ({
|
|
|
2565
2628
|
}
|
|
2566
2629
|
);
|
|
2567
2630
|
};
|
|
2568
|
-
function
|
|
2631
|
+
function zt({ ttsError: i }) {
|
|
2569
2632
|
return /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-w-full iw-h-full", children: [
|
|
2570
|
-
/* @__PURE__ */ e.jsx(
|
|
2571
|
-
|
|
2633
|
+
/* @__PURE__ */ e.jsx(Vt, { size: "80px" }),
|
|
2634
|
+
i && /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
|
|
2572
2635
|
"Audio playback failed: ",
|
|
2573
|
-
|
|
2636
|
+
i.message
|
|
2574
2637
|
] }),
|
|
2575
2638
|
/* @__PURE__ */ e.jsx("p", { className: "iw-text- iw-text-gray-700", children: "Your AI interviewer is speaking..." })
|
|
2576
2639
|
] });
|
|
2577
2640
|
}
|
|
2578
|
-
const
|
|
2641
|
+
const Ht = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ", children: [
|
|
2579
2642
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2580
2643
|
/* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Get Ready to Answer" }),
|
|
2581
2644
|
/* @__PURE__ */ e.jsx("p", { className: "iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: "After 30-seconds thinking time, recording will start automatically, or you can begin recording early by clicking the button below." })
|
|
2582
2645
|
] }),
|
|
2583
2646
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
|
|
2584
2647
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
|
|
2585
|
-
/* @__PURE__ */ e.jsx(
|
|
2648
|
+
/* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
|
|
2586
2649
|
/* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to think: " })
|
|
2587
2650
|
] }),
|
|
2588
2651
|
/* @__PURE__ */ e.jsx(
|
|
2589
|
-
|
|
2652
|
+
ve,
|
|
2590
2653
|
{
|
|
2591
2654
|
total: r,
|
|
2592
|
-
remaining:
|
|
2655
|
+
remaining: i.currentPhaseTimeRemaining,
|
|
2593
2656
|
size: 50,
|
|
2594
2657
|
strokeWidth: 4
|
|
2595
2658
|
}
|
|
2596
2659
|
)
|
|
2597
2660
|
] }),
|
|
2598
2661
|
/* @__PURE__ */ e.jsx("div", { className: "iw-w-full iw-grid iw-grid-cols-1", children: /* @__PURE__ */ e.jsx(
|
|
2599
|
-
|
|
2662
|
+
V,
|
|
2600
2663
|
{
|
|
2601
2664
|
onClick: () => {
|
|
2602
|
-
|
|
2665
|
+
t();
|
|
2603
2666
|
},
|
|
2604
2667
|
children: "Start Answering"
|
|
2605
2668
|
}
|
|
2606
2669
|
) })
|
|
2607
|
-
] }),
|
|
2670
|
+
] }), Yt = ({ sttError: i }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full", children: [
|
|
2608
2671
|
/* @__PURE__ */ e.jsxs("svg", { width: "48", height: "48", viewBox: "0 0 60 60", fill: "none", children: [
|
|
2609
2672
|
/* @__PURE__ */ e.jsx(
|
|
2610
2673
|
"rect",
|
|
@@ -2640,12 +2703,12 @@ const Pt = ({ state: t, thinkingTime: r, nextPhase: i }) => /* @__PURE__ */ e.js
|
|
|
2640
2703
|
] }),
|
|
2641
2704
|
/* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1 iw-mt-3", children: "Just a moment... We're analyzing your response" }),
|
|
2642
2705
|
/* @__PURE__ */ e.jsx("p", { className: "iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: "After transcription, you'll have 45 sec to review your answer." }),
|
|
2643
|
-
|
|
2706
|
+
i && /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
|
|
2644
2707
|
"Transcription error: ",
|
|
2645
|
-
|
|
2646
|
-
|
|
2708
|
+
i.message,
|
|
2709
|
+
i.recoverable && " (attempting to continue)"
|
|
2647
2710
|
] })
|
|
2648
|
-
] }),
|
|
2711
|
+
] }), se = (i) => /* @__PURE__ */ e.jsxs(
|
|
2649
2712
|
"svg",
|
|
2650
2713
|
{
|
|
2651
2714
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2657,14 +2720,14 @@ const Pt = ({ state: t, thinkingTime: r, nextPhase: i }) => /* @__PURE__ */ e.js
|
|
|
2657
2720
|
strokeWidth: "2",
|
|
2658
2721
|
strokeLinecap: "round",
|
|
2659
2722
|
strokeLinejoin: "round",
|
|
2660
|
-
...
|
|
2723
|
+
...i,
|
|
2661
2724
|
children: [
|
|
2662
2725
|
/* @__PURE__ */ e.jsx("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
2663
2726
|
/* @__PURE__ */ e.jsx("path", { d: "M12 9v4" }),
|
|
2664
2727
|
/* @__PURE__ */ e.jsx("path", { d: "M12 17h.01" })
|
|
2665
2728
|
]
|
|
2666
2729
|
}
|
|
2667
|
-
),
|
|
2730
|
+
), Qt = (i) => /* @__PURE__ */ e.jsxs(
|
|
2668
2731
|
"svg",
|
|
2669
2732
|
{
|
|
2670
2733
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2676,13 +2739,13 @@ const Pt = ({ state: t, thinkingTime: r, nextPhase: i }) => /* @__PURE__ */ e.js
|
|
|
2676
2739
|
strokeWidth: "2",
|
|
2677
2740
|
strokeLinecap: "round",
|
|
2678
2741
|
strokeLinejoin: "round",
|
|
2679
|
-
...
|
|
2742
|
+
...i,
|
|
2680
2743
|
children: [
|
|
2681
2744
|
/* @__PURE__ */ e.jsx("path", { d: "M12 6v6l4 2" }),
|
|
2682
2745
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" })
|
|
2683
2746
|
]
|
|
2684
2747
|
}
|
|
2685
|
-
),
|
|
2748
|
+
), Kt = (i) => /* @__PURE__ */ e.jsxs(
|
|
2686
2749
|
"svg",
|
|
2687
2750
|
{
|
|
2688
2751
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2694,13 +2757,13 @@ const Pt = ({ state: t, thinkingTime: r, nextPhase: i }) => /* @__PURE__ */ e.js
|
|
|
2694
2757
|
strokeWidth: "2",
|
|
2695
2758
|
strokeLinecap: "round",
|
|
2696
2759
|
strokeLinejoin: "round",
|
|
2697
|
-
...
|
|
2760
|
+
...i,
|
|
2698
2761
|
children: [
|
|
2699
2762
|
/* @__PURE__ */ e.jsx("path", { d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }),
|
|
2700
2763
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
2701
2764
|
]
|
|
2702
2765
|
}
|
|
2703
|
-
),
|
|
2766
|
+
), Jt = (i) => /* @__PURE__ */ e.jsxs(
|
|
2704
2767
|
"svg",
|
|
2705
2768
|
{
|
|
2706
2769
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2712,7 +2775,7 @@ const Pt = ({ state: t, thinkingTime: r, nextPhase: i }) => /* @__PURE__ */ e.js
|
|
|
2712
2775
|
strokeWidth: "2",
|
|
2713
2776
|
strokeLinecap: "round",
|
|
2714
2777
|
strokeLinejoin: "round",
|
|
2715
|
-
...
|
|
2778
|
+
...i,
|
|
2716
2779
|
children: [
|
|
2717
2780
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "3" }),
|
|
2718
2781
|
/* @__PURE__ */ e.jsx("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
|
|
@@ -2721,7 +2784,7 @@ const Pt = ({ state: t, thinkingTime: r, nextPhase: i }) => /* @__PURE__ */ e.js
|
|
|
2721
2784
|
/* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
|
|
2722
2785
|
]
|
|
2723
2786
|
}
|
|
2724
|
-
),
|
|
2787
|
+
), me = (i) => /* @__PURE__ */ e.jsxs(
|
|
2725
2788
|
"svg",
|
|
2726
2789
|
{
|
|
2727
2790
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2733,7 +2796,7 @@ const Pt = ({ state: t, thinkingTime: r, nextPhase: i }) => /* @__PURE__ */ e.js
|
|
|
2733
2796
|
strokeWidth: "2",
|
|
2734
2797
|
strokeLinecap: "round",
|
|
2735
2798
|
strokeLinejoin: "round",
|
|
2736
|
-
...
|
|
2799
|
+
...i,
|
|
2737
2800
|
children: [
|
|
2738
2801
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "3" }),
|
|
2739
2802
|
/* @__PURE__ */ e.jsx("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
|
|
@@ -2742,7 +2805,7 @@ const Pt = ({ state: t, thinkingTime: r, nextPhase: i }) => /* @__PURE__ */ e.js
|
|
|
2742
2805
|
/* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
|
|
2743
2806
|
]
|
|
2744
2807
|
}
|
|
2745
|
-
),
|
|
2808
|
+
), Xt = (i) => /* @__PURE__ */ e.jsxs(
|
|
2746
2809
|
"svg",
|
|
2747
2810
|
{
|
|
2748
2811
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2754,7 +2817,7 @@ const Pt = ({ state: t, thinkingTime: r, nextPhase: i }) => /* @__PURE__ */ e.js
|
|
|
2754
2817
|
strokeWidth: "2",
|
|
2755
2818
|
strokeLinecap: "round",
|
|
2756
2819
|
strokeLinejoin: "round",
|
|
2757
|
-
...
|
|
2820
|
+
...i,
|
|
2758
2821
|
children: [
|
|
2759
2822
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "3" }),
|
|
2760
2823
|
/* @__PURE__ */ e.jsx("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
|
|
@@ -2763,102 +2826,102 @@ const Pt = ({ state: t, thinkingTime: r, nextPhase: i }) => /* @__PURE__ */ e.js
|
|
|
2763
2826
|
/* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
|
|
2764
2827
|
]
|
|
2765
2828
|
}
|
|
2766
|
-
),
|
|
2767
|
-
function
|
|
2768
|
-
isOpen:
|
|
2829
|
+
), re = 5;
|
|
2830
|
+
function Zt({
|
|
2831
|
+
isOpen: i,
|
|
2769
2832
|
onClose: r,
|
|
2770
|
-
warningCount:
|
|
2833
|
+
warningCount: t,
|
|
2771
2834
|
violationType: s,
|
|
2772
2835
|
onDisqualify: n
|
|
2773
2836
|
}) {
|
|
2774
|
-
const [o, a] = k(10), l =
|
|
2837
|
+
const [o, a] = k(10), l = E(r);
|
|
2775
2838
|
if (C(() => {
|
|
2776
2839
|
l.current = r;
|
|
2777
2840
|
}, [r]), C(() => {
|
|
2778
|
-
if (!
|
|
2841
|
+
if (!i) return;
|
|
2779
2842
|
const m = setInterval(() => {
|
|
2780
2843
|
a((c) => c <= 1 ? (l.current(), 10) : c - 1);
|
|
2781
2844
|
}, 1e3);
|
|
2782
2845
|
return () => clearInterval(m);
|
|
2783
|
-
}, [
|
|
2784
|
-
|
|
2785
|
-
}, [
|
|
2846
|
+
}, [i]), C(() => {
|
|
2847
|
+
i && a(10);
|
|
2848
|
+
}, [i]), C(() => (i ? (document.body.style.overflow = "hidden", document.body.classList.add("interview-widget-container")) : (document.body.style.overflow = "unset", document.body.classList.remove("interview-widget-container")), () => {
|
|
2786
2849
|
document.body.style.overflow = "unset", document.body.classList.remove("interview-widget-container");
|
|
2787
|
-
}), [
|
|
2788
|
-
const
|
|
2850
|
+
}), [i]), !i) return null;
|
|
2851
|
+
const d = (() => {
|
|
2789
2852
|
switch (s) {
|
|
2790
2853
|
case "tab_switch":
|
|
2791
2854
|
return {
|
|
2792
2855
|
title: "Tab Switch Detected",
|
|
2793
2856
|
description: "You attempted to switch to another tab or reload application.",
|
|
2794
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2857
|
+
icon: /* @__PURE__ */ e.jsx(Kt, { className: "iw-h-5 iw-w-5" })
|
|
2795
2858
|
};
|
|
2796
2859
|
case "fullscreen_exit":
|
|
2797
2860
|
return {
|
|
2798
2861
|
title: "Full Screen Exit Detected",
|
|
2799
2862
|
description: "You attempted to exit full screen mode.",
|
|
2800
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2863
|
+
icon: /* @__PURE__ */ e.jsx(Oe, { className: "iw-h-5 iw-w-5" })
|
|
2801
2864
|
};
|
|
2802
2865
|
case "focus_loss":
|
|
2803
2866
|
return {
|
|
2804
2867
|
title: "Focus Loss Detected",
|
|
2805
2868
|
description: "You lost focus from the interview window.",
|
|
2806
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2869
|
+
icon: /* @__PURE__ */ e.jsx(Jt, { className: "iw-h-5 iw-w-5" })
|
|
2807
2870
|
};
|
|
2808
2871
|
case "blocked_shortcut":
|
|
2809
2872
|
return {
|
|
2810
2873
|
title: "Keyboard Shortcut Blocked",
|
|
2811
2874
|
description: "You attempted to use a blocked keyboard shortcut.",
|
|
2812
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2875
|
+
icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
|
|
2813
2876
|
};
|
|
2814
2877
|
case "right_click_attempt":
|
|
2815
2878
|
return {
|
|
2816
2879
|
title: "Right Click Attempted",
|
|
2817
2880
|
description: "You attempted to use the right click.",
|
|
2818
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2881
|
+
icon: /* @__PURE__ */ e.jsx(Xt, { className: "iw-h-5 iw-w-5" })
|
|
2819
2882
|
};
|
|
2820
2883
|
case "alt_tab_attempt":
|
|
2821
2884
|
return {
|
|
2822
2885
|
title: "Alt + Tab Attempted",
|
|
2823
2886
|
description: "You attempted to use the Alt + Tab shortcut.",
|
|
2824
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2887
|
+
icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
|
|
2825
2888
|
};
|
|
2826
2889
|
case "blocked_function_key":
|
|
2827
2890
|
return {
|
|
2828
2891
|
title: "Function Key Blocked",
|
|
2829
2892
|
description: "You attempted to use a blocked function key.",
|
|
2830
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2893
|
+
icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
|
|
2831
2894
|
};
|
|
2832
2895
|
default:
|
|
2833
2896
|
return {
|
|
2834
2897
|
title: "Violation Detected",
|
|
2835
2898
|
description: "You attempted to perform an action that is not allowed.",
|
|
2836
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2899
|
+
icon: /* @__PURE__ */ e.jsx(se, { className: "iw-h-5 iw-w-5" })
|
|
2837
2900
|
};
|
|
2838
2901
|
}
|
|
2839
|
-
})(), u =
|
|
2840
|
-
|
|
2902
|
+
})(), u = re - t, h = () => {
|
|
2903
|
+
t + 1 > re ? n() : r();
|
|
2841
2904
|
};
|
|
2842
2905
|
return /* @__PURE__ */ e.jsx("div", { className: "iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-black/60 iw-p-4 iw-backdrop-blur-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "iw-w-full iw-max-w-md iw-rounded-2xl iw-border iw-border-gray-100 iw-bg-white iw-shadow-xl", children: [
|
|
2843
2906
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-p-6 iw-pb-0", children: [
|
|
2844
2907
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-mb-6 iw-flex iw-items-start iw-gap-4", children: [
|
|
2845
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-12 iw-w-12 iw-flex-shrink-0 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-red-50", children: /* @__PURE__ */ e.jsx(
|
|
2908
|
+
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-12 iw-w-12 iw-flex-shrink-0 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-red-50", children: /* @__PURE__ */ e.jsx(se, { className: "iw-h-6 iw-w-6 iw-text-red-500" }) }),
|
|
2846
2909
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex-1", children: [
|
|
2847
2910
|
/* @__PURE__ */ e.jsx("h2", { className: "iw-mb-1 iw-text-xl iw-font-semibold iw-text-gray-900", children: "Security Violation" }),
|
|
2848
2911
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-2", children: [
|
|
2849
2912
|
/* @__PURE__ */ e.jsx("span", { className: "iw-text-sm iw-text-gray-500", children: "Warning" }),
|
|
2850
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-gap-1", children: Array.from({ length:
|
|
2913
|
+
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-gap-1", children: Array.from({ length: re }).map((m, c) => /* @__PURE__ */ e.jsx(
|
|
2851
2914
|
"div",
|
|
2852
2915
|
{
|
|
2853
|
-
className: `iw-h-2 iw-w-2 iw-rounded-full ${c <=
|
|
2916
|
+
className: `iw-h-2 iw-w-2 iw-rounded-full ${c <= t - 1 ? "iw-bg-red-500" : "iw-bg-gray-200"}`
|
|
2854
2917
|
},
|
|
2855
2918
|
c
|
|
2856
2919
|
)) }),
|
|
2857
2920
|
/* @__PURE__ */ e.jsxs("span", { className: "iw-text-sm iw-text-gray-500", children: [
|
|
2858
2921
|
"(",
|
|
2859
|
-
|
|
2922
|
+
t,
|
|
2860
2923
|
"/",
|
|
2861
|
-
|
|
2924
|
+
re,
|
|
2862
2925
|
")"
|
|
2863
2926
|
] })
|
|
2864
2927
|
] })
|
|
@@ -2873,12 +2936,12 @@ function qt({
|
|
|
2873
2936
|
borderColor: "rgb(254, 226, 226)"
|
|
2874
2937
|
},
|
|
2875
2938
|
children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-start iw-gap-4", children: [
|
|
2876
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-10 iw-w-10 iw-items-center iw-justify-center iw-rounded-xl iw-bg-white iw-shadow-sm", children:
|
|
2939
|
+
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-10 iw-w-10 iw-items-center iw-justify-center iw-rounded-xl iw-bg-white iw-shadow-sm", children: d.icon }),
|
|
2877
2940
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex-1", children: [
|
|
2878
|
-
/* @__PURE__ */ e.jsx("h3", { className: "iw-mb-2 iw-font-semibold iw-text-gray-900", children:
|
|
2879
|
-
/* @__PURE__ */ e.jsx("p", { className: "iw-text-sm iw-leading-relaxed iw-text-gray-700", children:
|
|
2941
|
+
/* @__PURE__ */ e.jsx("h3", { className: "iw-mb-2 iw-font-semibold iw-text-gray-900", children: d.title }),
|
|
2942
|
+
/* @__PURE__ */ e.jsx("p", { className: "iw-text-sm iw-leading-relaxed iw-text-gray-700", children: d.description }),
|
|
2880
2943
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-mt-3 iw-flex iw-items-center iw-gap-2 iw-text-xs iw-text-red-600", children: [
|
|
2881
|
-
/* @__PURE__ */ e.jsx(
|
|
2944
|
+
/* @__PURE__ */ e.jsx($e, { className: "iw-h-3 iw-w-3" }),
|
|
2882
2945
|
/* @__PURE__ */ e.jsx("span", { children: "This action is monitored for interview integrity" })
|
|
2883
2946
|
] })
|
|
2884
2947
|
] })
|
|
@@ -2892,7 +2955,7 @@ function qt({
|
|
|
2892
2955
|
] }) }),
|
|
2893
2956
|
/* @__PURE__ */ e.jsx("div", { className: "iw-border-primary-100 iw-bg-primary-50 iw-rounded-xl iw-border iw-p-4", children: /* @__PURE__ */ e.jsxs("div", { className: "iw-text-center", children: [
|
|
2894
2957
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-mb-1 iw-flex iw-items-center iw-justify-center iw-gap-1.5", children: [
|
|
2895
|
-
/* @__PURE__ */ e.jsx(
|
|
2958
|
+
/* @__PURE__ */ e.jsx(Qt, { className: "iw-text-primary-600 iw-h-4 iw-w-4" }),
|
|
2896
2959
|
/* @__PURE__ */ e.jsx("span", { className: "iw-text-primary-600 iw-text-2xl iw-font-bold", children: o })
|
|
2897
2960
|
] }),
|
|
2898
2961
|
/* @__PURE__ */ e.jsx("div", { className: "iw-text-primary-700 iw-text-xs iw-font-medium", children: "Auto Close" })
|
|
@@ -2906,7 +2969,7 @@ function qt({
|
|
|
2906
2969
|
background: "linear-gradient(to right, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.9))"
|
|
2907
2970
|
},
|
|
2908
2971
|
children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-3", children: [
|
|
2909
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-8 iw-w-8 iw-items-center iw-justify-center iw-rounded-full iw-bg-white/20", children: /* @__PURE__ */ e.jsx(
|
|
2972
|
+
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-h-8 iw-w-8 iw-items-center iw-justify-center iw-rounded-full iw-bg-white/20", children: /* @__PURE__ */ e.jsx(se, { className: "iw-h-4 iw-w-4" }) }),
|
|
2910
2973
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2911
2974
|
/* @__PURE__ */ e.jsx("div", { className: "iw-text-sm iw-font-semibold", children: "Final Warning" }),
|
|
2912
2975
|
/* @__PURE__ */ e.jsx("div", { className: "iw-text-xs iw-text-red-100", children: "Next violation will disqualify you from this interview" })
|
|
@@ -2917,7 +2980,7 @@ function qt({
|
|
|
2917
2980
|
] }),
|
|
2918
2981
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-p-6 iw-pt-0", children: [
|
|
2919
2982
|
/* @__PURE__ */ e.jsx(
|
|
2920
|
-
|
|
2983
|
+
V,
|
|
2921
2984
|
{
|
|
2922
2985
|
onClick: h,
|
|
2923
2986
|
className: "iw-h-12 iw-w-full iw-rounded-xl iw-bg-gray-800 iw-text-sm iw-font-medium iw-text-white iw-hover:bg-gray-800",
|
|
@@ -2928,7 +2991,7 @@ function qt({
|
|
|
2928
2991
|
] })
|
|
2929
2992
|
] }) });
|
|
2930
2993
|
}
|
|
2931
|
-
const
|
|
2994
|
+
const ei = (i) => /* @__PURE__ */ e.jsxs(
|
|
2932
2995
|
"svg",
|
|
2933
2996
|
{
|
|
2934
2997
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2940,24 +3003,24 @@ const Ut = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
2940
3003
|
strokeWidth: "2",
|
|
2941
3004
|
strokeLinecap: "round",
|
|
2942
3005
|
strokeLinejoin: "round",
|
|
2943
|
-
...
|
|
3006
|
+
...i,
|
|
2944
3007
|
children: [
|
|
2945
3008
|
/* @__PURE__ */ e.jsx("path", { d: "M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z" }),
|
|
2946
3009
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" })
|
|
2947
3010
|
]
|
|
2948
3011
|
}
|
|
2949
|
-
),
|
|
2950
|
-
showHardReloadWarning:
|
|
3012
|
+
), ti = ({
|
|
3013
|
+
showHardReloadWarning: i,
|
|
2951
3014
|
onContinue: r
|
|
2952
3015
|
}) => {
|
|
2953
|
-
const
|
|
3016
|
+
const t = () => {
|
|
2954
3017
|
r();
|
|
2955
3018
|
};
|
|
2956
3019
|
return /* @__PURE__ */ e.jsxs(
|
|
2957
|
-
|
|
3020
|
+
Ue,
|
|
2958
3021
|
{
|
|
2959
|
-
isOpen:
|
|
2960
|
-
onClose:
|
|
3022
|
+
isOpen: i,
|
|
3023
|
+
onClose: t,
|
|
2961
3024
|
closeOnOverlayClick: !1,
|
|
2962
3025
|
closeOnEscape: !1,
|
|
2963
3026
|
showCloseButton: !1,
|
|
@@ -2965,17 +3028,17 @@ const Ut = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
2965
3028
|
children: [
|
|
2966
3029
|
/* @__PURE__ */ e.jsx("div", { className: "iw-absolute iw-inset-x-0 iw-top-0 iw-h-1 iw-bg-gradient-to-r iw-from-red-500 iw-to-red-600" }),
|
|
2967
3030
|
/* @__PURE__ */ e.jsx("div", { className: "iw-space-y-1 iw-pb-2 iw-pt-3", children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-2", children: [
|
|
2968
|
-
/* @__PURE__ */ e.jsx(
|
|
3031
|
+
/* @__PURE__ */ e.jsx(se, { className: "iw-w-5 iw-h-5 iw-text-red-500" }),
|
|
2969
3032
|
/* @__PURE__ */ e.jsx("h3", { className: "iw-text-xl iw-font-semibold iw-text-red-500", children: "Full Screen Exit Detected" })
|
|
2970
3033
|
] }) }),
|
|
2971
3034
|
/* @__PURE__ */ e.jsx("div", { className: "iw-pt-4 iw-pb-6", children: /* @__PURE__ */ e.jsx("p", { className: "iw-text-center iw-text-sm iw-leading-relaxed iw-text-gray-500/90", children: "Exiting full screen mode or reloading this page during the session is strictly prohibited. Any attempt to do so will be recorded and may lead to penalties." }) }),
|
|
2972
3035
|
/* @__PURE__ */ e.jsx("div", { className: "iw-pt-2 iw-pb-4", children: /* @__PURE__ */ e.jsxs(
|
|
2973
3036
|
"button",
|
|
2974
3037
|
{
|
|
2975
|
-
onClick:
|
|
3038
|
+
onClick: t,
|
|
2976
3039
|
className: "iw-w-full iw-flex iw-items-center iw-justify-center iw-gap-2 iw-px-4 iw-py-3 iw-bg-gray-100 iw-text-gray-600 iw-rounded-md iw-font-medium iw-transition-colors hover:iw-bg-gray-200 focus:iw-outline-none focus:iw-ring-2 focus:iw-ring-gray-400 focus:iw-ring-offset-2",
|
|
2977
3040
|
children: [
|
|
2978
|
-
/* @__PURE__ */ e.jsx(
|
|
3041
|
+
/* @__PURE__ */ e.jsx(ei, { className: "iw-size-4" }),
|
|
2979
3042
|
"Continue Session"
|
|
2980
3043
|
]
|
|
2981
3044
|
}
|
|
@@ -2983,329 +3046,346 @@ const Ut = (t) => /* @__PURE__ */ e.jsxs(
|
|
|
2983
3046
|
]
|
|
2984
3047
|
}
|
|
2985
3048
|
);
|
|
2986
|
-
},
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
}), { enterFullScreen: u, isFullScreen: h, exitFullScreen: m } = lt({
|
|
2993
|
-
onFullScreenChange(x) {
|
|
2994
|
-
!x && !n && (s(!0), d({
|
|
2995
|
-
type: "fullscreen_exit",
|
|
2996
|
-
severity: "high",
|
|
2997
|
-
details: {
|
|
2998
|
-
action: "fullscreen_exit",
|
|
2999
|
-
reason: "Attempted to exit full screen mode"
|
|
3000
|
-
}
|
|
3001
|
-
}));
|
|
3002
|
-
}
|
|
3003
|
-
});
|
|
3004
|
-
C(() => {
|
|
3005
|
-
u();
|
|
3006
|
-
}, []), xt(d), ht(d), ft(), yt();
|
|
3007
|
-
const c = () => {
|
|
3008
|
-
o(!0), m(), s(!1), r == null || r();
|
|
3009
|
-
};
|
|
3010
|
-
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3011
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-relative iw-h-full iw-w-full", children: t }),
|
|
3012
|
-
/* @__PURE__ */ e.jsx(
|
|
3013
|
-
qt,
|
|
3014
|
-
{
|
|
3015
|
-
warningCount: w,
|
|
3016
|
-
isOpen: i,
|
|
3017
|
-
violationType: a,
|
|
3018
|
-
onClose: () => {
|
|
3019
|
-
s(!1), u();
|
|
3020
|
-
},
|
|
3021
|
-
onDisqualify: c
|
|
3049
|
+
}, ii = We(
|
|
3050
|
+
({ children: i, onDisqualify: r }, t) => {
|
|
3051
|
+
const [s, n] = k(!1), [o, a] = k(!1), [l, w] = k(!1), [d, u] = k("fullscreen_exit"), { logViolation: h, violationCount: m } = Dt({
|
|
3052
|
+
maxViolations: 5,
|
|
3053
|
+
onViolation: (g) => {
|
|
3054
|
+
o || (n(!0), u(g.type));
|
|
3022
3055
|
}
|
|
3023
|
-
),
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3056
|
+
}), { enterFullScreen: c, isFullScreen: x, exitFullScreen: b } = vt({
|
|
3057
|
+
onFullScreenChange(g) {
|
|
3058
|
+
!g && !o && !l && (n(!0), h({
|
|
3059
|
+
type: "fullscreen_exit",
|
|
3060
|
+
severity: "high",
|
|
3061
|
+
details: {
|
|
3062
|
+
action: "fullscreen_exit",
|
|
3063
|
+
reason: "Attempted to exit full screen mode"
|
|
3064
|
+
}
|
|
3065
|
+
})), g && w(!1);
|
|
3030
3066
|
}
|
|
3031
|
-
)
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3067
|
+
});
|
|
3068
|
+
C(() => {
|
|
3069
|
+
c();
|
|
3070
|
+
}, []), Ge(
|
|
3071
|
+
t,
|
|
3072
|
+
() => ({
|
|
3073
|
+
exitFullScreenIntentionally: async () => {
|
|
3074
|
+
w(!0), n(!1), a(!1);
|
|
3075
|
+
try {
|
|
3076
|
+
document.fullscreenElement && await document.exitFullscreen();
|
|
3077
|
+
} catch (g) {
|
|
3078
|
+
console.error("Failed to exit fullscreen:", g);
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
}),
|
|
3082
|
+
[]
|
|
3083
|
+
), It(h), Tt(h), Rt(), _t();
|
|
3084
|
+
const j = () => {
|
|
3085
|
+
a(!0), b(), n(!1), r == null || r();
|
|
3086
|
+
};
|
|
3087
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3088
|
+
/* @__PURE__ */ e.jsx("div", { className: "iw-relative iw-h-full iw-w-full", children: i }),
|
|
3089
|
+
/* @__PURE__ */ e.jsx(
|
|
3090
|
+
Zt,
|
|
3091
|
+
{
|
|
3092
|
+
warningCount: m,
|
|
3093
|
+
isOpen: s,
|
|
3094
|
+
violationType: d,
|
|
3095
|
+
onClose: () => {
|
|
3096
|
+
n(!1), c();
|
|
3097
|
+
},
|
|
3098
|
+
onDisqualify: j
|
|
3099
|
+
}
|
|
3100
|
+
),
|
|
3101
|
+
!s && m > 0 && !o && /* @__PURE__ */ e.jsx(
|
|
3102
|
+
ti,
|
|
3103
|
+
{
|
|
3104
|
+
showHardReloadWarning: !x,
|
|
3105
|
+
logViolation: h,
|
|
3106
|
+
onContinue: c
|
|
3107
|
+
}
|
|
3108
|
+
)
|
|
3109
|
+
] });
|
|
3110
|
+
}
|
|
3111
|
+
), ri = ({
|
|
3112
|
+
interviewTitle: i,
|
|
3035
3113
|
interviewId: r,
|
|
3036
|
-
onComplete:
|
|
3114
|
+
onComplete: t,
|
|
3037
3115
|
onDisqualify: s,
|
|
3038
3116
|
className: n = ""
|
|
3039
3117
|
}) => {
|
|
3040
|
-
const o =
|
|
3041
|
-
thinkingTime: (
|
|
3042
|
-
answeringTime: (
|
|
3043
|
-
editingTime: (
|
|
3044
|
-
}, { thinkingTime:
|
|
3118
|
+
const o = Et(), { baseUrl: a, authToken: l } = De(), { timers: w, stt: d, tts: u, proctoring: h } = at(), m = E(null), [c, x] = k(null), [b, j] = k(""), g = E(""), v = E(null), S = {
|
|
3119
|
+
thinkingTime: (w == null ? void 0 : w.thinkingDuration) || 30,
|
|
3120
|
+
answeringTime: (w == null ? void 0 : w.answeringDuration) || 120,
|
|
3121
|
+
editingTime: (w == null ? void 0 : w.editingDuration) || 30
|
|
3122
|
+
}, { thinkingTime: N, answeringTime: _, editingTime: y } = S;
|
|
3045
3123
|
C(() => {
|
|
3046
|
-
|
|
3047
|
-
}, [
|
|
3048
|
-
const
|
|
3049
|
-
speak:
|
|
3050
|
-
stop:
|
|
3051
|
-
error:
|
|
3052
|
-
} =
|
|
3124
|
+
g.current = b;
|
|
3125
|
+
}, [b]);
|
|
3126
|
+
const R = E(!1), {
|
|
3127
|
+
speak: A,
|
|
3128
|
+
stop: f,
|
|
3129
|
+
error: M
|
|
3130
|
+
} = Mt({
|
|
3053
3131
|
config: {
|
|
3054
3132
|
baseUrl: a,
|
|
3055
3133
|
provider: u == null ? void 0 : u.provider,
|
|
3056
3134
|
authToken: l
|
|
3057
3135
|
},
|
|
3058
3136
|
onEnd: () => {
|
|
3059
|
-
|
|
3137
|
+
R.current = !1, P();
|
|
3060
3138
|
},
|
|
3061
3139
|
onError: () => {
|
|
3062
|
-
|
|
3140
|
+
R.current || (R.current = !0, P());
|
|
3063
3141
|
}
|
|
3064
|
-
}),
|
|
3065
|
-
startRecording:
|
|
3066
|
-
stopRecording:
|
|
3067
|
-
transcribe:
|
|
3068
|
-
error:
|
|
3069
|
-
} =
|
|
3142
|
+
}), L = E(!1), O = E(!1), {
|
|
3143
|
+
startRecording: q,
|
|
3144
|
+
stopRecording: z,
|
|
3145
|
+
transcribe: H,
|
|
3146
|
+
error: Y
|
|
3147
|
+
} = St({
|
|
3070
3148
|
config: {
|
|
3071
3149
|
baseUrl: a,
|
|
3072
|
-
provider:
|
|
3073
|
-
model:
|
|
3074
|
-
language:
|
|
3150
|
+
provider: d == null ? void 0 : d.provider,
|
|
3151
|
+
model: d == null ? void 0 : d.model,
|
|
3152
|
+
language: d == null ? void 0 : d.language,
|
|
3075
3153
|
authToken: l
|
|
3076
3154
|
},
|
|
3077
3155
|
onStart: () => {
|
|
3078
|
-
|
|
3156
|
+
L.current = !1, O.current = !1;
|
|
3079
3157
|
},
|
|
3080
3158
|
onStop: () => {
|
|
3081
3159
|
},
|
|
3082
3160
|
onTranscriptionComplete: (p) => {
|
|
3083
|
-
|
|
3161
|
+
j(p.transcript), O.current || (O.current = !0, P());
|
|
3084
3162
|
},
|
|
3085
3163
|
onError: (p) => {
|
|
3086
|
-
console.error("STT Error:", p),
|
|
3164
|
+
console.error("STT Error:", p), L.current || (L.current = !0, P());
|
|
3087
3165
|
}
|
|
3088
|
-
}), { state:
|
|
3166
|
+
}), { state: B, startQuestion: U, nextPhase: P, completeInterview: Q } = bt({
|
|
3089
3167
|
config: {
|
|
3090
|
-
thinkingDuration:
|
|
3091
|
-
answeringDuration:
|
|
3092
|
-
editingDuration:
|
|
3168
|
+
thinkingDuration: N,
|
|
3169
|
+
answeringDuration: _,
|
|
3170
|
+
editingDuration: y
|
|
3093
3171
|
},
|
|
3094
3172
|
callbacks: {
|
|
3095
3173
|
onPhaseChange: (p) => {
|
|
3096
3174
|
switch (p) {
|
|
3097
|
-
case
|
|
3098
|
-
|
|
3175
|
+
case D.FETCHING_QUESTION:
|
|
3176
|
+
W();
|
|
3099
3177
|
break;
|
|
3100
|
-
case
|
|
3101
|
-
|
|
3178
|
+
case D.READING_QUESTION:
|
|
3179
|
+
de();
|
|
3102
3180
|
break;
|
|
3103
|
-
case
|
|
3104
|
-
|
|
3181
|
+
case D.ANSWERING:
|
|
3182
|
+
we();
|
|
3105
3183
|
break;
|
|
3106
|
-
case
|
|
3107
|
-
|
|
3184
|
+
case D.TRANSCRIBING:
|
|
3185
|
+
ue();
|
|
3108
3186
|
break;
|
|
3109
|
-
case
|
|
3110
|
-
|
|
3187
|
+
case D.SUBMITTING:
|
|
3188
|
+
K();
|
|
3111
3189
|
break;
|
|
3112
3190
|
}
|
|
3113
3191
|
},
|
|
3114
3192
|
onInterviewEnd: () => {
|
|
3115
|
-
|
|
3193
|
+
t == null || t();
|
|
3116
3194
|
}
|
|
3117
3195
|
}
|
|
3118
3196
|
});
|
|
3119
3197
|
C(() => {
|
|
3120
|
-
|
|
3198
|
+
U();
|
|
3121
3199
|
}, []);
|
|
3122
|
-
const { execute:
|
|
3200
|
+
const { execute: W, loading: ce } = yt(
|
|
3123
3201
|
async () => {
|
|
3124
|
-
var
|
|
3202
|
+
var G, X;
|
|
3125
3203
|
const p = await o.generateQuestion({
|
|
3126
3204
|
interviewId: r,
|
|
3127
|
-
question: ((
|
|
3128
|
-
qnaId: ((
|
|
3129
|
-
answer:
|
|
3205
|
+
question: ((G = v.current) == null ? void 0 : G.question) || "",
|
|
3206
|
+
qnaId: ((X = v.current) == null ? void 0 : X.qna_id) || "",
|
|
3207
|
+
answer: g.current
|
|
3130
3208
|
});
|
|
3131
|
-
return
|
|
3209
|
+
return v.current = p.data, p;
|
|
3132
3210
|
},
|
|
3133
3211
|
{
|
|
3134
3212
|
onSuccess: async (p) => {
|
|
3135
|
-
p && p.data && (
|
|
3213
|
+
p && p.data && (j(""), x(p.data), P());
|
|
3136
3214
|
},
|
|
3137
3215
|
onError: (p) => {
|
|
3138
3216
|
console.error("Failed to fetch questions:", p);
|
|
3139
3217
|
}
|
|
3140
3218
|
}
|
|
3141
|
-
),
|
|
3142
|
-
|
|
3143
|
-
}, [
|
|
3219
|
+
), K = T(async () => {
|
|
3220
|
+
U();
|
|
3221
|
+
}, [U]), de = T(async () => {
|
|
3144
3222
|
var p;
|
|
3145
|
-
if ((p =
|
|
3223
|
+
if ((p = v.current) != null && p.question)
|
|
3146
3224
|
try {
|
|
3147
|
-
|
|
3148
|
-
} catch (
|
|
3149
|
-
console.error("Failed to speak question:",
|
|
3225
|
+
R.current = !1, await A(v.current.question), v.current.is_interview_done && (await dt(2e3), Q());
|
|
3226
|
+
} catch (G) {
|
|
3227
|
+
console.error("Failed to speak question:", G);
|
|
3150
3228
|
}
|
|
3151
3229
|
else
|
|
3152
|
-
|
|
3153
|
-
}, [
|
|
3230
|
+
P();
|
|
3231
|
+
}, [A, P, Q]), we = T(async () => {
|
|
3154
3232
|
try {
|
|
3155
|
-
await
|
|
3233
|
+
await q(_);
|
|
3156
3234
|
} catch (p) {
|
|
3157
|
-
console.error("Failed to start recording:", p),
|
|
3235
|
+
console.error("Failed to start recording:", p), P();
|
|
3158
3236
|
}
|
|
3159
|
-
}, [
|
|
3237
|
+
}, [q, P]), ue = T(async () => {
|
|
3160
3238
|
try {
|
|
3161
|
-
const p = await
|
|
3162
|
-
await
|
|
3239
|
+
const p = await z();
|
|
3240
|
+
await H(p);
|
|
3163
3241
|
} catch (p) {
|
|
3164
|
-
console.error("STT processing failed:", p), !
|
|
3242
|
+
console.error("STT processing failed:", p), !L.current && !O.current && (L.current = !0, P());
|
|
3165
3243
|
}
|
|
3166
|
-
}, [
|
|
3244
|
+
}, [z, H, P]), J = T(
|
|
3167
3245
|
async (p) => {
|
|
3168
|
-
|
|
3246
|
+
var X;
|
|
3247
|
+
f(), await ((X = m.current) == null ? void 0 : X.exitFullScreenIntentionally()), (await o.generateQuestion({
|
|
3169
3248
|
interviewId: r,
|
|
3170
3249
|
isInterviewDone: !0
|
|
3171
|
-
})).success && (p == null || p(), Q(), sessionStorage.removeItem(
|
|
3250
|
+
})).success && (p == null || p(), Q(), sessionStorage.removeItem(xe));
|
|
3172
3251
|
},
|
|
3173
|
-
[r,
|
|
3174
|
-
),
|
|
3175
|
-
const { phase: p } =
|
|
3252
|
+
[r, f, o]
|
|
3253
|
+
), ie = () => {
|
|
3254
|
+
const { phase: p } = B;
|
|
3176
3255
|
switch (p) {
|
|
3177
|
-
case
|
|
3256
|
+
case D.IDLE:
|
|
3178
3257
|
return /* @__PURE__ */ e.jsxs("div", { className: "iw-text-center iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-2 iw-h-full", children: [
|
|
3179
3258
|
/* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Ready to start the Interview?" }),
|
|
3180
3259
|
/* @__PURE__ */ e.jsx("p", { className: "iw-max-w-xl iw-text-gray-500 iw-text-xs iw-leading-[21px]", children: `You will be asked a series of behavioral and technical questions. For each one you'll get a short thinking period, then a timed recording window. We'll transcribe your response so you can review and edit it before submitting. Click "Start Interview" when you're ready.` }),
|
|
3181
|
-
/* @__PURE__ */ e.jsx(
|
|
3260
|
+
/* @__PURE__ */ e.jsx(V, { onClick: U, className: "iw-mt-2 iw-w-40", children: "Start Interview" })
|
|
3182
3261
|
] });
|
|
3183
|
-
case
|
|
3184
|
-
return /* @__PURE__ */ e.jsx(
|
|
3185
|
-
case
|
|
3186
|
-
return /* @__PURE__ */ e.jsx(
|
|
3187
|
-
case
|
|
3262
|
+
case D.FETCHING_QUESTION:
|
|
3263
|
+
return /* @__PURE__ */ e.jsx(Gt, {});
|
|
3264
|
+
case D.READING_QUESTION:
|
|
3265
|
+
return /* @__PURE__ */ e.jsx(zt, { ttsError: M });
|
|
3266
|
+
case D.THINKING:
|
|
3188
3267
|
return /* @__PURE__ */ e.jsx(
|
|
3189
|
-
|
|
3268
|
+
Ht,
|
|
3190
3269
|
{
|
|
3191
|
-
state:
|
|
3192
|
-
thinkingTime:
|
|
3193
|
-
nextPhase:
|
|
3270
|
+
state: B,
|
|
3271
|
+
thinkingTime: N,
|
|
3272
|
+
nextPhase: P
|
|
3194
3273
|
}
|
|
3195
3274
|
);
|
|
3196
|
-
case
|
|
3275
|
+
case D.ANSWERING:
|
|
3197
3276
|
return /* @__PURE__ */ e.jsx(
|
|
3198
|
-
|
|
3277
|
+
Wt,
|
|
3199
3278
|
{
|
|
3200
|
-
state:
|
|
3201
|
-
answeringTime:
|
|
3202
|
-
nextPhase:
|
|
3203
|
-
sttError:
|
|
3279
|
+
state: B,
|
|
3280
|
+
answeringTime: _,
|
|
3281
|
+
nextPhase: P,
|
|
3282
|
+
sttError: Y
|
|
3204
3283
|
}
|
|
3205
3284
|
);
|
|
3206
|
-
case
|
|
3207
|
-
return /* @__PURE__ */ e.jsx(
|
|
3208
|
-
case
|
|
3209
|
-
case
|
|
3285
|
+
case D.TRANSCRIBING:
|
|
3286
|
+
return /* @__PURE__ */ e.jsx(Yt, { sttError: Y });
|
|
3287
|
+
case D.EDITING:
|
|
3288
|
+
case D.SUBMITTING:
|
|
3210
3289
|
return /* @__PURE__ */ e.jsx("div", { className: "iw-space-y-4 iw-h-full", children: /* @__PURE__ */ e.jsx(
|
|
3211
|
-
|
|
3290
|
+
Lt,
|
|
3212
3291
|
{
|
|
3213
|
-
value:
|
|
3214
|
-
onChange: (
|
|
3215
|
-
onSubmit: () =>
|
|
3216
|
-
isSubmitDisabled: !
|
|
3217
|
-
state:
|
|
3218
|
-
editingTime:
|
|
3292
|
+
value: b,
|
|
3293
|
+
onChange: (G) => j(G.target.value),
|
|
3294
|
+
onSubmit: () => P(),
|
|
3295
|
+
isSubmitDisabled: !b.trim() || ce,
|
|
3296
|
+
state: B,
|
|
3297
|
+
editingTime: y
|
|
3219
3298
|
}
|
|
3220
3299
|
) });
|
|
3221
|
-
case
|
|
3300
|
+
case D.COMPLETED:
|
|
3222
3301
|
return null;
|
|
3223
3302
|
default:
|
|
3224
3303
|
return null;
|
|
3225
3304
|
}
|
|
3226
3305
|
};
|
|
3227
3306
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: h != null && h.enabled ? /* @__PURE__ */ e.jsxs(
|
|
3228
|
-
|
|
3307
|
+
ii,
|
|
3229
3308
|
{
|
|
3230
|
-
|
|
3309
|
+
ref: m,
|
|
3310
|
+
onDisqualify: () => J(s),
|
|
3231
3311
|
children: [
|
|
3232
3312
|
/* @__PURE__ */ e.jsx(
|
|
3233
|
-
|
|
3313
|
+
Ee,
|
|
3234
3314
|
{
|
|
3235
|
-
title:
|
|
3236
|
-
onExit: () =>
|
|
3315
|
+
title: i,
|
|
3316
|
+
onExit: () => J()
|
|
3237
3317
|
}
|
|
3238
3318
|
),
|
|
3239
3319
|
/* @__PURE__ */ e.jsx(
|
|
3240
|
-
|
|
3320
|
+
ke,
|
|
3241
3321
|
{
|
|
3242
|
-
currentQuestion:
|
|
3243
|
-
phase:
|
|
3322
|
+
currentQuestion: c,
|
|
3323
|
+
phase: B.phase,
|
|
3244
3324
|
className: n,
|
|
3245
|
-
children:
|
|
3325
|
+
children: ie()
|
|
3246
3326
|
}
|
|
3247
3327
|
)
|
|
3248
3328
|
]
|
|
3249
3329
|
}
|
|
3250
3330
|
) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3251
3331
|
/* @__PURE__ */ e.jsx(
|
|
3252
|
-
|
|
3332
|
+
Ee,
|
|
3253
3333
|
{
|
|
3254
|
-
title:
|
|
3255
|
-
onExit: () =>
|
|
3334
|
+
title: i,
|
|
3335
|
+
onExit: () => J()
|
|
3256
3336
|
}
|
|
3257
3337
|
),
|
|
3258
3338
|
/* @__PURE__ */ e.jsx(
|
|
3259
|
-
|
|
3339
|
+
ke,
|
|
3260
3340
|
{
|
|
3261
|
-
currentQuestion:
|
|
3262
|
-
phase:
|
|
3341
|
+
currentQuestion: c,
|
|
3342
|
+
phase: B.phase,
|
|
3263
3343
|
className: n,
|
|
3264
|
-
children:
|
|
3344
|
+
children: ie()
|
|
3265
3345
|
}
|
|
3266
3346
|
)
|
|
3267
3347
|
] }) });
|
|
3268
|
-
},
|
|
3269
|
-
title:
|
|
3348
|
+
}, si = ({
|
|
3349
|
+
title: i,
|
|
3270
3350
|
interviewId: r,
|
|
3271
|
-
onInterviewEnd:
|
|
3351
|
+
onInterviewEnd: t,
|
|
3272
3352
|
onInterviewDisqualify: s,
|
|
3273
3353
|
className: n = ""
|
|
3274
3354
|
}) => {
|
|
3275
|
-
const [o, a] =
|
|
3355
|
+
const [o, a] = ge.useState(!1), [l, w] = ge.useState(!0), d = E(null);
|
|
3276
3356
|
return o ? /* @__PURE__ */ e.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ e.jsx(
|
|
3277
3357
|
"div",
|
|
3278
3358
|
{
|
|
3279
|
-
ref:
|
|
3359
|
+
ref: d,
|
|
3280
3360
|
className: `iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${n}`,
|
|
3281
3361
|
children: /* @__PURE__ */ e.jsx("div", { className: " iw-h-full iw-flex iw-flex-col", children: /* @__PURE__ */ e.jsx(
|
|
3282
|
-
|
|
3362
|
+
ri,
|
|
3283
3363
|
{
|
|
3284
|
-
interviewTitle:
|
|
3364
|
+
interviewTitle: i ?? "Interview",
|
|
3285
3365
|
interviewId: r,
|
|
3286
3366
|
className: n,
|
|
3287
|
-
onComplete:
|
|
3367
|
+
onComplete: t || (() => {
|
|
3288
3368
|
}),
|
|
3289
3369
|
onDisqualify: s
|
|
3290
3370
|
}
|
|
3291
3371
|
) })
|
|
3292
3372
|
}
|
|
3293
3373
|
) }) : /* @__PURE__ */ e.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ e.jsx(
|
|
3294
|
-
|
|
3374
|
+
gt,
|
|
3295
3375
|
{
|
|
3296
3376
|
isOpen: l,
|
|
3297
3377
|
onStart: () => {
|
|
3298
|
-
a(!0),
|
|
3378
|
+
a(!0), w(!1);
|
|
3299
3379
|
}
|
|
3300
3380
|
}
|
|
3301
3381
|
) });
|
|
3302
3382
|
};
|
|
3303
3383
|
typeof window < "u" && (window.InterviewWidget = {
|
|
3304
|
-
InterviewWidget:
|
|
3305
|
-
InterviewWidgetProvider:
|
|
3384
|
+
InterviewWidget: si,
|
|
3385
|
+
InterviewWidgetProvider: nt
|
|
3306
3386
|
});
|
|
3307
3387
|
export {
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3388
|
+
si as InterviewWidget,
|
|
3389
|
+
nt as InterviewWidgetProvider,
|
|
3390
|
+
si as default
|
|
3311
3391
|
};
|