{"version":3,"sources":["../../src/inference/_warmup.ts","../../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.58.12_@types+node@22.19.1__postcss@8.5.23_tsx@4.23.1_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Loader for the bundled `@livekit/local-inference` native binding.\n *\n * Memory model (measured ~138 MB for the EOT model, ~2 MB for VAD): Node has\n * no forkserver/COW, so anything loaded in a job worker is private to that\n * worker. To avoid paying ~138 MB per worker, the EOT model is NOT loaded in\n * job workers — it runs in the shared `InferenceProcExecutor` (see\n * `inference/eot/runner.ts`), loaded once per host. The VAD stays in-process\n * (it's small and runs continuously) and is reached via this loader.\n *\n * There are intentionally no public `prewarm*` helpers: EOT auto-warms via\n * the inference runner's `initialize()` at proc startup, and the VAD lazy-\n * loads on first stream.\n */\nimport { createRequire } from 'node:module';\nimport { log } from '../log.js';\n\nconst cjsRequire = createRequire(import.meta.url);\n\nlet nativeMod: typeof import('@livekit/local-inference') | undefined;\nlet triedLoad = false;\n\nfunction getNative(): typeof import('@livekit/local-inference') | undefined {\n  if (triedLoad) return nativeMod;\n  triedLoad = true;\n  try {\n    nativeMod = cjsRequire('@livekit/local-inference') as typeof import('@livekit/local-inference');\n    return nativeMod;\n  } catch (err) {\n    log().warn(\n      { err: err instanceof Error ? err.message : String(err) },\n      '@livekit/local-inference native binding not loadable; local VAD/EOT paths disabled',\n    );\n    return undefined;\n  }\n}\n\n/** @internal Returns the loaded native module, or `undefined` if unavailable. */\nexport function _getLocalInferenceModule(): typeof import('@livekit/local-inference') | undefined {\n  return getNative();\n}\n","// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n  typeof document === 'undefined'\n    ? new URL(`file:${__filename}`).href\n    : (document.currentScript && document.currentScript.src) ||\n      new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,OAClD,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEpC,IAAM,gBAAgC,iCAAiB;ADO9D,yBAA8B;AAC9B,iBAAoB;AAEpB,MAAM,iBAAa,kCAAc,aAAe;AAEhD,IAAI;AACJ,IAAI,YAAY;AAEhB,SAAS,YAAmE;AAC1E,MAAI,UAAW,QAAO;AACtB,cAAY;AACZ,MAAI;AACF,gBAAY,WAAW,0BAA0B;AACjD,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,wBAAI,EAAE;AAAA,MACJ,EAAE,KAAK,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAE;AAAA,MACxD;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACF;AAGO,SAAS,2BAAkF;AAChG,SAAO,UAAU;AACnB;","names":[]}