mirror of
https://github.com/imezx/Warp.git
synced 2025-04-24 23:20:02 +00:00
3 lines
11 KiB
JavaScript
3 lines
11 KiB
JavaScript
|
!function(n){"function"==typeof define&&define.amd?define(n):n()}(function(){var n,l,t,u,i,o,r,e,f,c,a=65536,s=1<<17,h={},v=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var t in l)n[t]=l[t];return n}function _(n){var l=n.parentNode;l&&l.removeChild(n)}function m(l,t,u){var i,o,r,e={};for(r in t)"key"==r?i=t[r]:"ref"==r?o=t[r]:e[r]=t[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):u),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===e[r]&&(e[r]=l.defaultProps[r]);return g(l,e,i,o,null)}function g(n,u,i,o,r){var e={type:n,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++t:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(e),e}function b(n){return n.children}function k(n,l){this.props=n,this.context=l}function w(n,l){if(null==l)return n.__?w(n.__,n.__i+1):null;for(var t;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e)return t.__e;return"function"==typeof n.type?w(n):null}function C(n){var l,t;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e){n.__e=n.__c.base=t.__e;break}return C(n)}}function x(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,t,u,o,r,f,c,a,s;for(i.sort(e);n=i.shift();)n.__d&&(t=i.length,o=void 0,f=(r=(u=n).__v).__e,a=[],s=[],(c=u.__P)&&((o=d({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),L(c,o,r,u.__n,void 0!==c.ownerSVGElement,32&r.__u?[f]:null,a,null==f?w(r):f,!!(32&r.__u),s),o.__.__k[o.__i]=o,M(a,o,s),o.__e!=f&&C(o)),i.length>t&&i.sort(e));P.__r=0}function S(n,l,t,u,i,o,r,e,f,c,s){var p,y,d,_,m,g=u&&u.__k||v,b=l.length;for(t.__d=f,$(t,l,g),f=t.__d,p=0;p<b;p++)null!=(d=t.__k[p])&&"boolean"!=typeof d&&"function"!=typeof d&&(y=-1===d.__i?h:g[d.__i]||h,d.__i=p,L(n,d,y,i,o,r,e,f,c,s),_=d.__e,d.ref&&y.ref!=d.ref&&(y.ref&&z(y.ref,null,d),s.push(d.ref,d.__c||_,d)),null==m&&null!=_&&(m=_),d.__u&a||y.__k===d.__k?f=A(d,f,n):"function"==typeof d.type&&void 0!==d.__d?f=d.__d:_&&(f=_.nextSibling),d.__d=void 0,d.__u&=-196609);t.__d=f,t.__e=m}function $(n,l,t){var u,i,o,r,e,f=l.length,c=t.length,h=c,v=0;for(n.__k=[],u=0;u<f;u++)null!=(i=n.__k[u]=null==(i=l[u])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?g(null,i,null,null,i):y(i)?g(b,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=n,i.__b=n.__b+1,e=E(i,t,r=u+v,h),i.__i=e,o=null,-1!==e&&(h--,(o=t[e])&&(o.__u|=s)),null==o||null===o.__v?(-1==e&&v--,"function"!=typeof i.type&&(i.__u|=a)):e!==r&&(e===r+1?v++:e>r?h>f-r?v+=e-r:v--:v=e<r&&e==r-1?e-r:0,e!==u+v&&(i.__u|=a))):(o=t[u])&&null==o.key&&o.__e&&(o.__e==n.__d&&(n.__d=w(o)),F(o,o,!1),t[u]=null,h--);if(h)for(u=0;u<c;u++)null!=(o=t[u])&&0==(o.__u&s)&&(o.__e==n.__d&&(n.__d=w(o)),F(o,o))}function A(n,l,t){var u,i;if("function"==typeof n.type){for(u=n.__k,i=0;u&&i<u.length;i++)u[i]&&(u[i].__=n,l=A(u[i],l,t));return l}return n.__e!=l&&(t.insertBefore(n.__e,l||null),l=n.__e),l&&l.nextSibling}function E(n,l,t,u){var i=n.key,o=n.type,r=t-1,e=t+1,f=l[t];if(null===f||f&&i==f.key&&o===f.type)return t;if(u>(null!=f&&0==(f.__u&s)?1:0))for(;r>=0||e<l.length;){if(r>=0){if((f=l[r])&&0==(f.__u&s)&&i==f.key&&o===f.type)return r;r--}if(e<l.length){if((f=l[e])&&0==(f.__u&s)&&i==f.key&&o===f.type)return e;e++}}return-1}function H(n,l,t){"-"===l[0]?n.setProperty(l,null==t?"":t):n[l]=null==t?"":"number"!=typeof t||p.test(l)?t:t+"px"}function I(n,l,t,u,i){var o;n:if("style"===l)if("string"==typeof t)n.style.cssText=t;else{if("string"==typeof u&&(n.style.cssText=u=""),u)for(l in u)t&&l in t||H(n.style,l,"");if(t)for(l in t)u&&t[l]===u[l]||H(n.style,l,t[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]=t,t?u?t.t=u.t:(t.t=Date.now(),n.addEventListener(l,o?D:T,o)):n.r
|
||
|
//# sourceMappingURL=preact.min.umd.js.map
|