best-unit 2.1.4 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/best-unit.cjs
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
.${e.scrollbarClass}::-webkit-scrollbar-thumb:hover {
|
|
76
76
|
background: ${e.scrollbarThumbHoverColor};
|
|
77
77
|
}
|
|
78
|
-
`,document.head.appendChild(n),t}function Kn({visible:e,onClose:t,title:n,children:r,width:o=re===l.SMALL?300:400,maxWidth:a=re===l.SMALL?300:400,showClose:i=!0,maskClosable:s=!0}){const[f,d]=R(!1),p=wi();H(()=>{Ai(p)},[p]);const u=b=>{b.target===b.currentTarget?d(!0):d(!1)},x=b=>{b.target===b.currentTarget&&f&&s&&t(),d(!1)};return e?c("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:p.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onMouseDown:u,onMouseUp:x,children:c("div",{style:{background:p.modalBg,borderRadius:re===l.SMALL?8:12,minWidth:o,maxWidth:a,color:p.modalColor,boxShadow:p.modalBoxShadow,position:"relative",width:typeof o=="string"?o:`${o}px`,maxHeight:"90vh",display:"flex",flexDirection:"column"},onClick:b=>b.stopPropagation(),children:[c("div",{style:{position:"sticky",top:0,background:p.modalBg,borderRadius:re===l.SMALL?"8px 8px 0 0":"12px 12px 0 0",padding:re===l.SMALL?"24px 24px 0 24px":"32px 32px 0 32px",zIndex:1,borderBottom:`1px solid ${p.headerBorder}`},children:[i&&c("button",{type:"button",onClick:t,style:p.closeBtn,"aria-label":"关闭",children:"×"}),n&&c("div",{style:p.title,children:n})]}),c("div",{className:`modal-content ${p.scrollbarClass}`,style:{flex:1,overflowY:"auto",padding:re===l.SMALL?"16px 24px 24px 24px":"20px 32px 32px 32px"},children:r})]})}):null}function ki(){const e=B("size");return{white:{tabBtn:(t,n)=>({flex:1,background:t?"#fff":"#F7F8FA",color:t?"#1890ff":"#222",border:"1px solid #F0F1F3",borderRadius:n?"8px 0 0 8px":"0 8px 8px 0",fontWeight:500,fontSize:e===l.SMALL?12:16,height:e===l.SMALL?32:48,boxShadow:t?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer"})},dark:{tabBtn:(t,n)=>({flex:1,background:t?"#23262F":"#181A20",color:t?"#00E8C6":"#fff",border:"1px solid #444C5C",borderRadius:n?"8px 0 0 8px":"0 8px 8px 0",fontWeight:500,fontSize:e===l.SMALL?12:16,height:e===l.SMALL?32:48,boxShadow:t?"0 2px 8px 0 rgba(20,20,20,0.10)":"none",outline:"none",cursor:"pointer"})}}}function Ei(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=ki(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,tabBtn:(i,s)=>({...o.tabBtn(i,s),color:i?a.color:o.tabBtn(i,s).color})}}return o}const vi=B("size");function Ci({visible:e,onClose:t,onSubmit:n}){const[r,o]=R({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[a,i]=R({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}),[s,f]=R("online"),d=Ei();H(()=>{e||(f("online"),o({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),i({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]);const p=async u=>{u.preventDefault();let x=!0;if(o(b=>({...b,amountError:"",rechargeChannelError:""})),r.amount.trim()||(o(b=>({...b,amountError:_("请输入充值金额")})),x=!1),r.rechargeChannel||(o(b=>({...b,rechargeChannelError:_("请选择支付平台")})),x=!1),!!x){o(b=>({...b,loading:!0,error:""}));try{await n({amount:r.amount,rechargeChannel:r.rechargeChannel,currency:r.currency}),t()}catch{o(b=>({...b,error:_("提交失败,请重试")}))}finally{o(b=>({...b,loading:!1}))}}};return c(Kn,{visible:e,onClose:t,title:_("充值 / 转账"),children:[c("div",{style:{display:"flex",marginBottom:vi===l.SMALL?16:28},children:[c("button",{type:"button",onClick:()=>f("online"),style:d.tabBtn(s==="online",!0),children:_("在线充值")}),c("button",{type:"button",onClick:()=>f("offline"),style:d.tabBtn(s==="offline",!1),children:_("线下转账")})]}),c("div",{style:{display:s==="online"?"block":"none"},children:c("form",{onSubmit:p,children:c(mi,{formState:r,setFormState:o,onClose:t,loading:r.loading})})}),c("div",{style:{display:s==="offline"?"block":"none"},children:c(Si,{formState:a,setFormState:i,onClose:t,loading:a.loading})})]})}function mt(){return(mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Bi=["context","children"];function Ti(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var a,i,s={},f=Object.keys(r);for(i=0;i<f.length;i++)o.indexOf(a=f[i])>=0||(s[a]=r[a]);return s}(e,Bi);return fn(t,n)}function Mi(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=ie(Ti,mt({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],a={},i=0,s=n.attributes,f=n.childNodes;for(i=s.length;i--;)s[i].name!=="slot"&&(a[s[i].name]=s[i].value,a[Xn(s[i].name)]=s[i].value);for(i=f.length;i--;){var d=t(f[i],null),p=f[i].slot;p?a[p]=ie(Gt,{name:p},d):o[i]=d}var u=r?ie(Gt,null,o):o;return ie(r||n.nodeName.toLowerCase(),a,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?un:Oe)(this._vdom,this._root)}function Xn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function Ri(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[Xn(e)]=n,this._vdom=fn(this._vdom,r),Oe(this._vdom,this._root)}}function Fi(){Oe(this._vdom=null,this._root)}function Gt(e,t){var n=this;return ie("slot",mt({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function qe(e,t,n,r){function o(){var a=Reflect.construct(HTMLElement,[],o);return a._vdomComponent=e,a._root=r&&r.shadow?a.attachShadow({mode:r.mode||"open"}):a,a}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=Mi,o.prototype.attributeChangedCallback=Ri,o.prototype.disconnectedCallback=Fi,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(a){Object.defineProperty(o.prototype,a,{get:function(){return this._vdom.props[a]},set:function(i){this._vdom?this.attributeChangedCallback(a,null,i):(this._props||(this._props={}),this._props[a]=i,this.connectedCallback());var s=typeof i;i!=null&&s!=="string"&&s!=="boolean"&&s!=="number"||this.setAttribute(a,i)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}function Ii(){const[e,t]=R(!1),n=async r=>{const o=await jn({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return c("div",{children:[c(ht,{onClick:()=>t(!0),children:_("充值/转账")}),c(Ci,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}qe(Ii,"best-recharge",["theme"],{shadow:!1});function zi(){const e=B("size"),t={wrapper:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:e===l.SMALL?12:20,alignItems:"start",minWidth:880,"@media (max-width: 1020px)":{gridTemplateColumns:"1fr",gap:16,minWidth:"auto",width:"100%"}},fieldLabel:{fontSize:e===l.SMALL?12:13,marginBottom:6,fontWeight:500,textAlign:"left"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13},inputWrapper:{position:"relative"},inputSuffix:{padding:"0 8px",fontSize:e===l.SMALL?12:13,opacity:.8},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},subTitle:{marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?8:10,fontWeight:600,textAlign:"left"},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},methodList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},bankList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}}};return{white:{...t,left:{background:"#fff",borderRadius:8,padding:16,border:"1px solid #E5E6EB"},right:{background:"#fff",borderRadius:8,padding:16},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 480px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#1890ff":"#E5E6EB"}`,color:n?"#1890ff":"#222",background:n?"#EEF7FF":"#fff",cursor:"pointer"}),input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:600,cursor:"pointer"},methodItem:n=>({padding:"10px 12px",textAlign:"left",borderRadius:8,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",cursor:"pointer"}),bankItem:{padding:"10px 12px",borderRadius:8,border:"1px solid #F0F1F3",background:"#F7F8FA",textAlign:"left"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left"},reminderList:{margin:0,paddingLeft:18,color:"#6b7280",lineHeight:1.6,textAlign:"left"}},dark:{...t,left:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},right:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 480px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#00E8C6":"#374151"}`,color:n?"#00E8C6":"#fff",background:n?"#0F2824":"#23262F",cursor:"pointer"}),input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#00E8C6",color:"#111",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:700,cursor:"pointer"},methodItem:n=>({padding:"10px 12px",textAlign:"left",borderRadius:8,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",color:"#fff",cursor:"pointer"}),bankItem:{padding:"10px 12px",borderRadius:8,border:"1px solid #374151",background:"#23262F",textAlign:"left",color:"#fff"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1",fontSize:e===l.SMALL?12:13},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left",color:"#fff"},reminderList:{margin:0,paddingLeft:18,color:"#B5B8BE",lineHeight:1.6,textAlign:"left"}}}}function Di(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=zi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,payButton:{...o.payButton,background:a.color},currencyItem:i=>({...o.currencyItem(i),border:`1px solid ${i?a.color:n?"#E5E6EB":"#374151"}`,color:i?a.color:n?"#222":"#fff"}),methodItem:i=>({...o.methodItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`})}}return o}function Oi(){const e=B("size"),t={left:{background:"#fff",borderRadius:8,padding:16,border:"1px solid #E5E6EB"},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},fieldLabel:{fontSize:e===l.SMALL?14:16,marginBottom:6,fontWeight:500,textAlign:"left"},required:{color:"#ff4d4f",marginRight:4},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 600px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#1890ff":"#E5E6EB"}`,color:n?"#1890ff":"#222",background:n?"#EEF7FF":"#fff",cursor:"pointer"}),inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},bizRateBox:{marginTop:6,color:"#666",fontSize:e===l.SMALL?12:13,textAlign:"left",lineHeight:1.6},bizRateStrong:{color:"#111",fontWeight:600},subTitle:{fontSize:e===l.SMALL?12:14,marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?8:10,textAlign:"left"},methodList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},methodItem:n=>({padding:"12px 16px",textAlign:"left",borderRadius:10,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),channelIcon:{width:22,height:22,objectFit:"contain",marginRight:8,display:"inline-block"},bankList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},bankItem:n=>({padding:"12px 16px",borderRadius:10,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",textAlign:"left",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13}};return{white:{...t,input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"}},dark:{...t,left:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#00E8C6":"#374151"}`,color:n?"#00E8C6":"#fff",background:n?"#0F2824":"#23262F",cursor:"pointer"}),input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},bizRateBox:{...t.bizRateBox,color:"#B5B8BE"},bizRateStrong:{color:"#ff4d4f",fontWeight:600},methodItem:n=>({padding:"12px 16px",textAlign:"left",borderRadius:10,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),bankItem:n=>({padding:"12px 16px",borderRadius:10,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",textAlign:"left",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44})}}}function Pi(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=Oi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,titleBar:{...o.titleBar,background:a.color},currencyItem:i=>({...o.currencyItem(i),border:`1px solid ${i?a.color:n?"#E5E6EB":"#374151"}`,color:i?a.color:n?"#222":"#fff"}),methodItem:i=>({...o.methodItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`}),bankItem:i=>({...o.bankItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`})}}return o}function Ni({onChannelChange:e,onAmountChange:t,onCurrencyChange:n,initialAmount:r="",initialCurrency:o="USD",initialPaymentType:a="online",amountError:i=""}){const s=Pi(),[f,d]=R([]),[p,u]=R([]),[x,b]=R([]),[h,y]=R({currency:o,amount:r,onlineChannel:"",bankChannel:"",paymentType:a,amountError:""}),[m,L]=R(null),S=se(null),k=(w,F)=>{const U=w!==void 0?w:h.amount,W=F!==void 0?F:h.currency;if(!U||Number(U)<=0){L(null);return}S.current&&clearTimeout(S.current),S.current=window.setTimeout(()=>{Ko({currency:W,amount:U}).then(V=>L(V)).catch(()=>L(null))},300)};H(()=>{Vo().then(w=>{d(w||[])})},[]),H(()=>{Go({currency:h.currency}).then(w=>{const F=w.onlineChannel||[],U=w.offlineChannel||[];u(F),b(U);const W=F.length>0,V=U?.[0]?.value||"",Le=F?.[0]?.value||"",de=W?a:"bank",C=de==="online"?Le:V;y(M=>({...M,onlineChannel:Le,bankChannel:V,paymentType:de})),C&&e(C,de)})},[h.currency]);function E(w){return w=w.replace(/[^\d.]/g,""),w=w.replace(/\.(?=.*\.)/g,""),w=w.replace(/^(\d+)(\.\d{0,2})?.*$/,"$1$2"),w=w.replace(/^0+(\d)/,"$1"),w.startsWith(".")&&(w="0"+w),w}const A=w=>{y(F=>({...F,currency:w})),n(w),k(void 0,w)},v=w=>{const F=E(w);y(U=>({...U,amount:F,amountError:""})),t(F),k(F)},P=(w,F)=>{y(U=>({...U,[F==="online"?"onlineChannel":"bankChannel"]:w,paymentType:F})),e(w,F),k()};return c("div",{style:s.left,children:[c("div",{style:s.blockTitle,children:[c("span",{style:s.titleBar}),_("选择支付方式")]}),c("div",{style:s.fieldLabel,children:_("支付币种")}),c("div",{style:s.currencyRow,children:(f||[]).slice(0,4).map(w=>c("button",{type:"button",onClick:()=>A(w.value),style:s.currencyItem(h.currency===w.value),children:w.label}))}),c("div",{style:{height:12}}),c("div",{style:s.fieldLabel,children:[c("span",{style:s.required,children:"*"}),_("支付金额")]}),c("div",{style:s.inputWrapper,children:[c("input",{type:"text",placeholder:_("请输入充值金额"),value:h.amount,onInput:w=>{v(w.target.value)},style:{...s.input,...i?s.inputError:{}}}),c("div",{style:s.inputSuffixAbs,children:h.currency})]}),i&&c("div",{style:s.error,children:i}),m&&m.consistent===!1&&c("div",{style:s.bizRateBox,children:[c("div",{children:_("您的支付币种与默认币种不一致,将转换为默认币种入账")}),c("div",{children:[_("目前汇率为:")," ",h.currency,_(`→${m.currency} = `),c("span",{style:s.bizRateStrong,children:m.exchangeRate})]}),c("div",{children:[_("钱包预计增加"),c("span",{style:s.bizRateStrong,children:[m.currency," ",m.amount]})]})]}),c("div",{style:{height:20}}),c("div",{style:s.fieldLabel,children:_("支付方式")}),p.length>0&&c("div",{children:[c("div",{style:s.subTitle,children:_("线上支付")}),c("div",{style:s.methodList,children:p.map(w=>c("button",{type:"button",onClick:()=>P(w.value,"online"),style:s.methodItem(h.onlineChannel===w.value&&h.paymentType==="online"),children:[w.icon&&c("img",{src:w.icon,alt:w.label,style:s.channelIcon}),w.label]}))})]}),c("div",{style:s.subTitle,children:_("银行转账")}),c("div",{style:s.bankList,children:x.map(w=>c("button",{type:"button",onClick:()=>P(w.value,"bank"),style:s.bankItem(h.bankChannel===w.value&&h.paymentType==="bank"),children:[w.icon&&c("img",{src:w.icon,alt:w.label,style:s.channelIcon}),w.label]}))})]})}function Ui(){const e=B("size"),t={right:{background:"#fff",borderRadius:8,padding:16},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},disabled:{backgroundColor:"#f5f5f5",color:"#999",cursor:"not-allowed"},disabledDark:{backgroundColor:"#1A1D23",color:"#6B7280",cursor:"not-allowed",border:"1px solid #374151"},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:600,cursor:"pointer"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13},calcBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?8:12,color:"#666",textAlign:"left",lineHeight:1.6,fontSize:e===l.SMALL?12:13},calcLine:{marginBottom:4},calcAmount:{color:"#ff4d4f",fontWeight:700,margin:"0 4px"},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left"},reminderList:{margin:0,paddingLeft:18,color:"#6b7280",lineHeight:1.6,textAlign:"left",listStyleType:"disc",listStylePosition:"outside"},listItem:{listStyleType:"disc",listStylePosition:"outside"},error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13}};return{white:{...t,input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"}},dark:{...t,right:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},payButton:{...t.payButton,background:"#00E8C6",color:"#111",fontWeight:700},noticeBox:{...t.noticeBox,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1"},calcBox:{...t.calcBox,color:"#B5B8BE"},reminderTitle:{...t.reminderTitle,color:"#fff"},reminderList:{...t.reminderList,color:"#B5B8BE"}}}}function Wi(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=Ui(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,payButton:{...o.payButton,background:a.color},titleBar:{...o.titleBar,background:a.color}}}return o}function $i({onSubmit:e,amount:t,currency:n,channel:r,loading:o=!1,error:a="",onAmountError:i}){const s=Wi(),f=s.right.background==="#181A20",[d,p]=R({amount:t,currency:n,channel:r,loading:o,error:a,amountError:""}),[u,x]=R(null);H(()=>{p(y=>({...y,amount:t,currency:n,channel:r,loading:o,error:a}));const h=setTimeout(()=>{t&&r&&n?qn({channel:r,amount:t,currency:n}).then(y=>x(y)).catch(()=>x(null)):x(null)},300);return()=>clearTimeout(h)},[t,n,r,o,a]);const b=async h=>{h&&h.preventDefault();let y=!0;if(t.trim()||(y=!1,i?.(_("请输入充值金额"))),r||(y=!1,p(m=>({...m,error:_("请选择支付平台")}))),!!y){p(m=>({...m,loading:!0,error:""}));try{await e({amount:t,currency:n,rechargeChannel:r})}finally{p(m=>({...m,loading:!1}))}}};return c("div",{style:s.right,children:[c("div",{style:s.blockTitle,children:[c("span",{style:s.titleBar}),_("在线支付")]}),c("form",{onSubmit:b,children:[c("div",{style:s.inputWrapper,children:[c("input",{type:"text",placeholder:_("支付金额"),value:d.amount,readOnly:!0,disabled:!0,style:{...s.input,...f?s.disabledDark:s.disabled,width:"100%"}}),c("div",{style:s.inputSuffixAbs,children:d.currency})]}),c("button",{type:"submit",disabled:d.loading,style:s.payButton,children:d.loading?_("提交中..."):_("立即支付")})]}),u&&c("div",{style:s.calcBox,children:[c("div",{style:s.calcLine,children:[_("预计支付金额约为:"),c("span",{style:s.calcAmount,children:`$${u.paymentAmount}`}),u.currency]}),c("div",{style:s.calcLine,children:[_("手续费约为:"),c("span",{style:s.calcAmount,children:`$${u.fee}`}),u.currency]}),c("div",{children:_("注:地区/币种/卡类型可能影响手续费,最终以平台为准。")})]}),c("div",{style:s.noticeBox,children:_("请在转账后提交银行回单,否则可能无法及时核验")}),c("div",{style:s.reminderTitle,children:_("温馨提示")}),c("ul",{style:s.reminderList,children:[c("li",{children:_("创建付款时请勿填写敏感备注,例如:topup ads、order等、建议填写数字代码")}),c("li",{children:_("请填写正确的支付金额、币种、支付时间,相同的交易请勿重复提交。")}),c("li",{children:_("请上传交易凭证,否则无法核验并及时添加余额。")}),c("li",{children:_("提交成功后根据实际到账金额添加余额。工作时间提交的转账当日处理,非工作时间提交的转账将在下一个工作日处理。")}),c("li",{children:_("通过平台互转(例如payoneer转payoneer)付款方式可能会有10分钟延迟,请耐心等待。")}),c("li",{children:_("广告款项若入账金额为美金外其他币种额外扣除0.6%手续费,其中PayPal支付方式额外扣除2.5%手续费。")}),c("li",{children:_("如有问题,请联系客服。")})]}),d.error&&c("div",{style:s.error,children:d.error})]})}function Hi(){const e=B("size"),t={container:{background:"#fff",borderRadius:8,padding:e===l.SMALL?14:16,width:"100%",maxWidth:"100%",boxSizing:"border-box","@media (max-width: 1020px)":{padding:e===l.SMALL?12:16}},header:{marginBottom:e===l.SMALL?16:20},backButton:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",color:"#1890ff",cursor:"pointer",fontSize:e===l.SMALL?13:14,fontWeight:500},backIcon:{fontSize:e===l.SMALL?16:18},uploadSection:{marginBottom:e===l.SMALL?18:24},uploadArea:{border:"2px dashed #D9D9D9",borderRadius:8,padding:e===l.SMALL?"30px 16px":"40px 20px",textAlign:"center",cursor:"pointer",background:"#FAFAFA",transition:"all 0.3s ease",width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{padding:e===l.SMALL?"30px 15px":"40px 20px"}},uploadIcon:{fontSize:e===l.SMALL?40:52,marginBottom:e===l.SMALL?10:12},uploadTitle:{fontSize:e===l.SMALL?14:16,fontWeight:600,color:"#222",marginBottom:e===l.SMALL?6:10},uploadHint:{fontSize:e===l.SMALL?12:13,color:"#999"},hiddenInput:{display:"none"},fileList:{marginTop:e===l.SMALL?10:12},fileItem:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:e===l.SMALL?"6px 10px":"8px 12px",background:"#F5F5F5",borderRadius:6,marginBottom:6},fileName:{fontSize:e===l.SMALL?12:13,color:"#222"},removeButton:{background:"#ff4d4f",color:"#fff",border:"none",borderRadius:"50%",width:20,height:20,cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",justifyContent:"center"},fieldSection:{marginBottom:e===l.SMALL?12:16},radioGroup:{display:"flex",alignItems:"center",gap:e===l.SMALL?16:20,flexWrap:"wrap"},radioOption:{display:"inline-flex",alignItems:"center",gap:6,color:"#222",fontSize:e===l.SMALL?13:14,cursor:"pointer"},subBizGrid:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:e===l.SMALL?10:12,width:"100%","@media (max-width: 600px)":{gridTemplateColumns:"1fr"}},subBizField:{minWidth:0},subBizHint:{marginTop:8,color:"#666",fontSize:e===l.SMALL?12:13},fieldLabel:{display:"block",fontSize:e===l.SMALL?13:14,fontWeight:500,color:"#222",marginBottom:e===l.SMALL?6:10},required:{color:"#ff4d4f",marginRight:4},inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,border:"1px solid #D9D9D9",outline:"none",fontSize:14,boxSizing:"border-box"},inputError:{border:"1px solid #ff4d4f"},disabled:{backgroundColor:"#f5f5f5",color:"#999",cursor:"not-allowed"},disabledDark:{backgroundColor:"#1A1D23",color:"#6B7280",cursor:"not-allowed",border:"1px solid #374151"},calendarIcon:{position:"absolute",right:e===l.SMALL?8:10,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?12:14,pointerEvents:"none"},currencySuffix:{position:"absolute",right:e===l.SMALL?10:12,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?12:14,color:"#999",pointerEvents:"none"},buttonSection:{display:"flex",gap:e===l.SMALL?10:12,marginTop:e===l.SMALL?24:32,width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{flexDirection:"column",gap:e===l.SMALL?8:12}},cancelButton:{flex:1,padding:e===l.SMALL?"8px 12px":"10px 16px",borderRadius:6,border:"1px solid #D9D9D9",background:"#fff",color:"#222",fontSize:e===l.SMALL?12:14,fontWeight:500,cursor:"pointer",minWidth:0,boxSizing:"border-box"},submitButton:{flex:1,padding:e===l.SMALL?"8px 12px":"10px 16px",borderRadius:6,border:"none",background:"#1890ff",color:"#fff",fontSize:e===l.SMALL?12:14,fontWeight:600,cursor:"pointer",minWidth:0,boxSizing:"border-box"},error:{color:"#ff4d4f",fontSize:e===l.SMALL?12:13,marginTop:6}};return{white:{...t},dark:{...t,container:{...t.container,background:"#181A20",border:"1px solid #2B2E38"},backButton:{...t.backButton,color:"#00E8C6"},uploadArea:{...t.uploadArea,border:"2px dashed #374151",background:"#23262F"},uploadTitle:{...t.uploadTitle,color:"#fff"},uploadHint:{...t.uploadHint,color:"#B5B8BE"},fileItem:{...t.fileItem,background:"#2B2E38"},fileName:{...t.fileName,color:"#fff"},fieldLabel:{...t.fieldLabel,color:"#fff"},radioOption:{...t.radioOption,color:"#fff"},subBizHint:{...t.subBizHint,color:"#B5B8BE"},input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},calendarIcon:{...t.calendarIcon,color:"#B5B8BE"},currencySuffix:{...t.currencySuffix,color:"#B5B8BE"},cancelButton:{...t.cancelButton,border:"1px solid #374151",background:"#23262F",color:"#fff"},submitButton:{...t.submitButton,background:"#00E8C6",color:"#111"}}}}function ji(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=Hi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,backButton:{...o.backButton,color:a.color},submitButton:{...o.submitButton,background:a.color}}}return o}const qi="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1760084950168'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6759'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M932.579556%20137.272889h-192V64.142222a9.159111%209.159111%200%200%200-9.130667-9.159111h-64a9.159111%209.159111%200%200%200-9.159111%209.159111v73.130667H365.738667V64.142222a9.159111%209.159111%200%200%200-9.159111-9.159111h-64a9.159111%209.159111%200%200%200-9.130667%209.159111v73.130667h-192c-20.224%200-36.579556%2016.355556-36.579556%2036.579555v758.869334c0%2020.195556%2016.355556%2036.551111%2036.579556%2036.551111h841.130667c20.252444%200%2036.579556-16.327111%2036.579555-36.551111V173.852444c0-20.224-16.355556-36.579556-36.579555-36.579555zM886.897778%20887.011556H137.159111V452.693333H886.897778v434.261334z%20m-749.710222-512V219.534222h146.289777v54.869334c0%205.034667%204.124444%209.130667%209.130667%209.130666h64a9.159111%209.159111%200%200%200%209.159111-9.130666V219.562667h292.551111v54.869333c0%205.034667%204.124444%209.130667%209.159111%209.130667h64a9.159111%209.159111%200%200%200%209.130667-9.130667V219.562667h146.289778v155.448889H137.159111z'%20p-id='6760'%3e%3c/path%3e%3c/svg%3e";function Ji(){const e=B("theme"),t=B("themeConfig"),n={container:{position:"relative",display:"inline-block"},input:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",backgroundColor:"#fff",cursor:"pointer",transition:"all 0.3s",outline:"none",fontSize:"14px",lineHeight:"1.5715",color:"rgba(0, 0, 0, 0.85)"},inputText:{flex:1,textAlign:"left",color:"rgba(0, 0, 0, 0.85)"},calendarIcon:{fontSize:"16px",color:"rgba(0, 0, 0, 0.45)",marginLeft:"8px",width:16,height:16,objectFit:"contain",display:"inline-block"},disabled:{backgroundColor:"#f5f5f5",color:"rgba(0, 0, 0, 0.25)",cursor:"not-allowed"},panel:{position:"absolute",top:"100%",left:0,zIndex:1050,backgroundColor:"#fff",border:"1px solid #d9d9d9",borderRadius:"6px",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",padding:"8px",minWidth:"280px",marginTop:"4px"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 0",marginBottom:"8px"},navButton:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"16px",color:"rgba(0, 0, 0, 0.45)",transition:"all 0.3s"},monthYear:{fontSize:"16px",fontWeight:500,color:"rgba(0, 0, 0, 0.85)"},weekHeader:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"4px",marginBottom:"8px"},weekDay:{display:"flex",alignItems:"center",justifyContent:"center",height:"32px",fontSize:"14px",fontWeight:500,color:"rgba(0, 0, 0, 0.85)"},calendarGrid:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"4px"},dayButton:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"14px",transition:"all 0.3s",color:"rgba(0, 0, 0, 0.85)"},dayCurrentMonth:{color:"rgba(0, 0, 0, 0.85)"},dayOtherMonth:{color:"rgba(0, 0, 0, 0.25)"},dayToday:{fontWeight:600,color:"#1890ff"},daySelected:{backgroundColor:"#1890ff",color:"#fff"},yearPicker:{maxHeight:"200px",overflowY:"auto",marginBottom:"8px",border:"1px solid #f0f0f0",borderRadius:"4px",padding:"8px"},yearGrid:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"4px"},yearButton:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"14px",transition:"all 0.3s",color:"rgba(0, 0, 0, 0.85)"},yearSelected:{backgroundColor:"#1890ff",color:"#fff"},small:{padding:"4px 8px",fontSize:"12px"},middle:{padding:"8px 12px",fontSize:"14px"},large:{padding:"12px 16px",fontSize:"16px"}},r={white:{...n,input:{...n.input,border:"1px solid #d9d9d9",backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.85)"},inputText:{...n.inputText,color:"rgba(0, 0, 0, 0.85)"},calendarIcon:{...n.calendarIcon,color:"rgba(0, 0, 0, 0.45)"},disabled:{...n.disabled,backgroundColor:"#f5f5f5",color:"rgba(0, 0, 0, 0.25)"},panel:{...n.panel,backgroundColor:"#fff",border:"1px solid #d9d9d9"},navButton:{...n.navButton,color:"rgba(0, 0, 0, 0.45)"},monthYear:{...n.monthYear,color:"rgba(0, 0, 0, 0.85)"},weekDay:{...n.weekDay,color:"rgba(0, 0, 0, 0.85)"},dayButton:{...n.dayButton,color:"rgba(0, 0, 0, 0.85)"},dayCurrentMonth:{...n.dayCurrentMonth,color:"rgba(0, 0, 0, 0.85)"},dayOtherMonth:{...n.dayOtherMonth,color:"rgba(0, 0, 0, 0.25)"},dayToday:{...n.dayToday,color:"#1890ff"},daySelected:{...n.daySelected,backgroundColor:"#1890ff",color:"#fff"},yearPicker:{...n.yearPicker,border:"1px solid #f0f0f0"},yearButton:{...n.yearButton,color:"rgba(0, 0, 0, 0.85)"},yearSelected:{...n.yearSelected,backgroundColor:"#1890ff",color:"#fff"}},dark:{...n,input:{...n.input,border:"1px solid #434343",backgroundColor:"#141414",color:"rgba(255, 255, 255, 0.85)"},inputText:{...n.inputText,color:"rgba(255, 255, 255, 0.85)"},calendarIcon:{...n.calendarIcon,color:"rgba(255, 255, 255, 0.45)"},disabled:{...n.disabled,backgroundColor:"#262626",color:"rgba(255, 255, 255, 0.25)"},panel:{...n.panel,backgroundColor:"#141414",border:"1px solid #434343"},navButton:{...n.navButton,color:"rgba(255, 255, 255, 0.45)"},monthYear:{...n.monthYear,color:"rgba(255, 255, 255, 0.85)"},weekDay:{...n.weekDay,color:"rgba(255, 255, 255, 0.85)"},dayButton:{...n.dayButton,color:"rgba(255, 255, 255, 0.85)"},dayCurrentMonth:{...n.dayCurrentMonth,color:"rgba(255, 255, 255, 0.85)"},dayOtherMonth:{...n.dayOtherMonth,color:"rgba(255, 255, 255, 0.25)"},dayToday:{...n.dayToday,color:"#00E8C6"},daySelected:{...n.daySelected,backgroundColor:"#00E8C6",color:"#111"},yearPicker:{...n.yearPicker,border:"1px solid #434343"},yearButton:{...n.yearButton,color:"rgba(255, 255, 255, 0.85)"},yearSelected:{...n.yearSelected,backgroundColor:"#00E8C6",color:"#111"}}},o=r[e]||r.white,a=t?.[e]?.color;return a&&(o.dayToday.color=a,o.daySelected.backgroundColor=a,o.yearSelected.backgroundColor=a,e==="dark"&&(o.daySelected.color="#111",o.yearSelected.color="#111")),o}function Vi(){return Ji()}function Yi({value:e="",placeholder:t=_("请选择日期"),disabled:n=!1,size:r="middle",onChange:o,onFocus:a,onBlur:i,className:s="",style:f={}}){const d=Vi(),[p,u]=R(!1),[x,b]=R(e),[h,y]=R(new Date),[m,L]=R(!1),S=se(null),k=C=>{if(!C)return"";const M=new Date(C);return`${M.getFullYear()}-${String(M.getMonth()+1).padStart(2,"0")}-${String(M.getDate()).padStart(2,"0")}`},E=(C,M)=>new Date(C,M+1,0).getDate(),A=(C,M)=>new Date(C,M,1).getDay(),v=()=>{const C=h.getFullYear(),M=h.getMonth(),ue=E(C,M),Zn=A(C,M),fe=[],gt=M===0?11:M-1,bt=M===0?C-1:C,yt=E(bt,gt);for(let j=Zn-1;j>=0;j--)fe.push({date:yt-j,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${bt}-${String(gt+1).padStart(2,"0")}-${String(yt-j).padStart(2,"0")}`});const Qn=new Date,xt=x?new Date(x):null;for(let j=1;j<=ue;j++){const _t=`${C}-${String(M+1).padStart(2,"0")}-${String(j).padStart(2,"0")}`,St=new Date(_t);fe.push({date:j,isCurrentMonth:!0,isToday:St.toDateString()===Qn.toDateString(),isSelected:xt&&St.toDateString()===xt.toDateString(),fullDate:_t})}const er=M===11?0:M+1,tr=M===11?C+1:C,nr=42-fe.length;for(let j=1;j<=nr;j++)fe.push({date:j,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${tr}-${String(er+1).padStart(2,"0")}-${String(j).padStart(2,"0")}`});return fe},P=C=>{b(C),u(!1),o?.(C)},w=C=>{const M=new Date(h);C==="prev"?M.setMonth(M.getMonth()-1):M.setMonth(M.getMonth()+1),y(M)},F=C=>{const M=new Date(h);C==="prev"?M.setFullYear(M.getFullYear()-1):M.setFullYear(M.getFullYear()+1),y(M)},U=C=>{const M=new Date(h);M.setFullYear(C),y(M),L(!1)},W=()=>{const C=new Date().getFullYear(),M=[];for(let ue=C-50;ue<=C+50;ue++)M.push(ue);return M};H(()=>{const C=M=>{S.current&&!S.current.contains(M.target)&&u(!1)};if(p)return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[p]);const V=v(),Le=[_("一月"),_("二月"),_("三月"),_("四月"),_("五月"),_("六月"),_("七月"),_("八月"),_("九月"),_("十月"),_("十一月"),_("十二月")],de=[_("日"),_("一"),_("二"),_("三"),_("四"),_("五"),_("六")];return c("div",{ref:S,className:`date-picker-container ${s}`,style:{...d.container,...f},children:[c("div",{style:{...d.input,...d[r],...n?d.disabled:{}},onClick:()=>!n&&u(!p),onFocus:a,onBlur:i,children:[c("span",{style:d.inputText,children:x?k(x):t}),c("img",{src:qi,alt:"calendar",style:d.calendarIcon})]}),p&&c("div",{style:d.panel,children:[c("div",{style:d.header,children:[c("button",{type:"button",style:d.navButton,onClick:()=>F("prev"),children:"‹‹"}),c("button",{type:"button",style:d.navButton,onClick:()=>w("prev"),children:"‹"}),c("span",{style:d.monthYear,onClick:()=>L(!m),children:[h.getFullYear()," ",_("年")," ",Le[h.getMonth()]]}),c("button",{type:"button",style:d.navButton,onClick:()=>w("next"),children:"›"}),c("button",{type:"button",style:d.navButton,onClick:()=>F("next"),children:"››"})]}),m&&c("div",{style:d.yearPicker,children:c("div",{style:d.yearGrid,children:W().map(C=>c("button",{type:"button",style:{...d.yearButton,...C===h.getFullYear()?d.yearSelected:{}},onClick:()=>U(C),children:C},C))})}),c("div",{style:d.weekHeader,children:de.map(C=>c("div",{style:d.weekDay,children:C},C))}),c("div",{style:d.calendarGrid,children:V.map((C,M)=>c("button",{type:"button",style:{...d.dayButton,...C.isCurrentMonth?d.dayCurrentMonth:d.dayOtherMonth,...C.isToday?d.dayToday:{},...C.isSelected?d.daySelected:{}},onClick:()=>P(C.fullDate),disabled:n,children:C.date},M))})]})]})}function Kt(e){return e==="ad"?"Advertising":e==="fulfill"?"Fulfillment":e==="chargewipe"?"ChargeWipe":e}function Gi(){const[e,t]=R([]),[n,r]=R(!1),[o,a]=R({}),[i,s]=R("");return H(()=>{let x=!0;const b=y=>{x&&(t(y),a(m=>y.reduce((L,S)=>({...L,[S.bizType]:m[S.bizType]||""}),{})))},h=JSON.parse(sessionStorage.getItem("allBalances")||"[]");return Array.isArray(h)&&h.length>0&&b(h),Wn().then(y=>{b(y)}).catch(()=>{Array.isArray(h)||b([])}),()=>{x=!1}},[]),{subBusinesses:e,useFundAllocation:n,subBizPercentages:o,subBizError:i,setUseFundAllocation:x=>{r(x),s("")},setSubBizPercentage:(x,b)=>{a(h=>({...h,[x]:b})),s("")},validateFundAllocation:()=>{if(!n||e.length===0)return!0;const x=e.some(y=>!o[y.bizType]?.trim()),b=e.some(y=>{const m=Number(o[y.bizType]);return Number.isNaN(m)||m<0||m>100}),h=e.reduce((y,m)=>y+Number(o[m.bizType]||0),0);return x?(s(_("请输入子业务占比")),!1):b||Math.abs(h-100)>1e-4?(s(_("子业务占比总和必须为100%")),!1):(s(""),!0)},buildAllocationRatios:()=>n?e.map(x=>({fundBalanceId:x.fundBalanceId,ratio:String(o[x.bizType]||"")})):[]}}function Ki({theme:e,useFundAllocation:t,subBusinesses:n,subBizPercentages:r,subBizError:o,onUseFundAllocationChange:a,onPercentageChange:i}){return c(Z,{children:[c("div",{style:e.fieldSection,children:[c("label",{style:e.fieldLabel,children:_("是否使用资金分配")}),c("div",{style:e.radioGroup,children:[c("label",{style:e.radioOption,children:[c("input",{type:"radio",name:"useFundAllocation",checked:t,onChange:()=>a(!0)}),c("span",{children:_("是")})]}),c("label",{style:e.radioOption,children:[c("input",{type:"radio",name:"useFundAllocation",checked:!t,onChange:()=>a(!1)}),c("span",{children:_("否")})]})]})]}),t&&n.length>0&&c("div",{style:e.fieldSection,children:[c("div",{style:e.subBizGrid,children:n.map(s=>c("div",{style:e.subBizField,children:[c("label",{style:e.fieldLabel,children:[Kt(s.bizType)," (%)"]}),c("input",{type:"number",min:"0",max:"100",step:"0.01",placeholder:"0",value:r[s.bizType]||"",onChange:f=>{i(s.bizType,f.target.value)},style:{...e.input,...o?e.inputError:{}}})]},s.fundBalanceId||s.bizType))}),c("div",{style:e.subBizHint,children:`${n.map(s=>Kt(s.bizType)).join(" + ")} ${_("must total 100%")}`}),o&&c("div",{style:e.error,children:o})]})]})}function Xi({onBack:e,onCancel:t,currency:n="USD",amount:r="",channel:o="",onAmountError:a}){const i=ji(),s=i.container.background==="#181A20",{subBusinesses:f,useFundAllocation:d,subBizPercentages:p,subBizError:u,setUseFundAllocation:x,setSubBizPercentage:b,validateFundAllocation:h,buildAllocationRatios:y}=Gi(),m=new Date,L=`${m.getFullYear()}-${String(m.getMonth()+1).padStart(2,"0")}-${String(m.getDate()).padStart(2,"0")}`,[S,k]=R({urls:[],transferTime:L,transferAmount:r,transactionId:"",payerName:"",filesError:"",timeError:"",amountError:"",transactionIdError:"",payerNameError:""});H(()=>{k(A=>({...A,transferAmount:r}))},[r]);const E=async()=>{let A=!0;if(S.urls.length===0&&(A=!1,k(v=>({...v,filesError:_("请上传银行转账回单")}))),S.transferTime||(A=!1,k(v=>({...v,timeError:_("请选择转账时间")}))),r.trim()||(A=!1,a?.(_("请输入充值金额"))),S.transactionId.trim()||(A=!1,k(v=>({...v,transactionIdError:_("请输入转账交易ID")}))),S.payerName.trim()||(A=!1,k(v=>({...v,payerNameError:_("请输入付款人名称")}))),h()||(A=!1),!!A)try{await Hn({transferDate:S.transferTime,transferNo:S.transactionId,transferChannel:o,voucherUrls:S.urls,payerName:S.payerName,submitAmount:r,submitCurrency:n,useFundAllocation:d,allocationRatios:y()}),ze.success(_("提交成功")),t()}finally{k(v=>({...v,loading:!1}))}};return c("div",{style:i.container,children:[c("div",{style:i.header,children:c("button",{type:"button",onClick:e,style:i.backButton,children:[c("span",{style:i.backIcon,children:"←"}),_("返回账户信息")]})}),c("div",{style:i.uploadSection,children:[c(Gn,{value:S.urls,onChange:A=>{k(v=>({...v,urls:A,filesError:""}))},maxCount:10,accept:"image/*,.pdf",multiple:!0}),S.filesError&&c("div",{style:i.error,children:S.filesError})]}),c("div",{style:i.fieldSection,children:[c("label",{style:i.fieldLabel,children:[c("span",{style:i.required,children:"*"}),_("转账时间")]}),c(Yi,{value:S.transferTime,placeholder:_("请选择转账时间"),onChange:A=>{k(v=>({...v,transferTime:A,timeError:""}))},style:{width:"100%"}}),S.timeError&&c("div",{style:i.error,children:S.timeError})]}),c("div",{style:i.fieldSection,children:[c("label",{style:i.fieldLabel,children:_("转账金额")}),c("div",{style:i.inputWrapper,children:[c("input",{type:"text",placeholder:_("请输入实际转账金额"),value:S.transferAmount,readOnly:!0,disabled:!0,style:{...i.input,...s?i.disabledDark:i.disabled}}),c("span",{style:i.currencySuffix,children:n})]})]}),c("div",{style:i.fieldSection,children:[c("label",{style:i.fieldLabel,children:[c("span",{style:i.required,children:"*"}),_("交易ID")]}),c("input",{type:"text",placeholder:_("请输入转账交易ID"),value:S.transactionId,onChange:A=>{k(v=>({...v,transactionId:A.target.value,transactionIdError:""}))},style:{...i.input,...S.transactionIdError?i.inputError:{}}}),S.transactionIdError&&c("div",{style:i.error,children:S.transactionIdError})]}),c("div",{style:i.fieldSection,children:[c("label",{style:i.fieldLabel,children:[c("span",{style:i.required,children:"*"}),_("付款人名称")]}),c("input",{type:"text",placeholder:_("请输入付款人名称"),value:S.payerName,onChange:A=>{k(v=>({...v,payerName:A.target.value,payerNameError:""}))},style:{...i.input,...S.payerNameError?i.inputError:{}}}),S.payerNameError&&c("div",{style:i.error,children:S.payerNameError})]}),c(Ki,{theme:i,useFundAllocation:d,subBusinesses:f,subBizPercentages:p,subBizError:u,onUseFundAllocationChange:x,onPercentageChange:b}),c("div",{style:i.buttonSection,children:[c("button",{type:"button",onClick:t,style:i.cancelButton,children:_("取消")}),c("button",{type:"button",onClick:E,style:i.submitButton,children:_("提交审核")})]})]})}function Zi(){const e=B("size"),t={container:{background:"#fff",borderRadius:8,padding:e===l.SMALL?16:20,width:"100%",maxWidth:"100%",boxSizing:"border-box","@media (max-width: 1020px)":{maxWidth:"100%",margin:0,padding:e===l.SMALL?12:16},"@media (min-width: 1021px)":{maxWidth:600,margin:"0 auto"}},header:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?16:20,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},bankDetails:{marginBottom:e===l.SMALL?20:24},detailCard:{marginTop:12,marginBottom:12,border:"1px solid #f0f0f0",borderRadius:8,background:"#fafafa",overflow:"hidden"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"8px 0":"10px 0",borderBottom:"1px solid #f0f0f0",width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{flexDirection:"column",alignItems:"flex-start",gap:4}},label:{fontSize:e===l.SMALL?13:14,color:"#666",fontWeight:500,minWidth:120,"@media (max-width: 600px)":{minWidth:"auto",marginBottom:2}},value:{fontSize:e===l.SMALL?13:14,color:"#222",fontWeight:500,textAlign:"right",flex:1,"@media (max-width: 600px)":{textAlign:"left",flex:"none",width:"100%"}},valueWithCopy:{display:"flex",alignItems:"center",gap:8,flex:1,justifyContent:"flex-end",minWidth:0,"@media (max-width: 600px)":{flex:"none",width:"100%",justifyContent:"flex-start"}},row:{display:"flex",alignItems:"center",padding:"10px 12px",borderBottom:"1px solid #ededed"},rowLast:{borderBottom:"none"},rowAlt:{background:"#fafafa"},labelMuted:{fontSize:e===l.SMALL?13:14,color:"#8c8c8c",fontWeight:500,flex:.4},valueStrong:{fontSize:e===l.SMALL?13:14,color:"#111",textAlign:"right",flex:.6,wordBreak:"break-all"},copyButton:{padding:e===l.SMALL?"4px 8px":"6px 12px",fontSize:e===l.SMALL?11:12,background:"#1890ff",color:"#fff",border:"none",borderRadius:4,cursor:"pointer",fontWeight:500,flexShrink:0,whiteSpace:"nowrap"},confirmButton:{width:"100%",marginBottom:e===l.SMALL?16:20,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"10px 12px":"12px 16px",fontWeight:600,cursor:"pointer",fontSize:e===l.SMALL?13:14},noticeBox:{marginBottom:e===l.SMALL?16:20,padding:e===l.SMALL?"10px 12px":"12px 16px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13,lineHeight:1.5},reminderTitle:{fontWeight:600,marginBottom:e===l.SMALL?8:12,textAlign:"left",fontSize:e===l.SMALL?14:16},reminderList:{margin:0,paddingLeft:18,color:"#666",lineHeight:1.6,textAlign:"left",fontSize:e===l.SMALL?12:13,listStyleType:"disc",listStylePosition:"outside"},link:{color:"#1890ff",textDecoration:"none",fontWeight:500}};return{white:{...t},dark:{...t,container:{...t.container,background:"#181A20",border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},detailCard:{...t.detailCard,border:"1px solid #374151",background:"#23262F"},row:{...t.row,borderBottom:"1px solid #374151",background:"#23262F"},rowAlt:{...t.rowAlt,borderBottom:"1px solid #374151",background:"#23262F"},rowLast:{...t.rowLast,background:"#23262F"},labelMuted:{...t.labelMuted,color:"#B5B8BE"},valueStrong:{...t.valueStrong,color:"#fff"},label:{...t.label,color:"#B5B8BE"},value:{...t.value,color:"#fff"},copyButton:{...t.copyButton,background:"#00E8C6",color:"#111"},confirmButton:{...t.confirmButton,background:"#00E8C6",color:"#111"},noticeBox:{...t.noticeBox,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1"},reminderTitle:{...t.reminderTitle,color:"#fff"},reminderList:{...t.reminderList,color:"#B5B8BE"},link:{...t.link,color:"#00E8C6"}}}}function Qi(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=Zi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,titleBar:{...o.titleBar,background:a.color},copyButton:{...o.copyButton,background:a.color},confirmButton:{...o.confirmButton,background:a.color},link:{...o.link,color:a.color}}}return o}function ea({onConfirm:e,channelCode:t}){const n=Qi(),[r,o]=R([]),a=B("merchantId"),i={color:"#ff4d4f",fontWeight:600};return H(()=>{if(!t)return;let s=!0;return Jn({code:t}).then(f=>{if(s){if(Array.isArray(f)){o(f.map(d=>String(d)));return}if(f&&typeof f=="object"){const d=[];Object.keys(f).forEach(p=>{const u=f[p];d.push(`${p}: ${u}`)}),o(d);return}o(f?[String(f)]:[])}}).catch(()=>o([])),()=>{s=!1}},[t]),c("div",{style:n.container,children:[c("div",{style:n.header,children:[c("span",{style:n.titleBar}),_("银行转账")]}),r.length>0&&c("div",{style:n.detailCard,children:r.map((s,f)=>{const d=String(s).split(":"),p=d.shift()?.trim()||"",u=d.join(":").trim();return c("div",{style:{...n.row,...f===r.length-1?n.rowLast:{},...f%2===1?n.rowAlt:{}},children:[c("div",{style:n.labelMuted,children:p}),c("div",{style:n.valueStrong,children:u||"-"})]},f)})}),c("button",{type:"button",onClick:e,style:n.confirmButton,children:_("确认转账详情")}),c("div",{style:n.noticeBox,children:_("转账后提交银行回单提示")}),c("div",{style:n.reminderTitle,children:_("温馨提示")}),c("ul",{style:n.reminderList,children:[c("li",{children:[_("我们强烈建议,转账时在备注中输入您的ID:"),c("span",{style:i,children:a}),_("。这可以"),c("span",{style:i,children:_("加速资金审核")}),Yn()===xe.ZH?"。":"."]}),c("li",{children:_("创建付款时请勿填写敏感备注,例如:topup ads、order等、建议填写数字代码")}),c("li",{children:_("请填写正确的支付金额、币种、支付时间,相同的交易请勿重复提交。")}),c("li",{children:_("请上传交易凭证,否则无法核验并及时添加余额。")}),c("li",{children:_("提交成功后根据实际到账金额添加余额。工作时间提交的转账当日处理,非工作时间提交的转账将在下一个工作日处理。")}),c("li",{children:_("通过平台互转(例如payoneer转payoneer)付款方式可能会有10分钟延迟,请耐心等待。")}),c("li",{children:_("广告款项若入账金额为美金外其他币种额外扣除0.6%手续费,其中PayPal支付方式额外扣除2.5%手续费。")}),c("li",{children:_("如有问题,请联系客服。")})]})]})}function ta({visible:e,onClose:t,onSubmit:n}){const r=Di(),[o,a]=R(!1),[i,s]=R({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1});H(()=>{const y=()=>{a(window.innerWidth<=1020)};return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]),H(()=>{e||s({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1})},[e]);const f=(y,m)=>{s(L=>({...L,channel:y,paymentType:m,channelError:""}))},d=y=>{s(m=>({...m,amount:y,amountError:""}))},p=y=>{s(m=>({...m,amountError:y}))},u=y=>{s(m=>({...m,currency:y}))},x=async y=>{s(m=>({...m,loading:!0,error:""}));try{await n(y),t()}catch{s(m=>({...m,error:_("提交失败,请重试")}))}finally{s(m=>({...m,loading:!1}))}},b=()=>{console.log("用户确认银行转账详情"),s(y=>({...y,showOfflineUpload:!0}))},h=()=>{s(y=>({...y,showOfflineUpload:!1}))};return c(Kn,{visible:e,onClose:t,title:_("充值/转账"),width:o?"95%":960,maxWidth:o?"95%":1e3,children:c("div",{style:{...r.wrapper,...o?{gridTemplateColumns:"1fr",gap:16,minWidth:"auto"}:{}},children:[c(Ni,{onChannelChange:f,onAmountChange:d,onCurrencyChange:u,initialAmount:i.amount,initialCurrency:i.currency,initialPaymentType:i.paymentType,amountError:i.amountError}),i.paymentType==="online"?c($i,{onSubmit:x,amount:i.amount,currency:i.currency,channel:i.channel,loading:i.loading,error:i.error,onAmountError:p}):i.showOfflineUpload?c(Xi,{onBack:h,onCancel:t,currency:i.currency,amount:i.amount,channel:i.channel,onAmountError:p}):c(ea,{onConfirm:b,channelCode:i.channel})]})})}function na(){const[e,t]=R(!1),n=async r=>{const o=await jn({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return c("div",{children:[c(ht,{onClick:()=>t(!0),children:_("充值/转账")}),c(ta,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}qe(na,"best-payment",["theme"],{shadow:!1});const Xt={white:{popover:{background:"#fff",color:"#222",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",border:"none"},arrow:{top:"#fff",bottom:"#fff",left:"#fff",right:"#fff"}},dark:{popover:{background:"#23262F",color:"#fff",boxShadow:"0 4px 16px rgba(0,0,0,0.32)",border:"1px solid #444C5C"},arrow:{top:"#23262F",bottom:"#23262F",left:"#23262F",right:"#23262F"}}};function ra(){return B("theme")===N.WHITE?Xt.white:Xt.dark}const oa=({popover:e,children:t,popoverWidth:n,popoverMinWidth:r,offsetY:o,offsetX:a,popoverPosition:i="top"})=>{const s=B("size"),f=n??(s===l.SMALL?200:300),d=r??(s===l.SMALL?150:200),p=o??(s===l.SMALL?8:16),u=a??(s===l.SMALL?8:16),[x,b]=R(!1),[h,y]=R(i),m=se(null),L=se(null),S=ra(),k=()=>{if(L.current&&(clearTimeout(L.current),L.current=null),i==="top"||i==="bottom")if(m.current){const P=m.current.getBoundingClientRect();i==="top"&&P.top<100?y("bottom"):i==="bottom"&&window.innerHeight-P.bottom<100?y("top"):y(i)}else y(i);else y(i);b(!0)},E=()=>{L.current=window.setTimeout(()=>{b(!1)},120)};let A={position:"absolute",zIndex:999,borderRadius:6,fontSize:s===l.SMALL?12:15,minWidth:d,width:f,padding:s===l.SMALL?"6px 12px":"8px 14px",pointerEvents:"auto",textAlign:"center",animation:"fadeInUp 0.3s",...S.popover},v={position:"absolute",zIndex:11,width:0,height:0};return h==="top"?(A={...A,left:"50%",top:-48,transform:"translateX(-50%)"},v={...v,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:`8px solid ${S.arrow.top}`}):h==="bottom"?(A={...A,left:"50%",top:"100%",marginTop:p,transform:"translateX(-50%)"},v={...v,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${S.arrow.bottom}`}):h==="leftTop"?(A={...A,right:"100%",top:0,marginRight:u,transform:"none"},v={...v,right:-8,top:s===l.SMALL?8:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:`8px solid ${S.arrow.left}`}):h==="rightTop"&&(A={...A,left:"100%",top:0,marginLeft:u,transform:"translateY(0)"},v={...v,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:`8px solid ${S.arrow.right}`}),c("div",{ref:m,style:{position:"relative",display:"inline-block"},onMouseEnter:k,onMouseLeave:E,children:[t,x&&c("div",{style:A,onMouseEnter:k,onMouseLeave:E,children:[e,c("div",{style:v})]})]})};function ia(){const e=B("size");return{white:{popoverTitle:{fontSize:e===l.SMALL?12:16,fontWeight:600,color:"#222",marginBottom:e===l.SMALL?12:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #e5e7eb",fontSize:e===l.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#6b7280",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===l.SMALL?6:8,height:e===l.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===l.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===l.SMALL?12:15}),main:{fontSize:e===l.SMALL?18:24,fontWeight:800,color:"#111827",display:"inline-block"},currency:{fontSize:e===l.SMALL?16:18,color:"#6b7280",marginLeft:e===l.SMALL?6:8,fontWeight:600}},dark:{popoverTitle:{fontSize:e===l.SMALL?14:16,fontWeight:600,color:"#fff",marginBottom:e===l.SMALL?14:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #374151",fontSize:e===l.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#B5B8BE",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===l.SMALL?6:8,height:e===l.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===l.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===l.SMALL?12:15}),main:{fontSize:e===l.SMALL?18:24,fontWeight:800,color:"#fff",display:"inline-block"},currency:{fontSize:e===l.SMALL?16:18,color:"#B5B8BE",marginLeft:e===l.SMALL?6:8,fontWeight:600}}}}function aa(){const t=B("theme")===N.WHITE,n=ia();return t?n.white:n.dark}function Zt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}function sa(e){const[t,n]=R({currBalance:0,currency:"USD",details:[]}),[r,o]=R(!0),a=async()=>{try{const f=await $n(),d=[{label:"",value:f.totalAmount,color:"#15b36b",dot:"#15b36b"},{label:"",value:f.frozenAmount,color:"#f59e0b",dot:"#f59e0b"},...f.isCredit?[{label:"",value:f.creditLimit,color:"#1890ff",dot:"#1890ff"},{label:"",value:f.creditUsed,color:"#ff0000",dot:"#ff0000"}]:[],{label:"",value:f.availableAmount,color:"#1890ff",dot:"#15b36b"}],p={currBalance:f.currBalance,currency:f.currency,details:d};n(p),o(!1)}catch(f){console.error("获取余额失败:",f),o(!1)}};H(()=>{a()},[]),H(()=>{const f=()=>{a()};return window.addEventListener("refresh-balance",f),()=>{window.removeEventListener("refresh-balance",f)}},[]);const i=aa(),s=[{label:_("真实金额"),value:t.details[0]?.value||0,color:"#15b36b",dot:"#15b36b"},{label:_("冻结金额"),value:t.details[1]?.value||0,color:"#f59e0b",dot:"#f59e0b"},...t.details.length>4?[{label:_("信用额度"),value:t.details[2]?.value||0,color:"#1890ff",dot:"#1890ff"},{label:_("已用额度"),value:t.details[3]?.value||0,color:"#ff0000",dot:"#ff0000"}]:[],{label:_("可用余额"),value:t.details[4]?.value||0,color:"#1890ff",dot:"#15b36b"}];return r?null:c(oa,{popover:c(Z,{children:[c("div",{style:i.popoverTitle,children:_("余额详情")}),s.map(f=>c("div",{style:i.detailRow,children:[c("span",{style:i.detailLabel,children:[c("span",{style:i.detailDot(f.dot)}),f.label]}),c("span",{style:i.detailValue(f.color),children:Zt(f.value)})]},f.label))]}),popoverPosition:e.popoverPosition||"bottom",children:c("div",{style:i.main,children:[Zt(t.currBalance),c("span",{style:i.currency,children:t.currency})]})})}qe(sa,"best-statistical-balance");const Ae={white:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontWeight:600,transition:"all 0.2s ease"},dark:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontWeight:600,transition:"all 0.2s ease"}};function la(e){return B("theme")===N.WHITE?{...Ae.white,background:e||Ae.white.background}:{...Ae.dark,background:e||Ae.dark.background}}function ca(e){switch(e){case"small":return{fontSize:"12px",gap:"2px"};case"large":return{fontSize:"18px",gap:"6px"};default:return{fontSize:"14px",gap:"4px"}}}function da({color:e,size:t="medium",children:n}){const[r,o]=R(!1),a=la(e),i=ca(t),s={...a,...i,display:"flex",alignItems:"center"};return c(Z,{children:[c("style",{children:`
|
|
78
|
+
`,document.head.appendChild(n),t}function Kn({visible:e,onClose:t,title:n,children:r,width:o=re===l.SMALL?300:400,maxWidth:a=re===l.SMALL?300:400,showClose:i=!0,maskClosable:s=!0}){const[f,d]=R(!1),p=wi();H(()=>{Ai(p)},[p]);const u=b=>{b.target===b.currentTarget?d(!0):d(!1)},x=b=>{b.target===b.currentTarget&&f&&s&&t(),d(!1)};return e?c("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:p.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onMouseDown:u,onMouseUp:x,children:c("div",{style:{background:p.modalBg,borderRadius:re===l.SMALL?8:12,minWidth:o,maxWidth:a,color:p.modalColor,boxShadow:p.modalBoxShadow,position:"relative",width:typeof o=="string"?o:`${o}px`,maxHeight:"90vh",display:"flex",flexDirection:"column"},onClick:b=>b.stopPropagation(),children:[c("div",{style:{position:"sticky",top:0,background:p.modalBg,borderRadius:re===l.SMALL?"8px 8px 0 0":"12px 12px 0 0",padding:re===l.SMALL?"24px 24px 0 24px":"32px 32px 0 32px",zIndex:1,borderBottom:`1px solid ${p.headerBorder}`},children:[i&&c("button",{type:"button",onClick:t,style:p.closeBtn,"aria-label":"关闭",children:"×"}),n&&c("div",{style:p.title,children:n})]}),c("div",{className:`modal-content ${p.scrollbarClass}`,style:{flex:1,overflowY:"auto",padding:re===l.SMALL?"16px 24px 24px 24px":"20px 32px 32px 32px"},children:r})]})}):null}function ki(){const e=B("size");return{white:{tabBtn:(t,n)=>({flex:1,background:t?"#fff":"#F7F8FA",color:t?"#1890ff":"#222",border:"1px solid #F0F1F3",borderRadius:n?"8px 0 0 8px":"0 8px 8px 0",fontWeight:500,fontSize:e===l.SMALL?12:16,height:e===l.SMALL?32:48,boxShadow:t?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer"})},dark:{tabBtn:(t,n)=>({flex:1,background:t?"#23262F":"#181A20",color:t?"#00E8C6":"#fff",border:"1px solid #444C5C",borderRadius:n?"8px 0 0 8px":"0 8px 8px 0",fontWeight:500,fontSize:e===l.SMALL?12:16,height:e===l.SMALL?32:48,boxShadow:t?"0 2px 8px 0 rgba(20,20,20,0.10)":"none",outline:"none",cursor:"pointer"})}}}function Ei(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=ki(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,tabBtn:(i,s)=>({...o.tabBtn(i,s),color:i?a.color:o.tabBtn(i,s).color})}}return o}const vi=B("size");function Ci({visible:e,onClose:t,onSubmit:n}){const[r,o]=R({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[a,i]=R({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}),[s,f]=R("online"),d=Ei();H(()=>{e||(f("online"),o({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),i({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]);const p=async u=>{u.preventDefault();let x=!0;if(o(b=>({...b,amountError:"",rechargeChannelError:""})),r.amount.trim()||(o(b=>({...b,amountError:_("请输入充值金额")})),x=!1),r.rechargeChannel||(o(b=>({...b,rechargeChannelError:_("请选择支付平台")})),x=!1),!!x){o(b=>({...b,loading:!0,error:""}));try{await n({amount:r.amount,rechargeChannel:r.rechargeChannel,currency:r.currency}),t()}catch{o(b=>({...b,error:_("提交失败,请重试")}))}finally{o(b=>({...b,loading:!1}))}}};return c(Kn,{visible:e,onClose:t,title:_("充值 / 转账"),children:[c("div",{style:{display:"flex",marginBottom:vi===l.SMALL?16:28},children:[c("button",{type:"button",onClick:()=>f("online"),style:d.tabBtn(s==="online",!0),children:_("在线充值")}),c("button",{type:"button",onClick:()=>f("offline"),style:d.tabBtn(s==="offline",!1),children:_("线下转账")})]}),c("div",{style:{display:s==="online"?"block":"none"},children:c("form",{onSubmit:p,children:c(mi,{formState:r,setFormState:o,onClose:t,loading:r.loading})})}),c("div",{style:{display:s==="offline"?"block":"none"},children:c(Si,{formState:a,setFormState:i,onClose:t,loading:a.loading})})]})}function mt(){return(mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Bi=["context","children"];function Ti(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var a,i,s={},f=Object.keys(r);for(i=0;i<f.length;i++)o.indexOf(a=f[i])>=0||(s[a]=r[a]);return s}(e,Bi);return fn(t,n)}function Mi(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=ie(Ti,mt({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],a={},i=0,s=n.attributes,f=n.childNodes;for(i=s.length;i--;)s[i].name!=="slot"&&(a[s[i].name]=s[i].value,a[Xn(s[i].name)]=s[i].value);for(i=f.length;i--;){var d=t(f[i],null),p=f[i].slot;p?a[p]=ie(Gt,{name:p},d):o[i]=d}var u=r?ie(Gt,null,o):o;return ie(r||n.nodeName.toLowerCase(),a,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?un:Oe)(this._vdom,this._root)}function Xn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function Ri(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[Xn(e)]=n,this._vdom=fn(this._vdom,r),Oe(this._vdom,this._root)}}function Fi(){Oe(this._vdom=null,this._root)}function Gt(e,t){var n=this;return ie("slot",mt({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function qe(e,t,n,r){function o(){var a=Reflect.construct(HTMLElement,[],o);return a._vdomComponent=e,a._root=r&&r.shadow?a.attachShadow({mode:r.mode||"open"}):a,a}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=Mi,o.prototype.attributeChangedCallback=Ri,o.prototype.disconnectedCallback=Fi,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(a){Object.defineProperty(o.prototype,a,{get:function(){return this._vdom.props[a]},set:function(i){this._vdom?this.attributeChangedCallback(a,null,i):(this._props||(this._props={}),this._props[a]=i,this.connectedCallback());var s=typeof i;i!=null&&s!=="string"&&s!=="boolean"&&s!=="number"||this.setAttribute(a,i)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}function Ii(){const[e,t]=R(!1),n=async r=>{const o=await jn({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return c("div",{children:[c(ht,{onClick:()=>t(!0),children:_("充值/转账")}),c(Ci,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}qe(Ii,"best-recharge",["theme"],{shadow:!1});function zi(){const e=B("size"),t={wrapper:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:e===l.SMALL?12:20,alignItems:"start",minWidth:880,"@media (max-width: 1020px)":{gridTemplateColumns:"1fr",gap:16,minWidth:"auto",width:"100%"}},fieldLabel:{fontSize:e===l.SMALL?12:13,marginBottom:6,fontWeight:500,textAlign:"left"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13},inputWrapper:{position:"relative"},inputSuffix:{padding:"0 8px",fontSize:e===l.SMALL?12:13,opacity:.8},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},subTitle:{marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?8:10,fontWeight:600,textAlign:"left"},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},methodList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},bankList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}}};return{white:{...t,left:{background:"#fff",borderRadius:8,padding:16,border:"1px solid #E5E6EB"},right:{background:"#fff",borderRadius:8,padding:16},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 480px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#1890ff":"#E5E6EB"}`,color:n?"#1890ff":"#222",background:n?"#EEF7FF":"#fff",cursor:"pointer"}),input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:600,cursor:"pointer"},methodItem:n=>({padding:"10px 12px",textAlign:"left",borderRadius:8,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",cursor:"pointer"}),bankItem:{padding:"10px 12px",borderRadius:8,border:"1px solid #F0F1F3",background:"#F7F8FA",textAlign:"left"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left"},reminderList:{margin:0,paddingLeft:18,color:"#6b7280",lineHeight:1.6,textAlign:"left"}},dark:{...t,left:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},right:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 480px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#00E8C6":"#374151"}`,color:n?"#00E8C6":"#fff",background:n?"#0F2824":"#23262F",cursor:"pointer"}),input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#00E8C6",color:"#111",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:700,cursor:"pointer"},methodItem:n=>({padding:"10px 12px",textAlign:"left",borderRadius:8,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",color:"#fff",cursor:"pointer"}),bankItem:{padding:"10px 12px",borderRadius:8,border:"1px solid #374151",background:"#23262F",textAlign:"left",color:"#fff"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1",fontSize:e===l.SMALL?12:13},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left",color:"#fff"},reminderList:{margin:0,paddingLeft:18,color:"#B5B8BE",lineHeight:1.6,textAlign:"left"}}}}function Di(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=zi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,payButton:{...o.payButton,background:a.color},currencyItem:i=>({...o.currencyItem(i),border:`1px solid ${i?a.color:n?"#E5E6EB":"#374151"}`,color:i?a.color:n?"#222":"#fff"}),methodItem:i=>({...o.methodItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`})}}return o}function Oi(){const e=B("size"),t={left:{background:"#fff",borderRadius:8,padding:16,border:"1px solid #E5E6EB"},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},fieldLabel:{fontSize:e===l.SMALL?14:16,marginBottom:6,fontWeight:500,textAlign:"left"},required:{color:"#ff4d4f",marginRight:4},currencyRow:{display:"flex",gap:10,flexWrap:"wrap","@media (max-width: 600px)":{gap:8}},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#1890ff":"#E5E6EB"}`,color:n?"#1890ff":"#222",background:n?"#EEF7FF":"#fff",cursor:"pointer"}),inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},bizRateBox:{marginTop:6,color:"#666",fontSize:e===l.SMALL?12:13,textAlign:"left",lineHeight:1.6},bizRateStrong:{color:"#111",fontWeight:600},subTitle:{fontSize:e===l.SMALL?12:14,marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?8:10,textAlign:"left"},methodList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},methodItem:n=>({padding:"12px 16px",textAlign:"left",borderRadius:10,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),channelIcon:{width:22,height:22,objectFit:"contain",marginRight:8,display:"inline-block"},bankList:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,"@media (max-width: 600px)":{gridTemplateColumns:"1fr",gap:8}},bankItem:n=>({padding:"12px 16px",borderRadius:10,border:`1px solid ${n?"#1890ff":"#F0F1F3"}`,background:n?"#EEF7FF":"#F7F8FA",textAlign:"left",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13}};return{white:{...t,input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"}},dark:{...t,left:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},currencyItem:n=>({padding:"6px 12px",borderRadius:6,border:`1px solid ${n?"#00E8C6":"#374151"}`,color:n?"#00E8C6":"#fff",background:n?"#0F2824":"#23262F",cursor:"pointer"}),input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},bizRateBox:{...t.bizRateBox,color:"#B5B8BE"},bizRateStrong:{color:"#ff4d4f",fontWeight:600},methodItem:n=>({padding:"12px 16px",textAlign:"left",borderRadius:10,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44}),bankItem:n=>({padding:"12px 16px",borderRadius:10,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",textAlign:"left",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",gap:8,minHeight:44})}}}function Pi(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=Oi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,titleBar:{...o.titleBar,background:a.color},currencyItem:i=>({...o.currencyItem(i),border:`1px solid ${i?a.color:n?"#E5E6EB":"#374151"}`,color:i?a.color:n?"#222":"#fff"}),methodItem:i=>({...o.methodItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`}),bankItem:i=>({...o.bankItem(i),border:`1px solid ${i?a.color:n?"#F0F1F3":"#374151"}`})}}return o}function Ni({onChannelChange:e,onAmountChange:t,onCurrencyChange:n,initialAmount:r="",initialCurrency:o="USD",initialPaymentType:a="online",amountError:i=""}){const s=Pi(),[f,d]=R([]),[p,u]=R([]),[x,b]=R([]),[h,y]=R({currency:o,amount:r,onlineChannel:"",bankChannel:"",paymentType:a,amountError:""}),[m,L]=R(null),S=se(null),k=(w,F)=>{const U=w!==void 0?w:h.amount,W=F!==void 0?F:h.currency;if(!U||Number(U)<=0){L(null);return}S.current&&clearTimeout(S.current),S.current=window.setTimeout(()=>{Ko({currency:W,amount:U}).then(V=>L(V)).catch(()=>L(null))},300)};H(()=>{Vo().then(w=>{d(w||[])})},[]),H(()=>{Go({currency:h.currency}).then(w=>{const F=w.onlineChannel||[],U=w.offlineChannel||[];u(F),b(U);const W=F.length>0,V=U?.[0]?.value||"",Le=F?.[0]?.value||"",de=W?a:"bank",C=de==="online"?Le:V;y(M=>({...M,onlineChannel:Le,bankChannel:V,paymentType:de})),C&&e(C,de)})},[h.currency]);function E(w){return w=w.replace(/[^\d.]/g,""),w=w.replace(/\.(?=.*\.)/g,""),w=w.replace(/^(\d+)(\.\d{0,2})?.*$/,"$1$2"),w=w.replace(/^0+(\d)/,"$1"),w.startsWith(".")&&(w="0"+w),w}const A=w=>{y(F=>({...F,currency:w})),n(w),k(void 0,w)},v=w=>{const F=E(w);y(U=>({...U,amount:F,amountError:""})),t(F),k(F)},P=(w,F)=>{y(U=>({...U,[F==="online"?"onlineChannel":"bankChannel"]:w,paymentType:F})),e(w,F),k()};return c("div",{style:s.left,children:[c("div",{style:s.blockTitle,children:[c("span",{style:s.titleBar}),_("选择支付方式")]}),c("div",{style:s.fieldLabel,children:_("支付币种")}),c("div",{style:s.currencyRow,children:(f||[]).slice(0,4).map(w=>c("button",{type:"button",onClick:()=>A(w.value),style:s.currencyItem(h.currency===w.value),children:w.label}))}),c("div",{style:{height:12}}),c("div",{style:s.fieldLabel,children:[c("span",{style:s.required,children:"*"}),_("支付金额")]}),c("div",{style:s.inputWrapper,children:[c("input",{type:"text",placeholder:_("请输入充值金额"),value:h.amount,onInput:w=>{v(w.target.value)},style:{...s.input,...i?s.inputError:{}}}),c("div",{style:s.inputSuffixAbs,children:h.currency})]}),i&&c("div",{style:s.error,children:i}),m&&m.consistent===!1&&c("div",{style:s.bizRateBox,children:[c("div",{children:_("您的支付币种与默认币种不一致,将转换为默认币种入账")}),c("div",{children:[_("目前汇率为:")," ",h.currency,_(`→${m.currency} = `),c("span",{style:s.bizRateStrong,children:m.exchangeRate})]}),c("div",{children:[_("钱包预计增加"),c("span",{style:s.bizRateStrong,children:[m.currency," ",m.amount]})]})]}),c("div",{style:{height:20}}),c("div",{style:s.fieldLabel,children:_("支付方式")}),p.length>0&&c("div",{children:[c("div",{style:s.subTitle,children:_("线上支付")}),c("div",{style:s.methodList,children:p.map(w=>c("button",{type:"button",onClick:()=>P(w.value,"online"),style:s.methodItem(h.onlineChannel===w.value&&h.paymentType==="online"),children:[w.icon&&c("img",{src:w.icon,alt:w.label,style:s.channelIcon}),w.label]}))})]}),c("div",{style:s.subTitle,children:_("银行转账")}),c("div",{style:s.bankList,children:x.map(w=>c("button",{type:"button",onClick:()=>P(w.value,"bank"),style:s.bankItem(h.bankChannel===w.value&&h.paymentType==="bank"),children:[w.icon&&c("img",{src:w.icon,alt:w.label,style:s.channelIcon}),w.label]}))})]})}function Ui(){const e=B("size"),t={right:{background:"#fff",borderRadius:8,padding:16},blockTitle:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?12:16,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,outline:"none",border:"1px solid",boxSizing:"border-box",paddingRight:e===l.SMALL?48:64},inputError:{border:"1px solid #ff4d4f"},disabled:{backgroundColor:"#f5f5f5",color:"#999",cursor:"not-allowed"},disabledDark:{backgroundColor:"#1A1D23",color:"#6B7280",cursor:"not-allowed",border:"1px solid #374151"},inputSuffixAbs:{position:"absolute",top:0,right:e===l.SMALL?10:12,height:"100%",display:"flex",alignItems:"center",color:"#999",pointerEvents:"none",fontSize:e===l.SMALL?12:13},payButton:{width:"100%",marginTop:e===l.SMALL?10:14,marginBottom:e===l.SMALL?12:16,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"8px 12px":"12px 16px",fontWeight:600,cursor:"pointer"},noticeBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?12:16,padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13},calcBox:{marginTop:e===l.SMALL?8:12,marginBottom:e===l.SMALL?8:12,color:"#666",textAlign:"left",lineHeight:1.6,fontSize:e===l.SMALL?12:13},calcLine:{marginBottom:4},calcAmount:{color:"#ff4d4f",fontWeight:700,margin:"0 4px"},reminderTitle:{fontWeight:600,margin:"6px 0",textAlign:"left"},reminderList:{margin:0,paddingLeft:18,color:"#6b7280",lineHeight:1.6,textAlign:"left",listStyleType:"disc",listStylePosition:"outside"},listItem:{listStyleType:"disc",listStylePosition:"outside"},error:{color:"#ff4d4f",marginTop:6,fontSize:e===l.SMALL?12:13}};return{white:{...t,input:{...t.input,border:"1px solid #E5E6EB",background:"#fff",color:"#222"}},dark:{...t,right:{background:"#181A20",borderRadius:8,padding:16,border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},payButton:{...t.payButton,background:"#00E8C6",color:"#111",fontWeight:700},noticeBox:{...t.noticeBox,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1"},calcBox:{...t.calcBox,color:"#B5B8BE"},reminderTitle:{...t.reminderTitle,color:"#fff"},reminderList:{...t.reminderList,color:"#B5B8BE"}}}}function Wi(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=Ui(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,payButton:{...o.payButton,background:a.color},titleBar:{...o.titleBar,background:a.color}}}return o}function $i({onSubmit:e,amount:t,currency:n,channel:r,loading:o=!1,error:a="",onAmountError:i}){const s=Wi(),f=s.right.background==="#181A20",[d,p]=R({amount:t,currency:n,channel:r,loading:o,error:a,amountError:""}),[u,x]=R(null);H(()=>{p(y=>({...y,amount:t,currency:n,channel:r,loading:o,error:a}));const h=setTimeout(()=>{t&&r&&n?qn({channel:r,amount:t,currency:n}).then(y=>x(y)).catch(()=>x(null)):x(null)},300);return()=>clearTimeout(h)},[t,n,r,o,a]);const b=async h=>{h&&h.preventDefault();let y=!0;if(t.trim()||(y=!1,i?.(_("请输入充值金额"))),r||(y=!1,p(m=>({...m,error:_("请选择支付平台")}))),!!y){p(m=>({...m,loading:!0,error:""}));try{await e({amount:t,currency:n,rechargeChannel:r})}finally{p(m=>({...m,loading:!1}))}}};return c("div",{style:s.right,children:[c("div",{style:s.blockTitle,children:[c("span",{style:s.titleBar}),_("在线支付")]}),c("form",{onSubmit:b,children:[c("div",{style:s.inputWrapper,children:[c("input",{type:"text",placeholder:_("支付金额"),value:d.amount,readOnly:!0,disabled:!0,style:{...s.input,...f?s.disabledDark:s.disabled,width:"100%"}}),c("div",{style:s.inputSuffixAbs,children:d.currency})]}),c("button",{type:"submit",disabled:d.loading,style:s.payButton,children:d.loading?_("提交中..."):_("立即支付")})]}),u&&c("div",{style:s.calcBox,children:[c("div",{style:s.calcLine,children:[_("预计支付金额约为:"),c("span",{style:s.calcAmount,children:`$${u.paymentAmount}`}),u.currency]}),c("div",{style:s.calcLine,children:[_("手续费约为:"),c("span",{style:s.calcAmount,children:`$${u.fee}`}),u.currency]}),c("div",{children:_("注:地区/币种/卡类型可能影响手续费,最终以平台为准。")})]}),c("div",{style:s.noticeBox,children:_("请在转账后提交银行回单,否则可能无法及时核验")}),c("div",{style:s.reminderTitle,children:_("温馨提示")}),c("ul",{style:s.reminderList,children:[c("li",{children:_("创建付款时请勿填写敏感备注,例如:topup ads、order等、建议填写数字代码")}),c("li",{children:_("请填写正确的支付金额、币种、支付时间,相同的交易请勿重复提交。")}),c("li",{children:_("请上传交易凭证,否则无法核验并及时添加余额。")}),c("li",{children:_("提交成功后根据实际到账金额添加余额。工作时间提交的转账当日处理,非工作时间提交的转账将在下一个工作日处理。")}),c("li",{children:_("通过平台互转(例如payoneer转payoneer)付款方式可能会有10分钟延迟,请耐心等待。")}),c("li",{children:_("广告款项若入账金额为美金外其他币种额外扣除0.6%手续费,其中PayPal支付方式额外扣除2.5%手续费。")}),c("li",{children:_("如有问题,请联系客服。")})]}),d.error&&c("div",{style:s.error,children:d.error})]})}function Hi(){const e=B("size"),t={container:{background:"#fff",borderRadius:8,padding:e===l.SMALL?14:16,width:"100%",maxWidth:"100%",boxSizing:"border-box","@media (max-width: 1020px)":{padding:e===l.SMALL?12:16}},header:{marginBottom:e===l.SMALL?16:20},backButton:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",color:"#1890ff",cursor:"pointer",fontSize:e===l.SMALL?13:14,fontWeight:500},backIcon:{fontSize:e===l.SMALL?16:18},uploadSection:{marginBottom:e===l.SMALL?18:24},uploadArea:{border:"2px dashed #D9D9D9",borderRadius:8,padding:e===l.SMALL?"30px 16px":"40px 20px",textAlign:"center",cursor:"pointer",background:"#FAFAFA",transition:"all 0.3s ease",width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{padding:e===l.SMALL?"30px 15px":"40px 20px"}},uploadIcon:{fontSize:e===l.SMALL?40:52,marginBottom:e===l.SMALL?10:12},uploadTitle:{fontSize:e===l.SMALL?14:16,fontWeight:600,color:"#222",marginBottom:e===l.SMALL?6:10},uploadHint:{fontSize:e===l.SMALL?12:13,color:"#999"},hiddenInput:{display:"none"},fileList:{marginTop:e===l.SMALL?10:12},fileItem:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:e===l.SMALL?"6px 10px":"8px 12px",background:"#F5F5F5",borderRadius:6,marginBottom:6},fileName:{fontSize:e===l.SMALL?12:13,color:"#222"},removeButton:{background:"#ff4d4f",color:"#fff",border:"none",borderRadius:"50%",width:20,height:20,cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",justifyContent:"center"},fieldSection:{marginBottom:e===l.SMALL?12:16},radioGroup:{display:"flex",alignItems:"center",gap:e===l.SMALL?16:20,flexWrap:"wrap"},radioOption:{display:"inline-flex",alignItems:"center",gap:6,color:"#222",fontSize:e===l.SMALL?13:14,cursor:"pointer"},subBizGrid:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:e===l.SMALL?10:12,width:"100%","@media (max-width: 600px)":{gridTemplateColumns:"1fr"}},subBizField:{minWidth:0},subBizHint:{marginTop:8,color:"#666",fontSize:e===l.SMALL?12:13},fieldLabel:{display:"block",fontSize:e===l.SMALL?13:14,fontWeight:500,color:"#222",marginBottom:e===l.SMALL?6:10},required:{color:"#ff4d4f",marginRight:4},inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"8px 10px":"10px 12px",borderRadius:6,border:"1px solid #D9D9D9",outline:"none",fontSize:14,boxSizing:"border-box"},inputError:{border:"1px solid #ff4d4f"},disabled:{backgroundColor:"#f5f5f5",color:"#999",cursor:"not-allowed"},disabledDark:{backgroundColor:"#1A1D23",color:"#6B7280",cursor:"not-allowed",border:"1px solid #374151"},calendarIcon:{position:"absolute",right:e===l.SMALL?8:10,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?12:14,pointerEvents:"none"},currencySuffix:{position:"absolute",right:e===l.SMALL?10:12,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?12:14,color:"#999",pointerEvents:"none"},buttonSection:{display:"flex",gap:e===l.SMALL?10:12,marginTop:e===l.SMALL?24:32,width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{flexDirection:"column",gap:e===l.SMALL?8:12}},cancelButton:{flex:1,padding:e===l.SMALL?"8px 12px":"10px 16px",borderRadius:6,border:"1px solid #D9D9D9",background:"#fff",color:"#222",fontSize:e===l.SMALL?12:14,fontWeight:500,cursor:"pointer",minWidth:0,boxSizing:"border-box"},submitButton:{flex:1,padding:e===l.SMALL?"8px 12px":"10px 16px",borderRadius:6,border:"none",background:"#1890ff",color:"#fff",fontSize:e===l.SMALL?12:14,fontWeight:600,cursor:"pointer",minWidth:0,boxSizing:"border-box"},error:{color:"#ff4d4f",fontSize:e===l.SMALL?12:13,marginTop:6}};return{white:{...t},dark:{...t,container:{...t.container,background:"#181A20",border:"1px solid #2B2E38"},backButton:{...t.backButton,color:"#00E8C6"},uploadArea:{...t.uploadArea,border:"2px dashed #374151",background:"#23262F"},uploadTitle:{...t.uploadTitle,color:"#fff"},uploadHint:{...t.uploadHint,color:"#B5B8BE"},fileItem:{...t.fileItem,background:"#2B2E38"},fileName:{...t.fileName,color:"#fff"},fieldLabel:{...t.fieldLabel,color:"#fff"},radioOption:{...t.radioOption,color:"#fff"},subBizHint:{...t.subBizHint,color:"#B5B8BE"},input:{...t.input,border:"1px solid #374151",background:"#23262F",color:"#fff"},calendarIcon:{...t.calendarIcon,color:"#B5B8BE"},currencySuffix:{...t.currencySuffix,color:"#B5B8BE"},cancelButton:{...t.cancelButton,border:"1px solid #374151",background:"#23262F",color:"#fff"},submitButton:{...t.submitButton,background:"#00E8C6",color:"#111"}}}}function ji(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=Hi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,backButton:{...o.backButton,color:a.color},submitButton:{...o.submitButton,background:a.color}}}return o}const qi="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1760084950168'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6759'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M932.579556%20137.272889h-192V64.142222a9.159111%209.159111%200%200%200-9.130667-9.159111h-64a9.159111%209.159111%200%200%200-9.159111%209.159111v73.130667H365.738667V64.142222a9.159111%209.159111%200%200%200-9.159111-9.159111h-64a9.159111%209.159111%200%200%200-9.130667%209.159111v73.130667h-192c-20.224%200-36.579556%2016.355556-36.579556%2036.579555v758.869334c0%2020.195556%2016.355556%2036.551111%2036.579556%2036.551111h841.130667c20.252444%200%2036.579556-16.327111%2036.579555-36.551111V173.852444c0-20.224-16.355556-36.579556-36.579555-36.579555zM886.897778%20887.011556H137.159111V452.693333H886.897778v434.261334z%20m-749.710222-512V219.534222h146.289777v54.869334c0%205.034667%204.124444%209.130667%209.130667%209.130666h64a9.159111%209.159111%200%200%200%209.159111-9.130666V219.562667h292.551111v54.869333c0%205.034667%204.124444%209.130667%209.159111%209.130667h64a9.159111%209.159111%200%200%200%209.130667-9.130667V219.562667h146.289778v155.448889H137.159111z'%20p-id='6760'%3e%3c/path%3e%3c/svg%3e";function Ji(){const e=B("theme"),t=B("themeConfig"),n={container:{position:"relative",display:"inline-block"},input:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",backgroundColor:"#fff",cursor:"pointer",transition:"all 0.3s",outline:"none",fontSize:"14px",lineHeight:"1.5715",color:"rgba(0, 0, 0, 0.85)"},inputText:{flex:1,textAlign:"left",color:"rgba(0, 0, 0, 0.85)"},calendarIcon:{fontSize:"16px",color:"rgba(0, 0, 0, 0.45)",marginLeft:"8px",width:16,height:16,objectFit:"contain",display:"inline-block"},disabled:{backgroundColor:"#f5f5f5",color:"rgba(0, 0, 0, 0.25)",cursor:"not-allowed"},panel:{position:"absolute",top:"100%",left:0,zIndex:1050,backgroundColor:"#fff",border:"1px solid #d9d9d9",borderRadius:"6px",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",padding:"8px",minWidth:"280px",marginTop:"4px"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 0",marginBottom:"8px"},navButton:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"16px",color:"rgba(0, 0, 0, 0.45)",transition:"all 0.3s"},monthYear:{fontSize:"16px",fontWeight:500,color:"rgba(0, 0, 0, 0.85)"},weekHeader:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"4px",marginBottom:"8px"},weekDay:{display:"flex",alignItems:"center",justifyContent:"center",height:"32px",fontSize:"14px",fontWeight:500,color:"rgba(0, 0, 0, 0.85)"},calendarGrid:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"4px"},dayButton:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"14px",transition:"all 0.3s",color:"rgba(0, 0, 0, 0.85)"},dayCurrentMonth:{color:"rgba(0, 0, 0, 0.85)"},dayOtherMonth:{color:"rgba(0, 0, 0, 0.25)"},dayToday:{fontWeight:600,color:"#1890ff"},daySelected:{backgroundColor:"#1890ff",color:"#fff"},yearPicker:{maxHeight:"200px",overflowY:"auto",marginBottom:"8px",border:"1px solid #f0f0f0",borderRadius:"4px",padding:"8px"},yearGrid:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"4px"},yearButton:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",border:"none",backgroundColor:"transparent",cursor:"pointer",borderRadius:"4px",fontSize:"14px",transition:"all 0.3s",color:"rgba(0, 0, 0, 0.85)"},yearSelected:{backgroundColor:"#1890ff",color:"#fff"},small:{padding:"4px 8px",fontSize:"12px"},middle:{padding:"8px 12px",fontSize:"14px"},large:{padding:"12px 16px",fontSize:"16px"}},r={white:{...n,input:{...n.input,border:"1px solid #d9d9d9",backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.85)"},inputText:{...n.inputText,color:"rgba(0, 0, 0, 0.85)"},calendarIcon:{...n.calendarIcon,color:"rgba(0, 0, 0, 0.45)"},disabled:{...n.disabled,backgroundColor:"#f5f5f5",color:"rgba(0, 0, 0, 0.25)"},panel:{...n.panel,backgroundColor:"#fff",border:"1px solid #d9d9d9"},navButton:{...n.navButton,color:"rgba(0, 0, 0, 0.45)"},monthYear:{...n.monthYear,color:"rgba(0, 0, 0, 0.85)"},weekDay:{...n.weekDay,color:"rgba(0, 0, 0, 0.85)"},dayButton:{...n.dayButton,color:"rgba(0, 0, 0, 0.85)"},dayCurrentMonth:{...n.dayCurrentMonth,color:"rgba(0, 0, 0, 0.85)"},dayOtherMonth:{...n.dayOtherMonth,color:"rgba(0, 0, 0, 0.25)"},dayToday:{...n.dayToday,color:"#1890ff"},daySelected:{...n.daySelected,backgroundColor:"#1890ff",color:"#fff"},yearPicker:{...n.yearPicker,border:"1px solid #f0f0f0"},yearButton:{...n.yearButton,color:"rgba(0, 0, 0, 0.85)"},yearSelected:{...n.yearSelected,backgroundColor:"#1890ff",color:"#fff"}},dark:{...n,input:{...n.input,border:"1px solid #434343",backgroundColor:"#141414",color:"rgba(255, 255, 255, 0.85)"},inputText:{...n.inputText,color:"rgba(255, 255, 255, 0.85)"},calendarIcon:{...n.calendarIcon,color:"rgba(255, 255, 255, 0.45)"},disabled:{...n.disabled,backgroundColor:"#262626",color:"rgba(255, 255, 255, 0.25)"},panel:{...n.panel,backgroundColor:"#141414",border:"1px solid #434343"},navButton:{...n.navButton,color:"rgba(255, 255, 255, 0.45)"},monthYear:{...n.monthYear,color:"rgba(255, 255, 255, 0.85)"},weekDay:{...n.weekDay,color:"rgba(255, 255, 255, 0.85)"},dayButton:{...n.dayButton,color:"rgba(255, 255, 255, 0.85)"},dayCurrentMonth:{...n.dayCurrentMonth,color:"rgba(255, 255, 255, 0.85)"},dayOtherMonth:{...n.dayOtherMonth,color:"rgba(255, 255, 255, 0.25)"},dayToday:{...n.dayToday,color:"#00E8C6"},daySelected:{...n.daySelected,backgroundColor:"#00E8C6",color:"#111"},yearPicker:{...n.yearPicker,border:"1px solid #434343"},yearButton:{...n.yearButton,color:"rgba(255, 255, 255, 0.85)"},yearSelected:{...n.yearSelected,backgroundColor:"#00E8C6",color:"#111"}}},o=r[e]||r.white,a=t?.[e]?.color;return a&&(o.dayToday.color=a,o.daySelected.backgroundColor=a,o.yearSelected.backgroundColor=a,e==="dark"&&(o.daySelected.color="#111",o.yearSelected.color="#111")),o}function Vi(){return Ji()}function Yi({value:e="",placeholder:t=_("请选择日期"),disabled:n=!1,size:r="middle",onChange:o,onFocus:a,onBlur:i,className:s="",style:f={}}){const d=Vi(),[p,u]=R(!1),[x,b]=R(e),[h,y]=R(new Date),[m,L]=R(!1),S=se(null),k=C=>{if(!C)return"";const M=new Date(C);return`${M.getFullYear()}-${String(M.getMonth()+1).padStart(2,"0")}-${String(M.getDate()).padStart(2,"0")}`},E=(C,M)=>new Date(C,M+1,0).getDate(),A=(C,M)=>new Date(C,M,1).getDay(),v=()=>{const C=h.getFullYear(),M=h.getMonth(),ue=E(C,M),Zn=A(C,M),fe=[],gt=M===0?11:M-1,bt=M===0?C-1:C,yt=E(bt,gt);for(let j=Zn-1;j>=0;j--)fe.push({date:yt-j,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${bt}-${String(gt+1).padStart(2,"0")}-${String(yt-j).padStart(2,"0")}`});const Qn=new Date,xt=x?new Date(x):null;for(let j=1;j<=ue;j++){const _t=`${C}-${String(M+1).padStart(2,"0")}-${String(j).padStart(2,"0")}`,St=new Date(_t);fe.push({date:j,isCurrentMonth:!0,isToday:St.toDateString()===Qn.toDateString(),isSelected:xt&&St.toDateString()===xt.toDateString(),fullDate:_t})}const er=M===11?0:M+1,tr=M===11?C+1:C,nr=42-fe.length;for(let j=1;j<=nr;j++)fe.push({date:j,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${tr}-${String(er+1).padStart(2,"0")}-${String(j).padStart(2,"0")}`});return fe},P=C=>{b(C),u(!1),o?.(C)},w=C=>{const M=new Date(h);C==="prev"?M.setMonth(M.getMonth()-1):M.setMonth(M.getMonth()+1),y(M)},F=C=>{const M=new Date(h);C==="prev"?M.setFullYear(M.getFullYear()-1):M.setFullYear(M.getFullYear()+1),y(M)},U=C=>{const M=new Date(h);M.setFullYear(C),y(M),L(!1)},W=()=>{const C=new Date().getFullYear(),M=[];for(let ue=C-50;ue<=C+50;ue++)M.push(ue);return M};H(()=>{const C=M=>{S.current&&!S.current.contains(M.target)&&u(!1)};if(p)return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[p]);const V=v(),Le=[_("一月"),_("二月"),_("三月"),_("四月"),_("五月"),_("六月"),_("七月"),_("八月"),_("九月"),_("十月"),_("十一月"),_("十二月")],de=[_("日"),_("一"),_("二"),_("三"),_("四"),_("五"),_("六")];return c("div",{ref:S,className:`date-picker-container ${s}`,style:{...d.container,...f},children:[c("div",{style:{...d.input,...d[r],...n?d.disabled:{}},onClick:()=>!n&&u(!p),onFocus:a,onBlur:i,children:[c("span",{style:d.inputText,children:x?k(x):t}),c("img",{src:qi,alt:"calendar",style:d.calendarIcon})]}),p&&c("div",{style:d.panel,children:[c("div",{style:d.header,children:[c("button",{type:"button",style:d.navButton,onClick:()=>F("prev"),children:"‹‹"}),c("button",{type:"button",style:d.navButton,onClick:()=>w("prev"),children:"‹"}),c("span",{style:d.monthYear,onClick:()=>L(!m),children:[h.getFullYear()," ",_("年")," ",Le[h.getMonth()]]}),c("button",{type:"button",style:d.navButton,onClick:()=>w("next"),children:"›"}),c("button",{type:"button",style:d.navButton,onClick:()=>F("next"),children:"››"})]}),m&&c("div",{style:d.yearPicker,children:c("div",{style:d.yearGrid,children:W().map(C=>c("button",{type:"button",style:{...d.yearButton,...C===h.getFullYear()?d.yearSelected:{}},onClick:()=>U(C),children:C},C))})}),c("div",{style:d.weekHeader,children:de.map(C=>c("div",{style:d.weekDay,children:C},C))}),c("div",{style:d.calendarGrid,children:V.map((C,M)=>c("button",{type:"button",style:{...d.dayButton,...C.isCurrentMonth?d.dayCurrentMonth:d.dayOtherMonth,...C.isToday?d.dayToday:{},...C.isSelected?d.daySelected:{}},onClick:()=>P(C.fullDate),disabled:n,children:C.date},M))})]})]})}function Kt(e){return e==="ad"?"Advertising":e==="fulfill"?"Fulfillment":e==="chargewipe"?"ChargeWipe":e}function Gi(){const[e,t]=R([]),[n,r]=R(!1),[o,a]=R({}),[i,s]=R("");return H(()=>{let x=!0;const b=y=>{x&&(t(y),a(m=>y.reduce((L,S)=>({...L,[S.bizType]:m[S.bizType]||""}),{})))},h=JSON.parse(sessionStorage.getItem("allBalances")||"[]");return Array.isArray(h)&&h.length>0&&b(h),Wn().then(y=>{b(y)}).catch(()=>{Array.isArray(h)||b([])}),()=>{x=!1}},[]),H(()=>{e.length<=1&&(r(!1),s(""))},[e.length]),{subBusinesses:e,useFundAllocation:n,subBizPercentages:o,subBizError:i,setUseFundAllocation:x=>{r(x),s("")},setSubBizPercentage:(x,b)=>{a(h=>({...h,[x]:b})),s("")},validateFundAllocation:()=>{if(!n||e.length<=1)return!0;const x=e.some(y=>!o[y.bizType]?.trim()),b=e.some(y=>{const m=Number(o[y.bizType]);return Number.isNaN(m)||m<0||m>100}),h=e.reduce((y,m)=>y+Number(o[m.bizType]||0),0);return x?(s(_("请输入子业务占比")),!1):b||Math.abs(h-100)>1e-4?(s(_("子业务占比总和必须为100%")),!1):(s(""),!0)},buildAllocationRatios:()=>!n||e.length<=1?[]:e.map(x=>({fundBalanceId:x.fundBalanceId,ratio:String(o[x.bizType]||"")}))}}function Ki({theme:e,useFundAllocation:t,subBusinesses:n,subBizPercentages:r,subBizError:o,onUseFundAllocationChange:a,onPercentageChange:i}){return n.length<=1?null:c(Z,{children:[c("div",{style:e.fieldSection,children:[c("label",{style:e.fieldLabel,children:_("是否使用资金分配")}),c("div",{style:e.radioGroup,children:[c("label",{style:e.radioOption,children:[c("input",{type:"radio",name:"useFundAllocation",checked:t,onChange:()=>a(!0)}),c("span",{children:_("是")})]}),c("label",{style:e.radioOption,children:[c("input",{type:"radio",name:"useFundAllocation",checked:!t,onChange:()=>a(!1)}),c("span",{children:_("否")})]})]})]}),t&&n.length>0&&c("div",{style:e.fieldSection,children:[c("div",{style:e.subBizGrid,children:n.map(s=>c("div",{style:e.subBizField,children:[c("label",{style:e.fieldLabel,children:[Kt(s.bizType)," (%)"]}),c("input",{type:"number",min:"0",max:"100",step:"0.01",placeholder:"0",value:r[s.bizType]||"",onChange:f=>{i(s.bizType,f.target.value)},style:{...e.input,...o?e.inputError:{}}})]},s.fundBalanceId||s.bizType))}),c("div",{style:e.subBizHint,children:`${n.map(s=>Kt(s.bizType)).join(" + ")} ${_("must total 100%")}`}),o&&c("div",{style:e.error,children:o})]})]})}function Xi({onBack:e,onCancel:t,currency:n="USD",amount:r="",channel:o="",onAmountError:a}){const i=ji(),s=i.container.background==="#181A20",{subBusinesses:f,useFundAllocation:d,subBizPercentages:p,subBizError:u,setUseFundAllocation:x,setSubBizPercentage:b,validateFundAllocation:h,buildAllocationRatios:y}=Gi(),m=new Date,L=`${m.getFullYear()}-${String(m.getMonth()+1).padStart(2,"0")}-${String(m.getDate()).padStart(2,"0")}`,[S,k]=R({urls:[],transferTime:L,transferAmount:r,transactionId:"",payerName:"",filesError:"",timeError:"",amountError:"",transactionIdError:"",payerNameError:""});H(()=>{k(A=>({...A,transferAmount:r}))},[r]);const E=async()=>{let A=!0;if(S.urls.length===0&&(A=!1,k(v=>({...v,filesError:_("请上传银行转账回单")}))),S.transferTime||(A=!1,k(v=>({...v,timeError:_("请选择转账时间")}))),r.trim()||(A=!1,a?.(_("请输入充值金额"))),S.transactionId.trim()||(A=!1,k(v=>({...v,transactionIdError:_("请输入转账交易ID")}))),S.payerName.trim()||(A=!1,k(v=>({...v,payerNameError:_("请输入付款人名称")}))),h()||(A=!1),!!A)try{await Hn({transferDate:S.transferTime,transferNo:S.transactionId,transferChannel:o,voucherUrls:S.urls,payerName:S.payerName,submitAmount:r,submitCurrency:n,useFundAllocation:d,allocationRatios:y()}),ze.success(_("提交成功")),t()}finally{k(v=>({...v,loading:!1}))}};return c("div",{style:i.container,children:[c("div",{style:i.header,children:c("button",{type:"button",onClick:e,style:i.backButton,children:[c("span",{style:i.backIcon,children:"←"}),_("返回账户信息")]})}),c("div",{style:i.uploadSection,children:[c(Gn,{value:S.urls,onChange:A=>{k(v=>({...v,urls:A,filesError:""}))},maxCount:10,accept:"image/*,.pdf",multiple:!0}),S.filesError&&c("div",{style:i.error,children:S.filesError})]}),c("div",{style:i.fieldSection,children:[c("label",{style:i.fieldLabel,children:[c("span",{style:i.required,children:"*"}),_("转账时间")]}),c(Yi,{value:S.transferTime,placeholder:_("请选择转账时间"),onChange:A=>{k(v=>({...v,transferTime:A,timeError:""}))},style:{width:"100%"}}),S.timeError&&c("div",{style:i.error,children:S.timeError})]}),c("div",{style:i.fieldSection,children:[c("label",{style:i.fieldLabel,children:_("转账金额")}),c("div",{style:i.inputWrapper,children:[c("input",{type:"text",placeholder:_("请输入实际转账金额"),value:S.transferAmount,readOnly:!0,disabled:!0,style:{...i.input,...s?i.disabledDark:i.disabled}}),c("span",{style:i.currencySuffix,children:n})]})]}),c("div",{style:i.fieldSection,children:[c("label",{style:i.fieldLabel,children:[c("span",{style:i.required,children:"*"}),_("交易ID")]}),c("input",{type:"text",placeholder:_("请输入转账交易ID"),value:S.transactionId,onChange:A=>{k(v=>({...v,transactionId:A.target.value,transactionIdError:""}))},style:{...i.input,...S.transactionIdError?i.inputError:{}}}),S.transactionIdError&&c("div",{style:i.error,children:S.transactionIdError})]}),c("div",{style:i.fieldSection,children:[c("label",{style:i.fieldLabel,children:[c("span",{style:i.required,children:"*"}),_("付款人名称")]}),c("input",{type:"text",placeholder:_("请输入付款人名称"),value:S.payerName,onChange:A=>{k(v=>({...v,payerName:A.target.value,payerNameError:""}))},style:{...i.input,...S.payerNameError?i.inputError:{}}}),S.payerNameError&&c("div",{style:i.error,children:S.payerNameError})]}),c(Ki,{theme:i,useFundAllocation:d,subBusinesses:f,subBizPercentages:p,subBizError:u,onUseFundAllocationChange:x,onPercentageChange:b}),c("div",{style:i.buttonSection,children:[c("button",{type:"button",onClick:t,style:i.cancelButton,children:_("取消")}),c("button",{type:"button",onClick:E,style:i.submitButton,children:_("提交审核")})]})]})}function Zi(){const e=B("size"),t={container:{background:"#fff",borderRadius:8,padding:e===l.SMALL?16:20,width:"100%",maxWidth:"100%",boxSizing:"border-box","@media (max-width: 1020px)":{maxWidth:"100%",margin:0,padding:e===l.SMALL?12:16},"@media (min-width: 1021px)":{maxWidth:600,margin:"0 auto"}},header:{fontSize:e===l.SMALL?16:18,fontWeight:700,marginBottom:e===l.SMALL?16:20,textAlign:"left",display:"flex",alignItems:"center",gap:8},titleBar:{width:3,height:e===l.SMALL?16:20,background:"#1890ff",borderRadius:2},bankDetails:{marginBottom:e===l.SMALL?20:24},detailCard:{marginTop:12,marginBottom:12,border:"1px solid #f0f0f0",borderRadius:8,background:"#fafafa",overflow:"hidden"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"8px 0":"10px 0",borderBottom:"1px solid #f0f0f0",width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{flexDirection:"column",alignItems:"flex-start",gap:4}},label:{fontSize:e===l.SMALL?13:14,color:"#666",fontWeight:500,minWidth:120,"@media (max-width: 600px)":{minWidth:"auto",marginBottom:2}},value:{fontSize:e===l.SMALL?13:14,color:"#222",fontWeight:500,textAlign:"right",flex:1,"@media (max-width: 600px)":{textAlign:"left",flex:"none",width:"100%"}},valueWithCopy:{display:"flex",alignItems:"center",gap:8,flex:1,justifyContent:"flex-end",minWidth:0,"@media (max-width: 600px)":{flex:"none",width:"100%",justifyContent:"flex-start"}},row:{display:"flex",alignItems:"center",padding:"10px 12px",borderBottom:"1px solid #ededed"},rowLast:{borderBottom:"none"},rowAlt:{background:"#fafafa"},labelMuted:{fontSize:e===l.SMALL?13:14,color:"#8c8c8c",fontWeight:500,flex:.4},valueStrong:{fontSize:e===l.SMALL?13:14,color:"#111",textAlign:"right",flex:.6,wordBreak:"break-all"},copyButton:{padding:e===l.SMALL?"4px 8px":"6px 12px",fontSize:e===l.SMALL?11:12,background:"#1890ff",color:"#fff",border:"none",borderRadius:4,cursor:"pointer",fontWeight:500,flexShrink:0,whiteSpace:"nowrap"},confirmButton:{width:"100%",marginBottom:e===l.SMALL?16:20,background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:e===l.SMALL?"10px 12px":"12px 16px",fontWeight:600,cursor:"pointer",fontSize:e===l.SMALL?13:14},noticeBox:{marginBottom:e===l.SMALL?16:20,padding:e===l.SMALL?"10px 12px":"12px 16px",borderRadius:6,background:"#FFF7E6",border:"1px solid #FFE7BA",color:"#AD6800",fontSize:e===l.SMALL?12:13,lineHeight:1.5},reminderTitle:{fontWeight:600,marginBottom:e===l.SMALL?8:12,textAlign:"left",fontSize:e===l.SMALL?14:16},reminderList:{margin:0,paddingLeft:18,color:"#666",lineHeight:1.6,textAlign:"left",fontSize:e===l.SMALL?12:13,listStyleType:"disc",listStylePosition:"outside"},link:{color:"#1890ff",textDecoration:"none",fontWeight:500}};return{white:{...t},dark:{...t,container:{...t.container,background:"#181A20",border:"1px solid #2B2E38"},titleBar:{...t.titleBar,background:"#00E8C6"},detailCard:{...t.detailCard,border:"1px solid #374151",background:"#23262F"},row:{...t.row,borderBottom:"1px solid #374151",background:"#23262F"},rowAlt:{...t.rowAlt,borderBottom:"1px solid #374151",background:"#23262F"},rowLast:{...t.rowLast,background:"#23262F"},labelMuted:{...t.labelMuted,color:"#B5B8BE"},valueStrong:{...t.valueStrong,color:"#fff"},label:{...t.label,color:"#B5B8BE"},value:{...t.value,color:"#fff"},copyButton:{...t.copyButton,background:"#00E8C6",color:"#111"},confirmButton:{...t.confirmButton,background:"#00E8C6",color:"#111"},noticeBox:{...t.noticeBox,background:"#2A1F0F",border:"1px solid #5C3E12",color:"#F4E3C1"},reminderTitle:{...t.reminderTitle,color:"#fff"},reminderList:{...t.reminderList,color:"#B5B8BE"},link:{...t.link,color:"#00E8C6"}}}}function Qi(){const e=B("theme"),t=B("themeConfig"),n=e===N.WHITE,r=Zi(),o=n?r.white:r.dark;if(t){const a=n?t.white:t.dark;if(a?.color)return{...o,titleBar:{...o.titleBar,background:a.color},copyButton:{...o.copyButton,background:a.color},confirmButton:{...o.confirmButton,background:a.color},link:{...o.link,color:a.color}}}return o}function ea({onConfirm:e,channelCode:t}){const n=Qi(),[r,o]=R([]),a=B("merchantId"),i={color:"#ff4d4f",fontWeight:600};return H(()=>{if(!t)return;let s=!0;return Jn({code:t}).then(f=>{if(s){if(Array.isArray(f)){o(f.map(d=>String(d)));return}if(f&&typeof f=="object"){const d=[];Object.keys(f).forEach(p=>{const u=f[p];d.push(`${p}: ${u}`)}),o(d);return}o(f?[String(f)]:[])}}).catch(()=>o([])),()=>{s=!1}},[t]),c("div",{style:n.container,children:[c("div",{style:n.header,children:[c("span",{style:n.titleBar}),_("银行转账")]}),r.length>0&&c("div",{style:n.detailCard,children:r.map((s,f)=>{const d=String(s).split(":"),p=d.shift()?.trim()||"",u=d.join(":").trim();return c("div",{style:{...n.row,...f===r.length-1?n.rowLast:{},...f%2===1?n.rowAlt:{}},children:[c("div",{style:n.labelMuted,children:p}),c("div",{style:n.valueStrong,children:u||"-"})]},f)})}),c("button",{type:"button",onClick:e,style:n.confirmButton,children:_("确认转账详情")}),c("div",{style:n.noticeBox,children:_("转账后提交银行回单提示")}),c("div",{style:n.reminderTitle,children:_("温馨提示")}),c("ul",{style:n.reminderList,children:[c("li",{children:[_("我们强烈建议,转账时在备注中输入您的ID:"),c("span",{style:i,children:a}),_("。这可以"),c("span",{style:i,children:_("加速资金审核")}),Yn()===xe.ZH?"。":"."]}),c("li",{children:_("创建付款时请勿填写敏感备注,例如:topup ads、order等、建议填写数字代码")}),c("li",{children:_("请填写正确的支付金额、币种、支付时间,相同的交易请勿重复提交。")}),c("li",{children:_("请上传交易凭证,否则无法核验并及时添加余额。")}),c("li",{children:_("提交成功后根据实际到账金额添加余额。工作时间提交的转账当日处理,非工作时间提交的转账将在下一个工作日处理。")}),c("li",{children:_("通过平台互转(例如payoneer转payoneer)付款方式可能会有10分钟延迟,请耐心等待。")}),c("li",{children:_("广告款项若入账金额为美金外其他币种额外扣除0.6%手续费,其中PayPal支付方式额外扣除2.5%手续费。")}),c("li",{children:_("如有问题,请联系客服。")})]})]})}function ta({visible:e,onClose:t,onSubmit:n}){const r=Di(),[o,a]=R(!1),[i,s]=R({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1});H(()=>{const y=()=>{a(window.innerWidth<=1020)};return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]),H(()=>{e||s({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1})},[e]);const f=(y,m)=>{s(L=>({...L,channel:y,paymentType:m,channelError:""}))},d=y=>{s(m=>({...m,amount:y,amountError:""}))},p=y=>{s(m=>({...m,amountError:y}))},u=y=>{s(m=>({...m,currency:y}))},x=async y=>{s(m=>({...m,loading:!0,error:""}));try{await n(y),t()}catch{s(m=>({...m,error:_("提交失败,请重试")}))}finally{s(m=>({...m,loading:!1}))}},b=()=>{console.log("用户确认银行转账详情"),s(y=>({...y,showOfflineUpload:!0}))},h=()=>{s(y=>({...y,showOfflineUpload:!1}))};return c(Kn,{visible:e,onClose:t,title:_("充值/转账"),width:o?"95%":960,maxWidth:o?"95%":1e3,children:c("div",{style:{...r.wrapper,...o?{gridTemplateColumns:"1fr",gap:16,minWidth:"auto"}:{}},children:[c(Ni,{onChannelChange:f,onAmountChange:d,onCurrencyChange:u,initialAmount:i.amount,initialCurrency:i.currency,initialPaymentType:i.paymentType,amountError:i.amountError}),i.paymentType==="online"?c($i,{onSubmit:x,amount:i.amount,currency:i.currency,channel:i.channel,loading:i.loading,error:i.error,onAmountError:p}):i.showOfflineUpload?c(Xi,{onBack:h,onCancel:t,currency:i.currency,amount:i.amount,channel:i.channel,onAmountError:p}):c(ea,{onConfirm:b,channelCode:i.channel})]})})}function na(){const[e,t]=R(!1),n=async r=>{const o=await jn({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return c("div",{children:[c(ht,{onClick:()=>t(!0),children:_("充值/转账")}),c(ta,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}qe(na,"best-payment",["theme"],{shadow:!1});const Xt={white:{popover:{background:"#fff",color:"#222",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",border:"none"},arrow:{top:"#fff",bottom:"#fff",left:"#fff",right:"#fff"}},dark:{popover:{background:"#23262F",color:"#fff",boxShadow:"0 4px 16px rgba(0,0,0,0.32)",border:"1px solid #444C5C"},arrow:{top:"#23262F",bottom:"#23262F",left:"#23262F",right:"#23262F"}}};function ra(){return B("theme")===N.WHITE?Xt.white:Xt.dark}const oa=({popover:e,children:t,popoverWidth:n,popoverMinWidth:r,offsetY:o,offsetX:a,popoverPosition:i="top"})=>{const s=B("size"),f=n??(s===l.SMALL?200:300),d=r??(s===l.SMALL?150:200),p=o??(s===l.SMALL?8:16),u=a??(s===l.SMALL?8:16),[x,b]=R(!1),[h,y]=R(i),m=se(null),L=se(null),S=ra(),k=()=>{if(L.current&&(clearTimeout(L.current),L.current=null),i==="top"||i==="bottom")if(m.current){const P=m.current.getBoundingClientRect();i==="top"&&P.top<100?y("bottom"):i==="bottom"&&window.innerHeight-P.bottom<100?y("top"):y(i)}else y(i);else y(i);b(!0)},E=()=>{L.current=window.setTimeout(()=>{b(!1)},120)};let A={position:"absolute",zIndex:999,borderRadius:6,fontSize:s===l.SMALL?12:15,minWidth:d,width:f,padding:s===l.SMALL?"6px 12px":"8px 14px",pointerEvents:"auto",textAlign:"center",animation:"fadeInUp 0.3s",...S.popover},v={position:"absolute",zIndex:11,width:0,height:0};return h==="top"?(A={...A,left:"50%",top:-48,transform:"translateX(-50%)"},v={...v,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:`8px solid ${S.arrow.top}`}):h==="bottom"?(A={...A,left:"50%",top:"100%",marginTop:p,transform:"translateX(-50%)"},v={...v,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${S.arrow.bottom}`}):h==="leftTop"?(A={...A,right:"100%",top:0,marginRight:u,transform:"none"},v={...v,right:-8,top:s===l.SMALL?8:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:`8px solid ${S.arrow.left}`}):h==="rightTop"&&(A={...A,left:"100%",top:0,marginLeft:u,transform:"translateY(0)"},v={...v,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:`8px solid ${S.arrow.right}`}),c("div",{ref:m,style:{position:"relative",display:"inline-block"},onMouseEnter:k,onMouseLeave:E,children:[t,x&&c("div",{style:A,onMouseEnter:k,onMouseLeave:E,children:[e,c("div",{style:v})]})]})};function ia(){const e=B("size");return{white:{popoverTitle:{fontSize:e===l.SMALL?12:16,fontWeight:600,color:"#222",marginBottom:e===l.SMALL?12:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #e5e7eb",fontSize:e===l.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#6b7280",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===l.SMALL?6:8,height:e===l.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===l.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===l.SMALL?12:15}),main:{fontSize:e===l.SMALL?18:24,fontWeight:800,color:"#111827",display:"inline-block"},currency:{fontSize:e===l.SMALL?16:18,color:"#6b7280",marginLeft:e===l.SMALL?6:8,fontWeight:600}},dark:{popoverTitle:{fontSize:e===l.SMALL?14:16,fontWeight:600,color:"#fff",marginBottom:e===l.SMALL?14:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:e===l.SMALL?"6px 0":"8px 0",borderBottom:"1px solid #374151",fontSize:e===l.SMALL?12:15},detailLabel:{display:"flex",alignItems:"center",color:"#B5B8BE",fontWeight:500},detailDot:t=>({display:"inline-block",width:e===l.SMALL?6:8,height:e===l.SMALL?6:8,borderRadius:"50%",background:t,marginRight:e===l.SMALL?6:8}),detailValue:t=>({color:t,fontWeight:600,fontSize:e===l.SMALL?12:15}),main:{fontSize:e===l.SMALL?18:24,fontWeight:800,color:"#fff",display:"inline-block"},currency:{fontSize:e===l.SMALL?16:18,color:"#B5B8BE",marginLeft:e===l.SMALL?6:8,fontWeight:600}}}}function aa(){const t=B("theme")===N.WHITE,n=ia();return t?n.white:n.dark}function Zt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}function sa(e){const[t,n]=R({currBalance:0,currency:"USD",details:[]}),[r,o]=R(!0),a=async()=>{try{const f=await $n(),d=[{label:"",value:f.totalAmount,color:"#15b36b",dot:"#15b36b"},{label:"",value:f.frozenAmount,color:"#f59e0b",dot:"#f59e0b"},...f.isCredit?[{label:"",value:f.creditLimit,color:"#1890ff",dot:"#1890ff"},{label:"",value:f.creditUsed,color:"#ff0000",dot:"#ff0000"}]:[],{label:"",value:f.availableAmount,color:"#1890ff",dot:"#15b36b"}],p={currBalance:f.currBalance,currency:f.currency,details:d};n(p),o(!1)}catch(f){console.error("获取余额失败:",f),o(!1)}};H(()=>{a()},[]),H(()=>{const f=()=>{a()};return window.addEventListener("refresh-balance",f),()=>{window.removeEventListener("refresh-balance",f)}},[]);const i=aa(),s=[{label:_("真实金额"),value:t.details[0]?.value||0,color:"#15b36b",dot:"#15b36b"},{label:_("冻结金额"),value:t.details[1]?.value||0,color:"#f59e0b",dot:"#f59e0b"},...t.details.length>4?[{label:_("信用额度"),value:t.details[2]?.value||0,color:"#1890ff",dot:"#1890ff"},{label:_("已用额度"),value:t.details[3]?.value||0,color:"#ff0000",dot:"#ff0000"}]:[],{label:_("可用余额"),value:t.details[4]?.value||0,color:"#1890ff",dot:"#15b36b"}];return r?null:c(oa,{popover:c(Z,{children:[c("div",{style:i.popoverTitle,children:_("余额详情")}),s.map(f=>c("div",{style:i.detailRow,children:[c("span",{style:i.detailLabel,children:[c("span",{style:i.detailDot(f.dot)}),f.label]}),c("span",{style:i.detailValue(f.color),children:Zt(f.value)})]},f.label))]}),popoverPosition:e.popoverPosition||"bottom",children:c("div",{style:i.main,children:[Zt(t.currBalance),c("span",{style:i.currency,children:t.currency})]})})}qe(sa,"best-statistical-balance");const Ae={white:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontWeight:600,transition:"all 0.2s ease"},dark:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,cursor:"pointer",fontWeight:600,transition:"all 0.2s ease"}};function la(e){return B("theme")===N.WHITE?{...Ae.white,background:e||Ae.white.background}:{...Ae.dark,background:e||Ae.dark.background}}function ca(e){switch(e){case"small":return{fontSize:"12px",gap:"2px"};case"large":return{fontSize:"18px",gap:"6px"};default:return{fontSize:"14px",gap:"4px"}}}function da({color:e,size:t="medium",children:n}){const[r,o]=R(!1),a=la(e),i=ca(t),s={...a,...i,display:"flex",alignItems:"center"};return c(Z,{children:[c("style",{children:`
|
|
79
79
|
@keyframes spin {
|
|
80
80
|
from {
|
|
81
81
|
transform: rotate(0deg);
|
package/dist/best-unit.js
CHANGED
|
@@ -6346,7 +6346,9 @@ function ji() {
|
|
|
6346
6346
|
}), () => {
|
|
6347
6347
|
x = !1;
|
|
6348
6348
|
};
|
|
6349
|
-
}, []), {
|
|
6349
|
+
}, []), H(() => {
|
|
6350
|
+
e.length <= 1 && (r(!1), s(""));
|
|
6351
|
+
}, [e.length]), {
|
|
6350
6352
|
subBusinesses: e,
|
|
6351
6353
|
useFundAllocation: n,
|
|
6352
6354
|
subBizPercentages: o,
|
|
@@ -6361,7 +6363,7 @@ function ji() {
|
|
|
6361
6363
|
})), s("");
|
|
6362
6364
|
},
|
|
6363
6365
|
validateFundAllocation: () => {
|
|
6364
|
-
if (!n || e.length
|
|
6366
|
+
if (!n || e.length <= 1)
|
|
6365
6367
|
return !0;
|
|
6366
6368
|
const x = e.some(
|
|
6367
6369
|
(y) => !o[y.bizType]?.trim()
|
|
@@ -6374,10 +6376,10 @@ function ji() {
|
|
|
6374
6376
|
);
|
|
6375
6377
|
return x ? (s(_("请输入子业务占比")), !1) : b || Math.abs(h - 100) > 1e-4 ? (s(_("子业务占比总和必须为100%")), !1) : (s(""), !0);
|
|
6376
6378
|
},
|
|
6377
|
-
buildAllocationRatios: () => n ? e.map((x) => ({
|
|
6379
|
+
buildAllocationRatios: () => !n || e.length <= 1 ? [] : e.map((x) => ({
|
|
6378
6380
|
fundBalanceId: x.fundBalanceId,
|
|
6379
6381
|
ratio: String(o[x.bizType] || "")
|
|
6380
|
-
}))
|
|
6382
|
+
}))
|
|
6381
6383
|
};
|
|
6382
6384
|
}
|
|
6383
6385
|
function qi({
|
|
@@ -6389,7 +6391,7 @@ function qi({
|
|
|
6389
6391
|
onUseFundAllocationChange: a,
|
|
6390
6392
|
onPercentageChange: i
|
|
6391
6393
|
}) {
|
|
6392
|
-
return /* @__PURE__ */ c(Z, { children: [
|
|
6394
|
+
return n.length <= 1 ? null : /* @__PURE__ */ c(Z, { children: [
|
|
6393
6395
|
/* @__PURE__ */ c("div", { style: e.fieldSection, children: [
|
|
6394
6396
|
/* @__PURE__ */ c("label", { style: e.fieldLabel, children: _("是否使用资金分配") }),
|
|
6395
6397
|
/* @__PURE__ */ c("div", { style: e.radioGroup, children: [
|
package/package.json
CHANGED
|
@@ -65,6 +65,13 @@ export function useFundAllocation() {
|
|
|
65
65
|
};
|
|
66
66
|
}, []);
|
|
67
67
|
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (subBusinesses.length <= 1) {
|
|
70
|
+
setUseFundAllocation(false);
|
|
71
|
+
setSubBizError("");
|
|
72
|
+
}
|
|
73
|
+
}, [subBusinesses.length]);
|
|
74
|
+
|
|
68
75
|
const handleUseFundAllocationChange = (value: boolean) => {
|
|
69
76
|
setUseFundAllocation(value);
|
|
70
77
|
setSubBizError("");
|
|
@@ -79,7 +86,7 @@ export function useFundAllocation() {
|
|
|
79
86
|
};
|
|
80
87
|
|
|
81
88
|
const validateFundAllocation = () => {
|
|
82
|
-
if (!useFundAllocation || subBusinesses.length
|
|
89
|
+
if (!useFundAllocation || subBusinesses.length <= 1) {
|
|
83
90
|
return true;
|
|
84
91
|
}
|
|
85
92
|
|
|
@@ -110,7 +117,7 @@ export function useFundAllocation() {
|
|
|
110
117
|
};
|
|
111
118
|
|
|
112
119
|
const buildAllocationRatios = () => {
|
|
113
|
-
if (!useFundAllocation) {
|
|
120
|
+
if (!useFundAllocation || subBusinesses.length <= 1) {
|
|
114
121
|
return [];
|
|
115
122
|
}
|
|
116
123
|
|
|
@@ -141,6 +148,10 @@ export function FundAllocationSection({
|
|
|
141
148
|
onUseFundAllocationChange,
|
|
142
149
|
onPercentageChange,
|
|
143
150
|
}: FundAllocationSectionProps) {
|
|
151
|
+
if (subBusinesses.length <= 1) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
|
|
144
155
|
return (
|
|
145
156
|
<>
|
|
146
157
|
<div style={theme.fieldSection}>
|