@agg-build/ui 2.8.0 → 4.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-AKLGQ6AB.mjs → chunk-JTSLZARU.mjs} +50 -250
- package/dist/{chunk-2QCNDFNC.mjs → chunk-R362GNI2.mjs} +1120 -400
- package/dist/{chunk-R5S2QOYL.mjs → chunk-XIDQ2A6W.mjs} +152 -59
- package/dist/index.js +1764 -1155
- package/dist/index.mjs +5 -3
- package/dist/modals.js +391 -845
- package/dist/modals.mjs +1 -1
- package/dist/pages.js +1724 -916
- package/dist/pages.mjs +4 -2
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +567 -472
- package/dist/trading.mjs +1 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +5 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +5 -1
- package/dist/types/pages/user-profile/components/manage-balances-modal.d.mts +8 -0
- package/dist/types/pages/user-profile/components/manage-balances-modal.d.ts +8 -0
- package/dist/types/pages/user-profile/index.d.mts +1 -0
- package/dist/types/pages/user-profile/index.d.ts +1 -0
- package/dist/types/profile/profile-modal.constants.d.mts +1 -2
- package/dist/types/profile/profile-modal.constants.d.ts +1 -2
- package/dist/types/trading/place-order/index.place-order.constants.d.mts +1 -0
- package/dist/types/trading/place-order/index.place-order.constants.d.ts +1 -0
- package/dist/types/trading/place-order/index.place-order.types.d.mts +4 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +4 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +7 -3
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +7 -3
- package/package.json +3 -3
- package/dist/types/profile/tabs/balance-management-tab.d.mts +0 -3
- package/dist/types/profile/tabs/balance-management-tab.d.ts +0 -3
package/dist/trading.js
CHANGED
|
@@ -5491,13 +5491,116 @@ var GeoBlockBanner = ({
|
|
|
5491
5491
|
};
|
|
5492
5492
|
GeoBlockBanner.displayName = "GeoBlockBanner";
|
|
5493
5493
|
|
|
5494
|
+
// src/notifications/agg-notification-events-provider.tsx
|
|
5495
|
+
var import_hooks23 = require("@agg-build/hooks");
|
|
5496
|
+
var import_react5 = require("react");
|
|
5497
|
+
|
|
5498
|
+
// src/primitives/toast/index.tsx
|
|
5499
|
+
var RadixToast = __toESM(require("@radix-ui/react-toast"));
|
|
5500
|
+
var import_react4 = require("react");
|
|
5501
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
5502
|
+
var ToastContext = (0, import_react4.createContext)(null);
|
|
5503
|
+
function useOptionalToast() {
|
|
5504
|
+
return (0, import_react4.useContext)(ToastContext);
|
|
5505
|
+
}
|
|
5506
|
+
|
|
5507
|
+
// src/notifications/agg-notification-events-provider.tsx
|
|
5508
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
5509
|
+
var firedOrderNotificationKeys = /* @__PURE__ */ new Set();
|
|
5510
|
+
var MICRO_UNITS_SCALE = 1e6;
|
|
5511
|
+
var formatScaledMicroAmount = (value) => {
|
|
5512
|
+
if (!value) return void 0;
|
|
5513
|
+
if (value.includes(".")) {
|
|
5514
|
+
const parsed = Number(value);
|
|
5515
|
+
if (!Number.isFinite(parsed)) return void 0;
|
|
5516
|
+
return parsed.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
5517
|
+
}
|
|
5518
|
+
try {
|
|
5519
|
+
const raw = BigInt(value);
|
|
5520
|
+
const whole = raw / BigInt(MICRO_UNITS_SCALE);
|
|
5521
|
+
const remainder = raw % BigInt(MICRO_UNITS_SCALE);
|
|
5522
|
+
const parsed = Number(whole) + Number(remainder) / MICRO_UNITS_SCALE;
|
|
5523
|
+
return parsed.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
5524
|
+
} catch (e) {
|
|
5525
|
+
const parsed = Number(value);
|
|
5526
|
+
if (!Number.isFinite(parsed)) return void 0;
|
|
5527
|
+
return (parsed / MICRO_UNITS_SCALE).toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
5528
|
+
}
|
|
5529
|
+
};
|
|
5530
|
+
var formatPriceCents = (value) => {
|
|
5531
|
+
if (!value) return void 0;
|
|
5532
|
+
const parsed = Number(value);
|
|
5533
|
+
if (!Number.isFinite(parsed)) return void 0;
|
|
5534
|
+
const cents = parsed * 100;
|
|
5535
|
+
const display2 = cents.toLocaleString("en-US", {
|
|
5536
|
+
minimumFractionDigits: 0,
|
|
5537
|
+
maximumFractionDigits: 1
|
|
5538
|
+
});
|
|
5539
|
+
return `${display2}\xA2`;
|
|
5540
|
+
};
|
|
5541
|
+
var formatSharesLabel = (raw) => {
|
|
5542
|
+
const formatted = formatScaledMicroAmount(raw);
|
|
5543
|
+
if (!formatted) return void 0;
|
|
5544
|
+
return `${formatted} shares`;
|
|
5545
|
+
};
|
|
5546
|
+
var capitalize = (value) => {
|
|
5547
|
+
if (!value) return void 0;
|
|
5548
|
+
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
5549
|
+
};
|
|
5550
|
+
var venueLabelFor = (venueKey, labels) => {
|
|
5551
|
+
var _a;
|
|
5552
|
+
if (!venueKey) return void 0;
|
|
5553
|
+
const normalized = venueKey.toLowerCase();
|
|
5554
|
+
const lookup = labels.venues;
|
|
5555
|
+
return (_a = lookup[normalized]) != null ? _a : capitalize(venueKey);
|
|
5556
|
+
};
|
|
5557
|
+
function handleOrderEvent({ event, labels, fireOnce }) {
|
|
5558
|
+
var _a, _b;
|
|
5559
|
+
const venueLabel = venueLabelFor(event.venue, labels);
|
|
5560
|
+
const amountLabel = formatSharesLabel((_a = event.actualSharesRaw) != null ? _a : event.filledAmountRaw);
|
|
5561
|
+
const priceLabel = formatPriceCents((_b = event.executionPriceRaw) != null ? _b : event.quotedPriceRaw);
|
|
5562
|
+
const fireOrderOnce = (key, tone, title2, message, detail) => {
|
|
5563
|
+
if (firedOrderNotificationKeys.has(key)) return;
|
|
5564
|
+
firedOrderNotificationKeys.add(key);
|
|
5565
|
+
fireOnce(key, tone, title2, message, detail);
|
|
5566
|
+
};
|
|
5567
|
+
if (event.event === "filled") {
|
|
5568
|
+
fireOrderOnce(
|
|
5569
|
+
`order:${event.orderId}:filled`,
|
|
5570
|
+
"success",
|
|
5571
|
+
labels.notifications.order.filledTitle,
|
|
5572
|
+
labels.notifications.order.filledMessage({ venueLabel, amountLabel, priceLabel })
|
|
5573
|
+
);
|
|
5574
|
+
return;
|
|
5575
|
+
}
|
|
5576
|
+
if (event.event === "partial_fill") {
|
|
5577
|
+
fireOrderOnce(
|
|
5578
|
+
`order:${event.orderId}:partial_fill`,
|
|
5579
|
+
"warning",
|
|
5580
|
+
labels.notifications.order.partialFilledTitle,
|
|
5581
|
+
labels.notifications.order.partialFilledMessage({ venueLabel, amountLabel, priceLabel })
|
|
5582
|
+
);
|
|
5583
|
+
return;
|
|
5584
|
+
}
|
|
5585
|
+
if (event.event === "failed") {
|
|
5586
|
+
fireOrderOnce(
|
|
5587
|
+
`order:${event.orderId}:failed`,
|
|
5588
|
+
"error",
|
|
5589
|
+
labels.notifications.order.failedTitle,
|
|
5590
|
+
labels.notifications.order.failedMessage(event.errorReason),
|
|
5591
|
+
venueLabel
|
|
5592
|
+
);
|
|
5593
|
+
}
|
|
5594
|
+
}
|
|
5595
|
+
var CLIENT_DEPOSIT_ACTIVITY_SUPPRESSION_MS = 2 * 60 * 1e3;
|
|
5596
|
+
|
|
5494
5597
|
// src/onboarding/index.tsx
|
|
5495
|
-
var
|
|
5496
|
-
var
|
|
5598
|
+
var import_react13 = require("react");
|
|
5599
|
+
var import_hooks35 = require("@agg-build/hooks");
|
|
5497
5600
|
var Dialog4 = __toESM(require("@radix-ui/react-dialog"));
|
|
5498
5601
|
|
|
5499
5602
|
// src/primitives/modal/index.tsx
|
|
5500
|
-
var
|
|
5603
|
+
var import_hooks24 = require("@agg-build/hooks");
|
|
5501
5604
|
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
5502
5605
|
|
|
5503
5606
|
// src/primitives/modal/modal.constants.ts
|
|
@@ -5521,7 +5624,7 @@ var resolveModalCloseIcon = ({
|
|
|
5521
5624
|
};
|
|
5522
5625
|
|
|
5523
5626
|
// src/primitives/modal/index.tsx
|
|
5524
|
-
var
|
|
5627
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
5525
5628
|
var Modal = ({
|
|
5526
5629
|
open,
|
|
5527
5630
|
onOpenChange,
|
|
@@ -5529,7 +5632,7 @@ var Modal = ({
|
|
|
5529
5632
|
"aria-label": _ariaLabel,
|
|
5530
5633
|
"aria-labelledby": _ariaLabelledBy
|
|
5531
5634
|
}) => {
|
|
5532
|
-
return /* @__PURE__ */ (0,
|
|
5635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Dialog.Root, { open, onOpenChange, children });
|
|
5533
5636
|
};
|
|
5534
5637
|
var ModalContainer = ({
|
|
5535
5638
|
children,
|
|
@@ -5541,11 +5644,11 @@ var ModalContainer = ({
|
|
|
5541
5644
|
const {
|
|
5542
5645
|
general: { rootClassName },
|
|
5543
5646
|
features: { enableAnimations }
|
|
5544
|
-
} = (0,
|
|
5647
|
+
} = (0, import_hooks24.useSdkUiConfig)();
|
|
5545
5648
|
const overlayAnimationClassName = resolveModalOverlayAnimationClassName(enableAnimations);
|
|
5546
5649
|
const panelAnimationClassName = resolveModalPanelAnimationClassName(enableAnimations);
|
|
5547
|
-
return /* @__PURE__ */ (0,
|
|
5548
|
-
/* @__PURE__ */ (0,
|
|
5650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(Dialog.Portal, { children: [
|
|
5651
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
5549
5652
|
Dialog.Overlay,
|
|
5550
5653
|
{
|
|
5551
5654
|
className: cn(
|
|
@@ -5556,7 +5659,7 @@ var ModalContainer = ({
|
|
|
5556
5659
|
)
|
|
5557
5660
|
}
|
|
5558
5661
|
),
|
|
5559
|
-
/* @__PURE__ */ (0,
|
|
5662
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
5560
5663
|
Dialog.Content,
|
|
5561
5664
|
{
|
|
5562
5665
|
className: cn(
|
|
@@ -5582,7 +5685,7 @@ var ModalContainer = ({
|
|
|
5582
5685
|
event.preventDefault();
|
|
5583
5686
|
}
|
|
5584
5687
|
},
|
|
5585
|
-
children: /* @__PURE__ */ (0,
|
|
5688
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
5586
5689
|
"div",
|
|
5587
5690
|
{
|
|
5588
5691
|
className: cn(
|
|
@@ -5590,7 +5693,7 @@ var ModalContainer = ({
|
|
|
5590
5693
|
"items-end md:items-center",
|
|
5591
5694
|
"flex h-full min-h-0 w-full justify-center p-0 md:p-5"
|
|
5592
5695
|
),
|
|
5593
|
-
children: /* @__PURE__ */ (0,
|
|
5696
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
5594
5697
|
"div",
|
|
5595
5698
|
{
|
|
5596
5699
|
className: cn(
|
|
@@ -5630,14 +5733,14 @@ var ModalHeader = ({
|
|
|
5630
5733
|
}) => {
|
|
5631
5734
|
const {
|
|
5632
5735
|
features: { enableAnimations }
|
|
5633
|
-
} = (0,
|
|
5634
|
-
const labels = (0,
|
|
5635
|
-
const defaultCloseIcon = /* @__PURE__ */ (0,
|
|
5736
|
+
} = (0, import_hooks24.useSdkUiConfig)();
|
|
5737
|
+
const labels = (0, import_hooks24.useLabels)();
|
|
5738
|
+
const defaultCloseIcon = /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(CloseIcon, { className: "h-6 w-6" });
|
|
5636
5739
|
const resolvedCloseIcon = resolveModalCloseIcon({
|
|
5637
5740
|
closeIcon,
|
|
5638
5741
|
defaultCloseIcon
|
|
5639
5742
|
});
|
|
5640
|
-
return /* @__PURE__ */ (0,
|
|
5743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
5641
5744
|
"div",
|
|
5642
5745
|
{
|
|
5643
5746
|
className: cn(
|
|
@@ -5650,7 +5753,7 @@ var ModalHeader = ({
|
|
|
5650
5753
|
classNames == null ? void 0 : classNames.root
|
|
5651
5754
|
),
|
|
5652
5755
|
children: [
|
|
5653
|
-
/* @__PURE__ */ (0,
|
|
5756
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
5654
5757
|
"div",
|
|
5655
5758
|
{
|
|
5656
5759
|
className: cn(
|
|
@@ -5663,8 +5766,8 @@ var ModalHeader = ({
|
|
|
5663
5766
|
classNames == null ? void 0 : classNames.container
|
|
5664
5767
|
),
|
|
5665
5768
|
children: [
|
|
5666
|
-
leftElement ? /* @__PURE__ */ (0,
|
|
5667
|
-
/* @__PURE__ */ (0,
|
|
5769
|
+
leftElement ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_jsx_runtime117.Fragment, { children: leftElement }) : null,
|
|
5770
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
5668
5771
|
"div",
|
|
5669
5772
|
{
|
|
5670
5773
|
className: cn(
|
|
@@ -5673,7 +5776,7 @@ var ModalHeader = ({
|
|
|
5673
5776
|
classNames == null ? void 0 : classNames.titleContainer
|
|
5674
5777
|
),
|
|
5675
5778
|
children: [
|
|
5676
|
-
/* @__PURE__ */ (0,
|
|
5779
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
5677
5780
|
Dialog.Title,
|
|
5678
5781
|
{
|
|
5679
5782
|
className: cn(
|
|
@@ -5687,7 +5790,7 @@ var ModalHeader = ({
|
|
|
5687
5790
|
children: title2
|
|
5688
5791
|
}
|
|
5689
5792
|
),
|
|
5690
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
5793
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
5691
5794
|
"span",
|
|
5692
5795
|
{
|
|
5693
5796
|
className: cn(
|
|
@@ -5701,9 +5804,9 @@ var ModalHeader = ({
|
|
|
5701
5804
|
]
|
|
5702
5805
|
}
|
|
5703
5806
|
),
|
|
5704
|
-
/* @__PURE__ */ (0,
|
|
5705
|
-
rightElement ? /* @__PURE__ */ (0,
|
|
5706
|
-
!hideClose && /* @__PURE__ */ (0,
|
|
5807
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "agg-modal-header-actions flex flex-row items-center justify-end gap-6", children: [
|
|
5808
|
+
rightElement ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_jsx_runtime117.Fragment, { children: rightElement }) : null,
|
|
5809
|
+
!hideClose && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
5707
5810
|
Dialog.Close,
|
|
5708
5811
|
{
|
|
5709
5812
|
className: cn(
|
|
@@ -5720,14 +5823,14 @@ var ModalHeader = ({
|
|
|
5720
5823
|
]
|
|
5721
5824
|
}
|
|
5722
5825
|
),
|
|
5723
|
-
children ? /* @__PURE__ */ (0,
|
|
5826
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "agg-modal-header-extra", children }) : null
|
|
5724
5827
|
]
|
|
5725
5828
|
}
|
|
5726
5829
|
);
|
|
5727
5830
|
};
|
|
5728
5831
|
Modal.Header = ModalHeader;
|
|
5729
5832
|
var ModalBody = ({ children, classNames }) => {
|
|
5730
|
-
return /* @__PURE__ */ (0,
|
|
5833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
5731
5834
|
"div",
|
|
5732
5835
|
{
|
|
5733
5836
|
className: cn(
|
|
@@ -5748,7 +5851,7 @@ var ModalFooter = ({
|
|
|
5748
5851
|
classNames,
|
|
5749
5852
|
hideBorder = false
|
|
5750
5853
|
}) => {
|
|
5751
|
-
return /* @__PURE__ */ (0,
|
|
5854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
5752
5855
|
"div",
|
|
5753
5856
|
{
|
|
5754
5857
|
className: cn(
|
|
@@ -5788,11 +5891,11 @@ var ONCHAIN_VENUES = [
|
|
|
5788
5891
|
].filter(import_sdk13.isVenueActive);
|
|
5789
5892
|
|
|
5790
5893
|
// src/onboarding/steps/how-it-works.tsx
|
|
5791
|
-
var
|
|
5792
|
-
var
|
|
5894
|
+
var import_react6 = require("react");
|
|
5895
|
+
var import_hooks26 = require("@agg-build/hooks");
|
|
5793
5896
|
|
|
5794
5897
|
// src/primitives/button/index.tsx
|
|
5795
|
-
var
|
|
5898
|
+
var import_hooks25 = require("@agg-build/hooks");
|
|
5796
5899
|
|
|
5797
5900
|
// src/primitives/button/button.constants.ts
|
|
5798
5901
|
var sizeClasses2 = {
|
|
@@ -5863,7 +5966,7 @@ var getButtonClassName = ({
|
|
|
5863
5966
|
};
|
|
5864
5967
|
|
|
5865
5968
|
// src/primitives/button/index.tsx
|
|
5866
|
-
var
|
|
5969
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
5867
5970
|
var Button = (_a) => {
|
|
5868
5971
|
var _b = _a, {
|
|
5869
5972
|
children,
|
|
@@ -5892,9 +5995,9 @@ var Button = (_a) => {
|
|
|
5892
5995
|
]);
|
|
5893
5996
|
const {
|
|
5894
5997
|
features: { enableAnimations }
|
|
5895
|
-
} = (0,
|
|
5998
|
+
} = (0, import_hooks25.useSdkUiConfig)();
|
|
5896
5999
|
const isDisabled = resolveButtonIsDisabled({ disabled, isLoading });
|
|
5897
|
-
return /* @__PURE__ */ (0,
|
|
6000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
5898
6001
|
"button",
|
|
5899
6002
|
__spreadProps(__spreadValues({
|
|
5900
6003
|
type,
|
|
@@ -5908,7 +6011,7 @@ var Button = (_a) => {
|
|
|
5908
6011
|
"aria-busy": isLoading,
|
|
5909
6012
|
"aria-label": ariaLabel
|
|
5910
6013
|
}, other), {
|
|
5911
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
6014
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
5912
6015
|
"span",
|
|
5913
6016
|
{
|
|
5914
6017
|
className: cn(
|
|
@@ -5919,9 +6022,9 @@ var Button = (_a) => {
|
|
|
5919
6022
|
),
|
|
5920
6023
|
"aria-hidden": "true"
|
|
5921
6024
|
}
|
|
5922
|
-
) : /* @__PURE__ */ (0,
|
|
6025
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(import_jsx_runtime118.Fragment, { children: [
|
|
5923
6026
|
prefix != null ? prefix : null,
|
|
5924
|
-
/* @__PURE__ */ (0,
|
|
6027
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
5925
6028
|
"span",
|
|
5926
6029
|
{
|
|
5927
6030
|
className: cn(
|
|
@@ -5940,28 +6043,28 @@ var Button = (_a) => {
|
|
|
5940
6043
|
Button.displayName = "Button";
|
|
5941
6044
|
|
|
5942
6045
|
// src/onboarding/steps/how-it-works.tsx
|
|
5943
|
-
var
|
|
6046
|
+
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
5944
6047
|
var defaultIcons = {
|
|
5945
|
-
createAccount: /* @__PURE__ */ (0,
|
|
5946
|
-
linkAccounts: /* @__PURE__ */ (0,
|
|
5947
|
-
bestPrices: /* @__PURE__ */ (0,
|
|
5948
|
-
stayInControl: /* @__PURE__ */ (0,
|
|
6048
|
+
createAccount: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CreateAccountIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
6049
|
+
linkAccounts: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(LinkAccountsIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
6050
|
+
bestPrices: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(BestPricesIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
6051
|
+
stayInControl: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(StayInControlIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" })
|
|
5949
6052
|
};
|
|
5950
6053
|
var HowItWorksStep = ({ onContinue, icons }) => {
|
|
5951
|
-
const labels = (0,
|
|
5952
|
-
const scrollRef = (0,
|
|
5953
|
-
const [showTopGradient, setShowTopGradient] = (0,
|
|
5954
|
-
const [showBottomGradient, setShowBottomGradient] = (0,
|
|
5955
|
-
const handleScroll = (0,
|
|
6054
|
+
const labels = (0, import_hooks26.useLabels)();
|
|
6055
|
+
const scrollRef = (0, import_react6.useRef)(null);
|
|
6056
|
+
const [showTopGradient, setShowTopGradient] = (0, import_react6.useState)(false);
|
|
6057
|
+
const [showBottomGradient, setShowBottomGradient] = (0, import_react6.useState)(true);
|
|
6058
|
+
const handleScroll = (0, import_react6.useCallback)(() => {
|
|
5956
6059
|
const el = scrollRef.current;
|
|
5957
6060
|
if (!el) return;
|
|
5958
6061
|
setShowTopGradient(el.scrollTop > 0);
|
|
5959
6062
|
setShowBottomGradient(el.scrollTop + el.clientHeight < el.scrollHeight - 1);
|
|
5960
6063
|
}, []);
|
|
5961
|
-
return /* @__PURE__ */ (0,
|
|
5962
|
-
/* @__PURE__ */ (0,
|
|
5963
|
-
/* @__PURE__ */ (0,
|
|
5964
|
-
/* @__PURE__ */ (0,
|
|
6064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex flex-col gap-6 h-[600px] sm:h-auto", children: [
|
|
6065
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.howItWorks.title }),
|
|
6066
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "relative flex-1 min-h-0 sm:flex-initial", children: [
|
|
6067
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
5965
6068
|
"div",
|
|
5966
6069
|
{
|
|
5967
6070
|
ref: scrollRef,
|
|
@@ -5971,7 +6074,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
5971
6074
|
var _a;
|
|
5972
6075
|
const icon = (_a = icons == null ? void 0 : icons[featureKey]) != null ? _a : defaultIcons[featureKey];
|
|
5973
6076
|
const feature = labels.onboarding.howItWorks.features[featureKey];
|
|
5974
|
-
return /* @__PURE__ */ (0,
|
|
6077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
5975
6078
|
"div",
|
|
5976
6079
|
{
|
|
5977
6080
|
className: cn(
|
|
@@ -5980,11 +6083,11 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
5980
6083
|
"bg-agg-secondary-hover"
|
|
5981
6084
|
),
|
|
5982
6085
|
children: [
|
|
5983
|
-
/* @__PURE__ */ (0,
|
|
5984
|
-
/* @__PURE__ */ (0,
|
|
5985
|
-
/* @__PURE__ */ (0,
|
|
6086
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex flex-col flex-1 min-w-0 gap-[6px]", children: [
|
|
6087
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: feature.title }),
|
|
6088
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: feature.description })
|
|
5986
6089
|
] }),
|
|
5987
|
-
icon ? /* @__PURE__ */ (0,
|
|
6090
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "hidden shrink-0 items-center justify-center text-agg-muted-foreground sm:flex", children: icon }) : null
|
|
5988
6091
|
]
|
|
5989
6092
|
},
|
|
5990
6093
|
featureKey
|
|
@@ -5992,7 +6095,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
5992
6095
|
})
|
|
5993
6096
|
}
|
|
5994
6097
|
),
|
|
5995
|
-
/* @__PURE__ */ (0,
|
|
6098
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
5996
6099
|
"div",
|
|
5997
6100
|
{
|
|
5998
6101
|
className: cn(
|
|
@@ -6003,7 +6106,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
6003
6106
|
)
|
|
6004
6107
|
}
|
|
6005
6108
|
),
|
|
6006
|
-
/* @__PURE__ */ (0,
|
|
6109
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6007
6110
|
"div",
|
|
6008
6111
|
{
|
|
6009
6112
|
className: cn(
|
|
@@ -6015,21 +6118,21 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
6015
6118
|
}
|
|
6016
6119
|
)
|
|
6017
6120
|
] }),
|
|
6018
|
-
/* @__PURE__ */ (0,
|
|
6121
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Button, { variant: "primary", size: "large", className: "w-full", onClick: onContinue, children: labels.onboarding.howItWorks.continue })
|
|
6019
6122
|
] });
|
|
6020
6123
|
};
|
|
6021
6124
|
HowItWorksStep.displayName = "HowItWorksStep";
|
|
6022
6125
|
|
|
6023
6126
|
// src/onboarding/steps/profile-setup.tsx
|
|
6024
|
-
var
|
|
6025
|
-
var
|
|
6127
|
+
var import_react10 = require("react");
|
|
6128
|
+
var import_hooks31 = require("@agg-build/hooks");
|
|
6026
6129
|
|
|
6027
6130
|
// src/primitives/calendar/index.tsx
|
|
6028
6131
|
var import_react_day_picker = require("react-day-picker");
|
|
6029
|
-
var
|
|
6132
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
6030
6133
|
var Calendar = (_a) => {
|
|
6031
6134
|
var _b = _a, { className, classNames } = _b, props = __objRest(_b, ["className", "classNames"]);
|
|
6032
|
-
return /* @__PURE__ */ (0,
|
|
6135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
6033
6136
|
import_react_day_picker.DayPicker,
|
|
6034
6137
|
__spreadValues({
|
|
6035
6138
|
showOutsideDays: false,
|
|
@@ -6063,8 +6166,8 @@ var Calendar = (_a) => {
|
|
|
6063
6166
|
Calendar.displayName = "Calendar";
|
|
6064
6167
|
|
|
6065
6168
|
// src/primitives/currency-input/index.tsx
|
|
6066
|
-
var
|
|
6067
|
-
var
|
|
6169
|
+
var import_hooks27 = require("@agg-build/hooks");
|
|
6170
|
+
var import_react7 = require("react");
|
|
6068
6171
|
|
|
6069
6172
|
// src/primitives/currency-input/currency-input.constants.ts
|
|
6070
6173
|
var CURRENCY_INPUT_DEFAULT_PREFIX = "$";
|
|
@@ -6155,7 +6258,7 @@ var sanitizeCurrencyInputPastedValue = (input, parts, decimalPlaces) => {
|
|
|
6155
6258
|
};
|
|
6156
6259
|
|
|
6157
6260
|
// src/primitives/currency-input/index.tsx
|
|
6158
|
-
var
|
|
6261
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
6159
6262
|
var CurrencyInput = ({
|
|
6160
6263
|
value,
|
|
6161
6264
|
onChange,
|
|
@@ -6173,20 +6276,20 @@ var CurrencyInput = ({
|
|
|
6173
6276
|
}) => {
|
|
6174
6277
|
const {
|
|
6175
6278
|
general: { locale }
|
|
6176
|
-
} = (0,
|
|
6177
|
-
const parts = (0,
|
|
6178
|
-
const [raw, setRaw] = (0,
|
|
6179
|
-
const isEditingRef = (0,
|
|
6180
|
-
const inputRef = (0,
|
|
6181
|
-
const caretPosRef = (0,
|
|
6182
|
-
(0,
|
|
6279
|
+
} = (0, import_hooks27.useSdkUiConfig)();
|
|
6280
|
+
const parts = (0, import_react7.useMemo)(() => resolveCurrencyInputFormatParts(locale), [locale]);
|
|
6281
|
+
const [raw, setRaw] = (0, import_react7.useState)(() => value >= 0 ? String(value) : "");
|
|
6282
|
+
const isEditingRef = (0, import_react7.useRef)(false);
|
|
6283
|
+
const inputRef = (0, import_react7.useRef)(null);
|
|
6284
|
+
const caretPosRef = (0, import_react7.useRef)(null);
|
|
6285
|
+
(0, import_react7.useEffect)(() => {
|
|
6183
6286
|
if (!isEditingRef.current) {
|
|
6184
6287
|
setRaw(value >= 0 ? String(value) : "");
|
|
6185
6288
|
}
|
|
6186
6289
|
}, [value]);
|
|
6187
6290
|
const numericDisplay = formatCurrencyInputRawValue(raw, locale, decimalPlaces, parts);
|
|
6188
6291
|
const displayValue = prefix + numericDisplay;
|
|
6189
|
-
(0,
|
|
6292
|
+
(0, import_react7.useLayoutEffect)(() => {
|
|
6190
6293
|
if (caretPosRef.current !== null && inputRef.current) {
|
|
6191
6294
|
inputRef.current.setSelectionRange(caretPosRef.current, caretPosRef.current);
|
|
6192
6295
|
caretPosRef.current = null;
|
|
@@ -6288,7 +6391,7 @@ var CurrencyInput = ({
|
|
|
6288
6391
|
onChange == null ? void 0 : onChange(nextValue);
|
|
6289
6392
|
onBlur == null ? void 0 : onBlur();
|
|
6290
6393
|
};
|
|
6291
|
-
return /* @__PURE__ */ (0,
|
|
6394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
6292
6395
|
"input",
|
|
6293
6396
|
{
|
|
6294
6397
|
ref: inputRef,
|
|
@@ -6362,7 +6465,7 @@ var resolveInlineAlertHasAction = ({
|
|
|
6362
6465
|
};
|
|
6363
6466
|
|
|
6364
6467
|
// src/primitives/inline-alert/index.tsx
|
|
6365
|
-
var
|
|
6468
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
6366
6469
|
var InlineAlert = ({
|
|
6367
6470
|
tone = INLINE_ALERT_DEFAULT_TONE,
|
|
6368
6471
|
variant,
|
|
@@ -6376,7 +6479,7 @@ var InlineAlert = ({
|
|
|
6376
6479
|
const resolvedVariant = resolveInlineAlertVariant({ tone, variant });
|
|
6377
6480
|
const hasAction = resolveInlineAlertHasAction({ actionLabel, onAction });
|
|
6378
6481
|
const { ariaLive, role } = INLINE_ALERT_LIVE_REGION_CONFIG[tone];
|
|
6379
|
-
return /* @__PURE__ */ (0,
|
|
6482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
6380
6483
|
"div",
|
|
6381
6484
|
{
|
|
6382
6485
|
className: cn(
|
|
@@ -6388,7 +6491,7 @@ var InlineAlert = ({
|
|
|
6388
6491
|
"aria-live": ariaLive,
|
|
6389
6492
|
"aria-label": ariaLabel,
|
|
6390
6493
|
children: [
|
|
6391
|
-
/* @__PURE__ */ (0,
|
|
6494
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
6392
6495
|
Icon,
|
|
6393
6496
|
{
|
|
6394
6497
|
name: INLINE_ALERT_TONE_ICON_NAME[tone],
|
|
@@ -6396,14 +6499,14 @@ var InlineAlert = ({
|
|
|
6396
6499
|
"aria-hidden": "true"
|
|
6397
6500
|
}
|
|
6398
6501
|
),
|
|
6399
|
-
/* @__PURE__ */ (0,
|
|
6502
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
6400
6503
|
"div",
|
|
6401
6504
|
{
|
|
6402
6505
|
className: cn(
|
|
6403
6506
|
"min-w-0",
|
|
6404
6507
|
resolvedVariant === "plain" && !hasAction ? "flex-none text-center" : "flex-1"
|
|
6405
6508
|
),
|
|
6406
|
-
children: /* @__PURE__ */ (0,
|
|
6509
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
6407
6510
|
"div",
|
|
6408
6511
|
{
|
|
6409
6512
|
className: cn(
|
|
@@ -6412,14 +6515,14 @@ var InlineAlert = ({
|
|
|
6412
6515
|
resolvedVariant === "plain" && !hasAction ? "items-center" : null
|
|
6413
6516
|
),
|
|
6414
6517
|
children: [
|
|
6415
|
-
title2 ? /* @__PURE__ */ (0,
|
|
6416
|
-
/* @__PURE__ */ (0,
|
|
6518
|
+
title2 ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: title2 }) : null,
|
|
6519
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground wrap-break-word", children: message })
|
|
6417
6520
|
]
|
|
6418
6521
|
}
|
|
6419
6522
|
)
|
|
6420
6523
|
}
|
|
6421
6524
|
),
|
|
6422
|
-
hasAction ? /* @__PURE__ */ (0,
|
|
6525
|
+
hasAction ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
6423
6526
|
"button",
|
|
6424
6527
|
{
|
|
6425
6528
|
type: "button",
|
|
@@ -6439,7 +6542,7 @@ var InlineAlert = ({
|
|
|
6439
6542
|
InlineAlert.displayName = "InlineAlert";
|
|
6440
6543
|
|
|
6441
6544
|
// src/primitives/loading-icon/index.tsx
|
|
6442
|
-
var
|
|
6545
|
+
var import_hooks28 = require("@agg-build/hooks");
|
|
6443
6546
|
|
|
6444
6547
|
// src/primitives/loading-icon/loading-icon.constants.ts
|
|
6445
6548
|
var LOADING_ICON_DEFAULT_SIZE = "medium";
|
|
@@ -6457,18 +6560,18 @@ var resolveLoadingIconAriaLabel = ({
|
|
|
6457
6560
|
};
|
|
6458
6561
|
|
|
6459
6562
|
// src/primitives/loading-icon/index.tsx
|
|
6460
|
-
var
|
|
6563
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
6461
6564
|
var LoadingIcon = ({
|
|
6462
6565
|
size = LOADING_ICON_DEFAULT_SIZE,
|
|
6463
6566
|
variant = "default",
|
|
6464
6567
|
className,
|
|
6465
6568
|
ariaLabel
|
|
6466
6569
|
}) => {
|
|
6467
|
-
const labels = (0,
|
|
6570
|
+
const labels = (0, import_hooks28.useLabels)();
|
|
6468
6571
|
const {
|
|
6469
6572
|
features: { enableAnimations }
|
|
6470
|
-
} = (0,
|
|
6471
|
-
return /* @__PURE__ */ (0,
|
|
6573
|
+
} = (0, import_hooks28.useSdkUiConfig)();
|
|
6574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
6472
6575
|
"span",
|
|
6473
6576
|
{
|
|
6474
6577
|
role: "status",
|
|
@@ -6481,7 +6584,7 @@ var LoadingIcon = ({
|
|
|
6481
6584
|
"inline-grid place-items-center text-agg-primary will-change-transform",
|
|
6482
6585
|
className
|
|
6483
6586
|
),
|
|
6484
|
-
children: /* @__PURE__ */ (0,
|
|
6587
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "inline-grid place-items-center", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
6485
6588
|
"svg",
|
|
6486
6589
|
{
|
|
6487
6590
|
viewBox: LOADING_ICON_SVG_VIEW_BOX,
|
|
@@ -6489,8 +6592,8 @@ var LoadingIcon = ({
|
|
|
6489
6592
|
"block",
|
|
6490
6593
|
variant === "prominent" ? LOADING_ICON_PROMINENT_FRAME_CLASS : iconSizeClasses[size]
|
|
6491
6594
|
),
|
|
6492
|
-
children: variant === "prominent" ? /* @__PURE__ */ (0,
|
|
6493
|
-
enableAnimations ? /* @__PURE__ */ (0,
|
|
6595
|
+
children: variant === "prominent" ? /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("g", { children: [
|
|
6596
|
+
enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
6494
6597
|
"animateTransform",
|
|
6495
6598
|
{
|
|
6496
6599
|
attributeName: "transform",
|
|
@@ -6502,7 +6605,7 @@ var LoadingIcon = ({
|
|
|
6502
6605
|
repeatCount: "indefinite"
|
|
6503
6606
|
}
|
|
6504
6607
|
) : null,
|
|
6505
|
-
/* @__PURE__ */ (0,
|
|
6608
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
6506
6609
|
"circle",
|
|
6507
6610
|
{
|
|
6508
6611
|
cx: "22",
|
|
@@ -6516,8 +6619,8 @@ var LoadingIcon = ({
|
|
|
6516
6619
|
strokeDasharray: LOADING_ICON_PROMINENT_DASHARRAY
|
|
6517
6620
|
}
|
|
6518
6621
|
)
|
|
6519
|
-
] }) : /* @__PURE__ */ (0,
|
|
6520
|
-
enableAnimations ? /* @__PURE__ */ (0,
|
|
6622
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("g", { children: [
|
|
6623
|
+
enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
6521
6624
|
"animateTransform",
|
|
6522
6625
|
{
|
|
6523
6626
|
attributeName: "transform",
|
|
@@ -6529,7 +6632,7 @@ var LoadingIcon = ({
|
|
|
6529
6632
|
repeatCount: "indefinite"
|
|
6530
6633
|
}
|
|
6531
6634
|
) : null,
|
|
6532
|
-
/* @__PURE__ */ (0,
|
|
6635
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
6533
6636
|
"circle",
|
|
6534
6637
|
{
|
|
6535
6638
|
cx: "22",
|
|
@@ -6541,8 +6644,8 @@ var LoadingIcon = ({
|
|
|
6541
6644
|
strokeLinecap: "round",
|
|
6542
6645
|
strokeDasharray: "60 100",
|
|
6543
6646
|
strokeDashoffset: "0",
|
|
6544
|
-
children: enableAnimations ? /* @__PURE__ */ (0,
|
|
6545
|
-
/* @__PURE__ */ (0,
|
|
6647
|
+
children: enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_jsx_runtime123.Fragment, { children: [
|
|
6648
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
6546
6649
|
"animate",
|
|
6547
6650
|
{
|
|
6548
6651
|
attributeName: "stroke-dasharray",
|
|
@@ -6551,7 +6654,7 @@ var LoadingIcon = ({
|
|
|
6551
6654
|
repeatCount: "indefinite"
|
|
6552
6655
|
}
|
|
6553
6656
|
),
|
|
6554
|
-
/* @__PURE__ */ (0,
|
|
6657
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
6555
6658
|
"animate",
|
|
6556
6659
|
{
|
|
6557
6660
|
attributeName: "stroke-dashoffset",
|
|
@@ -6572,8 +6675,8 @@ var LoadingIcon = ({
|
|
|
6572
6675
|
LoadingIcon.displayName = "LoadingIcon";
|
|
6573
6676
|
|
|
6574
6677
|
// src/primitives/select/index.tsx
|
|
6575
|
-
var
|
|
6576
|
-
var
|
|
6678
|
+
var import_hooks29 = require("@agg-build/hooks");
|
|
6679
|
+
var import_react8 = require("react");
|
|
6577
6680
|
var import_react_dom = require("react-dom");
|
|
6578
6681
|
|
|
6579
6682
|
// src/primitives/select/select.constants.ts
|
|
@@ -6594,7 +6697,7 @@ var resolveIsSelectDisabled = ({
|
|
|
6594
6697
|
};
|
|
6595
6698
|
|
|
6596
6699
|
// src/primitives/select/index.tsx
|
|
6597
|
-
var
|
|
6700
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
6598
6701
|
var SELECT_DROPDOWN_Z = 1e4;
|
|
6599
6702
|
function resolveSelectPortalContainer(triggerRoot) {
|
|
6600
6703
|
var _a, _b;
|
|
@@ -6617,24 +6720,24 @@ var Select = ({
|
|
|
6617
6720
|
contentSideOffset = 8
|
|
6618
6721
|
}) => {
|
|
6619
6722
|
var _a;
|
|
6620
|
-
const labels = (0,
|
|
6723
|
+
const labels = (0, import_hooks29.useLabels)();
|
|
6621
6724
|
const {
|
|
6622
6725
|
general: { rootClassName },
|
|
6623
6726
|
features: { enableAnimations }
|
|
6624
|
-
} = (0,
|
|
6727
|
+
} = (0, import_hooks29.useSdkUiConfig)();
|
|
6625
6728
|
const isDisabled = resolveIsSelectDisabled({ disabled, items });
|
|
6626
6729
|
const selectedItem = resolveSelectedItem(items, value);
|
|
6627
|
-
const [isOpen, setIsOpen] = (0,
|
|
6628
|
-
const [menuRect, setMenuRect] = (0,
|
|
6629
|
-
const containerRef = (0,
|
|
6630
|
-
const portalRef = (0,
|
|
6631
|
-
const closeTimerRef = (0,
|
|
6632
|
-
const openedByHoverRef = (0,
|
|
6633
|
-
const handleClose = (0,
|
|
6730
|
+
const [isOpen, setIsOpen] = (0, import_react8.useState)(false);
|
|
6731
|
+
const [menuRect, setMenuRect] = (0, import_react8.useState)(null);
|
|
6732
|
+
const containerRef = (0, import_react8.useRef)(null);
|
|
6733
|
+
const portalRef = (0, import_react8.useRef)(null);
|
|
6734
|
+
const closeTimerRef = (0, import_react8.useRef)(null);
|
|
6735
|
+
const openedByHoverRef = (0, import_react8.useRef)(false);
|
|
6736
|
+
const handleClose = (0, import_react8.useCallback)(() => {
|
|
6634
6737
|
setIsOpen(false);
|
|
6635
6738
|
openedByHoverRef.current = false;
|
|
6636
6739
|
}, []);
|
|
6637
|
-
const updateMenuRect = (0,
|
|
6740
|
+
const updateMenuRect = (0, import_react8.useCallback)(() => {
|
|
6638
6741
|
const el = containerRef.current;
|
|
6639
6742
|
if (!el) return;
|
|
6640
6743
|
const r = el.getBoundingClientRect();
|
|
@@ -6645,19 +6748,19 @@ var Select = ({
|
|
|
6645
6748
|
width: r.width
|
|
6646
6749
|
});
|
|
6647
6750
|
}, [contentSideOffset]);
|
|
6648
|
-
(0,
|
|
6751
|
+
(0, import_react8.useEffect)(() => {
|
|
6649
6752
|
return () => {
|
|
6650
6753
|
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
6651
6754
|
};
|
|
6652
6755
|
}, []);
|
|
6653
|
-
(0,
|
|
6756
|
+
(0, import_react8.useLayoutEffect)(() => {
|
|
6654
6757
|
if (!isOpen) {
|
|
6655
6758
|
setMenuRect(null);
|
|
6656
6759
|
return;
|
|
6657
6760
|
}
|
|
6658
6761
|
updateMenuRect();
|
|
6659
6762
|
}, [isOpen, updateMenuRect, value]);
|
|
6660
|
-
(0,
|
|
6763
|
+
(0, import_react8.useEffect)(() => {
|
|
6661
6764
|
if (!isOpen) return;
|
|
6662
6765
|
const handlePointerDown = (event) => {
|
|
6663
6766
|
var _a2, _b;
|
|
@@ -6678,7 +6781,7 @@ var Select = ({
|
|
|
6678
6781
|
document.removeEventListener("scroll", handleReposition, true);
|
|
6679
6782
|
};
|
|
6680
6783
|
}, [isOpen, handleClose, updateMenuRect]);
|
|
6681
|
-
(0,
|
|
6784
|
+
(0, import_react8.useEffect)(() => {
|
|
6682
6785
|
if (!isOpen) return;
|
|
6683
6786
|
const handleKeyDown = (event) => {
|
|
6684
6787
|
if ((event == null ? void 0 : event.key) === "Escape") handleClose();
|
|
@@ -6713,7 +6816,7 @@ var Select = ({
|
|
|
6713
6816
|
};
|
|
6714
6817
|
const isInline = variant === "inline";
|
|
6715
6818
|
const triggerRadiusClass = triggerClassName != null ? triggerClassName : isInline ? "rounded-agg-sm" : "rounded-agg-md";
|
|
6716
|
-
const listbox = menuRect ? /* @__PURE__ */ (0,
|
|
6819
|
+
const listbox = menuRect ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
6717
6820
|
"div",
|
|
6718
6821
|
{
|
|
6719
6822
|
ref: portalRef,
|
|
@@ -6741,7 +6844,7 @@ var Select = ({
|
|
|
6741
6844
|
const isSelected = item.value === value;
|
|
6742
6845
|
const isHidden = item.hidden === true;
|
|
6743
6846
|
if (isHidden) return null;
|
|
6744
|
-
return /* @__PURE__ */ (0,
|
|
6847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
6745
6848
|
"button",
|
|
6746
6849
|
{
|
|
6747
6850
|
type: "button",
|
|
@@ -6765,14 +6868,14 @@ var Select = ({
|
|
|
6765
6868
|
handleClose();
|
|
6766
6869
|
},
|
|
6767
6870
|
children: [
|
|
6768
|
-
isInline && isSelected ? /* @__PURE__ */ (0,
|
|
6871
|
+
isInline && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
6769
6872
|
"span",
|
|
6770
6873
|
{
|
|
6771
6874
|
className: "agg-select-item-indicator absolute bottom-2 left-0 top-2 w-1 bg-agg-primary",
|
|
6772
6875
|
"aria-hidden": true
|
|
6773
6876
|
}
|
|
6774
6877
|
) : null,
|
|
6775
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
6878
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
6776
6879
|
"span",
|
|
6777
6880
|
{
|
|
6778
6881
|
className: cn(
|
|
@@ -6781,7 +6884,7 @@ var Select = ({
|
|
|
6781
6884
|
),
|
|
6782
6885
|
children: item.icon
|
|
6783
6886
|
}
|
|
6784
|
-
) : item.iconUrl ? /* @__PURE__ */ (0,
|
|
6887
|
+
) : item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
6785
6888
|
RemoteImage,
|
|
6786
6889
|
{
|
|
6787
6890
|
src: item.iconUrl,
|
|
@@ -6789,7 +6892,7 @@ var Select = ({
|
|
|
6789
6892
|
className: "agg-select-item-icon h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
6790
6893
|
}
|
|
6791
6894
|
) : null,
|
|
6792
|
-
/* @__PURE__ */ (0,
|
|
6895
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "agg-select-item-label truncate", children: item.label })
|
|
6793
6896
|
]
|
|
6794
6897
|
},
|
|
6795
6898
|
item.value
|
|
@@ -6797,7 +6900,7 @@ var Select = ({
|
|
|
6797
6900
|
})
|
|
6798
6901
|
}
|
|
6799
6902
|
) : null;
|
|
6800
|
-
return /* @__PURE__ */ (0,
|
|
6903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
6801
6904
|
"div",
|
|
6802
6905
|
{
|
|
6803
6906
|
ref: containerRef,
|
|
@@ -6807,7 +6910,7 @@ var Select = ({
|
|
|
6807
6910
|
className
|
|
6808
6911
|
),
|
|
6809
6912
|
children: [
|
|
6810
|
-
/* @__PURE__ */ (0,
|
|
6913
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
6811
6914
|
"button",
|
|
6812
6915
|
{
|
|
6813
6916
|
type: "button",
|
|
@@ -6831,7 +6934,7 @@ var Select = ({
|
|
|
6831
6934
|
onPointerEnter: handlePointerEnter,
|
|
6832
6935
|
onPointerLeave: handlePointerLeave,
|
|
6833
6936
|
children: [
|
|
6834
|
-
(selectedItem == null ? void 0 : selectedItem.icon) ? /* @__PURE__ */ (0,
|
|
6937
|
+
(selectedItem == null ? void 0 : selectedItem.icon) ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "h-4 w-4 shrink-0 [&_svg]:h-full [&_svg]:w-full", children: selectedItem.icon }) : (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
6835
6938
|
RemoteImage,
|
|
6836
6939
|
{
|
|
6837
6940
|
src: selectedItem.iconUrl,
|
|
@@ -6839,18 +6942,18 @@ var Select = ({
|
|
|
6839
6942
|
className: "agg-select-icon h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
6840
6943
|
}
|
|
6841
6944
|
) : null,
|
|
6842
|
-
/* @__PURE__ */ (0,
|
|
6945
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "agg-select-value flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
|
|
6843
6946
|
]
|
|
6844
6947
|
}
|
|
6845
6948
|
),
|
|
6846
|
-
/* @__PURE__ */ (0,
|
|
6949
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
6847
6950
|
"span",
|
|
6848
6951
|
{
|
|
6849
6952
|
className: cn(
|
|
6850
6953
|
"agg-select-chevron pointer-events-none absolute inset-y-0 inline-flex items-center justify-center",
|
|
6851
6954
|
isInline ? "right-2 text-agg-foreground" : "right-3 text-agg-muted-foreground"
|
|
6852
6955
|
),
|
|
6853
|
-
children: /* @__PURE__ */ (0,
|
|
6956
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
6854
6957
|
Icon,
|
|
6855
6958
|
{
|
|
6856
6959
|
name: isOpen ? "chevron-up" : "chevron-down-thin",
|
|
@@ -6930,7 +7033,7 @@ var getTypographyClassName = ({
|
|
|
6930
7033
|
};
|
|
6931
7034
|
|
|
6932
7035
|
// src/primitives/typography/index.tsx
|
|
6933
|
-
var
|
|
7036
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
6934
7037
|
var Typography = ({
|
|
6935
7038
|
as: Component = "p",
|
|
6936
7039
|
variant = "body",
|
|
@@ -6938,23 +7041,14 @@ var Typography = ({
|
|
|
6938
7041
|
children,
|
|
6939
7042
|
"aria-label": ariaLabel
|
|
6940
7043
|
}) => {
|
|
6941
|
-
return /* @__PURE__ */ (0,
|
|
7044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Component, { className: getTypographyClassName({ className, variant }), "aria-label": ariaLabel, children });
|
|
6942
7045
|
};
|
|
6943
7046
|
Typography.displayName = "Typography";
|
|
6944
7047
|
|
|
6945
|
-
// src/primitives/toast/index.tsx
|
|
6946
|
-
var RadixToast = __toESM(require("@radix-ui/react-toast"));
|
|
6947
|
-
var import_react7 = require("react");
|
|
6948
|
-
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
6949
|
-
var ToastContext = (0, import_react7.createContext)(null);
|
|
6950
|
-
function useOptionalToast() {
|
|
6951
|
-
return (0, import_react7.useContext)(ToastContext);
|
|
6952
|
-
}
|
|
6953
|
-
|
|
6954
7048
|
// src/primitives/tooltip/index.tsx
|
|
6955
|
-
var
|
|
7049
|
+
var import_hooks30 = require("@agg-build/hooks");
|
|
6956
7050
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
6957
|
-
var
|
|
7051
|
+
var import_react9 = require("react");
|
|
6958
7052
|
|
|
6959
7053
|
// src/primitives/tooltip/tooltip.constants.ts
|
|
6960
7054
|
var tooltipSizeClasses = {
|
|
@@ -6986,7 +7080,7 @@ var resolveTooltipArrowDimensions = (size) => {
|
|
|
6986
7080
|
};
|
|
6987
7081
|
|
|
6988
7082
|
// src/primitives/tooltip/index.tsx
|
|
6989
|
-
var
|
|
7083
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
6990
7084
|
var Tooltip = ({
|
|
6991
7085
|
content,
|
|
6992
7086
|
children,
|
|
@@ -7001,25 +7095,25 @@ var Tooltip = ({
|
|
|
7001
7095
|
const {
|
|
7002
7096
|
general: { rootClassName },
|
|
7003
7097
|
features: { enableAnimations }
|
|
7004
|
-
} = (0,
|
|
7005
|
-
const trigger = (0,
|
|
7098
|
+
} = (0, import_hooks30.useSdkUiConfig)();
|
|
7099
|
+
const trigger = (0, import_react9.useMemo)(() => {
|
|
7006
7100
|
if (children) return children;
|
|
7007
|
-
return /* @__PURE__ */ (0,
|
|
7101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
7008
7102
|
"button",
|
|
7009
7103
|
{
|
|
7010
7104
|
type: "button",
|
|
7011
7105
|
className: resolveTooltipTriggerClassName(classNames == null ? void 0 : classNames.trigger),
|
|
7012
7106
|
"aria-label": ariaLabel != null ? ariaLabel : defaultTooltipTriggerAriaLabel,
|
|
7013
|
-
children: /* @__PURE__ */ (0,
|
|
7107
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Icon, { name: "info", size: "small", className: cn(classNames == null ? void 0 : classNames.icon), "aria-hidden": true })
|
|
7014
7108
|
}
|
|
7015
7109
|
);
|
|
7016
7110
|
}, [children, classNames == null ? void 0 : classNames.trigger, classNames == null ? void 0 : classNames.icon, ariaLabel]);
|
|
7017
7111
|
const { width: arrowWidth, height: arrowHeight } = resolveTooltipArrowDimensions(size);
|
|
7018
7112
|
const arrowPoints = `0,0 ${arrowWidth},0 ${arrowWidth / 2},${arrowHeight}`;
|
|
7019
7113
|
const arrowBorderPath = `M0 0 L${arrowWidth / 2} ${arrowHeight} L${arrowWidth} 0`;
|
|
7020
|
-
return /* @__PURE__ */ (0,
|
|
7021
|
-
/* @__PURE__ */ (0,
|
|
7022
|
-
/* @__PURE__ */ (0,
|
|
7114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(TooltipPrimitive.Root, { children: [
|
|
7115
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(TooltipPrimitive.Trigger, { asChild: true, children: trigger }),
|
|
7116
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
7023
7117
|
TooltipPrimitive.Content,
|
|
7024
7118
|
{
|
|
7025
7119
|
side,
|
|
@@ -7043,7 +7137,7 @@ var Tooltip = ({
|
|
|
7043
7137
|
classNames == null ? void 0 : classNames.content
|
|
7044
7138
|
),
|
|
7045
7139
|
children: [
|
|
7046
|
-
/* @__PURE__ */ (0,
|
|
7140
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(TooltipPrimitive.Arrow, { asChild: true, width: arrowWidth, height: arrowHeight, children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
7047
7141
|
"svg",
|
|
7048
7142
|
{
|
|
7049
7143
|
width: arrowWidth,
|
|
@@ -7052,8 +7146,8 @@ var Tooltip = ({
|
|
|
7052
7146
|
"aria-hidden": "true",
|
|
7053
7147
|
className: cn("overflow-visible", classNames == null ? void 0 : classNames.arrow),
|
|
7054
7148
|
children: [
|
|
7055
|
-
/* @__PURE__ */ (0,
|
|
7056
|
-
/* @__PURE__ */ (0,
|
|
7149
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("polygon", { points: arrowPoints, className: "fill-agg-secondary" }),
|
|
7150
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
7057
7151
|
"path",
|
|
7058
7152
|
{
|
|
7059
7153
|
d: arrowBorderPath,
|
|
@@ -7075,18 +7169,18 @@ var Tooltip = ({
|
|
|
7075
7169
|
Tooltip.displayName = "Tooltip";
|
|
7076
7170
|
|
|
7077
7171
|
// src/onboarding/steps/profile-setup.tsx
|
|
7078
|
-
var
|
|
7172
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
7079
7173
|
var ProfileSetupStep = ({ onContinue }) => {
|
|
7080
|
-
const labels = (0,
|
|
7081
|
-
const [username, setUsername] = (0,
|
|
7082
|
-
const [avatarFile, setAvatarFile] = (0,
|
|
7083
|
-
const [avatarPreview, setAvatarPreview] = (0,
|
|
7084
|
-
const fileInputRef = (0,
|
|
7085
|
-
const handleAvatarClick = (0,
|
|
7174
|
+
const labels = (0, import_hooks31.useLabels)();
|
|
7175
|
+
const [username, setUsername] = (0, import_react10.useState)("");
|
|
7176
|
+
const [avatarFile, setAvatarFile] = (0, import_react10.useState)();
|
|
7177
|
+
const [avatarPreview, setAvatarPreview] = (0, import_react10.useState)();
|
|
7178
|
+
const fileInputRef = (0, import_react10.useRef)(null);
|
|
7179
|
+
const handleAvatarClick = (0, import_react10.useCallback)(() => {
|
|
7086
7180
|
var _a;
|
|
7087
7181
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
7088
7182
|
}, []);
|
|
7089
|
-
const handleFileChange = (0,
|
|
7183
|
+
const handleFileChange = (0, import_react10.useCallback)((e) => {
|
|
7090
7184
|
var _a;
|
|
7091
7185
|
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
7092
7186
|
if (!file) return;
|
|
@@ -7098,18 +7192,18 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
7098
7192
|
};
|
|
7099
7193
|
reader.readAsDataURL(file);
|
|
7100
7194
|
}, []);
|
|
7101
|
-
const handleContinue = (0,
|
|
7195
|
+
const handleContinue = (0, import_react10.useCallback)(() => {
|
|
7102
7196
|
onContinue({
|
|
7103
7197
|
username,
|
|
7104
7198
|
avatarFile,
|
|
7105
7199
|
avatarPreview
|
|
7106
7200
|
});
|
|
7107
7201
|
}, [username, avatarFile, avatarPreview, onContinue]);
|
|
7108
|
-
return /* @__PURE__ */ (0,
|
|
7109
|
-
/* @__PURE__ */ (0,
|
|
7110
|
-
/* @__PURE__ */ (0,
|
|
7111
|
-
/* @__PURE__ */ (0,
|
|
7112
|
-
/* @__PURE__ */ (0,
|
|
7202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex flex-col gap-7", children: [
|
|
7203
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.profileSetup.title }),
|
|
7204
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex flex-col gap-5 items-center w-full", children: [
|
|
7205
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex justify-center", children: [
|
|
7206
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
7113
7207
|
"button",
|
|
7114
7208
|
{
|
|
7115
7209
|
type: "button",
|
|
@@ -7125,13 +7219,13 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
7125
7219
|
),
|
|
7126
7220
|
"aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
|
|
7127
7221
|
children: [
|
|
7128
|
-
!avatarPreview ? /* @__PURE__ */ (0,
|
|
7222
|
+
!avatarPreview ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
7129
7223
|
"svg",
|
|
7130
7224
|
{
|
|
7131
7225
|
"aria-hidden": true,
|
|
7132
7226
|
viewBox: "0 0 80 80",
|
|
7133
7227
|
className: "pointer-events-none absolute inset-0 h-full w-full text-agg-separator group-hover:text-agg-muted-foreground",
|
|
7134
|
-
children: /* @__PURE__ */ (0,
|
|
7228
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
7135
7229
|
"circle",
|
|
7136
7230
|
{
|
|
7137
7231
|
cx: "40",
|
|
@@ -7145,18 +7239,18 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
7145
7239
|
)
|
|
7146
7240
|
}
|
|
7147
7241
|
) : null,
|
|
7148
|
-
avatarPreview ? /* @__PURE__ */ (0,
|
|
7242
|
+
avatarPreview ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
7149
7243
|
RemoteImage,
|
|
7150
7244
|
{
|
|
7151
7245
|
src: avatarPreview,
|
|
7152
7246
|
alt: labels.onboarding.profileSetup.profilePreviewAlt,
|
|
7153
7247
|
className: "h-full w-full object-cover"
|
|
7154
7248
|
}
|
|
7155
|
-
) : /* @__PURE__ */ (0,
|
|
7249
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ProfileIcon, { className: "h-7 w-7 text-agg-muted-foreground" })
|
|
7156
7250
|
]
|
|
7157
7251
|
}
|
|
7158
7252
|
),
|
|
7159
|
-
/* @__PURE__ */ (0,
|
|
7253
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
7160
7254
|
"input",
|
|
7161
7255
|
{
|
|
7162
7256
|
ref: fileInputRef,
|
|
@@ -7168,8 +7262,8 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
7168
7262
|
}
|
|
7169
7263
|
)
|
|
7170
7264
|
] }),
|
|
7171
|
-
/* @__PURE__ */ (0,
|
|
7172
|
-
/* @__PURE__ */ (0,
|
|
7265
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex flex-col gap-2 w-full", children: [
|
|
7266
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
7173
7267
|
"label",
|
|
7174
7268
|
{
|
|
7175
7269
|
htmlFor: "onboarding-username",
|
|
@@ -7177,7 +7271,7 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
7177
7271
|
children: labels.onboarding.profileSetup.usernameLabel
|
|
7178
7272
|
}
|
|
7179
7273
|
),
|
|
7180
|
-
/* @__PURE__ */ (0,
|
|
7274
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
7181
7275
|
"input",
|
|
7182
7276
|
{
|
|
7183
7277
|
id: "onboarding-username",
|
|
@@ -7201,16 +7295,16 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
7201
7295
|
)
|
|
7202
7296
|
] })
|
|
7203
7297
|
] }),
|
|
7204
|
-
/* @__PURE__ */ (0,
|
|
7298
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Button, { variant: "primary", size: "large", className: "w-full", onClick: handleContinue, children: labels.onboarding.profileSetup.continue })
|
|
7205
7299
|
] });
|
|
7206
7300
|
};
|
|
7207
7301
|
ProfileSetupStep.displayName = "ProfileSetupStep";
|
|
7208
7302
|
|
|
7209
7303
|
// src/onboarding/steps/connect-accounts.tsx
|
|
7210
|
-
var
|
|
7211
|
-
var
|
|
7304
|
+
var import_hooks32 = require("@agg-build/hooks");
|
|
7305
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
7212
7306
|
var OnchainVenueLogos = () => {
|
|
7213
|
-
return /* @__PURE__ */ (0,
|
|
7307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "flex gap-1 sm:gap-0 sm:-space-x-5", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { style: { zIndex: ONCHAIN_VENUES.length - index }, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(VenueLogo, { venue, variant: "logo", size: "medium", className: "sm:h-8 sm:w-8" }) }, venue)) });
|
|
7214
7308
|
};
|
|
7215
7309
|
var VenueCard = ({
|
|
7216
7310
|
logos,
|
|
@@ -7221,8 +7315,8 @@ var VenueCard = ({
|
|
|
7221
7315
|
onConnect,
|
|
7222
7316
|
connected = false
|
|
7223
7317
|
}) => {
|
|
7224
|
-
const labels = (0,
|
|
7225
|
-
const action = connected ? /* @__PURE__ */ (0,
|
|
7318
|
+
const labels = (0, import_hooks32.useLabels)();
|
|
7319
|
+
const action = connected ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7226
7320
|
Button,
|
|
7227
7321
|
{
|
|
7228
7322
|
variant: "tertiary",
|
|
@@ -7232,18 +7326,18 @@ var VenueCard = ({
|
|
|
7232
7326
|
children: labels.onboarding.connectAccounts.connect
|
|
7233
7327
|
}
|
|
7234
7328
|
);
|
|
7235
|
-
const mobileAction = connected ? /* @__PURE__ */ (0,
|
|
7329
|
+
const mobileAction = connected ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7236
7330
|
Button,
|
|
7237
7331
|
{
|
|
7238
7332
|
variant: "tertiary",
|
|
7239
7333
|
size: "medium",
|
|
7240
7334
|
className: "!h-auto !px-0 !py-0 text-agg-primary hover:bg-transparent hover:text-agg-primary-hover",
|
|
7241
7335
|
onClick: onConnect,
|
|
7242
|
-
suffix: /* @__PURE__ */ (0,
|
|
7336
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(ChevronRightIcon, { className: "h-4 w-4" }),
|
|
7243
7337
|
children: labels.onboarding.connectAccounts.connectAccount
|
|
7244
7338
|
}
|
|
7245
7339
|
);
|
|
7246
|
-
return /* @__PURE__ */ (0,
|
|
7340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
7247
7341
|
"div",
|
|
7248
7342
|
{
|
|
7249
7343
|
className: cn(
|
|
@@ -7251,23 +7345,23 @@ var VenueCard = ({
|
|
|
7251
7345
|
connected ? "bg-agg-success/5" : "bg-agg-secondary-hover hover:bg-agg-tertiary"
|
|
7252
7346
|
),
|
|
7253
7347
|
children: [
|
|
7254
|
-
/* @__PURE__ */ (0,
|
|
7255
|
-
/* @__PURE__ */ (0,
|
|
7256
|
-
/* @__PURE__ */ (0,
|
|
7257
|
-
/* @__PURE__ */ (0,
|
|
7258
|
-
/* @__PURE__ */ (0,
|
|
7259
|
-
/* @__PURE__ */ (0,
|
|
7348
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "hidden sm:flex items-center justify-between", children: [
|
|
7349
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-5", children: [
|
|
7350
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "shrink-0", children: logos }),
|
|
7351
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex flex-col gap-[2px]", children: [
|
|
7352
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("p", { className: "text-agg-base font-agg-bold text-agg-foreground", children: title2 }),
|
|
7353
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("p", { className: "text-agg-sm text-agg-foreground", children: description })
|
|
7260
7354
|
] })
|
|
7261
7355
|
] }),
|
|
7262
|
-
/* @__PURE__ */ (0,
|
|
7356
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "shrink-0", children: action })
|
|
7263
7357
|
] }),
|
|
7264
|
-
/* @__PURE__ */ (0,
|
|
7265
|
-
/* @__PURE__ */ (0,
|
|
7266
|
-
/* @__PURE__ */ (0,
|
|
7267
|
-
/* @__PURE__ */ (0,
|
|
7358
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex flex-col gap-3 sm:hidden", children: [
|
|
7359
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
7360
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "shrink-0", children: logos }),
|
|
7361
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("p", { className: "text-agg-lg font-agg-bold text-agg-foreground", children: mobileTitle != null ? mobileTitle : title2 })
|
|
7268
7362
|
] }),
|
|
7269
|
-
/* @__PURE__ */ (0,
|
|
7270
|
-
/* @__PURE__ */ (0,
|
|
7363
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex flex-col items-start gap-2", children: [
|
|
7364
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("p", { className: "text-agg-base text-agg-foreground", children: mobileDescription != null ? mobileDescription : description }),
|
|
7271
7365
|
mobileAction
|
|
7272
7366
|
] })
|
|
7273
7367
|
] })
|
|
@@ -7280,14 +7374,14 @@ var ConnectAccountsStep = ({
|
|
|
7280
7374
|
onContinue,
|
|
7281
7375
|
connectedOnchain = false
|
|
7282
7376
|
}) => {
|
|
7283
|
-
const labels = (0,
|
|
7377
|
+
const labels = (0, import_hooks32.useLabels)();
|
|
7284
7378
|
const canContinue = connectedOnchain;
|
|
7285
|
-
return /* @__PURE__ */ (0,
|
|
7286
|
-
/* @__PURE__ */ (0,
|
|
7287
|
-
/* @__PURE__ */ (0,
|
|
7379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
7380
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectAccounts.title }),
|
|
7381
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7288
7382
|
VenueCard,
|
|
7289
7383
|
{
|
|
7290
|
-
logos: /* @__PURE__ */ (0,
|
|
7384
|
+
logos: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(OnchainVenueLogos, {}),
|
|
7291
7385
|
title: labels.onboarding.connectAccounts.onchainTitle,
|
|
7292
7386
|
mobileTitle: labels.onboarding.connectAccounts.onchainMobileTitle(
|
|
7293
7387
|
ONCHAIN_VENUES.length - 1
|
|
@@ -7298,7 +7392,7 @@ var ConnectAccountsStep = ({
|
|
|
7298
7392
|
connected: connectedOnchain
|
|
7299
7393
|
}
|
|
7300
7394
|
) }),
|
|
7301
|
-
/* @__PURE__ */ (0,
|
|
7395
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7302
7396
|
Button,
|
|
7303
7397
|
{
|
|
7304
7398
|
variant: "primary",
|
|
@@ -7314,22 +7408,22 @@ var ConnectAccountsStep = ({
|
|
|
7314
7408
|
ConnectAccountsStep.displayName = "ConnectAccountsStep";
|
|
7315
7409
|
|
|
7316
7410
|
// src/onboarding/steps/connect-onchain-modal.tsx
|
|
7317
|
-
var
|
|
7318
|
-
var
|
|
7411
|
+
var import_react11 = require("react");
|
|
7412
|
+
var import_hooks33 = require("@agg-build/hooks");
|
|
7319
7413
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
7320
|
-
var
|
|
7414
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
7321
7415
|
var ConnectOnchainModal = ({
|
|
7322
7416
|
open,
|
|
7323
7417
|
onOpenChange,
|
|
7324
7418
|
onConnect
|
|
7325
7419
|
}) => {
|
|
7326
|
-
const labels = (0,
|
|
7327
|
-
const [connecting, setConnecting] = (0,
|
|
7328
|
-
const [error, setError] = (0,
|
|
7329
|
-
const handleCancel = (0,
|
|
7420
|
+
const labels = (0, import_hooks33.useLabels)();
|
|
7421
|
+
const [connecting, setConnecting] = (0, import_react11.useState)(false);
|
|
7422
|
+
const [error, setError] = (0, import_react11.useState)();
|
|
7423
|
+
const handleCancel = (0, import_react11.useCallback)(() => {
|
|
7330
7424
|
onOpenChange(false);
|
|
7331
7425
|
}, [onOpenChange]);
|
|
7332
|
-
const handleConnect = (0,
|
|
7426
|
+
const handleConnect = (0, import_react11.useCallback)(() => __async(null, null, function* () {
|
|
7333
7427
|
if (connecting) return;
|
|
7334
7428
|
setConnecting(true);
|
|
7335
7429
|
setError(void 0);
|
|
@@ -7344,7 +7438,7 @@ var ConnectOnchainModal = ({
|
|
|
7344
7438
|
setConnecting(false);
|
|
7345
7439
|
}
|
|
7346
7440
|
}), [connecting, labels.onboarding.connectOnchainModal.fallbackError, onConnect, onOpenChange]);
|
|
7347
|
-
const handleOpenChange = (0,
|
|
7441
|
+
const handleOpenChange = (0, import_react11.useCallback)(
|
|
7348
7442
|
(value) => {
|
|
7349
7443
|
if (value) {
|
|
7350
7444
|
setError(void 0);
|
|
@@ -7354,15 +7448,15 @@ var ConnectOnchainModal = ({
|
|
|
7354
7448
|
},
|
|
7355
7449
|
[onOpenChange]
|
|
7356
7450
|
);
|
|
7357
|
-
return /* @__PURE__ */ (0,
|
|
7451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
7358
7452
|
Modal.Container,
|
|
7359
7453
|
{
|
|
7360
7454
|
maxWidth: "600px",
|
|
7361
7455
|
"aria-label": labels.onboarding.connectOnchainModal.ariaLabel,
|
|
7362
7456
|
classNames: { container: "!rounded-agg-lg" },
|
|
7363
7457
|
children: [
|
|
7364
|
-
/* @__PURE__ */ (0,
|
|
7365
|
-
/* @__PURE__ */ (0,
|
|
7458
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Dialog2.Title, { className: "sr-only", children: labels.onboarding.connectOnchainModal.title }),
|
|
7459
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7366
7460
|
Modal.Header,
|
|
7367
7461
|
{
|
|
7368
7462
|
hideClose: false,
|
|
@@ -7373,26 +7467,26 @@ var ConnectOnchainModal = ({
|
|
|
7373
7467
|
}
|
|
7374
7468
|
}
|
|
7375
7469
|
),
|
|
7376
|
-
/* @__PURE__ */ (0,
|
|
7377
|
-
/* @__PURE__ */ (0,
|
|
7378
|
-
/* @__PURE__ */ (0,
|
|
7379
|
-
/* @__PURE__ */ (0,
|
|
7470
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col gap-8 items-center", children: [
|
|
7471
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col gap-4 items-center text-center", children: [
|
|
7472
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectOnchainModal.title }),
|
|
7473
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-base text-center leading-agg-6 text-agg-foreground whitespace-pre-line", children: labels.onboarding.connectOnchainModal.description })
|
|
7380
7474
|
] }),
|
|
7381
|
-
/* @__PURE__ */ (0,
|
|
7382
|
-
/* @__PURE__ */ (0,
|
|
7383
|
-
/* @__PURE__ */ (0,
|
|
7384
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
7385
|
-
/* @__PURE__ */ (0,
|
|
7386
|
-
/* @__PURE__ */ (0,
|
|
7475
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex w-full flex-col items-center gap-4 rounded-agg-xl bg-agg-secondary-hover p-6", children: [
|
|
7476
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-sm font-agg-bold uppercase leading-agg-5 text-agg-muted-foreground", children: labels.onboarding.connectOnchainModal.supportedVenuesLabel }),
|
|
7477
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex flex-wrap items-center justify-center gap-x-4 gap-y-3", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex items-center gap-[6px]", children: [
|
|
7478
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "mr-2.5 h-3 w-px bg-agg-separator" }),
|
|
7479
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(VenueLogo, { venue, size: "medium" }),
|
|
7480
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-agg-base text-agg-foreground", children: labels.venues[venue] })
|
|
7387
7481
|
] }, venue)) })
|
|
7388
7482
|
] }),
|
|
7389
|
-
/* @__PURE__ */ (0,
|
|
7390
|
-
/* @__PURE__ */ (0,
|
|
7391
|
-
error ? /* @__PURE__ */ (0,
|
|
7392
|
-
/* @__PURE__ */ (0,
|
|
7393
|
-
/* @__PURE__ */ (0,
|
|
7483
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col gap-6 items-center", children: [
|
|
7484
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col gap-3 items-center", children: [
|
|
7485
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7486
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(WarningIcon, { className: "h-3.5 w-3.5 shrink-0 text-agg-error" }),
|
|
7487
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
7394
7488
|
] }) : null,
|
|
7395
|
-
/* @__PURE__ */ (0,
|
|
7489
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7396
7490
|
Button,
|
|
7397
7491
|
{
|
|
7398
7492
|
variant: "primary",
|
|
@@ -7403,7 +7497,7 @@ var ConnectOnchainModal = ({
|
|
|
7403
7497
|
}
|
|
7404
7498
|
)
|
|
7405
7499
|
] }),
|
|
7406
|
-
/* @__PURE__ */ (0,
|
|
7500
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7407
7501
|
Button,
|
|
7408
7502
|
{
|
|
7409
7503
|
variant: "tertiary",
|
|
@@ -7422,12 +7516,12 @@ var ConnectOnchainModal = ({
|
|
|
7422
7516
|
ConnectOnchainModal.displayName = "ConnectOnchainModal";
|
|
7423
7517
|
|
|
7424
7518
|
// src/onboarding/steps/connect-kalshi-modal.tsx
|
|
7425
|
-
var
|
|
7519
|
+
var import_hooks34 = require("@agg-build/hooks");
|
|
7426
7520
|
var import_sdk14 = require("@agg-build/sdk");
|
|
7427
7521
|
var Dialog3 = __toESM(require("@radix-ui/react-dialog"));
|
|
7428
|
-
var
|
|
7522
|
+
var import_react12 = require("react");
|
|
7429
7523
|
var import_zod = require("zod");
|
|
7430
|
-
var
|
|
7524
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
7431
7525
|
var kalshiCredentialsSchema = import_zod.z.object({
|
|
7432
7526
|
apiKeyId: import_zod.z.string().trim().min(1),
|
|
7433
7527
|
privateKey: import_zod.z.string().trim().min(1)
|
|
@@ -7449,25 +7543,25 @@ var ConnectKalshiModal = ({
|
|
|
7449
7543
|
onOpenChange,
|
|
7450
7544
|
onVerify
|
|
7451
7545
|
}) => {
|
|
7452
|
-
const labels = (0,
|
|
7453
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
7454
|
-
const apiKeyInputRef = (0,
|
|
7455
|
-
const errorId = (0,
|
|
7456
|
-
const [apiKeyId, setApiKeyId] = (0,
|
|
7457
|
-
const [privateKey, setPrivateKey] = (0,
|
|
7458
|
-
const [isVerifying, setIsVerifying] = (0,
|
|
7459
|
-
const [isConnected, setIsConnected] = (0,
|
|
7460
|
-
const [error, setError] = (0,
|
|
7461
|
-
const availabilityState = (0,
|
|
7546
|
+
const labels = (0, import_hooks34.useLabels)();
|
|
7547
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks34.useAppConfig)();
|
|
7548
|
+
const apiKeyInputRef = (0, import_react12.useRef)(null);
|
|
7549
|
+
const errorId = (0, import_react12.useId)();
|
|
7550
|
+
const [apiKeyId, setApiKeyId] = (0, import_react12.useState)("");
|
|
7551
|
+
const [privateKey, setPrivateKey] = (0, import_react12.useState)("");
|
|
7552
|
+
const [isVerifying, setIsVerifying] = (0, import_react12.useState)(false);
|
|
7553
|
+
const [isConnected, setIsConnected] = (0, import_react12.useState)(false);
|
|
7554
|
+
const [error, setError] = (0, import_react12.useState)();
|
|
7555
|
+
const availabilityState = (0, import_hooks34.getVenueAvailabilityState)({
|
|
7462
7556
|
venueId: import_sdk14.Venue.kalshi,
|
|
7463
7557
|
disabledVenues,
|
|
7464
7558
|
isConfigLoading: isAppConfigLoading
|
|
7465
7559
|
});
|
|
7466
|
-
const parsedCredentials = (0,
|
|
7560
|
+
const parsedCredentials = (0, import_react12.useMemo)(
|
|
7467
7561
|
() => kalshiCredentialsSchema.safeParse({ apiKeyId, privateKey }),
|
|
7468
7562
|
[apiKeyId, privateKey]
|
|
7469
7563
|
);
|
|
7470
|
-
(0,
|
|
7564
|
+
(0, import_react12.useEffect)(() => {
|
|
7471
7565
|
if (!open) return;
|
|
7472
7566
|
setApiKeyId("");
|
|
7473
7567
|
setPrivateKey("");
|
|
@@ -7480,14 +7574,14 @@ var ConnectKalshiModal = ({
|
|
|
7480
7574
|
});
|
|
7481
7575
|
return () => window.cancelAnimationFrame(animationFrame);
|
|
7482
7576
|
}, [open]);
|
|
7483
|
-
const handleOpenChange = (0,
|
|
7577
|
+
const handleOpenChange = (0, import_react12.useCallback)(
|
|
7484
7578
|
(nextOpen) => {
|
|
7485
7579
|
if (isVerifying && !nextOpen) return;
|
|
7486
7580
|
onOpenChange(nextOpen);
|
|
7487
7581
|
},
|
|
7488
7582
|
[isVerifying, onOpenChange]
|
|
7489
7583
|
);
|
|
7490
|
-
const handleVerify = (0,
|
|
7584
|
+
const handleVerify = (0, import_react12.useCallback)(() => __async(null, null, function* () {
|
|
7491
7585
|
if (!parsedCredentials.success || isVerifying || isConnected) return;
|
|
7492
7586
|
const credentials = parsedCredentials.data;
|
|
7493
7587
|
setIsVerifying(true);
|
|
@@ -7514,7 +7608,7 @@ var ConnectKalshiModal = ({
|
|
|
7514
7608
|
onVerify,
|
|
7515
7609
|
parsedCredentials
|
|
7516
7610
|
]);
|
|
7517
|
-
const handleSubmit = (0,
|
|
7611
|
+
const handleSubmit = (0, import_react12.useCallback)(
|
|
7518
7612
|
(event) => {
|
|
7519
7613
|
event.preventDefault();
|
|
7520
7614
|
void handleVerify();
|
|
@@ -7522,30 +7616,30 @@ var ConnectKalshiModal = ({
|
|
|
7522
7616
|
[handleVerify]
|
|
7523
7617
|
);
|
|
7524
7618
|
if (availabilityState === "hidden") return null;
|
|
7525
|
-
return /* @__PURE__ */ (0,
|
|
7619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
7526
7620
|
Modal.Container,
|
|
7527
7621
|
{
|
|
7528
7622
|
maxWidth: "600px",
|
|
7529
7623
|
"aria-label": labels.onboarding.connectKalshiModal.ariaLabel,
|
|
7530
7624
|
classNames: { container: "!rounded-agg-2xl" },
|
|
7531
7625
|
children: [
|
|
7532
|
-
/* @__PURE__ */ (0,
|
|
7626
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "flex h-[60px] shrink-0 items-center justify-end px-8", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7533
7627
|
Dialog3.Close,
|
|
7534
7628
|
{
|
|
7535
7629
|
"aria-label": labels.common.close,
|
|
7536
7630
|
className: "flex size-10 cursor-pointer items-center justify-center rounded-agg-full text-agg-secondary transition-colors hover:bg-agg-quaternary hover:text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-accent disabled:cursor-default disabled:opacity-50",
|
|
7537
7631
|
disabled: isVerifying,
|
|
7538
|
-
children: /* @__PURE__ */ (0,
|
|
7632
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Icon, { name: "close", size: "medium" })
|
|
7539
7633
|
}
|
|
7540
7634
|
) }),
|
|
7541
|
-
/* @__PURE__ */ (0,
|
|
7635
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Modal.Body, { classNames: { root: "!px-5 !pb-12 !pt-0 sm:!px-10" }, children: isConnected ? /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
7542
7636
|
"div",
|
|
7543
7637
|
{
|
|
7544
7638
|
className: "flex flex-col items-center gap-8 pb-3 text-center",
|
|
7545
7639
|
role: "status",
|
|
7546
7640
|
"aria-live": "polite",
|
|
7547
7641
|
children: [
|
|
7548
|
-
/* @__PURE__ */ (0,
|
|
7642
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "flex size-[60px] items-center justify-center rounded-agg-full bg-agg-success", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7549
7643
|
Icon,
|
|
7550
7644
|
{
|
|
7551
7645
|
name: "success-check",
|
|
@@ -7553,11 +7647,11 @@ var ConnectKalshiModal = ({
|
|
|
7553
7647
|
"aria-hidden": "true"
|
|
7554
7648
|
}
|
|
7555
7649
|
) }),
|
|
7556
|
-
/* @__PURE__ */ (0,
|
|
7557
|
-
/* @__PURE__ */ (0,
|
|
7558
|
-
/* @__PURE__ */ (0,
|
|
7650
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [
|
|
7651
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Dialog3.Title, { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: labels.onboarding.connectKalshiModal.success.title }),
|
|
7652
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Dialog3.Description, { className: "max-w-[480px] text-agg-base leading-agg-6 text-agg-foreground", children: labels.onboarding.connectKalshiModal.success.description })
|
|
7559
7653
|
] }),
|
|
7560
|
-
/* @__PURE__ */ (0,
|
|
7654
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7561
7655
|
Button,
|
|
7562
7656
|
{
|
|
7563
7657
|
variant: "primary",
|
|
@@ -7569,27 +7663,27 @@ var ConnectKalshiModal = ({
|
|
|
7569
7663
|
)
|
|
7570
7664
|
]
|
|
7571
7665
|
}
|
|
7572
|
-
) : /* @__PURE__ */ (0,
|
|
7573
|
-
/* @__PURE__ */ (0,
|
|
7574
|
-
/* @__PURE__ */ (0,
|
|
7575
|
-
/* @__PURE__ */ (0,
|
|
7576
|
-
/* @__PURE__ */ (0,
|
|
7666
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("form", { className: "flex flex-col items-center gap-8", onSubmit: handleSubmit, children: [
|
|
7667
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(VenueLogo, { venue: import_sdk14.Venue.kalshi, variant: "logo", size: "large", className: "size-[60px]" }),
|
|
7668
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col items-center gap-4 text-center", children: [
|
|
7669
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Dialog3.Title, { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: labels.onboarding.connectKalshiModal.title }),
|
|
7670
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Dialog3.Description, { className: "max-w-[520px] text-agg-base leading-agg-6 text-agg-foreground", children: labels.onboarding.connectKalshiModal.description })
|
|
7577
7671
|
] }),
|
|
7578
|
-
/* @__PURE__ */ (0,
|
|
7579
|
-
/* @__PURE__ */ (0,
|
|
7580
|
-
/* @__PURE__ */ (0,
|
|
7581
|
-
/* @__PURE__ */ (0,
|
|
7582
|
-
/* @__PURE__ */ (0,
|
|
7672
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex w-full flex-col gap-4", children: [
|
|
7673
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col gap-3 rounded-agg-xl bg-agg-secondary-hover p-4", children: [
|
|
7674
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
7675
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepOne.label }),
|
|
7676
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepOne.title })
|
|
7583
7677
|
] }),
|
|
7584
|
-
/* @__PURE__ */ (0,
|
|
7585
|
-
/* @__PURE__ */ (0,
|
|
7586
|
-
/* @__PURE__ */ (0,
|
|
7678
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
7679
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.signIn }),
|
|
7680
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("p", { children: [
|
|
7587
7681
|
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfilePrefix,
|
|
7588
7682
|
" ",
|
|
7589
|
-
/* @__PURE__ */ (0,
|
|
7683
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileText }),
|
|
7590
7684
|
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfileSeparator,
|
|
7591
7685
|
" ",
|
|
7592
|
-
/* @__PURE__ */ (0,
|
|
7686
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7593
7687
|
"a",
|
|
7594
7688
|
{
|
|
7595
7689
|
href: labels.onboarding.connectKalshiModal.stepOne.instructions.profileUrl,
|
|
@@ -7600,34 +7694,34 @@ var ConnectKalshiModal = ({
|
|
|
7600
7694
|
}
|
|
7601
7695
|
)
|
|
7602
7696
|
] }),
|
|
7603
|
-
/* @__PURE__ */ (0,
|
|
7697
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("p", { children: [
|
|
7604
7698
|
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeyPrefix,
|
|
7605
7699
|
" ",
|
|
7606
|
-
/* @__PURE__ */ (0,
|
|
7700
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKeyText }),
|
|
7607
7701
|
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeySuffix
|
|
7608
7702
|
] }),
|
|
7609
|
-
/* @__PURE__ */ (0,
|
|
7703
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("p", { children: [
|
|
7610
7704
|
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsPrefix,
|
|
7611
7705
|
" ",
|
|
7612
|
-
/* @__PURE__ */ (0,
|
|
7706
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.readWriteText }),
|
|
7613
7707
|
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsSuffix
|
|
7614
7708
|
] }),
|
|
7615
|
-
/* @__PURE__ */ (0,
|
|
7709
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKey })
|
|
7616
7710
|
] }),
|
|
7617
|
-
/* @__PURE__ */ (0,
|
|
7711
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
7618
7712
|
labels.onboarding.connectKalshiModal.stepOne.footerLineOne,
|
|
7619
|
-
/* @__PURE__ */ (0,
|
|
7713
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("br", {}),
|
|
7620
7714
|
labels.onboarding.connectKalshiModal.stepOne.footerLineTwo
|
|
7621
7715
|
] })
|
|
7622
7716
|
] }),
|
|
7623
|
-
/* @__PURE__ */ (0,
|
|
7624
|
-
/* @__PURE__ */ (0,
|
|
7625
|
-
/* @__PURE__ */ (0,
|
|
7626
|
-
/* @__PURE__ */ (0,
|
|
7717
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col gap-3 rounded-agg-xl bg-agg-secondary-hover p-4", children: [
|
|
7718
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
7719
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.label }),
|
|
7720
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.title })
|
|
7627
7721
|
] }),
|
|
7628
|
-
/* @__PURE__ */ (0,
|
|
7629
|
-
/* @__PURE__ */ (0,
|
|
7630
|
-
/* @__PURE__ */ (0,
|
|
7722
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.description }),
|
|
7723
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
7724
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7631
7725
|
"label",
|
|
7632
7726
|
{
|
|
7633
7727
|
htmlFor: "kalshi-api-key-id",
|
|
@@ -7635,7 +7729,7 @@ var ConnectKalshiModal = ({
|
|
|
7635
7729
|
children: labels.onboarding.connectKalshiModal.stepTwo.apiKeyIdLabel
|
|
7636
7730
|
}
|
|
7637
7731
|
),
|
|
7638
|
-
/* @__PURE__ */ (0,
|
|
7732
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7639
7733
|
"input",
|
|
7640
7734
|
{
|
|
7641
7735
|
ref: apiKeyInputRef,
|
|
@@ -7657,8 +7751,8 @@ var ConnectKalshiModal = ({
|
|
|
7657
7751
|
}
|
|
7658
7752
|
)
|
|
7659
7753
|
] }),
|
|
7660
|
-
/* @__PURE__ */ (0,
|
|
7661
|
-
/* @__PURE__ */ (0,
|
|
7754
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
7755
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7662
7756
|
"label",
|
|
7663
7757
|
{
|
|
7664
7758
|
htmlFor: "kalshi-private-key",
|
|
@@ -7666,7 +7760,7 @@ var ConnectKalshiModal = ({
|
|
|
7666
7760
|
children: labels.onboarding.connectKalshiModal.stepTwo.privateKeyLabel
|
|
7667
7761
|
}
|
|
7668
7762
|
),
|
|
7669
|
-
/* @__PURE__ */ (0,
|
|
7763
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7670
7764
|
"textarea",
|
|
7671
7765
|
{
|
|
7672
7766
|
id: "kalshi-private-key",
|
|
@@ -7689,22 +7783,22 @@ var ConnectKalshiModal = ({
|
|
|
7689
7783
|
] })
|
|
7690
7784
|
] })
|
|
7691
7785
|
] }),
|
|
7692
|
-
/* @__PURE__ */ (0,
|
|
7693
|
-
/* @__PURE__ */ (0,
|
|
7694
|
-
/* @__PURE__ */ (0,
|
|
7695
|
-
/* @__PURE__ */ (0,
|
|
7696
|
-
/* @__PURE__ */ (0,
|
|
7786
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex w-full items-center justify-between gap-4", children: [
|
|
7787
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "text-agg-base text-agg-foreground", children: labels.onboarding.connectKalshiModal.help.label }),
|
|
7788
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
7789
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("span", { className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary", children: [
|
|
7790
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Icon, { name: "document", size: "small", className: "size-4 text-agg-primary" }),
|
|
7697
7791
|
labels.onboarding.connectKalshiModal.help.docsLinkLabel
|
|
7698
7792
|
] }),
|
|
7699
|
-
/* @__PURE__ */ (0,
|
|
7700
|
-
/* @__PURE__ */ (0,
|
|
7701
|
-
/* @__PURE__ */ (0,
|
|
7793
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "h-3 w-px bg-agg-separator" }),
|
|
7794
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("span", { className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary", children: [
|
|
7795
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Icon, { name: "play-square", size: "small", className: "size-4 text-agg-primary" }),
|
|
7702
7796
|
labels.onboarding.connectKalshiModal.help.tutorialLinkLabel
|
|
7703
7797
|
] })
|
|
7704
7798
|
] })
|
|
7705
7799
|
] }),
|
|
7706
|
-
/* @__PURE__ */ (0,
|
|
7707
|
-
error ? /* @__PURE__ */ (0,
|
|
7800
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col items-center gap-5", children: [
|
|
7801
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
7708
7802
|
"div",
|
|
7709
7803
|
{
|
|
7710
7804
|
id: errorId,
|
|
@@ -7712,13 +7806,13 @@ var ConnectKalshiModal = ({
|
|
|
7712
7806
|
role: "alert",
|
|
7713
7807
|
"aria-live": "assertive",
|
|
7714
7808
|
children: [
|
|
7715
|
-
/* @__PURE__ */ (0,
|
|
7716
|
-
/* @__PURE__ */ (0,
|
|
7809
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Icon, { name: "warning", size: "small", className: "size-3.5 text-agg-error" }),
|
|
7810
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
7717
7811
|
]
|
|
7718
7812
|
}
|
|
7719
7813
|
) : null,
|
|
7720
|
-
/* @__PURE__ */ (0,
|
|
7721
|
-
/* @__PURE__ */ (0,
|
|
7814
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex items-center justify-center gap-3", children: [
|
|
7815
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7722
7816
|
Button,
|
|
7723
7817
|
{
|
|
7724
7818
|
variant: "secondary",
|
|
@@ -7728,7 +7822,7 @@ var ConnectKalshiModal = ({
|
|
|
7728
7822
|
children: labels.onboarding.connectKalshiModal.actions.cancel
|
|
7729
7823
|
}
|
|
7730
7824
|
),
|
|
7731
|
-
/* @__PURE__ */ (0,
|
|
7825
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7732
7826
|
Button,
|
|
7733
7827
|
{
|
|
7734
7828
|
type: "submit",
|
|
@@ -7749,7 +7843,7 @@ var ConnectKalshiModal = ({
|
|
|
7749
7843
|
ConnectKalshiModal.displayName = "ConnectKalshiModal";
|
|
7750
7844
|
|
|
7751
7845
|
// src/onboarding/index.tsx
|
|
7752
|
-
var
|
|
7846
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
7753
7847
|
var OnboardingModal = ({
|
|
7754
7848
|
open,
|
|
7755
7849
|
onOpenChange,
|
|
@@ -7760,55 +7854,55 @@ var OnboardingModal = ({
|
|
|
7760
7854
|
connectedOnchain = false
|
|
7761
7855
|
}) => {
|
|
7762
7856
|
var _a;
|
|
7763
|
-
const labels = (0,
|
|
7764
|
-
const [step, setStep] = (0,
|
|
7857
|
+
const labels = (0, import_hooks35.useLabels)();
|
|
7858
|
+
const [step, setStep] = (0, import_react13.useState)(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
7765
7859
|
const stepLabels = {
|
|
7766
7860
|
[ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
|
|
7767
7861
|
[ONBOARDING_STEPS.PROFILE_SETUP]: labels.onboarding.modal.stepProfileSetup,
|
|
7768
7862
|
[ONBOARDING_STEPS.CONNECT_ACCOUNTS]: labels.onboarding.modal.stepConnectAccounts
|
|
7769
7863
|
};
|
|
7770
7864
|
const resolvedTitle = (_a = stepLabels[step]) != null ? _a : labels.onboarding.modal.title;
|
|
7771
|
-
const [onchainModalOpen, setOnchainModalOpen] = (0,
|
|
7772
|
-
const [onchainConnected, setOnchainConnected] = (0,
|
|
7773
|
-
(0,
|
|
7865
|
+
const [onchainModalOpen, setOnchainModalOpen] = (0, import_react13.useState)(false);
|
|
7866
|
+
const [onchainConnected, setOnchainConnected] = (0, import_react13.useState)(false);
|
|
7867
|
+
(0, import_react13.useEffect)(() => {
|
|
7774
7868
|
if (open) {
|
|
7775
7869
|
setStep(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
7776
7870
|
setOnchainConnected(false);
|
|
7777
7871
|
}
|
|
7778
7872
|
}, [open]);
|
|
7779
|
-
const handleHowItWorksContinue = (0,
|
|
7873
|
+
const handleHowItWorksContinue = (0, import_react13.useCallback)(() => {
|
|
7780
7874
|
setStep(ONBOARDING_STEPS.PROFILE_SETUP);
|
|
7781
7875
|
}, []);
|
|
7782
|
-
const handleProfileContinue = (0,
|
|
7876
|
+
const handleProfileContinue = (0, import_react13.useCallback)(
|
|
7783
7877
|
(data) => {
|
|
7784
7878
|
onProfileSubmit == null ? void 0 : onProfileSubmit(data);
|
|
7785
7879
|
setStep(ONBOARDING_STEPS.CONNECT_ACCOUNTS);
|
|
7786
7880
|
},
|
|
7787
7881
|
[onProfileSubmit]
|
|
7788
7882
|
);
|
|
7789
|
-
const handleConnectContinue = (0,
|
|
7883
|
+
const handleConnectContinue = (0, import_react13.useCallback)(() => {
|
|
7790
7884
|
onComplete == null ? void 0 : onComplete();
|
|
7791
7885
|
}, [onComplete]);
|
|
7792
|
-
const handleOpenOnchainModal = (0,
|
|
7886
|
+
const handleOpenOnchainModal = (0, import_react13.useCallback)(() => {
|
|
7793
7887
|
setOnchainModalOpen(true);
|
|
7794
7888
|
}, []);
|
|
7795
|
-
const handleOnchainConnect = (0,
|
|
7889
|
+
const handleOnchainConnect = (0, import_react13.useCallback)(() => __async(null, null, function* () {
|
|
7796
7890
|
yield onConnectOnchain == null ? void 0 : onConnectOnchain();
|
|
7797
7891
|
setOnchainConnected(true);
|
|
7798
7892
|
}), [onConnectOnchain]);
|
|
7799
|
-
return /* @__PURE__ */ (0,
|
|
7800
|
-
/* @__PURE__ */ (0,
|
|
7893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [
|
|
7894
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
7801
7895
|
Modal.Container,
|
|
7802
7896
|
{
|
|
7803
7897
|
maxWidth: "600px",
|
|
7804
7898
|
"aria-label": resolvedTitle,
|
|
7805
7899
|
classNames: { container: "!rounded-agg-lg" },
|
|
7806
7900
|
children: [
|
|
7807
|
-
/* @__PURE__ */ (0,
|
|
7808
|
-
/* @__PURE__ */ (0,
|
|
7809
|
-
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ (0,
|
|
7810
|
-
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ (0,
|
|
7811
|
-
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ (0,
|
|
7901
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Dialog4.Title, { className: "sr-only", children: resolvedTitle }),
|
|
7902
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(Modal.Body, { classNames: { root: "px-5 py-6 sm:px-10 sm:py-8" }, children: [
|
|
7903
|
+
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(HowItWorksStep, { onContinue: handleHowItWorksContinue, icons: howItWorksIcons }),
|
|
7904
|
+
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(ProfileSetupStep, { onContinue: handleProfileContinue }),
|
|
7905
|
+
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
7812
7906
|
ConnectAccountsStep,
|
|
7813
7907
|
{
|
|
7814
7908
|
onConnectOnchain: handleOpenOnchainModal,
|
|
@@ -7820,7 +7914,7 @@ var OnboardingModal = ({
|
|
|
7820
7914
|
]
|
|
7821
7915
|
}
|
|
7822
7916
|
) }),
|
|
7823
|
-
/* @__PURE__ */ (0,
|
|
7917
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
7824
7918
|
ConnectOnchainModal,
|
|
7825
7919
|
{
|
|
7826
7920
|
open: onchainModalOpen,
|
|
@@ -7832,98 +7926,6 @@ var OnboardingModal = ({
|
|
|
7832
7926
|
};
|
|
7833
7927
|
OnboardingModal.displayName = "OnboardingModal";
|
|
7834
7928
|
|
|
7835
|
-
// src/notifications/agg-notification-events-provider.tsx
|
|
7836
|
-
var import_hooks35 = require("@agg-build/hooks");
|
|
7837
|
-
var import_react13 = require("react");
|
|
7838
|
-
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
7839
|
-
var firedOrderNotificationKeys = /* @__PURE__ */ new Set();
|
|
7840
|
-
var MICRO_UNITS_SCALE = 1e6;
|
|
7841
|
-
var formatScaledMicroAmount = (value) => {
|
|
7842
|
-
if (!value) return void 0;
|
|
7843
|
-
if (value.includes(".")) {
|
|
7844
|
-
const parsed = Number(value);
|
|
7845
|
-
if (!Number.isFinite(parsed)) return void 0;
|
|
7846
|
-
return parsed.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
7847
|
-
}
|
|
7848
|
-
try {
|
|
7849
|
-
const raw = BigInt(value);
|
|
7850
|
-
const whole = raw / BigInt(MICRO_UNITS_SCALE);
|
|
7851
|
-
const remainder = raw % BigInt(MICRO_UNITS_SCALE);
|
|
7852
|
-
const parsed = Number(whole) + Number(remainder) / MICRO_UNITS_SCALE;
|
|
7853
|
-
return parsed.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
7854
|
-
} catch (e) {
|
|
7855
|
-
const parsed = Number(value);
|
|
7856
|
-
if (!Number.isFinite(parsed)) return void 0;
|
|
7857
|
-
return (parsed / MICRO_UNITS_SCALE).toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
7858
|
-
}
|
|
7859
|
-
};
|
|
7860
|
-
var formatPriceCents = (value) => {
|
|
7861
|
-
if (!value) return void 0;
|
|
7862
|
-
const parsed = Number(value);
|
|
7863
|
-
if (!Number.isFinite(parsed)) return void 0;
|
|
7864
|
-
const cents = parsed * 100;
|
|
7865
|
-
const display2 = cents.toLocaleString("en-US", {
|
|
7866
|
-
minimumFractionDigits: 0,
|
|
7867
|
-
maximumFractionDigits: 1
|
|
7868
|
-
});
|
|
7869
|
-
return `${display2}\xA2`;
|
|
7870
|
-
};
|
|
7871
|
-
var formatSharesLabel = (raw) => {
|
|
7872
|
-
const formatted = formatScaledMicroAmount(raw);
|
|
7873
|
-
if (!formatted) return void 0;
|
|
7874
|
-
return `${formatted} shares`;
|
|
7875
|
-
};
|
|
7876
|
-
var capitalize = (value) => {
|
|
7877
|
-
if (!value) return void 0;
|
|
7878
|
-
return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
7879
|
-
};
|
|
7880
|
-
var venueLabelFor = (venueKey, labels) => {
|
|
7881
|
-
var _a;
|
|
7882
|
-
if (!venueKey) return void 0;
|
|
7883
|
-
const normalized = venueKey.toLowerCase();
|
|
7884
|
-
const lookup = labels.venues;
|
|
7885
|
-
return (_a = lookup[normalized]) != null ? _a : capitalize(venueKey);
|
|
7886
|
-
};
|
|
7887
|
-
function handleOrderEvent({ event, labels, fireOnce }) {
|
|
7888
|
-
var _a, _b;
|
|
7889
|
-
const venueLabel = venueLabelFor(event.venue, labels);
|
|
7890
|
-
const amountLabel = formatSharesLabel((_a = event.actualSharesRaw) != null ? _a : event.filledAmountRaw);
|
|
7891
|
-
const priceLabel = formatPriceCents((_b = event.executionPriceRaw) != null ? _b : event.quotedPriceRaw);
|
|
7892
|
-
const fireOrderOnce = (key, tone, title2, message, detail) => {
|
|
7893
|
-
if (firedOrderNotificationKeys.has(key)) return;
|
|
7894
|
-
firedOrderNotificationKeys.add(key);
|
|
7895
|
-
fireOnce(key, tone, title2, message, detail);
|
|
7896
|
-
};
|
|
7897
|
-
if (event.event === "filled") {
|
|
7898
|
-
fireOrderOnce(
|
|
7899
|
-
`order:${event.orderId}:filled`,
|
|
7900
|
-
"success",
|
|
7901
|
-
labels.notifications.order.filledTitle,
|
|
7902
|
-
labels.notifications.order.filledMessage({ venueLabel, amountLabel, priceLabel })
|
|
7903
|
-
);
|
|
7904
|
-
return;
|
|
7905
|
-
}
|
|
7906
|
-
if (event.event === "partial_fill") {
|
|
7907
|
-
fireOrderOnce(
|
|
7908
|
-
`order:${event.orderId}:partial_fill`,
|
|
7909
|
-
"warning",
|
|
7910
|
-
labels.notifications.order.partialFilledTitle,
|
|
7911
|
-
labels.notifications.order.partialFilledMessage({ venueLabel, amountLabel, priceLabel })
|
|
7912
|
-
);
|
|
7913
|
-
return;
|
|
7914
|
-
}
|
|
7915
|
-
if (event.event === "failed") {
|
|
7916
|
-
fireOrderOnce(
|
|
7917
|
-
`order:${event.orderId}:failed`,
|
|
7918
|
-
"error",
|
|
7919
|
-
labels.notifications.order.failedTitle,
|
|
7920
|
-
labels.notifications.order.failedMessage(event.errorReason),
|
|
7921
|
-
venueLabel
|
|
7922
|
-
);
|
|
7923
|
-
}
|
|
7924
|
-
}
|
|
7925
|
-
var CLIENT_DEPOSIT_ACTIVITY_SUPPRESSION_MS = 2 * 60 * 1e3;
|
|
7926
|
-
|
|
7927
7929
|
// src/shared/deposit-modal-events.ts
|
|
7928
7930
|
var DEPOSIT_MODAL_OPEN_EVENT = "agg-deposit:open-modal";
|
|
7929
7931
|
var requestAggDepositModalOpen = () => {
|
|
@@ -8009,6 +8011,7 @@ var MIN_SELL_ORDER_SHARES = 1;
|
|
|
8009
8011
|
var DEFAULT_SLIPPAGE_VALUE = "0.5";
|
|
8010
8012
|
var HIGH_SLIPPAGE_THRESHOLD = 10;
|
|
8011
8013
|
var PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT = 3;
|
|
8014
|
+
var PLACE_ORDER_MAXIMIZE_PAYOUT_ROUTE_ID = "live-maximize-payout";
|
|
8012
8015
|
var PLACE_ORDER_NUMERIC_INPUT_CLASS_NAME = "bg-transparent text-right text-agg-3xl font-agg-bold leading-agg-9 tracking-agg-normal text-agg-foreground outline-none";
|
|
8013
8016
|
var PLACE_ORDER_CONTAINER_CLASS_NAME = "w-full overflow-hidden rounded-agg-xl border border-agg-separator bg-agg-secondary shadow-none hover:shadow-none";
|
|
8014
8017
|
var PLACE_ORDER_OUTCOME_BUTTON_CLASS_NAMES = {
|
|
@@ -8483,6 +8486,29 @@ var routePriceLabelFormatter = new Intl.NumberFormat("en-US", {
|
|
|
8483
8486
|
maximumFractionDigits: 1
|
|
8484
8487
|
});
|
|
8485
8488
|
var GEO_BLOCK_WARNING_PREFIX = "Venue not available in your region";
|
|
8489
|
+
var floorToDecimals = (value, decimals) => {
|
|
8490
|
+
if (!Number.isFinite(value) || value <= 0) return 0;
|
|
8491
|
+
const [coefficient = "0", exponentText = "0"] = value.toString().toLowerCase().split("e");
|
|
8492
|
+
const [whole = "0", fraction = ""] = coefficient.split(".");
|
|
8493
|
+
const exponent = Number(exponentText);
|
|
8494
|
+
const digits = `${whole}${fraction}`;
|
|
8495
|
+
const decimalIndex = whole.length + exponent;
|
|
8496
|
+
const normalized = decimalIndex <= 0 ? `0.${"0".repeat(-decimalIndex)}${digits}` : decimalIndex >= digits.length ? `${digits}${"0".repeat(decimalIndex - digits.length)}` : `${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`;
|
|
8497
|
+
const [normalizedWhole = "0", normalizedFraction = ""] = normalized.split(".");
|
|
8498
|
+
const truncatedFraction = normalizedFraction.slice(0, decimals);
|
|
8499
|
+
return Number(
|
|
8500
|
+
truncatedFraction.length > 0 ? `${normalizedWhole}.${truncatedFraction}` : normalizedWhole
|
|
8501
|
+
);
|
|
8502
|
+
};
|
|
8503
|
+
var formatFlooredShareAmount = (value, decimals) => {
|
|
8504
|
+
const flooredValue = floorToDecimals(value, decimals);
|
|
8505
|
+
if (flooredValue <= 0) return "0";
|
|
8506
|
+
const formattedValue = flooredValue.toLocaleString("en-US", {
|
|
8507
|
+
minimumFractionDigits: 0,
|
|
8508
|
+
maximumFractionDigits: decimals
|
|
8509
|
+
});
|
|
8510
|
+
return formattedValue.replace(/(\.\d*?[1-9])0+$/u, "$1").replace(/\.0+$/u, "");
|
|
8511
|
+
};
|
|
8486
8512
|
var normalizeOutcomeName = (value) => {
|
|
8487
8513
|
var _a;
|
|
8488
8514
|
return (_a = value == null ? void 0 : value.trim().toLowerCase()) != null ? _a : "";
|
|
@@ -8632,18 +8658,24 @@ var mapVenueMarketOutcomesToPlaceOrderOutcomes = (venueMarketOutcomes) => {
|
|
|
8632
8658
|
};
|
|
8633
8659
|
});
|
|
8634
8660
|
};
|
|
8635
|
-
var mapQuoteDataToRoutingRows = (quoteData) => {
|
|
8661
|
+
var mapQuoteDataToRoutingRows = (quoteData, tradeSide = "buy") => {
|
|
8636
8662
|
if (!(quoteData == null ? void 0 : quoteData.fills.length)) return [];
|
|
8637
|
-
return quoteData.fills.map((fill) =>
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8663
|
+
return quoteData.fills.map((fill) => {
|
|
8664
|
+
const allocationValueLabel = getTradingValueLabel(__spreadValues({
|
|
8665
|
+
amount: fill.venueQty * fill.avgPrice
|
|
8666
|
+
}, tradeSide === "sell" ? { minimumFractionDigits: 2, maximumFractionDigits: 2 } : {}));
|
|
8667
|
+
const allocationSharesLabel = `${formatFlooredShareAmount(fill.venueQty, 2)} shares`;
|
|
8668
|
+
return {
|
|
8669
|
+
venue: fill.venue,
|
|
8670
|
+
label: tradeSide === "sell" ? allocationSharesLabel : allocationValueLabel,
|
|
8671
|
+
priceLabel: getTradingRoutePriceLabel(fill.avgPrice),
|
|
8672
|
+
resultLabel: tradeSide === "sell" ? allocationValueLabel : getTradingValueLabel({
|
|
8673
|
+
amount: fill.venueQty,
|
|
8674
|
+
minimumFractionDigits: 2,
|
|
8675
|
+
maximumFractionDigits: 2
|
|
8676
|
+
})
|
|
8677
|
+
};
|
|
8678
|
+
});
|
|
8647
8679
|
};
|
|
8648
8680
|
var deriveAggregateOrderStatus = (orderIds, terminalEvents) => {
|
|
8649
8681
|
if (!orderIds.length) return "pending";
|
|
@@ -8822,7 +8854,8 @@ var buildLiveRouteCards = ({
|
|
|
8822
8854
|
),
|
|
8823
8855
|
numericValue: tradeSide === "sell" ? quoteData.rawExecCost : quoteData.totalFilled,
|
|
8824
8856
|
quoteData,
|
|
8825
|
-
rows: mapQuoteDataToRoutingRows(quoteData),
|
|
8857
|
+
rows: mapQuoteDataToRoutingRows(quoteData, tradeSide),
|
|
8858
|
+
description: labels.splitOrderDescription,
|
|
8826
8859
|
value: primaryResult.value,
|
|
8827
8860
|
venue: isSplit ? void 0 : parsedPrimaryVenue.success ? parsedPrimaryVenue.data : void 0
|
|
8828
8861
|
} : null;
|
|
@@ -8956,6 +8989,9 @@ var clampSellSharesToAvailability = (requestedSellShares, availableShares) => {
|
|
|
8956
8989
|
requestedAtomicShares < availableAtomicShares ? requestedAtomicShares : availableAtomicShares
|
|
8957
8990
|
);
|
|
8958
8991
|
};
|
|
8992
|
+
var hasInsufficientVenueInventory = (requestedSellShares, availableShares) => {
|
|
8993
|
+
return sellSharesToAtomicUnits(requestedSellShares) > sellSharesToAtomicUnits(availableShares);
|
|
8994
|
+
};
|
|
8959
8995
|
var getRemainingVenueSellShares = (availableShares, filledShares) => {
|
|
8960
8996
|
const availableAtomicShares = sellSharesToAtomicUnits(availableShares);
|
|
8961
8997
|
const filledAtomicShares = sellSharesToAtomicUnits(filledShares);
|
|
@@ -8992,12 +9028,37 @@ var buildVenueSellQuoteRequests = ({
|
|
|
8992
9028
|
};
|
|
8993
9029
|
var buildLiveSellRouteCards = ({
|
|
8994
9030
|
labels,
|
|
9031
|
+
requestedSellShares,
|
|
8995
9032
|
smartQuoteData,
|
|
8996
9033
|
venueQuotes,
|
|
8997
9034
|
eventVenues = [],
|
|
8998
9035
|
geoBlockedVenues
|
|
8999
9036
|
}) => {
|
|
9000
9037
|
var _a;
|
|
9038
|
+
const availabilityRequests = buildVenueSellQuoteRequests({
|
|
9039
|
+
quoteData: smartQuoteData,
|
|
9040
|
+
requestedSellShares
|
|
9041
|
+
});
|
|
9042
|
+
const availabilityRequestByVenue = new Map(
|
|
9043
|
+
availabilityRequests.map((request) => [request.venue, request])
|
|
9044
|
+
);
|
|
9045
|
+
const decorateVenueCard = (card, request) => {
|
|
9046
|
+
if (card.kind !== "venue" || !card.venue || !request) return card;
|
|
9047
|
+
const executionPrice = card.quoteData.totalFilled > 0 ? card.quoteData.rawExecCost / card.quoteData.totalFilled : void 0;
|
|
9048
|
+
const insufficientInventory = hasInsufficientVenueInventory(
|
|
9049
|
+
requestedSellShares,
|
|
9050
|
+
request.availableShares
|
|
9051
|
+
);
|
|
9052
|
+
const sharesLabel = labels.shares(floorToDecimals(request.availableShares, 2));
|
|
9053
|
+
const priceLabel = executionPrice == null ? "\u2014" : getTradingRoutePriceLabel(executionPrice);
|
|
9054
|
+
return __spreadProps(__spreadValues({}, card), {
|
|
9055
|
+
availableShares: request.availableShares,
|
|
9056
|
+
executionPrice,
|
|
9057
|
+
hint: card.isUnavailable ? card.hint : insufficientInventory ? labels.insufficientVenueInventory(sharesLabel, priceLabel) : labels.venueInventory(sharesLabel, priceLabel),
|
|
9058
|
+
id: `live-solo-${card.venue}`,
|
|
9059
|
+
insufficientInventory
|
|
9060
|
+
});
|
|
9061
|
+
};
|
|
9001
9062
|
const smartRouteCards = smartQuoteData ? buildLiveRouteCards({
|
|
9002
9063
|
labels,
|
|
9003
9064
|
quoteData: __spreadProps(__spreadValues({}, smartQuoteData), {
|
|
@@ -9006,12 +9067,25 @@ var buildLiveSellRouteCards = ({
|
|
|
9006
9067
|
tradeSide: "sell",
|
|
9007
9068
|
eventVenues,
|
|
9008
9069
|
geoBlockedVenues
|
|
9070
|
+
}).map((card) => {
|
|
9071
|
+
if (card.kind === "split") {
|
|
9072
|
+
return __spreadProps(__spreadValues({}, card), {
|
|
9073
|
+
description: labels.maximizePayoutDescription,
|
|
9074
|
+
id: PLACE_ORDER_MAXIMIZE_PAYOUT_ROUTE_ID,
|
|
9075
|
+
label: labels.maximizePayout
|
|
9076
|
+
});
|
|
9077
|
+
}
|
|
9078
|
+
return decorateVenueCard(
|
|
9079
|
+
card,
|
|
9080
|
+
card.venue ? availabilityRequestByVenue.get(card.venue) : void 0
|
|
9081
|
+
);
|
|
9009
9082
|
}) : [];
|
|
9010
9083
|
const smartRouteVenue = (smartQuoteData == null ? void 0 : smartQuoteData.status) === "ok" && smartQuoteData.fills.length === 1 ? parseVenue((_a = smartQuoteData.fills[0]) == null ? void 0 : _a.venue) : null;
|
|
9011
9084
|
const independentVenueCards = /* @__PURE__ */ new Map();
|
|
9012
9085
|
for (const venueQuote of venueQuotes) {
|
|
9013
9086
|
const quoteData = venueQuote.quoteData;
|
|
9014
|
-
|
|
9087
|
+
const { venue } = venueQuote.request;
|
|
9088
|
+
if (!(quoteData == null ? void 0 : quoteData.quoteId) || quoteData.status !== "ok" || quoteData.fills.length === 0 || quoteData.fills.some((fill) => fill.venue !== venue) || (smartRouteVenue == null ? void 0 : smartRouteVenue.success) && smartRouteVenue.data === venue) {
|
|
9015
9089
|
continue;
|
|
9016
9090
|
}
|
|
9017
9091
|
const [venueCard] = buildLiveRouteCards({
|
|
@@ -9022,17 +9096,17 @@ var buildLiveSellRouteCards = ({
|
|
|
9022
9096
|
tradeSide: "sell",
|
|
9023
9097
|
geoBlockedVenues
|
|
9024
9098
|
});
|
|
9025
|
-
if (!venueCard || venueCard.kind !== "venue" || venueCard.venue !==
|
|
9099
|
+
if (!venueCard || venueCard.kind !== "venue" || venueCard.venue !== venue) {
|
|
9026
9100
|
continue;
|
|
9027
9101
|
}
|
|
9028
|
-
independentVenueCards.set(
|
|
9029
|
-
id: `live-solo-${venueQuote.venue}`
|
|
9030
|
-
}));
|
|
9102
|
+
independentVenueCards.set(venue, decorateVenueCard(venueCard, venueQuote.request));
|
|
9031
9103
|
}
|
|
9032
9104
|
const deduplicatedSmartRouteCards = smartRouteCards.filter(
|
|
9033
9105
|
(card) => !card.venue || !independentVenueCards.has(card.venue)
|
|
9034
9106
|
);
|
|
9035
9107
|
return [...deduplicatedSmartRouteCards, ...independentVenueCards.values()].sort((left, right) => {
|
|
9108
|
+
if (left.id === PLACE_ORDER_MAXIMIZE_PAYOUT_ROUTE_ID) return -1;
|
|
9109
|
+
if (right.id === PLACE_ORDER_MAXIMIZE_PAYOUT_ROUTE_ID) return 1;
|
|
9036
9110
|
if (!!left.isUnavailable !== !!right.isUnavailable) {
|
|
9037
9111
|
return left.isUnavailable ? 1 : -1;
|
|
9038
9112
|
}
|
|
@@ -10093,29 +10167,6 @@ PlaceOrderSuccessView.displayName = "PlaceOrderSuccessView";
|
|
|
10093
10167
|
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
10094
10168
|
var SELL_SHARE_INPUT_DECIMALS = 6;
|
|
10095
10169
|
var SELL_SHARE_DISPLAY_DECIMALS = 2;
|
|
10096
|
-
var floorToDecimals = (value, decimals) => {
|
|
10097
|
-
if (!Number.isFinite(value) || value <= 0) return 0;
|
|
10098
|
-
const [coefficient = "0", exponentText = "0"] = value.toString().toLowerCase().split("e");
|
|
10099
|
-
const [whole = "0", fraction = ""] = coefficient.split(".");
|
|
10100
|
-
const exponent = Number(exponentText);
|
|
10101
|
-
const digits = `${whole}${fraction}`;
|
|
10102
|
-
const decimalIndex = whole.length + exponent;
|
|
10103
|
-
const normalized = decimalIndex <= 0 ? `0.${"0".repeat(-decimalIndex)}${digits}` : decimalIndex >= digits.length ? `${digits}${"0".repeat(decimalIndex - digits.length)}` : `${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`;
|
|
10104
|
-
const [normalizedWhole = "0", normalizedFraction = ""] = normalized.split(".");
|
|
10105
|
-
const truncatedFraction = normalizedFraction.slice(0, decimals);
|
|
10106
|
-
return Number(
|
|
10107
|
-
truncatedFraction.length > 0 ? `${normalizedWhole}.${truncatedFraction}` : normalizedWhole
|
|
10108
|
-
);
|
|
10109
|
-
};
|
|
10110
|
-
var formatFlooredShareAmount = (value, decimals) => {
|
|
10111
|
-
const flooredValue = floorToDecimals(value, decimals);
|
|
10112
|
-
if (flooredValue <= 0) return "0";
|
|
10113
|
-
const formattedValue = flooredValue.toLocaleString("en-US", {
|
|
10114
|
-
minimumFractionDigits: 0,
|
|
10115
|
-
maximumFractionDigits: decimals
|
|
10116
|
-
});
|
|
10117
|
-
return formattedValue.replace(/(\.\d*?[1-9])0+$/u, "$1").replace(/\.0+$/u, "");
|
|
10118
|
-
};
|
|
10119
10170
|
var resolvePlaceOrderPortalContainer = (triggerElement) => {
|
|
10120
10171
|
var _a;
|
|
10121
10172
|
return (_a = triggerElement == null ? void 0 : triggerElement.closest(".agg-modal-center")) != null ? _a : void 0;
|
|
@@ -10673,7 +10724,7 @@ var renderRouteCard = ({
|
|
|
10673
10724
|
onSelect,
|
|
10674
10725
|
tradingLabels
|
|
10675
10726
|
}) => {
|
|
10676
|
-
var _a, _b;
|
|
10727
|
+
var _a, _b, _c;
|
|
10677
10728
|
const showSplitDetails = isSelected && isExpanded && card.kind === "split" && !!((_a = card.rows) == null ? void 0 : _a.length);
|
|
10678
10729
|
const ariaLabel = [card.label, card.hint, card.value].filter(Boolean).join(" ");
|
|
10679
10730
|
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
@@ -10728,6 +10779,14 @@ var renderRouteCard = ({
|
|
|
10728
10779
|
className: "shrink-0 text-agg-muted-foreground",
|
|
10729
10780
|
"aria-hidden": "true"
|
|
10730
10781
|
}
|
|
10782
|
+
) : card.insufficientInventory ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10783
|
+
Icon,
|
|
10784
|
+
{
|
|
10785
|
+
name: "warning",
|
|
10786
|
+
size: "xs",
|
|
10787
|
+
className: "shrink-0 text-agg-muted-foreground",
|
|
10788
|
+
"aria-hidden": "true"
|
|
10789
|
+
}
|
|
10731
10790
|
) : card.kind === "split" && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10732
10791
|
Icon,
|
|
10733
10792
|
{
|
|
@@ -10754,8 +10813,8 @@ var renderRouteCard = ({
|
|
|
10754
10813
|
)
|
|
10755
10814
|
] }),
|
|
10756
10815
|
showSplitDetails ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
|
|
10757
|
-
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-route-card-description text-agg-xs leading-agg-4 text-agg-foreground", children: tradingLabels.splitOrderDescription }),
|
|
10758
|
-
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "agg-route-breakdown flex flex-col gap-3", children: (
|
|
10816
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-route-card-description text-agg-xs leading-agg-4 text-agg-foreground", children: (_b = card.description) != null ? _b : tradingLabels.splitOrderDescription }),
|
|
10817
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "agg-route-breakdown flex flex-col gap-3", children: (_c = card.rows) == null ? void 0 : _c.map((row) => renderRouteBreakdownRow(row)) })
|
|
10759
10818
|
] }) : null
|
|
10760
10819
|
] })
|
|
10761
10820
|
}
|
|
@@ -11362,9 +11421,10 @@ var PlaceOrder = ({
|
|
|
11362
11421
|
eventVenues,
|
|
11363
11422
|
geoBlockedVenues: inheritedBuyGeoBlockedVenues,
|
|
11364
11423
|
labels: tradingLabels,
|
|
11424
|
+
requestedSellShares: debouncedAmount,
|
|
11365
11425
|
smartQuoteData: smartRoute.data,
|
|
11366
11426
|
venueQuotes: venueSellQuotes.quotes.map((venueQuote) => ({
|
|
11367
|
-
|
|
11427
|
+
request: venueQuote.request,
|
|
11368
11428
|
quoteData: venueQuote.data
|
|
11369
11429
|
}))
|
|
11370
11430
|
});
|
|
@@ -11376,6 +11436,7 @@ var PlaceOrder = ({
|
|
|
11376
11436
|
tradeSide: "buy"
|
|
11377
11437
|
}) : [];
|
|
11378
11438
|
}, [
|
|
11439
|
+
debouncedAmount,
|
|
11379
11440
|
smartRoute.data,
|
|
11380
11441
|
tradingLabels,
|
|
11381
11442
|
inheritedBuyGeoBlockedVenues,
|
|
@@ -11383,16 +11444,19 @@ var PlaceOrder = ({
|
|
|
11383
11444
|
scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venueMarkets,
|
|
11384
11445
|
venueSellQuotes.quotes
|
|
11385
11446
|
]);
|
|
11447
|
+
const isSellQuoteTransitioning = isSell && (isQuoteInputEditing || smartRoute.isLoading || smartRoute.isFetching || venueSellQuotes.isLoading || venueSellQuotes.isFetching);
|
|
11386
11448
|
const resolvedSelectedRouteCardId = (0, import_react16.useMemo)(() => {
|
|
11387
11449
|
var _a2;
|
|
11388
|
-
if (routeCards.length === 0) return null;
|
|
11389
11450
|
if (selectedRouteCardId && routeCards.some((card) => card.id === selectedRouteCardId && !card.isUnavailable)) {
|
|
11390
11451
|
return selectedRouteCardId;
|
|
11391
11452
|
}
|
|
11453
|
+
if (selectedRouteCardId && isSellQuoteTransitioning) return selectedRouteCardId;
|
|
11454
|
+
if (routeCards.length === 0) return null;
|
|
11392
11455
|
return resolveDefaultRouteCardId(routeCards, isSell ? void 0 : (_a2 = smartRoute.data) == null ? void 0 : _a2.status);
|
|
11393
|
-
}, [routeCards, selectedRouteCardId,
|
|
11456
|
+
}, [isSell, isSellQuoteTransitioning, routeCards, selectedRouteCardId, (_x = smartRoute.data) == null ? void 0 : _x.status]);
|
|
11394
11457
|
(0, import_react16.useEffect)(() => {
|
|
11395
11458
|
if (routeCards.length === 0) {
|
|
11459
|
+
if (isSellQuoteTransitioning) return;
|
|
11396
11460
|
setSelectedRouteCardId(null);
|
|
11397
11461
|
setIsRoutesExpanded(false);
|
|
11398
11462
|
setIsSplitDetailOpen(false);
|
|
@@ -11401,7 +11465,12 @@ var PlaceOrder = ({
|
|
|
11401
11465
|
if (resolvedSelectedRouteCardId !== selectedRouteCardId) {
|
|
11402
11466
|
setSelectedRouteCardId(resolvedSelectedRouteCardId);
|
|
11403
11467
|
}
|
|
11404
|
-
}, [
|
|
11468
|
+
}, [
|
|
11469
|
+
isSellQuoteTransitioning,
|
|
11470
|
+
resolvedSelectedRouteCardId,
|
|
11471
|
+
routeCards.length,
|
|
11472
|
+
selectedRouteCardId
|
|
11473
|
+
]);
|
|
11405
11474
|
const isSubmissionLocked = submissionProgressState != null;
|
|
11406
11475
|
const isSubmissionLockedRef = (0, import_react16.useRef)(isSubmissionLocked);
|
|
11407
11476
|
isSubmissionLockedRef.current = isSubmissionLocked;
|
|
@@ -11431,6 +11500,11 @@ var PlaceOrder = ({
|
|
|
11431
11500
|
(0, import_react16.useEffect)(() => {
|
|
11432
11501
|
setSelectedLimitVenue(null);
|
|
11433
11502
|
}, [scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id, scopedSelectedOutcomeId]);
|
|
11503
|
+
(0, import_react16.useEffect)(() => {
|
|
11504
|
+
setSelectedRouteCardId(null);
|
|
11505
|
+
setIsRoutesExpanded(false);
|
|
11506
|
+
setIsSplitDetailOpen(false);
|
|
11507
|
+
}, [executionType, internalTab, scopedSelectedOutcomeId]);
|
|
11434
11508
|
const orderedRouteCards = routeCards;
|
|
11435
11509
|
const selectedRouteCard = (_z = (_y = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _y : orderedRouteCards[0]) != null ? _z : null;
|
|
11436
11510
|
const isKalshiRoute = (0, import_react16.useMemo)(() => {
|
|
@@ -11479,16 +11553,33 @@ var PlaceOrder = ({
|
|
|
11479
11553
|
const verifyKalshiConnectionLabel = (_G = (_F = (_E = (_D = labels.onboarding) == null ? void 0 : _D.connectKalshiModal) == null ? void 0 : _E.actions) == null ? void 0 : _F.verifyConnection) != null ? _G : tradingLabels.kycRequired;
|
|
11480
11554
|
const handleRouteCardSelect = (0, import_react16.useCallback)(
|
|
11481
11555
|
(cardId) => {
|
|
11556
|
+
const card = routeCards.find((routeCard) => routeCard.id === cardId);
|
|
11557
|
+
if (!card || card.isUnavailable) return;
|
|
11482
11558
|
if (cardId === resolvedSelectedRouteCardId) {
|
|
11483
|
-
const card = routeCards.find((c) => c.id === cardId);
|
|
11484
11559
|
if ((card == null ? void 0 : card.kind) === "split") {
|
|
11485
11560
|
setIsSplitDetailOpen((prev) => !prev);
|
|
11486
11561
|
return;
|
|
11487
11562
|
}
|
|
11488
11563
|
}
|
|
11489
11564
|
setSelectedRouteCardId(cardId);
|
|
11565
|
+
setIsSplitDetailOpen(false);
|
|
11566
|
+
if (!isSell || card.kind !== "venue" || !card.insufficientInventory || card.availableShares == null) {
|
|
11567
|
+
return;
|
|
11568
|
+
}
|
|
11569
|
+
const clampedAmount = clampSellSharesToAvailability(internalAmount, card.availableShares);
|
|
11570
|
+
if (clampedAmount === internalAmount) return;
|
|
11571
|
+
setInternalAmount(clampedAmount);
|
|
11572
|
+
setSellFilledForOutcomeId(scopedSelectedOutcomeId != null ? scopedSelectedOutcomeId : null);
|
|
11573
|
+
onAmountChange == null ? void 0 : onAmountChange(clampedAmount);
|
|
11490
11574
|
},
|
|
11491
|
-
[
|
|
11575
|
+
[
|
|
11576
|
+
internalAmount,
|
|
11577
|
+
isSell,
|
|
11578
|
+
onAmountChange,
|
|
11579
|
+
resolvedSelectedRouteCardId,
|
|
11580
|
+
routeCards,
|
|
11581
|
+
scopedSelectedOutcomeId
|
|
11582
|
+
]
|
|
11492
11583
|
);
|
|
11493
11584
|
const executionProgress = (0, import_hooks37.useExecutionProgress)({
|
|
11494
11585
|
orderIds: (_H = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _H : null,
|
|
@@ -11800,7 +11891,7 @@ var PlaceOrder = ({
|
|
|
11800
11891
|
const activeQuoteData = isLimitOrder ? null : (_T = (_S = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _S : smartRoute.data) != null ? _T : null;
|
|
11801
11892
|
const visibleMarketRouteCards = orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? orderedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : orderedRouteCards;
|
|
11802
11893
|
const hasEnteredAmount = internalAmount > 0;
|
|
11803
|
-
const isQuoteLoading = !isLimitOrder && hasEnteredAmount && (
|
|
11894
|
+
const isQuoteLoading = !isLimitOrder && hasEnteredAmount && (isSell && isQuoteInputEditing || smartRoute.isLoading || !isSell && smartRoute.isFetching || isSell && venueSellQuotes.isLoading);
|
|
11804
11895
|
const routeLoadingMessage = isQuoteLoading ? smartRoute.loadingReason === "updating-route" ? tradingLabels.updatingRoute : smartRoute.loadingReason === "refreshing-quotes" ? tradingLabels.refreshingQuotes : tradingLabels.findingBestOdds : null;
|
|
11805
11896
|
const selectedRouteFills = (_U = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _U : [];
|
|
11806
11897
|
const isKalshiOnlyRoute = isKalshiRoute && ((selectedRouteCard == null ? void 0 : selectedRouteCard.venue) === import_sdk17.Venue.kalshi || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue === import_sdk17.Venue.kalshi));
|
|
@@ -11814,6 +11905,7 @@ var PlaceOrder = ({
|
|
|
11814
11905
|
const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > totalBalance : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isOnchainBalanceInsufficient);
|
|
11815
11906
|
const isQuoteInsufficientBalance = !isLimitOrder && (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
|
|
11816
11907
|
const shouldShowInsufficientBalanceAlert = isInsufficientBalance || isQuoteInsufficientBalance;
|
|
11908
|
+
const isSelectedVenueInventoryInsufficient = isSell && (selectedRouteCard == null ? void 0 : selectedRouteCard.kind) === "venue" && selectedRouteCard.insufficientInventory === true;
|
|
11817
11909
|
const isBelowClientMinimum = !isSell && hasEnteredAmount && internalAmount < MIN_BUY_ORDER_AMOUNT;
|
|
11818
11910
|
const isBelowVenueMinimumFromQuote = isQuoteBelowVenueMinimum(activeQuoteData);
|
|
11819
11911
|
const isBelowMinimum = isBelowClientMinimum || isBelowVenueMinimumFromQuote;
|
|
@@ -11895,13 +11987,10 @@ var PlaceOrder = ({
|
|
|
11895
11987
|
tradingLabels
|
|
11896
11988
|
]);
|
|
11897
11989
|
const displayedToWinHint = (0, import_react16.useMemo)(() => {
|
|
11898
|
-
var _a2
|
|
11990
|
+
var _a2;
|
|
11899
11991
|
if (!selectedRouteCard) return "";
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
return avgPrice != null ? tradingLabels.averagePrice(avgPrice) : "";
|
|
11903
|
-
}
|
|
11904
|
-
return (_d2 = selectedRouteCard.hint) != null ? _d2 : "";
|
|
11992
|
+
const averagePrice = selectedRouteCard.quoteData.totalFilled > 0 ? selectedRouteCard.quoteData.rawExecCost / selectedRouteCard.quoteData.totalFilled : (_a2 = selectedRouteCard.quoteData.fills[0]) == null ? void 0 : _a2.avgPrice;
|
|
11993
|
+
return averagePrice == null ? "" : tradingLabels.averagePrice(averagePrice);
|
|
11905
11994
|
}, [selectedRouteCard, tradingLabels]);
|
|
11906
11995
|
const displayedToWinValue = (_W = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _W : 0;
|
|
11907
11996
|
const limitOrderPayload = (0, import_react16.useMemo)(() => {
|
|
@@ -12099,7 +12188,7 @@ var PlaceOrder = ({
|
|
|
12099
12188
|
const shouldShowGeoBlockBanner = isTradingBlocked || selectedRouteGeoBlocked || isPrimaryVenueGeoBlocked || isLimitOrder && limitRouteCards.length > 0 && limitRouteCards.every((card) => card.isUnavailable);
|
|
12100
12189
|
const shouldShowLowLiquidityWarning = !isQuoteInputEditing && !isQuoteLoading && (activeQuoteData == null ? void 0 : activeQuoteData.venueMarketOutcomeId) === scopedSelectedOutcomeId && hasLowLiquidityWarning(activeQuoteData.warnings);
|
|
12101
12190
|
const actionLabel = `${internalTab === "buy" ? tradingLabels.buy : tradingLabels.sell} ${selectedOutcomeLabel}`.trim();
|
|
12102
|
-
const isActionDisabled = isPrimaryActionDisabled || !orderEligibility.canPlaceOrder || isActionLoading || !hasEnteredAmount || !scopedSelectedMarket || isInsufficientBalance || isQuoteInsufficientBalance || isSell && isQuoteInputEditing || isSellAmountAboveAvailability || isBelowMinimum || !isLimitOrder && isQuoteLoading || (isLimitOrder ? !limitOrderPayload : !selectedRouteCard || !selectedRouteCard.quoteData.quoteId) || selectedRouteGeoBlocked || !isAuthenticated || !isLimitOrder && quoteStatus !== void 0;
|
|
12191
|
+
const isActionDisabled = isPrimaryActionDisabled || !orderEligibility.canPlaceOrder || isActionLoading || !hasEnteredAmount || !scopedSelectedMarket || isInsufficientBalance || isQuoteInsufficientBalance || isSell && isQuoteInputEditing || isSellAmountAboveAvailability || isBelowMinimum || !isLimitOrder && isQuoteLoading || isSelectedVenueInventoryInsufficient || (isLimitOrder ? !limitOrderPayload : !selectedRouteCard || !selectedRouteCard.quoteData.quoteId) || selectedRouteGeoBlocked || !isAuthenticated || !isLimitOrder && quoteStatus !== void 0;
|
|
12103
12192
|
const shouldShowSmartRouting = orderEligibility.canPlaceOrder && hasEnteredAmount && !isBelowMinimum && (isLimitOrder ? limitRouteCards.length > 0 : orderedRouteCards.length > 0 || smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
|
|
12104
12193
|
const shouldShowRouteToggle = !isLimitOrder && !isQuoteLoading && orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT;
|
|
12105
12194
|
const handleReturnToOrderForm = (0, import_react16.useCallback)(() => {
|
|
@@ -12439,16 +12528,20 @@ var PlaceOrder = ({
|
|
|
12439
12528
|
}
|
|
12440
12529
|
const refreshedCards = selectedVenueQuote ? buildLiveSellRouteCards({
|
|
12441
12530
|
labels: tradingLabels,
|
|
12531
|
+
requestedSellShares: retryAmount,
|
|
12442
12532
|
smartQuoteData: null,
|
|
12443
12533
|
venueQuotes: [
|
|
12444
12534
|
{
|
|
12445
|
-
|
|
12535
|
+
request: __spreadProps(__spreadValues({}, selectedVenueQuote.request), {
|
|
12536
|
+
sellShares: retryAmount
|
|
12537
|
+
}),
|
|
12446
12538
|
quoteData: refetchedQuoteData
|
|
12447
12539
|
}
|
|
12448
12540
|
]
|
|
12449
12541
|
}) : isSell ? buildLiveSellRouteCards({
|
|
12450
12542
|
eventVenues: scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venueMarkets.map((market) => market.venue),
|
|
12451
12543
|
labels: tradingLabels,
|
|
12544
|
+
requestedSellShares: retryAmount,
|
|
12452
12545
|
smartQuoteData: refetchedQuoteData,
|
|
12453
12546
|
venueQuotes: []
|
|
12454
12547
|
}) : buildLiveRouteCards({
|
|
@@ -12581,6 +12674,8 @@ var PlaceOrder = ({
|
|
|
12581
12674
|
const handleFillSellableShares = () => {
|
|
12582
12675
|
if (!isSell) return;
|
|
12583
12676
|
if (maxSellableShares <= 0) return;
|
|
12677
|
+
setSelectedRouteCardId(PLACE_ORDER_MAXIMIZE_PAYOUT_ROUTE_ID);
|
|
12678
|
+
setIsSplitDetailOpen(false);
|
|
12584
12679
|
handleAmountChange(maxSellableShares);
|
|
12585
12680
|
};
|
|
12586
12681
|
const handleExecutionTypeChange = (nextType) => {
|