import{d as a,l as e,c as s,o as l,a as t,f as d,u as r,g as n,t as o,w as c,h as u,e as i,an as v,ax as m,ay as p,I as _,m as f,az as w}from"./vendor-edc0678f.js";import{_ as g,q as h,w as y,e as b,am as x,f as C}from"./index-4c745ab9.js";const k=""+new URL("../resource/images/defi/ERC.png",import.meta.url).href,I=""+new URL("../resource/images/defi/TRC.png",import.meta.url).href,R={class:"bg"},T={class:"form"},U={class:"form-item"},L={class:"label"},E=["src"],V={class:"tit"},j={class:"tip"},N={class:"form-item"},q={class:"label"},z={class:"input"},H=g({__name:"add-address",setup(g){const{_toast:H}=h(),P=a(),S=e(!1),A=e(0),B=s(()=>1==A.value?I:k),D=e({type:"ETH",address:""}),F=e(!1),G=e([{name:"ERC"},{name:"TRC"}]),J=(a,e)=>{A.value=e,D.value.type=a.name,S.value=!1},K=()=>{S.value=!0},M=async()=>{D.value.address=await navigator.clipboard.readText()},O=()=>{var a;if(!D.value.address)return H("wallet_address_cannot_be_empty");F.value=!0;const e=b(),{userInfo:s}=v(e);x({type:D.value.type,address:D.value.address.toLocaleLowerCase(),userId:null==(a=s.value.user)?void 0:a.userId}).then(async a=>{H("set_success"),D.value.address="",setTimeout(()=>{P.back(),e.getUserInfo()},1500)}).finally(()=>{F.value=!1})};return(a,e)=>{const s=w,v=m,g=p,h=_;return l(),t("div",R,[d(y,{currentName:r(C)("bind_address"),border_bottom:!0},null,8,["currentName"]),n("div",T,[n("div",U,[n("div",L,o(r(C)("please_select_a_chain")),1),n("div",{class:"input",onClick:K},[n("img",{src:B.value,class:"coin"},null,8,E),n("div",V,o(D.value.type),1),n("div",j,[d(s,{name:"arrow-down"})])])]),n("div",N,[n("div",q,o(r(C)("withdrawal_Please_enter_address")),1),n("div",z,[d(v,{class:"input-field",type:"textarea",modelValue:D.value.address,"onUpdate:modelValue":e[0]||(e[0]=a=>D.value.address=a),placeholder:r(C)("exchange.input")},null,8,["modelValue","placeholder"]),n("div",{class:"tip",onClick:M},o(r(C)("pasta")),1)])]),d(g,{block:"",class:"submit",loading:F.value,onClick:O},{default:c(()=>[f(o(r(C)("confirm")),1)]),_:1},8,["loading"])]),G.value.length?(l(),u(h,{key:0,show:S.value,"onUpdate:show":e[1]||(e[1]=a=>S.value=a),actions:G.value,onSelect:J,"cancel-text":r(C)("cancel")},null,8,["show","actions","cancel-text"])):i("",!0)])}}},[["__scopeId","data-v-0d72859c"]]);export{H as default};
