beautiful-backgrounds 1.0.0 → 2.0.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 +107 -62
- package/build/bb.es.js +45 -3034
- package/build/bb.es.js.map +1 -1
- package/build/bb.js +46 -5
- package/build/bb.js.map +1 -1
- package/build/index.d.ts +454 -7
- package/package.json +70 -51
- 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/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/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.es.js
CHANGED
|
@@ -1,3038 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})(t) : t;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
case Array:
|
|
45
|
-
t = t == null ? t : JSON.stringify(t);
|
|
46
|
-
}
|
|
47
|
-
return t;
|
|
48
|
-
}, fromAttribute(t, e) {
|
|
49
|
-
let i = t;
|
|
50
|
-
switch (e) {
|
|
51
|
-
case Boolean:
|
|
52
|
-
i = t !== null;
|
|
53
|
-
break;
|
|
54
|
-
case Number:
|
|
55
|
-
i = t === null ? null : Number(t);
|
|
56
|
-
break;
|
|
57
|
-
case Object:
|
|
58
|
-
case Array:
|
|
59
|
-
try {
|
|
60
|
-
i = JSON.parse(t);
|
|
61
|
-
} catch {
|
|
62
|
-
i = null;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return i;
|
|
66
|
-
} }, oe = (t, e) => !Ai(t, e), ve = { attribute: !0, type: String, converter: Ot, reflect: !1, useDefault: !1, hasChanged: oe };
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), Ut.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
-
let tt = class extends HTMLElement {
|
|
69
|
-
static addInitializer(e) {
|
|
70
|
-
this._$Ei(), (this.l ??= []).push(e);
|
|
71
|
-
}
|
|
72
|
-
static get observedAttributes() {
|
|
73
|
-
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
74
|
-
}
|
|
75
|
-
static createProperty(e, i = ve) {
|
|
76
|
-
if (i.state && (i.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((i = Object.create(i)).wrapped = !0), this.elementProperties.set(e, i), !i.noAccessor) {
|
|
77
|
-
const r = /* @__PURE__ */ Symbol(), n = this.getPropertyDescriptor(e, r, i);
|
|
78
|
-
n !== void 0 && Ci(this.prototype, e, n);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
static getPropertyDescriptor(e, i, r) {
|
|
82
|
-
const { get: n, set: s } = Mi(this.prototype, e) ?? { get() {
|
|
83
|
-
return this[i];
|
|
84
|
-
}, set(o) {
|
|
85
|
-
this[i] = o;
|
|
86
|
-
} };
|
|
87
|
-
return { get: n, set(o) {
|
|
88
|
-
const a = n?.call(this);
|
|
89
|
-
s?.call(this, o), this.requestUpdate(e, a, r);
|
|
90
|
-
}, configurable: !0, enumerable: !0 };
|
|
91
|
-
}
|
|
92
|
-
static getPropertyOptions(e) {
|
|
93
|
-
return this.elementProperties.get(e) ?? ve;
|
|
94
|
-
}
|
|
95
|
-
static _$Ei() {
|
|
96
|
-
if (this.hasOwnProperty(ft("elementProperties"))) return;
|
|
97
|
-
const e = Pi(this);
|
|
98
|
-
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
99
|
-
}
|
|
100
|
-
static finalize() {
|
|
101
|
-
if (this.hasOwnProperty(ft("finalized"))) return;
|
|
102
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ft("properties"))) {
|
|
103
|
-
const i = this.properties, r = [...Ei(i), ...Ni(i)];
|
|
104
|
-
for (const n of r) this.createProperty(n, i[n]);
|
|
105
|
-
}
|
|
106
|
-
const e = this[Symbol.metadata];
|
|
107
|
-
if (e !== null) {
|
|
108
|
-
const i = litPropertyMetadata.get(e);
|
|
109
|
-
if (i !== void 0) for (const [r, n] of i) this.elementProperties.set(r, n);
|
|
110
|
-
}
|
|
111
|
-
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
|
-
for (const [i, r] of this.elementProperties) {
|
|
113
|
-
const n = this._$Eu(i, r);
|
|
114
|
-
n !== void 0 && this._$Eh.set(n, i);
|
|
115
|
-
}
|
|
116
|
-
this.elementStyles = this.finalizeStyles(this.styles);
|
|
117
|
-
}
|
|
118
|
-
static finalizeStyles(e) {
|
|
119
|
-
const i = [];
|
|
120
|
-
if (Array.isArray(e)) {
|
|
121
|
-
const r = new Set(e.flat(1 / 0).reverse());
|
|
122
|
-
for (const n of r) i.unshift(_e(n));
|
|
123
|
-
} else e !== void 0 && i.push(_e(e));
|
|
124
|
-
return i;
|
|
125
|
-
}
|
|
126
|
-
static _$Eu(e, i) {
|
|
127
|
-
const r = i.attribute;
|
|
128
|
-
return r === !1 ? void 0 : typeof r == "string" ? r : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
129
|
-
}
|
|
130
|
-
constructor() {
|
|
131
|
-
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
132
|
-
}
|
|
133
|
-
_$Ev() {
|
|
134
|
-
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
|
|
135
|
-
}
|
|
136
|
-
addController(e) {
|
|
137
|
-
(this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
|
|
138
|
-
}
|
|
139
|
-
removeController(e) {
|
|
140
|
-
this._$EO?.delete(e);
|
|
141
|
-
}
|
|
142
|
-
_$E_() {
|
|
143
|
-
const e = /* @__PURE__ */ new Map(), i = this.constructor.elementProperties;
|
|
144
|
-
for (const r of i.keys()) this.hasOwnProperty(r) && (e.set(r, this[r]), delete this[r]);
|
|
145
|
-
e.size > 0 && (this._$Ep = e);
|
|
146
|
-
}
|
|
147
|
-
createRenderRoot() {
|
|
148
|
-
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return $i(e, this.constructor.elementStyles), e;
|
|
150
|
-
}
|
|
151
|
-
connectedCallback() {
|
|
152
|
-
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
|
|
153
|
-
}
|
|
154
|
-
enableUpdating(e) {
|
|
155
|
-
}
|
|
156
|
-
disconnectedCallback() {
|
|
157
|
-
this._$EO?.forEach((e) => e.hostDisconnected?.());
|
|
158
|
-
}
|
|
159
|
-
attributeChangedCallback(e, i, r) {
|
|
160
|
-
this._$AK(e, r);
|
|
161
|
-
}
|
|
162
|
-
_$ET(e, i) {
|
|
163
|
-
const r = this.constructor.elementProperties.get(e), n = this.constructor._$Eu(e, r);
|
|
164
|
-
if (n !== void 0 && r.reflect === !0) {
|
|
165
|
-
const s = (r.converter?.toAttribute !== void 0 ? r.converter : Ot).toAttribute(i, r.type);
|
|
166
|
-
this._$Em = e, s == null ? this.removeAttribute(n) : this.setAttribute(n, s), this._$Em = null;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
_$AK(e, i) {
|
|
170
|
-
const r = this.constructor, n = r._$Eh.get(e);
|
|
171
|
-
if (n !== void 0 && this._$Em !== n) {
|
|
172
|
-
const s = r.getPropertyOptions(n), o = typeof s.converter == "function" ? { fromAttribute: s.converter } : s.converter?.fromAttribute !== void 0 ? s.converter : Ot;
|
|
173
|
-
this._$Em = n;
|
|
174
|
-
const a = o.fromAttribute(i, s.type);
|
|
175
|
-
this[n] = a ?? this._$Ej?.get(n) ?? a, this._$Em = null;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
requestUpdate(e, i, r, n = !1, s) {
|
|
179
|
-
if (e !== void 0) {
|
|
180
|
-
const o = this.constructor;
|
|
181
|
-
if (n === !1 && (s = this[e]), r ??= o.getPropertyOptions(e), !((r.hasChanged ?? oe)(s, i) || r.useDefault && r.reflect && s === this._$Ej?.get(e) && !this.hasAttribute(o._$Eu(e, r)))) return;
|
|
182
|
-
this.C(e, i, r);
|
|
183
|
-
}
|
|
184
|
-
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
185
|
-
}
|
|
186
|
-
C(e, i, { useDefault: r, reflect: n, wrapped: s }, o) {
|
|
187
|
-
r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, o ?? i ?? this[e]), s !== !0 || o !== void 0) || (this._$AL.has(e) || (this.hasUpdated || r || (i = void 0), this._$AL.set(e, i)), n === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
188
|
-
}
|
|
189
|
-
async _$EP() {
|
|
190
|
-
this.isUpdatePending = !0;
|
|
191
|
-
try {
|
|
192
|
-
await this._$ES;
|
|
193
|
-
} catch (i) {
|
|
194
|
-
Promise.reject(i);
|
|
195
|
-
}
|
|
196
|
-
const e = this.scheduleUpdate();
|
|
197
|
-
return e != null && await e, !this.isUpdatePending;
|
|
198
|
-
}
|
|
199
|
-
scheduleUpdate() {
|
|
200
|
-
return this.performUpdate();
|
|
201
|
-
}
|
|
202
|
-
performUpdate() {
|
|
203
|
-
if (!this.isUpdatePending) return;
|
|
204
|
-
if (!this.hasUpdated) {
|
|
205
|
-
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
206
|
-
for (const [n, s] of this._$Ep) this[n] = s;
|
|
207
|
-
this._$Ep = void 0;
|
|
208
|
-
}
|
|
209
|
-
const r = this.constructor.elementProperties;
|
|
210
|
-
if (r.size > 0) for (const [n, s] of r) {
|
|
211
|
-
const { wrapped: o } = s, a = this[n];
|
|
212
|
-
o !== !0 || this._$AL.has(n) || a === void 0 || this.C(n, void 0, s, a);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
let e = !1;
|
|
216
|
-
const i = this._$AL;
|
|
217
|
-
try {
|
|
218
|
-
e = this.shouldUpdate(i), e ? (this.willUpdate(i), this._$EO?.forEach((r) => r.hostUpdate?.()), this.update(i)) : this._$EM();
|
|
219
|
-
} catch (r) {
|
|
220
|
-
throw e = !1, this._$EM(), r;
|
|
221
|
-
}
|
|
222
|
-
e && this._$AE(i);
|
|
223
|
-
}
|
|
224
|
-
willUpdate(e) {
|
|
225
|
-
}
|
|
226
|
-
_$AE(e) {
|
|
227
|
-
this._$EO?.forEach((i) => i.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
228
|
-
}
|
|
229
|
-
_$EM() {
|
|
230
|
-
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
231
|
-
}
|
|
232
|
-
get updateComplete() {
|
|
233
|
-
return this.getUpdateComplete();
|
|
234
|
-
}
|
|
235
|
-
getUpdateComplete() {
|
|
236
|
-
return this._$ES;
|
|
237
|
-
}
|
|
238
|
-
shouldUpdate(e) {
|
|
239
|
-
return !0;
|
|
240
|
-
}
|
|
241
|
-
update(e) {
|
|
242
|
-
this._$Eq &&= this._$Eq.forEach((i) => this._$ET(i, this[i])), this._$EM();
|
|
243
|
-
}
|
|
244
|
-
updated(e) {
|
|
245
|
-
}
|
|
246
|
-
firstUpdated(e) {
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
tt.elementStyles = [], tt.shadowRootOptions = { mode: "open" }, tt[ft("elementProperties")] = /* @__PURE__ */ new Map(), tt[ft("finalized")] = /* @__PURE__ */ new Map(), zi?.({ ReactiveElement: tt }), (Ut.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
-
const ae = globalThis, we = (t) => t, Rt = ae.trustedTypes, Se = Rt ? Rt.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, We = "$lit$", B = `lit$${Math.random().toFixed(9).slice(2)}$`, Ve = "?" + B, Oi = `<${Ve}>`, Z = document, gt = () => Z.createComment(""), yt = (t) => t === null || typeof t != "object" && typeof t != "function", he = Array.isArray, Ri = (t) => he(t) || typeof t?.[Symbol.iterator] == "function", Gt = `[
|
|
251
|
-
\f\r]`, ht = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, $e = /-->/g, Ae = />/g, W = RegExp(`>|${Gt}(?:([^\\s"'>=/]+)(${Gt}*=${Gt}*(?:[^
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ce = /'/g, Me = /"/g, Ge = /^(?:script|style|textarea|title)$/i, it = /* @__PURE__ */ Symbol.for("lit-noChange"), v = /* @__PURE__ */ Symbol.for("lit-nothing"), Ee = /* @__PURE__ */ new WeakMap(), V = Z.createTreeWalker(Z, 129);
|
|
253
|
-
function Ke(t, e) {
|
|
254
|
-
if (!he(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
-
return Se !== void 0 ? Se.createHTML(e) : e;
|
|
256
|
-
}
|
|
257
|
-
const Ti = (t, e) => {
|
|
258
|
-
const i = t.length - 1, r = [];
|
|
259
|
-
let n, s = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = ht;
|
|
260
|
-
for (let a = 0; a < i; a++) {
|
|
261
|
-
const h = t[a];
|
|
262
|
-
let l, c, u = -1, f = 0;
|
|
263
|
-
for (; f < h.length && (o.lastIndex = f, c = o.exec(h), c !== null); ) f = o.lastIndex, o === ht ? c[1] === "!--" ? o = $e : c[1] !== void 0 ? o = Ae : c[2] !== void 0 ? (Ge.test(c[2]) && (n = RegExp("</" + c[2], "g")), o = W) : c[3] !== void 0 && (o = W) : o === W ? c[0] === ">" ? (o = n ?? ht, u = -1) : c[1] === void 0 ? u = -2 : (u = o.lastIndex - c[2].length, l = c[1], o = c[3] === void 0 ? W : c[3] === '"' ? Me : Ce) : o === Me || o === Ce ? o = W : o === $e || o === Ae ? o = ht : (o = W, n = void 0);
|
|
264
|
-
const d = o === W && t[a + 1].startsWith("/>") ? " " : "";
|
|
265
|
-
s += o === ht ? h + Oi : u >= 0 ? (r.push(l), h.slice(0, u) + We + h.slice(u) + B + d) : h + B + (u === -2 ? a : d);
|
|
266
|
-
}
|
|
267
|
-
return [Ke(t, s + (t[i] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
|
|
268
|
-
};
|
|
269
|
-
class bt {
|
|
270
|
-
constructor({ strings: e, _$litType$: i }, r) {
|
|
271
|
-
let n;
|
|
272
|
-
this.parts = [];
|
|
273
|
-
let s = 0, o = 0;
|
|
274
|
-
const a = e.length - 1, h = this.parts, [l, c] = Ti(e, i);
|
|
275
|
-
if (this.el = bt.createElement(l, r), V.currentNode = this.el.content, i === 2 || i === 3) {
|
|
276
|
-
const u = this.el.content.firstChild;
|
|
277
|
-
u.replaceWith(...u.childNodes);
|
|
278
|
-
}
|
|
279
|
-
for (; (n = V.nextNode()) !== null && h.length < a; ) {
|
|
280
|
-
if (n.nodeType === 1) {
|
|
281
|
-
if (n.hasAttributes()) for (const u of n.getAttributeNames()) if (u.endsWith(We)) {
|
|
282
|
-
const f = c[o++], d = n.getAttribute(u).split(B), g = /([.?@])?(.*)/.exec(f);
|
|
283
|
-
h.push({ type: 1, index: s, name: g[2], strings: d, ctor: g[1] === "." ? Fi : g[1] === "?" ? ki : g[1] === "@" ? Ii : Xt }), n.removeAttribute(u);
|
|
284
|
-
} else u.startsWith(B) && (h.push({ type: 6, index: s }), n.removeAttribute(u));
|
|
285
|
-
if (Ge.test(n.tagName)) {
|
|
286
|
-
const u = n.textContent.split(B), f = u.length - 1;
|
|
287
|
-
if (f > 0) {
|
|
288
|
-
n.textContent = Rt ? Rt.emptyScript : "";
|
|
289
|
-
for (let d = 0; d < f; d++) n.append(u[d], gt()), V.nextNode(), h.push({ type: 2, index: ++s });
|
|
290
|
-
n.append(u[f], gt());
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
} else if (n.nodeType === 8) if (n.data === Ve) h.push({ type: 2, index: s });
|
|
294
|
-
else {
|
|
295
|
-
let u = -1;
|
|
296
|
-
for (; (u = n.data.indexOf(B, u + 1)) !== -1; ) h.push({ type: 7, index: s }), u += B.length - 1;
|
|
297
|
-
}
|
|
298
|
-
s++;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
static createElement(e, i) {
|
|
302
|
-
const r = Z.createElement("template");
|
|
303
|
-
return r.innerHTML = e, r;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
function rt(t, e, i = t, r) {
|
|
307
|
-
if (e === it) return e;
|
|
308
|
-
let n = r !== void 0 ? i._$Co?.[r] : i._$Cl;
|
|
309
|
-
const s = yt(e) ? void 0 : e._$litDirective$;
|
|
310
|
-
return n?.constructor !== s && (n?._$AO?.(!1), s === void 0 ? n = void 0 : (n = new s(t), n._$AT(t, i, r)), r !== void 0 ? (i._$Co ??= [])[r] = n : i._$Cl = n), n !== void 0 && (e = rt(t, n._$AS(t, e.values), n, r)), e;
|
|
311
|
-
}
|
|
312
|
-
class Li {
|
|
313
|
-
constructor(e, i) {
|
|
314
|
-
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = i;
|
|
315
|
-
}
|
|
316
|
-
get parentNode() {
|
|
317
|
-
return this._$AM.parentNode;
|
|
318
|
-
}
|
|
319
|
-
get _$AU() {
|
|
320
|
-
return this._$AM._$AU;
|
|
321
|
-
}
|
|
322
|
-
u(e) {
|
|
323
|
-
const { el: { content: i }, parts: r } = this._$AD, n = (e?.creationScope ?? Z).importNode(i, !0);
|
|
324
|
-
V.currentNode = n;
|
|
325
|
-
let s = V.nextNode(), o = 0, a = 0, h = r[0];
|
|
326
|
-
for (; h !== void 0; ) {
|
|
327
|
-
if (o === h.index) {
|
|
328
|
-
let l;
|
|
329
|
-
h.type === 2 ? l = new wt(s, s.nextSibling, this, e) : h.type === 1 ? l = new h.ctor(s, h.name, h.strings, this, e) : h.type === 6 && (l = new Di(s, this, e)), this._$AV.push(l), h = r[++a];
|
|
330
|
-
}
|
|
331
|
-
o !== h?.index && (s = V.nextNode(), o++);
|
|
332
|
-
}
|
|
333
|
-
return V.currentNode = Z, n;
|
|
334
|
-
}
|
|
335
|
-
p(e) {
|
|
336
|
-
let i = 0;
|
|
337
|
-
for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, i), i += r.strings.length - 2) : r._$AI(e[i])), i++;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
class wt {
|
|
341
|
-
get _$AU() {
|
|
342
|
-
return this._$AM?._$AU ?? this._$Cv;
|
|
343
|
-
}
|
|
344
|
-
constructor(e, i, r, n) {
|
|
345
|
-
this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = e, this._$AB = i, this._$AM = r, this.options = n, this._$Cv = n?.isConnected ?? !0;
|
|
346
|
-
}
|
|
347
|
-
get parentNode() {
|
|
348
|
-
let e = this._$AA.parentNode;
|
|
349
|
-
const i = this._$AM;
|
|
350
|
-
return i !== void 0 && e?.nodeType === 11 && (e = i.parentNode), e;
|
|
351
|
-
}
|
|
352
|
-
get startNode() {
|
|
353
|
-
return this._$AA;
|
|
354
|
-
}
|
|
355
|
-
get endNode() {
|
|
356
|
-
return this._$AB;
|
|
357
|
-
}
|
|
358
|
-
_$AI(e, i = this) {
|
|
359
|
-
e = rt(this, e, i), yt(e) ? e === v || e == null || e === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : e !== this._$AH && e !== it && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ri(e) ? this.k(e) : this._(e);
|
|
360
|
-
}
|
|
361
|
-
O(e) {
|
|
362
|
-
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
363
|
-
}
|
|
364
|
-
T(e) {
|
|
365
|
-
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
366
|
-
}
|
|
367
|
-
_(e) {
|
|
368
|
-
this._$AH !== v && yt(this._$AH) ? this._$AA.nextSibling.data = e : this.T(Z.createTextNode(e)), this._$AH = e;
|
|
369
|
-
}
|
|
370
|
-
$(e) {
|
|
371
|
-
const { values: i, _$litType$: r } = e, n = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = bt.createElement(Ke(r.h, r.h[0]), this.options)), r);
|
|
372
|
-
if (this._$AH?._$AD === n) this._$AH.p(i);
|
|
373
|
-
else {
|
|
374
|
-
const s = new Li(n, this), o = s.u(this.options);
|
|
375
|
-
s.p(i), this.T(o), this._$AH = s;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
_$AC(e) {
|
|
379
|
-
let i = Ee.get(e.strings);
|
|
380
|
-
return i === void 0 && Ee.set(e.strings, i = new bt(e)), i;
|
|
381
|
-
}
|
|
382
|
-
k(e) {
|
|
383
|
-
he(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
|
-
const i = this._$AH;
|
|
385
|
-
let r, n = 0;
|
|
386
|
-
for (const s of e) n === i.length ? i.push(r = new wt(this.O(gt()), this.O(gt()), this, this.options)) : r = i[n], r._$AI(s), n++;
|
|
387
|
-
n < i.length && (this._$AR(r && r._$AB.nextSibling, n), i.length = n);
|
|
388
|
-
}
|
|
389
|
-
_$AR(e = this._$AA.nextSibling, i) {
|
|
390
|
-
for (this._$AP?.(!1, !0, i); e !== this._$AB; ) {
|
|
391
|
-
const r = we(e).nextSibling;
|
|
392
|
-
we(e).remove(), e = r;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
setConnected(e) {
|
|
396
|
-
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
class Xt {
|
|
400
|
-
get tagName() {
|
|
401
|
-
return this.element.tagName;
|
|
402
|
-
}
|
|
403
|
-
get _$AU() {
|
|
404
|
-
return this._$AM._$AU;
|
|
405
|
-
}
|
|
406
|
-
constructor(e, i, r, n, s) {
|
|
407
|
-
this.type = 1, this._$AH = v, this._$AN = void 0, this.element = e, this.name = i, this._$AM = n, this.options = s, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = v;
|
|
408
|
-
}
|
|
409
|
-
_$AI(e, i = this, r, n) {
|
|
410
|
-
const s = this.strings;
|
|
411
|
-
let o = !1;
|
|
412
|
-
if (s === void 0) e = rt(this, e, i, 0), o = !yt(e) || e !== this._$AH && e !== it, o && (this._$AH = e);
|
|
413
|
-
else {
|
|
414
|
-
const a = e;
|
|
415
|
-
let h, l;
|
|
416
|
-
for (e = s[0], h = 0; h < s.length - 1; h++) l = rt(this, a[r + h], i, h), l === it && (l = this._$AH[h]), o ||= !yt(l) || l !== this._$AH[h], l === v ? e = v : e !== v && (e += (l ?? "") + s[h + 1]), this._$AH[h] = l;
|
|
417
|
-
}
|
|
418
|
-
o && !n && this.j(e);
|
|
419
|
-
}
|
|
420
|
-
j(e) {
|
|
421
|
-
e === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
class Fi extends Xt {
|
|
425
|
-
constructor() {
|
|
426
|
-
super(...arguments), this.type = 3;
|
|
427
|
-
}
|
|
428
|
-
j(e) {
|
|
429
|
-
this.element[this.name] = e === v ? void 0 : e;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
class ki extends Xt {
|
|
433
|
-
constructor() {
|
|
434
|
-
super(...arguments), this.type = 4;
|
|
435
|
-
}
|
|
436
|
-
j(e) {
|
|
437
|
-
this.element.toggleAttribute(this.name, !!e && e !== v);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
class Ii extends Xt {
|
|
441
|
-
constructor(e, i, r, n, s) {
|
|
442
|
-
super(e, i, r, n, s), this.type = 5;
|
|
443
|
-
}
|
|
444
|
-
_$AI(e, i = this) {
|
|
445
|
-
if ((e = rt(this, e, i, 0) ?? v) === it) return;
|
|
446
|
-
const r = this._$AH, n = e === v && r !== v || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, s = e !== v && (r === v || n);
|
|
447
|
-
n && this.element.removeEventListener(this.name, this, r), s && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
448
|
-
}
|
|
449
|
-
handleEvent(e) {
|
|
450
|
-
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
class Di {
|
|
454
|
-
constructor(e, i, r) {
|
|
455
|
-
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = r;
|
|
456
|
-
}
|
|
457
|
-
get _$AU() {
|
|
458
|
-
return this._$AM._$AU;
|
|
459
|
-
}
|
|
460
|
-
_$AI(e) {
|
|
461
|
-
rt(this, e);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
const qi = ae.litHtmlPolyfillSupport;
|
|
465
|
-
qi?.(bt, wt), (ae.litHtmlVersions ??= []).push("3.3.2");
|
|
466
|
-
const Ui = (t, e, i) => {
|
|
467
|
-
const r = i?.renderBefore ?? e;
|
|
468
|
-
let n = r._$litPart$;
|
|
469
|
-
if (n === void 0) {
|
|
470
|
-
const s = i?.renderBefore ?? null;
|
|
471
|
-
r._$litPart$ = n = new wt(e.insertBefore(gt(), s), s, void 0, i ?? {});
|
|
472
|
-
}
|
|
473
|
-
return n._$AI(t), n;
|
|
474
|
-
};
|
|
475
|
-
const le = globalThis;
|
|
476
|
-
class dt extends tt {
|
|
477
|
-
constructor() {
|
|
478
|
-
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
|
-
}
|
|
480
|
-
createRenderRoot() {
|
|
481
|
-
const e = super.createRenderRoot();
|
|
482
|
-
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
483
|
-
}
|
|
484
|
-
update(e) {
|
|
485
|
-
const i = this.render();
|
|
486
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Ui(i, this.renderRoot, this.renderOptions);
|
|
487
|
-
}
|
|
488
|
-
connectedCallback() {
|
|
489
|
-
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
490
|
-
}
|
|
491
|
-
disconnectedCallback() {
|
|
492
|
-
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
|
-
}
|
|
494
|
-
render() {
|
|
495
|
-
return it;
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
dt._$litElement$ = !0, dt.finalized = !0, le.litElementHydrateSupport?.({ LitElement: dt });
|
|
499
|
-
const Xi = le.litElementPolyfillSupport;
|
|
500
|
-
Xi?.({ LitElement: dt });
|
|
501
|
-
(le.litElementVersions ??= []).push("4.2.2");
|
|
502
|
-
const ot = (t) => (e, i) => {
|
|
503
|
-
i !== void 0 ? i.addInitializer(() => {
|
|
504
|
-
customElements.define(t, e);
|
|
505
|
-
}) : customElements.define(t, e);
|
|
506
|
-
};
|
|
507
|
-
const Yi = { attribute: !0, type: String, converter: Ot, reflect: !1, hasChanged: oe }, Bi = (t = Yi, e, i) => {
|
|
508
|
-
const { kind: r, metadata: n } = i;
|
|
509
|
-
let s = globalThis.litPropertyMetadata.get(n);
|
|
510
|
-
if (s === void 0 && globalThis.litPropertyMetadata.set(n, s = /* @__PURE__ */ new Map()), r === "setter" && ((t = Object.create(t)).wrapped = !0), s.set(i.name, t), r === "accessor") {
|
|
511
|
-
const { name: o } = i;
|
|
512
|
-
return { set(a) {
|
|
513
|
-
const h = e.get.call(this);
|
|
514
|
-
e.set.call(this, a), this.requestUpdate(o, h, t, !0, a);
|
|
515
|
-
}, init(a) {
|
|
516
|
-
return a !== void 0 && this.C(o, void 0, t, a), a;
|
|
517
|
-
} };
|
|
518
|
-
}
|
|
519
|
-
if (r === "setter") {
|
|
520
|
-
const { name: o } = i;
|
|
521
|
-
return function(a) {
|
|
522
|
-
const h = this[o];
|
|
523
|
-
e.call(this, a), this.requestUpdate(o, h, t, !0, a);
|
|
524
|
-
};
|
|
525
|
-
}
|
|
526
|
-
throw Error("Unsupported decorator location: " + r);
|
|
527
|
-
};
|
|
528
|
-
function p(t) {
|
|
529
|
-
return (e, i) => typeof i == "object" ? Bi(t, e, i) : ((r, n, s) => {
|
|
530
|
-
const o = n.hasOwnProperty(s);
|
|
531
|
-
return n.constructor.createProperty(s, r), o ? Object.getOwnPropertyDescriptor(n, s) : void 0;
|
|
532
|
-
})(t, e, i);
|
|
533
|
-
}
|
|
534
|
-
function Wi(t, e) {
|
|
535
|
-
let i;
|
|
536
|
-
return function(...r) {
|
|
537
|
-
clearTimeout(i), i = setTimeout(() => t.apply(this, r), e);
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
const at = {
|
|
541
|
-
fromAttribute: (t) => t ? t.split(",").map((e) => e.trim()).filter(Boolean) : [],
|
|
542
|
-
toAttribute: (t) => t.join(",")
|
|
543
|
-
};
|
|
544
|
-
var Vi = Object.defineProperty, Yt = (t, e, i, r) => {
|
|
545
|
-
for (var n = void 0, s = t.length - 1, o; s >= 0; s--)
|
|
546
|
-
(o = t[s]) && (n = o(e, i, n) || n);
|
|
547
|
-
return n && Vi(e, i, n), n;
|
|
548
|
-
};
|
|
549
|
-
const be = class be extends dt {
|
|
550
|
-
constructor() {
|
|
551
|
-
super(), this.bgColors = ["#000", "#000"], this.bgAngle = 0, this.backgroundColor = "0, 0, 0", this.width = 0, this.height = 0, this.animationFrameId = null, this.trailOpacity = 0.1, this.handleVisibilityChange = () => {
|
|
552
|
-
document.visibilityState === "hidden" ? this.stopAnimation() : this.startAnimation();
|
|
553
|
-
}, this.canvas = document.createElement("canvas"), this.ctx = this.canvas.getContext("2d"), this.debouncedResize = Wi(this.resizeCanvas.bind(this), 100);
|
|
554
|
-
}
|
|
555
|
-
firstUpdated() {
|
|
556
|
-
this.shadowRoot || this.attachShadow({ mode: "open" }), this.shadowRoot.appendChild(this.canvas), this.resizeCanvas(), this.initialize(), this.startAnimation(), window.addEventListener("resize", this.debouncedResize), document.addEventListener(
|
|
557
|
-
"visibilitychange",
|
|
558
|
-
this.handleVisibilityChange
|
|
559
|
-
);
|
|
560
|
-
}
|
|
561
|
-
disconnectedCallback() {
|
|
562
|
-
super.disconnectedCallback(), window.removeEventListener("resize", this.debouncedResize), document.removeEventListener(
|
|
563
|
-
"visibilitychange",
|
|
564
|
-
this.handleVisibilityChange
|
|
565
|
-
), this.stopAnimation();
|
|
566
|
-
}
|
|
567
|
-
drawBackground(e) {
|
|
568
|
-
const i = this.bgAngle * Math.PI / 180, n = Math.sqrt(this.width ** 2 + this.height ** 2) / 2, s = this.width / 2, o = this.height / 2, a = s - Math.cos(i) * n, h = o - Math.sin(i) * n, l = s + Math.cos(i) * n, c = o + Math.sin(i) * n, u = e.createLinearGradient(a, h, l, c), f = this.bgColors.length > 0 ? this.bgColors : ["#000", "#000"];
|
|
569
|
-
try {
|
|
570
|
-
f.forEach((d, g) => {
|
|
571
|
-
const y = g / (f.length - 1 || 1);
|
|
572
|
-
u.addColorStop(y, d);
|
|
573
|
-
});
|
|
574
|
-
} catch {
|
|
575
|
-
u.addColorStop(0, "#000"), u.addColorStop(1, "#000");
|
|
576
|
-
}
|
|
577
|
-
e.fillStyle = u, e.fillRect(0, 0, this.width, this.height);
|
|
578
|
-
}
|
|
579
|
-
resizeCanvas() {
|
|
580
|
-
const e = this.getBoundingClientRect(), i = window.devicePixelRatio || 1;
|
|
581
|
-
e.width === this.width && e.height === this.height || (this.width = e.width, this.height = e.height, this.canvas.width = Math.floor(this.width * i), this.canvas.height = Math.floor(this.height * i), this.canvas.style.width = `${this.width}px`, this.canvas.style.height = `${this.height}px`, this.canvas.style.borderRadius = "inherit", this.ctx.scale(i, i), this.drawBackground(this.ctx));
|
|
582
|
-
}
|
|
583
|
-
initialize() {
|
|
584
|
-
}
|
|
585
|
-
startAnimation() {
|
|
586
|
-
if (this.animationFrameId !== null) return;
|
|
587
|
-
let e = performance.now();
|
|
588
|
-
const i = (r) => {
|
|
589
|
-
const n = (r - e) / 1e3;
|
|
590
|
-
e = r, this.loop(n), this.animationFrameId = requestAnimationFrame(i);
|
|
591
|
-
};
|
|
592
|
-
this.animationFrameId = requestAnimationFrame(i);
|
|
593
|
-
}
|
|
594
|
-
stopAnimation() {
|
|
595
|
-
this.animationFrameId !== null && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = null);
|
|
596
|
-
}
|
|
597
|
-
render() {
|
|
598
|
-
}
|
|
599
|
-
};
|
|
600
|
-
be.styles = Si`
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
const e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,n=Symbol(),r=/* @__PURE__ */ new WeakMap;var i=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,n=this.t;if(t&&e===void 0){let t=n!==void 0&&n.length===1;t&&(e=r.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}};const a=e=>new i(typeof e==`string`?e:e+``,void 0,n),o=(e,...t)=>new i(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,n),s=(n,r)=>{if(t)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let t of r){let r=document.createElement(`style`),i=e.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=t.cssText,n.appendChild(r)}},c=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return a(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:f,getOwnPropertySymbols:p,getPrototypeOf:m}=Object,h=globalThis,ee=h.trustedTypes,te=ee?ee.emptyScript:``,ne=h.reactiveElementPolyfillSupport,g=(e,t)=>e,_={toAttribute(e,t){
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2017 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*/
|
|
12
|
+
switch(t){case Boolean:e=e?te: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}},re=(e,t)=>!l(e,t),ie={attribute:!0,type:String,converter:_,reflect:!1,useDefault:!1,hasChanged:re};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=ie){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&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(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)??ie}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=[...f(e),...p(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(c(e))}else e!==void 0&&t.push(c(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 s(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??re)(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,ne?.({ReactiveElement:v}),(h.reactiveElementVersions??=[]).push(`2.1.2`);
|
|
13
|
+
/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright 2017 Google LLC
|
|
16
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
+
*/
|
|
18
|
+
const ae=globalThis,oe=e=>e,y=ae.trustedTypes,se=y?y.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,ce=`$lit$`,b=`lit$${Math.random().toFixed(9).slice(2)}$`,le=`?`+b,ue=`<${le}>`,x=document,S=()=>x.createComment(``),C=e=>e===null||typeof e!=`object`&&typeof e!=`function`,de=Array.isArray,fe=e=>de(e)||typeof e?.[Symbol.iterator]==`function`,pe=`[
|
|
19
|
+
\f\r]`,w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,me=/-->/g,he=/>/g,T=RegExp(`>|${pe}(?:([^\\s"'>=/]+)(${pe}*=${pe}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ge=/'/g,_e=/"/g,ve=/^(?:script|style|textarea|title)$/i,E=Symbol.for(`lit-noChange`),D=Symbol.for(`lit-nothing`),ye=/* @__PURE__ */ new WeakMap,O=x.createTreeWalker(x,129);function be(e,t){if(!de(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return se===void 0?t:se.createHTML(t)}const xe=(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=me:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=T):(ve.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=T):o=he: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]===`"`?_e:ge):o===_e||o===ge?o=T:o===me||o===he?o=w:(o=T,i=void 0);let d=o===T&&e[t+1].startsWith(`/>`)?` `:``;a+=o===w?n+ue:l>=0?(r.push(s),n.slice(0,l)+ce+n.slice(l)+b+d):n+b+(l===-2?t:d)}return[be(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]};var Se=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]=xe(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(ce)){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]===`.`?Te:r[1]===`?`?Ee:r[1]===`@`?De:A}),i.removeAttribute(e)}else e.startsWith(b)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(ve.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===le)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 Ce=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 we(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Oe(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++}},we=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?fe(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=Se.createElement(be(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Ce(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=ye.get(e.strings);return t===void 0&&ye.set(e.strings,t=new Se(e)),t}k(t){de(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=oe(e).nextSibling;oe(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??``)}},Te=class extends A{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===D?void 0:e}},Ee=class extends A{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==D)}},De=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)}},Oe=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)}};const ke=ae.litHtmlPolyfillSupport;ke?.(Se,we),(ae.litHtmlVersions??=[]).push(`3.3.3`);const Ae=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new we(t.insertBefore(S(),e),e,void 0,n??{})}return i._$AI(e),i},je=globalThis
|
|
20
|
+
/**
|
|
21
|
+
* @license
|
|
22
|
+
* Copyright 2017 Google LLC
|
|
23
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
24
|
+
*/
|
|
25
|
+
;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=Ae(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,je.litElementHydrateSupport?.({LitElement:j});const Me=je.litElementPolyfillSupport;Me?.({LitElement:j}),(je.litElementVersions??=[]).push(`4.2.2`);
|
|
26
|
+
/**
|
|
27
|
+
* @license
|
|
28
|
+
* Copyright 2017 Google LLC
|
|
29
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
30
|
+
*/
|
|
31
|
+
const M=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},Ne={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:re},Pe=(e=Ne,t,n)=>{
|
|
32
|
+
/**
|
|
33
|
+
* @license
|
|
34
|
+
* Copyright 2017 Google LLC
|
|
35
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
36
|
+
*/
|
|
37
|
+
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`?Pe(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)}
|
|
38
|
+
/**
|
|
39
|
+
* @license
|
|
40
|
+
* Copyright 2017 Google LLC
|
|
41
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
42
|
+
*/
|
|
43
|
+
function Fe(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}const 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=Fe(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=Ie(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=o`
|
|
601
44
|
:host {
|
|
602
45
|
border-radius: inherit;
|
|
603
46
|
display: flex;
|
|
604
47
|
}
|
|
605
|
-
`;
|
|
606
|
-
|
|
607
|
-
Yt([
|
|
608
|
-
p({
|
|
609
|
-
type: Array,
|
|
610
|
-
attribute: "bg-colors",
|
|
611
|
-
converter: at
|
|
612
|
-
})
|
|
613
|
-
], O.prototype, "bgColors");
|
|
614
|
-
Yt([
|
|
615
|
-
p({ type: Number, attribute: "bg-angle" })
|
|
616
|
-
], O.prototype, "bgAngle");
|
|
617
|
-
Yt([
|
|
618
|
-
p({ type: String, attribute: "background-color" })
|
|
619
|
-
], O.prototype, "backgroundColor");
|
|
620
|
-
Yt([
|
|
621
|
-
p({ type: Number, attribute: "trail-opacity" })
|
|
622
|
-
], O.prototype, "trailOpacity");
|
|
623
|
-
function P(t, e) {
|
|
624
|
-
return Math.random() * (e - t) + t;
|
|
625
|
-
}
|
|
626
|
-
function Nt(t, e) {
|
|
627
|
-
return t = Math.ceil(t), e = Math.floor(e), Math.floor(Math.random() * (e - t + 1) + t);
|
|
628
|
-
}
|
|
629
|
-
function ce(t = [0, 360], e = [0, 100], i = [40, 60]) {
|
|
630
|
-
const r = Nt(t[0], t[1]), n = Nt(e[0], e[1]), s = Nt(i[0], i[1]);
|
|
631
|
-
return `hsl(${r}, ${n}%, ${s}%)`;
|
|
632
|
-
}
|
|
633
|
-
function Gi(t, e, i, r) {
|
|
634
|
-
return `hsla(${t}, ${e}%, ${i}%, ${r})`;
|
|
635
|
-
}
|
|
636
|
-
var Ki = Object.defineProperty, Zi = Object.getOwnPropertyDescriptor, C = (t, e, i, r) => {
|
|
637
|
-
for (var n = r > 1 ? void 0 : r ? Zi(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
638
|
-
(o = t[s]) && (n = (r ? o(e, i, n) : o(n)) || n);
|
|
639
|
-
return r && n && Ki(e, i, n), n;
|
|
640
|
-
};
|
|
641
|
-
class Ji {
|
|
642
|
-
constructor(e, i) {
|
|
643
|
-
this.angle = e, this.color = i;
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
class Qi {
|
|
647
|
-
constructor(e, i) {
|
|
648
|
-
this.speed = [], this.lines = [], this.angle = [
|
|
649
|
-
P(0, Math.PI * 2),
|
|
650
|
-
P(0, Math.PI * 2),
|
|
651
|
-
P(0, Math.PI * 2),
|
|
652
|
-
P(0, Math.PI * 2)
|
|
653
|
-
];
|
|
654
|
-
const r = () => Math.random() > 0.5 ? 1 : -1;
|
|
655
|
-
this.speedSeeds = [
|
|
656
|
-
Math.random(),
|
|
657
|
-
Math.random(),
|
|
658
|
-
Math.random(),
|
|
659
|
-
Math.random()
|
|
660
|
-
], this.speedSigns = [r(), r(), r(), r()], this.updateSpeeds(e, i);
|
|
661
|
-
}
|
|
662
|
-
updateSpeeds(e, i) {
|
|
663
|
-
this.speed = this.speedSeeds.map(
|
|
664
|
-
(r, n) => this.speedSigns[n] * (e + r * (i - e))
|
|
665
|
-
);
|
|
666
|
-
}
|
|
667
|
-
update(e) {
|
|
668
|
-
this.angle[0] += this.speed[0], this.angle[1] += this.speed[1], this.angle[2] += this.speed[2], this.angle[3] += this.speed[3];
|
|
669
|
-
const i = [
|
|
670
|
-
Math.sin(this.angle[0]),
|
|
671
|
-
Math.sin(this.angle[1]),
|
|
672
|
-
Math.sin(this.angle[2]),
|
|
673
|
-
Math.sin(this.angle[3])
|
|
674
|
-
];
|
|
675
|
-
this.lines.push(new Ji(i, "")), this.lines.length > e && this.lines.shift();
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
let w = class extends O {
|
|
679
|
-
constructor() {
|
|
680
|
-
super(...arguments), 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 = 0.5, this.ribbonSpeedMin = 4e-3, this.ribbonSpeedMax = 8e-3, this.ribbonLineWidth = 2, this.ribbonLineOpacity = 0.2, this.ribbons = [], this.hue = 11, this.hueForward = !0;
|
|
681
|
-
}
|
|
682
|
-
initialize() {
|
|
683
|
-
this.hue = this.ribbonHueStart, this.ribbons = [];
|
|
684
|
-
for (let t = 0; t < this.ribbonCount; t++)
|
|
685
|
-
this.ribbons.push(
|
|
686
|
-
new Qi(this.ribbonSpeedMin, this.ribbonSpeedMax)
|
|
687
|
-
);
|
|
688
|
-
for (let t = 0; t < this.ribbonCount; t++)
|
|
689
|
-
for (let e = 0; e < this.ribbonWidth; e++)
|
|
690
|
-
this.updateColor(), this.ribbons[t].update(this.ribbonWidth);
|
|
691
|
-
}
|
|
692
|
-
updated(t) {
|
|
693
|
-
super.updated(t), (t.has("ribbonSpeedMin") || t.has("ribbonSpeedMax")) && this.ribbons.forEach(
|
|
694
|
-
(e) => e.updateSpeeds(this.ribbonSpeedMin, this.ribbonSpeedMax)
|
|
695
|
-
), t.has("ribbonCount") && this.initialize(), t.has("ribbonWidth") && this.ribbons.forEach((e) => {
|
|
696
|
-
e.lines.length > this.ribbonWidth && (e.lines = e.lines.slice(-this.ribbonWidth));
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
updateColor() {
|
|
700
|
-
this.hue += this.hueForward ? 0.05 : -0.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);
|
|
701
|
-
}
|
|
702
|
-
loop() {
|
|
703
|
-
this.updateColor(), this.ctx.clearRect(0, 0, this.width, this.height), this.drawBackground(this.ctx);
|
|
704
|
-
const t = Math.sqrt(this.width ** 2 + this.height ** 2), e = this.width / 2, i = this.height / 2, r = t / 2, n = r / 3, s = this.ribbonRotation * Math.PI / 180;
|
|
705
|
-
this.ctx.lineWidth = this.ribbonLineWidth, this.ribbons.forEach((o) => {
|
|
706
|
-
o.update(this.ribbonWidth), o.lines.forEach((a, h) => {
|
|
707
|
-
const l = a.angle, c = e - r * Math.cos(l[0] * this.ribbonAmplitude + s), u = i - r * Math.sin(l[0] * this.ribbonAmplitude + s), f = e + r * Math.cos(l[3] * this.ribbonAmplitude + s), d = i + r * Math.sin(l[3] * this.ribbonAmplitude + s), g = e - n * Math.cos(l[1] * this.ribbonAmplitude * 2), y = i - n * Math.sin(l[1] * this.ribbonAmplitude * 2), $ = e + n * Math.cos(l[2] * this.ribbonAmplitude * 2), D = i + n * Math.sin(l[2] * this.ribbonAmplitude * 2), z = h / (o.lines.length - 1 || 1), X = this.ribbonHueEnd + (this.ribbonHueStart - this.ribbonHueEnd) * z, Q = this.ribbonSaturationEnd + (this.ribbonSaturationStart - this.ribbonSaturationEnd) * z, j = this.ribbonLightnessEnd + (this.ribbonLightnessStart - this.ribbonLightnessEnd) * z;
|
|
708
|
-
this.ctx.strokeStyle = Gi(
|
|
709
|
-
X,
|
|
710
|
-
Q,
|
|
711
|
-
j,
|
|
712
|
-
this.ribbonLineOpacity
|
|
713
|
-
), this.ctx.beginPath(), this.ctx.moveTo(c, u), this.ctx.bezierCurveTo(g, y, $, D, f, d), this.ctx.stroke();
|
|
714
|
-
});
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
};
|
|
718
|
-
C([
|
|
719
|
-
p({ type: Number, attribute: "ribbon-count" })
|
|
720
|
-
], w.prototype, "ribbonCount", 2);
|
|
721
|
-
C([
|
|
722
|
-
p({ type: Number, attribute: "ribbon-width" })
|
|
723
|
-
], w.prototype, "ribbonWidth", 2);
|
|
724
|
-
C([
|
|
725
|
-
p({ type: Number, attribute: "ribbon-rotation" })
|
|
726
|
-
], w.prototype, "ribbonRotation", 2);
|
|
727
|
-
C([
|
|
728
|
-
p({ type: Number, attribute: "ribbon-hue-start" })
|
|
729
|
-
], w.prototype, "ribbonHueStart", 2);
|
|
730
|
-
C([
|
|
731
|
-
p({ type: Number, attribute: "ribbon-hue-end" })
|
|
732
|
-
], w.prototype, "ribbonHueEnd", 2);
|
|
733
|
-
C([
|
|
734
|
-
p({ type: Number, attribute: "ribbon-saturation-start" })
|
|
735
|
-
], w.prototype, "ribbonSaturationStart", 2);
|
|
736
|
-
C([
|
|
737
|
-
p({ type: Number, attribute: "ribbon-saturation-end" })
|
|
738
|
-
], w.prototype, "ribbonSaturationEnd", 2);
|
|
739
|
-
C([
|
|
740
|
-
p({ type: Number, attribute: "ribbon-lightness-start" })
|
|
741
|
-
], w.prototype, "ribbonLightnessStart", 2);
|
|
742
|
-
C([
|
|
743
|
-
p({ type: Number, attribute: "ribbon-lightness-end" })
|
|
744
|
-
], w.prototype, "ribbonLightnessEnd", 2);
|
|
745
|
-
C([
|
|
746
|
-
p({ type: Number, attribute: "ribbon-amplitude" })
|
|
747
|
-
], w.prototype, "ribbonAmplitude", 2);
|
|
748
|
-
C([
|
|
749
|
-
p({ type: Number, attribute: "ribbon-speed-min" })
|
|
750
|
-
], w.prototype, "ribbonSpeedMin", 2);
|
|
751
|
-
C([
|
|
752
|
-
p({ type: Number, attribute: "ribbon-speed-max" })
|
|
753
|
-
], w.prototype, "ribbonSpeedMax", 2);
|
|
754
|
-
C([
|
|
755
|
-
p({ type: Number, attribute: "ribbon-line-width" })
|
|
756
|
-
], w.prototype, "ribbonLineWidth", 2);
|
|
757
|
-
C([
|
|
758
|
-
p({ type: Number, attribute: "ribbon-line-opacity" })
|
|
759
|
-
], w.prototype, "ribbonLineOpacity", 2);
|
|
760
|
-
w = C([
|
|
761
|
-
ot("bb-ambient-ribbon")
|
|
762
|
-
], w);
|
|
763
|
-
let ji = class {
|
|
764
|
-
constructor(e, i) {
|
|
765
|
-
this.x = e, this.y = i;
|
|
766
|
-
}
|
|
767
|
-
update(e, i, r, n, s, o = 30) {
|
|
768
|
-
const a = s / o;
|
|
769
|
-
this.y * r * a > e && Math.random() > i ? this.y = 0 : this.y += s * n;
|
|
770
|
-
}
|
|
771
|
-
draw(e, i, r, n, s, o = 30) {
|
|
772
|
-
const a = s / o;
|
|
773
|
-
e.fillStyle = r, e.fillText(
|
|
774
|
-
i,
|
|
775
|
-
this.x * n,
|
|
776
|
-
this.y * n * a
|
|
777
|
-
);
|
|
778
|
-
}
|
|
779
|
-
};
|
|
780
|
-
var tr = Object.defineProperty, er = Object.getOwnPropertyDescriptor, R = (t, e, i, r) => {
|
|
781
|
-
for (var n = r > 1 ? void 0 : r ? er(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
782
|
-
(o = t[s]) && (n = (r ? o(e, i, n) : o(n)) || n);
|
|
783
|
-
return r && n && tr(e, i, n), n;
|
|
784
|
-
};
|
|
785
|
-
let H = class extends O {
|
|
786
|
-
constructor() {
|
|
787
|
-
super(), this.speed = 10, this.characters = "ヲアウエオカキケコサシスセソタツテナニヌネハヒホマミムメモヤユラリワ", this.randomness = 0.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;
|
|
788
|
-
}
|
|
789
|
-
initialize() {
|
|
790
|
-
this.symbols = [], this.createSymbols(), this.drawBackground(this.ctx);
|
|
791
|
-
}
|
|
792
|
-
createSymbols() {
|
|
793
|
-
this.columns = Math.floor(this.width / this.fontSize);
|
|
794
|
-
for (let t = 0; t < this.columns; t++)
|
|
795
|
-
this.symbols[t] = this.createSymbol(t);
|
|
796
|
-
}
|
|
797
|
-
updateSymbols() {
|
|
798
|
-
const t = Math.floor(this.width / this.fontSize);
|
|
799
|
-
for (let e = this.symbols.length; e < t; e++)
|
|
800
|
-
this.symbols[e] = this.createSymbol(e);
|
|
801
|
-
this.symbols.length > t && (this.symbols.length = t);
|
|
802
|
-
}
|
|
803
|
-
loop(t) {
|
|
804
|
-
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((e) => {
|
|
805
|
-
e.draw(
|
|
806
|
-
this.ctx,
|
|
807
|
-
this.characters.charAt(
|
|
808
|
-
Math.floor(Math.random() * this.characters.length)
|
|
809
|
-
),
|
|
810
|
-
this.fontColors && this.fontColors.length > 0 ? this.fontColors[Math.floor(Math.random() * this.fontColors.length)] : ce(
|
|
811
|
-
[this.fontColorHueStart, this.fontColorHueEnd],
|
|
812
|
-
[
|
|
813
|
-
this.fontColorSaturationStart,
|
|
814
|
-
this.fontColorSaturationEnd
|
|
815
|
-
],
|
|
816
|
-
[
|
|
817
|
-
this.fontColorLightnessStart,
|
|
818
|
-
this.fontColorLightnessEnd
|
|
819
|
-
]
|
|
820
|
-
),
|
|
821
|
-
this.fontSize,
|
|
822
|
-
this.speed * 3
|
|
823
|
-
), e.update(
|
|
824
|
-
this.height,
|
|
825
|
-
this.randomness,
|
|
826
|
-
this.fontSize,
|
|
827
|
-
t,
|
|
828
|
-
this.speed * 3
|
|
829
|
-
);
|
|
830
|
-
});
|
|
831
|
-
}
|
|
832
|
-
createSymbol(t) {
|
|
833
|
-
return new ji(t, Nt(0, -this.height / this.fontSize));
|
|
834
|
-
}
|
|
835
|
-
};
|
|
836
|
-
R([
|
|
837
|
-
p({ type: Number, attribute: "speed" })
|
|
838
|
-
], H.prototype, "speed", 2);
|
|
839
|
-
R([
|
|
840
|
-
p({ type: String, attribute: "characters" })
|
|
841
|
-
], H.prototype, "characters", 2);
|
|
842
|
-
R([
|
|
843
|
-
p({ type: Number, attribute: "randomness" })
|
|
844
|
-
], H.prototype, "randomness", 2);
|
|
845
|
-
R([
|
|
846
|
-
p({ type: Number, attribute: "font-size" })
|
|
847
|
-
], H.prototype, "fontSize", 2);
|
|
848
|
-
R([
|
|
849
|
-
p({ type: Number, attribute: "font-color-hue-start" })
|
|
850
|
-
], H.prototype, "fontColorHueStart", 2);
|
|
851
|
-
R([
|
|
852
|
-
p({ type: Number, attribute: "font-color-hue-end" })
|
|
853
|
-
], H.prototype, "fontColorHueEnd", 2);
|
|
854
|
-
R([
|
|
855
|
-
p({ type: Number, attribute: "font-color-saturation-start" })
|
|
856
|
-
], H.prototype, "fontColorSaturationStart", 2);
|
|
857
|
-
R([
|
|
858
|
-
p({ type: Number, attribute: "font-color-saturation-end" })
|
|
859
|
-
], H.prototype, "fontColorSaturationEnd", 2);
|
|
860
|
-
R([
|
|
861
|
-
p({ type: Number, attribute: "font-color-lightness-start" })
|
|
862
|
-
], H.prototype, "fontColorLightnessStart", 2);
|
|
863
|
-
R([
|
|
864
|
-
p({ type: Number, attribute: "font-color-lightness-end" })
|
|
865
|
-
], H.prototype, "fontColorLightnessEnd", 2);
|
|
866
|
-
R([
|
|
867
|
-
p({
|
|
868
|
-
type: Array,
|
|
869
|
-
attribute: "font-colors",
|
|
870
|
-
converter: at
|
|
871
|
-
})
|
|
872
|
-
], H.prototype, "fontColors", 2);
|
|
873
|
-
H = R([
|
|
874
|
-
ot("bb-digital-rain")
|
|
875
|
-
], H);
|
|
876
|
-
var ir = { value: () => {
|
|
877
|
-
} };
|
|
878
|
-
function Ze() {
|
|
879
|
-
for (var t = 0, e = arguments.length, i = {}, r; t < e; ++t) {
|
|
880
|
-
if (!(r = arguments[t] + "") || r in i || /[\s.]/.test(r)) throw new Error("illegal type: " + r);
|
|
881
|
-
i[r] = [];
|
|
882
|
-
}
|
|
883
|
-
return new Pt(i);
|
|
884
|
-
}
|
|
885
|
-
function Pt(t) {
|
|
886
|
-
this._ = t;
|
|
887
|
-
}
|
|
888
|
-
function rr(t, e) {
|
|
889
|
-
return t.trim().split(/^|\s+/).map(function(i) {
|
|
890
|
-
var r = "", n = i.indexOf(".");
|
|
891
|
-
if (n >= 0 && (r = i.slice(n + 1), i = i.slice(0, n)), i && !e.hasOwnProperty(i)) throw new Error("unknown type: " + i);
|
|
892
|
-
return { type: i, name: r };
|
|
893
|
-
});
|
|
894
|
-
}
|
|
895
|
-
Pt.prototype = Ze.prototype = {
|
|
896
|
-
constructor: Pt,
|
|
897
|
-
on: function(t, e) {
|
|
898
|
-
var i = this._, r = rr(t + "", i), n, s = -1, o = r.length;
|
|
899
|
-
if (arguments.length < 2) {
|
|
900
|
-
for (; ++s < o; ) if ((n = (t = r[s]).type) && (n = nr(i[n], t.name))) return n;
|
|
901
|
-
return;
|
|
902
|
-
}
|
|
903
|
-
if (e != null && typeof e != "function") throw new Error("invalid callback: " + e);
|
|
904
|
-
for (; ++s < o; )
|
|
905
|
-
if (n = (t = r[s]).type) i[n] = Ne(i[n], t.name, e);
|
|
906
|
-
else if (e == null) for (n in i) i[n] = Ne(i[n], t.name, null);
|
|
907
|
-
return this;
|
|
908
|
-
},
|
|
909
|
-
copy: function() {
|
|
910
|
-
var t = {}, e = this._;
|
|
911
|
-
for (var i in e) t[i] = e[i].slice();
|
|
912
|
-
return new Pt(t);
|
|
913
|
-
},
|
|
914
|
-
call: function(t, e) {
|
|
915
|
-
if ((n = arguments.length - 2) > 0) for (var i = new Array(n), r = 0, n, s; r < n; ++r) i[r] = arguments[r + 2];
|
|
916
|
-
if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
|
|
917
|
-
for (s = this._[t], r = 0, n = s.length; r < n; ++r) s[r].value.apply(e, i);
|
|
918
|
-
},
|
|
919
|
-
apply: function(t, e, i) {
|
|
920
|
-
if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
|
|
921
|
-
for (var r = this._[t], n = 0, s = r.length; n < s; ++n) r[n].value.apply(e, i);
|
|
922
|
-
}
|
|
923
|
-
};
|
|
924
|
-
function nr(t, e) {
|
|
925
|
-
for (var i = 0, r = t.length, n; i < r; ++i)
|
|
926
|
-
if ((n = t[i]).name === e)
|
|
927
|
-
return n.value;
|
|
928
|
-
}
|
|
929
|
-
function Ne(t, e, i) {
|
|
930
|
-
for (var r = 0, n = t.length; r < n; ++r)
|
|
931
|
-
if (t[r].name === e) {
|
|
932
|
-
t[r] = ir, t = t.slice(0, r).concat(t.slice(r + 1));
|
|
933
|
-
break;
|
|
934
|
-
}
|
|
935
|
-
return i != null && t.push({ name: e, value: i }), t;
|
|
936
|
-
}
|
|
937
|
-
var Jt = "http://www.w3.org/1999/xhtml";
|
|
938
|
-
const Pe = {
|
|
939
|
-
svg: "http://www.w3.org/2000/svg",
|
|
940
|
-
xhtml: Jt,
|
|
941
|
-
xlink: "http://www.w3.org/1999/xlink",
|
|
942
|
-
xml: "http://www.w3.org/XML/1998/namespace",
|
|
943
|
-
xmlns: "http://www.w3.org/2000/xmlns/"
|
|
944
|
-
};
|
|
945
|
-
function Bt(t) {
|
|
946
|
-
var e = t += "", i = e.indexOf(":");
|
|
947
|
-
return i >= 0 && (e = t.slice(0, i)) !== "xmlns" && (t = t.slice(i + 1)), Pe.hasOwnProperty(e) ? { space: Pe[e], local: t } : t;
|
|
948
|
-
}
|
|
949
|
-
function sr(t) {
|
|
950
|
-
return function() {
|
|
951
|
-
var e = this.ownerDocument, i = this.namespaceURI;
|
|
952
|
-
return i === Jt && e.documentElement.namespaceURI === Jt ? e.createElement(t) : e.createElementNS(i, t);
|
|
953
|
-
};
|
|
954
|
-
}
|
|
955
|
-
function or(t) {
|
|
956
|
-
return function() {
|
|
957
|
-
return this.ownerDocument.createElementNS(t.space, t.local);
|
|
958
|
-
};
|
|
959
|
-
}
|
|
960
|
-
function Je(t) {
|
|
961
|
-
var e = Bt(t);
|
|
962
|
-
return (e.local ? or : sr)(e);
|
|
963
|
-
}
|
|
964
|
-
function ar() {
|
|
965
|
-
}
|
|
966
|
-
function ue(t) {
|
|
967
|
-
return t == null ? ar : function() {
|
|
968
|
-
return this.querySelector(t);
|
|
969
|
-
};
|
|
970
|
-
}
|
|
971
|
-
function hr(t) {
|
|
972
|
-
typeof t != "function" && (t = ue(t));
|
|
973
|
-
for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n)
|
|
974
|
-
for (var s = e[n], o = s.length, a = r[n] = new Array(o), h, l, c = 0; c < o; ++c)
|
|
975
|
-
(h = s[c]) && (l = t.call(h, h.__data__, c, s)) && ("__data__" in h && (l.__data__ = h.__data__), a[c] = l);
|
|
976
|
-
return new L(r, this._parents);
|
|
977
|
-
}
|
|
978
|
-
function lr(t) {
|
|
979
|
-
return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
|
|
980
|
-
}
|
|
981
|
-
function cr() {
|
|
982
|
-
return [];
|
|
983
|
-
}
|
|
984
|
-
function Qe(t) {
|
|
985
|
-
return t == null ? cr : function() {
|
|
986
|
-
return this.querySelectorAll(t);
|
|
987
|
-
};
|
|
988
|
-
}
|
|
989
|
-
function ur(t) {
|
|
990
|
-
return function() {
|
|
991
|
-
return lr(t.apply(this, arguments));
|
|
992
|
-
};
|
|
993
|
-
}
|
|
994
|
-
function pr(t) {
|
|
995
|
-
typeof t == "function" ? t = ur(t) : t = Qe(t);
|
|
996
|
-
for (var e = this._groups, i = e.length, r = [], n = [], s = 0; s < i; ++s)
|
|
997
|
-
for (var o = e[s], a = o.length, h, l = 0; l < a; ++l)
|
|
998
|
-
(h = o[l]) && (r.push(t.call(h, h.__data__, l, o)), n.push(h));
|
|
999
|
-
return new L(r, n);
|
|
1000
|
-
}
|
|
1001
|
-
function je(t) {
|
|
1002
|
-
return function() {
|
|
1003
|
-
return this.matches(t);
|
|
1004
|
-
};
|
|
1005
|
-
}
|
|
1006
|
-
function ti(t) {
|
|
1007
|
-
return function(e) {
|
|
1008
|
-
return e.matches(t);
|
|
1009
|
-
};
|
|
1010
|
-
}
|
|
1011
|
-
var fr = Array.prototype.find;
|
|
1012
|
-
function dr(t) {
|
|
1013
|
-
return function() {
|
|
1014
|
-
return fr.call(this.children, t);
|
|
1015
|
-
};
|
|
1016
|
-
}
|
|
1017
|
-
function gr() {
|
|
1018
|
-
return this.firstElementChild;
|
|
1019
|
-
}
|
|
1020
|
-
function yr(t) {
|
|
1021
|
-
return this.select(t == null ? gr : dr(typeof t == "function" ? t : ti(t)));
|
|
1022
|
-
}
|
|
1023
|
-
var br = Array.prototype.filter;
|
|
1024
|
-
function mr() {
|
|
1025
|
-
return Array.from(this.children);
|
|
1026
|
-
}
|
|
1027
|
-
function _r(t) {
|
|
1028
|
-
return function() {
|
|
1029
|
-
return br.call(this.children, t);
|
|
1030
|
-
};
|
|
1031
|
-
}
|
|
1032
|
-
function xr(t) {
|
|
1033
|
-
return this.selectAll(t == null ? mr : _r(typeof t == "function" ? t : ti(t)));
|
|
1034
|
-
}
|
|
1035
|
-
function vr(t) {
|
|
1036
|
-
typeof t != "function" && (t = je(t));
|
|
1037
|
-
for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n)
|
|
1038
|
-
for (var s = e[n], o = s.length, a = r[n] = [], h, l = 0; l < o; ++l)
|
|
1039
|
-
(h = s[l]) && t.call(h, h.__data__, l, s) && a.push(h);
|
|
1040
|
-
return new L(r, this._parents);
|
|
1041
|
-
}
|
|
1042
|
-
function ei(t) {
|
|
1043
|
-
return new Array(t.length);
|
|
1044
|
-
}
|
|
1045
|
-
function wr() {
|
|
1046
|
-
return new L(this._enter || this._groups.map(ei), this._parents);
|
|
1047
|
-
}
|
|
1048
|
-
function Tt(t, e) {
|
|
1049
|
-
this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e;
|
|
1050
|
-
}
|
|
1051
|
-
Tt.prototype = {
|
|
1052
|
-
constructor: Tt,
|
|
1053
|
-
appendChild: function(t) {
|
|
1054
|
-
return this._parent.insertBefore(t, this._next);
|
|
1055
|
-
},
|
|
1056
|
-
insertBefore: function(t, e) {
|
|
1057
|
-
return this._parent.insertBefore(t, e);
|
|
1058
|
-
},
|
|
1059
|
-
querySelector: function(t) {
|
|
1060
|
-
return this._parent.querySelector(t);
|
|
1061
|
-
},
|
|
1062
|
-
querySelectorAll: function(t) {
|
|
1063
|
-
return this._parent.querySelectorAll(t);
|
|
1064
|
-
}
|
|
1065
|
-
};
|
|
1066
|
-
function Sr(t) {
|
|
1067
|
-
return function() {
|
|
1068
|
-
return t;
|
|
1069
|
-
};
|
|
1070
|
-
}
|
|
1071
|
-
function $r(t, e, i, r, n, s) {
|
|
1072
|
-
for (var o = 0, a, h = e.length, l = s.length; o < l; ++o)
|
|
1073
|
-
(a = e[o]) ? (a.__data__ = s[o], r[o] = a) : i[o] = new Tt(t, s[o]);
|
|
1074
|
-
for (; o < h; ++o)
|
|
1075
|
-
(a = e[o]) && (n[o] = a);
|
|
1076
|
-
}
|
|
1077
|
-
function Ar(t, e, i, r, n, s, o) {
|
|
1078
|
-
var a, h, l = /* @__PURE__ */ new Map(), c = e.length, u = s.length, f = new Array(c), d;
|
|
1079
|
-
for (a = 0; a < c; ++a)
|
|
1080
|
-
(h = e[a]) && (f[a] = d = o.call(h, h.__data__, a, e) + "", l.has(d) ? n[a] = h : l.set(d, h));
|
|
1081
|
-
for (a = 0; a < u; ++a)
|
|
1082
|
-
d = o.call(t, s[a], a, s) + "", (h = l.get(d)) ? (r[a] = h, h.__data__ = s[a], l.delete(d)) : i[a] = new Tt(t, s[a]);
|
|
1083
|
-
for (a = 0; a < c; ++a)
|
|
1084
|
-
(h = e[a]) && l.get(f[a]) === h && (n[a] = h);
|
|
1085
|
-
}
|
|
1086
|
-
function Cr(t) {
|
|
1087
|
-
return t.__data__;
|
|
1088
|
-
}
|
|
1089
|
-
function Mr(t, e) {
|
|
1090
|
-
if (!arguments.length) return Array.from(this, Cr);
|
|
1091
|
-
var i = e ? Ar : $r, r = this._parents, n = this._groups;
|
|
1092
|
-
typeof t != "function" && (t = Sr(t));
|
|
1093
|
-
for (var s = n.length, o = new Array(s), a = new Array(s), h = new Array(s), l = 0; l < s; ++l) {
|
|
1094
|
-
var c = r[l], u = n[l], f = u.length, d = Er(t.call(c, c && c.__data__, l, r)), g = d.length, y = a[l] = new Array(g), $ = o[l] = new Array(g), D = h[l] = new Array(f);
|
|
1095
|
-
i(c, u, y, $, D, d, e);
|
|
1096
|
-
for (var z = 0, X = 0, Q, j; z < g; ++z)
|
|
1097
|
-
if (Q = y[z]) {
|
|
1098
|
-
for (z >= X && (X = z + 1); !(j = $[X]) && ++X < g; ) ;
|
|
1099
|
-
Q._next = j || null;
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
return o = new L(o, r), o._enter = a, o._exit = h, o;
|
|
1103
|
-
}
|
|
1104
|
-
function Er(t) {
|
|
1105
|
-
return typeof t == "object" && "length" in t ? t : Array.from(t);
|
|
1106
|
-
}
|
|
1107
|
-
function Nr() {
|
|
1108
|
-
return new L(this._exit || this._groups.map(ei), this._parents);
|
|
1109
|
-
}
|
|
1110
|
-
function Pr(t, e, i) {
|
|
1111
|
-
var r = this.enter(), n = this, s = this.exit();
|
|
1112
|
-
return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (n = e(n), n && (n = n.selection())), i == null ? s.remove() : i(s), r && n ? r.merge(n).order() : n;
|
|
1113
|
-
}
|
|
1114
|
-
function Hr(t) {
|
|
1115
|
-
for (var e = t.selection ? t.selection() : t, i = this._groups, r = e._groups, n = i.length, s = r.length, o = Math.min(n, s), a = new Array(n), h = 0; h < o; ++h)
|
|
1116
|
-
for (var l = i[h], c = r[h], u = l.length, f = a[h] = new Array(u), d, g = 0; g < u; ++g)
|
|
1117
|
-
(d = l[g] || c[g]) && (f[g] = d);
|
|
1118
|
-
for (; h < n; ++h)
|
|
1119
|
-
a[h] = i[h];
|
|
1120
|
-
return new L(a, this._parents);
|
|
1121
|
-
}
|
|
1122
|
-
function zr() {
|
|
1123
|
-
for (var t = this._groups, e = -1, i = t.length; ++e < i; )
|
|
1124
|
-
for (var r = t[e], n = r.length - 1, s = r[n], o; --n >= 0; )
|
|
1125
|
-
(o = r[n]) && (s && o.compareDocumentPosition(s) ^ 4 && s.parentNode.insertBefore(o, s), s = o);
|
|
1126
|
-
return this;
|
|
1127
|
-
}
|
|
1128
|
-
function Or(t) {
|
|
1129
|
-
t || (t = Rr);
|
|
1130
|
-
function e(u, f) {
|
|
1131
|
-
return u && f ? t(u.__data__, f.__data__) : !u - !f;
|
|
1132
|
-
}
|
|
1133
|
-
for (var i = this._groups, r = i.length, n = new Array(r), s = 0; s < r; ++s) {
|
|
1134
|
-
for (var o = i[s], a = o.length, h = n[s] = new Array(a), l, c = 0; c < a; ++c)
|
|
1135
|
-
(l = o[c]) && (h[c] = l);
|
|
1136
|
-
h.sort(e);
|
|
1137
|
-
}
|
|
1138
|
-
return new L(n, this._parents).order();
|
|
1139
|
-
}
|
|
1140
|
-
function Rr(t, e) {
|
|
1141
|
-
return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
|
|
1142
|
-
}
|
|
1143
|
-
function Tr() {
|
|
1144
|
-
var t = arguments[0];
|
|
1145
|
-
return arguments[0] = this, t.apply(null, arguments), this;
|
|
1146
|
-
}
|
|
1147
|
-
function Lr() {
|
|
1148
|
-
return Array.from(this);
|
|
1149
|
-
}
|
|
1150
|
-
function Fr() {
|
|
1151
|
-
for (var t = this._groups, e = 0, i = t.length; e < i; ++e)
|
|
1152
|
-
for (var r = t[e], n = 0, s = r.length; n < s; ++n) {
|
|
1153
|
-
var o = r[n];
|
|
1154
|
-
if (o) return o;
|
|
1155
|
-
}
|
|
1156
|
-
return null;
|
|
1157
|
-
}
|
|
1158
|
-
function kr() {
|
|
1159
|
-
let t = 0;
|
|
1160
|
-
for (const e of this) ++t;
|
|
1161
|
-
return t;
|
|
1162
|
-
}
|
|
1163
|
-
function Ir() {
|
|
1164
|
-
return !this.node();
|
|
1165
|
-
}
|
|
1166
|
-
function Dr(t) {
|
|
1167
|
-
for (var e = this._groups, i = 0, r = e.length; i < r; ++i)
|
|
1168
|
-
for (var n = e[i], s = 0, o = n.length, a; s < o; ++s)
|
|
1169
|
-
(a = n[s]) && t.call(a, a.__data__, s, n);
|
|
1170
|
-
return this;
|
|
1171
|
-
}
|
|
1172
|
-
function qr(t) {
|
|
1173
|
-
return function() {
|
|
1174
|
-
this.removeAttribute(t);
|
|
1175
|
-
};
|
|
1176
|
-
}
|
|
1177
|
-
function Ur(t) {
|
|
1178
|
-
return function() {
|
|
1179
|
-
this.removeAttributeNS(t.space, t.local);
|
|
1180
|
-
};
|
|
1181
|
-
}
|
|
1182
|
-
function Xr(t, e) {
|
|
1183
|
-
return function() {
|
|
1184
|
-
this.setAttribute(t, e);
|
|
1185
|
-
};
|
|
1186
|
-
}
|
|
1187
|
-
function Yr(t, e) {
|
|
1188
|
-
return function() {
|
|
1189
|
-
this.setAttributeNS(t.space, t.local, e);
|
|
1190
|
-
};
|
|
1191
|
-
}
|
|
1192
|
-
function Br(t, e) {
|
|
1193
|
-
return function() {
|
|
1194
|
-
var i = e.apply(this, arguments);
|
|
1195
|
-
i == null ? this.removeAttribute(t) : this.setAttribute(t, i);
|
|
1196
|
-
};
|
|
1197
|
-
}
|
|
1198
|
-
function Wr(t, e) {
|
|
1199
|
-
return function() {
|
|
1200
|
-
var i = e.apply(this, arguments);
|
|
1201
|
-
i == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, i);
|
|
1202
|
-
};
|
|
1203
|
-
}
|
|
1204
|
-
function Vr(t, e) {
|
|
1205
|
-
var i = Bt(t);
|
|
1206
|
-
if (arguments.length < 2) {
|
|
1207
|
-
var r = this.node();
|
|
1208
|
-
return i.local ? r.getAttributeNS(i.space, i.local) : r.getAttribute(i);
|
|
1209
|
-
}
|
|
1210
|
-
return this.each((e == null ? i.local ? Ur : qr : typeof e == "function" ? i.local ? Wr : Br : i.local ? Yr : Xr)(i, e));
|
|
1211
|
-
}
|
|
1212
|
-
function ii(t) {
|
|
1213
|
-
return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView;
|
|
1214
|
-
}
|
|
1215
|
-
function Gr(t) {
|
|
1216
|
-
return function() {
|
|
1217
|
-
this.style.removeProperty(t);
|
|
1218
|
-
};
|
|
1219
|
-
}
|
|
1220
|
-
function Kr(t, e, i) {
|
|
1221
|
-
return function() {
|
|
1222
|
-
this.style.setProperty(t, e, i);
|
|
1223
|
-
};
|
|
1224
|
-
}
|
|
1225
|
-
function Zr(t, e, i) {
|
|
1226
|
-
return function() {
|
|
1227
|
-
var r = e.apply(this, arguments);
|
|
1228
|
-
r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, i);
|
|
1229
|
-
};
|
|
1230
|
-
}
|
|
1231
|
-
function Jr(t, e, i) {
|
|
1232
|
-
return arguments.length > 1 ? this.each((e == null ? Gr : typeof e == "function" ? Zr : Kr)(t, e, i ?? "")) : nt(this.node(), t);
|
|
1233
|
-
}
|
|
1234
|
-
function nt(t, e) {
|
|
1235
|
-
return t.style.getPropertyValue(e) || ii(t).getComputedStyle(t, null).getPropertyValue(e);
|
|
1236
|
-
}
|
|
1237
|
-
function Qr(t) {
|
|
1238
|
-
return function() {
|
|
1239
|
-
delete this[t];
|
|
1240
|
-
};
|
|
1241
|
-
}
|
|
1242
|
-
function jr(t, e) {
|
|
1243
|
-
return function() {
|
|
1244
|
-
this[t] = e;
|
|
1245
|
-
};
|
|
1246
|
-
}
|
|
1247
|
-
function tn(t, e) {
|
|
1248
|
-
return function() {
|
|
1249
|
-
var i = e.apply(this, arguments);
|
|
1250
|
-
i == null ? delete this[t] : this[t] = i;
|
|
1251
|
-
};
|
|
1252
|
-
}
|
|
1253
|
-
function en(t, e) {
|
|
1254
|
-
return arguments.length > 1 ? this.each((e == null ? Qr : typeof e == "function" ? tn : jr)(t, e)) : this.node()[t];
|
|
1255
|
-
}
|
|
1256
|
-
function ri(t) {
|
|
1257
|
-
return t.trim().split(/^|\s+/);
|
|
1258
|
-
}
|
|
1259
|
-
function pe(t) {
|
|
1260
|
-
return t.classList || new ni(t);
|
|
1261
|
-
}
|
|
1262
|
-
function ni(t) {
|
|
1263
|
-
this._node = t, this._names = ri(t.getAttribute("class") || "");
|
|
1264
|
-
}
|
|
1265
|
-
ni.prototype = {
|
|
1266
|
-
add: function(t) {
|
|
1267
|
-
var e = this._names.indexOf(t);
|
|
1268
|
-
e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" ")));
|
|
1269
|
-
},
|
|
1270
|
-
remove: function(t) {
|
|
1271
|
-
var e = this._names.indexOf(t);
|
|
1272
|
-
e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" ")));
|
|
1273
|
-
},
|
|
1274
|
-
contains: function(t) {
|
|
1275
|
-
return this._names.indexOf(t) >= 0;
|
|
1276
|
-
}
|
|
1277
|
-
};
|
|
1278
|
-
function si(t, e) {
|
|
1279
|
-
for (var i = pe(t), r = -1, n = e.length; ++r < n; ) i.add(e[r]);
|
|
1280
|
-
}
|
|
1281
|
-
function oi(t, e) {
|
|
1282
|
-
for (var i = pe(t), r = -1, n = e.length; ++r < n; ) i.remove(e[r]);
|
|
1283
|
-
}
|
|
1284
|
-
function rn(t) {
|
|
1285
|
-
return function() {
|
|
1286
|
-
si(this, t);
|
|
1287
|
-
};
|
|
1288
|
-
}
|
|
1289
|
-
function nn(t) {
|
|
1290
|
-
return function() {
|
|
1291
|
-
oi(this, t);
|
|
1292
|
-
};
|
|
1293
|
-
}
|
|
1294
|
-
function sn(t, e) {
|
|
1295
|
-
return function() {
|
|
1296
|
-
(e.apply(this, arguments) ? si : oi)(this, t);
|
|
1297
|
-
};
|
|
1298
|
-
}
|
|
1299
|
-
function on(t, e) {
|
|
1300
|
-
var i = ri(t + "");
|
|
1301
|
-
if (arguments.length < 2) {
|
|
1302
|
-
for (var r = pe(this.node()), n = -1, s = i.length; ++n < s; ) if (!r.contains(i[n])) return !1;
|
|
1303
|
-
return !0;
|
|
1304
|
-
}
|
|
1305
|
-
return this.each((typeof e == "function" ? sn : e ? rn : nn)(i, e));
|
|
1306
|
-
}
|
|
1307
|
-
function an() {
|
|
1308
|
-
this.textContent = "";
|
|
1309
|
-
}
|
|
1310
|
-
function hn(t) {
|
|
1311
|
-
return function() {
|
|
1312
|
-
this.textContent = t;
|
|
1313
|
-
};
|
|
1314
|
-
}
|
|
1315
|
-
function ln(t) {
|
|
1316
|
-
return function() {
|
|
1317
|
-
var e = t.apply(this, arguments);
|
|
1318
|
-
this.textContent = e ?? "";
|
|
1319
|
-
};
|
|
1320
|
-
}
|
|
1321
|
-
function cn(t) {
|
|
1322
|
-
return arguments.length ? this.each(t == null ? an : (typeof t == "function" ? ln : hn)(t)) : this.node().textContent;
|
|
1323
|
-
}
|
|
1324
|
-
function un() {
|
|
1325
|
-
this.innerHTML = "";
|
|
1326
|
-
}
|
|
1327
|
-
function pn(t) {
|
|
1328
|
-
return function() {
|
|
1329
|
-
this.innerHTML = t;
|
|
1330
|
-
};
|
|
1331
|
-
}
|
|
1332
|
-
function fn(t) {
|
|
1333
|
-
return function() {
|
|
1334
|
-
var e = t.apply(this, arguments);
|
|
1335
|
-
this.innerHTML = e ?? "";
|
|
1336
|
-
};
|
|
1337
|
-
}
|
|
1338
|
-
function dn(t) {
|
|
1339
|
-
return arguments.length ? this.each(t == null ? un : (typeof t == "function" ? fn : pn)(t)) : this.node().innerHTML;
|
|
1340
|
-
}
|
|
1341
|
-
function gn() {
|
|
1342
|
-
this.nextSibling && this.parentNode.appendChild(this);
|
|
1343
|
-
}
|
|
1344
|
-
function yn() {
|
|
1345
|
-
return this.each(gn);
|
|
1346
|
-
}
|
|
1347
|
-
function bn() {
|
|
1348
|
-
this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
|
|
1349
|
-
}
|
|
1350
|
-
function mn() {
|
|
1351
|
-
return this.each(bn);
|
|
1352
|
-
}
|
|
1353
|
-
function _n(t) {
|
|
1354
|
-
var e = typeof t == "function" ? t : Je(t);
|
|
1355
|
-
return this.select(function() {
|
|
1356
|
-
return this.appendChild(e.apply(this, arguments));
|
|
1357
|
-
});
|
|
1358
|
-
}
|
|
1359
|
-
function xn() {
|
|
1360
|
-
return null;
|
|
1361
|
-
}
|
|
1362
|
-
function vn(t, e) {
|
|
1363
|
-
var i = typeof t == "function" ? t : Je(t), r = e == null ? xn : typeof e == "function" ? e : ue(e);
|
|
1364
|
-
return this.select(function() {
|
|
1365
|
-
return this.insertBefore(i.apply(this, arguments), r.apply(this, arguments) || null);
|
|
1366
|
-
});
|
|
1367
|
-
}
|
|
1368
|
-
function wn() {
|
|
1369
|
-
var t = this.parentNode;
|
|
1370
|
-
t && t.removeChild(this);
|
|
1371
|
-
}
|
|
1372
|
-
function Sn() {
|
|
1373
|
-
return this.each(wn);
|
|
1374
|
-
}
|
|
1375
|
-
function $n() {
|
|
1376
|
-
var t = this.cloneNode(!1), e = this.parentNode;
|
|
1377
|
-
return e ? e.insertBefore(t, this.nextSibling) : t;
|
|
1378
|
-
}
|
|
1379
|
-
function An() {
|
|
1380
|
-
var t = this.cloneNode(!0), e = this.parentNode;
|
|
1381
|
-
return e ? e.insertBefore(t, this.nextSibling) : t;
|
|
1382
|
-
}
|
|
1383
|
-
function Cn(t) {
|
|
1384
|
-
return this.select(t ? An : $n);
|
|
1385
|
-
}
|
|
1386
|
-
function Mn(t) {
|
|
1387
|
-
return arguments.length ? this.property("__data__", t) : this.node().__data__;
|
|
1388
|
-
}
|
|
1389
|
-
function En(t) {
|
|
1390
|
-
return function(e) {
|
|
1391
|
-
t.call(this, e, this.__data__);
|
|
1392
|
-
};
|
|
1393
|
-
}
|
|
1394
|
-
function Nn(t) {
|
|
1395
|
-
return t.trim().split(/^|\s+/).map(function(e) {
|
|
1396
|
-
var i = "", r = e.indexOf(".");
|
|
1397
|
-
return r >= 0 && (i = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: i };
|
|
1398
|
-
});
|
|
1399
|
-
}
|
|
1400
|
-
function Pn(t) {
|
|
1401
|
-
return function() {
|
|
1402
|
-
var e = this.__on;
|
|
1403
|
-
if (e) {
|
|
1404
|
-
for (var i = 0, r = -1, n = e.length, s; i < n; ++i)
|
|
1405
|
-
s = e[i], (!t.type || s.type === t.type) && s.name === t.name ? this.removeEventListener(s.type, s.listener, s.options) : e[++r] = s;
|
|
1406
|
-
++r ? e.length = r : delete this.__on;
|
|
1407
|
-
}
|
|
1408
|
-
};
|
|
1409
|
-
}
|
|
1410
|
-
function Hn(t, e, i) {
|
|
1411
|
-
return function() {
|
|
1412
|
-
var r = this.__on, n, s = En(e);
|
|
1413
|
-
if (r) {
|
|
1414
|
-
for (var o = 0, a = r.length; o < a; ++o)
|
|
1415
|
-
if ((n = r[o]).type === t.type && n.name === t.name) {
|
|
1416
|
-
this.removeEventListener(n.type, n.listener, n.options), this.addEventListener(n.type, n.listener = s, n.options = i), n.value = e;
|
|
1417
|
-
return;
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
this.addEventListener(t.type, s, i), n = { type: t.type, name: t.name, value: e, listener: s, options: i }, r ? r.push(n) : this.__on = [n];
|
|
1421
|
-
};
|
|
1422
|
-
}
|
|
1423
|
-
function zn(t, e, i) {
|
|
1424
|
-
var r = Nn(t + ""), n, s = r.length, o;
|
|
1425
|
-
if (arguments.length < 2) {
|
|
1426
|
-
var a = this.node().__on;
|
|
1427
|
-
if (a) {
|
|
1428
|
-
for (var h = 0, l = a.length, c; h < l; ++h)
|
|
1429
|
-
for (n = 0, c = a[h]; n < s; ++n)
|
|
1430
|
-
if ((o = r[n]).type === c.type && o.name === c.name)
|
|
1431
|
-
return c.value;
|
|
1432
|
-
}
|
|
1433
|
-
return;
|
|
1434
|
-
}
|
|
1435
|
-
for (a = e ? Hn : Pn, n = 0; n < s; ++n) this.each(a(r[n], e, i));
|
|
1436
|
-
return this;
|
|
1437
|
-
}
|
|
1438
|
-
function ai(t, e, i) {
|
|
1439
|
-
var r = ii(t), n = r.CustomEvent;
|
|
1440
|
-
typeof n == "function" ? n = new n(e, i) : (n = r.document.createEvent("Event"), i ? (n.initEvent(e, i.bubbles, i.cancelable), n.detail = i.detail) : n.initEvent(e, !1, !1)), t.dispatchEvent(n);
|
|
1441
|
-
}
|
|
1442
|
-
function On(t, e) {
|
|
1443
|
-
return function() {
|
|
1444
|
-
return ai(this, t, e);
|
|
1445
|
-
};
|
|
1446
|
-
}
|
|
1447
|
-
function Rn(t, e) {
|
|
1448
|
-
return function() {
|
|
1449
|
-
return ai(this, t, e.apply(this, arguments));
|
|
1450
|
-
};
|
|
1451
|
-
}
|
|
1452
|
-
function Tn(t, e) {
|
|
1453
|
-
return this.each((typeof e == "function" ? Rn : On)(t, e));
|
|
1454
|
-
}
|
|
1455
|
-
function* Ln() {
|
|
1456
|
-
for (var t = this._groups, e = 0, i = t.length; e < i; ++e)
|
|
1457
|
-
for (var r = t[e], n = 0, s = r.length, o; n < s; ++n)
|
|
1458
|
-
(o = r[n]) && (yield o);
|
|
1459
|
-
}
|
|
1460
|
-
var Fn = [null];
|
|
1461
|
-
function L(t, e) {
|
|
1462
|
-
this._groups = t, this._parents = e;
|
|
1463
|
-
}
|
|
1464
|
-
function St() {
|
|
1465
|
-
return new L([[document.documentElement]], Fn);
|
|
1466
|
-
}
|
|
1467
|
-
function kn() {
|
|
1468
|
-
return this;
|
|
1469
|
-
}
|
|
1470
|
-
L.prototype = St.prototype = {
|
|
1471
|
-
constructor: L,
|
|
1472
|
-
select: hr,
|
|
1473
|
-
selectAll: pr,
|
|
1474
|
-
selectChild: yr,
|
|
1475
|
-
selectChildren: xr,
|
|
1476
|
-
filter: vr,
|
|
1477
|
-
data: Mr,
|
|
1478
|
-
enter: wr,
|
|
1479
|
-
exit: Nr,
|
|
1480
|
-
join: Pr,
|
|
1481
|
-
merge: Hr,
|
|
1482
|
-
selection: kn,
|
|
1483
|
-
order: zr,
|
|
1484
|
-
sort: Or,
|
|
1485
|
-
call: Tr,
|
|
1486
|
-
nodes: Lr,
|
|
1487
|
-
node: Fr,
|
|
1488
|
-
size: kr,
|
|
1489
|
-
empty: Ir,
|
|
1490
|
-
each: Dr,
|
|
1491
|
-
attr: Vr,
|
|
1492
|
-
style: Jr,
|
|
1493
|
-
property: en,
|
|
1494
|
-
classed: on,
|
|
1495
|
-
text: cn,
|
|
1496
|
-
html: dn,
|
|
1497
|
-
raise: yn,
|
|
1498
|
-
lower: mn,
|
|
1499
|
-
append: _n,
|
|
1500
|
-
insert: vn,
|
|
1501
|
-
remove: Sn,
|
|
1502
|
-
clone: Cn,
|
|
1503
|
-
datum: Mn,
|
|
1504
|
-
on: zn,
|
|
1505
|
-
dispatch: Tn,
|
|
1506
|
-
[Symbol.iterator]: Ln
|
|
1507
|
-
};
|
|
1508
|
-
function fe(t, e, i) {
|
|
1509
|
-
t.prototype = e.prototype = i, i.constructor = t;
|
|
1510
|
-
}
|
|
1511
|
-
function hi(t, e) {
|
|
1512
|
-
var i = Object.create(t.prototype);
|
|
1513
|
-
for (var r in e) i[r] = e[r];
|
|
1514
|
-
return i;
|
|
1515
|
-
}
|
|
1516
|
-
function $t() {
|
|
1517
|
-
}
|
|
1518
|
-
var mt = 0.7, Lt = 1 / mt, et = "\\s*([+-]?\\d+)\\s*", _t = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", k = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", In = /^#([0-9a-f]{3,8})$/, Dn = new RegExp(`^rgb\\(${et},${et},${et}\\)$`), qn = new RegExp(`^rgb\\(${k},${k},${k}\\)$`), Un = new RegExp(`^rgba\\(${et},${et},${et},${_t}\\)$`), Xn = new RegExp(`^rgba\\(${k},${k},${k},${_t}\\)$`), Yn = new RegExp(`^hsl\\(${_t},${k},${k}\\)$`), Bn = new RegExp(`^hsla\\(${_t},${k},${k},${_t}\\)$`), He = {
|
|
1519
|
-
aliceblue: 15792383,
|
|
1520
|
-
antiquewhite: 16444375,
|
|
1521
|
-
aqua: 65535,
|
|
1522
|
-
aquamarine: 8388564,
|
|
1523
|
-
azure: 15794175,
|
|
1524
|
-
beige: 16119260,
|
|
1525
|
-
bisque: 16770244,
|
|
1526
|
-
black: 0,
|
|
1527
|
-
blanchedalmond: 16772045,
|
|
1528
|
-
blue: 255,
|
|
1529
|
-
blueviolet: 9055202,
|
|
1530
|
-
brown: 10824234,
|
|
1531
|
-
burlywood: 14596231,
|
|
1532
|
-
cadetblue: 6266528,
|
|
1533
|
-
chartreuse: 8388352,
|
|
1534
|
-
chocolate: 13789470,
|
|
1535
|
-
coral: 16744272,
|
|
1536
|
-
cornflowerblue: 6591981,
|
|
1537
|
-
cornsilk: 16775388,
|
|
1538
|
-
crimson: 14423100,
|
|
1539
|
-
cyan: 65535,
|
|
1540
|
-
darkblue: 139,
|
|
1541
|
-
darkcyan: 35723,
|
|
1542
|
-
darkgoldenrod: 12092939,
|
|
1543
|
-
darkgray: 11119017,
|
|
1544
|
-
darkgreen: 25600,
|
|
1545
|
-
darkgrey: 11119017,
|
|
1546
|
-
darkkhaki: 12433259,
|
|
1547
|
-
darkmagenta: 9109643,
|
|
1548
|
-
darkolivegreen: 5597999,
|
|
1549
|
-
darkorange: 16747520,
|
|
1550
|
-
darkorchid: 10040012,
|
|
1551
|
-
darkred: 9109504,
|
|
1552
|
-
darksalmon: 15308410,
|
|
1553
|
-
darkseagreen: 9419919,
|
|
1554
|
-
darkslateblue: 4734347,
|
|
1555
|
-
darkslategray: 3100495,
|
|
1556
|
-
darkslategrey: 3100495,
|
|
1557
|
-
darkturquoise: 52945,
|
|
1558
|
-
darkviolet: 9699539,
|
|
1559
|
-
deeppink: 16716947,
|
|
1560
|
-
deepskyblue: 49151,
|
|
1561
|
-
dimgray: 6908265,
|
|
1562
|
-
dimgrey: 6908265,
|
|
1563
|
-
dodgerblue: 2003199,
|
|
1564
|
-
firebrick: 11674146,
|
|
1565
|
-
floralwhite: 16775920,
|
|
1566
|
-
forestgreen: 2263842,
|
|
1567
|
-
fuchsia: 16711935,
|
|
1568
|
-
gainsboro: 14474460,
|
|
1569
|
-
ghostwhite: 16316671,
|
|
1570
|
-
gold: 16766720,
|
|
1571
|
-
goldenrod: 14329120,
|
|
1572
|
-
gray: 8421504,
|
|
1573
|
-
green: 32768,
|
|
1574
|
-
greenyellow: 11403055,
|
|
1575
|
-
grey: 8421504,
|
|
1576
|
-
honeydew: 15794160,
|
|
1577
|
-
hotpink: 16738740,
|
|
1578
|
-
indianred: 13458524,
|
|
1579
|
-
indigo: 4915330,
|
|
1580
|
-
ivory: 16777200,
|
|
1581
|
-
khaki: 15787660,
|
|
1582
|
-
lavender: 15132410,
|
|
1583
|
-
lavenderblush: 16773365,
|
|
1584
|
-
lawngreen: 8190976,
|
|
1585
|
-
lemonchiffon: 16775885,
|
|
1586
|
-
lightblue: 11393254,
|
|
1587
|
-
lightcoral: 15761536,
|
|
1588
|
-
lightcyan: 14745599,
|
|
1589
|
-
lightgoldenrodyellow: 16448210,
|
|
1590
|
-
lightgray: 13882323,
|
|
1591
|
-
lightgreen: 9498256,
|
|
1592
|
-
lightgrey: 13882323,
|
|
1593
|
-
lightpink: 16758465,
|
|
1594
|
-
lightsalmon: 16752762,
|
|
1595
|
-
lightseagreen: 2142890,
|
|
1596
|
-
lightskyblue: 8900346,
|
|
1597
|
-
lightslategray: 7833753,
|
|
1598
|
-
lightslategrey: 7833753,
|
|
1599
|
-
lightsteelblue: 11584734,
|
|
1600
|
-
lightyellow: 16777184,
|
|
1601
|
-
lime: 65280,
|
|
1602
|
-
limegreen: 3329330,
|
|
1603
|
-
linen: 16445670,
|
|
1604
|
-
magenta: 16711935,
|
|
1605
|
-
maroon: 8388608,
|
|
1606
|
-
mediumaquamarine: 6737322,
|
|
1607
|
-
mediumblue: 205,
|
|
1608
|
-
mediumorchid: 12211667,
|
|
1609
|
-
mediumpurple: 9662683,
|
|
1610
|
-
mediumseagreen: 3978097,
|
|
1611
|
-
mediumslateblue: 8087790,
|
|
1612
|
-
mediumspringgreen: 64154,
|
|
1613
|
-
mediumturquoise: 4772300,
|
|
1614
|
-
mediumvioletred: 13047173,
|
|
1615
|
-
midnightblue: 1644912,
|
|
1616
|
-
mintcream: 16121850,
|
|
1617
|
-
mistyrose: 16770273,
|
|
1618
|
-
moccasin: 16770229,
|
|
1619
|
-
navajowhite: 16768685,
|
|
1620
|
-
navy: 128,
|
|
1621
|
-
oldlace: 16643558,
|
|
1622
|
-
olive: 8421376,
|
|
1623
|
-
olivedrab: 7048739,
|
|
1624
|
-
orange: 16753920,
|
|
1625
|
-
orangered: 16729344,
|
|
1626
|
-
orchid: 14315734,
|
|
1627
|
-
palegoldenrod: 15657130,
|
|
1628
|
-
palegreen: 10025880,
|
|
1629
|
-
paleturquoise: 11529966,
|
|
1630
|
-
palevioletred: 14381203,
|
|
1631
|
-
papayawhip: 16773077,
|
|
1632
|
-
peachpuff: 16767673,
|
|
1633
|
-
peru: 13468991,
|
|
1634
|
-
pink: 16761035,
|
|
1635
|
-
plum: 14524637,
|
|
1636
|
-
powderblue: 11591910,
|
|
1637
|
-
purple: 8388736,
|
|
1638
|
-
rebeccapurple: 6697881,
|
|
1639
|
-
red: 16711680,
|
|
1640
|
-
rosybrown: 12357519,
|
|
1641
|
-
royalblue: 4286945,
|
|
1642
|
-
saddlebrown: 9127187,
|
|
1643
|
-
salmon: 16416882,
|
|
1644
|
-
sandybrown: 16032864,
|
|
1645
|
-
seagreen: 3050327,
|
|
1646
|
-
seashell: 16774638,
|
|
1647
|
-
sienna: 10506797,
|
|
1648
|
-
silver: 12632256,
|
|
1649
|
-
skyblue: 8900331,
|
|
1650
|
-
slateblue: 6970061,
|
|
1651
|
-
slategray: 7372944,
|
|
1652
|
-
slategrey: 7372944,
|
|
1653
|
-
snow: 16775930,
|
|
1654
|
-
springgreen: 65407,
|
|
1655
|
-
steelblue: 4620980,
|
|
1656
|
-
tan: 13808780,
|
|
1657
|
-
teal: 32896,
|
|
1658
|
-
thistle: 14204888,
|
|
1659
|
-
tomato: 16737095,
|
|
1660
|
-
turquoise: 4251856,
|
|
1661
|
-
violet: 15631086,
|
|
1662
|
-
wheat: 16113331,
|
|
1663
|
-
white: 16777215,
|
|
1664
|
-
whitesmoke: 16119285,
|
|
1665
|
-
yellow: 16776960,
|
|
1666
|
-
yellowgreen: 10145074
|
|
1667
|
-
};
|
|
1668
|
-
fe($t, xt, {
|
|
1669
|
-
copy(t) {
|
|
1670
|
-
return Object.assign(new this.constructor(), this, t);
|
|
1671
|
-
},
|
|
1672
|
-
displayable() {
|
|
1673
|
-
return this.rgb().displayable();
|
|
1674
|
-
},
|
|
1675
|
-
hex: ze,
|
|
1676
|
-
// Deprecated! Use color.formatHex.
|
|
1677
|
-
formatHex: ze,
|
|
1678
|
-
formatHex8: Wn,
|
|
1679
|
-
formatHsl: Vn,
|
|
1680
|
-
formatRgb: Oe,
|
|
1681
|
-
toString: Oe
|
|
1682
|
-
});
|
|
1683
|
-
function ze() {
|
|
1684
|
-
return this.rgb().formatHex();
|
|
1685
|
-
}
|
|
1686
|
-
function Wn() {
|
|
1687
|
-
return this.rgb().formatHex8();
|
|
1688
|
-
}
|
|
1689
|
-
function Vn() {
|
|
1690
|
-
return li(this).formatHsl();
|
|
1691
|
-
}
|
|
1692
|
-
function Oe() {
|
|
1693
|
-
return this.rgb().formatRgb();
|
|
1694
|
-
}
|
|
1695
|
-
function xt(t) {
|
|
1696
|
-
var e, i;
|
|
1697
|
-
return t = (t + "").trim().toLowerCase(), (e = In.exec(t)) ? (i = e[1].length, e = parseInt(e[1], 16), i === 6 ? Re(e) : i === 3 ? new E(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : i === 8 ? At(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : i === 4 ? At(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Dn.exec(t)) ? new E(e[1], e[2], e[3], 1) : (e = qn.exec(t)) ? new E(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Un.exec(t)) ? At(e[1], e[2], e[3], e[4]) : (e = Xn.exec(t)) ? At(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Yn.exec(t)) ? Fe(e[1], e[2] / 100, e[3] / 100, 1) : (e = Bn.exec(t)) ? Fe(e[1], e[2] / 100, e[3] / 100, e[4]) : He.hasOwnProperty(t) ? Re(He[t]) : t === "transparent" ? new E(NaN, NaN, NaN, 0) : null;
|
|
1698
|
-
}
|
|
1699
|
-
function Re(t) {
|
|
1700
|
-
return new E(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
|
|
1701
|
-
}
|
|
1702
|
-
function At(t, e, i, r) {
|
|
1703
|
-
return r <= 0 && (t = e = i = NaN), new E(t, e, i, r);
|
|
1704
|
-
}
|
|
1705
|
-
function Gn(t) {
|
|
1706
|
-
return t instanceof $t || (t = xt(t)), t ? (t = t.rgb(), new E(t.r, t.g, t.b, t.opacity)) : new E();
|
|
1707
|
-
}
|
|
1708
|
-
function Qt(t, e, i, r) {
|
|
1709
|
-
return arguments.length === 1 ? Gn(t) : new E(t, e, i, r ?? 1);
|
|
1710
|
-
}
|
|
1711
|
-
function E(t, e, i, r) {
|
|
1712
|
-
this.r = +t, this.g = +e, this.b = +i, this.opacity = +r;
|
|
1713
|
-
}
|
|
1714
|
-
fe(E, Qt, hi($t, {
|
|
1715
|
-
brighter(t) {
|
|
1716
|
-
return t = t == null ? Lt : Math.pow(Lt, t), new E(this.r * t, this.g * t, this.b * t, this.opacity);
|
|
1717
|
-
},
|
|
1718
|
-
darker(t) {
|
|
1719
|
-
return t = t == null ? mt : Math.pow(mt, t), new E(this.r * t, this.g * t, this.b * t, this.opacity);
|
|
1720
|
-
},
|
|
1721
|
-
rgb() {
|
|
1722
|
-
return this;
|
|
1723
|
-
},
|
|
1724
|
-
clamp() {
|
|
1725
|
-
return new E(K(this.r), K(this.g), K(this.b), Ft(this.opacity));
|
|
1726
|
-
},
|
|
1727
|
-
displayable() {
|
|
1728
|
-
return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
|
|
1729
|
-
},
|
|
1730
|
-
hex: Te,
|
|
1731
|
-
// Deprecated! Use color.formatHex.
|
|
1732
|
-
formatHex: Te,
|
|
1733
|
-
formatHex8: Kn,
|
|
1734
|
-
formatRgb: Le,
|
|
1735
|
-
toString: Le
|
|
1736
|
-
}));
|
|
1737
|
-
function Te() {
|
|
1738
|
-
return `#${G(this.r)}${G(this.g)}${G(this.b)}`;
|
|
1739
|
-
}
|
|
1740
|
-
function Kn() {
|
|
1741
|
-
return `#${G(this.r)}${G(this.g)}${G(this.b)}${G((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
1742
|
-
}
|
|
1743
|
-
function Le() {
|
|
1744
|
-
const t = Ft(this.opacity);
|
|
1745
|
-
return `${t === 1 ? "rgb(" : "rgba("}${K(this.r)}, ${K(this.g)}, ${K(this.b)}${t === 1 ? ")" : `, ${t})`}`;
|
|
1746
|
-
}
|
|
1747
|
-
function Ft(t) {
|
|
1748
|
-
return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
|
|
1749
|
-
}
|
|
1750
|
-
function K(t) {
|
|
1751
|
-
return Math.max(0, Math.min(255, Math.round(t) || 0));
|
|
1752
|
-
}
|
|
1753
|
-
function G(t) {
|
|
1754
|
-
return t = K(t), (t < 16 ? "0" : "") + t.toString(16);
|
|
1755
|
-
}
|
|
1756
|
-
function Fe(t, e, i, r) {
|
|
1757
|
-
return r <= 0 ? t = e = i = NaN : i <= 0 || i >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new T(t, e, i, r);
|
|
1758
|
-
}
|
|
1759
|
-
function li(t) {
|
|
1760
|
-
if (t instanceof T) return new T(t.h, t.s, t.l, t.opacity);
|
|
1761
|
-
if (t instanceof $t || (t = xt(t)), !t) return new T();
|
|
1762
|
-
if (t instanceof T) return t;
|
|
1763
|
-
t = t.rgb();
|
|
1764
|
-
var e = t.r / 255, i = t.g / 255, r = t.b / 255, n = Math.min(e, i, r), s = Math.max(e, i, r), o = NaN, a = s - n, h = (s + n) / 2;
|
|
1765
|
-
return a ? (e === s ? o = (i - r) / a + (i < r) * 6 : i === s ? o = (r - e) / a + 2 : o = (e - i) / a + 4, a /= h < 0.5 ? s + n : 2 - s - n, o *= 60) : a = h > 0 && h < 1 ? 0 : o, new T(o, a, h, t.opacity);
|
|
1766
|
-
}
|
|
1767
|
-
function kt(t, e, i, r) {
|
|
1768
|
-
return arguments.length === 1 ? li(t) : new T(t, e, i, r ?? 1);
|
|
1769
|
-
}
|
|
1770
|
-
function T(t, e, i, r) {
|
|
1771
|
-
this.h = +t, this.s = +e, this.l = +i, this.opacity = +r;
|
|
1772
|
-
}
|
|
1773
|
-
fe(T, kt, hi($t, {
|
|
1774
|
-
brighter(t) {
|
|
1775
|
-
return t = t == null ? Lt : Math.pow(Lt, t), new T(this.h, this.s, this.l * t, this.opacity);
|
|
1776
|
-
},
|
|
1777
|
-
darker(t) {
|
|
1778
|
-
return t = t == null ? mt : Math.pow(mt, t), new T(this.h, this.s, this.l * t, this.opacity);
|
|
1779
|
-
},
|
|
1780
|
-
rgb() {
|
|
1781
|
-
var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, i = this.l, r = i + (i < 0.5 ? i : 1 - i) * e, n = 2 * i - r;
|
|
1782
|
-
return new E(
|
|
1783
|
-
Kt(t >= 240 ? t - 240 : t + 120, n, r),
|
|
1784
|
-
Kt(t, n, r),
|
|
1785
|
-
Kt(t < 120 ? t + 240 : t - 120, n, r),
|
|
1786
|
-
this.opacity
|
|
1787
|
-
);
|
|
1788
|
-
},
|
|
1789
|
-
clamp() {
|
|
1790
|
-
return new T(ke(this.h), Ct(this.s), Ct(this.l), Ft(this.opacity));
|
|
1791
|
-
},
|
|
1792
|
-
displayable() {
|
|
1793
|
-
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
|
1794
|
-
},
|
|
1795
|
-
formatHsl() {
|
|
1796
|
-
const t = Ft(this.opacity);
|
|
1797
|
-
return `${t === 1 ? "hsl(" : "hsla("}${ke(this.h)}, ${Ct(this.s) * 100}%, ${Ct(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
|
|
1798
|
-
}
|
|
1799
|
-
}));
|
|
1800
|
-
function ke(t) {
|
|
1801
|
-
return t = (t || 0) % 360, t < 0 ? t + 360 : t;
|
|
1802
|
-
}
|
|
1803
|
-
function Ct(t) {
|
|
1804
|
-
return Math.max(0, Math.min(1, t || 0));
|
|
1805
|
-
}
|
|
1806
|
-
function Kt(t, e, i) {
|
|
1807
|
-
return (t < 60 ? e + (i - e) * t / 60 : t < 180 ? i : t < 240 ? e + (i - e) * (240 - t) / 60 : e) * 255;
|
|
1808
|
-
}
|
|
1809
|
-
const ci = (t) => () => t;
|
|
1810
|
-
function Zn(t, e) {
|
|
1811
|
-
return function(i) {
|
|
1812
|
-
return t + i * e;
|
|
1813
|
-
};
|
|
1814
|
-
}
|
|
1815
|
-
function Jn(t, e, i) {
|
|
1816
|
-
return t = Math.pow(t, i), e = Math.pow(e, i) - t, i = 1 / i, function(r) {
|
|
1817
|
-
return Math.pow(t + r * e, i);
|
|
1818
|
-
};
|
|
1819
|
-
}
|
|
1820
|
-
function Qn(t) {
|
|
1821
|
-
return (t = +t) == 1 ? ui : function(e, i) {
|
|
1822
|
-
return i - e ? Jn(e, i, t) : ci(isNaN(e) ? i : e);
|
|
1823
|
-
};
|
|
1824
|
-
}
|
|
1825
|
-
function ui(t, e) {
|
|
1826
|
-
var i = e - t;
|
|
1827
|
-
return i ? Zn(t, i) : ci(isNaN(t) ? e : t);
|
|
1828
|
-
}
|
|
1829
|
-
const Ie = (function t(e) {
|
|
1830
|
-
var i = Qn(e);
|
|
1831
|
-
function r(n, s) {
|
|
1832
|
-
var o = i((n = Qt(n)).r, (s = Qt(s)).r), a = i(n.g, s.g), h = i(n.b, s.b), l = ui(n.opacity, s.opacity);
|
|
1833
|
-
return function(c) {
|
|
1834
|
-
return n.r = o(c), n.g = a(c), n.b = h(c), n.opacity = l(c), n + "";
|
|
1835
|
-
};
|
|
1836
|
-
}
|
|
1837
|
-
return r.gamma = t, r;
|
|
1838
|
-
})(1);
|
|
1839
|
-
function Y(t, e) {
|
|
1840
|
-
return t = +t, e = +e, function(i) {
|
|
1841
|
-
return t * (1 - i) + e * i;
|
|
1842
|
-
};
|
|
1843
|
-
}
|
|
1844
|
-
var jt = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Zt = new RegExp(jt.source, "g");
|
|
1845
|
-
function jn(t) {
|
|
1846
|
-
return function() {
|
|
1847
|
-
return t;
|
|
1848
|
-
};
|
|
1849
|
-
}
|
|
1850
|
-
function ts(t) {
|
|
1851
|
-
return function(e) {
|
|
1852
|
-
return t(e) + "";
|
|
1853
|
-
};
|
|
1854
|
-
}
|
|
1855
|
-
function es(t, e) {
|
|
1856
|
-
var i = jt.lastIndex = Zt.lastIndex = 0, r, n, s, o = -1, a = [], h = [];
|
|
1857
|
-
for (t = t + "", e = e + ""; (r = jt.exec(t)) && (n = Zt.exec(e)); )
|
|
1858
|
-
(s = n.index) > i && (s = e.slice(i, s), a[o] ? a[o] += s : a[++o] = s), (r = r[0]) === (n = n[0]) ? a[o] ? a[o] += n : a[++o] = n : (a[++o] = null, h.push({ i: o, x: Y(r, n) })), i = Zt.lastIndex;
|
|
1859
|
-
return i < e.length && (s = e.slice(i), a[o] ? a[o] += s : a[++o] = s), a.length < 2 ? h[0] ? ts(h[0].x) : jn(e) : (e = h.length, function(l) {
|
|
1860
|
-
for (var c = 0, u; c < e; ++c) a[(u = h[c]).i] = u.x(l);
|
|
1861
|
-
return a.join("");
|
|
1862
|
-
});
|
|
1863
|
-
}
|
|
1864
|
-
var De = 180 / Math.PI, te = {
|
|
1865
|
-
translateX: 0,
|
|
1866
|
-
translateY: 0,
|
|
1867
|
-
rotate: 0,
|
|
1868
|
-
skewX: 0,
|
|
1869
|
-
scaleX: 1,
|
|
1870
|
-
scaleY: 1
|
|
1871
|
-
};
|
|
1872
|
-
function pi(t, e, i, r, n, s) {
|
|
1873
|
-
var o, a, h;
|
|
1874
|
-
return (o = Math.sqrt(t * t + e * e)) && (t /= o, e /= o), (h = t * i + e * r) && (i -= t * h, r -= e * h), (a = Math.sqrt(i * i + r * r)) && (i /= a, r /= a, h /= a), t * r < e * i && (t = -t, e = -e, h = -h, o = -o), {
|
|
1875
|
-
translateX: n,
|
|
1876
|
-
translateY: s,
|
|
1877
|
-
rotate: Math.atan2(e, t) * De,
|
|
1878
|
-
skewX: Math.atan(h) * De,
|
|
1879
|
-
scaleX: o,
|
|
1880
|
-
scaleY: a
|
|
1881
|
-
};
|
|
1882
|
-
}
|
|
1883
|
-
var Mt;
|
|
1884
|
-
function is(t) {
|
|
1885
|
-
const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
|
|
1886
|
-
return e.isIdentity ? te : pi(e.a, e.b, e.c, e.d, e.e, e.f);
|
|
1887
|
-
}
|
|
1888
|
-
function rs(t) {
|
|
1889
|
-
return t == null || (Mt || (Mt = document.createElementNS("http://www.w3.org/2000/svg", "g")), Mt.setAttribute("transform", t), !(t = Mt.transform.baseVal.consolidate())) ? te : (t = t.matrix, pi(t.a, t.b, t.c, t.d, t.e, t.f));
|
|
1890
|
-
}
|
|
1891
|
-
function fi(t, e, i, r) {
|
|
1892
|
-
function n(l) {
|
|
1893
|
-
return l.length ? l.pop() + " " : "";
|
|
1894
|
-
}
|
|
1895
|
-
function s(l, c, u, f, d, g) {
|
|
1896
|
-
if (l !== u || c !== f) {
|
|
1897
|
-
var y = d.push("translate(", null, e, null, i);
|
|
1898
|
-
g.push({ i: y - 4, x: Y(l, u) }, { i: y - 2, x: Y(c, f) });
|
|
1899
|
-
} else (u || f) && d.push("translate(" + u + e + f + i);
|
|
1900
|
-
}
|
|
1901
|
-
function o(l, c, u, f) {
|
|
1902
|
-
l !== c ? (l - c > 180 ? c += 360 : c - l > 180 && (l += 360), f.push({ i: u.push(n(u) + "rotate(", null, r) - 2, x: Y(l, c) })) : c && u.push(n(u) + "rotate(" + c + r);
|
|
1903
|
-
}
|
|
1904
|
-
function a(l, c, u, f) {
|
|
1905
|
-
l !== c ? f.push({ i: u.push(n(u) + "skewX(", null, r) - 2, x: Y(l, c) }) : c && u.push(n(u) + "skewX(" + c + r);
|
|
1906
|
-
}
|
|
1907
|
-
function h(l, c, u, f, d, g) {
|
|
1908
|
-
if (l !== u || c !== f) {
|
|
1909
|
-
var y = d.push(n(d) + "scale(", null, ",", null, ")");
|
|
1910
|
-
g.push({ i: y - 4, x: Y(l, u) }, { i: y - 2, x: Y(c, f) });
|
|
1911
|
-
} else (u !== 1 || f !== 1) && d.push(n(d) + "scale(" + u + "," + f + ")");
|
|
1912
|
-
}
|
|
1913
|
-
return function(l, c) {
|
|
1914
|
-
var u = [], f = [];
|
|
1915
|
-
return l = t(l), c = t(c), s(l.translateX, l.translateY, c.translateX, c.translateY, u, f), o(l.rotate, c.rotate, u, f), a(l.skewX, c.skewX, u, f), h(l.scaleX, l.scaleY, c.scaleX, c.scaleY, u, f), l = c = null, function(d) {
|
|
1916
|
-
for (var g = -1, y = f.length, $; ++g < y; ) u[($ = f[g]).i] = $.x(d);
|
|
1917
|
-
return u.join("");
|
|
1918
|
-
};
|
|
1919
|
-
};
|
|
1920
|
-
}
|
|
1921
|
-
var ns = fi(is, "px, ", "px)", "deg)"), ss = fi(rs, ", ", ")", ")"), st = 0, ct = 0, lt = 0, di = 1e3, It, ut, Dt = 0, J = 0, Wt = 0, vt = typeof performance == "object" && performance.now ? performance : Date, gi = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
|
|
1922
|
-
setTimeout(t, 17);
|
|
1923
|
-
};
|
|
1924
|
-
function de() {
|
|
1925
|
-
return J || (gi(os), J = vt.now() + Wt);
|
|
1926
|
-
}
|
|
1927
|
-
function os() {
|
|
1928
|
-
J = 0;
|
|
1929
|
-
}
|
|
1930
|
-
function qt() {
|
|
1931
|
-
this._call = this._time = this._next = null;
|
|
1932
|
-
}
|
|
1933
|
-
qt.prototype = yi.prototype = {
|
|
1934
|
-
constructor: qt,
|
|
1935
|
-
restart: function(t, e, i) {
|
|
1936
|
-
if (typeof t != "function") throw new TypeError("callback is not a function");
|
|
1937
|
-
i = (i == null ? de() : +i) + (e == null ? 0 : +e), !this._next && ut !== this && (ut ? ut._next = this : It = this, ut = this), this._call = t, this._time = i, ee();
|
|
1938
|
-
},
|
|
1939
|
-
stop: function() {
|
|
1940
|
-
this._call && (this._call = null, this._time = 1 / 0, ee());
|
|
1941
|
-
}
|
|
1942
|
-
};
|
|
1943
|
-
function yi(t, e, i) {
|
|
1944
|
-
var r = new qt();
|
|
1945
|
-
return r.restart(t, e, i), r;
|
|
1946
|
-
}
|
|
1947
|
-
function as() {
|
|
1948
|
-
de(), ++st;
|
|
1949
|
-
for (var t = It, e; t; )
|
|
1950
|
-
(e = J - t._time) >= 0 && t._call.call(void 0, e), t = t._next;
|
|
1951
|
-
--st;
|
|
1952
|
-
}
|
|
1953
|
-
function qe() {
|
|
1954
|
-
J = (Dt = vt.now()) + Wt, st = ct = 0;
|
|
1955
|
-
try {
|
|
1956
|
-
as();
|
|
1957
|
-
} finally {
|
|
1958
|
-
st = 0, ls(), J = 0;
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
function hs() {
|
|
1962
|
-
var t = vt.now(), e = t - Dt;
|
|
1963
|
-
e > di && (Wt -= e, Dt = t);
|
|
1964
|
-
}
|
|
1965
|
-
function ls() {
|
|
1966
|
-
for (var t, e = It, i, r = 1 / 0; e; )
|
|
1967
|
-
e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (i = e._next, e._next = null, e = t ? t._next = i : It = i);
|
|
1968
|
-
ut = t, ee(r);
|
|
1969
|
-
}
|
|
1970
|
-
function ee(t) {
|
|
1971
|
-
if (!st) {
|
|
1972
|
-
ct && (ct = clearTimeout(ct));
|
|
1973
|
-
var e = t - J;
|
|
1974
|
-
e > 24 ? (t < 1 / 0 && (ct = setTimeout(qe, t - vt.now() - Wt)), lt && (lt = clearInterval(lt))) : (lt || (Dt = vt.now(), lt = setInterval(hs, di)), st = 1, gi(qe));
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
function Ue(t, e, i) {
|
|
1978
|
-
var r = new qt();
|
|
1979
|
-
return e = e == null ? 0 : +e, r.restart((n) => {
|
|
1980
|
-
r.stop(), t(n + e);
|
|
1981
|
-
}, e, i), r;
|
|
1982
|
-
}
|
|
1983
|
-
var cs = Ze("start", "end", "cancel", "interrupt"), us = [], bi = 0, Xe = 1, ie = 2, Ht = 3, Ye = 4, re = 5, zt = 6;
|
|
1984
|
-
function Vt(t, e, i, r, n, s) {
|
|
1985
|
-
var o = t.__transition;
|
|
1986
|
-
if (!o) t.__transition = {};
|
|
1987
|
-
else if (i in o) return;
|
|
1988
|
-
ps(t, i, {
|
|
1989
|
-
name: e,
|
|
1990
|
-
index: r,
|
|
1991
|
-
// For context during callback.
|
|
1992
|
-
group: n,
|
|
1993
|
-
// For context during callback.
|
|
1994
|
-
on: cs,
|
|
1995
|
-
tween: us,
|
|
1996
|
-
time: s.time,
|
|
1997
|
-
delay: s.delay,
|
|
1998
|
-
duration: s.duration,
|
|
1999
|
-
ease: s.ease,
|
|
2000
|
-
timer: null,
|
|
2001
|
-
state: bi
|
|
2002
|
-
});
|
|
2003
|
-
}
|
|
2004
|
-
function ge(t, e) {
|
|
2005
|
-
var i = F(t, e);
|
|
2006
|
-
if (i.state > bi) throw new Error("too late; already scheduled");
|
|
2007
|
-
return i;
|
|
2008
|
-
}
|
|
2009
|
-
function I(t, e) {
|
|
2010
|
-
var i = F(t, e);
|
|
2011
|
-
if (i.state > Ht) throw new Error("too late; already running");
|
|
2012
|
-
return i;
|
|
2013
|
-
}
|
|
2014
|
-
function F(t, e) {
|
|
2015
|
-
var i = t.__transition;
|
|
2016
|
-
if (!i || !(i = i[e])) throw new Error("transition not found");
|
|
2017
|
-
return i;
|
|
2018
|
-
}
|
|
2019
|
-
function ps(t, e, i) {
|
|
2020
|
-
var r = t.__transition, n;
|
|
2021
|
-
r[e] = i, i.timer = yi(s, 0, i.time);
|
|
2022
|
-
function s(l) {
|
|
2023
|
-
i.state = Xe, i.timer.restart(o, i.delay, i.time), i.delay <= l && o(l - i.delay);
|
|
2024
|
-
}
|
|
2025
|
-
function o(l) {
|
|
2026
|
-
var c, u, f, d;
|
|
2027
|
-
if (i.state !== Xe) return h();
|
|
2028
|
-
for (c in r)
|
|
2029
|
-
if (d = r[c], d.name === i.name) {
|
|
2030
|
-
if (d.state === Ht) return Ue(o);
|
|
2031
|
-
d.state === Ye ? (d.state = zt, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[c]) : +c < e && (d.state = zt, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[c]);
|
|
2032
|
-
}
|
|
2033
|
-
if (Ue(function() {
|
|
2034
|
-
i.state === Ht && (i.state = Ye, i.timer.restart(a, i.delay, i.time), a(l));
|
|
2035
|
-
}), i.state = ie, i.on.call("start", t, t.__data__, i.index, i.group), i.state === ie) {
|
|
2036
|
-
for (i.state = Ht, n = new Array(f = i.tween.length), c = 0, u = -1; c < f; ++c)
|
|
2037
|
-
(d = i.tween[c].value.call(t, t.__data__, i.index, i.group)) && (n[++u] = d);
|
|
2038
|
-
n.length = u + 1;
|
|
2039
|
-
}
|
|
2040
|
-
}
|
|
2041
|
-
function a(l) {
|
|
2042
|
-
for (var c = l < i.duration ? i.ease.call(null, l / i.duration) : (i.timer.restart(h), i.state = re, 1), u = -1, f = n.length; ++u < f; )
|
|
2043
|
-
n[u].call(t, c);
|
|
2044
|
-
i.state === re && (i.on.call("end", t, t.__data__, i.index, i.group), h());
|
|
2045
|
-
}
|
|
2046
|
-
function h() {
|
|
2047
|
-
i.state = zt, i.timer.stop(), delete r[e];
|
|
2048
|
-
for (var l in r) return;
|
|
2049
|
-
delete t.__transition;
|
|
2050
|
-
}
|
|
2051
|
-
}
|
|
2052
|
-
function fs(t, e) {
|
|
2053
|
-
var i = t.__transition, r, n, s = !0, o;
|
|
2054
|
-
if (i) {
|
|
2055
|
-
e = e == null ? null : e + "";
|
|
2056
|
-
for (o in i) {
|
|
2057
|
-
if ((r = i[o]).name !== e) {
|
|
2058
|
-
s = !1;
|
|
2059
|
-
continue;
|
|
2060
|
-
}
|
|
2061
|
-
n = r.state > ie && r.state < re, r.state = zt, r.timer.stop(), r.on.call(n ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete i[o];
|
|
2062
|
-
}
|
|
2063
|
-
s && delete t.__transition;
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
function ds(t) {
|
|
2067
|
-
return this.each(function() {
|
|
2068
|
-
fs(this, t);
|
|
2069
|
-
});
|
|
2070
|
-
}
|
|
2071
|
-
function gs(t, e) {
|
|
2072
|
-
var i, r;
|
|
2073
|
-
return function() {
|
|
2074
|
-
var n = I(this, t), s = n.tween;
|
|
2075
|
-
if (s !== i) {
|
|
2076
|
-
r = i = s;
|
|
2077
|
-
for (var o = 0, a = r.length; o < a; ++o)
|
|
2078
|
-
if (r[o].name === e) {
|
|
2079
|
-
r = r.slice(), r.splice(o, 1);
|
|
2080
|
-
break;
|
|
2081
|
-
}
|
|
2082
|
-
}
|
|
2083
|
-
n.tween = r;
|
|
2084
|
-
};
|
|
2085
|
-
}
|
|
2086
|
-
function ys(t, e, i) {
|
|
2087
|
-
var r, n;
|
|
2088
|
-
if (typeof i != "function") throw new Error();
|
|
2089
|
-
return function() {
|
|
2090
|
-
var s = I(this, t), o = s.tween;
|
|
2091
|
-
if (o !== r) {
|
|
2092
|
-
n = (r = o).slice();
|
|
2093
|
-
for (var a = { name: e, value: i }, h = 0, l = n.length; h < l; ++h)
|
|
2094
|
-
if (n[h].name === e) {
|
|
2095
|
-
n[h] = a;
|
|
2096
|
-
break;
|
|
2097
|
-
}
|
|
2098
|
-
h === l && n.push(a);
|
|
2099
|
-
}
|
|
2100
|
-
s.tween = n;
|
|
2101
|
-
};
|
|
2102
|
-
}
|
|
2103
|
-
function bs(t, e) {
|
|
2104
|
-
var i = this._id;
|
|
2105
|
-
if (t += "", arguments.length < 2) {
|
|
2106
|
-
for (var r = F(this.node(), i).tween, n = 0, s = r.length, o; n < s; ++n)
|
|
2107
|
-
if ((o = r[n]).name === t)
|
|
2108
|
-
return o.value;
|
|
2109
|
-
return null;
|
|
2110
|
-
}
|
|
2111
|
-
return this.each((e == null ? gs : ys)(i, t, e));
|
|
2112
|
-
}
|
|
2113
|
-
function ye(t, e, i) {
|
|
2114
|
-
var r = t._id;
|
|
2115
|
-
return t.each(function() {
|
|
2116
|
-
var n = I(this, r);
|
|
2117
|
-
(n.value || (n.value = {}))[e] = i.apply(this, arguments);
|
|
2118
|
-
}), function(n) {
|
|
2119
|
-
return F(n, r).value[e];
|
|
2120
|
-
};
|
|
2121
|
-
}
|
|
2122
|
-
function mi(t, e) {
|
|
2123
|
-
var i;
|
|
2124
|
-
return (typeof e == "number" ? Y : e instanceof xt ? Ie : (i = xt(e)) ? (e = i, Ie) : es)(t, e);
|
|
2125
|
-
}
|
|
2126
|
-
function ms(t) {
|
|
2127
|
-
return function() {
|
|
2128
|
-
this.removeAttribute(t);
|
|
2129
|
-
};
|
|
2130
|
-
}
|
|
2131
|
-
function _s(t) {
|
|
2132
|
-
return function() {
|
|
2133
|
-
this.removeAttributeNS(t.space, t.local);
|
|
2134
|
-
};
|
|
2135
|
-
}
|
|
2136
|
-
function xs(t, e, i) {
|
|
2137
|
-
var r, n = i + "", s;
|
|
2138
|
-
return function() {
|
|
2139
|
-
var o = this.getAttribute(t);
|
|
2140
|
-
return o === n ? null : o === r ? s : s = e(r = o, i);
|
|
2141
|
-
};
|
|
2142
|
-
}
|
|
2143
|
-
function vs(t, e, i) {
|
|
2144
|
-
var r, n = i + "", s;
|
|
2145
|
-
return function() {
|
|
2146
|
-
var o = this.getAttributeNS(t.space, t.local);
|
|
2147
|
-
return o === n ? null : o === r ? s : s = e(r = o, i);
|
|
2148
|
-
};
|
|
2149
|
-
}
|
|
2150
|
-
function ws(t, e, i) {
|
|
2151
|
-
var r, n, s;
|
|
2152
|
-
return function() {
|
|
2153
|
-
var o, a = i(this), h;
|
|
2154
|
-
return a == null ? void this.removeAttribute(t) : (o = this.getAttribute(t), h = a + "", o === h ? null : o === r && h === n ? s : (n = h, s = e(r = o, a)));
|
|
2155
|
-
};
|
|
2156
|
-
}
|
|
2157
|
-
function Ss(t, e, i) {
|
|
2158
|
-
var r, n, s;
|
|
2159
|
-
return function() {
|
|
2160
|
-
var o, a = i(this), h;
|
|
2161
|
-
return a == null ? void this.removeAttributeNS(t.space, t.local) : (o = this.getAttributeNS(t.space, t.local), h = a + "", o === h ? null : o === r && h === n ? s : (n = h, s = e(r = o, a)));
|
|
2162
|
-
};
|
|
2163
|
-
}
|
|
2164
|
-
function $s(t, e) {
|
|
2165
|
-
var i = Bt(t), r = i === "transform" ? ss : mi;
|
|
2166
|
-
return this.attrTween(t, typeof e == "function" ? (i.local ? Ss : ws)(i, r, ye(this, "attr." + t, e)) : e == null ? (i.local ? _s : ms)(i) : (i.local ? vs : xs)(i, r, e));
|
|
2167
|
-
}
|
|
2168
|
-
function As(t, e) {
|
|
2169
|
-
return function(i) {
|
|
2170
|
-
this.setAttribute(t, e.call(this, i));
|
|
2171
|
-
};
|
|
2172
|
-
}
|
|
2173
|
-
function Cs(t, e) {
|
|
2174
|
-
return function(i) {
|
|
2175
|
-
this.setAttributeNS(t.space, t.local, e.call(this, i));
|
|
2176
|
-
};
|
|
2177
|
-
}
|
|
2178
|
-
function Ms(t, e) {
|
|
2179
|
-
var i, r;
|
|
2180
|
-
function n() {
|
|
2181
|
-
var s = e.apply(this, arguments);
|
|
2182
|
-
return s !== r && (i = (r = s) && Cs(t, s)), i;
|
|
2183
|
-
}
|
|
2184
|
-
return n._value = e, n;
|
|
2185
|
-
}
|
|
2186
|
-
function Es(t, e) {
|
|
2187
|
-
var i, r;
|
|
2188
|
-
function n() {
|
|
2189
|
-
var s = e.apply(this, arguments);
|
|
2190
|
-
return s !== r && (i = (r = s) && As(t, s)), i;
|
|
2191
|
-
}
|
|
2192
|
-
return n._value = e, n;
|
|
2193
|
-
}
|
|
2194
|
-
function Ns(t, e) {
|
|
2195
|
-
var i = "attr." + t;
|
|
2196
|
-
if (arguments.length < 2) return (i = this.tween(i)) && i._value;
|
|
2197
|
-
if (e == null) return this.tween(i, null);
|
|
2198
|
-
if (typeof e != "function") throw new Error();
|
|
2199
|
-
var r = Bt(t);
|
|
2200
|
-
return this.tween(i, (r.local ? Ms : Es)(r, e));
|
|
2201
|
-
}
|
|
2202
|
-
function Ps(t, e) {
|
|
2203
|
-
return function() {
|
|
2204
|
-
ge(this, t).delay = +e.apply(this, arguments);
|
|
2205
|
-
};
|
|
2206
|
-
}
|
|
2207
|
-
function Hs(t, e) {
|
|
2208
|
-
return e = +e, function() {
|
|
2209
|
-
ge(this, t).delay = e;
|
|
2210
|
-
};
|
|
2211
|
-
}
|
|
2212
|
-
function zs(t) {
|
|
2213
|
-
var e = this._id;
|
|
2214
|
-
return arguments.length ? this.each((typeof t == "function" ? Ps : Hs)(e, t)) : F(this.node(), e).delay;
|
|
2215
|
-
}
|
|
2216
|
-
function Os(t, e) {
|
|
2217
|
-
return function() {
|
|
2218
|
-
I(this, t).duration = +e.apply(this, arguments);
|
|
2219
|
-
};
|
|
2220
|
-
}
|
|
2221
|
-
function Rs(t, e) {
|
|
2222
|
-
return e = +e, function() {
|
|
2223
|
-
I(this, t).duration = e;
|
|
2224
|
-
};
|
|
2225
|
-
}
|
|
2226
|
-
function Ts(t) {
|
|
2227
|
-
var e = this._id;
|
|
2228
|
-
return arguments.length ? this.each((typeof t == "function" ? Os : Rs)(e, t)) : F(this.node(), e).duration;
|
|
2229
|
-
}
|
|
2230
|
-
function Ls(t, e) {
|
|
2231
|
-
if (typeof e != "function") throw new Error();
|
|
2232
|
-
return function() {
|
|
2233
|
-
I(this, t).ease = e;
|
|
2234
|
-
};
|
|
2235
|
-
}
|
|
2236
|
-
function Fs(t) {
|
|
2237
|
-
var e = this._id;
|
|
2238
|
-
return arguments.length ? this.each(Ls(e, t)) : F(this.node(), e).ease;
|
|
2239
|
-
}
|
|
2240
|
-
function ks(t, e) {
|
|
2241
|
-
return function() {
|
|
2242
|
-
var i = e.apply(this, arguments);
|
|
2243
|
-
if (typeof i != "function") throw new Error();
|
|
2244
|
-
I(this, t).ease = i;
|
|
2245
|
-
};
|
|
2246
|
-
}
|
|
2247
|
-
function Is(t) {
|
|
2248
|
-
if (typeof t != "function") throw new Error();
|
|
2249
|
-
return this.each(ks(this._id, t));
|
|
2250
|
-
}
|
|
2251
|
-
function Ds(t) {
|
|
2252
|
-
typeof t != "function" && (t = je(t));
|
|
2253
|
-
for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n)
|
|
2254
|
-
for (var s = e[n], o = s.length, a = r[n] = [], h, l = 0; l < o; ++l)
|
|
2255
|
-
(h = s[l]) && t.call(h, h.__data__, l, s) && a.push(h);
|
|
2256
|
-
return new U(r, this._parents, this._name, this._id);
|
|
2257
|
-
}
|
|
2258
|
-
function qs(t) {
|
|
2259
|
-
if (t._id !== this._id) throw new Error();
|
|
2260
|
-
for (var e = this._groups, i = t._groups, r = e.length, n = i.length, s = Math.min(r, n), o = new Array(r), a = 0; a < s; ++a)
|
|
2261
|
-
for (var h = e[a], l = i[a], c = h.length, u = o[a] = new Array(c), f, d = 0; d < c; ++d)
|
|
2262
|
-
(f = h[d] || l[d]) && (u[d] = f);
|
|
2263
|
-
for (; a < r; ++a)
|
|
2264
|
-
o[a] = e[a];
|
|
2265
|
-
return new U(o, this._parents, this._name, this._id);
|
|
2266
|
-
}
|
|
2267
|
-
function Us(t) {
|
|
2268
|
-
return (t + "").trim().split(/^|\s+/).every(function(e) {
|
|
2269
|
-
var i = e.indexOf(".");
|
|
2270
|
-
return i >= 0 && (e = e.slice(0, i)), !e || e === "start";
|
|
2271
|
-
});
|
|
2272
|
-
}
|
|
2273
|
-
function Xs(t, e, i) {
|
|
2274
|
-
var r, n, s = Us(e) ? ge : I;
|
|
2275
|
-
return function() {
|
|
2276
|
-
var o = s(this, t), a = o.on;
|
|
2277
|
-
a !== r && (n = (r = a).copy()).on(e, i), o.on = n;
|
|
2278
|
-
};
|
|
2279
|
-
}
|
|
2280
|
-
function Ys(t, e) {
|
|
2281
|
-
var i = this._id;
|
|
2282
|
-
return arguments.length < 2 ? F(this.node(), i).on.on(t) : this.each(Xs(i, t, e));
|
|
2283
|
-
}
|
|
2284
|
-
function Bs(t) {
|
|
2285
|
-
return function() {
|
|
2286
|
-
var e = this.parentNode;
|
|
2287
|
-
for (var i in this.__transition) if (+i !== t) return;
|
|
2288
|
-
e && e.removeChild(this);
|
|
2289
|
-
};
|
|
2290
|
-
}
|
|
2291
|
-
function Ws() {
|
|
2292
|
-
return this.on("end.remove", Bs(this._id));
|
|
2293
|
-
}
|
|
2294
|
-
function Vs(t) {
|
|
2295
|
-
var e = this._name, i = this._id;
|
|
2296
|
-
typeof t != "function" && (t = ue(t));
|
|
2297
|
-
for (var r = this._groups, n = r.length, s = new Array(n), o = 0; o < n; ++o)
|
|
2298
|
-
for (var a = r[o], h = a.length, l = s[o] = new Array(h), c, u, f = 0; f < h; ++f)
|
|
2299
|
-
(c = a[f]) && (u = t.call(c, c.__data__, f, a)) && ("__data__" in c && (u.__data__ = c.__data__), l[f] = u, Vt(l[f], e, i, f, l, F(c, i)));
|
|
2300
|
-
return new U(s, this._parents, e, i);
|
|
2301
|
-
}
|
|
2302
|
-
function Gs(t) {
|
|
2303
|
-
var e = this._name, i = this._id;
|
|
2304
|
-
typeof t != "function" && (t = Qe(t));
|
|
2305
|
-
for (var r = this._groups, n = r.length, s = [], o = [], a = 0; a < n; ++a)
|
|
2306
|
-
for (var h = r[a], l = h.length, c, u = 0; u < l; ++u)
|
|
2307
|
-
if (c = h[u]) {
|
|
2308
|
-
for (var f = t.call(c, c.__data__, u, h), d, g = F(c, i), y = 0, $ = f.length; y < $; ++y)
|
|
2309
|
-
(d = f[y]) && Vt(d, e, i, y, f, g);
|
|
2310
|
-
s.push(f), o.push(c);
|
|
2311
|
-
}
|
|
2312
|
-
return new U(s, o, e, i);
|
|
2313
|
-
}
|
|
2314
|
-
var Ks = St.prototype.constructor;
|
|
2315
|
-
function Zs() {
|
|
2316
|
-
return new Ks(this._groups, this._parents);
|
|
2317
|
-
}
|
|
2318
|
-
function Js(t, e) {
|
|
2319
|
-
var i, r, n;
|
|
2320
|
-
return function() {
|
|
2321
|
-
var s = nt(this, t), o = (this.style.removeProperty(t), nt(this, t));
|
|
2322
|
-
return s === o ? null : s === i && o === r ? n : n = e(i = s, r = o);
|
|
2323
|
-
};
|
|
2324
|
-
}
|
|
2325
|
-
function _i(t) {
|
|
2326
|
-
return function() {
|
|
2327
|
-
this.style.removeProperty(t);
|
|
2328
|
-
};
|
|
2329
|
-
}
|
|
2330
|
-
function Qs(t, e, i) {
|
|
2331
|
-
var r, n = i + "", s;
|
|
2332
|
-
return function() {
|
|
2333
|
-
var o = nt(this, t);
|
|
2334
|
-
return o === n ? null : o === r ? s : s = e(r = o, i);
|
|
2335
|
-
};
|
|
2336
|
-
}
|
|
2337
|
-
function js(t, e, i) {
|
|
2338
|
-
var r, n, s;
|
|
2339
|
-
return function() {
|
|
2340
|
-
var o = nt(this, t), a = i(this), h = a + "";
|
|
2341
|
-
return a == null && (h = a = (this.style.removeProperty(t), nt(this, t))), o === h ? null : o === r && h === n ? s : (n = h, s = e(r = o, a));
|
|
2342
|
-
};
|
|
2343
|
-
}
|
|
2344
|
-
function to(t, e) {
|
|
2345
|
-
var i, r, n, s = "style." + e, o = "end." + s, a;
|
|
2346
|
-
return function() {
|
|
2347
|
-
var h = I(this, t), l = h.on, c = h.value[s] == null ? a || (a = _i(e)) : void 0;
|
|
2348
|
-
(l !== i || n !== c) && (r = (i = l).copy()).on(o, n = c), h.on = r;
|
|
2349
|
-
};
|
|
2350
|
-
}
|
|
2351
|
-
function eo(t, e, i) {
|
|
2352
|
-
var r = (t += "") == "transform" ? ns : mi;
|
|
2353
|
-
return e == null ? this.styleTween(t, Js(t, r)).on("end.style." + t, _i(t)) : typeof e == "function" ? this.styleTween(t, js(t, r, ye(this, "style." + t, e))).each(to(this._id, t)) : this.styleTween(t, Qs(t, r, e), i).on("end.style." + t, null);
|
|
2354
|
-
}
|
|
2355
|
-
function io(t, e, i) {
|
|
2356
|
-
return function(r) {
|
|
2357
|
-
this.style.setProperty(t, e.call(this, r), i);
|
|
2358
|
-
};
|
|
2359
|
-
}
|
|
2360
|
-
function ro(t, e, i) {
|
|
2361
|
-
var r, n;
|
|
2362
|
-
function s() {
|
|
2363
|
-
var o = e.apply(this, arguments);
|
|
2364
|
-
return o !== n && (r = (n = o) && io(t, o, i)), r;
|
|
2365
|
-
}
|
|
2366
|
-
return s._value = e, s;
|
|
2367
|
-
}
|
|
2368
|
-
function no(t, e, i) {
|
|
2369
|
-
var r = "style." + (t += "");
|
|
2370
|
-
if (arguments.length < 2) return (r = this.tween(r)) && r._value;
|
|
2371
|
-
if (e == null) return this.tween(r, null);
|
|
2372
|
-
if (typeof e != "function") throw new Error();
|
|
2373
|
-
return this.tween(r, ro(t, e, i ?? ""));
|
|
2374
|
-
}
|
|
2375
|
-
function so(t) {
|
|
2376
|
-
return function() {
|
|
2377
|
-
this.textContent = t;
|
|
2378
|
-
};
|
|
2379
|
-
}
|
|
2380
|
-
function oo(t) {
|
|
2381
|
-
return function() {
|
|
2382
|
-
var e = t(this);
|
|
2383
|
-
this.textContent = e ?? "";
|
|
2384
|
-
};
|
|
2385
|
-
}
|
|
2386
|
-
function ao(t) {
|
|
2387
|
-
return this.tween("text", typeof t == "function" ? oo(ye(this, "text", t)) : so(t == null ? "" : t + ""));
|
|
2388
|
-
}
|
|
2389
|
-
function ho(t) {
|
|
2390
|
-
return function(e) {
|
|
2391
|
-
this.textContent = t.call(this, e);
|
|
2392
|
-
};
|
|
2393
|
-
}
|
|
2394
|
-
function lo(t) {
|
|
2395
|
-
var e, i;
|
|
2396
|
-
function r() {
|
|
2397
|
-
var n = t.apply(this, arguments);
|
|
2398
|
-
return n !== i && (e = (i = n) && ho(n)), e;
|
|
2399
|
-
}
|
|
2400
|
-
return r._value = t, r;
|
|
2401
|
-
}
|
|
2402
|
-
function co(t) {
|
|
2403
|
-
var e = "text";
|
|
2404
|
-
if (arguments.length < 1) return (e = this.tween(e)) && e._value;
|
|
2405
|
-
if (t == null) return this.tween(e, null);
|
|
2406
|
-
if (typeof t != "function") throw new Error();
|
|
2407
|
-
return this.tween(e, lo(t));
|
|
2408
|
-
}
|
|
2409
|
-
function uo() {
|
|
2410
|
-
for (var t = this._name, e = this._id, i = xi(), r = this._groups, n = r.length, s = 0; s < n; ++s)
|
|
2411
|
-
for (var o = r[s], a = o.length, h, l = 0; l < a; ++l)
|
|
2412
|
-
if (h = o[l]) {
|
|
2413
|
-
var c = F(h, e);
|
|
2414
|
-
Vt(h, t, i, l, o, {
|
|
2415
|
-
time: c.time + c.delay + c.duration,
|
|
2416
|
-
delay: 0,
|
|
2417
|
-
duration: c.duration,
|
|
2418
|
-
ease: c.ease
|
|
2419
|
-
});
|
|
2420
|
-
}
|
|
2421
|
-
return new U(r, this._parents, t, i);
|
|
2422
|
-
}
|
|
2423
|
-
function po() {
|
|
2424
|
-
var t, e, i = this, r = i._id, n = i.size();
|
|
2425
|
-
return new Promise(function(s, o) {
|
|
2426
|
-
var a = { value: o }, h = { value: function() {
|
|
2427
|
-
--n === 0 && s();
|
|
2428
|
-
} };
|
|
2429
|
-
i.each(function() {
|
|
2430
|
-
var l = I(this, r), c = l.on;
|
|
2431
|
-
c !== t && (e = (t = c).copy(), e._.cancel.push(a), e._.interrupt.push(a), e._.end.push(h)), l.on = e;
|
|
2432
|
-
}), n === 0 && s();
|
|
2433
|
-
});
|
|
2434
|
-
}
|
|
2435
|
-
var fo = 0;
|
|
2436
|
-
function U(t, e, i, r) {
|
|
2437
|
-
this._groups = t, this._parents = e, this._name = i, this._id = r;
|
|
2438
|
-
}
|
|
2439
|
-
function xi() {
|
|
2440
|
-
return ++fo;
|
|
2441
|
-
}
|
|
2442
|
-
var q = St.prototype;
|
|
2443
|
-
U.prototype = {
|
|
2444
|
-
constructor: U,
|
|
2445
|
-
select: Vs,
|
|
2446
|
-
selectAll: Gs,
|
|
2447
|
-
selectChild: q.selectChild,
|
|
2448
|
-
selectChildren: q.selectChildren,
|
|
2449
|
-
filter: Ds,
|
|
2450
|
-
merge: qs,
|
|
2451
|
-
selection: Zs,
|
|
2452
|
-
transition: uo,
|
|
2453
|
-
call: q.call,
|
|
2454
|
-
nodes: q.nodes,
|
|
2455
|
-
node: q.node,
|
|
2456
|
-
size: q.size,
|
|
2457
|
-
empty: q.empty,
|
|
2458
|
-
each: q.each,
|
|
2459
|
-
on: Ys,
|
|
2460
|
-
attr: $s,
|
|
2461
|
-
attrTween: Ns,
|
|
2462
|
-
style: eo,
|
|
2463
|
-
styleTween: no,
|
|
2464
|
-
text: ao,
|
|
2465
|
-
textTween: co,
|
|
2466
|
-
remove: Ws,
|
|
2467
|
-
tween: bs,
|
|
2468
|
-
delay: zs,
|
|
2469
|
-
duration: Ts,
|
|
2470
|
-
ease: Fs,
|
|
2471
|
-
easeVarying: Is,
|
|
2472
|
-
end: po,
|
|
2473
|
-
[Symbol.iterator]: q[Symbol.iterator]
|
|
2474
|
-
};
|
|
2475
|
-
function go(t) {
|
|
2476
|
-
return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
|
|
2477
|
-
}
|
|
2478
|
-
var yo = {
|
|
2479
|
-
time: null,
|
|
2480
|
-
// Set on use.
|
|
2481
|
-
delay: 0,
|
|
2482
|
-
duration: 250,
|
|
2483
|
-
ease: go
|
|
2484
|
-
};
|
|
2485
|
-
function bo(t, e) {
|
|
2486
|
-
for (var i; !(i = t.__transition) || !(i = i[e]); )
|
|
2487
|
-
if (!(t = t.parentNode))
|
|
2488
|
-
throw new Error(`transition ${e} not found`);
|
|
2489
|
-
return i;
|
|
2490
|
-
}
|
|
2491
|
-
function mo(t) {
|
|
2492
|
-
var e, i;
|
|
2493
|
-
t instanceof U ? (e = t._id, t = t._name) : (e = xi(), (i = yo).time = de(), t = t == null ? null : t + "");
|
|
2494
|
-
for (var r = this._groups, n = r.length, s = 0; s < n; ++s)
|
|
2495
|
-
for (var o = r[s], a = o.length, h, l = 0; l < a; ++l)
|
|
2496
|
-
(h = o[l]) && Vt(h, t, e, l, o, i || bo(h, e));
|
|
2497
|
-
return new U(r, this._parents, t, e);
|
|
2498
|
-
}
|
|
2499
|
-
St.prototype.interrupt = ds;
|
|
2500
|
-
St.prototype.transition = mo;
|
|
2501
|
-
function pt(t, e, i) {
|
|
2502
|
-
this.k = t, this.x = e, this.y = i;
|
|
2503
|
-
}
|
|
2504
|
-
pt.prototype = {
|
|
2505
|
-
constructor: pt,
|
|
2506
|
-
scale: function(t) {
|
|
2507
|
-
return t === 1 ? this : new pt(this.k * t, this.x, this.y);
|
|
2508
|
-
},
|
|
2509
|
-
translate: function(t, e) {
|
|
2510
|
-
return t === 0 & e === 0 ? this : new pt(this.k, this.x + this.k * t, this.y + this.k * e);
|
|
2511
|
-
},
|
|
2512
|
-
apply: function(t) {
|
|
2513
|
-
return [t[0] * this.k + this.x, t[1] * this.k + this.y];
|
|
2514
|
-
},
|
|
2515
|
-
applyX: function(t) {
|
|
2516
|
-
return t * this.k + this.x;
|
|
2517
|
-
},
|
|
2518
|
-
applyY: function(t) {
|
|
2519
|
-
return t * this.k + this.y;
|
|
2520
|
-
},
|
|
2521
|
-
invert: function(t) {
|
|
2522
|
-
return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k];
|
|
2523
|
-
},
|
|
2524
|
-
invertX: function(t) {
|
|
2525
|
-
return (t - this.x) / this.k;
|
|
2526
|
-
},
|
|
2527
|
-
invertY: function(t) {
|
|
2528
|
-
return (t - this.y) / this.k;
|
|
2529
|
-
},
|
|
2530
|
-
rescaleX: function(t) {
|
|
2531
|
-
return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t));
|
|
2532
|
-
},
|
|
2533
|
-
rescaleY: function(t) {
|
|
2534
|
-
return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t));
|
|
2535
|
-
},
|
|
2536
|
-
toString: function() {
|
|
2537
|
-
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
2538
|
-
}
|
|
2539
|
-
};
|
|
2540
|
-
pt.prototype;
|
|
2541
|
-
var _o = Object.defineProperty, xo = Object.getOwnPropertyDescriptor, M = (t, e, i, r) => {
|
|
2542
|
-
for (var n = r > 1 ? void 0 : r ? xo(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
2543
|
-
(o = t[s]) && (n = (r ? o(e, i, n) : o(n)) || n);
|
|
2544
|
-
return r && n && _o(e, i, n), n;
|
|
2545
|
-
};
|
|
2546
|
-
let S = class extends O {
|
|
2547
|
-
constructor() {
|
|
2548
|
-
super(...arguments), this.hexSize = 50, this.waveAmplitude = 5.5, this.waveSpeed = 1, this.waveXFactor = -5e-3, this.waveYFactor = -5e-3, this.shadeAmplitude = 0.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;
|
|
2549
|
-
}
|
|
2550
|
-
updated(t) {
|
|
2551
|
-
super.updated(t), t.has("hexSize") && this.initialize();
|
|
2552
|
-
}
|
|
2553
|
-
initialize() {
|
|
2554
|
-
this.grid = [], this.time = 0;
|
|
2555
|
-
const t = this.hexSize, i = Math.sqrt(3) * t, r = t * 1.5, n = Math.ceil(this.width / i) + 2, s = Math.ceil(this.height / r) + 2;
|
|
2556
|
-
for (let o = -1; o < s; o++)
|
|
2557
|
-
for (let a = -1; a < n; a++) {
|
|
2558
|
-
const h = o % 2 !== 0 ? i / 2 : 0;
|
|
2559
|
-
this.grid.push({
|
|
2560
|
-
x: a * i + h,
|
|
2561
|
-
y: o * r,
|
|
2562
|
-
phase: Math.random() * Math.PI * 2,
|
|
2563
|
-
colorIndex: Math.floor(Math.random() * 1e3)
|
|
2564
|
-
});
|
|
2565
|
-
}
|
|
2566
|
-
}
|
|
2567
|
-
loop(t) {
|
|
2568
|
-
this.time += t, this.ctx.globalAlpha = this.trailOpacity, this.drawBackground(this.ctx), this.ctx.globalAlpha = 1;
|
|
2569
|
-
for (const e of this.grid) {
|
|
2570
|
-
const i = e.x * this.waveXFactor, r = e.y * this.waveYFactor, n = Math.sin(
|
|
2571
|
-
this.time * this.waveSpeed + i + r
|
|
2572
|
-
), s = n * this.waveAmplitude, o = e.x + e.y, a = Math.sin(this.time + o) * this.shadeAmplitude, h = this.baseLightness + n * this.lightnessRange + a;
|
|
2573
|
-
let l;
|
|
2574
|
-
if (this.hexColors && this.hexColors.length > 0) {
|
|
2575
|
-
const c = this.hexColors[(e.colorIndex || 0) % this.hexColors.length], u = kt(c);
|
|
2576
|
-
l = `hsl(${u.h}, ${u.s * 100}%, ${h}%)`;
|
|
2577
|
-
} else {
|
|
2578
|
-
const c = this.width + this.height, u = (e.x + e.y) / c;
|
|
2579
|
-
l = `hsl(${this.hexHueStart + (this.hexHueEnd - this.hexHueStart) * u}, ${this.hexSaturation}%, ${h}%)`;
|
|
2580
|
-
}
|
|
2581
|
-
this.drawHex(
|
|
2582
|
-
e.x,
|
|
2583
|
-
e.y + s,
|
|
2584
|
-
this.hexSize * this.hexScale,
|
|
2585
|
-
l
|
|
2586
|
-
);
|
|
2587
|
-
}
|
|
2588
|
-
}
|
|
2589
|
-
drawHex(t, e, i, r) {
|
|
2590
|
-
const n = this.ctx;
|
|
2591
|
-
n.beginPath();
|
|
2592
|
-
for (let s = 0; s < 6; s++) {
|
|
2593
|
-
const o = Math.PI * 2 / 6 * s - Math.PI / 2, a = t + Math.cos(o) * i, h = e + Math.sin(o) * i;
|
|
2594
|
-
s === 0 ? n.moveTo(a, h) : n.lineTo(a, h);
|
|
2595
|
-
}
|
|
2596
|
-
n.closePath(), n.fillStyle = r, n.fill();
|
|
2597
|
-
}
|
|
2598
|
-
};
|
|
2599
|
-
M([
|
|
2600
|
-
p({ type: Number, attribute: "hex-size" })
|
|
2601
|
-
], S.prototype, "hexSize", 2);
|
|
2602
|
-
M([
|
|
2603
|
-
p({ type: Number, attribute: "wave-amplitude" })
|
|
2604
|
-
], S.prototype, "waveAmplitude", 2);
|
|
2605
|
-
M([
|
|
2606
|
-
p({ type: Number, attribute: "wave-speed" })
|
|
2607
|
-
], S.prototype, "waveSpeed", 2);
|
|
2608
|
-
M([
|
|
2609
|
-
p({ type: Number, attribute: "wave-x-factor" })
|
|
2610
|
-
], S.prototype, "waveXFactor", 2);
|
|
2611
|
-
M([
|
|
2612
|
-
p({ type: Number, attribute: "wave-y-factor" })
|
|
2613
|
-
], S.prototype, "waveYFactor", 2);
|
|
2614
|
-
M([
|
|
2615
|
-
p({ type: Number, attribute: "shade-amplitude" })
|
|
2616
|
-
], S.prototype, "shadeAmplitude", 2);
|
|
2617
|
-
M([
|
|
2618
|
-
p({ type: Number, attribute: "shade-lightness-boost" })
|
|
2619
|
-
], S.prototype, "shadeLightnessBoost", 2);
|
|
2620
|
-
M([
|
|
2621
|
-
p({ type: Number, attribute: "base-lightness" })
|
|
2622
|
-
], S.prototype, "baseLightness", 2);
|
|
2623
|
-
M([
|
|
2624
|
-
p({ type: Number, attribute: "lightness-range" })
|
|
2625
|
-
], S.prototype, "lightnessRange", 2);
|
|
2626
|
-
M([
|
|
2627
|
-
p({ type: Number, attribute: "hex-hue-start" })
|
|
2628
|
-
], S.prototype, "hexHueStart", 2);
|
|
2629
|
-
M([
|
|
2630
|
-
p({ type: Number, attribute: "hex-hue-end" })
|
|
2631
|
-
], S.prototype, "hexHueEnd", 2);
|
|
2632
|
-
M([
|
|
2633
|
-
p({ type: Number, attribute: "hex-saturation" })
|
|
2634
|
-
], S.prototype, "hexSaturation", 2);
|
|
2635
|
-
M([
|
|
2636
|
-
p({ type: Number, attribute: "hex-scale" })
|
|
2637
|
-
], S.prototype, "hexScale", 2);
|
|
2638
|
-
M([
|
|
2639
|
-
p({
|
|
2640
|
-
type: Array,
|
|
2641
|
-
attribute: "hex-colors",
|
|
2642
|
-
converter: at
|
|
2643
|
-
})
|
|
2644
|
-
], S.prototype, "hexColors", 2);
|
|
2645
|
-
S = M([
|
|
2646
|
-
ot("bb-hexagon-wave")
|
|
2647
|
-
], S);
|
|
2648
|
-
var vo = Object.defineProperty, wo = Object.getOwnPropertyDescriptor, N = (t, e, i, r) => {
|
|
2649
|
-
for (var n = r > 1 ? void 0 : r ? wo(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
2650
|
-
(o = t[s]) && (n = (r ? o(e, i, n) : o(n)) || n);
|
|
2651
|
-
return r && n && vo(e, i, n), n;
|
|
2652
|
-
};
|
|
2653
|
-
let A = class extends O {
|
|
2654
|
-
constructor() {
|
|
2655
|
-
super(...arguments), this.lineCount = 20, this.lineAmplitude = 30, this.lineFrequency = 5e-3, this.speed = 0.5, this.lineSpacing = 40, this.lineWidth = 2, this.lineHueStart = 200, this.lineHueEnd = 280, this.lineSaturation = 80, this.lineOffsetStep = 0.2, this.wiggleAmplitude = 20, this.wiggleSpeed = 0.3, this.lineColors = [], this.time = 0;
|
|
2656
|
-
}
|
|
2657
|
-
loop(t) {
|
|
2658
|
-
this.time += t, this.ctx.globalAlpha = this.trailOpacity, this.drawBackground(this.ctx), this.ctx.globalAlpha = 1;
|
|
2659
|
-
const i = this.height / 2 - this.lineCount * this.lineSpacing / 2;
|
|
2660
|
-
for (let r = 0; r < this.lineCount; r++)
|
|
2661
|
-
this.drawLine(r, i + r * this.lineSpacing);
|
|
2662
|
-
}
|
|
2663
|
-
drawLine(t, e) {
|
|
2664
|
-
const i = this.ctx, r = 100, n = this.width / (r - 1), s = t * this.lineOffsetStep;
|
|
2665
|
-
i.beginPath(), i.lineWidth = this.lineWidth;
|
|
2666
|
-
const o = t / this.lineCount, a = this.lineHueStart + (this.lineHueEnd - this.lineHueStart) * o, l = 40 + Math.sin(this.time * 1e-3 + t * 0.5) * 10, c = this.lineColors && this.lineColors.length > 0 ? kt(this.lineColors[t % this.lineColors.length]) : kt(
|
|
2667
|
-
a,
|
|
2668
|
-
this.lineSaturation / 100,
|
|
2669
|
-
l / 100
|
|
2670
|
-
);
|
|
2671
|
-
this.lineColors && this.lineColors.length > 0 && (c.l = l / 100), i.strokeStyle = c.toString();
|
|
2672
|
-
for (let u = 0; u < r - 1; u++) {
|
|
2673
|
-
const f = u * n, d = Math.sin(
|
|
2674
|
-
f * this.lineFrequency + this.time * this.speed + s
|
|
2675
|
-
) * this.lineAmplitude, g = Math.sin(this.time * this.wiggleSpeed + s + t) * this.wiggleAmplitude, y = e + d + g, $ = (u + 1) * n, D = Math.sin(
|
|
2676
|
-
$ * this.lineFrequency + this.time * this.speed + s
|
|
2677
|
-
) * this.lineAmplitude, z = Math.sin(this.time * this.wiggleSpeed + s + t) * this.wiggleAmplitude, X = e + D + z, Q = (f + $) / 2, j = (y + X) / 2;
|
|
2678
|
-
u === 0 && i.moveTo(f, y), i.quadraticCurveTo(f, y, Q, j);
|
|
2679
|
-
}
|
|
2680
|
-
i.stroke();
|
|
2681
|
-
}
|
|
2682
|
-
};
|
|
2683
|
-
N([
|
|
2684
|
-
p({ type: Number, attribute: "line-count" })
|
|
2685
|
-
], A.prototype, "lineCount", 2);
|
|
2686
|
-
N([
|
|
2687
|
-
p({ type: Number, attribute: "line-amplitude" })
|
|
2688
|
-
], A.prototype, "lineAmplitude", 2);
|
|
2689
|
-
N([
|
|
2690
|
-
p({ type: Number, attribute: "line-frequency" })
|
|
2691
|
-
], A.prototype, "lineFrequency", 2);
|
|
2692
|
-
N([
|
|
2693
|
-
p({ type: Number, attribute: "speed" })
|
|
2694
|
-
], A.prototype, "speed", 2);
|
|
2695
|
-
N([
|
|
2696
|
-
p({ type: Number, attribute: "line-spacing" })
|
|
2697
|
-
], A.prototype, "lineSpacing", 2);
|
|
2698
|
-
N([
|
|
2699
|
-
p({ type: Number, attribute: "line-width" })
|
|
2700
|
-
], A.prototype, "lineWidth", 2);
|
|
2701
|
-
N([
|
|
2702
|
-
p({ type: Number, attribute: "line-hue-start" })
|
|
2703
|
-
], A.prototype, "lineHueStart", 2);
|
|
2704
|
-
N([
|
|
2705
|
-
p({ type: Number, attribute: "line-hue-end" })
|
|
2706
|
-
], A.prototype, "lineHueEnd", 2);
|
|
2707
|
-
N([
|
|
2708
|
-
p({ type: Number, attribute: "line-saturation" })
|
|
2709
|
-
], A.prototype, "lineSaturation", 2);
|
|
2710
|
-
N([
|
|
2711
|
-
p({ type: Number, attribute: "line-offset-step" })
|
|
2712
|
-
], A.prototype, "lineOffsetStep", 2);
|
|
2713
|
-
N([
|
|
2714
|
-
p({ type: Number, attribute: "wiggle-amplitude" })
|
|
2715
|
-
], A.prototype, "wiggleAmplitude", 2);
|
|
2716
|
-
N([
|
|
2717
|
-
p({ type: Number, attribute: "wiggle-speed" })
|
|
2718
|
-
], A.prototype, "wiggleSpeed", 2);
|
|
2719
|
-
N([
|
|
2720
|
-
p({
|
|
2721
|
-
type: Array,
|
|
2722
|
-
attribute: "line-colors",
|
|
2723
|
-
converter: at
|
|
2724
|
-
})
|
|
2725
|
-
], A.prototype, "lineColors", 2);
|
|
2726
|
-
A = N([
|
|
2727
|
-
ot("bb-liquid-lines")
|
|
2728
|
-
], A);
|
|
2729
|
-
class vi {
|
|
2730
|
-
constructor(e) {
|
|
2731
|
-
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 * 0.25, this.fadeOutDuration = this.lifespan * 0.5;
|
|
2732
|
-
}
|
|
2733
|
-
circularMove(e, i, r) {
|
|
2734
|
-
this.angle += this.speed * r, this.radius += this.force * r;
|
|
2735
|
-
const n = e + Math.cos(this.angle * this.frequencyX) * this.radius, s = i + Math.sin(this.angle * this.frequencyY) * this.radius;
|
|
2736
|
-
this.initialized ? (this.px = this.x, this.py = this.y, this.x = n, this.y = s) : (this.x = n, this.y = s, this.px = n, this.py = s, this.initialized = !0);
|
|
2737
|
-
}
|
|
2738
|
-
sinusMove(e, i, r) {
|
|
2739
|
-
this.angle += this.speed * r;
|
|
2740
|
-
const n = e + this.angle * 100, s = i + Math.sin(this.angle * this.frequencyY) * this.radius;
|
|
2741
|
-
this.initialized ? (this.px = this.x, this.py = this.y, this.x = n, this.y = s) : (this.x = n, this.y = s, this.px = n, this.py = s, this.initialized = !0);
|
|
2742
|
-
}
|
|
2743
|
-
draw(e) {
|
|
2744
|
-
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;
|
|
2745
|
-
}
|
|
2746
|
-
isDead() {
|
|
2747
|
-
return Date.now() - this.born > this.lifespan;
|
|
2748
|
-
}
|
|
2749
|
-
// 0 to 1
|
|
2750
|
-
railMove(e, i, r) {
|
|
2751
|
-
if (!this.initialized) {
|
|
2752
|
-
const l = this.x, c = this.y, u = this.snapToGrid(l, c, e, i);
|
|
2753
|
-
this.railFromX = u.x, this.railFromY = u.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;
|
|
2754
|
-
}
|
|
2755
|
-
const n = Math.abs(this.speed) * 20;
|
|
2756
|
-
this.railProgress += n / this.gridSize * r, this.railProgress >= 1 && (this.railProgress -= 1, this.railFromX = this.railToX, this.railFromY = this.railToY, this.pickNextRailTarget());
|
|
2757
|
-
const s = this.railToX - this.railFromX, o = this.railToY - this.railFromY, a = this.railFromX + s * this.railProgress, h = this.railFromY + o * this.railProgress;
|
|
2758
|
-
this.updatePosition(a, h);
|
|
2759
|
-
}
|
|
2760
|
-
pickNextRailTarget() {
|
|
2761
|
-
const e = Math.PI * 2 / this.gridSides, r = Math.floor(Math.random() * this.gridSides) * e + this.gridAngle;
|
|
2762
|
-
this.railToX = this.railFromX + Math.cos(r) * this.gridSize, this.railToY = this.railFromY + Math.sin(r) * this.gridSize;
|
|
2763
|
-
}
|
|
2764
|
-
snapToGrid(e, i, r, n) {
|
|
2765
|
-
let s = e - r, o = i - n;
|
|
2766
|
-
const a = Math.cos(-this.gridAngle), h = Math.sin(-this.gridAngle), l = s * a - o * h, c = s * h + o * a;
|
|
2767
|
-
let u = l, f = c;
|
|
2768
|
-
const d = this.gridSize;
|
|
2769
|
-
if (this.gridSides === 6 || this.gridSides === 3) {
|
|
2770
|
-
const $ = d * Math.sqrt(3) / 2;
|
|
2771
|
-
let D = Math.round(c / $);
|
|
2772
|
-
u = Math.round((l - D * d / 2) / d) * d + D * d / 2, f = D * $;
|
|
2773
|
-
} else this.gridSides === 4 && (u = Math.round(l / d) * d, f = Math.round(c / d) * d);
|
|
2774
|
-
const g = u * Math.cos(this.gridAngle) - f * Math.sin(this.gridAngle), y = u * Math.sin(this.gridAngle) + f * Math.cos(this.gridAngle);
|
|
2775
|
-
return { x: g + r, y: y + n };
|
|
2776
|
-
}
|
|
2777
|
-
updatePosition(e, i) {
|
|
2778
|
-
this.initialized ? (this.px = this.x, this.py = this.y, this.x = e, this.y = i) : (this.x = e, this.y = i, this.px = e, this.py = i, this.initialized = !0);
|
|
2779
|
-
}
|
|
2780
|
-
calculateOpacity() {
|
|
2781
|
-
const e = Date.now() - this.born;
|
|
2782
|
-
return e < this.fadeInDuration ? e / this.fadeInDuration : e > this.lifespan - this.fadeOutDuration ? (this.lifespan - e) / this.fadeOutDuration : 1;
|
|
2783
|
-
}
|
|
2784
|
-
}
|
|
2785
|
-
var So = Object.defineProperty, $o = Object.getOwnPropertyDescriptor, x = (t, e, i, r) => {
|
|
2786
|
-
for (var n = r > 1 ? void 0 : r ? $o(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
2787
|
-
(o = t[s]) && (n = (r ? o(e, i, n) : o(n)) || n);
|
|
2788
|
-
return r && n && So(e, i, n), n;
|
|
2789
|
-
};
|
|
2790
|
-
let _ = class extends O {
|
|
2791
|
-
constructor() {
|
|
2792
|
-
super(...arguments), 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 = 0.0125;
|
|
2793
|
-
}
|
|
2794
|
-
initialize() {
|
|
2795
|
-
this.particles = [], this.drawBackground(this.ctx);
|
|
2796
|
-
for (let t = 0; t < this.particleAmount; t++)
|
|
2797
|
-
this.particles.push(this.createParticle());
|
|
2798
|
-
}
|
|
2799
|
-
loop(t) {
|
|
2800
|
-
for (this.ctx.globalAlpha = this.trailOpacity, this.drawBackground(this.ctx), this.ctx.globalAlpha = 1, this.particles = this.particles.filter(
|
|
2801
|
-
(e) => !e.isDead()
|
|
2802
|
-
); this.particles.length < this.particleAmount; )
|
|
2803
|
-
this.particles.push(this.createParticle());
|
|
2804
|
-
this.particles.forEach((e) => {
|
|
2805
|
-
e.railMove(this.width / 2, this.height / 2, t), e.draw(this.ctx);
|
|
2806
|
-
});
|
|
2807
|
-
}
|
|
2808
|
-
createParticle() {
|
|
2809
|
-
const t = P(this.particleSizeMin, this.particleSizeMax), e = P(
|
|
2810
|
-
this.particleSpeedMin,
|
|
2811
|
-
this.particleSpeedMax
|
|
2812
|
-
), i = P(
|
|
2813
|
-
this.particleLifespanMin,
|
|
2814
|
-
this.particleLifespanMax
|
|
2815
|
-
);
|
|
2816
|
-
let r;
|
|
2817
|
-
this.particleColors && this.particleColors.length > 0 ? r = this.particleColors[Math.floor(Math.random() * this.particleColors.length)] : r = ce(
|
|
2818
|
-
[this.particleColorHueStart, this.particleColorHueEnd],
|
|
2819
|
-
[
|
|
2820
|
-
this.particleColorSaturationStart,
|
|
2821
|
-
this.particleColorSaturationEnd
|
|
2822
|
-
],
|
|
2823
|
-
[
|
|
2824
|
-
this.particleColorLightnessStart,
|
|
2825
|
-
this.particleColorLightnessEnd
|
|
2826
|
-
]
|
|
2827
|
-
);
|
|
2828
|
-
const n = P(0, this.width), s = P(0, this.height), o = n - this.width / 2, a = s - this.height / 2, h = Math.atan2(a, o);
|
|
2829
|
-
return new vi({
|
|
2830
|
-
size: t,
|
|
2831
|
-
speed: e,
|
|
2832
|
-
color: r,
|
|
2833
|
-
angle: h,
|
|
2834
|
-
lifespan: i,
|
|
2835
|
-
gridSides: this.gridSides,
|
|
2836
|
-
gridSize: this.gridSize,
|
|
2837
|
-
gridAngle: this.gridAngle,
|
|
2838
|
-
x: n,
|
|
2839
|
-
y: s
|
|
2840
|
-
});
|
|
2841
|
-
}
|
|
2842
|
-
};
|
|
2843
|
-
x([
|
|
2844
|
-
p({ type: Number, attribute: "particle-size-min" })
|
|
2845
|
-
], _.prototype, "particleSizeMin", 2);
|
|
2846
|
-
x([
|
|
2847
|
-
p({ type: Number, attribute: "particle-size-max" })
|
|
2848
|
-
], _.prototype, "particleSizeMax", 2);
|
|
2849
|
-
x([
|
|
2850
|
-
p({ type: Number, attribute: "particle-speed-min" })
|
|
2851
|
-
], _.prototype, "particleSpeedMin", 2);
|
|
2852
|
-
x([
|
|
2853
|
-
p({ type: Number, attribute: "particle-speed-max" })
|
|
2854
|
-
], _.prototype, "particleSpeedMax", 2);
|
|
2855
|
-
x([
|
|
2856
|
-
p({ type: Number, attribute: "particle-color-hue-start" })
|
|
2857
|
-
], _.prototype, "particleColorHueStart", 2);
|
|
2858
|
-
x([
|
|
2859
|
-
p({ type: Number, attribute: "particle-color-hue-end" })
|
|
2860
|
-
], _.prototype, "particleColorHueEnd", 2);
|
|
2861
|
-
x([
|
|
2862
|
-
p({ type: Number, attribute: "particle-color-saturation-start" })
|
|
2863
|
-
], _.prototype, "particleColorSaturationStart", 2);
|
|
2864
|
-
x([
|
|
2865
|
-
p({ type: Number, attribute: "particle-color-saturation-end" })
|
|
2866
|
-
], _.prototype, "particleColorSaturationEnd", 2);
|
|
2867
|
-
x([
|
|
2868
|
-
p({ type: Number, attribute: "particle-color-lightness-start" })
|
|
2869
|
-
], _.prototype, "particleColorLightnessStart", 2);
|
|
2870
|
-
x([
|
|
2871
|
-
p({ type: Number, attribute: "particle-color-lightness-end" })
|
|
2872
|
-
], _.prototype, "particleColorLightnessEnd", 2);
|
|
2873
|
-
x([
|
|
2874
|
-
p({ type: Number, attribute: "particle-lifespan-min" })
|
|
2875
|
-
], _.prototype, "particleLifespanMin", 2);
|
|
2876
|
-
x([
|
|
2877
|
-
p({ type: Number, attribute: "particle-lifespan-max" })
|
|
2878
|
-
], _.prototype, "particleLifespanMax", 2);
|
|
2879
|
-
x([
|
|
2880
|
-
p({ type: Number, attribute: "particle-amount" })
|
|
2881
|
-
], _.prototype, "particleAmount", 2);
|
|
2882
|
-
x([
|
|
2883
|
-
p({ type: Number, attribute: "grid-sides" })
|
|
2884
|
-
], _.prototype, "gridSides", 2);
|
|
2885
|
-
x([
|
|
2886
|
-
p({ type: Number, attribute: "grid-size" })
|
|
2887
|
-
], _.prototype, "gridSize", 2);
|
|
2888
|
-
x([
|
|
2889
|
-
p({ type: Number, attribute: "grid-angle" })
|
|
2890
|
-
], _.prototype, "gridAngle", 2);
|
|
2891
|
-
x([
|
|
2892
|
-
p({
|
|
2893
|
-
type: Array,
|
|
2894
|
-
attribute: "particle-colors",
|
|
2895
|
-
converter: at
|
|
2896
|
-
})
|
|
2897
|
-
], _.prototype, "particleColors", 2);
|
|
2898
|
-
x([
|
|
2899
|
-
p({ type: Number, attribute: "trail-opacity" })
|
|
2900
|
-
], _.prototype, "trailOpacity", 2);
|
|
2901
|
-
_ = x([
|
|
2902
|
-
ot("bb-neon-rails")
|
|
2903
|
-
], _);
|
|
2904
|
-
var Ao = Object.defineProperty, Co = Object.getOwnPropertyDescriptor, m = (t, e, i, r) => {
|
|
2905
|
-
for (var n = r > 1 ? void 0 : r ? Co(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
2906
|
-
(o = t[s]) && (n = (r ? o(e, i, n) : o(n)) || n);
|
|
2907
|
-
return r && n && Ao(e, i, n), n;
|
|
2908
|
-
};
|
|
2909
|
-
let b = class extends O {
|
|
2910
|
-
constructor() {
|
|
2911
|
-
super(...arguments), this.particleForce = 0, this.particleSizeMin = 0.5, this.particleSizeMax = 1.5, this.particleSpeedMin = 0.025, this.particleSpeedMax = 0.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 = [];
|
|
2912
|
-
}
|
|
2913
|
-
initialize() {
|
|
2914
|
-
this.particles = [], this.drawBackground(this.ctx), this.particleRadiusMax = this.particleRadiusMax || this.width;
|
|
2915
|
-
for (let t = 0; t < this.particleAmount; t++)
|
|
2916
|
-
this.particles.push(this.createParticle());
|
|
2917
|
-
}
|
|
2918
|
-
loop(t) {
|
|
2919
|
-
for (this.ctx.globalAlpha = this.trailOpacity, this.drawBackground(this.ctx), this.ctx.globalAlpha = 1, this.particles = this.particles.filter(
|
|
2920
|
-
(e) => !e.isDead()
|
|
2921
|
-
); this.particles.length < this.particleAmount; )
|
|
2922
|
-
this.particles.push(this.createParticle());
|
|
2923
|
-
this.particles.forEach((e) => {
|
|
2924
|
-
e.circularMove(this.width / 2, this.height / 2, t), e.draw(this.ctx);
|
|
2925
|
-
});
|
|
2926
|
-
}
|
|
2927
|
-
createParticle() {
|
|
2928
|
-
const t = P(this.particleSizeMin, this.particleSizeMax), e = P(
|
|
2929
|
-
this.particleSpeedMin,
|
|
2930
|
-
this.particleSpeedMax
|
|
2931
|
-
), i = P(
|
|
2932
|
-
this.particleLifespanMin,
|
|
2933
|
-
this.particleLifespanMax
|
|
2934
|
-
);
|
|
2935
|
-
let r;
|
|
2936
|
-
this.particleColors && this.particleColors.length > 0 ? r = this.particleColors[Math.floor(Math.random() * this.particleColors.length)] : r = ce(
|
|
2937
|
-
[this.particleColorHueStart, this.particleColorHueEnd],
|
|
2938
|
-
[
|
|
2939
|
-
this.particleColorSaturationStart,
|
|
2940
|
-
this.particleColorSaturationEnd
|
|
2941
|
-
],
|
|
2942
|
-
[
|
|
2943
|
-
this.particleColorLightnessStart,
|
|
2944
|
-
this.particleColorLightnessEnd
|
|
2945
|
-
]
|
|
2946
|
-
);
|
|
2947
|
-
const n = P(0, Math.PI * 2), s = this.particleRadiusMax - this.particleRadiusMin, o = Math.sqrt(Math.random()) * s + this.particleRadiusMin;
|
|
2948
|
-
return new vi({
|
|
2949
|
-
size: t,
|
|
2950
|
-
speed: e,
|
|
2951
|
-
color: r,
|
|
2952
|
-
radius: o,
|
|
2953
|
-
angle: n,
|
|
2954
|
-
lifespan: i,
|
|
2955
|
-
gridSides: this.gridSides,
|
|
2956
|
-
gridSize: this.gridSize,
|
|
2957
|
-
gridAngle: this.gridAngle,
|
|
2958
|
-
force: this.particleForce
|
|
2959
|
-
});
|
|
2960
|
-
}
|
|
2961
|
-
};
|
|
2962
|
-
m([
|
|
2963
|
-
p({ type: Number, attribute: "particle-force" })
|
|
2964
|
-
], b.prototype, "particleForce", 2);
|
|
2965
|
-
m([
|
|
2966
|
-
p({ type: Number, attribute: "particle-size-min" })
|
|
2967
|
-
], b.prototype, "particleSizeMin", 2);
|
|
2968
|
-
m([
|
|
2969
|
-
p({ type: Number, attribute: "particle-size-max" })
|
|
2970
|
-
], b.prototype, "particleSizeMax", 2);
|
|
2971
|
-
m([
|
|
2972
|
-
p({ type: Number, attribute: "particle-speed-min" })
|
|
2973
|
-
], b.prototype, "particleSpeedMin", 2);
|
|
2974
|
-
m([
|
|
2975
|
-
p({ type: Number, attribute: "particle-speed-max" })
|
|
2976
|
-
], b.prototype, "particleSpeedMax", 2);
|
|
2977
|
-
m([
|
|
2978
|
-
p({ type: Number, attribute: "particle-color-hue-start" })
|
|
2979
|
-
], b.prototype, "particleColorHueStart", 2);
|
|
2980
|
-
m([
|
|
2981
|
-
p({ type: Number, attribute: "particle-color-hue-end" })
|
|
2982
|
-
], b.prototype, "particleColorHueEnd", 2);
|
|
2983
|
-
m([
|
|
2984
|
-
p({ type: Number, attribute: "particle-color-saturation-start" })
|
|
2985
|
-
], b.prototype, "particleColorSaturationStart", 2);
|
|
2986
|
-
m([
|
|
2987
|
-
p({ type: Number, attribute: "particle-color-saturation-end" })
|
|
2988
|
-
], b.prototype, "particleColorSaturationEnd", 2);
|
|
2989
|
-
m([
|
|
2990
|
-
p({ type: Number, attribute: "particle-color-lightness-start" })
|
|
2991
|
-
], b.prototype, "particleColorLightnessStart", 2);
|
|
2992
|
-
m([
|
|
2993
|
-
p({ type: Number, attribute: "particle-color-lightness-end" })
|
|
2994
|
-
], b.prototype, "particleColorLightnessEnd", 2);
|
|
2995
|
-
m([
|
|
2996
|
-
p({ type: Number, attribute: "particle-radius-min" })
|
|
2997
|
-
], b.prototype, "particleRadiusMin", 2);
|
|
2998
|
-
m([
|
|
2999
|
-
p({ type: Number, attribute: "particle-radius-max" })
|
|
3000
|
-
], b.prototype, "particleRadiusMax", 2);
|
|
3001
|
-
m([
|
|
3002
|
-
p({ type: Number, attribute: "particle-lifespan-min" })
|
|
3003
|
-
], b.prototype, "particleLifespanMin", 2);
|
|
3004
|
-
m([
|
|
3005
|
-
p({ type: Number, attribute: "particle-lifespan-max" })
|
|
3006
|
-
], b.prototype, "particleLifespanMax", 2);
|
|
3007
|
-
m([
|
|
3008
|
-
p({ type: Number, attribute: "particle-amount" })
|
|
3009
|
-
], b.prototype, "particleAmount", 2);
|
|
3010
|
-
m([
|
|
3011
|
-
p({ type: Number, attribute: "grid-sides" })
|
|
3012
|
-
], b.prototype, "gridSides", 2);
|
|
3013
|
-
m([
|
|
3014
|
-
p({ type: Number, attribute: "grid-size" })
|
|
3015
|
-
], b.prototype, "gridSize", 2);
|
|
3016
|
-
m([
|
|
3017
|
-
p({ type: Number, attribute: "grid-angle" })
|
|
3018
|
-
], b.prototype, "gridAngle", 2);
|
|
3019
|
-
m([
|
|
3020
|
-
p({
|
|
3021
|
-
type: Array,
|
|
3022
|
-
attribute: "particle-colors",
|
|
3023
|
-
converter: at
|
|
3024
|
-
})
|
|
3025
|
-
], b.prototype, "particleColors", 2);
|
|
3026
|
-
b = m([
|
|
3027
|
-
ot("bb-star-trail")
|
|
3028
|
-
], b);
|
|
3029
|
-
export {
|
|
3030
|
-
w as BbAmbientRibbon,
|
|
3031
|
-
H as BbDigitalRain,
|
|
3032
|
-
S as BbHexagonWave,
|
|
3033
|
-
A as BbLiquidLines,
|
|
3034
|
-
_ as BbNeonRails,
|
|
3035
|
-
b as BbStarTrail,
|
|
3036
|
-
O as BeautifulBackground
|
|
3037
|
-
};
|
|
3038
|
-
//# sourceMappingURL=bb.es.js.map
|
|
48
|
+
`}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 Ie(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 Le(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 Re(e,t,n,r){return`hsla(${e}, ${t}%, ${n}%, ${r})`}function ze(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 Be(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 Ve(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 He=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 He(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)),Ve(this.ctx,this.ribbonLineWidth)}lineColor(e){let t=(t,n)=>n+(t-n)*e;return Re(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 Ue(){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=We(e-r),o=We(n-i);return Ge(Ge(t(r,i),t(r+1,i),a),Ge(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 We(e){return(1-Math.cos(e*Math.PI))/2}function Ge(e,t,n){return e+(t-e)*n}const Ke=[`#89964e`],qe=.1,Je=3/2.2**2,H=Array.from({length:64},(e,t)=>{let n=t/64*Math.PI*2;return[Math.cos(n)*qe,Math.sin(n)*qe]});let 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=Ke,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=Ue(),this.survey(),this.shades=Be(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:Ke}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(Ye(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]*Je*t,a=e.dy+this.flow[r+1]*Je*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=Xe(e.x,this.cols*10),e.y=Xe(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 Ye(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 Xe(e,t){return(e%t+t)%t}var Ze=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)]:Le([this.fontColorHueStart,this.fontColorHueEnd],[this.fontColorSaturationStart,this.fontColorSaturationEnd],[this.fontColorLightnessStart,this.fontColorLightnessEnd])}createSymbol(e){return new Ze(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 G=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}=ze(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`})],G.prototype,`hexSize`,void 0),F([N({type:Number,attribute:`wave-amplitude`})],G.prototype,`waveAmplitude`,void 0),F([N({type:Number,attribute:`wave-speed`})],G.prototype,`waveSpeed`,void 0),F([N({type:Number,attribute:`wave-x-factor`})],G.prototype,`waveXFactor`,void 0),F([N({type:Number,attribute:`wave-y-factor`})],G.prototype,`waveYFactor`,void 0),F([N({type:Number,attribute:`shade-amplitude`})],G.prototype,`shadeAmplitude`,void 0),F([N({type:Number,attribute:`shade-lightness-boost`})],G.prototype,`shadeLightnessBoost`,void 0),F([N({type:Number,attribute:`base-lightness`})],G.prototype,`baseLightness`,void 0),F([N({type:Number,attribute:`lightness-range`})],G.prototype,`lightnessRange`,void 0),F([N({type:Number,attribute:`hex-hue-start`})],G.prototype,`hexHueStart`,void 0),F([N({type:Number,attribute:`hex-hue-end`})],G.prototype,`hexHueEnd`,void 0),F([N({type:Number,attribute:`hex-saturation`})],G.prototype,`hexSaturation`,void 0),F([N({type:Number,attribute:`hex-scale`})],G.prototype,`hexScale`,void 0),F([N({type:Array,attribute:`hex-colors`,converter:P})],G.prototype,`hexColors`,void 0),G=F([M(`bb-hexagon-wave`)],G);const Qe=[`#47d1d1`,`#475ed1`,`#a347d1`],$e=[[0,0],[.2,.5],[.5,.8],[.8,.5],[1,0]],et=[15,2],tt=[1,.3],nt=[21,4],rt=[.5,.9];let K=class extends I{constructor(...e){super(...e),this.shaftColors=Qe,this.shaftAmount=100,this.speed=1,this.trailOpacity=1,this.cleanTrail=!1,this.shafts=[],this.builtFor=``}initialize(){let e=Be(this.shaftColors.length>0?this.shaftColors:Qe,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=q(et,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 $e){let r=n*q(tt,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(...rt),speed:q(nt,t),sprite:r}}};F([N({type:Array,attribute:`shaft-colors`,converter:P})],K.prototype,`shaftColors`,void 0),F([N({type:Number,attribute:`shaft-amount`})],K.prototype,`shaftAmount`,void 0),F([N({type:Number,attribute:`speed`})],K.prototype,`speed`,void 0),K=F([M(`bb-light-shafts`)],K);function q([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)}Ve(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}=ze(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 it=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),Ve(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=at(e-n,t-r,-this.gridAngle),a=this.nearestNode(i.x,i.y),o=at(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 at(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 it({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)]:Le([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);const ot=`#005588`,st=.65,ct=[[1.1,.9,.7,1],[-.7,1.4,1.3,.55],[2.1,.5,.5,.3]],lt=ct.reduce((e,[,,,t])=>e+t,0);let Z=class extends I{constructor(...e){super(...e),this.silkColor=ot,this.swell=.2,this.sheen=.73,this.reach=st,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(){let e=Math.max(0,this.swell)||0,t=Math.min(1,Math.max(0,this.sheen))||0,n=this.reach>0?this.reach:st,{h:r,s:i,l:a}=ze(this.silkColor||ot),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=ut(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 ut(e,t,n){let r=0;for(let[i,a,o,s]of ct)r+=s*Math.sin(i*e+a*t+o*n);return r/lt}const dt=[`#b24c8b`,`#9f972d`,`#68c44f`,`#15caa8`,`#00abea`,`#156aff`,`#6810ff`,`#9f00d7`],ft=.001,pt=.35,mt=.01,ht=.2;let Q=class extends I{constructor(...e){super(...e),this.ringColors=dt,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=mt*t*e,l=mt*n*e,u=(t-1)/2,d=(n-1)/2,f=ft*t*e*Math.cos(pt*this.time),p=ft*n*e*Math.sin(pt*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]-ht)*c,e-(r[a]-ht)*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,m=(c*i+l)*3,h=(u*i+s)*3,ee=(u*i+l)*3;for(let e=0;e<3;e++){let t=o[p+e]+(o[m+e]-o[p+e])*d,i=o[h+e]+(o[ee+e]-o[h+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),m=gt(Math.abs(d+p))*e,h=(l*this.columns+u)*3;for(let e=0;e<3;e++){let n=this.smoke[h+e]+t[e]*m;this.smoke[h+e]=Math.min(1,n)}}}ringColor(){let e=(this.ringColors.length>0?this.ringColors:dt).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 gt(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`)],$);export{V as BbAmbientRibbon,U as BbContourFlow,W as BbDigitalRain,G as BbHexagonWave,K as BbLightShafts,J as BbLiquidLines,X as BbNeonRails,Z as BbSilkWaves,Q as BbSmokeRing,$ as BbStarTrail,I as BeautifulBackground};
|
|
49
|
+
//# sourceMappingURL=bb.es.js.map
|