@luxonis/visualizer-protobuf 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/apps/depthai-visualizer/src/components/Panel.d.ts.map +1 -1
  2. package/dist/apps/depthai-visualizer/src/components/Panel.js +13 -4
  3. package/dist/apps/depthai-visualizer/src/components/Panel.js.map +1 -1
  4. package/dist/apps/depthai-visualizer/src/components/PanelToolbar.d.ts.map +1 -1
  5. package/dist/apps/depthai-visualizer/src/components/PanelToolbar.js +3 -2
  6. package/dist/apps/depthai-visualizer/src/components/PanelToolbar.js.map +1 -1
  7. package/dist/apps/depthai-visualizer/src/connection/adapter.d.ts +6 -0
  8. package/dist/apps/depthai-visualizer/src/connection/adapter.d.ts.map +1 -1
  9. package/dist/apps/depthai-visualizer/src/connection/adapter.js +6 -0
  10. package/dist/apps/depthai-visualizer/src/connection/adapter.js.map +1 -1
  11. package/dist/apps/depthai-visualizer/src/connection/communicator.d.ts +12 -2
  12. package/dist/apps/depthai-visualizer/src/connection/communicator.d.ts.map +1 -1
  13. package/dist/apps/depthai-visualizer/src/connection/communicator.js +14 -22
  14. package/dist/apps/depthai-visualizer/src/connection/communicator.js.map +1 -1
  15. package/dist/apps/depthai-visualizer/src/connection/connection.d.ts +6 -0
  16. package/dist/apps/depthai-visualizer/src/connection/connection.d.ts.map +1 -1
  17. package/dist/apps/depthai-visualizer/src/connection/connection.js +7 -1
  18. package/dist/apps/depthai-visualizer/src/connection/connection.js.map +1 -1
  19. package/dist/apps/depthai-visualizer/src/connection/webrtc/bridge.d.ts.map +1 -1
  20. package/dist/apps/depthai-visualizer/src/connection/webrtc/bridge.js +82 -31
  21. package/dist/apps/depthai-visualizer/src/connection/webrtc/bridge.js.map +1 -1
  22. package/dist/apps/depthai-visualizer/src/connection/webrtc/worker-utils.d.ts +38 -3
  23. package/dist/apps/depthai-visualizer/src/connection/webrtc/worker-utils.d.ts.map +1 -1
  24. package/dist/apps/depthai-visualizer/src/connection/webrtc/worker-utils.js +54 -8
  25. package/dist/apps/depthai-visualizer/src/connection/webrtc/worker-utils.js.map +1 -1
  26. package/dist/apps/depthai-visualizer/src/connection/webrtc/worker.js +15 -0
  27. package/dist/apps/depthai-visualizer/src/connection/webrtc/worker.js.map +1 -1
  28. package/dist/apps/depthai-visualizer/src/connection/ws/worker-utils.d.ts +2 -1
  29. package/dist/apps/depthai-visualizer/src/connection/ws/worker-utils.d.ts.map +1 -1
  30. package/dist/apps/depthai-visualizer/src/connection/ws/worker-utils.js +28 -3
  31. package/dist/apps/depthai-visualizer/src/connection/ws/worker-utils.js.map +1 -1
  32. package/dist/apps/depthai-visualizer/src/utils/artificial-worker.d.ts +3 -0
  33. package/dist/apps/depthai-visualizer/src/utils/artificial-worker.d.ts.map +1 -1
  34. package/dist/apps/depthai-visualizer/src/utils/artificial-worker.js +10 -0
  35. package/dist/apps/depthai-visualizer/src/utils/artificial-worker.js.map +1 -1
  36. package/dist/{communicator-ZAqNuwq6.js → communicator-DKKKAI0H.js} +19 -29
  37. package/dist/{index-DakMDXW9.js → index-1yvlF6NH.js} +3 -3
  38. package/dist/{index-CKhCc5vm.js → index-B3F-eA-i.js} +187 -80
  39. package/dist/{index-QYS2yYV7.js → index-B4j3EVf8.js} +3 -3
  40. package/dist/{index-fkPdppby.js → index-BZjzIIuE.js} +3 -3
  41. package/dist/{index-DszVVt5Z.js → index-BsdqQ862.js} +3 -3
  42. package/dist/{index-r3QAVuN1.js → index-C6m30paN.js} +3 -3
  43. package/dist/{index-yfE-EHjv.js → index-CE1LH59a.js} +3 -3
  44. package/dist/{index-FWvVjhSv.js → index-Cmp_Tjng.js} +4 -4
  45. package/dist/{index-BEeIqwPz.js → index-Cqzhj8jS.js} +3 -3
  46. package/dist/{index-Bk2FsKKi.js → index-D0g7yNKD.js} +3 -3
  47. package/dist/{index-TgQ8-Lib.js → index-D7I7neMi.js} +3 -3
  48. package/dist/{index-Djz0avqZ.js → index-D_AhdZqi.js} +3 -3
  49. package/dist/{index-BNmANBei.js → index-Dai0K-_7.js} +3 -3
  50. package/dist/{index-DvdDp1CU.js → index-DbIgJEn4.js} +3 -3
  51. package/dist/{index-nxmrq-HQ.js → index-DkDTcHOl.js} +3 -3
  52. package/dist/{index-lPEkwJ-1.js → index-DleEaqya.js} +3 -3
  53. package/dist/{index-Cv9FekAD.js → index-FdS8KlrP.js} +3 -3
  54. package/dist/{index-2U-xZM02.js → index-MOg_zBJW.js} +3 -3
  55. package/dist/{index-sbw9t8iK.js → index-SZgAiOi4.js} +3 -3
  56. package/dist/index.js +3 -3
  57. package/dist/{worker-ByVSTHSI.js → worker-CMZIJlQN.js} +66 -9
  58. package/dist/{worker-DlZ2xp8p.js → worker-DtDgSl3T.js} +2 -2
  59. package/dist/{worker-utils-BNThsbdN.js → worker-utils-BuUq1bP1.js} +29 -4
  60. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- import { c as commonjsGlobal, g as getAugmentedNamespace, a as getDefaultExportFromCjs } from './worker-utils-BNThsbdN.js';
2
- import { T as Type$1, P as PointsAnnotationType$2, a as Profile, p as protobufsBySchema } from './communicator-ZAqNuwq6.js';
1
+ import { c as commonjsGlobal, g as getAugmentedNamespace, a as getDefaultExportFromCjs } from './worker-utils-BuUq1bP1.js';
2
+ import { T as Type$1, P as PointsAnnotationType$2, a as Profile, p as protobufsBySchema } from './communicator-DKKKAI0H.js';
3
3
  import * as React$1 from 'react';
4
4
  import React__default, { useContext, useRef, useLayoutEffect, createContext, useReducer, useState, useCallback, useMemo, forwardRef, createElement, Component, useEffect, useImperativeHandle, Fragment as Fragment$1, Suspense } from 'react';
5
5
  import { createStore, useStore } from 'zustand';
@@ -219,6 +219,22 @@ class FoxgloveWebSocketAdapter extends EventTarget {
219
219
  this.dispatchEvent(new Event("close"));
220
220
  }
221
221
  }
222
+ subscribe({
223
+ topics
224
+ }) {
225
+ this.#sendToWorker({
226
+ type: 'subscribe',
227
+ data: topics
228
+ });
229
+ }
230
+ unsubscribe({
231
+ topics
232
+ }) {
233
+ this.#sendToWorker({
234
+ type: 'unsubscribe',
235
+ data: topics
236
+ });
237
+ }
222
238
  async request({
223
239
  name,
224
240
  timeout = REQUEST_RESPONSE_TIMEOUT,
@@ -11883,44 +11899,49 @@ class WebRtcDataChannel {
11883
11899
  constructor(channel, withFragmentation = false) {
11884
11900
  this.channel = channel;
11885
11901
  this.withFragmentation = withFragmentation;
11886
- this.channel.onerror = event => this.events.emit('error', [event]);
11887
- this.channel.onmessage = async (event) => {
11902
+ this.channel.addEventListener('error', event => this.events.emit('error', [event]));
11903
+ this.channel.addEventListener('message', async (event) => {
11904
+ if (channel.label === 'ping-pong') {
11905
+ this.sendMessage('pong');
11906
+ }
11888
11907
  if (!this.withFragmentation) {
11889
11908
  this.events.emit('message', [event]);
11890
11909
  return;
11891
11910
  }
11892
- const arrayBuffer = await event.data.arrayBuffer();
11893
- const view = new DataView(arrayBuffer);
11894
- const totalChunks = view.getInt32(0);
11895
- const chunkIndex = view.getInt32(4);
11896
- const data = new Uint8Array(arrayBuffer, 8);
11911
+ const buffer = event.data instanceof ArrayBuffer ? event.data : await event.data.arrayBuffer();
11912
+ const view = new DataView(buffer);
11913
+ const totalChunks = view.getUint32(0);
11914
+ const chunkIndex = view.getUint32(4);
11915
+ const data = new Uint8Array(buffer, 8).slice(0);
11897
11916
  if (totalChunks !== 1) {
11898
11917
  this.appendChunk(data);
11899
11918
  if (totalChunks - 1 !== chunkIndex) {
11900
11919
  return;
11901
11920
  }
11902
11921
  }
11903
- const completeData = totalChunks === 1 ? data : new Uint8Array(this.buffer);
11922
+ const completeData = totalChunks === 1 ? data : this.buffer;
11923
+ this.events.emit('message', [
11924
+ new MessageEvent('message', {
11925
+ data: completeData.buffer,
11926
+ }),
11927
+ ]);
11904
11928
  if (totalChunks !== 1) {
11905
11929
  this.buffer = new Uint8Array(0);
11906
11930
  }
11907
- this.events.emit('message', [new MessageEvent('message', {
11908
- data: new Blob([completeData], { type: 'application/octet-stream' })
11909
- })]);
11910
- };
11911
- this.channel.onclose = event => this.events.emit('close', [event]);
11912
- this.channel.onopen = event => {
11931
+ });
11932
+ this.channel.addEventListener('close', event => this.events.emit('close', [event]));
11933
+ this.channel.addEventListener('open', event => {
11913
11934
  this.events.emit('open', [event]);
11914
11935
  for (const message of this.oldMessages) {
11915
11936
  this.sendMessage(message);
11916
11937
  }
11917
11938
  this.oldMessages = [];
11918
- };
11939
+ });
11919
11940
  }
11920
11941
  appendChunk(bytes) {
11921
- const newBuffer = new Uint8Array(this.buffer.length + bytes.length);
11942
+ const newBuffer = new Uint8Array(this.buffer.byteLength + bytes.byteLength);
11922
11943
  newBuffer.set(this.buffer, 0);
11923
- newBuffer.set(bytes, this.buffer.length);
11944
+ newBuffer.set(bytes, this.buffer.byteLength);
11924
11945
  this.buffer = newBuffer;
11925
11946
  }
11926
11947
  get raw() {
@@ -11931,7 +11952,7 @@ class WebRtcDataChannel {
11931
11952
  }
11932
11953
  sendMessage(message) {
11933
11954
  if (this.channel.readyState === 'open') {
11934
- const chunks = (message instanceof DataView && this.withFragmentation) ? makeChunks(message) : [message];
11955
+ const chunks = message instanceof DataView && this.withFragmentation ? makeChunks(message) : [message];
11935
11956
  for (const chunk of chunks) {
11936
11957
  this.channel.send(chunk);
11937
11958
  }
@@ -11948,20 +11969,20 @@ class WebRtcDataChannel {
11948
11969
  */
11949
11970
  onTextMessage(callback) {
11950
11971
  return this.events.on('message', async (event) => {
11951
- const buffer = await event.data.arrayBuffer();
11972
+ const buffer = event.data instanceof ArrayBuffer ? event.data : await event.data.arrayBuffer();
11952
11973
  const message = new TextDecoder('utf-8').decode(buffer);
11953
11974
  callback(message);
11954
11975
  });
11955
11976
  }
11956
11977
  on(event, callback) {
11978
+ const specificMessageEvents = ['message:binary', 'message:string', 'message:json'];
11979
+ if (!specificMessageEvents.includes(event)) {
11980
+ return this.events.on(event, callback);
11981
+ }
11957
11982
  return this.events.on('message', async (rawEvent) => {
11958
- if (!['message:binary', 'message:string', 'message:json'].includes(event)) {
11959
- callback(rawEvent);
11960
- return;
11961
- }
11962
- const buffer = await rawEvent.data.arrayBuffer();
11963
- const view = new DataView(buffer);
11983
+ const buffer = rawEvent.data instanceof ArrayBuffer ? rawEvent.data : await rawEvent.data.arrayBuffer();
11964
11984
  if (event === 'message:binary') {
11985
+ const view = new DataView(buffer);
11965
11986
  callback(view);
11966
11987
  }
11967
11988
  else {
@@ -11984,11 +12005,11 @@ class WebRtcConnection {
11984
12005
  events = new EventEmitter();
11985
12006
  onIceCandidate;
11986
12007
  onConnectionEstablished;
11987
- constructor(props) {
11988
- this.iceServers = props.iceServers;
11989
- this.onIceCandidate = props.onCandidate;
11990
- this.onConnectionEstablished = props.onConnectionEstablished;
11991
- this.#peerConnection = this.createPeerConnection();
12008
+ constructor(args) {
12009
+ this.iceServers = args.iceServers;
12010
+ this.onIceCandidate = args.onCandidate;
12011
+ this.onConnectionEstablished = args.onConnectionEstablished;
12012
+ this.#peerConnection = this.createPeerConnection(args.withFragmentation);
11992
12013
  }
11993
12014
  createPeerConnection(withFragmentation = false) {
11994
12015
  const config = {
@@ -12018,13 +12039,10 @@ class WebRtcConnection {
12018
12039
  this.onIceCandidate(event.candidate);
12019
12040
  }
12020
12041
  };
12021
- connection.ondatachannel = event => {
12022
- const channel = new WebRtcDataChannel(event.channel, withFragmentation);
12023
- if (channel.label === 'ping-pong') {
12024
- channel.on('message', () => channel.sendMessage('pong'));
12025
- }
12042
+ connection.addEventListener('datachannel', event => {
12043
+ const channel = new WebRtcDataChannel(event.channel, event.channel.label !== 'ping-pong' && withFragmentation);
12026
12044
  this.events.emit('data_channel', [channel]);
12027
- };
12045
+ });
12028
12046
  return connection;
12029
12047
  }
12030
12048
  get peerConnection() {
@@ -12160,9 +12178,9 @@ class WebRtcClient {
12160
12178
  // console.debug('[WebRTC] Offer accepted. Setting remote description..');
12161
12179
  await this.connection.setRemoteDescription(kind, candidate);
12162
12180
  // console.debug('[WebRTC] Set remote description');
12163
- for (const candidate of this.iceCandidates) {
12181
+ for (const iceCandidate of this.iceCandidates) {
12164
12182
  // console.debug('[WebRTC] Adding stored ICE candidate');
12165
- this.connection.addIceCandidate(JSON.parse(candidate));
12183
+ void this.connection.addIceCandidate(JSON.parse(iceCandidate));
12166
12184
  }
12167
12185
  this.iceCandidates = [];
12168
12186
  if (kind === 'offer') {
@@ -12212,6 +12230,7 @@ class WebRtcClient {
12212
12230
  });
12213
12231
  },
12214
12232
  onConnectionEstablished: () => this.disconnectSignalingServer('P2P connection established'),
12233
+ withFragmentation: this.config.withFragmentation,
12215
12234
  });
12216
12235
  this.events.emit('connection_established', [this.connection]);
12217
12236
  }
@@ -12227,14 +12246,29 @@ class WebRtcClient {
12227
12246
  // file, You can obtain one at http://mozilla.org/MPL/2.0/
12228
12247
 
12229
12248
  class ArtificialWorker extends EventTarget {
12249
+ #selfTarget = new EventTarget();
12250
+
12230
12251
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
12231
12252
  postMessage(data, _transferable) {
12253
+ const event = new MessageEvent('message', {
12254
+ data
12255
+ });
12256
+ this.#selfTarget.dispatchEvent(event);
12257
+ }
12258
+
12259
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
12260
+ selfPostMessage(data, _transferable) {
12232
12261
  const event = new MessageEvent('message', {
12233
12262
  data
12234
12263
  });
12235
12264
  super.dispatchEvent(event);
12236
12265
  }
12237
12266
 
12267
+ // @ts-expect-error Make it typed
12268
+ selfAddEventListener(type, callback) {
12269
+ this.#selfTarget.addEventListener(type, callback);
12270
+ }
12271
+
12238
12272
  // @ts-expect-error Make it typed
12239
12273
  addEventListener(type, callback) {
12240
12274
  super.addEventListener(type, callback);
@@ -12255,7 +12289,7 @@ class WebRtcBridge extends ArtificialWorker {
12255
12289
  #systemChannel = null;
12256
12290
  constructor() {
12257
12291
  super();
12258
- this.#worker = new Worker(new URL("worker-ByVSTHSI.js", import.meta.url), {
12292
+ this.#worker = new Worker(new URL("worker-CMZIJlQN.js", import.meta.url), {
12259
12293
  type: "module"
12260
12294
  });
12261
12295
  this.#setupArtificialWorker();
@@ -12264,15 +12298,57 @@ class WebRtcBridge extends ArtificialWorker {
12264
12298
  this.#worker.terminate();
12265
12299
  }
12266
12300
  #setupArtificialWorker() {
12267
- this.addEventListener('message', event => {
12301
+ this.selfAddEventListener("message", event => {
12268
12302
  switch (event.data.type) {
12269
- case 'open':
12303
+ case "open":
12270
12304
  {
12271
- if ('config' in event.data.data) {
12272
- this.#createWebRtc(event.data.data.config);
12305
+ if ("config" in event.data.data) {
12306
+ this.#createWebRtc({
12307
+ withFragmentation: true,
12308
+ ...event.data.data.config
12309
+ });
12273
12310
  }
12274
12311
  break;
12275
12312
  }
12313
+ case "close":
12314
+ {
12315
+ this.#webrtc?.dispose("Client requested connection close");
12316
+ this.terminate();
12317
+ break;
12318
+ }
12319
+ case "send":
12320
+ {
12321
+ this.#worker.postMessage({
12322
+ kind: "rawSend",
12323
+ data: {
12324
+ message: event.data.data
12325
+ }
12326
+ });
12327
+ break;
12328
+ }
12329
+ case "call_service":
12330
+ {
12331
+ this.#worker.postMessage({
12332
+ kind: "serviceCall",
12333
+ data: {
12334
+ message: event.data.data
12335
+ }
12336
+ });
12337
+ break;
12338
+ }
12339
+ case "unsubscribe":
12340
+ case "subscribe":
12341
+ {
12342
+ this.#worker.postMessage({
12343
+ kind: event.data.type,
12344
+ data: {
12345
+ message: {
12346
+ topics: event.data.data
12347
+ }
12348
+ }
12349
+ });
12350
+ break;
12351
+ }
12276
12352
  }
12277
12353
  });
12278
12354
  }
@@ -12282,26 +12358,30 @@ class WebRtcBridge extends ArtificialWorker {
12282
12358
  this.#handleMessages();
12283
12359
  }
12284
12360
  #handleWebRtc(client) {
12361
+ client.on("error", error => console.error("WebRtc Client Failed", error));
12285
12362
  client.on("connection_established", connection => {
12286
12363
  connection.on("data_channel", channel => {
12287
- channel.on('close', () => {
12364
+ channel.on("close", () => {
12288
12365
  if (channel.label !== MESSAGE_CHANNEL_NAME && channel.label !== SYSTEM_CHANNEL_NAME) {
12289
12366
  return;
12290
12367
  }
12291
12368
  this.#worker.postMessage({
12292
12369
  kind: "connection",
12293
12370
  data: {
12294
- channel: channel.label === MESSAGE_CHANNEL_NAME ? 'message' : 'system',
12371
+ channel: channel.label === MESSAGE_CHANNEL_NAME ? "message" : "system",
12295
12372
  ready: false
12296
12373
  }
12297
12374
  });
12375
+ this.selfPostMessage({
12376
+ type: "close"
12377
+ });
12298
12378
  });
12299
12379
  if (channel.label === MESSAGE_CHANNEL_NAME) {
12300
12380
  this.#messageChannel = channel;
12301
12381
  channel.on("message:binary", async view => {
12302
12382
  const operation = view.getUint8(0);
12303
- const action = operation === 0x01 ? 'message' : operation === 0x03 ? 'service_response' : 'other';
12304
- if (action === 'message') {
12383
+ const action = operation === 0x01 ? "message" : operation === 0x03 ? "service_response" : "other";
12384
+ if (action === "message") {
12305
12385
  const subscriptionId = view.getUint32(1);
12306
12386
  const payload = new DataView(view.buffer, view.byteOffset + 1 + 4 + 8);
12307
12387
  this.#worker.postMessage({
@@ -12321,7 +12401,7 @@ class WebRtcBridge extends ArtificialWorker {
12321
12401
  kind: "systemMessage",
12322
12402
  data: {
12323
12403
  message: {
12324
- op: 'serviceResponse',
12404
+ op: "serviceResponse",
12325
12405
  callId,
12326
12406
  data: payload
12327
12407
  }
@@ -12343,10 +12423,15 @@ class WebRtcBridge extends ArtificialWorker {
12343
12423
  this.#worker.postMessage({
12344
12424
  kind: "connection",
12345
12425
  data: {
12346
- channel: channel.label === MESSAGE_CHANNEL_NAME ? 'message' : 'system',
12426
+ channel: channel.label === MESSAGE_CHANNEL_NAME ? "message" : "system",
12347
12427
  ready: true
12348
12428
  }
12349
12429
  });
12430
+ if (this.#systemChannel?.raw.readyState === "open" && this.#messageChannel?.raw.readyState === "open") {
12431
+ this.selfPostMessage({
12432
+ type: "open"
12433
+ });
12434
+ }
12350
12435
  });
12351
12436
  connection.on("connection_closed", () => {
12352
12437
  this.#worker.postMessage({
@@ -12356,15 +12441,18 @@ class WebRtcBridge extends ArtificialWorker {
12356
12441
  ready: false
12357
12442
  }
12358
12443
  });
12444
+ this.selfPostMessage({
12445
+ type: "close"
12446
+ });
12359
12447
  });
12360
12448
  });
12361
12449
  }
12362
12450
  #handleMessages() {
12363
- this.#worker.addEventListener('message', event => {
12451
+ this.#worker.addEventListener("message", event => {
12364
12452
  switch (event.data.type) {
12365
- case 'send':
12453
+ case "send":
12366
12454
  {
12367
- const channel = event.data.data.channel === 'message' ? this.#messageChannel : this.#systemChannel;
12455
+ const channel = event.data.data.channel === "message" ? this.#messageChannel : this.#systemChannel;
12368
12456
  if (channel) {
12369
12457
  channel.sendMessage(event.data.data.data);
12370
12458
  }
@@ -12372,7 +12460,7 @@ class WebRtcBridge extends ArtificialWorker {
12372
12460
  }
12373
12461
  default:
12374
12462
  {
12375
- this.postMessage(event.data);
12463
+ this.selfPostMessage(event.data);
12376
12464
  }
12377
12465
  }
12378
12466
  });
@@ -12396,12 +12484,12 @@ class VisualizerConnection extends FoxgloveConnection {
12396
12484
  let finalWorker = worker;
12397
12485
  if (type === 'ws') {
12398
12486
  this.#url = data.connectionUrl;
12399
- finalWorker ??= new Worker(new URL("worker-DlZ2xp8p.js", import.meta.url), {
12487
+ finalWorker ??= new Worker(new URL("worker-DtDgSl3T.js", import.meta.url), {
12400
12488
  type: "module"
12401
12489
  });
12402
12490
  } else {
12403
12491
  this.#config = data.config;
12404
- finalWorker ??= new WebRtcBridge();
12492
+ finalWorker = new WebRtcBridge();
12405
12493
  }
12406
12494
  this.#open(finalWorker);
12407
12495
  }
@@ -12418,6 +12506,12 @@ class VisualizerConnection extends FoxgloveConnection {
12418
12506
  const response = await this.#adapter?.request(args);
12419
12507
  return response ?? null;
12420
12508
  }
12509
+ subscribe(args) {
12510
+ this.#adapter?.subscribe(args);
12511
+ }
12512
+ unsubscribe(args) {
12513
+ this.#adapter?.unsubscribe(args);
12514
+ }
12421
12515
 
12422
12516
  // eslint-disable-next-line no-restricted-syntax
12423
12517
  get connected() {
@@ -89581,7 +89675,7 @@ function legacy(parser) {
89581
89675
  return new LanguageSupport(StreamLanguage.define(parser));
89582
89676
  }
89583
89677
  function sql$1(dialectName) {
89584
- return import('./index-Djz0avqZ.js').then(m => m.sql({ dialect: m[dialectName] }));
89678
+ return import('./index-D_AhdZqi.js').then(m => m.sql({ dialect: m[dialectName] }));
89585
89679
  }
89586
89680
  /**
89587
89681
  An array of language descriptions for known language packages.
@@ -89592,7 +89686,7 @@ const languages = [
89592
89686
  name: "C",
89593
89687
  extensions: ["c", "h", "ino"],
89594
89688
  load() {
89595
- return import('./index-nxmrq-HQ.js').then(m => m.cpp());
89689
+ return import('./index-DkDTcHOl.js').then(m => m.cpp());
89596
89690
  }
89597
89691
  }),
89598
89692
  /*@__PURE__*/LanguageDescription.of({
@@ -89600,7 +89694,7 @@ const languages = [
89600
89694
  alias: ["cpp"],
89601
89695
  extensions: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"],
89602
89696
  load() {
89603
- return import('./index-nxmrq-HQ.js').then(m => m.cpp());
89697
+ return import('./index-DkDTcHOl.js').then(m => m.cpp());
89604
89698
  }
89605
89699
  }),
89606
89700
  /*@__PURE__*/LanguageDescription.of({
@@ -89620,7 +89714,7 @@ const languages = [
89620
89714
  name: "Go",
89621
89715
  extensions: ["go"],
89622
89716
  load() {
89623
- return import('./index-QYS2yYV7.js').then(m => m.go());
89717
+ return import('./index-B4j3EVf8.js').then(m => m.go());
89624
89718
  }
89625
89719
  }),
89626
89720
  /*@__PURE__*/LanguageDescription.of({
@@ -89635,7 +89729,7 @@ const languages = [
89635
89729
  name: "Java",
89636
89730
  extensions: ["java"],
89637
89731
  load() {
89638
- return import('./index-DakMDXW9.js').then(m => m.java());
89732
+ return import('./index-1yvlF6NH.js').then(m => m.java());
89639
89733
  }
89640
89734
  }),
89641
89735
  /*@__PURE__*/LanguageDescription.of({
@@ -89651,7 +89745,7 @@ const languages = [
89651
89745
  alias: ["json5"],
89652
89746
  extensions: ["json", "map"],
89653
89747
  load() {
89654
- return import('./index-Cv9FekAD.js').then(m => m.json());
89748
+ return import('./index-FdS8KlrP.js').then(m => m.json());
89655
89749
  }
89656
89750
  }),
89657
89751
  /*@__PURE__*/LanguageDescription.of({
@@ -89665,14 +89759,14 @@ const languages = [
89665
89759
  name: "LESS",
89666
89760
  extensions: ["less"],
89667
89761
  load() {
89668
- return import('./index-2U-xZM02.js').then(m => m.less());
89762
+ return import('./index-MOg_zBJW.js').then(m => m.less());
89669
89763
  }
89670
89764
  }),
89671
89765
  /*@__PURE__*/LanguageDescription.of({
89672
89766
  name: "Liquid",
89673
89767
  extensions: ["liquid"],
89674
89768
  load() {
89675
- return import('./index-DszVVt5Z.js').then(m => m.liquid());
89769
+ return import('./index-BsdqQ862.js').then(m => m.liquid());
89676
89770
  }
89677
89771
  }),
89678
89772
  /*@__PURE__*/LanguageDescription.of({
@@ -89698,7 +89792,7 @@ const languages = [
89698
89792
  name: "PHP",
89699
89793
  extensions: ["php", "php3", "php4", "php5", "php7", "phtml"],
89700
89794
  load() {
89701
- return import('./index-yfE-EHjv.js').then(m => m.php());
89795
+ return import('./index-CE1LH59a.js').then(m => m.php());
89702
89796
  }
89703
89797
  }),
89704
89798
  /*@__PURE__*/LanguageDescription.of({
@@ -89715,28 +89809,28 @@ const languages = [
89715
89809
  extensions: ["BUILD", "bzl", "py", "pyw"],
89716
89810
  filename: /^(BUCK|BUILD)$/,
89717
89811
  load() {
89718
- return import('./index-sbw9t8iK.js').then(m => m.python());
89812
+ return import('./index-SZgAiOi4.js').then(m => m.python());
89719
89813
  }
89720
89814
  }),
89721
89815
  /*@__PURE__*/LanguageDescription.of({
89722
89816
  name: "Rust",
89723
89817
  extensions: ["rs"],
89724
89818
  load() {
89725
- return import('./index-Bk2FsKKi.js').then(m => m.rust());
89819
+ return import('./index-D0g7yNKD.js').then(m => m.rust());
89726
89820
  }
89727
89821
  }),
89728
89822
  /*@__PURE__*/LanguageDescription.of({
89729
89823
  name: "Sass",
89730
89824
  extensions: ["sass"],
89731
89825
  load() {
89732
- return import('./index-TgQ8-Lib.js').then(m => m.sass({ indented: true }));
89826
+ return import('./index-D7I7neMi.js').then(m => m.sass({ indented: true }));
89733
89827
  }
89734
89828
  }),
89735
89829
  /*@__PURE__*/LanguageDescription.of({
89736
89830
  name: "SCSS",
89737
89831
  extensions: ["scss"],
89738
89832
  load() {
89739
- return import('./index-TgQ8-Lib.js').then(m => m.sass());
89833
+ return import('./index-D7I7neMi.js').then(m => m.sass());
89740
89834
  }
89741
89835
  }),
89742
89836
  /*@__PURE__*/LanguageDescription.of({
@@ -89767,7 +89861,7 @@ const languages = [
89767
89861
  name: "WebAssembly",
89768
89862
  extensions: ["wat", "wast"],
89769
89863
  load() {
89770
- return import('./index-DvdDp1CU.js').then(m => m.wast());
89864
+ return import('./index-DbIgJEn4.js').then(m => m.wast());
89771
89865
  }
89772
89866
  }),
89773
89867
  /*@__PURE__*/LanguageDescription.of({
@@ -89775,7 +89869,7 @@ const languages = [
89775
89869
  alias: ["rss", "wsdl", "xsd"],
89776
89870
  extensions: ["xml", "xsl", "xsd", "svg"],
89777
89871
  load() {
89778
- return import('./index-BNmANBei.js').then(m => m.xml());
89872
+ return import('./index-Dai0K-_7.js').then(m => m.xml());
89779
89873
  }
89780
89874
  }),
89781
89875
  /*@__PURE__*/LanguageDescription.of({
@@ -89783,7 +89877,7 @@ const languages = [
89783
89877
  alias: ["yml"],
89784
89878
  extensions: ["yaml", "yml"],
89785
89879
  load() {
89786
- return import('./index-BEeIqwPz.js').then(m => m.yaml());
89880
+ return import('./index-Cqzhj8jS.js').then(m => m.yaml());
89787
89881
  }
89788
89882
  }),
89789
89883
  // Legacy modes ported from CodeMirror 5
@@ -90579,13 +90673,13 @@ const languages = [
90579
90673
  name: "Vue",
90580
90674
  extensions: ["vue"],
90581
90675
  load() {
90582
- return import('./index-lPEkwJ-1.js').then(m => m.vue());
90676
+ return import('./index-DleEaqya.js').then(m => m.vue());
90583
90677
  }
90584
90678
  }),
90585
90679
  /*@__PURE__*/LanguageDescription.of({
90586
90680
  name: "Angular Template",
90587
90681
  load() {
90588
- return import('./index-r3QAVuN1.js').then(m => m.angular());
90682
+ return import('./index-C6m30paN.js').then(m => m.angular());
90589
90683
  }
90590
90684
  })
90591
90685
  ];
@@ -161315,7 +161409,7 @@ const PanelAnnotationButton = ({
161315
161409
  const handleClick = React__default.useCallback(event => {
161316
161410
  event.preventDefault();
161317
161411
  onClick();
161318
- }, []);
161412
+ }, [onClick]);
161319
161413
  return /*#__PURE__*/React__default.createElement(DropdownMenuItem, {
161320
161414
  onClick: handleClick
161321
161415
  }, /*#__PURE__*/React__default.createElement(Flex, {
@@ -161346,6 +161440,7 @@ const PanelToolbar = ({
161346
161440
  return () => {
161347
161441
  clearInterval(interval);
161348
161442
  };
161443
+ // eslint-disable-next-line react-hooks/exhaustive-deps
161349
161444
  }, []);
161350
161445
  const [annotationsOpened, setAnnotationsOpened] = React__default.useState(false);
161351
161446
  const hasExtra = React__default.useMemo(() => detections.some(topic => topic.extra && !topic.enabled), [detections]);
@@ -161357,7 +161452,7 @@ const PanelToolbar = ({
161357
161452
  enabled: !topic.enabled
161358
161453
  })
161359
161454
  })));
161360
- }, [detections, setDetections]);
161455
+ }, [setDetections]);
161361
161456
 
161362
161457
  // TODO: show only when debug mode is ON
161363
161458
  const name = React__default.useMemo(() => {
@@ -161454,10 +161549,22 @@ const Panel = ({
161454
161549
  annotationTopics = [],
161455
161550
  extraAnnotationTopics = []
161456
161551
  }) => {
161552
+ const connections = useConnections();
161457
161553
  const [detections, setDetections] = React__default.useState([]);
161458
161554
  React__default.useEffect(() => {
161459
161555
  if (!disableAnnotations) {
161460
- setDetections(current => [...rawToAnnotations(annotationTopics, 'main', current), ...rawToAnnotations(extraAnnotationTopics, 'extra', current)]);
161556
+ setDetections(current => {
161557
+ const newAnnotations = [...rawToAnnotations(annotationTopics, 'main', current), ...rawToAnnotations(extraAnnotationTopics, 'extra', current)];
161558
+ for (const connection of connections) {
161559
+ connection.unsubscribe({
161560
+ topics: current.map(c => c.name)
161561
+ });
161562
+ connection.subscribe({
161563
+ topics: newAnnotations.filter(c => c.enabled).map(c => c.name)
161564
+ });
161565
+ }
161566
+ return newAnnotations;
161567
+ });
161461
161568
  }
161462
161569
  // eslint-disable-next-line react-hooks/exhaustive-deps
161463
161570
  }, [JSON.stringify(annotationTopics), JSON.stringify(extraAnnotationTopics)]);
@@ -161486,7 +161593,7 @@ const Panel = ({
161486
161593
  }, children))))));
161487
161594
  };
161488
161595
 
161489
- const ImagePanelComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-FWvVjhSv.js'));
161596
+ const ImagePanelComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-Cmp_Tjng.js'));
161490
161597
  const ImagePanelBody = ({
161491
161598
  topic
161492
161599
  }) => {
@@ -161521,7 +161628,7 @@ const ImagePanel = /*#__PURE__*/React__default.memo(function ImagePanel(props) {
161521
161628
  // License, v2.0. If a copy of the MPL was not distributed with this
161522
161629
  // file, You can obtain one at http://mozilla.org/MPL/2.0/
161523
161630
 
161524
- const ThreeDeeRenderComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-fkPdppby.js'));
161631
+ const ThreeDeeRenderComponent = /*#__PURE__*/React__default.lazy(async () => await import('./index-BZjzIIuE.js'));
161525
161632
  const PointCloudPanelBody = ({
161526
161633
  topic
161527
161634
  }) => {
@@ -1,8 +1,8 @@
1
- import { au as ExternalTokenizer, aC as ContextTracker, aq as styleTags, ar as tags, av as LRParser, aD as LocalTokenGroup, aE as snippetCompletion, ay as syntaxTree, as as LRLanguage, an as indentNodeProp, ao as continuedIndent, az as flatIndent, aA as delimitedIndent, ap as foldNodeProp, aB as foldInside, at as LanguageSupport, aw as ifNotIn, ax as completeFromList, aF as IterMode, aG as NodeWeakMap } from './index-CKhCc5vm.js';
2
- import './worker-utils-BNThsbdN.js';
1
+ import { au as ExternalTokenizer, aC as ContextTracker, aq as styleTags, ar as tags, av as LRParser, aD as LocalTokenGroup, aE as snippetCompletion, ay as syntaxTree, as as LRLanguage, an as indentNodeProp, ao as continuedIndent, az as flatIndent, aA as delimitedIndent, ap as foldNodeProp, aB as foldInside, at as LanguageSupport, aw as ifNotIn, ax as completeFromList, aF as IterMode, aG as NodeWeakMap } from './index-B3F-eA-i.js';
2
+ import './worker-utils-BuUq1bP1.js';
3
3
  import 'hydrated-ws';
4
4
  import 'ms';
5
- import './communicator-ZAqNuwq6.js';
5
+ import './communicator-DKKKAI0H.js';
6
6
  import 'protobufjs/minimal';
7
7
  import 'react';
8
8
  import 'zustand';
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useReducer, useRef, useCallback, useLayoutEffect, Component, useContext, useState, useEffect, createContext, forwardRef, createElement, cloneElement, useMemo, Profiler, StrictMode } from 'react';
3
3
  import ReactDOM__default from 'react-dom';
4
- import { i as isSymbol, t as toString, k as keys, g as getSymbols$1, s as stubArray, a as arrayPush, b as baseGetAllKeys, c as getTag, d as getAllKeys, e as createAggregator, f as baseGet, h as baseIteratee, j as castPath, l as toKey, m as flatRest, n as arrayMap$1, o as baseSet, p as baseUniq, q as baseFlatten, r as generateUtilityClass, A as AnalyticsContext, u as useMustNotChange, P as PropTypes, v as useCurrentLayoutActions, w as useCurrentLayoutSelector, x as reportError, y as AppError, E as ErrorDisplay, S as Stack$1, z as makeStyles$1, _ as _extends$1, L as Logger, B as useGuaranteedContext, W as WorkspaceContext, C as useAnalytics, D as AppEvent, F as LeftSidebarItemKeys, R as RightSidebarItemKeys, G as usePanelMosaicId, H as useTranslation, I as usePanelCatalog, J as EmptyState, K as isEmpty, M as PanelContext, N as PanelCatalogContext, O as useSelectedPanels, Q as usePanelStateStore, T as useDefaultPanelTitle, U as PANEL_TITLE_CONFIG_KEY, V as noop$4, X as getPanelTypeFromId, Y as useWorkspaceStore, Z as useShallowMemo, $ as TAB_PANEL_TYPE, a0 as WorkspaceStoreSelectors, a1 as difference, a2 as filterMap, a3 as dist$3, a4 as usePanelContext, a5 as useMessagePipeline, a6 as v4, a7 as useHoverValue, a8 as useSetHoverValue, a9 as useClearHoverValue, aa as useAppConfiguration, ab as useMessagePipelineGetter, ac as usePanelSettingsTreeUpdate, ad as PlayerCapabilities, ae as useValueChangedDebugLog, af as assertNever, ag as PlayerPresence, ah as typescript, ai as isEqual, aj as isDesktopApp, ak as createTheme, al as propTypesExports, am as useJsonTreeTheme } from './index-CKhCc5vm.js';
4
+ import { i as isSymbol, t as toString, k as keys, g as getSymbols$1, s as stubArray, a as arrayPush, b as baseGetAllKeys, c as getTag, d as getAllKeys, e as createAggregator, f as baseGet, h as baseIteratee, j as castPath, l as toKey, m as flatRest, n as arrayMap$1, o as baseSet, p as baseUniq, q as baseFlatten, r as generateUtilityClass, A as AnalyticsContext, u as useMustNotChange, P as PropTypes, v as useCurrentLayoutActions, w as useCurrentLayoutSelector, x as reportError, y as AppError, E as ErrorDisplay, S as Stack$1, z as makeStyles$1, _ as _extends$1, L as Logger, B as useGuaranteedContext, W as WorkspaceContext, C as useAnalytics, D as AppEvent, F as LeftSidebarItemKeys, R as RightSidebarItemKeys, G as usePanelMosaicId, H as useTranslation, I as usePanelCatalog, J as EmptyState, K as isEmpty, M as PanelContext, N as PanelCatalogContext, O as useSelectedPanels, Q as usePanelStateStore, T as useDefaultPanelTitle, U as PANEL_TITLE_CONFIG_KEY, V as noop$4, X as getPanelTypeFromId, Y as useWorkspaceStore, Z as useShallowMemo, $ as TAB_PANEL_TYPE, a0 as WorkspaceStoreSelectors, a1 as difference, a2 as filterMap, a3 as dist$3, a4 as usePanelContext, a5 as useMessagePipeline, a6 as v4, a7 as useHoverValue, a8 as useSetHoverValue, a9 as useClearHoverValue, aa as useAppConfiguration, ab as useMessagePipelineGetter, ac as usePanelSettingsTreeUpdate, ad as PlayerCapabilities, ae as useValueChangedDebugLog, af as assertNever, ag as PlayerPresence, ah as typescript, ai as isEqual, aj as isDesktopApp, ak as createTheme, al as propTypesExports, am as useJsonTreeTheme } from './index-B3F-eA-i.js';
5
5
  import { createStore, useStore } from 'zustand';
6
6
  import { MosaicDragType, MosaicContext, MosaicWindowContext, getOtherBranch, getNodeAtPath } from 'react-mosaic-component';
7
- import { a as getDefaultExportFromCjs, c as commonjsGlobal, g as getAugmentedNamespace, E as EventEmitter } from './worker-utils-BNThsbdN.js';
7
+ import { a as getDefaultExportFromCjs, c as commonjsGlobal, g as getAugmentedNamespace, E as EventEmitter } from './worker-utils-BuUq1bP1.js';
8
8
  import { Link, Button, alpha, IconButton, Card, CardActionArea, CardMedia, CardContent, Typography, Container, Tooltip, Fade, ListItem, ListItemButton, ListItemText, List, TextField, InputAdornment, Popper, Grow, Paper, ClickAwayListener, Menu, MenuItem, Divider, buttonClasses, Backdrop, Chip, useTheme, alertClasses, darken, lighten, inputBaseClasses, autocompleteClasses, inputClasses, Checkbox, dialogActionsClasses, filledInputClasses, inputAdornmentClasses, listSubheaderClasses, selectClasses, tableCellClasses, ThemeProvider as ThemeProvider$1, SvgIcon, tabsClasses as tabsClasses$1, tabClasses, Tabs, Tab, ListItemIcon } from '@mui/material';
9
9
  import { p as isObject, r as root, E as copyObject, F as keysIn, G as getPrototype, H as cloneArrayBuffer, S as Symbol$1, I as cloneTypedArray, i as isObjectLike, J as nodeUtil, K as baseUnary, L as copyArray, l as isBuffer, N as cloneBuffer, O as initCloneObject, m as Stack, a as isArray, A as assignValue, z as baseAssignValue, x as baseRest, P as isPlainObject$1, y as isArrayLikeObject, B as tinycolor, Q as t$1, C as merge$1, D as instance } from './i18next-C5Qe4-E1.js';
10
10
  import FullscreenExitIcon from '@mui/icons-material/FullscreenExit';
@@ -20,7 +20,7 @@ import '@mui/material/styles/createTypography';
20
20
  import require$$1$3 from 'color';
21
21
  import require$$2$1 from 'lodash.curry';
22
22
  import OpenInNewIcon from '@mui/icons-material/OpenInNew';
23
- import './communicator-ZAqNuwq6.js';
23
+ import './communicator-DKKKAI0H.js';
24
24
  import 'protobufjs/minimal';
25
25
  import 'react-dnd-html5-backend';
26
26
  import 'object-assign';