aptechka 0.94.5 → 0.95.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/lib/{Animation-DwOegoQA.js → Animation-D5bhzxA5.js} +2 -2
- package/lib/Animation-WtDiwPFQ.cjs +1 -0
- package/lib/Damped-B8unWaEn.cjs +1 -0
- package/lib/{Damped-m3PWu4LD.js → Damped-BZrSNeI7.js} +2 -2
- package/lib/Damped-BxBI6Dds.js +50 -0
- package/lib/Damped-DTVkIAqc.cjs +1 -0
- package/lib/{DerivedArray-CP3QiK6l.cjs → DerivedArray-0qZFAKZ4.cjs} +1 -1
- package/lib/{DerivedArray-DT9yLVm3.js → DerivedArray-BKdK5OWE.js} +1 -1
- package/lib/DragControls-CqNPYkc2.cjs +1 -0
- package/lib/{DragControls-DSG2Orh3.js → DragControls-DDFMqZg4.js} +5 -3
- package/lib/LocalLinks-5-30Z1lF.cjs +1 -0
- package/lib/{LocalLinks-BjyGjtxD.js → LocalLinks-D9RhyFMf.js} +1 -2
- package/lib/{PageAnnouncerElement-Bqbv_gWM.js → PageAnnouncerElement-CI048qxO.js} +2 -2
- package/lib/PageAnnouncerElement-DreveHSN.cjs +1 -0
- package/lib/{PageScroll-DgTMhV1L.js → PageScroll-CrYJVAHA.js} +1 -2
- package/lib/PageScroll-xuHDTIoC.cjs +1 -0
- package/lib/ScrollNavigator-CNKI1Iae.cjs +1 -0
- package/lib/ScrollNavigator-CiZjoiyk.js +83 -0
- package/lib/{SourceElement-DNEy09VX.js → SourceElement-BMinosvj.js} +13 -11
- package/lib/SourceElement-D9iTbecT.cjs +5 -0
- package/lib/Store-BP8tuWzQ.cjs +1 -0
- package/lib/{Store-CAGUSjFX.js → Store-LDYxlJNu.js} +7 -99
- package/lib/Tweened-9ATB544_.js +118 -0
- package/lib/{Tweened-CZeS3EqK.js → Tweened-BAR8oYF3.js} +3 -39
- package/lib/Tweened-BNb6DQ39.cjs +1 -0
- package/lib/Tweened-FpbbJ3xC.cjs +1 -0
- package/lib/Viewport-BdFs1Zsn.cjs +1 -0
- package/lib/{Viewport-B3kVX27H.js → Viewport-CPB14lI1.js} +3 -2
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +2 -2
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/animation-kit/AnimationStore.d.ts +22 -0
- package/lib/animation-kit/Damped.d.ts +14 -0
- package/lib/animation-kit/Spring.d.ts +67 -0
- package/lib/animation-kit/Tweened.d.ts +15 -0
- package/lib/animation-kit/index.cjs +1 -0
- package/lib/animation-kit/index.d.ts +4 -0
- package/lib/animation-kit/index.js +119 -0
- package/lib/api-fetcher/index.cjs +1 -1
- package/lib/api-fetcher/index.d.ts +1 -1
- package/lib/api-fetcher/index.js +5 -6
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +3 -2
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +2 -2
- package/lib/browser-B9QXFVgG.js +4 -0
- package/lib/browser-CIp8NsnF.cjs +1 -0
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +3 -3
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +1 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +1 -1
- package/lib/cookies/index.cjs +1 -1
- package/lib/cookies/index.js +20 -19
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.js +2 -2
- package/lib/css-value-parser/index.cjs +1 -1
- package/lib/css-value-parser/index.js +1 -1
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +2 -2
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/easings-Bgvyia2r.cjs +1 -0
- package/lib/easings-D9LNSyOP.js +41 -0
- package/lib/element-linked-store/index.cjs +1 -1
- package/lib/element-linked-store/index.d.ts +1 -1
- package/lib/element-linked-store/index.js +7 -4
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +2 -2
- package/lib/en3/index.cjs +2 -2
- package/lib/en3/index.js +1 -2
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +4 -3
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +5 -4
- package/lib/index-BrasTsja.cjs +1 -0
- package/lib/{index-DAG0CtYo.js → index-Z2Lgb7xU.js} +73 -73
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +2 -2
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.js +6 -5
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +1 -1
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +2 -2
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +1 -2
- package/lib/local-links/LocalLinks.d.ts +3 -2
- package/lib/local-links/index.cjs +1 -1
- package/lib/local-links/index.js +1 -1
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +3 -3
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +1 -1
- package/lib/morph/Morph.d.ts +3 -2
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +5 -4
- package/lib/need_redo_tweaker/index.cjs +3 -3
- package/lib/need_redo_tweaker/index.js +5 -3
- package/lib/notched/index.cjs +2 -2
- package/lib/notched/index.js +2 -2
- package/lib/page-announcer/index.cjs +1 -1
- package/lib/page-announcer/index.js +1 -1
- package/lib/page-scroll/index.cjs +1 -1
- package/lib/page-scroll/index.js +1 -1
- package/lib/pixel-perfect/index.cjs +1 -1
- package/lib/pixel-perfect/index.js +2 -3
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +4 -3
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +9 -9
- package/lib/radio/index.cjs +1 -1
- package/lib/radio/index.js +1 -2
- package/lib/render-C3udrJln.cjs +1 -0
- package/lib/{render-q67wh8Lw.js → render-D_MhEAJB.js} +4 -3
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +5 -6
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +9 -7
- package/lib/scroll-kit/ScrollNavigator.d.ts +17 -0
- package/lib/scroll-kit/SmoothScrollElement.d.ts +9 -8
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +78 -91
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +4 -3
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +2 -2
- package/lib/slicer/index.cjs +1 -1
- package/lib/slicer/index.js +2 -2
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +1 -1
- package/lib/spa/index.cjs +1 -1
- package/lib/spa/index.js +6 -6
- package/lib/store/Store.d.ts +2 -4
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +4 -4
- package/lib/string-Bx5N38JG.cjs +1 -0
- package/lib/string-Ct-dy_cs.js +90 -0
- package/lib/stylesheet-B-bI1cZ3.cjs +1 -0
- package/lib/{stylesheet-GIzIJ_Xj.js → stylesheet-BUUjDCDf.js} +2 -1
- package/lib/subtree-observer/index.cjs +1 -1
- package/lib/subtree-observer/index.js +1 -2
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +2 -2
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +104 -106
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +5 -4
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +2 -2
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +5 -3
- package/package.json +9 -1
- package/lib/Animation-CS32dwF1.cjs +0 -1
- package/lib/Damped-B_mVO810.cjs +0 -1
- package/lib/DragControls-DZ0Np8yt.cjs +0 -1
- package/lib/LocalLinks-DJPhk_Gn.cjs +0 -1
- package/lib/PageAnnouncerElement-auvTbYB3.cjs +0 -1
- package/lib/PageScroll-DYsZDt3U.cjs +0 -1
- package/lib/SourceElement-CAukFvLE.cjs +0 -5
- package/lib/Store-B96mD8mD.cjs +0 -1
- package/lib/Tweened-j_TwbxEI.cjs +0 -1
- package/lib/Viewport-Blxv_yl_.cjs +0 -1
- package/lib/index-BoGx2BWX.cjs +0 -1
- package/lib/render-B5iiOqye.cjs +0 -1
- package/lib/scroll-CTDesBpj.cjs +0 -1
- package/lib/scroll-D1MT0QMY.js +0 -60
- package/lib/stylesheet-DQv6_0na.cjs +0 -1
- package/lib/utils/scroll.d.ts +0 -14
|
@@ -6,82 +6,8 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
6
6
|
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
7
7
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
8
8
|
import { Notifier } from "./notifier/index.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return kebab.split("-").forEach((part, i) => {
|
|
12
|
-
if (i === 0 && !capitalize2)
|
|
13
|
-
camel += part;
|
|
14
|
-
else {
|
|
15
|
-
const firstLetter = part[0], restLetters = part.slice(1), capitalized = firstLetter.toUpperCase() + restLetters;
|
|
16
|
-
camel += capitalized;
|
|
17
|
-
}
|
|
18
|
-
}), camel;
|
|
19
|
-
}
|
|
20
|
-
__name(kebabToCamel, "kebabToCamel");
|
|
21
|
-
function camelToKebab(camelCaseString) {
|
|
22
|
-
return camelCaseString.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
23
|
-
}
|
|
24
|
-
__name(camelToKebab, "camelToKebab");
|
|
25
|
-
function snakeToDotted(snake) {
|
|
26
|
-
return snake.split("_").join(".");
|
|
27
|
-
}
|
|
28
|
-
__name(snakeToDotted, "snakeToDotted");
|
|
29
|
-
function toPascalCase(str) {
|
|
30
|
-
return /^[a-z\d]+$/i.test(str) ? str.charAt(0).toUpperCase() + str.slice(1) : str.replace(
|
|
31
|
-
/([a-z\d])([a-z\d]*)/gi,
|
|
32
|
-
(_, g1, g2) => g1.toUpperCase() + g2.toLowerCase()
|
|
33
|
-
).replace(/[^a-z\d]/gi, "");
|
|
34
|
-
}
|
|
35
|
-
__name(toPascalCase, "toPascalCase");
|
|
36
|
-
function sliceAndModifyFirst(string, method) {
|
|
37
|
-
return string.slice(0, 1)[method]() + string.slice(1);
|
|
38
|
-
}
|
|
39
|
-
__name(sliceAndModifyFirst, "sliceAndModifyFirst");
|
|
40
|
-
function sliceAndModify(string, everyWord = !1, method) {
|
|
41
|
-
return everyWord ? string.split(" ").map((v) => sliceAndModifyFirst(v, method)).join(" ") : sliceAndModifyFirst(string, method);
|
|
42
|
-
}
|
|
43
|
-
__name(sliceAndModify, "sliceAndModify");
|
|
44
|
-
function capitalize(string, everyWord = !1) {
|
|
45
|
-
return sliceAndModify(string, everyWord, "toUpperCase");
|
|
46
|
-
}
|
|
47
|
-
__name(capitalize, "capitalize");
|
|
48
|
-
function uncapitalize(string, everyWord = !1) {
|
|
49
|
-
return sliceAndModify(string, everyWord, "toLowerCase");
|
|
50
|
-
}
|
|
51
|
-
__name(uncapitalize, "uncapitalize");
|
|
52
|
-
function generateId(length, characters = "abcdefghijklmnopqrstuvwxyz0123456789") {
|
|
53
|
-
const charactersLength = characters.length, key = crypto.getRandomValues(new Uint8Array(length));
|
|
54
|
-
let generatedKey = "";
|
|
55
|
-
for (let i = 0; i < length; i++)
|
|
56
|
-
generatedKey += characters.charAt(key[i] % charactersLength);
|
|
57
|
-
return generatedKey;
|
|
58
|
-
}
|
|
59
|
-
__name(generateId, "generateId");
|
|
60
|
-
function isUppercase(string) {
|
|
61
|
-
return new RegExp("^\\p{Lu}", "u").test(string);
|
|
62
|
-
}
|
|
63
|
-
__name(isUppercase, "isUppercase");
|
|
64
|
-
let textarea;
|
|
65
|
-
function decodeHtmlEntities(html) {
|
|
66
|
-
return textarea || (textarea = document.createElement("textarea")), textarea.innerHTML = html, textarea.value;
|
|
67
|
-
}
|
|
68
|
-
__name(decodeHtmlEntities, "decodeHtmlEntities");
|
|
69
|
-
function declension(number, one, few, many) {
|
|
70
|
-
const n = typeof number == "string" ? parseInt(number) : number;
|
|
71
|
-
if (n === 1)
|
|
72
|
-
return one;
|
|
73
|
-
if (n % 100 >= 11 && n % 100 <= 14)
|
|
74
|
-
return many;
|
|
75
|
-
const remainder = n % 10;
|
|
76
|
-
return remainder === 1 ? one : remainder >= 2 && remainder <= 4 ? few : many;
|
|
77
|
-
}
|
|
78
|
-
__name(declension, "declension");
|
|
79
|
-
function getRandomChar(chars) {
|
|
80
|
-
let c = chars || "abcdefghijklmnopqrstuvwxyz1234567890!@#$^&*()…æ_+-=;[]/~`";
|
|
81
|
-
return c = c[Math.floor(Math.random() * c.length)], Math.random() > 0.5 ? c : c.toUpperCase();
|
|
82
|
-
}
|
|
83
|
-
__name(getRandomChar, "getRandomChar");
|
|
84
|
-
const isBrowser = typeof window != "undefined" && typeof window.document != "undefined";
|
|
9
|
+
import { g as generateId } from "./string-Ct-dy_cs.js";
|
|
10
|
+
import { i as isBrowser } from "./browser-B9QXFVgG.js";
|
|
85
11
|
var _loadedState;
|
|
86
12
|
const _StoreRegistry = class _StoreRegistry {
|
|
87
13
|
constructor() {
|
|
@@ -171,18 +97,9 @@ const _Store = class _Store {
|
|
|
171
97
|
__privateGet(this, _state).current = value, this.notify(), __privateGet(this, _notifyAndClose) && this.close();
|
|
172
98
|
}
|
|
173
99
|
}
|
|
174
|
-
|
|
100
|
+
set(value) {
|
|
175
101
|
this.current = value;
|
|
176
102
|
}
|
|
177
|
-
update(callback) {
|
|
178
|
-
this.current = callback(this.current);
|
|
179
|
-
}
|
|
180
|
-
add(value) {
|
|
181
|
-
Array.isArray(this.current) && (this.current = [...this.current, value]);
|
|
182
|
-
}
|
|
183
|
-
filter(callback) {
|
|
184
|
-
Array.isArray(this.current) && (this.current = this.current.filter(callback));
|
|
185
|
-
}
|
|
186
103
|
get subscribers() {
|
|
187
104
|
return __privateGet(this, _notifier).subscribers;
|
|
188
105
|
}
|
|
@@ -210,6 +127,9 @@ const _Store = class _Store {
|
|
|
210
127
|
close() {
|
|
211
128
|
__privateGet(this, _notifier).close(), __privateGet(this, _state).previous = void 0, __privateGet(this, _state).current = __privateGet(this, _state).initial, unshareStore(this);
|
|
212
129
|
}
|
|
130
|
+
_handleSet(value) {
|
|
131
|
+
__privateGet(this, _state).current = value;
|
|
132
|
+
}
|
|
213
133
|
};
|
|
214
134
|
_name = new WeakMap(), _state = new WeakMap(), _equalityCheck = new WeakMap(), _notifier = new WeakMap(), _skipSubscribeNotification = new WeakMap(), _middlewares = new WeakMap(), _notifyAndClose = new WeakMap(), _invisible = new WeakMap(), _id = new WeakMap(), __name(_Store, "Store");
|
|
215
135
|
let Store = _Store;
|
|
@@ -227,17 +147,5 @@ __name(unshareStore, "unshareStore");
|
|
|
227
147
|
export {
|
|
228
148
|
Store as S,
|
|
229
149
|
activeStores as a,
|
|
230
|
-
|
|
231
|
-
camelToKebab as c,
|
|
232
|
-
isUppercase as d,
|
|
233
|
-
decodeHtmlEntities as e,
|
|
234
|
-
declension as f,
|
|
235
|
-
generateId as g,
|
|
236
|
-
getRandomChar as h,
|
|
237
|
-
isBrowser as i,
|
|
238
|
-
storeRegistry as j,
|
|
239
|
-
kebabToCamel as k,
|
|
240
|
-
snakeToDotted as s,
|
|
241
|
-
toPascalCase as t,
|
|
242
|
-
uncapitalize as u
|
|
150
|
+
storeRegistry as s
|
|
243
151
|
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var __typeError = (msg) => {
|
|
5
|
+
throw TypeError(msg);
|
|
6
|
+
};
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
|
|
8
|
+
for (var prop in b || (b = {}))
|
|
9
|
+
__hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b))
|
|
12
|
+
__propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
13
|
+
return a;
|
|
14
|
+
};
|
|
15
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
16
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
17
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
18
|
+
import { a as easeInOutCubic, e as easings } from "./easings-D9LNSyOP.js";
|
|
19
|
+
import { c as clamp } from "./math-r8V23YFe.js";
|
|
20
|
+
import { p as preciseNumber } from "./number-DiVt2xnh.js";
|
|
21
|
+
import { n as nullishCoalescing } from "./polyfills-CG1XJNia.js";
|
|
22
|
+
import "construct-style-sheets-polyfill";
|
|
23
|
+
import { t as ticker } from "./index-Z2Lgb7xU.js";
|
|
24
|
+
import { TICK_ORDER } from "./order/index.js";
|
|
25
|
+
import { S as Store } from "./Store-LDYxlJNu.js";
|
|
26
|
+
var _tickerOptions, _target, _active, _isAnimationSet, _min, _max, _direction, _tickListener;
|
|
27
|
+
const _AnimationStore = class _AnimationStore extends Store {
|
|
28
|
+
constructor(initialValue = 0) {
|
|
29
|
+
super(initialValue);
|
|
30
|
+
__privateAdd(this, _tickerOptions);
|
|
31
|
+
__privateAdd(this, _target, 0);
|
|
32
|
+
__privateAdd(this, _active, !1);
|
|
33
|
+
__privateAdd(this, _isAnimationSet, !1);
|
|
34
|
+
__privateAdd(this, _min, -1 / 0);
|
|
35
|
+
__privateAdd(this, _max, 1 / 0);
|
|
36
|
+
__privateAdd(this, _direction, 1);
|
|
37
|
+
__privateAdd(this, _tickListener, /* @__PURE__ */ __name((e) => {
|
|
38
|
+
if (preciseNumber(this.current, 6) === preciseNumber(this.target, 6)) {
|
|
39
|
+
this.stopAnimation();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
__privateSet(this, _isAnimationSet, !0), this.onAnimationTick(e), __privateSet(this, _isAnimationSet, !1);
|
|
43
|
+
}, "#tickListener"));
|
|
44
|
+
__privateSet(this, _target, initialValue);
|
|
45
|
+
}
|
|
46
|
+
get active() {
|
|
47
|
+
return __privateGet(this, _active);
|
|
48
|
+
}
|
|
49
|
+
get target() {
|
|
50
|
+
return __privateGet(this, _target);
|
|
51
|
+
}
|
|
52
|
+
get direction() {
|
|
53
|
+
return __privateGet(this, _direction);
|
|
54
|
+
}
|
|
55
|
+
get min() {
|
|
56
|
+
return __privateGet(this, _min);
|
|
57
|
+
}
|
|
58
|
+
get max() {
|
|
59
|
+
return __privateGet(this, _max);
|
|
60
|
+
}
|
|
61
|
+
close() {
|
|
62
|
+
super.close(), this.stopAnimation();
|
|
63
|
+
}
|
|
64
|
+
get current() {
|
|
65
|
+
return super.current;
|
|
66
|
+
}
|
|
67
|
+
set current(value) {
|
|
68
|
+
__privateGet(this, _target) !== value && (__privateGet(this, _isAnimationSet) ? super.current = value : __privateSet(this, _target, clamp(value, __privateGet(this, _min), __privateGet(this, _max))), __privateSet(this, _direction, Math.sign(
|
|
69
|
+
__privateGet(this, _target) - (this.previous || this.initial)
|
|
70
|
+
)), __privateGet(this, _isAnimationSet) || this.startAnimation());
|
|
71
|
+
}
|
|
72
|
+
setWithoutAnimation(value) {
|
|
73
|
+
__privateSet(this, _isAnimationSet, !0), this.current = clamp(value, __privateGet(this, _min), __privateGet(this, _max)), __privateSet(this, _target, this.current), __privateSet(this, _isAnimationSet, !1);
|
|
74
|
+
}
|
|
75
|
+
setEdges(min = -1 / 0, max = 1 / 0) {
|
|
76
|
+
__privateSet(this, _min, min), __privateSet(this, _max, max), this.current = clamp(__privateGet(this, _target), __privateGet(this, _min), __privateGet(this, _max));
|
|
77
|
+
}
|
|
78
|
+
setTickerOptions(options) {
|
|
79
|
+
__privateSet(this, _tickerOptions, options), __privateGet(this, _active) && (this.stopAnimation(), this.startAnimation());
|
|
80
|
+
}
|
|
81
|
+
startAnimation() {
|
|
82
|
+
var _a;
|
|
83
|
+
__privateGet(this, _active) || (__privateSet(this, _active, !0), (_a = this.onAnimationStart) == null || _a.call(this), ticker.subscribe(__privateGet(this, _tickListener), __spreadValues({
|
|
84
|
+
order: TICK_ORDER.ANIMATION
|
|
85
|
+
}, __privateGet(this, _tickerOptions))));
|
|
86
|
+
}
|
|
87
|
+
stopAnimation() {
|
|
88
|
+
var _a;
|
|
89
|
+
__privateGet(this, _active) && (ticker.unsubscribe(__privateGet(this, _tickListener)), __privateSet(this, _active, !1), super.current = this.target, (_a = this.onAnimationStop) == null || _a.call(this));
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
_tickerOptions = new WeakMap(), _target = new WeakMap(), _active = new WeakMap(), _isAnimationSet = new WeakMap(), _min = new WeakMap(), _max = new WeakMap(), _direction = new WeakMap(), _tickListener = new WeakMap(), __name(_AnimationStore, "AnimationStore");
|
|
93
|
+
let AnimationStore = _AnimationStore;
|
|
94
|
+
var _easing, _duration;
|
|
95
|
+
const _Tweened = class _Tweened extends AnimationStore {
|
|
96
|
+
constructor(options) {
|
|
97
|
+
super((options == null ? void 0 : options.initial) || 0);
|
|
98
|
+
__privateAdd(this, _easing, easeInOutCubic);
|
|
99
|
+
__privateAdd(this, _duration, 1e3);
|
|
100
|
+
this.setOptions(options);
|
|
101
|
+
}
|
|
102
|
+
setOptions(options) {
|
|
103
|
+
__privateSet(this, _easing, typeof (options == null ? void 0 : options.easing) == "function" ? options.easing : typeof (options == null ? void 0 : options.easing) == "string" ? easings[options.easing] || easings.linear : __privateGet(this, _easing)), __privateSet(this, _duration, (options == null ? void 0 : options.duration) === !1 ? 0 : nullishCoalescing(options == null ? void 0 : options.duration, __privateGet(this, _duration)));
|
|
104
|
+
}
|
|
105
|
+
onAnimationTick(e) {
|
|
106
|
+
const t = e.timeElapsedSinceSubscription / 1e3 / (__privateGet(this, _duration) / 1e3) || 0, et = __privateGet(this, _easing).call(this, clamp(t, 0, 1));
|
|
107
|
+
this.current = preciseNumber(
|
|
108
|
+
this.initial + (this.target - this.initial) * et,
|
|
109
|
+
6
|
|
110
|
+
), t > 1 && this.stopAnimation();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
_easing = new WeakMap(), _duration = new WeakMap(), __name(_Tweened, "Tweened");
|
|
114
|
+
let Tweened = _Tweened;
|
|
115
|
+
export {
|
|
116
|
+
AnimationStore as A,
|
|
117
|
+
Tweened as T
|
|
118
|
+
};
|
|
@@ -15,29 +15,11 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
15
15
|
}, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)), __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
16
16
|
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
17
17
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
18
|
+
import { l as linear, e as easings } from "./easings-D9LNSyOP.js";
|
|
18
19
|
import { c as clamp } from "./math-r8V23YFe.js";
|
|
19
20
|
import { p as preciseNumber } from "./number-DiVt2xnh.js";
|
|
20
21
|
import { n as nullishCoalescing } from "./polyfills-CG1XJNia.js";
|
|
21
|
-
import { A as Animation } from "./Animation-
|
|
22
|
-
const linear = /* @__PURE__ */ __name((t) => t, "linear"), easeInQuad = /* @__PURE__ */ __name((t) => t * t, "easeInQuad"), easeOutQuad = /* @__PURE__ */ __name((t) => t * (2 - t), "easeOutQuad"), easeInOutQuad = /* @__PURE__ */ __name((t) => t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t, "easeInOutQuad"), easeInCubic = /* @__PURE__ */ __name((t) => t * t * t, "easeInCubic"), easeOutCubic = /* @__PURE__ */ __name((t) => --t * t * t + 1, "easeOutCubic"), easeInOutCubic = /* @__PURE__ */ __name((t) => t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1, "easeInOutCubic"), easeInQuart = /* @__PURE__ */ __name((t) => t * t * t * t, "easeInQuart"), easeOutQuart = /* @__PURE__ */ __name((t) => 1 - --t * t * t * t, "easeOutQuart"), easeInOutQuart = /* @__PURE__ */ __name((t) => t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t, "easeInOutQuart"), easeInQuint = /* @__PURE__ */ __name((t) => t * t * t * t * t, "easeInQuint"), easeOutQuint = /* @__PURE__ */ __name((t) => 1 + --t * t * t * t * t, "easeOutQuint"), easeInOutQuint = /* @__PURE__ */ __name((t) => t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t, "easeInOutQuint"), easeInExpo = /* @__PURE__ */ __name((t) => t === 0 ? 0 : 2 ** (10 * (t - 1)), "easeInExpo"), easeOutExpo = /* @__PURE__ */ __name((t) => t === 1 ? 1 : 1 - 2 ** (-10 * t), "easeOutExpo"), easeInOutExpo = /* @__PURE__ */ __name((t) => t === 0 || t === 1 ? t : t < 0.5 ? 0.5 * 2 ** (10 * 2 * (t - 0.5)) : 0.5 * (2 - Math.abs(2 ** (-10 * 2 * (t - 0.5)))), "easeInOutExpo"), easeOvershoot = /* @__PURE__ */ __name((t) => 3 * (1 - t) * (1 - t) * t * 0.33 + 3 * (1 - t) * t * t * 1.42 + t * t * t * 0.05, "easeOvershoot"), easings = {
|
|
23
|
-
linear,
|
|
24
|
-
easeInQuad,
|
|
25
|
-
easeOutQuad,
|
|
26
|
-
easeInOutQuad,
|
|
27
|
-
easeInCubic,
|
|
28
|
-
easeOutCubic,
|
|
29
|
-
easeInOutCubic,
|
|
30
|
-
easeInQuart,
|
|
31
|
-
easeOutQuart,
|
|
32
|
-
easeInOutQuart,
|
|
33
|
-
easeInQuint,
|
|
34
|
-
easeOutQuint,
|
|
35
|
-
easeInOutQuint,
|
|
36
|
-
easeInExpo,
|
|
37
|
-
easeOutExpo,
|
|
38
|
-
easeInOutExpo,
|
|
39
|
-
easeOvershoot
|
|
40
|
-
};
|
|
22
|
+
import { A as Animation } from "./Animation-D5bhzxA5.js";
|
|
41
23
|
var _easing, _duration;
|
|
42
24
|
const _Tweened = class _Tweened extends Animation {
|
|
43
25
|
constructor(initial, options) {
|
|
@@ -60,23 +42,5 @@ const _Tweened = class _Tweened extends Animation {
|
|
|
60
42
|
_easing = new WeakMap(), _duration = new WeakMap(), __name(_Tweened, "Tweened");
|
|
61
43
|
let Tweened = _Tweened;
|
|
62
44
|
export {
|
|
63
|
-
Tweened as T
|
|
64
|
-
easeInOutExpo as a,
|
|
65
|
-
easeOutQuad as b,
|
|
66
|
-
easeInOutQuad as c,
|
|
67
|
-
easeInCubic as d,
|
|
68
|
-
easeInQuad as e,
|
|
69
|
-
easeOutCubic as f,
|
|
70
|
-
easeInOutCubic as g,
|
|
71
|
-
easeInQuart as h,
|
|
72
|
-
easeOutQuart as i,
|
|
73
|
-
easeInOutQuart as j,
|
|
74
|
-
easeInQuint as k,
|
|
75
|
-
linear as l,
|
|
76
|
-
easeOutQuint as m,
|
|
77
|
-
easeInOutQuint as n,
|
|
78
|
-
easeInExpo as o,
|
|
79
|
-
easeOutExpo as p,
|
|
80
|
-
easeOvershoot as q,
|
|
81
|
-
easings as r
|
|
45
|
+
Tweened as T
|
|
82
46
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const easings=require("./easings-Bgvyia2r.cjs"),math=require("./math-C-knY2TL.cjs"),number=require("./number-Bu4sGvW7.cjs"),polyfills=require("./polyfills-DZCuDBkA.cjs");require("construct-style-sheets-polyfill");const intersector_index=require("./index-BrasTsja.cjs"),order_index=require("./order/index.cjs"),Store=require("./Store-BP8tuWzQ.cjs");var _tickerOptions,_target,_active,_isAnimationSet,_min,_max,_direction,_tickListener;const _AnimationStore=class _AnimationStore extends Store.Store{constructor(initialValue=0){super(initialValue);__privateAdd(this,_tickerOptions);__privateAdd(this,_target,0);__privateAdd(this,_active,!1);__privateAdd(this,_isAnimationSet,!1);__privateAdd(this,_min,-1/0);__privateAdd(this,_max,1/0);__privateAdd(this,_direction,1);__privateAdd(this,_tickListener,__name(e=>{if(number.preciseNumber(this.current,6)===number.preciseNumber(this.target,6)){this.stopAnimation();return}__privateSet(this,_isAnimationSet,!0),this.onAnimationTick(e),__privateSet(this,_isAnimationSet,!1)},"#tickListener"));__privateSet(this,_target,initialValue)}get active(){return __privateGet(this,_active)}get target(){return __privateGet(this,_target)}get direction(){return __privateGet(this,_direction)}get min(){return __privateGet(this,_min)}get max(){return __privateGet(this,_max)}close(){super.close(),this.stopAnimation()}get current(){return super.current}set current(value){__privateGet(this,_target)!==value&&(__privateGet(this,_isAnimationSet)?super.current=value:__privateSet(this,_target,math.clamp(value,__privateGet(this,_min),__privateGet(this,_max))),__privateSet(this,_direction,Math.sign(__privateGet(this,_target)-(this.previous||this.initial))),__privateGet(this,_isAnimationSet)||this.startAnimation())}setWithoutAnimation(value){__privateSet(this,_isAnimationSet,!0),this.current=math.clamp(value,__privateGet(this,_min),__privateGet(this,_max)),__privateSet(this,_target,this.current),__privateSet(this,_isAnimationSet,!1)}setEdges(min=-1/0,max=1/0){__privateSet(this,_min,min),__privateSet(this,_max,max),this.current=math.clamp(__privateGet(this,_target),__privateGet(this,_min),__privateGet(this,_max))}setTickerOptions(options){__privateSet(this,_tickerOptions,options),__privateGet(this,_active)&&(this.stopAnimation(),this.startAnimation())}startAnimation(){var _a;__privateGet(this,_active)||(__privateSet(this,_active,!0),(_a=this.onAnimationStart)==null||_a.call(this),intersector_index.ticker.subscribe(__privateGet(this,_tickListener),__spreadValues({order:order_index.TICK_ORDER.ANIMATION},__privateGet(this,_tickerOptions))))}stopAnimation(){var _a;__privateGet(this,_active)&&(intersector_index.ticker.unsubscribe(__privateGet(this,_tickListener)),__privateSet(this,_active,!1),super.current=this.target,(_a=this.onAnimationStop)==null||_a.call(this))}};_tickerOptions=new WeakMap,_target=new WeakMap,_active=new WeakMap,_isAnimationSet=new WeakMap,_min=new WeakMap,_max=new WeakMap,_direction=new WeakMap,_tickListener=new WeakMap,__name(_AnimationStore,"AnimationStore");let AnimationStore=_AnimationStore;var _easing,_duration;const _Tweened=class _Tweened extends AnimationStore{constructor(options){super((options==null?void 0:options.initial)||0);__privateAdd(this,_easing,easings.easeInOutCubic);__privateAdd(this,_duration,1e3);this.setOptions(options)}setOptions(options){__privateSet(this,_easing,typeof(options==null?void 0:options.easing)=="function"?options.easing:typeof(options==null?void 0:options.easing)=="string"?easings.easings[options.easing]||easings.easings.linear:__privateGet(this,_easing)),__privateSet(this,_duration,(options==null?void 0:options.duration)===!1?0:polyfills.nullishCoalescing(options==null?void 0:options.duration,__privateGet(this,_duration)))}onAnimationTick(e){const t=e.timeElapsedSinceSubscription/1e3/(__privateGet(this,_duration)/1e3)||0,et=__privateGet(this,_easing).call(this,math.clamp(t,0,1));this.current=number.preciseNumber(this.initial+(this.target-this.initial)*et,6),t>1&&this.stopAnimation()}};_easing=new WeakMap,_duration=new WeakMap,__name(_Tweened,"Tweened");let Tweened=_Tweened;exports.AnimationStore=AnimationStore;exports.Tweened=Tweened;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const easings=require("./easings-Bgvyia2r.cjs"),math=require("./math-C-knY2TL.cjs"),number=require("./number-Bu4sGvW7.cjs"),polyfills=require("./polyfills-DZCuDBkA.cjs"),Animation=require("./Animation-WtDiwPFQ.cjs");var _easing,_duration;const _Tweened=class _Tweened extends Animation.Animation{constructor(initial,options){super(initial||0,options);__privateAdd(this,_easing,easings.linear);__privateAdd(this,_duration,1e3);this.updateOptions(__spreadProps(__spreadValues({},options),{equalize:!0}))}updateOptions(options){super.updateOptions(options),__privateSet(this,_easing,typeof(options==null?void 0:options.easing)=="function"?options.easing:typeof(options==null?void 0:options.easing)=="string"?easings.easings[options.easing]||easings.easings.linear:__privateGet(this,_easing)),__privateSet(this,_duration,(options==null?void 0:options.duration)===!1?0:polyfills.nullishCoalescing(options==null?void 0:options.duration,__privateGet(this,_duration)))}handleAnimationFrame(e){const t=e.timeElapsedSinceSubscription/1e3/(__privateGet(this,_duration)/1e3)||0,et=__privateGet(this,_easing).call(this,math.clamp(t,0,1));this.current=number.preciseNumber(this.from+(this.target-this.from)*et,6),t>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),super.start()}};_easing=new WeakMap,_duration=new WeakMap,__name(_Tweened,"Tweened");let Tweened=_Tweened;exports.Tweened=Tweened;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const order_index=require("./order/index.cjs"),windowResizer_index=require("./window-resizer/index.cjs"),browser=require("./browser-CIp8NsnF.cjs");require("construct-style-sheets-polyfill");require("./index-BrasTsja.cjs");const Store=require("./Store-BP8tuWzQ.cjs");var _OS,_isMobile,_isTouch,_isWebgl,_isWebp,_isApple;const _Device=class _Device{constructor(){__privateAdd(this,_OS);__privateAdd(this,_isMobile);__privateAdd(this,_isTouch);__privateAdd(this,_isWebgl);__privateAdd(this,_isWebp);__privateAdd(this,_isApple);var _a,_b;if(__privateSet(this,_OS,"unknown"),__privateSet(this,_isMobile,!1),__privateSet(this,_isTouch,!1),__privateSet(this,_isWebgl,!1),__privateSet(this,_isWebp,!1),__privateSet(this,_isApple,!1),this.resize=()=>{__privateSet(this,_isMobile,/Mobi|Android/i.test(navigator.userAgent)),__privateSet(this,_isTouch,"ontouchstart"in window||navigator.maxTouchPoints>0),setTimeout(()=>{__privateSet(this,_isTouch,"ontouchstart"in window||navigator.maxTouchPoints>0)},0)},browser.isBrowser){this.resize(),windowResizer_index.windowResizer.subscribe(this.resize,order_index.RESIZE_ORDER.DEVICE);{const canvas=document.createElement("canvas"),gl=canvas.getContext("webgl")||canvas.getContext("experimental-webgl");__privateSet(this,_isWebgl,gl&&gl instanceof WebGLRenderingContext||!1)}{const canvas=document.createElement("canvas");canvas.getContext("2d")&&__privateSet(this,_isWebp,canvas.toDataURL("image/webp").indexOf("data:image/webp")==0)}const userAgent=window.navigator.userAgent,platform=((_b=(_a=window.navigator)==null?void 0:_a.userAgentData)==null?void 0:_b.platform)||window.navigator.platform,macosPlatforms=["Macintosh","MacIntel","MacPPC","Mac68K","macOS"],windowsPlatforms=["Win32","Win64","Windows","WinCE"],iosPlatforms=["iPhone","iPad","iPod"];macosPlatforms.includes(platform)?(__privateSet(this,_OS,"macOS"),__privateSet(this,_isApple,!0)):iosPlatforms.includes(platform)?(__privateSet(this,_OS,"iOS"),__privateSet(this,_isApple,!0)):windowsPlatforms.includes(platform)?__privateSet(this,_OS,"Windows"):/Android/.test(userAgent)?__privateSet(this,_OS,"Android"):/Linux/.test(platform)?__privateSet(this,_OS,"Linux"):__privateSet(this,_OS,"unknown")}}get OS(){return __privateGet(this,_OS)}get isMobile(){return __privateGet(this,_isMobile)}get isTouch(){return __privateGet(this,_isTouch)}get isWebgl(){return __privateGet(this,_isWebgl)}get isWebp(){return __privateGet(this,_isWebp)}get isApple(){return __privateGet(this,_isApple)}};_OS=new WeakMap,_isMobile=new WeakMap,_isTouch=new WeakMap,_isWebgl=new WeakMap,_isWebp=new WeakMap,_isApple=new WeakMap,__name(_Device,"Device");let Device=_Device;const device=new Device;var ViewportBreakpoints=(ViewportBreakpoints2=>(ViewportBreakpoints2.mobile="600px",ViewportBreakpoints2.tablet="1024px",ViewportBreakpoints2.notebook="1280px",ViewportBreakpoints2.desktop="1281px",ViewportBreakpoints2))(ViewportBreakpoints||{}),ViewportMediaRules=(ViewportMediaRules2=>(ViewportMediaRules2["<=mobile"]="(max-width: 600px)",ViewportMediaRules2[">=mobile"]="(min-width: 601px)",ViewportMediaRules2["<=tablet"]="(max-width: 1024px)",ViewportMediaRules2[">=tablet"]="(min-width: 1025px)",ViewportMediaRules2["<=notebook"]="(max-width: 1280px)",ViewportMediaRules2[">=notebook"]="(min-width: 1281px)",ViewportMediaRules2["<=desktop"]="(max-width: 1280px)",ViewportMediaRules2[">=desktop"]="(min-width: 1281px)",ViewportMediaRules2))(ViewportMediaRules||{}),_width,_height,_pixelRatio,_type;const _Viewport=class _Viewport{constructor(){__privateAdd(this,_width);__privateAdd(this,_height);__privateAdd(this,_pixelRatio);__privateAdd(this,_type);__privateSet(this,_width,0),__privateSet(this,_height,0),__privateSet(this,_pixelRatio,0),__privateSet(this,_type,new Store.Store(void 0)),this.resize=()=>{__privateSet(this,_width,document.documentElement.clientWidth),__privateSet(this,_height,innerHeight),__privateSet(this,_pixelRatio,devicePixelRatio),matchMedia("(max-width: 600px)").matches?__privateGet(this,_type).current="mobile":matchMedia("(max-width: 1024px)").matches?__privateGet(this,_type).current="tablet":matchMedia("(max-width: 1280px)").matches?__privateGet(this,_type).current="notebook":matchMedia("(min-width: 1281px)").matches&&(__privateGet(this,_type).current="desktop")},browser.isBrowser&&(this.resize(),windowResizer_index.windowResizer.subscribe(this.resize,order_index.RESIZE_ORDER.DEVICE))}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get type(){return __privateGet(this,_type)}get pixelRatio(){return __privateGet(this,_pixelRatio)}};_width=new WeakMap,_height=new WeakMap,_pixelRatio=new WeakMap,_type=new WeakMap,__name(_Viewport,"Viewport");let Viewport=_Viewport;const viewport=new Viewport;exports.ViewportBreakpoints=ViewportBreakpoints;exports.ViewportMediaRules=ViewportMediaRules;exports.device=device;exports.viewport=viewport;
|
|
@@ -7,9 +7,10 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
7
7
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
8
8
|
import { RESIZE_ORDER } from "./order/index.js";
|
|
9
9
|
import { windowResizer } from "./window-resizer/index.js";
|
|
10
|
-
import { i as isBrowser
|
|
11
|
-
import "./index-DAG0CtYo.js";
|
|
10
|
+
import { i as isBrowser } from "./browser-B9QXFVgG.js";
|
|
12
11
|
import "construct-style-sheets-polyfill";
|
|
12
|
+
import "./index-Z2Lgb7xU.js";
|
|
13
|
+
import { S as Store } from "./Store-LDYxlJNu.js";
|
|
13
14
|
var _OS, _isMobile, _isTouch, _isWebgl, _isWebp, _isApple;
|
|
14
15
|
const _Device = class _Device {
|
|
15
16
|
constructor() {
|
package/lib/accordion/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const attribute_index=require("../attribute/index.cjs"),
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const attribute_index=require("../attribute/index.cjs"),browser=require("../browser-CIp8NsnF.cjs"),events=require("../events-UlGk63iC.cjs"),style=require("../style-IDJ6db6n.cjs");require("construct-style-sheets-polyfill");require("../index-BrasTsja.cjs");var _accordionElement,_element,_headElement,_bodyElement,_activeTimeoutId,_opened,_AccordionItem_instances,scrollSize_get,_headClickListener,_windowResizeListener,setScrollSize_fn,skipTransition_fn,tryDispatchResizeEvent_fn;const _AccordionItem=class _AccordionItem{constructor(accordionElement,element){__privateAdd(this,_AccordionItem_instances);__privateAdd(this,_accordionElement,null);__privateAdd(this,_element,null);__privateAdd(this,_headElement,null);__privateAdd(this,_bodyElement,null);__privateAdd(this,_activeTimeoutId);__privateAdd(this,_opened,!1);__privateAdd(this,_headClickListener,__name(()=>{__privateGet(this,_opened)?this.close():this.open()},"#headClickListener"));__privateAdd(this,_windowResizeListener,__name(event=>{__privateGet(this,_opened)&&!(event instanceof CustomEvent)&&(__privateMethod(this,_AccordionItem_instances,setScrollSize_fn).call(this,0,!0),__privateMethod(this,_AccordionItem_instances,setScrollSize_fn).call(this,__privateGet(this,_AccordionItem_instances,scrollSize_get)))},"#windowResizeListener"));element.firstElementChild instanceof HTMLElement&&element.lastElementChild instanceof HTMLElement?(__privateSet(this,_accordionElement,accordionElement),__privateSet(this,_element,element),__privateSet(this,_headElement,element.firstElementChild),__privateSet(this,_bodyElement,element.lastElementChild),__privateGet(this,_bodyElement).style.overflow="hidden",__privateGet(this,_accordionElement).axisAttribute.current==="y"?__privateGet(this,_bodyElement).style.height="0px":__privateGet(this,_bodyElement).style.width="0px",addEventListener("resize",__privateGet(this,_windowResizeListener)),__privateGet(this,_headElement).addEventListener("click",__privateGet(this,_headClickListener)),__privateGet(this,_element).hasAttribute("data-opened")&&this.open({skipTransition:!0})):accordionElement.removeItem(__privateGet(this,_element))}get element(){return __privateGet(this,_element)}destroy(){__privateGet(this,_headElement)&&(__privateGet(this,_element).classList.remove("opened","triggered"),__privateGet(this,_element).removeAttribute("data-opened"),__privateGet(this,_headElement).style.cursor="",__privateMethod(this,_AccordionItem_instances,setScrollSize_fn).call(this,void 0),removeEventListener("resize",__privateGet(this,_windowResizeListener)),__privateGet(this,_headElement).removeEventListener("click",__privateGet(this,_headClickListener)),clearTimeout(__privateGet(this,_activeTimeoutId)))}open(options){options!=null&&options.skipTransition&&__privateMethod(this,_AccordionItem_instances,skipTransition_fn).call(this),__privateGet(this,_accordionElement).multipleAttribute.current||__privateGet(this,_accordionElement).closeAll({exclude:__privateGet(this,_element)}),__privateSet(this,_opened,!0),clearTimeout(__privateGet(this,_activeTimeoutId)),__privateGet(this,_element).classList.add("triggered"),__privateMethod(this,_AccordionItem_instances,setScrollSize_fn).call(this,__privateGet(this,_AccordionItem_instances,scrollSize_get)),setTimeout(()=>{__privateGet(this,_element).classList.add("opened"),__privateGet(this,_element).setAttribute("data-opened",""),__privateMethod(this,_AccordionItem_instances,tryDispatchResizeEvent_fn).call(this)},0),events.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:__privateGet(this,_opened),element:__privateGet(this,_element)}})}close(options){options!=null&&options.skipTransition&&__privateMethod(this,_AccordionItem_instances,skipTransition_fn).call(this),clearTimeout(__privateGet(this,_activeTimeoutId)),__privateSet(this,_opened,!1),__privateGet(this,_element).classList.remove("opened"),__privateMethod(this,_AccordionItem_instances,setScrollSize_fn).call(this,0),__privateMethod(this,_AccordionItem_instances,tryDispatchResizeEvent_fn).call(this,()=>{__privateGet(this,_element).classList.remove("triggered")}),events.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:__privateGet(this,_opened),element:__privateGet(this,_element)}})}};_accordionElement=new WeakMap,_element=new WeakMap,_headElement=new WeakMap,_bodyElement=new WeakMap,_activeTimeoutId=new WeakMap,_opened=new WeakMap,_AccordionItem_instances=new WeakSet,scrollSize_get=__name(function(){return __privateGet(this,_accordionElement).axisAttribute.current==="x"?__privateGet(this,_bodyElement).scrollWidth:__privateGet(this,_bodyElement).scrollHeight},"#scrollSize"),_headClickListener=new WeakMap,_windowResizeListener=new WeakMap,setScrollSize_fn=__name(function(value,skipDuration=!1){skipDuration&&(__privateGet(this,_bodyElement).style.transition="all 0s",setTimeout(()=>{__privateGet(this,_bodyElement).style.transition=""}));const dim=__privateGet(this,_accordionElement).axisAttribute.current==="x"?"width":"height";value!=null?__privateGet(this,_bodyElement).style[dim]=`${value}px`:__privateGet(this,_bodyElement).style[dim]=""},"#setScrollSize"),skipTransition_fn=__name(function(){__privateGet(this,_bodyElement).style.transition="all 0s",setTimeout(()=>{__privateGet(this,_bodyElement).style.transition=""},50)},"#skipTransition"),tryDispatchResizeEvent_fn=__name(function(callback){__privateGet(this,_accordionElement).hasAttribute("no-window-resize")||__privateSet(this,_activeTimeoutId,setTimeout(()=>{callback==null||callback(),window.dispatchEvent(new CustomEvent("resize"))},style.getElementTransitionDurationMS(__privateGet(this,_bodyElement))))},"#tryDispatchResizeEvent"),__name(_AccordionItem,"AccordionItem");let AccordionItem=_AccordionItem;var _axisAttribute,_multipleAttribute,_items,_mutationObserver,_AccordionElement_instances,root_get;const _AccordionElement=class _AccordionElement extends HTMLElement{constructor(){super();__privateAdd(this,_AccordionElement_instances);__privateAdd(this,_axisAttribute,new attribute_index.Attribute(this,"axis","y"));__privateAdd(this,_multipleAttribute,new attribute_index.Attribute(this,"multiple",!1));__privateAdd(this,_items,[]);__privateAdd(this,_mutationObserver,null);browser.isBrowser&&__privateSet(this,_mutationObserver,new MutationObserver(records=>{records.forEach(record=>{record.removedNodes.forEach(node=>{node instanceof HTMLElement&&this.removeItem(node)}),record.addedNodes.forEach(node=>{node instanceof HTMLElement&&this.createItem(node)})})}))}get axisAttribute(){return __privateGet(this,_axisAttribute)}get multipleAttribute(){return __privateGet(this,_multipleAttribute)}createItem(element){__privateGet(this,_items).find(item=>item.element===element)||__privateGet(this,_items).push(new AccordionItem(this,element))}removeItem(element){__privateSet(this,_items,__privateGet(this,_items).filter(item=>{if(item.element!==element)return!0;item.destroy()}))}closeAll(options){__privateGet(this,_items).forEach(item=>{(options==null?void 0:options.exclude)!==item.element&&item.close(options)})}openAll(options){__privateGet(this,_items).forEach(item=>{(options==null?void 0:options.exclude)!==item.element&&item.open(options)})}connectedCallback(){__privateGet(this,_axisAttribute).observe(),__privateGet(this,_multipleAttribute).observe(),__privateGet(this,_mutationObserver).observe(__privateGet(this,_AccordionElement_instances,root_get),{childList:!0}),__privateSet(this,_items,[...__privateGet(this,_AccordionElement_instances,root_get).children].map(element=>{if(element instanceof HTMLElement)return new AccordionItem(this,element)}).filter(e=>!!e))}disconnectedCallback(){__privateGet(this,_axisAttribute).unobserve(),__privateGet(this,_multipleAttribute).unobserve(),__privateGet(this,_mutationObserver).disconnect()}};_axisAttribute=new WeakMap,_multipleAttribute=new WeakMap,_items=new WeakMap,_mutationObserver=new WeakMap,_AccordionElement_instances=new WeakSet,root_get=__name(function(){return this.shadowRoot?this.shadowRoot:this},"#root"),__name(_AccordionElement,"AccordionElement");let AccordionElement=_AccordionElement;browser.isBrowser&&!customElements.get("e-accordion")&&customElements.define("e-accordion",AccordionElement);exports.AccordionElement=AccordionElement;
|
package/lib/accordion/index.js
CHANGED
|
@@ -6,11 +6,11 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
6
6
|
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
7
7
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
8
8
|
import { Attribute } from "../attribute/index.js";
|
|
9
|
-
import { i as isBrowser } from "../
|
|
9
|
+
import { i as isBrowser } from "../browser-B9QXFVgG.js";
|
|
10
10
|
import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
|
|
11
|
-
import "../index-DAG0CtYo.js";
|
|
12
11
|
import { g as getElementTransitionDurationMS } from "../style-DBoQWK0d.js";
|
|
13
12
|
import "construct-style-sheets-polyfill";
|
|
13
|
+
import "../index-Z2Lgb7xU.js";
|
|
14
14
|
var _accordionElement, _element, _headElement, _bodyElement, _activeTimeoutId, _opened, _AccordionItem_instances, scrollSize_get, _headClickListener, _windowResizeListener, setScrollSize_fn, skipTransition_fn, tryDispatchResizeEvent_fn;
|
|
15
15
|
const _AccordionItem = class _AccordionItem {
|
|
16
16
|
constructor(accordionElement, element) {
|
package/lib/animation/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Animation=require("../Animation-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Animation=require("../Animation-WtDiwPFQ.cjs"),Damped=require("../Damped-B8unWaEn.cjs"),Tweened=require("../Tweened-FpbbJ3xC.cjs");exports.Animation=Animation.Animation;exports.Damped=Damped.Damped;exports.Tweened=Tweened.Tweened;
|
package/lib/animation/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A } from "../Animation-
|
|
2
|
-
import { D } from "../Damped-
|
|
3
|
-
import { T } from "../Tweened-
|
|
1
|
+
import { A } from "../Animation-D5bhzxA5.js";
|
|
2
|
+
import { D } from "../Damped-BZrSNeI7.js";
|
|
3
|
+
import { T } from "../Tweened-BAR8oYF3.js";
|
|
4
4
|
export {
|
|
5
5
|
A as Animation,
|
|
6
6
|
D as Damped,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Store } from '../store';
|
|
2
|
+
import { TickerAddOptions, TickerCallbackEntry } from '../ticker';
|
|
3
|
+
export declare abstract class AnimationStore extends Store<number> {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(initialValue?: number);
|
|
6
|
+
get active(): boolean;
|
|
7
|
+
get target(): number;
|
|
8
|
+
get direction(): number;
|
|
9
|
+
get min(): number;
|
|
10
|
+
get max(): number;
|
|
11
|
+
close(): void;
|
|
12
|
+
get current(): number;
|
|
13
|
+
set current(value: number);
|
|
14
|
+
setWithoutAnimation(value: number): void;
|
|
15
|
+
setEdges(min?: number, max?: number): void;
|
|
16
|
+
setTickerOptions(options?: TickerAddOptions): void;
|
|
17
|
+
startAnimation(): void;
|
|
18
|
+
stopAnimation(): void;
|
|
19
|
+
protected onAnimationStart?(): void;
|
|
20
|
+
protected onAnimationStop?(): void;
|
|
21
|
+
protected abstract onAnimationTick(e: TickerCallbackEntry): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TickerCallbackEntry } from '../ticker';
|
|
2
|
+
import { AnimationStore } from './AnimationStore';
|
|
3
|
+
export interface DampedOptions {
|
|
4
|
+
initial?: number;
|
|
5
|
+
damping?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class Damped extends AnimationStore {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(options?: DampedOptions);
|
|
10
|
+
get speed(): number;
|
|
11
|
+
setOptions(options?: Omit<DampedOptions, 'initial'>): void;
|
|
12
|
+
protected onAnimationStop(): void;
|
|
13
|
+
protected onAnimationTick(e: TickerCallbackEntry): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { TickerCallbackEntry } from '../ticker';
|
|
2
|
+
import { AnimationStore } from './AnimationStore';
|
|
3
|
+
export interface SpringOptions {
|
|
4
|
+
initial?: number;
|
|
5
|
+
stiffness?: number;
|
|
6
|
+
damping?: number;
|
|
7
|
+
mass?: number;
|
|
8
|
+
preset?: SpringPreset;
|
|
9
|
+
}
|
|
10
|
+
export declare const SpringPresets: {
|
|
11
|
+
readonly gentle: {
|
|
12
|
+
readonly stiffness: 80;
|
|
13
|
+
readonly damping: 15;
|
|
14
|
+
readonly mass: 1;
|
|
15
|
+
};
|
|
16
|
+
readonly default: {
|
|
17
|
+
readonly stiffness: 100;
|
|
18
|
+
readonly damping: 20;
|
|
19
|
+
readonly mass: 1;
|
|
20
|
+
};
|
|
21
|
+
readonly quick: {
|
|
22
|
+
readonly stiffness: 200;
|
|
23
|
+
readonly damping: 25;
|
|
24
|
+
readonly mass: 1;
|
|
25
|
+
};
|
|
26
|
+
readonly slow: {
|
|
27
|
+
readonly stiffness: 50;
|
|
28
|
+
readonly damping: 25;
|
|
29
|
+
readonly mass: 1.5;
|
|
30
|
+
};
|
|
31
|
+
readonly bouncy: {
|
|
32
|
+
readonly stiffness: 150;
|
|
33
|
+
readonly damping: 10;
|
|
34
|
+
readonly mass: 1;
|
|
35
|
+
};
|
|
36
|
+
readonly veryBouncy: {
|
|
37
|
+
readonly stiffness: 180;
|
|
38
|
+
readonly damping: 5;
|
|
39
|
+
readonly mass: 1;
|
|
40
|
+
};
|
|
41
|
+
readonly critical: {
|
|
42
|
+
readonly stiffness: 100;
|
|
43
|
+
readonly damping: 40;
|
|
44
|
+
readonly mass: 1;
|
|
45
|
+
};
|
|
46
|
+
readonly airy: {
|
|
47
|
+
readonly stiffness: 120;
|
|
48
|
+
readonly damping: 12;
|
|
49
|
+
readonly mass: 0.8;
|
|
50
|
+
};
|
|
51
|
+
readonly heavy: {
|
|
52
|
+
readonly stiffness: 70;
|
|
53
|
+
readonly damping: 30;
|
|
54
|
+
readonly mass: 2;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export type SpringPreset = keyof typeof SpringPresets;
|
|
58
|
+
export declare class Spring extends AnimationStore {
|
|
59
|
+
#private;
|
|
60
|
+
constructor(options?: SpringOptions);
|
|
61
|
+
get speed(): number;
|
|
62
|
+
get velocity(): number;
|
|
63
|
+
get acceleration(): number;
|
|
64
|
+
setOptions(options?: Omit<SpringOptions, 'initial'>): void;
|
|
65
|
+
protected onAnimationStop(): void;
|
|
66
|
+
protected onAnimationTick(e: TickerCallbackEntry): void;
|
|
67
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TweenEasingName } from '../animation/Tweened';
|
|
2
|
+
import { TickerCallbackEntry } from '../ticker';
|
|
3
|
+
import { EasingFunction } from '../utils';
|
|
4
|
+
import { AnimationStore } from './AnimationStore';
|
|
5
|
+
export interface TweenedOptions {
|
|
6
|
+
initial?: number;
|
|
7
|
+
easing?: EasingFunction | TweenEasingName | false;
|
|
8
|
+
duration?: number | false;
|
|
9
|
+
}
|
|
10
|
+
export declare class Tweened extends AnimationStore {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(options?: TweenedOptions);
|
|
13
|
+
setOptions(options?: Omit<TweenedOptions, 'initial'>): void;
|
|
14
|
+
protected onAnimationTick(e: TickerCallbackEntry): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Tweened=require("../Tweened-BNb6DQ39.cjs"),Damped=require("../Damped-DTVkIAqc.cjs"),SpringPresets={gentle:{stiffness:80,damping:15,mass:1},default:{stiffness:100,damping:20,mass:1},quick:{stiffness:200,damping:25,mass:1},slow:{stiffness:50,damping:25,mass:1.5},bouncy:{stiffness:150,damping:10,mass:1},veryBouncy:{stiffness:180,damping:5,mass:1},critical:{stiffness:100,damping:40,mass:1},airy:{stiffness:120,damping:12,mass:.8},heavy:{stiffness:70,damping:30,mass:2}};var _options,_speed,_velocity,_acceleration;const _Spring=class _Spring extends Tweened.AnimationStore{constructor(options){super((options==null?void 0:options.initial)||0);__privateAdd(this,_options,null);__privateAdd(this,_speed,0);__privateAdd(this,_velocity,0);__privateAdd(this,_acceleration,0);this.setOptions(options)}get speed(){return __privateGet(this,_speed)}get velocity(){return __privateGet(this,_velocity)}get acceleration(){return __privateGet(this,_acceleration)}setOptions(options){options!=null&&options.preset?__privateSet(this,_options,__spreadValues({},SpringPresets[options.preset])):__privateSet(this,_options,__spreadValues({damping:20,mass:1,stiffness:100},options))}onAnimationStop(){__privateSet(this,_speed,0),__privateSet(this,_velocity,0),__privateSet(this,_acceleration,0)}onAnimationTick(e){const delta=Math.abs(this.current-this.target),dt=e.timeBetweenFrames/1e3,{mass,stiffness,damping}=__privateGet(this,_options);__privateSet(this,_speed,delta/e.timeBetweenFrames),__privateSet(this,_acceleration,(this.target-this.current)*stiffness-__privateGet(this,_velocity)*damping),__privateSet(this,_velocity,__privateGet(this,_velocity)+__privateGet(this,_acceleration)/mass*dt),this.current+=__privateGet(this,_velocity)*dt}};_options=new WeakMap,_speed=new WeakMap,_velocity=new WeakMap,_acceleration=new WeakMap,__name(_Spring,"Spring");let Spring=_Spring;exports.AnimationStore=Tweened.AnimationStore;exports.Tweened=Tweened.Tweened;exports.Damped=Damped.Damped;exports.Spring=Spring;exports.SpringPresets=SpringPresets;
|