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.
Files changed (41) hide show
  1. package/lib/Damped-B0G_t-pw.cjs +1 -0
  2. package/lib/{Damped-ChjjwnrU.js → Damped-DpaKIZqv.js} +1 -1
  3. package/lib/accordion/index.js +9 -9
  4. package/lib/animation/index.cjs +1 -1
  5. package/lib/animation/index.js +2 -2
  6. package/lib/canvas/index.cjs +1 -1
  7. package/lib/canvas/index.d.ts +2 -0
  8. package/lib/canvas/index.js +63 -48
  9. package/lib/canvas-CU5Xjahf.cjs +1 -0
  10. package/lib/canvas-DeZ0SLUJ.js +34 -0
  11. package/lib/class-linked-status/index.cjs +1 -0
  12. package/lib/class-linked-status/index.d.ts +10 -0
  13. package/lib/class-linked-status/index.js +51 -0
  14. package/lib/coordinates-CgdGoSYs.js +24 -0
  15. package/lib/coordinates-D8Np3cPD.cjs +1 -0
  16. package/lib/{index-Fasue6kv.js → index-DTe0hK7c.js} +28 -28
  17. package/lib/pointer/Pointer.d.ts +21 -0
  18. package/lib/pointer/PointerElement.d.ts +13 -0
  19. package/lib/pointer/index.cjs +1 -0
  20. package/lib/pointer/index.d.ts +2 -0
  21. package/lib/pointer/index.js +130 -0
  22. package/lib/popover/PopoverButtonElement.d.ts +1 -0
  23. package/lib/popover/PopoverElement.d.ts +6 -0
  24. package/lib/popover/index.cjs +1 -1
  25. package/lib/popover/index.js +116 -77
  26. package/lib/scroll/index.cjs +1 -1
  27. package/lib/scroll/index.js +1 -1
  28. package/lib/select/index.js +1 -1
  29. package/lib/sequence/index.cjs +1 -0
  30. package/lib/sequence/index.d.ts +19 -0
  31. package/lib/sequence/index.js +151 -0
  32. package/lib/{style-j2TwriJ_.js → style-CklEF62D.js} +2 -2
  33. package/lib/tweaker/index.js +1 -1
  34. package/lib/utils/canvas.d.ts +1 -0
  35. package/lib/utils/coordinates.d.ts +2 -2
  36. package/lib/utils/index.cjs +1 -1
  37. package/lib/utils/index.d.ts +24 -24
  38. package/lib/utils/index.js +133 -168
  39. package/lib/utils/ts-shape.d.ts +2 -1
  40. package/package.json +25 -1
  41. package/lib/Damped-CbT5qqTP.cjs +0 -1
@@ -1,209 +1,174 @@
1
- import { a as Q, p as T } from "../attributes-69we3byR.js";
2
- import { i as k } from "../browser-0zX67oeU.js";
3
- import { f as N, b as j, a as U, g as q } from "../dom-0S_WDL4g.js";
4
- import { c as J, n as K, f as $, p as F, b as G, i as H, m as W, e as X, g as Y, j as Z, d as _, o as L, a as ee, h as te, k as ae, l as se } from "../easings-BKi40vHz.js";
5
- import { d as oe } from "../events-_C2CztxR.js";
6
- import { c as ie } from "../file-lxi_oXJf.js";
7
- import { d as ce, t as le } from "../function-C10DGppn.js";
8
- import { s as he } from "../gestures-D2Fdra_G.js";
9
- import { g as fe, a as de, b as xe } from "../layout-HoBT_Da2.js";
10
- import { e as ye, f as we, c as be, d as Ce, l as Ee, m as ve, r as Ie, b as Me, a as Oe, s as Se } from "../math-BOBiC4TN.js";
11
- import { p as Ae, r as De } from "../number-Bo5RdrA1.js";
12
- import { c as Qe, d as Te, i as Be, b as ke, a as ze, m as Ne, e as je, o as Ue, p as qe } from "../object-D6MVWB4l.js";
13
- import { n as Je } from "../polyfills-DJUYczFm.js";
14
- import { c as $e, a as Fe, g as Ge, i as He, k as We, s as Xe, t as Ye, u as Ze } from "../string-f0Dnk0L1.js";
15
- import { g as Le, a as et } from "../style-j2TwriJ_.js";
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, ...a) {
18
- return [...t.slice(0, e), ...a, ...t.slice(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 a = t.length;
22
- e = e % a;
23
- const s = new Array(a);
24
- for (let n = 0; n < a; n++) {
25
- const r = (n + e) % a;
26
- s[r] = t[n];
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 s;
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 C(t, e) {
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 E(t, e) {
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 v(t, e, a = !1) {
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((a) => {
77
- Array.from(a.cssRules).forEach((s) => {
78
- s instanceof CSSStyleRule && s.selectorText === ":root" && t.forEach((n) => {
79
- const r = s.styleMap.get(n);
80
- r && (e[n] = r.toString());
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((a) => {
84
- e[a] || console.warn(`variable named ${a} not found`);
47
+ }), t.forEach((s) => {
48
+ e[s] || console.warn(`variable named ${s} not found`);
85
49
  }), e;
86
50
  }
87
- function S(t) {
51
+ function C(t) {
88
52
  const e = window.atob(t);
89
53
  return decodeURIComponent(window.escape(e));
90
54
  }
91
- function P(t) {
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 a = document.createElement(null);
97
- a.innerHTML = t;
98
- const s = a.firstElementChild, r = s.querySelector(e).getPathData(), o = s.getAttribute("viewBox").split(" ").map((u) => u.trim()), i = {
99
- x: parseInt(o[0]),
100
- y: parseInt(o[1]),
101
- width: parseInt(o[2]),
102
- height: parseInt(o[3])
103
- }, c = Math.min(i.width, i.height);
104
- return r.forEach((u) => {
105
- u.values = u.values.map((l) => l / c);
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 f(t, e, a, s, n) {
72
+ function h(t, e, s, n, o) {
109
73
  const r = [];
110
- for (let o = 0; o <= 1; o += 1 / n) {
111
- const i = Math.pow(1 - o, 3) * t.x + 3 * Math.pow(1 - o, 2) * o * e.x + 3 * (1 - o) * Math.pow(o, 2) * a.x + Math.pow(o, 3) * s.x, c = Math.pow(1 - o, 3) * t.y + 3 * Math.pow(1 - o, 2) * o * e.y + 3 * (1 - o) * Math.pow(o, 2) * a.y + Math.pow(o, 3) * s.y;
112
- r.push({ x: i, y: c });
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 A(t, e) {
117
- const a = (e == null ? void 0 : e.segments) || 20, s = m(t, e);
118
- let n = [];
119
- for (let r = 0; r < s.length - 1; r++) {
120
- const { type: o, values: i } = s[r];
121
- if (o === "M" && r === 0)
122
- n.push({ x: i[0], y: i[1] });
123
- else if (o === "C") {
124
- const c = n[n.length - 1], u = { x: i[0], y: i[1] }, l = { x: i[2], y: i[3] }, p = { x: i[4], y: i[5] }, h = f(c, u, l, p, a);
125
- n = [...n, ...h];
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 n;
92
+ return o;
129
93
  }
130
94
  export {
131
- ye as calculateDistance,
132
- we as calculateDistanceWithRadius,
95
+ Ce as calculateDistance,
96
+ ve as calculateDistanceWithRadius,
133
97
  $e as camelToKebab,
134
98
  Fe as capitalize,
135
- be as clamp,
136
- Qe as cloneDeep,
137
- Te as compareObjects,
138
- b as cover,
139
- ie as createJSONAndSave,
140
- Ce as damp,
141
- ce as debounce,
142
- P as decode,
143
- oe as dispatchSizeChangeEvent,
144
- E as dotCircleCollision,
145
- C as dotRectCollision,
146
- J as easeInCubic,
147
- K as easeInExpo,
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
- H as easeInOutQuart,
152
- W as easeInOutQuint,
153
- X as easeInQuad,
154
- Y as easeInQuart,
155
- Z as easeInQuint,
156
- _ as easeOutCubic,
157
- L as easeOutExpo,
158
- ee as easeOutQuad,
159
- te as easeOutQuart,
160
- ae as easeOutQuint,
161
- S as encode,
162
- N as findParentElement,
163
- j as findScrollParentElement,
164
- w as fixPosition,
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
- U as getAllParentElements,
167
- fe as getCumulativeOffsetLeft,
168
- de as getCumulativeOffsetTop,
169
- xe as getCumulativePosition,
170
- q as getElement,
171
- Le as getElementTransitionDurationMS,
172
- et as getElementTransitionDurationS,
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
- M as getPointerPosition,
175
- A as getPoints,
176
- O as getRootVariables,
139
+ B as getPointerPosition,
140
+ E as getPoints,
141
+ y as getRootVariables,
177
142
  x as insert,
178
- k as isBrowser,
179
- Be as isESClass,
180
- ke as isNullish,
181
- ze as isObject,
182
- He as isUppercase,
183
- We as kebabToCamel,
184
- Ee as lerp,
185
- se as linear,
186
- ve as mapRange,
187
- y as measureText,
188
- Ne as mergeDeep,
189
- je as mixin,
190
- I as normalize,
191
- Je as nullishCoalescing,
192
- Ue as omit,
193
- Q as parseAttribute,
194
- T as parseAttributeValue,
195
- qe as pick,
196
- Ae as preciseNumber,
197
- Ie as round,
198
- De as roundNumberTo,
199
- v as screenToCartesian,
200
- he as setupDrag,
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
- Me as smootherstep,
203
- Oe as smoothstep,
204
- Xe as snakeToDotted,
205
- Se as step,
206
- le as throttle,
207
- Ye as toPascalCase,
208
- Ze as uncapitalize
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
  };
@@ -4,10 +4,11 @@ export type Dot2D = {
4
4
  x: number;
5
5
  y: number;
6
6
  };
7
- export type Rect2D = Dot2D & {
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.19",
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
  ],
@@ -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;