randmarcomps 1.238.0 → 1.239.0
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/randmarcomps.d.ts +20 -0
- package/dist/randmarcomps.js +1017 -1014
- package/dist/randmarcomps.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/randmarcomps.js
CHANGED
|
@@ -67258,93 +67258,6 @@ function ReportsSection({ isLoading: t, userEmail: e, appID: n }) {
|
|
|
67258
67258
|
] }) })
|
|
67259
67259
|
] });
|
|
67260
67260
|
}
|
|
67261
|
-
function SalesChart({
|
|
67262
|
-
salesData: t,
|
|
67263
|
-
chartHeight: e = 300,
|
|
67264
|
-
units: n = "$",
|
|
67265
|
-
unitsPosition: o = "left",
|
|
67266
|
-
className: l,
|
|
67267
|
-
isLoading: d = !1
|
|
67268
|
-
}) {
|
|
67269
|
-
const [f, g] = useState([]), [b, S] = useState(!0), _ = !d && !!t && t.length > 0;
|
|
67270
|
-
return useEffect(() => {
|
|
67271
|
-
if (d || !t || t.length === 0) {
|
|
67272
|
-
g([]);
|
|
67273
|
-
return;
|
|
67274
|
-
}
|
|
67275
|
-
const C = t.reduce(
|
|
67276
|
-
(Q, F) => {
|
|
67277
|
-
const j = F.Day ?? 0, te = Math.floor(j).toString();
|
|
67278
|
-
if (te.length !== 8 || isNaN(Number.parseInt(te)))
|
|
67279
|
-
return console.warn(`Skipping invalid Day format: ${F.Day}`), Q;
|
|
67280
|
-
const ne = te.substring(0, 4), se = te.substring(4, 6), ge = `${ne}-${se}`;
|
|
67281
|
-
return Q[ge] = (Q[ge] || 0) + (F.ExtendedPrice ?? 0), Q;
|
|
67282
|
-
},
|
|
67283
|
-
{}
|
|
67284
|
-
), E = Object.keys(C).sort(), R = /* @__PURE__ */ new Date(), A = R.getFullYear(), I = R.getMonth(), M = R.getDate(), O = `${A}-${(I + 1).toString().padStart(2, "0")}`, q = { ...C };
|
|
67285
|
-
if (b && E.length > 0 && E[E.length - 1] === O) {
|
|
67286
|
-
const Q = q[O], F = new Date(A, I + 1, 0).getDate();
|
|
67287
|
-
if (M < F && M > 0) {
|
|
67288
|
-
const te = Q / M * F;
|
|
67289
|
-
q[O] = te;
|
|
67290
|
-
}
|
|
67291
|
-
}
|
|
67292
|
-
const z = E.map((Q) => {
|
|
67293
|
-
const F = q[Q], [j, te] = Q.split("-").map(Number);
|
|
67294
|
-
return {
|
|
67295
|
-
month: new Date(j, te - 1).toLocaleString("default", { month: "short", year: "numeric" }),
|
|
67296
|
-
sales: F
|
|
67297
|
-
};
|
|
67298
|
-
});
|
|
67299
|
-
g(z);
|
|
67300
|
-
}, [t, b, d]), d ? /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
67301
|
-
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-24" }) }),
|
|
67302
|
-
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
67303
|
-
/* @__PURE__ */ jsx("div", { style: { height: e }, children: /* @__PURE__ */ jsx(Skeleton, { className: "h-full w-full rounded-md" }) }),
|
|
67304
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 my-1 pt-2", children: [
|
|
67305
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-10" }),
|
|
67306
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" })
|
|
67307
|
-
] }),
|
|
67308
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4 mt-1" })
|
|
67309
|
-
] })
|
|
67310
|
-
] }) : f.length === 0 ? /* @__PURE__ */ jsx(
|
|
67311
|
-
"div",
|
|
67312
|
-
{
|
|
67313
|
-
style: { height: e },
|
|
67314
|
-
className: l || "p-4 text-center text-muted-foreground flex items-center justify-center",
|
|
67315
|
-
children: "No monthly sales data to display."
|
|
67316
|
-
}
|
|
67317
|
-
) : /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
67318
|
-
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Sales" }) }),
|
|
67319
|
-
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
67320
|
-
/* @__PURE__ */ jsx(
|
|
67321
|
-
AreaChart,
|
|
67322
|
-
{
|
|
67323
|
-
data: f,
|
|
67324
|
-
units: n,
|
|
67325
|
-
unitsPosition: o,
|
|
67326
|
-
height: e,
|
|
67327
|
-
className: l
|
|
67328
|
-
}
|
|
67329
|
-
),
|
|
67330
|
-
_ && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
67331
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 my-1 pt-2", children: [
|
|
67332
|
-
/* @__PURE__ */ jsx(
|
|
67333
|
-
Switch,
|
|
67334
|
-
{
|
|
67335
|
-
checked: b,
|
|
67336
|
-
onCheckedChange: S,
|
|
67337
|
-
id: "extrapolate-switch",
|
|
67338
|
-
"aria-label": "Toggle sales extrapolation"
|
|
67339
|
-
}
|
|
67340
|
-
),
|
|
67341
|
-
/* @__PURE__ */ jsx(Label$2, { htmlFor: "extrapolate-switch", children: "Extrapolate" })
|
|
67342
|
-
] }),
|
|
67343
|
-
b && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "* Sales for the current month are projected, not actual." })
|
|
67344
|
-
] })
|
|
67345
|
-
] })
|
|
67346
|
-
] });
|
|
67347
|
-
}
|
|
67348
67261
|
function UnsavedChangesDialog({
|
|
67349
67262
|
isOpen: t,
|
|
67350
67263
|
onClose: e,
|
|
@@ -67409,534 +67322,228 @@ function useRouterNavigationGuard(t) {
|
|
|
67409
67322
|
NavigationGuardDialog: f
|
|
67410
67323
|
};
|
|
67411
67324
|
}
|
|
67412
|
-
|
|
67413
|
-
|
|
67414
|
-
|
|
67415
|
-
|
|
67416
|
-
|
|
67417
|
-
|
|
67418
|
-
|
|
67419
|
-
|
|
67420
|
-
|
|
67421
|
-
|
|
67422
|
-
|
|
67423
|
-
|
|
67424
|
-
|
|
67425
|
-
|
|
67426
|
-
|
|
67427
|
-
//
|
|
67428
|
-
), S =
|
|
67429
|
-
|
|
67430
|
-
|
|
67431
|
-
|
|
67432
|
-
|
|
67433
|
-
|
|
67434
|
-
|
|
67435
|
-
|
|
67436
|
-
|
|
67437
|
-
|
|
67438
|
-
|
|
67439
|
-
|
|
67440
|
-
|
|
67441
|
-
|
|
67442
|
-
|
|
67443
|
-
|
|
67444
|
-
|
|
67445
|
-
|
|
67446
|
-
|
|
67447
|
-
"div",
|
|
67325
|
+
function ResellerOverview({
|
|
67326
|
+
appID: t,
|
|
67327
|
+
reseller: e,
|
|
67328
|
+
readonly: n,
|
|
67329
|
+
userEmail: o,
|
|
67330
|
+
isSuperAdmin: l,
|
|
67331
|
+
withoutReports: d = !1
|
|
67332
|
+
}) {
|
|
67333
|
+
const {
|
|
67334
|
+
data: f,
|
|
67335
|
+
isLoading: g,
|
|
67336
|
+
isError: b
|
|
67337
|
+
} = useGetV4PartnerByApplicationIdAccountResellerQuery({
|
|
67338
|
+
applicationId: t ?? "",
|
|
67339
|
+
withSpecification: !0
|
|
67340
|
+
// This should ideally make Qualifications include full Manufacturer details
|
|
67341
|
+
}, { skip: !!e }), [S, _] = useState({
|
|
67342
|
+
publicInfo: { hasUnsavedChanges: !1 }
|
|
67343
|
+
}), C = useCallback(() => n ? !1 : S.publicInfo.hasUnsavedChanges, [n, S]), E = useCallback((q, z) => {
|
|
67344
|
+
_((Q) => {
|
|
67345
|
+
var F;
|
|
67346
|
+
return ((F = Q[q]) == null ? void 0 : F.hasUnsavedChanges) !== z.hasUnsavedChanges ? {
|
|
67347
|
+
...Q,
|
|
67348
|
+
[q]: z
|
|
67349
|
+
} : Q;
|
|
67350
|
+
});
|
|
67351
|
+
}, []), { NavigationGuardDialog: R } = useRouterNavigationGuard(C), A = e ?? f, I = !n || !!(A != null && A.Statement) && (A.Statement.Total ?? 0) > 0, M = (A == null ? void 0 : A.QualifiedManufacturers) ?? [], O = (A == null ? void 0 : A.Qualifications) ?? [];
|
|
67352
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
67353
|
+
b ? /* @__PURE__ */ jsx(Card, { className: "p-6", children: /* @__PURE__ */ jsxs(Alert, { variant: "destructive", children: [
|
|
67354
|
+
/* @__PURE__ */ jsx(CircleAlert, { className: "h-4 w-4" }),
|
|
67355
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Error" }),
|
|
67356
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: "There was an error loading your reseller information. Please try again later." })
|
|
67357
|
+
] }) }) : /* @__PURE__ */ jsxs("div", { className: "space-y-6 mb-6", children: [
|
|
67358
|
+
/* @__PURE__ */ jsx(
|
|
67359
|
+
SalesSummary,
|
|
67448
67360
|
{
|
|
67449
|
-
|
|
67450
|
-
|
|
67451
|
-
|
|
67361
|
+
fiscalYearMonthStart: (A == null ? void 0 : A.FiscalYearMonthStart) || 1,
|
|
67362
|
+
salesData: A == null ? void 0 : A.SalesData,
|
|
67363
|
+
isLoading: g
|
|
67364
|
+
}
|
|
67365
|
+
),
|
|
67366
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
|
|
67367
|
+
/* @__PURE__ */ jsx(
|
|
67368
|
+
SalesChart,
|
|
67369
|
+
{
|
|
67370
|
+
salesData: (A == null ? void 0 : A.SalesStatistics) ?? [],
|
|
67371
|
+
isLoading: g
|
|
67372
|
+
}
|
|
67373
|
+
),
|
|
67374
|
+
/* @__PURE__ */ jsx(OrderCategories, { openOrders: (A == null ? void 0 : A.ActiveOrderDetails) ?? [], isLoading: g }),
|
|
67375
|
+
I && /* @__PURE__ */ jsx(
|
|
67376
|
+
BillingCard,
|
|
67377
|
+
{
|
|
67378
|
+
appID: t,
|
|
67379
|
+
reseller: A || {},
|
|
67380
|
+
withoutReports: d,
|
|
67381
|
+
isLoading: g
|
|
67382
|
+
}
|
|
67383
|
+
),
|
|
67384
|
+
/* @__PURE__ */ jsx(
|
|
67385
|
+
PublicInfo,
|
|
67386
|
+
{
|
|
67387
|
+
reseller: A || {},
|
|
67388
|
+
appID: t ?? "",
|
|
67389
|
+
isLoading: g,
|
|
67390
|
+
readonly: n,
|
|
67391
|
+
onUnsavedChanges: (q) => E("publicInfo", { hasUnsavedChanges: q })
|
|
67392
|
+
}
|
|
67393
|
+
),
|
|
67394
|
+
/* @__PURE__ */ jsx(
|
|
67395
|
+
AccountTier,
|
|
67396
|
+
{
|
|
67397
|
+
isSuperAdmin: l,
|
|
67398
|
+
readonly: n,
|
|
67399
|
+
reseller: A || {},
|
|
67400
|
+
appID: t ?? "",
|
|
67401
|
+
isLoading: g
|
|
67402
|
+
}
|
|
67403
|
+
)
|
|
67404
|
+
] }),
|
|
67405
|
+
g || M.length > 0 ? /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
67406
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Manufacturers you are qualified for" }) }),
|
|
67407
|
+
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: g ? Array.from({ length: 2 }).map((q, z) => /* @__PURE__ */ jsx(ManufacturerCard, { loading: !0 }, z)) : M.map((q) => /* @__PURE__ */ jsx(
|
|
67408
|
+
ManufacturerCard,
|
|
67409
|
+
{
|
|
67410
|
+
manufacturer: q,
|
|
67411
|
+
link: `https://dashboard.randmar.io/${t}/Partner/${q.ManufacturerId}`
|
|
67412
|
+
},
|
|
67413
|
+
q.ManufacturerId
|
|
67414
|
+
)) }) })
|
|
67415
|
+
] }) : /* @__PURE__ */ jsx(
|
|
67416
|
+
ResellerQualificationsCard,
|
|
67417
|
+
{
|
|
67418
|
+
qualifications: O
|
|
67419
|
+
}
|
|
67420
|
+
),
|
|
67421
|
+
/* @__PURE__ */ jsx(
|
|
67422
|
+
ResellerOpportunitiesTable,
|
|
67423
|
+
{
|
|
67424
|
+
applicationId: t,
|
|
67425
|
+
opportunities: A == null ? void 0 : A.Opportunities,
|
|
67426
|
+
loading: g
|
|
67427
|
+
}
|
|
67428
|
+
),
|
|
67429
|
+
!d && /* @__PURE__ */ jsx(
|
|
67430
|
+
ReportsSection,
|
|
67431
|
+
{
|
|
67432
|
+
appID: t,
|
|
67433
|
+
userEmail: o,
|
|
67434
|
+
isLoading: g
|
|
67452
67435
|
}
|
|
67453
67436
|
)
|
|
67454
|
-
] })
|
|
67455
|
-
/* @__PURE__ */ jsx(
|
|
67456
|
-
|
|
67457
|
-
t
|
|
67458
|
-
] }) })
|
|
67459
|
-
] }) }) : /* @__PURE__ */ jsx("div", { className: "flex items-center justify-start h-8 w-8 text-muted-foreground", children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 100, children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
|
|
67460
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx("div", { className: "h-8 w-8 flex items-center justify-center border border-dashed border-border rounded-sm bg-muted/20 p-1", children: /* @__PURE__ */ jsx("span", { className: "text-xs font-mono", children: "N/A" }) }) }),
|
|
67461
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "top", align: "center", children: /* @__PURE__ */ jsx("p", { children: "ID: Not available" }) })
|
|
67462
|
-
] }) }) });
|
|
67463
|
-
};
|
|
67464
|
-
function getEndDateStatus(t) {
|
|
67465
|
-
if (!t) return { text: "No End Date", variant: "neutral", daysRemaining: null };
|
|
67466
|
-
const e = new Date(t);
|
|
67467
|
-
if (isNaN(e.getTime()))
|
|
67468
|
-
return { text: "Invalid Date", variant: "neutral", daysRemaining: null };
|
|
67469
|
-
const n = /* @__PURE__ */ new Date(), o = new Date(e.getFullYear(), e.getMonth(), e.getDate()), l = new Date(n.getFullYear(), n.getMonth(), n.getDate()), d = o.getTime() - l.getTime(), f = Math.ceil(d / (1e3 * 60 * 60 * 24));
|
|
67470
|
-
return f < 0 ? { text: `Ended ${Math.abs(f)}d ago`, variant: "destructive", daysRemaining: f } : f === 0 ? { text: "Ends today", variant: "destructive", daysRemaining: f } : f <= 7 ? { text: `Ends in ${f}d`, variant: "destructive", daysRemaining: f } : f <= 30 ? { text: `Ends in ${f}d`, variant: "warning", daysRemaining: f } : { text: `Ends in ${f}d`, variant: "neutral", daysRemaining: f };
|
|
67437
|
+
] }),
|
|
67438
|
+
/* @__PURE__ */ jsx(R, {})
|
|
67439
|
+
] });
|
|
67471
67440
|
}
|
|
67472
|
-
|
|
67473
|
-
|
|
67474
|
-
|
|
67475
|
-
|
|
67476
|
-
|
|
67477
|
-
|
|
67478
|
-
|
|
67479
|
-
|
|
67480
|
-
|
|
67481
|
-
|
|
67482
|
-
|
|
67483
|
-
|
|
67484
|
-
}
|
|
67485
|
-
|
|
67486
|
-
|
|
67487
|
-
|
|
67488
|
-
...
|
|
67489
|
-
[
|
|
67490
|
-
...ge[te],
|
|
67491
|
-
[ne]: se
|
|
67492
|
-
}
|
|
67441
|
+
/**
|
|
67442
|
+
* table-core
|
|
67443
|
+
*
|
|
67444
|
+
* Copyright (c) TanStack
|
|
67445
|
+
*
|
|
67446
|
+
* This source code is licensed under the MIT license found in the
|
|
67447
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
67448
|
+
*
|
|
67449
|
+
* @license MIT
|
|
67450
|
+
*/
|
|
67451
|
+
function functionalUpdate(t, e) {
|
|
67452
|
+
return typeof t == "function" ? t(e) : t;
|
|
67453
|
+
}
|
|
67454
|
+
function makeStateUpdater(t, e) {
|
|
67455
|
+
return (n) => {
|
|
67456
|
+
e.setState((o) => ({
|
|
67457
|
+
...o,
|
|
67458
|
+
[t]: functionalUpdate(n, o[t])
|
|
67493
67459
|
}));
|
|
67494
|
-
}
|
|
67495
|
-
|
|
67496
|
-
|
|
67497
|
-
|
|
67498
|
-
|
|
67499
|
-
|
|
67500
|
-
|
|
67501
|
-
|
|
67502
|
-
|
|
67503
|
-
|
|
67504
|
-
|
|
67505
|
-
|
|
67506
|
-
|
|
67507
|
-
|
|
67508
|
-
variant: "success"
|
|
67509
|
-
});
|
|
67510
|
-
}).catch((se) => {
|
|
67511
|
-
var ge;
|
|
67512
|
-
console.error("Set as default error:", se), o({
|
|
67513
|
-
title: "Error",
|
|
67514
|
-
description: ((ge = se.data) == null ? void 0 : ge.message) || se.message || "An error occurred while setting this opportunity as default.",
|
|
67515
|
-
variant: "destructive"
|
|
67516
|
-
});
|
|
67517
|
-
}).finally(() => {
|
|
67518
|
-
E(ne, "isSettingDefault", !1);
|
|
67460
|
+
};
|
|
67461
|
+
}
|
|
67462
|
+
function isFunction$1(t) {
|
|
67463
|
+
return t instanceof Function;
|
|
67464
|
+
}
|
|
67465
|
+
function isNumberArray(t) {
|
|
67466
|
+
return Array.isArray(t) && t.every((e) => typeof e == "number");
|
|
67467
|
+
}
|
|
67468
|
+
function flattenBy(t, e) {
|
|
67469
|
+
const n = [], o = (l) => {
|
|
67470
|
+
l.forEach((d) => {
|
|
67471
|
+
n.push(d);
|
|
67472
|
+
const f = e(d);
|
|
67473
|
+
f != null && f.length && o(f);
|
|
67519
67474
|
});
|
|
67520
|
-
}
|
|
67521
|
-
|
|
67522
|
-
|
|
67523
|
-
|
|
67524
|
-
|
|
67525
|
-
|
|
67526
|
-
|
|
67527
|
-
|
|
67528
|
-
|
|
67529
|
-
|
|
67475
|
+
};
|
|
67476
|
+
return o(t), n;
|
|
67477
|
+
}
|
|
67478
|
+
function memo(t, e, n) {
|
|
67479
|
+
let o = [], l;
|
|
67480
|
+
return (d) => {
|
|
67481
|
+
let f;
|
|
67482
|
+
n.key && n.debug && (f = Date.now());
|
|
67483
|
+
const g = t(d);
|
|
67484
|
+
if (!(g.length !== o.length || g.some((_, C) => o[C] !== _)))
|
|
67485
|
+
return l;
|
|
67486
|
+
o = g;
|
|
67487
|
+
let S;
|
|
67488
|
+
if (n.key && n.debug && (S = Date.now()), l = e(...g), n == null || n.onChange == null || n.onChange(l), n.key && n.debug && n != null && n.debug()) {
|
|
67489
|
+
const _ = Math.round((Date.now() - f) * 100) / 100, C = Math.round((Date.now() - S) * 100) / 100, E = C / 16, R = (A, I) => {
|
|
67490
|
+
for (A = String(A); A.length < I; )
|
|
67491
|
+
A = " " + A;
|
|
67492
|
+
return A;
|
|
67493
|
+
};
|
|
67494
|
+
console.info(`%c⏱ ${R(C, 5)} /${R(_, 5)} ms`, `
|
|
67495
|
+
font-size: .6rem;
|
|
67496
|
+
font-weight: bold;
|
|
67497
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * E, 120))}deg 100% 31%);`, n == null ? void 0 : n.key);
|
|
67530
67498
|
}
|
|
67531
|
-
|
|
67532
|
-
|
|
67533
|
-
|
|
67534
|
-
|
|
67535
|
-
|
|
67536
|
-
|
|
67537
|
-
|
|
67538
|
-
|
|
67539
|
-
|
|
67540
|
-
|
|
67541
|
-
|
|
67542
|
-
|
|
67543
|
-
|
|
67544
|
-
|
|
67545
|
-
|
|
67546
|
-
|
|
67547
|
-
|
|
67548
|
-
|
|
67549
|
-
|
|
67550
|
-
|
|
67551
|
-
|
|
67552
|
-
|
|
67553
|
-
|
|
67554
|
-
|
|
67555
|
-
|
|
67556
|
-
|
|
67557
|
-
|
|
67558
|
-
|
|
67559
|
-
|
|
67560
|
-
|
|
67561
|
-
|
|
67562
|
-
|
|
67563
|
-
|
|
67564
|
-
|
|
67565
|
-
|
|
67566
|
-
|
|
67567
|
-
|
|
67568
|
-
|
|
67569
|
-
|
|
67570
|
-
|
|
67571
|
-
|
|
67572
|
-
|
|
67573
|
-
|
|
67574
|
-
|
|
67575
|
-
|
|
67576
|
-
|
|
67577
|
-
|
|
67578
|
-
|
|
67579
|
-
enableFiltering: !0
|
|
67580
|
-
},
|
|
67581
|
-
{
|
|
67582
|
-
accessorKey: "BidNumber",
|
|
67583
|
-
header: "Bid Number",
|
|
67584
|
-
cell: ({ row: te }) => te.original.BidNumber ?? "N/A",
|
|
67585
|
-
enableSorting: !0,
|
|
67586
|
-
enableFiltering: !0
|
|
67587
|
-
},
|
|
67588
|
-
{
|
|
67589
|
-
id: "statusInfo",
|
|
67590
|
-
header: "Status",
|
|
67591
|
-
cell: ({ row: te }) => {
|
|
67592
|
-
const ne = te.original, se = ne.Active === !0, ge = getEndDateStatus(ne.EndDate);
|
|
67593
|
-
let oe = "border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400";
|
|
67594
|
-
return ge.variant === "destructive" ? oe = "border-red-500 bg-red-100 text-red-700 dark:border-red-600 dark:bg-red-900/50 dark:text-red-400" : ge.variant === "warning" && (oe = "border-yellow-500 bg-yellow-100 text-yellow-700 dark:border-yellow-600 dark:bg-yellow-900/50 dark:text-yellow-400"), /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 min-w-[200px]", children: [
|
|
67595
|
-
/* @__PURE__ */ jsx(Badge, { variant: "outline", className: se ? "border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400 font-medium" : "border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400 font-medium", children: se ? "Active" : "Inactive" }),
|
|
67596
|
-
ne.EndDate && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: `${oe} font-medium`, children: ge.text }),
|
|
67597
|
-
/* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 100, children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
|
|
67598
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 p-0 data-[state=delayed-open]:bg-accent data-[state=instant-open]:bg-accent", children: /* @__PURE__ */ jsx(Info, { className: "h-4 w-4 text-muted-foreground" }) }) }),
|
|
67599
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "top", align: "center", className: "bg-popover text-popover-foreground p-2 rounded shadow-lg", children: /* @__PURE__ */ jsxs("div", { className: "text-sm space-y-1", children: [
|
|
67600
|
-
/* @__PURE__ */ jsxs("p", { children: [
|
|
67601
|
-
/* @__PURE__ */ jsx("strong", { children: "Start:" }),
|
|
67602
|
-
" ",
|
|
67603
|
-
formatDate(ne.StartDate)
|
|
67604
|
-
] }),
|
|
67605
|
-
/* @__PURE__ */ jsxs("p", { children: [
|
|
67606
|
-
/* @__PURE__ */ jsx("strong", { children: "End:" }),
|
|
67607
|
-
" ",
|
|
67608
|
-
formatDate(ne.EndDate)
|
|
67609
|
-
] }),
|
|
67610
|
-
/* @__PURE__ */ jsxs("p", { children: [
|
|
67611
|
-
/* @__PURE__ */ jsx("strong", { children: "Updated:" }),
|
|
67612
|
-
" ",
|
|
67613
|
-
formatDate(ne.LastUpdate)
|
|
67614
|
-
] })
|
|
67615
|
-
] }) })
|
|
67616
|
-
] }) })
|
|
67617
|
-
] });
|
|
67618
|
-
},
|
|
67619
|
-
enableFiltering: !1
|
|
67620
|
-
},
|
|
67621
|
-
{
|
|
67622
|
-
id: "actions",
|
|
67623
|
-
header: "Actions",
|
|
67624
|
-
cell: ({ row: te }) => {
|
|
67625
|
-
var $e, Be;
|
|
67626
|
-
const ne = te.original;
|
|
67627
|
-
if (!ne.BidNumber)
|
|
67628
|
-
return /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Actions unavailable" });
|
|
67629
|
-
const se = ne.BidNumber, ge = ($e = l[se]) == null ? void 0 : $e.isSettingDefault, oe = (_ == null ? void 0 : _.BidNumber) === se && ((Be = l[se]) == null ? void 0 : Be.isSendingReport), Ae = ge || oe, Ne = ne.CanBeSetAsDefault === !0;
|
|
67630
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex space-x-2", children: [
|
|
67631
|
-
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: () => A(ne), disabled: Ae || !Ne, title: Ne ? "Set as default" : "This opportunity cannot be set as default", className: "flex items-center", children: [
|
|
67632
|
-
ge ? /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Star, { className: "mr-2 h-4 w-4" }),
|
|
67633
|
-
" Set Default"
|
|
67634
|
-
] }),
|
|
67635
|
-
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: () => M(ne), disabled: Ae, title: "Send report by email", className: "flex items-center", children: [
|
|
67636
|
-
oe ? /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Send, { className: "mr-2 h-4 w-4" }),
|
|
67637
|
-
" Send Report"
|
|
67638
|
-
] })
|
|
67639
|
-
] });
|
|
67640
|
-
}
|
|
67641
|
-
}
|
|
67642
|
-
],
|
|
67643
|
-
[l, A, M, _]
|
|
67644
|
-
), z = useMemo(() => {
|
|
67645
|
-
const te = {};
|
|
67646
|
-
if (e) {
|
|
67647
|
-
const ne = Array.from(
|
|
67648
|
-
new Set(e.map((ge) => ge.ManufacturerId).filter((ge) => ge != null))
|
|
67649
|
-
);
|
|
67650
|
-
te.ManufacturerId = ne;
|
|
67651
|
-
const se = Array.from(
|
|
67652
|
-
new Set(e.map((ge) => ge.OpportunityName || ge.Opportunity).filter((ge) => ge != null))
|
|
67653
|
-
);
|
|
67654
|
-
te.opportunityDisplay = se;
|
|
67655
|
-
}
|
|
67656
|
-
return te;
|
|
67657
|
-
}, [e]), Q = e || [], F = _ != null && _.BidNumber ? (j = l[_.BidNumber]) == null ? void 0 : j.isSendingReport : !1;
|
|
67658
|
-
return n ? /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
67659
|
-
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
67660
|
-
" ",
|
|
67661
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-48" }),
|
|
67662
|
-
" "
|
|
67663
|
-
] }),
|
|
67664
|
-
/* @__PURE__ */ jsxs(CardContent, { className: "space-y-4", children: [
|
|
67665
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full rounded-md border" }),
|
|
67666
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-48 w-full rounded-md border" }),
|
|
67667
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pt-4", children: [
|
|
67668
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-[130px]" }),
|
|
67669
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
67670
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-20" }),
|
|
67671
|
-
" ",
|
|
67672
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-24" }),
|
|
67673
|
-
" ",
|
|
67674
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-9" }),
|
|
67675
|
-
" ",
|
|
67676
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-9" })
|
|
67677
|
-
] })
|
|
67678
|
-
] })
|
|
67679
|
-
] })
|
|
67680
|
-
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
67681
|
-
/* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
67682
|
-
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
67683
|
-
" ",
|
|
67684
|
-
/* @__PURE__ */ jsx(CardTitle, { className: "text-1xl font-bold", children: "Opportunities" }),
|
|
67685
|
-
" "
|
|
67686
|
-
] }),
|
|
67687
|
-
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(DataTable, { columns: q, data: Q, uniqueValues: z }) })
|
|
67688
|
-
] }),
|
|
67689
|
-
/* @__PURE__ */ jsx(Dialog, { open: f, onOpenChange: (te) => {
|
|
67690
|
-
g(te), te || (C(null), S(""));
|
|
67691
|
-
}, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-[425px]", children: [
|
|
67692
|
-
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
67693
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: "Send Opportunity Report" }),
|
|
67694
|
-
/* @__PURE__ */ jsxs(DialogDescription, { children: [
|
|
67695
|
-
"Enter the email address to send the report for opportunity: ",
|
|
67696
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
67697
|
-
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: (_ == null ? void 0 : _.OpportunityName) || (_ == null ? void 0 : _.Opportunity) || "N/A" }),
|
|
67698
|
-
(_ == null ? void 0 : _.BidNumber) && /* @__PURE__ */ jsxs("span", { className: "block text-sm text-muted-foreground", children: [
|
|
67699
|
-
"Bid Number: ",
|
|
67700
|
-
_.BidNumber
|
|
67701
|
-
] })
|
|
67702
|
-
] })
|
|
67703
|
-
] }),
|
|
67704
|
-
/* @__PURE__ */ jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-4 items-center gap-4", children: [
|
|
67705
|
-
/* @__PURE__ */ jsx(Label$2, { htmlFor: "email", className: "text-right", children: "Email" }),
|
|
67706
|
-
/* @__PURE__ */ jsx(Input, { id: "email", type: "email", value: b, onChange: (te) => S(te.target.value), placeholder: "recipient@example.com", className: "col-span-3", disabled: F })
|
|
67707
|
-
] }) }),
|
|
67708
|
-
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
67709
|
-
/* @__PURE__ */ jsx(Button, { variant: "outline", onClick: () => g(!1), disabled: F, children: "Cancel" }),
|
|
67710
|
-
/* @__PURE__ */ jsxs(Button, { type: "submit", onClick: O, disabled: F, children: [
|
|
67711
|
-
F && /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
67712
|
-
" Send Report"
|
|
67713
|
-
] })
|
|
67714
|
-
] })
|
|
67715
|
-
] }) })
|
|
67716
|
-
] });
|
|
67717
|
-
};
|
|
67718
|
-
function ResellerOverview({
|
|
67719
|
-
appID: t,
|
|
67720
|
-
reseller: e,
|
|
67721
|
-
readonly: n,
|
|
67722
|
-
userEmail: o,
|
|
67723
|
-
isSuperAdmin: l,
|
|
67724
|
-
withoutReports: d = !1
|
|
67725
|
-
}) {
|
|
67726
|
-
const {
|
|
67727
|
-
data: f,
|
|
67728
|
-
isLoading: g,
|
|
67729
|
-
isError: b
|
|
67730
|
-
} = useGetV4PartnerByApplicationIdAccountResellerQuery({
|
|
67731
|
-
applicationId: t ?? "",
|
|
67732
|
-
withSpecification: !0
|
|
67733
|
-
// This should ideally make Qualifications include full Manufacturer details
|
|
67734
|
-
}, { skip: !!e }), [S, _] = useState({
|
|
67735
|
-
publicInfo: { hasUnsavedChanges: !1 }
|
|
67736
|
-
}), C = useCallback(() => n ? !1 : S.publicInfo.hasUnsavedChanges, [n, S]), E = useCallback((q, z) => {
|
|
67737
|
-
_((Q) => {
|
|
67738
|
-
var F;
|
|
67739
|
-
return ((F = Q[q]) == null ? void 0 : F.hasUnsavedChanges) !== z.hasUnsavedChanges ? {
|
|
67740
|
-
...Q,
|
|
67741
|
-
[q]: z
|
|
67742
|
-
} : Q;
|
|
67743
|
-
});
|
|
67744
|
-
}, []), { NavigationGuardDialog: R } = useRouterNavigationGuard(C), A = e ?? f, I = !n || !!(A != null && A.Statement) && (A.Statement.Total ?? 0) > 0, M = (A == null ? void 0 : A.QualifiedManufacturers) ?? [], O = (A == null ? void 0 : A.Qualifications) ?? [];
|
|
67745
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
67746
|
-
b ? /* @__PURE__ */ jsx(Card, { className: "p-6", children: /* @__PURE__ */ jsxs(Alert, { variant: "destructive", children: [
|
|
67747
|
-
/* @__PURE__ */ jsx(CircleAlert, { className: "h-4 w-4" }),
|
|
67748
|
-
/* @__PURE__ */ jsx(AlertTitle, { children: "Error" }),
|
|
67749
|
-
/* @__PURE__ */ jsx(AlertDescription, { children: "There was an error loading your reseller information. Please try again later." })
|
|
67750
|
-
] }) }) : /* @__PURE__ */ jsxs("div", { className: "space-y-6 mb-6", children: [
|
|
67751
|
-
/* @__PURE__ */ jsx(
|
|
67752
|
-
SalesSummary,
|
|
67753
|
-
{
|
|
67754
|
-
fiscalYearMonthStart: (A == null ? void 0 : A.FiscalYearMonthStart) || 1,
|
|
67755
|
-
salesData: A == null ? void 0 : A.SalesData,
|
|
67756
|
-
isLoading: g
|
|
67757
|
-
}
|
|
67758
|
-
),
|
|
67759
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
|
|
67760
|
-
/* @__PURE__ */ jsx(
|
|
67761
|
-
SalesChart,
|
|
67762
|
-
{
|
|
67763
|
-
salesData: (A == null ? void 0 : A.SalesStatistics) ?? [],
|
|
67764
|
-
isLoading: g
|
|
67765
|
-
}
|
|
67766
|
-
),
|
|
67767
|
-
/* @__PURE__ */ jsx(OrderCategories, { openOrders: (A == null ? void 0 : A.ActiveOrderDetails) ?? [], isLoading: g }),
|
|
67768
|
-
I && /* @__PURE__ */ jsx(
|
|
67769
|
-
BillingCard,
|
|
67770
|
-
{
|
|
67771
|
-
appID: t,
|
|
67772
|
-
reseller: A || {},
|
|
67773
|
-
withoutReports: d,
|
|
67774
|
-
isLoading: g
|
|
67775
|
-
}
|
|
67776
|
-
),
|
|
67777
|
-
/* @__PURE__ */ jsx(
|
|
67778
|
-
PublicInfo,
|
|
67779
|
-
{
|
|
67780
|
-
reseller: A || {},
|
|
67781
|
-
appID: t ?? "",
|
|
67782
|
-
isLoading: g,
|
|
67783
|
-
readonly: n,
|
|
67784
|
-
onUnsavedChanges: (q) => E("publicInfo", { hasUnsavedChanges: q })
|
|
67785
|
-
}
|
|
67786
|
-
),
|
|
67787
|
-
/* @__PURE__ */ jsx(
|
|
67788
|
-
AccountTier,
|
|
67789
|
-
{
|
|
67790
|
-
isSuperAdmin: l,
|
|
67791
|
-
readonly: n,
|
|
67792
|
-
reseller: A || {},
|
|
67793
|
-
appID: t ?? "",
|
|
67794
|
-
isLoading: g
|
|
67795
|
-
}
|
|
67796
|
-
)
|
|
67797
|
-
] }),
|
|
67798
|
-
g || M.length > 0 ? /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
67799
|
-
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Manufacturers you are qualified for" }) }),
|
|
67800
|
-
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: g ? Array.from({ length: 2 }).map((q, z) => /* @__PURE__ */ jsx(ManufacturerCard, { loading: !0 }, z)) : M.map((q) => /* @__PURE__ */ jsx(
|
|
67801
|
-
ManufacturerCard,
|
|
67802
|
-
{
|
|
67803
|
-
manufacturer: q,
|
|
67804
|
-
link: `https://dashboard.randmar.io/${t}/Partner/${q.ManufacturerId}`
|
|
67805
|
-
},
|
|
67806
|
-
q.ManufacturerId
|
|
67807
|
-
)) }) })
|
|
67808
|
-
] }) : /* @__PURE__ */ jsx(
|
|
67809
|
-
ResellerQualificationsCard,
|
|
67810
|
-
{
|
|
67811
|
-
qualifications: O
|
|
67812
|
-
}
|
|
67813
|
-
),
|
|
67814
|
-
/* @__PURE__ */ jsx(
|
|
67815
|
-
Opportunities,
|
|
67816
|
-
{
|
|
67817
|
-
applicationId: t,
|
|
67818
|
-
opportunities: A == null ? void 0 : A.Opportunities,
|
|
67819
|
-
loading: g
|
|
67820
|
-
}
|
|
67821
|
-
),
|
|
67822
|
-
!d && /* @__PURE__ */ jsx(
|
|
67823
|
-
ReportsSection,
|
|
67824
|
-
{
|
|
67825
|
-
appID: t,
|
|
67826
|
-
userEmail: o,
|
|
67827
|
-
isLoading: g
|
|
67828
|
-
}
|
|
67829
|
-
)
|
|
67830
|
-
] }),
|
|
67831
|
-
/* @__PURE__ */ jsx(R, {})
|
|
67832
|
-
] });
|
|
67833
|
-
}
|
|
67834
|
-
/**
|
|
67835
|
-
* table-core
|
|
67836
|
-
*
|
|
67837
|
-
* Copyright (c) TanStack
|
|
67838
|
-
*
|
|
67839
|
-
* This source code is licensed under the MIT license found in the
|
|
67840
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
67841
|
-
*
|
|
67842
|
-
* @license MIT
|
|
67843
|
-
*/
|
|
67844
|
-
function functionalUpdate(t, e) {
|
|
67845
|
-
return typeof t == "function" ? t(e) : t;
|
|
67846
|
-
}
|
|
67847
|
-
function makeStateUpdater(t, e) {
|
|
67848
|
-
return (n) => {
|
|
67849
|
-
e.setState((o) => ({
|
|
67850
|
-
...o,
|
|
67851
|
-
[t]: functionalUpdate(n, o[t])
|
|
67852
|
-
}));
|
|
67853
|
-
};
|
|
67854
|
-
}
|
|
67855
|
-
function isFunction$1(t) {
|
|
67856
|
-
return t instanceof Function;
|
|
67857
|
-
}
|
|
67858
|
-
function isNumberArray(t) {
|
|
67859
|
-
return Array.isArray(t) && t.every((e) => typeof e == "number");
|
|
67860
|
-
}
|
|
67861
|
-
function flattenBy(t, e) {
|
|
67862
|
-
const n = [], o = (l) => {
|
|
67863
|
-
l.forEach((d) => {
|
|
67864
|
-
n.push(d);
|
|
67865
|
-
const f = e(d);
|
|
67866
|
-
f != null && f.length && o(f);
|
|
67867
|
-
});
|
|
67868
|
-
};
|
|
67869
|
-
return o(t), n;
|
|
67870
|
-
}
|
|
67871
|
-
function memo(t, e, n) {
|
|
67872
|
-
let o = [], l;
|
|
67873
|
-
return (d) => {
|
|
67874
|
-
let f;
|
|
67875
|
-
n.key && n.debug && (f = Date.now());
|
|
67876
|
-
const g = t(d);
|
|
67877
|
-
if (!(g.length !== o.length || g.some((_, C) => o[C] !== _)))
|
|
67878
|
-
return l;
|
|
67879
|
-
o = g;
|
|
67880
|
-
let S;
|
|
67881
|
-
if (n.key && n.debug && (S = Date.now()), l = e(...g), n == null || n.onChange == null || n.onChange(l), n.key && n.debug && n != null && n.debug()) {
|
|
67882
|
-
const _ = Math.round((Date.now() - f) * 100) / 100, C = Math.round((Date.now() - S) * 100) / 100, E = C / 16, R = (A, I) => {
|
|
67883
|
-
for (A = String(A); A.length < I; )
|
|
67884
|
-
A = " " + A;
|
|
67885
|
-
return A;
|
|
67886
|
-
};
|
|
67887
|
-
console.info(`%c⏱ ${R(C, 5)} /${R(_, 5)} ms`, `
|
|
67888
|
-
font-size: .6rem;
|
|
67889
|
-
font-weight: bold;
|
|
67890
|
-
color: hsl(${Math.max(0, Math.min(120 - 120 * E, 120))}deg 100% 31%);`, n == null ? void 0 : n.key);
|
|
67891
|
-
}
|
|
67892
|
-
return l;
|
|
67893
|
-
};
|
|
67894
|
-
}
|
|
67895
|
-
function getMemoOptions(t, e, n, o) {
|
|
67896
|
-
return {
|
|
67897
|
-
debug: () => {
|
|
67898
|
-
var l;
|
|
67899
|
-
return (l = t == null ? void 0 : t.debugAll) != null ? l : t[e];
|
|
67900
|
-
},
|
|
67901
|
-
key: process.env.NODE_ENV === "development" && n,
|
|
67902
|
-
onChange: o
|
|
67903
|
-
};
|
|
67904
|
-
}
|
|
67905
|
-
function createCell(t, e, n, o) {
|
|
67906
|
-
const l = () => {
|
|
67907
|
-
var f;
|
|
67908
|
-
return (f = d.getValue()) != null ? f : t.options.renderFallbackValue;
|
|
67909
|
-
}, d = {
|
|
67910
|
-
id: `${e.id}_${n.id}`,
|
|
67911
|
-
row: e,
|
|
67912
|
-
column: n,
|
|
67913
|
-
getValue: () => e.getValue(o),
|
|
67914
|
-
renderValue: l,
|
|
67915
|
-
getContext: memo(() => [t, n, e, d], (f, g, b, S) => ({
|
|
67916
|
-
table: f,
|
|
67917
|
-
column: g,
|
|
67918
|
-
row: b,
|
|
67919
|
-
cell: S,
|
|
67920
|
-
getValue: S.getValue,
|
|
67921
|
-
renderValue: S.renderValue
|
|
67922
|
-
}), getMemoOptions(t.options, "debugCells", "cell.getContext"))
|
|
67923
|
-
};
|
|
67924
|
-
return t._features.forEach((f) => {
|
|
67925
|
-
f.createCell == null || f.createCell(d, n, e, t);
|
|
67926
|
-
}, {}), d;
|
|
67927
|
-
}
|
|
67928
|
-
function createColumn(t, e, n, o) {
|
|
67929
|
-
var l, d;
|
|
67930
|
-
const g = {
|
|
67931
|
-
...t._getDefaultColumnDef(),
|
|
67932
|
-
...e
|
|
67933
|
-
}, b = g.accessorKey;
|
|
67934
|
-
let S = (l = (d = g.id) != null ? d : b ? typeof String.prototype.replaceAll == "function" ? b.replaceAll(".", "_") : b.replace(/\./g, "_") : void 0) != null ? l : typeof g.header == "string" ? g.header : void 0, _;
|
|
67935
|
-
if (g.accessorFn ? _ = g.accessorFn : b && (b.includes(".") ? _ = (E) => {
|
|
67936
|
-
let R = E;
|
|
67937
|
-
for (const I of b.split(".")) {
|
|
67938
|
-
var A;
|
|
67939
|
-
R = (A = R) == null ? void 0 : A[I], process.env.NODE_ENV !== "production" && R === void 0 && console.warn(`"${I}" in deeply nested key "${b}" returned undefined.`);
|
|
67499
|
+
return l;
|
|
67500
|
+
};
|
|
67501
|
+
}
|
|
67502
|
+
function getMemoOptions(t, e, n, o) {
|
|
67503
|
+
return {
|
|
67504
|
+
debug: () => {
|
|
67505
|
+
var l;
|
|
67506
|
+
return (l = t == null ? void 0 : t.debugAll) != null ? l : t[e];
|
|
67507
|
+
},
|
|
67508
|
+
key: process.env.NODE_ENV === "development" && n,
|
|
67509
|
+
onChange: o
|
|
67510
|
+
};
|
|
67511
|
+
}
|
|
67512
|
+
function createCell(t, e, n, o) {
|
|
67513
|
+
const l = () => {
|
|
67514
|
+
var f;
|
|
67515
|
+
return (f = d.getValue()) != null ? f : t.options.renderFallbackValue;
|
|
67516
|
+
}, d = {
|
|
67517
|
+
id: `${e.id}_${n.id}`,
|
|
67518
|
+
row: e,
|
|
67519
|
+
column: n,
|
|
67520
|
+
getValue: () => e.getValue(o),
|
|
67521
|
+
renderValue: l,
|
|
67522
|
+
getContext: memo(() => [t, n, e, d], (f, g, b, S) => ({
|
|
67523
|
+
table: f,
|
|
67524
|
+
column: g,
|
|
67525
|
+
row: b,
|
|
67526
|
+
cell: S,
|
|
67527
|
+
getValue: S.getValue,
|
|
67528
|
+
renderValue: S.renderValue
|
|
67529
|
+
}), getMemoOptions(t.options, "debugCells", "cell.getContext"))
|
|
67530
|
+
};
|
|
67531
|
+
return t._features.forEach((f) => {
|
|
67532
|
+
f.createCell == null || f.createCell(d, n, e, t);
|
|
67533
|
+
}, {}), d;
|
|
67534
|
+
}
|
|
67535
|
+
function createColumn(t, e, n, o) {
|
|
67536
|
+
var l, d;
|
|
67537
|
+
const g = {
|
|
67538
|
+
...t._getDefaultColumnDef(),
|
|
67539
|
+
...e
|
|
67540
|
+
}, b = g.accessorKey;
|
|
67541
|
+
let S = (l = (d = g.id) != null ? d : b ? typeof String.prototype.replaceAll == "function" ? b.replaceAll(".", "_") : b.replace(/\./g, "_") : void 0) != null ? l : typeof g.header == "string" ? g.header : void 0, _;
|
|
67542
|
+
if (g.accessorFn ? _ = g.accessorFn : b && (b.includes(".") ? _ = (E) => {
|
|
67543
|
+
let R = E;
|
|
67544
|
+
for (const I of b.split(".")) {
|
|
67545
|
+
var A;
|
|
67546
|
+
R = (A = R) == null ? void 0 : A[I], process.env.NODE_ENV !== "production" && R === void 0 && console.warn(`"${I}" in deeply nested key "${b}" returned undefined.`);
|
|
67940
67547
|
}
|
|
67941
67548
|
return R;
|
|
67942
67549
|
} : _ = (E) => E[g.accessorKey]), !S)
|
|
@@ -85496,445 +85103,839 @@ const undo = buildCommand(!1, !0), redo = buildCommand(!0, !0), History = Extens
|
|
|
85496
85103
|
addPasteRules() {
|
|
85497
85104
|
return [
|
|
85498
85105
|
markPasteRule({
|
|
85499
|
-
find: starPasteRegex,
|
|
85500
|
-
type: this.type
|
|
85501
|
-
}),
|
|
85502
|
-
markPasteRule({
|
|
85503
|
-
find: underscorePasteRegex,
|
|
85106
|
+
find: starPasteRegex,
|
|
85107
|
+
type: this.type
|
|
85108
|
+
}),
|
|
85109
|
+
markPasteRule({
|
|
85110
|
+
find: underscorePasteRegex,
|
|
85111
|
+
type: this.type
|
|
85112
|
+
})
|
|
85113
|
+
];
|
|
85114
|
+
}
|
|
85115
|
+
}), ListItem = Node$1.create({
|
|
85116
|
+
name: "listItem",
|
|
85117
|
+
addOptions() {
|
|
85118
|
+
return {
|
|
85119
|
+
HTMLAttributes: {},
|
|
85120
|
+
bulletListTypeName: "bulletList",
|
|
85121
|
+
orderedListTypeName: "orderedList"
|
|
85122
|
+
};
|
|
85123
|
+
},
|
|
85124
|
+
content: "paragraph block*",
|
|
85125
|
+
defining: !0,
|
|
85126
|
+
parseHTML() {
|
|
85127
|
+
return [
|
|
85128
|
+
{
|
|
85129
|
+
tag: "li"
|
|
85130
|
+
}
|
|
85131
|
+
];
|
|
85132
|
+
},
|
|
85133
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
85134
|
+
return ["li", mergeAttributes(this.options.HTMLAttributes, t), 0];
|
|
85135
|
+
},
|
|
85136
|
+
addKeyboardShortcuts() {
|
|
85137
|
+
return {
|
|
85138
|
+
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
85139
|
+
Tab: () => this.editor.commands.sinkListItem(this.name),
|
|
85140
|
+
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
85141
|
+
};
|
|
85142
|
+
}
|
|
85143
|
+
}), ListItemName = "listItem", TextStyleName = "textStyle", inputRegex$1 = /^(\d+)\.\s$/, OrderedList = Node$1.create({
|
|
85144
|
+
name: "orderedList",
|
|
85145
|
+
addOptions() {
|
|
85146
|
+
return {
|
|
85147
|
+
itemTypeName: "listItem",
|
|
85148
|
+
HTMLAttributes: {},
|
|
85149
|
+
keepMarks: !1,
|
|
85150
|
+
keepAttributes: !1
|
|
85151
|
+
};
|
|
85152
|
+
},
|
|
85153
|
+
group: "block list",
|
|
85154
|
+
content() {
|
|
85155
|
+
return `${this.options.itemTypeName}+`;
|
|
85156
|
+
},
|
|
85157
|
+
addAttributes() {
|
|
85158
|
+
return {
|
|
85159
|
+
start: {
|
|
85160
|
+
default: 1,
|
|
85161
|
+
parseHTML: (t) => t.hasAttribute("start") ? parseInt(t.getAttribute("start") || "", 10) : 1
|
|
85162
|
+
},
|
|
85163
|
+
type: {
|
|
85164
|
+
default: null,
|
|
85165
|
+
parseHTML: (t) => t.getAttribute("type")
|
|
85166
|
+
}
|
|
85167
|
+
};
|
|
85168
|
+
},
|
|
85169
|
+
parseHTML() {
|
|
85170
|
+
return [
|
|
85171
|
+
{
|
|
85172
|
+
tag: "ol"
|
|
85173
|
+
}
|
|
85174
|
+
];
|
|
85175
|
+
},
|
|
85176
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
85177
|
+
const { start: e, ...n } = t;
|
|
85178
|
+
return e === 1 ? ["ol", mergeAttributes(this.options.HTMLAttributes, n), 0] : ["ol", mergeAttributes(this.options.HTMLAttributes, t), 0];
|
|
85179
|
+
},
|
|
85180
|
+
addCommands() {
|
|
85181
|
+
return {
|
|
85182
|
+
toggleOrderedList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName, this.editor.getAttributes(TextStyleName)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
85183
|
+
};
|
|
85184
|
+
},
|
|
85185
|
+
addKeyboardShortcuts() {
|
|
85186
|
+
return {
|
|
85187
|
+
"Mod-Shift-7": () => this.editor.commands.toggleOrderedList()
|
|
85188
|
+
};
|
|
85189
|
+
},
|
|
85190
|
+
addInputRules() {
|
|
85191
|
+
let t = wrappingInputRule({
|
|
85192
|
+
find: inputRegex$1,
|
|
85193
|
+
type: this.type,
|
|
85194
|
+
getAttributes: (e) => ({ start: +e[1] }),
|
|
85195
|
+
joinPredicate: (e, n) => n.childCount + n.attrs.start === +e[1]
|
|
85196
|
+
});
|
|
85197
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (t = wrappingInputRule({
|
|
85198
|
+
find: inputRegex$1,
|
|
85199
|
+
type: this.type,
|
|
85200
|
+
keepMarks: this.options.keepMarks,
|
|
85201
|
+
keepAttributes: this.options.keepAttributes,
|
|
85202
|
+
getAttributes: (e) => ({ start: +e[1], ...this.editor.getAttributes(TextStyleName) }),
|
|
85203
|
+
joinPredicate: (e, n) => n.childCount + n.attrs.start === +e[1],
|
|
85204
|
+
editor: this.editor
|
|
85205
|
+
})), [
|
|
85206
|
+
t
|
|
85207
|
+
];
|
|
85208
|
+
}
|
|
85209
|
+
}), Paragraph = Node$1.create({
|
|
85210
|
+
name: "paragraph",
|
|
85211
|
+
priority: 1e3,
|
|
85212
|
+
addOptions() {
|
|
85213
|
+
return {
|
|
85214
|
+
HTMLAttributes: {}
|
|
85215
|
+
};
|
|
85216
|
+
},
|
|
85217
|
+
group: "block",
|
|
85218
|
+
content: "inline*",
|
|
85219
|
+
parseHTML() {
|
|
85220
|
+
return [
|
|
85221
|
+
{ tag: "p" }
|
|
85222
|
+
];
|
|
85223
|
+
},
|
|
85224
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
85225
|
+
return ["p", mergeAttributes(this.options.HTMLAttributes, t), 0];
|
|
85226
|
+
},
|
|
85227
|
+
addCommands() {
|
|
85228
|
+
return {
|
|
85229
|
+
setParagraph: () => ({ commands: t }) => t.setNode(this.name)
|
|
85230
|
+
};
|
|
85231
|
+
},
|
|
85232
|
+
addKeyboardShortcuts() {
|
|
85233
|
+
return {
|
|
85234
|
+
"Mod-Alt-0": () => this.editor.commands.setParagraph()
|
|
85235
|
+
};
|
|
85236
|
+
}
|
|
85237
|
+
}), inputRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, pasteRegex = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, Strike = Mark.create({
|
|
85238
|
+
name: "strike",
|
|
85239
|
+
addOptions() {
|
|
85240
|
+
return {
|
|
85241
|
+
HTMLAttributes: {}
|
|
85242
|
+
};
|
|
85243
|
+
},
|
|
85244
|
+
parseHTML() {
|
|
85245
|
+
return [
|
|
85246
|
+
{
|
|
85247
|
+
tag: "s"
|
|
85248
|
+
},
|
|
85249
|
+
{
|
|
85250
|
+
tag: "del"
|
|
85251
|
+
},
|
|
85252
|
+
{
|
|
85253
|
+
tag: "strike"
|
|
85254
|
+
},
|
|
85255
|
+
{
|
|
85256
|
+
style: "text-decoration",
|
|
85257
|
+
consuming: !1,
|
|
85258
|
+
getAttrs: (t) => t.includes("line-through") ? {} : !1
|
|
85259
|
+
}
|
|
85260
|
+
];
|
|
85261
|
+
},
|
|
85262
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
85263
|
+
return ["s", mergeAttributes(this.options.HTMLAttributes, t), 0];
|
|
85264
|
+
},
|
|
85265
|
+
addCommands() {
|
|
85266
|
+
return {
|
|
85267
|
+
setStrike: () => ({ commands: t }) => t.setMark(this.name),
|
|
85268
|
+
toggleStrike: () => ({ commands: t }) => t.toggleMark(this.name),
|
|
85269
|
+
unsetStrike: () => ({ commands: t }) => t.unsetMark(this.name)
|
|
85270
|
+
};
|
|
85271
|
+
},
|
|
85272
|
+
addKeyboardShortcuts() {
|
|
85273
|
+
return {
|
|
85274
|
+
"Mod-Shift-s": () => this.editor.commands.toggleStrike()
|
|
85275
|
+
};
|
|
85276
|
+
},
|
|
85277
|
+
addInputRules() {
|
|
85278
|
+
return [
|
|
85279
|
+
markInputRule({
|
|
85280
|
+
find: inputRegex,
|
|
85281
|
+
type: this.type
|
|
85282
|
+
})
|
|
85283
|
+
];
|
|
85284
|
+
},
|
|
85285
|
+
addPasteRules() {
|
|
85286
|
+
return [
|
|
85287
|
+
markPasteRule({
|
|
85288
|
+
find: pasteRegex,
|
|
85504
85289
|
type: this.type
|
|
85505
85290
|
})
|
|
85506
85291
|
];
|
|
85507
85292
|
}
|
|
85508
|
-
}),
|
|
85509
|
-
name: "
|
|
85293
|
+
}), Text = Node$1.create({
|
|
85294
|
+
name: "text",
|
|
85295
|
+
group: "inline"
|
|
85296
|
+
}), StarterKit = Extension.create({
|
|
85297
|
+
name: "starterKit",
|
|
85298
|
+
addExtensions() {
|
|
85299
|
+
const t = [];
|
|
85300
|
+
return this.options.bold !== !1 && t.push(Bold.configure(this.options.bold)), this.options.blockquote !== !1 && t.push(Blockquote.configure(this.options.blockquote)), this.options.bulletList !== !1 && t.push(BulletList.configure(this.options.bulletList)), this.options.code !== !1 && t.push(Code.configure(this.options.code)), this.options.codeBlock !== !1 && t.push(CodeBlock.configure(this.options.codeBlock)), this.options.document !== !1 && t.push(Document.configure(this.options.document)), this.options.dropcursor !== !1 && t.push(Dropcursor.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && t.push(Gapcursor.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && t.push(HardBreak.configure(this.options.hardBreak)), this.options.heading !== !1 && t.push(Heading.configure(this.options.heading)), this.options.history !== !1 && t.push(History.configure(this.options.history)), this.options.horizontalRule !== !1 && t.push(HorizontalRule.configure(this.options.horizontalRule)), this.options.italic !== !1 && t.push(Italic.configure(this.options.italic)), this.options.listItem !== !1 && t.push(ListItem.configure(this.options.listItem)), this.options.orderedList !== !1 && t.push(OrderedList.configure(this.options.orderedList)), this.options.paragraph !== !1 && t.push(Paragraph.configure(this.options.paragraph)), this.options.strike !== !1 && t.push(Strike.configure(this.options.strike)), this.options.text !== !1 && t.push(Text.configure(this.options.text)), t;
|
|
85301
|
+
}
|
|
85302
|
+
}), Underline = Mark.create({
|
|
85303
|
+
name: "underline",
|
|
85510
85304
|
addOptions() {
|
|
85511
85305
|
return {
|
|
85512
|
-
HTMLAttributes: {}
|
|
85513
|
-
bulletListTypeName: "bulletList",
|
|
85514
|
-
orderedListTypeName: "orderedList"
|
|
85306
|
+
HTMLAttributes: {}
|
|
85515
85307
|
};
|
|
85516
85308
|
},
|
|
85517
|
-
content: "paragraph block*",
|
|
85518
|
-
defining: !0,
|
|
85519
85309
|
parseHTML() {
|
|
85520
85310
|
return [
|
|
85521
85311
|
{
|
|
85522
|
-
tag: "
|
|
85312
|
+
tag: "u"
|
|
85313
|
+
},
|
|
85314
|
+
{
|
|
85315
|
+
style: "text-decoration",
|
|
85316
|
+
consuming: !1,
|
|
85317
|
+
getAttrs: (t) => t.includes("underline") ? {} : !1
|
|
85523
85318
|
}
|
|
85524
85319
|
];
|
|
85525
85320
|
},
|
|
85526
85321
|
renderHTML({ HTMLAttributes: t }) {
|
|
85527
|
-
return ["
|
|
85322
|
+
return ["u", mergeAttributes(this.options.HTMLAttributes, t), 0];
|
|
85528
85323
|
},
|
|
85529
|
-
|
|
85530
|
-
return {
|
|
85531
|
-
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
85532
|
-
Tab: () => this.editor.commands.sinkListItem(this.name),
|
|
85533
|
-
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
85534
|
-
};
|
|
85535
|
-
}
|
|
85536
|
-
}), ListItemName = "listItem", TextStyleName = "textStyle", inputRegex$1 = /^(\d+)\.\s$/, OrderedList = Node$1.create({
|
|
85537
|
-
name: "orderedList",
|
|
85538
|
-
addOptions() {
|
|
85324
|
+
addCommands() {
|
|
85539
85325
|
return {
|
|
85540
|
-
|
|
85541
|
-
|
|
85542
|
-
|
|
85543
|
-
keepAttributes: !1
|
|
85326
|
+
setUnderline: () => ({ commands: t }) => t.setMark(this.name),
|
|
85327
|
+
toggleUnderline: () => ({ commands: t }) => t.toggleMark(this.name),
|
|
85328
|
+
unsetUnderline: () => ({ commands: t }) => t.unsetMark(this.name)
|
|
85544
85329
|
};
|
|
85545
85330
|
},
|
|
85546
|
-
|
|
85547
|
-
content() {
|
|
85548
|
-
return `${this.options.itemTypeName}+`;
|
|
85549
|
-
},
|
|
85550
|
-
addAttributes() {
|
|
85331
|
+
addKeyboardShortcuts() {
|
|
85551
85332
|
return {
|
|
85552
|
-
|
|
85553
|
-
|
|
85554
|
-
|
|
85333
|
+
"Mod-u": () => this.editor.commands.toggleUnderline(),
|
|
85334
|
+
"Mod-U": () => this.editor.commands.toggleUnderline()
|
|
85335
|
+
};
|
|
85336
|
+
}
|
|
85337
|
+
}), formatOptions = [
|
|
85338
|
+
{ value: "paragraph", label: "Paragraph" },
|
|
85339
|
+
{ value: "h1", label: "Heading 1" },
|
|
85340
|
+
{ value: "h2", label: "Heading 2" },
|
|
85341
|
+
{ value: "h3", label: "Heading 3" },
|
|
85342
|
+
{ value: "h4", label: "Heading 4" },
|
|
85343
|
+
{ value: "h5", label: "Heading 5" },
|
|
85344
|
+
{ value: "h6", label: "Heading 6" }
|
|
85345
|
+
], editorStyles = `
|
|
85346
|
+
.ProseMirror {
|
|
85347
|
+
min-height: 150px;
|
|
85348
|
+
padding: 0.5rem;
|
|
85349
|
+
}
|
|
85350
|
+
.ProseMirror:focus {
|
|
85351
|
+
outline: none;
|
|
85352
|
+
}
|
|
85353
|
+
.ProseMirror h1 {
|
|
85354
|
+
font-size: 2em;
|
|
85355
|
+
font-weight: bold;
|
|
85356
|
+
margin-bottom: 0.5em;
|
|
85357
|
+
}
|
|
85358
|
+
.ProseMirror h2 {
|
|
85359
|
+
font-size: 1.5em;
|
|
85360
|
+
font-weight: bold;
|
|
85361
|
+
margin-bottom: 0.5em;
|
|
85362
|
+
}
|
|
85363
|
+
.ProseMirror h3 {
|
|
85364
|
+
font-size: 1.17em;
|
|
85365
|
+
font-weight: bold;
|
|
85366
|
+
margin-bottom: 0.5em;
|
|
85367
|
+
}
|
|
85368
|
+
.ProseMirror h4 {
|
|
85369
|
+
font-size: 1em;
|
|
85370
|
+
font-weight: bold;
|
|
85371
|
+
margin-bottom: 0.5em;
|
|
85372
|
+
}
|
|
85373
|
+
.ProseMirror h5 {
|
|
85374
|
+
font-size: 0.83em;
|
|
85375
|
+
font-weight: bold;
|
|
85376
|
+
margin-bottom: 0.5em;
|
|
85377
|
+
}
|
|
85378
|
+
.ProseMirror h6 {
|
|
85379
|
+
font-size: 0.67em;
|
|
85380
|
+
font-weight: bold;
|
|
85381
|
+
margin-bottom: 0.5em;
|
|
85382
|
+
}
|
|
85383
|
+
.ProseMirror ul {
|
|
85384
|
+
list-style-type: disc;
|
|
85385
|
+
padding-left: 1.5em;
|
|
85386
|
+
margin-bottom: 0.5em;
|
|
85387
|
+
}
|
|
85388
|
+
.ProseMirror ol {
|
|
85389
|
+
list-style-type: decimal;
|
|
85390
|
+
padding-left: 1.5em;
|
|
85391
|
+
margin-bottom: 0.5em;
|
|
85392
|
+
}
|
|
85393
|
+
.ProseMirror li {
|
|
85394
|
+
margin-bottom: 0.25em;
|
|
85395
|
+
}
|
|
85396
|
+
.ProseMirror p {
|
|
85397
|
+
margin-bottom: 0.5em;
|
|
85398
|
+
}
|
|
85399
|
+
`;
|
|
85400
|
+
function RichTextEditor({ id: t, name: e, value: n, onChange: o, placeholder: l, className: d, ...f }) {
|
|
85401
|
+
const [g, b] = useState(!1), S = useRef(null), _ = useRef(null), C = useEditor({
|
|
85402
|
+
extensions: [StarterKit, Underline],
|
|
85403
|
+
content: n,
|
|
85404
|
+
editorProps: {
|
|
85405
|
+
attributes: {
|
|
85406
|
+
class: "prose prose-sm sm:prose dark:prose-invert focus:outline-none",
|
|
85407
|
+
id: t ?? "",
|
|
85408
|
+
name: e ?? ""
|
|
85409
|
+
}
|
|
85410
|
+
},
|
|
85411
|
+
onUpdate: ({ editor: O }) => {
|
|
85412
|
+
const q = O.getHTML();
|
|
85413
|
+
o({
|
|
85414
|
+
target: {
|
|
85415
|
+
id: t,
|
|
85416
|
+
name: e,
|
|
85417
|
+
value: q
|
|
85418
|
+
}
|
|
85419
|
+
});
|
|
85420
|
+
}
|
|
85421
|
+
});
|
|
85422
|
+
useEffect(() => {
|
|
85423
|
+
C && n !== C.getHTML() && C.commands.setContent(n);
|
|
85424
|
+
}, [n, C]);
|
|
85425
|
+
const E = useCallback(
|
|
85426
|
+
(O) => {
|
|
85427
|
+
if (C)
|
|
85428
|
+
if (C.chain().focus(), O === "paragraph")
|
|
85429
|
+
C.chain().setParagraph().run();
|
|
85430
|
+
else {
|
|
85431
|
+
const q = Number.parseInt(O.slice(1));
|
|
85432
|
+
C.chain().setHeading({ level: q }).run();
|
|
85433
|
+
}
|
|
85434
|
+
},
|
|
85435
|
+
[C]
|
|
85436
|
+
), R = useCallback(
|
|
85437
|
+
(O) => {
|
|
85438
|
+
if (C)
|
|
85439
|
+
switch (C.chain().focus(), O) {
|
|
85440
|
+
case "bold":
|
|
85441
|
+
C.chain().toggleBold().run();
|
|
85442
|
+
break;
|
|
85443
|
+
case "italic":
|
|
85444
|
+
C.chain().toggleItalic().run();
|
|
85445
|
+
break;
|
|
85446
|
+
case "underline":
|
|
85447
|
+
C.chain().toggleUnderline().run();
|
|
85448
|
+
break;
|
|
85449
|
+
case "strike":
|
|
85450
|
+
C.chain().toggleStrike().run();
|
|
85451
|
+
break;
|
|
85452
|
+
case "bulletList":
|
|
85453
|
+
C.chain().toggleBulletList().run();
|
|
85454
|
+
break;
|
|
85455
|
+
case "orderedList":
|
|
85456
|
+
C.chain().toggleOrderedList().run();
|
|
85457
|
+
break;
|
|
85458
|
+
}
|
|
85459
|
+
},
|
|
85460
|
+
[C]
|
|
85461
|
+
), A = useCallback(() => {
|
|
85462
|
+
b((O) => !O);
|
|
85463
|
+
}, []), I = useCallback(
|
|
85464
|
+
(O) => {
|
|
85465
|
+
const q = O.target.value;
|
|
85466
|
+
C && C.commands.setContent(q), o({
|
|
85467
|
+
target: {
|
|
85468
|
+
id: t,
|
|
85469
|
+
name: e,
|
|
85470
|
+
value: q
|
|
85471
|
+
}
|
|
85472
|
+
});
|
|
85473
|
+
},
|
|
85474
|
+
[o, C, t, e]
|
|
85475
|
+
), M = useCallback(() => {
|
|
85476
|
+
!g && C && C.commands.focus();
|
|
85477
|
+
}, [g, C]);
|
|
85478
|
+
return C ? /* @__PURE__ */ jsxs(
|
|
85479
|
+
"div",
|
|
85480
|
+
{
|
|
85481
|
+
ref: _,
|
|
85482
|
+
className: cn(
|
|
85483
|
+
"border border-input rounded-md overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring",
|
|
85484
|
+
d
|
|
85485
|
+
),
|
|
85486
|
+
onClick: M,
|
|
85487
|
+
...f,
|
|
85488
|
+
children: [
|
|
85489
|
+
/* @__PURE__ */ jsx("style", { children: editorStyles }),
|
|
85490
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center p-2 border-b border-input gap-2 bg-background", children: [
|
|
85491
|
+
/* @__PURE__ */ jsxs(Select, { onValueChange: E, disabled: g, children: [
|
|
85492
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "w-[160px]", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Format" }) }),
|
|
85493
|
+
/* @__PURE__ */ jsx(SelectContent, { children: formatOptions.map((O) => /* @__PURE__ */ jsx(SelectItem, { value: O.value, children: O.label }, O.value)) })
|
|
85494
|
+
] }),
|
|
85495
|
+
["bold", "italic", "underline", "strike", "bulletList", "orderedList"].map((O) => /* @__PURE__ */ jsxs(
|
|
85496
|
+
Button,
|
|
85497
|
+
{
|
|
85498
|
+
type: "button",
|
|
85499
|
+
variant: "ghost",
|
|
85500
|
+
size: "sm",
|
|
85501
|
+
onClick: () => R(O),
|
|
85502
|
+
className: C.isActive(O) ? "bg-muted" : "",
|
|
85503
|
+
disabled: g,
|
|
85504
|
+
children: [
|
|
85505
|
+
O === "bold" && /* @__PURE__ */ jsx(Bold$1, { className: "h-4 w-4" }),
|
|
85506
|
+
O === "italic" && /* @__PURE__ */ jsx(Italic$1, { className: "h-4 w-4" }),
|
|
85507
|
+
O === "underline" && /* @__PURE__ */ jsx(Underline$1, { className: "h-4 w-4" }),
|
|
85508
|
+
O === "strike" && /* @__PURE__ */ jsx(Strikethrough, { className: "h-4 w-4" }),
|
|
85509
|
+
O === "bulletList" && /* @__PURE__ */ jsx(List$1, { className: "h-4 w-4" }),
|
|
85510
|
+
O === "orderedList" && /* @__PURE__ */ jsx(ListOrdered, { className: "h-4 w-4" })
|
|
85511
|
+
]
|
|
85512
|
+
},
|
|
85513
|
+
O
|
|
85514
|
+
)),
|
|
85515
|
+
/* @__PURE__ */ jsx(
|
|
85516
|
+
Button,
|
|
85517
|
+
{
|
|
85518
|
+
type: "button",
|
|
85519
|
+
variant: "ghost",
|
|
85520
|
+
size: "sm",
|
|
85521
|
+
onClick: A,
|
|
85522
|
+
className: g ? "bg-muted" : "",
|
|
85523
|
+
children: /* @__PURE__ */ jsx(Code$1, { className: "h-4 w-4" })
|
|
85524
|
+
}
|
|
85525
|
+
)
|
|
85526
|
+
] }),
|
|
85527
|
+
/* @__PURE__ */ jsx("div", { className: "p-3", children: g ? /* @__PURE__ */ jsx(
|
|
85528
|
+
Textarea,
|
|
85529
|
+
{
|
|
85530
|
+
ref: S,
|
|
85531
|
+
id: t,
|
|
85532
|
+
name: e,
|
|
85533
|
+
value: C.getHTML(),
|
|
85534
|
+
onChange: I,
|
|
85535
|
+
className: cn(
|
|
85536
|
+
"min-h-[150px] font-mono text-sm resize-none border-0 focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
85537
|
+
d
|
|
85538
|
+
),
|
|
85539
|
+
placeholder: l
|
|
85540
|
+
}
|
|
85541
|
+
) : /* @__PURE__ */ jsx(EditorContent, { editor: C }) })
|
|
85542
|
+
]
|
|
85543
|
+
}
|
|
85544
|
+
) : null;
|
|
85545
|
+
}
|
|
85546
|
+
function SalesChart({
|
|
85547
|
+
salesData: t,
|
|
85548
|
+
chartHeight: e = 300,
|
|
85549
|
+
units: n = "$",
|
|
85550
|
+
unitsPosition: o = "left",
|
|
85551
|
+
className: l,
|
|
85552
|
+
isLoading: d = !1
|
|
85553
|
+
}) {
|
|
85554
|
+
const [f, g] = useState([]), [b, S] = useState(!0), _ = !d && !!t && t.length > 0;
|
|
85555
|
+
return useEffect(() => {
|
|
85556
|
+
if (d || !t || t.length === 0) {
|
|
85557
|
+
g([]);
|
|
85558
|
+
return;
|
|
85559
|
+
}
|
|
85560
|
+
const C = t.reduce(
|
|
85561
|
+
(Q, F) => {
|
|
85562
|
+
const j = F.Day ?? 0, te = Math.floor(j).toString();
|
|
85563
|
+
if (te.length !== 8 || isNaN(Number.parseInt(te)))
|
|
85564
|
+
return console.warn(`Skipping invalid Day format: ${F.Day}`), Q;
|
|
85565
|
+
const ne = te.substring(0, 4), se = te.substring(4, 6), ge = `${ne}-${se}`;
|
|
85566
|
+
return Q[ge] = (Q[ge] || 0) + (F.ExtendedPrice ?? 0), Q;
|
|
85555
85567
|
},
|
|
85556
|
-
|
|
85557
|
-
|
|
85558
|
-
|
|
85559
|
-
|
|
85560
|
-
|
|
85561
|
-
|
|
85562
|
-
|
|
85563
|
-
return [
|
|
85564
|
-
{
|
|
85565
|
-
tag: "ol"
|
|
85568
|
+
{}
|
|
85569
|
+
), E = Object.keys(C).sort(), R = /* @__PURE__ */ new Date(), A = R.getFullYear(), I = R.getMonth(), M = R.getDate(), O = `${A}-${(I + 1).toString().padStart(2, "0")}`, q = { ...C };
|
|
85570
|
+
if (b && E.length > 0 && E[E.length - 1] === O) {
|
|
85571
|
+
const Q = q[O], F = new Date(A, I + 1, 0).getDate();
|
|
85572
|
+
if (M < F && M > 0) {
|
|
85573
|
+
const te = Q / M * F;
|
|
85574
|
+
q[O] = te;
|
|
85566
85575
|
}
|
|
85567
|
-
|
|
85568
|
-
|
|
85569
|
-
|
|
85570
|
-
|
|
85571
|
-
|
|
85572
|
-
|
|
85573
|
-
|
|
85574
|
-
return {
|
|
85575
|
-
toggleOrderedList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName, this.editor.getAttributes(TextStyleName)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
85576
|
-
};
|
|
85577
|
-
},
|
|
85578
|
-
addKeyboardShortcuts() {
|
|
85579
|
-
return {
|
|
85580
|
-
"Mod-Shift-7": () => this.editor.commands.toggleOrderedList()
|
|
85581
|
-
};
|
|
85582
|
-
},
|
|
85583
|
-
addInputRules() {
|
|
85584
|
-
let t = wrappingInputRule({
|
|
85585
|
-
find: inputRegex$1,
|
|
85586
|
-
type: this.type,
|
|
85587
|
-
getAttributes: (e) => ({ start: +e[1] }),
|
|
85588
|
-
joinPredicate: (e, n) => n.childCount + n.attrs.start === +e[1]
|
|
85576
|
+
}
|
|
85577
|
+
const z = E.map((Q) => {
|
|
85578
|
+
const F = q[Q], [j, te] = Q.split("-").map(Number);
|
|
85579
|
+
return {
|
|
85580
|
+
month: new Date(j, te - 1).toLocaleString("default", { month: "short", year: "numeric" }),
|
|
85581
|
+
sales: F
|
|
85582
|
+
};
|
|
85589
85583
|
});
|
|
85590
|
-
|
|
85591
|
-
|
|
85592
|
-
|
|
85593
|
-
|
|
85594
|
-
|
|
85595
|
-
|
|
85596
|
-
|
|
85597
|
-
|
|
85598
|
-
|
|
85599
|
-
|
|
85600
|
-
]
|
|
85601
|
-
}
|
|
85602
|
-
|
|
85603
|
-
|
|
85604
|
-
|
|
85605
|
-
|
|
85606
|
-
|
|
85607
|
-
|
|
85608
|
-
|
|
85609
|
-
|
|
85610
|
-
|
|
85611
|
-
|
|
85612
|
-
|
|
85613
|
-
|
|
85614
|
-
|
|
85615
|
-
|
|
85616
|
-
|
|
85617
|
-
|
|
85618
|
-
|
|
85619
|
-
|
|
85620
|
-
|
|
85621
|
-
|
|
85622
|
-
|
|
85623
|
-
|
|
85624
|
-
|
|
85625
|
-
|
|
85626
|
-
|
|
85627
|
-
|
|
85628
|
-
|
|
85629
|
-
|
|
85630
|
-
}
|
|
85631
|
-
|
|
85632
|
-
|
|
85633
|
-
|
|
85634
|
-
|
|
85635
|
-
|
|
85636
|
-
|
|
85637
|
-
|
|
85638
|
-
|
|
85639
|
-
|
|
85640
|
-
|
|
85641
|
-
|
|
85642
|
-
|
|
85643
|
-
|
|
85644
|
-
|
|
85645
|
-
|
|
85646
|
-
|
|
85647
|
-
|
|
85648
|
-
|
|
85649
|
-
|
|
85650
|
-
|
|
85651
|
-
|
|
85652
|
-
|
|
85653
|
-
|
|
85654
|
-
|
|
85655
|
-
|
|
85656
|
-
|
|
85657
|
-
|
|
85658
|
-
|
|
85659
|
-
|
|
85660
|
-
|
|
85661
|
-
|
|
85662
|
-
|
|
85663
|
-
|
|
85664
|
-
|
|
85665
|
-
|
|
85666
|
-
|
|
85667
|
-
"Mod-Shift-s": () => this.editor.commands.toggleStrike()
|
|
85668
|
-
};
|
|
85669
|
-
},
|
|
85670
|
-
addInputRules() {
|
|
85671
|
-
return [
|
|
85672
|
-
markInputRule({
|
|
85673
|
-
find: inputRegex,
|
|
85674
|
-
type: this.type
|
|
85675
|
-
})
|
|
85676
|
-
];
|
|
85677
|
-
},
|
|
85678
|
-
addPasteRules() {
|
|
85679
|
-
return [
|
|
85680
|
-
markPasteRule({
|
|
85681
|
-
find: pasteRegex,
|
|
85682
|
-
type: this.type
|
|
85683
|
-
})
|
|
85684
|
-
];
|
|
85685
|
-
}
|
|
85686
|
-
}), Text = Node$1.create({
|
|
85687
|
-
name: "text",
|
|
85688
|
-
group: "inline"
|
|
85689
|
-
}), StarterKit = Extension.create({
|
|
85690
|
-
name: "starterKit",
|
|
85691
|
-
addExtensions() {
|
|
85692
|
-
const t = [];
|
|
85693
|
-
return this.options.bold !== !1 && t.push(Bold.configure(this.options.bold)), this.options.blockquote !== !1 && t.push(Blockquote.configure(this.options.blockquote)), this.options.bulletList !== !1 && t.push(BulletList.configure(this.options.bulletList)), this.options.code !== !1 && t.push(Code.configure(this.options.code)), this.options.codeBlock !== !1 && t.push(CodeBlock.configure(this.options.codeBlock)), this.options.document !== !1 && t.push(Document.configure(this.options.document)), this.options.dropcursor !== !1 && t.push(Dropcursor.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && t.push(Gapcursor.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && t.push(HardBreak.configure(this.options.hardBreak)), this.options.heading !== !1 && t.push(Heading.configure(this.options.heading)), this.options.history !== !1 && t.push(History.configure(this.options.history)), this.options.horizontalRule !== !1 && t.push(HorizontalRule.configure(this.options.horizontalRule)), this.options.italic !== !1 && t.push(Italic.configure(this.options.italic)), this.options.listItem !== !1 && t.push(ListItem.configure(this.options.listItem)), this.options.orderedList !== !1 && t.push(OrderedList.configure(this.options.orderedList)), this.options.paragraph !== !1 && t.push(Paragraph.configure(this.options.paragraph)), this.options.strike !== !1 && t.push(Strike.configure(this.options.strike)), this.options.text !== !1 && t.push(Text.configure(this.options.text)), t;
|
|
85694
|
-
}
|
|
85695
|
-
}), Underline = Mark.create({
|
|
85696
|
-
name: "underline",
|
|
85697
|
-
addOptions() {
|
|
85698
|
-
return {
|
|
85699
|
-
HTMLAttributes: {}
|
|
85700
|
-
};
|
|
85701
|
-
},
|
|
85702
|
-
parseHTML() {
|
|
85703
|
-
return [
|
|
85704
|
-
{
|
|
85705
|
-
tag: "u"
|
|
85706
|
-
},
|
|
85707
|
-
{
|
|
85708
|
-
style: "text-decoration",
|
|
85709
|
-
consuming: !1,
|
|
85710
|
-
getAttrs: (t) => t.includes("underline") ? {} : !1
|
|
85584
|
+
g(z);
|
|
85585
|
+
}, [t, b, d]), d ? /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
85586
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-24" }) }),
|
|
85587
|
+
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
85588
|
+
/* @__PURE__ */ jsx("div", { style: { height: e }, children: /* @__PURE__ */ jsx(Skeleton, { className: "h-full w-full rounded-md" }) }),
|
|
85589
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 my-1 pt-2", children: [
|
|
85590
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-10" }),
|
|
85591
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" })
|
|
85592
|
+
] }),
|
|
85593
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4 mt-1" })
|
|
85594
|
+
] })
|
|
85595
|
+
] }) : f.length === 0 ? /* @__PURE__ */ jsx(
|
|
85596
|
+
"div",
|
|
85597
|
+
{
|
|
85598
|
+
style: { height: e },
|
|
85599
|
+
className: l || "p-4 text-center text-muted-foreground flex items-center justify-center",
|
|
85600
|
+
children: "No monthly sales data to display."
|
|
85601
|
+
}
|
|
85602
|
+
) : /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
85603
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Sales" }) }),
|
|
85604
|
+
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
85605
|
+
/* @__PURE__ */ jsx(
|
|
85606
|
+
AreaChart,
|
|
85607
|
+
{
|
|
85608
|
+
data: f,
|
|
85609
|
+
units: n,
|
|
85610
|
+
unitsPosition: o,
|
|
85611
|
+
height: e,
|
|
85612
|
+
className: l
|
|
85613
|
+
}
|
|
85614
|
+
),
|
|
85615
|
+
_ && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
85616
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 my-1 pt-2", children: [
|
|
85617
|
+
/* @__PURE__ */ jsx(
|
|
85618
|
+
Switch,
|
|
85619
|
+
{
|
|
85620
|
+
checked: b,
|
|
85621
|
+
onCheckedChange: S,
|
|
85622
|
+
id: "extrapolate-switch",
|
|
85623
|
+
"aria-label": "Toggle sales extrapolation"
|
|
85624
|
+
}
|
|
85625
|
+
),
|
|
85626
|
+
/* @__PURE__ */ jsx(Label$2, { htmlFor: "extrapolate-switch", children: "Extrapolate" })
|
|
85627
|
+
] }),
|
|
85628
|
+
b && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "* Sales for the current month are projected, not actual." })
|
|
85629
|
+
] })
|
|
85630
|
+
] })
|
|
85631
|
+
] });
|
|
85632
|
+
}
|
|
85633
|
+
const PartnerLogo = ({ applicationId: t, width: e, height: n, align: o }) => {
|
|
85634
|
+
const l = !t, { data: d, isLoading: f } = useGetV4PartnerByApplicationIdAccountLogoExistsQuery(
|
|
85635
|
+
{ applicationId: t },
|
|
85636
|
+
// Pass the applicationId prop
|
|
85637
|
+
{ skip: l }
|
|
85638
|
+
), { data: g, isLoading: b } = useGetV4PartnerByApplicationIdAccountLogoQuery(
|
|
85639
|
+
{
|
|
85640
|
+
applicationId: t,
|
|
85641
|
+
// Pass the applicationId prop
|
|
85642
|
+
// Conditionally include optional parameters if they have a value
|
|
85643
|
+
...e !== void 0 && { width: e },
|
|
85644
|
+
...n !== void 0 && { height: n },
|
|
85645
|
+
...o !== void 0 && { align: o }
|
|
85646
|
+
},
|
|
85647
|
+
{ skip: l || !d }
|
|
85648
|
+
// Also skip if logoExists is false or not yet determined
|
|
85649
|
+
), S = useMemo(() => {
|
|
85650
|
+
if (g instanceof ArrayBuffer && g.byteLength > 0)
|
|
85651
|
+
try {
|
|
85652
|
+
const C = new Uint8Array(g);
|
|
85653
|
+
let E = "";
|
|
85654
|
+
for (let I = 0; I < C.byteLength; I++)
|
|
85655
|
+
E += String.fromCharCode(C[I]);
|
|
85656
|
+
const R = btoa(E);
|
|
85657
|
+
let A = "image/png";
|
|
85658
|
+
return C.length > 4 && (C[0] === 137 && C[1] === 80 && C[2] === 78 && C[3] === 71 ? A = "image/png" : C[0] === 255 && C[1] === 216 && C[C.length - 2] === 255 && C[C.length - 1] === 217 ? A = "image/jpeg" : C[0] === 71 && C[1] === 73 && C[2] === 70 && C[3] === 56 && (A = "image/gif")), `data:${A};base64,${R}`;
|
|
85659
|
+
} catch (C) {
|
|
85660
|
+
return console.error(`Error converting logo for Partner ID ${t}:`, C), null;
|
|
85711
85661
|
}
|
|
85712
|
-
|
|
85713
|
-
},
|
|
85714
|
-
|
|
85715
|
-
|
|
85716
|
-
|
|
85717
|
-
|
|
85718
|
-
|
|
85719
|
-
|
|
85720
|
-
|
|
85721
|
-
|
|
85722
|
-
|
|
85723
|
-
|
|
85724
|
-
|
|
85725
|
-
|
|
85726
|
-
|
|
85727
|
-
"
|
|
85728
|
-
|
|
85729
|
-
|
|
85730
|
-
}),
|
|
85731
|
-
|
|
85732
|
-
|
|
85733
|
-
|
|
85734
|
-
|
|
85735
|
-
|
|
85736
|
-
{
|
|
85737
|
-
|
|
85738
|
-
|
|
85739
|
-
|
|
85740
|
-
|
|
85741
|
-
|
|
85742
|
-
|
|
85743
|
-
|
|
85744
|
-
|
|
85745
|
-
|
|
85746
|
-
|
|
85747
|
-
|
|
85748
|
-
|
|
85749
|
-
|
|
85750
|
-
}
|
|
85751
|
-
.ProseMirror h2 {
|
|
85752
|
-
font-size: 1.5em;
|
|
85753
|
-
font-weight: bold;
|
|
85754
|
-
margin-bottom: 0.5em;
|
|
85755
|
-
}
|
|
85756
|
-
.ProseMirror h3 {
|
|
85757
|
-
font-size: 1.17em;
|
|
85758
|
-
font-weight: bold;
|
|
85759
|
-
margin-bottom: 0.5em;
|
|
85760
|
-
}
|
|
85761
|
-
.ProseMirror h4 {
|
|
85762
|
-
font-size: 1em;
|
|
85763
|
-
font-weight: bold;
|
|
85764
|
-
margin-bottom: 0.5em;
|
|
85765
|
-
}
|
|
85766
|
-
.ProseMirror h5 {
|
|
85767
|
-
font-size: 0.83em;
|
|
85768
|
-
font-weight: bold;
|
|
85769
|
-
margin-bottom: 0.5em;
|
|
85770
|
-
}
|
|
85771
|
-
.ProseMirror h6 {
|
|
85772
|
-
font-size: 0.67em;
|
|
85773
|
-
font-weight: bold;
|
|
85774
|
-
margin-bottom: 0.5em;
|
|
85775
|
-
}
|
|
85776
|
-
.ProseMirror ul {
|
|
85777
|
-
list-style-type: disc;
|
|
85778
|
-
padding-left: 1.5em;
|
|
85779
|
-
margin-bottom: 0.5em;
|
|
85780
|
-
}
|
|
85781
|
-
.ProseMirror ol {
|
|
85782
|
-
list-style-type: decimal;
|
|
85783
|
-
padding-left: 1.5em;
|
|
85784
|
-
margin-bottom: 0.5em;
|
|
85785
|
-
}
|
|
85786
|
-
.ProseMirror li {
|
|
85787
|
-
margin-bottom: 0.25em;
|
|
85788
|
-
}
|
|
85789
|
-
.ProseMirror p {
|
|
85790
|
-
margin-bottom: 0.5em;
|
|
85662
|
+
return null;
|
|
85663
|
+
}, [g, t]);
|
|
85664
|
+
return t ? /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 100, children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
|
|
85665
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-start h-8 min-w-[32px] cursor-default", children: [
|
|
85666
|
+
" ",
|
|
85667
|
+
f || d === !0 && b && !g ? /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-8 rounded-sm" }) : d === !0 && S ? /* @__PURE__ */ jsx("img", { src: S, alt: `${t}'s logo`, className: "h-8 w-auto max-w-[60px] object-contain rounded-sm" }) : /* @__PURE__ */ jsx(
|
|
85668
|
+
"div",
|
|
85669
|
+
{
|
|
85670
|
+
className: "h-8 w-full flex items-center justify-center border border-dashed border-border rounded-sm bg-muted/20 p-1",
|
|
85671
|
+
title: `Logo for ${t}`,
|
|
85672
|
+
children: /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground font-mono text-center leading-none break-all", children: t })
|
|
85673
|
+
}
|
|
85674
|
+
)
|
|
85675
|
+
] }) }),
|
|
85676
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "top", align: "center", children: /* @__PURE__ */ jsxs("p", { children: [
|
|
85677
|
+
"ID: ",
|
|
85678
|
+
t
|
|
85679
|
+
] }) })
|
|
85680
|
+
] }) }) : /* @__PURE__ */ jsx("div", { className: "flex items-center justify-start h-8 w-8 text-muted-foreground", children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 100, children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
|
|
85681
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx("div", { className: "h-8 w-8 flex items-center justify-center border border-dashed border-border rounded-sm bg-muted/20 p-1", children: /* @__PURE__ */ jsx("span", { className: "text-xs font-mono", children: "N/A" }) }) }),
|
|
85682
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "top", align: "center", children: /* @__PURE__ */ jsx("p", { children: "ID: Not available" }) })
|
|
85683
|
+
] }) }) });
|
|
85684
|
+
};
|
|
85685
|
+
function getEndDateStatus(t) {
|
|
85686
|
+
if (!t) return { text: "No End Date", variant: "neutral", daysRemaining: null };
|
|
85687
|
+
const e = new Date(t);
|
|
85688
|
+
if (isNaN(e.getTime()))
|
|
85689
|
+
return { text: "Invalid Date", variant: "neutral", daysRemaining: null };
|
|
85690
|
+
const n = /* @__PURE__ */ new Date(), o = new Date(e.getFullYear(), e.getMonth(), e.getDate()), l = new Date(n.getFullYear(), n.getMonth(), n.getDate()), d = o.getTime() - l.getTime(), f = Math.ceil(d / (1e3 * 60 * 60 * 24));
|
|
85691
|
+
return f < 0 ? { text: `Ended ${Math.abs(f)}d ago`, variant: "destructive", daysRemaining: f } : f === 0 ? { text: "Ends today", variant: "destructive", daysRemaining: f } : f <= 7 ? { text: `Ends in ${f}d`, variant: "destructive", daysRemaining: f } : f <= 30 ? { text: `Ends in ${f}d`, variant: "warning", daysRemaining: f } : { text: `Ends in ${f}d`, variant: "neutral", daysRemaining: f };
|
|
85692
|
+
}
|
|
85693
|
+
const formatDate = (t) => {
|
|
85694
|
+
if (!t) return "N/A";
|
|
85695
|
+
try {
|
|
85696
|
+
const e = new Date(t);
|
|
85697
|
+
return isNaN(e.getTime()) ? "Invalid Date" : e.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
85698
|
+
} catch {
|
|
85699
|
+
return "Invalid Date";
|
|
85791
85700
|
}
|
|
85792
|
-
|
|
85793
|
-
function
|
|
85794
|
-
|
|
85795
|
-
|
|
85796
|
-
|
|
85797
|
-
|
|
85798
|
-
|
|
85799
|
-
|
|
85800
|
-
|
|
85801
|
-
|
|
85701
|
+
};
|
|
85702
|
+
function ResellerOpportunitiesTable({
|
|
85703
|
+
applicationId: t,
|
|
85704
|
+
opportunities: e = null,
|
|
85705
|
+
loading: n = !1
|
|
85706
|
+
}) {
|
|
85707
|
+
var j;
|
|
85708
|
+
const { toast: o } = useToast(), [l, d] = useState({}), [f, g] = useState(!1), [b, S] = useState(""), [_, C] = useState(null), E = useCallback((te, ne, se) => {
|
|
85709
|
+
d((ge) => ({
|
|
85710
|
+
...ge,
|
|
85711
|
+
[te]: {
|
|
85712
|
+
...ge[te],
|
|
85713
|
+
[ne]: se
|
|
85802
85714
|
}
|
|
85803
|
-
}
|
|
85804
|
-
|
|
85805
|
-
|
|
85715
|
+
}));
|
|
85716
|
+
}, []), [R] = usePutV4ResellerByRouteResellerIdOpportunityAndManufacturerIdDefaultMutation(), A = useCallback(async (te) => {
|
|
85717
|
+
if (!te.BidNumber) {
|
|
85718
|
+
o({ title: "Error", description: "Bid Number is missing, cannot set default.", variant: "destructive" });
|
|
85719
|
+
return;
|
|
85720
|
+
}
|
|
85721
|
+
const ne = te.BidNumber;
|
|
85722
|
+
E(ne, "isSettingDefault", !0), R({
|
|
85723
|
+
routeResellerId: t,
|
|
85724
|
+
manufacturerId: te.ManufacturerId ?? "",
|
|
85725
|
+
opportunityNumber: ne
|
|
85726
|
+
}).unwrap().then(() => {
|
|
85806
85727
|
o({
|
|
85807
|
-
|
|
85808
|
-
|
|
85809
|
-
|
|
85810
|
-
|
|
85811
|
-
|
|
85728
|
+
title: "Success",
|
|
85729
|
+
description: `Opportunity "${te.OpportunityName || te.Opportunity || ne}" was successfully set as default.`,
|
|
85730
|
+
variant: "success"
|
|
85731
|
+
});
|
|
85732
|
+
}).catch((se) => {
|
|
85733
|
+
var ge;
|
|
85734
|
+
console.error("Set as default error:", se), o({
|
|
85735
|
+
title: "Error",
|
|
85736
|
+
description: ((ge = se.data) == null ? void 0 : ge.message) || se.message || "An error occurred while setting this opportunity as default.",
|
|
85737
|
+
variant: "destructive"
|
|
85812
85738
|
});
|
|
85739
|
+
}).finally(() => {
|
|
85740
|
+
E(ne, "isSettingDefault", !1);
|
|
85741
|
+
});
|
|
85742
|
+
}, [t, R, o, E]), [I] = usePostV4ResellerByRouteResellerIdOpportunityAndManufacturerIdBidNumberEmailMutation(), M = useCallback((te) => {
|
|
85743
|
+
if (!te.BidNumber) {
|
|
85744
|
+
o({ title: "Error", description: "Bid Number is missing, cannot prepare report.", variant: "destructive" });
|
|
85745
|
+
return;
|
|
85813
85746
|
}
|
|
85814
|
-
|
|
85815
|
-
|
|
85816
|
-
|
|
85817
|
-
|
|
85818
|
-
|
|
85819
|
-
|
|
85820
|
-
|
|
85821
|
-
|
|
85822
|
-
|
|
85823
|
-
|
|
85824
|
-
|
|
85825
|
-
|
|
85826
|
-
|
|
85827
|
-
|
|
85828
|
-
|
|
85829
|
-
|
|
85830
|
-
(
|
|
85831
|
-
|
|
85832
|
-
|
|
85833
|
-
|
|
85834
|
-
|
|
85835
|
-
|
|
85836
|
-
|
|
85837
|
-
|
|
85838
|
-
|
|
85839
|
-
|
|
85840
|
-
|
|
85841
|
-
|
|
85842
|
-
case "strike":
|
|
85843
|
-
C.chain().toggleStrike().run();
|
|
85844
|
-
break;
|
|
85845
|
-
case "bulletList":
|
|
85846
|
-
C.chain().toggleBulletList().run();
|
|
85847
|
-
break;
|
|
85848
|
-
case "orderedList":
|
|
85849
|
-
C.chain().toggleOrderedList().run();
|
|
85850
|
-
break;
|
|
85851
|
-
}
|
|
85852
|
-
},
|
|
85853
|
-
[C]
|
|
85854
|
-
), A = useCallback(() => {
|
|
85855
|
-
b((O) => !O);
|
|
85856
|
-
}, []), I = useCallback(
|
|
85857
|
-
(O) => {
|
|
85858
|
-
const q = O.target.value;
|
|
85859
|
-
C && C.commands.setContent(q), o({
|
|
85860
|
-
target: {
|
|
85861
|
-
id: t,
|
|
85862
|
-
name: e,
|
|
85863
|
-
value: q
|
|
85864
|
-
}
|
|
85747
|
+
C(te), S(""), g(!0);
|
|
85748
|
+
}, [o]), O = useCallback(async () => {
|
|
85749
|
+
if (!_ || !_.BidNumber) {
|
|
85750
|
+
o({ title: "Error", description: "No opportunity selected or Bid Number is missing.", variant: "destructive" });
|
|
85751
|
+
return;
|
|
85752
|
+
}
|
|
85753
|
+
if (!b.trim() || !/\S+@\S+\.\S+/.test(b)) {
|
|
85754
|
+
o({ title: "Validation Error", description: "Please enter a valid email address.", variant: "destructive" });
|
|
85755
|
+
return;
|
|
85756
|
+
}
|
|
85757
|
+
const te = _.BidNumber;
|
|
85758
|
+
E(te, "isSendingReport", !0), I({
|
|
85759
|
+
routeResellerId: t,
|
|
85760
|
+
manufacturerId: _.ManufacturerId ?? "",
|
|
85761
|
+
bidNumber: te,
|
|
85762
|
+
emailAddress: b
|
|
85763
|
+
}).unwrap().then(() => {
|
|
85764
|
+
o({
|
|
85765
|
+
title: "Success",
|
|
85766
|
+
description: `A report for "${_.OpportunityName || _.Opportunity || te}" was successfully sent to ${b}.`,
|
|
85767
|
+
variant: "success"
|
|
85768
|
+
}), g(!1);
|
|
85769
|
+
}).catch((ne) => {
|
|
85770
|
+
var se;
|
|
85771
|
+
console.error("Send report by email error:", ne), o({
|
|
85772
|
+
title: "Error",
|
|
85773
|
+
description: ((se = ne.data) == null ? void 0 : se.message) || ne.message || "An error occurred while sending the report by email.",
|
|
85774
|
+
variant: "destructive"
|
|
85865
85775
|
});
|
|
85866
|
-
}
|
|
85867
|
-
|
|
85868
|
-
|
|
85869
|
-
|
|
85870
|
-
|
|
85871
|
-
|
|
85872
|
-
|
|
85873
|
-
|
|
85874
|
-
|
|
85875
|
-
|
|
85876
|
-
"border border-input rounded-md overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring",
|
|
85877
|
-
d
|
|
85878
|
-
),
|
|
85879
|
-
onClick: M,
|
|
85880
|
-
...f,
|
|
85881
|
-
children: [
|
|
85882
|
-
/* @__PURE__ */ jsx("style", { children: editorStyles }),
|
|
85883
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center p-2 border-b border-input gap-2 bg-background", children: [
|
|
85884
|
-
/* @__PURE__ */ jsxs(Select, { onValueChange: E, disabled: g, children: [
|
|
85885
|
-
/* @__PURE__ */ jsx(SelectTrigger, { className: "w-[160px]", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Format" }) }),
|
|
85886
|
-
/* @__PURE__ */ jsx(SelectContent, { children: formatOptions.map((O) => /* @__PURE__ */ jsx(SelectItem, { value: O.value, children: O.label }, O.value)) })
|
|
85887
|
-
] }),
|
|
85888
|
-
["bold", "italic", "underline", "strike", "bulletList", "orderedList"].map((O) => /* @__PURE__ */ jsxs(
|
|
85889
|
-
Button,
|
|
85890
|
-
{
|
|
85891
|
-
type: "button",
|
|
85892
|
-
variant: "ghost",
|
|
85893
|
-
size: "sm",
|
|
85894
|
-
onClick: () => R(O),
|
|
85895
|
-
className: C.isActive(O) ? "bg-muted" : "",
|
|
85896
|
-
disabled: g,
|
|
85897
|
-
children: [
|
|
85898
|
-
O === "bold" && /* @__PURE__ */ jsx(Bold$1, { className: "h-4 w-4" }),
|
|
85899
|
-
O === "italic" && /* @__PURE__ */ jsx(Italic$1, { className: "h-4 w-4" }),
|
|
85900
|
-
O === "underline" && /* @__PURE__ */ jsx(Underline$1, { className: "h-4 w-4" }),
|
|
85901
|
-
O === "strike" && /* @__PURE__ */ jsx(Strikethrough, { className: "h-4 w-4" }),
|
|
85902
|
-
O === "bulletList" && /* @__PURE__ */ jsx(List$1, { className: "h-4 w-4" }),
|
|
85903
|
-
O === "orderedList" && /* @__PURE__ */ jsx(ListOrdered, { className: "h-4 w-4" })
|
|
85904
|
-
]
|
|
85905
|
-
},
|
|
85906
|
-
O
|
|
85907
|
-
)),
|
|
85908
|
-
/* @__PURE__ */ jsx(
|
|
85909
|
-
Button,
|
|
85910
|
-
{
|
|
85911
|
-
type: "button",
|
|
85912
|
-
variant: "ghost",
|
|
85913
|
-
size: "sm",
|
|
85914
|
-
onClick: A,
|
|
85915
|
-
className: g ? "bg-muted" : "",
|
|
85916
|
-
children: /* @__PURE__ */ jsx(Code$1, { className: "h-4 w-4" })
|
|
85917
|
-
}
|
|
85918
|
-
)
|
|
85919
|
-
] }),
|
|
85920
|
-
/* @__PURE__ */ jsx("div", { className: "p-3", children: g ? /* @__PURE__ */ jsx(
|
|
85921
|
-
Textarea,
|
|
85776
|
+
}).finally(() => {
|
|
85777
|
+
E(te, "isSendingReport", !1), f || (C(null), S(""));
|
|
85778
|
+
});
|
|
85779
|
+
}, [_, b, t, I, o, E, g]), q = useMemo(
|
|
85780
|
+
() => [
|
|
85781
|
+
{
|
|
85782
|
+
accessorKey: "ManufacturerId",
|
|
85783
|
+
header: "Manuf. ID",
|
|
85784
|
+
cell: ({ row: te }) => /* @__PURE__ */ jsx(
|
|
85785
|
+
PartnerLogo,
|
|
85922
85786
|
{
|
|
85923
|
-
|
|
85924
|
-
|
|
85925
|
-
|
|
85926
|
-
value: C.getHTML(),
|
|
85927
|
-
onChange: I,
|
|
85928
|
-
className: cn(
|
|
85929
|
-
"min-h-[150px] font-mono text-sm resize-none border-0 focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
85930
|
-
d
|
|
85931
|
-
),
|
|
85932
|
-
placeholder: l
|
|
85787
|
+
applicationId: te.original.ManufacturerId,
|
|
85788
|
+
height: 10,
|
|
85789
|
+
width: 18
|
|
85933
85790
|
}
|
|
85934
|
-
)
|
|
85935
|
-
|
|
85791
|
+
),
|
|
85792
|
+
enableSorting: !0,
|
|
85793
|
+
enableFiltering: !0
|
|
85794
|
+
},
|
|
85795
|
+
{
|
|
85796
|
+
id: "opportunityDisplay",
|
|
85797
|
+
accessorFn: (te) => te.OpportunityName || te.Opportunity,
|
|
85798
|
+
header: "Opportunity",
|
|
85799
|
+
cell: ({ getValue: te }) => /* @__PURE__ */ jsx("div", { className: "min-w-[150px]", children: te() ?? "N/A" }),
|
|
85800
|
+
enableSorting: !0,
|
|
85801
|
+
enableFiltering: !0
|
|
85802
|
+
},
|
|
85803
|
+
{
|
|
85804
|
+
accessorKey: "BidNumber",
|
|
85805
|
+
header: "Bid Number",
|
|
85806
|
+
cell: ({ row: te }) => te.original.BidNumber ?? "N/A",
|
|
85807
|
+
enableSorting: !0,
|
|
85808
|
+
enableFiltering: !0
|
|
85809
|
+
},
|
|
85810
|
+
{
|
|
85811
|
+
id: "statusInfo",
|
|
85812
|
+
header: "Status",
|
|
85813
|
+
cell: ({ row: te }) => {
|
|
85814
|
+
const ne = te.original, se = ne.Active === !0, ge = getEndDateStatus(ne.EndDate);
|
|
85815
|
+
let oe = "border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400";
|
|
85816
|
+
return ge.variant === "destructive" ? oe = "border-red-500 bg-red-100 text-red-700 dark:border-red-600 dark:bg-red-900/50 dark:text-red-400" : ge.variant === "warning" && (oe = "border-yellow-500 bg-yellow-100 text-yellow-700 dark:border-yellow-600 dark:bg-yellow-900/50 dark:text-yellow-400"), /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 min-w-[200px]", children: [
|
|
85817
|
+
/* @__PURE__ */ jsx(Badge, { variant: "outline", className: se ? "border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400 font-medium" : "border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400 font-medium", children: se ? "Active" : "Inactive" }),
|
|
85818
|
+
ne.EndDate && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: `${oe} font-medium`, children: ge.text }),
|
|
85819
|
+
/* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 100, children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
|
|
85820
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 p-0 data-[state=delayed-open]:bg-accent data-[state=instant-open]:bg-accent", children: /* @__PURE__ */ jsx(Info, { className: "h-4 w-4 text-muted-foreground" }) }) }),
|
|
85821
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "top", align: "center", className: "bg-popover text-popover-foreground p-2 rounded shadow-lg", children: /* @__PURE__ */ jsxs("div", { className: "text-sm space-y-1", children: [
|
|
85822
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
85823
|
+
/* @__PURE__ */ jsx("strong", { children: "Start:" }),
|
|
85824
|
+
" ",
|
|
85825
|
+
formatDate(ne.StartDate)
|
|
85826
|
+
] }),
|
|
85827
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
85828
|
+
/* @__PURE__ */ jsx("strong", { children: "End:" }),
|
|
85829
|
+
" ",
|
|
85830
|
+
formatDate(ne.EndDate)
|
|
85831
|
+
] }),
|
|
85832
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
85833
|
+
/* @__PURE__ */ jsx("strong", { children: "Updated:" }),
|
|
85834
|
+
" ",
|
|
85835
|
+
formatDate(ne.LastUpdate)
|
|
85836
|
+
] })
|
|
85837
|
+
] }) })
|
|
85838
|
+
] }) })
|
|
85839
|
+
] });
|
|
85840
|
+
},
|
|
85841
|
+
enableFiltering: !1
|
|
85842
|
+
},
|
|
85843
|
+
{
|
|
85844
|
+
id: "actions",
|
|
85845
|
+
header: "Actions",
|
|
85846
|
+
cell: ({ row: te }) => {
|
|
85847
|
+
var $e, Be;
|
|
85848
|
+
const ne = te.original;
|
|
85849
|
+
if (!ne.BidNumber)
|
|
85850
|
+
return /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Actions unavailable" });
|
|
85851
|
+
const se = ne.BidNumber, ge = ($e = l[se]) == null ? void 0 : $e.isSettingDefault, oe = (_ == null ? void 0 : _.BidNumber) === se && ((Be = l[se]) == null ? void 0 : Be.isSendingReport), Ae = ge || oe, Ne = ne.CanBeSetAsDefault === !0;
|
|
85852
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex space-x-2", children: [
|
|
85853
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: () => A(ne), disabled: Ae || !Ne, title: Ne ? "Set as default" : "This opportunity cannot be set as default", className: "flex items-center", children: [
|
|
85854
|
+
ge ? /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Star, { className: "mr-2 h-4 w-4" }),
|
|
85855
|
+
" Set Default"
|
|
85856
|
+
] }),
|
|
85857
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: () => M(ne), disabled: Ae, title: "Send report by email", className: "flex items-center", children: [
|
|
85858
|
+
oe ? /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Send, { className: "mr-2 h-4 w-4" }),
|
|
85859
|
+
" Send Report"
|
|
85860
|
+
] })
|
|
85861
|
+
] });
|
|
85862
|
+
}
|
|
85863
|
+
}
|
|
85864
|
+
],
|
|
85865
|
+
[l, A, M, _]
|
|
85866
|
+
), z = useMemo(() => {
|
|
85867
|
+
const te = {};
|
|
85868
|
+
if (e) {
|
|
85869
|
+
const ne = Array.from(
|
|
85870
|
+
new Set(e.map((ge) => ge.ManufacturerId).filter((ge) => ge != null))
|
|
85871
|
+
);
|
|
85872
|
+
te.ManufacturerId = ne;
|
|
85873
|
+
const se = Array.from(
|
|
85874
|
+
new Set(e.map((ge) => ge.OpportunityName || ge.Opportunity).filter((ge) => ge != null))
|
|
85875
|
+
);
|
|
85876
|
+
te.opportunityDisplay = se;
|
|
85936
85877
|
}
|
|
85937
|
-
|
|
85878
|
+
return te;
|
|
85879
|
+
}, [e]), Q = e || [], F = _ != null && _.BidNumber ? (j = l[_.BidNumber]) == null ? void 0 : j.isSendingReport : !1;
|
|
85880
|
+
return n ? /* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
85881
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
85882
|
+
" ",
|
|
85883
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-48" }),
|
|
85884
|
+
" "
|
|
85885
|
+
] }),
|
|
85886
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "space-y-4", children: [
|
|
85887
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full rounded-md border" }),
|
|
85888
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-48 w-full rounded-md border" }),
|
|
85889
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pt-4", children: [
|
|
85890
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-[130px]" }),
|
|
85891
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
85892
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-20" }),
|
|
85893
|
+
" ",
|
|
85894
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-24" }),
|
|
85895
|
+
" ",
|
|
85896
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-9" }),
|
|
85897
|
+
" ",
|
|
85898
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-9" })
|
|
85899
|
+
] })
|
|
85900
|
+
] })
|
|
85901
|
+
] })
|
|
85902
|
+
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
85903
|
+
/* @__PURE__ */ jsxs(Card, { className: "w-full", children: [
|
|
85904
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
85905
|
+
" ",
|
|
85906
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-1xl font-bold", children: "Opportunities" }),
|
|
85907
|
+
" "
|
|
85908
|
+
] }),
|
|
85909
|
+
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(DataTable, { columns: q, data: Q, uniqueValues: z }) })
|
|
85910
|
+
] }),
|
|
85911
|
+
/* @__PURE__ */ jsx(Dialog, { open: f, onOpenChange: (te) => {
|
|
85912
|
+
g(te), te || (C(null), S(""));
|
|
85913
|
+
}, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-[425px]", children: [
|
|
85914
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
85915
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: "Send Opportunity Report" }),
|
|
85916
|
+
/* @__PURE__ */ jsxs(DialogDescription, { children: [
|
|
85917
|
+
"Enter the email address to send the report for opportunity: ",
|
|
85918
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
85919
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: (_ == null ? void 0 : _.OpportunityName) || (_ == null ? void 0 : _.Opportunity) || "N/A" }),
|
|
85920
|
+
(_ == null ? void 0 : _.BidNumber) && /* @__PURE__ */ jsxs("span", { className: "block text-sm text-muted-foreground", children: [
|
|
85921
|
+
"Bid Number: ",
|
|
85922
|
+
_.BidNumber
|
|
85923
|
+
] })
|
|
85924
|
+
] })
|
|
85925
|
+
] }),
|
|
85926
|
+
/* @__PURE__ */ jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-4 items-center gap-4", children: [
|
|
85927
|
+
/* @__PURE__ */ jsx(Label$2, { htmlFor: "email", className: "text-right", children: "Email" }),
|
|
85928
|
+
/* @__PURE__ */ jsx(Input, { id: "email", type: "email", value: b, onChange: (te) => S(te.target.value), placeholder: "recipient@example.com", className: "col-span-3", disabled: F })
|
|
85929
|
+
] }) }),
|
|
85930
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
85931
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", onClick: () => g(!1), disabled: F, children: "Cancel" }),
|
|
85932
|
+
/* @__PURE__ */ jsxs(Button, { type: "submit", onClick: O, disabled: F, children: [
|
|
85933
|
+
F && /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
85934
|
+
" Send Report"
|
|
85935
|
+
] })
|
|
85936
|
+
] })
|
|
85937
|
+
] }) })
|
|
85938
|
+
] });
|
|
85938
85939
|
}
|
|
85939
85940
|
export {
|
|
85940
85941
|
ActiveOrdersCard,
|
|
@@ -86035,9 +86036,11 @@ export {
|
|
|
86035
86036
|
RadioGroupItem,
|
|
86036
86037
|
ResellerBillingOverviewCard,
|
|
86037
86038
|
ResellerCard,
|
|
86039
|
+
ResellerOpportunitiesTable,
|
|
86038
86040
|
ResellerOverview,
|
|
86039
86041
|
ResellerQualificationsCard,
|
|
86040
86042
|
RichTextEditor,
|
|
86043
|
+
SalesChart,
|
|
86041
86044
|
SalesOverviewCard,
|
|
86042
86045
|
ScrollArea,
|
|
86043
86046
|
ScrollBar,
|