1import{c as b,o as a,b as s,T as E,Z as N,U as I,a0 as Z,K as B,a4 as C,_ as F,t as V,M as x,x as h,v as n,d as u,u as f,G as P,w as A,a5 as R,N as D,O as U,L as O}from"./index-ae80RWzP.js";import{_ as Q}from"./BaseInput-BByyJOvX.js";import{a as X}from"./AccountsCarousel-BRaDEX46.js";import H from"./question-DJwRJGH1.js";import{_ as J}from"./instruction1-DKi0zkeF.js";import"./carousel-DphbfNlr.js";import"./edit-BN5QpqYw.js";const L={xmlns:"http://www.w3.org/2000/svg",width:"52",height:"58",fill:"none"};function q(t,e){return a(),b("svg",L,e[0]||(e[0]=[s("path",{fill:"#1852E0",stroke:"#1852E0","stroke-width":".56",d:"M22.508 19.651a6.435 6.435 0 0 0-6.427-6.427 6.435 6.435 0 0 0-6.426 6.427 6.434 6.434 0 0 0 6.426 6.427 6.434 6.434 0 0 0 6.427-6.427Zm-10.378 0a3.95 3.95 0 0 1 3.943-3.943 3.95 3.95 0 0 1 3.943 3.943 3.95 3.95 0 0 1-3.943 3.943 3.95 3.95 0 0 1-3.943-3.943ZM15.49 43.596h-5.308v-7.645c0-.56-.45-1.01-1.01-1.01-.558 0-1.008.45-1.008 1.01v7.645H5.905c-.1 0-.21-.078-.21-.21V35.92c0-3.314 2.702-6.016 6.016-6.016h8.615c1.204 0 2.275.334 3.276 1.017a1.234 1.234 0 0 0 1.723-.325 1.24 1.24 0 0 0-.326-1.724 8.14 8.14 0 0 0-4.673-1.451h-8.615c-4.688 0-8.5 3.811-8.5 8.499v7.466a2.7 2.7 0 0 0 2.694 2.694h9.586c.683 0 1.242-.559 1.242-1.242s-.559-1.242-1.242-1.242ZM38.031 33.428a5.923 5.923 0 0 0 5.914-5.914 5.92 5.92 0 0 0-5.914-5.914 5.923 5.923 0 0 0-5.915 5.914 5.923 5.923 0 0 0 5.915 5.914Zm0-9.345a3.432 3.432 0 0 1 0 6.862 3.433 3.433 0 0 1-3.431-3.431 3.433 3.433 0 0 1 3.431-3.431ZM47.33 36.93a7.56 7.56 0 0 0-5.449-2.281h-7.9399999999999995a4 4 0 0 0-.675.022 1.242 1.242 0 0 0 .147 2.477c.047 0 .1 0 .148-.009.077-.007.194-.007.325-.007h7.988c1.396 0 2.7.543 3.67 1.536.97.995 1.506 2.33 1.506 3.758v6.744c0 .04-.015.063-.062.063h-1.444v-6.776c0-.56-.45-1.01-1.008-1.01-.559 0-1.01.45-1.01 1.01v6.776h-5.58c-.683 0-1.242.558-1.242 1.241 0 .684.559 1.242 1.242 1.242h9.042a2.547 2.547 0 0 0 2.546-2.546v-6.744c.008-2.089-.776-4.037-2.204-5.496Z"},null,-1),s("path",{fill:"#1852E0",stroke:"#1852E0","stroke-width":".56",d:"M21.235 36.929a4.98 4.98 0 0 0 4.975 4.975 4.98 4.98 0 0 0 4.975-4.975 4.98 4.98 0 0 0-4.975-4.975 4.98 4.98 0 0 0-4.975 4.975Zm4.975-2.491a2.495 2.495 0 0 1 2.492 2.49 2.495 2.495 0 0 1-2.492 2.493 2.494 2.494 0 0 1-2.49-2.492 2.494 2.494 0 0 1 2.49-2.491ZM33.786 44.753a6.3 6.3 0 0 0-4.541-1.91h-6.201a6.48 6.48 0 0 0-6.474 6.473v5.388A2.3 2.3 0 0 0 18.868 57H33.35c1.25 0 2.266-1.032 2.266-2.297v-5.388a6.4 6.4 0 0 0-1.831-4.563Zm-10.735.574h6.202c1.048 0 2.034.412 2.763 1.164a4.03 4.03 0 0 1 1.133 2.825v5.201h-.745v-5.169c0-.559-.45-1.009-1.01-1.009-.558 0-1.008.45-1.008 1.01v5.168h-8.173v-5.169c0-.559-.45-1.009-1.01-1.009-.558 0-1.008.45-1.008 1.01v5.168h-1.133v-5.2a3.99 3.99 0 0 1 3.99-3.99ZM50.84 14.808l-7.235-3.562V3.119A2.097 2.097 0 0 0 41.486 1h-5.115a2.097 2.097 0 0 0-2.118 2.119v3.54l-7.274-3.54a2.63 2.63 0 0 0-2.313 0L1.164 14.629a1.32 1.32 0 0 0-.606 1.763 1.326 1.326 0 0 0 1.77.605l23.495-11.51 9.159 4.462.046.024c.008 0 .016.007.024.007.03.016.07.023.1.04.008 0 .016.007.023.007.04.008.07.023.11.031h.015c.04.008.078.015.125.015a1 1 0 0 0 .131.008c.039 0 .086 0 .124-.008h.032c.03 0 .07-.007.1-.015h.023l.102-.023c.015-.008.03-.008.038-.015l.07-.024c.015-.008.024-.008.04-.016l.092-.046c.008-.008.015-.008.032-.016.023-.015.053-.03.077-.046.008-.008.015-.008.023-.016.062-.046.124-.093.178-.148l.017-.015c.022-.023.046-.054.07-.078 0-.007.007-.007.007-.015l.07-.094c0-.007.008-.007.008-.015.015-.023.03-.054.046-.078.007-.015.016-.022.023-.038.008-.008.008-.016.016-.024.008-.007.008-.015.008-.022.007-.024.023-.047.03-.078a.1.1 0 0 0 .017-.047l.022-.07c.008-.023.008-.038.016-.062.007-.023.007-.038.015-.062.009-.023.009-.047.009-.07 0-.016.007-.039.007-.054 0-.031 0-.054.008-.085V3.63h4.082v8.46c0 .024 0 .055.008.078 0 .016 0 .04.008.054 0 .024.008.047.008.07s.008.047.015.063c.008.015.008.038.016.054l.023.07c.008.015.008.03.015.046.009.024.016.047.032.07l.023.047c.007.023.023.046.031.062.008.015.023.038.03.054.008.016.024.039.032.054l.047.063c.007.015.022.03.03.039.016.023.032.038.054.061.009.016.024.024.032.031.015.016.039.031.054.055.016.016.031.023.04.038.014.016.038.024.054.04.015.015.038.022.053.038a.14.14 0 0 1 .047.031c.024.016.047.024.07.039.008 0 .008.008.016.008l7.97 3.928a1.314 1.314 0 0 0 1.77-.599 1.33 1.33 0 0 0-.596-1.777Z"},null,-1)]))}const G={render:q},K={components:{Recalculation:G,QuestionIcon:H,AccountsCarousel:X},name:"RecalculationModal",directives:{maska:B},props:{image:String},data(){return{loading:!1,userProfile:null,tokenCookie:void 0,userAccount:"",unmaskedValue:"",fullName:"",tel:"996",file:[],formErrors:{userAccount:"",fullName:"",tel:"",readings:""}}},computed:{...Z(N),filteredFacilities(){var t,e;return((e=(t=this.userProfile)==null?void 0:t.facilities)==null?void 0:e.filter(l=>l.account))||[]},formattedPhone(){return"996"+this.unmaskedValue}},methods:{...E(I,["close"]),...E(N,["connect","openChat","setChatCookie"]),validateFields(){var e;this.formErrors={userAccount:"",fullName:"",tel:"",readings:""};let t=!0;if((!this.userAccount||this.userAccount.length<9)&&(this.formErrors.userAccount="ÐведиÑе коÑÑекÑнÑй лиÑевой ÑÑÐµÑ (минимÑм 9 Ñимволов)",t=!1),(!this.fullName||this.fullName.length<3)&&(this.formErrors.fullName="ÐведиÑе коÑÑекÑное ФÐÐ (минимÑм 3 Ñимвола)",t=!1),!((e=this.userProfile)!=null&&e.contactNumber)){const l=/^996\d{9}$/;(!this.tel||!l.test(this.tel))&&(this.formErrors.tel="ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð² ÑоÑмаÑе 996XXXXXXXXX (12 ÑиÑÑ)",t=!1)}return this.file.length||(this.formErrors.readings="ÐагÑÑзиÑе ÑоÑо газового ÑÑеÑÑика",t=!1),t},clearError(t){this.formErrors[t]=""},limitInput(t,e){this[t].toString().length>e&&(this[t]=this[t].toString().slice(0,e))},changeData(t){this.userAccount=t.account,this.fullName=t.owner},setToken(t){if(!t.phone.trim()&&!t.name.trim())return;const e=this.generateToken(),{cookies:l}=C(),c={token:e,fullname:t.name,contactNumber:t.phone};
1l.set("user",JSON.stringify(c),"1d"),this.tokenCookie=e,this.setChatCookie(e),this.connect()},generateToken(){const t=Math.random().toString(36).slice(2),e=Date.now().toString(36);return`${t}${e}`},sendRecalculation(){var l;if(!this.validateFields())return;const t=((l=this.userProfile)==null?void 0:l.contactNumber)||this.tel,e=this.getCookie();!e&&!this.userProfile?this.setToken({name:this.fullName,phone:t}):!e&&this.userProfile?console.log(this.userProfile):this.tokenCookie=e,setTimeout(()=>this.openChat(),1e3),this.close(),setTimeout(()=>this.chatMessagesStore.createItem(`ÐедеÑÑÑ ÑазÑабоÑка пеÑеÑаÑÑеÑа. ÐС:${this.userAccount}, ФÐÐ: ${this.fullName}, ТелеÑон: ${t}`,this.file[0]),2500)},getCookie(){const{cookies:t}=C(),e=t.get("user");return e==null?void 0:e.token}},async beforeMount(){var e,l,c,o,r,m;const t=localStorage.getItem("user");t&&(this.userProfile=JSON.parse(t),this.tel=((e=this.userProfile)==null?void 0:e.contactNumber)||"",(l=this.userProfile)!=null&&l.facilities.length?(this.userAccount=(c=this.userProfile)==null?void 0:c.facilities[0].account,this.fullName=(o=this.userProfile)==null?void 0:o.facilities[0].name):this.userProfile&&(this.fullName=((m=(r=this.userProfile)==null?void 0:r.client)==null?void 0:m.name)||""))}},W={class:"recalculation-modal"},j={class:"recalculation-header"},z={class:"header"},Y={class:"tooltip-wrapper"},$={class:"tooltip tooltip-head"},e0={class:"recalculation-form"},t0={class:"error-recalc"},o0={class:"error-recalc"},s0={class:"error-recalc"},r0={class:"upload-photo"},l0={class:"label"},i0={class:"error-recalc"};function n0(t,e,l,c,o,r){var g,_,k,v;const m=V("Recalculation"),w=V("QuestionIcon"),M=X,p=Q,y=R,S=D,T=O,d=x("maska");return a(),b("div",W,[s("div",j,[h(m,{style:{"align-self":"center"}}),s("div",z,[s("h3",null,n(t.$t("modals.recalculate.title")),1),s("div",Y,[h(w,{class:"question-icon"}),s("div",$,n(t.$t("modals.recalculate.tooltip")),1)])])]),s("form",e0,[(g=o.userProfile)!=null&&g.facilities&&r.filteredFacilities.length>0?(a(),u(M,{key:0,items:r.filteredFacilities,showIcon:!1,onChangeFacility:r.changeData,style:{"align-self":"normal !important",width:"100% !important"}},null,8,["items","onChangeFacility"])):f("",!0),!((_=o.userProfile)!=null&&_.facilities)||r.filteredFacilities.length===0||!((k=o.userProfile)!=null&&k.client)?(a(),u(p,{key:1,placeholder:"ФÐÐ",modelValue:o.fullName,"onUpdate:modelValue":e[0]||(e[0]=i=>o.fullName=i),label:t.$t("modals.recalculate.inputs.fullName"),error:!!o.formErrors.fullName,onInput:e[1]||(e[1]=i=>r.clearError("fullName"))},null,8,["modelValue","label","error"])):f("",!0),s("span",t0,n(o.formErrors.fullName),1),P((a(),u(p,{modelValue:o.userAccount,"onUpdate:modelValue":e[2]||(e[2]=i=>o.userAccount=i),label:t.$t("modals.recalculate.inputs.account"),placeholder:"XXXXXXXXX",inputType:"text",tooltip:!0,tooltipText:t.$t("modals.recalculate.inputs.accountTooltip"),error:!!o.formErrors.userAccount,onClearError:e[3]||(e[3]=i=>r.clearError("userAccount")),onInput:e[4]||(e[4]=i=>r.limitInput("userAccount",9))},{"image-content":A(()=>e[9]||(e[9]=[s("img",{src:J,alt:"instruction"},null,-1)])),_:1},8,["modelValue","label","tooltipText","error"])),[[d,"#########","unmaskedValue",{unmasked:!0}]]),s("span",o0,n(o.formErrors.userAccount),1),(v=o.userProfile)!=null&&v.contactNumber?f("",!0):P((a(),u(p,{key:2,modelValue:o.tel,"onUpdate:modelValue":e[5]||(e[5]=i=>o.tel=i),label:t.$t("modals.recalculate.inputs.phone"),placeholder:"996",inputType:"text",tooltip:!1,error:!!o.formErrors.tel,onClearError:e[6]||(e[6]=i=>r.clearError("tel"))},null,8,["modelValue","label","error"])),[[d,"996#########","unmaskedValue",{unmasked:!0}]]),s("span",s0,n(o.formErrors.tel),1),s("div",r0,[s("div",l0,n(t.$t("modals.recalculate.inputs.file")),1),h(y,{modelValue:o.file,"onUpdate:modelValue":e[7]||(e[7]=i=>o.file=i),style:{"margin-top":"5px"},accept:"image/*",error:!!o.formErrors.readings,onInput:e[8]||(e[8]=i=>r.clearError("readings"))},null,8,["modelValue","error"]),s("span",i0,n(o.formErrors.readings),1)]),h(T,{onClick:U(r.sendRecalculation,["prevent"]),text:o.loading?"":t.$t("modals.recalculate.buttons.submit"),bgColor:"#1852E0",style:{"margin-top":"30px !important","align-self":"stretch"}},{btnContent:A(()=>[o.loading?(a(),u(S,{key:0,loaderWidth:"10px",color:"white"})):f("",!0)]),_:1},8,["onClick","text"])])])}const d0=F(K,[["render",n0]]);
1export{d0 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.