@vincentt-xr/sdk 2.0.0-alpha.17 → 2.0.0-alpha.19
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/GROUNDING.md +225 -0
- package/components.json +221 -0
- package/dist/{CanonicalHeadFrame-vn-jM9fG.js → CanonicalHeadFrame-CQe2YX9a.js} +3 -3
- package/dist/{DebuggerUI-DDpU-nBF.js → DebuggerUI-CKYrYmod.js} +1 -1
- package/dist/{FaceRetouch-D2xH5OpW.js → FaceRetouch-l7y4oZBu.js} +4 -4
- package/dist/Scenes-BX0bR1j4.js +44 -0
- package/dist/Scenes-Dtt8UGE8.cjs +1 -0
- package/dist/audio/AudioPlayer.d.ts +2 -1
- package/dist/{bodyMaskMaterial-C3aXItLo.js → bodyMaskMaterial-BOdSJUEM.js} +1 -1
- package/dist/{cache-C85JjyZA.js → cache-Mu-VO_6E.js} +2 -2
- package/dist/components/Button/index.d.ts +23 -0
- package/dist/components/Button/safeLink.d.ts +6 -0
- package/dist/components/HtmlRegion/index.d.ts +8 -0
- package/dist/components/Light/index.d.ts +26 -0
- package/dist/components/Model/index.d.ts +16 -0
- package/dist/components/Object3D/index.d.ts +13 -0
- package/dist/components/PaintedFace/index.d.ts +24 -0
- package/dist/components/ScreenImage/types.d.ts +2 -2
- package/dist/components/ScreenText/types.d.ts +2 -1
- package/dist/components/ThemeProvider/index.d.ts +24 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/{contexts-B5GODwuV.js → contexts-Cl-4dUOI.js} +2 -2
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui.cjs +1 -1
- package/dist/debug-ui.js +11 -11
- package/dist/{drawNormalizedCrop-BLfB484W.js → drawNormalizedCrop-D606u5-F.js} +5 -5
- package/dist/editor-defs/definitions.d.ts +2 -0
- package/dist/editor-defs/index.d.ts +3 -0
- package/dist/editor-defs/types.d.ts +54 -0
- package/dist/editor-sample/sample.d.ts +15 -0
- package/dist/editor-scenes.cjs +1 -1
- package/dist/editor-scenes.js +39 -25
- package/dist/entries/core.d.ts +13 -1
- package/dist/entries/face-effects.d.ts +2 -0
- package/dist/face-effects.cjs +68 -68
- package/dist/face-effects.js +1353 -1333
- package/dist/{getFaceInfo-D_tCSQC7.js → getFaceInfo-Mt44zlej.js} +1 -1
- package/dist/{index-B9DdHE4u.js → index-B0EYdofX.js} +1 -1
- package/dist/{index-CTqQJj5p.js → index-BDxJWWyy.js} +85 -85
- package/dist/{index-DlP4xxaT.js → index-Bn72laBn.js} +4 -4
- package/dist/{index-Otoo-rph.js → index-CM3jkleV.js} +240 -223
- package/dist/{index-D10O6vqR.js → index-CbBCl2ZU.js} +2 -2
- package/dist/{index-CNt8esFO.js → index-CicO_Tnw.js} +1 -1
- package/dist/{index-Z5eKEUdE.js → index-D5NbXaCn.js} +4 -4
- package/dist/{index-D_pgrgJg.cjs → index-fDwL47CM.cjs} +3 -3
- package/dist/instructions.js +7 -7
- package/dist/{internal-TD4QhIry.js → internal-BoFDq5hC.js} +3 -3
- package/dist/internal.js +2 -2
- package/dist/{landmarks-vLy5QKt6.js → landmarks-C3LvDhMt.js} +1 -1
- package/dist/low-level.js +17 -17
- package/dist/main.cjs +1 -1
- package/dist/main.js +1046 -814
- package/dist/particles.js +5 -5
- package/dist/product.js +2 -2
- package/dist/{providers-DmJlgrDD.js → providers-Bxt_MfPK.js} +3 -3
- package/dist/{renderGroups-BcQYy_J2.js → renderGroups-uYPzUa66.js} +1 -1
- package/dist/{renderPasses-DIPTIU_x.js → renderPasses-C0wu5Cwg.js} +4 -4
- package/dist/scene-object.js +2 -2
- package/dist/scenes/Scenes.d.ts +17 -0
- package/dist/scenes/edit.d.ts +9 -1
- package/dist/{segmentation-CZs5aVvY.js → segmentation-DccvYBBO.js} +9 -9
- package/dist/{selectors-K5JKCWxw.js → selectors-J06V0eDb.js} +1 -1
- package/dist/{session-DHBNTyJJ.js → session-CYiWfcvz.js} +1 -1
- package/dist/tracking.js +25 -25
- package/dist/{trigger-BwZ81ENx.js → trigger-CQviD4xp.js} +155 -155
- package/dist/{useBodies-BMKHXAOL.js → useBodies-DOuwRuew.js} +2 -2
- package/dist/{useFaceInfo-BNVdnprN.js → useFaceInfo-XUGYTdfN.js} +4 -4
- package/dist/{useFaceResultReader-B15wn6RB.js → useFaceResultReader-D8wXbF1L.js} +1 -1
- package/dist/{useIrisTracking-CYm-KDIZ.js → useIrisTracking-B0uLWgNE.js} +10 -10
- package/dist/{useXRCapabilities-ClWlG5_Y.js → useXRCapabilities-DPUOvpdf.js} +1 -1
- package/package.json +6 -2
- package/settings.json +1 -1
- package/dist/Scenes-B30XZfTq.js +0 -29
- package/dist/Scenes-BLL7YvLw.cjs +0 -1
package/dist/main.js
CHANGED
|
@@ -1,140 +1,142 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { j as
|
|
5
|
-
import {
|
|
6
|
-
import { S as
|
|
7
|
-
import { X as
|
|
8
|
-
import { S as
|
|
9
|
-
import { jsxs as
|
|
10
|
-
import { useRef as
|
|
11
|
-
import * as
|
|
12
|
-
import { MathUtils as
|
|
13
|
-
import { D as
|
|
14
|
-
import { useThree as
|
|
15
|
-
import { R as
|
|
16
|
-
import { c as
|
|
17
|
-
import { u as
|
|
18
|
-
import { d as
|
|
19
|
-
import { S as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { useTexture as
|
|
23
|
-
import { a as
|
|
24
|
-
import {
|
|
25
|
-
import { D as
|
|
26
|
-
import { M as
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
var Be = Object.defineProperty;
|
|
2
|
+
var $e = (e, t, r) => t in e ? Be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var D = (e, t, r) => $e(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { j as k, J as Xe, u as He, as as Ke, at as je, au as Ve, av as Ze, aw as Ye, ax as Je } from "./index-BDxJWWyy.js";
|
|
5
|
+
import { b8 as Ms, az as Es, b9 as bs, M as Rs, P as As, L as Fs, w as Cs, ay as xs, ba as ks, b5 as _s, b6 as vs, aA as ws, c as Ds, z as Ps, y as Us, d as Ns, k as Ls, aR as Is, aS as Os, aT as Gs, aU as zs, n as qs, aV as Ws, i as Bs, aB as $s, O as Xs, aW as Hs, aC as Ks, aD as js, aX as Vs, aY as Zs, b3 as Ys, p as Js, A as Qs, b7 as ea, r as ta, K as ra, a3 as sa, aI as aa, aZ as na, aJ as oa, aK as ia, aL as ca, aH as la, aM as ua, aN as da, aE as ma, aO as fa, a_ as pa, b4 as ha, aP as ga, a$ as ya, t as Sa, aF as Ta, aG as Ma, b0 as Ea, b1 as ba, aQ as Ra, b2 as Aa } from "./index-BDxJWWyy.js";
|
|
6
|
+
import { S as Qe } from "./contexts-Cl-4dUOI.js";
|
|
7
|
+
import { X as Ca } from "./contexts-Cl-4dUOI.js";
|
|
8
|
+
import { S as ka, T as _a } from "./TextLabel-fEF1o3wE.js";
|
|
9
|
+
import { jsxs as O, jsx as g, Fragment as ne } from "react/jsx-runtime";
|
|
10
|
+
import { useRef as A, useMemo as z, useEffect as x, useState as _, Suspense as et, useCallback as F, forwardRef as tt, useImperativeHandle as rt, useContext as st, createContext as at, useId as nt, useSyncExternalStore as ot } from "react";
|
|
11
|
+
import * as de from "three";
|
|
12
|
+
import { MathUtils as it, Vector2 as ct, Vector3 as lt, DoubleSide as se, RepeatWrapping as Ee, LinearFilter as be } from "three";
|
|
13
|
+
import { D as wa, H as Da, G as Pa, E as Ua, J as Na, K as La, P as Ia, S as Oa, C as Ga, I as za, L as qa, M as Wa, F as Ba, B as $a } from "./index-D5NbXaCn.js";
|
|
14
|
+
import { useThree as ut, useFrame as Pe } from "@react-three/fiber";
|
|
15
|
+
import { R as dt } from "./uv-DJU_XfmN.js";
|
|
16
|
+
import { c as Ue, b as mt } from "./selectors-J06V0eDb.js";
|
|
17
|
+
import { u as ft, a as pt, s as ht, F as gt } from "./drawNormalizedCrop-D606u5-F.js";
|
|
18
|
+
import { d as Ha, b as Ka, r as ja } from "./drawNormalizedCrop-D606u5-F.js";
|
|
19
|
+
import { S as yt, c as St, D as L, L as Tt } from "./index-CM3jkleV.js";
|
|
20
|
+
import { d as Za, R as Ya, a as Ja, e as Qa, b as en, f as tn } from "./index-CM3jkleV.js";
|
|
21
|
+
import { a as sn, b as an, u as nn } from "./Scenes-BX0bR1j4.js";
|
|
22
|
+
import { useTexture as Mt } from "@react-three/drei";
|
|
23
|
+
import { a as Et } from "./context-DTxSQvp4.js";
|
|
24
|
+
import { j as K, T as bt } from "./renderPasses-C0wu5Cwg.js";
|
|
25
|
+
import { k as cn, D as ln, E as un, M as dn, h as mn, S as fn, l as pn, g as hn, n as gn, r as yn } from "./renderPasses-C0wu5Cwg.js";
|
|
26
|
+
import { D as Re, M as Rt } from "./index-Bn72laBn.js";
|
|
27
|
+
import { c as Tn, n as Mn } from "./index-Bn72laBn.js";
|
|
28
|
+
import { M as bn } from "./index-CbBCl2ZU.js";
|
|
29
|
+
import { u as An } from "./useXRCapabilities-DPUOvpdf.js";
|
|
30
|
+
import { g as Ne } from "./cache-Mu-VO_6E.js";
|
|
31
|
+
import { D as Cn, X as xn, c as kn, u as _n } from "./cache-Mu-VO_6E.js";
|
|
32
|
+
import { a as At } from "./segmentation-DccvYBBO.js";
|
|
33
|
+
import { d as wn, b as Dn, e as Pn, f as Un, g as Nn, h as Ln, i as In } from "./segmentation-DccvYBBO.js";
|
|
34
|
+
const J = (e, t, r, s) => it.damp(e, t, Math.max(0, r), Math.max(0, s)), Lr = (e, t, r, s, a = new ct()) => a.set(
|
|
35
|
+
J(e.x, t.x, r, s),
|
|
36
|
+
J(e.y, t.y, r, s)
|
|
37
|
+
), Ir = (e, t, r, s, a = new lt()) => a.set(
|
|
38
|
+
J(e.x, t.x, r, s),
|
|
39
|
+
J(e.y, t.y, r, s),
|
|
40
|
+
J(e.z, t.z, r, s)
|
|
41
|
+
), Ft = "rgba(20,40,110,0.88)", Ct = 24, xt = 512;
|
|
42
|
+
function Or({
|
|
43
|
+
color: e = Ft,
|
|
42
44
|
borderColor: t,
|
|
43
|
-
borderWidth:
|
|
44
|
-
borderRadius:
|
|
45
|
-
resolution: a =
|
|
45
|
+
borderWidth: r = 0,
|
|
46
|
+
borderRadius: s = Ct,
|
|
47
|
+
resolution: a = xt,
|
|
46
48
|
aspect: n = 1,
|
|
47
|
-
opacity:
|
|
49
|
+
opacity: o = 1,
|
|
48
50
|
name: c,
|
|
49
|
-
overlay:
|
|
51
|
+
overlay: i = !0,
|
|
50
52
|
position: l,
|
|
51
|
-
rotation:
|
|
53
|
+
rotation: p,
|
|
52
54
|
scale: d,
|
|
53
|
-
visible:
|
|
55
|
+
visible: f
|
|
54
56
|
}) {
|
|
55
|
-
const u =
|
|
57
|
+
const u = A(null), m = A(null), S = z(() => kt({
|
|
56
58
|
width: Math.round(a * Math.max(n, 0.05)),
|
|
57
59
|
height: Math.round(a),
|
|
58
60
|
color: e,
|
|
59
61
|
borderColor: t,
|
|
60
|
-
borderWidth:
|
|
61
|
-
borderRadius:
|
|
62
|
-
}), [e, t,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, [
|
|
66
|
-
const
|
|
67
|
-
return
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
return
|
|
71
|
-
|
|
62
|
+
borderWidth: r,
|
|
63
|
+
borderRadius: s
|
|
64
|
+
}), [e, t, r, s, a, n]);
|
|
65
|
+
x(() => () => {
|
|
66
|
+
S.dispose();
|
|
67
|
+
}, [S]);
|
|
68
|
+
const T = A(null), h = A(o);
|
|
69
|
+
return h.current !== o && (h.current = o, T.current = null, m.current && (m.current.opacity = o)), x(() => {
|
|
70
|
+
const y = u.current;
|
|
71
|
+
if (y)
|
|
72
|
+
return y.userData.setOpacity = (E) => {
|
|
73
|
+
T.current = E, m.current && (m.current.opacity = E);
|
|
72
74
|
}, () => {
|
|
73
|
-
delete
|
|
75
|
+
delete y.userData.setOpacity;
|
|
74
76
|
};
|
|
75
|
-
}, []), /* @__PURE__ */
|
|
77
|
+
}, []), /* @__PURE__ */ O(
|
|
76
78
|
"mesh",
|
|
77
79
|
{
|
|
78
80
|
ref: u,
|
|
79
81
|
name: c,
|
|
80
82
|
position: l,
|
|
81
|
-
rotation:
|
|
83
|
+
rotation: p,
|
|
82
84
|
scale: d,
|
|
83
|
-
visible:
|
|
85
|
+
visible: f,
|
|
84
86
|
children: [
|
|
85
87
|
/* @__PURE__ */ g("planeGeometry", { args: [1, 1] }),
|
|
86
88
|
/* @__PURE__ */ g(
|
|
87
89
|
"meshBasicMaterial",
|
|
88
90
|
{
|
|
89
|
-
ref:
|
|
90
|
-
map:
|
|
91
|
+
ref: m,
|
|
92
|
+
map: S,
|
|
91
93
|
transparent: !0,
|
|
92
|
-
opacity:
|
|
93
|
-
depthTest: !
|
|
94
|
-
depthWrite: !
|
|
94
|
+
opacity: o,
|
|
95
|
+
depthTest: !i,
|
|
96
|
+
depthWrite: !i
|
|
95
97
|
}
|
|
96
98
|
)
|
|
97
99
|
]
|
|
98
100
|
}
|
|
99
101
|
);
|
|
100
102
|
}
|
|
101
|
-
function
|
|
102
|
-
const { width: t, height:
|
|
103
|
+
function kt(e) {
|
|
104
|
+
const { width: t, height: r, color: s, borderColor: a, borderWidth: n, borderRadius: o } = e, c = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(t, r) : (() => {
|
|
103
105
|
const d = document.createElement("canvas");
|
|
104
|
-
return d.width = t, d.height =
|
|
105
|
-
})(),
|
|
106
|
-
|
|
107
|
-
const l = Math.min(
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
return
|
|
106
|
+
return d.width = t, d.height = r, d;
|
|
107
|
+
})(), i = c.getContext("2d");
|
|
108
|
+
i.clearRect(0, 0, t, r);
|
|
109
|
+
const l = Math.min(o, Math.min(t, r) / 2);
|
|
110
|
+
i.beginPath(), i.moveTo(l, 0), i.lineTo(t - l, 0), i.quadraticCurveTo(t, 0, t, l), i.lineTo(t, r - l), i.quadraticCurveTo(t, r, t - l, r), i.lineTo(l, r), i.quadraticCurveTo(0, r, 0, r - l), i.lineTo(0, l), i.quadraticCurveTo(0, 0, l, 0), i.closePath(), i.fillStyle = s, i.fill(), a && n > 0 && (i.lineWidth = n, i.strokeStyle = a, i.stroke());
|
|
111
|
+
const p = new de.CanvasTexture(c);
|
|
112
|
+
return p.needsUpdate = !0, p;
|
|
111
113
|
}
|
|
112
|
-
const
|
|
114
|
+
const Gr = ({
|
|
113
115
|
segmentationMask: e,
|
|
114
116
|
segmentation: t,
|
|
115
|
-
invert:
|
|
116
|
-
customBackground:
|
|
117
|
-
renderOrder: a =
|
|
117
|
+
invert: r = !1,
|
|
118
|
+
customBackground: s,
|
|
119
|
+
renderOrder: a = dt.BACKGROUND
|
|
118
120
|
}) => {
|
|
119
|
-
const { camera: n, size:
|
|
120
|
-
|
|
121
|
+
const { camera: n, size: o } = ut(), c = Ue(), i = mt(k.BACKGROUND_SEGMENTATION), l = t ? i == null ? void 0 : i.backgroundSegmentationMask : void 0, p = A(!1);
|
|
122
|
+
x(() => {
|
|
121
123
|
if (!t) {
|
|
122
|
-
|
|
124
|
+
p.current = !1;
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
125
|
-
|
|
127
|
+
i === null && !p.current && (console.warn(
|
|
126
128
|
`[VideoBackground] segmentation="${t}" set but no matching <Segmentation> component is mounted; rendering unmasked.`
|
|
127
|
-
),
|
|
128
|
-
}, [t,
|
|
129
|
-
const d = t ? l : e,
|
|
129
|
+
), p.current = !0);
|
|
130
|
+
}, [t, i]);
|
|
131
|
+
const d = t ? l : e, f = z(() => {
|
|
130
132
|
if (!n.isPerspectiveCamera)
|
|
131
133
|
return [10, 10];
|
|
132
|
-
const u = n,
|
|
133
|
-
return [
|
|
134
|
-
}, [n,
|
|
135
|
-
return c ? /* @__PURE__ */ g("group", { position: [0, 0, -1], children:
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */ g("planeGeometry", { args:
|
|
134
|
+
const u = n, T = (u.position.z || 5) - -1, h = u.fov * Math.PI / 180, y = 2 * Math.tan(h / 2) * T;
|
|
135
|
+
return [y * (o.width / o.height), y];
|
|
136
|
+
}, [n, o]);
|
|
137
|
+
return c ? /* @__PURE__ */ g("group", { position: [0, 0, -1], children: r ? /* @__PURE__ */ O(ne, { children: [
|
|
138
|
+
/* @__PURE__ */ O("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
|
|
139
|
+
/* @__PURE__ */ g("planeGeometry", { args: f }),
|
|
138
140
|
/* @__PURE__ */ g(
|
|
139
141
|
"meshBasicMaterial",
|
|
140
142
|
{
|
|
@@ -142,45 +144,45 @@ const ms = ({
|
|
|
142
144
|
depthTest: !1,
|
|
143
145
|
depthWrite: !1,
|
|
144
146
|
toneMapped: !1,
|
|
145
|
-
side:
|
|
147
|
+
side: se
|
|
146
148
|
}
|
|
147
149
|
)
|
|
148
150
|
] }),
|
|
149
|
-
|
|
150
|
-
/* @__PURE__ */ g("planeGeometry", { args:
|
|
151
|
+
s && d && /* @__PURE__ */ O("mesh", { position: [0, 0, 0], renderOrder: a, children: [
|
|
152
|
+
/* @__PURE__ */ g("planeGeometry", { args: f }),
|
|
151
153
|
/* @__PURE__ */ g(
|
|
152
154
|
"meshBasicMaterial",
|
|
153
155
|
{
|
|
154
|
-
map: typeof
|
|
155
|
-
color: typeof
|
|
156
|
+
map: typeof s == "string" ? void 0 : s,
|
|
157
|
+
color: typeof s == "string" ? s : void 0,
|
|
156
158
|
alphaMap: d,
|
|
157
159
|
transparent: !1,
|
|
158
160
|
alphaTest: 0.5,
|
|
159
161
|
depthTest: !1,
|
|
160
162
|
depthWrite: !1,
|
|
161
163
|
toneMapped: !1,
|
|
162
|
-
side:
|
|
164
|
+
side: se
|
|
163
165
|
},
|
|
164
166
|
"inverted-mask"
|
|
165
167
|
)
|
|
166
168
|
] })
|
|
167
|
-
] }) : /* @__PURE__ */
|
|
168
|
-
|
|
169
|
-
/* @__PURE__ */ g("planeGeometry", { args:
|
|
169
|
+
] }) : /* @__PURE__ */ O(ne, { children: [
|
|
170
|
+
s && d && /* @__PURE__ */ O("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
|
|
171
|
+
/* @__PURE__ */ g("planeGeometry", { args: f }),
|
|
170
172
|
/* @__PURE__ */ g(
|
|
171
173
|
"meshBasicMaterial",
|
|
172
174
|
{
|
|
173
|
-
map: typeof
|
|
174
|
-
color: typeof
|
|
175
|
+
map: typeof s == "string" ? void 0 : s,
|
|
176
|
+
color: typeof s == "string" ? s : void 0,
|
|
175
177
|
depthTest: !1,
|
|
176
178
|
depthWrite: !1,
|
|
177
179
|
toneMapped: !1,
|
|
178
|
-
side:
|
|
180
|
+
side: se
|
|
179
181
|
}
|
|
180
182
|
)
|
|
181
183
|
] }),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */ g("planeGeometry", { args:
|
|
184
|
+
/* @__PURE__ */ O("mesh", { position: [0, 0, 0], renderOrder: a, children: [
|
|
185
|
+
/* @__PURE__ */ g("planeGeometry", { args: f }),
|
|
184
186
|
/* @__PURE__ */ g(
|
|
185
187
|
"meshBasicMaterial",
|
|
186
188
|
{
|
|
@@ -191,63 +193,63 @@ const ms = ({
|
|
|
191
193
|
depthTest: !1,
|
|
192
194
|
depthWrite: !1,
|
|
193
195
|
toneMapped: !1,
|
|
194
|
-
side:
|
|
196
|
+
side: se
|
|
195
197
|
},
|
|
196
198
|
d ? "with-mask" : "no-mask"
|
|
197
199
|
)
|
|
198
200
|
] })
|
|
199
201
|
] }) }) : null;
|
|
200
|
-
},
|
|
202
|
+
}, Le = ({
|
|
201
203
|
mask: e,
|
|
202
204
|
status: t,
|
|
203
|
-
error:
|
|
204
|
-
invert:
|
|
205
|
+
error: r,
|
|
206
|
+
invert: s = !1,
|
|
205
207
|
fallback: a = "camera",
|
|
206
208
|
onStatusChange: n,
|
|
207
|
-
fit:
|
|
208
|
-
anchors: c =
|
|
209
|
-
renderOrder:
|
|
209
|
+
fit: o = "cover",
|
|
210
|
+
anchors: c = gt,
|
|
211
|
+
renderOrder: i = 100,
|
|
210
212
|
visible: l = !0,
|
|
211
|
-
maskFeather:
|
|
213
|
+
maskFeather: p = 4,
|
|
212
214
|
maskErode: d = 0.7,
|
|
213
|
-
...
|
|
215
|
+
...f
|
|
214
216
|
}) => {
|
|
215
|
-
const u =
|
|
216
|
-
if (
|
|
217
|
-
n == null || n(t,
|
|
218
|
-
}, [t,
|
|
219
|
-
const
|
|
220
|
-
return !
|
|
221
|
-
|
|
217
|
+
const u = Ue();
|
|
218
|
+
if (x(() => {
|
|
219
|
+
n == null || n(t, r);
|
|
220
|
+
}, [t, r, n]), !u) return null;
|
|
221
|
+
const m = t === "ready" && e;
|
|
222
|
+
return !m && !ht(t, a) ? null : /* @__PURE__ */ g(
|
|
223
|
+
yt,
|
|
222
224
|
{
|
|
223
|
-
...
|
|
225
|
+
...f,
|
|
224
226
|
source: { kind: "texture", texture: u },
|
|
225
|
-
fit:
|
|
227
|
+
fit: o,
|
|
226
228
|
anchors: c,
|
|
227
|
-
renderOrder:
|
|
229
|
+
renderOrder: i,
|
|
228
230
|
visible: l,
|
|
229
|
-
maskTexture:
|
|
231
|
+
maskTexture: m ? e : null,
|
|
230
232
|
maskChannel: "green",
|
|
231
|
-
maskInvert:
|
|
232
|
-
maskFeather:
|
|
233
|
+
maskInvert: s,
|
|
234
|
+
maskFeather: p,
|
|
233
235
|
maskErode: d
|
|
234
236
|
}
|
|
235
237
|
);
|
|
236
|
-
},
|
|
237
|
-
const { texture:
|
|
238
|
-
return /* @__PURE__ */ g(
|
|
239
|
-
},
|
|
240
|
-
const { texture: n, status:
|
|
241
|
-
return /* @__PURE__ */ g(
|
|
242
|
-
},
|
|
243
|
-
const [t,
|
|
244
|
-
return
|
|
245
|
-
const
|
|
246
|
-
const a = document.documentElement.clientWidth, n = document.documentElement.clientHeight,
|
|
247
|
-
let
|
|
248
|
-
|
|
238
|
+
}, _t = ({ active: e = !0, ...t }) => {
|
|
239
|
+
const { texture: r, status: s, error: a } = pt(e);
|
|
240
|
+
return /* @__PURE__ */ g(Le, { ...t, mask: r, status: s, error: a });
|
|
241
|
+
}, vt = ({ bodyId: e, subject: t, numBodies: r, active: s = !0, ...a }) => {
|
|
242
|
+
const { texture: n, status: o, error: c } = ft({ bodyId: e, subject: t, numBodies: r, active: s });
|
|
243
|
+
return /* @__PURE__ */ g(Le, { ...a, mask: n, status: o, error: c });
|
|
244
|
+
}, zr = ({ bodyId: e, subject: t, numBodies: r, ...s }) => e !== void 0 || t ? /* @__PURE__ */ g(vt, { ...s, bodyId: e, subject: t, numBodies: r }) : /* @__PURE__ */ g(_t, { ...s }), ce = 9, le = 16, qr = ({ children: e }) => {
|
|
245
|
+
const [t, r] = _({ width: 0, height: 0 });
|
|
246
|
+
return x(() => {
|
|
247
|
+
const s = () => {
|
|
248
|
+
const a = document.documentElement.clientWidth, n = document.documentElement.clientHeight, o = a / n, c = ce / le;
|
|
249
|
+
let i, l;
|
|
250
|
+
o > c ? (l = n, i = l * ce / le) : (i = a, l = i * le / ce), r({ width: i, height: l });
|
|
249
251
|
};
|
|
250
|
-
return
|
|
252
|
+
return s(), window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
|
|
251
253
|
}, []), /* @__PURE__ */ g(
|
|
252
254
|
"div",
|
|
253
255
|
{
|
|
@@ -262,34 +264,257 @@ const ms = ({
|
|
|
262
264
|
children: /* @__PURE__ */ g("div", { style: { width: t.width, height: t.height, position: "relative" }, children: e })
|
|
263
265
|
}
|
|
264
266
|
);
|
|
265
|
-
},
|
|
266
|
-
const
|
|
267
|
-
return { x:
|
|
268
|
-
},
|
|
267
|
+
}, Wr = ({ size: e = 0.25, ...t }) => /* @__PURE__ */ g("axesHelper", { args: [e], ...t }), wt = { left: -1, right: 1, top: 1, bottom: -1 }, Dt = (e, t, r) => {
|
|
268
|
+
const s = e % t, a = Math.floor(e / t);
|
|
269
|
+
return { x: s / t, y: (r - 1 - a) / r };
|
|
270
|
+
}, Pt = ({
|
|
269
271
|
sheet: e,
|
|
270
272
|
contentAspect: t,
|
|
271
|
-
renderOrder:
|
|
272
|
-
name:
|
|
273
|
+
renderOrder: r,
|
|
274
|
+
name: s
|
|
273
275
|
}) => {
|
|
274
|
-
const a =
|
|
275
|
-
return
|
|
276
|
-
a.wrapS =
|
|
277
|
-
const
|
|
278
|
-
if (
|
|
279
|
-
|
|
280
|
-
const { x: u, y:
|
|
281
|
-
a.offset.set(u,
|
|
282
|
-
}), /* @__PURE__ */
|
|
276
|
+
const a = Mt(e.url), n = A(0), o = A(-1), c = Et(), [i, l] = t != null ? St(c, t) : [1, 1];
|
|
277
|
+
return Pe((p, d) => {
|
|
278
|
+
a.wrapS = Ee, a.wrapT = Ee, a.magFilter = be, a.minFilter = be, a.generateMipmaps = !1, a.repeat.set(1 / e.cols, 1 / e.rows), n.current += d;
|
|
279
|
+
const f = Math.floor(n.current * e.fps) % e.frames;
|
|
280
|
+
if (f === o.current) return;
|
|
281
|
+
o.current = f;
|
|
282
|
+
const { x: u, y: m } = Dt(f, e.cols, e.rows);
|
|
283
|
+
a.offset.set(u, m);
|
|
284
|
+
}), /* @__PURE__ */ O("mesh", { name: s, renderOrder: r, scale: [i, l, 1], children: [
|
|
283
285
|
/* @__PURE__ */ g("planeGeometry", { args: [1, 1] }),
|
|
284
286
|
/* @__PURE__ */ g("meshBasicMaterial", { map: a, transparent: !0, toneMapped: !1, depthWrite: !1 })
|
|
285
287
|
] });
|
|
286
|
-
},
|
|
288
|
+
}, Br = ({
|
|
287
289
|
sheet: e,
|
|
288
|
-
anchors: t =
|
|
289
|
-
contentAspect:
|
|
290
|
-
renderOrder:
|
|
290
|
+
anchors: t = wt,
|
|
291
|
+
contentAspect: r,
|
|
292
|
+
renderOrder: s = 10,
|
|
291
293
|
name: a = "spriteAnimation"
|
|
292
|
-
}) => /* @__PURE__ */ g(
|
|
294
|
+
}) => /* @__PURE__ */ g(et, { fallback: null, children: /* @__PURE__ */ g(Qe, { anchors: t, children: /* @__PURE__ */ g(Pt, { sheet: e, contentAspect: r, renderOrder: s, name: a }) }) }), Ut = 64, Nt = 3, Lt = /^[A-Za-z][A-Za-z0-9]{0,39}$/, It = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, Ot = /^(?:rgb|rgba|hsl|hsla)\([0-9a-z.,%\s/+-]{1,60}\)$/i, Gt = /^-?[0-9]{1,4}(?:\.[0-9]{1,4})?(?:px|em|rem|%)?$/, zt = /^[A-Za-z0-9 ,'"_-]{1,120}$/;
|
|
295
|
+
function qt(e) {
|
|
296
|
+
return It.test(e) || Ot.test(e) || Gt.test(e) || zt.test(e);
|
|
297
|
+
}
|
|
298
|
+
const Ae = (e) => e.map((t) => t.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`)).join("-");
|
|
299
|
+
function Wt(e) {
|
|
300
|
+
const t = {};
|
|
301
|
+
let r = 0;
|
|
302
|
+
const s = (a, n) => {
|
|
303
|
+
for (const o of Object.keys(a)) {
|
|
304
|
+
if (r >= Ut) return;
|
|
305
|
+
if (!Lt.test(o)) continue;
|
|
306
|
+
const c = a[o], i = [...n, o];
|
|
307
|
+
typeof c == "number" ? Number.isFinite(c) && (t[`--vincentt-${Ae(i)}`] = String(c), r++) : typeof c == "string" ? qt(c) && (t[`--vincentt-${Ae(i)}`] = c, r++) : c && typeof c == "object" && !Array.isArray(c) && i.length < Nt && s(c, i);
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
return e && typeof e == "object" && s(e, []), t;
|
|
311
|
+
}
|
|
312
|
+
function $r({ theme: e, className: t, children: r }) {
|
|
313
|
+
const s = { display: "contents", ...Wt(e) };
|
|
314
|
+
return /* @__PURE__ */ g("div", { className: t, style: s, children: r });
|
|
315
|
+
}
|
|
316
|
+
const ue = (e, t) => ({
|
|
317
|
+
x: (t == null ? void 0 : t.x) ?? e.x,
|
|
318
|
+
y: (t == null ? void 0 : t.y) ?? e.y,
|
|
319
|
+
z: (t == null ? void 0 : t.z) ?? e.z
|
|
320
|
+
});
|
|
321
|
+
function Xr({
|
|
322
|
+
src: e,
|
|
323
|
+
position: t,
|
|
324
|
+
rotation: r,
|
|
325
|
+
scale: s,
|
|
326
|
+
visible: a = !0,
|
|
327
|
+
material: n,
|
|
328
|
+
// `name` and `locked` are editor metadata; neither changes rendering.
|
|
329
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
330
|
+
name: o,
|
|
331
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
332
|
+
locked: c
|
|
333
|
+
}) {
|
|
334
|
+
const [i, l, p] = [t == null ? void 0 : t.x, t == null ? void 0 : t.y, t == null ? void 0 : t.z], [d, f, u] = [r == null ? void 0 : r.x, r == null ? void 0 : r.y, r == null ? void 0 : r.z], [m, S, T] = [s == null ? void 0 : s.x, s == null ? void 0 : s.y, s == null ? void 0 : s.z], h = z(
|
|
335
|
+
() => ({
|
|
336
|
+
...K,
|
|
337
|
+
position: ue(K.position, { x: i, y: l, z: p }),
|
|
338
|
+
rotation: ue(K.rotation, { x: d, y: f, z: u }),
|
|
339
|
+
scale: ue(K.scale, { x: m, y: S, z: T }),
|
|
340
|
+
visible: a
|
|
341
|
+
}),
|
|
342
|
+
[i, l, p, d, f, u, m, S, T, a]
|
|
343
|
+
), y = z(
|
|
344
|
+
() => ({
|
|
345
|
+
...Re,
|
|
346
|
+
assetUrl: e,
|
|
347
|
+
material: { ...Re.material, ...n }
|
|
348
|
+
}),
|
|
349
|
+
[e, n]
|
|
350
|
+
);
|
|
351
|
+
return /* @__PURE__ */ g(bt, { value: h, children: /* @__PURE__ */ g(Rt, { value: y }) });
|
|
352
|
+
}
|
|
353
|
+
const Bt = (e) => Array.isArray(e) ? e : [e], $t = (e) => {
|
|
354
|
+
const [t, r] = _(null);
|
|
355
|
+
return x(() => {
|
|
356
|
+
if (!e) return;
|
|
357
|
+
let s = !0, a = null;
|
|
358
|
+
return new de.TextureLoader().load(
|
|
359
|
+
e,
|
|
360
|
+
(n) => {
|
|
361
|
+
if (a = n, !s) {
|
|
362
|
+
n.dispose();
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
n.colorSpace = de.SRGBColorSpace, n.flipY = !1, r({ url: e, texture: n });
|
|
366
|
+
},
|
|
367
|
+
void 0,
|
|
368
|
+
() => console.warn(`${Xe.loggerPrefix} Object3D could not load ${e}`)
|
|
369
|
+
), () => {
|
|
370
|
+
s = !1, a == null || a.dispose();
|
|
371
|
+
};
|
|
372
|
+
}, [e]), e && (t == null ? void 0 : t.url) === e ? t.texture : null;
|
|
373
|
+
};
|
|
374
|
+
function Hr({
|
|
375
|
+
colour: e,
|
|
376
|
+
texture: t,
|
|
377
|
+
size: r = 1,
|
|
378
|
+
visible: s = !0,
|
|
379
|
+
children: a,
|
|
380
|
+
// `name` and `locked` are editor metadata; neither changes rendering.
|
|
381
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
382
|
+
name: n,
|
|
383
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
384
|
+
locked: o
|
|
385
|
+
}) {
|
|
386
|
+
const c = A(null), i = A(/* @__PURE__ */ new Map()), l = $t(t), p = e !== void 0 || l !== null, d = () => {
|
|
387
|
+
for (const [f, { original: u, own: m }] of i.current)
|
|
388
|
+
f.material = u, m.forEach((S) => S.dispose());
|
|
389
|
+
i.current.clear();
|
|
390
|
+
};
|
|
391
|
+
return Pe(() => {
|
|
392
|
+
!p || !c.current || c.current.traverse((f) => {
|
|
393
|
+
const u = f;
|
|
394
|
+
if (!u.isMesh || i.current.has(u)) return;
|
|
395
|
+
const m = u.material, S = Bt(m).map((T) => {
|
|
396
|
+
var y;
|
|
397
|
+
const h = T.clone();
|
|
398
|
+
return e !== void 0 && ((y = h.color) == null || y.set(e)), l && (h.map = l, h.needsUpdate = !0), h;
|
|
399
|
+
});
|
|
400
|
+
u.material = Array.isArray(m) ? S : S[0], i.current.set(u, { original: m, own: S });
|
|
401
|
+
});
|
|
402
|
+
}), x(() => (d(), d), [e, l]), /* @__PURE__ */ g("group", { ref: c, visible: s, scale: r, children: a });
|
|
403
|
+
}
|
|
404
|
+
function Kr({
|
|
405
|
+
className: e,
|
|
406
|
+
children: t,
|
|
407
|
+
// `name` and `locked` are editor metadata; neither changes rendering.
|
|
408
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
409
|
+
name: r,
|
|
410
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
411
|
+
locked: s
|
|
412
|
+
}) {
|
|
413
|
+
return /* @__PURE__ */ g("div", { className: e, children: t });
|
|
414
|
+
}
|
|
415
|
+
const Xt = 2048;
|
|
416
|
+
function Ht(e) {
|
|
417
|
+
return e <= 32 || e >= 127 && e <= 160 || e === 173 || e === 92 || e === 1564 || e === 6158 || e >= 8192 && e <= 8207 || e >= 8232 && e <= 8238 || e >= 8288 && e <= 8303 || e === 12288 || e === 65279 || e >= 917504 && e <= 917631;
|
|
418
|
+
}
|
|
419
|
+
function Kt(e) {
|
|
420
|
+
if (typeof e != "string" || e.length === 0 || e.length > Xt) return;
|
|
421
|
+
for (const s of e)
|
|
422
|
+
if (Ht(s.codePointAt(0) ?? 0)) return;
|
|
423
|
+
const t = e.toLowerCase();
|
|
424
|
+
return t.startsWith("https://") || t.startsWith("http://") || t.startsWith("mailto:") || t.startsWith("#") || t.startsWith("/") && !t.startsWith("//") ? e : void 0;
|
|
425
|
+
}
|
|
426
|
+
const Fe = {
|
|
427
|
+
display: "inline-block",
|
|
428
|
+
padding: "0.6em 1.2em",
|
|
429
|
+
border: "none",
|
|
430
|
+
borderRadius: "var(--vincentt-radius, 0.5em)",
|
|
431
|
+
background: "var(--vincentt-button, #111827)",
|
|
432
|
+
color: "var(--vincentt-button-text, #ffffff)",
|
|
433
|
+
font: "inherit",
|
|
434
|
+
textDecoration: "none",
|
|
435
|
+
cursor: "pointer"
|
|
436
|
+
};
|
|
437
|
+
function jr({
|
|
438
|
+
label: e,
|
|
439
|
+
link: t,
|
|
440
|
+
onTap: r,
|
|
441
|
+
color: s,
|
|
442
|
+
visible: a = !0,
|
|
443
|
+
className: n,
|
|
444
|
+
children: o,
|
|
445
|
+
// `name` and `locked` are editor metadata; neither changes rendering.
|
|
446
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
447
|
+
name: c,
|
|
448
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
449
|
+
locked: i
|
|
450
|
+
}) {
|
|
451
|
+
if (!a) return null;
|
|
452
|
+
const l = s ? { ...Fe, background: s } : Fe, p = Kt(t), d = o ?? e;
|
|
453
|
+
if (p) {
|
|
454
|
+
const f = /^https?:/i.test(p);
|
|
455
|
+
return /* @__PURE__ */ g(
|
|
456
|
+
"a",
|
|
457
|
+
{
|
|
458
|
+
href: p,
|
|
459
|
+
className: n,
|
|
460
|
+
style: l,
|
|
461
|
+
onClick: r,
|
|
462
|
+
...f ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
463
|
+
children: d
|
|
464
|
+
}
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
return /* @__PURE__ */ g("button", { type: "button", className: n, style: l, onClick: r, children: d });
|
|
468
|
+
}
|
|
469
|
+
const Ce = (e, t) => ({
|
|
470
|
+
x: (t == null ? void 0 : t.x) ?? e.x,
|
|
471
|
+
y: (t == null ? void 0 : t.y) ?? e.y,
|
|
472
|
+
z: (t == null ? void 0 : t.z) ?? e.z
|
|
473
|
+
});
|
|
474
|
+
function Vr({
|
|
475
|
+
type: e = L.type,
|
|
476
|
+
color: t = L.color,
|
|
477
|
+
intensity: r = L.intensity,
|
|
478
|
+
enabled: s = L.enabled,
|
|
479
|
+
castShadow: a = !1,
|
|
480
|
+
distance: n = L.distance,
|
|
481
|
+
decay: o = L.decay,
|
|
482
|
+
angle: c = L.angle,
|
|
483
|
+
penumbra: i = L.penumbra,
|
|
484
|
+
position: l,
|
|
485
|
+
rotation: p,
|
|
486
|
+
showHelper: d = L.showHelper,
|
|
487
|
+
// `name` and `locked` are editor metadata; neither changes rendering.
|
|
488
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
489
|
+
name: f,
|
|
490
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
491
|
+
locked: u
|
|
492
|
+
}) {
|
|
493
|
+
const [m, S, T] = [l == null ? void 0 : l.x, l == null ? void 0 : l.y, l == null ? void 0 : l.z], [h, y, E] = [p == null ? void 0 : p.x, p == null ? void 0 : p.y, p == null ? void 0 : p.z], q = z(
|
|
494
|
+
() => ({
|
|
495
|
+
...K,
|
|
496
|
+
position: Ce(K.position, { x: m, y: S, z: T }),
|
|
497
|
+
rotation: Ce(K.rotation, { x: h, y, z: E })
|
|
498
|
+
}),
|
|
499
|
+
[m, S, T, h, y, E]
|
|
500
|
+
), b = z(
|
|
501
|
+
() => ({
|
|
502
|
+
enabled: s,
|
|
503
|
+
type: e,
|
|
504
|
+
color: t,
|
|
505
|
+
intensity: r,
|
|
506
|
+
castShadow: a,
|
|
507
|
+
distance: n,
|
|
508
|
+
angle: c,
|
|
509
|
+
penumbra: i,
|
|
510
|
+
decay: o,
|
|
511
|
+
showHelper: d
|
|
512
|
+
}),
|
|
513
|
+
[s, e, t, r, a, n, c, i, o, d]
|
|
514
|
+
);
|
|
515
|
+
return /* @__PURE__ */ g(Tt, { settings: b, transform: q });
|
|
516
|
+
}
|
|
517
|
+
const B = (e) => {
|
|
293
518
|
switch (e) {
|
|
294
519
|
case "start":
|
|
295
520
|
return "starting";
|
|
@@ -307,207 +532,207 @@ const ms = ({
|
|
|
307
532
|
case "clear":
|
|
308
533
|
return "idle";
|
|
309
534
|
}
|
|
310
|
-
},
|
|
535
|
+
}, jt = [
|
|
311
536
|
"video/mp4",
|
|
312
537
|
"video/webm;codecs=vp9",
|
|
313
538
|
"video/webm;codecs=vp8",
|
|
314
539
|
"video/webm"
|
|
315
540
|
];
|
|
316
|
-
function
|
|
541
|
+
function Zr(e = {}) {
|
|
317
542
|
const {
|
|
318
543
|
audio: t = !1,
|
|
319
|
-
mimeType:
|
|
320
|
-
bitsPerSecond:
|
|
544
|
+
mimeType: r,
|
|
545
|
+
bitsPerSecond: s,
|
|
321
546
|
onData: a,
|
|
322
547
|
onStop: n,
|
|
323
|
-
onRecordingStart:
|
|
548
|
+
onRecordingStart: o,
|
|
324
549
|
onRecordingPause: c,
|
|
325
|
-
onRecordingResume:
|
|
550
|
+
onRecordingResume: i,
|
|
326
551
|
onRecordingStop: l,
|
|
327
|
-
onRecordingComplete:
|
|
552
|
+
onRecordingComplete: p,
|
|
328
553
|
onError: d,
|
|
329
|
-
passThroughStream:
|
|
330
|
-
} = e, u =
|
|
554
|
+
passThroughStream: f
|
|
555
|
+
} = e, u = A(null), m = A(null), S = A([]), [T, h] = _("idle"), [y, E] = _(null), [q, b] = _(null), w = F(() => {
|
|
331
556
|
var C;
|
|
332
|
-
const
|
|
333
|
-
for (const
|
|
334
|
-
if ((C = MediaRecorder.isTypeSupported) != null && C.call(MediaRecorder,
|
|
335
|
-
}, [
|
|
336
|
-
async (
|
|
557
|
+
const M = [r, ...jt].filter(Boolean);
|
|
558
|
+
for (const R of M)
|
|
559
|
+
if ((C = MediaRecorder.isTypeSupported) != null && C.call(MediaRecorder, R)) return R;
|
|
560
|
+
}, [r]), W = F(
|
|
561
|
+
async (M) => {
|
|
337
562
|
const C = new MediaStream();
|
|
338
|
-
if (
|
|
339
|
-
let
|
|
563
|
+
if (M.getTracks().forEach((R) => C.addTrack(R)), t) {
|
|
564
|
+
let R;
|
|
340
565
|
if (t instanceof MediaStream)
|
|
341
|
-
|
|
566
|
+
R = t;
|
|
342
567
|
else {
|
|
343
|
-
const
|
|
344
|
-
|
|
568
|
+
const v = typeof t == "object" ? { audio: t } : { audio: !0, video: !1 };
|
|
569
|
+
R = await navigator.mediaDevices.getUserMedia(v);
|
|
345
570
|
}
|
|
346
|
-
|
|
571
|
+
R.getAudioTracks().forEach((v) => C.addTrack(v));
|
|
347
572
|
}
|
|
348
573
|
if (!C.getTracks().length)
|
|
349
574
|
throw new Error("No tracks available in combined stream.");
|
|
350
|
-
return
|
|
575
|
+
return m.current = C, C;
|
|
351
576
|
},
|
|
352
577
|
[t]
|
|
353
|
-
),
|
|
354
|
-
async (
|
|
355
|
-
|
|
578
|
+
), Q = F(
|
|
579
|
+
async (M, C) => {
|
|
580
|
+
h(B("start")), b(null), E(null);
|
|
356
581
|
try {
|
|
357
|
-
let
|
|
358
|
-
if (
|
|
359
|
-
|
|
582
|
+
let R;
|
|
583
|
+
if (f)
|
|
584
|
+
R = f, m.current = R;
|
|
360
585
|
else {
|
|
361
|
-
if (!
|
|
362
|
-
|
|
586
|
+
if (!M) throw new Error("start(stream) requires a MediaStream.");
|
|
587
|
+
R = await W(M);
|
|
363
588
|
}
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
var
|
|
369
|
-
((
|
|
370
|
-
},
|
|
371
|
-
const N = new Blob(
|
|
372
|
-
type:
|
|
589
|
+
const v = w(), j = {};
|
|
590
|
+
v && (j.mimeType = v), s && (j.bitsPerSecond = s);
|
|
591
|
+
const H = new MediaRecorder(R, j);
|
|
592
|
+
H.ondataavailable = (N) => {
|
|
593
|
+
var Z;
|
|
594
|
+
((Z = N.data) == null ? void 0 : Z.size) > 0 && (S.current.push(N.data), a == null || a(N.data));
|
|
595
|
+
}, H.onstop = () => {
|
|
596
|
+
const N = new Blob(S.current, {
|
|
597
|
+
type: v ?? "video/webm"
|
|
373
598
|
});
|
|
374
|
-
|
|
375
|
-
}, u.current =
|
|
376
|
-
} catch (
|
|
377
|
-
const
|
|
378
|
-
console.error("start(stream) failed",
|
|
599
|
+
E(N), n == null || n(N), p == null || p(N), S.current = [], h(B("complete"));
|
|
600
|
+
}, u.current = H, H.start(C), h(B("started")), o == null || o();
|
|
601
|
+
} catch (R) {
|
|
602
|
+
const v = R instanceof Error ? R : new Error(String(R));
|
|
603
|
+
console.error("start(stream) failed", v), b(v), h(B("fail")), d == null || d(v);
|
|
379
604
|
}
|
|
380
605
|
},
|
|
381
606
|
[
|
|
382
|
-
|
|
607
|
+
W,
|
|
383
608
|
w,
|
|
384
|
-
|
|
609
|
+
s,
|
|
385
610
|
a,
|
|
386
611
|
n,
|
|
387
|
-
|
|
388
|
-
|
|
612
|
+
p,
|
|
613
|
+
o,
|
|
389
614
|
d,
|
|
390
|
-
|
|
615
|
+
f
|
|
391
616
|
]
|
|
392
|
-
),
|
|
393
|
-
const
|
|
394
|
-
!
|
|
395
|
-
}, [l]),
|
|
396
|
-
const
|
|
397
|
-
(
|
|
398
|
-
}, [c]),
|
|
399
|
-
const
|
|
400
|
-
(
|
|
401
|
-
}, [
|
|
402
|
-
var
|
|
617
|
+
), ee = F(() => {
|
|
618
|
+
const M = u.current;
|
|
619
|
+
!M || M.state === "inactive" || (h(B("stop")), M.stop(), l == null || l());
|
|
620
|
+
}, [l]), te = F(() => {
|
|
621
|
+
const M = u.current;
|
|
622
|
+
(M == null ? void 0 : M.state) === "recording" && (M.pause(), h(B("pause")), c == null || c());
|
|
623
|
+
}, [c]), re = F(() => {
|
|
624
|
+
const M = u.current;
|
|
625
|
+
(M == null ? void 0 : M.state) === "paused" && (M.resume(), h(B("resume")), i == null || i());
|
|
626
|
+
}, [i]), V = F(() => {
|
|
627
|
+
var M;
|
|
403
628
|
try {
|
|
404
|
-
u.current && (u.current.onstop = null, u.current.state !== "inactive" && u.current.stop()), u.current = null, (
|
|
629
|
+
u.current && (u.current.onstop = null, u.current.state !== "inactive" && u.current.stop()), u.current = null, (M = m.current) == null || M.getTracks().forEach((C) => C.stop()), m.current = null, E(null), h(B("clear")), S.current = [], b(null);
|
|
405
630
|
} catch (C) {
|
|
406
631
|
console.error("clear failed", C);
|
|
407
632
|
}
|
|
408
633
|
}, []);
|
|
409
|
-
return
|
|
410
|
-
status:
|
|
411
|
-
start:
|
|
412
|
-
stop:
|
|
413
|
-
pause:
|
|
414
|
-
resume:
|
|
415
|
-
clear:
|
|
416
|
-
isRecording:
|
|
417
|
-
isPaused:
|
|
418
|
-
recordedBlob:
|
|
419
|
-
error:
|
|
420
|
-
getActiveStream: () =>
|
|
634
|
+
return x(() => () => V(), []), {
|
|
635
|
+
status: T,
|
|
636
|
+
start: Q,
|
|
637
|
+
stop: ee,
|
|
638
|
+
pause: te,
|
|
639
|
+
resume: re,
|
|
640
|
+
clear: V,
|
|
641
|
+
isRecording: T === "recording" || T === "paused",
|
|
642
|
+
isPaused: T === "paused",
|
|
643
|
+
recordedBlob: y,
|
|
644
|
+
error: q,
|
|
645
|
+
getActiveStream: () => m.current
|
|
421
646
|
};
|
|
422
647
|
}
|
|
423
|
-
const
|
|
424
|
-
var
|
|
425
|
-
(
|
|
648
|
+
const Vt = async (e, t = {}) => {
|
|
649
|
+
var r, s, a;
|
|
650
|
+
(r = t.onCaptureStart) == null || r.call(t), await Promise.resolve();
|
|
426
651
|
try {
|
|
427
652
|
const n = e();
|
|
428
|
-
return (
|
|
653
|
+
return (s = t.onCaptureComplete) == null || s.call(t, n), n;
|
|
429
654
|
} catch (n) {
|
|
430
|
-
const
|
|
431
|
-
throw (a = t.onError) == null || a.call(t,
|
|
655
|
+
const o = n instanceof Error ? n : new Error(String(n));
|
|
656
|
+
throw (a = t.onError) == null || a.call(t, o), o;
|
|
432
657
|
}
|
|
433
|
-
},
|
|
434
|
-
const { session: t } =
|
|
435
|
-
captureFrame:
|
|
436
|
-
onCaptureStart:
|
|
658
|
+
}, Yr = (e = {}) => {
|
|
659
|
+
const { session: t } = He(), {
|
|
660
|
+
captureFrame: r = t.captureFrame,
|
|
661
|
+
onCaptureStart: s,
|
|
437
662
|
onCaptureComplete: a,
|
|
438
663
|
onError: n
|
|
439
|
-
} = e, [
|
|
664
|
+
} = e, [o, c] = _("idle"), [i, l] = _(null), [p, d] = _(null), f = F(async () => {
|
|
440
665
|
c("capturing"), l(null), d(null);
|
|
441
666
|
try {
|
|
442
|
-
const
|
|
443
|
-
onCaptureStart:
|
|
667
|
+
const m = await Vt(r, {
|
|
668
|
+
onCaptureStart: s,
|
|
444
669
|
onCaptureComplete: a,
|
|
445
670
|
onError: n
|
|
446
671
|
});
|
|
447
|
-
return l(
|
|
448
|
-
} catch (
|
|
449
|
-
const
|
|
450
|
-
return d(
|
|
672
|
+
return l(m), c("completed"), m;
|
|
673
|
+
} catch (m) {
|
|
674
|
+
const S = m instanceof Error ? m : new Error(String(m));
|
|
675
|
+
return d(S), c("error"), null;
|
|
451
676
|
}
|
|
452
|
-
}, [
|
|
677
|
+
}, [r, s, a, n]), u = F(() => {
|
|
453
678
|
c("idle"), l(null), d(null);
|
|
454
679
|
}, []);
|
|
455
|
-
return { status:
|
|
456
|
-
},
|
|
457
|
-
const
|
|
458
|
-
let
|
|
459
|
-
const c = new Uint8Array(
|
|
460
|
-
for (;
|
|
461
|
-
c[
|
|
680
|
+
return { status: o, capturePhoto: f, clear: u, dataUrl: i, error: p };
|
|
681
|
+
}, Jr = (e, t) => {
|
|
682
|
+
const r = e.split(","), s = r[0].match(/:(.*?);/), a = s ? s[1] : "application/octet-stream", n = atob(r[r.length - 1]);
|
|
683
|
+
let o = n.length;
|
|
684
|
+
const c = new Uint8Array(o);
|
|
685
|
+
for (; o--; )
|
|
686
|
+
c[o] = n.charCodeAt(o);
|
|
462
687
|
return new File([c], t, { type: a });
|
|
463
|
-
},
|
|
688
|
+
}, Zt = 4, Yt = 50, Jt = 5e3, ae = (e) => Math.min(1, Math.max(0, e)), xe = (e) => new Promise((t) => {
|
|
464
689
|
if (e.readyState >= 4) {
|
|
465
690
|
t();
|
|
466
691
|
return;
|
|
467
692
|
}
|
|
468
|
-
let
|
|
469
|
-
const
|
|
470
|
-
|
|
693
|
+
let r = !1;
|
|
694
|
+
const s = () => {
|
|
695
|
+
r || (r = !0, t());
|
|
471
696
|
};
|
|
472
|
-
e.addEventListener("canplaythrough",
|
|
473
|
-
}),
|
|
474
|
-
const
|
|
475
|
-
return
|
|
476
|
-
},
|
|
697
|
+
e.addEventListener("canplaythrough", s, { once: !0 }), e.addEventListener("error", s, { once: !0 }), setTimeout(s, Jt);
|
|
698
|
+
}), ke = (e, t) => {
|
|
699
|
+
const r = document.createElement("audio");
|
|
700
|
+
return r.src = e, r.loop = t, r.preload = "auto", r.setAttribute("playsinline", ""), r.setAttribute("webkit-playsinline", ""), r.load(), r;
|
|
701
|
+
}, Qt = (e) => {
|
|
477
702
|
e.muted = !0, e.play().then(() => {
|
|
478
703
|
e.pause(), e.currentTime = 0, e.muted = !1;
|
|
479
704
|
}).catch(() => {
|
|
480
705
|
e.muted = !1;
|
|
481
706
|
});
|
|
482
707
|
};
|
|
483
|
-
class
|
|
708
|
+
class er {
|
|
484
709
|
constructor(t = {}) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
710
|
+
D(this, "sfxPoolSize");
|
|
711
|
+
D(this, "coalesceMs");
|
|
712
|
+
D(this, "muted", !0);
|
|
713
|
+
D(this, "listeners", /* @__PURE__ */ new Set());
|
|
714
|
+
D(this, "music", null);
|
|
715
|
+
D(this, "musicUrl", null);
|
|
716
|
+
D(this, "musicReady", null);
|
|
717
|
+
D(this, "musicWanted", null);
|
|
718
|
+
D(this, "pools", /* @__PURE__ */ new Map());
|
|
494
719
|
/** Last play time per SFX URL, for the coalesce window. */
|
|
495
|
-
|
|
720
|
+
D(this, "lastPlayed", /* @__PURE__ */ new Map());
|
|
496
721
|
/** Readiness promises so a loading gate can await decode/buffer. */
|
|
497
|
-
|
|
498
|
-
this.sfxPoolSize = t.sfxPoolSize ??
|
|
722
|
+
D(this, "ready", /* @__PURE__ */ new Map());
|
|
723
|
+
this.sfxPoolSize = t.sfxPoolSize ?? Zt, this.coalesceMs = t.coalesceMs ?? Yt;
|
|
499
724
|
}
|
|
500
725
|
/**
|
|
501
726
|
* Create + buffer the looping music element. Await in the loading gate so the
|
|
502
727
|
* unmute tap is instant. Idempotent per URL (re-requesting the same track is
|
|
503
728
|
* a no-op that returns the in-flight promise).
|
|
504
729
|
*/
|
|
505
|
-
prefetchMusic(t,
|
|
506
|
-
const
|
|
507
|
-
if (this.musicWanted = { url: t, volume:
|
|
508
|
-
return this.music && (this.music.volume =
|
|
509
|
-
this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music =
|
|
510
|
-
const a =
|
|
730
|
+
prefetchMusic(t, r = 0.4) {
|
|
731
|
+
const s = ae(r);
|
|
732
|
+
if (this.musicWanted = { url: t, volume: s }, this.musicUrl === t && this.musicReady)
|
|
733
|
+
return this.music && (this.music.volume = s), this.musicReady;
|
|
734
|
+
this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music = ke(t, !0), this.musicUrl = t, this.music.volume = s;
|
|
735
|
+
const a = xe(this.music);
|
|
511
736
|
return this.musicReady = a, a;
|
|
512
737
|
}
|
|
513
738
|
/**
|
|
@@ -515,19 +740,19 @@ class _t {
|
|
|
515
740
|
* cut each other off). Returns a promise that resolves when the first element
|
|
516
741
|
* buffers. Idempotent per URL.
|
|
517
742
|
*/
|
|
518
|
-
registerSound(t,
|
|
519
|
-
const
|
|
520
|
-
if (
|
|
521
|
-
const a =
|
|
743
|
+
registerSound(t, r = 1) {
|
|
744
|
+
const s = this.ready.get(t);
|
|
745
|
+
if (s) return s;
|
|
746
|
+
const a = ae(r), n = [];
|
|
522
747
|
for (let c = 0; c < this.sfxPoolSize; c += 1) {
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}), n.push(
|
|
748
|
+
const i = ke(t, !1);
|
|
749
|
+
i.volume = a, i.addEventListener("ended", () => {
|
|
750
|
+
i.currentTime = 0;
|
|
751
|
+
}), n.push(i);
|
|
527
752
|
}
|
|
528
753
|
this.pools.set(t, { els: n, next: 0, volume: a });
|
|
529
|
-
const
|
|
530
|
-
return this.ready.set(t,
|
|
754
|
+
const o = xe(n[0]);
|
|
755
|
+
return this.ready.set(t, o), o;
|
|
531
756
|
}
|
|
532
757
|
/** Subscribe to mute-state changes (for a toggle UI). Fires immediately with
|
|
533
758
|
* the current state. Returns an unsubscribe. */
|
|
@@ -544,7 +769,7 @@ class _t {
|
|
|
544
769
|
* then start the music. All elements are already buffered, so this is instant.
|
|
545
770
|
*/
|
|
546
771
|
setMuted(t) {
|
|
547
|
-
t !== this.muted && (this.muted = t, this.muted || this.pools.forEach((
|
|
772
|
+
t !== this.muted && (this.muted = t, this.muted || this.pools.forEach((r) => r.els.forEach(Qt)), this.applyMusic(), this.listeners.forEach((r) => r(this.muted)));
|
|
548
773
|
}
|
|
549
774
|
toggleMuted() {
|
|
550
775
|
this.setMuted(!this.muted);
|
|
@@ -555,30 +780,30 @@ class _t {
|
|
|
555
780
|
* same sound into one play, and does NO synchronous `currentTime` seek on a
|
|
556
781
|
* ready element (the pool rewinds on `ended`, off the hot path).
|
|
557
782
|
*/
|
|
558
|
-
playOneShot(t,
|
|
783
|
+
playOneShot(t, r) {
|
|
559
784
|
if (this.muted) return;
|
|
560
|
-
const
|
|
561
|
-
if (!
|
|
785
|
+
const s = this.pools.get(t);
|
|
786
|
+
if (!s) return;
|
|
562
787
|
const a = performance.now();
|
|
563
788
|
if (a - (this.lastPlayed.get(t) ?? -1 / 0) < this.coalesceMs) return;
|
|
564
789
|
this.lastPlayed.set(t, a);
|
|
565
|
-
const n =
|
|
566
|
-
let
|
|
790
|
+
const n = s.els.length;
|
|
791
|
+
let o;
|
|
567
792
|
for (let c = 0; c < n; c += 1) {
|
|
568
|
-
const
|
|
569
|
-
if (
|
|
570
|
-
|
|
793
|
+
const i = s.els[(s.next + c) % n];
|
|
794
|
+
if (i.paused) {
|
|
795
|
+
o = i, s.next = (s.next + c + 1) % n;
|
|
571
796
|
break;
|
|
572
797
|
}
|
|
573
798
|
}
|
|
574
|
-
|
|
799
|
+
o || (o = s.els[s.next], s.next = (s.next + 1) % n), o.muted = !1, o.volume = ae(r ?? s.volume), o.currentTime !== 0 && (o.currentTime = 0), o.play().catch(() => {
|
|
575
800
|
});
|
|
576
801
|
}
|
|
577
802
|
/** Request the looping background track (buffer it with prefetchMusic, which
|
|
578
803
|
* a loading gate awaits). Remembered while muted; starts on unmute. */
|
|
579
|
-
startMusic(t,
|
|
580
|
-
const
|
|
581
|
-
this.musicUrl !== t && this.prefetchMusic(t,
|
|
804
|
+
startMusic(t, r = 0.4) {
|
|
805
|
+
const s = ae(r);
|
|
806
|
+
this.musicUrl !== t && this.prefetchMusic(t, s), this.musicWanted = { url: t, volume: s }, this.applyMusic();
|
|
582
807
|
}
|
|
583
808
|
stopMusic() {
|
|
584
809
|
this.musicWanted = null, this.music && (this.music.pause(), this.music.currentTime = 0);
|
|
@@ -588,70 +813,70 @@ class _t {
|
|
|
588
813
|
}), this.muted && !this.music.paused && this.music.pause());
|
|
589
814
|
}
|
|
590
815
|
}
|
|
591
|
-
const
|
|
816
|
+
const tr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math.floor(r)) ? "replay" : "ended", rr = (e, t, r) => e && t !== r, sr = (e) => Math.min(100, Math.max(0, e)) / 100, Qr = tt(function({
|
|
592
817
|
src: t,
|
|
593
|
-
playMode:
|
|
594
|
-
loopCount:
|
|
818
|
+
playMode: r = "once",
|
|
819
|
+
loopCount: s = 1,
|
|
595
820
|
autoplay: a = !1,
|
|
596
821
|
muted: n = !1,
|
|
597
|
-
volume:
|
|
822
|
+
volume: o = 100,
|
|
598
823
|
preload: c = "auto",
|
|
599
|
-
onReady:
|
|
824
|
+
onReady: i,
|
|
600
825
|
onPlay: l,
|
|
601
|
-
onPause:
|
|
826
|
+
onPause: p,
|
|
602
827
|
onEnded: d,
|
|
603
|
-
onError:
|
|
828
|
+
onError: f
|
|
604
829
|
}, u) {
|
|
605
|
-
const
|
|
606
|
-
const
|
|
607
|
-
if (
|
|
830
|
+
const m = A(null), S = A(0), T = A(null), h = F(async () => {
|
|
831
|
+
const b = m.current;
|
|
832
|
+
if (b)
|
|
608
833
|
try {
|
|
609
|
-
await
|
|
834
|
+
await b.play();
|
|
610
835
|
} catch (w) {
|
|
611
|
-
const
|
|
612
|
-
throw
|
|
836
|
+
const W = w instanceof Error ? w : new Error(String(w));
|
|
837
|
+
throw f == null || f(W), W;
|
|
613
838
|
}
|
|
614
|
-
}, [
|
|
615
|
-
var
|
|
616
|
-
return (
|
|
617
|
-
}, []),
|
|
618
|
-
const
|
|
619
|
-
|
|
839
|
+
}, [f]), y = F(() => {
|
|
840
|
+
var b;
|
|
841
|
+
return (b = m.current) == null ? void 0 : b.pause();
|
|
842
|
+
}, []), E = F(() => {
|
|
843
|
+
const b = m.current;
|
|
844
|
+
b && (b.pause(), b.currentTime = 0, S.current = 0);
|
|
620
845
|
}, []);
|
|
621
|
-
|
|
846
|
+
rt(
|
|
622
847
|
u,
|
|
623
848
|
() => ({
|
|
624
|
-
play:
|
|
625
|
-
pause:
|
|
626
|
-
stop:
|
|
849
|
+
play: h,
|
|
850
|
+
pause: y,
|
|
851
|
+
stop: E,
|
|
627
852
|
get current() {
|
|
628
|
-
return
|
|
853
|
+
return m.current;
|
|
629
854
|
}
|
|
630
855
|
}),
|
|
631
|
-
[
|
|
632
|
-
),
|
|
633
|
-
|
|
634
|
-
}, [t]),
|
|
635
|
-
|
|
636
|
-
}, [
|
|
637
|
-
|
|
856
|
+
[y, h, E]
|
|
857
|
+
), x(() => {
|
|
858
|
+
S.current = 0, T.current = null;
|
|
859
|
+
}, [t]), x(() => {
|
|
860
|
+
m.current && (m.current.volume = sr(o));
|
|
861
|
+
}, [o]), x(() => {
|
|
862
|
+
rr(a, T.current, t) && (T.current = t, h().catch(() => {
|
|
638
863
|
}));
|
|
639
864
|
}, [a, t]);
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
const
|
|
643
|
-
if (
|
|
644
|
-
const w =
|
|
645
|
-
w && (w.currentTime = 0,
|
|
865
|
+
const q = F(() => {
|
|
866
|
+
S.current += 1;
|
|
867
|
+
const b = Math.max(1, Math.floor(s));
|
|
868
|
+
if (tr(r, S.current, b) === "replay") {
|
|
869
|
+
const w = m.current;
|
|
870
|
+
w && (w.currentTime = 0, h().catch(() => {
|
|
646
871
|
}));
|
|
647
872
|
return;
|
|
648
873
|
}
|
|
649
|
-
|
|
650
|
-
}, [
|
|
874
|
+
S.current = 0, d == null || d();
|
|
875
|
+
}, [s, d, h, r]);
|
|
651
876
|
return /* @__PURE__ */ g(
|
|
652
877
|
"audio",
|
|
653
878
|
{
|
|
654
|
-
ref:
|
|
879
|
+
ref: m,
|
|
655
880
|
src: t,
|
|
656
881
|
preload: c,
|
|
657
882
|
autoPlay: !1,
|
|
@@ -659,58 +884,58 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
|
|
|
659
884
|
loop: !1,
|
|
660
885
|
playsInline: !0,
|
|
661
886
|
style: { display: "none" },
|
|
662
|
-
onCanPlayThrough:
|
|
887
|
+
onCanPlayThrough: i,
|
|
663
888
|
onPlay: l,
|
|
664
|
-
onPause:
|
|
665
|
-
onEnded:
|
|
666
|
-
onError: () =>
|
|
889
|
+
onPause: p,
|
|
890
|
+
onEnded: q,
|
|
891
|
+
onError: () => f == null ? void 0 : f(new Error(`Unable to load audio: ${t}`))
|
|
667
892
|
}
|
|
668
893
|
);
|
|
669
|
-
}), U = new
|
|
670
|
-
const [e, t] =
|
|
671
|
-
return
|
|
672
|
-
},
|
|
673
|
-
const { auto: t = !1 } = e,
|
|
674
|
-
|
|
675
|
-
const [a, n] =
|
|
676
|
-
const d = ++
|
|
677
|
-
if (d !==
|
|
678
|
-
const u =
|
|
679
|
-
return n((
|
|
680
|
-
}, []),
|
|
894
|
+
}), U = new er(), es = (e, t) => U.prefetchMusic(e, t), ts = (e, t) => U.registerSound(e, t), rs = (e, t) => U.startMusic(e, t), ss = () => U.stopMusic(), as = (e, t) => U.playOneShot(e, t), ns = (e) => U.setMuted(e), os = () => U.toggleMuted(), is = () => U.isMuted(), cs = (e) => U.onMuteChange(e), ls = () => {
|
|
895
|
+
const [e, t] = _(U.isMuted());
|
|
896
|
+
return x(() => U.onMuteChange(t), []), e;
|
|
897
|
+
}, ar = (e = {}) => {
|
|
898
|
+
const { auto: t = !1 } = e, r = A(e.env ?? Ke()), s = A(e.constraints);
|
|
899
|
+
s.current = e.constraints;
|
|
900
|
+
const [a, n] = _("unknown"), [o, c] = _(null), i = A(0), l = F(async () => {
|
|
901
|
+
const d = ++i.current, f = await je(r.current);
|
|
902
|
+
if (d !== i.current) return a;
|
|
903
|
+
const u = f.state === "unknown" ? "unknown" : f.state;
|
|
904
|
+
return n((m) => m === "requesting" ? m : u), u !== "blocked" && c(null), u;
|
|
905
|
+
}, []), p = F(
|
|
681
906
|
async (d) => {
|
|
682
|
-
const
|
|
907
|
+
const f = ++i.current;
|
|
683
908
|
n("requesting"), c(null);
|
|
684
|
-
const u = await
|
|
685
|
-
{ constraints: (d == null ? void 0 : d.constraints) ??
|
|
686
|
-
|
|
909
|
+
const u = await Ve(
|
|
910
|
+
{ constraints: (d == null ? void 0 : d.constraints) ?? s.current, keepStream: !1 },
|
|
911
|
+
r.current
|
|
687
912
|
);
|
|
688
|
-
return
|
|
913
|
+
return f !== i.current || (n(u.state), c(u.reason)), u.state;
|
|
689
914
|
},
|
|
690
915
|
[]
|
|
691
916
|
);
|
|
692
|
-
return
|
|
917
|
+
return x(() => {
|
|
693
918
|
let d = () => {
|
|
694
|
-
},
|
|
695
|
-
return t ?
|
|
696
|
-
|
|
697
|
-
},
|
|
698
|
-
|
|
919
|
+
}, f = !0;
|
|
920
|
+
return t ? p() : l(), Ze((u) => {
|
|
921
|
+
f && (n((m) => m === "requesting" ? m : u.state === "unknown" ? "unknown" : u.state), u.state !== "blocked" && c(null));
|
|
922
|
+
}, r.current).then((u) => {
|
|
923
|
+
f ? d = u : u();
|
|
699
924
|
}), () => {
|
|
700
|
-
|
|
925
|
+
f = !1, i.current += 1, d();
|
|
701
926
|
};
|
|
702
|
-
}, [t, l,
|
|
927
|
+
}, [t, l, p]), z(
|
|
703
928
|
() => ({
|
|
704
929
|
state: a,
|
|
705
|
-
reason:
|
|
706
|
-
canPrompt:
|
|
930
|
+
reason: o,
|
|
931
|
+
canPrompt: Ye(a),
|
|
707
932
|
usable: a === "granted",
|
|
708
|
-
request:
|
|
933
|
+
request: p,
|
|
709
934
|
refresh: l
|
|
710
935
|
}),
|
|
711
|
-
[a,
|
|
936
|
+
[a, o, p, l]
|
|
712
937
|
);
|
|
713
|
-
},
|
|
938
|
+
}, nr = {
|
|
714
939
|
display: "flex",
|
|
715
940
|
flexDirection: "column",
|
|
716
941
|
alignItems: "center",
|
|
@@ -723,7 +948,7 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
|
|
|
723
948
|
background: "#111827",
|
|
724
949
|
color: "#f9fafb",
|
|
725
950
|
fontFamily: "system-ui, sans-serif"
|
|
726
|
-
},
|
|
951
|
+
}, or = {
|
|
727
952
|
font: "inherit",
|
|
728
953
|
padding: "10px 18px",
|
|
729
954
|
borderRadius: 8,
|
|
@@ -731,86 +956,86 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
|
|
|
731
956
|
background: "#2563eb",
|
|
732
957
|
color: "#fff",
|
|
733
958
|
cursor: "pointer"
|
|
734
|
-
},
|
|
959
|
+
}, us = ({
|
|
735
960
|
children: e,
|
|
736
961
|
fallback: t,
|
|
737
|
-
auto:
|
|
738
|
-
constraints:
|
|
962
|
+
auto: r = !1,
|
|
963
|
+
constraints: s,
|
|
739
964
|
requestLabel: a = "Allow camera"
|
|
740
965
|
}) => {
|
|
741
|
-
const n =
|
|
742
|
-
if (n.usable) return /* @__PURE__ */ g(
|
|
743
|
-
if (t) return /* @__PURE__ */ g(
|
|
744
|
-
const { state:
|
|
745
|
-
return /* @__PURE__ */
|
|
746
|
-
/* @__PURE__ */ g("p", { "aria-live": "polite", style: { margin: 0 }, children: (c == null ? void 0 : c.message) ??
|
|
966
|
+
const n = ar({ auto: r, constraints: s });
|
|
967
|
+
if (n.usable) return /* @__PURE__ */ g(ne, { children: e });
|
|
968
|
+
if (t) return /* @__PURE__ */ g(ne, { children: t(n) });
|
|
969
|
+
const { state: o, reason: c, canPrompt: i, request: l } = n;
|
|
970
|
+
return /* @__PURE__ */ O("div", { style: nr, role: "region", "aria-label": "Camera access", children: [
|
|
971
|
+
/* @__PURE__ */ g("p", { "aria-live": "polite", style: { margin: 0 }, children: (c == null ? void 0 : c.message) ?? Je[o] }),
|
|
747
972
|
/* @__PURE__ */ g(
|
|
748
973
|
"button",
|
|
749
974
|
{
|
|
750
975
|
type: "button",
|
|
751
976
|
onClick: () => void l(),
|
|
752
|
-
disabled: !
|
|
753
|
-
"aria-disabled": !
|
|
754
|
-
style: { ...
|
|
755
|
-
children:
|
|
977
|
+
disabled: !i || o === "requesting",
|
|
978
|
+
"aria-disabled": !i || o === "requesting",
|
|
979
|
+
style: { ...or, opacity: i && o !== "requesting" ? 1 : 0.5 },
|
|
980
|
+
children: o === "requesting" ? "Waiting…" : o === "denied" ? "Try again" : a
|
|
756
981
|
}
|
|
757
982
|
)
|
|
758
983
|
] });
|
|
759
|
-
},
|
|
984
|
+
}, ir = () => {
|
|
760
985
|
var e;
|
|
761
986
|
return {
|
|
762
987
|
enumerateDevices: typeof navigator < "u" && ((e = navigator.mediaDevices) != null && e.enumerateDevices) ? () => navigator.mediaDevices.enumerateDevices() : void 0
|
|
763
988
|
};
|
|
764
|
-
},
|
|
989
|
+
}, cr = /\b(back|rear|environment|world)\b/i, lr = /\b(front|user|facetime|selfie)\b/i, ur = (e) => cr.test(e) ? "environment" : lr.test(e) ? "user" : null, ds = async (e = ir()) => {
|
|
765
990
|
if (!e.enumerateDevices) return [];
|
|
766
991
|
try {
|
|
767
|
-
return (await e.enumerateDevices()).filter((
|
|
768
|
-
deviceId:
|
|
769
|
-
label:
|
|
770
|
-
facing:
|
|
992
|
+
return (await e.enumerateDevices()).filter((r) => r.kind === "videoinput").map((r) => ({
|
|
993
|
+
deviceId: r.deviceId,
|
|
994
|
+
label: r.label,
|
|
995
|
+
facing: ur(r.label)
|
|
771
996
|
}));
|
|
772
997
|
} catch {
|
|
773
998
|
return [];
|
|
774
999
|
}
|
|
775
|
-
},
|
|
1000
|
+
}, ms = (e, t) => e.find((r) => r.facing === t) ?? null, Ie = at(null), fs = ({
|
|
776
1001
|
cache: e,
|
|
777
1002
|
disposeUnreferencedOnUnmount: t = !0,
|
|
778
|
-
children:
|
|
1003
|
+
children: r
|
|
779
1004
|
}) => {
|
|
780
|
-
const
|
|
781
|
-
return
|
|
782
|
-
t &&
|
|
783
|
-
}, [
|
|
784
|
-
},
|
|
785
|
-
const { enabled:
|
|
1005
|
+
const s = e ?? Ne();
|
|
1006
|
+
return x(() => () => {
|
|
1007
|
+
t && s.disposeUnreferenced();
|
|
1008
|
+
}, [s, t]), /* @__PURE__ */ g(Ie.Provider, { value: s, children: r });
|
|
1009
|
+
}, Oe = () => st(Ie) ?? Ne(), ps = (e, t = {}) => {
|
|
1010
|
+
const { enabled: r = !0 } = t, s = Oe(), a = nt(), n = (e == null ? void 0 : e.key) ?? null, [o, c] = _({
|
|
786
1011
|
value: null,
|
|
787
1012
|
status: "idle",
|
|
788
1013
|
error: null
|
|
789
1014
|
});
|
|
790
|
-
return
|
|
791
|
-
if (!e || !
|
|
1015
|
+
return x(() => {
|
|
1016
|
+
if (!e || !r) {
|
|
792
1017
|
c({ value: null, status: "idle", error: null });
|
|
793
1018
|
return;
|
|
794
1019
|
}
|
|
795
|
-
let
|
|
796
|
-
const l =
|
|
797
|
-
return c({ value: l ?? null, status: l ? "ready" : "loading", error: null }),
|
|
798
|
-
|
|
799
|
-
}).catch((
|
|
800
|
-
|
|
1020
|
+
let i = !0;
|
|
1021
|
+
const l = s.get(e.key);
|
|
1022
|
+
return c({ value: l ?? null, status: l ? "ready" : "loading", error: null }), s.acquire(e, a).then((p) => {
|
|
1023
|
+
i && c({ value: p, status: "ready", error: null });
|
|
1024
|
+
}).catch((p) => {
|
|
1025
|
+
i && c({ value: null, status: "error", error: p });
|
|
801
1026
|
}), () => {
|
|
802
|
-
|
|
1027
|
+
i = !1, s.release(e.key, a);
|
|
803
1028
|
};
|
|
804
|
-
}, [
|
|
805
|
-
},
|
|
806
|
-
const t =
|
|
807
|
-
return
|
|
808
|
-
(
|
|
809
|
-
() =>
|
|
810
|
-
() =>
|
|
1029
|
+
}, [s, n, r, a]), o;
|
|
1030
|
+
}, hs = (e) => {
|
|
1031
|
+
const t = Oe(), r = e ?? t;
|
|
1032
|
+
return ot(
|
|
1033
|
+
(s) => r.subscribe(s),
|
|
1034
|
+
() => r.getStats(),
|
|
1035
|
+
() => r.getStats()
|
|
811
1036
|
);
|
|
812
|
-
},
|
|
813
|
-
version:
|
|
1037
|
+
}, oe = 1, Ge = Object.freeze({
|
|
1038
|
+
version: oe,
|
|
814
1039
|
trackers: {
|
|
815
1040
|
face: { enabled: !0, numFaces: 1, targetFps: null, holdMs: 250, predictMs: 0, smoothing: 0 },
|
|
816
1041
|
hand: { enabled: !1, targetFps: null },
|
|
@@ -837,13 +1062,13 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
|
|
|
837
1062
|
fallbacks: { onUnsupported: "degrade", delegate: "auto" },
|
|
838
1063
|
assets: { holisticModelUrl: null, semanticSegmentationModelUrl: null },
|
|
839
1064
|
updatedAt: 0
|
|
840
|
-
}),
|
|
1065
|
+
}), P = (e, t, r, s, a, n) => {
|
|
841
1066
|
if (e === void 0) return t;
|
|
842
1067
|
if (typeof e != "number" || !Number.isFinite(e))
|
|
843
1068
|
return n(`${a}: not a number, kept ${t}`), t;
|
|
844
|
-
const
|
|
845
|
-
return
|
|
846
|
-
},
|
|
1069
|
+
const o = Math.min(s, Math.max(r, e));
|
|
1070
|
+
return o !== e && n(`${a}: ${e} clamped to ${o}`), o;
|
|
1071
|
+
}, Y = (e, t, r, s) => e === void 0 ? t : e === null ? null : typeof e != "number" || !Number.isFinite(e) || e <= 0 ? (s(`${r}: invalid fps, kept ${t}`), t) : (e > 120 && s(`${r}: ${e} clamped to 120`), Math.min(120, e)), dr = [
|
|
847
1072
|
"tiers",
|
|
848
1073
|
"budget",
|
|
849
1074
|
"initialTier",
|
|
@@ -851,133 +1076,133 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
|
|
|
851
1076
|
"maxTier",
|
|
852
1077
|
"adaptive",
|
|
853
1078
|
"historySize"
|
|
854
|
-
],
|
|
1079
|
+
], _e = (e) => {
|
|
855
1080
|
const t = {};
|
|
856
|
-
for (const
|
|
1081
|
+
for (const r of dr) e[r] !== void 0 && (t[r] = e[r]);
|
|
857
1082
|
return t;
|
|
858
|
-
}, I = (e, t,
|
|
859
|
-
var c,
|
|
860
|
-
const
|
|
1083
|
+
}, I = (e, t, r, s) => e === void 0 ? t : typeof e != "boolean" ? (s(`${r}: not a boolean, kept ${t}`), t) : e, $ = (e, t, r, s, a) => e === void 0 ? r : t.includes(e) ? e : (a(`${s}: "${String(e)}" is not one of ${t.join(" | ")}, kept ${r}`), r), ve = (e, t, r, s) => e === void 0 ? t : e === null ? null : typeof e != "string" || !/^https?:\/\//.test(e) ? (s(`${r}: not an http(s) URL, kept ${t === null ? "the SDK default" : t}`), t) : e, X = (e = {}, t = Ge, r = []) => {
|
|
1084
|
+
var c, i, l, p, d, f, u, m, S, T, h, y, E, q, b, w, W, Q, ee, te, re, V, M, C, R, v, j, H, N, Z, fe, pe, he, ge, ye, Se, Te, Me;
|
|
1085
|
+
const s = (We) => r.push(We), a = e.trackers ?? {}, n = t.trackers, o = e.quality === void 0 ? t.quality === !1 ? !1 : _e(t.quality) : e.quality === !1 ? !1 : typeof e.quality == "object" && e.quality !== null ? _e(e.quality) : (s("quality: must be an object or false, kept base"), t.quality);
|
|
861
1086
|
return {
|
|
862
|
-
version:
|
|
1087
|
+
version: oe,
|
|
863
1088
|
trackers: {
|
|
864
1089
|
face: {
|
|
865
|
-
enabled: I((c = a.face) == null ? void 0 : c.enabled, n.face.enabled, "trackers.face.enabled",
|
|
1090
|
+
enabled: I((c = a.face) == null ? void 0 : c.enabled, n.face.enabled, "trackers.face.enabled", s),
|
|
866
1091
|
numFaces: Math.round(
|
|
867
|
-
|
|
1092
|
+
P((i = a.face) == null ? void 0 : i.numFaces, n.face.numFaces, 1, 10, "trackers.face.numFaces", s)
|
|
868
1093
|
),
|
|
869
|
-
targetFps:
|
|
870
|
-
holdMs:
|
|
871
|
-
predictMs:
|
|
1094
|
+
targetFps: Y((l = a.face) == null ? void 0 : l.targetFps, n.face.targetFps, "trackers.face.targetFps", s),
|
|
1095
|
+
holdMs: P((p = a.face) == null ? void 0 : p.holdMs, n.face.holdMs, 0, 5e3, "trackers.face.holdMs", s),
|
|
1096
|
+
predictMs: P(
|
|
872
1097
|
(d = a.face) == null ? void 0 : d.predictMs,
|
|
873
1098
|
n.face.predictMs,
|
|
874
1099
|
0,
|
|
875
1100
|
1e3,
|
|
876
1101
|
"trackers.face.predictMs",
|
|
877
|
-
|
|
1102
|
+
s
|
|
878
1103
|
),
|
|
879
|
-
smoothing:
|
|
880
|
-
(
|
|
1104
|
+
smoothing: P(
|
|
1105
|
+
(f = a.face) == null ? void 0 : f.smoothing,
|
|
881
1106
|
n.face.smoothing,
|
|
882
1107
|
0,
|
|
883
1108
|
100,
|
|
884
1109
|
"trackers.face.smoothing",
|
|
885
|
-
|
|
1110
|
+
s
|
|
886
1111
|
)
|
|
887
1112
|
},
|
|
888
1113
|
hand: {
|
|
889
|
-
enabled: I((u = a.hand) == null ? void 0 : u.enabled, n.hand.enabled, "trackers.hand.enabled",
|
|
890
|
-
targetFps:
|
|
1114
|
+
enabled: I((u = a.hand) == null ? void 0 : u.enabled, n.hand.enabled, "trackers.hand.enabled", s),
|
|
1115
|
+
targetFps: Y((m = a.hand) == null ? void 0 : m.targetFps, n.hand.targetFps, "trackers.hand.targetFps", s)
|
|
891
1116
|
},
|
|
892
1117
|
gesture: {
|
|
893
|
-
enabled: I((
|
|
894
|
-
targetFps:
|
|
895
|
-
(
|
|
1118
|
+
enabled: I((S = a.gesture) == null ? void 0 : S.enabled, n.gesture.enabled, "trackers.gesture.enabled", s),
|
|
1119
|
+
targetFps: Y(
|
|
1120
|
+
(T = a.gesture) == null ? void 0 : T.targetFps,
|
|
896
1121
|
n.gesture.targetFps,
|
|
897
1122
|
"trackers.gesture.targetFps",
|
|
898
|
-
|
|
1123
|
+
s
|
|
899
1124
|
)
|
|
900
1125
|
},
|
|
901
1126
|
body: {
|
|
902
|
-
enabled: I((
|
|
903
|
-
targetFps:
|
|
1127
|
+
enabled: I((h = a.body) == null ? void 0 : h.enabled, n.body.enabled, "trackers.body.enabled", s),
|
|
1128
|
+
targetFps: Y((y = a.body) == null ? void 0 : y.targetFps, n.body.targetFps, "trackers.body.targetFps", s)
|
|
904
1129
|
},
|
|
905
1130
|
holistic: {
|
|
906
|
-
enabled: I((
|
|
907
|
-
targetFps:
|
|
908
|
-
(
|
|
1131
|
+
enabled: I((E = a.holistic) == null ? void 0 : E.enabled, n.holistic.enabled, "trackers.holistic.enabled", s),
|
|
1132
|
+
targetFps: Y(
|
|
1133
|
+
(q = a.holistic) == null ? void 0 : q.targetFps,
|
|
909
1134
|
n.holistic.targetFps,
|
|
910
1135
|
"trackers.holistic.targetFps",
|
|
911
|
-
|
|
1136
|
+
s
|
|
912
1137
|
),
|
|
913
|
-
hands:
|
|
914
|
-
(
|
|
1138
|
+
hands: $(
|
|
1139
|
+
(b = a.holistic) == null ? void 0 : b.hands,
|
|
915
1140
|
["both", "left", "right", "none"],
|
|
916
1141
|
n.holistic.hands,
|
|
917
1142
|
"trackers.holistic.hands",
|
|
918
|
-
|
|
1143
|
+
s
|
|
919
1144
|
),
|
|
920
|
-
holdMs:
|
|
1145
|
+
holdMs: P(
|
|
921
1146
|
(w = a.holistic) == null ? void 0 : w.holdMs,
|
|
922
1147
|
n.holistic.holdMs,
|
|
923
1148
|
0,
|
|
924
1149
|
5e3,
|
|
925
1150
|
"trackers.holistic.holdMs",
|
|
926
|
-
|
|
1151
|
+
s
|
|
927
1152
|
),
|
|
928
|
-
predictMs:
|
|
929
|
-
(
|
|
1153
|
+
predictMs: P(
|
|
1154
|
+
(W = a.holistic) == null ? void 0 : W.predictMs,
|
|
930
1155
|
n.holistic.predictMs,
|
|
931
1156
|
0,
|
|
932
1157
|
1e3,
|
|
933
1158
|
"trackers.holistic.predictMs",
|
|
934
|
-
|
|
1159
|
+
s
|
|
935
1160
|
),
|
|
936
1161
|
analysisMaxDimension: Math.round(
|
|
937
|
-
|
|
938
|
-
(
|
|
1162
|
+
P(
|
|
1163
|
+
(Q = a.holistic) == null ? void 0 : Q.analysisMaxDimension,
|
|
939
1164
|
n.holistic.analysisMaxDimension,
|
|
940
1165
|
128,
|
|
941
1166
|
2048,
|
|
942
1167
|
"trackers.holistic.analysisMaxDimension",
|
|
943
|
-
|
|
1168
|
+
s
|
|
944
1169
|
)
|
|
945
1170
|
),
|
|
946
1171
|
outputFaceBlendshapes: I(
|
|
947
|
-
(
|
|
1172
|
+
(ee = a.holistic) == null ? void 0 : ee.outputFaceBlendshapes,
|
|
948
1173
|
n.holistic.outputFaceBlendshapes,
|
|
949
1174
|
"trackers.holistic.outputFaceBlendshapes",
|
|
950
|
-
|
|
1175
|
+
s
|
|
951
1176
|
),
|
|
952
|
-
confidence:
|
|
953
|
-
(
|
|
1177
|
+
confidence: P(
|
|
1178
|
+
(te = a.holistic) == null ? void 0 : te.confidence,
|
|
954
1179
|
n.holistic.confidence,
|
|
955
1180
|
0,
|
|
956
1181
|
1,
|
|
957
1182
|
"trackers.holistic.confidence",
|
|
958
|
-
|
|
1183
|
+
s
|
|
959
1184
|
),
|
|
960
|
-
delegate:
|
|
961
|
-
(
|
|
1185
|
+
delegate: $(
|
|
1186
|
+
(re = a.holistic) == null ? void 0 : re.delegate,
|
|
962
1187
|
["auto", "GPU", "CPU"],
|
|
963
1188
|
n.holistic.delegate,
|
|
964
1189
|
"trackers.holistic.delegate",
|
|
965
|
-
|
|
1190
|
+
s
|
|
966
1191
|
)
|
|
967
1192
|
},
|
|
968
1193
|
segmentation: {
|
|
969
1194
|
enabled: I(
|
|
970
|
-
(
|
|
1195
|
+
(V = a.segmentation) == null ? void 0 : V.enabled,
|
|
971
1196
|
n.segmentation.enabled,
|
|
972
1197
|
"trackers.segmentation.enabled",
|
|
973
|
-
|
|
1198
|
+
s
|
|
974
1199
|
),
|
|
975
|
-
quality:
|
|
976
|
-
(
|
|
1200
|
+
quality: $(
|
|
1201
|
+
(M = a.segmentation) == null ? void 0 : M.quality,
|
|
977
1202
|
["low", "medium", "high"],
|
|
978
1203
|
n.segmentation.quality,
|
|
979
1204
|
"trackers.segmentation.quality",
|
|
980
|
-
|
|
1205
|
+
s
|
|
981
1206
|
)
|
|
982
1207
|
},
|
|
983
1208
|
semanticSegmentation: {
|
|
@@ -985,113 +1210,113 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
|
|
|
985
1210
|
(C = a.semanticSegmentation) == null ? void 0 : C.enabled,
|
|
986
1211
|
n.semanticSegmentation.enabled,
|
|
987
1212
|
"trackers.semanticSegmentation.enabled",
|
|
988
|
-
|
|
1213
|
+
s
|
|
989
1214
|
),
|
|
990
|
-
preset:
|
|
991
|
-
(
|
|
992
|
-
|
|
1215
|
+
preset: $(
|
|
1216
|
+
(R = a.semanticSegmentation) == null ? void 0 : R.preset,
|
|
1217
|
+
At,
|
|
993
1218
|
n.semanticSegmentation.preset,
|
|
994
1219
|
"trackers.semanticSegmentation.preset",
|
|
995
|
-
|
|
1220
|
+
s
|
|
996
1221
|
),
|
|
997
|
-
quality:
|
|
998
|
-
(
|
|
1222
|
+
quality: $(
|
|
1223
|
+
(v = a.semanticSegmentation) == null ? void 0 : v.quality,
|
|
999
1224
|
["low", "medium", "high"],
|
|
1000
1225
|
n.semanticSegmentation.quality,
|
|
1001
1226
|
"trackers.semanticSegmentation.quality",
|
|
1002
|
-
|
|
1227
|
+
s
|
|
1003
1228
|
)
|
|
1004
1229
|
}
|
|
1005
1230
|
},
|
|
1006
1231
|
perf: {
|
|
1007
|
-
targetFps:
|
|
1008
|
-
camRes: Math.round(
|
|
1009
|
-
cameraZoom:
|
|
1010
|
-
analysisScale:
|
|
1011
|
-
(
|
|
1232
|
+
targetFps: P((j = e.perf) == null ? void 0 : j.targetFps, t.perf.targetFps, 0, 120, "perf.targetFps", s),
|
|
1233
|
+
camRes: Math.round(P((H = e.perf) == null ? void 0 : H.camRes, t.perf.camRes, 160, 3840, "perf.camRes", s)),
|
|
1234
|
+
cameraZoom: P((N = e.perf) == null ? void 0 : N.cameraZoom, t.perf.cameraZoom, 1, 3, "perf.cameraZoom", s),
|
|
1235
|
+
analysisScale: P(
|
|
1236
|
+
(Z = e.perf) == null ? void 0 : Z.analysisScale,
|
|
1012
1237
|
t.perf.analysisScale,
|
|
1013
1238
|
0.25,
|
|
1014
1239
|
1,
|
|
1015
1240
|
"perf.analysisScale",
|
|
1016
|
-
|
|
1241
|
+
s
|
|
1017
1242
|
)
|
|
1018
1243
|
},
|
|
1019
1244
|
lifecycle: {
|
|
1020
1245
|
pauseWhenHidden: I(
|
|
1021
|
-
(
|
|
1246
|
+
(fe = e.lifecycle) == null ? void 0 : fe.pauseWhenHidden,
|
|
1022
1247
|
t.lifecycle.pauseWhenHidden,
|
|
1023
1248
|
"lifecycle.pauseWhenHidden",
|
|
1024
|
-
|
|
1249
|
+
s
|
|
1025
1250
|
)
|
|
1026
1251
|
},
|
|
1027
|
-
quality:
|
|
1252
|
+
quality: o,
|
|
1028
1253
|
camera: {
|
|
1029
|
-
facingMode:
|
|
1030
|
-
(
|
|
1254
|
+
facingMode: $(
|
|
1255
|
+
(pe = e.camera) == null ? void 0 : pe.facingMode,
|
|
1031
1256
|
["user", "environment"],
|
|
1032
1257
|
t.camera.facingMode,
|
|
1033
1258
|
"camera.facingMode",
|
|
1034
|
-
|
|
1259
|
+
s
|
|
1035
1260
|
),
|
|
1036
|
-
deviceId: ((
|
|
1037
|
-
mirrored: ((
|
|
1261
|
+
deviceId: ((he = e.camera) == null ? void 0 : he.deviceId) === void 0 ? t.camera.deviceId : typeof e.camera.deviceId == "string" || e.camera.deviceId === null ? e.camera.deviceId : (s("camera.deviceId: not a string, kept base"), t.camera.deviceId),
|
|
1262
|
+
mirrored: ((ge = e.camera) == null ? void 0 : ge.mirrored) === void 0 ? t.camera.mirrored : e.camera.mirrored === "auto" || typeof e.camera.mirrored == "boolean" ? e.camera.mirrored : (s('camera.mirrored: must be boolean or "auto", kept base'), t.camera.mirrored)
|
|
1038
1263
|
},
|
|
1039
1264
|
fallbacks: {
|
|
1040
|
-
onUnsupported:
|
|
1041
|
-
(
|
|
1265
|
+
onUnsupported: $(
|
|
1266
|
+
(ye = e.fallbacks) == null ? void 0 : ye.onUnsupported,
|
|
1042
1267
|
["block", "degrade"],
|
|
1043
1268
|
t.fallbacks.onUnsupported,
|
|
1044
1269
|
"fallbacks.onUnsupported",
|
|
1045
|
-
|
|
1270
|
+
s
|
|
1046
1271
|
),
|
|
1047
|
-
delegate:
|
|
1048
|
-
(
|
|
1272
|
+
delegate: $(
|
|
1273
|
+
(Se = e.fallbacks) == null ? void 0 : Se.delegate,
|
|
1049
1274
|
["auto", "GPU", "CPU"],
|
|
1050
1275
|
t.fallbacks.delegate,
|
|
1051
1276
|
"fallbacks.delegate",
|
|
1052
|
-
|
|
1277
|
+
s
|
|
1053
1278
|
)
|
|
1054
1279
|
},
|
|
1055
1280
|
assets: {
|
|
1056
|
-
holisticModelUrl:
|
|
1057
|
-
(
|
|
1281
|
+
holisticModelUrl: ve(
|
|
1282
|
+
(Te = e.assets) == null ? void 0 : Te.holisticModelUrl,
|
|
1058
1283
|
t.assets.holisticModelUrl,
|
|
1059
1284
|
"assets.holisticModelUrl",
|
|
1060
|
-
|
|
1285
|
+
s
|
|
1061
1286
|
),
|
|
1062
|
-
semanticSegmentationModelUrl:
|
|
1063
|
-
(
|
|
1287
|
+
semanticSegmentationModelUrl: ve(
|
|
1288
|
+
(Me = e.assets) == null ? void 0 : Me.semanticSegmentationModelUrl,
|
|
1064
1289
|
t.assets.semanticSegmentationModelUrl,
|
|
1065
1290
|
"assets.semanticSegmentationModelUrl",
|
|
1066
|
-
|
|
1291
|
+
s
|
|
1067
1292
|
)
|
|
1068
1293
|
},
|
|
1069
1294
|
updatedAt: typeof e.updatedAt == "number" && Number.isFinite(e.updatedAt) ? e.updatedAt : t.updatedAt
|
|
1070
1295
|
};
|
|
1071
|
-
},
|
|
1296
|
+
}, we = (e, t, r = Date.now()) => X({ ...t, updatedAt: r }, e), ze = (e) => JSON.stringify(X({}, e)), qe = (e) => {
|
|
1072
1297
|
const t = [];
|
|
1073
|
-
let
|
|
1298
|
+
let r = e;
|
|
1074
1299
|
if (typeof e == "string")
|
|
1075
1300
|
try {
|
|
1076
|
-
|
|
1301
|
+
r = JSON.parse(e);
|
|
1077
1302
|
} catch {
|
|
1078
1303
|
return {
|
|
1079
|
-
config:
|
|
1304
|
+
config: X(),
|
|
1080
1305
|
migrated: !0,
|
|
1081
1306
|
warnings: ["not valid JSON; defaults used"]
|
|
1082
1307
|
};
|
|
1083
1308
|
}
|
|
1084
|
-
if (!
|
|
1309
|
+
if (!r || typeof r != "object")
|
|
1085
1310
|
return {
|
|
1086
|
-
config:
|
|
1311
|
+
config: X(),
|
|
1087
1312
|
migrated: !0,
|
|
1088
1313
|
warnings: ["not an object; defaults used"]
|
|
1089
1314
|
};
|
|
1090
|
-
const
|
|
1315
|
+
const s = r, a = s.version !== oe;
|
|
1091
1316
|
return a && t.push(
|
|
1092
|
-
`migrated from version ${String(
|
|
1093
|
-
), { config:
|
|
1094
|
-
},
|
|
1317
|
+
`migrated from version ${String(s.version ?? "none")} to ${oe}`
|
|
1318
|
+
), { config: X(s, Ge, t), migrated: a, warnings: t };
|
|
1319
|
+
}, gs = [
|
|
1095
1320
|
"face",
|
|
1096
1321
|
"hand",
|
|
1097
1322
|
"gesture",
|
|
@@ -1099,7 +1324,7 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
|
|
|
1099
1324
|
"holistic",
|
|
1100
1325
|
"segmentation",
|
|
1101
1326
|
"semanticSegmentation"
|
|
1102
|
-
],
|
|
1327
|
+
], mr = (e) => ({
|
|
1103
1328
|
perf: {
|
|
1104
1329
|
targetFps: e.perf.targetFps > 0 ? e.perf.targetFps : void 0,
|
|
1105
1330
|
camRes: e.perf.camRes,
|
|
@@ -1108,343 +1333,350 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
|
|
|
1108
1333
|
},
|
|
1109
1334
|
lifecycle: { pauseWhenHidden: e.lifecycle.pauseWhenHidden },
|
|
1110
1335
|
quality: e.quality
|
|
1111
|
-
}),
|
|
1336
|
+
}), fr = (e) => ({
|
|
1112
1337
|
facingMode: e.camera.facingMode,
|
|
1113
1338
|
...e.camera.deviceId ? { deviceId: e.camera.deviceId } : {},
|
|
1114
1339
|
...e.camera.mirrored === "auto" ? {} : { mirrored: e.camera.mirrored }
|
|
1115
|
-
}),
|
|
1116
|
-
const
|
|
1340
|
+
}), G = (e) => e === null ? {} : { targetFps: e }, pr = (e, t) => {
|
|
1341
|
+
const r = e.trackers;
|
|
1117
1342
|
return {
|
|
1118
1343
|
face: {
|
|
1119
|
-
numFaces:
|
|
1120
|
-
...
|
|
1121
|
-
holdMs:
|
|
1122
|
-
predictMs:
|
|
1123
|
-
active:
|
|
1344
|
+
numFaces: r.face.numFaces,
|
|
1345
|
+
...G(r.face.targetFps),
|
|
1346
|
+
holdMs: r.face.holdMs,
|
|
1347
|
+
predictMs: r.face.predictMs,
|
|
1348
|
+
active: r.face.enabled
|
|
1124
1349
|
},
|
|
1125
|
-
hand: { ...
|
|
1126
|
-
gesture: { ...
|
|
1127
|
-
body: { active:
|
|
1350
|
+
hand: { ...G(r.hand.targetFps), active: r.hand.enabled },
|
|
1351
|
+
gesture: { ...G(r.gesture.targetFps), active: r.gesture.enabled },
|
|
1352
|
+
body: { active: r.body.enabled },
|
|
1128
1353
|
holistic: {
|
|
1129
|
-
...
|
|
1130
|
-
hands:
|
|
1131
|
-
holdMs:
|
|
1132
|
-
predictMs:
|
|
1133
|
-
analysisMaxDimension:
|
|
1134
|
-
outputFaceBlendshapes:
|
|
1135
|
-
delegate:
|
|
1354
|
+
...G(r.holistic.targetFps),
|
|
1355
|
+
hands: r.holistic.hands,
|
|
1356
|
+
holdMs: r.holistic.holdMs,
|
|
1357
|
+
predictMs: r.holistic.predictMs,
|
|
1358
|
+
analysisMaxDimension: r.holistic.analysisMaxDimension,
|
|
1359
|
+
outputFaceBlendshapes: r.holistic.outputFaceBlendshapes,
|
|
1360
|
+
delegate: r.holistic.delegate === "auto" ? e.fallbacks.delegate : r.holistic.delegate,
|
|
1136
1361
|
...e.assets.holisticModelUrl ? { modelUrl: e.assets.holisticModelUrl } : {},
|
|
1137
|
-
active:
|
|
1362
|
+
active: r.holistic.enabled
|
|
1138
1363
|
},
|
|
1139
|
-
segmentation: { quality:
|
|
1364
|
+
segmentation: { quality: r.segmentation.quality, active: r.segmentation.enabled },
|
|
1140
1365
|
semanticSegmentation: {
|
|
1141
|
-
preset:
|
|
1142
|
-
quality:
|
|
1366
|
+
preset: r.semanticSegmentation.preset,
|
|
1367
|
+
quality: r.semanticSegmentation.quality,
|
|
1143
1368
|
...e.assets.semanticSegmentationModelUrl ? { modelUrl: e.assets.semanticSegmentationModelUrl } : {},
|
|
1144
|
-
active:
|
|
1369
|
+
active: r.semanticSegmentation.enabled
|
|
1145
1370
|
}
|
|
1146
1371
|
}[t];
|
|
1147
|
-
},
|
|
1148
|
-
const
|
|
1372
|
+
}, hr = (e, t) => {
|
|
1373
|
+
const r = e.trackers;
|
|
1149
1374
|
switch (t) {
|
|
1150
|
-
case
|
|
1151
|
-
return { numFaces:
|
|
1152
|
-
case
|
|
1153
|
-
return { ...
|
|
1154
|
-
case
|
|
1155
|
-
return { ...
|
|
1156
|
-
case
|
|
1157
|
-
return { ...
|
|
1158
|
-
case
|
|
1159
|
-
const
|
|
1375
|
+
case k.FACE_TRACKER:
|
|
1376
|
+
return { numFaces: r.face.numFaces, ...G(r.face.targetFps) };
|
|
1377
|
+
case k.HAND_TRACKER:
|
|
1378
|
+
return { ...G(r.hand.targetFps) };
|
|
1379
|
+
case k.GESTURE_TRACKER:
|
|
1380
|
+
return { ...G(r.gesture.targetFps) };
|
|
1381
|
+
case k.BODY_TRACKER:
|
|
1382
|
+
return { ...G(r.body.targetFps) };
|
|
1383
|
+
case k.HOLISTIC_TRACKER: {
|
|
1384
|
+
const s = r.holistic;
|
|
1160
1385
|
return {
|
|
1161
|
-
...
|
|
1162
|
-
hands:
|
|
1163
|
-
holdMs:
|
|
1164
|
-
predictMs:
|
|
1165
|
-
analysisMaxDimension:
|
|
1166
|
-
outputFaceBlendshapes:
|
|
1167
|
-
minFaceDetectionConfidence:
|
|
1168
|
-
minFacePresenceConfidence:
|
|
1169
|
-
minPoseDetectionConfidence:
|
|
1170
|
-
minPosePresenceConfidence:
|
|
1171
|
-
minHandLandmarksConfidence:
|
|
1172
|
-
delegate:
|
|
1386
|
+
...G(s.targetFps),
|
|
1387
|
+
hands: s.hands,
|
|
1388
|
+
holdMs: s.holdMs,
|
|
1389
|
+
predictMs: s.predictMs,
|
|
1390
|
+
analysisMaxDimension: s.analysisMaxDimension,
|
|
1391
|
+
outputFaceBlendshapes: s.outputFaceBlendshapes,
|
|
1392
|
+
minFaceDetectionConfidence: s.confidence,
|
|
1393
|
+
minFacePresenceConfidence: s.confidence,
|
|
1394
|
+
minPoseDetectionConfidence: s.confidence,
|
|
1395
|
+
minPosePresenceConfidence: s.confidence,
|
|
1396
|
+
minHandLandmarksConfidence: s.confidence,
|
|
1397
|
+
delegate: s.delegate === "auto" ? e.fallbacks.delegate : s.delegate,
|
|
1173
1398
|
...e.assets.holisticModelUrl ? { modelUrl: e.assets.holisticModelUrl } : {}
|
|
1174
1399
|
};
|
|
1175
1400
|
}
|
|
1176
|
-
case
|
|
1177
|
-
return { quality:
|
|
1178
|
-
case
|
|
1401
|
+
case k.BACKGROUND_SEGMENTATION:
|
|
1402
|
+
return { quality: r.segmentation.quality };
|
|
1403
|
+
case k.SEMANTIC_SEGMENTATION:
|
|
1179
1404
|
return {
|
|
1180
|
-
preset:
|
|
1181
|
-
quality:
|
|
1405
|
+
preset: r.semanticSegmentation.preset,
|
|
1406
|
+
quality: r.semanticSegmentation.quality,
|
|
1182
1407
|
...e.assets.semanticSegmentationModelUrl ? { modelUrl: e.assets.semanticSegmentationModelUrl } : {}
|
|
1183
1408
|
};
|
|
1184
1409
|
default:
|
|
1185
1410
|
return {};
|
|
1186
1411
|
}
|
|
1187
|
-
},
|
|
1188
|
-
const t = e.trackers,
|
|
1189
|
-
return t.face.enabled &&
|
|
1190
|
-
},
|
|
1412
|
+
}, gr = (e) => {
|
|
1413
|
+
const t = e.trackers, r = [];
|
|
1414
|
+
return t.face.enabled && r.push(k.FACE_TRACKER), t.hand.enabled && r.push(k.HAND_TRACKER), t.gesture.enabled && r.push(k.GESTURE_TRACKER), t.body.enabled && r.push(k.BODY_TRACKER), t.holistic.enabled && r.push(k.HOLISTIC_TRACKER), t.segmentation.enabled && r.push(k.BACKGROUND_SEGMENTATION), t.semanticSegmentation.enabled && r.push(k.SEMANTIC_SEGMENTATION), r;
|
|
1415
|
+
}, ie = "vincentt.xr.tracking-config", me = () => {
|
|
1191
1416
|
try {
|
|
1192
1417
|
return typeof localStorage < "u" ? localStorage : null;
|
|
1193
1418
|
} catch {
|
|
1194
1419
|
return null;
|
|
1195
1420
|
}
|
|
1196
|
-
},
|
|
1421
|
+
}, yr = (e = ie, t = me()) => {
|
|
1197
1422
|
if (!t) return null;
|
|
1198
1423
|
try {
|
|
1199
|
-
const
|
|
1200
|
-
return
|
|
1424
|
+
const r = t.getItem(e);
|
|
1425
|
+
return r ? qe(r) : null;
|
|
1201
1426
|
} catch {
|
|
1202
1427
|
return null;
|
|
1203
1428
|
}
|
|
1204
|
-
},
|
|
1205
|
-
if (!
|
|
1429
|
+
}, De = (e, t = ie, r = me()) => {
|
|
1430
|
+
if (!r) return !1;
|
|
1206
1431
|
try {
|
|
1207
|
-
return
|
|
1432
|
+
return r.setItem(t, ze(e)), !0;
|
|
1208
1433
|
} catch {
|
|
1209
1434
|
return !1;
|
|
1210
1435
|
}
|
|
1211
|
-
},
|
|
1436
|
+
}, Sr = (e = ie, t = me()) => {
|
|
1212
1437
|
if (t)
|
|
1213
1438
|
try {
|
|
1214
1439
|
t.removeItem(e);
|
|
1215
1440
|
} catch {
|
|
1216
1441
|
}
|
|
1217
|
-
},
|
|
1218
|
-
const { storageKey: t =
|
|
1219
|
-
|
|
1220
|
-
if (!
|
|
1442
|
+
}, ys = (e = {}) => {
|
|
1443
|
+
const { storageKey: t = ie, persist: r = !0 } = e, s = e.storage, a = A(e.initial), n = z(() => X(a.current ?? {}), []), [o, c] = _(n), [i, l] = _([]), [p, d] = _(!r), f = A(o);
|
|
1444
|
+
f.current = o, x(() => {
|
|
1445
|
+
if (!r) {
|
|
1221
1446
|
d(!0);
|
|
1222
1447
|
return;
|
|
1223
1448
|
}
|
|
1224
|
-
const
|
|
1225
|
-
if (
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1449
|
+
const h = yr(t, s);
|
|
1450
|
+
if (h) {
|
|
1451
|
+
const y = X(h.config, n);
|
|
1452
|
+
f.current = y, c(y), l(h.warnings), h.migrated && De(y, t, s);
|
|
1228
1453
|
}
|
|
1229
1454
|
d(!0);
|
|
1230
|
-
}, [
|
|
1231
|
-
const u =
|
|
1232
|
-
(
|
|
1233
|
-
[
|
|
1234
|
-
),
|
|
1235
|
-
(
|
|
1236
|
-
const
|
|
1237
|
-
return u(
|
|
1455
|
+
}, [r, t, s, n]);
|
|
1456
|
+
const u = F(
|
|
1457
|
+
(h, y) => (f.current = h, c(h), l(y), r && De(h, t, s), h),
|
|
1458
|
+
[r, t, s]
|
|
1459
|
+
), m = F(
|
|
1460
|
+
(h) => {
|
|
1461
|
+
const y = [], E = X({ ...h, updatedAt: Date.now() }, f.current, y);
|
|
1462
|
+
return u(E, y);
|
|
1238
1463
|
},
|
|
1239
1464
|
[u]
|
|
1240
|
-
),
|
|
1241
|
-
const
|
|
1242
|
-
return
|
|
1243
|
-
}, [n,
|
|
1244
|
-
(
|
|
1245
|
-
const
|
|
1246
|
-
return
|
|
1465
|
+
), S = F(() => {
|
|
1466
|
+
const h = we(n, {}, 0);
|
|
1467
|
+
return f.current = h, c(h), l([]), r && Sr(t, s), h;
|
|
1468
|
+
}, [n, r, t, s]), T = F(
|
|
1469
|
+
(h) => {
|
|
1470
|
+
const y = qe(h);
|
|
1471
|
+
return y.warnings.some((E) => E.startsWith("not valid JSON") || E.startsWith("not an object")) ? (l([`import: ${y.warnings[0]}; config unchanged`]), f.current) : u(we(y.config, {}, Date.now()), y.warnings);
|
|
1247
1472
|
},
|
|
1248
1473
|
[u]
|
|
1249
1474
|
);
|
|
1250
|
-
return
|
|
1475
|
+
return z(
|
|
1251
1476
|
() => ({
|
|
1252
|
-
config:
|
|
1253
|
-
hydrated:
|
|
1254
|
-
warnings:
|
|
1255
|
-
update:
|
|
1256
|
-
reset:
|
|
1257
|
-
importJson:
|
|
1258
|
-
json:
|
|
1259
|
-
providerProps:
|
|
1260
|
-
cameraRequest:
|
|
1261
|
-
trackerProps: (
|
|
1262
|
-
modelOptions: (
|
|
1263
|
-
enabledModels:
|
|
1477
|
+
config: o,
|
|
1478
|
+
hydrated: p,
|
|
1479
|
+
warnings: i,
|
|
1480
|
+
update: m,
|
|
1481
|
+
reset: S,
|
|
1482
|
+
importJson: T,
|
|
1483
|
+
json: ze(o),
|
|
1484
|
+
providerProps: mr(o),
|
|
1485
|
+
cameraRequest: fr(o),
|
|
1486
|
+
trackerProps: (h) => pr(o, h),
|
|
1487
|
+
modelOptions: (h) => hr(o, h),
|
|
1488
|
+
enabledModels: gr(o)
|
|
1264
1489
|
}),
|
|
1265
|
-
[
|
|
1490
|
+
[o, p, i, m, S, T]
|
|
1266
1491
|
);
|
|
1267
1492
|
};
|
|
1268
1493
|
export {
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1494
|
+
qr as AspectRatioContainer,
|
|
1495
|
+
er as AudioEngine,
|
|
1496
|
+
Qr as AudioPlayer,
|
|
1497
|
+
Wr as Axes,
|
|
1498
|
+
jr as Button,
|
|
1499
|
+
Je as CAMERA_PERMISSION_MESSAGES,
|
|
1500
|
+
us as CameraPermissionGate,
|
|
1501
|
+
Cn as DEFAULT_ASSET_BUDGET_BYTES,
|
|
1502
|
+
cn as DEFAULT_MATERIAL_FILL,
|
|
1503
|
+
Re as DEFAULT_MESH_RENDERER,
|
|
1504
|
+
Tn as DEFAULT_MESH_RENDERER_RENDER_STATE,
|
|
1505
|
+
Ms as DEFAULT_PERFORMANCE_BUDGET,
|
|
1506
|
+
Es as DEFAULT_PIXEL_SNAP_INCREMENT,
|
|
1507
|
+
bs as DEFAULT_QUALITY_TIERS,
|
|
1508
|
+
Rs as DEFAULT_REFERENCE_PIXELS_PER_UNIT,
|
|
1509
|
+
wa as DEFAULT_SCREEN_GLASS,
|
|
1510
|
+
ln as DEFAULT_SCREEN_GRADIENT,
|
|
1511
|
+
Da as DEFAULT_SCREEN_IMAGE_SCENE_SETTINGS,
|
|
1512
|
+
Pa as DEFAULT_SCREEN_IMAGE_SETTINGS,
|
|
1513
|
+
Ua as DEFAULT_SCREEN_SHAPE_SETTINGS,
|
|
1514
|
+
Na as DEFAULT_SCREEN_TEXT_SCENE_SETTINGS,
|
|
1515
|
+
La as DEFAULT_SCREEN_TEXT_SHADOW_LAYER,
|
|
1516
|
+
As as DEFAULT_SCREEN_TRANSFORM_2D,
|
|
1517
|
+
Fs as DEFAULT_SCREEN_TRANSFORM_ROOT,
|
|
1518
|
+
Ge as DEFAULT_TRACKING_CONFIG,
|
|
1519
|
+
K as DEFAULT_TRANSFORM_3D,
|
|
1520
|
+
un as EXTERNAL_BACKGROUND_RENDER_LAYER,
|
|
1521
|
+
gt as FULL_SCREEN_ANCHORS,
|
|
1522
|
+
Kr as HtmlRegion,
|
|
1523
|
+
Vr as Light,
|
|
1524
|
+
Tt as LightObject,
|
|
1525
|
+
Za as LookAt,
|
|
1526
|
+
dn as MAX_RENDER_GROUP_PASSES,
|
|
1527
|
+
mn as MaterialFill,
|
|
1528
|
+
bn as MeshMaterial,
|
|
1529
|
+
Rt as MeshRenderer,
|
|
1530
|
+
Xr as Model,
|
|
1531
|
+
Hr as Object3D,
|
|
1532
|
+
Or as Panel,
|
|
1533
|
+
zr as PersonCutout,
|
|
1534
|
+
Ia as PinToMesh,
|
|
1535
|
+
Ya as RenderGroupLayer,
|
|
1536
|
+
Ja as SCREEN_IMAGE_MASK_CHANNELS,
|
|
1537
|
+
sn as Scene,
|
|
1538
|
+
Qa as SceneObjectRenderer,
|
|
1539
|
+
an as Scenes,
|
|
1540
|
+
Oa as ScreenGlassMaterial,
|
|
1541
|
+
fn as ScreenGradientMaterial,
|
|
1542
|
+
yt as ScreenImage,
|
|
1543
|
+
Ga as ScreenShape,
|
|
1544
|
+
ka as ScreenSpaceUI,
|
|
1545
|
+
en as ScreenText,
|
|
1546
|
+
Qe as ScreenTransform,
|
|
1547
|
+
tn as SequentialRenderPasses,
|
|
1548
|
+
Br as SpriteAnimation,
|
|
1549
|
+
gs as TRACKER_KINDS,
|
|
1550
|
+
ie as TRACKING_CONFIG_STORAGE_KEY,
|
|
1551
|
+
oe as TRACKING_CONFIG_VERSION,
|
|
1552
|
+
_a as TextLabel,
|
|
1553
|
+
$r as ThemeProvider,
|
|
1554
|
+
bt as Transform3D,
|
|
1555
|
+
Gr as VideoBackground,
|
|
1556
|
+
xn as XRAssetCache,
|
|
1557
|
+
fs as XRAssetCacheProvider,
|
|
1558
|
+
Cs as XRMediaSource,
|
|
1559
|
+
k as XRModel,
|
|
1560
|
+
xs as XRProvider,
|
|
1561
|
+
ks as XRQualityController,
|
|
1562
|
+
Ca as XRScene,
|
|
1563
|
+
_s as XR_FALLBACK_MESSAGES,
|
|
1564
|
+
vs as XR_MODEL_ASSET_URLS,
|
|
1334
1565
|
U as audio,
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1566
|
+
Ye as canPromptForCamera,
|
|
1567
|
+
Sr as clearTrackingConfig,
|
|
1568
|
+
ws as clientToScreenPixels,
|
|
1569
|
+
St as computeContainScale,
|
|
1570
|
+
Ds as computeFeedCrop,
|
|
1571
|
+
Ps as computeFitLayout,
|
|
1572
|
+
kn as createAssetCache,
|
|
1573
|
+
Us as createFallbackReason,
|
|
1574
|
+
pn as createTwoStopGradient,
|
|
1575
|
+
Jr as dataURLtoFile,
|
|
1576
|
+
wn as defineGltfAsset,
|
|
1577
|
+
Dn as defineTextureAsset,
|
|
1578
|
+
Pn as defineVideoAsset,
|
|
1579
|
+
Ns as detectXRCapabilities,
|
|
1580
|
+
Un as disposeObject3D,
|
|
1581
|
+
Ha as drawNormalizedCrop,
|
|
1582
|
+
gr as enabledModels,
|
|
1583
|
+
Nn as estimateGeometryBytes,
|
|
1584
|
+
Ln as estimateObjectBytes,
|
|
1585
|
+
In as estimateTextureBytes,
|
|
1586
|
+
Ls as feedSidedName,
|
|
1587
|
+
Is as feedToScreenPixels,
|
|
1588
|
+
Os as feedToSource,
|
|
1589
|
+
Gs as feedToTracker,
|
|
1590
|
+
zs as feedToViewport,
|
|
1591
|
+
qs as feedToWorld,
|
|
1592
|
+
ms as findCameraByFacing,
|
|
1593
|
+
Ne as getDefaultAssetCache,
|
|
1594
|
+
hn as getRenderGroupLayer,
|
|
1595
|
+
Ws as isFeedPointInSource,
|
|
1596
|
+
Bs as isMirroredSourceKind,
|
|
1597
|
+
is as isMuted,
|
|
1598
|
+
ds as listCameras,
|
|
1599
|
+
yr as loadTrackingConfig,
|
|
1600
|
+
za as mapScreenImageSettingsToProps,
|
|
1601
|
+
qa as mapScreenTextInnerShadowToProps,
|
|
1602
|
+
Wa as mapScreenTextSettingsToProps,
|
|
1603
|
+
$s as mediaToScreenPixels,
|
|
1604
|
+
Ba as mergeScreenShapeSettings,
|
|
1605
|
+
Xs as mergeScreenTransform2D,
|
|
1606
|
+
we as mergeTrackingConfig,
|
|
1607
|
+
Hs as mirrorFeedX,
|
|
1608
|
+
Mn as normalizeMeshRendererRenderState,
|
|
1609
|
+
$a as normalizeScreenGlass,
|
|
1610
|
+
gn as normalizeScreenGradient,
|
|
1611
|
+
Ks as normalizedToScreenPixels,
|
|
1612
|
+
js as normalizedToTransform2DPixels,
|
|
1613
|
+
cs as onMuteChange,
|
|
1614
|
+
Vs as orientSourcePoint,
|
|
1615
|
+
Zs as orientedSize,
|
|
1616
|
+
Ys as otherSide,
|
|
1617
|
+
qe as parseTrackingConfig,
|
|
1618
|
+
Js as personLeftSign,
|
|
1619
|
+
Qs as personSide,
|
|
1620
|
+
as as playOneShot,
|
|
1621
|
+
es as prefetchMusic,
|
|
1622
|
+
je as queryCameraPermission,
|
|
1623
|
+
ts as registerSound,
|
|
1624
|
+
yn as renderSequentialPasses,
|
|
1625
|
+
Ve as requestCameraAccess,
|
|
1626
|
+
ea as resolveModelAssetUrl,
|
|
1627
|
+
Ka as resolveNormalizedCrop,
|
|
1628
|
+
ja as resolvePersonCutoutStatus,
|
|
1629
|
+
ta as resolveQualityConfig,
|
|
1630
|
+
ra as resolveScreenTransform2D,
|
|
1631
|
+
sa as resolveTrackerSupport,
|
|
1632
|
+
X as resolveTrackingConfig,
|
|
1633
|
+
De as saveTrackingConfig,
|
|
1634
|
+
aa as screenPixelsToClient,
|
|
1635
|
+
na as screenPixelsToFeed,
|
|
1636
|
+
oa as screenPixelsToMedia,
|
|
1637
|
+
ia as screenPixelsToNormalized,
|
|
1638
|
+
ca as screenPixelsToScreenSpace,
|
|
1639
|
+
la as screenPixelsToUnits,
|
|
1640
|
+
ua as screenPointToRay,
|
|
1641
|
+
da as screenSpaceToScreenPixels,
|
|
1642
|
+
ma as screenTransform2DScale,
|
|
1643
|
+
fa as screenUnitsToPixels,
|
|
1644
|
+
ze as serializeTrackingConfig,
|
|
1645
|
+
ns as setMuted,
|
|
1646
|
+
ht as shouldDrawFallback,
|
|
1647
|
+
J as smoothNumber,
|
|
1648
|
+
Lr as smoothVector2,
|
|
1649
|
+
Ir as smoothVector3,
|
|
1650
|
+
pa as sourceToFeed,
|
|
1651
|
+
rs as startMusic,
|
|
1652
|
+
ss as stopMusic,
|
|
1653
|
+
Ze as subscribeCameraPermission,
|
|
1654
|
+
ha as swapSidedName,
|
|
1655
|
+
fr as toCameraRequest,
|
|
1656
|
+
hr as toModelOptions,
|
|
1657
|
+
mr as toProviderProps,
|
|
1658
|
+
pr as toTrackerProps,
|
|
1659
|
+
os as toggleMuted,
|
|
1660
|
+
ga as trackerPointToScreenPixels,
|
|
1661
|
+
ya as trackerToFeed,
|
|
1662
|
+
Sa as trackerToWorld,
|
|
1663
|
+
Ta as transform2DPixelsToNormalized,
|
|
1664
|
+
ar as useCameraPermission,
|
|
1665
|
+
Yr as useFrameCapture,
|
|
1666
|
+
Zr as useMediaRecorder,
|
|
1667
|
+
ls as useMuted,
|
|
1668
|
+
pt as usePersonMaskTexture,
|
|
1669
|
+
nn as useSceneSample,
|
|
1670
|
+
Et as useScreenRectAspect,
|
|
1671
|
+
ps as useXRAsset,
|
|
1672
|
+
Oe as useXRAssetCache,
|
|
1673
|
+
hs as useXRAssetStats,
|
|
1674
|
+
An as useXRCapabilities,
|
|
1675
|
+
_n as useXRQuality,
|
|
1676
|
+
ys as useXRTrackingConfig,
|
|
1677
|
+
Ma as viewportSizeToTransform2DPixels,
|
|
1678
|
+
Ea as viewportToFeed,
|
|
1679
|
+
ba as worldToFeed,
|
|
1680
|
+
Ra as worldToScreenPixels,
|
|
1681
|
+
Aa as worldToTracker
|
|
1450
1682
|
};
|