birzha-legalizasia-frontend/dist/assets/BankAccount.39c7b61e.js

2 lines
7.0 KiB
JavaScript

import{y as B,q as I,K as L,J as _,N as O,B as T,D as Q,ac as S,r as y,e as c,f as e,t as r,g as R,w as Y,F as m,c as n,M as q,l as i,O as v,P as $,h as o,n as x,i as f,j as u,E as K,L as F,k as J}from"./index.64691206.js";import{c as p,r as b,u as j}from"./index.esm.c4d35866.js";const P={class:"intro-y flex items-center mt-8"},z={class:"text-lg font-medium mr-auto"},G={class:"grid grid-cols-12 gap-6 mt-5"},W={class:"intro-y col-span-12 lg:col-span-6"},H={class:"flex flex-col sm:flex-row items-center p-5 border-b border-slate-200/60 dark:border-darkmode-400"},X={class:"font-medium text-base mr-auto"},Z={class:"p-5"},ee=["onSubmit"],te={class:"input-form"},oe={for:"validation-form-6",class:"form-label w-full flex flex-col sm:flex-row"},se={class:"sm:ml-auto mt-1 sm:mt-0 text-xs text-slate-500"},ae=e("span",{class:"text-red-600"},"*",-1),re=["placeholder"],ne={class:"input-form mt-3"},le={for:"validation-form-2",class:"form-label w-full flex flex-col sm:flex-row"},ce={class:"sm:ml-auto mt-1 sm:mt-0 text-xs text-slate-500"},ie=e("span",{class:"text-red-600"},"*",-1),de={class:"relative mx-auto mt-3"},me={class:"absolute rounded-l w-10 h-full flex items-center justify-center bg-slate-100 border text-slate-500 dark:bg-darkmode-700 dark:border-darkmode-800 dark:text-slate-400"},ue={class:"input-form mt-3"},_e={for:"validation-form-4",class:"form-label w-full flex flex-col sm:flex-row"},fe={class:"sm:ml-auto mt-1 sm:mt-0 text-xs text-slate-500"},pe=e("span",{class:"text-red-600"},"*",-1),be={class:"input-form mt-3"},he={for:"validation-form-4",class:"form-label w-full flex flex-col sm:flex-row"},ve={class:"sm:ml-auto mt-1 sm:mt-0 text-xs text-slate-500"},$e=e("span",{class:"text-red-600"},"*",-1),xe=["placeholder"],ge={class:"input-form mt-3"},ye={for:"validation-form-4",class:"form-label w-full flex flex-col sm:flex-row"},ke={class:"sm:ml-auto mt-1 sm:mt-0 text-xs text-slate-500"},Re=e("span",{class:"text-red-600"},"*",-1),Ee=["placeholder"],Ie={class:"input-form mt-3"},we={for:"validation-form-4",class:"form-label w-full flex flex-col sm:flex-row"},Ae={class:"sm:ml-auto mt-1 sm:mt-0 text-xs text-slate-500"},De=e("span",{class:"text-red-600"},"*",-1),Ne=["placeholder"],Ue={type:"submit",class:"btn btn-primary mt-5"},Be={__name:"BankAccount",setup(Ve){const w="https://panel.exchange.gov.tm/api",E=B(),A=new Date,g=I(!1),k=I(""),h=L({account_number:"",account_date:"",currency:"",iban:"",bank_name:"",country:""}),D={account_number:{required:p.withMessage(_.global.t("REQUIRED_VALIDATION"),b)},account_date:{required:p.withMessage(_.global.t("REQUIRED_VALIDATION"),b)},currency:{required:p.withMessage(_.global.t("REQUIRED_VALIDATION"),b)},iban:{required:p.withMessage(_.global.t("REQUIRED_VALIDATION"),b)},bank_name:{required:p.withMessage(_.global.t("REQUIRED_VALIDATION"),b)},country:{required:p.withMessage(_.global.t("REQUIRED_VALIDATION"),b)}},t=j(D,O(h));T(k,(s,l)=>{h.account_date=s});const N=async()=>{if(t.value.$touch(),!t.value.$invalid)try{g.value=!0;const s=await F.put(`${w}/account/bank`,h);g.value=!1,localStorage.removeItem("bankAccount"),localStorage.setItem("bankAccount",JSON.stringify(h)),J.push({name:"profile",params:{loadFromLS:!0}})}catch{g.value=!1}};return Q(()=>{const s=S.isEmpty(E.params)?JSON.parse(localStorage.getItem("bankAccount")):E.params;s&&(localStorage.setItem("bankAccount",JSON.stringify(s)),Object.assign(h,s))}),(s,l)=>{const U=y("CalendarIcon"),V=y("Litepicker"),C=y("LoadingIcon"),M=y("PreviewComponent");return n(),c(m,null,[e("div",P,[e("h2",z,r(s.$t("BANK")),1)]),e("div",G,[e("div",W,[R(M,{class:"intro-y box"},{default:Y(()=>[e("div",H,[e("h2",X,r(s.$t("BANK_FORM")),1)]),e("div",Z,[e("form",{class:"validate-form",onSubmit:q(N,["prevent"])},[e("div",te,[e("label",oe,[i(r(s.$t("ACC_NUMBER"))+" ",1),e("span",se,[ae,i(" "+r(s.$t("REQUIRED")),1)])]),v(e("input",{type:"text",id:"validation-form-6","onUpdate:modelValue":l[0]||(l[0]=a=>o(t).account_number.$model=a),class:x(["form-control",{"border-danger":o(t).account_number.$error}]),name:"account number",placeholder:s.$t("ACC_NUMBER")},null,10,re),[[$,o(t).account_number.$model,void 0,{trim:!0}]]),o(t).account_number.$error?(n(!0),c(m,{key:0},f(o(t).account_number.$errors,(a,d)=>(n(),c("div",{key:d,class:"text-danger mt-2"},r(a.$message),1))),128)):u("",!0)]),e("div",ne,[e("label",le,[i(r(s.$t("ACC_DATE"))+" ",1),e("span",ce,[ie,i(" "+r(s.$t("REQUIRED")),1)])]),e("div",de,[e("div",me,[R(U,{class:"w-4 h-4"})]),R(V,{modelValue:k.value,"onUpdate:modelValue":l[1]||(l[1]=a=>k.value=a),options:{maxDate:o(A),format:"DD.MM.YYYY",dropdowns:{minYear:1990,maxYear:null,months:!0,years:!0}},class:"form-control pl-12"},null,8,["modelValue","options"])]),o(t).account_date.$error?(n(!0),c(m,{key:0},f(o(t).account_date.$errors,(a,d)=>(n(),c("div",{key:d,class:"text-danger mt-2"},r(a.$message),1))),128)):u("",!0)]),e("div",ue,[e("label",_e,[i(r(s.$t("CURRENCY"))+" ",1),e("span",fe,[pe,i(" "+r(s.$t("REQUIRED")),1)])]),v(e("input",{id:"validation-form-4","onUpdate:modelValue":l[2]||(l[2]=a=>o(t).currency.$model=a),type:"text",name:"currency",class:x(["form-control",{"border-danger":o(t).currency.$error}]),placeholder:"TMT"},null,2),[[$,o(t).currency.$model,void 0,{trim:!0}]]),o(t).currency.$error?(n(!0),c(m,{key:0},f(o(t).currency.$errors,(a,d)=>(n(),c("div",{key:d,class:"text-danger mt-2"},r(a.$message),1))),128)):u("",!0)]),e("div",be,[e("label",he,[i(r(s.$t("IBAN"))+" ",1),e("span",ve,[$e,i(" "+r(s.$t("REQUIRED")),1)])]),v(e("input",{id:"validation-form-4","onUpdate:modelValue":l[3]||(l[3]=a=>o(t).iban.$model=a),type:"text",name:"iban",class:x(["form-control",{"border-danger":o(t).iban.$error}]),placeholder:s.$t("IBAN")},null,10,xe),[[$,o(t).iban.$model,void 0,{trim:!0}]]),o(t).iban.$error?(n(!0),c(m,{key:0},f(o(t).iban.$errors,(a,d)=>(n(),c("div",{key:d,class:"text-danger mt-2"},r(a.$message),1))),128)):u("",!0)]),e("div",ge,[e("label",ye,[i(r(s.$t("BANK_NAME"))+" ",1),e("span",ke,[Re,i(" "+r(s.$t("REQUIRED")),1)])]),v(e("input",{id:"validation-form-4","onUpdate:modelValue":l[4]||(l[4]=a=>o(t).bank_name.$model=a),type:"text",name:"bank_name",class:x(["form-control",{"border-danger":o(t).bank_name.$error}]),placeholder:s.$t("BANK_NAME")},null,10,Ee),[[$,o(t).bank_name.$model,void 0,{trim:!0}]]),o(t).bank_name.$error?(n(!0),c(m,{key:0},f(o(t).bank_name.$errors,(a,d)=>(n(),c("div",{key:d,class:"text-danger mt-2"},r(a.$message),1))),128)):u("",!0)]),e("div",Ie,[e("label",we,[i(r(s.$t("COUNTRY"))+" ",1),e("span",Ae,[De,i(" "+r(s.$t("REQUIRED")),1)])]),v(e("input",{id:"validation-form-4","onUpdate:modelValue":l[5]||(l[5]=a=>o(t).country.$model=a),type:"text",name:"country",class:x(["form-control",{"border-danger":o(t).country.$error}]),placeholder:s.$t("COUNTRY")},null,10,Ne),[[$,o(t).country.$model,void 0,{trim:!0}]]),o(t).country.$error?(n(!0),c(m,{key:0},f(o(t).country.$errors,(a,d)=>(n(),c("div",{key:d,class:"text-danger mt-2"},r(a.$message),1))),128)):u("",!0)]),e("button",Ue,[i(r(s.$t("REGISTER"))+" ",1),g.value?(n(),K(C,{key:0,icon:"oval",color:"white",class:"w-4 h-4 ml-2"})):u("",!0)])],40,ee)])]),_:1})])])],64)}}};export{Be as default};