@ikonai/sdk 1.0.34 → 1.0.36
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/{audio-playback-worker-CVB6ftYO.js → audio-playback-worker-Box5TifN.js} +207 -207
- package/assets/{protocol-worker-Df11kdu1.js → protocol-worker-C3oOno6C.js} +114 -114
- package/assets/{video-capture-worker-g7UF_osl.js → video-capture-worker-reG7QGzz.js} +176 -176
- package/assets/{video-playback-worker-eGtjWcFg.js → video-playback-worker-CpHuZKgE.js} +404 -404
- package/client/endpoint-selector.d.ts +2 -2
- package/client/ikon-client-config.d.ts +10 -4
- package/functions/function-registry.d.ts +8 -1
- package/index.js +1897 -1753
- package/package.json +1 -1
|
@@ -3,20 +3,20 @@ function $(t) {
|
|
|
3
3
|
throw new Error("Protocol message too short");
|
|
4
4
|
return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function p(t) {
|
|
7
7
|
return $(t) & 4294901760;
|
|
8
8
|
}
|
|
9
9
|
function X(t) {
|
|
10
10
|
const e = Et(t), s = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
11
11
|
if (e.length < 27)
|
|
12
12
|
throw new Error("Protocol payload too short");
|
|
13
|
-
const r = s.getUint32(0, !0), i = s.getUint32(4, !0), n = s.getUint32(8, !0), a = s.getUint32(12, !0), o = s.getUint32(16, !0), l = s.getUint32(20, !0), h = s.getUint8(24),
|
|
13
|
+
const r = s.getUint32(0, !0), i = s.getUint32(4, !0), n = s.getUint32(8, !0), a = s.getUint32(12, !0), o = s.getUint32(16, !0), l = s.getUint32(20, !0), h = s.getUint8(24), f = s.getUint8(25), _ = s.getUint8(26);
|
|
14
14
|
if (27 + l * 4 > e.length)
|
|
15
15
|
throw new Error("Protocol header exceeds payload length");
|
|
16
16
|
const T = [];
|
|
17
|
-
let
|
|
18
|
-
for (let
|
|
19
|
-
T.push(s.getUint32(
|
|
17
|
+
let b = 27;
|
|
18
|
+
for (let d = 0; d < l; d++)
|
|
19
|
+
T.push(s.getUint32(b, !0)), b += 4;
|
|
20
20
|
return {
|
|
21
21
|
length: r,
|
|
22
22
|
opcode: i,
|
|
@@ -25,26 +25,26 @@ function X(t) {
|
|
|
25
25
|
sequenceId: o,
|
|
26
26
|
targetIds: T,
|
|
27
27
|
payloadVersion: h,
|
|
28
|
-
payloadType:
|
|
28
|
+
payloadType: f,
|
|
29
29
|
flags: _
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
function it(t, e, s, r, i) {
|
|
33
|
-
const l = [],
|
|
33
|
+
const l = [], f = 27 + l.length * 4, _ = f + e.length, O = new Uint8Array(_), T = new DataView(O.buffer);
|
|
34
34
|
T.setUint32(0, _, !0), T.setUint32(4, t >>> 0, !0), T.setUint32(8, r >>> 0, !0), T.setUint32(12, 0, !0), T.setUint32(16, 0, !0), T.setUint32(20, l.length >>> 0, !0), T.setUint8(24, s & 255), T.setUint8(25, 8), T.setUint8(26, 0);
|
|
35
|
-
let
|
|
36
|
-
for (let
|
|
37
|
-
T.setUint32(
|
|
38
|
-
return
|
|
35
|
+
let b = 27;
|
|
36
|
+
for (let d = 0; d < l.length; d++)
|
|
37
|
+
T.setUint32(b, l[d] >>> 0, !0), b += 4;
|
|
38
|
+
return O.set(e, f), O;
|
|
39
39
|
}
|
|
40
|
-
var
|
|
40
|
+
var L = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(L || {});
|
|
41
41
|
const nt = 161, at = 162, G = new TextEncoder();
|
|
42
42
|
new TextDecoder("utf-8", { fatal: !0 });
|
|
43
43
|
class B {
|
|
44
44
|
constructor(e = 1) {
|
|
45
45
|
this.version = e, this.buffer.writeByte(nt), this.buffer.writeVarUInt(e >>> 0);
|
|
46
46
|
}
|
|
47
|
-
buffer = new
|
|
47
|
+
buffer = new P();
|
|
48
48
|
closed = !1;
|
|
49
49
|
cached;
|
|
50
50
|
writeInt32Field(e, s) {
|
|
@@ -109,14 +109,14 @@ class B {
|
|
|
109
109
|
this.writeFieldHeader(e, s, r.length), this.buffer.writeBytes(r);
|
|
110
110
|
}
|
|
111
111
|
writeFieldHeader(e, s, r) {
|
|
112
|
-
this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(
|
|
112
|
+
this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(V(s)), lt(s) && this.buffer.writeVarUInt(r >>> 0);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
class k {
|
|
116
116
|
constructor(e) {
|
|
117
117
|
this.elementType = e;
|
|
118
118
|
}
|
|
119
|
-
payload = new
|
|
119
|
+
payload = new P();
|
|
120
120
|
count = 0;
|
|
121
121
|
writeInt32(e) {
|
|
122
122
|
this.ensureElementType(
|
|
@@ -215,19 +215,19 @@ class k {
|
|
|
215
215
|
this.payload.writeBytes(n);
|
|
216
216
|
}
|
|
217
217
|
finish() {
|
|
218
|
-
const e = new
|
|
219
|
-
return e.writeByte(
|
|
218
|
+
const e = new P();
|
|
219
|
+
return e.writeByte(V(this.elementType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
|
|
220
220
|
}
|
|
221
221
|
ensureElementType(e) {
|
|
222
222
|
if (this.elementType !== e)
|
|
223
|
-
throw new Error(`Array element type is ${
|
|
223
|
+
throw new Error(`Array element type is ${L[this.elementType]}, expected ${L[e]}`);
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
class Q {
|
|
227
227
|
constructor(e, s) {
|
|
228
228
|
this.keyType = e, this.valueType = s, ht(e);
|
|
229
229
|
}
|
|
230
|
-
payload = new
|
|
230
|
+
payload = new P();
|
|
231
231
|
count = 0;
|
|
232
232
|
entryOpen = !1;
|
|
233
233
|
beginEntry() {
|
|
@@ -240,8 +240,8 @@ class Q {
|
|
|
240
240
|
finish() {
|
|
241
241
|
if (this.entryOpen)
|
|
242
242
|
throw new Error("Dictionary entry not completed");
|
|
243
|
-
const e = new
|
|
244
|
-
return e.writeByte(
|
|
243
|
+
const e = new P();
|
|
244
|
+
return e.writeByte(V(this.keyType)), e.writeByte(V(this.valueType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
class ot {
|
|
@@ -428,11 +428,11 @@ class ot {
|
|
|
428
428
|
}
|
|
429
429
|
ensureKeyType(e) {
|
|
430
430
|
if (this.keyType !== e)
|
|
431
|
-
throw new Error(`Dictionary key type is ${
|
|
431
|
+
throw new Error(`Dictionary key type is ${L[this.keyType]}, expected ${L[e]}`);
|
|
432
432
|
}
|
|
433
433
|
ensureValueType(e) {
|
|
434
434
|
if (this.valueType !== e)
|
|
435
|
-
throw new Error(`Dictionary value type is ${
|
|
435
|
+
throw new Error(`Dictionary value type is ${L[this.valueType]}, expected ${L[e]}`);
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
class E {
|
|
@@ -505,13 +505,13 @@ class E {
|
|
|
505
505
|
return (e >>> 0).toString(16).padStart(s, "0");
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
|
-
class
|
|
508
|
+
class P {
|
|
509
509
|
static INITIAL_CAPACITY = 256;
|
|
510
510
|
buffer;
|
|
511
511
|
dataView;
|
|
512
512
|
length = 0;
|
|
513
513
|
constructor() {
|
|
514
|
-
this.buffer = new Uint8Array(
|
|
514
|
+
this.buffer = new Uint8Array(P.INITIAL_CAPACITY), this.dataView = new DataView(this.buffer.buffer);
|
|
515
515
|
}
|
|
516
516
|
ensureCapacity(e) {
|
|
517
517
|
const s = this.length + e;
|
|
@@ -557,7 +557,7 @@ class m {
|
|
|
557
557
|
return this.buffer.slice(0, this.length);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function V(t, e = 0) {
|
|
561
561
|
if ((e & 240) !== 0)
|
|
562
562
|
throw new Error("Teleport flags must fit into 4 bits");
|
|
563
563
|
return (t & 15) << 4 | e & 15;
|
|
@@ -575,7 +575,7 @@ function j(t) {
|
|
|
575
575
|
function Et(t) {
|
|
576
576
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
577
577
|
}
|
|
578
|
-
var R = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.WebSocket = 1] = "WebSocket", t[t.WebSocketProxy = 2] = "WebSocketProxy", t[t.WebTransport = 4] = "WebTransport", t[t.WebTransportProxy = 8] = "WebTransportProxy", t[t.Tcp = 16] = "Tcp", t[t.TcpProxy = 32] = "TcpProxy", t[t.Https = 64] = "Https", t[t.WebRTC = 128] = "WebRTC", t[t.TcpTls = 256] = "TcpTls", t))(R || {}), P = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(P || {});
|
|
578
|
+
var R = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.WebSocket = 1] = "WebSocket", t[t.WebSocketProxy = 2] = "WebSocketProxy", t[t.WebTransport = 4] = "WebTransport", t[t.WebTransportProxy = 8] = "WebTransportProxy", t[t.Tcp = 16] = "Tcp", t[t.TcpProxy = 32] = "TcpProxy", t[t.Https = 64] = "Https", t[t.WebRTC = 128] = "WebRTC", t[t.TcpTls = 256] = "TcpTls", t))(R || {}), m = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", t[t.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", t[t.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", t[t.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", t[t.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", t[t.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(m || {});
|
|
579
579
|
const J = 1, _t = 131074;
|
|
580
580
|
function Z(t) {
|
|
581
581
|
return {};
|
|
@@ -592,22 +592,22 @@ class et extends Error {
|
|
|
592
592
|
super(e), this.cause = s, this.name = "ConnectionError";
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
class
|
|
595
|
+
class g extends et {
|
|
596
596
|
constructor(e, s) {
|
|
597
597
|
super(e, s), this.name = "TransportError";
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
class z extends
|
|
600
|
+
class z extends g {
|
|
601
601
|
constructor(e) {
|
|
602
602
|
super(`No keepalive received within ${e}ms`), this.name = "KeepaliveTimeoutError";
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
class
|
|
605
|
+
class It extends et {
|
|
606
606
|
constructor(e) {
|
|
607
607
|
super(`Maximum reconnection attempts (${e}) exceeded`), this.name = "MaxRetriesExceededError";
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function ct(t, e) {
|
|
611
611
|
return new Promise((s, r) => {
|
|
612
612
|
const i = () => {
|
|
613
613
|
clearTimeout(n), r(new Error("Aborted"));
|
|
@@ -622,18 +622,18 @@ function It(t, e) {
|
|
|
622
622
|
});
|
|
623
623
|
}
|
|
624
624
|
let ut = 1;
|
|
625
|
-
const At = /* @__PURE__ */ new Map(),
|
|
625
|
+
const At = /* @__PURE__ */ new Map(), Ct = {
|
|
626
626
|
0: "DEBUG",
|
|
627
627
|
1: "INFO",
|
|
628
628
|
2: "WARN",
|
|
629
629
|
3: "ERROR",
|
|
630
630
|
4: "NONE"
|
|
631
631
|
};
|
|
632
|
-
function
|
|
632
|
+
function Nt(t, e) {
|
|
633
633
|
return `[${t}] ${e}`;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
const i = (/* @__PURE__ */ new Date()).toISOString(), n =
|
|
635
|
+
function M(t, e, s, r) {
|
|
636
|
+
const i = (/* @__PURE__ */ new Date()).toISOString(), n = Ct[t], a = {
|
|
637
637
|
timestamp: i,
|
|
638
638
|
level: t,
|
|
639
639
|
levelName: n,
|
|
@@ -650,7 +650,7 @@ function F(t, e, s, r) {
|
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
652
|
if (ut <= t) {
|
|
653
|
-
const o =
|
|
653
|
+
const o = Nt(e, s);
|
|
654
654
|
switch (t) {
|
|
655
655
|
case 0:
|
|
656
656
|
console.debug(o, ...r);
|
|
@@ -667,23 +667,23 @@ function F(t, e, s, r) {
|
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function F(t) {
|
|
671
671
|
return {
|
|
672
672
|
debug(e, ...s) {
|
|
673
|
-
|
|
673
|
+
M(0, t, e, s);
|
|
674
674
|
},
|
|
675
675
|
info(e, ...s) {
|
|
676
|
-
|
|
676
|
+
M(1, t, e, s);
|
|
677
677
|
},
|
|
678
678
|
warn(e, ...s) {
|
|
679
|
-
|
|
679
|
+
M(2, t, e, s);
|
|
680
680
|
},
|
|
681
681
|
error(e, ...s) {
|
|
682
|
-
|
|
682
|
+
M(3, t, e, s);
|
|
683
683
|
}
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
|
-
const W =
|
|
686
|
+
const W = F("WebSocketTransport"), ft = 1e4;
|
|
687
687
|
class Rt {
|
|
688
688
|
ws = null;
|
|
689
689
|
keepaliveTimeout = null;
|
|
@@ -704,28 +704,28 @@ class Rt {
|
|
|
704
704
|
try {
|
|
705
705
|
this.ws = new WebSocket(e), this.ws.binaryType = "arraybuffer";
|
|
706
706
|
} catch (h) {
|
|
707
|
-
i(new
|
|
707
|
+
i(new g(`Failed to create WebSocket: ${h}`, h instanceof Error ? h : void 0));
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
710
710
|
let n = !1, a = !1;
|
|
711
711
|
const o = () => {
|
|
712
712
|
clearTimeout(l), this.ws && (this.ws.onopen = null, this.ws.onerror = null, this.ws.onclose = null, this.ws.onmessage = null);
|
|
713
713
|
}, l = setTimeout(() => {
|
|
714
|
-
a || (a = !0, o(), this.ws?.close(), i(new
|
|
715
|
-
},
|
|
714
|
+
a || (a = !0, o(), this.ws?.close(), i(new g("WebSocket connection timeout")));
|
|
715
|
+
}, ft);
|
|
716
716
|
this.ws.onopen = () => {
|
|
717
717
|
n = !0, clearTimeout(l), this.ws.send(s), this.resetKeepaliveTimeout(), a || (a = !0, r());
|
|
718
718
|
}, this.ws.onerror = () => {
|
|
719
|
-
clearTimeout(l), a || (a = !0, o(), i(new
|
|
719
|
+
clearTimeout(l), a || (a = !0, o(), i(new g("WebSocket connection failed")));
|
|
720
720
|
}, this.ws.onclose = (h) => {
|
|
721
721
|
if (this.clearKeepaliveTimeout(), !n && !a) {
|
|
722
|
-
a = !0, o(), i(new
|
|
722
|
+
a = !0, o(), i(new g("WebSocket connection closed before opening"));
|
|
723
723
|
return;
|
|
724
724
|
}
|
|
725
725
|
if (this.isClosed)
|
|
726
726
|
return;
|
|
727
|
-
const
|
|
728
|
-
this.callbacks.onClose(
|
|
727
|
+
const f = h.wasClean && (h.code === 1e3 || h.code === 1001), _ = h.code === 1e3 || h.code === 1001, O = h.reason || `code=${h.code}`;
|
|
728
|
+
this.callbacks.onClose(O, f, _);
|
|
729
729
|
}, this.ws.onmessage = (h) => {
|
|
730
730
|
this.handleProtocolMessage(new Uint8Array(h.data));
|
|
731
731
|
};
|
|
@@ -745,7 +745,7 @@ class Rt {
|
|
|
745
745
|
}
|
|
746
746
|
handleProtocolMessage(e) {
|
|
747
747
|
try {
|
|
748
|
-
if (X(e).opcode ===
|
|
748
|
+
if (X(e).opcode === m.KEEPALIVE_REQUEST) {
|
|
749
749
|
this.send(this.getKeepaliveResponse()), this.resetKeepaliveTimeout();
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
@@ -763,7 +763,7 @@ class Rt {
|
|
|
763
763
|
this.keepaliveTimeout && (clearTimeout(this.keepaliveTimeout), this.keepaliveTimeout = null);
|
|
764
764
|
}
|
|
765
765
|
}
|
|
766
|
-
const y =
|
|
766
|
+
const y = F("WebTransportTransport"), q = 4, yt = 65536;
|
|
767
767
|
function st() {
|
|
768
768
|
return typeof WebTransport < "u";
|
|
769
769
|
}
|
|
@@ -795,7 +795,7 @@ class St {
|
|
|
795
795
|
}
|
|
796
796
|
async connect(e, s) {
|
|
797
797
|
if (!st())
|
|
798
|
-
throw new
|
|
798
|
+
throw new g("WebTransport is not supported in this browser");
|
|
799
799
|
this.isClosed = !1;
|
|
800
800
|
try {
|
|
801
801
|
this.transport = new WebTransport(e), await this.transport.ready, y.debug(`Connected to WebTransport entrypoint: ${e}`), this.transport.closed.then(() => {
|
|
@@ -804,7 +804,7 @@ class St {
|
|
|
804
804
|
y.error("WebTransport connection closed with error:", r), this.handleClose(r.message || "Connection error", !1);
|
|
805
805
|
}), this.stream = await this.transport.createBidirectionalStream(), this.reader = this.stream.readable.getReader(), this.writer = this.stream.writable.getWriter(), await this.writer.write(s), this.resetKeepaliveTimeout(), this.startReadLoop();
|
|
806
806
|
} catch (r) {
|
|
807
|
-
throw this.cleanup(), new
|
|
807
|
+
throw this.cleanup(), new g(`Failed to connect WebTransport: ${r}`, r instanceof Error ? r : void 0);
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
810
|
send(e) {
|
|
@@ -890,7 +890,7 @@ class St {
|
|
|
890
890
|
*/
|
|
891
891
|
handleProtocolMessage(e) {
|
|
892
892
|
try {
|
|
893
|
-
if (X(e).opcode ===
|
|
893
|
+
if (X(e).opcode === m.KEEPALIVE_REQUEST) {
|
|
894
894
|
this.send(this.getKeepaliveResponse()), this.resetKeepaliveTimeout();
|
|
895
895
|
return;
|
|
896
896
|
}
|
|
@@ -932,7 +932,7 @@ class St {
|
|
|
932
932
|
}
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
|
-
const K =
|
|
935
|
+
const K = F("Channel");
|
|
936
936
|
class Ut {
|
|
937
937
|
state = "disconnected";
|
|
938
938
|
transport = null;
|
|
@@ -1036,7 +1036,7 @@ class Ut {
|
|
|
1036
1036
|
handleProtocolMessage(e) {
|
|
1037
1037
|
try {
|
|
1038
1038
|
const s = e;
|
|
1039
|
-
if ($(s) ===
|
|
1039
|
+
if ($(s) === m.CORE_ON_SERVER_STOPPING) {
|
|
1040
1040
|
K.debug("Received server stopping message"), this.setState("stopped"), this.transport?.close();
|
|
1041
1041
|
return;
|
|
1042
1042
|
}
|
|
@@ -1064,7 +1064,7 @@ class Ut {
|
|
|
1064
1064
|
this.state !== e && (this.state = e, this.config.onStateChange?.(e));
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
|
-
const
|
|
1067
|
+
const I = F("ChannelManager");
|
|
1068
1068
|
class wt {
|
|
1069
1069
|
channels = /* @__PURE__ */ new Map();
|
|
1070
1070
|
// keyed by opcode group
|
|
@@ -1116,13 +1116,13 @@ class wt {
|
|
|
1116
1116
|
* The opcode group is extracted from the message automatically.
|
|
1117
1117
|
*/
|
|
1118
1118
|
sendProtocolMessage(e) {
|
|
1119
|
-
const s =
|
|
1119
|
+
const s = p(e);
|
|
1120
1120
|
for (const [r, i] of this.channels)
|
|
1121
1121
|
if (r & s) {
|
|
1122
1122
|
i.send(e);
|
|
1123
1123
|
return;
|
|
1124
1124
|
}
|
|
1125
|
-
this.state === "connected" &&
|
|
1125
|
+
this.state === "connected" && I.warn("No channel found for message");
|
|
1126
1126
|
}
|
|
1127
1127
|
/**
|
|
1128
1128
|
* Send a protocol message to all channels (for broadcast messages).
|
|
@@ -1150,16 +1150,16 @@ class wt {
|
|
|
1150
1150
|
this.setState("connecting");
|
|
1151
1151
|
let s = this.entrypoints;
|
|
1152
1152
|
if (this.config.webRtcEnabled) {
|
|
1153
|
-
|
|
1153
|
+
I.debug(`WebRTC enabled, filtering entrypoints (total: ${this.entrypoints.length})`);
|
|
1154
1154
|
for (const a of this.entrypoints)
|
|
1155
|
-
|
|
1156
|
-
const n =
|
|
1155
|
+
I.debug(` Entrypoint: type=${a.Type} fromServer=0x${a.OpcodeGroupsFromServer.toString(16)} toServer=0x${a.OpcodeGroupsToServer.toString(16)} uri=${a.Uri}`);
|
|
1156
|
+
const n = m.GROUP_AUDIO | m.GROUP_VIDEO;
|
|
1157
1157
|
s = this.entrypoints.filter((a) => {
|
|
1158
1158
|
if (a.Type === R.WebRTC)
|
|
1159
|
-
return
|
|
1159
|
+
return I.debug(` Filtered out WebRTC entrypoint (type=${a.Type})`), !1;
|
|
1160
1160
|
const o = a.OpcodeGroupsFromServer | a.OpcodeGroupsToServer;
|
|
1161
|
-
return (o & ~n) === 0 ? (
|
|
1162
|
-
}),
|
|
1161
|
+
return (o & ~n) === 0 ? (I.debug(` Filtered out audio/video-only entrypoint (type=${a.Type}, groups=0x${o.toString(16)})`), !1) : !0;
|
|
1162
|
+
}), I.debug(`After filtering: ${s.length} entrypoints remain for WS/WT channels`);
|
|
1163
1163
|
}
|
|
1164
1164
|
const r = this.groupByType(s);
|
|
1165
1165
|
if (r.size === 0)
|
|
@@ -1181,7 +1181,7 @@ class wt {
|
|
|
1181
1181
|
await this.connectAllChannels(a), this.config.endpointSelector?.rememberWorkingType(n), this.config.onRememberWorkingType?.(n), this.activeType = n, this.startStabilityTimer(), this.setState("connected");
|
|
1182
1182
|
return;
|
|
1183
1183
|
} catch (o) {
|
|
1184
|
-
|
|
1184
|
+
I.warn(`Failed to connect using ${R[n]}: ${o instanceof Error ? o.message : o}`), this.disconnectAll();
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
1187
1187
|
throw e || this.setState("offline"), new Error("Failed to connect using any endpoint type");
|
|
@@ -1247,10 +1247,10 @@ class wt {
|
|
|
1247
1247
|
handleChannelClose(e, s, r, i) {
|
|
1248
1248
|
if (!(this.state === "idle" || this.state === "stopped" || this.state === "offline") && this.channels.has(e)) {
|
|
1249
1249
|
if (i) {
|
|
1250
|
-
|
|
1250
|
+
I.debug("Channel closed by server"), this.shouldReconnect = !1, this.disconnectAll(), this.setState("stopped");
|
|
1251
1251
|
return;
|
|
1252
1252
|
}
|
|
1253
|
-
this.state === "connected" && (!this.connectionStable && this.activeType !== null && (
|
|
1253
|
+
this.state === "connected" && (!this.connectionStable && this.activeType !== null && (I.warn(`Connection unstable with ${R[this.activeType]}, demoting`), this.demotedTypes.add(this.activeType)), I.warn("Channel closed unexpectedly, attempting reconnect"), this.disconnectAll(), this.attemptReconnect());
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
1256
|
/**
|
|
@@ -1260,10 +1260,10 @@ class wt {
|
|
|
1260
1260
|
async attemptReconnect() {
|
|
1261
1261
|
if (this.shouldReconnect) {
|
|
1262
1262
|
if (this.reconnectAttempts >= this.config.maxReconnectAttempts) {
|
|
1263
|
-
|
|
1263
|
+
I.warn(`Max reconnect attempts (${this.config.maxReconnectAttempts}) reached`), this.setState("offline"), this.config.onError?.(new It(this.config.maxReconnectAttempts));
|
|
1264
1264
|
return;
|
|
1265
1265
|
}
|
|
1266
|
-
if (this.setState("reconnecting"), this.reconnectAttempts++, this.reconnectAttempts > 1 ? (
|
|
1266
|
+
if (this.setState("reconnecting"), this.reconnectAttempts++, this.reconnectAttempts > 1 ? (I.info(`Reconnecting in ${this.config.reconnectBackoffMs}ms (attempt ${this.reconnectAttempts}/${this.config.maxReconnectAttempts})`), await ct(this.config.reconnectBackoffMs, this.abortController?.signal)) : I.info(`Reconnecting immediately (attempt ${this.reconnectAttempts}/${this.config.maxReconnectAttempts})`), !!this.shouldReconnect)
|
|
1267
1267
|
try {
|
|
1268
1268
|
await this.connectInternal(!0);
|
|
1269
1269
|
} catch {
|
|
@@ -1302,11 +1302,11 @@ class wt {
|
|
|
1302
1302
|
this.state !== e && (this.state = e, this.config.onStateChange?.(e));
|
|
1303
1303
|
}
|
|
1304
1304
|
}
|
|
1305
|
-
const rt =
|
|
1305
|
+
const rt = F("ProtocolWorker"), w = (t, e) => {
|
|
1306
1306
|
self.postMessage(t, e ?? []);
|
|
1307
1307
|
};
|
|
1308
1308
|
let A = null, H, u = null;
|
|
1309
|
-
const U = [],
|
|
1309
|
+
const U = [], C = [], D = /* @__PURE__ */ new Map(), N = [], c = [], S = /* @__PURE__ */ new Map(), x = [];
|
|
1310
1310
|
function Y() {
|
|
1311
1311
|
try {
|
|
1312
1312
|
A?.disconnect();
|
|
@@ -1314,64 +1314,64 @@ function Y() {
|
|
|
1314
1314
|
rt.warn(`Failed to disconnect channel manager: ${t}`);
|
|
1315
1315
|
}
|
|
1316
1316
|
A = null;
|
|
1317
|
-
for (let t = 0; t <
|
|
1317
|
+
for (let t = 0; t < C.length; t++)
|
|
1318
1318
|
try {
|
|
1319
|
-
|
|
1319
|
+
C[t].port.close();
|
|
1320
1320
|
} catch {
|
|
1321
1321
|
}
|
|
1322
|
-
U.length = 0,
|
|
1323
|
-
for (let t = 0; t <
|
|
1322
|
+
U.length = 0, C.length = 0, D.clear();
|
|
1323
|
+
for (let t = 0; t < c.length; t++)
|
|
1324
1324
|
try {
|
|
1325
|
-
|
|
1325
|
+
c[t].port.close();
|
|
1326
1326
|
} catch {
|
|
1327
1327
|
}
|
|
1328
|
-
|
|
1328
|
+
N.length = 0, c.length = 0, S.clear();
|
|
1329
1329
|
}
|
|
1330
1330
|
function v(t) {
|
|
1331
1331
|
const e = t instanceof Error ? t : new Error(String(t));
|
|
1332
1332
|
w({ type: "error", error: { name: e.name, message: e.message, stack: e.stack } });
|
|
1333
1333
|
}
|
|
1334
|
-
function
|
|
1334
|
+
function Lt() {
|
|
1335
1335
|
let t = 0;
|
|
1336
|
-
for (let e = 0; e <
|
|
1337
|
-
t |=
|
|
1336
|
+
for (let e = 0; e < C.length; e++)
|
|
1337
|
+
t |= C[e].opcodeGroupsMask;
|
|
1338
1338
|
return t;
|
|
1339
1339
|
}
|
|
1340
|
-
function
|
|
1340
|
+
function gt(t) {
|
|
1341
1341
|
if (H === void 0)
|
|
1342
1342
|
return !0;
|
|
1343
|
-
const e =
|
|
1343
|
+
const e = p(t);
|
|
1344
1344
|
if ((e & H) !== 0)
|
|
1345
1345
|
return !0;
|
|
1346
|
-
const s =
|
|
1346
|
+
const s = Lt();
|
|
1347
1347
|
return (e & s) !== 0;
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1349
|
+
function Pt(t) {
|
|
1350
1350
|
x.length = 0;
|
|
1351
|
-
for (let e = 0; e <
|
|
1352
|
-
const s =
|
|
1351
|
+
for (let e = 0; e < C.length; e++) {
|
|
1352
|
+
const s = C[e];
|
|
1353
1353
|
(s.opcodeGroupsMask & t) !== 0 && x.push(s.port);
|
|
1354
1354
|
}
|
|
1355
1355
|
return x;
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1358
|
-
return (
|
|
1357
|
+
function mt(t, e) {
|
|
1358
|
+
return (p(t) & e) !== 0;
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1360
|
+
function Ot(t, e) {
|
|
1361
1361
|
if (!A || !e || typeof e != "object")
|
|
1362
1362
|
return;
|
|
1363
1363
|
const s = e;
|
|
1364
1364
|
if (!(s.type !== "send" || !(s.message instanceof ArrayBuffer)))
|
|
1365
1365
|
try {
|
|
1366
1366
|
const r = new Uint8Array(s.message);
|
|
1367
|
-
if (!
|
|
1367
|
+
if (!mt(r, t))
|
|
1368
1368
|
return;
|
|
1369
1369
|
A.sendProtocolMessage(r), u && u.postMessage({ direction: "sent", message: Array.from(r) });
|
|
1370
1370
|
} catch (r) {
|
|
1371
1371
|
v(r);
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
|
-
async function
|
|
1374
|
+
async function dt(t) {
|
|
1375
1375
|
Y(), A = new wt({
|
|
1376
1376
|
sessionId: t.sessionId,
|
|
1377
1377
|
keepaliveTimeoutMs: t.keepaliveTimeoutMs,
|
|
@@ -1389,8 +1389,8 @@ async function bt(t) {
|
|
|
1389
1389
|
v(e);
|
|
1390
1390
|
},
|
|
1391
1391
|
onProtocolMessage: (e) => {
|
|
1392
|
-
u && (u.postMessage({ direction: "received", message: Array.from(e) }), $(e) ===
|
|
1393
|
-
const s =
|
|
1392
|
+
u && (u.postMessage({ direction: "received", message: Array.from(e) }), $(e) === m.ANALYTICS_LOGS && u.postMessage({ type: "serverLogs", message: Array.from(e) }));
|
|
1393
|
+
const s = p(e), r = gt(e), i = Pt(s);
|
|
1394
1394
|
if (!(!r && i.length === 0))
|
|
1395
1395
|
try {
|
|
1396
1396
|
const n = X(e), a = e.buffer instanceof ArrayBuffer && e.byteOffset === 0 && e.byteLength === e.buffer.byteLength, o = i.length > 0;
|
|
@@ -1408,8 +1408,8 @@ async function bt(t) {
|
|
|
1408
1408
|
const l = [];
|
|
1409
1409
|
for (let _ = 1; _ < i.length; _++)
|
|
1410
1410
|
l.push(e.slice().buffer);
|
|
1411
|
-
const h = r ? e.slice().buffer : null,
|
|
1412
|
-
i[0].postMessage({ type: "protocol", message:
|
|
1411
|
+
const h = r ? e.slice().buffer : null, f = e.buffer;
|
|
1412
|
+
i[0].postMessage({ type: "protocol", message: f, headers: n }, [f]);
|
|
1413
1413
|
for (let _ = 1; _ < i.length; _++)
|
|
1414
1414
|
i[_].postMessage({ type: "protocol", message: l[_ - 1], headers: n }, [l[_ - 1]]);
|
|
1415
1415
|
h && w({ type: "protocol", message: h, headers: n }, [h]);
|
|
@@ -1433,7 +1433,7 @@ async function bt(t) {
|
|
|
1433
1433
|
self.addEventListener("message", (t) => {
|
|
1434
1434
|
const e = t.data;
|
|
1435
1435
|
if (e.type === "connect") {
|
|
1436
|
-
|
|
1436
|
+
dt(e).catch((s) => {
|
|
1437
1437
|
rt.error(`Failed to connect: ${s}`), v(s), Y();
|
|
1438
1438
|
});
|
|
1439
1439
|
return;
|
|
@@ -1471,13 +1471,13 @@ self.addEventListener("message", (t) => {
|
|
|
1471
1471
|
} catch {
|
|
1472
1472
|
}
|
|
1473
1473
|
const s = U.length;
|
|
1474
|
-
U.push(e.portId),
|
|
1474
|
+
U.push(e.portId), C.push({ port: e.port, opcodeGroupsMask: e.opcodeGroupsMask }), D.set(e.portId, s);
|
|
1475
1475
|
return;
|
|
1476
1476
|
}
|
|
1477
1477
|
if (e.type === "detachPort") {
|
|
1478
1478
|
const s = D.get(e.portId);
|
|
1479
1479
|
if (s !== void 0) {
|
|
1480
|
-
const r =
|
|
1480
|
+
const r = C[s];
|
|
1481
1481
|
try {
|
|
1482
1482
|
r.port.close();
|
|
1483
1483
|
} catch {
|
|
@@ -1485,52 +1485,52 @@ self.addEventListener("message", (t) => {
|
|
|
1485
1485
|
const i = U.length - 1;
|
|
1486
1486
|
if (s !== i) {
|
|
1487
1487
|
const n = U[i];
|
|
1488
|
-
U[s] = n,
|
|
1488
|
+
U[s] = n, C[s] = C[i], D.set(n, s);
|
|
1489
1489
|
}
|
|
1490
|
-
U.length--,
|
|
1490
|
+
U.length--, C.length--, D.delete(e.portId);
|
|
1491
1491
|
}
|
|
1492
1492
|
return;
|
|
1493
1493
|
}
|
|
1494
1494
|
if (e.type === "attachSendPort") {
|
|
1495
1495
|
const s = S.get(e.portId);
|
|
1496
1496
|
if (s !== void 0) {
|
|
1497
|
-
const n =
|
|
1497
|
+
const n = c[s];
|
|
1498
1498
|
try {
|
|
1499
1499
|
n.port.close();
|
|
1500
1500
|
} catch {
|
|
1501
1501
|
}
|
|
1502
|
-
const a =
|
|
1502
|
+
const a = N.length - 1;
|
|
1503
1503
|
if (s !== a) {
|
|
1504
|
-
const o =
|
|
1505
|
-
|
|
1504
|
+
const o = N[a];
|
|
1505
|
+
N[s] = o, c[s] = c[a], S.set(o, s);
|
|
1506
1506
|
}
|
|
1507
|
-
|
|
1507
|
+
N.length--, c.length--, S.delete(e.portId);
|
|
1508
1508
|
}
|
|
1509
|
-
const r = { port: e.port, opcodeGroupsMask: e.opcodeGroupsMask }, i =
|
|
1510
|
-
|
|
1509
|
+
const r = { port: e.port, opcodeGroupsMask: e.opcodeGroupsMask }, i = N.length;
|
|
1510
|
+
N.push(e.portId), c.push(r), S.set(e.portId, i);
|
|
1511
1511
|
try {
|
|
1512
1512
|
r.port.start?.();
|
|
1513
1513
|
} catch {
|
|
1514
1514
|
}
|
|
1515
1515
|
r.port.addEventListener("message", (n) => {
|
|
1516
|
-
|
|
1516
|
+
Ot(r.opcodeGroupsMask, n.data);
|
|
1517
1517
|
});
|
|
1518
1518
|
return;
|
|
1519
1519
|
}
|
|
1520
1520
|
if (e.type === "detachSendPort") {
|
|
1521
1521
|
const s = S.get(e.portId);
|
|
1522
1522
|
if (s !== void 0) {
|
|
1523
|
-
const r =
|
|
1523
|
+
const r = c[s];
|
|
1524
1524
|
try {
|
|
1525
1525
|
r.port.close();
|
|
1526
1526
|
} catch {
|
|
1527
1527
|
}
|
|
1528
|
-
const i =
|
|
1528
|
+
const i = N.length - 1;
|
|
1529
1529
|
if (s !== i) {
|
|
1530
|
-
const n =
|
|
1531
|
-
|
|
1530
|
+
const n = N[i];
|
|
1531
|
+
N[s] = n, c[s] = c[i], S.set(n, s);
|
|
1532
1532
|
}
|
|
1533
|
-
|
|
1533
|
+
N.length--, c.length--, S.delete(e.portId);
|
|
1534
1534
|
}
|
|
1535
1535
|
return;
|
|
1536
1536
|
}
|