{"version":3,"file":"worker.entry.js","names":[],"sources":["esm/layout/worker.entry.js"],"sourcesContent":["import { layoutWithDagre } from \"./dagre\";\nfunction runLayoutMessage(data) {\n  const message = data;\n  if (!message || typeof message !== \"object\") return void 0;\n  if (message.t === \"ping\") return { t: \"pong\" };\n  if (message.t !== \"layout\") return void 0;\n  try {\n    return { t: \"result\", id: message.id, result: layoutWithDagre(message.request) };\n  } catch (error) {\n    return {\n      t: \"error\",\n      id: message.id,\n      message: error instanceof Error ? error.message : String(error)\n    };\n  }\n}\nfunction inWorkerScope() {\n  return typeof WorkerGlobalScope !== \"undefined\" && typeof self !== \"undefined\" && self instanceof WorkerGlobalScope;\n}\nif (inWorkerScope()) {\n  self.addEventListener(\"message\", (event) => {\n    const response = runLayoutMessage(event.data);\n    if (response) self.postMessage(response);\n  });\n}\nexport {\n  runLayoutMessage\n};\n//# sourceMappingURL=worker.entry.js.map\n"],"mappings":";;;AACA,SAAS,iBAAiB,MAAM;CAC9B,MAAM,UAAU;CAChB,IAAI,CAAC,WAAW,OAAO,YAAY,UAAU,OAAO,KAAK;CACzD,IAAI,QAAQ,MAAM,QAAQ,OAAO,EAAE,GAAG,OAAO;CAC7C,IAAI,QAAQ,MAAM,UAAU,OAAO,KAAK;CACxC,IAAI;EACF,OAAO;GAAE,GAAG;GAAU,IAAI,QAAQ;GAAI,QAAQ,gBAAgB,QAAQ,OAAO;EAAE;CACjF,SAAS,OAAO;EACd,OAAO;GACL,GAAG;GACH,IAAI,QAAQ;GACZ,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EAChE;CACF;AACF;AACA,SAAS,gBAAgB;CACvB,OAAO,OAAO,sBAAsB,eAAe,OAAO,SAAS,eAAe,gBAAgB;AACpG;AACA,IAAI,cAAc,GAAG;CACnB,KAAK,iBAAiB,YAAY,UAAU;EAC1C,MAAM,WAAW,iBAAiB,MAAM,IAAI;EAC5C,IAAI,UAAU,KAAK,YAAY,QAAQ;CACzC,CAAC;AACH"}