@ikonai/sdk 1.11.3 → 1.12.0
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/assets/{protocol-worker-Byc-OmNW.js → protocol-worker--zkCPur7.js} +1 -1
- package/assets/{viseme-worker-CmvzHAbf.js → viseme-worker-B6zFPD9n.js} +1 -1
- package/{channel-manager-ehgy3BJp.js → channel-manager-C1NK3o9-.js} +26 -26
- package/client/ikon-client-config.d.ts +19 -12
- package/client/ikon-client-config.d.ts.map +1 -1
- package/client/ikon-client.d.ts +1 -0
- package/client/ikon-client.d.ts.map +1 -1
- package/connection/authenticator.d.ts.map +1 -1
- package/errors/index.d.ts +10 -0
- package/errors/index.d.ts.map +1 -1
- package/functions/browser-functions.d.ts.map +1 -1
- package/functions/sound-functions.d.ts +4 -0
- package/functions/sound-functions.d.ts.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +2630 -2325
- package/media/viseme-tracker.d.ts +16 -5
- package/media/viseme-tracker.d.ts.map +1 -1
- package/package.json +1 -1
- package/upload/file-upload.d.ts +4 -5
- package/upload/file-upload.d.ts.map +1 -1
- package/utils/query-params.d.ts +3 -1
- package/utils/query-params.d.ts.map +1 -1
- package/{viseme-tracker-CAtczW00.js → viseme-tracker-CbDKr_6G.js} +69 -58
- package/{web-transport-support-Cdyk4mQe.js → web-transport-support-DcxJuxz4.js} +28 -22
|
@@ -23,6 +23,7 @@ export declare class VisemeTracker {
|
|
|
23
23
|
private readonly visemeBuffers;
|
|
24
24
|
private visemeDelayMs;
|
|
25
25
|
private readonly _visemeResult;
|
|
26
|
+
private static readonly IDLE_BUFFER_SECONDS;
|
|
26
27
|
constructor(client: IkonClient);
|
|
27
28
|
/**
|
|
28
29
|
* Starts the viseme worker and subscribes to the GROUP_AUDIO protocol stream.
|
|
@@ -45,19 +46,29 @@ export declare class VisemeTracker {
|
|
|
45
46
|
getShapeSetValuesById(streamId: string, setId: number): number[] | null;
|
|
46
47
|
getAllShapeSetValues(streamId: string): Map<number, number[]> | null;
|
|
47
48
|
/**
|
|
48
|
-
* Get current viseme values
|
|
49
|
-
* Uses sample-based timing for precise synchronization with audio playback.
|
|
50
|
-
* Interpolates between viseme keyframes for smooth animation.
|
|
49
|
+
* Get current viseme values, interpolated in step with what this client is hearing.
|
|
51
50
|
*
|
|
52
|
-
*
|
|
51
|
+
* Each speaking playback has its own values: pass `slot` to follow one character (a playback
|
|
52
|
+
* the app played in that slot, e.g. `{ slot: 'aria' }`), or `playbackId` for one playback. With
|
|
53
|
+
* no filter, or several matches, the most recently started playback that is speaking right now
|
|
54
|
+
* wins. `Speak` plays in slot `"speech"` unless the app names another. Poll it once per animation
|
|
55
|
+
* frame; each call returns a new object.
|
|
56
|
+
*
|
|
57
|
+
* @returns Object with mouthOpenY (0-1) and mouthForm (-1 to +1), or null when nothing matching is speaking
|
|
53
58
|
*/
|
|
54
|
-
getCurrentVisemeValues(
|
|
59
|
+
getCurrentVisemeValues(filter?: {
|
|
60
|
+
slot?: string;
|
|
61
|
+
playbackId?: string;
|
|
62
|
+
}): {
|
|
55
63
|
mouthOpenY: number;
|
|
56
64
|
mouthForm: number;
|
|
57
65
|
} | null;
|
|
66
|
+
private sampleBuffer;
|
|
58
67
|
setVisemeDelayMs(delayMs: number): void;
|
|
59
68
|
getVisemeDelayMs(): number;
|
|
60
69
|
private onWorkerMessage;
|
|
61
70
|
private processShapeSetValues;
|
|
71
|
+
private getOrCreateBuffer;
|
|
72
|
+
private pushVisemeFrame;
|
|
62
73
|
}
|
|
63
74
|
//# sourceMappingURL=viseme-tracker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viseme-tracker.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/media/viseme-tracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,aAAa,EAA4B,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1G,OAAO,KAAK,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B,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI;IAIpE;;;;;;;;;;OAUG;IACH,sBAAsB,CAAC,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAmCzH,OAAO,CAAC,YAAY;IAqEpB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIvC,gBAAgB,IAAI,MAAM;IAI1B,OAAO,CAAC,eAAe;IAgCvB,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,iBAAiB;IAuCzB,OAAO,CAAC,eAAe;CA6BxB"}
|
package/package.json
CHANGED
package/upload/file-upload.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface FileUploadRequest {
|
|
|
10
10
|
/** The upload action the app registered (a `FileUploadZone`'s, or one handed to a client function). */
|
|
11
11
|
uploadActionId: string;
|
|
12
12
|
}
|
|
13
|
+
export declare const MAX_CONCURRENT_UPLOADS = 8;
|
|
13
14
|
/**
|
|
14
15
|
* An upload that did not finish. `retriable` separates the failures where sending the same bytes
|
|
15
16
|
* again is likely to work — a stall, a dropped connection — from a verdict the server will simply
|
|
@@ -42,13 +43,11 @@ export declare class UploadAckTracker {
|
|
|
42
43
|
private failure;
|
|
43
44
|
private disposed;
|
|
44
45
|
constructor(client: IkonClient, uploadId: string, signal: AbortSignal);
|
|
45
|
-
/** Resolves once the server has acknowledged this sequence. */
|
|
46
|
-
waitFor(sequenceId: number): Promise<void>;
|
|
47
46
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* Resolves once the server has acknowledged this sequence. Rejects with UploadDisconnectedError
|
|
48
|
+
* when `link` drops, or has already: the ack went out on that link.
|
|
50
49
|
*/
|
|
51
|
-
|
|
50
|
+
waitFor(sequenceId: number, link: AbortSignal): Promise<void>;
|
|
52
51
|
/** Re-points the tracker at the server's resume position after a reconnect. */
|
|
53
52
|
rewindTo(lastAckedSequenceId: number): void;
|
|
54
53
|
dispose(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/upload/file-upload.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/upload/file-upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAuBL,KAAK,yBAAyB,EAM/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,IAAI,GAAG;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,6FAA6F;IAC7F,QAAQ,EAAE,MAAM,CAAC;IACjB,uGAAuG;IACvG,cAAc,EAAE,MAAM,CAAC;CACxB;AAiBD,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAiBxC;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;gBAEhB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO;CAKhD;AAaD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,iBAAiB,GAAG,IAAI,CAMvG;AA4DD,wBAAsB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB9F;AA2iBD;;;;GAIG;AACH,qBAAa,gBAAgB;IAWzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAXzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8E;IACtG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;IACrC,OAAO,CAAC,SAAS,CAA8C;IAC/D,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,QAAQ,CAAS;gBAGvB,MAAM,EAAE,UAAU,EACD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,WAAW;IA8BtC;;;OAGG;IACH,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAiC7D,+EAA+E;IAC/E,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI;IAM3C,OAAO,IAAI,IAAI;IAWf,OAAO,CAAC,KAAK;IAgBb,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,IAAI;IAWZ,6FAA6F;IAC7F,OAAO,CAAC,SAAS;CASlB"}
|
package/utils/query-params.d.ts
CHANGED
|
@@ -24,7 +24,9 @@ import { HttpStreamMode } from '../transport/transport';
|
|
|
24
24
|
* - ikon-video Force video on or off
|
|
25
25
|
* - ikon-webrtc Force WebRTC on or off
|
|
26
26
|
* - ikon-ice-transport WebRTC ICE policy: relay (TURN only) | all
|
|
27
|
-
* - ikon-retry
|
|
27
|
+
* - ikon-retry false cuts /init provisioning to one attempt and goes offline instead of
|
|
28
|
+
* reconnecting or reauthing after a lost connection; the /connect retry
|
|
29
|
+
* loop retries regardless (default true)
|
|
28
30
|
* - ikon-snapshot Connect as a build-time snapshot client; sets Context.IsSnapshot
|
|
29
31
|
* - ikon-signed-out The user signed out; suppresses auto-login for this load
|
|
30
32
|
* - ikon-feedback Open the feedback sheet once the connection is live, as a tap on the button would
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-params.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/utils/query-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D
|
|
1
|
+
{"version":3,"file":"query-params.d.ts","sourceRoot":"","sources":["../../../../sdk/sdk/src/utils/query-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AACzD,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAC7D,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAC/C,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAC7D,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AACnD,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AACvD,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AACnD,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,qBAAqB,cAAc,CAAC;AACjD,eAAO,MAAM,yBAAyB,kBAAkB,CAAC;AACzD,eAAO,MAAM,qBAAqB,cAAc,CAAC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CAEvC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED,4GAA4G;AAC5G,wBAAgB,kBAAkB,IAAI,IAAI,CAiBzC;AAKD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAgBhD"}
|
|
@@ -2,7 +2,7 @@ import { c as e, n as t } from "./logger-gjegmH6K.js";
|
|
|
2
2
|
import { a as n, o as r, r as i } from "./audio-constants-0i9B4zLJ.js";
|
|
3
3
|
//#region src/worker/viseme-worker.ts?worker
|
|
4
4
|
function a(e) {
|
|
5
|
-
return new Worker(new URL("assets/viseme-worker-
|
|
5
|
+
return new Worker(new URL("assets/viseme-worker-B6zFPD9n.js", import.meta.url).href, {
|
|
6
6
|
type: "module",
|
|
7
7
|
name: e?.name
|
|
8
8
|
});
|
|
@@ -23,6 +23,7 @@ var o = t("VisemeTracker"), s = i * 2, c = class t {
|
|
|
23
23
|
mouthOpenY: 0,
|
|
24
24
|
mouthForm: 0
|
|
25
25
|
};
|
|
26
|
+
static IDLE_BUFFER_SECONDS = 30;
|
|
26
27
|
constructor(e) {
|
|
27
28
|
this.client = e;
|
|
28
29
|
}
|
|
@@ -98,27 +99,31 @@ var o = t("VisemeTracker"), s = i * 2, c = class t {
|
|
|
98
99
|
getAllShapeSetValues(e) {
|
|
99
100
|
return this.currentShapeSetValues.get(e) ?? null;
|
|
100
101
|
}
|
|
101
|
-
getCurrentVisemeValues() {
|
|
102
|
-
let
|
|
103
|
-
for (let
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
this._visemeResult.mouthOpenY = l.mouthOpenY + e * (u.mouthOpenY - l.mouthOpenY), this._visemeResult.mouthForm = l.mouthForm + e * (u.mouthForm - l.mouthForm);
|
|
118
|
-
} else this._visemeResult.mouthOpenY = l.mouthOpenY, this._visemeResult.mouthForm = l.mouthForm;
|
|
119
|
-
return this._visemeResult;
|
|
102
|
+
getCurrentVisemeValues(e) {
|
|
103
|
+
let t = performance.now() / 1e3, n = null, r = 0, i = 0;
|
|
104
|
+
for (let a of this.visemeBuffers.values()) (e?.slot === void 0 || a.slot === e.slot) && (e?.playbackId === void 0 || a.playbackId === e.playbackId) && (n && n.playbackStartTime >= a.playbackStartTime || this.sampleBuffer(a, t) && (n = a, r = this._visemeResult.mouthOpenY, i = this._visemeResult.mouthForm));
|
|
105
|
+
return n ? {
|
|
106
|
+
mouthOpenY: r,
|
|
107
|
+
mouthForm: i
|
|
108
|
+
} : null;
|
|
109
|
+
}
|
|
110
|
+
sampleBuffer(e, t) {
|
|
111
|
+
if (!e.timingEstablished || e.count === 0) return !1;
|
|
112
|
+
let n = t - e.playbackStartTime;
|
|
113
|
+
if (n < 0) return !1;
|
|
114
|
+
let i = n * s, a = e.frames, o = e.count, c = (e.head - o + r) % r, l = null, u = null;
|
|
115
|
+
for (let e = 0; e < o; e++) {
|
|
116
|
+
let t = a[(c + e) % r], n = t.samplePosition + Math.max(t.frameSamples, 1);
|
|
117
|
+
if (t.samplePosition <= i && (l = t), n > i && !u && (u = t, t.samplePosition <= i)) break;
|
|
120
118
|
}
|
|
121
|
-
return
|
|
119
|
+
if (!l || i > l.samplePosition + Math.max(l.frameSamples, 1) && !u) return !1;
|
|
120
|
+
if (!u) return this._visemeResult.mouthOpenY = l.mouthOpenY, this._visemeResult.mouthForm = l.mouthForm, !0;
|
|
121
|
+
let d = l.samplePosition, f = d + Math.max(l.frameSamples, 1);
|
|
122
|
+
if (l !== u && u.samplePosition > l.samplePosition && f > d) {
|
|
123
|
+
let e = Math.min(1, Math.max(0, (i - d) / (f - d)));
|
|
124
|
+
this._visemeResult.mouthOpenY = l.mouthOpenY + e * (u.mouthOpenY - l.mouthOpenY), this._visemeResult.mouthForm = l.mouthForm + e * (u.mouthForm - l.mouthForm);
|
|
125
|
+
} else this._visemeResult.mouthOpenY = l.mouthOpenY, this._visemeResult.mouthForm = l.mouthForm;
|
|
126
|
+
return !0;
|
|
122
127
|
}
|
|
123
128
|
setVisemeDelayMs(e) {
|
|
124
129
|
this.visemeDelayMs = Math.min(200, Math.max(n, e));
|
|
@@ -129,24 +134,7 @@ var o = t("VisemeTracker"), s = i * 2, c = class t {
|
|
|
129
134
|
onWorkerMessage(e) {
|
|
130
135
|
if (e.type === "streamBegin") {
|
|
131
136
|
if (this.streamShapeSets.has(e.streamId)) return;
|
|
132
|
-
|
|
133
|
-
let t = Array(r);
|
|
134
|
-
for (let e = 0; e < r; e++) t[e] = {
|
|
135
|
-
samplePosition: 0,
|
|
136
|
-
frameSamples: 0,
|
|
137
|
-
mouthOpenY: 0,
|
|
138
|
-
mouthForm: 0
|
|
139
|
-
};
|
|
140
|
-
this.visemeBuffers.set(e.streamId, {
|
|
141
|
-
frames: t,
|
|
142
|
-
head: 0,
|
|
143
|
-
count: 0,
|
|
144
|
-
playbackStartTime: 0,
|
|
145
|
-
epochTimestampSamples: 0,
|
|
146
|
-
timingEstablished: !1,
|
|
147
|
-
currentEpoch: -1
|
|
148
|
-
});
|
|
149
|
-
}
|
|
137
|
+
e.shapeSets && e.shapeSets.length > 0 && (this.streamShapeSets.set(e.streamId, e.shapeSets), this.currentShapeSetValues.set(e.streamId, /* @__PURE__ */ new Map()));
|
|
150
138
|
return;
|
|
151
139
|
}
|
|
152
140
|
if (e.type === "shapeFrame") {
|
|
@@ -154,28 +142,51 @@ var o = t("VisemeTracker"), s = i * 2, c = class t {
|
|
|
154
142
|
return;
|
|
155
143
|
}
|
|
156
144
|
if (e.type === "streamEnd") {
|
|
157
|
-
this.streamShapeSets.delete(e.streamId), this.currentShapeSetValues.delete(e.streamId)
|
|
145
|
+
this.streamShapeSets.delete(e.streamId), this.currentShapeSetValues.delete(e.streamId);
|
|
146
|
+
for (let [t, n] of this.visemeBuffers) n.streamId === e.streamId && this.visemeBuffers.delete(t);
|
|
158
147
|
return;
|
|
159
148
|
}
|
|
160
149
|
}
|
|
161
|
-
processShapeSetValues(e, t,
|
|
162
|
-
let
|
|
163
|
-
if (
|
|
164
|
-
let
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
let
|
|
169
|
-
if (
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
150
|
+
processShapeSetValues(e, t, n, r, i) {
|
|
151
|
+
let a = this.currentShapeSetValues.get(e);
|
|
152
|
+
if (a) for (let e of i) a.set(e.SetId, e.Values);
|
|
153
|
+
let o = this.streamShapeSets.get(e)?.find((e) => e.Name === "Viseme");
|
|
154
|
+
if (o) for (let a of i) a.SetId !== o.SetId || a.Values.length < 2 || this.pushVisemeFrame(this.getOrCreateBuffer(e, a.PlaybackId ?? "", a.Slot ?? ""), t, n, r, a);
|
|
155
|
+
}
|
|
156
|
+
getOrCreateBuffer(e, n, i) {
|
|
157
|
+
let a = `${e}\n${n}`, o = performance.now() / 1e3, s = this.visemeBuffers.get(a);
|
|
158
|
+
if (s) return s.lastFrameTime = o, s;
|
|
159
|
+
for (let [e, n] of this.visemeBuffers) o - n.lastFrameTime > t.IDLE_BUFFER_SECONDS && this.visemeBuffers.delete(e);
|
|
160
|
+
let c = Array(r);
|
|
161
|
+
for (let e = 0; e < r; e++) c[e] = {
|
|
162
|
+
samplePosition: 0,
|
|
163
|
+
frameSamples: 0,
|
|
164
|
+
mouthOpenY: 0,
|
|
165
|
+
mouthForm: 0
|
|
166
|
+
};
|
|
167
|
+
return s = {
|
|
168
|
+
streamId: e,
|
|
169
|
+
playbackId: n,
|
|
170
|
+
slot: i,
|
|
171
|
+
lastFrameTime: o,
|
|
172
|
+
frames: c,
|
|
173
|
+
head: 0,
|
|
174
|
+
count: 0,
|
|
175
|
+
playbackStartTime: 0,
|
|
176
|
+
epochTimestampSamples: 0,
|
|
177
|
+
timingEstablished: !1,
|
|
178
|
+
currentEpoch: -1
|
|
179
|
+
}, this.visemeBuffers.set(a, s), s;
|
|
180
|
+
}
|
|
181
|
+
pushVisemeFrame(e, t, i, a, o) {
|
|
182
|
+
if (e.currentEpoch !== t && (e.currentEpoch = t, e.timingEstablished = !1, e.count = 0, e.head = 0), !e.timingEstablished) {
|
|
183
|
+
e.epochTimestampSamples = i;
|
|
184
|
+
let t = Math.min(200, Math.max(n, this.visemeDelayMs));
|
|
185
|
+
e.playbackStartTime = performance.now() / 1e3 + t / 1e3, e.timingEstablished = !0;
|
|
186
|
+
}
|
|
187
|
+
if (a > 0) {
|
|
188
|
+
let t = e.frames[e.head];
|
|
189
|
+
t.samplePosition = i - e.epochTimestampSamples, t.frameSamples = a, t.mouthOpenY = o.Values[0], t.mouthForm = o.Values[1], e.head = (e.head + 1) % r, e.count < 1500 && e.count++;
|
|
179
190
|
}
|
|
180
191
|
}
|
|
181
192
|
};
|
|
@@ -28,33 +28,39 @@ var e = class extends Error {
|
|
|
28
28
|
constructor(e) {
|
|
29
29
|
super(`App session provisioning timeout after ${e}ms`), this.name = "ProvisioningTimeoutError";
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, te = class extends t {
|
|
32
32
|
constructor(e = "The app failed to start") {
|
|
33
33
|
super(e), this.name = "AppStartupFailedError";
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, ne = class extends t {
|
|
36
36
|
constructor(e) {
|
|
37
37
|
super(`Space not found for domain: ${e}`), this.name = "SpaceNotFoundError";
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, o = class extends t {
|
|
40
40
|
reason;
|
|
41
41
|
constructor(e, t) {
|
|
42
42
|
super(e), this.reason = t, this.name = "AccessDeniedError";
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, s = class extends o {
|
|
45
45
|
connectionId;
|
|
46
46
|
constructor(e, t, n) {
|
|
47
47
|
super(e, t), this.connectionId = n, this.name = "SsoRequiredError";
|
|
48
48
|
}
|
|
49
|
-
},
|
|
49
|
+
}, c = class extends t {
|
|
50
50
|
constructor(e) {
|
|
51
51
|
super(e), this.name = "CredentialRejectedError";
|
|
52
52
|
}
|
|
53
|
-
},
|
|
53
|
+
}, l = class extends t {
|
|
54
54
|
sessionIdentityHash;
|
|
55
55
|
constructor(e) {
|
|
56
56
|
super(`No live app session for sessionIdentityHash ${e}`), this.sessionIdentityHash = e, this.name = "SessionNotFoundError";
|
|
57
57
|
}
|
|
58
|
+
}, u = class extends t {
|
|
59
|
+
spaceId;
|
|
60
|
+
retryAfterMs;
|
|
61
|
+
constructor(e, t) {
|
|
62
|
+
super(`No live app session to join in space ${e}`), this.spaceId = e, this.retryAfterMs = t, this.name = "NoLiveSessionError";
|
|
63
|
+
}
|
|
58
64
|
}, d = class extends t {
|
|
59
65
|
constructor(e) {
|
|
60
66
|
super(e), this.name = "ServerFullError";
|
|
@@ -125,10 +131,10 @@ function W() {
|
|
|
125
131
|
mode: i
|
|
126
132
|
};
|
|
127
133
|
}
|
|
128
|
-
function
|
|
134
|
+
function re() {
|
|
129
135
|
return R(b) === !0;
|
|
130
136
|
}
|
|
131
|
-
function
|
|
137
|
+
function G() {
|
|
132
138
|
return L(C);
|
|
133
139
|
}
|
|
134
140
|
function K() {
|
|
@@ -159,35 +165,35 @@ function Y() {
|
|
|
159
165
|
function X() {
|
|
160
166
|
return R(E);
|
|
161
167
|
}
|
|
162
|
-
function
|
|
168
|
+
function ie() {
|
|
163
169
|
let e = L(D);
|
|
164
170
|
return e === "relay" ? "relay" : e === "all" ? "all" : null;
|
|
165
171
|
}
|
|
166
|
-
function
|
|
172
|
+
function ae() {
|
|
167
173
|
return R(S) === !0;
|
|
168
174
|
}
|
|
169
|
-
function
|
|
175
|
+
function oe() {
|
|
170
176
|
return R(x) === !0;
|
|
171
177
|
}
|
|
172
|
-
function
|
|
178
|
+
function se() {
|
|
173
179
|
return R(y);
|
|
174
180
|
}
|
|
175
|
-
function
|
|
181
|
+
function ce() {
|
|
176
182
|
return R(O) !== !1;
|
|
177
183
|
}
|
|
178
|
-
function
|
|
184
|
+
function Z() {
|
|
179
185
|
return R(k) === !0;
|
|
180
186
|
}
|
|
181
|
-
function
|
|
187
|
+
function le() {
|
|
182
188
|
return L(v);
|
|
183
189
|
}
|
|
184
|
-
function
|
|
190
|
+
function ue() {
|
|
185
191
|
return z(A);
|
|
186
192
|
}
|
|
187
|
-
function
|
|
193
|
+
function de() {
|
|
188
194
|
return z(j);
|
|
189
195
|
}
|
|
190
|
-
function
|
|
196
|
+
function fe() {
|
|
191
197
|
if (typeof window > "u") return;
|
|
192
198
|
let e = new URL(window.location.href), t = [j, j.replace(/-/g, "_")];
|
|
193
199
|
if (t.some((t) => e.searchParams.has(t))) {
|
|
@@ -196,7 +202,7 @@ function de() {
|
|
|
196
202
|
}
|
|
197
203
|
}
|
|
198
204
|
var Q = "ikon-test-link", $ = null;
|
|
199
|
-
function
|
|
205
|
+
function pe() {
|
|
200
206
|
let e = L(M);
|
|
201
207
|
try {
|
|
202
208
|
return e ? (sessionStorage.setItem(Q, e), e) : sessionStorage.getItem(Q) ?? $;
|
|
@@ -206,7 +212,7 @@ function fe() {
|
|
|
206
212
|
}
|
|
207
213
|
//#endregion
|
|
208
214
|
//#region src/utils/delay.ts
|
|
209
|
-
function
|
|
215
|
+
function me(e, t) {
|
|
210
216
|
return new Promise((n, r) => {
|
|
211
217
|
let i = () => {
|
|
212
218
|
clearTimeout(a), r(new DOMException("Aborted", "AbortError"));
|
|
@@ -222,8 +228,8 @@ function pe(e, t) {
|
|
|
222
228
|
}
|
|
223
229
|
//#endregion
|
|
224
230
|
//#region src/transport/web-transport-support.ts
|
|
225
|
-
function
|
|
231
|
+
function he() {
|
|
226
232
|
return typeof WebTransport < "u";
|
|
227
233
|
}
|
|
228
234
|
//#endregion
|
|
229
|
-
export { r as $,
|
|
235
|
+
export { r as $, de as A, Z as B, T as C, K as D, J as E, q as F, B as G, W as H, ce as I, i as J, o as K, se as L, ae as M, G as N, oe as O, V as P, c as Q, le as R, g as S, fe as T, Y as U, pe as V, X as W, p as X, t as Y, e as Z, y as _, b as a, f as at, k as b, D as c, s as ct, P as d, a as et, I as f, O as g, h, _ as i, d as it, ie as j, re as k, S as l, n as lt, N as m, me as n, m as nt, x as o, l as ot, F as p, te as q, w as r, ee as rt, j as s, ne as st, he as t, u as tt, C as u, v, E as w, M as x, A as y, ue as z };
|