define("discourse/plugins/discourse-mass-promote/discourse/controllers/admin-plugins-discourse-mass-promote",["exports","discourse/lib/ajax","discourse/lib/ajax-error","@ember/object/computed"],(function(s,e,t,r){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var n=["external_ids","usernames"],o=Ember.Controller.extend({targetUsersEmpty:(0,r.empty)("target_users"),submitDisabled:(0,r.or)("targetUsersEmpty","loading"),init:function(){this._super.apply(this,arguments);var s=n[0],e=n.map((function(s){return{name:I18n.t("discourse_bulk_messages.user_modes.".concat(s)),value:s}}));this.setProperties({currentUserListMode:s,userListModes:e,trust_level:this.siteSettings.discourse_mass_promote_default_trust_level})},actions:{promote:function(){var s=this;this.set("loading",!0),this.set("success",!1);var r={trust_level:this.get("trust_level")};r[this.get("currentUserListMode")]=this.get("target_users").split("\n"),(0,e.ajax)("/admin/plugins/discourse-mass-promote.json",{data:r,method:"POST"}).then((function(){s.set("success",!0)})).catch(t.popupAjaxError).finally((function(){s.set("loading",!1)}))}}});s.default=o})),define("discourse/plugins/discourse-mass-promote/discourse/discourse-mass-promote-route-map",["exports"],(function(s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;s.default={resource:"admin.adminPlugins",path:"/plugins",map:function(){this.route("discourse-mass-promote")}}})),Ember.TEMPLATES["javascripts/admin/plugins-discourse-mass-promote"]=Ember.HTMLBars.template({id:null,block:'{"symbols":[],"statements":[[7,"div",true],[10,"class","control-group"],[8],[0,"\\n\\n  "],[7,"h3",true],[8],[1,[28,"i18n",["discourse_mass_promote.users.title"],null],false],[9],[0,"\\n\\n  "],[7,"div",true],[10,"class","controls"],[8],[0,"\\n    "],[7,"label",true],[10,"for","mass-promote-user-mode"],[8],[1,[28,"i18n",["discourse_mass_promote.users.mode"],null],false],[9],[0,"\\n    "],[1,[28,"combo-box",null,[["valueProperty","content","value","id","onChange"],["value",[24,["userListModes"]],[24,["currentUserListMode"]],"mass-promote-user-mode",[28,"action",[[23,0,[]],[28,"mut",[[24,["currentUserListMode"]]],null]],null]]]],false],[0,"\\n  "],[9],[0,"\\n\\n  "],[7,"br",true],[8],[9],[0,"\\n\\n  "],[7,"div",true],[10,"class","controls"],[8],[0,"\\n    "],[7,"label",true],[8],[1,[28,"i18n",["discourse_mass_promote.users.input"],null],false],[9],[0,"\\n    "],[1,[28,"textarea",null,[["value"],[[24,["target_users"]]]]],false],[0,"\\n  "],[9],[0,"\\n\\n  "],[7,"br",true],[8],[9],[0,"\\n\\n  "],[7,"h3",true],[8],[1,[28,"i18n",["discourse_mass_promote.trust_level.title"],null],false],[9],[0,"\\n\\n  "],[7,"div",true],[10,"class","controls"],[8],[0,"\\n    "],[7,"label",true],[8],[1,[28,"i18n",["discourse_mass_promote.trust_level.label"],null],false],[9],[0,"\\n    "],[1,[28,"input",null,[["value","type","class"],[[24,["trust_level"]],"number","input-small"]]],false],[0,"\\n  "],[9],[0,"\\n\\n  "],[7,"br",true],[8],[9],[7,"br",true],[8],[9],[0,"\\n\\n  "],[7,"div",true],[10,"class","controls"],[8],[0,"\\n    "],[1,[28,"d-button",null,[["class","action","disabled","label"],["btn-default",[28,"action",[[23,0,[]],"promote"],null],[24,["submitDisabled"]],"discourse_mass_promote.promote"]]],false],[0,"\\n  "],[9],[0,"\\n\\n  "],[1,[28,"conditional-loading-spinner",null,[["condition"],[[24,["loading"]]]]],false],[0,"\\n\\n  "],[7,"br",true],[8],[9],[0,"\\n\\n"],[4,"if",[[24,["success"]]],null,{"statements":[[0,"    "],[7,"div",true],[10,"class","alert alert-success"],[8],[0,"\\n      "],[7,"p",true],[8],[1,[28,"i18n",["discourse_bulk_messages.success"],null],false],[9],[0,"\\n    "],[9],[0,"\\n"]],"parameters":[]},null],[0,"\\n"],[9],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"javascripts/discourse/templates/admin/plugins-discourse-mass-promote"}});
//# sourceMappingURL=https://doy2mn9upadnk.cloudfront.net/assets/plugins/discourse-mass-promote-fc2cfd737e61ba36737426f28651440dcd886e3a5a3913dd6c6e73b54571684a.js.map