interview-widget 1.0.4 → 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 F = (i, r, t) =>
|
|
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,8 +13,8 @@ var Ce = { 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
19
|
if (t !== void 0 && (s = "" + t), r.key !== void 0 && (s = "" + r.key), "key" in r) {
|
|
20
20
|
t = {};
|
|
@@ -22,18 +22,18 @@ function Se(i, r, t) {
|
|
|
22
22
|
n !== "key" && (t[n] = r[n]);
|
|
23
23
|
} else t = r;
|
|
24
24
|
return r = t.ref, {
|
|
25
|
-
$$typeof:
|
|
25
|
+
$$typeof: ze,
|
|
26
26
|
type: i,
|
|
27
27
|
key: s,
|
|
28
28
|
ref: r !== void 0 ? r : null,
|
|
29
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,40 +65,40 @@ const $ = {
|
|
|
65
65
|
enabled: !0
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
},
|
|
69
|
-
function
|
|
68
|
+
}, xe = "iw-storage";
|
|
69
|
+
function Ye() {
|
|
70
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
71
|
}
|
|
72
|
-
const
|
|
73
|
-
async function
|
|
72
|
+
const Re = Ye(), pe = "AES-GCM", fe = 12;
|
|
73
|
+
async function Ae(i) {
|
|
74
74
|
const t = new TextEncoder().encode(i), s = await crypto.subtle.digest("SHA-256", t);
|
|
75
|
-
return crypto.subtle.importKey("raw", s,
|
|
75
|
+
return crypto.subtle.importKey("raw", s, pe, !1, [
|
|
76
76
|
"encrypt",
|
|
77
77
|
"decrypt"
|
|
78
78
|
]);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
return crypto.getRandomValues(new Uint8Array(
|
|
80
|
+
function Qe() {
|
|
81
|
+
return crypto.getRandomValues(new Uint8Array(fe));
|
|
82
82
|
}
|
|
83
|
-
async function
|
|
83
|
+
async function Ke(i, r = "default-seed") {
|
|
84
84
|
try {
|
|
85
|
-
const t = typeof i == "string" ? i : JSON.stringify(i), n = new TextEncoder().encode(t), o = await
|
|
86
|
-
{ name:
|
|
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
87
|
o,
|
|
88
88
|
n
|
|
89
|
-
),
|
|
90
|
-
return
|
|
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
91
|
} catch (t) {
|
|
92
92
|
throw console.error("Encryption failed:", t), new Error("Failed to encrypt data");
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
async function
|
|
95
|
+
async function Je(i, r = "default-seed") {
|
|
96
96
|
try {
|
|
97
97
|
const t = atob(i), s = new Uint8Array(t.length);
|
|
98
|
-
for (let
|
|
99
|
-
s[
|
|
100
|
-
const n = s.slice(0,
|
|
101
|
-
{ name:
|
|
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
102
|
a,
|
|
103
103
|
o
|
|
104
104
|
);
|
|
@@ -107,23 +107,23 @@ async function Ye(i, r = "default-seed") {
|
|
|
107
107
|
throw console.error("Decryption failed:", t), new Error("Failed to decrypt data");
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
async function
|
|
111
|
-
return
|
|
110
|
+
async function Xe(i, r = "default-seed") {
|
|
111
|
+
return Ke(i, r);
|
|
112
112
|
}
|
|
113
|
-
async function
|
|
114
|
-
const t = await
|
|
113
|
+
async function Ze(i, r = "default-seed") {
|
|
114
|
+
const t = await Je(i, r);
|
|
115
115
|
try {
|
|
116
116
|
return JSON.parse(t);
|
|
117
117
|
} catch {
|
|
118
118
|
return t;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const oe = Te(null), et = async () => {
|
|
122
122
|
var i, r;
|
|
123
123
|
try {
|
|
124
|
-
const t = sessionStorage.getItem(
|
|
124
|
+
const t = sessionStorage.getItem(xe);
|
|
125
125
|
if (t) {
|
|
126
|
-
const s = await
|
|
126
|
+
const s = await Ze(t, Re);
|
|
127
127
|
return {
|
|
128
128
|
logViolations: ((i = s.state) == null ? void 0 : i.logViolations) || [],
|
|
129
129
|
totalViolations: ((r = s.state) == null ? void 0 : r.totalViolations) || 0
|
|
@@ -136,49 +136,49 @@ const ne = Ee(null), Je = async () => {
|
|
|
136
136
|
);
|
|
137
137
|
}
|
|
138
138
|
return { logViolations: [], totalViolations: 0 };
|
|
139
|
-
},
|
|
139
|
+
}, je = async (i) => {
|
|
140
140
|
try {
|
|
141
|
-
const r = await
|
|
141
|
+
const r = await Xe(
|
|
142
142
|
{
|
|
143
143
|
state: i,
|
|
144
144
|
version: 0
|
|
145
145
|
},
|
|
146
|
-
|
|
146
|
+
Re
|
|
147
147
|
);
|
|
148
|
-
sessionStorage.setItem(
|
|
148
|
+
sessionStorage.setItem(xe, r);
|
|
149
149
|
} catch (r) {
|
|
150
150
|
console.error("Failed to save proctoring data to session storage:", r);
|
|
151
151
|
}
|
|
152
|
-
},
|
|
152
|
+
}, tt = ({
|
|
153
153
|
children: i
|
|
154
154
|
}) => {
|
|
155
|
-
const r =
|
|
155
|
+
const r = E({
|
|
156
156
|
logViolations: [],
|
|
157
157
|
totalViolations: 0
|
|
158
|
-
}), t =
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
r.current =
|
|
158
|
+
}), t = E(/* @__PURE__ */ new Set());
|
|
159
|
+
ge.useEffect(() => {
|
|
160
|
+
et().then((d) => {
|
|
161
|
+
r.current = d, s();
|
|
162
162
|
});
|
|
163
163
|
}, []);
|
|
164
|
-
const s =
|
|
165
|
-
t.current.forEach((
|
|
166
|
-
}, []), n =
|
|
167
|
-
t.current.delete(
|
|
168
|
-
}), []), o =
|
|
169
|
-
(
|
|
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) => {
|
|
170
170
|
r.current = {
|
|
171
|
-
logViolations: [...r.current.logViolations,
|
|
171
|
+
logViolations: [...r.current.logViolations, d],
|
|
172
172
|
totalViolations: r.current.totalViolations + 1
|
|
173
|
-
},
|
|
173
|
+
}, je(r.current), s();
|
|
174
174
|
},
|
|
175
175
|
[s]
|
|
176
|
-
), l =
|
|
176
|
+
), l = T(() => {
|
|
177
177
|
r.current = {
|
|
178
178
|
logViolations: [],
|
|
179
179
|
totalViolations: 0
|
|
180
|
-
},
|
|
181
|
-
}, [s]),
|
|
180
|
+
}, je(r.current), s();
|
|
181
|
+
}, [s]), w = ee(
|
|
182
182
|
() => ({
|
|
183
183
|
getState: o,
|
|
184
184
|
addViolation: a,
|
|
@@ -187,29 +187,29 @@ const ne = Ee(null), Je = async () => {
|
|
|
187
187
|
}),
|
|
188
188
|
[o, a, l, n]
|
|
189
189
|
);
|
|
190
|
-
return /* @__PURE__ */ e.jsx(
|
|
191
|
-
},
|
|
192
|
-
const i =
|
|
190
|
+
return /* @__PURE__ */ e.jsx(oe.Provider, { value: w, children: i });
|
|
191
|
+
}, it = () => {
|
|
192
|
+
const i = ne(oe);
|
|
193
193
|
if (!i)
|
|
194
194
|
throw new Error("useViolations must be used within a ProctoringProvider");
|
|
195
|
-
return
|
|
195
|
+
return Ce(
|
|
196
196
|
i.subscribe,
|
|
197
197
|
() => i.getState().logViolations,
|
|
198
198
|
() => i.getState().logViolations
|
|
199
199
|
);
|
|
200
|
-
},
|
|
201
|
-
const i =
|
|
200
|
+
}, rt = () => {
|
|
201
|
+
const i = ne(oe);
|
|
202
202
|
if (!i)
|
|
203
203
|
throw new Error(
|
|
204
204
|
"useTotalViolations must be used within a ProctoringProvider"
|
|
205
205
|
);
|
|
206
|
-
return
|
|
206
|
+
return Ce(
|
|
207
207
|
i.subscribe,
|
|
208
208
|
() => i.getState().totalViolations,
|
|
209
209
|
() => i.getState().totalViolations
|
|
210
210
|
);
|
|
211
|
-
},
|
|
212
|
-
const i =
|
|
211
|
+
}, st = () => {
|
|
212
|
+
const i = ne(oe);
|
|
213
213
|
if (!i)
|
|
214
214
|
throw new Error(
|
|
215
215
|
"useProctoringActions must be used within a ProctoringProvider"
|
|
@@ -218,10 +218,10 @@ const ne = Ee(null), Je = async () => {
|
|
|
218
218
|
addViolation: i.addViolation,
|
|
219
219
|
clearViolations: i.clearViolations
|
|
220
220
|
};
|
|
221
|
-
},
|
|
221
|
+
}, Me = Te(
|
|
222
222
|
null
|
|
223
223
|
);
|
|
224
|
-
function
|
|
224
|
+
function nt({
|
|
225
225
|
config: i = {},
|
|
226
226
|
children: r
|
|
227
227
|
}) {
|
|
@@ -256,26 +256,26 @@ function it({
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
return /* @__PURE__ */ e.jsx(
|
|
259
|
+
return /* @__PURE__ */ e.jsx(Me.Provider, { value: t, children: /* @__PURE__ */ e.jsx(tt, { children: r }) });
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
const i =
|
|
261
|
+
function le() {
|
|
262
|
+
const i = ne(Me);
|
|
263
263
|
if (!i)
|
|
264
264
|
throw new Error(
|
|
265
265
|
"useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>"
|
|
266
266
|
);
|
|
267
267
|
return i;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
return
|
|
269
|
+
function De() {
|
|
270
|
+
return le().api || $.api;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
return
|
|
272
|
+
function te() {
|
|
273
|
+
return le().ui || $.ui;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
return
|
|
275
|
+
function at() {
|
|
276
|
+
return le().interview || $.interview;
|
|
277
277
|
}
|
|
278
|
-
const
|
|
278
|
+
const _e = ({
|
|
279
279
|
className: i,
|
|
280
280
|
...r
|
|
281
281
|
}) => /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(
|
|
@@ -304,7 +304,7 @@ const De = ({
|
|
|
304
304
|
/* @__PURE__ */ e.jsx("path", { d: "M7.75 7.75l-2.15 -2.15" })
|
|
305
305
|
]
|
|
306
306
|
}
|
|
307
|
-
) }),
|
|
307
|
+
) }), Pe = ({
|
|
308
308
|
children: i,
|
|
309
309
|
variant: r = "primary",
|
|
310
310
|
size: t = "md",
|
|
@@ -314,7 +314,7 @@ const De = ({
|
|
|
314
314
|
className: a = "",
|
|
315
315
|
...l
|
|
316
316
|
}) => {
|
|
317
|
-
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 = {
|
|
318
318
|
primary: "iw-bg-primary-600 iw-text-white iw-hover:bg-primary-700 iw-border iw-border-transparent",
|
|
319
319
|
secondary: "iw-bg-primary-100 iw-text-primary-700 iw-hover:bg-primary-200 iw-border iw-border-transparent",
|
|
320
320
|
outline: "iw-bg-transparent iw-text-primary-700 iw-border iw-border-primary-500 iw-hover:bg-primary-50",
|
|
@@ -328,17 +328,17 @@ const De = ({
|
|
|
328
328
|
return /* @__PURE__ */ e.jsxs(
|
|
329
329
|
"button",
|
|
330
330
|
{
|
|
331
|
-
className: `${
|
|
331
|
+
className: `${w} ${d[r]} ${u[t]} ${m} ${h} ${a}`,
|
|
332
332
|
disabled: o || n,
|
|
333
333
|
...l,
|
|
334
334
|
children: [
|
|
335
|
-
n && /* @__PURE__ */ e.jsx(
|
|
335
|
+
n && /* @__PURE__ */ e.jsx(_e, { height: 16, width: 16, style: { marginRight: "3px" } }),
|
|
336
336
|
i
|
|
337
337
|
]
|
|
338
338
|
}
|
|
339
339
|
);
|
|
340
340
|
};
|
|
341
|
-
function
|
|
341
|
+
function ot(i) {
|
|
342
342
|
const r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);
|
|
343
343
|
return r ? {
|
|
344
344
|
r: parseInt(r[1], 16),
|
|
@@ -346,32 +346,32 @@ function st(i) {
|
|
|
346
346
|
b: parseInt(r[3], 16)
|
|
347
347
|
} : null;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function lt(i, r, t) {
|
|
350
350
|
return "#" + [i, r, t].map((s) => {
|
|
351
351
|
const n = Math.round(s).toString(16);
|
|
352
352
|
return n.length === 1 ? "0" + n : n;
|
|
353
353
|
}).join("");
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
const t =
|
|
355
|
+
function Fe(i, r) {
|
|
356
|
+
const t = ot(i);
|
|
357
357
|
if (!t) return i;
|
|
358
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
|
|
359
|
+
return lt(s, n, o);
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function ct(i, r = 0.8) {
|
|
362
362
|
return {
|
|
363
|
-
background: `linear-gradient(to bottom, ${
|
|
363
|
+
background: `linear-gradient(to bottom, ${Fe(i, r)}, #ffffff)`,
|
|
364
364
|
color: "#1f2937"
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function dt(i) {
|
|
368
368
|
return new Promise((r) => setTimeout(r, i));
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
return `linear-gradient(to left, ${
|
|
370
|
+
function Le(i) {
|
|
371
|
+
return `linear-gradient(to left, ${Fe(i, 0.4)}, ${i})`;
|
|
372
372
|
}
|
|
373
|
-
const
|
|
374
|
-
function
|
|
373
|
+
const wt = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
374
|
+
function ut(i) {
|
|
375
375
|
try {
|
|
376
376
|
const r = i.split(".");
|
|
377
377
|
if (r.length !== 3 || !r[1])
|
|
@@ -385,7 +385,7 @@ function ct(i) {
|
|
|
385
385
|
return console.error("Error decoding JWT:", r), null;
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
const
|
|
388
|
+
const $e = (i) => /* @__PURE__ */ e.jsxs(
|
|
389
389
|
"svg",
|
|
390
390
|
{
|
|
391
391
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -403,7 +403,7 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
403
403
|
/* @__PURE__ */ e.jsx("path", { d: "m9 12 2 2 4-4" })
|
|
404
404
|
]
|
|
405
405
|
}
|
|
406
|
-
),
|
|
406
|
+
), Oe = (i) => /* @__PURE__ */ e.jsxs(
|
|
407
407
|
"svg",
|
|
408
408
|
{
|
|
409
409
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -422,7 +422,7 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
422
422
|
/* @__PURE__ */ e.jsx("line", { x1: "12", x2: "12", y1: "17", y2: "21" })
|
|
423
423
|
]
|
|
424
424
|
}
|
|
425
|
-
),
|
|
425
|
+
), ht = (i) => /* @__PURE__ */ e.jsxs(
|
|
426
426
|
"svg",
|
|
427
427
|
{
|
|
428
428
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -442,51 +442,51 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
442
442
|
]
|
|
443
443
|
}
|
|
444
444
|
), V = (i) => {
|
|
445
|
-
const { baseColor: r, borderRadius: t } =
|
|
445
|
+
const { baseColor: r, borderRadius: t } = te(), { loading: s, children: n, ...o } = i;
|
|
446
446
|
return /* @__PURE__ */ e.jsx(
|
|
447
|
-
|
|
447
|
+
Pe,
|
|
448
448
|
{
|
|
449
449
|
style: {
|
|
450
|
-
background:
|
|
450
|
+
background: Le(r),
|
|
451
451
|
borderRadius: t
|
|
452
452
|
},
|
|
453
453
|
...o,
|
|
454
|
-
children: s ? /* @__PURE__ */ e.jsx(
|
|
454
|
+
children: s ? /* @__PURE__ */ e.jsx(_e, {}) : n
|
|
455
455
|
}
|
|
456
456
|
);
|
|
457
|
-
},
|
|
457
|
+
}, mt = [
|
|
458
458
|
"Do not refresh or reload the page during your assessment",
|
|
459
459
|
"Refrain from switching tabs or opening other applications while the session is in progress",
|
|
460
460
|
"Ensure your face remains clearly visible on camera at all times",
|
|
461
461
|
"Avoid frequent distractions or leaving your seat during the session",
|
|
462
462
|
"Do not disable or interfere with audio/video monitoring"
|
|
463
|
-
],
|
|
463
|
+
], gt = ({
|
|
464
464
|
isOpen: i,
|
|
465
465
|
onStart: r,
|
|
466
466
|
onClose: t
|
|
467
467
|
}) => {
|
|
468
468
|
var A;
|
|
469
|
-
const s =
|
|
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 = [
|
|
470
470
|
`radial-gradient(120% 85% at 50% 125%, ${j(
|
|
471
|
-
|
|
471
|
+
c,
|
|
472
472
|
"34"
|
|
473
473
|
)} 0%, transparent 70%)`,
|
|
474
474
|
`radial-gradient(90% 70% at 10% 130%, ${j(
|
|
475
|
-
|
|
475
|
+
c,
|
|
476
476
|
"24"
|
|
477
477
|
)} 0%, transparent 72%)`,
|
|
478
478
|
`radial-gradient(90% 70% at 90% 130%, ${j(
|
|
479
|
-
|
|
479
|
+
c,
|
|
480
480
|
"24"
|
|
481
481
|
)} 0%, transparent 72%)`,
|
|
482
482
|
`repeating-linear-gradient(135deg, ${j(
|
|
483
|
-
|
|
483
|
+
c,
|
|
484
484
|
"14"
|
|
485
485
|
)} 0, ${j(
|
|
486
|
-
|
|
486
|
+
c,
|
|
487
487
|
"14"
|
|
488
488
|
)} 16px, transparent 16px, transparent 32px)`
|
|
489
|
-
].join(", "),
|
|
489
|
+
].join(", "), v = l ? {
|
|
490
490
|
label: "Camera & microphone ready",
|
|
491
491
|
toneClass: "iw-bg-white/15 iw-text-white",
|
|
492
492
|
dotClass: "iw-bg-emerald-400"
|
|
@@ -513,57 +513,57 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
513
513
|
toneClass: "iw-bg-rose-50 iw-text-rose-600",
|
|
514
514
|
cameraCopy: "Grant camera access to continue with the interview.",
|
|
515
515
|
micCopy: "Enable microphone access so we can capture your answers."
|
|
516
|
-
},
|
|
516
|
+
}, N = [
|
|
517
517
|
{
|
|
518
518
|
label: "Camera feed",
|
|
519
519
|
description: S.cameraCopy,
|
|
520
520
|
status: S.badge,
|
|
521
521
|
toneClass: S.toneClass,
|
|
522
|
-
Icon:
|
|
522
|
+
Icon: Oe
|
|
523
523
|
},
|
|
524
524
|
{
|
|
525
525
|
label: "Microphone input",
|
|
526
526
|
description: S.micCopy,
|
|
527
527
|
status: S.badge,
|
|
528
528
|
toneClass: S.toneClass,
|
|
529
|
-
Icon:
|
|
529
|
+
Icon: ht
|
|
530
530
|
}
|
|
531
|
-
],
|
|
532
|
-
n.current && (n.current.getTracks().forEach((
|
|
533
|
-
},
|
|
531
|
+
], _ = () => {
|
|
532
|
+
n.current && (n.current.getTracks().forEach((f) => f.stop()), n.current = null);
|
|
533
|
+
}, y = async () => {
|
|
534
534
|
m(!0), u(null);
|
|
535
535
|
try {
|
|
536
|
-
const
|
|
536
|
+
const f = await navigator.mediaDevices.getUserMedia({
|
|
537
537
|
video: { width: { ideal: 1280 }, height: { ideal: 720 } },
|
|
538
538
|
audio: !0
|
|
539
539
|
});
|
|
540
|
-
n.current =
|
|
541
|
-
} catch (
|
|
542
|
-
console.error("Media permission error:",
|
|
543
|
-
let
|
|
544
|
-
(
|
|
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);
|
|
545
545
|
} finally {
|
|
546
546
|
m(!1);
|
|
547
547
|
}
|
|
548
548
|
};
|
|
549
549
|
if (C(() => {
|
|
550
550
|
if (!i) {
|
|
551
|
-
|
|
551
|
+
_();
|
|
552
552
|
return;
|
|
553
553
|
}
|
|
554
|
-
return
|
|
555
|
-
|
|
554
|
+
return y(), () => {
|
|
555
|
+
_();
|
|
556
556
|
};
|
|
557
557
|
}, [i]), !i) return null;
|
|
558
|
-
const
|
|
559
|
-
r(),
|
|
558
|
+
const R = () => {
|
|
559
|
+
r(), _();
|
|
560
560
|
};
|
|
561
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: [
|
|
562
562
|
/* @__PURE__ */ e.jsxs(
|
|
563
563
|
"div",
|
|
564
564
|
{
|
|
565
565
|
className: "iw-relative iw-overflow-hidden",
|
|
566
|
-
style: { background:
|
|
566
|
+
style: { background: x },
|
|
567
567
|
children: [
|
|
568
568
|
/* @__PURE__ */ e.jsx(
|
|
569
569
|
"div",
|
|
@@ -597,7 +597,7 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
597
597
|
),
|
|
598
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: [
|
|
599
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: [
|
|
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(
|
|
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" }) }),
|
|
601
601
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
602
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" }),
|
|
603
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" }),
|
|
@@ -607,15 +607,15 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
607
607
|
/* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-items-start iw-justify-end", children: /* @__PURE__ */ e.jsxs(
|
|
608
608
|
"div",
|
|
609
609
|
{
|
|
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 ${
|
|
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}`,
|
|
611
611
|
children: [
|
|
612
612
|
/* @__PURE__ */ e.jsx(
|
|
613
613
|
"span",
|
|
614
614
|
{
|
|
615
|
-
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}`
|
|
616
616
|
}
|
|
617
617
|
),
|
|
618
|
-
|
|
618
|
+
v.label
|
|
619
619
|
]
|
|
620
620
|
}
|
|
621
621
|
) }),
|
|
@@ -625,7 +625,7 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
625
625
|
"aria-label": "Close",
|
|
626
626
|
className: "iw-absolute iw-top-5 iw-right-5 iw-text-white/70 transition-colors hover:iw-text-white",
|
|
627
627
|
onClick: () => {
|
|
628
|
-
|
|
628
|
+
_(), t == null || t();
|
|
629
629
|
},
|
|
630
630
|
children: "✕"
|
|
631
631
|
}
|
|
@@ -641,7 +641,7 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
641
641
|
/* @__PURE__ */ e.jsx("h3", { className: "iw-text-sm iw-font-semibold iw-text-slate-900", children: "Proctoring guidelines" }),
|
|
642
642
|
/* @__PURE__ */ e.jsx("span", { className: "iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-slate-400", children: "Required" })
|
|
643
643
|
] }),
|
|
644
|
-
/* @__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(
|
|
645
645
|
"li",
|
|
646
646
|
{
|
|
647
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",
|
|
@@ -650,14 +650,14 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
650
650
|
"span",
|
|
651
651
|
{
|
|
652
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",
|
|
653
|
-
style: { background:
|
|
654
|
-
children:
|
|
653
|
+
style: { background: x },
|
|
654
|
+
children: M + 1
|
|
655
655
|
}
|
|
656
656
|
),
|
|
657
|
-
/* @__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 })
|
|
658
658
|
] })
|
|
659
659
|
},
|
|
660
|
-
|
|
660
|
+
f
|
|
661
661
|
)) })
|
|
662
662
|
] }) }),
|
|
663
663
|
/* @__PURE__ */ e.jsxs("section", { className: "iw-flex iw-flex-col iw-gap-5", children: [
|
|
@@ -665,7 +665,7 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
665
665
|
"div",
|
|
666
666
|
{
|
|
667
667
|
className: "iw-relative iw-flex iw-flex-col iw-gap-6 iw-overflow-hidden iw-rounded-3xl iw-bg-white ",
|
|
668
|
-
style: { borderRadius:
|
|
668
|
+
style: { borderRadius: b },
|
|
669
669
|
children: [
|
|
670
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(
|
|
671
671
|
"video",
|
|
@@ -677,23 +677,23 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
677
677
|
className: "iw-h-64 iw-w-full iw-rounded-2xl iw-object-cover",
|
|
678
678
|
style: {
|
|
679
679
|
transform: "scaleX(-1)",
|
|
680
|
-
borderRadius:
|
|
680
|
+
borderRadius: b
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
) }),
|
|
684
684
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-relative iw-grid iw-grid-cols-2 iw-gap-4 iw-px-1", children: [
|
|
685
685
|
/* @__PURE__ */ e.jsx(
|
|
686
|
-
|
|
686
|
+
Pe,
|
|
687
687
|
{
|
|
688
|
-
onClick:
|
|
688
|
+
onClick: y,
|
|
689
689
|
disabled: h,
|
|
690
690
|
variant: "outline",
|
|
691
691
|
size: "sm",
|
|
692
692
|
className: "iw-font-medium",
|
|
693
693
|
style: {
|
|
694
|
-
borderColor:
|
|
695
|
-
borderRadius:
|
|
696
|
-
color:
|
|
694
|
+
borderColor: c,
|
|
695
|
+
borderRadius: b,
|
|
696
|
+
color: c
|
|
697
697
|
},
|
|
698
698
|
children: l ? "Recheck permissions" : "Enable camera & mic"
|
|
699
699
|
}
|
|
@@ -701,11 +701,11 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
701
701
|
/* @__PURE__ */ e.jsx(
|
|
702
702
|
V,
|
|
703
703
|
{
|
|
704
|
-
onClick:
|
|
704
|
+
onClick: R,
|
|
705
705
|
disabled: !l,
|
|
706
706
|
className: "iw-h-10 iw-px-6 iw-text-sm",
|
|
707
707
|
style: {
|
|
708
|
-
backgroundColor:
|
|
708
|
+
backgroundColor: c
|
|
709
709
|
},
|
|
710
710
|
children: "Proceed"
|
|
711
711
|
}
|
|
@@ -714,21 +714,21 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
714
714
|
]
|
|
715
715
|
}
|
|
716
716
|
),
|
|
717
|
-
/* @__PURE__ */ e.jsx("ul", { className: "iw-grid sm:iw-grid-cols-1 iw-gap-3", children:
|
|
718
|
-
({ 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(
|
|
719
719
|
"li",
|
|
720
720
|
{
|
|
721
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",
|
|
722
722
|
children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-start iw-gap-3", children: [
|
|
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(
|
|
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" }) }),
|
|
724
724
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex-1", children: [
|
|
725
725
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-between iw-gap-3", children: [
|
|
726
|
-
/* @__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 }),
|
|
727
727
|
/* @__PURE__ */ e.jsx(
|
|
728
728
|
"span",
|
|
729
729
|
{
|
|
730
730
|
className: `iw-rounded-full iw-px-3 iw-py-1 iw-text-[11px] iw-font-semibold ${q}`,
|
|
731
|
-
children:
|
|
731
|
+
children: O
|
|
732
732
|
}
|
|
733
733
|
)
|
|
734
734
|
] }),
|
|
@@ -736,10 +736,10 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
736
736
|
] })
|
|
737
737
|
] })
|
|
738
738
|
},
|
|
739
|
-
|
|
739
|
+
M
|
|
740
740
|
)
|
|
741
741
|
) }),
|
|
742
|
-
|
|
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
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." })
|
|
744
744
|
] })
|
|
745
745
|
] }),
|
|
@@ -750,7 +750,7 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
750
750
|
"aria-hidden": !0,
|
|
751
751
|
className: "iw-pointer-events-none iw-absolute iw-inset-x-0 iw-bottom-1 iw-h-20",
|
|
752
752
|
style: {
|
|
753
|
-
backgroundImage:
|
|
753
|
+
backgroundImage: g,
|
|
754
754
|
backgroundSize: "100% 120%, 100% 120%, 100% 120%, 32px 32px",
|
|
755
755
|
backgroundPosition: "center bottom, left 95% bottom, right 95% bottom, center bottom",
|
|
756
756
|
backgroundRepeat: "no-repeat, no-repeat, no-repeat, repeat",
|
|
@@ -764,12 +764,12 @@ const Le = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
764
764
|
] })
|
|
765
765
|
] }) });
|
|
766
766
|
};
|
|
767
|
-
var
|
|
768
|
-
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 = {
|
|
769
769
|
thinkingDuration: 30,
|
|
770
770
|
answeringDuration: 120,
|
|
771
771
|
editingDuration: 30
|
|
772
|
-
},
|
|
772
|
+
}, xt = {
|
|
773
773
|
idle: {
|
|
774
774
|
next: "fetching_question"
|
|
775
775
|
/* FETCHING_QUESTION */
|
|
@@ -798,14 +798,14 @@ const ht = {
|
|
|
798
798
|
/* COMPLETED */
|
|
799
799
|
}
|
|
800
800
|
};
|
|
801
|
-
class
|
|
801
|
+
class pt {
|
|
802
802
|
constructor(r = {}, t = {}) {
|
|
803
803
|
F(this, "config");
|
|
804
804
|
F(this, "state");
|
|
805
805
|
F(this, "phaseIntervalId", null);
|
|
806
806
|
F(this, "globalIntervalId", null);
|
|
807
807
|
F(this, "callbacks");
|
|
808
|
-
this.config = { ...
|
|
808
|
+
this.config = { ...ft, ...r }, this.callbacks = t, this.state = {
|
|
809
809
|
phase: "idle",
|
|
810
810
|
currentPhaseTimeRemaining: 0,
|
|
811
811
|
totalTimeElapsed: 0,
|
|
@@ -828,7 +828,7 @@ class gt {
|
|
|
828
828
|
* Move to next phase
|
|
829
829
|
*/
|
|
830
830
|
nextPhase() {
|
|
831
|
-
const r = this.state.phase, t =
|
|
831
|
+
const r = this.state.phase, t = xt[r];
|
|
832
832
|
if (!t) return;
|
|
833
833
|
this.stopPhaseTimer(), this.state.phase = t.next;
|
|
834
834
|
const s = this.getDurationForPhase(t.next);
|
|
@@ -899,21 +899,21 @@ class gt {
|
|
|
899
899
|
(t = (r = this.callbacks).onPhaseChange) == null || t.call(r, this.state.phase, this.getState());
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
function
|
|
903
|
-
const { config: r = {}, callbacks: t = {} } = i, s =
|
|
904
|
-
s.current || (s.current = new
|
|
905
|
-
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(() => {
|
|
906
906
|
a(n.getState());
|
|
907
907
|
}, [n]);
|
|
908
908
|
C(() => {
|
|
909
909
|
const h = {
|
|
910
|
-
onPhaseChange: (m,
|
|
911
|
-
var
|
|
912
|
-
l(), (
|
|
910
|
+
onPhaseChange: (m, c) => {
|
|
911
|
+
var x;
|
|
912
|
+
l(), (x = t.onPhaseChange) == null || x.call(t, m, c);
|
|
913
913
|
},
|
|
914
914
|
onTick: (m) => {
|
|
915
|
-
var
|
|
916
|
-
l(), (
|
|
915
|
+
var c;
|
|
916
|
+
l(), (c = t.onTick) == null || c.call(t, m);
|
|
917
917
|
},
|
|
918
918
|
onInterviewEnd: () => {
|
|
919
919
|
var m;
|
|
@@ -924,29 +924,29 @@ function ft(i = {}) {
|
|
|
924
924
|
}, [n, t, l]), C(() => () => {
|
|
925
925
|
n.destroy();
|
|
926
926
|
}, [n]);
|
|
927
|
-
const
|
|
927
|
+
const w = T(() => {
|
|
928
928
|
n.startQuestion(), l();
|
|
929
|
-
}, [n, l]),
|
|
929
|
+
}, [n, l]), d = T(() => {
|
|
930
930
|
n.nextPhase(), l();
|
|
931
|
-
}, [n, l]), u =
|
|
931
|
+
}, [n, l]), u = T(() => {
|
|
932
932
|
n.completeInterview(), l();
|
|
933
933
|
}, [n, l]);
|
|
934
934
|
return {
|
|
935
935
|
state: o,
|
|
936
|
-
startQuestion:
|
|
937
|
-
nextPhase:
|
|
936
|
+
startQuestion: w,
|
|
937
|
+
nextPhase: d,
|
|
938
938
|
completeInterview: u,
|
|
939
939
|
timerService: n
|
|
940
940
|
};
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function yt(i, r = {}) {
|
|
943
943
|
const [t, s] = k({
|
|
944
944
|
data: null,
|
|
945
945
|
loading: !1,
|
|
946
946
|
error: null
|
|
947
|
-
}), n =
|
|
947
|
+
}), n = T(
|
|
948
948
|
async (...o) => {
|
|
949
|
-
var a, l,
|
|
949
|
+
var a, l, w, d;
|
|
950
950
|
s((u) => ({ ...u, loading: !0, error: null }));
|
|
951
951
|
try {
|
|
952
952
|
const u = await i(...o);
|
|
@@ -968,7 +968,7 @@ function xt(i, r = {}) {
|
|
|
968
968
|
...m,
|
|
969
969
|
loading: !1,
|
|
970
970
|
error: h
|
|
971
|
-
})), (
|
|
971
|
+
})), (w = r.onError) == null || w.call(r, h), (d = r.onSettled) == null || d.call(r, null, h);
|
|
972
972
|
}
|
|
973
973
|
},
|
|
974
974
|
[i, r]
|
|
@@ -978,67 +978,67 @@ function xt(i, r = {}) {
|
|
|
978
978
|
execute: n
|
|
979
979
|
};
|
|
980
980
|
}
|
|
981
|
-
const
|
|
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,
|
|
983
|
-
var
|
|
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) => {
|
|
983
|
+
var x;
|
|
984
984
|
try {
|
|
985
985
|
if (!a())
|
|
986
986
|
throw new Error("Fullscreen is not supported in this environment");
|
|
987
|
-
|
|
988
|
-
} catch (
|
|
987
|
+
c.requestFullscreen ? await c.requestFullscreen() : c.webkitRequestFullscreen ? await c.webkitRequestFullscreen() : c.mozRequestFullScreen ? await c.mozRequestFullScreen() : c.msRequestFullscreen && await c.msRequestFullscreen();
|
|
988
|
+
} catch (b) {
|
|
989
989
|
const j = {
|
|
990
990
|
name: "FullscreenError",
|
|
991
|
-
message:
|
|
991
|
+
message: b instanceof Error ? b.message : "Failed to enter fullscreen"
|
|
992
992
|
};
|
|
993
|
-
t(j), (
|
|
993
|
+
t(j), (x = i == null ? void 0 : i.onError) == null || x.call(i, j);
|
|
994
994
|
}
|
|
995
|
-
},
|
|
996
|
-
var
|
|
995
|
+
}, d = async () => {
|
|
996
|
+
var c;
|
|
997
997
|
try {
|
|
998
998
|
o.exitFullscreen ? await o.exitFullscreen() : o.webkitExitFullscreen ? await o.webkitExitFullscreen() : o.mozCancelFullScreen ? await o.mozCancelFullScreen() : o.msExitFullscreen && await o.msExitFullscreen();
|
|
999
|
-
} catch (
|
|
1000
|
-
const
|
|
999
|
+
} catch (x) {
|
|
1000
|
+
const b = {
|
|
1001
1001
|
name: "FullscreenError",
|
|
1002
|
-
message:
|
|
1002
|
+
message: x instanceof Error ? x.message : "Failed to exit fullscreen"
|
|
1003
1003
|
};
|
|
1004
|
-
t(
|
|
1004
|
+
t(b), (c = i == null ? void 0 : i.onError) == null || c.call(i, b);
|
|
1005
1005
|
}
|
|
1006
|
-
}, u =
|
|
1007
|
-
var
|
|
1008
|
-
const
|
|
1009
|
-
n(
|
|
1006
|
+
}, u = T(() => {
|
|
1007
|
+
var x;
|
|
1008
|
+
const c = !!l();
|
|
1009
|
+
n(c), (x = i == null ? void 0 : i.onFullScreenChange) == null || x.call(i, c);
|
|
1010
1010
|
}, [i]);
|
|
1011
1011
|
C(() => {
|
|
1012
|
-
const
|
|
1012
|
+
const c = [
|
|
1013
1013
|
"fullscreenchange",
|
|
1014
1014
|
"webkitfullscreenchange",
|
|
1015
1015
|
"mozfullscreenchange",
|
|
1016
1016
|
"MSFullscreenChange"
|
|
1017
1017
|
];
|
|
1018
|
-
return
|
|
1019
|
-
document.addEventListener(
|
|
1018
|
+
return c.forEach((x) => {
|
|
1019
|
+
document.addEventListener(x, u);
|
|
1020
1020
|
}), () => {
|
|
1021
|
-
|
|
1022
|
-
document.removeEventListener(
|
|
1021
|
+
c.forEach((x) => {
|
|
1022
|
+
document.removeEventListener(x, u);
|
|
1023
1023
|
});
|
|
1024
1024
|
};
|
|
1025
1025
|
}, [u]);
|
|
1026
|
-
const h = async (
|
|
1026
|
+
const h = async (c) => {
|
|
1027
1027
|
t(null);
|
|
1028
|
-
const
|
|
1029
|
-
await
|
|
1028
|
+
const x = c ?? document.documentElement;
|
|
1029
|
+
await w(x);
|
|
1030
1030
|
};
|
|
1031
1031
|
return {
|
|
1032
1032
|
isFullScreen: s,
|
|
1033
|
-
toggleFullScreen: async (
|
|
1034
|
-
s ? await
|
|
1033
|
+
toggleFullScreen: async (c) => {
|
|
1034
|
+
s ? await d() : await h(c);
|
|
1035
1035
|
},
|
|
1036
1036
|
enterFullScreen: h,
|
|
1037
|
-
exitFullScreen:
|
|
1037
|
+
exitFullScreen: d,
|
|
1038
1038
|
error: r
|
|
1039
1039
|
};
|
|
1040
1040
|
};
|
|
1041
|
-
function
|
|
1041
|
+
function jt(i) {
|
|
1042
1042
|
var r;
|
|
1043
1043
|
if (!navigator.onLine)
|
|
1044
1044
|
return {
|
|
@@ -1097,7 +1097,7 @@ function bt(i) {
|
|
|
1097
1097
|
originalError: i
|
|
1098
1098
|
};
|
|
1099
1099
|
}
|
|
1100
|
-
async function
|
|
1100
|
+
async function be(i, r = {}, t = {
|
|
1101
1101
|
attempts: 3,
|
|
1102
1102
|
backoff: "exponential",
|
|
1103
1103
|
baseDelay: 1e3,
|
|
@@ -1118,22 +1118,22 @@ async function xe(i, r = {}, t = {
|
|
|
1118
1118
|
return l;
|
|
1119
1119
|
} catch (o) {
|
|
1120
1120
|
s = o;
|
|
1121
|
-
const a =
|
|
1121
|
+
const a = jt(o);
|
|
1122
1122
|
if (!a.retryable || n === t.attempts)
|
|
1123
1123
|
throw a;
|
|
1124
|
-
const l =
|
|
1124
|
+
const l = Nt(n, t);
|
|
1125
1125
|
console.warn(
|
|
1126
1126
|
`API request failed (attempt ${n}/${t.attempts}), retrying in ${l}ms:`,
|
|
1127
1127
|
a.message
|
|
1128
|
-
), await new Promise((
|
|
1128
|
+
), await new Promise((w) => setTimeout(w, l));
|
|
1129
1129
|
}
|
|
1130
1130
|
throw s;
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1132
|
+
function Nt(i, r) {
|
|
1133
1133
|
let t;
|
|
1134
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);
|
|
1135
1135
|
}
|
|
1136
|
-
class
|
|
1136
|
+
class kt {
|
|
1137
1137
|
constructor(r = {}) {
|
|
1138
1138
|
F(this, "config");
|
|
1139
1139
|
this.config = r;
|
|
@@ -1172,7 +1172,7 @@ class vt {
|
|
|
1172
1172
|
answer: o,
|
|
1173
1173
|
answerDuration: a
|
|
1174
1174
|
}) {
|
|
1175
|
-
const l = await
|
|
1175
|
+
const l = await be(
|
|
1176
1176
|
`${this.getBaseUrl()}/questions/next`,
|
|
1177
1177
|
{
|
|
1178
1178
|
method: "POST",
|
|
@@ -1193,14 +1193,14 @@ class vt {
|
|
|
1193
1193
|
return await l.json();
|
|
1194
1194
|
}
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1197
|
-
const i =
|
|
1198
|
-
return
|
|
1196
|
+
function Et() {
|
|
1197
|
+
const i = le();
|
|
1198
|
+
return ee(() => {
|
|
1199
1199
|
const t = i.api || {};
|
|
1200
|
-
return new
|
|
1200
|
+
return new kt(t);
|
|
1201
1201
|
}, [i.api]);
|
|
1202
1202
|
}
|
|
1203
|
-
const
|
|
1203
|
+
const Tt = (i) => {
|
|
1204
1204
|
C(() => {
|
|
1205
1205
|
const r = (s) => {
|
|
1206
1206
|
(s.ctrlKey || s.metaKey) && ["c", "v", "a", "t", "n", "w", "r", "s", "p"].includes(s.key.toLowerCase()) && (s.preventDefault(), i({
|
|
@@ -1240,12 +1240,12 @@ const Nt = (i) => {
|
|
|
1240
1240
|
};
|
|
1241
1241
|
}, [i]);
|
|
1242
1242
|
};
|
|
1243
|
-
class
|
|
1243
|
+
class I extends Error {
|
|
1244
1244
|
constructor(r, t, s = !1) {
|
|
1245
1245
|
super(r), this.code = t, this.recoverable = s, this.name = "STTError";
|
|
1246
1246
|
}
|
|
1247
1247
|
}
|
|
1248
|
-
class
|
|
1248
|
+
class Ct {
|
|
1249
1249
|
constructor(r = {}) {
|
|
1250
1250
|
F(this, "config");
|
|
1251
1251
|
F(this, "mediaRecorder", null);
|
|
@@ -1280,13 +1280,13 @@ class kt {
|
|
|
1280
1280
|
async startRecording(r, t) {
|
|
1281
1281
|
var s;
|
|
1282
1282
|
if (!this.isRecordingSupported())
|
|
1283
|
-
throw new
|
|
1283
|
+
throw new I(
|
|
1284
1284
|
"Audio recording is not supported in this browser",
|
|
1285
1285
|
"RECORDING_NOT_SUPPORTED",
|
|
1286
1286
|
!1
|
|
1287
1287
|
);
|
|
1288
1288
|
if (this.isRecording())
|
|
1289
|
-
throw new
|
|
1289
|
+
throw new I(
|
|
1290
1290
|
"Recording is already in progress",
|
|
1291
1291
|
"ALREADY_RECORDING",
|
|
1292
1292
|
!0
|
|
@@ -1310,7 +1310,7 @@ class kt {
|
|
|
1310
1310
|
(o = t == null ? void 0 : t.onStop) == null || o.call(t);
|
|
1311
1311
|
}, this.mediaRecorder.onerror = (o) => {
|
|
1312
1312
|
var l;
|
|
1313
|
-
const a = new
|
|
1313
|
+
const a = new I(
|
|
1314
1314
|
`Recording failed: ${o.error}`,
|
|
1315
1315
|
"RECORDING_ERROR",
|
|
1316
1316
|
!0
|
|
@@ -1322,15 +1322,15 @@ class kt {
|
|
|
1322
1322
|
} catch (n) {
|
|
1323
1323
|
if (this.cleanup(), n instanceof Error) {
|
|
1324
1324
|
if (n.name === "NotAllowedError" || n.name === "PermissionDeniedError")
|
|
1325
|
-
throw new
|
|
1325
|
+
throw new I(
|
|
1326
1326
|
"Microphone permission was denied",
|
|
1327
1327
|
"PERMISSION_DENIED",
|
|
1328
1328
|
!1
|
|
1329
1329
|
);
|
|
1330
1330
|
if (n.name === "NotFoundError")
|
|
1331
|
-
throw new
|
|
1331
|
+
throw new I("No microphone found", "NO_MICROPHONE", !1);
|
|
1332
1332
|
}
|
|
1333
|
-
throw new
|
|
1333
|
+
throw new I(
|
|
1334
1334
|
`Failed to start recording: ${n instanceof Error ? n.message : String(n)}`,
|
|
1335
1335
|
"START_RECORDING_FAILED",
|
|
1336
1336
|
!0
|
|
@@ -1342,7 +1342,7 @@ class kt {
|
|
|
1342
1342
|
*/
|
|
1343
1343
|
async stopRecording() {
|
|
1344
1344
|
if (this.autoStopTimeoutId && (clearTimeout(this.autoStopTimeoutId), this.autoStopTimeoutId = null), !this.mediaRecorder || !this.isRecording())
|
|
1345
|
-
throw new
|
|
1345
|
+
throw new I(
|
|
1346
1346
|
"No active recording to stop",
|
|
1347
1347
|
"NO_ACTIVE_RECORDING",
|
|
1348
1348
|
!1
|
|
@@ -1350,7 +1350,7 @@ class kt {
|
|
|
1350
1350
|
return new Promise((r, t) => {
|
|
1351
1351
|
if (!this.mediaRecorder) {
|
|
1352
1352
|
t(
|
|
1353
|
-
new
|
|
1353
|
+
new I("MediaRecorder is null", "MEDIARECORDER_NULL", !1)
|
|
1354
1354
|
);
|
|
1355
1355
|
return;
|
|
1356
1356
|
}
|
|
@@ -1360,7 +1360,7 @@ class kt {
|
|
|
1360
1360
|
this.cleanup(), r(a);
|
|
1361
1361
|
} catch (o) {
|
|
1362
1362
|
t(
|
|
1363
|
-
new
|
|
1363
|
+
new I(
|
|
1364
1364
|
`Failed to create audio blob: ${o instanceof Error ? o.message : String(o)}`,
|
|
1365
1365
|
"BLOB_CREATION_FAILED",
|
|
1366
1366
|
!1
|
|
@@ -1383,17 +1383,17 @@ class kt {
|
|
|
1383
1383
|
temperature: a = this.config.temperature
|
|
1384
1384
|
} = r;
|
|
1385
1385
|
if (!t || t.size === 0)
|
|
1386
|
-
throw new
|
|
1386
|
+
throw new I(
|
|
1387
1387
|
"Audio blob is empty or invalid",
|
|
1388
1388
|
"INVALID_AUDIO",
|
|
1389
1389
|
!1
|
|
1390
1390
|
);
|
|
1391
1391
|
try {
|
|
1392
|
-
const l = new FormData(),
|
|
1392
|
+
const l = new FormData(), w = new File([t], "recording.wav", {
|
|
1393
1393
|
type: t.type || "audio/wav"
|
|
1394
1394
|
});
|
|
1395
|
-
l.append("file",
|
|
1396
|
-
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(
|
|
1397
1397
|
`${this.config.baseUrl}/speech/transcribe`,
|
|
1398
1398
|
{
|
|
1399
1399
|
method: "POST",
|
|
@@ -1414,26 +1414,26 @@ class kt {
|
|
|
1414
1414
|
jitter: !0
|
|
1415
1415
|
}
|
|
1416
1416
|
);
|
|
1417
|
-
if (!
|
|
1418
|
-
const h = await
|
|
1419
|
-
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}`;
|
|
1420
1420
|
try {
|
|
1421
|
-
const
|
|
1422
|
-
m =
|
|
1421
|
+
const c = JSON.parse(h);
|
|
1422
|
+
m = c.message || c.error || m;
|
|
1423
1423
|
} catch {
|
|
1424
1424
|
m = h || m;
|
|
1425
1425
|
}
|
|
1426
|
-
throw new
|
|
1426
|
+
throw new I(
|
|
1427
1427
|
m,
|
|
1428
|
-
`HTTP_${
|
|
1429
|
-
|
|
1428
|
+
`HTTP_${d.status}`,
|
|
1429
|
+
d.status >= 500
|
|
1430
1430
|
);
|
|
1431
1431
|
}
|
|
1432
1432
|
return {
|
|
1433
|
-
transcript: (await
|
|
1433
|
+
transcript: (await d.json()).data.text ?? ""
|
|
1434
1434
|
};
|
|
1435
1435
|
} catch (l) {
|
|
1436
|
-
throw l instanceof
|
|
1436
|
+
throw l instanceof I ? l : new I(
|
|
1437
1437
|
`Transcription failed: ${l instanceof Error ? l.message : String(l)}`,
|
|
1438
1438
|
"TRANSCRIPTION_FAILED",
|
|
1439
1439
|
!0
|
|
@@ -1475,84 +1475,84 @@ class kt {
|
|
|
1475
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);
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
|
-
const
|
|
1479
|
-
const [r, t] = k(!1), [s, n] = k(!1), [o, a] = k(null), [l,
|
|
1480
|
-
i.config &&
|
|
1481
|
-
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) => {
|
|
1482
1482
|
var j;
|
|
1483
1483
|
try {
|
|
1484
|
-
|
|
1484
|
+
w(null), a(null), u(null), await Z.startRecording(b, {
|
|
1485
1485
|
onStart: () => {
|
|
1486
|
-
var
|
|
1487
|
-
t(!0), (
|
|
1486
|
+
var g;
|
|
1487
|
+
t(!0), (g = i.onStart) == null || g.call(i);
|
|
1488
1488
|
},
|
|
1489
1489
|
onStop: () => {
|
|
1490
|
-
var
|
|
1491
|
-
t(!1), (
|
|
1490
|
+
var g;
|
|
1491
|
+
t(!1), (g = i.onStop) == null || g.call(i);
|
|
1492
1492
|
},
|
|
1493
|
-
onError: (
|
|
1493
|
+
onError: (g) => {
|
|
1494
1494
|
var S;
|
|
1495
|
-
const
|
|
1496
|
-
|
|
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);
|
|
1497
1497
|
}
|
|
1498
1498
|
});
|
|
1499
|
-
} catch (
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1499
|
+
} catch (g) {
|
|
1500
|
+
const v = g instanceof I ? g : new I(
|
|
1501
|
+
g instanceof Error ? g.message : String(g),
|
|
1502
1502
|
"START_FAILED",
|
|
1503
1503
|
!1
|
|
1504
1504
|
);
|
|
1505
|
-
throw
|
|
1505
|
+
throw w(v), t(!1), (j = i.onError) == null || j.call(i, v), v;
|
|
1506
1506
|
}
|
|
1507
|
-
}, []), m =
|
|
1508
|
-
var
|
|
1507
|
+
}, []), m = T(async () => {
|
|
1508
|
+
var b, j;
|
|
1509
1509
|
try {
|
|
1510
|
-
const
|
|
1511
|
-
return u(
|
|
1512
|
-
} catch (
|
|
1513
|
-
const
|
|
1514
|
-
|
|
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),
|
|
1515
1515
|
"STOP_FAILED",
|
|
1516
1516
|
!1
|
|
1517
1517
|
);
|
|
1518
|
-
throw
|
|
1518
|
+
throw w(v), t(!1), (j = i.onError) == null || j.call(i, v), v;
|
|
1519
1519
|
}
|
|
1520
|
-
}, []),
|
|
1521
|
-
async (
|
|
1522
|
-
var
|
|
1520
|
+
}, []), c = T(
|
|
1521
|
+
async (b, j = {}) => {
|
|
1522
|
+
var g, v;
|
|
1523
1523
|
try {
|
|
1524
|
-
|
|
1524
|
+
w(null), n(!0);
|
|
1525
1525
|
const S = {
|
|
1526
|
-
audioBlob:
|
|
1526
|
+
audioBlob: b,
|
|
1527
1527
|
...j
|
|
1528
|
-
},
|
|
1529
|
-
return a(
|
|
1528
|
+
}, N = await Z.transcribe(S);
|
|
1529
|
+
return a(N.transcript), n(!1), (g = i.onTranscriptionComplete) == null || g.call(i, N), N;
|
|
1530
1530
|
} catch (S) {
|
|
1531
|
-
const
|
|
1531
|
+
const N = S instanceof I ? S : new I(
|
|
1532
1532
|
S instanceof Error ? S.message : String(S),
|
|
1533
1533
|
"TRANSCRIPTION_FAILED",
|
|
1534
1534
|
!0
|
|
1535
1535
|
);
|
|
1536
|
-
throw
|
|
1536
|
+
throw w(N), n(!1), (v = i.onError) == null || v.call(i, N), N;
|
|
1537
1537
|
}
|
|
1538
1538
|
},
|
|
1539
1539
|
[]
|
|
1540
|
-
),
|
|
1541
|
-
|
|
1540
|
+
), x = T(() => {
|
|
1541
|
+
Z.cancelRecording(), t(!1), u(null);
|
|
1542
1542
|
}, []);
|
|
1543
1543
|
return {
|
|
1544
1544
|
startRecording: h,
|
|
1545
1545
|
stopRecording: m,
|
|
1546
|
-
transcribe:
|
|
1547
|
-
cancelRecording:
|
|
1546
|
+
transcribe: c,
|
|
1547
|
+
cancelRecording: x,
|
|
1548
1548
|
isRecording: r,
|
|
1549
1549
|
isTranscribing: s,
|
|
1550
1550
|
transcript: o,
|
|
1551
1551
|
error: l,
|
|
1552
|
-
audioBlob:
|
|
1552
|
+
audioBlob: d
|
|
1553
1553
|
};
|
|
1554
|
-
},
|
|
1555
|
-
const r =
|
|
1554
|
+
}, It = (i) => {
|
|
1555
|
+
const r = E(null), t = E(!1);
|
|
1556
1556
|
C(() => {
|
|
1557
1557
|
const s = () => {
|
|
1558
1558
|
document.hidden && (t.current = !0, r.current && (clearTimeout(r.current), r.current = null), i({
|
|
@@ -1581,7 +1581,7 @@ const J = new kt(), Et = (i = {}) => {
|
|
|
1581
1581
|
document.removeEventListener("visibilitychange", s), window.removeEventListener("blur", n), r.current && clearTimeout(r.current);
|
|
1582
1582
|
};
|
|
1583
1583
|
}, [i]);
|
|
1584
|
-
},
|
|
1584
|
+
}, Rt = () => {
|
|
1585
1585
|
C(() => {
|
|
1586
1586
|
const i = document.createElement("style");
|
|
1587
1587
|
return i.textContent = `
|
|
@@ -1602,7 +1602,7 @@ const J = new kt(), Et = (i = {}) => {
|
|
|
1602
1602
|
};
|
|
1603
1603
|
}, []);
|
|
1604
1604
|
};
|
|
1605
|
-
class
|
|
1605
|
+
class At {
|
|
1606
1606
|
constructor(r = {}) {
|
|
1607
1607
|
F(this, "config");
|
|
1608
1608
|
F(this, "currentAudio", null);
|
|
@@ -1630,7 +1630,7 @@ class St {
|
|
|
1630
1630
|
speed: n = this.config.speed
|
|
1631
1631
|
} = r, o = new URLSearchParams();
|
|
1632
1632
|
o.append("text", t), o.append("voice", s || "string"), o.append("speed", (n == null ? void 0 : n.toString()) || "1");
|
|
1633
|
-
const a = await
|
|
1633
|
+
const a = await be(
|
|
1634
1634
|
`${this.config.baseUrl}/speech/synthesize`,
|
|
1635
1635
|
{
|
|
1636
1636
|
method: "POST",
|
|
@@ -1660,8 +1660,8 @@ class St {
|
|
|
1660
1660
|
if (l && l.includes("audio/"))
|
|
1661
1661
|
return a.blob();
|
|
1662
1662
|
try {
|
|
1663
|
-
const
|
|
1664
|
-
throw new Error(`TTS Error: ${JSON.stringify(
|
|
1663
|
+
const w = await a.json();
|
|
1664
|
+
throw new Error(`TTS Error: ${JSON.stringify(w)}`);
|
|
1665
1665
|
} catch {
|
|
1666
1666
|
throw new Error("TTS request failed with unknown error");
|
|
1667
1667
|
}
|
|
@@ -1674,25 +1674,25 @@ class St {
|
|
|
1674
1674
|
try {
|
|
1675
1675
|
this.stop(), (s = t == null ? void 0 : t.onStart) == null || s.call(t);
|
|
1676
1676
|
const o = await this.synthesizeSpeech(r), a = URL.createObjectURL(o);
|
|
1677
|
-
return this.currentAudio = new Audio(a), new Promise((l,
|
|
1677
|
+
return this.currentAudio = new Audio(a), new Promise((l, w) => {
|
|
1678
1678
|
if (!this.currentAudio) {
|
|
1679
|
-
|
|
1679
|
+
w(new Error("Audio element not created"));
|
|
1680
1680
|
return;
|
|
1681
1681
|
}
|
|
1682
|
-
const
|
|
1683
|
-
|
|
1682
|
+
const d = this.currentAudio;
|
|
1683
|
+
d.onended = () => {
|
|
1684
1684
|
var u;
|
|
1685
1685
|
URL.revokeObjectURL(a), this.currentAudio = null, (u = t == null ? void 0 : t.onEnd) == null || u.call(t), l();
|
|
1686
|
-
},
|
|
1686
|
+
}, d.onerror = (u) => {
|
|
1687
1687
|
var m;
|
|
1688
1688
|
URL.revokeObjectURL(a), this.currentAudio = null;
|
|
1689
1689
|
const h = new Error(`Audio playback failed: ${u}`);
|
|
1690
|
-
(m = t == null ? void 0 : t.onError) == null || m.call(t, h),
|
|
1691
|
-
},
|
|
1690
|
+
(m = t == null ? void 0 : t.onError) == null || m.call(t, h), w(h);
|
|
1691
|
+
}, d.play().catch((u) => {
|
|
1692
1692
|
var m;
|
|
1693
1693
|
URL.revokeObjectURL(a), this.currentAudio = null;
|
|
1694
1694
|
const h = new Error(`Failed to play audio: ${u.message}`);
|
|
1695
|
-
(m = t == null ? void 0 : t.onError) == null || m.call(t, h),
|
|
1695
|
+
(m = t == null ? void 0 : t.onError) == null || m.call(t, h), w(h);
|
|
1696
1696
|
});
|
|
1697
1697
|
});
|
|
1698
1698
|
} catch (o) {
|
|
@@ -1713,76 +1713,76 @@ class St {
|
|
|
1713
1713
|
return this.currentAudio !== null && !this.currentAudio.paused;
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
|
-
const
|
|
1716
|
+
const he = new At(), Mt = (i = {}) => {
|
|
1717
1717
|
const [r, t] = k(!1), [s, n] = k(!1), [o, a] = k(null);
|
|
1718
|
-
i.config &&
|
|
1719
|
-
const l =
|
|
1720
|
-
async (
|
|
1718
|
+
i.config && he.updateConfig(i.config);
|
|
1719
|
+
const l = T(
|
|
1720
|
+
async (d, u = {}) => {
|
|
1721
1721
|
var h;
|
|
1722
1722
|
try {
|
|
1723
1723
|
a(null), n(!0);
|
|
1724
1724
|
const m = {
|
|
1725
|
-
text:
|
|
1725
|
+
text: d,
|
|
1726
1726
|
...u
|
|
1727
1727
|
};
|
|
1728
|
-
await
|
|
1728
|
+
await he.speak(m, {
|
|
1729
1729
|
onStart: () => {
|
|
1730
|
-
var
|
|
1731
|
-
n(!1), t(!0), (
|
|
1730
|
+
var c;
|
|
1731
|
+
n(!1), t(!0), (c = i.onStart) == null || c.call(i);
|
|
1732
1732
|
},
|
|
1733
1733
|
onEnd: () => {
|
|
1734
|
-
var
|
|
1735
|
-
t(!1), (
|
|
1734
|
+
var c;
|
|
1735
|
+
t(!1), (c = i.onEnd) == null || c.call(i);
|
|
1736
1736
|
},
|
|
1737
|
-
onError: (
|
|
1738
|
-
var
|
|
1739
|
-
t(!1), n(!1), a(
|
|
1737
|
+
onError: (c) => {
|
|
1738
|
+
var x;
|
|
1739
|
+
t(!1), n(!1), a(c), (x = i.onError) == null || x.call(i, c);
|
|
1740
1740
|
}
|
|
1741
1741
|
});
|
|
1742
1742
|
} catch (m) {
|
|
1743
|
-
const
|
|
1744
|
-
throw a(
|
|
1743
|
+
const c = m instanceof Error ? m : new Error(String(m));
|
|
1744
|
+
throw a(c), t(!1), n(!1), (h = i.onError) == null || h.call(i, c), c;
|
|
1745
1745
|
}
|
|
1746
1746
|
},
|
|
1747
1747
|
[i]
|
|
1748
|
-
),
|
|
1749
|
-
|
|
1748
|
+
), w = T(() => {
|
|
1749
|
+
he.stop(), t(!1), n(!1);
|
|
1750
1750
|
}, []);
|
|
1751
1751
|
return {
|
|
1752
1752
|
speak: l,
|
|
1753
|
-
stop:
|
|
1753
|
+
stop: w,
|
|
1754
1754
|
isPlaying: r,
|
|
1755
1755
|
isLoading: s,
|
|
1756
1756
|
error: o
|
|
1757
1757
|
};
|
|
1758
|
-
},
|
|
1758
|
+
}, Dt = ({
|
|
1759
1759
|
onViolation: i,
|
|
1760
1760
|
onEnd: r,
|
|
1761
1761
|
maxViolations: t = 5
|
|
1762
1762
|
}) => {
|
|
1763
|
-
const { addViolation: s } =
|
|
1763
|
+
const { addViolation: s } = st(), n = it(), o = rt(), a = E(o);
|
|
1764
1764
|
C(() => {
|
|
1765
1765
|
a.current = o;
|
|
1766
1766
|
}, [o]);
|
|
1767
|
-
const l =
|
|
1768
|
-
(
|
|
1769
|
-
r && r(
|
|
1767
|
+
const l = T(
|
|
1768
|
+
(d) => {
|
|
1769
|
+
r && r(d, a.current);
|
|
1770
1770
|
},
|
|
1771
1771
|
[r]
|
|
1772
1772
|
);
|
|
1773
1773
|
return {
|
|
1774
|
-
logViolation:
|
|
1775
|
-
({ type:
|
|
1774
|
+
logViolation: T(
|
|
1775
|
+
({ type: d, severity: u, details: h }) => {
|
|
1776
1776
|
const m = {
|
|
1777
|
-
id:
|
|
1778
|
-
type:
|
|
1777
|
+
id: wt(),
|
|
1778
|
+
type: d,
|
|
1779
1779
|
severity: u,
|
|
1780
1780
|
details: h,
|
|
1781
1781
|
timestamp: Date.now()
|
|
1782
1782
|
};
|
|
1783
1783
|
s(m);
|
|
1784
|
-
const
|
|
1785
|
-
i && i(m,
|
|
1784
|
+
const c = a.current + 1;
|
|
1785
|
+
i && i(m, c), c >= t && l("excessive_violations");
|
|
1786
1786
|
},
|
|
1787
1787
|
[s, i, t, l]
|
|
1788
1788
|
),
|
|
@@ -1790,7 +1790,7 @@ const we = new St(), It = (i = {}) => {
|
|
|
1790
1790
|
violationCount: o,
|
|
1791
1791
|
logList: n
|
|
1792
1792
|
};
|
|
1793
|
-
},
|
|
1793
|
+
}, _t = () => {
|
|
1794
1794
|
C(() => {
|
|
1795
1795
|
function i() {
|
|
1796
1796
|
console.clear(), console.log(
|
|
@@ -1872,7 +1872,7 @@ const we = new St(), It = (i = {}) => {
|
|
|
1872
1872
|
clearInterval(s), document.removeEventListener("keydown", n), document.removeEventListener("contextmenu", o), delete window.showStats, delete window.interviewTips;
|
|
1873
1873
|
};
|
|
1874
1874
|
}, []);
|
|
1875
|
-
},
|
|
1875
|
+
}, ye = (i) => /* @__PURE__ */ e.jsxs(
|
|
1876
1876
|
"svg",
|
|
1877
1877
|
{
|
|
1878
1878
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1894,10 +1894,10 @@ const we = new St(), It = (i = {}) => {
|
|
|
1894
1894
|
/* @__PURE__ */ e.jsx("path", { d: "M8.644 21.42a10 10 0 0 0 7.631-.38" })
|
|
1895
1895
|
]
|
|
1896
1896
|
}
|
|
1897
|
-
),
|
|
1897
|
+
), Pt = (i, r, t) => Math.max(r, Math.min(t, i)), Ne = (i) => {
|
|
1898
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
1899
|
return `${t}:${s}`;
|
|
1900
|
-
},
|
|
1900
|
+
}, ve = ({
|
|
1901
1901
|
total: i,
|
|
1902
1902
|
remaining: r,
|
|
1903
1903
|
size: t = 64,
|
|
@@ -1905,16 +1905,16 @@ const we = new St(), It = (i = {}) => {
|
|
|
1905
1905
|
className: n = "",
|
|
1906
1906
|
showLabel: o = !0
|
|
1907
1907
|
}) => {
|
|
1908
|
-
const a = Math.max(1, i || 1), l =
|
|
1909
|
-
const
|
|
1910
|
-
return { radius:
|
|
1911
|
-
}, [t, s, l]), m =
|
|
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" : "";
|
|
1912
1912
|
return /* @__PURE__ */ e.jsxs(
|
|
1913
1913
|
"div",
|
|
1914
1914
|
{
|
|
1915
1915
|
className: `iw-relative iw-inline-flex iw-items-center iw-justify-center iw-rounded-full iw-bg-white ${n}`,
|
|
1916
1916
|
style: { width: t, height: t },
|
|
1917
|
-
"aria-label": `Time remaining ${
|
|
1917
|
+
"aria-label": `Time remaining ${Ne(r)}`,
|
|
1918
1918
|
role: "timer",
|
|
1919
1919
|
"aria-live": "polite",
|
|
1920
1920
|
children: [
|
|
@@ -1931,7 +1931,7 @@ const we = new St(), It = (i = {}) => {
|
|
|
1931
1931
|
{
|
|
1932
1932
|
cx: h,
|
|
1933
1933
|
cy: h,
|
|
1934
|
-
r:
|
|
1934
|
+
r: w,
|
|
1935
1935
|
className: "iw-stroke-gray-200",
|
|
1936
1936
|
strokeWidth: s,
|
|
1937
1937
|
fill: "none",
|
|
@@ -1944,12 +1944,12 @@ const we = new St(), It = (i = {}) => {
|
|
|
1944
1944
|
{
|
|
1945
1945
|
cx: h,
|
|
1946
1946
|
cy: h,
|
|
1947
|
-
r:
|
|
1948
|
-
className: `${m} ${
|
|
1947
|
+
r: w,
|
|
1948
|
+
className: `${m} ${c}`,
|
|
1949
1949
|
strokeWidth: s,
|
|
1950
1950
|
strokeLinecap: "round",
|
|
1951
1951
|
fill: "none",
|
|
1952
|
-
strokeDasharray:
|
|
1952
|
+
strokeDasharray: d,
|
|
1953
1953
|
strokeDashoffset: u,
|
|
1954
1954
|
shapeRendering: "geometricPrecision",
|
|
1955
1955
|
vectorEffect: "non-scaling-stroke",
|
|
@@ -1965,13 +1965,13 @@ const we = new St(), It = (i = {}) => {
|
|
|
1965
1965
|
"span",
|
|
1966
1966
|
{
|
|
1967
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"}`,
|
|
1968
|
-
children:
|
|
1968
|
+
children: Ne(r)
|
|
1969
1969
|
}
|
|
1970
1970
|
) })
|
|
1971
1971
|
]
|
|
1972
1972
|
}
|
|
1973
1973
|
);
|
|
1974
|
-
},
|
|
1974
|
+
}, Ft = ({
|
|
1975
1975
|
label: i,
|
|
1976
1976
|
error: r,
|
|
1977
1977
|
fullWidth: t = !1,
|
|
@@ -1979,7 +1979,7 @@ const we = new St(), It = (i = {}) => {
|
|
|
1979
1979
|
id: n,
|
|
1980
1980
|
...o
|
|
1981
1981
|
}) => {
|
|
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",
|
|
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" : "";
|
|
1983
1983
|
return /* @__PURE__ */ e.jsxs(
|
|
1984
1984
|
"div",
|
|
1985
1985
|
{
|
|
@@ -1997,7 +1997,7 @@ const we = new St(), It = (i = {}) => {
|
|
|
1997
1997
|
"textarea",
|
|
1998
1998
|
{
|
|
1999
1999
|
id: a,
|
|
2000
|
-
className: `${l} ${
|
|
2000
|
+
className: `${l} ${w} ${d} ${u} ${s}`,
|
|
2001
2001
|
"aria-invalid": r ? "true" : "false",
|
|
2002
2002
|
...o
|
|
2003
2003
|
}
|
|
@@ -2006,7 +2006,7 @@ const we = new St(), It = (i = {}) => {
|
|
|
2006
2006
|
]
|
|
2007
2007
|
}
|
|
2008
2008
|
);
|
|
2009
|
-
},
|
|
2009
|
+
}, Lt = ({
|
|
2010
2010
|
value: i,
|
|
2011
2011
|
onChange: r,
|
|
2012
2012
|
onSubmit: t,
|
|
@@ -2022,11 +2022,11 @@ const we = new St(), It = (i = {}) => {
|
|
|
2022
2022
|
/* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Your Answer" }),
|
|
2023
2023
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
|
|
2024
2024
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
|
|
2025
|
-
/* @__PURE__ */ e.jsx(
|
|
2025
|
+
/* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
|
|
2026
2026
|
/* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to edit: " })
|
|
2027
2027
|
] }),
|
|
2028
2028
|
/* @__PURE__ */ e.jsx(
|
|
2029
|
-
|
|
2029
|
+
ve,
|
|
2030
2030
|
{
|
|
2031
2031
|
total: o,
|
|
2032
2032
|
remaining: n.currentPhaseTimeRemaining,
|
|
@@ -2038,7 +2038,7 @@ const we = new St(), It = (i = {}) => {
|
|
|
2038
2038
|
] }),
|
|
2039
2039
|
/* @__PURE__ */ e.jsxs("div", { className: " iw-overflow-hidden iw-flex iw-flex-col iw-h-full iw-mt-2", children: [
|
|
2040
2040
|
/* @__PURE__ */ e.jsx(
|
|
2041
|
-
|
|
2041
|
+
Ft,
|
|
2042
2042
|
{
|
|
2043
2043
|
value: i,
|
|
2044
2044
|
onChange: r,
|
|
@@ -2055,9 +2055,9 @@ const we = new St(), It = (i = {}) => {
|
|
|
2055
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" }) })
|
|
2056
2056
|
] })
|
|
2057
2057
|
] });
|
|
2058
|
-
},
|
|
2058
|
+
}, $t = ({ className: i = "" }) => {
|
|
2059
2059
|
var n;
|
|
2060
|
-
const { authToken: r } =
|
|
2060
|
+
const { authToken: r } = De(), t = r ? ut(r) : null, s = E(null);
|
|
2061
2061
|
return C(() => {
|
|
2062
2062
|
let o = null;
|
|
2063
2063
|
return (async () => {
|
|
@@ -2092,16 +2092,16 @@ const we = new St(), It = (i = {}) => {
|
|
|
2092
2092
|
] }),
|
|
2093
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 }) })
|
|
2094
2094
|
] });
|
|
2095
|
-
},
|
|
2095
|
+
}, Ot = ({
|
|
2096
2096
|
question: i,
|
|
2097
2097
|
isLoading: r = !1
|
|
2098
2098
|
}) => {
|
|
2099
|
-
const { baseColor: t } =
|
|
2099
|
+
const { baseColor: t } = te();
|
|
2100
2100
|
return /* @__PURE__ */ e.jsx(
|
|
2101
2101
|
"div",
|
|
2102
2102
|
{
|
|
2103
2103
|
className: "iw-rounded-xl iw-mb-4 message-animation iw-text-gray-800 iw-p-6 ",
|
|
2104
|
-
style:
|
|
2104
|
+
style: ct(t, 0.85),
|
|
2105
2105
|
children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-8", children: [
|
|
2106
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(
|
|
2107
2107
|
"img",
|
|
@@ -2118,7 +2118,7 @@ const we = new St(), It = (i = {}) => {
|
|
|
2118
2118
|
] })
|
|
2119
2119
|
}
|
|
2120
2120
|
);
|
|
2121
|
-
},
|
|
2121
|
+
}, ke = ({
|
|
2122
2122
|
currentQuestion: i,
|
|
2123
2123
|
phase: r,
|
|
2124
2124
|
className: t = "",
|
|
@@ -2129,19 +2129,19 @@ const we = new St(), It = (i = {}) => {
|
|
|
2129
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`,
|
|
2130
2130
|
children: [
|
|
2131
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(
|
|
2132
|
-
|
|
2132
|
+
Ot,
|
|
2133
2133
|
{
|
|
2134
2134
|
question: i,
|
|
2135
|
-
isLoading: r ===
|
|
2135
|
+
isLoading: r === D.FETCHING_QUESTION || r === D.IDLE
|
|
2136
2136
|
}
|
|
2137
2137
|
) }) }),
|
|
2138
2138
|
/* @__PURE__ */ e.jsxs("div", { className: "iw iw-bg-[#F6F6F6] iw-grid iw-grid-cols-2 iw-rounded-[14px] iw-p-6", children: [
|
|
2139
|
-
/* @__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, {}) }),
|
|
2140
2140
|
/* @__PURE__ */ e.jsx("div", { className: "iw-bg-white iw-rounded-r-xl iw-shadow iw-p-6", children: s })
|
|
2141
2141
|
] })
|
|
2142
2142
|
]
|
|
2143
2143
|
}
|
|
2144
|
-
),
|
|
2144
|
+
), Ue = ({
|
|
2145
2145
|
isOpen: i,
|
|
2146
2146
|
onClose: r,
|
|
2147
2147
|
children: t,
|
|
@@ -2160,14 +2160,14 @@ const we = new St(), It = (i = {}) => {
|
|
|
2160
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")), () => {
|
|
2161
2161
|
document.body.style.overflow = "unset", document.body.classList.remove("interview-widget-container");
|
|
2162
2162
|
}), [i]), !i) return null;
|
|
2163
|
-
const
|
|
2163
|
+
const w = (u) => {
|
|
2164
2164
|
o && u.target === u.currentTarget && r();
|
|
2165
|
-
},
|
|
2165
|
+
}, d = /* @__PURE__ */ e.jsxs("div", { className: "iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center", children: [
|
|
2166
2166
|
/* @__PURE__ */ e.jsx(
|
|
2167
2167
|
"div",
|
|
2168
2168
|
{
|
|
2169
2169
|
className: "iw-fixed iw-inset-0 iw-bg-black iw-bg-opacity-50 iw-transition-opacity",
|
|
2170
|
-
onClick:
|
|
2170
|
+
onClick: w
|
|
2171
2171
|
}
|
|
2172
2172
|
),
|
|
2173
2173
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2219,13 +2219,13 @@ const we = new St(), It = (i = {}) => {
|
|
|
2219
2219
|
}
|
|
2220
2220
|
)
|
|
2221
2221
|
] });
|
|
2222
|
-
return
|
|
2223
|
-
},
|
|
2222
|
+
return Ve(d, document.body);
|
|
2223
|
+
}, Ut = ({
|
|
2224
2224
|
confirmExitInterview: i,
|
|
2225
2225
|
isOpen: r,
|
|
2226
2226
|
onClose: t
|
|
2227
2227
|
}) => /* @__PURE__ */ e.jsx(
|
|
2228
|
-
|
|
2228
|
+
Ue,
|
|
2229
2229
|
{
|
|
2230
2230
|
isOpen: r,
|
|
2231
2231
|
onClose: t,
|
|
@@ -2263,8 +2263,8 @@ const we = new St(), It = (i = {}) => {
|
|
|
2263
2263
|
] })
|
|
2264
2264
|
] })
|
|
2265
2265
|
}
|
|
2266
|
-
),
|
|
2267
|
-
const { baseColor: t } =
|
|
2266
|
+
), Ee = ({ title: i, onExit: r }) => {
|
|
2267
|
+
const { baseColor: t } = te(), [s, n] = k(!1);
|
|
2268
2268
|
return /* @__PURE__ */ e.jsxs("header", { className: "iw-w-full iw-text-gray-900", children: [
|
|
2269
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: [
|
|
2270
2270
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-space-x-2", children: [
|
|
@@ -2293,7 +2293,7 @@ const we = new St(), It = (i = {}) => {
|
|
|
2293
2293
|
] }),
|
|
2294
2294
|
/* @__PURE__ */ e.jsx("div", { className: "iw-h-px iw-bg-gray-200" }),
|
|
2295
2295
|
/* @__PURE__ */ e.jsx(
|
|
2296
|
-
|
|
2296
|
+
Ut,
|
|
2297
2297
|
{
|
|
2298
2298
|
isOpen: s,
|
|
2299
2299
|
confirmExitInterview: () => {
|
|
@@ -2303,7 +2303,7 @@ const we = new St(), It = (i = {}) => {
|
|
|
2303
2303
|
}
|
|
2304
2304
|
)
|
|
2305
2305
|
] });
|
|
2306
|
-
},
|
|
2306
|
+
}, qt = ({
|
|
2307
2307
|
className: i = "",
|
|
2308
2308
|
width: r,
|
|
2309
2309
|
height: t = 56,
|
|
@@ -2312,80 +2312,80 @@ const we = new St(), It = (i = {}) => {
|
|
|
2312
2312
|
fftSize: o = 1024,
|
|
2313
2313
|
smoothingTimeConstant: a = 0.8,
|
|
2314
2314
|
mediaStream: l,
|
|
2315
|
-
startOnMount:
|
|
2315
|
+
startOnMount: w = !0
|
|
2316
2316
|
}) => {
|
|
2317
|
-
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);
|
|
2318
2318
|
C(() => {
|
|
2319
2319
|
if (r || !h.current) return;
|
|
2320
|
-
const
|
|
2321
|
-
const
|
|
2322
|
-
if (!
|
|
2323
|
-
const A =
|
|
2324
|
-
|
|
2325
|
-
},
|
|
2326
|
-
return
|
|
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
2327
|
}, [r, t]), C(() => {
|
|
2328
2328
|
if (!r) return;
|
|
2329
|
-
const
|
|
2330
|
-
|
|
2329
|
+
const N = u.current;
|
|
2330
|
+
N && (N.width = Math.max(
|
|
2331
2331
|
1,
|
|
2332
2332
|
Math.floor(r * (window.devicePixelRatio || 1))
|
|
2333
|
-
),
|
|
2333
|
+
), N.height = Math.max(
|
|
2334
2334
|
1,
|
|
2335
2335
|
Math.floor(t * (window.devicePixelRatio || 1))
|
|
2336
2336
|
));
|
|
2337
2337
|
}, [r, t]), C(() => {
|
|
2338
|
-
let
|
|
2338
|
+
let N = !1;
|
|
2339
2339
|
return (async () => {
|
|
2340
2340
|
try {
|
|
2341
|
-
const
|
|
2342
|
-
m.current =
|
|
2343
|
-
let
|
|
2344
|
-
if (!
|
|
2345
|
-
if (!
|
|
2346
|
-
|
|
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({
|
|
2347
2347
|
audio: !0,
|
|
2348
2348
|
video: !1
|
|
2349
2349
|
}), j.current = !0;
|
|
2350
2350
|
}
|
|
2351
|
-
if (
|
|
2352
|
-
const A =
|
|
2353
|
-
A.fftSize = o, A.smoothingTimeConstant = a,
|
|
2354
|
-
const
|
|
2355
|
-
|
|
2356
|
-
} catch (
|
|
2357
|
-
|
|
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");
|
|
2358
2358
|
}
|
|
2359
2359
|
})(), () => {
|
|
2360
|
-
var
|
|
2361
|
-
|
|
2360
|
+
var y, R, A, f;
|
|
2361
|
+
N = !0, b.current && cancelAnimationFrame(b.current);
|
|
2362
2362
|
try {
|
|
2363
|
-
(
|
|
2363
|
+
(y = x.current) == null || y.disconnect();
|
|
2364
2364
|
} catch {
|
|
2365
2365
|
}
|
|
2366
2366
|
try {
|
|
2367
|
-
(
|
|
2367
|
+
(R = c.current) == null || R.disconnect();
|
|
2368
2368
|
} catch {
|
|
2369
2369
|
}
|
|
2370
|
-
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();
|
|
2371
2371
|
};
|
|
2372
|
-
}, [l, o, a,
|
|
2372
|
+
}, [l, o, a, w]);
|
|
2373
2373
|
const S = () => {
|
|
2374
|
-
const
|
|
2375
|
-
if (!
|
|
2376
|
-
const
|
|
2377
|
-
if (!
|
|
2378
|
-
const
|
|
2379
|
-
|
|
2380
|
-
const q = Math.max(1, Math.floor(s *
|
|
2381
|
-
for (let
|
|
2382
|
-
const
|
|
2383
|
-
|
|
2384
|
-
const
|
|
2385
|
-
|
|
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();
|
|
2386
2386
|
}
|
|
2387
2387
|
};
|
|
2388
|
-
|
|
2388
|
+
O();
|
|
2389
2389
|
};
|
|
2390
2390
|
return /* @__PURE__ */ e.jsxs(
|
|
2391
2391
|
"div",
|
|
@@ -2395,16 +2395,16 @@ const we = new St(), It = (i = {}) => {
|
|
|
2395
2395
|
style: { height: t },
|
|
2396
2396
|
children: [
|
|
2397
2397
|
/* @__PURE__ */ e.jsx("canvas", { ref: u, className: "iw-w-full iw-h-full" }),
|
|
2398
|
-
|
|
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 }) })
|
|
2399
2399
|
]
|
|
2400
2400
|
}
|
|
2401
2401
|
);
|
|
2402
2402
|
};
|
|
2403
|
-
function
|
|
2403
|
+
function Bt(i, r, t, s, n, o) {
|
|
2404
2404
|
const a = Math.min(o, s / 2, n / 2);
|
|
2405
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();
|
|
2406
2406
|
}
|
|
2407
|
-
const
|
|
2407
|
+
const Wt = ({
|
|
2408
2408
|
state: i,
|
|
2409
2409
|
answeringTime: r,
|
|
2410
2410
|
nextPhase: t,
|
|
@@ -2415,11 +2415,11 @@ const Ut = ({
|
|
|
2415
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...." }),
|
|
2416
2416
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
|
|
2417
2417
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
|
|
2418
|
-
/* @__PURE__ */ e.jsx(
|
|
2418
|
+
/* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
|
|
2419
2419
|
/* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to talk: " })
|
|
2420
2420
|
] }),
|
|
2421
2421
|
/* @__PURE__ */ e.jsx(
|
|
2422
|
-
|
|
2422
|
+
ve,
|
|
2423
2423
|
{
|
|
2424
2424
|
total: r,
|
|
2425
2425
|
remaining: i.currentPhaseTimeRemaining,
|
|
@@ -2432,7 +2432,7 @@ const Ut = ({
|
|
|
2432
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." })
|
|
2433
2433
|
] }),
|
|
2434
2434
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2435
|
-
/* @__PURE__ */ e.jsx(
|
|
2435
|
+
/* @__PURE__ */ e.jsx(qt, {}),
|
|
2436
2436
|
s && /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
|
|
2437
2437
|
"Recording error: ",
|
|
2438
2438
|
s.message
|
|
@@ -2448,8 +2448,8 @@ const Ut = ({
|
|
|
2448
2448
|
}
|
|
2449
2449
|
) })
|
|
2450
2450
|
] });
|
|
2451
|
-
function
|
|
2452
|
-
const [i, r] = k(!0), t =
|
|
2451
|
+
function Gt() {
|
|
2452
|
+
const [i, r] = k(!0), t = ee(
|
|
2453
2453
|
() => [0, 1, 2].map((s) => ({ id: s })),
|
|
2454
2454
|
[]
|
|
2455
2455
|
);
|
|
@@ -2460,7 +2460,7 @@ function qt() {
|
|
|
2460
2460
|
return () => clearInterval(s);
|
|
2461
2461
|
}, []), /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-h-full", children: [
|
|
2462
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,
|
|
2463
|
+
const o = n * 50, a = i ? o : o + 12, l = i ? 1 : 0.08, w = n * 140;
|
|
2464
2464
|
return /* @__PURE__ */ e.jsx(
|
|
2465
2465
|
"div",
|
|
2466
2466
|
{
|
|
@@ -2470,7 +2470,7 @@ function qt() {
|
|
|
2470
2470
|
top: 0,
|
|
2471
2471
|
transform: `translateY(${a}px)`,
|
|
2472
2472
|
opacity: l,
|
|
2473
|
-
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`
|
|
2474
2474
|
},
|
|
2475
2475
|
children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-gap-3 iw-items-center", children: [
|
|
2476
2476
|
/* @__PURE__ */ e.jsx("div", { className: "iw-w-10 iw-h-10 iw-bg-gray-300 iw-rounded iw-flex-shrink-0" }),
|
|
@@ -2486,7 +2486,7 @@ function qt() {
|
|
|
2486
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..." }) })
|
|
2487
2487
|
] });
|
|
2488
2488
|
}
|
|
2489
|
-
const
|
|
2489
|
+
const Vt = ({
|
|
2490
2490
|
size: i = "192px",
|
|
2491
2491
|
className: r,
|
|
2492
2492
|
colors: t,
|
|
@@ -2500,7 +2500,7 @@ const Bt = ({
|
|
|
2500
2500
|
// Pastel blue
|
|
2501
2501
|
c3: "oklch(78% 0.14 280)"
|
|
2502
2502
|
// Pastel purple/lavender
|
|
2503
|
-
}, ...t }, a = parseInt(i.replace("px", ""), 10), l = a < 50 ? Math.max(a * 8e-3, 1) : Math.max(a * 0.015, 4),
|
|
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;
|
|
2504
2504
|
return /* @__PURE__ */ e.jsx(
|
|
2505
2505
|
"div",
|
|
2506
2506
|
{
|
|
@@ -2515,7 +2515,7 @@ const Bt = ({
|
|
|
2515
2515
|
"--animation-duration": `${s}s`,
|
|
2516
2516
|
"--blur-amount": `${l}px`,
|
|
2517
2517
|
"--contrast-amount": m,
|
|
2518
|
-
"--dot-size": `${
|
|
2518
|
+
"--dot-size": `${d}px`,
|
|
2519
2519
|
"--shadow-spread": `${u}px`,
|
|
2520
2520
|
"--mask-radius": h
|
|
2521
2521
|
},
|
|
@@ -2628,9 +2628,9 @@ const Bt = ({
|
|
|
2628
2628
|
}
|
|
2629
2629
|
);
|
|
2630
2630
|
};
|
|
2631
|
-
function
|
|
2631
|
+
function zt({ ttsError: i }) {
|
|
2632
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: [
|
|
2633
|
-
/* @__PURE__ */ e.jsx(
|
|
2633
|
+
/* @__PURE__ */ e.jsx(Vt, { size: "80px" }),
|
|
2634
2634
|
i && /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
|
|
2635
2635
|
"Audio playback failed: ",
|
|
2636
2636
|
i.message
|
|
@@ -2638,18 +2638,18 @@ function Wt({ ttsError: i }) {
|
|
|
2638
2638
|
/* @__PURE__ */ e.jsx("p", { className: "iw-text- iw-text-gray-700", children: "Your AI interviewer is speaking..." })
|
|
2639
2639
|
] });
|
|
2640
2640
|
}
|
|
2641
|
-
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: [
|
|
2642
2642
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2643
2643
|
/* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Get Ready to Answer" }),
|
|
2644
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." })
|
|
2645
2645
|
] }),
|
|
2646
2646
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
|
|
2647
2647
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
|
|
2648
|
-
/* @__PURE__ */ e.jsx(
|
|
2648
|
+
/* @__PURE__ */ e.jsx(ye, { className: "iw-size-4 iw-text-orange-600" }),
|
|
2649
2649
|
/* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to think: " })
|
|
2650
2650
|
] }),
|
|
2651
2651
|
/* @__PURE__ */ e.jsx(
|
|
2652
|
-
|
|
2652
|
+
ve,
|
|
2653
2653
|
{
|
|
2654
2654
|
total: r,
|
|
2655
2655
|
remaining: i.currentPhaseTimeRemaining,
|
|
@@ -2667,7 +2667,7 @@ const Gt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
|
|
|
2667
2667
|
children: "Start Answering"
|
|
2668
2668
|
}
|
|
2669
2669
|
) })
|
|
2670
|
-
] }),
|
|
2670
|
+
] }), Yt = ({ sttError: i }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full", children: [
|
|
2671
2671
|
/* @__PURE__ */ e.jsxs("svg", { width: "48", height: "48", viewBox: "0 0 60 60", fill: "none", children: [
|
|
2672
2672
|
/* @__PURE__ */ e.jsx(
|
|
2673
2673
|
"rect",
|
|
@@ -2708,7 +2708,7 @@ const Gt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
|
|
|
2708
2708
|
i.message,
|
|
2709
2709
|
i.recoverable && " (attempting to continue)"
|
|
2710
2710
|
] })
|
|
2711
|
-
] }),
|
|
2711
|
+
] }), se = (i) => /* @__PURE__ */ e.jsxs(
|
|
2712
2712
|
"svg",
|
|
2713
2713
|
{
|
|
2714
2714
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2727,7 +2727,7 @@ const Gt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
|
|
|
2727
2727
|
/* @__PURE__ */ e.jsx("path", { d: "M12 17h.01" })
|
|
2728
2728
|
]
|
|
2729
2729
|
}
|
|
2730
|
-
),
|
|
2730
|
+
), Qt = (i) => /* @__PURE__ */ e.jsxs(
|
|
2731
2731
|
"svg",
|
|
2732
2732
|
{
|
|
2733
2733
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2745,7 +2745,7 @@ const Gt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
|
|
|
2745
2745
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" })
|
|
2746
2746
|
]
|
|
2747
2747
|
}
|
|
2748
|
-
),
|
|
2748
|
+
), Kt = (i) => /* @__PURE__ */ e.jsxs(
|
|
2749
2749
|
"svg",
|
|
2750
2750
|
{
|
|
2751
2751
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2763,7 +2763,7 @@ const Gt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
|
|
|
2763
2763
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
2764
2764
|
]
|
|
2765
2765
|
}
|
|
2766
|
-
),
|
|
2766
|
+
), Jt = (i) => /* @__PURE__ */ e.jsxs(
|
|
2767
2767
|
"svg",
|
|
2768
2768
|
{
|
|
2769
2769
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2784,7 +2784,7 @@ const Gt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
|
|
|
2784
2784
|
/* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
|
|
2785
2785
|
]
|
|
2786
2786
|
}
|
|
2787
|
-
),
|
|
2787
|
+
), me = (i) => /* @__PURE__ */ e.jsxs(
|
|
2788
2788
|
"svg",
|
|
2789
2789
|
{
|
|
2790
2790
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2805,7 +2805,7 @@ const Gt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
|
|
|
2805
2805
|
/* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
|
|
2806
2806
|
]
|
|
2807
2807
|
}
|
|
2808
|
-
),
|
|
2808
|
+
), Xt = (i) => /* @__PURE__ */ e.jsxs(
|
|
2809
2809
|
"svg",
|
|
2810
2810
|
{
|
|
2811
2811
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2826,21 +2826,21 @@ const Gt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
|
|
|
2826
2826
|
/* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
|
|
2827
2827
|
]
|
|
2828
2828
|
}
|
|
2829
|
-
),
|
|
2830
|
-
function
|
|
2829
|
+
), re = 5;
|
|
2830
|
+
function Zt({
|
|
2831
2831
|
isOpen: i,
|
|
2832
2832
|
onClose: r,
|
|
2833
2833
|
warningCount: t,
|
|
2834
2834
|
violationType: s,
|
|
2835
2835
|
onDisqualify: n
|
|
2836
2836
|
}) {
|
|
2837
|
-
const [o, a] = k(10), l =
|
|
2837
|
+
const [o, a] = k(10), l = E(r);
|
|
2838
2838
|
if (C(() => {
|
|
2839
2839
|
l.current = r;
|
|
2840
2840
|
}, [r]), C(() => {
|
|
2841
2841
|
if (!i) return;
|
|
2842
2842
|
const m = setInterval(() => {
|
|
2843
|
-
a((
|
|
2843
|
+
a((c) => c <= 1 ? (l.current(), 10) : c - 1);
|
|
2844
2844
|
}, 1e3);
|
|
2845
2845
|
return () => clearInterval(m);
|
|
2846
2846
|
}, [i]), C(() => {
|
|
@@ -2848,80 +2848,80 @@ function Kt({
|
|
|
2848
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")), () => {
|
|
2849
2849
|
document.body.style.overflow = "unset", document.body.classList.remove("interview-widget-container");
|
|
2850
2850
|
}), [i]), !i) return null;
|
|
2851
|
-
const
|
|
2851
|
+
const d = (() => {
|
|
2852
2852
|
switch (s) {
|
|
2853
2853
|
case "tab_switch":
|
|
2854
2854
|
return {
|
|
2855
2855
|
title: "Tab Switch Detected",
|
|
2856
2856
|
description: "You attempted to switch to another tab or reload application.",
|
|
2857
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2857
|
+
icon: /* @__PURE__ */ e.jsx(Kt, { className: "iw-h-5 iw-w-5" })
|
|
2858
2858
|
};
|
|
2859
2859
|
case "fullscreen_exit":
|
|
2860
2860
|
return {
|
|
2861
2861
|
title: "Full Screen Exit Detected",
|
|
2862
2862
|
description: "You attempted to exit full screen mode.",
|
|
2863
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2863
|
+
icon: /* @__PURE__ */ e.jsx(Oe, { className: "iw-h-5 iw-w-5" })
|
|
2864
2864
|
};
|
|
2865
2865
|
case "focus_loss":
|
|
2866
2866
|
return {
|
|
2867
2867
|
title: "Focus Loss Detected",
|
|
2868
2868
|
description: "You lost focus from the interview window.",
|
|
2869
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2869
|
+
icon: /* @__PURE__ */ e.jsx(Jt, { className: "iw-h-5 iw-w-5" })
|
|
2870
2870
|
};
|
|
2871
2871
|
case "blocked_shortcut":
|
|
2872
2872
|
return {
|
|
2873
2873
|
title: "Keyboard Shortcut Blocked",
|
|
2874
2874
|
description: "You attempted to use a blocked keyboard shortcut.",
|
|
2875
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2875
|
+
icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
|
|
2876
2876
|
};
|
|
2877
2877
|
case "right_click_attempt":
|
|
2878
2878
|
return {
|
|
2879
2879
|
title: "Right Click Attempted",
|
|
2880
2880
|
description: "You attempted to use the right click.",
|
|
2881
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2881
|
+
icon: /* @__PURE__ */ e.jsx(Xt, { className: "iw-h-5 iw-w-5" })
|
|
2882
2882
|
};
|
|
2883
2883
|
case "alt_tab_attempt":
|
|
2884
2884
|
return {
|
|
2885
2885
|
title: "Alt + Tab Attempted",
|
|
2886
2886
|
description: "You attempted to use the Alt + Tab shortcut.",
|
|
2887
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2887
|
+
icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
|
|
2888
2888
|
};
|
|
2889
2889
|
case "blocked_function_key":
|
|
2890
2890
|
return {
|
|
2891
2891
|
title: "Function Key Blocked",
|
|
2892
2892
|
description: "You attempted to use a blocked function key.",
|
|
2893
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2893
|
+
icon: /* @__PURE__ */ e.jsx(me, { className: "iw-h-5 iw-w-5" })
|
|
2894
2894
|
};
|
|
2895
2895
|
default:
|
|
2896
2896
|
return {
|
|
2897
2897
|
title: "Violation Detected",
|
|
2898
2898
|
description: "You attempted to perform an action that is not allowed.",
|
|
2899
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2899
|
+
icon: /* @__PURE__ */ e.jsx(se, { className: "iw-h-5 iw-w-5" })
|
|
2900
2900
|
};
|
|
2901
2901
|
}
|
|
2902
|
-
})(), u =
|
|
2903
|
-
t + 1 >
|
|
2902
|
+
})(), u = re - t, h = () => {
|
|
2903
|
+
t + 1 > re ? n() : r();
|
|
2904
2904
|
};
|
|
2905
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: [
|
|
2906
2906
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-p-6 iw-pb-0", children: [
|
|
2907
2907
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-mb-6 iw-flex iw-items-start iw-gap-4", children: [
|
|
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(
|
|
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" }) }),
|
|
2909
2909
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex-1", children: [
|
|
2910
2910
|
/* @__PURE__ */ e.jsx("h2", { className: "iw-mb-1 iw-text-xl iw-font-semibold iw-text-gray-900", children: "Security Violation" }),
|
|
2911
2911
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-2", children: [
|
|
2912
2912
|
/* @__PURE__ */ e.jsx("span", { className: "iw-text-sm iw-text-gray-500", children: "Warning" }),
|
|
2913
|
-
/* @__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(
|
|
2914
2914
|
"div",
|
|
2915
2915
|
{
|
|
2916
|
-
className: `iw-h-2 iw-w-2 iw-rounded-full ${
|
|
2916
|
+
className: `iw-h-2 iw-w-2 iw-rounded-full ${c <= t - 1 ? "iw-bg-red-500" : "iw-bg-gray-200"}`
|
|
2917
2917
|
},
|
|
2918
|
-
|
|
2918
|
+
c
|
|
2919
2919
|
)) }),
|
|
2920
2920
|
/* @__PURE__ */ e.jsxs("span", { className: "iw-text-sm iw-text-gray-500", children: [
|
|
2921
2921
|
"(",
|
|
2922
2922
|
t,
|
|
2923
2923
|
"/",
|
|
2924
|
-
|
|
2924
|
+
re,
|
|
2925
2925
|
")"
|
|
2926
2926
|
] })
|
|
2927
2927
|
] })
|
|
@@ -2936,12 +2936,12 @@ function Kt({
|
|
|
2936
2936
|
borderColor: "rgb(254, 226, 226)"
|
|
2937
2937
|
},
|
|
2938
2938
|
children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-start iw-gap-4", 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:
|
|
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 }),
|
|
2940
2940
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-flex-1", children: [
|
|
2941
|
-
/* @__PURE__ */ e.jsx("h3", { className: "iw-mb-2 iw-font-semibold iw-text-gray-900", children:
|
|
2942
|
-
/* @__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 }),
|
|
2943
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: [
|
|
2944
|
-
/* @__PURE__ */ e.jsx(
|
|
2944
|
+
/* @__PURE__ */ e.jsx($e, { className: "iw-h-3 iw-w-3" }),
|
|
2945
2945
|
/* @__PURE__ */ e.jsx("span", { children: "This action is monitored for interview integrity" })
|
|
2946
2946
|
] })
|
|
2947
2947
|
] })
|
|
@@ -2955,7 +2955,7 @@ function Kt({
|
|
|
2955
2955
|
] }) }),
|
|
2956
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: [
|
|
2957
2957
|
/* @__PURE__ */ e.jsxs("div", { className: "iw-mb-1 iw-flex iw-items-center iw-justify-center iw-gap-1.5", children: [
|
|
2958
|
-
/* @__PURE__ */ e.jsx(
|
|
2958
|
+
/* @__PURE__ */ e.jsx(Qt, { className: "iw-text-primary-600 iw-h-4 iw-w-4" }),
|
|
2959
2959
|
/* @__PURE__ */ e.jsx("span", { className: "iw-text-primary-600 iw-text-2xl iw-font-bold", children: o })
|
|
2960
2960
|
] }),
|
|
2961
2961
|
/* @__PURE__ */ e.jsx("div", { className: "iw-text-primary-700 iw-text-xs iw-font-medium", children: "Auto Close" })
|
|
@@ -2969,7 +2969,7 @@ function Kt({
|
|
|
2969
2969
|
background: "linear-gradient(to right, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.9))"
|
|
2970
2970
|
},
|
|
2971
2971
|
children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-3", children: [
|
|
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(
|
|
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" }) }),
|
|
2973
2973
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2974
2974
|
/* @__PURE__ */ e.jsx("div", { className: "iw-text-sm iw-font-semibold", children: "Final Warning" }),
|
|
2975
2975
|
/* @__PURE__ */ e.jsx("div", { className: "iw-text-xs iw-text-red-100", children: "Next violation will disqualify you from this interview" })
|
|
@@ -2991,7 +2991,7 @@ function Kt({
|
|
|
2991
2991
|
] })
|
|
2992
2992
|
] }) });
|
|
2993
2993
|
}
|
|
2994
|
-
const
|
|
2994
|
+
const ei = (i) => /* @__PURE__ */ e.jsxs(
|
|
2995
2995
|
"svg",
|
|
2996
2996
|
{
|
|
2997
2997
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3009,7 +3009,7 @@ const Jt = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
3009
3009
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" })
|
|
3010
3010
|
]
|
|
3011
3011
|
}
|
|
3012
|
-
),
|
|
3012
|
+
), ti = ({
|
|
3013
3013
|
showHardReloadWarning: i,
|
|
3014
3014
|
onContinue: r
|
|
3015
3015
|
}) => {
|
|
@@ -3017,7 +3017,7 @@ const Jt = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
3017
3017
|
r();
|
|
3018
3018
|
};
|
|
3019
3019
|
return /* @__PURE__ */ e.jsxs(
|
|
3020
|
-
|
|
3020
|
+
Ue,
|
|
3021
3021
|
{
|
|
3022
3022
|
isOpen: i,
|
|
3023
3023
|
onClose: t,
|
|
@@ -3028,7 +3028,7 @@ const Jt = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
3028
3028
|
children: [
|
|
3029
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" }),
|
|
3030
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: [
|
|
3031
|
-
/* @__PURE__ */ e.jsx(
|
|
3031
|
+
/* @__PURE__ */ e.jsx(se, { className: "iw-w-5 iw-h-5 iw-text-red-500" }),
|
|
3032
3032
|
/* @__PURE__ */ e.jsx("h3", { className: "iw-text-xl iw-font-semibold iw-text-red-500", children: "Full Screen Exit Detected" })
|
|
3033
3033
|
] }) }),
|
|
3034
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." }) }),
|
|
@@ -3038,7 +3038,7 @@ const Jt = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
3038
3038
|
onClick: t,
|
|
3039
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",
|
|
3040
3040
|
children: [
|
|
3041
|
-
/* @__PURE__ */ e.jsx(
|
|
3041
|
+
/* @__PURE__ */ e.jsx(ei, { className: "iw-size-4" }),
|
|
3042
3042
|
"Continue Session"
|
|
3043
3043
|
]
|
|
3044
3044
|
}
|
|
@@ -3046,131 +3046,146 @@ const Jt = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
3046
3046
|
]
|
|
3047
3047
|
}
|
|
3048
3048
|
);
|
|
3049
|
-
},
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
}), { enterFullScreen: u, isFullScreen: h, exitFullScreen: m } = pt({
|
|
3056
|
-
onFullScreenChange(f) {
|
|
3057
|
-
!f && !n && (s(!0), d({
|
|
3058
|
-
type: "fullscreen_exit",
|
|
3059
|
-
severity: "high",
|
|
3060
|
-
details: {
|
|
3061
|
-
action: "fullscreen_exit",
|
|
3062
|
-
reason: "Attempted to exit full screen mode"
|
|
3063
|
-
}
|
|
3064
|
-
}));
|
|
3065
|
-
}
|
|
3066
|
-
});
|
|
3067
|
-
C(() => {
|
|
3068
|
-
u();
|
|
3069
|
-
}, []), Tt(d), Nt(d), Ct(), At();
|
|
3070
|
-
const w = () => {
|
|
3071
|
-
o(!0), m(), s(!1), r == null || r();
|
|
3072
|
-
};
|
|
3073
|
-
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3074
|
-
/* @__PURE__ */ e.jsx("div", { className: "iw-relative iw-h-full iw-w-full", children: i }),
|
|
3075
|
-
/* @__PURE__ */ e.jsx(
|
|
3076
|
-
Kt,
|
|
3077
|
-
{
|
|
3078
|
-
warningCount: c,
|
|
3079
|
-
isOpen: t,
|
|
3080
|
-
violationType: a,
|
|
3081
|
-
onClose: () => {
|
|
3082
|
-
s(!1), u();
|
|
3083
|
-
},
|
|
3084
|
-
onDisqualify: w
|
|
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));
|
|
3085
3055
|
}
|
|
3086
|
-
),
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
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);
|
|
3093
3066
|
}
|
|
3094
|
-
)
|
|
3095
|
-
|
|
3096
|
-
|
|
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 = ({
|
|
3097
3112
|
interviewTitle: i,
|
|
3098
3113
|
interviewId: r,
|
|
3099
3114
|
onComplete: t,
|
|
3100
3115
|
onDisqualify: s,
|
|
3101
3116
|
className: n = ""
|
|
3102
3117
|
}) => {
|
|
3103
|
-
const o =
|
|
3104
|
-
thinkingTime: (
|
|
3105
|
-
answeringTime: (
|
|
3106
|
-
editingTime: (
|
|
3107
|
-
}, { 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;
|
|
3108
3123
|
C(() => {
|
|
3109
|
-
|
|
3110
|
-
}, [
|
|
3111
|
-
const
|
|
3112
|
-
speak:
|
|
3113
|
-
stop:
|
|
3114
|
-
error:
|
|
3115
|
-
} =
|
|
3124
|
+
g.current = b;
|
|
3125
|
+
}, [b]);
|
|
3126
|
+
const R = E(!1), {
|
|
3127
|
+
speak: A,
|
|
3128
|
+
stop: f,
|
|
3129
|
+
error: M
|
|
3130
|
+
} = Mt({
|
|
3116
3131
|
config: {
|
|
3117
3132
|
baseUrl: a,
|
|
3118
3133
|
provider: u == null ? void 0 : u.provider,
|
|
3119
3134
|
authToken: l
|
|
3120
3135
|
},
|
|
3121
3136
|
onEnd: () => {
|
|
3122
|
-
|
|
3137
|
+
R.current = !1, P();
|
|
3123
3138
|
},
|
|
3124
3139
|
onError: () => {
|
|
3125
|
-
|
|
3140
|
+
R.current || (R.current = !0, P());
|
|
3126
3141
|
}
|
|
3127
|
-
}),
|
|
3128
|
-
startRecording:
|
|
3129
|
-
stopRecording:
|
|
3130
|
-
transcribe:
|
|
3131
|
-
error:
|
|
3132
|
-
} =
|
|
3142
|
+
}), L = E(!1), O = E(!1), {
|
|
3143
|
+
startRecording: q,
|
|
3144
|
+
stopRecording: z,
|
|
3145
|
+
transcribe: H,
|
|
3146
|
+
error: Y
|
|
3147
|
+
} = St({
|
|
3133
3148
|
config: {
|
|
3134
3149
|
baseUrl: a,
|
|
3135
|
-
provider:
|
|
3136
|
-
model:
|
|
3137
|
-
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,
|
|
3138
3153
|
authToken: l
|
|
3139
3154
|
},
|
|
3140
3155
|
onStart: () => {
|
|
3141
|
-
|
|
3156
|
+
L.current = !1, O.current = !1;
|
|
3142
3157
|
},
|
|
3143
3158
|
onStop: () => {
|
|
3144
3159
|
},
|
|
3145
3160
|
onTranscriptionComplete: (p) => {
|
|
3146
|
-
|
|
3161
|
+
j(p.transcript), O.current || (O.current = !0, P());
|
|
3147
3162
|
},
|
|
3148
3163
|
onError: (p) => {
|
|
3149
|
-
console.error("STT Error:", p),
|
|
3164
|
+
console.error("STT Error:", p), L.current || (L.current = !0, P());
|
|
3150
3165
|
}
|
|
3151
|
-
}), { state:
|
|
3166
|
+
}), { state: B, startQuestion: U, nextPhase: P, completeInterview: Q } = bt({
|
|
3152
3167
|
config: {
|
|
3153
|
-
thinkingDuration:
|
|
3154
|
-
answeringDuration:
|
|
3155
|
-
editingDuration:
|
|
3168
|
+
thinkingDuration: N,
|
|
3169
|
+
answeringDuration: _,
|
|
3170
|
+
editingDuration: y
|
|
3156
3171
|
},
|
|
3157
3172
|
callbacks: {
|
|
3158
3173
|
onPhaseChange: (p) => {
|
|
3159
3174
|
switch (p) {
|
|
3160
|
-
case
|
|
3161
|
-
|
|
3175
|
+
case D.FETCHING_QUESTION:
|
|
3176
|
+
W();
|
|
3162
3177
|
break;
|
|
3163
|
-
case
|
|
3164
|
-
|
|
3178
|
+
case D.READING_QUESTION:
|
|
3179
|
+
de();
|
|
3165
3180
|
break;
|
|
3166
|
-
case
|
|
3167
|
-
|
|
3181
|
+
case D.ANSWERING:
|
|
3182
|
+
we();
|
|
3168
3183
|
break;
|
|
3169
|
-
case
|
|
3170
|
-
|
|
3184
|
+
case D.TRANSCRIBING:
|
|
3185
|
+
ue();
|
|
3171
3186
|
break;
|
|
3172
|
-
case
|
|
3173
|
-
|
|
3187
|
+
case D.SUBMITTING:
|
|
3188
|
+
K();
|
|
3174
3189
|
break;
|
|
3175
3190
|
}
|
|
3176
3191
|
},
|
|
@@ -3180,169 +3195,171 @@ const Jt = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
3180
3195
|
}
|
|
3181
3196
|
});
|
|
3182
3197
|
C(() => {
|
|
3183
|
-
|
|
3198
|
+
U();
|
|
3184
3199
|
}, []);
|
|
3185
|
-
const { execute:
|
|
3200
|
+
const { execute: W, loading: ce } = yt(
|
|
3186
3201
|
async () => {
|
|
3187
|
-
var
|
|
3202
|
+
var G, X;
|
|
3188
3203
|
const p = await o.generateQuestion({
|
|
3189
3204
|
interviewId: r,
|
|
3190
|
-
question: ((
|
|
3191
|
-
qnaId: ((
|
|
3192
|
-
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
|
|
3193
3208
|
});
|
|
3194
|
-
return
|
|
3209
|
+
return v.current = p.data, p;
|
|
3195
3210
|
},
|
|
3196
3211
|
{
|
|
3197
3212
|
onSuccess: async (p) => {
|
|
3198
|
-
p && p.data && (
|
|
3213
|
+
p && p.data && (j(""), x(p.data), P());
|
|
3199
3214
|
},
|
|
3200
3215
|
onError: (p) => {
|
|
3201
3216
|
console.error("Failed to fetch questions:", p);
|
|
3202
3217
|
}
|
|
3203
3218
|
}
|
|
3204
|
-
),
|
|
3205
|
-
|
|
3206
|
-
}, [
|
|
3219
|
+
), K = T(async () => {
|
|
3220
|
+
U();
|
|
3221
|
+
}, [U]), de = T(async () => {
|
|
3207
3222
|
var p;
|
|
3208
|
-
if ((p =
|
|
3223
|
+
if ((p = v.current) != null && p.question)
|
|
3209
3224
|
try {
|
|
3210
|
-
|
|
3211
|
-
} catch (
|
|
3212
|
-
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);
|
|
3213
3228
|
}
|
|
3214
3229
|
else
|
|
3215
|
-
|
|
3216
|
-
}, [
|
|
3230
|
+
P();
|
|
3231
|
+
}, [A, P, Q]), we = T(async () => {
|
|
3217
3232
|
try {
|
|
3218
|
-
await
|
|
3233
|
+
await q(_);
|
|
3219
3234
|
} catch (p) {
|
|
3220
|
-
console.error("Failed to start recording:", p),
|
|
3235
|
+
console.error("Failed to start recording:", p), P();
|
|
3221
3236
|
}
|
|
3222
|
-
}, [
|
|
3237
|
+
}, [q, P]), ue = T(async () => {
|
|
3223
3238
|
try {
|
|
3224
|
-
const p = await
|
|
3225
|
-
await
|
|
3239
|
+
const p = await z();
|
|
3240
|
+
await H(p);
|
|
3226
3241
|
} catch (p) {
|
|
3227
|
-
console.error("STT processing failed:", p), !
|
|
3242
|
+
console.error("STT processing failed:", p), !L.current && !O.current && (L.current = !0, P());
|
|
3228
3243
|
}
|
|
3229
|
-
}, [
|
|
3244
|
+
}, [z, H, P]), J = T(
|
|
3230
3245
|
async (p) => {
|
|
3231
|
-
|
|
3246
|
+
var X;
|
|
3247
|
+
f(), await ((X = m.current) == null ? void 0 : X.exitFullScreenIntentionally()), (await o.generateQuestion({
|
|
3232
3248
|
interviewId: r,
|
|
3233
3249
|
isInterviewDone: !0
|
|
3234
|
-
})).success && (p == null || p(),
|
|
3250
|
+
})).success && (p == null || p(), Q(), sessionStorage.removeItem(xe));
|
|
3235
3251
|
},
|
|
3236
|
-
[r,
|
|
3237
|
-
),
|
|
3238
|
-
const { phase: p } =
|
|
3252
|
+
[r, f, o]
|
|
3253
|
+
), ie = () => {
|
|
3254
|
+
const { phase: p } = B;
|
|
3239
3255
|
switch (p) {
|
|
3240
|
-
case
|
|
3256
|
+
case D.IDLE:
|
|
3241
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: [
|
|
3242
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?" }),
|
|
3243
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.` }),
|
|
3244
|
-
/* @__PURE__ */ e.jsx(V, { onClick:
|
|
3260
|
+
/* @__PURE__ */ e.jsx(V, { onClick: U, className: "iw-mt-2 iw-w-40", children: "Start Interview" })
|
|
3245
3261
|
] });
|
|
3246
|
-
case
|
|
3247
|
-
return /* @__PURE__ */ e.jsx(
|
|
3248
|
-
case
|
|
3249
|
-
return /* @__PURE__ */ e.jsx(
|
|
3250
|
-
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:
|
|
3251
3267
|
return /* @__PURE__ */ e.jsx(
|
|
3252
|
-
|
|
3268
|
+
Ht,
|
|
3253
3269
|
{
|
|
3254
|
-
state:
|
|
3255
|
-
thinkingTime:
|
|
3256
|
-
nextPhase:
|
|
3270
|
+
state: B,
|
|
3271
|
+
thinkingTime: N,
|
|
3272
|
+
nextPhase: P
|
|
3257
3273
|
}
|
|
3258
3274
|
);
|
|
3259
|
-
case
|
|
3275
|
+
case D.ANSWERING:
|
|
3260
3276
|
return /* @__PURE__ */ e.jsx(
|
|
3261
|
-
|
|
3277
|
+
Wt,
|
|
3262
3278
|
{
|
|
3263
|
-
state:
|
|
3264
|
-
answeringTime:
|
|
3265
|
-
nextPhase:
|
|
3266
|
-
sttError:
|
|
3279
|
+
state: B,
|
|
3280
|
+
answeringTime: _,
|
|
3281
|
+
nextPhase: P,
|
|
3282
|
+
sttError: Y
|
|
3267
3283
|
}
|
|
3268
3284
|
);
|
|
3269
|
-
case
|
|
3270
|
-
return /* @__PURE__ */ e.jsx(
|
|
3271
|
-
case
|
|
3272
|
-
case
|
|
3285
|
+
case D.TRANSCRIBING:
|
|
3286
|
+
return /* @__PURE__ */ e.jsx(Yt, { sttError: Y });
|
|
3287
|
+
case D.EDITING:
|
|
3288
|
+
case D.SUBMITTING:
|
|
3273
3289
|
return /* @__PURE__ */ e.jsx("div", { className: "iw-space-y-4 iw-h-full", children: /* @__PURE__ */ e.jsx(
|
|
3274
|
-
|
|
3290
|
+
Lt,
|
|
3275
3291
|
{
|
|
3276
|
-
value:
|
|
3277
|
-
onChange: (
|
|
3278
|
-
onSubmit: () =>
|
|
3279
|
-
isSubmitDisabled: !
|
|
3280
|
-
state:
|
|
3281
|
-
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
|
|
3282
3298
|
}
|
|
3283
3299
|
) });
|
|
3284
|
-
case
|
|
3300
|
+
case D.COMPLETED:
|
|
3285
3301
|
return null;
|
|
3286
3302
|
default:
|
|
3287
3303
|
return null;
|
|
3288
3304
|
}
|
|
3289
3305
|
};
|
|
3290
3306
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: h != null && h.enabled ? /* @__PURE__ */ e.jsxs(
|
|
3291
|
-
|
|
3307
|
+
ii,
|
|
3292
3308
|
{
|
|
3293
|
-
|
|
3309
|
+
ref: m,
|
|
3310
|
+
onDisqualify: () => J(s),
|
|
3294
3311
|
children: [
|
|
3295
3312
|
/* @__PURE__ */ e.jsx(
|
|
3296
|
-
|
|
3313
|
+
Ee,
|
|
3297
3314
|
{
|
|
3298
3315
|
title: i,
|
|
3299
|
-
onExit: () =>
|
|
3316
|
+
onExit: () => J()
|
|
3300
3317
|
}
|
|
3301
3318
|
),
|
|
3302
3319
|
/* @__PURE__ */ e.jsx(
|
|
3303
|
-
|
|
3320
|
+
ke,
|
|
3304
3321
|
{
|
|
3305
|
-
currentQuestion:
|
|
3306
|
-
phase:
|
|
3322
|
+
currentQuestion: c,
|
|
3323
|
+
phase: B.phase,
|
|
3307
3324
|
className: n,
|
|
3308
|
-
children:
|
|
3325
|
+
children: ie()
|
|
3309
3326
|
}
|
|
3310
3327
|
)
|
|
3311
3328
|
]
|
|
3312
3329
|
}
|
|
3313
3330
|
) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3314
3331
|
/* @__PURE__ */ e.jsx(
|
|
3315
|
-
|
|
3332
|
+
Ee,
|
|
3316
3333
|
{
|
|
3317
3334
|
title: i,
|
|
3318
|
-
onExit: () =>
|
|
3335
|
+
onExit: () => J()
|
|
3319
3336
|
}
|
|
3320
3337
|
),
|
|
3321
3338
|
/* @__PURE__ */ e.jsx(
|
|
3322
|
-
|
|
3339
|
+
ke,
|
|
3323
3340
|
{
|
|
3324
|
-
currentQuestion:
|
|
3325
|
-
phase:
|
|
3341
|
+
currentQuestion: c,
|
|
3342
|
+
phase: B.phase,
|
|
3326
3343
|
className: n,
|
|
3327
|
-
children:
|
|
3344
|
+
children: ie()
|
|
3328
3345
|
}
|
|
3329
3346
|
)
|
|
3330
3347
|
] }) });
|
|
3331
|
-
},
|
|
3348
|
+
}, si = ({
|
|
3332
3349
|
title: i,
|
|
3333
3350
|
interviewId: r,
|
|
3334
3351
|
onInterviewEnd: t,
|
|
3335
3352
|
onInterviewDisqualify: s,
|
|
3336
3353
|
className: n = ""
|
|
3337
3354
|
}) => {
|
|
3338
|
-
const [o, a] =
|
|
3355
|
+
const [o, a] = ge.useState(!1), [l, w] = ge.useState(!0), d = E(null);
|
|
3339
3356
|
return o ? /* @__PURE__ */ e.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ e.jsx(
|
|
3340
3357
|
"div",
|
|
3341
3358
|
{
|
|
3342
|
-
ref:
|
|
3359
|
+
ref: d,
|
|
3343
3360
|
className: `iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${n}`,
|
|
3344
3361
|
children: /* @__PURE__ */ e.jsx("div", { className: " iw-h-full iw-flex iw-flex-col", children: /* @__PURE__ */ e.jsx(
|
|
3345
|
-
|
|
3362
|
+
ri,
|
|
3346
3363
|
{
|
|
3347
3364
|
interviewTitle: i ?? "Interview",
|
|
3348
3365
|
interviewId: r,
|
|
@@ -3354,21 +3371,21 @@ const Jt = (i) => /* @__PURE__ */ e.jsxs(
|
|
|
3354
3371
|
) })
|
|
3355
3372
|
}
|
|
3356
3373
|
) }) : /* @__PURE__ */ e.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ e.jsx(
|
|
3357
|
-
|
|
3374
|
+
gt,
|
|
3358
3375
|
{
|
|
3359
3376
|
isOpen: l,
|
|
3360
3377
|
onStart: () => {
|
|
3361
|
-
a(!0),
|
|
3378
|
+
a(!0), w(!1);
|
|
3362
3379
|
}
|
|
3363
3380
|
}
|
|
3364
3381
|
) });
|
|
3365
3382
|
};
|
|
3366
3383
|
typeof window < "u" && (window.InterviewWidget = {
|
|
3367
|
-
InterviewWidget:
|
|
3368
|
-
InterviewWidgetProvider:
|
|
3384
|
+
InterviewWidget: si,
|
|
3385
|
+
InterviewWidgetProvider: nt
|
|
3369
3386
|
});
|
|
3370
3387
|
export {
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3388
|
+
si as InterviewWidget,
|
|
3389
|
+
nt as InterviewWidgetProvider,
|
|
3390
|
+
si as default
|
|
3374
3391
|
};
|