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IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACxJ,CAAC;AATD,oCASC","sourcesContent":["import { DebugLogger, exec, ExtraSpawnOptions, InvalidConfigurationError, spawn } from \"builder-util\"\nimport { ExecFileOptions, SpawnOptions } from \"child_process\"\nimport * as path from \"path\"\n\nexport class VmManager {\n get pathSep(): string {\n return path.sep\n }\n\n exec(file: string, args: Array, options?: ExecFileOptions, isLogOutIfDebug = true): Promise {\n return exec(file, args, options, isLogOutIfDebug)\n }\n\n spawn(file: string, args: Array, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise {\n return spawn(file, args, options, extraOptions)\n }\n\n toVmFile(file: string): string {\n return file\n }\n}\n\nexport async function getWindowsVm(debugLogger: DebugLogger): Promise {\n const parallelsVmModule = await import(\"./ParallelsVm\")\n const vmList = (await parallelsVmModule.parseVmList(debugLogger)).filter(it => [\"win-10\", \"win-11\"].includes(it.os))\n if (vmList.length === 0) {\n throw new InvalidConfigurationError(\"Cannot find suitable Parallels Desktop virtual machine (Windows 10 is required)\")\n }\n\n // prefer running or suspended vm\n return new parallelsVmModule.ParallelsVmManager(vmList.find(it => it.state === \"running\") || vmList.find(it => it.state === \"suspended\") || vmList[0])\n}\n"]}