3 lines
No EOL
11 KiB
JavaScript
3 lines
No EOL
11 KiB
JavaScript
/* esm.sh - preact@10.27.2 */
|
|
var D,d,Y,ce,C,K,Z,ee,_e,V,$,j,te,M={},ne=[],pe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,L=Array.isArray;function k(_,e){for(var t in e)_[t]=e[t];return _}function z(_){_&&_.parentNode&&_.parentNode.removeChild(_)}function fe(_,e,t){var o,l,n,i={};for(n in e)n=="key"?o=e[n]:n=="ref"?l=e[n]:i[n]=e[n];if(arguments.length>2&&(i.children=arguments.length>3?D.call(arguments,2):t),typeof _=="function"&&_.defaultProps!=null)for(n in _.defaultProps)i[n]===void 0&&(i[n]=_.defaultProps[n]);return E(_,i,o,l,null)}function E(_,e,t,o,l){var n={type:_,props:e,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++Y,__i:-1,__u:0};return l==null&&d.vnode!=null&&d.vnode(n),n}function be(){return{current:null}}function I(_){return _.children}function N(_,e){this.props=_,this.context=e}function S(_,e){if(e==null)return _.__?S(_.__,_.__i+1):null;for(var t;e<_.__k.length;e++)if((t=_.__k[e])!=null&&t.__e!=null)return t.__e;return typeof _.type=="function"?S(_):null}function re(_){var e,t;if((_=_.__)!=null&&_.__c!=null){for(_.__e=_.__c.base=null,e=0;e<_.__k.length;e++)if((t=_.__k[e])!=null&&t.__e!=null){_.__e=_.__c.base=t.__e;break}return re(_)}}function B(_){(!_.__d&&(_.__d=!0)&&C.push(_)&&!H.__r++||K!=d.debounceRendering)&&((K=d.debounceRendering)||Z)(H)}function H(){for(var _,e,t,o,l,n,i,u=1;C.length;)C.length>u&&C.sort(ee),_=C.shift(),u=C.length,_.__d&&(t=void 0,o=void 0,l=(o=(e=_).__v).__e,n=[],i=[],e.__P&&((t=k({},o)).__v=o.__v+1,d.vnode&&d.vnode(t),q(e.__P,t,o,e.__n,e.__P.namespaceURI,32&o.__u?[l]:null,n,l??S(o),!!(32&o.__u),i),t.__v=o.__v,t.__.__k[t.__i]=t,ie(n,t,i),o.__e=o.__=null,t.__e!=l&&re(t)));H.__r=0}function oe(_,e,t,o,l,n,i,u,f,s,p){var r,v,c,m,g,y,a,h=o&&o.__k||ne,w=e.length;for(f=ae(t,e,h,f,w),r=0;r<w;r++)(c=t.__k[r])!=null&&(v=c.__i==-1?M:h[c.__i]||M,c.__i=r,y=q(_,c,v,l,n,i,u,f,s,p),m=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&G(v.ref,null,c),p.push(c.ref,c.__c||m,c)),g==null&&m!=null&&(g=m),(a=!!(4&c.__u))||v.__k===c.__k?f=le(c,f,_,a):typeof c.type=="function"&&y!==void 0?f=y:m&&(f=m.nextSibling),c.__u&=-7);return t.__e=g,f}function ae(_,e,t,o,l){var n,i,u,f,s,p=t.length,r=p,v=0;for(_.__k=new Array(l),n=0;n<l;n++)(i=e[n])!=null&&typeof i!="boolean"&&typeof i!="function"?(f=n+v,(i=_.__k[n]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?E(null,i,null,null,null):L(i)?E(I,{children:i},null,null,null):i.constructor==null&&i.__b>0?E(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=_,i.__b=_.__b+1,u=null,(s=i.__i=de(i,t,f,r))!=-1&&(r--,(u=t[s])&&(u.__u|=2)),u==null||u.__v==null?(s==-1&&(l>p?v--:l<p&&v++),typeof i.type!="function"&&(i.__u|=4)):s!=f&&(s==f-1?v--:s==f+1?v++:(s>f?v--:v++,i.__u|=4))):_.__k[n]=null;if(r)for(n=0;n<p;n++)(u=t[n])!=null&&(2&u.__u)==0&&(u.__e==o&&(o=S(u)),ue(u,u));return o}function le(_,e,t,o){var l,n;if(typeof _.type=="function"){for(l=_.__k,n=0;l&&n<l.length;n++)l[n]&&(l[n].__=_,e=le(l[n],e,t,o));return e}_.__e!=e&&(o&&(e&&_.type&&!e.parentNode&&(e=S(_)),t.insertBefore(_.__e,e||null)),e=_.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function he(_,e){return e=e||[],_==null||typeof _=="boolean"||(L(_)?_.some(function(t){he(t,e)}):e.push(_)),e}function de(_,e,t,o){var l,n,i,u=_.key,f=_.type,s=e[t],p=s!=null&&(2&s.__u)==0;if(s===null&&_.key==null||p&&u==s.key&&f==s.type)return t;if(o>(p?1:0)){for(l=t-1,n=t+1;l>=0||n<e.length;)if((s=e[i=l>=0?l--:n++])!=null&&(2&s.__u)==0&&u==s.key&&f==s.type)return i}return-1}function Q(_,e,t){e[0]=="-"?_.setProperty(e,t??""):_[e]=t==null?"":typeof t!="number"||pe.test(e)?t:t+"px"}function F(_,e,t,o,l){var n,i;e:if(e=="style")if(typeof t=="string")_.style.cssText=t;else{if(typeof o=="string"&&(_.style.cssText=o=""),o)for(e in o)t&&e in t||Q(_.style,e,"");if(t)for(e in t)o&&t[e]==o[e]||Q(_.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(_e,"$1")),i=e.toLowerCase(),e=i in _||e=="onFocusOut"||e=="onFocusIn"?i.slice(2):e.slice(2),_.l||(_.l={}),_.l[e+n]=t,t?o?t.u=o.u:(t.u=V,_.addEventListener(e,n?j:$,n)):_.removeEventListener(e,n?j:$,n);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 _)try{_[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?_.removeAttribute(e):_.setAttribute(e,e=="popover"&&t==1?"":t))}}function X(_){return function(e){if(this.l){var t=this.l[e.type+_];if(e.t==null)e.t=V++;else if(e.t<t.u)return;return t(d.event?d.event(e):e)}}}function q(_,e,t,o,l,n,i,u,f,s){var p,r,v,c,m,g,y,a,h,w,x,W,U,J,A,T,R,b=e.type;if(e.constructor!=null)return null;128&t.__u&&(f=!!(32&t.__u),n=[u=e.__e=t.__e]),(p=d.__b)&&p(e);e:if(typeof b=="function")try{if(a=e.props,h="prototype"in b&&b.prototype.render,w=(p=b.contextType)&&o[p.__c],x=p?w?w.props.value:p.__:o,t.__c?y=(r=e.__c=t.__c).__=r.__E:(h?e.__c=r=new b(a,x):(e.__c=r=new N(a,x),r.constructor=b,r.render=me),w&&w.sub(r),r.props=a,r.state||(r.state={}),r.context=x,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(a,r.__s))),c=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&&a!==c&&r.componentWillReceiveProps!=null&&r.componentWillReceiveProps(a,x),!r.__e&&r.shouldComponentUpdate!=null&&r.shouldComponentUpdate(a,r.__s,x)===!1||e.__v==t.__v){for(e.__v!=t.__v&&(r.props=a,r.state=r.__s,r.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(P){P&&(P.__=e)}),W=0;W<r._sb.length;W++)r.__h.push(r._sb[W]);r._sb=[],r.__h.length&&i.push(r);break e}r.componentWillUpdate!=null&&r.componentWillUpdate(a,r.__s,x),h&&r.componentDidUpdate!=null&&r.__h.push(function(){r.componentDidUpdate(c,m,g)})}if(r.context=x,r.props=a,r.__P=_,r.__e=!1,U=d.__r,J=0,h){for(r.state=r.__s,r.__d=!1,U&&U(e),p=r.render(r.props,r.state,r.context),A=0;A<r._sb.length;A++)r.__h.push(r._sb[A]);r._sb=[]}else do r.__d=!1,U&&U(e),p=r.render(r.props,r.state,r.context),r.state=r.__s;while(r.__d&&++J<25);r.state=r.__s,r.getChildContext!=null&&(o=k(k({},o),r.getChildContext())),h&&!v&&r.getSnapshotBeforeUpdate!=null&&(g=r.getSnapshotBeforeUpdate(c,m)),T=p,p!=null&&p.type===I&&p.key==null&&(T=se(p.props.children)),u=oe(_,L(T)?T:[T],e,t,o,l,n,i,u,f,s),r.base=e.__e,e.__u&=-161,r.__h.length&&i.push(r),y&&(r.__E=r.__=null)}catch(P){if(e.__v=null,f||n!=null)if(P.then){for(e.__u|=f?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;n[n.indexOf(u)]=null,e.__e=u}else{for(R=n.length;R--;)z(n[R]);O(e)}else e.__e=t.__e,e.__k=t.__k,P.then||O(e);d.__e(P,e,t)}else n==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):u=e.__e=ve(t.__e,e,t,o,l,n,i,f,s);return(p=d.diffed)&&p(e),128&e.__u?void 0:u}function O(_){_&&_.__c&&(_.__c.__e=!0),_&&_.__k&&_.__k.forEach(O)}function ie(_,e,t){for(var o=0;o<t.length;o++)G(t[o],t[++o],t[++o]);d.__c&&d.__c(e,_),_.some(function(l){try{_=l.__h,l.__h=[],_.some(function(n){n.call(l)})}catch(n){d.__e(n,l.__v)}})}function se(_){return typeof _!="object"||_==null||_.__b&&_.__b>0?_:L(_)?_.map(se):k({},_)}function ve(_,e,t,o,l,n,i,u,f){var s,p,r,v,c,m,g,y=t.props,a=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"),n!=null){for(s=0;s<n.length;s++)if((c=n[s])&&"setAttribute"in c==!!h&&(h?c.localName==h:c.nodeType==3)){_=c,n[s]=null;break}}if(_==null){if(h==null)return document.createTextNode(a);_=document.createElementNS(l,h,a.is&&a),u&&(d.__m&&d.__m(e,n),u=!1),n=null}if(h==null)y===a||u&&_.data==a||(_.data=a);else{if(n=n&&D.call(_.childNodes),y=t.props||M,!u&&n!=null)for(y={},s=0;s<_.attributes.length;s++)y[(c=_.attributes[s]).name]=c.value;for(s in y)if(c=y[s],s!="children"){if(s=="dangerouslySetInnerHTML")r=c;else if(!(s in a)){if(s=="value"&&"defaultValue"in a||s=="checked"&&"defaultChecked"in a)continue;F(_,s,null,c,l)}}for(s in a)c=a[s],s=="children"?v=c:s=="dangerouslySetInnerHTML"?p=c:s=="value"?m=c:s=="checked"?g=c:u&&typeof c!="function"||y[s]===c||F(_,s,c,y[s],l);if(p)u||r&&(p.__html==r.__html||p.__html==_.innerHTML)||(_.innerHTML=p.__html),e.__k=[];else if(r&&(_.innerHTML=""),oe(e.type=="template"?_.content:_,L(v)?v:[v],e,t,o,h=="foreignObject"?"http://www.w3.org/1999/xhtml":l,n,i,n?n[0]:t.__k&&S(t,0),u,f),n!=null)for(s=n.length;s--;)z(n[s]);u||(s="value",h=="progress"&&m==null?_.removeAttribute("value"):m!=null&&(m!==_[s]||h=="progress"&&!m||h=="option"&&m!=y[s])&&F(_,s,m,y[s],l),s="checked",g!=null&&g!=_[s]&&F(_,s,g,y[s],l))}return _}function G(_,e,t){try{if(typeof _=="function"){var o=typeof _.__u=="function";o&&_.__u(),o&&e==null||(_.__u=_(e))}else _.current=e}catch(l){d.__e(l,t)}}function ue(_,e,t){var o,l;if(d.unmount&&d.unmount(_),(o=_.ref)&&(o.current&&o.current!=_.__e||G(o,null,e)),(o=_.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(n){d.__e(n,e)}o.base=o.__P=null}if(o=_.__k)for(l=0;l<o.length;l++)o[l]&&ue(o[l],e,t||typeof _.type!="function");t||z(_.__e),_.__c=_.__=_.__e=void 0}function me(_,e,t){return this.constructor(_,t)}function ye(_,e,t){var o,l,n,i;e==document&&(e=document.documentElement),d.__&&d.__(_,e),l=(o=typeof t=="function")?null:t&&t.__k||e.__k,n=[],i=[],q(e,_=(!o&&t||e).__k=fe(I,null,[_]),l||M,M,e.namespaceURI,!o&&t?[t]:l?null:e.firstChild?D.call(e.childNodes):null,n,!o&&t?t:l?l.__e:e.firstChild,o,i),ie(n,_,i)}function ge(_,e){ye(_,e,ge)}function ke(_,e,t){var o,l,n,i,u=k({},_.props);for(n in _.type&&_.type.defaultProps&&(i=_.type.defaultProps),e)n=="key"?o=e[n]:n=="ref"?l=e[n]:u[n]=e[n]===void 0&&i!=null?i[n]:e[n];return arguments.length>2&&(u.children=arguments.length>3?D.call(arguments,2):t),E(_.type,u,o||_.key,l||_.ref,null)}function we(_){function e(t){var o,l;return this.getChildContext||(o=new Set,(l={})[e.__c]=this,this.getChildContext=function(){return l},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&o.forEach(function(i){i.__e=!0,B(i)})},this.sub=function(n){o.add(n);var i=n.componentWillUnmount;n.componentWillUnmount=function(){o&&o.delete(n),i&&i.call(n)}}),t.children}return e.__c="__cC"+te++,e.__=_,e.Provider=e.__l=(e.Consumer=function(t,o){return t.children(o)}).contextType=e,e}D=ne.slice,d={__e:function(_,e,t,o){for(var l,n,i;e=e.__;)if((l=e.__c)&&!l.__)try{if((n=l.constructor)&&n.getDerivedStateFromError!=null&&(l.setState(n.getDerivedStateFromError(_)),i=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(_,o||{}),i=l.__d),i)return l.__E=l}catch(u){_=u}throw _}},Y=0,ce=function(_){return _!=null&&_.constructor==null},N.prototype.setState=function(_,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=k({},this.state),typeof _=="function"&&(_=_(k({},t),this.props)),_&&k(t,_),_!=null&&this.__v&&(e&&this._sb.push(e),B(this))},N.prototype.forceUpdate=function(_){this.__v&&(this.__e=!0,_&&this.__h.push(_),B(this))},N.prototype.render=I,C=[],Z=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ee=function(_,e){return _.__v.__b-e.__v.__b},H.__r=0,_e=/(PointerCapture)$|Capture$/i,V=0,$=X(!1),j=X(!0),te=0;export{N as Component,I as Fragment,ke as cloneElement,we as createContext,fe as createElement,be as createRef,fe as h,ge as hydrate,ce as isValidElement,d as options,ye as render,he as toChildArray};
|
|
//# sourceMappingURL=preact.bundle.mjs.map
|