(()=>{function t(e,a){function l(t,n){return"".concat(a.getString(t.label)," (").concat(a.getString(n),")").concat(t.required?" *":"")}return{require:"smartRuleParamInput",scope:{rule:"=",param:"="},restrict:"E",templateUrl:":::PLUGIN_PATH:::/views/paramInputTimeInterval.html",controller:["$scope",function(n){var r={amount:null,unit:null},u=[{label:e("hours"),valueInSeconds:3600,dontDisplay:!1},{label:e("minutes"),valueInSeconds:60,dontDisplay:!1},{label:e("seconds"),valueInSeconds:1,dontDisplay:n.param.dontUseSeconds||!1}],t={AMOUNT:e("amount"),UNIT:e("unit")};n.placeholder=l,n.units=u,n.fieldNames=t,n.timeInterval=r,n.$watch(function(){return n.timeInterval.amount&&n.timeInterval.unit&&n.timeInterval.amount*n.timeInterval.unit.valueInSeconds},function(t){t&&(n.rule.config[n.param.property]=t)}),n.$watch(function(){return n.rule.config[n.param.property]},function(t){var e,a;_.assign(r,(e=t,a=u[2],_.forEach(u,function(t){var n=e/t.valueInSeconds;return n%1!=0||(e=n,a=t,!1)}),{amount:e,unit:a}))})}]}}t.$inject=["gettext","gettextCatalog"],angular.module("c8y.smartRules").directive("smartRuleParamInputTimeInterval",t)})();