/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/cli-prompts@0.0.0/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var events=require("events");
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function __awaiter(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{p(n.next(t))}catch(t){r(t)}}function u(t){try{p(n.throw(t))}catch(t){r(t)}}function p(t){t.done?s(t.value):new e((function(i){i(t.value)})).then(o,u)}p((n=n.apply(t,i||[])).next())}))}class Prompt extends events.EventEmitter{constructor(t){super(),this.options=t,this.state={skipped:!1}}run(){return new Promise(((t,i)=>__awaiter(this,void 0,void 0,(function*(){if(this.once("submit",t),this.once("cancel",i),yield this.skip())return this.render=()=>{},this.submit();yield this.initialize(),this.emit("run")}))))}skip(){return __awaiter(this,void 0,void 0,(function*(){return this.state.skipped=!0===this.options.skip,"function"==typeof this.options.skip&&(this.state.skipped=yield this.options.skip.call(this)),this.state.skipped}))}initialize(){return __awaiter(this,void 0,void 0,(function*(){}))}submit(){return __awaiter(this,void 0,void 0,(function*(){}))}render(){throw new Error("Expect prompt to have custom render method")}}exports.Prompt=Prompt;
//# sourceMappingURL=/sm/a3003c829ce112246d6f67509ac1e941f291494324dd50af679e6e38d4990b0e.map