(()=>{function e(e,n,t,o){var s=this;function a(){e.responseTemplateForm.$setPristine(),e.responseTemplateForm.$setUntouched()}function r(){e.responseTemplateForm.msgId.$validate()}s.validation=o.validation,s.addPattern=t.addResponseTemplatePattern,s.removePattern=t.removeResponseTemplatePattern,s.$onChanges=function(e){e.responseTemplate&&e.responseTemplate.currentValue&&(e=e.responseTemplate.currentValue,s.originalMsgId=e.msgId,s.responseTemplate=_.cloneDeep(e),n(a),n(r))},s.save=function(){s.onSave({responseTemplate:s.responseTemplate})},s.remove=function(){s.onRemove({responseTemplate:s.responseTemplate})},s.cancel=function(){s.onCancel()}}e.$inject=["$scope","$timeout","c8ySmartRestTemplates","c8yConfig"],angular.module("c8y.smartRestEditor").component("c8ySmartRestResponseEditor",{bindings:{template:"<",responseTemplate:"<",onSave:"&",onRemove:"&",onCancel:"&"},templateUrl:":::PLUGIN_PATH:::/responseEditor/responseEditor.html",controller:e,controllerAs:"$ctrl"})})();