"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[9418],{9418:function(e,n,t){t.r(n),t.d(n,{default:function(){return R}});t(8309);var a=t(6252),l=t(3577),r=t(9963),u=function(e){return(0,a.dD)("data-v-c4b6a144"),e=e(),(0,a.Cn)(),e},i={key:0,class:"entity variable-container"},s={class:"icon"},o={class:"label"},c=["textContent"],d=["textContent"],v={class:"row"},p={class:"row"},f={class:"col-9"},h=["disabled"],m={class:"col-3 pull-right"},_=["disabled"],b=u((function(){return(0,a._)("i",{class:"fas fa-trash"},null,-1)})),g=[b],k=["disabled"],w=u((function(){return(0,a._)("i",{class:"fas fa-check"},null,-1)})),y=[w];function C(e,n,t,u,b,w){var C,x=(0,a.up)("EntityIcon");return null!=e.value.value?((0,a.wg)(),(0,a.iD)("div",i,[(0,a._)("div",{class:(0,l.C_)(["head",{collapsed:e.collapsed}])},[(0,a._)("div",s,[(0,a.Wm)(x,{entity:e.value,loading:e.loading,error:e.error},null,8,["entity","loading","error"])]),(0,a._)("div",o,[(0,a._)("div",{class:"name",textContent:(0,l.zw)(e.value.name)},null,8,c)]),(0,a._)("div",{class:"value-and-toggler",onClick:n[1]||(n[1]=(0,r.iM)((function(n){return e.collapsed=!e.collapsed}),["stop"]))},[null!=(null===(C=e.value)||void 0===C?void 0:C.value)?((0,a.wg)(),(0,a.iD)("div",{key:0,class:"value",textContent:(0,l.zw)(e.value.value)},null,8,d)):(0,a.kq)("",!0),(0,a._)("div",{class:"collapse-toggler",onClick:n[0]||(n[0]=(0,r.iM)((function(n){return e.collapsed=!e.collapsed}),["stop"]))},[(0,a._)("i",{class:(0,l.C_)(["fas",{"fa-chevron-down":e.collapsed,"fa-chevron-up":!e.collapsed}])},null,2)])])],2),e.collapsed?(0,a.kq)("",!0):((0,a.wg)(),(0,a.iD)("div",{key:0,class:"body",onClick:n[5]||(n[5]=(0,r.iM)((function(){return e.prevent&&e.prevent.apply(e,arguments)}),["stop"]))},[(0,a._)("div",v,[(0,a._)("form",{onSubmit:n[4]||(n[4]=(0,r.iM)((function(){return w.setValue&&w.setValue.apply(w,arguments)}),["prevent"]))},[(0,a._)("div",p,[(0,a._)("div",f,[(0,a.wy)((0,a._)("input",{type:"text","onUpdate:modelValue":n[2]||(n[2]=function(n){return e.value_=n}),placeholder:"Variable value",disabled:e.loading,ref:"text"},null,8,h),[[r.nr,e.value_]])]),(0,a._)("div",m,[(0,a._)("button",{type:"button",title:"Clear",onClick:n[3]||(n[3]=(0,r.iM)((function(){return w.clearValue&&w.clearValue.apply(w,arguments)}),["stop"])),disabled:e.loading},g,8,_),(0,a._)("button",{type:"submit",title:"Edit",disabled:e.loading},y,8,k)])])],32)])]))])):(0,a.kq)("",!0)}var x=t(8534),V=(t(5666),t(7909)),q=t(1706),M={name:"Variable",components:{EntityIcon:q["default"]},mixins:[V["default"]],emits:["loading"],data:function(){return{collapsed:!0,value_:null}},computed:{isCollapsed:function(){return this.collapsed}},methods:{clearValue:function(){var e=this;return(0,x.Z)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.$emit("loading",!0),n.prev=1,n.next=4,e.request("variable.unset",{name:e.value.name});case 4:return n.prev=4,e.$emit("loading",!1),n.finish(4);case 7:case"end":return n.stop()}}),n,null,[[1,,4,7]])})))()},setValue:function(){var e=this;return(0,x.Z)(regeneratorRuntime.mark((function n(){var t,a;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t=e.value_,null!==t&&void 0!==t&&t.length){n.next=5;break}return n.next=4,e.clearValue();case 4:return n.abrupt("return",n.sent);case 5:return e.$emit("loading",!0),n.prev=6,a={},a[e.value.name]=t,n.next=11,e.request("variable.set",a);case 11:return n.prev=11,e.$emit("loading",!1),n.finish(11);case 14:case"end":return n.stop()}}),n,null,[[6,,11,14]])})))()}},mounted:function(){var e=this;this.value_=this.value.value,this.$watch((function(){return e.value.value}),(function(n){e.value_=n}))}},$=t(3744);const D=(0,$.Z)(M,[["render",C],["__scopeId","data-v-c4b6a144"]]);var R=D}}]);
//# sourceMappingURL=9418-legacy.06c89318.js.map