chunk-2VOPQV4X.js 685 B

1234567891011121314151617181920212223242526272829
  1. import {
  2. EditorSimpleWorker,
  3. SimpleWorkerServer
  4. } from "./chunk-FBUDSZGC.js";
  5. // node_modules/.pnpm/monaco-editor@0.38.0/node_modules/monaco-editor/esm/vs/editor/editor.worker.js
  6. var initialized = false;
  7. function initialize(foreignModule) {
  8. if (initialized) {
  9. return;
  10. }
  11. initialized = true;
  12. const simpleWorker = new SimpleWorkerServer((msg) => {
  13. globalThis.postMessage(msg);
  14. }, (host) => new EditorSimpleWorker(host, foreignModule));
  15. globalThis.onmessage = (e) => {
  16. simpleWorker.onmessage(e.data);
  17. };
  18. }
  19. globalThis.onmessage = (e) => {
  20. if (!initialized) {
  21. initialize(null);
  22. }
  23. };
  24. export {
  25. initialize
  26. };
  27. //# sourceMappingURL=chunk-2VOPQV4X.js.map