@ikonai/sdk 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{audio-playback-worker-Cwm3GaAx.js → audio-playback-worker-CGBVb9zd.js} +140 -142
- package/assets/{protocol-worker-DKSTqFKg.js → protocol-worker-BnPqA34K.js} +117 -113
- package/assets/{video-capture-worker-BBs_62Fq.js → video-capture-worker-y4Nlx7f9.js} +15 -15
- package/assets/{video-playback-worker-Bfm3r5xW.js → video-playback-worker-Dylqg54c.js} +84 -86
- package/index.js +640 -640
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
function
|
|
1
|
+
function $(t) {
|
|
2
2
|
if (t.length < 8)
|
|
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
|
|
7
|
-
return
|
|
6
|
+
function K(t) {
|
|
7
|
+
return $(t) & 4294901760;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function X(t) {
|
|
10
10
|
const e = Et(t), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
11
11
|
if (e.length < 27)
|
|
12
12
|
throw new Error("Protocol payload too short");
|
|
@@ -14,9 +14,9 @@ function $(t) {
|
|
|
14
14
|
if (27 + a * 4 > e.length)
|
|
15
15
|
throw new Error("Protocol header exceeds payload length");
|
|
16
16
|
const I = [];
|
|
17
|
-
let
|
|
17
|
+
let b = 27;
|
|
18
18
|
for (let d = 0; d < a; d++)
|
|
19
|
-
I.push(r.getUint32(
|
|
19
|
+
I.push(r.getUint32(b, !0)), b += 4;
|
|
20
20
|
return {
|
|
21
21
|
length: s,
|
|
22
22
|
opcode: n,
|
|
@@ -32,15 +32,15 @@ function $(t) {
|
|
|
32
32
|
function nt(t, e, r, s, n) {
|
|
33
33
|
const a = [], f = 27 + a.length * 4, _ = f + e.length, m = new Uint8Array(_), I = new DataView(m.buffer);
|
|
34
34
|
I.setUint32(0, _, !0), I.setUint32(4, t >>> 0, !0), I.setUint32(8, s >>> 0, !0), I.setUint32(12, 0, !0), I.setUint32(16, 0, !0), I.setUint32(20, a.length >>> 0, !0), I.setUint8(24, r & 255), I.setUint8(25, 8), I.setUint8(26, 0);
|
|
35
|
-
let
|
|
35
|
+
let b = 27;
|
|
36
36
|
for (let d = 0; d < a.length; d++)
|
|
37
|
-
I.setUint32(
|
|
37
|
+
I.setUint32(b, a[d] >>> 0, !0), b += 4;
|
|
38
38
|
return m.set(e, f), m;
|
|
39
39
|
}
|
|
40
40
|
var g = /* @__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))(g || {});
|
|
41
41
|
const it = 161, at = 162, G = new TextEncoder();
|
|
42
42
|
new TextDecoder("utf-8", { fatal: !0 });
|
|
43
|
-
class
|
|
43
|
+
class B {
|
|
44
44
|
constructor(e = 1) {
|
|
45
45
|
this.version = e, this.buffer.writeByte(it), this.buffer.writeVarUInt(e >>> 0);
|
|
46
46
|
}
|
|
@@ -82,19 +82,19 @@ class M {
|
|
|
82
82
|
this.writeVariableField(e, 13, r);
|
|
83
83
|
}
|
|
84
84
|
writeObjectField(e, r, s) {
|
|
85
|
-
const n = new
|
|
85
|
+
const n = new B(r);
|
|
86
86
|
s(n);
|
|
87
87
|
const i = n.finish();
|
|
88
88
|
this.writeVariableField(e, 11, i);
|
|
89
89
|
}
|
|
90
90
|
writeArrayField(e, r, s) {
|
|
91
|
-
const n = new
|
|
91
|
+
const n = new W(r);
|
|
92
92
|
s(n);
|
|
93
93
|
const i = n.finish();
|
|
94
94
|
this.writeVariableField(e, 9, i);
|
|
95
95
|
}
|
|
96
96
|
writeDictionaryField(e, r, s, n) {
|
|
97
|
-
const i = new
|
|
97
|
+
const i = new Q(r, s);
|
|
98
98
|
n(i);
|
|
99
99
|
const o = i.finish();
|
|
100
100
|
this.writeVariableField(e, 10, o);
|
|
@@ -109,10 +109,10 @@ class M {
|
|
|
109
109
|
this.writeFieldHeader(e, r, s.length), this.buffer.writeBytes(s);
|
|
110
110
|
}
|
|
111
111
|
writeFieldHeader(e, r, s) {
|
|
112
|
-
this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(
|
|
112
|
+
this.buffer.writeUInt32(e >>> 0), this.buffer.writeByte(k(r)), ht(r) && this.buffer.writeVarUInt(s >>> 0);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
class
|
|
115
|
+
class W {
|
|
116
116
|
constructor(e) {
|
|
117
117
|
this.elementType = e;
|
|
118
118
|
}
|
|
@@ -189,7 +189,7 @@ class K {
|
|
|
189
189
|
11
|
|
190
190
|
/* Object */
|
|
191
191
|
), this.count++;
|
|
192
|
-
const s = new
|
|
192
|
+
const s = new B(e);
|
|
193
193
|
r(s);
|
|
194
194
|
const n = s.finish();
|
|
195
195
|
this.payload.writeVarUInt(n.length), this.payload.writeBytes(n);
|
|
@@ -199,7 +199,7 @@ class K {
|
|
|
199
199
|
9
|
|
200
200
|
/* Array */
|
|
201
201
|
), this.count++;
|
|
202
|
-
const s = new
|
|
202
|
+
const s = new W(e);
|
|
203
203
|
r(s);
|
|
204
204
|
const n = s.finish();
|
|
205
205
|
this.payload.writeBytes(n);
|
|
@@ -209,21 +209,21 @@ class K {
|
|
|
209
209
|
10
|
|
210
210
|
/* Dict */
|
|
211
211
|
), this.count++;
|
|
212
|
-
const n = new
|
|
212
|
+
const n = new Q(e, r);
|
|
213
213
|
s(n);
|
|
214
214
|
const i = n.finish();
|
|
215
215
|
this.payload.writeBytes(i);
|
|
216
216
|
}
|
|
217
217
|
finish() {
|
|
218
218
|
const e = new P();
|
|
219
|
-
return e.writeByte(
|
|
219
|
+
return e.writeByte(k(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
223
|
throw new Error(`Array element type is ${g[this.elementType]}, expected ${g[e]}`);
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
class
|
|
226
|
+
class Q {
|
|
227
227
|
constructor(e, r) {
|
|
228
228
|
this.keyType = e, this.valueType = r, lt(e);
|
|
229
229
|
}
|
|
@@ -241,7 +241,7 @@ class X {
|
|
|
241
241
|
if (this.entryOpen)
|
|
242
242
|
throw new Error("Dictionary entry not completed");
|
|
243
243
|
const e = new P();
|
|
244
|
-
return e.writeByte(
|
|
244
|
+
return e.writeByte(k(this.keyType)), e.writeByte(k(this.valueType)), e.writeVarUInt(this.count), e.writeBytes(this.payload.toUint8Array()), e.toUint8Array();
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
class ot {
|
|
@@ -394,7 +394,7 @@ class ot {
|
|
|
394
394
|
11
|
|
395
395
|
/* Object */
|
|
396
396
|
);
|
|
397
|
-
const s = new
|
|
397
|
+
const s = new B(e);
|
|
398
398
|
r(s);
|
|
399
399
|
const n = s.finish();
|
|
400
400
|
this.payload.writeVarUInt(n.length), this.payload.writeBytes(n), this.valueWritten = !0;
|
|
@@ -404,7 +404,7 @@ class ot {
|
|
|
404
404
|
9
|
|
405
405
|
/* Array */
|
|
406
406
|
);
|
|
407
|
-
const s = new
|
|
407
|
+
const s = new W(e);
|
|
408
408
|
r(s);
|
|
409
409
|
const n = s.finish();
|
|
410
410
|
this.payload.writeBytes(n), this.valueWritten = !0;
|
|
@@ -414,7 +414,7 @@ class ot {
|
|
|
414
414
|
10
|
|
415
415
|
/* Dict */
|
|
416
416
|
);
|
|
417
|
-
const n = new
|
|
417
|
+
const n = new Q(e, r);
|
|
418
418
|
s(n);
|
|
419
419
|
const i = n.finish();
|
|
420
420
|
this.payload.writeBytes(i), this.valueWritten = !0;
|
|
@@ -474,8 +474,8 @@ class l {
|
|
|
474
474
|
l.toHex(l.readUInt32LE(e, 0), 8),
|
|
475
475
|
l.toHex(l.readUInt16LE(e, 4), 4),
|
|
476
476
|
l.toHex(l.readUInt16LE(e, 6), 4),
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
j(e.subarray(8, 10)),
|
|
478
|
+
j(e.subarray(10, 16))
|
|
479
479
|
].join("-");
|
|
480
480
|
}
|
|
481
481
|
asBytes() {
|
|
@@ -557,7 +557,7 @@ class P {
|
|
|
557
557
|
return this.buffer.slice(0, this.length);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function k(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;
|
|
@@ -569,19 +569,19 @@ function lt(t) {
|
|
|
569
569
|
if (t === 9 || t === 11 || t === 10 || t === 1)
|
|
570
570
|
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function j(t) {
|
|
573
573
|
return Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
574
574
|
}
|
|
575
575
|
function Et(t) {
|
|
576
576
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
577
577
|
}
|
|
578
|
-
var U = /* @__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))(U || {}), W = /* @__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.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.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))(W || {});
|
|
578
|
+
var w = /* @__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))(w || {}), O = /* @__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.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.ANALYTICS_DEVTOOLS_CONSOLE_OUTPUT = 524297] = "ANALYTICS_DEVTOOLS_CONSOLE_OUTPUT", 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.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))(O || {});
|
|
579
579
|
const J = 1, _t = 131074;
|
|
580
580
|
function Z(t) {
|
|
581
581
|
return {};
|
|
582
582
|
}
|
|
583
583
|
function It(t) {
|
|
584
|
-
return new
|
|
584
|
+
return new B(J).finish();
|
|
585
585
|
}
|
|
586
586
|
function tt(t, e, r) {
|
|
587
587
|
const s = It();
|
|
@@ -597,7 +597,7 @@ class L extends et {
|
|
|
597
597
|
super(e, r), this.name = "TransportError";
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
class
|
|
600
|
+
class z extends L {
|
|
601
601
|
constructor(e) {
|
|
602
602
|
super(`No keepalive received within ${e}ms`), this.name = "KeepaliveTimeoutError";
|
|
603
603
|
}
|
|
@@ -625,7 +625,7 @@ let ut = 1;
|
|
|
625
625
|
function At(t, e) {
|
|
626
626
|
return `[${t}] ${e}`;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function V(t, e, r, s) {
|
|
629
629
|
if ((/* @__PURE__ */ new Date()).toISOString(), ut <= t) {
|
|
630
630
|
const n = At(e, r);
|
|
631
631
|
switch (t) {
|
|
@@ -644,23 +644,23 @@ function F(t, e, r, s) {
|
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function F(t) {
|
|
648
648
|
return {
|
|
649
649
|
debug(e, ...r) {
|
|
650
|
-
|
|
650
|
+
V(0, t, e, r);
|
|
651
651
|
},
|
|
652
652
|
info(e, ...r) {
|
|
653
|
-
|
|
653
|
+
V(1, t, e, r);
|
|
654
654
|
},
|
|
655
655
|
warn(e, ...r) {
|
|
656
|
-
|
|
656
|
+
V(2, t, e, r);
|
|
657
657
|
},
|
|
658
658
|
error(e, ...r) {
|
|
659
|
-
|
|
659
|
+
V(3, t, e, r);
|
|
660
660
|
}
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
|
-
const
|
|
663
|
+
const p = F("WebSocketTransport"), Nt = 1e4;
|
|
664
664
|
class ft {
|
|
665
665
|
ws = null;
|
|
666
666
|
keepaliveTimeout = null;
|
|
@@ -692,7 +692,7 @@ class ft {
|
|
|
692
692
|
this.ws.onopen = () => {
|
|
693
693
|
i = !0, clearTimeout(a), this.ws.send(r), this.resetKeepaliveTimeout(), o || (o = !0, s());
|
|
694
694
|
}, this.ws.onerror = () => {
|
|
695
|
-
clearTimeout(a),
|
|
695
|
+
clearTimeout(a), p.error("WebSocket error"), o || (o = !0, E(), n(new L("WebSocket connection failed")));
|
|
696
696
|
}, this.ws.onclose = (h) => {
|
|
697
697
|
if (this.clearKeepaliveTimeout(), !i && !o) {
|
|
698
698
|
o = !0, E(), n(new L("WebSocket connection closed before opening"));
|
|
@@ -706,7 +706,7 @@ class ft {
|
|
|
706
706
|
});
|
|
707
707
|
}
|
|
708
708
|
send(e) {
|
|
709
|
-
this.ws?.readyState === WebSocket.OPEN ? this.ws.send(e) :
|
|
709
|
+
this.ws?.readyState === WebSocket.OPEN ? this.ws.send(e) : p.warn("Cannot send: WebSocket not connected");
|
|
710
710
|
}
|
|
711
711
|
close() {
|
|
712
712
|
this.clearKeepaliveTimeout(), this.ws && (this.ws.close(1e3, "Client closing"), this.ws = null);
|
|
@@ -719,25 +719,25 @@ class ft {
|
|
|
719
719
|
}
|
|
720
720
|
handleProtocolMessage(e) {
|
|
721
721
|
try {
|
|
722
|
-
if (
|
|
722
|
+
if (X(e).opcode === O.KEEPALIVE_REQUEST) {
|
|
723
723
|
this.send(this.getKeepaliveResponse()), this.resetKeepaliveTimeout();
|
|
724
724
|
return;
|
|
725
725
|
}
|
|
726
726
|
this.resetKeepaliveTimeout(), this.callbacks.onProtocolMessage(e);
|
|
727
727
|
} catch (r) {
|
|
728
|
-
|
|
728
|
+
p.error("Failed to process protocol message:", r), this.callbacks.onError(r instanceof Error ? r : new Error(String(r)));
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
resetKeepaliveTimeout() {
|
|
732
732
|
this.clearKeepaliveTimeout(), this.keepaliveTimeout = setTimeout(() => {
|
|
733
|
-
|
|
733
|
+
p.error(`No keepalive received in ${this.keepaliveTimeoutMs}ms, closing connection`), this.callbacks.onError(new z(this.keepaliveTimeoutMs)), this.close();
|
|
734
734
|
}, this.keepaliveTimeoutMs);
|
|
735
735
|
}
|
|
736
736
|
clearKeepaliveTimeout() {
|
|
737
737
|
this.keepaliveTimeout && (clearTimeout(this.keepaliveTimeout), this.keepaliveTimeout = null);
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
|
-
const C =
|
|
740
|
+
const C = F("WebTransportTransport"), q = 4, Ct = 65536;
|
|
741
741
|
function rt() {
|
|
742
742
|
return typeof WebTransport < "u";
|
|
743
743
|
}
|
|
@@ -843,9 +843,9 @@ class Rt {
|
|
|
843
843
|
*/
|
|
844
844
|
processBufferedMessages() {
|
|
845
845
|
const e = this.getReceiveDataView();
|
|
846
|
-
for (; this.receiveBufferLength >=
|
|
846
|
+
for (; this.receiveBufferLength >= q; ) {
|
|
847
847
|
const r = e.getUint32(this.receiveBufferOffset, !0);
|
|
848
|
-
if (r <
|
|
848
|
+
if (r < q) {
|
|
849
849
|
C.error(`Invalid message length: ${r}`), this.callbacks.onError(new Error(`Invalid protocol message length: ${r}`)), this.receiveBufferOffset = 0, this.receiveBufferLength = 0;
|
|
850
850
|
return;
|
|
851
851
|
}
|
|
@@ -861,7 +861,7 @@ class Rt {
|
|
|
861
861
|
*/
|
|
862
862
|
handleProtocolMessage(e) {
|
|
863
863
|
try {
|
|
864
|
-
if (
|
|
864
|
+
if (X(e).opcode === O.KEEPALIVE_REQUEST) {
|
|
865
865
|
this.send(this.getKeepaliveResponse()), this.resetKeepaliveTimeout();
|
|
866
866
|
return;
|
|
867
867
|
}
|
|
@@ -881,7 +881,7 @@ class Rt {
|
|
|
881
881
|
*/
|
|
882
882
|
resetKeepaliveTimeout() {
|
|
883
883
|
this.clearKeepaliveTimeout(), this.keepaliveTimeout = setTimeout(() => {
|
|
884
|
-
C.error(`No keepalive received in ${this.keepaliveTimeoutMs}ms, closing connection`), this.callbacks.onError(new
|
|
884
|
+
C.error(`No keepalive received in ${this.keepaliveTimeoutMs}ms, closing connection`), this.callbacks.onError(new z(this.keepaliveTimeoutMs)), this.close();
|
|
885
885
|
}, this.keepaliveTimeoutMs);
|
|
886
886
|
}
|
|
887
887
|
/**
|
|
@@ -903,7 +903,7 @@ class Rt {
|
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
|
-
const
|
|
906
|
+
const D = F("Channel");
|
|
907
907
|
class yt {
|
|
908
908
|
state = "disconnected";
|
|
909
909
|
transport = null;
|
|
@@ -946,7 +946,7 @@ class yt {
|
|
|
946
946
|
try {
|
|
947
947
|
await this.connectTransport(), this.setState("connected");
|
|
948
948
|
} catch (e) {
|
|
949
|
-
throw
|
|
949
|
+
throw D.error("Channel connection failed:", e), this.setState("disconnected"), e;
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
/**
|
|
@@ -960,7 +960,7 @@ class yt {
|
|
|
960
960
|
*/
|
|
961
961
|
send(e) {
|
|
962
962
|
if (!this.transport?.isConnected) {
|
|
963
|
-
|
|
963
|
+
D.warn("Cannot send: channel not connected");
|
|
964
964
|
return;
|
|
965
965
|
}
|
|
966
966
|
this.transport.send(e);
|
|
@@ -979,18 +979,18 @@ class yt {
|
|
|
979
979
|
}
|
|
980
980
|
};
|
|
981
981
|
switch (e.Type) {
|
|
982
|
-
case
|
|
983
|
-
case
|
|
982
|
+
case w.WebSocket:
|
|
983
|
+
case w.WebSocketProxy:
|
|
984
984
|
this.transport = new ft(r);
|
|
985
985
|
break;
|
|
986
|
-
case
|
|
987
|
-
case
|
|
986
|
+
case w.WebTransport:
|
|
987
|
+
case w.WebTransportProxy:
|
|
988
988
|
if (!rt())
|
|
989
989
|
throw new Error("WebTransport is not supported in this browser");
|
|
990
990
|
this.transport = new Rt(r);
|
|
991
991
|
break;
|
|
992
992
|
default:
|
|
993
|
-
throw new Error(`Unsupported entrypoint type: ${
|
|
993
|
+
throw new Error(`Unsupported entrypoint type: ${w[e.Type]}`);
|
|
994
994
|
}
|
|
995
995
|
await this.transport.connect(e.Uri, e.AuthTicket);
|
|
996
996
|
}
|
|
@@ -1000,13 +1000,13 @@ class yt {
|
|
|
1000
1000
|
handleProtocolMessage(e) {
|
|
1001
1001
|
try {
|
|
1002
1002
|
const r = e;
|
|
1003
|
-
if (
|
|
1004
|
-
|
|
1003
|
+
if ($(r) === O.CORE_ON_SERVER_STOPPING) {
|
|
1004
|
+
D.debug("Received server stopping message"), this.setState("stopped"), this.transport?.close();
|
|
1005
1005
|
return;
|
|
1006
1006
|
}
|
|
1007
1007
|
this.config.onProtocolMessage?.(r);
|
|
1008
1008
|
} catch (r) {
|
|
1009
|
-
|
|
1009
|
+
D.error("Failed to handle protocol message:", r), this.config.onError?.(r instanceof Error ? r : new Error(String(r)));
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
1012
|
/**
|
|
@@ -1019,7 +1019,7 @@ class yt {
|
|
|
1019
1019
|
* Handle transport error.
|
|
1020
1020
|
*/
|
|
1021
1021
|
handleError(e) {
|
|
1022
|
-
|
|
1022
|
+
D.error("Channel error:", e), this.config.onError?.(e), e instanceof z && this.handleClose("Keepalive timeout", !1);
|
|
1023
1023
|
}
|
|
1024
1024
|
/**
|
|
1025
1025
|
* Update and notify state change.
|
|
@@ -1028,8 +1028,8 @@ class yt {
|
|
|
1028
1028
|
this.state !== e && (this.state = e, this.config.onStateChange?.(e));
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
1031
|
-
const R =
|
|
1032
|
-
class
|
|
1031
|
+
const R = F("ChannelManager");
|
|
1032
|
+
class Ut {
|
|
1033
1033
|
channels = /* @__PURE__ */ new Map();
|
|
1034
1034
|
// keyed by opcode group
|
|
1035
1035
|
activeType = null;
|
|
@@ -1073,7 +1073,7 @@ class wt {
|
|
|
1073
1073
|
* The opcode group is extracted from the message automatically.
|
|
1074
1074
|
*/
|
|
1075
1075
|
sendProtocolMessage(e) {
|
|
1076
|
-
const r =
|
|
1076
|
+
const r = K(e);
|
|
1077
1077
|
for (const [s, n] of this.channels)
|
|
1078
1078
|
if (s & r) {
|
|
1079
1079
|
n.send(e);
|
|
@@ -1110,7 +1110,7 @@ class wt {
|
|
|
1110
1110
|
await this.connectAllChannels(i), this.config.endpointSelector?.rememberWorkingType(n), this.config.onRememberWorkingType?.(n), this.activeType = n, this.reconnectAttempts = 0, this.setState("connected");
|
|
1111
1111
|
return;
|
|
1112
1112
|
} catch (o) {
|
|
1113
|
-
R.warn(`Failed to connect using ${
|
|
1113
|
+
R.warn(`Failed to connect using ${w[n]}: ${o}`), this.disconnectAll();
|
|
1114
1114
|
}
|
|
1115
1115
|
}
|
|
1116
1116
|
throw R.error("All endpoint types failed"), e || this.setState("offline"), new Error("Failed to connect using any endpoint type");
|
|
@@ -1213,11 +1213,11 @@ class wt {
|
|
|
1213
1213
|
this.state !== e && (this.state = e, this.config.onStateChange?.(e));
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
|
-
const st =
|
|
1216
|
+
const st = F("ProtocolWorker"), S = (t, e) => {
|
|
1217
1217
|
self.postMessage(t, e ?? []);
|
|
1218
1218
|
};
|
|
1219
|
-
let N = null, H,
|
|
1220
|
-
const
|
|
1219
|
+
let N = null, H, T = null;
|
|
1220
|
+
const U = [], u = [], v = /* @__PURE__ */ new Map(), A = [], c = [], y = /* @__PURE__ */ new Map(), x = [];
|
|
1221
1221
|
function Y() {
|
|
1222
1222
|
try {
|
|
1223
1223
|
N?.disconnect();
|
|
@@ -1225,48 +1225,48 @@ function Y() {
|
|
|
1225
1225
|
st.warn(`Failed to disconnect channel manager: ${t}`);
|
|
1226
1226
|
}
|
|
1227
1227
|
N = null;
|
|
1228
|
-
for (let t = 0; t <
|
|
1228
|
+
for (let t = 0; t < u.length; t++)
|
|
1229
1229
|
try {
|
|
1230
|
-
|
|
1230
|
+
u[t].port.close();
|
|
1231
1231
|
} catch {
|
|
1232
1232
|
}
|
|
1233
|
-
|
|
1234
|
-
for (let t = 0; t <
|
|
1233
|
+
U.length = 0, u.length = 0, v.clear();
|
|
1234
|
+
for (let t = 0; t < c.length; t++)
|
|
1235
1235
|
try {
|
|
1236
|
-
|
|
1236
|
+
c[t].port.close();
|
|
1237
1237
|
} catch {
|
|
1238
1238
|
}
|
|
1239
|
-
|
|
1239
|
+
A.length = 0, c.length = 0, y.clear();
|
|
1240
1240
|
}
|
|
1241
|
-
function
|
|
1241
|
+
function M(t) {
|
|
1242
1242
|
const e = t instanceof Error ? t : new Error(String(t));
|
|
1243
1243
|
S({ type: "error", error: { name: e.name, message: e.message, stack: e.stack } });
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function wt() {
|
|
1246
1246
|
let t = 0;
|
|
1247
|
-
for (let e = 0; e <
|
|
1248
|
-
t |=
|
|
1247
|
+
for (let e = 0; e < u.length; e++)
|
|
1248
|
+
t |= u[e].opcodeGroupsMask;
|
|
1249
1249
|
return t;
|
|
1250
1250
|
}
|
|
1251
1251
|
function St(t) {
|
|
1252
1252
|
if (H === void 0)
|
|
1253
1253
|
return !0;
|
|
1254
|
-
const e =
|
|
1254
|
+
const e = K(t);
|
|
1255
1255
|
if ((e & H) !== 0)
|
|
1256
1256
|
return !0;
|
|
1257
|
-
const r =
|
|
1257
|
+
const r = wt();
|
|
1258
1258
|
return (e & r) !== 0;
|
|
1259
1259
|
}
|
|
1260
1260
|
function gt(t) {
|
|
1261
1261
|
x.length = 0;
|
|
1262
|
-
for (let e = 0; e <
|
|
1263
|
-
const r =
|
|
1262
|
+
for (let e = 0; e < u.length; e++) {
|
|
1263
|
+
const r = u[e];
|
|
1264
1264
|
(r.opcodeGroupsMask & t) !== 0 && x.push(r.port);
|
|
1265
1265
|
}
|
|
1266
1266
|
return x;
|
|
1267
1267
|
}
|
|
1268
1268
|
function Lt(t, e) {
|
|
1269
|
-
return (
|
|
1269
|
+
return (K(t) & e) !== 0;
|
|
1270
1270
|
}
|
|
1271
1271
|
function Pt(t, e) {
|
|
1272
1272
|
if (!N || !e || typeof e != "object")
|
|
@@ -1277,13 +1277,13 @@ function Pt(t, e) {
|
|
|
1277
1277
|
const s = new Uint8Array(r.message);
|
|
1278
1278
|
if (!Lt(s, t))
|
|
1279
1279
|
return;
|
|
1280
|
-
N.sendProtocolMessage(s),
|
|
1280
|
+
N.sendProtocolMessage(s), T && T.postMessage({ direction: "sent", message: Array.from(s) });
|
|
1281
1281
|
} catch (s) {
|
|
1282
|
-
|
|
1282
|
+
M(s);
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
1285
|
async function mt(t) {
|
|
1286
|
-
Y(), N = new
|
|
1286
|
+
Y(), N = new Ut({
|
|
1287
1287
|
sessionId: t.sessionId,
|
|
1288
1288
|
keepaliveTimeoutMs: t.keepaliveTimeoutMs,
|
|
1289
1289
|
reconnectBackoffMs: t.reconnectBackoffMs,
|
|
@@ -1296,14 +1296,18 @@ async function mt(t) {
|
|
|
1296
1296
|
S({ type: "state", state: N?.managerState ?? "idle", activeType: N?.activeEndpointType ?? void 0 });
|
|
1297
1297
|
},
|
|
1298
1298
|
onError: (e) => {
|
|
1299
|
-
|
|
1299
|
+
M(e);
|
|
1300
1300
|
},
|
|
1301
1301
|
onProtocolMessage: (e) => {
|
|
1302
|
-
|
|
1303
|
-
|
|
1302
|
+
if (T) {
|
|
1303
|
+
T.postMessage({ direction: "received", message: Array.from(e) });
|
|
1304
|
+
const i = $(e);
|
|
1305
|
+
i === O.ANALYTICS_LOGS ? T.postMessage({ type: "serverLogs", message: Array.from(e) }) : i === O.ANALYTICS_DEVTOOLS_CONSOLE_OUTPUT && T.postMessage({ type: "serverConsole", message: Array.from(e) });
|
|
1306
|
+
}
|
|
1307
|
+
const r = K(e), s = St(e), n = gt(r);
|
|
1304
1308
|
if (!(!s && n.length === 0))
|
|
1305
1309
|
try {
|
|
1306
|
-
const i =
|
|
1310
|
+
const i = X(e), o = e.buffer instanceof ArrayBuffer && e.byteOffset === 0 && e.byteLength === e.buffer.byteLength, E = n.length > 0;
|
|
1307
1311
|
if (E && !s && n.length === 1 && o) {
|
|
1308
1312
|
const a = e.buffer;
|
|
1309
1313
|
n[0].postMessage({ type: "protocol", message: a, headers: i }, [a]);
|
|
@@ -1335,7 +1339,7 @@ async function mt(t) {
|
|
|
1335
1339
|
S({ type: "protocol", message: a, headers: i }, [a]);
|
|
1336
1340
|
}
|
|
1337
1341
|
} catch (i) {
|
|
1338
|
-
|
|
1342
|
+
M(i);
|
|
1339
1343
|
}
|
|
1340
1344
|
}
|
|
1341
1345
|
}), await N.connect(t.entrypoints);
|
|
@@ -1344,7 +1348,7 @@ self.addEventListener("message", (t) => {
|
|
|
1344
1348
|
const e = t.data;
|
|
1345
1349
|
if (e.type === "connect") {
|
|
1346
1350
|
mt(e).catch((r) => {
|
|
1347
|
-
st.error(`Failed to connect: ${r}`),
|
|
1351
|
+
st.error(`Failed to connect: ${r}`), M(r), Y();
|
|
1348
1352
|
});
|
|
1349
1353
|
return;
|
|
1350
1354
|
}
|
|
@@ -1357,9 +1361,9 @@ self.addEventListener("message", (t) => {
|
|
|
1357
1361
|
return;
|
|
1358
1362
|
try {
|
|
1359
1363
|
const r = new Uint8Array(e.message);
|
|
1360
|
-
N.sendProtocolMessage(r),
|
|
1364
|
+
N.sendProtocolMessage(r), T && T.postMessage({ direction: "sent", message: Array.from(r) });
|
|
1361
1365
|
} catch (r) {
|
|
1362
|
-
|
|
1366
|
+
M(r);
|
|
1363
1367
|
}
|
|
1364
1368
|
return;
|
|
1365
1369
|
}
|
|
@@ -1368,7 +1372,7 @@ self.addEventListener("message", (t) => {
|
|
|
1368
1372
|
return;
|
|
1369
1373
|
}
|
|
1370
1374
|
if (e.type === "enableDevtools") {
|
|
1371
|
-
e.enabled && !
|
|
1375
|
+
e.enabled && !T ? T = new BroadcastChannel("ikon:devtools") : !e.enabled && T && (T.close(), T = null);
|
|
1372
1376
|
return;
|
|
1373
1377
|
}
|
|
1374
1378
|
if (e.type === "attachPort") {
|
|
@@ -1376,44 +1380,44 @@ self.addEventListener("message", (t) => {
|
|
|
1376
1380
|
e.port.start?.();
|
|
1377
1381
|
} catch {
|
|
1378
1382
|
}
|
|
1379
|
-
const r =
|
|
1380
|
-
|
|
1383
|
+
const r = U.length;
|
|
1384
|
+
U.push(e.portId), u.push({ port: e.port, opcodeGroupsMask: e.opcodeGroupsMask }), v.set(e.portId, r);
|
|
1381
1385
|
return;
|
|
1382
1386
|
}
|
|
1383
1387
|
if (e.type === "detachPort") {
|
|
1384
|
-
const r =
|
|
1388
|
+
const r = v.get(e.portId);
|
|
1385
1389
|
if (r !== void 0) {
|
|
1386
|
-
const s =
|
|
1390
|
+
const s = u[r];
|
|
1387
1391
|
try {
|
|
1388
1392
|
s.port.close();
|
|
1389
1393
|
} catch {
|
|
1390
1394
|
}
|
|
1391
|
-
const n =
|
|
1395
|
+
const n = U.length - 1;
|
|
1392
1396
|
if (r !== n) {
|
|
1393
|
-
const i =
|
|
1394
|
-
|
|
1397
|
+
const i = U[n];
|
|
1398
|
+
U[r] = i, u[r] = u[n], v.set(i, r);
|
|
1395
1399
|
}
|
|
1396
|
-
|
|
1400
|
+
U.length--, u.length--, v.delete(e.portId);
|
|
1397
1401
|
}
|
|
1398
1402
|
return;
|
|
1399
1403
|
}
|
|
1400
1404
|
if (e.type === "attachSendPort") {
|
|
1401
1405
|
const r = y.get(e.portId);
|
|
1402
1406
|
if (r !== void 0) {
|
|
1403
|
-
const i =
|
|
1407
|
+
const i = c[r];
|
|
1404
1408
|
try {
|
|
1405
1409
|
i.port.close();
|
|
1406
1410
|
} catch {
|
|
1407
1411
|
}
|
|
1408
|
-
const o =
|
|
1412
|
+
const o = A.length - 1;
|
|
1409
1413
|
if (r !== o) {
|
|
1410
|
-
const E =
|
|
1411
|
-
|
|
1414
|
+
const E = A[o];
|
|
1415
|
+
A[r] = E, c[r] = c[o], y.set(E, r);
|
|
1412
1416
|
}
|
|
1413
|
-
|
|
1417
|
+
A.length--, c.length--, y.delete(e.portId);
|
|
1414
1418
|
}
|
|
1415
|
-
const s = { port: e.port, opcodeGroupsMask: e.opcodeGroupsMask }, n =
|
|
1416
|
-
|
|
1419
|
+
const s = { port: e.port, opcodeGroupsMask: e.opcodeGroupsMask }, n = A.length;
|
|
1420
|
+
A.push(e.portId), c.push(s), y.set(e.portId, n);
|
|
1417
1421
|
try {
|
|
1418
1422
|
s.port.start?.();
|
|
1419
1423
|
} catch {
|
|
@@ -1426,17 +1430,17 @@ self.addEventListener("message", (t) => {
|
|
|
1426
1430
|
if (e.type === "detachSendPort") {
|
|
1427
1431
|
const r = y.get(e.portId);
|
|
1428
1432
|
if (r !== void 0) {
|
|
1429
|
-
const s =
|
|
1433
|
+
const s = c[r];
|
|
1430
1434
|
try {
|
|
1431
1435
|
s.port.close();
|
|
1432
1436
|
} catch {
|
|
1433
1437
|
}
|
|
1434
|
-
const n =
|
|
1438
|
+
const n = A.length - 1;
|
|
1435
1439
|
if (r !== n) {
|
|
1436
|
-
const i =
|
|
1437
|
-
|
|
1440
|
+
const i = A[n];
|
|
1441
|
+
A[r] = i, c[r] = c[n], y.set(i, r);
|
|
1438
1442
|
}
|
|
1439
|
-
|
|
1443
|
+
A.length--, c.length--, y.delete(e.portId);
|
|
1440
1444
|
}
|
|
1441
1445
|
return;
|
|
1442
1446
|
}
|