import { init_esm_shims } from './chunk-W5GDONKU.js';
import { onExit } from 'signal-exit';
import ws from 'ws';

// src/devtools.ts
init_esm_shims();
var customGlobal = globalThis;
customGlobal.WebSocket ||= ws;
customGlobal.window ||= customGlobal;
customGlobal.self ||= customGlobal;
customGlobal.isDevtoolsEnabled = true;
customGlobal.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = [
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "Context.Provider",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "KubbRoot",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "KubbErrorBoundary",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "kubb-file",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "kubb-text",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "kubb-import",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "kubb-export",
    isEnabled: true,
    isValid: true
  },
  {
    // ComponentFilterDisplayName
    type: 2,
    value: "kubb-source",
    isEnabled: true,
    isValid: true
  }
];
function openDevtools() {
  let subprocess;
  import('execa').then(async (execa) => {
    console.log("Opening devtools");
    subprocess = execa.execa({ preferLocal: true })`npx react-devtools`;
  }).then(() => {
    return import('./backend-SFUVMIF5.js');
  }).then((devtools) => {
    console.log("Connecting devtools");
    devtools.default.connectToDevTools();
  }).catch(() => {
    console.log("Error connecting devtools");
  });
  onExit(
    () => {
      console.log("Disconnecting devtools");
      subprocess?.kill();
    },
    { alwaysLast: false }
  );
}
openDevtools();
//# sourceMappingURL=devtools.js.map
//# sourceMappingURL=devtools.js.map