l-min-components 1.8.474 → 1.8.476

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.
@@ -1,12 +1,37 @@
1
- import T, { forwardRef as Te, useEffect as U, useReducer as Ee, useState as ae, useRef as F, isValidElement as W, cloneElement as ie, useLayoutEffect as Ce } from "react";
2
- if (typeof ye > "u")
3
- var ye = window;
1
+ import T, { forwardRef as Te, useEffect as U, useReducer as Ee, useState as ie, useRef as F, isValidElement as H, cloneElement as ce, useLayoutEffect as Ce } from "react";
2
+ if (typeof ae > "u")
3
+ var ae = window;
4
+ var ze = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof ae < "u" ? ae : typeof self < "u" ? self : {};
5
+ function Se(e) {
6
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
7
+ }
8
+ function Ue(e) {
9
+ if (e.__esModule)
10
+ return e;
11
+ var t = e.default;
12
+ if (typeof t == "function") {
13
+ var s = function a() {
14
+ return this instanceof a ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
15
+ };
16
+ s.prototype = t.prototype;
17
+ } else
18
+ s = {};
19
+ return Object.defineProperty(s, "__esModule", { value: !0 }), Object.keys(e).forEach(function(a) {
20
+ var r = Object.getOwnPropertyDescriptor(e, a);
21
+ Object.defineProperty(s, a, r.get ? r : {
22
+ enumerable: !0,
23
+ get: function() {
24
+ return e[a];
25
+ }
26
+ });
27
+ }), s;
28
+ }
4
29
  /*! js-cookie v3.0.5 | MIT */
5
30
  function X(e) {
6
31
  for (var t = 1; t < arguments.length; t++) {
7
- var r = arguments[t];
8
- for (var a in r)
9
- e[a] = r[a];
32
+ var s = arguments[t];
33
+ for (var a in s)
34
+ e[a] = s[a];
10
35
  }
11
36
  return e;
12
37
  }
@@ -21,48 +46,48 @@ var be = {
21
46
  );
22
47
  }
23
48
  };
24
- function ce(e, t) {
25
- function r(s, o, n) {
49
+ function le(e, t) {
50
+ function s(r, o, n) {
26
51
  if (!(typeof document > "u")) {
27
- n = X({}, t, n), typeof n.expires == "number" && (n.expires = new Date(Date.now() + n.expires * 864e5)), n.expires && (n.expires = n.expires.toUTCString()), s = encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
52
+ n = X({}, t, n), typeof n.expires == "number" && (n.expires = new Date(Date.now() + n.expires * 864e5)), n.expires && (n.expires = n.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
28
53
  var i = "";
29
54
  for (var g in n)
30
55
  n[g] && (i += "; " + g, n[g] !== !0 && (i += "=" + n[g].split(";")[0]));
31
- return document.cookie = s + "=" + e.write(o, s) + i;
56
+ return document.cookie = r + "=" + e.write(o, r) + i;
32
57
  }
33
58
  }
34
- function a(s) {
35
- if (!(typeof document > "u" || arguments.length && !s)) {
59
+ function a(r) {
60
+ if (!(typeof document > "u" || arguments.length && !r)) {
36
61
  for (var o = document.cookie ? document.cookie.split("; ") : [], n = {}, i = 0; i < o.length; i++) {
37
62
  var g = o[i].split("="), h = g.slice(1).join("=");
38
63
  try {
39
64
  var p = decodeURIComponent(g[0]);
40
- if (n[p] = e.read(h, p), s === p)
65
+ if (n[p] = e.read(h, p), r === p)
41
66
  break;
42
67
  } catch {
43
68
  }
44
69
  }
45
- return s ? n[s] : n;
70
+ return r ? n[r] : n;
46
71
  }
47
72
  }
48
73
  return Object.create(
49
74
  {
50
- set: r,
75
+ set: s,
51
76
  get: a,
52
- remove: function(s, o) {
53
- r(
54
- s,
77
+ remove: function(r, o) {
78
+ s(
79
+ r,
55
80
  "",
56
81
  X({}, o, {
57
82
  expires: -1
58
83
  })
59
84
  );
60
85
  },
61
- withAttributes: function(s) {
62
- return ce(this.converter, X({}, this.attributes, s));
86
+ withAttributes: function(r) {
87
+ return le(this.converter, X({}, this.attributes, r));
63
88
  },
64
- withConverter: function(s) {
65
- return ce(X({}, this.converter, s), this.attributes);
89
+ withConverter: function(r) {
90
+ return le(X({}, this.converter, r), this.attributes);
66
91
  }
67
92
  },
68
93
  {
@@ -71,67 +96,67 @@ function ce(e, t) {
71
96
  }
72
97
  );
73
98
  }
74
- var ze = ce(be, { path: "/" });
75
- const Ie = (e) => {
76
- var s, o, n;
77
- const t = (s = window == null ? void 0 : window.location) == null ? void 0 : s.hostname, r = (o = window == null ? void 0 : window.location) != null && o.port ? `:${window.location.port}` : "";
78
- return `${(n = window == null ? void 0 : window.location) == null ? void 0 : n.protocol}//${t}${r}${e}`;
79
- }, Se = Ie;
80
- function he(e) {
81
- var t, r, a = "";
99
+ var Fe = le(be, { path: "/" });
100
+ const we = (e) => {
101
+ var r, o, n;
102
+ const t = (r = window == null ? void 0 : window.location) == null ? void 0 : r.hostname, s = (o = window == null ? void 0 : window.location) != null && o.port ? `:${window.location.port}` : "";
103
+ return `${(n = window == null ? void 0 : window.location) == null ? void 0 : n.protocol}//${t}${s}${e}`;
104
+ }, je = we;
105
+ function me(e) {
106
+ var t, s, a = "";
82
107
  if (typeof e == "string" || typeof e == "number")
83
108
  a += e;
84
109
  else if (typeof e == "object")
85
110
  if (Array.isArray(e))
86
111
  for (t = 0; t < e.length; t++)
87
- e[t] && (r = he(e[t])) && (a && (a += " "), a += r);
112
+ e[t] && (s = me(e[t])) && (a && (a += " "), a += s);
88
113
  else
89
114
  for (t in e)
90
115
  e[t] && (a && (a += " "), a += t);
91
116
  return a;
92
117
  }
93
- function M() {
94
- for (var e, t, r = 0, a = ""; r < arguments.length; )
95
- (e = arguments[r++]) && (t = he(e)) && (a && (a += " "), a += t);
118
+ function k() {
119
+ for (var e, t, s = 0, a = ""; s < arguments.length; )
120
+ (e = arguments[s++]) && (t = me(e)) && (a && (a += " "), a += t);
96
121
  return a;
97
122
  }
98
- const Q = (e) => typeof e == "number" && !isNaN(e), q = (e) => typeof e == "string", L = (e) => typeof e == "function", Z = (e) => q(e) || L(e) ? e : null, oe = (e) => W(e) || q(e) || L(e) || Q(e);
99
- function we(e, t, r) {
100
- r === void 0 && (r = 300);
101
- const { scrollHeight: a, style: s } = e;
123
+ const Q = (e) => typeof e == "number" && !isNaN(e), j = (e) => typeof e == "string", O = (e) => typeof e == "function", Z = (e) => j(e) || O(e) ? e : null, oe = (e) => H(e) || j(e) || O(e) || Q(e);
124
+ function Ie(e, t, s) {
125
+ s === void 0 && (s = 300);
126
+ const { scrollHeight: a, style: r } = e;
102
127
  requestAnimationFrame(() => {
103
- s.minHeight = "initial", s.height = a + "px", s.transition = `all ${r}ms`, requestAnimationFrame(() => {
104
- s.height = "0", s.padding = "0", s.margin = "0", setTimeout(t, r);
128
+ r.minHeight = "initial", r.height = a + "px", r.transition = `all ${s}ms`, requestAnimationFrame(() => {
129
+ r.height = "0", r.padding = "0", r.margin = "0", setTimeout(t, s);
105
130
  });
106
131
  });
107
132
  }
108
133
  function te(e) {
109
- let { enter: t, exit: r, appendPosition: a = !1, collapse: s = !0, collapseDuration: o = 300 } = e;
134
+ let { enter: t, exit: s, appendPosition: a = !1, collapse: r = !0, collapseDuration: o = 300 } = e;
110
135
  return function(n) {
111
136
  let { children: i, position: g, preventExitTransition: h, done: p, nodeRef: m, isIn: b } = n;
112
- const u = a ? `${t}--${g}` : t, c = a ? `${r}--${g}` : r, f = F(0);
137
+ const u = a ? `${t}--${g}` : t, c = a ? `${s}--${g}` : s, f = F(0);
113
138
  return Ce(() => {
114
- const l = m.current, d = u.split(" "), C = (w) => {
115
- w.target === m.current && (l.dispatchEvent(new Event("d")), l.removeEventListener("animationend", C), l.removeEventListener("animationcancel", C), f.current === 0 && w.type !== "animationcancel" && l.classList.remove(...d));
139
+ const l = m.current, d = u.split(" "), C = (I) => {
140
+ I.target === m.current && (l.dispatchEvent(new Event("d")), l.removeEventListener("animationend", C), l.removeEventListener("animationcancel", C), f.current === 0 && I.type !== "animationcancel" && l.classList.remove(...d));
116
141
  };
117
142
  l.classList.add(...d), l.addEventListener("animationend", C), l.addEventListener("animationcancel", C);
118
143
  }, []), U(() => {
119
144
  const l = m.current, d = () => {
120
- l.removeEventListener("animationend", d), s ? we(l, p, o) : p();
145
+ l.removeEventListener("animationend", d), r ? Ie(l, p, o) : p();
121
146
  };
122
147
  b || (h ? d() : (f.current = 1, l.className += ` ${c}`, l.addEventListener("animationend", d)));
123
148
  }, [b]), T.createElement(T.Fragment, null, i);
124
149
  };
125
150
  }
126
- function de(e, t) {
151
+ function fe(e, t) {
127
152
  return e != null ? { content: e.content, containerId: e.props.containerId, id: e.props.toastId, theme: e.props.theme, type: e.props.type, data: e.props.data || {}, isLoading: e.props.isLoading, icon: e.props.icon, status: t } : {};
128
153
  }
129
- const A = { list: /* @__PURE__ */ new Map(), emitQueue: /* @__PURE__ */ new Map(), on(e, t) {
154
+ const _ = { list: /* @__PURE__ */ new Map(), emitQueue: /* @__PURE__ */ new Map(), on(e, t) {
130
155
  return this.list.has(e) || this.list.set(e, []), this.list.get(e).push(t), this;
131
156
  }, off(e, t) {
132
157
  if (t) {
133
- const r = this.list.get(e).filter((a) => a !== t);
134
- return this.list.set(e, r), this;
158
+ const s = this.list.get(e).filter((a) => a !== t);
159
+ return this.list.set(e, s), this;
135
160
  }
136
161
  return this.list.delete(e), this;
137
162
  }, cancelEmit(e) {
@@ -139,14 +164,14 @@ const A = { list: /* @__PURE__ */ new Map(), emitQueue: /* @__PURE__ */ new Map(
139
164
  return t && (t.forEach(clearTimeout), this.emitQueue.delete(e)), this;
140
165
  }, emit(e) {
141
166
  this.list.has(e) && this.list.get(e).forEach((t) => {
142
- const r = setTimeout(() => {
167
+ const s = setTimeout(() => {
143
168
  t(...[].slice.call(arguments, 1));
144
169
  }, 0);
145
- this.emitQueue.has(e) || this.emitQueue.set(e, []), this.emitQueue.get(e).push(r);
170
+ this.emitQueue.has(e) || this.emitQueue.set(e, []), this.emitQueue.get(e).push(s);
146
171
  });
147
172
  } }, Y = (e) => {
148
- let { theme: t, type: r, ...a } = e;
149
- return T.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${r})`, ...a });
173
+ let { theme: t, type: s, ...a } = e;
174
+ return T.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${s})`, ...a });
150
175
  }, se = { info: function(e) {
151
176
  return T.createElement(Y, { ...e }, T.createElement("path", { d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z" }));
152
177
  }, warning: function(e) {
@@ -158,8 +183,8 @@ const A = { list: /* @__PURE__ */ new Map(), emitQueue: /* @__PURE__ */ new Map(
158
183
  }, spinner: function() {
159
184
  return T.createElement("div", { className: "Toastify__spinner" });
160
185
  } };
161
- function Le(e) {
162
- const [, t] = Ee((u) => u + 1, 0), [r, a] = ae([]), s = F(null), o = F(/* @__PURE__ */ new Map()).current, n = (u) => r.indexOf(u) !== -1, i = F({ toastKey: 1, displayedToast: 0, count: 0, queue: [], props: e, containerId: null, isToastActive: n, getToast: (u) => o.get(u) }).current;
186
+ function Oe(e) {
187
+ const [, t] = Ee((u) => u + 1, 0), [s, a] = ie([]), r = F(null), o = F(/* @__PURE__ */ new Map()).current, n = (u) => s.indexOf(u) !== -1, i = F({ toastKey: 1, displayedToast: 0, count: 0, queue: [], props: e, containerId: null, isToastActive: n, getToast: (u) => o.get(u) }).current;
163
188
  function g(u) {
164
189
  let { containerId: c } = u;
165
190
  const { limit: f } = i.props;
@@ -175,24 +200,24 @@ function Le(e) {
175
200
  function m(u, c) {
176
201
  let { delay: f, staleId: l, ...d } = c;
177
202
  if (!oe(u) || function(x) {
178
- return !s.current || i.props.enableMultiContainer && x.containerId !== i.props.containerId || o.has(x.toastId) && x.updateId == null;
203
+ return !r.current || i.props.enableMultiContainer && x.containerId !== i.props.containerId || o.has(x.toastId) && x.updateId == null;
179
204
  }(d))
180
205
  return;
181
- const { toastId: C, updateId: w, data: v } = d, { props: y } = i, $ = () => h(C), B = w == null;
182
- B && i.count++;
183
- const I = { ...y, style: y.toastStyle, key: i.toastKey++, ...Object.fromEntries(Object.entries(d).filter((x) => {
184
- let [_, O] = x;
185
- return O != null;
186
- })), toastId: C, updateId: w, data: v, closeToast: $, isIn: !1, className: Z(d.className || y.toastClassName), bodyClassName: Z(d.bodyClassName || y.bodyClassName), progressClassName: Z(d.progressClassName || y.progressClassName), autoClose: !d.isLoading && (N = d.autoClose, H = y.autoClose, N === !1 || Q(N) && N > 0 ? N : H), deleteToast() {
187
- const x = de(o.get(C), "removed");
188
- o.delete(C), A.emit(4, x);
189
- const _ = i.queue.length;
190
- if (i.count = C == null ? i.count - i.displayedToast : i.count - 1, i.count < 0 && (i.count = 0), _ > 0) {
191
- const O = C == null ? i.props.limit : 1;
192
- if (_ === 1 || O === 1)
206
+ const { toastId: C, updateId: I, data: y } = d, { props: v } = i, N = () => h(C), $ = I == null;
207
+ $ && i.count++;
208
+ const w = { ...v, style: v.toastStyle, key: i.toastKey++, ...Object.fromEntries(Object.entries(d).filter((x) => {
209
+ let [A, L] = x;
210
+ return L != null;
211
+ })), toastId: C, updateId: I, data: y, closeToast: N, isIn: !1, className: Z(d.className || v.toastClassName), bodyClassName: Z(d.bodyClassName || v.bodyClassName), progressClassName: Z(d.progressClassName || v.progressClassName), autoClose: !d.isLoading && (B = d.autoClose, q = v.autoClose, B === !1 || Q(B) && B > 0 ? B : q), deleteToast() {
212
+ const x = fe(o.get(C), "removed");
213
+ o.delete(C), _.emit(4, x);
214
+ const A = i.queue.length;
215
+ if (i.count = C == null ? i.count - i.displayedToast : i.count - 1, i.count < 0 && (i.count = 0), A > 0) {
216
+ const L = C == null ? i.props.limit : 1;
217
+ if (A === 1 || L === 1)
193
218
  i.displayedToast++, p();
194
219
  else {
195
- const P = O > _ ? _ : O;
220
+ const P = L > A ? A : L;
196
221
  i.displayedToast = P;
197
222
  for (let R = 0; R < P; R++)
198
223
  p();
@@ -200,244 +225,244 @@ function Le(e) {
200
225
  } else
201
226
  t();
202
227
  } };
203
- var N, H;
204
- I.iconOut = function(x) {
205
- let { theme: _, type: O, isLoading: P, icon: R } = x, k = null;
206
- const z = { theme: _, type: O };
207
- return R === !1 || (L(R) ? k = R(z) : W(R) ? k = ie(R, z) : q(R) || Q(R) ? k = R : P ? k = se.spinner() : ((G) => G in se)(O) && (k = se[O](z))), k;
208
- }(I), L(d.onOpen) && (I.onOpen = d.onOpen), L(d.onClose) && (I.onClose = d.onClose), I.closeButton = y.closeButton, d.closeButton === !1 || oe(d.closeButton) ? I.closeButton = d.closeButton : d.closeButton === !0 && (I.closeButton = !oe(y.closeButton) || y.closeButton);
228
+ var B, q;
229
+ w.iconOut = function(x) {
230
+ let { theme: A, type: L, isLoading: P, icon: R } = x, M = null;
231
+ const z = { theme: A, type: L };
232
+ return R === !1 || (O(R) ? M = R(z) : H(R) ? M = ce(R, z) : j(R) || Q(R) ? M = R : P ? M = se.spinner() : ((G) => G in se)(L) && (M = se[L](z))), M;
233
+ }(w), O(d.onOpen) && (w.onOpen = d.onOpen), O(d.onClose) && (w.onClose = d.onClose), w.closeButton = v.closeButton, d.closeButton === !1 || oe(d.closeButton) ? w.closeButton = d.closeButton : d.closeButton === !0 && (w.closeButton = !oe(v.closeButton) || v.closeButton);
209
234
  let D = u;
210
- W(u) && !q(u.type) ? D = ie(u, { closeToast: $, toastProps: I, data: v }) : L(u) && (D = u({ closeToast: $, toastProps: I, data: v })), y.limit && y.limit > 0 && i.count > y.limit && B ? i.queue.push({ toastContent: D, toastProps: I, staleId: l }) : Q(f) ? setTimeout(() => {
211
- b(D, I, l);
212
- }, f) : b(D, I, l);
235
+ H(u) && !j(u.type) ? D = ce(u, { closeToast: N, toastProps: w, data: y }) : O(u) && (D = u({ closeToast: N, toastProps: w, data: y })), v.limit && v.limit > 0 && i.count > v.limit && $ ? i.queue.push({ toastContent: D, toastProps: w, staleId: l }) : Q(f) ? setTimeout(() => {
236
+ b(D, w, l);
237
+ }, f) : b(D, w, l);
213
238
  }
214
239
  function b(u, c, f) {
215
240
  const { toastId: l } = c;
216
241
  f && o.delete(f);
217
242
  const d = { content: u, props: c };
218
- o.set(l, d), a((C) => [...C, l].filter((w) => w !== f)), A.emit(4, de(d, d.props.updateId == null ? "added" : "updated"));
243
+ o.set(l, d), a((C) => [...C, l].filter((I) => I !== f)), _.emit(4, fe(d, d.props.updateId == null ? "added" : "updated"));
219
244
  }
220
- return U(() => (i.containerId = e.containerId, A.cancelEmit(3).on(0, m).on(1, (u) => s.current && h(u)).on(5, g).emit(2, i), () => {
221
- o.clear(), A.emit(3, i);
245
+ return U(() => (i.containerId = e.containerId, _.cancelEmit(3).on(0, m).on(1, (u) => r.current && h(u)).on(5, g).emit(2, i), () => {
246
+ o.clear(), _.emit(3, i);
222
247
  }), []), U(() => {
223
- i.props = e, i.isToastActive = n, i.displayedToast = r.length;
248
+ i.props = e, i.isToastActive = n, i.displayedToast = s.length;
224
249
  }), { getToastToRender: function(u) {
225
250
  const c = /* @__PURE__ */ new Map(), f = Array.from(o.values());
226
251
  return e.newestOnTop && f.reverse(), f.forEach((l) => {
227
252
  const { position: d } = l.props;
228
253
  c.has(d) || c.set(d, []), c.get(d).push(l);
229
254
  }), Array.from(c, (l) => u(l[0], l[1]));
230
- }, containerRef: s, isToastActive: n };
255
+ }, containerRef: r, isToastActive: n };
231
256
  }
232
- function fe(e) {
257
+ function pe(e) {
233
258
  return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientX : e.clientX;
234
259
  }
235
- function pe(e) {
260
+ function ge(e) {
236
261
  return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientY : e.clientY;
237
262
  }
238
- function Oe(e) {
239
- const [t, r] = ae(!1), [a, s] = ae(!1), o = F(null), n = F({ start: 0, x: 0, y: 0, delta: 0, removalDistance: 0, canCloseOnClick: !0, canDrag: !1, boundingRect: null, didMove: !1 }).current, i = F(e), { autoClose: g, pauseOnHover: h, closeToast: p, onClick: m, closeOnClick: b } = e;
240
- function u(v) {
263
+ function Le(e) {
264
+ const [t, s] = ie(!1), [a, r] = ie(!1), o = F(null), n = F({ start: 0, x: 0, y: 0, delta: 0, removalDistance: 0, canCloseOnClick: !0, canDrag: !1, boundingRect: null, didMove: !1 }).current, i = F(e), { autoClose: g, pauseOnHover: h, closeToast: p, onClick: m, closeOnClick: b } = e;
265
+ function u(y) {
241
266
  if (e.draggable) {
242
- v.nativeEvent.type === "touchstart" && v.nativeEvent.preventDefault(), n.didMove = !1, document.addEventListener("mousemove", d), document.addEventListener("mouseup", C), document.addEventListener("touchmove", d), document.addEventListener("touchend", C);
243
- const y = o.current;
244
- n.canCloseOnClick = !0, n.canDrag = !0, n.boundingRect = y.getBoundingClientRect(), y.style.transition = "", n.x = fe(v.nativeEvent), n.y = pe(v.nativeEvent), e.draggableDirection === "x" ? (n.start = n.x, n.removalDistance = y.offsetWidth * (e.draggablePercent / 100)) : (n.start = n.y, n.removalDistance = y.offsetHeight * (e.draggablePercent === 80 ? 1.5 * e.draggablePercent : e.draggablePercent / 100));
267
+ y.nativeEvent.type === "touchstart" && y.nativeEvent.preventDefault(), n.didMove = !1, document.addEventListener("mousemove", d), document.addEventListener("mouseup", C), document.addEventListener("touchmove", d), document.addEventListener("touchend", C);
268
+ const v = o.current;
269
+ n.canCloseOnClick = !0, n.canDrag = !0, n.boundingRect = v.getBoundingClientRect(), v.style.transition = "", n.x = pe(y.nativeEvent), n.y = ge(y.nativeEvent), e.draggableDirection === "x" ? (n.start = n.x, n.removalDistance = v.offsetWidth * (e.draggablePercent / 100)) : (n.start = n.y, n.removalDistance = v.offsetHeight * (e.draggablePercent === 80 ? 1.5 * e.draggablePercent : e.draggablePercent / 100));
245
270
  }
246
271
  }
247
- function c(v) {
272
+ function c(y) {
248
273
  if (n.boundingRect) {
249
- const { top: y, bottom: $, left: B, right: I } = n.boundingRect;
250
- v.nativeEvent.type !== "touchend" && e.pauseOnHover && n.x >= B && n.x <= I && n.y >= y && n.y <= $ ? l() : f();
274
+ const { top: v, bottom: N, left: $, right: w } = n.boundingRect;
275
+ y.nativeEvent.type !== "touchend" && e.pauseOnHover && n.x >= $ && n.x <= w && n.y >= v && n.y <= N ? l() : f();
251
276
  }
252
277
  }
253
278
  function f() {
254
- r(!0);
279
+ s(!0);
255
280
  }
256
281
  function l() {
257
- r(!1);
282
+ s(!1);
258
283
  }
259
- function d(v) {
260
- const y = o.current;
261
- n.canDrag && y && (n.didMove = !0, t && l(), n.x = fe(v), n.y = pe(v), n.delta = e.draggableDirection === "x" ? n.x - n.start : n.y - n.start, n.start !== n.x && (n.canCloseOnClick = !1), y.style.transform = `translate${e.draggableDirection}(${n.delta}px)`, y.style.opacity = "" + (1 - Math.abs(n.delta / n.removalDistance)));
284
+ function d(y) {
285
+ const v = o.current;
286
+ n.canDrag && v && (n.didMove = !0, t && l(), n.x = pe(y), n.y = ge(y), n.delta = e.draggableDirection === "x" ? n.x - n.start : n.y - n.start, n.start !== n.x && (n.canCloseOnClick = !1), v.style.transform = `translate${e.draggableDirection}(${n.delta}px)`, v.style.opacity = "" + (1 - Math.abs(n.delta / n.removalDistance)));
262
287
  }
263
288
  function C() {
264
289
  document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", C), document.removeEventListener("touchmove", d), document.removeEventListener("touchend", C);
265
- const v = o.current;
266
- if (n.canDrag && n.didMove && v) {
290
+ const y = o.current;
291
+ if (n.canDrag && n.didMove && y) {
267
292
  if (n.canDrag = !1, Math.abs(n.delta) > n.removalDistance)
268
- return s(!0), void e.closeToast();
269
- v.style.transition = "transform 0.2s, opacity 0.2s", v.style.transform = `translate${e.draggableDirection}(0)`, v.style.opacity = "1";
293
+ return r(!0), void e.closeToast();
294
+ y.style.transition = "transform 0.2s, opacity 0.2s", y.style.transform = `translate${e.draggableDirection}(0)`, y.style.opacity = "1";
270
295
  }
271
296
  }
272
297
  U(() => {
273
298
  i.current = e;
274
- }), U(() => (o.current && o.current.addEventListener("d", f, { once: !0 }), L(e.onOpen) && e.onOpen(W(e.children) && e.children.props), () => {
275
- const v = i.current;
276
- L(v.onClose) && v.onClose(W(v.children) && v.children.props);
299
+ }), U(() => (o.current && o.current.addEventListener("d", f, { once: !0 }), O(e.onOpen) && e.onOpen(H(e.children) && e.children.props), () => {
300
+ const y = i.current;
301
+ O(y.onClose) && y.onClose(H(y.children) && y.children.props);
277
302
  }), []), U(() => (e.pauseOnFocusLoss && (document.hasFocus() || l(), window.addEventListener("focus", f), window.addEventListener("blur", l)), () => {
278
303
  e.pauseOnFocusLoss && (window.removeEventListener("focus", f), window.removeEventListener("blur", l));
279
304
  }), [e.pauseOnFocusLoss]);
280
- const w = { onMouseDown: u, onTouchStart: u, onMouseUp: c, onTouchEnd: c };
281
- return g && h && (w.onMouseEnter = l, w.onMouseLeave = f), b && (w.onClick = (v) => {
282
- m && m(v), n.canCloseOnClick && p();
283
- }), { playToast: f, pauseToast: l, isRunning: t, preventExitTransition: a, toastRef: o, eventHandlers: w };
305
+ const I = { onMouseDown: u, onTouchStart: u, onMouseUp: c, onTouchEnd: c };
306
+ return g && h && (I.onMouseEnter = l, I.onMouseLeave = f), b && (I.onClick = (y) => {
307
+ m && m(y), n.canCloseOnClick && p();
308
+ }), { playToast: f, pauseToast: l, isRunning: t, preventExitTransition: a, toastRef: o, eventHandlers: I };
284
309
  }
285
- function me(e) {
286
- let { closeToast: t, theme: r, ariaLabel: a = "close" } = e;
287
- return T.createElement("button", { className: `Toastify__close-button Toastify__close-button--${r}`, type: "button", onClick: (s) => {
288
- s.stopPropagation(), t(s);
310
+ function ye(e) {
311
+ let { closeToast: t, theme: s, ariaLabel: a = "close" } = e;
312
+ return T.createElement("button", { className: `Toastify__close-button Toastify__close-button--${s}`, type: "button", onClick: (r) => {
313
+ r.stopPropagation(), t(r);
289
314
  }, "aria-label": a }, T.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, T.createElement("path", { fillRule: "evenodd", d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z" })));
290
315
  }
291
316
  function Re(e) {
292
- let { delay: t, isRunning: r, closeToast: a, type: s = "default", hide: o, className: n, style: i, controlledProgress: g, progress: h, rtl: p, isIn: m, theme: b } = e;
293
- const u = o || g && h === 0, c = { ...i, animationDuration: `${t}ms`, animationPlayState: r ? "running" : "paused", opacity: u ? 0 : 1 };
317
+ let { delay: t, isRunning: s, closeToast: a, type: r = "default", hide: o, className: n, style: i, controlledProgress: g, progress: h, rtl: p, isIn: m, theme: b } = e;
318
+ const u = o || g && h === 0, c = { ...i, animationDuration: `${t}ms`, animationPlayState: s ? "running" : "paused", opacity: u ? 0 : 1 };
294
319
  g && (c.transform = `scaleX(${h})`);
295
- const f = M("Toastify__progress-bar", g ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${b}`, `Toastify__progress-bar--${s}`, { "Toastify__progress-bar--rtl": p }), l = L(n) ? n({ rtl: p, type: s, defaultClassName: f }) : M(f, n);
320
+ const f = k("Toastify__progress-bar", g ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${b}`, `Toastify__progress-bar--${r}`, { "Toastify__progress-bar--rtl": p }), l = O(n) ? n({ rtl: p, type: r, defaultClassName: f }) : k(f, n);
296
321
  return T.createElement("div", { role: "progressbar", "aria-hidden": u ? "true" : "false", "aria-label": "notification timer", className: l, style: c, [g && h >= 1 ? "onTransitionEnd" : "onAnimationEnd"]: g && h < 1 ? null : () => {
297
322
  m && a();
298
323
  } });
299
324
  }
300
325
  const xe = (e) => {
301
- const { isRunning: t, preventExitTransition: r, toastRef: a, eventHandlers: s } = Oe(e), { closeButton: o, children: n, autoClose: i, onClick: g, type: h, hideProgressBar: p, closeToast: m, transition: b, position: u, className: c, style: f, bodyClassName: l, bodyStyle: d, progressClassName: C, progressStyle: w, updateId: v, role: y, progress: $, rtl: B, toastId: I, deleteToast: N, isIn: H, isLoading: D, iconOut: x, closeOnClick: _, theme: O } = e, P = M("Toastify__toast", `Toastify__toast-theme--${O}`, `Toastify__toast--${h}`, { "Toastify__toast--rtl": B }, { "Toastify__toast--close-on-click": _ }), R = L(c) ? c({ rtl: B, position: u, type: h, defaultClassName: P }) : M(P, c), k = !!$ || !i, z = { closeToast: m, type: h, theme: O };
326
+ const { isRunning: t, preventExitTransition: s, toastRef: a, eventHandlers: r } = Le(e), { closeButton: o, children: n, autoClose: i, onClick: g, type: h, hideProgressBar: p, closeToast: m, transition: b, position: u, className: c, style: f, bodyClassName: l, bodyStyle: d, progressClassName: C, progressStyle: I, updateId: y, role: v, progress: N, rtl: $, toastId: w, deleteToast: B, isIn: q, isLoading: D, iconOut: x, closeOnClick: A, theme: L } = e, P = k("Toastify__toast", `Toastify__toast-theme--${L}`, `Toastify__toast--${h}`, { "Toastify__toast--rtl": $ }, { "Toastify__toast--close-on-click": A }), R = O(c) ? c({ rtl: $, position: u, type: h, defaultClassName: P }) : k(P, c), M = !!N || !i, z = { closeToast: m, type: h, theme: L };
302
327
  let G = null;
303
- return o === !1 || (G = L(o) ? o(z) : W(o) ? ie(o, z) : me(z)), T.createElement(b, { isIn: H, done: N, position: u, preventExitTransition: r, nodeRef: a }, T.createElement("div", { id: I, onClick: g, className: R, ...s, style: f, ref: a }, T.createElement("div", { ...H && { role: y }, className: L(l) ? l({ type: h }) : M("Toastify__toast-body", l), style: d }, x != null && T.createElement("div", { className: M("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !D }) }, x), T.createElement("div", null, n)), G, T.createElement(Re, { ...v && !k ? { key: `pb-${v}` } : {}, rtl: B, theme: O, delay: i, isRunning: t, isIn: H, closeToast: m, hide: p, type: h, style: w, className: C, controlledProgress: k, progress: $ || 0 })));
328
+ return o === !1 || (G = O(o) ? o(z) : H(o) ? ce(o, z) : ye(z)), T.createElement(b, { isIn: q, done: B, position: u, preventExitTransition: s, nodeRef: a }, T.createElement("div", { id: w, onClick: g, className: R, ...r, style: f, ref: a }, T.createElement("div", { ...q && { role: v }, className: O(l) ? l({ type: h }) : k("Toastify__toast-body", l), style: d }, x != null && T.createElement("div", { className: k("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !D }) }, x), T.createElement("div", null, n)), G, T.createElement(Re, { ...y && !M ? { key: `pb-${y}` } : {}, rtl: $, theme: L, delay: i, isRunning: t, isIn: q, closeToast: m, hide: p, type: h, style: I, className: C, controlledProgress: M, progress: N || 0 })));
304
329
  }, ne = function(e, t) {
305
330
  return t === void 0 && (t = !1), { enter: `Toastify--animate Toastify__${e}-enter`, exit: `Toastify--animate Toastify__${e}-exit`, appendPosition: t };
306
- }, Ae = te(ne("bounce", !0));
331
+ }, _e = te(ne("bounce", !0));
307
332
  te(ne("slide", !0));
308
333
  te(ne("zoom"));
309
334
  te(ne("flip"));
310
- const ge = Te((e, t) => {
311
- const { getToastToRender: r, containerRef: a, isToastActive: s } = Le(e), { className: o, style: n, rtl: i, containerId: g } = e;
335
+ const he = Te((e, t) => {
336
+ const { getToastToRender: s, containerRef: a, isToastActive: r } = Oe(e), { className: o, style: n, rtl: i, containerId: g } = e;
312
337
  function h(p) {
313
- const m = M("Toastify__toast-container", `Toastify__toast-container--${p}`, { "Toastify__toast-container--rtl": i });
314
- return L(o) ? o({ position: p, rtl: i, defaultClassName: m }) : M(m, Z(o));
338
+ const m = k("Toastify__toast-container", `Toastify__toast-container--${p}`, { "Toastify__toast-container--rtl": i });
339
+ return O(o) ? o({ position: p, rtl: i, defaultClassName: m }) : k(m, Z(o));
315
340
  }
316
341
  return U(() => {
317
342
  t && (t.current = a.current);
318
- }, []), T.createElement("div", { ref: a, className: "Toastify", id: g }, r((p, m) => {
343
+ }, []), T.createElement("div", { ref: a, className: "Toastify", id: g }, s((p, m) => {
319
344
  const b = m.length ? { ...n } : { ...n, pointerEvents: "none" };
320
345
  return T.createElement("div", { className: h(p), style: b, key: `container-${p}` }, m.map((u, c) => {
321
346
  let { content: f, props: l } = u;
322
- return T.createElement(xe, { ...l, isIn: s(l.toastId), style: { ...l.style, "--nth": c + 1, "--len": m.length }, key: `toast-${l.key}` }, f);
347
+ return T.createElement(xe, { ...l, isIn: r(l.toastId), style: { ...l.style, "--nth": c + 1, "--len": m.length }, key: `toast-${l.key}` }, f);
323
348
  }));
324
349
  }));
325
350
  });
326
- ge.displayName = "ToastContainer", ge.defaultProps = { position: "top-right", transition: Ae, autoClose: 5e3, closeButton: me, pauseOnHover: !0, pauseOnFocusLoss: !0, closeOnClick: !0, draggable: !0, draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light" };
327
- let re, S = /* @__PURE__ */ new Map(), j = [], _e = 1;
351
+ he.displayName = "ToastContainer", he.defaultProps = { position: "top-right", transition: _e, autoClose: 5e3, closeButton: ye, pauseOnHover: !0, pauseOnFocusLoss: !0, closeOnClick: !0, draggable: !0, draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light" };
352
+ let re, S = /* @__PURE__ */ new Map(), W = [], Ae = 1;
328
353
  function ve() {
329
- return "" + _e++;
354
+ return "" + Ae++;
330
355
  }
331
- function ke(e) {
332
- return e && (q(e.toastId) || Q(e.toastId)) ? e.toastId : ve();
356
+ function Me(e) {
357
+ return e && (j(e.toastId) || Q(e.toastId)) ? e.toastId : ve();
333
358
  }
334
359
  function V(e, t) {
335
- return S.size > 0 ? A.emit(0, e, t) : j.push({ content: e, options: t }), t.toastId;
360
+ return S.size > 0 ? _.emit(0, e, t) : W.push({ content: e, options: t }), t.toastId;
336
361
  }
337
362
  function ee(e, t) {
338
- return { ...t, type: t && t.type || e, toastId: ke(t) };
363
+ return { ...t, type: t && t.type || e, toastId: Me(t) };
339
364
  }
340
365
  function K(e) {
341
- return (t, r) => V(t, ee(e, r));
366
+ return (t, s) => V(t, ee(e, s));
342
367
  }
343
368
  function E(e, t) {
344
369
  return V(e, ee("default", t));
345
370
  }
346
- E.loading = (e, t) => V(e, ee("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...t })), E.promise = function(e, t, r) {
347
- let a, { pending: s, error: o, success: n } = t;
348
- s && (a = q(s) ? E.loading(s, r) : E.loading(s.render, { ...r, ...s }));
371
+ E.loading = (e, t) => V(e, ee("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...t })), E.promise = function(e, t, s) {
372
+ let a, { pending: r, error: o, success: n } = t;
373
+ r && (a = j(r) ? E.loading(r, s) : E.loading(r.render, { ...s, ...r }));
349
374
  const i = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, g = (p, m, b) => {
350
375
  if (m == null)
351
376
  return void E.dismiss(a);
352
- const u = { type: p, ...i, ...r, data: b }, c = q(m) ? { render: m } : m;
377
+ const u = { type: p, ...i, ...s, data: b }, c = j(m) ? { render: m } : m;
353
378
  return a ? E.update(a, { ...u, ...c }) : E(c.render, { ...u, ...c }), b;
354
- }, h = L(e) ? e() : e;
379
+ }, h = O(e) ? e() : e;
355
380
  return h.then((p) => g("success", n, p)).catch((p) => g("error", o, p)), h;
356
381
  }, E.success = K("success"), E.info = K("info"), E.error = K("error"), E.warning = K("warning"), E.warn = E.warning, E.dark = (e, t) => V(e, ee("default", { theme: "dark", ...t })), E.dismiss = (e) => {
357
- S.size > 0 ? A.emit(1, e) : j = j.filter((t) => e != null && t.options.toastId !== e);
382
+ S.size > 0 ? _.emit(1, e) : W = W.filter((t) => e != null && t.options.toastId !== e);
358
383
  }, E.clearWaitingQueue = function(e) {
359
- return e === void 0 && (e = {}), A.emit(5, e);
384
+ return e === void 0 && (e = {}), _.emit(5, e);
360
385
  }, E.isActive = (e) => {
361
386
  let t = !1;
362
- return S.forEach((r) => {
363
- r.isToastActive && r.isToastActive(e) && (t = !0);
387
+ return S.forEach((s) => {
388
+ s.isToastActive && s.isToastActive(e) && (t = !0);
364
389
  }), t;
365
390
  }, E.update = function(e, t) {
366
391
  t === void 0 && (t = {}), setTimeout(() => {
367
- const r = function(a, s) {
368
- let { containerId: o } = s;
392
+ const s = function(a, r) {
393
+ let { containerId: o } = r;
369
394
  const n = S.get(o || re);
370
395
  return n && n.getToast(a);
371
396
  }(e, t);
372
- if (r) {
373
- const { props: a, content: s } = r, o = { delay: 100, ...a, ...t, toastId: t.toastId || e, updateId: ve() };
397
+ if (s) {
398
+ const { props: a, content: r } = s, o = { delay: 100, ...a, ...t, toastId: t.toastId || e, updateId: ve() };
374
399
  o.toastId !== e && (o.staleId = e);
375
- const n = o.render || s;
400
+ const n = o.render || r;
376
401
  delete o.render, V(n, o);
377
402
  }
378
403
  }, 0);
379
404
  }, E.done = (e) => {
380
405
  E.update(e, { progress: 1 });
381
- }, E.onChange = (e) => (A.on(4, e), () => {
382
- A.off(4, e);
383
- }), E.POSITION = { TOP_LEFT: "top-left", TOP_RIGHT: "top-right", TOP_CENTER: "top-center", BOTTOM_LEFT: "bottom-left", BOTTOM_RIGHT: "bottom-right", BOTTOM_CENTER: "bottom-center" }, E.TYPE = { INFO: "info", SUCCESS: "success", WARNING: "warning", ERROR: "error", DEFAULT: "default" }, A.on(2, (e) => {
384
- re = e.containerId || e, S.set(re, e), j.forEach((t) => {
385
- A.emit(0, t.content, t.options);
386
- }), j = [];
406
+ }, E.onChange = (e) => (_.on(4, e), () => {
407
+ _.off(4, e);
408
+ }), E.POSITION = { TOP_LEFT: "top-left", TOP_RIGHT: "top-right", TOP_CENTER: "top-center", BOTTOM_LEFT: "bottom-left", BOTTOM_RIGHT: "bottom-right", BOTTOM_CENTER: "bottom-center" }, E.TYPE = { INFO: "info", SUCCESS: "success", WARNING: "warning", ERROR: "error", DEFAULT: "default" }, _.on(2, (e) => {
409
+ re = e.containerId || e, S.set(re, e), W.forEach((t) => {
410
+ _.emit(0, t.content, t.options);
411
+ }), W = [];
387
412
  }).on(3, (e) => {
388
- S.delete(e.containerId || e), S.size === 0 && A.off(0).off(1).off(5);
413
+ S.delete(e.containerId || e), S.size === 0 && _.off(0).off(1).off(5);
389
414
  });
390
- function Ue(e) {
415
+ function qe(e) {
391
416
  if (e) {
392
417
  const t = Math.trunc(e * 10) / 10;
393
418
  return t % 1 === 0 ? Math.trunc(t) : t;
394
419
  }
395
420
  return 0;
396
421
  }
397
- function le(e) {
398
- var r;
422
+ function ue(e) {
423
+ var s;
399
424
  const t = e == null ? void 0 : e.Reference;
400
425
  if (t) {
401
- const a = Object.values(e["Word Phonetic Evaluation"]), s = (r = t == null ? void 0 : t.split(/\s+/)) == null ? void 0 : r.map((n, i) => {
426
+ const a = Object.values(e["Word Phonetic Evaluation"]), r = (s = t == null ? void 0 : t.split(/\s+/)) == null ? void 0 : s.map((n, i) => {
402
427
  var p;
403
428
  const g = a[i], h = g["Word Score"];
404
429
  return (n == null ? void 0 : n.toLowerCase()) === ((p = g.Word) == null ? void 0 : p.toLowerCase()) ? { text: n, highlight: h <= 45 } : { text: n };
405
430
  });
406
431
  let o = "<p>";
407
- return s == null || s.forEach((n) => {
432
+ return r == null || r.forEach((n) => {
408
433
  n != null && n.highlight ? o += `<span>${n == null ? void 0 : n.text}</span> ` : o += `${n == null ? void 0 : n.text} `;
409
434
  }), o = (o == null ? void 0 : o.trim()) + "</p>", o;
410
435
  }
411
436
  return "";
412
437
  }
413
- const ue = (e, t = {}) => {
438
+ const de = (e, t = {}) => {
414
439
  if (e) {
415
- const r = [];
416
- return e != null && e.relevance && r.push({ value: "relevance", label: "Relevance" }), e != null && e.speech_analysis && r.push({ value: "speech", label: "Speech analysis" }), e != null && e.grammar && r.push({ value: "grammar", label: "Grammar" }), { options: r, data: { ...e, ...t } };
440
+ const s = [];
441
+ return e != null && e.relevance && s.push({ value: "relevance", label: "Relevance" }), e != null && e.speech_analysis && s.push({ value: "speech", label: "Speech analysis" }), e != null && e.grammar && s.push({ value: "grammar", label: "Grammar" }), { options: s, data: { ...e, ...t } };
417
442
  }
418
443
  return null;
419
- }, $e = (e) => {
444
+ }, Ne = (e) => {
420
445
  var a;
421
446
  if (!e)
422
447
  return [];
423
448
  const t = (a = e == null ? void 0 : e.data) == null ? void 0 : a.speech_analysis;
424
- return t == null ? void 0 : t.map((s) => {
449
+ return t == null ? void 0 : t.map((r) => {
425
450
  var n;
426
- const o = (n = Object.values(s == null ? void 0 : s.attempt_data)) == null ? void 0 : n[0];
451
+ const o = (n = Object.values(r == null ? void 0 : r.attempt_data)) == null ? void 0 : n[0];
427
452
  return {
428
453
  data: o,
429
- audioText: s != null && s.model_data ? le(s == null ? void 0 : s.model_data) : void 0,
430
- setupAnalysis: s != null && s.model_data ? ue(
431
- { speech_analysis: [{ model_data: s == null ? void 0 : s.model_data }] },
454
+ audioText: r != null && r.model_data ? ue(r == null ? void 0 : r.model_data) : void 0,
455
+ setupAnalysis: r != null && r.model_data ? de(
456
+ { speech_analysis: [{ model_data: r == null ? void 0 : r.model_data }] },
432
457
  { audio: o == null ? void 0 : o.recording }
433
458
  ) : void 0
434
459
  };
435
460
  });
436
- }, Be = (e) => {
437
- var s;
461
+ }, $e = (e) => {
462
+ var r;
438
463
  if (!e)
439
464
  return [];
440
- const t = (s = e == null ? void 0 : e.data) == null ? void 0 : s.speech_analysis, r = (o) => {
465
+ const t = (r = e == null ? void 0 : e.data) == null ? void 0 : r.speech_analysis, s = (o) => {
441
466
  var g;
442
467
  if (!o)
443
468
  return;
@@ -457,23 +482,23 @@ const ue = (e, t = {}) => {
457
482
  const n = o == null ? void 0 : o.attempt_data;
458
483
  return {
459
484
  data: n,
460
- audioText: o != null && o.model_data ? le(o == null ? void 0 : o.model_data) : void 0,
461
- setupAnalysis: o != null && o.model_data ? ue(
485
+ audioText: o != null && o.model_data ? ue(o == null ? void 0 : o.model_data) : void 0,
486
+ setupAnalysis: o != null && o.model_data ? de(
462
487
  {
463
488
  speech_analysis: [{ model_data: o == null ? void 0 : o.model_data }],
464
- grammar: r((i = n == null ? void 0 : n.recording) == null ? void 0 : i.id)
489
+ grammar: s((i = n == null ? void 0 : n.recording) == null ? void 0 : i.id)
465
490
  },
466
491
  { audio: (n == null ? void 0 : n.recording) || n, student_text: n == null ? void 0 : n.text }
467
492
  ) : void 0
468
493
  };
469
494
  });
470
- }, Me = () => ({ setupAnalysis: ue, getResponse: le, getDialogueByModal: $e, getQuizByModal: Be }), Fe = Me;
471
- function J(e, t, r) {
472
- for (let a = 0; a < r.length; a++)
473
- e.setUint8(t + a, r.charCodeAt(a));
495
+ }, ke = () => ({ setupAnalysis: de, getResponse: ue, getDialogueByModal: Ne, getQuizByModal: $e }), He = ke;
496
+ function J(e, t, s) {
497
+ for (let a = 0; a < s.length; a++)
498
+ e.setUint8(t + a, s.charCodeAt(a));
474
499
  }
475
- function Ne(e) {
476
- const t = e.numberOfChannels, r = e.sampleRate, a = 1, s = 16, o = s / 8, n = t * o, i = r * n, g = [];
500
+ function Be(e) {
501
+ const t = e.numberOfChannels, s = e.sampleRate, a = 1, r = 16, o = r / 8, n = t * o, i = s * n, g = [];
477
502
  for (let f = 0; f < t; f++)
478
503
  g.push(e.getChannelData(f));
479
504
  const h = g[0].length, p = h * t * o, m = new Int16Array(h * t);
@@ -484,43 +509,46 @@ function Ne(e) {
484
509
  d = Math.max(-1, Math.min(1, d)), m[b++] = d < 0 ? d * 32768 : d * 32767;
485
510
  }
486
511
  const u = new ArrayBuffer(44 + p), c = new DataView(u);
487
- return J(c, 0, "RIFF"), c.setUint32(4, 36 + p, !0), J(c, 8, "WAVE"), J(c, 12, "fmt "), c.setUint32(16, 16, !0), c.setUint16(20, a, !0), c.setUint16(22, t, !0), c.setUint32(24, r, !0), c.setUint32(28, i, !0), c.setUint16(32, n, !0), c.setUint16(34, s, !0), J(c, 36, "data"), c.setUint32(40, p, !0), new Int16Array(u, 44).set(m), new Blob([c], { type: "audio/wav" });
512
+ return J(c, 0, "RIFF"), c.setUint32(4, 36 + p, !0), J(c, 8, "WAVE"), J(c, 12, "fmt "), c.setUint32(16, 16, !0), c.setUint16(20, a, !0), c.setUint16(22, t, !0), c.setUint32(24, s, !0), c.setUint32(28, i, !0), c.setUint16(32, n, !0), c.setUint16(34, r, !0), J(c, 36, "data"), c.setUint32(40, p, !0), new Int16Array(u, 44).set(m), new Blob([c], { type: "audio/wav" });
488
513
  }
489
- async function qe(e) {
514
+ async function We(e) {
490
515
  if (!e || e.size === 0)
491
516
  throw new Error("Input blob is empty or null. Cannot convert to WAV.");
492
517
  let t;
493
518
  try {
494
519
  t = new (window.AudioContext || window.webkitAudioContext)();
495
- const r = await e.arrayBuffer(), a = await t.decodeAudioData(r);
496
- return Ne(a);
497
- } catch (r) {
498
- throw console.error("Error during blob to WAV conversion:", r), new Error(`Failed to convert blob to WAV: ${r.message}`);
520
+ const s = await e.arrayBuffer(), a = await t.decodeAudioData(s);
521
+ return Be(a);
522
+ } catch (s) {
523
+ throw console.error("Error during blob to WAV conversion:", s), new Error(`Failed to convert blob to WAV: ${s.message}`);
499
524
  } finally {
500
525
  t && t.state !== "closed" && await t.close();
501
526
  }
502
527
  }
503
- function He(e) {
504
- const r = document.cookie.split("; ");
505
- for (const a of r) {
506
- const [s, o] = a.split("=");
507
- if (s === e)
528
+ function Qe(e) {
529
+ const s = document.cookie.split("; ");
530
+ for (const a of s) {
531
+ const [r, o] = a.split("=");
532
+ if (r === e)
508
533
  return decodeURIComponent(o);
509
534
  }
510
535
  return null;
511
536
  }
512
537
  const De = (e) => {
513
- const t = Math.floor(e), r = Math.floor(t / 60), a = (t % 60).toString().padStart(2, "0");
514
- return `${r}:${a} min`;
515
- }, We = De;
538
+ const t = Math.floor(e), s = Math.floor(t / 60), a = (t % 60).toString().padStart(2, "0");
539
+ return `${s}:${a} min`;
540
+ }, Ve = De;
516
541
  export {
517
542
  E as Q,
518
- ze as a,
519
- We as b,
520
- qe as c,
521
- Ue as f,
522
- He as g,
523
- Se as r,
524
- Fe as u
543
+ Fe as a,
544
+ Ue as b,
545
+ ze as c,
546
+ Qe as d,
547
+ Ve as e,
548
+ qe as f,
549
+ Se as g,
550
+ We as h,
551
+ je as r,
552
+ He as u
525
553
  };
526
- //# sourceMappingURL=formatDuration.-bee1154e.js.map
554
+ //# sourceMappingURL=formatDuration.-ac7eeadf.js.map