@clara.care/react 1.0.5 → 1.0.6
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/clara-widget.cjs.js +41 -31
- package/clara-widget.es.js +336 -326
- package/package.json +1 -1
- package/style.css +1 -1
package/clara-widget.es.js
CHANGED
|
@@ -570,8 +570,8 @@ function spring(n = springDefaults.visualDuration, e = springDefaults.bounce) {
|
|
|
570
570
|
else {
|
|
571
571
|
let _ = x === 0 ? P : 0;
|
|
572
572
|
T < 1 && (_ = x === 0 ? /* @__PURE__ */ secondsToMilliseconds(P) : calcGeneratorVelocity(g, x, B));
|
|
573
|
-
const M = Math.abs(_) <= a,
|
|
574
|
-
l.done = M &&
|
|
573
|
+
const M = Math.abs(_) <= a, D = Math.abs(o - B) <= r;
|
|
574
|
+
l.done = M && D;
|
|
575
575
|
}
|
|
576
576
|
return l.value = l.done ? o : B, l;
|
|
577
577
|
},
|
|
@@ -597,8 +597,8 @@ function inertia({ keyframes: n, velocity: e = 0, power: i = 0.8, timeConstant:
|
|
|
597
597
|
const E = p + T, y = o === void 0 ? E : o(E);
|
|
598
598
|
y !== E && (T = y - p);
|
|
599
599
|
const S = (M) => -T * Math.exp(-M / a), g = (M) => y + S(M), C = (M) => {
|
|
600
|
-
const
|
|
601
|
-
f.done = Math.abs(
|
|
600
|
+
const D = S(M), L = g(M);
|
|
601
|
+
f.done = Math.abs(D) <= c, f.value = f.done ? y : L;
|
|
602
602
|
};
|
|
603
603
|
let x, B;
|
|
604
604
|
const _ = (M) => {
|
|
@@ -615,8 +615,8 @@ function inertia({ keyframes: n, velocity: e = 0, power: i = 0.8, timeConstant:
|
|
|
615
615
|
return _(0), {
|
|
616
616
|
calculatedDuration: null,
|
|
617
617
|
next: (M) => {
|
|
618
|
-
let
|
|
619
|
-
return !B && x === void 0 && (
|
|
618
|
+
let D = !1;
|
|
619
|
+
return !B && x === void 0 && (D = !0, C(M), _(M)), x !== void 0 && M >= x ? B.next(M - x) : (!D && C(M), f);
|
|
620
620
|
}
|
|
621
621
|
};
|
|
622
622
|
}
|
|
@@ -765,8 +765,8 @@ class JSAnimation extends WithPromise {
|
|
|
765
765
|
let g = this.currentTime, C = a;
|
|
766
766
|
if (p) {
|
|
767
767
|
const M = Math.min(this.currentTime, r) / l;
|
|
768
|
-
let
|
|
769
|
-
!L && M >= 1 && (L = 1), L === 1 &&
|
|
768
|
+
let D = Math.floor(M), L = M % 1;
|
|
769
|
+
!L && M >= 1 && (L = 1), L === 1 && D--, D = Math.min(D, p + 1), !!(D % 2) && (f === "reverse" ? (L = 1 - L, m && (L -= m / l)) : f === "mirror" && (C = o)), g = clamp(0, 1, L) * l;
|
|
770
770
|
}
|
|
771
771
|
const x = S ? { done: !1, value: d[0] } : C.next(g);
|
|
772
772
|
s && (x.value = s(x.value));
|
|
@@ -2007,25 +2007,25 @@ const AnimatePresence = ({ children: n, custom: e, initial: i = !0, onExitComple
|
|
|
2007
2007
|
if (p !== E) {
|
|
2008
2008
|
let B = [...p];
|
|
2009
2009
|
for (let _ = 0; _ < S.length; _++) {
|
|
2010
|
-
const M = S[_],
|
|
2011
|
-
f.includes(
|
|
2010
|
+
const M = S[_], D = getChildKey(M);
|
|
2011
|
+
f.includes(D) || (B.splice(_, 0, M), C.push(M));
|
|
2012
2012
|
}
|
|
2013
2013
|
return s === "wait" && C.length && (B = C), g(onlyElements(B)), y(p), null;
|
|
2014
2014
|
}
|
|
2015
2015
|
process.env.NODE_ENV !== "production" && s === "wait" && S.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
2016
2016
|
const { forceRender: x } = useContext(LayoutGroupContext);
|
|
2017
2017
|
return jsx(Fragment, { children: S.map((B) => {
|
|
2018
|
-
const _ = getChildKey(B), M = o && !c ? !1 : p === S || f.includes(_),
|
|
2018
|
+
const _ = getChildKey(B), M = o && !c ? !1 : p === S || f.includes(_), D = () => {
|
|
2019
2019
|
if (T.has(_))
|
|
2020
2020
|
T.set(_, !0);
|
|
2021
2021
|
else
|
|
2022
2022
|
return;
|
|
2023
2023
|
let L = !0;
|
|
2024
|
-
T.forEach((
|
|
2025
|
-
|
|
2024
|
+
T.forEach((N) => {
|
|
2025
|
+
N || (L = !1);
|
|
2026
2026
|
}), L && (x == null || x(), g(P.current), o && (d == null || d()), a && a());
|
|
2027
2027
|
};
|
|
2028
|
-
return jsx(PresenceChild, { isPresent: M, initial: !m.current || i ? void 0 : !1, custom: e, presenceAffectsLayout: r, mode: s, root: u, onExitComplete: M ? void 0 :
|
|
2028
|
+
return jsx(PresenceChild, { isPresent: M, initial: !m.current || i ? void 0 : !1, custom: e, presenceAffectsLayout: r, mode: s, root: u, onExitComplete: M ? void 0 : D, anchorX: l, children: B }, _);
|
|
2029
2029
|
}) });
|
|
2030
2030
|
}, LazyContext = createContext({ strict: !1 }), featureProps = {
|
|
2031
2031
|
animation: [
|
|
@@ -3223,28 +3223,28 @@ function createAnimationState(n) {
|
|
|
3223
3223
|
const _ = checkVariantsDidChange(S.prevProp, g);
|
|
3224
3224
|
let M = _ || // If we're making this variant active, we want to always make it active
|
|
3225
3225
|
y === u && S.isActive && !B && C || // If we removed a higher-priority variant (i is in reverse order)
|
|
3226
|
-
E > P && C,
|
|
3226
|
+
E > P && C, D = !1;
|
|
3227
3227
|
const L = Array.isArray(g) ? g : [g];
|
|
3228
|
-
let
|
|
3229
|
-
x === !1 && (
|
|
3230
|
-
const { prevResolvedValues:
|
|
3231
|
-
...
|
|
3232
|
-
...
|
|
3228
|
+
let N = L.reduce(r(y), {});
|
|
3229
|
+
x === !1 && (N = {});
|
|
3230
|
+
const { prevResolvedValues: F = {} } = S, H = {
|
|
3231
|
+
...F,
|
|
3232
|
+
...N
|
|
3233
3233
|
}, $ = (I) => {
|
|
3234
|
-
M = !0, f.has(I) && (
|
|
3234
|
+
M = !0, f.has(I) && (D = !0, f.delete(I)), S.needsAnimating[I] = !0;
|
|
3235
3235
|
const V = n.getValue(I);
|
|
3236
3236
|
V && (V.liveStyle = !1);
|
|
3237
3237
|
};
|
|
3238
3238
|
for (const I in H) {
|
|
3239
|
-
const V =
|
|
3239
|
+
const V = N[I], A = F[I];
|
|
3240
3240
|
if (m.hasOwnProperty(I))
|
|
3241
3241
|
continue;
|
|
3242
3242
|
let k = !1;
|
|
3243
3243
|
isKeyframesTarget(V) && isKeyframesTarget(A) ? k = !shallowCompare(V, A) : k = V !== A, k ? V != null ? $(I) : f.add(I) : V !== void 0 && f.has(I) ? $(I) : S.protectedKeys[I] = !0;
|
|
3244
3244
|
}
|
|
3245
|
-
S.prevProp = g, S.prevResolvedValues =
|
|
3245
|
+
S.prevProp = g, S.prevResolvedValues = N, S.isActive && (m = { ...m, ...N }), a && n.blockInitialAnimation && (M = !1);
|
|
3246
3246
|
const O = B && _;
|
|
3247
|
-
M && (!O ||
|
|
3247
|
+
M && (!O || D) && p.push(...L.map((I) => {
|
|
3248
3248
|
const V = { type: y };
|
|
3249
3249
|
if (typeof I == "string" && a && !O && n.manuallyAnimateOnMount && n.parent) {
|
|
3250
3250
|
const { parent: A } = n, k = resolveVariant(A, I);
|
|
@@ -6783,7 +6783,7 @@ var lottie$1 = { exports: {} };
|
|
|
6783
6783
|
}
|
|
6784
6784
|
}
|
|
6785
6785
|
};
|
|
6786
|
-
}(),
|
|
6786
|
+
}(), D = /* @__PURE__ */ function() {
|
|
6787
6787
|
var O = [5, 7, 15];
|
|
6788
6788
|
function b(V) {
|
|
6789
6789
|
var A = V.t.p;
|
|
@@ -6836,7 +6836,7 @@ var lottie$1 = { exports: {} };
|
|
|
6836
6836
|
V.assets[A].layers && I(V.assets[A].layers);
|
|
6837
6837
|
}
|
|
6838
6838
|
};
|
|
6839
|
-
}(),
|
|
6839
|
+
}(), N = /* @__PURE__ */ function() {
|
|
6840
6840
|
var O = [4, 4, 18];
|
|
6841
6841
|
function b(V) {
|
|
6842
6842
|
var A, k = V.length, R, G;
|
|
@@ -6872,14 +6872,14 @@ var lottie$1 = { exports: {} };
|
|
|
6872
6872
|
}
|
|
6873
6873
|
};
|
|
6874
6874
|
}();
|
|
6875
|
-
function
|
|
6876
|
-
O.__complete || (L(O), _(O), M(O),
|
|
6875
|
+
function F(O) {
|
|
6876
|
+
O.__complete || (L(O), _(O), M(O), D(O), N(O), E(O.layers, O.assets), y(O.chars, O.assets), O.__complete = !0);
|
|
6877
6877
|
}
|
|
6878
6878
|
function H(O) {
|
|
6879
6879
|
O.t.a.length === 0 && "m" in O.t.p;
|
|
6880
6880
|
}
|
|
6881
6881
|
var $ = {};
|
|
6882
|
-
return $.completeData =
|
|
6882
|
+
return $.completeData = F, $.checkColors = L, $.checkChars = M, $.checkPathProperties = D, $.checkShapes = N, $.completeLayers = E, $;
|
|
6883
6883
|
}
|
|
6884
6884
|
if (s.dataManager || (s.dataManager = P()), s.assetLoader || (s.assetLoader = /* @__PURE__ */ function() {
|
|
6885
6885
|
function E(S) {
|
|
@@ -7526,7 +7526,7 @@ var lottie$1 = { exports: {} };
|
|
|
7526
7526
|
z.style.width = "100%", z.style.height = "100%", z.setAttribute("data-bm-type", V), G.appendChild(z), u(z, b);
|
|
7527
7527
|
}
|
|
7528
7528
|
}
|
|
7529
|
-
function
|
|
7529
|
+
function D() {
|
|
7530
7530
|
var b;
|
|
7531
7531
|
for (b = 0; b < a; b += 1)
|
|
7532
7532
|
e[b].animation.resize();
|
|
@@ -7534,10 +7534,10 @@ var lottie$1 = { exports: {} };
|
|
|
7534
7534
|
function L() {
|
|
7535
7535
|
!o && r && s && (window.requestAnimationFrame(S), s = !1);
|
|
7536
7536
|
}
|
|
7537
|
-
function
|
|
7537
|
+
function N() {
|
|
7538
7538
|
o = !0;
|
|
7539
7539
|
}
|
|
7540
|
-
function
|
|
7540
|
+
function F() {
|
|
7541
7541
|
o = !1, L();
|
|
7542
7542
|
}
|
|
7543
7543
|
function H(b, I) {
|
|
@@ -7555,7 +7555,7 @@ var lottie$1 = { exports: {} };
|
|
|
7555
7555
|
for (I = 0; I < a; I += 1)
|
|
7556
7556
|
e[I].animation.unmute(b);
|
|
7557
7557
|
}
|
|
7558
|
-
return n.registerAnimation = u, n.loadAnimation = m, n.setSpeed = P, n.setDirection = T, n.play = E, n.pause = g, n.stop = x, n.togglePause = B, n.searchAnimations = M, n.resize =
|
|
7558
|
+
return n.registerAnimation = u, n.loadAnimation = m, n.setSpeed = P, n.setDirection = T, n.play = E, n.pause = g, n.stop = x, n.togglePause = B, n.searchAnimations = M, n.resize = D, n.goToAndStop = C, n.destroy = _, n.freeze = N, n.unfreeze = F, n.setVolume = H, n.mute = $, n.unmute = O, n.getRegisteredAnimations = c, n;
|
|
7559
7559
|
}(), BezierFactory = function() {
|
|
7560
7560
|
var n = {};
|
|
7561
7561
|
n.getBezierEasing = i;
|
|
@@ -7584,10 +7584,10 @@ var lottie$1 = { exports: {} };
|
|
|
7584
7584
|
return 3 * d(g, C) * S * S + 2 * p(g, C) * S + f(g);
|
|
7585
7585
|
}
|
|
7586
7586
|
function T(S, g, C, x, B) {
|
|
7587
|
-
var _, M,
|
|
7587
|
+
var _, M, D = 0;
|
|
7588
7588
|
do
|
|
7589
7589
|
M = g + (C - g) / 2, _ = m(M, x, B) - S, _ > 0 ? C = M : g = M;
|
|
7590
|
-
while (Math.abs(_) > s && ++
|
|
7590
|
+
while (Math.abs(_) > s && ++D < o);
|
|
7591
7591
|
return M;
|
|
7592
7592
|
}
|
|
7593
7593
|
function E(S, g, C, x) {
|
|
@@ -7620,11 +7620,11 @@ var lottie$1 = { exports: {} };
|
|
|
7620
7620
|
* getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
|
|
7621
7621
|
*/
|
|
7622
7622
|
_getTForX: function(g) {
|
|
7623
|
-
for (var C = this._p[0], x = this._p[2], B = this._mSampleValues, _ = 0, M = 1,
|
|
7623
|
+
for (var C = this._p[0], x = this._p[2], B = this._mSampleValues, _ = 0, M = 1, D = l - 1; M !== D && B[M] <= g; ++M)
|
|
7624
7624
|
_ += u;
|
|
7625
7625
|
--M;
|
|
7626
|
-
var L = (g - B[M]) / (B[M + 1] - B[M]),
|
|
7627
|
-
return
|
|
7626
|
+
var L = (g - B[M]) / (B[M + 1] - B[M]), N = _ + L * u, F = P(N, C, x);
|
|
7627
|
+
return F >= r ? E(g, N, C, x) : F === 0 ? N : T(g, _, _ + u, C, x);
|
|
7628
7628
|
}
|
|
7629
7629
|
}, n;
|
|
7630
7630
|
}(), pooling = /* @__PURE__ */ function() {
|
|
@@ -7687,10 +7687,10 @@ var lottie$1 = { exports: {} };
|
|
|
7687
7687
|
}
|
|
7688
7688
|
var a = /* @__PURE__ */ function() {
|
|
7689
7689
|
return function(f, m, P, T) {
|
|
7690
|
-
var E = getDefaultCurveSegments(), y, S, g, C, x, B = 0, _, M = [],
|
|
7690
|
+
var E = getDefaultCurveSegments(), y, S, g, C, x, B = 0, _, M = [], D = [], L = bezierLengthPool.newElement();
|
|
7691
7691
|
for (g = P.length, y = 0; y < E; y += 1) {
|
|
7692
7692
|
for (x = y / (E - 1), _ = 0, S = 0; S < g; S += 1)
|
|
7693
|
-
C = bmPow(1 - x, 3) * f[S] + 3 * bmPow(1 - x, 2) * x * P[S] + 3 * (1 - x) * bmPow(x, 2) * T[S] + bmPow(x, 3) * m[S], M[S] = C,
|
|
7693
|
+
C = bmPow(1 - x, 3) * f[S] + 3 * bmPow(1 - x, 2) * x * P[S] + 3 * (1 - x) * bmPow(x, 2) * T[S] + bmPow(x, 3) * m[S], M[S] = C, D[S] !== null && (_ += bmPow(M[S] - D[S], 2)), D[S] = M[S];
|
|
7694
7694
|
_ && (_ = bmSqrt(_), B += _), L.percents[y] = x, L.lengths[y] = B;
|
|
7695
7695
|
}
|
|
7696
7696
|
return L.addedLength = B, L;
|
|
@@ -7713,15 +7713,15 @@ var lottie$1 = { exports: {} };
|
|
|
7713
7713
|
return function(m, P, T, E) {
|
|
7714
7714
|
var y = (m[0] + "_" + m[1] + "_" + P[0] + "_" + P[1] + "_" + T[0] + "_" + T[1] + "_" + E[0] + "_" + E[1]).replace(/\./g, "p");
|
|
7715
7715
|
if (!f[y]) {
|
|
7716
|
-
var S = getDefaultCurveSegments(), g, C, x, B, _, M = 0,
|
|
7716
|
+
var S = getDefaultCurveSegments(), g, C, x, B, _, M = 0, D, L, N = null;
|
|
7717
7717
|
m.length === 2 && (m[0] !== P[0] || m[1] !== P[1]) && e(m[0], m[1], P[0], P[1], m[0] + T[0], m[1] + T[1]) && e(m[0], m[1], P[0], P[1], P[0] + E[0], P[1] + E[1]) && (S = 2);
|
|
7718
|
-
var
|
|
7718
|
+
var F = new s(S);
|
|
7719
7719
|
for (x = T.length, g = 0; g < S; g += 1) {
|
|
7720
|
-
for (L = createSizedArray(x), _ = g / (S - 1),
|
|
7721
|
-
B = bmPow(1 - _, 3) * m[C] + 3 * bmPow(1 - _, 2) * _ * (m[C] + T[C]) + 3 * (1 - _) * bmPow(_, 2) * (P[C] + E[C]) + bmPow(_, 3) * P[C], L[C] = B,
|
|
7722
|
-
|
|
7720
|
+
for (L = createSizedArray(x), _ = g / (S - 1), D = 0, C = 0; C < x; C += 1)
|
|
7721
|
+
B = bmPow(1 - _, 3) * m[C] + 3 * bmPow(1 - _, 2) * _ * (m[C] + T[C]) + 3 * (1 - _) * bmPow(_, 2) * (P[C] + E[C]) + bmPow(_, 3) * P[C], L[C] = B, N !== null && (D += bmPow(L[C] - N[C], 2));
|
|
7722
|
+
D = bmSqrt(D), M += D, F.points[g] = new o(D, L), N = L;
|
|
7723
7723
|
}
|
|
7724
|
-
|
|
7724
|
+
F.segmentLength = M, f[y] = F;
|
|
7725
7725
|
}
|
|
7726
7726
|
return f[y];
|
|
7727
7727
|
};
|
|
@@ -7747,9 +7747,9 @@ var lottie$1 = { exports: {} };
|
|
|
7747
7747
|
E < 0 ? E = 0 : E > 1 && (E = 1);
|
|
7748
7748
|
var g = u(E, S);
|
|
7749
7749
|
y = y > 1 ? 1 : y;
|
|
7750
|
-
var C = u(y, S), x, B = f.length, _ = 1 - g, M = 1 - C,
|
|
7750
|
+
var C = u(y, S), x, B = f.length, _ = 1 - g, M = 1 - C, D = _ * _ * _, L = g * _ * _ * 3, N = g * g * _ * 3, F = g * g * g, H = _ * _ * M, $ = g * _ * M + _ * g * M + _ * _ * C, O = g * g * M + _ * g * C + g * _ * C, b = g * g * C, I = _ * M * M, V = g * M * M + _ * C * M + _ * M * C, A = g * C * M + _ * C * C + g * M * C, k = g * C * C, R = M * M * M, G = C * M * M + M * C * M + M * M * C, z = C * C * M + M * C * C + C * M * C, q = C * C * C;
|
|
7751
7751
|
for (x = 0; x < B; x += 1)
|
|
7752
|
-
d[x * 4] = n.round((
|
|
7752
|
+
d[x * 4] = n.round((D * f[x] + L * P[x] + N * T[x] + F * m[x]) * 1e3) / 1e3, d[x * 4 + 1] = n.round((H * f[x] + $ * P[x] + O * T[x] + b * m[x]) * 1e3) / 1e3, d[x * 4 + 2] = n.round((I * f[x] + V * P[x] + A * T[x] + k * m[x]) * 1e3) / 1e3, d[x * 4 + 3] = n.round((R * f[x] + G * P[x] + z * T[x] + q * m[x]) * 1e3) / 1e3;
|
|
7753
7753
|
return d;
|
|
7754
7754
|
}
|
|
7755
7755
|
return {
|
|
@@ -7803,7 +7803,7 @@ var lottie$1 = { exports: {} };
|
|
|
7803
7803
|
e._lastPoint = T, e._lastAddedLength = M - C.points[T].partialLength, e._lastKeyframeIndex = s;
|
|
7804
7804
|
}
|
|
7805
7805
|
} else {
|
|
7806
|
-
var
|
|
7806
|
+
var D, L, N, F, H;
|
|
7807
7807
|
if (o = u.s.length, g = c.s || u.e, this.sh && u.h !== 1)
|
|
7808
7808
|
if (n >= y)
|
|
7809
7809
|
a[0] = g[0], a[1] = g[1], a[2] = g[2];
|
|
@@ -7815,7 +7815,7 @@ var lottie$1 = { exports: {} };
|
|
|
7815
7815
|
}
|
|
7816
7816
|
else
|
|
7817
7817
|
for (s = 0; s < o; s += 1)
|
|
7818
|
-
u.h !== 1 && (n >= y ? m = 1 : n < S ? m = 0 : (u.o.x.constructor === Array ? (d.__fnct || (d.__fnct = []), d.__fnct[s] ? E = d.__fnct[s] : (
|
|
7818
|
+
u.h !== 1 && (n >= y ? m = 1 : n < S ? m = 0 : (u.o.x.constructor === Array ? (d.__fnct || (d.__fnct = []), d.__fnct[s] ? E = d.__fnct[s] : (D = u.o.x[s] === void 0 ? u.o.x[0] : u.o.x[s], L = u.o.y[s] === void 0 ? u.o.y[0] : u.o.y[s], N = u.i.x[s] === void 0 ? u.i.x[0] : u.i.x[s], F = u.i.y[s] === void 0 ? u.i.y[0] : u.i.y[s], E = BezierFactory.getBezierEasing(D, L, N, F).get, d.__fnct[s] = E)) : d.__fnct ? E = d.__fnct : (D = u.o.x, L = u.o.y, N = u.i.x, F = u.i.y, E = BezierFactory.getBezierEasing(D, L, N, F).get, u.keyframeMetadata = E), m = E((n - S) / (y - S)))), g = c.s || u.e, H = u.h === 1 ? u.s[s] : u.s[s] + (g[s] - u.s[s]) * m, this.propType === "multidimensional" ? a[s] = H : a = H;
|
|
7819
7819
|
}
|
|
7820
7820
|
return e.lastIndex = r, a;
|
|
7821
7821
|
}
|
|
@@ -8036,7 +8036,7 @@ var lottie$1 = { exports: {} };
|
|
|
8036
8036
|
}(), ShapePropertyFactory = function() {
|
|
8037
8037
|
var n = -999999;
|
|
8038
8038
|
function e(y, S, g) {
|
|
8039
|
-
var C = g.lastIndex, x, B, _, M,
|
|
8039
|
+
var C = g.lastIndex, x, B, _, M, D, L, N, F, H, $ = this.keyframes;
|
|
8040
8040
|
if (y < $[0].t - this.offsetTime)
|
|
8041
8041
|
x = $[0].s[0], _ = !0, C = 0;
|
|
8042
8042
|
else if (y >= $[$.length - 1].t - this.offsetTime)
|
|
@@ -8046,20 +8046,20 @@ var lottie$1 = { exports: {} };
|
|
|
8046
8046
|
O < b - 1 ? O += 1 : I = !1;
|
|
8047
8047
|
if (k = this.keyframesMetadata[O] || {}, _ = V.h === 1, C = O, !_) {
|
|
8048
8048
|
if (y >= A.t - this.offsetTime)
|
|
8049
|
-
|
|
8049
|
+
F = 1;
|
|
8050
8050
|
else if (y < V.t - this.offsetTime)
|
|
8051
|
-
|
|
8051
|
+
F = 0;
|
|
8052
8052
|
else {
|
|
8053
8053
|
var R;
|
|
8054
|
-
k.__fnct ? R = k.__fnct : (R = BezierFactory.getBezierEasing(V.o.x, V.o.y, V.i.x, V.i.y).get, k.__fnct = R),
|
|
8054
|
+
k.__fnct ? R = k.__fnct : (R = BezierFactory.getBezierEasing(V.o.x, V.o.y, V.i.x, V.i.y).get, k.__fnct = R), F = R((y - (V.t - this.offsetTime)) / (A.t - this.offsetTime - (V.t - this.offsetTime)));
|
|
8055
8055
|
}
|
|
8056
8056
|
B = A.s ? A.s[0] : V.e[0];
|
|
8057
8057
|
}
|
|
8058
8058
|
x = V.s[0];
|
|
8059
8059
|
}
|
|
8060
|
-
for (L = S._length,
|
|
8061
|
-
for (
|
|
8062
|
-
H = _ ? x.i[M][
|
|
8060
|
+
for (L = S._length, N = x.i[0].length, g.lastIndex = C, M = 0; M < L; M += 1)
|
|
8061
|
+
for (D = 0; D < N; D += 1)
|
|
8062
|
+
H = _ ? x.i[M][D] : x.i[M][D] + (B.i[M][D] - x.i[M][D]) * F, S.i[M][D] = H, H = _ ? x.o[M][D] : x.o[M][D] + (B.o[M][D] - x.o[M][D]) * F, S.o[M][D] = H, H = _ ? x.v[M][D] : x.v[M][D] + (B.v[M][D] - x.v[M][D]) * F, S.v[M][D] = H;
|
|
8063
8063
|
}
|
|
8064
8064
|
function i() {
|
|
8065
8065
|
var y = this.comp.renderedFrame - this.offsetTime, S = this.keyframes[0].t - this.offsetTime, g = this.keyframes[this.keyframes.length - 1].t - this.offsetTime, C = this._caching.lastFrame;
|
|
@@ -8128,8 +8128,8 @@ var lottie$1 = { exports: {} };
|
|
|
8128
8128
|
this.elem.globalData.frameId !== this.frameId && (this.frameId = this.elem.globalData.frameId, this.iterateDynamicProperties(), this._mdf && this.convertEllToPath());
|
|
8129
8129
|
},
|
|
8130
8130
|
convertEllToPath: function() {
|
|
8131
|
-
var C = this.p.v[0], x = this.p.v[1], B = this.s.v[0] / 2, _ = this.s.v[1] / 2, M = this.d !== 3,
|
|
8132
|
-
|
|
8131
|
+
var C = this.p.v[0], x = this.p.v[1], B = this.s.v[0] / 2, _ = this.s.v[1] / 2, M = this.d !== 3, D = this.v;
|
|
8132
|
+
D.v[0][0] = C, D.v[0][1] = x - _, D.v[1][0] = M ? C + B : C - B, D.v[1][1] = x, D.v[2][0] = C, D.v[2][1] = x + _, D.v[3][0] = M ? C - B : C + B, D.v[3][1] = x, D.i[0][0] = M ? C - B * y : C + B * y, D.i[0][1] = x - _, D.i[1][0] = M ? C + B : C - B, D.i[1][1] = x - _ * y, D.i[2][0] = M ? C + B * y : C - B * y, D.i[2][1] = x + _, D.i[3][0] = M ? C - B : C + B, D.i[3][1] = x + _ * y, D.o[0][0] = M ? C + B * y : C - B * y, D.o[0][1] = x - _, D.o[1][0] = M ? C + B : C - B, D.o[1][1] = x + _ * y, D.o[2][0] = M ? C - B * y : C + B * y, D.o[2][1] = x + _, D.o[3][0] = M ? C - B : C + B, D.o[3][1] = x - _ * y;
|
|
8133
8133
|
}
|
|
8134
8134
|
}, extendPrototype([DynamicPropertyContainer], S), S;
|
|
8135
8135
|
}(), p = function() {
|
|
@@ -8142,20 +8142,20 @@ var lottie$1 = { exports: {} };
|
|
|
8142
8142
|
this.elem.globalData.frameId !== this.frameId && (this.frameId = this.elem.globalData.frameId, this.iterateDynamicProperties(), this._mdf && this.convertToPath());
|
|
8143
8143
|
},
|
|
8144
8144
|
convertStarToPath: function() {
|
|
8145
|
-
var g = Math.floor(this.pt.v) * 2, C = Math.PI * 2 / g, x = !0, B = this.or.v, _ = this.ir.v, M = this.os.v,
|
|
8145
|
+
var g = Math.floor(this.pt.v) * 2, C = Math.PI * 2 / g, x = !0, B = this.or.v, _ = this.ir.v, M = this.os.v, D = this.is.v, L = 2 * Math.PI * B / (g * 2), N = 2 * Math.PI * _ / (g * 2), F, H, $, O, b = -Math.PI / 2;
|
|
8146
8146
|
b += this.r.v;
|
|
8147
8147
|
var I = this.data.d === 3 ? -1 : 1;
|
|
8148
|
-
for (this.v._length = 0,
|
|
8149
|
-
H = x ? B : _, $ = x ? M :
|
|
8148
|
+
for (this.v._length = 0, F = 0; F < g; F += 1) {
|
|
8149
|
+
H = x ? B : _, $ = x ? M : D, O = x ? L : N;
|
|
8150
8150
|
var V = H * Math.cos(b), A = H * Math.sin(b), k = V === 0 && A === 0 ? 0 : A / Math.sqrt(V * V + A * A), R = V === 0 && A === 0 ? 0 : -V / Math.sqrt(V * V + A * A);
|
|
8151
|
-
V += +this.p.v[0], A += +this.p.v[1], this.v.setTripleAt(V, A, V - k * O * $ * I, A - R * O * $ * I, V + k * O * $ * I, A + R * O * $ * I,
|
|
8151
|
+
V += +this.p.v[0], A += +this.p.v[1], this.v.setTripleAt(V, A, V - k * O * $ * I, A - R * O * $ * I, V + k * O * $ * I, A + R * O * $ * I, F, !0), x = !x, b += C * I;
|
|
8152
8152
|
}
|
|
8153
8153
|
},
|
|
8154
8154
|
convertPolygonToPath: function() {
|
|
8155
|
-
var g = Math.floor(this.pt.v), C = Math.PI * 2 / g, x = this.or.v, B = this.os.v, _ = 2 * Math.PI * x / (g * 4), M,
|
|
8156
|
-
for (
|
|
8157
|
-
var
|
|
8158
|
-
|
|
8155
|
+
var g = Math.floor(this.pt.v), C = Math.PI * 2 / g, x = this.or.v, B = this.os.v, _ = 2 * Math.PI * x / (g * 4), M, D = -Math.PI * 0.5, L = this.data.d === 3 ? -1 : 1;
|
|
8156
|
+
for (D += this.r.v, this.v._length = 0, M = 0; M < g; M += 1) {
|
|
8157
|
+
var N = x * Math.cos(D), F = x * Math.sin(D), H = N === 0 && F === 0 ? 0 : F / Math.sqrt(N * N + F * F), $ = N === 0 && F === 0 ? 0 : -N / Math.sqrt(N * N + F * F);
|
|
8158
|
+
N += +this.p.v[0], F += +this.p.v[1], this.v.setTripleAt(N, F, N - H * _ * B * L, F - $ * _ * B * L, N + H * _ * B * L, F + $ * _ * B * L, M, !0), D += C * L;
|
|
8159
8159
|
}
|
|
8160
8160
|
this.paths.length = 0, this.paths[0] = this.v;
|
|
8161
8161
|
}
|
|
@@ -8252,8 +8252,8 @@ var lottie$1 = { exports: {} };
|
|
|
8252
8252
|
var Y = this.props;
|
|
8253
8253
|
if (V === 1 && A === 0 && k === 0 && R === 0 && G === 0 && z === 1 && q === 0 && U === 0 && K === 0 && j === 0 && ne === 1 && xe === 0)
|
|
8254
8254
|
return Y[12] = Y[12] * V + Y[15] * ye, Y[13] = Y[13] * z + Y[15] * ge, Y[14] = Y[14] * ne + Y[15] * Ee, Y[15] *= oe, this._identityCalculated = !1, this;
|
|
8255
|
-
var
|
|
8256
|
-
return Y[0] =
|
|
8255
|
+
var Fe = Y[0], Oe = Y[1], Le = Y[2], Ce = Y[3], De = Y[4], ae = Y[5], se = Y[6], de = Y[7], Be = Y[8], he = Y[9], Ie = Y[10], Ae = Y[11], Re = Y[12], fe = Y[13], ke = Y[14], pe = Y[15];
|
|
8256
|
+
return Y[0] = Fe * V + Oe * G + Le * K + Ce * ye, Y[1] = Fe * A + Oe * z + Le * j + Ce * ge, Y[2] = Fe * k + Oe * q + Le * ne + Ce * Ee, Y[3] = Fe * R + Oe * U + Le * xe + Ce * oe, Y[4] = De * V + ae * G + se * K + de * ye, Y[5] = De * A + ae * z + se * j + de * ge, Y[6] = De * k + ae * q + se * ne + de * Ee, Y[7] = De * R + ae * U + se * xe + de * oe, Y[8] = Be * V + he * G + Ie * K + Ae * ye, Y[9] = Be * A + he * z + Ie * j + Ae * ge, Y[10] = Be * k + he * q + Ie * ne + Ae * Ee, Y[11] = Be * R + he * U + Ie * xe + Ae * oe, Y[12] = Re * V + fe * G + ke * K + pe * ye, Y[13] = Re * A + fe * z + ke * j + pe * ge, Y[14] = Re * k + fe * q + ke * ne + pe * Ee, Y[15] = Re * R + fe * U + ke * xe + pe * oe, this._identityCalculated = !1, this;
|
|
8257
8257
|
}
|
|
8258
8258
|
function E(V) {
|
|
8259
8259
|
var A = V.props;
|
|
@@ -8297,7 +8297,7 @@ var lottie$1 = { exports: {} };
|
|
|
8297
8297
|
function M(V, A, k) {
|
|
8298
8298
|
return V * this.props[2] + A * this.props[6] + k * this.props[10] + this.props[14];
|
|
8299
8299
|
}
|
|
8300
|
-
function
|
|
8300
|
+
function D() {
|
|
8301
8301
|
var V = this.props[0] * this.props[5] - this.props[1] * this.props[4], A = this.props[5] / V, k = -this.props[1] / V, R = -this.props[4] / V, G = this.props[0] / V, z = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / V, q = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / V, U = new Matrix();
|
|
8302
8302
|
return U.props[0] = A, U.props[1] = k, U.props[4] = R, U.props[5] = G, U.props[12] = z, U.props[13] = q, U;
|
|
8303
8303
|
}
|
|
@@ -8305,13 +8305,13 @@ var lottie$1 = { exports: {} };
|
|
|
8305
8305
|
var A = this.getInverseMatrix();
|
|
8306
8306
|
return A.applyToPointArray(V[0], V[1], V[2] || 0);
|
|
8307
8307
|
}
|
|
8308
|
-
function
|
|
8308
|
+
function N(V) {
|
|
8309
8309
|
var A, k = V.length, R = [];
|
|
8310
8310
|
for (A = 0; A < k; A += 1)
|
|
8311
8311
|
R[A] = L(V[A]);
|
|
8312
8312
|
return R;
|
|
8313
8313
|
}
|
|
8314
|
-
function
|
|
8314
|
+
function F(V, A, k) {
|
|
8315
8315
|
var R = createTypedArray("float32", 6);
|
|
8316
8316
|
if (this.isIdentity())
|
|
8317
8317
|
R[0] = V[0], R[1] = V[1], R[2] = A[0], R[3] = A[1], R[4] = k[0], R[5] = k[1];
|
|
@@ -8345,7 +8345,7 @@ var lottie$1 = { exports: {} };
|
|
|
8345
8345
|
return "matrix(" + A + "," + k + "," + R + "," + G + "," + z + "," + q + ")";
|
|
8346
8346
|
}
|
|
8347
8347
|
return function() {
|
|
8348
|
-
this.reset = r, this.rotate = s, this.rotateX = o, this.rotateY = l, this.rotateZ = u, this.skew = d, this.skewFromAxis = p, this.shear = c, this.scale = f, this.setTransform = m, this.translate = P, this.transform = T, this.multiply = E, this.applyToPoint = x, this.applyToX = B, this.applyToY = _, this.applyToZ = M, this.applyToPointArray = H, this.applyToTriplePoints =
|
|
8348
|
+
this.reset = r, this.rotate = s, this.rotateX = o, this.rotateY = l, this.rotateZ = u, this.skew = d, this.skewFromAxis = p, this.shear = c, this.scale = f, this.setTransform = m, this.translate = P, this.transform = T, this.multiply = E, this.applyToPoint = x, this.applyToX = B, this.applyToY = _, this.applyToZ = M, this.applyToPointArray = H, this.applyToTriplePoints = F, this.applyToPointStringified = $, this.toCSS = O, this.to2dCSS = I, this.clone = g, this.cloneFromProps = C, this.equals = S, this.inversePoints = N, this.inversePoint = L, this.getInverseMatrix = D, this._t = this.transform, this.isIdentity = y, this._identity = !0, this._identityCalculated = !1, this.props = createTypedArray("float32", 16), this.reset();
|
|
8349
8349
|
};
|
|
8350
8350
|
}();
|
|
8351
8351
|
function _typeof$3(n) {
|
|
@@ -9309,17 +9309,17 @@ var lottie$1 = { exports: {} };
|
|
|
9309
9309
|
function M(b) {
|
|
9310
9310
|
return b === l;
|
|
9311
9311
|
}
|
|
9312
|
-
function
|
|
9312
|
+
function D(b) {
|
|
9313
9313
|
var I = x(b);
|
|
9314
9314
|
return I >= c && I <= d;
|
|
9315
9315
|
}
|
|
9316
9316
|
function L(b) {
|
|
9317
|
-
return
|
|
9317
|
+
return D(b.substr(0, 2)) && D(b.substr(2, 2));
|
|
9318
9318
|
}
|
|
9319
|
-
function
|
|
9319
|
+
function N(b) {
|
|
9320
9320
|
return i.indexOf(b) !== -1;
|
|
9321
9321
|
}
|
|
9322
|
-
function
|
|
9322
|
+
function F(b, I) {
|
|
9323
9323
|
var V = x(b.substr(I, 2));
|
|
9324
9324
|
if (V !== a)
|
|
9325
9325
|
return !1;
|
|
@@ -9337,7 +9337,7 @@ var lottie$1 = { exports: {} };
|
|
|
9337
9337
|
var $ = function() {
|
|
9338
9338
|
this.fonts = [], this.chars = null, this.typekitLoaded = 0, this.isLoaded = !1, this._warned = !1, this.initTime = Date.now(), this.setIsLoadedBinded = this.setIsLoaded.bind(this), this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);
|
|
9339
9339
|
};
|
|
9340
|
-
$.isModifier = B, $.isZeroWidthJoiner = _, $.isFlagEmoji = L, $.isRegionalCode =
|
|
9340
|
+
$.isModifier = B, $.isZeroWidthJoiner = _, $.isFlagEmoji = L, $.isRegionalCode = D, $.isCombinedCharacter = N, $.isRegionalFlag = F, $.isVariationSelector = M, $.BLACK_FLAG_CODE_POINT = a;
|
|
9341
9341
|
var O = {
|
|
9342
9342
|
addChars: y,
|
|
9343
9343
|
addFonts: E,
|
|
@@ -10296,14 +10296,14 @@ var lottie$1 = { exports: {} };
|
|
|
10296
10296
|
function s() {
|
|
10297
10297
|
}
|
|
10298
10298
|
function o(p, f, m) {
|
|
10299
|
-
var P, T, E, y, S, g, C = f.styles.length, x = f.lvl, B, _, M,
|
|
10299
|
+
var P, T, E, y, S, g, C = f.styles.length, x = f.lvl, B, _, M, D;
|
|
10300
10300
|
for (g = 0; g < C; g += 1) {
|
|
10301
10301
|
if (y = f.sh._mdf || m, f.styles[g].lvl < x) {
|
|
10302
|
-
for (_ = e.reset(), M = x - f.styles[g].lvl,
|
|
10303
|
-
y = f.transformers[
|
|
10302
|
+
for (_ = e.reset(), M = x - f.styles[g].lvl, D = f.transformers.length - 1; !y && M > 0; )
|
|
10303
|
+
y = f.transformers[D].mProps._mdf || y, M -= 1, D -= 1;
|
|
10304
10304
|
if (y)
|
|
10305
|
-
for (M = x - f.styles[g].lvl,
|
|
10306
|
-
_.multiply(f.transformers[
|
|
10305
|
+
for (M = x - f.styles[g].lvl, D = f.transformers.length - 1; M > 0; )
|
|
10306
|
+
_.multiply(f.transformers[D].mProps.v), M -= 1, D -= 1;
|
|
10307
10307
|
} else
|
|
10308
10308
|
_ = n;
|
|
10309
10309
|
if (B = f.sh.paths, T = B._length, y) {
|
|
@@ -10335,9 +10335,9 @@ var lottie$1 = { exports: {} };
|
|
|
10335
10335
|
var x, B, _, M;
|
|
10336
10336
|
if (f.g._cmdf || m) {
|
|
10337
10337
|
x = f.cst;
|
|
10338
|
-
var
|
|
10338
|
+
var D = f.g.c;
|
|
10339
10339
|
for (_ = x.length, B = 0; B < _; B += 1)
|
|
10340
|
-
M = x[B], M.setAttribute("offset",
|
|
10340
|
+
M = x[B], M.setAttribute("offset", D[B * 4] + "%"), M.setAttribute("stop-color", "rgb(" + D[B * 4 + 1] + "," + D[B * 4 + 2] + "," + D[B * 4 + 3] + ")");
|
|
10341
10341
|
}
|
|
10342
10342
|
if (T && (f.g._omdf || m)) {
|
|
10343
10343
|
var L = f.g.o;
|
|
@@ -10347,12 +10347,12 @@ var lottie$1 = { exports: {} };
|
|
|
10347
10347
|
if (p.t === 1)
|
|
10348
10348
|
(f.e._mdf || m) && (P.setAttribute("x2", y[0]), P.setAttribute("y2", y[1]), T && !f.g._collapsable && (f.of.setAttribute("x2", y[0]), f.of.setAttribute("y2", y[1])));
|
|
10349
10349
|
else {
|
|
10350
|
-
var
|
|
10351
|
-
if ((f.s._mdf || f.e._mdf || m) && (
|
|
10352
|
-
|
|
10353
|
-
var
|
|
10350
|
+
var N;
|
|
10351
|
+
if ((f.s._mdf || f.e._mdf || m) && (N = Math.sqrt(Math.pow(E[0] - y[0], 2) + Math.pow(E[1] - y[1], 2)), P.setAttribute("r", N), T && !f.g._collapsable && f.of.setAttribute("r", N)), f.s._mdf || f.e._mdf || f.h._mdf || f.a._mdf || m) {
|
|
10352
|
+
N || (N = Math.sqrt(Math.pow(E[0] - y[0], 2) + Math.pow(E[1] - y[1], 2)));
|
|
10353
|
+
var F = Math.atan2(y[1] - E[1], y[0] - E[0]), H = f.h.v;
|
|
10354
10354
|
H >= 1 ? H = 0.99 : H <= -1 && (H = -0.99);
|
|
10355
|
-
var $ =
|
|
10355
|
+
var $ = N * H, O = Math.cos(F + f.a.v) * $ + E[0], b = Math.sin(F + f.a.v) * $ + E[1];
|
|
10356
10356
|
P.setAttribute("fx", O), P.setAttribute("fy", b), T && !f.g._collapsable && (f.of.setAttribute("fx", O), f.of.setAttribute("fy", b));
|
|
10357
10357
|
}
|
|
10358
10358
|
}
|
|
@@ -10546,12 +10546,12 @@ var lottie$1 = { exports: {} };
|
|
|
10546
10546
|
n.fWeight = x.weight, n.fStyle = x.style, n.finalSize = n.s, n.finalText = this.buildFinalText(n.t), s = n.finalText.length, n.finalLineHeight = n.lh;
|
|
10547
10547
|
var B = n.tr / 1e3 * n.finalSize, _;
|
|
10548
10548
|
if (n.sz)
|
|
10549
|
-
for (var M = !0,
|
|
10550
|
-
|
|
10549
|
+
for (var M = !0, D = n.sz[0], L = n.sz[1], N, F; M; ) {
|
|
10550
|
+
F = this.buildFinalText(n.t), N = 0, P = 0, s = F.length, B = n.tr / 1e3 * n.finalSize;
|
|
10551
10551
|
var H = -1;
|
|
10552
10552
|
for (r = 0; r < s; r += 1)
|
|
10553
|
-
_ =
|
|
10554
|
-
|
|
10553
|
+
_ = F[r].charCodeAt(0), o = !1, F[r] === " " ? H = r : (_ === 13 || _ === 3) && (P = 0, o = !0, N += n.finalLineHeight || n.finalSize * 1.2), e.chars ? (g = e.getCharData(F[r], S.fStyle, S.fFamily), C = o ? 0 : g.w * n.finalSize / 100) : C = e.measureText(F[r], n.f, n.finalSize), P + C > D && F[r] !== " " ? (H === -1 ? s += 1 : r = H, N += n.finalLineHeight || n.finalSize * 1.2, F.splice(r, H === r ? 1 : 0, "\r"), H = -1, P = 0) : (P += C, P += B);
|
|
10554
|
+
N += S.ascent * n.finalSize / 100, this.canResize && n.finalSize > this.minimumFontSize && L < N ? (n.finalSize -= 1, n.finalLineHeight = n.finalSize * n.lh / n.s) : (n.finalText = F, s = n.finalText.length, M = !1);
|
|
10555
10555
|
}
|
|
10556
10556
|
P = -B, C = 0;
|
|
10557
10557
|
var $ = 0, O;
|
|
@@ -10726,20 +10726,20 @@ var lottie$1 = { exports: {} };
|
|
|
10726
10726
|
}, TextAnimatorProperty.prototype.getMeasures = function(n, e) {
|
|
10727
10727
|
if (this.lettersChangedFlag = e, !(!this._mdf && !this._isFirstFrame && !e && (!this._hasMaskedPath || !this._pathData.m._mdf))) {
|
|
10728
10728
|
this._isFirstFrame = !1;
|
|
10729
|
-
var i = this._moreOptions.alignment.v, a = this._animatorsData, r = this._textData, s = this.mHelper, o = this._renderType, l = this.renderedLetters.length, u, c, d, p, f = n.l, m, P, T, E, y, S, g, C, x, B, _, M,
|
|
10729
|
+
var i = this._moreOptions.alignment.v, a = this._animatorsData, r = this._textData, s = this.mHelper, o = this._renderType, l = this.renderedLetters.length, u, c, d, p, f = n.l, m, P, T, E, y, S, g, C, x, B, _, M, D, L, N;
|
|
10730
10730
|
if (this._hasMaskedPath) {
|
|
10731
|
-
if (
|
|
10732
|
-
var
|
|
10733
|
-
this._pathData.r.v && (
|
|
10731
|
+
if (N = this._pathData.m, !this._pathData.n || this._pathData._mdf) {
|
|
10732
|
+
var F = N.v;
|
|
10733
|
+
this._pathData.r.v && (F = F.reverse()), m = {
|
|
10734
10734
|
tLength: 0,
|
|
10735
10735
|
segments: []
|
|
10736
|
-
}, p =
|
|
10736
|
+
}, p = F._length - 1;
|
|
10737
10737
|
var H;
|
|
10738
10738
|
for (M = 0, d = 0; d < p; d += 1)
|
|
10739
|
-
H = bez.buildBezierData(
|
|
10740
|
-
d = p,
|
|
10739
|
+
H = bez.buildBezierData(F.v[d], F.v[d + 1], [F.o[d][0] - F.v[d][0], F.o[d][1] - F.v[d][1]], [F.i[d + 1][0] - F.v[d + 1][0], F.i[d + 1][1] - F.v[d + 1][1]]), m.tLength += H.segmentLength, m.segments.push(H), M += H.segmentLength;
|
|
10740
|
+
d = p, N.v.c && (H = bez.buildBezierData(F.v[d], F.v[0], [F.o[d][0] - F.v[d][0], F.o[d][1] - F.v[d][1]], [F.i[0][0] - F.v[0][0], F.i[0][1] - F.v[0][1]]), m.tLength += H.segmentLength, m.segments.push(H), M += H.segmentLength), this._pathData.pi = m;
|
|
10741
10741
|
}
|
|
10742
|
-
if (m = this._pathData.pi, P = this._pathData.f.v, g = 0, S = 1, E = 0, y = !0, B = m.segments, P < 0 &&
|
|
10742
|
+
if (m = this._pathData.pi, P = this._pathData.f.v, g = 0, S = 1, E = 0, y = !0, B = m.segments, P < 0 && N.v.c)
|
|
10743
10743
|
for (m.tLength < Math.abs(P) && (P = -Math.abs(P) % m.tLength), g = B.length - 1, x = B[g].points, S = x.length - 1; P < 0; )
|
|
10744
10744
|
P += x[S].partialLength, S -= 1, S < 0 && (g -= 1, x = B[g].points, S = x.length - 1);
|
|
10745
10745
|
x = B[g].points, C = x[S - 1], T = x[S], _ = T.partialLength;
|
|
@@ -10747,7 +10747,7 @@ var lottie$1 = { exports: {} };
|
|
|
10747
10747
|
p = f.length, u = 0, c = 0;
|
|
10748
10748
|
var $ = n.finalSize * 1.2 * 0.714, O = !0, b, I, V, A, k;
|
|
10749
10749
|
A = a.length;
|
|
10750
|
-
var R, G = -1, z, q, U, K = P, j = g, ne = S, xe = -1, ye, ge, Ee, oe, Y,
|
|
10750
|
+
var R, G = -1, z, q, U, K = P, j = g, ne = S, xe = -1, ye, ge, Ee, oe, Y, Fe, Oe, Le, Ce = "", De = this.defaultPropsArray, ae;
|
|
10751
10751
|
if (n.j === 2 || n.j === 1) {
|
|
10752
10752
|
var se = 0, de = 0, Be = n.j === 2 ? -0.5 : -1, he = 0, Ie = !0;
|
|
10753
10753
|
for (d = 0; d < p; d += 1)
|
|
@@ -10765,7 +10765,7 @@ var lottie$1 = { exports: {} };
|
|
|
10765
10765
|
}
|
|
10766
10766
|
for (d = 0; d < p; d += 1) {
|
|
10767
10767
|
if (s.reset(), ye = 1, f[d].n)
|
|
10768
|
-
u = 0, c += n.yOffset, c += O ? 1 : 0, P = K, O = !1, this._hasMaskedPath && (g = j, S = ne, x = B[g].points, C = x[S - 1], T = x[S], _ = T.partialLength, E = 0), Ce = "", Le = "",
|
|
10768
|
+
u = 0, c += n.yOffset, c += O ? 1 : 0, P = K, O = !1, this._hasMaskedPath && (g = j, S = ne, x = B[g].points, C = x[S - 1], T = x[S], _ = T.partialLength, E = 0), Ce = "", Le = "", Fe = "", ae = "", De = this.defaultPropsArray;
|
|
10769
10769
|
else {
|
|
10770
10770
|
if (this._hasMaskedPath) {
|
|
10771
10771
|
if (xe !== f[d].line) {
|
|
@@ -10784,7 +10784,7 @@ var lottie$1 = { exports: {} };
|
|
|
10784
10784
|
for (V = 0; V < A; V += 1)
|
|
10785
10785
|
b = a[V].a, b.p.propType && (I = a[V].s, R = I.getMult(f[d].anIndexes[V], r.a[V].s.totalChars), R.length ? Ae += b.p.v[0] * R[0] : Ae += b.p.v[0] * R), b.a.propType && (I = a[V].s, R = I.getMult(f[d].anIndexes[V], r.a[V].s.totalChars), R.length ? Ae += b.a.v[0] * R[0] : Ae += b.a.v[0] * R);
|
|
10786
10786
|
for (y = !0, this._pathData.a.v && (P = f[0].an * 0.5 + (M - this._pathData.f.v - f[0].an * 0.5 - f[f.length - 1].an * 0.5) * G / (p - 1), P += this._pathData.f.v); y; )
|
|
10787
|
-
E + _ >= P + Ae || !x ? (
|
|
10787
|
+
E + _ >= P + Ae || !x ? (D = (P + Ae - E) / T.partialLength, q = C.point[0] + (T.point[0] - C.point[0]) * D, U = C.point[1] + (T.point[1] - C.point[1]) * D, s.translate(-i[0] * f[d].an * 5e-3, -(i[1] * $) * 0.01), y = !1) : x && (E += T.partialLength, S += 1, S >= x.length && (S = 0, g += 1, B[g] ? x = B[g].points : N.v.c ? (S = 0, g = 0, x = B[g].points) : (E -= T.partialLength, x = null)), x && (C = T, T = x[S], _ = T.partialLength));
|
|
10788
10788
|
z = f[d].an / 2 - f[d].add, s.translate(-z, 0, 0);
|
|
10789
10789
|
} else
|
|
10790
10790
|
z = f[d].an / 2 - f[d].add, s.translate(-z, 0, 0), s.translate(-i[0] * f[d].an * 5e-3, -i[1] * $ * 0.01, 0);
|
|
@@ -10807,7 +10807,7 @@ var lottie$1 = { exports: {} };
|
|
|
10807
10807
|
}
|
|
10808
10808
|
for (V = 0; V < A; V += 1)
|
|
10809
10809
|
b = a[V].a, b.p.propType && (I = a[V].s, R = I.getMult(f[d].anIndexes[V], r.a[V].s.totalChars), this._hasMaskedPath ? R.length ? s.translate(0, b.p.v[1] * R[0], -b.p.v[2] * R[1]) : s.translate(0, b.p.v[1] * R, -b.p.v[2] * R) : R.length ? s.translate(b.p.v[0] * R[0], b.p.v[1] * R[1], -b.p.v[2] * R[2]) : s.translate(b.p.v[0] * R, b.p.v[1] * R, -b.p.v[2] * R));
|
|
10810
|
-
if (n.strokeWidthAnim && (
|
|
10810
|
+
if (n.strokeWidthAnim && (Fe = Ee < 0 ? 0 : Ee), n.strokeColorAnim && (Oe = "rgb(" + Math.round(ge[0] * 255) + "," + Math.round(ge[1] * 255) + "," + Math.round(ge[2] * 255) + ")"), n.fillColorAnim && n.fc && (Le = "rgb(" + Math.round(oe[0] * 255) + "," + Math.round(oe[1] * 255) + "," + Math.round(oe[2] * 255) + ")"), this._hasMaskedPath) {
|
|
10811
10811
|
if (s.translate(0, -n.ls), s.translate(0, i[1] * $ * 0.01 + c, 0), this._pathData.p.v) {
|
|
10812
10812
|
L = (T.point[1] - C.point[1]) / (T.point[0] - C.point[0]);
|
|
10813
10813
|
var Re = Math.atan(L) * 180 / Math.PI;
|
|
@@ -10825,9 +10825,9 @@ var lottie$1 = { exports: {} };
|
|
|
10825
10825
|
}
|
|
10826
10826
|
s.translate(0, -n.ls), s.translate(z, 0, 0), s.translate(i[0] * f[d].an * 5e-3, i[1] * $ * 0.01, 0), u += f[d].l + n.tr * 1e-3 * n.finalSize;
|
|
10827
10827
|
}
|
|
10828
|
-
o === "html" ? Ce = s.toCSS() : o === "svg" ? Ce = s.to2dCSS() :
|
|
10828
|
+
o === "html" ? Ce = s.toCSS() : o === "svg" ? Ce = s.to2dCSS() : De = [s.props[0], s.props[1], s.props[2], s.props[3], s.props[4], s.props[5], s.props[6], s.props[7], s.props[8], s.props[9], s.props[10], s.props[11], s.props[12], s.props[13], s.props[14], s.props[15]], ae = ye;
|
|
10829
10829
|
}
|
|
10830
|
-
l <= d ? (k = new LetterProps(ae,
|
|
10830
|
+
l <= d ? (k = new LetterProps(ae, Fe, Oe, Le, Ce, De), this.renderedLetters.push(k), l += 1, this.lettersChangedFlag = !0) : (k = this.renderedLetters[d], this.lettersChangedFlag = k.update(ae, Fe, Oe, Le, Ce, De) || this.lettersChangedFlag);
|
|
10831
10831
|
}
|
|
10832
10832
|
}
|
|
10833
10833
|
}, TextAnimatorProperty.prototype.getValue = function() {
|
|
@@ -12323,34 +12323,34 @@ var lottie$1 = { exports: {} };
|
|
|
12323
12323
|
C = C === !0 ? {
|
|
12324
12324
|
entropy: !0
|
|
12325
12325
|
} : C || {};
|
|
12326
|
-
var _ = E(T(C.entropy ? [g, S(n)] : g === null ? y() : g, 3), B), M = new m(B),
|
|
12327
|
-
for (var
|
|
12328
|
-
|
|
12329
|
-
for (;
|
|
12330
|
-
|
|
12331
|
-
return (
|
|
12326
|
+
var _ = E(T(C.entropy ? [g, S(n)] : g === null ? y() : g, 3), B), M = new m(B), D = function() {
|
|
12327
|
+
for (var N = M.g(r), F = l, H = 0; N < u; )
|
|
12328
|
+
N = (N + H) * a, F *= a, H = M.g(1);
|
|
12329
|
+
for (; N >= c; )
|
|
12330
|
+
N /= 2, F /= 2, H >>>= 1;
|
|
12331
|
+
return (N + H) / F;
|
|
12332
12332
|
};
|
|
12333
|
-
return
|
|
12333
|
+
return D.int32 = function() {
|
|
12334
12334
|
return M.g(4) | 0;
|
|
12335
|
-
},
|
|
12335
|
+
}, D.quick = function() {
|
|
12336
12336
|
return M.g(4) / 4294967296;
|
|
12337
|
-
},
|
|
12337
|
+
}, D.double = D, E(S(M.S), n), (C.pass || x || function(L, N, F, H) {
|
|
12338
12338
|
return H && (H.S && P(H, M), L.state = function() {
|
|
12339
12339
|
return P(M, {});
|
|
12340
|
-
}),
|
|
12341
|
-
})(
|
|
12340
|
+
}), F ? (e[o] = L, N) : L;
|
|
12341
|
+
})(D, _, "global" in C ? C.global : this == e, C.state);
|
|
12342
12342
|
}
|
|
12343
12343
|
e["seed" + o] = f;
|
|
12344
12344
|
function m(g) {
|
|
12345
|
-
var C, x = g.length, B = this, _ = 0, M = B.i = B.j = 0,
|
|
12345
|
+
var C, x = g.length, B = this, _ = 0, M = B.i = B.j = 0, D = B.S = [];
|
|
12346
12346
|
for (x || (g = [x++]); _ < a; )
|
|
12347
|
-
|
|
12347
|
+
D[_] = _++;
|
|
12348
12348
|
for (_ = 0; _ < a; _++)
|
|
12349
|
-
|
|
12349
|
+
D[_] = D[M = d & M + g[_ % x] + (C = D[_])], D[M] = C;
|
|
12350
12350
|
B.g = function(L) {
|
|
12351
|
-
for (var
|
|
12352
|
-
|
|
12353
|
-
return B.i = H, B.j = $,
|
|
12351
|
+
for (var N, F = 0, H = B.i, $ = B.j, O = B.S; L--; )
|
|
12352
|
+
N = O[H = d & H + 1], F = F * a + O[d & (O[H] = O[$ = d & $ + N]) + (O[$] = N)];
|
|
12353
|
+
return B.i = H, B.j = $, F;
|
|
12354
12354
|
};
|
|
12355
12355
|
}
|
|
12356
12356
|
function P(g, C) {
|
|
@@ -13558,21 +13558,21 @@ var lottie$1 = { exports: {} };
|
|
|
13558
13558
|
if (_ % 2 !== 0)
|
|
13559
13559
|
return this.getValueAtTime((S - (T - g) % S + g) / this.comp.globalData.frameRate, 0);
|
|
13560
13560
|
} else if (f === "offset") {
|
|
13561
|
-
var M = this.getValueAtTime(g / this.comp.globalData.frameRate, 0),
|
|
13561
|
+
var M = this.getValueAtTime(g / this.comp.globalData.frameRate, 0), D = this.getValueAtTime(y / this.comp.globalData.frameRate, 0), L = this.getValueAtTime(((T - g) % S + g) / this.comp.globalData.frameRate, 0), N = Math.floor((T - g) / S);
|
|
13562
13562
|
if (this.pv.length) {
|
|
13563
13563
|
for (B = new Array(M.length), x = B.length, C = 0; C < x; C += 1)
|
|
13564
|
-
B[C] = (
|
|
13564
|
+
B[C] = (D[C] - M[C]) * N + L[C];
|
|
13565
13565
|
return B;
|
|
13566
13566
|
}
|
|
13567
|
-
return (
|
|
13567
|
+
return (D - M) * N + L;
|
|
13568
13568
|
} else if (f === "continue") {
|
|
13569
|
-
var
|
|
13569
|
+
var F = this.getValueAtTime(y / this.comp.globalData.frameRate, 0), H = this.getValueAtTime((y - 1e-3) / this.comp.globalData.frameRate, 0);
|
|
13570
13570
|
if (this.pv.length) {
|
|
13571
|
-
for (B = new Array(
|
|
13572
|
-
B[C] =
|
|
13571
|
+
for (B = new Array(F.length), x = B.length, C = 0; C < x; C += 1)
|
|
13572
|
+
B[C] = F[C] + (F[C] - H[C]) * ((T - y) / this.comp.globalData.frameRate) / 5e-4;
|
|
13573
13573
|
return B;
|
|
13574
13574
|
}
|
|
13575
|
-
return
|
|
13575
|
+
return F + (F - H) * ((T - y) / 1e-3);
|
|
13576
13576
|
}
|
|
13577
13577
|
return this.getValueAtTime(((T - g) % S + g) / this.comp.globalData.frameRate, 0);
|
|
13578
13578
|
}
|
|
@@ -13591,21 +13591,21 @@ var lottie$1 = { exports: {} };
|
|
|
13591
13591
|
if (_ % 2 === 0)
|
|
13592
13592
|
return this.getValueAtTime(((y - T) % S + y) / this.comp.globalData.frameRate, 0);
|
|
13593
13593
|
} else if (f === "offset") {
|
|
13594
|
-
var M = this.getValueAtTime(y / this.comp.globalData.frameRate, 0),
|
|
13594
|
+
var M = this.getValueAtTime(y / this.comp.globalData.frameRate, 0), D = this.getValueAtTime(g / this.comp.globalData.frameRate, 0), L = this.getValueAtTime((S - (y - T) % S + y) / this.comp.globalData.frameRate, 0), N = Math.floor((y - T) / S) + 1;
|
|
13595
13595
|
if (this.pv.length) {
|
|
13596
13596
|
for (B = new Array(M.length), x = B.length, C = 0; C < x; C += 1)
|
|
13597
|
-
B[C] = L[C] - (
|
|
13597
|
+
B[C] = L[C] - (D[C] - M[C]) * N;
|
|
13598
13598
|
return B;
|
|
13599
13599
|
}
|
|
13600
|
-
return L - (
|
|
13600
|
+
return L - (D - M) * N;
|
|
13601
13601
|
} else if (f === "continue") {
|
|
13602
|
-
var
|
|
13602
|
+
var F = this.getValueAtTime(y / this.comp.globalData.frameRate, 0), H = this.getValueAtTime((y + 1e-3) / this.comp.globalData.frameRate, 0);
|
|
13603
13603
|
if (this.pv.length) {
|
|
13604
|
-
for (B = new Array(
|
|
13605
|
-
B[C] =
|
|
13604
|
+
for (B = new Array(F.length), x = B.length, C = 0; C < x; C += 1)
|
|
13605
|
+
B[C] = F[C] + (F[C] - H[C]) * (y - T) / 1e-3;
|
|
13606
13606
|
return B;
|
|
13607
13607
|
}
|
|
13608
|
-
return
|
|
13608
|
+
return F + (F - H) * (y - T) / 1e-3;
|
|
13609
13609
|
}
|
|
13610
13610
|
return this.getValueAtTime((S - ((y - T) % S + y)) / this.comp.globalData.frameRate, 0);
|
|
13611
13611
|
}
|
|
@@ -13658,8 +13658,8 @@ var lottie$1 = { exports: {} };
|
|
|
13658
13658
|
if (this.data.p && this.data.p.s) {
|
|
13659
13659
|
var _ = this.px.getValueAtTime(f), M = this.py.getValueAtTime(f);
|
|
13660
13660
|
if (this.data.p.z) {
|
|
13661
|
-
var
|
|
13662
|
-
m.translate(_ * this.px.mult, M * this.py.mult, -
|
|
13661
|
+
var D = this.pz.getValueAtTime(f);
|
|
13662
|
+
m.translate(_ * this.px.mult, M * this.py.mult, -D * this.pz.mult);
|
|
13663
13663
|
} else
|
|
13664
13664
|
m.translate(_ * this.px.mult, M * this.py.mult, 0);
|
|
13665
13665
|
} else {
|
|
@@ -13724,8 +13724,8 @@ var lottie$1 = { exports: {} };
|
|
|
13724
13724
|
P !== void 0 && (T = this.getValueAtTime(P, 0)), this._segmentsLength || (this._segmentsLength = bez.getSegmentsLength(T));
|
|
13725
13725
|
for (var E = this._segmentsLength, y = E.lengths, S = E.totalLength * m, g = 0, C = y.length, x = 0, B; g < C; ) {
|
|
13726
13726
|
if (x + y[g].addedLength > S) {
|
|
13727
|
-
var _ = g, M = T.c && g === C - 1 ? 0 : g + 1,
|
|
13728
|
-
B = bez.getPointInSegment(T.v[_], T.v[M], T.o[_], T.i[M],
|
|
13727
|
+
var _ = g, M = T.c && g === C - 1 ? 0 : g + 1, D = (S - x) / y[g].addedLength;
|
|
13728
|
+
B = bez.getPointInSegment(T.v[_], T.v[M], T.o[_], T.i[M], D, y[g]);
|
|
13729
13729
|
break;
|
|
13730
13730
|
} else
|
|
13731
13731
|
x += y[g].addedLength;
|
|
@@ -14108,16 +14108,16 @@ var _excluded$1 = ["animationData", "loop", "autoplay", "initialSegment", "onCom
|
|
|
14108
14108
|
var y = _objectWithoutProperties(e, _excluded$1), S = useState(!1), g = _slicedToArray(S, 2), C = g[0], x = g[1], B = useRef(), _ = useRef(null), M = function() {
|
|
14109
14109
|
var G;
|
|
14110
14110
|
(G = B.current) === null || G === void 0 || G.play();
|
|
14111
|
-
},
|
|
14111
|
+
}, D = function() {
|
|
14112
14112
|
var G;
|
|
14113
14113
|
(G = B.current) === null || G === void 0 || G.stop();
|
|
14114
14114
|
}, L = function() {
|
|
14115
14115
|
var G;
|
|
14116
14116
|
(G = B.current) === null || G === void 0 || G.pause();
|
|
14117
|
-
},
|
|
14117
|
+
}, N = function(G) {
|
|
14118
14118
|
var z;
|
|
14119
14119
|
(z = B.current) === null || z === void 0 || z.setSpeed(G);
|
|
14120
|
-
},
|
|
14120
|
+
}, F = function(G, z) {
|
|
14121
14121
|
var q;
|
|
14122
14122
|
(q = B.current) === null || q === void 0 || q.goToAndPlay(G, z);
|
|
14123
14123
|
}, H = function(G, z) {
|
|
@@ -14229,11 +14229,11 @@ var _excluded$1 = ["animationData", "loop", "autoplay", "initialSegment", "onCom
|
|
|
14229
14229
|
return {
|
|
14230
14230
|
View: k,
|
|
14231
14231
|
play: M,
|
|
14232
|
-
stop:
|
|
14232
|
+
stop: D,
|
|
14233
14233
|
pause: L,
|
|
14234
|
-
setSpeed:
|
|
14234
|
+
setSpeed: N,
|
|
14235
14235
|
goToAndStop: H,
|
|
14236
|
-
goToAndPlay:
|
|
14236
|
+
goToAndPlay: F,
|
|
14237
14237
|
setDirection: $,
|
|
14238
14238
|
playSegments: O,
|
|
14239
14239
|
setSubframe: b,
|
|
@@ -17054,13 +17054,13 @@ function generateContentConfigToMldev$1(n, e, i) {
|
|
|
17054
17054
|
"safetySettings"
|
|
17055
17055
|
]);
|
|
17056
17056
|
if (i !== void 0 && g != null) {
|
|
17057
|
-
let
|
|
17058
|
-
Array.isArray(
|
|
17057
|
+
let F = g;
|
|
17058
|
+
Array.isArray(F) && (F = F.map((H) => safetySettingToMldev$1(H))), setValueByPath(i, ["safetySettings"], F);
|
|
17059
17059
|
}
|
|
17060
17060
|
const C = getValueByPath(e, ["tools"]);
|
|
17061
17061
|
if (i !== void 0 && C != null) {
|
|
17062
|
-
let
|
|
17063
|
-
Array.isArray(
|
|
17062
|
+
let F = tTools(C);
|
|
17063
|
+
Array.isArray(F) && (F = F.map((H) => toolToMldev$4(tTool(H)))), setValueByPath(i, ["tools"], F);
|
|
17064
17064
|
}
|
|
17065
17065
|
const x = getValueByPath(e, ["toolConfig"]);
|
|
17066
17066
|
if (i !== void 0 && x != null && setValueByPath(i, ["toolConfig"], toolConfigToMldev$2(x)), getValueByPath(e, ["labels"]) !== void 0)
|
|
@@ -17077,15 +17077,15 @@ function generateContentConfigToMldev$1(n, e, i) {
|
|
|
17077
17077
|
"mediaResolution"
|
|
17078
17078
|
]);
|
|
17079
17079
|
M != null && setValueByPath(a, ["mediaResolution"], M);
|
|
17080
|
-
const
|
|
17081
|
-
if (
|
|
17080
|
+
const D = getValueByPath(e, ["speechConfig"]);
|
|
17081
|
+
if (D != null && setValueByPath(a, ["speechConfig"], tSpeechConfig(D)), getValueByPath(e, ["audioTimestamp"]) !== void 0)
|
|
17082
17082
|
throw new Error("audioTimestamp parameter is not supported in Gemini API.");
|
|
17083
17083
|
const L = getValueByPath(e, [
|
|
17084
17084
|
"thinkingConfig"
|
|
17085
17085
|
]);
|
|
17086
17086
|
L != null && setValueByPath(a, ["thinkingConfig"], L);
|
|
17087
|
-
const
|
|
17088
|
-
return
|
|
17087
|
+
const N = getValueByPath(e, ["imageConfig"]);
|
|
17088
|
+
return N != null && setValueByPath(a, ["imageConfig"], imageConfigToMldev$1(N)), a;
|
|
17089
17089
|
}
|
|
17090
17090
|
function generateContentResponseFromMldev$1(n) {
|
|
17091
17091
|
const e = {}, i = getValueByPath(n, [
|
|
@@ -19913,13 +19913,13 @@ function generateContentConfigToMldev(n, e, i) {
|
|
|
19913
19913
|
"safetySettings"
|
|
19914
19914
|
]);
|
|
19915
19915
|
if (i !== void 0 && g != null) {
|
|
19916
|
-
let
|
|
19917
|
-
Array.isArray(
|
|
19916
|
+
let F = g;
|
|
19917
|
+
Array.isArray(F) && (F = F.map((H) => safetySettingToMldev(H))), setValueByPath(i, ["safetySettings"], F);
|
|
19918
19918
|
}
|
|
19919
19919
|
const C = getValueByPath(e, ["tools"]);
|
|
19920
19920
|
if (i !== void 0 && C != null) {
|
|
19921
|
-
let
|
|
19922
|
-
Array.isArray(
|
|
19921
|
+
let F = tTools(C);
|
|
19922
|
+
Array.isArray(F) && (F = F.map((H) => toolToMldev$1(tTool(H)))), setValueByPath(i, ["tools"], F);
|
|
19923
19923
|
}
|
|
19924
19924
|
const x = getValueByPath(e, ["toolConfig"]);
|
|
19925
19925
|
if (i !== void 0 && x != null && setValueByPath(i, ["toolConfig"], toolConfigToMldev(x)), getValueByPath(e, ["labels"]) !== void 0)
|
|
@@ -19936,15 +19936,15 @@ function generateContentConfigToMldev(n, e, i) {
|
|
|
19936
19936
|
"mediaResolution"
|
|
19937
19937
|
]);
|
|
19938
19938
|
M != null && setValueByPath(a, ["mediaResolution"], M);
|
|
19939
|
-
const
|
|
19940
|
-
if (
|
|
19939
|
+
const D = getValueByPath(e, ["speechConfig"]);
|
|
19940
|
+
if (D != null && setValueByPath(a, ["speechConfig"], tSpeechConfig(D)), getValueByPath(e, ["audioTimestamp"]) !== void 0)
|
|
19941
19941
|
throw new Error("audioTimestamp parameter is not supported in Gemini API.");
|
|
19942
19942
|
const L = getValueByPath(e, [
|
|
19943
19943
|
"thinkingConfig"
|
|
19944
19944
|
]);
|
|
19945
19945
|
L != null && setValueByPath(a, ["thinkingConfig"], L);
|
|
19946
|
-
const
|
|
19947
|
-
return
|
|
19946
|
+
const N = getValueByPath(e, ["imageConfig"]);
|
|
19947
|
+
return N != null && setValueByPath(a, ["imageConfig"], imageConfigToMldev(N)), a;
|
|
19948
19948
|
}
|
|
19949
19949
|
function generateContentConfigToVertex(n, e, i) {
|
|
19950
19950
|
const a = {}, r = getValueByPath(e, [
|
|
@@ -20021,20 +20021,20 @@ function generateContentConfigToVertex(n, e, i) {
|
|
|
20021
20021
|
i !== void 0 && _ != null && setValueByPath(i, ["toolConfig"], _);
|
|
20022
20022
|
const M = getValueByPath(e, ["labels"]);
|
|
20023
20023
|
i !== void 0 && M != null && setValueByPath(i, ["labels"], M);
|
|
20024
|
-
const
|
|
20024
|
+
const D = getValueByPath(e, [
|
|
20025
20025
|
"cachedContent"
|
|
20026
20026
|
]);
|
|
20027
|
-
i !== void 0 &&
|
|
20027
|
+
i !== void 0 && D != null && setValueByPath(i, ["cachedContent"], tCachedContentName(n, D));
|
|
20028
20028
|
const L = getValueByPath(e, [
|
|
20029
20029
|
"responseModalities"
|
|
20030
20030
|
]);
|
|
20031
20031
|
L != null && setValueByPath(a, ["responseModalities"], L);
|
|
20032
|
-
const
|
|
20032
|
+
const N = getValueByPath(e, [
|
|
20033
20033
|
"mediaResolution"
|
|
20034
20034
|
]);
|
|
20035
|
-
|
|
20036
|
-
const
|
|
20037
|
-
|
|
20035
|
+
N != null && setValueByPath(a, ["mediaResolution"], N);
|
|
20036
|
+
const F = getValueByPath(e, ["speechConfig"]);
|
|
20037
|
+
F != null && setValueByPath(a, ["speechConfig"], speechConfigToVertex(tSpeechConfig(F)));
|
|
20038
20038
|
const H = getValueByPath(e, [
|
|
20039
20039
|
"audioTimestamp"
|
|
20040
20040
|
]);
|
|
@@ -22126,42 +22126,42 @@ class Live {
|
|
|
22126
22126
|
if (this.apiClient.isVertexAI())
|
|
22127
22127
|
d = `${u}/ws/google.cloud.aiplatform.${c}.LlmBidiService/BidiGenerateContent`, await this.auth.addAuthHeaders(f, d);
|
|
22128
22128
|
else {
|
|
22129
|
-
const
|
|
22130
|
-
let L = "BidiGenerateContent",
|
|
22131
|
-
|
|
22129
|
+
const D = this.apiClient.getApiKey();
|
|
22130
|
+
let L = "BidiGenerateContent", N = "key";
|
|
22131
|
+
D != null && D.startsWith("auth_tokens/") && (console.warn("Warning: Ephemeral token support is experimental and may change in future versions."), c !== "v1alpha" && console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection."), L = "BidiGenerateContentConstrained", N = "access_token"), d = `${u}/ws/google.ai.generativelanguage.${c}.GenerativeService.${L}?${N}=${D}`;
|
|
22132
22132
|
}
|
|
22133
22133
|
let m = () => {
|
|
22134
22134
|
};
|
|
22135
|
-
const P = new Promise((
|
|
22136
|
-
m =
|
|
22135
|
+
const P = new Promise((D) => {
|
|
22136
|
+
m = D;
|
|
22137
22137
|
}), T = e.callbacks, E = function() {
|
|
22138
|
-
var
|
|
22139
|
-
(
|
|
22138
|
+
var D;
|
|
22139
|
+
(D = T == null ? void 0 : T.onopen) === null || D === void 0 || D.call(T), m({});
|
|
22140
22140
|
}, y = this.apiClient, S = {
|
|
22141
22141
|
onopen: E,
|
|
22142
|
-
onmessage: (
|
|
22143
|
-
handleWebSocketMessage(y, T.onmessage,
|
|
22142
|
+
onmessage: (D) => {
|
|
22143
|
+
handleWebSocketMessage(y, T.onmessage, D);
|
|
22144
22144
|
},
|
|
22145
|
-
onerror: (i = T == null ? void 0 : T.onerror) !== null && i !== void 0 ? i : function(
|
|
22145
|
+
onerror: (i = T == null ? void 0 : T.onerror) !== null && i !== void 0 ? i : function(D) {
|
|
22146
22146
|
},
|
|
22147
|
-
onclose: (a = T == null ? void 0 : T.onclose) !== null && a !== void 0 ? a : function(
|
|
22147
|
+
onclose: (a = T == null ? void 0 : T.onclose) !== null && a !== void 0 ? a : function(D) {
|
|
22148
22148
|
}
|
|
22149
22149
|
}, g = this.webSocketFactory.create(d, headersToMap(f), S);
|
|
22150
22150
|
g.connect(), await P;
|
|
22151
22151
|
let C = tModel(this.apiClient, e.model);
|
|
22152
22152
|
if (this.apiClient.isVertexAI() && C.startsWith("publishers/")) {
|
|
22153
|
-
const
|
|
22154
|
-
C = `projects/${
|
|
22153
|
+
const D = this.apiClient.getProject(), L = this.apiClient.getLocation();
|
|
22154
|
+
C = `projects/${D}/locations/${L}/` + C;
|
|
22155
22155
|
}
|
|
22156
22156
|
let x = {};
|
|
22157
22157
|
this.apiClient.isVertexAI() && ((r = e.config) === null || r === void 0 ? void 0 : r.responseModalities) === void 0 && (e.config === void 0 ? e.config = { responseModalities: [Modality.AUDIO] } : e.config.responseModalities = [Modality.AUDIO]), !((s = e.config) === null || s === void 0) && s.generationConfig && console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");
|
|
22158
22158
|
const B = (l = (o = e.config) === null || o === void 0 ? void 0 : o.tools) !== null && l !== void 0 ? l : [], _ = [];
|
|
22159
|
-
for (const
|
|
22160
|
-
if (this.isCallableTool(
|
|
22161
|
-
const L =
|
|
22159
|
+
for (const D of B)
|
|
22160
|
+
if (this.isCallableTool(D)) {
|
|
22161
|
+
const L = D;
|
|
22162
22162
|
_.push(await L.tool());
|
|
22163
22163
|
} else
|
|
22164
|
-
_.push(
|
|
22164
|
+
_.push(D);
|
|
22165
22165
|
_.length > 0 && (e.config.tools = _);
|
|
22166
22166
|
const M = {
|
|
22167
22167
|
model: C,
|
|
@@ -22573,23 +22573,23 @@ class Models extends BaseModule {
|
|
|
22573
22573
|
try {
|
|
22574
22574
|
for (var S = !0, g = (T = void 0, __asyncValues(B)), C; C = yield __await(g.next()), P = C.done, !P; S = !0) {
|
|
22575
22575
|
y = C.value, S = !1;
|
|
22576
|
-
const
|
|
22577
|
-
if (yield yield __await(
|
|
22578
|
-
M.push(
|
|
22579
|
-
for (const L of (m =
|
|
22576
|
+
const D = y;
|
|
22577
|
+
if (yield yield __await(D), D.candidates && (!((f = D.candidates[0]) === null || f === void 0) && f.content)) {
|
|
22578
|
+
M.push(D.candidates[0].content);
|
|
22579
|
+
for (const L of (m = D.candidates[0].content.parts) !== null && m !== void 0 ? m : [])
|
|
22580
22580
|
if (l < s && L.functionCall) {
|
|
22581
22581
|
if (!L.functionCall.name)
|
|
22582
22582
|
throw new Error("Function call name was not returned by the model.");
|
|
22583
22583
|
if (d.has(L.functionCall.name)) {
|
|
22584
|
-
const
|
|
22585
|
-
_.push(...
|
|
22584
|
+
const N = yield __await(d.get(L.functionCall.name).callTool([L.functionCall]));
|
|
22585
|
+
_.push(...N);
|
|
22586
22586
|
} else
|
|
22587
22587
|
throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${d.keys()}, mising tool: ${L.functionCall.name}`);
|
|
22588
22588
|
}
|
|
22589
22589
|
}
|
|
22590
22590
|
}
|
|
22591
|
-
} catch (
|
|
22592
|
-
T = { error:
|
|
22591
|
+
} catch (D) {
|
|
22592
|
+
T = { error: D };
|
|
22593
22593
|
} finally {
|
|
22594
22594
|
try {
|
|
22595
22595
|
!S && !P && (E = g.return) && (yield __await(E.call(g)));
|
|
@@ -22599,22 +22599,22 @@ class Models extends BaseModule {
|
|
|
22599
22599
|
}
|
|
22600
22600
|
if (_.length > 0) {
|
|
22601
22601
|
o = !0;
|
|
22602
|
-
const
|
|
22603
|
-
|
|
22602
|
+
const D = new GenerateContentResponse();
|
|
22603
|
+
D.candidates = [
|
|
22604
22604
|
{
|
|
22605
22605
|
content: {
|
|
22606
22606
|
role: "user",
|
|
22607
22607
|
parts: _
|
|
22608
22608
|
}
|
|
22609
22609
|
}
|
|
22610
|
-
], yield yield __await(
|
|
22610
|
+
], yield yield __await(D);
|
|
22611
22611
|
const L = [];
|
|
22612
22612
|
L.push(...M), L.push({
|
|
22613
22613
|
role: "user",
|
|
22614
22614
|
parts: _
|
|
22615
22615
|
});
|
|
22616
|
-
const
|
|
22617
|
-
p.contents =
|
|
22616
|
+
const N = tContents(p.contents).concat(L);
|
|
22617
|
+
p.contents = N;
|
|
22618
22618
|
} else
|
|
22619
22619
|
break;
|
|
22620
22620
|
}
|
|
@@ -24476,18 +24476,18 @@ function tuningJobFromVertex(n, e) {
|
|
|
24476
24476
|
_ != null && setValueByPath(i, ["outputUri"], _);
|
|
24477
24477
|
const M = getValueByPath(n, ["pipelineJob"]);
|
|
24478
24478
|
M != null && setValueByPath(i, ["pipelineJob"], M);
|
|
24479
|
-
const
|
|
24479
|
+
const D = getValueByPath(n, [
|
|
24480
24480
|
"serviceAccount"
|
|
24481
24481
|
]);
|
|
24482
|
-
|
|
24482
|
+
D != null && setValueByPath(i, ["serviceAccount"], D);
|
|
24483
24483
|
const L = getValueByPath(n, [
|
|
24484
24484
|
"tunedModelDisplayName"
|
|
24485
24485
|
]);
|
|
24486
24486
|
L != null && setValueByPath(i, ["tunedModelDisplayName"], L);
|
|
24487
|
-
const
|
|
24487
|
+
const N = getValueByPath(n, [
|
|
24488
24488
|
"veoTuningSpec"
|
|
24489
24489
|
]);
|
|
24490
|
-
return
|
|
24490
|
+
return N != null && setValueByPath(i, ["veoTuningSpec"], N), i;
|
|
24491
24491
|
}
|
|
24492
24492
|
function tuningOperationFromMldev(n, e) {
|
|
24493
24493
|
const i = {}, a = getValueByPath(n, [
|
|
@@ -24997,11 +24997,11 @@ class S2StreamListener {
|
|
|
24997
24997
|
S += M.slice(5).trim();
|
|
24998
24998
|
else if (!M.startsWith("id:")) {
|
|
24999
24999
|
if (_.includes("batch{")) {
|
|
25000
|
-
const
|
|
25001
|
-
|
|
25000
|
+
const D = _.indexOf("{");
|
|
25001
|
+
D !== -1 && this.processSSEMessage("batch", _.substring(D));
|
|
25002
25002
|
} else if (_.includes("ping{")) {
|
|
25003
|
-
const
|
|
25004
|
-
|
|
25003
|
+
const D = _.indexOf("{");
|
|
25004
|
+
D !== -1 && this.processSSEMessage("ping", _.substring(D));
|
|
25005
25005
|
}
|
|
25006
25006
|
}
|
|
25007
25007
|
}
|
|
@@ -25936,7 +25936,7 @@ const VALID_TOOTH_KEYS = [
|
|
|
25936
25936
|
}, 2e3);
|
|
25937
25937
|
return () => clearTimeout(V);
|
|
25938
25938
|
}, [a, i == null ? void 0 : i.id]);
|
|
25939
|
-
const
|
|
25939
|
+
const D = async (I) => {
|
|
25940
25940
|
if (I.target.files && I.target.files.length > 0) {
|
|
25941
25941
|
const V = I.target.files[0], A = new FileReader();
|
|
25942
25942
|
A.onload = () => {
|
|
@@ -25955,7 +25955,7 @@ const VALID_TOOTH_KEYS = [
|
|
|
25955
25955
|
B.current && (B.current.value = "");
|
|
25956
25956
|
}, L = (I) => {
|
|
25957
25957
|
S((V) => V.filter((A) => A.id !== I));
|
|
25958
|
-
},
|
|
25958
|
+
}, N = async () => {
|
|
25959
25959
|
try {
|
|
25960
25960
|
const I = await navigator.mediaDevices.getUserMedia({ audio: !0 }), V = new MediaRecorder(I);
|
|
25961
25961
|
_.current = V, M.current = [], V.ondataavailable = (A) => {
|
|
@@ -25968,7 +25968,7 @@ const VALID_TOOTH_KEYS = [
|
|
|
25968
25968
|
timestamp: /* @__PURE__ */ new Date()
|
|
25969
25969
|
});
|
|
25970
25970
|
}
|
|
25971
|
-
},
|
|
25971
|
+
}, F = () => {
|
|
25972
25972
|
_.current && g && (_.current.stop(), _.current.onstop = async () => {
|
|
25973
25973
|
var A;
|
|
25974
25974
|
const I = new Blob(M.current, { type: "audio/webm" }), V = new FileReader();
|
|
@@ -26062,12 +26062,12 @@ ${ke}`;
|
|
|
26062
26062
|
}).join(`
|
|
26063
26063
|
|
|
26064
26064
|
`));
|
|
26065
|
-
const
|
|
26065
|
+
const Fe = JSON.stringify(u, null, 2), Le = `
|
|
26066
26066
|
Eres Clara, una asistente médica experta con **CAPACIDADES MULTIMODALES (VISIÓN Y AUDIO)**.
|
|
26067
26067
|
${d === "en" ? "Respond strictly in English." : "Responde estrictamente en español."}
|
|
26068
26068
|
|
|
26069
26069
|
CONTEXTO DEL PACIENTE (DATOS ACTUALES):
|
|
26070
|
-
${
|
|
26070
|
+
${Fe}
|
|
26071
26071
|
|
|
26072
26072
|
CAMPOS DEL FORMULARIO DISPONIBLES:
|
|
26073
26073
|
${Y}
|
|
@@ -26089,13 +26089,13 @@ SI TE ENVÍAN UNA IMAGEN SIN TEXTO, ASUME QUE ES UN DOCUMENTO Y EXTRAE DATOS MÉ
|
|
|
26089
26089
|
data: fe.base64
|
|
26090
26090
|
}
|
|
26091
26091
|
});
|
|
26092
|
-
const
|
|
26092
|
+
const De = a.filter((fe) => fe.id !== "welcome").slice(-10).map((fe) => ({
|
|
26093
26093
|
role: fe.role,
|
|
26094
26094
|
parts: [{ text: fe.content }]
|
|
26095
26095
|
})), ae = await ge.models.generateContent({
|
|
26096
26096
|
model: "gemini-2.5-flash",
|
|
26097
26097
|
contents: [
|
|
26098
|
-
...
|
|
26098
|
+
...De,
|
|
26099
26099
|
{ role: "user", parts: Ce }
|
|
26100
26100
|
],
|
|
26101
26101
|
config: {
|
|
@@ -26431,7 +26431,7 @@ ${V.slice(0, 10).join(`
|
|
|
26431
26431
|
ref: B,
|
|
26432
26432
|
className: "hidden",
|
|
26433
26433
|
accept: "image/*,application/pdf",
|
|
26434
|
-
onChange:
|
|
26434
|
+
onChange: D
|
|
26435
26435
|
}
|
|
26436
26436
|
),
|
|
26437
26437
|
/* @__PURE__ */ jsx(
|
|
@@ -26470,10 +26470,10 @@ ${V.slice(0, 10).join(`
|
|
|
26470
26470
|
) : /* @__PURE__ */ jsx(
|
|
26471
26471
|
"button",
|
|
26472
26472
|
{
|
|
26473
|
-
onMouseDown:
|
|
26474
|
-
onMouseUp:
|
|
26475
|
-
onTouchStart:
|
|
26476
|
-
onTouchEnd:
|
|
26473
|
+
onMouseDown: N,
|
|
26474
|
+
onMouseUp: F,
|
|
26475
|
+
onTouchStart: N,
|
|
26476
|
+
onTouchEnd: F,
|
|
26477
26477
|
className: `h-11 w-11 rounded-xl transition-all shadow-md flex items-center justify-center ${g ? "bg-destructive text-destructive-foreground scale-110 ring-4 ring-destructive/30" : "bg-secondary text-muted-foreground hover:bg-secondary/80"}`,
|
|
26478
26478
|
title: "Mantén presionado para hablar",
|
|
26479
26479
|
children: g ? /* @__PURE__ */ jsx("div", { className: "w-5 h-5 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "w-2 h-2 bg-white rounded-full animate-ping" }) }) : /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-5 h-5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z" }) })
|
|
@@ -26526,24 +26526,24 @@ function extractFormElementsFromDocument(n, e = "") {
|
|
|
26526
26526
|
u.add(P);
|
|
26527
26527
|
let g = l.get(P) || "";
|
|
26528
26528
|
if (g || (g = f.getAttribute("aria-label") || ""), g || (g = f.getAttribute("title") || ""), g || (g = y), !g) {
|
|
26529
|
-
const
|
|
26530
|
-
if (
|
|
26531
|
-
const L =
|
|
26529
|
+
const D = f.closest("div, td, li, span, p, .form-group, .field-wrapper");
|
|
26530
|
+
if (D) {
|
|
26531
|
+
const L = D.querySelector('label, span.label, .field-label, [class*="label"]');
|
|
26532
26532
|
L && L !== f && (g = ((_ = L.textContent) == null ? void 0 : _.trim()) || "");
|
|
26533
26533
|
}
|
|
26534
26534
|
}
|
|
26535
26535
|
if (!g) {
|
|
26536
|
-
const
|
|
26537
|
-
|
|
26536
|
+
const D = f.previousElementSibling;
|
|
26537
|
+
D && (D.tagName === "LABEL" || D.classList.contains("label")) && (g = ((M = D.textContent) == null ? void 0 : M.trim()) || "");
|
|
26538
26538
|
}
|
|
26539
26539
|
let C = "text";
|
|
26540
26540
|
m === "select" || f.getAttribute("role") === "combobox" || f.getAttribute("role") === "listbox" ? C = "select" : m === "textarea" || f.getAttribute("role") === "textbox" ? C = "textarea" : (E === "checkbox" || f.getAttribute("role") === "checkbox" || E === "radio" || f.getAttribute("role") === "radio") && (C = "checkbox");
|
|
26541
26541
|
let x = [];
|
|
26542
26542
|
if (m === "select") {
|
|
26543
|
-
const
|
|
26544
|
-
x = Array.from(
|
|
26545
|
-
var
|
|
26546
|
-
return ((
|
|
26543
|
+
const D = f.options;
|
|
26544
|
+
x = Array.from(D).map((L) => {
|
|
26545
|
+
var N;
|
|
26546
|
+
return ((N = L.textContent) == null ? void 0 : N.trim()) || L.value;
|
|
26547
26547
|
}).filter(Boolean);
|
|
26548
26548
|
}
|
|
26549
26549
|
const B = x.length > 0 ? ` options=[${x.slice(0, 20).join("|")}]` : "";
|
|
@@ -26719,28 +26719,28 @@ GENERA EL JSON:`;
|
|
|
26719
26719
|
}
|
|
26720
26720
|
const x = g.indexOf("{");
|
|
26721
26721
|
if (x !== -1) {
|
|
26722
|
-
let B = g.slice(x), _ = 0, M = 0,
|
|
26723
|
-
for (let
|
|
26724
|
-
const
|
|
26722
|
+
let B = g.slice(x), _ = 0, M = 0, D = !1, L = !1;
|
|
26723
|
+
for (let N = 0; N < B.length; N++) {
|
|
26724
|
+
const F = B[N];
|
|
26725
26725
|
if (L) {
|
|
26726
26726
|
L = !1;
|
|
26727
26727
|
continue;
|
|
26728
26728
|
}
|
|
26729
|
-
if (
|
|
26729
|
+
if (F === "\\") {
|
|
26730
26730
|
L = !0;
|
|
26731
26731
|
continue;
|
|
26732
26732
|
}
|
|
26733
|
-
if (
|
|
26734
|
-
|
|
26733
|
+
if (F === '"') {
|
|
26734
|
+
D = !D;
|
|
26735
26735
|
continue;
|
|
26736
26736
|
}
|
|
26737
|
-
|
|
26737
|
+
D || (F === "{" && _++, F === "}" && _--, F === "[" && M++, F === "]" && M--);
|
|
26738
26738
|
}
|
|
26739
|
-
|
|
26739
|
+
D && (B += '"'), B = B.replace(/,\s*"[^"]*":\s*"[^"]*$/, "").replace(/,\s*"[^"]*":\s*$/, "").replace(/,\s*"[^"]*$/, "").replace(/,\s*\{[^}]*$/, "").replace(/,\s*$/, ""), B += "]".repeat(Math.max(0, M)), B += "}".repeat(Math.max(0, _)), B = B.replace(/,\s*}/g, "}").replace(/,\s*]/g, "]");
|
|
26740
26740
|
try {
|
|
26741
26741
|
return JSON.parse(B);
|
|
26742
|
-
} catch (
|
|
26743
|
-
console.warn("[TemplateGenerator] JSON repair failed:",
|
|
26742
|
+
} catch (N) {
|
|
26743
|
+
console.warn("[TemplateGenerator] JSON repair failed:", N);
|
|
26744
26744
|
}
|
|
26745
26745
|
}
|
|
26746
26746
|
return null;
|
|
@@ -26906,7 +26906,7 @@ function emitSessionStopped(n) {
|
|
|
26906
26906
|
});
|
|
26907
26907
|
}
|
|
26908
26908
|
const ClaraDashboard = ({ onStartSession: n, onLogout: e, primaryColor: i }) => {
|
|
26909
|
-
const { config: a, accessToken: r, templates: s, currentTemplate: o, formData: l, userProfile: u, remoteSessionActive: c, remoteSessionInfo: d, setTemplates: p, setCurrentTemplate: f, setUserProfile: m } = useClaraStore(), P = a.lang || "es", T = !!a.templateId, [E, y] = useState("consulta"), [S, g] = useState(!1), [C, x] = useState(!1), [B, _] = useState(!1), [M,
|
|
26909
|
+
const { config: a, accessToken: r, templates: s, currentTemplate: o, formData: l, userProfile: u, remoteSessionActive: c, remoteSessionInfo: d, setTemplates: p, setCurrentTemplate: f, setUserProfile: m } = useClaraStore(), P = a.lang || "es", T = !!a.templateId, [E, y] = useState("consulta"), [S, g] = useState(!1), [C, x] = useState(!1), [B, _] = useState(!1), [M, D] = useState(!1), [L, N] = useState(!1), [F, H] = useState(null), [$, O] = useState(null);
|
|
26910
26910
|
o != null && o.name || a.templateId || t("dashboard.selectTemplate", P), useEffect(() => {
|
|
26911
26911
|
(async () => {
|
|
26912
26912
|
var R, G, z, q;
|
|
@@ -26954,7 +26954,7 @@ const ClaraDashboard = ({ onStartSession: n, onLogout: e, primaryColor: i }) =>
|
|
|
26954
26954
|
j && f(j);
|
|
26955
26955
|
}
|
|
26956
26956
|
} catch (U) {
|
|
26957
|
-
console.error("[Dashboard] Error loading data:", U), ((z = U == null ? void 0 : U.message) != null && z.includes("401") || (q = U == null ? void 0 : U.message) != null && q.toLowerCase().includes("invalid api key")) &&
|
|
26957
|
+
console.error("[Dashboard] Error loading data:", U), ((z = U == null ? void 0 : U.message) != null && z.includes("401") || (q = U == null ? void 0 : U.message) != null && q.toLowerCase().includes("invalid api key")) && D(!0), console.log("[Dashboard] Falling back to demo template due to error");
|
|
26958
26958
|
try {
|
|
26959
26959
|
const K = await getDemoTemplate(a.demoTemplate, a.apiKey || void 0, r || void 0);
|
|
26960
26960
|
K && f(K);
|
|
@@ -26979,7 +26979,7 @@ const ClaraDashboard = ({ onStartSession: n, onLogout: e, primaryColor: i }) =>
|
|
|
26979
26979
|
})();
|
|
26980
26980
|
}, [a.demoTemplate]);
|
|
26981
26981
|
const b = async () => {
|
|
26982
|
-
|
|
26982
|
+
N(!0), O(null), H({ phase: "analyzing", percentage: 0, message: "Iniciando..." });
|
|
26983
26983
|
const k = await generateTemplateFromPage((R) => {
|
|
26984
26984
|
H(R);
|
|
26985
26985
|
});
|
|
@@ -26996,7 +26996,7 @@ const ClaraDashboard = ({ onStartSession: n, onLogout: e, primaryColor: i }) =>
|
|
|
26996
26996
|
const G = await claraApi.createTemplate(R);
|
|
26997
26997
|
if (console.log("[Dashboard] Saved template response:", G), G)
|
|
26998
26998
|
p([...s, G]), f(G), H({ phase: "complete", percentage: 100, message: "Template guardado exitosamente" }), setTimeout(() => {
|
|
26999
|
-
|
|
26999
|
+
N(!1), H(null), O(null);
|
|
27000
27000
|
}, 1500);
|
|
27001
27001
|
else
|
|
27002
27002
|
throw new Error("No se pudo guardar el template");
|
|
@@ -27283,7 +27283,7 @@ const ClaraDashboard = ({ onStartSession: n, onLogout: e, primaryColor: i }) =>
|
|
|
27283
27283
|
"button",
|
|
27284
27284
|
{
|
|
27285
27285
|
onClick: () => {
|
|
27286
|
-
|
|
27286
|
+
D(!1), e();
|
|
27287
27287
|
},
|
|
27288
27288
|
className: "w-full py-2.5 px-4 rounded-lg bg-destructive text-white font-medium text-sm hover:brightness-110 transition-all",
|
|
27289
27289
|
children: "Cerrar y Reintentar"
|
|
@@ -27313,21 +27313,21 @@ const ClaraDashboard = ({ onStartSession: n, onLogout: e, primaryColor: i }) =>
|
|
|
27313
27313
|
"button",
|
|
27314
27314
|
{
|
|
27315
27315
|
onClick: () => {
|
|
27316
|
-
|
|
27316
|
+
N(!1), H(null), O(null);
|
|
27317
27317
|
},
|
|
27318
27318
|
className: "absolute top-3 right-3 p-1 rounded-full hover:bg-secondary text-muted-foreground transition-colors z-10",
|
|
27319
27319
|
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
27320
27320
|
}
|
|
27321
27321
|
),
|
|
27322
27322
|
/* @__PURE__ */ jsxs("div", { className: "p-5 flex flex-col items-center text-center", children: [
|
|
27323
|
-
(
|
|
27323
|
+
(F == null ? void 0 : F.phase) === "complete" ? /* @__PURE__ */ jsx(
|
|
27324
27324
|
"div",
|
|
27325
27325
|
{
|
|
27326
27326
|
className: "w-16 h-16 rounded-full flex items-center justify-center mb-4",
|
|
27327
27327
|
style: { backgroundColor: `${i}20` },
|
|
27328
27328
|
children: /* @__PURE__ */ jsx(Check, { className: "w-8 h-8", style: { color: i } })
|
|
27329
27329
|
}
|
|
27330
|
-
) : (
|
|
27330
|
+
) : (F == null ? void 0 : F.phase) === "error" ? /* @__PURE__ */ jsx("div", { className: "w-16 h-16 rounded-full flex items-center justify-center mb-4 bg-destructive/20", children: /* @__PURE__ */ jsx(TriangleAlert, { className: "w-8 h-8 text-destructive" }) }) : /* @__PURE__ */ jsx("div", { className: "w-24 h-24 mb-2", children: /* @__PURE__ */ jsx(
|
|
27331
27331
|
Lottie,
|
|
27332
27332
|
{
|
|
27333
27333
|
animationData: aiGeneratingAnimation,
|
|
@@ -27335,25 +27335,25 @@ const ClaraDashboard = ({ onStartSession: n, onLogout: e, primaryColor: i }) =>
|
|
|
27335
27335
|
style: { width: "100%", height: "100%" }
|
|
27336
27336
|
}
|
|
27337
27337
|
) }),
|
|
27338
|
-
/* @__PURE__ */ jsx("h3", { className: "font-bold text-base text-foreground mb-2", children: (
|
|
27339
|
-
|
|
27338
|
+
/* @__PURE__ */ jsx("h3", { className: "font-bold text-base text-foreground mb-2", children: (F == null ? void 0 : F.phase) === "complete" ? t("generate.complete", P) : (F == null ? void 0 : F.phase) === "error" ? t("common.error", P) : t("generate.title", P) }),
|
|
27339
|
+
F && F.phase !== "error" && /* @__PURE__ */ jsxs("div", { className: "w-full mb-3", children: [
|
|
27340
27340
|
/* @__PURE__ */ jsx("div", { className: "h-2 bg-secondary rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
27341
27341
|
motion.div,
|
|
27342
27342
|
{
|
|
27343
27343
|
className: "h-full rounded-full",
|
|
27344
27344
|
style: { backgroundColor: i },
|
|
27345
27345
|
initial: { width: 0 },
|
|
27346
|
-
animate: { width: `${
|
|
27346
|
+
animate: { width: `${F.percentage}%` },
|
|
27347
27347
|
transition: { duration: 0.3 }
|
|
27348
27348
|
}
|
|
27349
27349
|
) }),
|
|
27350
27350
|
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground mt-2", children: [
|
|
27351
|
-
|
|
27351
|
+
F.percentage,
|
|
27352
27352
|
"%"
|
|
27353
27353
|
] })
|
|
27354
27354
|
] }),
|
|
27355
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: (
|
|
27356
|
-
$ && (
|
|
27355
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-4", children: (F == null ? void 0 : F.message) || t("generate.analyzing", P) }),
|
|
27356
|
+
$ && (F == null ? void 0 : F.phase) !== "saving" && (F == null ? void 0 : F.phase) !== "complete" && /* @__PURE__ */ jsxs("div", { className: "w-full text-left mb-4 p-3 bg-secondary rounded-lg", children: [
|
|
27357
27357
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-foreground mb-1", children: $.name }),
|
|
27358
27358
|
/* @__PURE__ */ jsxs("p", { className: "text-[10px] text-muted-foreground", children: [
|
|
27359
27359
|
$.structure.sections.length,
|
|
@@ -27366,20 +27366,20 @@ const ClaraDashboard = ({ onStartSession: n, onLogout: e, primaryColor: i }) =>
|
|
|
27366
27366
|
t("generate.fields", P)
|
|
27367
27367
|
] })
|
|
27368
27368
|
] }),
|
|
27369
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-2 w-full", children: (
|
|
27369
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-2 w-full", children: (F == null ? void 0 : F.phase) === "error" ? /* @__PURE__ */ jsx(
|
|
27370
27370
|
"button",
|
|
27371
27371
|
{
|
|
27372
27372
|
onClick: () => {
|
|
27373
|
-
|
|
27373
|
+
N(!1), H(null), O(null);
|
|
27374
27374
|
},
|
|
27375
27375
|
className: "w-full py-2.5 px-4 rounded-lg bg-secondary text-foreground font-medium text-sm hover:bg-muted transition-all",
|
|
27376
27376
|
children: t("common.close", P)
|
|
27377
27377
|
}
|
|
27378
|
-
) : (
|
|
27378
|
+
) : (F == null ? void 0 : F.phase) === "complete" || (F == null ? void 0 : F.phase) === "saving" ? null : /* @__PURE__ */ jsx(
|
|
27379
27379
|
"button",
|
|
27380
27380
|
{
|
|
27381
27381
|
onClick: () => {
|
|
27382
|
-
|
|
27382
|
+
N(!1), H(null), O(null);
|
|
27383
27383
|
},
|
|
27384
27384
|
className: "w-full py-2.5 px-4 rounded-lg bg-secondary text-foreground font-medium text-sm hover:bg-muted transition-all",
|
|
27385
27385
|
children: t("common.cancel", P)
|
|
@@ -27527,7 +27527,7 @@ registerProcessor('pcm-processor', PCMProcessor);
|
|
|
27527
27527
|
outputCostPer1M: 0.3
|
|
27528
27528
|
}
|
|
27529
27529
|
}) => {
|
|
27530
|
-
const [P, T] = useState(!1), [E, y] = useState(!1), [S, g] = useState(!1), [C, x] = useState(null), [B, _] = useState(0), [M,
|
|
27530
|
+
const [P, T] = useState(!1), [E, y] = useState(!1), [S, g] = useState(!1), [C, x] = useState(null), [B, _] = useState(0), [M, D] = useState(!1), { setConnected: L } = useClaraStore(), N = useRef(null), F = useRef(null), H = useRef(null), $ = useRef(null), O = useRef([]), b = useRef(0), I = 4096, V = useRef(null), A = useRef(null), k = useRef(!1), R = useRef({
|
|
27531
27531
|
inputTokens: 0,
|
|
27532
27532
|
outputTokens: 0,
|
|
27533
27533
|
totalTokens: 0,
|
|
@@ -27560,7 +27560,7 @@ registerProcessor('pcm-processor', PCMProcessor);
|
|
|
27560
27560
|
}
|
|
27561
27561
|
$.current = null;
|
|
27562
27562
|
}
|
|
27563
|
-
if (
|
|
27563
|
+
if (F.current && (F.current.getTracks().forEach((de) => de.stop()), F.current = null), O.current = [], b.current = 0, A.current = null, R.current = { inputTokens: 0, outputTokens: 0, totalTokens: 0, estimatedCost: 0 }, V.current) {
|
|
27564
27564
|
const de = V.current;
|
|
27565
27565
|
V.current = null;
|
|
27566
27566
|
try {
|
|
@@ -27569,12 +27569,12 @@ registerProcessor('pcm-processor', PCMProcessor);
|
|
|
27569
27569
|
console.warn("[Gemini Live] Session close error", Be);
|
|
27570
27570
|
}
|
|
27571
27571
|
}
|
|
27572
|
-
if (((ae =
|
|
27572
|
+
if (((ae = N.current) == null ? void 0 : ae.state) !== "closed")
|
|
27573
27573
|
try {
|
|
27574
|
-
await ((se =
|
|
27574
|
+
await ((se = N.current) == null ? void 0 : se.close());
|
|
27575
27575
|
} catch {
|
|
27576
27576
|
}
|
|
27577
|
-
|
|
27577
|
+
N.current = null, y(!1), L(!1), _(0), ye.current = !1;
|
|
27578
27578
|
}
|
|
27579
27579
|
}, [L]), oe = useCallback((ae) => {
|
|
27580
27580
|
var Re, fe, ke;
|
|
@@ -27584,7 +27584,7 @@ registerProcessor('pcm-processor', PCMProcessor);
|
|
|
27584
27584
|
se += ae[pe] * ae[pe];
|
|
27585
27585
|
const de = Math.sqrt(se / ae.length);
|
|
27586
27586
|
_(Math.min(1, de * 8));
|
|
27587
|
-
const Be = ((Re =
|
|
27587
|
+
const Be = ((Re = N.current) == null ? void 0 : Re.sampleRate) || 16e3;
|
|
27588
27588
|
let he = ae;
|
|
27589
27589
|
Be !== 16e3 && (he = downsampleBuffer(ae, Be, 16e3));
|
|
27590
27590
|
const Ie = float32To16BitPCMBase64(he), Ae = V.current;
|
|
@@ -27610,7 +27610,7 @@ registerProcessor('pcm-processor', PCMProcessor);
|
|
|
27610
27610
|
throw new Error("No se pudo obtener credenciales de Gemini. Verifica tu autenticación.");
|
|
27611
27611
|
console.log("[Gemini Live] ✅ Gemini token obtained"), console.log("[Gemini Live] Connecting with lazy-loading schema strategy...");
|
|
27612
27612
|
const Be = window.AudioContext || window.webkitAudioContext, he = new Be({ sampleRate: 16e3 });
|
|
27613
|
-
he.state === "suspended" && await he.resume(),
|
|
27613
|
+
he.state === "suspended" && await he.resume(), N.current = he;
|
|
27614
27614
|
const Ie = new GoogleGenAI({ apiKey: de }), Ae = G.current.map((Z) => {
|
|
27615
27615
|
const Q = Z.fields.slice(0, 8).map((me) => me.label || me.id).join(", "), Se = Z.fields.length > 8 ? "..." : "";
|
|
27616
27616
|
return `- "${Z.key}" (${Z.label}): ${Q}${Se}`;
|
|
@@ -27629,24 +27629,34 @@ registerProcessor('pcm-processor', PCMProcessor);
|
|
|
27629
27629
|
Re = "Profesional y clínico.";
|
|
27630
27630
|
break;
|
|
27631
27631
|
}
|
|
27632
|
-
const ke = `
|
|
27633
|
-
Eres Clara, asistente médica
|
|
27634
|
-
|
|
27632
|
+
const fe = p === "fast" ? "Habla rápido." : p === "slow" ? "Habla lento." : "", ke = `
|
|
27633
|
+
Eres Clara, una asistente médica técnica optimizada para el procesamiento de datos.
|
|
27634
|
+
|
|
27635
|
+
ESTADO ACTUAL:
|
|
27636
|
+
- Modo Autopilot: ${u} (Si es TRUE: Pregunta datos faltantes brevemente. Si es FALSE: Solo procesa datos).
|
|
27637
|
+
|
|
27638
|
+
OBJETIVO PRINCIPAL:
|
|
27639
|
+
Escuchar la consulta médica, extraer información estructurada y ejecutar las herramientas correspondientes.
|
|
27635
27640
|
|
|
27636
|
-
|
|
27641
|
+
FORMATO DE RESPUESTA:
|
|
27642
|
+
1. Si necesitas usar una herramienta: EJECUTA LA HERRAMIENTA DIRECTAMENTE. No escribas introducción ni despedida.
|
|
27643
|
+
2. Si el modo Autopilot está activo y falta un dato crítico: Haz una pregunta de máximo 5 palabras.
|
|
27644
|
+
3. Si no es necesario hablar ni usar herramientas: Responde únicamente con el token "[WAITING]".
|
|
27637
27645
|
|
|
27638
|
-
|
|
27646
|
+
REGLAS DE INTERACCIÓN:
|
|
27647
|
+
- Tono: Clínico, neutro, robótico.
|
|
27648
|
+
- Prohibido: Saludos, confirmaciones ("Entendido", "Haciendo eso"), agradecimientos.
|
|
27649
|
+
- Prioridad: La ejecución de herramientas tiene prioridad sobre cualquier texto.
|
|
27639
27650
|
|
|
27640
|
-
|
|
27641
|
-
|
|
27642
|
-
|
|
27643
|
-
|
|
27644
|
-
|
|
27645
|
-
- getOdontogramSchema: Llámala UNA VEZ al inicio si la consulta incluye odontograma o revisión dental.
|
|
27646
|
-
- findSimilarOdontogramCondition: Úsala cuando el doctor diga sinónimos o frases no exactas (ej: "caries secundaria", "diente roto", "corona filtrada").
|
|
27647
|
-
- validateOdontogramActions: SIEMPRE úsala para aplicar condiciones dentales. Valida y auto-aplica acciones válidas.
|
|
27651
|
+
FLUJO DE TRABAJO (ODONTOGRAMA):
|
|
27652
|
+
Si detectas intención de odontograma/dental:
|
|
27653
|
+
1. Llama a getOdontogramSchema.
|
|
27654
|
+
2. Analiza la condición. Si el término no es exacto, usa findSimilarOdontogramCondition.
|
|
27655
|
+
3. Finalmente, usa validateOdontogramActions.
|
|
27648
27656
|
|
|
27649
|
-
|
|
27657
|
+
CONTEXTO TÉCNICO:
|
|
27658
|
+
${Re}
|
|
27659
|
+
${Ae}
|
|
27650
27660
|
`.trim();
|
|
27651
27661
|
console.log(`[Gemini Live] SYSTEM INSTRUCTION (Length: ${ke.length})`);
|
|
27652
27662
|
const pe = [
|
|
@@ -27942,9 +27952,9 @@ FLUJO ODONTOGRAMA: getOdontogramSchema → findSimilarOdontogramCondition (si fr
|
|
|
27942
27952
|
const ce = [], le = Array.isArray(te) ? te : [te];
|
|
27943
27953
|
for (const W of le)
|
|
27944
27954
|
if (W && W.tooth && W.condition && W.type) {
|
|
27945
|
-
const Ge = String(W.tooth), be = surfaceToArea(W.surface),
|
|
27955
|
+
const Ge = String(W.tooth), be = surfaceToArea(W.surface), Ne = W.type, Me = validateOdontogramAction({
|
|
27946
27956
|
key: Ge,
|
|
27947
|
-
type:
|
|
27957
|
+
type: Ne,
|
|
27948
27958
|
area: be,
|
|
27949
27959
|
action: W.condition
|
|
27950
27960
|
});
|
|
@@ -27952,7 +27962,7 @@ FLUJO ODONTOGRAMA: getOdontogramSchema → findSimilarOdontogramCondition (si fr
|
|
|
27952
27962
|
tooth: Ge,
|
|
27953
27963
|
surface: W.surface,
|
|
27954
27964
|
condition: W.condition,
|
|
27955
|
-
type:
|
|
27965
|
+
type: Ne
|
|
27956
27966
|
}), console.log(`[Gemini Live] ✅ Valid odontogram action: tooth=${Ge}, area=${be}, action=${W.condition}`)) : console.warn(`[Gemini Live] ❌ Invalid odontogram action: ${Me.error}`);
|
|
27957
27967
|
}
|
|
27958
27968
|
if (ce.length > 0 && j.current) {
|
|
@@ -27972,11 +27982,11 @@ FLUJO ODONTOGRAMA: getOdontogramSchema → findSimilarOdontogramCondition (si fr
|
|
|
27972
27982
|
}
|
|
27973
27983
|
};
|
|
27974
27984
|
console.log("[Gemini Live] 📤 Sending FROM_EXTENSION postMessage (local):", be), window.postMessage(be, "*");
|
|
27975
|
-
const
|
|
27976
|
-
console.log(`[Gemini Live] 📤 Broadcasting FROM_EXTENSION to ${
|
|
27977
|
-
for (let Me = 0; Me <
|
|
27985
|
+
const Ne = document.getElementsByTagName("iframe");
|
|
27986
|
+
console.log(`[Gemini Live] 📤 Broadcasting FROM_EXTENSION to ${Ne.length} iframes`);
|
|
27987
|
+
for (let Me = 0; Me < Ne.length; Me++)
|
|
27978
27988
|
try {
|
|
27979
|
-
(st =
|
|
27989
|
+
(st = Ne[Me].contentWindow) == null || st.postMessage(be, "*"), console.log(`[Gemini Live] ✅ Sent FROM_EXTENSION to iframe ${Me}`);
|
|
27980
27990
|
} catch (Xe) {
|
|
27981
27991
|
console.log(`[Gemini Live] ❌ Failed to send to iframe ${Me}:`, Xe);
|
|
27982
27992
|
}
|
|
@@ -28005,8 +28015,8 @@ FLUJO ODONTOGRAMA: getOdontogramSchema → findSimilarOdontogramCondition (si fr
|
|
|
28005
28015
|
const ce = G.current.flatMap(
|
|
28006
28016
|
(le) => le.fields.filter(
|
|
28007
28017
|
(W) => {
|
|
28008
|
-
var Ge, be,
|
|
28009
|
-
return ((Ge = W.label) == null ? void 0 : Ge.toLowerCase().includes(ue)) || ((be = W.description) == null ? void 0 : be.toLowerCase().includes(ue)) || ((
|
|
28018
|
+
var Ge, be, Ne;
|
|
28019
|
+
return ((Ge = W.label) == null ? void 0 : Ge.toLowerCase().includes(ue)) || ((be = W.description) == null ? void 0 : be.toLowerCase().includes(ue)) || ((Ne = W.keywords) == null ? void 0 : Ne.some((Me) => Me.toLowerCase().includes(ue)));
|
|
28010
28020
|
}
|
|
28011
28021
|
).map((W) => ({
|
|
28012
28022
|
sectionId: le.key,
|
|
@@ -28254,10 +28264,10 @@ FLUJO ODONTOGRAMA: getOdontogramSchema → findSimilarOdontogramCondition (si fr
|
|
|
28254
28264
|
valid: !1,
|
|
28255
28265
|
error: "Missing required properties: tooth, condition, type"
|
|
28256
28266
|
};
|
|
28257
|
-
const Ge = String(W.tooth), be = W.type,
|
|
28267
|
+
const Ge = String(W.tooth), be = W.type, Ne = W.surface ? surfaceToArea(W.surface) : 0, Me = validateOdontogramAction({
|
|
28258
28268
|
key: Ge,
|
|
28259
28269
|
type: be,
|
|
28260
|
-
area:
|
|
28270
|
+
area: Ne,
|
|
28261
28271
|
action: W.condition
|
|
28262
28272
|
});
|
|
28263
28273
|
if (Me.valid)
|
|
@@ -28421,11 +28431,11 @@ FLUJO ODONTOGRAMA: getOdontogramSchema → findSimilarOdontogramCondition (si fr
|
|
|
28421
28431
|
}
|
|
28422
28432
|
if (!W) {
|
|
28423
28433
|
const be = ue.split(/\s+/);
|
|
28424
|
-
for (const
|
|
28425
|
-
const Me =
|
|
28434
|
+
for (const Ne in le) {
|
|
28435
|
+
const Me = Ne.split(/\s+/), Xe = Me.filter((Ye) => be.some((nt) => nt.includes(Ye) || Ye.includes(nt)));
|
|
28426
28436
|
if (Xe.length > 0) {
|
|
28427
28437
|
const Ye = Xe.length / Me.length * 0.7;
|
|
28428
|
-
(!W || Ye > W.confidence) && (W = { ...le[
|
|
28438
|
+
(!W || Ye > W.confidence) && (W = { ...le[Ne], confidence: Ye });
|
|
28429
28439
|
}
|
|
28430
28440
|
}
|
|
28431
28441
|
}
|
|
@@ -28475,7 +28485,7 @@ FLUJO ODONTOGRAMA: getOdontogramSchema → findSimilarOdontogramCondition (si fr
|
|
|
28475
28485
|
deviceId: l ? { exact: l } : void 0
|
|
28476
28486
|
}
|
|
28477
28487
|
});
|
|
28478
|
-
|
|
28488
|
+
F.current = Pe;
|
|
28479
28489
|
const $e = new Blob([WORKLET_CODE], { type: "application/javascript" }), Qe = URL.createObjectURL($e);
|
|
28480
28490
|
try {
|
|
28481
28491
|
await he.audioWorklet.addModule(Qe);
|
|
@@ -28526,14 +28536,14 @@ FLUJO ODONTOGRAMA: getOdontogramSchema → findSimilarOdontogramCondition (si fr
|
|
|
28526
28536
|
ae && clearTimeout(ae);
|
|
28527
28537
|
};
|
|
28528
28538
|
}, [P, E, S, Y]);
|
|
28529
|
-
const
|
|
28539
|
+
const Fe = useCallback(() => {
|
|
28530
28540
|
T(!0);
|
|
28531
28541
|
}, []), Oe = useCallback(() => {
|
|
28532
28542
|
T(!1), Ee();
|
|
28533
28543
|
}, [Ee]), Le = useCallback(() => {
|
|
28534
|
-
|
|
28544
|
+
D((ae) => {
|
|
28535
28545
|
const se = !ae;
|
|
28536
|
-
return k.current = se,
|
|
28546
|
+
return k.current = se, F.current && F.current.getAudioTracks().forEach((de) => {
|
|
28537
28547
|
de.enabled = !se;
|
|
28538
28548
|
}), se && _(0), se;
|
|
28539
28549
|
});
|
|
@@ -28554,7 +28564,7 @@ FLUJO ODONTOGRAMA: getOdontogramSchema → findSimilarOdontogramCondition (si fr
|
|
|
28554
28564
|
} catch (se) {
|
|
28555
28565
|
console.error("[Gemini Live] Failed to send text", se);
|
|
28556
28566
|
}
|
|
28557
|
-
}, []),
|
|
28567
|
+
}, []), De = useCallback(() => ({ ...R.current }), []);
|
|
28558
28568
|
return {
|
|
28559
28569
|
isRecording: P,
|
|
28560
28570
|
isConnected: E,
|
|
@@ -28562,11 +28572,11 @@ FLUJO ODONTOGRAMA: getOdontogramSchema → findSimilarOdontogramCondition (si fr
|
|
|
28562
28572
|
isPaused: M,
|
|
28563
28573
|
error: C,
|
|
28564
28574
|
audioLevel: B,
|
|
28565
|
-
startRecording:
|
|
28575
|
+
startRecording: Fe,
|
|
28566
28576
|
stopRecording: Oe,
|
|
28567
28577
|
togglePause: Le,
|
|
28568
28578
|
sendText: Ce,
|
|
28569
|
-
getSessionUsage:
|
|
28579
|
+
getSessionUsage: De
|
|
28570
28580
|
};
|
|
28571
28581
|
};
|
|
28572
28582
|
function useDebouncedFormDataSync(n, e = 500, i) {
|
|
@@ -28642,10 +28652,10 @@ const ClaraActiveSession = ({
|
|
|
28642
28652
|
speechSpeed: B,
|
|
28643
28653
|
voiceStyle: _,
|
|
28644
28654
|
formData: M,
|
|
28645
|
-
documentChanges:
|
|
28655
|
+
documentChanges: D,
|
|
28646
28656
|
userStreamInfo: L,
|
|
28647
|
-
analysisStreamInfo:
|
|
28648
|
-
isS2Connected:
|
|
28657
|
+
analysisStreamInfo: N,
|
|
28658
|
+
isS2Connected: F,
|
|
28649
28659
|
usageStats: H,
|
|
28650
28660
|
addTranscriptMessage: $,
|
|
28651
28661
|
addChatMessage: O,
|
|
@@ -28675,7 +28685,7 @@ const ClaraActiveSession = ({
|
|
|
28675
28685
|
const Z = { ...j.current };
|
|
28676
28686
|
J.forEach((Q) => {
|
|
28677
28687
|
try {
|
|
28678
|
-
b(Q.fieldId, Q.value, "ai_tool", Q.reason || "AI extraction"), Z[Q.fieldId] = Q.value, sendFillCommand(Q.fieldId, Q.value), emitFieldFilled(Q.fieldId, Q.value),
|
|
28688
|
+
b(Q.fieldId, Q.value, "ai_tool", Q.reason || "AI extraction"), Z[Q.fieldId] = Q.value, sendFillCommand(Q.fieldId, Q.value), emitFieldFilled(Q.fieldId, Q.value), N && (S != null && S.id) && sendAIFill(N, S.id, Q.fieldId, Q.value);
|
|
28679
28689
|
} catch (Se) {
|
|
28680
28690
|
console.error("[Session] Error processing field:", Q.fieldId, Se);
|
|
28681
28691
|
}
|
|
@@ -28683,7 +28693,7 @@ const ClaraActiveSession = ({
|
|
|
28683
28693
|
} catch (Z) {
|
|
28684
28694
|
console.error("[Session] ❌ Error in handleDataExtracted:", Z);
|
|
28685
28695
|
}
|
|
28686
|
-
}, [b,
|
|
28696
|
+
}, [b, N, ne]), ge = useCallback((J) => {
|
|
28687
28697
|
console.log("[Session] Transcript:", J), $(J);
|
|
28688
28698
|
const Z = [...g, J];
|
|
28689
28699
|
emitTranscriptUpdated(
|
|
@@ -28694,17 +28704,17 @@ const ClaraActiveSession = ({
|
|
|
28694
28704
|
content: Q.content,
|
|
28695
28705
|
timestamp: Q.timestamp.toISOString()
|
|
28696
28706
|
}))
|
|
28697
|
-
),
|
|
28698
|
-
|
|
28707
|
+
), N && sendTranscript(
|
|
28708
|
+
N,
|
|
28699
28709
|
Z.map((Q) => ({
|
|
28700
28710
|
role: Q.role,
|
|
28701
28711
|
content: Q.content,
|
|
28702
28712
|
timestamp: Q.timestamp.toISOString()
|
|
28703
28713
|
}))
|
|
28704
28714
|
), S != null && S.id && claraApi.syncTranscriptToDB(S.id, Z);
|
|
28705
|
-
}, [$, g,
|
|
28706
|
-
console.log("[Session] Title updated:", J), V(J), emitTitleUpdated(J, S == null ? void 0 : S.id),
|
|
28707
|
-
}, [V, S,
|
|
28715
|
+
}, [$, g, N, S]), Ee = useCallback((J) => {
|
|
28716
|
+
console.log("[Session] Title updated:", J), V(J), emitTitleUpdated(J, S == null ? void 0 : S.id), N && sendTitleUpdate(N, J), S != null && S.id && claraApi.updateAnalysisTitle(S.id, J);
|
|
28717
|
+
}, [V, S, N]), oe = useCallback((J) => {
|
|
28708
28718
|
z(J);
|
|
28709
28719
|
}, [z]), Y = useCallback((J) => {
|
|
28710
28720
|
var Z, Q, Se;
|
|
@@ -28740,7 +28750,7 @@ const ClaraActiveSession = ({
|
|
|
28740
28750
|
} else
|
|
28741
28751
|
Ve[Te].whole = ve.condition, Ve[Te].wholeType = We;
|
|
28742
28752
|
}
|
|
28743
|
-
console.log("[Session] 🦷 Updated teeth map:", Ve), b(ie, Ve, "ai_tool", "Odontogram AI update"), emitOdontogramUpdated(ie, Ve), emitFieldFilled(ie, Ve),
|
|
28753
|
+
console.log("[Session] 🦷 Updated teeth map:", Ve), b(ie, Ve, "ai_tool", "Odontogram AI update"), emitOdontogramUpdated(ie, Ve), emitFieldFilled(ie, Ve), N && (S != null && S.id) && sendToS2(N, {
|
|
28744
28754
|
action: "odontogram",
|
|
28745
28755
|
fieldId: ie,
|
|
28746
28756
|
value: Ve,
|
|
@@ -28752,7 +28762,7 @@ const ClaraActiveSession = ({
|
|
|
28752
28762
|
} catch (me) {
|
|
28753
28763
|
console.error("[Session] ❌ Error in handleOdontogramUpdate:", me);
|
|
28754
28764
|
}
|
|
28755
|
-
}, [y, b,
|
|
28765
|
+
}, [y, b, N, S, ne]), Fe = useCallback((J) => {
|
|
28756
28766
|
var Z, Q, Se;
|
|
28757
28767
|
try {
|
|
28758
28768
|
console.log("[Session] 🦷 Clearing odontogram teeth:", J);
|
|
@@ -28778,7 +28788,7 @@ const ClaraActiveSession = ({
|
|
|
28778
28788
|
}
|
|
28779
28789
|
}, [y, b, ne]), Oe = useCallback((J) => {
|
|
28780
28790
|
if (console.log("[Session] Field interaction:", J), J.action === "change" && J.value !== void 0) {
|
|
28781
|
-
b(J.fieldId, J.value, "user", "Manual edit"),
|
|
28791
|
+
b(J.fieldId, J.value, "user", "Manual edit"), N && sendToS2(N, {
|
|
28782
28792
|
action: "fill",
|
|
28783
28793
|
fieldId: J.fieldId,
|
|
28784
28794
|
value: J.value,
|
|
@@ -28789,10 +28799,10 @@ const ClaraActiveSession = ({
|
|
|
28789
28799
|
const Z = { ...j.current, [J.fieldId]: J.value };
|
|
28790
28800
|
ne(Z);
|
|
28791
28801
|
}
|
|
28792
|
-
}, [b,
|
|
28802
|
+
}, [b, N, ne]), {
|
|
28793
28803
|
isRecording: Le,
|
|
28794
28804
|
isConnected: Ce,
|
|
28795
|
-
isConnecting:
|
|
28805
|
+
isConnecting: De,
|
|
28796
28806
|
isPaused: ae,
|
|
28797
28807
|
error: se,
|
|
28798
28808
|
audioLevel: de,
|
|
@@ -28807,7 +28817,7 @@ const ClaraActiveSession = ({
|
|
|
28807
28817
|
onTitleUpdate: Ee,
|
|
28808
28818
|
onUsageUpdate: oe,
|
|
28809
28819
|
onOdontogramUpdate: Y,
|
|
28810
|
-
onOdontogramClear:
|
|
28820
|
+
onOdontogramClear: Fe,
|
|
28811
28821
|
isAutopilot: x,
|
|
28812
28822
|
speechSpeed: B,
|
|
28813
28823
|
style: _,
|
|
@@ -28816,7 +28826,7 @@ const ClaraActiveSession = ({
|
|
|
28816
28826
|
useEffect(() => {
|
|
28817
28827
|
K.current = Ae;
|
|
28818
28828
|
}, [Ae]);
|
|
28819
|
-
const fe =
|
|
28829
|
+
const fe = De ? SessionStatus.CONNECTING : Ce && !ae ? SessionStatus.ACTIVE : Ce && ae ? SessionStatus.PAUSED : SessionStatus.DISCONNECTED;
|
|
28820
28830
|
useEffect(() => (f.current = setInterval(() => {
|
|
28821
28831
|
u((J) => J <= 1 ? (f.current && clearInterval(f.current), 0) : J - 1);
|
|
28822
28832
|
}, 1e3), () => {
|
|
@@ -28914,12 +28924,12 @@ const ClaraActiveSession = ({
|
|
|
28914
28924
|
d.current && d.current.stop();
|
|
28915
28925
|
};
|
|
28916
28926
|
}, [T.apiKey]), useEffect(() => {
|
|
28917
|
-
if (!
|
|
28927
|
+
if (!N || !(S != null && S.id)) return;
|
|
28918
28928
|
const J = () => {
|
|
28919
|
-
sendSessionStatus(
|
|
28929
|
+
sendSessionStatus(N, {
|
|
28920
28930
|
status: ae ? "paused" : "recording",
|
|
28921
28931
|
isPaused: ae,
|
|
28922
|
-
isConnected:
|
|
28932
|
+
isConnected: F,
|
|
28923
28933
|
analysisId: S.id,
|
|
28924
28934
|
templateName: y == null ? void 0 : y.name,
|
|
28925
28935
|
formDataCount: Object.keys(M).length,
|
|
@@ -28930,11 +28940,11 @@ const ClaraActiveSession = ({
|
|
|
28930
28940
|
return J(), m.current = setInterval(J, 5e3), () => {
|
|
28931
28941
|
m.current && (clearInterval(m.current), m.current = null);
|
|
28932
28942
|
};
|
|
28933
|
-
}, [
|
|
28943
|
+
}, [N, S == null ? void 0 : S.id, ae, F]);
|
|
28934
28944
|
const pe = useCallback(async () => {
|
|
28935
28945
|
console.log("[Session] Stopping session..."), m.current && (clearInterval(m.current), m.current = null), await xe();
|
|
28936
28946
|
const J = Ae();
|
|
28937
|
-
if (console.log("[Session] Final usage stats:", J), he(),
|
|
28947
|
+
if (console.log("[Session] Final usage stats:", J), he(), N && await sendSessionStatus(N, {
|
|
28938
28948
|
status: "stopped",
|
|
28939
28949
|
isPaused: !1,
|
|
28940
28950
|
isConnected: !1,
|
|
@@ -28948,7 +28958,7 @@ const ClaraActiveSession = ({
|
|
|
28948
28958
|
await claraApi.completeAnalysis(
|
|
28949
28959
|
S.id,
|
|
28950
28960
|
M,
|
|
28951
|
-
|
|
28961
|
+
D,
|
|
28952
28962
|
g,
|
|
28953
28963
|
Z,
|
|
28954
28964
|
J.totalTokens > 0 ? J : void 0
|
|
@@ -28960,7 +28970,7 @@ const ClaraActiveSession = ({
|
|
|
28960
28970
|
analysisId: S.id,
|
|
28961
28971
|
source: "web_agent"
|
|
28962
28972
|
}, !0), emitSessionStopped(S == null ? void 0 : S.id), q(), n();
|
|
28963
|
-
}, [he, Ae, n, S, M,
|
|
28973
|
+
}, [he, Ae, n, S, M, D, g, C, L, N, G, q, xe]);
|
|
28964
28974
|
useEffect(() => {
|
|
28965
28975
|
i && (i.current = {
|
|
28966
28976
|
disconnect: pe,
|
|
@@ -29067,7 +29077,7 @@ const ClaraActiveSession = ({
|
|
|
29067
29077
|
/* @__PURE__ */ jsx(ChartColumn, { className: "w-4 h-4 text-clara-success" }),
|
|
29068
29078
|
/* @__PURE__ */ jsx("span", { className: "font-semibold text-xs tracking-wide uppercase", children: t("session.recording", U) }),
|
|
29069
29079
|
Ce && $e(),
|
|
29070
|
-
/* @__PURE__ */ jsx("span", { title:
|
|
29080
|
+
/* @__PURE__ */ jsx("span", { title: F ? "S2 Conectado" : "S2 Desconectado", children: F ? /* @__PURE__ */ jsx(Wifi, { className: "w-3 h-3 text-clara-success" }) : /* @__PURE__ */ jsx(WifiOff, { className: "w-3 h-3 text-muted-foreground" }) })
|
|
29071
29081
|
] }),
|
|
29072
29082
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
29073
29083
|
se && /* @__PURE__ */ jsx("span", { className: "text-destructive text-[10px] mr-2", children: se }),
|
|
@@ -29129,7 +29139,7 @@ const ClaraActiveSession = ({
|
|
|
29129
29139
|
"⚠️ ",
|
|
29130
29140
|
t("transcript.provisional", U)
|
|
29131
29141
|
] }) }),
|
|
29132
|
-
/* @__PURE__ */ jsx("div", { ref: c, className: "flex-1 overflow-y-auto space-y-3", children: g.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-center text-muted-foreground mt-12 text-xs", children: t(
|
|
29142
|
+
/* @__PURE__ */ jsx("div", { ref: c, className: "flex-1 overflow-y-auto space-y-3", children: g.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-center text-muted-foreground mt-12 text-xs", children: t(De ? "transcript.connecting" : Ce ? "transcript.listening" : "transcript.startSession", U) }) : g.map((J, Z) => /* @__PURE__ */ jsx("div", { className: `flex flex-col ${J.role === "user" ? "items-end" : "items-start"}`, children: /* @__PURE__ */ jsx(
|
|
29133
29143
|
"div",
|
|
29134
29144
|
{
|
|
29135
29145
|
className: `max-w-[85%] px-2.5 py-2 rounded-lg text-xs ${J.role === "user" ? "bg-card border border-border text-foreground rounded-tr-none shadow-sm" : "rounded-tl-none"}`,
|