lhcAppControllers.controller("CannedReplaceCtrl",["$scope","$http","$location","$rootScope","$log","$window",function(e,n,t,i,o,d){this.combinations=[],this.departments=[];var s=this;this.makeid=function(e){for(var n="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<e;i++)n+=t.charAt(Math.floor(Math.random()*t.length));return n},this.setConditions=function(){this.combinations=d.replaceConditions,this.departments=d.replaceDepartments},this.deleteElement=function(e,n){confirm("Are you sure?")&&n.splice(n.indexOf(e),1)},this.addOption=function(e){this.addDepartment(e)},this.move=function(e,n,t){index=n.indexOf(e),newIndex=index+t,newIndex>-1&&newIndex<n.length&&(removedElement=n.splice(index,1)[0],n.splice(newIndex,0,removedElement))},this.addCombination=function(){s.combinations.push({conditions:[],value:"",cannedRepeatPeriod:"0",dep_id:"0",dep_ids:[],priority:0}),setTimeout((function(){$(".btn-block-department").makeDropdown()}),1e3)},this.setDateTime=function(){console.log("here")},this.addDepartment=function(e){e.dep_ids||(e.dep_ids=[]),-1==e.dep_ids.indexOf(e.dep_id)&&e.dep_ids.push(e.dep_id)},this.addCondition=function(e){e.conditions.push({field:"",logic:"and"})},this.moveUp=function(e,n){s.move(e,n,-1)},this.moveDown=function(e,n){s.move(e,n,1)},setTimeout((function(){$(".btn-block-department").makeDropdown()}),1500)}]);
//# sourceMappingURL=bc121faf728bd0ec510ab61cdf2061fb.js.map
