aptechka 0.4.19 → 0.4.21
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/Damped-B0G_t-pw.cjs +1 -0
- package/lib/{Damped-ChjjwnrU.js → Damped-DpaKIZqv.js} +1 -1
- package/lib/accordion/index.js +9 -9
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +2 -2
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.d.ts +2 -0
- package/lib/canvas/index.js +63 -48
- package/lib/canvas-CU5Xjahf.cjs +1 -0
- package/lib/canvas-DeZ0SLUJ.js +34 -0
- package/lib/class-linked-status/index.cjs +1 -0
- package/lib/class-linked-status/index.d.ts +10 -0
- package/lib/class-linked-status/index.js +51 -0
- package/lib/coordinates-CgdGoSYs.js +24 -0
- package/lib/coordinates-D8Np3cPD.cjs +1 -0
- package/lib/{index-Fasue6kv.js → index-DTe0hK7c.js} +28 -28
- package/lib/pointer/Pointer.d.ts +21 -0
- package/lib/pointer/PointerElement.d.ts +13 -0
- package/lib/pointer/index.cjs +1 -0
- package/lib/pointer/index.d.ts +2 -0
- package/lib/pointer/index.js +130 -0
- package/lib/popover/PopoverButtonElement.d.ts +1 -0
- package/lib/popover/PopoverElement.d.ts +6 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +116 -77
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +1 -1
- package/lib/select/index.js +1 -1
- package/lib/sequence/index.cjs +1 -0
- package/lib/sequence/index.d.ts +19 -0
- package/lib/sequence/index.js +151 -0
- package/lib/{style-j2TwriJ_.js → style-CklEF62D.js} +2 -2
- package/lib/tweaker/index.js +1 -1
- package/lib/utils/canvas.d.ts +1 -0
- package/lib/utils/coordinates.d.ts +2 -2
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +24 -24
- package/lib/utils/index.js +133 -168
- package/lib/utils/ts-shape.d.ts +2 -1
- package/package.json +25 -1
- package/lib/Damped-CbT5qqTP.cjs +0 -1
package/lib/utils/index.js
CHANGED
|
@@ -1,209 +1,174 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { i as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { c as
|
|
7
|
-
import { d as ce
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { c as
|
|
15
|
-
import {
|
|
1
|
+
import { a as S, p as M } from "../attributes-69we3byR.js";
|
|
2
|
+
import { i as T } from "../browser-0zX67oeU.js";
|
|
3
|
+
import { a as D, c as Q, f as R, m as z } from "../canvas-DeZ0SLUJ.js";
|
|
4
|
+
import { g as B, n as N, s as j } from "../coordinates-CgdGoSYs.js";
|
|
5
|
+
import { f as q, b as L, a as V, g as H } from "../dom-0S_WDL4g.js";
|
|
6
|
+
import { c as K, n as W, f as $, p as F, b as G, i as X, m as Y, e as Z, g as _, j as ee, d as te, o as ae, a as se, h as oe, k as ne, l as re } from "../easings-BKi40vHz.js";
|
|
7
|
+
import { d as ce } from "../events-_C2CztxR.js";
|
|
8
|
+
import { c as le } from "../file-lxi_oXJf.js";
|
|
9
|
+
import { d as fe, t as me } from "../function-C10DGppn.js";
|
|
10
|
+
import { s as de } from "../gestures-D2Fdra_G.js";
|
|
11
|
+
import { g as ge, a as be, b as we } from "../layout-HoBT_Da2.js";
|
|
12
|
+
import { e as Ce, f as ve, c as Ee, d as Ie, l as Oe, m as Se, r as Me, b as Pe, a as Te, s as Ae } from "../math-BOBiC4TN.js";
|
|
13
|
+
import { p as Qe, r as Re } from "../number-Bo5RdrA1.js";
|
|
14
|
+
import { c as ke, d as Be, i as Ne, b as je, a as Ue, m as qe, e as Le, o as Ve, p as He } from "../object-D6MVWB4l.js";
|
|
15
|
+
import { n as Ke } from "../polyfills-DJUYczFm.js";
|
|
16
|
+
import { c as $e, a as Fe, g as Ge, i as Xe, k as Ye, s as Ze, t as _e, u as et } from "../string-f0Dnk0L1.js";
|
|
17
|
+
import { a as at, g as st } from "../style-CklEF62D.js";
|
|
16
18
|
import "../path-data-polyfill-DgeDWYeI.js";
|
|
17
|
-
function x(t, e, ...
|
|
18
|
-
return [...t.slice(0, e), ...
|
|
19
|
+
function x(t, e, ...s) {
|
|
20
|
+
return [...t.slice(0, e), ...s, ...t.slice(e)];
|
|
19
21
|
}
|
|
20
22
|
function g(t, e) {
|
|
21
|
-
const
|
|
22
|
-
e = e %
|
|
23
|
-
const
|
|
24
|
-
for (let
|
|
25
|
-
const r = (
|
|
26
|
-
|
|
23
|
+
const s = t.length;
|
|
24
|
+
e = e % s;
|
|
25
|
+
const n = new Array(s);
|
|
26
|
+
for (let o = 0; o < s; o++) {
|
|
27
|
+
const r = (o + e) % s;
|
|
28
|
+
n[r] = t[o];
|
|
27
29
|
}
|
|
28
|
-
return
|
|
29
|
-
}
|
|
30
|
-
function y(t, e) {
|
|
31
|
-
const a = t.measureText(e), s = a.actualBoundingBoxAscent + a.actualBoundingBoxDescent, n = a.width;
|
|
32
|
-
return {
|
|
33
|
-
height: s,
|
|
34
|
-
width: n
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function w(t) {
|
|
38
|
-
return Math.floor(t) + 0.5;
|
|
39
|
-
}
|
|
40
|
-
function b(t, e, a, s, n, r) {
|
|
41
|
-
let o = t / e, i = a / s, c = 0, u = 0;
|
|
42
|
-
return n = typeof n == "undefined" ? 0.5 : n, r = typeof r == "undefined" ? 0.5 : r, o > i ? (c = s, u = s * o) : (u = a, c = a / o), [
|
|
43
|
-
(a - u) * n,
|
|
44
|
-
(s - c) * r,
|
|
45
|
-
u,
|
|
46
|
-
c
|
|
47
|
-
];
|
|
30
|
+
return n;
|
|
48
31
|
}
|
|
49
|
-
function
|
|
32
|
+
function b(t, e) {
|
|
50
33
|
return t.x < e.x + e.width && t.x > e.x && t.y < e.y + e.height && t.y > e.y;
|
|
51
34
|
}
|
|
52
|
-
function
|
|
35
|
+
function w(t, e) {
|
|
53
36
|
return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2) < e.radius;
|
|
54
37
|
}
|
|
55
|
-
function
|
|
56
|
-
let s = t.x - e.width / 2, n = e.height / 2 - t.y;
|
|
57
|
-
return a && (s = s / (e.width / 2), n = n / (e.height / 2)), { x: s, y: n };
|
|
58
|
-
}
|
|
59
|
-
function I(t, e) {
|
|
60
|
-
const a = t.x / e.x, s = t.y / e.y;
|
|
61
|
-
return { x: a, y: s };
|
|
62
|
-
}
|
|
63
|
-
function M(t, e) {
|
|
64
|
-
return e = e || {
|
|
65
|
-
x: 0,
|
|
66
|
-
y: 0,
|
|
67
|
-
width: document.documentElement.offsetWidth,
|
|
68
|
-
height: innerHeight
|
|
69
|
-
}, {
|
|
70
|
-
x: (t.x - e.x) / e.width * e.width,
|
|
71
|
-
y: (t.y - e.y) / e.height * e.height
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function O(...t) {
|
|
38
|
+
function y(...t) {
|
|
75
39
|
const e = {};
|
|
76
|
-
return Array.from(document.styleSheets).forEach((
|
|
77
|
-
Array.from(
|
|
78
|
-
|
|
79
|
-
const r =
|
|
80
|
-
r && (e[
|
|
40
|
+
return Array.from(document.styleSheets).forEach((s) => {
|
|
41
|
+
Array.from(s.cssRules).forEach((n) => {
|
|
42
|
+
n instanceof CSSStyleRule && n.selectorText === ":root" && t.forEach((o) => {
|
|
43
|
+
const r = n.styleMap.get(o);
|
|
44
|
+
r && (e[o] = r.toString());
|
|
81
45
|
});
|
|
82
46
|
});
|
|
83
|
-
}), t.forEach((
|
|
84
|
-
e[
|
|
47
|
+
}), t.forEach((s) => {
|
|
48
|
+
e[s] || console.warn(`variable named ${s} not found`);
|
|
85
49
|
}), e;
|
|
86
50
|
}
|
|
87
|
-
function
|
|
51
|
+
function C(t) {
|
|
88
52
|
const e = window.atob(t);
|
|
89
53
|
return decodeURIComponent(window.escape(e));
|
|
90
54
|
}
|
|
91
|
-
function
|
|
55
|
+
function v(t) {
|
|
92
56
|
const e = window.unescape(encodeURIComponent(t));
|
|
93
57
|
return window.btoa(e);
|
|
94
58
|
}
|
|
95
59
|
function m(t, { pathSelector: e = "path" } = {}) {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
x: parseInt(
|
|
100
|
-
y: parseInt(
|
|
101
|
-
width: parseInt(
|
|
102
|
-
height: parseInt(
|
|
103
|
-
},
|
|
104
|
-
return r.forEach((
|
|
105
|
-
|
|
60
|
+
const s = document.createElement(null);
|
|
61
|
+
s.innerHTML = t;
|
|
62
|
+
const n = s.firstElementChild, r = n.querySelector(e).getPathData(), a = n.getAttribute("viewBox").split(" ").map((c) => c.trim()), i = {
|
|
63
|
+
x: parseInt(a[0]),
|
|
64
|
+
y: parseInt(a[1]),
|
|
65
|
+
width: parseInt(a[2]),
|
|
66
|
+
height: parseInt(a[3])
|
|
67
|
+
}, u = Math.min(i.width, i.height);
|
|
68
|
+
return r.forEach((c) => {
|
|
69
|
+
c.values = c.values.map((l) => l / u);
|
|
106
70
|
}), r;
|
|
107
71
|
}
|
|
108
|
-
function
|
|
72
|
+
function h(t, e, s, n, o) {
|
|
109
73
|
const r = [];
|
|
110
|
-
for (let
|
|
111
|
-
const i = Math.pow(1 -
|
|
112
|
-
r.push({ x: i, y:
|
|
74
|
+
for (let a = 0; a <= 1; a += 1 / o) {
|
|
75
|
+
const i = Math.pow(1 - a, 3) * t.x + 3 * Math.pow(1 - a, 2) * a * e.x + 3 * (1 - a) * Math.pow(a, 2) * s.x + Math.pow(a, 3) * n.x, u = Math.pow(1 - a, 3) * t.y + 3 * Math.pow(1 - a, 2) * a * e.y + 3 * (1 - a) * Math.pow(a, 2) * s.y + Math.pow(a, 3) * n.y;
|
|
76
|
+
r.push({ x: i, y: u });
|
|
113
77
|
}
|
|
114
78
|
return r;
|
|
115
79
|
}
|
|
116
|
-
function
|
|
117
|
-
const
|
|
118
|
-
let
|
|
119
|
-
for (let r = 0; r <
|
|
120
|
-
const { type:
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
else if (
|
|
124
|
-
const
|
|
125
|
-
|
|
80
|
+
function E(t, e) {
|
|
81
|
+
const s = (e == null ? void 0 : e.segments) || 20, n = m(t, e);
|
|
82
|
+
let o = [];
|
|
83
|
+
for (let r = 0; r < n.length - 1; r++) {
|
|
84
|
+
const { type: a, values: i } = n[r];
|
|
85
|
+
if (a === "M" && r === 0)
|
|
86
|
+
o.push({ x: i[0], y: i[1] });
|
|
87
|
+
else if (a === "C") {
|
|
88
|
+
const u = o[o.length - 1], c = { x: i[0], y: i[1] }, l = { x: i[2], y: i[3] }, p = { x: i[4], y: i[5] }, f = h(u, c, l, p, s);
|
|
89
|
+
o = [...o, ...f];
|
|
126
90
|
}
|
|
127
91
|
}
|
|
128
|
-
return
|
|
92
|
+
return o;
|
|
129
93
|
}
|
|
130
94
|
export {
|
|
131
|
-
|
|
132
|
-
|
|
95
|
+
Ce as calculateDistance,
|
|
96
|
+
ve as calculateDistanceWithRadius,
|
|
133
97
|
$e as camelToKebab,
|
|
134
98
|
Fe as capitalize,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
K as
|
|
99
|
+
Ee as clamp,
|
|
100
|
+
ke as cloneDeep,
|
|
101
|
+
Be as compareObjects,
|
|
102
|
+
D as contain,
|
|
103
|
+
Q as cover,
|
|
104
|
+
le as createJSONAndSave,
|
|
105
|
+
Ie as damp,
|
|
106
|
+
fe as debounce,
|
|
107
|
+
v as decode,
|
|
108
|
+
ce as dispatchSizeChangeEvent,
|
|
109
|
+
w as dotCircleCollision,
|
|
110
|
+
b as dotRectCollision,
|
|
111
|
+
K as easeInCubic,
|
|
112
|
+
W as easeInExpo,
|
|
148
113
|
$ as easeInOutCubic,
|
|
149
114
|
F as easeInOutExpo,
|
|
150
115
|
G as easeInOutQuad,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
116
|
+
X as easeInOutQuart,
|
|
117
|
+
Y as easeInOutQuint,
|
|
118
|
+
Z as easeInQuad,
|
|
119
|
+
_ as easeInQuart,
|
|
120
|
+
ee as easeInQuint,
|
|
121
|
+
te as easeOutCubic,
|
|
122
|
+
ae as easeOutExpo,
|
|
123
|
+
se as easeOutQuad,
|
|
124
|
+
oe as easeOutQuart,
|
|
125
|
+
ne as easeOutQuint,
|
|
126
|
+
C as encode,
|
|
127
|
+
q as findParentElement,
|
|
128
|
+
L as findScrollParentElement,
|
|
129
|
+
R as fixPosition,
|
|
165
130
|
Ge as generateId,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
131
|
+
V as getAllParentElements,
|
|
132
|
+
ge as getCumulativeOffsetLeft,
|
|
133
|
+
be as getCumulativeOffsetTop,
|
|
134
|
+
we as getCumulativePosition,
|
|
135
|
+
H as getElement,
|
|
136
|
+
at as getElementTransitionDurationMS,
|
|
137
|
+
st as getElementTransitionDurationS,
|
|
173
138
|
m as getPathData,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
139
|
+
B as getPointerPosition,
|
|
140
|
+
E as getPoints,
|
|
141
|
+
y as getRootVariables,
|
|
177
142
|
x as insert,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
143
|
+
T as isBrowser,
|
|
144
|
+
Ne as isESClass,
|
|
145
|
+
je as isNullish,
|
|
146
|
+
Ue as isObject,
|
|
147
|
+
Xe as isUppercase,
|
|
148
|
+
Ye as kebabToCamel,
|
|
149
|
+
Oe as lerp,
|
|
150
|
+
re as linear,
|
|
151
|
+
Se as mapRange,
|
|
152
|
+
z as measureText,
|
|
153
|
+
qe as mergeDeep,
|
|
154
|
+
Le as mixin,
|
|
155
|
+
N as normalize,
|
|
156
|
+
Ke as nullishCoalescing,
|
|
157
|
+
Ve as omit,
|
|
158
|
+
S as parseAttribute,
|
|
159
|
+
M as parseAttributeValue,
|
|
160
|
+
He as pick,
|
|
161
|
+
Qe as preciseNumber,
|
|
162
|
+
Me as round,
|
|
163
|
+
Re as roundNumberTo,
|
|
164
|
+
j as screenToCartesian,
|
|
165
|
+
de as setupDrag,
|
|
201
166
|
g as shiftArray,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
167
|
+
Pe as smootherstep,
|
|
168
|
+
Te as smoothstep,
|
|
169
|
+
Ze as snakeToDotted,
|
|
170
|
+
Ae as step,
|
|
171
|
+
me as throttle,
|
|
172
|
+
_e as toPascalCase,
|
|
173
|
+
et as uncapitalize
|
|
209
174
|
};
|
package/lib/utils/ts-shape.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ export type Dot2D = {
|
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
6
6
|
};
|
|
7
|
-
export type
|
|
7
|
+
export type Dimension2D = {
|
|
8
8
|
width: number;
|
|
9
9
|
height: number;
|
|
10
10
|
};
|
|
11
|
+
export type Rect2D = Dot2D & Dimension2D;
|
|
11
12
|
export type Circle = Dot2D & {
|
|
12
13
|
radius: number;
|
|
13
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aptechka",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.21",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/denisavitski/aptechka.git"
|
|
@@ -43,6 +43,11 @@
|
|
|
43
43
|
"default": "./lib/checkbox/index.js",
|
|
44
44
|
"types": "./lib/checkbox/index.d.ts"
|
|
45
45
|
},
|
|
46
|
+
"./class-linked-status": {
|
|
47
|
+
"require": "./lib/class-linked-status/index.cjs",
|
|
48
|
+
"default": "./lib/class-linked-status/index.js",
|
|
49
|
+
"types": "./lib/class-linked-status/index.d.ts"
|
|
50
|
+
},
|
|
46
51
|
"./connector": {
|
|
47
52
|
"require": "./lib/connector/index.cjs",
|
|
48
53
|
"default": "./lib/connector/index.js",
|
|
@@ -148,6 +153,11 @@
|
|
|
148
153
|
"default": "./lib/order/index.js",
|
|
149
154
|
"types": "./lib/order/index.d.ts"
|
|
150
155
|
},
|
|
156
|
+
"./pointer": {
|
|
157
|
+
"require": "./lib/pointer/index.cjs",
|
|
158
|
+
"default": "./lib/pointer/index.js",
|
|
159
|
+
"types": "./lib/pointer/index.d.ts"
|
|
160
|
+
},
|
|
151
161
|
"./popover": {
|
|
152
162
|
"require": "./lib/popover/index.cjs",
|
|
153
163
|
"default": "./lib/popover/index.js",
|
|
@@ -178,6 +188,11 @@
|
|
|
178
188
|
"default": "./lib/select/index.js",
|
|
179
189
|
"types": "./lib/select/index.d.ts"
|
|
180
190
|
},
|
|
191
|
+
"./sequence": {
|
|
192
|
+
"require": "./lib/sequence/index.cjs",
|
|
193
|
+
"default": "./lib/sequence/index.js",
|
|
194
|
+
"types": "./lib/sequence/index.d.ts"
|
|
195
|
+
},
|
|
181
196
|
"./slicer": {
|
|
182
197
|
"require": "./lib/slicer/index.cjs",
|
|
183
198
|
"default": "./lib/slicer/index.js",
|
|
@@ -241,6 +256,9 @@
|
|
|
241
256
|
"checkbox": [
|
|
242
257
|
"lib/checkbox/index.d.ts"
|
|
243
258
|
],
|
|
259
|
+
"class-linked-status": [
|
|
260
|
+
"lib/class-linked-status/index.d.ts"
|
|
261
|
+
],
|
|
244
262
|
"component": [
|
|
245
263
|
"lib/component/index.d.ts"
|
|
246
264
|
],
|
|
@@ -307,6 +325,9 @@
|
|
|
307
325
|
"order": [
|
|
308
326
|
"lib/order/index.d.ts"
|
|
309
327
|
],
|
|
328
|
+
"pointer": [
|
|
329
|
+
"lib/pointer/index.d.ts"
|
|
330
|
+
],
|
|
310
331
|
"popover": [
|
|
311
332
|
"lib/popover/index.d.ts"
|
|
312
333
|
],
|
|
@@ -325,6 +346,9 @@
|
|
|
325
346
|
"select": [
|
|
326
347
|
"lib/select/index.d.ts"
|
|
327
348
|
],
|
|
349
|
+
"sequence": [
|
|
350
|
+
"lib/sequence/index.d.ts"
|
|
351
|
+
],
|
|
328
352
|
"slicer": [
|
|
329
353
|
"lib/slicer/index.d.ts"
|
|
330
354
|
],
|
package/lib/Damped-CbT5qqTP.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var L=Object.defineProperty,_=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var k=(e,i,t)=>i in e?L(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t,N=(e,i)=>{for(var t in i||(i={}))z.call(i,t)&&k(e,t,i[t]);if(O)for(var t of O(i))B.call(i,t)&&k(e,t,i[t]);return e},P=(e,i)=>_(e,j(i));var v=(e,i,t)=>{if(!i.has(e))throw TypeError("Cannot "+t)};var s=(e,i,t)=>(v(e,i,"read from private field"),t?t.call(e):i.get(e)),a=(e,i,t)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,t)},r=(e,i,t,h)=>(v(e,i,"write to private field"),h?h.call(e,t):i.set(e,t),t);const D=require("./math-GDWEqu7y.cjs"),S=require("./number-yVpzMdbQ.cjs"),c=require("./polyfills-CrcS4RcO.cjs");require("./path-data-polyfill-CXsOR7Oc.cjs");const I=require("./Store-BQGNOHlY.cjs"),M=require("./ticker/index.cjs");var d,f,F,m,C;class R extends I.Store{constructor(t){super(t||0);a(this,d,void 0);a(this,f,void 0);a(this,F,void 0);a(this,m,new I.Store(!1));a(this,C,t=>{this.handleAnimationFrame(t)})}get isRunning(){return s(this,m)}reset(){this.unlistenAnimationFrame(),super.reset()}close(){super.close(),this.unlistenAnimationFrame()}listenAnimationFrame(){s(this,m).current||(s(this,m).current=!0,M.ticker.subscribe(s(this,C),{maxFPS:s(this,d),order:s(this,f),culling:s(this,F)}))}unlistenAnimationFrame(){s(this,m).current&&(s(this,m).current=!1,M.ticker.unsubscribe(s(this,C)))}updateOptions(t){r(this,d,c.nullishCoalescing(t==null?void 0:t.maxFPS,s(this,d))),r(this,f,c.nullishCoalescing(t==null?void 0:t.order,s(this,f))),r(this,F,c.nullishCoalescing(t==null?void 0:t.culling,s(this,F)))}}d=new WeakMap,f=new WeakMap,F=new WeakMap,m=new WeakMap,C=new WeakMap;var n,A,u,l,g,x,b;class E extends R{constructor(t,h){super(t||0);a(this,n,void 0);a(this,A,void 0);a(this,u,void 0);a(this,l,void 0);a(this,g,void 0);a(this,x,void 0);a(this,b,void 0);this.damping=1,this.stiffness=0,this.mass=0,r(this,n,0),r(this,A,0),r(this,u,0),r(this,l,0),r(this,g,0),r(this,x,0),r(this,b,()=>{this.set(s(this,n),!0)}),r(this,u,c.nullishCoalescing(h==null?void 0:h.min,-1/0)),r(this,l,c.nullishCoalescing(h==null?void 0:h.max,1/0)),r(this,n,this.current),this.updateOptions(h),this.listenAnimationFrame()}get target(){return s(this,n)}get direction(){return s(this,A)}get min(){return s(this,u)}set min(t){r(this,u,t),s(this,b).call(this)}get max(){return s(this,l)}set max(t){r(this,l,t),s(this,b).call(this)}get velocity(){return s(this,g)}get speed(){return s(this,x)}get length(){return s(this,l)-s(this,u)}get progress(){return this.length?S.preciseNumber((this.current-s(this,u))/this.length,6):0}get entry(){return P(N({},super.entry),{min:s(this,u),max:s(this,l),length:this.length,direction:this.direction,progress:this.progress})}set(t,h=!1){const y=s(this,n);r(this,n,D.clamp(t,s(this,u),s(this,l))),h&&(this.current=s(this,n)),s(this,n)!==y&&(r(this,A,Math.sign(t-s(this,n))||1),this.listenAnimationFrame())}shift(t,h=!1){this.set(s(this,n)+t,h)}reset(){this.set(this.initial,!0),super.reset()}listenAnimationFrame(){this.current!==this.target&&super.listenAnimationFrame()}updateOptions(t){super.updateOptions(t),this.damping=c.nullishCoalescing(t==null?void 0:t.damping,this.damping),this.mass=c.nullishCoalescing(t==null?void 0:t.mass,this.mass),this.stiffness=c.nullishCoalescing(t==null?void 0:t.stiffness,this.stiffness)}handleAnimationFrame(t){S.preciseNumber(this.current,4)===S.preciseNumber(this.target,4)&&(this.unlistenAnimationFrame(),this.current=this.target);const h=this.current,y=Math.abs(h-this.target);r(this,x,y/t.elapsed);const q=t.elapsed/1e3;if(this.mass||this.stiffness){const w=(s(this,n)-this.current)*this.stiffness-s(this,g)*this.damping;r(this,g,s(this,g)+w/this.mass*q),this.current+=s(this,g)*q}else this.current=D.damp(this.current,this.target,this.damping,q)}}n=new WeakMap,A=new WeakMap,u=new WeakMap,l=new WeakMap,g=new WeakMap,x=new WeakMap,b=new WeakMap;exports.Animation=R;exports.Damped=E;
|