"use strict";var e=this&&this.__awaiter||function(e,t,s,i){return new(s||(s=Promise))((function(a,r){function o(e){try{c(i.next(e))}catch(e){r(e)}}function n(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,n)}c((i=i.apply(e,t||[])).next())}))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.distTagsCmd=void 0;const t=require("../core/install/common/OptionValid"),s=require("../core/dist-tags/DistTags"),i=require("../common/message");exports.distTagsCmd=function(a,r,o,n){return e(this,void 0,void 0,(function*(){(0,t.validDistTagsOptions)("dist-tags",n),function(e){if(!e)throw new Error(i.Messages.DistTags.SubcommandIsEmpty);if(!["add","rm","remove","up","update","ls","list"].includes(e))throw new Error((0,i.format)(i.Messages.DistTags.SubcommandNotSupport,{subcommand:e}))}(a);const e=new s.DistTags(r,o,n.publish_registry);switch(a){case"add":yield e.add();break;case"rm":case"remove":yield e.remove();break;case"up":case"update":yield e.update();break;case"ls":case"list":yield e.list()}}))};