aptechka 0.5.26 → 0.5.28

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 (108) hide show
  1. package/lib/Damped-DxwUBxOC.cjs +1 -0
  2. package/lib/{Damped-BJgyFENo.js → Damped-QZAoXO5Z.js} +31 -32
  3. package/lib/{Derived-BZtlW0bB.cjs → Derived-B-g8dYgh.cjs} +1 -1
  4. package/lib/{Derived-DH-ouLBq.js → Derived-kPJs5JC5.js} +1 -1
  5. package/lib/{SourceManager-DmXmmA6z.js → SourceManager-Q-PB-Rkh.js} +3 -4
  6. package/lib/SourceManager-vSlsMKUE.cjs +1 -0
  7. package/lib/{Store-Cd-E5W1z.js → Store-BQXXikps.js} +7 -8
  8. package/lib/Store-C-1ruEIm.cjs +1 -0
  9. package/lib/{Viewport-CCDNxaDg.js → Viewport-CFFhFKqX.js} +5 -6
  10. package/lib/Viewport-DMB0dO-s.cjs +1 -0
  11. package/lib/accordion/index.cjs +1 -1
  12. package/lib/accordion/index.js +8 -9
  13. package/lib/animation/index.cjs +1 -1
  14. package/lib/animation/index.js +13 -14
  15. package/lib/attribute/index.cjs +1 -1
  16. package/lib/attribute/index.js +15 -16
  17. package/lib/canvas/index.cjs +1 -1
  18. package/lib/canvas/index.js +3 -4
  19. package/lib/checkbox/index.cjs +1 -1
  20. package/lib/checkbox/index.js +3 -4
  21. package/lib/class-linked-status/index.cjs +1 -1
  22. package/lib/class-linked-status/index.js +28 -29
  23. package/lib/controls/index.cjs +1 -1
  24. package/lib/controls/index.js +84 -76
  25. package/lib/{createStylesheet-C8aQQ4hd.cjs → createStylesheet-CqHU9_qv.cjs} +1 -1
  26. package/lib/{createStylesheet-KMRQhSa-.js → createStylesheet-DBCEbDjI.js} +1 -1
  27. package/lib/createTheme-CHnsCgAr.js +15 -0
  28. package/lib/createTheme-Cfaw9UmV.cjs +1 -0
  29. package/lib/css-property/index.cjs +1 -1
  30. package/lib/css-property/index.js +9 -10
  31. package/lib/custom-element/index.cjs +1 -1
  32. package/lib/custom-element/index.js +15 -16
  33. package/lib/dev/index.cjs +1 -1
  34. package/lib/dev/index.js +6 -7
  35. package/lib/device/index.cjs +1 -1
  36. package/lib/device/index.js +1 -1
  37. package/lib/element-constructor/index.cjs +1 -1
  38. package/lib/element-constructor/index.js +3 -3
  39. package/lib/element-resizer/index.cjs +1 -1
  40. package/lib/element-resizer/index.js +22 -23
  41. package/lib/en3/index.cjs +1 -1
  42. package/lib/en3/index.js +20 -21
  43. package/lib/image/index.cjs +1 -1
  44. package/lib/image/index.js +7 -8
  45. package/lib/{index-DGr7Qzg3.js → index-BAHHdcp3.js} +3 -4
  46. package/lib/index-D2XtQX56.cjs +9 -0
  47. package/lib/intersector/index.cjs +1 -1
  48. package/lib/intersector/index.js +6 -7
  49. package/lib/ladder/index.cjs +1 -1
  50. package/lib/ladder/index.js +3 -4
  51. package/lib/layout-box/index.cjs +1 -1
  52. package/lib/layout-box/index.js +2 -3
  53. package/lib/loading/index.cjs +1 -1
  54. package/lib/loading/index.js +15 -16
  55. package/lib/media/index.cjs +1 -1
  56. package/lib/media/index.js +5 -6
  57. package/lib/modal/index.cjs +1 -1
  58. package/lib/modal/index.js +3 -4
  59. package/lib/morph/index.cjs +1 -1
  60. package/lib/morph/index.js +2 -3
  61. package/lib/pointer/index.cjs +1 -1
  62. package/lib/pointer/index.js +2 -3
  63. package/lib/popover/index.cjs +1 -1
  64. package/lib/popover/index.js +12 -13
  65. package/lib/resized/index.cjs +1 -1
  66. package/lib/resized/index.js +7 -8
  67. package/lib/router/index.cjs +1 -1
  68. package/lib/router/index.js +7 -8
  69. package/lib/scroll/index.cjs +1 -1
  70. package/lib/scroll/index.js +6 -7
  71. package/lib/select/index.cjs +1 -1
  72. package/lib/select/index.js +1 -1
  73. package/lib/sequence/index.cjs +1 -1
  74. package/lib/sequence/index.js +1 -2
  75. package/lib/slicer/index.cjs +2 -2
  76. package/lib/slicer/index.js +3 -4
  77. package/lib/source/index.cjs +1 -1
  78. package/lib/source/index.js +29 -30
  79. package/lib/store/index.cjs +1 -1
  80. package/lib/store/index.js +12 -13
  81. package/lib/svg-path-data/index.cjs +3 -0
  82. package/lib/{utils/svg.d.ts → svg-path-data/index.d.ts} +1 -1
  83. package/lib/{path-data-polyfill-DgeDWYeI.js → svg-path-data/index.js} +201 -162
  84. package/lib/{tags-BoPv9fDr.js → tags-CMPg9ETZ.js} +233 -234
  85. package/lib/tags-Djb6mb1o.cjs +1 -0
  86. package/lib/theme/index.cjs +1 -1
  87. package/lib/theme/index.js +3 -4
  88. package/lib/ticker/index.cjs +1 -1
  89. package/lib/ticker/index.js +12 -13
  90. package/lib/tweaker/index.cjs +1 -1
  91. package/lib/tweaker/index.js +5 -6
  92. package/lib/utils/index.cjs +1 -1
  93. package/lib/utils/index.d.ts +0 -1
  94. package/lib/utils/index.js +125 -163
  95. package/lib/video/index.cjs +1 -1
  96. package/lib/video/index.js +4 -5
  97. package/lib/window-resizer/index.cjs +1 -1
  98. package/lib/window-resizer/index.js +6 -7
  99. package/package.json +9 -1
  100. package/lib/Damped-CbWlWAbx.cjs +0 -1
  101. package/lib/SourceManager-BFSCX4Q8.cjs +0 -1
  102. package/lib/Store-BQGNOHlY.cjs +0 -1
  103. package/lib/Viewport-DhKPH5nw.cjs +0 -1
  104. package/lib/createTheme-BSreUYge.cjs +0 -1
  105. package/lib/createTheme-u3NsrEV6.js +0 -16
  106. package/lib/index-CWHXGxK7.cjs +0 -9
  107. package/lib/path-data-polyfill-CXsOR7Oc.cjs +0 -3
  108. package/lib/tags-CueX-JLX.cjs +0 -1
@@ -1,6 +1,6 @@
1
1
  // @license
2
2
  (!SVGPathElement.prototype.getPathData || !SVGPathElement.prototype.setPathData) && function() {
3
- var w = {
3
+ var V = {
4
4
  Z: "Z",
5
5
  M: "M",
6
6
  L: "L",
@@ -21,14 +21,14 @@
21
21
  v: "v",
22
22
  s: "s",
23
23
  t: "t"
24
- }, k = function(u) {
25
- this._string = u, this._currentIndex = 0, this._endIndex = this._string.length, this._prevCommand = null, this._skipOptionalSpaces();
26
- }, K = window.navigator.userAgent.indexOf("MSIE ") !== -1;
27
- k.prototype = {
24
+ }, M = function(n) {
25
+ this._string = n, this._currentIndex = 0, this._endIndex = this._string.length, this._prevCommand = null, this._skipOptionalSpaces();
26
+ }, E = window.navigator.userAgent.indexOf("MSIE ") !== -1;
27
+ M.prototype = {
28
28
  parseSegment: function() {
29
- var u = this._string[this._currentIndex], t = w[u] ? w[u] : null;
29
+ var n = this._string[this._currentIndex], t = V[n] ? V[n] : null;
30
30
  if (t === null) {
31
- if (this._prevCommand === null || ((u === "+" || u === "-" || u === "." || u >= "0" && u <= "9") && this._prevCommand !== "Z" ? this._prevCommand === "M" ? t = "L" : this._prevCommand === "m" ? t = "l" : t = this._prevCommand : t = null, t === null))
31
+ if (this._prevCommand === null || ((n === "+" || n === "-" || n === "." || n >= "0" && n <= "9") && this._prevCommand !== "Z" ? this._prevCommand === "M" ? t = "L" : this._prevCommand === "m" ? t = "l" : t = this._prevCommand : t = null, t === null))
32
32
  return null;
33
33
  } else
34
34
  this._currentIndex += 1;
@@ -60,19 +60,19 @@
60
60
  return this._currentIndex < this._endIndex;
61
61
  },
62
62
  peekSegmentType: function() {
63
- var u = this._string[this._currentIndex];
64
- return w[u] ? w[u] : null;
63
+ var n = this._string[this._currentIndex];
64
+ return V[n] ? V[n] : null;
65
65
  },
66
66
  initialCommandIsMoveTo: function() {
67
67
  if (!this.hasMoreData())
68
68
  return !0;
69
- var u = this.peekSegmentType();
70
- return u === "M" || u === "m";
69
+ var n = this.peekSegmentType();
70
+ return n === "M" || n === "m";
71
71
  },
72
72
  _isCurrentSpace: function() {
73
- var u = this._string[this._currentIndex];
74
- return u <= " " && (u === " " || u === `
75
- ` || u === " " || u === "\r" || u === "\f");
73
+ var n = this._string[this._currentIndex];
74
+ return n <= " " && (n === " " || n === `
75
+ ` || n === " " || n === "\r" || n === "\f");
76
76
  },
77
77
  _skipOptionalSpaces: function() {
78
78
  for (; this._currentIndex < this._endIndex && this._isCurrentSpace(); )
@@ -86,7 +86,7 @@
86
86
  // Source/core/svg/SVGParserUtilities.cpp.
87
87
  // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF
88
88
  _parseNumber: function() {
89
- var u = 0, t = 0, e = 1, s = 0, l = 1, n = 1, a = this._currentIndex;
89
+ var n = 0, t = 0, e = 1, s = 0, l = 1, u = 1, a = this._currentIndex;
90
90
  if (this._skipOptionalSpaces(), this._currentIndex < this._endIndex && this._string[this._currentIndex] === "+" ? this._currentIndex += 1 : this._currentIndex < this._endIndex && this._string[this._currentIndex] === "-" && (this._currentIndex += 1, l = -1), this._currentIndex === this._endIndex || (this._string[this._currentIndex] < "0" || this._string[this._currentIndex] > "9") && this._string[this._currentIndex] !== ".")
91
91
  return null;
92
92
  for (var p = this._currentIndex; this._currentIndex < this._endIndex && this._string[this._currentIndex] >= "0" && this._string[this._currentIndex] <= "9"; )
@@ -101,31 +101,31 @@
101
101
  e *= 10, s += (this._string.charAt(this._currentIndex) - "0") / e, this._currentIndex += 1;
102
102
  }
103
103
  if (this._currentIndex !== a && this._currentIndex + 1 < this._endIndex && (this._string[this._currentIndex] === "e" || this._string[this._currentIndex] === "E") && this._string[this._currentIndex + 1] !== "x" && this._string[this._currentIndex + 1] !== "m") {
104
- if (this._currentIndex += 1, this._string[this._currentIndex] === "+" ? this._currentIndex += 1 : this._string[this._currentIndex] === "-" && (this._currentIndex += 1, n = -1), this._currentIndex >= this._endIndex || this._string[this._currentIndex] < "0" || this._string[this._currentIndex] > "9")
104
+ if (this._currentIndex += 1, this._string[this._currentIndex] === "+" ? this._currentIndex += 1 : this._string[this._currentIndex] === "-" && (this._currentIndex += 1, u = -1), this._currentIndex >= this._endIndex || this._string[this._currentIndex] < "0" || this._string[this._currentIndex] > "9")
105
105
  return null;
106
106
  for (; this._currentIndex < this._endIndex && this._string[this._currentIndex] >= "0" && this._string[this._currentIndex] <= "9"; )
107
- u *= 10, u += this._string[this._currentIndex] - "0", this._currentIndex += 1;
107
+ n *= 10, n += this._string[this._currentIndex] - "0", this._currentIndex += 1;
108
108
  }
109
109
  var v = t + s;
110
- return v *= l, u && (v *= Math.pow(10, n * u)), a === this._currentIndex ? null : (this._skipOptionalSpacesOrDelimiter(), v);
110
+ return v *= l, n && (v *= Math.pow(10, u * n)), a === this._currentIndex ? null : (this._skipOptionalSpacesOrDelimiter(), v);
111
111
  },
112
112
  _parseArcFlag: function() {
113
113
  if (this._currentIndex >= this._endIndex)
114
114
  return null;
115
- var u = null, t = this._string[this._currentIndex];
115
+ var n = null, t = this._string[this._currentIndex];
116
116
  if (this._currentIndex += 1, t === "0")
117
- u = 0;
117
+ n = 0;
118
118
  else if (t === "1")
119
- u = 1;
119
+ n = 1;
120
120
  else
121
121
  return null;
122
- return this._skipOptionalSpacesOrDelimiter(), u;
122
+ return this._skipOptionalSpacesOrDelimiter(), n;
123
123
  }
124
124
  };
125
- var z = function(u) {
126
- if (!u || u.length === 0)
125
+ var A = function(n) {
126
+ if (!n || n.length === 0)
127
127
  return [];
128
- var t = new k(u), e = [];
128
+ var t = new M(n), e = [];
129
129
  if (t.initialCommandIsMoveTo())
130
130
  for (; t.hasMoreData(); ) {
131
131
  var s = t.parseSegment();
@@ -134,70 +134,70 @@
134
134
  e.push(s);
135
135
  }
136
136
  return e;
137
- }, W = SVGPathElement.prototype.setAttribute, U = SVGPathElement.prototype.setAttributeNS, R = SVGPathElement.prototype.removeAttribute, g = SVGPathElement.prototype.removeAttributeNS, x = window.Symbol ? Symbol() : "__cachedPathData", S = window.Symbol ? Symbol() : "__cachedNormalizedPathData", H = function(u, t, e, s, l, n, a, p, i, r) {
138
- var v = function(L) {
139
- return Math.PI * L / 180;
140
- }, h = function(L, J, T) {
141
- var ht = L * Math.cos(T) - J * Math.sin(T), pt = L * Math.sin(T) + J * Math.cos(T);
137
+ }, P = SVGPathElement.prototype.setAttribute, S = SVGPathElement.prototype.setAttributeNS, _ = SVGPathElement.prototype.removeAttribute, x = SVGPathElement.prototype.removeAttributeNS, y = window.Symbol ? Symbol() : "__cachedPathData", m = window.Symbol ? Symbol() : "__cachedNormalizedPathData", L = function(n, t, e, s, l, u, a, p, i, r) {
138
+ var v = function(X) {
139
+ return Math.PI * X / 180;
140
+ }, h = function(X, tt, Y) {
141
+ var ht = X * Math.cos(Y) - tt * Math.sin(Y), pt = X * Math.sin(Y) + tt * Math.cos(Y);
142
142
  return { x: ht, y: pt };
143
- }, o = v(a), c = [], _, f, d, y;
143
+ }, f = v(a), c = [], d, o, I, b;
144
144
  if (r)
145
- _ = r[0], f = r[1], d = r[2], y = r[3];
145
+ d = r[0], o = r[1], I = r[2], b = r[3];
146
146
  else {
147
- var A = h(u, t, -o);
148
- u = A.x, t = A.y;
149
- var P = h(e, s, -o);
150
- e = P.x, s = P.y;
151
- var m = (u - e) / 2, I = (t - s) / 2, M = m * m / (l * l) + I * I / (n * n);
152
- M > 1 && (M = Math.sqrt(M), l = M * l, n = M * n);
153
- var D;
154
- p === i ? D = -1 : D = 1;
155
- var E = l * l, N = n * n, et = E * N - E * I * I - N * m * m, at = E * I * I + N * m * m, O = D * Math.sqrt(Math.abs(et / at));
156
- d = O * l * I / n + (u + e) / 2, y = O * -n * m / l + (t + s) / 2, _ = Math.asin(parseFloat(((t - y) / n).toFixed(9))), f = Math.asin(parseFloat(((s - y) / n).toFixed(9))), u < d && (_ = Math.PI - _), e < d && (f = Math.PI - f), _ < 0 && (_ = Math.PI * 2 + _), f < 0 && (f = Math.PI * 2 + f), i && _ > f && (_ = _ - Math.PI * 2), !i && f > _ && (f = f - Math.PI * 2);
147
+ var O = h(n, t, -f);
148
+ n = O.x, t = O.y;
149
+ var T = h(e, s, -f);
150
+ e = T.x, s = T.y;
151
+ var w = (n - e) / 2, C = (t - s) / 2, G = w * w / (l * l) + C * C / (u * u);
152
+ G > 1 && (G = Math.sqrt(G), l = G * l, u = G * u);
153
+ var k;
154
+ p === i ? k = -1 : k = 1;
155
+ var z = l * l, H = u * u, et = z * H - z * C * C - H * w * w, at = z * C * C + H * w * w, q = k * Math.sqrt(Math.abs(et / at));
156
+ I = q * l * C / u + (n + e) / 2, b = q * -u * w / l + (t + s) / 2, d = Math.asin(parseFloat(((t - b) / u).toFixed(9))), o = Math.asin(parseFloat(((s - b) / u).toFixed(9))), n < I && (d = Math.PI - d), e < I && (o = Math.PI - o), d < 0 && (d = Math.PI * 2 + d), o < 0 && (o = Math.PI * 2 + o), i && d > o && (d = d - Math.PI * 2), !i && o > d && (o = o - Math.PI * 2);
157
157
  }
158
- var Z = f - _;
159
- if (Math.abs(Z) > Math.PI * 120 / 180) {
160
- var rt = f, st = e, ut = s;
161
- i && f > _ ? f = _ + Math.PI * 120 / 180 * 1 : f = _ + Math.PI * 120 / 180 * -1, e = d + l * Math.cos(f), s = y + n * Math.sin(f), c = H(
158
+ var B = o - d;
159
+ if (Math.abs(B) > Math.PI * 120 / 180) {
160
+ var rt = o, st = e, nt = s;
161
+ i && o > d ? o = d + Math.PI * 120 / 180 * 1 : o = d + Math.PI * 120 / 180 * -1, e = I + l * Math.cos(o), s = b + u * Math.sin(o), c = L(
162
162
  e,
163
163
  s,
164
164
  st,
165
- ut,
165
+ nt,
166
166
  l,
167
- n,
167
+ u,
168
168
  a,
169
169
  0,
170
170
  i,
171
- [f, rt, d, y]
171
+ [o, rt, I, b]
172
172
  );
173
173
  }
174
- Z = f - _;
175
- var it = Math.cos(_), nt = Math.sin(_), lt = Math.cos(f), vt = Math.sin(f), Q = Math.tan(Z / 4), X = 4 / 3 * l * Q, Y = 4 / 3 * n * Q, q = [u, t], C = [u + X * nt, t - Y * it], $ = [e + X * vt, s - Y * lt], F = [e, s];
176
- if (C[0] = 2 * q[0] - C[0], C[1] = 2 * q[1] - C[1], r)
177
- return [C, $, F].concat(c);
178
- c = [C, $, F].concat(c);
179
- for (var j = [], b = 0; b < c.length; b += 3) {
180
- var l = h(c[b][0], c[b][1], o), n = h(c[b + 1][0], c[b + 1][1], o), B = h(c[b + 2][0], c[b + 2][1], o);
181
- j.push([l.x, l.y, n.x, n.y, B.x, B.y]);
174
+ B = o - d;
175
+ var it = Math.cos(d), ut = Math.sin(d), lt = Math.cos(o), vt = Math.sin(o), F = Math.tan(B / 4), j = 4 / 3 * l * F, J = 4 / 3 * u * F, K = [n, t], Z = [n + j * ut, t - J * it], W = [e + j * vt, s - J * lt], U = [e, s];
176
+ if (Z[0] = 2 * K[0] - Z[0], Z[1] = 2 * K[1] - Z[1], r)
177
+ return [Z, W, U].concat(c);
178
+ c = [Z, W, U].concat(c);
179
+ for (var R = [], N = 0; N < c.length; N += 3) {
180
+ var l = h(c[N][0], c[N][1], f), u = h(c[N + 1][0], c[N + 1][1], f), g = h(c[N + 2][0], c[N + 2][1], f);
181
+ R.push([l.x, l.y, u.x, u.y, g.x, g.y]);
182
182
  }
183
- return j;
184
- }, V = function(u) {
185
- return u.map(function(t) {
183
+ return R;
184
+ }, D = function(n) {
185
+ return n.map(function(t) {
186
186
  return {
187
187
  type: t.type,
188
188
  values: Array.prototype.slice.call(t.values)
189
189
  };
190
190
  });
191
- }, tt = function(u) {
192
- var t = [], e = null, s = null, l = null, n = null;
193
- return u.forEach(function(a) {
191
+ }, $ = function(n) {
192
+ var t = [], e = null, s = null, l = null, u = null;
193
+ return n.forEach(function(a) {
194
194
  var p = a.type;
195
195
  if (p === "M") {
196
196
  var i = a.values[0], r = a.values[1];
197
- t.push({ type: "M", values: [i, r] }), l = i, n = r, e = i, s = r;
197
+ t.push({ type: "M", values: [i, r] }), l = i, u = r, e = i, s = r;
198
198
  } else if (p === "m") {
199
199
  var i = e + a.values[0], r = s + a.values[1];
200
- t.push({ type: "M", values: [i, r] }), l = i, n = r, e = i, s = r;
200
+ t.push({ type: "M", values: [i, r] }), l = i, u = r, e = i, s = r;
201
201
  } else if (p === "L") {
202
202
  var i = a.values[0], r = a.values[1];
203
203
  t.push({ type: "L", values: [i, r] }), e = i, s = r;
@@ -205,16 +205,16 @@
205
205
  var i = e + a.values[0], r = s + a.values[1];
206
206
  t.push({ type: "L", values: [i, r] }), e = i, s = r;
207
207
  } else if (p === "C") {
208
- var v = a.values[0], h = a.values[1], o = a.values[2], c = a.values[3], i = a.values[4], r = a.values[5];
208
+ var v = a.values[0], h = a.values[1], f = a.values[2], c = a.values[3], i = a.values[4], r = a.values[5];
209
209
  t.push({
210
210
  type: "C",
211
- values: [v, h, o, c, i, r]
211
+ values: [v, h, f, c, i, r]
212
212
  }), e = i, s = r;
213
213
  } else if (p === "c") {
214
- var v = e + a.values[0], h = s + a.values[1], o = e + a.values[2], c = s + a.values[3], i = e + a.values[4], r = s + a.values[5];
214
+ var v = e + a.values[0], h = s + a.values[1], f = e + a.values[2], c = s + a.values[3], i = e + a.values[4], r = s + a.values[5];
215
215
  t.push({
216
216
  type: "C",
217
- values: [v, h, o, c, i, r]
217
+ values: [v, h, f, c, i, r]
218
218
  }), e = i, s = r;
219
219
  } else if (p === "Q") {
220
220
  var v = a.values[0], h = a.values[1], i = a.values[2], r = a.values[3];
@@ -263,11 +263,11 @@
263
263
  var r = s + a.values[0];
264
264
  t.push({ type: "V", values: [r] }), s = r;
265
265
  } else if (p === "S") {
266
- var o = a.values[0], c = a.values[1], i = a.values[2], r = a.values[3];
267
- t.push({ type: "S", values: [o, c, i, r] }), e = i, s = r;
266
+ var f = a.values[0], c = a.values[1], i = a.values[2], r = a.values[3];
267
+ t.push({ type: "S", values: [f, c, i, r] }), e = i, s = r;
268
268
  } else if (p === "s") {
269
- var o = e + a.values[0], c = s + a.values[1], i = e + a.values[2], r = s + a.values[3];
270
- t.push({ type: "S", values: [o, c, i, r] }), e = i, s = r;
269
+ var f = e + a.values[0], c = s + a.values[1], i = e + a.values[2], r = s + a.values[3];
270
+ t.push({ type: "S", values: [f, c, i, r] }), e = i, s = r;
271
271
  } else if (p === "T") {
272
272
  var i = a.values[0], r = a.values[1];
273
273
  t.push({ type: "T", values: [i, r] }), e = i, s = r;
@@ -275,136 +275,136 @@
275
275
  var i = e + a.values[0], r = s + a.values[1];
276
276
  t.push({ type: "T", values: [i, r] }), e = i, s = r;
277
277
  } else
278
- (p === "Z" || p === "z") && (t.push({ type: "Z", values: [] }), e = l, s = n);
278
+ (p === "Z" || p === "z") && (t.push({ type: "Z", values: [] }), e = l, s = u);
279
279
  }), t;
280
- }, G = function(u) {
281
- var t = [], e = null, s = null, l = null, n = null, a = null, p = null, i = null;
282
- return u.forEach(function(r) {
280
+ }, Q = function(n) {
281
+ var t = [], e = null, s = null, l = null, u = null, a = null, p = null, i = null;
282
+ return n.forEach(function(r) {
283
283
  if (r.type === "M") {
284
284
  var v = r.values[0], h = r.values[1];
285
- t.push({ type: "M", values: [v, h] }), p = v, i = h, n = v, a = h;
285
+ t.push({ type: "M", values: [v, h] }), p = v, i = h, u = v, a = h;
286
286
  } else if (r.type === "C") {
287
- var o = r.values[0], c = r.values[1], _ = r.values[2], f = r.values[3], v = r.values[4], h = r.values[5];
288
- t.push({ type: "C", values: [o, c, _, f, v, h] }), s = _, l = f, n = v, a = h;
287
+ var f = r.values[0], c = r.values[1], d = r.values[2], o = r.values[3], v = r.values[4], h = r.values[5];
288
+ t.push({ type: "C", values: [f, c, d, o, v, h] }), s = d, l = o, u = v, a = h;
289
289
  } else if (r.type === "L") {
290
290
  var v = r.values[0], h = r.values[1];
291
- t.push({ type: "L", values: [v, h] }), n = v, a = h;
291
+ t.push({ type: "L", values: [v, h] }), u = v, a = h;
292
292
  } else if (r.type === "H") {
293
293
  var v = r.values[0];
294
- t.push({ type: "L", values: [v, a] }), n = v;
294
+ t.push({ type: "L", values: [v, a] }), u = v;
295
295
  } else if (r.type === "V") {
296
296
  var h = r.values[0];
297
- t.push({ type: "L", values: [n, h] }), a = h;
297
+ t.push({ type: "L", values: [u, h] }), a = h;
298
298
  } else if (r.type === "S") {
299
- var _ = r.values[0], f = r.values[1], v = r.values[2], h = r.values[3], d, y;
300
- e === "C" || e === "S" ? (d = n + (n - s), y = a + (a - l)) : (d = n, y = a), t.push({ type: "C", values: [d, y, _, f, v, h] }), s = _, l = f, n = v, a = h;
299
+ var d = r.values[0], o = r.values[1], v = r.values[2], h = r.values[3], I, b;
300
+ e === "C" || e === "S" ? (I = u + (u - s), b = a + (a - l)) : (I = u, b = a), t.push({ type: "C", values: [I, b, d, o, v, h] }), s = d, l = o, u = v, a = h;
301
301
  } else if (r.type === "T") {
302
- var v = r.values[0], h = r.values[1], o, c;
303
- e === "Q" || e === "T" ? (o = n + (n - s), c = a + (a - l)) : (o = n, c = a);
304
- var d = n + 2 * (o - n) / 3, y = a + 2 * (c - a) / 3, A = v + 2 * (o - v) / 3, P = h + 2 * (c - h) / 3;
302
+ var v = r.values[0], h = r.values[1], f, c;
303
+ e === "Q" || e === "T" ? (f = u + (u - s), c = a + (a - l)) : (f = u, c = a);
304
+ var I = u + 2 * (f - u) / 3, b = a + 2 * (c - a) / 3, O = v + 2 * (f - v) / 3, T = h + 2 * (c - h) / 3;
305
305
  t.push({
306
306
  type: "C",
307
- values: [d, y, A, P, v, h]
308
- }), s = o, l = c, n = v, a = h;
307
+ values: [I, b, O, T, v, h]
308
+ }), s = f, l = c, u = v, a = h;
309
309
  } else if (r.type === "Q") {
310
- var o = r.values[0], c = r.values[1], v = r.values[2], h = r.values[3], d = n + 2 * (o - n) / 3, y = a + 2 * (c - a) / 3, A = v + 2 * (o - v) / 3, P = h + 2 * (c - h) / 3;
310
+ var f = r.values[0], c = r.values[1], v = r.values[2], h = r.values[3], I = u + 2 * (f - u) / 3, b = a + 2 * (c - a) / 3, O = v + 2 * (f - v) / 3, T = h + 2 * (c - h) / 3;
311
311
  t.push({
312
312
  type: "C",
313
- values: [d, y, A, P, v, h]
314
- }), s = o, l = c, n = v, a = h;
313
+ values: [I, b, O, T, v, h]
314
+ }), s = f, l = c, u = v, a = h;
315
315
  } else if (r.type === "A") {
316
- var m = Math.abs(r.values[0]), I = Math.abs(r.values[1]), M = r.values[2], D = r.values[3], E = r.values[4], v = r.values[5], h = r.values[6];
317
- if (m === 0 || I === 0)
316
+ var w = Math.abs(r.values[0]), C = Math.abs(r.values[1]), G = r.values[2], k = r.values[3], z = r.values[4], v = r.values[5], h = r.values[6];
317
+ if (w === 0 || C === 0)
318
318
  t.push({
319
319
  type: "C",
320
- values: [n, a, v, h, v, h]
321
- }), n = v, a = h;
322
- else if (n !== v || a !== h) {
323
- var N = H(
324
- n,
320
+ values: [u, a, v, h, v, h]
321
+ }), u = v, a = h;
322
+ else if (u !== v || a !== h) {
323
+ var H = L(
324
+ u,
325
325
  a,
326
326
  v,
327
327
  h,
328
- m,
329
- I,
330
- M,
331
- D,
332
- E
328
+ w,
329
+ C,
330
+ G,
331
+ k,
332
+ z
333
333
  );
334
- N.forEach(function(O) {
335
- t.push({ type: "C", values: O });
336
- }), n = v, a = h;
334
+ H.forEach(function(q) {
335
+ t.push({ type: "C", values: q });
336
+ }), u = v, a = h;
337
337
  }
338
338
  } else
339
- r.type === "Z" && (t.push(r), n = p, a = i);
339
+ r.type === "Z" && (t.push(r), u = p, a = i);
340
340
  e = r.type;
341
341
  }), t;
342
342
  };
343
- SVGPathElement.prototype.setAttribute = function(u, t) {
344
- u === "d" && (this[x] = null, this[S] = null), W.call(this, u, t);
345
- }, SVGPathElement.prototype.setAttributeNS = function(u, t, e) {
343
+ SVGPathElement.prototype.setAttribute = function(n, t) {
344
+ n === "d" && (this[y] = null, this[m] = null), P.call(this, n, t);
345
+ }, SVGPathElement.prototype.setAttributeNS = function(n, t, e) {
346
346
  if (t === "d") {
347
347
  var s = "http://www.w3.org/2000/svg";
348
- if (u)
348
+ if (n)
349
349
  for (var l of this.ownerSVGElement.attributes)
350
- l.name === `xmlns:${u}` && (s = l.value);
351
- s === "http://www.w3.org/2000/svg" && (this[x] = null, this[S] = null);
350
+ l.name === `xmlns:${n}` && (s = l.value);
351
+ s === "http://www.w3.org/2000/svg" && (this[y] = null, this[m] = null);
352
352
  }
353
- U.call(this, u, t, e);
354
- }, SVGPathElement.prototype.removeAttribute = function(u, t) {
355
- u === "d" && (this[x] = null, this[S] = null), R.call(this, u);
356
- }, SVGPathElement.prototype.removeAttributeNS = function(u, t) {
353
+ S.call(this, n, t, e);
354
+ }, SVGPathElement.prototype.removeAttribute = function(n, t) {
355
+ n === "d" && (this[y] = null, this[m] = null), _.call(this, n);
356
+ }, SVGPathElement.prototype.removeAttributeNS = function(n, t) {
357
357
  if (t === "d") {
358
358
  var e = "http://www.w3.org/2000/svg";
359
- if (u)
359
+ if (n)
360
360
  for (var s of this.ownerSVGElement.attributes)
361
- s.name === `xmlns:${u}` && (e = s.value);
362
- e === "http://www.w3.org/2000/svg" && (this[x] = null, this[S] = null);
361
+ s.name === `xmlns:${n}` && (e = s.value);
362
+ e === "http://www.w3.org/2000/svg" && (this[y] = null, this[m] = null);
363
363
  }
364
- g.call(this, u, t);
365
- }, SVGPathElement.prototype.getPathData = function(u) {
366
- if (u && u.normalize) {
367
- if (this[S])
368
- return V(this[S]);
364
+ x.call(this, n, t);
365
+ }, SVGPathElement.prototype.getPathData = function(n) {
366
+ if (n && n.normalize) {
367
+ if (this[m])
368
+ return D(this[m]);
369
369
  var t;
370
- this[x] ? t = V(this[x]) : (t = z(this.getAttribute("d") || ""), this[x] = V(t));
371
- var e = G(tt(t));
372
- return this[S] = V(e), e;
370
+ this[y] ? t = D(this[y]) : (t = A(this.getAttribute("d") || ""), this[y] = D(t));
371
+ var e = Q($(t));
372
+ return this[m] = D(e), e;
373
373
  } else {
374
- if (this[x])
375
- return V(this[x]);
376
- var t = z(this.getAttribute("d") || "");
377
- return this[x] = V(t), t;
374
+ if (this[y])
375
+ return D(this[y]);
376
+ var t = A(this.getAttribute("d") || "");
377
+ return this[y] = D(t), t;
378
378
  }
379
- }, SVGPathElement.prototype.setPathData = function(u) {
380
- if (u.length === 0)
381
- K ? this.setAttribute("d", "") : this.removeAttribute("d");
379
+ }, SVGPathElement.prototype.setPathData = function(n) {
380
+ if (n.length === 0)
381
+ E ? this.setAttribute("d", "") : this.removeAttribute("d");
382
382
  else {
383
- for (var t = "", e = 0, s = u.length; e < s; e += 1) {
384
- var l = u[e];
383
+ for (var t = "", e = 0, s = n.length; e < s; e += 1) {
384
+ var l = n[e];
385
385
  e > 0 && (t += " "), t += l.type, l.values && l.values.length > 0 && (t += " " + l.values.join(" "));
386
386
  }
387
387
  this.setAttribute("d", t);
388
388
  }
389
- }, SVGRectElement.prototype.getPathData = function(u) {
390
- var t = this.x.baseVal.value, e = this.y.baseVal.value, s = this.width.baseVal.value, l = this.height.baseVal.value, n = this.hasAttribute("rx") ? this.rx.baseVal.value : this.ry.baseVal.value, a = this.hasAttribute("ry") ? this.ry.baseVal.value : this.rx.baseVal.value;
391
- n > s / 2 && (n = s / 2), a > l / 2 && (a = l / 2);
389
+ }, SVGRectElement.prototype.getPathData = function(n) {
390
+ var t = this.x.baseVal.value, e = this.y.baseVal.value, s = this.width.baseVal.value, l = this.height.baseVal.value, u = this.hasAttribute("rx") ? this.rx.baseVal.value : this.ry.baseVal.value, a = this.hasAttribute("ry") ? this.ry.baseVal.value : this.rx.baseVal.value;
391
+ u > s / 2 && (u = s / 2), a > l / 2 && (a = l / 2);
392
392
  var p = [
393
- { type: "M", values: [t + n, e] },
394
- { type: "H", values: [t + s - n] },
395
- { type: "A", values: [n, a, 0, 0, 1, t + s, e + a] },
393
+ { type: "M", values: [t + u, e] },
394
+ { type: "H", values: [t + s - u] },
395
+ { type: "A", values: [u, a, 0, 0, 1, t + s, e + a] },
396
396
  { type: "V", values: [e + l - a] },
397
- { type: "A", values: [n, a, 0, 0, 1, t + s - n, e + l] },
398
- { type: "H", values: [t + n] },
399
- { type: "A", values: [n, a, 0, 0, 1, t, e + l - a] },
397
+ { type: "A", values: [u, a, 0, 0, 1, t + s - u, e + l] },
398
+ { type: "H", values: [t + u] },
399
+ { type: "A", values: [u, a, 0, 0, 1, t, e + l - a] },
400
400
  { type: "V", values: [e + a] },
401
- { type: "A", values: [n, a, 0, 0, 1, t + n, e] },
401
+ { type: "A", values: [u, a, 0, 0, 1, t + u, e] },
402
402
  { type: "Z", values: [] }
403
403
  ];
404
404
  return p = p.filter(function(i) {
405
405
  return !(i.type === "A" && (i.values[0] === 0 || i.values[1] === 0));
406
- }), u && u.normalize === !0 && (p = G(p)), p;
407
- }, SVGCircleElement.prototype.getPathData = function(u) {
406
+ }), n && n.normalize === !0 && (p = Q(p)), p;
407
+ }, SVGCircleElement.prototype.getPathData = function(n) {
408
408
  var t = this.cx.baseVal.value, e = this.cy.baseVal.value, s = this.r.baseVal.value, l = [
409
409
  { type: "M", values: [t + s, e] },
410
410
  { type: "A", values: [s, s, 0, 0, 1, t, e + s] },
@@ -413,9 +413,9 @@
413
413
  { type: "A", values: [s, s, 0, 0, 1, t + s, e] },
414
414
  { type: "Z", values: [] }
415
415
  ];
416
- return u && u.normalize === !0 && (l = G(l)), l;
417
- }, SVGEllipseElement.prototype.getPathData = function(u) {
418
- var t = this.cx.baseVal.value, e = this.cy.baseVal.value, s = this.rx.baseVal.value, l = this.ry.baseVal.value, n = [
416
+ return n && n.normalize === !0 && (l = Q(l)), l;
417
+ }, SVGEllipseElement.prototype.getPathData = function(n) {
418
+ var t = this.cx.baseVal.value, e = this.cy.baseVal.value, s = this.rx.baseVal.value, l = this.ry.baseVal.value, u = [
419
419
  { type: "M", values: [t + s, e] },
420
420
  { type: "A", values: [s, l, 0, 0, 1, t, e + l] },
421
421
  { type: "A", values: [s, l, 0, 0, 1, t - s, e] },
@@ -423,32 +423,71 @@
423
423
  { type: "A", values: [s, l, 0, 0, 1, t + s, e] },
424
424
  { type: "Z", values: [] }
425
425
  ];
426
- return u && u.normalize === !0 && (n = G(n)), n;
426
+ return n && n.normalize === !0 && (u = Q(u)), u;
427
427
  }, SVGLineElement.prototype.getPathData = function() {
428
428
  return [
429
429
  { type: "M", values: [this.x1.baseVal.value, this.y1.baseVal.value] },
430
430
  { type: "L", values: [this.x2.baseVal.value, this.y2.baseVal.value] }
431
431
  ];
432
432
  }, SVGPolylineElement.prototype.getPathData = function() {
433
- for (var u = [], t = 0; t < this.points.numberOfItems; t += 1) {
433
+ for (var n = [], t = 0; t < this.points.numberOfItems; t += 1) {
434
434
  var e = this.points.getItem(t);
435
- u.push({
435
+ n.push({
436
436
  type: t === 0 ? "M" : "L",
437
437
  values: [e.x, e.y]
438
438
  });
439
439
  }
440
- return u;
440
+ return n;
441
441
  }, SVGPolygonElement.prototype.getPathData = function() {
442
- for (var u = [], t = 0; t < this.points.numberOfItems; t += 1) {
442
+ for (var n = [], t = 0; t < this.points.numberOfItems; t += 1) {
443
443
  var e = this.points.getItem(t);
444
- u.push({
444
+ n.push({
445
445
  type: t === 0 ? "M" : "L",
446
446
  values: [e.x, e.y]
447
447
  });
448
448
  }
449
- return u.push({
449
+ return n.push({
450
450
  type: "Z",
451
451
  values: []
452
- }), u;
452
+ }), n;
453
453
  };
454
454
  }();
455
+ function ct(V, { pathSelector: M = "path" } = {}) {
456
+ const E = document.createElement(null);
457
+ E.innerHTML = V;
458
+ const A = E.firstElementChild, S = A.querySelector(M).getPathData(), _ = A.getAttribute("viewBox").split(" ").map((m) => m.trim()), x = {
459
+ x: parseInt(_[0]),
460
+ y: parseInt(_[1]),
461
+ width: parseInt(_[2]),
462
+ height: parseInt(_[3])
463
+ }, y = Math.min(x.width, x.height);
464
+ return S.forEach((m) => {
465
+ m.values = m.values.map((L) => L / y);
466
+ }), S;
467
+ }
468
+ function ot(V, M, E, A, P) {
469
+ const S = [];
470
+ for (let _ = 0; _ <= 1; _ += 1 / P) {
471
+ const x = Math.pow(1 - _, 3) * V.x + 3 * Math.pow(1 - _, 2) * _ * M.x + 3 * (1 - _) * Math.pow(_, 2) * E.x + Math.pow(_, 3) * A.x, y = Math.pow(1 - _, 3) * V.y + 3 * Math.pow(1 - _, 2) * _ * M.y + 3 * (1 - _) * Math.pow(_, 2) * E.y + Math.pow(_, 3) * A.y;
472
+ S.push({ x, y });
473
+ }
474
+ return S;
475
+ }
476
+ function ft(V, M) {
477
+ const E = (M == null ? void 0 : M.segments) || 20, A = ct(V, M);
478
+ let P = [];
479
+ for (let S = 0; S < A.length - 1; S++) {
480
+ const { type: _, values: x } = A[S];
481
+ if (_ === "M" && S === 0)
482
+ P.push({ x: x[0], y: x[1] });
483
+ else if (_ === "C") {
484
+ const y = P[P.length - 1], m = { x: x[0], y: x[1] }, L = { x: x[2], y: x[3] }, D = { x: x[4], y: x[5] }, $ = ot(y, m, L, D, E);
485
+ P = [...P, ...$];
486
+ }
487
+ }
488
+ return P;
489
+ }
490
+ export {
491
+ ct as getPathData,
492
+ ft as getPoints
493
+ };