best-unit 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/best-unit.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function He(){console.log("npm package test!!!")}function Ae(){console.log("Current time:",new Date().toISOString())}var H,g,me,w,le,be,xe,Ee,Z,K,Q,D={},ke=[],Ne=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,G=Array.isArray;function C(e,n){for(var r in n)e[r]=n[r];return e}function ee(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function S(e,n,r){var t,l,o,_={};for(o in n)o=="key"?t=n[o]:o=="ref"?l=n[o]:_[o]=n[o];if(arguments.length>2&&(_.children=arguments.length>3?H.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)_[o]===void 0&&(_[o]=e.defaultProps[o]);return I(e,_,t,l,null)}function I(e,n,r,t,l){var o={type:e,props:n,key:r,ref:t,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++me,__i:-1,__u:0};return l==null&&g.vnode!=null&&g.vnode(o),o}function A(e){return e.children}function O(e,n){this.props=e,this.context=n}function B(e,n){if(n==null)return e.__?B(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?B(e):null}function Ce(e){var n,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Ce(e)}}function _e(e){(!e.__d&&(e.__d=!0)&&w.push(e)&&!W.__r++||le!=g.debounceRendering)&&((le=g.debounceRendering)||be)(W)}function W(){for(var e,n,r,t,l,o,_,a=1;w.length;)w.length>a&&w.sort(xe),e=w.shift(),a=w.length,e.__d&&(r=void 0,l=(t=(n=e).__v).__e,o=[],_=[],n.__P&&((r=C({},t)).__v=t.__v+1,g.vnode&&g.vnode(r),ne(n.__P,r,t,n.__n,n.__P.namespaceURI,32&t.__u?[l]:null,o,l??B(t),!!(32&t.__u),_),r.__v=t.__v,r.__.__k[r.__i]=r,Se(o,r,_),r.__e!=l&&Ce(r)));W.__r=0}function Fe(e,n,r,t,l,o,_,a,f,s,p){var i,d,c,h,E,x,v=t&&t.__k||ke,y=n.length;for(f=Ue(r,n,v,f,y),i=0;i<y;i++)(c=r.__k[i])!=null&&(d=c.__i==-1?D:v[c.__i]||D,c.__i=i,x=ne(e,c,d,l,o,_,a,f,s,p),h=c.__e,c.ref&&d.ref!=c.ref&&(d.ref&&re(d.ref,null,c),p.push(c.ref,c.__c||h,c)),E==null&&h!=null&&(E=h),4&c.__u||d.__k===c.__k?f=we(c,f,e):typeof c.type=="function"&&x!==void 0?f=x:h&&(f=h.nextSibling),c.__u&=-7);return r.__e=E,f}function Ue(e,n,r,t,l){var o,_,a,f,s,p=r.length,i=p,d=0;for(e.__k=new Array(l),o=0;o<l;o++)(_=n[o])!=null&&typeof _!="boolean"&&typeof _!="function"?(f=o+d,(_=e.__k[o]=typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?I(null,_,null,null,null):G(_)?I(A,{children:_},null,null,null):_.constructor==null&&_.__b>0?I(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_).__=e,_.__b=e.__b+1,a=null,(s=_.__i=Me(_,r,f,i))!=-1&&(i--,(a=r[s])&&(a.__u|=2)),a==null||a.__v==null?(s==-1&&(l>p?d--:l<p&&d++),typeof _.type!="function"&&(_.__u|=4)):s!=f&&(s==f-1?d--:s==f+1?d++:(s>f?d--:d++,_.__u|=4))):e.__k[o]=null;if(i)for(o=0;o<p;o++)(a=r[o])!=null&&(2&a.__u)==0&&(a.__e==t&&(t=B(a)),$e(a,a));return t}function we(e,n,r){var t,l;if(typeof e.type=="function"){for(t=e.__k,l=0;t&&l<t.length;l++)t[l]&&(t[l].__=e,n=we(t[l],n,r));return n}e.__e!=n&&(n&&e.type&&!r.contains(n)&&(n=B(e)),r.insertBefore(e.__e,n||null),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function Me(e,n,r,t){var l,o,_=e.key,a=e.type,f=n[r];if(f===null&&e.key==null||f&&_==f.key&&a==f.type&&(2&f.__u)==0)return r;if(t>(f!=null&&(2&f.__u)==0?1:0))for(l=r-1,o=r+1;l>=0||o<n.length;){if(l>=0){if((f=n[l])&&(2&f.__u)==0&&_==f.key&&a==f.type)return l;l--}if(o<n.length){if((f=n[o])&&(2&f.__u)==0&&_==f.key&&a==f.type)return o;o++}}return-1}function ae(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||Ne.test(n)?r:r+"px"}function M(e,n,r,t,l){var o,_;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof t=="string"&&(e.style.cssText=t=""),t)for(n in t)r&&n in r||ae(e.style,n,"");if(r)for(n in r)t&&r[n]==t[n]||ae(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")o=n!=(n=n.replace(Ee,"$1")),_=n.toLowerCase(),n=_ in e||n=="onFocusOut"||n=="onFocusIn"?_.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+o]=r,r?t?r.u=t.u:(r.u=Z,e.addEventListener(n,o?Q:K,o)):e.removeEventListener(n,o?Q:K,o);else{if(l=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function ce(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=Z++;else if(n.t<r.u)return;return r(g.event?g.event(n):n)}}}function ne(e,n,r,t,l,o,_,a,f,s){var p,i,d,c,h,E,x,v,y,$,F,N,z,ie,U,P,J,k=n.type;if(n.constructor!=null)return null;128&r.__u&&(f=!!(32&r.__u),o=[a=n.__e=r.__e]),(p=g.__b)&&p(n);e:if(typeof k=="function")try{if(v=n.props,y="prototype"in k&&k.prototype.render,$=(p=k.contextType)&&t[p.__c],F=p?$?$.props.value:p.__:t,r.__c?x=(i=n.__c=r.__c).__=i.__E:(y?n.__c=i=new k(v,F):(n.__c=i=new O(v,F),i.constructor=k,i.render=je),$&&$.sub(i),i.props=v,i.state||(i.state={}),i.context=F,i.__n=t,d=i.__d=!0,i.__h=[],i._sb=[]),y&&i.__s==null&&(i.__s=i.state),y&&k.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=C({},i.__s)),C(i.__s,k.getDerivedStateFromProps(v,i.__s))),c=i.props,h=i.state,i.__v=n,d)y&&k.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),y&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(y&&k.getDerivedStateFromProps==null&&v!==c&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(v,F),!i.__e&&i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(v,i.__s,F)===!1||n.__v==r.__v){for(n.__v!=r.__v&&(i.props=v,i.state=i.__s,i.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(T){T&&(T.__=n)}),N=0;N<i._sb.length;N++)i.__h.push(i._sb[N]);i._sb=[],i.__h.length&&_.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(v,i.__s,F),y&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(c,h,E)})}if(i.context=F,i.props=v,i.__P=e,i.__e=!1,z=g.__r,ie=0,y){for(i.state=i.__s,i.__d=!1,z&&z(n),p=i.render(i.props,i.state,i.context),U=0;U<i._sb.length;U++)i.__h.push(i._sb[U]);i._sb=[]}else do i.__d=!1,z&&z(n),p=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++ie<25);i.state=i.__s,i.getChildContext!=null&&(t=C(C({},t),i.getChildContext())),y&&!d&&i.getSnapshotBeforeUpdate!=null&&(E=i.getSnapshotBeforeUpdate(c,h)),P=p,p!=null&&p.type===A&&p.key==null&&(P=Be(p.props.children)),a=Fe(e,G(P)?P:[P],n,r,t,l,o,_,a,f,s),i.base=n.__e,n.__u&=-161,i.__h.length&&_.push(i),x&&(i.__E=i.__=null)}catch(T){if(n.__v=null,f||o!=null)if(T.then){for(n.__u|=f?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,n.__e=a}else for(J=o.length;J--;)ee(o[J]);else n.__e=r.__e,n.__k=r.__k;g.__e(T,n,r)}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):a=n.__e=Oe(r.__e,n,r,t,l,o,_,f,s);return(p=g.diffed)&&p(n),128&n.__u?void 0:a}function Se(e,n,r){for(var t=0;t<r.length;t++)re(r[t],r[++t],r[++t]);g.__c&&g.__c(n,e),e.some(function(l){try{e=l.__h,l.__h=[],e.some(function(o){o.call(l)})}catch(o){g.__e(o,l.__v)}})}function Be(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:G(e)?e.map(Be):C({},e)}function Oe(e,n,r,t,l,o,_,a,f){var s,p,i,d,c,h,E,x=r.props,v=n.props,y=n.type;if(y=="svg"?l="http://www.w3.org/2000/svg":y=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((c=o[s])&&"setAttribute"in c==!!y&&(y?c.localName==y:c.nodeType==3)){e=c,o[s]=null;break}}if(e==null){if(y==null)return document.createTextNode(v);e=document.createElementNS(l,y,v.is&&v),a&&(g.__m&&g.__m(n,o),a=!1),o=null}if(y==null)x===v||a&&e.data==v||(e.data=v);else{if(o=o&&H.call(e.childNodes),x=r.props||D,!a&&o!=null)for(x={},s=0;s<e.attributes.length;s++)x[(c=e.attributes[s]).name]=c.value;for(s in x)if(c=x[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=c;else if(!(s in v)){if(s=="value"&&"defaultValue"in v||s=="checked"&&"defaultChecked"in v)continue;M(e,s,null,c,l)}}for(s in v)c=v[s],s=="children"?d=c:s=="dangerouslySetInnerHTML"?p=c:s=="value"?h=c:s=="checked"?E=c:a&&typeof c!="function"||x[s]===c||M(e,s,c,x[s],l);if(p)a||i&&(p.__html==i.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),n.__k=[];else if(i&&(e.innerHTML=""),Fe(n.type=="template"?e.content:e,G(d)?d:[d],n,r,t,y=="foreignObject"?"http://www.w3.org/1999/xhtml":l,o,_,o?o[0]:r.__k&&B(r,0),a,f),o!=null)for(s=o.length;s--;)ee(o[s]);a||(s="value",y=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[s]||y=="progress"&&!h||y=="option"&&h!=x[s])&&M(e,s,h,x[s],l),s="checked",E!=null&&E!=e[s]&&M(e,s,E,x[s],l))}return e}function re(e,n,r){try{if(typeof e=="function"){var t=typeof e.__u=="function";t&&e.__u(),t&&n==null||(e.__u=e(n))}else e.current=n}catch(l){g.__e(l,r)}}function $e(e,n,r){var t,l;if(g.unmount&&g.unmount(e),(t=e.ref)&&(t.current&&t.current!=e.__e||re(t,null,n)),(t=e.__c)!=null){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(o){g.__e(o,n)}t.base=t.__P=null}if(t=e.__k)for(l=0;l<t.length;l++)t[l]&&$e(t[l],n,r||typeof e.type!="function");r||ee(e.__e),e.__c=e.__=e.__e=void 0}function je(e,n,r){return this.constructor(e,r)}function V(e,n,r){var t,l,o,_;n==document&&(n=document.documentElement),g.__&&g.__(e,n),l=(t=typeof r=="function")?null:r&&r.__k||n.__k,o=[],_=[],ne(n,e=(!t&&r||n).__k=S(A,null,[e]),l||D,D,n.namespaceURI,!t&&r?[r]:l?null:n.firstChild?H.call(n.childNodes):null,o,!t&&r?r:l?l.__e:n.firstChild,t,_),Se(o,e,_)}function ze(e,n){V(e,n,ze)}function Pe(e,n,r){var t,l,o,_,a=C({},e.props);for(o in e.type&&e.type.defaultProps&&(_=e.type.defaultProps),n)o=="key"?t=n[o]:o=="ref"?l=n[o]:a[o]=n[o]===void 0&&_!=null?_[o]:n[o];return arguments.length>2&&(a.children=arguments.length>3?H.call(arguments,2):r),I(e.type,a,t||e.key,l||e.ref,null)}H=ke.slice,g={__e:function(e,n,r,t){for(var l,o,_;n=n.__;)if((l=n.__c)&&!l.__)try{if((o=l.constructor)&&o.getDerivedStateFromError!=null&&(l.setState(o.getDerivedStateFromError(e)),_=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(e,t||{}),_=l.__d),_)return l.__E=l}catch(a){e=a}throw e}},me=0,O.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=C({},this.state),typeof e=="function"&&(e=e(C({},r),this.props)),e&&C(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),_e(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_e(this))},O.prototype.render=A,w=[],be=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xe=function(e,n){return e.__v.__b-n.__v.__b},W.__r=0,Ee=/(PointerCapture)$|Capture$/i,Z=0,K=ce(!1),Q=ce(!0);var Le=0;function u(e,n,r,t,l,o){n||(n={});var _,a,f=n;if("ref"in f)for(a in f={},n)a=="ref"?_=n[a]:f[a]=n[a];var s={type:e,props:f,key:r,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Le,__i:-1,__u:0,__source:l,__self:o};if(typeof e=="function"&&(_=e.defaultProps))for(a in _)f[a]===void 0&&(f[a]=_[a]);return g.vnode&&g.vnode(s),s}var R,m,Y,se,q=0,Te=[],b=g,ue=b.__b,fe=b.__r,de=b.diffed,pe=b.__c,he=b.unmount,ge=b.__;function te(e,n){b.__h&&b.__h(m,e,q||n),q=0;var r=m.__H||(m.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function j(e){return q=1,We(De,e)}function We(e,n,r){var t=te(R++,2);if(t.t=e,!t.__c&&(t.__=[De(void 0,n),function(a){var f=t.__N?t.__N[0]:t.__[0],s=t.t(f,a);f!==s&&(t.__N=[s,t.__[1]],t.__c.setState({}))}],t.__c=m,!m.__f)){var l=function(a,f,s){if(!t.__c.__H)return!0;var p=t.__c.__H.__.filter(function(d){return!!d.__c});if(p.every(function(d){return!d.__N}))return!o||o.call(this,a,f,s);var i=t.__c.props!==a;return p.forEach(function(d){if(d.__N){var c=d.__[0];d.__=d.__N,d.__N=void 0,c!==d.__[0]&&(i=!0)}}),o&&o.call(this,a,f,s)||i};m.__f=!0;var o=m.shouldComponentUpdate,_=m.componentWillUpdate;m.componentWillUpdate=function(a,f,s){if(this.__e){var p=o;o=void 0,l(a,f,s),o=p}_&&_.call(this,a,f,s)},m.shouldComponentUpdate=l}return t.__N||t.__}function qe(e,n){var r=te(R++,3);!b.__s&&Ie(r.__H,n)&&(r.__=e,r.u=n,m.__H.__h.push(r))}function Ge(e){return q=5,Ve(function(){return{current:e}},[])}function Ve(e,n){var r=te(R++,7);return Ie(r.__H,n)&&(r.__=e(),r.__H=n,r.__h=e),r.__}function Je(){for(var e;e=Te.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(L),e.__H.__h.forEach(X),e.__H.__h=[]}catch(n){e.__H.__h=[],b.__e(n,e.__v)}}b.__b=function(e){m=null,ue&&ue(e)},b.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),ge&&ge(e,n)},b.__r=function(e){fe&&fe(e),R=0;var n=(m=e.__c).__H;n&&(Y===m?(n.__h=[],m.__h=[],n.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(n.__h.forEach(L),n.__h.forEach(X),n.__h=[],R=0)),Y=m},b.diffed=function(e){de&&de(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(Te.push(n)!==1&&se===b.requestAnimationFrame||((se=b.requestAnimationFrame)||Ye)(Je)),n.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Y=m=null},b.__c=function(e,n){n.some(function(r){try{r.__h.forEach(L),r.__h=r.__h.filter(function(t){return!t.__||X(t)})}catch(t){n.some(function(l){l.__h&&(l.__h=[])}),n=[],b.__e(t,r.__v)}}),pe&&pe(e,n)},b.unmount=function(e){he&&he(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(t){try{L(t)}catch(l){n=l}}),r.__H=void 0,n&&b.__e(n,r.__v))};var ve=typeof requestAnimationFrame=="function";function Ye(e){var n,r=function(){clearTimeout(t),ve&&cancelAnimationFrame(n),setTimeout(e)},t=setTimeout(r,35);ve&&(n=requestAnimationFrame(r))}function L(e){var n=m,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),m=n}function X(e){var n=m;e.__c=e.__(),m=n}function Ie(e,n){return!e||e.length!==n.length||n.some(function(r,t){return r!==e[t]})}function De(e,n){return typeof n=="function"?n(e):n}function Ke({onClick:e,color:n,children:r}){return u("button",{style:{background:n||"#1890ff",color:"#fff",border:"none",borderRadius:4,padding:"8px 16px",cursor:"pointer",fontSize:16},onClick:e,children:r})}const Qe=({formState:e,setFormState:n,onClose:r,loading:t,whiteTheme:l=!1})=>{const o=l?{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:e.amountError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0}:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:e.amountError?"1px solid #ff4d4f":"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},_=l?{width:"100%",padding:"10px 12px",borderRadius:6,border:e.rechargeChannelError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"}:{width:"100%",padding:"10px 12px",borderRadius:6,border:e.rechargeChannelError?"1px solid #ff4d4f":"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},a=l?{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"}:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},f=l?{marginBottom:8,fontSize:14,color:"#222"}:{marginBottom:8,fontSize:14},s={color:"#ff4d4f",fontSize:13,marginTop:4},p=l?{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"}:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},i=l?{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600}:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600};return u(A,{children:[u("div",{style:{marginBottom:18},children:[u("div",{style:f,children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 充值币种"]}),u("select",{style:a,value:e.currency,onInput:d=>{const c=d.target.value;n(h=>({...h,currency:c}))},children:[u("option",{value:"USD",children:"USD - 美元"}),u("option",{value:"CNY",children:"CNY - 人民币"}),u("option",{value:"EUR",children:"EUR - 欧元"})]})]}),u("div",{style:{marginBottom:18},children:[u("div",{style:f,children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 充值金额"]}),u("input",{type:"text",placeholder:"请输入充值金额",value:e.amount,onInput:d=>{const c=d.target.value;n(h=>({...h,amount:c,amountError:c.trim()?"":h.amountError}))},style:o}),e.amountError&&u("div",{style:s,children:e.amountError})]}),u("div",{style:{marginBottom:24},children:[u("div",{style:f,children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 支付平台"]}),u("select",{style:_,value:e.rechargeChannel,onInput:d=>{const c=d.target.value;n(h=>({...h,rechargeChannel:c,rechargeChannelError:c?"":h.rechargeChannelError}))},children:[u("option",{value:"alipay",children:"支付宝"}),u("option",{value:"wechat",children:"微信"}),u("option",{value:"paypal",children:"PayPal"})]}),e.rechargeChannelError&&u("div",{style:s,children:e.rechargeChannelError})]}),e.error&&u("div",{style:{color:"#ff4d4f",marginBottom:12},children:e.error}),u("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[u("button",{type:"button",onClick:r,style:p,children:"取消"}),u("button",{type:"submit",disabled:t,style:i,children:t?"提交中...":"去支付"})]})]})},Xe=({formState:e,setFormState:n,onClose:r,loading:t})=>{const l=Ge(null),o=i=>{const d=Array.from(i.target.files).slice(0,10);n(c=>({...c,files:d,filesError:""}))},_=i=>{i.preventDefault();const d=Array.from(i.dataTransfer.files).slice(0,10);n(c=>({...c,files:d,filesError:""}))},a=i=>{i.preventDefault()},f=i=>{n(d=>({...d,files:d.files.filter((c,h)=>h!==i)}))},s=i=>{i.preventDefault();let d=!0;n(c=>({...c,platformError:"",transactionIdError:"",filesError:""})),e.platform||(n(c=>({...c,platformError:"请选择支付平台"})),d=!1),e.transactionId.trim()||(n(c=>({...c,transactionIdError:"请输入转账交易ID"})),d=!1),(!e.files||e.files.length===0)&&(n(c=>({...c,filesError:"请上传转账凭证"})),d=!1),d&&console.log("OfflineTransferForm values:",e)},p=i=>i>1024*1024?(i/1024/1024).toFixed(2)+" MB":i>1024?(i/1024).toFixed(2)+" KB":i+" B";return u("form",{onSubmit:s,children:[u("div",{style:{marginBottom:18},children:[u("div",{style:{marginBottom:8,fontSize:14,color:"#222"},children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 第三方支付平台"]}),u("select",{style:{width:"100%",padding:"10px 12px",borderRadius:6,border:e.platformError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},value:e.platform,onInput:i=>{const d=i.target.value;n(c=>({...c,platform:d,platformError:d?"":c.platformError}))},children:[u("option",{value:"paypal",children:"PayPal"}),u("option",{value:"alipay",children:"支付宝"}),u("option",{value:"wechat",children:"微信"})]}),e.platformError&&u("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:e.platformError})]}),u("div",{style:{marginBottom:18},children:[u("div",{style:{marginBottom:8,fontSize:14,color:"#222"},children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 交易ID"]}),u("input",{type:"text",placeholder:"请输入转账交易ID",value:e.transactionId,onInput:i=>{const d=i.target.value;n(c=>({...c,transactionId:d,transactionIdError:d?"":c.transactionIdError}))},style:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:e.transactionIdError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0}}),e.transactionIdError&&u("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:e.transactionIdError})]}),u("div",{style:{marginBottom:24},children:[u("div",{style:{marginBottom:8,fontSize:14,color:"#222"},children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 上传文件"]}),u("div",{style:{border:e.filesError?"1px dashed #ff4d4f":"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:24,textAlign:"center",cursor:"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15},onClick:()=>l.current?.click(),onDrop:_,onDragOver:a,children:[u("div",{style:{fontSize:48,marginBottom:12},children:u("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",children:[u("rect",{x:"8",y:"8",width:"48",height:"48",rx:"12",fill:"#F4F6FA"}),u("rect",{x:"28",y:"20",width:"8",height:"24",rx:"4",fill:"#E5E6EB"})]})}),u("div",{style:{color:"#222",fontSize:15,marginBottom:4},children:"点击或拖拽文件到此处上传"}),u("div",{style:{color:"#999",fontSize:13},children:"支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传 10 个文件"}),u("input",{ref:l,type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.pdf",style:{display:"none"},onChange:o})]}),e.files&&e.files.length>0&&u("div",{style:{marginTop:12},children:e.files.map((i,d)=>u("div",{style:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#222",justifyContent:"space-between"},children:[u("div",{style:{display:"flex",alignItems:"center",flex:1},children:[u("span",{style:{fontWeight:500},children:i.name}),u("span",{style:{color:"#8C8F93",fontSize:13,marginLeft:8},children:["(",p(i.size),")"]})]}),u("button",{type:"button",onClick:c=>{c.stopPropagation(),f(d)},style:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"},children:"移除"})]},d))}),e.filesError&&u("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:e.filesError})]}),u("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[u("button",{type:"button",onClick:r,style:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},children:"取消"}),u("button",{type:"submit",disabled:t,style:{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},children:"去支付"})]})]})};function Ze({visible:e,onClose:n,onSubmit:r,color:t}){console.log(1111);const[l,o]=j({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[_,a]=j("online"),[f,s]=j({platform:"paypal",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1});return qe(()=>{e||(a("online"),o({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),s({platform:"paypal",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]),e?u("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:d=>{d.target===d.currentTarget&&n()},children:u("form",{onSubmit:async d=>{d.preventDefault();let c=!0;if(o(h=>({...h,amountError:"",rechargeChannelError:""})),l.amount.trim()||(o(h=>({...h,amountError:"请输入充值金额"})),c=!1),l.rechargeChannel||(o(h=>({...h,rechargeChannelError:"请选择支付平台"})),c=!1),!!c){o(h=>({...h,loading:!0,error:""}));try{await r({amount:l.amount,rechargeChannel:l.rechargeChannel,currency:l.currency}),n()}catch{o(h=>({...h,error:"提交失败,请重试"}))}finally{o(h=>({...h,loading:!1}))}}},style:{background:"#fff",padding:32,borderRadius:12,minWidth:400,color:t||"#222",boxShadow:"0 4px 24px rgba(0,0,0,0.08)",position:"relative"},onClick:d=>d.stopPropagation(),children:[u("button",{type:"button",onClick:n,style:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#222",fontSize:22,cursor:"pointer",lineHeight:1},"aria-label":"关闭",children:"×"}),u("div",{style:{fontWeight:600,fontSize:20,marginBottom:24,textAlign:"left",color:"#222"},children:"充值 / 转账"}),u("div",{style:{display:"flex",marginBottom:28},children:[u("button",{type:"button",onClick:()=>a("online"),style:{flex:1,background:_==="online"?"#fff":"#F7F8FA",color:_==="online"?"#155EEF":"#222",border:"none",borderRadius:"8px 0 0 8px",fontWeight:_==="online"?600:400,fontSize:16,height:48,boxShadow:_==="online"?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer",borderRight:"1px solid #F0F1F3",transition:"all 0.2s"},children:"在线充值"}),u("button",{type:"button",onClick:()=>a("offline"),style:{flex:1,background:_==="offline"?"#fff":"#F7F8FA",color:_==="offline"?"#155EEF":"#222",border:"none",borderRadius:"0 8px 8px 0",fontWeight:_==="offline"?600:400,fontSize:16,height:48,boxShadow:_==="offline"?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer",borderLeft:"1px solid #F0F1F3",transition:"all 0.2s"},children:"线下转账"})]}),_==="online"?u(Qe,{formState:l,setFormState:o,onClose:n,loading:l.loading,whiteTheme:!0}):u(Xe,{formState:f,setFormState:s,onClose:n,loading:f.loading})]})}):null}function oe(){return(oe=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}var en=["context","children"];function nn(e){this.getChildContext=function(){return e.context};var n=e.children,r=function(t,l){if(t==null)return{};var o,_,a={},f=Object.keys(t);for(_=0;_<f.length;_++)l.indexOf(o=f[_])>=0||(a[o]=t[o]);return a}(e,en);return Pe(n,r)}function rn(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=S(nn,oe({},this._props,{context:e.detail.context}),function n(r,t){if(r.nodeType===3)return r.data;if(r.nodeType!==1)return null;var l=[],o={},_=0,a=r.attributes,f=r.childNodes;for(_=a.length;_--;)a[_].name!=="slot"&&(o[a[_].name]=a[_].value,o[Re(a[_].name)]=a[_].value);for(_=f.length;_--;){var s=n(f[_],null),p=f[_].slot;p?o[p]=S(ye,{name:p},s):l[_]=s}var i=t?S(ye,null,l):l;return S(t||r.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?ze:V)(this._vdom,this._root)}function Re(e){return e.replace(/-(\w)/g,function(n,r){return r?r.toUpperCase():""})}function tn(e,n,r){if(this._vdom){var t={};t[e]=r=r??void 0,t[Re(e)]=r,this._vdom=Pe(this._vdom,t),V(this._vdom,this._root)}}function on(){V(this._vdom=null,this._root)}function ye(e,n){var r=this;return S("slot",oe({},e,{ref:function(t){t?(r.ref=t,r._listener||(r._listener=function(l){l.stopPropagation(),l.detail.context=n},t.addEventListener("_preact",r._listener))):r.ref.removeEventListener("_preact",r._listener)}}))}function ln(e,n,r,t){function l(){var o=Reflect.construct(HTMLElement,[],l);return o._vdomComponent=e,o._root=o,o}return(l.prototype=Object.create(HTMLElement.prototype)).constructor=l,l.prototype.connectedCallback=rn,l.prototype.attributeChangedCallback=tn,l.prototype.disconnectedCallback=on,r=r||e.observedAttributes||Object.keys(e.propTypes||{}),l.observedAttributes=r,r.forEach(function(o){Object.defineProperty(l.prototype,o,{get:function(){return this._vdom.props[o]},set:function(_){this._vdom?this.attributeChangedCallback(o,null,_):(this._props||(this._props={}),this._props[o]=_,this.connectedCallback());var a=typeof _;_!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(o,_)}})}),customElements.define(n,l)}function _n(e){const[n,r]=j(!1),t=e.theme?.primaryColor;return u("div",{children:[u(Ke,{color:t,onClick:()=>r(!0),children:"打开表单"}),u(Ze,{visible:n,onClose:()=>r(!1),onSubmit:async o=>{console.log("submit",o)},color:t})]})}ln(_n,"x-best-modal-form",["theme"]);const an=["x-greeting","x-best-modal-form"];exports.components=an;exports.npmTest=He;exports.printCurrentTime=Ae;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function He(){console.log("npm package test!!!")}function Ae(){console.log("Current time:",new Date().toISOString())}var H,g,me,w,le,be,xe,Ee,Z,K,Q,D={},ke=[],Ne=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,G=Array.isArray;function C(e,n){for(var r in n)e[r]=n[r];return e}function ee(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function S(e,n,r){var t,l,o,_={};for(o in n)o=="key"?t=n[o]:o=="ref"?l=n[o]:_[o]=n[o];if(arguments.length>2&&(_.children=arguments.length>3?H.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)_[o]===void 0&&(_[o]=e.defaultProps[o]);return I(e,_,t,l,null)}function I(e,n,r,t,l){var o={type:e,props:n,key:r,ref:t,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++me,__i:-1,__u:0};return l==null&&g.vnode!=null&&g.vnode(o),o}function A(e){return e.children}function O(e,n){this.props=e,this.context=n}function B(e,n){if(n==null)return e.__?B(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?B(e):null}function Ce(e){var n,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Ce(e)}}function _e(e){(!e.__d&&(e.__d=!0)&&w.push(e)&&!W.__r++||le!=g.debounceRendering)&&((le=g.debounceRendering)||be)(W)}function W(){for(var e,n,r,t,l,o,_,a=1;w.length;)w.length>a&&w.sort(xe),e=w.shift(),a=w.length,e.__d&&(r=void 0,l=(t=(n=e).__v).__e,o=[],_=[],n.__P&&((r=C({},t)).__v=t.__v+1,g.vnode&&g.vnode(r),ne(n.__P,r,t,n.__n,n.__P.namespaceURI,32&t.__u?[l]:null,o,l??B(t),!!(32&t.__u),_),r.__v=t.__v,r.__.__k[r.__i]=r,Se(o,r,_),r.__e!=l&&Ce(r)));W.__r=0}function Fe(e,n,r,t,l,o,_,a,f,s,p){var i,d,c,h,E,x,y=t&&t.__k||ke,v=n.length;for(f=Ue(r,n,y,f,v),i=0;i<v;i++)(c=r.__k[i])!=null&&(d=c.__i==-1?D:y[c.__i]||D,c.__i=i,x=ne(e,c,d,l,o,_,a,f,s,p),h=c.__e,c.ref&&d.ref!=c.ref&&(d.ref&&re(d.ref,null,c),p.push(c.ref,c.__c||h,c)),E==null&&h!=null&&(E=h),4&c.__u||d.__k===c.__k?f=we(c,f,e):typeof c.type=="function"&&x!==void 0?f=x:h&&(f=h.nextSibling),c.__u&=-7);return r.__e=E,f}function Ue(e,n,r,t,l){var o,_,a,f,s,p=r.length,i=p,d=0;for(e.__k=new Array(l),o=0;o<l;o++)(_=n[o])!=null&&typeof _!="boolean"&&typeof _!="function"?(f=o+d,(_=e.__k[o]=typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?I(null,_,null,null,null):G(_)?I(A,{children:_},null,null,null):_.constructor==null&&_.__b>0?I(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_).__=e,_.__b=e.__b+1,a=null,(s=_.__i=Me(_,r,f,i))!=-1&&(i--,(a=r[s])&&(a.__u|=2)),a==null||a.__v==null?(s==-1&&(l>p?d--:l<p&&d++),typeof _.type!="function"&&(_.__u|=4)):s!=f&&(s==f-1?d--:s==f+1?d++:(s>f?d--:d++,_.__u|=4))):e.__k[o]=null;if(i)for(o=0;o<p;o++)(a=r[o])!=null&&(2&a.__u)==0&&(a.__e==t&&(t=B(a)),$e(a,a));return t}function we(e,n,r){var t,l;if(typeof e.type=="function"){for(t=e.__k,l=0;t&&l<t.length;l++)t[l]&&(t[l].__=e,n=we(t[l],n,r));return n}e.__e!=n&&(n&&e.type&&!r.contains(n)&&(n=B(e)),r.insertBefore(e.__e,n||null),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function Me(e,n,r,t){var l,o,_=e.key,a=e.type,f=n[r];if(f===null&&e.key==null||f&&_==f.key&&a==f.type&&(2&f.__u)==0)return r;if(t>(f!=null&&(2&f.__u)==0?1:0))for(l=r-1,o=r+1;l>=0||o<n.length;){if(l>=0){if((f=n[l])&&(2&f.__u)==0&&_==f.key&&a==f.type)return l;l--}if(o<n.length){if((f=n[o])&&(2&f.__u)==0&&_==f.key&&a==f.type)return o;o++}}return-1}function ae(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||Ne.test(n)?r:r+"px"}function M(e,n,r,t,l){var o,_;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof t=="string"&&(e.style.cssText=t=""),t)for(n in t)r&&n in r||ae(e.style,n,"");if(r)for(n in r)t&&r[n]==t[n]||ae(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")o=n!=(n=n.replace(Ee,"$1")),_=n.toLowerCase(),n=_ in e||n=="onFocusOut"||n=="onFocusIn"?_.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+o]=r,r?t?r.u=t.u:(r.u=Z,e.addEventListener(n,o?Q:K,o)):e.removeEventListener(n,o?Q:K,o);else{if(l=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function ce(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=Z++;else if(n.t<r.u)return;return r(g.event?g.event(n):n)}}}function ne(e,n,r,t,l,o,_,a,f,s){var p,i,d,c,h,E,x,y,v,$,F,N,z,ie,U,P,J,k=n.type;if(n.constructor!=null)return null;128&r.__u&&(f=!!(32&r.__u),o=[a=n.__e=r.__e]),(p=g.__b)&&p(n);e:if(typeof k=="function")try{if(y=n.props,v="prototype"in k&&k.prototype.render,$=(p=k.contextType)&&t[p.__c],F=p?$?$.props.value:p.__:t,r.__c?x=(i=n.__c=r.__c).__=i.__E:(v?n.__c=i=new k(y,F):(n.__c=i=new O(y,F),i.constructor=k,i.render=je),$&&$.sub(i),i.props=y,i.state||(i.state={}),i.context=F,i.__n=t,d=i.__d=!0,i.__h=[],i._sb=[]),v&&i.__s==null&&(i.__s=i.state),v&&k.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=C({},i.__s)),C(i.__s,k.getDerivedStateFromProps(y,i.__s))),c=i.props,h=i.state,i.__v=n,d)v&&k.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),v&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(v&&k.getDerivedStateFromProps==null&&y!==c&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(y,F),!i.__e&&i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(y,i.__s,F)===!1||n.__v==r.__v){for(n.__v!=r.__v&&(i.props=y,i.state=i.__s,i.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(T){T&&(T.__=n)}),N=0;N<i._sb.length;N++)i.__h.push(i._sb[N]);i._sb=[],i.__h.length&&_.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(y,i.__s,F),v&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(c,h,E)})}if(i.context=F,i.props=y,i.__P=e,i.__e=!1,z=g.__r,ie=0,v){for(i.state=i.__s,i.__d=!1,z&&z(n),p=i.render(i.props,i.state,i.context),U=0;U<i._sb.length;U++)i.__h.push(i._sb[U]);i._sb=[]}else do i.__d=!1,z&&z(n),p=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++ie<25);i.state=i.__s,i.getChildContext!=null&&(t=C(C({},t),i.getChildContext())),v&&!d&&i.getSnapshotBeforeUpdate!=null&&(E=i.getSnapshotBeforeUpdate(c,h)),P=p,p!=null&&p.type===A&&p.key==null&&(P=Be(p.props.children)),a=Fe(e,G(P)?P:[P],n,r,t,l,o,_,a,f,s),i.base=n.__e,n.__u&=-161,i.__h.length&&_.push(i),x&&(i.__E=i.__=null)}catch(T){if(n.__v=null,f||o!=null)if(T.then){for(n.__u|=f?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,n.__e=a}else for(J=o.length;J--;)ee(o[J]);else n.__e=r.__e,n.__k=r.__k;g.__e(T,n,r)}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):a=n.__e=Oe(r.__e,n,r,t,l,o,_,f,s);return(p=g.diffed)&&p(n),128&n.__u?void 0:a}function Se(e,n,r){for(var t=0;t<r.length;t++)re(r[t],r[++t],r[++t]);g.__c&&g.__c(n,e),e.some(function(l){try{e=l.__h,l.__h=[],e.some(function(o){o.call(l)})}catch(o){g.__e(o,l.__v)}})}function Be(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:G(e)?e.map(Be):C({},e)}function Oe(e,n,r,t,l,o,_,a,f){var s,p,i,d,c,h,E,x=r.props,y=n.props,v=n.type;if(v=="svg"?l="http://www.w3.org/2000/svg":v=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((c=o[s])&&"setAttribute"in c==!!v&&(v?c.localName==v:c.nodeType==3)){e=c,o[s]=null;break}}if(e==null){if(v==null)return document.createTextNode(y);e=document.createElementNS(l,v,y.is&&y),a&&(g.__m&&g.__m(n,o),a=!1),o=null}if(v==null)x===y||a&&e.data==y||(e.data=y);else{if(o=o&&H.call(e.childNodes),x=r.props||D,!a&&o!=null)for(x={},s=0;s<e.attributes.length;s++)x[(c=e.attributes[s]).name]=c.value;for(s in x)if(c=x[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=c;else if(!(s in y)){if(s=="value"&&"defaultValue"in y||s=="checked"&&"defaultChecked"in y)continue;M(e,s,null,c,l)}}for(s in y)c=y[s],s=="children"?d=c:s=="dangerouslySetInnerHTML"?p=c:s=="value"?h=c:s=="checked"?E=c:a&&typeof c!="function"||x[s]===c||M(e,s,c,x[s],l);if(p)a||i&&(p.__html==i.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),n.__k=[];else if(i&&(e.innerHTML=""),Fe(n.type=="template"?e.content:e,G(d)?d:[d],n,r,t,v=="foreignObject"?"http://www.w3.org/1999/xhtml":l,o,_,o?o[0]:r.__k&&B(r,0),a,f),o!=null)for(s=o.length;s--;)ee(o[s]);a||(s="value",v=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[s]||v=="progress"&&!h||v=="option"&&h!=x[s])&&M(e,s,h,x[s],l),s="checked",E!=null&&E!=e[s]&&M(e,s,E,x[s],l))}return e}function re(e,n,r){try{if(typeof e=="function"){var t=typeof e.__u=="function";t&&e.__u(),t&&n==null||(e.__u=e(n))}else e.current=n}catch(l){g.__e(l,r)}}function $e(e,n,r){var t,l;if(g.unmount&&g.unmount(e),(t=e.ref)&&(t.current&&t.current!=e.__e||re(t,null,n)),(t=e.__c)!=null){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(o){g.__e(o,n)}t.base=t.__P=null}if(t=e.__k)for(l=0;l<t.length;l++)t[l]&&$e(t[l],n,r||typeof e.type!="function");r||ee(e.__e),e.__c=e.__=e.__e=void 0}function je(e,n,r){return this.constructor(e,r)}function V(e,n,r){var t,l,o,_;n==document&&(n=document.documentElement),g.__&&g.__(e,n),l=(t=typeof r=="function")?null:r&&r.__k||n.__k,o=[],_=[],ne(n,e=(!t&&r||n).__k=S(A,null,[e]),l||D,D,n.namespaceURI,!t&&r?[r]:l?null:n.firstChild?H.call(n.childNodes):null,o,!t&&r?r:l?l.__e:n.firstChild,t,_),Se(o,e,_)}function ze(e,n){V(e,n,ze)}function Pe(e,n,r){var t,l,o,_,a=C({},e.props);for(o in e.type&&e.type.defaultProps&&(_=e.type.defaultProps),n)o=="key"?t=n[o]:o=="ref"?l=n[o]:a[o]=n[o]===void 0&&_!=null?_[o]:n[o];return arguments.length>2&&(a.children=arguments.length>3?H.call(arguments,2):r),I(e.type,a,t||e.key,l||e.ref,null)}H=ke.slice,g={__e:function(e,n,r,t){for(var l,o,_;n=n.__;)if((l=n.__c)&&!l.__)try{if((o=l.constructor)&&o.getDerivedStateFromError!=null&&(l.setState(o.getDerivedStateFromError(e)),_=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(e,t||{}),_=l.__d),_)return l.__E=l}catch(a){e=a}throw e}},me=0,O.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=C({},this.state),typeof e=="function"&&(e=e(C({},r),this.props)),e&&C(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),_e(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_e(this))},O.prototype.render=A,w=[],be=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xe=function(e,n){return e.__v.__b-n.__v.__b},W.__r=0,Ee=/(PointerCapture)$|Capture$/i,Z=0,K=ce(!1),Q=ce(!0);var Le=0;function u(e,n,r,t,l,o){n||(n={});var _,a,f=n;if("ref"in f)for(a in f={},n)a=="ref"?_=n[a]:f[a]=n[a];var s={type:e,props:f,key:r,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Le,__i:-1,__u:0,__source:l,__self:o};if(typeof e=="function"&&(_=e.defaultProps))for(a in _)f[a]===void 0&&(f[a]=_[a]);return g.vnode&&g.vnode(s),s}var R,m,Y,se,q=0,Te=[],b=g,ue=b.__b,fe=b.__r,de=b.diffed,pe=b.__c,he=b.unmount,ge=b.__;function te(e,n){b.__h&&b.__h(m,e,q||n),q=0;var r=m.__H||(m.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function j(e){return q=1,We(De,e)}function We(e,n,r){var t=te(R++,2);if(t.t=e,!t.__c&&(t.__=[De(void 0,n),function(a){var f=t.__N?t.__N[0]:t.__[0],s=t.t(f,a);f!==s&&(t.__N=[s,t.__[1]],t.__c.setState({}))}],t.__c=m,!m.__f)){var l=function(a,f,s){if(!t.__c.__H)return!0;var p=t.__c.__H.__.filter(function(d){return!!d.__c});if(p.every(function(d){return!d.__N}))return!o||o.call(this,a,f,s);var i=t.__c.props!==a;return p.forEach(function(d){if(d.__N){var c=d.__[0];d.__=d.__N,d.__N=void 0,c!==d.__[0]&&(i=!0)}}),o&&o.call(this,a,f,s)||i};m.__f=!0;var o=m.shouldComponentUpdate,_=m.componentWillUpdate;m.componentWillUpdate=function(a,f,s){if(this.__e){var p=o;o=void 0,l(a,f,s),o=p}_&&_.call(this,a,f,s)},m.shouldComponentUpdate=l}return t.__N||t.__}function qe(e,n){var r=te(R++,3);!b.__s&&Ie(r.__H,n)&&(r.__=e,r.u=n,m.__H.__h.push(r))}function Ge(e){return q=5,Ve(function(){return{current:e}},[])}function Ve(e,n){var r=te(R++,7);return Ie(r.__H,n)&&(r.__=e(),r.__H=n,r.__h=e),r.__}function Je(){for(var e;e=Te.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(L),e.__H.__h.forEach(X),e.__H.__h=[]}catch(n){e.__H.__h=[],b.__e(n,e.__v)}}b.__b=function(e){m=null,ue&&ue(e)},b.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),ge&&ge(e,n)},b.__r=function(e){fe&&fe(e),R=0;var n=(m=e.__c).__H;n&&(Y===m?(n.__h=[],m.__h=[],n.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(n.__h.forEach(L),n.__h.forEach(X),n.__h=[],R=0)),Y=m},b.diffed=function(e){de&&de(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(Te.push(n)!==1&&se===b.requestAnimationFrame||((se=b.requestAnimationFrame)||Ye)(Je)),n.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Y=m=null},b.__c=function(e,n){n.some(function(r){try{r.__h.forEach(L),r.__h=r.__h.filter(function(t){return!t.__||X(t)})}catch(t){n.some(function(l){l.__h&&(l.__h=[])}),n=[],b.__e(t,r.__v)}}),pe&&pe(e,n)},b.unmount=function(e){he&&he(e);var n,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(t){try{L(t)}catch(l){n=l}}),r.__H=void 0,n&&b.__e(n,r.__v))};var ye=typeof requestAnimationFrame=="function";function Ye(e){var n,r=function(){clearTimeout(t),ye&&cancelAnimationFrame(n),setTimeout(e)},t=setTimeout(r,35);ye&&(n=requestAnimationFrame(r))}function L(e){var n=m,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),m=n}function X(e){var n=m;e.__c=e.__(),m=n}function Ie(e,n){return!e||e.length!==n.length||n.some(function(r,t){return r!==e[t]})}function De(e,n){return typeof n=="function"?n(e):n}function Ke({onClick:e,color:n,children:r}){return u("button",{style:{background:n||"#1890ff",color:"#fff",border:"none",borderRadius:4,padding:"8px 16px",cursor:"pointer",fontSize:16},onClick:e,children:r})}const Qe=({formState:e,setFormState:n,onClose:r,loading:t,whiteTheme:l=!1})=>{const o=l?{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:e.amountError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0}:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:e.amountError?"1px solid #ff4d4f":"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},_=l?{width:"100%",padding:"10px 12px",borderRadius:6,border:e.rechargeChannelError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"}:{width:"100%",padding:"10px 12px",borderRadius:6,border:e.rechargeChannelError?"1px solid #ff4d4f":"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},a=l?{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"}:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},f=l?{marginBottom:8,fontSize:14,color:"#222",textAlign:"left",display:"block"}:{marginBottom:8,fontSize:14,textAlign:"left",display:"block"},s={color:"#ff4d4f",fontSize:13,marginTop:4},p=l?{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"}:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},i=l?{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600}:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600};return u(A,{children:[u("div",{style:{marginBottom:18},children:[u("div",{style:f,children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 充值币种"]}),u("select",{style:a,value:e.currency,onInput:d=>{const c=d.target.value;n(h=>({...h,currency:c}))},children:[u("option",{value:"USD",children:"USD - 美元"}),u("option",{value:"CNY",children:"CNY - 人民币"}),u("option",{value:"EUR",children:"EUR - 欧元"})]})]}),u("div",{style:{marginBottom:18},children:[u("div",{style:f,children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 充值金额"]}),u("input",{type:"text",placeholder:"请输入充值金额",value:e.amount,onInput:d=>{const c=d.target.value;n(h=>({...h,amount:c,amountError:c.trim()?"":h.amountError}))},style:o}),e.amountError&&u("div",{style:s,children:e.amountError})]}),u("div",{style:{marginBottom:24},children:[u("div",{style:f,children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 支付平台"]}),u("select",{style:_,value:e.rechargeChannel,onInput:d=>{const c=d.target.value;n(h=>({...h,rechargeChannel:c,rechargeChannelError:c?"":h.rechargeChannelError}))},children:[u("option",{value:"alipay",children:"支付宝"}),u("option",{value:"wechat",children:"微信"}),u("option",{value:"paypal",children:"PayPal"})]}),e.rechargeChannelError&&u("div",{style:s,children:e.rechargeChannelError})]}),e.error&&u("div",{style:{color:"#ff4d4f",marginBottom:12},children:e.error}),u("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[u("button",{type:"button",onClick:r,style:p,children:"取消"}),u("button",{type:"submit",disabled:t,style:i,children:t?"提交中...":"去支付"})]})]})},Xe=({formState:e,setFormState:n,onClose:r,loading:t})=>{const l=Ge(null),o=i=>{const d=Array.from(i.target.files).slice(0,10);n(c=>({...c,files:d,filesError:""}))},_=i=>{i.preventDefault();const d=Array.from(i.dataTransfer.files).slice(0,10);n(c=>({...c,files:d,filesError:""}))},a=i=>{i.preventDefault()},f=i=>{n(d=>({...d,files:d.files.filter((c,h)=>h!==i)}))},s=i=>{i.preventDefault();let d=!0;n(c=>({...c,platformError:"",transactionIdError:"",filesError:""})),e.platform||(n(c=>({...c,platformError:"请选择支付平台"})),d=!1),e.transactionId.trim()||(n(c=>({...c,transactionIdError:"请输入转账交易ID"})),d=!1),(!e.files||e.files.length===0)&&(n(c=>({...c,filesError:"请上传转账凭证"})),d=!1),d&&console.log("OfflineTransferForm values:",e)},p=i=>i>1024*1024?(i/1024/1024).toFixed(2)+" MB":i>1024?(i/1024).toFixed(2)+" KB":i+" B";return u("form",{onSubmit:s,children:[u("div",{style:{marginBottom:18},children:[u("div",{style:{marginBottom:8,fontSize:14,color:"#222"},children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 第三方支付平台"]}),u("select",{style:{width:"100%",padding:"10px 12px",borderRadius:6,border:e.platformError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},value:e.platform,onInput:i=>{const d=i.target.value;n(c=>({...c,platform:d,platformError:d?"":c.platformError}))},children:[u("option",{value:"paypal",children:"PayPal"}),u("option",{value:"alipay",children:"支付宝"}),u("option",{value:"wechat",children:"微信"})]}),e.platformError&&u("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:e.platformError})]}),u("div",{style:{marginBottom:18},children:[u("div",{style:{marginBottom:8,fontSize:14,color:"#222"},children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 交易ID"]}),u("input",{type:"text",placeholder:"请输入转账交易ID",value:e.transactionId,onInput:i=>{const d=i.target.value;n(c=>({...c,transactionId:d,transactionIdError:d?"":c.transactionIdError}))},style:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:e.transactionIdError?"1px solid #ff4d4f":"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0}}),e.transactionIdError&&u("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:e.transactionIdError})]}),u("div",{style:{marginBottom:24},children:[u("div",{style:{marginBottom:8,fontSize:14,color:"#222"},children:[u("span",{style:{color:"#F53F3F"},children:"*"})," 上传文件"]}),u("div",{style:{border:e.filesError?"1px dashed #ff4d4f":"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:24,textAlign:"center",cursor:"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15},onClick:()=>l.current?.click(),onDrop:_,onDragOver:a,children:[u("div",{style:{fontSize:48,marginBottom:12},children:u("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",children:[u("rect",{x:"8",y:"8",width:"48",height:"48",rx:"12",fill:"#F4F6FA"}),u("rect",{x:"28",y:"20",width:"8",height:"24",rx:"4",fill:"#E5E6EB"})]})}),u("div",{style:{color:"#222",fontSize:15,marginBottom:4},children:"点击或拖拽文件到此处上传"}),u("div",{style:{color:"#999",fontSize:13},children:"支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传 10 个文件"}),u("input",{ref:l,type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.pdf",style:{display:"none"},onChange:o})]}),e.files&&e.files.length>0&&u("div",{style:{marginTop:12},children:e.files.map((i,d)=>u("div",{style:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#222",justifyContent:"space-between"},children:[u("div",{style:{display:"flex",alignItems:"center",flex:1},children:[u("span",{style:{fontWeight:500},children:i.name}),u("span",{style:{color:"#8C8F93",fontSize:13,marginLeft:8},children:["(",p(i.size),")"]})]}),u("button",{type:"button",onClick:c=>{c.stopPropagation(),f(d)},style:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"},children:"移除"})]},d))}),e.filesError&&u("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:e.filesError})]}),u("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[u("button",{type:"button",onClick:r,style:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},children:"取消"}),u("button",{type:"submit",disabled:t,style:{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},children:"去支付"})]})]})};function Ze({visible:e,onClose:n,onSubmit:r,color:t}){console.log(1111);const[l,o]=j({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[_,a]=j("online"),[f,s]=j({platform:"paypal",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1});return qe(()=>{e||(a("online"),o({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),s({platform:"paypal",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]),e?u("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:d=>{d.target===d.currentTarget&&n()},children:u("form",{onSubmit:async d=>{d.preventDefault();let c=!0;if(o(h=>({...h,amountError:"",rechargeChannelError:""})),l.amount.trim()||(o(h=>({...h,amountError:"请输入充值金额"})),c=!1),l.rechargeChannel||(o(h=>({...h,rechargeChannelError:"请选择支付平台"})),c=!1),!!c){o(h=>({...h,loading:!0,error:""}));try{await r({amount:l.amount,rechargeChannel:l.rechargeChannel,currency:l.currency}),n()}catch{o(h=>({...h,error:"提交失败,请重试"}))}finally{o(h=>({...h,loading:!1}))}}},style:{background:"#fff",padding:32,borderRadius:12,minWidth:400,color:t||"#222",boxShadow:"0 4px 24px rgba(0,0,0,0.08)",position:"relative"},onClick:d=>d.stopPropagation(),children:[u("button",{type:"button",onClick:n,style:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#222",fontSize:22,cursor:"pointer",lineHeight:1},"aria-label":"关闭",children:"×"}),u("div",{style:{fontWeight:600,fontSize:20,marginBottom:24,textAlign:"left",color:"#222"},children:"充值 / 转账"}),u("div",{style:{display:"flex",marginBottom:28},children:[u("button",{type:"button",onClick:()=>a("online"),style:{flex:1,background:_==="online"?"#fff":"#F7F8FA",color:_==="online"?"#155EEF":"#222",border:"none",borderRadius:"8px 0 0 8px",fontWeight:_==="online"?600:400,fontSize:16,height:48,boxShadow:_==="online"?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer",borderRight:"1px solid #F0F1F3",transition:"all 0.2s"},children:"在线充值"}),u("button",{type:"button",onClick:()=>a("offline"),style:{flex:1,background:_==="offline"?"#fff":"#F7F8FA",color:_==="offline"?"#155EEF":"#222",border:"none",borderRadius:"0 8px 8px 0",fontWeight:_==="offline"?600:400,fontSize:16,height:48,boxShadow:_==="offline"?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer",borderLeft:"1px solid #F0F1F3",transition:"all 0.2s"},children:"线下转账"})]}),_==="online"?u(Qe,{formState:l,setFormState:o,onClose:n,loading:l.loading,whiteTheme:!0}):u(Xe,{formState:f,setFormState:s,onClose:n,loading:f.loading})]})}):null}function oe(){return(oe=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}var en=["context","children"];function nn(e){this.getChildContext=function(){return e.context};var n=e.children,r=function(t,l){if(t==null)return{};var o,_,a={},f=Object.keys(t);for(_=0;_<f.length;_++)l.indexOf(o=f[_])>=0||(a[o]=t[o]);return a}(e,en);return Pe(n,r)}function rn(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=S(nn,oe({},this._props,{context:e.detail.context}),function n(r,t){if(r.nodeType===3)return r.data;if(r.nodeType!==1)return null;var l=[],o={},_=0,a=r.attributes,f=r.childNodes;for(_=a.length;_--;)a[_].name!=="slot"&&(o[a[_].name]=a[_].value,o[Re(a[_].name)]=a[_].value);for(_=f.length;_--;){var s=n(f[_],null),p=f[_].slot;p?o[p]=S(ve,{name:p},s):l[_]=s}var i=t?S(ve,null,l):l;return S(t||r.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?ze:V)(this._vdom,this._root)}function Re(e){return e.replace(/-(\w)/g,function(n,r){return r?r.toUpperCase():""})}function tn(e,n,r){if(this._vdom){var t={};t[e]=r=r??void 0,t[Re(e)]=r,this._vdom=Pe(this._vdom,t),V(this._vdom,this._root)}}function on(){V(this._vdom=null,this._root)}function ve(e,n){var r=this;return S("slot",oe({},e,{ref:function(t){t?(r.ref=t,r._listener||(r._listener=function(l){l.stopPropagation(),l.detail.context=n},t.addEventListener("_preact",r._listener))):r.ref.removeEventListener("_preact",r._listener)}}))}function ln(e,n,r,t){function l(){var o=Reflect.construct(HTMLElement,[],l);return o._vdomComponent=e,o._root=o,o}return(l.prototype=Object.create(HTMLElement.prototype)).constructor=l,l.prototype.connectedCallback=rn,l.prototype.attributeChangedCallback=tn,l.prototype.disconnectedCallback=on,r=r||e.observedAttributes||Object.keys(e.propTypes||{}),l.observedAttributes=r,r.forEach(function(o){Object.defineProperty(l.prototype,o,{get:function(){return this._vdom.props[o]},set:function(_){this._vdom?this.attributeChangedCallback(o,null,_):(this._props||(this._props={}),this._props[o]=_,this.connectedCallback());var a=typeof _;_!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(o,_)}})}),customElements.define(n,l)}function _n(e){const[n,r]=j(!1),t=e.theme?.primaryColor;return u("div",{children:[u(Ke,{color:t,onClick:()=>r(!0),children:"打开表单"}),u(Ze,{visible:n,onClose:()=>r(!1),onSubmit:async o=>{console.log("submit",o)},color:t})]})}ln(_n,"x-best-modal-form",["theme"]);const an=["x-greeting","x-best-modal-form"];exports.components=an;exports.npmTest=He;exports.printCurrentTime=Ae;
|
package/dist/best-unit.js
CHANGED
|
@@ -463,7 +463,13 @@ const Ye = ({ formState: e, setFormState: n, onClose: r, loading: t, whiteTheme:
|
|
|
463
463
|
color: "#fff",
|
|
464
464
|
fontSize: 15,
|
|
465
465
|
outline: "none"
|
|
466
|
-
}, f = l ? {
|
|
466
|
+
}, f = l ? {
|
|
467
|
+
marginBottom: 8,
|
|
468
|
+
fontSize: 14,
|
|
469
|
+
color: "#222",
|
|
470
|
+
textAlign: "left",
|
|
471
|
+
display: "block"
|
|
472
|
+
} : { marginBottom: 8, fontSize: 14, textAlign: "left", display: "block" }, s = { color: "#ff4d4f", fontSize: 13, marginTop: 4 }, p = l ? {
|
|
467
473
|
background: "#fff",
|
|
468
474
|
color: "#222",
|
|
469
475
|
border: "1px solid #E5E6EB",
|
package/package.json
CHANGED
|
@@ -97,8 +97,14 @@ export const OnlineRechargeForm: FunctionalComponent<
|
|
|
97
97
|
outline: "none",
|
|
98
98
|
};
|
|
99
99
|
const labelStyle = whiteTheme
|
|
100
|
-
? {
|
|
101
|
-
|
|
100
|
+
? {
|
|
101
|
+
marginBottom: 8,
|
|
102
|
+
fontSize: 14,
|
|
103
|
+
color: "#222",
|
|
104
|
+
textAlign: "left",
|
|
105
|
+
display: "block",
|
|
106
|
+
}
|
|
107
|
+
: { marginBottom: 8, fontSize: 14, textAlign: "left", display: "block" };
|
|
102
108
|
const errorStyle = { color: "#ff4d4f", fontSize: 13, marginTop: 4 };
|
|
103
109
|
const buttonCancelStyle = whiteTheme
|
|
104
110
|
? {
|