@agg-market/ui 8.0.0 → 10.0.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-SBLIHCN2.mjs → chunk-55YYUTBK.mjs} +807 -358
- package/dist/{chunk-JE4MV5RL.mjs → chunk-5G4T5R2H.mjs} +6 -2
- package/dist/{chunk-TLFRGJ5B.mjs → chunk-GYOCLZGH.mjs} +564 -414
- package/dist/{chunk-KRCRD4AJ.mjs → chunk-RYQSVETG.mjs} +212 -174
- package/dist/{chunk-WKY3IN52.mjs → chunk-XP7DREIX.mjs} +54 -15
- package/dist/events.js +604 -421
- package/dist/events.mjs +6 -4
- package/dist/index.js +1616 -948
- package/dist/index.mjs +10 -6
- package/dist/modals.js +1185 -374
- package/dist/modals.mjs +4 -2
- package/dist/pages.js +1434 -1005
- package/dist/pages.mjs +4 -4
- package/dist/primitives.js +53 -14
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +20 -4
- package/dist/trading.mjs +2 -2
- package/dist/types/events/item/event-list-item.types.d.mts +6 -4
- package/dist/types/events/item/event-list-item.types.d.ts +6 -4
- package/dist/types/events/item/event-list-item.utils.d.mts +5 -5
- package/dist/types/events/item/event-list-item.utils.d.ts +5 -5
- package/dist/types/events/item/index.d.mts +1 -1
- package/dist/types/events/item/index.d.ts +1 -1
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +3 -5
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +3 -5
- package/dist/types/events/item-details/event-list-item-details.utils.d.mts +42 -3
- package/dist/types/events/item-details/event-list-item-details.utils.d.ts +42 -3
- package/dist/types/events/list/event-list.types.d.mts +6 -5
- package/dist/types/events/list/event-list.types.d.ts +6 -5
- package/dist/types/events/list/event-list.utils.d.mts +5 -5
- package/dist/types/events/list/event-list.utils.d.ts +5 -5
- package/dist/types/events/list/index.d.mts +1 -1
- package/dist/types/events/list/index.d.ts +1 -1
- package/dist/types/events/market-details/index.d.mts +6 -2
- package/dist/types/events/market-details/index.d.ts +6 -2
- package/dist/types/events/market-details/market-details.types.d.mts +35 -9
- package/dist/types/events/market-details/market-details.types.d.ts +35 -9
- package/dist/types/events/market-details/market-details.utils.d.mts +28 -12
- package/dist/types/events/market-details/market-details.utils.d.ts +28 -12
- package/dist/types/modals/index.d.mts +1 -0
- package/dist/types/modals/index.d.ts +1 -0
- package/dist/types/onramp/index.d.mts +6 -0
- package/dist/types/onramp/index.d.ts +6 -0
- package/dist/types/onramp/onramp-modal.constants.d.mts +9 -0
- package/dist/types/onramp/onramp-modal.constants.d.ts +9 -0
- package/dist/types/onramp/onramp-modal.types.d.mts +64 -0
- package/dist/types/onramp/onramp-modal.types.d.ts +64 -0
- package/dist/types/onramp/steps/quote-card.d.mts +8 -0
- package/dist/types/onramp/steps/quote-card.d.ts +8 -0
- package/dist/types/onramp/steps/quote-form.d.mts +12 -0
- package/dist/types/onramp/steps/quote-form.d.ts +12 -0
- package/dist/types/onramp/steps/quote-selection.d.mts +14 -0
- package/dist/types/onramp/steps/quote-selection.d.ts +14 -0
- package/dist/types/onramp/steps/widget.d.mts +7 -0
- package/dist/types/onramp/steps/widget.d.ts +7 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +4 -2
- package/dist/types/pages/event-market/event-market.types.d.ts +4 -2
- package/dist/types/pages/home/home.constants.d.mts +1 -3
- package/dist/types/pages/home/home.constants.d.ts +1 -3
- package/dist/types/pages/home/home.types.d.mts +0 -2
- package/dist/types/pages/home/home.types.d.ts +0 -2
- package/dist/types/pages/home/home.utils.d.mts +4 -0
- package/dist/types/pages/home/home.utils.d.ts +4 -0
- package/dist/types/pages/home/index.d.mts +1 -1
- package/dist/types/pages/home/index.d.ts +1 -1
- package/dist/types/primitives/chart/index.d.mts +18 -1
- package/dist/types/primitives/chart/index.d.ts +18 -1
- package/dist/types/primitives/venue-logo/index.d.mts +1 -1
- package/dist/types/primitives/venue-logo/index.d.ts +1 -1
- package/dist/types/trading/types.d.mts +2 -2
- package/dist/types/trading/types.d.ts +2 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -128,9 +128,11 @@ __export(src_exports, {
|
|
|
128
128
|
LinkAccountsIcon: () => LinkAccountsIcon,
|
|
129
129
|
LoadingIcon: () => LoadingIcon,
|
|
130
130
|
MarketDetails: () => MarketDetails,
|
|
131
|
+
MarketDetailsList: () => MarketDetailsList,
|
|
131
132
|
Modal: () => Modal,
|
|
132
133
|
NumberValue: () => NumberValue,
|
|
133
134
|
OnboardingModal: () => OnboardingModal,
|
|
135
|
+
OnrampModal: () => OnrampModal,
|
|
134
136
|
PencilIcon: () => PencilIcon,
|
|
135
137
|
PlaceOrder: () => PlaceOrder,
|
|
136
138
|
PlaySquareIcon: () => PlaySquareIcon,
|
|
@@ -915,7 +917,7 @@ var SwitchButton = ({
|
|
|
915
917
|
"div",
|
|
916
918
|
{
|
|
917
919
|
className: cn(
|
|
918
|
-
"group/agg-switch",
|
|
920
|
+
"group/agg-switch min-w-fit",
|
|
919
921
|
"inline-flex min-w-0 rounded-agg-full bg-agg-secondary-hover font-agg-sans",
|
|
920
922
|
getMotionClassName(enableAnimations, "transition-background duration-200 ease-in-out"),
|
|
921
923
|
"cursor-pointer hover:bg-agg-tertiary",
|
|
@@ -961,6 +963,7 @@ var SwitchButton = ({
|
|
|
961
963
|
tabIndex: isActive ? 0 : -1,
|
|
962
964
|
disabled: option.disabled,
|
|
963
965
|
className: cn(
|
|
966
|
+
"whitespace-nowrap",
|
|
964
967
|
"relative z-10 min-w-0 rounded-agg-full px-5 py-1.5 font-agg-sans text-agg-base leading-agg-6 text-agg-foreground",
|
|
965
968
|
getMotionClassName(
|
|
966
969
|
enableAnimations,
|
|
@@ -1232,11 +1235,16 @@ var LineChart = ({
|
|
|
1232
1235
|
isLoading = false,
|
|
1233
1236
|
chartType = "line",
|
|
1234
1237
|
showSeriesControls = true,
|
|
1235
|
-
renderSeriesControls
|
|
1238
|
+
renderSeriesControls,
|
|
1239
|
+
liveCandle: liveForming,
|
|
1240
|
+
lineData,
|
|
1241
|
+
lineValue,
|
|
1242
|
+
live
|
|
1236
1243
|
}) => {
|
|
1237
1244
|
var _a, _b;
|
|
1238
1245
|
const labels = (0, import_hooks11.useLabels)();
|
|
1239
|
-
const { theme } = (0, import_hooks11.useSdkUiConfig)();
|
|
1246
|
+
const { theme, enableGradients, enableLiveUpdates } = (0, import_hooks11.useSdkUiConfig)();
|
|
1247
|
+
const isLive = enableLiveUpdates && (live != null ? live : true);
|
|
1240
1248
|
const normalizedSeries = (0, import_react2.useMemo)(() => {
|
|
1241
1249
|
return normalizeSeries(series);
|
|
1242
1250
|
}, [series]);
|
|
@@ -1259,7 +1267,19 @@ var LineChart = ({
|
|
|
1259
1267
|
if (!primarySeries) {
|
|
1260
1268
|
return [];
|
|
1261
1269
|
}
|
|
1262
|
-
|
|
1270
|
+
const points = toLivelinePoints(primarySeries.points);
|
|
1271
|
+
if (points.length < 3) {
|
|
1272
|
+
return [
|
|
1273
|
+
...points,
|
|
1274
|
+
...points.map((point) => __spreadProps(__spreadValues({}, point), {
|
|
1275
|
+
time: point.time + 1500
|
|
1276
|
+
})),
|
|
1277
|
+
...points.map((point) => __spreadProps(__spreadValues({}, point), {
|
|
1278
|
+
time: point.time + 3e3
|
|
1279
|
+
}))
|
|
1280
|
+
];
|
|
1281
|
+
}
|
|
1282
|
+
return points;
|
|
1263
1283
|
}, [primarySeries]);
|
|
1264
1284
|
const primaryCandles = (0, import_react2.useMemo)(() => {
|
|
1265
1285
|
if (!primarySeries) {
|
|
@@ -1293,7 +1313,7 @@ var LineChart = ({
|
|
|
1293
1313
|
const timeFormatter = (0, import_react2.useMemo)(() => {
|
|
1294
1314
|
return resolveTimeFormatter(windowSeconds);
|
|
1295
1315
|
}, [windowSeconds]);
|
|
1296
|
-
const seriesControls = showSeriesControls
|
|
1316
|
+
const seriesControls = showSeriesControls ? (_a = renderSeriesControls == null ? void 0 : renderSeriesControls({
|
|
1297
1317
|
series: normalizedSeries,
|
|
1298
1318
|
activeSeriesId,
|
|
1299
1319
|
handleSeriesChange
|
|
@@ -1326,13 +1346,17 @@ var LineChart = ({
|
|
|
1326
1346
|
series: livelineSeries,
|
|
1327
1347
|
color: (_b = primarySeries == null ? void 0 : primarySeries.color) != null ? _b : "var(--agg-color-primary)",
|
|
1328
1348
|
theme: livelineTheme,
|
|
1349
|
+
fill: enableGradients,
|
|
1329
1350
|
grid: true,
|
|
1330
|
-
momentum:
|
|
1331
|
-
pulse:
|
|
1351
|
+
momentum: isLive,
|
|
1352
|
+
pulse: isLive,
|
|
1332
1353
|
window: windowSeconds,
|
|
1333
1354
|
mode: chartType === "candlestick" ? "candle" : "line",
|
|
1334
1355
|
candles: chartType === "candlestick" ? primaryCandles : void 0,
|
|
1335
1356
|
candleWidth: chartType === "candlestick" ? candleWidth : void 0,
|
|
1357
|
+
liveCandle: chartType === "candlestick" ? liveForming : void 0,
|
|
1358
|
+
lineData,
|
|
1359
|
+
lineValue,
|
|
1336
1360
|
formatValue: defaultValueFormatter,
|
|
1337
1361
|
formatTime: timeFormatter,
|
|
1338
1362
|
padding: {
|
|
@@ -1341,7 +1365,8 @@ var LineChart = ({
|
|
|
1341
1365
|
bottom: 28,
|
|
1342
1366
|
left: 12
|
|
1343
1367
|
},
|
|
1344
|
-
loading: isLoading
|
|
1368
|
+
loading: isLoading,
|
|
1369
|
+
lineWidth: 1
|
|
1345
1370
|
}
|
|
1346
1371
|
)
|
|
1347
1372
|
}
|
|
@@ -3645,9 +3670,12 @@ var VenueLogo = ({
|
|
|
3645
3670
|
title
|
|
3646
3671
|
}) => {
|
|
3647
3672
|
var _a;
|
|
3673
|
+
const { showVenueLogo = true } = (0, import_hooks14.useAggUiConfig)();
|
|
3648
3674
|
const labels = (0, import_hooks14.useLabels)();
|
|
3649
3675
|
const sizeClass = sizeClasses2[size];
|
|
3650
3676
|
const resolvedLabel = (_a = ariaLabel != null ? ariaLabel : labels.venues[venue]) != null ? _a : venueLogoLabels[venue];
|
|
3677
|
+
if (!showVenueLogo)
|
|
3678
|
+
return null;
|
|
3651
3679
|
if (variant === "logo") {
|
|
3652
3680
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3653
3681
|
RemoteImage,
|
|
@@ -3721,9 +3749,9 @@ function Badge({
|
|
|
3721
3749
|
)
|
|
3722
3750
|
}, onClick && { onClick }), {
|
|
3723
3751
|
children: [
|
|
3724
|
-
prefix ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: classNames == null ? void 0 : classNames.prefix, children: prefix }) : null,
|
|
3752
|
+
prefix ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: cn(classNames == null ? void 0 : classNames.prefix, "empty:hidden"), children: prefix }) : null,
|
|
3725
3753
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: cn("truncate", classNames == null ? void 0 : classNames.text), children: text }),
|
|
3726
|
-
suffix ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: classNames == null ? void 0 : classNames.suffix, children: suffix }) : null
|
|
3754
|
+
suffix ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: cn(classNames == null ? void 0 : classNames.suffix, "empty:hidden"), children: suffix }) : null
|
|
3727
3755
|
]
|
|
3728
3756
|
})
|
|
3729
3757
|
);
|
|
@@ -4229,7 +4257,11 @@ var StateMessage = ({
|
|
|
4229
4257
|
size: "large",
|
|
4230
4258
|
className: "text-agg-base leading-agg-6",
|
|
4231
4259
|
"aria-label": actionLabel,
|
|
4232
|
-
onClick:
|
|
4260
|
+
onClick: (e) => {
|
|
4261
|
+
e.stopPropagation();
|
|
4262
|
+
e.preventDefault();
|
|
4263
|
+
onAction == null ? void 0 : onAction();
|
|
4264
|
+
},
|
|
4233
4265
|
children: actionLabel
|
|
4234
4266
|
}
|
|
4235
4267
|
) : null
|
|
@@ -4281,7 +4313,7 @@ var getTabButtonClassName = ({
|
|
|
4281
4313
|
return cn(
|
|
4282
4314
|
"cursor-pointer disabled:cursor-not-allowed",
|
|
4283
4315
|
"relative inline-flex h-full shrink-0 items-center justify-center gap-2 font-agg-sans",
|
|
4284
|
-
isBarVariant ? "hover:text-agg-foreground hover:bg-agg-secondary-hover" : "hover:text-agg-foreground hover:font-bold",
|
|
4316
|
+
isBarVariant ? "hover:text-agg-foreground hover:bg-agg-secondary-hover" : "hover:text-agg-foreground hover:font-agg-bold",
|
|
4285
4317
|
getMotionClassName(
|
|
4286
4318
|
enableAnimations,
|
|
4287
4319
|
"transition-[colors] duration-300 ease-in-out motion-reduce:transition-none"
|
|
@@ -4707,8 +4739,17 @@ var Tabs = ({
|
|
|
4707
4739
|
)
|
|
4708
4740
|
}
|
|
4709
4741
|
) }) : null,
|
|
4710
|
-
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "relative z-10 inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
|
|
4711
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
4742
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "relative z-10 inline-flex shrink-0 items-center justify-center empty:hidden", children: item.icon }) : null,
|
|
4743
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
4744
|
+
"span",
|
|
4745
|
+
{
|
|
4746
|
+
className: cn(
|
|
4747
|
+
"relative z-10 truncate whitespace-nowrap [&::first-letter]:uppercase"
|
|
4748
|
+
),
|
|
4749
|
+
"data-text": item.label,
|
|
4750
|
+
children: item.label
|
|
4751
|
+
}
|
|
4752
|
+
)
|
|
4712
4753
|
]
|
|
4713
4754
|
},
|
|
4714
4755
|
item.value
|
|
@@ -5551,10 +5592,7 @@ var isErrorWithStatus = (error, status) => {
|
|
|
5551
5592
|
var resolveEventListItemEvent = (fetchedEvent) => {
|
|
5552
5593
|
if (!fetchedEvent)
|
|
5553
5594
|
return void 0;
|
|
5554
|
-
|
|
5555
|
-
(market) => market.venueMarkets
|
|
5556
|
-
);
|
|
5557
|
-
if (mergedVenueMarkets.length === 0)
|
|
5595
|
+
if (!fetchedEvent.venueMarkets || fetchedEvent.venueMarkets.length === 0)
|
|
5558
5596
|
return void 0;
|
|
5559
5597
|
return fetchedEvent;
|
|
5560
5598
|
};
|
|
@@ -5739,7 +5777,6 @@ var EventListItemContent = ({
|
|
|
5739
5777
|
event,
|
|
5740
5778
|
title,
|
|
5741
5779
|
image,
|
|
5742
|
-
showVenueLogo = true,
|
|
5743
5780
|
maxOutcomes = 2,
|
|
5744
5781
|
classNames,
|
|
5745
5782
|
venueInfo,
|
|
@@ -5751,8 +5788,8 @@ var EventListItemContent = ({
|
|
|
5751
5788
|
const config = (0, import_hooks21.useSdkUiConfig)();
|
|
5752
5789
|
const labels = (0, import_hooks21.useLabels)();
|
|
5753
5790
|
const allVenueMarkets = (0, import_react8.useMemo)(() => {
|
|
5754
|
-
return event.
|
|
5755
|
-
}, [event.
|
|
5791
|
+
return event.venueMarkets;
|
|
5792
|
+
}, [event.venueMarkets]);
|
|
5756
5793
|
const primaryVenueMarket = (0, import_react8.useMemo)(() => {
|
|
5757
5794
|
return selectPrimaryVenueMarket(allVenueMarkets);
|
|
5758
5795
|
}, [allVenueMarkets]);
|
|
@@ -5775,7 +5812,7 @@ var EventListItemContent = ({
|
|
|
5775
5812
|
return;
|
|
5776
5813
|
if ((eventToHandle == null ? void 0 : eventToHandle.key) === "Enter" || (eventToHandle == null ? void 0 : eventToHandle.key) === " ") {
|
|
5777
5814
|
eventToHandle == null ? void 0 : eventToHandle.preventDefault();
|
|
5778
|
-
onClick();
|
|
5815
|
+
onClick == null ? void 0 : onClick(event);
|
|
5779
5816
|
}
|
|
5780
5817
|
};
|
|
5781
5818
|
const renderArbitrage = (value) => {
|
|
@@ -5802,7 +5839,7 @@ var EventListItemContent = ({
|
|
|
5802
5839
|
className: cn(baseCardClassName, onClick && "cursor-pointer", classNames == null ? void 0 : classNames.root),
|
|
5803
5840
|
role: onClick ? "button" : void 0,
|
|
5804
5841
|
tabIndex: onClick ? 0 : void 0,
|
|
5805
|
-
onClick,
|
|
5842
|
+
onClick: () => onClick == null ? void 0 : onClick(event),
|
|
5806
5843
|
onKeyDown: handleKeyDown,
|
|
5807
5844
|
"aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
|
|
5808
5845
|
children: [
|
|
@@ -5856,7 +5893,7 @@ var EventListItemContent = ({
|
|
|
5856
5893
|
Badge,
|
|
5857
5894
|
{
|
|
5858
5895
|
text: config.formatPercent(probability),
|
|
5859
|
-
prefix:
|
|
5896
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(VenueLogo, { venue: visibleOutcome.venue, size: "small" }),
|
|
5860
5897
|
size: "large",
|
|
5861
5898
|
classNames: {
|
|
5862
5899
|
root: cn(
|
|
@@ -5889,7 +5926,7 @@ var EventListItemContent = ({
|
|
|
5889
5926
|
) }),
|
|
5890
5927
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "text-agg-muted-foreground", children: "\xD7" }),
|
|
5891
5928
|
singleVenue ? /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("span", { className: "flex items-center gap-1 truncate text-agg-muted-foreground", children: [
|
|
5892
|
-
|
|
5929
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
5893
5930
|
VenueLogo,
|
|
5894
5931
|
{
|
|
5895
5932
|
venue: singleVenue,
|
|
@@ -5897,14 +5934,14 @@ var EventListItemContent = ({
|
|
|
5897
5934
|
isMonochromatic: true,
|
|
5898
5935
|
className: "text-agg-muted-foreground!"
|
|
5899
5936
|
}
|
|
5900
|
-
)
|
|
5937
|
+
),
|
|
5901
5938
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { children: venueLabel })
|
|
5902
5939
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "truncate text-agg-muted-foreground", children: formatCountLabel(
|
|
5903
5940
|
venueCount,
|
|
5904
5941
|
labels.eventItem.venueSingular,
|
|
5905
5942
|
labels.eventItem.venuePlural
|
|
5906
5943
|
) }),
|
|
5907
|
-
|
|
5944
|
+
!singleVenue && visibleVenueLogos.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "flex items-center gap-1 overflow-hidden", children: visibleVenueLogos.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
5908
5945
|
VenueLogo,
|
|
5909
5946
|
{
|
|
5910
5947
|
venue,
|
|
@@ -5934,7 +5971,8 @@ var EventListItemByEventId = (_a) => {
|
|
|
5934
5971
|
error,
|
|
5935
5972
|
isError,
|
|
5936
5973
|
isLoading
|
|
5937
|
-
} = (0, import_hooks21.
|
|
5974
|
+
} = (0, import_hooks21.useVenueEvent)({
|
|
5975
|
+
eventId: eventId != null ? eventId : "",
|
|
5938
5976
|
enabled: !!eventId
|
|
5939
5977
|
});
|
|
5940
5978
|
const resolvedEvent = (0, import_react8.useMemo)(() => {
|
|
@@ -6034,7 +6072,9 @@ var ChartTypeSwitch = ({
|
|
|
6034
6072
|
"transition-colors duration-200 ease-in-out",
|
|
6035
6073
|
isActive ? "text-agg-foreground" : "text-agg-muted-foreground"
|
|
6036
6074
|
),
|
|
6037
|
-
onClick: () => {
|
|
6075
|
+
onClick: (e) => {
|
|
6076
|
+
e.stopPropagation();
|
|
6077
|
+
e.preventDefault();
|
|
6038
6078
|
if (isActive) {
|
|
6039
6079
|
return;
|
|
6040
6080
|
}
|
|
@@ -6063,14 +6103,9 @@ var isDateLikeLabel = (value) => {
|
|
|
6063
6103
|
return false;
|
|
6064
6104
|
return (0, import_dayjs3.default)(value).isValid();
|
|
6065
6105
|
};
|
|
6066
|
-
var
|
|
6067
|
-
if (!isDateLikeLabel(value))
|
|
6068
|
-
return value;
|
|
6069
|
-
return (0, import_dayjs3.default)(value).format("MMM D, YYYY");
|
|
6070
|
-
};
|
|
6071
|
-
var getDefaultSelectedTimeRange = (value) => {
|
|
6106
|
+
var getDefaultSelectedTimeRange = (value, fallback = "1D") => {
|
|
6072
6107
|
if (!value)
|
|
6073
|
-
return
|
|
6108
|
+
return fallback;
|
|
6074
6109
|
return value;
|
|
6075
6110
|
};
|
|
6076
6111
|
var getTimeWindowByRange = (range) => {
|
|
@@ -6152,24 +6187,6 @@ var resolveOutcomesByVenue = (venueMarkets, selectedOutcomeLabel) => {
|
|
|
6152
6187
|
};
|
|
6153
6188
|
}).filter((item) => item != null);
|
|
6154
6189
|
};
|
|
6155
|
-
var buildPriceHistoryGroups = (selectedOutcomes, fallbackMarketId) => {
|
|
6156
|
-
const marketIdByVenue = /* @__PURE__ */ new Map();
|
|
6157
|
-
selectedOutcomes.forEach(({ venue, market }) => {
|
|
6158
|
-
var _a, _b;
|
|
6159
|
-
const marketWithCanonicalId = market;
|
|
6160
|
-
const canonicalMarketId = (_a = marketWithCanonicalId.marketId) != null ? _a : fallbackMarketId;
|
|
6161
|
-
if (!canonicalMarketId)
|
|
6162
|
-
return;
|
|
6163
|
-
if (!marketIdByVenue.has(venue)) {
|
|
6164
|
-
marketIdByVenue.set(venue, /* @__PURE__ */ new Set());
|
|
6165
|
-
}
|
|
6166
|
-
(_b = marketIdByVenue.get(venue)) == null ? void 0 : _b.add(canonicalMarketId);
|
|
6167
|
-
});
|
|
6168
|
-
return [...marketIdByVenue.entries()].map(([venue, marketIds]) => ({
|
|
6169
|
-
venue,
|
|
6170
|
-
venueMarketOutcomeIds: [...marketIds]
|
|
6171
|
-
})).filter((group) => group.venueMarketOutcomeIds.length > 0);
|
|
6172
|
-
};
|
|
6173
6190
|
var resolveSeriesColor = (venue, index) => {
|
|
6174
6191
|
var _a;
|
|
6175
6192
|
const colorFromVenue = lineColorByVenue[venue];
|
|
@@ -6177,6 +6194,98 @@ var resolveSeriesColor = (venue, index) => {
|
|
|
6177
6194
|
return colorFromVenue;
|
|
6178
6195
|
return (_a = fallbackLineColors[index % fallbackLineColors.length]) != null ? _a : "#2e5cff";
|
|
6179
6196
|
};
|
|
6197
|
+
var toNonEmptyString = (value) => {
|
|
6198
|
+
if (typeof value !== "string")
|
|
6199
|
+
return void 0;
|
|
6200
|
+
const trimmedValue = value.trim();
|
|
6201
|
+
return trimmedValue ? trimmedValue : void 0;
|
|
6202
|
+
};
|
|
6203
|
+
var resolveCanonicalMarketId = (venueMarkets, fallbackMarketId) => {
|
|
6204
|
+
var _a;
|
|
6205
|
+
const uniqueMarketIds = Array.from(
|
|
6206
|
+
new Set(venueMarkets.map((market) => toNonEmptyString(market.marketId)).filter(Boolean))
|
|
6207
|
+
);
|
|
6208
|
+
if (uniqueMarketIds.length === 1) {
|
|
6209
|
+
return uniqueMarketIds[0];
|
|
6210
|
+
}
|
|
6211
|
+
return (_a = toNonEmptyString(fallbackMarketId)) != null ? _a : uniqueMarketIds[0];
|
|
6212
|
+
};
|
|
6213
|
+
var toChartDisplayValue = (value, transformProbability) => {
|
|
6214
|
+
if (value == null || !Number.isFinite(value))
|
|
6215
|
+
return void 0;
|
|
6216
|
+
return transformProbability(value) * 100;
|
|
6217
|
+
};
|
|
6218
|
+
var marketChartCandleToLineChartPoint = (candle, transformProbability) => {
|
|
6219
|
+
var _a, _b, _c, _d;
|
|
6220
|
+
const open = (_a = toChartDisplayValue(candle.open, transformProbability)) != null ? _a : 0;
|
|
6221
|
+
const high = (_b = toChartDisplayValue(candle.high, transformProbability)) != null ? _b : open;
|
|
6222
|
+
const low = (_c = toChartDisplayValue(candle.low, transformProbability)) != null ? _c : open;
|
|
6223
|
+
const close = (_d = toChartDisplayValue(candle.close, transformProbability)) != null ? _d : open;
|
|
6224
|
+
return {
|
|
6225
|
+
time: candle.time,
|
|
6226
|
+
value: close,
|
|
6227
|
+
open,
|
|
6228
|
+
high,
|
|
6229
|
+
low,
|
|
6230
|
+
close
|
|
6231
|
+
};
|
|
6232
|
+
};
|
|
6233
|
+
var marketChartCandleToScaledCandlePoint = (candle, transformProbability) => {
|
|
6234
|
+
var _a, _b, _c, _d;
|
|
6235
|
+
const point = marketChartCandleToLineChartPoint(candle, transformProbability);
|
|
6236
|
+
return {
|
|
6237
|
+
time: point.time,
|
|
6238
|
+
open: (_a = point.open) != null ? _a : point.value,
|
|
6239
|
+
high: (_b = point.high) != null ? _b : point.value,
|
|
6240
|
+
low: (_c = point.low) != null ? _c : point.value,
|
|
6241
|
+
close: (_d = point.close) != null ? _d : point.value,
|
|
6242
|
+
v: candle.volume
|
|
6243
|
+
};
|
|
6244
|
+
};
|
|
6245
|
+
var resolveMarketChartVenueSeries = ({
|
|
6246
|
+
chartData,
|
|
6247
|
+
transformProbability
|
|
6248
|
+
}) => {
|
|
6249
|
+
if (!chartData)
|
|
6250
|
+
return [];
|
|
6251
|
+
return Object.entries(chartData.venues).map(([venue, venueData]) => ({
|
|
6252
|
+
venue,
|
|
6253
|
+
points: venueData.candles.map(
|
|
6254
|
+
(candle) => marketChartCandleToLineChartPoint(candle, transformProbability)
|
|
6255
|
+
)
|
|
6256
|
+
})).filter((item) => item.points.length > 0);
|
|
6257
|
+
};
|
|
6258
|
+
var resolveMarketChartLiveState = ({
|
|
6259
|
+
chartData,
|
|
6260
|
+
selectedVenue,
|
|
6261
|
+
transformProbability
|
|
6262
|
+
}) => {
|
|
6263
|
+
var _a, _b;
|
|
6264
|
+
if (!chartData) {
|
|
6265
|
+
return {
|
|
6266
|
+
liveCandle: null,
|
|
6267
|
+
lineValue: void 0,
|
|
6268
|
+
live: false
|
|
6269
|
+
};
|
|
6270
|
+
}
|
|
6271
|
+
const venueEntries = selectedVenue ? Object.entries(chartData.venues).filter(([venue]) => venue === selectedVenue) : Object.entries(chartData.venues);
|
|
6272
|
+
if (venueEntries.length === 0) {
|
|
6273
|
+
return {
|
|
6274
|
+
liveCandle: null,
|
|
6275
|
+
lineValue: void 0,
|
|
6276
|
+
live: false
|
|
6277
|
+
};
|
|
6278
|
+
}
|
|
6279
|
+
const singleVenueView = selectedVenue != null || venueEntries.length === 1;
|
|
6280
|
+
const liveCandleEntry = singleVenueView ? venueEntries.find(([, venueData]) => venueData.liveCandle != null) : null;
|
|
6281
|
+
const primaryLineValue = (_b = (_a = venueEntries[0]) == null ? void 0 : _a[1]) == null ? void 0 : _b.lineValue;
|
|
6282
|
+
const lineValue = primaryLineValue != null ? toChartDisplayValue(primaryLineValue, transformProbability) : void 0;
|
|
6283
|
+
return {
|
|
6284
|
+
liveCandle: (liveCandleEntry == null ? void 0 : liveCandleEntry[1].liveCandle) ? marketChartCandleToScaledCandlePoint(liveCandleEntry[1].liveCandle, transformProbability) : null,
|
|
6285
|
+
lineValue,
|
|
6286
|
+
live: liveCandleEntry != null
|
|
6287
|
+
};
|
|
6288
|
+
};
|
|
6180
6289
|
|
|
6181
6290
|
// src/events/item-details/index.tsx
|
|
6182
6291
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
@@ -6241,31 +6350,23 @@ var resolveAverageProbability = (values) => {
|
|
|
6241
6350
|
return void 0;
|
|
6242
6351
|
return validValues.reduce((sum, value) => sum + value, 0) / validValues.length;
|
|
6243
6352
|
};
|
|
6244
|
-
var resolveOutcomeCandidateIds = (market, outcome) => {
|
|
6245
|
-
var _a, _b;
|
|
6246
|
-
const marketWithCanonicalId = market;
|
|
6247
|
-
return [
|
|
6248
|
-
outcome.id,
|
|
6249
|
-
(_a = outcome.externalIdentifier) != null ? _a : void 0,
|
|
6250
|
-
market.externalIdentifier,
|
|
6251
|
-
(_b = marketWithCanonicalId.marketId) != null ? _b : void 0
|
|
6252
|
-
].filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
6253
|
-
};
|
|
6254
6353
|
var EventListItemDetailsGraphSection = ({
|
|
6255
6354
|
venueMarkets,
|
|
6256
|
-
canonicalMarketId,
|
|
6257
6355
|
selectedOutcomeLabel,
|
|
6258
6356
|
onSelectedOutcomeLabelChange,
|
|
6259
6357
|
switchLabels,
|
|
6260
6358
|
isDateOutcomeMarket,
|
|
6261
6359
|
classNames,
|
|
6262
|
-
showVenueLogo,
|
|
6263
6360
|
venueInfo,
|
|
6264
6361
|
formatPercent,
|
|
6265
6362
|
selectedTimeRange,
|
|
6266
|
-
selectedChartType
|
|
6363
|
+
selectedChartType,
|
|
6364
|
+
selectedOutcome: _selectedOutcome,
|
|
6365
|
+
selectedMarket
|
|
6267
6366
|
}) => {
|
|
6367
|
+
var _a, _b;
|
|
6268
6368
|
const labels = (0, import_hooks23.useLabels)();
|
|
6369
|
+
const { enableLiveUpdates } = (0, import_hooks23.useSdkUiConfig)();
|
|
6269
6370
|
const [selectedVenue, setSelectedVenue] = (0, import_react10.useState)(null);
|
|
6270
6371
|
const [activeProbabilityMode, setActiveProbabilityMode] = (0, import_react10.useState)("yes");
|
|
6271
6372
|
const probabilityModeConfigs = (0, import_react10.useMemo)(() => {
|
|
@@ -6334,105 +6435,71 @@ var EventListItemDetailsGraphSection = ({
|
|
|
6334
6435
|
no: buildModeData("no")
|
|
6335
6436
|
};
|
|
6336
6437
|
}, [labels, probabilityModeConfigs, selectedOutcomesByMode, venueInfo]);
|
|
6337
|
-
const allOutcomesForHistory = (0, import_react10.useMemo)(() => {
|
|
6338
|
-
const outcomeByModeAndId = /* @__PURE__ */ new Map();
|
|
6339
|
-
probabilityModeOrder.forEach((mode) => {
|
|
6340
|
-
selectedOutcomesByMode[mode].forEach((outcomeByVenue) => {
|
|
6341
|
-
outcomeByModeAndId.set(
|
|
6342
|
-
`${outcomeByVenue.venue}:${outcomeByVenue.outcome.id}`,
|
|
6343
|
-
outcomeByVenue
|
|
6344
|
-
);
|
|
6345
|
-
});
|
|
6346
|
-
});
|
|
6347
|
-
return [...outcomeByModeAndId.values()];
|
|
6348
|
-
}, [selectedOutcomesByMode]);
|
|
6349
|
-
const priceHistoryGroups = (0, import_react10.useMemo)(() => {
|
|
6350
|
-
return buildPriceHistoryGroups(allOutcomesForHistory, canonicalMarketId);
|
|
6351
|
-
}, [allOutcomesForHistory, canonicalMarketId]);
|
|
6352
6438
|
const timeWindow = (0, import_react10.useMemo)(() => {
|
|
6353
6439
|
return getTimeWindowByRange(selectedTimeRange);
|
|
6354
6440
|
}, [selectedTimeRange]);
|
|
6441
|
+
const activeOutcomes = selectedOutcomesByMode[activeProbabilityMode];
|
|
6442
|
+
const activeCanonicalMarketId = (0, import_react10.useMemo)(() => {
|
|
6443
|
+
return resolveCanonicalMarketId(activeOutcomes.map((item) => item.market));
|
|
6444
|
+
}, [activeOutcomes]);
|
|
6445
|
+
const venueMarketIds = (0, import_react10.useMemo)(() => {
|
|
6446
|
+
return activeOutcomes.map((item) => item.market.id);
|
|
6447
|
+
}, [activeOutcomes]);
|
|
6355
6448
|
const {
|
|
6356
|
-
data:
|
|
6357
|
-
isLoading:
|
|
6358
|
-
error:
|
|
6359
|
-
|
|
6360
|
-
} = (0, import_hooks23.
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
}
|
|
6370
|
-
priceHistoryData.forEach((historyItem) => {
|
|
6371
|
-
const venue = historyItem.venue;
|
|
6372
|
-
const venueHistory = historyByVenue.get(venue);
|
|
6373
|
-
if (venueHistory) {
|
|
6374
|
-
venueHistory.push(historyItem);
|
|
6375
|
-
return;
|
|
6376
|
-
}
|
|
6377
|
-
historyByVenue.set(venue, [historyItem]);
|
|
6378
|
-
});
|
|
6379
|
-
return historyByVenue;
|
|
6380
|
-
}, [priceHistoryData]);
|
|
6381
|
-
const chartSeriesByMode = (0, import_react10.useMemo)(() => {
|
|
6382
|
-
const buildSeries = (mode) => {
|
|
6383
|
-
const modeConfig = probabilityModeConfigs[mode];
|
|
6384
|
-
const chartSeries = [];
|
|
6385
|
-
normalizedVenueDataByMode[mode].forEach((venueData) => {
|
|
6386
|
-
var _a;
|
|
6387
|
-
const venueHistory = priceHistoryByVenue.get(venueData.venue);
|
|
6388
|
-
if (!(venueHistory == null ? void 0 : venueHistory.length))
|
|
6389
|
-
return;
|
|
6390
|
-
const candidateIds = resolveOutcomeCandidateIds(venueData.market, venueData.outcome);
|
|
6391
|
-
const matchingHistory = (_a = venueHistory.find((historyItem) => candidateIds.includes(historyItem.marketId))) != null ? _a : venueHistory.length === 1 ? venueHistory[0] : void 0;
|
|
6392
|
-
if (!matchingHistory)
|
|
6393
|
-
return;
|
|
6394
|
-
const points = matchingHistory.points.map((point) => {
|
|
6395
|
-
const probability = normalizeProbability(point.price);
|
|
6396
|
-
if (probability == null || !Number.isFinite(point.timestamp))
|
|
6397
|
-
return null;
|
|
6398
|
-
const open = normalizeProbability(point.open);
|
|
6399
|
-
const high = normalizeProbability(point.high);
|
|
6400
|
-
const low = normalizeProbability(point.low);
|
|
6401
|
-
const close = normalizeProbability(point.close);
|
|
6402
|
-
const transformedPoint = {
|
|
6403
|
-
time: point.timestamp,
|
|
6404
|
-
value: clampProbability(modeConfig.transformProbability(probability)) * 100,
|
|
6405
|
-
open: open == null ? void 0 : clampProbability(modeConfig.transformProbability(open)) * 100,
|
|
6406
|
-
high: high == null ? void 0 : clampProbability(modeConfig.transformProbability(high)) * 100,
|
|
6407
|
-
low: low == null ? void 0 : clampProbability(modeConfig.transformProbability(low)) * 100,
|
|
6408
|
-
close: close == null ? void 0 : clampProbability(modeConfig.transformProbability(close)) * 100
|
|
6409
|
-
};
|
|
6410
|
-
return transformedPoint;
|
|
6411
|
-
}).filter((point) => point != null);
|
|
6412
|
-
if (points.length === 0)
|
|
6413
|
-
return;
|
|
6414
|
-
chartSeries.push({
|
|
6415
|
-
id: `${mode}-${venueData.venue}-${matchingHistory.marketId}`,
|
|
6416
|
-
venue: venueData.venue,
|
|
6417
|
-
color: venueData.color,
|
|
6418
|
-
points,
|
|
6419
|
-
lineWidth: 2,
|
|
6420
|
-
lineStyle: "solid"
|
|
6421
|
-
});
|
|
6422
|
-
});
|
|
6423
|
-
return chartSeries;
|
|
6424
|
-
};
|
|
6425
|
-
return {
|
|
6426
|
-
yes: buildSeries("yes"),
|
|
6427
|
-
no: buildSeries("no")
|
|
6428
|
-
};
|
|
6429
|
-
}, [normalizedVenueDataByMode, priceHistoryByVenue, probabilityModeConfigs]);
|
|
6449
|
+
data: marketChartData,
|
|
6450
|
+
isLoading: isMarketChartLoading,
|
|
6451
|
+
error: marketChartError,
|
|
6452
|
+
refetch: refetchMarketChart
|
|
6453
|
+
} = (0, import_hooks23.useMarketChart)({
|
|
6454
|
+
marketId: (_a = selectedMarket == null ? void 0 : selectedMarket.id) != null ? _a : null,
|
|
6455
|
+
venueMarketIds,
|
|
6456
|
+
interval: (0, import_hooks23.timeRangeToInterval)(selectedTimeRange),
|
|
6457
|
+
startTs: timeWindow.startTs * 1e3,
|
|
6458
|
+
endTs: timeWindow.endTs * 1e3,
|
|
6459
|
+
enabled: !!(selectedMarket == null ? void 0 : selectedMarket.id),
|
|
6460
|
+
live: enableLiveUpdates
|
|
6461
|
+
});
|
|
6430
6462
|
const visibleChartSeries = (0, import_react10.useMemo)(() => {
|
|
6431
|
-
const
|
|
6463
|
+
const transformProbability = probabilityModeConfigs[activeProbabilityMode].transformProbability;
|
|
6464
|
+
const colorByVenue = new Map(
|
|
6465
|
+
normalizedVenueDataByMode[activeProbabilityMode].map((venueData) => [
|
|
6466
|
+
venueData.venue,
|
|
6467
|
+
venueData.color
|
|
6468
|
+
])
|
|
6469
|
+
);
|
|
6470
|
+
const series = resolveMarketChartVenueSeries({
|
|
6471
|
+
chartData: marketChartData,
|
|
6472
|
+
transformProbability
|
|
6473
|
+
}).map((seriesItem) => {
|
|
6474
|
+
var _a2;
|
|
6475
|
+
const resolvedVenue = seriesItem.venue;
|
|
6476
|
+
return {
|
|
6477
|
+
id: `${activeProbabilityMode}-${resolvedVenue}-${activeCanonicalMarketId != null ? activeCanonicalMarketId : "chart"}`,
|
|
6478
|
+
venue: resolvedVenue,
|
|
6479
|
+
color: (_a2 = colorByVenue.get(resolvedVenue)) != null ? _a2 : resolveSeriesColor(resolvedVenue, 0),
|
|
6480
|
+
points: seriesItem.points,
|
|
6481
|
+
lineWidth: 2,
|
|
6482
|
+
lineStyle: "solid"
|
|
6483
|
+
};
|
|
6484
|
+
});
|
|
6432
6485
|
if (!selectedVenue)
|
|
6433
|
-
return
|
|
6434
|
-
return
|
|
6435
|
-
}, [
|
|
6486
|
+
return series;
|
|
6487
|
+
return series.filter((seriesItem) => seriesItem.venue === selectedVenue);
|
|
6488
|
+
}, [
|
|
6489
|
+
activeCanonicalMarketId,
|
|
6490
|
+
activeProbabilityMode,
|
|
6491
|
+
marketChartData,
|
|
6492
|
+
normalizedVenueDataByMode,
|
|
6493
|
+
probabilityModeConfigs,
|
|
6494
|
+
selectedVenue
|
|
6495
|
+
]);
|
|
6496
|
+
const chartLiveState = (0, import_react10.useMemo)(() => {
|
|
6497
|
+
return resolveMarketChartLiveState({
|
|
6498
|
+
chartData: marketChartData,
|
|
6499
|
+
selectedVenue,
|
|
6500
|
+
transformProbability: probabilityModeConfigs[activeProbabilityMode].transformProbability
|
|
6501
|
+
});
|
|
6502
|
+
}, [activeProbabilityMode, marketChartData, probabilityModeConfigs, selectedVenue]);
|
|
6436
6503
|
const segmentedDisplayItems = (0, import_react10.useMemo)(() => {
|
|
6437
6504
|
return probabilityModeOrder.map((mode) => {
|
|
6438
6505
|
const averageProbability = resolveAverageProbability(
|
|
@@ -6470,31 +6537,22 @@ var EventListItemDetailsGraphSection = ({
|
|
|
6470
6537
|
return venue;
|
|
6471
6538
|
});
|
|
6472
6539
|
};
|
|
6473
|
-
const
|
|
6474
|
-
void
|
|
6540
|
+
const handleRetryMarketChart = () => {
|
|
6541
|
+
void refetchMarketChart();
|
|
6475
6542
|
};
|
|
6476
|
-
if (
|
|
6477
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6478
|
-
|
|
6543
|
+
if (marketChartError) {
|
|
6544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: cn("w-full", classNames == null ? void 0 : classNames.chart), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6545
|
+
StateMessage,
|
|
6479
6546
|
{
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
ariaLabel: labels.eventItemDetails.chartUnavailableAria,
|
|
6488
|
-
tone: "warning",
|
|
6489
|
-
title: labels.eventItemDetails.chartUnavailableTitle,
|
|
6490
|
-
description: labels.eventItemDetails.chartUnavailableDescription,
|
|
6491
|
-
actionLabel: labels.common.retry,
|
|
6492
|
-
onAction: handleRetryPriceHistory,
|
|
6493
|
-
className: "min-h-[300px] px-5 py-10 md:px-10"
|
|
6494
|
-
}
|
|
6495
|
-
)
|
|
6547
|
+
tone: "warning",
|
|
6548
|
+
ariaLabel: labels.eventItemDetails.chartUnavailableAria,
|
|
6549
|
+
title: labels.eventItemDetails.chartUnavailableTitle,
|
|
6550
|
+
description: labels.eventItemDetails.chartUnavailableDescription,
|
|
6551
|
+
actionLabel: labels.common.retry,
|
|
6552
|
+
onAction: handleRetryMarketChart,
|
|
6553
|
+
className: "min-h-[300px] px-5 py-10 md:px-10"
|
|
6496
6554
|
}
|
|
6497
|
-
);
|
|
6555
|
+
) });
|
|
6498
6556
|
}
|
|
6499
6557
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6500
6558
|
LineChart,
|
|
@@ -6502,8 +6560,10 @@ var EventListItemDetailsGraphSection = ({
|
|
|
6502
6560
|
classNames: { root: classNames == null ? void 0 : classNames.chart },
|
|
6503
6561
|
series: visibleChartSeries,
|
|
6504
6562
|
height: 300,
|
|
6505
|
-
isLoading:
|
|
6563
|
+
isLoading: isMarketChartLoading,
|
|
6506
6564
|
chartType: selectedChartType,
|
|
6565
|
+
liveCandle: selectedChartType === "candlestick" ? (_b = chartLiveState.liveCandle) != null ? _b : void 0 : void 0,
|
|
6566
|
+
lineValue: chartLiveState.lineValue,
|
|
6507
6567
|
showSeriesControls: activeModeVenueData.length > 0 || segmentedDisplayItems.length > 0,
|
|
6508
6568
|
renderSeriesControls: () => {
|
|
6509
6569
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
@@ -6519,7 +6579,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
6519
6579
|
classNames == null ? void 0 : classNames.outcomeBadges
|
|
6520
6580
|
),
|
|
6521
6581
|
children: activeModeVenueData.map((venueData) => {
|
|
6522
|
-
var
|
|
6582
|
+
var _a2;
|
|
6523
6583
|
const text = venueData.probability == null ? "-" : formatPercent(venueData.probability);
|
|
6524
6584
|
const isActiveVenue = selectedVenue === venueData.venue;
|
|
6525
6585
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
@@ -6536,14 +6596,14 @@ var EventListItemDetailsGraphSection = ({
|
|
|
6536
6596
|
{
|
|
6537
6597
|
text,
|
|
6538
6598
|
size: "large",
|
|
6539
|
-
prefix:
|
|
6599
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6540
6600
|
VenueLogo,
|
|
6541
6601
|
{
|
|
6542
6602
|
venue: venueData.venue,
|
|
6543
6603
|
size: "small",
|
|
6544
|
-
title: (
|
|
6604
|
+
title: (_a2 = venueInfo == null ? void 0 : venueInfo[venueData.venue]) == null ? void 0 : _a2.label
|
|
6545
6605
|
}
|
|
6546
|
-
)
|
|
6606
|
+
),
|
|
6547
6607
|
classNames: {
|
|
6548
6608
|
root: cn("h-9 shrink-0 border-2 px-4 text-agg-base leading-agg-6")
|
|
6549
6609
|
},
|
|
@@ -6584,46 +6644,55 @@ var EventListItemDetailsGraphSection = ({
|
|
|
6584
6644
|
};
|
|
6585
6645
|
var EventListItemDetailsContent = ({
|
|
6586
6646
|
event,
|
|
6587
|
-
title,
|
|
6588
|
-
image,
|
|
6589
|
-
showVenueLogo = true,
|
|
6590
6647
|
classNames,
|
|
6591
6648
|
venueInfo,
|
|
6592
6649
|
detailsStats,
|
|
6593
6650
|
ariaLabel,
|
|
6594
|
-
defaultTimeRange
|
|
6651
|
+
defaultTimeRange,
|
|
6652
|
+
onClick
|
|
6595
6653
|
}) => {
|
|
6596
|
-
var _a
|
|
6654
|
+
var _a;
|
|
6597
6655
|
const config = (0, import_hooks23.useSdkUiConfig)();
|
|
6598
6656
|
const labels = (0, import_hooks23.useLabels)();
|
|
6599
6657
|
const venueMarkets = (0, import_react10.useMemo)(() => {
|
|
6600
|
-
var _a2
|
|
6601
|
-
return (
|
|
6602
|
-
}, [event.
|
|
6658
|
+
var _a2;
|
|
6659
|
+
return (_a2 = event.venueMarkets) != null ? _a2 : [];
|
|
6660
|
+
}, [event.venueMarkets]);
|
|
6661
|
+
const [selectedMarket, setSelectedMarket] = (0, import_react10.useState)(venueMarkets[0]);
|
|
6662
|
+
const [selectedOutcome] = (0, import_react10.useState)(
|
|
6663
|
+
(_a = selectedMarket == null ? void 0 : selectedMarket.venueMarketOutcomes.find(
|
|
6664
|
+
(outcome) => outcome.winner
|
|
6665
|
+
)) != null ? _a : selectedMarket == null ? void 0 : selectedMarket.venueMarketOutcomes[0]
|
|
6666
|
+
);
|
|
6603
6667
|
const primaryVenueMarket = (0, import_react10.useMemo)(() => {
|
|
6604
6668
|
return selectPrimaryVenueMarket(venueMarkets);
|
|
6605
6669
|
}, [venueMarkets]);
|
|
6670
|
+
const filteredVenueMarkets = (0, import_react10.useMemo)(() => {
|
|
6671
|
+
if (!selectedMarket)
|
|
6672
|
+
return venueMarkets;
|
|
6673
|
+
return venueMarkets.filter(
|
|
6674
|
+
(vm) => vm.question === (selectedMarket == null ? void 0 : selectedMarket.question)
|
|
6675
|
+
);
|
|
6676
|
+
}, [venueMarkets, selectedMarket]);
|
|
6606
6677
|
const outcomeLabels = (0, import_react10.useMemo)(() => {
|
|
6607
|
-
return resolveOutcomeLabels(
|
|
6608
|
-
}, [
|
|
6678
|
+
return resolveOutcomeLabels(filteredVenueMarkets);
|
|
6679
|
+
}, [filteredVenueMarkets]);
|
|
6609
6680
|
const [selectedOutcomeLabel, setSelectedOutcomeLabel] = (0, import_react10.useState)(() => {
|
|
6610
6681
|
return resolveDefaultOutcomeLabel(outcomeLabels);
|
|
6611
6682
|
});
|
|
6683
|
+
const configTimeRange = config.defaultChartTimeRange;
|
|
6612
6684
|
const [selectedTimeRange, setSelectedTimeRange] = (0, import_react10.useState)(() => {
|
|
6613
|
-
return getDefaultSelectedTimeRange(defaultTimeRange);
|
|
6685
|
+
return getDefaultSelectedTimeRange(defaultTimeRange, configTimeRange);
|
|
6614
6686
|
});
|
|
6615
6687
|
const [selectedChartType, setSelectedChartType] = (0, import_react10.useState)("line");
|
|
6616
6688
|
(0, import_react10.useEffect)(() => {
|
|
6617
|
-
setSelectedTimeRange(getDefaultSelectedTimeRange(defaultTimeRange));
|
|
6618
|
-
}, [defaultTimeRange]);
|
|
6619
|
-
const resolvedTitle = resolveTileTitle(event, primaryVenueMarket, title);
|
|
6620
|
-
const resolvedImage = resolveTileImage(event, primaryVenueMarket, image);
|
|
6689
|
+
setSelectedTimeRange(getDefaultSelectedTimeRange(defaultTimeRange, configTimeRange));
|
|
6690
|
+
}, [defaultTimeRange, configTimeRange]);
|
|
6621
6691
|
const isDateOutcomeMarket = outcomeLabels.length > 2 && outcomeLabels.every(isDateLikeLabel);
|
|
6622
|
-
const outcomeSelectorLabels = outcomeLabels;
|
|
6623
6692
|
const probabilityByLabel = (0, import_react10.useMemo)(() => {
|
|
6624
6693
|
return new Map(
|
|
6625
6694
|
outcomeLabels.map((label) => {
|
|
6626
|
-
const outcomesByVenue = resolveOutcomesByVenue(
|
|
6695
|
+
const outcomesByVenue = resolveOutcomesByVenue(filteredVenueMarkets, label);
|
|
6627
6696
|
const probabilities = outcomesByVenue.map((item) => normalizeProbability(item.outcome.price)).filter((value) => value != null);
|
|
6628
6697
|
if (probabilities.length === 0) {
|
|
6629
6698
|
return [label, void 0];
|
|
@@ -6632,14 +6701,14 @@ var EventListItemDetailsContent = ({
|
|
|
6632
6701
|
return [label, averageProbability];
|
|
6633
6702
|
})
|
|
6634
6703
|
);
|
|
6635
|
-
}, [outcomeLabels,
|
|
6704
|
+
}, [outcomeLabels, filteredVenueMarkets]);
|
|
6636
6705
|
const mainOutcomeLabel = (0, import_react10.useMemo)(() => {
|
|
6637
6706
|
if (outcomeLabels.length === 0)
|
|
6638
6707
|
return void 0;
|
|
6639
6708
|
return [...outcomeLabels].sort((left, right) => {
|
|
6640
|
-
var _a2,
|
|
6709
|
+
var _a2, _b;
|
|
6641
6710
|
const leftProbability = (_a2 = probabilityByLabel.get(left)) != null ? _a2 : -1;
|
|
6642
|
-
const rightProbability = (
|
|
6711
|
+
const rightProbability = (_b = probabilityByLabel.get(right)) != null ? _b : -1;
|
|
6643
6712
|
return rightProbability - leftProbability;
|
|
6644
6713
|
})[0];
|
|
6645
6714
|
}, [outcomeLabels, probabilityByLabel]);
|
|
@@ -6655,18 +6724,18 @@ var EventListItemDetailsContent = ({
|
|
|
6655
6724
|
setSelectedOutcomeLabel(fallbackOutcomeLabel);
|
|
6656
6725
|
}, [isDateOutcomeMarket, mainOutcomeLabel, outcomeLabels, selectedOutcomeLabel]);
|
|
6657
6726
|
const switchLabels = (0, import_react10.useMemo)(() => {
|
|
6658
|
-
var _a2,
|
|
6727
|
+
var _a2, _b;
|
|
6659
6728
|
if (isDateOutcomeMarket) {
|
|
6660
6729
|
return [labels.eventItemDetails.yes, labels.eventItemDetails.no];
|
|
6661
6730
|
}
|
|
6662
6731
|
const sortedOutcomeLabels = [...outcomeLabels].sort((left, right) => {
|
|
6663
|
-
var _a3,
|
|
6732
|
+
var _a3, _b2;
|
|
6664
6733
|
const leftProbability = (_a3 = probabilityByLabel.get(left)) != null ? _a3 : -1;
|
|
6665
|
-
const rightProbability = (
|
|
6734
|
+
const rightProbability = (_b2 = probabilityByLabel.get(right)) != null ? _b2 : -1;
|
|
6666
6735
|
return rightProbability - leftProbability;
|
|
6667
6736
|
});
|
|
6668
6737
|
const firstLabel = (_a2 = sortedOutcomeLabels[0]) != null ? _a2 : labels.eventItemDetails.yes;
|
|
6669
|
-
const secondLabel = (
|
|
6738
|
+
const secondLabel = (_b = sortedOutcomeLabels.find((label) => label !== firstLabel)) != null ? _b : firstLabel;
|
|
6670
6739
|
return [firstLabel, secondLabel];
|
|
6671
6740
|
}, [
|
|
6672
6741
|
isDateOutcomeMarket,
|
|
@@ -6683,27 +6752,37 @@ var EventListItemDetailsContent = ({
|
|
|
6683
6752
|
return `${config.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
|
|
6684
6753
|
}, [config, event.volume, labels.eventItemDetails.volumeSuffix, primaryVenueMarket == null ? void 0 : primaryVenueMarket.volume]);
|
|
6685
6754
|
if (!primaryVenueMarket || !selectedOutcomeLabel) {
|
|
6686
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6756
|
+
EventListItemDetailsUnavailableState,
|
|
6757
|
+
{
|
|
6758
|
+
classNames,
|
|
6759
|
+
ariaLabel: ariaLabel != null ? ariaLabel : event.title
|
|
6760
|
+
}
|
|
6761
|
+
);
|
|
6687
6762
|
}
|
|
6688
6763
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
6689
6764
|
Card,
|
|
6690
6765
|
{
|
|
6691
6766
|
className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
6692
|
-
"aria-label": ariaLabel != null ? ariaLabel :
|
|
6767
|
+
"aria-label": ariaLabel != null ? ariaLabel : event.title,
|
|
6768
|
+
onClick: () => {
|
|
6769
|
+
onClick == null ? void 0 : onClick(event);
|
|
6770
|
+
},
|
|
6693
6771
|
children: [
|
|
6694
6772
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
6695
6773
|
"div",
|
|
6696
6774
|
{
|
|
6697
6775
|
className: cn(
|
|
6698
6776
|
"flex flex-row gap-3 md:gap-4",
|
|
6699
|
-
"items-
|
|
6777
|
+
venueMarkets.length > 1 ? "items-start" : "items-center",
|
|
6778
|
+
"justify-start",
|
|
6700
6779
|
classNames == null ? void 0 : classNames.header
|
|
6701
6780
|
),
|
|
6702
6781
|
children: [
|
|
6703
|
-
|
|
6782
|
+
event.image ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6704
6783
|
RemoteImage,
|
|
6705
6784
|
{
|
|
6706
|
-
src:
|
|
6785
|
+
src: event.image,
|
|
6707
6786
|
alt: "",
|
|
6708
6787
|
className: "size-10 rounded-agg-lg object-cover md:size-[60px]"
|
|
6709
6788
|
}
|
|
@@ -6718,19 +6797,18 @@ var EventListItemDetailsContent = ({
|
|
|
6718
6797
|
"truncate text-wrap wrap-break-word line-clamp-2",
|
|
6719
6798
|
classNames == null ? void 0 : classNames.title
|
|
6720
6799
|
),
|
|
6721
|
-
children:
|
|
6800
|
+
children: event.title
|
|
6722
6801
|
}
|
|
6723
6802
|
),
|
|
6724
|
-
|
|
6803
|
+
venueMarkets.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6725
6804
|
"div",
|
|
6726
6805
|
{
|
|
6727
6806
|
className: cn(
|
|
6728
|
-
"flex items-center gap-2 overflow-x-auto pb-1 md:
|
|
6807
|
+
"flex flex-row flex-nowrap items-center gap-2 overflow-x-auto pb-1 md:pb-0",
|
|
6729
6808
|
classNames == null ? void 0 : classNames.headerPills
|
|
6730
6809
|
),
|
|
6731
|
-
children:
|
|
6732
|
-
const isActive =
|
|
6733
|
-
const displayLabel = isDateLikeLabel(outcomeSelectorLabel) ? formatDateLabel(outcomeSelectorLabel) : outcomeSelectorLabel;
|
|
6810
|
+
children: venueMarkets.map((venueMarket) => {
|
|
6811
|
+
const isActive = (selectedMarket == null ? void 0 : selectedMarket.id) === venueMarket.id;
|
|
6734
6812
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6735
6813
|
Button,
|
|
6736
6814
|
{
|
|
@@ -6742,10 +6820,14 @@ var EventListItemDetailsContent = ({
|
|
|
6742
6820
|
"border-2",
|
|
6743
6821
|
isActive ? "border-agg-primary bg-agg-secondary text-agg-foreground font-agg-bold" : "border-transparent bg-agg-secondary-hover text-agg-foreground font-agg-normal"
|
|
6744
6822
|
),
|
|
6745
|
-
onClick: () =>
|
|
6746
|
-
|
|
6823
|
+
onClick: (e) => {
|
|
6824
|
+
e.stopPropagation();
|
|
6825
|
+
e.preventDefault();
|
|
6826
|
+
setSelectedMarket(venueMarket);
|
|
6827
|
+
},
|
|
6828
|
+
children: venueMarket.question
|
|
6747
6829
|
},
|
|
6748
|
-
|
|
6830
|
+
venueMarket.id
|
|
6749
6831
|
);
|
|
6750
6832
|
})
|
|
6751
6833
|
}
|
|
@@ -6774,14 +6856,14 @@ var EventListItemDetailsContent = ({
|
|
|
6774
6856
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6775
6857
|
EventListItemDetailsGraphSection,
|
|
6776
6858
|
{
|
|
6777
|
-
|
|
6778
|
-
|
|
6859
|
+
selectedOutcome,
|
|
6860
|
+
selectedMarket,
|
|
6861
|
+
venueMarkets: filteredVenueMarkets,
|
|
6779
6862
|
selectedOutcomeLabel,
|
|
6780
6863
|
onSelectedOutcomeLabelChange: setSelectedOutcomeLabel,
|
|
6781
6864
|
switchLabels,
|
|
6782
6865
|
isDateOutcomeMarket,
|
|
6783
6866
|
classNames,
|
|
6784
|
-
showVenueLogo,
|
|
6785
6867
|
venueInfo,
|
|
6786
6868
|
formatPercent: config.formatPercent,
|
|
6787
6869
|
selectedTimeRange,
|
|
@@ -6807,7 +6889,11 @@ var EventListItemDetailsContent = ({
|
|
|
6807
6889
|
isActive ? "font-agg-bold! text-agg-foreground!" : "font-agg-normal! text-agg-muted-foreground!"
|
|
6808
6890
|
),
|
|
6809
6891
|
"aria-pressed": isActive,
|
|
6810
|
-
onClick: () =>
|
|
6892
|
+
onClick: (e) => {
|
|
6893
|
+
e.stopPropagation();
|
|
6894
|
+
e.preventDefault();
|
|
6895
|
+
setSelectedTimeRange(timeRange);
|
|
6896
|
+
},
|
|
6811
6897
|
children: timeRange === "ALL" ? labels.eventItemDetails.allTimeRange : timeRange
|
|
6812
6898
|
},
|
|
6813
6899
|
timeRange
|
|
@@ -6825,18 +6911,20 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
6825
6911
|
} = _b, rest = __objRest(_b, [
|
|
6826
6912
|
"eventId"
|
|
6827
6913
|
]);
|
|
6914
|
+
const resolvedEventId = eventId != null ? eventId : "";
|
|
6828
6915
|
const {
|
|
6829
6916
|
event: fetchedEvent,
|
|
6830
6917
|
error,
|
|
6831
6918
|
isError,
|
|
6832
6919
|
isLoading
|
|
6833
|
-
} = (0, import_hooks23.
|
|
6834
|
-
|
|
6920
|
+
} = (0, import_hooks23.useVenueEvent)({
|
|
6921
|
+
eventId: resolvedEventId,
|
|
6922
|
+
enabled: !!resolvedEventId
|
|
6835
6923
|
});
|
|
6836
6924
|
const resolvedEvent = (0, import_react10.useMemo)(() => {
|
|
6837
6925
|
return resolveEventListItemEvent(fetchedEvent);
|
|
6838
6926
|
}, [fetchedEvent]);
|
|
6839
|
-
if (!
|
|
6927
|
+
if (!resolvedEventId) {
|
|
6840
6928
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6841
6929
|
EventListItemDetailsUnavailableState,
|
|
6842
6930
|
{
|
|
@@ -6875,26 +6963,22 @@ var EventListItemDetails = (props) => {
|
|
|
6875
6963
|
}
|
|
6876
6964
|
if ("eventId" in props && typeof props.eventId === "string") {
|
|
6877
6965
|
const {
|
|
6878
|
-
title: titleOverride,
|
|
6879
|
-
image: imageOverride,
|
|
6880
|
-
showVenueLogo: showVenueLogoOverride,
|
|
6881
6966
|
classNames,
|
|
6882
6967
|
venueInfo,
|
|
6883
6968
|
detailsStats,
|
|
6884
6969
|
ariaLabel: ariaLabelOverride,
|
|
6885
|
-
defaultTimeRange: defaultTimeRangeOverride
|
|
6970
|
+
defaultTimeRange: defaultTimeRangeOverride,
|
|
6971
|
+
onClick
|
|
6886
6972
|
} = props;
|
|
6887
6973
|
const byEventIdProps = {
|
|
6888
6974
|
eventId: props.eventId,
|
|
6889
6975
|
isLoading: false,
|
|
6890
|
-
title: titleOverride,
|
|
6891
|
-
image: imageOverride,
|
|
6892
|
-
showVenueLogo: showVenueLogoOverride,
|
|
6893
6976
|
classNames,
|
|
6894
6977
|
venueInfo,
|
|
6895
6978
|
detailsStats,
|
|
6896
6979
|
ariaLabel: ariaLabelOverride,
|
|
6897
|
-
defaultTimeRange: defaultTimeRangeOverride
|
|
6980
|
+
defaultTimeRange: defaultTimeRangeOverride,
|
|
6981
|
+
onClick
|
|
6898
6982
|
};
|
|
6899
6983
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(EventListItemDetailsByEventId, __spreadValues({}, byEventIdProps));
|
|
6900
6984
|
}
|
|
@@ -6941,12 +7025,47 @@ var resolveInitialTab = (defaultTab) => {
|
|
|
6941
7025
|
return parsedTab.data;
|
|
6942
7026
|
return "order-book";
|
|
6943
7027
|
};
|
|
6944
|
-
var
|
|
6945
|
-
|
|
7028
|
+
var resolveMarketFromVenueMarkets = (venueMarkets, marketId) => {
|
|
7029
|
+
var _a, _b;
|
|
7030
|
+
if (!venueMarkets || venueMarkets.length === 0)
|
|
7031
|
+
return void 0;
|
|
7032
|
+
if (!marketId) {
|
|
7033
|
+
const primary = selectPrimaryVenueMarket(venueMarkets);
|
|
7034
|
+
const totalVolume2 = venueMarkets.reduce((sum, vm) => {
|
|
7035
|
+
return sum + (typeof vm.volume === "number" ? vm.volume : 0);
|
|
7036
|
+
}, 0);
|
|
7037
|
+
return {
|
|
7038
|
+
id: (_a = primary == null ? void 0 : primary.id) != null ? _a : venueMarkets[0].id,
|
|
7039
|
+
venueMarkets,
|
|
7040
|
+
volume: totalVolume2 || (primary == null ? void 0 : primary.volume),
|
|
7041
|
+
status: primary == null ? void 0 : primary.status,
|
|
7042
|
+
startDate: primary == null ? void 0 : primary.startDate,
|
|
7043
|
+
endDate: primary == null ? void 0 : primary.endDate,
|
|
7044
|
+
creationDate: primary == null ? void 0 : primary.creationDate,
|
|
7045
|
+
question: (_b = primary == null ? void 0 : primary.question) != null ? _b : venueMarkets[0].question
|
|
7046
|
+
};
|
|
7047
|
+
}
|
|
7048
|
+
const matchedVenueMarket = venueMarkets.find(
|
|
7049
|
+
(vm) => vm.id === marketId || vm.externalIdentifier === marketId
|
|
7050
|
+
);
|
|
7051
|
+
if (!matchedVenueMarket)
|
|
6946
7052
|
return void 0;
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
7053
|
+
const siblingVenueMarkets = venueMarkets.filter(
|
|
7054
|
+
(vm) => vm.question === matchedVenueMarket.question
|
|
7055
|
+
);
|
|
7056
|
+
const totalVolume = siblingVenueMarkets.reduce((sum, vm) => {
|
|
7057
|
+
return sum + (typeof vm.volume === "number" ? vm.volume : 0);
|
|
7058
|
+
}, 0);
|
|
7059
|
+
return {
|
|
7060
|
+
id: matchedVenueMarket.id,
|
|
7061
|
+
venueMarkets: siblingVenueMarkets,
|
|
7062
|
+
volume: totalVolume || matchedVenueMarket.volume,
|
|
7063
|
+
status: matchedVenueMarket.status,
|
|
7064
|
+
startDate: matchedVenueMarket.startDate,
|
|
7065
|
+
endDate: matchedVenueMarket.endDate,
|
|
7066
|
+
creationDate: matchedVenueMarket.creationDate,
|
|
7067
|
+
question: matchedVenueMarket.question
|
|
7068
|
+
};
|
|
6950
7069
|
};
|
|
6951
7070
|
var resolveDisplayOutcomeLabels = (labels) => {
|
|
6952
7071
|
if (!hasBinaryLabels(labels))
|
|
@@ -7014,7 +7133,8 @@ var resolveHeaderOutcomeItems = (venueMarkets, defaultOutcomeLabel) => {
|
|
|
7014
7133
|
label,
|
|
7015
7134
|
probability: probabilityByLabel.get(label),
|
|
7016
7135
|
tone: resolveOutcomeTone(label, index),
|
|
7017
|
-
isDefault: normalizeLabel2(label) === normalizeLabel2((_a = defaultOutcomeLabel != null ? defaultOutcomeLabel : labels[0]) != null ? _a : "")
|
|
7136
|
+
isDefault: normalizeLabel2(label) === normalizeLabel2((_a = defaultOutcomeLabel != null ? defaultOutcomeLabel : labels[0]) != null ? _a : ""),
|
|
7137
|
+
venue: venueMarkets[0].venue
|
|
7018
7138
|
};
|
|
7019
7139
|
});
|
|
7020
7140
|
};
|
|
@@ -7105,23 +7225,23 @@ var resolveOtherTabRows = (market, labels) => {
|
|
|
7105
7225
|
return rows;
|
|
7106
7226
|
};
|
|
7107
7227
|
var buildMarketDetailsModel = ({
|
|
7108
|
-
|
|
7228
|
+
venueMarkets,
|
|
7109
7229
|
marketId,
|
|
7110
7230
|
title,
|
|
7111
7231
|
image,
|
|
7112
7232
|
formatCompactCurrency,
|
|
7113
7233
|
labels
|
|
7114
7234
|
}) => {
|
|
7115
|
-
var _a;
|
|
7116
|
-
const market =
|
|
7235
|
+
var _a, _b;
|
|
7236
|
+
const market = resolveMarketFromVenueMarkets(venueMarkets, marketId);
|
|
7117
7237
|
if (!market)
|
|
7118
7238
|
return void 0;
|
|
7119
7239
|
const primaryVenueMarket = selectPrimaryVenueMarket(market.venueMarkets);
|
|
7120
7240
|
if (!primaryVenueMarket)
|
|
7121
7241
|
return void 0;
|
|
7122
|
-
const resolvedTitle =
|
|
7123
|
-
const resolvedImage =
|
|
7124
|
-
const resolvedVolume = typeof market.volume === "number" ? market.volume : (
|
|
7242
|
+
const resolvedTitle = (title == null ? void 0 : title.trim()) || primaryVenueMarket.question || market.question;
|
|
7243
|
+
const resolvedImage = (_a = typeof image === "string" && image.trim() ? image : void 0) != null ? _a : typeof primaryVenueMarket.image === "string" && primaryVenueMarket.image.trim() ? primaryVenueMarket.image : void 0;
|
|
7244
|
+
const resolvedVolume = typeof market.volume === "number" ? market.volume : (_b = primaryVenueMarket.volume) != null ? _b : void 0;
|
|
7125
7245
|
const subtitle = resolveSubtitle({
|
|
7126
7246
|
venueMarkets: market.venueMarkets,
|
|
7127
7247
|
volume: resolvedVolume,
|
|
@@ -7267,7 +7387,7 @@ var getOutcomeButtonClassName = ({
|
|
|
7267
7387
|
);
|
|
7268
7388
|
};
|
|
7269
7389
|
var MarketDetailsContent = ({
|
|
7270
|
-
|
|
7390
|
+
venueMarkets,
|
|
7271
7391
|
marketId,
|
|
7272
7392
|
title,
|
|
7273
7393
|
image,
|
|
@@ -7275,28 +7395,29 @@ var MarketDetailsContent = ({
|
|
|
7275
7395
|
onOpenChange,
|
|
7276
7396
|
defaultTab,
|
|
7277
7397
|
defaultOutcomeLabel,
|
|
7278
|
-
defaultTimeRange
|
|
7398
|
+
defaultTimeRange,
|
|
7279
7399
|
orderBookDepth = orderBookRowLimitDefault,
|
|
7280
7400
|
ariaLabel,
|
|
7281
7401
|
classNames,
|
|
7282
7402
|
otherContent
|
|
7283
7403
|
}) => {
|
|
7404
|
+
var _a, _b, _c, _d;
|
|
7284
7405
|
const config = (0, import_hooks24.useSdkUiConfig)();
|
|
7285
7406
|
const labels = (0, import_hooks24.useLabels)();
|
|
7286
7407
|
const detailsContentId = (0, import_react11.useId)();
|
|
7287
7408
|
const model = (0, import_react11.useMemo)(() => {
|
|
7288
7409
|
return buildMarketDetailsModel({
|
|
7289
|
-
|
|
7410
|
+
venueMarkets,
|
|
7290
7411
|
marketId,
|
|
7291
7412
|
title,
|
|
7292
7413
|
image,
|
|
7293
7414
|
formatCompactCurrency: config.formatCompactCurrency,
|
|
7294
7415
|
labels
|
|
7295
7416
|
});
|
|
7296
|
-
}, [config.formatCompactCurrency,
|
|
7417
|
+
}, [config.formatCompactCurrency, venueMarkets, image, labels, marketId, title]);
|
|
7297
7418
|
const resolvedMarket = (0, import_react11.useMemo)(() => {
|
|
7298
|
-
return
|
|
7299
|
-
}, [
|
|
7419
|
+
return resolveMarketFromVenueMarkets(venueMarkets, marketId);
|
|
7420
|
+
}, [venueMarkets, marketId]);
|
|
7300
7421
|
const marketDetailsTabs = (0, import_react11.useMemo)(() => {
|
|
7301
7422
|
return getMarketDetailsTabs(labels);
|
|
7302
7423
|
}, [labels]);
|
|
@@ -7307,22 +7428,23 @@ var MarketDetailsContent = ({
|
|
|
7307
7428
|
(0, import_react11.useEffect)(() => {
|
|
7308
7429
|
setSelectedTab(resolveInitialTab(defaultTab));
|
|
7309
7430
|
}, [defaultTab]);
|
|
7310
|
-
const
|
|
7431
|
+
const resolvedDefaultTimeRange = (_a = defaultTimeRange != null ? defaultTimeRange : config.defaultChartTimeRange) != null ? _a : "1D";
|
|
7432
|
+
const [selectedTimeRange, setSelectedTimeRange] = (0, import_react11.useState)(resolvedDefaultTimeRange);
|
|
7311
7433
|
const [selectedChartType, setSelectedChartType] = (0, import_react11.useState)("line");
|
|
7312
7434
|
(0, import_react11.useEffect)(() => {
|
|
7313
|
-
setSelectedTimeRange(
|
|
7314
|
-
}, [
|
|
7435
|
+
setSelectedTimeRange(resolvedDefaultTimeRange);
|
|
7436
|
+
}, [resolvedDefaultTimeRange]);
|
|
7315
7437
|
const [selectedOutcomeLabel, setSelectedOutcomeLabel] = (0, import_react11.useState)(
|
|
7316
7438
|
() => {
|
|
7317
|
-
var
|
|
7318
|
-
return resolveInitialOutcomeLabel((
|
|
7439
|
+
var _a2;
|
|
7440
|
+
return resolveInitialOutcomeLabel((_a2 = model == null ? void 0 : model.outcomeLabels) != null ? _a2 : [], defaultOutcomeLabel);
|
|
7319
7441
|
}
|
|
7320
7442
|
);
|
|
7321
7443
|
const [selectedGraphVenue, setSelectedGraphVenue] = (0, import_react11.useState)(null);
|
|
7322
7444
|
(0, import_react11.useEffect)(() => {
|
|
7323
|
-
var
|
|
7445
|
+
var _a2;
|
|
7324
7446
|
setSelectedOutcomeLabel(
|
|
7325
|
-
resolveInitialOutcomeLabel((
|
|
7447
|
+
resolveInitialOutcomeLabel((_a2 = model == null ? void 0 : model.outcomeLabels) != null ? _a2 : [], defaultOutcomeLabel)
|
|
7326
7448
|
);
|
|
7327
7449
|
}, [defaultOutcomeLabel, model == null ? void 0 : model.outcomeLabels]);
|
|
7328
7450
|
const headerOutcomeItems = (0, import_react11.useMemo)(() => {
|
|
@@ -7349,51 +7471,66 @@ var MarketDetailsContent = ({
|
|
|
7349
7471
|
return outcomesByLabelMap;
|
|
7350
7472
|
}, [headerOutcomeItems, model]);
|
|
7351
7473
|
const selectedOutcomesByVenue = (0, import_react11.useMemo)(() => {
|
|
7352
|
-
var
|
|
7474
|
+
var _a2;
|
|
7353
7475
|
if (!selectedOutcomeLabel)
|
|
7354
7476
|
return [];
|
|
7355
|
-
return (
|
|
7477
|
+
return (_a2 = outcomesByLabel.get(selectedOutcomeLabel)) != null ? _a2 : [];
|
|
7356
7478
|
}, [outcomesByLabel, selectedOutcomeLabel]);
|
|
7479
|
+
const chartEnabled = isOpened && selectedTab === "graph";
|
|
7480
|
+
const orderBookEnabled = isOpened && selectedTab === "order-book";
|
|
7357
7481
|
const timeWindow = (0, import_react11.useMemo)(() => {
|
|
7358
7482
|
return getTimeWindowByRange(selectedTimeRange);
|
|
7359
7483
|
}, [selectedTimeRange]);
|
|
7360
|
-
const
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
outcomes.forEach((outcomeByVenue) => {
|
|
7364
|
-
uniqueOutcomesByVenueAndId.set(
|
|
7365
|
-
`${outcomeByVenue.venue}:${outcomeByVenue.outcome.id}`,
|
|
7366
|
-
outcomeByVenue
|
|
7367
|
-
);
|
|
7368
|
-
});
|
|
7369
|
-
});
|
|
7370
|
-
return [...uniqueOutcomesByVenueAndId.values()];
|
|
7371
|
-
}, [outcomesByLabel]);
|
|
7372
|
-
const canonicalMarketIdForHistory = model == null ? void 0 : model.market.id;
|
|
7373
|
-
const priceHistoryGroups = (0, import_react11.useMemo)(() => {
|
|
7374
|
-
return buildPriceHistoryGroups(graphOutcomes, canonicalMarketIdForHistory);
|
|
7375
|
-
}, [canonicalMarketIdForHistory, graphOutcomes]);
|
|
7376
|
-
const { data: priceHistoryData, isLoading: isPriceHistoryLoading } = (0, import_hooks24.usePriceHistory)(__spreadProps(__spreadValues({
|
|
7377
|
-
groups: priceHistoryGroups
|
|
7378
|
-
}, timeWindow), {
|
|
7379
|
-
enabled: isOpened && selectedTab === "graph" && priceHistoryGroups.length > 0
|
|
7380
|
-
}));
|
|
7381
|
-
const orderBookInputs = (0, import_react11.useMemo)(() => {
|
|
7382
|
-
return selectedOutcomesByVenue.map(({ market, outcome }) => ({
|
|
7383
|
-
market,
|
|
7384
|
-
outcome,
|
|
7385
|
-
liveUpdate: true
|
|
7386
|
-
}));
|
|
7484
|
+
const primaryVenueMarketId = (_c = (_b = selectedOutcomesByVenue[0]) == null ? void 0 : _b.market.id) != null ? _c : null;
|
|
7485
|
+
const venueMarketIds = (0, import_react11.useMemo)(() => {
|
|
7486
|
+
return selectedOutcomesByVenue.map((item) => item.market.id);
|
|
7387
7487
|
}, [selectedOutcomesByVenue]);
|
|
7388
7488
|
const {
|
|
7389
|
-
data:
|
|
7489
|
+
data: marketChartData,
|
|
7490
|
+
isLoading: isMarketChartLoading,
|
|
7491
|
+
error: marketChartError,
|
|
7492
|
+
refetch: refetchMarketChart
|
|
7493
|
+
} = (0, import_hooks24.useMarketChart)({
|
|
7494
|
+
marketId: primaryVenueMarketId,
|
|
7495
|
+
venueMarketIds,
|
|
7496
|
+
interval: (0, import_hooks24.timeRangeToInterval)(selectedTimeRange),
|
|
7497
|
+
startTs: timeWindow.startTs * 1e3,
|
|
7498
|
+
endTs: timeWindow.endTs * 1e3,
|
|
7499
|
+
enabled: chartEnabled && !!primaryVenueMarketId
|
|
7500
|
+
});
|
|
7501
|
+
const {
|
|
7502
|
+
data: marketOrderbookData,
|
|
7390
7503
|
isLoading: isOrderBookLoading,
|
|
7391
7504
|
error: orderBookError,
|
|
7392
|
-
|
|
7393
|
-
} = (0, import_hooks24.
|
|
7394
|
-
|
|
7395
|
-
enabled:
|
|
7505
|
+
refetch: refetchOrderBook
|
|
7506
|
+
} = (0, import_hooks24.useMarketOrderbook)({
|
|
7507
|
+
marketId: primaryVenueMarketId,
|
|
7508
|
+
enabled: orderBookEnabled && !!primaryVenueMarketId,
|
|
7509
|
+
venueOutcomes: selectedOutcomesByVenue.map((item) => ({
|
|
7510
|
+
venue: item.market.venue,
|
|
7511
|
+
venueMarketOutcomeId: item.outcome.id
|
|
7512
|
+
}))
|
|
7396
7513
|
});
|
|
7514
|
+
const orderBookData = (0, import_react11.useMemo)(() => {
|
|
7515
|
+
if (!marketOrderbookData)
|
|
7516
|
+
return void 0;
|
|
7517
|
+
const results = selectedOutcomesByVenue.flatMap(({ market, outcome }) => {
|
|
7518
|
+
const venueOrderbook = marketOrderbookData.venueOrderbooks[market.venue];
|
|
7519
|
+
if (!venueOrderbook)
|
|
7520
|
+
return [];
|
|
7521
|
+
return [
|
|
7522
|
+
{
|
|
7523
|
+
market,
|
|
7524
|
+
outcome,
|
|
7525
|
+
orderbook: {
|
|
7526
|
+
bids: venueOrderbook.bids,
|
|
7527
|
+
asks: venueOrderbook.asks
|
|
7528
|
+
}
|
|
7529
|
+
}
|
|
7530
|
+
];
|
|
7531
|
+
});
|
|
7532
|
+
return results.length === selectedOutcomesByVenue.length ? results : void 0;
|
|
7533
|
+
}, [marketOrderbookData, selectedOutcomesByVenue]);
|
|
7397
7534
|
const askRows = (0, import_react11.useMemo)(() => {
|
|
7398
7535
|
return resolveOrderBookRows({
|
|
7399
7536
|
data: orderBookData,
|
|
@@ -7406,88 +7543,54 @@ var MarketDetailsContent = ({
|
|
|
7406
7543
|
side: "bids"
|
|
7407
7544
|
});
|
|
7408
7545
|
}, [orderBookData]);
|
|
7409
|
-
const priceHistoryByVenue = (0, import_react11.useMemo)(() => {
|
|
7410
|
-
const historyByVenue = /* @__PURE__ */ new Map();
|
|
7411
|
-
if (!(priceHistoryData == null ? void 0 : priceHistoryData.length)) {
|
|
7412
|
-
return historyByVenue;
|
|
7413
|
-
}
|
|
7414
|
-
priceHistoryData.forEach((historyItem) => {
|
|
7415
|
-
const venue = historyItem.venue;
|
|
7416
|
-
const venueHistory = historyByVenue.get(venue);
|
|
7417
|
-
if (venueHistory) {
|
|
7418
|
-
venueHistory.push(historyItem);
|
|
7419
|
-
return;
|
|
7420
|
-
}
|
|
7421
|
-
historyByVenue.set(venue, [historyItem]);
|
|
7422
|
-
});
|
|
7423
|
-
return historyByVenue;
|
|
7424
|
-
}, [priceHistoryData]);
|
|
7425
|
-
const graphSeriesByOutcomeLabel = (0, import_react11.useMemo)(() => {
|
|
7426
|
-
const seriesByOutcomeLabel = /* @__PURE__ */ new Map();
|
|
7427
|
-
const resolveOutcomeCandidateIds2 = (outcomeByVenue) => {
|
|
7428
|
-
var _a, _b;
|
|
7429
|
-
const marketWithCanonicalId = outcomeByVenue.market;
|
|
7430
|
-
return [
|
|
7431
|
-
outcomeByVenue.outcome.id,
|
|
7432
|
-
(_a = outcomeByVenue.outcome.externalIdentifier) != null ? _a : void 0,
|
|
7433
|
-
outcomeByVenue.market.externalIdentifier,
|
|
7434
|
-
(_b = marketWithCanonicalId.marketId) != null ? _b : void 0,
|
|
7435
|
-
canonicalMarketIdForHistory
|
|
7436
|
-
].filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
7437
|
-
};
|
|
7438
|
-
headerOutcomeItems.forEach((headerOutcomeItem) => {
|
|
7439
|
-
var _a;
|
|
7440
|
-
const outcomes = (_a = outcomesByLabel.get(headerOutcomeItem.label)) != null ? _a : [];
|
|
7441
|
-
const graphSeries2 = [];
|
|
7442
|
-
outcomes.forEach((outcomeByVenue, index) => {
|
|
7443
|
-
var _a2;
|
|
7444
|
-
const venueHistory = priceHistoryByVenue.get(outcomeByVenue.venue);
|
|
7445
|
-
if (!(venueHistory == null ? void 0 : venueHistory.length))
|
|
7446
|
-
return;
|
|
7447
|
-
const candidateIds = resolveOutcomeCandidateIds2(outcomeByVenue);
|
|
7448
|
-
const matchingHistory = (_a2 = venueHistory.find((historyItem) => candidateIds.includes(historyItem.marketId))) != null ? _a2 : venueHistory.length === 1 ? venueHistory[0] : void 0;
|
|
7449
|
-
if (!matchingHistory)
|
|
7450
|
-
return;
|
|
7451
|
-
const points = matchingHistory.points.map((point) => ({
|
|
7452
|
-
time: point.timestamp,
|
|
7453
|
-
value: point.price * 100,
|
|
7454
|
-
open: point.open == null ? void 0 : point.open * 100,
|
|
7455
|
-
high: point.high == null ? void 0 : point.high * 100,
|
|
7456
|
-
low: point.low == null ? void 0 : point.low * 100,
|
|
7457
|
-
close: point.close == null ? void 0 : point.close * 100
|
|
7458
|
-
})).filter((point) => Number.isFinite(point.time) && Number.isFinite(point.value));
|
|
7459
|
-
if (points.length === 0)
|
|
7460
|
-
return;
|
|
7461
|
-
graphSeries2.push({
|
|
7462
|
-
id: `${headerOutcomeItem.label}-${outcomeByVenue.venue}-${matchingHistory.marketId}`,
|
|
7463
|
-
venue: outcomeByVenue.venue,
|
|
7464
|
-
color: resolveSeriesColor(outcomeByVenue.venue, index),
|
|
7465
|
-
points
|
|
7466
|
-
});
|
|
7467
|
-
});
|
|
7468
|
-
seriesByOutcomeLabel.set(headerOutcomeItem.label, graphSeries2);
|
|
7469
|
-
});
|
|
7470
|
-
return seriesByOutcomeLabel;
|
|
7471
|
-
}, [canonicalMarketIdForHistory, headerOutcomeItems, outcomesByLabel, priceHistoryByVenue]);
|
|
7472
7546
|
const graphSeries = (0, import_react11.useMemo)(() => {
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7547
|
+
const colorByVenue = new Map(
|
|
7548
|
+
selectedOutcomesByVenue.map((item, index) => [
|
|
7549
|
+
item.venue,
|
|
7550
|
+
resolveSeriesColor(item.venue, index)
|
|
7551
|
+
])
|
|
7552
|
+
);
|
|
7553
|
+
const seriesForOutcomeLabel = resolveMarketChartVenueSeries({
|
|
7554
|
+
chartData: marketChartData,
|
|
7555
|
+
transformProbability: (value) => value
|
|
7556
|
+
}).map((seriesItem) => {
|
|
7557
|
+
var _a2;
|
|
7558
|
+
const resolvedVenue = seriesItem.venue;
|
|
7559
|
+
return {
|
|
7560
|
+
id: `${selectedOutcomeLabel != null ? selectedOutcomeLabel : "graph"}-${resolvedVenue}-${primaryVenueMarketId != null ? primaryVenueMarketId : "chart"}`,
|
|
7561
|
+
venue: resolvedVenue,
|
|
7562
|
+
color: (_a2 = colorByVenue.get(resolvedVenue)) != null ? _a2 : resolveSeriesColor(resolvedVenue, 0),
|
|
7563
|
+
points: seriesItem.points
|
|
7564
|
+
};
|
|
7565
|
+
});
|
|
7477
7566
|
if (!selectedGraphVenue)
|
|
7478
7567
|
return seriesForOutcomeLabel;
|
|
7479
7568
|
return seriesForOutcomeLabel.filter((seriesItem) => seriesItem.venue === selectedGraphVenue);
|
|
7480
|
-
}, [
|
|
7569
|
+
}, [
|
|
7570
|
+
primaryVenueMarketId,
|
|
7571
|
+
marketChartData,
|
|
7572
|
+
selectedGraphVenue,
|
|
7573
|
+
selectedOutcomeLabel,
|
|
7574
|
+
selectedOutcomesByVenue
|
|
7575
|
+
]);
|
|
7576
|
+
const graphLiveState = (0, import_react11.useMemo)(() => {
|
|
7577
|
+
return resolveMarketChartLiveState({
|
|
7578
|
+
chartData: marketChartData,
|
|
7579
|
+
selectedVenue: selectedGraphVenue,
|
|
7580
|
+
transformProbability: (value) => value
|
|
7581
|
+
});
|
|
7582
|
+
}, [marketChartData, selectedGraphVenue]);
|
|
7481
7583
|
const otherRows = (0, import_react11.useMemo)(() => {
|
|
7482
7584
|
if (!model)
|
|
7483
7585
|
return [];
|
|
7484
7586
|
return resolveOtherTabRows(model.market, labels);
|
|
7485
7587
|
}, [labels, model]);
|
|
7486
|
-
const isOrderBookNotFound =
|
|
7588
|
+
const isOrderBookNotFound = orderBookError && typeof orderBookError === "object" && "status" in orderBookError && orderBookError.status === 404;
|
|
7487
7589
|
const hasOrderBookError = !!orderBookError && !isOrderBookNotFound;
|
|
7488
|
-
const hasNoOrderBook = isOrderBookNotFound || !isOrderBookLoading && !hasOrderBookError && (
|
|
7590
|
+
const hasNoOrderBook = isOrderBookNotFound || !isOrderBookLoading && !hasOrderBookError && (selectedOutcomesByVenue.length === 0 || askRows.length === 0 && bidRows.length === 0);
|
|
7591
|
+
const hasChartError = !!marketChartError;
|
|
7489
7592
|
const handleOutcomeKeyDown = (eventToHandle) => {
|
|
7490
|
-
var
|
|
7593
|
+
var _a2;
|
|
7491
7594
|
if ((eventToHandle == null ? void 0 : eventToHandle.key) !== "ArrowLeft" && (eventToHandle == null ? void 0 : eventToHandle.key) !== "ArrowRight") {
|
|
7492
7595
|
return;
|
|
7493
7596
|
}
|
|
@@ -7498,14 +7601,14 @@ var MarketDetailsContent = ({
|
|
|
7498
7601
|
});
|
|
7499
7602
|
const direction = eventToHandle.key === "ArrowRight" ? 1 : -1;
|
|
7500
7603
|
const nextIndex = activeIndex < 0 ? 0 : (activeIndex + direction + headerOutcomeItems.length) % headerOutcomeItems.length;
|
|
7501
|
-
setSelectedOutcomeLabel((
|
|
7604
|
+
setSelectedOutcomeLabel((_a2 = headerOutcomeItems[nextIndex]) == null ? void 0 : _a2.label);
|
|
7502
7605
|
};
|
|
7503
|
-
const handleToggleExpanded = (
|
|
7504
|
-
if (
|
|
7606
|
+
const handleToggleExpanded = (event) => {
|
|
7607
|
+
if (event && "key" in event && (event == null ? void 0 : event.key) !== "Enter" && (event == null ? void 0 : event.key) !== " ") {
|
|
7505
7608
|
return;
|
|
7506
7609
|
}
|
|
7507
|
-
|
|
7508
|
-
|
|
7610
|
+
event == null ? void 0 : event.preventDefault();
|
|
7611
|
+
event == null ? void 0 : event.stopPropagation();
|
|
7509
7612
|
setIsOpened((prev) => {
|
|
7510
7613
|
const next = !prev;
|
|
7511
7614
|
onOpenChange == null ? void 0 : onOpenChange(next);
|
|
@@ -7520,7 +7623,10 @@ var MarketDetailsContent = ({
|
|
|
7520
7623
|
});
|
|
7521
7624
|
};
|
|
7522
7625
|
const handleRetryOrderBook = () => {
|
|
7523
|
-
void
|
|
7626
|
+
void refetchOrderBook();
|
|
7627
|
+
};
|
|
7628
|
+
const handleRetryMarketChart = () => {
|
|
7629
|
+
void refetchMarketChart();
|
|
7524
7630
|
};
|
|
7525
7631
|
(0, import_react11.useEffect)(() => {
|
|
7526
7632
|
if (!selectedGraphVenue) {
|
|
@@ -7563,7 +7669,7 @@ var MarketDetailsContent = ({
|
|
|
7563
7669
|
onClick: handleToggleExpanded,
|
|
7564
7670
|
onKeyDown: handleToggleExpanded,
|
|
7565
7671
|
children: [
|
|
7566
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex min-w-52 items-center gap-3 md:gap-4", children: [
|
|
7672
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex min-w-52 max-w-3/4 items-center gap-3 md:gap-4", children: [
|
|
7567
7673
|
model.image ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
7568
7674
|
RemoteImage,
|
|
7569
7675
|
{
|
|
@@ -7610,7 +7716,7 @@ var MarketDetailsContent = ({
|
|
|
7610
7716
|
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
7611
7717
|
VenueLogo,
|
|
7612
7718
|
{
|
|
7613
|
-
venue:
|
|
7719
|
+
venue: "polymarket",
|
|
7614
7720
|
size: "small",
|
|
7615
7721
|
color: isActiveOutcome ? "var(--agg-color-on-primary)" : void 0
|
|
7616
7722
|
}
|
|
@@ -7717,13 +7823,26 @@ var MarketDetailsContent = ({
|
|
|
7717
7823
|
)
|
|
7718
7824
|
] }) }) : null,
|
|
7719
7825
|
selectedTab === "graph" ? /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.graph), children: [
|
|
7720
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
7826
|
+
hasChartError ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
7827
|
+
StateMessage,
|
|
7828
|
+
{
|
|
7829
|
+
ariaLabel: labels.marketDetails.chartUnavailableAria,
|
|
7830
|
+
tone: "warning",
|
|
7831
|
+
title: labels.marketDetails.chartUnavailableTitle,
|
|
7832
|
+
description: labels.marketDetails.chartUnavailableDescription,
|
|
7833
|
+
actionLabel: labels.common.retry,
|
|
7834
|
+
onAction: handleRetryMarketChart,
|
|
7835
|
+
className: "min-h-[248px] px-5 py-10 md:min-h-[272px]"
|
|
7836
|
+
}
|
|
7837
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
7721
7838
|
LineChart,
|
|
7722
7839
|
{
|
|
7723
7840
|
series: graphSeries,
|
|
7724
7841
|
height: 260,
|
|
7725
|
-
isLoading:
|
|
7842
|
+
isLoading: isMarketChartLoading,
|
|
7726
7843
|
chartType: selectedChartType,
|
|
7844
|
+
liveCandle: selectedChartType === "candlestick" ? (_d = graphLiveState.liveCandle) != null ? _d : void 0 : void 0,
|
|
7845
|
+
lineValue: graphLiveState.lineValue,
|
|
7727
7846
|
classNames: { root: "w-full" },
|
|
7728
7847
|
showSeriesControls: selectedOutcomesByVenue.length > 0 || headerOutcomeItems.length > 0,
|
|
7729
7848
|
renderSeriesControls: () => {
|
|
@@ -7864,14 +7983,6 @@ var MarketDetails = (props) => {
|
|
|
7864
7983
|
}
|
|
7865
7984
|
(_a2 = props.onOpenChange) == null ? void 0 : _a2.call(props, nextIsOpened);
|
|
7866
7985
|
};
|
|
7867
|
-
const hasEventProp = "event" in props && !!props.event;
|
|
7868
|
-
const {
|
|
7869
|
-
event: fetchedEvent,
|
|
7870
|
-
error: eventError,
|
|
7871
|
-
isLoading: isFetchingEvent
|
|
7872
|
-
} = (0, import_hooks24.useEvent)(hasEventProp ? void 0 : props.eventId, {
|
|
7873
|
-
enabled: !props.isLoading && !hasEventProp && !!props.eventId
|
|
7874
|
-
});
|
|
7875
7986
|
if (props.isLoading) {
|
|
7876
7987
|
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
7877
7988
|
MarketDetailsLoadingState,
|
|
@@ -7882,42 +7993,115 @@ var MarketDetails = (props) => {
|
|
|
7882
7993
|
}
|
|
7883
7994
|
);
|
|
7884
7995
|
}
|
|
7885
|
-
if ("
|
|
7996
|
+
if ("venueMarkets" in props && props.venueMarkets) {
|
|
7886
7997
|
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
7887
7998
|
MarketDetailsContent,
|
|
7888
7999
|
__spreadProps(__spreadValues({}, props), {
|
|
7889
8000
|
isOpened: resolvedIsOpened,
|
|
7890
8001
|
onOpenChange: handleOpenChange,
|
|
7891
|
-
|
|
8002
|
+
venueMarkets: props.venueMarkets
|
|
7892
8003
|
})
|
|
7893
8004
|
);
|
|
7894
8005
|
}
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
8006
|
+
const { ariaLabel: fallbackAriaLabel, classNames: fallbackClassNames } = props;
|
|
8007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(MarketDetailsUnavailableState, { ariaLabel: fallbackAriaLabel, classNames: fallbackClassNames });
|
|
8008
|
+
};
|
|
8009
|
+
MarketDetails.displayName = "MarketDetails";
|
|
8010
|
+
var resolveInitialExpandedId = (markets, defaultId) => {
|
|
8011
|
+
var _a, _b;
|
|
8012
|
+
if (!markets.length)
|
|
8013
|
+
return null;
|
|
8014
|
+
if (defaultId) {
|
|
8015
|
+
const match = markets.find((m) => m.id === defaultId);
|
|
8016
|
+
if (match)
|
|
8017
|
+
return match.id;
|
|
8018
|
+
}
|
|
8019
|
+
return (_b = (_a = markets[0]) == null ? void 0 : _a.id) != null ? _b : null;
|
|
8020
|
+
};
|
|
8021
|
+
var MarketDetailsList = ({
|
|
8022
|
+
eventId,
|
|
8023
|
+
expandedMarketId,
|
|
8024
|
+
defaultExpandedMarketId,
|
|
8025
|
+
onExpandedMarketChange,
|
|
8026
|
+
defaultTab,
|
|
8027
|
+
defaultTimeRange,
|
|
8028
|
+
classNames,
|
|
8029
|
+
ariaLabel
|
|
8030
|
+
}) => {
|
|
8031
|
+
const labels = (0, import_hooks24.useLabels)();
|
|
8032
|
+
const resolvedEventId = eventId || "";
|
|
8033
|
+
const { markets, isLoading, error } = (0, import_hooks24.useVenueMarkets)({
|
|
8034
|
+
venueEventId: resolvedEventId,
|
|
8035
|
+
enabled: !!resolvedEventId
|
|
8036
|
+
});
|
|
8037
|
+
const [internalExpandedId, setInternalExpandedId] = (0, import_react11.useState)(
|
|
8038
|
+
() => resolveInitialExpandedId(markets, defaultExpandedMarketId)
|
|
8039
|
+
);
|
|
8040
|
+
(0, import_react11.useEffect)(() => {
|
|
8041
|
+
if (typeof expandedMarketId !== "undefined")
|
|
8042
|
+
return;
|
|
8043
|
+
setInternalExpandedId((current) => {
|
|
8044
|
+
if (current && markets.some((m) => m.id === current))
|
|
8045
|
+
return current;
|
|
8046
|
+
return resolveInitialExpandedId(markets, defaultExpandedMarketId);
|
|
8047
|
+
});
|
|
8048
|
+
}, [defaultExpandedMarketId, expandedMarketId, markets]);
|
|
8049
|
+
(0, import_react11.useEffect)(() => {
|
|
8050
|
+
if (typeof expandedMarketId === "undefined")
|
|
8051
|
+
return;
|
|
8052
|
+
setInternalExpandedId(expandedMarketId);
|
|
8053
|
+
}, [expandedMarketId]);
|
|
8054
|
+
const resolvedExpandedId = typeof expandedMarketId === "undefined" ? internalExpandedId : expandedMarketId;
|
|
8055
|
+
const handleToggle = (marketId, isOpened) => {
|
|
8056
|
+
const next = isOpened ? marketId : null;
|
|
8057
|
+
if (typeof expandedMarketId === "undefined") {
|
|
8058
|
+
setInternalExpandedId(next);
|
|
8059
|
+
}
|
|
8060
|
+
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(next);
|
|
8061
|
+
};
|
|
8062
|
+
if (isLoading) {
|
|
8063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: cn("flex flex-col gap-3", classNames == null ? void 0 : classNames.root), "aria-label": ariaLabel, children: [
|
|
8064
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(MarketDetailsLoadingState, { isOpened: true, classNames: { root: classNames == null ? void 0 : classNames.item } }),
|
|
8065
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(MarketDetailsLoadingState, { isOpened: false, classNames: { root: classNames == null ? void 0 : classNames.item } })
|
|
8066
|
+
] });
|
|
8067
|
+
}
|
|
8068
|
+
if (error) {
|
|
8069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Card, { className: cn(marketDetailsBaseCardClassName, "p-0", classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8070
|
+
StateMessage,
|
|
7898
8071
|
{
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
8072
|
+
ariaLabel: ariaLabel != null ? ariaLabel : labels.marketDetails.unavailableAria,
|
|
8073
|
+
title: labels.marketDetails.unavailableTitle,
|
|
8074
|
+
description: labels.marketDetails.unavailableDescription,
|
|
8075
|
+
className: "min-h-[280px] md:min-h-[320px]"
|
|
7902
8076
|
}
|
|
7903
|
-
);
|
|
8077
|
+
) });
|
|
7904
8078
|
}
|
|
7905
|
-
if (
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
8079
|
+
if (markets.length === 0) {
|
|
8080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Card, { className: cn(marketDetailsBaseCardClassName, "p-0", classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8081
|
+
StateMessage,
|
|
8082
|
+
{
|
|
8083
|
+
ariaLabel: ariaLabel != null ? ariaLabel : labels.marketDetails.notFoundAria,
|
|
8084
|
+
title: labels.marketDetails.notFoundTitle,
|
|
8085
|
+
description: labels.marketDetails.notFoundDescription,
|
|
8086
|
+
className: "min-h-[280px] md:min-h-[320px]"
|
|
8087
|
+
}
|
|
8088
|
+
) });
|
|
7910
8089
|
}
|
|
7911
|
-
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
8090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: cn("flex flex-col gap-3", classNames == null ? void 0 : classNames.root), "aria-label": ariaLabel, children: markets.map((market) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8091
|
+
MarketDetails,
|
|
8092
|
+
{
|
|
8093
|
+
venueMarkets: [market],
|
|
8094
|
+
isOpened: resolvedExpandedId === market.id,
|
|
8095
|
+
onOpenChange: (nextIsOpened) => handleToggle(market.id, nextIsOpened),
|
|
8096
|
+
defaultTab,
|
|
8097
|
+
defaultTimeRange,
|
|
8098
|
+
ariaLabel: market.question,
|
|
8099
|
+
classNames: { root: classNames == null ? void 0 : classNames.item }
|
|
8100
|
+
},
|
|
8101
|
+
market.id
|
|
8102
|
+
)) });
|
|
7919
8103
|
};
|
|
7920
|
-
|
|
8104
|
+
MarketDetailsList.displayName = "MarketDetailsList";
|
|
7921
8105
|
|
|
7922
8106
|
// src/events/list/index.tsx
|
|
7923
8107
|
var import_react12 = require("react");
|
|
@@ -7952,8 +8136,7 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
7952
8136
|
|
|
7953
8137
|
// src/events/list/event-list.utils.ts
|
|
7954
8138
|
var mapEventToEventListItemEvent = (event) => {
|
|
7955
|
-
|
|
7956
|
-
if (mergedVenueMarkets.length === 0)
|
|
8139
|
+
if (!event.venueMarkets || event.venueMarkets.length === 0)
|
|
7957
8140
|
return null;
|
|
7958
8141
|
return event;
|
|
7959
8142
|
};
|
|
@@ -8017,11 +8200,11 @@ var estimateTabsWidth = (items) => {
|
|
|
8017
8200
|
var EventList = ({
|
|
8018
8201
|
title,
|
|
8019
8202
|
maxItemsPerRow = 3,
|
|
8020
|
-
limit =
|
|
8203
|
+
limit = 9,
|
|
8021
8204
|
maxVisibleItems,
|
|
8022
|
-
showVenueLogo = true,
|
|
8023
8205
|
search,
|
|
8024
|
-
categoryIds
|
|
8206
|
+
categoryIds,
|
|
8207
|
+
onClick
|
|
8025
8208
|
}) => {
|
|
8026
8209
|
var _a, _b;
|
|
8027
8210
|
const labels = (0, import_hooks25.useLabels)();
|
|
@@ -8045,7 +8228,7 @@ var EventList = ({
|
|
|
8045
8228
|
}, [maxVisibleItems]);
|
|
8046
8229
|
const requestLimit = resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : limit;
|
|
8047
8230
|
const shouldPaginate = resolvedMaxVisibleItems == null;
|
|
8048
|
-
const { events, isLoading, isError, fetchNextPage, hasNextPage, isFetchingNextPage } = (0, import_hooks25.
|
|
8231
|
+
const { events, isLoading, isError, fetchNextPage, hasNextPage, isFetchingNextPage } = (0, import_hooks25.useVenueEvents)({
|
|
8049
8232
|
venues,
|
|
8050
8233
|
search,
|
|
8051
8234
|
categoryIds,
|
|
@@ -8176,10 +8359,10 @@ var EventList = ({
|
|
|
8176
8359
|
EventListItem,
|
|
8177
8360
|
{
|
|
8178
8361
|
event,
|
|
8179
|
-
showVenueLogo,
|
|
8180
8362
|
classNames: {
|
|
8181
8363
|
root: "w-full min-w-0 max-w-none"
|
|
8182
|
-
}
|
|
8364
|
+
},
|
|
8365
|
+
onClick
|
|
8183
8366
|
},
|
|
8184
8367
|
event.id
|
|
8185
8368
|
)),
|
|
@@ -8224,51 +8407,6 @@ var import_hooks26 = require("@agg-market/hooks");
|
|
|
8224
8407
|
var ALL_CATEGORIES_TAB_VALUE = "trending";
|
|
8225
8408
|
var DEFAULT_CATEGORIES_LIMIT = 100;
|
|
8226
8409
|
var DEFAULT_ALL_CATEGORY_TAB_LABEL = "Trending";
|
|
8227
|
-
var CATEGORY_TAB_NAME_ORDER = [
|
|
8228
|
-
"crypto",
|
|
8229
|
-
"economy",
|
|
8230
|
-
"entertainment",
|
|
8231
|
-
"finance",
|
|
8232
|
-
"geopolitics",
|
|
8233
|
-
"health",
|
|
8234
|
-
"mentions",
|
|
8235
|
-
"politics",
|
|
8236
|
-
"science",
|
|
8237
|
-
"sports",
|
|
8238
|
-
"technology",
|
|
8239
|
-
"weather",
|
|
8240
|
-
"world"
|
|
8241
|
-
];
|
|
8242
|
-
var getDefaultHomePageTabs = (allCategoryTabLabel) => {
|
|
8243
|
-
return [
|
|
8244
|
-
{
|
|
8245
|
-
value: ALL_CATEGORIES_TAB_VALUE,
|
|
8246
|
-
label: allCategoryTabLabel,
|
|
8247
|
-
iconName: "arrow-trend-up"
|
|
8248
|
-
},
|
|
8249
|
-
{ value: "crypto", label: "crypto", categoryIds: ["crypto"] },
|
|
8250
|
-
{ value: "economy", label: "economy", categoryIds: ["economy"] },
|
|
8251
|
-
{
|
|
8252
|
-
value: "entertainment",
|
|
8253
|
-
label: "entertainment",
|
|
8254
|
-
categoryIds: ["entertainment"]
|
|
8255
|
-
},
|
|
8256
|
-
{ value: "finance", label: "finance", categoryIds: ["finance"] },
|
|
8257
|
-
{
|
|
8258
|
-
value: "geopolitics",
|
|
8259
|
-
label: "geopolitics",
|
|
8260
|
-
categoryIds: ["geopolitics"]
|
|
8261
|
-
},
|
|
8262
|
-
{ value: "health", label: "health", categoryIds: ["health"] },
|
|
8263
|
-
{ value: "mentions", label: "mentions", categoryIds: ["mentions"] },
|
|
8264
|
-
{ value: "politics", label: "politics", categoryIds: ["politics"] },
|
|
8265
|
-
{ value: "science", label: "science", categoryIds: ["science"] },
|
|
8266
|
-
{ value: "sports", label: "sports", categoryIds: ["sports"] },
|
|
8267
|
-
{ value: "technology", label: "technology", categoryIds: ["technology"] },
|
|
8268
|
-
{ value: "weather", label: "weather", categoryIds: ["weather"] },
|
|
8269
|
-
{ value: "world", label: "world", categoryIds: ["world"] }
|
|
8270
|
-
];
|
|
8271
|
-
};
|
|
8272
8410
|
var getDefaultEventSectionItems = (labels) => {
|
|
8273
8411
|
return [
|
|
8274
8412
|
{
|
|
@@ -8289,31 +8427,7 @@ var getDefaultEventSectionItems = (labels) => {
|
|
|
8289
8427
|
};
|
|
8290
8428
|
|
|
8291
8429
|
// src/pages/home/home.utils.ts
|
|
8292
|
-
var categoryOrderMap = CATEGORY_TAB_NAME_ORDER.reduce(
|
|
8293
|
-
(accumulator, name, index) => {
|
|
8294
|
-
accumulator.set(name, index);
|
|
8295
|
-
return accumulator;
|
|
8296
|
-
},
|
|
8297
|
-
/* @__PURE__ */ new Map()
|
|
8298
|
-
);
|
|
8299
|
-
var normalizeCategoryName = (name) => {
|
|
8300
|
-
return name.trim().toLowerCase();
|
|
8301
|
-
};
|
|
8302
8430
|
var resolveCategoryTabs = (categories, allCategoryTabLabel) => {
|
|
8303
|
-
const sortedCategories = [...categories].sort((left, right) => {
|
|
8304
|
-
const leftName = normalizeCategoryName(left.name);
|
|
8305
|
-
const rightName = normalizeCategoryName(right.name);
|
|
8306
|
-
const leftOrder = categoryOrderMap.get(leftName);
|
|
8307
|
-
const rightOrder = categoryOrderMap.get(rightName);
|
|
8308
|
-
if (leftOrder != null && rightOrder != null) {
|
|
8309
|
-
return leftOrder - rightOrder;
|
|
8310
|
-
}
|
|
8311
|
-
if (leftOrder != null)
|
|
8312
|
-
return -1;
|
|
8313
|
-
if (rightOrder != null)
|
|
8314
|
-
return 1;
|
|
8315
|
-
return leftName.localeCompare(rightName);
|
|
8316
|
-
});
|
|
8317
8431
|
const seenCategoryIds = /* @__PURE__ */ new Set();
|
|
8318
8432
|
const tabs = [
|
|
8319
8433
|
{
|
|
@@ -8322,13 +8436,13 @@ var resolveCategoryTabs = (categories, allCategoryTabLabel) => {
|
|
|
8322
8436
|
iconName: "arrow-trend-up"
|
|
8323
8437
|
}
|
|
8324
8438
|
];
|
|
8325
|
-
for (const category of
|
|
8439
|
+
for (const category of categories) {
|
|
8326
8440
|
if (seenCategoryIds.has(category.id))
|
|
8327
8441
|
continue;
|
|
8328
8442
|
seenCategoryIds.add(category.id);
|
|
8329
8443
|
tabs.push({
|
|
8330
8444
|
value: category.id,
|
|
8331
|
-
label:
|
|
8445
|
+
label: category.name.trim().toLowerCase(),
|
|
8332
8446
|
categoryIds: [category.id]
|
|
8333
8447
|
});
|
|
8334
8448
|
}
|
|
@@ -8341,7 +8455,7 @@ var resolveInitialTabValue = (tabs, defaultActiveTab) => {
|
|
|
8341
8455
|
if (hasDefaultTab)
|
|
8342
8456
|
return defaultActiveTab;
|
|
8343
8457
|
}
|
|
8344
|
-
return (_b = (_a = tabs[0]) == null ? void 0 : _a.value) != null ? _b :
|
|
8458
|
+
return (_b = (_a = tabs[0]) == null ? void 0 : _a.value) != null ? _b : ALL_CATEGORIES_TAB_VALUE;
|
|
8345
8459
|
};
|
|
8346
8460
|
|
|
8347
8461
|
// src/pages/home/index.tsx
|
|
@@ -8352,17 +8466,15 @@ var HomePage = ({
|
|
|
8352
8466
|
onTabChange,
|
|
8353
8467
|
eventSectionItems,
|
|
8354
8468
|
classNames,
|
|
8355
|
-
useCategoriesTabs = true,
|
|
8356
8469
|
categoriesLimit = DEFAULT_CATEGORIES_LIMIT,
|
|
8357
8470
|
allCategoryTabLabel = DEFAULT_ALL_CATEGORY_TAB_LABEL
|
|
8358
8471
|
}) => {
|
|
8359
8472
|
const labels = (0, import_hooks26.useLabels)();
|
|
8360
8473
|
const hasCustomTabs = !!tabs && tabs.length > 0;
|
|
8361
|
-
const shouldUseCategoriesTabs = !hasCustomTabs && useCategoriesTabs;
|
|
8362
8474
|
const resolvedAllCategoryTabLabel = allCategoryTabLabel === DEFAULT_ALL_CATEGORY_TAB_LABEL ? labels.home.trending : allCategoryTabLabel;
|
|
8363
|
-
const { categories } = (0, import_hooks26.useCategories)({
|
|
8475
|
+
const { categories, isLoading: isCategoriesLoading } = (0, import_hooks26.useCategories)({
|
|
8364
8476
|
limit: categoriesLimit,
|
|
8365
|
-
enabled:
|
|
8477
|
+
enabled: !hasCustomTabs
|
|
8366
8478
|
});
|
|
8367
8479
|
const categoryTabs = (0, import_react13.useMemo)(() => {
|
|
8368
8480
|
return resolveCategoryTabs(categories, resolvedAllCategoryTabLabel);
|
|
@@ -8370,10 +8482,8 @@ var HomePage = ({
|
|
|
8370
8482
|
const resolvedTabs = (0, import_react13.useMemo)(() => {
|
|
8371
8483
|
if (hasCustomTabs && tabs)
|
|
8372
8484
|
return tabs;
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
return getDefaultHomePageTabs(resolvedAllCategoryTabLabel);
|
|
8376
|
-
}, [categoryTabs, hasCustomTabs, resolvedAllCategoryTabLabel, shouldUseCategoriesTabs, tabs]);
|
|
8485
|
+
return categoryTabs;
|
|
8486
|
+
}, [categoryTabs, hasCustomTabs, tabs]);
|
|
8377
8487
|
const resolvedEventSectionItems = eventSectionItems && eventSectionItems.length > 0 ? eventSectionItems : getDefaultEventSectionItems(labels);
|
|
8378
8488
|
const [activeTabValue, setActiveTabValue] = (0, import_react13.useState)(() => {
|
|
8379
8489
|
return resolveInitialTabValue(resolvedTabs, defaultActiveTab);
|
|
@@ -8408,22 +8518,20 @@ var HomePage = ({
|
|
|
8408
8518
|
return resolvedTabs.find((tab) => tab.value === activeTabValue);
|
|
8409
8519
|
}, [activeTabValue, resolvedTabs]);
|
|
8410
8520
|
const resolvedSectionItems = (0, import_react13.useMemo)(() => {
|
|
8411
|
-
var _a, _b, _c, _d
|
|
8521
|
+
var _a, _b, _c, _d;
|
|
8412
8522
|
if (activeTabValue === ALL_CATEGORIES_TAB_VALUE) {
|
|
8413
8523
|
return resolvedEventSectionItems;
|
|
8414
8524
|
}
|
|
8415
8525
|
const maxItemsPerRow = (_b = (_a = resolvedEventSectionItems[0]) == null ? void 0 : _a.maxItemsPerRow) != null ? _b : 3;
|
|
8416
|
-
const
|
|
8417
|
-
const firstSectionLimit = (_d = resolvedEventSectionItems[0]) == null ? void 0 : _d.limit;
|
|
8526
|
+
const firstSectionLimit = (_c = resolvedEventSectionItems[0]) == null ? void 0 : _c.limit;
|
|
8418
8527
|
const limit = firstSectionLimit && Number.isFinite(firstSectionLimit) ? Math.max(9, Math.floor(firstSectionLimit)) : 9;
|
|
8419
8528
|
return [
|
|
8420
8529
|
{
|
|
8421
8530
|
id: `${activeTabValue}-markets`,
|
|
8422
|
-
title: (
|
|
8531
|
+
title: (_d = activeTab == null ? void 0 : activeTab.label) != null ? _d : activeTabValue,
|
|
8423
8532
|
maxItemsPerRow,
|
|
8424
8533
|
limit,
|
|
8425
8534
|
maxVisibleItems: void 0,
|
|
8426
|
-
showVenueLogo,
|
|
8427
8535
|
search: activeTab == null ? void 0 : activeTab.search,
|
|
8428
8536
|
categoryIds: activeTab == null ? void 0 : activeTab.categoryIds
|
|
8429
8537
|
}
|
|
@@ -8433,6 +8541,18 @@ var HomePage = ({
|
|
|
8433
8541
|
setActiveTabValue(value);
|
|
8434
8542
|
onTabChange == null ? void 0 : onTabChange(value);
|
|
8435
8543
|
};
|
|
8544
|
+
if (!hasCustomTabs && isCategoriesLoading) {
|
|
8545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("section", { className: cn("flex w-full flex-col", classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
8546
|
+
"header",
|
|
8547
|
+
{
|
|
8548
|
+
className: cn(
|
|
8549
|
+
"w-full bg-agg-secondary border-b border-agg-separator",
|
|
8550
|
+
classNames == null ? void 0 : classNames.header
|
|
8551
|
+
),
|
|
8552
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: cn("w-full px-4 md:px-10 h-10", classNames == null ? void 0 : classNames.tabs) })
|
|
8553
|
+
}
|
|
8554
|
+
) });
|
|
8555
|
+
}
|
|
8436
8556
|
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("section", { className: cn("flex w-full flex-col", classNames == null ? void 0 : classNames.root), children: [
|
|
8437
8557
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
8438
8558
|
"header",
|
|
@@ -8467,7 +8587,6 @@ var HomePage = ({
|
|
|
8467
8587
|
maxItemsPerRow: eventSectionItem.maxItemsPerRow,
|
|
8468
8588
|
limit: eventSectionItem.limit,
|
|
8469
8589
|
maxVisibleItems: eventSectionItem.maxVisibleItems,
|
|
8470
|
-
showVenueLogo: eventSectionItem.showVenueLogo,
|
|
8471
8590
|
search: (_b = eventSectionItem.search) != null ? _b : activeTab == null ? void 0 : activeTab.search,
|
|
8472
8591
|
categoryIds: (_c = eventSectionItem.categoryIds) != null ? _c : activeTab == null ? void 0 : activeTab.categoryIds
|
|
8473
8592
|
},
|
|
@@ -9083,7 +9202,11 @@ var Settlement = ({
|
|
|
9083
9202
|
),
|
|
9084
9203
|
"aria-expanded": isExpanded,
|
|
9085
9204
|
"aria-label": labels.trading.settlementDetailsAria(venueLabel),
|
|
9086
|
-
onClick: () =>
|
|
9205
|
+
onClick: (e) => {
|
|
9206
|
+
e.stopPropagation();
|
|
9207
|
+
e.preventDefault();
|
|
9208
|
+
handleVenueClick(venue.venue);
|
|
9209
|
+
},
|
|
9087
9210
|
children: [
|
|
9088
9211
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
9089
9212
|
VenueLogo,
|
|
@@ -9197,29 +9320,29 @@ var getMarketDateValue = (market, fallbackIndex) => {
|
|
|
9197
9320
|
};
|
|
9198
9321
|
var resolveHeroMarketId = (event, heroMarketId) => {
|
|
9199
9322
|
var _a, _b;
|
|
9200
|
-
if (!((_a = event == null ? void 0 : event.
|
|
9323
|
+
if (!((_a = event == null ? void 0 : event.venueMarkets) == null ? void 0 : _a.length))
|
|
9201
9324
|
return void 0;
|
|
9202
9325
|
if (heroMarketId) {
|
|
9203
|
-
const matchingHeroMarket = event.
|
|
9326
|
+
const matchingHeroMarket = event.venueMarkets.find(
|
|
9204
9327
|
(market) => market.id === heroMarketId
|
|
9205
9328
|
);
|
|
9206
9329
|
if (matchingHeroMarket)
|
|
9207
9330
|
return matchingHeroMarket.id;
|
|
9208
9331
|
}
|
|
9209
|
-
return (_b = event.
|
|
9332
|
+
return (_b = event.venueMarkets[0]) == null ? void 0 : _b.id;
|
|
9210
9333
|
};
|
|
9211
9334
|
var buildHeroEvent = (event, heroMarketId) => {
|
|
9212
9335
|
if (!heroMarketId)
|
|
9213
9336
|
return void 0;
|
|
9214
|
-
const heroMarket = event.
|
|
9337
|
+
const heroMarket = event.venueMarkets.find((market) => market.id === heroMarketId);
|
|
9215
9338
|
if (!heroMarket)
|
|
9216
9339
|
return void 0;
|
|
9217
9340
|
return __spreadProps(__spreadValues({}, event), {
|
|
9218
|
-
|
|
9341
|
+
venueMarkets: [heroMarket]
|
|
9219
9342
|
});
|
|
9220
9343
|
};
|
|
9221
9344
|
var resolveDetailedMarkets = (event, heroMarketId) => {
|
|
9222
|
-
return event.
|
|
9345
|
+
return event.venueMarkets.filter((market) => market.id !== heroMarketId).map((market, index) => ({
|
|
9223
9346
|
market,
|
|
9224
9347
|
index
|
|
9225
9348
|
})).sort(
|
|
@@ -9239,6 +9362,69 @@ var resolveInitialExpandedMarketId = (detailedMarkets, defaultExpandedMarketId)
|
|
|
9239
9362
|
}
|
|
9240
9363
|
return (_b = (_a = detailedMarkets[0]) == null ? void 0 : _a.id) != null ? _b : null;
|
|
9241
9364
|
};
|
|
9365
|
+
var EventMarketPageMobileTrade = ({
|
|
9366
|
+
placeOrder,
|
|
9367
|
+
classNames
|
|
9368
|
+
}) => {
|
|
9369
|
+
const [isOpen, setIsOpen] = (0, import_react16.useState)(false);
|
|
9370
|
+
const handleOpen = () => {
|
|
9371
|
+
setIsOpen(true);
|
|
9372
|
+
};
|
|
9373
|
+
const handleOpenChange = (nextOpen) => {
|
|
9374
|
+
setIsOpen(nextOpen);
|
|
9375
|
+
};
|
|
9376
|
+
const handleClose = () => {
|
|
9377
|
+
setIsOpen(false);
|
|
9378
|
+
};
|
|
9379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
9380
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9381
|
+
"div",
|
|
9382
|
+
{
|
|
9383
|
+
className: cn(
|
|
9384
|
+
"fixed inset-x-0 bottom-0 z-20 flex justify-end p-4 lg:hidden",
|
|
9385
|
+
classNames == null ? void 0 : classNames.mobileTradeCta
|
|
9386
|
+
),
|
|
9387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9388
|
+
Button,
|
|
9389
|
+
{
|
|
9390
|
+
size: "large",
|
|
9391
|
+
className: "min-w-[168px] shadow-agg-modal",
|
|
9392
|
+
"aria-label": placeOrder.actionLabel,
|
|
9393
|
+
"data-testid": "event-market-page-mobile-trade-cta",
|
|
9394
|
+
onClick: (e) => {
|
|
9395
|
+
e.stopPropagation();
|
|
9396
|
+
e.preventDefault();
|
|
9397
|
+
handleOpen();
|
|
9398
|
+
},
|
|
9399
|
+
children: placeOrder.actionLabel
|
|
9400
|
+
}
|
|
9401
|
+
)
|
|
9402
|
+
}
|
|
9403
|
+
),
|
|
9404
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Modal, { open: isOpen, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9405
|
+
Modal.Container,
|
|
9406
|
+
{
|
|
9407
|
+
"aria-label": placeOrder.title,
|
|
9408
|
+
maxWidth: "420px",
|
|
9409
|
+
classNames: {
|
|
9410
|
+
content: "items-end p-0 sm:items-center sm:p-4",
|
|
9411
|
+
container: cn(
|
|
9412
|
+
"w-full max-w-[420px] border-0 bg-transparent shadow-none",
|
|
9413
|
+
classNames == null ? void 0 : classNames.mobileTradeModal
|
|
9414
|
+
)
|
|
9415
|
+
},
|
|
9416
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9417
|
+
PlaceOrder,
|
|
9418
|
+
__spreadProps(__spreadValues({}, placeOrder), {
|
|
9419
|
+
isDismissible: true,
|
|
9420
|
+
className: cn("w-full rounded-t-agg-2xl sm:rounded-agg-xl", classNames == null ? void 0 : classNames.mobileTrade),
|
|
9421
|
+
onClose: handleClose
|
|
9422
|
+
})
|
|
9423
|
+
)
|
|
9424
|
+
}
|
|
9425
|
+
) })
|
|
9426
|
+
] });
|
|
9427
|
+
};
|
|
9242
9428
|
var EventMarketPageUnavailableState = ({
|
|
9243
9429
|
ariaLabel
|
|
9244
9430
|
}) => {
|
|
@@ -9288,46 +9474,66 @@ var EventMarketPageLoadingState = ({
|
|
|
9288
9474
|
}
|
|
9289
9475
|
]
|
|
9290
9476
|
};
|
|
9291
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("section", { className: cn("w-full pb-24 lg:pb-0", classNames == null ? void 0 : classNames.root), children: [
|
|
9478
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
9479
|
+
"div",
|
|
9480
|
+
{
|
|
9481
|
+
className: cn(
|
|
9482
|
+
"mx-auto flex w-full max-w-[1200px] flex-col gap-6 px-3 py-3 md:px-6 md:py-6 lg:flex-row lg:items-start lg:gap-8",
|
|
9483
|
+
classNames == null ? void 0 : classNames.content
|
|
9484
|
+
),
|
|
9485
|
+
children: [
|
|
9486
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: cn("flex min-w-0 flex-1 flex-col gap-6", classNames == null ? void 0 : classNames.main), children: [
|
|
9487
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9488
|
+
EventListItemDetails,
|
|
9489
|
+
{
|
|
9490
|
+
isLoading: true,
|
|
9491
|
+
classNames: {
|
|
9492
|
+
root: classNames == null ? void 0 : classNames.hero
|
|
9493
|
+
}
|
|
9306
9494
|
}
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9495
|
+
),
|
|
9496
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: cn("flex flex-col gap-3", classNames == null ? void 0 : classNames.markets), children: [
|
|
9497
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(MarketDetails, { isLoading: true, isOpened: true, classNames: { root: "w-full" } }),
|
|
9498
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(MarketDetails, { isLoading: true, isOpened: false, classNames: { root: "w-full" } }),
|
|
9499
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(MarketDetails, { isLoading: true, isOpened: false, classNames: { root: "w-full" } })
|
|
9500
|
+
] }),
|
|
9501
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Settlement, __spreadProps(__spreadValues({}, fallbackSettlement), { isLoading: true, className: classNames == null ? void 0 : classNames.settlement })) }),
|
|
9502
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Settlement, __spreadProps(__spreadValues({}, fallbackSettlement), { isLoading: true, className: classNames == null ? void 0 : classNames.settlement })) })
|
|
9313
9503
|
] }),
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9504
|
+
placeOrder ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9505
|
+
"aside",
|
|
9506
|
+
{
|
|
9507
|
+
className: cn(
|
|
9508
|
+
"hidden w-full shrink-0 lg:sticky lg:top-6 lg:block lg:w-[343px]",
|
|
9509
|
+
classNames == null ? void 0 : classNames.sidebar
|
|
9510
|
+
),
|
|
9511
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(PlaceOrder, __spreadProps(__spreadValues({}, placeOrder), { isLoading: true, className: classNames == null ? void 0 : classNames.trade }))
|
|
9512
|
+
}
|
|
9513
|
+
) : null
|
|
9514
|
+
]
|
|
9515
|
+
}
|
|
9516
|
+
),
|
|
9517
|
+
placeOrder ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9518
|
+
"div",
|
|
9519
|
+
{
|
|
9520
|
+
className: cn(
|
|
9521
|
+
"fixed inset-x-0 bottom-0 z-20 flex justify-end p-4 lg:hidden",
|
|
9522
|
+
classNames == null ? void 0 : classNames.mobileTradeCta
|
|
9523
|
+
),
|
|
9524
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9525
|
+
Button,
|
|
9320
9526
|
{
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
children:
|
|
9527
|
+
size: "large",
|
|
9528
|
+
className: "min-w-[168px] shadow-agg-modal",
|
|
9529
|
+
"aria-label": placeOrder.actionLabel,
|
|
9530
|
+
disabled: true,
|
|
9531
|
+
children: placeOrder.actionLabel
|
|
9326
9532
|
}
|
|
9327
|
-
)
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
9533
|
+
)
|
|
9534
|
+
}
|
|
9535
|
+
) : null
|
|
9536
|
+
] });
|
|
9331
9537
|
};
|
|
9332
9538
|
var EventMarketPageContent = ({
|
|
9333
9539
|
event,
|
|
@@ -9377,60 +9583,78 @@ var EventMarketPageContent = ({
|
|
|
9377
9583
|
}
|
|
9378
9584
|
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(nextExpandedMarketId);
|
|
9379
9585
|
};
|
|
9380
|
-
if (!heroEvent || !event.
|
|
9586
|
+
if (!heroEvent || !event.venueMarkets.length) {
|
|
9381
9587
|
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(EventMarketPageUnavailableState, { ariaLabel });
|
|
9382
9588
|
}
|
|
9383
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.
|
|
9384
|
-
"
|
|
9589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
9590
|
+
"section",
|
|
9385
9591
|
{
|
|
9386
|
-
className: cn(
|
|
9387
|
-
|
|
9388
|
-
classNames == null ? void 0 : classNames.content
|
|
9389
|
-
),
|
|
9592
|
+
className: cn("w-full pb-24 lg:pb-0", classNames == null ? void 0 : classNames.root),
|
|
9593
|
+
"aria-label": ariaLabel != null ? ariaLabel : event.title,
|
|
9390
9594
|
children: [
|
|
9391
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
(0,
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9595
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
9596
|
+
"div",
|
|
9597
|
+
{
|
|
9598
|
+
className: cn(
|
|
9599
|
+
"mx-auto flex w-full max-w-[1200px] flex-row gap-6 px-3 py-3 md:px-6 md:py-6 lg:flex-row lg:items-start lg:gap-8",
|
|
9600
|
+
classNames == null ? void 0 : classNames.content
|
|
9601
|
+
),
|
|
9602
|
+
children: [
|
|
9603
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: cn("flex min-w-0 flex-1 flex-col gap-6", classNames == null ? void 0 : classNames.main), children: [
|
|
9604
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9605
|
+
EventListItemDetails,
|
|
9606
|
+
{
|
|
9607
|
+
event: heroEvent,
|
|
9608
|
+
defaultTimeRange: heroDefaultTimeRange,
|
|
9609
|
+
classNames: {
|
|
9610
|
+
root: classNames == null ? void 0 : classNames.hero
|
|
9611
|
+
}
|
|
9612
|
+
}
|
|
9613
|
+
),
|
|
9614
|
+
detailedMarkets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: cn("flex flex-col gap-3", classNames == null ? void 0 : classNames.markets), children: detailedMarkets.map((market) => {
|
|
9615
|
+
const isOpened = resolvedExpandedMarketId === market.id;
|
|
9616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9617
|
+
MarketDetails,
|
|
9618
|
+
{
|
|
9619
|
+
venueMarkets: [market],
|
|
9620
|
+
isOpened,
|
|
9621
|
+
defaultTab: "order-book",
|
|
9622
|
+
ariaLabel: market.endDate && (0, import_dayjs6.default)(market.endDate).isValid() ? labels.eventMarketPage.marketDetailsAriaByDate(
|
|
9623
|
+
(0, import_dayjs6.default)(market.endDate).format("MMM D, YYYY")
|
|
9624
|
+
) : labels.eventMarketPage.marketDetailsAriaByQuestion(market.question),
|
|
9625
|
+
onOpenChange: (nextIsOpened) => handleExpandedMarketChange(market.id, nextIsOpened)
|
|
9626
|
+
},
|
|
9627
|
+
market.id
|
|
9628
|
+
);
|
|
9629
|
+
}) }) : null,
|
|
9630
|
+
settlement ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Settlement, __spreadProps(__spreadValues({}, settlement), { className: classNames == null ? void 0 : classNames.settlement })) }) : null,
|
|
9631
|
+
settlement ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Settlement, __spreadProps(__spreadValues({}, settlement), { className: classNames == null ? void 0 : classNames.settlement })) }) : null
|
|
9632
|
+
] }),
|
|
9633
|
+
placeOrder ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
9634
|
+
"aside",
|
|
9635
|
+
{
|
|
9636
|
+
className: cn("hidden w-full lg:block lg:max-w-[360px]", classNames == null ? void 0 : classNames.sidebar),
|
|
9637
|
+
"data-testid": "event-market-page-desktop-trade",
|
|
9638
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(PlaceOrder, __spreadProps(__spreadValues({}, placeOrder), { className: classNames == null ? void 0 : classNames.trade }))
|
|
9639
|
+
}
|
|
9640
|
+
) : null
|
|
9641
|
+
]
|
|
9642
|
+
}
|
|
9643
|
+
),
|
|
9644
|
+
placeOrder ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(EventMarketPageMobileTrade, { placeOrder, classNames }) : null
|
|
9423
9645
|
]
|
|
9424
9646
|
}
|
|
9425
|
-
)
|
|
9647
|
+
);
|
|
9426
9648
|
};
|
|
9427
9649
|
var EventMarketPage = (props) => {
|
|
9650
|
+
var _a;
|
|
9428
9651
|
const hasEventProp = "event" in props && !!props.event;
|
|
9429
9652
|
const {
|
|
9430
9653
|
event: fetchedEvent,
|
|
9431
9654
|
error: eventError,
|
|
9432
9655
|
isLoading: isFetchingEvent
|
|
9433
|
-
} = (0, import_hooks30.
|
|
9656
|
+
} = (0, import_hooks30.useVenueEvent)({
|
|
9657
|
+
eventId: hasEventProp ? "" : (_a = props.eventId) != null ? _a : "",
|
|
9434
9658
|
enabled: !props.isLoading && !hasEventProp && !!props.eventId
|
|
9435
9659
|
});
|
|
9436
9660
|
if (props.isLoading) {
|
|
@@ -10732,20 +10956,460 @@ var DepositModal = ({
|
|
|
10732
10956
|
};
|
|
10733
10957
|
DepositModal.displayName = "DepositModal";
|
|
10734
10958
|
|
|
10735
|
-
// src/
|
|
10959
|
+
// src/onramp/index.tsx
|
|
10960
|
+
var import_react24 = require("react");
|
|
10961
|
+
|
|
10962
|
+
// src/onramp/steps/quote-form.tsx
|
|
10963
|
+
var import_react22 = require("react");
|
|
10964
|
+
|
|
10965
|
+
// src/onramp/onramp-modal.constants.ts
|
|
10966
|
+
var FIAT_OPTIONS = [
|
|
10967
|
+
{ value: "USD", label: "USD" },
|
|
10968
|
+
{ value: "EUR", label: "EUR" },
|
|
10969
|
+
{ value: "GBP", label: "GBP" }
|
|
10970
|
+
];
|
|
10971
|
+
var FIAT_SYMBOLS = {
|
|
10972
|
+
USD: "$",
|
|
10973
|
+
EUR: "\u20AC",
|
|
10974
|
+
GBP: "\xA3"
|
|
10975
|
+
};
|
|
10976
|
+
var CRYPTO_OPTIONS = [
|
|
10977
|
+
{ value: "USDC", label: "USDC (Ethereum)" },
|
|
10978
|
+
{ value: "USDC_BASE", label: "USDC (Base)" },
|
|
10979
|
+
{ value: "USDC_SOLANA", label: "USDC (Solana)" },
|
|
10980
|
+
{ value: "USDC_POLYGON", label: "USDC (Polygon)" },
|
|
10981
|
+
{ value: "USDC_ARBITRUM", label: "USDC (Arbitrum)" }
|
|
10982
|
+
];
|
|
10983
|
+
|
|
10984
|
+
// src/onramp/steps/quote-form.tsx
|
|
10985
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
10986
|
+
var QuoteFormStep = ({
|
|
10987
|
+
title,
|
|
10988
|
+
values,
|
|
10989
|
+
onAmountChange,
|
|
10990
|
+
onFiatChange,
|
|
10991
|
+
onCryptoChange,
|
|
10992
|
+
onWalletAddressChange,
|
|
10993
|
+
onSubmit
|
|
10994
|
+
}) => {
|
|
10995
|
+
var _a;
|
|
10996
|
+
const numericAmount = Number(values.amount) || 0;
|
|
10997
|
+
const isFormValid = numericAmount > 0 && values.walletAddress.length > 0;
|
|
10998
|
+
const handleAmountChange = (0, import_react22.useCallback)(
|
|
10999
|
+
(e) => {
|
|
11000
|
+
const v = e.target.value.replace(/[^0-9.]/g, "");
|
|
11001
|
+
const parts = v.split(".");
|
|
11002
|
+
onAmountChange(parts.length > 2 ? `${parts[0]}.${parts.slice(1).join("")}` : v);
|
|
11003
|
+
},
|
|
11004
|
+
[onAmountChange]
|
|
11005
|
+
);
|
|
11006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
|
|
11007
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Modal.Header, { title, hideBorder: true }),
|
|
11008
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
11009
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
11010
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: "You pay" }),
|
|
11011
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
11012
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
11013
|
+
Select,
|
|
11014
|
+
{
|
|
11015
|
+
items: FIAT_OPTIONS,
|
|
11016
|
+
value: values.fiatCurrency,
|
|
11017
|
+
onChange: onFiatChange,
|
|
11018
|
+
ariaLabel: "Fiat currency",
|
|
11019
|
+
className: "w-auto"
|
|
11020
|
+
}
|
|
11021
|
+
) }),
|
|
11022
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex items-baseline", children: [
|
|
11023
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "agg-type-display text-agg-foreground", children: (_a = FIAT_SYMBOLS[values.fiatCurrency]) != null ? _a : "$" }),
|
|
11024
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
11025
|
+
"input",
|
|
11026
|
+
{
|
|
11027
|
+
type: "text",
|
|
11028
|
+
inputMode: "decimal",
|
|
11029
|
+
"aria-label": "Amount",
|
|
11030
|
+
className: cn(
|
|
11031
|
+
"agg-type-display w-full bg-transparent outline-none",
|
|
11032
|
+
numericAmount > 0 ? "text-agg-foreground" : "text-agg-muted-foreground"
|
|
11033
|
+
),
|
|
11034
|
+
placeholder: "0",
|
|
11035
|
+
value: values.amount ? formatAmountDisplay(values.amount) : "",
|
|
11036
|
+
onChange: handleAmountChange
|
|
11037
|
+
}
|
|
11038
|
+
)
|
|
11039
|
+
] }) })
|
|
11040
|
+
] })
|
|
11041
|
+
] }),
|
|
11042
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "border-t border-agg-separator" }),
|
|
11043
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
11044
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: "You receive" }),
|
|
11045
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
11046
|
+
Select,
|
|
11047
|
+
{
|
|
11048
|
+
items: CRYPTO_OPTIONS,
|
|
11049
|
+
value: values.cryptoCurrency,
|
|
11050
|
+
onChange: onCryptoChange,
|
|
11051
|
+
ariaLabel: "Cryptocurrency"
|
|
11052
|
+
}
|
|
11053
|
+
)
|
|
11054
|
+
] }),
|
|
11055
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "border-t border-agg-separator" }),
|
|
11056
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
11057
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: "Destination wallet" }),
|
|
11058
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
11059
|
+
"input",
|
|
11060
|
+
{
|
|
11061
|
+
type: "text",
|
|
11062
|
+
"aria-label": "Wallet address",
|
|
11063
|
+
className: cn(
|
|
11064
|
+
"w-full rounded-agg-md border border-agg-separator bg-agg-secondary",
|
|
11065
|
+
"px-4 py-2 font-agg-sans text-agg-sm leading-agg-5 text-agg-foreground outline-none",
|
|
11066
|
+
"placeholder:text-agg-muted-foreground",
|
|
11067
|
+
"transition-[border-color,box-shadow] duration-200 ease-in-out",
|
|
11068
|
+
"focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15"
|
|
11069
|
+
),
|
|
11070
|
+
placeholder: "0x...",
|
|
11071
|
+
value: values.walletAddress,
|
|
11072
|
+
onChange: (e) => onWalletAddressChange(e.target.value)
|
|
11073
|
+
}
|
|
11074
|
+
)
|
|
11075
|
+
] }),
|
|
11076
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
11077
|
+
Button,
|
|
11078
|
+
{
|
|
11079
|
+
variant: "primary",
|
|
11080
|
+
size: "large",
|
|
11081
|
+
className: "w-full",
|
|
11082
|
+
disabled: !isFormValid,
|
|
11083
|
+
onClick: onSubmit,
|
|
11084
|
+
children: "Get Quotes"
|
|
11085
|
+
}
|
|
11086
|
+
)
|
|
11087
|
+
] }) })
|
|
11088
|
+
] });
|
|
11089
|
+
};
|
|
11090
|
+
|
|
11091
|
+
// src/onramp/steps/quote-card.tsx
|
|
11092
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
11093
|
+
var QuoteCard = ({ quote, rank, onSelect }) => {
|
|
11094
|
+
var _a;
|
|
11095
|
+
const isBest = rank === 1;
|
|
11096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
|
|
11097
|
+
"div",
|
|
11098
|
+
{
|
|
11099
|
+
className: cn(
|
|
11100
|
+
"flex items-center gap-3 sm:gap-4",
|
|
11101
|
+
"rounded-xl border",
|
|
11102
|
+
"p-3 sm:p-4",
|
|
11103
|
+
"transition-colors cursor-pointer",
|
|
11104
|
+
isBest ? "border-agg-primary bg-agg-primary/5 hover:bg-agg-primary/10" : "border-agg-separator hover:bg-agg-secondary-hover"
|
|
11105
|
+
),
|
|
11106
|
+
role: "button",
|
|
11107
|
+
tabIndex: 0,
|
|
11108
|
+
onClick: onSelect,
|
|
11109
|
+
onKeyDown: (e) => {
|
|
11110
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
11111
|
+
e.preventDefault();
|
|
11112
|
+
onSelect();
|
|
11113
|
+
}
|
|
11114
|
+
},
|
|
11115
|
+
children: [
|
|
11116
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
11117
|
+
"div",
|
|
11118
|
+
{
|
|
11119
|
+
className: cn(
|
|
11120
|
+
"shrink-0 flex items-center justify-center h-10 w-10 rounded-lg",
|
|
11121
|
+
isBest ? "bg-agg-primary/10" : "bg-agg-secondary-hover"
|
|
11122
|
+
),
|
|
11123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
11124
|
+
"span",
|
|
11125
|
+
{
|
|
11126
|
+
className: cn(
|
|
11127
|
+
"text-agg-lg font-agg-bold",
|
|
11128
|
+
isBest ? "text-agg-primary" : "text-agg-muted-foreground"
|
|
11129
|
+
),
|
|
11130
|
+
children: rank
|
|
11131
|
+
}
|
|
11132
|
+
)
|
|
11133
|
+
}
|
|
11134
|
+
),
|
|
11135
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
11136
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11137
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)("p", { className: "agg-type-body-strong text-agg-foreground", children: quote.serviceProvider }),
|
|
11138
|
+
isBest ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
11139
|
+
Badge,
|
|
11140
|
+
{
|
|
11141
|
+
text: "Best",
|
|
11142
|
+
size: "small",
|
|
11143
|
+
classNames: { root: "bg-agg-primary! text-white! border-agg-primary!" }
|
|
11144
|
+
}
|
|
11145
|
+
) : null,
|
|
11146
|
+
quote.lowKyc ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Badge, { text: "Low KYC", size: "small" }) : null
|
|
11147
|
+
] }),
|
|
11148
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex items-center gap-2 mt-0.5", children: [
|
|
11149
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
11150
|
+
quote.destinationAmount.toFixed(6),
|
|
11151
|
+
" ",
|
|
11152
|
+
quote.destinationCurrencyCode.split("_")[0]
|
|
11153
|
+
] }),
|
|
11154
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "text-agg-muted-foreground", children: "\xB7" }),
|
|
11155
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
11156
|
+
"Fee ",
|
|
11157
|
+
(_a = FIAT_SYMBOLS[quote.sourceCurrencyCode]) != null ? _a : "",
|
|
11158
|
+
quote.totalFee.toFixed(2)
|
|
11159
|
+
] })
|
|
11160
|
+
] })
|
|
11161
|
+
] }),
|
|
11162
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
11163
|
+
Button,
|
|
11164
|
+
{
|
|
11165
|
+
variant: "secondary",
|
|
11166
|
+
size: "small",
|
|
11167
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ChevronRightIcon, {}),
|
|
11168
|
+
onClick: (e) => {
|
|
11169
|
+
e.stopPropagation();
|
|
11170
|
+
onSelect();
|
|
11171
|
+
},
|
|
11172
|
+
children: "Select"
|
|
11173
|
+
}
|
|
11174
|
+
) })
|
|
11175
|
+
]
|
|
11176
|
+
}
|
|
11177
|
+
);
|
|
11178
|
+
};
|
|
11179
|
+
|
|
11180
|
+
// src/onramp/steps/quote-selection.tsx
|
|
11181
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
11182
|
+
var BACK_BUTTON_CLASS = "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80";
|
|
11183
|
+
var BackButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("button", { type: "button", className: BACK_BUTTON_CLASS, onClick, "aria-label": "Go back", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ChevronLeftIcon, { className: "h-6 w-6" }) });
|
|
11184
|
+
var QuoteSelectionStep = ({
|
|
11185
|
+
quotes,
|
|
11186
|
+
isLoading,
|
|
11187
|
+
error,
|
|
11188
|
+
fiatCurrency,
|
|
11189
|
+
cryptoCurrency,
|
|
11190
|
+
amount,
|
|
11191
|
+
onBack,
|
|
11192
|
+
onSelectQuote,
|
|
11193
|
+
onRetry
|
|
11194
|
+
}) => {
|
|
11195
|
+
var _a;
|
|
11196
|
+
const subtitle = `${cryptoCurrency.split("_")[0]} \xB7 ${(_a = FIAT_SYMBOLS[fiatCurrency]) != null ? _a : ""}${amount.toLocaleString()} ${fiatCurrency}`;
|
|
11197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_jsx_runtime109.Fragment, { children: [
|
|
11198
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
11199
|
+
Modal.Header,
|
|
11200
|
+
{
|
|
11201
|
+
title: "Select Provider",
|
|
11202
|
+
subtitle,
|
|
11203
|
+
hideBorder: true,
|
|
11204
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(BackButton, { onClick: onBack })
|
|
11205
|
+
}
|
|
11206
|
+
),
|
|
11207
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: [
|
|
11208
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "flex min-h-[240px] items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(LoadingIcon, { size: "large" }) }) : null,
|
|
11209
|
+
!isLoading && error ? /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
11210
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(InlineAlert, { tone: "error", message: error }),
|
|
11211
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Button, { variant: "secondary", size: "medium", className: "w-full", onClick: onRetry, children: "Retry" })
|
|
11212
|
+
] }) : null,
|
|
11213
|
+
!isLoading && !error && quotes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
11214
|
+
StateMessage,
|
|
11215
|
+
{
|
|
11216
|
+
tone: "empty",
|
|
11217
|
+
title: "No quotes available",
|
|
11218
|
+
description: "No providers returned quotes for this pair. Try a different amount or cryptocurrency.",
|
|
11219
|
+
actionLabel: "Go back",
|
|
11220
|
+
onAction: onBack
|
|
11221
|
+
}
|
|
11222
|
+
) : null,
|
|
11223
|
+
!isLoading && quotes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "flex flex-col gap-3", children: quotes.map((quote, i) => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
11224
|
+
QuoteCard,
|
|
11225
|
+
{
|
|
11226
|
+
quote,
|
|
11227
|
+
rank: i + 1,
|
|
11228
|
+
onSelect: () => onSelectQuote(quote)
|
|
11229
|
+
},
|
|
11230
|
+
`${quote.serviceProvider}-${quote.paymentMethodType}`
|
|
11231
|
+
)) }) : null
|
|
11232
|
+
] })
|
|
11233
|
+
] });
|
|
11234
|
+
};
|
|
11235
|
+
|
|
11236
|
+
// src/onramp/steps/widget.tsx
|
|
10736
11237
|
var import_react23 = require("react");
|
|
11238
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
11239
|
+
var BACK_BUTTON_CLASS2 = "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80";
|
|
11240
|
+
var BackButton2 = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("button", { type: "button", className: BACK_BUTTON_CLASS2, onClick, "aria-label": "Go back", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(ChevronLeftIcon, { className: "h-6 w-6" }) });
|
|
11241
|
+
var WidgetStep = ({ widgetUrl, isLoading, onBack }) => {
|
|
11242
|
+
const iframeRef = (0, import_react23.useRef)(null);
|
|
11243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(import_jsx_runtime110.Fragment, { children: [
|
|
11244
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
11245
|
+
Modal.Header,
|
|
11246
|
+
{
|
|
11247
|
+
title: "Complete Purchase",
|
|
11248
|
+
hideBorder: true,
|
|
11249
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(BackButton2, { onClick: onBack })
|
|
11250
|
+
}
|
|
11251
|
+
),
|
|
11252
|
+
/* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(Modal.Body, { classNames: { root: "p-0! sm:p-0! overflow-hidden" }, children: [
|
|
11253
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: "flex min-h-[400px] items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(LoadingIcon, { size: "large" }) }) : null,
|
|
11254
|
+
widgetUrl ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
11255
|
+
"iframe",
|
|
11256
|
+
{
|
|
11257
|
+
ref: iframeRef,
|
|
11258
|
+
src: widgetUrl,
|
|
11259
|
+
title: "Meld payment widget",
|
|
11260
|
+
className: "h-[700px] w-full border-0 block",
|
|
11261
|
+
allow: "camera; microphone; payment; encrypted-media"
|
|
11262
|
+
}
|
|
11263
|
+
) : null
|
|
11264
|
+
] })
|
|
11265
|
+
] });
|
|
11266
|
+
};
|
|
11267
|
+
|
|
11268
|
+
// src/onramp/index.tsx
|
|
11269
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
11270
|
+
var OnrampModal = ({
|
|
11271
|
+
open,
|
|
11272
|
+
onOpenChange,
|
|
11273
|
+
transactionType,
|
|
11274
|
+
walletAddress: initialWalletAddress = "",
|
|
11275
|
+
defaultFiatCurrency = "USD",
|
|
11276
|
+
defaultCryptoCurrency = "USDC",
|
|
11277
|
+
onGetQuotes,
|
|
11278
|
+
onSelectQuote
|
|
11279
|
+
}) => {
|
|
11280
|
+
const [step, setStep] = (0, import_react24.useState)("form");
|
|
11281
|
+
const [formValues, setFormValues] = (0, import_react24.useState)({
|
|
11282
|
+
amount: "",
|
|
11283
|
+
fiatCurrency: defaultFiatCurrency,
|
|
11284
|
+
cryptoCurrency: defaultCryptoCurrency,
|
|
11285
|
+
walletAddress: initialWalletAddress
|
|
11286
|
+
});
|
|
11287
|
+
const [quotes, setQuotes] = (0, import_react24.useState)([]);
|
|
11288
|
+
const [isLoadingQuotes, setIsLoadingQuotes] = (0, import_react24.useState)(false);
|
|
11289
|
+
const [quoteError, setQuoteError] = (0, import_react24.useState)(null);
|
|
11290
|
+
const [widgetUrl, setWidgetUrl] = (0, import_react24.useState)(null);
|
|
11291
|
+
const [isCreatingSession, setIsCreatingSession] = (0, import_react24.useState)(false);
|
|
11292
|
+
const handleOpenChange = (0, import_react24.useCallback)(
|
|
11293
|
+
(isOpen) => {
|
|
11294
|
+
if (!isOpen) {
|
|
11295
|
+
setStep("form");
|
|
11296
|
+
setQuotes([]);
|
|
11297
|
+
setQuoteError(null);
|
|
11298
|
+
setWidgetUrl(null);
|
|
11299
|
+
}
|
|
11300
|
+
onOpenChange(isOpen);
|
|
11301
|
+
},
|
|
11302
|
+
[onOpenChange]
|
|
11303
|
+
);
|
|
11304
|
+
const handleGetQuotes = (0, import_react24.useCallback)(() => __async(void 0, null, function* () {
|
|
11305
|
+
const numericAmount2 = Number(formValues.amount);
|
|
11306
|
+
if (!numericAmount2 || numericAmount2 <= 0)
|
|
11307
|
+
return;
|
|
11308
|
+
setStep("quotes");
|
|
11309
|
+
setIsLoadingQuotes(true);
|
|
11310
|
+
setQuoteError(null);
|
|
11311
|
+
try {
|
|
11312
|
+
const result = yield onGetQuotes({
|
|
11313
|
+
transactionType,
|
|
11314
|
+
sourceAmount: numericAmount2,
|
|
11315
|
+
sourceCurrencyCode: formValues.fiatCurrency,
|
|
11316
|
+
destinationCurrencyCode: formValues.cryptoCurrency,
|
|
11317
|
+
countryCode: "US"
|
|
11318
|
+
});
|
|
11319
|
+
setQuotes(result);
|
|
11320
|
+
} catch (err) {
|
|
11321
|
+
setQuoteError(err instanceof Error ? err.message : "Failed to fetch quotes");
|
|
11322
|
+
} finally {
|
|
11323
|
+
setIsLoadingQuotes(false);
|
|
11324
|
+
}
|
|
11325
|
+
}), [formValues, transactionType, onGetQuotes]);
|
|
11326
|
+
const handleSelectQuote = (0, import_react24.useCallback)(
|
|
11327
|
+
(quote) => __async(void 0, null, function* () {
|
|
11328
|
+
setStep("widget");
|
|
11329
|
+
setIsCreatingSession(true);
|
|
11330
|
+
try {
|
|
11331
|
+
const session = yield onSelectQuote({
|
|
11332
|
+
transactionType,
|
|
11333
|
+
serviceProvider: quote.serviceProvider,
|
|
11334
|
+
sourceAmount: quote.sourceAmount,
|
|
11335
|
+
sourceCurrencyCode: quote.sourceCurrencyCode,
|
|
11336
|
+
destinationCurrencyCode: quote.destinationCurrencyCode,
|
|
11337
|
+
countryCode: quote.countryCode,
|
|
11338
|
+
walletAddress: formValues.walletAddress
|
|
11339
|
+
});
|
|
11340
|
+
setWidgetUrl(session.serviceProviderWidgetUrl);
|
|
11341
|
+
} catch (e) {
|
|
11342
|
+
setStep("quotes");
|
|
11343
|
+
} finally {
|
|
11344
|
+
setIsCreatingSession(false);
|
|
11345
|
+
}
|
|
11346
|
+
}),
|
|
11347
|
+
[transactionType, formValues.walletAddress, onSelectQuote]
|
|
11348
|
+
);
|
|
11349
|
+
const numericAmount = Number(formValues.amount) || 0;
|
|
11350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
11351
|
+
Modal.Container,
|
|
11352
|
+
{
|
|
11353
|
+
maxWidth: "520px",
|
|
11354
|
+
"aria-label": transactionType === "BUY" ? "Buy Crypto" : "Sell Crypto",
|
|
11355
|
+
children: [
|
|
11356
|
+
step === "form" ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
11357
|
+
QuoteFormStep,
|
|
11358
|
+
{
|
|
11359
|
+
title: transactionType === "BUY" ? "Buy Crypto" : "Sell Crypto",
|
|
11360
|
+
values: formValues,
|
|
11361
|
+
onAmountChange: (amount) => setFormValues((prev) => __spreadProps(__spreadValues({}, prev), { amount })),
|
|
11362
|
+
onFiatChange: (fiatCurrency) => setFormValues((prev) => __spreadProps(__spreadValues({}, prev), { fiatCurrency })),
|
|
11363
|
+
onCryptoChange: (cryptoCurrency) => setFormValues((prev) => __spreadProps(__spreadValues({}, prev), { cryptoCurrency })),
|
|
11364
|
+
onWalletAddressChange: (walletAddress) => setFormValues((prev) => __spreadProps(__spreadValues({}, prev), { walletAddress })),
|
|
11365
|
+
onSubmit: handleGetQuotes
|
|
11366
|
+
}
|
|
11367
|
+
) : null,
|
|
11368
|
+
step === "quotes" ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
11369
|
+
QuoteSelectionStep,
|
|
11370
|
+
{
|
|
11371
|
+
quotes,
|
|
11372
|
+
isLoading: isLoadingQuotes,
|
|
11373
|
+
error: quoteError,
|
|
11374
|
+
fiatCurrency: formValues.fiatCurrency,
|
|
11375
|
+
cryptoCurrency: formValues.cryptoCurrency,
|
|
11376
|
+
amount: numericAmount,
|
|
11377
|
+
onBack: () => setStep("form"),
|
|
11378
|
+
onSelectQuote: handleSelectQuote,
|
|
11379
|
+
onRetry: handleGetQuotes
|
|
11380
|
+
}
|
|
11381
|
+
) : null,
|
|
11382
|
+
step === "widget" ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
11383
|
+
WidgetStep,
|
|
11384
|
+
{
|
|
11385
|
+
widgetUrl,
|
|
11386
|
+
isLoading: isCreatingSession,
|
|
11387
|
+
onBack: () => {
|
|
11388
|
+
setWidgetUrl(null);
|
|
11389
|
+
setStep("quotes");
|
|
11390
|
+
}
|
|
11391
|
+
}
|
|
11392
|
+
) : null
|
|
11393
|
+
]
|
|
11394
|
+
}
|
|
11395
|
+
) });
|
|
11396
|
+
};
|
|
11397
|
+
OnrampModal.displayName = "OnrampModal";
|
|
11398
|
+
|
|
11399
|
+
// src/withdraw/index.tsx
|
|
11400
|
+
var import_react26 = require("react");
|
|
10737
11401
|
|
|
10738
11402
|
// src/withdraw/withdraw-modal.constants.ts
|
|
10739
11403
|
var KALSHI_VENUE3 = "kalshi";
|
|
10740
11404
|
var KALSHI_WITHDRAW_URL_DEFAULT = "https://kalshi.com/account/withdraw";
|
|
10741
11405
|
|
|
10742
11406
|
// src/withdraw/steps/venue-selection.tsx
|
|
10743
|
-
var
|
|
11407
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
10744
11408
|
var VenueRow2 = ({ venue, onSelect }) => {
|
|
10745
11409
|
var _a, _b;
|
|
10746
11410
|
const displayName = (_a = venueLogoLabels[venue.venue]) != null ? _a : venue.venue;
|
|
10747
11411
|
const isDisabled = venue.disabled === true;
|
|
10748
|
-
return /* @__PURE__ */ (0,
|
|
11412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
|
|
10749
11413
|
"div",
|
|
10750
11414
|
{
|
|
10751
11415
|
className: cn(
|
|
@@ -10758,7 +11422,9 @@ var VenueRow2 = ({ venue, onSelect }) => {
|
|
|
10758
11422
|
role: "button",
|
|
10759
11423
|
tabIndex: isDisabled ? -1 : 0,
|
|
10760
11424
|
"aria-disabled": isDisabled,
|
|
10761
|
-
onClick: () => {
|
|
11425
|
+
onClick: (e) => {
|
|
11426
|
+
e.stopPropagation();
|
|
11427
|
+
e.preventDefault();
|
|
10762
11428
|
if (!isDisabled)
|
|
10763
11429
|
onSelect(venue.venue);
|
|
10764
11430
|
},
|
|
@@ -10769,20 +11435,20 @@ var VenueRow2 = ({ venue, onSelect }) => {
|
|
|
10769
11435
|
}
|
|
10770
11436
|
},
|
|
10771
11437
|
children: [
|
|
10772
|
-
/* @__PURE__ */ (0,
|
|
10773
|
-
/* @__PURE__ */ (0,
|
|
10774
|
-
/* @__PURE__ */ (0,
|
|
10775
|
-
/* @__PURE__ */ (0,
|
|
11438
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(VenueLogo, { venue: venue.venue, size: "large", className: "rounded-lg" }) }),
|
|
11439
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
11440
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("p", { className: "agg-type-body-strong text-agg-foreground", children: displayName }),
|
|
11441
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
10776
11442
|
"Balance ",
|
|
10777
11443
|
formatCompactUsd(venue.balance)
|
|
10778
11444
|
] })
|
|
10779
11445
|
] }),
|
|
10780
|
-
isDisabled ? /* @__PURE__ */ (0,
|
|
11446
|
+
isDisabled ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "agg-type-label text-agg-muted-foreground", children: (_b = venue.disabledReason) != null ? _b : "Unavailable" }) }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
10781
11447
|
Button,
|
|
10782
11448
|
{
|
|
10783
11449
|
variant: "secondary",
|
|
10784
11450
|
size: "small",
|
|
10785
|
-
suffix: /* @__PURE__ */ (0,
|
|
11451
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ChevronRightIcon, {}),
|
|
10786
11452
|
onClick: (e) => {
|
|
10787
11453
|
e.stopPropagation();
|
|
10788
11454
|
onSelect(venue.venue);
|
|
@@ -10797,22 +11463,22 @@ var VenueRow2 = ({ venue, onSelect }) => {
|
|
|
10797
11463
|
var VenueSelectionStep2 = ({
|
|
10798
11464
|
venues,
|
|
10799
11465
|
onSelectVenue
|
|
10800
|
-
}) => /* @__PURE__ */ (0,
|
|
10801
|
-
/* @__PURE__ */ (0,
|
|
10802
|
-
/* @__PURE__ */ (0,
|
|
10803
|
-
/* @__PURE__ */ (0,
|
|
10804
|
-
/* @__PURE__ */ (0,
|
|
11466
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_jsx_runtime112.Fragment, { children: [
|
|
11467
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Modal.Header, { title: "Withdraw", hideBorder: true }),
|
|
11468
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
11469
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("p", { className: "agg-type-body text-agg-foreground", children: "Choose where to withdraw funds from:" }),
|
|
11470
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: "flex flex-col gap-3", children: venues.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(VenueRow2, { venue, onSelect: onSelectVenue }, venue.venue)) })
|
|
10805
11471
|
] }) })
|
|
10806
11472
|
] });
|
|
10807
11473
|
|
|
10808
11474
|
// src/withdraw/steps/withdraw-method.tsx
|
|
10809
|
-
var
|
|
11475
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
10810
11476
|
var WithdrawMethodCard = ({
|
|
10811
11477
|
icon,
|
|
10812
11478
|
title,
|
|
10813
11479
|
description,
|
|
10814
11480
|
onContinue
|
|
10815
|
-
}) => /* @__PURE__ */ (0,
|
|
11481
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
|
|
10816
11482
|
"div",
|
|
10817
11483
|
{
|
|
10818
11484
|
className: cn(
|
|
@@ -10831,17 +11497,17 @@ var WithdrawMethodCard = ({
|
|
|
10831
11497
|
}
|
|
10832
11498
|
},
|
|
10833
11499
|
children: [
|
|
10834
|
-
/* @__PURE__ */ (0,
|
|
10835
|
-
/* @__PURE__ */ (0,
|
|
10836
|
-
/* @__PURE__ */ (0,
|
|
10837
|
-
/* @__PURE__ */ (0,
|
|
11500
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: icon }),
|
|
11501
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
11502
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("p", { className: "agg-type-body-strong text-agg-foreground", children: title }),
|
|
11503
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: description })
|
|
10838
11504
|
] }),
|
|
10839
|
-
/* @__PURE__ */ (0,
|
|
11505
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
10840
11506
|
Button,
|
|
10841
11507
|
{
|
|
10842
11508
|
variant: "secondary",
|
|
10843
11509
|
size: "small",
|
|
10844
|
-
suffix: /* @__PURE__ */ (0,
|
|
11510
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(ChevronRightIcon, {}),
|
|
10845
11511
|
onClick: (e) => {
|
|
10846
11512
|
e.stopPropagation();
|
|
10847
11513
|
onContinue();
|
|
@@ -10859,47 +11525,47 @@ var WithdrawMethodStep = ({
|
|
|
10859
11525
|
}) => {
|
|
10860
11526
|
var _a;
|
|
10861
11527
|
const displayName = (_a = venueLogoLabels[venue.venue]) != null ? _a : venue.venue;
|
|
10862
|
-
return /* @__PURE__ */ (0,
|
|
10863
|
-
/* @__PURE__ */ (0,
|
|
11528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
|
|
11529
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
10864
11530
|
Modal.Header,
|
|
10865
11531
|
{
|
|
10866
11532
|
title: `Withdraw from ${displayName}`,
|
|
10867
11533
|
hideBorder: true,
|
|
10868
|
-
leftElement: /* @__PURE__ */ (0,
|
|
11534
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
10869
11535
|
"button",
|
|
10870
11536
|
{
|
|
10871
11537
|
type: "button",
|
|
10872
11538
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
10873
11539
|
onClick: onBack,
|
|
10874
11540
|
"aria-label": "Go back",
|
|
10875
|
-
children: /* @__PURE__ */ (0,
|
|
11541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
10876
11542
|
}
|
|
10877
11543
|
)
|
|
10878
11544
|
}
|
|
10879
11545
|
),
|
|
10880
|
-
/* @__PURE__ */ (0,
|
|
10881
|
-
/* @__PURE__ */ (0,
|
|
10882
|
-
/* @__PURE__ */ (0,
|
|
10883
|
-
/* @__PURE__ */ (0,
|
|
11546
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
11547
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11548
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(VenueLogo, { venue: venue.venue, size: "small", className: "rounded-sm" }),
|
|
11549
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
10884
11550
|
displayName,
|
|
10885
11551
|
" balance: ",
|
|
10886
11552
|
formatCompactUsd(venue.balance)
|
|
10887
11553
|
] })
|
|
10888
11554
|
] }),
|
|
10889
|
-
/* @__PURE__ */ (0,
|
|
10890
|
-
/* @__PURE__ */ (0,
|
|
11555
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
11556
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
10891
11557
|
WithdrawMethodCard,
|
|
10892
11558
|
{
|
|
10893
|
-
icon: /* @__PURE__ */ (0,
|
|
11559
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(WalletIcon, { className: "h-6 w-6 text-agg-foreground" }),
|
|
10894
11560
|
title: "Withdraw to Wallet",
|
|
10895
11561
|
description: "Send funds to your crypto wallet as USDC.",
|
|
10896
11562
|
onContinue: () => onSelectMethod("wallet")
|
|
10897
11563
|
}
|
|
10898
11564
|
),
|
|
10899
|
-
/* @__PURE__ */ (0,
|
|
11565
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
10900
11566
|
WithdrawMethodCard,
|
|
10901
11567
|
{
|
|
10902
|
-
icon: /* @__PURE__ */ (0,
|
|
11568
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(BankIcon, { className: "h-6 w-6 text-agg-foreground" }),
|
|
10903
11569
|
title: "Withdraw to Bank",
|
|
10904
11570
|
description: "Transfer funds to your linked bank account.",
|
|
10905
11571
|
onContinue: () => onSelectMethod("bank")
|
|
@@ -10911,8 +11577,8 @@ var WithdrawMethodStep = ({
|
|
|
10911
11577
|
};
|
|
10912
11578
|
|
|
10913
11579
|
// src/withdraw/steps/withdraw-amount.tsx
|
|
10914
|
-
var
|
|
10915
|
-
var
|
|
11580
|
+
var import_react25 = require("react");
|
|
11581
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
10916
11582
|
var WithdrawAmountStep = ({
|
|
10917
11583
|
venue,
|
|
10918
11584
|
method,
|
|
@@ -10920,50 +11586,50 @@ var WithdrawAmountStep = ({
|
|
|
10920
11586
|
onContinue
|
|
10921
11587
|
}) => {
|
|
10922
11588
|
var _a;
|
|
10923
|
-
const [rawAmount, setRawAmount] = (0,
|
|
11589
|
+
const [rawAmount, setRawAmount] = (0, import_react25.useState)("");
|
|
10924
11590
|
const displayName = (_a = venueLogoLabels[venue.venue]) != null ? _a : venue.venue;
|
|
10925
11591
|
const numericAmount = Number(rawAmount) || 0;
|
|
10926
11592
|
const isValid = numericAmount > 0 && numericAmount <= venue.balance;
|
|
10927
11593
|
const exceedsBalance = numericAmount > venue.balance;
|
|
10928
11594
|
const methodLabel = method === "wallet" ? "Wallet" : "Bank";
|
|
10929
|
-
const handleAmountChange = (0,
|
|
11595
|
+
const handleAmountChange = (0, import_react25.useCallback)((e) => {
|
|
10930
11596
|
const v = e.target.value.replace(/[^0-9.]/g, "");
|
|
10931
11597
|
const parts = v.split(".");
|
|
10932
11598
|
const sanitized = parts.length > 2 ? `${parts[0]}.${parts.slice(1).join("")}` : v;
|
|
10933
11599
|
setRawAmount(sanitized);
|
|
10934
11600
|
}, []);
|
|
10935
|
-
const handleMax = (0,
|
|
11601
|
+
const handleMax = (0, import_react25.useCallback)(() => {
|
|
10936
11602
|
setRawAmount(venue.balance.toString());
|
|
10937
11603
|
}, [venue.balance]);
|
|
10938
|
-
return /* @__PURE__ */ (0,
|
|
10939
|
-
/* @__PURE__ */ (0,
|
|
11604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_jsx_runtime114.Fragment, { children: [
|
|
11605
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10940
11606
|
Modal.Header,
|
|
10941
11607
|
{
|
|
10942
11608
|
title: `Withdraw to ${methodLabel}`,
|
|
10943
11609
|
hideBorder: true,
|
|
10944
|
-
leftElement: /* @__PURE__ */ (0,
|
|
11610
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10945
11611
|
"button",
|
|
10946
11612
|
{
|
|
10947
11613
|
type: "button",
|
|
10948
11614
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
10949
11615
|
onClick: onBack,
|
|
10950
11616
|
"aria-label": "Go back",
|
|
10951
|
-
children: /* @__PURE__ */ (0,
|
|
11617
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
10952
11618
|
}
|
|
10953
11619
|
)
|
|
10954
11620
|
}
|
|
10955
11621
|
),
|
|
10956
|
-
/* @__PURE__ */ (0,
|
|
10957
|
-
/* @__PURE__ */ (0,
|
|
10958
|
-
/* @__PURE__ */ (0,
|
|
10959
|
-
/* @__PURE__ */ (0,
|
|
10960
|
-
/* @__PURE__ */ (0,
|
|
11622
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
11623
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
11624
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11625
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(VenueLogo, { venue: venue.venue, size: "small", className: "rounded-sm" }),
|
|
11626
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
10961
11627
|
displayName,
|
|
10962
11628
|
" balance: ",
|
|
10963
11629
|
formatCompactUsd(venue.balance)
|
|
10964
11630
|
] })
|
|
10965
11631
|
] }),
|
|
10966
|
-
/* @__PURE__ */ (0,
|
|
11632
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10967
11633
|
"button",
|
|
10968
11634
|
{
|
|
10969
11635
|
type: "button",
|
|
@@ -10973,10 +11639,10 @@ var WithdrawAmountStep = ({
|
|
|
10973
11639
|
}
|
|
10974
11640
|
)
|
|
10975
11641
|
] }),
|
|
10976
|
-
/* @__PURE__ */ (0,
|
|
10977
|
-
/* @__PURE__ */ (0,
|
|
10978
|
-
/* @__PURE__ */ (0,
|
|
10979
|
-
/* @__PURE__ */ (0,
|
|
11642
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
11643
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { className: "flex items-baseline", children: [
|
|
11644
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { className: "agg-type-display text-agg-foreground", children: "$" }),
|
|
11645
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10980
11646
|
"input",
|
|
10981
11647
|
{
|
|
10982
11648
|
type: "text",
|
|
@@ -10992,9 +11658,9 @@ var WithdrawAmountStep = ({
|
|
|
10992
11658
|
}
|
|
10993
11659
|
)
|
|
10994
11660
|
] }),
|
|
10995
|
-
exceedsBalance ? /* @__PURE__ */ (0,
|
|
11661
|
+
exceedsBalance ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("p", { className: "agg-type-label mt-2 text-agg-error", children: "Amount exceeds available balance" }) : null
|
|
10996
11662
|
] }),
|
|
10997
|
-
/* @__PURE__ */ (0,
|
|
11663
|
+
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
10998
11664
|
Button,
|
|
10999
11665
|
{
|
|
11000
11666
|
variant: "primary",
|
|
@@ -11010,30 +11676,30 @@ var WithdrawAmountStep = ({
|
|
|
11010
11676
|
};
|
|
11011
11677
|
|
|
11012
11678
|
// src/withdraw/steps/kalshi-withdraw.tsx
|
|
11013
|
-
var
|
|
11679
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
11014
11680
|
var KalshiStepCard2 = ({
|
|
11015
11681
|
step,
|
|
11016
11682
|
title,
|
|
11017
11683
|
description,
|
|
11018
11684
|
children
|
|
11019
|
-
}) => /* @__PURE__ */ (0,
|
|
11020
|
-
/* @__PURE__ */ (0,
|
|
11685
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: "flex flex-col gap-2 rounded-xl bg-agg-secondary-hover p-4", children: [
|
|
11686
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("p", { className: "agg-type-caption-caps text-agg-muted-foreground", children: [
|
|
11021
11687
|
"Step ",
|
|
11022
11688
|
step
|
|
11023
11689
|
] }),
|
|
11024
|
-
/* @__PURE__ */ (0,
|
|
11025
|
-
/* @__PURE__ */ (0,
|
|
11026
|
-
/* @__PURE__ */ (0,
|
|
11690
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
11691
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: title }),
|
|
11692
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("p", { className: "agg-type-label text-agg-foreground", children: description })
|
|
11027
11693
|
] }),
|
|
11028
11694
|
children
|
|
11029
11695
|
] });
|
|
11030
11696
|
var KalshiWithdrawStep = ({
|
|
11031
11697
|
withdrawUrl,
|
|
11032
11698
|
onDone
|
|
11033
|
-
}) => /* @__PURE__ */ (0,
|
|
11034
|
-
/* @__PURE__ */ (0,
|
|
11035
|
-
/* @__PURE__ */ (0,
|
|
11036
|
-
/* @__PURE__ */ (0,
|
|
11699
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_jsx_runtime115.Fragment, { children: [
|
|
11700
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Modal.Header, { title: "", hideBorder: true }),
|
|
11701
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: "flex flex-col items-center gap-8", children: [
|
|
11702
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
11037
11703
|
VenueLogo,
|
|
11038
11704
|
{
|
|
11039
11705
|
venue: "kalshi",
|
|
@@ -11041,23 +11707,23 @@ var KalshiWithdrawStep = ({
|
|
|
11041
11707
|
className: "h-[60px] w-[60px] rounded-lg"
|
|
11042
11708
|
}
|
|
11043
11709
|
),
|
|
11044
|
-
/* @__PURE__ */ (0,
|
|
11045
|
-
/* @__PURE__ */ (0,
|
|
11046
|
-
/* @__PURE__ */ (0,
|
|
11710
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: "flex flex-col items-center gap-4 text-center", children: [
|
|
11711
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("h2", { className: "agg-type-heading text-agg-foreground", children: "Withdraw from Kalshi" }),
|
|
11712
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)("p", { className: "agg-type-body text-agg-foreground", children: "To withdraw from Kalshi you'll need to initiate the withdrawal from your Kalshi account directly on Kalshi's site." })
|
|
11047
11713
|
] }),
|
|
11048
|
-
/* @__PURE__ */ (0,
|
|
11049
|
-
/* @__PURE__ */ (0,
|
|
11714
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: "flex w-full flex-col gap-4", children: [
|
|
11715
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
11050
11716
|
KalshiStepCard2,
|
|
11051
11717
|
{
|
|
11052
11718
|
step: 1,
|
|
11053
11719
|
title: "Open Kalshi Withdraw Page",
|
|
11054
11720
|
description: "Sign in to your Kalshi account and go to Withdraw from your account menu.",
|
|
11055
|
-
children: /* @__PURE__ */ (0,
|
|
11721
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "mt-1", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
11056
11722
|
Button,
|
|
11057
11723
|
{
|
|
11058
11724
|
variant: "secondary",
|
|
11059
11725
|
size: "small",
|
|
11060
|
-
suffix: /* @__PURE__ */ (0,
|
|
11726
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(ExternalLinkIcon, { className: "h-3.5 w-3.5" }),
|
|
11061
11727
|
onClick: () => {
|
|
11062
11728
|
window.open(withdrawUrl, "_blank", "noopener,noreferrer");
|
|
11063
11729
|
},
|
|
@@ -11066,7 +11732,7 @@ var KalshiWithdrawStep = ({
|
|
|
11066
11732
|
) })
|
|
11067
11733
|
}
|
|
11068
11734
|
),
|
|
11069
|
-
/* @__PURE__ */ (0,
|
|
11735
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
11070
11736
|
KalshiStepCard2,
|
|
11071
11737
|
{
|
|
11072
11738
|
step: 2,
|
|
@@ -11074,7 +11740,7 @@ var KalshiWithdrawStep = ({
|
|
|
11074
11740
|
description: "Select a withdrawal method: Bank transfer (ACH), Wire, or USDC (crypto)."
|
|
11075
11741
|
}
|
|
11076
11742
|
),
|
|
11077
|
-
/* @__PURE__ */ (0,
|
|
11743
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
11078
11744
|
KalshiStepCard2,
|
|
11079
11745
|
{
|
|
11080
11746
|
step: 3,
|
|
@@ -11083,12 +11749,12 @@ var KalshiWithdrawStep = ({
|
|
|
11083
11749
|
}
|
|
11084
11750
|
)
|
|
11085
11751
|
] }),
|
|
11086
|
-
/* @__PURE__ */ (0,
|
|
11752
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Button, { variant: "secondary", size: "large", onClick: onDone, children: "Done" })
|
|
11087
11753
|
] }) })
|
|
11088
11754
|
] });
|
|
11089
11755
|
|
|
11090
11756
|
// src/withdraw/index.tsx
|
|
11091
|
-
var
|
|
11757
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
11092
11758
|
var WithdrawModal = ({
|
|
11093
11759
|
open,
|
|
11094
11760
|
onOpenChange,
|
|
@@ -11100,9 +11766,9 @@ var WithdrawModal = ({
|
|
|
11100
11766
|
onDoneKalshi,
|
|
11101
11767
|
kalshiWithdrawUrl = KALSHI_WITHDRAW_URL_DEFAULT
|
|
11102
11768
|
}) => {
|
|
11103
|
-
const [step, setStep] = (0,
|
|
11104
|
-
const [selectedVenue, setSelectedVenue] = (0,
|
|
11105
|
-
const [selectedMethod, setSelectedMethod] = (0,
|
|
11769
|
+
const [step, setStep] = (0, import_react26.useState)("venues");
|
|
11770
|
+
const [selectedVenue, setSelectedVenue] = (0, import_react26.useState)(null);
|
|
11771
|
+
const [selectedMethod, setSelectedMethod] = (0, import_react26.useState)(null);
|
|
11106
11772
|
const handleSelectVenue = (venueSlug) => {
|
|
11107
11773
|
onSelectVenue(venueSlug);
|
|
11108
11774
|
if (venueSlug === KALSHI_VENUE3) {
|
|
@@ -11152,9 +11818,9 @@ var WithdrawModal = ({
|
|
|
11152
11818
|
}
|
|
11153
11819
|
onOpenChange(isOpen);
|
|
11154
11820
|
};
|
|
11155
|
-
return /* @__PURE__ */ (0,
|
|
11156
|
-
step === "venues" ? /* @__PURE__ */ (0,
|
|
11157
|
-
step === "method" && selectedVenue ? /* @__PURE__ */ (0,
|
|
11821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Modal.Container, { maxWidth: "600px", "aria-label": "Withdraw", children: [
|
|
11822
|
+
step === "venues" ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(VenueSelectionStep2, { venues, onSelectVenue: handleSelectVenue }) : null,
|
|
11823
|
+
step === "method" && selectedVenue ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
11158
11824
|
WithdrawMethodStep,
|
|
11159
11825
|
{
|
|
11160
11826
|
venue: selectedVenue,
|
|
@@ -11162,7 +11828,7 @@ var WithdrawModal = ({
|
|
|
11162
11828
|
onSelectMethod: handleSelectMethod
|
|
11163
11829
|
}
|
|
11164
11830
|
) : null,
|
|
11165
|
-
step === "withdraw-amount" && selectedVenue && selectedMethod ? /* @__PURE__ */ (0,
|
|
11831
|
+
step === "withdraw-amount" && selectedVenue && selectedMethod ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
11166
11832
|
WithdrawAmountStep,
|
|
11167
11833
|
{
|
|
11168
11834
|
venue: selectedVenue,
|
|
@@ -11171,13 +11837,13 @@ var WithdrawModal = ({
|
|
|
11171
11837
|
onContinue: handleContinueWithdraw
|
|
11172
11838
|
}
|
|
11173
11839
|
) : null,
|
|
11174
|
-
step === "kalshi" ? /* @__PURE__ */ (0,
|
|
11840
|
+
step === "kalshi" ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(KalshiWithdrawStep, { withdrawUrl: kalshiWithdrawUrl, onDone: handleDoneKalshi }) : null
|
|
11175
11841
|
] }) });
|
|
11176
11842
|
};
|
|
11177
11843
|
WithdrawModal.displayName = "WithdrawModal";
|
|
11178
11844
|
|
|
11179
11845
|
// src/onboarding/index.tsx
|
|
11180
|
-
var
|
|
11846
|
+
var import_react31 = require("react");
|
|
11181
11847
|
var import_hooks36 = require("@agg-market/hooks");
|
|
11182
11848
|
var Dialog4 = __toESM(require("@radix-ui/react-dialog"));
|
|
11183
11849
|
|
|
@@ -11200,31 +11866,31 @@ var ONCHAIN_VENUES = [
|
|
|
11200
11866
|
];
|
|
11201
11867
|
|
|
11202
11868
|
// src/onboarding/steps/how-it-works.tsx
|
|
11203
|
-
var
|
|
11869
|
+
var import_react27 = require("react");
|
|
11204
11870
|
var import_hooks31 = require("@agg-market/hooks");
|
|
11205
|
-
var
|
|
11871
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
11206
11872
|
var defaultIcons = {
|
|
11207
|
-
createAccount: /* @__PURE__ */ (0,
|
|
11208
|
-
linkAccounts: /* @__PURE__ */ (0,
|
|
11209
|
-
bestPrices: /* @__PURE__ */ (0,
|
|
11210
|
-
stayInControl: /* @__PURE__ */ (0,
|
|
11873
|
+
createAccount: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(CreateAccountIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
11874
|
+
linkAccounts: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(LinkAccountsIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
11875
|
+
bestPrices: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(BestPricesIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
11876
|
+
stayInControl: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(StayInControlIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" })
|
|
11211
11877
|
};
|
|
11212
11878
|
var HowItWorksStep = ({ onContinue, icons }) => {
|
|
11213
11879
|
const labels = (0, import_hooks31.useLabels)();
|
|
11214
|
-
const scrollRef = (0,
|
|
11215
|
-
const [showTopGradient, setShowTopGradient] = (0,
|
|
11216
|
-
const [showBottomGradient, setShowBottomGradient] = (0,
|
|
11217
|
-
const handleScroll = (0,
|
|
11880
|
+
const scrollRef = (0, import_react27.useRef)(null);
|
|
11881
|
+
const [showTopGradient, setShowTopGradient] = (0, import_react27.useState)(false);
|
|
11882
|
+
const [showBottomGradient, setShowBottomGradient] = (0, import_react27.useState)(true);
|
|
11883
|
+
const handleScroll = (0, import_react27.useCallback)(() => {
|
|
11218
11884
|
const el = scrollRef.current;
|
|
11219
11885
|
if (!el)
|
|
11220
11886
|
return;
|
|
11221
11887
|
setShowTopGradient(el.scrollTop > 0);
|
|
11222
11888
|
setShowBottomGradient(el.scrollTop + el.clientHeight < el.scrollHeight - 1);
|
|
11223
11889
|
}, []);
|
|
11224
|
-
return /* @__PURE__ */ (0,
|
|
11225
|
-
/* @__PURE__ */ (0,
|
|
11226
|
-
/* @__PURE__ */ (0,
|
|
11227
|
-
/* @__PURE__ */ (0,
|
|
11890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "flex flex-col gap-6 h-[600px] sm:h-auto", children: [
|
|
11891
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.howItWorks.title }),
|
|
11892
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "relative flex-1 min-h-0 sm:flex-initial", children: [
|
|
11893
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11228
11894
|
"div",
|
|
11229
11895
|
{
|
|
11230
11896
|
ref: scrollRef,
|
|
@@ -11234,7 +11900,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
11234
11900
|
var _a;
|
|
11235
11901
|
const icon = (_a = icons == null ? void 0 : icons[featureKey]) != null ? _a : defaultIcons[featureKey];
|
|
11236
11902
|
const feature = labels.onboarding.howItWorks.features[featureKey];
|
|
11237
|
-
return /* @__PURE__ */ (0,
|
|
11903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
11238
11904
|
"div",
|
|
11239
11905
|
{
|
|
11240
11906
|
className: cn(
|
|
@@ -11243,11 +11909,11 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
11243
11909
|
"bg-agg-secondary-hover"
|
|
11244
11910
|
),
|
|
11245
11911
|
children: [
|
|
11246
|
-
/* @__PURE__ */ (0,
|
|
11247
|
-
/* @__PURE__ */ (0,
|
|
11248
|
-
/* @__PURE__ */ (0,
|
|
11912
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "flex flex-col flex-1 min-w-0 gap-[6px]", children: [
|
|
11913
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: feature.title }),
|
|
11914
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: feature.description })
|
|
11249
11915
|
] }),
|
|
11250
|
-
icon ? /* @__PURE__ */ (0,
|
|
11916
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "hidden shrink-0 items-center justify-center text-agg-muted-foreground sm:flex", children: icon }) : null
|
|
11251
11917
|
]
|
|
11252
11918
|
},
|
|
11253
11919
|
featureKey
|
|
@@ -11255,7 +11921,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
11255
11921
|
})
|
|
11256
11922
|
}
|
|
11257
11923
|
),
|
|
11258
|
-
/* @__PURE__ */ (0,
|
|
11924
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11259
11925
|
"div",
|
|
11260
11926
|
{
|
|
11261
11927
|
className: cn(
|
|
@@ -11266,7 +11932,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
11266
11932
|
)
|
|
11267
11933
|
}
|
|
11268
11934
|
),
|
|
11269
|
-
/* @__PURE__ */ (0,
|
|
11935
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11270
11936
|
"div",
|
|
11271
11937
|
{
|
|
11272
11938
|
className: cn(
|
|
@@ -11278,26 +11944,26 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
11278
11944
|
}
|
|
11279
11945
|
)
|
|
11280
11946
|
] }),
|
|
11281
|
-
/* @__PURE__ */ (0,
|
|
11947
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Button, { variant: "primary", size: "large", className: "w-full", onClick: onContinue, children: labels.onboarding.howItWorks.continue })
|
|
11282
11948
|
] });
|
|
11283
11949
|
};
|
|
11284
11950
|
HowItWorksStep.displayName = "HowItWorksStep";
|
|
11285
11951
|
|
|
11286
11952
|
// src/onboarding/steps/profile-setup.tsx
|
|
11287
|
-
var
|
|
11953
|
+
var import_react28 = require("react");
|
|
11288
11954
|
var import_hooks32 = require("@agg-market/hooks");
|
|
11289
|
-
var
|
|
11955
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
11290
11956
|
var ProfileSetupStep = ({ onContinue }) => {
|
|
11291
11957
|
const labels = (0, import_hooks32.useLabels)();
|
|
11292
|
-
const [username, setUsername] = (0,
|
|
11293
|
-
const [avatarFile, setAvatarFile] = (0,
|
|
11294
|
-
const [avatarPreview, setAvatarPreview] = (0,
|
|
11295
|
-
const fileInputRef = (0,
|
|
11296
|
-
const handleAvatarClick = (0,
|
|
11958
|
+
const [username, setUsername] = (0, import_react28.useState)("");
|
|
11959
|
+
const [avatarFile, setAvatarFile] = (0, import_react28.useState)();
|
|
11960
|
+
const [avatarPreview, setAvatarPreview] = (0, import_react28.useState)();
|
|
11961
|
+
const fileInputRef = (0, import_react28.useRef)(null);
|
|
11962
|
+
const handleAvatarClick = (0, import_react28.useCallback)(() => {
|
|
11297
11963
|
var _a;
|
|
11298
11964
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
11299
11965
|
}, []);
|
|
11300
|
-
const handleFileChange = (0,
|
|
11966
|
+
const handleFileChange = (0, import_react28.useCallback)((e) => {
|
|
11301
11967
|
var _a;
|
|
11302
11968
|
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
11303
11969
|
if (!file)
|
|
@@ -11310,18 +11976,18 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
11310
11976
|
};
|
|
11311
11977
|
reader.readAsDataURL(file);
|
|
11312
11978
|
}, []);
|
|
11313
|
-
const handleContinue = (0,
|
|
11979
|
+
const handleContinue = (0, import_react28.useCallback)(() => {
|
|
11314
11980
|
onContinue({
|
|
11315
11981
|
username,
|
|
11316
11982
|
avatarFile,
|
|
11317
11983
|
avatarPreview
|
|
11318
11984
|
});
|
|
11319
11985
|
}, [username, avatarFile, avatarPreview, onContinue]);
|
|
11320
|
-
return /* @__PURE__ */ (0,
|
|
11321
|
-
/* @__PURE__ */ (0,
|
|
11322
|
-
/* @__PURE__ */ (0,
|
|
11323
|
-
/* @__PURE__ */ (0,
|
|
11324
|
-
/* @__PURE__ */ (0,
|
|
11986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "flex flex-col gap-7", children: [
|
|
11987
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.profileSetup.title }),
|
|
11988
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "flex flex-col gap-5 items-center w-full", children: [
|
|
11989
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "flex justify-center", children: [
|
|
11990
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11325
11991
|
"button",
|
|
11326
11992
|
{
|
|
11327
11993
|
type: "button",
|
|
@@ -11337,17 +12003,17 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
11337
12003
|
"overflow-hidden"
|
|
11338
12004
|
),
|
|
11339
12005
|
"aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
|
|
11340
|
-
children: avatarPreview ? /* @__PURE__ */ (0,
|
|
12006
|
+
children: avatarPreview ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11341
12007
|
RemoteImage,
|
|
11342
12008
|
{
|
|
11343
12009
|
src: avatarPreview,
|
|
11344
12010
|
alt: labels.onboarding.profileSetup.profilePreviewAlt,
|
|
11345
12011
|
className: "h-full w-full object-cover"
|
|
11346
12012
|
}
|
|
11347
|
-
) : /* @__PURE__ */ (0,
|
|
12013
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(ProfileIcon, { className: "h-7 w-7 text-agg-muted-foreground" })
|
|
11348
12014
|
}
|
|
11349
12015
|
),
|
|
11350
|
-
/* @__PURE__ */ (0,
|
|
12016
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11351
12017
|
"input",
|
|
11352
12018
|
{
|
|
11353
12019
|
ref: fileInputRef,
|
|
@@ -11359,8 +12025,8 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
11359
12025
|
}
|
|
11360
12026
|
)
|
|
11361
12027
|
] }),
|
|
11362
|
-
/* @__PURE__ */ (0,
|
|
11363
|
-
/* @__PURE__ */ (0,
|
|
12028
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "flex flex-col gap-2 w-full", children: [
|
|
12029
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11364
12030
|
"label",
|
|
11365
12031
|
{
|
|
11366
12032
|
htmlFor: "onboarding-username",
|
|
@@ -11368,7 +12034,7 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
11368
12034
|
children: labels.onboarding.profileSetup.usernameLabel
|
|
11369
12035
|
}
|
|
11370
12036
|
),
|
|
11371
|
-
/* @__PURE__ */ (0,
|
|
12037
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11372
12038
|
"input",
|
|
11373
12039
|
{
|
|
11374
12040
|
id: "onboarding-username",
|
|
@@ -11392,16 +12058,16 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
11392
12058
|
)
|
|
11393
12059
|
] })
|
|
11394
12060
|
] }),
|
|
11395
|
-
/* @__PURE__ */ (0,
|
|
12061
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Button, { variant: "primary", size: "large", className: "w-full", onClick: handleContinue, children: labels.onboarding.profileSetup.continue })
|
|
11396
12062
|
] });
|
|
11397
12063
|
};
|
|
11398
12064
|
ProfileSetupStep.displayName = "ProfileSetupStep";
|
|
11399
12065
|
|
|
11400
12066
|
// src/onboarding/steps/connect-accounts.tsx
|
|
11401
12067
|
var import_hooks33 = require("@agg-market/hooks");
|
|
11402
|
-
var
|
|
12068
|
+
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
11403
12069
|
var OnchainVenueLogos = () => {
|
|
11404
|
-
return /* @__PURE__ */ (0,
|
|
12070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "flex gap-1 sm:gap-0 sm:-space-x-5", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { style: { zIndex: ONCHAIN_VENUES.length - index }, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(VenueLogo, { venue, variant: "logo", size: "medium", className: "sm:h-8 sm:w-8" }) }, venue)) });
|
|
11405
12071
|
};
|
|
11406
12072
|
var VenueCard = ({
|
|
11407
12073
|
logos,
|
|
@@ -11413,7 +12079,7 @@ var VenueCard = ({
|
|
|
11413
12079
|
connected = false
|
|
11414
12080
|
}) => {
|
|
11415
12081
|
const labels = (0, import_hooks33.useLabels)();
|
|
11416
|
-
const action = connected ? /* @__PURE__ */ (0,
|
|
12082
|
+
const action = connected ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11417
12083
|
Button,
|
|
11418
12084
|
{
|
|
11419
12085
|
variant: "tertiary",
|
|
@@ -11423,18 +12089,18 @@ var VenueCard = ({
|
|
|
11423
12089
|
children: labels.onboarding.connectAccounts.connect
|
|
11424
12090
|
}
|
|
11425
12091
|
);
|
|
11426
|
-
const mobileAction = connected ? /* @__PURE__ */ (0,
|
|
12092
|
+
const mobileAction = connected ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11427
12093
|
Button,
|
|
11428
12094
|
{
|
|
11429
12095
|
variant: "tertiary",
|
|
11430
12096
|
size: "medium",
|
|
11431
12097
|
className: "!h-auto !px-0 !py-0 text-agg-primary hover:bg-transparent hover:text-agg-primary-hover",
|
|
11432
12098
|
onClick: onConnect,
|
|
11433
|
-
suffix: /* @__PURE__ */ (0,
|
|
12099
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(ChevronRightIcon, { className: "h-4 w-4" }),
|
|
11434
12100
|
children: labels.onboarding.connectAccounts.connectAccount
|
|
11435
12101
|
}
|
|
11436
12102
|
);
|
|
11437
|
-
return /* @__PURE__ */ (0,
|
|
12103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
11438
12104
|
"div",
|
|
11439
12105
|
{
|
|
11440
12106
|
className: cn(
|
|
@@ -11442,23 +12108,23 @@ var VenueCard = ({
|
|
|
11442
12108
|
connected ? "bg-agg-success/5" : "bg-agg-secondary-hover hover:bg-agg-tertiary"
|
|
11443
12109
|
),
|
|
11444
12110
|
children: [
|
|
11445
|
-
/* @__PURE__ */ (0,
|
|
11446
|
-
/* @__PURE__ */ (0,
|
|
11447
|
-
/* @__PURE__ */ (0,
|
|
11448
|
-
/* @__PURE__ */ (0,
|
|
11449
|
-
/* @__PURE__ */ (0,
|
|
11450
|
-
/* @__PURE__ */ (0,
|
|
12111
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "hidden sm:flex items-center justify-between", children: [
|
|
12112
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex items-center gap-5", children: [
|
|
12113
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "shrink-0", children: logos }),
|
|
12114
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex flex-col gap-[2px]", children: [
|
|
12115
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("p", { className: "text-agg-base font-agg-bold text-agg-foreground", children: title }),
|
|
12116
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("p", { className: "text-agg-sm text-agg-foreground", children: description })
|
|
11451
12117
|
] })
|
|
11452
12118
|
] }),
|
|
11453
|
-
/* @__PURE__ */ (0,
|
|
12119
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "shrink-0", children: action })
|
|
11454
12120
|
] }),
|
|
11455
|
-
/* @__PURE__ */ (0,
|
|
11456
|
-
/* @__PURE__ */ (0,
|
|
11457
|
-
/* @__PURE__ */ (0,
|
|
11458
|
-
/* @__PURE__ */ (0,
|
|
12121
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex flex-col gap-3 sm:hidden", children: [
|
|
12122
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
12123
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "shrink-0", children: logos }),
|
|
12124
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("p", { className: "text-agg-lg font-agg-bold text-agg-foreground", children: mobileTitle != null ? mobileTitle : title })
|
|
11459
12125
|
] }),
|
|
11460
|
-
/* @__PURE__ */ (0,
|
|
11461
|
-
/* @__PURE__ */ (0,
|
|
12126
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex flex-col items-start gap-2", children: [
|
|
12127
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("p", { className: "text-agg-base text-agg-foreground", children: mobileDescription != null ? mobileDescription : description }),
|
|
11462
12128
|
mobileAction
|
|
11463
12129
|
] })
|
|
11464
12130
|
] })
|
|
@@ -11475,13 +12141,13 @@ var ConnectAccountsStep = ({
|
|
|
11475
12141
|
}) => {
|
|
11476
12142
|
const labels = (0, import_hooks33.useLabels)();
|
|
11477
12143
|
const canContinue = connectedOnchain || connectedKalshi;
|
|
11478
|
-
return /* @__PURE__ */ (0,
|
|
11479
|
-
/* @__PURE__ */ (0,
|
|
11480
|
-
/* @__PURE__ */ (0,
|
|
11481
|
-
/* @__PURE__ */ (0,
|
|
12144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
12145
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectAccounts.title }),
|
|
12146
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
12147
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11482
12148
|
VenueCard,
|
|
11483
12149
|
{
|
|
11484
|
-
logos: /* @__PURE__ */ (0,
|
|
12150
|
+
logos: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(OnchainVenueLogos, {}),
|
|
11485
12151
|
title: labels.onboarding.connectAccounts.onchainTitle,
|
|
11486
12152
|
mobileTitle: labels.onboarding.connectAccounts.onchainMobileTitle(
|
|
11487
12153
|
ONCHAIN_VENUES.length - 1
|
|
@@ -11492,10 +12158,10 @@ var ConnectAccountsStep = ({
|
|
|
11492
12158
|
connected: connectedOnchain
|
|
11493
12159
|
}
|
|
11494
12160
|
),
|
|
11495
|
-
/* @__PURE__ */ (0,
|
|
12161
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11496
12162
|
VenueCard,
|
|
11497
12163
|
{
|
|
11498
|
-
logos: /* @__PURE__ */ (0,
|
|
12164
|
+
logos: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "sm:flex sm:w-14 sm:items-center sm:justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11499
12165
|
VenueLogo,
|
|
11500
12166
|
{
|
|
11501
12167
|
venue: "kalshi",
|
|
@@ -11513,7 +12179,7 @@ var ConnectAccountsStep = ({
|
|
|
11513
12179
|
}
|
|
11514
12180
|
)
|
|
11515
12181
|
] }),
|
|
11516
|
-
/* @__PURE__ */ (0,
|
|
12182
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
11517
12183
|
Button,
|
|
11518
12184
|
{
|
|
11519
12185
|
variant: "primary",
|
|
@@ -11529,25 +12195,25 @@ var ConnectAccountsStep = ({
|
|
|
11529
12195
|
ConnectAccountsStep.displayName = "ConnectAccountsStep";
|
|
11530
12196
|
|
|
11531
12197
|
// src/onboarding/steps/connect-kalshi-modal.tsx
|
|
11532
|
-
var
|
|
12198
|
+
var import_react29 = require("react");
|
|
11533
12199
|
var import_hooks34 = require("@agg-market/hooks");
|
|
11534
12200
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
11535
|
-
var
|
|
12201
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
11536
12202
|
var ConnectKalshiModal = ({
|
|
11537
12203
|
open,
|
|
11538
12204
|
onOpenChange,
|
|
11539
12205
|
onVerify
|
|
11540
12206
|
}) => {
|
|
11541
12207
|
const labels = (0, import_hooks34.useLabels)();
|
|
11542
|
-
const [apiKeyId, setApiKeyId] = (0,
|
|
11543
|
-
const [privateKey, setPrivateKey] = (0,
|
|
11544
|
-
const [verifying, setVerifying] = (0,
|
|
11545
|
-
const [error, setError] = (0,
|
|
12208
|
+
const [apiKeyId, setApiKeyId] = (0, import_react29.useState)("");
|
|
12209
|
+
const [privateKey, setPrivateKey] = (0, import_react29.useState)("");
|
|
12210
|
+
const [verifying, setVerifying] = (0, import_react29.useState)(false);
|
|
12211
|
+
const [error, setError] = (0, import_react29.useState)();
|
|
11546
12212
|
const canVerify = apiKeyId.trim().length > 0 && privateKey.trim().length > 0;
|
|
11547
|
-
const handleCancel = (0,
|
|
12213
|
+
const handleCancel = (0, import_react29.useCallback)(() => {
|
|
11548
12214
|
onOpenChange(false);
|
|
11549
12215
|
}, [onOpenChange]);
|
|
11550
|
-
const handleVerify = (0,
|
|
12216
|
+
const handleVerify = (0, import_react29.useCallback)(() => __async(void 0, null, function* () {
|
|
11551
12217
|
if (!canVerify || verifying)
|
|
11552
12218
|
return;
|
|
11553
12219
|
setVerifying(true);
|
|
@@ -11577,7 +12243,7 @@ var ConnectKalshiModal = ({
|
|
|
11577
12243
|
privateKey,
|
|
11578
12244
|
verifying
|
|
11579
12245
|
]);
|
|
11580
|
-
const handleOpenChange = (0,
|
|
12246
|
+
const handleOpenChange = (0, import_react29.useCallback)(
|
|
11581
12247
|
(value) => {
|
|
11582
12248
|
if (value) {
|
|
11583
12249
|
setApiKeyId("");
|
|
@@ -11589,15 +12255,15 @@ var ConnectKalshiModal = ({
|
|
|
11589
12255
|
},
|
|
11590
12256
|
[onOpenChange]
|
|
11591
12257
|
);
|
|
11592
|
-
return /* @__PURE__ */ (0,
|
|
12258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
11593
12259
|
Modal.Container,
|
|
11594
12260
|
{
|
|
11595
12261
|
maxWidth: "600px",
|
|
11596
12262
|
"aria-label": labels.onboarding.connectKalshiModal.ariaLabel,
|
|
11597
12263
|
classNames: { container: "!rounded-agg-lg" },
|
|
11598
12264
|
children: [
|
|
11599
|
-
/* @__PURE__ */ (0,
|
|
11600
|
-
/* @__PURE__ */ (0,
|
|
12265
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Dialog2.Title, { className: "sr-only", children: labels.onboarding.connectKalshiModal.title }),
|
|
12266
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11601
12267
|
Modal.Header,
|
|
11602
12268
|
{
|
|
11603
12269
|
hideClose: false,
|
|
@@ -11608,8 +12274,8 @@ var ConnectKalshiModal = ({
|
|
|
11608
12274
|
}
|
|
11609
12275
|
}
|
|
11610
12276
|
),
|
|
11611
|
-
/* @__PURE__ */ (0,
|
|
11612
|
-
/* @__PURE__ */ (0,
|
|
12277
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col gap-8 items-center", children: [
|
|
12278
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11613
12279
|
VenueLogo,
|
|
11614
12280
|
{
|
|
11615
12281
|
venue: "kalshi",
|
|
@@ -11618,54 +12284,54 @@ var ConnectKalshiModal = ({
|
|
|
11618
12284
|
className: "h-[60px] w-[60px]"
|
|
11619
12285
|
}
|
|
11620
12286
|
),
|
|
11621
|
-
/* @__PURE__ */ (0,
|
|
11622
|
-
/* @__PURE__ */ (0,
|
|
11623
|
-
/* @__PURE__ */ (0,
|
|
12287
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col gap-4 items-center text-center", children: [
|
|
12288
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectKalshiModal.title }),
|
|
12289
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: labels.onboarding.connectKalshiModal.description })
|
|
11624
12290
|
] }),
|
|
11625
|
-
/* @__PURE__ */ (0,
|
|
11626
|
-
/* @__PURE__ */ (0,
|
|
11627
|
-
/* @__PURE__ */ (0,
|
|
11628
|
-
/* @__PURE__ */ (0,
|
|
11629
|
-
/* @__PURE__ */ (0,
|
|
12291
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
12292
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col gap-3 rounded-agg-lg bg-agg-secondary-hover p-4", children: [
|
|
12293
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12294
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepOne.label }),
|
|
12295
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepOne.title })
|
|
11630
12296
|
] }),
|
|
11631
|
-
/* @__PURE__ */ (0,
|
|
11632
|
-
/* @__PURE__ */ (0,
|
|
11633
|
-
/* @__PURE__ */ (0,
|
|
12297
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "space-y-0 text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
12298
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.signIn }),
|
|
12299
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("p", { children: [
|
|
11634
12300
|
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfilePrefix,
|
|
11635
12301
|
" ",
|
|
11636
|
-
/* @__PURE__ */ (0,
|
|
12302
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileText }),
|
|
11637
12303
|
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfileSeparator,
|
|
11638
12304
|
" ",
|
|
11639
|
-
/* @__PURE__ */ (0,
|
|
12305
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "text-agg-foreground underline", children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileUrl })
|
|
11640
12306
|
] }),
|
|
11641
|
-
/* @__PURE__ */ (0,
|
|
12307
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("p", { children: [
|
|
11642
12308
|
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeyPrefix,
|
|
11643
12309
|
" ",
|
|
11644
|
-
/* @__PURE__ */ (0,
|
|
12310
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKeyText }),
|
|
11645
12311
|
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeySuffix
|
|
11646
12312
|
] }),
|
|
11647
|
-
/* @__PURE__ */ (0,
|
|
12313
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("p", { children: [
|
|
11648
12314
|
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsPrefix,
|
|
11649
12315
|
" ",
|
|
11650
|
-
/* @__PURE__ */ (0,
|
|
12316
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.readWriteText }),
|
|
11651
12317
|
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsSuffix
|
|
11652
12318
|
] }),
|
|
11653
|
-
/* @__PURE__ */ (0,
|
|
12319
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKey })
|
|
11654
12320
|
] }),
|
|
11655
|
-
/* @__PURE__ */ (0,
|
|
12321
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
11656
12322
|
labels.onboarding.connectKalshiModal.stepOne.footerLineOne,
|
|
11657
|
-
/* @__PURE__ */ (0,
|
|
12323
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("br", {}),
|
|
11658
12324
|
labels.onboarding.connectKalshiModal.stepOne.footerLineTwo
|
|
11659
12325
|
] })
|
|
11660
12326
|
] }),
|
|
11661
|
-
/* @__PURE__ */ (0,
|
|
11662
|
-
/* @__PURE__ */ (0,
|
|
11663
|
-
/* @__PURE__ */ (0,
|
|
11664
|
-
/* @__PURE__ */ (0,
|
|
12327
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col gap-3 rounded-agg-lg bg-agg-secondary-hover p-4", children: [
|
|
12328
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12329
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.label }),
|
|
12330
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.title })
|
|
11665
12331
|
] }),
|
|
11666
|
-
/* @__PURE__ */ (0,
|
|
11667
|
-
/* @__PURE__ */ (0,
|
|
11668
|
-
/* @__PURE__ */ (0,
|
|
12332
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.description }),
|
|
12333
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
12334
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11669
12335
|
"label",
|
|
11670
12336
|
{
|
|
11671
12337
|
htmlFor: "kalshi-api-key-id",
|
|
@@ -11673,7 +12339,7 @@ var ConnectKalshiModal = ({
|
|
|
11673
12339
|
children: labels.onboarding.connectKalshiModal.stepTwo.apiKeyIdLabel
|
|
11674
12340
|
}
|
|
11675
12341
|
),
|
|
11676
|
-
/* @__PURE__ */ (0,
|
|
12342
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11677
12343
|
"input",
|
|
11678
12344
|
{
|
|
11679
12345
|
id: "kalshi-api-key-id",
|
|
@@ -11693,8 +12359,8 @@ var ConnectKalshiModal = ({
|
|
|
11693
12359
|
}
|
|
11694
12360
|
)
|
|
11695
12361
|
] }),
|
|
11696
|
-
/* @__PURE__ */ (0,
|
|
11697
|
-
/* @__PURE__ */ (0,
|
|
12362
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
12363
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11698
12364
|
"label",
|
|
11699
12365
|
{
|
|
11700
12366
|
htmlFor: "kalshi-private-key",
|
|
@@ -11702,7 +12368,7 @@ var ConnectKalshiModal = ({
|
|
|
11702
12368
|
children: labels.onboarding.connectKalshiModal.stepTwo.privateKeyLabel
|
|
11703
12369
|
}
|
|
11704
12370
|
),
|
|
11705
|
-
/* @__PURE__ */ (0,
|
|
12371
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11706
12372
|
"textarea",
|
|
11707
12373
|
{
|
|
11708
12374
|
id: "kalshi-private-key",
|
|
@@ -11724,42 +12390,42 @@ var ConnectKalshiModal = ({
|
|
|
11724
12390
|
] })
|
|
11725
12391
|
] })
|
|
11726
12392
|
] }),
|
|
11727
|
-
/* @__PURE__ */ (0,
|
|
11728
|
-
/* @__PURE__ */ (0,
|
|
11729
|
-
/* @__PURE__ */ (0,
|
|
11730
|
-
/* @__PURE__ */ (0,
|
|
12393
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center justify-between w-full", children: [
|
|
12394
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "text-agg-base text-agg-foreground", children: labels.onboarding.connectKalshiModal.help.label }),
|
|
12395
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
12396
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
11731
12397
|
"a",
|
|
11732
12398
|
{
|
|
11733
12399
|
href: "#",
|
|
11734
12400
|
className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary hover:text-agg-primary-hover",
|
|
11735
12401
|
children: [
|
|
11736
|
-
/* @__PURE__ */ (0,
|
|
12402
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(DocumentIcon, { className: "h-4 w-4" }),
|
|
11737
12403
|
labels.onboarding.connectKalshiModal.help.docsLinkLabel
|
|
11738
12404
|
]
|
|
11739
12405
|
}
|
|
11740
12406
|
),
|
|
11741
|
-
/* @__PURE__ */ (0,
|
|
11742
|
-
/* @__PURE__ */ (0,
|
|
12407
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "h-3 w-px bg-agg-separator" }),
|
|
12408
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
11743
12409
|
"a",
|
|
11744
12410
|
{
|
|
11745
12411
|
href: "#",
|
|
11746
12412
|
className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary hover:text-agg-primary-hover",
|
|
11747
12413
|
children: [
|
|
11748
|
-
/* @__PURE__ */ (0,
|
|
12414
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(PlaySquareIcon, { className: "h-4 w-4" }),
|
|
11749
12415
|
labels.onboarding.connectKalshiModal.help.tutorialLinkLabel
|
|
11750
12416
|
]
|
|
11751
12417
|
}
|
|
11752
12418
|
)
|
|
11753
12419
|
] })
|
|
11754
12420
|
] }),
|
|
11755
|
-
/* @__PURE__ */ (0,
|
|
11756
|
-
error ? /* @__PURE__ */ (0,
|
|
11757
|
-
/* @__PURE__ */ (0,
|
|
11758
|
-
/* @__PURE__ */ (0,
|
|
12421
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col gap-5 items-center", children: [
|
|
12422
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
12423
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(WarningIcon, { className: "h-3.5 w-3.5 shrink-0 text-agg-error" }),
|
|
12424
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
11759
12425
|
] }) : null,
|
|
11760
|
-
/* @__PURE__ */ (0,
|
|
11761
|
-
/* @__PURE__ */ (0,
|
|
11762
|
-
/* @__PURE__ */ (0,
|
|
12426
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center gap-3 justify-center", children: [
|
|
12427
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Button, { variant: "secondary", size: "large", onClick: handleCancel, children: labels.onboarding.connectKalshiModal.actions.cancel }),
|
|
12428
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11763
12429
|
Button,
|
|
11764
12430
|
{
|
|
11765
12431
|
variant: "primary",
|
|
@@ -11780,22 +12446,22 @@ var ConnectKalshiModal = ({
|
|
|
11780
12446
|
ConnectKalshiModal.displayName = "ConnectKalshiModal";
|
|
11781
12447
|
|
|
11782
12448
|
// src/onboarding/steps/connect-onchain-modal.tsx
|
|
11783
|
-
var
|
|
12449
|
+
var import_react30 = require("react");
|
|
11784
12450
|
var import_hooks35 = require("@agg-market/hooks");
|
|
11785
12451
|
var Dialog3 = __toESM(require("@radix-ui/react-dialog"));
|
|
11786
|
-
var
|
|
12452
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
11787
12453
|
var ConnectOnchainModal = ({
|
|
11788
12454
|
open,
|
|
11789
12455
|
onOpenChange,
|
|
11790
12456
|
onConnect
|
|
11791
12457
|
}) => {
|
|
11792
12458
|
const labels = (0, import_hooks35.useLabels)();
|
|
11793
|
-
const [connecting, setConnecting] = (0,
|
|
11794
|
-
const [error, setError] = (0,
|
|
11795
|
-
const handleCancel = (0,
|
|
12459
|
+
const [connecting, setConnecting] = (0, import_react30.useState)(false);
|
|
12460
|
+
const [error, setError] = (0, import_react30.useState)();
|
|
12461
|
+
const handleCancel = (0, import_react30.useCallback)(() => {
|
|
11796
12462
|
onOpenChange(false);
|
|
11797
12463
|
}, [onOpenChange]);
|
|
11798
|
-
const handleConnect = (0,
|
|
12464
|
+
const handleConnect = (0, import_react30.useCallback)(() => __async(void 0, null, function* () {
|
|
11799
12465
|
if (connecting)
|
|
11800
12466
|
return;
|
|
11801
12467
|
setConnecting(true);
|
|
@@ -11811,7 +12477,7 @@ var ConnectOnchainModal = ({
|
|
|
11811
12477
|
setConnecting(false);
|
|
11812
12478
|
}
|
|
11813
12479
|
}), [connecting, labels.onboarding.connectOnchainModal.fallbackError, onConnect, onOpenChange]);
|
|
11814
|
-
const handleOpenChange = (0,
|
|
12480
|
+
const handleOpenChange = (0, import_react30.useCallback)(
|
|
11815
12481
|
(value) => {
|
|
11816
12482
|
if (value) {
|
|
11817
12483
|
setError(void 0);
|
|
@@ -11821,15 +12487,15 @@ var ConnectOnchainModal = ({
|
|
|
11821
12487
|
},
|
|
11822
12488
|
[onOpenChange]
|
|
11823
12489
|
);
|
|
11824
|
-
return /* @__PURE__ */ (0,
|
|
12490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
|
|
11825
12491
|
Modal.Container,
|
|
11826
12492
|
{
|
|
11827
12493
|
maxWidth: "600px",
|
|
11828
12494
|
"aria-label": labels.onboarding.connectOnchainModal.ariaLabel,
|
|
11829
12495
|
classNames: { container: "!rounded-agg-lg" },
|
|
11830
12496
|
children: [
|
|
11831
|
-
/* @__PURE__ */ (0,
|
|
11832
|
-
/* @__PURE__ */ (0,
|
|
12497
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Dialog3.Title, { className: "sr-only", children: labels.onboarding.connectOnchainModal.title }),
|
|
12498
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
11833
12499
|
Modal.Header,
|
|
11834
12500
|
{
|
|
11835
12501
|
hideClose: false,
|
|
@@ -11840,26 +12506,26 @@ var ConnectOnchainModal = ({
|
|
|
11840
12506
|
}
|
|
11841
12507
|
}
|
|
11842
12508
|
),
|
|
11843
|
-
/* @__PURE__ */ (0,
|
|
11844
|
-
/* @__PURE__ */ (0,
|
|
11845
|
-
/* @__PURE__ */ (0,
|
|
11846
|
-
/* @__PURE__ */ (0,
|
|
12509
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "flex flex-col gap-8 items-center", children: [
|
|
12510
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "flex flex-col gap-4 items-center text-center", children: [
|
|
12511
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectOnchainModal.title }),
|
|
12512
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("p", { className: "text-agg-base text-center leading-agg-6 text-agg-foreground whitespace-pre-line", children: labels.onboarding.connectOnchainModal.description })
|
|
11847
12513
|
] }),
|
|
11848
|
-
/* @__PURE__ */ (0,
|
|
11849
|
-
/* @__PURE__ */ (0,
|
|
11850
|
-
/* @__PURE__ */ (0,
|
|
11851
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
11852
|
-
/* @__PURE__ */ (0,
|
|
11853
|
-
/* @__PURE__ */ (0,
|
|
12514
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "flex w-full flex-col items-center gap-4 rounded-agg-xl bg-agg-secondary-hover p-6", children: [
|
|
12515
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("p", { className: "text-agg-sm font-agg-bold uppercase leading-agg-5 text-agg-muted-foreground", children: labels.onboarding.connectOnchainModal.supportedVenuesLabel }),
|
|
12516
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "flex flex-wrap items-center justify-center gap-x-4 gap-y-3", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "flex items-center gap-[6px]", children: [
|
|
12517
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "mr-2.5 h-3 w-px bg-agg-separator" }),
|
|
12518
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(VenueLogo, { venue, size: "medium" }),
|
|
12519
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "text-agg-base text-agg-foreground", children: labels.venues[venue] })
|
|
11854
12520
|
] }, venue)) })
|
|
11855
12521
|
] }),
|
|
11856
|
-
/* @__PURE__ */ (0,
|
|
11857
|
-
/* @__PURE__ */ (0,
|
|
11858
|
-
error ? /* @__PURE__ */ (0,
|
|
11859
|
-
/* @__PURE__ */ (0,
|
|
11860
|
-
/* @__PURE__ */ (0,
|
|
12522
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "flex flex-col gap-6 items-center", children: [
|
|
12523
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "flex flex-col gap-3 items-center", children: [
|
|
12524
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
12525
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(WarningIcon, { className: "h-3.5 w-3.5 shrink-0 text-agg-error" }),
|
|
12526
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
11861
12527
|
] }) : null,
|
|
11862
|
-
/* @__PURE__ */ (0,
|
|
12528
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
11863
12529
|
Button,
|
|
11864
12530
|
{
|
|
11865
12531
|
variant: "primary",
|
|
@@ -11870,7 +12536,7 @@ var ConnectOnchainModal = ({
|
|
|
11870
12536
|
}
|
|
11871
12537
|
)
|
|
11872
12538
|
] }),
|
|
11873
|
-
/* @__PURE__ */ (0,
|
|
12539
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
11874
12540
|
Button,
|
|
11875
12541
|
{
|
|
11876
12542
|
variant: "tertiary",
|
|
@@ -11889,7 +12555,7 @@ var ConnectOnchainModal = ({
|
|
|
11889
12555
|
ConnectOnchainModal.displayName = "ConnectOnchainModal";
|
|
11890
12556
|
|
|
11891
12557
|
// src/onboarding/index.tsx
|
|
11892
|
-
var
|
|
12558
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
11893
12559
|
var OnboardingModal = ({
|
|
11894
12560
|
open,
|
|
11895
12561
|
onOpenChange,
|
|
@@ -11903,67 +12569,67 @@ var OnboardingModal = ({
|
|
|
11903
12569
|
}) => {
|
|
11904
12570
|
var _a;
|
|
11905
12571
|
const labels = (0, import_hooks36.useLabels)();
|
|
11906
|
-
const [step, setStep] = (0,
|
|
12572
|
+
const [step, setStep] = (0, import_react31.useState)(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
11907
12573
|
const stepLabels = {
|
|
11908
12574
|
[ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
|
|
11909
12575
|
[ONBOARDING_STEPS.PROFILE_SETUP]: labels.onboarding.modal.stepProfileSetup,
|
|
11910
12576
|
[ONBOARDING_STEPS.CONNECT_ACCOUNTS]: labels.onboarding.modal.stepConnectAccounts
|
|
11911
12577
|
};
|
|
11912
12578
|
const resolvedTitle = (_a = stepLabels[step]) != null ? _a : labels.onboarding.modal.title;
|
|
11913
|
-
const [kalshiModalOpen, setKalshiModalOpen] = (0,
|
|
11914
|
-
const [kalshiConnected, setKalshiConnected] = (0,
|
|
11915
|
-
const [onchainModalOpen, setOnchainModalOpen] = (0,
|
|
11916
|
-
const [onchainConnected, setOnchainConnected] = (0,
|
|
11917
|
-
(0,
|
|
12579
|
+
const [kalshiModalOpen, setKalshiModalOpen] = (0, import_react31.useState)(false);
|
|
12580
|
+
const [kalshiConnected, setKalshiConnected] = (0, import_react31.useState)(false);
|
|
12581
|
+
const [onchainModalOpen, setOnchainModalOpen] = (0, import_react31.useState)(false);
|
|
12582
|
+
const [onchainConnected, setOnchainConnected] = (0, import_react31.useState)(false);
|
|
12583
|
+
(0, import_react31.useEffect)(() => {
|
|
11918
12584
|
if (open) {
|
|
11919
12585
|
setStep(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
11920
12586
|
setKalshiConnected(false);
|
|
11921
12587
|
setOnchainConnected(false);
|
|
11922
12588
|
}
|
|
11923
12589
|
}, [open]);
|
|
11924
|
-
const handleHowItWorksContinue = (0,
|
|
12590
|
+
const handleHowItWorksContinue = (0, import_react31.useCallback)(() => {
|
|
11925
12591
|
setStep(ONBOARDING_STEPS.PROFILE_SETUP);
|
|
11926
12592
|
}, []);
|
|
11927
|
-
const handleProfileContinue = (0,
|
|
12593
|
+
const handleProfileContinue = (0, import_react31.useCallback)(
|
|
11928
12594
|
(data) => {
|
|
11929
12595
|
onProfileSubmit == null ? void 0 : onProfileSubmit(data);
|
|
11930
12596
|
setStep(ONBOARDING_STEPS.CONNECT_ACCOUNTS);
|
|
11931
12597
|
},
|
|
11932
12598
|
[onProfileSubmit]
|
|
11933
12599
|
);
|
|
11934
|
-
const handleConnectContinue = (0,
|
|
12600
|
+
const handleConnectContinue = (0, import_react31.useCallback)(() => {
|
|
11935
12601
|
onComplete == null ? void 0 : onComplete();
|
|
11936
12602
|
}, [onComplete]);
|
|
11937
|
-
const handleOpenOnchainModal = (0,
|
|
12603
|
+
const handleOpenOnchainModal = (0, import_react31.useCallback)(() => {
|
|
11938
12604
|
setOnchainModalOpen(true);
|
|
11939
12605
|
}, []);
|
|
11940
|
-
const handleOnchainConnect = (0,
|
|
12606
|
+
const handleOnchainConnect = (0, import_react31.useCallback)(() => __async(void 0, null, function* () {
|
|
11941
12607
|
yield onConnectOnchain == null ? void 0 : onConnectOnchain();
|
|
11942
12608
|
setOnchainConnected(true);
|
|
11943
12609
|
}), [onConnectOnchain]);
|
|
11944
|
-
const handleOpenKalshiModal = (0,
|
|
12610
|
+
const handleOpenKalshiModal = (0, import_react31.useCallback)(() => {
|
|
11945
12611
|
setKalshiModalOpen(true);
|
|
11946
12612
|
}, []);
|
|
11947
|
-
const handleKalshiVerify = (0,
|
|
12613
|
+
const handleKalshiVerify = (0, import_react31.useCallback)(
|
|
11948
12614
|
(credentials) => __async(void 0, null, function* () {
|
|
11949
12615
|
yield onConnectKalshi == null ? void 0 : onConnectKalshi(credentials);
|
|
11950
12616
|
setKalshiConnected(true);
|
|
11951
12617
|
}),
|
|
11952
12618
|
[onConnectKalshi]
|
|
11953
12619
|
);
|
|
11954
|
-
return /* @__PURE__ */ (0,
|
|
11955
|
-
/* @__PURE__ */ (0,
|
|
12620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
12621
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
11956
12622
|
Modal.Container,
|
|
11957
12623
|
{
|
|
11958
12624
|
maxWidth: "600px",
|
|
11959
12625
|
"aria-label": resolvedTitle,
|
|
11960
12626
|
classNames: { container: "!rounded-agg-lg" },
|
|
11961
12627
|
children: [
|
|
11962
|
-
/* @__PURE__ */ (0,
|
|
11963
|
-
/* @__PURE__ */ (0,
|
|
11964
|
-
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ (0,
|
|
11965
|
-
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ (0,
|
|
11966
|
-
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ (0,
|
|
12628
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Dialog4.Title, { className: "sr-only", children: resolvedTitle }),
|
|
12629
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Modal.Body, { classNames: { root: "px-5 py-6 sm:px-10 sm:py-8" }, children: [
|
|
12630
|
+
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(HowItWorksStep, { onContinue: handleHowItWorksContinue, icons: howItWorksIcons }),
|
|
12631
|
+
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(ProfileSetupStep, { onContinue: handleProfileContinue }),
|
|
12632
|
+
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
11967
12633
|
ConnectAccountsStep,
|
|
11968
12634
|
{
|
|
11969
12635
|
onConnectOnchain: handleOpenOnchainModal,
|
|
@@ -11977,7 +12643,7 @@ var OnboardingModal = ({
|
|
|
11977
12643
|
]
|
|
11978
12644
|
}
|
|
11979
12645
|
) }),
|
|
11980
|
-
/* @__PURE__ */ (0,
|
|
12646
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
11981
12647
|
ConnectOnchainModal,
|
|
11982
12648
|
{
|
|
11983
12649
|
open: onchainModalOpen,
|
|
@@ -11985,7 +12651,7 @@ var OnboardingModal = ({
|
|
|
11985
12651
|
onConnect: handleOnchainConnect
|
|
11986
12652
|
}
|
|
11987
12653
|
),
|
|
11988
|
-
/* @__PURE__ */ (0,
|
|
12654
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
11989
12655
|
ConnectKalshiModal,
|
|
11990
12656
|
{
|
|
11991
12657
|
open: kalshiModalOpen,
|
|
@@ -11998,7 +12664,7 @@ var OnboardingModal = ({
|
|
|
11998
12664
|
OnboardingModal.displayName = "OnboardingModal";
|
|
11999
12665
|
|
|
12000
12666
|
// src/profile/index.tsx
|
|
12001
|
-
var
|
|
12667
|
+
var import_react33 = require("react");
|
|
12002
12668
|
|
|
12003
12669
|
// src/profile/profile-modal.constants.ts
|
|
12004
12670
|
var PROFILE_TAB_KEYS = {
|
|
@@ -12011,9 +12677,9 @@ var PROFILE_TAB_ITEMS = [
|
|
|
12011
12677
|
];
|
|
12012
12678
|
|
|
12013
12679
|
// src/profile/tabs/about-tab.tsx
|
|
12014
|
-
var
|
|
12680
|
+
var import_react32 = require("react");
|
|
12015
12681
|
var import_hooks37 = require("@agg-market/hooks");
|
|
12016
|
-
var
|
|
12682
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
12017
12683
|
var AboutTab = ({
|
|
12018
12684
|
avatarPreview,
|
|
12019
12685
|
onDeleteProfile,
|
|
@@ -12023,12 +12689,12 @@ var AboutTab = ({
|
|
|
12023
12689
|
draftAvatarPreview
|
|
12024
12690
|
}) => {
|
|
12025
12691
|
const labels = (0, import_hooks37.useLabels)();
|
|
12026
|
-
const fileInputRef = (0,
|
|
12027
|
-
const handleAvatarClick = (0,
|
|
12692
|
+
const fileInputRef = (0, import_react32.useRef)(null);
|
|
12693
|
+
const handleAvatarClick = (0, import_react32.useCallback)(() => {
|
|
12028
12694
|
var _a;
|
|
12029
12695
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
12030
12696
|
}, []);
|
|
12031
|
-
const handleFileChange = (0,
|
|
12697
|
+
const handleFileChange = (0, import_react32.useCallback)(
|
|
12032
12698
|
(e) => {
|
|
12033
12699
|
var _a;
|
|
12034
12700
|
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
@@ -12044,9 +12710,9 @@ var AboutTab = ({
|
|
|
12044
12710
|
[onDraftAvatarChange]
|
|
12045
12711
|
);
|
|
12046
12712
|
const resolvedPreview = draftAvatarPreview != null ? draftAvatarPreview : avatarPreview;
|
|
12047
|
-
return /* @__PURE__ */ (0,
|
|
12048
|
-
/* @__PURE__ */ (0,
|
|
12049
|
-
/* @__PURE__ */ (0,
|
|
12713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
12714
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex justify-center", children: [
|
|
12715
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
12050
12716
|
"button",
|
|
12051
12717
|
{
|
|
12052
12718
|
type: "button",
|
|
@@ -12062,17 +12728,17 @@ var AboutTab = ({
|
|
|
12062
12728
|
"overflow-hidden"
|
|
12063
12729
|
),
|
|
12064
12730
|
"aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
|
|
12065
|
-
children: resolvedPreview ? /* @__PURE__ */ (0,
|
|
12731
|
+
children: resolvedPreview ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
12066
12732
|
RemoteImage,
|
|
12067
12733
|
{
|
|
12068
12734
|
src: resolvedPreview,
|
|
12069
12735
|
alt: labels.onboarding.profileSetup.profilePreviewAlt,
|
|
12070
12736
|
className: "h-full w-full object-cover"
|
|
12071
12737
|
}
|
|
12072
|
-
) : /* @__PURE__ */ (0,
|
|
12738
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(ProfileIcon, { className: "h-8 w-8 text-agg-muted-foreground" })
|
|
12073
12739
|
}
|
|
12074
12740
|
),
|
|
12075
|
-
/* @__PURE__ */ (0,
|
|
12741
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
12076
12742
|
"input",
|
|
12077
12743
|
{
|
|
12078
12744
|
ref: fileInputRef,
|
|
@@ -12084,8 +12750,8 @@ var AboutTab = ({
|
|
|
12084
12750
|
}
|
|
12085
12751
|
)
|
|
12086
12752
|
] }),
|
|
12087
|
-
/* @__PURE__ */ (0,
|
|
12088
|
-
/* @__PURE__ */ (0,
|
|
12753
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
12754
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
12089
12755
|
"label",
|
|
12090
12756
|
{
|
|
12091
12757
|
htmlFor: "profile-username",
|
|
@@ -12093,7 +12759,7 @@ var AboutTab = ({
|
|
|
12093
12759
|
children: "Username"
|
|
12094
12760
|
}
|
|
12095
12761
|
),
|
|
12096
|
-
/* @__PURE__ */ (0,
|
|
12762
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
12097
12763
|
"input",
|
|
12098
12764
|
{
|
|
12099
12765
|
id: "profile-username",
|
|
@@ -12115,12 +12781,12 @@ var AboutTab = ({
|
|
|
12115
12781
|
}
|
|
12116
12782
|
)
|
|
12117
12783
|
] }),
|
|
12118
|
-
/* @__PURE__ */ (0,
|
|
12119
|
-
/* @__PURE__ */ (0,
|
|
12120
|
-
/* @__PURE__ */ (0,
|
|
12121
|
-
/* @__PURE__ */ (0,
|
|
12784
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
12785
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
12786
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: "Delete your profile" }),
|
|
12787
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: "This will permanently delete your account and all of its data. You will not be able to reactivate this account." })
|
|
12122
12788
|
] }),
|
|
12123
|
-
/* @__PURE__ */ (0,
|
|
12789
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
12124
12790
|
"button",
|
|
12125
12791
|
{
|
|
12126
12792
|
type: "button",
|
|
@@ -12142,9 +12808,9 @@ var AboutTab = ({
|
|
|
12142
12808
|
AboutTab.displayName = "AboutTab";
|
|
12143
12809
|
|
|
12144
12810
|
// src/profile/tabs/accounts-wallets-tab.tsx
|
|
12145
|
-
var
|
|
12146
|
-
var SectionTitle = ({ children }) => /* @__PURE__ */ (0,
|
|
12147
|
-
var AccountRow = ({ children, className }) => /* @__PURE__ */ (0,
|
|
12811
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
12812
|
+
var SectionTitle = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
|
|
12813
|
+
var AccountRow = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12148
12814
|
"div",
|
|
12149
12815
|
{
|
|
12150
12816
|
className: cn(
|
|
@@ -12156,7 +12822,7 @@ var AccountRow = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_run
|
|
|
12156
12822
|
children
|
|
12157
12823
|
}
|
|
12158
12824
|
);
|
|
12159
|
-
var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
12825
|
+
var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12160
12826
|
"button",
|
|
12161
12827
|
{
|
|
12162
12828
|
type: "button",
|
|
@@ -12165,7 +12831,7 @@ var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime1
|
|
|
12165
12831
|
children: "Connect"
|
|
12166
12832
|
}
|
|
12167
12833
|
);
|
|
12168
|
-
var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
12834
|
+
var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12169
12835
|
"button",
|
|
12170
12836
|
{
|
|
12171
12837
|
type: "button",
|
|
@@ -12190,19 +12856,19 @@ var AccountsWalletsTab = ({
|
|
|
12190
12856
|
const twitter = socialAccounts == null ? void 0 : socialAccounts.twitter;
|
|
12191
12857
|
const discord = socialAccounts == null ? void 0 : socialAccounts.discord;
|
|
12192
12858
|
const telegram = socialAccounts == null ? void 0 : socialAccounts.telegram;
|
|
12193
|
-
return /* @__PURE__ */ (0,
|
|
12194
|
-
/* @__PURE__ */ (0,
|
|
12195
|
-
/* @__PURE__ */ (0,
|
|
12196
|
-
exchanges.length === 0 ? /* @__PURE__ */ (0,
|
|
12859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
12860
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
12861
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(SectionTitle, { children: "Exchanges" }),
|
|
12862
|
+
exchanges.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: "No exchange accounts connected." }) : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "flex flex-col gap-2", children: exchanges.map((account) => {
|
|
12197
12863
|
var _a;
|
|
12198
12864
|
const displayName = (_a = venueLogoLabels[account.venue]) != null ? _a : account.venue;
|
|
12199
|
-
return /* @__PURE__ */ (0,
|
|
12200
|
-
/* @__PURE__ */ (0,
|
|
12201
|
-
/* @__PURE__ */ (0,
|
|
12202
|
-
/* @__PURE__ */ (0,
|
|
12203
|
-
/* @__PURE__ */ (0,
|
|
12204
|
-
/* @__PURE__ */ (0,
|
|
12205
|
-
account.verified ? /* @__PURE__ */ (0,
|
|
12865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(AccountRow, { children: [
|
|
12866
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
12867
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(VenueLogo, { venue: account.venue, size: "small" }),
|
|
12868
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: displayName }),
|
|
12869
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
12870
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "truncate text-agg-base font-agg-normal leading-6 text-agg-foreground", children: account.displayAddress }),
|
|
12871
|
+
account.verified ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
12206
12872
|
Icon,
|
|
12207
12873
|
{
|
|
12208
12874
|
name: "check-badge",
|
|
@@ -12212,39 +12878,39 @@ var AccountsWalletsTab = ({
|
|
|
12212
12878
|
) : null
|
|
12213
12879
|
] })
|
|
12214
12880
|
] }),
|
|
12215
|
-
/* @__PURE__ */ (0,
|
|
12881
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(DisconnectTextButton, { onClick: () => onDisconnectExchange(account.venue) })
|
|
12216
12882
|
] }, account.venue);
|
|
12217
12883
|
}) })
|
|
12218
12884
|
] }),
|
|
12219
|
-
/* @__PURE__ */ (0,
|
|
12220
|
-
/* @__PURE__ */ (0,
|
|
12221
|
-
/* @__PURE__ */ (0,
|
|
12222
|
-
/* @__PURE__ */ (0,
|
|
12223
|
-
/* @__PURE__ */ (0,
|
|
12224
|
-
/* @__PURE__ */ (0,
|
|
12225
|
-
/* @__PURE__ */ (0,
|
|
12885
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
12886
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(SectionTitle, { children: "Social Accounts" }),
|
|
12887
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
12888
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(AccountRow, { children: [
|
|
12889
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
12890
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-agg-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Icon, { name: "twitter", size: "small", color: "currentColor" }) }),
|
|
12891
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: "X (Twitter)" })
|
|
12226
12892
|
] }),
|
|
12227
|
-
(twitter == null ? void 0 : twitter.connected) ? /* @__PURE__ */ (0,
|
|
12893
|
+
(twitter == null ? void 0 : twitter.connected) ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(DisconnectTextButton, { onClick: onDisconnectTwitter }) : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(ConnectTextButton, { onClick: onConnectTwitter })
|
|
12228
12894
|
] }),
|
|
12229
|
-
/* @__PURE__ */ (0,
|
|
12230
|
-
/* @__PURE__ */ (0,
|
|
12231
|
-
/* @__PURE__ */ (0,
|
|
12232
|
-
/* @__PURE__ */ (0,
|
|
12895
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(AccountRow, { children: [
|
|
12896
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
12897
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-[#5865F2]", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Icon, { name: "discord", size: "small", color: "currentColor" }) }),
|
|
12898
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: "Discord" })
|
|
12233
12899
|
] }),
|
|
12234
|
-
(discord == null ? void 0 : discord.connected) ? /* @__PURE__ */ (0,
|
|
12900
|
+
(discord == null ? void 0 : discord.connected) ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(DisconnectTextButton, { onClick: onDisconnectDiscord }) : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(ConnectTextButton, { onClick: onConnectDiscord })
|
|
12235
12901
|
] }),
|
|
12236
|
-
/* @__PURE__ */ (0,
|
|
12237
|
-
/* @__PURE__ */ (0,
|
|
12238
|
-
/* @__PURE__ */ (0,
|
|
12239
|
-
/* @__PURE__ */ (0,
|
|
12902
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(AccountRow, { children: [
|
|
12903
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
12904
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-[#26A5E4]", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Icon, { name: "telegram", size: "small", color: "currentColor" }) }),
|
|
12905
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: "Telegram" })
|
|
12240
12906
|
] }),
|
|
12241
|
-
(telegram == null ? void 0 : telegram.connected) ? /* @__PURE__ */ (0,
|
|
12907
|
+
(telegram == null ? void 0 : telegram.connected) ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(DisconnectTextButton, { onClick: onDisconnectTelegram }) : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(ConnectTextButton, { onClick: onConnectTelegram })
|
|
12242
12908
|
] })
|
|
12243
12909
|
] })
|
|
12244
12910
|
] }),
|
|
12245
|
-
/* @__PURE__ */ (0,
|
|
12246
|
-
/* @__PURE__ */ (0,
|
|
12247
|
-
/* @__PURE__ */ (0,
|
|
12911
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
12912
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(SectionTitle, { children: "Email Address" }),
|
|
12913
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
12248
12914
|
"button",
|
|
12249
12915
|
{
|
|
12250
12916
|
type: "button",
|
|
@@ -12256,11 +12922,11 @@ var AccountsWalletsTab = ({
|
|
|
12256
12922
|
"cursor-pointer hover:bg-agg-secondary-hover"
|
|
12257
12923
|
),
|
|
12258
12924
|
children: [
|
|
12259
|
-
/* @__PURE__ */ (0,
|
|
12260
|
-
/* @__PURE__ */ (0,
|
|
12261
|
-
/* @__PURE__ */ (0,
|
|
12925
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
12926
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-agg-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Icon, { name: "email", size: "small", color: "currentColor" }) }),
|
|
12927
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: email != null ? email : "Connect email" })
|
|
12262
12928
|
] }),
|
|
12263
|
-
/* @__PURE__ */ (0,
|
|
12929
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Icon, { name: "chevron-right", size: "small", color: "currentColor" })
|
|
12264
12930
|
]
|
|
12265
12931
|
}
|
|
12266
12932
|
)
|
|
@@ -12270,7 +12936,7 @@ var AccountsWalletsTab = ({
|
|
|
12270
12936
|
AccountsWalletsTab.displayName = "AccountsWalletsTab";
|
|
12271
12937
|
|
|
12272
12938
|
// src/profile/index.tsx
|
|
12273
|
-
var
|
|
12939
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
12274
12940
|
var ProfileModal = ({
|
|
12275
12941
|
open,
|
|
12276
12942
|
onOpenChange,
|
|
@@ -12290,15 +12956,15 @@ var ProfileModal = ({
|
|
|
12290
12956
|
onDisconnectTelegram,
|
|
12291
12957
|
onConnectEmail
|
|
12292
12958
|
}) => {
|
|
12293
|
-
const [activeTab, setActiveTab] = (0,
|
|
12294
|
-
const [draftUsername, setDraftUsername] = (0,
|
|
12295
|
-
const [draftAvatarFile, setDraftAvatarFile] = (0,
|
|
12296
|
-
const [draftAvatarPreview, setDraftAvatarPreview] = (0,
|
|
12297
|
-
const [isSaving, setIsSaving] = (0,
|
|
12298
|
-
(0,
|
|
12959
|
+
const [activeTab, setActiveTab] = (0, import_react33.useState)(PROFILE_TAB_KEYS.ABOUT);
|
|
12960
|
+
const [draftUsername, setDraftUsername] = (0, import_react33.useState)(username != null ? username : "");
|
|
12961
|
+
const [draftAvatarFile, setDraftAvatarFile] = (0, import_react33.useState)();
|
|
12962
|
+
const [draftAvatarPreview, setDraftAvatarPreview] = (0, import_react33.useState)();
|
|
12963
|
+
const [isSaving, setIsSaving] = (0, import_react33.useState)(false);
|
|
12964
|
+
(0, import_react33.useEffect)(() => {
|
|
12299
12965
|
setDraftUsername(username != null ? username : "");
|
|
12300
12966
|
}, [username]);
|
|
12301
|
-
const handleOpenChange = (0,
|
|
12967
|
+
const handleOpenChange = (0, import_react33.useCallback)(
|
|
12302
12968
|
(isOpen) => {
|
|
12303
12969
|
if (!isOpen) {
|
|
12304
12970
|
setActiveTab(PROFILE_TAB_KEYS.ABOUT);
|
|
@@ -12319,7 +12985,7 @@ var ProfileModal = ({
|
|
|
12319
12985
|
setDraftAvatarPreview
|
|
12320
12986
|
]
|
|
12321
12987
|
);
|
|
12322
|
-
const handleDraftAvatarChange = (0,
|
|
12988
|
+
const handleDraftAvatarChange = (0, import_react33.useCallback)(
|
|
12323
12989
|
(file, preview) => {
|
|
12324
12990
|
setDraftAvatarFile(file);
|
|
12325
12991
|
setDraftAvatarPreview(preview);
|
|
@@ -12327,7 +12993,7 @@ var ProfileModal = ({
|
|
|
12327
12993
|
[]
|
|
12328
12994
|
);
|
|
12329
12995
|
const hasChanges = draftUsername !== (username != null ? username : "") || draftAvatarFile !== void 0;
|
|
12330
|
-
const handleSave = (0,
|
|
12996
|
+
const handleSave = (0, import_react33.useCallback)(() => {
|
|
12331
12997
|
setIsSaving(true);
|
|
12332
12998
|
onSave({
|
|
12333
12999
|
username: draftUsername || void 0,
|
|
@@ -12339,16 +13005,16 @@ var ProfileModal = ({
|
|
|
12339
13005
|
onOpenChange(false);
|
|
12340
13006
|
}, 500);
|
|
12341
13007
|
}, [draftUsername, draftAvatarFile, draftAvatarPreview, onSave, onOpenChange]);
|
|
12342
|
-
const handleCancel = (0,
|
|
13008
|
+
const handleCancel = (0, import_react33.useCallback)(() => {
|
|
12343
13009
|
handleOpenChange(false);
|
|
12344
13010
|
}, [handleOpenChange]);
|
|
12345
|
-
return /* @__PURE__ */ (0,
|
|
12346
|
-
/* @__PURE__ */ (0,
|
|
12347
|
-
/* @__PURE__ */ (0,
|
|
12348
|
-
/* @__PURE__ */ (0,
|
|
12349
|
-
/* @__PURE__ */ (0,
|
|
13011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(Modal.Container, { maxWidth: "800px", "aria-label": "Edit Profile", children: [
|
|
13012
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Modal.Header, { title: "Edit Profile" }),
|
|
13013
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Modal.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "flex flex-col sm:flex-row sm:gap-10", children: [
|
|
13014
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "shrink-0", children: [
|
|
13015
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { className: "flex gap-2 sm:hidden mb-6", children: PROFILE_TAB_ITEMS.map((tab) => {
|
|
12350
13016
|
const isActive = activeTab === tab.value;
|
|
12351
|
-
return /* @__PURE__ */ (0,
|
|
13017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
|
|
12352
13018
|
"button",
|
|
12353
13019
|
{
|
|
12354
13020
|
type: "button",
|
|
@@ -12361,14 +13027,14 @@ var ProfileModal = ({
|
|
|
12361
13027
|
isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover border-agg-primary" : "font-agg-normal text-agg-foreground border-transparent"
|
|
12362
13028
|
),
|
|
12363
13029
|
children: [
|
|
12364
|
-
/* @__PURE__ */ (0,
|
|
12365
|
-
/* @__PURE__ */ (0,
|
|
13030
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
|
|
13031
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { className: "whitespace-nowrap", children: tab.label })
|
|
12366
13032
|
]
|
|
12367
13033
|
},
|
|
12368
13034
|
tab.value
|
|
12369
13035
|
);
|
|
12370
13036
|
}) }),
|
|
12371
|
-
/* @__PURE__ */ (0,
|
|
13037
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
12372
13038
|
"nav",
|
|
12373
13039
|
{
|
|
12374
13040
|
className: cn(
|
|
@@ -12383,7 +13049,7 @@ var ProfileModal = ({
|
|
|
12383
13049
|
"aria-label": "Profile sections",
|
|
12384
13050
|
children: PROFILE_TAB_ITEMS.map((tab) => {
|
|
12385
13051
|
const isActive = activeTab === tab.value;
|
|
12386
|
-
return /* @__PURE__ */ (0,
|
|
13052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
|
|
12387
13053
|
"button",
|
|
12388
13054
|
{
|
|
12389
13055
|
type: "button",
|
|
@@ -12398,9 +13064,9 @@ var ProfileModal = ({
|
|
|
12398
13064
|
isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover" : "font-agg-normal text-agg-foreground"
|
|
12399
13065
|
),
|
|
12400
13066
|
children: [
|
|
12401
|
-
isActive ? /* @__PURE__ */ (0,
|
|
12402
|
-
/* @__PURE__ */ (0,
|
|
12403
|
-
/* @__PURE__ */ (0,
|
|
13067
|
+
isActive ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-agg-primary" }) : null,
|
|
13068
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
|
|
13069
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { className: "shrink-0 whitespace-nowrap", children: tab.label })
|
|
12404
13070
|
]
|
|
12405
13071
|
},
|
|
12406
13072
|
tab.value
|
|
@@ -12409,8 +13075,8 @@ var ProfileModal = ({
|
|
|
12409
13075
|
}
|
|
12410
13076
|
)
|
|
12411
13077
|
] }),
|
|
12412
|
-
/* @__PURE__ */ (0,
|
|
12413
|
-
activeTab === PROFILE_TAB_KEYS.ABOUT ? /* @__PURE__ */ (0,
|
|
13078
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
13079
|
+
activeTab === PROFILE_TAB_KEYS.ABOUT ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
12414
13080
|
AboutTab,
|
|
12415
13081
|
{
|
|
12416
13082
|
username,
|
|
@@ -12423,7 +13089,7 @@ var ProfileModal = ({
|
|
|
12423
13089
|
draftAvatarPreview
|
|
12424
13090
|
}
|
|
12425
13091
|
) : null,
|
|
12426
|
-
activeTab === PROFILE_TAB_KEYS.ACCOUNTS_WALLETS ? /* @__PURE__ */ (0,
|
|
13092
|
+
activeTab === PROFILE_TAB_KEYS.ACCOUNTS_WALLETS ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
12427
13093
|
AccountsWalletsTab,
|
|
12428
13094
|
{
|
|
12429
13095
|
exchanges,
|
|
@@ -12441,9 +13107,9 @@ var ProfileModal = ({
|
|
|
12441
13107
|
) : null
|
|
12442
13108
|
] })
|
|
12443
13109
|
] }) }),
|
|
12444
|
-
/* @__PURE__ */ (0,
|
|
12445
|
-
/* @__PURE__ */ (0,
|
|
12446
|
-
/* @__PURE__ */ (0,
|
|
13110
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(Modal.Footer, { children: [
|
|
13111
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Button, { variant: "secondary", size: "large", onClick: handleCancel, className: "min-w-[120px]", children: "Cancel" }),
|
|
13112
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
12447
13113
|
Button,
|
|
12448
13114
|
{
|
|
12449
13115
|
variant: "primary",
|
|
@@ -12582,9 +13248,11 @@ var placeOrderViewModelSchema = import_zod3.z.object({
|
|
|
12582
13248
|
LinkAccountsIcon,
|
|
12583
13249
|
LoadingIcon,
|
|
12584
13250
|
MarketDetails,
|
|
13251
|
+
MarketDetailsList,
|
|
12585
13252
|
Modal,
|
|
12586
13253
|
NumberValue,
|
|
12587
13254
|
OnboardingModal,
|
|
13255
|
+
OnrampModal,
|
|
12588
13256
|
PencilIcon,
|
|
12589
13257
|
PlaceOrder,
|
|
12590
13258
|
PlaySquareIcon,
|