import{C as O,v as $,N as j,x as q,r as y,y as Q,D as C,E as r,F as e,M as g,J as t,K as s,al as X,V as G,G as N,H as V,I as c,am as Y}from"./common.modules-7b90237f.js";import{i as Z,G as ee,n as te,a3 as ae,c9 as se,y as le,A as ne,b_ as oe,cb as re,c as p,g as ce,aC as ie}from"./page-activity-ActivityDetail-27bd7cf0.js";const ue={class:"wallet-container"},de={class:"wallet-container-header"},ve={class:"wallet-container-header-belly"},he={key:0},_e={class:"total"},we={class:"total"},ye={class:"wallet-container-content"},ge={class:"container"},me={class:"progressBars"},pe={class:"progressBarsL"},fe={class:"progressBarsR"},ke={class:"recycleBtnD"},Re={key:1,class:"recycleBtn disable"},Be={class:"userDetail"},Ce=["onClick"],be={class:"imgD"},De=["src"],xe={key:0,class:"gameList"},Le={class:"money"},Se={key:1,class:"gameList"},Me=O({__name:"index",setup(We){Z();const b=ee(),{downAppTip:E}=te(),K=re(),{t:n}=$(),D=j(),{setLoading:m}=ae(),x=se();le();const P={recharge:{title:n("recharge"),icon:"rechargeIcon",link:"Recharge"},withdraw:{title:n("withdraw"),icon:"widthdrawBlue",link:"Withdraw"},rechargeHistory:{title:n("rechargeRecords"),icon:"rechargeHistory",link:"RechargeHistory"},withdrawHistory:{title:n("withdrawRecords"),icon:"withdrawHistory",link:"WithdrawHistory"}},L=q(()=>b.userInfo),U=async a=>{a=="Recharge"||a=="Withdraw"?await E(a):(a==="RechargeHistory"&&K.emit("changeKeepAliveKey"),D.push({name:a}))};let f=0,k=y([]),v=0,h=0,i=0,S="0%",_=0,u=0,W="0%";new Date().getTime()/1e3;const A=y(0),H=y(0),d=y(0),R=y(!1);async function I(a=!0){m(!0),await x.getAllwalletsBalance(void 0,!0),J(x.getAllwallets),m(!1),a&&b.notifyARGame()}async function F(){if(d.value||R.value)return;R.value=!0;const a=await ne(oe(!0));R.value=!1,a?(d.value=5,v=a.data.amount,z()):d.value=0}const z=async()=>{clearInterval(f),f=setInterval(async()=>{d.value-=1,d.value==0&&(clearInterval(f),m(!0),await I(!1),m(!1))},1e3)};function J(a){if(!a)return;L.value.isShowWalletTotalCT=="1"&&(A.value=a.totalWithdraw||0,H.value=a.totalRecharge||0),k.value=a.thidGameBalanceList||[];let o=a.thidGameBalanceList||[];if(h=0,_=0,o)for(var w of o)w.vendorCode==="Lottery"?h+=w.balance:_+=w.balance;v=h+_,v>0?(i=Math.round(h/v*1e4)/100,u=Math.round(_/v*1e4)/100,S=i+"%",W=u+"%"):(i=0,u=0)}return Q(async()=>{await I()}),(a,o)=>{const w=C("NavBar"),M=C("svg-icon"),T=C("van-circle");return c(),r("div",ue,[e("div",de,[g(w,{title:t(n)("wallet"),class:"main","left-arrow":"",onClickLeft:o[0]||(o[0]=l=>t(D).go(-1))},null,8,["title"]),e("div",ve,[g(M,{name:"wallet1"}),e("div",null,s(t(p)(t(v))),1),e("span",null,s(t(n)("totalBalance")),1),L.value.isShowWalletTotalCT=="1"?(c(),r("div",he,[e("div",null,[e("p",_e,s(A.value),1),e("p",null,s(t(n)("totalWithdraw")),1)]),e("div",null,[e("p",we,s(H.value),1),e("p",null,s(t(n)("totalRechargeAmount")),1)])])):X("v-if",!0)])]),e("div",ye,[e("div",ge,[e("div",me,[e("div",pe,[g(T,{"current-rate":t(i),"onUpdate:currentRate":o[1]||(o[1]=l=>G(i)?i.value=l:i=l),speed:100,text:t(S),"stroke-width":"100","stroke-linecap":"butt"},null,8,["current-rate","text"]),e("h3",null,s(t(p)(t(h))),1),e("span",null,s(t(n)("mainWallet")),1)]),e("div",fe,[g(T,{"current-rate":t(u),"onUpdate:currentRate":o[2]||(o[2]=l=>G(u)?u.value=l:u=l),speed:100,text:t(W),"stroke-width":"100","stroke-linecap":"butt"},null,8,["current-rate","text"]),e("h3",null,s(t(p)(t(_))),1),e("span",null,s(t(n)("thirdPartyWallet")),1)])]),e("div",ke,[d.value==0?(c(),r("button",{key:0,class:"recycleBtn",onClick:F},s(t(n)("oneClickRecovery")),1)):(c(),r("button",Re,s(t(n)("recycling"))+" "+s(d.value),1))]),e("div",Be,[(c(),r(N,null,V(P,(l,B)=>e("div",{key:B,onClick:Ae=>U(l.link)},[e("div",be,[e("img",{src:t(ce)("wallet",l.icon)},null,8,De)]),e("span",null,s(l.title),1)],8,Ce)),64))])]),t(k)?(c(),r("div",xe,[(c(!0),r(N,null,V(t(k),(l,B)=>(c(),r("div",{class:Y(["box",l.balance>0?"select":""]),key:B},[g(M,{name:l.vendorCode},null,8,["name"]),e("h3",Le,s(t(p)(l.balance," ")),1),e("span",null,s(t(ie)(l.vendorCode)),1)],2))),128))])):(c(),r("div",Se,[e("div",null,s(t(n)("noData")),1)]))])])}}});export{Me as _};
