@agg-build/ui 2.4.3 → 2.4.5

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.
Files changed (38) hide show
  1. package/dist/{chunk-GLVLCXIM.mjs → chunk-CXSIXL7M.mjs} +29 -35
  2. package/dist/{chunk-PHAEFHBM.mjs → chunk-GWRFSQQK.mjs} +70 -17
  3. package/dist/{chunk-PHRYWSNV.mjs → chunk-I4X5UNCT.mjs} +307 -240
  4. package/dist/{chunk-3PSIO77N.mjs → chunk-JVRTJQPZ.mjs} +1 -1
  5. package/dist/{chunk-QDNG5UKJ.mjs → chunk-P5CVJQPW.mjs} +288 -291
  6. package/dist/{chunk-WZ55ERDO.mjs → chunk-PTNFXXOV.mjs} +50 -11
  7. package/dist/{chunk-STL4ZHLP.mjs → chunk-UH3DUTMG.mjs} +140 -115
  8. package/dist/events.js +440 -305
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +840 -666
  11. package/dist/index.mjs +7 -7
  12. package/dist/modals.js +333 -297
  13. package/dist/modals.mjs +3 -3
  14. package/dist/pages.js +558 -381
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +50 -11
  17. package/dist/primitives.mjs +1 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +2597 -2384
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/events/item-details/event-list-item-details.constants.d.mts +1 -1
  23. package/dist/types/events/item-details/event-list-item-details.constants.d.ts +1 -1
  24. package/dist/types/events/item-details/settlement-summary.d.mts +1 -1
  25. package/dist/types/events/item-details/settlement-summary.d.ts +1 -1
  26. package/dist/types/onboarding/index.d.mts +1 -1
  27. package/dist/types/onboarding/index.d.ts +1 -1
  28. package/dist/types/onboarding/steps/connect-accounts.d.mts +1 -1
  29. package/dist/types/onboarding/steps/connect-accounts.d.ts +1 -1
  30. package/dist/types/primitives/icon/icon.constants.d.mts +1 -0
  31. package/dist/types/primitives/icon/icon.constants.d.ts +1 -0
  32. package/dist/types/shared/use-horizontal-scroll-state.d.mts +3 -0
  33. package/dist/types/shared/use-horizontal-scroll-state.d.ts +3 -0
  34. package/dist/types/trading/place-order/index.place-order.utils.d.mts +1 -0
  35. package/dist/types/trading/place-order/index.place-order.utils.d.ts +1 -0
  36. package/dist/types/trading/settlement/index.d.mts +1 -1
  37. package/dist/types/trading/settlement/index.d.ts +1 -1
  38. package/package.json +2 -2
@@ -1643,6 +1643,12 @@ var iconSizeClasses = {
1643
1643
  medium: "h-6 w-6",
1644
1644
  large: "h-8 w-8"
1645
1645
  };
1646
+ var iconSizePixels = {
1647
+ xs: 12,
1648
+ small: 16,
1649
+ medium: 24,
1650
+ large: 32
1651
+ };
1646
1652
 
1647
1653
  // src/primitives/search/search-empty-icon.tsx
1648
1654
  import { jsx as jsx40, jsxs as jsxs40 } from "react/jsx-runtime";
@@ -3244,6 +3250,8 @@ var Icon = (_a) => {
3244
3250
  __spreadValues({
3245
3251
  color,
3246
3252
  className: cn("group/agg-icon", resolvedClassName),
3253
+ width: iconSizePixels[size],
3254
+ height: iconSizePixels[size],
3247
3255
  style: resolvedStyle
3248
3256
  }, props)
3249
3257
  );
@@ -5575,7 +5583,7 @@ EventListSkeletonView.displayName = "EventListSkeletonView";
5575
5583
  import { useLabels as useLabels5 } from "@agg-build/hooks";
5576
5584
 
5577
5585
  // src/events/item-details/event-list-item-details.constants.ts
5578
- var detailsBaseCardClassName = "w-full gap-6 p-5 md:gap-8";
5586
+ var detailsBaseCardClassName = "w-full gap-6 p-4 md:p-5 md:gap-8";
5579
5587
 
5580
5588
  // src/primitives/skeleton/views/event-list-item-details-skeleton-view.tsx
5581
5589
  import { jsx as jsx101, jsxs as jsxs98 } from "react/jsx-runtime";
@@ -8846,14 +8854,23 @@ import { useCallback as useCallback6, useEffect as useEffect9, useLayoutEffect a
8846
8854
  import { useCallback as useCallback5, useEffect as useEffect8, useRef as useRef8, useState as useState9 } from "react";
8847
8855
  var useHorizontalScrollState = () => {
8848
8856
  const containerRef = useRef8(null);
8857
+ const [hasOverflow, setHasOverflow] = useState9(false);
8858
+ const [isAtStart, setIsAtStart] = useState9(true);
8859
+ const [isAtEnd, setIsAtEnd] = useState9(true);
8849
8860
  const [canScrollLeft, setCanScrollLeft] = useState9(false);
8850
8861
  const [canScrollRight, setCanScrollRight] = useState9(false);
8851
8862
  const update = useCallback5(() => {
8852
8863
  const el = containerRef.current;
8853
8864
  if (!el) return;
8854
- const maxScroll = el.scrollWidth - el.clientWidth;
8855
- setCanScrollLeft(el.scrollLeft > 4);
8856
- setCanScrollRight(maxScroll - el.scrollLeft > 4);
8865
+ const epsilon = 2;
8866
+ const nextHasOverflow = el.scrollWidth > el.clientWidth + epsilon;
8867
+ const nextIsAtStart = el.scrollLeft <= epsilon;
8868
+ const nextIsAtEnd = el.scrollLeft + el.clientWidth >= el.scrollWidth - epsilon;
8869
+ setHasOverflow(nextHasOverflow);
8870
+ setIsAtStart(nextIsAtStart);
8871
+ setIsAtEnd(nextIsAtEnd);
8872
+ setCanScrollLeft(nextHasOverflow && !nextIsAtStart);
8873
+ setCanScrollRight(nextHasOverflow && !nextIsAtEnd);
8857
8874
  }, []);
8858
8875
  useEffect8(() => {
8859
8876
  const el = containerRef.current;
@@ -8869,7 +8886,15 @@ var useHorizontalScrollState = () => {
8869
8886
  ro.observe(el);
8870
8887
  return () => ro.disconnect();
8871
8888
  }, [update]);
8872
- return { containerRef, canScrollLeft, canScrollRight, update };
8889
+ return {
8890
+ containerRef,
8891
+ hasOverflow,
8892
+ isAtStart,
8893
+ isAtEnd,
8894
+ canScrollLeft,
8895
+ canScrollRight,
8896
+ update
8897
+ };
8873
8898
  };
8874
8899
 
8875
8900
  // src/primitives/tabs/tabs.constants.ts
@@ -8964,6 +8989,9 @@ var Tabs = ({
8964
8989
  });
8965
8990
  const {
8966
8991
  containerRef: tabListRef,
8992
+ hasOverflow,
8993
+ isAtStart,
8994
+ isAtEnd,
8967
8995
  canScrollLeft,
8968
8996
  canScrollRight,
8969
8997
  update: updateScrollState
@@ -9052,7 +9080,7 @@ var Tabs = ({
9052
9080
  "overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
9053
9081
  getMotionClassName(enableAnimations, "scroll-smooth")
9054
9082
  ) : "overflow-x-auto",
9055
- isBarVariant ? "items-start rounded-agg-lg border border-agg-separator p-1.5" : "h-15 border-b border-agg-separator -mb-[1px]",
9083
+ isBarVariant ? "items-start rounded-agg-lg border border-agg-separator p-1.5" : "h-14 md:h-15 border-b border-agg-separator -mb-[1px]",
9056
9084
  shouldUseOverflowScroll && "select-none",
9057
9085
  shouldUseOverflowScroll && !isBarVariant && "snap-x snap-mandatory",
9058
9086
  shouldUseOverflowScroll && (isDraggingTabs ? "cursor-grabbing" : "cursor-grab")
@@ -9210,7 +9238,10 @@ var Tabs = ({
9210
9238
  left: Math.max(0, nextScrollLeft),
9211
9239
  behavior: getScrollBehavior(enableAnimations)
9212
9240
  });
9213
- }, [enableAnimations, renderedItems, shouldUseOverflowScroll, value]);
9241
+ requestAnimationFrame(() => {
9242
+ updateScrollState();
9243
+ });
9244
+ }, [enableAnimations, renderedItems, shouldUseOverflowScroll, updateScrollState, value]);
9214
9245
  if (shouldUseOverflowSelect) {
9215
9246
  return /* @__PURE__ */ jsx128("div", { className: cn("group/agg-tabs w-full", className, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ jsx128(
9216
9247
  Select,
@@ -9249,6 +9280,13 @@ var Tabs = ({
9249
9280
  onPointerUp: handleEndTabListDrag,
9250
9281
  onWheel: handleTabListWheel,
9251
9282
  children: [
9283
+ shouldUseOverflowScroll && !isBarVariant && hasOverflow ? /* @__PURE__ */ jsx128(
9284
+ "span",
9285
+ {
9286
+ "aria-hidden": true,
9287
+ className: "agg-tab-scroll-start-spacer h-full w-4 shrink-0 snap-start"
9288
+ }
9289
+ ) : null,
9252
9290
  renderedItems.map((item, index) => {
9253
9291
  var _a;
9254
9292
  const isActive = item.value === value;
@@ -9283,6 +9321,7 @@ var Tabs = ({
9283
9321
  isDisabled: !!item.disabled,
9284
9322
  size
9285
9323
  }),
9324
+ !isBarVariant && (size === "s" ? "px-3 md:px-4" : "h-14 px-3 md:h-15 md:px-4"),
9286
9325
  shouldUseOverflowScroll && !isBarVariant && "snap-start",
9287
9326
  classNames == null ? void 0 : classNames.tabTrigger
9288
9327
  ),
@@ -9332,9 +9371,9 @@ var Tabs = ({
9332
9371
  "aria-hidden": true,
9333
9372
  className: cn(
9334
9373
  "agg-tab-scroll-start",
9335
- "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",
9374
+ "pointer-events-none absolute inset-y-0 left-0 z-10 w-6 md:w-[60px] bg-linear-to-r from-agg-secondary to-transparent",
9336
9375
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
9337
- canScrollLeft ? "opacity-100" : "opacity-0"
9376
+ hasOverflow && canScrollLeft && !isAtStart ? "opacity-100" : "opacity-0"
9338
9377
  )
9339
9378
  }
9340
9379
  ),
@@ -9344,9 +9383,9 @@ var Tabs = ({
9344
9383
  "aria-hidden": true,
9345
9384
  className: cn(
9346
9385
  "agg-tab-scroll-end",
9347
- "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",
9386
+ "pointer-events-none absolute inset-y-0 right-0 z-10 w-6 md:w-[60px] bg-linear-to-l from-agg-secondary to-transparent",
9348
9387
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
9349
- canScrollRight ? "opacity-100" : "opacity-0"
9388
+ hasOverflow && canScrollRight && !isAtEnd ? "opacity-100" : "opacity-0"
9350
9389
  )
9351
9390
  }
9352
9391
  )
@@ -2,7 +2,6 @@
2
2
  import {
3
3
  Card,
4
4
  DEFAULT_VENUE_COLOR,
5
- Icon,
6
5
  Skeleton,
7
6
  VenueLogo,
8
7
  __spreadProps,
@@ -20,7 +19,7 @@ import {
20
19
  selectPrimaryVenueMarket,
21
20
  skeletonViews,
22
21
  sortOutcomes
23
- } from "./chunk-WZ55ERDO.mjs";
22
+ } from "./chunk-PTNFXXOV.mjs";
24
23
 
25
24
  // src/trading/trading-context/index.tsx
26
25
  import { useEventTradingContext } from "@agg-build/hooks";
@@ -198,13 +197,6 @@ var parseSettlementBlocks = (input) => {
198
197
  }
199
198
  return blocks;
200
199
  };
201
- var getFirstSettlementParagraph = (input) => {
202
- if (!input) return "";
203
- const blocks = parseSettlementBlocks(input);
204
- const firstParagraph = blocks.find((block) => block.kind === "paragraph");
205
- if (!firstParagraph || firstParagraph.kind !== "paragraph") return "";
206
- return firstParagraph.lines.join(" ").trim();
207
- };
208
200
  var normalizeSettlementForCompare = (input) => {
209
201
  return stripHtmlFragments(input).replace(/\s+/g, " ").trim().toLowerCase();
210
202
  };
@@ -440,7 +432,13 @@ var mergePerVenueValues = (current, next) => {
440
432
  };
441
433
  var prepareSettlementDifferences = (differences) => {
442
434
  const byCanonicalKey = /* @__PURE__ */ new Map();
443
- for (const [originalIndex, difference] of (differences != null ? differences : []).entries()) {
435
+ for (const [originalIndex, rawDifference] of (differences != null ? differences : []).entries()) {
436
+ const title = rawDifference.title.trim();
437
+ const perVenue = Object.fromEntries(
438
+ Object.entries(rawDifference.perVenue).map(([venue, value]) => [venue.trim(), value.trim()]).filter(([venue, value]) => venue.length > 0 && value.length > 0)
439
+ );
440
+ if (!title || Object.keys(perVenue).length === 0) continue;
441
+ const difference = __spreadProps(__spreadValues({}, rawDifference), { title, perVenue });
444
442
  const canonicalKey = resolveCanonicalDifferenceKey(difference);
445
443
  if (hasEqualNormalizedDateValues(difference, canonicalKey)) continue;
446
444
  const existing = byCanonicalKey.get(canonicalKey);
@@ -495,17 +493,76 @@ var resolveDifferenceIconClassName = (canonicalKey) => {
495
493
  return "fi-rr-info";
496
494
  };
497
495
  var buildSettlementVenueRules = ({
498
- eventBlock,
499
496
  marketBlock,
500
497
  primaryRulesBlock,
498
+ settlementVenues,
501
499
  settlementVenueRules
502
500
  }) => {
503
- if (settlementVenueRules) return settlementVenueRules;
504
- const content = [marketBlock == null ? void 0 : marketBlock.content, primaryRulesBlock == null ? void 0 : primaryRulesBlock.content, eventBlock == null ? void 0 : eventBlock.content].filter((value) => typeof value === "string" && value.trim().length > 0).join("\n\n");
505
- return content ? [{ venue: "polymarket", content }] : [];
501
+ var _a, _b;
502
+ if (settlementVenueRules) {
503
+ const rulesByVenue = /* @__PURE__ */ new Map();
504
+ for (const rule of settlementVenueRules) {
505
+ const venue2 = rule.venue.trim();
506
+ const content2 = rule.content.trim();
507
+ if (!venue2 || !content2) continue;
508
+ const venueRules = (_a = rulesByVenue.get(venue2)) != null ? _a : [];
509
+ if (!venueRules.includes(content2)) venueRules.push(content2);
510
+ rulesByVenue.set(venue2, venueRules);
511
+ }
512
+ return Array.from(rulesByVenue, ([venue2, contents]) => ({
513
+ venue: venue2,
514
+ content: contents.join("\n\n")
515
+ }));
516
+ }
517
+ const content = [marketBlock == null ? void 0 : marketBlock.content, primaryRulesBlock == null ? void 0 : primaryRulesBlock.content].filter((value) => typeof value === "string" && value.trim().length > 0).join("\n\n");
518
+ const venue = (_b = settlementVenues == null ? void 0 : settlementVenues.find((candidate) => candidate.trim().length > 0)) == null ? void 0 : _b.trim();
519
+ return content && venue ? [{ venue, content }] : [];
520
+ };
521
+ var isDuplicatedByVenueRules = (content, venueRules) => {
522
+ const normalizedContent = normalizeSettlementForCompare(content);
523
+ if (!normalizedContent) return false;
524
+ return venueRules.some((rule) => {
525
+ const normalizedRule = normalizeSettlementForCompare(rule.content);
526
+ return normalizedRule.includes(normalizedContent);
527
+ });
506
528
  };
507
- var getSettlementHeaderClassName = () => {
508
- return "flex items-center justify-between gap-4";
529
+ var SettlementVenueRules = ({
530
+ rules,
531
+ labels
532
+ }) => {
533
+ return /* @__PURE__ */ jsxs2("div", { className: "agg-settlement-venue-rules flex w-full flex-col items-start gap-4", children: [
534
+ /* @__PURE__ */ jsx2("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.trading.settlementFullRulesTitle }),
535
+ /* @__PURE__ */ jsx2("div", { className: "flex w-full flex-col items-start gap-4", children: rules.map((rule) => {
536
+ const venueLabel = resolveSettlementVenueLabel(rule.venue, labels);
537
+ return /* @__PURE__ */ jsxs2("details", { className: "group/agg-settlement-rule w-full", children: [
538
+ /* @__PURE__ */ jsxs2("summary", { className: "flex cursor-pointer list-none items-center gap-2 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground group-hover/agg-settlement-rule:text-agg-muted-foreground transition-colors marker:hidden", children: [
539
+ /* @__PURE__ */ jsx2(
540
+ VenueLogo,
541
+ {
542
+ venue: rule.venue,
543
+ size: "small",
544
+ className: "size-4",
545
+ ariaLabel: venueLabel
546
+ }
547
+ ),
548
+ /* @__PURE__ */ jsx2("span", { className: "text-agg-foreground group-hover/agg-settlement-rule:text-agg-muted-foreground transition-colors", children: venueLabel }),
549
+ /* @__PURE__ */ jsx2(
550
+ "i",
551
+ {
552
+ className: cn(
553
+ "fi fi-rr-angle-small-down text-[14px]!",
554
+ "group-open/agg-settlement-rule:rotate-180",
555
+ "size-3.5! shrink-0 text-agg-foreground group-hover/agg-settlement-rule:text-agg-muted-foreground transition-[colors,transform]"
556
+ ),
557
+ style: { fontSize: 14 },
558
+ "aria-hidden": "true"
559
+ }
560
+ )
561
+ ] }),
562
+ /* @__PURE__ */ jsx2("div", { className: "mt-3 pl-6", children: /* @__PURE__ */ jsx2(SettlementTextRenderer, { content: rule.content }) })
563
+ ] }, rule.venue);
564
+ }) })
565
+ ] });
509
566
  };
510
567
  var Settlement = ({
511
568
  className,
@@ -539,13 +596,20 @@ var Settlement = ({
539
596
  const primaryRulesBlock = (_c = blocks.find((block) => block.key === "primaryRules")) != null ? _c : null;
540
597
  const venueRuleBlocks = useMemo(
541
598
  () => buildSettlementVenueRules({
542
- eventBlock,
543
599
  marketBlock,
544
600
  primaryRulesBlock,
601
+ settlementVenues,
545
602
  settlementVenueRules
546
603
  }),
547
- [eventBlock, marketBlock, primaryRulesBlock, settlementVenueRules]
604
+ [marketBlock, primaryRulesBlock, settlementVenues, settlementVenueRules]
548
605
  );
606
+ const hasSettlementDifferences = settlementDifferences.length > 0;
607
+ const hasVenueSettlementRules = venueRuleBlocks.length > 0;
608
+ const standaloneEventBlock = eventBlock && !isDuplicatedByVenueRules(eventBlock.content, venueRuleBlocks) ? eventBlock : null;
609
+ const standaloneMarketBlock = hasVenueSettlementRules ? null : marketBlock;
610
+ const standalonePrimaryRulesBlock = hasVenueSettlementRules ? null : primaryRulesBlock;
611
+ const hasStandaloneSettlementText = hasVenueSettlementRules ? standaloneEventBlock !== null : blocks.length > 0;
612
+ const hasSettlementContent = hasSettlementDifferences || hasVenueSettlementRules || hasStandaloneSettlementText;
549
613
  const defaultOpenDifferenceKey = (_e = (_d = settlementDifferences[0]) == null ? void 0 : _d.canonicalKey) != null ? _e : null;
550
614
  const [openDifferenceKeys, setOpenDifferenceKeys] = useState(
551
615
  () => defaultOpenDifferenceKey ? [defaultOpenDifferenceKey] : []
@@ -568,25 +632,51 @@ var Settlement = ({
568
632
  }
569
633
  );
570
634
  }
635
+ if (!hasSettlementContent) return null;
571
636
  const resolvedSectionLabel = sectionLabel === defaultSettlementSectionLabel ? labels.trading.settlementSection : sectionLabel;
572
- if (settlementDifferences.length > 0) {
573
- return /* @__PURE__ */ jsxs2(
574
- Card,
575
- {
576
- id,
577
- className: cn(
578
- "group/agg-settlement-card",
579
- "flex w-full flex-col items-start gap-4 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5 shadow-none hover:shadow-none sm:gap-5",
580
- className
581
- ),
582
- children: [
583
- /* @__PURE__ */ jsxs2("div", { className: "agg-settlement-header flex w-full flex-col items-start gap-1 text-agg-muted-foreground sm:flex-row sm:items-center sm:justify-between sm:gap-4", children: [
584
- /* @__PURE__ */ jsx2("p", { className: "shrink-0 text-agg-xs font-agg-bold leading-agg-4 uppercase", children: resolvedSectionLabel }),
585
- question ? /* @__PURE__ */ jsx2("p", { className: "agg-settlement-question min-w-0 text-agg-sm font-agg-normal leading-agg-5 sm:max-w-[314px] sm:truncate", children: question }) : null
586
- ] }),
587
- /* @__PURE__ */ jsxs2("div", { className: "agg-settlement-differences flex w-full flex-col items-start gap-5", children: [
637
+ return /* @__PURE__ */ jsxs2(
638
+ Card,
639
+ {
640
+ id,
641
+ className: cn(
642
+ "group/agg-settlement-card",
643
+ "flex w-full flex-col items-start gap-4 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5 shadow-none hover:shadow-none sm:gap-5",
644
+ className
645
+ ),
646
+ children: [
647
+ /* @__PURE__ */ jsxs2("div", { className: "agg-settlement-header flex w-full flex-col items-start gap-1 text-agg-muted-foreground sm:flex-row sm:items-center sm:justify-between sm:gap-4", children: [
648
+ /* @__PURE__ */ jsx2("p", { className: "shrink-0 text-agg-xs font-agg-bold leading-agg-4 uppercase", children: resolvedSectionLabel }),
649
+ question ? /* @__PURE__ */ jsx2("p", { className: "agg-settlement-question min-w-0 text-agg-sm font-agg-normal leading-agg-5 sm:max-w-[314px] sm:truncate", children: question }) : null
650
+ ] }),
651
+ /* @__PURE__ */ jsxs2("div", { className: "agg-settlement-sections flex w-full flex-col items-start gap-5", children: [
652
+ hasStandaloneSettlementText ? /* @__PURE__ */ jsxs2("div", { className: "w-full", children: [
653
+ standaloneEventBlock || standaloneMarketBlock ? /* @__PURE__ */ jsxs2(
654
+ "div",
655
+ {
656
+ className: "agg-settlement-section agg-settlement-section-description",
657
+ "data-source": "description",
658
+ children: [
659
+ standaloneEventBlock ? /* @__PURE__ */ jsx2("div", { "data-source": "eventDescription", children: /* @__PURE__ */ jsx2(SettlementTextRenderer, { content: standaloneEventBlock.content }) }) : null,
660
+ standaloneEventBlock && standaloneMarketBlock ? /* @__PURE__ */ jsx2("hr", { className: "agg-settlement-divider my-4 border-0 border-t border-agg-separator" }) : null,
661
+ standaloneMarketBlock ? /* @__PURE__ */ jsx2("div", { "data-source": "marketDescription", children: /* @__PURE__ */ jsx2(SettlementTextRenderer, { content: standaloneMarketBlock.content }) }) : null
662
+ ]
663
+ }
664
+ ) : null,
665
+ standalonePrimaryRulesBlock ? /* @__PURE__ */ jsxs2(
666
+ "div",
667
+ {
668
+ className: "agg-settlement-section agg-settlement-section-primaryRules",
669
+ "data-source": "primaryRules",
670
+ children: [
671
+ /* @__PURE__ */ jsx2("p", { className: "agg-settlement-section-label text-agg-xs font-agg-bold leading-agg-4 uppercase text-agg-muted-foreground mb-2", children: labels.trading.settlementPrimaryRulesLabel }),
672
+ /* @__PURE__ */ jsx2(SettlementTextRenderer, { content: standalonePrimaryRulesBlock.content })
673
+ ]
674
+ }
675
+ ) : null
676
+ ] }) : null,
677
+ hasSettlementDifferences ? /* @__PURE__ */ jsxs2("div", { className: "agg-settlement-differences flex w-full flex-col items-start gap-5", children: [
588
678
  /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
589
- /* @__PURE__ */ jsx2("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: "Key differences" }),
679
+ /* @__PURE__ */ jsx2("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.trading.settlementDifferencesTitle }),
590
680
  /* @__PURE__ */ jsx2("span", { className: "flex size-4 shrink-0 items-center justify-center rounded-agg-full bg-agg-primary text-[10px] font-agg-bold leading-[14px] text-agg-on-primary", children: settlementDifferences.length })
591
681
  ] }),
592
682
  /* @__PURE__ */ jsx2("div", { className: "flex w-full flex-col items-start gap-5", children: settlementDifferences.map((difference) => {
@@ -602,7 +692,7 @@ var Settlement = ({
602
692
  "button",
603
693
  {
604
694
  type: "button",
605
- className: "flex w-full cursor-pointer items-start gap-2 text-left",
695
+ className: "flex w-full cursor-pointer items-center gap-2 text-left group/agg-settlement-difference",
606
696
  "aria-expanded": isExpanded,
607
697
  onClick: () => handleToggleDifference(difference.canonicalKey),
608
698
  children: [
@@ -617,12 +707,16 @@ var Settlement = ({
617
707
  "aria-hidden": "true"
618
708
  }
619
709
  ),
620
- /* @__PURE__ */ jsx2("p", { className: "min-w-0 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground break-words [overflow-wrap:anywhere]", children: difference.title }),
710
+ /* @__PURE__ */ jsx2("p", { className: "min-w-0 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground group-hover/agg-settlement-difference:text-agg-muted-foreground transition-colors break-words [overflow-wrap:anywhere]", children: difference.title }),
621
711
  /* @__PURE__ */ jsx2(
622
- Icon,
712
+ "i",
623
713
  {
624
- name: isExpanded ? "chevron-up" : "chevron-down",
625
- className: "size-4! mt-0.5 shrink-0 text-agg-foreground",
714
+ className: cn(
715
+ "fi fi-rr-angle-small-down text-[14px]!",
716
+ isExpanded && "rotate-180",
717
+ "size-3.5! shrink-0 text-agg-foreground group-hover/agg-settlement-difference:text-agg-muted-foreground transition-[colors,transform]"
718
+ ),
719
+ style: { fontSize: 14 },
626
720
  "aria-hidden": "true"
627
721
  }
628
722
  )
@@ -651,80 +745,12 @@ var Settlement = ({
651
745
  },
652
746
  difference.canonicalKey
653
747
  );
654
- }) }),
655
- venueRuleBlocks.length > 0 ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
656
- /* @__PURE__ */ jsx2("div", { className: "h-px w-full bg-agg-separator" }),
657
- /* @__PURE__ */ jsx2("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: "Full rules by venue" }),
658
- /* @__PURE__ */ jsx2("div", { className: "flex w-full flex-col items-start gap-4", children: venueRuleBlocks.map((rule) => {
659
- const venueLabel = resolveSettlementVenueLabel(rule.venue, labels);
660
- return /* @__PURE__ */ jsxs2("details", { className: "group/agg-settlement-rule w-full", children: [
661
- /* @__PURE__ */ jsxs2("summary", { className: "flex cursor-pointer list-none items-center gap-2 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground marker:hidden", children: [
662
- /* @__PURE__ */ jsx2(
663
- VenueLogo,
664
- {
665
- venue: rule.venue,
666
- size: "small",
667
- className: "size-4",
668
- ariaLabel: venueLabel
669
- }
670
- ),
671
- /* @__PURE__ */ jsx2("span", { children: venueLabel }),
672
- /* @__PURE__ */ jsx2(
673
- Icon,
674
- {
675
- name: "chevron-down",
676
- className: "size-4! shrink-0 text-agg-foreground transition-transform group-open/agg-settlement-rule:rotate-180",
677
- "aria-hidden": "true"
678
- }
679
- )
680
- ] }),
681
- /* @__PURE__ */ jsx2("div", { className: "mt-3 pl-6", children: /* @__PURE__ */ jsx2(SettlementTextRenderer, { content: rule.content }) })
682
- ] }, rule.venue);
683
- }) })
684
- ] }) : null
685
- ] })
686
- ]
687
- }
688
- );
689
- }
690
- return /* @__PURE__ */ jsxs2(
691
- Card,
692
- {
693
- id,
694
- className: cn(
695
- "group/agg-settlement-card",
696
- "flex flex-col w-full gap-5 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5 shadow-none hover:shadow-none",
697
- className
698
- ),
699
- children: [
700
- /* @__PURE__ */ jsxs2("div", { className: cn("agg-settlement-header", getSettlementHeaderClassName()), children: [
701
- /* @__PURE__ */ jsx2("p", { className: "text-agg-xs font-agg-bold leading-agg-4 uppercase text-agg-muted-foreground", children: resolvedSectionLabel }),
702
- question ? /* @__PURE__ */ jsx2("p", { className: "agg-settlement-question text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: question }) : null
703
- ] }),
704
- blocks.length === 0 && settlementDifferences.length === 0 ? /* @__PURE__ */ jsx2("p", { className: "agg-settlement-empty text-agg-sm leading-agg-5 text-agg-muted-foreground", children: labels.trading.settlementEmpty }) : /* @__PURE__ */ jsxs2("div", { className: "agg-settlement-sections flex flex-col gap-4", children: [
705
- eventBlock || marketBlock ? /* @__PURE__ */ jsxs2(
706
- "div",
707
- {
708
- className: "agg-settlement-section agg-settlement-section-description",
709
- "data-source": "description",
710
- children: [
711
- eventBlock ? /* @__PURE__ */ jsx2("div", { "data-source": "eventDescription", children: /* @__PURE__ */ jsx2(SettlementTextRenderer, { content: eventBlock.content }) }) : null,
712
- eventBlock && marketBlock ? /* @__PURE__ */ jsx2("hr", { className: "agg-settlement-divider my-4 border-0 border-t border-agg-separator" }) : null,
713
- marketBlock ? /* @__PURE__ */ jsx2("div", { "data-source": "marketDescription", children: /* @__PURE__ */ jsx2(SettlementTextRenderer, { content: marketBlock.content }) }) : null
714
- ]
715
- }
716
- ) : null,
717
- primaryRulesBlock ? /* @__PURE__ */ jsxs2(
718
- "div",
719
- {
720
- className: "agg-settlement-section agg-settlement-section-primaryRules",
721
- "data-source": "primaryRules",
722
- children: [
723
- /* @__PURE__ */ jsx2("p", { className: "agg-settlement-section-label text-agg-xs font-agg-bold leading-agg-4 uppercase text-agg-muted-foreground mb-2", children: labels.trading.settlementPrimaryRulesLabel }),
724
- /* @__PURE__ */ jsx2(SettlementTextRenderer, { content: primaryRulesBlock.content })
725
- ]
726
- }
727
- ) : null
748
+ }) })
749
+ ] }) : null,
750
+ hasVenueSettlementRules ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
751
+ hasSettlementDifferences || hasStandaloneSettlementText ? /* @__PURE__ */ jsx2("div", { className: "h-px w-full bg-agg-separator" }) : null,
752
+ /* @__PURE__ */ jsx2(SettlementVenueRules, { rules: venueRuleBlocks, labels })
753
+ ] }) : null
728
754
  ] })
729
755
  ]
730
756
  }
@@ -1599,7 +1625,6 @@ export {
1599
1625
  getTradingBalanceLabel,
1600
1626
  getTradingSharesLabel,
1601
1627
  getTradingSlippageLabel,
1602
- getFirstSettlementParagraph,
1603
1628
  SETTLEMENT_SECTION_ID,
1604
1629
  getSettlementDifferenceId,
1605
1630
  prepareSettlementDifferences,