@genai-fi/base 3.0.1
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/LICENSE +7 -0
- package/README.md +18 -0
- package/dist/Button-DQwRVw4a.js +1918 -0
- package/dist/DefaultPropsProvider-C0Ib4Mye.js +520 -0
- package/dist/DialogQR-BU45QB3i.js +1625 -0
- package/dist/FileSaver.min-DhePf63e.js +2397 -0
- package/dist/FlashWifi-CaAOKd3g.js +33 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/assets/AlertPara.css +1 -0
- package/dist/assets/ConnectionStatus.css +1 -0
- package/dist/assets/DialogQR.css +1 -0
- package/dist/assets/Motd.css +1 -0
- package/dist/assets/Privacy.css +1 -0
- package/dist/assets/Spinner.css +1 -0
- package/dist/assets/Webcam.css +1 -0
- package/dist/assets/style.css +1 -0
- package/dist/assets/theme.css +1 -0
- package/dist/colours.module.css +19 -0
- package/dist/components/AlertPara/AlertPara.d.ts +8 -0
- package/dist/components/AlertPara/AlertPara.js +19 -0
- package/dist/components/BusyButton/BusyButton.d.ts +7 -0
- package/dist/components/BusyButton/BusyButton.js +25 -0
- package/dist/components/Button/Button.d.ts +6 -0
- package/dist/components/Button/Button.js +6 -0
- package/dist/components/ConnectionStatus/ConnectionStatus.d.ts +12 -0
- package/dist/components/ConnectionStatus/ConnectionStatus.js +82 -0
- package/dist/components/ConnectionStatus/FlashWifi.d.ts +1 -0
- package/dist/components/ConnectionStatus/FlashWifi.js +6 -0
- package/dist/components/ConnectionStatus/check.d.ts +1 -0
- package/dist/components/ConnectionStatus/check.js +10 -0
- package/dist/components/ConnectionStatus/ice.d.ts +13 -0
- package/dist/components/ConnectionStatus/ice.js +12 -0
- package/dist/components/ContentLoader/ContentError.d.ts +5 -0
- package/dist/components/ContentLoader/ContentError.js +21 -0
- package/dist/components/ContentLoader/ContentLoader.d.ts +8 -0
- package/dist/components/ContentLoader/ContentLoader.js +51 -0
- package/dist/components/ContentLoader/ContentProgress.d.ts +6 -0
- package/dist/components/ContentLoader/ContentProgress.js +31 -0
- package/dist/components/Motd/Motd.d.ts +5 -0
- package/dist/components/Motd/Motd.js +48 -0
- package/dist/components/Privacy/Privacy.d.ts +7 -0
- package/dist/components/Privacy/Privacy.js +57 -0
- package/dist/components/QRCode/DialogQR.d.ts +7 -0
- package/dist/components/QRCode/DialogQR.js +14 -0
- package/dist/components/QRCode/QRCode.d.ts +9 -0
- package/dist/components/QRCode/QRCode.js +61 -0
- package/dist/components/Spinner/Spinner.d.ts +6 -0
- package/dist/components/Spinner/Spinner.js +33 -0
- package/dist/components/Webcam/Webcam.d.ts +15 -0
- package/dist/components/Webcam/Webcam.js +397 -0
- package/dist/components/Webcam/webcamClass.d.ts +32 -0
- package/dist/components/Webcam/webcamClass.js +76 -0
- package/dist/createSvgIcon-BfF8yuCp.js +249 -0
- package/dist/createTheme-BIcG8YPQ.js +2895 -0
- package/dist/hooks/id.d.ts +1 -0
- package/dist/hooks/id.js +16 -0
- package/dist/hooks/onlyOnce.d.ts +1 -0
- package/dist/hooks/onlyOnce.js +7 -0
- package/dist/hooks/peer.d.ts +25 -0
- package/dist/hooks/peer.js +70 -0
- package/dist/hooks/random.d.ts +1 -0
- package/dist/hooks/random.js +9 -0
- package/dist/hooks/useTabActive.d.ts +1 -0
- package/dist/hooks/useTabActive.js +17 -0
- package/dist/index-SOhdqzHq.js +113 -0
- package/dist/main.d.ts +21 -0
- package/dist/main.js +49 -0
- package/dist/react-D-b-Xrzv.js +98 -0
- package/dist/services/peer2peer/Incoming.d.ts +13 -0
- package/dist/services/peer2peer/Incoming.js +39 -0
- package/dist/services/peer2peer/Outgoing.d.ts +25 -0
- package/dist/services/peer2peer/Outgoing.js +65 -0
- package/dist/services/peer2peer/Peer2Peer.d.ts +80 -0
- package/dist/services/peer2peer/Peer2Peer.js +3367 -0
- package/dist/services/peer2peer/PeerConnection.d.ts +40 -0
- package/dist/services/peer2peer/PeerConnection.js +155 -0
- package/dist/services/peer2peer/error.d.ts +2 -0
- package/dist/services/peer2peer/error.js +5 -0
- package/dist/services/peer2peer/types.d.ts +38 -0
- package/dist/services/peer2peer/types.js +1 -0
- package/dist/state/webrtcState.d.ts +12 -0
- package/dist/state/webrtcState.js +6 -0
- package/dist/style/theme.d.ts +1 -0
- package/dist/style/theme.js +33 -0
- package/dist/style.module-DSFm2eLD.js +9 -0
- package/dist/util/backoff.d.ts +1 -0
- package/dist/util/backoff.js +6 -0
- package/dist/util/base64.d.ts +2 -0
- package/dist/util/base64.js +19 -0
- package/dist/util/canvas.d.ts +7 -0
- package/dist/util/canvas.js +92 -0
- package/dist/util/crypto.d.ts +7 -0
- package/dist/util/crypto.js +50 -0
- package/dist/util/randomId.d.ts +1 -0
- package/dist/util/randomId.js +8 -0
- package/dist/util/zip.d.ts +13 -0
- package/dist/util/zip.js +94 -0
- package/dist/webrtcState-D0nJpE9Z.js +406 -0
- package/package.json +88 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as a, useEffect as c } from "react";
|
|
3
|
+
import { c as r } from "./createSvgIcon-BfF8yuCp.js";
|
|
4
|
+
const f = r(/* @__PURE__ */ t("path", {
|
|
5
|
+
d: "m1 9 2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9m8 8 3 3 3-3c-1.65-1.66-4.34-1.66-6 0m-4-4 2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13"
|
|
6
|
+
}), "Wifi"), l = r(/* @__PURE__ */ t("path", {
|
|
7
|
+
d: "M12 6c3.33 0 6.49 1.08 9.08 3.07L12 18.17l-9.08-9.1C5.51 7.08 8.67 6 12 6m0-2C7.31 4 3.07 5.9 0 8.98L12 21 24 8.98C20.93 5.9 16.69 4 12 4"
|
|
8
|
+
}), "SignalWifi0Bar");
|
|
9
|
+
function S() {
|
|
10
|
+
const [e, i] = a(!1);
|
|
11
|
+
return c(() => {
|
|
12
|
+
const o = setInterval(() => i((n) => !n), 1e3);
|
|
13
|
+
return () => {
|
|
14
|
+
clearInterval(o);
|
|
15
|
+
};
|
|
16
|
+
}, []), e ? /* @__PURE__ */ t(
|
|
17
|
+
f,
|
|
18
|
+
{
|
|
19
|
+
fontSize: "large",
|
|
20
|
+
color: "inherit"
|
|
21
|
+
}
|
|
22
|
+
) : /* @__PURE__ */ t(
|
|
23
|
+
l,
|
|
24
|
+
{
|
|
25
|
+
fontSize: "large",
|
|
26
|
+
color: "inherit"
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
S as F,
|
|
32
|
+
f as W
|
|
33
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
+
function l(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
o as c,
|
|
7
|
+
l as g
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._alert_ur25l_1{padding:.5rem 1rem;background:transparent;transition:background .5s;display:flex;justify-content:left;align-items:center;gap:1rem;max-width:400px;border-radius:4px}._isolated_ur25l_13{margin:.5rem;border-radius:6px;padding:.5rem}._info_ur25l_23{background:#e5f6fd;color:#014361}._alert_ur25l_1 svg{color:#0288d1}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._container_1p4sr_3{display:flex;flex-direction:column;align-items:center;color:#ed6c02;font-size:.9rem;pointer-events:none;-webkit-user-select:none;user-select:none;width:min-content;overflow:hidden}._containerConnecting_1p4sr_15{color:#ed6c02}._containerSuccess_1p4sr_20{color:#2e7d32}._containerMedium_1p4sr_25{color:#ed6c02}._containerBad_1p4sr_30{color:#d32f2f}._message_1p4sr_35{overflow-wrap:break-word;text-wrap:wrap;width:100%;text-align:center;-webkit-user-select:none;user-select:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._link_1udre_3{display:flex;flex-direction:column;align-items:center;gap:1rem;font-size:1.8rem;font-weight:700;text-decoration:inherit;color:inherit}._container_1udre_14{display:flex;align-items:center}._canvas_1udre_19{cursor:pointer;margin:2px}._canvas_1udre_19:focus{border:2px solid #008297;margin:0;border-radius:4px}._dialog_1udre_30,._dialog_1udre_30 .MuiDialog-paper{margin:0}._dialog_1udre_30 .MuiDialogContent-root{padding:0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._motd_1rn2j_3{width:100%;font-size:1.2rem;font-weight:700;color:#fff;padding:.8rem;text-align:center;margin:0;display:flex;align-items:center}._info_1rn2j_15{background:#e8f0fe;color:#444}._warn_1rn2j_21{background:#fd9d32}._error_1rn2j_26{background:#e04f66}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._policy_12v8a_1{color:#444;background:#fff;position:fixed;align-items:center;gap:1rem;max-width:200px;display:flex;font-size:.7rem;box-sizing:border-box;box-shadow:0 0 6px #ddd;overflow:hidden}._bottomLeft_12v8a_15{bottom:0;left:0;border-top-right-radius:20px;padding-right:15px}._topRight_12v8a_22{top:0;right:0;border-bottom-left-radius:20px;padding-left:15px}._policy_12v8a_1 a,._policy_12v8a_1 a:visited{color:#444}._versionBox_12v8a_37{font-size:6pt;height:40px;display:flex;align-items:center;justify-content:center;padding-left:5px;padding-right:8px;background:#444;box-sizing:border-box}._bottomLeft_12v8a_15 ._versionBox_12v8a_37{border-top-right-radius:20px}._topRight_12v8a_22 ._versionBox_12v8a_37{border-bottom-left-radius:20px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._spinner_18gtf_3{display:inline-block;position:relative;width:80px;height:80px}._largeSpinner_18gtf_10{transform:scale(2)}._spinner_18gtf_3 div{transform-origin:40px 40px}._animated_18gtf_19 div{animation:_lds-spinner_18gtf_1 1.2s linear infinite}._spinner_18gtf_3 div:after{content:" ";display:block;position:absolute;top:3px;left:37px;width:6px;height:18px;border-radius:3px;background:#008297}._disabled_18gtf_35 div{animation:none}._disabled_18gtf_35 div:after{opacity:.1}._spinner_18gtf_3 div:nth-child(1){transform:rotate(0);animation-delay:-1.1s}._spinner_18gtf_3 div:nth-child(2){transform:rotate(30deg);animation-delay:-1s}._spinner_18gtf_3 div:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}._spinner_18gtf_3 div:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}._spinner_18gtf_3 div:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}._spinner_18gtf_3 div:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}._spinner_18gtf_3 div:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}._spinner_18gtf_3 div:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}._spinner_18gtf_3 div:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}._spinner_18gtf_3 div:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}._spinner_18gtf_3 div:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}._spinner_18gtf_3 div:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes _lds-spinner_18gtf_1{0%{opacity:1}to{opacity:0}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._container_u6uf5_1{display:flex}._wrapContainer_u6uf5_5{position:relative;color:#fff}._flipButton_u6uf5_10{position:absolute;right:.5rem;top:.5rem}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._title_1bpz2_3{background:#e8f0fe;border-bottom:2px solid rgb(2,136,209)}._content_1bpz2_8{display:flex;flex-direction:column;gap:1rem;padding:2rem;padding-top:1rem!important;max-width:400px;align-items:center}._errorTitle_1bpz2_18{background:#ffcbcb;border-bottom:2px solid #fa3e3e}._errorContent_1bpz2_23{display:flex;flex-direction:column;gap:1rem;padding:2rem;padding-top:1rem!important;max-width:400px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:Andika;src:url(https://store.gen-ai.fi/fonts/Andika-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:Andika;src:url(https://store.gen-ai.fi/fonts/Andika-Bold.ttf) format("truetype");font-weight:700;font-style:normal}.MuiPopper-root{font-size:1rem;padding-left:5px}.MuiTooltip-tooltip{font-size:1rem;padding:.3em .8rem;background:#5f7377;border-radius:6px}.MuiTooltip-arrow{color:#5f7377}.MuiDialogTitle-root{border-bottom:2px solid #008297;padding:.5rem 1rem;background:#e5f6fd;margin-bottom:.5rem}.MuiBackdrop-root{background:#ffffffb3}.MuiDialog-paper{border-radius:6px}.MuiMenu-paper{box-shadow:none;box-shadow:1px 1px 8px #888}.MuiDialogContent-root{font-family:Andika}.MuiSpeedDialAction-staticTooltipLabel{width:max-content;box-shadow:0 2px 8px #0006;color:#fff;background:#5f7377;border-radius:6px}h1{color:#444}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@value textDark: #444;
|
|
2
|
+
@value textLight: #f7f9f5;
|
|
3
|
+
@value bgColourful1: #078092;
|
|
4
|
+
@value bgColourful2: #fd9d32;
|
|
5
|
+
@value bgColourful3: #e04f66;
|
|
6
|
+
@value bgSubdued1: #e8f0fe;
|
|
7
|
+
@value bgSubdued2: #fecb8b;
|
|
8
|
+
@value bgSubdued3: #ff9499;
|
|
9
|
+
@value backgroundDark: #5f7377;
|
|
10
|
+
@value backgroundLight: #dee4e8;
|
|
11
|
+
@value workspaceBg: #dfe5e8;
|
|
12
|
+
@value primary: #008297;
|
|
13
|
+
@value primaryHover: rgba(0, 130, 151, 0.04);
|
|
14
|
+
@value secondary: rgb(174, 37, 174);
|
|
15
|
+
@value bgError: #ffcbcb;
|
|
16
|
+
@value bgOk: #a2e4b8;
|
|
17
|
+
@value borderGrey: #ddd;
|
|
18
|
+
@value borderGreen: #19b1a8;
|
|
19
|
+
@value borderBrightBlue: rgb(2, 136, 209);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface Props extends React.PropsWithChildren {
|
|
3
|
+
severity: 'none' | 'info' | 'warn' | 'error' | 'success';
|
|
4
|
+
hideIcon?: boolean;
|
|
5
|
+
isolated?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export default function AlertPara({ severity, children, hideIcon, isolated }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as a } from "../../createSvgIcon-BfF8yuCp.js";
|
|
3
|
+
import '../../assets/AlertPara.css';const _ = a(/* @__PURE__ */ t("path", {
|
|
4
|
+
d: "M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"
|
|
5
|
+
}), "InfoOutlined"), c = "_alert_ur25l_1", i = "_isolated_ur25l_13", f = "_none_ur25l_19 _alert_ur25l_1", u = "_info_ur25l_23 _alert_ur25l_1", n = {
|
|
6
|
+
alert: c,
|
|
7
|
+
isolated: i,
|
|
8
|
+
none: f,
|
|
9
|
+
info: u
|
|
10
|
+
};
|
|
11
|
+
function h({ severity: o, children: l, hideIcon: e, isolated: r }) {
|
|
12
|
+
return /* @__PURE__ */ s("p", { className: n[o] + (r ? ` ${n.isolated}` : ""), children: [
|
|
13
|
+
!e && o === "info" && /* @__PURE__ */ t(_, { fontSize: "small" }),
|
|
14
|
+
l
|
|
15
|
+
] });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
h as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Button } from '../Button/Button';
|
|
3
|
+
interface Props extends React.ComponentProps<typeof Button> {
|
|
4
|
+
busy?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as a } from "react";
|
|
3
|
+
import { B as n, C as s } from "../../Button-DQwRVw4a.js";
|
|
4
|
+
const m = a(function({ busy: r, ...t }, i) {
|
|
5
|
+
return /* @__PURE__ */ o(
|
|
6
|
+
n,
|
|
7
|
+
{
|
|
8
|
+
ref: i,
|
|
9
|
+
...t,
|
|
10
|
+
disabled: r || t.disabled,
|
|
11
|
+
sx: {
|
|
12
|
+
...t.sx,
|
|
13
|
+
"& .MuiCircularProgress-root": {
|
|
14
|
+
width: "20px !important",
|
|
15
|
+
height: "20px !important"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
startIcon: r ? /* @__PURE__ */ o(s, {}) : t.startIcon,
|
|
19
|
+
children: t.children
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
m as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const Button: import('@emotion/styled').StyledComponent<import('@mui/material').ButtonOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
2
|
+
ref?: ((instance: HTMLButtonElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLButtonElement> | null | undefined;
|
|
3
|
+
}, "disabled" | "className" | "style" | "classes" | "children" | "color" | "sx" | "tabIndex" | "href" | "action" | "loading" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "loadingIndicator" | "loadingPosition" | "startIcon" | "variant"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
|
+
export declare const LargeButton: import('@emotion/styled').StyledComponent<import('@mui/material').ButtonOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
5
|
+
ref?: ((instance: HTMLButtonElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLButtonElement> | null | undefined;
|
|
6
|
+
}, "disabled" | "className" | "style" | "classes" | "children" | "color" | "sx" | "tabIndex" | "href" | "action" | "loading" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "loadingIndicator" | "loadingPosition" | "startIcon" | "variant"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PeerEvent } from '../../services/peer2peer/types';
|
|
2
|
+
import { default as Peer2Peer } from '../../services/peer2peer/Peer2Peer';
|
|
3
|
+
interface Props {
|
|
4
|
+
api: string;
|
|
5
|
+
appName: string;
|
|
6
|
+
ready?: boolean;
|
|
7
|
+
peer?: Peer2Peer<PeerEvent>;
|
|
8
|
+
visibility?: number;
|
|
9
|
+
noCheck?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export default function ConnectionStatus({ api, appName, ready, peer, visibility, noCheck }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as o, Fragment as W, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { i as q, w as y } from "../../webrtcState-D0nJpE9Z.js";
|
|
3
|
+
import { useRef as F, useState as g, useEffect as s } from "react";
|
|
4
|
+
import { getRTConfig as R } from "./ice.js";
|
|
5
|
+
import { W as z, F as E } from "../../FlashWifi-CaAOKd3g.js";
|
|
6
|
+
import { useTranslation as P } from "react-i18next";
|
|
7
|
+
import { c as w } from "../../createSvgIcon-BfF8yuCp.js";
|
|
8
|
+
import { checkP2P as x } from "./check.js";
|
|
9
|
+
import { u as I } from "../../react-D-b-Xrzv.js";
|
|
10
|
+
import '../../assets/ConnectionStatus.css';const A = "_containerConnecting_1p4sr_15 _container_1p4sr_3", U = "_containerSuccess_1p4sr_20 _container_1p4sr_3", b = "_containerMedium_1p4sr_25 _container_1p4sr_3", j = "_containerBad_1p4sr_30 _container_1p4sr_3", k = "_message_1p4sr_35", r = {
|
|
11
|
+
containerConnecting: A,
|
|
12
|
+
containerSuccess: U,
|
|
13
|
+
containerMedium: b,
|
|
14
|
+
containerBad: j,
|
|
15
|
+
message: k
|
|
16
|
+
}, D = w(/* @__PURE__ */ o("path", {
|
|
17
|
+
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"
|
|
18
|
+
}), "SignalWifiBad"), $ = 6e4;
|
|
19
|
+
function Y({ api: f, appName: S, ready: c, peer: t, visibility: v, noCheck: C }) {
|
|
20
|
+
const { t: h } = P(), [u, M] = I(q), [T, l] = I(y), m = F(), [i, d] = g("connecting"), [e, _] = g(0), [, L] = g(!1), [a, B] = g(!1);
|
|
21
|
+
return s(() => {
|
|
22
|
+
if (t)
|
|
23
|
+
return t.on("status", d), t.on("quality", _), d(t.status), _(t.quality), () => {
|
|
24
|
+
t.off("status", d), t.off("quality", _);
|
|
25
|
+
};
|
|
26
|
+
_(0), d("connecting");
|
|
27
|
+
}, [t]), s(() => {
|
|
28
|
+
u || R(f, S, (n) => {
|
|
29
|
+
M(n);
|
|
30
|
+
});
|
|
31
|
+
}, [u, M, f, S]), s(() => {
|
|
32
|
+
if (i !== "ready") {
|
|
33
|
+
const n = setTimeout(() => {
|
|
34
|
+
B(!0);
|
|
35
|
+
}, $);
|
|
36
|
+
return () => {
|
|
37
|
+
clearTimeout(n);
|
|
38
|
+
};
|
|
39
|
+
} else
|
|
40
|
+
B(!1);
|
|
41
|
+
}, [i]), s(() => {
|
|
42
|
+
u && T === "unset" && (navigator != null && navigator.mediaDevices ? navigator.mediaDevices.getUserMedia({ video: !0 }).then((n) => {
|
|
43
|
+
m.current = n, l("full");
|
|
44
|
+
}).catch(() => {
|
|
45
|
+
l("relay");
|
|
46
|
+
}) : l("relay"));
|
|
47
|
+
}, [u, T, l]), s(() => {
|
|
48
|
+
c && m.current && (m.current.getTracks().forEach(function(n) {
|
|
49
|
+
n.stop();
|
|
50
|
+
}), m.current = void 0);
|
|
51
|
+
}, [c, i]), s(() => {
|
|
52
|
+
c && t && !C && t.code && x(f, t.code).then((n) => {
|
|
53
|
+
L(n);
|
|
54
|
+
});
|
|
55
|
+
}, [c, t, f, C]), /* @__PURE__ */ o(W, { children: (v === void 0 || e <= v) && /* @__PURE__ */ p(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: i === "connecting" && !a ? r.containerConnecting : e === 3 ? r.containerSuccess : e === 2 ? r.containerMedium : r.containerBad,
|
|
59
|
+
children: [
|
|
60
|
+
!a && e > 0 && /* @__PURE__ */ o(
|
|
61
|
+
z,
|
|
62
|
+
{
|
|
63
|
+
fontSize: "large",
|
|
64
|
+
color: "inherit"
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
!a && e <= 0 && /* @__PURE__ */ o(E, {}),
|
|
68
|
+
a && /* @__PURE__ */ o(
|
|
69
|
+
D,
|
|
70
|
+
{
|
|
71
|
+
fontSize: "large",
|
|
72
|
+
color: "inherit"
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ o("div", { className: r.message, children: h(c ? `loader.messages.quality${e}` : a ? "loader.messages.failed" : `loader.messages.${i}`) })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
) });
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
Y as default
|
|
82
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function FlashWifi(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function checkP2P(api: string, code: string): Promise<boolean>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type RouteType = 'any' | 'nearest';
|
|
2
|
+
export interface CommunicationIceServer {
|
|
3
|
+
urls: string[];
|
|
4
|
+
username: string;
|
|
5
|
+
credential: string;
|
|
6
|
+
routeType: RouteType;
|
|
7
|
+
}
|
|
8
|
+
export interface CommunicationRelayConfiguration {
|
|
9
|
+
expiresOn: Date;
|
|
10
|
+
iceServers: CommunicationIceServer[];
|
|
11
|
+
}
|
|
12
|
+
export declare function getRTConfig(api: string, appName: string, resolve: (value: CommunicationRelayConfiguration) => void): void;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { expBackoff as n } from "../../util/backoff.js";
|
|
2
|
+
let c = 0;
|
|
3
|
+
function i(t, o, f) {
|
|
4
|
+
fetch(`${t}/rtcconfig?appName=${o}`).then((e) => {
|
|
5
|
+
e.ok ? (c = 0, e.json().then(f)) : setTimeout(() => i(t, o, f), n(c++, 5));
|
|
6
|
+
}).catch(() => {
|
|
7
|
+
setTimeout(() => i(t, o, f), n(c++, 5));
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
i as getRTConfig
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog as l, DialogTitle as a, DialogContent as i } from "@mui/material";
|
|
3
|
+
import { useTranslation as s } from "react-i18next";
|
|
4
|
+
import { s as t } from "../../style.module-DSFm2eLD.js";
|
|
5
|
+
function f({ error: o }) {
|
|
6
|
+
const { t: r } = s();
|
|
7
|
+
return /* @__PURE__ */ n(
|
|
8
|
+
l,
|
|
9
|
+
{
|
|
10
|
+
hideBackdrop: !0,
|
|
11
|
+
open: o !== "none",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ e(a, { className: t.errorTitle, children: r("loader.titles.error") }),
|
|
14
|
+
/* @__PURE__ */ e(i, { className: t.errorContent, children: /* @__PURE__ */ e("div", { children: r(`loader.errors.${o}`, { defaultValue: r("loader.errors.unknownContent") }) }) })
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
f as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ZipData } from '../../util/zip';
|
|
2
|
+
interface Props {
|
|
3
|
+
content?: (File | ArrayBuffer | string)[];
|
|
4
|
+
onLoaded?: () => void;
|
|
5
|
+
onLoad: (data: ZipData) => Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export default function ContentLoader({ content, onLoaded, onLoad }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsxs as P, Fragment as S, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { getZipBlob as x, loadZipFile as y } from "../../util/zip.js";
|
|
3
|
+
import { useRef as C, useState as p, useEffect as E } from "react";
|
|
4
|
+
import j from "./ContentError.js";
|
|
5
|
+
import F from "./ContentProgress.js";
|
|
6
|
+
function B({ content: r, onLoaded: l, onLoad: d }) {
|
|
7
|
+
const f = C(/* @__PURE__ */ new Set()), [n, e] = p("waiting"), [h, g] = p();
|
|
8
|
+
return E(() => {
|
|
9
|
+
if (r && r.length > 0) {
|
|
10
|
+
const s = r.filter((o) => typeof o == "string" ? !f.current.has(o) : !0);
|
|
11
|
+
if (s.length === 0) return;
|
|
12
|
+
e("downloading");
|
|
13
|
+
const c = [], m = new Array(s.length).fill(0);
|
|
14
|
+
s.forEach((o, a) => {
|
|
15
|
+
typeof o == "string" && f.current.add(o), c.push(
|
|
16
|
+
x(o, (t) => {
|
|
17
|
+
m[a] = t, g(m.reduce((i, w) => i + w, 0) / s.length);
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
}), Promise.all(c).then((o) => {
|
|
21
|
+
e("loading"), g(void 0);
|
|
22
|
+
const a = o.map((t) => y(t).then((i) => d(i)));
|
|
23
|
+
Promise.all(a).then(() => {
|
|
24
|
+
e("done"), l && l();
|
|
25
|
+
}).catch((t) => {
|
|
26
|
+
console.error(t), e("failed-load");
|
|
27
|
+
});
|
|
28
|
+
}).catch((o) => {
|
|
29
|
+
console.error(o), e("failed-download");
|
|
30
|
+
});
|
|
31
|
+
} else
|
|
32
|
+
e("waiting");
|
|
33
|
+
}, [r, l, d]), /* @__PURE__ */ P(S, { children: [
|
|
34
|
+
/* @__PURE__ */ u(
|
|
35
|
+
F,
|
|
36
|
+
{
|
|
37
|
+
status: n === "downloading" ? "download" : n === "loading" ? "load" : "none",
|
|
38
|
+
progress: h
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ u(
|
|
42
|
+
j,
|
|
43
|
+
{
|
|
44
|
+
error: n === "failed-download" ? "download" : n === "failed-load" ? "load" : "none"
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
B as default
|
|
51
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog as a, DialogTitle as l, DialogContent as d, LinearProgress as s } from "@mui/material";
|
|
3
|
+
import { useTranslation as m } from "react-i18next";
|
|
4
|
+
import { s as r } from "../../style.module-DSFm2eLD.js";
|
|
5
|
+
function p({ status: o, progress: e }) {
|
|
6
|
+
const { t: n } = m();
|
|
7
|
+
return /* @__PURE__ */ i(
|
|
8
|
+
a,
|
|
9
|
+
{
|
|
10
|
+
hideBackdrop: !0,
|
|
11
|
+
open: o !== "none",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ t(l, { className: r.title, children: n("loader.titles.contentLoad") }),
|
|
14
|
+
/* @__PURE__ */ i(d, { className: r.content, children: [
|
|
15
|
+
/* @__PURE__ */ t("div", { children: n(`loader.messages.content_${o}`) }),
|
|
16
|
+
/* @__PURE__ */ t(
|
|
17
|
+
s,
|
|
18
|
+
{
|
|
19
|
+
style: { width: "100%" },
|
|
20
|
+
variant: e === void 0 ? "indeterminate" : "determinate",
|
|
21
|
+
value: e === void 0 ? void 0 : Math.floor(e)
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
] })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
p as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useEffect as d, useMemo as m } from "react";
|
|
3
|
+
import { c as _ } from "../../createSvgIcon-BfF8yuCp.js";
|
|
4
|
+
import { IconButton as a } from "@mui/material";
|
|
5
|
+
import '../../assets/Motd.css';const g = "#e04f66", h = "#fd9d32", b = "#e8f0fe", j = "_motd_1rn2j_3", v = "_info_1rn2j_15 _motd_1rn2j_3", w = "_warn_1rn2j_21 _motd_1rn2j_3", C = "_error_1rn2j_26 _motd_1rn2j_3", M = {
|
|
6
|
+
bgColourful3: g,
|
|
7
|
+
bgColourful2: h,
|
|
8
|
+
bgSubdued1: b,
|
|
9
|
+
motd: j,
|
|
10
|
+
info: v,
|
|
11
|
+
warn: w,
|
|
12
|
+
error: C
|
|
13
|
+
}, p = _(/* @__PURE__ */ r("path", {
|
|
14
|
+
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
15
|
+
}), "Close");
|
|
16
|
+
function k({ message: t }) {
|
|
17
|
+
const [o, i] = l(t || ""), [f, c] = l(!0);
|
|
18
|
+
d(() => {
|
|
19
|
+
t || fetch("undefined/motd").then((s) => {
|
|
20
|
+
s.ok && s.json().then((e) => {
|
|
21
|
+
e && e.motd && i(e.motd);
|
|
22
|
+
});
|
|
23
|
+
}).catch(() => {
|
|
24
|
+
console.warn("MOTD Failed");
|
|
25
|
+
});
|
|
26
|
+
}, [t]);
|
|
27
|
+
const n = m(() => o.startsWith("info:") ? { msg: o.substring(5), level: "info" } : o.startsWith("warn:") ? { msg: o.substring(5), level: "warn" } : o.startsWith("error:") ? { msg: o.substring(6), level: "error" } : { msg: o, level: "info" }, [o]);
|
|
28
|
+
return o.length > 0 && f ? /* @__PURE__ */ u("div", { className: M[n.level], children: [
|
|
29
|
+
/* @__PURE__ */ r("div", { style: { flexGrow: 1 }, children: n.msg }),
|
|
30
|
+
/* @__PURE__ */ r(
|
|
31
|
+
a,
|
|
32
|
+
{
|
|
33
|
+
color: "inherit",
|
|
34
|
+
onClick: () => c(!1),
|
|
35
|
+
children: /* @__PURE__ */ r(
|
|
36
|
+
p,
|
|
37
|
+
{
|
|
38
|
+
fontSize: "large",
|
|
39
|
+
color: "inherit"
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] }) : null;
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
k as default
|
|
48
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as c } from "react-i18next";
|
|
3
|
+
import '../../assets/Privacy.css';const l = "_policy_12v8a_1", n = "_bottomLeft_12v8a_15", h = "_topRight_12v8a_22", g = "_versionBox_12v8a_37", o = {
|
|
4
|
+
policy: l,
|
|
5
|
+
bottomLeft: n,
|
|
6
|
+
topRight: h,
|
|
7
|
+
versionBox: g
|
|
8
|
+
}, d = "data:image/svg+xml,%3csvg%20width='98'%20height='96'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M48.854%200C21.839%200%200%2022%200%2049.217c0%2021.756%2013.993%2040.172%2033.405%2046.69%202.427.49%203.316-1.059%203.316-2.362%200-1.141-.08-5.052-.08-9.127-13.59%202.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015%204.934.326%207.523%205.052%207.523%205.052%204.367%207.496%2011.404%205.378%2014.235%204.074.404-3.178%201.699-5.378%203.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283%200-5.378%201.94-9.778%205.014-13.2-.485-1.222-2.184-6.275.486-13.038%200%200%204.125-1.304%2013.426%205.052a46.97%2046.97%200%200%201%2012.214-1.63c4.125%200%208.33.571%2012.213%201.63%209.302-6.356%2013.427-5.052%2013.427-5.052%202.67%206.763.97%2011.816.485%2013.038%203.155%203.422%205.015%207.822%205.015%2013.2%200%2018.905-11.404%2023.06-22.324%2024.283%201.78%201.548%203.316%204.481%203.316%209.126%200%206.6-.08%2011.897-.08%2013.526%200%201.304.89%202.853%203.316%202.364%2019.412-6.52%2033.405-24.935%2033.405-46.691C97.707%2022%2075.788%200%2048.854%200z'%20fill='%23fff'/%3e%3c/svg%3e";
|
|
9
|
+
function m({ tag: a, appName: r, position: e = "bottomLeft" }) {
|
|
10
|
+
const { t: i } = c();
|
|
11
|
+
return /* @__PURE__ */ s("section", { className: `${o.policy} ${o[e]}`, children: [
|
|
12
|
+
e === "topRight" && /* @__PURE__ */ t(
|
|
13
|
+
"a",
|
|
14
|
+
{
|
|
15
|
+
href: "/about",
|
|
16
|
+
target: "_blank",
|
|
17
|
+
children: i("about.privacyTitle")
|
|
18
|
+
}
|
|
19
|
+
),
|
|
20
|
+
/* @__PURE__ */ t(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
"aria-hidden": !0,
|
|
24
|
+
className: o.versionBox,
|
|
25
|
+
children: /* @__PURE__ */ t(
|
|
26
|
+
"a",
|
|
27
|
+
{
|
|
28
|
+
href: `https://github.com/knicos/genai-${r}/releases/tag/${a}`,
|
|
29
|
+
target: "_blank",
|
|
30
|
+
rel: "noreferrer",
|
|
31
|
+
"data-testid": "versionlink",
|
|
32
|
+
children: /* @__PURE__ */ t(
|
|
33
|
+
"img",
|
|
34
|
+
{
|
|
35
|
+
src: d,
|
|
36
|
+
width: 24,
|
|
37
|
+
height: 24,
|
|
38
|
+
alt: "Github source"
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
e === "bottomLeft" && /* @__PURE__ */ t(
|
|
46
|
+
"a",
|
|
47
|
+
{
|
|
48
|
+
href: "/about",
|
|
49
|
+
target: "_blank",
|
|
50
|
+
children: i("about.privacyTitle")
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] });
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
m as default
|
|
57
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { D as u } from "../../DialogQR-BU45QB3i.js";
|
|
4
|
+
import "@mui/material";
|
|
5
|
+
import "react-i18next";
|
|
6
|
+
import "../../webrtcState-D0nJpE9Z.js";
|
|
7
|
+
import "../../Button-DQwRVw4a.js";
|
|
8
|
+
import "../../index-SOhdqzHq.js";
|
|
9
|
+
import "../../style/theme.js";
|
|
10
|
+
import "../../FileSaver.min-DhePf63e.js";
|
|
11
|
+
import "../BusyButton/BusyButton.js";
|
|
12
|
+
export {
|
|
13
|
+
u as default
|
|
14
|
+
};
|