earthnut 0.0.1 → 0.0.2
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/BackgroundRipple/index.cjs +1 -1
- package/BackgroundRipple/index.mjs +1 -1
- package/README.md +15 -0
- package/customHooks/useRipples/buildBackground/create-background-color.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/create-linear-gradient.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/default-background/index.d.ts +1 -1
- package/customHooks/useRipples/buildBackground/loadImage.d.ts +1 -1
- package/customHooks/useRipples/buildBackground/type.d.ts +4 -0
- package/customHooks/useRipples/buildBackground/utils/bindImage.d.ts +2 -1
- package/customHooks/useRipples/rippersData/fadeData.d.ts +16 -2
- package/customHooks/useRipples/rippersData/renderData.d.ts +2 -0
- package/customHooks/useRipples/rippersData/useOptions.d.ts +1 -1
- package/customHooks/useRipples/types.d.ts +5 -5
- package/index.cjs +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -2
- package/useRipples/index.cjs +1 -1
- package/useRipples/index.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={56:(e,t,r)=>{e.exports=function(e){var t=r.nc;t&&e.setAttribute("nonce",t)}},72:e=>{var t=[];function r(e){for(var r=-1,n=0;n<t.length;n++)if(t[n].identifier===e){r=n;break}return r}function n(e,n){for(var o={},a=[],u=0;u<e.length;u++){var l=e[u],s=n.base?l[0]+n.base:l[0],c=o[s]||0,f="".concat(s," ").concat(c);o[s]=c+1;var p=r(f),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)t[p].references++,t[p].updater(d);else{var h=i(d,n);n.byIndex=u,t.splice(u,0,{identifier:f,updater:h,references:1})}a.push(f)}return a}function i(e,t){var r=t.domAPI(t);return r.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;r.update(e=t)}else r.remove()}}e.exports=function(e,i){var o=n(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var u=r(o[a]);t[u].references--}for(var l=n(e,i),s=0;s<o.length;s++){var c=r(o[s]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}o=l}}},109:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(601),i=r.n(n),o=r(314),a=r.n(o)()(i());a.push([e.id,".en-ripple-container{width:100%;height:100%;position:relative;top:0px;left:0px;z-index:1}",""]);const u=a},113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},148:(e,t,r)=>{r.d(t,{useRipples:()=>Be});var n=r(953);const i=require("a-element-inline-style");var o=r(570);function a(e,t,r,n){function i(e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var a,u={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(u.id,i(r.VERTEX_SHADER,e)),r.attachShader(u.id,i(r.FRAGMENT_SHADER,t)),r.linkProgram(u.id),!r.getProgramParameter(u.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(u.id));r.useProgram(u.id),r.enableVertexAttribArray(0);for(var l=e+t,s=/uniform (\w+) (\w+)/g;!(0,o.isNull)(a=s.exec(l));){var c=a[2];u.locations[c]=r.getUniformLocation(u.id,c)}return u}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(t||0)),r.bindTexture(r.TEXTURE_2D,e)}function l(){var e=this,t=function(){return e.initState=!1,null};if(!this.gl)return t();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce((function(e,t){var n=r.getExtension(t);return n&&e.push([t,n]),e}),[]));if(!n.OES_texture_float)return t();var i=[];function o(e,t,r){var i="OES_texture_"+e,o=i+"_linear",a=o in n;return{type:t,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),u=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,u),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var l=null,s=0;s<i.length;s++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[s].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){l=i[s];break}return l}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d(n.key),n)}}function f(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e,t,r){return(t=d(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}var h=f((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),p(this,"canvas",void 0),p(this,"gl",void 0),p(this,"config",void 0),p(this,"initState",!0),this.canvas=t;var r=t.getContext("webgl");if((0,o.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(l,this,[])}));const v=require("a-js-tools");var m,y={imageUrl:"",resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0};function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function g(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,E(n.key),n)}}function E(e){var t=function(e){if("object"!=b(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==b(t)?t:t+""}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function R(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,T(n.key),n)}}function T(e){var t=function(e){if("object"!=w(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==w(t)?t:t+""}function S(e,t,r){return e.set(x(e,t),r),r}function P(e,t){return e.get(x(e,t))}function x(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}function O(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}Object.freeze(y),new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(){};return Object.setPrototypeOf(t,this),Object.defineProperties(t,{info:{value:function(){},configurable:!1,writable:!1},warn:{value:function(){},configurable:!1,writable:!1},error:{value:function(){},configurable:!1,writable:!1},type:{value:!1,configurable:!1,writable:!1}}),t},(t=[{key:"clear",value:function(){}}])&&g(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}())({name:"earthnut",type:!1});var D=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t={list:[],diameter:48,radius:0,cells:0};t.diameter%2!=0&&t.diameter++;var r=t.diameter,n=t.list,i=r/2;t.radius=i,t.cells=Math.pow(r,2);for(var o=0;o<r;o++){n[o]=[];for(var a=0;a<r;a++)n[o][a]=[0,0,0,0]}for(var u=0;u<=i;u++)for(var l=u;l<=i;l++){var s=n[u][l],c=function(){return(0,v.getRandomInt)(255,190)};s[0]=c(),s[1]=c(),s[2]=c(),s[3]=Math.ceil(Math.sqrt(Math.pow(u,2)+Math.pow(l,2)))<=i?(0,v.getRandomInt)(120,180):(0,v.getRandomInt)(160,240)}for(var f=0;f<=i;f++)for(var p=0;p<=f;p++)n[f][p]=n[p][f];for(var d=i;d<r;d++)for(var h=0;h<=i;h++)n[d][h]=n[r-d][h];for(var m=0;m<i;m++)for(var y=i;y<r;y++)n[m][y]=n[m][r-y];for(var b=i;b<r;b++)for(var g=i;g<r;g++)n[b][g]=n[b][r-g];var E=e%r;return t.list=[].concat(O(n.slice(E)),O(n.slice(0,E))),t},k=new(m=new WeakMap,function(){return e=function e(){var t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}(this,m,1),t=this,r="data",n=D(),(r=T(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n},(t=[{key:"build",value:function(){P(m,this)>100&&S(m,this,0),this.data=D(S(m,this,P(m,this)+3))}}])&&R(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());function A(e,t){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),a=n.getContext("2d");return(0,o.isNull)(i)||(0,o.isNull)(a)?r:(r.width=n.width=e,r.height=n.height=t,i.clearRect(0,0,e,t),a.clearRect(0,0,e,t),i.globalAlpha=1,i.putImageData(function(e,t){Date.now();for(var r=new ImageData(e,t),n=r.data,i=k.data,o=i.diameter,a=i.list,u=e*o,l=0;l<n.length;l+=4){var s=l/4%u,c=s%e%o,f=Math.floor(s/e),p=a[c][f];n[l]=p[0],n[l+1]=p[1],n[l+2]=p[2],n[l+3]=p[3]}return r}(e,t),0,0),a.fillStyle="#ffffff",a.fillRect(0,0,e,t),a.drawImage(r,0,0,e,t),a.globalCompositeOperation="source-over",n)}function I(){var e=this.fadeData,t=e.backgroundInfo,r=t.width,n=t.height;k.build(),e.toBeList.push(A(r,n)),e.run()}function F(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if((0,o.isNull)(t))Reflect.apply(I,this,[]);else{var i,a,u=t.lastUseStyle,l=n.backgroundInfo,s=l.width,c=l.height,f=r.imageUrl||(i=u.backgroundImage,a=/url\(["']?([^"']*)["']?\)/.exec(i),(0,o.isNull)(a)?null:a[1]);if(t.imageSource=f,f){var p=function(e,t,r){var n=new Image(t,r);return n.width=t,n.height=r,n.src=e,n}(f,s,c);p.onload=function(){clearTimeout(n.transparentId),n.toBeList=n.toBeList.filter((function(e){return"img"===e.tagName.toLowerCase()&&e.getAttribute("src")!==f&&e.width===s&&e.height===c})),n.toBeList.push(p),n.run()},p.onerror=function(){Reflect.apply(I,e,[])},p.crossOrigin=r.crossOrigin}else Reflect.apply(I,this,[])}}function j(){var e=this.renderData;if(!(0,o.isNull)(e)){var t=e.parentElement;t&&[["background-image","none"],["background-color","transparent"]].forEach((function(e){return t.style.setProperty(e[0],e[1],"important")}))}}function C(e){var t=window.getComputedStyle(e),r=e.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:t.backgroundColor,backgroundImage:t.backgroundImage,backgroundSize:t.backgroundSize,backgroundPosition:t.backgroundPosition,backgroundRepeat:t.backgroundRepeat,backgroundClip:t.backgroundClip,backgroundOrigin:t.backgroundOrigin,backgroundAttachment:t.backgroundAttachment,position:t.position}}function U(e){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(e)}function N(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,B(n.key),n)}}function L(e,t,r){return t&&N(e.prototype,t),r&&N(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function M(e,t,r){return(t=B(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B(e){var t=function(e){if("object"!=U(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=U(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==U(t)?t:t+""}var X=L((function e(t,r,n){var i,a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),M(this,"quad",null),M(this,"lastRaindropsFallTime",0),M(this,"parentElement",void 0),M(this,"mutationObserver",void 0),M(this,"resizeObserver",void 0),M(this,"renderProgram",void 0),M(this,"imageSource",""),M(this,"dropProgram",void 0),M(this,"updateProgram",void 0),M(this,"textures",[]),M(this,"backgroundTexture",[]),M(this,"textureDelta",void 0),M(this,"framebuffers",[]),M(this,"bufferWriteIndex",0),M(this,"bufferReadIndex",1),M(this,"originStyle",void 0),M(this,"lastUseStyle",void 0),M(this,"events",{}),M(this,"animationFrameId",0),this.parentElement=null!==(i=t.parentElement)&&void 0!==i?i:document.body,Reflect.apply(j,n,[]),this.originStyle=this.lastUseStyle=C(this.parentElement),this.mutationObserver=new MutationObserver((function(e){e.forEach((function(e){var t,i;if(e.target===a.parentElement&&"attributes"===e.type&&n.options.visible){var u=Object.values(a.lastUseStyle),l=C(a.parentElement),s=Object.values(l);if((0,o.isEmptyArray)(v.enArr.difference(u,s)))return;var c="none"===(i=l.backgroundImage)||""===i,f="rgba(0, 0, 0, 0)"===(t=l.backgroundColor)||"#ffffffff"===t||"transport"===t;if(c&&f)return;a.lastUseStyle=l,Reflect.apply(r,n,[]),Reflect.apply(j,n,[])}}))})),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver((function(){Reflect.apply(r,n,[])})),this.resizeObserver.observe(this.parentElement)}));function W(){var e=this.renderData,t=this.fadeData;if(!(0,o.isNull)(e)){var r,n,i,a=e.parentElement,u=window.getComputedStyle(a),l=u.backgroundSize,s=u.backgroundAttachment,c=u.backgroundPosition,f=/\s+/.test(r=c)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):z(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],p={left:0,top:0,width:0,height:0};"fixed"===s?(p.height=window.innerHeight,p.left=window.screenX,p.top=window.screenY,p.width=window.innerWidth):(p.left=0,p.top=0,p.width=a.scrollWidth,p.height=a.scrollHeight);var d=t.backgroundInfo||{width:100,height:100},h=d.width,v=d.height;if("cover"===l){var m=Math.max(p.width/h,p.height/v);n=h*m,i=v*m}else if("contain"===l){var y=Math.min(p.width/h,p.height/v);n=h*y,i=v*y}else{var b=l.split(" ");n=b[0]||"",i=b[1]||n,z(n)?n=p.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),z(i)?i=p.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=h,i=v):("auto"===n&&(n=h*(Number(i)/v)),"auto"===i&&(i=v*(Number(n)/h)))}var g=f&&f[0]||"0%",E=f&&f[1]||"0%";g=z(g)?(p.left+(p.width-Number(n))*parseFloat(g)/100).toString():(p.left+parseFloat(g)).toString(),E=z(E)?(p.top+(p.height-Number(i))*parseFloat(E)/100).toString():(p.top+parseFloat(E)).toString(),e.renderProgram.uniforms.topLeft=new Float32Array([(a.offsetLeft-Number(g))/n,(a.offsetTop-Number(E))/i]),e.renderProgram.uniforms.bottomRight=new Float32Array([e.renderProgram.uniforms.topLeft[0]+a.clientWidth/n,e.renderProgram.uniforms.topLeft[1]+a.clientHeight/i]);var w=Math.max(this.canvas.width,this.canvas.height);e.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/w,this.canvas.height/w])}}function z(e){return e.endsWith("%")}function G(){var e=this.gl,t=this.renderData;(0,o.isNull)(t)||(e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_FAN,0,4))}function H(){var e=this.gl,t=this.renderData,r=this.options;if(!(0,o.isNull)(t)){var n=t.textures,i=t.backgroundTexture,a=r.perturbance;e.bindFramebuffer(e.FRAMEBUFFER,null),e.viewport(0,0,this.canvas.width,this.canvas.height),e.enable(e.BLEND),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.useProgram(t.renderProgram.id),Reflect.apply(u,this,[i,0]),Reflect.apply(u,this,[n[0],1]),e.uniform1f(t.renderProgram.locations.perturbance,a),e.uniform2fv(t.renderProgram.locations.topLeft,t.renderProgram.uniforms.topLeft),e.uniform2fv(t.renderProgram.locations.bottomRight,t.renderProgram.uniforms.bottomRight),e.uniform2fv(t.renderProgram.locations.containerRatio,t.renderProgram.uniforms.containerRatio),e.uniform1i(t.renderProgram.locations.samplerBackground,0),e.uniform1i(t.renderProgram.locations.samplerRipples,1),Reflect.apply(G,this,[]),e.disable(e.BLEND)}}function q(){var e=this.renderData;if(!(0,o.isNull)(e)){var t=e.bufferWriteIndex,r=e.bufferReadIndex;e.bufferWriteIndex=1-t,e.bufferReadIndex=1-r}}function Y(){var e=this.gl,t=this.renderData,r=this.options;if(!(0,o.isNull)(t)){var n=t.updateProgram,i=t.textures,a=t.framebuffers,l=t.bufferWriteIndex,s=t.bufferReadIndex,c=r.resolution;e.viewport(0,0,c,c),e.bindFramebuffer(e.FRAMEBUFFER,a[l]),Reflect.apply(u,this,[i[s]]),e.useProgram(n.id),Reflect.apply(G,this,[]),Reflect.apply(q,this,[])}}function K(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if(!(0,o.isNull)(t)){var i=t.parentElement,a=n.isTransitioning,u=r.running,l=r.idleFluctuations,s=r.lastRunningState,c=getComputedStyle(i);n.backgroundInfo={width:parseInt(c.width),height:parseInt(c.height)},Reflect.apply(W,this,[]),u?(s||(r.lastRunningState=!0,this.show()),l&&this.raindropsFall(),a&&this.fade(),Reflect.apply(Y,this,[]),Reflect.apply(H,this,[])):s&&(r.lastRunningState=!1,this.hide()),t.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(K,e,[])}))}}function V(e,t,r){var n=this.renderData;if(!(0,o.isNull)(n)){var i=n.parentElement,a=window.getComputedStyle(i),u=parseInt(a.borderLeftWidth)||0,l=parseInt(a.borderTopWidth)||0,s=i.getBoundingClientRect(),c=e.clientX-s.left-u,f=e.clientY-s.top-l;this.drop(c,f,t,r)}}function J(){var e=this,t=this.renderData,r=this.options;if(!(0,o.isNull)(t)){var n=t.parentElement,i=t.events,a=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(t.lastRaindropsFallTime=Date.now(),Reflect.apply(V,e,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(e){for(var t=r.accelerating;t--;)a(e)},i.touchmove=i.touchstart=function(e){for(var t=e.touches,r=0;r<t.length;r++)a(t[r])},i.mousedown=function(e){return a(e,!0)},Object.keys(i).forEach((function(e){return null==n?void 0:n.addEventListener(e,i[e],{passive:!0})}))}}var Z="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function $(){var e=this.gl,t=this.renderData;if(!(0,o.isNull)(t)){var r=t.textureDelta;t.dropProgram=a(Z,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",e);var n=t.updateProgram=a(Z,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);e.uniform2fv(n.locations.delta,r),t.renderProgram=a("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",e),e.uniform2fv(t.renderProgram.locations.delta,r)}}function Q(){var e=this.gl,t=this.renderData;if(!(0,o.isNull)(t)){var r=t.backgroundTexture=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)}}function ee(e){var t=this.gl,r=this.renderData,n=this.fadeData;if(!(0,o.isNull)(r)){var i=r.backgroundTexture,a=n.backgroundInfo,u=a.width,l=a.height,s=function(e){return(0,o.isZero)(e&e-1)},c=s(u)&&s(l)?t.REPEAT:t.CLAMP_TO_EDGE;t.bindTexture(t.TEXTURE_2D,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,c),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,c),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e)}}function te(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if(!(0,o.isNull)(t)&&this.config){var i=t.textures,a=t.framebuffers,u=r.resolution,l=this.gl,s=1/u;t.textureDelta=new Float32Array([s,s]),this.config.extensions.forEach((function(e){return l.getExtension(e)}));for(var c=this.config.arrayType,f=c?new c(u*u*4):null,p=this.config,d=0;d<2;d++){var h=l.createTexture(),v=l.createFramebuffer();l.bindFramebuffer(l.FRAMEBUFFER,v),l.bindTexture(l.TEXTURE_2D,h),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,u,u,0,l.RGBA,p.type,f),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,h,0),i.push(h),a.push(v)}t.quad=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,t.quad),l.bufferData(l.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),l.STATIC_DRAW),Reflect.apply($,this,[]),Reflect.apply(Q,this,[]),Reflect.apply(I,this,[]),Reflect.apply(F,this,[]),l.clearColor(0,0,0,0),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(J,this,[]),Reflect.apply(ee,this,[n.lastDrawImage]),t.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(K,e,[])}))}}function re(){var e=this.renderData,t=this.fadeData;if(!(0,o.isNull)(e)){var r=e.parentElement,n=t.backgroundInfo,i=r.offsetWidth,a=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=a,Reflect.apply(F,this,[])}}function ne(){var e=this.renderData;if(!(0,o.isNull)(e)){var t=e.parentElement,r=e.originStyle;t.style.setProperty("background-image",r.inlineBackgroundImage),t.style.setProperty("background-color",r.inlineBackgroundColor)}}function ie(){var e=this.renderData,t=this.fadeData;if(!(0,o.isNull)(e)){if(e.animationFrameId&&window.cancelAnimationFrame(e.animationFrameId),t.transparentId&&clearTimeout(t.transparentId),null!=e&&e.parentElement&&null!=e&&e.events){var r,n,i,a=e.parentElement,u=e.events;Object.keys(u).forEach((function(e){return a.removeEventListener&&a.removeEventListener(e,u[e])})),a.removeAttribute&&a.removeAttribute("data-ripples"),null===(r=e.mutationObserver)||void 0===r||r.takeRecords(),null===(n=e.mutationObserver)||void 0===n||n.disconnect(),e.mutationObserver=null,null===(i=e.resizeObserver)||void 0===i||i.disconnect(),e.resizeObserver=null}this.gl=null,Reflect.apply(ne,this,[]),Object.keys(e).forEach((function(t){return e[t]=null})),this.renderData=null,this.gl&&(this.gl=null)}}function oe(e,t,r,n){var i=this.renderData,a=this.options,l=this.gl;if(!(0,o.isNull)(i)){var s=i.parentElement,c=i.dropProgram,f=i.textures,p=i.framebuffers,d=i.bufferWriteIndex,h=i.bufferReadIndex,v=a.resolution,m=s.offsetWidth,y=s.offsetHeight,b=Math.max(m,y);r/=b;var g=new Float32Array([(2*e-m)/b,(y-2*t)/b]);l.viewport(0,0,v,v),l.bindFramebuffer(l.FRAMEBUFFER,p[d]),Reflect.apply(u,this,[f[h]]),l.useProgram(c.id),l.uniform2fv(c.locations.center,g),l.uniform1f(c.locations.radius,r),l.uniform1f(c.locations.strength,n),Reflect.apply(G,this,[]),Reflect.apply(q,this,[])}}function ae(e){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(e)}function ue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,se(n.key),n)}}function le(e,t,r){return(t=se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function se(e){var t=function(e){if("object"!=ae(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=ae(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ae(t)?t:t+""}function ce(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function fe(e,t){return e.get(de(e,t))}function pe(e,t,r){return e.set(de(e,t),r),r}function de(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var he=new WeakMap,ve=new WeakMap,me=new WeakMap,ye=new WeakMap,be=new WeakMap,ge=new WeakMap,Ee=new WeakMap,we=function(){return e=function e(t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ce(this,he,y.accelerating),ce(this,ve,y.interactive),ce(this,me,y.resolution),ce(this,ye,y.perturbance),ce(this,be,y.dropRadius),le(this,"imageUrl",y.imageUrl),ce(this,ge,y.idleFluctuations),ce(this,Ee,y.raindropsTimeInterval),le(this,"crossOrigin","no-cors"),le(this,"visible",!1),le(this,"running",!1),le(this,"lastRunningState",!1),this.perturbance=t.perturbance,this.resolution=t.resolution,this.raindropsTimeInterval=t.raindropsTimeInterval,this.accelerating=t.accelerating,this.interactive=t.interactive,this.dropRadius=t.dropRadius,this.imageUrl=t.imageUrl,this.idleFluctuations=t.idleFluctuations,this.running=Boolean(null===(r=t.playingState)||void 0===r||r),this.crossOrigin=t.crossOrigin},(t=[{key:"accelerating",get:function(){return fe(he,this)},set:function(e){e>100||e<2||pe(he,this,e)}},{key:"interactive",get:function(){return fe(ve,this)},set:function(e){(0,o.isBoolean)(e)&&pe(ve,this,e)}},{key:"resolution",get:function(){return fe(me,this)},set:function(e){e<100||e>550||pe(me,this,e)}},{key:"perturbance",get:function(){return fe(ye,this)},set:function(e){e<1e-4||e>1||pe(ye,this,e)}},{key:"dropRadius",get:function(){return fe(be,this)},set:function(e){!isFinite(e)||e<10||pe(be,this,e)}},{key:"idleFluctuations",get:function(){return fe(ge,this)},set:function(e){(0,o.isBoolean)(e)&&pe(ge,this,e)}},{key:"raindropsTimeInterval",get:function(){return fe(Ee,this)},set:function(e){e<10||e>12e3||pe(Ee,this,e)}},{key:"playingState",get:function(){return this.running},set:function(e){this.running=Boolean(null==e||e)}}])&&ue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Re(){var e=this,t=this.options,r=this.fadeData;r.transparentId=setTimeout((function(){if(clearTimeout(r.transparentId),r.isTransitioning)return Reflect.apply(Re,e,[]);r.drawProgress=0,r.isTransitioning=!0}),2*t.raindropsTimeInterval)}function Te(){var e=this.renderData,t=this.fadeData,r=t.toBeList,n=t.drawProgress,i=t.lastDrawImage,a=t.backgroundInfo;if(!(0,o.isNull)(e)&&!(0,o.isEmptyArray)(r)){if(t.drawProgress>1e3)return t.isTransitioning=!1,t.lastDrawImage=r.shift(),Reflect.apply(ee,this,[t.lastDrawImage]),void((0,o.isEmptyArray)(r)||Reflect.apply(Re,this,[]));t.drawProgress+=18;var u=document.createElement("canvas"),l=u.getContext("2d");if(!((0,o.isNull)(l)||(0,o.isNull)(i)||(0,o.isEmptyArray)(r))){var s=a.width,c=a.height;u.width=s,u.height=c,l.clearRect(0,0,s,c),l.drawImage(i,0,0,s,c),l.globalAlpha=n/1e3,l.drawImage(r[0],0,0,s,c),l.globalAlpha=1,Reflect.apply(ee,this,[u])}}}function Se(e){return Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Se(e)}function Pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Oe(n.key),n)}}function xe(e,t,r){return(t=Oe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oe(e){var t=function(e){if("object"!=Se(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Se(t)?t:t+""}var _e=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xe(this,"backgroundInfo",{width:0,height:0}),xe(this,"transparentId",setTimeout(Boolean)),xe(this,"lastDrawImage",void 0),xe(this,"toBeList",[]),xe(this,"drawProgress",0),xe(this,"isTransitioning",!1);var r,n,i=t.renderData;if((0,o.isNull)(i))r=10,n=10;else{var a=getComputedStyle(i.parentElement);r=parseInt(a.width),n=parseInt(a.height)}this.backgroundInfo={width:r,height:n},this.lastDrawImage=A(r,n)},(t=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}}])&&Pe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function De(e){return De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},De(e)}function ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(r),!0).forEach((function(t){Ue(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ie(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ne(n.key),n)}}function Fe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fe=function(){return!!e})()}function je(e){return je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},je(e)}function Ce(e,t){return Ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ce(e,t)}function Ue(e,t,r){return(t=Ne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ne(e){var t=function(e){if("object"!=De(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=De(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==De(t)?t:t+""}var Le=new WeakMap,Me=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ue(n=function(e,t,r){return t=je(t),function(e,t){if(t&&("object"==De(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fe()?Reflect.construct(t,r||[],je(e).constructor):t.apply(e,r))}(this,t,[e]),"renderData",null),Ue(n,"options",void 0),Ue(n,"fadeData",void 0),Ue(n,"defaults",y),Ue(n,"initialized",!1),function(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}(n,Le,(0,v.debounce)(re,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new we(Ae(Ae({},n.defaults),r)),n.renderData=new X(e,n.reloadBackground,n),n.fadeData=new _e(n),(0,o.isFalse)(n.initState)||(0,o.isNull)(e.parentElement)||(0,o.isNull)(n.config)||(0,o.isNull)(n.gl)?n.initState=!1:(function(e){var t=e.parentElement;e.width=t.clientWidth,e.height=t.clientHeight,(0,i.setStyle)(e,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(e),Reflect.apply(te,n,[])),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ce(e,t)}(t,e),r=t,n=[{key:"raindropsFall",value:function(){var e=this.renderData,t=this.options,r=this.fadeData;if(!(0,o.isNull)(e)){var n=r.backgroundInfo,i=e.lastRaindropsFallTime,a=t.raindropsTimeInterval,u=t.dropRadius,l=Date.now();if(!(l-i<a)){e.lastRaindropsFallTime=l;var s=function(e){return(0,v.getRandomInt)(e)},c=n.width,f=n.height;this.drop(s(c),s(f),u,.03)}}}},{key:"drop",value:function(e,t,r,n){Reflect.apply(oe,this,[e,t,r,n])}},{key:"fade",value:function(){Reflect.apply(Te,this,[])}},{key:"reloadBackground",value:function(){var e,t;(e=Le,t=this,e.get(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}(e,t))).call(this)}},{key:"destroy",value:function(){Reflect.apply(ie,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(j,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(ne,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var e=this.options;e.running=!e.running}},{key:"set",value:function(e,t){"imageUrl"===e?(this.options.imageUrl=t,Reflect.apply(F,this,[])):this.options[e]=t}}],n&&Ie(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(h);function Be(e,t){var r=(0,n.useRef)(null);return(0,n.useEffect)((function(){if(!(0,o.isNull)(e.current))return r.current=new Me(e.current,t&&t.option),function(){var e,t;return null!==(e=null===(t=r.current)||void 0===t?void 0:t.destroy())&&void 0!==e?e:void 0}}),[]),r}},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var u=0;u<this.length;u++){var l=this[u][0];null!=l&&(a[l]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);n&&a[c[0]]||(void 0!==o&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),r&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=r):c[2]=r),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},570:e=>{e.exports=require("a-type-of-js")},601:e=>{e.exports=function(e){return e[1]}},659:e=>{var t={};e.exports=function(e,r){var n=function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},763:e=>{e.exports=require("xcn")},825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(r){!function(e,t,r){var n="";r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {"));var i=void 0!==r.layer;i&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,i&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var o=r.sourceMap;o&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},953:e=>{e.exports=require("react")}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nc=void 0;var n={};r.r(n),r.d(n,{BackgroundRipple:()=>_});var i=r(953),o=r.n(i),a=r(148),u=r(570),l=r(763),s=r(72),c=r.n(s),f=r(825),p=r.n(f),d=r(659),h=r.n(d),v=r(56),m=r.n(v),y=r(540),b=r.n(y),g=r(113),E=r.n(g),w=r(109),R={};function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}R.styleTagTransform=E(),R.setAttributes=m(),R.insert=h().bind(null,"head"),R.domAPI=p(),R.insertStyleElement=b(),c()(w.A,R),w.A&&w.A.locals&&w.A.locals;var S=["children","style"];function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){O(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e,t,r){return(t=function(e){var t=function(e){if("object"!=T(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=T(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==T(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _=(0,i.forwardRef)((function(e,t){var r=e.children,n=e.style,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,S),c=(0,i.useRef)(null),f=(0,a.useRipples)(c,s);return function(e,t){(0,i.useEffect)((function(){if(t.option&&e.current){var r=t.option;Object.keys(e.current.defaults).forEach((function(t){!(0,u.isUndefined)(r[t])&&e.current&&e.current.set(t,r[t])}))}}),[t.option])}(f,s),(0,i.useImperativeHandle)(t,(function(){return{toggleState:function(){var e;null===(e=f.current)||void 0===e||e.changePlayingState()},get state(){var e,t;return null!==(e=null===(t=f.current)||void 0===t?void 0:t.options.playingState)&&void 0!==e&&e},pause:function(){var e;null===(e=f.current)||void 0===e||e.pause()},set:function(e){if(!(0,u.isUndefined)(e))for(var t=Object.keys(e),r=0,n=t.length;r<n;r++){var i,o=t[r];null===(i=f.current)||void 0===i||i.set(o,e[o])}}}})),o().createElement("div",{className:(0,l.xcn)("en-ripple-container"),style:x({backgroundRepeat:"round"},n)},o().createElement("canvas",{ref:c,"data-earthnut-ui":"canvas"}),r)}));_.displayName="en-background-ripple",module.exports.earthnut=n})();
|
|
1
|
+
(()=>{"use strict";var t={56:(t,e,r)=>{t.exports=function(t){var e=r.nc;e&&t.setAttribute("nonce",e)}},72:t=>{var e=[];function r(t){for(var r=-1,n=0;n<e.length;n++)if(e[n].identifier===t){r=n;break}return r}function n(t,n){for(var o={},a=[],u=0;u<t.length;u++){var l=t[u],s=n.base?l[0]+n.base:l[0],c=o[s]||0,f="".concat(s," ").concat(c);o[s]=c+1;var p=r(f),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)e[p].references++,e[p].updater(d);else{var h=i(d,n);n.byIndex=u,e.splice(u,0,{identifier:f,updater:h,references:1})}a.push(f)}return a}function i(t,e){var r=e.domAPI(e);return r.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;r.update(t=e)}else r.remove()}}t.exports=function(t,i){var o=n(t=t||[],i=i||{});return function(t){t=t||[];for(var a=0;a<o.length;a++){var u=r(o[a]);e[u].references--}for(var l=n(t,i),s=0;s<o.length;s++){var c=r(o[s]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}o=l}}},109:(t,e,r)=>{r.d(e,{A:()=>u});var n=r(601),i=r.n(n),o=r(314),a=r.n(o)()(i());a.push([t.id,".en-ripple-container{width:100%;height:100%;position:relative;top:0px;left:0px;z-index:1}",""]);const u=a},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},308:(t,e,r)=>{r.d(e,{useRipples:()=>Gt});var n=r(953);const i=require("a-element-inline-style");var o=r(570);function a(t,e,r,n){function i(t,e){var n=r.createShader(t);if(r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var a,u={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(u.id,i(r.VERTEX_SHADER,t)),r.attachShader(u.id,i(r.FRAGMENT_SHADER,e)),r.linkProgram(u.id),!r.getProgramParameter(u.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(u.id));r.useProgram(u.id),r.enableVertexAttribArray(0);for(var l=t+e,s=/uniform (\w+) (\w+)/g;!(0,o.isNull)(a=s.exec(l));){var c=a[2];u.locations[c]=r.getUniformLocation(u.id,c)}return u}function u(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(e||0)),r.bindTexture(r.TEXTURE_2D,t)}function l(t){return"rgba(0, 0, 0, 0)"===t||"#ffffffff"===t||"transport"===t}function s(t){return"none"===t||""===t}function c(){var t=this,e=function(){return t.initState=!1,null};if(!this.gl)return e();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce((function(t,e){var n=r.getExtension(e);return n&&t.push([e,n]),t}),[]));if(!n.OES_texture_float)return e();var i=[];function o(t,e,r){var i="OES_texture_"+t,o=i+"_linear",a=o in n;return{type:e,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),u=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,u),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var l=null,s=0;s<i.length;s++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[s].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){l=i[s];break}return l}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,v(n.key),n)}}function d(t,e,r){return e&&p(t.prototype,e),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t,e,r){return(e=v(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v(t){var e=function(t){if("object"!=f(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==f(e)?e:e+""}var g=d((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),h(this,"canvas",void 0),h(this,"gl",void 0),h(this,"config",void 0),h(this,"initState",!0),this.canvas=e;var r=e.getContext("webgl");if((0,o.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(c,this,[])}));const m=require("a-js-tools");var y,b={imgUrl:"",resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0};function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function w(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R(n.key),n)}}function R(t){var e=function(t){if("object"!=E(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==E(e)?e:e+""}function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function S(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,P(n.key),n)}}function P(t){var e=function(t){if("object"!=T(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=T(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==T(e)?e:e+""}function x(t,e,r){return t.set(k(t,e),r),r}function O(t,e){return t.get(k(t,e))}function k(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}function _(t){return function(t){if(Array.isArray(t))return D(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return D(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.freeze(b),new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(){};return Object.setPrototypeOf(e,this),Object.defineProperties(e,{info:{value:function(){},configurable:!1,writable:!1},warn:{value:function(){},configurable:!1,writable:!1},error:{value:function(){},configurable:!1,writable:!1},type:{value:!1,configurable:!1,writable:!1}}),e},(e=[{key:"clear",value:function(){}}])&&w(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}())({name:"earthnut",type:!1});var A=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e={list:[],diameter:48,radius:0,cells:0};e.diameter%2!=0&&e.diameter++;var r=e.diameter,n=e.list,i=r/2;e.radius=i,e.cells=Math.pow(r,2);for(var o=0;o<r;o++){n[o]=[];for(var a=0;a<r;a++)n[o][a]=[0,0,0,0]}for(var u=0;u<=i;u++)for(var l=u;l<=i;l++){var s=n[u][l],c=function(){return(0,m.getRandomInt)(255,190)};s[0]=c(),s[1]=c(),s[2]=c(),s[3]=Math.ceil(Math.sqrt(Math.pow(u,2)+Math.pow(l,2)))<=i?(0,m.getRandomInt)(120,180):(0,m.getRandomInt)(160,240)}for(var f=0;f<=i;f++)for(var p=0;p<=f;p++)n[f][p]=n[p][f];for(var d=i;d<r;d++)for(var h=0;h<=i;h++)n[d][h]=n[r-d][h];for(var v=0;v<i;v++)for(var g=i;g<r;g++)n[v][g]=n[v][r-g];for(var y=i;y<r;y++)for(var b=i;b<r;b++)n[y][b]=n[y][r-b];var E=t%r;return e.list=[].concat(_(n.slice(E)),_(n.slice(0,E))),e},I=new(y=new WeakMap,function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}(this,y,1),e=this,r="data",n=A(),(r=P(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"build",value:function(){O(y,this)>100&&x(y,this,0),this.data=A(x(y,this,O(y,this)+3))}}])&&S(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}());function j(t,e){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),a=n.getContext("2d");return(0,o.isNull)(i)||(0,o.isNull)(a)?r:(r.width=n.width=t,r.height=n.height=e,i.clearRect(0,0,t,e),a.clearRect(0,0,t,e),i.globalAlpha=1,i.putImageData(function(t,e){Date.now();for(var r=new ImageData(t,e),n=r.data,i=I.data,o=i.diameter,a=i.list,u=t*o,l=0;l<n.length;l+=4){var s=l/4%u,c=s%t%o,f=Math.floor(s/t),p=a[c][f];n[l]=p[0],n[l+1]=p[1],n[l+2]=p[2],n[l+3]=p[3]}return r}(t,e),0,0),a.fillStyle="#ffffff",a.fillRect(0,0,t,e),a.drawImage(r,0,0,t,e),a.globalCompositeOperation="source-over",n)}function F(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.fadeData,r=e.backgroundInfo,n=e.toBeList,i=r.width,o=r.height,a=(0,m.getRandomString)({length:8,includeNumbers:!0,includeUppercaseLetters:!0});I.build(),n.push({resource:j(i,o),width:i,height:o,kind:"default",tag:a}),t&&e.run()}function U(){var t=this.renderData,e=this.fadeData,r=this.options;if((0,o.isNull)(t))return Reflect.apply(F,this,[]);var n=t.originStyle;if(l(n.backgroundColor)&&(!(0,o.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(F,this,[]);var i=document.createElement("canvas"),a=i.getContext("2d");if((0,o.isNull)(a))return Reflect.apply(F,this,[]);var u=e.backgroundInfo,s=u.width,c=u.height;i.width=s,i.height=c,a.clearRect(0,0,s,c);var f=(0,o.isArray)(r.imgUrl)&&1===r.imgUrl.length&&r.imgUrl[0]||n.backgroundColor;a.beginPath(),a.fillStyle=f,a.fillRect(0,0,s,c),a.fill(),e.isTransitioning?e.toBeList=[e.toBeList[0]]:e.toBeList=[];var p={resource:i,kind:"background-color",tag:f,width:s,height:c};e.toBeList.push(p),e.run()}function C(){var t=this.fadeData,e=this.renderData,r=this.options;if((0,o.isNull)(e))return Reflect.apply(U,this,[]);var n=e.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,o.isArray)(r.imgUrl))return Reflect.apply(U,this,[]);var i=(0,o.isArray)(r.imgUrl)&&r.imgUrl.length>1&&r.imgUrl||n.backgroundImage.replace(/^.*linear-gradient\((.*)\).*$/,"$1").split("),").map((function(t){return(t=t.trim()).endsWith(")")||(t+=")"),t})).filter((function(t){return t.startsWith("rgb")||t.startsWith("#")}));if(i.length<2)return Reflect.apply(U,this,[]);var a=document.createElement("canvas"),u=a.getContext("2d");if((0,o.isNull)(u))return Reflect.apply(U,this,[]);var l=t.backgroundInfo,s=l.width,c=l.height;a.width=s,a.height=c,u.fillStyle="#fff",u.fillRect(0,0,s,c);var f=u.createLinearGradient(0,0,0,c);i.forEach((function(t,e){return f.addColorStop(e/(i.length-1),t)})),u.fillStyle=f,u.fillRect(0,0,s,c),t.isTransitioning?t.toBeList=[t.toBeList[0]]:t.toBeList=[],t.toBeList.push({resource:a,kind:"linear-gradient",tag:i.join("_"),width:s,height:c}),t.run()}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function L(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if((0,o.isNull)(e))Reflect.apply(C,this,[]);else{var i,a,u=e.lastUseStyle,l=n.backgroundInfo,s=l.width,c=l.height,f=(0,o.isString)(r.imgUrl)&&r.imgUrl||(i=u.backgroundImage,a=/url\(["']?([^"']*)["']?\)/.exec(i),(0,o.isNull)(a)?null:a[1]);if(e.imageSource=f,f){var p=function(t,e,r){var n=new Image(e,r);return n.width=e,n.height=r,n.src=t,n}(f,s,c);p.onload=function(){var t;clearTimeout(n.transparentId),n.isTransitioning?n.toBeList=[n.toBeList[0]].concat(function(t){if(Array.isArray(t))return N(t)}(t=n.toBeList.slice(1).filter((function(t){return"image"===t.kind&&(Math.abs(t.width-s)>2||Math.abs(t.height-c)>2||t.tag!==f)})))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return N(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?N(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):n.toBeList=[],n.toBeList.push({resource:p,width:s,height:c,kind:"image",tag:f}),n.run()},p.onerror=function(){Reflect.apply(C,t,[])},p.crossOrigin=r.crossOrigin}else Reflect.apply(C,this,[])}}function B(){var t=this.renderData;if(!(0,o.isNull)(t)){var e=t.parentElement;e&&[["background-image","none"],["background-color","transparent"]].forEach((function(t){return e.style.setProperty(t[0],t[1],"important")}))}}function M(t){var e=window.getComputedStyle(t),r=t.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:e.backgroundColor,backgroundImage:e.backgroundImage,backgroundSize:e.backgroundSize,backgroundPosition:e.backgroundPosition,backgroundRepeat:e.backgroundRepeat,backgroundClip:e.backgroundClip,backgroundOrigin:e.backgroundOrigin,backgroundAttachment:e.backgroundAttachment,position:e.position,width:parseInt(e.width),height:parseInt(e.height)}}function X(){var t=this.renderData;if(!(0,o.isNull)(t)){var e=t.parentElement,r=t.originStyle;e.style.setProperty("background-image",r.inlineBackgroundImage),e.style.setProperty("background-color",r.inlineBackgroundColor)}}function W(t){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function z(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,H(n.key),n)}}function G(t,e,r){return(e=H(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H(t){var e=function(t){if("object"!=W(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=W(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==W(e)?e:e+""}var q=function(){return t=function t(e,r,n){var i,a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),G(this,"quad",null),G(this,"lastRaindropsFallTime",0),G(this,"parentElement",void 0),G(this,"mutationObserver",void 0),G(this,"resizeObserver",void 0),G(this,"renderProgram",void 0),G(this,"imageSource",""),G(this,"dropProgram",void 0),G(this,"updateProgram",void 0),G(this,"textures",[]),G(this,"backgroundTexture",[]),G(this,"textureDelta",void 0),G(this,"framebuffers",[]),G(this,"bufferWriteIndex",0),G(this,"bufferReadIndex",1),G(this,"originStyle",void 0),G(this,"lastUseStyle",void 0),G(this,"events",{}),G(this,"animationFrameId",0),this.parentElement=null!==(i=e.parentElement)&&void 0!==i?i:document.body,Reflect.apply(B,n,[]),this.originStyle=this.lastUseStyle=M(this.parentElement),this.mutationObserver=new MutationObserver((function(t){t.forEach((function(t){if(t.target===a.parentElement&&"attributes"===t.type&&n.options.visible){var e=Object.values(a.lastUseStyle),i=M(a.parentElement),u=Object.values(i);if((0,o.isEmptyArray)(m.enArr.difference(e,u)))return;var c=s(i.backgroundImage),f=l(i.backgroundColor);if(c&&f)return;a.lastUseStyle=i,Reflect.apply(r,n,[]),Reflect.apply(B,n,[])}}))})),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver((function(t){t.forEach((function(t){if(t.target===a.parentElement){var e=M(a.parentElement);Math.abs(e.width-a.originStyle.width)<3&&Math.abs(e.height-a.originStyle.height)<3||Reflect.apply(r,n,[])}}))})),this.resizeObserver.observe(this.parentElement)},e=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(X,{renderData:this},[]),this.parentElement&&this.events){var t,e,r,n=this.parentElement,i=this.events;Object.keys(i).forEach((function(t){return n.removeEventListener&&n.removeEventListener(t,i[t])})),n.removeAttribute&&n.removeAttribute("data-ripples"),null===(t=this.mutationObserver)||void 0===t||t.takeRecords(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null===(r=this.resizeObserver)||void 0===r||r.disconnect(),this.resizeObserver=null}}}],e&&z(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Y(){var t=this.renderData,e=this.fadeData;if(!(0,o.isNull)(t)){var r,n,i,a=t.parentElement,u=window.getComputedStyle(a),l=u.backgroundSize,s=u.backgroundAttachment,c=u.backgroundPosition,f=/\s+/.test(r=c)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):$(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],p={left:0,top:0,width:0,height:0};"fixed"===s?(p.height=window.innerHeight,p.left=window.screenX,p.top=window.screenY,p.width=window.innerWidth):(p.left=0,p.top=0,p.width=a.scrollWidth,p.height=a.scrollHeight);var d=e.backgroundInfo||{width:100,height:100},h=d.width,v=d.height;if("cover"===l){var g=Math.max(p.width/h,p.height/v);n=h*g,i=v*g}else if("contain"===l){var m=Math.min(p.width/h,p.height/v);n=h*m,i=v*m}else{var y=l.split(" ");n=y[0]||"",i=y[1]||n,$(n)?n=p.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),$(i)?i=p.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=h,i=v):("auto"===n&&(n=h*(Number(i)/v)),"auto"===i&&(i=v*(Number(n)/h)))}var b=f&&f[0]||"0%",E=f&&f[1]||"0%";b=$(b)?(p.left+(p.width-Number(n))*parseFloat(b)/100).toString():(p.left+parseFloat(b)).toString(),E=$(E)?(p.top+(p.height-Number(i))*parseFloat(E)/100).toString():(p.top+parseFloat(E)).toString(),t.renderProgram.uniforms.topLeft=new Float32Array([(a.offsetLeft-Number(b))/n,(a.offsetTop-Number(E))/i]),t.renderProgram.uniforms.bottomRight=new Float32Array([t.renderProgram.uniforms.topLeft[0]+a.clientWidth/n,t.renderProgram.uniforms.topLeft[1]+a.clientHeight/i]);var w=Math.max(this.canvas.width,this.canvas.height);t.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/w,this.canvas.height/w])}}function $(t){return t.endsWith("%")}function K(){var t=this.gl,e=this.renderData;(0,o.isNull)(e)||(t.bindBuffer(t.ARRAY_BUFFER,e.quad),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLE_FAN,0,4))}function V(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.textures,i=e.backgroundTexture,a=r.perturbance;t.bindFramebuffer(t.FRAMEBUFFER,null),t.viewport(0,0,this.canvas.width,this.canvas.height),t.enable(t.BLEND),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.useProgram(e.renderProgram.id),Reflect.apply(u,this,[i,0]),Reflect.apply(u,this,[n[0],1]),t.uniform1f(e.renderProgram.locations.perturbance,a),t.uniform2fv(e.renderProgram.locations.topLeft,e.renderProgram.uniforms.topLeft),t.uniform2fv(e.renderProgram.locations.bottomRight,e.renderProgram.uniforms.bottomRight),t.uniform2fv(e.renderProgram.locations.containerRatio,e.renderProgram.uniforms.containerRatio),t.uniform1i(e.renderProgram.locations.samplerBackground,0),t.uniform1i(e.renderProgram.locations.samplerRipples,1),Reflect.apply(K,this,[]),t.disable(t.BLEND)}}function J(){var t=this.renderData;if(!(0,o.isNull)(t)){var e=t.bufferWriteIndex,r=t.bufferReadIndex;t.bufferWriteIndex=1-e,t.bufferReadIndex=1-r}}function Z(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.updateProgram,i=e.textures,a=e.framebuffers,l=e.bufferWriteIndex,s=e.bufferReadIndex,c=r.resolution;t.viewport(0,0,c,c),t.bindFramebuffer(t.FRAMEBUFFER,a[l]),Reflect.apply(u,this,[i[s]]),t.useProgram(n.id),Reflect.apply(K,this,[]),Reflect.apply(J,this,[])}}function Q(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,o.isNull)(e)){var i=e.parentElement,a=n.isTransitioning,u=r.running,l=r.idleFluctuations,s=r.lastRunningState,c=getComputedStyle(i);n.backgroundInfo={width:parseInt(c.width),height:parseInt(c.height)},Reflect.apply(Y,this,[]),u?(s||(r.lastRunningState=!0,this.show()),l&&this.raindropsFall(),a&&this.fade(),Reflect.apply(Z,this,[]),Reflect.apply(V,this,[])):s&&(r.lastRunningState=!1,this.hide()),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(Q,t,[])}))}}function tt(t,e,r){var n=this.renderData;if(!(0,o.isNull)(n)){var i=n.parentElement,a=window.getComputedStyle(i),u=parseInt(a.borderLeftWidth)||0,l=parseInt(a.borderTopWidth)||0,s=i.getBoundingClientRect(),c=t.clientX-s.left-u,f=t.clientY-s.top-l;this.drop(c,f,e,r)}}function et(){var t=this,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.parentElement,i=e.events,a=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(e.lastRaindropsFallTime=Date.now(),Reflect.apply(tt,t,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(t){for(var e=r.accelerating;e--;)a(t)},i.touchmove=i.touchstart=function(t){for(var e=t.touches,r=0;r<e.length;r++)a(e[r])},i.mousedown=function(t){return a(t,!0)},Object.keys(i).forEach((function(t){return null==n?void 0:n.addEventListener(t,i[t],{passive:!0})}))}}var rt="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function nt(){var t=this.gl,e=this.renderData;if(!(0,o.isNull)(e)){var r=e.textureDelta;e.dropProgram=a(rt,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",t);var n=e.updateProgram=a(rt,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);t.uniform2fv(n.locations.delta,r),e.renderProgram=a("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",t),t.uniform2fv(e.renderProgram.locations.delta,r)}}function it(){var t=this.gl,e=this.renderData;if(!(0,o.isNull)(e)){var r=e.backgroundTexture=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)}}function ot(t){var e=this.gl,r=this.renderData,n=this.fadeData;if(!(0,o.isNull)(r)){var i=r.backgroundTexture,a=n.backgroundInfo,u=a.width,l=a.height,s=function(t){return(0,o.isZero)(t&t-1)},c=s(u)&&s(l)?e.REPEAT:e.CLAMP_TO_EDGE;e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,c),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.resource)}}function at(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,o.isNull)(e)&&this.config){var i=e.textures,a=e.framebuffers,u=r.resolution,l=this.gl,s=1/u;e.textureDelta=new Float32Array([s,s]),this.config.extensions.forEach((function(t){return l.getExtension(t)}));for(var c=this.config.arrayType,f=c?new c(u*u*4):null,p=this.config,d=0;d<2;d++){var h=l.createTexture(),v=l.createFramebuffer();l.bindFramebuffer(l.FRAMEBUFFER,v),l.bindTexture(l.TEXTURE_2D,h),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,u,u,0,l.RGBA,p.type,f),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,h,0),i.push(h),a.push(v)}e.quad=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,e.quad),l.bufferData(l.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),l.STATIC_DRAW),Reflect.apply(nt,this,[]),Reflect.apply(it,this,[]),Reflect.apply(L,this,[]),l.clearColor(0,0,0,0),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(et,this,[]),Reflect.apply(ot,this,[n.lastDrawImage]),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(Q,t,[])}))}}function ut(){var t=this.renderData,e=this.fadeData;if(!(0,o.isNull)(t)){var r=t.parentElement,n=e.backgroundInfo,i=r.offsetWidth,a=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=a,Reflect.apply(L,this,[])}}function lt(){var t=this.renderData,e=this.fadeData;(0,o.isNull)(t)||(t.destroy(),Object.keys(t).forEach((function(e){return t[e]=null})),this.renderData=null),e.destroy(),Object.keys(e).forEach((function(t){return e[t]=null})),this.fadeData=null,this.gl&&(this.gl=null)}function st(t,e,r,n){var i=this.renderData,a=this.options,l=this.gl;if(!(0,o.isNull)(i)){var s=i.parentElement,c=i.dropProgram,f=i.textures,p=i.framebuffers,d=i.bufferWriteIndex,h=i.bufferReadIndex,v=a.resolution,g=s.offsetWidth,m=s.offsetHeight,y=Math.max(g,m);r/=y;var b=new Float32Array([(2*t-g)/y,(m-2*e)/y]);l.viewport(0,0,v,v),l.bindFramebuffer(l.FRAMEBUFFER,p[d]),Reflect.apply(u,this,[f[h]]),l.useProgram(c.id),l.uniform2fv(c.locations.center,b),l.uniform1f(c.locations.radius,r),l.uniform1f(c.locations.strength,n),Reflect.apply(K,this,[]),Reflect.apply(J,this,[])}}function ct(t){return ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(t)}function ft(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dt(n.key),n)}}function pt(t,e,r){return(e=dt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dt(t){var e=function(t){if("object"!=ct(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ct(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ct(e)?e:e+""}function ht(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function vt(t,e){return t.get(mt(t,e))}function gt(t,e,r){return t.set(mt(t,e),r),r}function mt(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var yt=new WeakMap,bt=new WeakMap,Et=new WeakMap,wt=new WeakMap,Rt=new WeakMap,Tt=new WeakMap,St=new WeakMap,Pt=function(){return t=function t(e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ht(this,yt,b.accelerating),ht(this,bt,b.interactive),ht(this,Et,b.resolution),ht(this,wt,b.perturbance),ht(this,Rt,b.dropRadius),pt(this,"imgUrl",b.imgUrl),ht(this,Tt,b.idleFluctuations),ht(this,St,b.raindropsTimeInterval),pt(this,"crossOrigin","no-cors"),pt(this,"visible",!1),pt(this,"running",!1),pt(this,"lastRunningState",!1),this.perturbance=e.perturbance,this.resolution=e.resolution,this.raindropsTimeInterval=e.raindropsTimeInterval,this.accelerating=e.accelerating,this.interactive=e.interactive,this.dropRadius=e.dropRadius,this.imgUrl=e.imgUrl,this.idleFluctuations=e.idleFluctuations,this.running=Boolean(null===(r=e.playingState)||void 0===r||r),this.crossOrigin=e.crossOrigin},(e=[{key:"accelerating",get:function(){return vt(yt,this)},set:function(t){t>100||t<2||gt(yt,this,t)}},{key:"interactive",get:function(){return vt(bt,this)},set:function(t){(0,o.isBoolean)(t)&>(bt,this,t)}},{key:"resolution",get:function(){return vt(Et,this)},set:function(t){t<100||t>550||gt(Et,this,t)}},{key:"perturbance",get:function(){return vt(wt,this)},set:function(t){t<1e-4||t>1||gt(wt,this,t)}},{key:"dropRadius",get:function(){return vt(Rt,this)},set:function(t){!isFinite(t)||t<10||gt(Rt,this,t)}},{key:"idleFluctuations",get:function(){return vt(Tt,this)},set:function(t){(0,o.isBoolean)(t)&>(Tt,this,t)}},{key:"raindropsTimeInterval",get:function(){return vt(St,this)},set:function(t){t<10||t>12e3||gt(St,this,t)}},{key:"playingState",get:function(){return this.running},set:function(t){this.running=Boolean(null==t||t)}}])&&ft(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function xt(){var t=this,e=this.options,r=this.fadeData;r.transparentId=setTimeout((function(){if(clearTimeout(r.transparentId),r.isTransitioning)return Reflect.apply(xt,t,[]);"image"!==r.lastDrawImage.kind&&r.run()}),2*e.raindropsTimeInterval)}function Ot(){var t=this.renderData,e=this.fadeData,r=this.options,n=e.toBeList;if((0,o.isNull)(t))return e.isTransitioning=!1,void Reflect.apply(xt,this,[]);if((0,o.isEmptyArray)(n))return e.isTransitioning=!1,void Reflect.apply(xt,this,[]);if(0===e.drawProgress&&n.forEach((function(t){})),e.drawProgress>1e3)if(e.isTransitioning=!1,e.lastDrawImage=n.shift(),Reflect.apply(ot,this,[e.lastDrawImage]),(0,o.isEmptyArray)(n)){var i=t.lastUseStyle;(0,o.isNull)(r.imgUrl)&&l(i.backgroundColor)&&s(i.backgroundImage)&&(Reflect.apply(F,this,[!1]),Reflect.apply(xt,this,[]))}else Reflect.apply(xt,this,[]);else{var a=e.lastDrawImage,u=e.backgroundInfo;e.drawProgress+=18;var c=document.createElement("canvas"),f=c.getContext("2d");if(!((0,o.isNull)(f)||(0,o.isNull)(a.resource)||(0,o.isEmptyArray)(n))){var p=u.width,d=u.height;c.width=p,c.height=d,f.clearRect(0,0,p,d),f.drawImage(a.resource,0,0,p,d),f.globalAlpha=e.drawProgress/1e3,f.drawImage(n[0].resource,0,0,p,d),f.globalAlpha=1;var h={resource:c,width:p,height:d,kind:"mix",tag:"".concat(a.tag," >> ").concat(n[0].tag)};Reflect.apply(ot,this,[h]),n.length>1&&(e.lastDrawImage=h,n.shift(),e.drawProgress=0)}}}function kt(t){return kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(t)}function _t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,At(n.key),n)}}function Dt(t,e,r){return(e=At(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function At(t){var e=function(t){if("object"!=kt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=kt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kt(e)?e:e+""}var It=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Dt(this,"backgroundInfo",{width:0,height:0}),Dt(this,"transparentId",setTimeout(Boolean)),Dt(this,"lastDrawImage",void 0),Dt(this,"toBeList",[]),Dt(this,"drawProgress",0),Dt(this,"isTransitioning",!1);var r,n,i=e.renderData;if((0,o.isNull)(i))r=10,n=10;else{var a=getComputedStyle(i.parentElement);r=parseInt(a.width),n=parseInt(a.height)}this.backgroundInfo={width:r,height:n},this.lastDrawImage={resource:j(r,n),width:r,height:n,kind:"default",tag:""}},(e=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){this.transparentId&&clearTimeout(this.transparentId)}}])&&_t(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function jt(t){return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt(t)}function Ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ut(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ft(Object(r),!0).forEach((function(e){Mt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ft(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ct(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xt(n.key),n)}}function Nt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Nt=function(){return!!t})()}function Lt(t){return Lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lt(t)}function Bt(t,e){return Bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Bt(t,e)}function Mt(t,e,r){return(e=Xt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xt(t){var e=function(t){if("object"!=jt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=jt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jt(e)?e:e+""}var Wt=new WeakMap,zt=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Mt(n=function(t,e,r){return e=Lt(e),function(t,e){if(e&&("object"==jt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Nt()?Reflect.construct(e,r||[],Lt(t).constructor):e.apply(t,r))}(this,e,[t]),"renderData",null),Mt(n,"options",void 0),Mt(n,"fadeData",void 0),Mt(n,"defaults",b),Mt(n,"initialized",!1),function(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}(n,Wt,(0,m.debounce)(ut,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new Pt(Ut(Ut({},n.defaults),r)),n.renderData=new q(t,n.reloadBackground,n),n.fadeData=new It(n),(0,o.isFalse)(n.initState)||(0,o.isNull)(t.parentElement)||(0,o.isNull)(n.config)||(0,o.isNull)(n.gl)?n.initState=!1:(function(t){var e=t.parentElement;t.width=e.clientWidth,t.height=e.clientHeight,(0,i.setStyle)(t,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(t),Reflect.apply(at,n,[])),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bt(t,e)}(e,t),r=e,n=[{key:"raindropsFall",value:function(){var t=this.renderData,e=this.options,r=this.fadeData;if(!(0,o.isNull)(t)){var n=r.backgroundInfo,i=t.lastRaindropsFallTime,a=e.raindropsTimeInterval,u=e.dropRadius,l=Date.now();if(!(l-i<a)){t.lastRaindropsFallTime=l;var s=function(t){return(0,m.getRandomInt)(t)},c=n.width,f=n.height;this.drop(s(c),s(f),u,.03)}}}},{key:"drop",value:function(t,e,r,n){Reflect.apply(st,this,[t,e,r,n])}},{key:"fade",value:function(){Reflect.apply(Ot,this,[])}},{key:"reloadBackground",value:function(){var t,e;(t=Wt,e=this,t.get(function(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}(t,e))).call(this)}},{key:"destroy",value:function(){Reflect.apply(lt,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(B,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(X,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var t=this.options;t.running=!t.running}},{key:"set",value:function(t,e){"imgUrl"===t?(this.options.imgUrl=e,Reflect.apply(L,this,[])):this.options[t]=e}}],n&&Ct(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(g);function Gt(t,e){var r=(0,n.useRef)(null);return(0,n.useEffect)((function(){if(!(0,o.isNull)(t.current))return r.current=new zt(t.current,e&&e.option),function(){var t,e;return null!==(t=null===(e=r.current)||void 0===e?void 0:e.destroy())&&void 0!==t?t:void 0}}),[]),r}},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,i,o){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(n)for(var u=0;u<this.length;u++){var l=this[u][0];null!=l&&(a[l]=!0)}for(var s=0;s<t.length;s++){var c=[].concat(t[s]);n&&a[c[0]]||(void 0!==o&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),r&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=r):c[2]=r),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),e.push(c))}},e}},540:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},570:t=>{t.exports=require("a-type-of-js")},601:t=>{t.exports=function(t){return t[1]}},659:t=>{var e={};t.exports=function(t,r){var n=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},763:t=>{t.exports=require("xcn")},825:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var n="";r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {"));var i=void 0!==r.layer;i&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,i&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var o=r.sourceMap;o&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},953:t=>{t.exports=require("react")}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,exports:{}};return t[n](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nc=void 0;var n={};r.r(n),r.d(n,{BackgroundRipple:()=>k});var i=r(953),o=r.n(i),a=r(308),u=r(570),l=r(763),s=r(72),c=r.n(s),f=r(825),p=r.n(f),d=r(659),h=r.n(d),v=r(56),g=r.n(v),m=r(540),y=r.n(m),b=r(113),E=r.n(b),w=r(109),R={};function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}R.styleTagTransform=E(),R.setAttributes=g(),R.insert=h().bind(null,"head"),R.domAPI=p(),R.insertStyleElement=y(),c()(w.A,R),w.A&&w.A.locals&&w.A.locals;var S=["children","style"];function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t,e,r){return(e=function(t){var e=function(t){if("object"!=T(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=T(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==T(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var k=(0,i.forwardRef)((function(t,e){var r=t.children,n=t.style,s=function(t,e){if(null==t)return{};var r,n,i=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}(t,S),c=(0,i.useRef)(null),f=(0,a.useRipples)(c,s);return function(t,e){(0,i.useEffect)((function(){if(e.option&&t.current){var r=e.option;Object.keys(t.current.defaults).forEach((function(e){!(0,u.isUndefined)(r[e])&&t.current&&t.current.set(e,r[e])}))}}),[e.option])}(f,s),(0,i.useImperativeHandle)(e,(function(){return{toggleState:function(){var t;null===(t=f.current)||void 0===t||t.changePlayingState()},get state(){var t,e;return null!==(t=null===(e=f.current)||void 0===e?void 0:e.options.playingState)&&void 0!==t&&t},pause:function(){var t;null===(t=f.current)||void 0===t||t.pause()},set:function(t){if(!(0,u.isUndefined)(t))for(var e=Object.keys(t),r=0,n=e.length;r<n;r++){var i,o=e[r];null===(i=f.current)||void 0===i||i.set(o,t[o])}}}})),o().createElement("div",{className:(0,l.xcn)("en-ripple-container"),style:x({backgroundRepeat:"round"},n)},o().createElement("canvas",{ref:c,"data-earthnut-ui":"canvas"}),r)}));k.displayName="en-background-ripple",module.exports.earthnut=n})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"a-type-of-js";import*as t from"xcn";import*as r from"react";import*as n from"a-element-inline-style";import*as i from"a-js-tools";var o={56:(e,t,r)=>{e.exports=function(e){var t=r.nc;t&&e.setAttribute("nonce",t)}},72:e=>{var t=[];function r(e){for(var r=-1,n=0;n<t.length;n++)if(t[n].identifier===e){r=n;break}return r}function n(e,n){for(var o={},a=[],u=0;u<e.length;u++){var l=e[u],s=n.base?l[0]+n.base:l[0],c=o[s]||0,f="".concat(s," ").concat(c);o[s]=c+1;var p=r(f),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)t[p].references++,t[p].updater(d);else{var h=i(d,n);n.byIndex=u,t.splice(u,0,{identifier:f,updater:h,references:1})}a.push(f)}return a}function i(e,t){var r=t.domAPI(t);return r.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;r.update(e=t)}else r.remove()}}e.exports=function(e,i){var o=n(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var u=r(o[a]);t[u].references--}for(var l=n(e,i),s=0;s<o.length;s++){var c=r(o[s]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}o=l}}},109:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(601),i=r.n(n),o=r(314),a=r.n(o)()(i());a.push([e.id,".en-ripple-container{width:100%;height:100%;position:relative;top:0px;left:0px;z-index:1}",""]);const u=a},113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var u=0;u<this.length;u++){var l=this[u][0];null!=l&&(a[l]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);n&&a[c[0]]||(void 0!==o&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),r&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=r):c[2]=r),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},362:(t,r,n)=>{var i,o;t.exports=(i={isBoolean:()=>e.isBoolean,isEmptyArray:()=>e.isEmptyArray,isFalse:()=>e.isFalse,isNull:()=>e.isNull,isUndefined:()=>e.isUndefined,isZero:()=>e.isZero},o={},n.d(o,i),o)},411:(e,r,n)=>{var i,o;e.exports=(i={xcn:()=>t.xcn},o={},n.d(o,i),o)},540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},601:e=>{e.exports=function(e){return e[1]}},649:(e,t,n)=>{var i,o;e.exports=(i={default:()=>r.default,forwardRef:()=>r.forwardRef,useEffect:()=>r.useEffect,useImperativeHandle:()=>r.useImperativeHandle,useRef:()=>r.useRef},o={},n.d(o,i),o)},659:e=>{var t={};e.exports=function(e,r){var n=function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},707:(e,t,r)=>{r.d(t,{n:()=>He});var o=r(649);const a=(u={setStyle:()=>n.setStyle},l={},r.d(l,u),l);var u,l,s=r(362);function c(e,t,r,n){function i(e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var o,a={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(a.id,i(r.VERTEX_SHADER,e)),r.attachShader(a.id,i(r.FRAGMENT_SHADER,t)),r.linkProgram(a.id),!r.getProgramParameter(a.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(a.id));r.useProgram(a.id),r.enableVertexAttribArray(0);for(var u=e+t,l=/uniform (\w+) (\w+)/g;!(0,s.isNull)(o=l.exec(u));){var c=o[2];a.locations[c]=r.getUniformLocation(a.id,c)}return a}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(t||0)),r.bindTexture(r.TEXTURE_2D,e)}function p(){var e=this,t=function(){return e.initState=!1,null};if(!this.gl)return t();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce((function(e,t){var n=r.getExtension(t);return n&&e.push([t,n]),e}),[]));if(!n.OES_texture_float)return t();var i=[];function o(e,t,r){var i="OES_texture_"+e,o=i+"_linear",a=o in n;return{type:t,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),u=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,u),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var l=null,s=0;s<i.length;s++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[s].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){l=i[s];break}return l}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y(n.key),n)}}function v(e,t,r){return t&&h(e.prototype,t),r&&h(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function m(e,t,r){return(t=y(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}var b=v((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),m(this,"canvas",void 0),m(this,"gl",void 0),m(this,"config",void 0),m(this,"initState",!0),this.canvas=t;var r=t.getContext("webgl");if((0,s.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(p,this,[])}));const g=(e=>{var t={};return r.d(t,e),t})({debounce:()=>i.debounce,enArr:()=>i.enArr,getRandomInt:()=>i.getRandomInt});var E,w={imageUrl:"",resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0};function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,P(n.key),n)}}function P(e){var t=function(e){if("object"!=R(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=R(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==R(t)?t:t+""}function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function x(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,O(n.key),n)}}function O(e){var t=function(e){if("object"!=S(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==S(t)?t:t+""}function _(e,t,r){return e.set(D(e,t),r),r}function A(e,t){return e.get(D(e,t))}function D(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}function k(e){return function(e){if(Array.isArray(e))return I(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}Object.freeze(w),new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(){};return Object.setPrototypeOf(t,this),Object.defineProperties(t,{info:{value:function(){},configurable:!1,writable:!1},warn:{value:function(){},configurable:!1,writable:!1},error:{value:function(){},configurable:!1,writable:!1},type:{value:!1,configurable:!1,writable:!1}}),t},(t=[{key:"clear",value:function(){}}])&&T(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}())({name:"earthnut",type:!1});var F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t={list:[],diameter:48,radius:0,cells:0};t.diameter%2!=0&&t.diameter++;var r=t.diameter,n=t.list,i=r/2;t.radius=i,t.cells=Math.pow(r,2);for(var o=0;o<r;o++){n[o]=[];for(var a=0;a<r;a++)n[o][a]=[0,0,0,0]}for(var u=0;u<=i;u++)for(var l=u;l<=i;l++){var s=n[u][l],c=function(){return(0,g.getRandomInt)(255,190)};s[0]=c(),s[1]=c(),s[2]=c(),s[3]=Math.ceil(Math.sqrt(Math.pow(u,2)+Math.pow(l,2)))<=i?(0,g.getRandomInt)(120,180):(0,g.getRandomInt)(160,240)}for(var f=0;f<=i;f++)for(var p=0;p<=f;p++)n[f][p]=n[p][f];for(var d=i;d<r;d++)for(var h=0;h<=i;h++)n[d][h]=n[r-d][h];for(var v=0;v<i;v++)for(var m=i;m<r;m++)n[v][m]=n[v][r-m];for(var y=i;y<r;y++)for(var b=i;b<r;b++)n[y][b]=n[y][r-b];var E=e%r;return t.list=[].concat(k(n.slice(E)),k(n.slice(0,E))),t},j=new(E=new WeakMap,function(){return e=function e(){var t,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}(this,E,1),t=this,r="data",n=F(),(r=O(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n},(t=[{key:"build",value:function(){A(E,this)>100&&_(E,this,0),this.data=F(_(E,this,A(E,this)+3))}}])&&x(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());function U(e,t){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),o=n.getContext("2d");return(0,s.isNull)(i)||(0,s.isNull)(o)?r:(r.width=n.width=e,r.height=n.height=t,i.clearRect(0,0,e,t),o.clearRect(0,0,e,t),i.globalAlpha=1,i.putImageData(function(e,t){Date.now();for(var r=new ImageData(e,t),n=r.data,i=j.data,o=i.diameter,a=i.list,u=e*o,l=0;l<n.length;l+=4){var s=l/4%u,c=s%e%o,f=Math.floor(s/e),p=a[c][f];n[l]=p[0],n[l+1]=p[1],n[l+2]=p[2],n[l+3]=p[3]}return r}(e,t),0,0),o.fillStyle="#ffffff",o.fillRect(0,0,e,t),o.drawImage(r,0,0,e,t),o.globalCompositeOperation="source-over",n)}function C(){var e=this.fadeData,t=e.backgroundInfo,r=t.width,n=t.height;j.build(),e.toBeList.push(U(r,n)),e.run()}function N(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if((0,s.isNull)(t))Reflect.apply(C,this,[]);else{var i,o,a=t.lastUseStyle,u=n.backgroundInfo,l=u.width,c=u.height,f=r.imageUrl||(i=a.backgroundImage,o=/url\(["']?([^"']*)["']?\)/.exec(i),(0,s.isNull)(o)?null:o[1]);if(t.imageSource=f,f){var p=function(e,t,r){var n=new Image(t,r);return n.width=t,n.height=r,n.src=e,n}(f,l,c);p.onload=function(){clearTimeout(n.transparentId),n.toBeList=n.toBeList.filter((function(e){return"img"===e.tagName.toLowerCase()&&e.getAttribute("src")!==f&&e.width===l&&e.height===c})),n.toBeList.push(p),n.run()},p.onerror=function(){Reflect.apply(C,e,[])},p.crossOrigin=r.crossOrigin}else Reflect.apply(C,this,[])}}function L(){var e=this.renderData;if(!(0,s.isNull)(e)){var t=e.parentElement;t&&[["background-image","none"],["background-color","transparent"]].forEach((function(e){return t.style.setProperty(e[0],e[1],"important")}))}}function B(e){var t=window.getComputedStyle(e),r=e.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:t.backgroundColor,backgroundImage:t.backgroundImage,backgroundSize:t.backgroundSize,backgroundPosition:t.backgroundPosition,backgroundRepeat:t.backgroundRepeat,backgroundClip:t.backgroundClip,backgroundOrigin:t.backgroundOrigin,backgroundAttachment:t.backgroundAttachment,position:t.position}}function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function X(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,H(n.key),n)}}function W(e,t,r){return t&&X(e.prototype,t),r&&X(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function z(e,t,r){return(t=H(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H(e){var t=function(e){if("object"!=M(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=M(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==M(t)?t:t+""}var G=W((function e(t,r,n){var i,o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),z(this,"quad",null),z(this,"lastRaindropsFallTime",0),z(this,"parentElement",void 0),z(this,"mutationObserver",void 0),z(this,"resizeObserver",void 0),z(this,"renderProgram",void 0),z(this,"imageSource",""),z(this,"dropProgram",void 0),z(this,"updateProgram",void 0),z(this,"textures",[]),z(this,"backgroundTexture",[]),z(this,"textureDelta",void 0),z(this,"framebuffers",[]),z(this,"bufferWriteIndex",0),z(this,"bufferReadIndex",1),z(this,"originStyle",void 0),z(this,"lastUseStyle",void 0),z(this,"events",{}),z(this,"animationFrameId",0),this.parentElement=null!==(i=t.parentElement)&&void 0!==i?i:document.body,Reflect.apply(L,n,[]),this.originStyle=this.lastUseStyle=B(this.parentElement),this.mutationObserver=new MutationObserver((function(e){e.forEach((function(e){var t,i;if(e.target===o.parentElement&&"attributes"===e.type&&n.options.visible){var a=Object.values(o.lastUseStyle),u=B(o.parentElement),l=Object.values(u);if((0,s.isEmptyArray)(g.enArr.difference(a,l)))return;var c="none"===(i=u.backgroundImage)||""===i,f="rgba(0, 0, 0, 0)"===(t=u.backgroundColor)||"#ffffffff"===t||"transport"===t;if(c&&f)return;o.lastUseStyle=u,Reflect.apply(r,n,[]),Reflect.apply(L,n,[])}}))})),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver((function(){Reflect.apply(r,n,[])})),this.resizeObserver.observe(this.parentElement)}));function Y(){var e=this.renderData,t=this.fadeData;if(!(0,s.isNull)(e)){var r,n,i,o=e.parentElement,a=window.getComputedStyle(o),u=a.backgroundSize,l=a.backgroundAttachment,c=a.backgroundPosition,f=/\s+/.test(r=c)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):q(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],p={left:0,top:0,width:0,height:0};"fixed"===l?(p.height=window.innerHeight,p.left=window.screenX,p.top=window.screenY,p.width=window.innerWidth):(p.left=0,p.top=0,p.width=o.scrollWidth,p.height=o.scrollHeight);var d=t.backgroundInfo||{width:100,height:100},h=d.width,v=d.height;if("cover"===u){var m=Math.max(p.width/h,p.height/v);n=h*m,i=v*m}else if("contain"===u){var y=Math.min(p.width/h,p.height/v);n=h*y,i=v*y}else{var b=u.split(" ");n=b[0]||"",i=b[1]||n,q(n)?n=p.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),q(i)?i=p.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=h,i=v):("auto"===n&&(n=h*(Number(i)/v)),"auto"===i&&(i=v*(Number(n)/h)))}var g=f&&f[0]||"0%",E=f&&f[1]||"0%";g=q(g)?(p.left+(p.width-Number(n))*parseFloat(g)/100).toString():(p.left+parseFloat(g)).toString(),E=q(E)?(p.top+(p.height-Number(i))*parseFloat(E)/100).toString():(p.top+parseFloat(E)).toString(),e.renderProgram.uniforms.topLeft=new Float32Array([(o.offsetLeft-Number(g))/n,(o.offsetTop-Number(E))/i]),e.renderProgram.uniforms.bottomRight=new Float32Array([e.renderProgram.uniforms.topLeft[0]+o.clientWidth/n,e.renderProgram.uniforms.topLeft[1]+o.clientHeight/i]);var w=Math.max(this.canvas.width,this.canvas.height);e.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/w,this.canvas.height/w])}}function q(e){return e.endsWith("%")}function Z(){var e=this.gl,t=this.renderData;(0,s.isNull)(t)||(e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_FAN,0,4))}function K(){var e=this.gl,t=this.renderData,r=this.options;if(!(0,s.isNull)(t)){var n=t.textures,i=t.backgroundTexture,o=r.perturbance;e.bindFramebuffer(e.FRAMEBUFFER,null),e.viewport(0,0,this.canvas.width,this.canvas.height),e.enable(e.BLEND),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.useProgram(t.renderProgram.id),Reflect.apply(f,this,[i,0]),Reflect.apply(f,this,[n[0],1]),e.uniform1f(t.renderProgram.locations.perturbance,o),e.uniform2fv(t.renderProgram.locations.topLeft,t.renderProgram.uniforms.topLeft),e.uniform2fv(t.renderProgram.locations.bottomRight,t.renderProgram.uniforms.bottomRight),e.uniform2fv(t.renderProgram.locations.containerRatio,t.renderProgram.uniforms.containerRatio),e.uniform1i(t.renderProgram.locations.samplerBackground,0),e.uniform1i(t.renderProgram.locations.samplerRipples,1),Reflect.apply(Z,this,[]),e.disable(e.BLEND)}}function V(){var e=this.renderData;if(!(0,s.isNull)(e)){var t=e.bufferWriteIndex,r=e.bufferReadIndex;e.bufferWriteIndex=1-t,e.bufferReadIndex=1-r}}function J(){var e=this.gl,t=this.renderData,r=this.options;if(!(0,s.isNull)(t)){var n=t.updateProgram,i=t.textures,o=t.framebuffers,a=t.bufferWriteIndex,u=t.bufferReadIndex,l=r.resolution;e.viewport(0,0,l,l),e.bindFramebuffer(e.FRAMEBUFFER,o[a]),Reflect.apply(f,this,[i[u]]),e.useProgram(n.id),Reflect.apply(Z,this,[]),Reflect.apply(V,this,[])}}function $(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if(!(0,s.isNull)(t)){var i=t.parentElement,o=n.isTransitioning,a=r.running,u=r.idleFluctuations,l=r.lastRunningState,c=getComputedStyle(i);n.backgroundInfo={width:parseInt(c.width),height:parseInt(c.height)},Reflect.apply(Y,this,[]),a?(l||(r.lastRunningState=!0,this.show()),u&&this.raindropsFall(),o&&this.fade(),Reflect.apply(J,this,[]),Reflect.apply(K,this,[])):l&&(r.lastRunningState=!1,this.hide()),t.animationFrameId=requestAnimationFrame((function(){return Reflect.apply($,e,[])}))}}function Q(e,t,r){var n=this.renderData;if(!(0,s.isNull)(n)){var i=n.parentElement,o=window.getComputedStyle(i),a=parseInt(o.borderLeftWidth)||0,u=parseInt(o.borderTopWidth)||0,l=i.getBoundingClientRect(),c=e.clientX-l.left-a,f=e.clientY-l.top-u;this.drop(c,f,t,r)}}function ee(){var e=this,t=this.renderData,r=this.options;if(!(0,s.isNull)(t)){var n=t.parentElement,i=t.events,o=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(t.lastRaindropsFallTime=Date.now(),Reflect.apply(Q,e,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(e){for(var t=r.accelerating;t--;)o(e)},i.touchmove=i.touchstart=function(e){for(var t=e.touches,r=0;r<t.length;r++)o(t[r])},i.mousedown=function(e){return o(e,!0)},Object.keys(i).forEach((function(e){return null==n?void 0:n.addEventListener(e,i[e],{passive:!0})}))}}var te="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function re(){var e=this.gl,t=this.renderData;if(!(0,s.isNull)(t)){var r=t.textureDelta;t.dropProgram=c(te,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",e);var n=t.updateProgram=c(te,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);e.uniform2fv(n.locations.delta,r),t.renderProgram=c("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",e),e.uniform2fv(t.renderProgram.locations.delta,r)}}function ne(){var e=this.gl,t=this.renderData;if(!(0,s.isNull)(t)){var r=t.backgroundTexture=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)}}function ie(e){var t=this.gl,r=this.renderData,n=this.fadeData;if(!(0,s.isNull)(r)){var i=r.backgroundTexture,o=n.backgroundInfo,a=o.width,u=o.height,l=function(e){return(0,s.isZero)(e&e-1)},c=l(a)&&l(u)?t.REPEAT:t.CLAMP_TO_EDGE;t.bindTexture(t.TEXTURE_2D,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,c),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,c),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e)}}function oe(){var e=this,t=this.renderData,r=this.options,n=this.fadeData;if(!(0,s.isNull)(t)&&this.config){var i=t.textures,o=t.framebuffers,a=r.resolution,u=this.gl,l=1/a;t.textureDelta=new Float32Array([l,l]),this.config.extensions.forEach((function(e){return u.getExtension(e)}));for(var c=this.config.arrayType,f=c?new c(a*a*4):null,p=this.config,d=0;d<2;d++){var h=u.createTexture(),v=u.createFramebuffer();u.bindFramebuffer(u.FRAMEBUFFER,v),u.bindTexture(u.TEXTURE_2D,h),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,p.linearSupport?u.LINEAR:u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,p.linearSupport?u.LINEAR:u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,a,a,0,u.RGBA,p.type,f),u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,h,0),i.push(h),o.push(v)}t.quad=u.createBuffer(),u.bindBuffer(u.ARRAY_BUFFER,t.quad),u.bufferData(u.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),u.STATIC_DRAW),Reflect.apply(re,this,[]),Reflect.apply(ne,this,[]),Reflect.apply(C,this,[]),Reflect.apply(N,this,[]),u.clearColor(0,0,0,0),u.blendFunc(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(ee,this,[]),Reflect.apply(ie,this,[n.lastDrawImage]),t.animationFrameId=requestAnimationFrame((function(){return Reflect.apply($,e,[])}))}}function ae(){var e=this.renderData,t=this.fadeData;if(!(0,s.isNull)(e)){var r=e.parentElement,n=t.backgroundInfo,i=r.offsetWidth,o=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=o,Reflect.apply(N,this,[])}}function ue(){var e=this.renderData;if(!(0,s.isNull)(e)){var t=e.parentElement,r=e.originStyle;t.style.setProperty("background-image",r.inlineBackgroundImage),t.style.setProperty("background-color",r.inlineBackgroundColor)}}function le(){var e=this.renderData,t=this.fadeData;if(!(0,s.isNull)(e)){if(e.animationFrameId&&window.cancelAnimationFrame(e.animationFrameId),t.transparentId&&clearTimeout(t.transparentId),null!=e&&e.parentElement&&null!=e&&e.events){var r,n,i,o=e.parentElement,a=e.events;Object.keys(a).forEach((function(e){return o.removeEventListener&&o.removeEventListener(e,a[e])})),o.removeAttribute&&o.removeAttribute("data-ripples"),null===(r=e.mutationObserver)||void 0===r||r.takeRecords(),null===(n=e.mutationObserver)||void 0===n||n.disconnect(),e.mutationObserver=null,null===(i=e.resizeObserver)||void 0===i||i.disconnect(),e.resizeObserver=null}this.gl=null,Reflect.apply(ue,this,[]),Object.keys(e).forEach((function(t){return e[t]=null})),this.renderData=null,this.gl&&(this.gl=null)}}function se(e,t,r,n){var i=this.renderData,o=this.options,a=this.gl;if(!(0,s.isNull)(i)){var u=i.parentElement,l=i.dropProgram,c=i.textures,p=i.framebuffers,d=i.bufferWriteIndex,h=i.bufferReadIndex,v=o.resolution,m=u.offsetWidth,y=u.offsetHeight,b=Math.max(m,y);r/=b;var g=new Float32Array([(2*e-m)/b,(y-2*t)/b]);a.viewport(0,0,v,v),a.bindFramebuffer(a.FRAMEBUFFER,p[d]),Reflect.apply(f,this,[c[h]]),a.useProgram(l.id),a.uniform2fv(l.locations.center,g),a.uniform1f(l.locations.radius,r),a.uniform1f(l.locations.strength,n),Reflect.apply(Z,this,[]),Reflect.apply(V,this,[])}}function ce(e){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ce(e)}function fe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,de(n.key),n)}}function pe(e,t,r){return(t=de(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function de(e){var t=function(e){if("object"!=ce(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=ce(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ce(t)?t:t+""}function he(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function ve(e,t){return e.get(ye(e,t))}function me(e,t,r){return e.set(ye(e,t),r),r}function ye(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var be=new WeakMap,ge=new WeakMap,Ee=new WeakMap,we=new WeakMap,Re=new WeakMap,Te=new WeakMap,Pe=new WeakMap,Se=function(){return e=function e(t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),he(this,be,w.accelerating),he(this,ge,w.interactive),he(this,Ee,w.resolution),he(this,we,w.perturbance),he(this,Re,w.dropRadius),pe(this,"imageUrl",w.imageUrl),he(this,Te,w.idleFluctuations),he(this,Pe,w.raindropsTimeInterval),pe(this,"crossOrigin","no-cors"),pe(this,"visible",!1),pe(this,"running",!1),pe(this,"lastRunningState",!1),this.perturbance=t.perturbance,this.resolution=t.resolution,this.raindropsTimeInterval=t.raindropsTimeInterval,this.accelerating=t.accelerating,this.interactive=t.interactive,this.dropRadius=t.dropRadius,this.imageUrl=t.imageUrl,this.idleFluctuations=t.idleFluctuations,this.running=Boolean(null===(r=t.playingState)||void 0===r||r),this.crossOrigin=t.crossOrigin},(t=[{key:"accelerating",get:function(){return ve(be,this)},set:function(e){e>100||e<2||me(be,this,e)}},{key:"interactive",get:function(){return ve(ge,this)},set:function(e){(0,s.isBoolean)(e)&&me(ge,this,e)}},{key:"resolution",get:function(){return ve(Ee,this)},set:function(e){e<100||e>550||me(Ee,this,e)}},{key:"perturbance",get:function(){return ve(we,this)},set:function(e){e<1e-4||e>1||me(we,this,e)}},{key:"dropRadius",get:function(){return ve(Re,this)},set:function(e){!isFinite(e)||e<10||me(Re,this,e)}},{key:"idleFluctuations",get:function(){return ve(Te,this)},set:function(e){(0,s.isBoolean)(e)&&me(Te,this,e)}},{key:"raindropsTimeInterval",get:function(){return ve(Pe,this)},set:function(e){e<10||e>12e3||me(Pe,this,e)}},{key:"playingState",get:function(){return this.running},set:function(e){this.running=Boolean(null==e||e)}}])&&fe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function xe(){var e=this,t=this.options,r=this.fadeData;r.transparentId=setTimeout((function(){if(clearTimeout(r.transparentId),r.isTransitioning)return Reflect.apply(xe,e,[]);r.drawProgress=0,r.isTransitioning=!0}),2*t.raindropsTimeInterval)}function Oe(){var e=this.renderData,t=this.fadeData,r=t.toBeList,n=t.drawProgress,i=t.lastDrawImage,o=t.backgroundInfo;if(!(0,s.isNull)(e)&&!(0,s.isEmptyArray)(r)){if(t.drawProgress>1e3)return t.isTransitioning=!1,t.lastDrawImage=r.shift(),Reflect.apply(ie,this,[t.lastDrawImage]),void((0,s.isEmptyArray)(r)||Reflect.apply(xe,this,[]));t.drawProgress+=18;var a=document.createElement("canvas"),u=a.getContext("2d");if(!((0,s.isNull)(u)||(0,s.isNull)(i)||(0,s.isEmptyArray)(r))){var l=o.width,c=o.height;a.width=l,a.height=c,u.clearRect(0,0,l,c),u.drawImage(i,0,0,l,c),u.globalAlpha=n/1e3,u.drawImage(r[0],0,0,l,c),u.globalAlpha=1,Reflect.apply(ie,this,[a])}}}function _e(e){return _e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_e(e)}function Ae(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ke(n.key),n)}}function De(e,t,r){return(t=ke(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ke(e){var t=function(e){if("object"!=_e(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=_e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_e(t)?t:t+""}var Ie=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),De(this,"backgroundInfo",{width:0,height:0}),De(this,"transparentId",setTimeout(Boolean)),De(this,"lastDrawImage",void 0),De(this,"toBeList",[]),De(this,"drawProgress",0),De(this,"isTransitioning",!1);var r,n,i=t.renderData;if((0,s.isNull)(i))r=10,n=10;else{var o=getComputedStyle(i.parentElement);r=parseInt(o.width),n=parseInt(o.height)}this.backgroundInfo={width:r,height:n},this.lastDrawImage=U(r,n)},(t=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}}])&&Ae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Fe(e){return Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fe(e)}function je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?je(Object(r),!0).forEach((function(t){Me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):je(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xe(n.key),n)}}function Ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ne=function(){return!!e})()}function Le(e){return Le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Le(e)}function Be(e,t){return Be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Be(e,t)}function Me(e,t,r){return(t=Xe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xe(e){var t=function(e){if("object"!=Fe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Fe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fe(t)?t:t+""}var We=new WeakMap,ze=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Me(n=function(e,t,r){return t=Le(t),function(e,t){if(t&&("object"==Fe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ne()?Reflect.construct(t,r||[],Le(e).constructor):t.apply(e,r))}(this,t,[e]),"renderData",null),Me(n,"options",void 0),Me(n,"fadeData",void 0),Me(n,"defaults",w),Me(n,"initialized",!1),function(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}(n,We,(0,g.debounce)(ae,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new Se(Ue(Ue({},n.defaults),r)),n.renderData=new G(e,n.reloadBackground,n),n.fadeData=new Ie(n),(0,s.isFalse)(n.initState)||(0,s.isNull)(e.parentElement)||(0,s.isNull)(n.config)||(0,s.isNull)(n.gl)?n.initState=!1:(function(e){var t=e.parentElement;e.width=t.clientWidth,e.height=t.clientHeight,(0,a.setStyle)(e,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(e),Reflect.apply(oe,n,[])),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Be(e,t)}(t,e),r=t,n=[{key:"raindropsFall",value:function(){var e=this.renderData,t=this.options,r=this.fadeData;if(!(0,s.isNull)(e)){var n=r.backgroundInfo,i=e.lastRaindropsFallTime,o=t.raindropsTimeInterval,a=t.dropRadius,u=Date.now();if(!(u-i<o)){e.lastRaindropsFallTime=u;var l=function(e){return(0,g.getRandomInt)(e)},c=n.width,f=n.height;this.drop(l(c),l(f),a,.03)}}}},{key:"drop",value:function(e,t,r,n){Reflect.apply(se,this,[e,t,r,n])}},{key:"fade",value:function(){Reflect.apply(Oe,this,[])}},{key:"reloadBackground",value:function(){var e,t;(e=We,t=this,e.get(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}(e,t))).call(this)}},{key:"destroy",value:function(){Reflect.apply(le,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(L,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(ue,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var e=this.options;e.running=!e.running}},{key:"set",value:function(e,t){"imageUrl"===e?(this.options.imageUrl=t,Reflect.apply(N,this,[])):this.options[e]=t}}],n&&Ce(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(b);function He(e,t){var r=(0,o.useRef)(null);return(0,o.useEffect)((function(){if(!(0,s.isNull)(e.current))return r.current=new ze(e.current,t&&t.option),function(){var e,t;return null!==(e=null===(t=r.current)||void 0===t?void 0:t.destroy())&&void 0!==e?e:void 0}}),[]),r}},825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(r){!function(e,t,r){var n="";r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {"));var i=void 0!==r.layer;i&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,i&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var o=r.sourceMap;o&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}}},a={};function u(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={id:e,exports:{}};return o[e](r,r.exports,u),r.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.nc=void 0;var l={};u.d(l,{z:()=>I});var s=u(649),c=u(707),f=u(362),p=u(411),d=u(72),h=u.n(d),v=u(825),m=u.n(v),y=u(659),b=u.n(y),g=u(56),E=u.n(g),w=u(540),R=u.n(w),T=u(113),P=u.n(T),S=u(109),x={};function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}x.styleTagTransform=P(),x.setAttributes=E(),x.insert=b().bind(null,"head"),x.domAPI=m(),x.insertStyleElement=R(),h()(S.A,x),S.A&&S.A.locals&&S.A.locals;var _=["children","style"];function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){k(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function k(e,t,r){return(t=function(e){var t=function(e){if("object"!=O(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=O(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==O(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var I=(0,s.forwardRef)((function(e,t){var r=e.children,n=e.style,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,_),o=(0,s.useRef)(null),a=(0,c.n)(o,i);return function(e,t){(0,s.useEffect)((function(){if(t.option&&e.current){var r=t.option;Object.keys(e.current.defaults).forEach((function(t){!(0,f.isUndefined)(r[t])&&e.current&&e.current.set(t,r[t])}))}}),[t.option])}(a,i),(0,s.useImperativeHandle)(t,(function(){return{toggleState:function(){var e;null===(e=a.current)||void 0===e||e.changePlayingState()},get state(){var e,t;return null!==(e=null===(t=a.current)||void 0===t?void 0:t.options.playingState)&&void 0!==e&&e},pause:function(){var e;null===(e=a.current)||void 0===e||e.pause()},set:function(e){if(!(0,f.isUndefined)(e))for(var t=Object.keys(e),r=0,n=t.length;r<n;r++){var i,o=t[r];null===(i=a.current)||void 0===i||i.set(o,e[o])}}}})),s.default.createElement("div",{className:(0,p.xcn)("en-ripple-container"),style:D({backgroundRepeat:"round"},n)},s.default.createElement("canvas",{ref:o,"data-earthnut-ui":"canvas"}),r)}));I.displayName="en-background-ripple";const F=l.z;export{F as BackgroundRipple};
|
|
1
|
+
import*as t from"a-element-inline-style";import*as e from"a-js-tools";import*as r from"a-type-of-js";import*as n from"xcn";import*as i from"react";var o={56:(t,e,r)=>{t.exports=function(t){var e=r.nc;e&&t.setAttribute("nonce",e)}},72:t=>{var e=[];function r(t){for(var r=-1,n=0;n<e.length;n++)if(e[n].identifier===t){r=n;break}return r}function n(t,n){for(var o={},a=[],u=0;u<t.length;u++){var l=t[u],s=n.base?l[0]+n.base:l[0],c=o[s]||0,f="".concat(s," ").concat(c);o[s]=c+1;var p=r(f),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)e[p].references++,e[p].updater(d);else{var h=i(d,n);n.byIndex=u,e.splice(u,0,{identifier:f,updater:h,references:1})}a.push(f)}return a}function i(t,e){var r=e.domAPI(e);return r.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;r.update(t=e)}else r.remove()}}t.exports=function(t,i){var o=n(t=t||[],i=i||{});return function(t){t=t||[];for(var a=0;a<o.length;a++){var u=r(o[a]);e[u].references--}for(var l=n(t,i),s=0;s<o.length;s++){var c=r(o[s]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}o=l}}},78:(r,n,i)=>{i.d(n,{n:()=>$t});var o=i(649);const a=(u={setStyle:()=>t.setStyle},l={},i.d(l,u),l);var u,l,s=i(362);function c(t,e,r,n){function i(t,e){var n=r.createShader(t);if(r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var o,a={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(a.id,i(r.VERTEX_SHADER,t)),r.attachShader(a.id,i(r.FRAGMENT_SHADER,e)),r.linkProgram(a.id),!r.getProgramParameter(a.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(a.id));r.useProgram(a.id),r.enableVertexAttribArray(0);for(var u=t+e,l=/uniform (\w+) (\w+)/g;!(0,s.isNull)(o=l.exec(u));){var c=o[2];a.locations[c]=r.getUniformLocation(a.id,c)}return a}function f(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(e||0)),r.bindTexture(r.TEXTURE_2D,t)}function p(t){return"rgba(0, 0, 0, 0)"===t||"#ffffffff"===t||"transport"===t}function d(t){return"none"===t||""===t}function h(){var t=this,e=function(){return t.initState=!1,null};if(!this.gl)return e();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce((function(t,e){var n=r.getExtension(e);return n&&t.push([e,n]),t}),[]));if(!n.OES_texture_float)return e();var i=[];function o(t,e,r){var i="OES_texture_"+t,o=i+"_linear",a=o in n;return{type:e,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),u=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,u),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var l=null,s=0;s<i.length;s++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[s].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){l=i[s];break}return l}function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function m(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function g(t,e,r){return e&&m(t.prototype,e),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t){var e=function(t){if("object"!=v(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==v(e)?e:e+""}var E=g((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),y(this,"canvas",void 0),y(this,"gl",void 0),y(this,"config",void 0),y(this,"initState",!0),this.canvas=e;var r=e.getContext("webgl");if((0,s.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(h,this,[])}));const w=(t=>{var e={};return i.d(e,t),e})({debounce:()=>e.debounce,enArr:()=>e.enArr,getRandomInt:()=>e.getRandomInt,getRandomString:()=>e.getRandomString});var R,T={imgUrl:"",resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0};function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function P(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,x(n.key),n)}}function x(t){var e=function(t){if("object"!=S(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==S(e)?e:e+""}function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function k(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,A(n.key),n)}}function A(t){var e=function(t){if("object"!=O(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=O(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==O(e)?e:e+""}function I(t,e,r){return t.set(_(t,e),r),r}function D(t,e){return t.get(_(t,e))}function _(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}function F(t){return function(t){if(Array.isArray(t))return j(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return j(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.freeze(T),new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(){};return Object.setPrototypeOf(e,this),Object.defineProperties(e,{info:{value:function(){},configurable:!1,writable:!1},warn:{value:function(){},configurable:!1,writable:!1},error:{value:function(){},configurable:!1,writable:!1},type:{value:!1,configurable:!1,writable:!1}}),e},(e=[{key:"clear",value:function(){}}])&&P(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}())({name:"earthnut",type:!1});var U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e={list:[],diameter:48,radius:0,cells:0};e.diameter%2!=0&&e.diameter++;var r=e.diameter,n=e.list,i=r/2;e.radius=i,e.cells=Math.pow(r,2);for(var o=0;o<r;o++){n[o]=[];for(var a=0;a<r;a++)n[o][a]=[0,0,0,0]}for(var u=0;u<=i;u++)for(var l=u;l<=i;l++){var s=n[u][l],c=function(){return(0,w.getRandomInt)(255,190)};s[0]=c(),s[1]=c(),s[2]=c(),s[3]=Math.ceil(Math.sqrt(Math.pow(u,2)+Math.pow(l,2)))<=i?(0,w.getRandomInt)(120,180):(0,w.getRandomInt)(160,240)}for(var f=0;f<=i;f++)for(var p=0;p<=f;p++)n[f][p]=n[p][f];for(var d=i;d<r;d++)for(var h=0;h<=i;h++)n[d][h]=n[r-d][h];for(var v=0;v<i;v++)for(var m=i;m<r;m++)n[v][m]=n[v][r-m];for(var g=i;g<r;g++)for(var y=i;y<r;y++)n[g][y]=n[g][r-y];var b=t%r;return e.list=[].concat(F(n.slice(b)),F(n.slice(0,b))),e},C=new(R=new WeakMap,function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}(this,R,1),e=this,r="data",n=U(),(r=A(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"build",value:function(){D(R,this)>100&&I(R,this,0),this.data=U(I(R,this,D(R,this)+3))}}])&&k(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}());function N(t,e){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),o=n.getContext("2d");return(0,s.isNull)(i)||(0,s.isNull)(o)?r:(r.width=n.width=t,r.height=n.height=e,i.clearRect(0,0,t,e),o.clearRect(0,0,t,e),i.globalAlpha=1,i.putImageData(function(t,e){Date.now();for(var r=new ImageData(t,e),n=r.data,i=C.data,o=i.diameter,a=i.list,u=t*o,l=0;l<n.length;l+=4){var s=l/4%u,c=s%t%o,f=Math.floor(s/t),p=a[c][f];n[l]=p[0],n[l+1]=p[1],n[l+2]=p[2],n[l+3]=p[3]}return r}(t,e),0,0),o.fillStyle="#ffffff",o.fillRect(0,0,t,e),o.drawImage(r,0,0,t,e),o.globalCompositeOperation="source-over",n)}function L(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.fadeData,r=e.backgroundInfo,n=e.toBeList,i=r.width,o=r.height,a=(0,w.getRandomString)({length:8,includeNumbers:!0,includeUppercaseLetters:!0});C.build(),n.push({resource:N(i,o),width:i,height:o,kind:"default",tag:a}),t&&e.run()}function B(){var t=this.renderData,e=this.fadeData,r=this.options;if((0,s.isNull)(t))return Reflect.apply(L,this,[]);var n=t.originStyle;if(p(n.backgroundColor)&&(!(0,s.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(L,this,[]);var i=document.createElement("canvas"),o=i.getContext("2d");if((0,s.isNull)(o))return Reflect.apply(L,this,[]);var a=e.backgroundInfo,u=a.width,l=a.height;i.width=u,i.height=l,o.clearRect(0,0,u,l);var c=(0,s.isArray)(r.imgUrl)&&1===r.imgUrl.length&&r.imgUrl[0]||n.backgroundColor;o.beginPath(),o.fillStyle=c,o.fillRect(0,0,u,l),o.fill(),e.isTransitioning?e.toBeList=[e.toBeList[0]]:e.toBeList=[];var f={resource:i,kind:"background-color",tag:c,width:u,height:l};e.toBeList.push(f),e.run()}function M(){var t=this.fadeData,e=this.renderData,r=this.options;if((0,s.isNull)(e))return Reflect.apply(B,this,[]);var n=e.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,s.isArray)(r.imgUrl))return Reflect.apply(B,this,[]);var i=(0,s.isArray)(r.imgUrl)&&r.imgUrl.length>1&&r.imgUrl||n.backgroundImage.replace(/^.*linear-gradient\((.*)\).*$/,"$1").split("),").map((function(t){return(t=t.trim()).endsWith(")")||(t+=")"),t})).filter((function(t){return t.startsWith("rgb")||t.startsWith("#")}));if(i.length<2)return Reflect.apply(B,this,[]);var o=document.createElement("canvas"),a=o.getContext("2d");if((0,s.isNull)(a))return Reflect.apply(B,this,[]);var u=t.backgroundInfo,l=u.width,c=u.height;o.width=l,o.height=c,a.fillStyle="#fff",a.fillRect(0,0,l,c);var f=a.createLinearGradient(0,0,0,c);i.forEach((function(t,e){return f.addColorStop(e/(i.length-1),t)})),a.fillStyle=f,a.fillRect(0,0,l,c),t.isTransitioning?t.toBeList=[t.toBeList[0]]:t.toBeList=[],t.toBeList.push({resource:o,kind:"linear-gradient",tag:i.join("_"),width:l,height:c}),t.run()}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function W(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if((0,s.isNull)(e))Reflect.apply(M,this,[]);else{var i,o,a=e.lastUseStyle,u=n.backgroundInfo,l=u.width,c=u.height,f=(0,s.isString)(r.imgUrl)&&r.imgUrl||(i=a.backgroundImage,o=/url\(["']?([^"']*)["']?\)/.exec(i),(0,s.isNull)(o)?null:o[1]);if(e.imageSource=f,f){var p=function(t,e,r){var n=new Image(e,r);return n.width=e,n.height=r,n.src=t,n}(f,l,c);p.onload=function(){var t;clearTimeout(n.transparentId),n.isTransitioning?n.toBeList=[n.toBeList[0]].concat(function(t){if(Array.isArray(t))return X(t)}(t=n.toBeList.slice(1).filter((function(t){return"image"===t.kind&&(Math.abs(t.width-l)>2||Math.abs(t.height-c)>2||t.tag!==f)})))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return X(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):n.toBeList=[],n.toBeList.push({resource:p,width:l,height:c,kind:"image",tag:f}),n.run()},p.onerror=function(){Reflect.apply(M,t,[])},p.crossOrigin=r.crossOrigin}else Reflect.apply(M,this,[])}}function z(){var t=this.renderData;if(!(0,s.isNull)(t)){var e=t.parentElement;e&&[["background-image","none"],["background-color","transparent"]].forEach((function(t){return e.style.setProperty(t[0],t[1],"important")}))}}function G(t){var e=window.getComputedStyle(t),r=t.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:e.backgroundColor,backgroundImage:e.backgroundImage,backgroundSize:e.backgroundSize,backgroundPosition:e.backgroundPosition,backgroundRepeat:e.backgroundRepeat,backgroundClip:e.backgroundClip,backgroundOrigin:e.backgroundOrigin,backgroundAttachment:e.backgroundAttachment,position:e.position,width:parseInt(e.width),height:parseInt(e.height)}}function H(){var t=this.renderData;if(!(0,s.isNull)(t)){var e=t.parentElement,r=t.originStyle;e.style.setProperty("background-image",r.inlineBackgroundImage),e.style.setProperty("background-color",r.inlineBackgroundColor)}}function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function q(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Z(n.key),n)}}function $(t,e,r){return(e=Z(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Z(t){var e=function(t){if("object"!=Y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Y(e)?e:e+""}var K=function(){return t=function t(e,r,n){var i,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$(this,"quad",null),$(this,"lastRaindropsFallTime",0),$(this,"parentElement",void 0),$(this,"mutationObserver",void 0),$(this,"resizeObserver",void 0),$(this,"renderProgram",void 0),$(this,"imageSource",""),$(this,"dropProgram",void 0),$(this,"updateProgram",void 0),$(this,"textures",[]),$(this,"backgroundTexture",[]),$(this,"textureDelta",void 0),$(this,"framebuffers",[]),$(this,"bufferWriteIndex",0),$(this,"bufferReadIndex",1),$(this,"originStyle",void 0),$(this,"lastUseStyle",void 0),$(this,"events",{}),$(this,"animationFrameId",0),this.parentElement=null!==(i=e.parentElement)&&void 0!==i?i:document.body,Reflect.apply(z,n,[]),this.originStyle=this.lastUseStyle=G(this.parentElement),this.mutationObserver=new MutationObserver((function(t){t.forEach((function(t){if(t.target===o.parentElement&&"attributes"===t.type&&n.options.visible){var e=Object.values(o.lastUseStyle),i=G(o.parentElement),a=Object.values(i);if((0,s.isEmptyArray)(w.enArr.difference(e,a)))return;var u=d(i.backgroundImage),l=p(i.backgroundColor);if(u&&l)return;o.lastUseStyle=i,Reflect.apply(r,n,[]),Reflect.apply(z,n,[])}}))})),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver((function(t){t.forEach((function(t){if(t.target===o.parentElement){var e=G(o.parentElement);Math.abs(e.width-o.originStyle.width)<3&&Math.abs(e.height-o.originStyle.height)<3||Reflect.apply(r,n,[])}}))})),this.resizeObserver.observe(this.parentElement)},e=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(H,{renderData:this},[]),this.parentElement&&this.events){var t,e,r,n=this.parentElement,i=this.events;Object.keys(i).forEach((function(t){return n.removeEventListener&&n.removeEventListener(t,i[t])})),n.removeAttribute&&n.removeAttribute("data-ripples"),null===(t=this.mutationObserver)||void 0===t||t.takeRecords(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null===(r=this.resizeObserver)||void 0===r||r.disconnect(),this.resizeObserver=null}}}],e&&q(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function V(){var t=this.renderData,e=this.fadeData;if(!(0,s.isNull)(t)){var r,n,i,o=t.parentElement,a=window.getComputedStyle(o),u=a.backgroundSize,l=a.backgroundAttachment,c=a.backgroundPosition,f=/\s+/.test(r=c)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):J(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],p={left:0,top:0,width:0,height:0};"fixed"===l?(p.height=window.innerHeight,p.left=window.screenX,p.top=window.screenY,p.width=window.innerWidth):(p.left=0,p.top=0,p.width=o.scrollWidth,p.height=o.scrollHeight);var d=e.backgroundInfo||{width:100,height:100},h=d.width,v=d.height;if("cover"===u){var m=Math.max(p.width/h,p.height/v);n=h*m,i=v*m}else if("contain"===u){var g=Math.min(p.width/h,p.height/v);n=h*g,i=v*g}else{var y=u.split(" ");n=y[0]||"",i=y[1]||n,J(n)?n=p.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),J(i)?i=p.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=h,i=v):("auto"===n&&(n=h*(Number(i)/v)),"auto"===i&&(i=v*(Number(n)/h)))}var b=f&&f[0]||"0%",E=f&&f[1]||"0%";b=J(b)?(p.left+(p.width-Number(n))*parseFloat(b)/100).toString():(p.left+parseFloat(b)).toString(),E=J(E)?(p.top+(p.height-Number(i))*parseFloat(E)/100).toString():(p.top+parseFloat(E)).toString(),t.renderProgram.uniforms.topLeft=new Float32Array([(o.offsetLeft-Number(b))/n,(o.offsetTop-Number(E))/i]),t.renderProgram.uniforms.bottomRight=new Float32Array([t.renderProgram.uniforms.topLeft[0]+o.clientWidth/n,t.renderProgram.uniforms.topLeft[1]+o.clientHeight/i]);var w=Math.max(this.canvas.width,this.canvas.height);t.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/w,this.canvas.height/w])}}function J(t){return t.endsWith("%")}function Q(){var t=this.gl,e=this.renderData;(0,s.isNull)(e)||(t.bindBuffer(t.ARRAY_BUFFER,e.quad),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLE_FAN,0,4))}function tt(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,s.isNull)(e)){var n=e.textures,i=e.backgroundTexture,o=r.perturbance;t.bindFramebuffer(t.FRAMEBUFFER,null),t.viewport(0,0,this.canvas.width,this.canvas.height),t.enable(t.BLEND),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.useProgram(e.renderProgram.id),Reflect.apply(f,this,[i,0]),Reflect.apply(f,this,[n[0],1]),t.uniform1f(e.renderProgram.locations.perturbance,o),t.uniform2fv(e.renderProgram.locations.topLeft,e.renderProgram.uniforms.topLeft),t.uniform2fv(e.renderProgram.locations.bottomRight,e.renderProgram.uniforms.bottomRight),t.uniform2fv(e.renderProgram.locations.containerRatio,e.renderProgram.uniforms.containerRatio),t.uniform1i(e.renderProgram.locations.samplerBackground,0),t.uniform1i(e.renderProgram.locations.samplerRipples,1),Reflect.apply(Q,this,[]),t.disable(t.BLEND)}}function et(){var t=this.renderData;if(!(0,s.isNull)(t)){var e=t.bufferWriteIndex,r=t.bufferReadIndex;t.bufferWriteIndex=1-e,t.bufferReadIndex=1-r}}function rt(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,s.isNull)(e)){var n=e.updateProgram,i=e.textures,o=e.framebuffers,a=e.bufferWriteIndex,u=e.bufferReadIndex,l=r.resolution;t.viewport(0,0,l,l),t.bindFramebuffer(t.FRAMEBUFFER,o[a]),Reflect.apply(f,this,[i[u]]),t.useProgram(n.id),Reflect.apply(Q,this,[]),Reflect.apply(et,this,[])}}function nt(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,s.isNull)(e)){var i=e.parentElement,o=n.isTransitioning,a=r.running,u=r.idleFluctuations,l=r.lastRunningState,c=getComputedStyle(i);n.backgroundInfo={width:parseInt(c.width),height:parseInt(c.height)},Reflect.apply(V,this,[]),a?(l||(r.lastRunningState=!0,this.show()),u&&this.raindropsFall(),o&&this.fade(),Reflect.apply(rt,this,[]),Reflect.apply(tt,this,[])):l&&(r.lastRunningState=!1,this.hide()),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(nt,t,[])}))}}function it(t,e,r){var n=this.renderData;if(!(0,s.isNull)(n)){var i=n.parentElement,o=window.getComputedStyle(i),a=parseInt(o.borderLeftWidth)||0,u=parseInt(o.borderTopWidth)||0,l=i.getBoundingClientRect(),c=t.clientX-l.left-a,f=t.clientY-l.top-u;this.drop(c,f,e,r)}}function ot(){var t=this,e=this.renderData,r=this.options;if(!(0,s.isNull)(e)){var n=e.parentElement,i=e.events,o=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(e.lastRaindropsFallTime=Date.now(),Reflect.apply(it,t,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(t){for(var e=r.accelerating;e--;)o(t)},i.touchmove=i.touchstart=function(t){for(var e=t.touches,r=0;r<e.length;r++)o(e[r])},i.mousedown=function(t){return o(t,!0)},Object.keys(i).forEach((function(t){return null==n?void 0:n.addEventListener(t,i[t],{passive:!0})}))}}var at="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function ut(){var t=this.gl,e=this.renderData;if(!(0,s.isNull)(e)){var r=e.textureDelta;e.dropProgram=c(at,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",t);var n=e.updateProgram=c(at,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);t.uniform2fv(n.locations.delta,r),e.renderProgram=c("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",t),t.uniform2fv(e.renderProgram.locations.delta,r)}}function lt(){var t=this.gl,e=this.renderData;if(!(0,s.isNull)(e)){var r=e.backgroundTexture=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)}}function st(t){var e=this.gl,r=this.renderData,n=this.fadeData;if(!(0,s.isNull)(r)){var i=r.backgroundTexture,o=n.backgroundInfo,a=o.width,u=o.height,l=function(t){return(0,s.isZero)(t&t-1)},c=l(a)&&l(u)?e.REPEAT:e.CLAMP_TO_EDGE;e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,c),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.resource)}}function ct(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,s.isNull)(e)&&this.config){var i=e.textures,o=e.framebuffers,a=r.resolution,u=this.gl,l=1/a;e.textureDelta=new Float32Array([l,l]),this.config.extensions.forEach((function(t){return u.getExtension(t)}));for(var c=this.config.arrayType,f=c?new c(a*a*4):null,p=this.config,d=0;d<2;d++){var h=u.createTexture(),v=u.createFramebuffer();u.bindFramebuffer(u.FRAMEBUFFER,v),u.bindTexture(u.TEXTURE_2D,h),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,p.linearSupport?u.LINEAR:u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,p.linearSupport?u.LINEAR:u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,a,a,0,u.RGBA,p.type,f),u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,h,0),i.push(h),o.push(v)}e.quad=u.createBuffer(),u.bindBuffer(u.ARRAY_BUFFER,e.quad),u.bufferData(u.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),u.STATIC_DRAW),Reflect.apply(ut,this,[]),Reflect.apply(lt,this,[]),Reflect.apply(W,this,[]),u.clearColor(0,0,0,0),u.blendFunc(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(ot,this,[]),Reflect.apply(st,this,[n.lastDrawImage]),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(nt,t,[])}))}}function ft(){var t=this.renderData,e=this.fadeData;if(!(0,s.isNull)(t)){var r=t.parentElement,n=e.backgroundInfo,i=r.offsetWidth,o=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=o,Reflect.apply(W,this,[])}}function pt(){var t=this.renderData,e=this.fadeData;(0,s.isNull)(t)||(t.destroy(),Object.keys(t).forEach((function(e){return t[e]=null})),this.renderData=null),e.destroy(),Object.keys(e).forEach((function(t){return e[t]=null})),this.fadeData=null,this.gl&&(this.gl=null)}function dt(t,e,r,n){var i=this.renderData,o=this.options,a=this.gl;if(!(0,s.isNull)(i)){var u=i.parentElement,l=i.dropProgram,c=i.textures,p=i.framebuffers,d=i.bufferWriteIndex,h=i.bufferReadIndex,v=o.resolution,m=u.offsetWidth,g=u.offsetHeight,y=Math.max(m,g);r/=y;var b=new Float32Array([(2*t-m)/y,(g-2*e)/y]);a.viewport(0,0,v,v),a.bindFramebuffer(a.FRAMEBUFFER,p[d]),Reflect.apply(f,this,[c[h]]),a.useProgram(l.id),a.uniform2fv(l.locations.center,b),a.uniform1f(l.locations.radius,r),a.uniform1f(l.locations.strength,n),Reflect.apply(Q,this,[]),Reflect.apply(et,this,[])}}function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function vt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,gt(n.key),n)}}function mt(t,e,r){return(e=gt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gt(t){var e=function(t){if("object"!=ht(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ht(e)?e:e+""}function yt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function bt(t,e){return t.get(wt(t,e))}function Et(t,e,r){return t.set(wt(t,e),r),r}function wt(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Rt=new WeakMap,Tt=new WeakMap,St=new WeakMap,Pt=new WeakMap,xt=new WeakMap,Ot=new WeakMap,kt=new WeakMap,At=function(){return t=function t(e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),yt(this,Rt,T.accelerating),yt(this,Tt,T.interactive),yt(this,St,T.resolution),yt(this,Pt,T.perturbance),yt(this,xt,T.dropRadius),mt(this,"imgUrl",T.imgUrl),yt(this,Ot,T.idleFluctuations),yt(this,kt,T.raindropsTimeInterval),mt(this,"crossOrigin","no-cors"),mt(this,"visible",!1),mt(this,"running",!1),mt(this,"lastRunningState",!1),this.perturbance=e.perturbance,this.resolution=e.resolution,this.raindropsTimeInterval=e.raindropsTimeInterval,this.accelerating=e.accelerating,this.interactive=e.interactive,this.dropRadius=e.dropRadius,this.imgUrl=e.imgUrl,this.idleFluctuations=e.idleFluctuations,this.running=Boolean(null===(r=e.playingState)||void 0===r||r),this.crossOrigin=e.crossOrigin},(e=[{key:"accelerating",get:function(){return bt(Rt,this)},set:function(t){t>100||t<2||Et(Rt,this,t)}},{key:"interactive",get:function(){return bt(Tt,this)},set:function(t){(0,s.isBoolean)(t)&&Et(Tt,this,t)}},{key:"resolution",get:function(){return bt(St,this)},set:function(t){t<100||t>550||Et(St,this,t)}},{key:"perturbance",get:function(){return bt(Pt,this)},set:function(t){t<1e-4||t>1||Et(Pt,this,t)}},{key:"dropRadius",get:function(){return bt(xt,this)},set:function(t){!isFinite(t)||t<10||Et(xt,this,t)}},{key:"idleFluctuations",get:function(){return bt(Ot,this)},set:function(t){(0,s.isBoolean)(t)&&Et(Ot,this,t)}},{key:"raindropsTimeInterval",get:function(){return bt(kt,this)},set:function(t){t<10||t>12e3||Et(kt,this,t)}},{key:"playingState",get:function(){return this.running},set:function(t){this.running=Boolean(null==t||t)}}])&&vt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function It(){var t=this,e=this.options,r=this.fadeData;r.transparentId=setTimeout((function(){if(clearTimeout(r.transparentId),r.isTransitioning)return Reflect.apply(It,t,[]);"image"!==r.lastDrawImage.kind&&r.run()}),2*e.raindropsTimeInterval)}function Dt(){var t=this.renderData,e=this.fadeData,r=this.options,n=e.toBeList;if((0,s.isNull)(t))return e.isTransitioning=!1,void Reflect.apply(It,this,[]);if((0,s.isEmptyArray)(n))return e.isTransitioning=!1,void Reflect.apply(It,this,[]);if(0===e.drawProgress&&n.forEach((function(t){})),e.drawProgress>1e3)if(e.isTransitioning=!1,e.lastDrawImage=n.shift(),Reflect.apply(st,this,[e.lastDrawImage]),(0,s.isEmptyArray)(n)){var i=t.lastUseStyle;(0,s.isNull)(r.imgUrl)&&p(i.backgroundColor)&&d(i.backgroundImage)&&(Reflect.apply(L,this,[!1]),Reflect.apply(It,this,[]))}else Reflect.apply(It,this,[]);else{var o=e.lastDrawImage,a=e.backgroundInfo;e.drawProgress+=18;var u=document.createElement("canvas"),l=u.getContext("2d");if(!((0,s.isNull)(l)||(0,s.isNull)(o.resource)||(0,s.isEmptyArray)(n))){var c=a.width,f=a.height;u.width=c,u.height=f,l.clearRect(0,0,c,f),l.drawImage(o.resource,0,0,c,f),l.globalAlpha=e.drawProgress/1e3,l.drawImage(n[0].resource,0,0,c,f),l.globalAlpha=1;var h={resource:u,width:c,height:f,kind:"mix",tag:"".concat(o.tag," >> ").concat(n[0].tag)};Reflect.apply(st,this,[h]),n.length>1&&(e.lastDrawImage=h,n.shift(),e.drawProgress=0)}}}function _t(t){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}function Ft(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ut(n.key),n)}}function jt(t,e,r){return(e=Ut(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ut(t){var e=function(t){if("object"!=_t(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=_t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_t(e)?e:e+""}var Ct=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),jt(this,"backgroundInfo",{width:0,height:0}),jt(this,"transparentId",setTimeout(Boolean)),jt(this,"lastDrawImage",void 0),jt(this,"toBeList",[]),jt(this,"drawProgress",0),jt(this,"isTransitioning",!1);var r,n,i=e.renderData;if((0,s.isNull)(i))r=10,n=10;else{var o=getComputedStyle(i.parentElement);r=parseInt(o.width),n=parseInt(o.height)}this.backgroundInfo={width:r,height:n},this.lastDrawImage={resource:N(r,n),width:r,height:n,kind:"default",tag:""}},(e=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){this.transparentId&&clearTimeout(this.transparentId)}}])&&Ft(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Nt(t){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(t)}function Lt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Bt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Lt(Object(r),!0).forEach((function(e){Gt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Mt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ht(n.key),n)}}function Xt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Xt=function(){return!!t})()}function Wt(t){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wt(t)}function zt(t,e){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zt(t,e)}function Gt(t,e,r){return(e=Ht(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ht(t){var e=function(t){if("object"!=Nt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Nt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nt(e)?e:e+""}var Yt=new WeakMap,qt=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Gt(n=function(t,e,r){return e=Wt(e),function(t,e){if(e&&("object"==Nt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Xt()?Reflect.construct(e,r||[],Wt(t).constructor):e.apply(t,r))}(this,e,[t]),"renderData",null),Gt(n,"options",void 0),Gt(n,"fadeData",void 0),Gt(n,"defaults",T),Gt(n,"initialized",!1),function(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}(n,Yt,(0,w.debounce)(ft,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new At(Bt(Bt({},n.defaults),r)),n.renderData=new K(t,n.reloadBackground,n),n.fadeData=new Ct(n),(0,s.isFalse)(n.initState)||(0,s.isNull)(t.parentElement)||(0,s.isNull)(n.config)||(0,s.isNull)(n.gl)?n.initState=!1:(function(t){var e=t.parentElement;t.width=e.clientWidth,t.height=e.clientHeight,(0,a.setStyle)(t,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(t),Reflect.apply(ct,n,[])),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zt(t,e)}(e,t),r=e,n=[{key:"raindropsFall",value:function(){var t=this.renderData,e=this.options,r=this.fadeData;if(!(0,s.isNull)(t)){var n=r.backgroundInfo,i=t.lastRaindropsFallTime,o=e.raindropsTimeInterval,a=e.dropRadius,u=Date.now();if(!(u-i<o)){t.lastRaindropsFallTime=u;var l=function(t){return(0,w.getRandomInt)(t)},c=n.width,f=n.height;this.drop(l(c),l(f),a,.03)}}}},{key:"drop",value:function(t,e,r,n){Reflect.apply(dt,this,[t,e,r,n])}},{key:"fade",value:function(){Reflect.apply(Dt,this,[])}},{key:"reloadBackground",value:function(){var t,e;(t=Yt,e=this,t.get(function(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}(t,e))).call(this)}},{key:"destroy",value:function(){Reflect.apply(pt,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(z,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(H,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var t=this.options;t.running=!t.running}},{key:"set",value:function(t,e){"imgUrl"===t?(this.options.imgUrl=e,Reflect.apply(W,this,[])):this.options[t]=e}}],n&&Mt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(E);function $t(t,e){var r=(0,o.useRef)(null);return(0,o.useEffect)((function(){if(!(0,s.isNull)(t.current))return r.current=new qt(t.current,e&&e.option),function(){var t,e;return null!==(t=null===(e=r.current)||void 0===e?void 0:e.destroy())&&void 0!==t?t:void 0}}),[]),r}},109:(t,e,r)=>{r.d(e,{A:()=>u});var n=r(601),i=r.n(n),o=r(314),a=r.n(o)()(i());a.push([t.id,".en-ripple-container{width:100%;height:100%;position:relative;top:0px;left:0px;z-index:1}",""]);const u=a},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,i,o){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(n)for(var u=0;u<this.length;u++){var l=this[u][0];null!=l&&(a[l]=!0)}for(var s=0;s<t.length;s++){var c=[].concat(t[s]);n&&a[c[0]]||(void 0!==o&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),r&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=r):c[2]=r),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),e.push(c))}},e}},362:(t,e,n)=>{var i,o;t.exports=(i={isArray:()=>r.isArray,isBoolean:()=>r.isBoolean,isEmptyArray:()=>r.isEmptyArray,isFalse:()=>r.isFalse,isNull:()=>r.isNull,isString:()=>r.isString,isUndefined:()=>r.isUndefined,isZero:()=>r.isZero},o={},n.d(o,i),o)},411:(t,e,r)=>{var i,o;t.exports=(i={xcn:()=>n.xcn},o={},r.d(o,i),o)},540:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},601:t=>{t.exports=function(t){return t[1]}},649:(t,e,r)=>{var n,o;t.exports=(n={default:()=>i.default,forwardRef:()=>i.forwardRef,useEffect:()=>i.useEffect,useImperativeHandle:()=>i.useImperativeHandle,useRef:()=>i.useRef},o={},r.d(o,n),o)},659:t=>{var e={};t.exports=function(t,r){var n=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},825:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var n="";r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {"));var i=void 0!==r.layer;i&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,i&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var o=r.sourceMap;o&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}}},a={};function u(t){var e=a[t];if(void 0!==e)return e.exports;var r=a[t]={id:t,exports:{}};return o[t](r,r.exports,u),r.exports}u.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return u.d(e,{a:e}),e},u.d=(t,e)=>{for(var r in e)u.o(e,r)&&!u.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},u.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),u.nc=void 0;var l={};u.d(l,{z:()=>_});var s=u(649),c=u(78),f=u(362),p=u(411),d=u(72),h=u.n(d),v=u(825),m=u.n(v),g=u(659),y=u.n(g),b=u(56),E=u.n(b),w=u(540),R=u.n(w),T=u(113),S=u.n(T),P=u(109),x={};function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}x.styleTagTransform=S(),x.setAttributes=E(),x.insert=y().bind(null,"head"),x.domAPI=m(),x.insertStyleElement=R(),h()(P.A,x),P.A&&P.A.locals&&P.A.locals;var k=["children","style"];function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){D(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t,e,r){return(e=function(t){var e=function(t){if("object"!=O(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=O(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==O(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var _=(0,s.forwardRef)((function(t,e){var r=t.children,n=t.style,i=function(t,e){if(null==t)return{};var r,n,i=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}(t,k),o=(0,s.useRef)(null),a=(0,c.n)(o,i);return function(t,e){(0,s.useEffect)((function(){if(e.option&&t.current){var r=e.option;Object.keys(t.current.defaults).forEach((function(e){!(0,f.isUndefined)(r[e])&&t.current&&t.current.set(e,r[e])}))}}),[e.option])}(a,i),(0,s.useImperativeHandle)(e,(function(){return{toggleState:function(){var t;null===(t=a.current)||void 0===t||t.changePlayingState()},get state(){var t,e;return null!==(t=null===(e=a.current)||void 0===e?void 0:e.options.playingState)&&void 0!==t&&t},pause:function(){var t;null===(t=a.current)||void 0===t||t.pause()},set:function(t){if(!(0,f.isUndefined)(t))for(var e=Object.keys(t),r=0,n=e.length;r<n;r++){var i,o=e[r];null===(i=a.current)||void 0===i||i.set(o,t[o])}}}})),s.default.createElement("div",{className:(0,p.xcn)("en-ripple-container"),style:I({backgroundRepeat:"round"},n)},s.default.createElement("canvas",{ref:o,"data-earthnut-ui":"canvas"}),r)}));_.displayName="en-background-ripple";const F=l.z;export{F as BackgroundRipple};
|
package/README.md
CHANGED
|
@@ -8,6 +8,21 @@
|
|
|
8
8
|
npm install --save earthnut
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## 涟漪背景
|
|
12
|
+
|
|
13
|
+
由于当前组件的开发进度较缓慢,目前:
|
|
14
|
+
|
|
15
|
+
- 尽管接受所有的 style 属性,但是 `position` 还是期待是非 'static' 值,否则将影响涟漪背景的渲染位置和显示状态;
|
|
16
|
+
- 当前如果设置了 `background` 的话,有可能在恢复时使得其覆盖其他子属性;
|
|
17
|
+
- 当前期待使用 `background-color` 设置背景色,而不是在上面的 `background` 中设置背景色。譬如:`background-color: #f0f6;`
|
|
18
|
+
- 当前更期待使用配置参数 `option` 的 'imgUrl' 来配置目标背景图(请注意图源的跨域问题)。譬如:`imgUrl: 'background.png'`
|
|
19
|
+
- 当然,也可以使用标准的 `background-image` 配置符合要求的背景图片(目前仅支持单张图配置)。譬如:`background-image: url(background.png);`
|
|
20
|
+
- 当前可配置 `background-image` 为渐变色,但仅支持从上到下的线性渐变(仅支持单渐变)。譬如: `background-image: linear-gradient(black, transparent);`
|
|
21
|
+
- 在同时配置了 `imgUrl`、`background-image`、`background-color` 时仅会显示一个效果(混合效果暂时并未实现)。优先展示 `imgUrl`,然后是 `background-image`,之后是 `background-color` 。如果都未设置则会展示默认的老式地板砖背景图
|
|
22
|
+
- 尽量不要是使用透明色或是当前的主背景色,否则导致涟漪的效果不明显
|
|
23
|
+
|
|
24
|
+
切换背景最好不好通过设置
|
|
25
|
+
|
|
11
26
|
## 文档
|
|
12
27
|
|
|
13
28
|
参阅 [earthnut](https://earthnut.dev/)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Ripples } from '../../ripplesClass';
|
|
2
|
+
import { DrawImage } from 'customHooks/useRipples/rippersData/fadeData';
|
|
2
3
|
/** 绑定图片 */
|
|
3
|
-
export declare function bindImage(this: Ripples, texImageSource:
|
|
4
|
+
export declare function bindImage(this: Ripples, texImageSource: DrawImage): void;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { Ripples } from '../ripplesClass';
|
|
2
|
+
export type DrawImage = {
|
|
3
|
+
/** 资源 */
|
|
4
|
+
resource: HTMLCanvasElement | HTMLImageElement;
|
|
5
|
+
/** 类型 */
|
|
6
|
+
kind: 'image' | 'linear-gradient' | 'background-color' | 'default' | 'mix';
|
|
7
|
+
/** 标识 */
|
|
8
|
+
tag: string;
|
|
9
|
+
/** 当前的宽 */
|
|
10
|
+
width: number;
|
|
11
|
+
/** 当前的高 */
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
2
14
|
/** 背景渐变的数据 */
|
|
3
15
|
export declare class FadeData {
|
|
4
16
|
/** 背景页面的数据 */
|
|
@@ -12,18 +24,20 @@ export declare class FadeData {
|
|
|
12
24
|
*
|
|
13
25
|
* 如果没有 toBeList 为空值,则当前渲染的为此纹理)绘制的图像
|
|
14
26
|
*/
|
|
15
|
-
lastDrawImage:
|
|
27
|
+
lastDrawImage: DrawImage;
|
|
16
28
|
/** 当前绘制的图像
|
|
17
29
|
*
|
|
18
30
|
* 该值仅出现在需要渐变过程中,一旦渐变完成,实际渲染的值就成了最后渲染的值
|
|
19
31
|
*/
|
|
20
|
-
toBeList:
|
|
32
|
+
toBeList: DrawImage[];
|
|
21
33
|
/** 绘制进度 */
|
|
22
34
|
drawProgress: number;
|
|
23
35
|
/** 是否处于绘制过渡状态 */
|
|
24
36
|
isTransitioning: boolean;
|
|
25
37
|
/** 执行渐变 */
|
|
26
38
|
run(): void;
|
|
39
|
+
/** 销毁 */
|
|
40
|
+
destroy(): void;
|
|
27
41
|
/** 创建背景渐变的数据 */
|
|
28
42
|
constructor(_Ripples: Ripples);
|
|
29
43
|
}
|