earthnut 0.0.0 → 0.0.1
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 -0
- package/BackgroundRipple/index.mjs +1 -0
- package/LICENSE +25 -0
- package/Layout/index.cjs +1 -0
- package/Layout/index.mjs +1 -0
- package/README.md +9 -5
- package/components/button/button.d.ts +5 -0
- package/components/button/index.d.ts +3 -0
- package/components/button/style/index.d.ts +1 -0
- package/components/index.d.ts +3 -0
- package/components/layout/content.d.ts +11 -0
- package/components/layout/footer.d.ts +16 -0
- package/components/layout/header.d.ts +18 -0
- package/components/layout/index.d.ts +2 -0
- package/components/layout/layout.d.ts +50 -0
- package/components/layout/sideBar.d.ts +24 -0
- package/components/layout/types.d.ts +71 -0
- package/components/menu/index.d.ts +0 -0
- package/components/menu/menu.d.ts +0 -0
- package/components/menu/style/index.d.ts +0 -0
- package/components/ripples/RipplesEle.d.ts +36 -0
- package/components/ripples/index.d.ts +4 -0
- package/components/ripples/style/index.d.ts +0 -0
- package/components/ripples/types.d.ts +11 -0
- package/components/ripples/useOptionUpdate.d.ts +5 -0
- package/customHooks/index.d.ts +5 -0
- package/customHooks/useAnimationFrame.d.ts +42 -0
- package/customHooks/useInputIsComposing.d.ts +46 -0
- package/customHooks/useRipples/buildBackground/default-background/_createImageData.d.ts +7 -0
- package/customHooks/useRipples/buildBackground/default-background/circleDataList.d.ts +18 -0
- package/customHooks/useRipples/buildBackground/default-background/createCanvasElementBySize.d.ts +2 -0
- package/customHooks/useRipples/buildBackground/default-background/createDefault.d.ts +2 -0
- package/customHooks/useRipples/buildBackground/default-background/index.d.ts +10 -0
- package/customHooks/useRipples/buildBackground/loadImage.d.ts +13 -0
- package/customHooks/useRipples/buildBackground/runSide.d.ts +9 -0
- package/customHooks/useRipples/buildBackground/type.d.ts +27 -0
- package/customHooks/useRipples/buildBackground/utils/bindImage.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/utils/createCanvasElement.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/utils/createImageBySrc.d.ts +2 -0
- package/customHooks/useRipples/buildBackground/utils/getBackgroundStyle.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/utils/hideCssBackground.d.ts +10 -0
- package/customHooks/useRipples/buildBackground/utils/restore-css-background.d.ts +7 -0
- package/customHooks/useRipples/callback/destroy.d.ts +3 -0
- package/customHooks/useRipples/callback/drop.d.ts +3 -0
- package/customHooks/useRipples/callback/fade.d.ts +3 -0
- package/customHooks/useRipples/callback/reload-background.d.ts +6 -0
- package/customHooks/useRipples/callback/scale.d.ts +2 -0
- package/customHooks/useRipples/index.d.ts +40 -0
- package/customHooks/useRipples/init/index.d.ts +5 -0
- package/customHooks/useRipples/init/initEvent.d.ts +5 -0
- package/customHooks/useRipples/init/initShaders.d.ts +7 -0
- package/customHooks/useRipples/init/initTexture.d.ts +7 -0
- package/customHooks/useRipples/render/computeTextureBoundaries.d.ts +3 -0
- package/customHooks/useRipples/render/draw.d.ts +7 -0
- package/customHooks/useRipples/render/drawQuad.d.ts +7 -0
- package/customHooks/useRipples/render/dropAtPointer.d.ts +7 -0
- package/customHooks/useRipples/render/index.d.ts +6 -0
- package/customHooks/useRipples/render/swapBufferIndices.d.ts +5 -0
- package/customHooks/useRipples/render/update.d.ts +5 -0
- package/customHooks/useRipples/rippersData/defaultData.d.ts +5 -0
- package/customHooks/useRipples/rippersData/fadeData.d.ts +29 -0
- package/customHooks/useRipples/rippersData/index.d.ts +40 -0
- package/customHooks/useRipples/rippersData/loadConfig.d.ts +19 -0
- package/customHooks/useRipples/rippersData/renderData.d.ts +72 -0
- package/customHooks/useRipples/rippersData/useOptions.d.ts +81 -0
- package/customHooks/useRipples/rippersData/vertexSource.d.ts +28 -0
- package/customHooks/useRipples/ripple.html.d.ts +6 -0
- package/customHooks/useRipples/ripplesClass.d.ts +51 -0
- package/customHooks/useRipples/tools.d.ts +31 -0
- package/customHooks/useRipples/types.d.ts +192 -0
- package/customHooks/useTimeId.d.ts +55 -0
- package/dog.d.ts +3 -0
- package/index.cjs +1 -0
- package/index.d.ts +5 -0
- package/index.js.LICENSE.txt +79 -0
- package/index.mjs +1 -0
- package/package.json +87 -14
- package/styles/common.css +360 -0
- package/styles/common.scss +444 -0
- package/useAnimationFrame/index.cjs +1 -0
- package/useAnimationFrame/index.mjs +1 -0
- package/useInputIsComposing/index.cjs +1 -0
- package/useInputIsComposing/index.mjs +1 -0
- package/useRipples/index.cjs +1 -0
- package/useRipples/index.mjs +1 -0
- package/useTimeId/index.cjs +1 -0
- package/useTimeId/index.mjs +1 -0
- package/index.js +0 -1
|
@@ -0,0 +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})();
|
|
@@ -0,0 +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};
|
package/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) <2025> <earthnut.dev>
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
|
|
17
|
+
# MIT 许可证
|
|
18
|
+
|
|
19
|
+
版权所有 (c) [2025] [花生亻]
|
|
20
|
+
|
|
21
|
+
特此免费授予任何获得本软件及相关文档文件(以下简称“软件”)副本的人不受限制地处置该软件的权利,包括不受限制地使用、复制、修改、合并、发布、分发、再许可和/或出售该软件副本的权利,并允许向其提供该软件的人这样做,但须遵守以下条件:
|
|
22
|
+
|
|
23
|
+
上述版权声明和本许可声明应包含在所有副本或软件的重要部分中。
|
|
24
|
+
|
|
25
|
+
软件按“原样”提供,不附带任何形式的明示或暗示的保证,包括但不限于适销性、特定用途适用性和不侵权的保证。在任何情况下,作者或版权持有人均不对因合同、侵权或其他方式引起的任何索赔、损害或其他责任负责,无论是在与软件或软件的使用或其他交易有关的任何诉讼中。
|
package/Layout/index.cjs
ADDED
|
@@ -0,0 +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,a=0;a<t.length;a++)if(t[a].identifier===e){r=a;break}return r}function a(e,a){for(var o={},i=[],l=0;l<e.length;l++){var u=e[l],c=a.base?u[0]+a.base:u[0],s=o[c]||0,d="".concat(c," ").concat(s);o[c]=s+1;var y=r(d),h={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==y)t[y].references++,t[y].updater(h);else{var f=n(h,a);a.byIndex=l,t.splice(l,0,{identifier:d,updater:f,references:1})}i.push(d)}return i}function n(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,n){var o=a(e=e||[],n=n||{});return function(e){e=e||[];for(var i=0;i<o.length;i++){var l=r(o[i]);t[l].references--}for(var u=a(e,n),c=0;c<o.length;c++){var s=r(o[c]);0===t[s].references&&(t[s].updater(),t.splice(s,1))}o=u}}},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="",a=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),a&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),a&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,a,n,o){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(a)for(var l=0;l<this.length;l++){var u=this[l][0];null!=u&&(i[u]=!0)}for(var c=0;c<e.length;c++){var s=[].concat(e[c]);a&&i[s[0]]||(void 0!==o&&(void 0===s[5]||(s[1]="@layer".concat(s[5].length>0?" ".concat(s[5]):""," {").concat(s[1],"}")),s[5]=o),r&&(s[2]?(s[1]="@media ".concat(s[2]," {").concat(s[1],"}"),s[2]=r):s[2]=r),n&&(s[4]?(s[1]="@supports (".concat(s[4],") {").concat(s[1],"}"),s[4]=n):s[4]="".concat(n)),t.push(s))}},t}},384:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(601),n=r.n(a),o=r(314),i=r.n(o)()(n());i.push([e.id,'.LcdTDTWWkxGZFXQc8XNV{width:var(--layout-width);height:var(--layout-height);overflow-x:hidden;overflow-y:auto}.CxCt7n1zXeDfFdmgQAme{grid-area:header;position:sticky;top:0px;left:0px;z-index:10;height:var(--layout-header-height);box-shadow:0 4px 13px -3px rgba(0,0,0,.1019607843);overflow:hidden}.E2socS6t6fugHzd2ATQy{position:sticky;left:0;z-index:8;grid-area:side;overflow-x:hidden;overflow-y:auto}.k2yu7eCpEzToH_ynBglg{grid-area:content}.zWuykaXyereS6ELF7SHy{grid-area:footer;height:var(--layout-footer-height);box-shadow:0 -1px 13px 0px rgba(0,0,0,.1019607843);overflow:hidden}.O6AnGNbL5r3nPmEFEv73>.CxCt7n1zXeDfFdmgQAme{position:relative;z-index:2}.O6AnGNbL5r3nPmEFEv73.ognI7wqsq0lXqSVkJ0cj>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy,.O6AnGNbL5r3nPmEFEv73.Sax5A5AqDPokwTlrUZu5>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy{top:0;min-height:calc(var(--layout-height) - var(--layout-footer-height) - var(--layout-header-height));max-height:var(--layout-height)}.O6AnGNbL5r3nPmEFEv73.Wz4q5vQzeOw8RbDr0rOF>.E2socS6t6fugHzd2ATQy,.O6AnGNbL5r3nPmEFEv73.GkLVEZcHiQyvuSh0RLU5>.E2socS6t6fugHzd2ATQy{top:0;min-height:calc(var(--layout-height) - var(--layout-footer-height));max-height:var(--layout-height)}.rZPYzoPjyQP7sDeJbPjp>.E2socS6t6fugHzd2ATQy{top:0;height:var(--layout-height)}.ognI7wqsq0lXqSVkJ0cj>.r_iQ4e7myBc0DSPRkp2u,.Sax5A5AqDPokwTlrUZu5>.r_iQ4e7myBc0DSPRkp2u{display:grid;grid-template-rows:calc(var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height)) auto;min-height:calc(100% - var(--layout-header-height) - var(--layout-footer-height))}.ognI7wqsq0lXqSVkJ0cj>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy,.Sax5A5AqDPokwTlrUZu5>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy{top:var(--layout-header-height);min-height:calc(var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height));max-height:calc(var(--layout-height) - var(--layout-header-height))}.ognI7wqsq0lXqSVkJ0cj>.r_iQ4e7myBc0DSPRkp2u,.UhPmIL0kNAGv5201kGbo>.r_iQ4e7myBc0DSPRkp2u{grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:"side content" ". content"}.Sax5A5AqDPokwTlrUZu5>.r_iQ4e7myBc0DSPRkp2u,.Nkg7pjNAPCenCQZY8gLg>.r_iQ4e7myBc0DSPRkp2u{grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:"content side" "content ."}.XRYEv9hWhdcl2OHap6fQ,.SmA7SjLAZLofOenJZAWg{display:grid;grid-template-rows:var(--layout-header-height) auto var(--layout-footer-height);gap:0px}.XRYEv9hWhdcl2OHap6fQ{grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:"side header" "side content" "side footer"}.SmA7SjLAZLofOenJZAWg{grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:"header side" "content side" "footer side"}.UhPmIL0kNAGv5201kGbo>.r_iQ4e7myBc0DSPRkp2u,.Nkg7pjNAPCenCQZY8gLg>.r_iQ4e7myBc0DSPRkp2u{display:grid;grid-template-rows:auto}.UhPmIL0kNAGv5201kGbo>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy,.Nkg7pjNAPCenCQZY8gLg>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy{top:0;min-height:calc(var(--layout-height) - var(--layout-footer-height));max-height:var(--layout-height)}.UT3CcVcTx9pLwV2GGFGi,.tzvYxycvFA9rcOf26LP7{display:grid;grid-template-rows:auto var(--layout-footer-height);gap:0px}.UT3CcVcTx9pLwV2GGFGi{grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:"side content" "side footer"}.tzvYxycvFA9rcOf26LP7{grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:"content side" "footer side"}.Wz4q5vQzeOw8RbDr0rOF,.GkLVEZcHiQyvuSh0RLU5{display:grid;grid-template-rows:var(--layout-header-height) auto;min-height:calc(100% - var(--layout-header-height));gap:0px}.Wz4q5vQzeOw8RbDr0rOF>.E2socS6t6fugHzd2ATQy,.GkLVEZcHiQyvuSh0RLU5>.E2socS6t6fugHzd2ATQy{top:var(--layout-header-height);height:calc(var(--layout-height) - var(--layout-header-height))}.Wz4q5vQzeOw8RbDr0rOF{grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:"header header" "side content" ". content"}.GkLVEZcHiQyvuSh0RLU5{grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:"header header" "content side" "content ."}.cFlRZr9kGWMtc0nRYCWE,.DzmD_4Su8YXCKKIwXjG1{display:grid;grid-template-rows:var(--layout-header-height) auto;gap:0px}.cFlRZr9kGWMtc0nRYCWE>.k2yu7eCpEzToH_ynBglg,.DzmD_4Su8YXCKKIwXjG1>.k2yu7eCpEzToH_ynBglg{min-height:calc(var(--layout-height) - var(--layout-header-height))}.cFlRZr9kGWMtc0nRYCWE{grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:"side header" "side content"}.DzmD_4Su8YXCKKIwXjG1{grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:"header side" "content side"}.sm5xSKZmdrGS3a6b5rcN{display:grid;grid-template-rows:auto var(--layout-footer-height);grid-template-columns:1fr;gap:0px;grid-template-areas:"content" "footer"}.qxhkwYH_Y7uyvMDH8JyZ{display:grid;grid-template-rows:var(--layout-header-height) auto;grid-template-columns:1fr;gap:0px;grid-template-areas:"header" "content"}.sAEoDcBqMzkziXXvgv8X,.jxy4KSYJK23WN2rx2CDS,.wVTitTPpRyG8XfbxJGhy,.mKVYywd6gr5_u2naW5_u{display:grid;grid-template-rows:100%;grid-template-columns:var(--layout-side-bar-width) auto;gap:0px;grid-template-areas:"side content" ". content"}.mKVYywd6gr5_u2naW5_u,.jxy4KSYJK23WN2rx2CDS{grid-template-areas:"content side" "content .";grid-template-columns:auto var(--layout-side-bar-width)}',""]),i.locals={"en-layout":"LcdTDTWWkxGZFXQc8XNV","en-layout-header":"CxCt7n1zXeDfFdmgQAme","en-layout-side":"E2socS6t6fugHzd2ATQy","en-layout-main":"k2yu7eCpEzToH_ynBglg","en-layout-footer":"zWuykaXyereS6ELF7SHy","en-layout-header-no-sticky":"O6AnGNbL5r3nPmEFEv73","en-layout-simple-all":"ognI7wqsq0lXqSVkJ0cj","en-layout-content":"r_iQ4e7myBc0DSPRkp2u","en-layout-side-right-all":"Sax5A5AqDPokwTlrUZu5","en-layout-simple-no-footer":"Wz4q5vQzeOw8RbDr0rOF","en-layout-side-right-no-footer":"GkLVEZcHiQyvuSh0RLU5","en-layout-side-full":"rZPYzoPjyQP7sDeJbPjp","en-layout-simple-no-header":"UhPmIL0kNAGv5201kGbo","en-layout-side-right-no-header":"Nkg7pjNAPCenCQZY8gLg","en-layout-side-full-all":"XRYEv9hWhdcl2OHap6fQ","en-layout-side-right-full-all":"SmA7SjLAZLofOenJZAWg","en-layout-side-full-no-header":"UT3CcVcTx9pLwV2GGFGi","en-layout-side-right-full-no-header":"tzvYxycvFA9rcOf26LP7","en-layout-side-full-no-footer":"cFlRZr9kGWMtc0nRYCWE","en-layout-side-right-full-no-footer":"DzmD_4Su8YXCKKIwXjG1","en-layout-only-footer":"sm5xSKZmdrGS3a6b5rcN","en-layout-only-header":"qxhkwYH_Y7uyvMDH8JyZ","en-layout-simple-only-side":"sAEoDcBqMzkziXXvgv8X","en-layout-side-right-only-side":"jxy4KSYJK23WN2rx2CDS","en-layout-side-full-only-side":"wVTitTPpRyG8XfbxJGhy","en-layout-side-right-full-only-side":"mKVYywd6gr5_u2naW5_u"};const l=i},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 a=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(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.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 a="";r.supports&&(a+="@supports (".concat(r.supports,") {")),r.media&&(a+="@media ".concat(r.media," {"));var n=void 0!==r.layer;n&&(a+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),a+=r.css,n&&(a+="}"),r.media&&(a+="}"),r.supports&&(a+="}");var o=r.sourceMap;o&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(a,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(a){var n=t[a];if(void 0!==n)return n.exports;var o=t[a]={id:a,exports:{}};return e[a](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 a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},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 a={};r.r(a),r.d(a,{EnLayout:()=>q,EnLayoutContent:()=>N,EnLayoutFooter:()=>T,EnLayoutHeader:()=>P,EnLayoutSideBar:()=>j,Layout:()=>q,LayoutContent:()=>N,LayoutFooter:()=>T,LayoutHeader:()=>P,LayoutSideBar:()=>j});var n=r(953),o=r.n(n),i=r(763),l=r(72),u=r.n(l),c=r(825),s=r.n(c),d=r(659),y=r.n(d),h=r(56),f=r.n(h),p=r(540),g=r.n(p),m=r(113),v=r.n(m),b=r(384),w={};w.styleTagTransform=v(),w.setAttributes=f(),w.insert=y().bind(null,"head"),w.domAPI=s(),w.insertStyleElement=g(),u()(b.A,w);const S=b.A&&b.A.locals?b.A.locals:void 0;var O=["className","children","height","noSticky"];function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},x.apply(null,arguments)}var P=o().forwardRef((function(e,t){var r=e.className,a=e.children,n=(e.height,e.noSticky,function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,O));return o().createElement("div",x({ref:t,className:(0,i.xcn)(S["en-layout-header"],r)},n,{"data-earthnut-ui":"layout-header"}),a)}));P.displayName="LayoutHeader";var E=["className","width","right","full"];function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},k.apply(null,arguments)}var j=o().forwardRef((function(e,t){var r=e.className,a=(e.width,e.right,e.full,function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,E));return o().createElement("div",k({className:(0,i.xcn)(S["en-layout-side"],r),ref:t},a,{"data-earthnut-ui":"layout-side-bar"}))}));j.displayName="LayoutSideBar";var A=["className"];function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},L.apply(null,arguments)}var N=o().forwardRef((function(e,t){var r=e.className,a=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,A);return o().createElement("main",L({ref:t,className:(0,i.xcn)(S["en-layout-main"],r)},a,{"data-earthnut-ui":"layout-content"}))}));N.displayName="LayoutContent";var D=["className","height"];function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Q.apply(null,arguments)}var T=o().forwardRef((function(e,t){var r=e.className,a=(e.height,function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,D));return o().createElement("div",Q({ref:t},a,{className:(0,i.xcn)(S["en-layout-footer"],r),"data-earthnut-ui":"layout-footer"}))}));T.displayName="LayoutFooter";var z=r(570);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)}var C=["className","children","style","width","height"];function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},G.apply(null,arguments)}function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e,t,r){return(t=function(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+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var q=n.forwardRef((function(e,t){var r,a,o,l,u=e.className,c=e.children,s=e.style,d=e.width,y=void 0===d?"100vw":d,h=e.height,f=void 0===h?"100vh":h,p=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,C),g="simple",m="",v=!1,b=!1,w=!1,O=!1,x=150,E="2.8rem",k="2rem",A=!1;n.Children.forEach(c,(function(e){if(n.isValidElement(e))if(v||e.type!==P)if(b||e.type!==j)w||e.type!==N?w||e.type!==q?O||e.type!==T||(k=e.props.height||k,l=e,O=!0):(o=n.createElement("main",{"data-earthnut-ui":"layout-content",className:(0,i.xcn)(S["en-layout-main"])},e),w=!0):(o=e,w=!0);else{var t=e.props;x=t.width||x,g=t.right&&t.full?"side-right-full":t.right?"side-right":t.full?"side-full":"simple",A=(0,z.isTrue)(t.full),a=e,b=!0}else{var u=e.props;E=u.height||E,m=u.noSticky?S["en-layout-header-no-sticky"]:"",r=e,v=!0}}));var L=v&&b&&w&&O&&S["en-layout-".concat(g,"-all")]||v&&w&&b&&S["en-layout-".concat(g,"-no-footer")]||b&&w&&O&&S["en-layout-".concat(g,"-no-header")]||w&&O&&S["en-layout-only-footer"]||w&&v&&S["en-layout-only-header"]||w&&b&&(A=!0)&&S["en-layout-".concat(g,"-only-side")]||"";return n.createElement("div",G({ref:t,className:(0,i.xcn)(S["en-layout"],A&&S["en-layout-side-full"],L,m,u),style:H({"--layout-width":X(y),"--layout-height":X(f),"--layout-side-bar-width":X(x),"--layout-header-height":X(E),"--layout-footer-height":X(k)},s)},p,{"data-earthnut-ui":"layout"}),/side.*full/.test(g)?n.createElement(n.Fragment,null,a,r,o,l):n.createElement(n.Fragment,null,r,O?n.createElement("div",{className:(0,i.xcn)(S["en-layout-content"]),"data-earthnut-ui":"layout-with-foot-content"},a,o):n.createElement(n.Fragment,null,a,o),l))}));function X(e){return(0,z.isNumber)(e)||parseInt(e)===Number(e)?e+"px":e||0}q.displayName="Layout",module.exports.earthnut=a})();
|
package/Layout/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"a-type-of-js";import*as t from"xcn";import*as r from"react";var a={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,a=0;a<t.length;a++)if(t[a].identifier===e){r=a;break}return r}function a(e,a){for(var o={},i=[],l=0;l<e.length;l++){var u=e[l],c=a.base?u[0]+a.base:u[0],s=o[c]||0,d="".concat(c," ").concat(s);o[c]=s+1;var y=r(d),h={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==y)t[y].references++,t[y].updater(h);else{var f=n(h,a);a.byIndex=l,t.splice(l,0,{identifier:d,updater:f,references:1})}i.push(d)}return i}function n(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,n){var o=a(e=e||[],n=n||{});return function(e){e=e||[];for(var i=0;i<o.length;i++){var l=r(o[i]);t[l].references--}for(var u=a(e,n),c=0;c<o.length;c++){var s=r(o[c]);0===t[s].references&&(t[s].updater(),t.splice(s,1))}o=u}}},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="",a=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),a&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),a&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,a,n,o){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(a)for(var l=0;l<this.length;l++){var u=this[l][0];null!=u&&(i[u]=!0)}for(var c=0;c<e.length;c++){var s=[].concat(e[c]);a&&i[s[0]]||(void 0!==o&&(void 0===s[5]||(s[1]="@layer".concat(s[5].length>0?" ".concat(s[5]):""," {").concat(s[1],"}")),s[5]=o),r&&(s[2]?(s[1]="@media ".concat(s[2]," {").concat(s[1],"}"),s[2]=r):s[2]=r),n&&(s[4]?(s[1]="@supports (".concat(s[4],") {").concat(s[1],"}"),s[4]=n):s[4]="".concat(n)),t.push(s))}},t}},362:(t,r,a)=>{var n,o;t.exports=(n={isNumber:()=>e.isNumber,isTrue:()=>e.isTrue},o={},a.d(o,n),o)},384:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(601),n=r.n(a),o=r(314),i=r.n(o)()(n());i.push([e.id,'.LcdTDTWWkxGZFXQc8XNV{width:var(--layout-width);height:var(--layout-height);overflow-x:hidden;overflow-y:auto}.CxCt7n1zXeDfFdmgQAme{grid-area:header;position:sticky;top:0px;left:0px;z-index:10;height:var(--layout-header-height);box-shadow:0 4px 13px -3px rgba(0,0,0,.1019607843);overflow:hidden}.E2socS6t6fugHzd2ATQy{position:sticky;left:0;z-index:8;grid-area:side;overflow-x:hidden;overflow-y:auto}.k2yu7eCpEzToH_ynBglg{grid-area:content}.zWuykaXyereS6ELF7SHy{grid-area:footer;height:var(--layout-footer-height);box-shadow:0 -1px 13px 0px rgba(0,0,0,.1019607843);overflow:hidden}.O6AnGNbL5r3nPmEFEv73>.CxCt7n1zXeDfFdmgQAme{position:relative;z-index:2}.O6AnGNbL5r3nPmEFEv73.ognI7wqsq0lXqSVkJ0cj>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy,.O6AnGNbL5r3nPmEFEv73.Sax5A5AqDPokwTlrUZu5>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy{top:0;min-height:calc(var(--layout-height) - var(--layout-footer-height) - var(--layout-header-height));max-height:var(--layout-height)}.O6AnGNbL5r3nPmEFEv73.Wz4q5vQzeOw8RbDr0rOF>.E2socS6t6fugHzd2ATQy,.O6AnGNbL5r3nPmEFEv73.GkLVEZcHiQyvuSh0RLU5>.E2socS6t6fugHzd2ATQy{top:0;min-height:calc(var(--layout-height) - var(--layout-footer-height));max-height:var(--layout-height)}.rZPYzoPjyQP7sDeJbPjp>.E2socS6t6fugHzd2ATQy{top:0;height:var(--layout-height)}.ognI7wqsq0lXqSVkJ0cj>.r_iQ4e7myBc0DSPRkp2u,.Sax5A5AqDPokwTlrUZu5>.r_iQ4e7myBc0DSPRkp2u{display:grid;grid-template-rows:calc(var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height)) auto;min-height:calc(100% - var(--layout-header-height) - var(--layout-footer-height))}.ognI7wqsq0lXqSVkJ0cj>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy,.Sax5A5AqDPokwTlrUZu5>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy{top:var(--layout-header-height);min-height:calc(var(--layout-height) - var(--layout-header-height) - var(--layout-footer-height));max-height:calc(var(--layout-height) - var(--layout-header-height))}.ognI7wqsq0lXqSVkJ0cj>.r_iQ4e7myBc0DSPRkp2u,.UhPmIL0kNAGv5201kGbo>.r_iQ4e7myBc0DSPRkp2u{grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:"side content" ". content"}.Sax5A5AqDPokwTlrUZu5>.r_iQ4e7myBc0DSPRkp2u,.Nkg7pjNAPCenCQZY8gLg>.r_iQ4e7myBc0DSPRkp2u{grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:"content side" "content ."}.XRYEv9hWhdcl2OHap6fQ,.SmA7SjLAZLofOenJZAWg{display:grid;grid-template-rows:var(--layout-header-height) auto var(--layout-footer-height);gap:0px}.XRYEv9hWhdcl2OHap6fQ{grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:"side header" "side content" "side footer"}.SmA7SjLAZLofOenJZAWg{grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:"header side" "content side" "footer side"}.UhPmIL0kNAGv5201kGbo>.r_iQ4e7myBc0DSPRkp2u,.Nkg7pjNAPCenCQZY8gLg>.r_iQ4e7myBc0DSPRkp2u{display:grid;grid-template-rows:auto}.UhPmIL0kNAGv5201kGbo>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy,.Nkg7pjNAPCenCQZY8gLg>.r_iQ4e7myBc0DSPRkp2u>.E2socS6t6fugHzd2ATQy{top:0;min-height:calc(var(--layout-height) - var(--layout-footer-height));max-height:var(--layout-height)}.UT3CcVcTx9pLwV2GGFGi,.tzvYxycvFA9rcOf26LP7{display:grid;grid-template-rows:auto var(--layout-footer-height);gap:0px}.UT3CcVcTx9pLwV2GGFGi{grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:"side content" "side footer"}.tzvYxycvFA9rcOf26LP7{grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:"content side" "footer side"}.Wz4q5vQzeOw8RbDr0rOF,.GkLVEZcHiQyvuSh0RLU5{display:grid;grid-template-rows:var(--layout-header-height) auto;min-height:calc(100% - var(--layout-header-height));gap:0px}.Wz4q5vQzeOw8RbDr0rOF>.E2socS6t6fugHzd2ATQy,.GkLVEZcHiQyvuSh0RLU5>.E2socS6t6fugHzd2ATQy{top:var(--layout-header-height);height:calc(var(--layout-height) - var(--layout-header-height))}.Wz4q5vQzeOw8RbDr0rOF{grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:"header header" "side content" ". content"}.GkLVEZcHiQyvuSh0RLU5{grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:"header header" "content side" "content ."}.cFlRZr9kGWMtc0nRYCWE,.DzmD_4Su8YXCKKIwXjG1{display:grid;grid-template-rows:var(--layout-header-height) auto;gap:0px}.cFlRZr9kGWMtc0nRYCWE>.k2yu7eCpEzToH_ynBglg,.DzmD_4Su8YXCKKIwXjG1>.k2yu7eCpEzToH_ynBglg{min-height:calc(var(--layout-height) - var(--layout-header-height))}.cFlRZr9kGWMtc0nRYCWE{grid-template-columns:var(--layout-side-bar-width) auto;grid-template-areas:"side header" "side content"}.DzmD_4Su8YXCKKIwXjG1{grid-template-columns:auto var(--layout-side-bar-width);grid-template-areas:"header side" "content side"}.sm5xSKZmdrGS3a6b5rcN{display:grid;grid-template-rows:auto var(--layout-footer-height);grid-template-columns:1fr;gap:0px;grid-template-areas:"content" "footer"}.qxhkwYH_Y7uyvMDH8JyZ{display:grid;grid-template-rows:var(--layout-header-height) auto;grid-template-columns:1fr;gap:0px;grid-template-areas:"header" "content"}.sAEoDcBqMzkziXXvgv8X,.jxy4KSYJK23WN2rx2CDS,.wVTitTPpRyG8XfbxJGhy,.mKVYywd6gr5_u2naW5_u{display:grid;grid-template-rows:100%;grid-template-columns:var(--layout-side-bar-width) auto;gap:0px;grid-template-areas:"side content" ". content"}.mKVYywd6gr5_u2naW5_u,.jxy4KSYJK23WN2rx2CDS{grid-template-areas:"content side" "content .";grid-template-columns:auto var(--layout-side-bar-width)}',""]),i.locals={"en-layout":"LcdTDTWWkxGZFXQc8XNV","en-layout-header":"CxCt7n1zXeDfFdmgQAme","en-layout-side":"E2socS6t6fugHzd2ATQy","en-layout-main":"k2yu7eCpEzToH_ynBglg","en-layout-footer":"zWuykaXyereS6ELF7SHy","en-layout-header-no-sticky":"O6AnGNbL5r3nPmEFEv73","en-layout-simple-all":"ognI7wqsq0lXqSVkJ0cj","en-layout-content":"r_iQ4e7myBc0DSPRkp2u","en-layout-side-right-all":"Sax5A5AqDPokwTlrUZu5","en-layout-simple-no-footer":"Wz4q5vQzeOw8RbDr0rOF","en-layout-side-right-no-footer":"GkLVEZcHiQyvuSh0RLU5","en-layout-side-full":"rZPYzoPjyQP7sDeJbPjp","en-layout-simple-no-header":"UhPmIL0kNAGv5201kGbo","en-layout-side-right-no-header":"Nkg7pjNAPCenCQZY8gLg","en-layout-side-full-all":"XRYEv9hWhdcl2OHap6fQ","en-layout-side-right-full-all":"SmA7SjLAZLofOenJZAWg","en-layout-side-full-no-header":"UT3CcVcTx9pLwV2GGFGi","en-layout-side-right-full-no-header":"tzvYxycvFA9rcOf26LP7","en-layout-side-full-no-footer":"cFlRZr9kGWMtc0nRYCWE","en-layout-side-right-full-no-footer":"DzmD_4Su8YXCKKIwXjG1","en-layout-only-footer":"sm5xSKZmdrGS3a6b5rcN","en-layout-only-header":"qxhkwYH_Y7uyvMDH8JyZ","en-layout-simple-only-side":"sAEoDcBqMzkziXXvgv8X","en-layout-side-right-only-side":"jxy4KSYJK23WN2rx2CDS","en-layout-side-full-only-side":"wVTitTPpRyG8XfbxJGhy","en-layout-side-right-full-only-side":"mKVYywd6gr5_u2naW5_u"};const l=i},411:(e,r,a)=>{var n,o;e.exports=(n={xcn:()=>t.xcn},o={},a.d(o,n),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,a)=>{var n,o;e.exports=(n={Children:()=>r.Children,Fragment:()=>r.Fragment,createElement:()=>r.createElement,default:()=>r.default,forwardRef:()=>r.forwardRef,isValidElement:()=>r.isValidElement},o={},a.d(o,n),o)},659:e=>{var t={};e.exports=function(e,r){var a=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(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(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 a="";r.supports&&(a+="@supports (".concat(r.supports,") {")),r.media&&(a+="@media ".concat(r.media," {"));var n=void 0!==r.layer;n&&(a+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),a+=r.css,n&&(a+="}"),r.media&&(a+="}"),r.supports&&(a+="}");var o=r.sourceMap;o&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(a,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={id:e,exports:{}};return a[e](r,r.exports,o),r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.nc=void 0;var i={};o.d(i,{wb:()=>W,Ht:()=>Q,zE:()=>R,n5:()=>A,AX:()=>L,PE:()=>W,A1:()=>Q,cZ:()=>R,KL:()=>A,nb:()=>L});var l=o(649),u=o(411),c=o(72),s=o.n(c),d=o(825),y=o.n(d),h=o(659),f=o.n(h),p=o(56),g=o.n(p),m=o(540),v=o.n(m),b=o(113),w=o.n(b),S=o(384),O={};O.styleTagTransform=w(),O.setAttributes=g(),O.insert=f().bind(null,"head"),O.domAPI=y(),O.insertStyleElement=v(),s()(S.A,O);const x=S.A&&S.A.locals?S.A.locals:void 0;var E=["className","children","height","noSticky"];function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},P.apply(null,arguments)}var A=l.default.forwardRef((function(e,t){var r=e.className,a=e.children,n=(e.height,e.noSticky,function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,E));return l.default.createElement("div",P({ref:t,className:(0,u.xcn)(x["en-layout-header"],r)},n,{"data-earthnut-ui":"layout-header"}),a)}));A.displayName="LayoutHeader";var k=["className","width","right","full"];function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},j.apply(null,arguments)}var L=l.default.forwardRef((function(e,t){var r=e.className,a=(e.width,e.right,e.full,function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,k));return l.default.createElement("div",j({className:(0,u.xcn)(x["en-layout-side"],r),ref:t},a,{"data-earthnut-ui":"layout-side-bar"}))}));L.displayName="LayoutSideBar";var N=["className"];function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},D.apply(null,arguments)}var Q=l.default.forwardRef((function(e,t){var r=e.className,a=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,N);return l.default.createElement("main",D({ref:t,className:(0,u.xcn)(x["en-layout-main"],r)},a,{"data-earthnut-ui":"layout-content"}))}));Q.displayName="LayoutContent";var z=["className","height"];function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},T.apply(null,arguments)}var R=l.default.forwardRef((function(e,t){var r=e.className,a=(e.height,function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,z));return l.default.createElement("div",T({ref:t},a,{className:(0,u.xcn)(x["en-layout-footer"],r),"data-earthnut-ui":"layout-footer"}))}));R.displayName="LayoutFooter";var C=o(362);function G(e){return G="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},G(e)}var F=["className","children","style","width","height"];function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},H.apply(null,arguments)}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e,t,r){return(t=function(e){var t=function(e){if("object"!=G(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=G(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==G(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var W=l.forwardRef((function(e,t){var r,a,n,o,i=e.className,c=e.children,s=e.style,d=e.width,y=void 0===d?"100vw":d,h=e.height,f=void 0===h?"100vh":h,p=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,F),g="simple",m="",v=!1,b=!1,w=!1,S=!1,O=150,E="2.8rem",P="2rem",k=!1;l.Children.forEach(c,(function(e){if(l.isValidElement(e))if(v||e.type!==A)if(b||e.type!==L)w||e.type!==Q?w||e.type!==W?S||e.type!==R||(P=e.props.height||P,o=e,S=!0):(n=l.createElement("main",{"data-earthnut-ui":"layout-content",className:(0,u.xcn)(x["en-layout-main"])},e),w=!0):(n=e,w=!0);else{var t=e.props;O=t.width||O,g=t.right&&t.full?"side-right-full":t.right?"side-right":t.full?"side-full":"simple",k=(0,C.isTrue)(t.full),a=e,b=!0}else{var i=e.props;E=i.height||E,m=i.noSticky?x["en-layout-header-no-sticky"]:"",r=e,v=!0}}));var j=v&&b&&w&&S&&x["en-layout-".concat(g,"-all")]||v&&w&&b&&x["en-layout-".concat(g,"-no-footer")]||b&&w&&S&&x["en-layout-".concat(g,"-no-header")]||w&&S&&x["en-layout-only-footer"]||w&&v&&x["en-layout-only-header"]||w&&b&&(k=!0)&&x["en-layout-".concat(g,"-only-side")]||"";return l.createElement("div",H({ref:t,className:(0,u.xcn)(x["en-layout"],k&&x["en-layout-side-full"],j,m,i),style:Z({"--layout-width":q(y),"--layout-height":q(f),"--layout-side-bar-width":q(O),"--layout-header-height":q(E),"--layout-footer-height":q(P)},s)},p,{"data-earthnut-ui":"layout"}),/side.*full/.test(g)?l.createElement(l.Fragment,null,a,r,n,o):l.createElement(l.Fragment,null,r,S?l.createElement("div",{className:(0,u.xcn)(x["en-layout-content"]),"data-earthnut-ui":"layout-with-foot-content"},a,n):l.createElement(l.Fragment,null,a,n),o))}));function q(e){return(0,C.isNumber)(e)||parseInt(e)===Number(e)?e+"px":e||0}W.displayName="Layout";const Y=i.wb,V=i.Ht,I=i.zE,B=i.n5,K=i.AX,U=i.PE,J=i.A1,M=i.cZ,$=i.KL,ee=i.nb;export{Y as EnLayout,V as EnLayoutContent,I as EnLayoutFooter,B as EnLayoutHeader,K as EnLayoutSideBar,U as Layout,J as LayoutContent,M as LayoutFooter,$ as LayoutHeader,ee as LayoutSideBar};
|
package/README.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.scss';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* layout content
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* @param {string} className 布局的类名
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
declare const InternalValueC: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { InternalValueC };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LayoutFooterProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* layout footer
|
|
6
|
+
*
|
|
7
|
+
* 布局底部
|
|
8
|
+
*
|
|
9
|
+
* @param className 自定义类名
|
|
10
|
+
* @param height 自定义高度
|
|
11
|
+
* @param props 其他属性
|
|
12
|
+
* @returns React.ReactElement
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
declare const InternalValueF: React.ForwardRefExoticComponent<LayoutFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export { InternalValueF };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LayoutHeaderProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* layout header
|
|
6
|
+
*
|
|
7
|
+
* 布局头部
|
|
8
|
+
*
|
|
9
|
+
* @param className 自定义类名
|
|
10
|
+
* @param height 高度
|
|
11
|
+
* 缺省值为 2.8rem,当未在 `Layout` 中使用,该值不起作用
|
|
12
|
+
* @param noSticky 是否取消悬挂粘连
|
|
13
|
+
* 缺省值为 false
|
|
14
|
+
* @param props 其他属性
|
|
15
|
+
* @returns React.ReactElement
|
|
16
|
+
*/
|
|
17
|
+
declare const InternalValueH: React.ForwardRefExoticComponent<LayoutHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export { InternalValueH };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Layout, Layout as EnLayout, LayoutContent, LayoutContent as EnLayoutContent, LayoutHeader, LayoutHeader as EnLayoutHeader, LayoutFooter, LayoutFooter as EnLayoutFooter, LayoutSideBar, LayoutSideBar as EnLayoutSideBar, } from './layout';
|
|
2
|
+
export type { LayoutProps, LayoutSideBarProps, LayoutHeaderProps, LayoutFooterProps, } from './types';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { InternalValueH as LayoutHeader } from './header';
|
|
3
|
+
import { InternalValueS as LayoutSideBar } from './sideBar';
|
|
4
|
+
import { InternalValueC as LayoutContent } from './content';
|
|
5
|
+
import { InternalValueF as LayoutFooter } from './footer';
|
|
6
|
+
import { LayoutProps } from './types';
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* ## layout
|
|
10
|
+
*
|
|
11
|
+
* 布局组件,用于构建页面布局。
|
|
12
|
+
*
|
|
13
|
+
* ***为了照顾在 next.js 中的服务端组件中使用,在拥有 `side bar` 时 `Layout` 的 `height` 为百分比时会触发 side bar 滚动***
|
|
14
|
+
*
|
|
15
|
+
* @param {string} className 布局的类名
|
|
16
|
+
* @param {React.CSSProperties} style 布局的样式
|
|
17
|
+
* @param {string | number} width 布局的宽
|
|
18
|
+
* @param {string | number} height 布局的高
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* ```jsx
|
|
22
|
+
* <Layout>
|
|
23
|
+
* <LayoutHeader> 头部 </LayoutHeader>
|
|
24
|
+
* <LayoutSideBar> 侧边栏 </LayoutSideBar>
|
|
25
|
+
* <LayoutContent> 内容区 </LayoutContent>
|
|
26
|
+
* <LayoutFooter> 页脚 </LayoutFooter>
|
|
27
|
+
* </Layout>
|
|
28
|
+
*
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* 该组件仅接受 `LayoutHeader`、`LayoutSideBar`、`LayoutContent` 和 `LayoutFooter` 作为(直接)子组件。
|
|
32
|
+
*
|
|
33
|
+
* 可任意搭配使用,但不推荐使用无 `LayoutContent` 使用。
|
|
34
|
+
*
|
|
35
|
+
* 目前已知当 `Layout` 嵌套 `Layout` 时,需要设定内部 `Layout` 的 `width` 和 `height`。
|
|
36
|
+
*
|
|
37
|
+
* ```jsx
|
|
38
|
+
* <Layout width="100%" height="100%">
|
|
39
|
+
* <Layout width="100%" height="100%">
|
|
40
|
+
* <LayoutSideBar width="150px"> 侧边栏 </LayoutSideBar>
|
|
41
|
+
* <LayoutContent> 内容区 </LayoutContent>
|
|
42
|
+
* </Layout>
|
|
43
|
+
* <LayoutFooter> 页脚 </LayoutFooter>
|
|
44
|
+
* </Layout>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
declare const Layout: React.ForwardRefExoticComponent<LayoutProps & React.RefAttributes<HTMLDivElement>>;
|
|
50
|
+
export { Layout, LayoutHeader, LayoutSideBar, LayoutContent, LayoutFooter };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LayoutSideBarProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* children side bar
|
|
6
|
+
*
|
|
7
|
+
* 侧边栏
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* @param children 子元素
|
|
11
|
+
* @param ref 组件引用
|
|
12
|
+
* @param props 组件属性
|
|
13
|
+
* @param className 自定义类名
|
|
14
|
+
* @param width 侧边栏的宽度
|
|
15
|
+
* 缺省值为 `150px`
|
|
16
|
+
* @param right 是否居右
|
|
17
|
+
* 缺省值为 `false`
|
|
18
|
+
* @param full 是否占用所有空间
|
|
19
|
+
* 缺省值为 `false`
|
|
20
|
+
* @returns `React.ReactElement`;
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
declare const InternalValueS: React.ForwardRefExoticComponent<LayoutSideBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export { InternalValueS };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 布局
|
|
3
|
+
*/
|
|
4
|
+
export interface LayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
classes?: string | string[];
|
|
6
|
+
/** 样式 */
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
/** 布局的 */
|
|
9
|
+
/**
|
|
10
|
+
* 布局的宽
|
|
11
|
+
*
|
|
12
|
+
*
|
|
13
|
+
* 缺省值为 100vw
|
|
14
|
+
*/
|
|
15
|
+
width?: string | number;
|
|
16
|
+
/**
|
|
17
|
+
* 布局可视界面的高
|
|
18
|
+
*
|
|
19
|
+
* 用于限制 side bar 的高度
|
|
20
|
+
*
|
|
21
|
+
* 缺省值为 100vh
|
|
22
|
+
*
|
|
23
|
+
* 为具体值。当为 100% 时 side bar 渲染不正确
|
|
24
|
+
*/
|
|
25
|
+
height?: string | number;
|
|
26
|
+
}
|
|
27
|
+
export interface LayoutSideBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
28
|
+
classes?: string | string[];
|
|
29
|
+
/**
|
|
30
|
+
* 侧边栏的宽度
|
|
31
|
+
*
|
|
32
|
+
* 缺省值为 150
|
|
33
|
+
*/
|
|
34
|
+
width?: number | string;
|
|
35
|
+
/**
|
|
36
|
+
* 是否居右
|
|
37
|
+
*
|
|
38
|
+
* 缺省值为 false
|
|
39
|
+
*/
|
|
40
|
+
right?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 是否占用所有空间
|
|
43
|
+
*
|
|
44
|
+
* 缺省值为 false
|
|
45
|
+
*/
|
|
46
|
+
full?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface LayoutHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
49
|
+
classes?: string | string[];
|
|
50
|
+
/**
|
|
51
|
+
* header 的高度
|
|
52
|
+
*
|
|
53
|
+
* 缺省值为 2.8rem
|
|
54
|
+
*/
|
|
55
|
+
height?: number | string;
|
|
56
|
+
/**
|
|
57
|
+
* 是否取消悬挂粘连
|
|
58
|
+
*
|
|
59
|
+
* 缺省值为 false
|
|
60
|
+
*/
|
|
61
|
+
noSticky?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface LayoutFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
64
|
+
classes?: string | string[];
|
|
65
|
+
/**
|
|
66
|
+
* footer 的高度
|
|
67
|
+
*
|
|
68
|
+
* 缺省值为 2rem
|
|
69
|
+
*/
|
|
70
|
+
height?: number | string;
|
|
71
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|