@devtron-labs/devtron-fe-common-lib 1.1.6-beta-2 → 1.1.6-beta-4

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 (118) hide show
  1. package/dist/Common/CustomTagSelector/Types.d.ts +12 -0
  2. package/dist/Common/Types.d.ts +2 -1
  3. package/dist/Shared/Components/DynamicDataTable/DynamicDataTable.d.ts +2 -0
  4. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableHeader.d.ts +2 -0
  5. package/dist/Shared/Components/DynamicDataTable/DynamicDataTableRow.d.ts +2 -0
  6. package/dist/Shared/Components/DynamicDataTable/index.d.ts +2 -0
  7. package/dist/Shared/Components/DynamicDataTable/types.d.ts +161 -0
  8. package/dist/Shared/Components/DynamicDataTable/utils.d.ts +5 -0
  9. package/dist/Shared/Components/MultipleResizableTextArea/MultipleResizableTextArea.d.ts +2 -0
  10. package/dist/Shared/Components/MultipleResizableTextArea/index.d.ts +2 -0
  11. package/dist/Shared/Components/MultipleResizableTextArea/types.d.ts +9 -0
  12. package/dist/Shared/Components/SelectPicker/type.d.ts +5 -4
  13. package/dist/Shared/Components/SelectTextArea/SelectTextArea.d.ts +2 -0
  14. package/dist/Shared/Components/SelectTextArea/index.d.ts +2 -0
  15. package/dist/Shared/Components/SelectTextArea/types.d.ts +12 -0
  16. package/dist/Shared/Components/index.d.ts +2 -0
  17. package/dist/abap-DttVK1gE.js +1314 -0
  18. package/dist/apex-BjfHvyb2.js +315 -0
  19. package/dist/assets/index.css +1 -0
  20. package/dist/azcli-Ws-Trf8e.js +74 -0
  21. package/dist/bat-CeCHpU9_.js +95 -0
  22. package/dist/bicep-C7a7aEmi.js +108 -0
  23. package/dist/cameligo-CJeEIvX4.js +168 -0
  24. package/dist/clojure-CEKXhLdU.js +754 -0
  25. package/dist/coffee-CKu3e6V1.js +228 -0
  26. package/dist/cpp-CvUiT5Ec.js +390 -0
  27. package/dist/csharp-PmU9HJkB.js +320 -0
  28. package/dist/csp-DULvRLPF.js +57 -0
  29. package/dist/css-CNWXQPpt.js +186 -0
  30. package/dist/cssMode--71rLUMi.js +1446 -0
  31. package/dist/cypher-CYHOQS2R.js +262 -0
  32. package/dist/dart-BjGx-9Jk.js +270 -0
  33. package/dist/dockerfile-D0WaVIZ2.js +132 -0
  34. package/dist/ecl-CijaJu-p.js +454 -0
  35. package/dist/elixir-BI5Tc37S.js +489 -0
  36. package/dist/flow9-BApGtQOO.js +141 -0
  37. package/dist/freemarker2-Cx3qG0cs.js +643 -0
  38. package/dist/fsharp-VeKgt2eG.js +210 -0
  39. package/dist/go-Cl8cKDlN.js +208 -0
  40. package/dist/graphql-PfgPBmj4.js +141 -0
  41. package/dist/handlebars-Bt2uqG8b.js +391 -0
  42. package/dist/hcl-CG4VZSkm.js +177 -0
  43. package/dist/html-DU7HWII4.js +281 -0
  44. package/dist/htmlMode-C_jemX66.js +1456 -0
  45. package/dist/index-DFjnZKpc.js +163879 -0
  46. package/dist/index.js +508 -505
  47. package/dist/ini-EhiBNPZF.js +68 -0
  48. package/dist/java-DPbnXhoY.js +221 -0
  49. package/dist/javascript-tR3wsqWc.js +75 -0
  50. package/dist/jsonMode-CPHJoMDt.js +1866 -0
  51. package/dist/julia-Bw7EYexg.js +496 -0
  52. package/dist/kotlin-BNXLDoV0.js +245 -0
  53. package/dist/less-DtuF_id_.js +168 -0
  54. package/dist/lexon-DpB0-37O.js +151 -0
  55. package/dist/liquid-Cp4TQ7hL.js +238 -0
  56. package/dist/lua-CzRNOk9S.js +157 -0
  57. package/dist/m3-pXPmDwal.js +210 -0
  58. package/dist/markdown-CeQ3rxjn.js +202 -0
  59. package/dist/mdx-DP3ktqo6.js +171 -0
  60. package/dist/mips-DyE0VSNz.js +194 -0
  61. package/dist/msdax-CbdkoqRa.js +377 -0
  62. package/dist/mysql-B86-uHNu.js +876 -0
  63. package/dist/objective-c-1xvkKPId.js +188 -0
  64. package/dist/pascal-DcyFhj80.js +245 -0
  65. package/dist/pascaligo-QnM0hvMG.js +158 -0
  66. package/dist/perl-Bqp3FbU4.js +599 -0
  67. package/dist/pgsql-HdG7BG_Z.js +847 -0
  68. package/dist/php-zf7L2p7t.js +471 -0
  69. package/dist/pla-3Ykqsyzl.js +131 -0
  70. package/dist/postiats-D1v08O4B.js +544 -0
  71. package/dist/powerquery-CiQ9b1-b.js +890 -0
  72. package/dist/powershell-DFNK6VaX.js +233 -0
  73. package/dist/protobuf-D5P2Z6tc.js +422 -0
  74. package/dist/pug-BeyMX5am.js +393 -0
  75. package/dist/python-7adrB-AP.js +259 -0
  76. package/dist/qsharp-DcFOTjuP.js +282 -0
  77. package/dist/r-B3aJPcWp.js +245 -0
  78. package/dist/razor-DgqIzp1R.js +512 -0
  79. package/dist/redis-CyC__Tub.js +298 -0
  80. package/dist/redshift-NqbcQPcY.js +806 -0
  81. package/dist/restructuredtext-CZMxBkap.js +162 -0
  82. package/dist/ruby-C_jEtDv5.js +444 -0
  83. package/dist/rust-WAeitMCC.js +337 -0
  84. package/dist/sb-CSBm2pED.js +110 -0
  85. package/dist/scala-D76PhKmh.js +353 -0
  86. package/dist/scheme-CBSAjRuO.js +114 -0
  87. package/dist/scss-BHY8wFFg.js +244 -0
  88. package/dist/shell-Cwju9_l8.js +224 -0
  89. package/dist/solidity-BV1-nze3.js +1351 -0
  90. package/dist/sophia-DfoUlGAs.js +190 -0
  91. package/dist/sparql-4kfArTtK.js +193 -0
  92. package/dist/sql-DIpn0HSX.js +818 -0
  93. package/dist/st-BgJ_KDZh.js +415 -0
  94. package/dist/swift-D-ucEgIi.js +315 -0
  95. package/dist/systemverilog-DjkH5zuo.js +556 -0
  96. package/dist/tcl-gd8XLKJA.js +232 -0
  97. package/dist/tsMode-DEn7IgUV.js +810 -0
  98. package/dist/twig-D5XtTFGM.js +323 -0
  99. package/dist/typescript-BIIti-S_.js +328 -0
  100. package/dist/vb-DYqqYAf3.js +364 -0
  101. package/dist/wgsl-CkZE0qf3.js +420 -0
  102. package/dist/xml-BTCrcRFQ.js +95 -0
  103. package/dist/yaml-7Qg03Fvh.js +184 -0
  104. package/package.json +5 -4
  105. package/dist/@code-editor-Vbkor1r4.js +0 -18991
  106. package/dist/@common-rjsf-6UM_zh8b.js +0 -567
  107. package/dist/@framer-motion-DHY98qq3.js +0 -3437
  108. package/dist/@moment-C_WeV3Af.js +0 -2609
  109. package/dist/@monaco-editor-34kqzg3G.js +0 -70451
  110. package/dist/@react-dates-WNnwjI5S.js +0 -7708
  111. package/dist/@react-select-BbR996pa.js +0 -2636
  112. package/dist/@src-assets-images-DamVa6cS.js +0 -14
  113. package/dist/@vendor-RU8AW1bK.js +0 -20473
  114. package/dist/assets/@code-editor.css +0 -1
  115. package/dist/assets/@common-rjsf.css +0 -1
  116. package/dist/assets/@monaco-editor.css +0 -1
  117. package/dist/assets/@react-dates.css +0 -1
  118. package/dist/assets/@vendor.css +0 -1
@@ -1,3437 +0,0 @@
1
- import { e as ct, _ as m, g as I, l as Yr, n as we, p as T, o as at, q as zt, r as ae, t as Xe, v as J, w as kr, x as Qn, y as Xr, z as ti, B as ei, C as ri, D as ni, E as ii, F as Wr, G as ai, H as oi, I as si, K as ui, L as li, M as fi, N as ci, O as yt, P as k, S as pe, T as Zr, U as vi, V as di, W, X as $, Y as pi, Z as he, $ as Dt, a0 as hi, a1 as mi, a2 as $r, a3 as Mt, a4 as O, a5 as me, a6 as gi, a7 as oe, a8 as yi } from "./@vendor-RU8AW1bK.js";
2
- import * as K from "react";
3
- import Ee, { createContext as bt, useContext as F, useLayoutEffect as Pi, useEffect as G, useState as qr, useRef as q, useCallback as ge, useMemo as It, forwardRef as bi, createElement as Vi, cloneElement as Ti, Children as Si, isValidElement as xi } from "react";
4
- var We = "production", Le = typeof process > "u" || process.env === void 0 ? We : process.env.NODE_ENV || We, Q = function(t) {
5
- return {
6
- isEnabled: function(e) {
7
- return t.some(function(r) {
8
- return !!e[r];
9
- });
10
- }
11
- };
12
- }, Ot = {
13
- measureLayout: Q(["layout", "layoutId", "drag"]),
14
- animation: Q([
15
- "animate",
16
- "exit",
17
- "variants",
18
- "whileHover",
19
- "whileTap",
20
- "whileFocus",
21
- "whileDrag",
22
- "whileInView"
23
- ]),
24
- exit: Q(["exit"]),
25
- drag: Q(["drag", "dragControls"]),
26
- focus: Q(["whileFocus"]),
27
- hover: Q(["whileHover", "onHoverStart", "onHoverEnd"]),
28
- tap: Q(["whileTap", "onTap", "onTapStart", "onTapCancel"]),
29
- pan: Q([
30
- "onPan",
31
- "onPanStart",
32
- "onPanSessionStart",
33
- "onPanEnd"
34
- ]),
35
- inView: Q([
36
- "whileInView",
37
- "onViewportEnter",
38
- "onViewportLeave"
39
- ])
40
- };
41
- function Ci(t) {
42
- for (var e in t)
43
- t[e] !== null && (e === "projectionNodeConstructor" ? Ot.projectionNodeConstructor = t[e] : Ot[e].Component = t[e]);
44
- }
45
- var Jr = bt({ strict: !1 }), Qr = Object.keys(Ot), Ai = Qr.length;
46
- function wi(t, e, r) {
47
- var n = [], i = F(Jr);
48
- if (!e)
49
- return null;
50
- Le !== "production" && r && i.strict && ct(!1, "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.");
51
- for (var s = 0; s < Ai; s++) {
52
- var o = Qr[s], a = Ot[o], u = a.isEnabled, l = a.Component;
53
- u(t) && l && n.push(K.createElement(l, m({ key: o }, t, { visualElement: e })));
54
- }
55
- return n;
56
- }
57
- var Re = bt({
58
- transformPagePoint: function(t) {
59
- return t;
60
- },
61
- isStatic: !1,
62
- reducedMotion: "never"
63
- }), te = bt({});
64
- function Ei() {
65
- return F(te).visualElement;
66
- }
67
- var Bt = bt(null), Vt = typeof document < "u", Wt = Vt ? Pi : G, ye = { current: null }, tn = !1;
68
- function Li() {
69
- if (tn = !0, !!Vt)
70
- if (window.matchMedia) {
71
- var t = window.matchMedia("(prefers-reduced-motion)"), e = function() {
72
- return ye.current = t.matches;
73
- };
74
- t.addListener(e), e();
75
- } else
76
- ye.current = !1;
77
- }
78
- function Ri() {
79
- !tn && Li();
80
- var t = I(qr(ye.current), 1), e = t[0];
81
- return e;
82
- }
83
- function Di() {
84
- var t = Ri(), e = F(Re).reducedMotion;
85
- return e === "never" ? !1 : e === "always" ? !0 : t;
86
- }
87
- function Mi(t, e, r, n) {
88
- var i = F(Jr), s = Ei(), o = F(Bt), a = Di(), u = q(void 0);
89
- n || (n = i.renderer), !u.current && n && (u.current = n(t, {
90
- visualState: e,
91
- parent: s,
92
- props: r,
93
- presenceId: o?.id,
94
- blockInitialAnimation: o?.initial === !1,
95
- shouldReduceMotion: a
96
- }));
97
- var l = u.current;
98
- return Wt(function() {
99
- l?.syncRender();
100
- }), G(function() {
101
- var f;
102
- (f = l?.animationState) === null || f === void 0 || f.animateChanges();
103
- }), Wt(function() {
104
- return function() {
105
- return l?.notifyUnmount();
106
- };
107
- }, []), l;
108
- }
109
- function ht(t) {
110
- return typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
111
- }
112
- function Ii(t, e, r) {
113
- return ge(
114
- function(n) {
115
- var i;
116
- n && ((i = t.mount) === null || i === void 0 || i.call(t, n)), e && (n ? e.mount(n) : e.unmount()), r && (typeof r == "function" ? r(n) : ht(r) && (r.current = n));
117
- },
118
- /**
119
- * Only pass a new ref callback to React if we've received a visual element
120
- * factory. Otherwise we'll be mounting/remounting every time externalRef
121
- * or other dependencies change.
122
- */
123
- [e]
124
- );
125
- }
126
- function en(t) {
127
- return Array.isArray(t);
128
- }
129
- function X(t) {
130
- return typeof t == "string" || en(t);
131
- }
132
- function Oi(t) {
133
- var e = {};
134
- return t.forEachValue(function(r, n) {
135
- return e[n] = r.get();
136
- }), e;
137
- }
138
- function Fi(t) {
139
- var e = {};
140
- return t.forEachValue(function(r, n) {
141
- return e[n] = r.getVelocity();
142
- }), e;
143
- }
144
- function rn(t, e, r, n, i) {
145
- var s;
146
- return n === void 0 && (n = {}), i === void 0 && (i = {}), typeof e == "function" && (e = e(r ?? t.custom, n, i)), typeof e == "string" && (e = (s = t.variants) === null || s === void 0 ? void 0 : s[e]), typeof e == "function" && (e = e(r ?? t.custom, n, i)), e;
147
- }
148
- function ee(t, e, r) {
149
- var n = t.getProps();
150
- return rn(n, e, r ?? n.custom, Oi(t), Fi(t));
151
- }
152
- function re(t) {
153
- var e;
154
- return typeof ((e = t.animate) === null || e === void 0 ? void 0 : e.start) == "function" || X(t.initial) || X(t.animate) || X(t.whileHover) || X(t.whileDrag) || X(t.whileTap) || X(t.whileFocus) || X(t.exit);
155
- }
156
- function nn(t) {
157
- return !!(re(t) || t.variants);
158
- }
159
- function ji(t, e) {
160
- if (re(t)) {
161
- var r = t.initial, n = t.animate;
162
- return {
163
- initial: r === !1 || X(r) ? r : void 0,
164
- animate: X(n) ? n : void 0
165
- };
166
- }
167
- return t.inherit !== !1 ? e : {};
168
- }
169
- function Bi(t) {
170
- var e = ji(t, F(te)), r = e.initial, n = e.animate;
171
- return It(function() {
172
- return { initial: r, animate: n };
173
- }, [Ze(r), Ze(n)]);
174
- }
175
- function Ze(t) {
176
- return Array.isArray(t) ? t.join(" ") : t;
177
- }
178
- function _t(t) {
179
- var e = q(null);
180
- return e.current === null && (e.current = t()), e.current;
181
- }
182
- var At = {
183
- /**
184
- * Global flag as to whether the tree has animated since the last time
185
- * we resized the window
186
- */
187
- hasAnimatedSinceResize: !0,
188
- /**
189
- * We set this to true once, on the first update. Any nodes added to the tree beyond that
190
- * update will be given a `data-projection-id` attribute.
191
- */
192
- hasEverUpdated: !1
193
- }, _i = 1;
194
- function Ui() {
195
- return _t(function() {
196
- if (At.hasEverUpdated)
197
- return _i++;
198
- });
199
- }
200
- var De = bt({}), an = bt({});
201
- function Ni(t, e, r, n) {
202
- var i, s = e.layoutId, o = e.layout, a = e.drag, u = e.dragConstraints, l = e.layoutScroll, f = F(an);
203
- !n || !r || r?.projection || (r.projection = new n(t, r.getLatestValues(), (i = r.parent) === null || i === void 0 ? void 0 : i.projection), r.projection.setOptions({
204
- layoutId: s,
205
- layout: o,
206
- alwaysMeasureLayout: !!a || u && ht(u),
207
- visualElement: r,
208
- scheduleRender: function() {
209
- return r.scheduleRender();
210
- },
211
- /**
212
- * TODO: Update options in an effect. This could be tricky as it'll be too late
213
- * to update by the time layout animations run.
214
- * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
215
- * ensuring it gets called if there's no potential layout animations.
216
- *
217
- */
218
- animationType: typeof o == "string" ? o : "both",
219
- initialPromotionConfig: f,
220
- layoutScroll: l
221
- }));
222
- }
223
- var Hi = (
224
- /** @class */
225
- function(t) {
226
- Yr(e, t);
227
- function e() {
228
- return t !== null && t.apply(this, arguments) || this;
229
- }
230
- return e.prototype.getSnapshotBeforeUpdate = function() {
231
- return this.updateProps(), null;
232
- }, e.prototype.componentDidUpdate = function() {
233
- }, e.prototype.updateProps = function() {
234
- var r = this.props, n = r.visualElement, i = r.props;
235
- n && n.setProps(i);
236
- }, e.prototype.render = function() {
237
- return this.props.children;
238
- }, e;
239
- }(Ee.Component)
240
- );
241
- function zi(t) {
242
- var e = t.preloadedFeatures, r = t.createVisualElement, n = t.projectionNodeConstructor, i = t.useRender, s = t.useVisualState, o = t.Component;
243
- e && Ci(e);
244
- function a(u, l) {
245
- var f = Ki(u);
246
- u = m(m({}, u), { layoutId: f });
247
- var v = F(Re), c = null, d = Bi(u), p = v.isStatic ? void 0 : Ui(), h = s(u, v.isStatic);
248
- return !v.isStatic && Vt && (d.visualElement = Mi(o, h, m(m({}, v), u), r), Ni(p, u, d.visualElement, n || Ot.projectionNodeConstructor), c = wi(u, d.visualElement, e)), K.createElement(
249
- Hi,
250
- { visualElement: d.visualElement, props: m(m({}, v), u) },
251
- c,
252
- K.createElement(te.Provider, { value: d }, i(o, u, p, Ii(h, d.visualElement, l), h, v.isStatic, d.visualElement))
253
- );
254
- }
255
- return bi(a);
256
- }
257
- function Ki(t) {
258
- var e, r = t.layoutId, n = (e = F(De)) === null || e === void 0 ? void 0 : e.id;
259
- return n && r !== void 0 ? n + "-" + r : r;
260
- }
261
- function Gi(t) {
262
- function e(n, i) {
263
- return i === void 0 && (i = {}), zi(t(n, i));
264
- }
265
- if (typeof Proxy > "u")
266
- return e;
267
- var r = /* @__PURE__ */ new Map();
268
- return new Proxy(e, {
269
- /**
270
- * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
271
- * The prop name is passed through as `key` and we can use that to generate a `motion`
272
- * DOM component with that name.
273
- */
274
- get: function(n, i) {
275
- return r.has(i) || r.set(i, e(i)), r.get(i);
276
- }
277
- });
278
- }
279
- var Yi = [
280
- "animate",
281
- "circle",
282
- "defs",
283
- "desc",
284
- "ellipse",
285
- "g",
286
- "image",
287
- "line",
288
- "filter",
289
- "marker",
290
- "mask",
291
- "metadata",
292
- "path",
293
- "pattern",
294
- "polygon",
295
- "polyline",
296
- "rect",
297
- "stop",
298
- "svg",
299
- "switch",
300
- "symbol",
301
- "text",
302
- "tspan",
303
- "use",
304
- "view"
305
- ];
306
- function Me(t) {
307
- return (
308
- /**
309
- * If it's not a string, it's a custom React component. Currently we only support
310
- * HTML custom React components.
311
- */
312
- typeof t != "string" || /**
313
- * If it contains a dash, the element is a custom HTML webcomponent.
314
- */
315
- t.includes("-") ? !1 : (
316
- /**
317
- * If it's in our list of lowercase SVG tags, it's an SVG component
318
- */
319
- !!(Yi.indexOf(t) > -1 || /**
320
- * If it contains a capital letter, it's an SVG component
321
- */
322
- /[A-Z]/.test(t))
323
- )
324
- );
325
- }
326
- var Zt = {};
327
- function ki(t) {
328
- Object.assign(Zt, t);
329
- }
330
- var Pe = ["", "X", "Y", "Z"], Xi = ["translate", "scale", "rotate", "skew"], Ft = ["transformPerspective", "x", "y", "z"];
331
- Xi.forEach(function(t) {
332
- return Pe.forEach(function(e) {
333
- return Ft.push(t + e);
334
- });
335
- });
336
- function Wi(t, e) {
337
- return Ft.indexOf(t) - Ft.indexOf(e);
338
- }
339
- var Zi = new Set(Ft);
340
- function Ut(t) {
341
- return Zi.has(t);
342
- }
343
- var $i = /* @__PURE__ */ new Set(["originX", "originY", "originZ"]);
344
- function on(t) {
345
- return $i.has(t);
346
- }
347
- function sn(t, e) {
348
- var r = e.layout, n = e.layoutId;
349
- return Ut(t) || on(t) || (r || n !== void 0) && (!!Zt[t] || t === "opacity");
350
- }
351
- var tt = function(t) {
352
- return !!(t !== null && typeof t == "object" && t.getVelocity);
353
- }, qi = {
354
- x: "translateX",
355
- y: "translateY",
356
- z: "translateZ",
357
- transformPerspective: "perspective"
358
- };
359
- function Ji(t, e, r, n) {
360
- var i = t.transform, s = t.transformKeys, o = e.enableHardwareAcceleration, a = o === void 0 ? !0 : o, u = e.allowTransformNone, l = u === void 0 ? !0 : u, f = "";
361
- s.sort(Wi);
362
- for (var v = !1, c = s.length, d = 0; d < c; d++) {
363
- var p = s[d];
364
- f += "".concat(qi[p] || p, "(").concat(i[p], ") "), p === "z" && (v = !0);
365
- }
366
- return !v && a ? f += "translateZ(0)" : f = f.trim(), n ? f = n(i, r ? "" : f) : l && r && (f = "none"), f;
367
- }
368
- function Qi(t) {
369
- var e = t.originX, r = e === void 0 ? "50%" : e, n = t.originY, i = n === void 0 ? "50%" : n, s = t.originZ, o = s === void 0 ? 0 : s;
370
- return "".concat(r, " ").concat(i, " ").concat(o);
371
- }
372
- function un(t) {
373
- return t.startsWith("--");
374
- }
375
- var ta = function(t, e) {
376
- return e && typeof t == "number" ? e.transform(t) : t;
377
- }, $e = m(m({}, we), { transform: Math.round }), ln = {
378
- // Border props
379
- borderWidth: T,
380
- borderTopWidth: T,
381
- borderRightWidth: T,
382
- borderBottomWidth: T,
383
- borderLeftWidth: T,
384
- borderRadius: T,
385
- radius: T,
386
- borderTopLeftRadius: T,
387
- borderTopRightRadius: T,
388
- borderBottomRightRadius: T,
389
- borderBottomLeftRadius: T,
390
- // Positioning props
391
- width: T,
392
- maxWidth: T,
393
- height: T,
394
- maxHeight: T,
395
- size: T,
396
- top: T,
397
- right: T,
398
- bottom: T,
399
- left: T,
400
- // Spacing props
401
- padding: T,
402
- paddingTop: T,
403
- paddingRight: T,
404
- paddingBottom: T,
405
- paddingLeft: T,
406
- margin: T,
407
- marginTop: T,
408
- marginRight: T,
409
- marginBottom: T,
410
- marginLeft: T,
411
- // Transform props
412
- rotate: at,
413
- rotateX: at,
414
- rotateY: at,
415
- rotateZ: at,
416
- scale: zt,
417
- scaleX: zt,
418
- scaleY: zt,
419
- scaleZ: zt,
420
- skew: at,
421
- skewX: at,
422
- skewY: at,
423
- distance: T,
424
- translateX: T,
425
- translateY: T,
426
- translateZ: T,
427
- x: T,
428
- y: T,
429
- z: T,
430
- perspective: T,
431
- transformPerspective: T,
432
- opacity: ae,
433
- originX: Xe,
434
- originY: Xe,
435
- originZ: T,
436
- // Misc
437
- zIndex: $e,
438
- // SVG
439
- fillOpacity: ae,
440
- strokeOpacity: ae,
441
- numOctaves: $e
442
- };
443
- function Ie(t, e, r, n) {
444
- var i, s = t.style, o = t.vars, a = t.transform, u = t.transformKeys, l = t.transformOrigin;
445
- u.length = 0;
446
- var f = !1, v = !1, c = !0;
447
- for (var d in e) {
448
- var p = e[d];
449
- if (un(d)) {
450
- o[d] = p;
451
- continue;
452
- }
453
- var h = ln[d], g = ta(p, h);
454
- if (Ut(d)) {
455
- if (f = !0, a[d] = g, u.push(d), !c)
456
- continue;
457
- p !== ((i = h.default) !== null && i !== void 0 ? i : 0) && (c = !1);
458
- } else on(d) ? (l[d] = g, v = !0) : s[d] = g;
459
- }
460
- f ? s.transform = Ji(t, r, c, n) : n ? s.transform = n({}, "") : !e.transform && s.transform && (s.transform = "none"), v && (s.transformOrigin = Qi(l));
461
- }
462
- var Oe = function() {
463
- return {
464
- style: {},
465
- transform: {},
466
- transformKeys: [],
467
- transformOrigin: {},
468
- vars: {}
469
- };
470
- };
471
- function fn(t, e, r) {
472
- for (var n in e)
473
- !tt(e[n]) && !sn(n, r) && (t[n] = e[n]);
474
- }
475
- function ea(t, e, r) {
476
- var n = t.transformTemplate;
477
- return It(function() {
478
- var i = Oe();
479
- Ie(i, e, { enableHardwareAcceleration: !r }, n);
480
- var s = i.vars, o = i.style;
481
- return m(m({}, s), o);
482
- }, [e]);
483
- }
484
- function ra(t, e, r) {
485
- var n = t.style || {}, i = {};
486
- return fn(i, n, t), Object.assign(i, ea(t, e, r)), t.transformValues && (i = t.transformValues(i)), i;
487
- }
488
- function na(t, e, r) {
489
- var n = {}, i = ra(t, e, r);
490
- return t.drag && t.dragListener !== !1 && (n.draggable = !1, i.userSelect = i.WebkitUserSelect = i.WebkitTouchCallout = "none", i.touchAction = t.drag === !0 ? "none" : "pan-".concat(t.drag === "x" ? "y" : "x")), n.style = i, n;
491
- }
492
- var ia = /* @__PURE__ */ new Set([
493
- "initial",
494
- "animate",
495
- "exit",
496
- "style",
497
- "variants",
498
- "transition",
499
- "transformTemplate",
500
- "transformValues",
501
- "custom",
502
- "inherit",
503
- "layout",
504
- "layoutId",
505
- "layoutDependency",
506
- "onLayoutAnimationStart",
507
- "onLayoutAnimationComplete",
508
- "onLayoutMeasure",
509
- "onBeforeLayoutMeasure",
510
- "onAnimationStart",
511
- "onAnimationComplete",
512
- "onUpdate",
513
- "onDragStart",
514
- "onDrag",
515
- "onDragEnd",
516
- "onMeasureDragConstraints",
517
- "onDirectionLock",
518
- "onDragTransitionEnd",
519
- "drag",
520
- "dragControls",
521
- "dragListener",
522
- "dragConstraints",
523
- "dragDirectionLock",
524
- "dragSnapToOrigin",
525
- "_dragX",
526
- "_dragY",
527
- "dragElastic",
528
- "dragMomentum",
529
- "dragPropagation",
530
- "dragTransition",
531
- "whileDrag",
532
- "onPan",
533
- "onPanStart",
534
- "onPanEnd",
535
- "onPanSessionStart",
536
- "onTap",
537
- "onTapStart",
538
- "onTapCancel",
539
- "onHoverStart",
540
- "onHoverEnd",
541
- "whileFocus",
542
- "whileTap",
543
- "whileHover",
544
- "whileInView",
545
- "onViewportEnter",
546
- "onViewportLeave",
547
- "viewport",
548
- "layoutScroll"
549
- ]);
550
- function $t(t) {
551
- return ia.has(t);
552
- }
553
- var cn = function(t) {
554
- return !$t(t);
555
- };
556
- function aa(t) {
557
- t && (cn = function(e) {
558
- return e.startsWith("on") ? !$t(e) : t(e);
559
- });
560
- }
561
- try {
562
- aa(require("@emotion/is-prop-valid").default);
563
- } catch {
564
- }
565
- function oa(t, e, r) {
566
- var n = {};
567
- for (var i in t)
568
- (cn(i) || r === !0 && $t(i) || !e && !$t(i) || // If trying to use native HTML drag events, forward drag listeners
569
- t.draggable && i.startsWith("onDrag")) && (n[i] = t[i]);
570
- return n;
571
- }
572
- function qe(t, e, r) {
573
- return typeof t == "string" ? t : T.transform(e + r * t);
574
- }
575
- function sa(t, e, r) {
576
- var n = qe(e, t.x, t.width), i = qe(r, t.y, t.height);
577
- return "".concat(n, " ").concat(i);
578
- }
579
- var ua = {
580
- offset: "strokeDashoffset",
581
- array: "strokeDasharray"
582
- };
583
- function la(t, e, r, n, i) {
584
- r === void 0 && (r = 1), n === void 0 && (n = 0), t.pathLength = 1;
585
- var s = ua;
586
- t[s.offset] = T.transform(-n);
587
- var o = T.transform(e), a = T.transform(r);
588
- t[s.array] = "".concat(o, " ").concat(a);
589
- }
590
- function Fe(t, e, r, n) {
591
- var i = e.attrX, s = e.attrY, o = e.originX, a = e.originY, u = e.pathLength, l = e.pathSpacing, f = l === void 0 ? 1 : l, v = e.pathOffset, c = v === void 0 ? 0 : v, d = J(e, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]);
592
- Ie(t, d, r, n), t.attrs = t.style, t.style = {};
593
- var p = t.attrs, h = t.style, g = t.dimensions;
594
- p.transform && (g && (h.transform = p.transform), delete p.transform), g && (o !== void 0 || a !== void 0 || h.transform) && (h.transformOrigin = sa(g, o !== void 0 ? o : 0.5, a !== void 0 ? a : 0.5)), i !== void 0 && (p.x = i), s !== void 0 && (p.y = s), u !== void 0 && la(p, u, f, c);
595
- }
596
- var vn = function() {
597
- return m(m({}, Oe()), { attrs: {} });
598
- };
599
- function fa(t, e) {
600
- var r = It(function() {
601
- var i = vn();
602
- return Fe(i, e, { enableHardwareAcceleration: !1 }, t.transformTemplate), m(m({}, i.attrs), { style: m({}, i.style) });
603
- }, [e]);
604
- if (t.style) {
605
- var n = {};
606
- fn(n, t.style, t), r.style = m(m({}, n), r.style);
607
- }
608
- return r;
609
- }
610
- function ca(t) {
611
- t === void 0 && (t = !1);
612
- var e = function(r, n, i, s, o, a) {
613
- var u = o.latestValues, l = Me(r) ? fa : na, f = l(n, u, a), v = oa(n, typeof r == "string", t), c = m(m(m({}, v), f), { ref: s });
614
- return i && (c["data-projection-id"] = i), Vi(r, c);
615
- };
616
- return e;
617
- }
618
- var va = /([a-z])([A-Z])/g, da = "$1-$2", dn = function(t) {
619
- return t.replace(va, da).toLowerCase();
620
- };
621
- function pn(t, e, r, n) {
622
- var i = e.style, s = e.vars;
623
- Object.assign(t.style, i, n && n.getProjectionStyles(r));
624
- for (var o in s)
625
- t.style.setProperty(o, s[o]);
626
- }
627
- var hn = /* @__PURE__ */ new Set([
628
- "baseFrequency",
629
- "diffuseConstant",
630
- "kernelMatrix",
631
- "kernelUnitLength",
632
- "keySplines",
633
- "keyTimes",
634
- "limitingConeAngle",
635
- "markerHeight",
636
- "markerWidth",
637
- "numOctaves",
638
- "targetX",
639
- "targetY",
640
- "surfaceScale",
641
- "specularConstant",
642
- "specularExponent",
643
- "stdDeviation",
644
- "tableValues",
645
- "viewBox",
646
- "gradientTransform",
647
- "pathLength"
648
- ]);
649
- function mn(t, e, r, n) {
650
- pn(t, e, void 0, n);
651
- for (var i in e.attrs)
652
- t.setAttribute(hn.has(i) ? i : dn(i), e.attrs[i]);
653
- }
654
- function je(t) {
655
- var e = t.style, r = {};
656
- for (var n in e)
657
- (tt(e[n]) || sn(n, t)) && (r[n] = e[n]);
658
- return r;
659
- }
660
- function gn(t) {
661
- var e = je(t);
662
- for (var r in t)
663
- if (tt(t[r])) {
664
- var n = r === "x" || r === "y" ? "attr" + r.toUpperCase() : r;
665
- e[n] = t[r];
666
- }
667
- return e;
668
- }
669
- function Be(t) {
670
- return typeof t == "object" && typeof t.start == "function";
671
- }
672
- var jt = function(t) {
673
- return Array.isArray(t);
674
- }, pa = function(t) {
675
- return !!(t && typeof t == "object" && t.mix && t.toValue);
676
- }, yn = function(t) {
677
- return jt(t) ? t[t.length - 1] || 0 : t;
678
- };
679
- function Xt(t) {
680
- var e = tt(t) ? t.get() : t;
681
- return pa(e) ? e.toValue() : e;
682
- }
683
- function Je(t, e, r, n) {
684
- var i = t.scrapeMotionValuesFromProps, s = t.createRenderState, o = t.onMount, a = {
685
- latestValues: ha(e, r, n, i),
686
- renderState: s()
687
- };
688
- return o && (a.mount = function(u) {
689
- return o(e, u, a);
690
- }), a;
691
- }
692
- var Pn = function(t) {
693
- return function(e, r) {
694
- var n = F(te), i = F(Bt);
695
- return r ? Je(t, e, n, i) : _t(function() {
696
- return Je(t, e, n, i);
697
- });
698
- };
699
- };
700
- function ha(t, e, r, n) {
701
- var i = {}, s = r?.initial === !1, o = n(t);
702
- for (var a in o)
703
- i[a] = Xt(o[a]);
704
- var u = t.initial, l = t.animate, f = re(t), v = nn(t);
705
- e && v && !f && t.inherit !== !1 && (u ?? (u = e.initial), l ?? (l = e.animate));
706
- var c = s || u === !1, d = c ? l : u;
707
- if (d && typeof d != "boolean" && !Be(d)) {
708
- var p = Array.isArray(d) ? d : [d];
709
- p.forEach(function(h) {
710
- var g = rn(t, h);
711
- if (g) {
712
- var P = g.transitionEnd;
713
- g.transition;
714
- var b = J(g, ["transitionEnd", "transition"]);
715
- for (var S in b) {
716
- var C = b[S];
717
- if (Array.isArray(C)) {
718
- var A = c ? C.length - 1 : 0;
719
- C = C[A];
720
- }
721
- C !== null && (i[S] = C);
722
- }
723
- for (var S in P)
724
- i[S] = P[S];
725
- }
726
- });
727
- }
728
- return i;
729
- }
730
- var ma = {
731
- useVisualState: Pn({
732
- scrapeMotionValuesFromProps: gn,
733
- createRenderState: vn,
734
- onMount: function(t, e, r) {
735
- var n = r.renderState, i = r.latestValues;
736
- try {
737
- n.dimensions = typeof e.getBBox == "function" ? e.getBBox() : e.getBoundingClientRect();
738
- } catch {
739
- n.dimensions = {
740
- x: 0,
741
- y: 0,
742
- width: 0,
743
- height: 0
744
- };
745
- }
746
- Fe(n, i, { enableHardwareAcceleration: !1 }, t.transformTemplate), mn(e, n);
747
- }
748
- })
749
- }, ga = {
750
- useVisualState: Pn({
751
- scrapeMotionValuesFromProps: je,
752
- createRenderState: Oe
753
- })
754
- };
755
- function ya(t, e, r, n, i) {
756
- var s = e.forwardMotionProps, o = s === void 0 ? !1 : s, a = Me(t) ? ma : ga;
757
- return m(m({}, a), { preloadedFeatures: r, useRender: ca(o), createVisualElement: n, projectionNodeConstructor: i, Component: t });
758
- }
759
- var L;
760
- (function(t) {
761
- t.Animate = "animate", t.Hover = "whileHover", t.Tap = "whileTap", t.Drag = "whileDrag", t.Focus = "whileFocus", t.InView = "whileInView", t.Exit = "exit";
762
- })(L || (L = {}));
763
- function ne(t, e, r, n) {
764
- return n === void 0 && (n = { passive: !0 }), t.addEventListener(e, r, n), function() {
765
- return t.removeEventListener(e, r);
766
- };
767
- }
768
- function be(t, e, r, n) {
769
- G(function() {
770
- var i = t.current;
771
- if (r && i)
772
- return ne(i, e, r, n);
773
- }, [t, e, r, n]);
774
- }
775
- function Pa(t) {
776
- var e = t.whileFocus, r = t.visualElement, n = function() {
777
- var s;
778
- (s = r.animationState) === null || s === void 0 || s.setActive(L.Focus, !0);
779
- }, i = function() {
780
- var s;
781
- (s = r.animationState) === null || s === void 0 || s.setActive(L.Focus, !1);
782
- };
783
- be(r, "focus", e ? n : void 0), be(r, "blur", e ? i : void 0);
784
- }
785
- function bn(t) {
786
- return typeof PointerEvent < "u" && t instanceof PointerEvent ? t.pointerType === "mouse" : t instanceof MouseEvent;
787
- }
788
- function Vn(t) {
789
- var e = !!t.touches;
790
- return e;
791
- }
792
- function ba(t) {
793
- return function(e) {
794
- var r = e instanceof MouseEvent, n = !r || r && e.button === 0;
795
- n && t(e);
796
- };
797
- }
798
- var Va = { pageX: 0, pageY: 0 };
799
- function Ta(t, e) {
800
- e === void 0 && (e = "page");
801
- var r = t.touches[0] || t.changedTouches[0], n = r || Va;
802
- return {
803
- x: n[e + "X"],
804
- y: n[e + "Y"]
805
- };
806
- }
807
- function Sa(t, e) {
808
- return e === void 0 && (e = "page"), {
809
- x: t[e + "X"],
810
- y: t[e + "Y"]
811
- };
812
- }
813
- function _e(t, e) {
814
- return e === void 0 && (e = "page"), {
815
- point: Vn(t) ? Ta(t, e) : Sa(t, e)
816
- };
817
- }
818
- var Tn = function(t, e) {
819
- e === void 0 && (e = !1);
820
- var r = function(n) {
821
- return t(n, _e(n));
822
- };
823
- return e ? ba(r) : r;
824
- }, xa = function() {
825
- return Vt && window.onpointerdown === null;
826
- }, Ca = function() {
827
- return Vt && window.ontouchstart === null;
828
- }, Aa = function() {
829
- return Vt && window.onmousedown === null;
830
- }, wa = {
831
- pointerdown: "mousedown",
832
- pointermove: "mousemove",
833
- pointerup: "mouseup",
834
- pointercancel: "mousecancel",
835
- pointerover: "mouseover",
836
- pointerout: "mouseout",
837
- pointerenter: "mouseenter",
838
- pointerleave: "mouseleave"
839
- }, Ea = {
840
- pointerdown: "touchstart",
841
- pointermove: "touchmove",
842
- pointerup: "touchend",
843
- pointercancel: "touchcancel"
844
- };
845
- function Sn(t) {
846
- return xa() ? t : Ca() ? Ea[t] : Aa() ? wa[t] : t;
847
- }
848
- function gt(t, e, r, n) {
849
- return ne(t, Sn(e), Tn(r, e === "pointerdown"), n);
850
- }
851
- function qt(t, e, r, n) {
852
- return be(t, Sn(e), r && Tn(r, e === "pointerdown"), n);
853
- }
854
- function xn(t) {
855
- var e = null;
856
- return function() {
857
- var r = function() {
858
- e = null;
859
- };
860
- return e === null ? (e = t, r) : !1;
861
- };
862
- }
863
- var Qe = xn("dragHorizontal"), tr = xn("dragVertical");
864
- function Cn(t) {
865
- var e = !1;
866
- if (t === "y")
867
- e = tr();
868
- else if (t === "x")
869
- e = Qe();
870
- else {
871
- var r = Qe(), n = tr();
872
- r && n ? e = function() {
873
- r(), n();
874
- } : (r && r(), n && n());
875
- }
876
- return e;
877
- }
878
- function An() {
879
- var t = Cn(!0);
880
- return t ? (t(), !1) : !0;
881
- }
882
- function er(t, e, r) {
883
- return function(n, i) {
884
- var s;
885
- !bn(n) || An() || ((s = t.animationState) === null || s === void 0 || s.setActive(L.Hover, e), r?.(n, i));
886
- };
887
- }
888
- function La(t) {
889
- var e = t.onHoverStart, r = t.onHoverEnd, n = t.whileHover, i = t.visualElement;
890
- qt(i, "pointerenter", e || n ? er(i, !0, e) : void 0, { passive: !e }), qt(i, "pointerleave", r || n ? er(i, !1, r) : void 0, { passive: !r });
891
- }
892
- var wn = function(t, e) {
893
- return e ? t === e ? !0 : wn(t, e.parentElement) : !1;
894
- };
895
- function Ue(t) {
896
- return G(function() {
897
- return function() {
898
- return t();
899
- };
900
- }, []);
901
- }
902
- function Ra(t) {
903
- var e = t.onTap, r = t.onTapStart, n = t.onTapCancel, i = t.whileTap, s = t.visualElement, o = e || r || n || i, a = q(!1), u = q(null), l = {
904
- passive: !(r || e || n || p)
905
- };
906
- function f() {
907
- var h;
908
- (h = u.current) === null || h === void 0 || h.call(u), u.current = null;
909
- }
910
- function v() {
911
- var h;
912
- return f(), a.current = !1, (h = s.animationState) === null || h === void 0 || h.setActive(L.Tap, !1), !An();
913
- }
914
- function c(h, g) {
915
- v() && (wn(s.getInstance(), h.target) ? e?.(h, g) : n?.(h, g));
916
- }
917
- function d(h, g) {
918
- v() && n?.(h, g);
919
- }
920
- function p(h, g) {
921
- var P;
922
- f(), !a.current && (a.current = !0, u.current = kr(gt(window, "pointerup", c, l), gt(window, "pointercancel", d, l)), (P = s.animationState) === null || P === void 0 || P.setActive(L.Tap, !0), r?.(h, g));
923
- }
924
- qt(s, "pointerdown", o ? p : void 0, l), Ue(f);
925
- }
926
- var rr = /* @__PURE__ */ new Set();
927
- function En(t, e, r) {
928
- t || rr.has(e) || (console.warn(e), rr.add(e));
929
- }
930
- var Ve = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), Da = function(t) {
931
- var e;
932
- (e = Ve.get(t.target)) === null || e === void 0 || e(t);
933
- }, Ma = function(t) {
934
- t.forEach(Da);
935
- };
936
- function Ia(t) {
937
- var e = t.root, r = J(t, ["root"]), n = e || document;
938
- se.has(n) || se.set(n, {});
939
- var i = se.get(n), s = JSON.stringify(r);
940
- return i[s] || (i[s] = new IntersectionObserver(Ma, m({ root: e }, r))), i[s];
941
- }
942
- function Oa(t, e, r) {
943
- var n = Ia(e);
944
- return Ve.set(t, r), n.observe(t), function() {
945
- Ve.delete(t), n.unobserve(t);
946
- };
947
- }
948
- function Fa(t) {
949
- var e = t.visualElement, r = t.whileInView, n = t.onViewportEnter, i = t.onViewportLeave, s = t.viewport, o = s === void 0 ? {} : s, a = q({
950
- hasEnteredView: !1,
951
- isInView: !1
952
- }), u = !!(r || n || i);
953
- o.once && a.current.hasEnteredView && (u = !1);
954
- var l = typeof IntersectionObserver > "u" ? _a : Ba;
955
- l(u, a.current, e, o);
956
- }
957
- var ja = {
958
- some: 0,
959
- all: 1
960
- };
961
- function Ba(t, e, r, n) {
962
- var i = n.root, s = n.margin, o = n.amount, a = o === void 0 ? "some" : o, u = n.once;
963
- G(function() {
964
- if (t) {
965
- var l = {
966
- root: i?.current,
967
- rootMargin: s,
968
- threshold: typeof a == "number" ? a : ja[a]
969
- }, f = function(v) {
970
- var c, d = v.isIntersecting;
971
- if (e.isInView !== d && (e.isInView = d, !(u && !d && e.hasEnteredView))) {
972
- d && (e.hasEnteredView = !0), (c = r.animationState) === null || c === void 0 || c.setActive(L.InView, d);
973
- var p = r.getProps(), h = d ? p.onViewportEnter : p.onViewportLeave;
974
- h?.(v);
975
- }
976
- };
977
- return Oa(r.getInstance(), l, f);
978
- }
979
- }, [t, i, s, a]);
980
- }
981
- function _a(t, e, r, n) {
982
- var i = n.fallback, s = i === void 0 ? !0 : i;
983
- G(function() {
984
- !t || !s || (Le !== "production" && En(!1, "IntersectionObserver not available on this device. whileInView animations will trigger on mount."), requestAnimationFrame(function() {
985
- var o;
986
- e.hasEnteredView = !0;
987
- var a = r.getProps().onViewportEnter;
988
- a?.(null), (o = r.animationState) === null || o === void 0 || o.setActive(L.InView, !0);
989
- }));
990
- }, [t]);
991
- }
992
- var ut = function(t) {
993
- return function(e) {
994
- return t(e), null;
995
- };
996
- }, Ua = {
997
- inView: ut(Fa),
998
- tap: ut(Ra),
999
- focus: ut(Pa),
1000
- hover: ut(La)
1001
- }, Na = 0, Ha = function() {
1002
- return Na++;
1003
- }, Ln = function() {
1004
- return _t(Ha);
1005
- };
1006
- function Rn() {
1007
- var t = F(Bt);
1008
- if (t === null)
1009
- return [!0, null];
1010
- var e = t.isPresent, r = t.onExitComplete, n = t.register, i = Ln();
1011
- G(function() {
1012
- return n(i);
1013
- }, []);
1014
- var s = function() {
1015
- return r?.(i);
1016
- };
1017
- return !e && r ? [!1, s] : [!0];
1018
- }
1019
- function Dn(t, e) {
1020
- if (!Array.isArray(e))
1021
- return !1;
1022
- var r = e.length;
1023
- if (r !== t.length)
1024
- return !1;
1025
- for (var n = 0; n < r; n++)
1026
- if (e[n] !== t[n])
1027
- return !1;
1028
- return !0;
1029
- }
1030
- var Jt = function(t) {
1031
- return t * 1e3;
1032
- }, nr = {
1033
- linear: Xr,
1034
- easeIn: ti,
1035
- easeInOut: ei,
1036
- easeOut: ri,
1037
- circIn: ni,
1038
- circInOut: ii,
1039
- circOut: Wr,
1040
- backIn: ai,
1041
- backInOut: oi,
1042
- backOut: si,
1043
- anticipate: ui,
1044
- bounceIn: li,
1045
- bounceInOut: fi,
1046
- bounceOut: ci
1047
- }, ir = function(t) {
1048
- if (Array.isArray(t)) {
1049
- ct(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
1050
- var e = I(t, 4), r = e[0], n = e[1], i = e[2], s = e[3];
1051
- return Qn(r, n, i, s);
1052
- } else if (typeof t == "string")
1053
- return ct(nr[t] !== void 0, "Invalid easing type '".concat(t, "'")), nr[t];
1054
- return t;
1055
- }, za = function(t) {
1056
- return Array.isArray(t) && typeof t[0] != "number";
1057
- }, ar = function(t, e) {
1058
- return t === "zIndex" ? !1 : !!(typeof e == "number" || Array.isArray(e) || typeof e == "string" && // It's animatable if we have a string
1059
- yt.test(e) && // And it contains numbers and/or colors
1060
- !e.startsWith("url("));
1061
- }, lt = function() {
1062
- return {
1063
- type: "spring",
1064
- stiffness: 500,
1065
- damping: 25,
1066
- restSpeed: 10
1067
- };
1068
- }, Kt = function(t) {
1069
- return {
1070
- type: "spring",
1071
- stiffness: 550,
1072
- damping: t === 0 ? 2 * Math.sqrt(550) : 30,
1073
- restSpeed: 10
1074
- };
1075
- }, ue = function() {
1076
- return {
1077
- type: "keyframes",
1078
- ease: "linear",
1079
- duration: 0.3
1080
- };
1081
- }, Ka = function(t) {
1082
- return {
1083
- type: "keyframes",
1084
- duration: 0.8,
1085
- values: t
1086
- };
1087
- }, or = {
1088
- x: lt,
1089
- y: lt,
1090
- z: lt,
1091
- rotate: lt,
1092
- rotateX: lt,
1093
- rotateY: lt,
1094
- rotateZ: lt,
1095
- scaleX: Kt,
1096
- scaleY: Kt,
1097
- scale: Kt,
1098
- opacity: ue,
1099
- backgroundColor: ue,
1100
- color: ue,
1101
- default: Kt
1102
- }, Ga = function(t, e) {
1103
- var r;
1104
- return jt(e) ? r = Ka : r = or[t] || or.default, m({ to: e }, r(e));
1105
- }, Ya = m(m({}, ln), {
1106
- // Color props
1107
- color: k,
1108
- backgroundColor: k,
1109
- outlineColor: k,
1110
- fill: k,
1111
- stroke: k,
1112
- // Border props
1113
- borderColor: k,
1114
- borderTopColor: k,
1115
- borderRightColor: k,
1116
- borderBottomColor: k,
1117
- borderLeftColor: k,
1118
- filter: pe,
1119
- WebkitFilter: pe
1120
- }), Ne = function(t) {
1121
- return Ya[t];
1122
- };
1123
- function He(t, e) {
1124
- var r, n = Ne(t);
1125
- return n !== pe && (n = yt), (r = n.getAnimatableNone) === null || r === void 0 ? void 0 : r.call(n, e);
1126
- }
1127
- function ka(t) {
1128
- t.when, t.delay, t.delayChildren, t.staggerChildren, t.staggerDirection, t.repeat, t.repeatType, t.repeatDelay, t.from;
1129
- var e = J(t, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from"]);
1130
- return !!Object.keys(e).length;
1131
- }
1132
- var sr = !1;
1133
- function Xa(t) {
1134
- var e = t.ease, r = t.times, n = t.yoyo, i = t.flip, s = t.loop, o = J(t, ["ease", "times", "yoyo", "flip", "loop"]), a = m({}, o);
1135
- return r && (a.offset = r), o.duration && (a.duration = Jt(o.duration)), o.repeatDelay && (a.repeatDelay = Jt(o.repeatDelay)), e && (a.ease = za(e) ? e.map(ir) : ir(e)), o.type === "tween" && (a.type = "keyframes"), (n || s || i) && (Zr(!sr, "yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."), sr = !0, n ? a.repeatType = "reverse" : s ? a.repeatType = "loop" : i && (a.repeatType = "mirror"), a.repeat = s || n || i || o.repeat), o.type !== "spring" && (a.type = "keyframes"), a;
1136
- }
1137
- function Wa(t, e) {
1138
- var r, n, i = ze(t, e) || {};
1139
- return (n = (r = i.delay) !== null && r !== void 0 ? r : t.delay) !== null && n !== void 0 ? n : 0;
1140
- }
1141
- function Za(t) {
1142
- return Array.isArray(t.to) && t.to[0] === null && (t.to = W([], I(t.to), !1), t.to[0] = t.from), t;
1143
- }
1144
- function $a(t, e, r) {
1145
- var n;
1146
- return Array.isArray(e.to) && ((n = t.duration) !== null && n !== void 0 || (t.duration = 0.8)), Za(e), ka(t) || (t = m(m({}, t), Ga(r, e.to))), m(m({}, e), Xa(t));
1147
- }
1148
- function qa(t, e, r, n, i) {
1149
- var s, o = ze(n, t), a = (s = o.from) !== null && s !== void 0 ? s : e.get(), u = ar(t, r);
1150
- a === "none" && u && typeof r == "string" ? a = He(t, r) : ur(a) && typeof r == "string" ? a = lr(r) : !Array.isArray(r) && ur(r) && typeof a == "string" && (r = lr(a));
1151
- var l = ar(t, a);
1152
- Zr(l === u, "You are trying to animate ".concat(t, ' from "').concat(a, '" to "').concat(r, '". ').concat(a, " is not an animatable value - to enable this animation set ").concat(a, " to a value animatable to ").concat(r, " via the `style` property."));
1153
- function f() {
1154
- var c = {
1155
- from: a,
1156
- to: r,
1157
- velocity: e.getVelocity(),
1158
- onComplete: i,
1159
- onUpdate: function(d) {
1160
- return e.set(d);
1161
- }
1162
- };
1163
- return o.type === "inertia" || o.type === "decay" ? vi(m(m({}, c), o)) : di(m(m({}, $a(o, c, t)), { onUpdate: function(d) {
1164
- var p;
1165
- c.onUpdate(d), (p = o.onUpdate) === null || p === void 0 || p.call(o, d);
1166
- }, onComplete: function() {
1167
- var d;
1168
- c.onComplete(), (d = o.onComplete) === null || d === void 0 || d.call(o);
1169
- } }));
1170
- }
1171
- function v() {
1172
- var c, d, p = yn(r);
1173
- return e.set(p), i(), (c = o?.onUpdate) === null || c === void 0 || c.call(o, p), (d = o?.onComplete) === null || d === void 0 || d.call(o), { stop: function() {
1174
- } };
1175
- }
1176
- return !l || !u || o.type === !1 ? v : f;
1177
- }
1178
- function ur(t) {
1179
- return t === 0 || typeof t == "string" && parseFloat(t) === 0 && t.indexOf(" ") === -1;
1180
- }
1181
- function lr(t) {
1182
- return typeof t == "number" ? 0 : He("", t);
1183
- }
1184
- function ze(t, e) {
1185
- return t[e] || t.default || t;
1186
- }
1187
- function Ke(t, e, r, n) {
1188
- return n === void 0 && (n = {}), e.start(function(i) {
1189
- var s, o, a = qa(t, e, r, n, i), u = Wa(n, t), l = function() {
1190
- return o = a();
1191
- };
1192
- return u ? s = window.setTimeout(l, Jt(u)) : l(), function() {
1193
- clearTimeout(s), o?.stop();
1194
- };
1195
- });
1196
- }
1197
- var Ja = function(t) {
1198
- return /^\-?\d*\.?\d+$/.test(t);
1199
- }, Qa = function(t) {
1200
- return /^0[^.\s]+$/.test(t);
1201
- };
1202
- function Ge(t, e) {
1203
- t.indexOf(e) === -1 && t.push(e);
1204
- }
1205
- function Ye(t, e) {
1206
- var r = t.indexOf(e);
1207
- r > -1 && t.splice(r, 1);
1208
- }
1209
- var wt = (
1210
- /** @class */
1211
- function() {
1212
- function t() {
1213
- this.subscriptions = [];
1214
- }
1215
- return t.prototype.add = function(e) {
1216
- var r = this;
1217
- return Ge(this.subscriptions, e), function() {
1218
- return Ye(r.subscriptions, e);
1219
- };
1220
- }, t.prototype.notify = function(e, r, n) {
1221
- var i = this.subscriptions.length;
1222
- if (i)
1223
- if (i === 1)
1224
- this.subscriptions[0](e, r, n);
1225
- else
1226
- for (var s = 0; s < i; s++) {
1227
- var o = this.subscriptions[s];
1228
- o && o(e, r, n);
1229
- }
1230
- }, t.prototype.getSize = function() {
1231
- return this.subscriptions.length;
1232
- }, t.prototype.clear = function() {
1233
- this.subscriptions.length = 0;
1234
- }, t;
1235
- }()
1236
- ), to = function(t) {
1237
- return !isNaN(parseFloat(t));
1238
- }, eo = (
1239
- /** @class */
1240
- function() {
1241
- function t(e) {
1242
- var r = this;
1243
- this.version = "6.5.1", this.timeDelta = 0, this.lastUpdated = 0, this.updateSubscribers = new wt(), this.velocityUpdateSubscribers = new wt(), this.renderSubscribers = new wt(), this.canTrackVelocity = !1, this.updateAndNotify = function(n, i) {
1244
- i === void 0 && (i = !0), r.prev = r.current, r.current = n;
1245
- var s = he(), o = s.delta, a = s.timestamp;
1246
- r.lastUpdated !== a && (r.timeDelta = o, r.lastUpdated = a, $.postRender(r.scheduleVelocityCheck)), r.prev !== r.current && r.updateSubscribers.notify(r.current), r.velocityUpdateSubscribers.getSize() && r.velocityUpdateSubscribers.notify(r.getVelocity()), i && r.renderSubscribers.notify(r.current);
1247
- }, this.scheduleVelocityCheck = function() {
1248
- return $.postRender(r.velocityCheck);
1249
- }, this.velocityCheck = function(n) {
1250
- var i = n.timestamp;
1251
- i !== r.lastUpdated && (r.prev = r.current, r.velocityUpdateSubscribers.notify(r.getVelocity()));
1252
- }, this.hasAnimated = !1, this.prev = this.current = e, this.canTrackVelocity = to(this.current);
1253
- }
1254
- return t.prototype.onChange = function(e) {
1255
- return this.updateSubscribers.add(e);
1256
- }, t.prototype.clearListeners = function() {
1257
- this.updateSubscribers.clear();
1258
- }, t.prototype.onRenderRequest = function(e) {
1259
- return e(this.get()), this.renderSubscribers.add(e);
1260
- }, t.prototype.attach = function(e) {
1261
- this.passiveEffect = e;
1262
- }, t.prototype.set = function(e, r) {
1263
- r === void 0 && (r = !0), !r || !this.passiveEffect ? this.updateAndNotify(e, r) : this.passiveEffect(e, this.updateAndNotify);
1264
- }, t.prototype.get = function() {
1265
- return this.current;
1266
- }, t.prototype.getPrevious = function() {
1267
- return this.prev;
1268
- }, t.prototype.getVelocity = function() {
1269
- return this.canTrackVelocity ? (
1270
- // These casts could be avoided if parseFloat would be typed better
1271
- pi(parseFloat(this.current) - parseFloat(this.prev), this.timeDelta)
1272
- ) : 0;
1273
- }, t.prototype.start = function(e) {
1274
- var r = this;
1275
- return this.stop(), new Promise(function(n) {
1276
- r.hasAnimated = !0, r.stopAnimation = e(n);
1277
- }).then(function() {
1278
- return r.clearAnimation();
1279
- });
1280
- }, t.prototype.stop = function() {
1281
- this.stopAnimation && this.stopAnimation(), this.clearAnimation();
1282
- }, t.prototype.isAnimating = function() {
1283
- return !!this.stopAnimation;
1284
- }, t.prototype.clearAnimation = function() {
1285
- this.stopAnimation = null;
1286
- }, t.prototype.destroy = function() {
1287
- this.updateSubscribers.clear(), this.renderSubscribers.clear(), this.stop();
1288
- }, t;
1289
- }()
1290
- );
1291
- function Pt(t) {
1292
- return new eo(t);
1293
- }
1294
- var Mn = function(t) {
1295
- return function(e) {
1296
- return e.test(t);
1297
- };
1298
- }, ro = {
1299
- test: function(t) {
1300
- return t === "auto";
1301
- },
1302
- parse: function(t) {
1303
- return t;
1304
- }
1305
- }, In = [we, T, Dt, at, hi, mi, ro], xt = function(t) {
1306
- return In.find(Mn(t));
1307
- }, no = W(W([], I(In), !1), [k, yt], !1), io = function(t) {
1308
- return no.find(Mn(t));
1309
- };
1310
- function ao(t, e, r) {
1311
- t.hasValue(e) ? t.getValue(e).set(r) : t.addValue(e, Pt(r));
1312
- }
1313
- function oo(t, e) {
1314
- var r = ee(t, e), n = r ? t.makeTargetAnimatable(r, !1) : {}, i = n.transitionEnd, s = i === void 0 ? {} : i;
1315
- n.transition;
1316
- var o = J(n, ["transitionEnd", "transition"]);
1317
- o = m(m({}, o), s);
1318
- for (var a in o) {
1319
- var u = yn(o[a]);
1320
- ao(t, a, u);
1321
- }
1322
- }
1323
- function so(t, e, r) {
1324
- var n, i, s, o, a = Object.keys(e).filter(function(d) {
1325
- return !t.hasValue(d);
1326
- }), u = a.length;
1327
- if (u)
1328
- for (var l = 0; l < u; l++) {
1329
- var f = a[l], v = e[f], c = null;
1330
- Array.isArray(v) && (c = v[0]), c === null && (c = (i = (n = r[f]) !== null && n !== void 0 ? n : t.readValue(f)) !== null && i !== void 0 ? i : e[f]), c != null && (typeof c == "string" && (Ja(c) || Qa(c)) ? c = parseFloat(c) : !io(c) && yt.test(v) && (c = He(f, v)), t.addValue(f, Pt(c)), (s = (o = r)[f]) !== null && s !== void 0 || (o[f] = c), t.setBaseTarget(f, c));
1331
- }
1332
- }
1333
- function uo(t, e) {
1334
- if (e) {
1335
- var r = e[t] || e.default || e;
1336
- return r.from;
1337
- }
1338
- }
1339
- function lo(t, e, r) {
1340
- var n, i, s = {};
1341
- for (var o in t)
1342
- s[o] = (n = uo(o, e)) !== null && n !== void 0 ? n : (i = r.getValue(o)) === null || i === void 0 ? void 0 : i.get();
1343
- return s;
1344
- }
1345
- function fo(t, e, r) {
1346
- r === void 0 && (r = {}), t.notifyAnimationStart(e);
1347
- var n;
1348
- if (Array.isArray(e)) {
1349
- var i = e.map(function(o) {
1350
- return Te(t, o, r);
1351
- });
1352
- n = Promise.all(i);
1353
- } else if (typeof e == "string")
1354
- n = Te(t, e, r);
1355
- else {
1356
- var s = typeof e == "function" ? ee(t, e, r.custom) : e;
1357
- n = On(t, s, r);
1358
- }
1359
- return n.then(function() {
1360
- return t.notifyAnimationComplete(e);
1361
- });
1362
- }
1363
- function Te(t, e, r) {
1364
- var n;
1365
- r === void 0 && (r = {});
1366
- var i = ee(t, e, r.custom), s = (i || {}).transition, o = s === void 0 ? t.getDefaultTransition() || {} : s;
1367
- r.transitionOverride && (o = r.transitionOverride);
1368
- var a = i ? function() {
1369
- return On(t, i, r);
1370
- } : function() {
1371
- return Promise.resolve();
1372
- }, u = !((n = t.variantChildren) === null || n === void 0) && n.size ? function(d) {
1373
- d === void 0 && (d = 0);
1374
- var p = o.delayChildren, h = p === void 0 ? 0 : p, g = o.staggerChildren, P = o.staggerDirection;
1375
- return co(t, e, h + d, g, P, r);
1376
- } : function() {
1377
- return Promise.resolve();
1378
- }, l = o.when;
1379
- if (l) {
1380
- var f = I(l === "beforeChildren" ? [a, u] : [u, a], 2), v = f[0], c = f[1];
1381
- return v().then(c);
1382
- } else
1383
- return Promise.all([a(), u(r.delay)]);
1384
- }
1385
- function On(t, e, r) {
1386
- var n, i = r === void 0 ? {} : r, s = i.delay, o = s === void 0 ? 0 : s, a = i.transitionOverride, u = i.type, l = t.makeTargetAnimatable(e), f = l.transition, v = f === void 0 ? t.getDefaultTransition() : f, c = l.transitionEnd, d = J(l, ["transition", "transitionEnd"]);
1387
- a && (v = a);
1388
- var p = [], h = u && ((n = t.animationState) === null || n === void 0 ? void 0 : n.getState()[u]);
1389
- for (var g in d) {
1390
- var P = t.getValue(g), b = d[g];
1391
- if (!(!P || b === void 0 || h && po(h, g))) {
1392
- var S = m({ delay: o }, v);
1393
- t.shouldReduceMotion && Ut(g) && (S = m(m({}, S), { type: !1, delay: 0 }));
1394
- var C = Ke(g, P, b, S);
1395
- p.push(C);
1396
- }
1397
- }
1398
- return Promise.all(p).then(function() {
1399
- c && oo(t, c);
1400
- });
1401
- }
1402
- function co(t, e, r, n, i, s) {
1403
- r === void 0 && (r = 0), n === void 0 && (n = 0), i === void 0 && (i = 1);
1404
- var o = [], a = (t.variantChildren.size - 1) * n, u = i === 1 ? function(l) {
1405
- return l === void 0 && (l = 0), l * n;
1406
- } : function(l) {
1407
- return l === void 0 && (l = 0), a - l * n;
1408
- };
1409
- return Array.from(t.variantChildren).sort(vo).forEach(function(l, f) {
1410
- o.push(Te(l, e, m(m({}, s), { delay: r + u(f) })).then(function() {
1411
- return l.notifyAnimationComplete(e);
1412
- }));
1413
- }), Promise.all(o);
1414
- }
1415
- function vo(t, e) {
1416
- return t.sortNodePosition(e);
1417
- }
1418
- function po(t, e) {
1419
- var r = t.protectedKeys, n = t.needsAnimating, i = r.hasOwnProperty(e) && n[e] !== !0;
1420
- return n[e] = !1, i;
1421
- }
1422
- var ke = [
1423
- L.Animate,
1424
- L.InView,
1425
- L.Focus,
1426
- L.Hover,
1427
- L.Tap,
1428
- L.Drag,
1429
- L.Exit
1430
- ], ho = W([], I(ke), !1).reverse(), mo = ke.length;
1431
- function go(t) {
1432
- return function(e) {
1433
- return Promise.all(e.map(function(r) {
1434
- var n = r.animation, i = r.options;
1435
- return fo(t, n, i);
1436
- }));
1437
- };
1438
- }
1439
- function yo(t) {
1440
- var e = go(t), r = bo(), n = {}, i = !0, s = function(f, v) {
1441
- var c = ee(t, v);
1442
- if (c) {
1443
- c.transition;
1444
- var d = c.transitionEnd, p = J(c, ["transition", "transitionEnd"]);
1445
- f = m(m(m({}, f), p), d);
1446
- }
1447
- return f;
1448
- };
1449
- function o(f) {
1450
- return n[f] !== void 0;
1451
- }
1452
- function a(f) {
1453
- e = f(t);
1454
- }
1455
- function u(f, v) {
1456
- for (var c, d = t.getProps(), p = t.getVariantContext(!0) || {}, h = [], g = /* @__PURE__ */ new Set(), P = {}, b = 1 / 0, S = function(R) {
1457
- var x = ho[R], w = r[x], D = (c = d[x]) !== null && c !== void 0 ? c : p[x], H = X(D), B = x === v ? w.isActive : null;
1458
- B === !1 && (b = R);
1459
- var N = D === p[x] && D !== d[x] && H;
1460
- if (N && i && t.manuallyAnimateOnMount && (N = !1), w.protectedKeys = m({}, P), // If it isn't active and hasn't *just* been set as inactive
1461
- !w.isActive && B === null || // If we didn't and don't have any defined prop for this animation type
1462
- !D && !w.prevProp || // Or if the prop doesn't define an animation
1463
- Be(D) || typeof D == "boolean")
1464
- return "continue";
1465
- var rt = Po(w.prevProp, D), nt = rt || // If we're making this variant active, we want to always make it active
1466
- x === v && w.isActive && !N && H || // If we removed a higher-priority variant (i is in reverse order)
1467
- R > b && H, it = Array.isArray(D) ? D : [D], z = it.reduce(s, {});
1468
- B === !1 && (z = {});
1469
- var Tt = w.prevResolvedValues, vt = Tt === void 0 ? {} : Tt, Nt = m(m({}, vt), z), dt = function(V) {
1470
- nt = !0, g.delete(V), w.needsAnimating[V] = !0;
1471
- };
1472
- for (var U in Nt) {
1473
- var E = z[U], y = vt[U];
1474
- P.hasOwnProperty(U) || (E !== y ? jt(E) && jt(y) ? !Dn(E, y) || rt ? dt(U) : w.protectedKeys[U] = !0 : E !== void 0 ? dt(U) : g.add(U) : E !== void 0 && g.has(U) ? dt(U) : w.protectedKeys[U] = !0);
1475
- }
1476
- w.prevProp = D, w.prevResolvedValues = z, w.isActive && (P = m(m({}, P), z)), i && t.blockInitialAnimation && (nt = !1), nt && !N && h.push.apply(h, W([], I(it.map(function(V) {
1477
- return {
1478
- animation: V,
1479
- options: m({ type: x }, f)
1480
- };
1481
- })), !1));
1482
- }, C = 0; C < mo; C++)
1483
- S(C);
1484
- if (n = m({}, P), g.size) {
1485
- var A = {};
1486
- g.forEach(function(R) {
1487
- var x = t.getBaseTarget(R);
1488
- x !== void 0 && (A[R] = x);
1489
- }), h.push({ animation: A });
1490
- }
1491
- var M = !!h.length;
1492
- return i && d.initial === !1 && !t.manuallyAnimateOnMount && (M = !1), i = !1, M ? e(h) : Promise.resolve();
1493
- }
1494
- function l(f, v, c) {
1495
- var d;
1496
- if (r[f].isActive === v)
1497
- return Promise.resolve();
1498
- (d = t.variantChildren) === null || d === void 0 || d.forEach(function(g) {
1499
- var P;
1500
- return (P = g.animationState) === null || P === void 0 ? void 0 : P.setActive(f, v);
1501
- }), r[f].isActive = v;
1502
- var p = u(c, f);
1503
- for (var h in r)
1504
- r[h].protectedKeys = {};
1505
- return p;
1506
- }
1507
- return {
1508
- isAnimated: o,
1509
- animateChanges: u,
1510
- setActive: l,
1511
- setAnimateFunction: a,
1512
- getState: function() {
1513
- return r;
1514
- }
1515
- };
1516
- }
1517
- function Po(t, e) {
1518
- return typeof e == "string" ? e !== t : en(e) ? !Dn(e, t) : !1;
1519
- }
1520
- function ft(t) {
1521
- return t === void 0 && (t = !1), {
1522
- isActive: t,
1523
- protectedKeys: {},
1524
- needsAnimating: {},
1525
- prevResolvedValues: {}
1526
- };
1527
- }
1528
- function bo() {
1529
- var t;
1530
- return t = {}, t[L.Animate] = ft(!0), t[L.InView] = ft(), t[L.Hover] = ft(), t[L.Tap] = ft(), t[L.Drag] = ft(), t[L.Focus] = ft(), t[L.Exit] = ft(), t;
1531
- }
1532
- var Vo = {
1533
- animation: ut(function(t) {
1534
- var e = t.visualElement, r = t.animate;
1535
- e.animationState || (e.animationState = yo(e)), Be(r) && G(function() {
1536
- return r.subscribe(e);
1537
- }, [r]);
1538
- }),
1539
- exit: ut(function(t) {
1540
- var e = t.custom, r = t.visualElement, n = I(Rn(), 2), i = n[0], s = n[1], o = F(Bt);
1541
- G(function() {
1542
- var a, u;
1543
- r.isPresent = i;
1544
- var l = (a = r.animationState) === null || a === void 0 ? void 0 : a.setActive(L.Exit, !i, { custom: (u = o?.custom) !== null && u !== void 0 ? u : e });
1545
- !i && l?.then(s);
1546
- }, [i]);
1547
- })
1548
- }, Fn = (
1549
- /** @class */
1550
- function() {
1551
- function t(e, r, n) {
1552
- var i = this, s = n === void 0 ? {} : n, o = s.transformPagePoint;
1553
- if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.handlers = {}, this.updatePoint = function() {
1554
- if (i.lastMoveEvent && i.lastMoveEventInfo) {
1555
- var c = fe(i.lastMoveEventInfo, i.history), d = i.startEvent !== null, p = $r(c.offset, { x: 0, y: 0 }) >= 3;
1556
- if (!(!d && !p)) {
1557
- var h = c.point, g = he().timestamp;
1558
- i.history.push(m(m({}, h), { timestamp: g }));
1559
- var P = i.handlers, b = P.onStart, S = P.onMove;
1560
- d || (b && b(i.lastMoveEvent, c), i.startEvent = i.lastMoveEvent), S && S(i.lastMoveEvent, c);
1561
- }
1562
- }
1563
- }, this.handlePointerMove = function(c, d) {
1564
- if (i.lastMoveEvent = c, i.lastMoveEventInfo = le(d, i.transformPagePoint), bn(c) && c.buttons === 0) {
1565
- i.handlePointerUp(c, d);
1566
- return;
1567
- }
1568
- $.update(i.updatePoint, !0);
1569
- }, this.handlePointerUp = function(c, d) {
1570
- i.end();
1571
- var p = i.handlers, h = p.onEnd, g = p.onSessionEnd, P = fe(le(d, i.transformPagePoint), i.history);
1572
- i.startEvent && h && h(c, P), g && g(c, P);
1573
- }, !(Vn(e) && e.touches.length > 1)) {
1574
- this.handlers = r, this.transformPagePoint = o;
1575
- var a = _e(e), u = le(a, this.transformPagePoint), l = u.point, f = he().timestamp;
1576
- this.history = [m(m({}, l), { timestamp: f })];
1577
- var v = r.onSessionStart;
1578
- v && v(e, fe(u, this.history)), this.removeListeners = kr(gt(window, "pointermove", this.handlePointerMove), gt(window, "pointerup", this.handlePointerUp), gt(window, "pointercancel", this.handlePointerUp));
1579
- }
1580
- }
1581
- return t.prototype.updateHandlers = function(e) {
1582
- this.handlers = e;
1583
- }, t.prototype.end = function() {
1584
- this.removeListeners && this.removeListeners(), Mt.update(this.updatePoint);
1585
- }, t;
1586
- }()
1587
- );
1588
- function le(t, e) {
1589
- return e ? { point: e(t.point) } : t;
1590
- }
1591
- function fr(t, e) {
1592
- return { x: t.x - e.x, y: t.y - e.y };
1593
- }
1594
- function fe(t, e) {
1595
- var r = t.point;
1596
- return {
1597
- point: r,
1598
- delta: fr(r, jn(e)),
1599
- offset: fr(r, To(e)),
1600
- velocity: So(e, 0.1)
1601
- };
1602
- }
1603
- function To(t) {
1604
- return t[0];
1605
- }
1606
- function jn(t) {
1607
- return t[t.length - 1];
1608
- }
1609
- function So(t, e) {
1610
- if (t.length < 2)
1611
- return { x: 0, y: 0 };
1612
- for (var r = t.length - 1, n = null, i = jn(t); r >= 0 && (n = t[r], !(i.timestamp - n.timestamp > Jt(e))); )
1613
- r--;
1614
- if (!n)
1615
- return { x: 0, y: 0 };
1616
- var s = (i.timestamp - n.timestamp) / 1e3;
1617
- if (s === 0)
1618
- return { x: 0, y: 0 };
1619
- var o = {
1620
- x: (i.x - n.x) / s,
1621
- y: (i.y - n.y) / s
1622
- };
1623
- return o.x === 1 / 0 && (o.x = 0), o.y === 1 / 0 && (o.y = 0), o;
1624
- }
1625
- function et(t) {
1626
- return t.max - t.min;
1627
- }
1628
- function cr(t, e, r) {
1629
- return e === void 0 && (e = 0), r === void 0 && (r = 0.01), $r(t, e) < r;
1630
- }
1631
- function vr(t, e, r, n) {
1632
- n === void 0 && (n = 0.5), t.origin = n, t.originPoint = O(e.min, e.max, t.origin), t.scale = et(r) / et(e), (cr(t.scale, 1, 1e-4) || isNaN(t.scale)) && (t.scale = 1), t.translate = O(r.min, r.max, t.origin) - t.originPoint, (cr(t.translate) || isNaN(t.translate)) && (t.translate = 0);
1633
- }
1634
- function Et(t, e, r, n) {
1635
- vr(t.x, e.x, r.x, n?.originX), vr(t.y, e.y, r.y, n?.originY);
1636
- }
1637
- function dr(t, e, r) {
1638
- t.min = r.min + e.min, t.max = t.min + et(e);
1639
- }
1640
- function xo(t, e, r) {
1641
- dr(t.x, e.x, r.x), dr(t.y, e.y, r.y);
1642
- }
1643
- function pr(t, e, r) {
1644
- t.min = e.min - r.min, t.max = t.min + et(e);
1645
- }
1646
- function Lt(t, e, r) {
1647
- pr(t.x, e.x, r.x), pr(t.y, e.y, r.y);
1648
- }
1649
- function Co(t, e, r) {
1650
- var n = e.min, i = e.max;
1651
- return n !== void 0 && t < n ? t = r ? O(n, t, r.min) : Math.max(t, n) : i !== void 0 && t > i && (t = r ? O(i, t, r.max) : Math.min(t, i)), t;
1652
- }
1653
- function hr(t, e, r) {
1654
- return {
1655
- min: e !== void 0 ? t.min + e : void 0,
1656
- max: r !== void 0 ? t.max + r - (t.max - t.min) : void 0
1657
- };
1658
- }
1659
- function Ao(t, e) {
1660
- var r = e.top, n = e.left, i = e.bottom, s = e.right;
1661
- return {
1662
- x: hr(t.x, n, s),
1663
- y: hr(t.y, r, i)
1664
- };
1665
- }
1666
- function mr(t, e) {
1667
- var r, n = e.min - t.min, i = e.max - t.max;
1668
- return e.max - e.min < t.max - t.min && (r = I([i, n], 2), n = r[0], i = r[1]), { min: n, max: i };
1669
- }
1670
- function wo(t, e) {
1671
- return {
1672
- x: mr(t.x, e.x),
1673
- y: mr(t.y, e.y)
1674
- };
1675
- }
1676
- function Eo(t, e) {
1677
- var r = 0.5, n = et(t), i = et(e);
1678
- return i > n ? r = me(e.min, e.max - n, t.min) : n > i && (r = me(t.min, t.max - i, e.min)), gi(0, 1, r);
1679
- }
1680
- function Lo(t, e) {
1681
- var r = {};
1682
- return e.min !== void 0 && (r.min = e.min - t.min), e.max !== void 0 && (r.max = e.max - t.min), r;
1683
- }
1684
- var Se = 0.35;
1685
- function Ro(t) {
1686
- return t === void 0 && (t = Se), t === !1 ? t = 0 : t === !0 && (t = Se), {
1687
- x: gr(t, "left", "right"),
1688
- y: gr(t, "top", "bottom")
1689
- };
1690
- }
1691
- function gr(t, e, r) {
1692
- return {
1693
- min: yr(t, e),
1694
- max: yr(t, r)
1695
- };
1696
- }
1697
- function yr(t, e) {
1698
- var r;
1699
- return typeof t == "number" ? t : (r = t[e]) !== null && r !== void 0 ? r : 0;
1700
- }
1701
- var Pr = function() {
1702
- return {
1703
- translate: 0,
1704
- scale: 1,
1705
- origin: 0,
1706
- originPoint: 0
1707
- };
1708
- }, Rt = function() {
1709
- return {
1710
- x: Pr(),
1711
- y: Pr()
1712
- };
1713
- }, br = function() {
1714
- return { min: 0, max: 0 };
1715
- }, j = function() {
1716
- return {
1717
- x: br(),
1718
- y: br()
1719
- };
1720
- };
1721
- function Z(t) {
1722
- return [t("x"), t("y")];
1723
- }
1724
- function Bn(t) {
1725
- var e = t.top, r = t.left, n = t.right, i = t.bottom;
1726
- return {
1727
- x: { min: r, max: n },
1728
- y: { min: e, max: i }
1729
- };
1730
- }
1731
- function Do(t) {
1732
- var e = t.x, r = t.y;
1733
- return { top: r.min, right: e.max, bottom: r.max, left: e.min };
1734
- }
1735
- function Mo(t, e) {
1736
- if (!e)
1737
- return t;
1738
- var r = e({ x: t.left, y: t.top }), n = e({ x: t.right, y: t.bottom });
1739
- return {
1740
- top: r.y,
1741
- left: r.x,
1742
- bottom: n.y,
1743
- right: n.x
1744
- };
1745
- }
1746
- function ce(t) {
1747
- return t === void 0 || t === 1;
1748
- }
1749
- function _n(t) {
1750
- var e = t.scale, r = t.scaleX, n = t.scaleY;
1751
- return !ce(e) || !ce(r) || !ce(n);
1752
- }
1753
- function ot(t) {
1754
- return _n(t) || Vr(t.x) || Vr(t.y) || t.z || t.rotate || t.rotateX || t.rotateY;
1755
- }
1756
- function Vr(t) {
1757
- return t && t !== "0%";
1758
- }
1759
- function Qt(t, e, r) {
1760
- var n = t - r, i = e * n;
1761
- return r + i;
1762
- }
1763
- function Tr(t, e, r, n, i) {
1764
- return i !== void 0 && (t = Qt(t, i, n)), Qt(t, r, n) + e;
1765
- }
1766
- function xe(t, e, r, n, i) {
1767
- e === void 0 && (e = 0), r === void 0 && (r = 1), t.min = Tr(t.min, e, r, n, i), t.max = Tr(t.max, e, r, n, i);
1768
- }
1769
- function Un(t, e) {
1770
- var r = e.x, n = e.y;
1771
- xe(t.x, r.translate, r.scale, r.originPoint), xe(t.y, n.translate, n.scale, n.originPoint);
1772
- }
1773
- function Io(t, e, r, n) {
1774
- var i, s;
1775
- n === void 0 && (n = !1);
1776
- var o = r.length;
1777
- if (o) {
1778
- e.x = e.y = 1;
1779
- for (var a, u, l = 0; l < o; l++)
1780
- a = r[l], u = a.projectionDelta, ((s = (i = a.instance) === null || i === void 0 ? void 0 : i.style) === null || s === void 0 ? void 0 : s.display) !== "contents" && (n && a.options.layoutScroll && a.scroll && a !== a.root && mt(t, { x: -a.scroll.x, y: -a.scroll.y }), u && (e.x *= u.x.scale, e.y *= u.y.scale, Un(t, u)), n && ot(a.latestValues) && mt(t, a.latestValues));
1781
- }
1782
- }
1783
- function st(t, e) {
1784
- t.min = t.min + e, t.max = t.max + e;
1785
- }
1786
- function Sr(t, e, r) {
1787
- var n = I(r, 3), i = n[0], s = n[1], o = n[2], a = e[o] !== void 0 ? e[o] : 0.5, u = O(t.min, t.max, a);
1788
- xe(t, e[i], e[s], u, e.scale);
1789
- }
1790
- var Oo = ["x", "scaleX", "originX"], Fo = ["y", "scaleY", "originY"];
1791
- function mt(t, e) {
1792
- Sr(t.x, e, Oo), Sr(t.y, e, Fo);
1793
- }
1794
- function Nn(t, e) {
1795
- return Bn(Mo(t.getBoundingClientRect(), e));
1796
- }
1797
- function jo(t, e, r) {
1798
- var n = Nn(t, r), i = e.scroll;
1799
- return i && (st(n.x, i.x), st(n.y, i.y)), n;
1800
- }
1801
- var Bo = /* @__PURE__ */ new WeakMap(), _o = (
1802
- /** @class */
1803
- function() {
1804
- function t(e) {
1805
- this.openGlobalLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = j(), this.visualElement = e;
1806
- }
1807
- return t.prototype.start = function(e, r) {
1808
- var n = this, i = r === void 0 ? {} : r, s = i.snapToCursor, o = s === void 0 ? !1 : s;
1809
- if (this.visualElement.isPresent !== !1) {
1810
- var a = function(v) {
1811
- n.stopAnimation(), o && n.snapToCursor(_e(v, "page").point);
1812
- }, u = function(v, c) {
1813
- var d, p = n.getProps(), h = p.drag, g = p.dragPropagation, P = p.onDragStart;
1814
- h && !g && (n.openGlobalLock && n.openGlobalLock(), n.openGlobalLock = Cn(h), !n.openGlobalLock) || (n.isDragging = !0, n.currentDirection = null, n.resolveConstraints(), n.visualElement.projection && (n.visualElement.projection.isAnimationBlocked = !0, n.visualElement.projection.target = void 0), Z(function(b) {
1815
- var S, C, A = n.getAxisMotionValue(b).get() || 0;
1816
- if (Dt.test(A)) {
1817
- var M = (C = (S = n.visualElement.projection) === null || S === void 0 ? void 0 : S.layout) === null || C === void 0 ? void 0 : C.actual[b];
1818
- if (M) {
1819
- var R = et(M);
1820
- A = R * (parseFloat(A) / 100);
1821
- }
1822
- }
1823
- n.originPoint[b] = A;
1824
- }), P?.(v, c), (d = n.visualElement.animationState) === null || d === void 0 || d.setActive(L.Drag, !0));
1825
- }, l = function(v, c) {
1826
- var d = n.getProps(), p = d.dragPropagation, h = d.dragDirectionLock, g = d.onDirectionLock, P = d.onDrag;
1827
- if (!(!p && !n.openGlobalLock)) {
1828
- var b = c.offset;
1829
- if (h && n.currentDirection === null) {
1830
- n.currentDirection = Uo(b), n.currentDirection !== null && g?.(n.currentDirection);
1831
- return;
1832
- }
1833
- n.updateAxis("x", c.point, b), n.updateAxis("y", c.point, b), n.visualElement.syncRender(), P?.(v, c);
1834
- }
1835
- }, f = function(v, c) {
1836
- return n.stop(v, c);
1837
- };
1838
- this.panSession = new Fn(e, {
1839
- onSessionStart: a,
1840
- onStart: u,
1841
- onMove: l,
1842
- onSessionEnd: f
1843
- }, { transformPagePoint: this.visualElement.getTransformPagePoint() });
1844
- }
1845
- }, t.prototype.stop = function(e, r) {
1846
- var n = this.isDragging;
1847
- if (this.cancel(), !!n) {
1848
- var i = r.velocity;
1849
- this.startAnimation(i);
1850
- var s = this.getProps().onDragEnd;
1851
- s?.(e, r);
1852
- }
1853
- }, t.prototype.cancel = function() {
1854
- var e, r;
1855
- this.isDragging = !1, this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !1), (e = this.panSession) === null || e === void 0 || e.end(), this.panSession = void 0;
1856
- var n = this.getProps().dragPropagation;
1857
- !n && this.openGlobalLock && (this.openGlobalLock(), this.openGlobalLock = null), (r = this.visualElement.animationState) === null || r === void 0 || r.setActive(L.Drag, !1);
1858
- }, t.prototype.updateAxis = function(e, r, n) {
1859
- var i = this.getProps().drag;
1860
- if (!(!n || !Gt(e, i, this.currentDirection))) {
1861
- var s = this.getAxisMotionValue(e), o = this.originPoint[e] + n[e];
1862
- this.constraints && this.constraints[e] && (o = Co(o, this.constraints[e], this.elastic[e])), s.set(o);
1863
- }
1864
- }, t.prototype.resolveConstraints = function() {
1865
- var e = this, r = this.getProps(), n = r.dragConstraints, i = r.dragElastic, s = (this.visualElement.projection || {}).layout, o = this.constraints;
1866
- n && ht(n) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : n && s ? this.constraints = Ao(s.actual, n) : this.constraints = !1, this.elastic = Ro(i), o !== this.constraints && s && this.constraints && !this.hasMutatedConstraints && Z(function(a) {
1867
- e.getAxisMotionValue(a) && (e.constraints[a] = Lo(s.actual[a], e.constraints[a]));
1868
- });
1869
- }, t.prototype.resolveRefConstraints = function() {
1870
- var e = this.getProps(), r = e.dragConstraints, n = e.onMeasureDragConstraints;
1871
- if (!r || !ht(r))
1872
- return !1;
1873
- var i = r.current;
1874
- ct(i !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
1875
- var s = this.visualElement.projection;
1876
- if (!s || !s.layout)
1877
- return !1;
1878
- var o = jo(i, s.root, this.visualElement.getTransformPagePoint()), a = wo(s.layout.actual, o);
1879
- if (n) {
1880
- var u = n(Do(a));
1881
- this.hasMutatedConstraints = !!u, u && (a = Bn(u));
1882
- }
1883
- return a;
1884
- }, t.prototype.startAnimation = function(e) {
1885
- var r = this, n = this.getProps(), i = n.drag, s = n.dragMomentum, o = n.dragElastic, a = n.dragTransition, u = n.dragSnapToOrigin, l = n.onDragTransitionEnd, f = this.constraints || {}, v = Z(function(c) {
1886
- var d;
1887
- if (Gt(c, i, r.currentDirection)) {
1888
- var p = (d = f?.[c]) !== null && d !== void 0 ? d : {};
1889
- u && (p = { min: 0, max: 0 });
1890
- var h = o ? 200 : 1e6, g = o ? 40 : 1e7, P = m(m({ type: "inertia", velocity: s ? e[c] : 0, bounceStiffness: h, bounceDamping: g, timeConstant: 750, restDelta: 1, restSpeed: 10 }, a), p);
1891
- return r.startAxisValueAnimation(c, P);
1892
- }
1893
- });
1894
- return Promise.all(v).then(l);
1895
- }, t.prototype.startAxisValueAnimation = function(e, r) {
1896
- var n = this.getAxisMotionValue(e);
1897
- return Ke(e, n, 0, r);
1898
- }, t.prototype.stopAnimation = function() {
1899
- var e = this;
1900
- Z(function(r) {
1901
- return e.getAxisMotionValue(r).stop();
1902
- });
1903
- }, t.prototype.getAxisMotionValue = function(e) {
1904
- var r, n, i = "_drag" + e.toUpperCase(), s = this.visualElement.getProps()[i];
1905
- return s || this.visualElement.getValue(e, (n = (r = this.visualElement.getProps().initial) === null || r === void 0 ? void 0 : r[e]) !== null && n !== void 0 ? n : 0);
1906
- }, t.prototype.snapToCursor = function(e) {
1907
- var r = this;
1908
- Z(function(n) {
1909
- var i = r.getProps().drag;
1910
- if (Gt(n, i, r.currentDirection)) {
1911
- var s = r.visualElement.projection, o = r.getAxisMotionValue(n);
1912
- if (s && s.layout) {
1913
- var a = s.layout.actual[n], u = a.min, l = a.max;
1914
- o.set(e[n] - O(u, l, 0.5));
1915
- }
1916
- }
1917
- });
1918
- }, t.prototype.scalePositionWithinConstraints = function() {
1919
- var e = this, r, n = this.getProps(), i = n.drag, s = n.dragConstraints, o = this.visualElement.projection;
1920
- if (!(!ht(s) || !o || !this.constraints)) {
1921
- this.stopAnimation();
1922
- var a = { x: 0, y: 0 };
1923
- Z(function(l) {
1924
- var f = e.getAxisMotionValue(l);
1925
- if (f) {
1926
- var v = f.get();
1927
- a[l] = Eo({ min: v, max: v }, e.constraints[l]);
1928
- }
1929
- });
1930
- var u = this.visualElement.getProps().transformTemplate;
1931
- this.visualElement.getInstance().style.transform = u ? u({}, "") : "none", (r = o.root) === null || r === void 0 || r.updateScroll(), o.updateLayout(), this.resolveConstraints(), Z(function(l) {
1932
- if (Gt(l, i, null)) {
1933
- var f = e.getAxisMotionValue(l), v = e.constraints[l], c = v.min, d = v.max;
1934
- f.set(O(c, d, a[l]));
1935
- }
1936
- });
1937
- }
1938
- }, t.prototype.addListeners = function() {
1939
- var e = this, r;
1940
- Bo.set(this.visualElement, this);
1941
- var n = this.visualElement.getInstance(), i = gt(n, "pointerdown", function(l) {
1942
- var f = e.getProps(), v = f.drag, c = f.dragListener, d = c === void 0 ? !0 : c;
1943
- v && d && e.start(l);
1944
- }), s = function() {
1945
- var l = e.getProps().dragConstraints;
1946
- ht(l) && (e.constraints = e.resolveRefConstraints());
1947
- }, o = this.visualElement.projection, a = o.addEventListener("measure", s);
1948
- o && !o.layout && ((r = o.root) === null || r === void 0 || r.updateScroll(), o.updateLayout()), s();
1949
- var u = ne(window, "resize", function() {
1950
- return e.scalePositionWithinConstraints();
1951
- });
1952
- return o.addEventListener("didUpdate", function(l) {
1953
- var f = l.delta, v = l.hasLayoutChanged;
1954
- e.isDragging && v && (Z(function(c) {
1955
- var d = e.getAxisMotionValue(c);
1956
- d && (e.originPoint[c] += f[c].translate, d.set(d.get() + f[c].translate));
1957
- }), e.visualElement.syncRender());
1958
- }), function() {
1959
- u(), i(), a();
1960
- };
1961
- }, t.prototype.getProps = function() {
1962
- var e = this.visualElement.getProps(), r = e.drag, n = r === void 0 ? !1 : r, i = e.dragDirectionLock, s = i === void 0 ? !1 : i, o = e.dragPropagation, a = o === void 0 ? !1 : o, u = e.dragConstraints, l = u === void 0 ? !1 : u, f = e.dragElastic, v = f === void 0 ? Se : f, c = e.dragMomentum, d = c === void 0 ? !0 : c;
1963
- return m(m({}, e), { drag: n, dragDirectionLock: s, dragPropagation: a, dragConstraints: l, dragElastic: v, dragMomentum: d });
1964
- }, t;
1965
- }()
1966
- );
1967
- function Gt(t, e, r) {
1968
- return (e === !0 || e === t) && (r === null || r === t);
1969
- }
1970
- function Uo(t, e) {
1971
- e === void 0 && (e = 10);
1972
- var r = null;
1973
- return Math.abs(t.y) > e ? r = "y" : Math.abs(t.x) > e && (r = "x"), r;
1974
- }
1975
- function No(t) {
1976
- var e = t.dragControls, r = t.visualElement, n = _t(function() {
1977
- return new _o(r);
1978
- });
1979
- G(function() {
1980
- return e && e.subscribe(n);
1981
- }, [n, e]), G(function() {
1982
- return n.addListeners();
1983
- }, [n]);
1984
- }
1985
- function Ho(t) {
1986
- var e = t.onPan, r = t.onPanStart, n = t.onPanEnd, i = t.onPanSessionStart, s = t.visualElement, o = e || r || n || i, a = q(null), u = F(Re).transformPagePoint, l = {
1987
- onSessionStart: i,
1988
- onStart: r,
1989
- onMove: e,
1990
- onEnd: function(v, c) {
1991
- a.current = null, n && n(v, c);
1992
- }
1993
- };
1994
- G(function() {
1995
- a.current !== null && a.current.updateHandlers(l);
1996
- });
1997
- function f(v) {
1998
- a.current = new Fn(v, l, {
1999
- transformPagePoint: u
2000
- });
2001
- }
2002
- qt(s, "pointerdown", o && f), Ue(function() {
2003
- return a.current && a.current.end();
2004
- });
2005
- }
2006
- var zo = {
2007
- pan: ut(Ho),
2008
- drag: ut(No)
2009
- }, Yt = [
2010
- "LayoutMeasure",
2011
- "BeforeLayoutMeasure",
2012
- "LayoutUpdate",
2013
- "ViewportBoxUpdate",
2014
- "Update",
2015
- "Render",
2016
- "AnimationComplete",
2017
- "LayoutAnimationComplete",
2018
- "AnimationStart",
2019
- "LayoutAnimationStart",
2020
- "SetAxisTarget",
2021
- "Unmount"
2022
- ];
2023
- function Ko() {
2024
- var t = Yt.map(function() {
2025
- return new wt();
2026
- }), e = {}, r = {
2027
- clearAllListeners: function() {
2028
- return t.forEach(function(n) {
2029
- return n.clear();
2030
- });
2031
- },
2032
- updatePropListeners: function(n) {
2033
- Yt.forEach(function(i) {
2034
- var s, o = "on" + i, a = n[o];
2035
- (s = e[i]) === null || s === void 0 || s.call(e), a && (e[i] = r[o](a));
2036
- });
2037
- }
2038
- };
2039
- return t.forEach(function(n, i) {
2040
- r["on" + Yt[i]] = function(s) {
2041
- return n.add(s);
2042
- }, r["notify" + Yt[i]] = function() {
2043
- for (var s = [], o = 0; o < arguments.length; o++)
2044
- s[o] = arguments[o];
2045
- return n.notify.apply(n, W([], I(s), !1));
2046
- };
2047
- }), r;
2048
- }
2049
- function Go(t, e, r) {
2050
- var n;
2051
- for (var i in e) {
2052
- var s = e[i], o = r[i];
2053
- if (tt(s))
2054
- t.addValue(i, s), process.env.NODE_ENV === "development" && En(s.version === "6.5.1", "Attempting to mix Framer Motion versions ".concat(s.version, " with 6.5.1 may not work as expected."));
2055
- else if (tt(o))
2056
- t.addValue(i, Pt(s));
2057
- else if (o !== s)
2058
- if (t.hasValue(i)) {
2059
- var a = t.getValue(i);
2060
- !a.hasAnimated && a.set(s);
2061
- } else
2062
- t.addValue(i, Pt((n = t.getStaticValue(i)) !== null && n !== void 0 ? n : s));
2063
- }
2064
- for (var i in r)
2065
- e[i] === void 0 && t.removeValue(i);
2066
- return e;
2067
- }
2068
- var Hn = function(t) {
2069
- var e = t.treeType, r = e === void 0 ? "" : e, n = t.build, i = t.getBaseTarget, s = t.makeTargetAnimatable, o = t.measureViewportBox, a = t.render, u = t.readValueFromInstance, l = t.removeValueFromRenderState, f = t.sortNodePosition, v = t.scrapeMotionValuesFromProps;
2070
- return function(c, d) {
2071
- var p = c.parent, h = c.props, g = c.presenceId, P = c.blockInitialAnimation, b = c.visualState, S = c.shouldReduceMotion;
2072
- d === void 0 && (d = {});
2073
- var C = !1, A = b.latestValues, M = b.renderState, R, x = Ko(), w = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), H = {}, B = m({}, A), N;
2074
- function rt() {
2075
- !R || !C || (nt(), a(R, M, h.style, E.projection));
2076
- }
2077
- function nt() {
2078
- n(E, M, A, d, h);
2079
- }
2080
- function it() {
2081
- x.notifyUpdate(A);
2082
- }
2083
- function z(y, V) {
2084
- var _ = V.onChange(function(Ht) {
2085
- A[y] = Ht, h.onUpdate && $.update(it, !1, !0);
2086
- }), St = V.onRenderRequest(E.scheduleRender);
2087
- D.set(y, function() {
2088
- _(), St();
2089
- });
2090
- }
2091
- var Tt = v(h);
2092
- for (var vt in Tt) {
2093
- var Nt = Tt[vt];
2094
- A[vt] !== void 0 && tt(Nt) && Nt.set(A[vt], !1);
2095
- }
2096
- var dt = re(h), U = nn(h), E = m(m({
2097
- treeType: r,
2098
- /**
2099
- * This is a mirror of the internal instance prop, which keeps
2100
- * VisualElement type-compatible with React's RefObject.
2101
- */
2102
- current: null,
2103
- /**
2104
- * The depth of this visual element within the visual element tree.
2105
- */
2106
- depth: p ? p.depth + 1 : 0,
2107
- parent: p,
2108
- children: /* @__PURE__ */ new Set(),
2109
- /**
2110
- *
2111
- */
2112
- presenceId: g,
2113
- shouldReduceMotion: S,
2114
- /**
2115
- * If this component is part of the variant tree, it should track
2116
- * any children that are also part of the tree. This is essentially
2117
- * a shadow tree to simplify logic around how to stagger over children.
2118
- */
2119
- variantChildren: U ? /* @__PURE__ */ new Set() : void 0,
2120
- /**
2121
- * Whether this instance is visible. This can be changed imperatively
2122
- * by the projection tree, is analogous to CSS's visibility in that
2123
- * hidden elements should take up layout, and needs enacting by the configured
2124
- * render function.
2125
- */
2126
- isVisible: void 0,
2127
- /**
2128
- * Normally, if a component is controlled by a parent's variants, it can
2129
- * rely on that ancestor to trigger animations further down the tree.
2130
- * However, if a component is created after its parent is mounted, the parent
2131
- * won't trigger that mount animation so the child needs to.
2132
- *
2133
- * TODO: This might be better replaced with a method isParentMounted
2134
- */
2135
- manuallyAnimateOnMount: !!p?.isMounted(),
2136
- /**
2137
- * This can be set by AnimatePresence to force components that mount
2138
- * at the same time as it to mount as if they have initial={false} set.
2139
- */
2140
- blockInitialAnimation: P,
2141
- /**
2142
- * Determine whether this component has mounted yet. This is mostly used
2143
- * by variant children to determine whether they need to trigger their
2144
- * own animations on mount.
2145
- */
2146
- isMounted: function() {
2147
- return !!R;
2148
- },
2149
- mount: function(y) {
2150
- C = !0, R = E.current = y, E.projection && E.projection.mount(y), U && p && !dt && (N = p?.addVariantChild(E)), w.forEach(function(V, _) {
2151
- return z(_, V);
2152
- }), p?.children.add(E), E.setProps(h);
2153
- },
2154
- /**
2155
- *
2156
- */
2157
- unmount: function() {
2158
- var y;
2159
- (y = E.projection) === null || y === void 0 || y.unmount(), Mt.update(it), Mt.render(rt), D.forEach(function(V) {
2160
- return V();
2161
- }), N?.(), p?.children.delete(E), x.clearAllListeners(), R = void 0, C = !1;
2162
- },
2163
- /**
2164
- * Add a child visual element to our set of children.
2165
- */
2166
- addVariantChild: function(y) {
2167
- var V, _ = E.getClosestVariantNode();
2168
- if (_)
2169
- return (V = _.variantChildren) === null || V === void 0 || V.add(y), function() {
2170
- return _.variantChildren.delete(y);
2171
- };
2172
- },
2173
- sortNodePosition: function(y) {
2174
- return !f || r !== y.treeType ? 0 : f(E.getInstance(), y.getInstance());
2175
- },
2176
- /**
2177
- * Returns the closest variant node in the tree starting from
2178
- * this visual element.
2179
- */
2180
- getClosestVariantNode: function() {
2181
- return U ? E : p?.getClosestVariantNode();
2182
- },
2183
- /**
2184
- * Expose the latest layoutId prop.
2185
- */
2186
- getLayoutId: function() {
2187
- return h.layoutId;
2188
- },
2189
- /**
2190
- * Returns the current instance.
2191
- */
2192
- getInstance: function() {
2193
- return R;
2194
- },
2195
- /**
2196
- * Get/set the latest static values.
2197
- */
2198
- getStaticValue: function(y) {
2199
- return A[y];
2200
- },
2201
- setStaticValue: function(y, V) {
2202
- return A[y] = V;
2203
- },
2204
- /**
2205
- * Returns the latest motion value state. Currently only used to take
2206
- * a snapshot of the visual element - perhaps this can return the whole
2207
- * visual state
2208
- */
2209
- getLatestValues: function() {
2210
- return A;
2211
- },
2212
- /**
2213
- * Set the visiblity of the visual element. If it's changed, schedule
2214
- * a render to reflect these changes.
2215
- */
2216
- setVisibility: function(y) {
2217
- E.isVisible !== y && (E.isVisible = y, E.scheduleRender());
2218
- },
2219
- /**
2220
- * Make a target animatable by Popmotion. For instance, if we're
2221
- * trying to animate width from 100px to 100vw we need to measure 100vw
2222
- * in pixels to determine what we really need to animate to. This is also
2223
- * pluggable to support Framer's custom value types like Color,
2224
- * and CSS variables.
2225
- */
2226
- makeTargetAnimatable: function(y, V) {
2227
- return V === void 0 && (V = !0), s(E, y, h, V);
2228
- },
2229
- /**
2230
- * Measure the current viewport box with or without transforms.
2231
- * Only measures axis-aligned boxes, rotate and skew must be manually
2232
- * removed with a re-render to work.
2233
- */
2234
- measureViewportBox: function() {
2235
- return o(R, h);
2236
- },
2237
- // Motion values ========================
2238
- /**
2239
- * Add a motion value and bind it to this visual element.
2240
- */
2241
- addValue: function(y, V) {
2242
- E.hasValue(y) && E.removeValue(y), w.set(y, V), A[y] = V.get(), z(y, V);
2243
- },
2244
- /**
2245
- * Remove a motion value and unbind any active subscriptions.
2246
- */
2247
- removeValue: function(y) {
2248
- var V;
2249
- w.delete(y), (V = D.get(y)) === null || V === void 0 || V(), D.delete(y), delete A[y], l(y, M);
2250
- },
2251
- /**
2252
- * Check whether we have a motion value for this key
2253
- */
2254
- hasValue: function(y) {
2255
- return w.has(y);
2256
- },
2257
- /**
2258
- * Get a motion value for this key. If called with a default
2259
- * value, we'll create one if none exists.
2260
- */
2261
- getValue: function(y, V) {
2262
- var _ = w.get(y);
2263
- return _ === void 0 && V !== void 0 && (_ = Pt(V), E.addValue(y, _)), _;
2264
- },
2265
- /**
2266
- * Iterate over our motion values.
2267
- */
2268
- forEachValue: function(y) {
2269
- return w.forEach(y);
2270
- },
2271
- /**
2272
- * If we're trying to animate to a previously unencountered value,
2273
- * we need to check for it in our state and as a last resort read it
2274
- * directly from the instance (which might have performance implications).
2275
- */
2276
- readValue: function(y) {
2277
- var V;
2278
- return (V = A[y]) !== null && V !== void 0 ? V : u(R, y, d);
2279
- },
2280
- /**
2281
- * Set the base target to later animate back to. This is currently
2282
- * only hydrated on creation and when we first read a value.
2283
- */
2284
- setBaseTarget: function(y, V) {
2285
- B[y] = V;
2286
- },
2287
- /**
2288
- * Find the base target for a value thats been removed from all animation
2289
- * props.
2290
- */
2291
- getBaseTarget: function(y) {
2292
- if (i) {
2293
- var V = i(h, y);
2294
- if (V !== void 0 && !tt(V))
2295
- return V;
2296
- }
2297
- return B[y];
2298
- }
2299
- }, x), {
2300
- /**
2301
- * Build the renderer state based on the latest visual state.
2302
- */
2303
- build: function() {
2304
- return nt(), M;
2305
- },
2306
- /**
2307
- * Schedule a render on the next animation frame.
2308
- */
2309
- scheduleRender: function() {
2310
- $.render(rt, !1, !0);
2311
- },
2312
- /**
2313
- * Synchronously fire render. It's prefered that we batch renders but
2314
- * in many circumstances, like layout measurement, we need to run this
2315
- * synchronously. However in those instances other measures should be taken
2316
- * to batch reads/writes.
2317
- */
2318
- syncRender: rt,
2319
- /**
2320
- * Update the provided props. Ensure any newly-added motion values are
2321
- * added to our map, old ones removed, and listeners updated.
2322
- */
2323
- setProps: function(y) {
2324
- (y.transformTemplate || h.transformTemplate) && E.scheduleRender(), h = y, x.updatePropListeners(y), H = Go(E, v(h), H);
2325
- },
2326
- getProps: function() {
2327
- return h;
2328
- },
2329
- // Variants ==============================
2330
- /**
2331
- * Returns the variant definition with a given name.
2332
- */
2333
- getVariant: function(y) {
2334
- var V;
2335
- return (V = h.variants) === null || V === void 0 ? void 0 : V[y];
2336
- },
2337
- /**
2338
- * Returns the defined default transition on this component.
2339
- */
2340
- getDefaultTransition: function() {
2341
- return h.transition;
2342
- },
2343
- getTransformPagePoint: function() {
2344
- return h.transformPagePoint;
2345
- },
2346
- /**
2347
- * Used by child variant nodes to get the closest ancestor variant props.
2348
- */
2349
- getVariantContext: function(y) {
2350
- if (y === void 0 && (y = !1), y)
2351
- return p?.getVariantContext();
2352
- if (!dt) {
2353
- var V = p?.getVariantContext() || {};
2354
- return h.initial !== void 0 && (V.initial = h.initial), V;
2355
- }
2356
- for (var _ = {}, St = 0; St < Yo; St++) {
2357
- var Ht = zn[St], ie = h[Ht];
2358
- (X(ie) || ie === !1) && (_[Ht] = ie);
2359
- }
2360
- return _;
2361
- }
2362
- });
2363
- return E;
2364
- };
2365
- }, zn = W(["initial"], I(ke), !1), Yo = zn.length;
2366
- function Ce(t) {
2367
- return typeof t == "string" && t.startsWith("var(--");
2368
- }
2369
- var Kn = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
2370
- function ko(t) {
2371
- var e = Kn.exec(t);
2372
- if (!e)
2373
- return [,];
2374
- var r = I(e, 3), n = r[1], i = r[2];
2375
- return [n, i];
2376
- }
2377
- var Xo = 4;
2378
- function Ae(t, e, r) {
2379
- r === void 0 && (r = 1), ct(r <= Xo, 'Max CSS variable fallback depth detected in property "'.concat(t, '". This may indicate a circular fallback dependency.'));
2380
- var n = I(ko(t), 2), i = n[0], s = n[1];
2381
- if (i) {
2382
- var o = window.getComputedStyle(e).getPropertyValue(i);
2383
- return o ? o.trim() : Ce(s) ? Ae(s, e, r + 1) : s;
2384
- }
2385
- }
2386
- function Wo(t, e, r) {
2387
- var n, i = J(e, []), s = t.getInstance();
2388
- if (!(s instanceof Element))
2389
- return { target: i, transitionEnd: r };
2390
- r && (r = m({}, r)), t.forEachValue(function(l) {
2391
- var f = l.get();
2392
- if (Ce(f)) {
2393
- var v = Ae(f, s);
2394
- v && l.set(v);
2395
- }
2396
- });
2397
- for (var o in i) {
2398
- var a = i[o];
2399
- if (Ce(a)) {
2400
- var u = Ae(a, s);
2401
- u && (i[o] = u, r && ((n = r[o]) !== null && n !== void 0 || (r[o] = a)));
2402
- }
2403
- }
2404
- return { target: i, transitionEnd: r };
2405
- }
2406
- var Zo = /* @__PURE__ */ new Set([
2407
- "width",
2408
- "height",
2409
- "top",
2410
- "left",
2411
- "right",
2412
- "bottom",
2413
- "x",
2414
- "y"
2415
- ]), Gn = function(t) {
2416
- return Zo.has(t);
2417
- }, $o = function(t) {
2418
- return Object.keys(t).some(Gn);
2419
- }, Yn = function(t, e) {
2420
- t.set(e, !1), t.set(e);
2421
- }, kt = function(t) {
2422
- return t === we || t === T;
2423
- }, xr;
2424
- (function(t) {
2425
- t.width = "width", t.height = "height", t.left = "left", t.right = "right", t.top = "top", t.bottom = "bottom";
2426
- })(xr || (xr = {}));
2427
- var Cr = function(t, e) {
2428
- return parseFloat(t.split(", ")[e]);
2429
- }, Ar = function(t, e) {
2430
- return function(r, n) {
2431
- var i = n.transform;
2432
- if (i === "none" || !i)
2433
- return 0;
2434
- var s = i.match(/^matrix3d\((.+)\)$/);
2435
- if (s)
2436
- return Cr(s[1], e);
2437
- var o = i.match(/^matrix\((.+)\)$/);
2438
- return o ? Cr(o[1], t) : 0;
2439
- };
2440
- }, qo = /* @__PURE__ */ new Set(["x", "y", "z"]), Jo = Ft.filter(function(t) {
2441
- return !qo.has(t);
2442
- });
2443
- function Qo(t) {
2444
- var e = [];
2445
- return Jo.forEach(function(r) {
2446
- var n = t.getValue(r);
2447
- n !== void 0 && (e.push([r, n.get()]), n.set(r.startsWith("scale") ? 1 : 0));
2448
- }), e.length && t.syncRender(), e;
2449
- }
2450
- var wr = {
2451
- // Dimensions
2452
- width: function(t, e) {
2453
- var r = t.x, n = e.paddingLeft, i = n === void 0 ? "0" : n, s = e.paddingRight, o = s === void 0 ? "0" : s;
2454
- return r.max - r.min - parseFloat(i) - parseFloat(o);
2455
- },
2456
- height: function(t, e) {
2457
- var r = t.y, n = e.paddingTop, i = n === void 0 ? "0" : n, s = e.paddingBottom, o = s === void 0 ? "0" : s;
2458
- return r.max - r.min - parseFloat(i) - parseFloat(o);
2459
- },
2460
- top: function(t, e) {
2461
- var r = e.top;
2462
- return parseFloat(r);
2463
- },
2464
- left: function(t, e) {
2465
- var r = e.left;
2466
- return parseFloat(r);
2467
- },
2468
- bottom: function(t, e) {
2469
- var r = t.y, n = e.top;
2470
- return parseFloat(n) + (r.max - r.min);
2471
- },
2472
- right: function(t, e) {
2473
- var r = t.x, n = e.left;
2474
- return parseFloat(n) + (r.max - r.min);
2475
- },
2476
- // Transform
2477
- x: Ar(4, 13),
2478
- y: Ar(5, 14)
2479
- }, ts = function(t, e, r) {
2480
- var n = e.measureViewportBox(), i = e.getInstance(), s = getComputedStyle(i), o = s.display, a = {};
2481
- o === "none" && e.setStaticValue("display", t.display || "block"), r.forEach(function(l) {
2482
- a[l] = wr[l](n, s);
2483
- }), e.syncRender();
2484
- var u = e.measureViewportBox();
2485
- return r.forEach(function(l) {
2486
- var f = e.getValue(l);
2487
- Yn(f, a[l]), t[l] = wr[l](u, s);
2488
- }), t;
2489
- }, es = function(t, e, r, n) {
2490
- r === void 0 && (r = {}), n === void 0 && (n = {}), e = m({}, e), n = m({}, n);
2491
- var i = Object.keys(e).filter(Gn), s = [], o = !1, a = [];
2492
- if (i.forEach(function(f) {
2493
- var v = t.getValue(f);
2494
- if (t.hasValue(f)) {
2495
- var c = r[f], d = xt(c), p = e[f], h;
2496
- if (jt(p)) {
2497
- var g = p.length, P = p[0] === null ? 1 : 0;
2498
- c = p[P], d = xt(c);
2499
- for (var b = P; b < g; b++)
2500
- h ? ct(xt(p[b]) === h, "All keyframes must be of the same type") : (h = xt(p[b]), ct(h === d || kt(d) && kt(h), "Keyframes must be of the same dimension as the current value"));
2501
- } else
2502
- h = xt(p);
2503
- if (d !== h)
2504
- if (kt(d) && kt(h)) {
2505
- var S = v.get();
2506
- typeof S == "string" && v.set(parseFloat(S)), typeof p == "string" ? e[f] = parseFloat(p) : Array.isArray(p) && h === T && (e[f] = p.map(parseFloat));
2507
- } else d?.transform && h?.transform && (c === 0 || p === 0) ? c === 0 ? v.set(h.transform(c)) : e[f] = d.transform(p) : (o || (s = Qo(t), o = !0), a.push(f), n[f] = n[f] !== void 0 ? n[f] : e[f], Yn(v, p));
2508
- }
2509
- }), a.length) {
2510
- var u = a.indexOf("height") >= 0 ? window.pageYOffset : null, l = ts(e, t, a);
2511
- return s.length && s.forEach(function(f) {
2512
- var v = I(f, 2), c = v[0], d = v[1];
2513
- t.getValue(c).set(d);
2514
- }), t.syncRender(), u !== null && window.scrollTo({ top: u }), { target: l, transitionEnd: n };
2515
- } else
2516
- return { target: e, transitionEnd: n };
2517
- };
2518
- function rs(t, e, r, n) {
2519
- return $o(e) ? es(t, e, r, n) : { target: e, transitionEnd: n };
2520
- }
2521
- var ns = function(t, e, r, n) {
2522
- var i = Wo(t, e, n);
2523
- return e = i.target, n = i.transitionEnd, rs(t, e, r, n);
2524
- };
2525
- function is(t) {
2526
- return window.getComputedStyle(t);
2527
- }
2528
- var kn = {
2529
- treeType: "dom",
2530
- readValueFromInstance: function(t, e) {
2531
- if (Ut(e)) {
2532
- var r = Ne(e);
2533
- return r && r.default || 0;
2534
- } else {
2535
- var n = is(t);
2536
- return (un(e) ? n.getPropertyValue(e) : n[e]) || 0;
2537
- }
2538
- },
2539
- sortNodePosition: function(t, e) {
2540
- return t.compareDocumentPosition(e) & 2 ? 1 : -1;
2541
- },
2542
- getBaseTarget: function(t, e) {
2543
- var r;
2544
- return (r = t.style) === null || r === void 0 ? void 0 : r[e];
2545
- },
2546
- measureViewportBox: function(t, e) {
2547
- var r = e.transformPagePoint;
2548
- return Nn(t, r);
2549
- },
2550
- /**
2551
- * Reset the transform on the current Element. This is called as part
2552
- * of a batched process across the entire layout tree. To remove this write
2553
- * cycle it'd be interesting to see if it's possible to "undo" all the current
2554
- * layout transforms up the tree in the same way this.getBoundingBoxWithoutTransforms
2555
- * works
2556
- */
2557
- resetTransform: function(t, e, r) {
2558
- var n = r.transformTemplate;
2559
- e.style.transform = n ? n({}, "") : "none", t.scheduleRender();
2560
- },
2561
- restoreTransform: function(t, e) {
2562
- t.style.transform = e.style.transform;
2563
- },
2564
- removeValueFromRenderState: function(t, e) {
2565
- var r = e.vars, n = e.style;
2566
- delete r[t], delete n[t];
2567
- },
2568
- /**
2569
- * Ensure that HTML and Framer-specific value types like `px`->`%` and `Color`
2570
- * can be animated by Motion.
2571
- */
2572
- makeTargetAnimatable: function(t, e, r, n) {
2573
- var i = r.transformValues;
2574
- n === void 0 && (n = !0);
2575
- var s = e.transition, o = e.transitionEnd, a = J(e, ["transition", "transitionEnd"]), u = lo(a, s || {}, t);
2576
- if (i && (o && (o = i(o)), a && (a = i(a)), u && (u = i(u))), n) {
2577
- so(t, a, u);
2578
- var l = ns(t, a, u, o);
2579
- o = l.transitionEnd, a = l.target;
2580
- }
2581
- return m({ transition: s, transitionEnd: o }, a);
2582
- },
2583
- scrapeMotionValuesFromProps: je,
2584
- build: function(t, e, r, n, i) {
2585
- t.isVisible !== void 0 && (e.style.visibility = t.isVisible ? "visible" : "hidden"), Ie(e, r, n, i.transformTemplate);
2586
- },
2587
- render: pn
2588
- }, as = Hn(kn), os = Hn(m(m({}, kn), { getBaseTarget: function(t, e) {
2589
- return t[e];
2590
- }, readValueFromInstance: function(t, e) {
2591
- var r;
2592
- return Ut(e) ? ((r = Ne(e)) === null || r === void 0 ? void 0 : r.default) || 0 : (e = hn.has(e) ? e : dn(e), t.getAttribute(e));
2593
- }, scrapeMotionValuesFromProps: gn, build: function(t, e, r, n, i) {
2594
- Fe(e, r, n, i.transformTemplate);
2595
- }, render: mn })), ss = function(t, e) {
2596
- return Me(t) ? os(e, { enableHardwareAcceleration: !1 }) : as(e, { enableHardwareAcceleration: !0 });
2597
- };
2598
- function Er(t, e) {
2599
- return e.max === e.min ? 0 : t / (e.max - e.min) * 100;
2600
- }
2601
- var Ct = {
2602
- correct: function(t, e) {
2603
- if (!e.target)
2604
- return t;
2605
- if (typeof t == "string")
2606
- if (T.test(t))
2607
- t = parseFloat(t);
2608
- else
2609
- return t;
2610
- var r = Er(t, e.target.x), n = Er(t, e.target.y);
2611
- return "".concat(r, "% ").concat(n, "%");
2612
- }
2613
- }, Lr = "_$css", us = {
2614
- correct: function(t, e) {
2615
- var r = e.treeScale, n = e.projectionDelta, i = t, s = t.includes("var("), o = [];
2616
- s && (t = t.replace(Kn, function(h) {
2617
- return o.push(h), Lr;
2618
- }));
2619
- var a = yt.parse(t);
2620
- if (a.length > 5)
2621
- return i;
2622
- var u = yt.createTransformer(t), l = typeof a[0] != "number" ? 1 : 0, f = n.x.scale * r.x, v = n.y.scale * r.y;
2623
- a[0 + l] /= f, a[1 + l] /= v;
2624
- var c = O(f, v, 0.5);
2625
- typeof a[2 + l] == "number" && (a[2 + l] /= c), typeof a[3 + l] == "number" && (a[3 + l] /= c);
2626
- var d = u(a);
2627
- if (s) {
2628
- var p = 0;
2629
- d = d.replace(Lr, function() {
2630
- var h = o[p];
2631
- return p++, h;
2632
- });
2633
- }
2634
- return d;
2635
- }
2636
- }, ls = (
2637
- /** @class */
2638
- function(t) {
2639
- Yr(e, t);
2640
- function e() {
2641
- return t !== null && t.apply(this, arguments) || this;
2642
- }
2643
- return e.prototype.componentDidMount = function() {
2644
- var r = this, n = this.props, i = n.visualElement, s = n.layoutGroup, o = n.switchLayoutGroup, a = n.layoutId, u = i.projection;
2645
- ki(cs), u && (s?.group && s.group.add(u), o?.register && a && o.register(u), u.root.didUpdate(), u.addEventListener("animationComplete", function() {
2646
- r.safeToRemove();
2647
- }), u.setOptions(m(m({}, u.options), { onExitComplete: function() {
2648
- return r.safeToRemove();
2649
- } }))), At.hasEverUpdated = !0;
2650
- }, e.prototype.getSnapshotBeforeUpdate = function(r) {
2651
- var n = this, i = this.props, s = i.layoutDependency, o = i.visualElement, a = i.drag, u = i.isPresent, l = o.projection;
2652
- return l && (l.isPresent = u, a || r.layoutDependency !== s || s === void 0 ? l.willUpdate() : this.safeToRemove(), r.isPresent !== u && (u ? l.promote() : l.relegate() || $.postRender(function() {
2653
- var f;
2654
- !((f = l.getStack()) === null || f === void 0) && f.members.length || n.safeToRemove();
2655
- }))), null;
2656
- }, e.prototype.componentDidUpdate = function() {
2657
- var r = this.props.visualElement.projection;
2658
- r && (r.root.didUpdate(), !r.currentAnimation && r.isLead() && this.safeToRemove());
2659
- }, e.prototype.componentWillUnmount = function() {
2660
- var r = this.props, n = r.visualElement, i = r.layoutGroup, s = r.switchLayoutGroup, o = n.projection;
2661
- o && (o.scheduleCheckAfterUnmount(), i?.group && i.group.remove(o), s?.deregister && s.deregister(o));
2662
- }, e.prototype.safeToRemove = function() {
2663
- var r = this.props.safeToRemove;
2664
- r?.();
2665
- }, e.prototype.render = function() {
2666
- return null;
2667
- }, e;
2668
- }(Ee.Component)
2669
- );
2670
- function fs(t) {
2671
- var e = I(Rn(), 2), r = e[0], n = e[1], i = F(De);
2672
- return Ee.createElement(ls, m({}, t, { layoutGroup: i, switchLayoutGroup: F(an), isPresent: r, safeToRemove: n }));
2673
- }
2674
- var cs = {
2675
- borderRadius: m(m({}, Ct), { applyTo: [
2676
- "borderTopLeftRadius",
2677
- "borderTopRightRadius",
2678
- "borderBottomLeftRadius",
2679
- "borderBottomRightRadius"
2680
- ] }),
2681
- borderTopLeftRadius: Ct,
2682
- borderTopRightRadius: Ct,
2683
- borderBottomLeftRadius: Ct,
2684
- borderBottomRightRadius: Ct,
2685
- boxShadow: us
2686
- }, vs = {
2687
- measureLayout: fs
2688
- };
2689
- function ds(t, e, r) {
2690
- r === void 0 && (r = {});
2691
- var n = tt(t) ? t : Pt(t);
2692
- return Ke("", n, e, r), {
2693
- stop: function() {
2694
- return n.stop();
2695
- },
2696
- isAnimating: function() {
2697
- return n.isAnimating();
2698
- }
2699
- };
2700
- }
2701
- var Xn = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], ps = Xn.length, Rr = function(t) {
2702
- return typeof t == "string" ? parseFloat(t) : t;
2703
- }, Dr = function(t) {
2704
- return typeof t == "number" || T.test(t);
2705
- };
2706
- function hs(t, e, r, n, i, s) {
2707
- var o, a, u, l;
2708
- i ? (t.opacity = O(
2709
- 0,
2710
- // (follow?.opacity as number) ?? 0,
2711
- // TODO Reinstate this if only child
2712
- (o = r.opacity) !== null && o !== void 0 ? o : 1,
2713
- ms(n)
2714
- ), t.opacityExit = O((a = e.opacity) !== null && a !== void 0 ? a : 1, 0, gs(n))) : s && (t.opacity = O((u = e.opacity) !== null && u !== void 0 ? u : 1, (l = r.opacity) !== null && l !== void 0 ? l : 1, n));
2715
- for (var f = 0; f < ps; f++) {
2716
- var v = "border".concat(Xn[f], "Radius"), c = Mr(e, v), d = Mr(r, v);
2717
- if (!(c === void 0 && d === void 0)) {
2718
- c || (c = 0), d || (d = 0);
2719
- var p = c === 0 || d === 0 || Dr(c) === Dr(d);
2720
- p ? (t[v] = Math.max(O(Rr(c), Rr(d), n), 0), (Dt.test(d) || Dt.test(c)) && (t[v] += "%")) : t[v] = d;
2721
- }
2722
- }
2723
- (e.rotate || r.rotate) && (t.rotate = O(e.rotate || 0, r.rotate || 0, n));
2724
- }
2725
- function Mr(t, e) {
2726
- var r;
2727
- return (r = t[e]) !== null && r !== void 0 ? r : t.borderRadius;
2728
- }
2729
- var ms = Wn(0, 0.5, Wr), gs = Wn(0.5, 0.95, Xr);
2730
- function Wn(t, e, r) {
2731
- return function(n) {
2732
- return n < t ? 0 : n > e ? 1 : r(me(t, e, n));
2733
- };
2734
- }
2735
- function Ir(t, e) {
2736
- t.min = e.min, t.max = e.max;
2737
- }
2738
- function Y(t, e) {
2739
- Ir(t.x, e.x), Ir(t.y, e.y);
2740
- }
2741
- function Or(t, e, r, n, i) {
2742
- return t -= e, t = Qt(t, 1 / r, n), i !== void 0 && (t = Qt(t, 1 / i, n)), t;
2743
- }
2744
- function ys(t, e, r, n, i, s, o) {
2745
- if (e === void 0 && (e = 0), r === void 0 && (r = 1), n === void 0 && (n = 0.5), s === void 0 && (s = t), o === void 0 && (o = t), Dt.test(e)) {
2746
- e = parseFloat(e);
2747
- var a = O(o.min, o.max, e / 100);
2748
- e = a - o.min;
2749
- }
2750
- if (typeof e == "number") {
2751
- var u = O(s.min, s.max, n);
2752
- t === s && (u -= e), t.min = Or(t.min, e, r, u, i), t.max = Or(t.max, e, r, u, i);
2753
- }
2754
- }
2755
- function Fr(t, e, r, n, i) {
2756
- var s = I(r, 3), o = s[0], a = s[1], u = s[2];
2757
- ys(t, e[o], e[a], e[u], e.scale, n, i);
2758
- }
2759
- var Ps = ["x", "scaleX", "originX"], bs = ["y", "scaleY", "originY"];
2760
- function jr(t, e, r, n) {
2761
- Fr(t.x, e, Ps, r?.x, n?.x), Fr(t.y, e, bs, r?.y, n?.y);
2762
- }
2763
- function Br(t) {
2764
- return t.translate === 0 && t.scale === 1;
2765
- }
2766
- function Zn(t) {
2767
- return Br(t.x) && Br(t.y);
2768
- }
2769
- function $n(t, e) {
2770
- return t.x.min === e.x.min && t.x.max === e.x.max && t.y.min === e.y.min && t.y.max === e.y.max;
2771
- }
2772
- var Vs = (
2773
- /** @class */
2774
- function() {
2775
- function t() {
2776
- this.members = [];
2777
- }
2778
- return t.prototype.add = function(e) {
2779
- Ge(this.members, e), e.scheduleRender();
2780
- }, t.prototype.remove = function(e) {
2781
- if (Ye(this.members, e), e === this.prevLead && (this.prevLead = void 0), e === this.lead) {
2782
- var r = this.members[this.members.length - 1];
2783
- r && this.promote(r);
2784
- }
2785
- }, t.prototype.relegate = function(e) {
2786
- var r = this.members.findIndex(function(o) {
2787
- return e === o;
2788
- });
2789
- if (r === 0)
2790
- return !1;
2791
- for (var n, i = r; i >= 0; i--) {
2792
- var s = this.members[i];
2793
- if (s.isPresent !== !1) {
2794
- n = s;
2795
- break;
2796
- }
2797
- }
2798
- return n ? (this.promote(n), !0) : !1;
2799
- }, t.prototype.promote = function(e, r) {
2800
- var n, i = this.lead;
2801
- if (e !== i && (this.prevLead = i, this.lead = e, e.show(), i)) {
2802
- i.instance && i.scheduleRender(), e.scheduleRender(), e.resumeFrom = i, r && (e.resumeFrom.preserveOpacity = !0), i.snapshot && (e.snapshot = i.snapshot, e.snapshot.latestValues = i.animationValues || i.latestValues, e.snapshot.isShared = !0), !((n = e.root) === null || n === void 0) && n.isUpdating && (e.isLayoutDirty = !0);
2803
- var s = e.options.crossfade;
2804
- s === !1 && i.hide();
2805
- }
2806
- }, t.prototype.exitAnimationComplete = function() {
2807
- this.members.forEach(function(e) {
2808
- var r, n, i, s, o;
2809
- (n = (r = e.options).onExitComplete) === null || n === void 0 || n.call(r), (o = (i = e.resumingFrom) === null || i === void 0 ? void 0 : (s = i.options).onExitComplete) === null || o === void 0 || o.call(s);
2810
- });
2811
- }, t.prototype.scheduleRender = function() {
2812
- this.members.forEach(function(e) {
2813
- e.instance && e.scheduleRender(!1);
2814
- });
2815
- }, t.prototype.removeLeadSnapshot = function() {
2816
- this.lead && this.lead.snapshot && (this.lead.snapshot = void 0);
2817
- }, t;
2818
- }()
2819
- ), Ts = "translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";
2820
- function _r(t, e, r) {
2821
- var n = t.x.translate / e.x, i = t.y.translate / e.y, s = "translate3d(".concat(n, "px, ").concat(i, "px, 0) ");
2822
- if (s += "scale(".concat(1 / e.x, ", ").concat(1 / e.y, ") "), r) {
2823
- var o = r.rotate, a = r.rotateX, u = r.rotateY;
2824
- o && (s += "rotate(".concat(o, "deg) ")), a && (s += "rotateX(".concat(a, "deg) ")), u && (s += "rotateY(".concat(u, "deg) "));
2825
- }
2826
- var l = t.x.scale * e.x, f = t.y.scale * e.y;
2827
- return s += "scale(".concat(l, ", ").concat(f, ")"), s === Ts ? "none" : s;
2828
- }
2829
- var Ss = function(t, e) {
2830
- return t.depth - e.depth;
2831
- }, xs = (
2832
- /** @class */
2833
- function() {
2834
- function t() {
2835
- this.children = [], this.isDirty = !1;
2836
- }
2837
- return t.prototype.add = function(e) {
2838
- Ge(this.children, e), this.isDirty = !0;
2839
- }, t.prototype.remove = function(e) {
2840
- Ye(this.children, e), this.isDirty = !0;
2841
- }, t.prototype.forEach = function(e) {
2842
- this.isDirty && this.children.sort(Ss), this.isDirty = !1, this.children.forEach(e);
2843
- }, t;
2844
- }()
2845
- ), Ur = 1e3;
2846
- function qn(t) {
2847
- var e = t.attachResizeListener, r = t.defaultParent, n = t.measureScroll, i = t.checkIsScrollRoot, s = t.resetTransform;
2848
- return (
2849
- /** @class */
2850
- function() {
2851
- function o(a, u, l) {
2852
- var f = this;
2853
- u === void 0 && (u = {}), l === void 0 && (l = r?.()), this.children = /* @__PURE__ */ new Set(), this.options = {}, this.isTreeAnimating = !1, this.isAnimationBlocked = !1, this.isLayoutDirty = !1, this.updateManuallyBlocked = !1, this.updateBlockedByResize = !1, this.isUpdating = !1, this.isSVG = !1, this.needsReset = !1, this.shouldResetTransform = !1, this.treeScale = { x: 1, y: 1 }, this.eventHandlers = /* @__PURE__ */ new Map(), this.potentialNodes = /* @__PURE__ */ new Map(), this.checkUpdateFailed = function() {
2854
- f.isUpdating && (f.isUpdating = !1, f.clearAllSnapshots());
2855
- }, this.updateProjection = function() {
2856
- f.nodes.forEach(Rs), f.nodes.forEach(Ds);
2857
- }, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.id = a, this.latestValues = u, this.root = l ? l.root || l : this, this.path = l ? W(W([], I(l.path), !1), [l], !1) : [], this.parent = l, this.depth = l ? l.depth + 1 : 0, a && this.root.registerPotentialNode(a, this);
2858
- for (var v = 0; v < this.path.length; v++)
2859
- this.path[v].shouldResetTransform = !0;
2860
- this.root === this && (this.nodes = new xs());
2861
- }
2862
- return o.prototype.addEventListener = function(a, u) {
2863
- return this.eventHandlers.has(a) || this.eventHandlers.set(a, new wt()), this.eventHandlers.get(a).add(u);
2864
- }, o.prototype.notifyListeners = function(a) {
2865
- for (var u = [], l = 1; l < arguments.length; l++)
2866
- u[l - 1] = arguments[l];
2867
- var f = this.eventHandlers.get(a);
2868
- f?.notify.apply(f, W([], I(u), !1));
2869
- }, o.prototype.hasListeners = function(a) {
2870
- return this.eventHandlers.has(a);
2871
- }, o.prototype.registerPotentialNode = function(a, u) {
2872
- this.potentialNodes.set(a, u);
2873
- }, o.prototype.mount = function(a, u) {
2874
- var l = this, f;
2875
- if (u === void 0 && (u = !1), !this.instance) {
2876
- this.isSVG = a instanceof SVGElement && a.tagName !== "svg", this.instance = a;
2877
- var v = this.options, c = v.layoutId, d = v.layout, p = v.visualElement;
2878
- if (p && !p.getInstance() && p.mount(a), this.root.nodes.add(this), (f = this.parent) === null || f === void 0 || f.children.add(this), this.id && this.root.potentialNodes.delete(this.id), u && (d || c) && (this.isLayoutDirty = !0), e) {
2879
- var h, g = function() {
2880
- return l.root.updateBlockedByResize = !1;
2881
- };
2882
- e(a, function() {
2883
- l.root.updateBlockedByResize = !0, clearTimeout(h), h = window.setTimeout(g, 250), At.hasAnimatedSinceResize && (At.hasAnimatedSinceResize = !1, l.nodes.forEach(Ls));
2884
- });
2885
- }
2886
- c && this.root.registerSharedNode(c, this), this.options.animate !== !1 && p && (c || d) && this.addEventListener("didUpdate", function(P) {
2887
- var b, S, C, A, M, R = P.delta, x = P.hasLayoutChanged, w = P.hasRelativeTargetChanged, D = P.layout;
2888
- if (l.isTreeAnimationBlocked()) {
2889
- l.target = void 0, l.relativeTarget = void 0;
2890
- return;
2891
- }
2892
- var H = (S = (b = l.options.transition) !== null && b !== void 0 ? b : p.getDefaultTransition()) !== null && S !== void 0 ? S : js, B = p.getProps(), N = B.onLayoutAnimationStart, rt = B.onLayoutAnimationComplete, nt = !l.targetLayout || !$n(l.targetLayout, D) || w, it = !x && w;
2893
- if (!((C = l.resumeFrom) === null || C === void 0) && C.instance || it || x && (nt || !l.currentAnimation)) {
2894
- l.resumeFrom && (l.resumingFrom = l.resumeFrom, l.resumingFrom.resumingFrom = void 0), l.setAnimationOrigin(R, it);
2895
- var z = m(m({}, ze(H, "layout")), { onPlay: N, onComplete: rt });
2896
- p.shouldReduceMotion && (z.delay = 0, z.type = !1), l.startAnimation(z);
2897
- } else
2898
- !x && l.animationProgress === 0 && l.finishAnimation(), l.isLead() && ((M = (A = l.options).onExitComplete) === null || M === void 0 || M.call(A));
2899
- l.targetLayout = D;
2900
- });
2901
- }
2902
- }, o.prototype.unmount = function() {
2903
- var a, u;
2904
- this.options.layoutId && this.willUpdate(), this.root.nodes.remove(this), (a = this.getStack()) === null || a === void 0 || a.remove(this), (u = this.parent) === null || u === void 0 || u.children.delete(this), this.instance = void 0, Mt.preRender(this.updateProjection);
2905
- }, o.prototype.blockUpdate = function() {
2906
- this.updateManuallyBlocked = !0;
2907
- }, o.prototype.unblockUpdate = function() {
2908
- this.updateManuallyBlocked = !1;
2909
- }, o.prototype.isUpdateBlocked = function() {
2910
- return this.updateManuallyBlocked || this.updateBlockedByResize;
2911
- }, o.prototype.isTreeAnimationBlocked = function() {
2912
- var a;
2913
- return this.isAnimationBlocked || ((a = this.parent) === null || a === void 0 ? void 0 : a.isTreeAnimationBlocked()) || !1;
2914
- }, o.prototype.startUpdate = function() {
2915
- var a;
2916
- this.isUpdateBlocked() || (this.isUpdating = !0, (a = this.nodes) === null || a === void 0 || a.forEach(Ms));
2917
- }, o.prototype.willUpdate = function(a) {
2918
- var u, l, f;
2919
- if (a === void 0 && (a = !0), this.root.isUpdateBlocked()) {
2920
- (l = (u = this.options).onExitComplete) === null || l === void 0 || l.call(u);
2921
- return;
2922
- }
2923
- if (!this.root.isUpdating && this.root.startUpdate(), !this.isLayoutDirty) {
2924
- this.isLayoutDirty = !0;
2925
- for (var v = 0; v < this.path.length; v++) {
2926
- var c = this.path[v];
2927
- c.shouldResetTransform = !0, c.updateScroll();
2928
- }
2929
- var d = this.options, p = d.layoutId, h = d.layout;
2930
- if (!(p === void 0 && !h)) {
2931
- var g = (f = this.options.visualElement) === null || f === void 0 ? void 0 : f.getProps().transformTemplate;
2932
- this.prevTransformTemplateValue = g?.(this.latestValues, ""), this.updateSnapshot(), a && this.notifyListeners("willUpdate");
2933
- }
2934
- }
2935
- }, o.prototype.didUpdate = function() {
2936
- var a = this.isUpdateBlocked();
2937
- if (a) {
2938
- this.unblockUpdate(), this.clearAllSnapshots(), this.nodes.forEach(Nr);
2939
- return;
2940
- }
2941
- this.isUpdating && (this.isUpdating = !1, this.potentialNodes.size && (this.potentialNodes.forEach(Bs), this.potentialNodes.clear()), this.nodes.forEach(Es), this.nodes.forEach(Cs), this.nodes.forEach(As), this.clearAllSnapshots(), oe.update(), oe.preRender(), oe.render());
2942
- }, o.prototype.clearAllSnapshots = function() {
2943
- this.nodes.forEach(ws), this.sharedNodes.forEach(Is);
2944
- }, o.prototype.scheduleUpdateProjection = function() {
2945
- $.preRender(this.updateProjection, !1, !0);
2946
- }, o.prototype.scheduleCheckAfterUnmount = function() {
2947
- var a = this;
2948
- $.postRender(function() {
2949
- a.isLayoutDirty ? a.root.didUpdate() : a.root.checkUpdateFailed();
2950
- });
2951
- }, o.prototype.updateSnapshot = function() {
2952
- if (!(this.snapshot || !this.instance)) {
2953
- var a = this.measure(), u = this.removeTransform(this.removeElementScroll(a));
2954
- Gr(u), this.snapshot = {
2955
- measured: a,
2956
- layout: u,
2957
- latestValues: {}
2958
- };
2959
- }
2960
- }, o.prototype.updateLayout = function() {
2961
- var a;
2962
- if (this.instance && (this.updateScroll(), !(!(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty))) {
2963
- if (this.resumeFrom && !this.resumeFrom.instance)
2964
- for (var u = 0; u < this.path.length; u++) {
2965
- var l = this.path[u];
2966
- l.updateScroll();
2967
- }
2968
- var f = this.measure();
2969
- Gr(f);
2970
- var v = this.layout;
2971
- this.layout = {
2972
- measured: f,
2973
- actual: this.removeElementScroll(f)
2974
- }, this.layoutCorrected = j(), this.isLayoutDirty = !1, this.projectionDelta = void 0, this.notifyListeners("measure", this.layout.actual), (a = this.options.visualElement) === null || a === void 0 || a.notifyLayoutMeasure(this.layout.actual, v?.actual);
2975
- }
2976
- }, o.prototype.updateScroll = function() {
2977
- this.options.layoutScroll && this.instance && (this.isScrollRoot = i(this.instance), this.scroll = n(this.instance));
2978
- }, o.prototype.resetTransform = function() {
2979
- var a;
2980
- if (s) {
2981
- var u = this.isLayoutDirty || this.shouldResetTransform, l = this.projectionDelta && !Zn(this.projectionDelta), f = (a = this.options.visualElement) === null || a === void 0 ? void 0 : a.getProps().transformTemplate, v = f?.(this.latestValues, ""), c = v !== this.prevTransformTemplateValue;
2982
- u && (l || ot(this.latestValues) || c) && (s(this.instance, v), this.shouldResetTransform = !1, this.scheduleRender());
2983
- }
2984
- }, o.prototype.measure = function() {
2985
- var a = this.options.visualElement;
2986
- if (!a)
2987
- return j();
2988
- var u = a.measureViewportBox(), l = this.root.scroll;
2989
- return l && (st(u.x, l.x), st(u.y, l.y)), u;
2990
- }, o.prototype.removeElementScroll = function(a) {
2991
- var u = j();
2992
- Y(u, a);
2993
- for (var l = 0; l < this.path.length; l++) {
2994
- var f = this.path[l], v = f.scroll, c = f.options, d = f.isScrollRoot;
2995
- if (f !== this.root && v && c.layoutScroll) {
2996
- if (d) {
2997
- Y(u, a);
2998
- var p = this.root.scroll;
2999
- p && (st(u.x, -p.x), st(u.y, -p.y));
3000
- }
3001
- st(u.x, v.x), st(u.y, v.y);
3002
- }
3003
- }
3004
- return u;
3005
- }, o.prototype.applyTransform = function(a, u) {
3006
- u === void 0 && (u = !1);
3007
- var l = j();
3008
- Y(l, a);
3009
- for (var f = 0; f < this.path.length; f++) {
3010
- var v = this.path[f];
3011
- !u && v.options.layoutScroll && v.scroll && v !== v.root && mt(l, {
3012
- x: -v.scroll.x,
3013
- y: -v.scroll.y
3014
- }), ot(v.latestValues) && mt(l, v.latestValues);
3015
- }
3016
- return ot(this.latestValues) && mt(l, this.latestValues), l;
3017
- }, o.prototype.removeTransform = function(a) {
3018
- var u, l = j();
3019
- Y(l, a);
3020
- for (var f = 0; f < this.path.length; f++) {
3021
- var v = this.path[f];
3022
- if (v.instance && ot(v.latestValues)) {
3023
- _n(v.latestValues) && v.updateSnapshot();
3024
- var c = j(), d = v.measure();
3025
- Y(c, d), jr(l, v.latestValues, (u = v.snapshot) === null || u === void 0 ? void 0 : u.layout, c);
3026
- }
3027
- }
3028
- return ot(this.latestValues) && jr(l, this.latestValues), l;
3029
- }, o.prototype.setTargetDelta = function(a) {
3030
- this.targetDelta = a, this.root.scheduleUpdateProjection();
3031
- }, o.prototype.setOptions = function(a) {
3032
- var u;
3033
- this.options = m(m(m({}, this.options), a), { crossfade: (u = a.crossfade) !== null && u !== void 0 ? u : !0 });
3034
- }, o.prototype.clearMeasurements = function() {
3035
- this.scroll = void 0, this.layout = void 0, this.snapshot = void 0, this.prevTransformTemplateValue = void 0, this.targetDelta = void 0, this.target = void 0, this.isLayoutDirty = !1;
3036
- }, o.prototype.resolveTargetDelta = function() {
3037
- var a, u = this.options, l = u.layout, f = u.layoutId;
3038
- !this.layout || !(l || f) || (!this.targetDelta && !this.relativeTarget && (this.relativeParent = this.getClosestProjectingParent(), this.relativeParent && this.relativeParent.layout && (this.relativeTarget = j(), this.relativeTargetOrigin = j(), Lt(this.relativeTargetOrigin, this.layout.actual, this.relativeParent.layout.actual), Y(this.relativeTarget, this.relativeTargetOrigin))), !(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target = j(), this.targetWithTransforms = j()), this.relativeTarget && this.relativeTargetOrigin && (!((a = this.relativeParent) === null || a === void 0) && a.target) ? xo(this.target, this.relativeTarget, this.relativeParent.target) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.actual) : Y(this.target, this.layout.actual), Un(this.target, this.targetDelta)) : Y(this.target, this.layout.actual), this.attemptToResolveRelativeTarget && (this.attemptToResolveRelativeTarget = !1, this.relativeParent = this.getClosestProjectingParent(), this.relativeParent && !!this.relativeParent.resumingFrom == !!this.resumingFrom && !this.relativeParent.options.layoutScroll && this.relativeParent.target && (this.relativeTarget = j(), this.relativeTargetOrigin = j(), Lt(this.relativeTargetOrigin, this.target, this.relativeParent.target), Y(this.relativeTarget, this.relativeTargetOrigin)))));
3039
- }, o.prototype.getClosestProjectingParent = function() {
3040
- if (!(!this.parent || ot(this.parent.latestValues)))
3041
- return (this.parent.relativeTarget || this.parent.targetDelta) && this.parent.layout ? this.parent : this.parent.getClosestProjectingParent();
3042
- }, o.prototype.calcProjection = function() {
3043
- var a, u = this.options, l = u.layout, f = u.layoutId;
3044
- if (this.isTreeAnimating = !!(!((a = this.parent) === null || a === void 0) && a.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !(!this.layout || !(l || f))) {
3045
- var v = this.getLead();
3046
- Y(this.layoutCorrected, this.layout.actual), Io(this.layoutCorrected, this.treeScale, this.path, !!this.resumingFrom || this !== v);
3047
- var c = v.target;
3048
- if (c) {
3049
- this.projectionDelta || (this.projectionDelta = Rt(), this.projectionDeltaWithTransform = Rt());
3050
- var d = this.treeScale.x, p = this.treeScale.y, h = this.projectionTransform;
3051
- Et(this.projectionDelta, this.layoutCorrected, c, this.latestValues), this.projectionTransform = _r(this.projectionDelta, this.treeScale), (this.projectionTransform !== h || this.treeScale.x !== d || this.treeScale.y !== p) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", c));
3052
- }
3053
- }
3054
- }, o.prototype.hide = function() {
3055
- this.isVisible = !1;
3056
- }, o.prototype.show = function() {
3057
- this.isVisible = !0;
3058
- }, o.prototype.scheduleRender = function(a) {
3059
- var u, l, f;
3060
- a === void 0 && (a = !0), (l = (u = this.options).scheduleRender) === null || l === void 0 || l.call(u), a && ((f = this.getStack()) === null || f === void 0 || f.scheduleRender()), this.resumingFrom && !this.resumingFrom.instance && (this.resumingFrom = void 0);
3061
- }, o.prototype.setAnimationOrigin = function(a, u) {
3062
- var l = this, f;
3063
- u === void 0 && (u = !1);
3064
- var v = this.snapshot, c = v?.latestValues || {}, d = m({}, this.latestValues), p = Rt();
3065
- this.relativeTarget = this.relativeTargetOrigin = void 0, this.attemptToResolveRelativeTarget = !u;
3066
- var h = j(), g = v?.isShared, P = (((f = this.getStack()) === null || f === void 0 ? void 0 : f.members.length) || 0) <= 1, b = !!(g && !P && this.options.crossfade === !0 && !this.path.some(Fs));
3067
- this.animationProgress = 0, this.mixTargetDelta = function(S) {
3068
- var C, A = S / 1e3;
3069
- Hr(p.x, a.x, A), Hr(p.y, a.y, A), l.setTargetDelta(p), l.relativeTarget && l.relativeTargetOrigin && l.layout && (!((C = l.relativeParent) === null || C === void 0) && C.layout) && (Lt(h, l.layout.actual, l.relativeParent.layout.actual), Os(l.relativeTarget, l.relativeTargetOrigin, h, A)), g && (l.animationValues = d, hs(d, c, l.latestValues, A, b, P)), l.root.scheduleUpdateProjection(), l.scheduleRender(), l.animationProgress = A;
3070
- }, this.mixTargetDelta(0);
3071
- }, o.prototype.startAnimation = function(a) {
3072
- var u = this, l, f;
3073
- this.notifyListeners("animationStart"), (l = this.currentAnimation) === null || l === void 0 || l.stop(), this.resumingFrom && ((f = this.resumingFrom.currentAnimation) === null || f === void 0 || f.stop()), this.pendingAnimation && (Mt.update(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = $.update(function() {
3074
- At.hasAnimatedSinceResize = !0, u.currentAnimation = ds(0, Ur, m(m({}, a), { onUpdate: function(v) {
3075
- var c;
3076
- u.mixTargetDelta(v), (c = a.onUpdate) === null || c === void 0 || c.call(a, v);
3077
- }, onComplete: function() {
3078
- var v;
3079
- (v = a.onComplete) === null || v === void 0 || v.call(a), u.completeAnimation();
3080
- } })), u.resumingFrom && (u.resumingFrom.currentAnimation = u.currentAnimation), u.pendingAnimation = void 0;
3081
- });
3082
- }, o.prototype.completeAnimation = function() {
3083
- var a;
3084
- this.resumingFrom && (this.resumingFrom.currentAnimation = void 0, this.resumingFrom.preserveOpacity = void 0), (a = this.getStack()) === null || a === void 0 || a.exitAnimationComplete(), this.resumingFrom = this.currentAnimation = this.animationValues = void 0, this.notifyListeners("animationComplete");
3085
- }, o.prototype.finishAnimation = function() {
3086
- var a;
3087
- this.currentAnimation && ((a = this.mixTargetDelta) === null || a === void 0 || a.call(this, Ur), this.currentAnimation.stop()), this.completeAnimation();
3088
- }, o.prototype.applyTransformsToTarget = function() {
3089
- var a = this.getLead(), u = a.targetWithTransforms, l = a.target, f = a.layout, v = a.latestValues;
3090
- !u || !l || !f || (Y(u, l), mt(u, v), Et(this.projectionDeltaWithTransform, this.layoutCorrected, u, v));
3091
- }, o.prototype.registerSharedNode = function(a, u) {
3092
- var l, f, v;
3093
- this.sharedNodes.has(a) || this.sharedNodes.set(a, new Vs());
3094
- var c = this.sharedNodes.get(a);
3095
- c.add(u), u.promote({
3096
- transition: (l = u.options.initialPromotionConfig) === null || l === void 0 ? void 0 : l.transition,
3097
- preserveFollowOpacity: (v = (f = u.options.initialPromotionConfig) === null || f === void 0 ? void 0 : f.shouldPreserveFollowOpacity) === null || v === void 0 ? void 0 : v.call(f, u)
3098
- });
3099
- }, o.prototype.isLead = function() {
3100
- var a = this.getStack();
3101
- return a ? a.lead === this : !0;
3102
- }, o.prototype.getLead = function() {
3103
- var a, u = this.options.layoutId;
3104
- return u ? ((a = this.getStack()) === null || a === void 0 ? void 0 : a.lead) || this : this;
3105
- }, o.prototype.getPrevLead = function() {
3106
- var a, u = this.options.layoutId;
3107
- return u ? (a = this.getStack()) === null || a === void 0 ? void 0 : a.prevLead : void 0;
3108
- }, o.prototype.getStack = function() {
3109
- var a = this.options.layoutId;
3110
- if (a)
3111
- return this.root.sharedNodes.get(a);
3112
- }, o.prototype.promote = function(a) {
3113
- var u = a === void 0 ? {} : a, l = u.needsReset, f = u.transition, v = u.preserveFollowOpacity, c = this.getStack();
3114
- c && c.promote(this, v), l && (this.projectionDelta = void 0, this.needsReset = !0), f && this.setOptions({ transition: f });
3115
- }, o.prototype.relegate = function() {
3116
- var a = this.getStack();
3117
- return a ? a.relegate(this) : !1;
3118
- }, o.prototype.resetRotation = function() {
3119
- var a = this.options.visualElement;
3120
- if (a) {
3121
- for (var u = !1, l = {}, f = 0; f < Pe.length; f++) {
3122
- var v = Pe[f], c = "rotate" + v;
3123
- a.getStaticValue(c) && (u = !0, l[c] = a.getStaticValue(c), a.setStaticValue(c, 0));
3124
- }
3125
- if (u) {
3126
- a?.syncRender();
3127
- for (var c in l)
3128
- a.setStaticValue(c, l[c]);
3129
- a.scheduleRender();
3130
- }
3131
- }
3132
- }, o.prototype.getProjectionStyles = function(a) {
3133
- var u, l, f, v, c, d;
3134
- a === void 0 && (a = {});
3135
- var p = {};
3136
- if (!this.instance || this.isSVG)
3137
- return p;
3138
- if (this.isVisible)
3139
- p.visibility = "";
3140
- else
3141
- return { visibility: "hidden" };
3142
- var h = (u = this.options.visualElement) === null || u === void 0 ? void 0 : u.getProps().transformTemplate;
3143
- if (this.needsReset)
3144
- return this.needsReset = !1, p.opacity = "", p.pointerEvents = Xt(a.pointerEvents) || "", p.transform = h ? h(this.latestValues, "") : "none", p;
3145
- var g = this.getLead();
3146
- if (!this.projectionDelta || !this.layout || !g.target) {
3147
- var P = {};
3148
- return this.options.layoutId && (P.opacity = (l = this.latestValues.opacity) !== null && l !== void 0 ? l : 1, P.pointerEvents = Xt(a.pointerEvents) || ""), this.hasProjected && !ot(this.latestValues) && (P.transform = h ? h({}, "") : "none", this.hasProjected = !1), P;
3149
- }
3150
- var b = g.animationValues || g.latestValues;
3151
- this.applyTransformsToTarget(), p.transform = _r(this.projectionDeltaWithTransform, this.treeScale, b), h && (p.transform = h(b, p.transform));
3152
- var S = this.projectionDelta, C = S.x, A = S.y;
3153
- p.transformOrigin = "".concat(C.origin * 100, "% ").concat(A.origin * 100, "% 0"), g.animationValues ? p.opacity = g === this ? (v = (f = b.opacity) !== null && f !== void 0 ? f : this.latestValues.opacity) !== null && v !== void 0 ? v : 1 : this.preserveOpacity ? this.latestValues.opacity : b.opacityExit : p.opacity = g === this ? (c = b.opacity) !== null && c !== void 0 ? c : "" : (d = b.opacityExit) !== null && d !== void 0 ? d : 0;
3154
- for (var M in Zt)
3155
- if (b[M] !== void 0) {
3156
- var R = Zt[M], x = R.correct, w = R.applyTo, D = x(b[M], g);
3157
- if (w)
3158
- for (var H = w.length, B = 0; B < H; B++)
3159
- p[w[B]] = D;
3160
- else
3161
- p[M] = D;
3162
- }
3163
- return this.options.layoutId && (p.pointerEvents = g === this ? Xt(a.pointerEvents) || "" : "none"), p;
3164
- }, o.prototype.clearSnapshot = function() {
3165
- this.resumeFrom = this.snapshot = void 0;
3166
- }, o.prototype.resetTree = function() {
3167
- this.root.nodes.forEach(function(a) {
3168
- var u;
3169
- return (u = a.currentAnimation) === null || u === void 0 ? void 0 : u.stop();
3170
- }), this.root.nodes.forEach(Nr), this.root.sharedNodes.clear();
3171
- }, o;
3172
- }()
3173
- );
3174
- }
3175
- function Cs(t) {
3176
- t.updateLayout();
3177
- }
3178
- function As(t) {
3179
- var e, r, n, i, s = (r = (e = t.resumeFrom) === null || e === void 0 ? void 0 : e.snapshot) !== null && r !== void 0 ? r : t.snapshot;
3180
- if (t.isLead() && t.layout && s && t.hasListeners("didUpdate")) {
3181
- var o = t.layout, a = o.actual, u = o.measured;
3182
- t.options.animationType === "size" ? Z(function(b) {
3183
- var S = s.isShared ? s.measured[b] : s.layout[b], C = et(S);
3184
- S.min = a[b].min, S.max = S.min + C;
3185
- }) : t.options.animationType === "position" && Z(function(b) {
3186
- var S = s.isShared ? s.measured[b] : s.layout[b], C = et(a[b]);
3187
- S.max = S.min + C;
3188
- });
3189
- var l = Rt();
3190
- Et(l, a, s.layout);
3191
- var f = Rt();
3192
- s.isShared ? Et(f, t.applyTransform(u, !0), s.measured) : Et(f, a, s.layout);
3193
- var v = !Zn(l), c = !1;
3194
- if (!t.resumeFrom && (t.relativeParent = t.getClosestProjectingParent(), t.relativeParent && !t.relativeParent.resumeFrom)) {
3195
- var d = t.relativeParent, p = d.snapshot, h = d.layout;
3196
- if (p && h) {
3197
- var g = j();
3198
- Lt(g, s.layout, p.layout);
3199
- var P = j();
3200
- Lt(P, a, h.actual), $n(g, P) || (c = !0);
3201
- }
3202
- }
3203
- t.notifyListeners("didUpdate", {
3204
- layout: a,
3205
- snapshot: s,
3206
- delta: f,
3207
- layoutDelta: l,
3208
- hasLayoutChanged: v,
3209
- hasRelativeTargetChanged: c
3210
- });
3211
- } else t.isLead() && ((i = (n = t.options).onExitComplete) === null || i === void 0 || i.call(n));
3212
- t.options.transition = void 0;
3213
- }
3214
- function ws(t) {
3215
- t.clearSnapshot();
3216
- }
3217
- function Nr(t) {
3218
- t.clearMeasurements();
3219
- }
3220
- function Es(t) {
3221
- var e = t.options.visualElement;
3222
- e?.getProps().onBeforeLayoutMeasure && e.notifyBeforeLayoutMeasure(), t.resetTransform();
3223
- }
3224
- function Ls(t) {
3225
- t.finishAnimation(), t.targetDelta = t.relativeTarget = t.target = void 0;
3226
- }
3227
- function Rs(t) {
3228
- t.resolveTargetDelta();
3229
- }
3230
- function Ds(t) {
3231
- t.calcProjection();
3232
- }
3233
- function Ms(t) {
3234
- t.resetRotation();
3235
- }
3236
- function Is(t) {
3237
- t.removeLeadSnapshot();
3238
- }
3239
- function Hr(t, e, r) {
3240
- t.translate = O(e.translate, 0, r), t.scale = O(e.scale, 1, r), t.origin = e.origin, t.originPoint = e.originPoint;
3241
- }
3242
- function zr(t, e, r, n) {
3243
- t.min = O(e.min, r.min, n), t.max = O(e.max, r.max, n);
3244
- }
3245
- function Os(t, e, r, n) {
3246
- zr(t.x, e.x, r.x, n), zr(t.y, e.y, r.y, n);
3247
- }
3248
- function Fs(t) {
3249
- return t.animationValues && t.animationValues.opacityExit !== void 0;
3250
- }
3251
- var js = {
3252
- duration: 0.45,
3253
- ease: [0.4, 0, 0.1, 1]
3254
- };
3255
- function Bs(t, e) {
3256
- for (var r = t.root, n = t.path.length - 1; n >= 0; n--)
3257
- if (t.path[n].instance) {
3258
- r = t.path[n];
3259
- break;
3260
- }
3261
- var i = r && r !== t.root ? r.instance : document, s = i.querySelector('[data-projection-id="'.concat(e, '"]'));
3262
- s && t.mount(s, !0);
3263
- }
3264
- function Kr(t) {
3265
- t.min = Math.round(t.min), t.max = Math.round(t.max);
3266
- }
3267
- function Gr(t) {
3268
- Kr(t.x), Kr(t.y);
3269
- }
3270
- var _s = qn({
3271
- attachResizeListener: function(t, e) {
3272
- return ne(t, "resize", e);
3273
- },
3274
- measureScroll: function() {
3275
- return {
3276
- x: document.documentElement.scrollLeft || document.body.scrollLeft,
3277
- y: document.documentElement.scrollTop || document.body.scrollTop
3278
- };
3279
- },
3280
- checkIsScrollRoot: function() {
3281
- return !0;
3282
- }
3283
- }), ve = {
3284
- current: void 0
3285
- }, Us = qn({
3286
- measureScroll: function(t) {
3287
- return {
3288
- x: t.scrollLeft,
3289
- y: t.scrollTop
3290
- };
3291
- },
3292
- defaultParent: function() {
3293
- if (!ve.current) {
3294
- var t = new _s(0, {});
3295
- t.mount(window), t.setOptions({ layoutScroll: !0 }), ve.current = t;
3296
- }
3297
- return ve.current;
3298
- },
3299
- resetTransform: function(t, e) {
3300
- t.style.transform = e ?? "none";
3301
- },
3302
- checkIsScrollRoot: function(t) {
3303
- return window.getComputedStyle(t).position === "fixed";
3304
- }
3305
- }), Ns = m(m(m(m({}, Vo), Ua), zo), vs), Xs = /* @__PURE__ */ Gi(function(t, e) {
3306
- return ya(t, e, Ns, ss, Us);
3307
- });
3308
- function Jn() {
3309
- var t = q(!1);
3310
- return Wt(function() {
3311
- return t.current = !0, function() {
3312
- t.current = !1;
3313
- };
3314
- }, []), t;
3315
- }
3316
- function Hs() {
3317
- var t = Jn(), e = I(qr(0), 2), r = e[0], n = e[1], i = ge(function() {
3318
- t.current && n(r + 1);
3319
- }, [r]), s = ge(function() {
3320
- return $.postRender(i);
3321
- }, [i]);
3322
- return [s, r];
3323
- }
3324
- var de = function(t) {
3325
- var e = t.children, r = t.initial, n = t.isPresent, i = t.onExitComplete, s = t.custom, o = t.presenceAffectsLayout, a = _t(zs), u = Ln(), l = It(
3326
- function() {
3327
- return {
3328
- id: u,
3329
- initial: r,
3330
- isPresent: n,
3331
- custom: s,
3332
- onExitComplete: function(f) {
3333
- var v, c;
3334
- a.set(f, !0);
3335
- try {
3336
- for (var d = yi(a.values()), p = d.next(); !p.done; p = d.next()) {
3337
- var h = p.value;
3338
- if (!h)
3339
- return;
3340
- }
3341
- } catch (g) {
3342
- v = { error: g };
3343
- } finally {
3344
- try {
3345
- p && !p.done && (c = d.return) && c.call(d);
3346
- } finally {
3347
- if (v) throw v.error;
3348
- }
3349
- }
3350
- i?.();
3351
- },
3352
- register: function(f) {
3353
- return a.set(f, !1), function() {
3354
- return a.delete(f);
3355
- };
3356
- }
3357
- };
3358
- },
3359
- /**
3360
- * If the presence of a child affects the layout of the components around it,
3361
- * we want to make a new context value to ensure they get re-rendered
3362
- * so they can detect that layout change.
3363
- */
3364
- o ? void 0 : [n]
3365
- );
3366
- return It(function() {
3367
- a.forEach(function(f, v) {
3368
- return a.set(v, !1);
3369
- });
3370
- }, [n]), K.useEffect(function() {
3371
- !n && !a.size && i?.();
3372
- }, [n]), K.createElement(Bt.Provider, { value: l }, e);
3373
- };
3374
- function zs() {
3375
- return /* @__PURE__ */ new Map();
3376
- }
3377
- var pt = function(t) {
3378
- return t.key || "";
3379
- };
3380
- function Ks(t, e) {
3381
- t.forEach(function(r) {
3382
- var n = pt(r);
3383
- e.set(n, r);
3384
- });
3385
- }
3386
- function Gs(t) {
3387
- var e = [];
3388
- return Si.forEach(t, function(r) {
3389
- xi(r) && e.push(r);
3390
- }), e;
3391
- }
3392
- var Ws = function(t) {
3393
- var e = t.children, r = t.custom, n = t.initial, i = n === void 0 ? !0 : n, s = t.onExitComplete, o = t.exitBeforeEnter, a = t.presenceAffectsLayout, u = a === void 0 ? !0 : a, l = I(Hs(), 1), f = l[0], v = F(De).forceRender;
3394
- v && (f = v);
3395
- var c = Jn(), d = Gs(e), p = d, h = /* @__PURE__ */ new Set(), g = q(p), P = q(/* @__PURE__ */ new Map()).current, b = q(!0);
3396
- if (Wt(function() {
3397
- b.current = !1, Ks(d, P), g.current = p;
3398
- }), Ue(function() {
3399
- b.current = !0, P.clear(), h.clear();
3400
- }), b.current)
3401
- return K.createElement(K.Fragment, null, p.map(function(x) {
3402
- return K.createElement(de, { key: pt(x), isPresent: !0, initial: i ? void 0 : !1, presenceAffectsLayout: u }, x);
3403
- }));
3404
- p = W([], I(p), !1);
3405
- for (var S = g.current.map(pt), C = d.map(pt), A = S.length, M = 0; M < A; M++) {
3406
- var R = S[M];
3407
- C.indexOf(R) === -1 && h.add(R);
3408
- }
3409
- return o && h.size && (p = []), h.forEach(function(x) {
3410
- if (C.indexOf(x) === -1) {
3411
- var w = P.get(x);
3412
- if (w) {
3413
- var D = S.indexOf(x), H = function() {
3414
- P.delete(x), h.delete(x);
3415
- var B = g.current.findIndex(function(N) {
3416
- return N.key === x;
3417
- });
3418
- if (g.current.splice(B, 1), !h.size) {
3419
- if (g.current = d, c.current === !1)
3420
- return;
3421
- f(), s && s();
3422
- }
3423
- };
3424
- p.splice(D, 0, K.createElement(de, { key: pt(w), isPresent: !1, onExitComplete: H, custom: r, presenceAffectsLayout: u }, w));
3425
- }
3426
- }
3427
- }), p = p.map(function(x) {
3428
- var w = x.key;
3429
- return h.has(w) ? x : K.createElement(de, { key: pt(x), isPresent: !0, presenceAffectsLayout: u }, x);
3430
- }), Le !== "production" && o && p.length > 1 && console.warn("You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour."), K.createElement(K.Fragment, null, h.size ? p : p.map(function(x) {
3431
- return Ti(x);
3432
- }));
3433
- };
3434
- export {
3435
- Ws as A,
3436
- Xs as m
3437
- };