interview-widget 1.0.6 → 1.0.8

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 Be = Object.defineProperty;
2
- var We = (i, r, t) => r in i ? Be(i, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[r] = t;
3
- var F = (i, r, t) => We(i, typeof r != "symbol" ? r + "" : r, t);
4
- import fe, { createContext as Ce, useContext as ne, useSyncExternalStore as Se, useRef as E, useCallback as T, useMemo as ee, useState as k, useEffect as C, forwardRef as Ge, useImperativeHandle as Ve } from "react";
5
- import { createPortal as ze } from "react-dom";
6
- var Ie = { exports: {} }, ae = {};
1
+ var We = Object.defineProperty;
2
+ var Ge = (i, r, t) => r in i ? We(i, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[r] = t;
3
+ var F = (i, r, t) => Ge(i, typeof r != "symbol" ? r + "" : r, t);
4
+ import xe, { createContext as Se, useContext as ae, useSyncExternalStore as Ie, useRef as E, useCallback as T, useMemo as ee, useState as k, useEffect as C, forwardRef as Ve, useImperativeHandle as ze } from "react";
5
+ import { createPortal as He } from "react-dom";
6
+ var Re = { exports: {} }, oe = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.js
@@ -13,8 +13,8 @@ var Ie = { exports: {} }, ae = {};
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 He = Symbol.for("react.transitional.element"), Ye = Symbol.for("react.fragment");
17
- function Re(i, r, t) {
16
+ var Ye = Symbol.for("react.transitional.element"), Qe = Symbol.for("react.fragment");
17
+ function Ae(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,19 +22,19 @@ function Re(i, r, t) {
22
22
  n !== "key" && (t[n] = r[n]);
23
23
  } else t = r;
24
24
  return r = t.ref, {
25
- $$typeof: He,
25
+ $$typeof: Ye,
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
- ae.Fragment = Ye;
33
- ae.jsx = Re;
34
- ae.jsxs = Re;
35
- Ie.exports = ae;
36
- var e = Ie.exports;
37
- const he = {}, $ = {
32
+ oe.Fragment = Qe;
33
+ oe.jsx = Ae;
34
+ oe.jsxs = Ae;
35
+ Re.exports = oe;
36
+ var e = Re.exports;
37
+ const me = {}, $ = {
38
38
  api: {
39
39
  baseUrl: "/api",
40
40
  retryConfig: {
@@ -65,26 +65,26 @@ const he = {}, $ = {
65
65
  enabled: !0
66
66
  }
67
67
  }
68
- }, pe = "iw-storage";
69
- function Qe() {
70
- if (!(typeof import.meta < "u" && (he != null && he.VITE_IW_SECRET)))
68
+ }, be = "iw-storage";
69
+ function Ke() {
70
+ if (!(typeof import.meta < "u" && (me != null && me.VITE_IW_SECRET)))
71
71
  return 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";
72
72
  }
73
- const Ae = Qe(), be = "AES-GCM", xe = 12;
74
- async function Me(i) {
73
+ const Me = Ke(), ye = "AES-GCM", pe = 12;
74
+ async function De(i) {
75
75
  const t = new TextEncoder().encode(i), s = await crypto.subtle.digest("SHA-256", t);
76
- return crypto.subtle.importKey("raw", s, be, !1, [
76
+ return crypto.subtle.importKey("raw", s, ye, !1, [
77
77
  "encrypt",
78
78
  "decrypt"
79
79
  ]);
80
80
  }
81
- function Ke() {
82
- return crypto.getRandomValues(new Uint8Array(xe));
81
+ function Je() {
82
+ return crypto.getRandomValues(new Uint8Array(pe));
83
83
  }
84
- async function Je(i, r = "default-seed") {
84
+ async function Xe(i, r = "default-seed") {
85
85
  try {
86
- const t = typeof i == "string" ? i : JSON.stringify(i), n = new TextEncoder().encode(t), o = await Me(r), a = Ke(), l = await crypto.subtle.encrypt(
87
- { name: be, iv: a },
86
+ const t = typeof i == "string" ? i : JSON.stringify(i), n = new TextEncoder().encode(t), o = await De(r), a = Je(), l = await crypto.subtle.encrypt(
87
+ { name: ye, iv: a },
88
88
  o,
89
89
  n
90
90
  ), w = new Uint8Array(a.length + l.byteLength);
@@ -93,13 +93,13 @@ async function Je(i, r = "default-seed") {
93
93
  throw console.error("Encryption failed:", t), new Error("Failed to encrypt data");
94
94
  }
95
95
  }
96
- async function Xe(i, r = "default-seed") {
96
+ async function Ze(i, r = "default-seed") {
97
97
  try {
98
98
  const t = atob(i), s = new Uint8Array(t.length);
99
99
  for (let d = 0; d < t.length; d++)
100
100
  s[d] = t.charCodeAt(d);
101
- const n = s.slice(0, xe), o = s.slice(xe), a = await Me(r), l = await crypto.subtle.decrypt(
102
- { name: be, iv: n },
101
+ const n = s.slice(0, pe), o = s.slice(pe), a = await De(r), l = await crypto.subtle.decrypt(
102
+ { name: ye, iv: n },
103
103
  a,
104
104
  o
105
105
  );
@@ -108,23 +108,23 @@ async function Xe(i, r = "default-seed") {
108
108
  throw console.error("Decryption failed:", t), new Error("Failed to decrypt data");
109
109
  }
110
110
  }
111
- async function Ze(i, r = "default-seed") {
112
- return Je(i, r);
113
- }
114
111
  async function et(i, r = "default-seed") {
115
- const t = await Xe(i, r);
112
+ return Xe(i, r);
113
+ }
114
+ async function tt(i, r = "default-seed") {
115
+ const t = await Ze(i, r);
116
116
  try {
117
117
  return JSON.parse(t);
118
118
  } catch {
119
119
  return t;
120
120
  }
121
121
  }
122
- const oe = Ce(null), tt = async () => {
122
+ const le = Se(null), it = async () => {
123
123
  var i, r;
124
124
  try {
125
- const t = sessionStorage.getItem(pe);
125
+ const t = sessionStorage.getItem(be);
126
126
  if (t) {
127
- const s = await et(t, Ae);
127
+ const s = await tt(t, Me);
128
128
  return {
129
129
  logViolations: ((i = s.state) == null ? void 0 : i.logViolations) || [],
130
130
  totalViolations: ((r = s.state) == null ? void 0 : r.totalViolations) || 0
@@ -137,28 +137,28 @@ const oe = Ce(null), tt = async () => {
137
137
  );
138
138
  }
139
139
  return { logViolations: [], totalViolations: 0 };
140
- }, Ne = async (i) => {
140
+ }, ke = async (i) => {
141
141
  try {
142
- const r = await Ze(
142
+ const r = await et(
143
143
  {
144
144
  state: i,
145
145
  version: 0
146
146
  },
147
- Ae
147
+ Me
148
148
  );
149
- sessionStorage.setItem(pe, r);
149
+ sessionStorage.setItem(be, r);
150
150
  } catch (r) {
151
151
  console.error("Failed to save proctoring data to session storage:", r);
152
152
  }
153
- }, it = ({
153
+ }, rt = ({
154
154
  children: i
155
155
  }) => {
156
156
  const r = E({
157
157
  logViolations: [],
158
158
  totalViolations: 0
159
159
  }), t = E(/* @__PURE__ */ new Set());
160
- fe.useEffect(() => {
161
- tt().then((d) => {
160
+ xe.useEffect(() => {
161
+ it().then((d) => {
162
162
  r.current = d, s();
163
163
  });
164
164
  }, []);
@@ -171,14 +171,14 @@ const oe = Ce(null), tt = async () => {
171
171
  r.current = {
172
172
  logViolations: [...r.current.logViolations, d],
173
173
  totalViolations: r.current.totalViolations + 1
174
- }, Ne(r.current), s();
174
+ }, ke(r.current), s();
175
175
  },
176
176
  [s]
177
177
  ), l = T(() => {
178
178
  r.current = {
179
179
  logViolations: [],
180
180
  totalViolations: 0
181
- }, Ne(r.current), s();
181
+ }, ke(r.current), s();
182
182
  }, [s]), w = ee(
183
183
  () => ({
184
184
  getState: o,
@@ -188,29 +188,29 @@ const oe = Ce(null), tt = async () => {
188
188
  }),
189
189
  [o, a, l, n]
190
190
  );
191
- return /* @__PURE__ */ e.jsx(oe.Provider, { value: w, children: i });
192
- }, rt = () => {
193
- const i = ne(oe);
191
+ return /* @__PURE__ */ e.jsx(le.Provider, { value: w, children: i });
192
+ }, st = () => {
193
+ const i = ae(le);
194
194
  if (!i)
195
195
  throw new Error("useViolations must be used within a ProctoringProvider");
196
- return Se(
196
+ return Ie(
197
197
  i.subscribe,
198
198
  () => i.getState().logViolations,
199
199
  () => i.getState().logViolations
200
200
  );
201
- }, st = () => {
202
- const i = ne(oe);
201
+ }, nt = () => {
202
+ const i = ae(le);
203
203
  if (!i)
204
204
  throw new Error(
205
205
  "useTotalViolations must be used within a ProctoringProvider"
206
206
  );
207
- return Se(
207
+ return Ie(
208
208
  i.subscribe,
209
209
  () => i.getState().totalViolations,
210
210
  () => i.getState().totalViolations
211
211
  );
212
- }, nt = () => {
213
- const i = ne(oe);
212
+ }, at = () => {
213
+ const i = ae(le);
214
214
  if (!i)
215
215
  throw new Error(
216
216
  "useProctoringActions must be used within a ProctoringProvider"
@@ -219,10 +219,10 @@ const oe = Ce(null), tt = async () => {
219
219
  addViolation: i.addViolation,
220
220
  clearViolations: i.clearViolations
221
221
  };
222
- }, De = Ce(
222
+ }, _e = Se(
223
223
  null
224
224
  );
225
- function at({
225
+ function ot({
226
226
  config: i = {},
227
227
  children: r
228
228
  }) {
@@ -257,10 +257,10 @@ function at({
257
257
  }
258
258
  }
259
259
  };
260
- return /* @__PURE__ */ e.jsx(De.Provider, { value: t, children: /* @__PURE__ */ e.jsx(it, { children: r }) });
260
+ return /* @__PURE__ */ e.jsx(_e.Provider, { value: t, children: /* @__PURE__ */ e.jsx(rt, { children: r }) });
261
261
  }
262
- function le() {
263
- const i = ne(De);
262
+ function ce() {
263
+ const i = ae(_e);
264
264
  if (!i)
265
265
  throw new Error(
266
266
  "useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>"
@@ -268,15 +268,15 @@ function le() {
268
268
  return i;
269
269
  }
270
270
  function Pe() {
271
- return le().api || $.api;
271
+ return ce().api || $.api;
272
272
  }
273
273
  function te() {
274
- return le().ui || $.ui;
274
+ return ce().ui || $.ui;
275
275
  }
276
- function ot() {
277
- return le().interview || $.interview;
276
+ function lt() {
277
+ return ce().interview || $.interview;
278
278
  }
279
- const _e = ({
279
+ const Fe = ({
280
280
  className: i,
281
281
  ...r
282
282
  }) => /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(
@@ -305,7 +305,7 @@ const _e = ({
305
305
  /* @__PURE__ */ e.jsx("path", { d: "M7.75 7.75l-2.15 -2.15" })
306
306
  ]
307
307
  }
308
- ) }), Fe = ({
308
+ ) }), Le = ({
309
309
  children: i,
310
310
  variant: r = "primary",
311
311
  size: t = "md",
@@ -333,13 +333,13 @@ const _e = ({
333
333
  disabled: o || n,
334
334
  ...l,
335
335
  children: [
336
- n && /* @__PURE__ */ e.jsx(_e, { height: 16, width: 16, style: { marginRight: "3px" } }),
336
+ n && /* @__PURE__ */ e.jsx(Fe, { height: 16, width: 16, style: { marginRight: "3px" } }),
337
337
  i
338
338
  ]
339
339
  }
340
340
  );
341
341
  };
342
- function lt(i) {
342
+ function ct(i) {
343
343
  const r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);
344
344
  return r ? {
345
345
  r: parseInt(r[1], 16),
@@ -347,32 +347,32 @@ function lt(i) {
347
347
  b: parseInt(r[3], 16)
348
348
  } : null;
349
349
  }
350
- function ct(i, r, t) {
350
+ function dt(i, r, t) {
351
351
  return "#" + [i, r, t].map((s) => {
352
352
  const n = Math.round(s).toString(16);
353
353
  return n.length === 1 ? "0" + n : n;
354
354
  }).join("");
355
355
  }
356
- function Le(i, r) {
357
- const t = lt(i);
356
+ function $e(i, r) {
357
+ const t = ct(i);
358
358
  if (!t) return i;
359
359
  const s = t.r + (255 - t.r) * r, n = t.g + (255 - t.g) * r, o = t.b + (255 - t.b) * r;
360
- return ct(s, n, o);
360
+ return dt(s, n, o);
361
361
  }
362
- function dt(i, r = 0.8) {
362
+ function wt(i, r = 0.8) {
363
363
  return {
364
- background: `linear-gradient(to bottom, ${Le(i, r)}, #ffffff)`,
364
+ background: `linear-gradient(to bottom, ${$e(i, r)}, #ffffff)`,
365
365
  color: "#1f2937"
366
366
  };
367
367
  }
368
- function wt(i) {
368
+ function ut(i) {
369
369
  return new Promise((r) => setTimeout(r, i));
370
370
  }
371
- function $e(i) {
372
- return `linear-gradient(to left, ${Le(i, 0.4)}, ${i})`;
371
+ function Oe(i) {
372
+ return `linear-gradient(to left, ${$e(i, 0.4)}, ${i})`;
373
373
  }
374
- const ut = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
375
- function ht(i) {
374
+ const ht = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
375
+ function mt(i) {
376
376
  try {
377
377
  const r = i.split(".");
378
378
  if (r.length !== 3 || !r[1])
@@ -386,7 +386,7 @@ function ht(i) {
386
386
  return console.error("Error decoding JWT:", r), null;
387
387
  }
388
388
  }
389
- const Oe = (i) => /* @__PURE__ */ e.jsxs(
389
+ const qe = (i) => /* @__PURE__ */ e.jsxs(
390
390
  "svg",
391
391
  {
392
392
  xmlns: "http://www.w3.org/2000/svg",
@@ -423,7 +423,7 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
423
423
  /* @__PURE__ */ e.jsx("line", { x1: "12", x2: "12", y1: "17", y2: "21" })
424
424
  ]
425
425
  }
426
- ), mt = (i) => /* @__PURE__ */ e.jsxs(
426
+ ), gt = (i) => /* @__PURE__ */ e.jsxs(
427
427
  "svg",
428
428
  {
429
429
  xmlns: "http://www.w3.org/2000/svg",
@@ -445,29 +445,29 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
445
445
  ), V = (i) => {
446
446
  const { baseColor: r, borderRadius: t } = te(), { loading: s, children: n, ...o } = i;
447
447
  return /* @__PURE__ */ e.jsx(
448
- Fe,
448
+ Le,
449
449
  {
450
450
  style: {
451
- background: $e(r),
451
+ background: Oe(r),
452
452
  borderRadius: t
453
453
  },
454
454
  ...o,
455
- children: s ? /* @__PURE__ */ e.jsx(_e, {}) : n
455
+ children: s ? /* @__PURE__ */ e.jsx(Fe, {}) : n
456
456
  }
457
457
  );
458
- }, gt = [
458
+ }, ft = [
459
459
  "Do not refresh or reload the page during your assessment",
460
460
  "Refrain from switching tabs or opening other applications while the session is in progress",
461
461
  "Ensure your face remains clearly visible on camera at all times",
462
462
  "Avoid frequent distractions or leaving your seat during the session",
463
463
  "Do not disable or interfere with audio/video monitoring"
464
- ], ft = ({
464
+ ], xt = ({
465
465
  isOpen: i,
466
466
  onStart: r,
467
467
  onClose: t
468
468
  }) => {
469
469
  var A;
470
- 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 = $e(c), b = a ?? 18, j = (f, M) => f.startsWith("#") && f.length === 7 ? `${f}${M}` : f, g = [
470
+ 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 = Oe(c), p = a ?? 18, j = (f, M) => f.startsWith("#") && f.length === 7 ? `${f}${M}` : f, g = [
471
471
  `radial-gradient(120% 85% at 50% 125%, ${j(
472
472
  c,
473
473
  "34"
@@ -487,7 +487,7 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
487
487
  c,
488
488
  "14"
489
489
  )} 16px, transparent 16px, transparent 32px)`
490
- ].join(", "), v = l ? {
490
+ ].join(", "), y = l ? {
491
491
  label: "Camera & microphone ready",
492
492
  toneClass: "iw-bg-white/15 iw-text-white",
493
493
  dotClass: "iw-bg-emerald-400"
@@ -527,11 +527,11 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
527
527
  description: S.micCopy,
528
528
  status: S.badge,
529
529
  toneClass: S.toneClass,
530
- Icon: mt
530
+ Icon: gt
531
531
  }
532
- ], P = () => {
532
+ ], _ = () => {
533
533
  n.current && (n.current.getTracks().forEach((f) => f.stop()), n.current = null);
534
- }, y = async () => {
534
+ }, v = async () => {
535
535
  m(!0), u(null);
536
536
  try {
537
537
  const f = await navigator.mediaDevices.getUserMedia({
@@ -549,15 +549,15 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
549
549
  };
550
550
  if (C(() => {
551
551
  if (!i) {
552
- P();
552
+ _();
553
553
  return;
554
554
  }
555
- return y(), () => {
556
- P();
555
+ return v(), () => {
556
+ _();
557
557
  };
558
558
  }, [i]), !i) return null;
559
559
  const R = () => {
560
- r(), P();
560
+ r(), _();
561
561
  };
562
562
  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: [
563
563
  /* @__PURE__ */ e.jsxs(
@@ -598,7 +598,7 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
598
598
  ),
599
599
  /* @__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: [
600
600
  /* @__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: [
601
- /* @__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(Oe, { className: "iw-h-6 iw-w-6" }) }),
601
+ /* @__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(qe, { className: "iw-h-6 iw-w-6" }) }),
602
602
  /* @__PURE__ */ e.jsxs("div", { children: [
603
603
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-white/70", children: "Pre-interview checklist" }),
604
604
  /* @__PURE__ */ e.jsx("h2", { className: "iw-mt-1 iw-text-xl iw-font-semibold iw-leading-tight", children: "Final checks before you go live" }),
@@ -608,15 +608,15 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
608
608
  /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-items-start iw-justify-end", children: /* @__PURE__ */ e.jsxs(
609
609
  "div",
610
610
  {
611
- 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
+ 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 ${y.toneClass}`,
612
612
  children: [
613
613
  /* @__PURE__ */ e.jsx(
614
614
  "span",
615
615
  {
616
- className: `iw-inline-flex iw-h-2 iw-w-2 iw-rounded-full ${v.dotClass}`
616
+ className: `iw-inline-flex iw-h-2 iw-w-2 iw-rounded-full ${y.dotClass}`
617
617
  }
618
618
  ),
619
- v.label
619
+ y.label
620
620
  ]
621
621
  }
622
622
  ) }),
@@ -626,7 +626,7 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
626
626
  "aria-label": "Close",
627
627
  className: "iw-absolute iw-top-5 iw-right-5 iw-text-white/70 transition-colors hover:iw-text-white",
628
628
  onClick: () => {
629
- P(), t == null || t();
629
+ _(), t == null || t();
630
630
  },
631
631
  children: "✕"
632
632
  }
@@ -642,7 +642,7 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
642
642
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-sm iw-font-semibold iw-text-slate-900", children: "Proctoring guidelines" }),
643
643
  /* @__PURE__ */ e.jsx("span", { className: "iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-slate-400", children: "Required" })
644
644
  ] }),
645
- /* @__PURE__ */ e.jsx("ul", { className: "iw-mt-5 iw-flex iw-flex-col iw-gap-4", children: gt.map((f, M) => /* @__PURE__ */ e.jsx(
645
+ /* @__PURE__ */ e.jsx("ul", { className: "iw-mt-5 iw-flex iw-flex-col iw-gap-4", children: ft.map((f, M) => /* @__PURE__ */ e.jsx(
646
646
  "li",
647
647
  {
648
648
  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",
@@ -666,7 +666,7 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
666
666
  "div",
667
667
  {
668
668
  className: "iw-relative iw-flex iw-flex-col iw-gap-6 iw-overflow-hidden iw-rounded-3xl iw-bg-white ",
669
- style: { borderRadius: b },
669
+ style: { borderRadius: p },
670
670
  children: [
671
671
  /* @__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(
672
672
  "video",
@@ -678,22 +678,22 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
678
678
  className: "iw-h-64 iw-w-full iw-rounded-2xl iw-object-cover",
679
679
  style: {
680
680
  transform: "scaleX(-1)",
681
- borderRadius: b
681
+ borderRadius: p
682
682
  }
683
683
  }
684
684
  ) }),
685
685
  /* @__PURE__ */ e.jsxs("div", { className: "iw-relative iw-grid iw-grid-cols-2 iw-gap-4 iw-px-1", children: [
686
686
  /* @__PURE__ */ e.jsx(
687
- Fe,
687
+ Le,
688
688
  {
689
- onClick: y,
689
+ onClick: v,
690
690
  disabled: h,
691
691
  variant: "outline",
692
692
  size: "sm",
693
693
  className: "iw-font-medium",
694
694
  style: {
695
695
  borderColor: c,
696
- borderRadius: b,
696
+ borderRadius: p,
697
697
  color: c
698
698
  },
699
699
  children: l ? "Recheck permissions" : "Enable camera & mic"
@@ -716,7 +716,7 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
716
716
  }
717
717
  ),
718
718
  /* @__PURE__ */ e.jsx("ul", { className: "iw-grid sm:iw-grid-cols-1 iw-gap-3", children: N.map(
719
- ({ Icon: f, label: M, description: L, status: O, toneClass: q }) => /* @__PURE__ */ e.jsx(
719
+ ({ Icon: f, label: M, description: L, status: O, toneClass: U }) => /* @__PURE__ */ e.jsx(
720
720
  "li",
721
721
  {
722
722
  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",
@@ -728,7 +728,7 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
728
728
  /* @__PURE__ */ e.jsx(
729
729
  "span",
730
730
  {
731
- className: `iw-rounded-full iw-px-3 iw-py-1 iw-text-[11px] iw-font-semibold ${q}`,
731
+ className: `iw-rounded-full iw-px-3 iw-py-1 iw-text-[11px] iw-font-semibold ${U}`,
732
732
  children: O
733
733
  }
734
734
  )
@@ -766,11 +766,11 @@ const Oe = (i) => /* @__PURE__ */ e.jsxs(
766
766
  ] }) });
767
767
  };
768
768
  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 || {});
769
- const xt = {
769
+ const pt = {
770
770
  thinkingDuration: 30,
771
771
  answeringDuration: 120,
772
772
  editingDuration: 30
773
- }, pt = {
773
+ }, bt = {
774
774
  idle: {
775
775
  next: "fetching_question"
776
776
  /* FETCHING_QUESTION */
@@ -799,14 +799,14 @@ const xt = {
799
799
  /* COMPLETED */
800
800
  }
801
801
  };
802
- class bt {
802
+ class yt {
803
803
  constructor(r = {}, t = {}) {
804
804
  F(this, "config");
805
805
  F(this, "state");
806
806
  F(this, "phaseIntervalId", null);
807
807
  F(this, "globalIntervalId", null);
808
808
  F(this, "callbacks");
809
- this.config = { ...xt, ...r }, this.callbacks = t, this.state = {
809
+ this.config = { ...pt, ...r }, this.callbacks = t, this.state = {
810
810
  phase: "idle",
811
811
  currentPhaseTimeRemaining: 0,
812
812
  totalTimeElapsed: 0,
@@ -829,7 +829,7 @@ class bt {
829
829
  * Move to next phase
830
830
  */
831
831
  nextPhase() {
832
- const r = this.state.phase, t = pt[r];
832
+ const r = this.state.phase, t = bt[r];
833
833
  if (!t) return;
834
834
  this.stopPhaseTimer(), this.state.phase = t.next;
835
835
  const s = this.getDurationForPhase(t.next);
@@ -900,9 +900,9 @@ class bt {
900
900
  (t = (r = this.callbacks).onPhaseChange) == null || t.call(r, this.state.phase, this.getState());
901
901
  }
902
902
  }
903
- function yt(i = {}) {
903
+ function vt(i = {}) {
904
904
  const { config: r = {}, callbacks: t = {} } = i, s = E(null);
905
- s.current || (s.current = new bt(r, {}));
905
+ s.current || (s.current = new yt(r, {}));
906
906
  const n = s.current, [o, a] = k(n.getState()), l = T(() => {
907
907
  a(n.getState());
908
908
  }, [n]);
@@ -940,7 +940,7 @@ function yt(i = {}) {
940
940
  timerService: n
941
941
  };
942
942
  }
943
- function vt(i, r = {}) {
943
+ function jt(i, r = {}) {
944
944
  const [t, s] = k({
945
945
  data: null,
946
946
  loading: !1,
@@ -979,17 +979,17 @@ function vt(i, r = {}) {
979
979
  execute: n
980
980
  };
981
981
  }
982
- const jt = (i) => {
982
+ const Nt = (i) => {
983
983
  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) => {
984
984
  var x;
985
985
  try {
986
986
  if (!a())
987
987
  throw new Error("Fullscreen is not supported in this environment");
988
988
  c.requestFullscreen ? await c.requestFullscreen() : c.webkitRequestFullscreen ? await c.webkitRequestFullscreen() : c.mozRequestFullScreen ? await c.mozRequestFullScreen() : c.msRequestFullscreen && await c.msRequestFullscreen();
989
- } catch (b) {
989
+ } catch (p) {
990
990
  const j = {
991
991
  name: "FullscreenError",
992
- message: b instanceof Error ? b.message : "Failed to enter fullscreen"
992
+ message: p instanceof Error ? p.message : "Failed to enter fullscreen"
993
993
  };
994
994
  t(j), (x = i == null ? void 0 : i.onError) == null || x.call(i, j);
995
995
  }
@@ -998,11 +998,11 @@ const jt = (i) => {
998
998
  try {
999
999
  o.exitFullscreen ? await o.exitFullscreen() : o.webkitExitFullscreen ? await o.webkitExitFullscreen() : o.mozCancelFullScreen ? await o.mozCancelFullScreen() : o.msExitFullscreen && await o.msExitFullscreen();
1000
1000
  } catch (x) {
1001
- const b = {
1001
+ const p = {
1002
1002
  name: "FullscreenError",
1003
1003
  message: x instanceof Error ? x.message : "Failed to exit fullscreen"
1004
1004
  };
1005
- t(b), (c = i == null ? void 0 : i.onError) == null || c.call(i, b);
1005
+ t(p), (c = i == null ? void 0 : i.onError) == null || c.call(i, p);
1006
1006
  }
1007
1007
  }, u = T(() => {
1008
1008
  var x;
@@ -1039,7 +1039,7 @@ const jt = (i) => {
1039
1039
  error: r
1040
1040
  };
1041
1041
  };
1042
- function Nt(i) {
1042
+ function kt(i) {
1043
1043
  var r;
1044
1044
  if (!navigator.onLine)
1045
1045
  return {
@@ -1098,7 +1098,7 @@ function Nt(i) {
1098
1098
  originalError: i
1099
1099
  };
1100
1100
  }
1101
- async function ye(i, r = {}, t = {
1101
+ async function ve(i, r = {}, t = {
1102
1102
  attempts: 3,
1103
1103
  backoff: "exponential",
1104
1104
  baseDelay: 1e3,
@@ -1119,10 +1119,10 @@ async function ye(i, r = {}, t = {
1119
1119
  return l;
1120
1120
  } catch (o) {
1121
1121
  s = o;
1122
- const a = Nt(o);
1122
+ const a = kt(o);
1123
1123
  if (!a.retryable || n === t.attempts)
1124
1124
  throw a;
1125
- const l = kt(n, t);
1125
+ const l = Et(n, t);
1126
1126
  console.warn(
1127
1127
  `API request failed (attempt ${n}/${t.attempts}), retrying in ${l}ms:`,
1128
1128
  a.message
@@ -1130,11 +1130,11 @@ async function ye(i, r = {}, t = {
1130
1130
  }
1131
1131
  throw s;
1132
1132
  }
1133
- function kt(i, r) {
1133
+ function Et(i, r) {
1134
1134
  let t;
1135
1135
  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);
1136
1136
  }
1137
- class Et {
1137
+ class Tt {
1138
1138
  constructor(r = {}) {
1139
1139
  F(this, "config");
1140
1140
  this.config = r;
@@ -1173,7 +1173,7 @@ class Et {
1173
1173
  answer: o,
1174
1174
  answerDuration: a
1175
1175
  }) {
1176
- const l = await ye(
1176
+ const l = await ve(
1177
1177
  `${this.getBaseUrl()}/questions/next`,
1178
1178
  {
1179
1179
  method: "POST",
@@ -1194,14 +1194,14 @@ class Et {
1194
1194
  return await l.json();
1195
1195
  }
1196
1196
  }
1197
- function Tt() {
1198
- const i = le();
1197
+ function Ct() {
1198
+ const i = ce();
1199
1199
  return ee(() => {
1200
1200
  const t = i.api || {};
1201
- return new Et(t);
1201
+ return new Tt(t);
1202
1202
  }, [i.api]);
1203
1203
  }
1204
- const Ct = (i) => {
1204
+ const St = (i) => {
1205
1205
  C(() => {
1206
1206
  const r = (s) => {
1207
1207
  (s.ctrlKey || s.metaKey) && ["c", "v", "a", "t", "n", "w", "r", "s", "p"].includes(s.key.toLowerCase()) && (s.preventDefault(), i({
@@ -1246,7 +1246,7 @@ class I extends Error {
1246
1246
  super(r), this.code = t, this.recoverable = s, this.name = "STTError";
1247
1247
  }
1248
1248
  }
1249
- class St {
1249
+ class It {
1250
1250
  constructor(r = {}) {
1251
1251
  F(this, "config");
1252
1252
  F(this, "mediaRecorder", null);
@@ -1393,8 +1393,8 @@ class St {
1393
1393
  const l = new FormData(), w = new File([t], "recording.wav", {
1394
1394
  type: t.type || "audio/wav"
1395
1395
  });
1396
- 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));
1397
- const d = await ye(
1396
+ 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)), l.append("qna_id", this.config.qnaId || "");
1397
+ const d = await ve(
1398
1398
  `${this.config.baseUrl}/speech/transcribe`,
1399
1399
  {
1400
1400
  method: "POST",
@@ -1476,13 +1476,13 @@ class St {
1476
1476
  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);
1477
1477
  }
1478
1478
  }
1479
- const Z = new St(), It = (i = {}) => {
1479
+ const Z = new It(), Rt = (i = {}) => {
1480
1480
  const [r, t] = k(!1), [s, n] = k(!1), [o, a] = k(null), [l, w] = k(null), [d, u] = k(null);
1481
1481
  i.config && Z.updateConfig(i.config);
1482
- const h = T(async (b) => {
1482
+ const h = T(async (p) => {
1483
1483
  var j;
1484
1484
  try {
1485
- w(null), a(null), u(null), await Z.startRecording(b, {
1485
+ w(null), a(null), u(null), await Z.startRecording(p, {
1486
1486
  onStart: () => {
1487
1487
  var g;
1488
1488
  t(!0), (g = i.onStart) == null || g.call(i);
@@ -1493,38 +1493,38 @@ const Z = new St(), It = (i = {}) => {
1493
1493
  },
1494
1494
  onError: (g) => {
1495
1495
  var S;
1496
- const v = g instanceof I ? g : new I(g.message, "RECORDING_ERROR", !0);
1497
- w(v), t(!1), (S = i.onError) == null || S.call(i, v);
1496
+ const y = g instanceof I ? g : new I(g.message, "RECORDING_ERROR", !0);
1497
+ w(y), t(!1), (S = i.onError) == null || S.call(i, y);
1498
1498
  }
1499
1499
  });
1500
1500
  } catch (g) {
1501
- const v = g instanceof I ? g : new I(
1501
+ const y = g instanceof I ? g : new I(
1502
1502
  g instanceof Error ? g.message : String(g),
1503
1503
  "START_FAILED",
1504
1504
  !1
1505
1505
  );
1506
- throw w(v), t(!1), (j = i.onError) == null || j.call(i, v), v;
1506
+ throw w(y), t(!1), (j = i.onError) == null || j.call(i, y), y;
1507
1507
  }
1508
1508
  }, []), m = T(async () => {
1509
- var b, j;
1509
+ var p, j;
1510
1510
  try {
1511
1511
  const g = await Z.stopRecording();
1512
- return u(g), t(!1), (b = i.onStop) == null || b.call(i), g;
1512
+ return u(g), t(!1), (p = i.onStop) == null || p.call(i), g;
1513
1513
  } catch (g) {
1514
- const v = g instanceof I ? g : new I(
1514
+ const y = g instanceof I ? g : new I(
1515
1515
  g instanceof Error ? g.message : String(g),
1516
1516
  "STOP_FAILED",
1517
1517
  !1
1518
1518
  );
1519
- throw w(v), t(!1), (j = i.onError) == null || j.call(i, v), v;
1519
+ throw w(y), t(!1), (j = i.onError) == null || j.call(i, y), y;
1520
1520
  }
1521
1521
  }, []), c = T(
1522
- async (b, j = {}) => {
1523
- var g, v;
1522
+ async (p, j = {}) => {
1523
+ var g, y;
1524
1524
  try {
1525
1525
  w(null), n(!0);
1526
1526
  const S = {
1527
- audioBlob: b,
1527
+ audioBlob: p,
1528
1528
  ...j
1529
1529
  }, N = await Z.transcribe(S);
1530
1530
  return a(N.transcript), n(!1), (g = i.onTranscriptionComplete) == null || g.call(i, N), N;
@@ -1534,7 +1534,7 @@ const Z = new St(), It = (i = {}) => {
1534
1534
  "TRANSCRIPTION_FAILED",
1535
1535
  !0
1536
1536
  );
1537
- throw w(N), n(!1), (v = i.onError) == null || v.call(i, N), N;
1537
+ throw w(N), n(!1), (y = i.onError) == null || y.call(i, N), N;
1538
1538
  }
1539
1539
  },
1540
1540
  []
@@ -1552,7 +1552,7 @@ const Z = new St(), It = (i = {}) => {
1552
1552
  error: l,
1553
1553
  audioBlob: d
1554
1554
  };
1555
- }, Rt = (i) => {
1555
+ }, At = (i) => {
1556
1556
  const r = E(null), t = E(!1);
1557
1557
  C(() => {
1558
1558
  const s = () => {
@@ -1582,7 +1582,7 @@ const Z = new St(), It = (i = {}) => {
1582
1582
  document.removeEventListener("visibilitychange", s), window.removeEventListener("blur", n), r.current && clearTimeout(r.current);
1583
1583
  };
1584
1584
  }, [i]);
1585
- }, At = () => {
1585
+ }, Mt = () => {
1586
1586
  C(() => {
1587
1587
  const i = document.createElement("style");
1588
1588
  return i.textContent = `
@@ -1603,7 +1603,7 @@ const Z = new St(), It = (i = {}) => {
1603
1603
  };
1604
1604
  }, []);
1605
1605
  };
1606
- class Mt {
1606
+ class Dt {
1607
1607
  constructor(r = {}) {
1608
1608
  F(this, "config");
1609
1609
  F(this, "currentAudio", null);
@@ -1631,7 +1631,7 @@ class Mt {
1631
1631
  speed: n = this.config.speed
1632
1632
  } = r, o = new URLSearchParams();
1633
1633
  o.append("text", t), o.append("voice", s || "string"), o.append("speed", (n == null ? void 0 : n.toString()) || "1");
1634
- const a = await ye(
1634
+ const a = await ve(
1635
1635
  `${this.config.baseUrl}/speech/synthesize`,
1636
1636
  {
1637
1637
  method: "POST",
@@ -1714,9 +1714,9 @@ class Mt {
1714
1714
  return this.currentAudio !== null && !this.currentAudio.paused;
1715
1715
  }
1716
1716
  }
1717
- const me = new Mt(), Dt = (i = {}) => {
1717
+ const ge = new Dt(), _t = (i = {}) => {
1718
1718
  const [r, t] = k(!1), [s, n] = k(!1), [o, a] = k(null);
1719
- i.config && me.updateConfig(i.config);
1719
+ i.config && ge.updateConfig(i.config);
1720
1720
  const l = T(
1721
1721
  async (d, u = {}) => {
1722
1722
  var h;
@@ -1726,7 +1726,7 @@ const me = new Mt(), Dt = (i = {}) => {
1726
1726
  text: d,
1727
1727
  ...u
1728
1728
  };
1729
- await me.speak(m, {
1729
+ await ge.speak(m, {
1730
1730
  onStart: () => {
1731
1731
  var c;
1732
1732
  n(!1), t(!0), (c = i.onStart) == null || c.call(i);
@@ -1747,7 +1747,7 @@ const me = new Mt(), Dt = (i = {}) => {
1747
1747
  },
1748
1748
  [i]
1749
1749
  ), w = T(() => {
1750
- me.stop(), t(!1), n(!1);
1750
+ ge.stop(), t(!1), n(!1);
1751
1751
  }, []);
1752
1752
  return {
1753
1753
  speak: l,
@@ -1761,7 +1761,7 @@ const me = new Mt(), Dt = (i = {}) => {
1761
1761
  onEnd: r,
1762
1762
  maxViolations: t = 5
1763
1763
  }) => {
1764
- const { addViolation: s } = nt(), n = rt(), o = st(), a = E(o);
1764
+ const { addViolation: s } = at(), n = st(), o = nt(), a = E(o);
1765
1765
  C(() => {
1766
1766
  a.current = o;
1767
1767
  }, [o]);
@@ -1775,7 +1775,7 @@ const me = new Mt(), Dt = (i = {}) => {
1775
1775
  logViolation: T(
1776
1776
  ({ type: d, severity: u, details: h }) => {
1777
1777
  const m = {
1778
- id: ut(),
1778
+ id: ht(),
1779
1779
  type: d,
1780
1780
  severity: u,
1781
1781
  details: h,
@@ -1791,7 +1791,7 @@ const me = new Mt(), Dt = (i = {}) => {
1791
1791
  violationCount: o,
1792
1792
  logList: n
1793
1793
  };
1794
- }, _t = () => {
1794
+ }, Ft = () => {
1795
1795
  C(() => {
1796
1796
  function i() {
1797
1797
  console.clear(), console.log(
@@ -1873,7 +1873,7 @@ const me = new Mt(), Dt = (i = {}) => {
1873
1873
  clearInterval(s), document.removeEventListener("keydown", n), document.removeEventListener("contextmenu", o), delete window.showStats, delete window.interviewTips;
1874
1874
  };
1875
1875
  }, []);
1876
- }, ve = (i) => /* @__PURE__ */ e.jsxs(
1876
+ }, je = (i) => /* @__PURE__ */ e.jsxs(
1877
1877
  "svg",
1878
1878
  {
1879
1879
  xmlns: "http://www.w3.org/2000/svg",
@@ -1895,10 +1895,10 @@ const me = new Mt(), Dt = (i = {}) => {
1895
1895
  /* @__PURE__ */ e.jsx("path", { d: "M8.644 21.42a10 10 0 0 0 7.631-.38" })
1896
1896
  ]
1897
1897
  }
1898
- ), Ft = (i, r, t) => Math.max(r, Math.min(t, i)), ke = (i) => {
1898
+ ), Lt = (i, r, t) => Math.max(r, Math.min(t, i)), Ee = (i) => {
1899
1899
  const r = Math.max(0, Math.floor(i)), t = Math.floor(r / 60).toString().padStart(2, "0"), s = (r % 60).toString().padStart(2, "0");
1900
1900
  return `${t}:${s}`;
1901
- }, je = ({
1901
+ }, Ne = ({
1902
1902
  total: i,
1903
1903
  remaining: r,
1904
1904
  size: t = 64,
@@ -1906,16 +1906,16 @@ const me = new Mt(), Dt = (i = {}) => {
1906
1906
  className: n = "",
1907
1907
  showLabel: o = !0
1908
1908
  }) => {
1909
- const a = Math.max(1, i || 1), l = Ft(r / a, 0, 1), { radius: w, circumference: d, dashOffset: u, center: h } = ee(() => {
1910
- 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);
1911
- return { radius: x, circumference: b, dashOffset: j, center: v };
1909
+ const a = Math.max(1, i || 1), l = Lt(r / a, 0, 1), { radius: w, circumference: d, dashOffset: u, center: h } = ee(() => {
1910
+ const x = (t - s) / 2, p = 2 * Math.PI * x, j = p * (1 - l), g = Math.round(s) % 2 === 1, y = t / 2 + (g ? 0.5 : 0);
1911
+ return { radius: x, circumference: p, dashOffset: j, center: y };
1912
1912
  }, [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" : "";
1913
1913
  return /* @__PURE__ */ e.jsxs(
1914
1914
  "div",
1915
1915
  {
1916
1916
  className: `iw-relative iw-inline-flex iw-items-center iw-justify-center iw-rounded-full iw-bg-white ${n}`,
1917
1917
  style: { width: t, height: t },
1918
- "aria-label": `Time remaining ${ke(r)}`,
1918
+ "aria-label": `Time remaining ${Ee(r)}`,
1919
1919
  role: "timer",
1920
1920
  "aria-live": "polite",
1921
1921
  children: [
@@ -1966,13 +1966,13 @@ const me = new Mt(), Dt = (i = {}) => {
1966
1966
  "span",
1967
1967
  {
1968
1968
  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"}`,
1969
- children: ke(r)
1969
+ children: Ee(r)
1970
1970
  }
1971
1971
  ) })
1972
1972
  ]
1973
1973
  }
1974
1974
  );
1975
- }, Lt = ({
1975
+ }, $t = ({
1976
1976
  label: i,
1977
1977
  error: r,
1978
1978
  fullWidth: t = !1,
@@ -2007,7 +2007,7 @@ const me = new Mt(), Dt = (i = {}) => {
2007
2007
  ]
2008
2008
  }
2009
2009
  );
2010
- }, $t = ({
2010
+ }, Ot = ({
2011
2011
  value: i,
2012
2012
  onChange: r,
2013
2013
  onSubmit: t,
@@ -2023,11 +2023,11 @@ const me = new Mt(), Dt = (i = {}) => {
2023
2023
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Your Answer" }),
2024
2024
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
2025
2025
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
2026
- /* @__PURE__ */ e.jsx(ve, { className: "iw-size-4 iw-text-orange-600" }),
2026
+ /* @__PURE__ */ e.jsx(je, { className: "iw-size-4 iw-text-orange-600" }),
2027
2027
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to edit: " })
2028
2028
  ] }),
2029
2029
  /* @__PURE__ */ e.jsx(
2030
- je,
2030
+ Ne,
2031
2031
  {
2032
2032
  total: o,
2033
2033
  remaining: n.currentPhaseTimeRemaining,
@@ -2039,7 +2039,7 @@ const me = new Mt(), Dt = (i = {}) => {
2039
2039
  ] }),
2040
2040
  /* @__PURE__ */ e.jsxs("div", { className: " iw-overflow-hidden iw-flex iw-flex-col iw-h-full iw-mt-2", children: [
2041
2041
  /* @__PURE__ */ e.jsx(
2042
- Lt,
2042
+ $t,
2043
2043
  {
2044
2044
  value: i,
2045
2045
  onChange: r,
@@ -2056,9 +2056,9 @@ const me = new Mt(), Dt = (i = {}) => {
2056
2056
  /* @__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" }) })
2057
2057
  ] })
2058
2058
  ] });
2059
- }, Ot = ({ className: i = "" }) => {
2059
+ }, qt = ({ className: i = "" }) => {
2060
2060
  var n;
2061
- const { authToken: r } = Pe(), t = r ? ht(r) : null, s = E(null);
2061
+ const { authToken: r } = Pe(), t = r ? mt(r) : null, s = E(null);
2062
2062
  return C(() => {
2063
2063
  let o = null;
2064
2064
  return (async () => {
@@ -2102,7 +2102,7 @@ const me = new Mt(), Dt = (i = {}) => {
2102
2102
  "div",
2103
2103
  {
2104
2104
  className: "iw-rounded-xl iw-mb-4 message-animation iw-text-gray-800 iw-p-6 ",
2105
- style: dt(t, 0.85),
2105
+ style: wt(t, 0.85),
2106
2106
  children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-8", children: [
2107
2107
  /* @__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(
2108
2108
  "img",
@@ -2119,7 +2119,7 @@ const me = new Mt(), Dt = (i = {}) => {
2119
2119
  ] })
2120
2120
  }
2121
2121
  );
2122
- }, Ee = ({
2122
+ }, Te = ({
2123
2123
  currentQuestion: i,
2124
2124
  phase: r,
2125
2125
  className: t = "",
@@ -2137,12 +2137,12 @@ const me = new Mt(), Dt = (i = {}) => {
2137
2137
  }
2138
2138
  ) }) }),
2139
2139
  /* @__PURE__ */ e.jsxs("div", { className: "iw iw-bg-[#F6F6F6] iw-grid iw-grid-cols-2 iw-rounded-[14px] iw-p-6", children: [
2140
- /* @__PURE__ */ e.jsx("div", { className: "iw-min-h-[400px] iw-max-h-[600px]", children: /* @__PURE__ */ e.jsx(Ot, {}) }),
2140
+ /* @__PURE__ */ e.jsx("div", { className: "iw-min-h-[400px] iw-max-h-[600px]", children: /* @__PURE__ */ e.jsx(qt, {}) }),
2141
2141
  /* @__PURE__ */ e.jsx("div", { className: "iw-bg-white iw-rounded-r-xl iw-shadow iw-p-6", children: s })
2142
2142
  ] })
2143
2143
  ]
2144
2144
  }
2145
- ), qe = ({
2145
+ ), Be = ({
2146
2146
  isOpen: i,
2147
2147
  onClose: r,
2148
2148
  children: t,
@@ -2220,13 +2220,13 @@ const me = new Mt(), Dt = (i = {}) => {
2220
2220
  }
2221
2221
  )
2222
2222
  ] });
2223
- return ze(d, document.body);
2224
- }, qt = ({
2223
+ return He(d, document.body);
2224
+ }, Bt = ({
2225
2225
  confirmExitInterview: i,
2226
2226
  isOpen: r,
2227
2227
  onClose: t
2228
2228
  }) => /* @__PURE__ */ e.jsx(
2229
- qe,
2229
+ Be,
2230
2230
  {
2231
2231
  isOpen: r,
2232
2232
  onClose: t,
@@ -2264,7 +2264,7 @@ const me = new Mt(), Dt = (i = {}) => {
2264
2264
  ] })
2265
2265
  ] })
2266
2266
  }
2267
- ), Te = ({ title: i, onExit: r }) => {
2267
+ ), Ce = ({ title: i, onExit: r }) => {
2268
2268
  const { baseColor: t } = te(), [s, n] = k(!1);
2269
2269
  return /* @__PURE__ */ e.jsxs("header", { className: "iw-w-full iw-text-gray-900", children: [
2270
2270
  /* @__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: [
@@ -2294,7 +2294,7 @@ const me = new Mt(), Dt = (i = {}) => {
2294
2294
  ] }),
2295
2295
  /* @__PURE__ */ e.jsx("div", { className: "iw-h-px iw-bg-gray-200" }),
2296
2296
  /* @__PURE__ */ e.jsx(
2297
- qt,
2297
+ Bt,
2298
2298
  {
2299
2299
  isOpen: s,
2300
2300
  confirmExitInterview: () => {
@@ -2304,7 +2304,7 @@ const me = new Mt(), Dt = (i = {}) => {
2304
2304
  }
2305
2305
  )
2306
2306
  ] });
2307
- }, Bt = ({
2307
+ }, Wt = ({
2308
2308
  className: i = "",
2309
2309
  width: r,
2310
2310
  height: t = 56,
@@ -2315,16 +2315,16 @@ const me = new Mt(), Dt = (i = {}) => {
2315
2315
  mediaStream: l,
2316
2316
  startOnMount: w = !0
2317
2317
  }) => {
2318
- 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
+ const { baseColor: d } = te(), u = E(null), h = E(null), m = E(null), c = E(null), x = E(null), p = E(null), j = E(!1), [g, y] = k(null);
2319
2319
  C(() => {
2320
2320
  if (r || !h.current) return;
2321
- const N = h.current, P = () => {
2321
+ const N = h.current, _ = () => {
2322
2322
  const R = u.current;
2323
2323
  if (!R) return;
2324
2324
  const A = N.clientWidth, f = t;
2325
2325
  R.width = Math.max(1, Math.floor(A * window.devicePixelRatio || 1)), R.height = Math.max(1, Math.floor(f * window.devicePixelRatio || 1));
2326
- }, y = new ResizeObserver(P);
2327
- return y.observe(N), P(), () => y.disconnect();
2326
+ }, v = new ResizeObserver(_);
2327
+ return v.observe(N), _(), () => v.disconnect();
2328
2328
  }, [r, t]), C(() => {
2329
2329
  if (!r) return;
2330
2330
  const N = u.current;
@@ -2339,8 +2339,8 @@ const me = new Mt(), Dt = (i = {}) => {
2339
2339
  let N = !1;
2340
2340
  return (async () => {
2341
2341
  try {
2342
- const y = new (window.AudioContext || window.webkitAudioContext)();
2343
- m.current = y;
2342
+ const v = new (window.AudioContext || window.webkitAudioContext)();
2343
+ m.current = v;
2344
2344
  let R = l;
2345
2345
  if (!R) {
2346
2346
  if (!w) return;
@@ -2350,18 +2350,18 @@ const me = new Mt(), Dt = (i = {}) => {
2350
2350
  }), j.current = !0;
2351
2351
  }
2352
2352
  if (N) return;
2353
- const A = y.createAnalyser();
2353
+ const A = v.createAnalyser();
2354
2354
  A.fftSize = o, A.smoothingTimeConstant = a, c.current = A;
2355
- const f = y.createMediaStreamSource(R);
2355
+ const f = v.createMediaStreamSource(R);
2356
2356
  x.current = f, f.connect(A), S();
2357
- } catch (y) {
2358
- v((y == null ? void 0 : y.message) || "Failed to initialize microphone");
2357
+ } catch (v) {
2358
+ y((v == null ? void 0 : v.message) || "Failed to initialize microphone");
2359
2359
  }
2360
2360
  })(), () => {
2361
- var y, R, A, f;
2362
- N = !0, b.current && cancelAnimationFrame(b.current);
2361
+ var v, R, A, f;
2362
+ N = !0, p.current && cancelAnimationFrame(p.current);
2363
2363
  try {
2364
- (y = x.current) == null || y.disconnect();
2364
+ (v = x.current) == null || v.disconnect();
2365
2365
  } catch {
2366
2366
  }
2367
2367
  try {
@@ -2372,18 +2372,18 @@ const me = new Mt(), Dt = (i = {}) => {
2372
2372
  };
2373
2373
  }, [l, o, a, w]);
2374
2374
  const S = () => {
2375
- const N = u.current, P = c.current;
2376
- if (!N || !P) return;
2377
- const y = N.getContext("2d");
2378
- if (!y) return;
2379
- const R = window.devicePixelRatio || 1, A = N.width, f = N.height, M = P.frequencyBinCount, L = new Uint8Array(M), O = () => {
2380
- b.current = requestAnimationFrame(O), P.getByteTimeDomainData(L), y.clearRect(0, 0, A, f), y.fillStyle = "rgba(0,0,0,0)", y.fillRect(0, 0, A, f);
2381
- 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);
2382
- for (let U = 0; U < Y; U++) {
2383
- const _ = Math.min(L.length - 1, U * B), Q = L[_] / 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));
2384
- y.fillStyle = `${d}`, y.shadowColor = `hsla(${ue}, ${J}%, ${ie}%, ${0.25 * W})`, y.shadowBlur = 8 * W;
2385
- const p = Math.min(q / 2, K / 2);
2386
- Wt(y, de, we, q, K, p), y.fill();
2375
+ const N = u.current, _ = c.current;
2376
+ if (!N || !_) return;
2377
+ const v = N.getContext("2d");
2378
+ if (!v) return;
2379
+ const R = window.devicePixelRatio || 1, A = N.width, f = N.height, M = _.frequencyBinCount, L = new Uint8Array(M), O = () => {
2380
+ p.current = requestAnimationFrame(O), _.getByteTimeDomainData(L), v.clearRect(0, 0, A, f), v.fillStyle = "rgba(0,0,0,0)", v.fillRect(0, 0, A, f);
2381
+ const U = Math.max(1, Math.floor(s * R)), z = Math.max(1, Math.floor(n * R)), H = U + z, Y = Math.max(8, Math.floor((A + z) / H)), B = Math.floor(L.length / Y);
2382
+ for (let q = 0; q < Y; q++) {
2383
+ const P = Math.min(L.length - 1, q * B), Q = L[P] / 128 - 1, W = Math.abs(Q), de = Math.pow(W, 0.6), K = Math.max(f * 0.06, de * (f * 0.9)), we = q * H, ue = (f - K) / 2, he = 140 - Math.min(140, 140 * W), J = 85, ie = 48 + Math.floor(12 * (1 - W));
2384
+ v.fillStyle = `${d}`, v.shadowColor = `hsla(${he}, ${J}%, ${ie}%, ${0.25 * W})`, v.shadowBlur = 8 * W;
2385
+ const re = Math.min(U / 2, K / 2);
2386
+ Gt(v, we, ue, U, K, re), v.fill();
2387
2387
  }
2388
2388
  };
2389
2389
  O();
@@ -2401,11 +2401,11 @@ const me = new Mt(), Dt = (i = {}) => {
2401
2401
  }
2402
2402
  );
2403
2403
  };
2404
- function Wt(i, r, t, s, n, o) {
2404
+ function Gt(i, r, t, s, n, o) {
2405
2405
  const a = Math.min(o, s / 2, n / 2);
2406
2406
  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();
2407
2407
  }
2408
- const Gt = ({
2408
+ const Vt = ({
2409
2409
  state: i,
2410
2410
  answeringTime: r,
2411
2411
  nextPhase: t,
@@ -2416,11 +2416,11 @@ const Gt = ({
2416
2416
  /* @__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...." }),
2417
2417
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
2418
2418
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
2419
- /* @__PURE__ */ e.jsx(ve, { className: "iw-size-4 iw-text-orange-600" }),
2419
+ /* @__PURE__ */ e.jsx(je, { className: "iw-size-4 iw-text-orange-600" }),
2420
2420
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to talk: " })
2421
2421
  ] }),
2422
2422
  /* @__PURE__ */ e.jsx(
2423
- je,
2423
+ Ne,
2424
2424
  {
2425
2425
  total: r,
2426
2426
  remaining: i.currentPhaseTimeRemaining,
@@ -2433,7 +2433,7 @@ const Gt = ({
2433
2433
  /* @__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." })
2434
2434
  ] }),
2435
2435
  /* @__PURE__ */ e.jsxs("div", { children: [
2436
- /* @__PURE__ */ e.jsx(Bt, {}),
2436
+ /* @__PURE__ */ e.jsx(Wt, {}),
2437
2437
  s && /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
2438
2438
  "Recording error: ",
2439
2439
  s.message
@@ -2449,7 +2449,7 @@ const Gt = ({
2449
2449
  }
2450
2450
  ) })
2451
2451
  ] });
2452
- function Vt() {
2452
+ function zt() {
2453
2453
  const [i, r] = k(!0), t = ee(
2454
2454
  () => [0, 1, 2].map((s) => ({ id: s })),
2455
2455
  []
@@ -2487,7 +2487,7 @@ function Vt() {
2487
2487
  /* @__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..." }) })
2488
2488
  ] });
2489
2489
  }
2490
- const zt = ({
2490
+ const Ht = ({
2491
2491
  size: i = "192px",
2492
2492
  className: r,
2493
2493
  colors: t,
@@ -2629,9 +2629,9 @@ const zt = ({
2629
2629
  }
2630
2630
  );
2631
2631
  };
2632
- function Ht({ ttsError: i }) {
2632
+ function Yt({ ttsError: i }) {
2633
2633
  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: [
2634
- /* @__PURE__ */ e.jsx(zt, { size: "80px" }),
2634
+ /* @__PURE__ */ e.jsx(Ht, { size: "80px" }),
2635
2635
  i && /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-2 iw-text-xs iw-text-red-600", children: [
2636
2636
  "Audio playback failed: ",
2637
2637
  i.message
@@ -2639,18 +2639,18 @@ function Ht({ ttsError: i }) {
2639
2639
  /* @__PURE__ */ e.jsx("p", { className: "iw-text- iw-text-gray-700", children: "Your AI interviewer is speaking..." })
2640
2640
  ] });
2641
2641
  }
2642
- const Yt = ({ 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
+ const Qt = ({ 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: [
2643
2643
  /* @__PURE__ */ e.jsxs("div", { children: [
2644
2644
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Get Ready to Answer" }),
2645
2645
  /* @__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." })
2646
2646
  ] }),
2647
2647
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-justify-center iw-gap-2", children: [
2648
2648
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-1", children: [
2649
- /* @__PURE__ */ e.jsx(ve, { className: "iw-size-4 iw-text-orange-600" }),
2649
+ /* @__PURE__ */ e.jsx(je, { className: "iw-size-4 iw-text-orange-600" }),
2650
2650
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-gray-700 iw-text-sm", children: "Time to think: " })
2651
2651
  ] }),
2652
2652
  /* @__PURE__ */ e.jsx(
2653
- je,
2653
+ Ne,
2654
2654
  {
2655
2655
  total: r,
2656
2656
  remaining: i.currentPhaseTimeRemaining,
@@ -2668,7 +2668,7 @@ const Yt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2668
2668
  children: "Start Answering"
2669
2669
  }
2670
2670
  ) })
2671
- ] }), Qt = ({ sttError: i }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full", children: [
2671
+ ] }), Kt = ({ sttError: i }) => /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full", children: [
2672
2672
  /* @__PURE__ */ e.jsxs("svg", { width: "48", height: "48", viewBox: "0 0 60 60", fill: "none", children: [
2673
2673
  /* @__PURE__ */ e.jsx(
2674
2674
  "rect",
@@ -2709,7 +2709,7 @@ const Yt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2709
2709
  i.message,
2710
2710
  i.recoverable && " (attempting to continue)"
2711
2711
  ] })
2712
- ] }), se = (i) => /* @__PURE__ */ e.jsxs(
2712
+ ] }), ne = (i) => /* @__PURE__ */ e.jsxs(
2713
2713
  "svg",
2714
2714
  {
2715
2715
  xmlns: "http://www.w3.org/2000/svg",
@@ -2728,7 +2728,7 @@ const Yt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2728
2728
  /* @__PURE__ */ e.jsx("path", { d: "M12 17h.01" })
2729
2729
  ]
2730
2730
  }
2731
- ), Kt = (i) => /* @__PURE__ */ e.jsxs(
2731
+ ), Jt = (i) => /* @__PURE__ */ e.jsxs(
2732
2732
  "svg",
2733
2733
  {
2734
2734
  xmlns: "http://www.w3.org/2000/svg",
@@ -2746,7 +2746,7 @@ const Yt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2746
2746
  /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" })
2747
2747
  ]
2748
2748
  }
2749
- ), Jt = (i) => /* @__PURE__ */ e.jsxs(
2749
+ ), Xt = (i) => /* @__PURE__ */ e.jsxs(
2750
2750
  "svg",
2751
2751
  {
2752
2752
  xmlns: "http://www.w3.org/2000/svg",
@@ -2764,7 +2764,7 @@ const Yt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2764
2764
  /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "3" })
2765
2765
  ]
2766
2766
  }
2767
- ), Xt = (i) => /* @__PURE__ */ e.jsxs(
2767
+ ), Zt = (i) => /* @__PURE__ */ e.jsxs(
2768
2768
  "svg",
2769
2769
  {
2770
2770
  xmlns: "http://www.w3.org/2000/svg",
@@ -2785,7 +2785,7 @@ const Yt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2785
2785
  /* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
2786
2786
  ]
2787
2787
  }
2788
- ), ge = (i) => /* @__PURE__ */ e.jsxs(
2788
+ ), fe = (i) => /* @__PURE__ */ e.jsxs(
2789
2789
  "svg",
2790
2790
  {
2791
2791
  xmlns: "http://www.w3.org/2000/svg",
@@ -2806,7 +2806,7 @@ const Yt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2806
2806
  /* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
2807
2807
  ]
2808
2808
  }
2809
- ), Zt = (i) => /* @__PURE__ */ e.jsxs(
2809
+ ), ei = (i) => /* @__PURE__ */ e.jsxs(
2810
2810
  "svg",
2811
2811
  {
2812
2812
  xmlns: "http://www.w3.org/2000/svg",
@@ -2827,8 +2827,8 @@ const Yt = ({ state: i, thinkingTime: r, nextPhase: t }) => /* @__PURE__ */ e.js
2827
2827
  /* @__PURE__ */ e.jsx("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })
2828
2828
  ]
2829
2829
  }
2830
- ), re = 5;
2831
- function ei({
2830
+ ), se = 5;
2831
+ function ti({
2832
2832
  isOpen: i,
2833
2833
  onClose: r,
2834
2834
  warningCount: t,
@@ -2855,7 +2855,7 @@ function ei({
2855
2855
  return {
2856
2856
  title: "Tab Switch Detected",
2857
2857
  description: "You attempted to switch to another tab or reload application.",
2858
- icon: /* @__PURE__ */ e.jsx(Jt, { className: "iw-h-5 iw-w-5" })
2858
+ icon: /* @__PURE__ */ e.jsx(Xt, { className: "iw-h-5 iw-w-5" })
2859
2859
  };
2860
2860
  case "fullscreen_exit":
2861
2861
  return {
@@ -2867,51 +2867,51 @@ function ei({
2867
2867
  return {
2868
2868
  title: "Focus Loss Detected",
2869
2869
  description: "You lost focus from the interview window.",
2870
- icon: /* @__PURE__ */ e.jsx(Xt, { className: "iw-h-5 iw-w-5" })
2870
+ icon: /* @__PURE__ */ e.jsx(Zt, { className: "iw-h-5 iw-w-5" })
2871
2871
  };
2872
2872
  case "blocked_shortcut":
2873
2873
  return {
2874
2874
  title: "Keyboard Shortcut Blocked",
2875
2875
  description: "You attempted to use a blocked keyboard shortcut.",
2876
- icon: /* @__PURE__ */ e.jsx(ge, { className: "iw-h-5 iw-w-5" })
2876
+ icon: /* @__PURE__ */ e.jsx(fe, { className: "iw-h-5 iw-w-5" })
2877
2877
  };
2878
2878
  case "right_click_attempt":
2879
2879
  return {
2880
2880
  title: "Right Click Attempted",
2881
2881
  description: "You attempted to use the right click.",
2882
- icon: /* @__PURE__ */ e.jsx(Zt, { className: "iw-h-5 iw-w-5" })
2882
+ icon: /* @__PURE__ */ e.jsx(ei, { className: "iw-h-5 iw-w-5" })
2883
2883
  };
2884
2884
  case "alt_tab_attempt":
2885
2885
  return {
2886
2886
  title: "Alt + Tab Attempted",
2887
2887
  description: "You attempted to use the Alt + Tab shortcut.",
2888
- icon: /* @__PURE__ */ e.jsx(ge, { className: "iw-h-5 iw-w-5" })
2888
+ icon: /* @__PURE__ */ e.jsx(fe, { className: "iw-h-5 iw-w-5" })
2889
2889
  };
2890
2890
  case "blocked_function_key":
2891
2891
  return {
2892
2892
  title: "Function Key Blocked",
2893
2893
  description: "You attempted to use a blocked function key.",
2894
- icon: /* @__PURE__ */ e.jsx(ge, { className: "iw-h-5 iw-w-5" })
2894
+ icon: /* @__PURE__ */ e.jsx(fe, { className: "iw-h-5 iw-w-5" })
2895
2895
  };
2896
2896
  default:
2897
2897
  return {
2898
2898
  title: "Violation Detected",
2899
2899
  description: "You attempted to perform an action that is not allowed.",
2900
- icon: /* @__PURE__ */ e.jsx(se, { className: "iw-h-5 iw-w-5" })
2900
+ icon: /* @__PURE__ */ e.jsx(ne, { className: "iw-h-5 iw-w-5" })
2901
2901
  };
2902
2902
  }
2903
- })(), u = re - t, h = () => {
2904
- t + 1 > re ? n() : r();
2903
+ })(), u = se - t, h = () => {
2904
+ t + 1 > se ? n() : r();
2905
2905
  };
2906
2906
  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: [
2907
2907
  /* @__PURE__ */ e.jsxs("div", { className: "iw-p-6 iw-pb-0", children: [
2908
2908
  /* @__PURE__ */ e.jsxs("div", { className: "iw-mb-6 iw-flex iw-items-start iw-gap-4", children: [
2909
- /* @__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
+ /* @__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(ne, { className: "iw-h-6 iw-w-6 iw-text-red-500" }) }),
2910
2910
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex-1", children: [
2911
2911
  /* @__PURE__ */ e.jsx("h2", { className: "iw-mb-1 iw-text-xl iw-font-semibold iw-text-gray-900", children: "Security Violation" }),
2912
2912
  /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-2", children: [
2913
2913
  /* @__PURE__ */ e.jsx("span", { className: "iw-text-sm iw-text-gray-500", children: "Warning" }),
2914
- /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-gap-1", children: Array.from({ length: re }).map((m, c) => /* @__PURE__ */ e.jsx(
2914
+ /* @__PURE__ */ e.jsx("div", { className: "iw-flex iw-gap-1", children: Array.from({ length: se }).map((m, c) => /* @__PURE__ */ e.jsx(
2915
2915
  "div",
2916
2916
  {
2917
2917
  className: `iw-h-2 iw-w-2 iw-rounded-full ${c <= t - 1 ? "iw-bg-red-500" : "iw-bg-gray-200"}`
@@ -2922,7 +2922,7 @@ function ei({
2922
2922
  "(",
2923
2923
  t,
2924
2924
  "/",
2925
- re,
2925
+ se,
2926
2926
  ")"
2927
2927
  ] })
2928
2928
  ] })
@@ -2942,7 +2942,7 @@ function ei({
2942
2942
  /* @__PURE__ */ e.jsx("h3", { className: "iw-mb-2 iw-font-semibold iw-text-gray-900", children: d.title }),
2943
2943
  /* @__PURE__ */ e.jsx("p", { className: "iw-text-sm iw-leading-relaxed iw-text-gray-700", children: d.description }),
2944
2944
  /* @__PURE__ */ e.jsxs("div", { className: "iw-mt-3 iw-flex iw-items-center iw-gap-2 iw-text-xs iw-text-red-600", children: [
2945
- /* @__PURE__ */ e.jsx(Oe, { className: "iw-h-3 iw-w-3" }),
2945
+ /* @__PURE__ */ e.jsx(qe, { className: "iw-h-3 iw-w-3" }),
2946
2946
  /* @__PURE__ */ e.jsx("span", { children: "This action is monitored for interview integrity" })
2947
2947
  ] })
2948
2948
  ] })
@@ -2956,7 +2956,7 @@ function ei({
2956
2956
  ] }) }),
2957
2957
  /* @__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: [
2958
2958
  /* @__PURE__ */ e.jsxs("div", { className: "iw-mb-1 iw-flex iw-items-center iw-justify-center iw-gap-1.5", children: [
2959
- /* @__PURE__ */ e.jsx(Kt, { className: "iw-text-primary-600 iw-h-4 iw-w-4" }),
2959
+ /* @__PURE__ */ e.jsx(Jt, { className: "iw-text-primary-600 iw-h-4 iw-w-4" }),
2960
2960
  /* @__PURE__ */ e.jsx("span", { className: "iw-text-primary-600 iw-text-2xl iw-font-bold", children: o })
2961
2961
  ] }),
2962
2962
  /* @__PURE__ */ e.jsx("div", { className: "iw-text-primary-700 iw-text-xs iw-font-medium", children: "Auto Close" })
@@ -2970,7 +2970,7 @@ function ei({
2970
2970
  background: "linear-gradient(to right, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.9))"
2971
2971
  },
2972
2972
  children: /* @__PURE__ */ e.jsxs("div", { className: "iw-flex iw-items-center iw-gap-3", children: [
2973
- /* @__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
+ /* @__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(ne, { className: "iw-h-4 iw-w-4" }) }),
2974
2974
  /* @__PURE__ */ e.jsxs("div", { children: [
2975
2975
  /* @__PURE__ */ e.jsx("div", { className: "iw-text-sm iw-font-semibold", children: "Final Warning" }),
2976
2976
  /* @__PURE__ */ e.jsx("div", { className: "iw-text-xs iw-text-red-100", children: "Next violation will disqualify you from this interview" })
@@ -2992,7 +2992,7 @@ function ei({
2992
2992
  ] })
2993
2993
  ] }) });
2994
2994
  }
2995
- const ti = (i) => /* @__PURE__ */ e.jsxs(
2995
+ const ii = (i) => /* @__PURE__ */ e.jsxs(
2996
2996
  "svg",
2997
2997
  {
2998
2998
  xmlns: "http://www.w3.org/2000/svg",
@@ -3010,7 +3010,7 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3010
3010
  /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" })
3011
3011
  ]
3012
3012
  }
3013
- ), ii = ({
3013
+ ), ri = ({
3014
3014
  showHardReloadWarning: i,
3015
3015
  onContinue: r
3016
3016
  }) => {
@@ -3018,7 +3018,7 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3018
3018
  r();
3019
3019
  };
3020
3020
  return /* @__PURE__ */ e.jsxs(
3021
- qe,
3021
+ Be,
3022
3022
  {
3023
3023
  isOpen: i,
3024
3024
  onClose: t,
@@ -3029,7 +3029,7 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3029
3029
  children: [
3030
3030
  /* @__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" }),
3031
3031
  /* @__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: [
3032
- /* @__PURE__ */ e.jsx(se, { className: "iw-w-5 iw-h-5 iw-text-red-500" }),
3032
+ /* @__PURE__ */ e.jsx(ne, { className: "iw-w-5 iw-h-5 iw-text-red-500" }),
3033
3033
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-xl iw-font-semibold iw-text-red-500", children: "Full Screen Exit Detected" })
3034
3034
  ] }) }),
3035
3035
  /* @__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." }) }),
@@ -3039,7 +3039,7 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3039
3039
  onClick: t,
3040
3040
  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",
3041
3041
  children: [
3042
- /* @__PURE__ */ e.jsx(ti, { className: "iw-size-4" }),
3042
+ /* @__PURE__ */ e.jsx(ii, { className: "iw-size-4" }),
3043
3043
  "Continue Session"
3044
3044
  ]
3045
3045
  }
@@ -3047,14 +3047,14 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3047
3047
  ]
3048
3048
  }
3049
3049
  );
3050
- }, ri = Ge(
3050
+ }, si = Ve(
3051
3051
  ({ children: i, onDisqualify: r }, t) => {
3052
3052
  const [s, n] = k(!1), [o, a] = k(!1), [l, w] = k(!1), [d, u] = k("fullscreen_exit"), { logViolation: h, violationCount: m } = Pt({
3053
3053
  maxViolations: 5,
3054
3054
  onViolation: (g) => {
3055
3055
  o || (n(!0), u(g.type));
3056
3056
  }
3057
- }), { enterFullScreen: c, isFullScreen: x, exitFullScreen: b } = jt({
3057
+ }), { enterFullScreen: c, isFullScreen: x, exitFullScreen: p } = Nt({
3058
3058
  onFullScreenChange(g) {
3059
3059
  !g && !o && !l && (n(!0), h({
3060
3060
  type: "fullscreen_exit",
@@ -3068,7 +3068,7 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3068
3068
  });
3069
3069
  C(() => {
3070
3070
  c();
3071
- }, []), Ve(
3071
+ }, []), ze(
3072
3072
  t,
3073
3073
  () => ({
3074
3074
  exitFullScreenIntentionally: async () => {
@@ -3081,14 +3081,14 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3081
3081
  }
3082
3082
  }),
3083
3083
  []
3084
- ), Rt(h), Ct(h), At(), _t();
3084
+ ), At(h), St(h), Mt(), Ft();
3085
3085
  const j = () => {
3086
- a(!0), b(), n(!1), r == null || r();
3086
+ a(!0), p(), n(!1), r == null || r();
3087
3087
  };
3088
3088
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3089
3089
  /* @__PURE__ */ e.jsx("div", { className: "iw-relative iw-h-full iw-w-full", children: i }),
3090
3090
  /* @__PURE__ */ e.jsx(
3091
- ei,
3091
+ ti,
3092
3092
  {
3093
3093
  warningCount: m,
3094
3094
  isOpen: s,
@@ -3100,7 +3100,7 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3100
3100
  }
3101
3101
  ),
3102
3102
  !s && m > 0 && !o && !l && /* @__PURE__ */ e.jsx(
3103
- ii,
3103
+ ri,
3104
3104
  {
3105
3105
  showHardReloadWarning: !x,
3106
3106
  logViolation: h,
@@ -3109,81 +3109,83 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3109
3109
  )
3110
3110
  ] });
3111
3111
  }
3112
- ), si = ({
3112
+ ), ni = ({
3113
3113
  interviewTitle: i,
3114
3114
  interviewId: r,
3115
3115
  onComplete: t,
3116
3116
  onDisqualify: s,
3117
3117
  className: n = ""
3118
3118
  }) => {
3119
- const o = Tt(), { baseUrl: a, authToken: l } = Pe(), { timers: w, stt: d, tts: u, proctoring: h } = ot(), m = E(null), [c, x] = k(null), [b, j] = k(""), g = E(""), v = E(null), S = {
3119
+ var re;
3120
+ const o = Ct(), { baseUrl: a, authToken: l } = Pe(), { timers: w, stt: d, tts: u, proctoring: h } = lt(), m = E(null), [c, x] = k(null), [p, j] = k(""), g = E(""), y = E(null), S = {
3120
3121
  thinkingTime: (w == null ? void 0 : w.thinkingDuration) || 30,
3121
3122
  answeringTime: (w == null ? void 0 : w.answeringDuration) || 120,
3122
3123
  editingTime: (w == null ? void 0 : w.editingDuration) || 30
3123
- }, { thinkingTime: N, answeringTime: P, editingTime: y } = S;
3124
+ }, { thinkingTime: N, answeringTime: _, editingTime: v } = S;
3124
3125
  C(() => {
3125
- g.current = b;
3126
- }, [b]);
3126
+ g.current = p;
3127
+ }, [p]);
3127
3128
  const R = E(!1), {
3128
3129
  speak: A,
3129
3130
  stop: f,
3130
3131
  error: M
3131
- } = Dt({
3132
+ } = _t({
3132
3133
  config: {
3133
3134
  baseUrl: a,
3134
3135
  provider: u == null ? void 0 : u.provider,
3135
3136
  authToken: l
3136
3137
  },
3137
3138
  onEnd: () => {
3138
- R.current = !1, _();
3139
+ R.current = !1, P();
3139
3140
  },
3140
3141
  onError: () => {
3141
- R.current || (R.current = !0, _());
3142
+ R.current || (R.current = !0, P());
3142
3143
  }
3143
3144
  }), L = E(!1), O = E(!1), {
3144
- startRecording: q,
3145
+ startRecording: U,
3145
3146
  stopRecording: z,
3146
3147
  transcribe: H,
3147
3148
  error: Y
3148
- } = It({
3149
+ } = Rt({
3149
3150
  config: {
3150
3151
  baseUrl: a,
3151
3152
  provider: d == null ? void 0 : d.provider,
3152
3153
  model: d == null ? void 0 : d.model,
3153
3154
  language: d == null ? void 0 : d.language,
3154
- authToken: l
3155
+ authToken: l,
3156
+ qnaId: ((re = y.current) == null ? void 0 : re.qna_id) || ""
3155
3157
  },
3156
3158
  onStart: () => {
3157
3159
  L.current = !1, O.current = !1;
3158
3160
  },
3159
3161
  onStop: () => {
3160
3162
  },
3161
- onTranscriptionComplete: (p) => {
3162
- j(p.transcript), O.current || (O.current = !0, _());
3163
+ onTranscriptionComplete: (b) => {
3164
+ j(b.transcript), O.current || (O.current = !0, P());
3163
3165
  },
3164
- onError: (p) => {
3165
- console.error("STT Error:", p), L.current || (L.current = !0, _());
3166
+ onError: (b) => {
3167
+ console.error("STT Error:", b), L.current || (L.current = !0, P());
3166
3168
  }
3167
- }), { state: B, startQuestion: U, nextPhase: _, completeInterview: Q } = yt({
3169
+ }), { state: B, startQuestion: q, nextPhase: P, completeInterview: Q } = vt({
3168
3170
  config: {
3169
3171
  thinkingDuration: N,
3170
- answeringDuration: P,
3171
- editingDuration: y
3172
+ answeringDuration: _,
3173
+ editingDuration: v
3172
3174
  },
3173
3175
  callbacks: {
3174
- onPhaseChange: (p) => {
3175
- switch (p) {
3176
+ onPhaseChange: (b) => {
3177
+ switch (b) {
3176
3178
  case D.FETCHING_QUESTION:
3177
3179
  W();
3178
3180
  break;
3179
3181
  case D.READING_QUESTION:
3180
- de();
3182
+ we();
3181
3183
  break;
3182
3184
  case D.ANSWERING:
3183
- we();
3185
+ ue();
3184
3186
  break;
3185
3187
  case D.TRANSCRIBING:
3186
- ue();
3188
+ he();
3187
3189
  break;
3188
3190
  case D.SUBMITTING:
3189
3191
  K();
@@ -3196,106 +3198,106 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3196
3198
  }
3197
3199
  });
3198
3200
  C(() => {
3199
- U();
3201
+ q();
3200
3202
  }, []);
3201
- const { execute: W, loading: ce } = vt(
3203
+ const { execute: W, loading: de } = jt(
3202
3204
  async () => {
3203
3205
  var G, X;
3204
- const p = await o.generateQuestion({
3206
+ const b = await o.generateQuestion({
3205
3207
  interviewId: r,
3206
- question: ((G = v.current) == null ? void 0 : G.question) || "",
3207
- qnaId: ((X = v.current) == null ? void 0 : X.qna_id) || "",
3208
+ question: ((G = y.current) == null ? void 0 : G.question) || "",
3209
+ qnaId: ((X = y.current) == null ? void 0 : X.qna_id) || "",
3208
3210
  answer: g.current
3209
3211
  });
3210
- return v.current = p.data, p;
3212
+ return y.current = b.data, b;
3211
3213
  },
3212
3214
  {
3213
- onSuccess: async (p) => {
3214
- p && p.data && (j(""), x(p.data), _());
3215
+ onSuccess: async (b) => {
3216
+ b && b.data && (j(""), x(b.data), P());
3215
3217
  },
3216
- onError: (p) => {
3217
- console.error("Failed to fetch questions:", p);
3218
+ onError: (b) => {
3219
+ console.error("Failed to fetch questions:", b);
3218
3220
  }
3219
3221
  }
3220
3222
  ), K = T(async () => {
3221
- U();
3222
- }, [U]), de = T(async () => {
3223
- var p;
3224
- if ((p = v.current) != null && p.question)
3223
+ q();
3224
+ }, [q]), we = T(async () => {
3225
+ var b;
3226
+ if ((b = y.current) != null && b.question)
3225
3227
  try {
3226
- R.current = !1, await A(v.current.question), v.current.is_interview_done && (await wt(2e3), Q());
3228
+ R.current = !1, await A(y.current.question), y.current.is_interview_done && (await ut(2e3), Q());
3227
3229
  } catch (G) {
3228
3230
  console.error("Failed to speak question:", G);
3229
3231
  }
3230
3232
  else
3231
- _();
3232
- }, [A, _, Q]), we = T(async () => {
3233
+ P();
3234
+ }, [A, P, Q]), ue = T(async () => {
3233
3235
  try {
3234
- await q(P);
3235
- } catch (p) {
3236
- console.error("Failed to start recording:", p), _();
3236
+ await U(_);
3237
+ } catch (b) {
3238
+ console.error("Failed to start recording:", b), P();
3237
3239
  }
3238
- }, [q, _]), ue = T(async () => {
3240
+ }, [U, P]), he = T(async () => {
3239
3241
  try {
3240
- const p = await z();
3241
- await H(p);
3242
- } catch (p) {
3243
- console.error("STT processing failed:", p), !L.current && !O.current && (L.current = !0, _());
3242
+ const b = await z();
3243
+ await H(b);
3244
+ } catch (b) {
3245
+ console.error("STT processing failed:", b), !L.current && !O.current && (L.current = !0, P());
3244
3246
  }
3245
- }, [z, H, _]), J = T(
3246
- async (p) => {
3247
+ }, [z, H, P]), J = T(
3248
+ async (b) => {
3247
3249
  var X;
3248
3250
  f(), await ((X = m.current) == null ? void 0 : X.exitFullScreenIntentionally()), (await o.generateQuestion({
3249
3251
  interviewId: r,
3250
3252
  isInterviewDone: !0
3251
- })).success && (p == null || p(), Q(), sessionStorage.removeItem(pe));
3253
+ })).success && (b == null || b(), Q(), sessionStorage.removeItem(be));
3252
3254
  },
3253
3255
  [r, f, o]
3254
3256
  ), ie = () => {
3255
- const { phase: p } = B;
3256
- switch (p) {
3257
+ const { phase: b } = B;
3258
+ switch (b) {
3257
3259
  case D.IDLE:
3258
3260
  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: [
3259
3261
  /* @__PURE__ */ e.jsx("h3", { className: "iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1", children: "Ready to start the Interview?" }),
3260
3262
  /* @__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.` }),
3261
- /* @__PURE__ */ e.jsx(V, { onClick: U, className: "iw-mt-2 iw-w-40", children: "Start Interview" })
3263
+ /* @__PURE__ */ e.jsx(V, { onClick: q, className: "iw-mt-2 iw-w-40", children: "Start Interview" })
3262
3264
  ] });
3263
3265
  case D.FETCHING_QUESTION:
3264
- return /* @__PURE__ */ e.jsx(Vt, {});
3266
+ return /* @__PURE__ */ e.jsx(zt, {});
3265
3267
  case D.READING_QUESTION:
3266
- return /* @__PURE__ */ e.jsx(Ht, { ttsError: M });
3268
+ return /* @__PURE__ */ e.jsx(Yt, { ttsError: M });
3267
3269
  case D.THINKING:
3268
3270
  return /* @__PURE__ */ e.jsx(
3269
- Yt,
3271
+ Qt,
3270
3272
  {
3271
3273
  state: B,
3272
3274
  thinkingTime: N,
3273
- nextPhase: _
3275
+ nextPhase: P
3274
3276
  }
3275
3277
  );
3276
3278
  case D.ANSWERING:
3277
3279
  return /* @__PURE__ */ e.jsx(
3278
- Gt,
3280
+ Vt,
3279
3281
  {
3280
3282
  state: B,
3281
- answeringTime: P,
3282
- nextPhase: _,
3283
+ answeringTime: _,
3284
+ nextPhase: P,
3283
3285
  sttError: Y
3284
3286
  }
3285
3287
  );
3286
3288
  case D.TRANSCRIBING:
3287
- return /* @__PURE__ */ e.jsx(Qt, { sttError: Y });
3289
+ return /* @__PURE__ */ e.jsx(Kt, { sttError: Y });
3288
3290
  case D.EDITING:
3289
3291
  case D.SUBMITTING:
3290
3292
  return /* @__PURE__ */ e.jsx("div", { className: "iw-space-y-4 iw-h-full", children: /* @__PURE__ */ e.jsx(
3291
- $t,
3293
+ Ot,
3292
3294
  {
3293
- value: b,
3295
+ value: p,
3294
3296
  onChange: (G) => j(G.target.value),
3295
- onSubmit: () => _(),
3296
- isSubmitDisabled: !b.trim() || ce,
3297
+ onSubmit: () => P(),
3298
+ isSubmitDisabled: !p.trim() || de,
3297
3299
  state: B,
3298
- editingTime: y
3300
+ editingTime: v
3299
3301
  }
3300
3302
  ) });
3301
3303
  case D.COMPLETED:
@@ -3305,20 +3307,20 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3305
3307
  }
3306
3308
  };
3307
3309
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: h != null && h.enabled ? /* @__PURE__ */ e.jsxs(
3308
- ri,
3310
+ si,
3309
3311
  {
3310
3312
  ref: m,
3311
3313
  onDisqualify: () => J(s),
3312
3314
  children: [
3313
3315
  /* @__PURE__ */ e.jsx(
3314
- Te,
3316
+ Ce,
3315
3317
  {
3316
3318
  title: i,
3317
3319
  onExit: () => J()
3318
3320
  }
3319
3321
  ),
3320
3322
  /* @__PURE__ */ e.jsx(
3321
- Ee,
3323
+ Te,
3322
3324
  {
3323
3325
  currentQuestion: c,
3324
3326
  phase: B.phase,
@@ -3330,14 +3332,14 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3330
3332
  }
3331
3333
  ) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3332
3334
  /* @__PURE__ */ e.jsx(
3333
- Te,
3335
+ Ce,
3334
3336
  {
3335
3337
  title: i,
3336
3338
  onExit: () => J()
3337
3339
  }
3338
3340
  ),
3339
3341
  /* @__PURE__ */ e.jsx(
3340
- Ee,
3342
+ Te,
3341
3343
  {
3342
3344
  currentQuestion: c,
3343
3345
  phase: B.phase,
@@ -3346,21 +3348,21 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3346
3348
  }
3347
3349
  )
3348
3350
  ] }) });
3349
- }, ni = ({
3351
+ }, ai = ({
3350
3352
  title: i,
3351
3353
  interviewId: r,
3352
3354
  onInterviewEnd: t,
3353
3355
  onInterviewDisqualify: s,
3354
3356
  className: n = ""
3355
3357
  }) => {
3356
- const [o, a] = fe.useState(!1), [l, w] = fe.useState(!0), d = E(null);
3358
+ const [o, a] = xe.useState(!1), [l, w] = xe.useState(!0), d = E(null);
3357
3359
  return o ? /* @__PURE__ */ e.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ e.jsx(
3358
3360
  "div",
3359
3361
  {
3360
3362
  ref: d,
3361
3363
  className: `iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${n}`,
3362
3364
  children: /* @__PURE__ */ e.jsx("div", { className: " iw-h-full iw-flex iw-flex-col", children: /* @__PURE__ */ e.jsx(
3363
- si,
3365
+ ni,
3364
3366
  {
3365
3367
  interviewTitle: i ?? "Interview",
3366
3368
  interviewId: r,
@@ -3372,7 +3374,7 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3372
3374
  ) })
3373
3375
  }
3374
3376
  ) }) : /* @__PURE__ */ e.jsx("div", { className: "interview-widget-container", children: /* @__PURE__ */ e.jsx(
3375
- ft,
3377
+ xt,
3376
3378
  {
3377
3379
  isOpen: l,
3378
3380
  onStart: () => {
@@ -3382,11 +3384,11 @@ const ti = (i) => /* @__PURE__ */ e.jsxs(
3382
3384
  ) });
3383
3385
  };
3384
3386
  typeof window < "u" && (window.InterviewWidget = {
3385
- InterviewWidget: ni,
3386
- InterviewWidgetProvider: at
3387
+ InterviewWidget: ai,
3388
+ InterviewWidgetProvider: ot
3387
3389
  });
3388
3390
  export {
3389
- ni as InterviewWidget,
3390
- at as InterviewWidgetProvider,
3391
- ni as default
3391
+ ai as InterviewWidget,
3392
+ ot as InterviewWidgetProvider,
3393
+ ai as default
3392
3394
  };