r
} = _devtoolsUtils.workerUtils;
let dispatcher;
let workerPath;

const start = path => {
  workerPath = path;
};

exports.start = start;

const stop = () => {
  if (dispatcher) {
    dispatcher.stop();
    dispatcher = null;
    workerPath = null;
  }
};

exports.stop = stop;

async function prettyPrint({
  text,
  url
}) {
  if (!dispatcher) {
    dispatcher = new WorkerDispatcher();
    dispatcher.start(workerPath);
  }

  return dispatcher.invoke("prettyPrint", {
    url,
    indent: _prefs.prefs.indentSize,
    sourceText: text
  });
}PK