best-unit 0.0.6 → 0.0.8

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function de(){console.log("npm package test!!!")}function ve(){console.log("Current time:",new Date().toISOString())}var O,d,te,C,Q,ne,_e,re,z,R,B,L={},oe=[],me=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,H=Array.isArray;function k(t,e){for(var n in e)t[n]=e[n];return t}function G(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function x(t,e,n){var o,l,_,i={};for(_ in e)_=="key"?o=e[_]:_=="ref"?l=e[_]:i[_]=e[_];if(arguments.length>2&&(i.children=arguments.length>3?O.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(_ in t.defaultProps)i[_]===void 0&&(i[_]=t.defaultProps[_]);return $(t,i,o,l,null)}function $(t,e,n,o,l){var _={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++te,__i:-1,__u:0};return l==null&&d.vnode!=null&&d.vnode(_),_}function F(t){return t.children}function j(t,e){this.props=t,this.context=e}function P(t,e){if(e==null)return t.__?P(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?P(t):null}function le(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return le(t)}}function X(t){(!t.__d&&(t.__d=!0)&&C.push(t)&&!N.__r++||Q!=d.debounceRendering)&&((Q=d.debounceRendering)||ne)(N)}function N(){for(var t,e,n,o,l,_,i,s=1;C.length;)C.length>s&&C.sort(_e),t=C.shift(),s=C.length,t.__d&&(n=void 0,l=(o=(e=t).__v).__e,_=[],i=[],e.__P&&((n=k({},o)).__v=o.__v+1,d.vnode&&d.vnode(n),V(e.__P,n,o,e.__n,e.__P.namespaceURI,32&o.__u?[l]:null,_,l??P(o),!!(32&o.__u),i),n.__v=o.__v,n.__.__k[n.__i]=n,ue(_,n,i),n.__e!=l&&le(n)));N.__r=0}function ie(t,e,n,o,l,_,i,s,c,u,a){var r,v,p,m,g,y,f=o&&o.__k||oe,h=e.length;for(c=ye(n,e,f,c,h),r=0;r<h;r++)(p=n.__k[r])!=null&&(v=p.__i==-1?L:f[p.__i]||L,p.__i=r,y=V(t,p,v,l,_,i,s,c,u,a),m=p.__e,p.ref&&v.ref!=p.ref&&(v.ref&&q(v.ref,null,p),a.push(p.ref,p.__c||m,p)),g==null&&m!=null&&(g=m),4&p.__u||v.__k===p.__k?c=se(p,c,t):typeof p.type=="function"&&y!==void 0?c=y:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=g,c}function ye(t,e,n,o,l){var _,i,s,c,u,a=n.length,r=a,v=0;for(t.__k=new Array(l),_=0;_<l;_++)(i=e[_])!=null&&typeof i!="boolean"&&typeof i!="function"?(c=_+v,(i=t.__k[_]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?$(null,i,null,null,null):H(i)?$(F,{children:i},null,null,null):i.constructor==null&&i.__b>0?$(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=t,i.__b=t.__b+1,s=null,(u=i.__i=ge(i,n,c,r))!=-1&&(r--,(s=n[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(l>a?v--:l<a&&v++),typeof i.type!="function"&&(i.__u|=4)):u!=c&&(u==c-1?v--:u==c+1?v++:(u>c?v--:v++,i.__u|=4))):t.__k[_]=null;if(r)for(_=0;_<a;_++)(s=n[_])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=P(s)),pe(s,s));return o}function se(t,e,n){var o,l;if(typeof t.type=="function"){for(o=t.__k,l=0;o&&l<o.length;l++)o[l]&&(o[l].__=t,e=se(o[l],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=P(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ge(t,e,n,o){var l,_,i=t.key,s=t.type,c=e[n];if(c===null&&t.key==null||c&&i==c.key&&s==c.type&&(2&c.__u)==0)return n;if(o>(c!=null&&(2&c.__u)==0?1:0))for(l=n-1,_=n+1;l>=0||_<e.length;){if(l>=0){if((c=e[l])&&(2&c.__u)==0&&i==c.key&&s==c.type)return l;l--}if(_<e.length){if((c=e[_])&&(2&c.__u)==0&&i==c.key&&s==c.type)return _;_++}}return-1}function Y(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||me.test(e)?n:n+"px"}function A(t,e,n,o,l){var _,i;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||Y(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||Y(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")_=e!=(e=e.replace(re,"$1")),i=e.toLowerCase(),e=i in t||e=="onFocusOut"||e=="onFocusIn"?i.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+_]=n,n?o?n.u=o.u:(n.u=z,t.addEventListener(e,_?B:R,_)):t.removeEventListener(e,_?B:R,_);else{if(l=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Z(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=z++;else if(e.t<n.u)return;return n(d.event?d.event(e):e)}}}function V(t,e,n,o,l,_,i,s,c,u){var a,r,v,p,m,g,y,f,h,S,w,D,T,K,U,E,I,b=e.type;if(e.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),_=[s=e.__e=n.__e]),(a=d.__b)&&a(e);e:if(typeof b=="function")try{if(f=e.props,h="prototype"in b&&b.prototype.render,S=(a=b.contextType)&&o[a.__c],w=a?S?S.props.value:a.__:o,n.__c?y=(r=e.__c=n.__c).__=r.__E:(h?e.__c=r=new b(f,w):(e.__c=r=new j(f,w),r.constructor=b,r.render=ke),S&&S.sub(r),r.props=f,r.state||(r.state={}),r.context=w,r.__n=o,v=r.__d=!0,r.__h=[],r._sb=[]),h&&r.__s==null&&(r.__s=r.state),h&&b.getDerivedStateFromProps!=null&&(r.__s==r.state&&(r.__s=k({},r.__s)),k(r.__s,b.getDerivedStateFromProps(f,r.__s))),p=r.props,m=r.state,r.__v=e,v)h&&b.getDerivedStateFromProps==null&&r.componentWillMount!=null&&r.componentWillMount(),h&&r.componentDidMount!=null&&r.__h.push(r.componentDidMount);else{if(h&&b.getDerivedStateFromProps==null&&f!==p&&r.componentWillReceiveProps!=null&&r.componentWillReceiveProps(f,w),!r.__e&&r.shouldComponentUpdate!=null&&r.shouldComponentUpdate(f,r.__s,w)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(r.props=f,r.state=r.__s,r.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(M){M&&(M.__=e)}),D=0;D<r._sb.length;D++)r.__h.push(r._sb[D]);r._sb=[],r.__h.length&&i.push(r);break e}r.componentWillUpdate!=null&&r.componentWillUpdate(f,r.__s,w),h&&r.componentDidUpdate!=null&&r.__h.push(function(){r.componentDidUpdate(p,m,g)})}if(r.context=w,r.props=f,r.__P=t,r.__e=!1,T=d.__r,K=0,h){for(r.state=r.__s,r.__d=!1,T&&T(e),a=r.render(r.props,r.state,r.context),U=0;U<r._sb.length;U++)r.__h.push(r._sb[U]);r._sb=[]}else do r.__d=!1,T&&T(e),a=r.render(r.props,r.state,r.context),r.state=r.__s;while(r.__d&&++K<25);r.state=r.__s,r.getChildContext!=null&&(o=k(k({},o),r.getChildContext())),h&&!v&&r.getSnapshotBeforeUpdate!=null&&(g=r.getSnapshotBeforeUpdate(p,m)),E=a,a!=null&&a.type===F&&a.key==null&&(E=ce(a.props.children)),s=ie(t,H(E)?E:[E],e,n,o,l,_,i,s,c,u),r.base=e.__e,e.__u&=-161,r.__h.length&&i.push(r),y&&(r.__E=r.__=null)}catch(M){if(e.__v=null,c||_!=null)if(M.then){for(e.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;_[_.indexOf(s)]=null,e.__e=s}else for(I=_.length;I--;)G(_[I]);else e.__e=n.__e,e.__k=n.__k;d.__e(M,e,n)}else _==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=be(n.__e,e,n,o,l,_,i,c,u);return(a=d.diffed)&&a(e),128&e.__u?void 0:s}function ue(t,e,n){for(var o=0;o<n.length;o++)q(n[o],n[++o],n[++o]);d.__c&&d.__c(e,t),t.some(function(l){try{t=l.__h,l.__h=[],t.some(function(_){_.call(l)})}catch(_){d.__e(_,l.__v)}})}function ce(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:H(t)?t.map(ce):k({},t)}function be(t,e,n,o,l,_,i,s,c){var u,a,r,v,p,m,g,y=n.props,f=e.props,h=e.type;if(h=="svg"?l="http://www.w3.org/2000/svg":h=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),_!=null){for(u=0;u<_.length;u++)if((p=_[u])&&"setAttribute"in p==!!h&&(h?p.localName==h:p.nodeType==3)){t=p,_[u]=null;break}}if(t==null){if(h==null)return document.createTextNode(f);t=document.createElementNS(l,h,f.is&&f),s&&(d.__m&&d.__m(e,_),s=!1),_=null}if(h==null)y===f||s&&t.data==f||(t.data=f);else{if(_=_&&O.call(t.childNodes),y=n.props||L,!s&&_!=null)for(y={},u=0;u<t.attributes.length;u++)y[(p=t.attributes[u]).name]=p.value;for(u in y)if(p=y[u],u!="children"){if(u=="dangerouslySetInnerHTML")r=p;else if(!(u in f)){if(u=="value"&&"defaultValue"in f||u=="checked"&&"defaultChecked"in f)continue;A(t,u,null,p,l)}}for(u in f)p=f[u],u=="children"?v=p:u=="dangerouslySetInnerHTML"?a=p:u=="value"?m=p:u=="checked"?g=p:s&&typeof p!="function"||y[u]===p||A(t,u,p,y[u],l);if(a)s||r&&(a.__html==r.__html||a.__html==t.innerHTML)||(t.innerHTML=a.__html),e.__k=[];else if(r&&(t.innerHTML=""),ie(e.type=="template"?t.content:t,H(v)?v:[v],e,n,o,h=="foreignObject"?"http://www.w3.org/1999/xhtml":l,_,i,_?_[0]:n.__k&&P(n,0),s,c),_!=null)for(u=_.length;u--;)G(_[u]);s||(u="value",h=="progress"&&m==null?t.removeAttribute("value"):m!=null&&(m!==t[u]||h=="progress"&&!m||h=="option"&&m!=y[u])&&A(t,u,m,y[u],l),u="checked",g!=null&&g!=t[u]&&A(t,u,g,y[u],l))}return t}function q(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(l){d.__e(l,n)}}function pe(t,e,n){var o,l;if(d.unmount&&d.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||q(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(_){d.__e(_,e)}o.base=o.__P=null}if(o=t.__k)for(l=0;l<o.length;l++)o[l]&&pe(o[l],e,n||typeof t.type!="function");n||G(t.__e),t.__c=t.__=t.__e=void 0}function ke(t,e,n){return this.constructor(t,n)}function W(t,e,n){var o,l,_,i;e==document&&(e=document.documentElement),d.__&&d.__(t,e),l=(o=typeof n=="function")?null:n&&n.__k||e.__k,_=[],i=[],V(e,t=(!o&&n||e).__k=x(F,null,[t]),l||L,L,e.namespaceURI,!o&&n?[n]:l?null:e.firstChild?O.call(e.childNodes):null,_,!o&&n?n:l?l.__e:e.firstChild,o,i),ue(_,t,i)}function ae(t,e){W(t,e,ae)}function fe(t,e,n){var o,l,_,i,s=k({},t.props);for(_ in t.type&&t.type.defaultProps&&(i=t.type.defaultProps),e)_=="key"?o=e[_]:_=="ref"?l=e[_]:s[_]=e[_]===void 0&&i!=null?i[_]:e[_];return arguments.length>2&&(s.children=arguments.length>3?O.call(arguments,2):n),$(t.type,s,o||t.key,l||t.ref,null)}O=oe.slice,d={__e:function(t,e,n,o){for(var l,_,i;e=e.__;)if((l=e.__c)&&!l.__)try{if((_=l.constructor)&&_.getDerivedStateFromError!=null&&(l.setState(_.getDerivedStateFromError(t)),i=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(t,o||{}),i=l.__d),i)return l.__E=l}catch(s){t=s}throw t}},te=0,j.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=k({},this.state),typeof t=="function"&&(t=t(k({},n),this.props)),t&&k(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),X(this))},j.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),X(this))},j.prototype.render=F,C=[],ne=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_e=function(t,e){return t.__v.__b-e.__v.__b},N.__r=0,re=/(PointerCapture)$|Capture$/i,z=0,R=Z(!1),B=Z(!0);var we=0;function Ce(t,e,n,o,l,_){e||(e={});var i,s,c=e;if("ref"in c)for(s in c={},e)s=="ref"?i=e[s]:c[s]=e[s];var u={type:t,props:c,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--we,__i:-1,__u:0,__source:l,__self:_};return d.vnode&&d.vnode(u),u}function J(){return(J=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}var xe=["context","children"];function Pe(t){this.getChildContext=function(){return t.context};var e=t.children,n=function(o,l){if(o==null)return{};var _,i,s={},c=Object.keys(o);for(i=0;i<c.length;i++)l.indexOf(_=c[i])>=0||(s[_]=o[_]);return s}(t,xe);return fe(e,n)}function Se(){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=x(Pe,J({},this._props,{context:t.detail.context}),function e(n,o){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var l=[],_={},i=0,s=n.attributes,c=n.childNodes;for(i=s.length;i--;)s[i].name!=="slot"&&(_[s[i].name]=s[i].value,_[he(s[i].name)]=s[i].value);for(i=c.length;i--;){var u=e(c[i],null),a=c[i].slot;a?_[a]=x(ee,{name:a},u):l[i]=u}var r=o?x(ee,null,l):l;return x(o||n.nodeName.toLowerCase(),_,r)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?ae:W)(this._vdom,this._root)}function he(t){return t.replace(/-(\w)/g,function(e,n){return n?n.toUpperCase():""})}function Te(t,e,n){if(this._vdom){var o={};o[t]=n=n??void 0,o[he(t)]=n,this._vdom=fe(this._vdom,o),W(this._vdom,this._root)}}function Ee(){W(this._vdom=null,this._root)}function ee(t,e){var n=this;return x("slot",J({},t,{ref:function(o){o?(n.ref=o,n._listener||(n._listener=function(l){l.stopPropagation(),l.detail.context=e},o.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function Me(t,e,n,o){function l(){var _=Reflect.construct(HTMLElement,[],l);return _._vdomComponent=t,_._root=_,_}return(l.prototype=Object.create(HTMLElement.prototype)).constructor=l,l.prototype.connectedCallback=Se,l.prototype.attributeChangedCallback=Te,l.prototype.disconnectedCallback=Ee,n=n||t.observedAttributes||Object.keys(t.propTypes||{}),l.observedAttributes=n,n.forEach(function(_){Object.defineProperty(l.prototype,_,{get:function(){return this._vdom.props[_]},set:function(i){this._vdom?this.attributeChangedCallback(_,null,i):(this._props||(this._props={}),this._props[_]=i,this.connectedCallback());var s=typeof i;i!=null&&s!=="string"&&s!=="boolean"&&s!=="number"||this.setAttribute(_,i)}})}),customElements.define(e,l)}const $e=({name:t="World"})=>Ce("p",{children:["Hello, ",t,"!"]});Me($e,"x-greeting",["name"]);const Le=["x-greeting"];exports.components=Le;exports.npmTest=de;exports.printCurrentTime=ve;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function De(){console.log("npm package test!!!")}function Me(){console.log("Current time:",new Date().toISOString())}var D,h,ve,w,oe,ge,ye,be,X,G,J,A={},ke=[],ze=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,W=Array.isArray;function S(t,e){for(var n in e)t[n]=e[n];return t}function Z(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function $(t,e,n){var o,_,r,l={};for(r in e)r=="key"?o=e[r]:r=="ref"?_=e[r]:l[r]=e[r];if(arguments.length>2&&(l.children=arguments.length>3?D.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)l[r]===void 0&&(l[r]=t.defaultProps[r]);return F(t,l,o,_,null)}function F(t,e,n,o,_){var r={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:_??++ve,__i:-1,__u:0};return _==null&&h.vnode!=null&&h.vnode(r),r}function I(t){return t.children}function L(t,e){this.props=t,this.context=e}function P(t,e){if(e==null)return t.__?P(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?P(t):null}function Ce(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Ce(t)}}function _e(t){(!t.__d&&(t.__d=!0)&&w.push(t)&&!j.__r++||oe!=h.debounceRendering)&&((oe=h.debounceRendering)||ge)(j)}function j(){for(var t,e,n,o,_,r,l,a=1;w.length;)w.length>a&&w.sort(ye),t=w.shift(),a=w.length,t.__d&&(n=void 0,_=(o=(e=t).__v).__e,r=[],l=[],e.__P&&((n=S({},o)).__v=o.__v+1,h.vnode&&h.vnode(n),ee(e.__P,n,o,e.__n,e.__P.namespaceURI,32&o.__u?[_]:null,r,_??P(o),!!(32&o.__u),l),n.__v=o.__v,n.__.__k[n.__i]=n,Ee(r,n,l),n.__e!=_&&Ce(n)));j.__r=0}function xe(t,e,n,o,_,r,l,a,u,c,s){var i,p,f,b,C,k,m=o&&o.__k||ke,v=e.length;for(u=Be(n,e,m,u,v),i=0;i<v;i++)(f=n.__k[i])!=null&&(p=f.__i==-1?A:m[f.__i]||A,f.__i=i,k=ee(t,f,p,_,r,l,a,u,c,s),b=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&te(p.ref,null,f),s.push(f.ref,f.__c||b,f)),C==null&&b!=null&&(C=b),4&f.__u||p.__k===f.__k?u=Se(f,u,t):typeof f.type=="function"&&k!==void 0?u=k:b&&(u=b.nextSibling),f.__u&=-7);return n.__e=C,u}function Be(t,e,n,o,_){var r,l,a,u,c,s=n.length,i=s,p=0;for(t.__k=new Array(_),r=0;r<_;r++)(l=e[r])!=null&&typeof l!="boolean"&&typeof l!="function"?(u=r+p,(l=t.__k[r]=typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?F(null,l,null,null,null):W(l)?F(I,{children:l},null,null,null):l.constructor==null&&l.__b>0?F(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=t,l.__b=t.__b+1,a=null,(c=l.__i=Le(l,n,u,i))!=-1&&(i--,(a=n[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(_>s?p--:_<s&&p++),typeof l.type!="function"&&(l.__u|=4)):c!=u&&(c==u-1?p--:c==u+1?p++:(c>u?p--:p++,l.__u|=4))):t.__k[r]=null;if(i)for(r=0;r<s;r++)(a=n[r])!=null&&(2&a.__u)==0&&(a.__e==o&&(o=P(a)),$e(a,a));return o}function Se(t,e,n){var o,_;if(typeof t.type=="function"){for(o=t.__k,_=0;o&&_<o.length;_++)o[_]&&(o[_].__=t,e=Se(o[_],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=P(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Le(t,e,n,o){var _,r,l=t.key,a=t.type,u=e[n];if(u===null&&t.key==null||u&&l==u.key&&a==u.type&&(2&u.__u)==0)return n;if(o>(u!=null&&(2&u.__u)==0?1:0))for(_=n-1,r=n+1;_>=0||r<e.length;){if(_>=0){if((u=e[_])&&(2&u.__u)==0&&l==u.key&&a==u.type)return _;_--}if(r<e.length){if((u=e[r])&&(2&u.__u)==0&&l==u.key&&a==u.type)return r;r++}}return-1}function ie(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||ze.test(e)?n:n+"px"}function B(t,e,n,o,_){var r,l;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||ie(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||ie(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(be,"$1")),l=e.toLowerCase(),e=l in t||e=="onFocusOut"||e=="onFocusIn"?l.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=X,t.addEventListener(e,r?J:G,r)):t.removeEventListener(e,r?J:G,r);else{if(_=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function le(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=X++;else if(e.t<n.u)return;return n(h.event?h.event(e):e)}}}function ee(t,e,n,o,_,r,l,a,u,c){var s,i,p,f,b,C,k,m,v,T,E,M,H,re,z,U,V,x=e.type;if(e.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),r=[a=e.__e=n.__e]),(s=h.__b)&&s(e);e:if(typeof x=="function")try{if(m=e.props,v="prototype"in x&&x.prototype.render,T=(s=x.contextType)&&o[s.__c],E=s?T?T.props.value:s.__:o,n.__c?k=(i=e.__c=n.__c).__=i.__E:(v?e.__c=i=new x(m,E):(e.__c=i=new L(m,E),i.constructor=x,i.render=je),T&&T.sub(i),i.props=m,i.state||(i.state={}),i.context=E,i.__n=o,p=i.__d=!0,i.__h=[],i._sb=[]),v&&i.__s==null&&(i.__s=i.state),v&&x.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=S({},i.__s)),S(i.__s,x.getDerivedStateFromProps(m,i.__s))),f=i.props,b=i.state,i.__v=e,p)v&&x.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),v&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(v&&x.getDerivedStateFromProps==null&&m!==f&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(m,E),!i.__e&&i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(m,i.__s,E)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(i.props=m,i.state=i.__s,i.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(N){N&&(N.__=e)}),M=0;M<i._sb.length;M++)i.__h.push(i._sb[M]);i._sb=[],i.__h.length&&l.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(m,i.__s,E),v&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(f,b,C)})}if(i.context=E,i.props=m,i.__P=t,i.__e=!1,H=h.__r,re=0,v){for(i.state=i.__s,i.__d=!1,H&&H(e),s=i.render(i.props,i.state,i.context),z=0;z<i._sb.length;z++)i.__h.push(i._sb[z]);i._sb=[]}else do i.__d=!1,H&&H(e),s=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++re<25);i.state=i.__s,i.getChildContext!=null&&(o=S(S({},o),i.getChildContext())),v&&!p&&i.getSnapshotBeforeUpdate!=null&&(C=i.getSnapshotBeforeUpdate(f,b)),U=s,s!=null&&s.type===I&&s.key==null&&(U=we(s.props.children)),a=xe(t,W(U)?U:[U],e,n,o,_,r,l,a,u,c),i.base=e.__e,e.__u&=-161,i.__h.length&&l.push(i),k&&(i.__E=i.__=null)}catch(N){if(e.__v=null,u||r!=null)if(N.then){for(e.__u|=u?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,e.__e=a}else for(V=r.length;V--;)Z(r[V]);else e.__e=n.__e,e.__k=n.__k;h.__e(N,e,n)}else r==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=Re(n.__e,e,n,o,_,r,l,u,c);return(s=h.diffed)&&s(e),128&e.__u?void 0:a}function Ee(t,e,n){for(var o=0;o<n.length;o++)te(n[o],n[++o],n[++o]);h.__c&&h.__c(e,t),t.some(function(_){try{t=_.__h,_.__h=[],t.some(function(r){r.call(_)})}catch(r){h.__e(r,_.__v)}})}function we(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:W(t)?t.map(we):S({},t)}function Re(t,e,n,o,_,r,l,a,u){var c,s,i,p,f,b,C,k=n.props,m=e.props,v=e.type;if(v=="svg"?_="http://www.w3.org/2000/svg":v=="math"?_="http://www.w3.org/1998/Math/MathML":_||(_="http://www.w3.org/1999/xhtml"),r!=null){for(c=0;c<r.length;c++)if((f=r[c])&&"setAttribute"in f==!!v&&(v?f.localName==v:f.nodeType==3)){t=f,r[c]=null;break}}if(t==null){if(v==null)return document.createTextNode(m);t=document.createElementNS(_,v,m.is&&m),a&&(h.__m&&h.__m(e,r),a=!1),r=null}if(v==null)k===m||a&&t.data==m||(t.data=m);else{if(r=r&&D.call(t.childNodes),k=n.props||A,!a&&r!=null)for(k={},c=0;c<t.attributes.length;c++)k[(f=t.attributes[c]).name]=f.value;for(c in k)if(f=k[c],c!="children"){if(c=="dangerouslySetInnerHTML")i=f;else if(!(c in m)){if(c=="value"&&"defaultValue"in m||c=="checked"&&"defaultChecked"in m)continue;B(t,c,null,f,_)}}for(c in m)f=m[c],c=="children"?p=f:c=="dangerouslySetInnerHTML"?s=f:c=="value"?b=f:c=="checked"?C=f:a&&typeof f!="function"||k[c]===f||B(t,c,f,k[c],_);if(s)a||i&&(s.__html==i.__html||s.__html==t.innerHTML)||(t.innerHTML=s.__html),e.__k=[];else if(i&&(t.innerHTML=""),xe(e.type=="template"?t.content:t,W(p)?p:[p],e,n,o,v=="foreignObject"?"http://www.w3.org/1999/xhtml":_,r,l,r?r[0]:n.__k&&P(n,0),a,u),r!=null)for(c=r.length;c--;)Z(r[c]);a||(c="value",v=="progress"&&b==null?t.removeAttribute("value"):b!=null&&(b!==t[c]||v=="progress"&&!b||v=="option"&&b!=k[c])&&B(t,c,b,k[c],_),c="checked",C!=null&&C!=t[c]&&B(t,c,C,k[c],_))}return t}function te(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(_){h.__e(_,n)}}function $e(t,e,n){var o,_;if(h.unmount&&h.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||te(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(r){h.__e(r,e)}o.base=o.__P=null}if(o=t.__k)for(_=0;_<o.length;_++)o[_]&&$e(o[_],e,n||typeof t.type!="function");n||Z(t.__e),t.__c=t.__=t.__e=void 0}function je(t,e,n){return this.constructor(t,n)}function q(t,e,n){var o,_,r,l;e==document&&(e=document.documentElement),h.__&&h.__(t,e),_=(o=typeof n=="function")?null:n&&n.__k||e.__k,r=[],l=[],ee(e,t=(!o&&n||e).__k=$(I,null,[t]),_||A,A,e.namespaceURI,!o&&n?[n]:_?null:e.firstChild?D.call(e.childNodes):null,r,!o&&n?n:_?_.__e:e.firstChild,o,l),Ee(r,t,l)}function Pe(t,e){q(t,e,Pe)}function Te(t,e,n){var o,_,r,l,a=S({},t.props);for(r in t.type&&t.type.defaultProps&&(l=t.type.defaultProps),e)r=="key"?o=e[r]:r=="ref"?_=e[r]:a[r]=e[r]===void 0&&l!=null?l[r]:e[r];return arguments.length>2&&(a.children=arguments.length>3?D.call(arguments,2):n),F(t.type,a,o||t.key,_||t.ref,null)}D=ke.slice,h={__e:function(t,e,n,o){for(var _,r,l;e=e.__;)if((_=e.__c)&&!_.__)try{if((r=_.constructor)&&r.getDerivedStateFromError!=null&&(_.setState(r.getDerivedStateFromError(t)),l=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(t,o||{}),l=_.__d),l)return _.__E=_}catch(a){t=a}throw t}},ve=0,L.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=S({},this.state),typeof t=="function"&&(t=t(S({},n),this.props)),t&&S(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),_e(this))},L.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),_e(this))},L.prototype.render=I,w=[],ge=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ye=function(t,e){return t.__v.__b-e.__v.__b},j.__r=0,be=/(PointerCapture)$|Capture$/i,X=0,G=le(!1),J=le(!0);var Oe=0;function d(t,e,n,o,_,r){e||(e={});var l,a,u=e;if("ref"in u)for(a in u={},e)a=="ref"?l=e[a]:u[a]=e[a];var c={type:t,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Oe,__i:-1,__u:0,__source:_,__self:r};if(typeof t=="function"&&(l=t.defaultProps))for(a in l)u[a]===void 0&&(u[a]=l[a]);return h.vnode&&h.vnode(c),c}var O,g,Y,ae,K=0,He=[],y=h,ce=y.__b,ue=y.__r,se=y.diffed,fe=y.__c,pe=y.unmount,de=y.__;function Ue(t,e){y.__h&&y.__h(g,t,K||e),K=0;var n=g.__H||(g.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Ne(t){return K=1,We(Fe,t)}function We(t,e,n){var o=Ue(O++,2);if(o.t=t,!o.__c&&(o.__=[Fe(void 0,e),function(a){var u=o.__N?o.__N[0]:o.__[0],c=o.t(u,a);u!==c&&(o.__N=[c,o.__[1]],o.__c.setState({}))}],o.__c=g,!g.__f)){var _=function(a,u,c){if(!o.__c.__H)return!0;var s=o.__c.__H.__.filter(function(p){return!!p.__c});if(s.every(function(p){return!p.__N}))return!r||r.call(this,a,u,c);var i=o.__c.props!==a;return s.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(i=!0)}}),r&&r.call(this,a,u,c)||i};g.__f=!0;var r=g.shouldComponentUpdate,l=g.componentWillUpdate;g.componentWillUpdate=function(a,u,c){if(this.__e){var s=r;r=void 0,_(a,u,c),r=s}l&&l.call(this,a,u,c)},g.shouldComponentUpdate=_}return o.__N||o.__}function Ie(t,e){var n=Ue(O++,3);!y.__s&&Ye(n.__H,e)&&(n.__=t,n.u=e,g.__H.__h.push(n))}function qe(){for(var t;t=He.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(R),t.__H.__h.forEach(Q),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){g=null,ce&&ce(t)},y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),de&&de(t,e)},y.__r=function(t){ue&&ue(t),O=0;var e=(g=t.__c).__H;e&&(Y===g?(e.__h=[],g.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(R),e.__h.forEach(Q),e.__h=[],O=0)),Y=g},y.diffed=function(t){se&&se(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(He.push(e)!==1&&ae===y.requestAnimationFrame||((ae=y.requestAnimationFrame)||Ve)(qe)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Y=g=null},y.__c=function(t,e){e.some(function(n){try{n.__h.forEach(R),n.__h=n.__h.filter(function(o){return!o.__||Q(o)})}catch(o){e.some(function(_){_.__h&&(_.__h=[])}),e=[],y.__e(o,n.__v)}}),fe&&fe(t,e)},y.unmount=function(t){pe&&pe(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{R(o)}catch(_){e=_}}),n.__H=void 0,e&&y.__e(e,n.__v))};var he=typeof requestAnimationFrame=="function";function Ve(t){var e,n=function(){clearTimeout(o),he&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);he&&(e=requestAnimationFrame(n))}function R(t){var e=g,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),g=e}function Q(t){var e=g;t.__c=t.__(),g=e}function Ye(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Fe(t,e){return typeof e=="function"?e(t):e}function Ge({onClick:t,color:e,children:n}){return d("button",{style:{background:e||"#1890ff",color:"#fff",border:"none",borderRadius:4,padding:"8px 16px",cursor:"pointer",fontSize:16},onClick:t,children:n})}function Je({visible:t,onClose:e,onSubmit:n,color:o}){const[_,r]=Ne({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""});return Ie(()=>{t||r({amount:"",rechargeChannel:"paypal",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""})},[t]),t?d("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:u=>{u.target===u.currentTarget&&e()},children:d("form",{onSubmit:async u=>{u.preventDefault();let c=!0;if(r(s=>({...s,amountError:"",rechargeChannelError:""})),_.amount.trim()||(r(s=>({...s,amountError:"请输入充值金额"})),c=!1),_.rechargeChannel||(r(s=>({...s,rechargeChannelError:"请选择支付平台"})),c=!1),!!c){r(s=>({...s,loading:!0,error:""}));try{await n({amount:_.amount,rechargeChannel:_.rechargeChannel,currency:_.currency}),e()}catch{r(s=>({...s,error:"提交失败,请重试"}))}finally{r(s=>({...s,loading:!1}))}}},style:{background:"#181A20",padding:32,borderRadius:12,minWidth:360,color:o||"#fff",boxShadow:"0 4px 24px rgba(0,0,0,0.5)",position:"relative"},onClick:u=>u.stopPropagation(),children:[d("button",{type:"button",onClick:e,style:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#fff",fontSize:22,cursor:"pointer",lineHeight:1},"aria-label":"关闭",children:"×"}),d("div",{style:{fontWeight:600,fontSize:18,marginBottom:24,textAlign:"left"},children:"在线充值"}),d("div",{style:{marginBottom:18},children:[d("div",{style:{marginBottom:8,fontSize:14},children:[d("span",{style:{color:"#00E8C6"},children:"*"})," 充值金额"]}),d("input",{type:"text",placeholder:"请输入充值金额",value:_.amount,onInput:u=>{const c=u.target.value;r(s=>({...s,amount:c,amountError:c.trim()?"":s.amountError}))},style:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:_.amountError?"1px solid #ff4d4f":"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0}}),_.amountError&&d("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:_.amountError})]}),d("div",{style:{marginBottom:18},children:[d("div",{style:{marginBottom:8,fontSize:14},children:[d("span",{style:{color:"#00E8C6"},children:"*"})," 支付平台"]}),d("select",{style:{width:"100%",padding:"10px 12px",borderRadius:6,border:_.rechargeChannelError?"1px solid #ff4d4f":"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},value:_.rechargeChannel,onInput:u=>{const c=u.target.value;r(s=>({...s,rechargeChannel:c,rechargeChannelError:c?"":s.rechargeChannelError}))},children:[d("option",{value:"alipay",children:"支付宝"}),d("option",{value:"wechat",children:"微信"}),d("option",{value:"paypal",children:"PayPal"})]}),_.rechargeChannelError&&d("div",{style:{color:"#ff4d4f",fontSize:13,marginTop:4},children:_.rechargeChannelError})]}),d("div",{style:{marginBottom:24},children:[d("div",{style:{marginBottom:8,fontSize:14},children:"币种"}),d("select",{style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},value:_.currency,children:[d("option",{value:"USD",children:"USD"}),d("option",{value:"CNY",children:"CNY"}),d("option",{value:"EUR",children:"EUR"})]})]}),_.error&&d("div",{style:{color:"#ff4d4f",marginBottom:12},children:_.error}),d("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[d("button",{type:"button",onClick:e,style:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},children:"取消"}),d("button",{type:"submit",disabled:_.loading,style:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},children:_.loading?"提交中...":"去支付"})]})]})}):null}function ne(){return(ne=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}var Ke=["context","children"];function Qe(t){this.getChildContext=function(){return t.context};var e=t.children,n=function(o,_){if(o==null)return{};var r,l,a={},u=Object.keys(o);for(l=0;l<u.length;l++)_.indexOf(r=u[l])>=0||(a[r]=o[r]);return a}(t,Ke);return Te(e,n)}function Xe(){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=$(Qe,ne({},this._props,{context:t.detail.context}),function e(n,o){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var _=[],r={},l=0,a=n.attributes,u=n.childNodes;for(l=a.length;l--;)a[l].name!=="slot"&&(r[a[l].name]=a[l].value,r[Ae(a[l].name)]=a[l].value);for(l=u.length;l--;){var c=e(u[l],null),s=u[l].slot;s?r[s]=$(me,{name:s},c):_[l]=c}var i=o?$(me,null,_):_;return $(o||n.nodeName.toLowerCase(),r,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Pe:q)(this._vdom,this._root)}function Ae(t){return t.replace(/-(\w)/g,function(e,n){return n?n.toUpperCase():""})}function Ze(t,e,n){if(this._vdom){var o={};o[t]=n=n??void 0,o[Ae(t)]=n,this._vdom=Te(this._vdom,o),q(this._vdom,this._root)}}function et(){q(this._vdom=null,this._root)}function me(t,e){var n=this;return $("slot",ne({},t,{ref:function(o){o?(n.ref=o,n._listener||(n._listener=function(_){_.stopPropagation(),_.detail.context=e},o.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function tt(t,e,n,o){function _(){var r=Reflect.construct(HTMLElement,[],_);return r._vdomComponent=t,r._root=r,r}return(_.prototype=Object.create(HTMLElement.prototype)).constructor=_,_.prototype.connectedCallback=Xe,_.prototype.attributeChangedCallback=Ze,_.prototype.disconnectedCallback=et,n=n||t.observedAttributes||Object.keys(t.propTypes||{}),_.observedAttributes=n,n.forEach(function(r){Object.defineProperty(_.prototype,r,{get:function(){return this._vdom.props[r]},set:function(l){this._vdom?this.attributeChangedCallback(r,null,l):(this._props||(this._props={}),this._props[r]=l,this.connectedCallback());var a=typeof l;l!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(r,l)}})}),customElements.define(e,_)}function nt(t){const[e,n]=Ne(!1),o=t.theme?.primaryColor;return d("div",{children:[d(Ge,{color:o,onClick:()=>n(!0),children:"打开表单"}),d(Je,{visible:e,onClose:()=>n(!1),onSubmit:async r=>{console.log("submit",r)},color:o})]})}tt(nt,"x-best-modal-form",["theme"]);const rt=["x-greeting","x-best-modal-form"];exports.components=rt;exports.npmTest=De;exports.printCurrentTime=Me;