beautiful-backgrounds 1.1.0 → 2.1.0
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/README.md +108 -76
- package/build/bb.es.js +44 -2990
- package/build/bb.es.js.map +1 -1
- package/build/bb.js +45 -3
- package/build/bb.js.map +1 -1
- package/build/index.d.ts +475 -8
- package/package.json +67 -52
- package/build/src/BeautifulBackground.d.ts +0 -25
- package/build/src/Particle.d.ts +0 -53
- package/build/src/Symbol.d.ts +0 -7
- package/build/src/components/ambientRibbon.d.ts +0 -25
- package/build/src/components/concentricPulse.d.ts +0 -19
- package/build/src/components/digitalRain.d.ts +0 -28
- package/build/src/components/hexagonWave.d.ts +0 -29
- package/build/src/components/liquidLines.d.ts +0 -24
- package/build/src/components/neonRails.d.ts +0 -31
- package/build/src/components/startTrail.d.ts +0 -33
- package/build/src/stories/AmbientRibbon.stories.d.ts +0 -16
- package/build/src/stories/ConcentricPulse.stories.d.ts +0 -15
- package/build/src/stories/DigitalRain.stories.d.ts +0 -13
- package/build/src/stories/HexagonWave.stories.d.ts +0 -19
- package/build/src/stories/LiquidLines.stories.d.ts +0 -17
- package/build/src/stories/NeonRails.stories.d.ts +0 -20
- package/build/src/stories/StartTrail.stories.d.ts +0 -20
- package/build/src/utils/color.d.ts +0 -2
- package/build/src/utils/function.d.ts +0 -1
- package/build/src/utils/lit.d.ts +0 -2
- package/build/src/utils/number.d.ts +0 -2
- package/build/src/utils/object.d.ts +0 -3
- package/build/vite.svg +0 -1
package/build/bb.js
CHANGED
|
@@ -1,8 +1,50 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.bb={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});
|
|
2
|
-
\f\r]`,ge=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_e=/-->/g,ve=/>/g,C=RegExp(`>|${he}(?:([^\\s"'>=/]+)(${he}*=${he}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ye=/'/g,be=/"/g,xe=/^(?:script|style|textarea|title)$/i,w=Symbol.for(`lit-noChange`),T=Symbol.for(`lit-nothing`),Se=new WeakMap,E=S.createTreeWalker(S,129);function Ce(e,t){if(!pe(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return se===void 0?t:se.createHTML(t)}var we=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=ge;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===ge?c[1]===`!--`?o=_e:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=C):(xe.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=C):o=ve:o===C?c[0]===`>`?(o=i??ge,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?C:c[3]===`"`?be:ye):o===be||o===ye?o=C:o===_e||o===ve?o=ge:(o=C,i=void 0);let d=o===C&&e[t+1].startsWith(`/>`)?` `:``;a+=o===ge?n+ue:l>=0?(r.push(s),n.slice(0,l)+ce+n.slice(l)+x+d):n+x+(l===-2?t:d)}return[Ce(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},Te=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=we(t,n);if(this.el=e.createElement(l,r),E.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=E.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(ce)){let t=u[o++],n=i.getAttribute(e).split(x),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?ke:r[1]===`?`?Ae:r[1]===`@`?je:Oe}),i.removeAttribute(e)}else e.startsWith(x)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(xe.test(i.tagName)){let e=i.textContent.split(x),t=e.length-1;if(t>0){i.textContent=oe?oe.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],de()),E.nextNode(),c.push({type:2,index:++a});i.append(e[t],de())}}}else if(i.nodeType===8){if(i.data===le)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(x,e+1))!==-1;)c.push({type:7,index:a}),e+=x.length-1}}a++}}static createElement(e,t){let n=S.createElement(`template`);return n.innerHTML=e,n}};function D(e,t,n=e,r){if(t===w)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=fe(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=D(e,i._$AS(e,t.values),i,r)),t}var Ee=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??S).importNode(t,!0);E.currentNode=r;let i=E.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new De(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Me(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=E.nextNode(),a++)}return E.currentNode=S,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},De=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=D(this,e,t),fe(e)?e===T||e==null||e===``?(this._$AH!==T&&this._$AR(),this._$AH=T):e!==this._$AH&&e!==w&&this._(e):e._$litType$===void 0?e.nodeType===void 0?me(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==T&&fe(this._$AH)?this._$AA.nextSibling.data=e:this.T(S.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=Te.createElement(Ce(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Ee(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=Se.get(e.strings);return t===void 0&&Se.set(e.strings,t=new Te(e)),t}k(t){pe(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(de()),this.O(de()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=ae(e).nextSibling;ae(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Oe=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=T,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=T}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=D(this,e,t,0),a=!fe(e)||e!==this._$AH&&e!==w,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=D(this,r[n+o],t,o),s===w&&(s=this._$AH[o]),a||=!fe(s)||s!==this._$AH[o],s===T?e=T:e!==T&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},ke=class extends Oe{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===T?void 0:e}},Ae=class extends Oe{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==T)}},je=class extends Oe{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=D(this,e,t,0)??T)===w)return;let n=this._$AH,r=e===T&&n!==T||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==T&&(n===T||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Me=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){D(this,e)}},Ne=ie.litHtmlPolyfillSupport;Ne?.(Te,De),(ie.litHtmlVersions??=[]).push(`3.3.3`);var Pe=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new De(t.insertBefore(de(),e),e,void 0,n??{})}return i._$AI(e),i},Fe=globalThis,Ie=class extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Pe(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return w}};Ie._$litElement$=!0,Ie.finalized=!0,Fe.litElementHydrateSupport?.({LitElement:Ie});var Le=Fe.litElementPolyfillSupport;Le?.({LitElement:Ie}),(Fe.litElementVersions??=[]).push(`4.2.2`);var O=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},Re={attribute:!0,type:String,converter:te,reflect:!1,hasChanged:ne},ze=(e=Re,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function k(e){return(t,n)=>typeof n==`object`?ze(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function Be(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}var A={fromAttribute:e=>e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[],toAttribute:e=>e.join(`,`)};function j(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var M=class extends Ie{constructor(){super(),this.bgColors=[`#000`,`#000`],this.bgAngle=0,this.backgroundColor=`0, 0, 0`,this.width=0,this.height=0,this.animationFrameId=null,this.trailOpacity=.1,this.handleVisibilityChange=()=>{document.visibilityState===`hidden`?this.stopAnimation():this.startAnimation()},this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),this.debouncedResize=Be(this.resizeCanvas.bind(this),100)}firstUpdated(){this.shadowRoot||this.attachShadow({mode:`open`}),this.shadowRoot.appendChild(this.canvas),this.resizeCanvas(),this.initialize(),this.startAnimation(),window.addEventListener(`resize`,this.debouncedResize),document.addEventListener(`visibilitychange`,this.handleVisibilityChange)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`resize`,this.debouncedResize),document.removeEventListener(`visibilitychange`,this.handleVisibilityChange),this.stopAnimation()}drawBackground(e){let t=this.bgAngle*Math.PI/180,n=(Math.abs(this.width*Math.cos(t))+Math.abs(this.height*Math.sin(t)))/2,r=this.width/2,i=this.height/2,a=r-Math.cos(t)*n,o=i-Math.sin(t)*n,s=r+Math.cos(t)*n,c=i+Math.sin(t)*n,l=e.createLinearGradient(a,o,s,c),u=this.bgColors.length>0?this.bgColors:[`#000`,`#000`];try{u.forEach((e,t)=>{let n=t/(u.length-1||1);l.addColorStop(n,e)})}catch{l.addColorStop(0,`#000`),l.addColorStop(1,`#000`)}e.fillStyle=l,e.fillRect(0,0,this.width,this.height)}resizeCanvas(){let e=this.getBoundingClientRect(),t=window.devicePixelRatio||1;(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this.canvas.width=Math.floor(this.width*t),this.canvas.height=Math.floor(this.height*t),this.canvas.style.width=`${this.width}px`,this.canvas.style.height=`${this.height}px`,this.canvas.style.borderRadius=`inherit`,this.ctx.scale(t,t),this.drawBackground(this.ctx))}initialize(){}startAnimation(){if(this.animationFrameId!==null)return;let e=performance.now(),t=n=>{let r=(n-e)/1e3;e=n,this.loop(r),this.animationFrameId=requestAnimationFrame(t)};this.animationFrameId=requestAnimationFrame(t)}stopAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}static{this.styles=s`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.bb={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2019 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
let t=globalThis,n=t.ShadowRoot&&(t.ShadyCSS===void 0||t.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,r=Symbol(),i=/* @__PURE__ */ new WeakMap;var a=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(n&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=i.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&i.set(t,e))}return e}toString(){return this.cssText}};let o=e=>new a(typeof e==`string`?e:e+``,void 0,r),s=(e,...t)=>new a(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,r),c=(e,r)=>{if(n)e.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of r){let r=document.createElement(`style`),i=t.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=n.cssText,e.appendChild(r)}},l=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return o(t)})(e):e,{is:u,defineProperty:d,getOwnPropertyDescriptor:f,getOwnPropertyNames:p,getOwnPropertySymbols:ee,getPrototypeOf:m}=Object,h=globalThis,te=h.trustedTypes,ne=te?te.emptyScript:``,re=h.reactiveElementPolyfillSupport,g=(e,t)=>e,_={toAttribute(e,t){
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2017 Google LLC
|
|
11
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
+
*/
|
|
13
|
+
switch(t){case Boolean:e=e?ne:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},ie=(e,t)=>!u(e,t),ae={attribute:!0,type:String,converter:_,reflect:!1,useDefault:!1,hasChanged:ie};Symbol.metadata??=Symbol(`metadata`),h.litPropertyMetadata??=/* @__PURE__ */ new WeakMap;var v=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ae){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&d(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=f(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ae}static _$Ei(){if(this.hasOwnProperty(g(`elementProperties`)))return;let e=m(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(g(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g(`properties`))){let e=this.properties,t=[...p(e),...ee(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=/* @__PURE__ */ new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(l(e))}else e!==void 0&&t.push(l(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=/* @__PURE__ */ new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=/* @__PURE__ */ new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=/* @__PURE__ */ new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return c(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?_:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?_:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??ie)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=/* @__PURE__ */ new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=/* @__PURE__ */ new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=/* @__PURE__ */ new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};v.elementStyles=[],v.shadowRootOptions={mode:`open`},v[g(`elementProperties`)]=/* @__PURE__ */ new Map,v[g(`finalized`)]=/* @__PURE__ */ new Map,re?.({ReactiveElement:v}),(h.reactiveElementVersions??=[]).push(`2.1.2`);
|
|
14
|
+
/**
|
|
15
|
+
* @license
|
|
16
|
+
* Copyright 2017 Google LLC
|
|
17
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
|
+
*/
|
|
19
|
+
let oe=globalThis,se=e=>e,y=oe.trustedTypes,ce=y?y.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,le=`$lit$`,b=`lit$${Math.random().toFixed(9).slice(2)}$`,ue=`?`+b,de=`<${ue}>`,x=document,S=()=>x.createComment(``),C=e=>e===null||typeof e!=`object`&&typeof e!=`function`,fe=Array.isArray,pe=e=>fe(e)||typeof e?.[Symbol.iterator]==`function`,me=`[
|
|
20
|
+
\f\r]`,w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,he=/-->/g,ge=/>/g,T=RegExp(`>|${me}(?:([^\\s"'>=/]+)(${me}*=${me}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),_e=/'/g,ve=/"/g,ye=/^(?:script|style|textarea|title)$/i,E=Symbol.for(`lit-noChange`),D=Symbol.for(`lit-nothing`),be=/* @__PURE__ */ new WeakMap,O=x.createTreeWalker(x,129);function xe(e,t){if(!fe(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return ce===void 0?t:ce.createHTML(t)}let Se=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=w;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===w?c[1]===`!--`?o=he:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=T):(ye.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=T):o=ge:o===T?c[0]===`>`?(o=i??w,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?T:c[3]===`"`?ve:_e):o===ve||o===_e?o=T:o===he||o===ge?o=w:(o=T,i=void 0);let d=o===T&&e[t+1].startsWith(`/>`)?` `:``;a+=o===w?n+de:l>=0?(r.push(s),n.slice(0,l)+le+n.slice(l)+b+d):n+b+(l===-2?t:d)}return[xe(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]};var Ce=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=Se(t,n);if(this.el=e.createElement(l,r),O.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=O.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(le)){let t=u[o++],n=i.getAttribute(e).split(b),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Ee:r[1]===`?`?De:r[1]===`@`?Oe:A}),i.removeAttribute(e)}else e.startsWith(b)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(ye.test(i.tagName)){let e=i.textContent.split(b),t=e.length-1;if(t>0){i.textContent=y?y.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],S()),O.nextNode(),c.push({type:2,index:++a});i.append(e[t],S())}}}else if(i.nodeType===8){if(i.data===ue)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(b,e+1))!==-1;)c.push({type:7,index:a}),e+=b.length-1}}a++}}static createElement(e,t){let n=x.createElement(`template`);return n.innerHTML=e,n}};function k(e,t,n=e,r){if(t===E)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=C(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=k(e,i._$AS(e,t.values),i,r)),t}var we=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??x).importNode(t,!0);O.currentNode=r;let i=O.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new Te(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new ke(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=O.nextNode(),a++)}return O.currentNode=x,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},Te=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=k(this,e,t),C(e)?e===D||e==null||e===``?(this._$AH!==D&&this._$AR(),this._$AH=D):e!==this._$AH&&e!==E&&this._(e):e._$litType$===void 0?e.nodeType===void 0?pe(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==D&&C(this._$AH)?this._$AA.nextSibling.data=e:this.T(x.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=Ce.createElement(xe(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new we(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=be.get(e.strings);return t===void 0&&be.set(e.strings,t=new Ce(e)),t}k(t){fe(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(S()),this.O(S()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=se(e).nextSibling;se(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},A=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=D,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(/* @__PURE__ */ new String),this.strings=n):this._$AH=D}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=k(this,e,t,0),a=!C(e)||e!==this._$AH&&e!==E,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=k(this,r[n+o],t,o),s===E&&(s=this._$AH[o]),a||=!C(s)||s!==this._$AH[o],s===D?e=D:e!==D&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Ee=class extends A{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===D?void 0:e}},De=class extends A{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==D)}},Oe=class extends A{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=k(this,e,t,0)??D)===E)return;let n=this._$AH,r=e===D&&n!==D||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==D&&(n===D||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ke=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){k(this,e)}};let Ae=oe.litHtmlPolyfillSupport;Ae?.(Ce,Te),(oe.litHtmlVersions??=[]).push(`3.3.3`);let je=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new Te(t.insertBefore(S(),e),e,void 0,n??{})}return i._$AI(e),i},Me=globalThis
|
|
21
|
+
/**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2017 Google LLC
|
|
24
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
+
*/
|
|
26
|
+
;var j=class extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=je(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return E}};j._$litElement$=!0,j.finalized=!0,Me.litElementHydrateSupport?.({LitElement:j});let Ne=Me.litElementPolyfillSupport;Ne?.({LitElement:j}),(Me.litElementVersions??=[]).push(`4.2.2`);
|
|
27
|
+
/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright 2017 Google LLC
|
|
30
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
+
*/
|
|
32
|
+
let M=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},Pe={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:ie},Fe=(e=Pe,t,n)=>{
|
|
33
|
+
/**
|
|
34
|
+
* @license
|
|
35
|
+
* Copyright 2017 Google LLC
|
|
36
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
+
*/
|
|
38
|
+
let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=/* @__PURE__ */ new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function N(e){return(t,n)=>typeof n==`object`?Fe(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}
|
|
39
|
+
/**
|
|
40
|
+
* @license
|
|
41
|
+
* Copyright 2017 Google LLC
|
|
42
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
+
*/
|
|
44
|
+
function Ie(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}let P={fromAttribute:e=>e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[],toAttribute:e=>e.join(`,`)};function F(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var I=class extends j{constructor(){super(),this.bgColors=[`#000`,`#000`],this.bgAngle=0,this.backgroundColor=`0, 0, 0`,this.width=0,this.height=0,this.animationFrameId=null,this.trailOpacity=.1,this.cleanTrail=!0,this.fadeMasks=[],this.fadeTurn=0,this.handleVisibilityChange=()=>{document.visibilityState===`hidden`?this.stopAnimation():this.startAnimation()},this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),this.debouncedResize=Ie(this.resizeCanvas.bind(this),100)}firstUpdated(){this.shadowRoot.appendChild(this.canvas),this.resizeCanvas(),this.initialize(),this.startAnimation(),window.addEventListener(`resize`,this.debouncedResize),document.addEventListener(`visibilitychange`,this.handleVisibilityChange)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`resize`,this.debouncedResize),document.removeEventListener(`visibilitychange`,this.handleVisibilityChange),this.stopAnimation()}updated(e){super.updated(e),this.canvas.style.background=this.cleanTrail?this.cssBackground():``}drawBackground(e){this.cleanTrail?e.clearRect(0,0,this.width,this.height):(e.fillStyle=this.backgroundGradient(e),e.fillRect(0,0,this.width,this.height))}fadeTrail(){this.cleanTrail?this.fadeTrailCleanly():(this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1)}fadeTrailCleanly(){if(this.trailOpacity<=0)return;let e=Math.max(this.trailOpacity,.1),t=Math.round(e/this.trailOpacity);this.fadeMasks.length!==t&&(this.fadeMasks=Le(this.ctx,t));let n=this.ctx;n.save(),n.globalCompositeOperation=`destination-out`,n.globalAlpha=Math.min(1,e),n.fillStyle=this.fadeMasks[this.fadeTurn++%t],n.fillRect(0,0,this.width,this.height),n.restore()}cssBackground(){let e=this.bgColors.length>0?this.bgColors:[`#000`];return e.length===1?e[0]:`linear-gradient(${this.bgAngle+90}deg, ${e.join(`, `)})`}backgroundGradient(e){let t=this.bgAngle*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=(Math.abs(this.width*n)+Math.abs(this.height*r))/2,a=this.width/2,o=this.height/2,s=e.createLinearGradient(a-n*i,o-r*i,a+n*i,o+r*i),c=this.bgColors.length>0?this.bgColors:[`#000`,`#000`];try{c.forEach((e,t)=>{s.addColorStop(t/(c.length-1||1),e)})}catch{s.addColorStop(0,`#000`),s.addColorStop(1,`#000`)}return s}resizeCanvas(){let e=this.getBoundingClientRect(),t=window.devicePixelRatio||1;(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this.canvas.width=Math.floor(this.width*t),this.canvas.height=Math.floor(this.height*t),this.canvas.style.width=`${this.width}px`,this.canvas.style.height=`${this.height}px`,this.canvas.style.borderRadius=`inherit`,this.ctx.scale(t,t),this.drawBackground(this.ctx))}initialize(){}startAnimation(){if(this.animationFrameId!==null)return;let e=performance.now(),t=n=>{let r=Math.max(0,n-e)/1e3;e=n,this.loop(r),this.animationFrameId=requestAnimationFrame(t)};this.animationFrameId=requestAnimationFrame(t)}stopAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}static{this.styles=s`
|
|
3
45
|
:host {
|
|
4
46
|
border-radius: inherit;
|
|
5
47
|
display: flex;
|
|
6
48
|
}
|
|
7
|
-
`}render(){}};j([k({type:Array,attribute:`bg-colors`,converter:A})],M.prototype,`bgColors`,void 0),j([k({type:Number,attribute:`bg-angle`})],M.prototype,`bgAngle`,void 0),j([k({type:String,attribute:`background-color`})],M.prototype,`backgroundColor`,void 0),j([k({type:Number,attribute:`trail-opacity`})],M.prototype,`trailOpacity`,void 0);function N(e,t){return Math.random()*(t-e)+e}function Ve(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}function He(e=[0,360],t=[0,100],n=[40,60]){return`hsl(${Ve(e[0],e[1])}, ${Ve(t[0],t[1])}%, ${Ve(n[0],n[1])}%)`}function Ue(e,t,n,r){return`hsla(${e}, ${t}%, ${n}%, ${r})`}var We=class{constructor(e,t){this.angle=e,this.color=t}},Ge=class{constructor(e,t){this.speed=[],this.lines=[],this.angle=[N(0,Math.PI*2),N(0,Math.PI*2),N(0,Math.PI*2),N(0,Math.PI*2)];let n=()=>Math.random()>.5?1:-1;this.speedSeeds=[Math.random(),Math.random(),Math.random(),Math.random()],this.speedSigns=[n(),n(),n(),n()],this.updateSpeeds(e,t)}updateSpeeds(e,t){this.speed=this.speedSeeds.map((n,r)=>this.speedSigns[r]*(e+n*(t-e)))}update(e){this.angle[0]+=this.speed[0],this.angle[1]+=this.speed[1],this.angle[2]+=this.speed[2],this.angle[3]+=this.speed[3];let t=[Math.sin(this.angle[0]),Math.sin(this.angle[1]),Math.sin(this.angle[2]),Math.sin(this.angle[3])];this.lines.push(new We(t,``)),this.lines.length>e&&this.lines.shift()}},P=class extends M{constructor(...e){super(...e),this.ribbonCount=5,this.ribbonWidth=100,this.ribbonRotation=45,this.ribbonHueStart=11,this.ribbonHueEnd=14,this.ribbonSaturationStart=100,this.ribbonSaturationEnd=100,this.ribbonLightnessStart=50,this.ribbonLightnessEnd=50,this.ribbonAmplitude=.5,this.ribbonSpeedMin=.004,this.ribbonSpeedMax=.008,this.ribbonLineWidth=2,this.ribbonLineOpacity=.2,this.ribbons=[],this.hue=11,this.hueForward=!0}initialize(){this.hue=this.ribbonHueStart,this.ribbons=[];for(let e=0;e<this.ribbonCount;e++)this.ribbons.push(new Ge(this.ribbonSpeedMin,this.ribbonSpeedMax));for(let e=0;e<this.ribbonCount;e++)for(let t=0;t<this.ribbonWidth;t++)this.updateColor(),this.ribbons[e].update(this.ribbonWidth)}updated(e){super.updated(e),(e.has(`ribbonSpeedMin`)||e.has(`ribbonSpeedMax`))&&this.ribbons.forEach(e=>e.updateSpeeds(this.ribbonSpeedMin,this.ribbonSpeedMax)),e.has(`ribbonCount`)&&this.initialize(),e.has(`ribbonWidth`)&&this.ribbons.forEach(e=>{e.lines.length>this.ribbonWidth&&(e.lines=e.lines.slice(-this.ribbonWidth))})}updateColor(){this.hue+=this.hueForward?.05:-.05,this.hue>this.ribbonHueEnd&&this.hueForward?(this.hue=this.ribbonHueEnd,this.hueForward=!1):this.hue<this.ribbonHueStart&&!this.hueForward&&(this.hue=this.ribbonHueStart,this.hueForward=!0)}loop(){this.updateColor(),this.ctx.clearRect(0,0,this.width,this.height),this.drawBackground(this.ctx);let e=Math.sqrt(this.width**2+this.height**2),t=this.width/2,n=this.height/2,r=e/2,i=r/3,a=this.ribbonRotation*Math.PI/180;this.ctx.lineWidth=this.ribbonLineWidth,this.ribbons.forEach(e=>{e.update(this.ribbonWidth),e.lines.forEach((o,s)=>{let c=o.angle,l=t-r*Math.cos(c[0]*this.ribbonAmplitude+a),u=n-r*Math.sin(c[0]*this.ribbonAmplitude+a),d=t+r*Math.cos(c[3]*this.ribbonAmplitude+a),f=n+r*Math.sin(c[3]*this.ribbonAmplitude+a),p=t-i*Math.cos(c[1]*this.ribbonAmplitude*2),m=n-i*Math.sin(c[1]*this.ribbonAmplitude*2),h=t+i*Math.cos(c[2]*this.ribbonAmplitude*2),g=n+i*Math.sin(c[2]*this.ribbonAmplitude*2),_=s/(e.lines.length-1||1),v=this.ribbonHueEnd+(this.ribbonHueStart-this.ribbonHueEnd)*_,ee=this.ribbonSaturationEnd+(this.ribbonSaturationStart-this.ribbonSaturationEnd)*_,y=this.ribbonLightnessEnd+(this.ribbonLightnessStart-this.ribbonLightnessEnd)*_;this.ctx.strokeStyle=Ue(v,ee,y,this.ribbonLineOpacity),this.ctx.beginPath(),this.ctx.moveTo(l,u),this.ctx.bezierCurveTo(p,m,h,g,d,f),this.ctx.stroke()})})}};j([k({type:Number,attribute:`ribbon-count`})],P.prototype,`ribbonCount`,void 0),j([k({type:Number,attribute:`ribbon-width`})],P.prototype,`ribbonWidth`,void 0),j([k({type:Number,attribute:`ribbon-rotation`})],P.prototype,`ribbonRotation`,void 0),j([k({type:Number,attribute:`ribbon-hue-start`})],P.prototype,`ribbonHueStart`,void 0),j([k({type:Number,attribute:`ribbon-hue-end`})],P.prototype,`ribbonHueEnd`,void 0),j([k({type:Number,attribute:`ribbon-saturation-start`})],P.prototype,`ribbonSaturationStart`,void 0),j([k({type:Number,attribute:`ribbon-saturation-end`})],P.prototype,`ribbonSaturationEnd`,void 0),j([k({type:Number,attribute:`ribbon-lightness-start`})],P.prototype,`ribbonLightnessStart`,void 0),j([k({type:Number,attribute:`ribbon-lightness-end`})],P.prototype,`ribbonLightnessEnd`,void 0),j([k({type:Number,attribute:`ribbon-amplitude`})],P.prototype,`ribbonAmplitude`,void 0),j([k({type:Number,attribute:`ribbon-speed-min`})],P.prototype,`ribbonSpeedMin`,void 0),j([k({type:Number,attribute:`ribbon-speed-max`})],P.prototype,`ribbonSpeedMax`,void 0),j([k({type:Number,attribute:`ribbon-line-width`})],P.prototype,`ribbonLineWidth`,void 0),j([k({type:Number,attribute:`ribbon-line-opacity`})],P.prototype,`ribbonLineOpacity`,void 0),P=j([O(`bb-ambient-ribbon`)],P);var F=class extends M{constructor(...e){super(...e),this.ringCount=20,this.pulseSpeed=.5,this.ringColors=[`#78c8ff`,`#0064ff`],this.ringAmplitude=15,this.ringSpacing=40}firstUpdated(){super.firstUpdated()}disconnectedCallback(){super.disconnectedCallback()}parseRGB(e){let t=e.startsWith(`#`)?e.slice(1):e;return t.includes(`,`)?t.split(`,`).map(e=>parseInt(e.trim())):[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]}lerpColor(e,t,n){return`${Math.round(e[0]+(t[0]-e[0])*n)}, ${Math.round(e[1]+(t[1]-e[1])*n)}, ${Math.round(e[2]+(t[2]-e[2])*n)}`}loop(){let e=performance.now();this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1;let t=e*.001,n=this.width/2,r=this.height/2;for(let e=0;e<this.ringCount;e++){let i=t*2*this.pulseSpeed,a=50+e*this.ringSpacing+Math.sin(i+e*.4)*this.ringAmplitude,o=.08+e/this.ringCount*.15,s=(e/(this.ringCount-1||1)+t*.2)%1,c=this.ringColors.length,l=1/(c-1||1),u=Math.min(Math.floor(s/l),c-2),d=(s-u*l)/l,f=this.parseRGB(this.ringColors[u]),p=this.parseRGB(this.ringColors[u+1]||this.ringColors[u]),m=this.lerpColor(f,p,d);this.drawCircle(n,r,a,m,o,1.2)}}drawCircle(e,t,n,r,i,a=1.5){n<0||(this.ctx.beginPath(),this.ctx.arc(e,t,n,0,Math.PI*2),this.ctx.strokeStyle=`rgba(${r}, ${i})`,this.ctx.lineWidth=a,this.ctx.stroke())}};j([k({type:Number,attribute:`ring-count`})],F.prototype,`ringCount`,void 0),j([k({type:Number,attribute:`pulse-speed`})],F.prototype,`pulseSpeed`,void 0),j([k({type:Array,attribute:`ring-colors`,converter:A})],F.prototype,`ringColors`,void 0),j([k({type:Number,attribute:`ring-amplitude`})],F.prototype,`ringAmplitude`,void 0),j([k({type:Number,attribute:`ring-spacing`})],F.prototype,`ringSpacing`,void 0),F=j([O(`bb-concentric-pulse`)],F);var Ke=class{constructor(e,t){this.x=e,this.y=t}update(e,t,n,r,i,a=30){let o=i/a;this.y*n*o>e&&Math.random()>t?this.y=0:this.y+=i*r}draw(e,t,n,r,i,a=30){let o=i/a;e.fillStyle=n,e.fillText(t,this.x*r,this.y*r*o)}},I=class extends M{constructor(){super(),this.speed=10,this.characters=`ヲアウエオカキケコサシスセソタツテナニヌネハヒホマミムメモヤユラリワ`,this.randomness=.975,this.fontSize=24,this.fontColorHueStart=60,this.fontColorHueEnd=150,this.fontColorSaturationStart=90,this.fontColorSaturationEnd=100,this.fontColorLightnessStart=50,this.fontColorLightnessEnd=50,this.fontColors=[],this.columns=0,this.symbols=[],this.fontColorHueEnd=this.fontColorHueStart+90}initialize(){this.symbols=[],this.createSymbols(),this.drawBackground(this.ctx)}createSymbols(){this.columns=Math.floor(this.width/this.fontSize);for(let e=0;e<this.columns;e++)this.symbols[e]=this.createSymbol(e)}updateSymbols(){let e=Math.floor(this.width/this.fontSize);for(let t=this.symbols.length;t<e;t++)this.symbols[t]=this.createSymbol(t);this.symbols.length>e&&(this.symbols.length=e)}loop(e){this.updateSymbols(),this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1,this.ctx.textAlign=`center`,this.ctx.font=`${this.fontSize}px monospace`,this.symbols.forEach(t=>{t.draw(this.ctx,this.characters.charAt(Math.floor(Math.random()*this.characters.length)),this.fontColors&&this.fontColors.length>0?this.fontColors[Math.floor(Math.random()*this.fontColors.length)]:He([this.fontColorHueStart,this.fontColorHueEnd],[this.fontColorSaturationStart,this.fontColorSaturationEnd],[this.fontColorLightnessStart,this.fontColorLightnessEnd]),this.fontSize,this.speed*3),t.update(this.height,this.randomness,this.fontSize,e,this.speed*3)})}createSymbol(e){return new Ke(e,Ve(0,-this.height/this.fontSize))}};j([k({type:Number,attribute:`speed`})],I.prototype,`speed`,void 0),j([k({type:String,attribute:`characters`})],I.prototype,`characters`,void 0),j([k({type:Number,attribute:`randomness`})],I.prototype,`randomness`,void 0),j([k({type:Number,attribute:`font-size`})],I.prototype,`fontSize`,void 0),j([k({type:Number,attribute:`font-color-hue-start`})],I.prototype,`fontColorHueStart`,void 0),j([k({type:Number,attribute:`font-color-hue-end`})],I.prototype,`fontColorHueEnd`,void 0),j([k({type:Number,attribute:`font-color-saturation-start`})],I.prototype,`fontColorSaturationStart`,void 0),j([k({type:Number,attribute:`font-color-saturation-end`})],I.prototype,`fontColorSaturationEnd`,void 0),j([k({type:Number,attribute:`font-color-lightness-start`})],I.prototype,`fontColorLightnessStart`,void 0),j([k({type:Number,attribute:`font-color-lightness-end`})],I.prototype,`fontColorLightnessEnd`,void 0),j([k({type:Array,attribute:`font-colors`,converter:A})],I.prototype,`fontColors`,void 0),I=j([O(`bb-digital-rain`)],I);var qe={value:()=>{}};function Je(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Ye(n)}function Ye(e){this._=e}function Xe(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Ye.prototype=Je.prototype={constructor:Ye,on:function(e,t){var n=this._,r=Xe(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Ze(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Qe(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Qe(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ye(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Ze(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Qe(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=qe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var $e={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function et(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),$e.hasOwnProperty(t)?{space:$e[t],local:e}:e}function tt(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function nt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function rt(e){var t=et(e);return(t.local?nt:tt)(t)}function it(){}function at(e){return e==null?it:function(){return this.querySelector(e)}}function ot(e){typeof e!=`function`&&(e=at(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new R(r,this._parents)}function st(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ct(){return[]}function lt(e){return e==null?ct:function(){return this.querySelectorAll(e)}}function ut(e){return function(){return st(e.apply(this,arguments))}}function dt(e){e=typeof e==`function`?ut(e):lt(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new R(r,i)}function ft(e){return function(){return this.matches(e)}}function pt(e){return function(t){return t.matches(e)}}var mt=Array.prototype.find;function ht(e){return function(){return mt.call(this.children,e)}}function gt(){return this.firstElementChild}function _t(e){return this.select(e==null?gt:ht(typeof e==`function`?e:pt(e)))}var vt=Array.prototype.filter;function yt(){return Array.from(this.children)}function bt(e){return function(){return vt.call(this.children,e)}}function xt(e){return this.selectAll(e==null?yt:bt(typeof e==`function`?e:pt(e)))}function St(e){typeof e!=`function`&&(e=ft(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new R(r,this._parents)}function Ct(e){return Array(e.length)}function wt(){return new R(this._enter||this._groups.map(Ct),this._parents)}function Tt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tt.prototype={constructor:Tt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Et(e){return function(){return e}}function Dt(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new Tt(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Ot(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new Tt(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function kt(e){return e.__data__}function At(e,t){if(!arguments.length)return Array.from(this,kt);var n=t?Ot:Dt,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Et(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=jt(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,ee,y;_<m;++_)if(ee=h[_]){for(_>=v&&(v=_+1);!(y=g[v])&&++v<m;);ee._next=y||null}}return o=new R(o,r),o._enter=s,o._exit=c,o}function jt(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Mt(){return new R(this._exit||this._groups.map(Ct),this._parents)}function Nt(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Pt(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new R(s,this._parents)}function Ft(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function It(e){e||=Lt;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new R(i,this._parents).order()}function Lt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Rt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zt(){return Array.from(this)}function Bt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Vt(){let e=0;for(let t of this)++e;return e}function Ht(){return!this.node()}function Ut(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Wt(e){return function(){this.removeAttribute(e)}}function Gt(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Kt(e,t){return function(){this.setAttribute(e,t)}}function qt(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Jt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Yt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Xt(e,t){var n=et(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Gt:Wt:typeof t==`function`?n.local?Yt:Jt:n.local?qt:Kt)(n,t))}function Zt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Qt(e){return function(){this.style.removeProperty(e)}}function $t(e,t,n){return function(){this.style.setProperty(e,t,n)}}function en(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function tn(e,t,n){return arguments.length>1?this.each((t==null?Qt:typeof t==`function`?en:$t)(e,t,n??``)):L(this.node(),e)}function L(e,t){return e.style.getPropertyValue(t)||Zt(e).getComputedStyle(e,null).getPropertyValue(t)}function nn(e){return function(){delete this[e]}}function rn(e,t){return function(){this[e]=t}}function an(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function on(e,t){return arguments.length>1?this.each((t==null?nn:typeof t==`function`?an:rn)(e,t)):this.node()[e]}function sn(e){return e.trim().split(/^|\s+/)}function cn(e){return e.classList||new ln(e)}function ln(e){this._node=e,this._names=sn(e.getAttribute(`class`)||``)}ln.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function un(e,t){for(var n=cn(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function dn(e,t){for(var n=cn(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function fn(e){return function(){un(this,e)}}function pn(e){return function(){dn(this,e)}}function mn(e,t){return function(){(t.apply(this,arguments)?un:dn)(this,e)}}function hn(e,t){var n=sn(e+``);if(arguments.length<2){for(var r=cn(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?mn:t?fn:pn)(n,t))}function gn(){this.textContent=``}function _n(e){return function(){this.textContent=e}}function vn(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function yn(e){return arguments.length?this.each(e==null?gn:(typeof e==`function`?vn:_n)(e)):this.node().textContent}function bn(){this.innerHTML=``}function xn(e){return function(){this.innerHTML=e}}function Sn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Cn(e){return arguments.length?this.each(e==null?bn:(typeof e==`function`?Sn:xn)(e)):this.node().innerHTML}function wn(){this.nextSibling&&this.parentNode.appendChild(this)}function Tn(){return this.each(wn)}function En(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Dn(){return this.each(En)}function On(e){var t=typeof e==`function`?e:rt(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function kn(){return null}function An(e,t){var n=typeof e==`function`?e:rt(e),r=t==null?kn:typeof t==`function`?t:at(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function jn(){var e=this.parentNode;e&&e.removeChild(this)}function Mn(){return this.each(jn)}function Nn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Fn(e){return this.select(e?Pn:Nn)}function In(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Ln(e){return function(t){e.call(this,t,this.__data__)}}function Rn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function zn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Bn(e,t,n){return function(){var r=this.__on,i,a=Ln(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Vn(e,t,n){var r=Rn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?Bn:zn,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function Hn(e,t,n){var r=Zt(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Un(e,t){return function(){return Hn(this,e,t)}}function Wn(e,t){return function(){return Hn(this,e,t.apply(this,arguments))}}function Gn(e,t){return this.each((typeof t==`function`?Wn:Un)(e,t))}function*Kn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var qn=[null];function R(e,t){this._groups=e,this._parents=t}function Jn(){return new R([[document.documentElement]],qn)}function Yn(){return this}R.prototype=Jn.prototype={constructor:R,select:ot,selectAll:dt,selectChild:_t,selectChildren:xt,filter:St,data:At,enter:wt,exit:Mt,join:Nt,merge:Pt,selection:Yn,order:Ft,sort:It,call:Rt,nodes:zt,node:Bt,size:Vt,empty:Ht,each:Ut,attr:Xt,style:tn,property:on,classed:hn,text:yn,html:Cn,raise:Tn,lower:Dn,append:On,insert:An,remove:Mn,clone:Fn,datum:In,on:Vn,dispatch:Gn,[Symbol.iterator]:Kn};function Xn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Zn(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Qn(){}var $n=.7,er=1/$n,z=`\\s*([+-]?\\d+)\\s*`,tr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,B=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,nr=/^#([0-9a-f]{3,8})$/,rr=RegExp(`^rgb\\(${z},${z},${z}\\)$`),ir=RegExp(`^rgb\\(${B},${B},${B}\\)$`),ar=RegExp(`^rgba\\(${z},${z},${z},${tr}\\)$`),or=RegExp(`^rgba\\(${B},${B},${B},${tr}\\)$`),sr=RegExp(`^hsl\\(${tr},${B},${B}\\)$`),cr=RegExp(`^hsla\\(${tr},${B},${B},${tr}\\)$`),lr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Xn(Qn,mr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ur,formatHex:ur,formatHex8:dr,formatHsl:fr,formatRgb:pr,toString:pr});function ur(){return this.rgb().formatHex()}function dr(){return this.rgb().formatHex8()}function fr(){return wr(this).formatHsl()}function pr(){return this.rgb().formatRgb()}function mr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=nr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?hr(t):n===3?new V(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?gr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?gr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=rr.exec(e))?new V(t[1],t[2],t[3],1):(t=ir.exec(e))?new V(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ar.exec(e))?gr(t[1],t[2],t[3],t[4]):(t=or.exec(e))?gr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=sr.exec(e))?Cr(t[1],t[2]/100,t[3]/100,1):(t=cr.exec(e))?Cr(t[1],t[2]/100,t[3]/100,t[4]):lr.hasOwnProperty(e)?hr(lr[e]):e===`transparent`?new V(NaN,NaN,NaN,0):null}function hr(e){return new V(e>>16&255,e>>8&255,e&255,1)}function gr(e,t,n,r){return r<=0&&(e=t=n=NaN),new V(e,t,n,r)}function _r(e){return e instanceof Qn||(e=mr(e)),e?(e=e.rgb(),new V(e.r,e.g,e.b,e.opacity)):new V}function vr(e,t,n,r){return arguments.length===1?_r(e):new V(e,t,n,r??1)}function V(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Xn(V,vr,Zn(Qn,{brighter(e){return e=e==null?er:er**+e,new V(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$n:$n**+e,new V(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new V(H(this.r),H(this.g),H(this.b),Sr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yr,formatHex:yr,formatHex8:br,formatRgb:xr,toString:xr}));function yr(){return`#${U(this.r)}${U(this.g)}${U(this.b)}`}function br(){return`#${U(this.r)}${U(this.g)}${U(this.b)}${U((isNaN(this.opacity)?1:this.opacity)*255)}`}function xr(){let e=Sr(this.opacity);return`${e===1?`rgb(`:`rgba(`}${H(this.r)}, ${H(this.g)}, ${H(this.b)}${e===1?`)`:`, ${e})`}`}function Sr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function H(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function U(e){return e=H(e),(e<16?`0`:``)+e.toString(16)}function Cr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new W(e,t,n,r)}function wr(e){if(e instanceof W)return new W(e.h,e.s,e.l,e.opacity);if(e instanceof Qn||(e=mr(e)),!e)return new W;if(e instanceof W)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new W(o,s,c,e.opacity)}function Tr(e,t,n,r){return arguments.length===1?wr(e):new W(e,t,n,r??1)}function W(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Xn(W,Tr,Zn(Qn,{brighter(e){return e=e==null?er:er**+e,new W(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$n:$n**+e,new W(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new V(Or(e>=240?e-240:e+120,i,r),Or(e,i,r),Or(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new W(Er(this.h),Dr(this.s),Dr(this.l),Sr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Sr(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Er(this.h)}, ${Dr(this.s)*100}%, ${Dr(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Er(e){return e=(e||0)%360,e<0?e+360:e}function Dr(e){return Math.max(0,Math.min(1,e||0))}function Or(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var kr=e=>()=>e;function Ar(e,t){return function(n){return e+n*t}}function jr(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Mr(e){return(e=+e)==1?Nr:function(t,n){return n-t?jr(t,n,e):kr(isNaN(t)?n:t)}}function Nr(e,t){var n=t-e;return n?Ar(e,n):kr(isNaN(e)?t:e)}var Pr=(function e(t){var n=Mr(t);function r(e,t){var r=n((e=vr(e)).r,(t=vr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Nr(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function G(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Fr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ir=new RegExp(Fr.source,`g`);function Lr(e){return function(){return e}}function Rr(e){return function(t){return e(t)+``}}function zr(e,t){var n=Fr.lastIndex=Ir.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Fr.exec(e))&&(i=Ir.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:G(r,i)})),n=Ir.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Rr(c[0].x):Lr(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var Br=180/Math.PI,Vr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Hr(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Br,skewX:Math.atan(c)*Br,scaleX:o,scaleY:s}}var Ur;function Wr(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Vr:Hr(t.a,t.b,t.c,t.d,t.e,t.f)}function Gr(e){return e==null||(Ur||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Ur.setAttribute(`transform`,e),!(e=Ur.transform.baseVal.consolidate()))?Vr:(e=e.matrix,Hr(e.a,e.b,e.c,e.d,e.e,e.f))}function Kr(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:G(e,i)},{i:c-2,x:G(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:G(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:G(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:G(e,n)},{i:s-2,x:G(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var qr=Kr(Wr,`px, `,`px)`,`deg)`),Jr=Kr(Gr,`, `,`)`,`)`),Yr=0,Xr=0,Zr=0,Qr=1e3,$r,ei,ti=0,ni=0,ri=0,ii=typeof performance==`object`&&performance.now?performance:Date,ai=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function oi(){return ni||=(ai(si),ii.now()+ri)}function si(){ni=0}function ci(){this._call=this._time=this._next=null}ci.prototype=li.prototype={constructor:ci,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?oi():+n)+(t==null?0:+t),!this._next&&ei!==this&&(ei?ei._next=this:$r=this,ei=this),this._call=e,this._time=n,mi()},stop:function(){this._call&&(this._call=null,this._time=1/0,mi())}};function li(e,t,n){var r=new ci;return r.restart(e,t,n),r}function ui(){oi(),++Yr;for(var e=$r,t;e;)(t=ni-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Yr}function di(){ni=(ti=ii.now())+ri,Yr=Xr=0;try{ui()}finally{Yr=0,pi(),ni=0}}function fi(){var e=ii.now(),t=e-ti;t>Qr&&(ri-=t,ti=e)}function pi(){for(var e,t=$r,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$r=n);ei=e,mi(r)}function mi(e){Yr||(Xr&&=clearTimeout(Xr),e-ni>24?(e<1/0&&(Xr=setTimeout(di,e-ii.now()-ri)),Zr&&=clearInterval(Zr)):(Zr||=(ti=ii.now(),setInterval(fi,Qr)),Yr=1,ai(di)))}function hi(e,t,n){var r=new ci;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var gi=Je(`start`,`end`,`cancel`,`interrupt`),_i=[];function vi(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;bi(e,n,{name:t,index:r,group:i,on:gi,tween:_i,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function yi(e,t){var n=q(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function K(e,t){var n=q(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function q(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function bi(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=li(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return hi(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(hi(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function xi(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function Si(e){return this.each(function(){xi(this,e)})}function Ci(e,t){var n,r;return function(){var i=K(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function wi(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=K(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Ti(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=q(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Ci:wi)(n,e,t))}function Ei(e,t,n){var r=e._id;return e.each(function(){var e=K(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return q(e,r).value[t]}}function Di(e,t){var n;return(typeof t==`number`?G:t instanceof mr?Pr:(n=mr(t))?(t=n,Pr):zr)(e,t)}function Oi(e){return function(){this.removeAttribute(e)}}function ki(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ai(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function ji(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Mi(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Ni(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Pi(e,t){var n=et(e),r=n===`transform`?Jr:Di;return this.attrTween(e,typeof t==`function`?(n.local?Ni:Mi)(n,r,Ei(this,`attr.`+e,t)):t==null?(n.local?ki:Oi)(n):(n.local?ji:Ai)(n,r,t))}function Fi(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ii(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Li(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ii(e,i)),n}return i._value=t,i}function Ri(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Fi(e,i)),n}return i._value=t,i}function zi(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=et(e);return this.tween(n,(r.local?Li:Ri)(r,t))}function Bi(e,t){return function(){yi(this,e).delay=+t.apply(this,arguments)}}function Vi(e,t){return t=+t,function(){yi(this,e).delay=t}}function Hi(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Bi:Vi)(t,e)):q(this.node(),t).delay}function Ui(e,t){return function(){K(this,e).duration=+t.apply(this,arguments)}}function Wi(e,t){return t=+t,function(){K(this,e).duration=t}}function Gi(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Ui:Wi)(t,e)):q(this.node(),t).duration}function Ki(e,t){if(typeof t!=`function`)throw Error();return function(){K(this,e).ease=t}}function qi(e){var t=this._id;return arguments.length?this.each(Ki(t,e)):q(this.node(),t).ease}function Ji(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();K(this,e).ease=n}}function Yi(e){if(typeof e!=`function`)throw Error();return this.each(Ji(this._id,e))}function Xi(e){typeof e!=`function`&&(e=ft(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new J(r,this._parents,this._name,this._id)}function Zi(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new J(o,this._parents,this._name,this._id)}function Qi(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function $i(e,t,n){var r,i,a=Qi(t)?yi:K;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function ea(e,t){var n=this._id;return arguments.length<2?q(this.node(),n).on.on(e):this.each($i(n,e,t))}function ta(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function na(){return this.on(`end.remove`,ta(this._id))}function ra(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=at(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,vi(l[f],t,n,f,l,q(u,n)));return new J(a,this._parents,t,n)}function ia(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=lt(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=q(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&vi(p,t,n,h,f,m);a.push(f),o.push(u)}return new J(a,o,t,n)}var aa=Jn.prototype.constructor;function oa(){return new aa(this._groups,this._parents)}function sa(e,t){var n,r,i;return function(){var a=L(this,e),o=(this.style.removeProperty(e),L(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function ca(e){return function(){this.style.removeProperty(e)}}function la(e,t,n){var r,i=n+``,a;return function(){var o=L(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function ua(e,t,n){var r,i,a;return function(){var o=L(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),L(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function da(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=K(this,e),l=c.on,u=c.value[a]==null?s||=ca(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function fa(e,t,n){var r=(e+=``)==`transform`?qr:Di;return t==null?this.styleTween(e,sa(e,r)).on(`end.style.`+e,ca(e)):typeof t==`function`?this.styleTween(e,ua(e,r,Ei(this,`style.`+e,t))).each(da(this._id,e)):this.styleTween(e,la(e,r,t),n).on(`end.style.`+e,null)}function pa(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function ma(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&pa(e,a,n)),r}return a._value=t,a}function ha(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,ma(e,t,n??``))}function ga(e){return function(){this.textContent=e}}function _a(e){return function(){var t=e(this);this.textContent=t??``}}function va(e){return this.tween(`text`,typeof e==`function`?_a(Ei(this,`text`,e)):ga(e==null?``:e+``))}function ya(e){return function(t){this.textContent=e.call(this,t)}}function ba(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&ya(r)),t}return r._value=e,r}function xa(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,ba(e))}function Sa(){for(var e=this._name,t=this._id,n=Ta(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=q(c,t);vi(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new J(r,this._parents,e,n)}function Ca(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=K(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var wa=0;function J(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ta(){return++wa}var Y=Jn.prototype;J.prototype={constructor:J,select:ra,selectAll:ia,selectChild:Y.selectChild,selectChildren:Y.selectChildren,filter:Xi,merge:Zi,selection:oa,transition:Sa,call:Y.call,nodes:Y.nodes,node:Y.node,size:Y.size,empty:Y.empty,each:Y.each,on:ea,attr:Pi,attrTween:zi,style:fa,styleTween:ha,text:va,textTween:xa,remove:na,tween:Ti,delay:Hi,duration:Gi,ease:qi,easeVarying:Yi,end:Ca,[Symbol.iterator]:Y[Symbol.iterator]};function Ea(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Da={time:null,delay:0,duration:250,ease:Ea};function Oa(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function ka(e){var t,n;e instanceof J?(t=e._id,e=e._name):(t=Ta(),(n=Da).time=oi(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&vi(c,e,t,l,o,n||Oa(c,t));return new J(r,this._parents,e,t)}Jn.prototype.interrupt=Si,Jn.prototype.transition=ka;var{abs:Aa,max:ja,min:Ma}=Math;[`w`,`e`].map(Na),[`n`,`s`].map(Na),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(Na);function Na(e){return{type:e}}function Pa(e,t,n){this.k=e,this.x=t,this.y=n}Pa.prototype={constructor:Pa,scale:function(e){return e===1?this:new Pa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Pa(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Fa=new Pa(1,0,0);Ia.prototype=Pa.prototype;function Ia(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fa;return e.__zoom}var X=class extends M{constructor(...e){super(...e),this.hexSize=50,this.waveAmplitude=5.5,this.waveSpeed=1,this.waveXFactor=-.005,this.waveYFactor=-.005,this.shadeAmplitude=.5,this.shadeLightnessBoost=15,this.baseLightness=10,this.lightnessRange=25,this.hexHueStart=310,this.hexHueEnd=200,this.hexSaturation=100,this.hexScale=1,this.hexColors=[],this.grid=[],this.time=0}updated(e){super.updated(e),e.has(`hexSize`)&&this.initialize()}initialize(){this.grid=[],this.time=0;let e=this.hexSize,t=Math.sqrt(3)*e,n=e*1.5,r=Math.ceil(this.width/t)+2,i=Math.ceil(this.height/n)+2;for(let e=-1;e<i;e++)for(let i=-1;i<r;i++){let r=e%2==0?0:t/2;this.grid.push({x:i*t+r,y:e*n,phase:Math.random()*Math.PI*2,colorIndex:Math.floor(Math.random()*1e3)})}}loop(e){this.time+=e,this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1;for(let e of this.grid){let t=e.x*this.waveXFactor,n=e.y*this.waveYFactor,r=Math.sin(this.time*this.waveSpeed+t+n),i=r*this.waveAmplitude,a=e.x+e.y,o=Math.sin(this.time+a)*this.shadeAmplitude,s=this.baseLightness+r*this.lightnessRange+o,c;if(this.hexColors&&this.hexColors.length>0){let t=this.hexColors[(e.colorIndex||0)%this.hexColors.length],n=Tr(t);c=`hsl(${n.h}, ${n.s*100}%, ${s}%)`}else{let t=this.width+this.height,n=(e.x+e.y)/t;c=`hsl(${this.hexHueStart+(this.hexHueEnd-this.hexHueStart)*n}, ${this.hexSaturation}%, ${s}%)`}this.drawHex(e.x,e.y+i,this.hexSize*this.hexScale,c)}}drawHex(e,t,n,r){let i=this.ctx;i.beginPath();for(let r=0;r<6;r++){let a=Math.PI*2/6*r-Math.PI/2,o=e+Math.cos(a)*n,s=t+Math.sin(a)*n;r===0?i.moveTo(o,s):i.lineTo(o,s)}i.closePath(),i.fillStyle=r,i.fill()}};j([k({type:Number,attribute:`hex-size`})],X.prototype,`hexSize`,void 0),j([k({type:Number,attribute:`wave-amplitude`})],X.prototype,`waveAmplitude`,void 0),j([k({type:Number,attribute:`wave-speed`})],X.prototype,`waveSpeed`,void 0),j([k({type:Number,attribute:`wave-x-factor`})],X.prototype,`waveXFactor`,void 0),j([k({type:Number,attribute:`wave-y-factor`})],X.prototype,`waveYFactor`,void 0),j([k({type:Number,attribute:`shade-amplitude`})],X.prototype,`shadeAmplitude`,void 0),j([k({type:Number,attribute:`shade-lightness-boost`})],X.prototype,`shadeLightnessBoost`,void 0),j([k({type:Number,attribute:`base-lightness`})],X.prototype,`baseLightness`,void 0),j([k({type:Number,attribute:`lightness-range`})],X.prototype,`lightnessRange`,void 0),j([k({type:Number,attribute:`hex-hue-start`})],X.prototype,`hexHueStart`,void 0),j([k({type:Number,attribute:`hex-hue-end`})],X.prototype,`hexHueEnd`,void 0),j([k({type:Number,attribute:`hex-saturation`})],X.prototype,`hexSaturation`,void 0),j([k({type:Number,attribute:`hex-scale`})],X.prototype,`hexScale`,void 0),j([k({type:Array,attribute:`hex-colors`,converter:A})],X.prototype,`hexColors`,void 0),X=j([O(`bb-hexagon-wave`)],X);var Z=class extends M{constructor(...e){super(...e),this.lineCount=20,this.lineAmplitude=30,this.lineFrequency=.005,this.speed=.5,this.lineSpacing=40,this.lineWidth=2,this.lineHueStart=200,this.lineHueEnd=280,this.lineSaturation=80,this.lineOffsetStep=.2,this.wiggleAmplitude=20,this.wiggleSpeed=.3,this.lineColors=[],this.time=0}loop(e){this.time+=e,this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1;let t=this.height/2-this.lineCount*this.lineSpacing/2;for(let e=0;e<this.lineCount;e++)this.drawLine(e,t+e*this.lineSpacing)}drawLine(e,t){let n=this.ctx,r=this.width/99,i=e*this.lineOffsetStep;n.beginPath(),n.lineWidth=this.lineWidth;let a=e/this.lineCount,o=this.lineHueStart+(this.lineHueEnd-this.lineHueStart)*a,s=40+Math.sin(this.time*.001+e*.5)*10,c=this.lineColors&&this.lineColors.length>0?Tr(this.lineColors[e%this.lineColors.length]):Tr(o,this.lineSaturation/100,s/100);this.lineColors&&this.lineColors.length>0&&(c.l=s/100),n.strokeStyle=c.toString();for(let a=0;a<99;a++){let o=a*r,s=Math.sin(o*this.lineFrequency+this.time*this.speed+i)*this.lineAmplitude,c=Math.sin(this.time*this.wiggleSpeed+i+e)*this.wiggleAmplitude,l=t+s+c,u=(a+1)*r,d=Math.sin(u*this.lineFrequency+this.time*this.speed+i)*this.lineAmplitude,f=Math.sin(this.time*this.wiggleSpeed+i+e)*this.wiggleAmplitude,p=t+d+f,m=(o+u)/2,h=(l+p)/2;a===0&&n.moveTo(o,l),n.quadraticCurveTo(o,l,m,h)}n.stroke()}};j([k({type:Number,attribute:`line-count`})],Z.prototype,`lineCount`,void 0),j([k({type:Number,attribute:`line-amplitude`})],Z.prototype,`lineAmplitude`,void 0),j([k({type:Number,attribute:`line-frequency`})],Z.prototype,`lineFrequency`,void 0),j([k({type:Number,attribute:`speed`})],Z.prototype,`speed`,void 0),j([k({type:Number,attribute:`line-spacing`})],Z.prototype,`lineSpacing`,void 0),j([k({type:Number,attribute:`line-width`})],Z.prototype,`lineWidth`,void 0),j([k({type:Number,attribute:`line-hue-start`})],Z.prototype,`lineHueStart`,void 0),j([k({type:Number,attribute:`line-hue-end`})],Z.prototype,`lineHueEnd`,void 0),j([k({type:Number,attribute:`line-saturation`})],Z.prototype,`lineSaturation`,void 0),j([k({type:Number,attribute:`line-offset-step`})],Z.prototype,`lineOffsetStep`,void 0),j([k({type:Number,attribute:`wiggle-amplitude`})],Z.prototype,`wiggleAmplitude`,void 0),j([k({type:Number,attribute:`wiggle-speed`})],Z.prototype,`wiggleSpeed`,void 0),j([k({type:Array,attribute:`line-colors`,converter:A})],Z.prototype,`lineColors`,void 0),Z=j([O(`bb-liquid-lines`)],Z);var La=class{constructor(e){this.initialized=!1,this.railFromX=0,this.railFromY=0,this.railToX=0,this.railToY=0,this.railProgress=0,this.size=e.size,this.speed=e.speed,this.color=e.color,this.radius=e.radius??1,this.angle=e.angle,this.lifespan=e.lifespan,this.force=e.force??1,this.frequencyX=e.frequencyX??1,this.frequencyY=e.frequencyY??1,this.gridSides=e.gridSides??6,this.gridSize=e.gridSize??40,this.gridAngle=e.gridAngle??Math.PI/2,this.x=e.x??0,this.y=e.y??0,this.px=this.x,this.py=this.y,this.born=Date.now(),this.fadeInDuration=this.lifespan*.25,this.fadeOutDuration=this.lifespan*.5}circularMove(e,t,n){this.angle+=this.speed*n,this.radius+=this.force*n;let r=e+Math.cos(this.angle*this.frequencyX)*this.radius,i=t+Math.sin(this.angle*this.frequencyY)*this.radius;this.initialized?(this.px=this.x,this.py=this.y,this.x=r,this.y=i):(this.x=r,this.y=i,this.px=r,this.py=i,this.initialized=!0)}sinusMove(e,t,n){this.angle+=this.speed*n;let r=e+this.angle*100,i=t+Math.sin(this.angle*this.frequencyY)*this.radius;this.initialized?(this.px=this.x,this.py=this.y,this.x=r,this.y=i):(this.x=r,this.y=i,this.px=r,this.py=i,this.initialized=!0)}draw(e){e.globalAlpha=this.calculateOpacity(),e.beginPath(),e.lineCap=`round`,e.lineWidth=this.size*2,e.strokeStyle=this.color,e.moveTo(this.px,this.py),e.lineTo(this.x,this.y),e.stroke(),e.globalAlpha=1}isDead(){return Date.now()-this.born>this.lifespan}railMove(e,t,n){if(!this.initialized){let n=this.x,r=this.y,i=this.snapToGrid(n,r,e,t);this.railFromX=i.x,this.railFromY=i.y,this.pickNextRailTarget(),this.x=this.railFromX,this.y=this.railFromY,this.px=this.x,this.py=this.y,this.initialized=!0,this.railProgress=0}let r=Math.abs(this.speed)*20;this.railProgress+=r/this.gridSize*n,this.railProgress>=1&&(--this.railProgress,this.railFromX=this.railToX,this.railFromY=this.railToY,this.pickNextRailTarget());let i=this.railToX-this.railFromX,a=this.railToY-this.railFromY,o=this.railFromX+i*this.railProgress,s=this.railFromY+a*this.railProgress;this.updatePosition(o,s)}pickNextRailTarget(){let e=Math.PI*2/this.gridSides,t=Math.floor(Math.random()*this.gridSides)*e+this.gridAngle;this.railToX=this.railFromX+Math.cos(t)*this.gridSize,this.railToY=this.railFromY+Math.sin(t)*this.gridSize}snapToGrid(e,t,n,r){let i=e-n,a=t-r,o=Math.cos(-this.gridAngle),s=Math.sin(-this.gridAngle),c=i*o-a*s,l=i*s+a*o,u=c,d=l,f=this.gridSize;if(this.gridSides===6||this.gridSides===3){let e=f*Math.sqrt(3)/2,t=Math.round(l/e);u=Math.round((c-t*f/2)/f)*f+t*f/2,d=t*e}else this.gridSides===4&&(u=Math.round(c/f)*f,d=Math.round(l/f)*f);let p=u*Math.cos(this.gridAngle)-d*Math.sin(this.gridAngle),m=u*Math.sin(this.gridAngle)+d*Math.cos(this.gridAngle);return{x:p+n,y:m+r}}updatePosition(e,t){this.initialized?(this.px=this.x,this.py=this.y,this.x=e,this.y=t):(this.x=e,this.y=t,this.px=e,this.py=t,this.initialized=!0)}calculateOpacity(){let e=Date.now()-this.born;return e<this.fadeInDuration?e/this.fadeInDuration:e>this.lifespan-this.fadeOutDuration?(this.lifespan-e)/this.fadeOutDuration:1}},Q=class extends M{constructor(...e){super(...e),this.particleSizeMin=1,this.particleSizeMax=1,this.particleSpeedMin=-30,this.particleSpeedMax=30,this.particleColorHueStart=130,this.particleColorHueEnd=300,this.particleColorSaturationStart=100,this.particleColorSaturationEnd=100,this.particleColorLightnessStart=50,this.particleColorLightnessEnd=0,this.particleLifespanMin=100,this.particleLifespanMax=5e4,this.particleAmount=2e3,this.gridSides=3,this.gridSize=60,this.gridAngle=Math.PI/2,this.particleColors=[],this.particles=[],this.trailOpacity=.0125}initialize(){this.particles=[],this.drawBackground(this.ctx);for(let e=0;e<this.particleAmount;e++)this.particles.push(this.createParticle())}loop(e){for(this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1,this.particles=this.particles.filter(e=>!e.isDead());this.particles.length<this.particleAmount;)this.particles.push(this.createParticle());this.particles.forEach(t=>{t.railMove(this.width/2,this.height/2,e),t.draw(this.ctx)})}createParticle(){let e=N(this.particleSizeMin,this.particleSizeMax),t=N(this.particleSpeedMin,this.particleSpeedMax),n=N(this.particleLifespanMin,this.particleLifespanMax),r;r=this.particleColors&&this.particleColors.length>0?this.particleColors[Math.floor(Math.random()*this.particleColors.length)]:He([this.particleColorHueStart,this.particleColorHueEnd],[this.particleColorSaturationStart,this.particleColorSaturationEnd],[this.particleColorLightnessStart,this.particleColorLightnessEnd]);let i=N(0,this.width),a=N(0,this.height),o=i-this.width/2,s=a-this.height/2;return new La({size:e,speed:t,color:r,angle:Math.atan2(s,o),lifespan:n,gridSides:this.gridSides,gridSize:this.gridSize,gridAngle:this.gridAngle,x:i,y:a})}};j([k({type:Number,attribute:`particle-size-min`})],Q.prototype,`particleSizeMin`,void 0),j([k({type:Number,attribute:`particle-size-max`})],Q.prototype,`particleSizeMax`,void 0),j([k({type:Number,attribute:`particle-speed-min`})],Q.prototype,`particleSpeedMin`,void 0),j([k({type:Number,attribute:`particle-speed-max`})],Q.prototype,`particleSpeedMax`,void 0),j([k({type:Number,attribute:`particle-color-hue-start`})],Q.prototype,`particleColorHueStart`,void 0),j([k({type:Number,attribute:`particle-color-hue-end`})],Q.prototype,`particleColorHueEnd`,void 0),j([k({type:Number,attribute:`particle-color-saturation-start`})],Q.prototype,`particleColorSaturationStart`,void 0),j([k({type:Number,attribute:`particle-color-saturation-end`})],Q.prototype,`particleColorSaturationEnd`,void 0),j([k({type:Number,attribute:`particle-color-lightness-start`})],Q.prototype,`particleColorLightnessStart`,void 0),j([k({type:Number,attribute:`particle-color-lightness-end`})],Q.prototype,`particleColorLightnessEnd`,void 0),j([k({type:Number,attribute:`particle-lifespan-min`})],Q.prototype,`particleLifespanMin`,void 0),j([k({type:Number,attribute:`particle-lifespan-max`})],Q.prototype,`particleLifespanMax`,void 0),j([k({type:Number,attribute:`particle-amount`})],Q.prototype,`particleAmount`,void 0),j([k({type:Number,attribute:`grid-sides`})],Q.prototype,`gridSides`,void 0),j([k({type:Number,attribute:`grid-size`})],Q.prototype,`gridSize`,void 0),j([k({type:Number,attribute:`grid-angle`})],Q.prototype,`gridAngle`,void 0),j([k({type:Array,attribute:`particle-colors`,converter:A})],Q.prototype,`particleColors`,void 0),j([k({type:Number,attribute:`trail-opacity`})],Q.prototype,`trailOpacity`,void 0),Q=j([O(`bb-neon-rails`)],Q);var $=class extends M{constructor(...e){super(...e),this.particleForce=0,this.particleSizeMin=.5,this.particleSizeMax=1.5,this.particleSpeedMin=.025,this.particleSpeedMax=.05,this.particleColorHueStart=30,this.particleColorHueEnd=75,this.particleColorSaturationStart=100,this.particleColorSaturationEnd=100,this.particleColorLightnessStart=50,this.particleColorLightnessEnd=50,this.particleRadiusMin=1,this.particleRadiusMax=100,this.particleLifespanMin=1e3,this.particleLifespanMax=1e4,this.particleAmount=1e3,this.gridSides=6,this.gridSize=40,this.gridAngle=0,this.particleColors=[],this.particles=[]}initialize(){this.particles=[],this.drawBackground(this.ctx),this.particleRadiusMax=this.particleRadiusMax||this.width;for(let e=0;e<this.particleAmount;e++)this.particles.push(this.createParticle())}loop(e){for(this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1,this.particles=this.particles.filter(e=>!e.isDead());this.particles.length<this.particleAmount;)this.particles.push(this.createParticle());this.particles.forEach(t=>{t.circularMove(this.width/2,this.height/2,e),t.draw(this.ctx)})}createParticle(){let e=N(this.particleSizeMin,this.particleSizeMax),t=N(this.particleSpeedMin,this.particleSpeedMax),n=N(this.particleLifespanMin,this.particleLifespanMax),r;r=this.particleColors&&this.particleColors.length>0?this.particleColors[Math.floor(Math.random()*this.particleColors.length)]:He([this.particleColorHueStart,this.particleColorHueEnd],[this.particleColorSaturationStart,this.particleColorSaturationEnd],[this.particleColorLightnessStart,this.particleColorLightnessEnd]);let i=N(0,Math.PI*2),a=this.particleRadiusMax-this.particleRadiusMin,o=Math.sqrt(Math.random())*a+this.particleRadiusMin;return new La({size:e,speed:t,color:r,radius:o,angle:i,lifespan:n,gridSides:this.gridSides,gridSize:this.gridSize,gridAngle:this.gridAngle,force:this.particleForce})}};j([k({type:Number,attribute:`particle-force`})],$.prototype,`particleForce`,void 0),j([k({type:Number,attribute:`particle-size-min`})],$.prototype,`particleSizeMin`,void 0),j([k({type:Number,attribute:`particle-size-max`})],$.prototype,`particleSizeMax`,void 0),j([k({type:Number,attribute:`particle-speed-min`})],$.prototype,`particleSpeedMin`,void 0),j([k({type:Number,attribute:`particle-speed-max`})],$.prototype,`particleSpeedMax`,void 0),j([k({type:Number,attribute:`particle-color-hue-start`})],$.prototype,`particleColorHueStart`,void 0),j([k({type:Number,attribute:`particle-color-hue-end`})],$.prototype,`particleColorHueEnd`,void 0),j([k({type:Number,attribute:`particle-color-saturation-start`})],$.prototype,`particleColorSaturationStart`,void 0),j([k({type:Number,attribute:`particle-color-saturation-end`})],$.prototype,`particleColorSaturationEnd`,void 0),j([k({type:Number,attribute:`particle-color-lightness-start`})],$.prototype,`particleColorLightnessStart`,void 0),j([k({type:Number,attribute:`particle-color-lightness-end`})],$.prototype,`particleColorLightnessEnd`,void 0),j([k({type:Number,attribute:`particle-radius-min`})],$.prototype,`particleRadiusMin`,void 0),j([k({type:Number,attribute:`particle-radius-max`})],$.prototype,`particleRadiusMax`,void 0),j([k({type:Number,attribute:`particle-lifespan-min`})],$.prototype,`particleLifespanMin`,void 0),j([k({type:Number,attribute:`particle-lifespan-max`})],$.prototype,`particleLifespanMax`,void 0),j([k({type:Number,attribute:`particle-amount`})],$.prototype,`particleAmount`,void 0),j([k({type:Number,attribute:`grid-sides`})],$.prototype,`gridSides`,void 0),j([k({type:Number,attribute:`grid-size`})],$.prototype,`gridSize`,void 0),j([k({type:Number,attribute:`grid-angle`})],$.prototype,`gridAngle`,void 0),j([k({type:Array,attribute:`particle-colors`,converter:A})],$.prototype,`particleColors`,void 0),$=j([O(`bb-star-trail`)],$),Object.defineProperty(e,"BbAmbientRibbon",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"BbConcentricPulse",{enumerable:!0,get:function(){return F}}),Object.defineProperty(e,"BbDigitalRain",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"BbHexagonWave",{enumerable:!0,get:function(){return X}}),Object.defineProperty(e,"BbLiquidLines",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(e,"BbNeonRails",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(e,"BbStarTrail",{enumerable:!0,get:function(){return $}}),e.BeautifulBackground=M});
|
|
49
|
+
`}render(){}};F([N({type:Array,attribute:`bg-colors`,converter:P})],I.prototype,`bgColors`,void 0),F([N({type:Number,attribute:`bg-angle`})],I.prototype,`bgAngle`,void 0),F([N({type:String,attribute:`background-color`})],I.prototype,`backgroundColor`,void 0),F([N({type:Number,attribute:`trail-opacity`})],I.prototype,`trailOpacity`,void 0),F([N({attribute:`clean-trail`,converter:e=>e!==`false`})],I.prototype,`cleanTrail`,void 0);function Le(e,t){let n=Array.from({length:4096},()=>Math.floor(Math.random()*t));return Array.from({length:t},(t,r)=>{let i=new ImageData(64,64);n.forEach((e,t)=>{e===r&&(i.data[t*4+3]=255)});let a=document.createElement(`canvas`);return a.width=a.height=64,a.getContext(`2d`).putImageData(i,0,0),e.createPattern(a,`repeat`)})}function L(e,t){return Math.random()*(t-e)+e}function R(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}let z=null;function Re(e=[0,360],t=[0,100],n=[40,60]){return`hsl(${R(e[0],e[1])}, ${R(t[0],t[1])}%, ${R(n[0],n[1])}%)`}function ze(e,t,n,r){return`hsla(${e}, ${t}%, ${n}%, ${r})`}function Be(e){let[t,n,r]=B(e).map(e=>e/255),i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s=i-a;if(s===0)return{h:0,s:0,l:o};let c=s/(1-Math.abs(2*o-1)),l;return l=i===t?((n-r)/s+6)%6:i===n?(r-t)/s+2:(t-n)/s+4,{h:l*60,s:c,l:o}}function Ve(e,t){let n=e.map(B);return Array.from({length:t},(e,r)=>{let i=r/(t-1)*(n.length-1),a=Math.floor(i),o=n[a],s=n[a+1]??o;return`rgb(${o.map((e,t)=>Math.round(e+(s[t]-e)*(i-a))).join(`, `)})`})}function B(e){z??=document.createElement(`canvas`).getContext(`2d`),z.fillStyle=`#000`,z.fillStyle=e;let t=String(z.fillStyle);return t.startsWith(`#`)?[1,3,5].map(e=>parseInt(t.slice(e,e+2),16)):t.match(/[\d.]+/g).slice(0,3).map(Number)}function He(e,t){let n=2/e.getTransform().a,r=e.globalAlpha;e.lineWidth=Math.max(t,n),e.globalAlpha=r*Math.min(1,Math.max(0,t)/n),e.stroke(),e.globalAlpha=r}var Ue=class{constructor(e,t){this.speed=[],this.lines=[],this.angle=[L(0,Math.PI*2),L(0,Math.PI*2),L(0,Math.PI*2),L(0,Math.PI*2)];let n=()=>Math.random()>.5?1:-1;this.speedSeeds=[Math.random(),Math.random(),Math.random(),Math.random()],this.speedSigns=[n(),n(),n(),n()],this.updateSpeeds(e,t)}updateSpeeds(e,t){this.speed=this.speedSeeds.map((n,r)=>this.speedSigns[r]*(e+n*(t-e)))}update(e){this.angle[0]+=this.speed[0],this.angle[1]+=this.speed[1],this.angle[2]+=this.speed[2],this.angle[3]+=this.speed[3];let t=[Math.sin(this.angle[0]),Math.sin(this.angle[1]),Math.sin(this.angle[2]),Math.sin(this.angle[3])];this.lines.push(t),this.lines.length>e&&this.lines.shift()}};let V=class extends I{constructor(...e){super(...e),this.ribbonCount=5,this.ribbonWidth=100,this.ribbonRotation=45,this.ribbonHueStart=11,this.ribbonHueEnd=14,this.ribbonSaturationStart=100,this.ribbonSaturationEnd=100,this.ribbonLightnessStart=50,this.ribbonLightnessEnd=50,this.ribbonAmplitude=.5,this.ribbonSpeedMin=.004,this.ribbonSpeedMax=.008,this.ribbonLineWidth=2,this.ribbonLineOpacity=.2,this.ribbons=[]}initialize(){this.ribbons=[];for(let e=0;e<this.ribbonCount;e++)this.ribbons.push(new Ue(this.ribbonSpeedMin,this.ribbonSpeedMax));for(let e=0;e<this.ribbonCount;e++)for(let t=0;t<this.ribbonWidth;t++)this.ribbons[e].update(this.ribbonWidth)}updated(e){super.updated(e),(e.has(`ribbonSpeedMin`)||e.has(`ribbonSpeedMax`))&&this.ribbons.forEach(e=>e.updateSpeeds(this.ribbonSpeedMin,this.ribbonSpeedMax)),e.has(`ribbonCount`)&&this.initialize(),e.has(`ribbonWidth`)&&this.ribbons.forEach(e=>{e.lines.length>this.ribbonWidth&&(e.lines=e.lines.slice(-this.ribbonWidth))})}loop(){this.ctx.clearRect(0,0,this.width,this.height),this.drawBackground(this.ctx),this.ribbons.forEach(e=>{e.update(this.ribbonWidth),e.lines.forEach((t,n)=>{let r=n/(e.lines.length-1||1);this.ctx.strokeStyle=this.lineColor(r),this.drawLine(t)})})}drawLine(e){let t=Math.sqrt(this.width**2+this.height**2)/2,n=this.ribbonRotation*Math.PI/180,r=this.ribbonAmplitude,i=(e,t,n)=>[this.width/2+e*t*Math.cos(n),this.height/2+e*t*Math.sin(n)];this.ctx.beginPath(),this.ctx.moveTo(...i(-1,t,e[0]*r+n)),this.ctx.bezierCurveTo(...i(-1,t/3,e[1]*r*2),...i(1,t/3,e[2]*r*2),...i(1,t,e[3]*r+n)),He(this.ctx,this.ribbonLineWidth)}lineColor(e){let t=(t,n)=>n+(t-n)*e;return ze(t(this.ribbonHueStart,this.ribbonHueEnd),t(this.ribbonSaturationStart,this.ribbonSaturationEnd),t(this.ribbonLightnessStart,this.ribbonLightnessEnd),this.ribbonLineOpacity)}};F([N({type:Number,attribute:`ribbon-count`})],V.prototype,`ribbonCount`,void 0),F([N({type:Number,attribute:`ribbon-width`})],V.prototype,`ribbonWidth`,void 0),F([N({type:Number,attribute:`ribbon-rotation`})],V.prototype,`ribbonRotation`,void 0),F([N({type:Number,attribute:`ribbon-hue-start`})],V.prototype,`ribbonHueStart`,void 0),F([N({type:Number,attribute:`ribbon-hue-end`})],V.prototype,`ribbonHueEnd`,void 0),F([N({type:Number,attribute:`ribbon-saturation-start`})],V.prototype,`ribbonSaturationStart`,void 0),F([N({type:Number,attribute:`ribbon-saturation-end`})],V.prototype,`ribbonSaturationEnd`,void 0),F([N({type:Number,attribute:`ribbon-lightness-start`})],V.prototype,`ribbonLightnessStart`,void 0),F([N({type:Number,attribute:`ribbon-lightness-end`})],V.prototype,`ribbonLightnessEnd`,void 0),F([N({type:Number,attribute:`ribbon-amplitude`})],V.prototype,`ribbonAmplitude`,void 0),F([N({type:Number,attribute:`ribbon-speed-min`})],V.prototype,`ribbonSpeedMin`,void 0),F([N({type:Number,attribute:`ribbon-speed-max`})],V.prototype,`ribbonSpeedMax`,void 0),F([N({type:Number,attribute:`ribbon-line-width`})],V.prototype,`ribbonLineWidth`,void 0),F([N({type:Number,attribute:`ribbon-line-opacity`})],V.prototype,`ribbonLineOpacity`,void 0),V=F([M(`bb-ambient-ribbon`)],V);function We(){let e=Float32Array.from({length:65536},()=>Math.random()),t=(t,n)=>e[(n&255)*256+(t&255)],n=(e,n)=>{let r=Math.floor(e),i=Math.floor(n),a=Ge(e-r),o=Ge(n-i);return Ke(Ke(t(r,i),t(r+1,i),a),Ke(t(r,i+1),t(r+1,i+1),a),o)};return(e,t)=>{let r=0;for(let i=1;i<=4;i++)r+=n(e*2**(i-1),t*2**(i-1))/2**i;return r}}function Ge(e){return(1-Math.cos(e*Math.PI))/2}function Ke(e,t,n){return e+(t-e)*n}let qe=[`#89964e`],Je=.1,Ye=3/2.2**2,H=Array.from({length:64},(e,t)=>{let n=t/64*Math.PI*2;return[Math.cos(n)*Je,Math.sin(n)*Je]}),U=class extends I{constructor(...e){super(...e),this.particleAmount=4500,this.particleLife=6,this.pulseStrength=.5,this.pulseSpeed=.1,this.lineOpacity=.08,this.flowSpeed=132,this.terrainSize=3333,this.lineColors=qe,this.trailOpacity=.005,this.cols=0,this.rows=0,this.flow=/* @__PURE__ */ new Float32Array,this.lowest=0,this.highest=0,this.shades=[],this.time=0,this.particles=[],this.builtFor=``}initialize(){this.cols=Math.ceil((this.width+200)/10),this.rows=Math.ceil((this.height+200)/10),this.terrain=We(),this.survey(),this.shades=Ve(this.colors(),128),this.particles=Array.from({length:this.particleAmount},()=>this.spawn()),this.builtFor=this.settings(),this.drawBackground(this.ctx)}loop(e){this.builtFor!==this.settings()&&this.initialize(),this.time+=e,this.fadeTrail();let t=this.flowSpeed*e,n=this.shades.map(()=>new Path2D);for(let r of this.particles)r.age+=e,r.age>r.life&&Object.assign(r,this.spawn()),this.move(r,t,n[this.shadeIndex(r)]);this.stroke(n)}settings(){return[this.width,this.height,this.terrainSize,this.particleAmount,this.lineColors].join(` `)}colors(){return this.lineColors.length>0?this.lineColors:qe}survey(){let e=10/this.terrainSize;this.flow=new Float32Array(this.cols*this.rows*2),this.lowest=1/0,this.highest=-1/0;for(let t=0;t<this.rows;t++)for(let n=0;n<this.cols;n++){let[r,i]=[n*e,t*e],a=this.terrain(r,i);this.lowest=Math.min(this.lowest,a),this.highest=Math.max(this.highest,a);let o=(t*this.cols+n)*2;this.flow.set(Xe(this.terrain,r,i),o)}}shadeIndex({x:e,y:t}){let n=this.terrain(e/this.terrainSize,t/this.terrainSize),r=this.highest-this.lowest||1,i=Math.floor((n-this.lowest)/r*128);return Math.min(127,Math.max(0,i))}spawn(){return{x:Math.random()*this.cols*10,y:Math.random()*this.rows*10,dx:0,dy:0,age:0,life:this.particleLife*(.5+Math.random())}}pulse(e){let t=e/128,n=this.pulseSpeed*this.time+t*2;return 1+this.pulseStrength*Math.sin(n*2*Math.PI)}move(e,t,n){let r=(Math.floor(e.y/10)*this.cols+Math.floor(e.x/10))*2,i=e.dx+this.flow[r]*Ye*t,a=e.dy+this.flow[r+1]*Ye*t,o=Math.hypot(i,a)||1;e.dx=i/o,e.dy=a/o,n.moveTo(e.x,e.y),e.x+=e.dx*t,e.y+=e.dy*t,n.lineTo(e.x,e.y),e.x=Ze(e.x,this.cols*10),e.y=Ze(e.y,this.rows*10)}stroke(e){let t=this.ctx;t.save(),t.translate(-100,-100),t.lineWidth=1,e.forEach((e,n)=>{let r=this.lineOpacity*this.pulse(n);t.globalAlpha=Math.min(1,Math.max(0,r)),t.strokeStyle=this.shades[n],t.stroke(e)}),t.restore()}};F([N({type:Number,attribute:`particle-amount`})],U.prototype,`particleAmount`,void 0),F([N({type:Number,attribute:`particle-life`})],U.prototype,`particleLife`,void 0),F([N({type:Number,attribute:`pulse-strength`})],U.prototype,`pulseStrength`,void 0),F([N({type:Number,attribute:`pulse-speed`})],U.prototype,`pulseSpeed`,void 0),F([N({type:Number,attribute:`line-opacity`})],U.prototype,`lineOpacity`,void 0),F([N({type:Number,attribute:`flow-speed`})],U.prototype,`flowSpeed`,void 0),F([N({type:Number,attribute:`terrain-size`})],U.prototype,`terrainSize`,void 0),F([N({type:Array,attribute:`line-colors`,converter:P})],U.prototype,`lineColors`,void 0),U=F([M(`bb-contour-flow`)],U);function Xe(e,t,n){let r=H.map(([r,i])=>e(t+r,n+i)),i=r.indexOf(Math.max(...r)),a=r.indexOf(Math.min(...r)),o=H[a][0]-H[i][0],s=H[a][1]-H[i][1],c=(r[i]-r[a])/(Math.hypot(o,s)||1);return[o*c,s*c]}function Ze(e,t){return(e%t+t)%t}var Qe=class{constructor(e,t){this.x=e,this.y=t}update(e,t,n,r,i){let a=i/30;this.y*n*a>e&&Math.random()>t?this.y=0:this.y+=i*r}draw(e,t,n,r,i){let a=i/30;e.fillStyle=n,e.fillText(t,this.x*r,this.y*r*a)}};let W=class extends I{constructor(){super(),this.speed=10,this.characters=`ヲアウエオカキケコサシスセソタツテナニヌネハヒホマミムメモヤユラリワ`,this.randomness=.975,this.fontSize=24,this.fontColorHueStart=60,this.fontColorHueEnd=150,this.fontColorSaturationStart=90,this.fontColorSaturationEnd=100,this.fontColorLightnessStart=50,this.fontColorLightnessEnd=50,this.fontColors=[],this.columns=0,this.symbols=[],this.fontColorHueEnd=this.fontColorHueStart+90}initialize(){this.symbols=[],this.createSymbols(),this.drawBackground(this.ctx)}createSymbols(){this.columns=Math.floor(this.width/this.fontSize);for(let e=0;e<this.columns;e++)this.symbols[e]=this.createSymbol(e)}updateSymbols(){let e=Math.floor(this.width/this.fontSize);for(let t=this.symbols.length;t<e;t++)this.symbols[t]=this.createSymbol(t);this.symbols.length>e&&(this.symbols.length=e)}loop(e){this.updateSymbols(),this.fadeTrail(),this.ctx.textAlign=`center`,this.ctx.font=`${this.fontSize}px monospace`;let t=this.speed*3;this.symbols.forEach(n=>{n.draw(this.ctx,this.randomCharacter(),this.symbolColor(),this.fontSize,t),n.update(this.height,this.randomness,this.fontSize,e,t)})}randomCharacter(){return this.characters.charAt(Math.floor(Math.random()*this.characters.length))}symbolColor(){return this.fontColors.length>0?this.fontColors[Math.floor(Math.random()*this.fontColors.length)]:Re([this.fontColorHueStart,this.fontColorHueEnd],[this.fontColorSaturationStart,this.fontColorSaturationEnd],[this.fontColorLightnessStart,this.fontColorLightnessEnd])}createSymbol(e){return new Qe(e,R(0,-this.height/this.fontSize))}};F([N({type:Number,attribute:`speed`})],W.prototype,`speed`,void 0),F([N({type:String,attribute:`characters`})],W.prototype,`characters`,void 0),F([N({type:Number,attribute:`randomness`})],W.prototype,`randomness`,void 0),F([N({type:Number,attribute:`font-size`})],W.prototype,`fontSize`,void 0),F([N({type:Number,attribute:`font-color-hue-start`})],W.prototype,`fontColorHueStart`,void 0),F([N({type:Number,attribute:`font-color-hue-end`})],W.prototype,`fontColorHueEnd`,void 0),F([N({type:Number,attribute:`font-color-saturation-start`})],W.prototype,`fontColorSaturationStart`,void 0),F([N({type:Number,attribute:`font-color-saturation-end`})],W.prototype,`fontColorSaturationEnd`,void 0),F([N({type:Number,attribute:`font-color-lightness-start`})],W.prototype,`fontColorLightnessStart`,void 0),F([N({type:Number,attribute:`font-color-lightness-end`})],W.prototype,`fontColorLightnessEnd`,void 0),F([N({type:Array,attribute:`font-colors`,converter:P})],W.prototype,`fontColors`,void 0),W=F([M(`bb-digital-rain`)],W);let $e=[`#c41e3a`,`#e0218a`,`#6a2c9e`,`#3b4fa8`,`#f5c800`],et=[[0,`0, 0, 0`,.5],[.35,`0, 0, 0`,0],[.7,`255, 255, 255`,0],[1,`255, 255, 255`,.85]],tt=.45,G=class extends I{constructor(...e){super(...e),this.washColors=$e,this.slatAmount=27,this.slatAngle=0,this.speed=1,this.trailOpacity=1,this.cleanTrail=!1,this.time=0}loop(e){this.time+=e*(Math.max(0,this.speed)||0),this.drawWash(),this.drawSlats()}drawWash(){let{ctx:e,width:t,height:n}=this,r=this.washColors.length>0?this.washColors:$e,i=.5*Math.hypot(t,n);e.fillStyle=r[0],e.fillRect(0,0,t,n),r.forEach((r,a)=>{let o=.05+a%3*.01,s=t*(.5+tt*Math.sin(this.time*o+a*2.4)),c=n*(.5+tt*Math.cos(this.time*o*1.3+a*1.7)),l=B(r).join(`, `),u=e.createRadialGradient(s,c,0,s,c,i);u.addColorStop(0,`rgba(${l}, 1)`),u.addColorStop(1,`rgba(${l}, 0)`),e.fillStyle=u,e.fillRect(0,0,t,n)})}drawSlats(){let{ctx:e,width:t,height:n}=this,r=(this.slatAngle||0)*Math.PI/180,i=Math.abs(Math.cos(r)),a=Math.abs(Math.sin(r)),o=t*i+n*a,s=t*a+n*i,c=Math.round(this.slatAmount)||2,l=Math.min(Math.max(2,c),Math.max(2,Math.floor(o))),u=o/l;e.save(),e.translate(t/2,n/2),e.rotate(r);for(let t=0;t<l;t++){let n=-o/2+t*u,r=e.createLinearGradient(n,0,n+u,0);for(let[e,t,n]of et)r.addColorStop(e,`rgba(${t}, ${n})`);e.fillStyle=r,e.fillRect(n,-s/2,u,s)}e.restore()}};F([N({type:Array,attribute:`wash-colors`,converter:P})],G.prototype,`washColors`,void 0),F([N({type:Number,attribute:`slat-amount`})],G.prototype,`slatAmount`,void 0),F([N({type:Number,attribute:`slat-angle`})],G.prototype,`slatAngle`,void 0),F([N({type:Number,attribute:`speed`})],G.prototype,`speed`,void 0),G=F([M(`bb-gradient-slats`)],G);let K=class extends I{constructor(...e){super(...e),this.hexSize=50,this.waveAmplitude=5.5,this.waveSpeed=1,this.waveXFactor=-.005,this.waveYFactor=-.005,this.shadeAmplitude=.5,this.shadeLightnessBoost=15,this.baseLightness=10,this.lightnessRange=25,this.hexHueStart=310,this.hexHueEnd=200,this.hexSaturation=100,this.hexScale=1,this.hexColors=[],this.grid=[],this.time=0}updated(e){super.updated(e),e.has(`hexSize`)&&this.initialize()}initialize(){this.grid=[],this.time=0;let e=this.hexSize,t=Math.sqrt(3)*e,n=e*1.5,r=Math.ceil(this.width/t)+2,i=Math.ceil(this.height/n)+2;for(let e=-1;e<i;e++)for(let i=-1;i<r;i++){let r=e%2==0?0:t/2;this.grid.push({x:i*t+r,y:e*n,colorIndex:Math.floor(Math.random()*1e3)})}}loop(e){this.time+=e,this.fadeTrail();for(let e of this.grid)this.drawCell(e)}drawCell(e){let t=e.x*this.waveXFactor,n=e.y*this.waveYFactor,r=Math.sin(this.time*this.waveSpeed+t+n),i=Math.sin(this.time+e.x+e.y)*this.shadeAmplitude,a=this.baseLightness+r*this.lightnessRange+i;this.drawHex(e.x,e.y+r*this.waveAmplitude,this.hexSize*this.hexScale,this.cellFill(e,a))}cellFill(e,t){if(this.hexColors.length>0){let{h:n,s:r}=Be(this.hexColors[e.colorIndex%this.hexColors.length]);return`hsl(${n}, ${r*100}%, ${t}%)`}let n=(e.x+e.y)/(this.width+this.height);return`hsl(${this.hexHueStart+(this.hexHueEnd-this.hexHueStart)*n}, ${this.hexSaturation}%, ${t}%)`}drawHex(e,t,n,r){let i=this.ctx;i.beginPath();for(let r=0;r<6;r++){let a=Math.PI*2/6*r-Math.PI/2,o=e+Math.cos(a)*n,s=t+Math.sin(a)*n;i.lineTo(o,s)}i.closePath(),i.fillStyle=r,i.fill()}};F([N({type:Number,attribute:`hex-size`})],K.prototype,`hexSize`,void 0),F([N({type:Number,attribute:`wave-amplitude`})],K.prototype,`waveAmplitude`,void 0),F([N({type:Number,attribute:`wave-speed`})],K.prototype,`waveSpeed`,void 0),F([N({type:Number,attribute:`wave-x-factor`})],K.prototype,`waveXFactor`,void 0),F([N({type:Number,attribute:`wave-y-factor`})],K.prototype,`waveYFactor`,void 0),F([N({type:Number,attribute:`shade-amplitude`})],K.prototype,`shadeAmplitude`,void 0),F([N({type:Number,attribute:`shade-lightness-boost`})],K.prototype,`shadeLightnessBoost`,void 0),F([N({type:Number,attribute:`base-lightness`})],K.prototype,`baseLightness`,void 0),F([N({type:Number,attribute:`lightness-range`})],K.prototype,`lightnessRange`,void 0),F([N({type:Number,attribute:`hex-hue-start`})],K.prototype,`hexHueStart`,void 0),F([N({type:Number,attribute:`hex-hue-end`})],K.prototype,`hexHueEnd`,void 0),F([N({type:Number,attribute:`hex-saturation`})],K.prototype,`hexSaturation`,void 0),F([N({type:Number,attribute:`hex-scale`})],K.prototype,`hexScale`,void 0),F([N({type:Array,attribute:`hex-colors`,converter:P})],K.prototype,`hexColors`,void 0),K=F([M(`bb-hexagon-wave`)],K);let nt=[`#47d1d1`,`#475ed1`,`#a347d1`],rt=[[0,0],[.2,.5],[.5,.8],[.8,.5],[1,0]],it=[15,2],at=[1,.3],ot=[21,4],st=[.5,.9],q=class extends I{constructor(...e){super(...e),this.shaftColors=nt,this.shaftAmount=100,this.speed=1,this.trailOpacity=1,this.cleanTrail=!1,this.shafts=[],this.builtFor=``}initialize(){let e=Ve(this.shaftColors.length>0?this.shaftColors:nt,64);this.shafts=Array.from({length:this.shaftAmount},()=>this.shaft(e[Math.floor(Math.random()*64)])),this.builtFor=this.settings()}loop(e){this.builtFor!==this.settings()&&this.initialize();let t=this.ctx,n=e*Math.max(0,this.speed);this.fadeTrail(),t.globalCompositeOperation=`lighter`;for(let e of this.shafts){let r=this.width+e.sprite.width;e.x=(e.x+e.speed*n+e.sprite.width)%r-e.sprite.width,t.drawImage(e.sprite,e.x,e.y,e.sprite.width,e.height)}t.globalCompositeOperation=`source-over`}settings(){let{width:e,height:t,shaftAmount:n,shaftColors:r}=this;return`${e} ${t} ${n} ${r.join(`,`)}`}shaft(e){let t=Math.random(),n=ct(it,t),r=document.createElement(`canvas`);r.width=Math.ceil(n+40),r.height=64;let i=r.getContext(`2d`),[a,o,s]=B(e),c=i.createLinearGradient(0,0,0,64);for(let[e,n]of rt){let r=n*ct(at,t);c.addColorStop(e,`rgba(${a}, ${o}, ${s}, ${r})`)}return i.fillStyle=c,i.shadowBlur=10,i.shadowColor=e,i.fillRect(20,0,n,64),{x:L(-r.width,this.width),y:L(0,.5*this.height),height:this.height*L(...st),speed:ct(ot,t),sprite:r}}};F([N({type:Array,attribute:`shaft-colors`,converter:P})],q.prototype,`shaftColors`,void 0),F([N({type:Number,attribute:`shaft-amount`})],q.prototype,`shaftAmount`,void 0),F([N({type:Number,attribute:`speed`})],q.prototype,`speed`,void 0),q=F([M(`bb-light-shafts`)],q);function ct([e,t],n){return e+(t-e)*n}let J=class extends I{constructor(...e){super(...e),this.lineCount=20,this.lineAmplitude=30,this.lineFrequency=.005,this.speed=.5,this.lineSpacing=40,this.lineWidth=2,this.lineHueStart=200,this.lineHueEnd=280,this.lineSaturation=80,this.lineOffsetStep=.2,this.wiggleAmplitude=20,this.wiggleSpeed=.3,this.lineColors=[],this.time=0}loop(e){this.time+=e,this.fadeTrail();let t=this.height/2-this.lineCount*this.lineSpacing/2;for(let e=0;e<this.lineCount;e++)this.drawLine(e,t+e*this.lineSpacing)}drawLine(e,t){let n=this.ctx,r=this.width/99,i=e*this.lineOffsetStep,a=Math.sin(this.time*this.wiggleSpeed+i+e)*this.wiggleAmplitude,o=e=>t+Math.sin(e*this.lineFrequency+this.time*this.speed+i)*this.lineAmplitude+a;n.beginPath(),n.strokeStyle=this.lineColor(e),n.moveTo(0,o(0));for(let e=0;e<99;e++){let t=e*r,i=(e+1)*r,a=o(t);n.quadraticCurveTo(t,a,(t+i)/2,(a+o(i))/2)}He(n,this.lineWidth)}lineColor(e){let t=40+Math.sin(this.time*.001+e*.5)*10;if(this.lineColors.length>0){let{h:n,s:r}=Be(this.lineColors[e%this.lineColors.length]);return`hsl(${n}, ${r*100}%, ${t}%)`}let n=e/this.lineCount;return`hsl(${this.lineHueStart+(this.lineHueEnd-this.lineHueStart)*n}, ${this.lineSaturation}%, ${t}%)`}};F([N({type:Number,attribute:`line-count`})],J.prototype,`lineCount`,void 0),F([N({type:Number,attribute:`line-amplitude`})],J.prototype,`lineAmplitude`,void 0),F([N({type:Number,attribute:`line-frequency`})],J.prototype,`lineFrequency`,void 0),F([N({type:Number,attribute:`speed`})],J.prototype,`speed`,void 0),F([N({type:Number,attribute:`line-spacing`})],J.prototype,`lineSpacing`,void 0),F([N({type:Number,attribute:`line-width`})],J.prototype,`lineWidth`,void 0),F([N({type:Number,attribute:`line-hue-start`})],J.prototype,`lineHueStart`,void 0),F([N({type:Number,attribute:`line-hue-end`})],J.prototype,`lineHueEnd`,void 0),F([N({type:Number,attribute:`line-saturation`})],J.prototype,`lineSaturation`,void 0),F([N({type:Number,attribute:`line-offset-step`})],J.prototype,`lineOffsetStep`,void 0),F([N({type:Number,attribute:`wiggle-amplitude`})],J.prototype,`wiggleAmplitude`,void 0),F([N({type:Number,attribute:`wiggle-speed`})],J.prototype,`wiggleSpeed`,void 0),F([N({type:Array,attribute:`line-colors`,converter:P})],J.prototype,`lineColors`,void 0),J=F([M(`bb-liquid-lines`)],J);var lt=class{constructor(e){this.initialized=!1,this.railFromX=0,this.railFromY=0,this.railToX=0,this.railToY=0,this.railProgress=0,this.size=e.size,this.speed=e.speed,this.color=e.color,this.radius=e.radius??1,this.angle=e.angle,this.lifespan=e.lifespan,this.force=e.force??1,this.gridSides=e.gridSides,this.gridSize=e.gridSize,this.gridAngle=e.gridAngle,this.x=e.x??0,this.y=e.y??0,this.px=this.x,this.py=this.y,this.born=Date.now(),this.fadeInDuration=this.lifespan*.25,this.fadeOutDuration=this.lifespan*.5}circularMove(e,t,n){this.angle+=this.speed*n,this.radius+=this.force*n,this.updatePosition(e+Math.cos(this.angle)*this.radius,t+Math.sin(this.angle)*this.radius)}draw(e){e.globalAlpha=this.calculateOpacity(),e.beginPath(),e.lineCap=`round`,e.strokeStyle=this.color,e.moveTo(this.px,this.py),e.lineTo(this.x,this.y),He(e,this.size*2),e.globalAlpha=1}isDead(){return Date.now()-this.born>this.lifespan}railMove(e,t,n){this.initialized||this.enterRail(e,t);let r=Math.abs(this.speed)*20;this.railProgress+=r/this.gridSize*n,this.railProgress>=1&&(--this.railProgress,this.railFromX=this.railToX,this.railFromY=this.railToY,this.pickNextRailTarget()),this.updatePosition(this.railFromX+(this.railToX-this.railFromX)*this.railProgress,this.railFromY+(this.railToY-this.railFromY)*this.railProgress)}enterRail(e,t){let n=this.snapToGrid(this.x,this.y,e,t);this.railFromX=n.x,this.railFromY=n.y,this.railProgress=0,this.pickNextRailTarget(),this.updatePosition(n.x,n.y)}pickNextRailTarget(){let e=Math.PI*2/this.gridSides,t=Math.floor(Math.random()*this.gridSides)*e+this.gridAngle;this.railToX=this.railFromX+Math.cos(t)*this.gridSize,this.railToY=this.railFromY+Math.sin(t)*this.gridSize}snapToGrid(e,t,n,r){let i=ut(e-n,t-r,-this.gridAngle),a=this.nearestNode(i.x,i.y),o=ut(a.x,a.y,this.gridAngle);return{x:o.x+n,y:o.y+r}}nearestNode(e,t){let n=this.gridSize;if(this.gridSides===6||this.gridSides===3){let r=n*Math.sqrt(3)/2,i=Math.round(t/r);return{x:Math.round((e-i*n/2)/n)*n+i*n/2,y:i*r}}return this.gridSides===4?{x:Math.round(e/n)*n,y:Math.round(t/n)*n}:{x:e,y:t}}updatePosition(e,t){this.initialized?(this.px=this.x,this.py=this.y,this.x=e,this.y=t):(this.x=e,this.y=t,this.px=e,this.py=t,this.initialized=!0)}calculateOpacity(){let e=Date.now()-this.born;return e<this.fadeInDuration?e/this.fadeInDuration:e>this.lifespan-this.fadeOutDuration?(this.lifespan-e)/this.fadeOutDuration:1}};function ut(e,t,n){let r=Math.cos(n),i=Math.sin(n);return{x:e*r-t*i,y:e*i+t*r}}var Y=class extends I{constructor(...e){super(...e),this.particleSizeMin=1,this.particleSizeMax=1,this.particleSpeedMin=-30,this.particleSpeedMax=30,this.particleColorHueStart=130,this.particleColorHueEnd=300,this.particleColorSaturationStart=100,this.particleColorSaturationEnd=100,this.particleColorLightnessStart=50,this.particleColorLightnessEnd=0,this.particleLifespanMin=100,this.particleLifespanMax=5e4,this.particleAmount=2e3,this.gridSides=3,this.gridSize=60,this.gridAngle=Math.PI/2,this.particleColors=[],this.particles=[]}initialize(){this.particles=[],this.drawBackground(this.ctx),this.replenish()}loop(e){this.fadeTrail(),this.particles=this.particles.filter(e=>!e.isDead()),this.replenish(),this.particles.forEach(t=>{this.move(t,e),t.draw(this.ctx)})}createParticle(){return new lt({size:L(this.particleSizeMin,this.particleSizeMax),speed:L(this.particleSpeedMin,this.particleSpeedMax),lifespan:L(this.particleLifespanMin,this.particleLifespanMax),color:this.particleColor(),gridSides:this.gridSides,gridSize:this.gridSize,gridAngle:this.gridAngle,...this.placement()})}replenish(){for(;this.particles.length<this.particleAmount;)this.particles.push(this.createParticle())}particleColor(){return this.particleColors.length>0?this.particleColors[Math.floor(Math.random()*this.particleColors.length)]:Re([this.particleColorHueStart,this.particleColorHueEnd],[this.particleColorSaturationStart,this.particleColorSaturationEnd],[this.particleColorLightnessStart,this.particleColorLightnessEnd])}};F([N({type:Number,attribute:`particle-size-min`})],Y.prototype,`particleSizeMin`,void 0),F([N({type:Number,attribute:`particle-size-max`})],Y.prototype,`particleSizeMax`,void 0),F([N({type:Number,attribute:`particle-speed-min`})],Y.prototype,`particleSpeedMin`,void 0),F([N({type:Number,attribute:`particle-speed-max`})],Y.prototype,`particleSpeedMax`,void 0),F([N({type:Number,attribute:`particle-color-hue-start`})],Y.prototype,`particleColorHueStart`,void 0),F([N({type:Number,attribute:`particle-color-hue-end`})],Y.prototype,`particleColorHueEnd`,void 0),F([N({type:Number,attribute:`particle-color-saturation-start`})],Y.prototype,`particleColorSaturationStart`,void 0),F([N({type:Number,attribute:`particle-color-saturation-end`})],Y.prototype,`particleColorSaturationEnd`,void 0),F([N({type:Number,attribute:`particle-color-lightness-start`})],Y.prototype,`particleColorLightnessStart`,void 0),F([N({type:Number,attribute:`particle-color-lightness-end`})],Y.prototype,`particleColorLightnessEnd`,void 0),F([N({type:Number,attribute:`particle-lifespan-min`})],Y.prototype,`particleLifespanMin`,void 0),F([N({type:Number,attribute:`particle-lifespan-max`})],Y.prototype,`particleLifespanMax`,void 0),F([N({type:Number,attribute:`particle-amount`})],Y.prototype,`particleAmount`,void 0),F([N({type:Number,attribute:`grid-sides`})],Y.prototype,`gridSides`,void 0),F([N({type:Number,attribute:`grid-size`})],Y.prototype,`gridSize`,void 0),F([N({type:Number,attribute:`grid-angle`})],Y.prototype,`gridAngle`,void 0),F([N({type:Array,attribute:`particle-colors`,converter:P})],Y.prototype,`particleColors`,void 0);let X=class extends Y{constructor(...e){super(...e),this.trailOpacity=.0125}move(e,t){e.railMove(this.width/2,this.height/2,t)}placement(){let e=L(0,this.width),t=L(0,this.height);return{angle:Math.atan2(t-this.height/2,e-this.width/2),x:e,y:t}}};F([N({type:Number,attribute:`trail-opacity`})],X.prototype,`trailOpacity`,void 0),X=F([M(`bb-neon-rails`)],X);let dt=`#005588`,ft=.65,pt=[[1.1,.9,.7,1],[-.7,1.4,1.3,.55],[2.1,.5,.5,.3]],mt=pt.reduce((e,[,,,t])=>e+t,0),Z=class extends I{constructor(...e){super(...e),this.silkColor=dt,this.swell=.2,this.sheen=.73,this.reach=ft,this.speed=1,this.trailOpacity=1,this.cleanTrail=!1,this.time=0}loop(e){let t=Math.min(e,.06666666666666667)*Math.max(0,this.speed);this.time+=t||0,this.drawSea()}drawSea(){if(!this.width||!this.height)return;let e=Math.max(0,this.swell)||0,t=Math.min(1,Math.max(0,this.sheen))||0,n=this.reach>0?this.reach:ft,{h:r,s:i,l:a}=Be(this.silkColor||dt),o=Math.min(.95,a+.55*t),s=Math.min(.5,Math.max(.01,.06/n)),c=s*s,l=this.ctx;this.fadeTrail();for(let t=0;t<64;t++){let s=c+(1-c)*(t/64);this.paintRow(l,this.curve(s,e,n),r,i,a,o,Math.min(1,s/.22))}l.globalAlpha=1}curve(e,t,n){let{width:r,height:i}=this,a=i*(.2+.8600000000000001*e),o=r*(.55+.45*e),s=t*i*e/n,c=t=>t*3*n/e,l=20*n/e,u={xs:[],ys:[],swells:[]};for(let e=0;e<=48;e++){let t=e/48*2-1,n=ht(c(t),l,this.time);u.xs.push(r/2+t*o),u.ys.push(a-s*n),u.swells.push(n)}return u}paintRow(e,t,n,r,i,a,o){let s=t.xs[0],c=t.xs[48],l=e.createLinearGradient(s,0,c,0);t.swells.forEach((e,o)=>{let u=(t.xs[o]-s)/(c-s),d=i+(a-i)*((e+1)/2);l.addColorStop(u,`hsl(${Math.round(n)}, ${Math.round(r*100)}%, ${(d*100).toFixed(1)}%)`)}),e.beginPath(),t.xs.forEach((n,r)=>{r===0?e.moveTo(n,t.ys[r]):e.lineTo(n,t.ys[r])}),e.lineTo(c,this.height+1),e.lineTo(s,this.height+1),e.closePath(),e.globalAlpha=o,e.fillStyle=l,e.fill()}};F([N({type:String,attribute:`silk-color`})],Z.prototype,`silkColor`,void 0),F([N({type:Number,attribute:`swell`})],Z.prototype,`swell`,void 0),F([N({type:Number,attribute:`sheen`})],Z.prototype,`sheen`,void 0),F([N({type:Number,attribute:`reach`})],Z.prototype,`reach`,void 0),F([N({type:Number,attribute:`speed`})],Z.prototype,`speed`,void 0),Z=F([M(`bb-silk-waves`)],Z);function ht(e,t,n){let r=0;for(let[i,a,o,s]of pt)r+=s*Math.sin(i*e+a*t+o*n);return r/mt}let gt=[`#b24c8b`,`#9f972d`,`#68c44f`,`#15caa8`,`#00abea`,`#156aff`,`#6810ff`,`#9f00d7`],_t=.001,vt=.35,yt=.01,bt=.2,Q=class extends I{constructor(...e){super(...e),this.ringColors=gt,this.ringSize=.2,this.ringWobble=.03,this.speed=1,this.trailOpacity=.005,this.cleanTrail=!1,this.time=0,this.columns=0,this.rows=0,this.smoke=/* @__PURE__ */ new Float32Array,this.next=/* @__PURE__ */ new Float32Array,this.soft=/* @__PURE__ */ new Float32Array,this.image=new ImageData(1,1),this.buffer=document.createElement(`canvas`),this.builtFor=``}initialize(){let e=Math.min(1,Math.sqrt(15e4/(this.width*this.height)));this.columns=Math.max(1,Math.round(this.width*e)),this.rows=Math.max(1,Math.round(this.height*e)),this.smoke=new Float32Array(this.columns*this.rows*3),this.next=new Float32Array(this.smoke.length),this.soft=new Float32Array(this.smoke.length),this.image=new ImageData(this.columns,this.rows),this.buffer.width=this.columns,this.buffer.height=this.rows,this.builtFor=this.size()}loop(e){this.builtFor!==this.size()&&this.initialize();let t=Math.min(e,.06666666666666667)*Math.max(0,this.speed);this.time+=t,this.drift(60*t),this.shine(60*t),this.soften(),this.show()}size(){return`${this.width} ${this.height}`}drift(e){let{columns:t,rows:n,soft:r}=this,i=.996**e,a=Math.min(1,Math.max(0,this.trailOpacity)),o=(1-a)**e,s=.3*a*e,c=yt*t*e,l=yt*n*e,u=(t-1)/2,d=(n-1)/2,f=_t*t*e*Math.cos(vt*this.time),p=_t*n*e*Math.sin(vt*this.time);this.next.fill(0);for(let e=0;e<n;e++)for(let n=0;n<t;n++){let a=(e*t+n)*3;this.takeSmoke(u+(n-u)*i+f,d+(e-d)*i+p,.6,a),this.takeSmoke(n+(r[a+1]-bt)*c,e-(r[a]-bt)*l,.4,a);for(let e=a;e<a+3;e++)this.next[e]=Math.max(0,this.next[e]-s)*o}[this.smoke,this.next]=[this.next,this.smoke]}takeSmoke(e,t,n,r){let{columns:i,rows:a,smoke:o}=this;e=Math.min(Math.max(e,0),i-1),t=Math.min(Math.max(t,0),a-1);let s=Math.floor(e),c=Math.floor(t),l=Math.min(s+1,i-1),u=Math.min(c+1,a-1),d=e-s,f=t-c,p=(c*i+s)*3,ee=(c*i+l)*3,m=(u*i+s)*3,h=(u*i+l)*3;for(let e=0;e<3;e++){let t=o[p+e]+(o[ee+e]-o[p+e])*d,i=o[m+e]+(o[h+e]-o[m+e])*d;this.next[r+e]+=(t+(i-t)*f)*n}}shine(e){let t=this.ringColor(),n=this.ringSize*Math.min(this.columns,this.rows),r=(this.columns-1)/2,i=(this.rows-1)/2,a=this.ringWobble*Math.sin(1.5*this.time),o=.5*this.time,s=.6-Math.abs(a),c=1+Math.abs(a);for(let l=0;l<this.rows;l++)for(let u=0;u<this.columns;u++){let d=Math.hypot(u-r,l-i)/n;if(!(d>=s&&d<=c))continue;let f=Math.atan2(l-i,u-r),p=a*Math.sin(7*f+o),ee=xt(Math.abs(d+p))*e,m=(l*this.columns+u)*3;for(let e=0;e<3;e++){let n=this.smoke[m+e]+t[e]*ee;this.smoke[m+e]=Math.min(1,n)}}}ringColor(){let e=(this.ringColors.length>0?this.ringColors:gt).map(B),t=this.time/3%1*e.length,n=e[Math.floor(t)],r=e[(Math.floor(t)+1)%e.length],i=t-Math.floor(t);return n.map((e,t)=>(e+(r[t]-e)*i)/255)}soften(){let{columns:e,rows:t,smoke:n}=this;for(let r=0;r<t;r++){let i=Math.max(r-1,0)*e,a=Math.min(r+1,t-1)*e;for(let t=0;t<e;t++){let o=(r*e+t)*3,s=(r*e+Math.max(t-1,0))*3,c=(r*e+Math.min(t+1,e-1))*3,l=(i+t)*3,u=(a+t)*3;for(let e=0;e<3;e++)this.soft[o+e]=(n[o+e]+n[s+e]+n[c+e]+n[l+e]+n[u+e])/5}}}show(){let e=this.image.data;for(let t=0,n=0;t<this.soft.length;t+=3,n+=4)e[n]=this.soft[t]*255,e[n+1]=this.soft[t+1]*255,e[n+2]=this.soft[t+2]*255,e[n+3]=255;this.buffer.getContext(`2d`).putImageData(this.image,0,0);let t=this.ctx;this.drawBackground(t),t.globalCompositeOperation=`lighter`,t.drawImage(this.buffer,0,0,this.width,this.height),t.globalCompositeOperation=`source-over`}};F([N({type:Array,attribute:`ring-colors`,converter:P})],Q.prototype,`ringColors`,void 0),F([N({type:Number,attribute:`ring-size`})],Q.prototype,`ringSize`,void 0),F([N({type:Number,attribute:`ring-wobble`})],Q.prototype,`ringWobble`,void 0),F([N({type:Number,attribute:`speed`})],Q.prototype,`speed`,void 0),Q=F([M(`bb-smoke-ring`)],Q);function xt(e){let t=Math.min(1,Math.max(0,(1-e)/.1));return e**20*t*t*(3-2*t)}let $=class extends Y{constructor(...e){super(...e),this.particleForce=0,this.particleRadiusMin=1,this.particleRadiusMax=100,this.particleSizeMin=.5,this.particleSizeMax=1.5,this.particleSpeedMin=.025,this.particleSpeedMax=.05,this.particleColorHueStart=30,this.particleColorHueEnd=75,this.particleColorLightnessEnd=50,this.particleLifespanMin=1e3,this.particleLifespanMax=1e4,this.particleAmount=1e3,this.gridSides=6,this.gridSize=40,this.gridAngle=0}initialize(){this.particleRadiusMax=this.particleRadiusMax||this.width,super.initialize()}move(e,t){e.circularMove(this.width/2,this.height/2,t)}placement(){let e=L(0,Math.PI*2),t=this.particleRadiusMax-this.particleRadiusMin;return{angle:e,radius:Math.sqrt(Math.random())*t+this.particleRadiusMin,force:this.particleForce}}};F([N({type:Number,attribute:`particle-force`})],$.prototype,`particleForce`,void 0),F([N({type:Number,attribute:`particle-radius-min`})],$.prototype,`particleRadiusMin`,void 0),F([N({type:Number,attribute:`particle-radius-max`})],$.prototype,`particleRadiusMax`,void 0),$=F([M(`bb-star-trail`)],$),Object.defineProperty(e,"BbAmbientRibbon",{enumerable:!0,get:function(){return V}}),Object.defineProperty(e,"BbContourFlow",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"BbDigitalRain",{enumerable:!0,get:function(){return W}}),Object.defineProperty(e,"BbGradientSlats",{enumerable:!0,get:function(){return G}}),Object.defineProperty(e,"BbHexagonWave",{enumerable:!0,get:function(){return K}}),Object.defineProperty(e,"BbLightShafts",{enumerable:!0,get:function(){return q}}),Object.defineProperty(e,"BbLiquidLines",{enumerable:!0,get:function(){return J}}),Object.defineProperty(e,"BbNeonRails",{enumerable:!0,get:function(){return X}}),Object.defineProperty(e,"BbSilkWaves",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(e,"BbSmokeRing",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(e,"BbStarTrail",{enumerable:!0,get:function(){return $}}),e.BeautifulBackground=I});
|
|
8
50
|
//# sourceMappingURL=bb.js.map
|