{"ast":null,"code":"'use strict';\n\nvar _asyncToGenerator = require(\"D:\\\\Development\\\\Work\\\\CENOS\\\\cenos-ui\\\\node_modules\\\\@angular-devkit\\\\build-angular\\\\node_modules\\\\@babel\\\\runtime\\\\helpers\\\\asyncToGenerator.js\").default;\n\nconst path = require('path');\n\nconst childProcess = require('child_process');\n\nconst crossSpawn = require('cross-spawn');\n\nconst stripFinalNewline = require('strip-final-newline');\n\nconst npmRunPath = require('npm-run-path');\n\nconst onetime = require('onetime');\n\nconst makeError = require('./lib/error');\n\nconst normalizeStdio = require('./lib/stdio');\n\nconst {\n  spawnedKill,\n  spawnedCancel,\n  setupTimeout,\n  setExitHandler\n} = require('./lib/kill');\n\nconst {\n  handleInput,\n  getSpawnedResult,\n  makeAllStream,\n  validateInputSync\n} = require('./lib/stream.js');\n\nconst {\n  mergePromise,\n  getSpawnedPromise\n} = require('./lib/promise.js');\n\nconst {\n  joinCommand,\n  parseCommand\n} = require('./lib/command.js');\n\nconst DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;\n\nconst getEnv = ({\n  env: envOption,\n  extendEnv,\n  preferLocal,\n  localDir,\n  execPath\n}) => {\n  const env = extendEnv ? { ...process.env,\n    ...envOption\n  } : envOption;\n\n  if (preferLocal) {\n    return npmRunPath.env({\n      env,\n      cwd: localDir,\n      execPath\n    });\n  }\n\n  return env;\n};\n\nconst handleArguments = (file, args, options = {}) => {\n  const parsed = crossSpawn._parse(file, args, options);\n\n  file = parsed.command;\n  args = parsed.args;\n  options = parsed.options;\n  options = {\n    maxBuffer: DEFAULT_MAX_BUFFER,\n    buffer: true,\n    stripFinalNewline: true,\n    extendEnv: true,\n    preferLocal: false,\n    localDir: options.cwd || process.cwd(),\n    execPath: process.execPath,\n    encoding: 'utf8',\n    reject: true,\n    cleanup: true,\n    all: false,\n    windowsHide: true,\n    ...options\n  };\n  options.env = getEnv(options);\n  options.stdio = normalizeStdio(options);\n\n  if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') {\n    // #116\n    args.unshift('/q');\n  }\n\n  return {\n    file,\n    args,\n    options,\n    parsed\n  };\n};\n\nconst handleOutput = (options, value, error) => {\n  if (typeof value !== 'string' && !Buffer.isBuffer(value)) {\n    // When `execa.sync()` errors, we normalize it to '' to mimic `execa()`\n    return error === undefined ? undefined : '';\n  }\n\n  if (options.stripFinalNewline) {\n    return stripFinalNewline(value);\n  }\n\n  return value;\n};\n\nconst execa = (file, args, options) => {\n  const parsed = handleArguments(file, args, options);\n  const command = joinCommand(file, args);\n  let spawned;\n\n  try {\n    spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);\n  } catch (error) {\n    // Ensure the returned error is always both a promise and a child process\n    const dummySpawned = new childProcess.ChildProcess();\n    const errorPromise = Promise.reject(makeError({\n      error,\n      stdout: '',\n      stderr: '',\n      all: '',\n      command,\n      parsed,\n      timedOut: false,\n      isCanceled: false,\n      killed: false\n    }));\n    return mergePromise(dummySpawned, errorPromise);\n  }\n\n  const spawnedPromise = getSpawnedPromise(spawned);\n  const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);\n  const processDone = setExitHandler(spawned, parsed.options, timedPromise);\n  const context = {\n    isCanceled: false\n  };\n  spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));\n  spawned.cancel = spawnedCancel.bind(null, spawned, context);\n\n  const handlePromise = /*#__PURE__*/function () {\n    var _ref = _asyncToGenerator(function* () {\n      const [{\n        error,\n        exitCode,\n        signal,\n        timedOut\n      }, stdoutResult, stderrResult, allResult] = yield getSpawnedResult(spawned, parsed.options, processDone);\n      const stdout = handleOutput(parsed.options, stdoutResult);\n      const stderr = handleOutput(parsed.options, stderrResult);\n      const all = handleOutput(parsed.options, allResult);\n\n      if (error || exitCode !== 0 || signal !== null) {\n        const returnedError = makeError({\n          error,\n          exitCode,\n          signal,\n          stdout,\n          stderr,\n          all,\n          command,\n          parsed,\n          timedOut,\n          isCanceled: context.isCanceled,\n          killed: spawned.killed\n        });\n\n        if (!parsed.options.reject) {\n          return returnedError;\n        }\n\n        throw returnedError;\n      }\n\n      return {\n        command,\n        exitCode: 0,\n        stdout,\n        stderr,\n        all,\n        failed: false,\n        timedOut: false,\n        isCanceled: false,\n        killed: false\n      };\n    });\n\n    return function handlePromise() {\n      return _ref.apply(this, arguments);\n    };\n  }();\n\n  const handlePromiseOnce = onetime(handlePromise);\n\n  crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);\n\n  handleInput(spawned, parsed.options.input);\n  spawned.all = makeAllStream(spawned, parsed.options);\n  return mergePromise(spawned, handlePromiseOnce);\n};\n\nmodule.exports = execa;\n\nmodule.exports.sync = (file, args, options) => {\n  const parsed = handleArguments(file, args, options);\n  const command = joinCommand(file, args);\n  validateInputSync(parsed.options);\n  let result;\n\n  try {\n    result = childProcess.spawnSync(parsed.file, parsed.args, parsed.options);\n  } catch (error) {\n    throw makeError({\n      error,\n      stdout: '',\n      stderr: '',\n      all: '',\n      command,\n      parsed,\n      timedOut: false,\n      isCanceled: false,\n      killed: false\n    });\n  }\n\n  const stdout = handleOutput(parsed.options, result.stdout, result.error);\n  const stderr = handleOutput(parsed.options, result.stderr, result.error);\n\n  if (result.error || result.status !== 0 || result.signal !== null) {\n    const error = makeError({\n      stdout,\n      stderr,\n      error: result.error,\n      signal: result.signal,\n      exitCode: result.status,\n      command,\n      parsed,\n      timedOut: result.error && result.error.code === 'ETIMEDOUT',\n      isCanceled: false,\n      killed: result.signal !== null\n    });\n\n    if (!parsed.options.reject) {\n      return error;\n    }\n\n    throw error;\n  }\n\n  return {\n    command,\n    exitCode: 0,\n    stdout,\n    stderr,\n    failed: false,\n    timedOut: false,\n    isCanceled: false,\n    killed: false\n  };\n};\n\nmodule.exports.command = (command, options) => {\n  const [file, ...args] = parseCommand(command);\n  return execa(file, args, options);\n};\n\nmodule.exports.commandSync = (command, options) => {\n  const [file, ...args] = parseCommand(command);\n  return execa.sync(file, args, options);\n};\n\nmodule.exports.node = (scriptPath, args, options = {}) => {\n  if (args && !Array.isArray(args) && typeof args === 'object') {\n    options = args;\n    args = [];\n  }\n\n  const stdio = normalizeStdio.node(options);\n  const defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect'));\n  const {\n    nodePath = process.execPath,\n    nodeOptions = defaultExecArgv\n  } = options;\n  return execa(nodePath, [...nodeOptions, scriptPath, ...(Array.isArray(args) ? args : [])], { ...options,\n    stdin: undefined,\n    stdout: undefined,\n    stderr: undefined,\n    stdio,\n    shell: false\n  });\n};","map":{"version":3,"sources":["D:/Development/Work/CENOS/cenos-ui/node_modules/execa/index.js"],"names":["path","require","childProcess","crossSpawn","stripFinalNewline","npmRunPath","onetime","makeError","normalizeStdio","spawnedKill","spawnedCancel","setupTimeout","setExitHandler","handleInput","getSpawnedResult","makeAllStream","validateInputSync","mergePromise","getSpawnedPromise","joinCommand","parseCommand","DEFAULT_MAX_BUFFER","getEnv","env","envOption","extendEnv","preferLocal","localDir","execPath","process","cwd","handleArguments","file","args","options","parsed","_parse","command","maxBuffer","buffer","encoding","reject","cleanup","all","windowsHide","stdio","platform","basename","unshift","handleOutput","value","error","Buffer","isBuffer","undefined","execa","spawned","spawn","dummySpawned","ChildProcess","errorPromise","Promise","stdout","stderr","timedOut","isCanceled","killed","spawnedPromise","timedPromise","processDone","context","kill","bind","cancel","handlePromise","exitCode","signal","stdoutResult","stderrResult","allResult","returnedError","failed","handlePromiseOnce","_enoent","hookChildProcess","input","module","exports","sync","result","spawnSync","status","code","commandSync","node","scriptPath","Array","isArray","defaultExecArgv","execArgv","filter","arg","startsWith","nodePath","nodeOptions","stdin","shell"],"mappings":"AAAA;;;;AACA,MAAMA,IAAI,GAAGC,OAAO,CAAC,MAAD,CAApB;;AACA,MAAMC,YAAY,GAAGD,OAAO,CAAC,eAAD,CAA5B;;AACA,MAAME,UAAU,GAAGF,OAAO,CAAC,aAAD,CAA1B;;AACA,MAAMG,iBAAiB,GAAGH,OAAO,CAAC,qBAAD,CAAjC;;AACA,MAAMI,UAAU,GAAGJ,OA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C,OAAvB,CAAP;AACA,CAHD;;AAKAoD,MAAM,CAACC,OAAP,CAAeO,IAAf,GAAsB,CAACC,UAAD,EAAa9D,IAAb,EAAmBC,OAAO,GAAG,EAA7B,KAAoC;AACzD,MAAID,IAAI,IAAI,CAAC+D,KAAK,CAACC,OAAN,CAAchE,IAAd,CAAT,IAAgC,OAAOA,IAAP,KAAgB,QAApD,EAA8D;AAC7DC,IAAAA,OAAO,GAAGD,IAAV;AACAA,IAAAA,IAAI,GAAG,EAAP;AACA;;AAED,QAAMY,KAAK,GAAGrC,cAAc,CAACsF,IAAf,CAAoB5D,OAApB,CAAd;AACA,QAAMgE,eAAe,GAAGrE,OAAO,CAACsE,QAAR,CAAiBC,MAAjB,CAAwBC,GAAG,IAAI,CAACA,GAAG,CAACC,UAAJ,CAAe,WAAf,CAAhC,CAAxB;AAEA,QAAM;AACLC,IAAAA,QAAQ,GAAG1E,OAAO,CAACD,QADd;AAEL4E,IAAAA,WAAW,GAAGN;AAFT,MAGFhE,OAHJ;AAKA,SAAOqB,KAAK,CACXgD,QADW,EAEX,CACC,GAAGC,WADJ,EAECT,UAFD,EAGC,IAAIC,KAAK,CAACC,OAAN,CAAchE,IAAd,IAAsBA,IAAtB,GAA6B,EAAjC,CAHD,CAFW,EAOX,EACC,GAAGC,OADJ;AAECuE,IAAAA,KAAK,EAAEnD,SAFR;AAGCQ,IAAAA,MAAM,EAAER,SAHT;AAICS,IAAAA,MAAM,EAAET,SAJT;AAKCT,IAAAA,KALD;AAMC6D,IAAAA,KAAK,EAAE;AANR,GAPW,CAAZ;AAgBA,CA9BD","sourcesContent":["'use strict';\nconst path = require('path');\nconst childProcess = require('child_process');\nconst crossSpawn = require('cross-spawn');\nconst stripFinalNewline = require('strip-final-newline');\nconst npmRunPath = require('npm-run-path');\nconst onetime = require('onetime');\nconst makeError = require('./lib/error');\nconst normalizeStdio = require('./lib/stdio');\nconst {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = require('./lib/kill');\nconst {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = require('./lib/stream.js');\nconst {mergePromise, getSpawnedPromise} = require('./lib/promise.js');\nconst {joinCommand, parseCommand} = require('./lib/command.js');\n\nconst DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;\n\nconst getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => {\n\tconst env = extendEnv ? {...process.env, ...envOption} : envOption;\n\n\tif (preferLocal) {\n\t\treturn npmRunPath.env({env, cwd: localDir, execPath});\n\t}\n\n\treturn env;\n};\n\nconst handleArguments = (file, args, options = {}) => {\n\tconst parsed = crossSpawn._parse(file, args, options);\n\tfile = parsed.command;\n\targs = parsed.args;\n\toptions = parsed.options;\n\n\toptions = {\n\t\tmaxBuffer: DEFAULT_MAX_BUFFER,\n\t\tbuffer: true,\n\t\tstripFinalNewline: true,\n\t\textendEnv: true,\n\t\tpreferLocal: false,\n\t\tlocalDir: options.cwd || process.cwd(),\n\t\texecPath: process.execPath,\n\t\tencoding: 'utf8',\n\t\treject: true,\n\t\tcleanup: true,\n\t\tall: false,\n\t\twindowsHide: true,\n\t\t...options\n\t};\n\n\toptions.env = getEnv(options);\n\n\toptions.stdio = normalizeStdio(options);\n\n\tif (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') {\n\t\t// #116\n\t\targs.unshift('/q');\n\t}\n\n\treturn {file, args, options, parsed};\n};\n\nconst handleOutput = (options, value, error) => {\n\tif (typeof value !== 'string' && !Buffer.isBuffer(value)) {\n\t\t// When `execa.sync()` errors, we normalize it to '' to mimic `execa()`\n\t\treturn error === undefined ? undefined : '';\n\t}\n\n\tif (options.stripFinalNewline) {\n\t\treturn stripFinalNewline(value);\n\t}\n\n\treturn value;\n};\n\nconst execa = (file, args, options) => {\n\tconst parsed = handleArguments(file, args, options);\n\tconst command = joinCommand(file, args);\n\n\tlet spawned;\n\ttry {\n\t\tspawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);\n\t} catch (error) {\n\t\t// Ensure the returned error is always both a promise and a child process\n\t\tconst dummySpawned = new childProcess.ChildProcess();\n\t\tconst errorPromise = Promise.reject(makeError({\n\t\t\terror,\n\t\t\tstdout: '',\n\t\t\tstderr: '',\n\t\t\tall: '',\n\t\t\tcommand,\n\t\t\tparsed,\n\t\t\ttimedOut: false,\n\t\t\tisCanceled: false,\n\t\t\tkilled: false\n\t\t}));\n\t\treturn mergePromise(dummySpawned, errorPromise);\n\t}\n\n\tconst spawnedPromise = getSpawnedPromise(spawned);\n\tconst timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);\n\tconst processDone = setExitHandler(spawned, parsed.options, timedPromise);\n\n\tconst context = {isCanceled: false};\n\n\tspawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));\n\tspawned.cancel = spawnedCancel.bind(null, spawned, context);\n\n\tconst handlePromise = async () => {\n\t\tconst [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);\n\t\tconst stdout = handleOutput(parsed.options, stdoutResult);\n\t\tconst stderr = handleOutput(parsed.options, stderrResult);\n\t\tconst all = handleOutput(parsed.options, allResult);\n\n\t\tif (error || exitCode !== 0 || signal !== null) {\n\t\t\tconst returnedError = makeError({\n\t\t\t\terror,\n\t\t\t\texitCode,\n\t\t\t\tsignal,\n\t\t\t\tstdout,\n\t\t\t\tstderr,\n\t\t\t\tall,\n\t\t\t\tcommand,\n\t\t\t\tparsed,\n\t\t\t\ttimedOut,\n\t\t\t\tisCanceled: context.isCanceled,\n\t\t\t\tkilled: spawned.killed\n\t\t\t});\n\n\t\t\tif (!parsed.options.reject) {\n\t\t\t\treturn returnedError;\n\t\t\t}\n\n\t\t\tthrow returnedError;\n\t\t}\n\n\t\treturn {\n\t\t\tcommand,\n\t\t\texitCode: 0,\n\t\t\tstdout,\n\t\t\tstderr,\n\t\t\tall,\n\t\t\tfailed: false,\n\t\t\ttimedOut: false,\n\t\t\tisCanceled: false,\n\t\t\tkilled: false\n\t\t};\n\t};\n\n\tconst handlePromiseOnce = onetime(handlePromise);\n\n\tcrossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);\n\n\thandleInput(spawned, parsed.options.input);\n\n\tspawned.all = makeAllStream(spawned, parsed.options);\n\n\treturn mergePromise(spawned, handlePromiseOnce);\n};\n\nmodule.exports = execa;\n\nmodule.exports.sync = (file, args, options) => {\n\tconst parsed = handleArguments(file, args, options);\n\tconst command = joinCommand(file, args);\n\n\tvalidateInputSync(parsed.options);\n\n\tlet result;\n\ttry {\n\t\tresult = childProcess.spawnSync(parsed.file, parsed.args, parsed.options);\n\t} catch (error) {\n\t\tthrow makeError({\n\t\t\terror,\n\t\t\tstdout: '',\n\t\t\tstderr: '',\n\t\t\tall: '',\n\t\t\tcommand,\n\t\t\tparsed,\n\t\t\ttimedOut: false,\n\t\t\tisCanceled: false,\n\t\t\tkilled: false\n\t\t});\n\t}\n\n\tconst stdout = handleOutput(parsed.options, result.stdout, result.error);\n\tconst stderr = handleOutput(parsed.options, result.stderr, result.error);\n\n\tif (result.error || result.status !== 0 || result.signal !== null) {\n\t\tconst error = makeError({\n\t\t\tstdout,\n\t\t\tstderr,\n\t\t\terror: result.error,\n\t\t\tsignal: result.signal,\n\t\t\texitCode: result.status,\n\t\t\tcommand,\n\t\t\tparsed,\n\t\t\ttimedOut: result.error && result.error.code === 'ETIMEDOUT',\n\t\t\tisCanceled: false,\n\t\t\tkilled: result.signal !== null\n\t\t});\n\n\t\tif (!parsed.options.reject) {\n\t\t\treturn error;\n\t\t}\n\n\t\tthrow error;\n\t}\n\n\treturn {\n\t\tcommand,\n\t\texitCode: 0,\n\t\tstdout,\n\t\tstderr,\n\t\tfailed: false,\n\t\ttimedOut: false,\n\t\tisCanceled: false,\n\t\tkilled: false\n\t};\n};\n\nmodule.exports.command = (command, options) => {\n\tconst [file, ...args] = parseCommand(command);\n\treturn execa(file, args, options);\n};\n\nmodule.exports.commandSync = (command, options) => {\n\tconst [file, ...args] = parseCommand(command);\n\treturn execa.sync(file, args, options);\n};\n\nmodule.exports.node = (scriptPath, args, options = {}) => {\n\tif (args && !Array.isArray(args) && typeof args === 'object') {\n\t\toptions = args;\n\t\targs = [];\n\t}\n\n\tconst stdio = normalizeStdio.node(options);\n\tconst defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect'));\n\n\tconst {\n\t\tnodePath = process.execPath,\n\t\tnodeOptions = defaultExecArgv\n\t} = options;\n\n\treturn execa(\n\t\tnodePath,\n\t\t[\n\t\t\t...nodeOptions,\n\t\t\tscriptPath,\n\t\t\t...(Array.isArray(args) ? args : [])\n\t\t],\n\t\t{\n\t\t\t...options,\n\t\t\tstdin: undefined,\n\t\t\tstdout: undefined,\n\t\t\tstderr: undefined,\n\t\t\tstdio,\n\t\t\tshell: false\n\t\t}\n\t);\n};\n"]},"metadata":{},"sourceType":"script"}