(window.webpackJsonp=window.webpackJsonp||[]).push([[138],{1576:function(e,t,n){"use strict";n.r(t);n(1);var r=n(27),l=(n(82),n(4),n(5)),c=n(21),o=n(49),m=n.n(o),v=n(56),d=n(174),f=Object(l.c)({props:{rules:Object},setup:function(e,t){var n=Object(l.i)(""),o=Object(l.i)(!1),f=Object(l.i)(!0),form=Object(l.i)(null),w=function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!form.value.validate()){e.next=4;break}return o.value=!0,e.next=4,new Promise((function(e){var r={id:Object(d.a)(),name:n.value,isEnabled:!0,tickOffline:!1,triggerEveryMessage:10,triggerEverySecond:300,messages:[]};console.log("Saving",{item:r}),Object(c.getSocket)("/systems/timers").emit("generic::setById",{id:r.id,item:r},(function(){e(!0),t.emit("save"),o.value=!1}))}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return{name:n,translate:m.a,newItemSaving:o,newItem:w,valid:f,closeDlg:function(){t.emit("close")},form:form,capitalize:v.capitalize}}}),w=f,O=n(45),j=n(44),k=n.n(j),x=n(48),y=n(378),_=n(140),component=Object(O.a)(w,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-form",{ref:"form",attrs:{"lazy-validation":""},model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[n("v-text-field",{attrs:{label:e.capitalize(e.translate("timers.dialog.name")),"hide-details":"auto",rules:e.rules.name,required:"",counter:""},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}}),e._v(" "),n("v-btn",{staticClass:"mr-4",attrs:{loading:e.newItemSaving,disabled:!e.valid},on:{click:e.newItem}},[e._v("\n    submit\n  ")]),e._v(" "),n("v-btn",{staticClass:"mr-4",on:{click:e.closeDlg}},[e._v("\n    close\n  ")])],1)}),[],!1,null,null,null);t.default=component.exports;k()(component,{VBtn:x.a,VForm:y.a,VTextField:_.a})}}]);