import{_ as a,a as e,e as t,q as l,ag as n,aX as s,f as u,P as o,aY as r,w as c,b as v}from"./index-4c745ab9.js";import{l as i,c as d,q as f,o as m,a as p,f as _,u as A,g as b,t as y,w as k,j as O,C as V,m as h,F as x,y as C,aG as I,a2 as g,a3 as w,aH as S}from"./vendor-edc0678f.js";import{u as U}from"./useFreeze-8df38998.js";const j={class:"content_box"},z={class:"title fw-bold"},q={class:"cardOne"},F={class:"left"},N={class:"left_top"},P={class:"left_bottom"},E={class:"cardTwo"},G={class:"top"},T={class:"bottom"},B=["placeholder"],D=(a=>(g("data-v-016c684c"),a=a(),w(),a))(()=>b("i",null,"|",-1)),H={class:"keyong"},L={class:"fw-num"},X=a({__name:"index",setup(a){var g,w;const{_isFreeze:X}=U(),Y=e();t();const{_toast:J}=l(),K=i({coin:"usdt",transferOutAccount:"",transferInAccount:"",amount:""}),M=i([]),Q=async()=>{let a=await s();"200"==a.code&&(M.value=a.data)},R=d(()=>{let a="";return M.value.forEach((e,t)=>{(null==e?void 0:e.type)==K.value.transferOutAccount&&(a=e.availableAmount)}),a}),W=d(()=>Y.getAssetsTabList.filter(a=>!!a.isOpen&&("平台资产"==a.name&&(a.keyStr=u(a.keyStr,["latcoin"])),"理财资产"==a.name&&(a.keyStr=u(a.keyStr,["paxpay","latcoin"])),"合约资产"==a.name&&(a.keyStr=u(a.keyStr,["paxpay","latcoin"])),a.text=a.keyStr,a.value={"平台资产":1,"理财资产":2,"合约资产":3}[a.name],!0)).sort((a,e)=>a.sort-e.sort));K.value.transferOutAccount=(null==(g=W.value[0])?void 0:g.value)||"",K.value.transferInAccount=(null==(w=W.value[1])?void 0:w.value)||"";const Z=d(()=>W.value.filter(a=>a.value!=K.value.transferInAccount)),$=d(()=>W.value.filter(a=>a.value!=K.value.transferOutAccount)),aa=()=>{o.includes(__config._APP_ENV)?X(o)&&ea():ea()},ea=()=>{if(""==K.value.amount||K.value.amount<=0)return J("transfer_please_amount");r(K.value).then(a=>{"200"==a.code?(J("transfer_success"),Q()):C(a.msg||"")})},ta=()=>{K.value.amount=R.value},la=()=>{[K.value.transferOutAccount,K.value.transferInAccount]=[K.value.transferInAccount,K.value.transferOutAccount]};return f(()=>{Q()}),(a,e)=>{var t,l,s;const o=c,r=S,i=I,d=v;return m(),p(x,null,[_(o,{currentName:A(u)("transfer")},null,8,["currentName"]),b("div",j,[b("p",z,y(A(u)("transfer")),1),b("div",q,[b("div",F,[b("div",N,[b("span",null,y(A(u)("transfer_from")),1),_(i,{"active-color":"#17ac74"},{default:k(()=>[_(r,{modelValue:K.value.transferOutAccount,"onUpdate:modelValue":e[0]||(e[0]=a=>K.value.transferOutAccount=a),options:Z.value},null,8,["modelValue","options"])]),_:1})]),b("div",P,[b("span",null,y(A(u)("transfer_to",["aams"])),1),_(i,{"active-color":"#17ac74"},{default:k(()=>[_(r,{modelValue:K.value.transferInAccount,"onUpdate:modelValue":e[1]||(e[1]=a=>K.value.transferInAccount=a),options:$.value},null,8,["modelValue","options"])]),_:1})])]),b("div",{class:"right",onClick:la},[_(d,{name:"huazhuanbtn",class:"huazhuanbtn"})])]),b("div",E,[b("div",G,y(A(u)("transfer_amount")),1),b("div",T,[O(b("input",{type:"number",placeholder:"".concat(A(u)("transfer_less",["aams"]),"1").concat(null==(t=K.value.coin)?void 0:t.toUpperCase()),"onUpdate:modelValue":e[2]||(e[2]=a=>K.value.amount=a)},null,8,B),[[V,K.value.amount]]),b("span",{onClick:ta},y(A(u)("swap_all")),1),D,b("p",null,y(null==(l=K.value.coin)?void 0:l.toUpperCase()),1)])]),b("div",H,[h(y(A(u)("transfer_available"))+"：",1),b("span",L,y(R.value)+" "+y(null==(s=K.value.coin)?void 0:s.toUpperCase()),1)]),b("div",{class:"btnBox",onClick:aa},[_(n,{btnValue:A(u)("transfer_require"),btnColor:"#138A5D"},null,8,["btnValue"])])])],64)}}},[["__scopeId","data-v-016c684c"]]);export{X as default};
