@netless/window-manager 0.4.73-beta.0 → 0.4.73

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 (79) hide show
  1. package/dist/index.d.ts +1093 -40
  2. package/dist/index.js +15 -14
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +266 -164
  5. package/dist/index.mjs.map +1 -1
  6. package/package.json +13 -13
  7. package/src/App/AppContext.ts +13 -8
  8. package/src/App/AppProxy.ts +3 -8
  9. package/src/App/MagixEvent/index.ts +38 -38
  10. package/src/App/Storage/StorageEvent.ts +13 -13
  11. package/src/App/Storage/index.ts +265 -242
  12. package/src/App/Storage/typings.ts +4 -2
  13. package/src/App/Storage/utils.ts +3 -3
  14. package/src/AppListener.ts +5 -5
  15. package/src/AppManager.ts +6 -19
  16. package/src/AttributesDelegate.ts +5 -7
  17. package/src/BoxEmitter.ts +12 -6
  18. package/src/BoxManager.ts +1 -1
  19. package/src/ContainerResizeObserver.ts +1 -1
  20. package/src/Cursor/Cursor.svelte +3 -1
  21. package/src/Cursor/Cursor.ts +1 -0
  22. package/src/Cursor/index.ts +1 -1
  23. package/src/Helper.ts +67 -15
  24. package/src/InternalEmitter.ts +4 -3
  25. package/src/Page/index.ts +1 -1
  26. package/src/Register/index.ts +5 -7
  27. package/src/Register/loader.ts +1 -1
  28. package/src/Register/storage.ts +13 -13
  29. package/src/Utils/Common.ts +10 -5
  30. package/src/Utils/Reactive.ts +26 -25
  31. package/src/Utils/RoomHacker.ts +1 -1
  32. package/src/Utils/error.ts +0 -1
  33. package/src/View/IframeBridge.ts +627 -583
  34. package/src/View/MainView.ts +8 -6
  35. package/src/callback.ts +7 -1
  36. package/src/index.ts +34 -24
  37. package/src/typings.ts +11 -6
  38. package/dist/App/AppContext.d.ts +0 -79
  39. package/dist/App/AppPageStateImpl.d.ts +0 -17
  40. package/dist/App/AppProxy.d.ts +0 -67
  41. package/dist/App/MagixEvent/index.d.ts +0 -29
  42. package/dist/App/Storage/StorageEvent.d.ts +0 -8
  43. package/dist/App/Storage/index.d.ts +0 -39
  44. package/dist/App/Storage/typings.d.ts +0 -22
  45. package/dist/App/Storage/utils.d.ts +0 -5
  46. package/dist/App/index.d.ts +0 -2
  47. package/dist/AppListener.d.ts +0 -21
  48. package/dist/AppManager.d.ts +0 -110
  49. package/dist/AttributesDelegate.d.ts +0 -91
  50. package/dist/BoxEmitter.d.ts +0 -34
  51. package/dist/BoxManager.d.ts +0 -98
  52. package/dist/BuiltinApps.d.ts +0 -5
  53. package/dist/ContainerResizeObserver.d.ts +0 -11
  54. package/dist/Cursor/Cursor.d.ts +0 -43
  55. package/dist/Cursor/icons.d.ts +0 -3
  56. package/dist/Cursor/icons2.d.ts +0 -4
  57. package/dist/Cursor/index.d.ts +0 -55
  58. package/dist/Helper.d.ts +0 -11
  59. package/dist/InternalEmitter.d.ts +0 -34
  60. package/dist/Page/PageController.d.ts +0 -21
  61. package/dist/Page/index.d.ts +0 -3
  62. package/dist/PageState.d.ts +0 -9
  63. package/dist/ReconnectRefresher.d.ts +0 -24
  64. package/dist/RedoUndo.d.ts +0 -18
  65. package/dist/Register/index.d.ts +0 -28
  66. package/dist/Register/loader.d.ts +0 -4
  67. package/dist/Register/storage.d.ts +0 -8
  68. package/dist/Utils/AppCreateQueue.d.ts +0 -15
  69. package/dist/Utils/Common.d.ts +0 -22
  70. package/dist/Utils/Reactive.d.ts +0 -6
  71. package/dist/Utils/RoomHacker.d.ts +0 -3
  72. package/dist/Utils/error.d.ts +0 -27
  73. package/dist/Utils/log.d.ts +0 -1
  74. package/dist/View/IframeBridge.d.ts +0 -146
  75. package/dist/View/MainView.d.ts +0 -58
  76. package/dist/View/ViewManager.d.ts +0 -13
  77. package/dist/callback.d.ts +0 -38
  78. package/dist/constants.d.ts +0 -48
  79. package/dist/typings.d.ts +0 -84
package/dist/index.mjs CHANGED
@@ -22,7 +22,6 @@ import Emittery from "emittery";
22
22
  import { debounce as debounce$1, isEqual, omit, isObject as isObject$1, has, get, size as size$1, mapValues, noop as noop$2, pick, isEmpty, isInteger, orderBy, isFunction, isNumber, isNull } from "lodash";
23
23
  import { ScenePathType, UpdateEventKind, listenUpdated, unlistenUpdated, reaction, autorun, toJS, listenDisposed, unlistenDisposed, ViewMode, AnimationMode, isPlayer, isRoom, WhiteVersion, ApplianceNames, RoomPhase, PlayerPhase, InvisiblePlugin } from "white-web-sdk";
24
24
  import { v4 } from "uuid";
25
- import { genUID as genUID$1, SideEffectManager as SideEffectManager$1 } from "side-effect-manager";
26
25
  import { ResizeObserver as ResizeObserver$3 } from "@juggle/resize-observer";
27
26
  import videojs from "video.js";
28
27
  var Events = /* @__PURE__ */ ((Events2) => {
@@ -624,6 +623,61 @@ class BindContainerRoomPhaseInvalidError extends Error {
624
623
  this.message = "[WindowManager]: room phase only Connected can be bindContainer";
625
624
  }
626
625
  }
626
+ const e$2 = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", s$2 = e$2.length, t$3 = Array(20), r$4 = () => {
627
+ for (let r2 = 0; r2 < 20; r2++)
628
+ t$3[r2] = e$2.charAt(Math.random() * s$2);
629
+ return t$3.join("");
630
+ };
631
+ class o$1 {
632
+ constructor() {
633
+ this.disposers = /* @__PURE__ */ new Map();
634
+ }
635
+ add(e2, s2 = r$4()) {
636
+ return this.flush(s2), this.disposers.set(s2, e2()), s2;
637
+ }
638
+ addDisposer(e2, s2 = r$4()) {
639
+ return this.flush(s2), this.disposers.set(s2, e2), s2;
640
+ }
641
+ addEventListener(e2, s2, t2, o2, i2 = r$4()) {
642
+ return this.add(() => (e2.addEventListener(s2, t2, o2), () => e2.removeEventListener(s2, t2, o2)), i2), i2;
643
+ }
644
+ setTimeout(e2, s2, t2 = r$4()) {
645
+ return this.add(() => {
646
+ const r2 = window.setTimeout(() => {
647
+ this.remove(t2), e2();
648
+ }, s2);
649
+ return () => window.clearTimeout(r2);
650
+ }, t2);
651
+ }
652
+ setInterval(e2, s2, t2 = r$4()) {
653
+ return this.add(() => {
654
+ const t3 = window.setInterval(e2, s2);
655
+ return () => window.clearInterval(t3);
656
+ }, t2);
657
+ }
658
+ remove(e2) {
659
+ const s2 = this.disposers.get(e2);
660
+ return this.disposers.delete(e2), s2;
661
+ }
662
+ flush(e2) {
663
+ const s2 = this.remove(e2);
664
+ if (s2)
665
+ try {
666
+ s2();
667
+ } catch (t2) {
668
+ console.error(t2);
669
+ }
670
+ }
671
+ flushAll() {
672
+ this.disposers.forEach((e2) => {
673
+ try {
674
+ e2();
675
+ } catch (s2) {
676
+ console.error(s2);
677
+ }
678
+ }), this.disposers.clear();
679
+ }
680
+ }
627
681
  const onObjectByEvent = (event) => {
628
682
  return (object, func) => {
629
683
  if (object === void 0)
@@ -691,12 +745,12 @@ function isRef(e2) {
691
745
  return Boolean(has(e2, "__isRef"));
692
746
  }
693
747
  function makeRef(v2) {
694
- return { k: genUID$1(), v: v2, __isRef: true };
748
+ return { k: r$4(), v: v2, __isRef: true };
695
749
  }
696
750
  const STORAGE_NS = "_WM-STORAGE_";
697
751
  class Storage {
698
752
  constructor(context, id2, defaultState) {
699
- this._sideEffect = new SideEffectManager$1();
753
+ this._sideEffect = new o$1();
700
754
  this._destroyed = false;
701
755
  this._refMap = /* @__PURE__ */ new WeakMap();
702
756
  this._lastValue = /* @__PURE__ */ new Map();
@@ -954,9 +1008,7 @@ class AppContext {
954
1008
  setTimeout(() => {
955
1009
  var _a;
956
1010
  (_a = this.getRoom()) == null ? void 0 : _a.refreshViewSize();
957
- if (WindowManager.supportTeachingAidsPlugin) {
958
- callbacks$1.emit("onAppViewMounted", { appId: this.appId, view });
959
- }
1011
+ callbacks$1.emit("onAppViewMounted", { appId: this.appId, view });
960
1012
  }, 1e3);
961
1013
  }
962
1014
  };
@@ -1080,7 +1132,12 @@ class AppContext {
1080
1132
  return this.appProxy.kind;
1081
1133
  }
1082
1134
  dispatchAppEvent(type, value) {
1083
- internalEmitter.emit(`custom-${this.kind}`, { kind: this.kind, appId: this.appId, type, value });
1135
+ internalEmitter.emit(`custom-${this.kind}`, {
1136
+ kind: this.kind,
1137
+ appId: this.appId,
1138
+ type,
1139
+ value
1140
+ });
1084
1141
  }
1085
1142
  }
1086
1143
  class AppPageStateImpl {
@@ -1400,9 +1457,7 @@ class AppProxy {
1400
1457
  var _a2;
1401
1458
  if (this.view && fullPath && fullPath !== ((_a2 = this.view) == null ? void 0 : _a2.focusScenePath)) {
1402
1459
  setViewFocusScenePath(this.view, fullPath);
1403
- if (WindowManager.supportTeachingAidsPlugin) {
1404
- callbacks$1.emit("onAppScenePathChange", { appId: this.id, view: this.view });
1405
- }
1460
+ callbacks$1.emit("onAppScenePathChange", { appId: this.id, view: this.view });
1406
1461
  }
1407
1462
  }, 50);
1408
1463
  this.notifyPageStateChange = debounce$1(() => {
@@ -1520,9 +1575,7 @@ class AppProxy {
1520
1575
  appRegister.notifyApp(this.kind, "created", { appId, result });
1521
1576
  this.afterSetupApp(boxInitState);
1522
1577
  this.fixMobileSize();
1523
- if (WindowManager.supportTeachingAidsPlugin) {
1524
- callbacks$1.emit("onAppSetup", appId);
1525
- }
1578
+ callbacks$1.emit("onAppSetup", appId);
1526
1579
  }, SETUP_APP_DELAY);
1527
1580
  });
1528
1581
  (_a = this.boxManager) == null ? void 0 : _a.createBox({
@@ -1803,7 +1856,7 @@ class MainViewProxy {
1803
1856
  this.mainViewIsAddListener = false;
1804
1857
  this.store = this.manager.store;
1805
1858
  this.viewMode = this.manager.windowManger.viewMode;
1806
- this.sideEffectManager = new SideEffectManager$1();
1859
+ this.sideEffectManager = new o$1();
1807
1860
  this.syncCamera = () => {
1808
1861
  if (!this.polling || this.viewMode !== ViewMode.Broadcaster)
1809
1862
  return;
@@ -1978,9 +2031,7 @@ class MainViewProxy {
1978
2031
  this.mainView.divElement = divElement;
1979
2032
  this.addMainViewListener();
1980
2033
  this.start();
1981
- if (WindowManager.supportTeachingAidsPlugin) {
1982
- callbacks$1.emit("onMainViewRebind", this.mainView);
1983
- }
2034
+ callbacks$1.emit("onMainViewRebind", this.mainView);
1984
2035
  }
1985
2036
  addMainViewListener() {
1986
2037
  if (this.mainViewIsAddListener)
@@ -2127,7 +2178,7 @@ class AppManager {
2127
2178
  this.mainViewScenesLength = 0;
2128
2179
  this.callbacksNode = null;
2129
2180
  this.appCreateQueue = new AppCreateQueue();
2130
- this.sideEffectManager = new SideEffectManager$1();
2181
+ this.sideEffectManager = new o$1();
2131
2182
  this.sceneState = null;
2132
2183
  this.rootDirRemoving = false;
2133
2184
  this.onRemoveScenes = async (params) => {
@@ -2255,9 +2306,7 @@ class AppManager {
2255
2306
  x: payload.x,
2256
2307
  y: payload.y
2257
2308
  });
2258
- if (WindowManager.supportTeachingAidsPlugin) {
2259
- callbacks$1.emit("onBoxMove", payload);
2260
- }
2309
+ callbacks$1.emit("onBoxMove", payload);
2261
2310
  };
2262
2311
  this.onBoxResize = (payload) => {
2263
2312
  if (payload.width && payload.height) {
@@ -2266,31 +2315,23 @@ class AppManager {
2266
2315
  width: payload.width,
2267
2316
  height: payload.height
2268
2317
  });
2269
- if (WindowManager.supportTeachingAidsPlugin) {
2270
- callbacks$1.emit("onBoxResize", payload);
2271
- }
2318
+ callbacks$1.emit("onBoxResize", payload);
2272
2319
  }
2273
2320
  };
2274
2321
  this.onBoxFocus = (payload) => {
2275
2322
  this.windowManger.safeSetAttributes({ focus: payload.appId });
2276
- if (WindowManager.supportTeachingAidsPlugin) {
2277
- callbacks$1.emit("onBoxFocus", payload);
2278
- }
2323
+ callbacks$1.emit("onBoxFocus", payload);
2279
2324
  };
2280
2325
  this.onBoxClose = (payload) => {
2281
2326
  const appProxy = this.appProxies.get(payload.appId);
2282
2327
  if (appProxy) {
2283
2328
  appProxy.destroy(false, true, true, payload.error);
2284
2329
  }
2285
- if (WindowManager.supportTeachingAidsPlugin) {
2286
- callbacks$1.emit("onBoxClose", payload);
2287
- }
2330
+ callbacks$1.emit("onBoxClose", payload);
2288
2331
  };
2289
2332
  this.onBoxStateChange = (payload) => {
2290
2333
  this.dispatchInternalEvent(Events.AppBoxStateChange, payload);
2291
- if (WindowManager.supportTeachingAidsPlugin) {
2292
- callbacks$1.emit("onBoxStateChange", payload);
2293
- }
2334
+ callbacks$1.emit("onBoxStateChange", payload);
2294
2335
  };
2295
2336
  this.addAppsChangeListener = () => {
2296
2337
  this.refresher.add("apps", () => {
@@ -2624,9 +2665,7 @@ class AppManager {
2624
2665
  this.setMainViewFocusPath();
2625
2666
  }
2626
2667
  internalEmitter.emit("mainViewMounted");
2627
- if (WindowManager.supportTeachingAidsPlugin) {
2628
- callbacks$1.emit("onMainViewMounted", mainView);
2629
- }
2668
+ callbacks$1.emit("onMainViewMounted", mainView);
2630
2669
  }
2631
2670
  setMainViewFocusPath(scenePath) {
2632
2671
  var _a;
@@ -2853,16 +2892,59 @@ const findMemberByUid = (room, uid) => {
2853
2892
  return result;
2854
2893
  };
2855
2894
  const createInvisiblePlugin = async (room) => {
2856
- try {
2857
- const manager = await room.createInvisiblePlugin(WindowManager, {});
2895
+ let manager = room.getInvisiblePlugin(WindowManager.kind);
2896
+ if (manager)
2858
2897
  return manager;
2859
- } catch (error) {
2860
- if (error.message === `invisible plugin "WindowManager" exits`) {
2861
- await wait(200);
2862
- return room.getInvisiblePlugin(WindowManager.kind);
2863
- } else {
2864
- log("createInvisiblePlugin failed", error);
2898
+ let resolve;
2899
+ const promise = new Promise((r2) => {
2900
+ WindowManager._resolve = resolve = r2;
2901
+ });
2902
+ let wasReadonly = false;
2903
+ const canOperate = isRoomTokenWritable(room);
2904
+ if (!room.isWritable && canOperate) {
2905
+ wasReadonly = true;
2906
+ await pRetry(async (count) => {
2907
+ log(`switching to writable (x${count})`);
2908
+ await room.setWritable(true);
2909
+ }, { retries: 10, maxTimeout: 5e3 });
2910
+ }
2911
+ if (room.isWritable) {
2912
+ log("creating InvisiblePlugin...");
2913
+ room.createInvisiblePlugin(WindowManager, {}).catch(console.warn);
2914
+ } else {
2915
+ if (canOperate)
2916
+ console.warn("[WindowManager]: failed to switch to writable");
2917
+ console.warn("[WindowManager]: waiting for others to create the plugin...");
2918
+ }
2919
+ const timeout = setTimeout(() => {
2920
+ console.warn("[WindowManager]: no one called createInvisiblePlugin() after 20 seconds");
2921
+ }, 2e4);
2922
+ const abort = setTimeout(() => {
2923
+ throw new Error("[WindowManager]: no one called createInvisiblePlugin() after 60 seconds");
2924
+ }, 6e4);
2925
+ const interval = setInterval(() => {
2926
+ manager = room.getInvisiblePlugin(WindowManager.kind);
2927
+ if (manager) {
2928
+ clearTimeout(abort);
2929
+ clearTimeout(timeout);
2930
+ clearInterval(interval);
2931
+ resolve(manager);
2932
+ if (wasReadonly && room.isWritable) {
2933
+ setTimeout(() => room.setWritable(false).catch(console.warn), 500);
2934
+ }
2865
2935
  }
2936
+ }, 200);
2937
+ return promise;
2938
+ };
2939
+ const isRoomTokenWritable = (room) => {
2940
+ try {
2941
+ const str = atob(room.roomToken.slice("NETLESSROOM_".length));
2942
+ const index2 = str.indexOf("&role=");
2943
+ const role = +str[index2 + "&role=".length];
2944
+ return role < 2;
2945
+ } catch (error) {
2946
+ console.error(error);
2947
+ return false;
2866
2948
  }
2867
2949
  };
2868
2950
  const ResizeObserver$2 = window.ResizeObserver || ResizeObserver$3;
@@ -6798,8 +6880,8 @@ function create_if_block(ctx) {
6798
6880
  let t1;
6799
6881
  let t2;
6800
6882
  let div1_class_value;
6801
- let if_block0 = ctx[17] && create_if_block_2(ctx);
6802
- let if_block1 = ctx[18] && create_if_block_1(ctx);
6883
+ let if_block0 = ctx[18] && create_if_block_2(ctx);
6884
+ let if_block1 = ctx[19] && create_if_block_1(ctx);
6803
6885
  return {
6804
6886
  c() {
6805
6887
  div1 = element("div");
@@ -6808,7 +6890,7 @@ function create_if_block(ctx) {
6808
6890
  if_block0.c();
6809
6891
  t0 = space();
6810
6892
  span = element("span");
6811
- t1 = text$1(ctx[0]);
6893
+ t1 = text$1(ctx[1]);
6812
6894
  t2 = space();
6813
6895
  if (if_block1)
6814
6896
  if_block1.c();
@@ -6816,11 +6898,11 @@ function create_if_block(ctx) {
6816
6898
  set_style(span, "white-space", "nowrap");
6817
6899
  set_style(span, "text-overflow", "ellipsis");
6818
6900
  set_style(span, "max-width", "80px");
6819
- attr(div0, "class", ctx[8]);
6820
- set_style(div0, "background-color", ctx[2]);
6821
- set_style(div0, "color", ctx[9]);
6822
- set_style(div0, "opacity", ctx[11]);
6823
- attr(div1, "class", div1_class_value = "netless-window-manager-cursor-name " + ctx[15] + " " + ctx[14]);
6901
+ attr(div0, "class", ctx[9]);
6902
+ set_style(div0, "background-color", ctx[3]);
6903
+ set_style(div0, "color", ctx[10]);
6904
+ set_style(div0, "opacity", ctx[12]);
6905
+ attr(div1, "class", div1_class_value = "netless-window-manager-cursor-name " + ctx[16] + " " + ctx[15]);
6824
6906
  },
6825
6907
  m(target, anchor) {
6826
6908
  insert(target, div1, anchor);
@@ -6835,7 +6917,7 @@ function create_if_block(ctx) {
6835
6917
  if_block1.m(div0, null);
6836
6918
  },
6837
6919
  p(ctx2, dirty) {
6838
- if (ctx2[17]) {
6920
+ if (ctx2[18]) {
6839
6921
  if (if_block0) {
6840
6922
  if_block0.p(ctx2, dirty);
6841
6923
  } else {
@@ -6847,9 +6929,9 @@ function create_if_block(ctx) {
6847
6929
  if_block0.d(1);
6848
6930
  if_block0 = null;
6849
6931
  }
6850
- if (dirty & 1)
6851
- set_data(t1, ctx2[0]);
6852
- if (ctx2[18]) {
6932
+ if (dirty & 2)
6933
+ set_data(t1, ctx2[1]);
6934
+ if (ctx2[19]) {
6853
6935
  if (if_block1) {
6854
6936
  if_block1.p(ctx2, dirty);
6855
6937
  } else {
@@ -6861,19 +6943,19 @@ function create_if_block(ctx) {
6861
6943
  if_block1.d(1);
6862
6944
  if_block1 = null;
6863
6945
  }
6864
- if (dirty & 256) {
6865
- attr(div0, "class", ctx2[8]);
6946
+ if (dirty & 512) {
6947
+ attr(div0, "class", ctx2[9]);
6866
6948
  }
6867
- if (dirty & 4) {
6868
- set_style(div0, "background-color", ctx2[2]);
6949
+ if (dirty & 8) {
6950
+ set_style(div0, "background-color", ctx2[3]);
6869
6951
  }
6870
- if (dirty & 512) {
6871
- set_style(div0, "color", ctx2[9]);
6952
+ if (dirty & 1024) {
6953
+ set_style(div0, "color", ctx2[10]);
6872
6954
  }
6873
- if (dirty & 2048) {
6874
- set_style(div0, "opacity", ctx2[11]);
6955
+ if (dirty & 4096) {
6956
+ set_style(div0, "opacity", ctx2[12]);
6875
6957
  }
6876
- if (dirty & 49152 && div1_class_value !== (div1_class_value = "netless-window-manager-cursor-name " + ctx2[15] + " " + ctx2[14])) {
6958
+ if (dirty & 98304 && div1_class_value !== (div1_class_value = "netless-window-manager-cursor-name " + ctx2[16] + " " + ctx2[15])) {
6877
6959
  attr(div1, "class", div1_class_value);
6878
6960
  }
6879
6961
  },
@@ -6894,8 +6976,8 @@ function create_if_block_2(ctx) {
6894
6976
  c() {
6895
6977
  img = element("img");
6896
6978
  attr(img, "class", "netless-window-manager-cursor-selector-avatar");
6897
- attr(img, "style", ctx[19]());
6898
- if (!src_url_equal(img.src, img_src_value = ctx[7]))
6979
+ attr(img, "style", ctx[20]());
6980
+ if (!src_url_equal(img.src, img_src_value = ctx[8]))
6899
6981
  attr(img, "src", img_src_value);
6900
6982
  attr(img, "alt", "avatar");
6901
6983
  },
@@ -6903,7 +6985,7 @@ function create_if_block_2(ctx) {
6903
6985
  insert(target, img, anchor);
6904
6986
  },
6905
6987
  p(ctx2, dirty) {
6906
- if (dirty & 128 && !src_url_equal(img.src, img_src_value = ctx2[7])) {
6988
+ if (dirty & 256 && !src_url_equal(img.src, img_src_value = ctx2[8])) {
6907
6989
  attr(img, "src", img_src_value);
6908
6990
  }
6909
6991
  },
@@ -6919,19 +7001,19 @@ function create_if_block_1(ctx) {
6919
7001
  return {
6920
7002
  c() {
6921
7003
  span = element("span");
6922
- t2 = text$1(ctx[1]);
7004
+ t2 = text$1(ctx[2]);
6923
7005
  attr(span, "class", "netless-window-manager-cursor-tag-name");
6924
- set_style(span, "background-color", ctx[10]);
7006
+ set_style(span, "background-color", ctx[11]);
6925
7007
  },
6926
7008
  m(target, anchor) {
6927
7009
  insert(target, span, anchor);
6928
7010
  append(span, t2);
6929
7011
  },
6930
7012
  p(ctx2, dirty) {
6931
- if (dirty & 2)
6932
- set_data(t2, ctx2[1]);
6933
- if (dirty & 1024) {
6934
- set_style(span, "background-color", ctx2[10]);
7013
+ if (dirty & 4)
7014
+ set_data(t2, ctx2[2]);
7015
+ if (dirty & 2048) {
7016
+ set_style(span, "background-color", ctx2[11]);
6935
7017
  }
6936
7018
  },
6937
7019
  d(detaching) {
@@ -6948,7 +7030,7 @@ function create_fragment(ctx) {
6948
7030
  let img_class_value;
6949
7031
  let img_src_value;
6950
7032
  let div1_class_value;
6951
- let if_block = !ctx[13] && create_if_block(ctx);
7033
+ let if_block = !ctx[14] && create_if_block(ctx);
6952
7034
  return {
6953
7035
  c() {
6954
7036
  div1 = element("div");
@@ -6957,14 +7039,15 @@ function create_fragment(ctx) {
6957
7039
  t2 = space();
6958
7040
  div0 = element("div");
6959
7041
  img = element("img");
6960
- attr(img, "class", img_class_value = "netless-window-manager-cursor-" + ctx[3] + "-image " + ctx[14]);
6961
- if (!src_url_equal(img.src, img_src_value = ctx[6]))
7042
+ attr(img, "class", img_class_value = "netless-window-manager-cursor-" + ctx[4] + "-image " + ctx[15]);
7043
+ if (!src_url_equal(img.src, img_src_value = ctx[7]))
6962
7044
  attr(img, "src", img_src_value);
6963
- attr(img, "alt", ctx[3]);
7045
+ attr(img, "alt", ctx[4]);
6964
7046
  attr(div0, "class", "cursor-image-wrapper");
6965
- attr(div1, "class", div1_class_value = "netless-window-manager-cursor-mid" + (ctx[12] ? " netless-window-manager-cursor-custom" : ""));
6966
- set_style(div1, "transform", "translateX(" + ctx[4] + "px) translateY(" + ctx[5] + "px)");
6967
- set_style(div1, "display", ctx[16]);
7047
+ attr(div1, "class", div1_class_value = "netless-window-manager-cursor-mid" + (ctx[13] ? " netless-window-manager-cursor-custom" : ""));
7048
+ set_style(div1, "transform", "translateX(" + ctx[5] + "px) translateY(" + ctx[6] + "px)");
7049
+ set_style(div1, "display", ctx[17]);
7050
+ attr(div1, "data-cursor-uid", ctx[0]);
6968
7051
  },
6969
7052
  m(target, anchor) {
6970
7053
  insert(target, div1, anchor);
@@ -6975,7 +7058,7 @@ function create_fragment(ctx) {
6975
7058
  append(div0, img);
6976
7059
  },
6977
7060
  p(ctx2, [dirty]) {
6978
- if (!ctx2[13]) {
7061
+ if (!ctx2[14]) {
6979
7062
  if (if_block) {
6980
7063
  if_block.p(ctx2, dirty);
6981
7064
  } else {
@@ -6987,23 +7070,26 @@ function create_fragment(ctx) {
6987
7070
  if_block.d(1);
6988
7071
  if_block = null;
6989
7072
  }
6990
- if (dirty & 16392 && img_class_value !== (img_class_value = "netless-window-manager-cursor-" + ctx2[3] + "-image " + ctx2[14])) {
7073
+ if (dirty & 32784 && img_class_value !== (img_class_value = "netless-window-manager-cursor-" + ctx2[4] + "-image " + ctx2[15])) {
6991
7074
  attr(img, "class", img_class_value);
6992
7075
  }
6993
- if (dirty & 64 && !src_url_equal(img.src, img_src_value = ctx2[6])) {
7076
+ if (dirty & 128 && !src_url_equal(img.src, img_src_value = ctx2[7])) {
6994
7077
  attr(img, "src", img_src_value);
6995
7078
  }
6996
- if (dirty & 8) {
6997
- attr(img, "alt", ctx2[3]);
7079
+ if (dirty & 16) {
7080
+ attr(img, "alt", ctx2[4]);
6998
7081
  }
6999
- if (dirty & 4096 && div1_class_value !== (div1_class_value = "netless-window-manager-cursor-mid" + (ctx2[12] ? " netless-window-manager-cursor-custom" : ""))) {
7082
+ if (dirty & 8192 && div1_class_value !== (div1_class_value = "netless-window-manager-cursor-mid" + (ctx2[13] ? " netless-window-manager-cursor-custom" : ""))) {
7000
7083
  attr(div1, "class", div1_class_value);
7001
7084
  }
7002
- if (dirty & 48) {
7003
- set_style(div1, "transform", "translateX(" + ctx2[4] + "px) translateY(" + ctx2[5] + "px)");
7085
+ if (dirty & 96) {
7086
+ set_style(div1, "transform", "translateX(" + ctx2[5] + "px) translateY(" + ctx2[6] + "px)");
7087
+ }
7088
+ if (dirty & 131072) {
7089
+ set_style(div1, "display", ctx2[17]);
7004
7090
  }
7005
- if (dirty & 65536) {
7006
- set_style(div1, "display", ctx2[16]);
7091
+ if (dirty & 1) {
7092
+ attr(div1, "data-cursor-uid", ctx2[0]);
7007
7093
  }
7008
7094
  },
7009
7095
  i: noop,
@@ -7025,6 +7111,7 @@ function instance($$self, $$props, $$invalidate) {
7025
7111
  let isLaserPointerPencilEraser;
7026
7112
  let offset;
7027
7113
  let pencilEraserSize3ImageOffset;
7114
+ let { uid } = $$props;
7028
7115
  let { cursorName } = $$props;
7029
7116
  let { tagName } = $$props;
7030
7117
  let { backgroundColor } = $$props;
@@ -7050,64 +7137,67 @@ function instance($$self, $$props, $$invalidate) {
7050
7137
  }).map(([key, v2]) => `${key}: ${v2}`).join(";");
7051
7138
  };
7052
7139
  $$self.$$set = ($$props2) => {
7140
+ if ("uid" in $$props2)
7141
+ $$invalidate(0, uid = $$props2.uid);
7053
7142
  if ("cursorName" in $$props2)
7054
- $$invalidate(0, cursorName = $$props2.cursorName);
7143
+ $$invalidate(1, cursorName = $$props2.cursorName);
7055
7144
  if ("tagName" in $$props2)
7056
- $$invalidate(1, tagName = $$props2.tagName);
7145
+ $$invalidate(2, tagName = $$props2.tagName);
7057
7146
  if ("backgroundColor" in $$props2)
7058
- $$invalidate(2, backgroundColor = $$props2.backgroundColor);
7147
+ $$invalidate(3, backgroundColor = $$props2.backgroundColor);
7059
7148
  if ("appliance" in $$props2)
7060
- $$invalidate(3, appliance = $$props2.appliance);
7149
+ $$invalidate(4, appliance = $$props2.appliance);
7061
7150
  if ("x" in $$props2)
7062
- $$invalidate(4, x2 = $$props2.x);
7151
+ $$invalidate(5, x2 = $$props2.x);
7063
7152
  if ("y" in $$props2)
7064
- $$invalidate(5, y2 = $$props2.y);
7153
+ $$invalidate(6, y2 = $$props2.y);
7065
7154
  if ("src" in $$props2)
7066
- $$invalidate(6, src = $$props2.src);
7155
+ $$invalidate(7, src = $$props2.src);
7067
7156
  if ("visible" in $$props2)
7068
- $$invalidate(20, visible = $$props2.visible);
7157
+ $$invalidate(21, visible = $$props2.visible);
7069
7158
  if ("avatar" in $$props2)
7070
- $$invalidate(7, avatar = $$props2.avatar);
7159
+ $$invalidate(8, avatar = $$props2.avatar);
7071
7160
  if ("theme" in $$props2)
7072
- $$invalidate(8, theme = $$props2.theme);
7161
+ $$invalidate(9, theme = $$props2.theme);
7073
7162
  if ("color" in $$props2)
7074
- $$invalidate(9, color2 = $$props2.color);
7163
+ $$invalidate(10, color2 = $$props2.color);
7075
7164
  if ("cursorTagBackgroundColor" in $$props2)
7076
- $$invalidate(10, cursorTagBackgroundColor = $$props2.cursorTagBackgroundColor);
7165
+ $$invalidate(11, cursorTagBackgroundColor = $$props2.cursorTagBackgroundColor);
7077
7166
  if ("opacity" in $$props2)
7078
- $$invalidate(11, opacity = $$props2.opacity);
7167
+ $$invalidate(12, opacity = $$props2.opacity);
7079
7168
  if ("pencilEraserSize" in $$props2)
7080
- $$invalidate(21, pencilEraserSize = $$props2.pencilEraserSize);
7169
+ $$invalidate(22, pencilEraserSize = $$props2.pencilEraserSize);
7081
7170
  if ("custom" in $$props2)
7082
- $$invalidate(12, custom = $$props2.custom);
7171
+ $$invalidate(13, custom = $$props2.custom);
7083
7172
  };
7084
7173
  $$self.$$.update = () => {
7085
- if ($$self.$$.dirty & 1) {
7174
+ if ($$self.$$.dirty & 2) {
7086
7175
  hasName = !isEmpty(cursorName);
7087
7176
  }
7088
- if ($$self.$$.dirty & 2) {
7089
- $$invalidate(18, hasTagName = !isEmpty(tagName));
7177
+ if ($$self.$$.dirty & 4) {
7178
+ $$invalidate(19, hasTagName = !isEmpty(tagName));
7090
7179
  }
7091
- if ($$self.$$.dirty & 128) {
7092
- $$invalidate(17, hasAvatar = !isEmpty(avatar));
7180
+ if ($$self.$$.dirty & 256) {
7181
+ $$invalidate(18, hasAvatar = !isEmpty(avatar));
7093
7182
  }
7094
- if ($$self.$$.dirty & 1048576) {
7095
- $$invalidate(16, display = visible ? "initial" : "none");
7183
+ if ($$self.$$.dirty & 2097152) {
7184
+ $$invalidate(17, display = visible ? "" : "none");
7096
7185
  }
7097
- if ($$self.$$.dirty & 8) {
7098
- $$invalidate(13, isLaserPointer = appliance === ApplianceNames.laserPointer);
7186
+ if ($$self.$$.dirty & 16) {
7187
+ $$invalidate(14, isLaserPointer = appliance === ApplianceNames.laserPointer);
7099
7188
  }
7100
- if ($$self.$$.dirty & 8200) {
7101
- $$invalidate(22, isLaserPointerPencilEraser = isLaserPointer || appliance === ApplianceNames.pencilEraser);
7189
+ if ($$self.$$.dirty & 16400) {
7190
+ $$invalidate(23, isLaserPointerPencilEraser = isLaserPointer || appliance === ApplianceNames.pencilEraser);
7102
7191
  }
7103
- if ($$self.$$.dirty & 4194304) {
7104
- $$invalidate(15, offset = isLaserPointerPencilEraser ? "netless-window-manager-laserPointer-pencilEraser-offset" : "");
7192
+ if ($$self.$$.dirty & 8388608) {
7193
+ $$invalidate(16, offset = isLaserPointerPencilEraser ? "netless-window-manager-laserPointer-pencilEraser-offset" : "");
7105
7194
  }
7106
- if ($$self.$$.dirty & 2097152) {
7107
- $$invalidate(14, pencilEraserSize3ImageOffset = pencilEraserSize === 3 ? "netless-window-manager-pencilEraser-3-offset" : "");
7195
+ if ($$self.$$.dirty & 4194304) {
7196
+ $$invalidate(15, pencilEraserSize3ImageOffset = pencilEraserSize === 3 ? "netless-window-manager-pencilEraser-3-offset" : "");
7108
7197
  }
7109
7198
  };
7110
7199
  return [
7200
+ uid,
7111
7201
  cursorName,
7112
7202
  tagName,
7113
7203
  backgroundColor,
@@ -7137,21 +7227,22 @@ class Cursor$1 extends SvelteComponent {
7137
7227
  constructor(options2) {
7138
7228
  super();
7139
7229
  init(this, options2, instance, create_fragment, safe_not_equal, {
7140
- cursorName: 0,
7141
- tagName: 1,
7142
- backgroundColor: 2,
7143
- appliance: 3,
7144
- x: 4,
7145
- y: 5,
7146
- src: 6,
7147
- visible: 20,
7148
- avatar: 7,
7149
- theme: 8,
7150
- color: 9,
7151
- cursorTagBackgroundColor: 10,
7152
- opacity: 11,
7153
- pencilEraserSize: 21,
7154
- custom: 12
7230
+ uid: 0,
7231
+ cursorName: 1,
7232
+ tagName: 2,
7233
+ backgroundColor: 3,
7234
+ appliance: 4,
7235
+ x: 5,
7236
+ y: 6,
7237
+ src: 7,
7238
+ visible: 21,
7239
+ avatar: 8,
7240
+ theme: 9,
7241
+ color: 10,
7242
+ cursorTagBackgroundColor: 11,
7243
+ opacity: 12,
7244
+ pencilEraserSize: 22,
7245
+ custom: 13
7155
7246
  });
7156
7247
  }
7157
7248
  }
@@ -7348,6 +7439,7 @@ class Cursor {
7348
7439
  initProps() {
7349
7440
  var _a;
7350
7441
  return {
7442
+ uid: this.memberId,
7351
7443
  x: 0,
7352
7444
  y: 0,
7353
7445
  appliance: this.memberApplianceName,
@@ -7459,7 +7551,7 @@ class CursorManager {
7459
7551
  this.enableCursor = enableCursor;
7460
7552
  this.cursorInstances = /* @__PURE__ */ new Map();
7461
7553
  this.userApplianceIcons = {};
7462
- this.sideEffectManager = new SideEffectManager$1();
7554
+ this.sideEffectManager = new o$1();
7463
7555
  this.store = this.manager.store;
7464
7556
  this.leaveFlag = true;
7465
7557
  this._style = "default";
@@ -7495,7 +7587,7 @@ class CursorManager {
7495
7587
  const now2 = Date.now();
7496
7588
  if (now2 - this.mouseMoveTimer > 48) {
7497
7589
  this.mouseMoveTimer = now2;
7498
- if (WindowManager.supportTeachingAidsPlugin && isRoom(WindowManager.displayer) && WindowManager.displayer.disableDeviceInputs) {
7590
+ if (WindowManager.supportAppliancePlugin && isRoom(WindowManager.displayer) && WindowManager.displayer.disableDeviceInputs) {
7499
7591
  if (this.leaveFlag) {
7500
7592
  this.manager.dispatchInternalEvent(Events.CursorMove, {
7501
7593
  uid: this.manager.uid,
@@ -17970,7 +18062,7 @@ const _IframeBridge = class {
17970
18062
  this.allowAppliances = ["clicker"];
17971
18063
  this.bridgeDisposer = noop$2;
17972
18064
  this.rootRect = null;
17973
- this.sideEffectManager = new SideEffectManager$1();
18065
+ this.sideEffectManager = new o$1();
17974
18066
  this.execListenIframe = debounce$1((options2) => {
17975
18067
  this.listenIframe(options2);
17976
18068
  }, 50);
@@ -18140,7 +18232,9 @@ const _IframeBridge = class {
18140
18232
  const room = this.displayer;
18141
18233
  const scenes = room.entireScenes()[this.attributes.displaySceneDir];
18142
18234
  if (!scenes || scenes.length !== page) {
18143
- const genScenes = times(page, (index2) => ({ name: String(index2 + 1) }));
18235
+ const genScenes = times(page, (index2) => ({
18236
+ name: String(index2 + 1)
18237
+ }));
18144
18238
  room.putScenes(this.attributes.displaySceneDir, genScenes);
18145
18239
  this.manager.setMainViewScenePath(this.attributes.displaySceneDir);
18146
18240
  }
@@ -18429,19 +18523,23 @@ const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
18429
18523
  const _WindowManager = class extends InvisiblePlugin {
18430
18524
  constructor(context) {
18431
18525
  super(context);
18432
- this.version = "0.4.73-beta.0";
18433
- this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.28", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "side-effect-manager": "0.1.5", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.2.17", "@netless/app-media-player": "0.1.0-beta.6", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.22", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.5.3", "vitest": "^0.14.1", "white-web-sdk": "2.16.43" } };
18526
+ this.version = "0.4.73";
18527
+ this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.28", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.0" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.17", "@netless/app-media-player": "0.1.0-beta.6", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.22", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "2.16.43" } };
18434
18528
  this.emitter = callbacks$1;
18435
18529
  this.viewMode = ViewMode.Broadcaster;
18436
18530
  this.isReplay = isPlayer(this.displayer);
18531
+ this._cursorUIDs = [];
18437
18532
  this.containerSizeRatio = _WindowManager.containerSizeRatio;
18438
18533
  _WindowManager.displayer = context.displayer;
18439
- window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.28", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "side-effect-manager": "0.1.5", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "^0.2.17", "@netless/app-media-player": "0.1.0-beta.6", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.22", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.5.3", "vitest": "^0.14.1", "white-web-sdk": "2.16.43" } };
18534
+ window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "0.2.28", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.0" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.17", "@netless/app-media-player": "0.1.0-beta.6", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.22", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "2.16.43" } };
18535
+ }
18536
+ static onCreate(manager) {
18537
+ _WindowManager._resolve(manager);
18440
18538
  }
18441
18539
  static async mount(params) {
18442
18540
  const room = params.room;
18443
18541
  _WindowManager.container = params.container;
18444
- _WindowManager.supportTeachingAidsPlugin = params.supportTeachingAidsPlugin;
18542
+ _WindowManager.supportAppliancePlugin = params.supportAppliancePlugin;
18445
18543
  const containerSizeRatio = params.containerSizeRatio;
18446
18544
  const debug2 = params.debug;
18447
18545
  const cursor = params.cursor;
@@ -18508,26 +18606,8 @@ const _WindowManager = class extends InvisiblePlugin {
18508
18606
  }
18509
18607
  return manager;
18510
18608
  }
18511
- static async initManager(room) {
18512
- let manager = room.getInvisiblePlugin(_WindowManager.kind);
18513
- if (!manager) {
18514
- if (isRoom(room)) {
18515
- if (room.isWritable === false) {
18516
- try {
18517
- await room.setWritable(true);
18518
- } catch (error) {
18519
- throw new Error("[WindowManger]: room must be switched to be writable");
18520
- }
18521
- manager = await createInvisiblePlugin(room);
18522
- manager == null ? void 0 : manager.ensureAttributes();
18523
- await wait(500);
18524
- await room.setWritable(false);
18525
- } else {
18526
- manager = await createInvisiblePlugin(room);
18527
- }
18528
- }
18529
- }
18530
- return manager;
18609
+ static initManager(room) {
18610
+ return createInvisiblePlugin(room);
18531
18611
  }
18532
18612
  static initContainer(manager, container, params) {
18533
18613
  const { chessboard, overwriteStyles, fullscreen } = params;
@@ -18847,6 +18927,27 @@ const _WindowManager = class extends InvisiblePlugin {
18847
18927
  callbacks$1.emit("fullscreenChange", fullscreen);
18848
18928
  }
18849
18929
  }
18930
+ get cursorUIDs() {
18931
+ return this._cursorUIDs;
18932
+ }
18933
+ setCursorUIDs(cursorUIDs) {
18934
+ var _a, _b;
18935
+ this._cursorUIDs = cursorUIDs || [];
18936
+ if (this._cursorUIDs.length === 0) {
18937
+ (_a = this._cursorUIDsStyleDOM) == null ? void 0 : _a.remove();
18938
+ } else {
18939
+ if (!this._cursorUIDsStyleDOM) {
18940
+ this._cursorUIDsStyleDOM = document.createElement("style");
18941
+ }
18942
+ (_b = _WindowManager.playground) == null ? void 0 : _b.appendChild(this._cursorUIDsStyleDOM);
18943
+ let style2 = "[data-cursor-uid] { display: none }";
18944
+ for (const uid of this._cursorUIDs) {
18945
+ style2 += `
18946
+ [data-cursor-uid="${uid}"] { display: flex }`;
18947
+ }
18948
+ this._cursorUIDsStyleDOM.textContent = style2;
18949
+ }
18950
+ }
18850
18951
  get mainView() {
18851
18952
  if (this.appManager) {
18852
18953
  return this.appManager.mainViewProxy.view;
@@ -19178,6 +19279,7 @@ WindowManager.kind = "WindowManager";
19178
19279
  WindowManager.debug = false;
19179
19280
  WindowManager.containerSizeRatio = DEFAULT_CONTAINER_RATIO;
19180
19281
  WindowManager.isCreated = false;
19282
+ WindowManager._resolve = (_manager) => void 0;
19181
19283
  setupBuiltin();
19182
19284
  export { AppCreateError, AppManagerNotInitError, AppNotRegisterError, BindContainerRoomPhaseInvalidError, BoxManagerNotFoundError, BoxNotCreatedError, BuiltinApps, DomEvents, IframeBridge, IframeEvents, InvalidScenePath, ParamsInvalidError, WhiteWebSDKInvalidError, WindowManager, calculateNextIndex, reconnectRefresher };
19183
19285
  //# sourceMappingURL=index.mjs.map