componentes-exagono 0.1.91 → 0.1.92
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.es.js +43 -43
- package/dist/index.umd.js +6 -6
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -64,10 +64,10 @@ function im() {
|
|
|
64
64
|
{
|
|
65
65
|
var De = x.ReactDebugCurrentFrame, $e = De.getStackAddendum();
|
|
66
66
|
$e !== "" && (q += "%s", de = de.concat([$e]));
|
|
67
|
-
var
|
|
67
|
+
var ze = de.map(function(Me) {
|
|
68
68
|
return String(Me);
|
|
69
69
|
});
|
|
70
|
-
|
|
70
|
+
ze.unshift("Warning: " + q), Function.prototype.apply.call(console[C], console, ze);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
var w = !1, S = !1, A = !1, I = !1, G = !1, M;
|
|
@@ -124,9 +124,9 @@ function im() {
|
|
|
124
124
|
var De = C.displayName || null;
|
|
125
125
|
return De !== null ? De : P(C.type) || "Memo";
|
|
126
126
|
case p: {
|
|
127
|
-
var $e = C,
|
|
127
|
+
var $e = C, ze = $e._payload, Me = $e._init;
|
|
128
128
|
try {
|
|
129
|
-
return P(Me(
|
|
129
|
+
return P(Me(ze));
|
|
130
130
|
} catch {
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
@@ -227,8 +227,8 @@ function im() {
|
|
|
227
227
|
ke = !0;
|
|
228
228
|
var $e = Error.prepareStackTrace;
|
|
229
229
|
Error.prepareStackTrace = void 0;
|
|
230
|
-
var
|
|
231
|
-
|
|
230
|
+
var ze;
|
|
231
|
+
ze = se.current, se.current = null, te();
|
|
232
232
|
try {
|
|
233
233
|
if (q) {
|
|
234
234
|
var Me = function() {
|
|
@@ -281,7 +281,7 @@ function im() {
|
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
} finally {
|
|
284
|
-
ke = !1, se.current =
|
|
284
|
+
ke = !1, se.current = ze, ae(), Error.prepareStackTrace = $e;
|
|
285
285
|
}
|
|
286
286
|
var rt = C ? C.displayName || C.name : "", Ge = rt ? ye(rt) : "";
|
|
287
287
|
return typeof C == "function" && we.set(C, Ge), Ge;
|
|
@@ -313,9 +313,9 @@ function im() {
|
|
|
313
313
|
case f:
|
|
314
314
|
return me(C.type, q, de);
|
|
315
315
|
case p: {
|
|
316
|
-
var De = C, $e = De._payload,
|
|
316
|
+
var De = C, $e = De._payload, ze = De._init;
|
|
317
317
|
try {
|
|
318
|
-
return me(
|
|
318
|
+
return me(ze($e), q, de);
|
|
319
319
|
} catch {
|
|
320
320
|
}
|
|
321
321
|
}
|
|
@@ -332,9 +332,9 @@ function im() {
|
|
|
332
332
|
}
|
|
333
333
|
function _(C, q, de, De, $e) {
|
|
334
334
|
{
|
|
335
|
-
var
|
|
335
|
+
var ze = Function.call.bind(Ie);
|
|
336
336
|
for (var Me in C)
|
|
337
|
-
if (
|
|
337
|
+
if (ze(C, Me)) {
|
|
338
338
|
var je = void 0;
|
|
339
339
|
try {
|
|
340
340
|
if (typeof C[Me] != "function") {
|
|
@@ -420,7 +420,7 @@ function im() {
|
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
var dr = function(C, q, de, De, $e,
|
|
423
|
+
var dr = function(C, q, de, De, $e, ze, Me) {
|
|
424
424
|
var je = {
|
|
425
425
|
// This tag allows us to uniquely identify this as a React Element
|
|
426
426
|
$$typeof: n,
|
|
@@ -430,7 +430,7 @@ function im() {
|
|
|
430
430
|
ref: de,
|
|
431
431
|
props: Me,
|
|
432
432
|
// Record the component responsible for creating this element.
|
|
433
|
-
_owner:
|
|
433
|
+
_owner: ze
|
|
434
434
|
};
|
|
435
435
|
return je._store = {}, Object.defineProperty(je._store, "validated", {
|
|
436
436
|
configurable: !1,
|
|
@@ -451,14 +451,14 @@ function im() {
|
|
|
451
451
|
};
|
|
452
452
|
function or(C, q, de, De, $e) {
|
|
453
453
|
{
|
|
454
|
-
var
|
|
454
|
+
var ze, Me = {}, je = null, L = null;
|
|
455
455
|
de !== void 0 && (J(de), je = "" + de), Ze(q) && (J(q.key), je = "" + q.key), ve(q) && (L = q.ref, At(q, $e));
|
|
456
|
-
for (
|
|
457
|
-
Ie.call(q,
|
|
456
|
+
for (ze in q)
|
|
457
|
+
Ie.call(q, ze) && !Re.hasOwnProperty(ze) && (Me[ze] = q[ze]);
|
|
458
458
|
if (C && C.defaultProps) {
|
|
459
459
|
var Y = C.defaultProps;
|
|
460
|
-
for (
|
|
461
|
-
Me[
|
|
460
|
+
for (ze in Y)
|
|
461
|
+
Me[ze] === void 0 && (Me[ze] = Y[ze]);
|
|
462
462
|
}
|
|
463
463
|
if (je || L) {
|
|
464
464
|
var ce = typeof C == "function" ? C.displayName || C.name || "Unknown" : C;
|
|
@@ -535,7 +535,7 @@ Check the top-level render call using <` + de + ">.");
|
|
|
535
535
|
else if (C) {
|
|
536
536
|
var $e = y(C);
|
|
537
537
|
if (typeof $e == "function" && $e !== C.entries)
|
|
538
|
-
for (var
|
|
538
|
+
for (var ze = $e.call(C), Me; !(Me = ze.next()).done; )
|
|
539
539
|
vo(Me.value) && ha(Me.value, q);
|
|
540
540
|
}
|
|
541
541
|
}
|
|
@@ -578,7 +578,7 @@ Check the top-level render call using <` + de + ">.");
|
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
var bo = {};
|
|
581
|
-
function va(C, q, de, De, $e,
|
|
581
|
+
function va(C, q, de, De, $e, ze) {
|
|
582
582
|
{
|
|
583
583
|
var Me = F(C);
|
|
584
584
|
if (!Me) {
|
|
@@ -589,7 +589,7 @@ Check the top-level render call using <` + de + ">.");
|
|
|
589
589
|
var Y;
|
|
590
590
|
C === null ? Y = "null" : N(C) ? Y = "array" : C !== void 0 && C.$$typeof === n ? (Y = "<" + (P(C.type) || "Unknown") + " />", je = " Did you accidentally export a JSX literal instead of a component?") : Y = typeof C, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Y, je);
|
|
591
591
|
}
|
|
592
|
-
var ce = or(C, q, de, $e,
|
|
592
|
+
var ce = or(C, q, de, $e, ze);
|
|
593
593
|
if (ce == null)
|
|
594
594
|
return ce;
|
|
595
595
|
if (Me) {
|
|
@@ -1334,7 +1334,7 @@ function Tm() {
|
|
|
1334
1334
|
return wa.exports;
|
|
1335
1335
|
}
|
|
1336
1336
|
var Am = /* @__PURE__ */ Tm();
|
|
1337
|
-
const
|
|
1337
|
+
const Le = /* @__PURE__ */ am(Am);
|
|
1338
1338
|
function vf(e) {
|
|
1339
1339
|
var n, t, r = "";
|
|
1340
1340
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
@@ -1545,7 +1545,7 @@ function jo(e, n) {
|
|
|
1545
1545
|
// No need to clone deep, it's way faster.
|
|
1546
1546
|
}) : e;
|
|
1547
1547
|
}
|
|
1548
|
-
const hn = process.env.NODE_ENV !== "production" ?
|
|
1548
|
+
const hn = process.env.NODE_ENV !== "production" ? Le.oneOfType([Le.number, Le.string, Le.object, Le.array]) : {};
|
|
1549
1549
|
function Vl(e, n) {
|
|
1550
1550
|
if (!e.containerQueries)
|
|
1551
1551
|
return n;
|
|
@@ -3876,7 +3876,7 @@ function ka(e, n, t) {
|
|
|
3876
3876
|
}
|
|
3877
3877
|
}
|
|
3878
3878
|
const Bg = /* @__PURE__ */ oe.createContext(void 0);
|
|
3879
|
-
process.env.NODE_ENV !== "production" && (
|
|
3879
|
+
process.env.NODE_ENV !== "production" && (Le.node, Le.object);
|
|
3880
3880
|
function Vg(e) {
|
|
3881
3881
|
const {
|
|
3882
3882
|
theme: n,
|
|
@@ -4993,7 +4993,7 @@ const Pv = (e) => Mv(e) && e !== "classes", jv = Og({
|
|
|
4993
4993
|
defaultTheme: Iv,
|
|
4994
4994
|
rootShouldForwardProp: Pv
|
|
4995
4995
|
}), Nv = Ug;
|
|
4996
|
-
process.env.NODE_ENV !== "production" && (
|
|
4996
|
+
process.env.NODE_ENV !== "production" && (Le.node, Le.object.isRequired);
|
|
4997
4997
|
function Fv(e) {
|
|
4998
4998
|
return Wg(e);
|
|
4999
4999
|
}
|
|
@@ -5157,15 +5157,15 @@ process.env.NODE_ENV !== "production" && (ls.propTypes = {
|
|
|
5157
5157
|
/**
|
|
5158
5158
|
* Node passed into the SVG element.
|
|
5159
5159
|
*/
|
|
5160
|
-
children:
|
|
5160
|
+
children: Le.node,
|
|
5161
5161
|
/**
|
|
5162
5162
|
* Override or extend the styles applied to the component.
|
|
5163
5163
|
*/
|
|
5164
|
-
classes:
|
|
5164
|
+
classes: Le.object,
|
|
5165
5165
|
/**
|
|
5166
5166
|
* @ignore
|
|
5167
5167
|
*/
|
|
5168
|
-
className:
|
|
5168
|
+
className: Le.string,
|
|
5169
5169
|
/**
|
|
5170
5170
|
* The color of the component.
|
|
5171
5171
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
@@ -5173,21 +5173,21 @@ process.env.NODE_ENV !== "production" && (ls.propTypes = {
|
|
|
5173
5173
|
* You can use the `htmlColor` prop to apply a color attribute to the SVG element.
|
|
5174
5174
|
* @default 'inherit'
|
|
5175
5175
|
*/
|
|
5176
|
-
color:
|
|
5176
|
+
color: Le.oneOfType([Le.oneOf(["inherit", "action", "disabled", "primary", "secondary", "error", "info", "success", "warning"]), Le.string]),
|
|
5177
5177
|
/**
|
|
5178
5178
|
* The component used for the root node.
|
|
5179
5179
|
* Either a string to use a HTML element or a component.
|
|
5180
5180
|
*/
|
|
5181
|
-
component:
|
|
5181
|
+
component: Le.elementType,
|
|
5182
5182
|
/**
|
|
5183
5183
|
* The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.
|
|
5184
5184
|
* @default 'medium'
|
|
5185
5185
|
*/
|
|
5186
|
-
fontSize:
|
|
5186
|
+
fontSize: Le.oneOfType([Le.oneOf(["inherit", "large", "medium", "small"]), Le.string]),
|
|
5187
5187
|
/**
|
|
5188
5188
|
* Applies a color attribute to the SVG element.
|
|
5189
5189
|
*/
|
|
5190
|
-
htmlColor:
|
|
5190
|
+
htmlColor: Le.string,
|
|
5191
5191
|
/**
|
|
5192
5192
|
* If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`
|
|
5193
5193
|
* prop will be ignored.
|
|
@@ -5195,22 +5195,22 @@ process.env.NODE_ENV !== "production" && (ls.propTypes = {
|
|
|
5195
5195
|
* `component`'s viewBox to the root node.
|
|
5196
5196
|
* @default false
|
|
5197
5197
|
*/
|
|
5198
|
-
inheritViewBox:
|
|
5198
|
+
inheritViewBox: Le.bool,
|
|
5199
5199
|
/**
|
|
5200
5200
|
* The shape-rendering attribute. The behavior of the different options is described on the
|
|
5201
5201
|
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/shape-rendering).
|
|
5202
5202
|
* If you are having issues with blurry icons you should investigate this prop.
|
|
5203
5203
|
*/
|
|
5204
|
-
shapeRendering:
|
|
5204
|
+
shapeRendering: Le.string,
|
|
5205
5205
|
/**
|
|
5206
5206
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
5207
5207
|
*/
|
|
5208
|
-
sx:
|
|
5208
|
+
sx: Le.oneOfType([Le.arrayOf(Le.oneOfType([Le.func, Le.object, Le.bool])), Le.func, Le.object]),
|
|
5209
5209
|
/**
|
|
5210
5210
|
* Provides a human-readable title for the element that contains it.
|
|
5211
5211
|
* https://www.w3.org/TR/SVG-access/#Equivalent
|
|
5212
5212
|
*/
|
|
5213
|
-
titleAccess:
|
|
5213
|
+
titleAccess: Le.string,
|
|
5214
5214
|
/**
|
|
5215
5215
|
* Allows you to redefine what the coordinates without units mean inside an SVG element.
|
|
5216
5216
|
* For example, if the SVG element is 500 (width) by 200 (height),
|
|
@@ -5219,7 +5219,7 @@ process.env.NODE_ENV !== "production" && (ls.propTypes = {
|
|
|
5219
5219
|
* to bottom right (50,20) and each unit will be worth 10px.
|
|
5220
5220
|
* @default '0 0 24 24'
|
|
5221
5221
|
*/
|
|
5222
|
-
viewBox:
|
|
5222
|
+
viewBox: Le.string
|
|
5223
5223
|
});
|
|
5224
5224
|
ls.muiName = "SvgIcon";
|
|
5225
5225
|
function ht(e, n) {
|
|
@@ -17817,18 +17817,18 @@ function RD({
|
|
|
17817
17817
|
}
|
|
17818
17818
|
}, $e = () => {
|
|
17819
17819
|
k?.(t), v(null), H(null), F(!1);
|
|
17820
|
-
},
|
|
17821
|
-
if (!
|
|
17822
|
-
|
|
17820
|
+
}, ze = E.useRef(!1), Me = E.useRef(null), je = E.useCallback(() => {
|
|
17821
|
+
if (!ze.current) {
|
|
17822
|
+
ze.current = !0;
|
|
17823
17823
|
return;
|
|
17824
17824
|
}
|
|
17825
17825
|
Me.current && window.clearTimeout(Me.current), Me.current = window.setTimeout(() => {
|
|
17826
|
-
console.log("iframe recargó (estable) -> refetch"),
|
|
17826
|
+
console.log("iframe recargó (estable) -> refetch"), w?.(t);
|
|
17827
17827
|
}, 500);
|
|
17828
17828
|
}, []);
|
|
17829
17829
|
return E.useEffect(() => {
|
|
17830
|
-
|
|
17831
|
-
}, [j, U]),
|
|
17830
|
+
ze.current = !1, Me.current && window.clearTimeout(Me.current);
|
|
17831
|
+
}, [j, U]), /* @__PURE__ */ d.jsx(
|
|
17832
17832
|
Tc,
|
|
17833
17833
|
{
|
|
17834
17834
|
open: e,
|
package/dist/index.umd.js
CHANGED
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ac;function sp(){return ac||(ac=1,process.env.NODE_ENV!=="production"&&(function(){var e=y,n=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,h="@@iterator";function x(E){if(E===null||typeof E!="object")return null;var X=m&&E[m]||E[h];return typeof X=="function"?X:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(E){{for(var X=arguments.length,fe=new Array(X>1?X-1:0),Ee=1;Ee<X;Ee++)fe[Ee-1]=arguments[Ee];T("error",E,fe)}}function T(E,X,fe){{var Ee=S.ReactDebugCurrentFrame,$e=Ee.getStackAddendum();$e!==""&&(X+="%s",fe=fe.concat([$e]));var
|
|
18
|
-
`+pe+E}}var ke=!1,_e;{var Qe=typeof WeakMap=="function"?WeakMap:Map;_e=new Qe}function j(E,X){if(!E||ke)return"";{var fe=_e.get(E);if(fe!==void 0)return fe}var Ee;ke=!0;var $e=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var
|
|
17
|
+
*/var ac;function sp(){return ac||(ac=1,process.env.NODE_ENV!=="production"&&(function(){var e=y,n=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,h="@@iterator";function x(E){if(E===null||typeof E!="object")return null;var X=m&&E[m]||E[h];return typeof X=="function"?X:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(E){{for(var X=arguments.length,fe=new Array(X>1?X-1:0),Ee=1;Ee<X;Ee++)fe[Ee-1]=arguments[Ee];T("error",E,fe)}}function T(E,X,fe){{var Ee=S.ReactDebugCurrentFrame,$e=Ee.getStackAddendum();$e!==""&&(X+="%s",fe=fe.concat([$e]));var Be=fe.map(function(Oe){return String(Oe)});Be.unshift("Warning: "+X),Function.prototype.apply.call(console[E],console,Be)}}var C=!1,D=!1,M=!1,P=!1,K=!1,N;N=Symbol.for("react.module.reference");function z(E){return!!(typeof E=="string"||typeof E=="function"||E===r||E===s||K||E===o||E===l||E===u||P||E===g||C||D||M||typeof E=="object"&&E!==null&&(E.$$typeof===p||E.$$typeof===f||E.$$typeof===i||E.$$typeof===a||E.$$typeof===c||E.$$typeof===N||E.getModuleId!==void 0))}function H(E,X,fe){var Ee=E.displayName;if(Ee)return Ee;var $e=X.displayName||X.name||"";return $e!==""?fe+"("+$e+")":fe}function v(E){return E.displayName||"Context"}function R(E){if(E==null)return null;if(typeof E.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof E=="function")return E.displayName||E.name||null;if(typeof E=="string")return E;switch(E){case r:return"Fragment";case t:return"Portal";case s:return"Profiler";case o:return"StrictMode";case l:return"Suspense";case u:return"SuspenseList"}if(typeof E=="object")switch(E.$$typeof){case a:var X=E;return v(X)+".Consumer";case i:var fe=E;return v(fe._context)+".Provider";case c:return H(E,E.render,"ForwardRef");case f:var Ee=E.displayName||null;return Ee!==null?Ee:R(E.type)||"Memo";case p:{var $e=E,Be=$e._payload,Oe=$e._init;try{return R(Oe(Be))}catch{return null}}}return null}var A=Object.assign,$=0,Z,ne,oe,we,Y,Q,ve;function me(){}me.__reactDisabledLog=!0;function re(){{if($===0){Z=console.log,ne=console.info,oe=console.warn,we=console.error,Y=console.group,Q=console.groupCollapsed,ve=console.groupEnd;var E={configurable:!0,enumerable:!0,value:me,writable:!0};Object.defineProperties(console,{info:E,log:E,warn:E,error:E,group:E,groupCollapsed:E,groupEnd:E})}$++}}function ie(){{if($--,$===0){var E={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},E,{value:Z}),info:A({},E,{value:ne}),warn:A({},E,{value:oe}),error:A({},E,{value:we}),group:A({},E,{value:Y}),groupCollapsed:A({},E,{value:Q}),groupEnd:A({},E,{value:ve})})}$<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=S.ReactCurrentDispatcher,pe;function be(E,X,fe){{if(pe===void 0)try{throw Error()}catch($e){var Ee=$e.stack.trim().match(/\n( *(at )?)/);pe=Ee&&Ee[1]||""}return`
|
|
18
|
+
`+pe+E}}var ke=!1,_e;{var Qe=typeof WeakMap=="function"?WeakMap:Map;_e=new Qe}function j(E,X){if(!E||ke)return"";{var fe=_e.get(E);if(fe!==void 0)return fe}var Ee;ke=!0;var $e=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Be;Be=ae.current,ae.current=null,re();try{if(X){var Oe=function(){throw Error()};if(Object.defineProperty(Oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Oe,[])}catch(ot){Ee=ot}Reflect.construct(E,[],Oe)}else{try{Oe.call()}catch(ot){Ee=ot}E.call(Oe.prototype)}}else{try{throw Error()}catch(ot){Ee=ot}E()}}catch(ot){if(ot&&Ee&&typeof ot.stack=="string"){for(var Pe=ot.stack.split(`
|
|
19
19
|
`),V=Ee.stack.split(`
|
|
20
20
|
`),G=Pe.length-1,le=V.length-1;G>=1&&le>=0&&Pe[G]!==V[le];)le--;for(;G>=1&&le>=0;G--,le--)if(Pe[G]!==V[le]){if(G!==1||le!==1)do if(G--,le--,le<0||Pe[G]!==V[le]){var De=`
|
|
21
|
-
`+Pe[G].replace(" at new "," at ");return E.displayName&&De.includes("<anonymous>")&&(De=De.replace("<anonymous>",E.displayName)),typeof E=="function"&&_e.set(E,De),De}while(G>=1&&le>=0);break}}}finally{ke=!1,ae.current=
|
|
21
|
+
`+Pe[G].replace(" at new "," at ");return E.displayName&&De.includes("<anonymous>")&&(De=De.replace("<anonymous>",E.displayName)),typeof E=="function"&&_e.set(E,De),De}while(G>=1&&le>=0);break}}}finally{ke=!1,ae.current=Be,ie(),Error.prepareStackTrace=$e}var Je=E?E.displayName||E.name:"",Ge=Je?be(Je):"";return typeof E=="function"&&_e.set(E,Ge),Ge}function U(E,X,fe){return j(E,!1)}function he(E){var X=E.prototype;return!!(X&&X.isReactComponent)}function ge(E,X,fe){if(E==null)return"";if(typeof E=="function")return j(E,he(E));if(typeof E=="string")return be(E);switch(E){case l:return be("Suspense");case u:return be("SuspenseList")}if(typeof E=="object")switch(E.$$typeof){case c:return U(E.render);case f:return ge(E.type,X,fe);case p:{var Ee=E,$e=Ee._payload,Be=Ee._init;try{return ge(Be($e),X,fe)}catch{}}}return""}var Me=Object.prototype.hasOwnProperty,Ct={},bt=S.ReactDebugCurrentFrame;function gt(E){if(E){var X=E._owner,fe=ge(E.type,E._source,X?X.type:null);bt.setExtraStackFrame(fe)}else bt.setExtraStackFrame(null)}function k(E,X,fe,Ee,$e){{var Be=Function.call.bind(Me);for(var Oe in E)if(Be(E,Oe)){var Pe=void 0;try{if(typeof E[Oe]!="function"){var V=Error((Ee||"React class")+": "+fe+" type `"+Oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof E[Oe]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw V.name="Invariant Violation",V}Pe=E[Oe](X,Oe,Ee,fe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(G){Pe=G}Pe&&!(Pe instanceof Error)&&(gt($e),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ee||"React class",fe,Oe,typeof Pe),gt(null)),Pe instanceof Error&&!(Pe.message in Ct)&&(Ct[Pe.message]=!0,gt($e),_("Failed %s type: %s",fe,Pe.message),gt(null))}}}var I=Array.isArray;function L(E){return I(E)}function ce(E){{var X=typeof Symbol=="function"&&Symbol.toStringTag,fe=X&&E[Symbol.toStringTag]||E.constructor.name||"Object";return fe}}function te(E){try{return O(E),!1}catch{return!0}}function O(E){return""+E}function ee(E){if(te(E))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ce(E)),O(E)}var xe=S.ReactCurrentOwner,Ae={key:!0,ref:!0,__self:!0,__source:!0},B,J;function ye(E){if(Me.call(E,"ref")){var X=Object.getOwnPropertyDescriptor(E,"ref").get;if(X&&X.isReactWarning)return!1}return E.ref!==void 0}function Ze(E){if(Me.call(E,"key")){var X=Object.getOwnPropertyDescriptor(E,"key").get;if(X&&X.isReactWarning)return!1}return E.key!==void 0}function kt(E,X){typeof E.ref=="string"&&xe.current}function Dt(E,X){{var fe=function(){B||(B=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",X))};fe.isReactWarning=!0,Object.defineProperty(E,"key",{get:fe,configurable:!0})}}function zt(E,X){{var fe=function(){J||(J=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",X))};fe.isReactWarning=!0,Object.defineProperty(E,"ref",{get:fe,configurable:!0})}}var lr=function(E,X,fe,Ee,$e,Be,Oe){var Pe={$$typeof:n,type:E,key:X,ref:fe,props:Oe,_owner:Be};return Pe._store={},Object.defineProperty(Pe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Pe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ee}),Object.defineProperty(Pe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$e}),Object.freeze&&(Object.freeze(Pe.props),Object.freeze(Pe)),Pe};function Jt(E,X,fe,Ee,$e){{var Be,Oe={},Pe=null,V=null;fe!==void 0&&(ee(fe),Pe=""+fe),Ze(X)&&(ee(X.key),Pe=""+X.key),ye(X)&&(V=X.ref,kt(X,$e));for(Be in X)Me.call(X,Be)&&!Ae.hasOwnProperty(Be)&&(Oe[Be]=X[Be]);if(E&&E.defaultProps){var G=E.defaultProps;for(Be in G)Oe[Be]===void 0&&(Oe[Be]=G[Be])}if(Pe||V){var le=typeof E=="function"?E.displayName||E.name||"Unknown":E;Pe&&Dt(Oe,le),V&&zt(Oe,le)}return lr(E,Pe,V,$e,Ee,xe.current,Oe)}}var Ar=S.ReactCurrentOwner,Ir=S.ReactDebugCurrentFrame;function Mr(E){if(E){var X=E._owner,fe=ge(E.type,E._source,X?X.type:null);Ir.setExtraStackFrame(fe)}else Ir.setExtraStackFrame(null)}var xo;xo=!1;function wo(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function oi(){{if(Ar.current){var E=R(Ar.current.type);if(E)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+E+"`."}return""}}function Ja(E){return""}var an={};function si(E){{var X=oi();if(!X){var fe=typeof E=="string"?E:E.displayName||E.name;fe&&(X=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+fe+">.")}return X}}function ii(E,X){{if(!E._store||E._store.validated||E.key!=null)return;E._store.validated=!0;var fe=si(X);if(an[fe])return;an[fe]=!0;var Ee="";E&&E._owner&&E._owner!==Ar.current&&(Ee=" It was passed a child from "+R(E._owner.type)+"."),Mr(E),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',fe,Ee),Mr(null)}}function _o(E,X){{if(typeof E!="object")return;if(L(E))for(var fe=0;fe<E.length;fe++){var Ee=E[fe];wo(Ee)&&ii(Ee,X)}else if(wo(E))E._store&&(E._store.validated=!0);else if(E){var $e=x(E);if(typeof $e=="function"&&$e!==E.entries)for(var
|
|
25
|
+
Check the top-level render call using <`+fe+">.")}return X}}function ii(E,X){{if(!E._store||E._store.validated||E.key!=null)return;E._store.validated=!0;var fe=si(X);if(an[fe])return;an[fe]=!0;var Ee="";E&&E._owner&&E._owner!==Ar.current&&(Ee=" It was passed a child from "+R(E._owner.type)+"."),Mr(E),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',fe,Ee),Mr(null)}}function _o(E,X){{if(typeof E!="object")return;if(L(E))for(var fe=0;fe<E.length;fe++){var Ee=E[fe];wo(Ee)&&ii(Ee,X)}else if(wo(E))E._store&&(E._store.validated=!0);else if(E){var $e=x(E);if(typeof $e=="function"&&$e!==E.entries)for(var Be=$e.call(E),Oe;!(Oe=Be.next()).done;)wo(Oe.value)&&ii(Oe.value,X)}}}function ai(E){{var X=E.type;if(X==null||typeof X=="string")return;var fe;if(typeof X=="function")fe=X.propTypes;else if(typeof X=="object"&&(X.$$typeof===c||X.$$typeof===f))fe=X.propTypes;else return;if(fe){var Ee=R(X);k(fe,E.props,"prop",Ee,E)}else if(X.PropTypes!==void 0&&!xo){xo=!0;var $e=R(X);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",$e||"Unknown")}typeof X.getDefaultProps=="function"&&!X.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ci(E){{for(var X=Object.keys(E.props),fe=0;fe<X.length;fe++){var Ee=X[fe];if(Ee!=="children"&&Ee!=="key"){Mr(E),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ee),Mr(null);break}}E.ref!==null&&(Mr(E),_("Invalid attribute `ref` supplied to `React.Fragment`."),Mr(null))}}var So={};function li(E,X,fe,Ee,$e,Be){{var Oe=z(E);if(!Oe){var Pe="";(E===void 0||typeof E=="object"&&E!==null&&Object.keys(E).length===0)&&(Pe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var V=Ja();V?Pe+=V:Pe+=oi();var G;E===null?G="null":L(E)?G="array":E!==void 0&&E.$$typeof===n?(G="<"+(R(E.type)||"Unknown")+" />",Pe=" Did you accidentally export a JSX literal instead of a component?"):G=typeof E,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",G,Pe)}var le=Jt(E,X,fe,$e,Be);if(le==null)return le;if(Oe){var De=X.children;if(De!==void 0)if(Ee)if(L(De)){for(var Je=0;Je<De.length;Je++)_o(De[Je],E);Object.freeze&&Object.freeze(De)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _o(De,E)}if(Me.call(X,"key")){var Ge=R(E),ot=Object.keys(X).filter(function(rc){return rc!=="key"}),It=ot.length>0?"{key: someKey, "+ot.join(": ..., ")+": ...}":"{key: someKey}";if(!So[Ge+It]){var Or=ot.length>0?"{"+ot.join(": ..., ")+": ...}":"{}";_(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
@@ -66,7 +66,7 @@ Valid keys: `+JSON.stringify(Object.keys(Y),null," "));var j=Qe(pe,_e,re,ie,ae+
|
|
|
66
66
|
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`:Pr(18,`(${n})`));return null}const[,r,o]=t,s=Number.isNaN(+r)?r||0:+r;return e.containerQueries(o).up(s)}function _p(e){const n=(s,i)=>s.replace("@media",i?`@container ${i}`:"@container");function t(s,i){s.up=(...a)=>n(e.breakpoints.up(...a),i),s.down=(...a)=>n(e.breakpoints.down(...a),i),s.between=(...a)=>n(e.breakpoints.between(...a),i),s.only=(...a)=>n(e.breakpoints.only(...a),i),s.not=(...a)=>{const c=n(e.breakpoints.not(...a),i);return c.includes("not all and")?c.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):c}}const r={},o=s=>(t(r,s),r);return t(o),{...e,containerQueries:o}}const Io={xs:0,sm:600,md:900,lg:1200,xl:1536},Tc={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Io[e]}px)`},Sp={containerQueries:e=>({up:n=>{let t=typeof n=="number"?n:Io[n]||n;return typeof t=="number"&&(t=`${t}px`),e?`@container ${e} (min-width:${t})`:`@container (min-width:${t})`}})};function _r(e,n,t){const r=e.theme||{};if(Array.isArray(n)){const s=r.breakpoints||Tc;return n.reduce((i,a,c)=>(i[s.up(s.keys[c])]=t(n[c]),i),{})}if(typeof n=="object"){const s=r.breakpoints||Tc;return Object.keys(n).reduce((i,a)=>{if(xp(s.keys,a)){const c=wp(r.containerQueries?r:Sp,a);c&&(i[c]=t(n[a],a))}else if(Object.keys(s.values||Io).includes(a)){const c=s.up(a);i[c]=t(n[a],a)}else{const c=a;i[c]=n[c]}return i},{})}return t(n)}function Cp(e={}){return e.keys?.reduce((t,r)=>{const o=e.up(r);return t[o]={},t},{})||{}}function Ac(e,n){return e.reduce((t,r)=>{const o=t[r];return(!o||Object.keys(o).length===0)&&delete t[r],t},n)}function Mo(e,n,t=!0){if(!n||typeof n!="string")return null;if(e&&e.vars&&t){const r=`vars.${n}`.split(".").reduce((o,s)=>o&&o[s]?o[s]:null,e);if(r!=null)return r}return n.split(".").reduce((r,o)=>r&&r[o]!=null?r[o]:null,e)}function Oo(e,n,t,r=t){let o;return typeof e=="function"?o=e(t):Array.isArray(e)?o=e[t]||r:o=Mo(e,t)||r,n&&(o=n(o,r,e)),o}function dt(e){const{prop:n,cssProperty:t=e.prop,themeKey:r,transform:o}=e,s=i=>{if(i[n]==null)return null;const a=i[n],c=i.theme,l=Mo(c,r)||{};return _r(i,a,f=>{let p=Oo(l,o,f);return f===p&&typeof f=="string"&&(p=Oo(l,o,`${n}${f==="default"?"":Yr(f)}`,f)),t===!1?p:{[t]:p}})};return s.propTypes=process.env.NODE_ENV!=="production"?{[n]:jr}:{},s.filterProps=[n],s}function kp(e){const n={};return t=>(n[t]===void 0&&(n[t]=e(t)),n[t])}const Dp={m:"margin",p:"padding"},Ep={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Ic={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Tp=kp(e=>{if(e.length>2)if(Ic[e])e=Ic[e];else return[e];const[n,t]=e.split(""),r=Dp[n],o=Ep[t]||"";return Array.isArray(o)?o.map(s=>r+s):[r+o]}),Po=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],jo=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Ap=[...Po,...jo];function Ln(e,n,t,r){const o=Mo(e,n,!0)??t;return typeof o=="number"||typeof o=="string"?s=>typeof s=="string"?s:(process.env.NODE_ENV!=="production"&&typeof s!="number"&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${s}.`),typeof o=="string"?o.startsWith("var(")&&s===0?0:o.startsWith("var(")&&s===1?o:`calc(${s} * ${o})`:o*s):Array.isArray(o)?s=>{if(typeof s=="string")return s;const i=Math.abs(s);process.env.NODE_ENV!=="production"&&(Number.isInteger(i)?i>o.length-1&&console.error([`MUI: The value provided (${i}) overflows.`,`The supported values are: ${JSON.stringify(o)}.`,`${i} > ${o.length-1}, you need to add the missing values.`].join(`
|
|
67
67
|
`)):console.error([`MUI: The \`theme.${n}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${n}\` as a number.`].join(`
|
|
68
68
|
`)));const a=o[i];return s>=0?a:typeof a=="number"?-a:typeof a=="string"&&a.startsWith("var(")?`calc(-1 * ${a})`:`-${a}`}:typeof o=="function"?o:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${n}\` value (${o}) is invalid.`,"It should be a number, an array or a function."].join(`
|
|
69
|
-
`)),()=>{})}function yi(e){return Ln(e,"spacing",8,"spacing")}function zn(e,n){return typeof n=="string"||n==null?n:e(n)}function Ip(e,n){return t=>e.reduce((r,o)=>(r[o]=zn(n,t),r),{})}function Mp(e,n,t,r){if(!n.includes(t))return null;const o=Tp(t),s=Ip(o,r),i=e[t];return _r(e,i,s)}function Mc(e,n){const t=yi(e.theme);return Object.keys(e).map(r=>Mp(e,n,r,t)).reduce($n,{})}function it(e){return Mc(e,Po)}it.propTypes=process.env.NODE_ENV!=="production"?Po.reduce((e,n)=>(e[n]=jr,e),{}):{},it.filterProps=Po;function at(e){return Mc(e,jo)}at.propTypes=process.env.NODE_ENV!=="production"?jo.reduce((e,n)=>(e[n]=jr,e),{}):{},at.filterProps=jo,process.env.NODE_ENV!=="production"&&Ap.reduce((e,n)=>(e[n]=jr,e),{});function No(...e){const n=e.reduce((r,o)=>(o.filterProps.forEach(s=>{r[s]=o}),r),{}),t=r=>Object.keys(r).reduce((o,s)=>n[s]?$n(o,n[s](r)):o,{});return t.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,o)=>Object.assign(r,o.propTypes),{}):{},t.filterProps=e.reduce((r,o)=>r.concat(o.filterProps),[]),t}function Zt(e){return typeof e!="number"?e:`${e}px solid`}function Gt(e,n){return dt({prop:e,themeKey:"borders",transform:n})}const Op=Gt("border",Zt),Pp=Gt("borderTop",Zt),jp=Gt("borderRight",Zt),Np=Gt("borderBottom",Zt),Rp=Gt("borderLeft",Zt),$p=Gt("borderColor"),Lp=Gt("borderTopColor"),zp=Gt("borderRightColor"),Bp=Gt("borderBottomColor"),Fp=Gt("borderLeftColor"),Vp=Gt("outline",Zt),Yp=Gt("outlineColor"),Ro=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const n=Ln(e.theme,"shape.borderRadius",4,"borderRadius"),t=r=>({borderRadius:zn(n,r)});return _r(e,e.borderRadius,t)}return null};Ro.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:jr}:{},Ro.filterProps=["borderRadius"],No(Op,Pp,jp,Np,Rp,$p,Lp,zp,Bp,Fp,Ro,Vp,Yp);const $o=e=>{if(e.gap!==void 0&&e.gap!==null){const n=Ln(e.theme,"spacing",8,"gap"),t=r=>({gap:zn(n,r)});return _r(e,e.gap,t)}return null};$o.propTypes=process.env.NODE_ENV!=="production"?{gap:jr}:{},$o.filterProps=["gap"];const Lo=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const n=Ln(e.theme,"spacing",8,"columnGap"),t=r=>({columnGap:zn(n,r)});return _r(e,e.columnGap,t)}return null};Lo.propTypes=process.env.NODE_ENV!=="production"?{columnGap:jr}:{},Lo.filterProps=["columnGap"];const zo=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const n=Ln(e.theme,"spacing",8,"rowGap"),t=r=>({rowGap:zn(n,r)});return _r(e,e.rowGap,t)}return null};zo.propTypes=process.env.NODE_ENV!=="production"?{rowGap:jr}:{},zo.filterProps=["rowGap"];const Wp=dt({prop:"gridColumn"}),Up=dt({prop:"gridRow"}),Hp=dt({prop:"gridAutoFlow"}),Zp=dt({prop:"gridAutoColumns"}),Gp=dt({prop:"gridAutoRows"}),qp=dt({prop:"gridTemplateColumns"}),Kp=dt({prop:"gridTemplateRows"}),Qp=dt({prop:"gridTemplateAreas"}),Xp=dt({prop:"gridArea"});No($o,Lo,zo,Wp,Up,Hp,Zp,Gp,qp,Kp,Qp,Xp);function cn(e,n){return n==="grey"?n:e}const Jp=dt({prop:"color",themeKey:"palette",transform:cn}),eh=dt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:cn}),th=dt({prop:"backgroundColor",themeKey:"palette",transform:cn});No(Jp,eh,th);function Ft(e){return e<=1&&e!==0?`${e*100}%`:e}const rh=dt({prop:"width",transform:Ft}),bi=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const n=t=>{const r=e.theme?.breakpoints?.values?.[t]||Io[t];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Ft(t)}};return _r(e,e.maxWidth,n)}return null};bi.filterProps=["maxWidth"];const nh=dt({prop:"minWidth",transform:Ft}),oh=dt({prop:"height",transform:Ft}),sh=dt({prop:"maxHeight",transform:Ft}),ih=dt({prop:"minHeight",transform:Ft});dt({prop:"size",cssProperty:"width",transform:Ft}),dt({prop:"size",cssProperty:"height",transform:Ft});const ah=dt({prop:"boxSizing"});No(rh,bi,nh,oh,sh,ih,ah);const Bo={border:{themeKey:"borders",transform:Zt},borderTop:{themeKey:"borders",transform:Zt},borderRight:{themeKey:"borders",transform:Zt},borderBottom:{themeKey:"borders",transform:Zt},borderLeft:{themeKey:"borders",transform:Zt},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Zt},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ro},color:{themeKey:"palette",transform:cn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:cn},backgroundColor:{themeKey:"palette",transform:cn},p:{style:at},pt:{style:at},pr:{style:at},pb:{style:at},pl:{style:at},px:{style:at},py:{style:at},padding:{style:at},paddingTop:{style:at},paddingRight:{style:at},paddingBottom:{style:at},paddingLeft:{style:at},paddingX:{style:at},paddingY:{style:at},paddingInline:{style:at},paddingInlineStart:{style:at},paddingInlineEnd:{style:at},paddingBlock:{style:at},paddingBlockStart:{style:at},paddingBlockEnd:{style:at},m:{style:it},mt:{style:it},mr:{style:it},mb:{style:it},ml:{style:it},mx:{style:it},my:{style:it},margin:{style:it},marginTop:{style:it},marginRight:{style:it},marginBottom:{style:it},marginLeft:{style:it},marginX:{style:it},marginY:{style:it},marginInline:{style:it},marginInlineStart:{style:it},marginInlineEnd:{style:it},marginBlock:{style:it},marginBlockStart:{style:it},marginBlockEnd:{style:it},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:$o},rowGap:{style:zo},columnGap:{style:Lo},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Ft},maxWidth:{style:bi},minWidth:{transform:Ft},height:{transform:Ft},maxHeight:{transform:Ft},minHeight:{transform:Ft},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function ch(...e){const n=e.reduce((r,o)=>r.concat(Object.keys(o)),[]),t=new Set(n);return e.every(r=>t.size===Object.keys(r).length)}function lh(e,n){return typeof e=="function"?e(n):e}function uh(){function e(t,r,o,s){const i={[t]:r,theme:o},a=s[t];if(!a)return{[t]:r};const{cssProperty:c=t,themeKey:l,transform:u,style:f}=a;if(r==null)return null;if(l==="typography"&&r==="inherit")return{[t]:r};const p=Mo(o,l)||{};return f?f(i):_r(i,r,m=>{let h=Oo(p,u,m);return m===h&&typeof m=="string"&&(h=Oo(p,u,`${t}${m==="default"?"":Yr(m)}`,m)),c===!1?h:{[c]:h}})}function n(t){const{sx:r,theme:o={},nested:s}=t||{};if(!r)return null;const i=o.unstable_sxConfig??Bo;function a(c){let l=c;if(typeof c=="function")l=c(o);else if(typeof c!="object")return c;if(!l)return null;const u=Cp(o.breakpoints),f=Object.keys(u);let p=u;return Object.keys(l).forEach(g=>{const m=lh(l[g],o);if(m!=null)if(typeof m=="object")if(i[g])p=$n(p,e(g,m,o,i));else{const h=_r({theme:o},m,x=>({[g]:x}));ch(h,m)?p[g]=n({sx:m,theme:o,nested:!0}):p=$n(p,h)}else p=$n(p,e(g,m,o,i))}),!s&&o.modularCssLayers?{"@layer sx":Ec(o,Ac(f,p))}:Ec(o,Ac(f,p))}return Array.isArray(r)?r.map(a):a(r)}return n}const ln=uh();ln.filterProps=["sx"];function xi(){return xi=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},xi.apply(null,arguments)}function dh(e){if(e.sheet)return e.sheet;for(var n=0;n<document.styleSheets.length;n++)if(document.styleSheets[n].ownerNode===e)return document.styleSheets[n]}function fh(e){var n=document.createElement("style");return n.setAttribute("data-emotion",e.key),e.nonce!==void 0&&n.setAttribute("nonce",e.nonce),n.appendChild(document.createTextNode("")),n.setAttribute("data-s",""),n}var ph=(function(){function e(t){var r=this;this._insertTag=function(o){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(o,s),r.tags.push(o)},this.isSpeedy=t.speedy===void 0?!0:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var n=e.prototype;return n.hydrate=function(r){r.forEach(this._insertTag)},n.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(fh(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var s=dh(o);try{s.insertRule(r,s.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(r));this.ctr++},n.flush=function(){this.tags.forEach(function(r){var o;return(o=r.parentNode)==null?void 0:o.removeChild(r)}),this.tags=[],this.ctr=0},e})(),Et="-ms-",Fo="-moz-",ze="-webkit-",Oc="comm",wi="rule",_i="decl",hh="@import",Pc="@keyframes",mh="@layer",gh=Math.abs,Vo=String.fromCharCode,vh=Object.assign;function yh(e,n){return _t(e,0)^45?(((n<<2^_t(e,0))<<2^_t(e,1))<<2^_t(e,2))<<2^_t(e,3):0}function jc(e){return e.trim()}function bh(e,n){return(e=n.exec(e))?e[0]:e}function Be(e,n,t){return e.replace(n,t)}function Si(e,n){return e.indexOf(n)}function _t(e,n){return e.charCodeAt(n)|0}function Bn(e,n,t){return e.slice(n,t)}function ur(e){return e.length}function Ci(e){return e.length}function Yo(e,n){return n.push(e),e}function xh(e,n){return e.map(n).join("")}var Wo=1,un=1,Nc=0,jt=0,vt=0,dn="";function Uo(e,n,t,r,o,s,i){return{value:e,root:n,parent:t,type:r,props:o,children:s,line:Wo,column:un,length:i,return:""}}function Fn(e,n){return vh(Uo("",null,null,"",null,null,0),e,{length:-e.length},n)}function wh(){return vt}function _h(){return vt=jt>0?_t(dn,--jt):0,un--,vt===10&&(un=1,Wo--),vt}function Vt(){return vt=jt<Nc?_t(dn,jt++):0,un++,vt===10&&(un=1,Wo++),vt}function dr(){return _t(dn,jt)}function Ho(){return jt}function Vn(e,n){return Bn(dn,e,n)}function Yn(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Rc(e){return Wo=un=1,Nc=ur(dn=e),jt=0,[]}function $c(e){return dn="",e}function Zo(e){return jc(Vn(jt-1,ki(e===91?e+2:e===40?e+1:e)))}function Sh(e){for(;(vt=dr())&&vt<33;)Vt();return Yn(e)>2||Yn(vt)>3?"":" "}function Ch(e,n){for(;--n&&Vt()&&!(vt<48||vt>102||vt>57&&vt<65||vt>70&&vt<97););return Vn(e,Ho()+(n<6&&dr()==32&&Vt()==32))}function ki(e){for(;Vt();)switch(vt){case e:return jt;case 34:case 39:e!==34&&e!==39&&ki(vt);break;case 40:e===41&&ki(e);break;case 92:Vt();break}return jt}function kh(e,n){for(;Vt()&&e+vt!==57;)if(e+vt===84&&dr()===47)break;return"/*"+Vn(n,jt-1)+"*"+Vo(e===47?e:Vt())}function Dh(e){for(;!Yn(dr());)Vt();return Vn(e,jt)}function Eh(e){return $c(Go("",null,null,null,[""],e=Rc(e),0,[0],e))}function Go(e,n,t,r,o,s,i,a,c){for(var l=0,u=0,f=i,p=0,g=0,m=0,h=1,x=1,S=1,_=0,T="",C=o,D=s,M=r,P=T;x;)switch(m=_,_=Vt()){case 40:if(m!=108&&_t(P,f-1)==58){Si(P+=Be(Zo(_),"&","&\f"),"&\f")!=-1&&(S=-1);break}case 34:case 39:case 91:P+=Zo(_);break;case 9:case 10:case 13:case 32:P+=Sh(m);break;case 92:P+=Ch(Ho()-1,7);continue;case 47:switch(dr()){case 42:case 47:Yo(Th(kh(Vt(),Ho()),n,t),c);break;default:P+="/"}break;case 123*h:a[l++]=ur(P)*S;case 125*h:case 59:case 0:switch(_){case 0:case 125:x=0;case 59+u:S==-1&&(P=Be(P,/\f/g,"")),g>0&&ur(P)-f&&Yo(g>32?zc(P+";",r,t,f-1):zc(Be(P," ","")+";",r,t,f-2),c);break;case 59:P+=";";default:if(Yo(M=Lc(P,n,t,l,u,o,a,T,C=[],D=[],f),s),_===123)if(u===0)Go(P,n,M,M,C,s,f,a,D);else switch(p===99&&_t(P,3)===110?100:p){case 100:case 108:case 109:case 115:Go(e,M,M,r&&Yo(Lc(e,M,M,0,0,o,a,T,o,C=[],f),D),o,D,f,a,r?C:D);break;default:Go(P,M,M,M,[""],D,0,a,D)}}l=u=g=0,h=S=1,T=P="",f=i;break;case 58:f=1+ur(P),g=m;default:if(h<1){if(_==123)--h;else if(_==125&&h++==0&&_h()==125)continue}switch(P+=Vo(_),_*h){case 38:S=u>0?1:(P+="\f",-1);break;case 44:a[l++]=(ur(P)-1)*S,S=1;break;case 64:dr()===45&&(P+=Zo(Vt())),p=dr(),u=f=ur(T=P+=Dh(Ho())),_++;break;case 45:m===45&&ur(P)==2&&(h=0)}}return s}function Lc(e,n,t,r,o,s,i,a,c,l,u){for(var f=o-1,p=o===0?s:[""],g=Ci(p),m=0,h=0,x=0;m<r;++m)for(var S=0,_=Bn(e,f+1,f=gh(h=i[m])),T=e;S<g;++S)(T=jc(h>0?p[S]+" "+_:Be(_,/&\f/g,p[S])))&&(c[x++]=T);return Uo(e,n,t,o===0?wi:a,c,l,u)}function Th(e,n,t){return Uo(e,n,t,Oc,Vo(wh()),Bn(e,2,-2),0)}function zc(e,n,t,r){return Uo(e,n,t,_i,Bn(e,0,r),Bn(e,r+1,-1),r)}function fn(e,n){for(var t="",r=Ci(e),o=0;o<r;o++)t+=n(e[o],o,e,n)||"";return t}function Ah(e,n,t,r){switch(e.type){case mh:if(e.children.length)break;case hh:case _i:return e.return=e.return||e.value;case Oc:return"";case Pc:return e.return=e.value+"{"+fn(e.children,r)+"}";case wi:e.value=e.props.join(",")}return ur(t=fn(e.children,r))?e.return=e.value+"{"+t+"}":""}function Ih(e){var n=Ci(e);return function(t,r,o,s){for(var i="",a=0;a<n;a++)i+=e[a](t,r,o,s)||"";return i}}function Mh(e){return function(n){n.root||(n=n.return)&&e(n)}}function Bc(e){var n=Object.create(null);return function(t){return n[t]===void 0&&(n[t]=e(t)),n[t]}}var Oh=function(n,t,r){for(var o=0,s=0;o=s,s=dr(),o===38&&s===12&&(t[r]=1),!Yn(s);)Vt();return Vn(n,jt)},Ph=function(n,t){var r=-1,o=44;do switch(Yn(o)){case 0:o===38&&dr()===12&&(t[r]=1),n[r]+=Oh(jt-1,t,r);break;case 2:n[r]+=Zo(o);break;case 4:if(o===44){n[++r]=dr()===58?"&\f":"",t[r]=n[r].length;break}default:n[r]+=Vo(o)}while(o=Vt());return n},jh=function(n,t){return $c(Ph(Rc(n),t))},Fc=new WeakMap,Nh=function(n){if(!(n.type!=="rule"||!n.parent||n.length<1)){for(var t=n.value,r=n.parent,o=n.column===r.column&&n.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(n.props.length===1&&t.charCodeAt(0)!==58&&!Fc.get(r))&&!o){Fc.set(n,!0);for(var s=[],i=jh(t,s),a=r.props,c=0,l=0;c<i.length;c++)for(var u=0;u<a.length;u++,l++)n.props[l]=s[c]?i[c].replace(/&\f/g,a[u]):a[u]+" "+i[c]}}},Rh=function(n){if(n.type==="decl"){var t=n.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(n.return="",n.value="")}};function Vc(e,n){switch(yh(e,n)){case 5103:return ze+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ze+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ze+e+Fo+e+Et+e+e;case 6828:case 4268:return ze+e+Et+e+e;case 6165:return ze+e+Et+"flex-"+e+e;case 5187:return ze+e+Be(e,/(\w+).+(:[^]+)/,ze+"box-$1$2"+Et+"flex-$1$2")+e;case 5443:return ze+e+Et+"flex-item-"+Be(e,/flex-|-self/,"")+e;case 4675:return ze+e+Et+"flex-line-pack"+Be(e,/align-content|flex-|-self/,"")+e;case 5548:return ze+e+Et+Be(e,"shrink","negative")+e;case 5292:return ze+e+Et+Be(e,"basis","preferred-size")+e;case 6060:return ze+"box-"+Be(e,"-grow","")+ze+e+Et+Be(e,"grow","positive")+e;case 4554:return ze+Be(e,/([^-])(transform)/g,"$1"+ze+"$2")+e;case 6187:return Be(Be(Be(e,/(zoom-|grab)/,ze+"$1"),/(image-set)/,ze+"$1"),e,"")+e;case 5495:case 3959:return Be(e,/(image-set\([^]*)/,ze+"$1$`$1");case 4968:return Be(Be(e,/(.+:)(flex-)?(.*)/,ze+"box-pack:$3"+Et+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ze+e+e;case 4095:case 3583:case 4068:case 2532:return Be(e,/(.+)-inline(.+)/,ze+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ur(e)-1-n>6)switch(_t(e,n+1)){case 109:if(_t(e,n+4)!==45)break;case 102:return Be(e,/(.+:)(.+)-([^]+)/,"$1"+ze+"$2-$3$1"+Fo+(_t(e,n+3)==108?"$3":"$2-$3"))+e;case 115:return~Si(e,"stretch")?Vc(Be(e,"stretch","fill-available"),n)+e:e}break;case 4949:if(_t(e,n+1)!==115)break;case 6444:switch(_t(e,ur(e)-3-(~Si(e,"!important")&&10))){case 107:return Be(e,":",":"+ze)+e;case 101:return Be(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ze+(_t(e,14)===45?"inline-":"")+"box$3$1"+ze+"$2$3$1"+Et+"$2box$3")+e}break;case 5936:switch(_t(e,n+11)){case 114:return ze+e+Et+Be(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ze+e+Et+Be(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ze+e+Et+Be(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ze+e+Et+e+e}return e}var $h=function(n,t,r,o){if(n.length>-1&&!n.return)switch(n.type){case _i:n.return=Vc(n.value,n.length);break;case Pc:return fn([Fn(n,{value:Be(n.value,"@","@"+ze)})],o);case wi:if(n.length)return xh(n.props,function(s){switch(bh(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return fn([Fn(n,{props:[Be(s,/:(read-\w+)/,":"+Fo+"$1")]})],o);case"::placeholder":return fn([Fn(n,{props:[Be(s,/:(plac\w+)/,":"+ze+"input-$1")]}),Fn(n,{props:[Be(s,/:(plac\w+)/,":"+Fo+"$1")]}),Fn(n,{props:[Be(s,/:(plac\w+)/,Et+"input-$1")]})],o)}return""})}},Lh=[$h],zh=function(n){var t=n.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(h){var x=h.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(h),h.setAttribute("data-s",""))})}var o=n.stylisPlugins||Lh,s={},i,a=[];i=n.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(h){for(var x=h.getAttribute("data-emotion").split(" "),S=1;S<x.length;S++)s[x[S]]=!0;a.push(h)});var c,l=[Nh,Rh];{var u,f=[Ah,Mh(function(h){u.insert(h)})],p=Ih(l.concat(o,f)),g=function(x){return fn(Eh(x),p)};c=function(x,S,_,T){u=_,g(x?x+"{"+S.styles+"}":S.styles),T&&(m.inserted[S.name]=!0)}}var m={key:t,sheet:new ph({key:t,container:i,nonce:n.nonce,speedy:n.speedy,prepend:n.prepend,insertionPoint:n.insertionPoint}),nonce:n.nonce,inserted:s,registered:{},insert:c};return m.sheet.hydrate(a),m},Bh=!0;function Fh(e,n,t){var r="";return t.split(" ").forEach(function(o){e[o]!==void 0?n.push(e[o]+";"):o&&(r+=o+" ")}),r}var Yc=function(n,t,r){var o=n.key+"-"+t.name;(r===!1||Bh===!1)&&n.registered[o]===void 0&&(n.registered[o]=t.styles)},Vh=function(n,t,r){Yc(n,t,r);var o=n.key+"-"+t.name;if(n.inserted[t.name]===void 0){var s=t;do n.insert(t===s?"."+o:"",s,n.sheet,!0),s=s.next;while(s!==void 0)}};function Yh(e){for(var n=0,t,r=0,o=e.length;o>=4;++r,o-=4)t=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,n=(t&65535)*1540483477+((t>>>16)*59797<<16)^(n&65535)*1540483477+((n>>>16)*59797<<16);switch(o){case 3:n^=(e.charCodeAt(r+2)&255)<<16;case 2:n^=(e.charCodeAt(r+1)&255)<<8;case 1:n^=e.charCodeAt(r)&255,n=(n&65535)*1540483477+((n>>>16)*59797<<16)}return n^=n>>>13,n=(n&65535)*1540483477+((n>>>16)*59797<<16),((n^n>>>15)>>>0).toString(36)}var Wh={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Uh=/[A-Z]|^ms/g,Hh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Wc=function(n){return n.charCodeAt(1)===45},Uc=function(n){return n!=null&&typeof n!="boolean"},Di=Bc(function(e){return Wc(e)?e:e.replace(Uh,"-$&").toLowerCase()}),Hc=function(n,t){switch(n){case"animation":case"animationName":if(typeof t=="string")return t.replace(Hh,function(r,o,s){return fr={name:o,styles:s,next:fr},o})}return Wh[n]!==1&&!Wc(n)&&typeof t=="number"&&t!==0?t+"px":t};function Wn(e,n,t){if(t==null)return"";var r=t;if(r.__emotion_styles!==void 0)return r;switch(typeof t){case"boolean":return"";case"object":{var o=t;if(o.anim===1)return fr={name:o.name,styles:o.styles,next:fr},o.name;var s=t;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)fr={name:i.name,styles:i.styles,next:fr},i=i.next;var a=s.styles+";";return a}return Zh(e,n,t)}case"function":{if(e!==void 0){var c=fr,l=t(e);return fr=c,Wn(e,n,l)}break}}var u=t;if(n==null)return u;var f=n[u];return f!==void 0?f:u}function Zh(e,n,t){var r="";if(Array.isArray(t))for(var o=0;o<t.length;o++)r+=Wn(e,n,t[o])+";";else for(var s in t){var i=t[s];if(typeof i!="object"){var a=i;n!=null&&n[a]!==void 0?r+=s+"{"+n[a]+"}":Uc(a)&&(r+=Di(s)+":"+Hc(s,a)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&(n==null||n[i[0]]===void 0))for(var c=0;c<i.length;c++)Uc(i[c])&&(r+=Di(s)+":"+Hc(s,i[c])+";");else{var l=Wn(e,n,i);switch(s){case"animation":case"animationName":{r+=Di(s)+":"+l+";";break}default:r+=s+"{"+l+"}"}}}return r}var Zc=/label:\s*([^\s;{]+)\s*(;|$)/g,fr;function Gc(e,n,t){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";fr=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,o+=Wn(t,n,s);else{var i=s;o+=i[0]}for(var a=1;a<e.length;a++)if(o+=Wn(t,n,e[a]),r){var c=s;o+=c[a]}Zc.lastIndex=0;for(var l="",u;(u=Zc.exec(o))!==null;)l+="-"+u[1];var f=Yh(o)+l;return{name:f,styles:o,next:fr}}var Gh=function(n){return n()},qh=se.useInsertionEffect?se.useInsertionEffect:!1,Kh=qh||Gh,qc=se.createContext(typeof HTMLElement<"u"?zh({key:"css"}):null);qc.Provider;var Qh=function(n){return y.forwardRef(function(t,r){var o=y.useContext(qc);return n(t,o,r)})},Xh=se.createContext({}),Jh=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,em=Bc(function(e){return Jh.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),tm=em,rm=function(n){return n!=="theme"},Kc=function(n){return typeof n=="string"&&n.charCodeAt(0)>96?tm:rm},Qc=function(n,t,r){var o;if(t){var s=t.shouldForwardProp;o=n.__emotion_forwardProp&&s?function(i){return n.__emotion_forwardProp(i)&&s(i)}:s}return typeof o!="function"&&r&&(o=n.__emotion_forwardProp),o},nm=function(n){var t=n.cache,r=n.serialized,o=n.isStringTag;return Yc(t,r,o),Kh(function(){return Vh(t,r,o)}),null},om=function e(n,t){var r=n.__emotion_real===n,o=r&&n.__emotion_base||n,s,i;t!==void 0&&(s=t.label,i=t.target);var a=Qc(n,t,r),c=a||Kc(o),l=!c("as");return function(){var u=arguments,f=r&&n.__emotion_styles!==void 0?n.__emotion_styles.slice(0):[];if(s!==void 0&&f.push("label:"+s+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{var p=u[0];f.push(p[0]);for(var g=u.length,m=1;m<g;m++)f.push(u[m],p[m])}var h=Qh(function(x,S,_){var T=l&&x.as||o,C="",D=[],M=x;if(x.theme==null){M={};for(var P in x)M[P]=x[P];M.theme=se.useContext(Xh)}typeof x.className=="string"?C=Fh(S.registered,D,x.className):x.className!=null&&(C=x.className+" ");var K=Gc(f.concat(D),S.registered,M);C+=S.key+"-"+K.name,i!==void 0&&(C+=" "+i);var N=l&&a===void 0?Kc(T):c,z={};for(var H in x)l&&H==="as"||N(H)&&(z[H]=x[H]);return z.className=C,_&&(z.ref=_),se.createElement(se.Fragment,null,se.createElement(nm,{cache:S,serialized:K,isStringTag:typeof T=="string"}),se.createElement(T,z))});return h.displayName=s!==void 0?s:"Styled("+(typeof o=="string"?o:o.displayName||o.name||"Component")+")",h.defaultProps=n.defaultProps,h.__emotion_real=h,h.__emotion_base=o,h.__emotion_styles=f,h.__emotion_forwardProp=a,Object.defineProperty(h,"toString",{value:function(){return"."+i}}),h.withComponent=function(x,S){var _=e(x,xi({},t,S,{shouldForwardProp:Qc(h,S,!0)}));return _.apply(void 0,f)},h}},sm=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Ei=om.bind(null);sm.forEach(function(e){Ei[e]=Ei(e)});/**
|
|
69
|
+
`)),()=>{})}function yi(e){return Ln(e,"spacing",8,"spacing")}function zn(e,n){return typeof n=="string"||n==null?n:e(n)}function Ip(e,n){return t=>e.reduce((r,o)=>(r[o]=zn(n,t),r),{})}function Mp(e,n,t,r){if(!n.includes(t))return null;const o=Tp(t),s=Ip(o,r),i=e[t];return _r(e,i,s)}function Mc(e,n){const t=yi(e.theme);return Object.keys(e).map(r=>Mp(e,n,r,t)).reduce($n,{})}function it(e){return Mc(e,Po)}it.propTypes=process.env.NODE_ENV!=="production"?Po.reduce((e,n)=>(e[n]=jr,e),{}):{},it.filterProps=Po;function at(e){return Mc(e,jo)}at.propTypes=process.env.NODE_ENV!=="production"?jo.reduce((e,n)=>(e[n]=jr,e),{}):{},at.filterProps=jo,process.env.NODE_ENV!=="production"&&Ap.reduce((e,n)=>(e[n]=jr,e),{});function No(...e){const n=e.reduce((r,o)=>(o.filterProps.forEach(s=>{r[s]=o}),r),{}),t=r=>Object.keys(r).reduce((o,s)=>n[s]?$n(o,n[s](r)):o,{});return t.propTypes=process.env.NODE_ENV!=="production"?e.reduce((r,o)=>Object.assign(r,o.propTypes),{}):{},t.filterProps=e.reduce((r,o)=>r.concat(o.filterProps),[]),t}function Zt(e){return typeof e!="number"?e:`${e}px solid`}function Gt(e,n){return dt({prop:e,themeKey:"borders",transform:n})}const Op=Gt("border",Zt),Pp=Gt("borderTop",Zt),jp=Gt("borderRight",Zt),Np=Gt("borderBottom",Zt),Rp=Gt("borderLeft",Zt),$p=Gt("borderColor"),Lp=Gt("borderTopColor"),zp=Gt("borderRightColor"),Bp=Gt("borderBottomColor"),Fp=Gt("borderLeftColor"),Vp=Gt("outline",Zt),Yp=Gt("outlineColor"),Ro=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const n=Ln(e.theme,"shape.borderRadius",4,"borderRadius"),t=r=>({borderRadius:zn(n,r)});return _r(e,e.borderRadius,t)}return null};Ro.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:jr}:{},Ro.filterProps=["borderRadius"],No(Op,Pp,jp,Np,Rp,$p,Lp,zp,Bp,Fp,Ro,Vp,Yp);const $o=e=>{if(e.gap!==void 0&&e.gap!==null){const n=Ln(e.theme,"spacing",8,"gap"),t=r=>({gap:zn(n,r)});return _r(e,e.gap,t)}return null};$o.propTypes=process.env.NODE_ENV!=="production"?{gap:jr}:{},$o.filterProps=["gap"];const Lo=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const n=Ln(e.theme,"spacing",8,"columnGap"),t=r=>({columnGap:zn(n,r)});return _r(e,e.columnGap,t)}return null};Lo.propTypes=process.env.NODE_ENV!=="production"?{columnGap:jr}:{},Lo.filterProps=["columnGap"];const zo=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const n=Ln(e.theme,"spacing",8,"rowGap"),t=r=>({rowGap:zn(n,r)});return _r(e,e.rowGap,t)}return null};zo.propTypes=process.env.NODE_ENV!=="production"?{rowGap:jr}:{},zo.filterProps=["rowGap"];const Wp=dt({prop:"gridColumn"}),Up=dt({prop:"gridRow"}),Hp=dt({prop:"gridAutoFlow"}),Zp=dt({prop:"gridAutoColumns"}),Gp=dt({prop:"gridAutoRows"}),qp=dt({prop:"gridTemplateColumns"}),Kp=dt({prop:"gridTemplateRows"}),Qp=dt({prop:"gridTemplateAreas"}),Xp=dt({prop:"gridArea"});No($o,Lo,zo,Wp,Up,Hp,Zp,Gp,qp,Kp,Qp,Xp);function cn(e,n){return n==="grey"?n:e}const Jp=dt({prop:"color",themeKey:"palette",transform:cn}),eh=dt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:cn}),th=dt({prop:"backgroundColor",themeKey:"palette",transform:cn});No(Jp,eh,th);function Ft(e){return e<=1&&e!==0?`${e*100}%`:e}const rh=dt({prop:"width",transform:Ft}),bi=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const n=t=>{const r=e.theme?.breakpoints?.values?.[t]||Io[t];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Ft(t)}};return _r(e,e.maxWidth,n)}return null};bi.filterProps=["maxWidth"];const nh=dt({prop:"minWidth",transform:Ft}),oh=dt({prop:"height",transform:Ft}),sh=dt({prop:"maxHeight",transform:Ft}),ih=dt({prop:"minHeight",transform:Ft});dt({prop:"size",cssProperty:"width",transform:Ft}),dt({prop:"size",cssProperty:"height",transform:Ft});const ah=dt({prop:"boxSizing"});No(rh,bi,nh,oh,sh,ih,ah);const Bo={border:{themeKey:"borders",transform:Zt},borderTop:{themeKey:"borders",transform:Zt},borderRight:{themeKey:"borders",transform:Zt},borderBottom:{themeKey:"borders",transform:Zt},borderLeft:{themeKey:"borders",transform:Zt},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Zt},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ro},color:{themeKey:"palette",transform:cn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:cn},backgroundColor:{themeKey:"palette",transform:cn},p:{style:at},pt:{style:at},pr:{style:at},pb:{style:at},pl:{style:at},px:{style:at},py:{style:at},padding:{style:at},paddingTop:{style:at},paddingRight:{style:at},paddingBottom:{style:at},paddingLeft:{style:at},paddingX:{style:at},paddingY:{style:at},paddingInline:{style:at},paddingInlineStart:{style:at},paddingInlineEnd:{style:at},paddingBlock:{style:at},paddingBlockStart:{style:at},paddingBlockEnd:{style:at},m:{style:it},mt:{style:it},mr:{style:it},mb:{style:it},ml:{style:it},mx:{style:it},my:{style:it},margin:{style:it},marginTop:{style:it},marginRight:{style:it},marginBottom:{style:it},marginLeft:{style:it},marginX:{style:it},marginY:{style:it},marginInline:{style:it},marginInlineStart:{style:it},marginInlineEnd:{style:it},marginBlock:{style:it},marginBlockStart:{style:it},marginBlockEnd:{style:it},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:$o},rowGap:{style:zo},columnGap:{style:Lo},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Ft},maxWidth:{style:bi},minWidth:{transform:Ft},height:{transform:Ft},maxHeight:{transform:Ft},minHeight:{transform:Ft},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function ch(...e){const n=e.reduce((r,o)=>r.concat(Object.keys(o)),[]),t=new Set(n);return e.every(r=>t.size===Object.keys(r).length)}function lh(e,n){return typeof e=="function"?e(n):e}function uh(){function e(t,r,o,s){const i={[t]:r,theme:o},a=s[t];if(!a)return{[t]:r};const{cssProperty:c=t,themeKey:l,transform:u,style:f}=a;if(r==null)return null;if(l==="typography"&&r==="inherit")return{[t]:r};const p=Mo(o,l)||{};return f?f(i):_r(i,r,m=>{let h=Oo(p,u,m);return m===h&&typeof m=="string"&&(h=Oo(p,u,`${t}${m==="default"?"":Yr(m)}`,m)),c===!1?h:{[c]:h}})}function n(t){const{sx:r,theme:o={},nested:s}=t||{};if(!r)return null;const i=o.unstable_sxConfig??Bo;function a(c){let l=c;if(typeof c=="function")l=c(o);else if(typeof c!="object")return c;if(!l)return null;const u=Cp(o.breakpoints),f=Object.keys(u);let p=u;return Object.keys(l).forEach(g=>{const m=lh(l[g],o);if(m!=null)if(typeof m=="object")if(i[g])p=$n(p,e(g,m,o,i));else{const h=_r({theme:o},m,x=>({[g]:x}));ch(h,m)?p[g]=n({sx:m,theme:o,nested:!0}):p=$n(p,h)}else p=$n(p,e(g,m,o,i))}),!s&&o.modularCssLayers?{"@layer sx":Ec(o,Ac(f,p))}:Ec(o,Ac(f,p))}return Array.isArray(r)?r.map(a):a(r)}return n}const ln=uh();ln.filterProps=["sx"];function xi(){return xi=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},xi.apply(null,arguments)}function dh(e){if(e.sheet)return e.sheet;for(var n=0;n<document.styleSheets.length;n++)if(document.styleSheets[n].ownerNode===e)return document.styleSheets[n]}function fh(e){var n=document.createElement("style");return n.setAttribute("data-emotion",e.key),e.nonce!==void 0&&n.setAttribute("nonce",e.nonce),n.appendChild(document.createTextNode("")),n.setAttribute("data-s",""),n}var ph=(function(){function e(t){var r=this;this._insertTag=function(o){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(o,s),r.tags.push(o)},this.isSpeedy=t.speedy===void 0?!0:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var n=e.prototype;return n.hydrate=function(r){r.forEach(this._insertTag)},n.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(fh(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var s=dh(o);try{s.insertRule(r,s.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(r));this.ctr++},n.flush=function(){this.tags.forEach(function(r){var o;return(o=r.parentNode)==null?void 0:o.removeChild(r)}),this.tags=[],this.ctr=0},e})(),Et="-ms-",Fo="-moz-",Le="-webkit-",Oc="comm",wi="rule",_i="decl",hh="@import",Pc="@keyframes",mh="@layer",gh=Math.abs,Vo=String.fromCharCode,vh=Object.assign;function yh(e,n){return _t(e,0)^45?(((n<<2^_t(e,0))<<2^_t(e,1))<<2^_t(e,2))<<2^_t(e,3):0}function jc(e){return e.trim()}function bh(e,n){return(e=n.exec(e))?e[0]:e}function ze(e,n,t){return e.replace(n,t)}function Si(e,n){return e.indexOf(n)}function _t(e,n){return e.charCodeAt(n)|0}function Bn(e,n,t){return e.slice(n,t)}function ur(e){return e.length}function Ci(e){return e.length}function Yo(e,n){return n.push(e),e}function xh(e,n){return e.map(n).join("")}var Wo=1,un=1,Nc=0,jt=0,vt=0,dn="";function Uo(e,n,t,r,o,s,i){return{value:e,root:n,parent:t,type:r,props:o,children:s,line:Wo,column:un,length:i,return:""}}function Fn(e,n){return vh(Uo("",null,null,"",null,null,0),e,{length:-e.length},n)}function wh(){return vt}function _h(){return vt=jt>0?_t(dn,--jt):0,un--,vt===10&&(un=1,Wo--),vt}function Vt(){return vt=jt<Nc?_t(dn,jt++):0,un++,vt===10&&(un=1,Wo++),vt}function dr(){return _t(dn,jt)}function Ho(){return jt}function Vn(e,n){return Bn(dn,e,n)}function Yn(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Rc(e){return Wo=un=1,Nc=ur(dn=e),jt=0,[]}function $c(e){return dn="",e}function Zo(e){return jc(Vn(jt-1,ki(e===91?e+2:e===40?e+1:e)))}function Sh(e){for(;(vt=dr())&&vt<33;)Vt();return Yn(e)>2||Yn(vt)>3?"":" "}function Ch(e,n){for(;--n&&Vt()&&!(vt<48||vt>102||vt>57&&vt<65||vt>70&&vt<97););return Vn(e,Ho()+(n<6&&dr()==32&&Vt()==32))}function ki(e){for(;Vt();)switch(vt){case e:return jt;case 34:case 39:e!==34&&e!==39&&ki(vt);break;case 40:e===41&&ki(e);break;case 92:Vt();break}return jt}function kh(e,n){for(;Vt()&&e+vt!==57;)if(e+vt===84&&dr()===47)break;return"/*"+Vn(n,jt-1)+"*"+Vo(e===47?e:Vt())}function Dh(e){for(;!Yn(dr());)Vt();return Vn(e,jt)}function Eh(e){return $c(Go("",null,null,null,[""],e=Rc(e),0,[0],e))}function Go(e,n,t,r,o,s,i,a,c){for(var l=0,u=0,f=i,p=0,g=0,m=0,h=1,x=1,S=1,_=0,T="",C=o,D=s,M=r,P=T;x;)switch(m=_,_=Vt()){case 40:if(m!=108&&_t(P,f-1)==58){Si(P+=ze(Zo(_),"&","&\f"),"&\f")!=-1&&(S=-1);break}case 34:case 39:case 91:P+=Zo(_);break;case 9:case 10:case 13:case 32:P+=Sh(m);break;case 92:P+=Ch(Ho()-1,7);continue;case 47:switch(dr()){case 42:case 47:Yo(Th(kh(Vt(),Ho()),n,t),c);break;default:P+="/"}break;case 123*h:a[l++]=ur(P)*S;case 125*h:case 59:case 0:switch(_){case 0:case 125:x=0;case 59+u:S==-1&&(P=ze(P,/\f/g,"")),g>0&&ur(P)-f&&Yo(g>32?zc(P+";",r,t,f-1):zc(ze(P," ","")+";",r,t,f-2),c);break;case 59:P+=";";default:if(Yo(M=Lc(P,n,t,l,u,o,a,T,C=[],D=[],f),s),_===123)if(u===0)Go(P,n,M,M,C,s,f,a,D);else switch(p===99&&_t(P,3)===110?100:p){case 100:case 108:case 109:case 115:Go(e,M,M,r&&Yo(Lc(e,M,M,0,0,o,a,T,o,C=[],f),D),o,D,f,a,r?C:D);break;default:Go(P,M,M,M,[""],D,0,a,D)}}l=u=g=0,h=S=1,T=P="",f=i;break;case 58:f=1+ur(P),g=m;default:if(h<1){if(_==123)--h;else if(_==125&&h++==0&&_h()==125)continue}switch(P+=Vo(_),_*h){case 38:S=u>0?1:(P+="\f",-1);break;case 44:a[l++]=(ur(P)-1)*S,S=1;break;case 64:dr()===45&&(P+=Zo(Vt())),p=dr(),u=f=ur(T=P+=Dh(Ho())),_++;break;case 45:m===45&&ur(P)==2&&(h=0)}}return s}function Lc(e,n,t,r,o,s,i,a,c,l,u){for(var f=o-1,p=o===0?s:[""],g=Ci(p),m=0,h=0,x=0;m<r;++m)for(var S=0,_=Bn(e,f+1,f=gh(h=i[m])),T=e;S<g;++S)(T=jc(h>0?p[S]+" "+_:ze(_,/&\f/g,p[S])))&&(c[x++]=T);return Uo(e,n,t,o===0?wi:a,c,l,u)}function Th(e,n,t){return Uo(e,n,t,Oc,Vo(wh()),Bn(e,2,-2),0)}function zc(e,n,t,r){return Uo(e,n,t,_i,Bn(e,0,r),Bn(e,r+1,-1),r)}function fn(e,n){for(var t="",r=Ci(e),o=0;o<r;o++)t+=n(e[o],o,e,n)||"";return t}function Ah(e,n,t,r){switch(e.type){case mh:if(e.children.length)break;case hh:case _i:return e.return=e.return||e.value;case Oc:return"";case Pc:return e.return=e.value+"{"+fn(e.children,r)+"}";case wi:e.value=e.props.join(",")}return ur(t=fn(e.children,r))?e.return=e.value+"{"+t+"}":""}function Ih(e){var n=Ci(e);return function(t,r,o,s){for(var i="",a=0;a<n;a++)i+=e[a](t,r,o,s)||"";return i}}function Mh(e){return function(n){n.root||(n=n.return)&&e(n)}}function Bc(e){var n=Object.create(null);return function(t){return n[t]===void 0&&(n[t]=e(t)),n[t]}}var Oh=function(n,t,r){for(var o=0,s=0;o=s,s=dr(),o===38&&s===12&&(t[r]=1),!Yn(s);)Vt();return Vn(n,jt)},Ph=function(n,t){var r=-1,o=44;do switch(Yn(o)){case 0:o===38&&dr()===12&&(t[r]=1),n[r]+=Oh(jt-1,t,r);break;case 2:n[r]+=Zo(o);break;case 4:if(o===44){n[++r]=dr()===58?"&\f":"",t[r]=n[r].length;break}default:n[r]+=Vo(o)}while(o=Vt());return n},jh=function(n,t){return $c(Ph(Rc(n),t))},Fc=new WeakMap,Nh=function(n){if(!(n.type!=="rule"||!n.parent||n.length<1)){for(var t=n.value,r=n.parent,o=n.column===r.column&&n.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(n.props.length===1&&t.charCodeAt(0)!==58&&!Fc.get(r))&&!o){Fc.set(n,!0);for(var s=[],i=jh(t,s),a=r.props,c=0,l=0;c<i.length;c++)for(var u=0;u<a.length;u++,l++)n.props[l]=s[c]?i[c].replace(/&\f/g,a[u]):a[u]+" "+i[c]}}},Rh=function(n){if(n.type==="decl"){var t=n.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(n.return="",n.value="")}};function Vc(e,n){switch(yh(e,n)){case 5103:return Le+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Le+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Le+e+Fo+e+Et+e+e;case 6828:case 4268:return Le+e+Et+e+e;case 6165:return Le+e+Et+"flex-"+e+e;case 5187:return Le+e+ze(e,/(\w+).+(:[^]+)/,Le+"box-$1$2"+Et+"flex-$1$2")+e;case 5443:return Le+e+Et+"flex-item-"+ze(e,/flex-|-self/,"")+e;case 4675:return Le+e+Et+"flex-line-pack"+ze(e,/align-content|flex-|-self/,"")+e;case 5548:return Le+e+Et+ze(e,"shrink","negative")+e;case 5292:return Le+e+Et+ze(e,"basis","preferred-size")+e;case 6060:return Le+"box-"+ze(e,"-grow","")+Le+e+Et+ze(e,"grow","positive")+e;case 4554:return Le+ze(e,/([^-])(transform)/g,"$1"+Le+"$2")+e;case 6187:return ze(ze(ze(e,/(zoom-|grab)/,Le+"$1"),/(image-set)/,Le+"$1"),e,"")+e;case 5495:case 3959:return ze(e,/(image-set\([^]*)/,Le+"$1$`$1");case 4968:return ze(ze(e,/(.+:)(flex-)?(.*)/,Le+"box-pack:$3"+Et+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Le+e+e;case 4095:case 3583:case 4068:case 2532:return ze(e,/(.+)-inline(.+)/,Le+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ur(e)-1-n>6)switch(_t(e,n+1)){case 109:if(_t(e,n+4)!==45)break;case 102:return ze(e,/(.+:)(.+)-([^]+)/,"$1"+Le+"$2-$3$1"+Fo+(_t(e,n+3)==108?"$3":"$2-$3"))+e;case 115:return~Si(e,"stretch")?Vc(ze(e,"stretch","fill-available"),n)+e:e}break;case 4949:if(_t(e,n+1)!==115)break;case 6444:switch(_t(e,ur(e)-3-(~Si(e,"!important")&&10))){case 107:return ze(e,":",":"+Le)+e;case 101:return ze(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Le+(_t(e,14)===45?"inline-":"")+"box$3$1"+Le+"$2$3$1"+Et+"$2box$3")+e}break;case 5936:switch(_t(e,n+11)){case 114:return Le+e+Et+ze(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Le+e+Et+ze(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Le+e+Et+ze(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Le+e+Et+e+e}return e}var $h=function(n,t,r,o){if(n.length>-1&&!n.return)switch(n.type){case _i:n.return=Vc(n.value,n.length);break;case Pc:return fn([Fn(n,{value:ze(n.value,"@","@"+Le)})],o);case wi:if(n.length)return xh(n.props,function(s){switch(bh(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return fn([Fn(n,{props:[ze(s,/:(read-\w+)/,":"+Fo+"$1")]})],o);case"::placeholder":return fn([Fn(n,{props:[ze(s,/:(plac\w+)/,":"+Le+"input-$1")]}),Fn(n,{props:[ze(s,/:(plac\w+)/,":"+Fo+"$1")]}),Fn(n,{props:[ze(s,/:(plac\w+)/,Et+"input-$1")]})],o)}return""})}},Lh=[$h],zh=function(n){var t=n.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(h){var x=h.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(h),h.setAttribute("data-s",""))})}var o=n.stylisPlugins||Lh,s={},i,a=[];i=n.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(h){for(var x=h.getAttribute("data-emotion").split(" "),S=1;S<x.length;S++)s[x[S]]=!0;a.push(h)});var c,l=[Nh,Rh];{var u,f=[Ah,Mh(function(h){u.insert(h)})],p=Ih(l.concat(o,f)),g=function(x){return fn(Eh(x),p)};c=function(x,S,_,T){u=_,g(x?x+"{"+S.styles+"}":S.styles),T&&(m.inserted[S.name]=!0)}}var m={key:t,sheet:new ph({key:t,container:i,nonce:n.nonce,speedy:n.speedy,prepend:n.prepend,insertionPoint:n.insertionPoint}),nonce:n.nonce,inserted:s,registered:{},insert:c};return m.sheet.hydrate(a),m},Bh=!0;function Fh(e,n,t){var r="";return t.split(" ").forEach(function(o){e[o]!==void 0?n.push(e[o]+";"):o&&(r+=o+" ")}),r}var Yc=function(n,t,r){var o=n.key+"-"+t.name;(r===!1||Bh===!1)&&n.registered[o]===void 0&&(n.registered[o]=t.styles)},Vh=function(n,t,r){Yc(n,t,r);var o=n.key+"-"+t.name;if(n.inserted[t.name]===void 0){var s=t;do n.insert(t===s?"."+o:"",s,n.sheet,!0),s=s.next;while(s!==void 0)}};function Yh(e){for(var n=0,t,r=0,o=e.length;o>=4;++r,o-=4)t=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,n=(t&65535)*1540483477+((t>>>16)*59797<<16)^(n&65535)*1540483477+((n>>>16)*59797<<16);switch(o){case 3:n^=(e.charCodeAt(r+2)&255)<<16;case 2:n^=(e.charCodeAt(r+1)&255)<<8;case 1:n^=e.charCodeAt(r)&255,n=(n&65535)*1540483477+((n>>>16)*59797<<16)}return n^=n>>>13,n=(n&65535)*1540483477+((n>>>16)*59797<<16),((n^n>>>15)>>>0).toString(36)}var Wh={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Uh=/[A-Z]|^ms/g,Hh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Wc=function(n){return n.charCodeAt(1)===45},Uc=function(n){return n!=null&&typeof n!="boolean"},Di=Bc(function(e){return Wc(e)?e:e.replace(Uh,"-$&").toLowerCase()}),Hc=function(n,t){switch(n){case"animation":case"animationName":if(typeof t=="string")return t.replace(Hh,function(r,o,s){return fr={name:o,styles:s,next:fr},o})}return Wh[n]!==1&&!Wc(n)&&typeof t=="number"&&t!==0?t+"px":t};function Wn(e,n,t){if(t==null)return"";var r=t;if(r.__emotion_styles!==void 0)return r;switch(typeof t){case"boolean":return"";case"object":{var o=t;if(o.anim===1)return fr={name:o.name,styles:o.styles,next:fr},o.name;var s=t;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)fr={name:i.name,styles:i.styles,next:fr},i=i.next;var a=s.styles+";";return a}return Zh(e,n,t)}case"function":{if(e!==void 0){var c=fr,l=t(e);return fr=c,Wn(e,n,l)}break}}var u=t;if(n==null)return u;var f=n[u];return f!==void 0?f:u}function Zh(e,n,t){var r="";if(Array.isArray(t))for(var o=0;o<t.length;o++)r+=Wn(e,n,t[o])+";";else for(var s in t){var i=t[s];if(typeof i!="object"){var a=i;n!=null&&n[a]!==void 0?r+=s+"{"+n[a]+"}":Uc(a)&&(r+=Di(s)+":"+Hc(s,a)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&(n==null||n[i[0]]===void 0))for(var c=0;c<i.length;c++)Uc(i[c])&&(r+=Di(s)+":"+Hc(s,i[c])+";");else{var l=Wn(e,n,i);switch(s){case"animation":case"animationName":{r+=Di(s)+":"+l+";";break}default:r+=s+"{"+l+"}"}}}return r}var Zc=/label:\s*([^\s;{]+)\s*(;|$)/g,fr;function Gc(e,n,t){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";fr=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,o+=Wn(t,n,s);else{var i=s;o+=i[0]}for(var a=1;a<e.length;a++)if(o+=Wn(t,n,e[a]),r){var c=s;o+=c[a]}Zc.lastIndex=0;for(var l="",u;(u=Zc.exec(o))!==null;)l+="-"+u[1];var f=Yh(o)+l;return{name:f,styles:o,next:fr}}var Gh=function(n){return n()},qh=se.useInsertionEffect?se.useInsertionEffect:!1,Kh=qh||Gh,qc=se.createContext(typeof HTMLElement<"u"?zh({key:"css"}):null);qc.Provider;var Qh=function(n){return y.forwardRef(function(t,r){var o=y.useContext(qc);return n(t,o,r)})},Xh=se.createContext({}),Jh=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,em=Bc(function(e){return Jh.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),tm=em,rm=function(n){return n!=="theme"},Kc=function(n){return typeof n=="string"&&n.charCodeAt(0)>96?tm:rm},Qc=function(n,t,r){var o;if(t){var s=t.shouldForwardProp;o=n.__emotion_forwardProp&&s?function(i){return n.__emotion_forwardProp(i)&&s(i)}:s}return typeof o!="function"&&r&&(o=n.__emotion_forwardProp),o},nm=function(n){var t=n.cache,r=n.serialized,o=n.isStringTag;return Yc(t,r,o),Kh(function(){return Vh(t,r,o)}),null},om=function e(n,t){var r=n.__emotion_real===n,o=r&&n.__emotion_base||n,s,i;t!==void 0&&(s=t.label,i=t.target);var a=Qc(n,t,r),c=a||Kc(o),l=!c("as");return function(){var u=arguments,f=r&&n.__emotion_styles!==void 0?n.__emotion_styles.slice(0):[];if(s!==void 0&&f.push("label:"+s+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{var p=u[0];f.push(p[0]);for(var g=u.length,m=1;m<g;m++)f.push(u[m],p[m])}var h=Qh(function(x,S,_){var T=l&&x.as||o,C="",D=[],M=x;if(x.theme==null){M={};for(var P in x)M[P]=x[P];M.theme=se.useContext(Xh)}typeof x.className=="string"?C=Fh(S.registered,D,x.className):x.className!=null&&(C=x.className+" ");var K=Gc(f.concat(D),S.registered,M);C+=S.key+"-"+K.name,i!==void 0&&(C+=" "+i);var N=l&&a===void 0?Kc(T):c,z={};for(var H in x)l&&H==="as"||N(H)&&(z[H]=x[H]);return z.className=C,_&&(z.ref=_),se.createElement(se.Fragment,null,se.createElement(nm,{cache:S,serialized:K,isStringTag:typeof T=="string"}),se.createElement(T,z))});return h.displayName=s!==void 0?s:"Styled("+(typeof o=="string"?o:o.displayName||o.name||"Component")+")",h.defaultProps=n.defaultProps,h.__emotion_real=h,h.__emotion_base=o,h.__emotion_styles=f,h.__emotion_forwardProp=a,Object.defineProperty(h,"toString",{value:function(){return"."+i}}),h.withComponent=function(x,S){var _=e(x,xi({},t,S,{shouldForwardProp:Qc(h,S,!0)}));return _.apply(void 0,f)},h}},sm=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Ei=om.bind(null);sm.forEach(function(e){Ei[e]=Ei(e)});/**
|
|
70
70
|
* @mui/styled-engine v7.3.2
|
|
71
71
|
*
|
|
72
72
|
* @license MIT
|
|
@@ -179,4 +179,4 @@ To suppress this warning, you need to explicitly provide the \`palette.${n}Chann
|
|
|
179
179
|
`)}g.write("payload.value = newResult;"),g.write("return payload;");const _=g.compile();return(T,C)=>_(p,T,C)};let s;const i=Ws,a=!qd.jitless,l=a&&z1.value,u=n.catchall;let f;e._zod.parse=(p,g)=>{f??(f=r.value);const m=p.value;return i(m)?a&&l&&g?.async===!1&&g.jitless!==!0?(s||(s=o(n.shape)),p=s(p,g),u?hf([],m,p,g,f,e):p):t(p,g):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),p)}});function mf(e,n,t,r){for(const s of e)if(s.issues.length===0)return n.value=s.value,n;const o=e.filter(s=>!On(s));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:t,errors:e.map(s=>s.issues.map(i=>on(i,r,nn())))}),n)}const A2=q("$ZodUnion",(e,n)=>{lt.init(e,n),Xe(e._zod,"optin",()=>n.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Xe(e._zod,"optout",()=>n.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Xe(e._zod,"values",()=>{if(n.options.every(o=>o._zod.values))return new Set(n.options.flatMap(o=>Array.from(o._zod.values)))}),Xe(e._zod,"pattern",()=>{if(n.options.every(o=>o._zod.pattern)){const o=n.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Ra(s.source)).join("|")})$`)}});const t=n.options.length===1,r=n.options[0]._zod.run;e._zod.parse=(o,s)=>{if(t)return r(o,s);let i=!1;const a=[];for(const c of n.options){const l=c._zod.run({value:o.value,issues:[]},s);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(c=>mf(c,o,e,s)):mf(a,o,e,s)}}),I2=q("$ZodIntersection",(e,n)=>{lt.init(e,n),e._zod.parse=(t,r)=>{const o=t.value,s=n.left._zod.run({value:o,issues:[]},r),i=n.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,l])=>gf(t,c,l)):gf(t,s,i)}});function Ba(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(go(e)&&go(n)){const t=Object.keys(n),r=Object.keys(e).filter(s=>t.indexOf(s)!==-1),o={...e,...n};for(const s of r){const i=Ba(e[s],n[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let r=0;r<e.length;r++){const o=e[r],s=n[r],i=Ba(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};t.push(i.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function gf(e,n,t){if(n.issues.length&&e.issues.push(...n.issues),t.issues.length&&e.issues.push(...t.issues),On(e))return e;const r=Ba(n.value,t.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const M2=q("$ZodEnum",(e,n)=>{lt.init(e,n);const t=R1(n.entries),r=new Set(t);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.filter(o=>B1.has(typeof o)).map(o=>typeof o=="string"?Mn(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t,input:i,inst:e}),o}}),O2=q("$ZodLiteral",(e,n)=>{if(lt.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(n.values),e._zod.pattern=new RegExp(`^(${n.values.map(t=>typeof t=="string"?Mn(t):t?Mn(t.toString()):String(t)).join("|")})$`),e._zod.parse=(t,r)=>{const o=t.value;return e._zod.values.has(o)||t.issues.push({code:"invalid_value",values:n.values,input:o,inst:e}),t}}),P2=q("$ZodTransform",(e,n)=>{lt.init(e,n),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Gd(e.constructor.name);const o=n.transform(t.value,t);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(t.value=i,t));if(o instanceof Promise)throw new An;return t.value=o,t}});function vf(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const j2=q("$ZodOptional",(e,n)=>{lt.init(e,n),e._zod.optin="optional",e._zod.optout="optional",Xe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),Xe(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${Ra(t.source)})?$`):void 0}),e._zod.parse=(t,r)=>{if(n.innerType._zod.optin==="optional"){const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>vf(s,t.value)):vf(o,t.value)}return t.value===void 0?t:n.innerType._zod.run(t,r)}}),N2=q("$ZodNullable",(e,n)=>{lt.init(e,n),Xe(e._zod,"optin",()=>n.innerType._zod.optin),Xe(e._zod,"optout",()=>n.innerType._zod.optout),Xe(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${Ra(t.source)}|null)$`):void 0}),Xe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(t,r)=>t.value===null?t:n.innerType._zod.run(t,r)}),R2=q("$ZodDefault",(e,n)=>{lt.init(e,n),e._zod.optin="optional",Xe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);if(t.value===void 0)return t.value=n.defaultValue,t;const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>yf(s,n)):yf(o,n)}});function yf(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const $2=q("$ZodPrefault",(e,n)=>{lt.init(e,n),e._zod.optin="optional",Xe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>(r.direction==="backward"||t.value===void 0&&(t.value=n.defaultValue),n.innerType._zod.run(t,r))}),L2=q("$ZodNonOptional",(e,n)=>{lt.init(e,n),Xe(e._zod,"values",()=>{const t=n.innerType._zod.values;return t?new Set([...t].filter(r=>r!==void 0)):void 0}),e._zod.parse=(t,r)=>{const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>bf(s,e)):bf(o,e)}});function bf(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const z2=q("$ZodCatch",(e,n)=>{lt.init(e,n),Xe(e._zod,"optin",()=>n.innerType._zod.optin),Xe(e._zod,"optout",()=>n.innerType._zod.optout),Xe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>(t.value=s.value,s.issues.length&&(t.value=n.catchValue({...t,error:{issues:s.issues.map(i=>on(i,r,nn()))},input:t.value}),t.issues=[]),t)):(t.value=o.value,o.issues.length&&(t.value=n.catchValue({...t,error:{issues:o.issues.map(s=>on(s,r,nn()))},input:t.value}),t.issues=[]),t)}}),B2=q("$ZodPipe",(e,n)=>{lt.init(e,n),Xe(e._zod,"values",()=>n.in._zod.values),Xe(e._zod,"optin",()=>n.in._zod.optin),Xe(e._zod,"optout",()=>n.out._zod.optout),Xe(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(t,r)=>{if(r.direction==="backward"){const s=n.out._zod.run(t,r);return s instanceof Promise?s.then(i=>Js(i,n.in,r)):Js(s,n.in,r)}const o=n.in._zod.run(t,r);return o instanceof Promise?o.then(s=>Js(s,n.out,r)):Js(o,n.out,r)}});function Js(e,n,t){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},t)}const F2=q("$ZodReadonly",(e,n)=>{lt.init(e,n),Xe(e._zod,"propValues",()=>n.innerType._zod.propValues),Xe(e._zod,"values",()=>n.innerType._zod.values),Xe(e._zod,"optin",()=>n.innerType._zod.optin),Xe(e._zod,"optout",()=>n.innerType._zod.optout),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(xf):xf(o)}});function xf(e){return e.value=Object.freeze(e.value),e}const V2=q("$ZodCustom",(e,n)=>{Lt.init(e,n),lt.init(e,n),e._zod.parse=(t,r)=>t,e._zod.check=t=>{const r=t.value,o=n.fn(r);if(o instanceof Promise)return o.then(s=>wf(s,t,r,e));wf(o,t,r,e)}});function wf(e,n,t,r){if(!e){const o={code:"custom",input:t,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),n.issues.push(vo(o))}}class Y2{constructor(){this._map=new Map,this._idmap=new Map}add(n,...t){const r=t[0];if(this._map.set(n,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,n)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(n){const t=this._map.get(n);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(n),this}get(n){const t=n._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const o={...r,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function W2(){return new Y2}const ei=W2();function U2(e,n){return new e({type:"string",...Ce(n)})}function H2(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(n)})}function _f(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(n)})}function Z2(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(n)})}function G2(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(n)})}function q2(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(n)})}function K2(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(n)})}function Q2(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(n)})}function X2(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(n)})}function J2(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(n)})}function ew(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(n)})}function tw(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(n)})}function rw(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(n)})}function nw(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(n)})}function ow(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(n)})}function sw(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(n)})}function iw(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(n)})}function aw(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(n)})}function cw(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(n)})}function lw(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(n)})}function uw(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(n)})}function dw(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(n)})}function fw(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(n)})}function pw(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(n)})}function hw(e,n){return new e({type:"string",format:"date",check:"string_format",...Ce(n)})}function mw(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(n)})}function gw(e,n){return new e({type:"string",format:"duration",check:"string_format",...Ce(n)})}function vw(e,n){return new e({type:"number",checks:[],...Ce(n)})}function yw(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(n)})}function bw(e,n){return new e({type:"boolean",...Ce(n)})}function xw(e){return new e({type:"unknown"})}function ww(e,n){return new e({type:"never",...Ce(n)})}function Sf(e,n){return new cf({check:"less_than",...Ce(n),value:e,inclusive:!1})}function Fa(e,n){return new cf({check:"less_than",...Ce(n),value:e,inclusive:!0})}function Cf(e,n){return new lf({check:"greater_than",...Ce(n),value:e,inclusive:!1})}function Va(e,n){return new lf({check:"greater_than",...Ce(n),value:e,inclusive:!0})}function kf(e,n){return new $x({check:"multiple_of",...Ce(n),value:e})}function Df(e,n){return new zx({check:"max_length",...Ce(n),maximum:e})}function ti(e,n){return new Bx({check:"min_length",...Ce(n),minimum:e})}function Ef(e,n){return new Fx({check:"length_equals",...Ce(n),length:e})}function _w(e,n){return new Vx({check:"string_format",format:"regex",...Ce(n),pattern:e})}function Sw(e){return new Yx({check:"string_format",format:"lowercase",...Ce(e)})}function Cw(e){return new Wx({check:"string_format",format:"uppercase",...Ce(e)})}function kw(e,n){return new Ux({check:"string_format",format:"includes",...Ce(n),includes:e})}function Dw(e,n){return new Hx({check:"string_format",format:"starts_with",...Ce(n),prefix:e})}function Ew(e,n){return new Zx({check:"string_format",format:"ends_with",...Ce(n),suffix:e})}function yo(e){return new Gx({check:"overwrite",tx:e})}function Tw(e){return yo(n=>n.normalize(e))}function Aw(){return yo(e=>e.trim())}function Iw(){return yo(e=>e.toLowerCase())}function Mw(){return yo(e=>e.toUpperCase())}function Ow(e,n,t){return new e({type:"array",element:n,...Ce(t)})}function Pw(e,n,t){return new e({type:"custom",check:"custom",fn:n,...Ce(t)})}function jw(e){const n=Nw(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(vo(r,t.value,n._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=t.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),t.issues.push(vo(o))}},e(t.value,t)));return n}function Nw(e,n){const t=new Lt({check:"custom",...Ce(n)});return t._zod.check=e,t}function Tf(e,n){try{var t=e()}catch(r){return n(r)}return t&&t.then?t.then(void 0,n):t}function Rw(e,n){for(var t={};e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!t[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];t[i]={message:a.message,type:a.code}}else t[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(f){return e.push(f)})}),n){var c=t[i].types,l=c&&c[r.code];t[i]=Ta(i,n,t,o,l?[].concat(l,r.message):r.message)}e.shift()}return t}function $w(e,n){for(var t={};e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!t[i])if(r.code==="invalid_union"&&r.errors.length>0){var a=r.errors[0][0];t[i]={message:a.message,type:a.code}}else t[i]={message:s,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(u){return u.forEach(function(f){return e.push(f)})}),n){var c=t[i].types,l=c&&c[r.code];t[i]=Ta(i,n,t,o,l?[].concat(l,r.message):r.message)}e.shift()}return t}function Lw(e,n,t){if(t===void 0&&(t={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,s){try{return Promise.resolve(Tf(function(){return Promise.resolve(e[t.mode==="sync"?"parse":"parseAsync"](r,n)).then(function(i){return s.shouldUseNativeValidation&&Oa({},s),{errors:{},values:t.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:Hd(Rw(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(Tf(function(){return Promise.resolve((t.mode==="sync"?X1:J1)(e,r,n)).then(function(i){return s.shouldUseNativeValidation&&Oa({},s),{errors:{},values:t.raw?Object.assign({},r):i}})},function(i){if((function(a){return a instanceof La})(i))return{values:{},errors:Hd($w(i.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}const zw=q("ZodISODateTime",(e,n)=>{c2.init(e,n),st.init(e,n)});function Bw(e){return pw(zw,e)}const Fw=q("ZodISODate",(e,n)=>{l2.init(e,n),st.init(e,n)});function Vw(e){return hw(Fw,e)}const Yw=q("ZodISOTime",(e,n)=>{u2.init(e,n),st.init(e,n)});function Ww(e){return mw(Yw,e)}const Uw=q("ZodISODuration",(e,n)=>{d2.init(e,n),st.init(e,n)});function Hw(e){return gw(Uw,e)}const Xt=q("ZodError",(e,n)=>{La.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>Q1(e,t)},flatten:{value:t=>K1(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Pa,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Pa,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Zw=Zs(Xt),Gw=Gs(Xt),qw=qs(Xt),Kw=Ks(Xt),Qw=rx(Xt),Xw=nx(Xt),Jw=ox(Xt),e_=sx(Xt),t_=ix(Xt),r_=ax(Xt),n_=cx(Xt),o_=lx(Xt),mt=q("ZodType",(e,n)=>(lt.init(e,n),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...t)=>e.clone({...n,checks:[...n.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(t,r)=>Br(e,t,r),e.brand=()=>e,e.register=((t,r)=>(t.add(e,r),e)),e.parse=(t,r)=>Zw(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>qw(e,t,r),e.parseAsync=async(t,r)=>Gw(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>Kw(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Qw(e,t,r),e.decode=(t,r)=>Xw(e,t,r),e.encodeAsync=async(t,r)=>Jw(e,t,r),e.decodeAsync=async(t,r)=>e_(e,t,r),e.safeEncode=(t,r)=>t_(e,t,r),e.safeDecode=(t,r)=>r_(e,t,r),e.safeEncodeAsync=async(t,r)=>n_(e,t,r),e.safeDecodeAsync=async(t,r)=>o_(e,t,r),e.refine=(t,r)=>e.check(J_(t,r)),e.superRefine=t=>e.check(eS(t)),e.overwrite=t=>e.check(yo(t)),e.optional=()=>Rf(e),e.nullable=()=>$f(e),e.nullish=()=>Rf($f(e)),e.nonoptional=t=>H_(e,t),e.array=()=>A_(e),e.or=t=>P_([e,t]),e.and=t=>N_(e,t),e.transform=t=>zf(e,B_(t)),e.default=t=>Y_(e,t),e.prefault=t=>U_(e,t),e.catch=t=>G_(e,t),e.pipe=t=>zf(e,t),e.readonly=()=>Q_(e),e.describe=t=>{const r=e.clone();return ei.add(r,{description:t}),r},Object.defineProperty(e,"description",{get(){return ei.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return ei.get(e);const r=e.clone();return ei.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Af=q("_ZodString",(e,n)=>{za.init(e,n),mt.init(e,n);const t=e._zod.bag;e.format=t.format??null,e.minLength=t.minimum??null,e.maxLength=t.maximum??null,e.regex=(...r)=>e.check(_w(...r)),e.includes=(...r)=>e.check(kw(...r)),e.startsWith=(...r)=>e.check(Dw(...r)),e.endsWith=(...r)=>e.check(Ew(...r)),e.min=(...r)=>e.check(ti(...r)),e.max=(...r)=>e.check(Df(...r)),e.length=(...r)=>e.check(Ef(...r)),e.nonempty=(...r)=>e.check(ti(1,...r)),e.lowercase=r=>e.check(Sw(r)),e.uppercase=r=>e.check(Cw(r)),e.trim=()=>e.check(Aw()),e.normalize=(...r)=>e.check(Tw(...r)),e.toLowerCase=()=>e.check(Iw()),e.toUpperCase=()=>e.check(Mw())}),s_=q("ZodString",(e,n)=>{za.init(e,n),Af.init(e,n),e.email=t=>e.check(H2(i_,t)),e.url=t=>e.check(Q2(a_,t)),e.jwt=t=>e.check(fw(__,t)),e.emoji=t=>e.check(X2(c_,t)),e.guid=t=>e.check(_f(If,t)),e.uuid=t=>e.check(Z2(ri,t)),e.uuidv4=t=>e.check(G2(ri,t)),e.uuidv6=t=>e.check(q2(ri,t)),e.uuidv7=t=>e.check(K2(ri,t)),e.nanoid=t=>e.check(J2(l_,t)),e.guid=t=>e.check(_f(If,t)),e.cuid=t=>e.check(ew(u_,t)),e.cuid2=t=>e.check(tw(d_,t)),e.ulid=t=>e.check(rw(f_,t)),e.base64=t=>e.check(lw(b_,t)),e.base64url=t=>e.check(uw(x_,t)),e.xid=t=>e.check(nw(p_,t)),e.ksuid=t=>e.check(ow(h_,t)),e.ipv4=t=>e.check(sw(m_,t)),e.ipv6=t=>e.check(iw(g_,t)),e.cidrv4=t=>e.check(aw(v_,t)),e.cidrv6=t=>e.check(cw(y_,t)),e.e164=t=>e.check(dw(w_,t)),e.datetime=t=>e.check(Bw(t)),e.date=t=>e.check(Vw(t)),e.time=t=>e.check(Ww(t)),e.duration=t=>e.check(Hw(t))});function ar(e){return U2(s_,e)}const st=q("ZodStringFormat",(e,n)=>{nt.init(e,n),Af.init(e,n)}),i_=q("ZodEmail",(e,n)=>{Jx.init(e,n),st.init(e,n)}),If=q("ZodGUID",(e,n)=>{Qx.init(e,n),st.init(e,n)}),ri=q("ZodUUID",(e,n)=>{Xx.init(e,n),st.init(e,n)}),a_=q("ZodURL",(e,n)=>{e2.init(e,n),st.init(e,n)}),c_=q("ZodEmoji",(e,n)=>{t2.init(e,n),st.init(e,n)}),l_=q("ZodNanoID",(e,n)=>{r2.init(e,n),st.init(e,n)}),u_=q("ZodCUID",(e,n)=>{n2.init(e,n),st.init(e,n)}),d_=q("ZodCUID2",(e,n)=>{o2.init(e,n),st.init(e,n)}),f_=q("ZodULID",(e,n)=>{s2.init(e,n),st.init(e,n)}),p_=q("ZodXID",(e,n)=>{i2.init(e,n),st.init(e,n)}),h_=q("ZodKSUID",(e,n)=>{a2.init(e,n),st.init(e,n)}),m_=q("ZodIPv4",(e,n)=>{f2.init(e,n),st.init(e,n)}),g_=q("ZodIPv6",(e,n)=>{p2.init(e,n),st.init(e,n)}),v_=q("ZodCIDRv4",(e,n)=>{h2.init(e,n),st.init(e,n)}),y_=q("ZodCIDRv6",(e,n)=>{m2.init(e,n),st.init(e,n)}),b_=q("ZodBase64",(e,n)=>{g2.init(e,n),st.init(e,n)}),x_=q("ZodBase64URL",(e,n)=>{y2.init(e,n),st.init(e,n)}),w_=q("ZodE164",(e,n)=>{b2.init(e,n),st.init(e,n)}),__=q("ZodJWT",(e,n)=>{w2.init(e,n),st.init(e,n)}),Mf=q("ZodNumber",(e,n)=>{df.init(e,n),mt.init(e,n),e.gt=(r,o)=>e.check(Cf(r,o)),e.gte=(r,o)=>e.check(Va(r,o)),e.min=(r,o)=>e.check(Va(r,o)),e.lt=(r,o)=>e.check(Sf(r,o)),e.lte=(r,o)=>e.check(Fa(r,o)),e.max=(r,o)=>e.check(Fa(r,o)),e.int=r=>e.check(Pf(r)),e.safe=r=>e.check(Pf(r)),e.positive=r=>e.check(Cf(0,r)),e.nonnegative=r=>e.check(Va(0,r)),e.negative=r=>e.check(Sf(0,r)),e.nonpositive=r=>e.check(Fa(0,r)),e.multipleOf=(r,o)=>e.check(kf(r,o)),e.step=(r,o)=>e.check(kf(r,o)),e.finite=()=>e;const t=e._zod.bag;e.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),e.isFinite=!0,e.format=t.format??null});function Of(e){return vw(Mf,e)}const S_=q("ZodNumberFormat",(e,n)=>{_2.init(e,n),Mf.init(e,n)});function Pf(e){return yw(S_,e)}const C_=q("ZodBoolean",(e,n)=>{S2.init(e,n),mt.init(e,n)});function Ya(e){return bw(C_,e)}const k_=q("ZodUnknown",(e,n)=>{C2.init(e,n),mt.init(e,n)});function jf(){return xw(k_)}const D_=q("ZodNever",(e,n)=>{k2.init(e,n),mt.init(e,n)});function E_(e){return ww(D_,e)}const T_=q("ZodArray",(e,n)=>{D2.init(e,n),mt.init(e,n),e.element=n.element,e.min=(t,r)=>e.check(ti(t,r)),e.nonempty=t=>e.check(ti(1,t)),e.max=(t,r)=>e.check(Df(t,r)),e.length=(t,r)=>e.check(Ef(t,r)),e.unwrap=()=>e.element});function A_(e,n){return Ow(T_,e,n)}const I_=q("ZodObject",(e,n)=>{T2.init(e,n),mt.init(e,n),Xe(e,"shape",()=>n.shape),e.keyof=()=>R_(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:jf()}),e.loose=()=>e.clone({...e._zod.def,catchall:jf()}),e.strict=()=>e.clone({...e._zod.def,catchall:E_()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>U1(e,t),e.safeExtend=t=>H1(e,t),e.merge=t=>Z1(e,t),e.pick=t=>Y1(e,t),e.omit=t=>W1(e,t),e.partial=(...t)=>G1(Nf,e,t[0]),e.required=(...t)=>q1(Lf,e,t[0])});function M_(e,n){const t={type:"object",get shape(){return zr(this,"shape",e?L1(e):{}),this.shape},...Ce(n)};return new I_(t)}const O_=q("ZodUnion",(e,n)=>{A2.init(e,n),mt.init(e,n),e.options=n.options});function P_(e,n){return new O_({type:"union",options:e,...Ce(n)})}const j_=q("ZodIntersection",(e,n)=>{I2.init(e,n),mt.init(e,n)});function N_(e,n){return new j_({type:"intersection",left:e,right:n})}const Wa=q("ZodEnum",(e,n)=>{M2.init(e,n),mt.init(e,n),e.enum=n.entries,e.options=Object.values(n.entries);const t=new Set(Object.keys(n.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(t.has(i))s[i]=n.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Wa({...n,checks:[],...Ce(o),entries:s})},e.exclude=(r,o)=>{const s={...n.entries};for(const i of r)if(t.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Wa({...n,checks:[],...Ce(o),entries:s})}});function R_(e,n){const t=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Wa({type:"enum",entries:t,...Ce(n)})}const $_=q("ZodLiteral",(e,n)=>{O2.init(e,n),mt.init(e,n),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function L_(e,n){return new $_({type:"literal",values:Array.isArray(e)?e:[e],...Ce(n)})}const z_=q("ZodTransform",(e,n)=>{P2.init(e,n),mt.init(e,n),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Gd(e.constructor.name);t.addIssue=s=>{if(typeof s=="string")t.issues.push(vo(s,t.value,n));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),t.issues.push(vo(i))}};const o=n.transform(t.value,t);return o instanceof Promise?o.then(s=>(t.value=s,t)):(t.value=o,t)}});function B_(e){return new z_({type:"transform",transform:e})}const Nf=q("ZodOptional",(e,n)=>{j2.init(e,n),mt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function Rf(e){return new Nf({type:"optional",innerType:e})}const F_=q("ZodNullable",(e,n)=>{N2.init(e,n),mt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function $f(e){return new F_({type:"nullable",innerType:e})}const V_=q("ZodDefault",(e,n)=>{R2.init(e,n),mt.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Y_(e,n){return new V_({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Jd(n)}})}const W_=q("ZodPrefault",(e,n)=>{$2.init(e,n),mt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function U_(e,n){return new W_({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():Jd(n)}})}const Lf=q("ZodNonOptional",(e,n)=>{L2.init(e,n),mt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function H_(e,n){return new Lf({type:"nonoptional",innerType:e,...Ce(n)})}const Z_=q("ZodCatch",(e,n)=>{z2.init(e,n),mt.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function G_(e,n){return new Z_({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const q_=q("ZodPipe",(e,n)=>{B2.init(e,n),mt.init(e,n),e.in=n.in,e.out=n.out});function zf(e,n){return new q_({type:"pipe",in:e,out:n})}const K_=q("ZodReadonly",(e,n)=>{F2.init(e,n),mt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function Q_(e){return new K_({type:"readonly",innerType:e})}const X_=q("ZodCustom",(e,n)=>{V2.init(e,n),mt.init(e,n)});function J_(e,n={}){return Pw(X_,e,n)}function eS(e){return jw(e)}const Bf=/^([01][0-9]|2[0-3]):[0-5][0-9]$/,Ff=(e,n)=>{if(!e||!n)return null;const t=e.split("-");if(t.length!==3)return null;const r=parseInt(t[0],10),o=parseInt(t[1],10)-1,s=parseInt(t[2],10),i=n.split(":");if(i.length!==2)return null;const a=parseInt(i[0],10),c=parseInt(i[1],10),l=new Date(r,o,s,a,c);return isNaN(l.getTime())||!w.isValid(l)?null:l},tS=M_({titulo:ar().min(1,"El campo Título es requerido.").refine(e=>!e.startsWith(" "),{message:"El título no puede empezar con un espacio en blanco"}),fechaInicio:ar().min(1,"El campo fecha inicio es requerido."),horaInicio:ar().min(1,"La hora de inicio es requerida.").regex(Bf,{message:"Formato inválido"}),horaFin:ar().min(1,"La hora fin es requerida.").regex(Bf,{message:"Formato inválido"}),todoElDia:Ya(),fechaFin:ar().optional(),showEndDate:Ya().optional(),horaInicio2:ar().optional(),TodoElDia2:Ya().optional(),client:ar().optional().nullable(),repetir:ar().optional(),link:ar().trim().url("Debe ser una URL válida. Ejemplo https://meet.google.com/").or(L_("")).optional().refine(e=>e===void 0?!0:!/\s/.test(e),{message:"El enlace no puede contener espacios en blanco"}),descripcion:ar().optional(),color:ar().optional(),solID:Of().optional().nullable(),disID:Of().optional().nullable()}).refine(e=>e.showEndDate?e.fechaFin&&e.fechaFin.length>0:!0,{message:"La fecha de fin es requerida.",path:["fechaFin"]}).refine(e=>e.fechaFin!==void 0?!!e.fechaFin&&!!e.horaInicio2:!0,{message:"La hora de fin son requeridas.",path:["horaInicio2"]}).refine(e=>{if(e.todoElDia||!e.fechaInicio||!e.horaInicio||!e.fechaFin||!e.horaInicio2)return!0;const n=Ff(e.fechaInicio,e.horaInicio),t=Ff(e.fechaFin,e.horaFin);return!n||!t||!w.isValid(n)||!w.isValid(t)?!0:!(w.isBefore(t,n)&&!w.isSameDay(t,n)||w.isSameDay(n,t)&&w.isBefore(t,n))},{message:"",path:["horaFin"]}),Vf=e=>se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},se.createElement("path",{fill:"#333",d:"M12 24C5.38 24 0 18.608 0 12S5.38 0 12 0s12 5.38 12 12-5.38 12-12 12"}),se.createElement("path",{fill:"#fff",d:"M16.703 7.275c.52.52.541 1.345.046 1.84l-2.874 2.874 2.874 2.873c.495.496.475 1.32-.046 1.841-.52.52-1.344.54-1.84.045l-2.873-2.873-2.874 2.873c-.496.496-1.32.475-1.84-.045-.521-.521-.541-1.345-.046-1.84l2.874-2.874L7.23 9.116c-.495-.496-.475-1.32.045-1.84.521-.521 1.345-.542 1.841-.046l2.874 2.873 2.873-2.873c.496-.496 1.32-.476 1.84.045"})),rS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cg%20fill='%23404756'%20clip-path='url(%23a)'%3e%3cpath%20d='M7.288%2022.986h-.147a6.2%206.2%200%200%201-4.28-1.85c-2.404-2.404-2.478-6.24-.16-8.557L4.28%2011a1.228%201.228%200%201%201%201.739%201.739L4.44%2014.317c-1.356%201.357-1.282%203.626.16%205.068a3.82%203.82%200%200%200%202.602%201.135c.95%200%201.825-.32%202.479-.974l1.578-1.579a1.23%201.23%200%200%201%201.739%200c.48.481.48%201.258%200%201.739l-1.579%201.578c-1.097%201.098-2.552%201.69-4.13%201.69zM17.98%2012.998a1.23%201.23%200%200%201%200-1.739l1.578-1.578c.654-.654.986-1.53.974-2.466a3.78%203.78%200%200%200-1.134-2.602c-1.443-1.443-3.712-1.517-5.068-.16L12.75%206.03c-.48.48-1.258.48-1.739%200a1.23%201.23%200%200%201%200-1.739l1.579-1.578c2.318-2.319%206.153-2.245%208.558.16a6.23%206.23%200%200%201%201.85%204.279%205.84%205.84%200%200%201-1.69%204.279l-1.578%201.578c-.481.481-1.258.481-1.74%200z'/%3e%3cpath%20d='M14.172%208.11%208.07%2014.214a1.233%201.233%200%200%200%201.743%201.744l6.104-6.104a1.233%201.233%200%201%200-1.744-1.744'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h24v24H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",nS=e=>se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},se.createElement("g",{clipPath:"url(#a)"},se.createElement("path",{fill:"#404756",d:"M21.24 5.72a2.98 2.98 0 0 0-2.97-2.96l-5.19-.06c-1.06-.03-2.12.41-2.87 1.17l-7.49 7.49c-.66.66-1.03 1.54-1.03 2.47s.36 1.81 1.03 2.47l4.97 4.97a3.5 3.5 0 0 0 2.47 1.02c.89 0 1.79-.34 2.47-1.02l7.49-7.49c.76-.76 1.18-1.81 1.17-2.88l-.06-5.19zm-4.2 4.43c-.44.44-1.02.66-1.6.66a2.256 2.256 0 1 1 0-4.51 2.256 2.256 0 0 1 1.6 3.85"})),se.createElement("defs",null,se.createElement("clipPath",{id:"a"},se.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),oS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23404756'%20d='M13.17%2013.68c2.06%200%204%20.8%205.46%202.27a7.7%207.7%200%200%201%202.26%205.47c0%20.79-.64%201.43-1.43%201.43l.01-.01H4.53c-.79%200-1.43-.64-1.43-1.43%200-4.27%203.46-7.73%207.72-7.73zM12%201.9c2.82%200%205.11%202.29%205.11%205.11s-2.29%205.11-5.11%205.11v-.01c-2.82%200-5.11-2.29-5.11-5.11S9.18%201.9%2012%201.9'/%3e%3c/svg%3e",sS=e=>se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},se.createElement("g",{fill:"#2571D6",clipPath:"url(#a)"},se.createElement("path",{d:"M13.085 7.331a1.096 1.096 0 1 0-2.192 0v9.316a1.096 1.096 0 0 0 2.192 0z"}),se.createElement("path",{d:"M16.647 10.893H7.33a1.096 1.096 0 1 0 0 2.192h9.316a1.096 1.096 0 0 0 0-2.192"}),se.createElement("path",{d:"M12 24C5.38 24 0 18.608 0 12S5.38 0 12 0s12 5.38 12 12-5.38 12-12 12m0-21.808c-5.414 0-9.808 4.394-9.808 9.808S6.586 21.808 12 21.808s9.808-4.394 9.808-9.808S17.403 2.192 12 2.192"})),se.createElement("defs",null,se.createElement("clipPath",{id:"a"},se.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),iS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cg%20fill='%23404756'%20clip-path='url(%23a)'%3e%3cpath%20d='M13.789%2017H3.21C2.542%2017%202%2017.56%202%2018.25s.542%201.25%201.211%201.25H13.79c.669%200%201.211-.56%201.211-1.25S14.458%2017%2013.789%2017M20.718%204H3.282C2.574%204%202%204.56%202%205.25S2.574%206.5%203.282%206.5h17.436C21.426%206.5%2022%205.94%2022%205.25S21.426%204%2020.718%204M20.718%2010.5H3.282C2.574%2010.5%202%2011.06%202%2011.75S2.574%2013%203.282%2013h17.436c.708%200%201.282-.56%201.282-1.25s-.574-1.25-1.282-1.25'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h24v24H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",aS=e=>se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},se.createElement("path",{fill:"#2571D6",fillRule:"evenodd",d:"M17.333 11a6.34 6.34 0 0 1 6.334 6.333 6.34 6.34 0 0 1-6.334 6.334c-3.493 0-6.333-2.846-6.333-6.334A6.343 6.343 0 0 1 17.333 11m-.005 2.37c-.437 0-.79.338-.79.754v2.412h-2.414c-.416 0-.754.355-.754.792s.338.792.754.792h2.413v2.412c0 .416.354.754.791.754s.792-.338.792-.754V18.12h2.413c.416 0 .754-.355.754-.792s-.338-.792-.754-.792H18.12v-2.412c0-.416-.355-.754-.792-.754",clipRule:"evenodd"}),se.createElement("path",{fill:"#2571D6",d:"M11.12 12.297a7.97 7.97 0 0 0-1.787 5.036c0 1.763.571 3.392 1.537 4.714H3.044c-.84 0-1.523-.682-1.523-1.523 0-4.544 3.683-8.227 8.217-8.227zM10.995.139c2.925 0 5.3 2.376 5.3 5.3s-2.376 5.3-5.3 5.3v-.01a5.303 5.303 0 0 1-5.3-5.3 5.295 5.295 0 0 1 5.3-5.29"})),Yf=ct(d.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),sn=ct(d.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),cS=ct(d.jsx("path",{d:"M16.53 11.06 15.47 10l-4.88 4.88-2.12-2.12-1.06 1.06L10.59 17zM19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V8h14z"}),"EventAvailable"),lS={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:{xs:"90%",sm:450,md:500},bgcolor:"background.paper",boxShadow:24,p:{xs:2,sm:3},borderRadius:2,maxHeight:"90vh",overflowY:"auto"},Ua=["#dbe3fe","#fcebc7","#d9f1d2","#fdf5d1","#ebe3d7","#e1d6fb","#f7c7cc","#f9e7fb","#eaedf2","#d5d8dd"],Pn=(()=>{const e=[];for(let n=0;n<24;n++)for(let t=0;t<60;t+=15){const r=n.toString().padStart(2,"0"),o=t.toString().padStart(2,"0");e.push(`${r}:${o}`)}return e})(),bo=(e,n)=>{if(!e||!n)return null;const t=e.split("-");if(t.length!==3)return null;const r=parseInt(t[0],10),o=parseInt(t[1],10)-1,s=parseInt(t[2],10),i=n.split(":");if(i.length!==2)return null;const a=parseInt(i[0],10),c=parseInt(i[1],10),l=new Date(s,o,r,a,c);return isNaN(l.getTime())||!w.isValid(l)?null:l},uS=({isVisible:e,onClose:n,onSave:t,onDelete:r,selectedDate:o,initialEvent:s,userId:i,masNombreBD:a,disId:c})=>{const[l,u]=y.useState(!1),[f,p]=y.useState(!1),g=w.format(new Date,"yyyy-MM-dd"),[m,h]=y.useState(""),[x,S]=y.useState([]),[_,T]=y.useState(!1),C=xa(),[D,M]=y.useState([]),[P,K]=y.useState(""),{control:N,handleSubmit:z,reset:H,formState:{errors:v,isValid:R},watch:A,setValue:$}=Wd({resolver:Lw(tS),defaultValues:{titulo:"",fechaInicio:w.format(new Date,"yyyy-MM-dd"),horaInicio:w.format(new Date,"HH:mm"),horaFin:w.format(w.addHours(new Date,1),"HH:mm"),todoElDia:!1,client:"",repetir:"No repetir",link:"",descripcion:"",color:Ua[0],solID:null},mode:"onChange"}),Z=A("fechaInicio"),ne=A("fechaFin"),oe=A("todoElDia");y.useEffect(()=>{if(m.trim()===""||!i||!c||!a){S([]),M([]),$("solID",null),T(!1),K("");return}console.log("medo"),T(!0);const j=setTimeout(()=>{C.getClients(m,c,a,i).then(U=>{if(T(!1),U){const ge=U.map(Me=>Me.solID);M([...new Set(ge)])}else M([]);const he=Array.from(new Map(U.map(ge=>[ge.nombreCliente,ge])).values());if(he.length>0)S(he),K("");else if(s?.client&&s.solID!==null){const ge=[{solID:s.solID,nombreCliente:s.client}];S(ge),K("Sin resultados")}else S([]),K("Sin resultados")}).catch(U=>{console.error("Error al buscar clientes:",U),T(!1)})},500);return()=>clearTimeout(j)},[m,i,c,a]),y.useEffect(()=>{if(Z&&ne){const j=new Date(Z),U=new Date(ne);(j===U||j>U)&&$("fechaFin",Z)}},[Z,ne,$]),y.useEffect(()=>{Z&&$("fechaFin",Z)},[Z]),y.useEffect(()=>{$("showEndDate",l)},[l,$]),y.useEffect(()=>{if(s){const j=w.format(s.fechaInicio,"yyyy-MM-dd")===w.format(s.fechaFin,"yyyy-MM-dd");u(!j),$("titulo",s?.titulo),$("fechaInicio",w.format(s.fechaInicio,"yyyy-MM-dd")),$("fechaFin",w.format(s.fechaFin,"yyyy-MM-dd")),$("horaInicio",w.format(s.fechaInicio,"HH:mm")),$("horaFin",w.format(s.fechaFin,"HH:mm")),$("horaInicio2",w.format(s.fechaFin,"HH:mm")),$("descripcion",s.descripcion),$("link",s.link),$("repetir","false"),$("color",s.color),$("todoElDia",s.todoElDia),$("solID",s.solID),$("client",s.client),s.solID?p(!0):p(!1)}else{const j=o||new Date,U=new Date,he=new Date(j.getFullYear(),j.getMonth(),j.getDate(),U.getHours(),U.getMinutes()),ge=w.addHours(he,1);H({titulo:"",fechaInicio:w.format(he,"yyyy-MM-dd"),horaInicio:w.format(he,"HH:mm"),fechaFin:w.format(ge,"yyyy-MM-dd"),horaFin:w.format(ge,"HH:mm"),horaInicio2:w.format(ge,"HH:mm"),todoElDia:!1,client:"",repetir:"No repetir",link:"",descripcion:"",color:Ua[0],solID:null}),u(!1),p(!1)}},[s,e,o]);const we=z(j=>{t(j,s?.eventoID),n(),H(),u(!1)},j=>{console.log("Errores de validación:",j)});y.useEffect(()=>{oe&&($("horaInicio","00:00"),$("horaFin","23:59"))},[oe,$,A]);const Y=()=>{const j=A("fechaInicio");if(j){const U=new Date(`${j}T00:00:00`),he=w.addDays(U,1);$("fechaFin",w.format(he,"yyyy-MM-dd"))}u(!0)},Q=A("fechaInicio"),ve=A("horaInicio"),me=A("fechaFin"),re=A("horaFin"),[ie,ae]=y.useState(null),[pe,be]=y.useState(null);y.useEffect(()=>{(ie===null||ie!==ve)&&ae(ve)},[ve,ie]),y.useEffect(()=>{(pe===null||pe!==re)&&be(re??"")},[re,pe]);const ke=A("todoElDia");y.useEffect(()=>{if(ke||!ve||!re||!Q||!me)return;const j=bo(Q,ve),U=bo(me,re);if(!j||!U||!w.isValid(j)||!w.isValid(U))return;const he=w.isSameDay(j,U),ge=he&&(w.isAfter(j,U)||j.getTime()===U.getTime()),Me=w.isBefore(U,j)&&!he;(ge||Me)&&($("horaFin",""),be(""))},[ve,Q]);const _e=y.useMemo(()=>{if(!ve||!Q)return Pn;const j=bo(Q,ve),U=bo(me,"00:00");return!j||!U||!w.isValid(j)||!w.isValid(U)||w.isBefore(U,j)&&!w.isSameDay(U,j)?Pn:w.isSameDay(j,U)?Pn.filter(he=>{const ge=bo(me,he);return ge&&w.isAfter(ge,j)}):(w.isAfter(U,j),Pn)},[ve,Q,me]),Qe=y.useMemo(()=>Pn,[]);return d.jsx(d.Fragment,{children:d.jsx(b.Modal,{open:e,onClose:n,children:d.jsx("form",{onSubmit:we,children:d.jsxs(b.Box,{sx:lS,children:[d.jsx(b.IconButton,{"aria-label":"close",onClick:n,sx:{position:"absolute",right:8,top:12},children:d.jsx(sn,{})}),d.jsx(b.Typography,{variant:"h6",mb:2,children:s?.isGoogleEvent?d.jsxs(d.Fragment,{children:[d.jsx(cS,{sx:{mr:1}}),s.titulo||"Evento de Google"]}):s?"Editar evento":"Agregar evento"}),d.jsxs(b.Grid,{container:!0,spacing:1,marginBottom:l?0:1,children:[d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(Ht,{name:"titulo",control:N,render:({field:j})=>d.jsx(b.TextField,{...j,label:"Título",fullWidth:!0,variant:"outlined",size:"small",error:!!v.titulo,helperText:v.titulo?.message,inputProps:{maxLength:100},sx:{"& .MuiInputLabel-root.Mui-focused":{color:"black"},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"black"},"& .MuiInputLabel-root":{backgroundColor:"transparent !important",padding:"0 !important"}}})})}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(b.Divider,{})}),d.jsx(b.Grid,{size:{xs:12,md:4},children:d.jsx(Ht,{name:"fechaInicio",control:N,render:({field:j})=>d.jsx(b.TextField,{fullWidth:!0,...j,type:"date",placeholder:"Fecha de inicio",size:"small",InputLabelProps:{shrink:!0},error:!!v.fechaInicio,helperText:v.fechaInicio?.message})})}),l?d.jsxs(d.Fragment,{children:[d.jsx(b.Grid,{size:{xs:1,md:3},sx:{display:{xs:"none",sm:"block"}}}),d.jsx(b.Grid,{size:{xs:11,md:4},children:d.jsx(Ht,{name:"fechaFin",control:N,render:({field:j})=>d.jsx(b.TextField,{...j,type:"date",placeholder:"Fecha de fin",fullWidth:!!l,size:"small",InputLabelProps:{shrink:!0},inputProps:{min:Z||g},error:!!v.fechaFin,helperText:v.fechaFin?.message})})}),!s&&d.jsx(b.Grid,{size:{xs:1,md:1},children:d.jsx(b.IconButton,{onClick:()=>u(!1),sx:{fontSize:18},children:d.jsx(Vf,{})})})]}):d.jsx(b.Grid,{size:{xs:12,md:7}})]}),l&&d.jsx(d.Fragment,{children:d.jsxs(b.Grid,{container:!0,spacing:0,sx:{margin:0,padding:0,width:"100%"},children:[d.jsx(b.Grid,{size:{xs:6,md:5}}),d.jsx(b.Grid,{size:{xs:12,md:6},sx:{margin:0,padding:0,width:"100%",display:{xs:"none",sm:"block"}},children:d.jsx(Yf,{sx:{color:"#757575",margin:0,padding:0}})})]})}),d.jsxs(b.Grid,{container:!0,spacing:1,marginBottom:1,marginTop:1,children:[d.jsx(b.Grid,{size:{xs:12,md:4},children:d.jsx(Ht,{name:"horaInicio",control:N,render:({field:{onChange:j,value:U,...he}})=>d.jsx(b.Autocomplete,{freeSolo:!0,options:Qe,value:U||"",onChange:(ge,Me)=>j(Me||""),onInputChange:(ge,Me)=>j(Me),renderInput:ge=>d.jsx(b.TextField,{...ge,...he,size:"small",error:!!v.horaInicio,helperText:v.horaInicio?.message,InputProps:{...ge.InputProps,endAdornment:d.jsx(b.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:d.jsx(xd,{})})}}),disabled:A("todoElDia")})})}),d.jsx(b.Grid,{size:{xs:1,md:1},sx:{display:"flex",alignItems:v.horaInicio?"start":"center",marginTop:v.horaInicio?"5px":"0px"},children:!l&&d.jsx(Yf,{sx:{color:"#757575"}})}),l&&d.jsx(b.Grid,{size:{xs:2,md:2}}),d.jsx(b.Grid,{size:{xs:12,md:4},children:d.jsx(Ht,{name:"horaFin",control:N,render:({field:{onChange:j,value:U,...he}})=>d.jsx(b.Autocomplete,{freeSolo:!0,options:_e,value:U||"",onChange:(ge,Me)=>j(Me||""),onInputChange:(ge,Me)=>j(Me),renderInput:ge=>d.jsx(b.TextField,{...ge,...he,size:"small",error:!!v.horaFin,helperText:v.horaFin?.message,InputProps:{...ge.InputProps,endAdornment:d.jsx(b.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:d.jsx(xd,{})})}}),disabled:A("todoElDia")})})}),d.jsx(b.Grid,{size:{xs:12,md:3},hidden:l,children:d.jsx(Ht,{name:"todoElDia",control:N,render:({field:j})=>d.jsx(b.FormControlLabel,{control:d.jsx(b.Checkbox,{checked:j.value,onChange:U=>j.onChange(U.target.checked)}),label:d.jsx("label",{style:{fontSize:"0.7rem",fontWeight:"normal"},children:"Todo el día"}),sx:{whiteSpace:"nowrap"}})})}),!s?.isGoogleEvent&&d.jsx(b.Grid,{size:{xs:12,md:12},children:!l&&d.jsx(d.Fragment,{children:d.jsxs(b.Button,{onClick:Y,size:"small",sx:{textTransform:"none",fontSize:16},children:[d.jsx(sS,{})," Agregar fecha final"]})})}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(b.Divider,{})}),!s?.isGoogleEvent&&d.jsxs(d.Fragment,{children:[d.jsx(b.Grid,{size:{xs:12,md:12},children:!f&&d.jsxs(b.Button,{onClick:()=>p(!0),size:"small",sx:{textTransform:"none",fontSize:16},children:[d.jsx(aS,{})," Vincular cliente"]})}),f&&d.jsxs(d.Fragment,{children:[d.jsx(b.Grid,{size:{xs:12,md:7},children:d.jsx(Ht,{name:"client",control:N,render:({field:j})=>d.jsx(b.Autocomplete,{options:x,loading:_,loadingText:"Buscando coincidencias...",getOptionLabel:U=>U.nombreCliente?.trim()||"",value:x.find(U=>U.nombreCliente===j.value)||(j.value&&typeof j.value=="string"?{solID:-1,nombreCliente:j.value}:null),noOptionsText:P,onInputChange:(U,he)=>{h(he)},onChange:(U,he)=>{j.onChange(he?he.nombreCliente:"")},renderInput:U=>d.jsx(b.TextField,{...U,placeholder:"Buscar cliente...",size:"small",InputProps:{...U.InputProps,startAdornment:d.jsx("img",{src:oS,width:20,style:{alignSelf:"flex-start",marginRight:"8px",marginTop:"5px"}}),endAdornment:d.jsxs(d.Fragment,{children:[_?d.jsx(b.CircularProgress,{color:"inherit",size:20}):null,U.InputProps.endAdornment]})}})})})}),d.jsx(b.Grid,{size:{xs:11,md:4},children:d.jsx(Ht,{name:"solID",control:N,render:({field:j})=>d.jsx(b.Autocomplete,{options:D,noOptionsText:"Sin resultados",getOptionLabel:U=>U.toString(),value:j.value??null,onChange:(U,he)=>j.onChange(he),renderInput:U=>d.jsx(b.TextField,{...U,label:"#Registro",variant:"outlined",size:"small",sx:{"& .MuiInputLabel-root":{backgroundColor:"transparent !important",padding:"0 !important"}}}),disabled:!x})})}),d.jsx(b.Grid,{size:{xs:1,md:1},children:d.jsx(b.IconButton,{onClick:()=>p(!1),sx:{fontSize:18},children:d.jsx(Vf,{})})})]})]}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(b.Divider,{})}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(Ht,{name:"link",control:N,render:({field:j})=>d.jsx(b.TextField,{...j,placeholder:" Agregar enlace de reunión",fullWidth:!0,variant:"outlined",size:"small",error:!!v.link,helperText:v.link?.message,InputProps:{startAdornment:d.jsx("img",{src:rS,width:20,style:{alignSelf:"flex-start",marginRight:"8px",marginTop:"8px"}})}})})}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(Ht,{name:"descripcion",control:N,render:({field:j})=>d.jsx(b.TextField,{...j,placeholder:" Agregar descripción aquí...",fullWidth:!0,multiline:!0,rows:3,inputProps:{maxLength:500},variant:"outlined",size:"small",InputProps:{startAdornment:d.jsx("img",{src:iS,width:20,style:{alignSelf:"flex-start",marginRight:"8px"}})}})})}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexWrap:"wrap"},children:[d.jsx(nS,{}),Ua.map(j=>d.jsx(Ht,{name:"color",control:N,render:({field:U})=>d.jsx(b.IconButton,{onClick:()=>U.onChange(j),sx:{width:24,height:24,borderRadius:"50%",bgcolor:j,border:U.value===j?"2px solid":"none",borderColor:U.value===j?"primary.main":"transparent"}})},j))]})})]}),d.jsxs(b.Box,{sx:{display:s?.isGoogleEvent?"none":"flex",justifyContent:"flex-end",mt:3,gap:2},children:[s&&d.jsx(b.Button,{onClick:r,variant:"outlined",color:"error",sx:{textTransform:"none"},children:"Eliminar"}),d.jsx(b.Button,{onClick:n,variant:"outlined",sx:{textTransform:"none"},children:"Cancelar"}),d.jsx(b.Button,{onClick:we,variant:"contained",sx:{textTransform:"none"},disabled:!R,children:"Guardar"})]})]})})})})},dS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='48'%20height='49'%20fill='none'%3e%3cpath%20fill='%23E40B1C'%20d='M34.559%2048.077c-7.413%200-13.44-6.039-13.44-13.44s6.027-13.44%2013.44-13.44%2013.44%206.027%2013.44%2013.44c0%207.414-6.027%2013.44-13.44%2013.44'/%3e%3cpath%20fill='%23fff'%20d='M39.827%2029.346c.583.583.605%201.505.05%202.06l-3.218%203.219%203.219%203.218c.555.556.532%201.48-.051%202.062-.584.583-1.506.605-2.062.05l-3.218-3.218-3.218%203.218c-.556.555-1.478.533-2.061-.05s-.606-1.506-.05-2.062l3.217-3.218-3.218-3.218c-.555-.555-.533-1.478.05-2.061.583-.584%201.507-.606%202.063-.05l3.217%203.217%203.218-3.218c.556-.555%201.478-.533%202.062.05'/%3e%3cpath%20fill='%23404756'%20d='M30.367.078c1.112%200%202.001.868%202.001%201.954v1.195h.979c4.913%200%208.892%203.887%208.892%208.686v9.237a15.4%2015.4%200%200%200-4.424-1.691v-1.312H4.468V33.63c0%202.389%202%204.343%204.446%204.343H19.4a15.4%2015.4%200%200%200%201.676%204.343H8.892C3.979%2042.317%200%2038.43%200%2033.631V11.913c0-4.8%203.979-8.686%208.892-8.686h1V2.032c0-1.086.89-1.954%202.002-1.954s2%20.868%202%201.954v1.195h14.473V2.032c0-1.085.889-1.954%202-1.954'/%3e%3c/svg%3e",fS={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",boxShadow:24,p:4,borderRadius:2,textAlign:"center"},pS=({isOpen:e,onClose:n,onConfirm:t,title:r,message:o})=>d.jsx(b.Modal,{open:e,onClose:n,children:d.jsxs(b.Box,{sx:fS,children:[d.jsx("img",{src:dS}),d.jsx(b.Typography,{variant:"h6",component:"h2",sx:{mt:1},children:r}),d.jsx(b.Typography,{sx:{mt:2},children:o}),d.jsxs(b.Box,{sx:{mt:4,display:"flex",justifyContent:"center",gap:2},children:[d.jsx(b.Button,{variant:"outlined",onClick:n,sx:{textTransform:"none"},children:"Regresar"}),d.jsxs(b.Button,{variant:"contained",color:"error",onClick:t,sx:{textTransform:"none"},children:[d.jsx("span",{className:"icon-eliminar",children:" "})," Eliminar"]})]})]})}),hS={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:450,bgcolor:"background.paper",boxShadow:24,p:2,borderRadius:2},mS=({isOpen:e,onClose:n,events:t,date:r,onEventClick:o})=>{if(!r)return null;const s=i=>{o(i),n()};return d.jsx(b.Modal,{open:e,onClose:n,children:d.jsxs(b.Box,{sx:hS,children:[d.jsxs(b.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[d.jsxs(b.Typography,{sx:{fontSize:"20px"},component:"h2",children:["Eventos del"," ",r.toLocaleDateString("es-ES",{weekday:"long",day:"numeric",month:"long"})]}),d.jsx(b.IconButton,{onClick:n,children:d.jsx(sn,{})})]}),d.jsx(b.Divider,{}),d.jsx(b.List,{children:t.map(i=>d.jsx(b.ListItem,{disablePadding:!0,children:d.jsxs(b.ListItemButton,{onClick:()=>s(i),sx:{py:.5},children:[d.jsx(b.Box,{sx:{width:"15px",height:"15px",borderRadius:"50%",backgroundColor:i.color||"#ccc",mr:2,flexShrink:0,minWidth:"10px"}}),d.jsx(b.ListItemText,{primary:i.titulo,secondary:`${w.format(i.fechaInicio,"HH:mm")} - ${w.format(i.fechaFin,"HH:mm")}`,sx:{my:0,"& .MuiListItemText-primary":{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"},"& .MuiListItemText-secondary":{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",fontSize:"12px"}}})]})},i.eventoID))})]})})},gS=ct(d.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),vS=ct(d.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),yS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23E40B1C'%20d='M20.36%204.14H16c0-1.65-1.35-3-3-3h-2c-1.65%200-3%201.35-3%203H3.64c-.55%200-1%20.45-1%201s.45%201%201%201h1.04l.84%2013.91a3%203%200%200%200%202.99%202.82h6.98c1.58%200%202.9-1.24%203-2.82l.84-13.91h1.04c.55%200%201-.45%201-1s-.45-1-1-1zm-9.36-1h2c.55%200%201%20.45%201%201h-4c0-.55.45-1%201-1m-.39%2014.9c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201zm4.78%200c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201z'/%3e%3c/svg%3e",bS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23fff'%20d='M19.378%204.405a1.813%201.813%200%201%201%202.565%202.565L9.571%2019.342a1.813%201.813%200%200%201-2.565%200l-4.949-4.949a1.814%201.814%200%200%201%202.428-2.69l.137.126%203.666%203.666z'/%3e%3c/svg%3e",Wf=y.forwardRef(({id:e,message:n,variant:t},r)=>{const{closeSnackbar:o}=Co.useSnackbar(),s={success:{color:"#fff",icon:d.jsx("img",{width:25,src:bS,style:{borderRadius:"50%",backgroundColor:"#4caf50",color:"white",fontSize:"12px",padding:3}})},error:{color:"#f44336",icon:d.jsx(gS,{sx:{color:"#f44336"}})},info:{color:"#2196f3",icon:d.jsx(vS,{sx:{color:"#2196f3"}})},delete:{color:"#fff",icon:d.jsx("img",{src:yS,width:25,style:{borderRadius:"50%",backgroundColor:"#ffdfd4",color:"red",fontSize:"16px",padding:3}})}},i=s[t]||s.info;return d.jsx(Co.SnackbarContent,{ref:r,children:d.jsxs(b.Box,{sx:{backgroundColor:"white",color:"#333",padding:"8px 16px",borderRadius:"8px",boxShadow:"0 3px 10px rgba(0,0,0,0.2)",display:"flex",alignItems:"center",width:{xs:"90%",sm:"auto"},minWidth:"300px",borderLeft:`5px solid ${i.color}`},children:[d.jsx(b.Box,{sx:{mr:1.5},children:i.icon}),d.jsx(b.Typography,{variant:"body2",sx:{flexGrow:1},children:n}),d.jsx(b.IconButton,{size:"small",onClick:()=>o(e),children:d.jsx(sn,{fontSize:"small"})})]})})}),Uf=y.createContext(void 0),xS=({children:e})=>{const[n,t]=y.useState([]),[r,o]=y.useState(!1);return d.jsx(Uf.Provider,{value:{googleEvents:n,setGoogleEvents:t,isLoadingGoogleEvents:r,setIsLoadingGoogleEvents:o},children:e})},wS=()=>{const e=y.useContext(Uf);if(e===void 0)throw new Error("useEvents must be used within an EventsProvider");return e},_S=(e,n,t,r)=>{const o=e.start.dateTime?new Date(e.start.dateTime):e.start.date?new Date(e.start.date):new Date;let s=e.end.dateTime?new Date(e.end.dateTime):e.end.date?new Date(e.end.date):new Date;return e.end.date&&!e.end.dateTime&&s.setDate(s.getDate()-1),{eventoID:Math.abs(SS(e.id)),titulo:e.summary||"(Sin título)",descripcion:e.description,fechaInicio:o,fechaFin:s,todoElDia:!!(e.start.date&&!e.start.dateTime),color:"#4285F4",hasVideoCall:!!e.conferenceData,link:e.htmlLink,repetir:void 0,solID:null,disID:n,client:null,usrID:t,solicitudRelacionada:[],isGoogleEvent:!0}};function SS(e){let n=0;for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);n=(n<<5)-n+r,n|=0}return n}const CS=({userId:e,leads30Days:n,leads90Days:t,disId:r,masNombreBD:o})=>{const[s,i]=y.useState(new Date),[a,c]=y.useState([]),[l,u]=y.useState(!1),[f,p]=y.useState(null),[g,m]=y.useState(!1),[h,x]=y.useState(null),[S,_]=y.useState([]),{enqueueSnackbar:T}=Co.useSnackbar(),C=xa(),D=Rs(),[M,P]=y.useState(!1),[K,N]=y.useState([]),[z,H]=y.useState(null),{session:v}=ia(),{googleEvents:R,setGoogleEvents:A}=wS(),[$,Z]=y.useState([]),ne=(U,he)=>{N(U),H(he),P(!0)},oe=y.useRef(null);y.useEffect(()=>{const U=async()=>{try{if(e){const he=await C.getEventsByUser(e);c(he)}}catch{console.log("No se pudieron cargar los eventos. Revisa la consola para más detalles.")}};return U(),oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>{U()},4e3),()=>{oe.current&&clearTimeout(oe.current)}},[s,e,R]),y.useEffect(()=>{const U=new Date,he=w.startOfDay(U),ge=w.endOfDay(w.addDays(he,6)),Me={start:he,end:ge},Ct=a.filter(bt=>{const gt={start:bt.fechaInicio,end:bt.fechaFin};return wu(gt,Me)}).sort((bt,gt)=>bt.fechaInicio.getTime()-gt.fechaInicio.getTime());_(Ct)},[a]);const we=async U=>{try{if(console.log("validacion id",U),U?.isGoogleEvent)p(U),u(!0);else{const he=await C.getEventById(U.eventoID);p(he),u(!0)}}catch(he){console.error(he)}},Y=()=>{u(!1),p(null)},Q=async(U,he)=>{let ge,Me;U.todoElDia?(ge=new Date(`${U.fechaInicio}T${U.horaInicio}`),Me=new Date(`${U.fechaInicio}T${U.horaFin}`)):(ge=new Date(`${U.fechaInicio}T${U.horaInicio}`),Me=U.fechaFin&&U.horaFin?new Date(`${U.fechaFin}T${U.horaFin}`):new Date(`${U.fechaInicio}T${U.horaFin}`));const Ct=w.format(ge,"yyyy-MM-dd HH:mm:ss.SSS"),bt=w.format(Me,"yyyy-MM-dd HH:mm:ss.SSS");if(he){const k={...U,eventoID:he,fechaInicio:Ct,fechaFin:bt,solID:U.solID??null,disID:r??null,client:U.client};try{const I=await C.updateEvent(k);var gt=a.map(L=>L.eventoID===I.eventoID?I:L);c(gt),T("El evento se ha actualizado correctamente.",{variant:"success"}),Y()}catch{T("Error al actualizar Evento",{variant:"error"})}}else{const k={...U,fechaInicio:Ct,fechaFin:bt,todoElDia:U.todoElDia,solID:U.solID??null,disID:r??null,client:U.client};try{const I=await C.createEvent(k,e);c(L=>[...L,I]),T("El evento se ha creado con éxito",{variant:"success"}),Y()}catch{T("Error al guardar Evento",{variant:"error"})}}if(e){const k=await C.getEventsByUser(e);c(k)}},ve=()=>{i(U=>new Date(U.getFullYear(),U.getMonth()-1,1))},me=()=>{i(U=>new Date(U.getFullYear(),U.getMonth()+1,1))},re=()=>{m(!0)},ie=()=>{x(new Date),u(!0)},ae=()=>alert("Sincronizar con Outlook Calendar"),pe=U=>{U&&i(U)},be=U=>{x(U),u(!0),p(null)},ke=async()=>{if(f)try{await C.deleteEvent(f.eventoID),c(a.filter(U=>U.eventoID!==f.eventoID)),T("El evento se ha eliminado de tu calendario",{content:(U,he)=>d.jsx(Wf,{id:U,message:String(he),variant:"delete"})})}catch{T("Error al eliminar Evento",{variant:"error"})}finally{Y(),m(!1)}};y.useEffect(()=>{const U=[...a];if(R.length>0&&v.userEmail&&(v.userEmail,r&&e)){const he=R.map(ge=>_S(ge,r,e));U.push(...he)}Z(U)},[a,R]);const[_e,Qe]=y.useState([]),j=async U=>{if(v?.userEmail===null){console.warn("Faltan datos o calendarios para cargar eventos de Google."),A([]);return}const he=_e.filter(ge=>ge.selected).map(ge=>ge.id);console.log("googleCalendars",_e);try{const ge={disID:r,year:s.getFullYear(),month:s.getMonth()+1,usrMail:v?.userEmail,calendarIds:he};if(r){const Me=await D.getGoogleEventsByMonth(ge);console.log("eventstosGmail",Me),A(Me)}}catch(ge){console.error("Error al obtener eventos de Google Calendar:",ge),A([])}};return r===void 0||e===void 0?d.jsx("div",{children:"Cargando configuración de usuario..."}):d.jsxs("div",{id:"Agenda",style:{height:"100%",width:"100%"},children:[d.jsx(Ag,{header:d.jsx(qv,{currentDate:s,onPrevMonth:ve,onNextMonth:me,onAddEvent:ie,onDateChange:pe}),sidebar:d.jsx(a1,{onEventClick:we,upcomingEvents:S,onSyncOutlook:ae,leads30Days:n,leads90Days:t,disID:r,usrID:e,onGoogleEvents:j}),mainContent:d.jsx(g1,{onSeeMoreClick:ne,currentDate:s,events:$,onDayClick:be,onEventClick:we})}),l&&d.jsx(uS,{isVisible:l,onClose:Y,onSave:Q,onDelete:re,selectedDate:h,initialEvent:f,userId:e,masNombreBD:o,disId:r}),d.jsx(pS,{isOpen:g,onClose:()=>m(!1),onConfirm:ke,title:"Eliminar evento",message:"¿De verdad deseas eliminar este evento? Esta acción no se puede deshacer."}),d.jsx(mS,{isOpen:M,onClose:()=>P(!1),events:K,date:z,onEventClick:we})]})},kS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='22'%20height='22'%3e%3cpath%20fill='%23070c10'%20d='M18.575%203.172A10.829%2010.829%200%200%200%201.564%2016.284l-.028-.051L0%2021.843l5.739-1.506a10.7%2010.7%200%200%200%205.173%201.318%2010.83%2010.83%200%200%200%207.663-18.483m-7.658%2016.655a8.94%208.94%200%200%201-4.62-1.277l.041.023-.329-.194-3.405.894.908-3.321-.214-.34a8.9%208.9%200%200%201-1.376-4.782%209%209%200%201%201%209%209Zm4.935-6.736c-.27-.135-1.6-.789-1.848-.88s-.429-.135-.61.136-.7.879-.856%201.06-.316.2-.586.068a7.5%207.5%200%200%201-2.183-1.349l.007.007a8.2%208.2%200%200%201-1.483-1.842l-.02-.038c-.157-.27-.017-.417.118-.551s.271-.316.406-.473a1.9%201.9%200%200%200%20.267-.44v-.012a.5.5%200%200%200%20.05-.216.5.5%200%200%200-.074-.26c-.068-.135-.609-1.467-.834-2.009s-.444-.455-.609-.464-.338-.009-.519-.009a.99.99%200%200%200-.72.337%203.03%203.03%200%200%200-.947%202.2v.058a5.27%205.27%200%200%200%201.114%202.815v-.011a12.16%2012.16%200%200%200%204.553%204.053l.068.031a14%2014%200%200%200%201.434.539l.109.03a3.6%203.6%200%200%200%201.077.161%203.7%203.7%200%200%200%20.648-.057h-.023a2.8%202.8%200%200%200%201.819-1.274l.007-.012a2.2%202.2%200%200%200%20.19-.9%202.3%202.3%200%200%200-.034-.395v.014c-.067-.113-.248-.18-.519-.316Z'/%3e%3c/svg%3e",DS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='25.085'%20height='18.5'%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='none'%20d='M0%200h25.085v18.5H0z'%20data-name='Rectángulo%204598'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23a)'%20data-name='Grupo%207946'%3e%3cpath%20d='M23.12%205.809V3.226a3.2%203.2%200%200%200-.068-.656l-3.141%202.21a7.8%207.8%200%200%201%203.209%201.032'%20data-name='Trazado%2013329'/%3e%3cpath%20d='M11.847%209.791c-.1.009-.2.023-.308.023a3.78%203.78%200%200%201-2.18-.688L.067%202.58A3.2%203.2%200%200%200%200%203.227V13.98a3.23%203.23%200%200%200%203.226%203.226h9.611a7.86%207.86%200%200%201-.99-7.414'%20data-name='Trazado%2013330'/%3e%3cpath%20d='M12.478%207.369%2021.92.737A3.2%203.2%200%200%200%2019.894%200H3.226a3.2%203.2%200%200%200-2.031.74l9.4%206.628a1.64%201.64%200%200%200%201.881%200'%20data-name='Trazado%2013331'/%3e%3cpath%20d='M23.356%208.407a5.914%205.914%200%201%200%200%208.364%205.92%205.92%200%200%200%200-8.364m-1.833%204.842a.54.54%200%200%201-1.081%200v-1.164l-2.513%202.516a.54.54%200%200%201-.765-.763l2.515-2.515h-1.167a.54.54%200%201%201%200-1.081h2.471a.54.54%200%200%201%20.54.54Z'%20data-name='Trazado%2013332'/%3e%3c/g%3e%3c/svg%3e";function Ha(e,n,t){return e.accessor?e.accessor(n,t):e.field?n?.[e.field]:n?.[e?.key||""]}function ES(e,n){const t=e??"",r=n??"";return t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():typeof t=="number"&&typeof r=="number"?t-r:typeof t=="boolean"&&typeof r=="boolean"?Number(t)-Number(r):String(t).localeCompare(String(r),void 0,{numeric:!0,sensitivity:"base"})}function Za(e,n,t=!0){return typeof e=="function"?e(n):e??t}function TS(e){return e.replace(/[^\d]/g,"")}function AS(e,n){return n}const IS=ct(d.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAlt"),MS=ct(d.jsx("path",{d:"M15.5 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.79 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0s.41-1.08 0-1.49zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"SearchRounded"),OS=ct(d.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),PS=ct(d.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function Hf(e){return e==="right"?"end":e==="center"?"center":"start"}function Zf(e){const n=e.filter(t=>!t.width).length||1;return e.map(t=>typeof t.width=="number"?`${t.width}px`:typeof t.width=="string"?t.width:`minmax(0, ${1/n}fr)`).join(" ")}const jS=1060,Ga=(e,n)=>e.metrics.find(t=>String(t.label).toLowerCase()===n.toLowerCase())?.value??"";function NS({sections:e,detailColumns:n,summaryWidths:t=["1fr",120,120,150],minWidth:r=jS,getDetailColumns:o,onRowClick:s}){function c(u){if(typeof u=="number")return u;if(!u)return 0;const f=/^(\d+)\s*px$/.exec(u.trim());return f?Number(f[1]):/fr$/i.test(u)?160:0}function l(u){const f=u.reduce((m,h)=>m+c(h.width),0),p=Math.max(u.length-1,0)*16;return f+p+32}return d.jsx(b.Box,{sx:{border:"1px solid rgba(0,0,0,0.15)",overflow:"hidden",bgcolor:"background.paper",width:"100%"},children:d.jsxs(b.Box,{children:[d.jsx(b.Box,{sx:{display:"grid",gridTemplateColumns:t.map(u=>typeof u=="number"?`${u}px`:u).join(" "),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:"#1E5BCE",color:"#fff",boxSizing:"border-box"},children:["Tipo","En Proceso","Finalizadas","Último seg."].map(u=>d.jsx(b.Typography,{sx:{fontSize:13,fontWeight:800},children:u},u))}),e.map((u,f)=>{const[p,g]=se.useState(!!u.initiallyOpen),m=f%2===1,h=o?o(u):n,x=Math.max(r,l(h));return d.jsxs(b.Box,{children:[d.jsxs(b.Box,{sx:{display:"grid",gridTemplateColumns:t.map(S=>typeof S=="number"?`${S}px`:S).join(" "),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:m?"rgba(30,91,206,0.06)":"background.paper",borderTop:"1px solid rgba(0,0,0,0.08)","&:hover":{bgcolor:"rgba(30,91,206,0.12)"},boxSizing:"border-box",cursor:"pointer"},onClick:()=>g(S=>!S),children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[d.jsx(b.IconButton,{size:"small",disableRipple:!0,children:p?d.jsx(PS,{}):d.jsx(OS,{})}),d.jsx(b.Typography,{sx:{fontWeight:700,fontSize:14,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:String(u.title),children:u.title})]}),d.jsx(b.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Ga(u,"En Proceso")}),d.jsx(b.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Ga(u,"Finalizadas")}),d.jsx(b.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Ga(u,"Último seg.")})]}),d.jsx(b.Collapse,{in:p,unmountOnExit:!0,children:d.jsxs(b.Box,{sx:{overflowX:"auto","&::-webkit-scrollbar":{height:"5px"}},children:[d.jsx(b.Box,{sx:{minWidth:x,display:"grid",gridTemplateColumns:Zf(h),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:"rgba(30,91,206,0.18)",color:"#1a1a1a",borderTop:"1px solid rgba(0,0,0,0.12)",boxSizing:"border-box"},children:h.map(S=>d.jsx(b.Typography,{sx:{justifySelf:Hf(S.align),textAlign:S.align??"left",fontSize:12.5,fontWeight:800,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:S.header},S.key))}),(u.rows??[]).map((S,_)=>d.jsx(b.Box,{sx:{minWidth:x,display:"grid",gridTemplateColumns:Zf(h),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:_%2===0?"background.paper":"rgba(30,91,206,0.06)",borderTop:"1px solid rgba(0,0,0,0.06)","&:hover":{bgcolor:"rgba(30,91,206,0.12)"},boxSizing:"border-box",cursor:"pointer"},onClick:()=>s?.(S,u),children:h.map((T,C)=>{const D=T.accessor?T.accessor(S,_):T.field?S[T.field]:null;return d.jsx(b.Box,{sx:{justifySelf:Hf(T.align),textAlign:T.align??"left",minWidth:0},children:typeof D=="string"||typeof D=="number"?d.jsx(b.Typography,{sx:{fontSize:13,fontWeight:/^(estatus|seg|avance|nivel|asesor|fecha)$/i.test(T.key)?700:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:String(D),children:D}):D},T.key??C)})},S.id??_))]})})]},u.id)})]})})}const RS=ct(d.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m3.3 14.71L11 12.41V7h2v4.59l3.71 3.71z"}),"AccessTimeFilled"),$S=e=>e?new Date(e).toLocaleDateString("es-MX",{day:"2-digit",month:"short",year:"numeric"}).replace(".",""):"",LS=e=>{const n=`${e?.Nombre??""} ${e?.Apellido??""}`.trim();return n||(e?.IdAsesor?e?.Correo??"Usuario":"Sin asesor asignado")},zS=e=>{const n=(e||"").split(" ").filter(Boolean);return n.length>=2?(n[0][0]+n[1][0]).toUpperCase():(e?.[0]??"?").toUpperCase()},BS=ct(d.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Create"),qa=({current:e,total:n,color:t="#4caf50"})=>d.jsx("div",{style:{display:"flex",gap:"1px",width:"100%",height:"100%",justifyContent:"center"},children:Array.from({length:n}).map((r,o)=>d.jsx("div",{style:{width:"7px",height:"7px",borderRadius:"2px",backgroundColor:o<e?t:"#e0e0e0",display:"flex"}},o))}),Gf=ct(d.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),FS=ct(d.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),VS=e=>{const n=String(e??"").toLowerCase().trim();return n==="muy interesado"?{bg:"#E53935",color:"#FFFFFF"}:n==="interesado"?{bg:"#FB8C00",color:"#FFFFFF"}:n==="venta definitiva"?{bg:"#2E7D32",color:"#FFFFFF"}:n==="no sé"||n==="no se"?{bg:"#9E9E9E",color:"#FFFFFF"}:n==="algo interesado"?{bg:"#FFEB3B",color:"#000000"}:{bg:"transparent",color:"#2c2c2c"}},YS=e=>{switch(parseInt(String(e??""),10)){case 1:return"Por Asignar";case 2:return"Solicitud Asignada";case 3:return"Solicitud asignada en proceso";case 4:return"Finalizadas sin Venta";case 5:return"Finalizadas con Venta";case 6:return"Rechazadas";case 7:return"Finalizada por sistema";case 8:return"";case 9:return"";case 10:return"Prospección";case 11:return"Interés Real";case 12:return"Proceso de Compra";case 13:return"";case 14:return"En espera de Unidad";case 15:return"Auto Facturado";case 16:return"";case 17:return"";case 18:return"Compró otra Marca";case 19:return"No comprará";default:return null}},WS=e=>{switch(parseInt(String(e??""),10)){case 1:return"Por asignar";case 2:return"Solicitud Asignada";case 3:return"En seguimiento";case 6:return"Rechazada";case 7:return"Finalizada sin enviar a Ventas";case 8:return"Finalizada enviado a Ventas";default:return null}},US=e=>{switch(parseInt(String(e??""),10)){case 0:return"Sin asignar";case 1:return"Confirmado";case 2:return"Solicitud Asignada";case 3:return"En seguimiento";case 4:return"Confirmado";case 5:return"Finalizada";case 6:return"Rechazada";case 10:return"Reagendado";case 20:return"Seguimiento [Cita Finalizada]";case 30:return"Reenvio";case 40:return"Seguimiento [Mecanico]";case 50:return"Seguimiento";default:return null}};function HS(e){const n=new Date(e),t=n.toLocaleDateString("es-MX",{day:"2-digit",month:"short",year:"numeric"}),r=n.toLocaleTimeString("es-MX",{hour:"2-digit",minute:"2-digit"});return`${t.replace(".","")} • ${r}`}function ZS(e){return e.replace(/<br\s*\/?>/gi,`
|
|
180
180
|
`).replace(/\r\n/g,`
|
|
181
181
|
`).replace(/\r/g,`
|
|
182
|
-
`)}const GS={Todos:[],"Sin Asignar":["Sin Asignar"],"En prospección":["Prospección"],"Proceso de Compra":["Proceso de Compra"],"En espera de Unidad":["En Espera de Unidad"],"Auto Facturado":["Auto Facturado"],Rechazadas:["Rechazada","Rechazadas"],"Finalizadas sin Venta":["Sin Venta"],"Finalizadas con Venta":["Con Venta"],"En Proceso":["Asignada","Prospección","Sin Asignar","Proceso de Compra","En Espera de Unidad","Auto Facturado","Sin Atender"]},qS={Todos:[],"Selección y presentación de vehículos":["Selección y presentación de vehículos"],"Prueba de Manejo":["Prueba de Manejo"],"Valoración del Auto a cuenta y/o enganche":["Valoración del Auto a cuenta y/o enganche"],"Entrega de vehículo":["Entrega de vehículo"],"Negociación y Cierre":["Negociación y Cierre"]},KS={Todos:[],"Algo interesado":["Algo interesado"],Interesado:["Interesado"],"Muy interesado":["Muy interesado"],"Venta definitiva":["Venta definitiva"],"No sé":["No sé"]};function QS(e,n){switch(e){case"pruebas":return WS(n)??"—";case"servicio":return US(n)??"—";case"nuevos":case"seminuevos":default:return YS(n)??"—"}}function XS({open:e,onClose:n,customer:t,fields:r=[],header:o,extraSections:s,normalTable:i,normalTableColumns:a=[],history:c=[],advisorHistory:l=[],onRequestEdit:u,searchFilter:f,solicitudesNuevos:p=[],solicitudesPrueba:g=[],solicitudesServicio:m=[],solicitudesSeminuevos:h=[],onCreateSolicitud:x,isCrmMode:S=!1,onSolicitudBaseUrl:_,onIframeClose:T,reloadInfo:C}){if(!t)return null;const D=3,[M,P]=y.useState(null),K=!!M,[N,z]=y.useState(!1),[H,v]=y.useState(null),[R,A]=y.useState(c??[]),[$,Z]=y.useState(null),ne=y.useMemo(()=>[...l].sort((V,G)=>new Date(G.FechaAsignacion).getTime()-new Date(V.FechaAsignacion).getTime()),[l]);y.useEffect(()=>{c&&c.length&&A(c)},[c]);const oe=c?.length?c:R,we=o?.title??(V=>V?.Nombre||V?.name||"Sin título"),Y=o?.infoItems??[],Q=V=>V.nombreAsesor?.trim()||(V.Email?V.Email:"Sistema"),ve=V=>{const G=V||"",le=G.split(" ").filter(Boolean);return le.length>=2?(le[0][0]+le[1][0]).toUpperCase():(G[0]||"?").toUpperCase()},me=V=>V?.SolID??V?.solID??V?.SolId??V?.SOLID??null,re=y.useMemo(()=>!$||H==null?oe??[]:(oe??[]).filter(V=>{const G=me(V);return G!=null&&String(G)===String(H)}),[oe,$,H]),ie=y.useMemo(()=>[...re].sort((V,G)=>new Date(G.fecAlta).getTime()-new Date(V.fecAlta).getTime()),[re]),[ae,pe]=y.useState(!1),be=y.useMemo(()=>ae?ie:ie.slice(0,D),[ae,ie]),ke=Math.max(ie.length-D,0),_e=V=>String(V??"").normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().trim(),Qe=(V,G)=>_e(JSON.stringify(V)).includes(_e(G)),j=(V,G)=>f?f(V,G):Qe(V,G),U=(V,G)=>{const le=_e(G).split(/\s+/).filter(Boolean);return le.length?le.every(De=>j(V,De)):!0},[he,ge]=y.useState(""),[Me,Ct]=y.useState([]);y.useMemo(()=>i??[],[i]),y.useMemo(()=>{const V=he.trim();return V?(i??[]).filter(G=>U(G,V)):i??[]},[i,he]);const bt=b.useTheme(),gt=b.useMediaQuery(bt.breakpoints.down("md")),[k,I]=y.useState(""),[L,ce]=y.useState(!0),[te,O]=y.useState(!1),ee=new Date().toISOString().slice(0,10),xe=new Date(Date.now()-720*3600*1e3).toISOString().slice(0,10),[Ae,B]=y.useState(xe),[J,ye]=y.useState(ee),[Ze,kt]=y.useState(null),Dt=!!Ze,[zt,lr]=y.useState("Todos"),[Jt,Ar]=y.useState("Todos"),[Ir,Mr]=y.useState("Todos"),xo=["Algo interesado","Interesado","Muy interesado","Venta definitiva","No sé"],wo=["Selección y presentación de vehículos","Prueba de Manejo","Valoración del Auto a cuenta y/o enganche","Entrega de vehículo","Negociación y Cierre"],oi=()=>{I(""),ce(!1),O(!1),B(xe),ye(ee),lr("Todos"),Ar("Todos"),Mr("Todos")},Ja=y.useMemo(()=>(k??"").trim()!==""||zt!=="Todos"||Jt!=="Todos"||L||te||Ir!=="Todos",[k,zt,Jt,L,te,Ir]);function an(V){if(!V)return"";const G=new Date(V);if(isNaN(G.getTime()))return"";const le=String(G.getDate()).padStart(2,"0"),De=String(G.getMonth()+1).padStart(2,"0"),Je=String(G.getFullYear()).slice(-2);return`${le}/${De}/${Je}`}function si(V){const G=V?new Date(V):null;return G&&!isNaN(G.getTime())?G:null}function ii(V,G){let le=null;for(const De of V){const Je=si(G(De));if(Je){const Ge=Je.getTime();(le===null||Ge>le)&&(le=Ge)}}return le?new Date(le):null}function _o(V){const G=ii(V,le=>le.UltimoSeguimiento||le.FechaCita);return G?an(G.toISOString()):"—"}function ai(V){const G=(V??"").toLowerCase().trim();return G==="sin venta"||G==="con venta"||G==="rechazada"||G==="rechazadas"}function ci(V){return V.filter(G=>ai(G.EstatusDescripcion)).length}function So(V){return V.filter(G=>!ai(G.EstatusDescripcion)).length}const li=({progress:V,color:G})=>{if(!V)return d.jsx(qa,{current:0,total:0,color:G});const le=V.split("/").map(Number);if(le.length!==2||le.some(Ge=>Number.isNaN(Ge)))return d.jsx(qa,{current:0,total:0,color:G});const[De,Je]=le;return d.jsx(qa,{current:De,total:Je,color:G})};function ui(V){return[{key:"fecha",header:"Fecha",accessor:G=>an(G.Fecha),width:110},{key:"vehiculo",header:"Vehículo",accessor:G=>d.jsx(b.Tooltip,{title:G.Vehiculo??"",placement:"top",arrow:!0,children:d.jsx(b.Typography,{component:"span",sx:{fontSize:13,fontWeight:500,display:"block",maxWidth:260,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3,cursor:"default"},children:G.Vehiculo??"—"})}),width:260},{key:"estatus",header:"Estatus",accessor:G=>d.jsx(b.Typography,{sx:{fontWeight:800,fontSize:13},children:QS(V,G.IdEstatus)}),width:170},{key:"nivel",header:"Nivel de Interés",accessor:G=>{const{bg:le,color:De}=VS(G.NivelInteres);return d.jsx(b.Box,{sx:{display:"inline-block",px:1,py:.25,borderRadius:9999,bgcolor:le,color:De,fontSize:12,fontWeight:G.NivelInteres?800:500},children:G.NivelInteres??"—"})},width:150},{key:"asesor",header:"Asesor",accessor:G=>{const le=(G.Asesor??"").trim(),De=nc=>{if(!nc)return"";const gC=nc[0]?.toUpperCase()??"",vC=nc[1]?.toLowerCase()??"";return`${gC}${vC}`};if(!le)return d.jsx(b.Tooltip,{title:"",placement:"top",children:d.jsx(b.Typography,{sx:{fontWeight:700,fontSize:13,textAlign:"center"},children:"—"})});const Je=le.split(/\s+/),Ge=Je[0]??"",ot=Je[1]??"",It=De(Ge),Or=De(ot),rc=`${It}${Or}`||"—";return d.jsx(b.Tooltip,{title:le,placement:"top",children:d.jsx(b.Typography,{sx:{fontWeight:700,fontSize:13,textAlign:"center"},children:rc})})},width:120,align:"center"},{key:"origen",header:"Origen",accessor:G=>G.Origen??"—",width:120,align:"center"},{key:"actividad",header:"Actividad",accessor:G=>d.jsx(b.Tooltip,{title:G.Actividad??"",placement:"top",arrow:!0,children:d.jsxs(b.Box,{sx:{maxWidth:160,overflow:"hidden",display:"flex",gap:.5,alignItems:"center"},children:[G.Icon&&d.jsx("span",{style:{color:"#fff",backgroundColor:G.Color,borderRadius:100,alignItems:"center",justifyContent:"center",display:"flex",padding:3},children:d.jsx("i",{className:G.Icon})}),d.jsx(b.Typography,{component:"span",noWrap:!0,sx:{fontSize:13,fontWeight:500,display:"block",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3,cursor:(G.Actividad??"").length?"default":"inherit"},children:G.Actividad??"—"})]})}),width:180},{key:"avance",header:"Avance",accessor:G=>d.jsx(li,{progress:G.Avance,color:G.Color}),width:"auto",align:"left"}]}function ec(V){const le=ui(V).slice(1);return[{key:"fecha",header:"Fecha",accessor:De=>an(De.Fecha),width:110},{key:"fechaCita",header:"Fecha Cita",accessor:De=>an(De.FechaCita),width:120},{key:"horaCita",header:"Hora Cita",accessor:De=>De.HoraCita??"—",width:110},...le]}function tc(V){const G=V.kind;switch(G){case"pruebas":case"servicio":return ec(G);case"nuevos":case"seminuevos":default:return ui(G)}}function jn(V,G,le,De){return{id:V,kind:le,title:G,metrics:[{label:"En Proceso",value:So(De)},{label:"Finalizadas",value:ci(De)},{label:"Último seg.",value:_o(De)}],rows:De,initiallyOpen:!1}}const E=[jn("n-1","Cotización de nuevos","nuevos",p),jn("p-1","Prueba de Manejo","pruebas",g),jn("s-1","Cita de Servicio","servicio",m),jn("sn-1","Cotización para Seminuevos","seminuevos",h)],X=y.useMemo(()=>{const V=(k??"").trim().toLowerCase(),G=(le,De)=>{if(V&&!(le.Vehiculo??"").toLowerCase().includes(V))return!1;const Je=te?le.FechaCita:le.Fecha;if(L&&Je){const Ge=si(Je??"");if(!Ge)return!1;const ot=Ae?new Date(`${Ae}T00:00:00`):null,It=J?new Date(`${J}T00:00:00`):null;if(It&&It.setDate(It.getDate()+1),ot&&Ge<ot||It&&Ge>=It)return!1}if(zt!=="Todos"){const Ge=(le.EstatusDescripcion??"").toLowerCase();if(!(GS[zt]??[]).some(Or=>Ge===Or.toLowerCase()))return!1}if(Jt!=="Todos"){const Ge=(le.Actividad??"").toLowerCase();if(!(qS[Jt]??[]).some(Or=>Ge===Or.toLowerCase()))return!1}if(Ir!=="Todos"){const Ge=(le.NivelInteres??"").toLowerCase();if(!(KS[Ir]??[]).some(Or=>Ge===Or.toLowerCase()))return!1}return!0};return E.map(le=>{const De=(le.rows??[]).filter(Ge=>G(Ge,le.kind)),Je=[{label:"En Proceso",value:So(De)},{label:"Finalizadas",value:ci(De)},{label:"Último seg.",value:_o(De)}];return{...le,rows:De,metrics:Je}})},[E,k,L,Ae,J,te,zt,Jt,Ir]);console.log("filteredSections",X);const fe={nuevos:"cotizaciones",pruebas:"pruebademanejo",servicio:"citasservicio",seminuevos:"seminuevos"},Ee=(V,G)=>{const le=V.SolID;if(!le)return;const De=G.kind,Je=fe[De]??"cotizaciones",Ge=`https://qa2.crm.netcar.com.mx/netcar/${Je}/${le}`,ot=_?.({row:V,section:G,slug:Je,solId:le,baseUrl:Ge});if(!S){const It=ot??`https://qa2.crm.netcar.com.mx/netcar/${Je}/${le}`;v(le),Z(It),z(!0)}},$e=()=>{T?.(t),v(null),Z(null),z(!1)},Le=y.useRef(!1),Oe=y.useRef(null),Pe=y.useCallback(()=>{if(!Le.current){Le.current=!0;return}Oe.current&&window.clearTimeout(Oe.current),Oe.current=window.setTimeout(()=>{console.log("iframe recargó (estable) -> refetch"),console.log("iframe customer",t),C?.(t)},500)},[]);return y.useEffect(()=>{Le.current=!1,Oe.current&&window.clearTimeout(Oe.current)},[$,H]),console.log("iframeUrl",$),console.log("iframeUrl iframeFirstLoadRef",Le),d.jsx(b.Dialog,{open:e,onClose:n,fullWidth:!0,fullScreen:gt,PaperProps:{sx:{height:{xs:"100dvh",md:"90vh"},maxWidth:{xs:"100vw",md:"92vw"},overflow:"hidden",display:"flex",flexDirection:"column",borderRadius:{xs:0,md:3}}},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},height:"100%",minHeight:0,overflow:"auto",position:"relative"},children:[d.jsxs(b.Box,{sx:{width:{xs:"100%",md:405},maxWidth:{xs:"100%",md:405},bgcolor:{xs:"transparent",md:"#40404024"},display:"flex",flexDirection:"column",height:{xs:"auto",md:"100%"},borderRight:{xs:"none",md:"1px solid #EBEEF0"}},children:[d.jsxs(b.Box,{children:[d.jsx(b.Stack,{direction:"row",spacing:2,alignItems:"center",mb:1,sx:{px:2.5,pt:2.5},children:d.jsxs(b.Box,{display:"flex",flexDirection:"column",gap:1,width:"100%",children:[d.jsx(b.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",alignItems:"center",children:d.jsx(b.Box,{sx:{flex:1,minWidth:0,pr:1},children:d.jsxs(b.Typography,{component:"span",fontWeight:700,sx:{display:"inline",lineHeight:1.2,wordBreak:"break-word",pr:.5},children:[we(t)," ",d.jsx(b.IconButton,{component:"span",size:"small",disableRipple:!0,onClick:()=>{n?.(),t&&u?.(t)},sx:{p:0,ml:.5,verticalAlign:"text-bottom",color:"#336BE1","&:hover":{bgcolor:"transparent"},"&:focus-visible":{outline:"none"}},"aria-label":"Editar nombre",children:d.jsx(BS,{sx:{fontSize:"1em"}})})]})})}),Y.map((V,G)=>d.jsxs(b.Box,{sx:{display:"flex",gap:1.2,alignItems:"center",cursor:V.onClick?"pointer":"default"},onClick:()=>{V.onClick&&V.onClick(t)},children:[V.icon,d.jsx(b.Typography,{variant:"body2",sx:{color:V.inLink?"#336BE1":"#070C10"},style:{},children:V.value(t)})]},G))]})}),d.jsx(b.Stack,{mb:2,sx:{px:2.5,pt:0,gap:2},children:r.map((V,G)=>{const le=V.label?.toLowerCase().startsWith("asesor");return d.jsxs(b.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[d.jsx(b.Box,{sx:{width:"50%"},children:d.jsx(b.Typography,{variant:"body2",color:"text.secondary",sx:{color:"#5C6372"},children:V.label})}),d.jsxs(b.Box,{sx:{width:"50%",display:"flex",alignItems:"center",gap:1},children:[d.jsx("div",{children:V?.avatar?V.avatar(t):null}),d.jsx(b.Typography,{variant:"body2",color:"textPrimary",children:V?.value(t)}),le&&d.jsx(b.Tooltip,{title:"Historial asesores",placement:"top",arrow:!0,children:d.jsx(b.IconButton,{size:"small",onClick:De=>P(De.currentTarget),sx:{ml:.5},disableRipple:!0,children:d.jsx(RS,{fontSize:"small",sx:{color:"#5C6372"}})})})]})]},G)})}),d.jsx(b.Divider,{sx:{my:2}})]}),d.jsx(b.Box,{px:2.5,pb:.5,children:d.jsxs(b.Typography,{children:[d.jsx("span",{style:{fontWeight:800},children:"Última actividad"}),!$&&" por solicitud",":"]})}),d.jsxs(b.Box,{sx:{px:2.5,pt:0,gap:2,flex:1,overflowY:"auto",display:"flex",flexDirection:"column",pb:6,maxHeight:{xs:"140px",md:"100%"}},children:[be.length===0&&d.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:"Sin actividad registrada."}),d.jsxs(b.Box,{children:[be?.map((V,G)=>{const le=Q(V),De=ZS(V.comentario||"");return d.jsxs(b.Box,{sx:{pb:1.5},children:[d.jsxs(b.Stack,{direction:"row",spacing:1,alignItems:"center",justifyContent:"space-between",sx:{mb:.75},children:[d.jsx(b.Typography,{variant:"subtitle2",sx:{color:"#5C6372"},children:V.tipo||"Evento"}),d.jsx(b.Chip,{size:"small",label:V.auto!=null?`${V.auto}`:"—",sx:{bgcolor:"#336be1",color:"#fff",height:20}})]}),De?d.jsx(b.Typography,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.5,mb:.75},children:De}):null,d.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[V?.ImgAsesor!=null?d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},alt:ve(le),src:V?.ImgAsesor}):d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},children:ve(le)}),d.jsxs(b.Stack,{spacing:0,children:[d.jsx(b.Typography,{variant:"body2",fontWeight:600,children:le}),d.jsx(b.Typography,{variant:"caption",color:"text.secondary",children:HS(V.fecAlta)})]})]}),G<be.length-1&&d.jsx(b.Divider,{sx:{mt:1.25}})]},V.SegID??G)}),ie.length>D&&d.jsx(b.Box,{sx:{mt:1},children:d.jsx(b.Button,{onClick:()=>pe(V=>!V),size:"small",sx:{textTransform:"none",px:0,color:"#336BE1","&:hover":{background:"transparent",textDecoration:"underline"}},children:ae?"Ver menos":`Ver más (${ke})`})})]})]}),d.jsx(b.Menu,{anchorEl:M,open:K,onClose:()=>P(null),TransitionComponent:b.Fade,MenuListProps:{disablePadding:!0},PaperProps:{sx:{width:320,p:0,overflow:"hidden"}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[d.jsx(b.Box,{sx:{position:"sticky",top:0,zIndex:1,px:1.5,py:1,fontWeight:700,bgcolor:"background.paper",borderBottom:"1px solid",borderColor:"divider"},children:"Historial asesores"}),d.jsxs(b.Box,{sx:{overflowY:"auto",py:.5,maxHeight:200},children:[ne.length===0&&d.jsx(b.Box,{sx:{px:1.5,py:1},children:d.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:"Sin registros"})}),ne.map((V,G)=>{const le=LS(V),De=$S(V.FechaBaja??V.FechaAsignacion);return d.jsx(b.Box,{sx:{px:1,py:.75},children:d.jsxs(b.Stack,{direction:"row",alignItems:"center",spacing:1,children:[d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},src:V?.ImgAsesor??void 0,children:zS(le)}),d.jsx(b.Box,{sx:{flex:1,minWidth:0},children:d.jsx(b.Typography,{variant:"body2",noWrap:!0,children:le})}),d.jsx(b.Typography,{variant:"caption",color:"text.secondary",sx:{whiteSpace:"nowrap"},children:De})]})},G)})]})]})})]}),N?d.jsxs(b.Box,{sx:{flex:1,minWidth:0,overflow:"hidden",position:"relative"},children:[d.jsx(b.Box,{sx:{position:"absolute",top:18,left:24,zIndex:10,pointerEvents:"auto"},children:d.jsx(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:d.jsx(b.Button,{onClick:$e,sx:{backgroundColor:"#2571d6",minWidth:36,minHeight:36,p:.5,borderRadius:"8px",color:"#fff",boxShadow:3,"&:hover":{backgroundColor:"#2074e3"}},children:d.jsx(FS,{fontSize:"medium"})})})}),$&&d.jsx("iframe",{src:$,width:"100%",height:"100%",onLoad:Pe,style:{border:0}})]}):d.jsxs(b.Box,{sx:{width:"100%",minHeight:0,overflowY:"auto"},children:[d.jsx(b.Box,{sx:{mt:{xs:1.5,md:3}},children:d.jsxs(b.Box,{sx:{mt:3,display:"flex",flexDirection:"column",gap:4,padding:"0 20px 0 20px"},children:[d.jsx(b.Typography,{variant:"h4",sx:{fontWeight:800,textAlign:"center",mb:1,letterSpacing:.2},children:"Solicitudes"}),d.jsxs(b.Stack,{direction:{xs:"column",md:"column"},spacing:1.5,alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",sx:{mb:1.5},children:[d.jsxs(b.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",sx:{flexWrap:"wrap"},children:[d.jsx(b.TextField,{size:"small",placeholder:"Buscar por vehículo",value:k,onChange:V=>I(V.target.value),InputProps:{endAdornment:d.jsx(MS,{fontSize:"small",sx:{color:"#b6afaf"}})},sx:{minWidth:220}}),d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,position:"relative"},children:[d.jsxs(b.Stack,{direction:"row",spacing:1.1,position:"absolute",bottom:48,left:0,alignItems:"center",children:[d.jsx(b.FormControlLabel,{label:d.jsx(b.Typography,{sx:{fontSize:15,fontWeight:600,marginLeft:0},children:"Por fecha"}),labelPlacement:"start",control:d.jsx(b.Checkbox,{checked:L,onChange:V=>ce(V.target.checked),size:"small",sx:{p:.3,"& .MuiSvgIcon-root":{fontSize:19},color:"#bab4b4"}}),sx:{ml:0,"& .MuiFormControlLabel-label":{marginRight:0}}}),d.jsx(b.Typography,{sx:{fontSize:15,paddingLeft:.4},children:"De cita"})]}),d.jsxs(b.Stack,{direction:"row",spacing:1,children:[d.jsx(b.TextField,{size:"small",type:"date",label:"Desde",InputLabelProps:{shrink:!0},value:Ae,onChange:V=>B(V.target.value),disabled:!L,sx:{width:170}}),d.jsx(b.TextField,{size:"small",type:"date",label:"Hasta",InputLabelProps:{shrink:!0},value:J,onChange:V=>ye(V.target.value),disabled:!L,sx:{width:170}})]})]}),d.jsx(b.IconButton,{onClick:V=>kt(V.currentTarget),disableRipple:!0,sx:{border:"1px solid #d4d7de",borderRadius:2,width:40,height:40,mt:2},children:d.jsx(IS,{})}),Ja&&d.jsx(b.Button,{variant:"outlined",onClick:oi,disableRipple:!0,sx:{height:40,textTransform:"none",borderColor:"#d4d7de",color:"#333",mt:2},children:"Limpiar filtros"}),d.jsxs(b.Button,{variant:"outlined",sx:{height:40,textTransform:"none",borderColor:"none",color:"#fff",backgroundColor:"#1e5bce","&:hover":{backgroundColor:"#1e5bce",boxShadow:"none"},mt:2},onClick:()=>{x?.(t)},disableRipple:!0,children:[d.jsx(Gf,{sx:{color:"#fff",fontSize:24,paddingRight:.6}}),"Crear Solicitud"]})]}),d.jsx(NS,{sections:X,detailColumns:[],getDetailColumns:tc,onRowClick:Ee})]})]})}),d.jsx(b.Menu,{anchorEl:Ze,open:Dt,onClose:()=>kt(null),TransitionComponent:b.Fade,PaperProps:{sx:{p:1.5,width:260,borderRadius:2,boxShadow:3}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d.jsxs(b.Stack,{spacing:1.5,paddingX:1.5,paddingY:1,children:[d.jsx(b.Typography,{variant:"subtitle2",sx:{fontWeight:700,color:"#070C10"},children:"Filtro"}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Estatus"}),d.jsx(b.RadioGroup,{value:zt,onChange:V=>lr(V.target.value),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos","Sin Asignar","En prospección","Proceso de Compra","En espera de Unidad","Auto Facturado","Rechazadas","Finalizadas sin Venta","Finalizadas con Venta","En Proceso"].map(V=>d.jsx(b.FormControlLabel,{value:V,control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:V},V))})]}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Actividades"}),d.jsx(b.RadioGroup,{value:Jt,onChange:(V,G)=>Ar(G),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos",...wo].map(V=>d.jsx(b.FormControlLabel,{value:V,sx:{alignItems:"start"},control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:V},V))})]}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Nivel de interés"}),d.jsx(b.RadioGroup,{value:Ir,onChange:(V,G)=>Mr(G),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos",...xo].map(V=>d.jsx(b.FormControlLabel,{value:V,control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:V},V))})]})]})})]})]})})}const qf={tableClientes:"_tableClientes_acwe7_1",tableResponsive:"_tableResponsive_acwe7_1"};function Kf(e,n,t){const{fields:r,order:o=["nombreCliente","email","acciones"],header:s={},cells:i={},hide:a={},actions:c}=n,l=c??{},u=l.show??{},f=l.handlers??{},p=l.accessors??{},g=l.icons??{},m=l.className??"d-flex flex-row gap-2 align-items-center ",h=l.tooltip??{},x=g.view??d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",style:{fill:"#070c10"},children:[d.jsx("path",{d:"M18.6,6.3c-3.9-3-9.3-3-13.2,0-1.9,1.5-3.2,3.5-3.9,5.7.7,2.3,2,4.3,3.9,5.7,1.9,1.5,4.2,2.3,6.6,2.3,2.4,0,4.7-.8,6.6-2.3,1.9-1.5,3.2-3.5,3.9-5.7-.7-2.3-2-4.3-3.9-5.7ZM17.2,12.1c0,2.9-2.5,5.3-5.4,5.2-2.9,0-5.3-2.5-5.2-5.4,0-2.9,2.5-5.3,5.4-5.2,2.9,0,5.3,2.4,5.2,5.3,0,0,0,0,0,0Z"}),d.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),S={nombreCliente:{key:"nombreCliente",header:s.nombreCliente??"Cliente",accessor:z=>z[r.nombreCliente],cell:i.nombreCliente,width:190},email:{key:"email",header:s.email??"Correo",accessor:z=>z[r.email],cell:i.email??(z=>{const H=String(z[r.email]??"");return H?d.jsx("a",{href:`mailto:${H}`,children:H}):d.jsx("span",{className:"text-muted",children:"—"})}),width:230},acciones:a.acciones?void 0:{key:"acciones",header:"",cell:i.acciones??(z=>{const H=Za(u.whatsapp,z,!0),v=Za(u.email,z,!0),R=Za(u.view,z,!0),A=p.phone?.(z),$=p.email?.(z),Z=we=>{if(we.stopPropagation(),f.onWhatsApp)return f.onWhatsApp(z);if(!A)return;const Y=p.countryCode??"52",Q=TS(String(A));typeof window<"u"&&window.open(`https://wa.me/${Y}${Q}`,"_blank")},ne=we=>{if(we.stopPropagation(),f.onEmail)return f.onEmail(z);$&&typeof window<"u"&&(window.location.href=`mailto:${$}`)},oe=we=>{we.stopPropagation(),f.onView&&f.onView(z)};return d.jsxs("div",{className:m,children:[H&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.whatsapp??"WhatsApp",onClick:Z,style:{width:24,height:24},children:d.jsx("img",{src:kS,alt:"WhatsApp"})}),v&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.email??"Email",onClick:ne,style:{width:24,height:24},children:d.jsx("img",{src:DS,alt:"Email"})}),R&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.view??"Ver detalle",onClick:oe,style:{width:24,height:24},children:x})]})}),width:120}},_=Object.values(S).filter(z=>!!z),T=(e??[]).filter(z=>!!z?.key),C=new Map;for(const z of _)C.set(String(z.key),z);for(const z of T)C.set(String(z.key),z);const D=[..._.map(z=>String(z.key)),...T.map(z=>String(z.key))],M=Array.from(new Set(o.map(z=>String(z)).filter(z=>C.has(z)))),P=D.filter(z=>!M.includes(z)),K=[...M,...P],N="acciones";if(C.has(N)){const z=K.filter(H=>H!==N);K.splice(0,K.length,...z,N)}return K.map(z=>C.get(z))}function JS(e){const{rows:n,columns:t,clientSort:r=!0,defaultSort:o,minWidth:s=1100,rowKey:i=AS,defaults:a,detailConfig:c,extraSections:l,normalTableColumns:u,normalTable:f,onRowClick:p,activityHistory:g,advisorHistory:m,forceOpenDetailFor:h,closeDetailFor:x,onRequestEdit:S,searchFilter:_,solicitudesNuevos:T,solicitudesPrueba:C,solicitudesServicio:D,solicitudesSeminuevos:M,onCreateSolicitud:P,isCrmMode:K,onSolicitudBaseUrl:N,onIframeClose:z,reloadInfo:H}=e,[v,R]=y.useState(o??null),[A,$]=y.useState({open:!1,customer:null}),[Z,ne]=y.useState([]),oe=re=>{$({open:!0,customer:re})},we=re=>{p?.(re),$({open:!0,customer:re})},Y=()=>{$({open:!1,customer:null}),x?.()},Q=y.useMemo(()=>a?Kf(t??[],a):Kf(t??[],{fields:{},order:[]}),[t,a]),ve=y.useMemo(()=>{if(!r||!v)return n;const re=Q.find(ae=>ae.key===v.key);if(!re)return n;const ie=[...n];return ie.sort((ae,pe)=>{const be=Ha(re,ae,0),ke=Ha(re,pe,0),_e=ES(be,ke);return v.direction==="asc"?_e:-_e}),ie},[n,Q,v,r]),me=y.useMemo(()=>{const re=c?.getCustomerId;return ie=>{const ae=re?.(ie)??ie?.Id_cliente??ie?.CliID??ie?.id??ie?.ID??ie?.Id??"";return String(ae)}},[c]);return y.useEffect(()=>{if(!A.open||!A.customer)return;const re=me(A.customer);if(!re)return;const ie=(n??[]).find(ae=>me(ae)===re);ie&&ie!==A.customer&&$(ae=>({...ae,customer:ie}))},[n,A.open,A.customer,me]),y.useEffect(()=>{h&&oe(h)},[h]),d.jsxs("div",{children:[d.jsx("div",{className:`${qf.tableClientes} back-white rounded-3 shadow-main mt-4 mb-4`,children:d.jsx("div",{className:`${qf.tableResponsive} table-responsive`,children:d.jsxs("table",{className:"table table-hover align-middle mb-0",children:[d.jsx("thead",{children:d.jsx("tr",{children:Q.map(re=>d.jsx("th",{style:{fontWeight:600,width:re.width,paddingTop:"20px",paddingBottom:"20px",textAlign:re.align??"left"},children:re.header},re.key))})}),d.jsx("tbody",{children:ve.map((re,ie)=>d.jsx("tr",{onClick:()=>we?.(re),role:"button",tabIndex:0,onKeyDown:ae=>{(ae.key==="Enter"||ae.key===" ")&&we?.(re)},style:{cursor:"pointer"},children:Q.map((ae,pe)=>{const be=ae.Component?d.jsx(ae.Component,{row:re,index:ie}):ae.cell?ae.cell(re,ie):(()=>{const ke=Ha(ae,re,ie);return ke==null||ke===""?"":String(ke)})();return d.jsx("td",{style:{paddingTop:"20px",paddingBottom:"20px",textAlign:ae.align??"left"},children:be},`${String(ae.key)}-${pe}`)})},i(re,ie)))})]})})}),A.open&&d.jsx(XS,{open:A.open,onClose:Y,customer:A.customer,fields:c?.dynamicFields,header:c?.header,extraSections:l,normalTableColumns:u,normalTable:f,history:g,advisorHistory:m,onRequestEdit:re=>{Y(),S?.(re)},searchFilter:_,solicitudesNuevos:T,solicitudesPrueba:C,solicitudesServicio:D,solicitudesSeminuevos:M,onCreateSolicitud:P,isCrmMode:K,onSolicitudBaseUrl:N,onIframeClose:z,reloadInfo:H})]})}const Qf=se.forwardRef(({sx:e,...n},t)=>d.jsx(b.InputBase,{inputRef:t,...n,sx:{height:48,px:1.5,width:"100%",maxWidth:"none",bgcolor:"#EBEEF0",borderRadius:2,border:"1px solid transparent","&:hover":{borderColor:"transparent"},"& .MuiInputBase-input::placeholder":{opacity:.7},...e}}));Qf.displayName="SoftInput";const eC=ct(d.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline");function tC({message:e}){return e?d.jsxs(b.Box,{role:"alert",sx:{mt:1,display:"flex",alignItems:"center",gap:1,bgcolor:"#fdeaea",border:"1px solid rgb(253, 237, 237)",color:"#842029",borderRadius:1,px:2,py:1.25},children:[d.jsx(eC,{fontSize:"small",sx:{color:"rgb(211, 47, 47)"}}),d.jsx("span",{style:{color:"rgb(95, 33, 32)",fontSize:14,fontWeight:"500"},children:e})]}):null}function rC(e){if(e.required)return e.required===!0?"El campo es obligatorio.":e.required}function Ka(e,n){const t=rC(e);return t?n?.isArray?{required:t,validate:r=>Array.isArray(r)&&r.length>0||t}:{required:t,validate:r=>r!==""&&r!==null&&r!==void 0||t}:{}}const Xf={"& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},width:"100%"},nC={mb:1,fontWeight:600,color:"#1C1C1D","&.Mui-focused":{color:"#1C1C1D !important"},"&.Mui-error":{color:"#1C1C1D !important"}};function Qa({label:e,errorMsg:n,helperText:t,children:r,sx:o}){return d.jsxs(b.FormControl,{fullWidth:!0,error:!!n,sx:o,className:"1- FieldWrapper",children:[d.jsx(b.FormLabel,{sx:nC,children:e}),r,d.jsx(tC,{message:n||t})]})}function oC(e,n){const{register:t,formState:{errors:r}}=n,o={...Ka(e)};e.minLength&&(o.minLength={value:e.minLength,message:`El campo espera minimo ${e.minLength} caracteres`}),e.maxLength&&(o.maxLength={value:e.maxLength,message:`El campo espera maximo ${e.maxLength} caracteres`}),e.pattern&&(o.pattern={value:e.pattern,message:"Formato inválido"});const s=e.type==="email";s&&!o.pattern&&(o.pattern={value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Correo electrónico inválido"});const i=/[A-Za-zÁÉÍÓÚÜÑáéíóúüñ\s'.-]/g,a=/[0-9]/g,c=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Home","End","Escape","Enter"]),l=C=>e.onlyNumbers?(C.match(a)??[]).join(""):e.onlyLetters?(C.match(i)??[]).join(""):C,u=(C,D)=>c.has(C)||D?!0:e.onlyNumbers?/^[0-9]$/.test(C):e.onlyLetters?/^[A-Za-zÁÉÍÓÚÜÑáéíóúüñ\s'.-]$/.test(C):!0,f=r[e.name]?.message,p=t(e.name,o),g=(e.inputProps&&typeof e.inputProps.maxLength=="number"?e.inputProps.maxLength:void 0)??e.maxLength,m=C=>{u(C.key,C.ctrlKey||C.metaKey)||C.preventDefault()},h=C=>{const D=C.data??null;D!=null&&(e.onlyNumbers&&/[^0-9]/.test(D)&&C.preventDefault(),e.onlyLetters&&/[^A-Za-zÁÉÍÓÚÜÑáéíóúüñ ]/.test(D)&&C.preventDefault())},x=C=>{const D=C.clipboardData.getData("text"),M=l(D);if(M!==D){C.preventDefault();const P=C.target,K=P.selectionStart??P.value.length,N=P.selectionEnd??P.value.length;P.setRangeText(M,K,N,"end"),P.dispatchEvent(new Event("input",{bubbles:!0}))}},S=C=>{const D=l(C.target.value);D!==C.target.value&&(C.target.value=D),g&&C.target.value.length>g&&(C.target.value=C.target.value.slice(0,g)),p.onChange(C)},_={...e.inputProps,...s?{inputMode:"email",autoComplete:"email"}:{},maxLength:g,onKeyDown:m,onBeforeInput:h,onPaste:x,onInvalid:C=>C.preventDefault()},T=e.onlyNumbers||s?"text":e.type??"text";return d.jsx(Qa,{label:e.label,errorMsg:f,helperText:e.helperText,sx:Xf,children:d.jsx(Qf,{placeholder:e.placeholder,type:T,inputProps:_,...p,onChange:S,sx:{width:"100%",maxWidth:"none"},className:"SoftInputData"})})}function sC(e,n){const{control:t}=n,r=!!e.multiple;return d.jsx(Ht,{name:e.name,control:t,rules:Ka(e,{isArray:r}),render:({field:o,fieldState:s})=>d.jsx(Qa,{label:e.label,errorMsg:s.error?.message,helperText:e.helperText,sx:Xf,children:d.jsxs(b.Select,{...o,multiple:r,displayEmpty:!0,sx:{height:48,backgroundColor:"#EBEEF0","& .MuiSelect-select":{display:"flex",alignItems:"center",py:0}},className:"2-SoftInputData",children:[!r&&d.jsx(b.MenuItem,{value:"",disabled:!0,children:"Selecciona…"}),e.options.map(i=>d.jsx(b.MenuItem,{value:i.value,children:i.label},String(i.value)))]})})})}function iC(e,n){return d.jsx(Ht,{name:e.name,control:n.control,rules:Ka(e),render:({field:t,fieldState:r})=>d.jsx(Qa,{label:e.label,errorMsg:r.error?.message,helperText:e.helperText,children:d.jsx(b.RadioGroup,{row:!0,...t,className:"3-RadioFieldRender",children:e.options.map(o=>d.jsx(b.FormControlLabel,{value:o.value,control:d.jsx(b.Radio,{}),label:o.label},String(o.value)))})})})}function Jf(e,n){if(e.render)return e.render(n);switch(e.kind){case"text":return oC(e,n);case"select":return sC(e,n);case"radio":return iC(e,n);default:return null}}function aC(e,{initialPerPage:n=25,perPageOptions:t=[10,25,50,100,"Todos"],onPageChange:r,onPerPageChange:o,scrollTop:s,deps:i=[]}={}){const a=Array.isArray(e)?e:[],[c,l]=y.useState(1),[u,f]=y.useState(n),{currentItems:p,totalPages:g,showingFrom:m,showingTo:h,totalItems:x}=y.useMemo(()=>{const T=a.length,C=u==="Todos"?1/0:Number(u),D=C===1/0?1:Math.max(1,Math.ceil(T/C)),M=Math.min(c,D),P=C===1/0?T:M*C,K=C===1/0?0:P-C;return{currentItems:C===1/0?a:a.slice(K,P),totalPages:D,showingFrom:T===0?0:K+1,showingTo:C===1/0?T:Math.min(P,T),totalItems:T}},[a,c,u]),S=T=>{const C=Math.max(1,Math.min(T,g||1));l(C),r?.(C),s?.()};return{currentItems:p,totalPages:g,showingFrom:m,showingTo:h,totalItems:x,currentPage:c,itemsPerPage:u,perPageOptions:t,goTo:S,next:()=>S(c+1),prev:()=>S(c-1),setItemsPerPage:T=>{f(T),o?.(T),l(1),s?.()},setCurrentPage:S}}const cC=ct(d.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"NavigateBefore"),lC=ct(d.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),uC=({currentPage:e,totalPages:n,onPageChange:t,itemsPerPage:r,onItemsPerPageChange:o,itemsPerPageOptions:s,showingFrom:i,showingTo:a,totalItems:c})=>{const l=b.useTheme(),u=b.useMediaQuery(l.breakpoints.down("sm")),f=()=>{if(n<=1)return[1];const m=u?0:2,h=[],x=1,S=n,_=Math.max(x+1,e-m),T=Math.min(S-1,e+m);h.push(x),_>x+1&&h.push("...");for(let C=_;C<=T;C++)C>=x+1&&C<=S-1&&h.push(C);return T<S-1&&h.push("..."),h.push(S),h},p=m=>{const h=m.target.value;o(h)},g=Math.max(1,n);return d.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:"center",justifyContent:{xs:"center",sm:"space-between"},gap:2,my:0,py:2,borderTop:"#D3D4D5 1px solid",px:3},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",justifyContent:"center"},children:[d.jsx(b.IconButton,{onClick:()=>t(e-1),disabled:e<=1,size:"medium",sx:{"&:hover":{backgroundColor:"action.hover"}},"aria-label":"Página anterior",children:d.jsx(cC,{fontSize:"large"})}),f().map((m,h)=>m==="..."?d.jsx(b.Box,{sx:{px:1,display:"flex",alignItems:"center",fontSize:"1.1rem"},children:". . ."},`dots-${h}`):d.jsx(b.Button,{onClick:()=>t(m),size:"small",sx:{minWidth:36,height:36,fontSize:"1.05rem",p:1,borderRadius:"10px",backgroundColor:e===m?"primary.main":"transparent",fontWeight:e===m?700:400,color:e===m?"#fff":"#5C6372","&:hover":{backgroundColor:e===m?"primary.dark":"action.hover"},boxShadow:"none",border:"none",mx:.5},children:m},`p-${m}`)),d.jsx(b.IconButton,{onClick:()=>t(e+1),disabled:e>=g,size:"medium",sx:{"&:hover":{backgroundColor:"action.hover"}},"aria-label":"Página siguiente",children:d.jsx(lC,{fontSize:"large"})})]}),d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1.25,justifyContent:{xs:"center",sm:"flex-start"},mt:{xs:1,sm:0}},children:[d.jsx(b.Typography,{variant:"body2",children:"Mostrar"}),d.jsx(b.FormControl,{size:"small",sx:{minWidth:72},children:d.jsx(b.Select,{value:r,onChange:p,renderValue:m=>m==="Todos"?"Todos":String(m),children:s.map(m=>d.jsx(b.MenuItem,{value:m,children:m==="Todos"?"Todos":m},String(m)))})}),d.jsx(b.Typography,{variant:"body2",children:"por página"})]})]})};function dC(e){const{open:n,dataAdd:t,fields:r,onSubmit:o,onCancel:s,defaultValues:i,txtBtnGuardar:a,haveId:c=!1,itemsTable:l,filter:u,getId:f,renderRow:p,selectedIds:g,onSelectedChange:m,onSubmitAddData:h,initialSelectedIds:x=[],showAutosPanel:S}=e,_=Wd({mode:"onSubmit",reValidateMode:"onChange",criteriaMode:"all",shouldUnregister:!1,defaultValues:i});y.useEffect(()=>{i&&_.reset(i)},[i,_]);const[T,C]=y.useState(""),[D,M]=y.useState(x),P=Array.isArray(g)&&!!m,K=P?g:D,N=O=>{const ee=typeof O=="function"?O(K):O;P?m(ee):M(ee)},z=y.useCallback(O=>f?f(O):O?.IdAuto,[f]),H=y.useMemo(()=>{const O=new Map;return(l??[]).forEach((ee,xe)=>O.set(z(ee),xe)),O},[l,z]),v=y.useRef(new Set),R=y.useMemo(()=>{const O=new Map;return(l??[]).forEach(ee=>O.set(f?f(ee):ee?.IdAuto,ee)),O},[l,f]),A=y.useMemo(()=>(r??[]).filter(O=>!!O.required).map(O=>O.name),[r]),$=Dd({control:_.control,name:A}),Z=O=>O==null?!1:typeof O=="string"?O.trim().length>0:Array.isArray(O)?O.length>0:typeof O=="number"?!Number.isNaN(O):typeof O=="object"?Object.keys(O).length>0:!0,ne=y.useMemo(()=>A.length?$?.every(Z)??!1:!0,[$,A]),{handleSubmit:oe,formState:{isSubmitting:we,isDirty:Y,isValid:Q}}=_,ve=u??((O,ee)=>JSON.stringify(O).toLowerCase().includes(ee.toLowerCase())),me=y.useMemo(()=>T.trim()?l?.filter(O=>ve(O,T)):l,[l,T,ve]),re=y.useMemo(()=>{if(!me)return me;const O=v.current,ee=[...me];return ee.sort((xe,Ae)=>{const B=O.has(z(xe))?0:1,J=O.has(z(Ae))?0:1;if(B!==J)return B-J;const ye=H.get(z(xe))??0,Ze=H.get(z(Ae))??0;return ye-Ze}),ee},[me,H,z]),{currentItems:ie,totalPages:ae,showingFrom:pe,showingTo:be,totalItems:ke,currentPage:_e,itemsPerPage:Qe,perPageOptions:j,goTo:U,setItemsPerPage:he}=aC(re,{initialPerPage:25,perPageOptions:[10,25,50,100,"Todos"],deps:[T],scrollTop:()=>{}}),ge=O=>{const ee=R.get(O)??null;N([O]),h?.({items:ee})},Me=O=>K.includes(O),Ct=async O=>{try{await o?.(O),_.reset(_.getValues())}catch(ee){console.error("Error al enviar AddCliente:",ee)}},bt=y.useMemo(()=>{const O=new Map;return(r??[]).forEach(ee=>O.set(String(ee.name),ee)),O},[r]),gt=(O,ee)=>{const xe=bt.get(String(O));if(!xe)return null;const Ae={xs:12,...xe.grid,...ee||{}};return d.jsx(b.Grid,{item:!0,...Ae,children:xe.render?xe.render(_):Jf(xe,_)},`fld-${String(O)}`)},k=S??(e.haveId?"edit":"new"),I=k!=="onlyCars",L=k==="new"||k==="onlyCars",ce=K?.length>0,te=k==="onlyCars"?ce:e.haveId?ne&&Y||ce:ne&&ce;return d.jsx(b.Dialog,{open:n,onClose:s,maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{height:{xs:"100dvh",md:L?"90vw":"auto"},maxWidth:{xs:"100vw",md:L?"98vw":"50%"},overflow:"hidden",display:"flex",flexDirection:"column",borderRadius:{xs:0,md:3}}},children:d.jsx(b1,{..._,children:d.jsxs(b.Box,{component:"form",noValidate:!0,onSubmit:oe(Ct),display:"flex",flexDirection:{xs:"column",md:"row"},width:"100%",height:"100%",overflow:{xs:"auto",md:"unset"},position:"relative",children:[I&&d.jsxs(b.Box,{sx:{width:{xs:"100%",md:c?"100%":394},maxWidth:{xs:"100%",md:c?"100%":394},boxShadow:{xs:"none",md:c?"none":"2px 0px 8px #40404024"},borderRight:{xs:"none",md:c?"none":"1px solid #EBEEF0"},bgcolor:"background.paper",paddingBottom:3,mx:{xs:0,md:c?"auto":0},position:"relative"},children:[d.jsxs(b.Box,{p:{xs:2,md:2},height:"100%",width:"100%",children:[d.jsx(b.Typography,{fontWeight:700,fontSize:20,children:t.title}),d.jsxs(b.Box,{sx:{flex:1,height:"100%",overflowY:"auto",paddingBottom:10},children:[d.jsx(b.Typography,{fontSize:"18px",mt:2.5,fontWeight:500,children:t.subTitle}),d.jsx(b.Box,{mt:2,display:"flex",flexDirection:"column",width:"100%",gap:2,children:Array.isArray(e.formLayout)&&c?e.formLayout.map((O,ee)=>d.jsx(b.Grid,{container:!0,spacing:2,alignItems:"flex-start",wrap:"wrap",width:"100%",children:O.map((xe,Ae)=>{const B=typeof xe=="string"?{name:xe}:xe;return B.hidden?.(_)?null:gt(B.name,B.grid)})},`row-${ee}`)):d.jsx(b.Grid,{container:!0,spacing:2,width:"100%",children:r?.map((O,ee)=>{const xe=O.grid??{xs:12,md:12};return d.jsx(b.Grid,{item:!0,...xe,children:O.render?O.render(_):Jf(O,_)},`${String(O.name)}-${ee}`)})})})]})]}),d.jsx(b.Box,{sx:{position:"absolute",zIndex:O=>O.zIndex.modal+1,bottom:0,width:"100%",borderRadius:2,boxShadow:{xs:"0",md:"0 -8px 8px -6px #0003"},p:1,backgroundColor:"#fff"},children:d.jsx(b.Box,{display:"flex",alignItems:"center",children:d.jsx(b.Box,{display:"flex",gap:1.5,width:"100%",justifyContent:c?"flex-end":"center",children:d.jsx(b.Button,{type:"submit",variant:"contained",disabled:we||!te,sx:{backgroundColor:"#336BE1",color:"#fff",borderColor:"transparent",height:48,fontSize:15,textTransform:"none",fontWeight:"400",paddingX:5,width:c?"160px":"100%"},children:a})})})})]}),L&&d.jsx(b.Box,{flex:1,display:"flex",flexDirection:"column",minWidth:0,sx:{height:"100%"},children:d.jsx(b.Box,{mt:1,sx:{flex:1,display:"flex",flexDirection:"column",height:"100%"},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[d.jsxs(b.Box,{p:3,sx:{borderBottom:1,borderBottomColor:"#D3D4D5",position:"sticky",top:0,zIndex:1,bgcolor:"#fff",flexDirection:{sm:"row",xs:"column"}},display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:4,children:[d.jsx(b.TextField,{value:T,onChange:O=>C(O.target.value),placeholder:"Buscar marca, modelo, vin...",InputProps:{endAdornment:d.jsx(b.InputAdornment,{position:"start",children:d.jsx(sy,{})}),disableUnderline:!0},variant:"standard",sx:{maxWidth:360,width:"100%",backgroundColor:"#EBEEF0",paddingX:"16px",paddingY:"10px"}}),d.jsx(b.Box,{display:"flex",gap:2,alignItems:"center",sx:{marginTop:{sm:0,xs:2}},children:d.jsx(b.Box,{onClick:s,sx:{cursor:"pointer",position:"absolute",top:0,right:10},display:{xs:"none",md:"block"},children:d.jsx(sn,{sx:{color:"#070C10",fontSize:24}})})}),S=="onlyCars"&&d.jsx(b.Box,{display:"flex",alignItems:"center",justifyContent:"center",children:d.jsx(b.Box,{display:"flex",gap:1.5,width:"100%",children:d.jsxs(b.Button,{type:"submit",variant:"contained",disabled:we||!te,sx:{backgroundColor:"#336BE1",color:"#fff",borderColor:"transparent",height:48,fontSize:15,textTransform:"none",fontWeight:"400",paddingX:5,width:"100%"},children:[d.jsx(Gf,{sx:{color:we||!te?"gray":"#fff",fontSize:26,paddingRight:.6}}),"Crear Solicitud"]})})})]}),d.jsx(b.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",overflowX:"auto",padding:0,height:"100%","&::-webkit-scrollbar:horizontal":{display:"none"},"&::-webkit-scrollbar:vertical":{width:8}},children:d.jsx(b.Box,{sx:{minWidth:1150,width:"max(1150px, 100%)",paddingBottom:10},children:d.jsxs(b.List,{disablePadding:!0,sx:{borderColor:"transparent",padding:0},children:[ie?.map((O,ee)=>{const xe=f?f(O):ee,Ae=Me(xe);return d.jsx(b.Box,{sx:{borderBottom:"1px solid #D3D4D5",padding:0},children:d.jsx(b.ListItem,{disableGutters:!0,sx:{paddingTop:0,padding:0,m:0},children:d.jsx(b.ListItemButton,{onClick:()=>ge(xe),disableRipple:!0,sx:{padding:0},children:d.jsx(b.ListItemText,{disableTypography:!0,primary:p?p({item:O,selected:Ae,toggle:()=>ge(xe),index:ee}):null})})})},`${String(xe)}`)}),!ie?.length&&d.jsx(b.Box,{p:3,children:d.jsxs(b.Typography,{fontSize:14,color:"#5C6372",children:["Sin resultados para “",T,"”."]})})]})})}),d.jsx(b.Box,{sx:{position:"sticky",bottom:0,bgcolor:"#fff"},children:d.jsx(uC,{currentPage:_e,totalPages:ae,onPageChange:U,itemsPerPage:Qe,onItemsPerPageChange:he,itemsPerPageOptions:j,showingFrom:pe,showingTo:be,totalItems:ke})})]})})})]})})})}const fC=ct(d.jsx("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile"),Xa=/^[^\s@]+@[^\s@]+\.[^\s@]+$/i,ni=/[,\s;]+/g,Fr=e=>e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase(),Vr=(e,n)=>Array.from(new Set([...e,...n.map(t=>t.trim()).filter(Boolean)])),ep=(e,n)=>n?e.filter(t=>Fr(t)!==Fr(n)):e,pC=(e,n)=>e.filter(t=>!n.some(r=>Fr(r)===Fr(t)));function cr(e,n,t){if(t)return typeof t=="function"?t(e,n):e[t]}function hC(e,n){if(n)return!e||/^https?:\/\//i.test(n)?n:e+n}function mC({open:e,onClose:n,value:t,onChange:r,onRequestSend:o,customer:s,itemsSelects:i,renderItem:a,filterFields:c=[],multiSelectAutos:l=!0,imgCorreoSrc:u,baseURLImages:f,itemProps:p,defaultItemImageSrc:g}){const m=y.useRef(null),[h,x]=y.useState("idle"),S=y.useRef(e);y.useEffect(()=>{const B=S.current;e&&!B&&x("entering"),!e&&B&&x("exiting"),S.current=e},[e]),y.useEffect(()=>{if(h==="entering"){const ye=setTimeout(()=>x("idle"),320);return()=>clearTimeout(ye)}if(h==="exiting"){const ye=setTimeout(()=>x("idle"),220);return()=>clearTimeout(ye)}},[h]);const[_,T]=y.useState(""),[C,D]=y.useState(!1),[M,P]=y.useState(!1),[K,N]=y.useState(!1),[z,H]=y.useState(""),[v,R]=y.useState([]),A=K?v:t.selectedIds,$=()=>{R([...t.selectedIds]),H(""),N(!0)},Z=()=>{N(!1),R([])},ne=()=>{const B=new Set(bt.map((ye,Ze)=>String(cr(ye,Ze,p.id)))),J=v.filter(ye=>B.has(String(ye)));r({...t,selectedIds:J}),N(!1)},oe=(B,J)=>Fr(B??"")===Fr(J??"");function we(B,J,ye,Ze,kt){const Dt=J?B.some(lr=>oe(lr,J)):!1,zt=ye.length>0?ye.some(lr=>B.some(Jt=>oe(Jt,lr))):!1;Ze(Dt),kt(zt)}const Y=B=>{const J=typeof B=="function"?B(t.recipients):B;r({...t,recipients:J}),we(J,ie,pe,D,P)},Q=B=>r({...t,message:B}),ve=B=>r({...t,attachments:[...t.attachments,...B]}),me=B=>r({...t,attachments:t.attachments.filter(J=>J.name!==B)}),re=B=>{if(K)if(l){const J=new Set(v);J.has(B)?J.delete(B):J.add(B),R(Array.from(J))}else{const J=v.includes(B);R(J?[]:[B])}else if(l){const J=new Set(t.selectedIds);J.has(B)?J.delete(B):J.add(B),r({...t,selectedIds:Array.from(J)})}else{const J=t.selectedIds.includes(B);r({...t,selectedIds:J?[]:[B]})}},ie=y.useMemo(()=>(s?.Correo??"").trim(),[s]),ae=y.useMemo(()=>Array.isArray(s?.Asesores)?s.Asesores.filter(B=>B?.EmailAsesor&&B?.Activo):[],[s]),pe=y.useMemo(()=>ae.map(B=>(B.EmailAsesor??"").trim()).filter(Boolean),[ae]),be=y.useRef(!1);y.useEffect(()=>{if(e&&!be.current){let B=[];C&&ie&&(B=Vr(B,[ie])),M&&pe.length&&(B=Vr(B,pe)),Y(J=>Vr(J,B)),we(t.recipients,ie,pe,D,P),T(""),be.current=!0}e||(be.current=!1)},[e,C,M,ie,pe]);const ke=B=>{const J=ae.find(ye=>Fr(ye.EmailAsesor??"")===Fr(B));if(J){if(J.ImgAsesor)return d.jsx(b.Avatar,{src:J.ImgAsesor,alt:J.NombreAsesor});const ye=(J.NombreAsesor||"").trim(),Ze=(J.ApellidosAsesor||"").trim();return d.jsx(b.Avatar,{children:`${ye[0]??""}${Ze[0]??""}`.toUpperCase()})}return d.jsx(b.Avatar,{children:B[0]?.toUpperCase()})},_e=()=>{const B=_.trim();if(!B)return;const ye=B.split(ni).filter(Boolean).filter(Ze=>Xa.test(Ze));ye.length>0&&Y(Ze=>Vr(Ze,ye)),T("")},Qe=B=>{D(B),Y(J=>B&&ie?Vr(J,[ie]):ep(J,ie))},j=B=>{P(B),Y(J=>B?Vr(J,pe):pC(J,pe))},U=B=>{const J=Array.from(B.target.files||[]);ve(J.map(ye=>({name:ye.name,size:ye.size,file:ye}))),B.target.value=""},he=A[0],ge=y.useMemo(()=>!i||he===void 0?void 0:i.find((J,ye)=>String(cr(J,ye,p.id))===String(he)),[i,he,p.id]),Me=y.useMemo(()=>{if(!(!ge||!p.distributorId))return cr(ge,0,p.distributorId)},[ge,p.distributorId]);console.log("lockedDisId",Me);const Ct=y.useMemo(()=>ge?(p.distributorTitle?cr(ge,0,p.distributorTitle):void 0)??(Me!=null?String(Me):void 0):void 0,[ge,p.distributorTitle,Me]),bt=y.useMemo(()=>{const B=i??[];return Me==null||!p.distributorId?B:B.filter((J,ye)=>cr(J,ye,p.distributorId)==Me)},[i,Me,p.distributorId]),gt=y.useMemo(()=>{if(!z.trim())return bt;const B=z.toLowerCase();return bt.filter(J=>(c??[]).some(ye=>String(J?.[ye]??"").toLowerCase().includes(B)))},[bt,z,c]),k=y.useMemo(()=>{if(!i||!t.selectedIds.length)return[];const B=new Map;return i.forEach((J,ye)=>{B.set(String(cr(J,ye,p.id)),J)}),t.selectedIds.map(J=>B.get(String(J))).filter(Boolean)},[i,t.selectedIds,p.id]),I=B=>r({...t,selectedIds:t.selectedIds.filter(J=>String(J)!==String(B))}),L=()=>{let B=t.recipients;if(_.trim()){const Dt=_.split(ni).filter(zt=>Xa.test(zt));B=Vr(B,Dt),Y(B),T("")}const J=C?ie:"",ye=ae.find(Dt=>Dt?.Activo&&Dt?.EmailAsesor)?.EmailAsesor?.trim()??"";o?.({recipients:B,toClient:C,toAdvisor:M,tipoInt:C&&M?2:1,correoCliente:J,correoAsesor:M?ye:"",disIdLocked:Me}),n?.()},ce=y.useMemo(()=>{const J=_.split(ni).filter(Boolean).some(ye=>Xa.test(ye));return t.recipients.length>0||J},[t.recipients,_]),te=(t.selectedIds?.length??0)>0,O=t.message.trim().length>0,ee=ce&&te&&O,xe=b.useTheme(),Ae=b.useMediaQuery(xe.breakpoints.down("sm"));return d.jsxs(b.Drawer,{anchor:Ae?"bottom":"right",open:e,onClose:n,ModalProps:{keepMounted:!0,BackdropProps:{invisible:!Ae}},transitionDuration:{enter:320,exit:220},SlideProps:{direction:Ae?"up":"left",timeout:{enter:320,exit:220},easing:{enter:"cubic-bezier(0.22, 1, 0.36, 1)",exit:"cubic-bezier(0.4, 0, 1, 1)"}},PaperProps:{sx:{width:{xs:"100vw",sm:420},height:{xs:"85vh",sm:"auto"},maxHeight:{xs:"85vh",sm:"calc(100vh - 32px)"},left:{xs:0,sm:"auto"},right:{xs:0,sm:16},bottom:{xs:0,sm:16},top:{xs:"auto",sm:"auto"},borderRadius:{xs:"12px 12px 0 0",sm:2},boxShadow:6,overflow:"hidden"}},children:[d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",height:{xs:"100%",sm:"auto"},position:"relative",overflow:"auto"},children:[d.jsxs(b.Box,{sx:{p:2,pb:1,position:"sticky",top:0,zIndex:1,bgcolor:"#fff",borderBottom:"1px solid #E5E7EB"},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:2},children:[u?d.jsx("img",{src:u,alt:"Correo",style:{width:24,height:18}}):null,d.jsxs(b.Typography,{fontWeight:700,children:["Mensaje a"," ",s?`${s.Nombre??""} ${s.ApellidoP??""} ${s.ApellidoM??""}`.trim():"—"]})]}),d.jsx(b.IconButton,{onClick:n,size:"small",children:d.jsx(sn,{})})]}),d.jsx("div",{children:d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 10px",backgroundColor:"#EBEEF0",border:"1px solid #E5E7EB",borderRadius:8,flexWrap:"wrap"},children:[d.jsx("label",{style:{fontSize:14,fontWeight:600,marginRight:4},children:"Para:"}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",flex:1},children:[t.recipients.map(B=>d.jsx(b.Chip,{avatar:ke(B),label:B,onDelete:()=>Y(J=>ep(J,B)),size:"small",variant:"outlined",sx:{borderRadius:999,height:28}},B)),d.jsx("input",{type:"text",value:_,onChange:B=>T(B.target.value),onKeyDown:B=>{const J=B.key;J==="Enter"||J===","||J===";"||J===" "||J==="Tab"?(B.preventDefault(),_e()):J==="Backspace"&&!_&&t.recipients.length&&Y(Ze=>Ze.slice(0,-1))},onBlur:_e,onPaste:B=>{const ye=B.clipboardData.getData("text").split(ni).filter(Boolean);ye.length>1&&(B.preventDefault(),Y(Ze=>Vr(Ze,ye)),T(""))},placeholder:t.recipients.length?"":"correo@ejemplo.com",style:{flex:1,minWidth:140,border:"none",outline:"none",background:"transparent",fontSize:14,color:"#111827",padding:"4px 0"}})]})]})}),d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:2,mb:1.5},children:[d.jsx(b.FormControlLabel,{control:d.jsx(b.Checkbox,{checked:C,onChange:B=>Qe(B.target.checked),size:"small"}),label:"Cliente"}),ae.length!==0&&d.jsx(b.FormControlLabel,{control:d.jsx(b.Checkbox,{checked:M,onChange:B=>j(B.target.checked),size:"small"}),label:`Asesor${ae.length>1?"es":""}`})]})]}),d.jsx(b.Divider,{}),d.jsxs(b.Box,{p:2,children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},onClick:$,children:[d.jsx(b.Typography,{fontSize:12,fontWeight:600,sx:{textDecorationLine:"underline",cursor:"pointer"},children:"Selecciona el auto de seguimiento"}),Ct!=null&&d.jsx(b.Chip,{size:"small",label:`Distribuidora: ${Ct}`})]}),k.length>0?d.jsx(b.Box,{sx:{mt:1.5,display:"flex",gap:1,flexWrap:"wrap"},children:k.map((B,J)=>{const ye=cr(B,J,p.id),Ze=cr(B,J,p.title)??"",kt=cr(B,J,p.image),Dt=hC(f,kt);return d.jsx(b.Chip,{onDelete:()=>I(ye),label:d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.jsx(b.Box,{sx:{width:28,height:20,borderRadius:.8,bgcolor:"#e5e6e8",overflow:"hidden",flex:"0 0 auto"},children:Dt?d.jsx("img",{src:Dt,alt:Ze,style:{width:"100%",height:"100%",objectFit:"cover"}}):d.jsx("img",{src:g,alt:Ze,style:{width:"100%",height:"100%",objectFit:"cover"}})}),d.jsx("span",{style:{fontSize:12},children:d.jsx("b",{children:Ze})})]}),sx:{pl:.5,pr:.3,py:.2,borderRadius:2,".MuiChip-deleteIcon":{fontSize:18}},variant:"outlined"},String(ye))})}):d.jsx(b.Typography,{fontSize:13,color:"#5C6372",sx:{mt:.5},children:"Aún no has seleccionado autos."})]}),d.jsx(b.Divider,{}),d.jsxs(b.Box,{sx:{p:2},children:[d.jsx(b.TextField,{placeholder:"Escribe aquí tu mensaje...",value:t.message,onChange:B=>Q(B.target.value),multiline:!0,minRows:6,fullWidth:!0,sx:{mb:1.5}}),t.attachments.length>0&&d.jsx(b.List,{dense:!0,sx:{display:"flex",flexDirection:"column",gap:2,border:"none"},children:t.attachments.map(B=>d.jsxs(b.ListItem,{sx:{px:0,background:"#EAEBF2",borderRadius:2,paddingX:1},children:[d.jsx(b.ListItemText,{style:{gap:10,fontSize:15,color:"#5285F7",display:"flex",flexWrap:"wrap",flex:"none"},primary:B.name,secondary:B.size<1024?`${B.size} b`:B.size<1024*1024?`${(B.size/1024).toFixed(0)} kb`:`${(B.size/(1024*1024)).toFixed(1)} MB`,secondaryTypographyProps:{sx:{fontSize:12,color:"#64748B",fontWeight:500,mt:.25}},primaryTypographyProps:{noWrap:!0,width:"auto"}}),d.jsx(b.Tooltip,{title:"Quitar",children:d.jsx(b.IconButton,{edge:"end",onClick:()=>me(B.name),size:"small",children:d.jsx(sn,{fontSize:"small"})})})]},B.name))})]}),d.jsxs(b.Box,{sx:{position:{xs:"sticky",sm:"sticky"},bottom:0,bgcolor:"#fff",borderTop:"1px solid #E5E7EB",p:2,display:"flex",alignItems:"center",gap:2},children:[d.jsx("input",{ref:m,hidden:!0,type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.mp4,.pdf,.xlsx,.csv,.docx,.pptx,.txt",onChange:U}),d.jsx(b.Button,{startIcon:d.jsx(fC,{}),variant:"text",onClick:()=>m.current?.click(),sx:{color:"#5C6372"},children:"Adjuntar archivo"}),d.jsx(b.Box,{sx:{flex:1}}),d.jsx(b.Button,{variant:"contained",onClick:L,disabled:!ee,sx:{maxWidth:146,width:"100%",height:53,backgroundColor:"#336BE1"},children:"Enviar"})]})]}),d.jsxs(b.Dialog,{fullWidth:!0,maxWidth:"sm",fullScreen:Ae,open:K,onClose:Z,children:[d.jsxs(b.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1},children:["Selecciona tu auto de seguimiento",d.jsx(b.IconButton,{onClick:Z,size:"small",children:d.jsx(sn,{})})]}),d.jsxs(b.DialogContent,{children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.jsx(b.TextField,{placeholder:"Buscar...",fullWidth:!0,size:"small",value:z,onChange:B=>H(B.target.value),sx:{mb:2}}),Ct!=null&&d.jsx(b.Chip,{size:"small",label:`Distribuidora: ${Ct}`})]}),d.jsxs(b.Typography,{variant:"caption",fontWeight:600,children:["RESULTADOS (",gt.length,")"]}),d.jsxs(b.List,{sx:{p:0},children:[gt.map((B,J)=>{const ye=cr(B,J,p.id),Ze=A.includes(String(ye))||A.includes(ye),kt=Me==null||cr(B,J,p.distributorId)==Me;return d.jsx(b.ListItem,{disableGutters:!0,sx:{p:0,opacity:kt?1:.5},children:d.jsx(b.Box,{onClick:()=>kt&&re(ye),sx:{cursor:kt?"pointer":"not-allowed",p:.5,backgroundColor:Ze?"#e5f0ff":"transparent",width:"100%",borderBottom:"solid 1px #D3D4D5"},children:a?a(B,J):d.jsx("pre",{style:{margin:0},children:JSON.stringify(B,null,2)})})},String(ye))}),gt.length===0&&d.jsx(b.Box,{p:2,children:d.jsx(b.Typography,{children:"Tu búsqueda no generó resultados"})})]})]}),d.jsxs(b.DialogActions,{sx:{px:3,pb:2},children:[d.jsx(b.Button,{variant:"text",onClick:Z,sx:{color:"#5C6372"},children:"Cancelar"}),d.jsx(b.Button,{variant:"contained",onClick:ne,sx:{backgroundColor:"#336BE1"},children:"Guardar selección"})]})]})]})}ut.AddCliente=dC,ut.ApiProvider=o1,ut.AuthProvider=Oy,ut.Clientes=JS,ut.CustomSnackbar=Wf,ut.EventsProvider=xS,ut.ModalCorreo=mC,ut.MyCalendar=CS,ut.useAuth=ia,ut.useAuthRepository=Rs,ut.useEventRepository=xa,Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"})}));
|
|
182
|
+
`)}const GS={Todos:[],"Sin Asignar":["Sin Asignar"],"En prospección":["Prospección"],"Proceso de Compra":["Proceso de Compra"],"En espera de Unidad":["En Espera de Unidad"],"Auto Facturado":["Auto Facturado"],Rechazadas:["Rechazada","Rechazadas"],"Finalizadas sin Venta":["Sin Venta"],"Finalizadas con Venta":["Con Venta"],"En Proceso":["Asignada","Prospección","Sin Asignar","Proceso de Compra","En Espera de Unidad","Auto Facturado","Sin Atender"]},qS={Todos:[],"Selección y presentación de vehículos":["Selección y presentación de vehículos"],"Prueba de Manejo":["Prueba de Manejo"],"Valoración del Auto a cuenta y/o enganche":["Valoración del Auto a cuenta y/o enganche"],"Entrega de vehículo":["Entrega de vehículo"],"Negociación y Cierre":["Negociación y Cierre"]},KS={Todos:[],"Algo interesado":["Algo interesado"],Interesado:["Interesado"],"Muy interesado":["Muy interesado"],"Venta definitiva":["Venta definitiva"],"No sé":["No sé"]};function QS(e,n){switch(e){case"pruebas":return WS(n)??"—";case"servicio":return US(n)??"—";case"nuevos":case"seminuevos":default:return YS(n)??"—"}}function XS({open:e,onClose:n,customer:t,fields:r=[],header:o,extraSections:s,normalTable:i,normalTableColumns:a=[],history:c=[],advisorHistory:l=[],onRequestEdit:u,searchFilter:f,solicitudesNuevos:p=[],solicitudesPrueba:g=[],solicitudesServicio:m=[],solicitudesSeminuevos:h=[],onCreateSolicitud:x,isCrmMode:S=!1,onSolicitudBaseUrl:_,onIframeClose:T,reloadInfo:C}){if(!t)return null;const D=3,[M,P]=y.useState(null),K=!!M,[N,z]=y.useState(!1),[H,v]=y.useState(null),[R,A]=y.useState(c??[]),[$,Z]=y.useState(null),ne=y.useMemo(()=>[...l].sort((V,G)=>new Date(G.FechaAsignacion).getTime()-new Date(V.FechaAsignacion).getTime()),[l]);y.useEffect(()=>{c&&c.length&&A(c)},[c]);const oe=c?.length?c:R,we=o?.title??(V=>V?.Nombre||V?.name||"Sin título"),Y=o?.infoItems??[],Q=V=>V.nombreAsesor?.trim()||(V.Email?V.Email:"Sistema"),ve=V=>{const G=V||"",le=G.split(" ").filter(Boolean);return le.length>=2?(le[0][0]+le[1][0]).toUpperCase():(G[0]||"?").toUpperCase()},me=V=>V?.SolID??V?.solID??V?.SolId??V?.SOLID??null,re=y.useMemo(()=>!$||H==null?oe??[]:(oe??[]).filter(V=>{const G=me(V);return G!=null&&String(G)===String(H)}),[oe,$,H]),ie=y.useMemo(()=>[...re].sort((V,G)=>new Date(G.fecAlta).getTime()-new Date(V.fecAlta).getTime()),[re]),[ae,pe]=y.useState(!1),be=y.useMemo(()=>ae?ie:ie.slice(0,D),[ae,ie]),ke=Math.max(ie.length-D,0),_e=V=>String(V??"").normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().trim(),Qe=(V,G)=>_e(JSON.stringify(V)).includes(_e(G)),j=(V,G)=>f?f(V,G):Qe(V,G),U=(V,G)=>{const le=_e(G).split(/\s+/).filter(Boolean);return le.length?le.every(De=>j(V,De)):!0},[he,ge]=y.useState(""),[Me,Ct]=y.useState([]);y.useMemo(()=>i??[],[i]),y.useMemo(()=>{const V=he.trim();return V?(i??[]).filter(G=>U(G,V)):i??[]},[i,he]);const bt=b.useTheme(),gt=b.useMediaQuery(bt.breakpoints.down("md")),[k,I]=y.useState(""),[L,ce]=y.useState(!0),[te,O]=y.useState(!1),ee=new Date().toISOString().slice(0,10),xe=new Date(Date.now()-720*3600*1e3).toISOString().slice(0,10),[Ae,B]=y.useState(xe),[J,ye]=y.useState(ee),[Ze,kt]=y.useState(null),Dt=!!Ze,[zt,lr]=y.useState("Todos"),[Jt,Ar]=y.useState("Todos"),[Ir,Mr]=y.useState("Todos"),xo=["Algo interesado","Interesado","Muy interesado","Venta definitiva","No sé"],wo=["Selección y presentación de vehículos","Prueba de Manejo","Valoración del Auto a cuenta y/o enganche","Entrega de vehículo","Negociación y Cierre"],oi=()=>{I(""),ce(!1),O(!1),B(xe),ye(ee),lr("Todos"),Ar("Todos"),Mr("Todos")},Ja=y.useMemo(()=>(k??"").trim()!==""||zt!=="Todos"||Jt!=="Todos"||L||te||Ir!=="Todos",[k,zt,Jt,L,te,Ir]);function an(V){if(!V)return"";const G=new Date(V);if(isNaN(G.getTime()))return"";const le=String(G.getDate()).padStart(2,"0"),De=String(G.getMonth()+1).padStart(2,"0"),Je=String(G.getFullYear()).slice(-2);return`${le}/${De}/${Je}`}function si(V){const G=V?new Date(V):null;return G&&!isNaN(G.getTime())?G:null}function ii(V,G){let le=null;for(const De of V){const Je=si(G(De));if(Je){const Ge=Je.getTime();(le===null||Ge>le)&&(le=Ge)}}return le?new Date(le):null}function _o(V){const G=ii(V,le=>le.UltimoSeguimiento||le.FechaCita);return G?an(G.toISOString()):"—"}function ai(V){const G=(V??"").toLowerCase().trim();return G==="sin venta"||G==="con venta"||G==="rechazada"||G==="rechazadas"}function ci(V){return V.filter(G=>ai(G.EstatusDescripcion)).length}function So(V){return V.filter(G=>!ai(G.EstatusDescripcion)).length}const li=({progress:V,color:G})=>{if(!V)return d.jsx(qa,{current:0,total:0,color:G});const le=V.split("/").map(Number);if(le.length!==2||le.some(Ge=>Number.isNaN(Ge)))return d.jsx(qa,{current:0,total:0,color:G});const[De,Je]=le;return d.jsx(qa,{current:De,total:Je,color:G})};function ui(V){return[{key:"fecha",header:"Fecha",accessor:G=>an(G.Fecha),width:110},{key:"vehiculo",header:"Vehículo",accessor:G=>d.jsx(b.Tooltip,{title:G.Vehiculo??"",placement:"top",arrow:!0,children:d.jsx(b.Typography,{component:"span",sx:{fontSize:13,fontWeight:500,display:"block",maxWidth:260,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3,cursor:"default"},children:G.Vehiculo??"—"})}),width:260},{key:"estatus",header:"Estatus",accessor:G=>d.jsx(b.Typography,{sx:{fontWeight:800,fontSize:13},children:QS(V,G.IdEstatus)}),width:170},{key:"nivel",header:"Nivel de Interés",accessor:G=>{const{bg:le,color:De}=VS(G.NivelInteres);return d.jsx(b.Box,{sx:{display:"inline-block",px:1,py:.25,borderRadius:9999,bgcolor:le,color:De,fontSize:12,fontWeight:G.NivelInteres?800:500},children:G.NivelInteres??"—"})},width:150},{key:"asesor",header:"Asesor",accessor:G=>{const le=(G.Asesor??"").trim(),De=nc=>{if(!nc)return"";const gC=nc[0]?.toUpperCase()??"",vC=nc[1]?.toLowerCase()??"";return`${gC}${vC}`};if(!le)return d.jsx(b.Tooltip,{title:"",placement:"top",children:d.jsx(b.Typography,{sx:{fontWeight:700,fontSize:13,textAlign:"center"},children:"—"})});const Je=le.split(/\s+/),Ge=Je[0]??"",ot=Je[1]??"",It=De(Ge),Or=De(ot),rc=`${It}${Or}`||"—";return d.jsx(b.Tooltip,{title:le,placement:"top",children:d.jsx(b.Typography,{sx:{fontWeight:700,fontSize:13,textAlign:"center"},children:rc})})},width:120,align:"center"},{key:"origen",header:"Origen",accessor:G=>G.Origen??"—",width:120,align:"center"},{key:"actividad",header:"Actividad",accessor:G=>d.jsx(b.Tooltip,{title:G.Actividad??"",placement:"top",arrow:!0,children:d.jsxs(b.Box,{sx:{maxWidth:160,overflow:"hidden",display:"flex",gap:.5,alignItems:"center"},children:[G.Icon&&d.jsx("span",{style:{color:"#fff",backgroundColor:G.Color,borderRadius:100,alignItems:"center",justifyContent:"center",display:"flex",padding:3},children:d.jsx("i",{className:G.Icon})}),d.jsx(b.Typography,{component:"span",noWrap:!0,sx:{fontSize:13,fontWeight:500,display:"block",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3,cursor:(G.Actividad??"").length?"default":"inherit"},children:G.Actividad??"—"})]})}),width:180},{key:"avance",header:"Avance",accessor:G=>d.jsx(li,{progress:G.Avance,color:G.Color}),width:"auto",align:"left"}]}function ec(V){const le=ui(V).slice(1);return[{key:"fecha",header:"Fecha",accessor:De=>an(De.Fecha),width:110},{key:"fechaCita",header:"Fecha Cita",accessor:De=>an(De.FechaCita),width:120},{key:"horaCita",header:"Hora Cita",accessor:De=>De.HoraCita??"—",width:110},...le]}function tc(V){const G=V.kind;switch(G){case"pruebas":case"servicio":return ec(G);case"nuevos":case"seminuevos":default:return ui(G)}}function jn(V,G,le,De){return{id:V,kind:le,title:G,metrics:[{label:"En Proceso",value:So(De)},{label:"Finalizadas",value:ci(De)},{label:"Último seg.",value:_o(De)}],rows:De,initiallyOpen:!1}}const E=[jn("n-1","Cotización de nuevos","nuevos",p),jn("p-1","Prueba de Manejo","pruebas",g),jn("s-1","Cita de Servicio","servicio",m),jn("sn-1","Cotización para Seminuevos","seminuevos",h)],X=y.useMemo(()=>{const V=(k??"").trim().toLowerCase(),G=(le,De)=>{if(V&&!(le.Vehiculo??"").toLowerCase().includes(V))return!1;const Je=te?le.FechaCita:le.Fecha;if(L&&Je){const Ge=si(Je??"");if(!Ge)return!1;const ot=Ae?new Date(`${Ae}T00:00:00`):null,It=J?new Date(`${J}T00:00:00`):null;if(It&&It.setDate(It.getDate()+1),ot&&Ge<ot||It&&Ge>=It)return!1}if(zt!=="Todos"){const Ge=(le.EstatusDescripcion??"").toLowerCase();if(!(GS[zt]??[]).some(Or=>Ge===Or.toLowerCase()))return!1}if(Jt!=="Todos"){const Ge=(le.Actividad??"").toLowerCase();if(!(qS[Jt]??[]).some(Or=>Ge===Or.toLowerCase()))return!1}if(Ir!=="Todos"){const Ge=(le.NivelInteres??"").toLowerCase();if(!(KS[Ir]??[]).some(Or=>Ge===Or.toLowerCase()))return!1}return!0};return E.map(le=>{const De=(le.rows??[]).filter(Ge=>G(Ge,le.kind)),Je=[{label:"En Proceso",value:So(De)},{label:"Finalizadas",value:ci(De)},{label:"Último seg.",value:_o(De)}];return{...le,rows:De,metrics:Je}})},[E,k,L,Ae,J,te,zt,Jt,Ir]);console.log("filteredSections",X);const fe={nuevos:"cotizaciones",pruebas:"pruebademanejo",servicio:"citasservicio",seminuevos:"seminuevos"},Ee=(V,G)=>{const le=V.SolID;if(!le)return;const De=G.kind,Je=fe[De]??"cotizaciones",Ge=`https://qa2.crm.netcar.com.mx/netcar/${Je}/${le}`,ot=_?.({row:V,section:G,slug:Je,solId:le,baseUrl:Ge});if(!S){const It=ot??`https://qa2.crm.netcar.com.mx/netcar/${Je}/${le}`;v(le),Z(It),z(!0)}},$e=()=>{T?.(t),v(null),Z(null),z(!1)},Be=y.useRef(!1),Oe=y.useRef(null),Pe=y.useCallback(()=>{if(!Be.current){Be.current=!0;return}Oe.current&&window.clearTimeout(Oe.current),Oe.current=window.setTimeout(()=>{console.log("iframe recargó (estable) -> refetch"),C?.(t)},500)},[]);return y.useEffect(()=>{Be.current=!1,Oe.current&&window.clearTimeout(Oe.current)},[$,H]),d.jsx(b.Dialog,{open:e,onClose:n,fullWidth:!0,fullScreen:gt,PaperProps:{sx:{height:{xs:"100dvh",md:"90vh"},maxWidth:{xs:"100vw",md:"92vw"},overflow:"hidden",display:"flex",flexDirection:"column",borderRadius:{xs:0,md:3}}},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},height:"100%",minHeight:0,overflow:"auto",position:"relative"},children:[d.jsxs(b.Box,{sx:{width:{xs:"100%",md:405},maxWidth:{xs:"100%",md:405},bgcolor:{xs:"transparent",md:"#40404024"},display:"flex",flexDirection:"column",height:{xs:"auto",md:"100%"},borderRight:{xs:"none",md:"1px solid #EBEEF0"}},children:[d.jsxs(b.Box,{children:[d.jsx(b.Stack,{direction:"row",spacing:2,alignItems:"center",mb:1,sx:{px:2.5,pt:2.5},children:d.jsxs(b.Box,{display:"flex",flexDirection:"column",gap:1,width:"100%",children:[d.jsx(b.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",alignItems:"center",children:d.jsx(b.Box,{sx:{flex:1,minWidth:0,pr:1},children:d.jsxs(b.Typography,{component:"span",fontWeight:700,sx:{display:"inline",lineHeight:1.2,wordBreak:"break-word",pr:.5},children:[we(t)," ",d.jsx(b.IconButton,{component:"span",size:"small",disableRipple:!0,onClick:()=>{n?.(),t&&u?.(t)},sx:{p:0,ml:.5,verticalAlign:"text-bottom",color:"#336BE1","&:hover":{bgcolor:"transparent"},"&:focus-visible":{outline:"none"}},"aria-label":"Editar nombre",children:d.jsx(BS,{sx:{fontSize:"1em"}})})]})})}),Y.map((V,G)=>d.jsxs(b.Box,{sx:{display:"flex",gap:1.2,alignItems:"center",cursor:V.onClick?"pointer":"default"},onClick:()=>{V.onClick&&V.onClick(t)},children:[V.icon,d.jsx(b.Typography,{variant:"body2",sx:{color:V.inLink?"#336BE1":"#070C10"},style:{},children:V.value(t)})]},G))]})}),d.jsx(b.Stack,{mb:2,sx:{px:2.5,pt:0,gap:2},children:r.map((V,G)=>{const le=V.label?.toLowerCase().startsWith("asesor");return d.jsxs(b.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[d.jsx(b.Box,{sx:{width:"50%"},children:d.jsx(b.Typography,{variant:"body2",color:"text.secondary",sx:{color:"#5C6372"},children:V.label})}),d.jsxs(b.Box,{sx:{width:"50%",display:"flex",alignItems:"center",gap:1},children:[d.jsx("div",{children:V?.avatar?V.avatar(t):null}),d.jsx(b.Typography,{variant:"body2",color:"textPrimary",children:V?.value(t)}),le&&d.jsx(b.Tooltip,{title:"Historial asesores",placement:"top",arrow:!0,children:d.jsx(b.IconButton,{size:"small",onClick:De=>P(De.currentTarget),sx:{ml:.5},disableRipple:!0,children:d.jsx(RS,{fontSize:"small",sx:{color:"#5C6372"}})})})]})]},G)})}),d.jsx(b.Divider,{sx:{my:2}})]}),d.jsx(b.Box,{px:2.5,pb:.5,children:d.jsxs(b.Typography,{children:[d.jsx("span",{style:{fontWeight:800},children:"Última actividad"}),!$&&" por solicitud",":"]})}),d.jsxs(b.Box,{sx:{px:2.5,pt:0,gap:2,flex:1,overflowY:"auto",display:"flex",flexDirection:"column",pb:6,maxHeight:{xs:"140px",md:"100%"}},children:[be.length===0&&d.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:"Sin actividad registrada."}),d.jsxs(b.Box,{children:[be?.map((V,G)=>{const le=Q(V),De=ZS(V.comentario||"");return d.jsxs(b.Box,{sx:{pb:1.5},children:[d.jsxs(b.Stack,{direction:"row",spacing:1,alignItems:"center",justifyContent:"space-between",sx:{mb:.75},children:[d.jsx(b.Typography,{variant:"subtitle2",sx:{color:"#5C6372"},children:V.tipo||"Evento"}),d.jsx(b.Chip,{size:"small",label:V.auto!=null?`${V.auto}`:"—",sx:{bgcolor:"#336be1",color:"#fff",height:20}})]}),De?d.jsx(b.Typography,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.5,mb:.75},children:De}):null,d.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[V?.ImgAsesor!=null?d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},alt:ve(le),src:V?.ImgAsesor}):d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},children:ve(le)}),d.jsxs(b.Stack,{spacing:0,children:[d.jsx(b.Typography,{variant:"body2",fontWeight:600,children:le}),d.jsx(b.Typography,{variant:"caption",color:"text.secondary",children:HS(V.fecAlta)})]})]}),G<be.length-1&&d.jsx(b.Divider,{sx:{mt:1.25}})]},V.SegID??G)}),ie.length>D&&d.jsx(b.Box,{sx:{mt:1},children:d.jsx(b.Button,{onClick:()=>pe(V=>!V),size:"small",sx:{textTransform:"none",px:0,color:"#336BE1","&:hover":{background:"transparent",textDecoration:"underline"}},children:ae?"Ver menos":`Ver más (${ke})`})})]})]}),d.jsx(b.Menu,{anchorEl:M,open:K,onClose:()=>P(null),TransitionComponent:b.Fade,MenuListProps:{disablePadding:!0},PaperProps:{sx:{width:320,p:0,overflow:"hidden"}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[d.jsx(b.Box,{sx:{position:"sticky",top:0,zIndex:1,px:1.5,py:1,fontWeight:700,bgcolor:"background.paper",borderBottom:"1px solid",borderColor:"divider"},children:"Historial asesores"}),d.jsxs(b.Box,{sx:{overflowY:"auto",py:.5,maxHeight:200},children:[ne.length===0&&d.jsx(b.Box,{sx:{px:1.5,py:1},children:d.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:"Sin registros"})}),ne.map((V,G)=>{const le=LS(V),De=$S(V.FechaBaja??V.FechaAsignacion);return d.jsx(b.Box,{sx:{px:1,py:.75},children:d.jsxs(b.Stack,{direction:"row",alignItems:"center",spacing:1,children:[d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},src:V?.ImgAsesor??void 0,children:zS(le)}),d.jsx(b.Box,{sx:{flex:1,minWidth:0},children:d.jsx(b.Typography,{variant:"body2",noWrap:!0,children:le})}),d.jsx(b.Typography,{variant:"caption",color:"text.secondary",sx:{whiteSpace:"nowrap"},children:De})]})},G)})]})]})})]}),N?d.jsxs(b.Box,{sx:{flex:1,minWidth:0,overflow:"hidden",position:"relative"},children:[d.jsx(b.Box,{sx:{position:"absolute",top:18,left:24,zIndex:10,pointerEvents:"auto"},children:d.jsx(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:d.jsx(b.Button,{onClick:$e,sx:{backgroundColor:"#2571d6",minWidth:36,minHeight:36,p:.5,borderRadius:"8px",color:"#fff",boxShadow:3,"&:hover":{backgroundColor:"#2074e3"}},children:d.jsx(FS,{fontSize:"medium"})})})}),$&&d.jsx("iframe",{src:$,width:"100%",height:"100%",onLoad:Pe,style:{border:0}})]}):d.jsxs(b.Box,{sx:{width:"100%",minHeight:0,overflowY:"auto"},children:[d.jsx(b.Box,{sx:{mt:{xs:1.5,md:3}},children:d.jsxs(b.Box,{sx:{mt:3,display:"flex",flexDirection:"column",gap:4,padding:"0 20px 0 20px"},children:[d.jsx(b.Typography,{variant:"h4",sx:{fontWeight:800,textAlign:"center",mb:1,letterSpacing:.2},children:"Solicitudes"}),d.jsxs(b.Stack,{direction:{xs:"column",md:"column"},spacing:1.5,alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",sx:{mb:1.5},children:[d.jsxs(b.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",sx:{flexWrap:"wrap"},children:[d.jsx(b.TextField,{size:"small",placeholder:"Buscar por vehículo",value:k,onChange:V=>I(V.target.value),InputProps:{endAdornment:d.jsx(MS,{fontSize:"small",sx:{color:"#b6afaf"}})},sx:{minWidth:220}}),d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,position:"relative"},children:[d.jsxs(b.Stack,{direction:"row",spacing:1.1,position:"absolute",bottom:48,left:0,alignItems:"center",children:[d.jsx(b.FormControlLabel,{label:d.jsx(b.Typography,{sx:{fontSize:15,fontWeight:600,marginLeft:0},children:"Por fecha"}),labelPlacement:"start",control:d.jsx(b.Checkbox,{checked:L,onChange:V=>ce(V.target.checked),size:"small",sx:{p:.3,"& .MuiSvgIcon-root":{fontSize:19},color:"#bab4b4"}}),sx:{ml:0,"& .MuiFormControlLabel-label":{marginRight:0}}}),d.jsx(b.Typography,{sx:{fontSize:15,paddingLeft:.4},children:"De cita"})]}),d.jsxs(b.Stack,{direction:"row",spacing:1,children:[d.jsx(b.TextField,{size:"small",type:"date",label:"Desde",InputLabelProps:{shrink:!0},value:Ae,onChange:V=>B(V.target.value),disabled:!L,sx:{width:170}}),d.jsx(b.TextField,{size:"small",type:"date",label:"Hasta",InputLabelProps:{shrink:!0},value:J,onChange:V=>ye(V.target.value),disabled:!L,sx:{width:170}})]})]}),d.jsx(b.IconButton,{onClick:V=>kt(V.currentTarget),disableRipple:!0,sx:{border:"1px solid #d4d7de",borderRadius:2,width:40,height:40,mt:2},children:d.jsx(IS,{})}),Ja&&d.jsx(b.Button,{variant:"outlined",onClick:oi,disableRipple:!0,sx:{height:40,textTransform:"none",borderColor:"#d4d7de",color:"#333",mt:2},children:"Limpiar filtros"}),d.jsxs(b.Button,{variant:"outlined",sx:{height:40,textTransform:"none",borderColor:"none",color:"#fff",backgroundColor:"#1e5bce","&:hover":{backgroundColor:"#1e5bce",boxShadow:"none"},mt:2},onClick:()=>{x?.(t)},disableRipple:!0,children:[d.jsx(Gf,{sx:{color:"#fff",fontSize:24,paddingRight:.6}}),"Crear Solicitud"]})]}),d.jsx(NS,{sections:X,detailColumns:[],getDetailColumns:tc,onRowClick:Ee})]})]})}),d.jsx(b.Menu,{anchorEl:Ze,open:Dt,onClose:()=>kt(null),TransitionComponent:b.Fade,PaperProps:{sx:{p:1.5,width:260,borderRadius:2,boxShadow:3}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d.jsxs(b.Stack,{spacing:1.5,paddingX:1.5,paddingY:1,children:[d.jsx(b.Typography,{variant:"subtitle2",sx:{fontWeight:700,color:"#070C10"},children:"Filtro"}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Estatus"}),d.jsx(b.RadioGroup,{value:zt,onChange:V=>lr(V.target.value),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos","Sin Asignar","En prospección","Proceso de Compra","En espera de Unidad","Auto Facturado","Rechazadas","Finalizadas sin Venta","Finalizadas con Venta","En Proceso"].map(V=>d.jsx(b.FormControlLabel,{value:V,control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:V},V))})]}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Actividades"}),d.jsx(b.RadioGroup,{value:Jt,onChange:(V,G)=>Ar(G),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos",...wo].map(V=>d.jsx(b.FormControlLabel,{value:V,sx:{alignItems:"start"},control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:V},V))})]}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Nivel de interés"}),d.jsx(b.RadioGroup,{value:Ir,onChange:(V,G)=>Mr(G),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos",...xo].map(V=>d.jsx(b.FormControlLabel,{value:V,control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:V},V))})]})]})})]})]})})}const qf={tableClientes:"_tableClientes_acwe7_1",tableResponsive:"_tableResponsive_acwe7_1"};function Kf(e,n,t){const{fields:r,order:o=["nombreCliente","email","acciones"],header:s={},cells:i={},hide:a={},actions:c}=n,l=c??{},u=l.show??{},f=l.handlers??{},p=l.accessors??{},g=l.icons??{},m=l.className??"d-flex flex-row gap-2 align-items-center ",h=l.tooltip??{},x=g.view??d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",style:{fill:"#070c10"},children:[d.jsx("path",{d:"M18.6,6.3c-3.9-3-9.3-3-13.2,0-1.9,1.5-3.2,3.5-3.9,5.7.7,2.3,2,4.3,3.9,5.7,1.9,1.5,4.2,2.3,6.6,2.3,2.4,0,4.7-.8,6.6-2.3,1.9-1.5,3.2-3.5,3.9-5.7-.7-2.3-2-4.3-3.9-5.7ZM17.2,12.1c0,2.9-2.5,5.3-5.4,5.2-2.9,0-5.3-2.5-5.2-5.4,0-2.9,2.5-5.3,5.4-5.2,2.9,0,5.3,2.4,5.2,5.3,0,0,0,0,0,0Z"}),d.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),S={nombreCliente:{key:"nombreCliente",header:s.nombreCliente??"Cliente",accessor:z=>z[r.nombreCliente],cell:i.nombreCliente,width:190},email:{key:"email",header:s.email??"Correo",accessor:z=>z[r.email],cell:i.email??(z=>{const H=String(z[r.email]??"");return H?d.jsx("a",{href:`mailto:${H}`,children:H}):d.jsx("span",{className:"text-muted",children:"—"})}),width:230},acciones:a.acciones?void 0:{key:"acciones",header:"",cell:i.acciones??(z=>{const H=Za(u.whatsapp,z,!0),v=Za(u.email,z,!0),R=Za(u.view,z,!0),A=p.phone?.(z),$=p.email?.(z),Z=we=>{if(we.stopPropagation(),f.onWhatsApp)return f.onWhatsApp(z);if(!A)return;const Y=p.countryCode??"52",Q=TS(String(A));typeof window<"u"&&window.open(`https://wa.me/${Y}${Q}`,"_blank")},ne=we=>{if(we.stopPropagation(),f.onEmail)return f.onEmail(z);$&&typeof window<"u"&&(window.location.href=`mailto:${$}`)},oe=we=>{we.stopPropagation(),f.onView&&f.onView(z)};return d.jsxs("div",{className:m,children:[H&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.whatsapp??"WhatsApp",onClick:Z,style:{width:24,height:24},children:d.jsx("img",{src:kS,alt:"WhatsApp"})}),v&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.email??"Email",onClick:ne,style:{width:24,height:24},children:d.jsx("img",{src:DS,alt:"Email"})}),R&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.view??"Ver detalle",onClick:oe,style:{width:24,height:24},children:x})]})}),width:120}},_=Object.values(S).filter(z=>!!z),T=(e??[]).filter(z=>!!z?.key),C=new Map;for(const z of _)C.set(String(z.key),z);for(const z of T)C.set(String(z.key),z);const D=[..._.map(z=>String(z.key)),...T.map(z=>String(z.key))],M=Array.from(new Set(o.map(z=>String(z)).filter(z=>C.has(z)))),P=D.filter(z=>!M.includes(z)),K=[...M,...P],N="acciones";if(C.has(N)){const z=K.filter(H=>H!==N);K.splice(0,K.length,...z,N)}return K.map(z=>C.get(z))}function JS(e){const{rows:n,columns:t,clientSort:r=!0,defaultSort:o,minWidth:s=1100,rowKey:i=AS,defaults:a,detailConfig:c,extraSections:l,normalTableColumns:u,normalTable:f,onRowClick:p,activityHistory:g,advisorHistory:m,forceOpenDetailFor:h,closeDetailFor:x,onRequestEdit:S,searchFilter:_,solicitudesNuevos:T,solicitudesPrueba:C,solicitudesServicio:D,solicitudesSeminuevos:M,onCreateSolicitud:P,isCrmMode:K,onSolicitudBaseUrl:N,onIframeClose:z,reloadInfo:H}=e,[v,R]=y.useState(o??null),[A,$]=y.useState({open:!1,customer:null}),[Z,ne]=y.useState([]),oe=re=>{$({open:!0,customer:re})},we=re=>{p?.(re),$({open:!0,customer:re})},Y=()=>{$({open:!1,customer:null}),x?.()},Q=y.useMemo(()=>a?Kf(t??[],a):Kf(t??[],{fields:{},order:[]}),[t,a]),ve=y.useMemo(()=>{if(!r||!v)return n;const re=Q.find(ae=>ae.key===v.key);if(!re)return n;const ie=[...n];return ie.sort((ae,pe)=>{const be=Ha(re,ae,0),ke=Ha(re,pe,0),_e=ES(be,ke);return v.direction==="asc"?_e:-_e}),ie},[n,Q,v,r]),me=y.useMemo(()=>{const re=c?.getCustomerId;return ie=>{const ae=re?.(ie)??ie?.Id_cliente??ie?.CliID??ie?.id??ie?.ID??ie?.Id??"";return String(ae)}},[c]);return y.useEffect(()=>{if(!A.open||!A.customer)return;const re=me(A.customer);if(!re)return;const ie=(n??[]).find(ae=>me(ae)===re);ie&&ie!==A.customer&&$(ae=>({...ae,customer:ie}))},[n,A.open,A.customer,me]),y.useEffect(()=>{h&&oe(h)},[h]),d.jsxs("div",{children:[d.jsx("div",{className:`${qf.tableClientes} back-white rounded-3 shadow-main mt-4 mb-4`,children:d.jsx("div",{className:`${qf.tableResponsive} table-responsive`,children:d.jsxs("table",{className:"table table-hover align-middle mb-0",children:[d.jsx("thead",{children:d.jsx("tr",{children:Q.map(re=>d.jsx("th",{style:{fontWeight:600,width:re.width,paddingTop:"20px",paddingBottom:"20px",textAlign:re.align??"left"},children:re.header},re.key))})}),d.jsx("tbody",{children:ve.map((re,ie)=>d.jsx("tr",{onClick:()=>we?.(re),role:"button",tabIndex:0,onKeyDown:ae=>{(ae.key==="Enter"||ae.key===" ")&&we?.(re)},style:{cursor:"pointer"},children:Q.map((ae,pe)=>{const be=ae.Component?d.jsx(ae.Component,{row:re,index:ie}):ae.cell?ae.cell(re,ie):(()=>{const ke=Ha(ae,re,ie);return ke==null||ke===""?"":String(ke)})();return d.jsx("td",{style:{paddingTop:"20px",paddingBottom:"20px",textAlign:ae.align??"left"},children:be},`${String(ae.key)}-${pe}`)})},i(re,ie)))})]})})}),A.open&&d.jsx(XS,{open:A.open,onClose:Y,customer:A.customer,fields:c?.dynamicFields,header:c?.header,extraSections:l,normalTableColumns:u,normalTable:f,history:g,advisorHistory:m,onRequestEdit:re=>{Y(),S?.(re)},searchFilter:_,solicitudesNuevos:T,solicitudesPrueba:C,solicitudesServicio:D,solicitudesSeminuevos:M,onCreateSolicitud:P,isCrmMode:K,onSolicitudBaseUrl:N,onIframeClose:z,reloadInfo:H})]})}const Qf=se.forwardRef(({sx:e,...n},t)=>d.jsx(b.InputBase,{inputRef:t,...n,sx:{height:48,px:1.5,width:"100%",maxWidth:"none",bgcolor:"#EBEEF0",borderRadius:2,border:"1px solid transparent","&:hover":{borderColor:"transparent"},"& .MuiInputBase-input::placeholder":{opacity:.7},...e}}));Qf.displayName="SoftInput";const eC=ct(d.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline");function tC({message:e}){return e?d.jsxs(b.Box,{role:"alert",sx:{mt:1,display:"flex",alignItems:"center",gap:1,bgcolor:"#fdeaea",border:"1px solid rgb(253, 237, 237)",color:"#842029",borderRadius:1,px:2,py:1.25},children:[d.jsx(eC,{fontSize:"small",sx:{color:"rgb(211, 47, 47)"}}),d.jsx("span",{style:{color:"rgb(95, 33, 32)",fontSize:14,fontWeight:"500"},children:e})]}):null}function rC(e){if(e.required)return e.required===!0?"El campo es obligatorio.":e.required}function Ka(e,n){const t=rC(e);return t?n?.isArray?{required:t,validate:r=>Array.isArray(r)&&r.length>0||t}:{required:t,validate:r=>r!==""&&r!==null&&r!==void 0||t}:{}}const Xf={"& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},width:"100%"},nC={mb:1,fontWeight:600,color:"#1C1C1D","&.Mui-focused":{color:"#1C1C1D !important"},"&.Mui-error":{color:"#1C1C1D !important"}};function Qa({label:e,errorMsg:n,helperText:t,children:r,sx:o}){return d.jsxs(b.FormControl,{fullWidth:!0,error:!!n,sx:o,className:"1- FieldWrapper",children:[d.jsx(b.FormLabel,{sx:nC,children:e}),r,d.jsx(tC,{message:n||t})]})}function oC(e,n){const{register:t,formState:{errors:r}}=n,o={...Ka(e)};e.minLength&&(o.minLength={value:e.minLength,message:`El campo espera minimo ${e.minLength} caracteres`}),e.maxLength&&(o.maxLength={value:e.maxLength,message:`El campo espera maximo ${e.maxLength} caracteres`}),e.pattern&&(o.pattern={value:e.pattern,message:"Formato inválido"});const s=e.type==="email";s&&!o.pattern&&(o.pattern={value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Correo electrónico inválido"});const i=/[A-Za-zÁÉÍÓÚÜÑáéíóúüñ\s'.-]/g,a=/[0-9]/g,c=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Home","End","Escape","Enter"]),l=C=>e.onlyNumbers?(C.match(a)??[]).join(""):e.onlyLetters?(C.match(i)??[]).join(""):C,u=(C,D)=>c.has(C)||D?!0:e.onlyNumbers?/^[0-9]$/.test(C):e.onlyLetters?/^[A-Za-zÁÉÍÓÚÜÑáéíóúüñ\s'.-]$/.test(C):!0,f=r[e.name]?.message,p=t(e.name,o),g=(e.inputProps&&typeof e.inputProps.maxLength=="number"?e.inputProps.maxLength:void 0)??e.maxLength,m=C=>{u(C.key,C.ctrlKey||C.metaKey)||C.preventDefault()},h=C=>{const D=C.data??null;D!=null&&(e.onlyNumbers&&/[^0-9]/.test(D)&&C.preventDefault(),e.onlyLetters&&/[^A-Za-zÁÉÍÓÚÜÑáéíóúüñ ]/.test(D)&&C.preventDefault())},x=C=>{const D=C.clipboardData.getData("text"),M=l(D);if(M!==D){C.preventDefault();const P=C.target,K=P.selectionStart??P.value.length,N=P.selectionEnd??P.value.length;P.setRangeText(M,K,N,"end"),P.dispatchEvent(new Event("input",{bubbles:!0}))}},S=C=>{const D=l(C.target.value);D!==C.target.value&&(C.target.value=D),g&&C.target.value.length>g&&(C.target.value=C.target.value.slice(0,g)),p.onChange(C)},_={...e.inputProps,...s?{inputMode:"email",autoComplete:"email"}:{},maxLength:g,onKeyDown:m,onBeforeInput:h,onPaste:x,onInvalid:C=>C.preventDefault()},T=e.onlyNumbers||s?"text":e.type??"text";return d.jsx(Qa,{label:e.label,errorMsg:f,helperText:e.helperText,sx:Xf,children:d.jsx(Qf,{placeholder:e.placeholder,type:T,inputProps:_,...p,onChange:S,sx:{width:"100%",maxWidth:"none"},className:"SoftInputData"})})}function sC(e,n){const{control:t}=n,r=!!e.multiple;return d.jsx(Ht,{name:e.name,control:t,rules:Ka(e,{isArray:r}),render:({field:o,fieldState:s})=>d.jsx(Qa,{label:e.label,errorMsg:s.error?.message,helperText:e.helperText,sx:Xf,children:d.jsxs(b.Select,{...o,multiple:r,displayEmpty:!0,sx:{height:48,backgroundColor:"#EBEEF0","& .MuiSelect-select":{display:"flex",alignItems:"center",py:0}},className:"2-SoftInputData",children:[!r&&d.jsx(b.MenuItem,{value:"",disabled:!0,children:"Selecciona…"}),e.options.map(i=>d.jsx(b.MenuItem,{value:i.value,children:i.label},String(i.value)))]})})})}function iC(e,n){return d.jsx(Ht,{name:e.name,control:n.control,rules:Ka(e),render:({field:t,fieldState:r})=>d.jsx(Qa,{label:e.label,errorMsg:r.error?.message,helperText:e.helperText,children:d.jsx(b.RadioGroup,{row:!0,...t,className:"3-RadioFieldRender",children:e.options.map(o=>d.jsx(b.FormControlLabel,{value:o.value,control:d.jsx(b.Radio,{}),label:o.label},String(o.value)))})})})}function Jf(e,n){if(e.render)return e.render(n);switch(e.kind){case"text":return oC(e,n);case"select":return sC(e,n);case"radio":return iC(e,n);default:return null}}function aC(e,{initialPerPage:n=25,perPageOptions:t=[10,25,50,100,"Todos"],onPageChange:r,onPerPageChange:o,scrollTop:s,deps:i=[]}={}){const a=Array.isArray(e)?e:[],[c,l]=y.useState(1),[u,f]=y.useState(n),{currentItems:p,totalPages:g,showingFrom:m,showingTo:h,totalItems:x}=y.useMemo(()=>{const T=a.length,C=u==="Todos"?1/0:Number(u),D=C===1/0?1:Math.max(1,Math.ceil(T/C)),M=Math.min(c,D),P=C===1/0?T:M*C,K=C===1/0?0:P-C;return{currentItems:C===1/0?a:a.slice(K,P),totalPages:D,showingFrom:T===0?0:K+1,showingTo:C===1/0?T:Math.min(P,T),totalItems:T}},[a,c,u]),S=T=>{const C=Math.max(1,Math.min(T,g||1));l(C),r?.(C),s?.()};return{currentItems:p,totalPages:g,showingFrom:m,showingTo:h,totalItems:x,currentPage:c,itemsPerPage:u,perPageOptions:t,goTo:S,next:()=>S(c+1),prev:()=>S(c-1),setItemsPerPage:T=>{f(T),o?.(T),l(1),s?.()},setCurrentPage:S}}const cC=ct(d.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"NavigateBefore"),lC=ct(d.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),uC=({currentPage:e,totalPages:n,onPageChange:t,itemsPerPage:r,onItemsPerPageChange:o,itemsPerPageOptions:s,showingFrom:i,showingTo:a,totalItems:c})=>{const l=b.useTheme(),u=b.useMediaQuery(l.breakpoints.down("sm")),f=()=>{if(n<=1)return[1];const m=u?0:2,h=[],x=1,S=n,_=Math.max(x+1,e-m),T=Math.min(S-1,e+m);h.push(x),_>x+1&&h.push("...");for(let C=_;C<=T;C++)C>=x+1&&C<=S-1&&h.push(C);return T<S-1&&h.push("..."),h.push(S),h},p=m=>{const h=m.target.value;o(h)},g=Math.max(1,n);return d.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:"center",justifyContent:{xs:"center",sm:"space-between"},gap:2,my:0,py:2,borderTop:"#D3D4D5 1px solid",px:3},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",justifyContent:"center"},children:[d.jsx(b.IconButton,{onClick:()=>t(e-1),disabled:e<=1,size:"medium",sx:{"&:hover":{backgroundColor:"action.hover"}},"aria-label":"Página anterior",children:d.jsx(cC,{fontSize:"large"})}),f().map((m,h)=>m==="..."?d.jsx(b.Box,{sx:{px:1,display:"flex",alignItems:"center",fontSize:"1.1rem"},children:". . ."},`dots-${h}`):d.jsx(b.Button,{onClick:()=>t(m),size:"small",sx:{minWidth:36,height:36,fontSize:"1.05rem",p:1,borderRadius:"10px",backgroundColor:e===m?"primary.main":"transparent",fontWeight:e===m?700:400,color:e===m?"#fff":"#5C6372","&:hover":{backgroundColor:e===m?"primary.dark":"action.hover"},boxShadow:"none",border:"none",mx:.5},children:m},`p-${m}`)),d.jsx(b.IconButton,{onClick:()=>t(e+1),disabled:e>=g,size:"medium",sx:{"&:hover":{backgroundColor:"action.hover"}},"aria-label":"Página siguiente",children:d.jsx(lC,{fontSize:"large"})})]}),d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1.25,justifyContent:{xs:"center",sm:"flex-start"},mt:{xs:1,sm:0}},children:[d.jsx(b.Typography,{variant:"body2",children:"Mostrar"}),d.jsx(b.FormControl,{size:"small",sx:{minWidth:72},children:d.jsx(b.Select,{value:r,onChange:p,renderValue:m=>m==="Todos"?"Todos":String(m),children:s.map(m=>d.jsx(b.MenuItem,{value:m,children:m==="Todos"?"Todos":m},String(m)))})}),d.jsx(b.Typography,{variant:"body2",children:"por página"})]})]})};function dC(e){const{open:n,dataAdd:t,fields:r,onSubmit:o,onCancel:s,defaultValues:i,txtBtnGuardar:a,haveId:c=!1,itemsTable:l,filter:u,getId:f,renderRow:p,selectedIds:g,onSelectedChange:m,onSubmitAddData:h,initialSelectedIds:x=[],showAutosPanel:S}=e,_=Wd({mode:"onSubmit",reValidateMode:"onChange",criteriaMode:"all",shouldUnregister:!1,defaultValues:i});y.useEffect(()=>{i&&_.reset(i)},[i,_]);const[T,C]=y.useState(""),[D,M]=y.useState(x),P=Array.isArray(g)&&!!m,K=P?g:D,N=O=>{const ee=typeof O=="function"?O(K):O;P?m(ee):M(ee)},z=y.useCallback(O=>f?f(O):O?.IdAuto,[f]),H=y.useMemo(()=>{const O=new Map;return(l??[]).forEach((ee,xe)=>O.set(z(ee),xe)),O},[l,z]),v=y.useRef(new Set),R=y.useMemo(()=>{const O=new Map;return(l??[]).forEach(ee=>O.set(f?f(ee):ee?.IdAuto,ee)),O},[l,f]),A=y.useMemo(()=>(r??[]).filter(O=>!!O.required).map(O=>O.name),[r]),$=Dd({control:_.control,name:A}),Z=O=>O==null?!1:typeof O=="string"?O.trim().length>0:Array.isArray(O)?O.length>0:typeof O=="number"?!Number.isNaN(O):typeof O=="object"?Object.keys(O).length>0:!0,ne=y.useMemo(()=>A.length?$?.every(Z)??!1:!0,[$,A]),{handleSubmit:oe,formState:{isSubmitting:we,isDirty:Y,isValid:Q}}=_,ve=u??((O,ee)=>JSON.stringify(O).toLowerCase().includes(ee.toLowerCase())),me=y.useMemo(()=>T.trim()?l?.filter(O=>ve(O,T)):l,[l,T,ve]),re=y.useMemo(()=>{if(!me)return me;const O=v.current,ee=[...me];return ee.sort((xe,Ae)=>{const B=O.has(z(xe))?0:1,J=O.has(z(Ae))?0:1;if(B!==J)return B-J;const ye=H.get(z(xe))??0,Ze=H.get(z(Ae))??0;return ye-Ze}),ee},[me,H,z]),{currentItems:ie,totalPages:ae,showingFrom:pe,showingTo:be,totalItems:ke,currentPage:_e,itemsPerPage:Qe,perPageOptions:j,goTo:U,setItemsPerPage:he}=aC(re,{initialPerPage:25,perPageOptions:[10,25,50,100,"Todos"],deps:[T],scrollTop:()=>{}}),ge=O=>{const ee=R.get(O)??null;N([O]),h?.({items:ee})},Me=O=>K.includes(O),Ct=async O=>{try{await o?.(O),_.reset(_.getValues())}catch(ee){console.error("Error al enviar AddCliente:",ee)}},bt=y.useMemo(()=>{const O=new Map;return(r??[]).forEach(ee=>O.set(String(ee.name),ee)),O},[r]),gt=(O,ee)=>{const xe=bt.get(String(O));if(!xe)return null;const Ae={xs:12,...xe.grid,...ee||{}};return d.jsx(b.Grid,{item:!0,...Ae,children:xe.render?xe.render(_):Jf(xe,_)},`fld-${String(O)}`)},k=S??(e.haveId?"edit":"new"),I=k!=="onlyCars",L=k==="new"||k==="onlyCars",ce=K?.length>0,te=k==="onlyCars"?ce:e.haveId?ne&&Y||ce:ne&&ce;return d.jsx(b.Dialog,{open:n,onClose:s,maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{height:{xs:"100dvh",md:L?"90vw":"auto"},maxWidth:{xs:"100vw",md:L?"98vw":"50%"},overflow:"hidden",display:"flex",flexDirection:"column",borderRadius:{xs:0,md:3}}},children:d.jsx(b1,{..._,children:d.jsxs(b.Box,{component:"form",noValidate:!0,onSubmit:oe(Ct),display:"flex",flexDirection:{xs:"column",md:"row"},width:"100%",height:"100%",overflow:{xs:"auto",md:"unset"},position:"relative",children:[I&&d.jsxs(b.Box,{sx:{width:{xs:"100%",md:c?"100%":394},maxWidth:{xs:"100%",md:c?"100%":394},boxShadow:{xs:"none",md:c?"none":"2px 0px 8px #40404024"},borderRight:{xs:"none",md:c?"none":"1px solid #EBEEF0"},bgcolor:"background.paper",paddingBottom:3,mx:{xs:0,md:c?"auto":0},position:"relative"},children:[d.jsxs(b.Box,{p:{xs:2,md:2},height:"100%",width:"100%",children:[d.jsx(b.Typography,{fontWeight:700,fontSize:20,children:t.title}),d.jsxs(b.Box,{sx:{flex:1,height:"100%",overflowY:"auto",paddingBottom:10},children:[d.jsx(b.Typography,{fontSize:"18px",mt:2.5,fontWeight:500,children:t.subTitle}),d.jsx(b.Box,{mt:2,display:"flex",flexDirection:"column",width:"100%",gap:2,children:Array.isArray(e.formLayout)&&c?e.formLayout.map((O,ee)=>d.jsx(b.Grid,{container:!0,spacing:2,alignItems:"flex-start",wrap:"wrap",width:"100%",children:O.map((xe,Ae)=>{const B=typeof xe=="string"?{name:xe}:xe;return B.hidden?.(_)?null:gt(B.name,B.grid)})},`row-${ee}`)):d.jsx(b.Grid,{container:!0,spacing:2,width:"100%",children:r?.map((O,ee)=>{const xe=O.grid??{xs:12,md:12};return d.jsx(b.Grid,{item:!0,...xe,children:O.render?O.render(_):Jf(O,_)},`${String(O.name)}-${ee}`)})})})]})]}),d.jsx(b.Box,{sx:{position:"absolute",zIndex:O=>O.zIndex.modal+1,bottom:0,width:"100%",borderRadius:2,boxShadow:{xs:"0",md:"0 -8px 8px -6px #0003"},p:1,backgroundColor:"#fff"},children:d.jsx(b.Box,{display:"flex",alignItems:"center",children:d.jsx(b.Box,{display:"flex",gap:1.5,width:"100%",justifyContent:c?"flex-end":"center",children:d.jsx(b.Button,{type:"submit",variant:"contained",disabled:we||!te,sx:{backgroundColor:"#336BE1",color:"#fff",borderColor:"transparent",height:48,fontSize:15,textTransform:"none",fontWeight:"400",paddingX:5,width:c?"160px":"100%"},children:a})})})})]}),L&&d.jsx(b.Box,{flex:1,display:"flex",flexDirection:"column",minWidth:0,sx:{height:"100%"},children:d.jsx(b.Box,{mt:1,sx:{flex:1,display:"flex",flexDirection:"column",height:"100%"},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[d.jsxs(b.Box,{p:3,sx:{borderBottom:1,borderBottomColor:"#D3D4D5",position:"sticky",top:0,zIndex:1,bgcolor:"#fff",flexDirection:{sm:"row",xs:"column"}},display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:4,children:[d.jsx(b.TextField,{value:T,onChange:O=>C(O.target.value),placeholder:"Buscar marca, modelo, vin...",InputProps:{endAdornment:d.jsx(b.InputAdornment,{position:"start",children:d.jsx(sy,{})}),disableUnderline:!0},variant:"standard",sx:{maxWidth:360,width:"100%",backgroundColor:"#EBEEF0",paddingX:"16px",paddingY:"10px"}}),d.jsx(b.Box,{display:"flex",gap:2,alignItems:"center",sx:{marginTop:{sm:0,xs:2}},children:d.jsx(b.Box,{onClick:s,sx:{cursor:"pointer",position:"absolute",top:0,right:10},display:{xs:"none",md:"block"},children:d.jsx(sn,{sx:{color:"#070C10",fontSize:24}})})}),S=="onlyCars"&&d.jsx(b.Box,{display:"flex",alignItems:"center",justifyContent:"center",children:d.jsx(b.Box,{display:"flex",gap:1.5,width:"100%",children:d.jsxs(b.Button,{type:"submit",variant:"contained",disabled:we||!te,sx:{backgroundColor:"#336BE1",color:"#fff",borderColor:"transparent",height:48,fontSize:15,textTransform:"none",fontWeight:"400",paddingX:5,width:"100%"},children:[d.jsx(Gf,{sx:{color:we||!te?"gray":"#fff",fontSize:26,paddingRight:.6}}),"Crear Solicitud"]})})})]}),d.jsx(b.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",overflowX:"auto",padding:0,height:"100%","&::-webkit-scrollbar:horizontal":{display:"none"},"&::-webkit-scrollbar:vertical":{width:8}},children:d.jsx(b.Box,{sx:{minWidth:1150,width:"max(1150px, 100%)",paddingBottom:10},children:d.jsxs(b.List,{disablePadding:!0,sx:{borderColor:"transparent",padding:0},children:[ie?.map((O,ee)=>{const xe=f?f(O):ee,Ae=Me(xe);return d.jsx(b.Box,{sx:{borderBottom:"1px solid #D3D4D5",padding:0},children:d.jsx(b.ListItem,{disableGutters:!0,sx:{paddingTop:0,padding:0,m:0},children:d.jsx(b.ListItemButton,{onClick:()=>ge(xe),disableRipple:!0,sx:{padding:0},children:d.jsx(b.ListItemText,{disableTypography:!0,primary:p?p({item:O,selected:Ae,toggle:()=>ge(xe),index:ee}):null})})})},`${String(xe)}`)}),!ie?.length&&d.jsx(b.Box,{p:3,children:d.jsxs(b.Typography,{fontSize:14,color:"#5C6372",children:["Sin resultados para “",T,"”."]})})]})})}),d.jsx(b.Box,{sx:{position:"sticky",bottom:0,bgcolor:"#fff"},children:d.jsx(uC,{currentPage:_e,totalPages:ae,onPageChange:U,itemsPerPage:Qe,onItemsPerPageChange:he,itemsPerPageOptions:j,showingFrom:pe,showingTo:be,totalItems:ke})})]})})})]})})})}const fC=ct(d.jsx("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile"),Xa=/^[^\s@]+@[^\s@]+\.[^\s@]+$/i,ni=/[,\s;]+/g,Fr=e=>e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase(),Vr=(e,n)=>Array.from(new Set([...e,...n.map(t=>t.trim()).filter(Boolean)])),ep=(e,n)=>n?e.filter(t=>Fr(t)!==Fr(n)):e,pC=(e,n)=>e.filter(t=>!n.some(r=>Fr(r)===Fr(t)));function cr(e,n,t){if(t)return typeof t=="function"?t(e,n):e[t]}function hC(e,n){if(n)return!e||/^https?:\/\//i.test(n)?n:e+n}function mC({open:e,onClose:n,value:t,onChange:r,onRequestSend:o,customer:s,itemsSelects:i,renderItem:a,filterFields:c=[],multiSelectAutos:l=!0,imgCorreoSrc:u,baseURLImages:f,itemProps:p,defaultItemImageSrc:g}){const m=y.useRef(null),[h,x]=y.useState("idle"),S=y.useRef(e);y.useEffect(()=>{const B=S.current;e&&!B&&x("entering"),!e&&B&&x("exiting"),S.current=e},[e]),y.useEffect(()=>{if(h==="entering"){const ye=setTimeout(()=>x("idle"),320);return()=>clearTimeout(ye)}if(h==="exiting"){const ye=setTimeout(()=>x("idle"),220);return()=>clearTimeout(ye)}},[h]);const[_,T]=y.useState(""),[C,D]=y.useState(!1),[M,P]=y.useState(!1),[K,N]=y.useState(!1),[z,H]=y.useState(""),[v,R]=y.useState([]),A=K?v:t.selectedIds,$=()=>{R([...t.selectedIds]),H(""),N(!0)},Z=()=>{N(!1),R([])},ne=()=>{const B=new Set(bt.map((ye,Ze)=>String(cr(ye,Ze,p.id)))),J=v.filter(ye=>B.has(String(ye)));r({...t,selectedIds:J}),N(!1)},oe=(B,J)=>Fr(B??"")===Fr(J??"");function we(B,J,ye,Ze,kt){const Dt=J?B.some(lr=>oe(lr,J)):!1,zt=ye.length>0?ye.some(lr=>B.some(Jt=>oe(Jt,lr))):!1;Ze(Dt),kt(zt)}const Y=B=>{const J=typeof B=="function"?B(t.recipients):B;r({...t,recipients:J}),we(J,ie,pe,D,P)},Q=B=>r({...t,message:B}),ve=B=>r({...t,attachments:[...t.attachments,...B]}),me=B=>r({...t,attachments:t.attachments.filter(J=>J.name!==B)}),re=B=>{if(K)if(l){const J=new Set(v);J.has(B)?J.delete(B):J.add(B),R(Array.from(J))}else{const J=v.includes(B);R(J?[]:[B])}else if(l){const J=new Set(t.selectedIds);J.has(B)?J.delete(B):J.add(B),r({...t,selectedIds:Array.from(J)})}else{const J=t.selectedIds.includes(B);r({...t,selectedIds:J?[]:[B]})}},ie=y.useMemo(()=>(s?.Correo??"").trim(),[s]),ae=y.useMemo(()=>Array.isArray(s?.Asesores)?s.Asesores.filter(B=>B?.EmailAsesor&&B?.Activo):[],[s]),pe=y.useMemo(()=>ae.map(B=>(B.EmailAsesor??"").trim()).filter(Boolean),[ae]),be=y.useRef(!1);y.useEffect(()=>{if(e&&!be.current){let B=[];C&&ie&&(B=Vr(B,[ie])),M&&pe.length&&(B=Vr(B,pe)),Y(J=>Vr(J,B)),we(t.recipients,ie,pe,D,P),T(""),be.current=!0}e||(be.current=!1)},[e,C,M,ie,pe]);const ke=B=>{const J=ae.find(ye=>Fr(ye.EmailAsesor??"")===Fr(B));if(J){if(J.ImgAsesor)return d.jsx(b.Avatar,{src:J.ImgAsesor,alt:J.NombreAsesor});const ye=(J.NombreAsesor||"").trim(),Ze=(J.ApellidosAsesor||"").trim();return d.jsx(b.Avatar,{children:`${ye[0]??""}${Ze[0]??""}`.toUpperCase()})}return d.jsx(b.Avatar,{children:B[0]?.toUpperCase()})},_e=()=>{const B=_.trim();if(!B)return;const ye=B.split(ni).filter(Boolean).filter(Ze=>Xa.test(Ze));ye.length>0&&Y(Ze=>Vr(Ze,ye)),T("")},Qe=B=>{D(B),Y(J=>B&&ie?Vr(J,[ie]):ep(J,ie))},j=B=>{P(B),Y(J=>B?Vr(J,pe):pC(J,pe))},U=B=>{const J=Array.from(B.target.files||[]);ve(J.map(ye=>({name:ye.name,size:ye.size,file:ye}))),B.target.value=""},he=A[0],ge=y.useMemo(()=>!i||he===void 0?void 0:i.find((J,ye)=>String(cr(J,ye,p.id))===String(he)),[i,he,p.id]),Me=y.useMemo(()=>{if(!(!ge||!p.distributorId))return cr(ge,0,p.distributorId)},[ge,p.distributorId]);console.log("lockedDisId",Me);const Ct=y.useMemo(()=>ge?(p.distributorTitle?cr(ge,0,p.distributorTitle):void 0)??(Me!=null?String(Me):void 0):void 0,[ge,p.distributorTitle,Me]),bt=y.useMemo(()=>{const B=i??[];return Me==null||!p.distributorId?B:B.filter((J,ye)=>cr(J,ye,p.distributorId)==Me)},[i,Me,p.distributorId]),gt=y.useMemo(()=>{if(!z.trim())return bt;const B=z.toLowerCase();return bt.filter(J=>(c??[]).some(ye=>String(J?.[ye]??"").toLowerCase().includes(B)))},[bt,z,c]),k=y.useMemo(()=>{if(!i||!t.selectedIds.length)return[];const B=new Map;return i.forEach((J,ye)=>{B.set(String(cr(J,ye,p.id)),J)}),t.selectedIds.map(J=>B.get(String(J))).filter(Boolean)},[i,t.selectedIds,p.id]),I=B=>r({...t,selectedIds:t.selectedIds.filter(J=>String(J)!==String(B))}),L=()=>{let B=t.recipients;if(_.trim()){const Dt=_.split(ni).filter(zt=>Xa.test(zt));B=Vr(B,Dt),Y(B),T("")}const J=C?ie:"",ye=ae.find(Dt=>Dt?.Activo&&Dt?.EmailAsesor)?.EmailAsesor?.trim()??"";o?.({recipients:B,toClient:C,toAdvisor:M,tipoInt:C&&M?2:1,correoCliente:J,correoAsesor:M?ye:"",disIdLocked:Me}),n?.()},ce=y.useMemo(()=>{const J=_.split(ni).filter(Boolean).some(ye=>Xa.test(ye));return t.recipients.length>0||J},[t.recipients,_]),te=(t.selectedIds?.length??0)>0,O=t.message.trim().length>0,ee=ce&&te&&O,xe=b.useTheme(),Ae=b.useMediaQuery(xe.breakpoints.down("sm"));return d.jsxs(b.Drawer,{anchor:Ae?"bottom":"right",open:e,onClose:n,ModalProps:{keepMounted:!0,BackdropProps:{invisible:!Ae}},transitionDuration:{enter:320,exit:220},SlideProps:{direction:Ae?"up":"left",timeout:{enter:320,exit:220},easing:{enter:"cubic-bezier(0.22, 1, 0.36, 1)",exit:"cubic-bezier(0.4, 0, 1, 1)"}},PaperProps:{sx:{width:{xs:"100vw",sm:420},height:{xs:"85vh",sm:"auto"},maxHeight:{xs:"85vh",sm:"calc(100vh - 32px)"},left:{xs:0,sm:"auto"},right:{xs:0,sm:16},bottom:{xs:0,sm:16},top:{xs:"auto",sm:"auto"},borderRadius:{xs:"12px 12px 0 0",sm:2},boxShadow:6,overflow:"hidden"}},children:[d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",height:{xs:"100%",sm:"auto"},position:"relative",overflow:"auto"},children:[d.jsxs(b.Box,{sx:{p:2,pb:1,position:"sticky",top:0,zIndex:1,bgcolor:"#fff",borderBottom:"1px solid #E5E7EB"},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:2},children:[u?d.jsx("img",{src:u,alt:"Correo",style:{width:24,height:18}}):null,d.jsxs(b.Typography,{fontWeight:700,children:["Mensaje a"," ",s?`${s.Nombre??""} ${s.ApellidoP??""} ${s.ApellidoM??""}`.trim():"—"]})]}),d.jsx(b.IconButton,{onClick:n,size:"small",children:d.jsx(sn,{})})]}),d.jsx("div",{children:d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 10px",backgroundColor:"#EBEEF0",border:"1px solid #E5E7EB",borderRadius:8,flexWrap:"wrap"},children:[d.jsx("label",{style:{fontSize:14,fontWeight:600,marginRight:4},children:"Para:"}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",flex:1},children:[t.recipients.map(B=>d.jsx(b.Chip,{avatar:ke(B),label:B,onDelete:()=>Y(J=>ep(J,B)),size:"small",variant:"outlined",sx:{borderRadius:999,height:28}},B)),d.jsx("input",{type:"text",value:_,onChange:B=>T(B.target.value),onKeyDown:B=>{const J=B.key;J==="Enter"||J===","||J===";"||J===" "||J==="Tab"?(B.preventDefault(),_e()):J==="Backspace"&&!_&&t.recipients.length&&Y(Ze=>Ze.slice(0,-1))},onBlur:_e,onPaste:B=>{const ye=B.clipboardData.getData("text").split(ni).filter(Boolean);ye.length>1&&(B.preventDefault(),Y(Ze=>Vr(Ze,ye)),T(""))},placeholder:t.recipients.length?"":"correo@ejemplo.com",style:{flex:1,minWidth:140,border:"none",outline:"none",background:"transparent",fontSize:14,color:"#111827",padding:"4px 0"}})]})]})}),d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:2,mb:1.5},children:[d.jsx(b.FormControlLabel,{control:d.jsx(b.Checkbox,{checked:C,onChange:B=>Qe(B.target.checked),size:"small"}),label:"Cliente"}),ae.length!==0&&d.jsx(b.FormControlLabel,{control:d.jsx(b.Checkbox,{checked:M,onChange:B=>j(B.target.checked),size:"small"}),label:`Asesor${ae.length>1?"es":""}`})]})]}),d.jsx(b.Divider,{}),d.jsxs(b.Box,{p:2,children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},onClick:$,children:[d.jsx(b.Typography,{fontSize:12,fontWeight:600,sx:{textDecorationLine:"underline",cursor:"pointer"},children:"Selecciona el auto de seguimiento"}),Ct!=null&&d.jsx(b.Chip,{size:"small",label:`Distribuidora: ${Ct}`})]}),k.length>0?d.jsx(b.Box,{sx:{mt:1.5,display:"flex",gap:1,flexWrap:"wrap"},children:k.map((B,J)=>{const ye=cr(B,J,p.id),Ze=cr(B,J,p.title)??"",kt=cr(B,J,p.image),Dt=hC(f,kt);return d.jsx(b.Chip,{onDelete:()=>I(ye),label:d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.jsx(b.Box,{sx:{width:28,height:20,borderRadius:.8,bgcolor:"#e5e6e8",overflow:"hidden",flex:"0 0 auto"},children:Dt?d.jsx("img",{src:Dt,alt:Ze,style:{width:"100%",height:"100%",objectFit:"cover"}}):d.jsx("img",{src:g,alt:Ze,style:{width:"100%",height:"100%",objectFit:"cover"}})}),d.jsx("span",{style:{fontSize:12},children:d.jsx("b",{children:Ze})})]}),sx:{pl:.5,pr:.3,py:.2,borderRadius:2,".MuiChip-deleteIcon":{fontSize:18}},variant:"outlined"},String(ye))})}):d.jsx(b.Typography,{fontSize:13,color:"#5C6372",sx:{mt:.5},children:"Aún no has seleccionado autos."})]}),d.jsx(b.Divider,{}),d.jsxs(b.Box,{sx:{p:2},children:[d.jsx(b.TextField,{placeholder:"Escribe aquí tu mensaje...",value:t.message,onChange:B=>Q(B.target.value),multiline:!0,minRows:6,fullWidth:!0,sx:{mb:1.5}}),t.attachments.length>0&&d.jsx(b.List,{dense:!0,sx:{display:"flex",flexDirection:"column",gap:2,border:"none"},children:t.attachments.map(B=>d.jsxs(b.ListItem,{sx:{px:0,background:"#EAEBF2",borderRadius:2,paddingX:1},children:[d.jsx(b.ListItemText,{style:{gap:10,fontSize:15,color:"#5285F7",display:"flex",flexWrap:"wrap",flex:"none"},primary:B.name,secondary:B.size<1024?`${B.size} b`:B.size<1024*1024?`${(B.size/1024).toFixed(0)} kb`:`${(B.size/(1024*1024)).toFixed(1)} MB`,secondaryTypographyProps:{sx:{fontSize:12,color:"#64748B",fontWeight:500,mt:.25}},primaryTypographyProps:{noWrap:!0,width:"auto"}}),d.jsx(b.Tooltip,{title:"Quitar",children:d.jsx(b.IconButton,{edge:"end",onClick:()=>me(B.name),size:"small",children:d.jsx(sn,{fontSize:"small"})})})]},B.name))})]}),d.jsxs(b.Box,{sx:{position:{xs:"sticky",sm:"sticky"},bottom:0,bgcolor:"#fff",borderTop:"1px solid #E5E7EB",p:2,display:"flex",alignItems:"center",gap:2},children:[d.jsx("input",{ref:m,hidden:!0,type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.mp4,.pdf,.xlsx,.csv,.docx,.pptx,.txt",onChange:U}),d.jsx(b.Button,{startIcon:d.jsx(fC,{}),variant:"text",onClick:()=>m.current?.click(),sx:{color:"#5C6372"},children:"Adjuntar archivo"}),d.jsx(b.Box,{sx:{flex:1}}),d.jsx(b.Button,{variant:"contained",onClick:L,disabled:!ee,sx:{maxWidth:146,width:"100%",height:53,backgroundColor:"#336BE1"},children:"Enviar"})]})]}),d.jsxs(b.Dialog,{fullWidth:!0,maxWidth:"sm",fullScreen:Ae,open:K,onClose:Z,children:[d.jsxs(b.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1},children:["Selecciona tu auto de seguimiento",d.jsx(b.IconButton,{onClick:Z,size:"small",children:d.jsx(sn,{})})]}),d.jsxs(b.DialogContent,{children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.jsx(b.TextField,{placeholder:"Buscar...",fullWidth:!0,size:"small",value:z,onChange:B=>H(B.target.value),sx:{mb:2}}),Ct!=null&&d.jsx(b.Chip,{size:"small",label:`Distribuidora: ${Ct}`})]}),d.jsxs(b.Typography,{variant:"caption",fontWeight:600,children:["RESULTADOS (",gt.length,")"]}),d.jsxs(b.List,{sx:{p:0},children:[gt.map((B,J)=>{const ye=cr(B,J,p.id),Ze=A.includes(String(ye))||A.includes(ye),kt=Me==null||cr(B,J,p.distributorId)==Me;return d.jsx(b.ListItem,{disableGutters:!0,sx:{p:0,opacity:kt?1:.5},children:d.jsx(b.Box,{onClick:()=>kt&&re(ye),sx:{cursor:kt?"pointer":"not-allowed",p:.5,backgroundColor:Ze?"#e5f0ff":"transparent",width:"100%",borderBottom:"solid 1px #D3D4D5"},children:a?a(B,J):d.jsx("pre",{style:{margin:0},children:JSON.stringify(B,null,2)})})},String(ye))}),gt.length===0&&d.jsx(b.Box,{p:2,children:d.jsx(b.Typography,{children:"Tu búsqueda no generó resultados"})})]})]}),d.jsxs(b.DialogActions,{sx:{px:3,pb:2},children:[d.jsx(b.Button,{variant:"text",onClick:Z,sx:{color:"#5C6372"},children:"Cancelar"}),d.jsx(b.Button,{variant:"contained",onClick:ne,sx:{backgroundColor:"#336BE1"},children:"Guardar selección"})]})]})]})}ut.AddCliente=dC,ut.ApiProvider=o1,ut.AuthProvider=Oy,ut.Clientes=JS,ut.CustomSnackbar=Wf,ut.EventsProvider=xS,ut.ModalCorreo=mC,ut.MyCalendar=CS,ut.useAuth=ia,ut.useAuthRepository=Rs,ut.useEventRepository=xa,Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"})}));
|