{"version":3,"sources":["../src/devtools-config.ts"],"sourcesContent":["export const DEFAULT_FARM_DEVTOOLS_SHORTCUT = \"mod+shift+.\";\nexport const FARM_DEVTOOLS_PATH = \"/__farm/devtools\";\nexport const FARM_DEVTOOLS_LAUNCH_PARAM = \"__farm_devtools\";\n\n/**\n * Configuration for the built-in DevTools dashboard. The dashboard is deprecated in favor\n * of the `@farm.js/devtools` plugin, which reuses this configuration for enablement and\n * the keyboard shortcut. Both options keep working while the built-in UI remains available.\n */\nexport interface FarmDevtoolsConfig {\n  /** Enable the development-only DevTools UI and runtime endpoints. */\n  enabled?: boolean;\n  /** Keyboard shortcut used to toggle DevTools, or false to disable the shortcut. */\n  shortcut?: string | false;\n}\n\nexport type FarmDevtoolsUserConfig = boolean | FarmDevtoolsConfig;\n\nexport interface ResolvedFarmDevtoolsConfig {\n  enabled: boolean;\n  shortcut: string | false;\n}\n\nexport function resolveFarmDevtoolsConfig(\n  config: FarmDevtoolsUserConfig | ResolvedFarmDevtoolsConfig | undefined,\n  mode: \"development\" | \"production\" = \"development\",\n): ResolvedFarmDevtoolsConfig {\n  if (mode !== \"development\" || config === false) {\n    return { enabled: false, shortcut: false };\n  }\n\n  const options = config === true || config === undefined ? {} : config;\n  const enabled = options.enabled ?? true;\n\n  if (!enabled) {\n    return { enabled: false, shortcut: false };\n  }\n\n  const shortcut =\n    typeof options.shortcut === \"string\" && options.shortcut.trim()\n      ? options.shortcut\n          .toLowerCase()\n          .split(\"+\")\n          .map((part) => part.trim())\n          .filter(Boolean)\n          .join(\"+\")\n      : options.shortcut === false\n        ? false\n        : DEFAULT_FARM_DEVTOOLS_SHORTCUT;\n\n  return { enabled: true, shortcut };\n}\n"],"mappings":";;;;;AAAO,IAAM,iCAAiC;AACvC,IAAM,qBAAqB;AAC3B,IAAM,6BAA6B;AAqBnC,SAAS,0BACd,QACA,OAAqC,eACT;AAC5B,MAAI,SAAS,iBAAiB,WAAW,OAAO;AAC9C,WAAO,EAAE,SAAS,OAAO,UAAU,MAAM;AAAA,EAC3C;AAEA,QAAM,UAAU,WAAW,QAAQ,WAAW,SAAY,CAAC,IAAI;AAC/D,QAAM,UAAU,QAAQ,WAAW;AAEnC,MAAI,CAAC,SAAS;AACZ,WAAO,EAAE,SAAS,OAAO,UAAU,MAAM;AAAA,EAC3C;AAEA,QAAM,WACJ,OAAO,QAAQ,aAAa,YAAY,QAAQ,SAAS,KAAK,IAC1D,QAAQ,SACL,YAAY,EACZ,MAAM,GAAG,EACT,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,OAAO,EACd,KAAK,GAAG,IACX,QAAQ,aAAa,QACnB,QACA;AAER,SAAO,EAAE,SAAS,MAAM,SAAS;AACnC;AA5BgB;","names":[]}