best-unit 2.0.1 → 2.0.2

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.
@@ -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 qn({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,c]=B(!1),p=yi();q(()=>{xi(p)},[p]);const u=b=>{b.target===b.currentTarget?c(!0):c(!1)},h=b=>{b.target===b.currentTarget&&f&&s&&t(),c(!1)};return e?d("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:h,children:d("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:[d("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&&d("button",{type:"button",onClick:t,style:p.closeBtn,"aria-label":"关闭",children:"×"}),n&&d("div",{style:p.title,children:n})]}),d("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 _i(){const e=k("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 Si(){const e=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=_i(),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 Li=k("size");function wi({visible:e,onClose:t,onSubmit:n}){const[r,o]=B({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[a,i]=B({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}),[s,f]=B("online"),c=Si();q(()=>{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 h=!0;if(o(b=>({...b,amountError:"",rechargeChannelError:""})),r.amount.trim()||(o(b=>({...b,amountError:_("请输入充值金额")})),h=!1),r.rechargeChannel||(o(b=>({...b,rechargeChannelError:_("请选择支付平台")})),h=!1),!!h){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 d(qn,{visible:e,onClose:t,title:_("充值 / 转账"),children:[d("div",{style:{display:"flex",marginBottom:Li===l.SMALL?16:28},children:[d("button",{type:"button",onClick:()=>f("online"),style:c.tabBtn(s==="online",!0),children:_("在线充值")}),d("button",{type:"button",onClick:()=>f("offline"),style:c.tabBtn(s==="offline",!1),children:_("线下转账")})]}),d("div",{style:{display:s==="online"?"block":"none"},children:d("form",{onSubmit:p,children:d(ui,{formState:r,setFormState:o,onClose:t,loading:r.loading})})}),d("div",{style:{display:s==="offline"?"block":"none"},children:d(gi,{formState:a,setFormState:i,onClose:t,loading:a.loading})})]})}function pt(){return(pt=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 Ai=["context","children"];function ki(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,Ai);return cn(t,n)}function Ei(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=ie(ki,pt({},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[Jn(s[i].name)]=s[i].value);for(i=f.length;i--;){var c=t(f[i],null),p=f[i].slot;p?a[p]=ie(Vt,{name:p},c):o[i]=c}var u=r?ie(Vt,null,o):o;return ie(r||n.nodeName.toLowerCase(),a,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?ln:Ie)(this._vdom,this._root)}function Jn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function Ci(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[Jn(e)]=n,this._vdom=cn(this._vdom,r),Ie(this._vdom,this._root)}}function vi(){Ie(this._vdom=null,this._root)}function Vt(e,t){var n=this;return ie("slot",pt({},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 He(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=Ei,o.prototype.attributeChangedCallback=Ci,o.prototype.disconnectedCallback=vi,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 Mi(){const[e,t]=B(!1),n=async r=>{const o=await Un({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return d("div",{children:[d(ft,{onClick:()=>t(!0),children:_("充值/转账")}),d(wi,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}He(Mi,"best-recharge",["theme"],{shadow:!1});function Ti(){const e=k("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 Bi(){const e=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=Ti(),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 Ri(){const e=k("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},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"},methodItem:n=>({padding:"10px 12px",textAlign:"left",borderRadius:8,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",color:"#fff",cursor:"pointer"}),bankItem:n=>({padding:"10px 12px",borderRadius:8,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",textAlign:"left",color:"#fff",cursor:"pointer"})}}}function Fi(){const e=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=Ri(),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 Ii({onChannelChange:e,onAmountChange:t,onCurrencyChange:n,initialAmount:r="",initialCurrency:o="USD",initialPaymentType:a="online",amountError:i=""}){const s=Fi(),c=JSON.parse(sessionStorage.getItem("all_dicts")||"{}")?.currency||[],[p,u]=B([]),[h,b]=B([]),[g,x]=B({currency:o,amount:r,onlineChannel:"",bankChannel:"",paymentType:a,amountError:""});q(()=>{qo({currency:g.currency}).then(L=>{const A=L.onlineChannel||[],T=L.offlineChannel||[];u(A),b(T);const z=A.length>0,N=T?.[0]?.value||"",$=A?.[0]?.value||"",G=z?a:"bank",U=G==="online"?$:N;x(K=>({...K,onlineChannel:$,bankChannel:N,paymentType:G})),U&&e(U,G)})},[g.currency]);function y(L){return L=L.replace(/[^\d.]/g,""),L=L.replace(/\.(?=.*\.)/g,""),L=L.replace(/^(\d+)(\.\d{0,2})?.*$/,"$1$2"),L=L.replace(/^0+(\d)/,"$1"),L.startsWith(".")&&(L="0"+L),L}const S=L=>{x(A=>({...A,currency:L})),n(L)},w=L=>{const A=y(L);x(T=>({...T,amount:A,amountError:""})),t(A)},M=(L,A)=>{x(T=>({...T,[A==="online"?"onlineChannel":"bankChannel"]:L,paymentType:A})),e(L,A)};return d("div",{style:s.left,children:[d("div",{style:s.blockTitle,children:[d("span",{style:s.titleBar}),_("选择支付方式")]}),d("div",{style:s.fieldLabel,children:_("支付币种")}),d("div",{style:s.currencyRow,children:(c||[]).slice(0,4).map(L=>d("button",{type:"button",onClick:()=>S(L.value),style:s.currencyItem(g.currency===L.value),children:L.label}))}),d("div",{style:{height:12}}),d("div",{style:s.fieldLabel,children:[d("span",{style:s.required,children:"*"}),_("支付金额")]}),d("div",{style:s.inputWrapper,children:[d("input",{type:"text",placeholder:_("请输入充值金额"),value:g.amount,onInput:L=>{w(L.target.value)},style:{...s.input,...i?s.inputError:{}}}),d("div",{style:s.inputSuffixAbs,children:g.currency})]}),i&&d("div",{style:s.error,children:i}),d("div",{style:{height:20}}),d("div",{style:s.fieldLabel,children:_("支付方式")}),p.length>0&&d("div",{children:[d("div",{style:s.subTitle,children:_("线上支付")}),d("div",{style:s.methodList,children:p.map(L=>d("button",{type:"button",onClick:()=>M(L.value,"online"),style:s.methodItem(g.onlineChannel===L.value&&g.paymentType==="online"),children:[L.icon&&d("img",{src:L.icon,alt:L.label,style:s.channelIcon}),L.label]}))})]}),d("div",{style:s.subTitle,children:_("银行转账")}),d("div",{style:s.bankList,children:h.map(L=>d("button",{type:"button",onClick:()=>M(L.value,"bank"),style:s.bankItem(g.bankChannel===L.value&&g.paymentType==="bank"),children:[L.icon&&d("img",{src:L.icon,alt:L.label,style:s.channelIcon}),L.label]}))})]})}function Di(){const e=k("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"},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"},reminderTitle:{...t.reminderTitle,color:"#fff"},reminderList:{...t.reminderList,color:"#B5B8BE"}}}}function Oi(){const e=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=Di(),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 zi({onSubmit:e,amount:t,currency:n,channel:r,loading:o=!1,error:a="",onAmountError:i}){const s=Oi(),f=s.right.background==="#181A20",[c,p]=B({amount:t,currency:n,channel:r,loading:o,error:a,amountError:""}),[u,h]=B(null);q(()=>{p(x=>({...x,amount:t,currency:n,channel:r,loading:o,error:a}));const g=setTimeout(()=>{t&&r&&n?$n({channel:r,amount:t,currency:n}).then(x=>h(x)).catch(()=>h(null)):h(null)},300);return()=>clearTimeout(g)},[t,n,r,o,a]);const b=async g=>{g&&g.preventDefault();let x=!0;if(t.trim()||(x=!1,i?.(_("请输入充值金额"))),r||(x=!1,p(y=>({...y,error:_("请选择支付平台")}))),!!x){p(y=>({...y,loading:!0,error:""}));try{await e({amount:t,currency:n,rechargeChannel:r})}finally{p(y=>({...y,loading:!1}))}}};return d("div",{style:s.right,children:[d("div",{style:s.blockTitle,children:[d("span",{style:s.titleBar}),_("在线支付")]}),d("form",{onSubmit:b,children:[d("div",{style:s.inputWrapper,children:[d("input",{type:"text",placeholder:_("支付金额"),value:c.amount,readOnly:!0,disabled:!0,style:{...s.input,...f?s.disabledDark:s.disabled,width:"100%"}}),d("div",{style:s.inputSuffixAbs,children:c.currency})]}),d("button",{type:"submit",disabled:c.loading,style:s.payButton,children:c.loading?_("提交中..."):_("立即支付")})]}),u&&d("div",{style:s.calcBox,children:[d("div",{style:s.calcLine,children:[_("预计支付金额约为:"),d("span",{style:s.calcAmount,children:`$${u.paymentAmount}`}),u.currency]}),d("div",{style:s.calcLine,children:[_("手续费约为:"),d("span",{style:s.calcAmount,children:`$${u.fee}`}),u.currency]}),d("div",{children:_("注:地区/币种/卡类型可能影响手续费,最终以平台为准。")})]}),d("div",{style:s.noticeBox,children:_("请在转账后提交银行回单,否则可能无法及时核验")}),d("div",{style:s.reminderTitle,children:_("温馨提示")}),d("ul",{style:s.reminderList,children:[d("li",{children:_("支付金额须与申请金额一致,请勿多付、少付或分批提交。")}),d("li",{children:_("请妥善保存回单并提供准确的支付时间,否则可能无法核验。")}),d("li",{children:_("工作时间提交4小时内审核,非工作时间将顺延至下一个工作日。")}),d("li",{children:_("如有问题,请联系平台客服。")}),d("li",{children:_("预付充值将收取平台服务费,具体以官方为准。")})]}),c.error&&d("div",{style:s.error,children:c.error})]})}function Pi(){const e=k("size"),t={container:{background:"#fff",borderRadius:8,padding:e===l.SMALL?16:20,width:"100%",maxWidth:"100%",boxSizing:"border-box","@media (max-width: 1020px)":{padding:e===l.SMALL?12:16}},header:{marginBottom:e===l.SMALL?20:24},backButton:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",color:"#1890ff",cursor:"pointer",fontSize:e===l.SMALL?14:16,fontWeight:500},backIcon:{fontSize:e===l.SMALL?16:18},uploadSection:{marginBottom:e===l.SMALL?24:32},uploadArea:{border:"2px dashed #D9D9D9",borderRadius:8,padding:e===l.SMALL?"40px 20px":"60px 30px",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?48:64,marginBottom:e===l.SMALL?12:16},uploadTitle:{fontSize:e===l.SMALL?16:18,fontWeight:600,color:"#222",marginBottom:e===l.SMALL?8:12},uploadHint:{fontSize:e===l.SMALL?13:14,color:"#999"},hiddenInput:{display:"none"},fileList:{marginTop:e===l.SMALL?12:16},fileItem:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:e===l.SMALL?"8px 12px":"10px 16px",background:"#F5F5F5",borderRadius:6,marginBottom:8},fileName:{fontSize:e===l.SMALL?13:14,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?20:24},fieldLabel:{display:"block",fontSize:e===l.SMALL?14:16,fontWeight:500,color:"#222",marginBottom:e===l.SMALL?8:12},required:{color:"#ff4d4f",marginRight:4},inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"10px 12px":"12px 16px",borderRadius:6,border:"1px solid #D9D9D9",outline:"none",fontSize:e===l.SMALL?14:16,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?12:16,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?16:18,pointerEvents:"none"},currencySuffix:{position:"absolute",right:e===l.SMALL?12:16,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?14:16,color:"#999",pointerEvents:"none"},buttonSection:{display:"flex",gap:e===l.SMALL?12:16,marginTop:e===l.SMALL?32:40,width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{flexDirection:"column",gap:e===l.SMALL?8:12}},cancelButton:{flex:1,padding:e===l.SMALL?"10px 16px":"12px 20px",borderRadius:6,border:"1px solid #D9D9D9",background:"#fff",color:"#222",fontSize:e===l.SMALL?14:16,fontWeight:500,cursor:"pointer",minWidth:0,boxSizing:"border-box"},submitButton:{flex:1,padding:e===l.SMALL?"10px 16px":"12px 20px",borderRadius:6,border:"none",background:"#1890ff",color:"#fff",fontSize:e===l.SMALL?14:16,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"},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 Ni(){const e=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=Pi(),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}function Ui(){const e=k("theme"),t=k("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"},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 $i(){return Ui()}function Wi({value:e="",placeholder:t=_("请选择日期"),disabled:n=!1,size:r="middle",onChange:o,onFocus:a,onBlur:i,className:s="",style:f={}}){const c=$i(),[p,u]=B(!1),[h,b]=B(e),[g,x]=B(new Date),[y,S]=B(!1),w=me(null),M=E=>{if(!E)return"";const v=new Date(E);return`${v.getFullYear()}-${String(v.getMonth()+1).padStart(2,"0")}-${String(v.getDate()).padStart(2,"0")}`},L=(E,v)=>new Date(E,v+1,0).getDate(),A=(E,v)=>new Date(E,v,1).getDay(),T=()=>{const E=g.getFullYear(),v=g.getMonth(),ce=L(E,v),Gn=A(E,v),de=[],ht=v===0?11:v-1,mt=v===0?E-1:E,gt=L(mt,ht);for(let W=Gn-1;W>=0;W--)de.push({date:gt-W,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${mt}-${String(ht+1).padStart(2,"0")}-${String(gt-W).padStart(2,"0")}`});const Kn=new Date,bt=h?new Date(h):null;for(let W=1;W<=ce;W++){const yt=`${E}-${String(v+1).padStart(2,"0")}-${String(W).padStart(2,"0")}`,xt=new Date(yt);de.push({date:W,isCurrentMonth:!0,isToday:xt.toDateString()===Kn.toDateString(),isSelected:bt&&xt.toDateString()===bt.toDateString(),fullDate:yt})}const Xn=v===11?0:v+1,Zn=v===11?E+1:E,Qn=42-de.length;for(let W=1;W<=Qn;W++)de.push({date:W,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${Zn}-${String(Xn+1).padStart(2,"0")}-${String(W).padStart(2,"0")}`});return de},z=E=>{b(E),u(!1),o?.(E)},N=E=>{const v=new Date(g);E==="prev"?v.setMonth(v.getMonth()-1):v.setMonth(v.getMonth()+1),x(v)},$=E=>{const v=new Date(g);E==="prev"?v.setFullYear(v.getFullYear()-1):v.setFullYear(v.getFullYear()+1),x(v)},G=E=>{const v=new Date(g);v.setFullYear(E),x(v),S(!1)},U=()=>{const E=new Date().getFullYear(),v=[];for(let ce=E-50;ce<=E+50;ce++)v.push(ce);return v};q(()=>{const E=v=>{w.current&&!w.current.contains(v.target)&&u(!1)};if(p)return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[p]);const K=T(),Vn=[_("一月"),_("二月"),_("三月"),_("四月"),_("五月"),_("六月"),_("七月"),_("八月"),_("九月"),_("十月"),_("十一月"),_("十二月")],Yn=[_("日"),_("一"),_("二"),_("三"),_("四"),_("五"),_("六")];return d("div",{ref:w,className:`date-picker-container ${s}`,style:{...c.container,...f},children:[d("div",{style:{...c.input,...c[r],...n?c.disabled:{}},onClick:()=>!n&&u(!p),onFocus:a,onBlur:i,children:[d("span",{style:c.inputText,children:h?M(h):t}),d("span",{style:c.calendarIcon,children:"📅"})]}),p&&d("div",{style:c.panel,children:[d("div",{style:c.header,children:[d("button",{type:"button",style:c.navButton,onClick:()=>$("prev"),children:"‹‹"}),d("button",{type:"button",style:c.navButton,onClick:()=>N("prev"),children:"‹"}),d("span",{style:c.monthYear,onClick:()=>S(!y),children:[g.getFullYear(),"年",Vn[g.getMonth()]]}),d("button",{type:"button",style:c.navButton,onClick:()=>N("next"),children:"›"}),d("button",{type:"button",style:c.navButton,onClick:()=>$("next"),children:"››"})]}),y&&d("div",{style:c.yearPicker,children:d("div",{style:c.yearGrid,children:U().map(E=>d("button",{type:"button",style:{...c.yearButton,...E===g.getFullYear()?c.yearSelected:{}},onClick:()=>G(E),children:E},E))})}),d("div",{style:c.weekHeader,children:Yn.map(E=>d("div",{style:c.weekDay,children:E},E))}),d("div",{style:c.calendarGrid,children:K.map((E,v)=>d("button",{type:"button",style:{...c.dayButton,...E.isCurrentMonth?c.dayCurrentMonth:c.dayOtherMonth,...E.isToday?c.dayToday:{},...E.isSelected?c.daySelected:{}},onClick:()=>z(E.fullDate),disabled:n,children:E.date},v))})]})]})}function Hi({onBack:e,onCancel:t,currency:n="USD",amount:r="",channel:o="",onAmountError:a}){const i=Ni(),s=i.container.background==="#181A20",[f,c]=B({urls:[],transferTime:"",transferAmount:r,transactionId:"",payerName:"",filesError:"",timeError:"",amountError:"",transactionIdError:"",payerNameError:""});q(()=>{c(u=>({...u,transferAmount:r}))},[r]);const p=async()=>{let u=!0;if(f.urls.length===0&&(u=!1,c(h=>({...h,filesError:_("请上传银行转账回单")}))),f.transferTime||(u=!1,c(h=>({...h,timeError:_("请选择转账时间")}))),r.trim()||(u=!1,a?.(_("请输入充值金额"))),f.transactionId.trim()||(u=!1,c(h=>({...h,transactionIdError:_("请输入转账交易ID")}))),f.payerName.trim()||(u=!1,c(h=>({...h,payerNameError:_("请输入付款人名称")}))),!!u)try{await Nn({transferDate:f.transferTime,transferNo:f.transactionId,transferChannel:o,voucherUrls:f.urls,payerName:f.payerName}),Re.success(_("提交成功")),t()}finally{c(h=>({...h,loading:!1}))}};return d("div",{style:i.container,children:[d("div",{style:i.header,children:d("button",{type:"button",onClick:e,style:i.backButton,children:[d("span",{style:i.backIcon,children:"←"}),_("返回账户信息")]})}),d("div",{style:i.uploadSection,children:[d(jn,{value:f.urls,onChange:u=>{c(h=>({...h,urls:u,filesError:""}))},maxCount:10,accept:"image/*,.pdf",multiple:!0}),f.filesError&&d("div",{style:i.error,children:f.filesError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("转账时间")]}),d(Wi,{value:f.transferTime,placeholder:_("请选择转账时间"),onChange:u=>{c(h=>({...h,transferTime:u,timeError:""}))},style:{width:"100%"}}),f.timeError&&d("div",{style:i.error,children:f.timeError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:_("转账金额")}),d("div",{style:i.inputWrapper,children:[d("input",{type:"text",placeholder:_("请输入实际转账金额"),value:f.transferAmount,readOnly:!0,disabled:!0,style:{...i.input,...s?i.disabledDark:i.disabled}}),d("span",{style:i.currencySuffix,children:n})]})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("交易ID")]}),d("input",{type:"text",placeholder:_("请输入转账交易ID"),value:f.transactionId,onChange:u=>{c(h=>({...h,transactionId:u.target.value,transactionIdError:""}))},style:{...i.input,...f.transactionIdError?i.inputError:{}}}),f.transactionIdError&&d("div",{style:i.error,children:f.transactionIdError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("付款人名称")]}),d("input",{type:"text",placeholder:_("请输入付款人名称"),value:f.payerName,onChange:u=>{c(h=>({...h,payerName:u.target.value,payerNameError:""}))},style:{...i.input,...f.payerNameError?i.inputError:{}}}),f.payerNameError&&d("div",{style:i.error,children:f.payerNameError})]}),d("div",{style:i.buttonSection,children:[d("button",{type:"button",onClick:t,style:i.cancelButton,children:_("取消")}),d("button",{type:"button",onClick:p,style:i.submitButton,children:_("提交审核")})]})]})}function ji(){const e=k("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?"12px 16px":"14px 20px",fontWeight:600,cursor:"pointer",fontSize:e===l.SMALL?14:16},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},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"},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=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=ji(),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 Ji({onConfirm:e,channelCode:t}){const n=qi(),[r,o]=B([]);return q(()=>{if(!t)return;let a=!0;return Wn({code:t}).then(i=>{if(a){if(Array.isArray(i)){o(i.map(s=>String(s)));return}if(i&&typeof i=="object"){const s=[];Object.keys(i).forEach(f=>{const c=i[f];s.push(`${f}: ${c}`)}),o(s);return}o(i?[String(i)]:[])}}).catch(()=>o([])),()=>{a=!1}},[t]),d("div",{style:n.container,children:[d("div",{style:n.header,children:[d("span",{style:n.titleBar}),_("银行转账")]}),r.length>0&&d("div",{style:n.detailCard,children:r.map((a,i)=>{const s=String(a).split(":"),f=s.shift()?.trim()||"",c=s.join(":").trim();return d("div",{style:{...n.row,...i===r.length-1?n.rowLast:{},...i%2===1?n.rowAlt:{}},children:[d("div",{style:n.labelMuted,children:f}),d("div",{style:n.valueStrong,children:c||"-"})]},i)})}),d("button",{type:"button",onClick:e,style:n.confirmButton,children:_("确认转账详情")}),d("div",{style:n.noticeBox,children:_("转账后提交银行回单提示")}),d("div",{style:n.reminderTitle,children:_("温馨提示")}),d("ul",{style:n.reminderList,children:[d("li",{children:_("支付金额匹配提醒")}),d("li",{children:_("保存交易回单提醒")}),d("li",{children:_("查看余额提醒")}),d("li",{children:_("联系客服提醒")}),d("li",{children:_("P卡转账延迟提醒")}),d("li",{children:[_("平台服务费说明")," ",d("a",{href:"#",style:n.link,children:_("费用政策")})," ",_("详情")]})]})]})}function Vi({visible:e,onClose:t,onSubmit:n}){const r=Bi(),[o,a]=B(!1),[i,s]=B({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1});q(()=>{const x=()=>{a(window.innerWidth<=1020)};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]),q(()=>{e||s({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1})},[e]);const f=(x,y)=>{s(S=>({...S,channel:x,paymentType:y,channelError:""}))},c=x=>{s(y=>({...y,amount:x,amountError:""}))},p=x=>{s(y=>({...y,amountError:x}))},u=x=>{s(y=>({...y,currency:x}))},h=async x=>{s(y=>({...y,loading:!0,error:""}));try{await n(x),t()}catch{s(y=>({...y,error:_("提交失败,请重试")}))}finally{s(y=>({...y,loading:!1}))}},b=()=>{console.log("用户确认银行转账详情"),s(x=>({...x,showOfflineUpload:!0}))},g=()=>{s(x=>({...x,showOfflineUpload:!1}))};return d(qn,{visible:e,onClose:t,title:_("在线支付"),width:o?"95%":960,maxWidth:o?"95%":1e3,children:d("div",{style:{...r.wrapper,...o?{gridTemplateColumns:"1fr",gap:16,minWidth:"auto"}:{}},children:[d(Ii,{onChannelChange:f,onAmountChange:c,onCurrencyChange:u,initialAmount:i.amount,initialCurrency:i.currency,initialPaymentType:i.paymentType,amountError:i.amountError}),i.paymentType==="online"?d(zi,{onSubmit:h,amount:i.amount,currency:i.currency,channel:i.channel,loading:i.loading,error:i.error,onAmountError:p}):i.showOfflineUpload?d(Hi,{onBack:g,onCancel:t,currency:i.currency,amount:i.amount,channel:i.channel,onAmountError:p}):d(Ji,{onConfirm:b,channelCode:i.channel})]})})}function Yi(){const[e,t]=B(!1),n=async r=>{const o=await Un({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return d("div",{children:[d(ft,{onClick:()=>t(!0),children:_("在线支付")}),d(Vi,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}He(Yi,"best-payment",["theme"],{shadow:!1});const Yt={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 Gi(){return k("theme")===O.WHITE?Yt.white:Yt.dark}const Ki=({popover:e,children:t,popoverWidth:n,popoverMinWidth:r,offsetY:o,offsetX:a,popoverPosition:i="top"})=>{const s=k("size"),f=n??(s===l.SMALL?200:300),c=r??(s===l.SMALL?150:200),p=o??(s===l.SMALL?8:16),u=a??(s===l.SMALL?8:16),[h,b]=B(!1),[g,x]=B(i),y=me(null),S=me(null),w=Gi(),M=()=>{if(S.current&&(clearTimeout(S.current),S.current=null),i==="top"||i==="bottom")if(y.current){const z=y.current.getBoundingClientRect();i==="top"&&z.top<100?x("bottom"):i==="bottom"&&window.innerHeight-z.bottom<100?x("top"):x(i)}else x(i);else x(i);b(!0)},L=()=>{S.current=window.setTimeout(()=>{b(!1)},120)};let A={position:"absolute",zIndex:999,borderRadius:6,fontSize:s===l.SMALL?12:15,minWidth:c,width:f,padding:s===l.SMALL?"6px 12px":"8px 14px",pointerEvents:"auto",textAlign:"center",animation:"fadeInUp 0.3s",...w.popover},T={position:"absolute",zIndex:11,width:0,height:0};return g==="top"?(A={...A,left:"50%",top:-48,transform:"translateX(-50%)"},T={...T,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:`8px solid ${w.arrow.top}`}):g==="bottom"?(A={...A,left:"50%",top:"100%",marginTop:p,transform:"translateX(-50%)"},T={...T,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${w.arrow.bottom}`}):g==="leftTop"?(A={...A,right:"100%",top:0,marginRight:u,transform:"none"},T={...T,right:-8,top:s===l.SMALL?8:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:`8px solid ${w.arrow.left}`}):g==="rightTop"&&(A={...A,left:"100%",top:0,marginLeft:u,transform:"translateY(0)"},T={...T,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:`8px solid ${w.arrow.right}`}),d("div",{ref:y,style:{position:"relative",display:"inline-block"},onMouseEnter:M,onMouseLeave:L,children:[t,h&&d("div",{style:A,onMouseEnter:M,onMouseLeave:L,children:[e,d("div",{style:T})]})]})};function Xi(){const e=k("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 Zi(){const t=k("theme")===O.WHITE,n=Xi();return t?n.white:n.dark}function Gt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}function Qi(e){const[t,n]=B({currBalance:0,currency:"USD",details:[]}),r=async()=>{try{const i=await Pn(),s=[{label:"",value:i.totalAmount,color:"#15b36b",dot:"#15b36b"},{label:"",value:i.frozenAmount,color:"#f59e0b",dot:"#f59e0b"},...i.isCredit?[{label:"",value:i.creditLimit,color:"#1890ff",dot:"#1890ff"},{label:"",value:i.creditUsed,color:"#ff0000",dot:"#ff0000"}]:[],{label:"",value:i.availableAmount,color:"#1890ff",dot:"#15b36b"}],f={currBalance:i.currBalance,currency:"USD",symbol:"$",details:s};n(f)}catch(i){console.error("获取余额失败:",i)}};q(()=>{r()},[]),q(()=>{const i=()=>{r()};return window.addEventListener("refresh-balance",i),()=>{window.removeEventListener("refresh-balance",i)}},[]);const o=Zi(),a=[{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 d(Ki,{popover:d(ne,{children:[d("div",{style:o.popoverTitle,children:_("余额详情")}),a.map(i=>d("div",{style:o.detailRow,children:[d("span",{style:o.detailLabel,children:[d("span",{style:o.detailDot(i.dot)}),i.label]}),d("span",{style:o.detailValue(i.color),children:Gt(i.value)})]},i.label))]}),popoverPosition:e.popoverPosition||"bottom",children:d("div",{style:o.main,children:[Gt(t.currBalance),d("span",{style:o.currency,children:t.currency})]})})}He(Qi,"best-statistical-balance");const Se={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 ea(e){return k("theme")===O.WHITE?{...Se.white,background:e||Se.white.background}:{...Se.dark,background:e||Se.dark.background}}function ta(e){switch(e){case"small":return{fontSize:"12px",gap:"2px"};case"large":return{fontSize:"18px",gap:"6px"};default:return{fontSize:"14px",gap:"4px"}}}function na({color:e,size:t="medium",children:n}){const[r,o]=B(!1),a=ea(e),i=ta(t),s={...a,...i,display:"flex",alignItems:"center"};return d(ne,{children:[d("style",{children:`
78
+ `,document.head.appendChild(n),t}function qn({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,c]=B(!1),p=yi();q(()=>{xi(p)},[p]);const u=b=>{b.target===b.currentTarget?c(!0):c(!1)},h=b=>{b.target===b.currentTarget&&f&&s&&t(),c(!1)};return e?d("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:h,children:d("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:[d("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&&d("button",{type:"button",onClick:t,style:p.closeBtn,"aria-label":"关闭",children:"×"}),n&&d("div",{style:p.title,children:n})]}),d("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 _i(){const e=k("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 Si(){const e=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=_i(),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 Li=k("size");function wi({visible:e,onClose:t,onSubmit:n}){const[r,o]=B({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[a,i]=B({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}),[s,f]=B("online"),c=Si();q(()=>{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 h=!0;if(o(b=>({...b,amountError:"",rechargeChannelError:""})),r.amount.trim()||(o(b=>({...b,amountError:_("请输入充值金额")})),h=!1),r.rechargeChannel||(o(b=>({...b,rechargeChannelError:_("请选择支付平台")})),h=!1),!!h){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 d(qn,{visible:e,onClose:t,title:_("充值 / 转账"),children:[d("div",{style:{display:"flex",marginBottom:Li===l.SMALL?16:28},children:[d("button",{type:"button",onClick:()=>f("online"),style:c.tabBtn(s==="online",!0),children:_("在线充值")}),d("button",{type:"button",onClick:()=>f("offline"),style:c.tabBtn(s==="offline",!1),children:_("线下转账")})]}),d("div",{style:{display:s==="online"?"block":"none"},children:d("form",{onSubmit:p,children:d(ui,{formState:r,setFormState:o,onClose:t,loading:r.loading})})}),d("div",{style:{display:s==="offline"?"block":"none"},children:d(gi,{formState:a,setFormState:i,onClose:t,loading:a.loading})})]})}function pt(){return(pt=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 Ai=["context","children"];function ki(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,Ai);return cn(t,n)}function Ei(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=ie(ki,pt({},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[Jn(s[i].name)]=s[i].value);for(i=f.length;i--;){var c=t(f[i],null),p=f[i].slot;p?a[p]=ie(Vt,{name:p},c):o[i]=c}var u=r?ie(Vt,null,o):o;return ie(r||n.nodeName.toLowerCase(),a,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?ln:Ie)(this._vdom,this._root)}function Jn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function Ci(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[Jn(e)]=n,this._vdom=cn(this._vdom,r),Ie(this._vdom,this._root)}}function vi(){Ie(this._vdom=null,this._root)}function Vt(e,t){var n=this;return ie("slot",pt({},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 He(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=Ei,o.prototype.attributeChangedCallback=Ci,o.prototype.disconnectedCallback=vi,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 Mi(){const[e,t]=B(!1),n=async r=>{const o=await Un({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return d("div",{children:[d(ft,{onClick:()=>t(!0),children:_("充值/转账")}),d(wi,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}He(Mi,"best-recharge",["theme"],{shadow:!1});function Ti(){const e=k("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 Bi(){const e=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=Ti(),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 Ri(){const e=k("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},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"},methodItem:n=>({padding:"10px 12px",textAlign:"left",borderRadius:8,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",color:"#fff",cursor:"pointer"}),bankItem:n=>({padding:"10px 12px",borderRadius:8,border:`1px solid ${n?"#00E8C6":"#374151"}`,background:n?"#0F2824":"#23262F",textAlign:"left",color:"#fff",cursor:"pointer"})}}}function Fi(){const e=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=Ri(),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 Ii({onChannelChange:e,onAmountChange:t,onCurrencyChange:n,initialAmount:r="",initialCurrency:o="USD",initialPaymentType:a="online",amountError:i=""}){const s=Fi(),c=JSON.parse(sessionStorage.getItem("all_dicts")||"{}")?.currency||[],[p,u]=B([]),[h,b]=B([]),[g,x]=B({currency:o,amount:r,onlineChannel:"",bankChannel:"",paymentType:a,amountError:""});q(()=>{qo({currency:g.currency}).then(L=>{const A=L.onlineChannel||[],T=L.offlineChannel||[];u(A),b(T);const z=A.length>0,N=T?.[0]?.value||"",$=A?.[0]?.value||"",G=z?a:"bank",U=G==="online"?$:N;x(K=>({...K,onlineChannel:$,bankChannel:N,paymentType:G})),U&&e(U,G)})},[g.currency]);function y(L){return L=L.replace(/[^\d.]/g,""),L=L.replace(/\.(?=.*\.)/g,""),L=L.replace(/^(\d+)(\.\d{0,2})?.*$/,"$1$2"),L=L.replace(/^0+(\d)/,"$1"),L.startsWith(".")&&(L="0"+L),L}const S=L=>{x(A=>({...A,currency:L})),n(L)},w=L=>{const A=y(L);x(T=>({...T,amount:A,amountError:""})),t(A)},M=(L,A)=>{x(T=>({...T,[A==="online"?"onlineChannel":"bankChannel"]:L,paymentType:A})),e(L,A)};return d("div",{style:s.left,children:[d("div",{style:s.blockTitle,children:[d("span",{style:s.titleBar}),_("选择支付方式")]}),d("div",{style:s.fieldLabel,children:_("支付币种")}),d("div",{style:s.currencyRow,children:(c||[]).slice(0,4).map(L=>d("button",{type:"button",onClick:()=>S(L.value),style:s.currencyItem(g.currency===L.value),children:L.label}))}),d("div",{style:{height:12}}),d("div",{style:s.fieldLabel,children:[d("span",{style:s.required,children:"*"}),_("支付金额")]}),d("div",{style:s.inputWrapper,children:[d("input",{type:"text",placeholder:_("请输入充值金额"),value:g.amount,onInput:L=>{w(L.target.value)},style:{...s.input,...i?s.inputError:{}}}),d("div",{style:s.inputSuffixAbs,children:g.currency})]}),i&&d("div",{style:s.error,children:i}),d("div",{style:{height:20}}),d("div",{style:s.fieldLabel,children:_("支付方式")}),p.length>0&&d("div",{children:[d("div",{style:s.subTitle,children:_("线上支付")}),d("div",{style:s.methodList,children:p.map(L=>d("button",{type:"button",onClick:()=>M(L.value,"online"),style:s.methodItem(g.onlineChannel===L.value&&g.paymentType==="online"),children:[L.icon&&d("img",{src:L.icon,alt:L.label,style:s.channelIcon}),L.label]}))})]}),d("div",{style:s.subTitle,children:_("银行转账")}),d("div",{style:s.bankList,children:h.map(L=>d("button",{type:"button",onClick:()=>M(L.value,"bank"),style:s.bankItem(g.bankChannel===L.value&&g.paymentType==="bank"),children:[L.icon&&d("img",{src:L.icon,alt:L.label,style:s.channelIcon}),L.label]}))})]})}function Di(){const e=k("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"},reminderTitle:{...t.reminderTitle,color:"#fff"},reminderList:{...t.reminderList,color:"#B5B8BE"}}}}function Oi(){const e=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=Di(),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 zi({onSubmit:e,amount:t,currency:n,channel:r,loading:o=!1,error:a="",onAmountError:i}){const s=Oi(),f=s.right.background==="#181A20",[c,p]=B({amount:t,currency:n,channel:r,loading:o,error:a,amountError:""}),[u,h]=B(null);q(()=>{p(x=>({...x,amount:t,currency:n,channel:r,loading:o,error:a}));const g=setTimeout(()=>{t&&r&&n?$n({channel:r,amount:t,currency:n}).then(x=>h(x)).catch(()=>h(null)):h(null)},300);return()=>clearTimeout(g)},[t,n,r,o,a]);const b=async g=>{g&&g.preventDefault();let x=!0;if(t.trim()||(x=!1,i?.(_("请输入充值金额"))),r||(x=!1,p(y=>({...y,error:_("请选择支付平台")}))),!!x){p(y=>({...y,loading:!0,error:""}));try{await e({amount:t,currency:n,rechargeChannel:r})}finally{p(y=>({...y,loading:!1}))}}};return d("div",{style:s.right,children:[d("div",{style:s.blockTitle,children:[d("span",{style:s.titleBar}),_("在线支付")]}),d("form",{onSubmit:b,children:[d("div",{style:s.inputWrapper,children:[d("input",{type:"text",placeholder:_("支付金额"),value:c.amount,readOnly:!0,disabled:!0,style:{...s.input,...f?s.disabledDark:s.disabled,width:"100%"}}),d("div",{style:s.inputSuffixAbs,children:c.currency})]}),d("button",{type:"submit",disabled:c.loading,style:s.payButton,children:c.loading?_("提交中..."):_("立即支付")})]}),u&&d("div",{style:s.calcBox,children:[d("div",{style:s.calcLine,children:[_("预计支付金额约为:"),d("span",{style:s.calcAmount,children:`$${u.paymentAmount}`}),u.currency]}),d("div",{style:s.calcLine,children:[_("手续费约为:"),d("span",{style:s.calcAmount,children:`$${u.fee}`}),u.currency]}),d("div",{children:_("注:地区/币种/卡类型可能影响手续费,最终以平台为准。")})]}),d("div",{style:s.noticeBox,children:_("请在转账后提交银行回单,否则可能无法及时核验")}),d("div",{style:s.reminderTitle,children:_("温馨提示")}),d("ul",{style:s.reminderList,children:[d("li",{children:_("支付金额须与申请金额一致,请勿多付、少付或分批提交。")}),d("li",{children:_("请妥善保存回单并提供准确的支付时间,否则可能无法核验。")}),d("li",{children:_("工作时间提交4小时内审核,非工作时间将顺延至下一个工作日。")}),d("li",{children:_("如有问题,请联系平台客服。")}),d("li",{children:_("预付充值将收取平台服务费,具体以官方为准。")})]}),c.error&&d("div",{style:s.error,children:c.error})]})}function Pi(){const e=k("size"),t={container:{background:"#fff",borderRadius:8,padding:e===l.SMALL?16:20,width:"100%",maxWidth:"100%",boxSizing:"border-box","@media (max-width: 1020px)":{padding:e===l.SMALL?12:16}},header:{marginBottom:e===l.SMALL?20:24},backButton:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",color:"#1890ff",cursor:"pointer",fontSize:e===l.SMALL?14:16,fontWeight:500},backIcon:{fontSize:e===l.SMALL?16:18},uploadSection:{marginBottom:e===l.SMALL?24:32},uploadArea:{border:"2px dashed #D9D9D9",borderRadius:8,padding:e===l.SMALL?"40px 20px":"60px 30px",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?48:64,marginBottom:e===l.SMALL?12:16},uploadTitle:{fontSize:e===l.SMALL?16:18,fontWeight:600,color:"#222",marginBottom:e===l.SMALL?8:12},uploadHint:{fontSize:e===l.SMALL?13:14,color:"#999"},hiddenInput:{display:"none"},fileList:{marginTop:e===l.SMALL?12:16},fileItem:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:e===l.SMALL?"8px 12px":"10px 16px",background:"#F5F5F5",borderRadius:6,marginBottom:8},fileName:{fontSize:e===l.SMALL?13:14,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?20:24},fieldLabel:{display:"block",fontSize:e===l.SMALL?14:16,fontWeight:500,color:"#222",marginBottom:e===l.SMALL?8:12},required:{color:"#ff4d4f",marginRight:4},inputWrapper:{position:"relative"},input:{width:"100%",padding:e===l.SMALL?"10px 12px":"12px 16px",borderRadius:6,border:"1px solid #D9D9D9",outline:"none",fontSize:e===l.SMALL?14:16,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?12:16,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?16:18,pointerEvents:"none"},currencySuffix:{position:"absolute",right:e===l.SMALL?12:16,top:"50%",transform:"translateY(-50%)",fontSize:e===l.SMALL?14:16,color:"#999",pointerEvents:"none"},buttonSection:{display:"flex",gap:e===l.SMALL?12:16,marginTop:e===l.SMALL?32:40,width:"100%",boxSizing:"border-box","@media (max-width: 600px)":{flexDirection:"column",gap:e===l.SMALL?8:12}},cancelButton:{flex:1,padding:e===l.SMALL?"10px 16px":"12px 20px",borderRadius:6,border:"1px solid #D9D9D9",background:"#fff",color:"#222",fontSize:e===l.SMALL?14:16,fontWeight:500,cursor:"pointer",minWidth:0,boxSizing:"border-box"},submitButton:{flex:1,padding:e===l.SMALL?"10px 16px":"12px 20px",borderRadius:6,border:"none",background:"#1890ff",color:"#fff",fontSize:e===l.SMALL?14:16,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"},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 Ni(){const e=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=Pi(),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}function Ui(){const e=k("theme"),t=k("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"},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 $i(){return Ui()}function Wi({value:e="",placeholder:t=_("请选择日期"),disabled:n=!1,size:r="middle",onChange:o,onFocus:a,onBlur:i,className:s="",style:f={}}){const c=$i(),[p,u]=B(!1),[h,b]=B(e),[g,x]=B(new Date),[y,S]=B(!1),w=me(null),M=E=>{if(!E)return"";const v=new Date(E);return`${v.getFullYear()}-${String(v.getMonth()+1).padStart(2,"0")}-${String(v.getDate()).padStart(2,"0")}`},L=(E,v)=>new Date(E,v+1,0).getDate(),A=(E,v)=>new Date(E,v,1).getDay(),T=()=>{const E=g.getFullYear(),v=g.getMonth(),ce=L(E,v),Gn=A(E,v),de=[],ht=v===0?11:v-1,mt=v===0?E-1:E,gt=L(mt,ht);for(let W=Gn-1;W>=0;W--)de.push({date:gt-W,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${mt}-${String(ht+1).padStart(2,"0")}-${String(gt-W).padStart(2,"0")}`});const Kn=new Date,bt=h?new Date(h):null;for(let W=1;W<=ce;W++){const yt=`${E}-${String(v+1).padStart(2,"0")}-${String(W).padStart(2,"0")}`,xt=new Date(yt);de.push({date:W,isCurrentMonth:!0,isToday:xt.toDateString()===Kn.toDateString(),isSelected:bt&&xt.toDateString()===bt.toDateString(),fullDate:yt})}const Xn=v===11?0:v+1,Zn=v===11?E+1:E,Qn=42-de.length;for(let W=1;W<=Qn;W++)de.push({date:W,isCurrentMonth:!1,isToday:!1,isSelected:!1,fullDate:`${Zn}-${String(Xn+1).padStart(2,"0")}-${String(W).padStart(2,"0")}`});return de},z=E=>{b(E),u(!1),o?.(E)},N=E=>{const v=new Date(g);E==="prev"?v.setMonth(v.getMonth()-1):v.setMonth(v.getMonth()+1),x(v)},$=E=>{const v=new Date(g);E==="prev"?v.setFullYear(v.getFullYear()-1):v.setFullYear(v.getFullYear()+1),x(v)},G=E=>{const v=new Date(g);v.setFullYear(E),x(v),S(!1)},U=()=>{const E=new Date().getFullYear(),v=[];for(let ce=E-50;ce<=E+50;ce++)v.push(ce);return v};q(()=>{const E=v=>{w.current&&!w.current.contains(v.target)&&u(!1)};if(p)return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[p]);const K=T(),Vn=[_("一月"),_("二月"),_("三月"),_("四月"),_("五月"),_("六月"),_("七月"),_("八月"),_("九月"),_("十月"),_("十一月"),_("十二月")],Yn=[_("日"),_("一"),_("二"),_("三"),_("四"),_("五"),_("六")];return d("div",{ref:w,className:`date-picker-container ${s}`,style:{...c.container,...f},children:[d("div",{style:{...c.input,...c[r],...n?c.disabled:{}},onClick:()=>!n&&u(!p),onFocus:a,onBlur:i,children:[d("span",{style:c.inputText,children:h?M(h):t}),d("span",{style:c.calendarIcon,children:"📅"})]}),p&&d("div",{style:c.panel,children:[d("div",{style:c.header,children:[d("button",{type:"button",style:c.navButton,onClick:()=>$("prev"),children:"‹‹"}),d("button",{type:"button",style:c.navButton,onClick:()=>N("prev"),children:"‹"}),d("span",{style:c.monthYear,onClick:()=>S(!y),children:[g.getFullYear(),"年",Vn[g.getMonth()]]}),d("button",{type:"button",style:c.navButton,onClick:()=>N("next"),children:"›"}),d("button",{type:"button",style:c.navButton,onClick:()=>$("next"),children:"››"})]}),y&&d("div",{style:c.yearPicker,children:d("div",{style:c.yearGrid,children:U().map(E=>d("button",{type:"button",style:{...c.yearButton,...E===g.getFullYear()?c.yearSelected:{}},onClick:()=>G(E),children:E},E))})}),d("div",{style:c.weekHeader,children:Yn.map(E=>d("div",{style:c.weekDay,children:E},E))}),d("div",{style:c.calendarGrid,children:K.map((E,v)=>d("button",{type:"button",style:{...c.dayButton,...E.isCurrentMonth?c.dayCurrentMonth:c.dayOtherMonth,...E.isToday?c.dayToday:{},...E.isSelected?c.daySelected:{}},onClick:()=>z(E.fullDate),disabled:n,children:E.date},v))})]})]})}function Hi({onBack:e,onCancel:t,currency:n="USD",amount:r="",channel:o="",onAmountError:a}){const i=Ni(),s=i.container.background==="#181A20",[f,c]=B({urls:[],transferTime:"",transferAmount:r,transactionId:"",payerName:"",filesError:"",timeError:"",amountError:"",transactionIdError:"",payerNameError:""});q(()=>{c(u=>({...u,transferAmount:r}))},[r]);const p=async()=>{let u=!0;if(f.urls.length===0&&(u=!1,c(h=>({...h,filesError:_("请上传银行转账回单")}))),f.transferTime||(u=!1,c(h=>({...h,timeError:_("请选择转账时间")}))),r.trim()||(u=!1,a?.(_("请输入充值金额"))),f.transactionId.trim()||(u=!1,c(h=>({...h,transactionIdError:_("请输入转账交易ID")}))),f.payerName.trim()||(u=!1,c(h=>({...h,payerNameError:_("请输入付款人名称")}))),!!u)try{await Nn({transferDate:f.transferTime,transferNo:f.transactionId,transferChannel:o,voucherUrls:f.urls,payerName:f.payerName}),Re.success(_("提交成功")),t()}finally{c(h=>({...h,loading:!1}))}};return d("div",{style:i.container,children:[d("div",{style:i.header,children:d("button",{type:"button",onClick:e,style:i.backButton,children:[d("span",{style:i.backIcon,children:"←"}),_("返回账户信息")]})}),d("div",{style:i.uploadSection,children:[d(jn,{value:f.urls,onChange:u=>{c(h=>({...h,urls:u,filesError:""}))},maxCount:10,accept:"image/*,.pdf",multiple:!0}),f.filesError&&d("div",{style:i.error,children:f.filesError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("转账时间")]}),d(Wi,{value:f.transferTime,placeholder:_("请选择转账时间"),onChange:u=>{c(h=>({...h,transferTime:u,timeError:""}))},style:{width:"100%"}}),f.timeError&&d("div",{style:i.error,children:f.timeError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:_("转账金额")}),d("div",{style:i.inputWrapper,children:[d("input",{type:"text",placeholder:_("请输入实际转账金额"),value:f.transferAmount,readOnly:!0,disabled:!0,style:{...i.input,...s?i.disabledDark:i.disabled}}),d("span",{style:i.currencySuffix,children:n})]})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("交易ID")]}),d("input",{type:"text",placeholder:_("请输入转账交易ID"),value:f.transactionId,onChange:u=>{c(h=>({...h,transactionId:u.target.value,transactionIdError:""}))},style:{...i.input,...f.transactionIdError?i.inputError:{}}}),f.transactionIdError&&d("div",{style:i.error,children:f.transactionIdError})]}),d("div",{style:i.fieldSection,children:[d("label",{style:i.fieldLabel,children:[d("span",{style:i.required,children:"*"}),_("付款人名称")]}),d("input",{type:"text",placeholder:_("请输入付款人名称"),value:f.payerName,onChange:u=>{c(h=>({...h,payerName:u.target.value,payerNameError:""}))},style:{...i.input,...f.payerNameError?i.inputError:{}}}),f.payerNameError&&d("div",{style:i.error,children:f.payerNameError})]}),d("div",{style:i.buttonSection,children:[d("button",{type:"button",onClick:t,style:i.cancelButton,children:_("取消")}),d("button",{type:"button",onClick:p,style:i.submitButton,children:_("提交审核")})]})]})}function ji(){const e=k("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?"12px 16px":"14px 20px",fontWeight:600,cursor:"pointer",fontSize:e===l.SMALL?14:16},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},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"},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=k("theme"),t=k("themeConfig"),n=e===O.WHITE,r=ji(),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 Ji({onConfirm:e,channelCode:t}){const n=qi(),[r,o]=B([]);return q(()=>{if(!t)return;let a=!0;return Wn({code:t}).then(i=>{if(a){if(Array.isArray(i)){o(i.map(s=>String(s)));return}if(i&&typeof i=="object"){const s=[];Object.keys(i).forEach(f=>{const c=i[f];s.push(`${f}: ${c}`)}),o(s);return}o(i?[String(i)]:[])}}).catch(()=>o([])),()=>{a=!1}},[t]),d("div",{style:n.container,children:[d("div",{style:n.header,children:[d("span",{style:n.titleBar}),_("银行转账")]}),r.length>0&&d("div",{style:n.detailCard,children:r.map((a,i)=>{const s=String(a).split(":"),f=s.shift()?.trim()||"",c=s.join(":").trim();return d("div",{style:{...n.row,...i===r.length-1?n.rowLast:{},...i%2===1?n.rowAlt:{}},children:[d("div",{style:n.labelMuted,children:f}),d("div",{style:n.valueStrong,children:c||"-"})]},i)})}),d("button",{type:"button",onClick:e,style:n.confirmButton,children:_("确认转账详情")}),d("div",{style:n.noticeBox,children:_("转账后提交银行回单提示")}),d("div",{style:n.reminderTitle,children:_("温馨提示")}),d("ul",{style:n.reminderList,children:[d("li",{children:_("支付金额匹配提醒")}),d("li",{children:_("保存交易回单提醒")}),d("li",{children:_("查看余额提醒")}),d("li",{children:_("联系客服提醒")}),d("li",{children:_("P卡转账延迟提醒")}),d("li",{children:[_("平台服务费说明")," ",d("a",{href:"#",style:n.link,children:_("费用政策")})," ",_("详情")]})]})]})}function Vi({visible:e,onClose:t,onSubmit:n}){const r=Bi(),[o,a]=B(!1),[i,s]=B({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1});q(()=>{const x=()=>{a(window.innerWidth<=1020)};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]),q(()=>{e||s({currency:"USD",amount:"",channel:"",paymentType:"online",loading:!1,error:"",amountError:"",channelError:"",showOfflineUpload:!1})},[e]);const f=(x,y)=>{s(S=>({...S,channel:x,paymentType:y,channelError:""}))},c=x=>{s(y=>({...y,amount:x,amountError:""}))},p=x=>{s(y=>({...y,amountError:x}))},u=x=>{s(y=>({...y,currency:x}))},h=async x=>{s(y=>({...y,loading:!0,error:""}));try{await n(x),t()}catch{s(y=>({...y,error:_("提交失败,请重试")}))}finally{s(y=>({...y,loading:!1}))}},b=()=>{console.log("用户确认银行转账详情"),s(x=>({...x,showOfflineUpload:!0}))},g=()=>{s(x=>({...x,showOfflineUpload:!1}))};return d(qn,{visible:e,onClose:t,title:_("在线支付"),width:o?"95%":960,maxWidth:o?"95%":1e3,children:d("div",{style:{...r.wrapper,...o?{gridTemplateColumns:"1fr",gap:16,minWidth:"auto"}:{}},children:[d(Ii,{onChannelChange:f,onAmountChange:c,onCurrencyChange:u,initialAmount:i.amount,initialCurrency:i.currency,initialPaymentType:i.paymentType,amountError:i.amountError}),i.paymentType==="online"?d(zi,{onSubmit:h,amount:i.amount,currency:i.currency,channel:i.channel,loading:i.loading,error:i.error,onAmountError:p}):i.showOfflineUpload?d(Hi,{onBack:g,onCancel:t,currency:i.currency,amount:i.amount,channel:i.channel,onAmountError:p}):d(Ji,{onConfirm:b,channelCode:i.channel})]})})}function Yi(){const[e,t]=B(!1),n=async r=>{const o=await Un({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return d("div",{children:[d(ft,{onClick:()=>t(!0),children:_("在线支付")}),d(Vi,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}He(Yi,"best-payment",["theme"],{shadow:!1});const Yt={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 Gi(){return k("theme")===O.WHITE?Yt.white:Yt.dark}const Ki=({popover:e,children:t,popoverWidth:n,popoverMinWidth:r,offsetY:o,offsetX:a,popoverPosition:i="top"})=>{const s=k("size"),f=n??(s===l.SMALL?200:300),c=r??(s===l.SMALL?150:200),p=o??(s===l.SMALL?8:16),u=a??(s===l.SMALL?8:16),[h,b]=B(!1),[g,x]=B(i),y=me(null),S=me(null),w=Gi(),M=()=>{if(S.current&&(clearTimeout(S.current),S.current=null),i==="top"||i==="bottom")if(y.current){const z=y.current.getBoundingClientRect();i==="top"&&z.top<100?x("bottom"):i==="bottom"&&window.innerHeight-z.bottom<100?x("top"):x(i)}else x(i);else x(i);b(!0)},L=()=>{S.current=window.setTimeout(()=>{b(!1)},120)};let A={position:"absolute",zIndex:999,borderRadius:6,fontSize:s===l.SMALL?12:15,minWidth:c,width:f,padding:s===l.SMALL?"6px 12px":"8px 14px",pointerEvents:"auto",textAlign:"center",animation:"fadeInUp 0.3s",...w.popover},T={position:"absolute",zIndex:11,width:0,height:0};return g==="top"?(A={...A,left:"50%",top:-48,transform:"translateX(-50%)"},T={...T,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:`8px solid ${w.arrow.top}`}):g==="bottom"?(A={...A,left:"50%",top:"100%",marginTop:p,transform:"translateX(-50%)"},T={...T,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${w.arrow.bottom}`}):g==="leftTop"?(A={...A,right:"100%",top:0,marginRight:u,transform:"none"},T={...T,right:-8,top:s===l.SMALL?8:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:`8px solid ${w.arrow.left}`}):g==="rightTop"&&(A={...A,left:"100%",top:0,marginLeft:u,transform:"translateY(0)"},T={...T,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:`8px solid ${w.arrow.right}`}),d("div",{ref:y,style:{position:"relative",display:"inline-block"},onMouseEnter:M,onMouseLeave:L,children:[t,h&&d("div",{style:A,onMouseEnter:M,onMouseLeave:L,children:[e,d("div",{style:T})]})]})};function Xi(){const e=k("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 Zi(){const t=k("theme")===O.WHITE,n=Xi();return t?n.white:n.dark}function Gt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}function Qi(e){const[t,n]=B({currBalance:0,currency:"USD",details:[]}),r=async()=>{try{const i=await Pn(),s=[{label:"",value:i.totalAmount,color:"#15b36b",dot:"#15b36b"},{label:"",value:i.frozenAmount,color:"#f59e0b",dot:"#f59e0b"},...i.isCredit?[{label:"",value:i.creditLimit,color:"#1890ff",dot:"#1890ff"},{label:"",value:i.creditUsed,color:"#ff0000",dot:"#ff0000"}]:[],{label:"",value:i.availableAmount,color:"#1890ff",dot:"#15b36b"}],f={currBalance:i.currBalance,currency:"USD",symbol:"$",details:s};n(f)}catch(i){console.error("获取余额失败:",i)}};q(()=>{r()},[]),q(()=>{const i=()=>{r()};return window.addEventListener("refresh-balance",i),()=>{window.removeEventListener("refresh-balance",i)}},[]);const o=Zi(),a=[{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 d(Ki,{popover:d(ne,{children:[d("div",{style:o.popoverTitle,children:_("余额详情")}),a.map(i=>d("div",{style:o.detailRow,children:[d("span",{style:o.detailLabel,children:[d("span",{style:o.detailDot(i.dot)}),i.label]}),d("span",{style:o.detailValue(i.color),children:Gt(i.value)})]},i.label))]}),popoverPosition:e.popoverPosition||"bottom",children:d("div",{style:o.main,children:[Gt(t.currBalance),d("span",{style:o.currency,children:t.currency})]})})}He(Qi,"best-statistical-balance");const Se={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 ea(e){return k("theme")===O.WHITE?{...Se.white,background:e||Se.white.background}:{...Se.dark,background:e||Se.dark.background}}function ta(e){switch(e){case"small":return{fontSize:"12px",gap:"2px"};case"large":return{fontSize:"18px",gap:"6px"};default:return{fontSize:"14px",gap:"4px"}}}function na({color:e,size:t="medium",children:n}){const[r,o]=B(!1),a=ea(e),i=ta(t),s={...a,...i,display:"flex",alignItems:"center"};return d(ne,{children:[d("style",{children:`
79
79
  @keyframes spin {
80
80
  from {
81
81
  transform: rotate(0deg);
package/dist/best-unit.js CHANGED
@@ -5126,7 +5126,13 @@ function Ti() {
5126
5126
  paddingLeft: 18,
5127
5127
  color: "#6b7280",
5128
5128
  lineHeight: 1.6,
5129
- textAlign: "left"
5129
+ textAlign: "left",
5130
+ listStyleType: "disc",
5131
+ listStylePosition: "outside"
5132
+ },
5133
+ listItem: {
5134
+ listStyleType: "disc",
5135
+ listStylePosition: "outside"
5130
5136
  },
5131
5137
  error: {
5132
5138
  color: "#ff4d4f",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "best-unit",
3
3
  "private": false,
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "type": "module",
6
6
  "main": "dist/best-unit.cjs",
7
7
  "module": "dist/best-unit.js",
@@ -98,6 +98,12 @@ function createOnlinePaymentThemes() {
98
98
  color: "#6b7280",
99
99
  lineHeight: 1.6,
100
100
  textAlign: "left",
101
+ listStyleType: "disc",
102
+ listStylePosition: "outside",
103
+ },
104
+ listItem: {
105
+ listStyleType: "disc",
106
+ listStylePosition: "outside",
101
107
  },
102
108
  error: {
103
109
  color: "#ff4d4f",