define("discourse/plugins/discourse-enhanced-anonymize/discourse/controllers/admin-plugins-discourse-enhanced-anonymize",["exports","discourse/lib/ajax","discourse/lib/ajax-error","@ember/object/computed","discourse-common/utils/decorators","discourse/lib/computed"],(function(e,n,s,t,i,r){"use strict";var a,u,c,l;function o(e,n,s,t,i){var r={};return Object.keys(t).forEach((function(e){r[e]=t[e]})),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=s.slice().reverse().reduce((function(s,t){return t(e,n,s)||s}),r),i&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(i):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(e,n,r),r=null),r}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var d=Ember.Controller.extend((a=(0,i.default)("count","maxReferences"),u=(0,i.default)("loading","reference"),c=(0,i.default)("loading","reference","referenceCounted","count","exceeded"),o(l={reference:"",referenceCounted:null,count:null,loading:!1,success:!1,job:null,counted:(0,t.notEmpty)("count"),maxReferences:(0,r.setting)("discourse_enhanced_anonymize_max_references"),exceeded:function(e,n){return e&&e>n},countDisabled:function(e,n){return e||!n},submitDisabled:function(e,n,s,t,i){return e||!s||n!=s||0==t||i},actions:{count:function(){var e=this;this.set("loading",!0),this.set("success",!1),this.set("referenceCounted",null),this.set("count",null);var t=this.get("reference");(0,n.ajax)("/admin/plugins/anonymize-reference/count",{data:{reference:t},method:"GET"}).then((function(n){e.set("referenceCounted",t),e.set("count",n.count)})).catch(s.popupAjaxError).finally((function(){e.set("loading",!1)}))},action:function(){var e=this;this.set("loading",!0),this.set("success",!1),(0,n.ajax)("/admin/plugins/anonymize-reference",{data:{reference:this.get("referenceCounted")},method:"POST"}).then((function(n){e.set("success",!0),e.set("job",n.job),e.set("referenceCounted",null),e.set("count",null)})).catch(s.popupAjaxError).finally((function(){e.set("loading",!1)}))}}},"exceeded",[a],Object.getOwnPropertyDescriptor(l,"exceeded"),l),o(l,"countDisabled",[u],Object.getOwnPropertyDescriptor(l,"countDisabled"),l),o(l,"submitDisabled",[c],Object.getOwnPropertyDescriptor(l,"submitDisabled"),l),l));e.default=d})),define("discourse/plugins/discourse-enhanced-anonymize/discourse/discourse-enhanced-anonymize-route-map",["exports"],(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={resource:"admin.adminPlugins",path:"/plugins",map:function(){this.route("discourse-enhanced-anonymize")}}})),Ember.TEMPLATES["javascripts/admin/plugins-discourse-enhanced-anonymize"]=Ember.HTMLBars.template({id:null,block:'{"symbols":[],"statements":[[7,"div",true],[10,"class","control-group"],[8],[0,"\\n\\n  "],[7,"div",true],[10,"class","controls"],[8],[0,"\\n    "],[7,"label",true],[8],[1,[28,"i18n",["discourse_enhanced_anonymize.reference"],null],false],[9],[0,"\\n    "],[1,[28,"input",null,[["value"],[[24,["reference"]]]]],false],[0,"\\n  "],[9],[0,"\\n\\n  "],[7,"div",true],[10,"class","controls"],[8],[0,"\\n    "],[1,[28,"d-button",null,[["class","action","label","disabled"],["btn-default",[28,"action",[[23,0,[]],"count"],null],"discourse_enhanced_anonymize.count",[24,["countDisabled"]]]]],false],[0,"\\n  "],[9],[0,"\\n\\n"],[4,"unless",[[24,["success"]]],null,{"statements":[[4,"if",[[24,["counted"]]],null,{"statements":[[0,"\\n      "],[7,"p",true],[8],[1,[28,"i18n",["discourse_enhanced_anonymize.result"],null],false],[0,": "],[1,[22,"count"],false],[9],[0,"\\n\\n      "],[7,"div",true],[10,"class","controls"],[8],[0,"\\n        "],[1,[28,"d-button",null,[["class","action","label","disabled"],["btn-default",[28,"action",[[23,0,[]],"action"],null],"discourse_enhanced_anonymize.submit",[24,["submitDisabled"]]]]],false],[0,"\\n      "],[9],[0,"\\n\\n"],[4,"if",[[24,["exceeded"]]],null,{"statements":[[0,"\\n        "],[7,"br",true],[8],[9],[0,"\\n\\n        "],[7,"div",true],[10,"class","alert alert-error"],[8],[0,"\\n          "],[1,[28,"i18n",["discourse_enhanced_anonymize.exceeded"],null],false],[0,"\\n        "],[9],[0,"\\n\\n"]],"parameters":[]},null],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null],[0,"\\n  "],[1,[28,"conditional-loading-spinner",null,[["condition"],[[24,["loading"]]]]],false],[0,"\\n\\n"],[4,"if",[[24,["success"]]],null,{"statements":[[0,"\\n    "],[7,"br",true],[8],[9],[0,"\\n\\n    "],[7,"div",true],[10,"class","alert alert-success"],[8],[0,"\\n      "],[1,[28,"i18n",["discourse_enhanced_anonymize.success"],null],false],[0,"\\n      "],[7,"br",true],[8],[9],[0,"\\n      "],[1,[28,"i18n",["discourse_enhanced_anonymize.success_job"],null],false],[0,": "],[7,"b",true],[8],[1,[22,"job"],false],[9],[0,"\\n    "],[9],[0,"\\n\\n"]],"parameters":[]},null],[0,"\\n"],[9],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"javascripts/discourse/templates/admin/plugins-discourse-enhanced-anonymize"}});
//# sourceMappingURL=https://doy2mn9upadnk.cloudfront.net/assets/plugins/discourse-enhanced-anonymize-112da5d9a554d72242af07272d7715da63f1bd0b6c2935fa1d78c108879d70fc.js.map