@genai-fi/base 4.1.3 → 4.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
api: string;
|
|
3
|
+
checkURL?: string;
|
|
3
4
|
appName: string;
|
|
4
5
|
visibility?: number;
|
|
5
6
|
noCheck?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export default function ConnectionStatus({ api, appName, visibility, noCheck }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default function ConnectionStatus({ api, checkURL, appName, visibility, noCheck }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as r, Fragment as
|
|
2
|
-
import { iceConfig as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { getRTConfig as
|
|
5
|
-
import { W as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { c as
|
|
8
|
-
import { checkP2P as
|
|
9
|
-
import { usePeerObject as
|
|
10
|
-
import { a as
|
|
11
|
-
import '../../assets/ConnectionStatus.css';const
|
|
12
|
-
containerConnecting:
|
|
13
|
-
containerSuccess:
|
|
14
|
-
containerMedium:
|
|
15
|
-
containerBad:
|
|
16
|
-
message:
|
|
17
|
-
},
|
|
1
|
+
import { jsx as r, Fragment as W, jsxs as q } from "react/jsx-runtime";
|
|
2
|
+
import { iceConfig as F, webrtcActive as L } from "../../state/webrtcState.js";
|
|
3
|
+
import { useRef as P, useState as g, useEffect as o } from "react";
|
|
4
|
+
import { getRTConfig as z } from "./ice.js";
|
|
5
|
+
import { W as E, F as R } from "../../FlashWifi-DkGhdWqj.js";
|
|
6
|
+
import { useTranslation as b } from "react-i18next";
|
|
7
|
+
import { c as j } from "../../createSvgIcon-DQhMxTx4.js";
|
|
8
|
+
import { checkP2P as x } from "./check.js";
|
|
9
|
+
import { usePeerObject as A } from "../../hooks/peer.js";
|
|
10
|
+
import { a as B } from "../../react-D_xU5dL6.js";
|
|
11
|
+
import '../../assets/ConnectionStatus.css';const w = "_containerConnecting_1p4sr_15 _container_1p4sr_3", D = "_containerSuccess_1p4sr_20 _container_1p4sr_3", O = "_containerMedium_1p4sr_25 _container_1p4sr_3", U = "_containerBad_1p4sr_30 _container_1p4sr_3", $ = "_message_1p4sr_35", a = {
|
|
12
|
+
containerConnecting: w,
|
|
13
|
+
containerSuccess: D,
|
|
14
|
+
containerMedium: O,
|
|
15
|
+
containerBad: U,
|
|
16
|
+
message: $
|
|
17
|
+
}, k = j(/* @__PURE__ */ r("path", {
|
|
18
18
|
d: "M24 8.98C20.93 5.9 16.69 4 12 4S3.07 5.9 0 8.98L12 21v-9h8.99zM19.59 14l-2.09 2.09L15.41 14 14 15.41l2.09 2.09L14 19.59 15.41 21l2.09-2.08L19.59 21 21 19.59l-2.08-2.09L21 15.41z"
|
|
19
|
-
}), "SignalWifiBad"),
|
|
20
|
-
function
|
|
21
|
-
const { t: p } =
|
|
19
|
+
}), "SignalWifiBad"), N = 6e4;
|
|
20
|
+
function te({ api: f, checkURL: S, appName: h, visibility: v, noCheck: y }) {
|
|
21
|
+
const { t: p } = b(), e = A(), [u, C] = B(F), [M, l] = B(L), m = P(), [n, d] = g("connecting"), [s, _] = g(0), [, I] = g(!1), [c, T] = g(!1), i = n === "ready";
|
|
22
22
|
return o(() => {
|
|
23
23
|
if (e)
|
|
24
24
|
return e.on("status", d), e.on("quality", _), d(e.status), _(e.quality), () => {
|
|
@@ -26,48 +26,48 @@ function ee({ api: f, appName: h, visibility: S, noCheck: v }) {
|
|
|
26
26
|
};
|
|
27
27
|
_(0), d("connecting");
|
|
28
28
|
}, [e]), o(() => {
|
|
29
|
-
u ||
|
|
30
|
-
|
|
29
|
+
u || z(f, h, (t) => {
|
|
30
|
+
C(t);
|
|
31
31
|
});
|
|
32
|
-
}, [u,
|
|
32
|
+
}, [u, C, f, h]), o(() => {
|
|
33
33
|
if (n !== "ready") {
|
|
34
34
|
const t = setTimeout(() => {
|
|
35
|
-
|
|
36
|
-
},
|
|
35
|
+
T(!0);
|
|
36
|
+
}, N);
|
|
37
37
|
return () => {
|
|
38
38
|
clearTimeout(t);
|
|
39
39
|
};
|
|
40
40
|
} else
|
|
41
|
-
|
|
41
|
+
T(!1);
|
|
42
42
|
}, [n]), o(() => {
|
|
43
|
-
u &&
|
|
43
|
+
u && M === "unset" && (navigator != null && navigator.mediaDevices ? navigator.mediaDevices.getUserMedia({ video: !0 }).then((t) => {
|
|
44
44
|
m.current = t, l("full");
|
|
45
45
|
}).catch(() => {
|
|
46
46
|
l("relay");
|
|
47
47
|
}) : l("relay"));
|
|
48
|
-
}, [u,
|
|
48
|
+
}, [u, M, l]), o(() => {
|
|
49
49
|
i && m.current && (m.current.getTracks().forEach(function(t) {
|
|
50
50
|
t.stop();
|
|
51
51
|
}), m.current = void 0);
|
|
52
52
|
}, [i, n]), o(() => {
|
|
53
|
-
i && e && !
|
|
54
|
-
|
|
53
|
+
i && e && !y && e.code && x(S || f, e.code).then((t) => {
|
|
54
|
+
I(t);
|
|
55
55
|
});
|
|
56
|
-
}, [i, e, f,
|
|
56
|
+
}, [i, e, f, S, y]), /* @__PURE__ */ r(W, { children: (v === void 0 || s <= v) && /* @__PURE__ */ q(
|
|
57
57
|
"div",
|
|
58
58
|
{
|
|
59
59
|
className: n === "connecting" && !c ? a.containerConnecting : s === 3 ? a.containerSuccess : s === 2 ? a.containerMedium : a.containerBad,
|
|
60
60
|
children: [
|
|
61
61
|
!c && s > 0 && /* @__PURE__ */ r(
|
|
62
|
-
|
|
62
|
+
E,
|
|
63
63
|
{
|
|
64
64
|
fontSize: "large",
|
|
65
65
|
color: "inherit"
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
|
-
!c && s <= 0 && /* @__PURE__ */ r(
|
|
68
|
+
!c && s <= 0 && /* @__PURE__ */ r(R, {}),
|
|
69
69
|
c && /* @__PURE__ */ r(
|
|
70
|
-
|
|
70
|
+
k,
|
|
71
71
|
{
|
|
72
72
|
fontSize: "large",
|
|
73
73
|
color: "inherit"
|
|
@@ -79,5 +79,5 @@ function ee({ api: f, appName: h, visibility: S, noCheck: v }) {
|
|
|
79
79
|
) });
|
|
80
80
|
}
|
|
81
81
|
export {
|
|
82
|
-
|
|
82
|
+
te as default
|
|
83
83
|
};
|