next-recomponents 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +582 -455
- package/dist/index.mjs +586 -459
- package/package.json +1 -1
- package/src/container/index.tsx +0 -2
- package/src/select/index.tsx +0 -1
- package/src/table/td.tsx +0 -1
- package/src/use-resources/encode.decode.tsx +0 -4
- package/src/use-resources/index.ts +1 -1
- package/tsup.config.ts +6 -6
package/dist/index.js
CHANGED
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
9
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
10
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __pow = Math.pow;
|
|
13
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
+
var __spreadValues = (a, b) => {
|
|
15
|
+
for (var prop in b || (b = {}))
|
|
16
|
+
if (__hasOwnProp.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
if (__getOwnPropSymbols)
|
|
19
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
+
if (__propIsEnum.call(b, prop))
|
|
21
|
+
__defNormalProp(a, prop, b[prop]);
|
|
22
|
+
}
|
|
23
|
+
return a;
|
|
24
|
+
};
|
|
25
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
|
+
var __objRest = (source, exclude) => {
|
|
27
|
+
var target = {};
|
|
28
|
+
for (var prop in source)
|
|
29
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
30
|
+
target[prop] = source[prop];
|
|
31
|
+
if (source != null && __getOwnPropSymbols)
|
|
32
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
33
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
34
|
+
target[prop] = source[prop];
|
|
35
|
+
}
|
|
36
|
+
return target;
|
|
37
|
+
};
|
|
8
38
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
39
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
40
|
};
|
|
@@ -29,6 +59,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
59
|
mod
|
|
30
60
|
));
|
|
31
61
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
62
|
+
var __async = (__this, __arguments, generator) => {
|
|
63
|
+
return new Promise((resolve, reject) => {
|
|
64
|
+
var fulfilled = (value) => {
|
|
65
|
+
try {
|
|
66
|
+
step(generator.next(value));
|
|
67
|
+
} catch (e) {
|
|
68
|
+
reject(e);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var rejected = (value) => {
|
|
72
|
+
try {
|
|
73
|
+
step(generator.throw(value));
|
|
74
|
+
} catch (e) {
|
|
75
|
+
reject(e);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
79
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
80
|
+
});
|
|
81
|
+
};
|
|
32
82
|
|
|
33
83
|
// ../../node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs
|
|
34
84
|
var require_interop_require_wildcard = __commonJS({
|
|
@@ -369,45 +419,47 @@ var require_utils = __commonJS({
|
|
|
369
419
|
const urlNoQuery = urlParts[0];
|
|
370
420
|
return urlNoQuery.replace(/\\/g, "/").replace(/\/\/+/g, "/") + (urlParts[1] ? "?" + urlParts.slice(1).join("?") : "");
|
|
371
421
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
422
|
+
function loadGetInitialProps(App, ctx) {
|
|
423
|
+
return __async(this, null, function* () {
|
|
424
|
+
if (process.env.NODE_ENV !== "production") {
|
|
425
|
+
var _App_prototype;
|
|
426
|
+
if ((_App_prototype = App.prototype) == null ? void 0 : _App_prototype.getInitialProps) {
|
|
427
|
+
const message = '"' + getDisplayName(App) + '.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.';
|
|
428
|
+
throw Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
429
|
+
value: "E394",
|
|
430
|
+
enumerable: false,
|
|
431
|
+
configurable: true
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
const res = ctx.res || ctx.ctx && ctx.ctx.res;
|
|
436
|
+
if (!App.getInitialProps) {
|
|
437
|
+
if (ctx.ctx && ctx.Component) {
|
|
438
|
+
return {
|
|
439
|
+
pageProps: yield loadGetInitialProps(ctx.Component, ctx.ctx)
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
return {};
|
|
443
|
+
}
|
|
444
|
+
const props = yield App.getInitialProps(ctx);
|
|
445
|
+
if (res && isResSent(res)) {
|
|
446
|
+
return props;
|
|
447
|
+
}
|
|
448
|
+
if (!props) {
|
|
449
|
+
const message = '"' + getDisplayName(App) + '.getInitialProps()" should resolve to an object. But found "' + props + '" instead.';
|
|
377
450
|
throw Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
378
451
|
value: "E394",
|
|
379
452
|
enumerable: false,
|
|
380
453
|
configurable: true
|
|
381
454
|
});
|
|
382
455
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
return {
|
|
388
|
-
pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx)
|
|
389
|
-
};
|
|
456
|
+
if (process.env.NODE_ENV !== "production") {
|
|
457
|
+
if (Object.keys(props).length === 0 && !ctx.ctx) {
|
|
458
|
+
console.warn("" + getDisplayName(App) + " returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps");
|
|
459
|
+
}
|
|
390
460
|
}
|
|
391
|
-
return {};
|
|
392
|
-
}
|
|
393
|
-
const props = await App.getInitialProps(ctx);
|
|
394
|
-
if (res && isResSent(res)) {
|
|
395
461
|
return props;
|
|
396
|
-
}
|
|
397
|
-
if (!props) {
|
|
398
|
-
const message = '"' + getDisplayName(App) + '.getInitialProps()" should resolve to an object. But found "' + props + '" instead.';
|
|
399
|
-
throw Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
400
|
-
value: "E394",
|
|
401
|
-
enumerable: false,
|
|
402
|
-
configurable: true
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
if (process.env.NODE_ENV !== "production") {
|
|
406
|
-
if (Object.keys(props).length === 0 && !ctx.ctx) {
|
|
407
|
-
console.warn("" + getDisplayName(App) + " returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps");
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
return props;
|
|
462
|
+
});
|
|
411
463
|
}
|
|
412
464
|
var SP = typeof performance !== "undefined";
|
|
413
465
|
var ST = SP && [
|
|
@@ -1436,8 +1488,7 @@ var require_constants = __commonJS({
|
|
|
1436
1488
|
*/
|
|
1437
1489
|
pagesDirNode: "pages-dir-node"
|
|
1438
1490
|
};
|
|
1439
|
-
var WEBPACK_LAYERS = {
|
|
1440
|
-
...WEBPACK_LAYERS_NAMES,
|
|
1491
|
+
var WEBPACK_LAYERS = __spreadProps(__spreadValues({}, WEBPACK_LAYERS_NAMES), {
|
|
1441
1492
|
GROUP: {
|
|
1442
1493
|
builtinReact: [
|
|
1443
1494
|
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
@@ -1475,7 +1526,7 @@ var require_constants = __commonJS({
|
|
|
1475
1526
|
WEBPACK_LAYERS_NAMES.actionBrowser
|
|
1476
1527
|
]
|
|
1477
1528
|
}
|
|
1478
|
-
};
|
|
1529
|
+
});
|
|
1479
1530
|
var WEBPACK_RESOURCE_QUERIES = {
|
|
1480
1531
|
edgeSSREntry: "__next_edge_ssr_entry__",
|
|
1481
1532
|
metadata: "__next_metadata__",
|
|
@@ -1713,11 +1764,10 @@ var require_route_regex = __commonJS({
|
|
|
1713
1764
|
if (!options.excludeOptionalTrailingSlash) {
|
|
1714
1765
|
namedRegex += "(?:/)?";
|
|
1715
1766
|
}
|
|
1716
|
-
return {
|
|
1717
|
-
...getRouteRegex(normalizedRoute, options),
|
|
1767
|
+
return __spreadProps(__spreadValues({}, getRouteRegex(normalizedRoute, options)), {
|
|
1718
1768
|
namedRegex: "^" + namedRegex + "$",
|
|
1719
1769
|
routeKeys: result.routeKeys
|
|
1720
|
-
};
|
|
1770
|
+
});
|
|
1721
1771
|
}
|
|
1722
1772
|
function getNamedMiddlewareRegex(normalizedRoute, options) {
|
|
1723
1773
|
const { parameterizedRoute } = getParametrizedRoute(normalizedRoute, false, false);
|
|
@@ -2548,7 +2598,7 @@ var require_link = __commonJS({
|
|
|
2548
2598
|
}
|
|
2549
2599
|
var Link2 = /* @__PURE__ */ _react.default.forwardRef(function LinkComponent(props, forwardedRef) {
|
|
2550
2600
|
let children;
|
|
2551
|
-
const { href: hrefProp, as: asProp, children: childrenProp, prefetch: prefetchProp = null, passHref, replace, shallow, scroll, locale, onClick, onNavigate, onMouseEnter: onMouseEnterProp, onTouchStart: onTouchStartProp, legacyBehavior = false,
|
|
2601
|
+
const _a = props, { href: hrefProp, as: asProp, children: childrenProp, prefetch: prefetchProp = null, passHref, replace, shallow, scroll, locale, onClick, onNavigate, onMouseEnter: onMouseEnterProp, onTouchStart: onTouchStartProp, legacyBehavior = false } = _a, restProps = __objRest(_a, ["href", "as", "children", "prefetch", "passHref", "replace", "shallow", "scroll", "locale", "onClick", "onNavigate", "onMouseEnter", "onTouchStart", "legacyBehavior"]);
|
|
2552
2602
|
children = childrenProp;
|
|
2553
2603
|
if (legacyBehavior && (typeof children === "string" || typeof children === "number")) {
|
|
2554
2604
|
children = /* @__PURE__ */ (0, _jsxruntime.jsx)("a", {
|
|
@@ -2809,11 +2859,9 @@ var require_link = __commonJS({
|
|
|
2809
2859
|
}
|
|
2810
2860
|
return /* @__PURE__ */ _react.default.cloneElement(child, childProps);
|
|
2811
2861
|
}
|
|
2812
|
-
return /* @__PURE__ */ (0, _jsxruntime.jsx)("a", {
|
|
2813
|
-
...restProps,
|
|
2814
|
-
...childProps,
|
|
2862
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)("a", __spreadProps(__spreadValues(__spreadValues({}, restProps), childProps), {
|
|
2815
2863
|
children
|
|
2816
|
-
});
|
|
2864
|
+
}));
|
|
2817
2865
|
});
|
|
2818
2866
|
var LinkStatusContext = /* @__PURE__ */ (0, _react.createContext)({
|
|
2819
2867
|
// We do not support link status in the Pages Router, so we always return false
|
|
@@ -4927,28 +4975,36 @@ var catColor = {
|
|
|
4927
4975
|
|
|
4928
4976
|
// src/alert/index.tsx
|
|
4929
4977
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
4930
|
-
function Alert({
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
}
|
|
4978
|
+
function Alert(_a) {
|
|
4979
|
+
var _b = _a, {
|
|
4980
|
+
color: color2 = "primary",
|
|
4981
|
+
children
|
|
4982
|
+
} = _b, props = __objRest(_b, [
|
|
4983
|
+
"color",
|
|
4984
|
+
"children"
|
|
4985
|
+
]);
|
|
4935
4986
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: [catColor[color2], "p-2 rounded shadow border"].join(" "), children });
|
|
4936
4987
|
}
|
|
4937
4988
|
|
|
4938
4989
|
// src/button/index.tsx
|
|
4939
4990
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
4940
|
-
function Button({
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
}
|
|
4991
|
+
function Button(_a) {
|
|
4992
|
+
var _b = _a, {
|
|
4993
|
+
className,
|
|
4994
|
+
size = "small",
|
|
4995
|
+
color: color2 = "primary",
|
|
4996
|
+
children,
|
|
4997
|
+
icon
|
|
4998
|
+
} = _b, props = __objRest(_b, [
|
|
4999
|
+
"className",
|
|
5000
|
+
"size",
|
|
5001
|
+
"color",
|
|
5002
|
+
"children",
|
|
5003
|
+
"icon"
|
|
5004
|
+
]);
|
|
4948
5005
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
4949
5006
|
"button",
|
|
4950
|
-
{
|
|
4951
|
-
...props,
|
|
5007
|
+
__spreadProps(__spreadValues({}, props), {
|
|
4952
5008
|
className: [
|
|
4953
5009
|
className,
|
|
4954
5010
|
"p-2 border shadow rounded flex gap-1 justify-center items-center",
|
|
@@ -4959,7 +5015,7 @@ function Button({
|
|
|
4959
5015
|
icon,
|
|
4960
5016
|
children
|
|
4961
5017
|
]
|
|
4962
|
-
}
|
|
5018
|
+
})
|
|
4963
5019
|
);
|
|
4964
5020
|
}
|
|
4965
5021
|
|
|
@@ -5408,14 +5464,12 @@ var number = {
|
|
|
5408
5464
|
parse: parseFloat,
|
|
5409
5465
|
transform: (v) => v
|
|
5410
5466
|
};
|
|
5411
|
-
var alpha = {
|
|
5412
|
-
...number,
|
|
5467
|
+
var alpha = __spreadProps(__spreadValues({}, number), {
|
|
5413
5468
|
transform: (v) => clamp(0, 1, v)
|
|
5414
|
-
};
|
|
5415
|
-
var scale = {
|
|
5416
|
-
...number,
|
|
5469
|
+
});
|
|
5470
|
+
var scale = __spreadProps(__spreadValues({}, number), {
|
|
5417
5471
|
default: 1
|
|
5418
|
-
};
|
|
5472
|
+
});
|
|
5419
5473
|
|
|
5420
5474
|
// ../../node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs
|
|
5421
5475
|
var sanitize = (v) => Math.round(v * 1e5) / 1e5;
|
|
@@ -5449,10 +5503,9 @@ var splitColor = (aName, bName, cName) => (v) => {
|
|
|
5449
5503
|
|
|
5450
5504
|
// ../../node_modules/motion-dom/dist/es/value/types/color/rgba.mjs
|
|
5451
5505
|
var clampRgbUnit = (v) => clamp(0, 255, v);
|
|
5452
|
-
var rgbUnit = {
|
|
5453
|
-
...number,
|
|
5506
|
+
var rgbUnit = __spreadProps(__spreadValues({}, number), {
|
|
5454
5507
|
transform: (v) => Math.round(clampRgbUnit(v))
|
|
5455
|
-
};
|
|
5508
|
+
});
|
|
5456
5509
|
var rgba = {
|
|
5457
5510
|
test: /* @__PURE__ */ isColorString("rgb", "red"),
|
|
5458
5511
|
parse: /* @__PURE__ */ splitColor("red", "green", "blue"),
|
|
@@ -5504,8 +5557,7 @@ var percent = /* @__PURE__ */ createUnitType("%");
|
|
|
5504
5557
|
var px = /* @__PURE__ */ createUnitType("px");
|
|
5505
5558
|
var vh = /* @__PURE__ */ createUnitType("vh");
|
|
5506
5559
|
var vw = /* @__PURE__ */ createUnitType("vw");
|
|
5507
|
-
var progressPercentage = /* @__PURE__ */ (() => ({
|
|
5508
|
-
...percent,
|
|
5560
|
+
var progressPercentage = /* @__PURE__ */ (() => __spreadProps(__spreadValues({}, percent), {
|
|
5509
5561
|
parse: (v) => percent.parse(v) / 100,
|
|
5510
5562
|
transform: (v) => percent.transform(v * 100)
|
|
5511
5563
|
}))();
|
|
@@ -5541,7 +5593,8 @@ var colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]
|
|
|
5541
5593
|
|
|
5542
5594
|
// ../../node_modules/motion-dom/dist/es/value/types/complex/index.mjs
|
|
5543
5595
|
function test(v) {
|
|
5544
|
-
|
|
5596
|
+
var _a, _b;
|
|
5597
|
+
return isNaN(v) && typeof v === "string" && (((_a = v.match(floatRegex)) == null ? void 0 : _a.length) || 0) + (((_b = v.match(colorRegex)) == null ? void 0 : _b.length) || 0) > 0;
|
|
5545
5598
|
}
|
|
5546
5599
|
var NUMBER_TOKEN = "number";
|
|
5547
5600
|
var COLOR_TOKEN = "color";
|
|
@@ -5689,7 +5742,7 @@ var mixColor = (from, to) => {
|
|
|
5689
5742
|
if (!fromRGBA || !toRGBA) {
|
|
5690
5743
|
return mixImmediate(from, to);
|
|
5691
5744
|
}
|
|
5692
|
-
const blended = {
|
|
5745
|
+
const blended = __spreadValues({}, fromRGBA);
|
|
5693
5746
|
return (v) => {
|
|
5694
5747
|
blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);
|
|
5695
5748
|
blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);
|
|
@@ -5737,7 +5790,7 @@ function mixArray(a, b) {
|
|
|
5737
5790
|
};
|
|
5738
5791
|
}
|
|
5739
5792
|
function mixObject(a, b) {
|
|
5740
|
-
const output = {
|
|
5793
|
+
const output = __spreadValues(__spreadValues({}, a), b);
|
|
5741
5794
|
const blendValue = {};
|
|
5742
5795
|
for (const key in output) {
|
|
5743
5796
|
if (a[key] !== void 0 && b[key] !== void 0) {
|
|
@@ -5752,12 +5805,13 @@ function mixObject(a, b) {
|
|
|
5752
5805
|
};
|
|
5753
5806
|
}
|
|
5754
5807
|
function matchOrder(origin, target) {
|
|
5808
|
+
var _a;
|
|
5755
5809
|
const orderedOrigin = [];
|
|
5756
5810
|
const pointers = { color: 0, var: 0, number: 0 };
|
|
5757
5811
|
for (let i = 0; i < target.values.length; i++) {
|
|
5758
5812
|
const type = target.types[i];
|
|
5759
5813
|
const originIndex = origin.indexes[type][pointers[type]];
|
|
5760
|
-
const originValue = origin.values[originIndex]
|
|
5814
|
+
const originValue = (_a = origin.values[originIndex]) != null ? _a : 0;
|
|
5761
5815
|
orderedOrigin[i] = originValue;
|
|
5762
5816
|
pointers[type]++;
|
|
5763
5817
|
}
|
|
@@ -5827,7 +5881,7 @@ function calcGeneratorDuration(generator) {
|
|
|
5827
5881
|
|
|
5828
5882
|
// ../../node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs
|
|
5829
5883
|
function createGeneratorEasing(options, scale2 = 100, createGenerator) {
|
|
5830
|
-
const generator = createGenerator({
|
|
5884
|
+
const generator = createGenerator(__spreadProps(__spreadValues({}, options), { keyframes: [0, scale2] }));
|
|
5831
5885
|
const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
|
|
5832
5886
|
return {
|
|
5833
5887
|
type: "keyframes",
|
|
@@ -5953,33 +6007,29 @@ function isSpringType(options, keys2) {
|
|
|
5953
6007
|
return keys2.some((key) => options[key] !== void 0);
|
|
5954
6008
|
}
|
|
5955
6009
|
function getSpringOptions(options) {
|
|
5956
|
-
let springOptions = {
|
|
6010
|
+
let springOptions = __spreadValues({
|
|
5957
6011
|
velocity: springDefaults.velocity,
|
|
5958
6012
|
stiffness: springDefaults.stiffness,
|
|
5959
6013
|
damping: springDefaults.damping,
|
|
5960
6014
|
mass: springDefaults.mass,
|
|
5961
|
-
isResolvedFromDuration: false
|
|
5962
|
-
|
|
5963
|
-
};
|
|
6015
|
+
isResolvedFromDuration: false
|
|
6016
|
+
}, options);
|
|
5964
6017
|
if (!isSpringType(options, physicsKeys) && isSpringType(options, durationKeys)) {
|
|
5965
6018
|
if (options.visualDuration) {
|
|
5966
6019
|
const visualDuration = options.visualDuration;
|
|
5967
6020
|
const root = 2 * Math.PI / (visualDuration * 1.2);
|
|
5968
6021
|
const stiffness = root * root;
|
|
5969
6022
|
const damping = 2 * clamp(0.05, 1, 1 - (options.bounce || 0)) * Math.sqrt(stiffness);
|
|
5970
|
-
springOptions = {
|
|
5971
|
-
...springOptions,
|
|
6023
|
+
springOptions = __spreadProps(__spreadValues({}, springOptions), {
|
|
5972
6024
|
mass: springDefaults.mass,
|
|
5973
6025
|
stiffness,
|
|
5974
6026
|
damping
|
|
5975
|
-
};
|
|
6027
|
+
});
|
|
5976
6028
|
} else {
|
|
5977
6029
|
const derived = findSpring(options);
|
|
5978
|
-
springOptions = {
|
|
5979
|
-
...springOptions,
|
|
5980
|
-
...derived,
|
|
6030
|
+
springOptions = __spreadProps(__spreadValues(__spreadValues({}, springOptions), derived), {
|
|
5981
6031
|
mass: springDefaults.mass
|
|
5982
|
-
};
|
|
6032
|
+
});
|
|
5983
6033
|
springOptions.isResolvedFromDuration = true;
|
|
5984
6034
|
}
|
|
5985
6035
|
}
|
|
@@ -5995,10 +6045,9 @@ function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce
|
|
|
5995
6045
|
const origin = options.keyframes[0];
|
|
5996
6046
|
const target = options.keyframes[options.keyframes.length - 1];
|
|
5997
6047
|
const state = { done: false, value: origin };
|
|
5998
|
-
const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration } = getSpringOptions({
|
|
5999
|
-
...options,
|
|
6048
|
+
const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration } = getSpringOptions(__spreadProps(__spreadValues({}, options), {
|
|
6000
6049
|
velocity: -millisecondsToSeconds(options.velocity || 0)
|
|
6001
|
-
});
|
|
6050
|
+
}));
|
|
6002
6051
|
const initialVelocity = velocity || 0;
|
|
6003
6052
|
const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));
|
|
6004
6053
|
const initialDelta = target - origin;
|
|
@@ -6279,6 +6328,7 @@ var JSAnimation = class extends WithPromise {
|
|
|
6279
6328
|
this.holdTime = null;
|
|
6280
6329
|
this.playbackSpeed = 1;
|
|
6281
6330
|
this.stop = (sync = true) => {
|
|
6331
|
+
var _a, _b;
|
|
6282
6332
|
if (sync) {
|
|
6283
6333
|
const { motionValue: motionValue2 } = this.options;
|
|
6284
6334
|
if (motionValue2 && motionValue2.updatedAt !== time.now()) {
|
|
@@ -6289,7 +6339,7 @@ var JSAnimation = class extends WithPromise {
|
|
|
6289
6339
|
if (this.state === "idle")
|
|
6290
6340
|
return;
|
|
6291
6341
|
this.teardown();
|
|
6292
|
-
this.options.onStop
|
|
6342
|
+
(_b = (_a = this.options).onStop) == null ? void 0 : _b.call(_a);
|
|
6293
6343
|
};
|
|
6294
6344
|
activeAnimations.mainThread++;
|
|
6295
6345
|
this.options = options;
|
|
@@ -6311,13 +6361,12 @@ var JSAnimation = class extends WithPromise {
|
|
|
6311
6361
|
this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));
|
|
6312
6362
|
keyframes$1 = [0, 100];
|
|
6313
6363
|
}
|
|
6314
|
-
const generator = generatorFactory({
|
|
6364
|
+
const generator = generatorFactory(__spreadProps(__spreadValues({}, options), { keyframes: keyframes$1 }));
|
|
6315
6365
|
if (repeatType === "mirror") {
|
|
6316
|
-
this.mirroredGenerator = generatorFactory({
|
|
6317
|
-
...options,
|
|
6366
|
+
this.mirroredGenerator = generatorFactory(__spreadProps(__spreadValues({}, options), {
|
|
6318
6367
|
keyframes: [...keyframes$1].reverse(),
|
|
6319
6368
|
velocity: -velocity
|
|
6320
|
-
});
|
|
6369
|
+
}));
|
|
6321
6370
|
}
|
|
6322
6371
|
if (generator.calculatedDuration === null) {
|
|
6323
6372
|
generator.calculatedDuration = calcGeneratorDuration(generator);
|
|
@@ -6416,6 +6465,7 @@ var JSAnimation = class extends WithPromise {
|
|
|
6416
6465
|
return millisecondsToSeconds(this.currentTime);
|
|
6417
6466
|
}
|
|
6418
6467
|
set time(newTime) {
|
|
6468
|
+
var _a;
|
|
6419
6469
|
newTime = secondsToMilliseconds(newTime);
|
|
6420
6470
|
this.currentTime = newTime;
|
|
6421
6471
|
if (this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0) {
|
|
@@ -6423,7 +6473,7 @@ var JSAnimation = class extends WithPromise {
|
|
|
6423
6473
|
} else if (this.driver) {
|
|
6424
6474
|
this.startTime = this.driver.now() - newTime / this.playbackSpeed;
|
|
6425
6475
|
}
|
|
6426
|
-
this.driver
|
|
6476
|
+
(_a = this.driver) == null ? void 0 : _a.start(false);
|
|
6427
6477
|
}
|
|
6428
6478
|
get speed() {
|
|
6429
6479
|
return this.playbackSpeed;
|
|
@@ -6437,13 +6487,14 @@ var JSAnimation = class extends WithPromise {
|
|
|
6437
6487
|
}
|
|
6438
6488
|
}
|
|
6439
6489
|
play() {
|
|
6490
|
+
var _a, _b;
|
|
6440
6491
|
if (this.isStopped)
|
|
6441
6492
|
return;
|
|
6442
6493
|
const { driver = frameloopDriver, startTime } = this.options;
|
|
6443
6494
|
if (!this.driver) {
|
|
6444
6495
|
this.driver = driver((timestamp) => this.tick(timestamp));
|
|
6445
6496
|
}
|
|
6446
|
-
this.options.onPlay
|
|
6497
|
+
(_b = (_a = this.options).onPlay) == null ? void 0 : _b.call(_a);
|
|
6447
6498
|
const now2 = this.driver.now();
|
|
6448
6499
|
if (this.state === "finished") {
|
|
6449
6500
|
this.updateFinished();
|
|
@@ -6451,7 +6502,7 @@ var JSAnimation = class extends WithPromise {
|
|
|
6451
6502
|
} else if (this.holdTime !== null) {
|
|
6452
6503
|
this.startTime = now2 - this.holdTime;
|
|
6453
6504
|
} else if (!this.startTime) {
|
|
6454
|
-
this.startTime = startTime
|
|
6505
|
+
this.startTime = startTime != null ? startTime : now2;
|
|
6455
6506
|
}
|
|
6456
6507
|
if (this.state === "finished" && this.speed < 0) {
|
|
6457
6508
|
this.startTime += this.calculatedDuration;
|
|
@@ -6473,17 +6524,19 @@ var JSAnimation = class extends WithPromise {
|
|
|
6473
6524
|
this.holdTime = null;
|
|
6474
6525
|
}
|
|
6475
6526
|
finish() {
|
|
6527
|
+
var _a, _b;
|
|
6476
6528
|
this.notifyFinished();
|
|
6477
6529
|
this.teardown();
|
|
6478
6530
|
this.state = "finished";
|
|
6479
|
-
this.options.onComplete
|
|
6531
|
+
(_b = (_a = this.options).onComplete) == null ? void 0 : _b.call(_a);
|
|
6480
6532
|
}
|
|
6481
6533
|
cancel() {
|
|
6534
|
+
var _a, _b;
|
|
6482
6535
|
this.holdTime = null;
|
|
6483
6536
|
this.startTime = 0;
|
|
6484
6537
|
this.tick(0);
|
|
6485
6538
|
this.teardown();
|
|
6486
|
-
this.options.onCancel
|
|
6539
|
+
(_b = (_a = this.options).onCancel) == null ? void 0 : _b.call(_a);
|
|
6487
6540
|
}
|
|
6488
6541
|
teardown() {
|
|
6489
6542
|
this.state = "idle";
|
|
@@ -6502,20 +6555,22 @@ var JSAnimation = class extends WithPromise {
|
|
|
6502
6555
|
return this.tick(sampleTime, true);
|
|
6503
6556
|
}
|
|
6504
6557
|
attachTimeline(timeline) {
|
|
6558
|
+
var _a;
|
|
6505
6559
|
if (this.options.allowFlatten) {
|
|
6506
6560
|
this.options.type = "keyframes";
|
|
6507
6561
|
this.options.ease = "linear";
|
|
6508
6562
|
this.initAnimation();
|
|
6509
6563
|
}
|
|
6510
|
-
this.driver
|
|
6564
|
+
(_a = this.driver) == null ? void 0 : _a.stop();
|
|
6511
6565
|
return timeline.observe(this);
|
|
6512
6566
|
}
|
|
6513
6567
|
};
|
|
6514
6568
|
|
|
6515
6569
|
// ../../node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs
|
|
6516
6570
|
function fillWildcards(keyframes2) {
|
|
6571
|
+
var _a;
|
|
6517
6572
|
for (let i = 1; i < keyframes2.length; i++) {
|
|
6518
|
-
keyframes2[i]
|
|
6573
|
+
(_a = keyframes2[i]) != null ? _a : keyframes2[i] = keyframes2[i - 1];
|
|
6519
6574
|
}
|
|
6520
6575
|
}
|
|
6521
6576
|
|
|
@@ -6674,7 +6729,8 @@ function measureAllKeyframes() {
|
|
|
6674
6729
|
const restore = transformsToRestore.get(element);
|
|
6675
6730
|
if (restore) {
|
|
6676
6731
|
restore.forEach(([key, value]) => {
|
|
6677
|
-
|
|
6732
|
+
var _a;
|
|
6733
|
+
(_a = element.getValue(key)) == null ? void 0 : _a.set(value);
|
|
6678
6734
|
});
|
|
6679
6735
|
}
|
|
6680
6736
|
});
|
|
@@ -6733,7 +6789,7 @@ var KeyframeResolver = class {
|
|
|
6733
6789
|
readKeyframes() {
|
|
6734
6790
|
const { unresolvedKeyframes, name, element, motionValue: motionValue2 } = this;
|
|
6735
6791
|
if (unresolvedKeyframes[0] === null) {
|
|
6736
|
-
const currentValue = motionValue2
|
|
6792
|
+
const currentValue = motionValue2 == null ? void 0 : motionValue2.get();
|
|
6737
6793
|
const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];
|
|
6738
6794
|
if (currentValue !== void 0) {
|
|
6739
6795
|
unresolvedKeyframes[0] = currentValue;
|
|
@@ -6794,7 +6850,10 @@ var supportsFlags = {};
|
|
|
6794
6850
|
// ../../node_modules/motion-dom/dist/es/utils/supports/memo.mjs
|
|
6795
6851
|
function memoSupports(callback, supportsFlag) {
|
|
6796
6852
|
const memoized = memo(callback);
|
|
6797
|
-
return () =>
|
|
6853
|
+
return () => {
|
|
6854
|
+
var _a;
|
|
6855
|
+
return (_a = supportsFlags[supportsFlag]) != null ? _a : memoized();
|
|
6856
|
+
};
|
|
6798
6857
|
}
|
|
6799
6858
|
|
|
6800
6859
|
// ../../node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs
|
|
@@ -6876,12 +6935,14 @@ function isGenerator(type) {
|
|
|
6876
6935
|
}
|
|
6877
6936
|
|
|
6878
6937
|
// ../../node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs
|
|
6879
|
-
function applyGeneratorOptions(
|
|
6938
|
+
function applyGeneratorOptions(_a) {
|
|
6939
|
+
var _b = _a, { type } = _b, options = __objRest(_b, ["type"]);
|
|
6940
|
+
var _a2, _b2;
|
|
6880
6941
|
if (isGenerator(type) && supportsLinearEasing()) {
|
|
6881
6942
|
return type.applyToOptions(options);
|
|
6882
6943
|
} else {
|
|
6883
|
-
options.duration
|
|
6884
|
-
options.ease
|
|
6944
|
+
(_a2 = options.duration) != null ? _a2 : options.duration = 300;
|
|
6945
|
+
(_b2 = options.ease) != null ? _b2 : options.ease = "easeOut";
|
|
6885
6946
|
}
|
|
6886
6947
|
return options;
|
|
6887
6948
|
}
|
|
@@ -6915,7 +6976,7 @@ var NativeAnimation = class extends WithPromise {
|
|
|
6915
6976
|
}
|
|
6916
6977
|
this.animation.cancel();
|
|
6917
6978
|
}
|
|
6918
|
-
onComplete
|
|
6979
|
+
onComplete == null ? void 0 : onComplete();
|
|
6919
6980
|
this.notifyFinished();
|
|
6920
6981
|
};
|
|
6921
6982
|
}
|
|
@@ -6931,7 +6992,8 @@ var NativeAnimation = class extends WithPromise {
|
|
|
6931
6992
|
this.animation.pause();
|
|
6932
6993
|
}
|
|
6933
6994
|
complete() {
|
|
6934
|
-
|
|
6995
|
+
var _a, _b;
|
|
6996
|
+
(_b = (_a = this.animation).finish) == null ? void 0 : _b.call(_a);
|
|
6935
6997
|
}
|
|
6936
6998
|
cancel() {
|
|
6937
6999
|
try {
|
|
@@ -6968,12 +7030,14 @@ var NativeAnimation = class extends WithPromise {
|
|
|
6968
7030
|
* while deferring the commit until the next animation frame.
|
|
6969
7031
|
*/
|
|
6970
7032
|
commitStyles() {
|
|
7033
|
+
var _a, _b;
|
|
6971
7034
|
if (!this.isPseudoElement) {
|
|
6972
|
-
this.animation.commitStyles
|
|
7035
|
+
(_b = (_a = this.animation).commitStyles) == null ? void 0 : _b.call(_a);
|
|
6973
7036
|
}
|
|
6974
7037
|
}
|
|
6975
7038
|
get duration() {
|
|
6976
|
-
|
|
7039
|
+
var _a, _b;
|
|
7040
|
+
const duration = ((_b = (_a = this.animation.effect) == null ? void 0 : _a.getComputedTiming) == null ? void 0 : _b.call(_a).duration) || 0;
|
|
6977
7041
|
return millisecondsToSeconds(Number(duration));
|
|
6978
7042
|
}
|
|
6979
7043
|
get time() {
|
|
@@ -7008,8 +7072,9 @@ var NativeAnimation = class extends WithPromise {
|
|
|
7008
7072
|
* Attaches a timeline to the animation, for instance the `ScrollTimeline`.
|
|
7009
7073
|
*/
|
|
7010
7074
|
attachTimeline({ timeline, observe }) {
|
|
7075
|
+
var _a;
|
|
7011
7076
|
if (this.allowFlatten) {
|
|
7012
|
-
this.animation.effect
|
|
7077
|
+
(_a = this.animation.effect) == null ? void 0 : _a.updateTiming({ easing: "linear" });
|
|
7013
7078
|
}
|
|
7014
7079
|
this.animation.onfinish = null;
|
|
7015
7080
|
if (timeline && supportsScrollTimeline()) {
|
|
@@ -7057,18 +7122,18 @@ var NativeAnimationExtended = class extends NativeAnimation {
|
|
|
7057
7122
|
* Motion to calculate velocity for any subsequent animation.
|
|
7058
7123
|
*/
|
|
7059
7124
|
updateMotionValue(value) {
|
|
7060
|
-
|
|
7125
|
+
var _b;
|
|
7126
|
+
const _a = this.options, { motionValue: motionValue2, onUpdate, onComplete, element } = _a, options = __objRest(_a, ["motionValue", "onUpdate", "onComplete", "element"]);
|
|
7061
7127
|
if (!motionValue2)
|
|
7062
7128
|
return;
|
|
7063
7129
|
if (value !== void 0) {
|
|
7064
7130
|
motionValue2.set(value);
|
|
7065
7131
|
return;
|
|
7066
7132
|
}
|
|
7067
|
-
const sampleAnimation = new JSAnimation({
|
|
7068
|
-
...options,
|
|
7133
|
+
const sampleAnimation = new JSAnimation(__spreadProps(__spreadValues({}, options), {
|
|
7069
7134
|
autoplay: false
|
|
7070
|
-
});
|
|
7071
|
-
const sampleTime = secondsToMilliseconds(this.finishedTime
|
|
7135
|
+
}));
|
|
7136
|
+
const sampleTime = secondsToMilliseconds((_b = this.finishedTime) != null ? _b : this.time);
|
|
7072
7137
|
motionValue2.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
|
|
7073
7138
|
sampleAnimation.stop();
|
|
7074
7139
|
}
|
|
@@ -7130,8 +7195,9 @@ var acceleratedValues = /* @__PURE__ */ new Set([
|
|
|
7130
7195
|
]);
|
|
7131
7196
|
var supportsWaapi = /* @__PURE__ */ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
7132
7197
|
function supportsBrowserAnimation(options) {
|
|
7198
|
+
var _a;
|
|
7133
7199
|
const { motionValue: motionValue2, name, repeatDelay, repeatType, damping, type } = options;
|
|
7134
|
-
if (!isHTMLElement(motionValue2
|
|
7200
|
+
if (!isHTMLElement((_a = motionValue2 == null ? void 0 : motionValue2.owner) == null ? void 0 : _a.current)) {
|
|
7135
7201
|
return false;
|
|
7136
7202
|
}
|
|
7137
7203
|
const { onUpdate, transformTemplate } = motionValue2.owner.getProps();
|
|
@@ -7145,17 +7211,20 @@ function supportsBrowserAnimation(options) {
|
|
|
7145
7211
|
// ../../node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs
|
|
7146
7212
|
var MAX_RESOLVE_DELAY = 40;
|
|
7147
7213
|
var AsyncMotionValueAnimation = class extends WithPromise {
|
|
7148
|
-
constructor(
|
|
7214
|
+
constructor(_a) {
|
|
7215
|
+
var _b = _a, { autoplay = true, delay: delay2 = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes: keyframes2, name, motionValue: motionValue2, element } = _b, options = __objRest(_b, ["autoplay", "delay", "type", "repeat", "repeatDelay", "repeatType", "keyframes", "name", "motionValue", "element"]);
|
|
7216
|
+
var _a2;
|
|
7149
7217
|
super();
|
|
7150
7218
|
this.stop = () => {
|
|
7219
|
+
var _a3, _b2;
|
|
7151
7220
|
if (this._animation) {
|
|
7152
7221
|
this._animation.stop();
|
|
7153
|
-
this.stopTimeline
|
|
7222
|
+
(_a3 = this.stopTimeline) == null ? void 0 : _a3.call(this);
|
|
7154
7223
|
}
|
|
7155
|
-
this.keyframeResolver
|
|
7224
|
+
(_b2 = this.keyframeResolver) == null ? void 0 : _b2.cancel();
|
|
7156
7225
|
};
|
|
7157
7226
|
this.createdAt = time.now();
|
|
7158
|
-
const optionsWithDefaults = {
|
|
7227
|
+
const optionsWithDefaults = __spreadValues({
|
|
7159
7228
|
autoplay,
|
|
7160
7229
|
delay: delay2,
|
|
7161
7230
|
type,
|
|
@@ -7164,12 +7233,11 @@ var AsyncMotionValueAnimation = class extends WithPromise {
|
|
|
7164
7233
|
repeatType,
|
|
7165
7234
|
name,
|
|
7166
7235
|
motionValue: motionValue2,
|
|
7167
|
-
element
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;
|
|
7236
|
+
element
|
|
7237
|
+
}, options);
|
|
7238
|
+
const KeyframeResolver$1 = (element == null ? void 0 : element.KeyframeResolver) || KeyframeResolver;
|
|
7171
7239
|
this.keyframeResolver = new KeyframeResolver$1(keyframes2, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue2, element);
|
|
7172
|
-
this.keyframeResolver
|
|
7240
|
+
(_a2 = this.keyframeResolver) == null ? void 0 : _a2.scheduleResolve();
|
|
7173
7241
|
}
|
|
7174
7242
|
onKeyframesResolved(keyframes2, finalKeyframe, options, sync) {
|
|
7175
7243
|
this.keyframeResolver = void 0;
|
|
@@ -7177,23 +7245,22 @@ var AsyncMotionValueAnimation = class extends WithPromise {
|
|
|
7177
7245
|
this.resolvedAt = time.now();
|
|
7178
7246
|
if (!canAnimate(keyframes2, name, type, velocity)) {
|
|
7179
7247
|
if (MotionGlobalConfig.instantAnimations || !delay2) {
|
|
7180
|
-
onUpdate
|
|
7248
|
+
onUpdate == null ? void 0 : onUpdate(getFinalKeyframe(keyframes2, options, finalKeyframe));
|
|
7181
7249
|
}
|
|
7182
7250
|
keyframes2[0] = keyframes2[keyframes2.length - 1];
|
|
7183
7251
|
options.duration = 0;
|
|
7184
7252
|
options.repeat = 0;
|
|
7185
7253
|
}
|
|
7186
7254
|
const startTime = sync ? !this.resolvedAt ? this.createdAt : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY ? this.resolvedAt : this.createdAt : void 0;
|
|
7187
|
-
const resolvedOptions = {
|
|
7255
|
+
const resolvedOptions = __spreadProps(__spreadValues({
|
|
7188
7256
|
startTime,
|
|
7189
|
-
finalKeyframe
|
|
7190
|
-
|
|
7257
|
+
finalKeyframe
|
|
7258
|
+
}, options), {
|
|
7191
7259
|
keyframes: keyframes2
|
|
7192
|
-
};
|
|
7193
|
-
const animation = !isHandoff && supportsBrowserAnimation(resolvedOptions) ? new NativeAnimationExtended({
|
|
7194
|
-
...resolvedOptions,
|
|
7260
|
+
});
|
|
7261
|
+
const animation = !isHandoff && supportsBrowserAnimation(resolvedOptions) ? new NativeAnimationExtended(__spreadProps(__spreadValues({}, resolvedOptions), {
|
|
7195
7262
|
element: resolvedOptions.motionValue.owner.current
|
|
7196
|
-
}) : new JSAnimation(resolvedOptions);
|
|
7263
|
+
})) : new JSAnimation(resolvedOptions);
|
|
7197
7264
|
animation.finished.then(() => this.notifyFinished()).catch(noop);
|
|
7198
7265
|
if (this.pendingTimeline) {
|
|
7199
7266
|
this.stopTimeline = animation.attachTimeline(this.pendingTimeline);
|
|
@@ -7213,8 +7280,9 @@ var AsyncMotionValueAnimation = class extends WithPromise {
|
|
|
7213
7280
|
});
|
|
7214
7281
|
}
|
|
7215
7282
|
get animation() {
|
|
7283
|
+
var _a;
|
|
7216
7284
|
if (!this._animation) {
|
|
7217
|
-
this.keyframeResolver
|
|
7285
|
+
(_a = this.keyframeResolver) == null ? void 0 : _a.resume();
|
|
7218
7286
|
flushKeyframeResolvers();
|
|
7219
7287
|
}
|
|
7220
7288
|
return this._animation;
|
|
@@ -7258,10 +7326,11 @@ var AsyncMotionValueAnimation = class extends WithPromise {
|
|
|
7258
7326
|
this.animation.complete();
|
|
7259
7327
|
}
|
|
7260
7328
|
cancel() {
|
|
7329
|
+
var _a;
|
|
7261
7330
|
if (this._animation) {
|
|
7262
7331
|
this.animation.cancel();
|
|
7263
7332
|
}
|
|
7264
|
-
this.keyframeResolver
|
|
7333
|
+
(_a = this.keyframeResolver) == null ? void 0 : _a.cancel();
|
|
7265
7334
|
}
|
|
7266
7335
|
};
|
|
7267
7336
|
|
|
@@ -7275,7 +7344,7 @@ function parseCSSVariable(current) {
|
|
|
7275
7344
|
if (!match)
|
|
7276
7345
|
return [,];
|
|
7277
7346
|
const [, token1, token2, fallback] = match;
|
|
7278
|
-
return [`--${token1
|
|
7347
|
+
return [`--${token1 != null ? token1 : token2}`, fallback];
|
|
7279
7348
|
}
|
|
7280
7349
|
var maxDepth = 4;
|
|
7281
7350
|
function getVariableValue(current, element, depth = 1) {
|
|
@@ -7293,7 +7362,8 @@ function getVariableValue(current, element, depth = 1) {
|
|
|
7293
7362
|
|
|
7294
7363
|
// ../../node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs
|
|
7295
7364
|
function getValueTransition(transition, key) {
|
|
7296
|
-
|
|
7365
|
+
var _a, _b;
|
|
7366
|
+
return (_b = (_a = transition == null ? void 0 : transition[key]) != null ? _a : transition == null ? void 0 : transition["default"]) != null ? _b : transition;
|
|
7297
7367
|
}
|
|
7298
7368
|
|
|
7299
7369
|
// ../../node_modules/motion-dom/dist/es/render/utils/keys-position.mjs
|
|
@@ -7347,19 +7417,17 @@ function applyDefaultFilter(v) {
|
|
|
7347
7417
|
return name + "(" + defaultValue + unit + ")";
|
|
7348
7418
|
}
|
|
7349
7419
|
var functionRegex = /\b([a-z-]*)\(.*?\)/gu;
|
|
7350
|
-
var filter = {
|
|
7351
|
-
...complex,
|
|
7420
|
+
var filter = __spreadProps(__spreadValues({}, complex), {
|
|
7352
7421
|
getAnimatableNone: (v) => {
|
|
7353
7422
|
const functions = v.match(functionRegex);
|
|
7354
7423
|
return functions ? functions.map(applyDefaultFilter).join(" ") : v;
|
|
7355
7424
|
}
|
|
7356
|
-
};
|
|
7425
|
+
});
|
|
7357
7426
|
|
|
7358
7427
|
// ../../node_modules/motion-dom/dist/es/value/types/int.mjs
|
|
7359
|
-
var int = {
|
|
7360
|
-
...number,
|
|
7428
|
+
var int = __spreadProps(__spreadValues({}, number), {
|
|
7361
7429
|
transform: Math.round
|
|
7362
|
-
};
|
|
7430
|
+
});
|
|
7363
7431
|
|
|
7364
7432
|
// ../../node_modules/motion-dom/dist/es/value/types/maps/transform.mjs
|
|
7365
7433
|
var transformValueTypes = {
|
|
@@ -7390,7 +7458,7 @@ var transformValueTypes = {
|
|
|
7390
7458
|
};
|
|
7391
7459
|
|
|
7392
7460
|
// ../../node_modules/motion-dom/dist/es/value/types/maps/number.mjs
|
|
7393
|
-
var numberValueTypes = {
|
|
7461
|
+
var numberValueTypes = __spreadProps(__spreadValues({
|
|
7394
7462
|
// Border props
|
|
7395
7463
|
borderWidth: px,
|
|
7396
7464
|
borderTopWidth: px,
|
|
@@ -7425,18 +7493,17 @@ var numberValueTypes = {
|
|
|
7425
7493
|
marginLeft: px,
|
|
7426
7494
|
// Misc
|
|
7427
7495
|
backgroundPositionX: px,
|
|
7428
|
-
backgroundPositionY: px
|
|
7429
|
-
|
|
7496
|
+
backgroundPositionY: px
|
|
7497
|
+
}, transformValueTypes), {
|
|
7430
7498
|
zIndex: int,
|
|
7431
7499
|
// SVG
|
|
7432
7500
|
fillOpacity: alpha,
|
|
7433
7501
|
strokeOpacity: alpha,
|
|
7434
7502
|
numOctaves: int
|
|
7435
|
-
};
|
|
7503
|
+
});
|
|
7436
7504
|
|
|
7437
7505
|
// ../../node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs
|
|
7438
|
-
var defaultValueTypes = {
|
|
7439
|
-
...numberValueTypes,
|
|
7506
|
+
var defaultValueTypes = __spreadProps(__spreadValues({}, numberValueTypes), {
|
|
7440
7507
|
// Color props
|
|
7441
7508
|
color,
|
|
7442
7509
|
backgroundColor: color,
|
|
@@ -7451,7 +7518,7 @@ var defaultValueTypes = {
|
|
|
7451
7518
|
borderLeftColor: color,
|
|
7452
7519
|
filter,
|
|
7453
7520
|
WebkitFilter: filter
|
|
7454
|
-
};
|
|
7521
|
+
});
|
|
7455
7522
|
var getDefaultValueType = (key) => defaultValueTypes[key];
|
|
7456
7523
|
|
|
7457
7524
|
// ../../node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs
|
|
@@ -7553,6 +7620,7 @@ var DOMKeyframesResolver = class extends KeyframeResolver {
|
|
|
7553
7620
|
}
|
|
7554
7621
|
}
|
|
7555
7622
|
measureEndState() {
|
|
7623
|
+
var _a;
|
|
7556
7624
|
const { element, name, unresolvedKeyframes } = this;
|
|
7557
7625
|
if (!element || !element.current)
|
|
7558
7626
|
return;
|
|
@@ -7564,7 +7632,7 @@ var DOMKeyframesResolver = class extends KeyframeResolver {
|
|
|
7564
7632
|
if (finalKeyframe !== null && this.finalKeyframe === void 0) {
|
|
7565
7633
|
this.finalKeyframe = finalKeyframe;
|
|
7566
7634
|
}
|
|
7567
|
-
if (this.removedTransforms
|
|
7635
|
+
if ((_a = this.removedTransforms) == null ? void 0 : _a.length) {
|
|
7568
7636
|
this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {
|
|
7569
7637
|
element.getValue(unsetTransformName).set(unsetTransformValue);
|
|
7570
7638
|
});
|
|
@@ -7575,6 +7643,7 @@ var DOMKeyframesResolver = class extends KeyframeResolver {
|
|
|
7575
7643
|
|
|
7576
7644
|
// ../../node_modules/motion-dom/dist/es/utils/resolve-elements.mjs
|
|
7577
7645
|
function resolveElements(elementOrSelector, scope, selectorCache) {
|
|
7646
|
+
var _a;
|
|
7578
7647
|
if (elementOrSelector instanceof EventTarget) {
|
|
7579
7648
|
return [elementOrSelector];
|
|
7580
7649
|
} else if (typeof elementOrSelector === "string") {
|
|
@@ -7582,7 +7651,7 @@ function resolveElements(elementOrSelector, scope, selectorCache) {
|
|
|
7582
7651
|
if (scope) {
|
|
7583
7652
|
root = scope.current;
|
|
7584
7653
|
}
|
|
7585
|
-
const elements = selectorCache
|
|
7654
|
+
const elements = (_a = selectorCache == null ? void 0 : selectorCache[elementOrSelector]) != null ? _a : root.querySelectorAll(elementOrSelector);
|
|
7586
7655
|
return elements ? Array.from(elements) : [];
|
|
7587
7656
|
}
|
|
7588
7657
|
return Array.from(elementOrSelector);
|
|
@@ -7607,6 +7676,7 @@ var MotionValue = class {
|
|
|
7607
7676
|
this.canTrackVelocity = null;
|
|
7608
7677
|
this.events = {};
|
|
7609
7678
|
this.updateAndNotify = (v, render = true) => {
|
|
7679
|
+
var _a, _b;
|
|
7610
7680
|
const currentTime = time.now();
|
|
7611
7681
|
if (this.updatedAt !== currentTime) {
|
|
7612
7682
|
this.setPrevFrameValue();
|
|
@@ -7614,7 +7684,7 @@ var MotionValue = class {
|
|
|
7614
7684
|
this.prev = this.current;
|
|
7615
7685
|
this.setCurrent(v);
|
|
7616
7686
|
if (this.current !== this.prev) {
|
|
7617
|
-
this.events.change
|
|
7687
|
+
(_a = this.events.change) == null ? void 0 : _a.notify(this.current);
|
|
7618
7688
|
if (this.dependents) {
|
|
7619
7689
|
for (const dependent of this.dependents) {
|
|
7620
7690
|
dependent.dirty();
|
|
@@ -7622,7 +7692,7 @@ var MotionValue = class {
|
|
|
7622
7692
|
}
|
|
7623
7693
|
}
|
|
7624
7694
|
if (render) {
|
|
7625
|
-
this.events.renderRequest
|
|
7695
|
+
(_b = this.events.renderRequest) == null ? void 0 : _b.notify(this.current);
|
|
7626
7696
|
}
|
|
7627
7697
|
};
|
|
7628
7698
|
this.hasAnimated = false;
|
|
@@ -7756,7 +7826,8 @@ var MotionValue = class {
|
|
|
7756
7826
|
this.stopPassiveEffect();
|
|
7757
7827
|
}
|
|
7758
7828
|
dirty() {
|
|
7759
|
-
|
|
7829
|
+
var _a;
|
|
7830
|
+
(_a = this.events.change) == null ? void 0 : _a.notify(this.current);
|
|
7760
7831
|
}
|
|
7761
7832
|
addDependent(dependent) {
|
|
7762
7833
|
if (!this.dependents) {
|
|
@@ -7863,8 +7934,9 @@ var MotionValue = class {
|
|
|
7863
7934
|
* @public
|
|
7864
7935
|
*/
|
|
7865
7936
|
destroy() {
|
|
7866
|
-
|
|
7867
|
-
this.
|
|
7937
|
+
var _a, _b;
|
|
7938
|
+
(_a = this.dependents) == null ? void 0 : _a.clear();
|
|
7939
|
+
(_b = this.events.destroy) == null ? void 0 : _b.notify();
|
|
7868
7940
|
this.clearListeners();
|
|
7869
7941
|
this.stop();
|
|
7870
7942
|
if (this.stopPassiveEffect) {
|
|
@@ -7920,11 +7992,11 @@ function setDragLock(axis) {
|
|
|
7920
7992
|
function setupGesture(elementOrSelector, options) {
|
|
7921
7993
|
const elements = resolveElements(elementOrSelector);
|
|
7922
7994
|
const gestureAbortController = new AbortController();
|
|
7923
|
-
const eventOptions = {
|
|
7924
|
-
passive: true
|
|
7925
|
-
|
|
7995
|
+
const eventOptions = __spreadProps(__spreadValues({
|
|
7996
|
+
passive: true
|
|
7997
|
+
}, options), {
|
|
7926
7998
|
signal: gestureAbortController.signal
|
|
7927
|
-
};
|
|
7999
|
+
});
|
|
7928
8000
|
const cancel = () => gestureAbortController.abort();
|
|
7929
8001
|
return [elements, eventOptions, cancel];
|
|
7930
8002
|
}
|
|
@@ -8145,10 +8217,7 @@ for (const key in featureProps) {
|
|
|
8145
8217
|
// ../../node_modules/framer-motion/dist/es/motion/features/load-features.mjs
|
|
8146
8218
|
function loadFeatures(features) {
|
|
8147
8219
|
for (const key in features) {
|
|
8148
|
-
featureDefinitions[key] = {
|
|
8149
|
-
...featureDefinitions[key],
|
|
8150
|
-
...features[key]
|
|
8151
|
-
};
|
|
8220
|
+
featureDefinitions[key] = __spreadValues(__spreadValues({}, featureDefinitions[key]), features[key]);
|
|
8152
8221
|
}
|
|
8153
8222
|
}
|
|
8154
8223
|
|
|
@@ -8198,7 +8267,7 @@ function loadExternalIsValidProp(isValidProp) {
|
|
|
8198
8267
|
}
|
|
8199
8268
|
try {
|
|
8200
8269
|
loadExternalIsValidProp(require("@emotion/is-prop-valid").default);
|
|
8201
|
-
} catch {
|
|
8270
|
+
} catch (e) {
|
|
8202
8271
|
}
|
|
8203
8272
|
function filterProps(props, isDom, forwardMotionProps) {
|
|
8204
8273
|
const filteredProps = {};
|
|
@@ -8362,6 +8431,7 @@ var SwitchLayoutGroupContext = (0, import_react11.createContext)({});
|
|
|
8362
8431
|
|
|
8363
8432
|
// ../../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs
|
|
8364
8433
|
function useVisualElement(Component2, visualState, props, createVisualElement, ProjectionNodeConstructor) {
|
|
8434
|
+
var _a, _b;
|
|
8365
8435
|
const { visualElement: parent } = (0, import_react12.useContext)(MotionContext);
|
|
8366
8436
|
const lazyContext = (0, import_react12.useContext)(LazyContext);
|
|
8367
8437
|
const presenceContext = (0, import_react12.useContext)(PresenceContext);
|
|
@@ -8390,7 +8460,7 @@ function useVisualElement(Component2, visualState, props, createVisualElement, P
|
|
|
8390
8460
|
}
|
|
8391
8461
|
});
|
|
8392
8462
|
const optimisedAppearId = props[optimizedAppearDataAttribute];
|
|
8393
|
-
const wantsHandoff = (0, import_react12.useRef)(Boolean(optimisedAppearId) && !window.MotionHandoffIsComplete
|
|
8463
|
+
const wantsHandoff = (0, import_react12.useRef)(Boolean(optimisedAppearId) && !((_a = window.MotionHandoffIsComplete) == null ? void 0 : _a.call(window, optimisedAppearId)) && ((_b = window.MotionHasOptimisedAnimation) == null ? void 0 : _b.call(window, optimisedAppearId)));
|
|
8394
8464
|
useIsomorphicLayoutEffect(() => {
|
|
8395
8465
|
if (!visualElement)
|
|
8396
8466
|
return;
|
|
@@ -8410,7 +8480,8 @@ function useVisualElement(Component2, visualState, props, createVisualElement, P
|
|
|
8410
8480
|
}
|
|
8411
8481
|
if (wantsHandoff.current) {
|
|
8412
8482
|
queueMicrotask(() => {
|
|
8413
|
-
|
|
8483
|
+
var _a2;
|
|
8484
|
+
(_a2 = window.MotionHandoffMarkAsComplete) == null ? void 0 : _a2.call(window, optimisedAppearId);
|
|
8414
8485
|
});
|
|
8415
8486
|
wantsHandoff.current = false;
|
|
8416
8487
|
}
|
|
@@ -8447,14 +8518,13 @@ function getClosestProjectingNode(visualElement) {
|
|
|
8447
8518
|
|
|
8448
8519
|
// ../../node_modules/framer-motion/dist/es/motion/index.mjs
|
|
8449
8520
|
function createRendererMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component: Component2 }) {
|
|
8521
|
+
var _a, _b;
|
|
8450
8522
|
preloadedFeatures && loadFeatures(preloadedFeatures);
|
|
8451
8523
|
function MotionComponent(props, externalRef) {
|
|
8452
8524
|
let MeasureLayout2;
|
|
8453
|
-
const configAndProps = {
|
|
8454
|
-
...(0, import_react13.useContext)(MotionConfigContext),
|
|
8455
|
-
...props,
|
|
8525
|
+
const configAndProps = __spreadProps(__spreadValues(__spreadValues({}, (0, import_react13.useContext)(MotionConfigContext)), props), {
|
|
8456
8526
|
layoutId: useLayoutId(props)
|
|
8457
|
-
};
|
|
8527
|
+
});
|
|
8458
8528
|
const { isStatic } = configAndProps;
|
|
8459
8529
|
const context = useCreateMotionContext(props);
|
|
8460
8530
|
const visualState = useVisualState(props, isStatic);
|
|
@@ -8464,9 +8534,9 @@ function createRendererMotionComponent({ preloadedFeatures, createVisualElement,
|
|
|
8464
8534
|
MeasureLayout2 = layoutProjection.MeasureLayout;
|
|
8465
8535
|
context.visualElement = useVisualElement(Component2, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode);
|
|
8466
8536
|
}
|
|
8467
|
-
return (0, import_jsx_runtime3.jsxs)(MotionContext.Provider, { value: context, children: [MeasureLayout2 && context.visualElement ? (0, import_jsx_runtime3.jsx)(MeasureLayout2, { visualElement: context.visualElement,
|
|
8537
|
+
return (0, import_jsx_runtime3.jsxs)(MotionContext.Provider, { value: context, children: [MeasureLayout2 && context.visualElement ? (0, import_jsx_runtime3.jsx)(MeasureLayout2, __spreadValues({ visualElement: context.visualElement }, configAndProps)) : null, useRender(Component2, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)] });
|
|
8468
8538
|
}
|
|
8469
|
-
MotionComponent.displayName = `motion.${typeof Component2 === "string" ? Component2 : `create(${Component2.displayName
|
|
8539
|
+
MotionComponent.displayName = `motion.${typeof Component2 === "string" ? Component2 : `create(${(_b = (_a = Component2.displayName) != null ? _a : Component2.name) != null ? _b : ""})`}`;
|
|
8470
8540
|
const ForwardRefMotionComponent = (0, import_react13.forwardRef)(MotionComponent);
|
|
8471
8541
|
ForwardRefMotionComponent[motionComponentSymbol] = Component2;
|
|
8472
8542
|
return ForwardRefMotionComponent;
|
|
@@ -8486,9 +8556,9 @@ function getProjectionFunctionality(props) {
|
|
|
8486
8556
|
const { drag: drag2, layout: layout2 } = featureDefinitions;
|
|
8487
8557
|
if (!drag2 && !layout2)
|
|
8488
8558
|
return {};
|
|
8489
|
-
const combined = {
|
|
8559
|
+
const combined = __spreadValues(__spreadValues({}, drag2), layout2);
|
|
8490
8560
|
return {
|
|
8491
|
-
MeasureLayout: drag2
|
|
8561
|
+
MeasureLayout: (drag2 == null ? void 0 : drag2.isEnabled(props)) || (layout2 == null ? void 0 : layout2.isEnabled(props)) ? combined.MeasureLayout : void 0,
|
|
8492
8562
|
ProjectionNode: combined.ProjectionNode
|
|
8493
8563
|
};
|
|
8494
8564
|
}
|
|
@@ -8661,16 +8731,23 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
|
|
|
8661
8731
|
}
|
|
8662
8732
|
|
|
8663
8733
|
// ../../node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs
|
|
8664
|
-
function buildSVGAttrs(state, {
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8734
|
+
function buildSVGAttrs(state, _a, isSVGTag2, transformTemplate, styleProp) {
|
|
8735
|
+
var _b = _a, {
|
|
8736
|
+
attrX,
|
|
8737
|
+
attrY,
|
|
8738
|
+
attrScale,
|
|
8739
|
+
pathLength,
|
|
8740
|
+
pathSpacing = 1,
|
|
8741
|
+
pathOffset = 0
|
|
8742
|
+
} = _b, latest = __objRest(_b, [
|
|
8743
|
+
"attrX",
|
|
8744
|
+
"attrY",
|
|
8745
|
+
"attrScale",
|
|
8746
|
+
"pathLength",
|
|
8747
|
+
"pathSpacing",
|
|
8748
|
+
"pathOffset"
|
|
8749
|
+
]);
|
|
8750
|
+
var _a2, _b2;
|
|
8674
8751
|
buildHTMLStyles(state, latest, transformTemplate);
|
|
8675
8752
|
if (isSVGTag2) {
|
|
8676
8753
|
if (state.style.viewBox) {
|
|
@@ -8686,11 +8763,11 @@ function buildSVGAttrs(state, {
|
|
|
8686
8763
|
delete attrs.transform;
|
|
8687
8764
|
}
|
|
8688
8765
|
if (style.transform || attrs.transformOrigin) {
|
|
8689
|
-
style.transformOrigin = attrs.transformOrigin
|
|
8766
|
+
style.transformOrigin = (_a2 = attrs.transformOrigin) != null ? _a2 : "50% 50%";
|
|
8690
8767
|
delete attrs.transformOrigin;
|
|
8691
8768
|
}
|
|
8692
8769
|
if (style.transform) {
|
|
8693
|
-
style.transformBox = styleProp
|
|
8770
|
+
style.transformBox = (_b2 = styleProp == null ? void 0 : styleProp.transformBox) != null ? _b2 : "fill-box";
|
|
8694
8771
|
delete attrs.transformBox;
|
|
8695
8772
|
}
|
|
8696
8773
|
if (attrX !== void 0)
|
|
@@ -8705,8 +8782,7 @@ function buildSVGAttrs(state, {
|
|
|
8705
8782
|
}
|
|
8706
8783
|
|
|
8707
8784
|
// ../../node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs
|
|
8708
|
-
var createSvgRenderState = () => ({
|
|
8709
|
-
...createHtmlRenderState(),
|
|
8785
|
+
var createSvgRenderState = () => __spreadProps(__spreadValues({}, createHtmlRenderState()), {
|
|
8710
8786
|
attrs: {}
|
|
8711
8787
|
});
|
|
8712
8788
|
|
|
@@ -8718,15 +8794,14 @@ function useSVGProps(props, visualState, _isStatic, Component2) {
|
|
|
8718
8794
|
const visualProps = (0, import_react15.useMemo)(() => {
|
|
8719
8795
|
const state = createSvgRenderState();
|
|
8720
8796
|
buildSVGAttrs(state, visualState, isSVGTag(Component2), props.transformTemplate, props.style);
|
|
8721
|
-
return {
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
};
|
|
8797
|
+
return __spreadProps(__spreadValues({}, state.attrs), {
|
|
8798
|
+
style: __spreadValues({}, state.style)
|
|
8799
|
+
});
|
|
8725
8800
|
}, [visualState]);
|
|
8726
8801
|
if (props.style) {
|
|
8727
8802
|
const rawStyles = {};
|
|
8728
8803
|
copyRawValuesOnly(rawStyles, props.style, props);
|
|
8729
|
-
visualProps.style = {
|
|
8804
|
+
visualProps.style = __spreadValues(__spreadValues({}, rawStyles), visualProps.style);
|
|
8730
8805
|
}
|
|
8731
8806
|
return visualProps;
|
|
8732
8807
|
}
|
|
@@ -8793,13 +8868,12 @@ function createUseRender(forwardMotionProps = false) {
|
|
|
8793
8868
|
const useVisualProps = isSVGComponent(Component2) ? useSVGProps : useHTMLProps;
|
|
8794
8869
|
const visualProps = useVisualProps(props, latestValues, isStatic, Component2);
|
|
8795
8870
|
const filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps);
|
|
8796
|
-
const elementProps = Component2 !== import_react16.Fragment ? {
|
|
8871
|
+
const elementProps = Component2 !== import_react16.Fragment ? __spreadProps(__spreadValues(__spreadValues({}, filteredProps), visualProps), { ref }) : {};
|
|
8797
8872
|
const { children } = props;
|
|
8798
8873
|
const renderedChildren = (0, import_react16.useMemo)(() => isMotionValue(children) ? children.get() : children, [children]);
|
|
8799
|
-
return (0, import_react16.createElement)(Component2, {
|
|
8800
|
-
...elementProps,
|
|
8874
|
+
return (0, import_react16.createElement)(Component2, __spreadProps(__spreadValues({}, elementProps), {
|
|
8801
8875
|
children: renderedChildren
|
|
8802
|
-
});
|
|
8876
|
+
}));
|
|
8803
8877
|
};
|
|
8804
8878
|
return useRender;
|
|
8805
8879
|
}
|
|
@@ -8810,7 +8884,7 @@ var import_react17 = require("react");
|
|
|
8810
8884
|
// ../../node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs
|
|
8811
8885
|
function getValueState(visualElement) {
|
|
8812
8886
|
const state = [{}, {}];
|
|
8813
|
-
visualElement
|
|
8887
|
+
visualElement == null ? void 0 : visualElement.values.forEach((value, key) => {
|
|
8814
8888
|
state[0][key] = value.get();
|
|
8815
8889
|
state[1][key] = value.getVelocity();
|
|
8816
8890
|
});
|
|
@@ -8873,7 +8947,7 @@ function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
|
|
|
8873
8947
|
for (let i = 0; i < list.length; i++) {
|
|
8874
8948
|
const resolved = resolveVariantFromProps(props, list[i]);
|
|
8875
8949
|
if (resolved) {
|
|
8876
|
-
const { transitionEnd, transition,
|
|
8950
|
+
const _a = resolved, { transitionEnd, transition } = _a, target = __objRest(_a, ["transitionEnd", "transition"]);
|
|
8877
8951
|
for (const key in target) {
|
|
8878
8952
|
let valueTarget = target[key];
|
|
8879
8953
|
if (Array.isArray(valueTarget)) {
|
|
@@ -8895,10 +8969,11 @@ function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
|
|
|
8895
8969
|
|
|
8896
8970
|
// ../../node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs
|
|
8897
8971
|
function scrapeMotionValuesFromProps(props, prevProps, visualElement) {
|
|
8972
|
+
var _a;
|
|
8898
8973
|
const { style } = props;
|
|
8899
8974
|
const newValues = {};
|
|
8900
8975
|
for (const key in style) {
|
|
8901
|
-
if (isMotionValue(style[key]) || prevProps.style && isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props) || visualElement
|
|
8976
|
+
if (isMotionValue(style[key]) || prevProps.style && isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props) || ((_a = visualElement == null ? void 0 : visualElement.getValue(key)) == null ? void 0 : _a.liveStyle) !== void 0) {
|
|
8902
8977
|
newValues[key] = style[key];
|
|
8903
8978
|
}
|
|
8904
8979
|
}
|
|
@@ -8937,13 +9012,12 @@ var svgMotionConfig = {
|
|
|
8937
9012
|
function createMotionComponentFactory(preloadedFeatures, createVisualElement) {
|
|
8938
9013
|
return function createMotionComponent2(Component2, { forwardMotionProps } = { forwardMotionProps: false }) {
|
|
8939
9014
|
const baseConfig = isSVGComponent(Component2) ? svgMotionConfig : htmlMotionConfig;
|
|
8940
|
-
const config = {
|
|
8941
|
-
...baseConfig,
|
|
9015
|
+
const config = __spreadProps(__spreadValues({}, baseConfig), {
|
|
8942
9016
|
preloadedFeatures,
|
|
8943
9017
|
useRender: createUseRender(forwardMotionProps),
|
|
8944
9018
|
createVisualElement,
|
|
8945
9019
|
Component: Component2
|
|
8946
|
-
};
|
|
9020
|
+
});
|
|
8947
9021
|
return createRendererMotionComponent(config);
|
|
8948
9022
|
};
|
|
8949
9023
|
}
|
|
@@ -8972,8 +9046,8 @@ function resolveFinalValueInKeyframes(v) {
|
|
|
8972
9046
|
}
|
|
8973
9047
|
function setTarget(visualElement, definition) {
|
|
8974
9048
|
const resolved = resolveVariant(visualElement, definition);
|
|
8975
|
-
let { transitionEnd = {}, transition = {},
|
|
8976
|
-
target = {
|
|
9049
|
+
let _a = resolved || {}, { transitionEnd = {}, transition = {} } = _a, target = __objRest(_a, ["transitionEnd", "transition"]);
|
|
9050
|
+
target = __spreadValues(__spreadValues({}, target), transitionEnd);
|
|
8977
9051
|
for (const key in target) {
|
|
8978
9052
|
const value = resolveFinalValueInKeyframes(target[key]);
|
|
8979
9053
|
setMotionValue(visualElement, key, value);
|
|
@@ -9042,7 +9116,8 @@ var getDefaultTransition = (valueKey, { keyframes: keyframes2 }) => {
|
|
|
9042
9116
|
};
|
|
9043
9117
|
|
|
9044
9118
|
// ../../node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs
|
|
9045
|
-
function isTransitionDefined(
|
|
9119
|
+
function isTransitionDefined(_a) {
|
|
9120
|
+
var _b = _a, { when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed } = _b, transition = __objRest(_b, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from", "elapsed"]);
|
|
9046
9121
|
return !!Object.keys(transition).length;
|
|
9047
9122
|
}
|
|
9048
9123
|
|
|
@@ -9052,11 +9127,11 @@ var animateMotionValue = (name, value, target, transition = {}, element, isHando
|
|
|
9052
9127
|
const delay2 = valueTransition.delay || transition.delay || 0;
|
|
9053
9128
|
let { elapsed = 0 } = transition;
|
|
9054
9129
|
elapsed = elapsed - secondsToMilliseconds(delay2);
|
|
9055
|
-
const options = {
|
|
9130
|
+
const options = __spreadProps(__spreadValues({
|
|
9056
9131
|
keyframes: Array.isArray(target) ? target : [null, target],
|
|
9057
9132
|
ease: "easeOut",
|
|
9058
|
-
velocity: value.getVelocity()
|
|
9059
|
-
|
|
9133
|
+
velocity: value.getVelocity()
|
|
9134
|
+
}, valueTransition), {
|
|
9060
9135
|
delay: -elapsed,
|
|
9061
9136
|
onUpdate: (v) => {
|
|
9062
9137
|
value.set(v);
|
|
@@ -9069,7 +9144,7 @@ var animateMotionValue = (name, value, target, transition = {}, element, isHando
|
|
|
9069
9144
|
name,
|
|
9070
9145
|
motionValue: value,
|
|
9071
9146
|
element: isHandoff ? void 0 : element
|
|
9072
|
-
};
|
|
9147
|
+
});
|
|
9073
9148
|
if (!isTransitionDefined(valueTransition)) {
|
|
9074
9149
|
Object.assign(options, getDefaultTransition(name, options));
|
|
9075
9150
|
}
|
|
@@ -9111,21 +9186,21 @@ function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {
|
|
|
9111
9186
|
return shouldBlock;
|
|
9112
9187
|
}
|
|
9113
9188
|
function animateTarget(visualElement, targetAndTransition, { delay: delay2 = 0, transitionOverride, type } = {}) {
|
|
9114
|
-
|
|
9189
|
+
var _b;
|
|
9190
|
+
let _a = targetAndTransition, { transition = visualElement.getDefaultTransition(), transitionEnd } = _a, target = __objRest(_a, ["transition", "transitionEnd"]);
|
|
9115
9191
|
if (transitionOverride)
|
|
9116
9192
|
transition = transitionOverride;
|
|
9117
9193
|
const animations2 = [];
|
|
9118
9194
|
const animationTypeState = type && visualElement.animationState && visualElement.animationState.getState()[type];
|
|
9119
9195
|
for (const key in target) {
|
|
9120
|
-
const value = visualElement.getValue(key, visualElement.latestValues[key]
|
|
9196
|
+
const value = visualElement.getValue(key, (_b = visualElement.latestValues[key]) != null ? _b : null);
|
|
9121
9197
|
const valueTarget = target[key];
|
|
9122
9198
|
if (valueTarget === void 0 || animationTypeState && shouldBlockAnimation(animationTypeState, key)) {
|
|
9123
9199
|
continue;
|
|
9124
9200
|
}
|
|
9125
|
-
const valueTransition = {
|
|
9126
|
-
delay: delay2
|
|
9127
|
-
|
|
9128
|
-
};
|
|
9201
|
+
const valueTransition = __spreadValues({
|
|
9202
|
+
delay: delay2
|
|
9203
|
+
}, getValueTransition(transition || {}, key));
|
|
9129
9204
|
const currentValue = value.get();
|
|
9130
9205
|
if (currentValue !== void 0 && !value.isAnimating && !Array.isArray(valueTarget) && valueTarget === currentValue && !valueTransition.velocity) {
|
|
9131
9206
|
continue;
|
|
@@ -9160,7 +9235,8 @@ function animateTarget(visualElement, targetAndTransition, { delay: delay2 = 0,
|
|
|
9160
9235
|
|
|
9161
9236
|
// ../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs
|
|
9162
9237
|
function animateVariant(visualElement, variant, options = {}) {
|
|
9163
|
-
|
|
9238
|
+
var _a;
|
|
9239
|
+
const resolved = resolveVariant(visualElement, variant, options.type === "exit" ? (_a = visualElement.presenceContext) == null ? void 0 : _a.custom : void 0);
|
|
9164
9240
|
let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};
|
|
9165
9241
|
if (options.transitionOverride) {
|
|
9166
9242
|
transition = options.transitionOverride;
|
|
@@ -9184,10 +9260,9 @@ function animateChildren(visualElement, variant, delayChildren = 0, staggerChild
|
|
|
9184
9260
|
const generateStaggerDuration = staggerDirection === 1 ? (i = 0) => i * staggerChildren : (i = 0) => maxStaggerDuration - i * staggerChildren;
|
|
9185
9261
|
Array.from(visualElement.variantChildren).sort(sortByTreeOrder).forEach((child, i) => {
|
|
9186
9262
|
child.notify("AnimationStart", variant);
|
|
9187
|
-
animations2.push(animateVariant(child, variant, {
|
|
9188
|
-
...options,
|
|
9263
|
+
animations2.push(animateVariant(child, variant, __spreadProps(__spreadValues({}, options), {
|
|
9189
9264
|
delay: delayChildren + generateStaggerDuration(i)
|
|
9190
|
-
}).then(() => child.notify("AnimationComplete", variant)));
|
|
9265
|
+
})).then(() => child.notify("AnimationComplete", variant)));
|
|
9191
9266
|
});
|
|
9192
9267
|
return Promise.all(animations2);
|
|
9193
9268
|
}
|
|
@@ -9261,10 +9336,11 @@ function createAnimationState(visualElement) {
|
|
|
9261
9336
|
let state = createState();
|
|
9262
9337
|
let isInitialRender = true;
|
|
9263
9338
|
const buildResolvedTypeValues = (type) => (acc, definition) => {
|
|
9264
|
-
|
|
9339
|
+
var _a;
|
|
9340
|
+
const resolved = resolveVariant(visualElement, definition, type === "exit" ? (_a = visualElement.presenceContext) == null ? void 0 : _a.custom : void 0);
|
|
9265
9341
|
if (resolved) {
|
|
9266
|
-
const { transition, transitionEnd,
|
|
9267
|
-
acc = {
|
|
9342
|
+
const _b = resolved, { transition, transitionEnd } = _b, target = __objRest(_b, ["transition", "transitionEnd"]);
|
|
9343
|
+
acc = __spreadValues(__spreadValues(__spreadValues({}, acc), target), transitionEnd);
|
|
9268
9344
|
}
|
|
9269
9345
|
return acc;
|
|
9270
9346
|
};
|
|
@@ -9290,7 +9366,7 @@ function createAnimationState(visualElement) {
|
|
|
9290
9366
|
if (isInherited && isInitialRender && visualElement.manuallyAnimateOnMount) {
|
|
9291
9367
|
isInherited = false;
|
|
9292
9368
|
}
|
|
9293
|
-
typeState.protectedKeys = {
|
|
9369
|
+
typeState.protectedKeys = __spreadValues({}, encounteredKeys);
|
|
9294
9370
|
if (
|
|
9295
9371
|
// If it isn't active and hasn't *just* been set as inactive
|
|
9296
9372
|
!typeState.isActive && activeDelta === null || // If we didn't and don't have any defined prop for this animation type
|
|
@@ -9309,10 +9385,7 @@ function createAnimationState(visualElement) {
|
|
|
9309
9385
|
if (activeDelta === false)
|
|
9310
9386
|
resolvedValues = {};
|
|
9311
9387
|
const { prevResolvedValues = {} } = typeState;
|
|
9312
|
-
const allKeys = {
|
|
9313
|
-
...prevResolvedValues,
|
|
9314
|
-
...resolvedValues
|
|
9315
|
-
};
|
|
9388
|
+
const allKeys = __spreadValues(__spreadValues({}, prevResolvedValues), resolvedValues);
|
|
9316
9389
|
const markToAnimate = (key) => {
|
|
9317
9390
|
shouldAnimateType = true;
|
|
9318
9391
|
if (removedKeys.has(key)) {
|
|
@@ -9350,7 +9423,7 @@ function createAnimationState(visualElement) {
|
|
|
9350
9423
|
typeState.prevProp = prop;
|
|
9351
9424
|
typeState.prevResolvedValues = resolvedValues;
|
|
9352
9425
|
if (typeState.isActive) {
|
|
9353
|
-
encounteredKeys = {
|
|
9426
|
+
encounteredKeys = __spreadValues(__spreadValues({}, encounteredKeys), resolvedValues);
|
|
9354
9427
|
}
|
|
9355
9428
|
if (isInitialRender && visualElement.blockInitialAnimation) {
|
|
9356
9429
|
shouldAnimateType = false;
|
|
@@ -9377,7 +9450,7 @@ function createAnimationState(visualElement) {
|
|
|
9377
9450
|
const motionValue2 = visualElement.getValue(key);
|
|
9378
9451
|
if (motionValue2)
|
|
9379
9452
|
motionValue2.liveStyle = true;
|
|
9380
|
-
fallbackAnimation[key] = fallbackTarget
|
|
9453
|
+
fallbackAnimation[key] = fallbackTarget != null ? fallbackTarget : null;
|
|
9381
9454
|
});
|
|
9382
9455
|
animations2.push({ animation: fallbackAnimation });
|
|
9383
9456
|
}
|
|
@@ -9389,9 +9462,13 @@ function createAnimationState(visualElement) {
|
|
|
9389
9462
|
return shouldAnimate ? animate(animations2) : Promise.resolve();
|
|
9390
9463
|
}
|
|
9391
9464
|
function setActive(type, isActive) {
|
|
9465
|
+
var _a;
|
|
9392
9466
|
if (state[type].isActive === isActive)
|
|
9393
9467
|
return Promise.resolve();
|
|
9394
|
-
visualElement.variantChildren
|
|
9468
|
+
(_a = visualElement.variantChildren) == null ? void 0 : _a.forEach((child) => {
|
|
9469
|
+
var _a2;
|
|
9470
|
+
return (_a2 = child.animationState) == null ? void 0 : _a2.setActive(type, isActive);
|
|
9471
|
+
});
|
|
9395
9472
|
state[type].isActive = isActive;
|
|
9396
9473
|
const animations2 = animateChanges(type);
|
|
9397
9474
|
for (const key in state) {
|
|
@@ -9479,8 +9556,9 @@ var AnimationFeature = class extends Feature {
|
|
|
9479
9556
|
}
|
|
9480
9557
|
}
|
|
9481
9558
|
unmount() {
|
|
9559
|
+
var _a;
|
|
9482
9560
|
this.node.animationState.reset();
|
|
9483
|
-
this.unmountControls
|
|
9561
|
+
(_a = this.unmountControls) == null ? void 0 : _a.call(this);
|
|
9484
9562
|
}
|
|
9485
9563
|
};
|
|
9486
9564
|
|
|
@@ -9756,7 +9834,7 @@ var distance = (a, b) => Math.abs(a - b);
|
|
|
9756
9834
|
function distance2D(a, b) {
|
|
9757
9835
|
const xDelta = distance(a.x, b.x);
|
|
9758
9836
|
const yDelta = distance(a.y, b.y);
|
|
9759
|
-
return Math.sqrt(xDelta
|
|
9837
|
+
return Math.sqrt(__pow(xDelta, 2) + __pow(yDelta, 2));
|
|
9760
9838
|
}
|
|
9761
9839
|
|
|
9762
9840
|
// ../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs
|
|
@@ -9777,7 +9855,7 @@ var PanSession = class {
|
|
|
9777
9855
|
return;
|
|
9778
9856
|
const { point: point2 } = info2;
|
|
9779
9857
|
const { timestamp: timestamp2 } = frameData;
|
|
9780
|
-
this.history.push({
|
|
9858
|
+
this.history.push(__spreadProps(__spreadValues({}, point2), { timestamp: timestamp2 }));
|
|
9781
9859
|
const { onStart, onMove } = this.handlers;
|
|
9782
9860
|
if (!isPanStarted) {
|
|
9783
9861
|
onStart && onStart(this.lastMoveEvent, info2);
|
|
@@ -9813,7 +9891,7 @@ var PanSession = class {
|
|
|
9813
9891
|
const initialInfo = transformPoint(info, this.transformPagePoint);
|
|
9814
9892
|
const { point } = initialInfo;
|
|
9815
9893
|
const { timestamp } = frameData;
|
|
9816
|
-
this.history = [{
|
|
9894
|
+
this.history = [__spreadProps(__spreadValues({}, point), { timestamp })];
|
|
9817
9895
|
const { onSessionStart } = handlers;
|
|
9818
9896
|
onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history));
|
|
9819
9897
|
this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp));
|
|
@@ -10037,7 +10115,10 @@ var VisualElementDragControls = class {
|
|
|
10037
10115
|
onDrag && onDrag(event, info);
|
|
10038
10116
|
};
|
|
10039
10117
|
const onSessionEnd = (event, info) => this.stop(event, info);
|
|
10040
|
-
const resumeAnimation = () => eachAxis((axis) =>
|
|
10118
|
+
const resumeAnimation = () => eachAxis((axis) => {
|
|
10119
|
+
var _a;
|
|
10120
|
+
return this.getAnimationState(axis) === "paused" && ((_a = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a.play());
|
|
10121
|
+
});
|
|
10041
10122
|
const { dragSnapToOrigin } = this.getProps();
|
|
10042
10123
|
this.panSession = new PanSession(originEvent, {
|
|
10043
10124
|
onSessionStart,
|
|
@@ -10090,8 +10171,9 @@ var VisualElementDragControls = class {
|
|
|
10090
10171
|
axisValue.set(next);
|
|
10091
10172
|
}
|
|
10092
10173
|
resolveConstraints() {
|
|
10174
|
+
var _a;
|
|
10093
10175
|
const { dragConstraints, dragElastic } = this.getProps();
|
|
10094
|
-
const layout2 = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(false) : this.visualElement.projection
|
|
10176
|
+
const layout2 = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(false) : (_a = this.visualElement.projection) == null ? void 0 : _a.layout;
|
|
10095
10177
|
const prevConstraints = this.constraints;
|
|
10096
10178
|
if (dragConstraints && isRefObject(dragConstraints)) {
|
|
10097
10179
|
if (!this.constraints) {
|
|
@@ -10145,17 +10227,15 @@ var VisualElementDragControls = class {
|
|
|
10145
10227
|
transition = { min: 0, max: 0 };
|
|
10146
10228
|
const bounceStiffness = dragElastic ? 200 : 1e6;
|
|
10147
10229
|
const bounceDamping = dragElastic ? 40 : 1e7;
|
|
10148
|
-
const inertia2 = {
|
|
10230
|
+
const inertia2 = __spreadValues(__spreadValues({
|
|
10149
10231
|
type: "inertia",
|
|
10150
10232
|
velocity: dragMomentum ? velocity[axis] : 0,
|
|
10151
10233
|
bounceStiffness,
|
|
10152
10234
|
bounceDamping,
|
|
10153
10235
|
timeConstant: 750,
|
|
10154
10236
|
restDelta: 1,
|
|
10155
|
-
restSpeed: 10
|
|
10156
|
-
|
|
10157
|
-
...transition
|
|
10158
|
-
};
|
|
10237
|
+
restSpeed: 10
|
|
10238
|
+
}, dragTransition), transition);
|
|
10159
10239
|
return this.startAxisValueAnimation(axis, inertia2);
|
|
10160
10240
|
});
|
|
10161
10241
|
return Promise.all(momentumAnimations).then(onDragTransitionEnd);
|
|
@@ -10169,10 +10249,14 @@ var VisualElementDragControls = class {
|
|
|
10169
10249
|
eachAxis((axis) => this.getAxisMotionValue(axis).stop());
|
|
10170
10250
|
}
|
|
10171
10251
|
pauseAnimation() {
|
|
10172
|
-
eachAxis((axis) =>
|
|
10252
|
+
eachAxis((axis) => {
|
|
10253
|
+
var _a;
|
|
10254
|
+
return (_a = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a.pause();
|
|
10255
|
+
});
|
|
10173
10256
|
}
|
|
10174
10257
|
getAnimationState(axis) {
|
|
10175
|
-
|
|
10258
|
+
var _a;
|
|
10259
|
+
return (_a = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a.state;
|
|
10176
10260
|
}
|
|
10177
10261
|
/**
|
|
10178
10262
|
* Drag works differently depending on which props are provided.
|
|
@@ -10278,15 +10362,14 @@ var VisualElementDragControls = class {
|
|
|
10278
10362
|
getProps() {
|
|
10279
10363
|
const props = this.visualElement.getProps();
|
|
10280
10364
|
const { drag: drag2 = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true } = props;
|
|
10281
|
-
return {
|
|
10282
|
-
...props,
|
|
10365
|
+
return __spreadProps(__spreadValues({}, props), {
|
|
10283
10366
|
drag: drag2,
|
|
10284
10367
|
dragDirectionLock,
|
|
10285
10368
|
dragPropagation,
|
|
10286
10369
|
dragConstraints,
|
|
10287
10370
|
dragElastic,
|
|
10288
10371
|
dragMomentum
|
|
10289
|
-
};
|
|
10372
|
+
});
|
|
10290
10373
|
}
|
|
10291
10374
|
};
|
|
10292
10375
|
function shouldDrag(direction, drag2, currentDirection) {
|
|
@@ -10450,10 +10533,9 @@ var MeasureLayoutWithContext = class extends import_react18.Component {
|
|
|
10450
10533
|
projection.addEventListener("animationComplete", () => {
|
|
10451
10534
|
this.safeToRemove();
|
|
10452
10535
|
});
|
|
10453
|
-
projection.setOptions({
|
|
10454
|
-
...projection.options,
|
|
10536
|
+
projection.setOptions(__spreadProps(__spreadValues({}, projection.options), {
|
|
10455
10537
|
onExitComplete: () => this.safeToRemove()
|
|
10456
|
-
});
|
|
10538
|
+
}));
|
|
10457
10539
|
}
|
|
10458
10540
|
globalProjectionState.hasEverUpdated = true;
|
|
10459
10541
|
}
|
|
@@ -10515,18 +10597,17 @@ var MeasureLayoutWithContext = class extends import_react18.Component {
|
|
|
10515
10597
|
function MeasureLayout(props) {
|
|
10516
10598
|
const [isPresent, safeToRemove] = usePresence();
|
|
10517
10599
|
const layoutGroup = (0, import_react18.useContext)(LayoutGroupContext);
|
|
10518
|
-
return (0, import_jsx_runtime4.jsx)(MeasureLayoutWithContext, {
|
|
10600
|
+
return (0, import_jsx_runtime4.jsx)(MeasureLayoutWithContext, __spreadProps(__spreadValues({}, props), { layoutGroup, switchLayoutGroup: (0, import_react18.useContext)(SwitchLayoutGroupContext), isPresent, safeToRemove }));
|
|
10519
10601
|
}
|
|
10520
10602
|
var defaultScaleCorrectors = {
|
|
10521
|
-
borderRadius: {
|
|
10522
|
-
...correctBorderRadius,
|
|
10603
|
+
borderRadius: __spreadProps(__spreadValues({}, correctBorderRadius), {
|
|
10523
10604
|
applyTo: [
|
|
10524
10605
|
"borderTopLeftRadius",
|
|
10525
10606
|
"borderTopRightRadius",
|
|
10526
10607
|
"borderBottomLeftRadius",
|
|
10527
10608
|
"borderBottomRightRadius"
|
|
10528
10609
|
]
|
|
10529
|
-
},
|
|
10610
|
+
}),
|
|
10530
10611
|
borderTopLeftRadius: correctBorderRadius,
|
|
10531
10612
|
borderTopRightRadius: correctBorderRadius,
|
|
10532
10613
|
borderBottomLeftRadius: correctBorderRadius,
|
|
@@ -10585,11 +10666,12 @@ var numBorders = borders.length;
|
|
|
10585
10666
|
var asNumber = (value) => typeof value === "string" ? parseFloat(value) : value;
|
|
10586
10667
|
var isPx = (value) => typeof value === "number" || px.test(value);
|
|
10587
10668
|
function mixValues(target, follow, lead, progress2, shouldCrossfadeOpacity, isOnlyMember) {
|
|
10669
|
+
var _a, _b, _c, _d;
|
|
10588
10670
|
if (shouldCrossfadeOpacity) {
|
|
10589
|
-
target.opacity = mixNumber(0, lead.opacity
|
|
10590
|
-
target.opacityExit = mixNumber(follow.opacity
|
|
10671
|
+
target.opacity = mixNumber(0, (_a = lead.opacity) != null ? _a : 1, easeCrossfadeIn(progress2));
|
|
10672
|
+
target.opacityExit = mixNumber((_b = follow.opacity) != null ? _b : 1, 0, easeCrossfadeOut(progress2));
|
|
10591
10673
|
} else if (isOnlyMember) {
|
|
10592
|
-
target.opacity = mixNumber(follow.opacity
|
|
10674
|
+
target.opacity = mixNumber((_c = follow.opacity) != null ? _c : 1, (_d = lead.opacity) != null ? _d : 1, progress2);
|
|
10593
10675
|
}
|
|
10594
10676
|
for (let i = 0; i < numBorders; i++) {
|
|
10595
10677
|
const borderLabel = `border${borders[i]}Radius`;
|
|
@@ -10800,7 +10882,7 @@ function buildProjectionTransform(delta, treeScale, latestTransform) {
|
|
|
10800
10882
|
let transform = "";
|
|
10801
10883
|
const xTranslate = delta.x.translate / treeScale.x;
|
|
10802
10884
|
const yTranslate = delta.y.translate / treeScale.y;
|
|
10803
|
-
const zTranslate = latestTransform
|
|
10885
|
+
const zTranslate = (latestTransform == null ? void 0 : latestTransform.z) || 0;
|
|
10804
10886
|
if (xTranslate || yTranslate || zTranslate) {
|
|
10805
10887
|
transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `;
|
|
10806
10888
|
}
|
|
@@ -10869,7 +10951,7 @@ function cancelTreeOptimisedTransformAnimations(projectionNode) {
|
|
|
10869
10951
|
}
|
|
10870
10952
|
function createProjectionNode2({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform }) {
|
|
10871
10953
|
return class ProjectionNode {
|
|
10872
|
-
constructor(latestValues = {}, parent = defaultParent
|
|
10954
|
+
constructor(latestValues = {}, parent = defaultParent == null ? void 0 : defaultParent()) {
|
|
10873
10955
|
this.id = id2++;
|
|
10874
10956
|
this.animationId = 0;
|
|
10875
10957
|
this.children = /* @__PURE__ */ new Set();
|
|
@@ -10991,11 +11073,10 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
10991
11073
|
this.resumingFrom.resumingFrom = void 0;
|
|
10992
11074
|
}
|
|
10993
11075
|
this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
|
|
10994
|
-
const animationOptions = {
|
|
10995
|
-
...getValueTransition(layoutTransition, "layout"),
|
|
11076
|
+
const animationOptions = __spreadProps(__spreadValues({}, getValueTransition(layoutTransition, "layout")), {
|
|
10996
11077
|
onPlay: onLayoutAnimationStart,
|
|
10997
11078
|
onComplete: onLayoutAnimationComplete
|
|
10998
|
-
};
|
|
11079
|
+
});
|
|
10999
11080
|
if (visualElement.shouldReduceMotion || this.options.layoutRoot) {
|
|
11000
11081
|
animationOptions.delay = 0;
|
|
11001
11082
|
animationOptions.type = false;
|
|
@@ -11207,11 +11288,12 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11207
11288
|
};
|
|
11208
11289
|
}
|
|
11209
11290
|
measurePageBox() {
|
|
11291
|
+
var _a;
|
|
11210
11292
|
const { visualElement } = this.options;
|
|
11211
11293
|
if (!visualElement)
|
|
11212
11294
|
return createBox();
|
|
11213
11295
|
const box = visualElement.measureViewportBox();
|
|
11214
|
-
const wasInScrollRoot = this.scroll
|
|
11296
|
+
const wasInScrollRoot = ((_a = this.scroll) == null ? void 0 : _a.wasRoot) || this.path.some(checkNodeWasScrollRoot);
|
|
11215
11297
|
if (!wasInScrollRoot) {
|
|
11216
11298
|
const { scroll } = this.root;
|
|
11217
11299
|
if (scroll) {
|
|
@@ -11222,9 +11304,10 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11222
11304
|
return box;
|
|
11223
11305
|
}
|
|
11224
11306
|
removeElementScroll(box) {
|
|
11307
|
+
var _a;
|
|
11225
11308
|
const boxWithoutScroll = createBox();
|
|
11226
11309
|
copyBoxInto(boxWithoutScroll, box);
|
|
11227
|
-
if (this.scroll
|
|
11310
|
+
if ((_a = this.scroll) == null ? void 0 : _a.wasRoot) {
|
|
11228
11311
|
return boxWithoutScroll;
|
|
11229
11312
|
}
|
|
11230
11313
|
for (let i = 0; i < this.path.length; i++) {
|
|
@@ -11286,11 +11369,9 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11286
11369
|
this.isProjectionDirty = true;
|
|
11287
11370
|
}
|
|
11288
11371
|
setOptions(options) {
|
|
11289
|
-
this.options = {
|
|
11290
|
-
...this.options,
|
|
11291
|
-
...options,
|
|
11372
|
+
this.options = __spreadProps(__spreadValues(__spreadValues({}, this.options), options), {
|
|
11292
11373
|
crossfade: options.crossfade !== void 0 ? options.crossfade : true
|
|
11293
|
-
};
|
|
11374
|
+
});
|
|
11294
11375
|
}
|
|
11295
11376
|
clearMeasurements() {
|
|
11296
11377
|
this.scroll = void 0;
|
|
@@ -11309,12 +11390,13 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11309
11390
|
}
|
|
11310
11391
|
}
|
|
11311
11392
|
resolveTargetDelta(forceRecalculation = false) {
|
|
11393
|
+
var _a;
|
|
11312
11394
|
const lead = this.getLead();
|
|
11313
11395
|
this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);
|
|
11314
11396
|
this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);
|
|
11315
11397
|
this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);
|
|
11316
11398
|
const isShared = Boolean(this.resumingFrom) || this !== lead;
|
|
11317
|
-
const canSkip = !(forceRecalculation || isShared && this.isSharedProjectionDirty || this.isProjectionDirty || this.parent
|
|
11399
|
+
const canSkip = !(forceRecalculation || isShared && this.isSharedProjectionDirty || this.isProjectionDirty || ((_a = this.parent) == null ? void 0 : _a.isProjectionDirty) || this.attemptToResolveRelativeTarget || this.root.updateBlockedByResize);
|
|
11318
11400
|
if (canSkip)
|
|
11319
11401
|
return;
|
|
11320
11402
|
const { layout: layout2, layoutId } = this.options;
|
|
@@ -11385,10 +11467,11 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11385
11467
|
return Boolean((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout);
|
|
11386
11468
|
}
|
|
11387
11469
|
calcProjection() {
|
|
11470
|
+
var _a;
|
|
11388
11471
|
const lead = this.getLead();
|
|
11389
11472
|
const isShared = Boolean(this.resumingFrom) || this !== lead;
|
|
11390
11473
|
let canSkip = true;
|
|
11391
|
-
if (this.isProjectionDirty || this.parent
|
|
11474
|
+
if (this.isProjectionDirty || ((_a = this.parent) == null ? void 0 : _a.isProjectionDirty)) {
|
|
11392
11475
|
canSkip = false;
|
|
11393
11476
|
}
|
|
11394
11477
|
if (isShared && (this.isSharedProjectionDirty || this.isTransformDirty)) {
|
|
@@ -11445,7 +11528,8 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11445
11528
|
this.isVisible = true;
|
|
11446
11529
|
}
|
|
11447
11530
|
scheduleRender(notifyAll = true) {
|
|
11448
|
-
|
|
11531
|
+
var _a;
|
|
11532
|
+
(_a = this.options.visualElement) == null ? void 0 : _a.scheduleRender();
|
|
11449
11533
|
if (notifyAll) {
|
|
11450
11534
|
const stack = this.getStack();
|
|
11451
11535
|
stack && stack.scheduleRender();
|
|
@@ -11462,7 +11546,7 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11462
11546
|
setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {
|
|
11463
11547
|
const snapshot = this.snapshot;
|
|
11464
11548
|
const snapshotLatestValues = snapshot ? snapshot.latestValues : {};
|
|
11465
|
-
const mixedValues = {
|
|
11549
|
+
const mixedValues = __spreadValues({}, this.latestValues);
|
|
11466
11550
|
const targetDelta = createDelta();
|
|
11467
11551
|
if (!this.relativeParent || !this.relativeParent.options.layoutRoot) {
|
|
11468
11552
|
this.relativeTarget = this.relativeTargetOrigin = void 0;
|
|
@@ -11503,9 +11587,10 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11503
11587
|
this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
|
|
11504
11588
|
}
|
|
11505
11589
|
startAnimation(options) {
|
|
11590
|
+
var _a, _b, _c;
|
|
11506
11591
|
this.notifyListeners("animationStart");
|
|
11507
|
-
this.currentAnimation
|
|
11508
|
-
this.resumingFrom
|
|
11592
|
+
(_a = this.currentAnimation) == null ? void 0 : _a.stop(false);
|
|
11593
|
+
(_c = (_b = this.resumingFrom) == null ? void 0 : _b.currentAnimation) == null ? void 0 : _c.stop(false);
|
|
11509
11594
|
if (this.pendingAnimation) {
|
|
11510
11595
|
cancelFrame(this.pendingAnimation);
|
|
11511
11596
|
this.pendingAnimation = void 0;
|
|
@@ -11514,8 +11599,7 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11514
11599
|
globalProjectionState.hasAnimatedSinceResize = true;
|
|
11515
11600
|
activeAnimations.layout++;
|
|
11516
11601
|
this.motionValue || (this.motionValue = motionValue(0));
|
|
11517
|
-
this.currentAnimation = animateSingleValue(this.motionValue, [0, 1e3], {
|
|
11518
|
-
...options,
|
|
11602
|
+
this.currentAnimation = animateSingleValue(this.motionValue, [0, 1e3], __spreadProps(__spreadValues({}, options), {
|
|
11519
11603
|
isSync: true,
|
|
11520
11604
|
onUpdate: (latest) => {
|
|
11521
11605
|
this.mixTargetDelta(latest);
|
|
@@ -11529,7 +11613,7 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11529
11613
|
options.onComplete && options.onComplete();
|
|
11530
11614
|
this.completeAnimation();
|
|
11531
11615
|
}
|
|
11532
|
-
});
|
|
11616
|
+
}));
|
|
11533
11617
|
if (this.resumingFrom) {
|
|
11534
11618
|
this.resumingFrom.currentAnimation = this.currentAnimation;
|
|
11535
11619
|
}
|
|
@@ -11588,12 +11672,14 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11588
11672
|
return stack ? stack.lead === this : true;
|
|
11589
11673
|
}
|
|
11590
11674
|
getLead() {
|
|
11675
|
+
var _a;
|
|
11591
11676
|
const { layoutId } = this.options;
|
|
11592
|
-
return layoutId ? this.getStack()
|
|
11677
|
+
return layoutId ? ((_a = this.getStack()) == null ? void 0 : _a.lead) || this : this;
|
|
11593
11678
|
}
|
|
11594
11679
|
getPrevLead() {
|
|
11680
|
+
var _a;
|
|
11595
11681
|
const { layoutId } = this.options;
|
|
11596
|
-
return layoutId ? this.getStack()
|
|
11682
|
+
return layoutId ? (_a = this.getStack()) == null ? void 0 : _a.prevLead : void 0;
|
|
11597
11683
|
}
|
|
11598
11684
|
getStack() {
|
|
11599
11685
|
const { layoutId } = this.options;
|
|
@@ -11648,6 +11734,7 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11648
11734
|
visualElement.scheduleRender();
|
|
11649
11735
|
}
|
|
11650
11736
|
getProjectionStyles(styleProp) {
|
|
11737
|
+
var _a, _b;
|
|
11651
11738
|
if (!this.instance || this.isSVG)
|
|
11652
11739
|
return void 0;
|
|
11653
11740
|
if (!this.isVisible) {
|
|
@@ -11660,7 +11747,7 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11660
11747
|
if (this.needsReset) {
|
|
11661
11748
|
this.needsReset = false;
|
|
11662
11749
|
styles.opacity = "";
|
|
11663
|
-
styles.pointerEvents = resolveMotionValue(styleProp
|
|
11750
|
+
styles.pointerEvents = resolveMotionValue(styleProp == null ? void 0 : styleProp.pointerEvents) || "";
|
|
11664
11751
|
styles.transform = transformTemplate ? transformTemplate(this.latestValues, "") : "none";
|
|
11665
11752
|
return styles;
|
|
11666
11753
|
}
|
|
@@ -11669,7 +11756,7 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11669
11756
|
const emptyStyles = {};
|
|
11670
11757
|
if (this.options.layoutId) {
|
|
11671
11758
|
emptyStyles.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1;
|
|
11672
|
-
emptyStyles.pointerEvents = resolveMotionValue(styleProp
|
|
11759
|
+
emptyStyles.pointerEvents = resolveMotionValue(styleProp == null ? void 0 : styleProp.pointerEvents) || "";
|
|
11673
11760
|
}
|
|
11674
11761
|
if (this.hasProjected && !hasTransform(this.latestValues)) {
|
|
11675
11762
|
emptyStyles.transform = transformTemplate ? transformTemplate({}, "") : "none";
|
|
@@ -11686,7 +11773,7 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11686
11773
|
const { x, y } = this.projectionDelta;
|
|
11687
11774
|
styles.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;
|
|
11688
11775
|
if (lead.animationValues) {
|
|
11689
|
-
styles.opacity = lead === this ? valuesToRender.opacity
|
|
11776
|
+
styles.opacity = lead === this ? (_b = (_a = valuesToRender.opacity) != null ? _a : this.latestValues.opacity) != null ? _b : 1 : this.preserveOpacity ? this.latestValues.opacity : valuesToRender.opacityExit;
|
|
11690
11777
|
} else {
|
|
11691
11778
|
styles.opacity = lead === this ? valuesToRender.opacity !== void 0 ? valuesToRender.opacity : "" : valuesToRender.opacityExit !== void 0 ? valuesToRender.opacityExit : 0;
|
|
11692
11779
|
}
|
|
@@ -11709,7 +11796,7 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11709
11796
|
}
|
|
11710
11797
|
}
|
|
11711
11798
|
if (this.options.layoutId) {
|
|
11712
|
-
styles.pointerEvents = lead === this ? resolveMotionValue(styleProp
|
|
11799
|
+
styles.pointerEvents = lead === this ? resolveMotionValue(styleProp == null ? void 0 : styleProp.pointerEvents) || "" : "none";
|
|
11713
11800
|
}
|
|
11714
11801
|
return styles;
|
|
11715
11802
|
}
|
|
@@ -11718,7 +11805,10 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
|
|
|
11718
11805
|
}
|
|
11719
11806
|
// Only run on root
|
|
11720
11807
|
resetTree() {
|
|
11721
|
-
this.root.nodes.forEach((node) =>
|
|
11808
|
+
this.root.nodes.forEach((node) => {
|
|
11809
|
+
var _a;
|
|
11810
|
+
return (_a = node.currentAnimation) == null ? void 0 : _a.stop(false);
|
|
11811
|
+
});
|
|
11722
11812
|
this.root.nodes.forEach(clearMeasurements);
|
|
11723
11813
|
this.root.sharedNodes.clear();
|
|
11724
11814
|
}
|
|
@@ -11728,7 +11818,8 @@ function updateLayout(node) {
|
|
|
11728
11818
|
node.updateLayout();
|
|
11729
11819
|
}
|
|
11730
11820
|
function notifyLayoutUpdate(node) {
|
|
11731
|
-
|
|
11821
|
+
var _a;
|
|
11822
|
+
const snapshot = ((_a = node.resumeFrom) == null ? void 0 : _a.snapshot) || node.snapshot;
|
|
11732
11823
|
if (node.isLead() && node.layout && snapshot && node.hasListeners("didUpdate")) {
|
|
11733
11824
|
const { layoutBox: layout2, measuredBox: measuredLayout } = node.layout;
|
|
11734
11825
|
const { animationType } = node.options;
|
|
@@ -11878,7 +11969,8 @@ function shouldAnimatePositionOnly(animationType, snapshot, layout2) {
|
|
|
11878
11969
|
return animationType === "position" || animationType === "preserve-aspect" && !isNear(aspectRatio(snapshot), aspectRatio(layout2), 0.2);
|
|
11879
11970
|
}
|
|
11880
11971
|
function checkNodeWasScrollRoot(node) {
|
|
11881
|
-
|
|
11972
|
+
var _a;
|
|
11973
|
+
return node !== node.root && ((_a = node.scroll) == null ? void 0 : _a.wasRoot);
|
|
11882
11974
|
}
|
|
11883
11975
|
|
|
11884
11976
|
// ../../node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs
|
|
@@ -12023,7 +12115,8 @@ var fireObserverCallback = (entry) => {
|
|
|
12023
12115
|
var fireAllObserverCallbacks = (entries) => {
|
|
12024
12116
|
entries.forEach(fireObserverCallback);
|
|
12025
12117
|
};
|
|
12026
|
-
function initIntersectionObserver(
|
|
12118
|
+
function initIntersectionObserver(_a) {
|
|
12119
|
+
var _b = _a, { root } = _b, options = __objRest(_b, ["root"]);
|
|
12027
12120
|
const lookupRoot = root || document;
|
|
12028
12121
|
if (!observers.has(lookupRoot)) {
|
|
12029
12122
|
observers.set(lookupRoot, {});
|
|
@@ -12031,7 +12124,7 @@ function initIntersectionObserver({ root, ...options }) {
|
|
|
12031
12124
|
const rootObservers = observers.get(lookupRoot);
|
|
12032
12125
|
const key = JSON.stringify(options);
|
|
12033
12126
|
if (!rootObservers[key]) {
|
|
12034
|
-
rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root,
|
|
12127
|
+
rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, __spreadValues({ root }, options));
|
|
12035
12128
|
}
|
|
12036
12129
|
return rootObservers[key];
|
|
12037
12130
|
}
|
|
@@ -12233,8 +12326,8 @@ var VisualElement = class {
|
|
|
12233
12326
|
};
|
|
12234
12327
|
const { latestValues, renderState } = visualState;
|
|
12235
12328
|
this.latestValues = latestValues;
|
|
12236
|
-
this.baseTarget = {
|
|
12237
|
-
this.initialValues = props.initial ? {
|
|
12329
|
+
this.baseTarget = __spreadValues({}, latestValues);
|
|
12330
|
+
this.initialValues = props.initial ? __spreadValues({}, latestValues) : {};
|
|
12238
12331
|
this.renderState = renderState;
|
|
12239
12332
|
this.parent = parent;
|
|
12240
12333
|
this.props = props;
|
|
@@ -12249,7 +12342,7 @@ var VisualElement = class {
|
|
|
12249
12342
|
this.variantChildren = /* @__PURE__ */ new Set();
|
|
12250
12343
|
}
|
|
12251
12344
|
this.manuallyAnimateOnMount = Boolean(parent && parent.current);
|
|
12252
|
-
const
|
|
12345
|
+
const _a = this.scrapeMotionValuesFromProps(props, {}, this), { willChange } = _a, initialMotionValues = __objRest(_a, ["willChange"]);
|
|
12253
12346
|
for (const key in initialMotionValues) {
|
|
12254
12347
|
const value = initialMotionValues[key];
|
|
12255
12348
|
if (latestValues[key] !== void 0 && isMotionValue(value)) {
|
|
@@ -12480,7 +12573,8 @@ var VisualElement = class {
|
|
|
12480
12573
|
* directly from the instance (which might have performance implications).
|
|
12481
12574
|
*/
|
|
12482
12575
|
readValue(key, target) {
|
|
12483
|
-
|
|
12576
|
+
var _a;
|
|
12577
|
+
let value = this.latestValues[key] !== void 0 || !this.current ? this.latestValues[key] : (_a = this.getBaseTargetFromProps(this.props, key)) != null ? _a : this.readValueFromInstance(this.current, key, this.options);
|
|
12484
12578
|
if (value !== void 0 && value !== null) {
|
|
12485
12579
|
if (typeof value === "string" && (isNumericalString(value) || isZeroValueString(value))) {
|
|
12486
12580
|
value = parseFloat(value);
|
|
@@ -12503,10 +12597,11 @@ var VisualElement = class {
|
|
|
12503
12597
|
* props.
|
|
12504
12598
|
*/
|
|
12505
12599
|
getBaseTarget(key) {
|
|
12600
|
+
var _a;
|
|
12506
12601
|
const { initial } = this.props;
|
|
12507
12602
|
let valueFromInitial;
|
|
12508
12603
|
if (typeof initial === "string" || typeof initial === "object") {
|
|
12509
|
-
const variant = resolveVariantFromProps(this.props, initial, this.presenceContext
|
|
12604
|
+
const variant = resolveVariantFromProps(this.props, initial, (_a = this.presenceContext) == null ? void 0 : _a.custom);
|
|
12510
12605
|
if (variant) {
|
|
12511
12606
|
valueFromInitial = variant[key];
|
|
12512
12607
|
}
|
|
@@ -12583,8 +12678,9 @@ var HTMLVisualElement = class extends DOMVisualElement {
|
|
|
12583
12678
|
this.renderInstance = renderHTML;
|
|
12584
12679
|
}
|
|
12585
12680
|
readValueFromInstance(instance, key) {
|
|
12681
|
+
var _a;
|
|
12586
12682
|
if (transformProps.has(key)) {
|
|
12587
|
-
return this.projection
|
|
12683
|
+
return ((_a = this.projection) == null ? void 0 : _a.isProjecting) ? defaultTransformValue(key) : readTransformValue(instance, key);
|
|
12588
12684
|
} else {
|
|
12589
12685
|
const computedStyle = getComputedStyle2(instance);
|
|
12590
12686
|
const value = (isCSSVariableName(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0;
|
|
@@ -12679,12 +12775,7 @@ var createDomVisualElement = (Component2, options) => {
|
|
|
12679
12775
|
};
|
|
12680
12776
|
|
|
12681
12777
|
// ../../node_modules/framer-motion/dist/es/render/components/motion/create.mjs
|
|
12682
|
-
var createMotionComponent = /* @__PURE__ */ createMotionComponentFactory({
|
|
12683
|
-
...animations,
|
|
12684
|
-
...gestureAnimations,
|
|
12685
|
-
...drag,
|
|
12686
|
-
...layout
|
|
12687
|
-
}, createDomVisualElement);
|
|
12778
|
+
var createMotionComponent = /* @__PURE__ */ createMotionComponentFactory(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, animations), gestureAnimations), drag), layout), createDomVisualElement);
|
|
12688
12779
|
|
|
12689
12780
|
// ../../node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs
|
|
12690
12781
|
var motion = /* @__PURE__ */ createDOMMotionComponentProxy(createMotionComponent);
|
|
@@ -12821,7 +12912,7 @@ function Container({
|
|
|
12821
12912
|
"menu"
|
|
12822
12913
|
),
|
|
12823
12914
|
menuList.map((itemMenu, k) => {
|
|
12824
|
-
const letra = `${itemMenu
|
|
12915
|
+
const letra = `${itemMenu == null ? void 0 : itemMenu.name}`.split("")[0];
|
|
12825
12916
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
12826
12917
|
import_link.default,
|
|
12827
12918
|
{
|
|
@@ -12832,7 +12923,7 @@ function Container({
|
|
|
12832
12923
|
itemMenu.icon,
|
|
12833
12924
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: itemMenu.name })
|
|
12834
12925
|
] }),
|
|
12835
|
-
!isSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hover:bg-gray-200 hover:text-black rounded p-1", children: itemMenu
|
|
12926
|
+
!isSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "hover:bg-gray-200 hover:text-black rounded p-1", children: (itemMenu == null ? void 0 : itemMenu.icon) || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "px-1 border shadow rounded", children: letra }) })
|
|
12836
12927
|
]
|
|
12837
12928
|
}
|
|
12838
12929
|
) }, k);
|
|
@@ -12887,8 +12978,8 @@ function Form({
|
|
|
12887
12978
|
const ref = (0, import_react21.useRef)(null);
|
|
12888
12979
|
const [hvalues, setHValues] = state || (0, import_react21.useState)({});
|
|
12889
12980
|
(0, import_react21.useEffect)(() => {
|
|
12890
|
-
if (ref
|
|
12891
|
-
const newValues = {
|
|
12981
|
+
if (ref == null ? void 0 : ref.current) {
|
|
12982
|
+
const newValues = __spreadValues({}, hvalues);
|
|
12892
12983
|
const formData = new FormData(ref.current);
|
|
12893
12984
|
for (let [k, v] of formData.entries()) {
|
|
12894
12985
|
if (!newValues[k]) {
|
|
@@ -12901,8 +12992,9 @@ function Form({
|
|
|
12901
12992
|
}
|
|
12902
12993
|
}, [state, ref]);
|
|
12903
12994
|
function hasErrors() {
|
|
12904
|
-
|
|
12905
|
-
|
|
12995
|
+
var _a;
|
|
12996
|
+
const hasInvalids = (_a = ref == null ? void 0 : ref.current) == null ? void 0 : _a.querySelectorAll(".invalid");
|
|
12997
|
+
if (hasInvalids && (hasInvalids == null ? void 0 : hasInvalids.length) > 0) {
|
|
12906
12998
|
return true;
|
|
12907
12999
|
}
|
|
12908
13000
|
return false;
|
|
@@ -12917,17 +13009,17 @@ function Form({
|
|
|
12917
13009
|
alert(invalidMessage);
|
|
12918
13010
|
return;
|
|
12919
13011
|
}
|
|
12920
|
-
onSubmit && onSubmit({
|
|
13012
|
+
onSubmit && onSubmit(__spreadProps(__spreadValues({}, e), { values: hvalues }));
|
|
12921
13013
|
},
|
|
12922
13014
|
children: import_react21.default.Children.map(children, (child) => {
|
|
12923
13015
|
if (import_react21.default.isValidElement(child)) {
|
|
12924
|
-
const props = child
|
|
13016
|
+
const props = (child == null ? void 0 : child.props) ? __spreadValues({}, child.props) : {};
|
|
12925
13017
|
try {
|
|
12926
13018
|
return import_react21.default.cloneElement(child, {
|
|
12927
13019
|
value: hvalues[props.name] || "",
|
|
12928
13020
|
onChange: (e) => {
|
|
12929
|
-
setHValues({
|
|
12930
|
-
props
|
|
13021
|
+
setHValues(__spreadProps(__spreadValues({}, hvalues), { [props.name]: e.target.value }));
|
|
13022
|
+
(props == null ? void 0 : props.onChange) && props.onChange(e);
|
|
12931
13023
|
}
|
|
12932
13024
|
});
|
|
12933
13025
|
} catch (error) {
|
|
@@ -12942,29 +13034,33 @@ function Form({
|
|
|
12942
13034
|
|
|
12943
13035
|
// src/input/index.tsx
|
|
12944
13036
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
12945
|
-
function Input({
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
}
|
|
12952
|
-
|
|
13037
|
+
function Input(_a) {
|
|
13038
|
+
var _b = _a, {
|
|
13039
|
+
label,
|
|
13040
|
+
className,
|
|
13041
|
+
regex,
|
|
13042
|
+
invalidMessage = "Valor no v\xE1lido"
|
|
13043
|
+
} = _b, props = __objRest(_b, [
|
|
13044
|
+
"label",
|
|
13045
|
+
"className",
|
|
13046
|
+
"regex",
|
|
13047
|
+
"invalidMessage"
|
|
13048
|
+
]);
|
|
13049
|
+
const value = `${(props == null ? void 0 : props.value) || ""}`;
|
|
12953
13050
|
const isValid = !regex ? true : regex.test(value);
|
|
12954
13051
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w-full", children: [
|
|
12955
13052
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
12956
13053
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "font-bold ", children: label }),
|
|
12957
13054
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
12958
13055
|
"input",
|
|
12959
|
-
{
|
|
12960
|
-
...props,
|
|
13056
|
+
__spreadProps(__spreadValues({}, props), {
|
|
12961
13057
|
className: [
|
|
12962
13058
|
"p-2 w-full rounded border shadow",
|
|
12963
13059
|
value != "" && !isValid && "bg-red-200 text-black",
|
|
12964
13060
|
value != "" && isValid && "bg-green-200 text-black",
|
|
12965
13061
|
className
|
|
12966
13062
|
].join(" ")
|
|
12967
|
-
}
|
|
13063
|
+
})
|
|
12968
13064
|
) })
|
|
12969
13065
|
] }),
|
|
12970
13066
|
!isValid && value != "" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "text-red-800 invalid", children: invalidMessage })
|
|
@@ -12988,27 +13084,35 @@ var import_react24 = require("react");
|
|
|
12988
13084
|
// src/table/td.tsx
|
|
12989
13085
|
var import_react22 = __toESM(require("react"));
|
|
12990
13086
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
12991
|
-
function TD({
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
|
|
12995
|
-
|
|
12996
|
-
|
|
12997
|
-
|
|
12998
|
-
}
|
|
13087
|
+
function TD(_a) {
|
|
13088
|
+
var _b = _a, {
|
|
13089
|
+
className,
|
|
13090
|
+
item,
|
|
13091
|
+
index,
|
|
13092
|
+
color: color2,
|
|
13093
|
+
symbols
|
|
13094
|
+
} = _b, props = __objRest(_b, [
|
|
13095
|
+
"className",
|
|
13096
|
+
"item",
|
|
13097
|
+
"index",
|
|
13098
|
+
"color",
|
|
13099
|
+
"symbols"
|
|
13100
|
+
]);
|
|
12999
13101
|
const [isHidded, setIsHidded] = (0, import_react22.useState)(false);
|
|
13000
13102
|
const isNode = (0, import_react22.useMemo)(() => {
|
|
13001
|
-
|
|
13103
|
+
var _a2;
|
|
13104
|
+
return symbols && typeof symbols[item.name] == "object" && ((_a2 = symbols[item.name]) == null ? void 0 : _a2.props);
|
|
13002
13105
|
}, [symbols]);
|
|
13003
13106
|
const newProps = symbols && isNode && Object.keys(symbols[item.name].props).reduce(
|
|
13004
13107
|
(acc, i) => {
|
|
13005
13108
|
try {
|
|
13006
|
-
const newAcc = {
|
|
13109
|
+
const newAcc = __spreadValues({}, acc);
|
|
13007
13110
|
const hasEvent = `${i}`.startsWith("on");
|
|
13008
13111
|
if (hasEvent) {
|
|
13009
13112
|
newAcc[i] = (e) => {
|
|
13113
|
+
var _a2, _b2;
|
|
13010
13114
|
e.item = item;
|
|
13011
|
-
symbols[item.name].props[i]
|
|
13115
|
+
(_b2 = (_a2 = symbols[item.name].props)[i]) == null ? void 0 : _b2.call(_a2, e);
|
|
13012
13116
|
};
|
|
13013
13117
|
}
|
|
13014
13118
|
return newAcc;
|
|
@@ -13029,9 +13133,7 @@ function TD({
|
|
|
13029
13133
|
["number", "money"].includes(item.cellTypeOf) && "text-right"
|
|
13030
13134
|
].join(" "),
|
|
13031
13135
|
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: symbols && symbols[item.name] && "flex justify-between", children: [
|
|
13032
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: symbols && symbols[item.name] && (isNode ? import_react22.default.cloneElement(symbols[item.name], {
|
|
13033
|
-
...newProps
|
|
13034
|
-
}) : symbols[item.name]) }),
|
|
13136
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: symbols && symbols[item.name] && (isNode ? import_react22.default.cloneElement(symbols[item.name], __spreadValues({}, newProps)) : symbols[item.name]) }),
|
|
13035
13137
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: item.content })
|
|
13036
13138
|
] })
|
|
13037
13139
|
}
|
|
@@ -13111,7 +13213,7 @@ function FilterMenu({
|
|
|
13111
13213
|
{
|
|
13112
13214
|
className: "flex gap-1 w-full hover:bg-gray-100 p-3 cursor-pointer",
|
|
13113
13215
|
onClick: (e) => {
|
|
13114
|
-
const newFilters = {
|
|
13216
|
+
const newFilters = __spreadValues({}, filters);
|
|
13115
13217
|
newFilters[h] = [...items];
|
|
13116
13218
|
setFilters(newFilters);
|
|
13117
13219
|
},
|
|
@@ -13132,7 +13234,7 @@ function FilterMenu({
|
|
|
13132
13234
|
placeholder: "Buscar...",
|
|
13133
13235
|
value: text,
|
|
13134
13236
|
onChange: (e) => {
|
|
13135
|
-
setFilters({
|
|
13237
|
+
setFilters(__spreadProps(__spreadValues({}, filters), { [h]: [] }));
|
|
13136
13238
|
setText(e.target.value);
|
|
13137
13239
|
}
|
|
13138
13240
|
}
|
|
@@ -13150,7 +13252,7 @@ function FilterMenu({
|
|
|
13150
13252
|
type: "checkbox",
|
|
13151
13253
|
checked: filters[h].length == items.length,
|
|
13152
13254
|
onChange: (e) => {
|
|
13153
|
-
const newFilters = {
|
|
13255
|
+
const newFilters = __spreadValues({}, filters);
|
|
13154
13256
|
if (filters[h].length == items.length) {
|
|
13155
13257
|
newFilters[h] = [];
|
|
13156
13258
|
} else {
|
|
@@ -13164,7 +13266,8 @@ function FilterMenu({
|
|
|
13164
13266
|
"(Seleccionar todo)"
|
|
13165
13267
|
] }) }),
|
|
13166
13268
|
newMapedData.map((item, key) => {
|
|
13167
|
-
|
|
13269
|
+
var _a;
|
|
13270
|
+
const checked = (_a = filters[h]) == null ? void 0 : _a.find((i) => i == item);
|
|
13168
13271
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
13169
13272
|
"div",
|
|
13170
13273
|
{
|
|
@@ -13176,7 +13279,7 @@ function FilterMenu({
|
|
|
13176
13279
|
type: "checkbox",
|
|
13177
13280
|
checked: !!checked,
|
|
13178
13281
|
onChange: (e) => {
|
|
13179
|
-
const newFilters = {
|
|
13282
|
+
const newFilters = __spreadValues({}, filters);
|
|
13180
13283
|
newFilters[h] = newFilters[h] || [];
|
|
13181
13284
|
const index2 = newFilters[h].findIndex(
|
|
13182
13285
|
(nf) => nf == item
|
|
@@ -13227,15 +13330,22 @@ function FilterMenu({
|
|
|
13227
13330
|
|
|
13228
13331
|
// src/table/h.tsx
|
|
13229
13332
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
13230
|
-
function HTable({
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
}
|
|
13333
|
+
function HTable(_a) {
|
|
13334
|
+
var _b = _a, {
|
|
13335
|
+
data,
|
|
13336
|
+
mapedData,
|
|
13337
|
+
setMapedData,
|
|
13338
|
+
symbols,
|
|
13339
|
+
totals,
|
|
13340
|
+
exportName
|
|
13341
|
+
} = _b, props = __objRest(_b, [
|
|
13342
|
+
"data",
|
|
13343
|
+
"mapedData",
|
|
13344
|
+
"setMapedData",
|
|
13345
|
+
"symbols",
|
|
13346
|
+
"totals",
|
|
13347
|
+
"exportName"
|
|
13348
|
+
]);
|
|
13239
13349
|
const [selected, setSelected] = (0, import_react24.useState)(null);
|
|
13240
13350
|
const [selectedFilter, setSelectedFilter] = (0, import_react24.useState)(null);
|
|
13241
13351
|
const modalRef = (0, import_react24.useRef)(null);
|
|
@@ -13257,15 +13367,13 @@ function HTable({
|
|
|
13257
13367
|
}, {});
|
|
13258
13368
|
}, [mapedData]);
|
|
13259
13369
|
(0, import_react24.useEffect)(() => {
|
|
13260
|
-
setFilters({
|
|
13261
|
-
|
|
13262
|
-
|
|
13263
|
-
|
|
13264
|
-
|
|
13265
|
-
|
|
13266
|
-
|
|
13267
|
-
}, {})
|
|
13268
|
-
});
|
|
13370
|
+
setFilters(__spreadValues({}, head.reduce((acc, hh) => {
|
|
13371
|
+
const newAcc = __spreadValues({}, acc);
|
|
13372
|
+
newAcc[hh] = [
|
|
13373
|
+
...new Set(mapedData.map((md) => md[hh].content))
|
|
13374
|
+
];
|
|
13375
|
+
return newAcc;
|
|
13376
|
+
}, {})));
|
|
13269
13377
|
}, [mapedData, head]);
|
|
13270
13378
|
(0, import_react24.useEffect)(() => {
|
|
13271
13379
|
const newData = data.map((d, trkey) => {
|
|
@@ -13288,8 +13396,9 @@ function HTable({
|
|
|
13288
13396
|
});
|
|
13289
13397
|
setMapedData(newData);
|
|
13290
13398
|
}, [data]);
|
|
13291
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("table", {
|
|
13399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("table", __spreadProps(__spreadValues({}, props), { className: "w-full border-collapse table-auto", children: [
|
|
13292
13400
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("thead", { className: "bg-gray-800 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tr", { children: head.map((h, key) => {
|
|
13401
|
+
var _a2;
|
|
13293
13402
|
const items = [
|
|
13294
13403
|
...new Set(mapedData.map((item) => item[h].content))
|
|
13295
13404
|
];
|
|
@@ -13308,7 +13417,7 @@ function HTable({
|
|
|
13308
13417
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "text-white w-full bg-black rounded p-1 flex justify-center", children: [
|
|
13309
13418
|
h,
|
|
13310
13419
|
" ",
|
|
13311
|
-
filters[h]
|
|
13420
|
+
((_a2 = filters[h]) == null ? void 0 : _a2.length) != items.length && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "text-red-300", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FilterOffIcon, {}) })
|
|
13312
13421
|
] })
|
|
13313
13422
|
}
|
|
13314
13423
|
),
|
|
@@ -13343,7 +13452,8 @@ function HTable({
|
|
|
13343
13452
|
"tr",
|
|
13344
13453
|
{
|
|
13345
13454
|
onDoubleClick: (e) => {
|
|
13346
|
-
|
|
13455
|
+
var _a2;
|
|
13456
|
+
(_a2 = modalRef.current) == null ? void 0 : _a2.showModal();
|
|
13347
13457
|
},
|
|
13348
13458
|
onClick: (e) => setSelected(trKey),
|
|
13349
13459
|
className: [
|
|
@@ -13373,7 +13483,7 @@ function HTable({
|
|
|
13373
13483
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "p-1", children: mapedTotals[h] })
|
|
13374
13484
|
] }) }, fkey);
|
|
13375
13485
|
}) }) })
|
|
13376
|
-
] });
|
|
13486
|
+
] }));
|
|
13377
13487
|
}
|
|
13378
13488
|
|
|
13379
13489
|
// ../../node_modules/xlsx/xlsx.mjs
|
|
@@ -33884,7 +33994,7 @@ function Table(props) {
|
|
|
33884
33994
|
const isArray = Array.isArray(props.data);
|
|
33885
33995
|
const exported = useExportdata();
|
|
33886
33996
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "bg-gray-200 border rounded shadow p-1", children: [
|
|
33887
|
-
props
|
|
33997
|
+
(props == null ? void 0 : props.exportName) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
33888
33998
|
"button",
|
|
33889
33999
|
{
|
|
33890
34000
|
className: "p-2 border rounded shadow bg-green-800 text-white flex gap-1",
|
|
@@ -33905,13 +34015,10 @@ function Table(props) {
|
|
|
33905
34015
|
),
|
|
33906
34016
|
isArray && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
33907
34017
|
HTable,
|
|
33908
|
-
{
|
|
33909
|
-
|
|
33910
|
-
|
|
33911
|
-
|
|
33912
|
-
setMapedData
|
|
33913
|
-
}
|
|
33914
|
-
}
|
|
34018
|
+
__spreadValues({}, __spreadProps(__spreadValues({}, props), {
|
|
34019
|
+
mapedData,
|
|
34020
|
+
setMapedData
|
|
34021
|
+
}))
|
|
33915
34022
|
)
|
|
33916
34023
|
] });
|
|
33917
34024
|
}
|
|
@@ -33919,22 +34026,27 @@ function Table(props) {
|
|
|
33919
34026
|
// src/text-area/index.tsx
|
|
33920
34027
|
var import_react26 = require("react");
|
|
33921
34028
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
33922
|
-
function TextArea({
|
|
33923
|
-
|
|
33924
|
-
|
|
33925
|
-
|
|
33926
|
-
|
|
33927
|
-
|
|
33928
|
-
|
|
33929
|
-
}
|
|
34029
|
+
function TextArea(_a) {
|
|
34030
|
+
var _b = _a, {
|
|
34031
|
+
label,
|
|
34032
|
+
className,
|
|
34033
|
+
maxLength,
|
|
34034
|
+
onChange,
|
|
34035
|
+
children = ""
|
|
34036
|
+
} = _b, props = __objRest(_b, [
|
|
34037
|
+
"label",
|
|
34038
|
+
"className",
|
|
34039
|
+
"maxLength",
|
|
34040
|
+
"onChange",
|
|
34041
|
+
"children"
|
|
34042
|
+
]);
|
|
33930
34043
|
const [value, setValue] = (0, import_react26.useState)(children);
|
|
33931
34044
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
33932
34045
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "font-bold ", children: label }),
|
|
33933
34046
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
33934
34047
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
33935
34048
|
"textarea",
|
|
33936
|
-
{
|
|
33937
|
-
...props,
|
|
34049
|
+
__spreadProps(__spreadValues({}, props), {
|
|
33938
34050
|
className: ["p-1 w-full rounded border shadow", className].join(
|
|
33939
34051
|
" "
|
|
33940
34052
|
),
|
|
@@ -33943,10 +34055,10 @@ function TextArea({
|
|
|
33943
34055
|
e.target.value = e.target.value.slice(0, maxLength);
|
|
33944
34056
|
}
|
|
33945
34057
|
setValue(e.target.value);
|
|
33946
|
-
onChange
|
|
34058
|
+
onChange == null ? void 0 : onChange(e);
|
|
33947
34059
|
},
|
|
33948
34060
|
value
|
|
33949
|
-
}
|
|
34061
|
+
})
|
|
33950
34062
|
),
|
|
33951
34063
|
maxLength && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: " text-xs text-gray text-right", children: [
|
|
33952
34064
|
value.length,
|
|
@@ -34060,29 +34172,34 @@ function useResources({
|
|
|
34060
34172
|
const router = (0, import_navigation.useRouter)();
|
|
34061
34173
|
const [info, setInfo] = (0, import_react28.useState)({});
|
|
34062
34174
|
const result = (0, import_react28.useMemo)(() => {
|
|
34175
|
+
var _c, _d, _e, _f, _g, _h, _i;
|
|
34063
34176
|
const r = {};
|
|
34064
34177
|
for (const key in endpoints) {
|
|
34065
34178
|
const endpoint = endpoints[key];
|
|
34066
|
-
const showFunc =
|
|
34067
|
-
|
|
34068
|
-
|
|
34069
|
-
|
|
34070
|
-
|
|
34071
|
-
|
|
34179
|
+
const showFunc = (_a) => __async(null, null, function* () {
|
|
34180
|
+
var _b = _a, {
|
|
34181
|
+
limit = 10,
|
|
34182
|
+
page = 1,
|
|
34183
|
+
merge = true
|
|
34184
|
+
} = _b, query = __objRest(_b, [
|
|
34185
|
+
"limit",
|
|
34186
|
+
"page",
|
|
34187
|
+
"merge"
|
|
34188
|
+
]);
|
|
34072
34189
|
const options = {
|
|
34073
34190
|
method: "GET",
|
|
34074
34191
|
url: `${baseURI}/${key}`,
|
|
34075
|
-
params: { limit, page,
|
|
34192
|
+
params: __spreadValues({ limit, page }, query),
|
|
34076
34193
|
headers: { Authorization: token }
|
|
34077
34194
|
};
|
|
34078
|
-
const newInfo = {
|
|
34195
|
+
const newInfo = __spreadValues({}, info);
|
|
34079
34196
|
newInfo[key] = newInfo[key] || {};
|
|
34080
34197
|
newInfo[key].state = "loading";
|
|
34081
34198
|
newInfo[key].errorMessage = "";
|
|
34082
34199
|
newInfo[key].params = query;
|
|
34083
34200
|
setInfo(newInfo);
|
|
34084
34201
|
try {
|
|
34085
|
-
const consulta =
|
|
34202
|
+
const consulta = yield import_axios.default.request(options);
|
|
34086
34203
|
const d = consulta.data;
|
|
34087
34204
|
newInfo[key].state = "success";
|
|
34088
34205
|
newInfo[key].errorMessage = "";
|
|
@@ -34090,126 +34207,127 @@ function useResources({
|
|
|
34090
34207
|
newInfo[key].totalItems = d.totalItems;
|
|
34091
34208
|
newInfo[key].totalPages = d.totalPages;
|
|
34092
34209
|
newInfo[key].currentPage = d.currentPage;
|
|
34093
|
-
setInfo({
|
|
34210
|
+
setInfo(__spreadValues({}, newInfo));
|
|
34094
34211
|
return d.data;
|
|
34095
34212
|
} catch (error) {
|
|
34096
34213
|
const item = http_codes_default.find((s) => s.code == error.status);
|
|
34097
34214
|
newInfo[key].state = "error";
|
|
34098
|
-
newInfo[key].errorMessage = item
|
|
34215
|
+
newInfo[key].errorMessage = item == null ? void 0 : item.meaning;
|
|
34099
34216
|
if (error.status == 403) {
|
|
34100
34217
|
router.push(authURI);
|
|
34101
34218
|
}
|
|
34102
|
-
setInfo({
|
|
34219
|
+
setInfo(__spreadValues({}, newInfo));
|
|
34103
34220
|
return error;
|
|
34104
34221
|
}
|
|
34105
|
-
};
|
|
34106
|
-
r[key] = {
|
|
34107
|
-
...endpoint,
|
|
34222
|
+
});
|
|
34223
|
+
r[key] = __spreadProps(__spreadValues({}, endpoint), {
|
|
34108
34224
|
show: showFunc,
|
|
34109
|
-
find:
|
|
34225
|
+
find: (id3, query) => __async(null, null, function* () {
|
|
34226
|
+
var _a, _b, _c2;
|
|
34110
34227
|
const options = {
|
|
34111
34228
|
method: "GET",
|
|
34112
34229
|
url: `${baseURI}/${key}/${id3}`,
|
|
34113
|
-
params: {
|
|
34230
|
+
params: __spreadValues({}, query),
|
|
34114
34231
|
headers: { Authorization: token }
|
|
34115
34232
|
};
|
|
34116
|
-
const newInfo = {
|
|
34233
|
+
const newInfo = __spreadValues({}, info);
|
|
34117
34234
|
newInfo[key] = newInfo[key] || {};
|
|
34118
34235
|
newInfo[key].state = "loading";
|
|
34119
34236
|
newInfo[key].errorMessage = "";
|
|
34120
34237
|
newInfo[key].params = query;
|
|
34121
34238
|
setInfo(newInfo);
|
|
34122
34239
|
try {
|
|
34123
|
-
const consulta =
|
|
34240
|
+
const consulta = yield import_axios.default.request(options);
|
|
34124
34241
|
const d = consulta.data;
|
|
34125
34242
|
newInfo[key].state = "success";
|
|
34126
34243
|
newInfo[key].errorMessage = "";
|
|
34127
34244
|
newInfo[key].selectedItem = d;
|
|
34128
|
-
const index = newInfo[key]
|
|
34129
|
-
(d2) => d2
|
|
34245
|
+
const index = (_b = (_a = newInfo[key]) == null ? void 0 : _a.data) == null ? void 0 : _b.findIndex(
|
|
34246
|
+
(d2) => (d2 == null ? void 0 : d2.id) == (d2 == null ? void 0 : d2.id)
|
|
34130
34247
|
);
|
|
34131
34248
|
if (index >= 0) {
|
|
34132
34249
|
newInfo[key].data[index] = d;
|
|
34133
34250
|
} else {
|
|
34134
|
-
if (newInfo[key]
|
|
34251
|
+
if ((_c2 = newInfo[key]) == null ? void 0 : _c2.data) {
|
|
34135
34252
|
newInfo[key].data.unshift(d);
|
|
34136
34253
|
} else {
|
|
34137
34254
|
newInfo[key].data = [d];
|
|
34138
34255
|
}
|
|
34139
34256
|
}
|
|
34140
|
-
setInfo({
|
|
34257
|
+
setInfo(__spreadValues({}, newInfo));
|
|
34141
34258
|
return d.data;
|
|
34142
34259
|
} catch (error) {
|
|
34143
34260
|
const item = http_codes_default.find((s) => s.code == error.status);
|
|
34144
34261
|
newInfo[key].state = "error";
|
|
34145
|
-
newInfo[key].errorMessage = item
|
|
34262
|
+
newInfo[key].errorMessage = (item == null ? void 0 : item.meaning) || error.message;
|
|
34146
34263
|
if (error.status == 403) {
|
|
34147
34264
|
router.push(authURI);
|
|
34148
34265
|
}
|
|
34149
|
-
setInfo({
|
|
34266
|
+
setInfo(__spreadValues({}, newInfo));
|
|
34150
34267
|
return error;
|
|
34151
34268
|
}
|
|
34152
|
-
},
|
|
34153
|
-
create:
|
|
34269
|
+
}),
|
|
34270
|
+
create: (data) => __async(null, null, function* () {
|
|
34271
|
+
var _a, _b, _c2;
|
|
34154
34272
|
const options = {
|
|
34155
34273
|
method: "POST",
|
|
34156
34274
|
url: `${baseURI}/${key}`,
|
|
34157
|
-
data: {
|
|
34275
|
+
data: __spreadValues({}, data),
|
|
34158
34276
|
headers: { Authorization: token }
|
|
34159
34277
|
};
|
|
34160
|
-
const newInfo = {
|
|
34278
|
+
const newInfo = __spreadValues({}, info);
|
|
34161
34279
|
newInfo[key] = newInfo[key] || {};
|
|
34162
34280
|
newInfo[key].state = "loading";
|
|
34163
34281
|
newInfo[key].errorMessage = "";
|
|
34164
34282
|
setInfo(newInfo);
|
|
34165
34283
|
try {
|
|
34166
|
-
const consulta =
|
|
34284
|
+
const consulta = yield import_axios.default.request(options);
|
|
34167
34285
|
const d = consulta.data;
|
|
34168
34286
|
newInfo[key].state = "success";
|
|
34169
34287
|
newInfo[key].errorMessage = "";
|
|
34170
34288
|
newInfo[key].selectedItem = d;
|
|
34171
|
-
const index = newInfo[key]
|
|
34172
|
-
(d2) => d2
|
|
34289
|
+
const index = (_b = (_a = newInfo[key]) == null ? void 0 : _a.data) == null ? void 0 : _b.findIndex(
|
|
34290
|
+
(d2) => (d2 == null ? void 0 : d2.id) == (d2 == null ? void 0 : d2.id)
|
|
34173
34291
|
);
|
|
34174
34292
|
if (index >= 0) {
|
|
34175
34293
|
newInfo[key].data[index] = d;
|
|
34176
34294
|
} else {
|
|
34177
|
-
if (newInfo[key]
|
|
34295
|
+
if ((_c2 = newInfo[key]) == null ? void 0 : _c2.data) {
|
|
34178
34296
|
newInfo[key].data.unshift(d);
|
|
34179
34297
|
} else {
|
|
34180
34298
|
newInfo[key].data = [d];
|
|
34181
34299
|
}
|
|
34182
34300
|
}
|
|
34183
|
-
setInfo({
|
|
34301
|
+
setInfo(__spreadValues({}, newInfo));
|
|
34184
34302
|
return d.data;
|
|
34185
34303
|
} catch (error) {
|
|
34186
34304
|
const item = http_codes_default.find((s) => s.code == error.status);
|
|
34187
34305
|
newInfo[key].state = "error";
|
|
34188
|
-
newInfo[key].errorMessage = item
|
|
34306
|
+
newInfo[key].errorMessage = (item == null ? void 0 : item.meaning) || error.message;
|
|
34189
34307
|
if (error.status == 403) {
|
|
34190
34308
|
router.push(authURI);
|
|
34191
34309
|
}
|
|
34192
|
-
setInfo({
|
|
34310
|
+
setInfo(__spreadValues({}, newInfo));
|
|
34193
34311
|
return error;
|
|
34194
34312
|
}
|
|
34195
|
-
},
|
|
34196
|
-
update:
|
|
34313
|
+
}),
|
|
34314
|
+
update: (id3, data) => __async(null, null, function* () {
|
|
34197
34315
|
console.log("update", id3, data);
|
|
34198
|
-
},
|
|
34199
|
-
remove:
|
|
34316
|
+
}),
|
|
34317
|
+
remove: (id3) => __async(null, null, function* () {
|
|
34200
34318
|
console.log("remove", id3);
|
|
34201
|
-
},
|
|
34202
|
-
totalPages: info[key]
|
|
34203
|
-
currentPage: info[key]
|
|
34204
|
-
state: info[key]
|
|
34205
|
-
errorMessage: info[key]
|
|
34206
|
-
params: info[key]
|
|
34207
|
-
getAllPages:
|
|
34319
|
+
}),
|
|
34320
|
+
totalPages: (_c = info[key]) == null ? void 0 : _c.totalPages,
|
|
34321
|
+
currentPage: (_d = info[key]) == null ? void 0 : _d.currentPage,
|
|
34322
|
+
state: ((_e = info[key]) == null ? void 0 : _e.state) || "success",
|
|
34323
|
+
errorMessage: (_f = info[key]) == null ? void 0 : _f.errorMessage,
|
|
34324
|
+
params: (_g = info[key]) == null ? void 0 : _g.params,
|
|
34325
|
+
getAllPages: (limit = 10) => __async(null, null, function* () {
|
|
34208
34326
|
console.log("Not aviable");
|
|
34209
|
-
},
|
|
34210
|
-
data: info[key]
|
|
34211
|
-
selectedItem: info[key]
|
|
34212
|
-
};
|
|
34327
|
+
}),
|
|
34328
|
+
data: ((_h = info[key]) == null ? void 0 : _h.data) || [],
|
|
34329
|
+
selectedItem: ((_i = info[key]) == null ? void 0 : _i.selectedItem) || {}
|
|
34330
|
+
});
|
|
34213
34331
|
}
|
|
34214
34332
|
return r;
|
|
34215
34333
|
}, [info, token, endpoints]);
|
|
@@ -34257,15 +34375,20 @@ function CloseIcon() {
|
|
|
34257
34375
|
|
|
34258
34376
|
// src/select/index.tsx
|
|
34259
34377
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
34260
|
-
function Select({
|
|
34261
|
-
|
|
34262
|
-
|
|
34263
|
-
|
|
34264
|
-
|
|
34265
|
-
|
|
34266
|
-
}
|
|
34378
|
+
function Select(_a) {
|
|
34379
|
+
var _b = _a, {
|
|
34380
|
+
label,
|
|
34381
|
+
placeholder = "Selecciona...",
|
|
34382
|
+
children,
|
|
34383
|
+
strictMode = true
|
|
34384
|
+
} = _b, props = __objRest(_b, [
|
|
34385
|
+
"label",
|
|
34386
|
+
"placeholder",
|
|
34387
|
+
"children",
|
|
34388
|
+
"strictMode"
|
|
34389
|
+
]);
|
|
34267
34390
|
const [isOpen, setIsOpen] = (0, import_react29.useState)(false);
|
|
34268
|
-
const [inputValue, setInputValue] = (0, import_react29.useState)(props
|
|
34391
|
+
const [inputValue, setInputValue] = (0, import_react29.useState)((props == null ? void 0 : props.value) || "");
|
|
34269
34392
|
const [options, setOptions] = (0, import_react29.useState)(
|
|
34270
34393
|
[]
|
|
34271
34394
|
);
|
|
@@ -34293,7 +34416,10 @@ function Select({
|
|
|
34293
34416
|
(0, import_react29.useEffect)(() => {
|
|
34294
34417
|
setFiltered(
|
|
34295
34418
|
options.filter(
|
|
34296
|
-
(opt) =>
|
|
34419
|
+
(opt) => {
|
|
34420
|
+
var _a2, _b2;
|
|
34421
|
+
return (_b2 = (_a2 = opt == null ? void 0 : opt.label) == null ? void 0 : _a2.toLowerCase()) == null ? void 0 : _b2.includes(inputValue == null ? void 0 : inputValue.toLowerCase());
|
|
34422
|
+
}
|
|
34297
34423
|
)
|
|
34298
34424
|
);
|
|
34299
34425
|
setHighlightedIndex(-1);
|
|
@@ -34335,13 +34461,13 @@ function Select({
|
|
|
34335
34461
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative", children: [
|
|
34336
34462
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
34337
34463
|
"input",
|
|
34338
|
-
{
|
|
34464
|
+
__spreadProps(__spreadValues({
|
|
34339
34465
|
autoComplete: "off",
|
|
34340
|
-
ref: inputRef
|
|
34341
|
-
|
|
34466
|
+
ref: inputRef
|
|
34467
|
+
}, props), {
|
|
34342
34468
|
className: [
|
|
34343
34469
|
"p-2 w-full rounded border shadow",
|
|
34344
|
-
props
|
|
34470
|
+
props == null ? void 0 : props.className
|
|
34345
34471
|
].join(" "),
|
|
34346
34472
|
value: inputValue,
|
|
34347
34473
|
onBlur: (e) => {
|
|
@@ -34355,20 +34481,21 @@ function Select({
|
|
|
34355
34481
|
return;
|
|
34356
34482
|
}
|
|
34357
34483
|
} else {
|
|
34358
|
-
e.target.value = item
|
|
34484
|
+
e.target.value = (item == null ? void 0 : item.value) || item.label;
|
|
34359
34485
|
e.currentTarget.classList.add("bg-green-200");
|
|
34360
34486
|
e.currentTarget.classList.remove("bg-red-200");
|
|
34361
34487
|
}
|
|
34362
34488
|
props.onChange(e);
|
|
34363
34489
|
},
|
|
34364
34490
|
onChange: (e) => {
|
|
34491
|
+
var _a2;
|
|
34365
34492
|
setInputValue(e.target.value);
|
|
34366
|
-
props.onChange
|
|
34493
|
+
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
34367
34494
|
},
|
|
34368
34495
|
placeholder,
|
|
34369
34496
|
onFocus: () => setIsOpen(true),
|
|
34370
34497
|
onKeyDown: handleKeyDown
|
|
34371
|
-
}
|
|
34498
|
+
})
|
|
34372
34499
|
),
|
|
34373
34500
|
!isOpen && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "absolute top-0 right-0 flex flex-col justify-center items-center px-2 py-2 font-bold", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectIcon, {}) }),
|
|
34374
34501
|
isOpen && inputValue != "" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -34377,7 +34504,7 @@ function Select({
|
|
|
34377
34504
|
onClick: (e) => {
|
|
34378
34505
|
setIsOpen(true);
|
|
34379
34506
|
setInputValue("");
|
|
34380
|
-
if (inputRef
|
|
34507
|
+
if ((inputRef == null ? void 0 : inputRef.current) && strictMode) {
|
|
34381
34508
|
inputRef.current.classList.remove("bg-green-200");
|
|
34382
34509
|
inputRef.current.classList.add("bg-red-200");
|
|
34383
34510
|
}
|
|
@@ -34396,10 +34523,10 @@ function Select({
|
|
|
34396
34523
|
className: `p-2 cursor-pointer ${index === highlightedIndex ? "bg-blue-100" : "hover:bg-gray-100"}`,
|
|
34397
34524
|
onMouseDown: () => {
|
|
34398
34525
|
props.onChange({
|
|
34399
|
-
target: { value: opt
|
|
34526
|
+
target: { value: (opt == null ? void 0 : opt.value) || opt.label }
|
|
34400
34527
|
});
|
|
34401
34528
|
const item = validOption(opt.label);
|
|
34402
|
-
if (inputRef
|
|
34529
|
+
if (inputRef == null ? void 0 : inputRef.current) {
|
|
34403
34530
|
if (!item) {
|
|
34404
34531
|
if (strictMode) {
|
|
34405
34532
|
inputRef.current.value = "";
|