@agg-market/ui 10.0.0 → 11.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-GYOCLZGH.mjs → chunk-2KGE5AJQ.mjs} +167 -276
- package/dist/{chunk-55YYUTBK.mjs → chunk-5FSWOXEG.mjs} +1 -1
- package/dist/{chunk-RYQSVETG.mjs → chunk-HMUMJUIL.mjs} +429 -331
- package/dist/{chunk-XP7DREIX.mjs → chunk-IUJXJEDQ.mjs} +1300 -656
- package/dist/{chunk-5G4T5R2H.mjs → chunk-UONHGMFI.mjs} +7 -3
- package/dist/events.js +756 -670
- package/dist/events.mjs +2 -2
- package/dist/index.js +2976 -2367
- package/dist/index.mjs +13 -6
- package/dist/modals.js +26 -9
- package/dist/modals.mjs +2 -2
- package/dist/pages.js +2653 -1790
- package/dist/pages.mjs +4 -4
- package/dist/primitives.js +1277 -649
- package/dist/primitives.mjs +5 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +257 -189
- package/dist/trading.mjs +2 -2
- package/dist/types/events/list/event-list.types.d.mts +1 -1
- package/dist/types/events/list/event-list.types.d.ts +1 -1
- package/dist/types/events/market-details/index.d.mts +2 -2
- package/dist/types/events/market-details/index.d.ts +2 -2
- package/dist/types/events/market-details/market-details.types.d.mts +1 -5
- package/dist/types/events/market-details/market-details.types.d.ts +1 -5
- package/dist/types/primitives/agg-logo/index.d.mts +6 -0
- package/dist/types/primitives/agg-logo/index.d.ts +6 -0
- package/dist/types/primitives/header/agg-logo.d.mts +2 -0
- package/dist/types/primitives/header/agg-logo.d.ts +2 -0
- package/dist/types/primitives/header/header.constants.d.mts +3 -0
- package/dist/types/primitives/header/header.constants.d.ts +3 -0
- package/dist/types/primitives/header/header.types.d.mts +28 -0
- package/dist/types/primitives/header/header.types.d.ts +28 -0
- package/dist/types/primitives/header/index.d.mts +7 -0
- package/dist/types/primitives/header/index.d.ts +7 -0
- package/dist/types/primitives/index.d.mts +2 -0
- package/dist/types/primitives/index.d.ts +2 -0
- package/dist/types/primitives/search/index.d.mts +1 -1
- package/dist/types/primitives/search/index.d.ts +1 -1
- package/dist/types/primitives/search/search.types.d.mts +9 -59
- package/dist/types/primitives/search/search.types.d.ts +9 -59
- package/dist/types/primitives/search/search.utils.d.mts +4 -0
- package/dist/types/primitives/search/search.utils.d.ts +4 -0
- package/dist/types/primitives/skeleton/skeleton.types.d.mts +1 -0
- package/dist/types/primitives/skeleton/skeleton.types.d.ts +1 -0
- package/dist/types/primitives/skeleton/views/search-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/search-skeleton-view.d.ts +5 -0
- 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/events.js
CHANGED
|
@@ -70,7 +70,7 @@ module.exports = __toCommonJS(events_exports);
|
|
|
70
70
|
// src/events/item/index.tsx
|
|
71
71
|
var import_dayjs2 = __toESM(require("dayjs"));
|
|
72
72
|
var import_react6 = require("react");
|
|
73
|
-
var
|
|
73
|
+
var import_hooks16 = require("@agg-market/hooks");
|
|
74
74
|
|
|
75
75
|
// src/primitives/badge/index.tsx
|
|
76
76
|
var import_hooks = require("@agg-market/hooks");
|
|
@@ -118,7 +118,9 @@ function Badge({
|
|
|
118
118
|
onClick,
|
|
119
119
|
isActive = false
|
|
120
120
|
}) {
|
|
121
|
-
const {
|
|
121
|
+
const {
|
|
122
|
+
features: { enableAnimations }
|
|
123
|
+
} = (0, import_hooks.useSdkUiConfig)();
|
|
122
124
|
const resolvedText = `${text}`;
|
|
123
125
|
const resolvedAriaLabel = resolvedText.length > 0 ? resolvedText : void 0;
|
|
124
126
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -153,7 +155,9 @@ var import_hooks2 = require("@agg-market/hooks");
|
|
|
153
155
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
154
156
|
var Card = (_a) => {
|
|
155
157
|
var _b = _a, { className, onClick } = _b, props = __objRest(_b, ["className", "onClick"]);
|
|
156
|
-
const {
|
|
158
|
+
const {
|
|
159
|
+
features: { enableAnimations }
|
|
160
|
+
} = (0, import_hooks2.useSdkUiConfig)();
|
|
157
161
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
158
162
|
"div",
|
|
159
163
|
__spreadValues(__spreadValues({
|
|
@@ -1860,7 +1864,9 @@ var import_hooks5 = require("@agg-market/hooks");
|
|
|
1860
1864
|
var import_hooks3 = require("@agg-market/hooks");
|
|
1861
1865
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
1862
1866
|
var SkeletonBlock = ({ className }) => {
|
|
1863
|
-
const {
|
|
1867
|
+
const {
|
|
1868
|
+
features: { enableAnimations }
|
|
1869
|
+
} = (0, import_hooks3.useSdkUiConfig)();
|
|
1864
1870
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
1865
1871
|
"div",
|
|
1866
1872
|
{
|
|
@@ -2192,15 +2198,63 @@ var PlaceOrderSkeletonView = ({
|
|
|
2192
2198
|
};
|
|
2193
2199
|
PlaceOrderSkeletonView.displayName = "PlaceOrderSkeletonView";
|
|
2194
2200
|
|
|
2195
|
-
// src/primitives/skeleton/views/
|
|
2201
|
+
// src/primitives/skeleton/views/search-skeleton-view.tsx
|
|
2196
2202
|
var import_hooks8 = require("@agg-market/hooks");
|
|
2197
2203
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2204
|
+
var SearchSkeletonRow = () => {
|
|
2205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex w-full items-center gap-6 px-5 py-4", children: [
|
|
2206
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SkeletonBlock, { className: "size-12 shrink-0 rounded-[8px]" }),
|
|
2207
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2208
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SkeletonBlock, { className: "h-5 w-full max-w-[320px] rounded-agg-sm" }),
|
|
2209
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2210
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SkeletonBlock, { className: "h-4 w-[104px] rounded-agg-sm" }),
|
|
2211
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
2212
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SkeletonBlock, { className: "size-[14px] rounded-[4px]" }),
|
|
2213
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SkeletonBlock, { className: "size-[14px] rounded-[4px]" })
|
|
2214
|
+
] })
|
|
2215
|
+
] })
|
|
2216
|
+
] }),
|
|
2217
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex w-[200px] shrink-0 items-center gap-2", children: [
|
|
2218
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SkeletonBlock, { className: "size-4 rounded-[4px]" }),
|
|
2219
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
2220
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SkeletonBlock, { className: "h-6 w-10 rounded-agg-sm" }),
|
|
2221
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SkeletonBlock, { className: "h-4 w-[60px] rounded-agg-sm" })
|
|
2222
|
+
] })
|
|
2223
|
+
] }),
|
|
2224
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SkeletonBlock, { className: "size-5 rounded-[4px]" })
|
|
2225
|
+
] });
|
|
2226
|
+
};
|
|
2227
|
+
var SearchSkeletonView = ({ className, ariaLabel }) => {
|
|
2228
|
+
const labels = (0, import_hooks8.useLabels)();
|
|
2229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
2230
|
+
"div",
|
|
2231
|
+
{
|
|
2232
|
+
className: cn(
|
|
2233
|
+
"group/agg-search-skeleton",
|
|
2234
|
+
"w-full overflow-hidden rounded-agg-xl border border-agg-separator bg-agg-secondary shadow-[0px_8px_16px_0px_rgba(0,0,0,0.1)]",
|
|
2235
|
+
className
|
|
2236
|
+
),
|
|
2237
|
+
role: "status",
|
|
2238
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.search.loadingResults,
|
|
2239
|
+
"aria-busy": true,
|
|
2240
|
+
children: [
|
|
2241
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "pt-2", children: Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: cn(index > 0 && "border-t border-agg-separator"), children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SearchSkeletonRow, {}) }, index)) }),
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "border-t border-agg-separator px-5 py-5", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SkeletonBlock, { className: "h-5 w-[116px] rounded-agg-sm" }) })
|
|
2243
|
+
]
|
|
2244
|
+
}
|
|
2245
|
+
);
|
|
2246
|
+
};
|
|
2247
|
+
SearchSkeletonView.displayName = "SearchSkeletonView";
|
|
2248
|
+
|
|
2249
|
+
// src/primitives/skeleton/views/settlement-skeleton-view.tsx
|
|
2250
|
+
var import_hooks9 = require("@agg-market/hooks");
|
|
2251
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2198
2252
|
var SettlementSkeletonView = ({
|
|
2199
2253
|
className,
|
|
2200
2254
|
ariaLabel
|
|
2201
2255
|
}) => {
|
|
2202
|
-
const labels = (0,
|
|
2203
|
-
return /* @__PURE__ */ (0,
|
|
2256
|
+
const labels = (0, import_hooks9.useLabels)();
|
|
2257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
2204
2258
|
Card,
|
|
2205
2259
|
{
|
|
2206
2260
|
className: cn(
|
|
@@ -2212,26 +2266,26 @@ var SettlementSkeletonView = ({
|
|
|
2212
2266
|
"aria-label": ariaLabel != null ? ariaLabel : labels.trading.settlementLoading,
|
|
2213
2267
|
"aria-busy": true,
|
|
2214
2268
|
children: [
|
|
2215
|
-
/* @__PURE__ */ (0,
|
|
2216
|
-
/* @__PURE__ */ (0,
|
|
2217
|
-
/* @__PURE__ */ (0,
|
|
2269
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex w-full items-center justify-between gap-4", children: [
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SkeletonBlock, { className: "h-4 w-[81px] rounded-agg-sm" }),
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SkeletonBlock, { className: "h-5 w-full max-w-[240px] rounded-agg-sm" })
|
|
2218
2272
|
] }),
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2220
|
-
/* @__PURE__ */ (0,
|
|
2221
|
-
/* @__PURE__ */ (0,
|
|
2222
|
-
/* @__PURE__ */ (0,
|
|
2223
|
-
/* @__PURE__ */ (0,
|
|
2273
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
|
|
2274
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SkeletonBlock, { className: "h-5 w-[200px] rounded-agg-sm" }),
|
|
2275
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
2276
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[320px] rounded-agg-sm" }),
|
|
2277
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[280px] rounded-agg-sm" })
|
|
2224
2278
|
] })
|
|
2225
2279
|
] }),
|
|
2226
|
-
/* @__PURE__ */ (0,
|
|
2227
|
-
/* @__PURE__ */ (0,
|
|
2228
|
-
/* @__PURE__ */ (0,
|
|
2229
|
-
/* @__PURE__ */ (0,
|
|
2230
|
-
/* @__PURE__ */ (0,
|
|
2280
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
2281
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
|
|
2282
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2283
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
|
|
2284
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SkeletonBlock, { className: "h-5 w-[100px] rounded-agg-sm" })
|
|
2231
2285
|
] }),
|
|
2232
|
-
/* @__PURE__ */ (0,
|
|
2233
|
-
/* @__PURE__ */ (0,
|
|
2234
|
-
/* @__PURE__ */ (0,
|
|
2286
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2287
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
|
|
2288
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SkeletonBlock, { className: "h-5 w-[60px] rounded-agg-sm" })
|
|
2235
2289
|
] })
|
|
2236
2290
|
] })
|
|
2237
2291
|
]
|
|
@@ -2248,36 +2302,40 @@ var skeletonViews = {
|
|
|
2248
2302
|
marketDetailsDetailed: "market-details-detailed",
|
|
2249
2303
|
eventList: "event-list",
|
|
2250
2304
|
settlement: "settlement",
|
|
2251
|
-
placeOrder: "place-order"
|
|
2305
|
+
placeOrder: "place-order",
|
|
2306
|
+
search: "search"
|
|
2252
2307
|
};
|
|
2253
2308
|
|
|
2254
2309
|
// src/primitives/skeleton/index.tsx
|
|
2255
|
-
var
|
|
2310
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2256
2311
|
var Skeleton = ({ view, className, ariaLabel }) => {
|
|
2257
2312
|
if (view === skeletonViews.eventListItem) {
|
|
2258
|
-
return /* @__PURE__ */ (0,
|
|
2313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(EventListItemSkeletonView, { className, ariaLabel, isStandalone: true });
|
|
2259
2314
|
}
|
|
2260
2315
|
if (view === skeletonViews.eventListItemDetails) {
|
|
2261
|
-
return /* @__PURE__ */ (0,
|
|
2316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(EventListItemDetailsSkeletonView, { className, ariaLabel });
|
|
2262
2317
|
}
|
|
2263
2318
|
if (view === skeletonViews.marketDetailsMinified) {
|
|
2264
|
-
return /* @__PURE__ */ (0,
|
|
2319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(MarketDetailsSkeletonView, { className, ariaLabel, isDetailed: false });
|
|
2265
2320
|
}
|
|
2266
2321
|
if (view === skeletonViews.marketDetailsDetailed) {
|
|
2267
|
-
return /* @__PURE__ */ (0,
|
|
2322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(MarketDetailsSkeletonView, { className, ariaLabel, isDetailed: true });
|
|
2268
2323
|
}
|
|
2269
2324
|
if (view === skeletonViews.settlement) {
|
|
2270
|
-
return /* @__PURE__ */ (0,
|
|
2325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SettlementSkeletonView, { className, ariaLabel });
|
|
2271
2326
|
}
|
|
2272
2327
|
if (view === skeletonViews.placeOrder) {
|
|
2273
|
-
return /* @__PURE__ */ (0,
|
|
2328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(PlaceOrderSkeletonView, { className, ariaLabel });
|
|
2329
|
+
}
|
|
2330
|
+
if (view === skeletonViews.search) {
|
|
2331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SearchSkeletonView, { className, ariaLabel });
|
|
2274
2332
|
}
|
|
2275
|
-
return /* @__PURE__ */ (0,
|
|
2333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(EventListSkeletonView, { className, ariaLabel });
|
|
2276
2334
|
};
|
|
2277
2335
|
Skeleton.displayName = "Skeleton";
|
|
2278
2336
|
|
|
2279
2337
|
// src/primitives/button/index.tsx
|
|
2280
|
-
var
|
|
2338
|
+
var import_hooks10 = require("@agg-market/hooks");
|
|
2281
2339
|
|
|
2282
2340
|
// src/primitives/button/button.constants.ts
|
|
2283
2341
|
var sizeClasses = {
|
|
@@ -2324,7 +2382,7 @@ var baseButtonClasses = cn(
|
|
|
2324
2382
|
);
|
|
2325
2383
|
|
|
2326
2384
|
// src/primitives/button/index.tsx
|
|
2327
|
-
var
|
|
2385
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2328
2386
|
var Button = (_a) => {
|
|
2329
2387
|
var _b = _a, {
|
|
2330
2388
|
children,
|
|
@@ -2349,9 +2407,11 @@ var Button = (_a) => {
|
|
|
2349
2407
|
"className",
|
|
2350
2408
|
"aria-label"
|
|
2351
2409
|
]);
|
|
2352
|
-
const {
|
|
2410
|
+
const {
|
|
2411
|
+
features: { enableAnimations }
|
|
2412
|
+
} = (0, import_hooks10.useSdkUiConfig)();
|
|
2353
2413
|
const isDisabled = disabled || isLoading;
|
|
2354
|
-
return /* @__PURE__ */ (0,
|
|
2414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
2355
2415
|
"button",
|
|
2356
2416
|
__spreadProps(__spreadValues({
|
|
2357
2417
|
type,
|
|
@@ -2368,7 +2428,7 @@ var Button = (_a) => {
|
|
|
2368
2428
|
"aria-busy": isLoading,
|
|
2369
2429
|
"aria-label": ariaLabel
|
|
2370
2430
|
}, other), {
|
|
2371
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
2431
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
2372
2432
|
"span",
|
|
2373
2433
|
{
|
|
2374
2434
|
className: cn(
|
|
@@ -2378,9 +2438,9 @@ var Button = (_a) => {
|
|
|
2378
2438
|
),
|
|
2379
2439
|
"aria-hidden": "true"
|
|
2380
2440
|
}
|
|
2381
|
-
) : /* @__PURE__ */ (0,
|
|
2441
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
2382
2442
|
prefix != null ? prefix : null,
|
|
2383
|
-
/* @__PURE__ */ (0,
|
|
2443
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { children }),
|
|
2384
2444
|
suffix != null ? suffix : null
|
|
2385
2445
|
] })
|
|
2386
2446
|
})
|
|
@@ -2389,10 +2449,10 @@ var Button = (_a) => {
|
|
|
2389
2449
|
Button.displayName = "Button";
|
|
2390
2450
|
|
|
2391
2451
|
// src/primitives/search/search-empty-icon.tsx
|
|
2392
|
-
var
|
|
2452
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
2393
2453
|
var SearchEmptyIcon = (_a) => {
|
|
2394
2454
|
var _b = _a, { title, className } = _b, props = __objRest(_b, ["title", "className"]);
|
|
2395
|
-
return /* @__PURE__ */ (0,
|
|
2455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
2396
2456
|
"svg",
|
|
2397
2457
|
__spreadProps(__spreadValues(__spreadValues({
|
|
2398
2458
|
viewBox: "0 0 40 40",
|
|
@@ -2401,9 +2461,9 @@ var SearchEmptyIcon = (_a) => {
|
|
|
2401
2461
|
className
|
|
2402
2462
|
}, getIconA11yProps(title)), props), {
|
|
2403
2463
|
children: [
|
|
2404
|
-
title ? /* @__PURE__ */ (0,
|
|
2405
|
-
/* @__PURE__ */ (0,
|
|
2406
|
-
/* @__PURE__ */ (0,
|
|
2464
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("title", { children: title }) : null,
|
|
2465
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("circle", { cx: "19.9987", cy: "20.0013", r: "9.2", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
2466
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2407
2467
|
"ellipse",
|
|
2408
2468
|
{
|
|
2409
2469
|
cx: "19.9987",
|
|
@@ -2441,14 +2501,14 @@ var typographyVariantClasses = {
|
|
|
2441
2501
|
};
|
|
2442
2502
|
|
|
2443
2503
|
// src/primitives/typography/index.tsx
|
|
2444
|
-
var
|
|
2504
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
2445
2505
|
var Typography = ({
|
|
2446
2506
|
as: Component = "p",
|
|
2447
2507
|
variant = "body",
|
|
2448
2508
|
className,
|
|
2449
2509
|
children
|
|
2450
2510
|
}) => {
|
|
2451
|
-
return /* @__PURE__ */ (0,
|
|
2511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
2452
2512
|
Component,
|
|
2453
2513
|
{
|
|
2454
2514
|
className: cn(
|
|
@@ -2464,7 +2524,7 @@ var Typography = ({
|
|
|
2464
2524
|
Typography.displayName = "Typography";
|
|
2465
2525
|
|
|
2466
2526
|
// src/primitives/state-message/index.tsx
|
|
2467
|
-
var
|
|
2527
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
2468
2528
|
var iconClassName = "h-9 w-9 text-agg-muted-foreground";
|
|
2469
2529
|
var StateMessage = ({
|
|
2470
2530
|
ariaLabel,
|
|
@@ -2475,8 +2535,8 @@ var StateMessage = ({
|
|
|
2475
2535
|
onAction,
|
|
2476
2536
|
className
|
|
2477
2537
|
}) => {
|
|
2478
|
-
const icon = tone === "warning" ? /* @__PURE__ */ (0,
|
|
2479
|
-
return /* @__PURE__ */ (0,
|
|
2538
|
+
const icon = tone === "warning" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(WarningIcon, { className: iconClassName, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SearchEmptyIcon, { className: iconClassName, "aria-hidden": true });
|
|
2539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2480
2540
|
"div",
|
|
2481
2541
|
{
|
|
2482
2542
|
className: cn(
|
|
@@ -2486,13 +2546,13 @@ var StateMessage = ({
|
|
|
2486
2546
|
role: "status",
|
|
2487
2547
|
"aria-live": "polite",
|
|
2488
2548
|
"aria-label": ariaLabel,
|
|
2489
|
-
children: /* @__PURE__ */ (0,
|
|
2549
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col items-center gap-6", children: [
|
|
2490
2550
|
icon,
|
|
2491
|
-
/* @__PURE__ */ (0,
|
|
2492
|
-
/* @__PURE__ */ (0,
|
|
2493
|
-
description ? /* @__PURE__ */ (0,
|
|
2551
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col items-center gap-2", children: [
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Typography, { variant: "body-large-strong", children: title }),
|
|
2553
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Typography, { variant: "body", className: "whitespace-pre-line text-agg-muted-foreground", children: description }) : null
|
|
2494
2554
|
] }),
|
|
2495
|
-
actionLabel && onAction ? /* @__PURE__ */ (0,
|
|
2555
|
+
actionLabel && onAction ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2496
2556
|
Button,
|
|
2497
2557
|
{
|
|
2498
2558
|
variant: "tertiary",
|
|
@@ -2514,7 +2574,7 @@ var StateMessage = ({
|
|
|
2514
2574
|
StateMessage.displayName = "StateMessage";
|
|
2515
2575
|
|
|
2516
2576
|
// src/primitives/venue-logo/index.tsx
|
|
2517
|
-
var
|
|
2577
|
+
var import_hooks11 = require("@agg-market/hooks");
|
|
2518
2578
|
|
|
2519
2579
|
// src/primitives/remote-image/index.tsx
|
|
2520
2580
|
var import_react = require("react");
|
|
@@ -2526,7 +2586,7 @@ var skeletonClasses = "h-full w-full rounded-agg-lg";
|
|
|
2526
2586
|
var placeholderClasses = "flex h-full w-full items-center justify-center bg-agg-secondary-hover rounded-agg-lg";
|
|
2527
2587
|
|
|
2528
2588
|
// src/primitives/remote-image/index.tsx
|
|
2529
|
-
var
|
|
2589
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
2530
2590
|
var isValidSrc = (src) => typeof src === "string" && src.length > 0;
|
|
2531
2591
|
var RemoteImage = ({
|
|
2532
2592
|
src,
|
|
@@ -2557,7 +2617,7 @@ var RemoteImage = ({
|
|
|
2557
2617
|
setStatus("error");
|
|
2558
2618
|
};
|
|
2559
2619
|
const sizeStyle = width !== void 0 || height !== void 0 ? { width: width != null ? width : void 0, height: height != null ? height : void 0 } : void 0;
|
|
2560
|
-
return /* @__PURE__ */ (0,
|
|
2620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
2561
2621
|
"div",
|
|
2562
2622
|
{
|
|
2563
2623
|
className: cn(containerClasses, classNames == null ? void 0 : classNames.root, className),
|
|
@@ -2574,17 +2634,17 @@ var RemoteImage = ({
|
|
|
2574
2634
|
"aria-label": ariaLabel,
|
|
2575
2635
|
title,
|
|
2576
2636
|
children: [
|
|
2577
|
-
status === "loading" && /* @__PURE__ */ (0,
|
|
2578
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
2637
|
+
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SkeletonBlock, { className: cn(skeletonClasses, classNames == null ? void 0 : classNames.placeholder) }),
|
|
2638
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
2579
2639
|
"div",
|
|
2580
2640
|
{
|
|
2581
2641
|
className: cn(placeholderClasses, classNames == null ? void 0 : classNames.placeholder),
|
|
2582
2642
|
"aria-hidden": true,
|
|
2583
2643
|
"aria-errormessage": "Image failed to load",
|
|
2584
|
-
children: /* @__PURE__ */ (0,
|
|
2644
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Icon, { name: "image", size: "medium", className: "text-agg-muted-foreground" })
|
|
2585
2645
|
}
|
|
2586
2646
|
),
|
|
2587
|
-
isValidSrc(src) && status !== "error" && /* @__PURE__ */ (0,
|
|
2647
|
+
isValidSrc(src) && status !== "error" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
2588
2648
|
"img",
|
|
2589
2649
|
{
|
|
2590
2650
|
src,
|
|
@@ -2617,7 +2677,7 @@ var resolveLogoPrimaryColor = ({
|
|
|
2617
2677
|
};
|
|
2618
2678
|
|
|
2619
2679
|
// src/primitives/venue-logo/svg/logo-kalshi.tsx
|
|
2620
|
-
var
|
|
2680
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
2621
2681
|
var KALSHI_GREEN = "#18C590";
|
|
2622
2682
|
var LogoKalshiIcon = (_a) => {
|
|
2623
2683
|
var _b = _a, {
|
|
@@ -2636,7 +2696,7 @@ var LogoKalshiIcon = (_a) => {
|
|
|
2636
2696
|
isColor,
|
|
2637
2697
|
color
|
|
2638
2698
|
});
|
|
2639
|
-
return /* @__PURE__ */ (0,
|
|
2699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
2640
2700
|
"svg",
|
|
2641
2701
|
__spreadProps(__spreadValues(__spreadValues({
|
|
2642
2702
|
viewBox: "0 0 100 100",
|
|
@@ -2644,8 +2704,8 @@ var LogoKalshiIcon = (_a) => {
|
|
|
2644
2704
|
fill: "none"
|
|
2645
2705
|
}, getIconA11yProps(title)), props), {
|
|
2646
2706
|
children: [
|
|
2647
|
-
title ? /* @__PURE__ */ (0,
|
|
2648
|
-
/* @__PURE__ */ (0,
|
|
2707
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("title", { children: title }) : null,
|
|
2708
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
2649
2709
|
"path",
|
|
2650
2710
|
{
|
|
2651
2711
|
d: "M54.9798 47.579L79.4249 85.9995H58.2273L38.2531 52.9344V85.9995H20.4189V13.9995H38.2531V45.4356L59.6547 13.9995H78.7119L54.9798 47.579Z",
|
|
@@ -2659,7 +2719,7 @@ var LogoKalshiIcon = (_a) => {
|
|
|
2659
2719
|
LogoKalshiIcon.displayName = "LogoKalshiIcon";
|
|
2660
2720
|
|
|
2661
2721
|
// src/primitives/venue-logo/svg/logo-limitless.tsx
|
|
2662
|
-
var
|
|
2722
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
2663
2723
|
var LIMITLESS_BLACK = "#000000";
|
|
2664
2724
|
var LogoLimitlessIcon = (_a) => {
|
|
2665
2725
|
var _b = _a, {
|
|
@@ -2678,7 +2738,7 @@ var LogoLimitlessIcon = (_a) => {
|
|
|
2678
2738
|
isColor,
|
|
2679
2739
|
color
|
|
2680
2740
|
});
|
|
2681
|
-
return /* @__PURE__ */ (0,
|
|
2741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
2682
2742
|
"svg",
|
|
2683
2743
|
__spreadProps(__spreadValues(__spreadValues({
|
|
2684
2744
|
viewBox: "0 0 44 32",
|
|
@@ -2686,8 +2746,8 @@ var LogoLimitlessIcon = (_a) => {
|
|
|
2686
2746
|
fill: "none"
|
|
2687
2747
|
}, getIconA11yProps(title)), props), {
|
|
2688
2748
|
children: [
|
|
2689
|
-
title ? /* @__PURE__ */ (0,
|
|
2690
|
-
/* @__PURE__ */ (0,
|
|
2749
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("title", { children: title }) : null,
|
|
2750
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2691
2751
|
"path",
|
|
2692
2752
|
{
|
|
2693
2753
|
fill: primaryColor,
|
|
@@ -2696,7 +2756,7 @@ var LogoLimitlessIcon = (_a) => {
|
|
|
2696
2756
|
clipRule: "evenodd"
|
|
2697
2757
|
}
|
|
2698
2758
|
),
|
|
2699
|
-
/* @__PURE__ */ (0,
|
|
2759
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2700
2760
|
"path",
|
|
2701
2761
|
{
|
|
2702
2762
|
fill: primaryColor,
|
|
@@ -2705,7 +2765,7 @@ var LogoLimitlessIcon = (_a) => {
|
|
|
2705
2765
|
clipRule: "evenodd"
|
|
2706
2766
|
}
|
|
2707
2767
|
),
|
|
2708
|
-
/* @__PURE__ */ (0,
|
|
2768
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2709
2769
|
"path",
|
|
2710
2770
|
{
|
|
2711
2771
|
fill: primaryColor,
|
|
@@ -2714,7 +2774,7 @@ var LogoLimitlessIcon = (_a) => {
|
|
|
2714
2774
|
clipRule: "evenodd"
|
|
2715
2775
|
}
|
|
2716
2776
|
),
|
|
2717
|
-
/* @__PURE__ */ (0,
|
|
2777
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2718
2778
|
"path",
|
|
2719
2779
|
{
|
|
2720
2780
|
fill: primaryColor,
|
|
@@ -2723,7 +2783,7 @@ var LogoLimitlessIcon = (_a) => {
|
|
|
2723
2783
|
clipRule: "evenodd"
|
|
2724
2784
|
}
|
|
2725
2785
|
),
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2786
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2727
2787
|
"path",
|
|
2728
2788
|
{
|
|
2729
2789
|
fill: primaryColor,
|
|
@@ -2739,7 +2799,7 @@ var LogoLimitlessIcon = (_a) => {
|
|
|
2739
2799
|
LogoLimitlessIcon.displayName = "LogoLimitlessIcon";
|
|
2740
2800
|
|
|
2741
2801
|
// src/primitives/venue-logo/svg/logo-opinion.tsx
|
|
2742
|
-
var
|
|
2802
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
2743
2803
|
var OPINION_BLACK = "#000000";
|
|
2744
2804
|
var LogoOpinionIcon = (_a) => {
|
|
2745
2805
|
var _b = _a, {
|
|
@@ -2758,7 +2818,7 @@ var LogoOpinionIcon = (_a) => {
|
|
|
2758
2818
|
isColor,
|
|
2759
2819
|
color
|
|
2760
2820
|
});
|
|
2761
|
-
return /* @__PURE__ */ (0,
|
|
2821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
2762
2822
|
"svg",
|
|
2763
2823
|
__spreadProps(__spreadValues(__spreadValues({
|
|
2764
2824
|
viewBox: "0 0 100 100",
|
|
@@ -2766,8 +2826,8 @@ var LogoOpinionIcon = (_a) => {
|
|
|
2766
2826
|
fill: "none"
|
|
2767
2827
|
}, getIconA11yProps(title)), props), {
|
|
2768
2828
|
children: [
|
|
2769
|
-
title ? /* @__PURE__ */ (0,
|
|
2770
|
-
/* @__PURE__ */ (0,
|
|
2829
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("title", { children: title }) : null,
|
|
2830
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
2771
2831
|
"path",
|
|
2772
2832
|
{
|
|
2773
2833
|
d: "M51.8239 68.4603L56.9659 68.0094L58.8049 89.0576C61.1459 88.5314 63.4349 87.7952 65.6437 86.8578V68.1879H71.9955V83.4385C74.6496 81.6828 77.0863 79.619 79.2548 77.2898L80.0716 67.958L85.516 68.433C88.6185 62.4381 90.156 55.7558 89.9858 49.0072C89.8154 42.2584 87.9429 35.6623 84.542 29.8316L84.3394 32.1494L77.9876 31.5927L78.8042 22.2668C76.7468 20.1288 74.4594 18.225 71.9835 16.5902V31.9164H65.6317V13.1739C62.9224 12.0205 60.0929 11.173 57.1957 10.6473L59.0317 31.6441L53.8897 32.0949L51.9599 10.0482C51.3128 10.0179 50.6593 9.99976 50.006 9.99976C47.4581 9.99976 44.9161 10.2419 42.414 10.723L46.0438 31.3899L42.1297 32.0798L38.5304 11.6701C35.1755 12.6725 31.9677 14.1143 28.9905 15.9578L33.0435 31.0873L29.9705 31.9134L26.2018 17.8369C23.2938 19.9923 20.6902 22.5308 18.4615 25.3835L20.4246 30.7787L18.1833 31.5956L16.7707 27.7134C14.5111 31.0771 12.7772 34.7657 11.6287 38.652L12.2639 38.4221L20.4306 60.8471L18.1893 61.6641L10.8877 41.5963C9.21542 49.4012 9.91256 57.528 12.8896 64.9338C15.8667 72.3395 20.9879 78.6865 27.5961 83.1601L23.8031 68.9989L26.8762 68.1728L31.5162 85.4991C34.6952 87.1593 38.0844 88.3808 41.5914 89.1303L38.0132 68.7296L41.9301 68.0397L45.7684 89.8262C47.1811 89.9757 48.6007 90.0505 50.0212 90.0502C51.2583 90.0502 52.4863 89.9926 53.6963 89.8807L51.8239 68.4603ZM80.1017 37.8985L86.4385 38.4524L84.3605 62.2299L78.0087 61.6761L80.1017 37.8985ZM65.6528 38.1315H72.0046V61.9969H65.6528V38.1315ZM56.975 37.9501L59.053 61.7277L53.911 62.1785L51.8299 38.4009L56.975 37.9501ZM29.9976 62.003L23.8243 38.9486L26.8974 38.1255L33.0707 61.1649L29.9976 62.003ZM42.157 62.1603L38.0132 38.658L41.9301 37.9683L46.0709 61.4674L42.157 62.1603Z",
|
|
@@ -2781,7 +2841,7 @@ var LogoOpinionIcon = (_a) => {
|
|
|
2781
2841
|
LogoOpinionIcon.displayName = "LogoOpinionIcon";
|
|
2782
2842
|
|
|
2783
2843
|
// src/primitives/venue-logo/svg/logo-polymarket.tsx
|
|
2784
|
-
var
|
|
2844
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
2785
2845
|
var POLYMARKET_BLUE = "#2E5CFF";
|
|
2786
2846
|
var LogoPolymarketIcon = (_a) => {
|
|
2787
2847
|
var _b = _a, {
|
|
@@ -2800,7 +2860,7 @@ var LogoPolymarketIcon = (_a) => {
|
|
|
2800
2860
|
isColor,
|
|
2801
2861
|
color
|
|
2802
2862
|
});
|
|
2803
|
-
return /* @__PURE__ */ (0,
|
|
2863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
2804
2864
|
"svg",
|
|
2805
2865
|
__spreadProps(__spreadValues(__spreadValues({
|
|
2806
2866
|
viewBox: "0 0 100 100",
|
|
@@ -2808,8 +2868,8 @@ var LogoPolymarketIcon = (_a) => {
|
|
|
2808
2868
|
fill: "none"
|
|
2809
2869
|
}, getIconA11yProps(title)), props), {
|
|
2810
2870
|
children: [
|
|
2811
|
-
title ? /* @__PURE__ */ (0,
|
|
2812
|
-
/* @__PURE__ */ (0,
|
|
2871
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("title", { children: title }) : null,
|
|
2872
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
2813
2873
|
"path",
|
|
2814
2874
|
{
|
|
2815
2875
|
d: "M81.0904 84.2882C81.0904 87.9246 81.0904 89.7428 79.901 90.644C78.7119 91.5456 76.9613 91.0542 73.4603 90.0717L17.1975 74.2838C15.0881 73.6919 14.0332 73.3959 13.4233 72.5913C12.8135 71.7866 12.8135 70.6911 12.8135 68.5002V31.4998C12.8135 29.309 12.8135 28.2134 13.4233 27.4088C14.0332 26.6042 15.0881 26.3081 17.1975 25.7163L73.4603 9.92806C76.9613 8.94572 78.7119 8.45448 79.901 9.35587C81.0904 10.2573 81.0904 12.0755 81.0904 15.7119V84.2882ZM26.8451 69.1363L73.4308 82.2104V56.0637L26.8451 69.1363ZM20.4723 63.0711L67.0487 50L20.4723 36.929V63.0711ZM26.8446 30.8638L73.4308 43.9366V17.7896L26.8446 30.8638Z",
|
|
@@ -2823,7 +2883,7 @@ var LogoPolymarketIcon = (_a) => {
|
|
|
2823
2883
|
LogoPolymarketIcon.displayName = "LogoPolymarketIcon";
|
|
2824
2884
|
|
|
2825
2885
|
// src/primitives/venue-logo/svg/logo-probable.tsx
|
|
2826
|
-
var
|
|
2886
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
2827
2887
|
var PROBABLE_ORANGE = "#F05923";
|
|
2828
2888
|
var LogoProbableIcon = (_a) => {
|
|
2829
2889
|
var _b = _a, {
|
|
@@ -2842,7 +2902,7 @@ var LogoProbableIcon = (_a) => {
|
|
|
2842
2902
|
isColor,
|
|
2843
2903
|
color
|
|
2844
2904
|
});
|
|
2845
|
-
return /* @__PURE__ */ (0,
|
|
2905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
2846
2906
|
"svg",
|
|
2847
2907
|
__spreadProps(__spreadValues(__spreadValues({
|
|
2848
2908
|
viewBox: "0 0 100 100",
|
|
@@ -2850,16 +2910,16 @@ var LogoProbableIcon = (_a) => {
|
|
|
2850
2910
|
fill: "none"
|
|
2851
2911
|
}, getIconA11yProps(title)), props), {
|
|
2852
2912
|
children: [
|
|
2853
|
-
title ? /* @__PURE__ */ (0,
|
|
2854
|
-
/* @__PURE__ */ (0,
|
|
2913
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("title", { children: title }) : null,
|
|
2914
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
2855
2915
|
"path",
|
|
2856
2916
|
{
|
|
2857
2917
|
d: "M75.625 59.3489C75.6247 53.7323 71.0719 49.1792 65.4551 49.179H33.9209C28.3039 49.179 23.7503 53.7321 23.75 59.3489C23.75 64.9659 28.3038 69.5198 33.9209 69.5198H65.4551C71.0719 69.5195 75.625 64.9658 75.625 59.3489ZM90.625 59.3489C90.625 73.2501 79.3562 84.5195 65.4551 84.5198H33.9209C20.0196 84.5198 8.75 73.2502 8.75 59.3489C8.75026 45.4477 20.0198 34.179 33.9209 34.179H65.4551C79.3559 34.1792 90.6247 45.4478 90.625 59.3489Z",
|
|
2858
2918
|
fill: primaryColor
|
|
2859
2919
|
}
|
|
2860
2920
|
),
|
|
2861
|
-
/* @__PURE__ */ (0,
|
|
2862
|
-
/* @__PURE__ */ (0,
|
|
2921
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("path", { d: "M90.9329 15.4546V30.4546H8.90234V15.4546H90.9329Z", fill: primaryColor }),
|
|
2922
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
2863
2923
|
"path",
|
|
2864
2924
|
{
|
|
2865
2925
|
d: "M64.5742 51.3496C68.9894 51.3496 72.5742 54.9344 72.5742 59.3496C72.5742 63.7648 68.9894 67.3496 64.5742 67.3496C60.159 67.3496 56.5742 63.7648 56.5742 59.3496C56.5742 54.9344 60.159 51.3496 64.5742 51.3496Z",
|
|
@@ -2903,7 +2963,7 @@ var sizeClasses2 = {
|
|
|
2903
2963
|
};
|
|
2904
2964
|
|
|
2905
2965
|
// src/primitives/venue-logo/index.tsx
|
|
2906
|
-
var
|
|
2966
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
2907
2967
|
var VenueLogo = ({
|
|
2908
2968
|
venue,
|
|
2909
2969
|
variant = "icon",
|
|
@@ -2916,14 +2976,16 @@ var VenueLogo = ({
|
|
|
2916
2976
|
title
|
|
2917
2977
|
}) => {
|
|
2918
2978
|
var _a;
|
|
2919
|
-
const {
|
|
2920
|
-
|
|
2979
|
+
const {
|
|
2980
|
+
features: { showVenueLogo }
|
|
2981
|
+
} = (0, import_hooks11.useAggUiConfig)();
|
|
2982
|
+
const labels = (0, import_hooks11.useLabels)();
|
|
2921
2983
|
const sizeClass = sizeClasses2[size];
|
|
2922
2984
|
const resolvedLabel = (_a = ariaLabel != null ? ariaLabel : labels.venues[venue]) != null ? _a : venueLogoLabels[venue];
|
|
2923
2985
|
if (!showVenueLogo)
|
|
2924
2986
|
return null;
|
|
2925
2987
|
if (variant === "logo") {
|
|
2926
|
-
return /* @__PURE__ */ (0,
|
|
2988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
2927
2989
|
RemoteImage,
|
|
2928
2990
|
{
|
|
2929
2991
|
src: venueLogoUrlRegistry[venue],
|
|
@@ -2935,7 +2997,7 @@ var VenueLogo = ({
|
|
|
2935
2997
|
}
|
|
2936
2998
|
const Component = venueLogoRegistry[venue];
|
|
2937
2999
|
const resolvedIsColor = isMonochromatic ? false : isColor;
|
|
2938
|
-
return /* @__PURE__ */ (0,
|
|
3000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
2939
3001
|
Component,
|
|
2940
3002
|
{
|
|
2941
3003
|
className: cn("group/agg-venue-logo", "shrink-0", sizeClass, className),
|
|
@@ -2961,8 +3023,8 @@ var isErrorWithStatus = (error, status) => {
|
|
|
2961
3023
|
|
|
2962
3024
|
// src/primitives/switch-button/index.tsx
|
|
2963
3025
|
var import_react2 = require("react");
|
|
2964
|
-
var
|
|
2965
|
-
var
|
|
3026
|
+
var import_hooks12 = require("@agg-market/hooks");
|
|
3027
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
2966
3028
|
var resolveActiveIndex = (options, value) => {
|
|
2967
3029
|
const activeIndex = options.findIndex((option) => option.value === value);
|
|
2968
3030
|
if (activeIndex >= 0)
|
|
@@ -2989,7 +3051,9 @@ var SwitchButton = ({
|
|
|
2989
3051
|
ariaLabel,
|
|
2990
3052
|
className
|
|
2991
3053
|
}) => {
|
|
2992
|
-
const {
|
|
3054
|
+
const {
|
|
3055
|
+
features: { enableAnimations }
|
|
3056
|
+
} = (0, import_hooks12.useSdkUiConfig)();
|
|
2993
3057
|
const activeIndex = (0, import_react2.useMemo)(() => {
|
|
2994
3058
|
return resolveActiveIndex(options, value);
|
|
2995
3059
|
}, [options, value]);
|
|
@@ -3031,7 +3095,7 @@ var SwitchButton = ({
|
|
|
3031
3095
|
}
|
|
3032
3096
|
onValueChange(nextOption.value);
|
|
3033
3097
|
};
|
|
3034
|
-
return /* @__PURE__ */ (0,
|
|
3098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
3035
3099
|
"div",
|
|
3036
3100
|
{
|
|
3037
3101
|
className: cn(
|
|
@@ -3041,7 +3105,7 @@ var SwitchButton = ({
|
|
|
3041
3105
|
"cursor-pointer hover:bg-agg-tertiary",
|
|
3042
3106
|
className
|
|
3043
3107
|
),
|
|
3044
|
-
children: /* @__PURE__ */ (0,
|
|
3108
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
3045
3109
|
"div",
|
|
3046
3110
|
{
|
|
3047
3111
|
className: "relative grid min-w-0 flex-1 items-center",
|
|
@@ -3051,7 +3115,7 @@ var SwitchButton = ({
|
|
|
3051
3115
|
role: "tablist",
|
|
3052
3116
|
"aria-label": ariaLabel,
|
|
3053
3117
|
children: [
|
|
3054
|
-
/* @__PURE__ */ (0,
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
3055
3119
|
"span",
|
|
3056
3120
|
{
|
|
3057
3121
|
className: cn(
|
|
@@ -3071,7 +3135,7 @@ var SwitchButton = ({
|
|
|
3071
3135
|
options.map((option, optionIndex) => {
|
|
3072
3136
|
var _a;
|
|
3073
3137
|
const isActive = optionIndex === activeIndex;
|
|
3074
|
-
return /* @__PURE__ */ (0,
|
|
3138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
3075
3139
|
"button",
|
|
3076
3140
|
{
|
|
3077
3141
|
type: "button",
|
|
@@ -3116,10 +3180,10 @@ SwitchButton.displayName = "SwitchButton";
|
|
|
3116
3180
|
|
|
3117
3181
|
// src/primitives/chart/index.tsx
|
|
3118
3182
|
var import_dayjs = __toESM(require("dayjs"));
|
|
3119
|
-
var
|
|
3183
|
+
var import_hooks13 = require("@agg-market/hooks");
|
|
3120
3184
|
var import_react3 = require("react");
|
|
3121
3185
|
var import_liveline = require("liveline");
|
|
3122
|
-
var
|
|
3186
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
3123
3187
|
var normalizeSeries = (series) => {
|
|
3124
3188
|
return series.map((seriesItem) => {
|
|
3125
3189
|
const pointsByTime = /* @__PURE__ */ new Map();
|
|
@@ -3244,7 +3308,7 @@ var renderDefaultSeriesControls = ({
|
|
|
3244
3308
|
seriesSwitchAriaLabel,
|
|
3245
3309
|
formatSeriesOptionAriaLabel
|
|
3246
3310
|
}) => {
|
|
3247
|
-
return /* @__PURE__ */ (0,
|
|
3311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3248
3312
|
SwitchButton,
|
|
3249
3313
|
{
|
|
3250
3314
|
ariaLabel: seriesSwitchAriaLabel,
|
|
@@ -3281,8 +3345,11 @@ var LineChart = ({
|
|
|
3281
3345
|
live
|
|
3282
3346
|
}) => {
|
|
3283
3347
|
var _a, _b;
|
|
3284
|
-
const labels = (0,
|
|
3285
|
-
const {
|
|
3348
|
+
const labels = (0, import_hooks13.useLabels)();
|
|
3349
|
+
const {
|
|
3350
|
+
general: { theme },
|
|
3351
|
+
features: { enableGradients, enableLiveUpdates }
|
|
3352
|
+
} = (0, import_hooks13.useSdkUiConfig)();
|
|
3286
3353
|
const isLive = enableLiveUpdates && (live != null ? live : true);
|
|
3287
3354
|
const normalizedSeries = (0, import_react3.useMemo)(() => {
|
|
3288
3355
|
return normalizeSeries(series);
|
|
@@ -3364,9 +3431,9 @@ var LineChart = ({
|
|
|
3364
3431
|
seriesSwitchAriaLabel: labels.common.lineChartSeriesSwitchAria,
|
|
3365
3432
|
formatSeriesOptionAriaLabel: labels.common.lineChartSeriesOptionAria
|
|
3366
3433
|
}) : null : null;
|
|
3367
|
-
return /* @__PURE__ */ (0,
|
|
3368
|
-
!isLoading && seriesControls ? /* @__PURE__ */ (0,
|
|
3369
|
-
/* @__PURE__ */ (0,
|
|
3434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: cn("group/agg-chart", "w-full", classNames == null ? void 0 : classNames.root), style: { width }, children: [
|
|
3435
|
+
!isLoading && seriesControls ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: cn("mb-3", classNames == null ? void 0 : classNames.controls), children: seriesControls }) : null,
|
|
3436
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3370
3437
|
"div",
|
|
3371
3438
|
{
|
|
3372
3439
|
className: cn(
|
|
@@ -3376,7 +3443,7 @@ var LineChart = ({
|
|
|
3376
3443
|
style: { height },
|
|
3377
3444
|
role: "img",
|
|
3378
3445
|
"aria-label": chartType === "candlestick" ? labels.common.candlestickChartAria : labels.common.lineChartAria,
|
|
3379
|
-
children: /* @__PURE__ */ (0,
|
|
3446
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3380
3447
|
import_liveline.Liveline,
|
|
3381
3448
|
{
|
|
3382
3449
|
className: cn("h-full w-full agg-livechart", classNames == null ? void 0 : classNames.liveline),
|
|
@@ -3400,7 +3467,7 @@ var LineChart = ({
|
|
|
3400
3467
|
formatTime: timeFormatter,
|
|
3401
3468
|
padding: {
|
|
3402
3469
|
top: 12,
|
|
3403
|
-
right:
|
|
3470
|
+
right: 28,
|
|
3404
3471
|
bottom: 28,
|
|
3405
3472
|
left: 12
|
|
3406
3473
|
},
|
|
@@ -3416,8 +3483,8 @@ LineChart.displayName = "LineChart";
|
|
|
3416
3483
|
|
|
3417
3484
|
// src/primitives/select/index.tsx
|
|
3418
3485
|
var import_react4 = require("react");
|
|
3419
|
-
var
|
|
3420
|
-
var
|
|
3486
|
+
var import_hooks14 = require("@agg-market/hooks");
|
|
3487
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
3421
3488
|
var Select = ({
|
|
3422
3489
|
items,
|
|
3423
3490
|
value,
|
|
@@ -3427,8 +3494,10 @@ var Select = ({
|
|
|
3427
3494
|
disabled = false
|
|
3428
3495
|
}) => {
|
|
3429
3496
|
var _a;
|
|
3430
|
-
const labels = (0,
|
|
3431
|
-
const {
|
|
3497
|
+
const labels = (0, import_hooks14.useLabels)();
|
|
3498
|
+
const {
|
|
3499
|
+
features: { enableAnimations }
|
|
3500
|
+
} = (0, import_hooks14.useSdkUiConfig)();
|
|
3432
3501
|
const hasEnabledItems = items.some((item) => !item.disabled);
|
|
3433
3502
|
const hasAnyIcon = items.some((item) => item.iconUrl);
|
|
3434
3503
|
const [isOpen, setIsOpen] = (0, import_react4.useState)(false);
|
|
@@ -3458,8 +3527,8 @@ var Select = ({
|
|
|
3458
3527
|
const isDisabled = disabled || !hasEnabledItems;
|
|
3459
3528
|
const selectedItem = items.find((item) => item.value === value);
|
|
3460
3529
|
if (!hasAnyIcon) {
|
|
3461
|
-
return /* @__PURE__ */ (0,
|
|
3462
|
-
/* @__PURE__ */ (0,
|
|
3530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("label", { className: cn("group/agg-select", "relative inline-flex w-full", className), children: [
|
|
3531
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3463
3532
|
"select",
|
|
3464
3533
|
{
|
|
3465
3534
|
"aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
|
|
@@ -3475,19 +3544,19 @@ var Select = ({
|
|
|
3475
3544
|
disabled: isDisabled,
|
|
3476
3545
|
value,
|
|
3477
3546
|
onChange: (event) => onChange(event.target.value),
|
|
3478
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
3547
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("option", { value: item.value, disabled: item.disabled, children: item.label }, item.value))
|
|
3479
3548
|
}
|
|
3480
3549
|
),
|
|
3481
|
-
/* @__PURE__ */ (0,
|
|
3550
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "pointer-events-none absolute inset-y-0 right-3 inline-flex items-center justify-center text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) })
|
|
3482
3551
|
] });
|
|
3483
3552
|
}
|
|
3484
|
-
return /* @__PURE__ */ (0,
|
|
3553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
3485
3554
|
"div",
|
|
3486
3555
|
{
|
|
3487
3556
|
ref: containerRef,
|
|
3488
3557
|
className: cn("group/agg-select", "relative inline-flex w-full", className),
|
|
3489
3558
|
children: [
|
|
3490
|
-
/* @__PURE__ */ (0,
|
|
3559
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
3491
3560
|
"button",
|
|
3492
3561
|
{
|
|
3493
3562
|
type: "button",
|
|
@@ -3507,7 +3576,7 @@ var Select = ({
|
|
|
3507
3576
|
),
|
|
3508
3577
|
onClick: () => setIsOpen((prev) => !prev),
|
|
3509
3578
|
children: [
|
|
3510
|
-
(selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0,
|
|
3579
|
+
(selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3511
3580
|
RemoteImage,
|
|
3512
3581
|
{
|
|
3513
3582
|
src: selectedItem.iconUrl,
|
|
@@ -3515,12 +3584,12 @@ var Select = ({
|
|
|
3515
3584
|
className: "h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
3516
3585
|
}
|
|
3517
3586
|
) : null,
|
|
3518
|
-
/* @__PURE__ */ (0,
|
|
3587
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
|
|
3519
3588
|
]
|
|
3520
3589
|
}
|
|
3521
3590
|
),
|
|
3522
|
-
/* @__PURE__ */ (0,
|
|
3523
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
3591
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "pointer-events-none absolute inset-y-0 right-3 inline-flex items-center justify-center text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) }),
|
|
3592
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3524
3593
|
"div",
|
|
3525
3594
|
{
|
|
3526
3595
|
role: "listbox",
|
|
@@ -3528,7 +3597,7 @@ var Select = ({
|
|
|
3528
3597
|
className: "absolute top-full left-0 z-50 mt-1 w-full overflow-hidden rounded-agg-md border border-agg-separator bg-agg-secondary shadow-lg",
|
|
3529
3598
|
children: items.map((item) => {
|
|
3530
3599
|
const isSelected = item.value === value;
|
|
3531
|
-
return /* @__PURE__ */ (0,
|
|
3600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
3532
3601
|
"button",
|
|
3533
3602
|
{
|
|
3534
3603
|
type: "button",
|
|
@@ -3548,7 +3617,7 @@ var Select = ({
|
|
|
3548
3617
|
}
|
|
3549
3618
|
},
|
|
3550
3619
|
children: [
|
|
3551
|
-
item.iconUrl ? /* @__PURE__ */ (0,
|
|
3620
|
+
item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3552
3621
|
RemoteImage,
|
|
3553
3622
|
{
|
|
3554
3623
|
src: item.iconUrl,
|
|
@@ -3556,7 +3625,7 @@ var Select = ({
|
|
|
3556
3625
|
className: "h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
3557
3626
|
}
|
|
3558
3627
|
) : null,
|
|
3559
|
-
/* @__PURE__ */ (0,
|
|
3628
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "truncate", children: item.label })
|
|
3560
3629
|
]
|
|
3561
3630
|
},
|
|
3562
3631
|
item.value
|
|
@@ -3570,68 +3639,204 @@ var Select = ({
|
|
|
3570
3639
|
};
|
|
3571
3640
|
Select.displayName = "Select";
|
|
3572
3641
|
|
|
3573
|
-
// src/
|
|
3574
|
-
var
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3642
|
+
// src/events/item/event-list-item.utils.ts
|
|
3643
|
+
var resolveEventListItemEvent = (fetchedEvent) => {
|
|
3644
|
+
if (!fetchedEvent)
|
|
3645
|
+
return void 0;
|
|
3646
|
+
if (!fetchedEvent.venueMarkets || fetchedEvent.venueMarkets.length === 0)
|
|
3647
|
+
return void 0;
|
|
3648
|
+
return fetchedEvent;
|
|
3649
|
+
};
|
|
3650
|
+
var normalizeProbability = (value) => {
|
|
3651
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
3652
|
+
return void 0;
|
|
3653
|
+
if (value < 0)
|
|
3654
|
+
return 0;
|
|
3655
|
+
if (value > 1)
|
|
3656
|
+
return 1;
|
|
3657
|
+
return value;
|
|
3658
|
+
};
|
|
3659
|
+
var hasDateLabel = (outcome) => {
|
|
3660
|
+
return !!toDate(outcome.label);
|
|
3661
|
+
};
|
|
3662
|
+
var sortOutcomes = (outcomes) => {
|
|
3663
|
+
if (outcomes.length <= 1)
|
|
3664
|
+
return outcomes;
|
|
3665
|
+
const now = Date.now();
|
|
3666
|
+
if (outcomes.some(hasDateLabel)) {
|
|
3667
|
+
return [...outcomes].sort((a, b) => {
|
|
3668
|
+
var _a, _b, _c, _d;
|
|
3669
|
+
const aDate = (_b = (_a = toDate(a.label)) == null ? void 0 : _a.getTime()) != null ? _b : 0;
|
|
3670
|
+
const bDate = (_d = (_c = toDate(b.label)) == null ? void 0 : _c.getTime()) != null ? _d : 0;
|
|
3671
|
+
return Math.abs(aDate - now) - Math.abs(bDate - now);
|
|
3672
|
+
});
|
|
3586
3673
|
}
|
|
3587
|
-
return
|
|
3674
|
+
return [...outcomes].sort((a, b) => {
|
|
3675
|
+
var _a, _b;
|
|
3676
|
+
const aPrice = (_a = normalizeProbability(a.price)) != null ? _a : 0;
|
|
3677
|
+
const bPrice = (_b = normalizeProbability(b.price)) != null ? _b : 0;
|
|
3678
|
+
return bPrice - aPrice;
|
|
3679
|
+
});
|
|
3588
3680
|
};
|
|
3589
|
-
var
|
|
3590
|
-
var _a;
|
|
3591
|
-
|
|
3592
|
-
|
|
3681
|
+
var compareVisibleOutcomeRows = (left, right) => {
|
|
3682
|
+
var _a, _b;
|
|
3683
|
+
const leftDate = toDate(resolveOutcomeTitle(left.outcome));
|
|
3684
|
+
const rightDate = toDate(resolveOutcomeTitle(right.outcome));
|
|
3685
|
+
if (leftDate && rightDate) {
|
|
3686
|
+
return leftDate.getTime() - rightDate.getTime();
|
|
3593
3687
|
}
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3688
|
+
const leftProbability = (_a = normalizeProbability(left.outcome.price)) != null ? _a : -1;
|
|
3689
|
+
const rightProbability = (_b = normalizeProbability(right.outcome.price)) != null ? _b : -1;
|
|
3690
|
+
return rightProbability - leftProbability;
|
|
3691
|
+
};
|
|
3692
|
+
var shouldReplaceVisibleOutcome = (current, next) => {
|
|
3693
|
+
var _a, _b;
|
|
3694
|
+
const currentVolume = typeof current.market.volume === "number" ? current.market.volume : -1;
|
|
3695
|
+
const nextVolume = typeof next.market.volume === "number" ? next.market.volume : -1;
|
|
3696
|
+
if (currentVolume !== nextVolume) {
|
|
3697
|
+
return nextVolume > currentVolume;
|
|
3597
3698
|
}
|
|
3598
|
-
|
|
3699
|
+
const currentProbability = (_a = normalizeProbability(current.outcome.price)) != null ? _a : -1;
|
|
3700
|
+
const nextProbability = (_b = normalizeProbability(next.outcome.price)) != null ? _b : -1;
|
|
3701
|
+
return nextProbability > currentProbability;
|
|
3599
3702
|
};
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
),
|
|
3620
|
-
isBarVariant ? cn(
|
|
3621
|
-
"min-w-20 overflow-hidden border-r border-agg-separator last:border-r-0",
|
|
3622
|
-
isSmall ? "px-3 text-agg-sm leading-agg-5" : "px-4 text-agg-base leading-agg-6"
|
|
3623
|
-
) : cn(isSmall ? "px-4 text-agg-sm leading-agg-5" : "px-5 text-agg-base leading-agg-6"),
|
|
3624
|
-
isBarVariant && isActive && "font-agg-bold text-agg-primary",
|
|
3625
|
-
isBarVariant && !isActive && "font-agg-normal text-agg-foreground",
|
|
3626
|
-
!isBarVariant && isActive && "font-agg-bold text-agg-primary",
|
|
3627
|
-
!isBarVariant && !isActive && "font-agg-normal text-agg-foreground",
|
|
3628
|
-
isDisabled && "cursor-not-allowed opacity-60"
|
|
3629
|
-
);
|
|
3703
|
+
var resolveVisibleOutcomes = (venueMarkets, maxOutcomes) => {
|
|
3704
|
+
const visibleOutcomesByLabel = /* @__PURE__ */ new Map();
|
|
3705
|
+
venueMarkets.forEach((market) => {
|
|
3706
|
+
sortOutcomes(market.venueMarketOutcomes).forEach((outcome) => {
|
|
3707
|
+
const title = resolveOutcomeTitle(outcome);
|
|
3708
|
+
const normalizedTitle = title.trim().toLowerCase();
|
|
3709
|
+
const nextVisibleOutcome = {
|
|
3710
|
+
venue: market.venue,
|
|
3711
|
+
market,
|
|
3712
|
+
outcome,
|
|
3713
|
+
title
|
|
3714
|
+
};
|
|
3715
|
+
const currentVisibleOutcome = visibleOutcomesByLabel.get(normalizedTitle);
|
|
3716
|
+
if (!currentVisibleOutcome || shouldReplaceVisibleOutcome(currentVisibleOutcome, nextVisibleOutcome)) {
|
|
3717
|
+
visibleOutcomesByLabel.set(normalizedTitle, nextVisibleOutcome);
|
|
3718
|
+
}
|
|
3719
|
+
});
|
|
3720
|
+
});
|
|
3721
|
+
return [...visibleOutcomesByLabel.values()].sort(compareVisibleOutcomeRows).slice(0, Math.max(1, maxOutcomes));
|
|
3630
3722
|
};
|
|
3631
|
-
var
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3723
|
+
var resolveOutcomeTitle = (outcome) => {
|
|
3724
|
+
if (outcome.title && outcome.title.trim())
|
|
3725
|
+
return outcome.title;
|
|
3726
|
+
return outcome.label;
|
|
3727
|
+
};
|
|
3728
|
+
var selectPrimaryVenueMarket = (venueMarkets) => {
|
|
3729
|
+
if (venueMarkets.length === 0)
|
|
3730
|
+
return void 0;
|
|
3731
|
+
if (venueMarkets.length === 1)
|
|
3732
|
+
return venueMarkets[0];
|
|
3733
|
+
return [...venueMarkets].sort((a, b) => {
|
|
3734
|
+
const aVolume = typeof a.volume === "number" ? a.volume : -1;
|
|
3735
|
+
const bVolume = typeof b.volume === "number" ? b.volume : -1;
|
|
3736
|
+
return bVolume - aVolume;
|
|
3737
|
+
})[0];
|
|
3738
|
+
};
|
|
3739
|
+
var resolveTileTitle = (event, primaryVenueMarket, titleOverride) => {
|
|
3740
|
+
if (typeof titleOverride === "string" && titleOverride.trim()) {
|
|
3741
|
+
return titleOverride;
|
|
3742
|
+
}
|
|
3743
|
+
if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.question) === "string" && primaryVenueMarket.question.trim()) {
|
|
3744
|
+
return primaryVenueMarket.question;
|
|
3745
|
+
}
|
|
3746
|
+
return event.title;
|
|
3747
|
+
};
|
|
3748
|
+
var resolveTileImage = (event, primaryVenueMarket, imageOverride) => {
|
|
3749
|
+
if (typeof imageOverride === "string" && imageOverride.trim()) {
|
|
3750
|
+
return imageOverride;
|
|
3751
|
+
}
|
|
3752
|
+
if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.image) === "string" && primaryVenueMarket.image.trim()) {
|
|
3753
|
+
return primaryVenueMarket.image;
|
|
3754
|
+
}
|
|
3755
|
+
if (typeof event.image === "string" && event.image.trim()) {
|
|
3756
|
+
return event.image;
|
|
3757
|
+
}
|
|
3758
|
+
return void 0;
|
|
3759
|
+
};
|
|
3760
|
+
var formatCountLabel = (count, singular, plural) => {
|
|
3761
|
+
return `${count} ${count === 1 ? singular : plural}`;
|
|
3762
|
+
};
|
|
3763
|
+
var getVenueSummary = (venueMarkets) => {
|
|
3764
|
+
const uniqueVenues = Array.from(new Set(venueMarkets.map((market) => market.venue)));
|
|
3765
|
+
return {
|
|
3766
|
+
marketCount: venueMarkets.length,
|
|
3767
|
+
venueCount: uniqueVenues.length,
|
|
3768
|
+
singleVenue: uniqueVenues.length === 1 ? uniqueVenues[0] : void 0
|
|
3769
|
+
};
|
|
3770
|
+
};
|
|
3771
|
+
var resolveVenueLabel = (venue, venueInfo, labels) => {
|
|
3772
|
+
var _a, _b;
|
|
3773
|
+
if (!venue)
|
|
3774
|
+
return labels.eventItem.venueSingular;
|
|
3775
|
+
return (_b = (_a = venueInfo == null ? void 0 : venueInfo[venue]) == null ? void 0 : _a.label) != null ? _b : labels.venues[venue];
|
|
3776
|
+
};
|
|
3777
|
+
|
|
3778
|
+
// src/primitives/tabs/index.tsx
|
|
3779
|
+
var import_react5 = require("react");
|
|
3780
|
+
var import_hooks15 = require("@agg-market/hooks");
|
|
3781
|
+
|
|
3782
|
+
// src/primitives/tabs/tabs.utils.ts
|
|
3783
|
+
var findNextEnabledIndex = (items, startIndex, direction) => {
|
|
3784
|
+
var _a;
|
|
3785
|
+
if (items.length === 0)
|
|
3786
|
+
return -1;
|
|
3787
|
+
for (let step = 1; step <= items.length; step += 1) {
|
|
3788
|
+
const nextIndex = (startIndex + direction * step + items.length) % items.length;
|
|
3789
|
+
if (!((_a = items[nextIndex]) == null ? void 0 : _a.disabled))
|
|
3790
|
+
return nextIndex;
|
|
3791
|
+
}
|
|
3792
|
+
return -1;
|
|
3793
|
+
};
|
|
3794
|
+
var findEdgeEnabledIndex = (items, direction) => {
|
|
3795
|
+
var _a;
|
|
3796
|
+
if (direction === 1) {
|
|
3797
|
+
return items.findIndex((item) => !item.disabled);
|
|
3798
|
+
}
|
|
3799
|
+
for (let index = items.length - 1; index >= 0; index -= 1) {
|
|
3800
|
+
if (!((_a = items[index]) == null ? void 0 : _a.disabled))
|
|
3801
|
+
return index;
|
|
3802
|
+
}
|
|
3803
|
+
return -1;
|
|
3804
|
+
};
|
|
3805
|
+
|
|
3806
|
+
// src/primitives/tabs/index.tsx
|
|
3807
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
3808
|
+
var mobileTabsMediaQuery = "(max-width: 512px)";
|
|
3809
|
+
var getTabButtonClassName = ({
|
|
3810
|
+
enableAnimations,
|
|
3811
|
+
isBarVariant,
|
|
3812
|
+
isActive,
|
|
3813
|
+
isDisabled,
|
|
3814
|
+
size
|
|
3815
|
+
}) => {
|
|
3816
|
+
const isSmall = size === "s";
|
|
3817
|
+
return cn(
|
|
3818
|
+
"cursor-pointer disabled:cursor-not-allowed",
|
|
3819
|
+
"relative inline-flex h-full shrink-0 items-center justify-center gap-2 font-agg-sans",
|
|
3820
|
+
isBarVariant ? "hover:text-agg-foreground hover:bg-agg-secondary-hover" : "hover:text-agg-foreground hover:font-agg-bold",
|
|
3821
|
+
getMotionClassName(
|
|
3822
|
+
enableAnimations,
|
|
3823
|
+
"transition-[colors] duration-300 ease-in-out motion-reduce:transition-none"
|
|
3824
|
+
),
|
|
3825
|
+
isBarVariant ? cn(
|
|
3826
|
+
"min-w-20 overflow-hidden border-r border-agg-separator last:border-r-0",
|
|
3827
|
+
isSmall ? "px-3 text-agg-sm leading-agg-5" : "px-4 text-agg-base leading-agg-6"
|
|
3828
|
+
) : cn(isSmall ? "px-4 text-agg-sm leading-agg-5" : "px-5 text-agg-base leading-agg-6"),
|
|
3829
|
+
isBarVariant && isActive && "font-agg-bold text-agg-primary",
|
|
3830
|
+
isBarVariant && !isActive && "font-agg-normal text-agg-foreground",
|
|
3831
|
+
!isBarVariant && isActive && "font-agg-bold text-agg-primary",
|
|
3832
|
+
!isBarVariant && !isActive && "font-agg-normal text-agg-foreground",
|
|
3833
|
+
isDisabled && "cursor-not-allowed opacity-60"
|
|
3834
|
+
);
|
|
3835
|
+
};
|
|
3836
|
+
var Tabs = ({
|
|
3837
|
+
items,
|
|
3838
|
+
value,
|
|
3839
|
+
onChange,
|
|
3635
3840
|
variant = "bar",
|
|
3636
3841
|
size = "m",
|
|
3637
3842
|
overflowBehavior,
|
|
@@ -3639,8 +3844,10 @@ var Tabs = ({
|
|
|
3639
3844
|
className,
|
|
3640
3845
|
classNames
|
|
3641
3846
|
}) => {
|
|
3642
|
-
const labels = (0,
|
|
3643
|
-
const {
|
|
3847
|
+
const labels = (0, import_hooks15.useLabels)();
|
|
3848
|
+
const {
|
|
3849
|
+
features: { enableAnimations }
|
|
3850
|
+
} = (0, import_hooks15.useSdkUiConfig)();
|
|
3644
3851
|
const buttonRefs = (0, import_react5.useRef)([]);
|
|
3645
3852
|
const dragStateRef = (0, import_react5.useRef)({
|
|
3646
3853
|
isPointerDown: false,
|
|
@@ -3956,7 +4163,7 @@ var Tabs = ({
|
|
|
3956
4163
|
});
|
|
3957
4164
|
}, [enableAnimations, renderedItems, shouldUseOverflowScroll, value]);
|
|
3958
4165
|
if (shouldUseOverflowSelect) {
|
|
3959
|
-
return /* @__PURE__ */ (0,
|
|
4166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: cn("w-full", className, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3960
4167
|
Select,
|
|
3961
4168
|
{
|
|
3962
4169
|
ariaLabel,
|
|
@@ -3968,7 +4175,7 @@ var Tabs = ({
|
|
|
3968
4175
|
}
|
|
3969
4176
|
) });
|
|
3970
4177
|
}
|
|
3971
|
-
return /* @__PURE__ */ (0,
|
|
4178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
3972
4179
|
"div",
|
|
3973
4180
|
{
|
|
3974
4181
|
className: cn(
|
|
@@ -3979,7 +4186,7 @@ var Tabs = ({
|
|
|
3979
4186
|
classNames == null ? void 0 : classNames.root
|
|
3980
4187
|
),
|
|
3981
4188
|
children: [
|
|
3982
|
-
/* @__PURE__ */ (0,
|
|
4189
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
3983
4190
|
"div",
|
|
3984
4191
|
{
|
|
3985
4192
|
ref: tabListRef,
|
|
@@ -3995,7 +4202,7 @@ var Tabs = ({
|
|
|
3995
4202
|
children: [
|
|
3996
4203
|
renderedItems.map((item, index) => {
|
|
3997
4204
|
const isActive = item.value === value;
|
|
3998
|
-
return /* @__PURE__ */ (0,
|
|
4205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
3999
4206
|
"button",
|
|
4000
4207
|
{
|
|
4001
4208
|
ref: (buttonElement) => {
|
|
@@ -4024,7 +4231,7 @@ var Tabs = ({
|
|
|
4024
4231
|
shouldUseOverflowScroll && !isBarVariant && "snap-start"
|
|
4025
4232
|
),
|
|
4026
4233
|
children: [
|
|
4027
|
-
isBarVariant ? /* @__PURE__ */ (0,
|
|
4234
|
+
isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_jsx_runtime76.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4028
4235
|
"span",
|
|
4029
4236
|
{
|
|
4030
4237
|
"aria-hidden": true,
|
|
@@ -4038,8 +4245,8 @@ var Tabs = ({
|
|
|
4038
4245
|
)
|
|
4039
4246
|
}
|
|
4040
4247
|
) }) : null,
|
|
4041
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
4042
|
-
/* @__PURE__ */ (0,
|
|
4248
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "relative z-10 inline-flex shrink-0 items-center justify-center empty:hidden", children: item.icon }) : null,
|
|
4249
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4043
4250
|
"span",
|
|
4044
4251
|
{
|
|
4045
4252
|
className: cn(
|
|
@@ -4054,7 +4261,7 @@ var Tabs = ({
|
|
|
4054
4261
|
item.value
|
|
4055
4262
|
);
|
|
4056
4263
|
}),
|
|
4057
|
-
!isBarVariant ? /* @__PURE__ */ (0,
|
|
4264
|
+
!isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4058
4265
|
"span",
|
|
4059
4266
|
{
|
|
4060
4267
|
"aria-hidden": true,
|
|
@@ -4072,24 +4279,24 @@ var Tabs = ({
|
|
|
4072
4279
|
]
|
|
4073
4280
|
}
|
|
4074
4281
|
),
|
|
4075
|
-
shouldUseOverflowScroll && !isBarVariant ? /* @__PURE__ */ (0,
|
|
4076
|
-
/* @__PURE__ */ (0,
|
|
4282
|
+
shouldUseOverflowScroll && !isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
4283
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4077
4284
|
"span",
|
|
4078
4285
|
{
|
|
4079
4286
|
"aria-hidden": true,
|
|
4080
4287
|
className: cn(
|
|
4081
|
-
"pointer-events-none absolute top-0 bottom-0 left-
|
|
4288
|
+
"pointer-events-none absolute top-0 bottom-0 left-0 z-10 w-12 md:w-18 bg-linear-to-r from-agg-secondary via-agg-secondary to-transparent",
|
|
4082
4289
|
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
4083
4290
|
scrollAffordanceState.showStart ? "opacity-100" : "opacity-0"
|
|
4084
4291
|
)
|
|
4085
4292
|
}
|
|
4086
4293
|
),
|
|
4087
|
-
/* @__PURE__ */ (0,
|
|
4294
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4088
4295
|
"span",
|
|
4089
4296
|
{
|
|
4090
4297
|
"aria-hidden": true,
|
|
4091
4298
|
className: cn(
|
|
4092
|
-
"pointer-events-none absolute top-0 right-
|
|
4299
|
+
"pointer-events-none absolute top-0 right-0 bottom-0 z-10 w-12 md:w-18 bg-linear-to-l from-agg-secondary via-agg-secondary to-transparent",
|
|
4093
4300
|
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
4094
4301
|
scrollAffordanceState.showEnd ? "opacity-100" : "opacity-0"
|
|
4095
4302
|
)
|
|
@@ -4102,150 +4309,14 @@ var Tabs = ({
|
|
|
4102
4309
|
};
|
|
4103
4310
|
Tabs.displayName = "Tabs";
|
|
4104
4311
|
|
|
4105
|
-
// src/events/item/event-list-item.utils.ts
|
|
4106
|
-
var resolveEventListItemEvent = (fetchedEvent) => {
|
|
4107
|
-
if (!fetchedEvent)
|
|
4108
|
-
return void 0;
|
|
4109
|
-
if (!fetchedEvent.venueMarkets || fetchedEvent.venueMarkets.length === 0)
|
|
4110
|
-
return void 0;
|
|
4111
|
-
return fetchedEvent;
|
|
4112
|
-
};
|
|
4113
|
-
var normalizeProbability = (value) => {
|
|
4114
|
-
if (typeof value !== "number" || !Number.isFinite(value))
|
|
4115
|
-
return void 0;
|
|
4116
|
-
if (value < 0)
|
|
4117
|
-
return 0;
|
|
4118
|
-
if (value > 1)
|
|
4119
|
-
return 1;
|
|
4120
|
-
return value;
|
|
4121
|
-
};
|
|
4122
|
-
var hasDateLabel = (outcome) => {
|
|
4123
|
-
return !!toDate(outcome.label);
|
|
4124
|
-
};
|
|
4125
|
-
var sortOutcomes = (outcomes) => {
|
|
4126
|
-
if (outcomes.length <= 1)
|
|
4127
|
-
return outcomes;
|
|
4128
|
-
const now = Date.now();
|
|
4129
|
-
if (outcomes.some(hasDateLabel)) {
|
|
4130
|
-
return [...outcomes].sort((a, b) => {
|
|
4131
|
-
var _a, _b, _c, _d;
|
|
4132
|
-
const aDate = (_b = (_a = toDate(a.label)) == null ? void 0 : _a.getTime()) != null ? _b : 0;
|
|
4133
|
-
const bDate = (_d = (_c = toDate(b.label)) == null ? void 0 : _c.getTime()) != null ? _d : 0;
|
|
4134
|
-
return Math.abs(aDate - now) - Math.abs(bDate - now);
|
|
4135
|
-
});
|
|
4136
|
-
}
|
|
4137
|
-
return [...outcomes].sort((a, b) => {
|
|
4138
|
-
var _a, _b;
|
|
4139
|
-
const aPrice = (_a = normalizeProbability(a.price)) != null ? _a : 0;
|
|
4140
|
-
const bPrice = (_b = normalizeProbability(b.price)) != null ? _b : 0;
|
|
4141
|
-
return bPrice - aPrice;
|
|
4142
|
-
});
|
|
4143
|
-
};
|
|
4144
|
-
var compareVisibleOutcomeRows = (left, right) => {
|
|
4145
|
-
var _a, _b;
|
|
4146
|
-
const leftDate = toDate(resolveOutcomeTitle(left.outcome));
|
|
4147
|
-
const rightDate = toDate(resolveOutcomeTitle(right.outcome));
|
|
4148
|
-
if (leftDate && rightDate) {
|
|
4149
|
-
return leftDate.getTime() - rightDate.getTime();
|
|
4150
|
-
}
|
|
4151
|
-
const leftProbability = (_a = normalizeProbability(left.outcome.price)) != null ? _a : -1;
|
|
4152
|
-
const rightProbability = (_b = normalizeProbability(right.outcome.price)) != null ? _b : -1;
|
|
4153
|
-
return rightProbability - leftProbability;
|
|
4154
|
-
};
|
|
4155
|
-
var shouldReplaceVisibleOutcome = (current, next) => {
|
|
4156
|
-
var _a, _b;
|
|
4157
|
-
const currentVolume = typeof current.market.volume === "number" ? current.market.volume : -1;
|
|
4158
|
-
const nextVolume = typeof next.market.volume === "number" ? next.market.volume : -1;
|
|
4159
|
-
if (currentVolume !== nextVolume) {
|
|
4160
|
-
return nextVolume > currentVolume;
|
|
4161
|
-
}
|
|
4162
|
-
const currentProbability = (_a = normalizeProbability(current.outcome.price)) != null ? _a : -1;
|
|
4163
|
-
const nextProbability = (_b = normalizeProbability(next.outcome.price)) != null ? _b : -1;
|
|
4164
|
-
return nextProbability > currentProbability;
|
|
4165
|
-
};
|
|
4166
|
-
var resolveVisibleOutcomes = (venueMarkets, maxOutcomes) => {
|
|
4167
|
-
const visibleOutcomesByLabel = /* @__PURE__ */ new Map();
|
|
4168
|
-
venueMarkets.forEach((market) => {
|
|
4169
|
-
sortOutcomes(market.venueMarketOutcomes).forEach((outcome) => {
|
|
4170
|
-
const title = resolveOutcomeTitle(outcome);
|
|
4171
|
-
const normalizedTitle = title.trim().toLowerCase();
|
|
4172
|
-
const nextVisibleOutcome = {
|
|
4173
|
-
venue: market.venue,
|
|
4174
|
-
market,
|
|
4175
|
-
outcome,
|
|
4176
|
-
title
|
|
4177
|
-
};
|
|
4178
|
-
const currentVisibleOutcome = visibleOutcomesByLabel.get(normalizedTitle);
|
|
4179
|
-
if (!currentVisibleOutcome || shouldReplaceVisibleOutcome(currentVisibleOutcome, nextVisibleOutcome)) {
|
|
4180
|
-
visibleOutcomesByLabel.set(normalizedTitle, nextVisibleOutcome);
|
|
4181
|
-
}
|
|
4182
|
-
});
|
|
4183
|
-
});
|
|
4184
|
-
return [...visibleOutcomesByLabel.values()].sort(compareVisibleOutcomeRows).slice(0, Math.max(1, maxOutcomes));
|
|
4185
|
-
};
|
|
4186
|
-
var resolveOutcomeTitle = (outcome) => {
|
|
4187
|
-
if (outcome.title && outcome.title.trim())
|
|
4188
|
-
return outcome.title;
|
|
4189
|
-
return outcome.label;
|
|
4190
|
-
};
|
|
4191
|
-
var selectPrimaryVenueMarket = (venueMarkets) => {
|
|
4192
|
-
if (venueMarkets.length === 0)
|
|
4193
|
-
return void 0;
|
|
4194
|
-
if (venueMarkets.length === 1)
|
|
4195
|
-
return venueMarkets[0];
|
|
4196
|
-
return [...venueMarkets].sort((a, b) => {
|
|
4197
|
-
const aVolume = typeof a.volume === "number" ? a.volume : -1;
|
|
4198
|
-
const bVolume = typeof b.volume === "number" ? b.volume : -1;
|
|
4199
|
-
return bVolume - aVolume;
|
|
4200
|
-
})[0];
|
|
4201
|
-
};
|
|
4202
|
-
var resolveTileTitle = (event, primaryVenueMarket, titleOverride) => {
|
|
4203
|
-
if (typeof titleOverride === "string" && titleOverride.trim()) {
|
|
4204
|
-
return titleOverride;
|
|
4205
|
-
}
|
|
4206
|
-
if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.question) === "string" && primaryVenueMarket.question.trim()) {
|
|
4207
|
-
return primaryVenueMarket.question;
|
|
4208
|
-
}
|
|
4209
|
-
return event.title;
|
|
4210
|
-
};
|
|
4211
|
-
var resolveTileImage = (event, primaryVenueMarket, imageOverride) => {
|
|
4212
|
-
if (typeof imageOverride === "string" && imageOverride.trim()) {
|
|
4213
|
-
return imageOverride;
|
|
4214
|
-
}
|
|
4215
|
-
if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.image) === "string" && primaryVenueMarket.image.trim()) {
|
|
4216
|
-
return primaryVenueMarket.image;
|
|
4217
|
-
}
|
|
4218
|
-
if (typeof event.image === "string" && event.image.trim()) {
|
|
4219
|
-
return event.image;
|
|
4220
|
-
}
|
|
4221
|
-
return void 0;
|
|
4222
|
-
};
|
|
4223
|
-
var formatCountLabel = (count, singular, plural) => {
|
|
4224
|
-
return `${count} ${count === 1 ? singular : plural}`;
|
|
4225
|
-
};
|
|
4226
|
-
var getVenueSummary = (venueMarkets) => {
|
|
4227
|
-
const uniqueVenues = Array.from(new Set(venueMarkets.map((market) => market.venue)));
|
|
4228
|
-
return {
|
|
4229
|
-
marketCount: venueMarkets.length,
|
|
4230
|
-
venueCount: uniqueVenues.length,
|
|
4231
|
-
singleVenue: uniqueVenues.length === 1 ? uniqueVenues[0] : void 0
|
|
4232
|
-
};
|
|
4233
|
-
};
|
|
4234
|
-
var resolveVenueLabel = (venue, venueInfo, labels) => {
|
|
4235
|
-
var _a, _b;
|
|
4236
|
-
if (!venue)
|
|
4237
|
-
return labels.eventItem.venueSingular;
|
|
4238
|
-
return (_b = (_a = venueInfo == null ? void 0 : venueInfo[venue]) == null ? void 0 : _a.label) != null ? _b : labels.venues[venue];
|
|
4239
|
-
};
|
|
4240
|
-
|
|
4241
4312
|
// src/events/item/index.tsx
|
|
4242
|
-
var
|
|
4313
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
4243
4314
|
var EventListItemLoadingState = ({
|
|
4244
4315
|
classNames,
|
|
4245
4316
|
ariaLabel
|
|
4246
4317
|
}) => {
|
|
4247
|
-
const labels = (0,
|
|
4248
|
-
return /* @__PURE__ */ (0,
|
|
4318
|
+
const labels = (0, import_hooks16.useLabels)();
|
|
4319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4249
4320
|
Skeleton,
|
|
4250
4321
|
{
|
|
4251
4322
|
view: "event-list-item",
|
|
@@ -4258,16 +4329,16 @@ var EventListItemUnavailableState = ({
|
|
|
4258
4329
|
classNames,
|
|
4259
4330
|
ariaLabel
|
|
4260
4331
|
}) => {
|
|
4261
|
-
const labels = (0,
|
|
4262
|
-
return /* @__PURE__ */ (0,
|
|
4332
|
+
const labels = (0, import_hooks16.useLabels)();
|
|
4333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4263
4334
|
Card,
|
|
4264
4335
|
{
|
|
4265
4336
|
className: cn(baseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
4266
4337
|
role: "status",
|
|
4267
4338
|
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItem.unavailableAria,
|
|
4268
|
-
children: /* @__PURE__ */ (0,
|
|
4269
|
-
/* @__PURE__ */ (0,
|
|
4270
|
-
/* @__PURE__ */ (0,
|
|
4339
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: cn("flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
|
|
4340
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Typography, { variant: "body-large-strong", className: cn("truncate", classNames == null ? void 0 : classNames.title), children: labels.eventItem.unavailableTitle }),
|
|
4341
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItem.unavailableDescription })
|
|
4271
4342
|
] })
|
|
4272
4343
|
}
|
|
4273
4344
|
);
|
|
@@ -4276,8 +4347,8 @@ var EventListItemNotFoundState = ({
|
|
|
4276
4347
|
classNames,
|
|
4277
4348
|
ariaLabel
|
|
4278
4349
|
}) => {
|
|
4279
|
-
const labels = (0,
|
|
4280
|
-
return /* @__PURE__ */ (0,
|
|
4350
|
+
const labels = (0, import_hooks16.useLabels)();
|
|
4351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Card, { className: cn("w-full gap-0 overflow-hidden p-0", classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4281
4352
|
StateMessage,
|
|
4282
4353
|
{
|
|
4283
4354
|
ariaLabel: ariaLabel != null ? ariaLabel : labels.eventItemDetails.notFoundAria,
|
|
@@ -4299,8 +4370,8 @@ var EventListItemContent = ({
|
|
|
4299
4370
|
ariaLabel
|
|
4300
4371
|
}) => {
|
|
4301
4372
|
var _a;
|
|
4302
|
-
const config = (0,
|
|
4303
|
-
const labels = (0,
|
|
4373
|
+
const config = (0, import_hooks16.useSdkUiConfig)();
|
|
4374
|
+
const labels = (0, import_hooks16.useLabels)();
|
|
4304
4375
|
const allVenueMarkets = (0, import_react6.useMemo)(() => {
|
|
4305
4376
|
return event.venueMarkets;
|
|
4306
4377
|
}, [event.venueMarkets]);
|
|
@@ -4320,7 +4391,7 @@ var EventListItemContent = ({
|
|
|
4320
4391
|
return Array.from(new Set(allVenueMarkets.map((market) => market.venue))).slice(0, 4);
|
|
4321
4392
|
}, [allVenueMarkets]);
|
|
4322
4393
|
const resolvedVolume = typeof event.volume === "number" ? event.volume : (_a = primaryVenueMarket == null ? void 0 : primaryVenueMarket.volume) != null ? _a : void 0;
|
|
4323
|
-
const volumeLabel = typeof resolvedVolume === "number" ? `${config.formatCompactCurrency(resolvedVolume)} ${labels.eventItem.volumeSuffix}` : "";
|
|
4394
|
+
const volumeLabel = typeof resolvedVolume === "number" ? `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItem.volumeSuffix}` : "";
|
|
4324
4395
|
const handleKeyDown = (eventToHandle) => {
|
|
4325
4396
|
if (!onClick)
|
|
4326
4397
|
return;
|
|
@@ -4332,11 +4403,11 @@ var EventListItemContent = ({
|
|
|
4332
4403
|
const renderArbitrage = (value) => {
|
|
4333
4404
|
if (value == null)
|
|
4334
4405
|
return null;
|
|
4335
|
-
if (Math.abs(value) < config.arbitrageThreshold)
|
|
4406
|
+
if (Math.abs(value) < config.market.arbitrageThreshold)
|
|
4336
4407
|
return null;
|
|
4337
|
-
return /* @__PURE__ */ (0,
|
|
4338
|
-
/* @__PURE__ */ (0,
|
|
4339
|
-
/* @__PURE__ */ (0,
|
|
4408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: cn("flex items-center gap-1", "text-agg-success"), children: [
|
|
4409
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Typography, { variant: "label-strong", className: "text-agg-success", children: config.formatting.formatPercent(value) }),
|
|
4410
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4340
4411
|
Icon,
|
|
4341
4412
|
{
|
|
4342
4413
|
name: "triangle-up",
|
|
@@ -4347,7 +4418,7 @@ var EventListItemContent = ({
|
|
|
4347
4418
|
)
|
|
4348
4419
|
] });
|
|
4349
4420
|
};
|
|
4350
|
-
return /* @__PURE__ */ (0,
|
|
4421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
4351
4422
|
Card,
|
|
4352
4423
|
{
|
|
4353
4424
|
className: cn(baseCardClassName, onClick && "cursor-pointer", classNames == null ? void 0 : classNames.root),
|
|
@@ -4357,8 +4428,8 @@ var EventListItemContent = ({
|
|
|
4357
4428
|
onKeyDown: handleKeyDown,
|
|
4358
4429
|
"aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
|
|
4359
4430
|
children: [
|
|
4360
|
-
/* @__PURE__ */ (0,
|
|
4361
|
-
resolvedImage ? /* @__PURE__ */ (0,
|
|
4431
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: cn("flex items-center gap-3", classNames == null ? void 0 : classNames.header), children: [
|
|
4432
|
+
resolvedImage ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4362
4433
|
RemoteImage,
|
|
4363
4434
|
{
|
|
4364
4435
|
src: resolvedImage,
|
|
@@ -4366,7 +4437,7 @@ var EventListItemContent = ({
|
|
|
4366
4437
|
className: cn("h-10 w-10", "rounded-agg-lg object-cover")
|
|
4367
4438
|
}
|
|
4368
4439
|
) : null,
|
|
4369
|
-
/* @__PURE__ */ (0,
|
|
4440
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4370
4441
|
Typography,
|
|
4371
4442
|
{
|
|
4372
4443
|
variant: "body-strong",
|
|
@@ -4379,13 +4450,13 @@ var EventListItemContent = ({
|
|
|
4379
4450
|
}
|
|
4380
4451
|
)
|
|
4381
4452
|
] }),
|
|
4382
|
-
/* @__PURE__ */ (0,
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: cn("flex flex-col gap-3", classNames == null ? void 0 : classNames.outcomes), children: visibleOutcomes.map((visibleOutcome) => {
|
|
4383
4454
|
const probability = normalizeProbability(visibleOutcome.outcome.price);
|
|
4384
4455
|
const showBadge = typeof probability === "number";
|
|
4385
4456
|
const arbitragePercent = arbitrageByOutcomeId == null ? void 0 : arbitrageByOutcomeId[visibleOutcome.outcome.id];
|
|
4386
4457
|
const outcomeTitle = resolveOutcomeTitle(visibleOutcome.outcome);
|
|
4387
4458
|
const formattedTitle = (0, import_dayjs2.default)(outcomeTitle).isValid() ? (0, import_dayjs2.default)(outcomeTitle).format("MMMM D, YYYY") : outcomeTitle;
|
|
4388
|
-
return /* @__PURE__ */ (0,
|
|
4459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
4389
4460
|
"div",
|
|
4390
4461
|
{
|
|
4391
4462
|
className: cn(
|
|
@@ -4393,7 +4464,7 @@ var EventListItemContent = ({
|
|
|
4393
4464
|
classNames == null ? void 0 : classNames.outcomeRow
|
|
4394
4465
|
),
|
|
4395
4466
|
children: [
|
|
4396
|
-
/* @__PURE__ */ (0,
|
|
4467
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4397
4468
|
Typography,
|
|
4398
4469
|
{
|
|
4399
4470
|
variant: "body",
|
|
@@ -4401,13 +4472,13 @@ var EventListItemContent = ({
|
|
|
4401
4472
|
children: formattedTitle
|
|
4402
4473
|
}
|
|
4403
4474
|
),
|
|
4404
|
-
/* @__PURE__ */ (0,
|
|
4475
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex flex-row gap-3 items-center justify-end", children: [
|
|
4405
4476
|
renderArbitrage(arbitragePercent),
|
|
4406
|
-
showBadge ? /* @__PURE__ */ (0,
|
|
4477
|
+
showBadge ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4407
4478
|
Badge,
|
|
4408
4479
|
{
|
|
4409
|
-
text: config.formatPercent(probability),
|
|
4410
|
-
prefix: /* @__PURE__ */ (0,
|
|
4480
|
+
text: config.formatting.formatPercent(probability),
|
|
4481
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(VenueLogo, { venue: visibleOutcome.venue, size: "small" }),
|
|
4411
4482
|
size: "large",
|
|
4412
4483
|
classNames: {
|
|
4413
4484
|
root: cn(
|
|
@@ -4423,7 +4494,7 @@ var EventListItemContent = ({
|
|
|
4423
4494
|
`${visibleOutcome.market.id}-${visibleOutcome.outcome.id}`
|
|
4424
4495
|
);
|
|
4425
4496
|
}) }),
|
|
4426
|
-
/* @__PURE__ */ (0,
|
|
4497
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
4427
4498
|
"div",
|
|
4428
4499
|
{
|
|
4429
4500
|
className: cn(
|
|
@@ -4432,15 +4503,15 @@ var EventListItemContent = ({
|
|
|
4432
4503
|
classNames == null ? void 0 : classNames.footer
|
|
4433
4504
|
),
|
|
4434
4505
|
children: [
|
|
4435
|
-
/* @__PURE__ */ (0,
|
|
4436
|
-
/* @__PURE__ */ (0,
|
|
4506
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: cn("flex items-center gap-1", "text-agg-sm leading-agg-5"), children: [
|
|
4507
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "truncate text-agg-muted-foreground", children: formatCountLabel(
|
|
4437
4508
|
marketCount,
|
|
4438
4509
|
labels.eventItem.marketSingular,
|
|
4439
4510
|
labels.eventItem.marketPlural
|
|
4440
4511
|
) }),
|
|
4441
|
-
/* @__PURE__ */ (0,
|
|
4442
|
-
singleVenue ? /* @__PURE__ */ (0,
|
|
4443
|
-
/* @__PURE__ */ (0,
|
|
4512
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "text-agg-muted-foreground", children: "\xD7" }),
|
|
4513
|
+
singleVenue ? /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("span", { className: "flex items-center gap-1 truncate text-agg-muted-foreground", children: [
|
|
4514
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4444
4515
|
VenueLogo,
|
|
4445
4516
|
{
|
|
4446
4517
|
venue: singleVenue,
|
|
@@ -4449,13 +4520,13 @@ var EventListItemContent = ({
|
|
|
4449
4520
|
className: "text-agg-muted-foreground!"
|
|
4450
4521
|
}
|
|
4451
4522
|
),
|
|
4452
|
-
/* @__PURE__ */ (0,
|
|
4453
|
-
] }) : /* @__PURE__ */ (0,
|
|
4523
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: venueLabel })
|
|
4524
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "truncate text-agg-muted-foreground", children: formatCountLabel(
|
|
4454
4525
|
venueCount,
|
|
4455
4526
|
labels.eventItem.venueSingular,
|
|
4456
4527
|
labels.eventItem.venuePlural
|
|
4457
4528
|
) }),
|
|
4458
|
-
!singleVenue && visibleVenueLogos.length > 0 ? /* @__PURE__ */ (0,
|
|
4529
|
+
!singleVenue && visibleVenueLogos.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "flex items-center gap-1 overflow-hidden", children: visibleVenueLogos.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4459
4530
|
VenueLogo,
|
|
4460
4531
|
{
|
|
4461
4532
|
venue,
|
|
@@ -4466,7 +4537,7 @@ var EventListItemContent = ({
|
|
|
4466
4537
|
venue
|
|
4467
4538
|
)) }) : null
|
|
4468
4539
|
] }),
|
|
4469
|
-
volumeLabel ? /* @__PURE__ */ (0,
|
|
4540
|
+
volumeLabel ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Typography, { variant: "label", className: "text-agg-sm text-agg-muted-foreground", children: volumeLabel }) : null
|
|
4470
4541
|
]
|
|
4471
4542
|
}
|
|
4472
4543
|
)
|
|
@@ -4485,7 +4556,7 @@ var EventListItemByEventId = (_a) => {
|
|
|
4485
4556
|
error,
|
|
4486
4557
|
isError,
|
|
4487
4558
|
isLoading
|
|
4488
|
-
} = (0,
|
|
4559
|
+
} = (0, import_hooks16.useVenueEvent)({
|
|
4489
4560
|
eventId: eventId != null ? eventId : "",
|
|
4490
4561
|
enabled: !!eventId
|
|
4491
4562
|
});
|
|
@@ -4493,48 +4564,48 @@ var EventListItemByEventId = (_a) => {
|
|
|
4493
4564
|
return resolveEventListItemEvent(fetchedEvent);
|
|
4494
4565
|
}, [fetchedEvent]);
|
|
4495
4566
|
if (!eventId) {
|
|
4496
|
-
return /* @__PURE__ */ (0,
|
|
4567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EventListItemUnavailableState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
4497
4568
|
}
|
|
4498
4569
|
if (isLoading) {
|
|
4499
|
-
return /* @__PURE__ */ (0,
|
|
4570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
4500
4571
|
}
|
|
4501
4572
|
if (isErrorWithStatus(error, 404)) {
|
|
4502
|
-
return /* @__PURE__ */ (0,
|
|
4573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EventListItemNotFoundState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
4503
4574
|
}
|
|
4504
4575
|
if (!fetchedEvent && !isError) {
|
|
4505
|
-
return /* @__PURE__ */ (0,
|
|
4576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
4506
4577
|
}
|
|
4507
4578
|
if (!resolvedEvent) {
|
|
4508
|
-
return /* @__PURE__ */ (0,
|
|
4579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EventListItemUnavailableState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
4509
4580
|
}
|
|
4510
|
-
return /* @__PURE__ */ (0,
|
|
4581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EventListItemContent, __spreadValues({ event: resolvedEvent }, rest));
|
|
4511
4582
|
};
|
|
4512
4583
|
var EventListItem = (props) => {
|
|
4513
4584
|
if (props.isLoading) {
|
|
4514
|
-
return /* @__PURE__ */ (0,
|
|
4585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EventListItemLoadingState, { classNames: props.classNames, ariaLabel: props.ariaLabel });
|
|
4515
4586
|
}
|
|
4516
4587
|
if ("event" in props && props.event) {
|
|
4517
4588
|
const _a = props, { event } = _a, rest = __objRest(_a, ["event"]);
|
|
4518
|
-
return /* @__PURE__ */ (0,
|
|
4589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EventListItemContent, __spreadValues({ event }, rest));
|
|
4519
4590
|
}
|
|
4520
|
-
return /* @__PURE__ */ (0,
|
|
4591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(EventListItemByEventId, __spreadValues({}, props));
|
|
4521
4592
|
};
|
|
4522
4593
|
EventListItem.displayName = "EventListItem";
|
|
4523
4594
|
|
|
4524
4595
|
// src/events/item-details/index.tsx
|
|
4525
4596
|
var import_react8 = require("react");
|
|
4526
|
-
var
|
|
4597
|
+
var import_hooks18 = require("@agg-market/hooks");
|
|
4527
4598
|
|
|
4528
4599
|
// src/primitives/chart/chart-type-switch.tsx
|
|
4529
|
-
var
|
|
4600
|
+
var import_hooks17 = require("@agg-market/hooks");
|
|
4530
4601
|
var import_react7 = require("react");
|
|
4531
|
-
var
|
|
4602
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
4532
4603
|
var ChartTypeSwitch = ({
|
|
4533
4604
|
value,
|
|
4534
4605
|
onValueChange,
|
|
4535
4606
|
className
|
|
4536
4607
|
}) => {
|
|
4537
|
-
const labels = (0,
|
|
4608
|
+
const labels = (0, import_hooks17.useLabels)();
|
|
4538
4609
|
const options = (0, import_react7.useMemo)(
|
|
4539
4610
|
() => [
|
|
4540
4611
|
{
|
|
@@ -4563,7 +4634,7 @@ var ChartTypeSwitch = ({
|
|
|
4563
4634
|
}
|
|
4564
4635
|
onValueChange(nextOption.value);
|
|
4565
4636
|
};
|
|
4566
|
-
return /* @__PURE__ */ (0,
|
|
4637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4567
4638
|
"div",
|
|
4568
4639
|
{
|
|
4569
4640
|
className: cn("inline-flex items-center gap-2", className),
|
|
@@ -4571,7 +4642,7 @@ var ChartTypeSwitch = ({
|
|
|
4571
4642
|
"aria-label": labels.common.chartTypeSwitchAria,
|
|
4572
4643
|
children: options.map((option, index) => {
|
|
4573
4644
|
const isActive = option.value === value;
|
|
4574
|
-
return /* @__PURE__ */ (0,
|
|
4645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4575
4646
|
"button",
|
|
4576
4647
|
{
|
|
4577
4648
|
type: "button",
|
|
@@ -4597,7 +4668,7 @@ var ChartTypeSwitch = ({
|
|
|
4597
4668
|
onKeyDown: (event) => {
|
|
4598
4669
|
handleKeyDown(event, index);
|
|
4599
4670
|
},
|
|
4600
|
-
children: /* @__PURE__ */ (0,
|
|
4671
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Icon, { name: option.iconName, color: "currentColor", className: "h-5 w-5" })
|
|
4601
4672
|
},
|
|
4602
4673
|
option.value
|
|
4603
4674
|
);
|
|
@@ -4802,13 +4873,13 @@ var resolveMarketChartLiveState = ({
|
|
|
4802
4873
|
};
|
|
4803
4874
|
|
|
4804
4875
|
// src/events/item-details/index.tsx
|
|
4805
|
-
var
|
|
4876
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
4806
4877
|
var EventListItemDetailsLoadingState = ({
|
|
4807
4878
|
classNames,
|
|
4808
4879
|
ariaLabel
|
|
4809
4880
|
}) => {
|
|
4810
|
-
const labels = (0,
|
|
4811
|
-
return /* @__PURE__ */ (0,
|
|
4881
|
+
const labels = (0, import_hooks18.useLabels)();
|
|
4882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4812
4883
|
Skeleton,
|
|
4813
4884
|
{
|
|
4814
4885
|
view: "event-list-item-details",
|
|
@@ -4821,16 +4892,16 @@ var EventListItemDetailsUnavailableState = ({
|
|
|
4821
4892
|
classNames,
|
|
4822
4893
|
ariaLabel
|
|
4823
4894
|
}) => {
|
|
4824
|
-
const labels = (0,
|
|
4825
|
-
return /* @__PURE__ */ (0,
|
|
4895
|
+
const labels = (0, import_hooks18.useLabels)();
|
|
4896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4826
4897
|
Card,
|
|
4827
4898
|
{
|
|
4828
4899
|
className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
4829
4900
|
role: "status",
|
|
4830
4901
|
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.unavailableAria,
|
|
4831
|
-
children: /* @__PURE__ */ (0,
|
|
4832
|
-
/* @__PURE__ */ (0,
|
|
4833
|
-
/* @__PURE__ */ (0,
|
|
4902
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: cn("flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
|
|
4903
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Typography, { variant: "body-large-strong", className: cn("truncate", classNames == null ? void 0 : classNames.title), children: labels.eventItemDetails.unavailableTitle }),
|
|
4904
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItemDetails.unavailableDescription })
|
|
4834
4905
|
] })
|
|
4835
4906
|
}
|
|
4836
4907
|
);
|
|
@@ -4839,8 +4910,8 @@ var EventListItemDetailsNotFoundState = ({
|
|
|
4839
4910
|
classNames,
|
|
4840
4911
|
ariaLabel
|
|
4841
4912
|
}) => {
|
|
4842
|
-
const labels = (0,
|
|
4843
|
-
return /* @__PURE__ */ (0,
|
|
4913
|
+
const labels = (0, import_hooks18.useLabels)();
|
|
4914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Card, { className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4844
4915
|
StateMessage,
|
|
4845
4916
|
{
|
|
4846
4917
|
ariaLabel: ariaLabel != null ? ariaLabel : labels.eventItemDetails.notFoundAria,
|
|
@@ -4879,8 +4950,10 @@ var EventListItemDetailsGraphSection = ({
|
|
|
4879
4950
|
selectedMarket
|
|
4880
4951
|
}) => {
|
|
4881
4952
|
var _a, _b;
|
|
4882
|
-
const labels = (0,
|
|
4883
|
-
const {
|
|
4953
|
+
const labels = (0, import_hooks18.useLabels)();
|
|
4954
|
+
const {
|
|
4955
|
+
features: { enableLiveUpdates }
|
|
4956
|
+
} = (0, import_hooks18.useSdkUiConfig)();
|
|
4884
4957
|
const [selectedVenue, setSelectedVenue] = (0, import_react8.useState)(null);
|
|
4885
4958
|
const [activeProbabilityMode, setActiveProbabilityMode] = (0, import_react8.useState)("yes");
|
|
4886
4959
|
const probabilityModeConfigs = (0, import_react8.useMemo)(() => {
|
|
@@ -4964,10 +5037,10 @@ var EventListItemDetailsGraphSection = ({
|
|
|
4964
5037
|
isLoading: isMarketChartLoading,
|
|
4965
5038
|
error: marketChartError,
|
|
4966
5039
|
refetch: refetchMarketChart
|
|
4967
|
-
} = (0,
|
|
5040
|
+
} = (0, import_hooks18.useMarketChart)({
|
|
4968
5041
|
marketId: (_a = selectedMarket == null ? void 0 : selectedMarket.id) != null ? _a : null,
|
|
4969
5042
|
venueMarketIds,
|
|
4970
|
-
interval: (0,
|
|
5043
|
+
interval: (0, import_hooks18.timeRangeToInterval)(selectedTimeRange),
|
|
4971
5044
|
startTs: timeWindow.startTs * 1e3,
|
|
4972
5045
|
endTs: timeWindow.endTs * 1e3,
|
|
4973
5046
|
enabled: !!(selectedMarket == null ? void 0 : selectedMarket.id),
|
|
@@ -5055,7 +5128,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
5055
5128
|
void refetchMarketChart();
|
|
5056
5129
|
};
|
|
5057
5130
|
if (marketChartError) {
|
|
5058
|
-
return /* @__PURE__ */ (0,
|
|
5131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: cn("w-full", classNames == null ? void 0 : classNames.chart), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5059
5132
|
StateMessage,
|
|
5060
5133
|
{
|
|
5061
5134
|
tone: "warning",
|
|
@@ -5068,7 +5141,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
5068
5141
|
}
|
|
5069
5142
|
) });
|
|
5070
5143
|
}
|
|
5071
|
-
return /* @__PURE__ */ (0,
|
|
5144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5072
5145
|
LineChart,
|
|
5073
5146
|
{
|
|
5074
5147
|
classNames: { root: classNames == null ? void 0 : classNames.chart },
|
|
@@ -5080,12 +5153,12 @@ var EventListItemDetailsGraphSection = ({
|
|
|
5080
5153
|
lineValue: chartLiveState.lineValue,
|
|
5081
5154
|
showSeriesControls: activeModeVenueData.length > 0 || segmentedDisplayItems.length > 0,
|
|
5082
5155
|
renderSeriesControls: () => {
|
|
5083
|
-
return /* @__PURE__ */ (0,
|
|
5156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
5084
5157
|
"div",
|
|
5085
5158
|
{
|
|
5086
5159
|
className: cn("flex flex-row items-center justify-between gap-4", classNames == null ? void 0 : classNames.summary),
|
|
5087
5160
|
children: [
|
|
5088
|
-
/* @__PURE__ */ (0,
|
|
5161
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5089
5162
|
"div",
|
|
5090
5163
|
{
|
|
5091
5164
|
className: cn(
|
|
@@ -5096,7 +5169,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
5096
5169
|
var _a2;
|
|
5097
5170
|
const text = venueData.probability == null ? "-" : formatPercent(venueData.probability);
|
|
5098
5171
|
const isActiveVenue = selectedVenue === venueData.venue;
|
|
5099
|
-
return /* @__PURE__ */ (0,
|
|
5172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5100
5173
|
"button",
|
|
5101
5174
|
{
|
|
5102
5175
|
type: "button",
|
|
@@ -5105,12 +5178,12 @@ var EventListItemDetailsGraphSection = ({
|
|
|
5105
5178
|
className: cn(
|
|
5106
5179
|
"rounded-agg-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary-hover"
|
|
5107
5180
|
),
|
|
5108
|
-
children: /* @__PURE__ */ (0,
|
|
5181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5109
5182
|
Badge,
|
|
5110
5183
|
{
|
|
5111
5184
|
text,
|
|
5112
5185
|
size: "large",
|
|
5113
|
-
prefix: /* @__PURE__ */ (0,
|
|
5186
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5114
5187
|
VenueLogo,
|
|
5115
5188
|
{
|
|
5116
5189
|
venue: venueData.venue,
|
|
@@ -5135,7 +5208,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
5135
5208
|
})
|
|
5136
5209
|
}
|
|
5137
5210
|
),
|
|
5138
|
-
/* @__PURE__ */ (0,
|
|
5211
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5139
5212
|
SwitchButton,
|
|
5140
5213
|
{
|
|
5141
5214
|
ariaLabel: labels.eventItemDetails.outcomeSelectorAria,
|
|
@@ -5166,8 +5239,8 @@ var EventListItemDetailsContent = ({
|
|
|
5166
5239
|
onClick
|
|
5167
5240
|
}) => {
|
|
5168
5241
|
var _a;
|
|
5169
|
-
const config = (0,
|
|
5170
|
-
const labels = (0,
|
|
5242
|
+
const config = (0, import_hooks18.useSdkUiConfig)();
|
|
5243
|
+
const labels = (0, import_hooks18.useLabels)();
|
|
5171
5244
|
const venueMarkets = (0, import_react8.useMemo)(() => {
|
|
5172
5245
|
var _a2;
|
|
5173
5246
|
return (_a2 = event.venueMarkets) != null ? _a2 : [];
|
|
@@ -5194,7 +5267,7 @@ var EventListItemDetailsContent = ({
|
|
|
5194
5267
|
const [selectedOutcomeLabel, setSelectedOutcomeLabel] = (0, import_react8.useState)(() => {
|
|
5195
5268
|
return resolveDefaultOutcomeLabel(outcomeLabels);
|
|
5196
5269
|
});
|
|
5197
|
-
const configTimeRange = config.defaultChartTimeRange;
|
|
5270
|
+
const configTimeRange = config.chart.defaultChartTimeRange;
|
|
5198
5271
|
const [selectedTimeRange, setSelectedTimeRange] = (0, import_react8.useState)(() => {
|
|
5199
5272
|
return getDefaultSelectedTimeRange(defaultTimeRange, configTimeRange);
|
|
5200
5273
|
});
|
|
@@ -5263,10 +5336,10 @@ var EventListItemDetailsContent = ({
|
|
|
5263
5336
|
const resolvedVolume = typeof event.volume === "number" ? event.volume : (_a2 = primaryVenueMarket == null ? void 0 : primaryVenueMarket.volume) != null ? _a2 : void 0;
|
|
5264
5337
|
if (typeof resolvedVolume !== "number")
|
|
5265
5338
|
return "";
|
|
5266
|
-
return `${config.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
|
|
5339
|
+
return `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
|
|
5267
5340
|
}, [config, event.volume, labels.eventItemDetails.volumeSuffix, primaryVenueMarket == null ? void 0 : primaryVenueMarket.volume]);
|
|
5268
5341
|
if (!primaryVenueMarket || !selectedOutcomeLabel) {
|
|
5269
|
-
return /* @__PURE__ */ (0,
|
|
5342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5270
5343
|
EventListItemDetailsUnavailableState,
|
|
5271
5344
|
{
|
|
5272
5345
|
classNames,
|
|
@@ -5274,7 +5347,7 @@ var EventListItemDetailsContent = ({
|
|
|
5274
5347
|
}
|
|
5275
5348
|
);
|
|
5276
5349
|
}
|
|
5277
|
-
return /* @__PURE__ */ (0,
|
|
5350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
5278
5351
|
Card,
|
|
5279
5352
|
{
|
|
5280
5353
|
className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
@@ -5283,7 +5356,7 @@ var EventListItemDetailsContent = ({
|
|
|
5283
5356
|
onClick == null ? void 0 : onClick(event);
|
|
5284
5357
|
},
|
|
5285
5358
|
children: [
|
|
5286
|
-
/* @__PURE__ */ (0,
|
|
5359
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
5287
5360
|
"div",
|
|
5288
5361
|
{
|
|
5289
5362
|
className: cn(
|
|
@@ -5293,7 +5366,7 @@ var EventListItemDetailsContent = ({
|
|
|
5293
5366
|
classNames == null ? void 0 : classNames.header
|
|
5294
5367
|
),
|
|
5295
5368
|
children: [
|
|
5296
|
-
event.image ? /* @__PURE__ */ (0,
|
|
5369
|
+
event.image ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5297
5370
|
RemoteImage,
|
|
5298
5371
|
{
|
|
5299
5372
|
src: event.image,
|
|
@@ -5301,8 +5374,8 @@ var EventListItemDetailsContent = ({
|
|
|
5301
5374
|
className: "size-10 rounded-agg-lg object-cover md:size-[60px]"
|
|
5302
5375
|
}
|
|
5303
5376
|
) : null,
|
|
5304
|
-
/* @__PURE__ */ (0,
|
|
5305
|
-
/* @__PURE__ */ (0,
|
|
5377
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-3", children: [
|
|
5378
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5306
5379
|
Typography,
|
|
5307
5380
|
{
|
|
5308
5381
|
variant: "body-strong",
|
|
@@ -5314,7 +5387,7 @@ var EventListItemDetailsContent = ({
|
|
|
5314
5387
|
children: event.title
|
|
5315
5388
|
}
|
|
5316
5389
|
),
|
|
5317
|
-
venueMarkets.length > 1 ? /* @__PURE__ */ (0,
|
|
5390
|
+
venueMarkets.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5318
5391
|
"div",
|
|
5319
5392
|
{
|
|
5320
5393
|
className: cn(
|
|
@@ -5323,7 +5396,7 @@ var EventListItemDetailsContent = ({
|
|
|
5323
5396
|
),
|
|
5324
5397
|
children: venueMarkets.map((venueMarket) => {
|
|
5325
5398
|
const isActive = (selectedMarket == null ? void 0 : selectedMarket.id) === venueMarket.id;
|
|
5326
|
-
return /* @__PURE__ */ (0,
|
|
5399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5327
5400
|
Button,
|
|
5328
5401
|
{
|
|
5329
5402
|
size: "small",
|
|
@@ -5350,12 +5423,12 @@ var EventListItemDetailsContent = ({
|
|
|
5350
5423
|
]
|
|
5351
5424
|
}
|
|
5352
5425
|
),
|
|
5353
|
-
detailsStats && detailsStats.length > 0 ? /* @__PURE__ */ (0,
|
|
5426
|
+
detailsStats && detailsStats.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: cn("flex flex-wrap items-start gap-4 md:gap-6", classNames == null ? void 0 : classNames.headerStats), children: detailsStats.map((statItem) => {
|
|
5354
5427
|
const deltaClassName = statItem.deltaTone === "positive" ? "text-agg-success!" : statItem.deltaTone === "negative" ? "text-agg-error!" : "text-agg-muted-foreground";
|
|
5355
|
-
return /* @__PURE__ */ (0,
|
|
5356
|
-
/* @__PURE__ */ (0,
|
|
5357
|
-
/* @__PURE__ */ (0,
|
|
5358
|
-
/* @__PURE__ */ (0,
|
|
5428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
5429
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Typography, { variant: "caption-caps", className: "text-agg-muted-foreground", children: statItem.label }),
|
|
5430
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex items-baseline gap-1", children: [
|
|
5431
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5359
5432
|
Typography,
|
|
5360
5433
|
{
|
|
5361
5434
|
variant: "body",
|
|
@@ -5363,11 +5436,11 @@ var EventListItemDetailsContent = ({
|
|
|
5363
5436
|
children: statItem.value
|
|
5364
5437
|
}
|
|
5365
5438
|
),
|
|
5366
|
-
statItem.delta ? /* @__PURE__ */ (0,
|
|
5439
|
+
statItem.delta ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Typography, { variant: "label", className: cn(deltaClassName), children: statItem.delta }) : null
|
|
5367
5440
|
] })
|
|
5368
5441
|
] }, `${statItem.label}-${statItem.value}`);
|
|
5369
5442
|
}) }) : null,
|
|
5370
|
-
/* @__PURE__ */ (0,
|
|
5443
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5371
5444
|
EventListItemDetailsGraphSection,
|
|
5372
5445
|
{
|
|
5373
5446
|
selectedOutcome,
|
|
@@ -5379,19 +5452,19 @@ var EventListItemDetailsContent = ({
|
|
|
5379
5452
|
isDateOutcomeMarket,
|
|
5380
5453
|
classNames,
|
|
5381
5454
|
venueInfo,
|
|
5382
|
-
formatPercent: config.formatPercent,
|
|
5455
|
+
formatPercent: config.formatting.formatPercent,
|
|
5383
5456
|
selectedTimeRange,
|
|
5384
5457
|
selectedChartType
|
|
5385
5458
|
}
|
|
5386
5459
|
),
|
|
5387
|
-
/* @__PURE__ */ (0,
|
|
5388
|
-
/* @__PURE__ */ (0,
|
|
5389
|
-
/* @__PURE__ */ (0,
|
|
5390
|
-
/* @__PURE__ */ (0,
|
|
5391
|
-
/* @__PURE__ */ (0,
|
|
5460
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-4", classNames == null ? void 0 : classNames.footer), children: [
|
|
5461
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: volumeLabel || "-" }),
|
|
5462
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: cn("flex flex-wrap items-center gap-2 md:gap-3", classNames == null ? void 0 : classNames.timeRange), children: [
|
|
5463
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ChartTypeSwitch, { value: selectedChartType, onValueChange: setSelectedChartType }),
|
|
5464
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
|
|
5392
5465
|
eventListItemDetailsTimeRanges.map((timeRange) => {
|
|
5393
5466
|
const isActive = timeRange === selectedTimeRange;
|
|
5394
|
-
return /* @__PURE__ */ (0,
|
|
5467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5395
5468
|
Button,
|
|
5396
5469
|
{
|
|
5397
5470
|
size: "small",
|
|
@@ -5431,7 +5504,7 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
5431
5504
|
error,
|
|
5432
5505
|
isError,
|
|
5433
5506
|
isLoading
|
|
5434
|
-
} = (0,
|
|
5507
|
+
} = (0, import_hooks18.useVenueEvent)({
|
|
5435
5508
|
eventId: resolvedEventId,
|
|
5436
5509
|
enabled: !!resolvedEventId
|
|
5437
5510
|
});
|
|
@@ -5439,7 +5512,7 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
5439
5512
|
return resolveEventListItemEvent(fetchedEvent);
|
|
5440
5513
|
}, [fetchedEvent]);
|
|
5441
5514
|
if (!resolvedEventId) {
|
|
5442
|
-
return /* @__PURE__ */ (0,
|
|
5515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5443
5516
|
EventListItemDetailsUnavailableState,
|
|
5444
5517
|
{
|
|
5445
5518
|
classNames: rest.classNames,
|
|
@@ -5448,16 +5521,16 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
5448
5521
|
);
|
|
5449
5522
|
}
|
|
5450
5523
|
if (isLoading) {
|
|
5451
|
-
return /* @__PURE__ */ (0,
|
|
5524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(EventListItemDetailsLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
5452
5525
|
}
|
|
5453
5526
|
if (isErrorWithStatus(error, 404)) {
|
|
5454
|
-
return /* @__PURE__ */ (0,
|
|
5527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(EventListItemDetailsNotFoundState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
5455
5528
|
}
|
|
5456
5529
|
if (!fetchedEvent && !isError) {
|
|
5457
|
-
return /* @__PURE__ */ (0,
|
|
5530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(EventListItemDetailsLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
5458
5531
|
}
|
|
5459
5532
|
if (!resolvedEvent) {
|
|
5460
|
-
return /* @__PURE__ */ (0,
|
|
5533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5461
5534
|
EventListItemDetailsUnavailableState,
|
|
5462
5535
|
{
|
|
5463
5536
|
classNames: rest.classNames,
|
|
@@ -5465,15 +5538,15 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
5465
5538
|
}
|
|
5466
5539
|
);
|
|
5467
5540
|
}
|
|
5468
|
-
return /* @__PURE__ */ (0,
|
|
5541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(EventListItemDetailsContent, __spreadValues({ event: resolvedEvent }, rest));
|
|
5469
5542
|
};
|
|
5470
5543
|
var EventListItemDetails = (props) => {
|
|
5471
5544
|
if (props.isLoading) {
|
|
5472
|
-
return /* @__PURE__ */ (0,
|
|
5545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(EventListItemDetailsLoadingState, { classNames: props.classNames, ariaLabel: props.ariaLabel });
|
|
5473
5546
|
}
|
|
5474
5547
|
if ("event" in props && props.event) {
|
|
5475
5548
|
const _a = props, { event } = _a, rest = __objRest(_a, ["event"]);
|
|
5476
|
-
return /* @__PURE__ */ (0,
|
|
5549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(EventListItemDetailsContent, __spreadValues({ event }, rest));
|
|
5477
5550
|
}
|
|
5478
5551
|
if ("eventId" in props && typeof props.eventId === "string") {
|
|
5479
5552
|
const {
|
|
@@ -5494,9 +5567,9 @@ var EventListItemDetails = (props) => {
|
|
|
5494
5567
|
defaultTimeRange: defaultTimeRangeOverride,
|
|
5495
5568
|
onClick
|
|
5496
5569
|
};
|
|
5497
|
-
return /* @__PURE__ */ (0,
|
|
5570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(EventListItemDetailsByEventId, __spreadValues({}, byEventIdProps));
|
|
5498
5571
|
}
|
|
5499
|
-
return /* @__PURE__ */ (0,
|
|
5572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5500
5573
|
EventListItemDetailsUnavailableState,
|
|
5501
5574
|
{
|
|
5502
5575
|
classNames: props.classNames,
|
|
@@ -5508,7 +5581,7 @@ EventListItemDetails.displayName = "EventListItemDetails";
|
|
|
5508
5581
|
|
|
5509
5582
|
// src/events/market-details/index.tsx
|
|
5510
5583
|
var import_react9 = require("react");
|
|
5511
|
-
var
|
|
5584
|
+
var import_hooks19 = require("@agg-market/hooks");
|
|
5512
5585
|
|
|
5513
5586
|
// src/events/market-details/market-details.utils.ts
|
|
5514
5587
|
var import_dayjs4 = __toESM(require("dayjs"));
|
|
@@ -5588,6 +5661,21 @@ var resolveDisplayOutcomeLabels = (labels) => {
|
|
|
5588
5661
|
(label) => labels.some((value) => normalizeLabel2(value) === normalizeLabel2(label))
|
|
5589
5662
|
);
|
|
5590
5663
|
};
|
|
5664
|
+
var resolveMarketDetailsOutcomeLabels = (venueMarkets) => {
|
|
5665
|
+
var _a;
|
|
5666
|
+
const primaryMarket = selectPrimaryVenueMarket(venueMarkets);
|
|
5667
|
+
const initialLabels = ((_a = primaryMarket == null ? void 0 : primaryMarket.venueMarketOutcomes) != null ? _a : []).map((outcome) => outcome.label.trim()).filter(Boolean);
|
|
5668
|
+
const labels = new Set(initialLabels);
|
|
5669
|
+
venueMarkets.forEach((market) => {
|
|
5670
|
+
sortOutcomes(market.venueMarketOutcomes).forEach((outcome) => {
|
|
5671
|
+
const label = outcome.label.trim();
|
|
5672
|
+
if (!label)
|
|
5673
|
+
return;
|
|
5674
|
+
labels.add(label);
|
|
5675
|
+
});
|
|
5676
|
+
});
|
|
5677
|
+
return [...labels];
|
|
5678
|
+
};
|
|
5591
5679
|
var resolveInitialOutcomeLabel = (labels, defaultOutcomeLabel) => {
|
|
5592
5680
|
var _a;
|
|
5593
5681
|
if (labels.length === 0)
|
|
@@ -5639,7 +5727,7 @@ var resolveOutcomeTone = (label, index) => {
|
|
|
5639
5727
|
return index === 0 ? "positive" : "negative";
|
|
5640
5728
|
};
|
|
5641
5729
|
var resolveHeaderOutcomeItems = (venueMarkets, defaultOutcomeLabel) => {
|
|
5642
|
-
const labels = resolveDisplayOutcomeLabels(
|
|
5730
|
+
const labels = resolveDisplayOutcomeLabels(resolveMarketDetailsOutcomeLabels(venueMarkets));
|
|
5643
5731
|
const probabilityByLabel = resolveAverageProbabilityByLabel(venueMarkets, labels);
|
|
5644
5732
|
return labels.slice(0, 2).map((label, index) => {
|
|
5645
5733
|
var _a;
|
|
@@ -5762,7 +5850,9 @@ var buildMarketDetailsModel = ({
|
|
|
5762
5850
|
formatCompactCurrency,
|
|
5763
5851
|
labels
|
|
5764
5852
|
});
|
|
5765
|
-
const outcomeLabels = resolveDisplayOutcomeLabels(
|
|
5853
|
+
const outcomeLabels = resolveDisplayOutcomeLabels(
|
|
5854
|
+
resolveMarketDetailsOutcomeLabels(market.venueMarkets)
|
|
5855
|
+
);
|
|
5766
5856
|
const probabilityByLabel = resolveAverageProbabilityByLabel(market.venueMarkets, outcomeLabels);
|
|
5767
5857
|
return {
|
|
5768
5858
|
market,
|
|
@@ -5776,14 +5866,14 @@ var buildMarketDetailsModel = ({
|
|
|
5776
5866
|
};
|
|
5777
5867
|
|
|
5778
5868
|
// src/events/market-details/index.tsx
|
|
5779
|
-
var
|
|
5869
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
5780
5870
|
var MarketDetailsLoadingState = ({
|
|
5781
5871
|
isOpened = marketDetailsDefaultIsOpened,
|
|
5782
5872
|
ariaLabel,
|
|
5783
5873
|
classNames
|
|
5784
5874
|
}) => {
|
|
5785
|
-
const labels = (0,
|
|
5786
|
-
return /* @__PURE__ */ (0,
|
|
5875
|
+
const labels = (0, import_hooks19.useLabels)();
|
|
5876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5787
5877
|
Skeleton,
|
|
5788
5878
|
{
|
|
5789
5879
|
view: isOpened ? "market-details-detailed" : "market-details-minified",
|
|
@@ -5796,16 +5886,16 @@ var MarketDetailsUnavailableState = ({
|
|
|
5796
5886
|
ariaLabel,
|
|
5797
5887
|
classNames
|
|
5798
5888
|
}) => {
|
|
5799
|
-
const labels = (0,
|
|
5800
|
-
return /* @__PURE__ */ (0,
|
|
5889
|
+
const labels = (0, import_hooks19.useLabels)();
|
|
5890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5801
5891
|
Card,
|
|
5802
5892
|
{
|
|
5803
5893
|
className: cn(marketDetailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
5804
5894
|
role: "status",
|
|
5805
5895
|
"aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.unavailableAria,
|
|
5806
|
-
children: /* @__PURE__ */ (0,
|
|
5807
|
-
/* @__PURE__ */ (0,
|
|
5808
|
-
/* @__PURE__ */ (0,
|
|
5896
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex flex-col gap-1 p-5", children: [
|
|
5897
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.unavailableTitle }),
|
|
5898
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.unavailableDescription })
|
|
5809
5899
|
] })
|
|
5810
5900
|
}
|
|
5811
5901
|
);
|
|
@@ -5814,8 +5904,8 @@ var MarketDetailsNotFoundState = ({
|
|
|
5814
5904
|
ariaLabel,
|
|
5815
5905
|
classNames
|
|
5816
5906
|
}) => {
|
|
5817
|
-
const labels = (0,
|
|
5818
|
-
return /* @__PURE__ */ (0,
|
|
5907
|
+
const labels = (0, import_hooks19.useLabels)();
|
|
5908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card, { className: cn(marketDetailsBaseCardClassName, "p-0", classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5819
5909
|
StateMessage,
|
|
5820
5910
|
{
|
|
5821
5911
|
ariaLabel: ariaLabel != null ? ariaLabel : labels.marketDetails.notFoundAria,
|
|
@@ -5832,7 +5922,7 @@ var OrderBookRows = ({
|
|
|
5832
5922
|
formatCurrency,
|
|
5833
5923
|
visibleRows
|
|
5834
5924
|
}) => {
|
|
5835
|
-
const labels = (0,
|
|
5925
|
+
const labels = (0, import_hooks19.useLabels)();
|
|
5836
5926
|
const isAsks = title === labels.marketDetails.asks;
|
|
5837
5927
|
const priceClassName = isAsks ? "text-agg-orderbook-ask" : "text-agg-orderbook-bid";
|
|
5838
5928
|
const barClassName = isAsks ? "bg-agg-orderbook-ask/10" : "bg-agg-orderbook-bid/10";
|
|
@@ -5841,20 +5931,20 @@ var OrderBookRows = ({
|
|
|
5841
5931
|
const orderBookDividerHeightPx = 1;
|
|
5842
5932
|
const orderBookRowGapPx = 8;
|
|
5843
5933
|
const orderBookVisibleHeightPx = maxVisibleRows * orderBookRowHeightPx + Math.max(0, maxVisibleRows - 1) * (orderBookDividerHeightPx + orderBookRowGapPx);
|
|
5844
|
-
return /* @__PURE__ */ (0,
|
|
5845
|
-
/* @__PURE__ */ (0,
|
|
5846
|
-
/* @__PURE__ */ (0,
|
|
5934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
5935
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography, { variant: "caption-caps", children: title }),
|
|
5936
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5847
5937
|
"div",
|
|
5848
5938
|
{
|
|
5849
5939
|
className: "overflow-y-auto pr-1 flex flex-col gap-2",
|
|
5850
5940
|
style: { maxHeight: `${orderBookVisibleHeightPx}px` },
|
|
5851
5941
|
role: "region",
|
|
5852
5942
|
"aria-label": `${title} order book levels`,
|
|
5853
|
-
children: rows.map((row, index) => /* @__PURE__ */ (0,
|
|
5854
|
-
/* @__PURE__ */ (0,
|
|
5855
|
-
/* @__PURE__ */ (0,
|
|
5856
|
-
/* @__PURE__ */ (0,
|
|
5857
|
-
/* @__PURE__ */ (0,
|
|
5943
|
+
children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
5944
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2 md:grid-cols-[88px_1fr_1fr_minmax(120px,220px)] md:gap-6", children: [
|
|
5945
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex items-center gap-1 md:gap-3", children: [
|
|
5946
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(VenueLogo, { venue: row.venue, size: "small" }),
|
|
5947
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5858
5948
|
"span",
|
|
5859
5949
|
{
|
|
5860
5950
|
className: cn(
|
|
@@ -5865,9 +5955,9 @@ var OrderBookRows = ({
|
|
|
5865
5955
|
}
|
|
5866
5956
|
)
|
|
5867
5957
|
] }),
|
|
5868
|
-
/* @__PURE__ */ (0,
|
|
5869
|
-
/* @__PURE__ */ (0,
|
|
5870
|
-
/* @__PURE__ */ (0,
|
|
5958
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "truncate text-agg-xs leading-agg-4 text-center text-agg-foreground md:text-agg-sm md:leading-agg-5", children: formatNumber(row.size) }),
|
|
5959
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "truncate text-agg-xs leading-agg-4 text-center text-agg-foreground md:text-agg-sm md:leading-agg-5", children: formatCurrency(row.total) }),
|
|
5960
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5871
5961
|
"div",
|
|
5872
5962
|
{
|
|
5873
5963
|
"aria-hidden": "true",
|
|
@@ -5878,7 +5968,7 @@ var OrderBookRows = ({
|
|
|
5878
5968
|
}
|
|
5879
5969
|
) })
|
|
5880
5970
|
] }),
|
|
5881
|
-
index < rows.length - 1 ? /* @__PURE__ */ (0,
|
|
5971
|
+
index < rows.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "h-px w-full bg-agg-separator" }) : null
|
|
5882
5972
|
] }, row.id))
|
|
5883
5973
|
}
|
|
5884
5974
|
)
|
|
@@ -5892,7 +5982,7 @@ var getOutcomeButtonClassName = ({
|
|
|
5892
5982
|
const defaultStateClassName = isPositive ? "border-[#18c15c]/50 bg-[#18c15c]/5 text-agg-foreground hover:bg-[#18c15c]/10" : "border-[#e5455f]/50 bg-[#e5455f]/5 text-agg-foreground hover:bg-[#e5455f]/10";
|
|
5893
5983
|
const activeStateClassName = isPositive ? "border-transparent bg-[#18c15c] text-agg-on-primary" : "border-transparent bg-[#e5455f] text-agg-on-primary";
|
|
5894
5984
|
return cn(
|
|
5895
|
-
"h-auto
|
|
5985
|
+
"h-auto flex-1 rounded-agg-full border px-4 py-1.5 text-agg-base leading-agg-6 shadow-none md:flex-none md:min-w-[168px]",
|
|
5896
5986
|
getMotionClassName(enableAnimations, "transition-all duration-300 ease-in-out"),
|
|
5897
5987
|
isActive ? activeStateClassName : defaultStateClassName,
|
|
5898
5988
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary-hover",
|
|
@@ -5905,7 +5995,7 @@ var MarketDetailsContent = ({
|
|
|
5905
5995
|
marketId,
|
|
5906
5996
|
title,
|
|
5907
5997
|
image,
|
|
5908
|
-
isOpened:
|
|
5998
|
+
isOpened: controlledIsOpened = marketDetailsDefaultIsOpened,
|
|
5909
5999
|
onOpenChange,
|
|
5910
6000
|
defaultTab,
|
|
5911
6001
|
defaultOutcomeLabel,
|
|
@@ -5916,8 +6006,8 @@ var MarketDetailsContent = ({
|
|
|
5916
6006
|
otherContent
|
|
5917
6007
|
}) => {
|
|
5918
6008
|
var _a, _b, _c, _d;
|
|
5919
|
-
const config = (0,
|
|
5920
|
-
const labels = (0,
|
|
6009
|
+
const config = (0, import_hooks19.useSdkUiConfig)();
|
|
6010
|
+
const labels = (0, import_hooks19.useLabels)();
|
|
5921
6011
|
const detailsContentId = (0, import_react9.useId)();
|
|
5922
6012
|
const model = (0, import_react9.useMemo)(() => {
|
|
5923
6013
|
return buildMarketDetailsModel({
|
|
@@ -5925,10 +6015,10 @@ var MarketDetailsContent = ({
|
|
|
5925
6015
|
marketId,
|
|
5926
6016
|
title,
|
|
5927
6017
|
image,
|
|
5928
|
-
formatCompactCurrency: config.formatCompactCurrency,
|
|
6018
|
+
formatCompactCurrency: config.formatting.formatCompactCurrency,
|
|
5929
6019
|
labels
|
|
5930
6020
|
});
|
|
5931
|
-
}, [config.formatCompactCurrency, venueMarkets, image, labels, marketId, title]);
|
|
6021
|
+
}, [config.formatting.formatCompactCurrency, venueMarkets, image, labels, marketId, title]);
|
|
5932
6022
|
const resolvedMarket = (0, import_react9.useMemo)(() => {
|
|
5933
6023
|
return resolveMarketFromVenueMarkets(venueMarkets, marketId);
|
|
5934
6024
|
}, [venueMarkets, marketId]);
|
|
@@ -5938,11 +6028,14 @@ var MarketDetailsContent = ({
|
|
|
5938
6028
|
const [selectedTab, setSelectedTab] = (0, import_react9.useState)(
|
|
5939
6029
|
() => resolveInitialTab(defaultTab)
|
|
5940
6030
|
);
|
|
5941
|
-
const [isOpened, setIsOpened] = (0, import_react9.useState)(
|
|
6031
|
+
const [isOpened, setIsOpened] = (0, import_react9.useState)(controlledIsOpened);
|
|
5942
6032
|
(0, import_react9.useEffect)(() => {
|
|
5943
6033
|
setSelectedTab(resolveInitialTab(defaultTab));
|
|
5944
6034
|
}, [defaultTab]);
|
|
5945
|
-
|
|
6035
|
+
(0, import_react9.useEffect)(() => {
|
|
6036
|
+
setIsOpened(controlledIsOpened);
|
|
6037
|
+
}, [controlledIsOpened]);
|
|
6038
|
+
const resolvedDefaultTimeRange = (_a = defaultTimeRange != null ? defaultTimeRange : config.chart.defaultChartTimeRange) != null ? _a : "1D";
|
|
5946
6039
|
const [selectedTimeRange, setSelectedTimeRange] = (0, import_react9.useState)(resolvedDefaultTimeRange);
|
|
5947
6040
|
const [selectedChartType, setSelectedChartType] = (0, import_react9.useState)("line");
|
|
5948
6041
|
(0, import_react9.useEffect)(() => {
|
|
@@ -6004,10 +6097,10 @@ var MarketDetailsContent = ({
|
|
|
6004
6097
|
isLoading: isMarketChartLoading,
|
|
6005
6098
|
error: marketChartError,
|
|
6006
6099
|
refetch: refetchMarketChart
|
|
6007
|
-
} = (0,
|
|
6100
|
+
} = (0, import_hooks19.useMarketChart)({
|
|
6008
6101
|
marketId: primaryVenueMarketId,
|
|
6009
6102
|
venueMarketIds,
|
|
6010
|
-
interval: (0,
|
|
6103
|
+
interval: (0, import_hooks19.timeRangeToInterval)(selectedTimeRange),
|
|
6011
6104
|
startTs: timeWindow.startTs * 1e3,
|
|
6012
6105
|
endTs: timeWindow.endTs * 1e3,
|
|
6013
6106
|
enabled: chartEnabled && !!primaryVenueMarketId
|
|
@@ -6017,7 +6110,7 @@ var MarketDetailsContent = ({
|
|
|
6017
6110
|
isLoading: isOrderBookLoading,
|
|
6018
6111
|
error: orderBookError,
|
|
6019
6112
|
refetch: refetchOrderBook
|
|
6020
|
-
} = (0,
|
|
6113
|
+
} = (0, import_hooks19.useMarketOrderbook)({
|
|
6021
6114
|
marketId: primaryVenueMarketId,
|
|
6022
6115
|
enabled: orderBookEnabled && !!primaryVenueMarketId,
|
|
6023
6116
|
venueOutcomes: selectedOutcomesByVenue.map((item) => ({
|
|
@@ -6118,16 +6211,14 @@ var MarketDetailsContent = ({
|
|
|
6118
6211
|
setSelectedOutcomeLabel((_a2 = headerOutcomeItems[nextIndex]) == null ? void 0 : _a2.label);
|
|
6119
6212
|
};
|
|
6120
6213
|
const handleToggleExpanded = (event) => {
|
|
6214
|
+
if (!marketId)
|
|
6215
|
+
return;
|
|
6121
6216
|
if (event && "key" in event && (event == null ? void 0 : event.key) !== "Enter" && (event == null ? void 0 : event.key) !== " ") {
|
|
6122
6217
|
return;
|
|
6123
6218
|
}
|
|
6124
6219
|
event == null ? void 0 : event.preventDefault();
|
|
6125
6220
|
event == null ? void 0 : event.stopPropagation();
|
|
6126
|
-
|
|
6127
|
-
const next = !prev;
|
|
6128
|
-
onOpenChange == null ? void 0 : onOpenChange(next);
|
|
6129
|
-
return next;
|
|
6130
|
-
});
|
|
6221
|
+
onOpenChange == null ? void 0 : onOpenChange(marketId);
|
|
6131
6222
|
};
|
|
6132
6223
|
const handleGraphVenueToggle = (venue) => {
|
|
6133
6224
|
setSelectedGraphVenue((currentVenue) => {
|
|
@@ -6152,12 +6243,12 @@ var MarketDetailsContent = ({
|
|
|
6152
6243
|
setSelectedGraphVenue(null);
|
|
6153
6244
|
}, [selectedGraphVenue, selectedOutcomesByVenue]);
|
|
6154
6245
|
if (marketId && !resolvedMarket) {
|
|
6155
|
-
return /* @__PURE__ */ (0,
|
|
6246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(MarketDetailsNotFoundState, { ariaLabel, classNames });
|
|
6156
6247
|
}
|
|
6157
6248
|
if (!model) {
|
|
6158
|
-
return /* @__PURE__ */ (0,
|
|
6249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(MarketDetailsUnavailableState, { ariaLabel, classNames });
|
|
6159
6250
|
}
|
|
6160
|
-
return /* @__PURE__ */ (0,
|
|
6251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
6161
6252
|
Card,
|
|
6162
6253
|
{
|
|
6163
6254
|
className: cn(
|
|
@@ -6166,12 +6257,12 @@ var MarketDetailsContent = ({
|
|
|
6166
6257
|
classNames == null ? void 0 : classNames.root
|
|
6167
6258
|
),
|
|
6168
6259
|
children: [
|
|
6169
|
-
/* @__PURE__ */ (0,
|
|
6260
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
6170
6261
|
"div",
|
|
6171
6262
|
{
|
|
6172
6263
|
className: cn(
|
|
6173
6264
|
"cursor-pointer disabled:cursor-default",
|
|
6174
|
-
"flex flex-
|
|
6265
|
+
"flex flex-nowrap flex-row items-center justify-between gap-3 px-5 py-4",
|
|
6175
6266
|
isOpened && "pb-3",
|
|
6176
6267
|
classNames == null ? void 0 : classNames.header
|
|
6177
6268
|
),
|
|
@@ -6183,8 +6274,8 @@ var MarketDetailsContent = ({
|
|
|
6183
6274
|
onClick: handleToggleExpanded,
|
|
6184
6275
|
onKeyDown: handleToggleExpanded,
|
|
6185
6276
|
children: [
|
|
6186
|
-
/* @__PURE__ */ (0,
|
|
6187
|
-
model.image ? /* @__PURE__ */ (0,
|
|
6277
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 md:gap-4", children: [
|
|
6278
|
+
model.image ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6188
6279
|
RemoteImage,
|
|
6189
6280
|
{
|
|
6190
6281
|
src: model.image,
|
|
@@ -6192,97 +6283,102 @@ var MarketDetailsContent = ({
|
|
|
6192
6283
|
className: "size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
6193
6284
|
}
|
|
6194
6285
|
) : null,
|
|
6195
|
-
/* @__PURE__ */ (0,
|
|
6196
|
-
/* @__PURE__ */ (0,
|
|
6197
|
-
/* @__PURE__ */ (0,
|
|
6286
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
|
|
6287
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography, { as: "h3", variant: "body-large-strong", className: "truncate", children: model.title }),
|
|
6288
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography, { variant: "label", className: "truncate text-agg-muted-foreground", children: model.subtitle }) })
|
|
6198
6289
|
] })
|
|
6199
6290
|
] }),
|
|
6200
|
-
/* @__PURE__ */ (0,
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
e
|
|
6226
|
-
|
|
6227
|
-
|
|
6291
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex shrink-0 items-center gap-3", children: [
|
|
6292
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography, { as: "div", variant: "heading", className: "shrink-0", children: formatProbabilityPercent(headlineProbability) }),
|
|
6293
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6294
|
+
"div",
|
|
6295
|
+
{
|
|
6296
|
+
className: "flex shrink-0 gap-2",
|
|
6297
|
+
role: "tablist",
|
|
6298
|
+
"aria-label": labels.marketDetails.marketOutcomesAria,
|
|
6299
|
+
tabIndex: 0,
|
|
6300
|
+
onKeyDown: (e) => handleOutcomeKeyDown(e),
|
|
6301
|
+
children: headerOutcomeItems.map((item) => {
|
|
6302
|
+
const isPositive = item.tone === "positive";
|
|
6303
|
+
const isActiveOutcome = item.label === selectedOutcomeLabel;
|
|
6304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6305
|
+
"button",
|
|
6306
|
+
{
|
|
6307
|
+
type: "button",
|
|
6308
|
+
role: "tab",
|
|
6309
|
+
"aria-selected": isActiveOutcome,
|
|
6310
|
+
tabIndex: isActiveOutcome ? 0 : -1,
|
|
6311
|
+
className: getOutcomeButtonClassName({
|
|
6312
|
+
enableAnimations: config.features.enableAnimations,
|
|
6313
|
+
isPositive,
|
|
6314
|
+
isActive: isActiveOutcome
|
|
6315
|
+
}),
|
|
6316
|
+
onClick: (e) => {
|
|
6317
|
+
e.preventDefault();
|
|
6318
|
+
e.stopPropagation();
|
|
6319
|
+
setSelectedOutcomeLabel(item.label);
|
|
6320
|
+
},
|
|
6321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
|
|
6322
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6323
|
+
VenueLogo,
|
|
6324
|
+
{
|
|
6325
|
+
venue: item.venue,
|
|
6326
|
+
size: "small",
|
|
6327
|
+
color: isActiveOutcome ? "var(--agg-color-on-primary)" : void 0
|
|
6328
|
+
}
|
|
6329
|
+
),
|
|
6330
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6331
|
+
Typography,
|
|
6332
|
+
{
|
|
6333
|
+
variant: isActiveOutcome ? "body-strong" : "body",
|
|
6334
|
+
className: cn(
|
|
6335
|
+
"text-agg-base leading-agg-6",
|
|
6336
|
+
isActiveOutcome ? "text-agg-on-primary" : "text-agg-foreground"
|
|
6337
|
+
),
|
|
6338
|
+
children: `${item.label} ${formatProbabilityCents(item.probability)}`
|
|
6339
|
+
}
|
|
6340
|
+
)
|
|
6341
|
+
] })
|
|
6228
6342
|
},
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
color: isActiveOutcome ? "var(--agg-color-on-primary)" : void 0
|
|
6236
|
-
}
|
|
6237
|
-
),
|
|
6238
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
6239
|
-
Typography,
|
|
6240
|
-
{
|
|
6241
|
-
variant: isActiveOutcome ? "body-strong" : "body",
|
|
6242
|
-
className: cn(
|
|
6243
|
-
"text-agg-base leading-agg-6",
|
|
6244
|
-
isActiveOutcome ? "text-agg-on-primary" : "text-agg-foreground"
|
|
6245
|
-
),
|
|
6246
|
-
children: `${item.label} ${formatProbabilityCents(item.probability)}`
|
|
6247
|
-
}
|
|
6248
|
-
)
|
|
6249
|
-
] })
|
|
6250
|
-
},
|
|
6251
|
-
item.label
|
|
6252
|
-
);
|
|
6253
|
-
})
|
|
6254
|
-
}
|
|
6255
|
-
)
|
|
6343
|
+
item.label
|
|
6344
|
+
);
|
|
6345
|
+
})
|
|
6346
|
+
}
|
|
6347
|
+
)
|
|
6348
|
+
] })
|
|
6256
6349
|
]
|
|
6257
6350
|
}
|
|
6258
6351
|
),
|
|
6259
|
-
/* @__PURE__ */ (0,
|
|
6352
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6260
6353
|
"div",
|
|
6261
6354
|
{
|
|
6262
6355
|
id: detailsContentId,
|
|
6263
6356
|
className: cn(
|
|
6264
6357
|
"grid overflow-hidden",
|
|
6265
|
-
getMotionClassName(
|
|
6358
|
+
getMotionClassName(
|
|
6359
|
+
config.features.enableAnimations,
|
|
6360
|
+
"transition-all duration-500 ease-in-out"
|
|
6361
|
+
),
|
|
6266
6362
|
isOpened ? "grid-rows-[1fr] opacity-100" : "pointer-events-none grid-rows-[0fr] opacity-0"
|
|
6267
6363
|
),
|
|
6268
6364
|
"aria-hidden": !isOpened,
|
|
6269
|
-
children: /* @__PURE__ */ (0,
|
|
6270
|
-
/* @__PURE__ */ (0,
|
|
6271
|
-
/* @__PURE__ */ (0,
|
|
6365
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "min-h-0", children: [
|
|
6366
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
6367
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
6272
6368
|
"div",
|
|
6273
6369
|
{
|
|
6274
6370
|
className: cn(
|
|
6275
6371
|
getMotionClassName(
|
|
6276
|
-
config.enableAnimations,
|
|
6372
|
+
config.features.enableAnimations,
|
|
6277
6373
|
"transition-all duration-500 ease-in-out"
|
|
6278
6374
|
),
|
|
6279
6375
|
isOpened ? cn(
|
|
6280
6376
|
"translate-y-0 opacity-100",
|
|
6281
|
-
getMotionClassName(config.enableAnimations, "delay-100")
|
|
6377
|
+
getMotionClassName(config.features.enableAnimations, "delay-100")
|
|
6282
6378
|
) : "translate-y-5 opacity-0"
|
|
6283
6379
|
),
|
|
6284
6380
|
children: [
|
|
6285
|
-
/* @__PURE__ */ (0,
|
|
6381
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: cn("block", classNames == null ? void 0 : classNames.tabs), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6286
6382
|
Tabs,
|
|
6287
6383
|
{
|
|
6288
6384
|
ariaLabel: labels.marketDetails.tabsAria,
|
|
@@ -6293,9 +6389,9 @@ var MarketDetailsContent = ({
|
|
|
6293
6389
|
className: "w-full px-5"
|
|
6294
6390
|
}
|
|
6295
6391
|
) }),
|
|
6296
|
-
/* @__PURE__ */ (0,
|
|
6297
|
-
/* @__PURE__ */ (0,
|
|
6298
|
-
selectedTab === "order-book" ? /* @__PURE__ */ (0,
|
|
6392
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
6393
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: cn("p-5", classNames == null ? void 0 : classNames.content), children: [
|
|
6394
|
+
selectedTab === "order-book" ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.orderBook), children: isOrderBookLoading ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(MarketDetailsOderbookSkeleton, {}) : hasOrderBookError ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6299
6395
|
StateMessage,
|
|
6300
6396
|
{
|
|
6301
6397
|
ariaLabel: labels.marketDetails.orderBookUnavailableAria,
|
|
@@ -6306,7 +6402,7 @@ var MarketDetailsContent = ({
|
|
|
6306
6402
|
onAction: handleRetryOrderBook,
|
|
6307
6403
|
className: "min-h-[248px] px-5 py-10 md:min-h-[272px]"
|
|
6308
6404
|
}
|
|
6309
|
-
) : hasNoOrderBook ? /* @__PURE__ */ (0,
|
|
6405
|
+
) : hasNoOrderBook ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6310
6406
|
StateMessage,
|
|
6311
6407
|
{
|
|
6312
6408
|
ariaLabel: labels.marketDetails.orderBookEmptyAria,
|
|
@@ -6314,30 +6410,30 @@ var MarketDetailsContent = ({
|
|
|
6314
6410
|
description: labels.marketDetails.orderBookEmptyDescription,
|
|
6315
6411
|
className: "min-h-[248px] px-5 py-10 md:min-h-[272px]"
|
|
6316
6412
|
}
|
|
6317
|
-
) : /* @__PURE__ */ (0,
|
|
6318
|
-
/* @__PURE__ */ (0,
|
|
6413
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
6414
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6319
6415
|
OrderBookRows,
|
|
6320
6416
|
{
|
|
6321
6417
|
rows: askRows,
|
|
6322
6418
|
title: labels.marketDetails.asks,
|
|
6323
|
-
formatNumber: config.formatNumber,
|
|
6324
|
-
formatCurrency: config.formatCurrency,
|
|
6419
|
+
formatNumber: config.formatting.formatNumber,
|
|
6420
|
+
formatCurrency: config.formatting.formatCurrency,
|
|
6325
6421
|
visibleRows: orderBookDepth
|
|
6326
6422
|
}
|
|
6327
6423
|
),
|
|
6328
|
-
/* @__PURE__ */ (0,
|
|
6424
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6329
6425
|
OrderBookRows,
|
|
6330
6426
|
{
|
|
6331
6427
|
rows: bidRows,
|
|
6332
6428
|
title: labels.marketDetails.bids,
|
|
6333
|
-
formatNumber: config.formatNumber,
|
|
6334
|
-
formatCurrency: config.formatCurrency,
|
|
6429
|
+
formatNumber: config.formatting.formatNumber,
|
|
6430
|
+
formatCurrency: config.formatting.formatCurrency,
|
|
6335
6431
|
visibleRows: orderBookDepth
|
|
6336
6432
|
}
|
|
6337
6433
|
)
|
|
6338
6434
|
] }) }) : null,
|
|
6339
|
-
selectedTab === "graph" ? /* @__PURE__ */ (0,
|
|
6340
|
-
hasChartError ? /* @__PURE__ */ (0,
|
|
6435
|
+
selectedTab === "graph" ? /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.graph), children: [
|
|
6436
|
+
hasChartError ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6341
6437
|
StateMessage,
|
|
6342
6438
|
{
|
|
6343
6439
|
ariaLabel: labels.marketDetails.chartUnavailableAria,
|
|
@@ -6348,7 +6444,7 @@ var MarketDetailsContent = ({
|
|
|
6348
6444
|
onAction: handleRetryMarketChart,
|
|
6349
6445
|
className: "min-h-[248px] px-5 py-10 md:min-h-[272px]"
|
|
6350
6446
|
}
|
|
6351
|
-
) : /* @__PURE__ */ (0,
|
|
6447
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6352
6448
|
LineChart,
|
|
6353
6449
|
{
|
|
6354
6450
|
series: graphSeries,
|
|
@@ -6360,11 +6456,11 @@ var MarketDetailsContent = ({
|
|
|
6360
6456
|
classNames: { root: "w-full" },
|
|
6361
6457
|
showSeriesControls: selectedOutcomesByVenue.length > 0 || headerOutcomeItems.length > 0,
|
|
6362
6458
|
renderSeriesControls: () => {
|
|
6363
|
-
return /* @__PURE__ */ (0,
|
|
6364
|
-
/* @__PURE__ */ (0,
|
|
6459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex flex-col gap-4 md:flex-row md:items-center md:justify-between", children: [
|
|
6460
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "flex flex-wrap gap-2", children: selectedOutcomesByVenue.map((item) => {
|
|
6365
6461
|
const probability = formatProbabilityPercent(item.outcome.price);
|
|
6366
6462
|
const isActiveVenue = selectedGraphVenue === item.venue;
|
|
6367
|
-
return /* @__PURE__ */ (0,
|
|
6463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
6368
6464
|
"button",
|
|
6369
6465
|
{
|
|
6370
6466
|
type: "button",
|
|
@@ -6381,14 +6477,14 @@ var MarketDetailsContent = ({
|
|
|
6381
6477
|
handleGraphVenueToggle(item.venue);
|
|
6382
6478
|
},
|
|
6383
6479
|
children: [
|
|
6384
|
-
/* @__PURE__ */ (0,
|
|
6385
|
-
/* @__PURE__ */ (0,
|
|
6480
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
|
|
6481
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: probability })
|
|
6386
6482
|
]
|
|
6387
6483
|
},
|
|
6388
6484
|
`${item.market.id}-${item.outcome.id}`
|
|
6389
6485
|
);
|
|
6390
6486
|
}) }),
|
|
6391
|
-
/* @__PURE__ */ (0,
|
|
6487
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6392
6488
|
SwitchButton,
|
|
6393
6489
|
{
|
|
6394
6490
|
ariaLabel: labels.marketDetails.outcomeSelectorAria,
|
|
@@ -6406,7 +6502,7 @@ var MarketDetailsContent = ({
|
|
|
6406
6502
|
}
|
|
6407
6503
|
}
|
|
6408
6504
|
),
|
|
6409
|
-
/* @__PURE__ */ (0,
|
|
6505
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
6410
6506
|
"div",
|
|
6411
6507
|
{
|
|
6412
6508
|
className: cn(
|
|
@@ -6414,9 +6510,9 @@ var MarketDetailsContent = ({
|
|
|
6414
6510
|
classNames == null ? void 0 : classNames.footer
|
|
6415
6511
|
),
|
|
6416
6512
|
children: [
|
|
6417
|
-
/* @__PURE__ */ (0,
|
|
6418
|
-
/* @__PURE__ */ (0,
|
|
6419
|
-
/* @__PURE__ */ (0,
|
|
6513
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { children: typeof model.market.volume === "number" ? `${config.formatting.formatCompactCurrency(model.market.volume)} ${labels.marketDetails.meta.volumeSuffix}` : labels.marketDetails.volumeUnavailable }),
|
|
6514
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex flex-wrap items-center gap-3 md:gap-4", children: [
|
|
6515
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6420
6516
|
ChartTypeSwitch,
|
|
6421
6517
|
{
|
|
6422
6518
|
className: "shrink-0",
|
|
@@ -6424,7 +6520,7 @@ var MarketDetailsContent = ({
|
|
|
6424
6520
|
onValueChange: setSelectedChartType
|
|
6425
6521
|
}
|
|
6426
6522
|
),
|
|
6427
|
-
/* @__PURE__ */ (0,
|
|
6523
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6428
6524
|
"span",
|
|
6429
6525
|
{
|
|
6430
6526
|
"aria-hidden": "true",
|
|
@@ -6433,7 +6529,7 @@ var MarketDetailsContent = ({
|
|
|
6433
6529
|
),
|
|
6434
6530
|
eventListItemDetailsTimeRanges.map((timeRange) => {
|
|
6435
6531
|
const isActive = selectedTimeRange === timeRange;
|
|
6436
|
-
return /* @__PURE__ */ (0,
|
|
6532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6437
6533
|
"button",
|
|
6438
6534
|
{
|
|
6439
6535
|
type: "button",
|
|
@@ -6457,13 +6553,13 @@ var MarketDetailsContent = ({
|
|
|
6457
6553
|
}
|
|
6458
6554
|
)
|
|
6459
6555
|
] }) : null,
|
|
6460
|
-
selectedTab === "other" ? /* @__PURE__ */ (0,
|
|
6556
|
+
selectedTab === "other" ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "flex flex-col gap-4", children: otherContent != null ? otherContent : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "grid grid-cols-1 gap-3", children: otherRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
6461
6557
|
"div",
|
|
6462
6558
|
{
|
|
6463
6559
|
className: "flex items-center justify-between rounded-agg-xl bg-agg-secondary-hover px-4 py-3",
|
|
6464
6560
|
children: [
|
|
6465
|
-
/* @__PURE__ */ (0,
|
|
6466
|
-
/* @__PURE__ */ (0,
|
|
6561
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: row.label }),
|
|
6562
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography, { variant: "body", className: "text-right", children: row.value })
|
|
6467
6563
|
]
|
|
6468
6564
|
},
|
|
6469
6565
|
row.label
|
|
@@ -6479,108 +6575,79 @@ var MarketDetailsContent = ({
|
|
|
6479
6575
|
}
|
|
6480
6576
|
);
|
|
6481
6577
|
};
|
|
6482
|
-
var MarketDetails = (
|
|
6483
|
-
var _a;
|
|
6484
|
-
const [uncontrolledIsOpened, setUncontrolledIsOpened] = (0, import_react9.useState)(
|
|
6485
|
-
(_a = props.defaultIsOpened) != null ? _a : marketDetailsDefaultIsOpened
|
|
6486
|
-
);
|
|
6487
|
-
(0, import_react9.useEffect)(() => {
|
|
6488
|
-
if (typeof props.isOpened !== "boolean")
|
|
6489
|
-
return;
|
|
6490
|
-
setUncontrolledIsOpened(props.isOpened);
|
|
6491
|
-
}, [props.isOpened]);
|
|
6492
|
-
const resolvedIsOpened = typeof props.isOpened === "boolean" ? props.isOpened : uncontrolledIsOpened;
|
|
6493
|
-
const handleOpenChange = (nextIsOpened) => {
|
|
6494
|
-
var _a2;
|
|
6495
|
-
if (typeof props.isOpened !== "boolean") {
|
|
6496
|
-
setUncontrolledIsOpened(nextIsOpened);
|
|
6497
|
-
}
|
|
6498
|
-
(_a2 = props.onOpenChange) == null ? void 0 : _a2.call(props, nextIsOpened);
|
|
6499
|
-
};
|
|
6578
|
+
var MarketDetails = (_a) => {
|
|
6579
|
+
var _b = _a, { isOpened } = _b, props = __objRest(_b, ["isOpened"]);
|
|
6500
6580
|
if (props.isLoading) {
|
|
6501
|
-
return /* @__PURE__ */ (0,
|
|
6581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6502
6582
|
MarketDetailsLoadingState,
|
|
6503
6583
|
{
|
|
6504
|
-
isOpened
|
|
6584
|
+
isOpened,
|
|
6505
6585
|
ariaLabel: props.ariaLabel,
|
|
6506
6586
|
classNames: props.classNames
|
|
6507
6587
|
}
|
|
6508
6588
|
);
|
|
6509
6589
|
}
|
|
6510
6590
|
if ("venueMarkets" in props && props.venueMarkets) {
|
|
6511
|
-
return /* @__PURE__ */ (0,
|
|
6591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6512
6592
|
MarketDetailsContent,
|
|
6513
6593
|
__spreadProps(__spreadValues({}, props), {
|
|
6514
|
-
isOpened
|
|
6515
|
-
onOpenChange:
|
|
6594
|
+
isOpened,
|
|
6595
|
+
onOpenChange: props.onOpenChange,
|
|
6516
6596
|
venueMarkets: props.venueMarkets
|
|
6517
6597
|
})
|
|
6518
6598
|
);
|
|
6519
6599
|
}
|
|
6520
6600
|
const { ariaLabel: fallbackAriaLabel, classNames: fallbackClassNames } = props;
|
|
6521
|
-
return /* @__PURE__ */ (0,
|
|
6601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(MarketDetailsUnavailableState, { ariaLabel: fallbackAriaLabel, classNames: fallbackClassNames });
|
|
6522
6602
|
};
|
|
6523
6603
|
MarketDetails.displayName = "MarketDetails";
|
|
6524
|
-
var resolveInitialExpandedId = (markets
|
|
6604
|
+
var resolveInitialExpandedId = (markets) => {
|
|
6525
6605
|
var _a, _b;
|
|
6526
6606
|
if (!markets.length)
|
|
6527
6607
|
return null;
|
|
6528
|
-
if (defaultId) {
|
|
6529
|
-
const match = markets.find((m) => m.id === defaultId);
|
|
6530
|
-
if (match)
|
|
6531
|
-
return match.id;
|
|
6532
|
-
}
|
|
6533
6608
|
return (_b = (_a = markets[0]) == null ? void 0 : _a.id) != null ? _b : null;
|
|
6534
6609
|
};
|
|
6535
6610
|
var MarketDetailsList = ({
|
|
6536
6611
|
eventId,
|
|
6537
|
-
expandedMarketId,
|
|
6538
|
-
defaultExpandedMarketId,
|
|
6539
6612
|
onExpandedMarketChange,
|
|
6540
6613
|
defaultTab,
|
|
6541
6614
|
defaultTimeRange,
|
|
6542
6615
|
classNames,
|
|
6543
6616
|
ariaLabel
|
|
6544
6617
|
}) => {
|
|
6545
|
-
const labels = (0,
|
|
6618
|
+
const labels = (0, import_hooks19.useLabels)();
|
|
6546
6619
|
const resolvedEventId = eventId || "";
|
|
6547
|
-
const { markets, isLoading, error } = (0,
|
|
6620
|
+
const { markets, isLoading, error } = (0, import_hooks19.useVenueMarkets)({
|
|
6548
6621
|
venueEventId: resolvedEventId,
|
|
6549
6622
|
enabled: !!resolvedEventId
|
|
6550
6623
|
});
|
|
6551
|
-
const [
|
|
6552
|
-
() => resolveInitialExpandedId(markets
|
|
6624
|
+
const [expandedMarketId, setExpandedMarketId] = (0, import_react9.useState)(
|
|
6625
|
+
() => resolveInitialExpandedId(markets)
|
|
6553
6626
|
);
|
|
6554
6627
|
(0, import_react9.useEffect)(() => {
|
|
6555
|
-
|
|
6556
|
-
return;
|
|
6557
|
-
setInternalExpandedId((current) => {
|
|
6628
|
+
setExpandedMarketId((current) => {
|
|
6558
6629
|
if (current && markets.some((m) => m.id === current))
|
|
6559
6630
|
return current;
|
|
6560
|
-
return resolveInitialExpandedId(markets
|
|
6631
|
+
return resolveInitialExpandedId(markets);
|
|
6561
6632
|
});
|
|
6562
|
-
}, [
|
|
6563
|
-
|
|
6564
|
-
if (
|
|
6633
|
+
}, [markets]);
|
|
6634
|
+
const handleToggle = (marketId) => {
|
|
6635
|
+
if (marketId === expandedMarketId) {
|
|
6636
|
+
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(null);
|
|
6637
|
+
setExpandedMarketId(null);
|
|
6565
6638
|
return;
|
|
6566
|
-
setInternalExpandedId(expandedMarketId);
|
|
6567
|
-
}, [expandedMarketId]);
|
|
6568
|
-
const resolvedExpandedId = typeof expandedMarketId === "undefined" ? internalExpandedId : expandedMarketId;
|
|
6569
|
-
const handleToggle = (marketId, isOpened) => {
|
|
6570
|
-
const next = isOpened ? marketId : null;
|
|
6571
|
-
if (typeof expandedMarketId === "undefined") {
|
|
6572
|
-
setInternalExpandedId(next);
|
|
6573
6639
|
}
|
|
6574
|
-
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(
|
|
6640
|
+
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(marketId);
|
|
6641
|
+
setExpandedMarketId(marketId);
|
|
6575
6642
|
};
|
|
6576
6643
|
if (isLoading) {
|
|
6577
|
-
return /* @__PURE__ */ (0,
|
|
6578
|
-
/* @__PURE__ */ (0,
|
|
6579
|
-
/* @__PURE__ */ (0,
|
|
6644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: cn("flex flex-col gap-3", classNames == null ? void 0 : classNames.root), "aria-label": ariaLabel, children: [
|
|
6645
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(MarketDetailsLoadingState, { isOpened: true, classNames: { root: classNames == null ? void 0 : classNames.item } }),
|
|
6646
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(MarketDetailsLoadingState, { isOpened: false, classNames: { root: classNames == null ? void 0 : classNames.item } })
|
|
6580
6647
|
] });
|
|
6581
6648
|
}
|
|
6582
6649
|
if (error) {
|
|
6583
|
-
return /* @__PURE__ */ (0,
|
|
6650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card, { className: cn(marketDetailsBaseCardClassName, "p-0", classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6584
6651
|
StateMessage,
|
|
6585
6652
|
{
|
|
6586
6653
|
ariaLabel: ariaLabel != null ? ariaLabel : labels.marketDetails.unavailableAria,
|
|
@@ -6591,7 +6658,7 @@ var MarketDetailsList = ({
|
|
|
6591
6658
|
) });
|
|
6592
6659
|
}
|
|
6593
6660
|
if (markets.length === 0) {
|
|
6594
|
-
return /* @__PURE__ */ (0,
|
|
6661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card, { className: cn(marketDetailsBaseCardClassName, "p-0", classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6595
6662
|
StateMessage,
|
|
6596
6663
|
{
|
|
6597
6664
|
ariaLabel: ariaLabel != null ? ariaLabel : labels.marketDetails.notFoundAria,
|
|
@@ -6601,12 +6668,15 @@ var MarketDetailsList = ({
|
|
|
6601
6668
|
}
|
|
6602
6669
|
) });
|
|
6603
6670
|
}
|
|
6604
|
-
return /* @__PURE__ */ (0,
|
|
6671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.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_runtime80.jsx)(
|
|
6605
6672
|
MarketDetails,
|
|
6606
6673
|
{
|
|
6674
|
+
marketId: market.id,
|
|
6607
6675
|
venueMarkets: [market],
|
|
6608
|
-
isOpened:
|
|
6609
|
-
onOpenChange: (
|
|
6676
|
+
isOpened: expandedMarketId === market.id,
|
|
6677
|
+
onOpenChange: (marketId) => {
|
|
6678
|
+
handleToggle(marketId);
|
|
6679
|
+
},
|
|
6610
6680
|
defaultTab,
|
|
6611
6681
|
defaultTimeRange,
|
|
6612
6682
|
ariaLabel: market.question,
|
|
@@ -6619,13 +6689,17 @@ MarketDetailsList.displayName = "MarketDetailsList";
|
|
|
6619
6689
|
|
|
6620
6690
|
// src/events/list/index.tsx
|
|
6621
6691
|
var import_react10 = require("react");
|
|
6622
|
-
var
|
|
6692
|
+
var import_hooks20 = require("@agg-market/hooks");
|
|
6623
6693
|
|
|
6624
6694
|
// src/events/list/event-list.constants.ts
|
|
6625
6695
|
var POLYMARKET_VENUE = "polymarket";
|
|
6626
6696
|
var KALSHI_VENUE = "kalshi";
|
|
6697
|
+
var OPINION_VENUE = "opinion";
|
|
6698
|
+
var PROBABLE_VENUE = "probable";
|
|
6627
6699
|
var POLYMARKET_VENUE_LOGO = "polymarket";
|
|
6628
6700
|
var KALSHI_VENUE_LOGO = "kalshi";
|
|
6701
|
+
var OPINION_VENUE_LOGO = "opinion";
|
|
6702
|
+
var PROBABLE_VENUE_LOGO = "probable";
|
|
6629
6703
|
var getDefaultEventListTabs = (labels) => {
|
|
6630
6704
|
return [
|
|
6631
6705
|
{
|
|
@@ -6644,6 +6718,18 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
6644
6718
|
label: labels.venues.kalshi,
|
|
6645
6719
|
venueLogo: KALSHI_VENUE_LOGO,
|
|
6646
6720
|
venues: [KALSHI_VENUE]
|
|
6721
|
+
},
|
|
6722
|
+
{
|
|
6723
|
+
value: "opinion",
|
|
6724
|
+
label: labels.venues.opinion,
|
|
6725
|
+
venueLogo: OPINION_VENUE_LOGO,
|
|
6726
|
+
venues: [OPINION_VENUE]
|
|
6727
|
+
},
|
|
6728
|
+
{
|
|
6729
|
+
value: "probable",
|
|
6730
|
+
label: labels.venues.probable,
|
|
6731
|
+
venueLogo: PROBABLE_VENUE_LOGO,
|
|
6732
|
+
venues: [PROBABLE_VENUE]
|
|
6647
6733
|
}
|
|
6648
6734
|
];
|
|
6649
6735
|
};
|
|
@@ -6662,21 +6748,21 @@ var resolveTabVenus = (tab) => {
|
|
|
6662
6748
|
return void 0;
|
|
6663
6749
|
if (tab.venues && tab.venues.length > 0)
|
|
6664
6750
|
return tab.venues;
|
|
6665
|
-
if (tab.value === "polymarket" || tab.value === "kalshi") {
|
|
6751
|
+
if (tab.value === "polymarket" || tab.value === "kalshi" || tab.value === "opinion" || tab.value === "probable") {
|
|
6666
6752
|
return [tab.value];
|
|
6667
6753
|
}
|
|
6668
6754
|
return void 0;
|
|
6669
6755
|
};
|
|
6670
6756
|
|
|
6671
6757
|
// src/events/list/index.tsx
|
|
6672
|
-
var
|
|
6758
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
6673
6759
|
var renderTabIcon = (tab, isActive) => {
|
|
6674
6760
|
if (tab.venueLogo) {
|
|
6675
|
-
return /* @__PURE__ */ (0,
|
|
6761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(VenueLogo, { venue: tab.venueLogo, size: "small" });
|
|
6676
6762
|
}
|
|
6677
6763
|
if (!tab.iconName)
|
|
6678
6764
|
return null;
|
|
6679
|
-
return /* @__PURE__ */ (0,
|
|
6765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
6680
6766
|
Icon,
|
|
6681
6767
|
{
|
|
6682
6768
|
name: tab.iconName,
|
|
@@ -6721,7 +6807,7 @@ var EventList = ({
|
|
|
6721
6807
|
onClick
|
|
6722
6808
|
}) => {
|
|
6723
6809
|
var _a, _b;
|
|
6724
|
-
const labels = (0,
|
|
6810
|
+
const labels = (0, import_hooks20.useLabels)();
|
|
6725
6811
|
const defaultEventListTabs = (0, import_react10.useMemo)(() => {
|
|
6726
6812
|
return getDefaultEventListTabs(labels);
|
|
6727
6813
|
}, [labels]);
|
|
@@ -6742,7 +6828,8 @@ var EventList = ({
|
|
|
6742
6828
|
}, [maxVisibleItems]);
|
|
6743
6829
|
const requestLimit = resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : limit;
|
|
6744
6830
|
const shouldPaginate = resolvedMaxVisibleItems == null;
|
|
6745
|
-
const { events, isLoading, isError, fetchNextPage, hasNextPage, isFetchingNextPage } = (0,
|
|
6831
|
+
const { events, isLoading, isError, fetchNextPage, hasNextPage, isFetchingNextPage } = (0, import_hooks20.useVenueEvents)({
|
|
6832
|
+
queryKeyScope: "event-list",
|
|
6746
6833
|
venues,
|
|
6747
6834
|
search,
|
|
6748
6835
|
categoryIds,
|
|
@@ -6846,17 +6933,17 @@ var EventList = ({
|
|
|
6846
6933
|
"md:[grid-template-columns:repeat(var(--agg-event-list-columns),minmax(0,1fr))]"
|
|
6847
6934
|
);
|
|
6848
6935
|
if (shouldRenderLoadingState) {
|
|
6849
|
-
return /* @__PURE__ */ (0,
|
|
6936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Skeleton, { view: "event-list", ariaLabel: labels.eventList.loading(title) });
|
|
6850
6937
|
}
|
|
6851
|
-
return /* @__PURE__ */ (0,
|
|
6852
|
-
/* @__PURE__ */ (0,
|
|
6938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("section", { className: "flex w-full flex-col gap-5", children: [
|
|
6939
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
6853
6940
|
"header",
|
|
6854
6941
|
{
|
|
6855
6942
|
ref: headerRef,
|
|
6856
6943
|
className: "flex flex-col sm:flex-row w-full flex-nowrap items-start sm:items-center justify-between gap-2 sm:gap-4",
|
|
6857
6944
|
children: [
|
|
6858
|
-
/* @__PURE__ */ (0,
|
|
6859
|
-
/* @__PURE__ */ (0,
|
|
6945
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { ref: titleRef, className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Typography, { as: "h2", variant: "title", className: "truncate [&::first-letter]:uppercase", children: title }) }),
|
|
6946
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
6860
6947
|
Tabs,
|
|
6861
6948
|
{
|
|
6862
6949
|
ariaLabel: labels.eventList.tabsAria(title),
|
|
@@ -6868,8 +6955,8 @@ var EventList = ({
|
|
|
6868
6955
|
]
|
|
6869
6956
|
}
|
|
6870
6957
|
),
|
|
6871
|
-
/* @__PURE__ */ (0,
|
|
6872
|
-
tileEvents.map((event) => /* @__PURE__ */ (0,
|
|
6958
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: gridClassName, style: gridStyle, children: [
|
|
6959
|
+
tileEvents.map((event) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
6873
6960
|
EventListItem,
|
|
6874
6961
|
{
|
|
6875
6962
|
event,
|
|
@@ -6880,7 +6967,7 @@ var EventList = ({
|
|
|
6880
6967
|
},
|
|
6881
6968
|
event.id
|
|
6882
6969
|
)),
|
|
6883
|
-
Array.from({ length: loadingPlaceholderCount }).map((_, index) => /* @__PURE__ */ (0,
|
|
6970
|
+
Array.from({ length: loadingPlaceholderCount }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
6884
6971
|
EventListItem,
|
|
6885
6972
|
{
|
|
6886
6973
|
isLoading: true,
|
|
@@ -6890,16 +6977,15 @@ var EventList = ({
|
|
|
6890
6977
|
},
|
|
6891
6978
|
`loading-${index}`
|
|
6892
6979
|
)),
|
|
6893
|
-
!isLoading && !isError && (tileEvents == null ? void 0 : tileEvents.length) === 0 ? /* @__PURE__ */ (0,
|
|
6980
|
+
!isLoading && !isError && (tileEvents == null ? void 0 : tileEvents.length) === 0 ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Card, { className: "col-span-full overflow-hidden shadow-none hover:shadow-none p-0! border-none! bg-transparent!", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
6894
6981
|
StateMessage,
|
|
6895
6982
|
{
|
|
6896
6983
|
ariaLabel: labels.eventList.emptyAria,
|
|
6897
6984
|
title: labels.eventList.emptyTitle,
|
|
6898
|
-
description: labels.eventList.emptyDescription
|
|
6899
|
-
className: "min-h-[320px]"
|
|
6985
|
+
description: labels.eventList.emptyDescription
|
|
6900
6986
|
}
|
|
6901
6987
|
) }) : null,
|
|
6902
|
-
isError ? /* @__PURE__ */ (0,
|
|
6988
|
+
isError ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
6903
6989
|
Typography,
|
|
6904
6990
|
{
|
|
6905
6991
|
variant: "body",
|
|
@@ -6908,7 +6994,7 @@ var EventList = ({
|
|
|
6908
6994
|
}
|
|
6909
6995
|
) : null
|
|
6910
6996
|
] }),
|
|
6911
|
-
shouldPaginate && hasNextPage ? /* @__PURE__ */ (0,
|
|
6997
|
+
shouldPaginate && hasNextPage ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { ref: loadMoreRef, className: "h-px w-full", "aria-hidden": true }) : null
|
|
6912
6998
|
] });
|
|
6913
6999
|
};
|
|
6914
7000
|
EventList.displayName = "EventList";
|