You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
11 KiB
2 lines
11 KiB
!function(n,l){"object"==typeof exports&&"undefined"!=typeof module?l(exports):"function"==typeof define&&define.amd?define(["exports"],l):l((n||self).preact={})}(this,function(n){var l,u,t,i,o,f,r,e,c,s={},a=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function p(n,l){for(var u in l)n[u]=l[u];return n}function d(n){var l=n.parentNode;l&&l.removeChild(n)}function y(n,u,t){var i,o,f,r={};for(f in u)"key"==f?i=u[f]:"ref"==f?o=u[f]:r[f]=u[f];if(arguments.length>2&&(r.children=arguments.length>3?l.call(arguments,2):t),"function"==typeof n&&null!=n.defaultProps)for(f in n.defaultProps)void 0===r[f]&&(r[f]=n.defaultProps[f]);return _(n,r,i,o,null)}function _(n,l,i,o,f){var r={type:n,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==f?++t:f};return null==f&&null!=u.vnode&&u.vnode(r),r}function b(n){return n.children}function g(n,l){this.props=n,this.context=l}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__d||u.__e;return"function"==typeof n.type?k(n):null}function m(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return m(n)}}function w(n){(!n.__d&&(n.__d=!0)&&o.push(n)&&!x.__r++||f!==u.debounceRendering)&&((f=u.debounceRendering)||r)(x)}function x(){var n,l,u,t,i,f,r,c,s;for(o.sort(e);n=o.shift();)n.__d&&(l=o.length,t=void 0,i=void 0,f=void 0,c=(r=(u=n).__v).__e,(s=u.__P)&&(t=[],i=[],(f=p({},r)).__v=r.__v+1,I(s,r,f,u.__n,void 0!==s.ownerSVGElement,null!=r.__h?[c]:null,t,null==c?k(r):c,r.__h,i),z(t,r,i),r.__e!=c&&m(r)),o.length>l&&o.sort(e));x.__r=0}function P(n,l,u,t,i,o,f,r,e,c,h){var p,d,y,g,m,w,x,P,S,j=0,A=t&&t.__k||a,D=A.length,H=D,z=l.length;for(u.__k=[],p=0;p<z;p++)null!=(g=u.__k[p]=null==(g=l[p])||"boolean"==typeof g||"function"==typeof g?null:"string"==typeof g||"number"==typeof g||"bigint"==typeof g?_(null,g,null,null,g):v(g)?_(b,{children:g},null,null,null):g.__b>0?_(g.type,g.props,g.key,g.ref?g.ref:null,g.__v):g)?(g.__=u,g.__b=u.__b+1,-1===(P=T(g,A,x=p+j,H))?y=s:(y=A[P]||s,A[P]=void 0,H--),I(n,g,y,i,o,f,r,e,c,h),m=g.__e,(d=g.ref)&&y.ref!=d&&(y.ref&&M(y.ref,null,g),h.push(d,g.__c||m,g)),null!=m&&(null==w&&(w=m),(S=y===s||null===y.__v)?-1==P&&j--:P!==x&&(P===x+1?j++:P>x?H>z-x?j+=P-x:j--:j=P<x&&P==x-1?P-x:0),x=p+j,"function"!=typeof g.type||P===x&&y.__k!==g.__k?"function"==typeof g.type||P===x&&!S?void 0!==g.__d?(e=g.__d,g.__d=void 0):e=m.nextSibling:e=C(n,m,e):e=$(g,e,n),"function"==typeof u.type&&(u.__d=e))):(y=A[p])&&null==y.key&&y.__e&&(y.__e==e&&(y.__=t,e=k(y)),N(y,y,!1),A[p]=null);for(u.__e=w,p=D;p--;)null!=A[p]&&("function"==typeof u.type&&null!=A[p].__e&&A[p].__e==u.__d&&(u.__d=A[p].__e.nextSibling),N(A[p],A[p]))}function $(n,l,u){for(var t,i=n.__k,o=0;i&&o<i.length;o++)(t=i[o])&&(t.__=n,l="function"==typeof t.type?$(t,l,u):C(u,t.__e,l));return l}function C(n,l,u){return null==u||u.parentNode!==n?n.insertBefore(l,null):l==u&&null!=l.parentNode||n.insertBefore(l,u),l.nextSibling}function T(n,l,u,t){var i=n.key,o=n.type,f=u-1,r=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type)return u;if(t>(null!=e?1:0))for(;f>=0||r<l.length;){if(f>=0){if((e=l[f])&&i==e.key&&o===e.type)return f;f--}if(r<l.length){if((e=l[r])&&i==e.key&&o===e.type)return r;r++}}return-1}function S(n,l,u,t,i){var o;for(o in u)"children"===o||"key"===o||o in l||A(n,o,null,u[o],t);for(o in l)i&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||A(n,o,l[o],u[o],t)}function j(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||h.test(l)?u:u+"px"}function A(n,l,u,t,i){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||j(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||j(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=Date.now(),n.addEventListener(l,o?H:D,o)):n.removeEventListener(l,o?H:D,o);else if("dangerouslySetInnerHTML"!==l){if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&"role"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u))}}function D(n){var l=this.l[n.type+!1];if(n.t){if(n.t<=l.u)return}else n.t=Date.now();return l(u.event?u.event(n):n)}function H(n){return this.l[n.type+!0](u.event?u.event(n):n)}function I(n,l,t,i,o,f,r,e,c,s){var a,h,d,y,_,k,m,w,x,$,C,T,S,j,A,D=l.type;if(void 0!==l.constructor)return null;null!=t.__h&&(c=t.__h,e=l.__e=t.__e,l.__h=null,f=[e]),(a=u.__b)&&a(l);n:if("function"==typeof D)try{if(w=l.props,x=(a=D.contextType)&&i[a.__c],$=a?x?x.props.value:a.__:i,t.__c?m=(h=l.__c=t.__c).__=h.__E:("prototype"in D&&D.prototype.render?l.__c=h=new D(w,$):(l.__c=h=new g(w,$),h.constructor=D,h.render=O),x&&x.sub(h),h.props=w,h.state||(h.state={}),h.context=$,h.__n=i,d=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=D.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=p({},h.__s)),p(h.__s,D.getDerivedStateFromProps(w,h.__s))),y=h.props,_=h.state,h.__v=l,d)null==D.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==D.getDerivedStateFromProps&&w!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(w,$),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(w,h.__s,$)||l.__v===t.__v)){for(l.__v!==t.__v&&(h.props=w,h.state=h.__s,h.__d=!1),l.__e=t.__e,l.__k=t.__k,l.__k.forEach(function(n){n&&(n.__=l)}),C=0;C<h._sb.length;C++)h.__h.push(h._sb[C]);h._sb=[],h.__h.length&&r.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(w,h.__s,$),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k)})}if(h.context=$,h.props=w,h.__P=n,h.__e=!1,T=u.__r,S=0,"prototype"in D&&D.prototype.render){for(h.state=h.__s,h.__d=!1,T&&T(l),a=h.render(h.props,h.state,h.context),j=0;j<h._sb.length;j++)h.__h.push(h._sb[j]);h._sb=[]}else do{h.__d=!1,T&&T(l),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++S<25);h.state=h.__s,null!=h.getChildContext&&(i=p(p({},i),h.getChildContext())),d||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),P(n,v(A=null!=a&&a.type===b&&null==a.key?a.props.children:a)?A:[A],l,t,i,o,f,r,e,c,s),h.base=l.__e,l.__h=null,h.__h.length&&r.push(h),m&&(h.__E=h.__=null)}catch(n){l.__v=null,(c||null!=f)&&(l.__e=e,l.__h=!!c,f[f.indexOf(e)]=null),u.__e(n,l,t)}else null==f&&l.__v===t.__v?(l.__k=t.__k,l.__e=t.__e):l.__e=L(t.__e,l,t,i,o,f,r,c,s);(a=u.diffed)&&a(l)}function z(n,l,t){for(var i=0;i<t.length;i++)M(t[i],t[++i],t[++i]);u.__c&&u.__c(l,n),n.some(function(l){try{n=l.__h,l.__h=[],n.some(function(n){n.call(l)})}catch(n){u.__e(n,l.__v)}})}function L(n,u,t,i,o,f,r,e,c){var a,h,p,y=t.props,_=u.props,b=u.type,g=0;if("svg"===b&&(o=!0),null!=f)for(;g<f.length;g++)if((a=f[g])&&"setAttribute"in a==!!b&&(b?a.localName===b:3===a.nodeType)){n=a,f[g]=null;break}if(null==n){if(null===b)return document.createTextNode(_);n=o?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,_.is&&_),f=null,e=!1}if(null===b)y===_||e&&n.data===_||(n.data=_);else{if(f=f&&l.call(n.childNodes),h=(y=t.props||s).dangerouslySetInnerHTML,p=_.dangerouslySetInnerHTML,!e){if(null!=f)for(y={},g=0;g<n.attributes.length;g++)y[n.attributes[g].name]=n.attributes[g].value;(p||h)&&(p&&(h&&p.__html==h.__html||p.__html===n.innerHTML)||(n.innerHTML=p&&p.__html||""))}if(S(n,_,y,o,e),p)u.__k=[];else if(P(n,v(g=u.props.children)?g:[g],u,t,i,o&&"foreignObject"!==b,f,r,f?f[0]:t.__k&&k(t,0),e,c),null!=f)for(g=f.length;g--;)null!=f[g]&&d(f[g]);e||("value"in _&&void 0!==(g=_.value)&&(g!==n.value||"progress"===b&&!g||"option"===b&&g!==y.value)&&A(n,"value",g,y.value,!1),"checked"in _&&void 0!==(g=_.checked)&&g!==n.checked&&A(n,"checked",g,y.checked,!1))}return n}function M(n,l,t){try{"function"==typeof n?n(l):n.current=l}catch(n){u.__e(n,t)}}function N(n,l,t){var i,o;if(u.unmount&&u.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||M(i,null,l)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){u.__e(n,l)}i.base=i.__P=null,n.__c=void 0}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&N(i[o],l,t||"function"!=typeof n.type);t||null==n.__e||d(n.__e),n.__=n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function q(n,t,i){var o,f,r,e;u.__&&u.__(n,t),f=(o="function"==typeof i)?null:i&&i.__k||t.__k,r=[],e=[],I(t,n=(!o&&i||t).__k=y(b,null,[n]),f||s,s,void 0!==t.ownerSVGElement,!o&&i?[i]:f?null:t.firstChild?l.call(t.childNodes):null,r,!o&&i?i:f?f.__e:t.firstChild,o,e),z(r,n,e)}l=a.slice,u={__e:function(n,l,u,t){for(var i,o,f;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),f=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),f=i.__d),f)return i.__E=i}catch(l){n=l}throw n}},t=0,i=function(n){return null!=n&&void 0===n.constructor},g.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=p({},this.state),"function"==typeof n&&(n=n(p({},u),this.props)),n&&p(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w(this))},g.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w(this))},g.prototype.render=b,o=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},x.__r=0,c=0,n.Component=g,n.Fragment=b,n.cloneElement=function(n,u,t){var i,o,f,r,e=p({},n.props);for(f in n.type&&n.type.defaultProps&&(r=n.type.defaultProps),u)"key"==f?i=u[f]:"ref"==f?o=u[f]:e[f]=void 0===u[f]&&void 0!==r?r[f]:u[f];return arguments.length>2&&(e.children=arguments.length>3?l.call(arguments,2):t),_(n.type,e,i||n.key,o||n.ref,null)},n.createContext=function(n,l){var u={__c:l="__cC"+c++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,w(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u},n.createElement=y,n.createRef=function(){return{current:null}},n.h=y,n.hydrate=function n(l,u){q(l,u,n)},n.isValidElement=i,n.options=u,n.render=q,n.toChildArray=function n(l,u){return u=u||[],null==l||"boolean"==typeof l||(v(l)?l.some(function(l){n(l,u)}):u.push(l)),u}});
|
|
//# sourceMappingURL=preact.umd.js.map
|
|
|