@agg-build/ui 4.19.0 → 4.21.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/{chunk-GT3DCFIT.mjs → chunk-5PA5KLXN.mjs} +17 -9
- package/dist/chunk-CKHECAKV.mjs +2724 -0
- package/dist/{chunk-NSQQ62QK.mjs → chunk-DONMO42Q.mjs} +1 -1
- package/dist/{chunk-DXASFSVL.mjs → chunk-JLO2BGSF.mjs} +546 -225
- package/dist/{chunk-5YHKIJ23.mjs → chunk-NV6WT3TN.mjs} +481 -826
- package/dist/{chunk-47CCGQH6.mjs → chunk-UXLC3FFY.mjs} +451 -1349
- package/dist/{event-market-2BAMDM5I.mjs → event-market-UREM3ZE7.mjs} +3 -3
- package/dist/events.js +419 -99
- package/dist/events.mjs +4 -2
- package/dist/index.js +22571 -21972
- package/dist/index.mjs +12 -10
- package/dist/modals.js +898 -335
- package/dist/modals.mjs +5 -5
- package/dist/pages.js +4328 -2833
- package/dist/pages.mjs +5 -5
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1746 -643
- package/dist/trading.mjs +2 -2
- package/dist/types/events/list/event-list-venue-strip.d.mts +29 -0
- package/dist/types/events/list/event-list-venue-strip.d.ts +29 -0
- package/dist/types/events/list/index.d.mts +2 -0
- package/dist/types/events/list/index.d.ts +2 -0
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +2 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +2 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.mts +3 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.ts +3 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.mts +2 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.ts +2 -1
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.mts +6 -0
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.ts +6 -0
- package/dist/types/profile/tabs/trading-access-tab.d.mts +2 -1
- package/dist/types/profile/tabs/trading-access-tab.d.ts +2 -1
- package/dist/types/trading/manage-betdex-account-modal.d.mts +2 -1
- package/dist/types/trading/manage-betdex-account-modal.d.ts +2 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +1 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +1 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +2 -2
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +2 -2
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +3 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +3 -1
- package/dist/types/withdraw/withdraw-modal.types.d.mts +8 -0
- package/dist/types/withdraw/withdraw-modal.types.d.ts +8 -0
- package/package.json +3 -3
- package/dist/chunk-ROA5K67W.mjs +0 -1237
|
@@ -1020,144 +1020,14 @@ var EventListItemV2 = (props) => {
|
|
|
1020
1020
|
};
|
|
1021
1021
|
EventListItemV2.displayName = "EventListItemV2";
|
|
1022
1022
|
|
|
1023
|
-
// src/events/list/
|
|
1024
|
-
import {
|
|
1025
|
-
|
|
1026
|
-
getVisibleVenueIdsByConfig,
|
|
1027
|
-
useAppConfig as useAppConfig2,
|
|
1028
|
-
useCategories,
|
|
1029
|
-
useCategoryChildren,
|
|
1030
|
-
useLabels as useLabels3,
|
|
1031
|
-
useSdkUiConfig as useSdkUiConfig2,
|
|
1032
|
-
useVenueEvents,
|
|
1033
|
-
useVenueMarketMidpoints as useVenueMarketMidpoints2
|
|
1034
|
-
} from "@agg-build/hooks";
|
|
1035
|
-
import { VENUES } from "@agg-build/sdk";
|
|
1036
|
-
import * as Dialog from "@radix-ui/react-dialog";
|
|
1037
|
-
import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo4, useRef as useRef3, useState as useState3 } from "react";
|
|
1038
|
-
|
|
1039
|
-
// src/events/list/category-sidebar.tsx
|
|
1040
|
-
import { useMemo as useMemo2 } from "react";
|
|
1041
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1042
|
-
var rowBase = cn(
|
|
1043
|
-
"flex min-h-11 w-full items-center gap-3 rounded-[6px] px-3 py-3",
|
|
1044
|
-
"text-left text-agg-sm font-agg-normal leading-agg-5",
|
|
1045
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-1 focus-visible:ring-offset-agg-secondary"
|
|
1046
|
-
);
|
|
1047
|
-
var idleRowClassName = cn(
|
|
1048
|
-
rowBase,
|
|
1049
|
-
"cursor-pointer text-agg-foreground hover:bg-agg-secondary-hover"
|
|
1050
|
-
);
|
|
1051
|
-
var selectedRowClassName = cn(rowBase, "cursor-pointer bg-agg-primary/10 text-agg-primary");
|
|
1052
|
-
var CategorySidebar = ({
|
|
1053
|
-
baseCategoryId,
|
|
1054
|
-
childrenByParentId,
|
|
1055
|
-
categoryPath,
|
|
1056
|
-
collapsedCategoryIds,
|
|
1057
|
-
totalEventCount,
|
|
1058
|
-
labels,
|
|
1059
|
-
onSelectAll,
|
|
1060
|
-
onToggleCategory
|
|
1061
|
-
}) => {
|
|
1062
|
-
const isDrilledIn = categoryPath.length > 0;
|
|
1063
|
-
const sortedBaseChildren = useMemo2(() => {
|
|
1064
|
-
var _a;
|
|
1065
|
-
if (!baseCategoryId) return [];
|
|
1066
|
-
const children = [...(_a = childrenByParentId.get(baseCategoryId)) != null ? _a : []];
|
|
1067
|
-
return children.sort((a, b) => {
|
|
1068
|
-
var _a2, _b, _c, _d;
|
|
1069
|
-
const aHasChildren = ((_b = (_a2 = childrenByParentId.get(a.id)) == null ? void 0 : _a2.length) != null ? _b : 0) > 0;
|
|
1070
|
-
const bHasChildren = ((_d = (_c = childrenByParentId.get(b.id)) == null ? void 0 : _c.length) != null ? _d : 0) > 0;
|
|
1071
|
-
if (aHasChildren === bHasChildren) return 0;
|
|
1072
|
-
return aHasChildren ? -1 : 1;
|
|
1073
|
-
});
|
|
1074
|
-
}, [baseCategoryId, childrenByParentId]);
|
|
1075
|
-
const renderRow = ({
|
|
1076
|
-
entry,
|
|
1077
|
-
isExpanded,
|
|
1078
|
-
isSelected,
|
|
1079
|
-
onClick
|
|
1080
|
-
}) => {
|
|
1081
|
-
var _a, _b;
|
|
1082
|
-
const hasKnownChildren = ((_b = (_a = childrenByParentId.get(entry.id)) == null ? void 0 : _a.length) != null ? _b : 0) > 0;
|
|
1083
|
-
return /* @__PURE__ */ jsxs2(
|
|
1084
|
-
"button",
|
|
1085
|
-
{
|
|
1086
|
-
type: "button",
|
|
1087
|
-
"aria-current": isSelected ? "true" : void 0,
|
|
1088
|
-
"aria-expanded": hasKnownChildren ? isExpanded : void 0,
|
|
1089
|
-
className: isSelected ? selectedRowClassName : idleRowClassName,
|
|
1090
|
-
onClick,
|
|
1091
|
-
children: [
|
|
1092
|
-
/* @__PURE__ */ jsx2("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: entry.label }),
|
|
1093
|
-
hasKnownChildren ? /* @__PURE__ */ jsx2(
|
|
1094
|
-
Icon,
|
|
1095
|
-
{
|
|
1096
|
-
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
1097
|
-
size: "small",
|
|
1098
|
-
color: "currentColor",
|
|
1099
|
-
className: "shrink-0 text-agg-muted-foreground"
|
|
1100
|
-
}
|
|
1101
|
-
) : /* @__PURE__ */ jsx2("span", { className: "shrink-0 text-agg-muted-foreground", children: entry.eventCount })
|
|
1102
|
-
]
|
|
1103
|
-
},
|
|
1104
|
-
entry.id
|
|
1105
|
-
);
|
|
1106
|
-
};
|
|
1107
|
-
const renderBranch = (category, depth) => {
|
|
1108
|
-
var _a, _b, _c, _d, _e;
|
|
1109
|
-
const label = (_a = category.displayName) != null ? _a : category.name;
|
|
1110
|
-
const entry = {
|
|
1111
|
-
id: category.id,
|
|
1112
|
-
label,
|
|
1113
|
-
eventCount: (_b = category.eventCount) != null ? _b : 0
|
|
1114
|
-
};
|
|
1115
|
-
const childCategories = (_c = childrenByParentId.get(category.id)) != null ? _c : [];
|
|
1116
|
-
const hasKnownChildren = childCategories.length > 0;
|
|
1117
|
-
const isExpanded = ((_d = categoryPath[depth]) == null ? void 0 : _d.id) === category.id && !collapsedCategoryIds.has(category.id);
|
|
1118
|
-
const isSelected = ((_e = categoryPath[depth]) == null ? void 0 : _e.id) === category.id && categoryPath.length === depth + 1;
|
|
1119
|
-
return /* @__PURE__ */ jsxs2("div", { className: "flex w-full flex-col", children: [
|
|
1120
|
-
renderRow({
|
|
1121
|
-
entry,
|
|
1122
|
-
isExpanded,
|
|
1123
|
-
isSelected,
|
|
1124
|
-
onClick: () => onToggleCategory({ entry, depth, hasKnownChildren, isExpanded, isSelected })
|
|
1125
|
-
}),
|
|
1126
|
-
/* @__PURE__ */ jsx2(
|
|
1127
|
-
"div",
|
|
1128
|
-
{
|
|
1129
|
-
className: cn(
|
|
1130
|
-
"grid transition-[grid-template-rows] duration-150 ease-in-out motion-reduce:transition-none",
|
|
1131
|
-
isExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
1132
|
-
),
|
|
1133
|
-
children: /* @__PURE__ */ jsx2("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx2("div", { className: "flex w-full flex-col gap-1 pl-4 pt-1", children: childCategories.map((child) => renderBranch(child, depth + 1)) }) })
|
|
1134
|
-
}
|
|
1135
|
-
)
|
|
1136
|
-
] }, category.id);
|
|
1137
|
-
};
|
|
1138
|
-
return /* @__PURE__ */ jsxs2("div", { className: "flex w-full flex-col gap-1", children: [
|
|
1139
|
-
/* @__PURE__ */ jsxs2(
|
|
1140
|
-
"button",
|
|
1141
|
-
{
|
|
1142
|
-
type: "button",
|
|
1143
|
-
"aria-current": !isDrilledIn ? "true" : void 0,
|
|
1144
|
-
className: !isDrilledIn ? selectedRowClassName : idleRowClassName,
|
|
1145
|
-
onClick: onSelectAll,
|
|
1146
|
-
children: [
|
|
1147
|
-
/* @__PURE__ */ jsx2("span", { className: "min-w-0 flex-1 truncate", children: labels.subcategoriesAll }),
|
|
1148
|
-
/* @__PURE__ */ jsx2("span", { className: "shrink-0 text-agg-muted-foreground", children: totalEventCount })
|
|
1149
|
-
]
|
|
1150
|
-
}
|
|
1151
|
-
),
|
|
1152
|
-
sortedBaseChildren.map((category) => renderBranch(category, 0))
|
|
1153
|
-
] });
|
|
1154
|
-
};
|
|
1155
|
-
CategorySidebar.displayName = "CategorySidebar";
|
|
1023
|
+
// src/events/list/event-list-venue-strip.tsx
|
|
1024
|
+
import { useAppConfig as useAppConfig2, useLabels as useLabels3, useSdkUiConfig as useSdkUiConfig2 } from "@agg-build/hooks";
|
|
1025
|
+
import { useEffect as useEffect3, useLayoutEffect, useMemo as useMemo3, useRef as useRef3, useState as useState3 } from "react";
|
|
1156
1026
|
|
|
1157
1027
|
// src/events/list/event-list-tabs.tsx
|
|
1158
1028
|
import { getVenueAvailabilityState, useAppConfig, useGeoBlock, useLabels as useLabels2 } from "@agg-build/hooks";
|
|
1159
1029
|
import { getEffectiveDisabledVenues, isVenueInactive } from "@agg-build/sdk";
|
|
1160
|
-
import { useCallback as useCallback2, useEffect as useEffect2, useMemo as
|
|
1030
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
|
|
1161
1031
|
|
|
1162
1032
|
// src/events/list/event-list.constants.ts
|
|
1163
1033
|
import { sortVenues as sortVenues2 } from "@agg-build/hooks";
|
|
@@ -1274,17 +1144,17 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
1274
1144
|
};
|
|
1275
1145
|
|
|
1276
1146
|
// src/events/list/event-list-tabs.tsx
|
|
1277
|
-
import { jsx as
|
|
1147
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1278
1148
|
var DEFAULT_HIDDEN_VENUES = new Set(getEffectiveDisabledVenues(void 0));
|
|
1279
1149
|
var renderTabIcon = (tab, isActive) => {
|
|
1280
1150
|
if (tab.iconName === "warning-filled") {
|
|
1281
|
-
return /* @__PURE__ */
|
|
1151
|
+
return /* @__PURE__ */ jsx2(Icon, { name: "warning-filled", size: "small", color: "currentColor" });
|
|
1282
1152
|
}
|
|
1283
1153
|
if (tab.venueLogo) {
|
|
1284
|
-
return /* @__PURE__ */
|
|
1154
|
+
return /* @__PURE__ */ jsx2(VenueLogo, { venue: tab.venueLogo, size: "small" });
|
|
1285
1155
|
}
|
|
1286
1156
|
if (!tab.iconName) return null;
|
|
1287
|
-
return /* @__PURE__ */
|
|
1157
|
+
return /* @__PURE__ */ jsx2(
|
|
1288
1158
|
Icon,
|
|
1289
1159
|
{
|
|
1290
1160
|
name: tab.iconName,
|
|
@@ -1297,7 +1167,7 @@ var useEventListTabs = (tabs) => {
|
|
|
1297
1167
|
const labels = useLabels2();
|
|
1298
1168
|
const { disabledVenues, isLoading: isAppConfigLoading } = useAppConfig();
|
|
1299
1169
|
const { isLocationBlocked } = useGeoBlock();
|
|
1300
|
-
return
|
|
1170
|
+
return useMemo2(() => {
|
|
1301
1171
|
const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
|
|
1302
1172
|
return baseTabs.flatMap((tab) => {
|
|
1303
1173
|
if (!tab.venueLogo) return [tab];
|
|
@@ -1337,7 +1207,7 @@ var EventListTabs = ({
|
|
|
1337
1207
|
if (resolvedTabs.some((tab) => tab.value === activeTab && !tab.disabled)) return;
|
|
1338
1208
|
onTabChange(fallbackTab.value);
|
|
1339
1209
|
}, [activeTab, onTabChange, resolvedTabs]);
|
|
1340
|
-
const items =
|
|
1210
|
+
const items = useMemo2(() => {
|
|
1341
1211
|
return resolvedTabs.map((tab) => {
|
|
1342
1212
|
const isActive = tab.value === activeTab;
|
|
1343
1213
|
return {
|
|
@@ -1349,7 +1219,7 @@ var EventListTabs = ({
|
|
|
1349
1219
|
};
|
|
1350
1220
|
});
|
|
1351
1221
|
}, [activeTab, resolvedTabs]);
|
|
1352
|
-
return /* @__PURE__ */
|
|
1222
|
+
return /* @__PURE__ */ jsx2(
|
|
1353
1223
|
Tabs,
|
|
1354
1224
|
{
|
|
1355
1225
|
ariaLabel,
|
|
@@ -1434,8 +1304,459 @@ var useEventListTabsHeaderOverflow = (recomputeOn, options) => {
|
|
|
1434
1304
|
return { headerRef, titleRef, shouldUseSelectOverflow };
|
|
1435
1305
|
};
|
|
1436
1306
|
|
|
1307
|
+
// src/events/list/event-list-venue-strip.tsx
|
|
1308
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1309
|
+
var TILE = 28;
|
|
1310
|
+
var TILE_GAP = 4;
|
|
1311
|
+
var CHIP = 36;
|
|
1312
|
+
var STRIP_INSET = 7;
|
|
1313
|
+
var FIT_TOLERANCE = 0.5;
|
|
1314
|
+
var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect3 : useLayoutEffect;
|
|
1315
|
+
var isTabUnavailable = (tab) => !!tab.disabled || !!tab.isComingSoon;
|
|
1316
|
+
var resolveTabLabel = (tab) => tab.isComingSoon ? `${tab.label} (soon)` : tab.label;
|
|
1317
|
+
var StripFrame = ({
|
|
1318
|
+
className,
|
|
1319
|
+
children,
|
|
1320
|
+
frameRef
|
|
1321
|
+
}) => /* @__PURE__ */ jsx3(
|
|
1322
|
+
"div",
|
|
1323
|
+
{
|
|
1324
|
+
ref: frameRef,
|
|
1325
|
+
className: cn(
|
|
1326
|
+
"inline-flex items-center gap-1 rounded-agg-lg border border-agg-separator bg-agg-secondary p-1.5",
|
|
1327
|
+
className
|
|
1328
|
+
),
|
|
1329
|
+
children
|
|
1330
|
+
}
|
|
1331
|
+
);
|
|
1332
|
+
var StripTile = ({
|
|
1333
|
+
tab,
|
|
1334
|
+
isActive,
|
|
1335
|
+
shape,
|
|
1336
|
+
motionClassName,
|
|
1337
|
+
onSelect,
|
|
1338
|
+
showTooltip = true,
|
|
1339
|
+
isVenue = false
|
|
1340
|
+
}) => {
|
|
1341
|
+
const isUnavailable = isTabUnavailable(tab);
|
|
1342
|
+
const label = resolveTabLabel(tab);
|
|
1343
|
+
const isExpanded = shape === "pill" || isActive;
|
|
1344
|
+
const glyphClassName = cn(
|
|
1345
|
+
"shrink-0",
|
|
1346
|
+
motionClassName,
|
|
1347
|
+
!isActive && shape === "tile" && "opacity-70 group-hover:opacity-100"
|
|
1348
|
+
);
|
|
1349
|
+
const glyph = tab.venueLogo ? /* @__PURE__ */ jsx3(VenueLogo, { venue: tab.venueLogo, size: "small", className: glyphClassName }) : tab.iconName ? /* @__PURE__ */ jsx3(
|
|
1350
|
+
Icon,
|
|
1351
|
+
{
|
|
1352
|
+
name: tab.iconName,
|
|
1353
|
+
size: "small",
|
|
1354
|
+
color: "currentColor",
|
|
1355
|
+
className: cn(tab.iconName === "warning-filled" ? "shrink-0" : glyphClassName)
|
|
1356
|
+
}
|
|
1357
|
+
) : null;
|
|
1358
|
+
return /* @__PURE__ */ jsxs2(
|
|
1359
|
+
"button",
|
|
1360
|
+
{
|
|
1361
|
+
type: "button",
|
|
1362
|
+
"data-venue-tile": isVenue ? "" : void 0,
|
|
1363
|
+
"aria-pressed": isActive,
|
|
1364
|
+
"aria-label": label,
|
|
1365
|
+
disabled: isUnavailable,
|
|
1366
|
+
onClick: () => onSelect == null ? void 0 : onSelect(tab.value),
|
|
1367
|
+
className: cn(
|
|
1368
|
+
"agg-venue-strip-tile group relative inline-flex h-7 shrink-0 items-center gap-1.5",
|
|
1369
|
+
"rounded-agg-sm font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
1370
|
+
"cursor-pointer disabled:cursor-not-allowed",
|
|
1371
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary/40",
|
|
1372
|
+
motionClassName,
|
|
1373
|
+
isExpanded ? "px-3" : "w-7 justify-center",
|
|
1374
|
+
isActive ? "bg-agg-primary/10 text-agg-primary" : "bg-transparent text-agg-foreground hover:bg-agg-secondary-hover",
|
|
1375
|
+
isUnavailable && "opacity-50 hover:bg-transparent"
|
|
1376
|
+
),
|
|
1377
|
+
children: [
|
|
1378
|
+
glyph,
|
|
1379
|
+
isExpanded ? /* @__PURE__ */ jsx3("span", { className: "whitespace-nowrap", children: tab.label }) : null,
|
|
1380
|
+
!isExpanded && showTooltip ? /* @__PURE__ */ jsx3(
|
|
1381
|
+
"span",
|
|
1382
|
+
{
|
|
1383
|
+
role: "tooltip",
|
|
1384
|
+
className: cn(
|
|
1385
|
+
"pointer-events-none absolute left-1/2 top-[calc(100%+6px)] z-10 -translate-x-1/2",
|
|
1386
|
+
"whitespace-nowrap rounded-agg-sm border border-agg-separator bg-agg-secondary px-2 py-1",
|
|
1387
|
+
"text-agg-xs text-agg-foreground shadow-agg-card-hover",
|
|
1388
|
+
"opacity-0 transition-opacity delay-150 group-hover:opacity-100 group-focus-visible:opacity-100"
|
|
1389
|
+
),
|
|
1390
|
+
children: label
|
|
1391
|
+
}
|
|
1392
|
+
) : null
|
|
1393
|
+
]
|
|
1394
|
+
}
|
|
1395
|
+
);
|
|
1396
|
+
};
|
|
1397
|
+
var EventListVenueStrip = ({
|
|
1398
|
+
tabs,
|
|
1399
|
+
activeTab,
|
|
1400
|
+
onTabChange,
|
|
1401
|
+
ariaLabel,
|
|
1402
|
+
className,
|
|
1403
|
+
fullWidth = false
|
|
1404
|
+
}) => {
|
|
1405
|
+
const labels = useLabels3();
|
|
1406
|
+
const {
|
|
1407
|
+
features: { enableAnimations }
|
|
1408
|
+
} = useSdkUiConfig2();
|
|
1409
|
+
const { isLoading: isAppConfigLoading } = useAppConfig2();
|
|
1410
|
+
const resolvedTabs = useEventListTabs(tabs);
|
|
1411
|
+
const wrapRef = useRef3(null);
|
|
1412
|
+
const ghostRef = useRef3(null);
|
|
1413
|
+
const [fit, setFit] = useState3(null);
|
|
1414
|
+
const [isListOpen, setIsListOpen] = useState3(false);
|
|
1415
|
+
const motionClassName = getMotionClassName(
|
|
1416
|
+
enableAnimations,
|
|
1417
|
+
"transition-[color,background-color,opacity] duration-200 motion-reduce:transition-none"
|
|
1418
|
+
);
|
|
1419
|
+
const modeTabs = useMemo3(() => resolvedTabs.filter((tab) => !tab.venueLogo), [resolvedTabs]);
|
|
1420
|
+
const venueTabs = useMemo3(() => resolvedTabs.filter((tab) => !!tab.venueLogo), [resolvedTabs]);
|
|
1421
|
+
const activeVenueIndex = venueTabs.findIndex((tab) => tab.value === activeTab);
|
|
1422
|
+
useEffect3(() => {
|
|
1423
|
+
if (isAppConfigLoading) return;
|
|
1424
|
+
const fallbackTab = resolvedTabs.find((tab) => !isTabUnavailable(tab));
|
|
1425
|
+
if (!fallbackTab) return;
|
|
1426
|
+
if (resolvedTabs.some((tab) => tab.value === activeTab && !isTabUnavailable(tab))) return;
|
|
1427
|
+
onTabChange(fallbackTab.value);
|
|
1428
|
+
}, [activeTab, isAppConfigLoading, onTabChange, resolvedTabs]);
|
|
1429
|
+
useIsomorphicLayoutEffect(() => {
|
|
1430
|
+
const wrap = wrapRef.current;
|
|
1431
|
+
const ghost = ghostRef.current;
|
|
1432
|
+
if (!wrap || !ghost) return;
|
|
1433
|
+
const measure = () => {
|
|
1434
|
+
const available = wrap.getBoundingClientRect().width;
|
|
1435
|
+
const strip = ghost.getBoundingClientRect();
|
|
1436
|
+
if (strip.width <= available + FIT_TOLERANCE) {
|
|
1437
|
+
setFit(null);
|
|
1438
|
+
return;
|
|
1439
|
+
}
|
|
1440
|
+
const firstTile = ghost.querySelector("[data-venue-tile]");
|
|
1441
|
+
if (!firstTile) {
|
|
1442
|
+
setFit(null);
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
const activeTile = ghost.querySelector('[data-venue-tile][aria-pressed="true"]');
|
|
1446
|
+
const room = strip.right - STRIP_INSET - firstTile.getBoundingClientRect().left - (strip.width - available);
|
|
1447
|
+
const activeWidth = activeTile ? activeTile.getBoundingClientRect().width + TILE_GAP : 0;
|
|
1448
|
+
const plain = Math.max(0, Math.floor((room - CHIP - activeWidth) / (TILE + TILE_GAP)));
|
|
1449
|
+
setFit(plain + (activeTile ? 1 : 0));
|
|
1450
|
+
};
|
|
1451
|
+
measure();
|
|
1452
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
1453
|
+
const observer = new ResizeObserver(measure);
|
|
1454
|
+
observer.observe(wrap);
|
|
1455
|
+
observer.observe(ghost);
|
|
1456
|
+
return () => {
|
|
1457
|
+
observer.disconnect();
|
|
1458
|
+
};
|
|
1459
|
+
}, [venueTabs, activeVenueIndex, fullWidth]);
|
|
1460
|
+
useEffect3(() => {
|
|
1461
|
+
if (!isListOpen) return;
|
|
1462
|
+
const handlePointerDown = (event) => {
|
|
1463
|
+
var _a;
|
|
1464
|
+
if (!((_a = wrapRef.current) == null ? void 0 : _a.contains(event.target))) setIsListOpen(false);
|
|
1465
|
+
};
|
|
1466
|
+
const handleKeyDown = (event) => {
|
|
1467
|
+
if (event.key === "Escape") setIsListOpen(false);
|
|
1468
|
+
};
|
|
1469
|
+
document.addEventListener("mousedown", handlePointerDown);
|
|
1470
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1471
|
+
return () => {
|
|
1472
|
+
document.removeEventListener("mousedown", handlePointerDown);
|
|
1473
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
1474
|
+
};
|
|
1475
|
+
}, [isListOpen]);
|
|
1476
|
+
const shownVenueTabs = useMemo3(() => {
|
|
1477
|
+
if (fit === null) return venueTabs;
|
|
1478
|
+
if (activeVenueIndex >= fit) {
|
|
1479
|
+
const activeVenueTab = venueTabs[activeVenueIndex];
|
|
1480
|
+
return activeVenueTab ? [...venueTabs.slice(0, Math.max(0, fit - 1)), activeVenueTab] : venueTabs.slice(0, fit);
|
|
1481
|
+
}
|
|
1482
|
+
return venueTabs.slice(0, fit);
|
|
1483
|
+
}, [activeVenueIndex, fit, venueTabs]);
|
|
1484
|
+
const foldedVenueTabs = useMemo3(
|
|
1485
|
+
() => venueTabs.filter((tab) => !shownVenueTabs.includes(tab)),
|
|
1486
|
+
[shownVenueTabs, venueTabs]
|
|
1487
|
+
);
|
|
1488
|
+
const foldedCount = foldedVenueTabs.length;
|
|
1489
|
+
const modeShape = fullWidth ? "tile" : "pill";
|
|
1490
|
+
const separator = /* @__PURE__ */ jsx3("span", { className: "mx-0.5 h-4 w-px shrink-0 bg-agg-separator", "aria-hidden": true });
|
|
1491
|
+
return /* @__PURE__ */ jsxs2(
|
|
1492
|
+
"div",
|
|
1493
|
+
{
|
|
1494
|
+
ref: wrapRef,
|
|
1495
|
+
className: cn(
|
|
1496
|
+
"agg-venue-strip relative flex min-w-0 max-w-full flex-col items-end",
|
|
1497
|
+
fullWidth && "w-full",
|
|
1498
|
+
className
|
|
1499
|
+
),
|
|
1500
|
+
children: [
|
|
1501
|
+
/* @__PURE__ */ jsx3("div", __spreadProps(__spreadValues({ "aria-hidden": true }, { inert: "" }), { className: "h-0 w-full overflow-hidden", children: /* @__PURE__ */ jsxs2(StripFrame, { frameRef: ghostRef, className: "w-max", children: [
|
|
1502
|
+
modeTabs.map((tab) => /* @__PURE__ */ jsx3(
|
|
1503
|
+
StripTile,
|
|
1504
|
+
{
|
|
1505
|
+
tab,
|
|
1506
|
+
isActive: tab.value === activeTab,
|
|
1507
|
+
shape: modeShape,
|
|
1508
|
+
showTooltip: false
|
|
1509
|
+
},
|
|
1510
|
+
tab.value
|
|
1511
|
+
)),
|
|
1512
|
+
venueTabs.length > 0 && modeTabs.length > 0 ? separator : null,
|
|
1513
|
+
venueTabs.map((tab) => /* @__PURE__ */ jsx3(
|
|
1514
|
+
StripTile,
|
|
1515
|
+
{
|
|
1516
|
+
tab,
|
|
1517
|
+
isActive: tab.value === activeTab,
|
|
1518
|
+
shape: "tile",
|
|
1519
|
+
showTooltip: false,
|
|
1520
|
+
isVenue: true
|
|
1521
|
+
},
|
|
1522
|
+
tab.value
|
|
1523
|
+
))
|
|
1524
|
+
] }) })),
|
|
1525
|
+
/* @__PURE__ */ jsxs2(StripFrame, { className: cn("agg-venue-strip-bar relative", fullWidth && "w-full"), children: [
|
|
1526
|
+
/* @__PURE__ */ jsxs2("div", { role: "group", "aria-label": ariaLabel, className: "contents", children: [
|
|
1527
|
+
modeTabs.map((tab) => /* @__PURE__ */ jsx3(
|
|
1528
|
+
StripTile,
|
|
1529
|
+
{
|
|
1530
|
+
tab,
|
|
1531
|
+
isActive: tab.value === activeTab,
|
|
1532
|
+
shape: modeShape,
|
|
1533
|
+
motionClassName,
|
|
1534
|
+
showTooltip: false,
|
|
1535
|
+
onSelect: onTabChange
|
|
1536
|
+
},
|
|
1537
|
+
tab.value
|
|
1538
|
+
)),
|
|
1539
|
+
venueTabs.length > 0 && modeTabs.length > 0 ? separator : null,
|
|
1540
|
+
shownVenueTabs.map((tab) => /* @__PURE__ */ jsx3(
|
|
1541
|
+
StripTile,
|
|
1542
|
+
{
|
|
1543
|
+
tab,
|
|
1544
|
+
isActive: tab.value === activeTab,
|
|
1545
|
+
shape: "tile",
|
|
1546
|
+
motionClassName,
|
|
1547
|
+
onSelect: onTabChange,
|
|
1548
|
+
isVenue: true
|
|
1549
|
+
},
|
|
1550
|
+
tab.value
|
|
1551
|
+
))
|
|
1552
|
+
] }),
|
|
1553
|
+
foldedCount > 0 ? /* @__PURE__ */ jsxs2(
|
|
1554
|
+
"button",
|
|
1555
|
+
{
|
|
1556
|
+
type: "button",
|
|
1557
|
+
"aria-haspopup": "listbox",
|
|
1558
|
+
"aria-expanded": isListOpen,
|
|
1559
|
+
"aria-label": labels.eventList.moreVenuesAria(foldedCount),
|
|
1560
|
+
onClick: () => setIsListOpen((open) => !open),
|
|
1561
|
+
className: cn(
|
|
1562
|
+
"agg-venue-strip-more inline-flex h-7 w-9 shrink-0 items-center justify-center",
|
|
1563
|
+
"rounded-agg-sm font-agg-sans text-agg-xs tabular-nums cursor-pointer",
|
|
1564
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary/40",
|
|
1565
|
+
motionClassName,
|
|
1566
|
+
fullWidth && "ml-auto",
|
|
1567
|
+
isListOpen ? "bg-agg-secondary-hover text-agg-foreground" : "text-agg-foreground/70 hover:bg-agg-secondary-hover hover:text-agg-foreground"
|
|
1568
|
+
),
|
|
1569
|
+
children: [
|
|
1570
|
+
"+",
|
|
1571
|
+
foldedCount
|
|
1572
|
+
]
|
|
1573
|
+
}
|
|
1574
|
+
) : null
|
|
1575
|
+
] }),
|
|
1576
|
+
isListOpen ? /* @__PURE__ */ jsx3(
|
|
1577
|
+
"div",
|
|
1578
|
+
{
|
|
1579
|
+
role: "listbox",
|
|
1580
|
+
"aria-label": labels.eventList.moreVenuesListAria,
|
|
1581
|
+
className: cn(
|
|
1582
|
+
"agg-venue-strip-list absolute right-0 top-[calc(100%+6px)] z-20 flex flex-col",
|
|
1583
|
+
"rounded-agg-lg border border-agg-separator bg-agg-secondary p-1.5 shadow-agg-card-hover",
|
|
1584
|
+
fullWidth ? "left-0" : "w-[248px]"
|
|
1585
|
+
),
|
|
1586
|
+
children: /* @__PURE__ */ jsx3("div", { className: "flex max-h-[352px] flex-col overflow-y-auto", children: foldedVenueTabs.map((tab) => {
|
|
1587
|
+
const isActive = tab.value === activeTab;
|
|
1588
|
+
const isUnavailable = isTabUnavailable(tab);
|
|
1589
|
+
return /* @__PURE__ */ jsxs2(
|
|
1590
|
+
"button",
|
|
1591
|
+
{
|
|
1592
|
+
type: "button",
|
|
1593
|
+
role: "option",
|
|
1594
|
+
"aria-selected": isActive,
|
|
1595
|
+
"aria-disabled": isUnavailable || void 0,
|
|
1596
|
+
disabled: isUnavailable,
|
|
1597
|
+
onClick: () => {
|
|
1598
|
+
onTabChange(tab.value);
|
|
1599
|
+
setIsListOpen(false);
|
|
1600
|
+
},
|
|
1601
|
+
className: cn(
|
|
1602
|
+
"flex h-8 shrink-0 items-center gap-2.5 rounded-agg-sm px-2.5",
|
|
1603
|
+
"font-agg-sans text-agg-sm leading-agg-5 cursor-pointer disabled:cursor-not-allowed",
|
|
1604
|
+
motionClassName,
|
|
1605
|
+
isActive ? "bg-agg-primary/10 text-agg-primary" : "text-agg-foreground hover:bg-agg-secondary-hover",
|
|
1606
|
+
isUnavailable && "opacity-50 hover:bg-transparent"
|
|
1607
|
+
),
|
|
1608
|
+
children: [
|
|
1609
|
+
tab.iconName === "warning-filled" ? /* @__PURE__ */ jsx3(Icon, { name: "warning-filled", size: "small", color: "currentColor" }) : tab.venueLogo ? /* @__PURE__ */ jsx3(VenueLogo, { venue: tab.venueLogo, size: "small", className: "shrink-0" }) : null,
|
|
1610
|
+
/* @__PURE__ */ jsx3("span", { className: "flex-1 truncate text-left", children: resolveTabLabel(tab) })
|
|
1611
|
+
]
|
|
1612
|
+
},
|
|
1613
|
+
tab.value
|
|
1614
|
+
);
|
|
1615
|
+
}) })
|
|
1616
|
+
}
|
|
1617
|
+
) : null
|
|
1618
|
+
]
|
|
1619
|
+
}
|
|
1620
|
+
);
|
|
1621
|
+
};
|
|
1622
|
+
EventListVenueStrip.displayName = "EventListVenueStrip";
|
|
1623
|
+
|
|
1437
1624
|
// src/events/list/index.tsx
|
|
1625
|
+
import {
|
|
1626
|
+
MarketStatus,
|
|
1627
|
+
getVisibleVenueIdsByConfig,
|
|
1628
|
+
useAppConfig as useAppConfig3,
|
|
1629
|
+
useCategories,
|
|
1630
|
+
useCategoryChildren,
|
|
1631
|
+
useLabels as useLabels4,
|
|
1632
|
+
useSdkUiConfig as useSdkUiConfig3,
|
|
1633
|
+
useVenueEvents,
|
|
1634
|
+
useVenueMarketMidpoints as useVenueMarketMidpoints2
|
|
1635
|
+
} from "@agg-build/hooks";
|
|
1636
|
+
import { VENUES } from "@agg-build/sdk";
|
|
1637
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
1638
|
+
import { useCallback as useCallback3, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef4, useState as useState4 } from "react";
|
|
1639
|
+
|
|
1640
|
+
// src/events/list/category-sidebar.tsx
|
|
1641
|
+
import { useMemo as useMemo4 } from "react";
|
|
1438
1642
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1643
|
+
var rowBase = cn(
|
|
1644
|
+
"flex min-h-11 w-full items-center gap-3 rounded-[6px] px-3 py-3",
|
|
1645
|
+
"text-left text-agg-sm font-agg-normal leading-agg-5",
|
|
1646
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-1 focus-visible:ring-offset-agg-secondary"
|
|
1647
|
+
);
|
|
1648
|
+
var idleRowClassName = cn(
|
|
1649
|
+
rowBase,
|
|
1650
|
+
"cursor-pointer text-agg-foreground hover:bg-agg-secondary-hover"
|
|
1651
|
+
);
|
|
1652
|
+
var selectedRowClassName = cn(rowBase, "cursor-pointer bg-agg-primary/10 text-agg-primary");
|
|
1653
|
+
var CategorySidebar = ({
|
|
1654
|
+
baseCategoryId,
|
|
1655
|
+
childrenByParentId,
|
|
1656
|
+
categoryPath,
|
|
1657
|
+
collapsedCategoryIds,
|
|
1658
|
+
totalEventCount,
|
|
1659
|
+
labels,
|
|
1660
|
+
onSelectAll,
|
|
1661
|
+
onToggleCategory
|
|
1662
|
+
}) => {
|
|
1663
|
+
const isDrilledIn = categoryPath.length > 0;
|
|
1664
|
+
const sortedBaseChildren = useMemo4(() => {
|
|
1665
|
+
var _a;
|
|
1666
|
+
if (!baseCategoryId) return [];
|
|
1667
|
+
const children = [...(_a = childrenByParentId.get(baseCategoryId)) != null ? _a : []];
|
|
1668
|
+
return children.sort((a, b) => {
|
|
1669
|
+
var _a2, _b, _c, _d;
|
|
1670
|
+
const aHasChildren = ((_b = (_a2 = childrenByParentId.get(a.id)) == null ? void 0 : _a2.length) != null ? _b : 0) > 0;
|
|
1671
|
+
const bHasChildren = ((_d = (_c = childrenByParentId.get(b.id)) == null ? void 0 : _c.length) != null ? _d : 0) > 0;
|
|
1672
|
+
if (aHasChildren === bHasChildren) return 0;
|
|
1673
|
+
return aHasChildren ? -1 : 1;
|
|
1674
|
+
});
|
|
1675
|
+
}, [baseCategoryId, childrenByParentId]);
|
|
1676
|
+
const renderRow = ({
|
|
1677
|
+
entry,
|
|
1678
|
+
isExpanded,
|
|
1679
|
+
isSelected,
|
|
1680
|
+
onClick
|
|
1681
|
+
}) => {
|
|
1682
|
+
var _a, _b;
|
|
1683
|
+
const hasKnownChildren = ((_b = (_a = childrenByParentId.get(entry.id)) == null ? void 0 : _a.length) != null ? _b : 0) > 0;
|
|
1684
|
+
return /* @__PURE__ */ jsxs3(
|
|
1685
|
+
"button",
|
|
1686
|
+
{
|
|
1687
|
+
type: "button",
|
|
1688
|
+
"aria-current": isSelected ? "true" : void 0,
|
|
1689
|
+
"aria-expanded": hasKnownChildren ? isExpanded : void 0,
|
|
1690
|
+
className: isSelected ? selectedRowClassName : idleRowClassName,
|
|
1691
|
+
onClick,
|
|
1692
|
+
children: [
|
|
1693
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: entry.label }),
|
|
1694
|
+
hasKnownChildren ? /* @__PURE__ */ jsx4(
|
|
1695
|
+
Icon,
|
|
1696
|
+
{
|
|
1697
|
+
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
1698
|
+
size: "small",
|
|
1699
|
+
color: "currentColor",
|
|
1700
|
+
className: "shrink-0 text-agg-muted-foreground"
|
|
1701
|
+
}
|
|
1702
|
+
) : /* @__PURE__ */ jsx4("span", { className: "shrink-0 text-agg-muted-foreground", children: entry.eventCount })
|
|
1703
|
+
]
|
|
1704
|
+
},
|
|
1705
|
+
entry.id
|
|
1706
|
+
);
|
|
1707
|
+
};
|
|
1708
|
+
const renderBranch = (category, depth) => {
|
|
1709
|
+
var _a, _b, _c, _d, _e;
|
|
1710
|
+
const label = (_a = category.displayName) != null ? _a : category.name;
|
|
1711
|
+
const entry = {
|
|
1712
|
+
id: category.id,
|
|
1713
|
+
label,
|
|
1714
|
+
eventCount: (_b = category.eventCount) != null ? _b : 0
|
|
1715
|
+
};
|
|
1716
|
+
const childCategories = (_c = childrenByParentId.get(category.id)) != null ? _c : [];
|
|
1717
|
+
const hasKnownChildren = childCategories.length > 0;
|
|
1718
|
+
const isExpanded = ((_d = categoryPath[depth]) == null ? void 0 : _d.id) === category.id && !collapsedCategoryIds.has(category.id);
|
|
1719
|
+
const isSelected = ((_e = categoryPath[depth]) == null ? void 0 : _e.id) === category.id && categoryPath.length === depth + 1;
|
|
1720
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex w-full flex-col", children: [
|
|
1721
|
+
renderRow({
|
|
1722
|
+
entry,
|
|
1723
|
+
isExpanded,
|
|
1724
|
+
isSelected,
|
|
1725
|
+
onClick: () => onToggleCategory({ entry, depth, hasKnownChildren, isExpanded, isSelected })
|
|
1726
|
+
}),
|
|
1727
|
+
/* @__PURE__ */ jsx4(
|
|
1728
|
+
"div",
|
|
1729
|
+
{
|
|
1730
|
+
className: cn(
|
|
1731
|
+
"grid transition-[grid-template-rows] duration-150 ease-in-out motion-reduce:transition-none",
|
|
1732
|
+
isExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
1733
|
+
),
|
|
1734
|
+
children: /* @__PURE__ */ jsx4("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx4("div", { className: "flex w-full flex-col gap-1 pl-4 pt-1", children: childCategories.map((child) => renderBranch(child, depth + 1)) }) })
|
|
1735
|
+
}
|
|
1736
|
+
)
|
|
1737
|
+
] }, category.id);
|
|
1738
|
+
};
|
|
1739
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex w-full flex-col gap-1", children: [
|
|
1740
|
+
/* @__PURE__ */ jsxs3(
|
|
1741
|
+
"button",
|
|
1742
|
+
{
|
|
1743
|
+
type: "button",
|
|
1744
|
+
"aria-current": !isDrilledIn ? "true" : void 0,
|
|
1745
|
+
className: !isDrilledIn ? selectedRowClassName : idleRowClassName,
|
|
1746
|
+
onClick: onSelectAll,
|
|
1747
|
+
children: [
|
|
1748
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1 truncate", children: labels.subcategoriesAll }),
|
|
1749
|
+
/* @__PURE__ */ jsx4("span", { className: "shrink-0 text-agg-muted-foreground", children: totalEventCount })
|
|
1750
|
+
]
|
|
1751
|
+
}
|
|
1752
|
+
),
|
|
1753
|
+
sortedBaseChildren.map((category) => renderBranch(category, 0))
|
|
1754
|
+
] });
|
|
1755
|
+
};
|
|
1756
|
+
CategorySidebar.displayName = "CategorySidebar";
|
|
1757
|
+
|
|
1758
|
+
// src/events/list/index.tsx
|
|
1759
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1439
1760
|
var SORT_ICON_BY_VALUE = {
|
|
1440
1761
|
volume24hr: "sort-volume-24hr",
|
|
1441
1762
|
topArbitrage: "sort-top-arbitrage",
|
|
@@ -1496,27 +1817,27 @@ var EventList = ({
|
|
|
1496
1817
|
stateRef
|
|
1497
1818
|
}) => {
|
|
1498
1819
|
var _a, _b, _c, _d, _e, _f;
|
|
1499
|
-
const labels =
|
|
1500
|
-
const { disabledVenues } =
|
|
1820
|
+
const labels = useLabels4();
|
|
1821
|
+
const { disabledVenues } = useAppConfig3();
|
|
1501
1822
|
const {
|
|
1502
1823
|
features: { enableVenueEventDiscoveryFilters, showSportsMarkets }
|
|
1503
|
-
} =
|
|
1824
|
+
} = useSdkUiConfig3();
|
|
1504
1825
|
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
1505
1826
|
const resolvedTabs = useEventListTabs();
|
|
1506
|
-
const visibleVenues =
|
|
1827
|
+
const visibleVenues = useMemo5(
|
|
1507
1828
|
() => disabledVenues.length === 0 ? void 0 : getVisibleVenueIdsByConfig(VENUES, disabledVenues),
|
|
1508
1829
|
[disabledVenues]
|
|
1509
1830
|
);
|
|
1510
|
-
const [internalActiveTabValue, setInternalActiveTabValue] =
|
|
1831
|
+
const [internalActiveTabValue, setInternalActiveTabValue] = useState4(
|
|
1511
1832
|
(_b = initialVenueTab != null ? initialVenueTab : (_a = resolvedTabs[0]) == null ? void 0 : _a.value) != null ? _b : "matched"
|
|
1512
1833
|
);
|
|
1513
1834
|
const activeTabValue = controlledActiveVenueTab != null ? controlledActiveVenueTab : internalActiveTabValue;
|
|
1514
|
-
const [internalSelectedSort, setInternalSelectedSort] =
|
|
1835
|
+
const [internalSelectedSort, setInternalSelectedSort] = useState4(DEFAULT_EVENT_LIST_SORT);
|
|
1515
1836
|
const selectedSort = controlledSelectedSort != null ? controlledSelectedSort : internalSelectedSort;
|
|
1516
|
-
const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] =
|
|
1517
|
-
const [internalCategoryPath, setInternalCategoryPath] =
|
|
1837
|
+
const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] = useState4(false);
|
|
1838
|
+
const [internalCategoryPath, setInternalCategoryPath] = useState4([]);
|
|
1518
1839
|
const categoryPath = controlledCategoryPath != null ? controlledCategoryPath : internalCategoryPath;
|
|
1519
|
-
const [collapsedCategoryIds, setCollapsedCategoryIds] =
|
|
1840
|
+
const [collapsedCategoryIds, setCollapsedCategoryIds] = useState4(() => /* @__PURE__ */ new Set());
|
|
1520
1841
|
const handleActiveTabChange = useCallback3(
|
|
1521
1842
|
(value) => {
|
|
1522
1843
|
if (controlledActiveVenueTab == null) setInternalActiveTabValue(value);
|
|
@@ -1538,27 +1859,27 @@ var EventList = ({
|
|
|
1538
1859
|
},
|
|
1539
1860
|
[controlledCategoryPath, onCategoryPathChange]
|
|
1540
1861
|
);
|
|
1541
|
-
const sortItems =
|
|
1862
|
+
const sortItems = useMemo5(() => {
|
|
1542
1863
|
return [
|
|
1543
1864
|
{
|
|
1544
1865
|
value: "volume24hr",
|
|
1545
1866
|
label: labels.eventList.sortBy24hVolume,
|
|
1546
|
-
icon: /* @__PURE__ */
|
|
1867
|
+
icon: /* @__PURE__ */ jsx5(Icon, { name: SORT_ICON_BY_VALUE.volume24hr, size: "small", color: "currentColor" })
|
|
1547
1868
|
},
|
|
1548
1869
|
{
|
|
1549
1870
|
value: "topArbitrage",
|
|
1550
1871
|
label: labels.eventList.sortByTopArbitrage,
|
|
1551
|
-
icon: /* @__PURE__ */
|
|
1872
|
+
icon: /* @__PURE__ */ jsx5(Icon, { name: SORT_ICON_BY_VALUE.topArbitrage, size: "small", color: "currentColor" })
|
|
1552
1873
|
},
|
|
1553
1874
|
{
|
|
1554
1875
|
value: "volume",
|
|
1555
1876
|
label: labels.eventList.sortByTotalVolume,
|
|
1556
|
-
icon: /* @__PURE__ */
|
|
1877
|
+
icon: /* @__PURE__ */ jsx5(Icon, { name: SORT_ICON_BY_VALUE.volume, size: "small", color: "currentColor" })
|
|
1557
1878
|
},
|
|
1558
1879
|
{
|
|
1559
1880
|
value: "endDate",
|
|
1560
1881
|
label: labels.eventList.sortByEndingSoon,
|
|
1561
|
-
icon: /* @__PURE__ */
|
|
1882
|
+
icon: /* @__PURE__ */ jsx5(Icon, { name: SORT_ICON_BY_VALUE.endDate, size: "small", color: "currentColor" })
|
|
1562
1883
|
}
|
|
1563
1884
|
];
|
|
1564
1885
|
}, [
|
|
@@ -1568,8 +1889,8 @@ var EventList = ({
|
|
|
1568
1889
|
labels.eventList.sortByTotalVolume
|
|
1569
1890
|
]);
|
|
1570
1891
|
const baseCategoryId = (_c = categoryIds == null ? void 0 : categoryIds[0]) != null ? _c : null;
|
|
1571
|
-
const previousBaseCategoryIdRef =
|
|
1572
|
-
|
|
1892
|
+
const previousBaseCategoryIdRef = useRef4(baseCategoryId);
|
|
1893
|
+
useEffect4(() => {
|
|
1573
1894
|
var _a2, _b2;
|
|
1574
1895
|
if (previousBaseCategoryIdRef.current === baseCategoryId) return;
|
|
1575
1896
|
previousBaseCategoryIdRef.current = baseCategoryId;
|
|
@@ -1593,10 +1914,10 @@ var EventList = ({
|
|
|
1593
1914
|
enabled: isDiscoveryFiltersEnabled,
|
|
1594
1915
|
limit: 100
|
|
1595
1916
|
});
|
|
1596
|
-
const sortedTopLevelCategories =
|
|
1917
|
+
const sortedTopLevelCategories = useMemo5(() => {
|
|
1597
1918
|
return sortCategoriesForNavigation(topLevelCategories);
|
|
1598
1919
|
}, [topLevelCategories]);
|
|
1599
|
-
const baseCategoryChildPrefetchIds =
|
|
1920
|
+
const baseCategoryChildPrefetchIds = useMemo5(() => {
|
|
1600
1921
|
return Array.from(
|
|
1601
1922
|
/* @__PURE__ */ new Set([
|
|
1602
1923
|
...baseCategoryId ? [baseCategoryId] : [],
|
|
@@ -1611,7 +1932,7 @@ var EventList = ({
|
|
|
1611
1932
|
parentIds: baseCategoryChildPrefetchIds,
|
|
1612
1933
|
limit: 100
|
|
1613
1934
|
});
|
|
1614
|
-
const visibleChildPrefetchIds =
|
|
1935
|
+
const visibleChildPrefetchIds = useMemo5(() => {
|
|
1615
1936
|
var _a2, _b2;
|
|
1616
1937
|
const ids = /* @__PURE__ */ new Set();
|
|
1617
1938
|
if (baseCategoryId) {
|
|
@@ -1632,7 +1953,7 @@ var EventList = ({
|
|
|
1632
1953
|
parentIds: visibleChildPrefetchIds,
|
|
1633
1954
|
limit: 100
|
|
1634
1955
|
});
|
|
1635
|
-
const visibleGrandchildPrefetchIds =
|
|
1956
|
+
const visibleGrandchildPrefetchIds = useMemo5(() => {
|
|
1636
1957
|
var _a2;
|
|
1637
1958
|
const ids = /* @__PURE__ */ new Set();
|
|
1638
1959
|
for (const expandedCategory of categoryPath) {
|
|
@@ -1648,7 +1969,7 @@ var EventList = ({
|
|
|
1648
1969
|
parentIds: visibleGrandchildPrefetchIds,
|
|
1649
1970
|
limit: 100
|
|
1650
1971
|
});
|
|
1651
|
-
const childrenByParentId =
|
|
1972
|
+
const childrenByParentId = useMemo5(() => {
|
|
1652
1973
|
return new Map([
|
|
1653
1974
|
...baseChildrenByParentId,
|
|
1654
1975
|
...visibleChildrenByParentId,
|
|
@@ -1657,10 +1978,10 @@ var EventList = ({
|
|
|
1657
1978
|
}, [baseChildrenByParentId, visibleChildrenByParentId, visibleGrandchildrenByParentId]);
|
|
1658
1979
|
const controlledCategoryPathKey = (_d = controlledCategoryPath == null ? void 0 : controlledCategoryPath.map((entry) => entry.id).join(",")) != null ? _d : "";
|
|
1659
1980
|
const controlledCategoryPathValidationKey = `${baseCategoryId != null ? baseCategoryId : ""}|${controlledCategoryPathKey}`;
|
|
1660
|
-
const [validatedCategoryPathKey, setValidatedCategoryPathKey] =
|
|
1981
|
+
const [validatedCategoryPathKey, setValidatedCategoryPathKey] = useState4(
|
|
1661
1982
|
() => controlledCategoryPath == null || controlledCategoryPath.length === 0 ? controlledCategoryPathValidationKey : ""
|
|
1662
1983
|
);
|
|
1663
|
-
|
|
1984
|
+
useEffect4(() => {
|
|
1664
1985
|
if (controlledCategoryPath == null || controlledCategoryPath.length === 0) {
|
|
1665
1986
|
setValidatedCategoryPathKey(controlledCategoryPathValidationKey);
|
|
1666
1987
|
return;
|
|
@@ -1685,33 +2006,33 @@ var EventList = ({
|
|
|
1685
2006
|
isBaseCategoryChildrenLoading
|
|
1686
2007
|
]);
|
|
1687
2008
|
const shouldRenderSubcategoryFilters = isDiscoveryFiltersEnabled && baseCategoryId !== null && (((_f = (_e = childrenByParentId.get(baseCategoryId)) == null ? void 0 : _e.length) != null ? _f : 0) > 0 || categoryPath.length > 0);
|
|
1688
|
-
const baseCategoryEventCount =
|
|
2009
|
+
const baseCategoryEventCount = useMemo5(() => {
|
|
1689
2010
|
var _a2, _b2;
|
|
1690
2011
|
return (_b2 = (_a2 = sortedTopLevelCategories.find((c) => c.id === baseCategoryId)) == null ? void 0 : _a2.eventCount) != null ? _b2 : 0;
|
|
1691
2012
|
}, [baseCategoryId, sortedTopLevelCategories]);
|
|
1692
|
-
const resolvedCategoryIds =
|
|
2013
|
+
const resolvedCategoryIds = useMemo5(() => {
|
|
1693
2014
|
if (!isDiscoveryFiltersEnabled) return categoryIds;
|
|
1694
2015
|
return resolveCategoryIdsFromPath(categoryPath, baseCategoryId ? [baseCategoryId] : void 0);
|
|
1695
2016
|
}, [baseCategoryId, categoryIds, categoryPath, isDiscoveryFiltersEnabled]);
|
|
1696
|
-
const sortQueryParams =
|
|
2017
|
+
const sortQueryParams = useMemo5(() => {
|
|
1697
2018
|
return resolveSortQueryParams(selectedSort);
|
|
1698
2019
|
}, [selectedSort]);
|
|
1699
|
-
const activeTab =
|
|
2020
|
+
const activeTab = useMemo5(() => {
|
|
1700
2021
|
return resolvedTabs.find((tab) => tab.value === activeTabValue);
|
|
1701
2022
|
}, [activeTabValue, resolvedTabs]);
|
|
1702
|
-
const venues =
|
|
2023
|
+
const venues = useMemo5(() => {
|
|
1703
2024
|
return resolveTabVenus(activeTab, visibleVenues);
|
|
1704
2025
|
}, [activeTab, visibleVenues]);
|
|
1705
|
-
const matchStatus =
|
|
2026
|
+
const matchStatus = useMemo5(() => {
|
|
1706
2027
|
return activeTabValue === "matched" ? activeTab == null ? void 0 : activeTab.matchStatus : void 0;
|
|
1707
2028
|
}, [activeTabValue, activeTab]);
|
|
1708
|
-
const resolvedMaxVisibleItems =
|
|
2029
|
+
const resolvedMaxVisibleItems = useMemo5(() => {
|
|
1709
2030
|
if (!Number.isFinite(maxVisibleItems)) return void 0;
|
|
1710
2031
|
return Math.max(1, Math.floor(maxVisibleItems));
|
|
1711
2032
|
}, [maxVisibleItems]);
|
|
1712
2033
|
const requestLimit = resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : limit;
|
|
1713
2034
|
const shouldPaginate = resolvedMaxVisibleItems == null;
|
|
1714
|
-
const endDateFrom =
|
|
2035
|
+
const endDateFrom = useMemo5(() => {
|
|
1715
2036
|
if (search) return void 0;
|
|
1716
2037
|
const BUCKET_MINUTES = 5;
|
|
1717
2038
|
const bucket = /* @__PURE__ */ new Date();
|
|
@@ -1745,29 +2066,29 @@ var EventList = ({
|
|
|
1745
2066
|
initialPages: initialLoadedPageCount,
|
|
1746
2067
|
enabled: controlledCategoryPath == null || validatedCategoryPathKey === controlledCategoryPathValidationKey
|
|
1747
2068
|
});
|
|
1748
|
-
|
|
2069
|
+
useEffect4(() => {
|
|
1749
2070
|
if (stateRef) {
|
|
1750
2071
|
stateRef.current = { venueTab: activeTabValue, loadedPageCount };
|
|
1751
2072
|
}
|
|
1752
2073
|
}, [stateRef, activeTabValue, loadedPageCount]);
|
|
1753
|
-
const filteredEvents =
|
|
2074
|
+
const filteredEvents = useMemo5(() => {
|
|
1754
2075
|
return filterEventsByTabValue(events, activeTabValue);
|
|
1755
2076
|
}, [events, activeTabValue]);
|
|
1756
|
-
const groupedEvents =
|
|
2077
|
+
const groupedEvents = useMemo5(() => {
|
|
1757
2078
|
return splitEventsByLifecycle(filteredEvents);
|
|
1758
2079
|
}, [filteredEvents]);
|
|
1759
|
-
const orderedEvents =
|
|
2080
|
+
const orderedEvents = useMemo5(() => {
|
|
1760
2081
|
return groupedEvents.open;
|
|
1761
2082
|
}, [groupedEvents.open]);
|
|
1762
|
-
const tileEvents =
|
|
2083
|
+
const tileEvents = useMemo5(() => {
|
|
1763
2084
|
const normalizedEvents = orderedEvents.map((event) => mapEventToEventListItemEvent(event)).filter((event) => event != null);
|
|
1764
2085
|
if (resolvedMaxVisibleItems == null) return normalizedEvents;
|
|
1765
2086
|
return normalizedEvents.slice(0, resolvedMaxVisibleItems);
|
|
1766
2087
|
}, [orderedEvents, resolvedMaxVisibleItems]);
|
|
1767
|
-
const visibleVenueMarkets =
|
|
2088
|
+
const visibleVenueMarkets = useMemo5(() => {
|
|
1768
2089
|
return collectEventListVenueMarkets(tileEvents);
|
|
1769
2090
|
}, [tileEvents]);
|
|
1770
|
-
const visibleMidpointVenueMarketIds =
|
|
2091
|
+
const visibleMidpointVenueMarketIds = useMemo5(() => {
|
|
1771
2092
|
return collectMidpointVenueMarketIds(visibleVenueMarkets);
|
|
1772
2093
|
}, [visibleVenueMarkets]);
|
|
1773
2094
|
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = useVenueMarketMidpoints2({
|
|
@@ -1778,8 +2099,8 @@ var EventList = ({
|
|
|
1778
2099
|
const shouldRenderEmptyState = !isLoading && !isError && tileEvents.length === 0;
|
|
1779
2100
|
const placeholderSkeletonCount = isPlaceholderData ? Math.min(Math.max(tileEvents.length, PLACEHOLDER_SKELETON_MIN_ITEMS), requestLimit) : 0;
|
|
1780
2101
|
const shouldRenderPaginationLoadingItems = shouldPaginate && hasNextPage && !isPlaceholderData;
|
|
1781
|
-
const loadMoreRef =
|
|
1782
|
-
|
|
2102
|
+
const loadMoreRef = useRef4(null);
|
|
2103
|
+
useEffect4(() => {
|
|
1783
2104
|
if (!shouldPaginate) return;
|
|
1784
2105
|
if (!hasNextPage) return;
|
|
1785
2106
|
if (typeof IntersectionObserver === "undefined") return;
|
|
@@ -1830,7 +2151,7 @@ var EventList = ({
|
|
|
1830
2151
|
onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
|
|
1831
2152
|
};
|
|
1832
2153
|
if (shouldRenderLoadingState) {
|
|
1833
|
-
return /* @__PURE__ */
|
|
2154
|
+
return /* @__PURE__ */ jsx5(
|
|
1834
2155
|
Skeleton,
|
|
1835
2156
|
{
|
|
1836
2157
|
view: "event-list",
|
|
@@ -1839,8 +2160,8 @@ var EventList = ({
|
|
|
1839
2160
|
}
|
|
1840
2161
|
);
|
|
1841
2162
|
}
|
|
1842
|
-
return /* @__PURE__ */
|
|
1843
|
-
/* @__PURE__ */
|
|
2163
|
+
return /* @__PURE__ */ jsxs4("section", { className: "agg-event-list flex w-full flex-col gap-2 md:gap-5 t", children: [
|
|
2164
|
+
/* @__PURE__ */ jsxs4(
|
|
1844
2165
|
"header",
|
|
1845
2166
|
{
|
|
1846
2167
|
className: cn(
|
|
@@ -1849,19 +2170,18 @@ var EventList = ({
|
|
|
1849
2170
|
"gap-2 sm:flex-row sm:items-center sm:gap-4"
|
|
1850
2171
|
),
|
|
1851
2172
|
children: [
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
1855
|
-
|
|
2173
|
+
/* @__PURE__ */ jsx5("div", { className: "agg-event-list-title min-w-32", children: /* @__PURE__ */ jsx5(Typography, { as: "h2", variant: "title", className: "truncate first-letter:uppercase", children: title }) }),
|
|
2174
|
+
/* @__PURE__ */ jsxs4("div", { className: "hidden min-w-0 max-w-full items-center gap-3 md:flex", children: [
|
|
2175
|
+
/* @__PURE__ */ jsx5(
|
|
2176
|
+
EventListVenueStrip,
|
|
1856
2177
|
{
|
|
1857
2178
|
ariaLabel: labels.eventList.tabsAria(title),
|
|
1858
|
-
className: "agg-event-list-tabs
|
|
2179
|
+
className: "agg-event-list-tabs",
|
|
1859
2180
|
activeTab: activeTabValue,
|
|
1860
|
-
onTabChange: handleActiveTabChange
|
|
1861
|
-
overflowBehavior: "scroll"
|
|
2181
|
+
onTabChange: handleActiveTabChange
|
|
1862
2182
|
}
|
|
1863
2183
|
),
|
|
1864
|
-
/* @__PURE__ */
|
|
2184
|
+
/* @__PURE__ */ jsx5(
|
|
1865
2185
|
Select,
|
|
1866
2186
|
{
|
|
1867
2187
|
ariaLabel: labels.eventList.sortByLabel,
|
|
@@ -1877,18 +2197,18 @@ var EventList = ({
|
|
|
1877
2197
|
]
|
|
1878
2198
|
}
|
|
1879
2199
|
),
|
|
1880
|
-
/* @__PURE__ */
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
/* @__PURE__ */
|
|
2200
|
+
/* @__PURE__ */ jsx5(
|
|
2201
|
+
EventListVenueStrip,
|
|
2202
|
+
{
|
|
2203
|
+
ariaLabel: labels.eventList.tabsAria(title),
|
|
2204
|
+
className: "agg-event-list-tabs md:hidden!",
|
|
2205
|
+
activeTab: activeTabValue,
|
|
2206
|
+
onTabChange: handleActiveTabChange,
|
|
2207
|
+
fullWidth: true
|
|
2208
|
+
}
|
|
2209
|
+
),
|
|
2210
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex w-full gap-2 md:hidden mb-3", children: [
|
|
2211
|
+
/* @__PURE__ */ jsx5(
|
|
1892
2212
|
Select,
|
|
1893
2213
|
{
|
|
1894
2214
|
ariaLabel: labels.eventList.sortByLabel,
|
|
@@ -1899,23 +2219,23 @@ var EventList = ({
|
|
|
1899
2219
|
contentClassName: "rounded-[12px] py-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]"
|
|
1900
2220
|
}
|
|
1901
2221
|
),
|
|
1902
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */
|
|
2222
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx5(
|
|
1903
2223
|
"button",
|
|
1904
2224
|
{
|
|
1905
2225
|
type: "button",
|
|
1906
2226
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-[8px] border-2 border-agg-primary bg-agg-secondary text-agg-foreground cursor-pointer",
|
|
1907
2227
|
"aria-label": labels.eventList.subcategoriesOpenAria,
|
|
1908
2228
|
onClick: () => setIsSubcategoriesModalOpen(true),
|
|
1909
|
-
children: /* @__PURE__ */
|
|
2229
|
+
children: /* @__PURE__ */ jsx5(Icon, { name: "apps", size: "small", color: "currentColor" })
|
|
1910
2230
|
}
|
|
1911
2231
|
) : null
|
|
1912
2232
|
] }),
|
|
1913
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ jsxs4(
|
|
1914
2234
|
"div",
|
|
1915
2235
|
{
|
|
1916
2236
|
className: cn("flex w-full gap-6", shouldRenderSubcategoryFilters ? "md:items-start" : ""),
|
|
1917
2237
|
children: [
|
|
1918
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */
|
|
2238
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx5("aside", { className: "hidden w-[200px] shrink-0 md:block self-start sticky top-4", children: /* @__PURE__ */ jsx5("div", { className: "agg-sidebar max-h-[calc(100vh-19rem)] overflow-y-auto rounded-[8px] border border-agg-separator bg-agg-secondary p-2", children: /* @__PURE__ */ jsx5(
|
|
1919
2239
|
CategorySidebar,
|
|
1920
2240
|
{
|
|
1921
2241
|
baseCategoryId,
|
|
@@ -1928,7 +2248,7 @@ var EventList = ({
|
|
|
1928
2248
|
onToggleCategory: handleToggleSubcategory
|
|
1929
2249
|
}
|
|
1930
2250
|
) }) }) : null,
|
|
1931
|
-
/* @__PURE__ */
|
|
2251
|
+
/* @__PURE__ */ jsxs4(
|
|
1932
2252
|
"div",
|
|
1933
2253
|
{
|
|
1934
2254
|
className: cn(
|
|
@@ -1938,7 +2258,7 @@ var EventList = ({
|
|
|
1938
2258
|
gridClassName
|
|
1939
2259
|
),
|
|
1940
2260
|
children: [
|
|
1941
|
-
isPlaceholderData ? Array.from({ length: placeholderSkeletonCount }).map((_, index) => /* @__PURE__ */
|
|
2261
|
+
isPlaceholderData ? Array.from({ length: placeholderSkeletonCount }).map((_, index) => /* @__PURE__ */ jsx5(
|
|
1942
2262
|
EventListItem,
|
|
1943
2263
|
{
|
|
1944
2264
|
isLoading: true,
|
|
@@ -1948,7 +2268,7 @@ var EventList = ({
|
|
|
1948
2268
|
},
|
|
1949
2269
|
`placeholder-${index}`
|
|
1950
2270
|
)) : null,
|
|
1951
|
-
(isPlaceholderData ? [] : tileEvents).map((event) => /* @__PURE__ */
|
|
2271
|
+
(isPlaceholderData ? [] : tileEvents).map((event) => /* @__PURE__ */ jsx5(
|
|
1952
2272
|
EventListItem,
|
|
1953
2273
|
{
|
|
1954
2274
|
event,
|
|
@@ -1965,7 +2285,7 @@ var EventList = ({
|
|
|
1965
2285
|
},
|
|
1966
2286
|
event.id
|
|
1967
2287
|
)),
|
|
1968
|
-
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */
|
|
2288
|
+
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ jsx5(
|
|
1969
2289
|
EventListItem,
|
|
1970
2290
|
{
|
|
1971
2291
|
isLoading: true,
|
|
@@ -1975,20 +2295,20 @@ var EventList = ({
|
|
|
1975
2295
|
},
|
|
1976
2296
|
`loading-${index}`
|
|
1977
2297
|
)) : null,
|
|
1978
|
-
shouldRenderEmptyState ? /* @__PURE__ */
|
|
2298
|
+
shouldRenderEmptyState ? /* @__PURE__ */ jsx5("div", { className: "col-span-full w-full", children: /* @__PURE__ */ jsx5(
|
|
1979
2299
|
StateMessage,
|
|
1980
2300
|
{
|
|
1981
2301
|
title: labels.eventList.emptyTitle,
|
|
1982
2302
|
description: labels.eventList.emptyDescription,
|
|
1983
|
-
icon: /* @__PURE__ */
|
|
2303
|
+
icon: /* @__PURE__ */ jsx5(Icon, { name: "search-empty" })
|
|
1984
2304
|
}
|
|
1985
2305
|
) }) : null,
|
|
1986
|
-
isError ? /* @__PURE__ */
|
|
2306
|
+
isError ? /* @__PURE__ */ jsx5("div", { className: "col-span-full w-full", children: /* @__PURE__ */ jsx5(
|
|
1987
2307
|
StateMessage,
|
|
1988
2308
|
{
|
|
1989
2309
|
title: labels.eventList.errorTitle,
|
|
1990
2310
|
description: labels.eventList.errorDescription,
|
|
1991
|
-
icon: /* @__PURE__ */
|
|
2311
|
+
icon: /* @__PURE__ */ jsx5(Icon, { name: "warning" })
|
|
1992
2312
|
}
|
|
1993
2313
|
) }) : null
|
|
1994
2314
|
]
|
|
@@ -1997,7 +2317,7 @@ var EventList = ({
|
|
|
1997
2317
|
]
|
|
1998
2318
|
}
|
|
1999
2319
|
),
|
|
2000
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */
|
|
2320
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx5(Modal, { open: isSubcategoriesModalOpen, onOpenChange: setIsSubcategoriesModalOpen, children: /* @__PURE__ */ jsx5(
|
|
2001
2321
|
Modal.Container,
|
|
2002
2322
|
{
|
|
2003
2323
|
classNames: {
|
|
@@ -2006,20 +2326,20 @@ var EventList = ({
|
|
|
2006
2326
|
content: "items-end p-0 pointer-events-none",
|
|
2007
2327
|
container: "w-full max-w-none border-0 bg-transparent shadow-none"
|
|
2008
2328
|
},
|
|
2009
|
-
children: /* @__PURE__ */
|
|
2010
|
-
/* @__PURE__ */
|
|
2011
|
-
/* @__PURE__ */
|
|
2012
|
-
/* @__PURE__ */
|
|
2013
|
-
/* @__PURE__ */
|
|
2329
|
+
children: /* @__PURE__ */ jsxs4("div", { className: "pointer-events-auto w-full rounded-t-[12px] border border-agg-separator bg-agg-secondary", children: [
|
|
2330
|
+
/* @__PURE__ */ jsx5("div", { className: "flex justify-center pb-1 pt-3", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("div", { className: "h-1 w-10 rounded-full bg-agg-muted-foreground/30" }) }),
|
|
2331
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between px-4 pb-2 pt-1", children: [
|
|
2332
|
+
/* @__PURE__ */ jsx5(Dialog.Title, { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.eventList.subcategoriesLabel }),
|
|
2333
|
+
/* @__PURE__ */ jsx5(
|
|
2014
2334
|
Dialog.Close,
|
|
2015
2335
|
{
|
|
2016
2336
|
className: "flex cursor-pointer items-center justify-center rounded-full p-1 text-agg-muted-foreground hover:bg-agg-secondary-hover",
|
|
2017
2337
|
"aria-label": labels.common.close,
|
|
2018
|
-
children: /* @__PURE__ */
|
|
2338
|
+
children: /* @__PURE__ */ jsx5(CloseIcon, { className: "h-5 w-5" })
|
|
2019
2339
|
}
|
|
2020
2340
|
)
|
|
2021
2341
|
] }),
|
|
2022
|
-
/* @__PURE__ */
|
|
2342
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-col gap-1 px-4 pb-4", children: /* @__PURE__ */ jsx5(
|
|
2023
2343
|
CategorySidebar,
|
|
2024
2344
|
{
|
|
2025
2345
|
baseCategoryId,
|
|
@@ -2035,7 +2355,7 @@ var EventList = ({
|
|
|
2035
2355
|
] })
|
|
2036
2356
|
}
|
|
2037
2357
|
) }) : null,
|
|
2038
|
-
shouldPaginate && hasNextPage ? /* @__PURE__ */
|
|
2358
|
+
shouldPaginate && hasNextPage ? /* @__PURE__ */ jsx5("div", { ref: loadMoreRef, className: "agg-event-list-sentinel h-px w-full", "aria-hidden": true }) : null
|
|
2039
2359
|
] });
|
|
2040
2360
|
};
|
|
2041
2361
|
EventList.displayName = "EventList";
|
|
@@ -2049,5 +2369,6 @@ export {
|
|
|
2049
2369
|
useEventListTabs,
|
|
2050
2370
|
EventListTabs,
|
|
2051
2371
|
useEventListTabsHeaderOverflow,
|
|
2372
|
+
EventListVenueStrip,
|
|
2052
2373
|
EventList
|
|
2053
2374
|
};
|