1import{_ as p,o as l,c as o,g as x,X as j,a as e,x as k,t as d,d as v,F as c,j as m,e as h,l as _,v as g}from"./app-DVhk9hEg.js";/* empty css */const y={name:"LeadSender",props:["projects","source","process","status","thread","utm","args"],components:{},data(){return{form:this.args||{},result:null,project:this.projects[0]}},mounted(){this.getForm.form||this.send()},methods:{send(){var a;axios.post(`/webhook/${((a=this.project)==null?void 0:a.key)||"test"}/${this.source}`,{"x-process":this.process.key,"x-status":this.status,"x-thread-id":this.thread,...this.utm||{},...this.form}).then(t=>this.$emit("updated",t.data))}},computed:{getForm(){return this.process.states[this.status]||this.process.states[this.process.start]}}},b={key:0,class:"form-page"},w={class:"footer"};function V(a,t,i,f,n,r){return r.getForm.form?(l(),o("div",b,[(l(),x(j(r.getForm.form),{modelValue:n.form,"onUpdate:modelValue":t[0]||(t[0]=s=>n.form=s)},null,8,["modelValue"])),e("div",w,[e("div",{class:"btn primary full",onClick:t[1]||(t[1]=(...s)=>r.send&&r.send(...s))},"ÐÑпÑавиÑÑ"),k(a.$slots,"default")]),e("pre",null,d(i.projects),1)])):v("",!0)}const C=p(y,[["render",V]]),F={name:"TaskInfo",props:["lead","process","projects"],components:{"lead-sender":C},data(){return{action:null,comment:"",project:Object.keys(this.projects)[0]}},methods:{wa(a){return"https://wa.me/"+a.replaceAll(/[^0-9]/g,"")},tel(a){return"tel:+"+a.replaceAll(/[^0-9]/g,"")},close(){this.$emit("close",!0)},updated(a){this.action=null,this.$emit("updated",a),this.close()},reject(){window.confirm("ТоÑно помеÑиÑÑ ÐºÐ°Ðº: Ðе Ñелевой?")&&axios.post(`/api/lead/${this.lead.id}/meta`,{"x-thread-start":!0,"x-process":this.lead.details.state.meta["x-process"],"x-thread-id":this.lead.details.state.meta["x-thread-id"],"x-status":"cancel"}).then(a=>this.updated(a.data))},sendTo(){axios.post(`/api/lead/${this.lead.id}/meta`,{"x-thread-start":!0,"x-process":this.lead.details.state.meta["x-process"],"x-thread-id":this.lead.details.state.meta["x-thread-id"],"x-status":"redirect"}).then(()=>{axios.post(`/repeat/${this.project}/verification`,{...this.lead.fields,comment:this.comment,verified:this.lead.id}).then(a=>this.updated(a.data))})}}},T={class:"modal"},S={class:"head"},B={class:"field-table"},D={key:0},L=["href"],U=["href"],A={key:1},I={class:"actions"},M=["value"];function N(a,t,i,f,n,r){return l(),o("div",T,[e("div",S,[e("div",{class:"btn primary tertiary",onClick:t[0]||(t[0]=(...s)=>r.close&&r.close(...s))},[...t[5]||(t[5]=[e("i",{class:"fas fa-times"},null,-1)])]),e("span",null,d(i.lead.details.state.meta["x-process"])+" - "+d(i.lead.details.state.meta["x-status"]),1)]),e("div",null,[e("div",null,[e("table",B,[e("tr",null,[t[6]||(t[6]=e("th",null,"Создано",-1)),e("td",null,d(i.lead.created_at),1)]),(l(!0),o(c,null,m(i.lead.fields,(s,u)=>(l(),o("tr",null,[e("th",null,d(u),1),u==="Phone"?(l(),o("td",D,[e("a",{href:r.tel(s)},d(s),9,L),e("a",{href:r.wa(s),target:"_blank"},[...t[7]||(t[7]=[e("i",{class:"fab fa-whatsapp"},null,-1)])],8,U)])):(l(),o("td",A,d(s),1))]))),256))])]),e("div",I,[t[8]||(t[8]=e("hr",null,null,-1)),h(e("select",{"onUpdate:modelValue":t[1]||(t[1]=s=>n.project=s)},[(l(!0),o(c,null,m(i.projects,(s,u)=>(l(),o("option",{value:u},d(s),9,M))),256))],512),[[_,n.project]]),e("div",{class:"btn",onClick:t[2]||(t[2]=(...s)=>r.sendTo&&r.sendTo(...s))},"ÐÑпÑавиÑÑ"),e("div",{class:"btn",onClick:t[3]||(t[3]=(...s)=>r.reject&&r.reject(...s))},"Ðе Ñелевой")]),h(e("input",{type:"text","onUpdate:modelValue":t[4]||(t[4]=s=>n.comment=s),placeholder:"ÐомменÑаÑий к лидÑ"},null,512),[[g,n.comment]])])])}const P=p(F,[["render",N]]);export{P as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.