@agg-build/ui 4.22.6 → 4.24.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.
Files changed (31) hide show
  1. package/dist/{chunk-CKHECAKV.mjs → chunk-7ORC3TUJ.mjs} +398 -239
  2. package/dist/{chunk-RCO424WO.mjs → chunk-G4KXZ5XX.mjs} +63 -66
  3. package/dist/{chunk-NV6WT3TN.mjs → chunk-HZXHDH6G.mjs} +153 -45
  4. package/dist/{chunk-H54RU7NF.mjs → chunk-MDCFCGA3.mjs} +6 -3
  5. package/dist/{chunk-SGXFMBJM.mjs → chunk-Q5NJCH5O.mjs} +19 -7
  6. package/dist/{chunk-UXLC3FFY.mjs → chunk-W2LCFCW3.mjs} +1 -1
  7. package/dist/{chunk-JR2XAAK6.mjs → chunk-YYGS6S7N.mjs} +5 -2
  8. package/dist/{event-market-J35IWO2I.mjs → event-market-YBWA2HRJ.mjs} +4 -4
  9. package/dist/events.js +10 -4
  10. package/dist/events.mjs +2 -2
  11. package/dist/index.js +2688 -2395
  12. package/dist/index.mjs +9 -7
  13. package/dist/modals.js +512 -352
  14. package/dist/modals.mjs +4 -2
  15. package/dist/pages.js +2234 -1943
  16. package/dist/pages.mjs +6 -6
  17. package/dist/styles.css +1 -1
  18. package/dist/tailwind.css +1 -1
  19. package/dist/trading.js +1139 -874
  20. package/dist/trading.mjs +2 -2
  21. package/dist/types/onboarding/index.d.mts +1 -0
  22. package/dist/types/onboarding/index.d.ts +1 -0
  23. package/dist/types/onboarding/steps/connect-novig-modal.d.mts +12 -0
  24. package/dist/types/onboarding/steps/connect-novig-modal.d.ts +12 -0
  25. package/dist/types/pages/event-market/sports-markets.d.mts +3 -1
  26. package/dist/types/pages/event-market/sports-markets.d.ts +3 -1
  27. package/dist/types/pages/user-profile/components/available-balance-card.d.mts +1 -2
  28. package/dist/types/pages/user-profile/components/available-balance-card.d.ts +1 -2
  29. package/dist/types/trading/place-order/index.place-order.utils.d.mts +7 -0
  30. package/dist/types/trading/place-order/index.place-order.utils.d.ts +7 -0
  31. package/package.json +3 -3
package/dist/trading.js CHANGED
@@ -109,7 +109,7 @@ __export(trading_exports, {
109
109
  prepareSettlementDifferences: () => prepareSettlementDifferences,
110
110
  resolveDifferenceIconClassName: () => resolveDifferenceIconClassName,
111
111
  useClaimWinnings: () => useClaimWinnings,
112
- useEventTradingContext: () => import_hooks52.useEventTradingContext,
112
+ useEventTradingContext: () => import_hooks53.useEventTradingContext,
113
113
  useResolvedMarketClaim: () => useResolvedMarketClaim,
114
114
  venueRequiresSharedKyc: () => venueRequiresSharedKyc
115
115
  });
@@ -6200,14 +6200,14 @@ var SettlementDetailsContent = ({
6200
6200
  SettlementDetails.displayName = "SettlementDetails";
6201
6201
 
6202
6202
  // src/trading/place-order/index.tsx
6203
- var import_hooks51 = require("@agg-build/hooks");
6204
- var import_sdk22 = require("@agg-build/sdk");
6205
- var import_react25 = __toESM(require("@number-flow/react"));
6203
+ var import_hooks52 = require("@agg-build/hooks");
6204
+ var import_sdk23 = require("@agg-build/sdk");
6205
+ var import_react26 = __toESM(require("@number-flow/react"));
6206
6206
  var Popover = __toESM(require("@radix-ui/react-popover"));
6207
6207
  var import_dayjs5 = __toESM(require("dayjs"));
6208
6208
  var import_timezone2 = __toESM(require("dayjs/plugin/timezone"));
6209
6209
  var import_utc2 = __toESM(require("dayjs/plugin/utc"));
6210
- var import_react26 = require("react");
6210
+ var import_react27 = require("react");
6211
6211
 
6212
6212
  // src/events/market-details/market-details.utils.ts
6213
6213
  var import_sdk14 = require("@agg-build/sdk");
@@ -7239,9 +7239,9 @@ function handleOrderEvent({ event, labels, fireOnce }) {
7239
7239
  var CLIENT_DEPOSIT_ACTIVITY_SUPPRESSION_MS = 2 * 60 * 1e3;
7240
7240
 
7241
7241
  // src/onboarding/index.tsx
7242
- var import_react17 = require("react");
7243
- var import_hooks40 = require("@agg-build/hooks");
7244
- var Dialog6 = __toESM(require("@radix-ui/react-dialog"));
7242
+ var import_react18 = require("react");
7243
+ var import_hooks41 = require("@agg-build/hooks");
7244
+ var Dialog7 = __toESM(require("@radix-ui/react-dialog"));
7245
7245
 
7246
7246
  // src/onboarding/onboarding-modal.constants.ts
7247
7247
  var import_sdk16 = require("@agg-build/sdk");
@@ -9053,8 +9053,166 @@ function ConnectProphetxModal({
9053
9053
  );
9054
9054
  }
9055
9055
 
9056
- // src/onboarding/index.tsx
9056
+ // src/onboarding/steps/connect-novig-modal.tsx
9057
+ var import_hooks40 = require("@agg-build/hooks");
9058
+ var import_sdk19 = require("@agg-build/sdk");
9059
+ var Dialog6 = __toESM(require("@radix-ui/react-dialog"));
9060
+ var import_react17 = require("react");
9057
9061
  var import_jsx_runtime143 = require("react/jsx-runtime");
9062
+ function ConnectNovigModal({
9063
+ open,
9064
+ onOpenChange,
9065
+ onVerify,
9066
+ onDisconnect,
9067
+ allowExistingConnection = false
9068
+ }) {
9069
+ const copy = (0, import_hooks40.useLabels)().onboarding.connectNovigModal;
9070
+ const common = (0, import_hooks40.useLabels)().common;
9071
+ const { novigExecutionMode, disabledVenues, isLoading } = (0, import_hooks40.useAppConfig)();
9072
+ const id = (0, import_react17.useId)();
9073
+ const [keyId, setKeyId] = (0, import_react17.useState)("");
9074
+ const [privateKey, setPrivateKey] = (0, import_react17.useState)("");
9075
+ const [pending, setPending] = (0, import_react17.useState)(false);
9076
+ const [disconnecting, setDisconnecting] = (0, import_react17.useState)(false);
9077
+ const [disconnectError, setDisconnectError] = (0, import_react17.useState)(false);
9078
+ const busy = pending || disconnecting;
9079
+ const [connected, setConnected] = (0, import_react17.useState)(false);
9080
+ const [error, setError] = (0, import_react17.useState)(false);
9081
+ (0, import_react17.useEffect)(() => {
9082
+ if (!open) {
9083
+ setKeyId("");
9084
+ setPrivateKey("");
9085
+ setError(false);
9086
+ setDisconnectError(false);
9087
+ setConnected(false);
9088
+ }
9089
+ }, [open]);
9090
+ if (isLoading || !allowExistingConnection && (novigExecutionMode !== "direct" || disabledVenues.includes(import_sdk19.Venue.novig)))
9091
+ return null;
9092
+ return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
9093
+ Modal,
9094
+ {
9095
+ open,
9096
+ onOpenChange: (value) => {
9097
+ if (!busy) onOpenChange(value);
9098
+ },
9099
+ children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Modal.Container, { maxWidth: "480px", "aria-label": copy.title, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(Modal.Body, { classNames: { root: "relative !p-6" }, children: [
9100
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
9101
+ Dialog6.Close,
9102
+ {
9103
+ "aria-label": common.close,
9104
+ disabled: busy,
9105
+ className: "absolute right-4 top-4 cursor-pointer disabled:cursor-not-allowed",
9106
+ children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Icon, { name: "close", size: "medium" })
9107
+ }
9108
+ ),
9109
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
9110
+ "form",
9111
+ {
9112
+ className: "flex flex-col gap-4",
9113
+ onSubmit: (event) => __async(null, null, function* () {
9114
+ event.preventDefault();
9115
+ if (busy || !keyId.trim() || !privateKey.trim()) return;
9116
+ setPending(true);
9117
+ setError(false);
9118
+ try {
9119
+ yield onVerify({ keyId: keyId.trim(), privateKey: privateKey.trim() });
9120
+ setKeyId("");
9121
+ setPrivateKey("");
9122
+ setConnected(true);
9123
+ } catch (e) {
9124
+ setError(true);
9125
+ } finally {
9126
+ setPending(false);
9127
+ }
9128
+ }),
9129
+ children: [
9130
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(VenueLogo, { venue: import_sdk19.Venue.novig, size: "large" }),
9131
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Dialog6.Title, { className: "text-agg-xl font-agg-bold text-agg-foreground", children: copy.title }),
9132
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Dialog6.Description, { className: "text-agg-sm text-agg-muted-foreground", children: copy.description }),
9133
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("p", { className: "text-agg-sm text-agg-muted-foreground", children: copy.fundingNotice }),
9134
+ connected ? /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
9135
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("p", { role: "status", children: copy.connected }),
9136
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Button, { type: "button", onClick: () => onOpenChange(false), children: copy.done })
9137
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
9138
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
9139
+ "a",
9140
+ {
9141
+ className: "text-agg-sm text-agg-primary underline",
9142
+ href: "https://docs.novig.com/api/quickstart",
9143
+ target: "_blank",
9144
+ rel: "noopener noreferrer",
9145
+ children: copy.instructions
9146
+ }
9147
+ ),
9148
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("label", { htmlFor: `${id}-access`, className: "text-agg-sm text-agg-foreground", children: copy.keyId }),
9149
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
9150
+ "input",
9151
+ {
9152
+ id: `${id}-access`,
9153
+ type: "password",
9154
+ autoComplete: "off",
9155
+ spellCheck: false,
9156
+ className: "rounded-agg-md border border-agg-border bg-agg-secondary p-3 text-agg-foreground",
9157
+ value: keyId,
9158
+ onChange: (e) => setKeyId(e.target.value),
9159
+ disabled: busy,
9160
+ required: true
9161
+ }
9162
+ ),
9163
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("label", { htmlFor: `${id}-secret`, className: "text-agg-sm text-agg-foreground", children: copy.privateKey }),
9164
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
9165
+ "textarea",
9166
+ {
9167
+ id: `${id}-secret`,
9168
+ rows: 5,
9169
+ autoComplete: "new-password",
9170
+ spellCheck: false,
9171
+ className: "rounded-agg-md border border-agg-border bg-agg-secondary p-3 text-agg-foreground",
9172
+ value: privateKey,
9173
+ onChange: (e) => setPrivateKey(e.target.value),
9174
+ disabled: busy,
9175
+ required: true
9176
+ }
9177
+ ),
9178
+ error ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("p", { role: "alert", className: "text-agg-sm text-agg-error", children: copy.error }) : null,
9179
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Button, { type: "submit", disabled: busy || !keyId.trim() || !privateKey.trim(), children: pending ? copy.verifying : copy.verify })
9180
+ ] }),
9181
+ allowExistingConnection && onDisconnect ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
9182
+ Button,
9183
+ {
9184
+ type: "button",
9185
+ variant: "secondary",
9186
+ disabled: busy,
9187
+ onClick: () => __async(null, null, function* () {
9188
+ setDisconnecting(true);
9189
+ setDisconnectError(false);
9190
+ setError(false);
9191
+ try {
9192
+ yield onDisconnect();
9193
+ setKeyId("");
9194
+ setPrivateKey("");
9195
+ onOpenChange(false);
9196
+ } catch (e) {
9197
+ setDisconnectError(true);
9198
+ } finally {
9199
+ setDisconnecting(false);
9200
+ }
9201
+ }),
9202
+ children: disconnecting ? copy.disconnecting : copy.disconnect
9203
+ }
9204
+ ) : null,
9205
+ disconnectError ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("p", { role: "alert", className: "text-agg-sm text-agg-error", children: copy.disconnectError }) : null
9206
+ ]
9207
+ }
9208
+ )
9209
+ ] }) })
9210
+ }
9211
+ );
9212
+ }
9213
+
9214
+ // src/onboarding/index.tsx
9215
+ var import_jsx_runtime144 = require("react/jsx-runtime");
9058
9216
  var OnboardingModal = ({
9059
9217
  open,
9060
9218
  onOpenChange,
@@ -9065,55 +9223,55 @@ var OnboardingModal = ({
9065
9223
  connectedOnchain = false
9066
9224
  }) => {
9067
9225
  var _a;
9068
- const labels = (0, import_hooks40.useLabels)();
9069
- const [step, setStep] = (0, import_react17.useState)(ONBOARDING_STEPS.HOW_IT_WORKS);
9226
+ const labels = (0, import_hooks41.useLabels)();
9227
+ const [step, setStep] = (0, import_react18.useState)(ONBOARDING_STEPS.HOW_IT_WORKS);
9070
9228
  const stepLabels = {
9071
9229
  [ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
9072
9230
  [ONBOARDING_STEPS.PROFILE_SETUP]: labels.onboarding.modal.stepProfileSetup,
9073
9231
  [ONBOARDING_STEPS.CONNECT_ACCOUNTS]: labels.onboarding.modal.stepConnectAccounts
9074
9232
  };
9075
9233
  const resolvedTitle = (_a = stepLabels[step]) != null ? _a : labels.onboarding.modal.title;
9076
- const [onchainModalOpen, setOnchainModalOpen] = (0, import_react17.useState)(false);
9077
- const [onchainConnected, setOnchainConnected] = (0, import_react17.useState)(false);
9078
- (0, import_react17.useEffect)(() => {
9234
+ const [onchainModalOpen, setOnchainModalOpen] = (0, import_react18.useState)(false);
9235
+ const [onchainConnected, setOnchainConnected] = (0, import_react18.useState)(false);
9236
+ (0, import_react18.useEffect)(() => {
9079
9237
  if (open) {
9080
9238
  setStep(ONBOARDING_STEPS.HOW_IT_WORKS);
9081
9239
  setOnchainConnected(false);
9082
9240
  }
9083
9241
  }, [open]);
9084
- const handleHowItWorksContinue = (0, import_react17.useCallback)(() => {
9242
+ const handleHowItWorksContinue = (0, import_react18.useCallback)(() => {
9085
9243
  setStep(ONBOARDING_STEPS.PROFILE_SETUP);
9086
9244
  }, []);
9087
- const handleProfileContinue = (0, import_react17.useCallback)(
9245
+ const handleProfileContinue = (0, import_react18.useCallback)(
9088
9246
  (data) => {
9089
9247
  onProfileSubmit == null ? void 0 : onProfileSubmit(data);
9090
9248
  setStep(ONBOARDING_STEPS.CONNECT_ACCOUNTS);
9091
9249
  },
9092
9250
  [onProfileSubmit]
9093
9251
  );
9094
- const handleConnectContinue = (0, import_react17.useCallback)(() => {
9252
+ const handleConnectContinue = (0, import_react18.useCallback)(() => {
9095
9253
  onComplete == null ? void 0 : onComplete();
9096
9254
  }, [onComplete]);
9097
- const handleOpenOnchainModal = (0, import_react17.useCallback)(() => {
9255
+ const handleOpenOnchainModal = (0, import_react18.useCallback)(() => {
9098
9256
  setOnchainModalOpen(true);
9099
9257
  }, []);
9100
- const handleOnchainConnect = (0, import_react17.useCallback)(() => __async(null, null, function* () {
9258
+ const handleOnchainConnect = (0, import_react18.useCallback)(() => __async(null, null, function* () {
9101
9259
  yield onConnectOnchain == null ? void 0 : onConnectOnchain();
9102
9260
  setOnchainConnected(true);
9103
9261
  }), [onConnectOnchain]);
9104
- return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
9105
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
9262
+ return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(import_jsx_runtime144.Fragment, { children: [
9263
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
9106
9264
  Modal.Container,
9107
9265
  {
9108
9266
  maxWidth: "600px",
9109
9267
  "aria-label": resolvedTitle,
9110
9268
  classNames: { container: "!rounded-agg-lg" },
9111
9269
  children: [
9112
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Dialog6.Title, { className: "sr-only", children: resolvedTitle }),
9113
- /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(Modal.Body, { classNames: { root: "px-5 py-6 sm:px-10 sm:py-8" }, children: [
9114
- step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(HowItWorksStep, { onContinue: handleHowItWorksContinue, icons: howItWorksIcons }),
9115
- step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(ProfileSetupStep, { onContinue: handleProfileContinue }),
9116
- step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
9270
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Dialog7.Title, { className: "sr-only", children: resolvedTitle }),
9271
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(Modal.Body, { classNames: { root: "px-5 py-6 sm:px-10 sm:py-8" }, children: [
9272
+ step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(HowItWorksStep, { onContinue: handleHowItWorksContinue, icons: howItWorksIcons }),
9273
+ step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(ProfileSetupStep, { onContinue: handleProfileContinue }),
9274
+ step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
9117
9275
  ConnectAccountsStep,
9118
9276
  {
9119
9277
  onConnectOnchain: handleOpenOnchainModal,
@@ -9125,7 +9283,7 @@ var OnboardingModal = ({
9125
9283
  ]
9126
9284
  }
9127
9285
  ) }),
9128
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
9286
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
9129
9287
  ConnectOnchainModal,
9130
9288
  {
9131
9289
  open: onchainModalOpen,
@@ -9145,41 +9303,41 @@ var requestAggDepositModalOpen = () => {
9145
9303
  };
9146
9304
 
9147
9305
  // src/trading/fund-kalshi-modal.tsx
9148
- var import_hooks41 = require("@agg-build/hooks");
9149
- var import_sdk19 = require("@agg-build/sdk");
9150
- var Dialog7 = __toESM(require("@radix-ui/react-dialog"));
9151
- var import_jsx_runtime144 = require("react/jsx-runtime");
9306
+ var import_hooks42 = require("@agg-build/hooks");
9307
+ var import_sdk20 = require("@agg-build/sdk");
9308
+ var Dialog8 = __toESM(require("@radix-ui/react-dialog"));
9309
+ var import_jsx_runtime145 = require("react/jsx-runtime");
9152
9310
  var FundKalshiModal = ({ open, onOpenChange }) => {
9153
- const labels = (0, import_hooks41.useLabels)();
9311
+ const labels = (0, import_hooks42.useLabels)();
9154
9312
  const modalLabels = labels.trading.fundKalshiModal;
9155
- return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
9313
+ return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(
9156
9314
  Modal.Container,
9157
9315
  {
9158
9316
  maxWidth: "600px",
9159
9317
  "aria-label": modalLabels.ariaLabel,
9160
9318
  classNames: { container: "relative !rounded-agg-2xl" },
9161
9319
  children: [
9162
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
9163
- Dialog7.Close,
9320
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9321
+ Dialog8.Close,
9164
9322
  {
9165
9323
  "aria-label": labels.common.close,
9166
9324
  className: "absolute right-6 top-6 z-10 flex size-11 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 sm:right-7 sm:top-7",
9167
- children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Icon, { name: "close", size: "medium" })
9325
+ children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Icon, { name: "close", size: "medium" })
9168
9326
  }
9169
9327
  ),
9170
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Modal.Body, { classNames: { root: "!px-5 !py-12 sm:!px-10" }, children: /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "flex flex-col items-center gap-8 text-center", children: [
9171
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(VenueLogo, { venue: import_sdk19.Venue.kalshi, variant: "logo", size: "large", className: "size-[60px]" }),
9172
- /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [
9173
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Dialog7.Title, { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: modalLabels.title }),
9174
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Dialog7.Description, { className: "max-w-[520px] text-agg-base leading-agg-6 text-agg-foreground", children: modalLabels.description })
9328
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Modal.Body, { classNames: { root: "!px-5 !py-12 sm:!px-10" }, children: /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex flex-col items-center gap-8 text-center", children: [
9329
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(VenueLogo, { venue: import_sdk20.Venue.kalshi, variant: "logo", size: "large", className: "size-[60px]" }),
9330
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [
9331
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Dialog8.Title, { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: modalLabels.title }),
9332
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Dialog8.Description, { className: "max-w-[520px] text-agg-base leading-agg-6 text-agg-foreground", children: modalLabels.description })
9175
9333
  ] }),
9176
- /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "flex w-full flex-col gap-3 rounded-agg-xl bg-agg-secondary-hover p-4 text-left", children: [
9177
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: modalLabels.howItWorks }),
9178
- /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("ol", { className: "list-decimal space-y-0 pl-5 text-agg-sm leading-agg-5 text-agg-foreground", children: [
9179
- /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("li", { children: [
9334
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex w-full flex-col gap-3 rounded-agg-xl bg-agg-secondary-hover p-4 text-left", children: [
9335
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: modalLabels.howItWorks }),
9336
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("ol", { className: "list-decimal space-y-0 pl-5 text-agg-sm leading-agg-5 text-agg-foreground", children: [
9337
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("li", { children: [
9180
9338
  modalLabels.firstStepPrefix,
9181
9339
  " ",
9182
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
9340
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9183
9341
  "a",
9184
9342
  {
9185
9343
  href: modalLabels.kalshiUrl,
@@ -9192,12 +9350,12 @@ var FundKalshiModal = ({ open, onOpenChange }) => {
9192
9350
  " ",
9193
9351
  modalLabels.firstStepSuffix
9194
9352
  ] }),
9195
- modalLabels.remainingSteps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("li", { children: step }, step))
9353
+ modalLabels.remainingSteps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("li", { children: step }, step))
9196
9354
  ] })
9197
9355
  ] }),
9198
- /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "flex flex-wrap items-center justify-center gap-3", children: [
9199
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Button, { variant: "secondary", size: "large", onClick: () => onOpenChange(false), children: modalLabels.doItLater }),
9200
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
9356
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex flex-wrap items-center justify-center gap-3", children: [
9357
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Button, { variant: "secondary", size: "large", onClick: () => onOpenChange(false), children: modalLabels.doItLater }),
9358
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9201
9359
  Button,
9202
9360
  {
9203
9361
  variant: "primary",
@@ -9216,19 +9374,19 @@ var FundKalshiModal = ({ open, onOpenChange }) => {
9216
9374
  FundKalshiModal.displayName = "FundKalshiModal";
9217
9375
 
9218
9376
  // src/trading/manage-betdex-account-modal.tsx
9219
- var import_react23 = require("react");
9220
- var import_hooks50 = require("@agg-build/hooks");
9221
- var Dialog8 = __toESM(require("@radix-ui/react-dialog"));
9377
+ var import_react24 = require("react");
9378
+ var import_hooks51 = require("@agg-build/hooks");
9379
+ var Dialog9 = __toESM(require("@radix-ui/react-dialog"));
9222
9380
 
9223
9381
  // src/pages/user-profile/components/betdex-account-card.tsx
9224
- var import_react20 = require("react");
9225
- var import_hooks44 = require("@agg-build/hooks");
9226
- var import_sdk20 = require("@agg-build/sdk");
9382
+ var import_react21 = require("react");
9383
+ var import_hooks45 = require("@agg-build/hooks");
9384
+ var import_sdk21 = require("@agg-build/sdk");
9227
9385
 
9228
9386
  // src/pages/user-profile/components/betdex-account-transfers.tsx
9229
- var import_react18 = require("react");
9230
- var import_hooks42 = require("@agg-build/hooks");
9231
- var import_jsx_runtime145 = require("react/jsx-runtime");
9387
+ var import_react19 = require("react");
9388
+ var import_hooks43 = require("@agg-build/hooks");
9389
+ var import_jsx_runtime146 = require("react/jsx-runtime");
9232
9390
  function hostedWithdrawalRaw(value) {
9233
9391
  var _a;
9234
9392
  const match = /^([0-9]{1,26})(?:\.([0-9]{1,6}))?$/.exec(value.trim());
@@ -9248,15 +9406,15 @@ function BetdexAccountTransfers({
9248
9406
  canDeposit,
9249
9407
  onWalletDeposit
9250
9408
  }) {
9251
- const labels = (0, import_hooks42.useLabels)().userProfile.hostedBetdex;
9252
- const transfer = (0, import_hooks42.useHostedVenueTransfers)(accountId, environment);
9253
- const [showWithdraw, setShowWithdraw] = (0, import_react18.useState)(false);
9254
- const wallet = (0, import_hooks42.useDepositAddresses)({
9409
+ const labels = (0, import_hooks43.useLabels)().userProfile.hostedBetdex;
9410
+ const transfer = (0, import_hooks43.useHostedVenueTransfers)(accountId, environment);
9411
+ const [showWithdraw, setShowWithdraw] = (0, import_react19.useState)(false);
9412
+ const wallet = (0, import_hooks43.useDepositAddresses)({
9255
9413
  enabled: transfer.isAvailable && environment === "production" && showWithdraw
9256
9414
  });
9257
- const [amount2, setAmount] = (0, import_react18.useState)("");
9258
- const [destination, setDestination] = (0, import_react18.useState)("");
9259
- const [actionError, setActionError] = (0, import_react18.useState)(false);
9415
+ const [amount2, setAmount] = (0, import_react19.useState)("");
9416
+ const [destination, setDestination] = (0, import_react19.useState)("");
9417
+ const [actionError, setActionError] = (0, import_react19.useState)(false);
9260
9418
  const raw = hostedWithdrawalRaw(amount2);
9261
9419
  const withinBalance = raw !== null && (availableRaw === void 0 || BigInt(raw) <= BigInt(availableRaw));
9262
9420
  const validDestination = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(destination.trim());
@@ -9267,9 +9425,9 @@ function BetdexAccountTransfers({
9267
9425
  void work().catch(() => setActionError(true));
9268
9426
  };
9269
9427
  if (!transfer.isAvailable) return null;
9270
- return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex flex-col gap-3 border-t border-agg-separator pt-3", children: [
9271
- /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex flex-wrap gap-2", children: [
9272
- canDeposit && environment === "production" && onWalletDeposit ? /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9428
+ return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "flex flex-col gap-3 border-t border-agg-separator pt-3", children: [
9429
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "flex flex-wrap gap-2", children: [
9430
+ canDeposit && environment === "production" && onWalletDeposit ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9273
9431
  Button,
9274
9432
  {
9275
9433
  type: "button",
@@ -9284,7 +9442,7 @@ function BetdexAccountTransfers({
9284
9442
  children: labels.fromWallet
9285
9443
  }
9286
9444
  ) : null,
9287
- canDeposit ? /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9445
+ canDeposit ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9288
9446
  Button,
9289
9447
  {
9290
9448
  type: "button",
@@ -9297,7 +9455,7 @@ function BetdexAccountTransfers({
9297
9455
  children: labels.deposit
9298
9456
  }
9299
9457
  ) : null,
9300
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9458
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9301
9459
  Button,
9302
9460
  {
9303
9461
  type: "button",
@@ -9309,11 +9467,11 @@ function BetdexAccountTransfers({
9309
9467
  }
9310
9468
  )
9311
9469
  ] }),
9312
- transfer.deposit.data ? /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex flex-col gap-2 agg-type-caption", children: [
9313
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("p", { className: "text-agg-muted-foreground", children: labels.depositInstructions[environment] }),
9314
- /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("label", { className: "flex flex-col gap-1 text-agg-muted-foreground", children: [
9470
+ transfer.deposit.data ? /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "flex flex-col gap-2 agg-type-caption", children: [
9471
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("p", { className: "text-agg-muted-foreground", children: labels.depositInstructions[environment] }),
9472
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("label", { className: "flex flex-col gap-1 text-agg-muted-foreground", children: [
9315
9473
  labels.depositAddress,
9316
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9474
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9317
9475
  "input",
9318
9476
  {
9319
9477
  readOnly: true,
@@ -9324,20 +9482,20 @@ function BetdexAccountTransfers({
9324
9482
  )
9325
9483
  ] })
9326
9484
  ] }) : null,
9327
- transfer.deposit.isError || transfer.withdrawal.isError || transfer.storageError || actionError ? /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("p", { role: "alert", className: "agg-type-caption text-agg-error", children: labels.transferUnavailable }) : null,
9328
- transfer.request ? /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex flex-col gap-2 agg-type-caption", children: [
9329
- /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("p", { children: [
9485
+ transfer.deposit.isError || transfer.withdrawal.isError || transfer.storageError || actionError ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("p", { role: "alert", className: "agg-type-caption text-agg-error", children: labels.transferUnavailable }) : null,
9486
+ transfer.request ? /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "flex flex-col gap-2 agg-type-caption", children: [
9487
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("p", { children: [
9330
9488
  labels.withdrawalAmount,
9331
9489
  ": ",
9332
9490
  amountText(transfer.request.amountRaw)
9333
9491
  ] }),
9334
- /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("p", { className: "break-all", children: [
9492
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("p", { className: "break-all", children: [
9335
9493
  labels.withdrawalDestination,
9336
9494
  ": ",
9337
9495
  transfer.request.destinationAddress
9338
9496
  ] }),
9339
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("p", { role: "status", children: result ? labels.withdrawalStatuses[result.status] : labels.withdrawalUnknown }),
9340
- terminal ? /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9497
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("p", { role: "status", children: result ? labels.withdrawalStatuses[result.status] : labels.withdrawalUnknown }),
9498
+ terminal ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9341
9499
  Button,
9342
9500
  {
9343
9501
  type: "button",
@@ -9352,7 +9510,7 @@ function BetdexAccountTransfers({
9352
9510
  },
9353
9511
  children: labels.withdrawalNew
9354
9512
  }
9355
- ) : /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9513
+ ) : /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9356
9514
  Button,
9357
9515
  {
9358
9516
  type: "button",
@@ -9365,7 +9523,7 @@ function BetdexAccountTransfers({
9365
9523
  children: result ? labels.withdrawalCheck : labels.withdrawalRetry
9366
9524
  }
9367
9525
  )
9368
- ] }) : showWithdraw ? /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(
9526
+ ] }) : showWithdraw ? /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
9369
9527
  "form",
9370
9528
  {
9371
9529
  className: "flex flex-col gap-3",
@@ -9375,9 +9533,9 @@ function BetdexAccountTransfers({
9375
9533
  run(() => transfer.submit(raw, destination.trim()));
9376
9534
  },
9377
9535
  children: [
9378
- /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("label", { className: "flex flex-col gap-1 agg-type-caption text-agg-muted-foreground", children: [
9536
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("label", { className: "flex flex-col gap-1 agg-type-caption text-agg-muted-foreground", children: [
9379
9537
  labels.withdrawalAmount,
9380
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9538
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9381
9539
  "input",
9382
9540
  {
9383
9541
  inputMode: "decimal",
@@ -9388,7 +9546,7 @@ function BetdexAccountTransfers({
9388
9546
  }
9389
9547
  )
9390
9548
  ] }),
9391
- environment === "production" ? /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9549
+ environment === "production" ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9392
9550
  Button,
9393
9551
  {
9394
9552
  type: "button",
@@ -9403,9 +9561,9 @@ function BetdexAccountTransfers({
9403
9561
  children: labels.toWallet
9404
9562
  }
9405
9563
  ) : null,
9406
- /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("label", { className: "flex flex-col gap-1 agg-type-caption text-agg-muted-foreground", children: [
9564
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("label", { className: "flex flex-col gap-1 agg-type-caption text-agg-muted-foreground", children: [
9407
9565
  labels.withdrawalDestination,
9408
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9566
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9409
9567
  "input",
9410
9568
  {
9411
9569
  autoComplete: "off",
@@ -9416,7 +9574,7 @@ function BetdexAccountTransfers({
9416
9574
  }
9417
9575
  )
9418
9576
  ] }),
9419
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
9577
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9420
9578
  Button,
9421
9579
  {
9422
9580
  type: "submit",
@@ -9435,9 +9593,9 @@ function BetdexAccountTransfers({
9435
9593
  }
9436
9594
 
9437
9595
  // src/pages/user-profile/components/betdex-account-activity.tsx
9438
- var import_react19 = require("react");
9439
- var import_hooks43 = require("@agg-build/hooks");
9440
- var import_jsx_runtime146 = require("react/jsx-runtime");
9596
+ var import_react20 = require("react");
9597
+ var import_hooks44 = require("@agg-build/hooks");
9598
+ var import_jsx_runtime147 = require("react/jsx-runtime");
9441
9599
  function amount(raw) {
9442
9600
  const negative = raw.startsWith("-");
9443
9601
  const digits = (negative ? raw.slice(1) : raw).padStart(19, "0");
@@ -9448,36 +9606,36 @@ function BetdexAccountActivity({
9448
9606
  accountId,
9449
9607
  environment
9450
9608
  }) {
9451
- const labels = (0, import_hooks43.useLabels)().userProfile.hostedBetdex;
9452
- const [page, setPage] = (0, import_react19.useState)(0);
9453
- const { activity, isAvailable } = (0, import_hooks43.useHostedVenueActivity)("betdex", page);
9609
+ const labels = (0, import_hooks44.useLabels)().userProfile.hostedBetdex;
9610
+ const [page, setPage] = (0, import_react20.useState)(0);
9611
+ const { activity, isAvailable } = (0, import_hooks44.useHostedVenueActivity)("betdex", page);
9454
9612
  if (!isAvailable) return null;
9455
9613
  const data = activity.data;
9456
9614
  const valid = (data == null ? void 0 : data.accountId) === accountId && data.environment === environment && data.page === page;
9457
9615
  const unavailable = activity.isError || !!data && !valid;
9458
- return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
9616
+ return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(
9459
9617
  "section",
9460
9618
  {
9461
9619
  "aria-label": labels.activityTitle,
9462
9620
  className: "flex flex-col gap-3 border-t border-agg-separator pt-3",
9463
9621
  children: [
9464
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("h4", { className: "agg-type-label text-agg-foreground", children: labels.activityTitle }),
9465
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.activityDescription }),
9466
- activity.isPending ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(SkeletonBlock, { className: "h-16 w-full" }) : null,
9467
- unavailable ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.activityUnavailable }) : null,
9468
- valid && !unavailable ? data.items.length ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("ul", { className: "flex flex-col gap-3 agg-type-caption", children: data.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("li", { className: "flex flex-col gap-1", children: [
9469
- /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "flex justify-between gap-3 text-agg-foreground", children: [
9470
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("span", { children: labels.activityCodes[item.code] }),
9471
- /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("span", { className: "break-all tabular-nums", children: [
9622
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("h4", { className: "agg-type-label text-agg-foreground", children: labels.activityTitle }),
9623
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.activityDescription }),
9624
+ activity.isPending ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(SkeletonBlock, { className: "h-16 w-full" }) : null,
9625
+ unavailable ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.activityUnavailable }) : null,
9626
+ valid && !unavailable ? data.items.length ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("ul", { className: "flex flex-col gap-3 agg-type-caption", children: data.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("li", { className: "flex flex-col gap-1", children: [
9627
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex justify-between gap-3 text-agg-foreground", children: [
9628
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { children: labels.activityCodes[item.code] }),
9629
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("span", { className: "break-all tabular-nums", children: [
9472
9630
  amount(item.amountRaw),
9473
9631
  " ",
9474
9632
  data.asset
9475
9633
  ] })
9476
9634
  ] }),
9477
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("time", { dateTime: item.createdAt, className: "text-agg-muted-foreground", children: new Date(item.createdAt).toLocaleString() })
9478
- ] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.activityEmpty }) : null,
9479
- /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "flex flex-wrap gap-2", children: [
9480
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9635
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("time", { dateTime: item.createdAt, className: "text-agg-muted-foreground", children: new Date(item.createdAt).toLocaleString() })
9636
+ ] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.activityEmpty }) : null,
9637
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex flex-wrap gap-2", children: [
9638
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
9481
9639
  Button,
9482
9640
  {
9483
9641
  type: "button",
@@ -9488,7 +9646,7 @@ function BetdexAccountActivity({
9488
9646
  children: labels.activityPrevious
9489
9647
  }
9490
9648
  ),
9491
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9649
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
9492
9650
  Button,
9493
9651
  {
9494
9652
  type: "button",
@@ -9501,7 +9659,7 @@ function BetdexAccountActivity({
9501
9659
  children: labels.activityNext
9502
9660
  }
9503
9661
  ),
9504
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
9662
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
9505
9663
  Button,
9506
9664
  {
9507
9665
  type: "button",
@@ -9521,46 +9679,46 @@ function BetdexAccountActivity({
9521
9679
  }
9522
9680
 
9523
9681
  // src/pages/user-profile/components/betdex-account-card.tsx
9524
- var import_jsx_runtime147 = require("react/jsx-runtime");
9682
+ var import_jsx_runtime148 = require("react/jsx-runtime");
9525
9683
  function BetdexAccountCard({
9526
9684
  onWalletDeposit
9527
9685
  } = {}) {
9528
9686
  var _a;
9529
- const [showActivity, setShowActivity] = (0, import_react20.useState)(false);
9530
- const labels = (0, import_hooks44.useLabels)().userProfile.hostedBetdex;
9531
- const { account, provision, isAvailable } = (0, import_hooks44.useHostedVenueAccount)("betdex");
9687
+ const [showActivity, setShowActivity] = (0, import_react21.useState)(false);
9688
+ const labels = (0, import_hooks45.useLabels)().userProfile.hostedBetdex;
9689
+ const { account, provision, isAvailable } = (0, import_hooks45.useHostedVenueAccount)("betdex");
9532
9690
  const data = account.data;
9533
9691
  if (!isAvailable || (data == null ? void 0 : data.status) === "disabled") return null;
9534
9692
  const pending = provision.isPending || (data == null ? void 0 : data.status) === "provisioning";
9535
9693
  const canCreate = (data == null ? void 0 : data.status) === "not_created" && data.provisioningEnabled;
9536
9694
  const rawLabel = (raw) => formatUsd(Number(raw) / 1e6);
9537
- return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(
9695
+ return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(
9538
9696
  "section",
9539
9697
  {
9540
9698
  "aria-label": labels.title,
9541
9699
  className: "flex flex-col gap-3 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5",
9542
9700
  children: [
9543
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center gap-2", children: [
9544
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(VenueLogo, { venue: import_sdk20.Venue.betdex, size: "small", className: "size-4" }),
9545
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("h3", { className: "agg-type-label text-agg-foreground", children: labels.title })
9701
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "flex items-center gap-2", children: [
9702
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(VenueLogo, { venue: import_sdk21.Venue.betdex, size: "small", className: "size-4" }),
9703
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("h3", { className: "agg-type-label text-agg-foreground", children: labels.title })
9546
9704
  ] }),
9547
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.description }),
9548
- (data == null ? void 0 : data.environment) === "sandbox" ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "agg-type-caption text-agg-warning", children: labels.sandbox }) : null,
9549
- account.isPending ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(SkeletonBlock, { className: "h-10 w-full" }) : null,
9550
- (data == null ? void 0 : data.status) === "active" && data.balanceStatus === "available" && data.balance && !account.isError ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("dl", { className: "flex flex-col gap-2 agg-type-caption", children: [
9705
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.description }),
9706
+ (data == null ? void 0 : data.environment) === "sandbox" ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { className: "agg-type-caption text-agg-warning", children: labels.sandbox }) : null,
9707
+ account.isPending ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(SkeletonBlock, { className: "h-10 w-full" }) : null,
9708
+ (data == null ? void 0 : data.status) === "active" && data.balanceStatus === "available" && data.balance && !account.isError ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("dl", { className: "flex flex-col gap-2 agg-type-caption", children: [
9551
9709
  [labels.total, data.balance.totalRaw],
9552
9710
  [labels.available, data.balance.availableRaw],
9553
9711
  [labels.reserved, data.balance.unmatchedExposureRaw]
9554
- ].map(([label2, raw]) => /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex justify-between gap-3", children: [
9555
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("dt", { className: "text-agg-muted-foreground", children: label2 }),
9556
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("dd", { className: "text-agg-foreground", children: rawLabel(raw) })
9712
+ ].map(([label2, raw]) => /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "flex justify-between gap-3", children: [
9713
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("dt", { className: "text-agg-muted-foreground", children: label2 }),
9714
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("dd", { className: "text-agg-foreground", children: rawLabel(raw) })
9557
9715
  ] }, label2)) }) : null,
9558
- pending ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.provisioning }) : null,
9559
- (data == null ? void 0 : data.status) === "suspended" ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.suspended }) : null,
9560
- account.isError || (data == null ? void 0 : data.status) === "unavailable" || (data == null ? void 0 : data.balanceStatus) === "unavailable" ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.unavailable }) : null,
9561
- (data == null ? void 0 : data.status) === "not_created" && !data.provisioningEnabled ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.provisioningUnavailable }) : null,
9562
- provision.isError ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { role: "alert", className: "agg-type-caption text-agg-error", children: labels.creationFailed }) : null,
9563
- canCreate || (data == null ? void 0 : data.status) === "provisioning" ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
9716
+ pending ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.provisioning }) : null,
9717
+ (data == null ? void 0 : data.status) === "suspended" ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.suspended }) : null,
9718
+ account.isError || (data == null ? void 0 : data.status) === "unavailable" || (data == null ? void 0 : data.balanceStatus) === "unavailable" ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.unavailable }) : null,
9719
+ (data == null ? void 0 : data.status) === "not_created" && !data.provisioningEnabled ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.provisioningUnavailable }) : null,
9720
+ provision.isError ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { role: "alert", className: "agg-type-caption text-agg-error", children: labels.creationFailed }) : null,
9721
+ canCreate || (data == null ? void 0 : data.status) === "provisioning" ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
9564
9722
  Button,
9565
9723
  {
9566
9724
  type: "button",
@@ -9573,7 +9731,7 @@ function BetdexAccountCard({
9573
9731
  children: (data == null ? void 0 : data.status) === "provisioning" ? labels.checkSetup : labels.createAccount
9574
9732
  }
9575
9733
  ) : null,
9576
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
9734
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
9577
9735
  Button,
9578
9736
  {
9579
9737
  type: "button",
@@ -9586,11 +9744,11 @@ function BetdexAccountCard({
9586
9744
  children: labels.refresh
9587
9745
  }
9588
9746
  ),
9589
- (data == null ? void 0 : data.accountId) && data.environment && ["active", "suspended"].includes(data.status) ? /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_jsx_runtime147.Fragment, { children: [
9590
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("details", { className: "group/agg-betdex-funds border-t border-agg-separator pt-3", children: [
9591
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between gap-3 text-agg-sm font-agg-bold text-agg-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary [&::-webkit-details-marker]:hidden", children: [
9747
+ (data == null ? void 0 : data.accountId) && data.environment && ["active", "suspended"].includes(data.status) ? /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_jsx_runtime148.Fragment, { children: [
9748
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("details", { className: "group/agg-betdex-funds border-t border-agg-separator pt-3", children: [
9749
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("summary", { className: "flex min-h-11 cursor-pointer list-none items-center justify-between gap-3 text-agg-sm font-agg-bold text-agg-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary [&::-webkit-details-marker]:hidden", children: [
9592
9750
  labels.manageFunds,
9593
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
9751
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
9594
9752
  Icon,
9595
9753
  {
9596
9754
  name: "chevron-down",
@@ -9599,7 +9757,7 @@ function BetdexAccountCard({
9599
9757
  }
9600
9758
  )
9601
9759
  ] }),
9602
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
9760
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
9603
9761
  BetdexAccountTransfers,
9604
9762
  {
9605
9763
  accountId: data.accountId,
@@ -9611,7 +9769,7 @@ function BetdexAccountCard({
9611
9769
  `transfers:${data.accountId}:${data.environment}`
9612
9770
  )
9613
9771
  ] }),
9614
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
9772
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
9615
9773
  Button,
9616
9774
  {
9617
9775
  type: "button",
@@ -9622,7 +9780,7 @@ function BetdexAccountCard({
9622
9780
  children: showActivity ? labels.hideActivity : labels.showActivity
9623
9781
  }
9624
9782
  ),
9625
- showActivity ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
9783
+ showActivity ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
9626
9784
  BetdexAccountActivity,
9627
9785
  {
9628
9786
  accountId: data.accountId,
@@ -9637,12 +9795,12 @@ function BetdexAccountCard({
9637
9795
  }
9638
9796
 
9639
9797
  // src/pages/user-profile/components/betdex-wallet-deposit.tsx
9640
- var import_react22 = require("react");
9641
- var import_hooks49 = require("@agg-build/hooks");
9798
+ var import_react23 = require("react");
9799
+ var import_hooks50 = require("@agg-build/hooks");
9642
9800
  var import_withdraw2 = require("@agg-build/hooks/withdraw");
9643
9801
 
9644
9802
  // src/withdraw/index.tsx
9645
- var import_react21 = require("react");
9803
+ var import_react22 = require("react");
9646
9804
  var import_withdraw = require("@agg-build/hooks/withdraw");
9647
9805
 
9648
9806
  // src/shared/constants.ts
@@ -9817,22 +9975,22 @@ var withNetworkIcons = (options) => {
9817
9975
  };
9818
9976
 
9819
9977
  // src/withdraw/steps/withdraw-method.tsx
9820
- var import_hooks45 = require("@agg-build/hooks");
9821
- var import_jsx_runtime148 = require("react/jsx-runtime");
9978
+ var import_hooks46 = require("@agg-build/hooks");
9979
+ var import_jsx_runtime149 = require("react/jsx-runtime");
9822
9980
  var WithdrawMethodStep = ({
9823
9981
  balance,
9824
9982
  onSelectMethod
9825
9983
  }) => {
9826
- const labels = (0, import_hooks45.useLabels)();
9827
- return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_jsx_runtime148.Fragment, { children: [
9828
- /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Modal.Header, { title: labels.withdraw.title, hideBorder: true }),
9829
- /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "flex flex-col gap-5", children: [
9830
- /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("p", { className: "agg-type-body text-agg-foreground", children: [
9984
+ const labels = (0, import_hooks46.useLabels)();
9985
+ return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(import_jsx_runtime149.Fragment, { children: [
9986
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Modal.Header, { title: labels.withdraw.title, hideBorder: true }),
9987
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "flex flex-col gap-5", children: [
9988
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("p", { className: "agg-type-body text-agg-foreground", children: [
9831
9989
  labels.withdraw.balancePrefix,
9832
9990
  " ",
9833
9991
  formatCompactUsd(balance)
9834
9992
  ] }),
9835
- /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(
9993
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
9836
9994
  "div",
9837
9995
  {
9838
9996
  className: cn(
@@ -9849,12 +10007,12 @@ var WithdrawMethodStep = ({
9849
10007
  }
9850
10008
  },
9851
10009
  children: [
9852
- /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(WalletIcon, { className: "h-6 w-6 text-agg-muted-foreground" }) }),
9853
- /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "flex-1 min-w-0", children: [
9854
- /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { className: "agg-type-body-strong text-agg-foreground", children: labels.withdraw.methods.walletTitle }),
9855
- /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: labels.withdraw.methods.walletDescription })
10010
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(WalletIcon, { className: "h-6 w-6 text-agg-muted-foreground" }) }),
10011
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "flex-1 min-w-0", children: [
10012
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("p", { className: "agg-type-body-strong text-agg-foreground", children: labels.withdraw.methods.walletTitle }),
10013
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: labels.withdraw.methods.walletDescription })
9856
10014
  ] }),
9857
- /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "shrink-0 text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(ChevronRightIcon, { className: "h-5 w-5" }) })
10015
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "shrink-0 text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(ChevronRightIcon, { className: "h-5 w-5" }) })
9858
10016
  ]
9859
10017
  }
9860
10018
  )
@@ -9863,12 +10021,12 @@ var WithdrawMethodStep = ({
9863
10021
  };
9864
10022
 
9865
10023
  // src/withdraw/steps/withdraw-amount.tsx
9866
- var import_hooks47 = require("@agg-build/hooks");
10024
+ var import_hooks48 = require("@agg-build/hooks");
9867
10025
 
9868
10026
  // src/shared/transfer-fee-summary.tsx
9869
- var import_hooks46 = require("@agg-build/hooks");
9870
- var import_jsx_runtime149 = require("react/jsx-runtime");
9871
- var separator = /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "text-agg-muted-foreground", "aria-hidden": "true", children: "\xB7" });
10027
+ var import_hooks47 = require("@agg-build/hooks");
10028
+ var import_jsx_runtime150 = require("react/jsx-runtime");
10029
+ var separator = /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("span", { className: "text-agg-muted-foreground", "aria-hidden": "true", children: "\xB7" });
9872
10030
  var normalizeFeeLabel = (label2) => label2.replace(/\s*~\s*$/, "");
9873
10031
  var TransferFeeSummary = ({
9874
10032
  estimate,
@@ -9876,46 +10034,46 @@ var TransferFeeSummary = ({
9876
10034
  minDeposit,
9877
10035
  eta
9878
10036
  }) => {
9879
- const labels = (0, import_hooks46.useLabels)();
10037
+ const labels = (0, import_hooks47.useLabels)();
9880
10038
  if (!estimate) return null;
9881
10039
  if (view === "deposit") {
9882
- return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("p", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
9883
- minDeposit ? /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { children: [
10040
+ return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("p", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
10041
+ minDeposit ? /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("span", { children: [
9884
10042
  labels.deposit.sendCrypto.minDepositPrefix,
9885
10043
  " ",
9886
10044
  minDeposit
9887
10045
  ] }) : null,
9888
10046
  minDeposit ? separator : null,
9889
- /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { children: [
10047
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("span", { children: [
9890
10048
  normalizeFeeLabel(labels.deposit.walletFlow.feePrefix),
9891
10049
  ": ",
9892
10050
  estimate.estimatedFees
9893
10051
  ] }),
9894
10052
  eta ? separator : null,
9895
- eta ? /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { children: eta }) : null
10053
+ eta ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("span", { children: eta }) : null
9896
10054
  ] });
9897
10055
  }
9898
- return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
9899
- /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { children: [
10056
+ return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
10057
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("span", { children: [
9900
10058
  labels.withdraw.walletFlow.estimatedFees,
9901
10059
  ": ",
9902
10060
  estimate.estimatedFees
9903
10061
  ] }),
9904
10062
  separator,
9905
- /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { className: "inline-flex items-center gap-1", children: [
9906
- /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { children: [
10063
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("span", { className: "inline-flex items-center gap-1", children: [
10064
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("span", { children: [
9907
10065
  labels.withdraw.walletFlow.networkReserve,
9908
10066
  ": ",
9909
10067
  estimate.networkReserve
9910
10068
  ] }),
9911
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
10069
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
9912
10070
  Tooltip,
9913
10071
  {
9914
10072
  "aria-label": labels.withdraw.walletFlow.networkReserveTooltipAria,
9915
10073
  size: "medium",
9916
- content: /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "text-center", children: [
9917
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineOne }),
9918
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineTwo })
10074
+ content: /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "text-center", children: [
10075
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineOne }),
10076
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineTwo })
9919
10077
  ] }),
9920
10078
  classNames: {
9921
10079
  content: "min-w-96 max-w-none!",
@@ -9926,7 +10084,7 @@ var TransferFeeSummary = ({
9926
10084
  )
9927
10085
  ] }),
9928
10086
  separator,
9929
- /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { children: [
10087
+ /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("span", { children: [
9930
10088
  labels.withdraw.walletFlow.youReceive,
9931
10089
  ": ",
9932
10090
  estimate.youReceive
@@ -9935,7 +10093,7 @@ var TransferFeeSummary = ({
9935
10093
  };
9936
10094
 
9937
10095
  // src/withdraw/steps/withdraw-amount.tsx
9938
- var import_jsx_runtime150 = require("react/jsx-runtime");
10096
+ var import_jsx_runtime151 = require("react/jsx-runtime");
9939
10097
  var formatRawTokenAmount = (rawAmount, decimals) => {
9940
10098
  if (!rawAmount) return "0";
9941
10099
  const raw = BigInt(rawAmount);
@@ -9981,7 +10139,7 @@ var WithdrawAmountStep = ({
9981
10139
  onContinue
9982
10140
  }) => {
9983
10141
  var _a, _b, _c, _d;
9984
- const labels = (0, import_hooks47.useLabels)();
10142
+ const labels = (0, import_hooks48.useLabels)();
9985
10143
  const SOLANA_CHAIN_ID = "792703809";
9986
10144
  const isSolanaDest = selectedNetwork === SOLANA_CHAIN_ID;
9987
10145
  const trimmedDestination = destinationWallet.trim();
@@ -9989,7 +10147,7 @@ var WithdrawAmountStep = ({
9989
10147
  const isValid = Number(amount2) > 0 && isValidAddress;
9990
10148
  const amountRaw = amount2 && Number(amount2) > 0 ? parseTokenAmountToRaw(amount2, destDecimals) : null;
9991
10149
  const destinationChainId = Number(selectedNetwork) || null;
9992
- const preview = (0, import_hooks47.useWithdrawPreview)({
10150
+ const preview = (0, import_hooks48.useWithdrawPreview)({
9993
10151
  amountRaw,
9994
10152
  tokenSymbol: selectedToken || null,
9995
10153
  destinationChainId,
@@ -10006,29 +10164,29 @@ var WithdrawAmountStep = ({
10006
10164
  youReceive: preview.data.receiveAmountRaw != null ? `~${formatRawTokenAmount(preview.data.receiveAmountRaw, destDecimals)} ${selectedToken}` : "\u2014"
10007
10165
  } : null;
10008
10166
  const shouldShowWithdrawEstimate = Boolean(withdrawEstimate);
10009
- return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(import_jsx_runtime150.Fragment, { children: [
10010
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
10167
+ return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(import_jsx_runtime151.Fragment, { children: [
10168
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10011
10169
  Modal.Header,
10012
10170
  {
10013
10171
  title: title2 != null ? title2 : labels.withdraw.walletFlow.title,
10014
10172
  hideBorder: true,
10015
- leftElement: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
10173
+ leftElement: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10016
10174
  "button",
10017
10175
  {
10018
10176
  type: "button",
10019
10177
  className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
10020
10178
  onClick: onBack,
10021
10179
  "aria-label": labels.withdraw.back,
10022
- children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
10180
+ children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
10023
10181
  }
10024
10182
  )
10025
10183
  }
10026
10184
  ),
10027
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "flex flex-col gap-5", children: [
10028
- /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "flex flex-col gap-5", children: [
10029
- /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "flex flex-col gap-2", children: [
10030
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.recipientAddressLabel }),
10031
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
10185
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-col gap-5", children: [
10186
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-col gap-5", children: [
10187
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-col gap-2", children: [
10188
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.recipientAddressLabel }),
10189
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10032
10190
  "input",
10033
10191
  {
10034
10192
  type: "text",
@@ -10045,17 +10203,17 @@ var WithdrawAmountStep = ({
10045
10203
  }
10046
10204
  )
10047
10205
  ] }),
10048
- /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "flex flex-col gap-2", children: [
10049
- /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "flex items-center justify-between", children: [
10050
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.amountLabel }),
10051
- /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
10206
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-col gap-2", children: [
10207
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex items-center justify-between", children: [
10208
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.amountLabel }),
10209
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
10052
10210
  labels.withdraw.balancePrefix,
10053
10211
  " ",
10054
10212
  balanceDisplay
10055
10213
  ] })
10056
10214
  ] }),
10057
- /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "flex h-10 items-center gap-2 rounded border border-agg-separator bg-agg-secondary px-3 focus-within:border-agg-primary transition-colors", children: [
10058
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
10215
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex h-10 items-center gap-2 rounded border border-agg-separator bg-agg-secondary px-3 focus-within:border-agg-primary transition-colors", children: [
10216
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10059
10217
  "input",
10060
10218
  {
10061
10219
  type: "text",
@@ -10070,8 +10228,8 @@ var WithdrawAmountStep = ({
10070
10228
  onChange: (e) => onAmountChange(e.target.value)
10071
10229
  }
10072
10230
  ),
10073
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("span", { className: "agg-type-body text-agg-muted-foreground shrink-0", children: selectedToken }),
10074
- onMaxClick ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
10231
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("span", { className: "agg-type-body text-agg-muted-foreground shrink-0", children: selectedToken }),
10232
+ onMaxClick ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10075
10233
  "button",
10076
10234
  {
10077
10235
  type: "button",
@@ -10082,10 +10240,10 @@ var WithdrawAmountStep = ({
10082
10240
  ) : null
10083
10241
  ] })
10084
10242
  ] }),
10085
- /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "flex flex-col gap-3 sm:flex-row sm:gap-5", children: [
10086
- /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
10087
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.tokenLabel }),
10088
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
10243
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-col gap-3 sm:flex-row sm:gap-5", children: [
10244
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
10245
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.tokenLabel }),
10246
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10089
10247
  Select,
10090
10248
  {
10091
10249
  items: tokenOptions,
@@ -10096,9 +10254,9 @@ var WithdrawAmountStep = ({
10096
10254
  }
10097
10255
  )
10098
10256
  ] }),
10099
- /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
10100
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.networkLabel }),
10101
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
10257
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
10258
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.networkLabel }),
10259
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10102
10260
  Select,
10103
10261
  {
10104
10262
  items: networkOptions,
@@ -10110,47 +10268,47 @@ var WithdrawAmountStep = ({
10110
10268
  )
10111
10269
  ] })
10112
10270
  ] }),
10113
- shouldShowWithdrawEstimate && withdrawEstimate ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(TransferFeeSummary, { estimate: withdrawEstimate, view: "withdraw" }) : null,
10114
- previewUnviableMessage ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "agg-type-label text-agg-error", role: "alert", children: previewUnviableMessage }) : null
10271
+ shouldShowWithdrawEstimate && withdrawEstimate ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(TransferFeeSummary, { estimate: withdrawEstimate, view: "withdraw" }) : null,
10272
+ previewUnviableMessage ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("p", { className: "agg-type-label text-agg-error", role: "alert", children: previewUnviableMessage }) : null
10115
10273
  ] }),
10116
- /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
10274
+ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10117
10275
  Button,
10118
10276
  {
10119
10277
  variant: isValid && !isConfirming && !previewUnviable && !previewLoading ? "primary" : "secondary",
10120
10278
  size: "large",
10121
10279
  className: "w-full",
10122
10280
  disabled: isDisabled,
10123
- prefix: previewLoading && !isConfirming ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(LoadingIcon, { size: "small", className: "mr-2 text-current" }) : void 0,
10281
+ prefix: previewLoading && !isConfirming ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(LoadingIcon, { size: "small", className: "mr-2 text-current" }) : void 0,
10124
10282
  onClick: onContinue,
10125
10283
  children: isConfirming ? labels.common.loading : previewLoading ? labels.withdraw.walletFlow.calculatingFees : labels.withdraw.walletFlow.confirm
10126
10284
  }
10127
10285
  ),
10128
- error ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "agg-type-label text-agg-error text-center", role: "alert", children: error }) : null
10286
+ error ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("p", { className: "agg-type-label text-agg-error text-center", role: "alert", children: error }) : null
10129
10287
  ] }) })
10130
10288
  ] });
10131
10289
  };
10132
10290
 
10133
10291
  // src/withdraw/steps/withdraw-success.tsx
10134
- var import_hooks48 = require("@agg-build/hooks");
10135
- var import_jsx_runtime151 = require("react/jsx-runtime");
10136
- var SummaryRow = ({ label: label2, value }) => /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex items-center justify-between gap-4 border-b border-agg-separator py-2 last:border-b-0", children: [
10137
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("p", { className: "min-w-0 text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label2 }),
10138
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("p", { className: "min-w-0 text-right text-[14px] leading-5 text-agg-foreground", children: value })
10292
+ var import_hooks49 = require("@agg-build/hooks");
10293
+ var import_jsx_runtime152 = require("react/jsx-runtime");
10294
+ var SummaryRow = ({ label: label2, value }) => /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: "flex items-center justify-between gap-4 border-b border-agg-separator py-2 last:border-b-0", children: [
10295
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("p", { className: "min-w-0 text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label2 }),
10296
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("p", { className: "min-w-0 text-right text-[14px] leading-5 text-agg-foreground", children: value })
10139
10297
  ] });
10140
- var WithdrawCloseButton = ({ onClose, label: label2 }) => /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10298
+ var WithdrawCloseButton = ({ onClose, label: label2 }) => /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10141
10299
  "button",
10142
10300
  {
10143
10301
  type: "button",
10144
10302
  className: "absolute right-8 top-7 flex cursor-pointer items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
10145
10303
  onClick: onClose,
10146
10304
  "aria-label": label2,
10147
- children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(CloseIcon, { className: "h-6 w-6" })
10305
+ children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(CloseIcon, { className: "h-6 w-6" })
10148
10306
  }
10149
10307
  );
10150
10308
  var LoadingGlyph = ({
10151
10309
  className,
10152
10310
  enableAnimations
10153
- }) => /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10311
+ }) => /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10154
10312
  "span",
10155
10313
  {
10156
10314
  "aria-hidden": "true",
@@ -10176,33 +10334,33 @@ var WithdrawLoadingStep = ({
10176
10334
  lifecycleState,
10177
10335
  onClose
10178
10336
  }) => {
10179
- const labels = (0, import_hooks48.useLabels)();
10337
+ const labels = (0, import_hooks49.useLabels)();
10180
10338
  const {
10181
10339
  features: { enableAnimations }
10182
- } = (0, import_hooks48.useSdkUiConfig)();
10340
+ } = (0, import_hooks49.useSdkUiConfig)();
10183
10341
  const walletFlowLabels = labels.withdraw.walletFlow;
10184
10342
  const activeIndex = loadingActiveIndexFor(lifecycleState);
10185
10343
  const loadingSteps = getLoadingSteps(walletFlowLabels);
10186
- return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Modal.Body, { classNames: { root: "px-8 py-7" }, children: /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-col gap-7", children: [
10187
- /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
10188
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: walletFlowLabels.successTitle }),
10189
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10344
+ return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(Modal.Body, { classNames: { root: "px-8 py-7" }, children: /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: "flex flex-col gap-7", children: [
10345
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
10346
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: walletFlowLabels.successTitle }),
10347
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10190
10348
  "button",
10191
10349
  {
10192
10350
  type: "button",
10193
10351
  className: "flex cursor-pointer items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
10194
10352
  onClick: onClose,
10195
10353
  "aria-label": labels.common.close,
10196
- children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(CloseIcon, { className: "h-6 w-6" })
10354
+ children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(CloseIcon, { className: "h-6 w-6" })
10197
10355
  }
10198
10356
  )
10199
10357
  ] }),
10200
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("div", { className: "flex flex-col gap-5", role: "status", "aria-live": "polite", children: loadingSteps.map((step, index) => {
10358
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { className: "flex flex-col gap-5", role: "status", "aria-live": "polite", children: loadingSteps.map((step, index) => {
10201
10359
  const isComplete = index < activeIndex;
10202
10360
  const isActive = index === activeIndex;
10203
10361
  const textClassName = isActive || isComplete ? "text-agg-foreground" : "text-agg-muted-foreground";
10204
- return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex items-center gap-3", children: [
10205
- isComplete ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10362
+ return /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: "flex items-center gap-3", children: [
10363
+ isComplete ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10206
10364
  Icon,
10207
10365
  {
10208
10366
  name: "check-circle",
@@ -10211,24 +10369,24 @@ var WithdrawLoadingStep = ({
10211
10369
  "aria-hidden": "true"
10212
10370
  }
10213
10371
  ) : null,
10214
- isActive ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10372
+ isActive ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10215
10373
  LoadingGlyph,
10216
10374
  {
10217
10375
  enableAnimations,
10218
10376
  className: "h-4 w-4 shrink-0 text-agg-primary"
10219
10377
  }
10220
10378
  ) : null,
10221
- !isComplete && !isActive ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10379
+ !isComplete && !isActive ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10222
10380
  "span",
10223
10381
  {
10224
10382
  "aria-hidden": "true",
10225
10383
  className: "h-4 w-4 shrink-0 rounded-full border border-agg-separator"
10226
10384
  }
10227
10385
  ) : null,
10228
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("p", { className: cn("min-w-0 flex-1 text-agg-base leading-agg-6", textClassName), children: step.label })
10386
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("p", { className: cn("min-w-0 flex-1 text-agg-base leading-agg-6", textClassName), children: step.label })
10229
10387
  ] }, step.id);
10230
10388
  }) }),
10231
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: walletFlowLabels.loadingDescription })
10389
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: walletFlowLabels.loadingDescription })
10232
10390
  ] }) }) });
10233
10391
  };
10234
10392
  var resultCopyFor = ({
@@ -10263,7 +10421,7 @@ var WithdrawSuccessStep = ({
10263
10421
  onRetry,
10264
10422
  onClose
10265
10423
  }) => {
10266
- const labels = (0, import_hooks48.useLabels)();
10424
+ const labels = (0, import_hooks49.useLabels)();
10267
10425
  const walletFlowLabels = labels.withdraw.walletFlow;
10268
10426
  const { title: title2, description } = resultCopyFor({
10269
10427
  status: resultStatus,
@@ -10271,10 +10429,10 @@ var WithdrawSuccessStep = ({
10271
10429
  labels: walletFlowLabels
10272
10430
  });
10273
10431
  const isFailed = resultStatus === "failed";
10274
- return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(Modal.Body, { classNames: { root: "px-10 py-12" }, children: [
10275
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(WithdrawCloseButton, { onClose, label: labels.common.close }),
10276
- /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-col items-center justify-center gap-8 text-center", children: [
10277
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10432
+ return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(Modal.Body, { classNames: { root: "px-10 py-12" }, children: [
10433
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(WithdrawCloseButton, { onClose, label: labels.common.close }),
10434
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: "flex flex-col items-center justify-center gap-8 text-center", children: [
10435
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10278
10436
  "div",
10279
10437
  {
10280
10438
  className: cn(
@@ -10282,12 +10440,12 @@ var WithdrawSuccessStep = ({
10282
10440
  isFailed ? "bg-agg-error/15" : "bg-agg-success/15"
10283
10441
  ),
10284
10442
  "aria-hidden": "true",
10285
- children: isFailed ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(CloseIcon, { className: "h-6 w-6 text-agg-error" }) : /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(SuccessCheckIcon, { className: "h-6 w-6 text-agg-success" })
10443
+ children: isFailed ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(CloseIcon, { className: "h-6 w-6 text-agg-error" }) : /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(SuccessCheckIcon, { className: "h-6 w-6 text-agg-success" })
10286
10444
  }
10287
10445
  ),
10288
- /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex w-full flex-col items-center gap-3 text-center text-agg-foreground", children: [
10289
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold", children: title2 }),
10290
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10446
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: "flex w-full flex-col items-center gap-3 text-center text-agg-foreground", children: [
10447
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold", children: title2 }),
10448
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10291
10449
  "p",
10292
10450
  {
10293
10451
  className: "max-w-[400px] text-agg-base leading-agg-6",
@@ -10296,35 +10454,35 @@ var WithdrawSuccessStep = ({
10296
10454
  }
10297
10455
  )
10298
10456
  ] }),
10299
- !isFailed ? /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex w-full max-w-[400px] flex-col rounded-agg-lg border border-agg-separator bg-agg-secondary px-3 py-1 text-left", children: [
10300
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10457
+ !isFailed ? /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: "flex w-full max-w-[400px] flex-col rounded-agg-lg border border-agg-separator bg-agg-secondary px-3 py-1 text-left", children: [
10458
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10301
10459
  SummaryRow,
10302
10460
  {
10303
10461
  label: walletFlowLabels.summary.requestedWithdrawal,
10304
10462
  value: requestedWithdrawal
10305
10463
  }
10306
10464
  ),
10307
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
10465
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10308
10466
  SummaryRow,
10309
10467
  {
10310
10468
  label: walletFlowLabels.summary.amountReceived,
10311
10469
  value: summary.amountReceived
10312
10470
  }
10313
10471
  ),
10314
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(SummaryRow, { label: walletFlowLabels.summary.fees, value: summary.fees }),
10315
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(SummaryRow, { label: walletFlowLabels.summary.network, value: summary.network }),
10316
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(SummaryRow, { label: walletFlowLabels.summary.toWallet, value: summary.toWallet })
10472
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(SummaryRow, { label: walletFlowLabels.summary.fees, value: summary.fees }),
10473
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(SummaryRow, { label: walletFlowLabels.summary.network, value: summary.network }),
10474
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(SummaryRow, { label: walletFlowLabels.summary.toWallet, value: summary.toWallet })
10317
10475
  ] }) : null,
10318
- isFailed ? /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex items-center justify-center gap-3", children: [
10319
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onClose, children: walletFlowLabels.close }),
10320
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Button, { variant: "primary", size: "large", className: "w-[123px]", onClick: onRetry, children: walletFlowLabels.retry })
10321
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.withdraw.done })
10476
+ isFailed ? /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: "flex items-center justify-center gap-3", children: [
10477
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onClose, children: walletFlowLabels.close }),
10478
+ /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(Button, { variant: "primary", size: "large", className: "w-[123px]", onClick: onRetry, children: walletFlowLabels.retry })
10479
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.withdraw.done })
10322
10480
  ] })
10323
10481
  ] }) });
10324
10482
  };
10325
10483
 
10326
10484
  // src/withdraw/index.tsx
10327
- var import_jsx_runtime152 = require("react/jsx-runtime");
10485
+ var import_jsx_runtime153 = require("react/jsx-runtime");
10328
10486
  var DEFAULT_TOKEN_DECIMALS = 6;
10329
10487
  var TOKEN_DECIMALS_BY_SYMBOL = {
10330
10488
  BNB: 18,
@@ -10407,7 +10565,7 @@ function WithdrawModalSelfDriven({
10407
10565
  onOpenChange
10408
10566
  }) {
10409
10567
  const withdrawProps = (0, import_withdraw.useWithdrawFlow)({ open, onOpenChange });
10410
- return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(WithdrawModalControlled, __spreadValues({}, withdrawProps));
10568
+ return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(WithdrawModalControlled, __spreadValues({}, withdrawProps));
10411
10569
  }
10412
10570
  function WithdrawModalControlled({
10413
10571
  open,
@@ -10424,14 +10582,14 @@ function WithdrawModalControlled({
10424
10582
  }) {
10425
10583
  var _a;
10426
10584
  const initialFormStep = transferTarget ? "withdraw-amount" : "method";
10427
- const [flowState, setFlowState] = (0, import_react21.useState)({
10585
+ const [flowState, setFlowState] = (0, import_react22.useState)({
10428
10586
  status: "form",
10429
10587
  formStep: initialFormStep
10430
10588
  });
10431
- const [isConfirming, setIsConfirming] = (0, import_react21.useState)(false);
10432
- const [confirmError, setConfirmError] = (0, import_react21.useState)(null);
10589
+ const [isConfirming, setIsConfirming] = (0, import_react22.useState)(false);
10590
+ const [confirmError, setConfirmError] = (0, import_react22.useState)(null);
10433
10591
  const { state: withdrawalLifecycleState, reset: resetWithdrawalLifecycle } = (0, import_withdraw.useWithdrawalLifecycle)(withdrawFlow.withdrawalId);
10434
- (0, import_react21.useEffect)(() => {
10592
+ (0, import_react22.useEffect)(() => {
10435
10593
  if (!open) {
10436
10594
  setFlowState({ status: "form", formStep: initialFormStep });
10437
10595
  setIsConfirming(false);
@@ -10439,7 +10597,7 @@ function WithdrawModalControlled({
10439
10597
  resetWithdrawalLifecycle();
10440
10598
  }
10441
10599
  }, [open, resetWithdrawalLifecycle, initialFormStep]);
10442
- (0, import_react21.useEffect)(() => {
10600
+ (0, import_react22.useEffect)(() => {
10443
10601
  if (flowState.status !== "loading") return;
10444
10602
  if (!withdrawalLifecycleState.terminal) return;
10445
10603
  if (withdrawalLifecycleState.status === "completed") {
@@ -10514,15 +10672,15 @@ function WithdrawModalControlled({
10514
10672
  tokenSymbol: withdrawFlow.selectedToken,
10515
10673
  chainId: withdrawFlow.selectedNetwork
10516
10674
  });
10517
- return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(Modal.Container, { maxWidth: modalMaxWidth, "aria-label": (_a = transferTarget == null ? void 0 : transferTarget.title) != null ? _a : "Withdraw", children: [
10518
- flowState.status === "form" && flowState.formStep === "method" ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10675
+ return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(Modal.Container, { maxWidth: modalMaxWidth, "aria-label": (_a = transferTarget == null ? void 0 : transferTarget.title) != null ? _a : "Withdraw", children: [
10676
+ flowState.status === "form" && flowState.formStep === "method" ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
10519
10677
  WithdrawMethodStep,
10520
10678
  {
10521
10679
  balance: withdrawFlow.balance,
10522
10680
  onSelectMethod: () => setFlowState({ status: "form", formStep: "withdraw-amount" })
10523
10681
  }
10524
10682
  ) : null,
10525
- flowState.status === "form" && flowState.formStep === "withdraw-amount" ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10683
+ flowState.status === "form" && flowState.formStep === "withdraw-amount" ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
10526
10684
  WithdrawAmountStep,
10527
10685
  {
10528
10686
  title: transferTarget == null ? void 0 : transferTarget.title,
@@ -10550,14 +10708,14 @@ function WithdrawModalControlled({
10550
10708
  onContinue: handleConfirm
10551
10709
  }
10552
10710
  ) : null,
10553
- flowState.status === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10711
+ flowState.status === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
10554
10712
  WithdrawLoadingStep,
10555
10713
  {
10556
10714
  lifecycleState: withdrawalLifecycleState,
10557
10715
  onClose: () => handleOpenChange(false)
10558
10716
  }
10559
10717
  ) : null,
10560
- flowState.status === "success" || flowState.status === "partial_success" || flowState.status === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
10718
+ flowState.status === "success" || flowState.status === "partial_success" || flowState.status === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
10561
10719
  WithdrawSuccessStep,
10562
10720
  {
10563
10721
  summary: terminalSummary,
@@ -10574,19 +10732,19 @@ function WithdrawModalControlled({
10574
10732
  }
10575
10733
  var WithdrawModal = (props) => {
10576
10734
  if (isControlledWithdrawModalProps(props)) {
10577
- return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(WithdrawModalControlled, __spreadValues({}, props));
10735
+ return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(WithdrawModalControlled, __spreadValues({}, props));
10578
10736
  }
10579
- return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(WithdrawModalSelfDriven, __spreadValues({}, props));
10737
+ return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(WithdrawModalSelfDriven, __spreadValues({}, props));
10580
10738
  };
10581
10739
  WithdrawModal.displayName = "WithdrawModal";
10582
10740
 
10583
10741
  // src/pages/user-profile/components/betdex-wallet-deposit.tsx
10584
- var import_jsx_runtime153 = require("react/jsx-runtime");
10742
+ var import_jsx_runtime154 = require("react/jsx-runtime");
10585
10743
  function BetdexWalletDeposit({
10586
10744
  address,
10587
10745
  onClose
10588
10746
  }) {
10589
- const labels = (0, import_hooks49.useLabels)().userProfile.hostedBetdex;
10747
+ const labels = (0, import_hooks50.useLabels)().userProfile.hostedBetdex;
10590
10748
  const flow = (0, import_withdraw2.useWithdrawFlow)({
10591
10749
  open: true,
10592
10750
  onOpenChange: (open) => {
@@ -10594,12 +10752,12 @@ function BetdexWalletDeposit({
10594
10752
  }
10595
10753
  });
10596
10754
  const { onWithdrawDestinationChange, onWithdrawNetworkChange, onWithdrawTokenChange } = flow;
10597
- (0, import_react22.useEffect)(() => {
10755
+ (0, import_react23.useEffect)(() => {
10598
10756
  onWithdrawDestinationChange(address);
10599
10757
  onWithdrawNetworkChange("792703809");
10600
10758
  onWithdrawTokenChange("USDC");
10601
10759
  }, [address, onWithdrawDestinationChange, onWithdrawNetworkChange, onWithdrawTokenChange]);
10602
- return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
10760
+ return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
10603
10761
  WithdrawModal,
10604
10762
  __spreadProps(__spreadValues({}, flow), {
10605
10763
  transferTarget: {
@@ -10613,35 +10771,35 @@ function BetdexWalletDeposit({
10613
10771
  }
10614
10772
 
10615
10773
  // src/trading/manage-betdex-account-modal.tsx
10616
- var import_jsx_runtime154 = require("react/jsx-runtime");
10774
+ var import_jsx_runtime155 = require("react/jsx-runtime");
10617
10775
  function ManageBetdexAccountModal({
10618
10776
  open,
10619
10777
  onOpenChange,
10620
10778
  userId
10621
10779
  }) {
10622
- const labels = (0, import_hooks50.useLabels)();
10623
- const [fundingTarget, setFundingTarget] = (0, import_react23.useState)(
10780
+ const labels = (0, import_hooks51.useLabels)();
10781
+ const [fundingTarget, setFundingTarget] = (0, import_react24.useState)(
10624
10782
  null
10625
10783
  );
10626
10784
  const currentTarget = (fundingTarget == null ? void 0 : fundingTarget.userId) === userId ? fundingTarget : null;
10627
- (0, import_react23.useEffect)(() => {
10785
+ (0, import_react24.useEffect)(() => {
10628
10786
  if (!open) setFundingTarget(null);
10629
10787
  }, [open]);
10630
- (0, import_react23.useEffect)(() => setFundingTarget(null), [userId]);
10631
- return /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(import_jsx_runtime154.Fragment, { children: [
10632
- /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(Modal, { open: open && !currentTarget, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(Modal.Container, { maxWidth: "600px", "aria-label": labels.trading.manageBetdexAccount, children: [
10633
- /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
10634
- Dialog8.Close,
10788
+ (0, import_react24.useEffect)(() => setFundingTarget(null), [userId]);
10789
+ return /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(import_jsx_runtime155.Fragment, { children: [
10790
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(Modal, { open: open && !currentTarget, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(Modal.Container, { maxWidth: "600px", "aria-label": labels.trading.manageBetdexAccount, children: [
10791
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
10792
+ Dialog9.Close,
10635
10793
  {
10636
10794
  "aria-label": labels.common.close,
10637
10795
  className: "absolute right-4 top-4 z-10 flex size-11 cursor-pointer items-center justify-center rounded-agg-full text-agg-muted-foreground hover:bg-agg-quaternary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-accent",
10638
- children: /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(Icon, { name: "close", size: "medium" })
10796
+ children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(Icon, { name: "close", size: "medium" })
10639
10797
  }
10640
10798
  ),
10641
- /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(Modal.Body, { classNames: { root: "!px-5 !py-16" }, children: [
10642
- /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(Dialog8.Title, { className: "sr-only", children: labels.trading.manageBetdexAccount }),
10643
- /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(Dialog8.Description, { className: "sr-only", children: labels.userProfile.hostedBetdex.description }),
10644
- open ? /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
10799
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(Modal.Body, { classNames: { root: "!px-5 !py-16" }, children: [
10800
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(Dialog9.Title, { className: "sr-only", children: labels.trading.manageBetdexAccount }),
10801
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(Dialog9.Description, { className: "sr-only", children: labels.userProfile.hostedBetdex.description }),
10802
+ open ? /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
10645
10803
  BetdexAccountCard,
10646
10804
  {
10647
10805
  onWalletDeposit: userId ? (address) => setFundingTarget({ userId, address }) : void 0
@@ -10649,7 +10807,7 @@ function ManageBetdexAccountModal({
10649
10807
  ) : null
10650
10808
  ] })
10651
10809
  ] }) }),
10652
- open && currentTarget ? /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
10810
+ open && currentTarget ? /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
10653
10811
  BetdexWalletDeposit,
10654
10812
  {
10655
10813
  address: currentTarget.address,
@@ -10952,7 +11110,7 @@ var formatChainIdLabel = (chainId) => {
10952
11110
  };
10953
11111
 
10954
11112
  // src/trading/place-order/index.place-order.utils.ts
10955
- var import_sdk21 = require("@agg-build/sdk");
11113
+ var import_sdk22 = require("@agg-build/sdk");
10956
11114
  var ATOMIC_UNITS = 1e6;
10957
11115
  var ATOMIC_UNITS_BIGINT = BigInt(ATOMIC_UNITS);
10958
11116
  var getPlaceOrderBalanceCacheKey = (balances) => {
@@ -11038,7 +11196,7 @@ var resolveSellableSharesByVenue = ({
11038
11196
  market,
11039
11197
  selectedOutcome
11040
11198
  }) => {
11041
- var _a, _b, _c, _d, _e, _f, _g;
11199
+ var _a, _b, _c, _d, _e, _f, _g, _h;
11042
11200
  const sharesByVenue = /* @__PURE__ */ new Map();
11043
11201
  if (!market || !selectedOutcome) return sharesByVenue;
11044
11202
  const normalizedSelectedOutcomeLabel = normalizeOutcomeName(selectedOutcome.label);
@@ -11050,16 +11208,32 @@ var resolveSellableSharesByVenue = ({
11050
11208
  ...((_c = market.matchedVenueMarkets) != null ? _c : []).map((matched) => matched.id)
11051
11209
  ].filter((value) => Boolean(value))
11052
11210
  );
11211
+ const selectedOutcomeRefs = [
11212
+ { venueMarketId: market.id, venueMarketOutcomeId: selectedOutcome.id },
11213
+ ...(_d = selectedOutcome.matchedVenueMarketOutcomes) != null ? _d : []
11214
+ ];
11215
+ const referencedMarketIds = new Set(selectedOutcomeRefs.map((ref) => ref.venueMarketId));
11216
+ const referencedOutcomeKeys = new Set(
11217
+ selectedOutcomeRefs.map((ref) => `${ref.venueMarketId}\0${ref.venueMarketOutcomeId}`)
11218
+ );
11053
11219
  for (const group of positions) {
11054
- for (const outcome of (_e = (_d = group.venueMarket) == null ? void 0 : _d.venueMarketOutcomes) != null ? _e : []) {
11055
- if (normalizeOutcomeName(outcome.label) !== normalizedSelectedOutcomeLabel) continue;
11056
- for (const breakdown of (_f = outcome.venueBreakdown) != null ? _f : []) {
11057
- if (breakdown.executionBackend === "direct" && breakdown.venue === "prophetx") continue;
11058
- const matchesMarketId = selectedMarketIdSet.size === 0 || selectedMarketIdSet.has(group.targetMarketId) || selectedMarketIdSet.has(breakdown.venueMarketId);
11059
- if (!matchesMarketId) continue;
11220
+ for (const outcome of (_f = (_e = group.venueMarket) == null ? void 0 : _e.venueMarketOutcomes) != null ? _f : []) {
11221
+ const labelMatches = normalizeOutcomeName(outcome.label) === normalizedSelectedOutcomeLabel;
11222
+ for (const breakdown of (_g = outcome.venueBreakdown) != null ? _g : []) {
11223
+ if (breakdown.executionBackend === "direct" && (breakdown.venue === "prophetx" || breakdown.venue === "novig"))
11224
+ continue;
11225
+ const heldOutcomeId = breakdown.venueMarketOutcomeId;
11226
+ const referenced = heldOutcomeId !== void 0 && referencedOutcomeKeys.has(`${breakdown.venueMarketId}\0${heldOutcomeId}`);
11227
+ if (!referenced) {
11228
+ if (heldOutcomeId !== void 0 && (referencedMarketIds.has(breakdown.venueMarketId) || referencedMarketIds.has(group.targetMarketId)))
11229
+ continue;
11230
+ if (!labelMatches) continue;
11231
+ const matchesMarketId = selectedMarketIdSet.size === 0 || selectedMarketIdSet.has(group.targetMarketId) || selectedMarketIdSet.has(breakdown.venueMarketId);
11232
+ if (!matchesMarketId) continue;
11233
+ }
11060
11234
  const size = Number.isFinite(breakdown.size) ? breakdown.size : 0;
11061
11235
  if (size <= 0) continue;
11062
- sharesByVenue.set(breakdown.venue, ((_g = sharesByVenue.get(breakdown.venue)) != null ? _g : 0) + size);
11236
+ sharesByVenue.set(breakdown.venue, ((_h = sharesByVenue.get(breakdown.venue)) != null ? _h : 0) + size);
11063
11237
  }
11064
11238
  }
11065
11239
  }
@@ -11630,16 +11804,16 @@ var buildLiveRouteCards = ({
11630
11804
  ];
11631
11805
  })() : [];
11632
11806
  const betdexFundingWarnings = tradeSide === "buy" ? ((_f = quoteData.warnings) != null ? _f : []).filter(
11633
- (warning) => warning.venue === import_sdk21.Venue.betdex && warning.reason === "hosted_cash_unavailable"
11807
+ (warning) => warning.venue === import_sdk22.Venue.betdex && warning.reason === "hosted_cash_unavailable"
11634
11808
  ) : [];
11635
- if (tradeSide === "buy" && betdexFundingRequired && betdexFundingWarnings.length === 0 && quoteData.matchedMarkets.some((market) => market.venue === import_sdk21.Venue.betdex) && !((_g = quoteData.warnings) != null ? _g : []).some((warning) => warning.venue === import_sdk21.Venue.betdex)) {
11809
+ if (tradeSide === "buy" && betdexFundingRequired && betdexFundingWarnings.length === 0 && quoteData.matchedMarkets.some((market) => market.venue === import_sdk22.Venue.betdex) && !((_g = quoteData.warnings) != null ? _g : []).some((warning) => warning.venue === import_sdk22.Venue.betdex)) {
11636
11810
  betdexFundingWarnings.push({
11637
- venue: import_sdk21.Venue.betdex,
11638
- venueMarketOutcomeId: (_j = (_i = (_h = quoteData.venueSoloQuotes) == null ? void 0 : _h.find((solo) => solo.venue === import_sdk21.Venue.betdex)) == null ? void 0 : _i.venueMarketOutcomeId) != null ? _j : "",
11811
+ venue: import_sdk22.Venue.betdex,
11812
+ venueMarketOutcomeId: (_j = (_i = (_h = quoteData.venueSoloQuotes) == null ? void 0 : _h.find((solo) => solo.venue === import_sdk22.Venue.betdex)) == null ? void 0 : _i.venueMarketOutcomeId) != null ? _j : "",
11639
11813
  reason: "hosted_cash_unavailable"
11640
11814
  });
11641
11815
  }
11642
- const fundingCards = eventVenueSet.has(import_sdk21.Venue.betdex) && !coveredVenueStrings.has(import_sdk21.Venue.betdex) && !geoBlockedVenues.has(import_sdk21.Venue.betdex) ? [
11816
+ const fundingCards = eventVenueSet.has(import_sdk22.Venue.betdex) && !coveredVenueStrings.has(import_sdk22.Venue.betdex) && !geoBlockedVenues.has(import_sdk22.Venue.betdex) ? [
11643
11817
  ...new Map(
11644
11818
  betdexFundingWarnings.map((warning) => [warning.venueMarketOutcomeId, warning])
11645
11819
  ).values()
@@ -11648,7 +11822,7 @@ var buildLiveRouteCards = ({
11648
11822
  venueMarketOutcomeId: warning.venueMarketOutcomeId,
11649
11823
  hint: labels.manageBetdexAccount,
11650
11824
  kind: "venue",
11651
- label: getTradingVenueLabel(import_sdk21.Venue.betdex),
11825
+ label: getTradingVenueLabel(import_sdk22.Venue.betdex),
11652
11826
  numericValue: 0,
11653
11827
  quoteData: __spreadProps(__spreadValues({}, quoteData), {
11654
11828
  quoteId: "",
@@ -11664,7 +11838,7 @@ var buildLiveRouteCards = ({
11664
11838
  error: void 0
11665
11839
  }),
11666
11840
  value: "",
11667
- venue: import_sdk21.Venue.betdex
11841
+ venue: import_sdk22.Venue.betdex
11668
11842
  })) : [];
11669
11843
  return [...baseCards, ...unavailableCards, ...warningOnlyUnavailableCards, ...fundingCards];
11670
11844
  };
@@ -13137,17 +13311,17 @@ var calculateExecutionProgress = ({
13137
13311
  };
13138
13312
 
13139
13313
  // src/trading/place-order/index.place-order.execution-view.tsx
13140
- var import_react24 = require("react");
13141
- var import_jsx_runtime155 = require("react/jsx-runtime");
13314
+ var import_react25 = require("react");
13315
+ var import_jsx_runtime156 = require("react/jsx-runtime");
13142
13316
  var PlaceOrderExecutionHeader = ({
13143
13317
  className,
13144
13318
  eventDateLabel,
13145
13319
  eventImage,
13146
13320
  eventTitle
13147
13321
  }) => {
13148
- return /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: cn("agg-order-execution-header flex flex-col gap-2", className), children: [
13149
- /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: "flex items-center gap-3", children: [
13150
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13322
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: cn("agg-order-execution-header flex flex-col gap-2", className), children: [
13323
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-3", children: [
13324
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13151
13325
  RemoteImage,
13152
13326
  {
13153
13327
  src: eventImage != null ? eventImage : null,
@@ -13155,17 +13329,17 @@ var PlaceOrderExecutionHeader = ({
13155
13329
  className: "h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
13156
13330
  }
13157
13331
  ),
13158
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("p", { className: "min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: eventTitle })
13332
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: eventTitle })
13159
13333
  ] }),
13160
- eventDateLabel ? /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: eventDateLabel }) : null
13334
+ eventDateLabel ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: eventDateLabel }) : null
13161
13335
  ] });
13162
13336
  };
13163
13337
  var PROGRESS_TWEEN_MS = 700;
13164
13338
  var prefersReducedMotion = () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
13165
13339
  var useTweenedProgress = (target, enabled) => {
13166
- const [value, setValue] = (0, import_react24.useState)(target);
13167
- const valueRef = (0, import_react24.useRef)(target);
13168
- (0, import_react24.useEffect)(() => {
13340
+ const [value, setValue] = (0, import_react25.useState)(target);
13341
+ const valueRef = (0, import_react25.useRef)(target);
13342
+ (0, import_react25.useEffect)(() => {
13169
13343
  const from = valueRef.current;
13170
13344
  if (!enabled || from === target || prefersReducedMotion()) {
13171
13345
  valueRef.current = target;
@@ -13195,12 +13369,12 @@ var ExecutionProgressBar = ({
13195
13369
  const clamped = Math.max(0, Math.min(100, progress));
13196
13370
  const displayed = useTweenedProgress(clamped, enableAnimations);
13197
13371
  const isRunning = clamped < 100;
13198
- return /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: "flex items-center gap-3", children: [
13199
- /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("p", { className: "shrink-0 tabular-nums text-agg-sm leading-agg-5 text-agg-muted-foreground", children: [
13372
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-3", children: [
13373
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("p", { className: "shrink-0 tabular-nums text-agg-sm leading-agg-5 text-agg-muted-foreground", children: [
13200
13374
  displayed,
13201
13375
  "%"
13202
13376
  ] }),
13203
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13377
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13204
13378
  "div",
13205
13379
  {
13206
13380
  role: "progressbar",
@@ -13209,7 +13383,7 @@ var ExecutionProgressBar = ({
13209
13383
  "aria-valuemax": 100,
13210
13384
  "aria-valuenow": clamped,
13211
13385
  className: "relative h-1 min-w-0 flex-1 overflow-hidden rounded-agg-full bg-agg-separator",
13212
- children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13386
+ children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13213
13387
  "div",
13214
13388
  {
13215
13389
  className: cn(
@@ -13220,7 +13394,7 @@ var ExecutionProgressBar = ({
13220
13394
  )
13221
13395
  ),
13222
13396
  style: { width: `${clamped}%` },
13223
- children: isRunning ? /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13397
+ children: isRunning ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13224
13398
  "span",
13225
13399
  {
13226
13400
  "aria-hidden": "true",
@@ -13244,7 +13418,7 @@ var ExecutionStepIndicator = ({
13244
13418
  step
13245
13419
  }) => {
13246
13420
  if (step.status === "done") {
13247
- return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13421
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13248
13422
  Icon,
13249
13423
  {
13250
13424
  name: "check-circle",
@@ -13255,7 +13429,7 @@ var ExecutionStepIndicator = ({
13255
13429
  );
13256
13430
  }
13257
13431
  if (step.status === "loading") {
13258
- return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "inline-flex h-3 w-3 shrink-0 items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13432
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("span", { className: "inline-flex h-3 w-3 shrink-0 items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13259
13433
  "span",
13260
13434
  {
13261
13435
  className: cn(
@@ -13266,7 +13440,7 @@ var ExecutionStepIndicator = ({
13266
13440
  ) });
13267
13441
  }
13268
13442
  if (step.status === "failed") {
13269
- return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13443
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13270
13444
  Icon,
13271
13445
  {
13272
13446
  name: "error-filled",
@@ -13277,7 +13451,7 @@ var ExecutionStepIndicator = ({
13277
13451
  );
13278
13452
  }
13279
13453
  if (step.status === "warning") {
13280
- return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13454
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13281
13455
  Icon,
13282
13456
  {
13283
13457
  name: "warning-filled",
@@ -13287,7 +13461,7 @@ var ExecutionStepIndicator = ({
13287
13461
  }
13288
13462
  );
13289
13463
  }
13290
- return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13464
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13291
13465
  "span",
13292
13466
  {
13293
13467
  className: "h-3 w-3 shrink-0 rounded-full border border-dashed border-agg-separator",
@@ -13300,17 +13474,17 @@ var PlaceOrderExecutionGroups = ({
13300
13474
  groups,
13301
13475
  labels
13302
13476
  }) => {
13303
- return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("div", { className: "agg-order-execution-groups flex flex-col gap-5", children: groups.map((group) => {
13477
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "agg-order-execution-groups flex flex-col gap-5", children: groups.map((group) => {
13304
13478
  var _a, _b;
13305
- return /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(
13479
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
13306
13480
  "section",
13307
13481
  {
13308
13482
  className: "agg-order-execution-group flex flex-col gap-3",
13309
13483
  "aria-label": (_a = group.title) != null ? _a : labels.venueOrder(group.venueLabel),
13310
13484
  children: [
13311
- /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: "flex min-h-5 items-center justify-between gap-3 text-agg-sm leading-agg-5", children: [
13312
- /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-agg-foreground", children: [
13313
- group.venue ? /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13485
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-h-5 items-center justify-between gap-3 text-agg-sm leading-agg-5", children: [
13486
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-agg-foreground", children: [
13487
+ group.venue ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13314
13488
  VenueLogo,
13315
13489
  {
13316
13490
  venue: group.venue,
@@ -13319,22 +13493,22 @@ var PlaceOrderExecutionGroups = ({
13319
13493
  className: "h-3.5 w-3.5 shrink-0"
13320
13494
  }
13321
13495
  ) : null,
13322
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("h3", { className: "truncate font-agg-normal", children: (_b = group.title) != null ? _b : labels.venueOrder(group.venueLabel) })
13496
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("h3", { className: "truncate font-agg-normal", children: (_b = group.title) != null ? _b : labels.venueOrder(group.venueLabel) })
13323
13497
  ] }),
13324
- /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
13325
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "text-agg-muted-foreground", children: group.priceLabel }),
13326
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "text-agg-foreground", children: group.amountLabel })
13498
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
13499
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("span", { className: "text-agg-muted-foreground", children: group.priceLabel }),
13500
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("span", { className: "text-agg-foreground", children: group.amountLabel })
13327
13501
  ] })
13328
13502
  ] }),
13329
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("div", { className: "flex flex-col gap-3 pl-[22px]", children: group.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(
13503
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "flex flex-col gap-3 pl-[22px]", children: group.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
13330
13504
  "div",
13331
13505
  {
13332
13506
  className: "flex items-start gap-2 text-agg-xs leading-agg-4 text-agg-foreground",
13333
13507
  "data-kind": step.kind,
13334
13508
  "data-status": step.status,
13335
13509
  children: [
13336
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(ExecutionStepIndicator, { enableAnimations, step }),
13337
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("p", { className: "min-w-0 flex-1", children: step.status === "done" ? step.completedLabel : step.pendingLabel })
13510
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(ExecutionStepIndicator, { enableAnimations, step }),
13511
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "min-w-0 flex-1", children: step.status === "done" ? step.completedLabel : step.pendingLabel })
13338
13512
  ]
13339
13513
  },
13340
13514
  step.id
@@ -13357,7 +13531,7 @@ var PlaceOrderExecutionView = ({
13357
13531
  progress,
13358
13532
  settlementHint
13359
13533
  }) => {
13360
- return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13534
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13361
13535
  Card,
13362
13536
  {
13363
13537
  className: cn(
@@ -13366,8 +13540,8 @@ var PlaceOrderExecutionView = ({
13366
13540
  classNames == null ? void 0 : classNames.root,
13367
13541
  className
13368
13542
  ),
13369
- children: /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: cn("flex flex-col gap-6 p-5", classNames == null ? void 0 : classNames.body), children: [
13370
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13543
+ children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: cn("flex flex-col gap-6 p-5", classNames == null ? void 0 : classNames.body), children: [
13544
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13371
13545
  PlaceOrderExecutionHeader,
13372
13546
  {
13373
13547
  className: classNames == null ? void 0 : classNames.header,
@@ -13376,8 +13550,8 @@ var PlaceOrderExecutionView = ({
13376
13550
  eventTitle
13377
13551
  }
13378
13552
  ),
13379
- /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.content), children: [
13380
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13553
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.content), children: [
13554
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13381
13555
  ExecutionProgressBar,
13382
13556
  {
13383
13557
  enableAnimations,
@@ -13385,7 +13559,7 @@ var PlaceOrderExecutionView = ({
13385
13559
  progress
13386
13560
  }
13387
13561
  ),
13388
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
13562
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13389
13563
  PlaceOrderExecutionGroups,
13390
13564
  {
13391
13565
  enableAnimations,
@@ -13393,7 +13567,7 @@ var PlaceOrderExecutionView = ({
13393
13567
  labels
13394
13568
  }
13395
13569
  ),
13396
- settlementHint ? /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: settlementHint }) : null
13570
+ settlementHint ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: settlementHint }) : null
13397
13571
  ] })
13398
13572
  ] })
13399
13573
  }
@@ -13402,7 +13576,7 @@ var PlaceOrderExecutionView = ({
13402
13576
  PlaceOrderExecutionView.displayName = "PlaceOrderExecutionView";
13403
13577
 
13404
13578
  // src/trading/place-order/index.place-order.failure.tsx
13405
- var import_jsx_runtime156 = require("react/jsx-runtime");
13579
+ var import_jsx_runtime157 = require("react/jsx-runtime");
13406
13580
  var resolveFailureActionHandler = ({
13407
13581
  action,
13408
13582
  onDone,
@@ -13415,12 +13589,12 @@ var resolveFailureActionHandler = ({
13415
13589
  };
13416
13590
  var renderPartialFailureStep = (step) => {
13417
13591
  const isWarningStep = step.tone === "warning" || step.tone === "error";
13418
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
13592
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
13419
13593
  "div",
13420
13594
  {
13421
13595
  className: "flex items-center gap-2 text-agg-sm leading-agg-5 text-agg-foreground",
13422
13596
  children: [
13423
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13597
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13424
13598
  Icon,
13425
13599
  {
13426
13600
  name: isWarningStep ? "warning-filled" : "check-circle",
@@ -13429,8 +13603,8 @@ var renderPartialFailureStep = (step) => {
13429
13603
  "aria-hidden": "true"
13430
13604
  }
13431
13605
  ),
13432
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "min-w-0 flex-1", children: step.label }),
13433
- step.venue ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(VenueLogo, { venue: step.venue, size: "small", className: "h-4 w-4 shrink-0" }) : null
13606
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "min-w-0 flex-1", children: step.label }),
13607
+ step.venue ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(VenueLogo, { venue: step.venue, size: "small", className: "h-4 w-4 shrink-0" }) : null
13434
13608
  ]
13435
13609
  },
13436
13610
  step.id
@@ -13449,10 +13623,10 @@ var PlaceOrderFailureView = ({
13449
13623
  const shouldShowPartialFailureLayout = summary.kind === "partial_fill";
13450
13624
  const failureStepGroups = shouldShowPartialFailureLayout ? groupPlaceOrderFailureSteps(summary.steps) : [];
13451
13625
  if (shouldShowPartialFailureLayout) {
13452
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Card, { className: cn("group/agg-order-panel", getPlaceOrderContainerClassName(), className), children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "agg-order-failure-body flex flex-col gap-6 p-5", children: [
13453
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "agg-order-failure-header flex flex-col gap-2", children: [
13454
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "agg-order-failure-market flex items-center gap-3", children: [
13455
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13626
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(Card, { className: cn("group/agg-order-panel", getPlaceOrderContainerClassName(), className), children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "agg-order-failure-body flex flex-col gap-6 p-5", children: [
13627
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "agg-order-failure-header flex flex-col gap-2", children: [
13628
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "agg-order-failure-market flex items-center gap-3", children: [
13629
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13456
13630
  RemoteImage,
13457
13631
  {
13458
13632
  src: (_a = summary.eventImage) != null ? _a : null,
@@ -13460,19 +13634,19 @@ var PlaceOrderFailureView = ({
13460
13634
  className: "h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
13461
13635
  }
13462
13636
  ),
13463
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: summary.eventTitle })
13637
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: summary.eventTitle })
13464
13638
  ] }),
13465
- summary.eventSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: summary.eventSubtitle }) : null
13639
+ summary.eventSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: summary.eventSubtitle }) : null
13466
13640
  ] }),
13467
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "flex flex-col gap-4", children: ((_b = summary.executionGroups) == null ? void 0 : _b.length) ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13641
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "flex flex-col gap-4", children: ((_b = summary.executionGroups) == null ? void 0 : _b.length) ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13468
13642
  PlaceOrderExecutionGroups,
13469
13643
  {
13470
13644
  enableAnimations: false,
13471
13645
  groups: summary.executionGroups,
13472
13646
  labels: tradingLabels
13473
13647
  }
13474
- ) : failureStepGroups.map((group, groupIndex) => /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "flex flex-col gap-2", children: group.map((step) => renderPartialFailureStep(step)) }, `failure-group-${groupIndex}`)) }),
13475
- summary.errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13648
+ ) : failureStepGroups.map((group, groupIndex) => /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "flex flex-col gap-2", children: group.map((step) => renderPartialFailureStep(step)) }, `failure-group-${groupIndex}`)) }),
13649
+ summary.errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13476
13650
  InlineAlert,
13477
13651
  {
13478
13652
  tone: "error",
@@ -13480,20 +13654,20 @@ var PlaceOrderFailureView = ({
13480
13654
  message: tradingLabels.orderFailureDescription(summary.errorMessage)
13481
13655
  }
13482
13656
  ) : null,
13483
- summary.result ? /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex flex-col gap-4", children: [
13484
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
13485
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
13486
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.orderPartiallyFilled }),
13487
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: tradingLabels.orderAveragePrice(summary.result.averagePriceLabel) })
13657
+ summary.result ? /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex flex-col gap-4", children: [
13658
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
13659
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
13660
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.orderPartiallyFilled }),
13661
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: tradingLabels.orderAveragePrice(summary.result.averagePriceLabel) })
13488
13662
  ] }),
13489
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-foreground", children: summary.result.filledAmountLabel })
13663
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-foreground", children: summary.result.filledAmountLabel })
13490
13664
  ] }),
13491
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
13492
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.orderPayout }),
13493
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-success", children: summary.result.payoutLabel })
13665
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
13666
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.orderPayout }),
13667
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-success", children: summary.result.payoutLabel })
13494
13668
  ] })
13495
13669
  ] }) : null,
13496
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "flex flex-col gap-4", children: summary.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13670
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "flex flex-col gap-4", children: summary.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13497
13671
  Button,
13498
13672
  {
13499
13673
  variant: action.variant === "retry" ? "primary" : "secondary",
@@ -13507,10 +13681,10 @@ var PlaceOrderFailureView = ({
13507
13681
  )) })
13508
13682
  ] }) });
13509
13683
  }
13510
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Card, { className: cn("group/agg-order-panel", getPlaceOrderContainerClassName(), className), children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "agg-order-failure-body flex flex-col gap-6 p-5", children: [
13511
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "agg-order-failure-header flex flex-col gap-2", children: [
13512
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "agg-order-failure-market flex items-center gap-3", children: [
13513
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13684
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(Card, { className: cn("group/agg-order-panel", getPlaceOrderContainerClassName(), className), children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "agg-order-failure-body flex flex-col gap-6 p-5", children: [
13685
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "agg-order-failure-header flex flex-col gap-2", children: [
13686
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "agg-order-failure-market flex items-center gap-3", children: [
13687
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13514
13688
  RemoteImage,
13515
13689
  {
13516
13690
  src: (_c = summary.eventImage) != null ? _c : null,
@@ -13518,11 +13692,11 @@ var PlaceOrderFailureView = ({
13518
13692
  className: "h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
13519
13693
  }
13520
13694
  ),
13521
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: summary.eventTitle })
13695
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: summary.eventTitle })
13522
13696
  ] }),
13523
- summary.eventSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: summary.eventSubtitle }) : null
13697
+ summary.eventSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: summary.eventSubtitle }) : null
13524
13698
  ] }),
13525
- ((_d = summary.executionGroups) == null ? void 0 : _d.length) ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13699
+ ((_d = summary.executionGroups) == null ? void 0 : _d.length) ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13526
13700
  PlaceOrderExecutionGroups,
13527
13701
  {
13528
13702
  enableAnimations: false,
@@ -13530,7 +13704,7 @@ var PlaceOrderFailureView = ({
13530
13704
  labels: tradingLabels
13531
13705
  }
13532
13706
  ) : null,
13533
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13707
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13534
13708
  InlineAlert,
13535
13709
  {
13536
13710
  tone: "error",
@@ -13539,7 +13713,7 @@ var PlaceOrderFailureView = ({
13539
13713
  message: tradingLabels.orderFailureDescription((_e = summary.errorMessage) != null ? _e : "")
13540
13714
  }
13541
13715
  ),
13542
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "agg-order-failure-actions flex flex-col gap-4", children: summary.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
13716
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "agg-order-failure-actions flex flex-col gap-4", children: summary.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13543
13717
  Button,
13544
13718
  {
13545
13719
  variant: action.variant === "retry" ? "primary" : "secondary",
@@ -13556,7 +13730,7 @@ var PlaceOrderFailureView = ({
13556
13730
  PlaceOrderFailureView.displayName = "PlaceOrderFailureView";
13557
13731
 
13558
13732
  // src/trading/place-order/index.place-order.success.tsx
13559
- var import_jsx_runtime157 = require("react/jsx-runtime");
13733
+ var import_jsx_runtime158 = require("react/jsx-runtime");
13560
13734
  var resolveBuyPayoutLabel = (shares) => {
13561
13735
  if (!shares) return "$0";
13562
13736
  return shares.startsWith("$") ? shares : `$${shares}`;
@@ -13577,7 +13751,7 @@ var PlaceOrderSuccessView = ({
13577
13751
  const amountTitle = isLimitOrder ? tradingLabels.orderAmount : summary.resultState === "partial" ? tradingLabels.orderPartiallyFilled : tradingLabels.orderFullyFilled;
13578
13752
  const amountSubtitle = isLimitOrder ? tradingLabels.orderLimitPrice((_d = summary.limitPriceLabel) != null ? _d : summary.avgPrice) : tradingLabels.orderAveragePrice(summary.avgPrice);
13579
13753
  const legacyExecutionSteps = ((_e = summary.executionStepGroups) != null ? _e : []).flat();
13580
- return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13754
+ return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
13581
13755
  Card,
13582
13756
  {
13583
13757
  className: cn(
@@ -13586,8 +13760,8 @@ var PlaceOrderSuccessView = ({
13586
13760
  "border-0 ring-1 ring-inset ring-agg-separator",
13587
13761
  className
13588
13762
  ),
13589
- children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "agg-order-success-body flex flex-col gap-6 p-5", children: [
13590
- summary.eventTitle ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13763
+ children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-success-body flex flex-col gap-6 p-5", children: [
13764
+ summary.eventTitle ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
13591
13765
  PlaceOrderExecutionHeader,
13592
13766
  {
13593
13767
  eventDateLabel: summary.eventDateLabel,
@@ -13595,19 +13769,19 @@ var PlaceOrderSuccessView = ({
13595
13769
  eventTitle: summary.eventTitle
13596
13770
  }
13597
13771
  ) : null,
13598
- ((_f = summary.executionGroups) == null ? void 0 : _f.length) ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13772
+ ((_f = summary.executionGroups) == null ? void 0 : _f.length) ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
13599
13773
  PlaceOrderExecutionGroups,
13600
13774
  {
13601
13775
  enableAnimations: false,
13602
13776
  groups: summary.executionGroups,
13603
13777
  labels: tradingLabels
13604
13778
  }
13605
- ) : legacyExecutionSteps.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "flex flex-col gap-3 pl-[22px]", children: legacyExecutionSteps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
13779
+ ) : legacyExecutionSteps.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "flex flex-col gap-3 pl-[22px]", children: legacyExecutionSteps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
13606
13780
  "div",
13607
13781
  {
13608
13782
  className: "flex items-start gap-2 text-agg-xs leading-agg-4 text-agg-foreground",
13609
13783
  children: [
13610
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13784
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
13611
13785
  Icon,
13612
13786
  {
13613
13787
  name: step.tone === "warning" || step.tone === "error" ? "warning-filled" : "check-circle",
@@ -13619,28 +13793,28 @@ var PlaceOrderSuccessView = ({
13619
13793
  "aria-hidden": "true"
13620
13794
  }
13621
13795
  ),
13622
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "min-w-0 flex-1", children: step.label })
13796
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "min-w-0 flex-1", children: step.label })
13623
13797
  ]
13624
13798
  },
13625
13799
  step.id
13626
13800
  )) }) : null,
13627
- /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "agg-order-success-summary flex flex-col gap-4", children: [
13628
- /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
13629
- /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
13630
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: amountTitle }),
13631
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: amountSubtitle })
13801
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-success-summary flex flex-col gap-4", children: [
13802
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
13803
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
13804
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: amountTitle }),
13805
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: amountSubtitle })
13632
13806
  ] }),
13633
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-foreground", children: resolvedAmountLabel })
13807
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-foreground", children: resolvedAmountLabel })
13634
13808
  ] }),
13635
- /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
13636
- /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
13637
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.orderPayout }),
13638
- potentialReturnLabel ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("span", { className: "agg-type-overline agg-text-brand", children: potentialReturnLabel }) : null
13809
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
13810
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
13811
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.orderPayout }),
13812
+ potentialReturnLabel ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "agg-type-overline agg-text-brand", children: potentialReturnLabel }) : null
13639
13813
  ] }),
13640
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-success", children: resolvedPayoutLabel })
13814
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-success", children: resolvedPayoutLabel })
13641
13815
  ] })
13642
13816
  ] }),
13643
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
13817
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
13644
13818
  Button,
13645
13819
  {
13646
13820
  variant: "secondary",
@@ -13658,7 +13832,7 @@ var PlaceOrderSuccessView = ({
13658
13832
  PlaceOrderSuccessView.displayName = "PlaceOrderSuccessView";
13659
13833
 
13660
13834
  // src/trading/place-order/index.tsx
13661
- var import_jsx_runtime158 = require("react/jsx-runtime");
13835
+ var import_jsx_runtime159 = require("react/jsx-runtime");
13662
13836
  var SELL_SHARE_INPUT_DECIMALS = 6;
13663
13837
  var SELL_SHARE_DISPLAY_DECIMALS = 2;
13664
13838
  var resolvePlaceOrderPortalContainer = (triggerElement) => {
@@ -13676,11 +13850,11 @@ var ceilDiv = (numerator, denominator) => {
13676
13850
  };
13677
13851
  var toRaw6 = (value) => {
13678
13852
  const normalizedValue = Number.isFinite(value) ? Math.max(0, value) : 0;
13679
- return Math.ceil(normalizedValue * Number(import_sdk22.LIMIT_PRICE_RAW_SCALE)).toString();
13853
+ return Math.ceil(normalizedValue * Number(import_sdk23.LIMIT_PRICE_RAW_SCALE)).toString();
13680
13854
  };
13681
13855
  var toLimitPriceRaw = (value) => {
13682
13856
  const clampedValue = Math.min(LIMIT_PRICE_MAX, Math.max(LIMIT_PRICE_MIN, value));
13683
- return Math.round(clampedValue * Number(import_sdk22.LIMIT_PRICE_RAW_SCALE)).toString();
13857
+ return Math.round(clampedValue * Number(import_sdk23.LIMIT_PRICE_RAW_SCALE)).toString();
13684
13858
  };
13685
13859
  var toLimitSizeRaw = ({
13686
13860
  amount: amount2,
@@ -13690,7 +13864,7 @@ var toLimitSizeRaw = ({
13690
13864
  if (side === "sell") return toRaw6(amount2);
13691
13865
  const spendRaw = BigInt(toRaw6(amount2));
13692
13866
  const priceRaw = BigInt(limitPriceRaw);
13693
- return ceilDiv(spendRaw * import_sdk22.LIMIT_PRICE_RAW_SCALE, priceRaw).toString();
13867
+ return ceilDiv(spendRaw * import_sdk23.LIMIT_PRICE_RAW_SCALE, priceRaw).toString();
13694
13868
  };
13695
13869
  var formatLimitPriceLabel = (value) => {
13696
13870
  return `${(value * 100).toLocaleString("en-US", {
@@ -13699,7 +13873,7 @@ var formatLimitPriceLabel = (value) => {
13699
13873
  })}\xA2`;
13700
13874
  };
13701
13875
  var formatLimitPriceRawLabel = (value) => {
13702
- return formatLimitPriceLabel(Number(BigInt(value)) / Number(import_sdk22.LIMIT_PRICE_RAW_SCALE));
13876
+ return formatLimitPriceLabel(Number(BigInt(value)) / Number(import_sdk23.LIMIT_PRICE_RAW_SCALE));
13703
13877
  };
13704
13878
  var LIMIT_ORDER_SUBMITTING_PROGRESS = 10;
13705
13879
  var buildLimitOrderExecutionGroup = ({
@@ -13734,10 +13908,10 @@ var getLimitOrderToWinValue = ({
13734
13908
  side
13735
13909
  }) => {
13736
13910
  const priceRaw = BigInt(limitPriceRaw);
13737
- if (priceRaw <= BigInt(0) || priceRaw >= import_sdk22.LIMIT_PRICE_RAW_SCALE) return 0;
13911
+ if (priceRaw <= BigInt(0) || priceRaw >= import_sdk23.LIMIT_PRICE_RAW_SCALE) return 0;
13738
13912
  const sizeRaw = BigInt(toLimitSizeRaw({ amount: amount2, limitPriceRaw, side }));
13739
- if (side === "buy") return Number(sizeRaw) / Number(import_sdk22.LIMIT_PRICE_RAW_SCALE);
13740
- return Number(ceilDiv(priceRaw * sizeRaw, import_sdk22.LIMIT_PRICE_RAW_SCALE)) / Number(import_sdk22.LIMIT_PRICE_RAW_SCALE);
13913
+ if (side === "buy") return Number(sizeRaw) / Number(import_sdk23.LIMIT_PRICE_RAW_SCALE);
13914
+ return Number(ceilDiv(priceRaw * sizeRaw, import_sdk23.LIMIT_PRICE_RAW_SCALE)) / Number(import_sdk23.LIMIT_PRICE_RAW_SCALE);
13741
13915
  };
13742
13916
  var normalizeLimitPrice = (value) => {
13743
13917
  if (!Number.isFinite(value)) return LIMIT_PRICE_MIN;
@@ -13803,25 +13977,25 @@ var PlaceOrderSlippageControl = ({
13803
13977
  minimumValue: slippageMinimumValue
13804
13978
  }) => {
13805
13979
  var _a, _b;
13806
- const labels = (0, import_hooks51.useLabels)();
13807
- const containerRef = (0, import_react26.useRef)(null);
13808
- const triggerRef = (0, import_react26.useRef)(null);
13809
- const inputRef = (0, import_react26.useRef)(null);
13810
- const warningId = (0, import_react26.useId)();
13980
+ const labels = (0, import_hooks52.useLabels)();
13981
+ const containerRef = (0, import_react27.useRef)(null);
13982
+ const triggerRef = (0, import_react27.useRef)(null);
13983
+ const inputRef = (0, import_react27.useRef)(null);
13984
+ const warningId = (0, import_react27.useId)();
13811
13985
  const defaultValue = finalizePercentageValue(slippageDefaultValue);
13812
13986
  const committedValue = finalizePercentageValue(slippageValue) || defaultValue;
13813
- const [draftValue, setDraftValue] = (0, import_react26.useState)(committedValue);
13814
- const [isEditing, setIsEditing] = (0, import_react26.useState)(
13987
+ const [draftValue, setDraftValue] = (0, import_react27.useState)(committedValue);
13988
+ const [isEditing, setIsEditing] = (0, import_react27.useState)(
13815
13989
  () => isPercentageBelowMinimum(committedValue, slippageMinimumValue)
13816
13990
  );
13817
- const [shouldFocusInput, setShouldFocusInput] = (0, import_react26.useState)(false);
13818
- (0, import_react26.useEffect)(() => {
13991
+ const [shouldFocusInput, setShouldFocusInput] = (0, import_react27.useState)(false);
13992
+ (0, import_react27.useEffect)(() => {
13819
13993
  setDraftValue(committedValue);
13820
13994
  if (isPercentageBelowMinimum(committedValue, slippageMinimumValue)) {
13821
13995
  setIsEditing(true);
13822
13996
  }
13823
13997
  }, [committedValue, slippageMinimumValue]);
13824
- (0, import_react26.useEffect)(() => {
13998
+ (0, import_react27.useEffect)(() => {
13825
13999
  if (!shouldFocusInput) return;
13826
14000
  requestAnimationFrame(() => {
13827
14001
  var _a2, _b2;
@@ -13838,7 +14012,7 @@ var PlaceOrderSlippageControl = ({
13838
14012
  Number(committedValue || slippageDefaultValue || DEFAULT_SLIPPAGE_VALUE)
13839
14013
  );
13840
14014
  const resolvedAutoLabel = labels.trading.resetSlippage;
13841
- const resolvedWarningMessage = (0, import_react26.useMemo)(() => {
14015
+ const resolvedWarningMessage = (0, import_react27.useMemo)(() => {
13842
14016
  if (isLowSlippage) {
13843
14017
  return labels.trading.slippageLow(slippageMinimumValue);
13844
14018
  }
@@ -13901,8 +14075,8 @@ var PlaceOrderSlippageControl = ({
13901
14075
  if (!isEditing) return;
13902
14076
  handleCommitDraft(false);
13903
14077
  };
13904
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { ref: containerRef, className: "agg-slippage-control w-full", onBlur: handleContainerBlur, children: [
13905
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
14078
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { ref: containerRef, className: "agg-slippage-control w-full", onBlur: handleContainerBlur, children: [
14079
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
13906
14080
  "button",
13907
14081
  {
13908
14082
  ref: triggerRef,
@@ -13920,8 +14094,8 @@ var PlaceOrderSlippageControl = ({
13920
14094
  ),
13921
14095
  onClick: handleToggleEditing,
13922
14096
  children: [
13923
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "agg-slippage-label", children: collapsedLabel }),
13924
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14097
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "agg-slippage-label", children: collapsedLabel }),
14098
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
13925
14099
  Icon,
13926
14100
  {
13927
14101
  name: isEditing ? "chevron-up" : "pencil",
@@ -13933,7 +14107,7 @@ var PlaceOrderSlippageControl = ({
13933
14107
  ]
13934
14108
  }
13935
14109
  ),
13936
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14110
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
13937
14111
  "div",
13938
14112
  {
13939
14113
  "aria-hidden": !isEditing,
@@ -13947,10 +14121,10 @@ var PlaceOrderSlippageControl = ({
13947
14121
  "transition-[grid-template-rows,opacity,margin-top] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)]"
13948
14122
  )
13949
14123
  ),
13950
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-slippage-editor-body flex flex-col gap-2", children: [
13951
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-slippage-input-row flex h-9 overflow-hidden rounded-agg-sm border border-agg-separator", children: [
13952
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-slippage-input-group flex min-w-0 flex-1 items-center gap-2 bg-agg-secondary px-3", children: [
13953
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14124
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-slippage-editor-body flex flex-col gap-2", children: [
14125
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-slippage-input-row flex h-9 overflow-hidden rounded-agg-sm border border-agg-separator", children: [
14126
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-slippage-input-group flex min-w-0 flex-1 items-center gap-2 bg-agg-secondary px-3", children: [
14127
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
13954
14128
  "input",
13955
14129
  {
13956
14130
  ref: inputRef,
@@ -13965,7 +14139,7 @@ var PlaceOrderSlippageControl = ({
13965
14139
  onKeyDown: handleInputKeyDown
13966
14140
  }
13967
14141
  ),
13968
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14142
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
13969
14143
  "button",
13970
14144
  {
13971
14145
  type: "button",
@@ -13983,8 +14157,8 @@ var PlaceOrderSlippageControl = ({
13983
14157
  }
13984
14158
  )
13985
14159
  ] }),
13986
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "h-full w-px bg-agg-separator", "aria-hidden": "true" }),
13987
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14160
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "h-full w-px bg-agg-separator", "aria-hidden": "true" }),
14161
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
13988
14162
  "div",
13989
14163
  {
13990
14164
  className: "agg-slippage-suffix flex w-9 items-center justify-center bg-agg-secondary-hover text-agg-sm leading-agg-5 text-agg-muted-foreground",
@@ -13993,7 +14167,7 @@ var PlaceOrderSlippageControl = ({
13993
14167
  }
13994
14168
  )
13995
14169
  ] }),
13996
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14170
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
13997
14171
  "div",
13998
14172
  {
13999
14173
  "aria-hidden": !resolvedWarningMessage,
@@ -14007,13 +14181,13 @@ var PlaceOrderSlippageControl = ({
14007
14181
  "transition-[grid-template-rows,opacity] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]"
14008
14182
  )
14009
14183
  ),
14010
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
14184
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
14011
14185
  "div",
14012
14186
  {
14013
14187
  id: warningId,
14014
14188
  className: "agg-slippage-warning-message flex items-start gap-2 text-agg-sm leading-agg-5 text-agg-foreground",
14015
14189
  children: [
14016
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14190
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14017
14191
  Icon,
14018
14192
  {
14019
14193
  name: "warning-filled",
@@ -14022,7 +14196,7 @@ var PlaceOrderSlippageControl = ({
14022
14196
  color: "currentColor"
14023
14197
  }
14024
14198
  ),
14025
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { children: resolvedWarningMessage != null ? resolvedWarningMessage : "" })
14199
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { children: resolvedWarningMessage != null ? resolvedWarningMessage : "" })
14026
14200
  ]
14027
14201
  }
14028
14202
  ) })
@@ -14043,30 +14217,30 @@ var renderCardHeader = ({
14043
14217
  onClose
14044
14218
  }) => {
14045
14219
  if (!headerTitle) return null;
14046
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: cn("agg-order-panel-header flex flex-col gap-2", className), children: [
14047
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-market-summary flex items-center gap-3", children: [
14048
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14220
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: cn("agg-order-panel-header flex flex-col gap-2", className), children: [
14221
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-order-market-summary flex items-center gap-3", children: [
14222
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14049
14223
  RemoteImage,
14050
14224
  {
14051
14225
  src: headerImage,
14052
14226
  alt: "",
14053
- fallback: headerVenue ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(VenueLogo, { venue: headerVenue, size: "large" }) : void 0,
14227
+ fallback: headerVenue ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(VenueLogo, { venue: headerVenue, size: "large" }) : void 0,
14054
14228
  className: "agg-order-market-image h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
14055
14229
  }
14056
14230
  ),
14057
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-order-market-title min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: headerTitle }),
14058
- onClose ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14231
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-order-market-title min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: headerTitle }),
14232
+ onClose ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14059
14233
  "button",
14060
14234
  {
14061
14235
  type: "button",
14062
14236
  className: "agg-order-close -mr-1 -mt-1 hidden shrink-0 cursor-pointer items-center justify-center p-1 text-agg-muted-foreground hover:text-agg-foreground sm:flex",
14063
14237
  "aria-label": "Close",
14064
14238
  onClick: onClose,
14065
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(CloseIcon, { className: "h-5 w-5" })
14239
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(CloseIcon, { className: "h-5 w-5" })
14066
14240
  }
14067
14241
  ) : null
14068
14242
  ] }),
14069
- headerSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-order-market-subtitle text-agg-base leading-agg-6 text-agg-foreground", children: headerSubtitle }) : null
14243
+ headerSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-order-market-subtitle text-agg-base leading-agg-6 text-agg-foreground", children: headerSubtitle }) : null
14070
14244
  ] });
14071
14245
  };
14072
14246
  var PlaceOrderResolvedView = ({
@@ -14079,7 +14253,7 @@ var PlaceOrderResolvedView = ({
14079
14253
  showResolvingState = false
14080
14254
  }) => {
14081
14255
  var _a, _b;
14082
- const labels = (0, import_hooks51.useLabels)();
14256
+ const labels = (0, import_hooks52.useLabels)();
14083
14257
  const tradingLabels = labels.trading;
14084
14258
  const resolvingTimestamp = (_a = resolutionTimestamp != null ? resolutionTimestamp : tradingState.resolvesAt) != null ? _a : tradingState.endsAt;
14085
14259
  const isResolvingMarket = showResolvingState && !tradingState.winningOutcome;
@@ -14088,7 +14262,7 @@ var PlaceOrderResolvedView = ({
14088
14262
  return endDateLabel ? `${tradingState.market.question} \xB7 ${endDateLabel}` : tradingState.market.question;
14089
14263
  })() : "";
14090
14264
  if (isResolvingMarket) {
14091
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14265
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14092
14266
  Card,
14093
14267
  {
14094
14268
  className: cn(
@@ -14099,7 +14273,7 @@ var PlaceOrderResolvedView = ({
14099
14273
  ),
14100
14274
  role: "status",
14101
14275
  "aria-label": labels.marketDetails.resolvingTitle,
14102
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
14276
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
14103
14277
  "div",
14104
14278
  {
14105
14279
  className: cn(
@@ -14107,12 +14281,12 @@ var PlaceOrderResolvedView = ({
14107
14281
  classNames == null ? void 0 : classNames.body
14108
14282
  ),
14109
14283
  children: [
14110
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "flex h-[60px] w-[60px] items-center justify-center rounded-full bg-agg-primary/10", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(LoadingIcon, { variant: "prominent" }) }),
14111
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: cn("flex w-full flex-col items-center gap-1", classNames == null ? void 0 : classNames.content), children: [
14112
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.resolvingTitle }),
14113
- resolvingSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Typography, { variant: "body", className: "text-center", children: resolvingSubtitle }) : null
14284
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "flex h-[60px] w-[60px] items-center justify-center rounded-full bg-agg-primary/10", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(LoadingIcon, { variant: "prominent" }) }),
14285
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: cn("flex w-full flex-col items-center gap-1", classNames == null ? void 0 : classNames.content), children: [
14286
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.resolvingTitle }),
14287
+ resolvingSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Typography, { variant: "body", className: "text-center", children: resolvingSubtitle }) : null
14114
14288
  ] }),
14115
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14289
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14116
14290
  Typography,
14117
14291
  {
14118
14292
  variant: "label",
@@ -14126,7 +14300,7 @@ var PlaceOrderResolvedView = ({
14126
14300
  }
14127
14301
  );
14128
14302
  }
14129
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14303
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14130
14304
  Card,
14131
14305
  {
14132
14306
  className: cn(
@@ -14135,19 +14309,19 @@ var PlaceOrderResolvedView = ({
14135
14309
  classNames == null ? void 0 : classNames.root,
14136
14310
  className
14137
14311
  ),
14138
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: cn("agg-order-panel-body flex flex-col", classNames == null ? void 0 : classNames.body), children: [
14139
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex flex-col items-center gap-6 p-8", children: [
14140
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14312
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: cn("agg-order-panel-body flex flex-col", classNames == null ? void 0 : classNames.body), children: [
14313
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex flex-col items-center gap-6 p-8", children: [
14314
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14141
14315
  "div",
14142
14316
  {
14143
14317
  className: cn(
14144
14318
  "flex h-15 w-15 items-center justify-center rounded-full",
14145
14319
  "bg-agg-primary/15"
14146
14320
  ),
14147
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Icon, { name: "success-check", className: cn("h-6 w-6", "text-agg-primary") })
14321
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Icon, { name: "success-check", className: cn("h-6 w-6", "text-agg-primary") })
14148
14322
  }
14149
14323
  ),
14150
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
14324
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
14151
14325
  "div",
14152
14326
  {
14153
14327
  className: cn(
@@ -14155,8 +14329,8 @@ var PlaceOrderResolvedView = ({
14155
14329
  classNames == null ? void 0 : classNames.content
14156
14330
  ),
14157
14331
  children: [
14158
- tradingState.market ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Typography, { variant: "body", className: "text-center", children: tradingState.market.question }) : null,
14159
- tradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Typography, { variant: "body-large-strong", children: tradingLabels.outcome(
14332
+ tradingState.market ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Typography, { variant: "body", className: "text-center", children: tradingState.market.question }) : null,
14333
+ tradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Typography, { variant: "body-large-strong", children: tradingLabels.outcome(
14160
14334
  shouldUseRawResolvedPlaceOrderOutcomeLabel(
14161
14335
  tradingState.market,
14162
14336
  tradingState.winningOutcome
@@ -14170,25 +14344,25 @@ var PlaceOrderResolvedView = ({
14170
14344
  }
14171
14345
  )
14172
14346
  ] }),
14173
- resolvedClaim ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
14174
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
14175
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex w-full flex-col gap-5 p-6", children: [
14176
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Typography, { variant: "body-strong", className: "text-center", children: tradingLabels.resolvedEarningsTitle }),
14177
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex flex-col gap-3 text-agg-sm leading-agg-5 text-agg-foreground", children: [
14178
- resolvedClaim.resolutionDateLabel ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
14179
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { children: tradingLabels.resolvedResolutionDateLabel }),
14180
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "font-agg-bold", children: resolvedClaim.resolutionDateLabel })
14347
+ resolvedClaim ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
14348
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
14349
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex w-full flex-col gap-5 p-6", children: [
14350
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Typography, { variant: "body-strong", className: "text-center", children: tradingLabels.resolvedEarningsTitle }),
14351
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex flex-col gap-3 text-agg-sm leading-agg-5 text-agg-foreground", children: [
14352
+ resolvedClaim.resolutionDateLabel ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
14353
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { children: tradingLabels.resolvedResolutionDateLabel }),
14354
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "font-agg-bold", children: resolvedClaim.resolutionDateLabel })
14181
14355
  ] }) : null,
14182
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
14183
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { children: tradingLabels.resolvedSharesLabel }),
14184
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "font-agg-bold", children: resolvedClaim.sharesLabel })
14356
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
14357
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { children: tradingLabels.resolvedSharesLabel }),
14358
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "font-agg-bold", children: resolvedClaim.sharesLabel })
14185
14359
  ] }),
14186
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
14187
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { children: tradingLabels.resolvedTotalPayoutLabel }),
14188
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "font-agg-bold", children: resolvedClaim.totalPayoutLabel })
14360
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
14361
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { children: tradingLabels.resolvedTotalPayoutLabel }),
14362
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "font-agg-bold", children: resolvedClaim.totalPayoutLabel })
14189
14363
  ] })
14190
14364
  ] }),
14191
- resolvedClaim.onClaim ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14365
+ resolvedClaim.onClaim ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14192
14366
  Button,
14193
14367
  {
14194
14368
  size: "large",
@@ -14210,21 +14384,21 @@ var renderRouteBreakdownRow = (row, sharedKycStatus, tradingLabels) => {
14210
14384
  const venueLabel = getTradingVenueLabel(row.venue);
14211
14385
  const rowKey = `${row.venue}-${row.label}-${row.priceLabel}-${(_a = row.resultLabel) != null ? _a : ""}`;
14212
14386
  const showSharedKycRequirement = row.requiresSharedKyc === true && sharedKycStatus !== void 0 && sharedKycStatus !== "verified";
14213
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
14387
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
14214
14388
  "div",
14215
14389
  {
14216
14390
  className: "agg-route-breakdown-row flex items-center justify-between gap-4 text-left",
14217
14391
  children: [
14218
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-route-breakdown-market flex min-w-0 items-center gap-2", children: [
14219
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(VenueLogo, { venue: row.venue, className: "size-3!", ariaLabel: venueLabel }),
14220
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
14221
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-route-breakdown-label truncate text-agg-sm leading-agg-5 text-agg-foreground", children: row.label }),
14222
- showSharedKycRequirement ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-agg-xs leading-agg-4 text-agg-muted-foreground", children: tradingLabels.sharedKyc.required }) : null
14392
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-route-breakdown-market flex min-w-0 items-center gap-2", children: [
14393
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(VenueLogo, { venue: row.venue, className: "size-3!", ariaLabel: venueLabel }),
14394
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
14395
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-route-breakdown-label truncate text-agg-sm leading-agg-5 text-agg-foreground", children: row.label }),
14396
+ showSharedKycRequirement ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "text-agg-xs leading-agg-4 text-agg-muted-foreground", children: tradingLabels.sharedKyc.required }) : null
14223
14397
  ] })
14224
14398
  ] }),
14225
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-route-breakdown-value flex shrink-0 items-center gap-2 text-agg-sm leading-agg-5", children: [
14226
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-agg-muted-foreground", children: row.priceLabel }),
14227
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-agg-foreground", children: (_b = row.resultLabel) != null ? _b : "" })
14399
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-route-breakdown-value flex shrink-0 items-center gap-2 text-agg-sm leading-agg-5", children: [
14400
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "text-agg-muted-foreground", children: row.priceLabel }),
14401
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "text-agg-foreground", children: (_b = row.resultLabel) != null ? _b : "" })
14228
14402
  ] })
14229
14403
  ]
14230
14404
  },
@@ -14257,7 +14431,7 @@ var renderRouteCard = ({
14257
14431
  const showSplitDetails = isSelected && isExpanded && card.kind === "split" && !!((_a = card.rows) == null ? void 0 : _a.length);
14258
14432
  const displayedHint = showKalshiRequirement ? tradingLabels.requiresKalshiAccount : showSharedKycRequirement ? tradingLabels.sharedKyc.required : card.hint;
14259
14433
  const ariaLabel = [card.label, displayedHint, card.value].filter(Boolean).join(" ");
14260
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14434
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14261
14435
  "button",
14262
14436
  {
14263
14437
  type: "button",
@@ -14276,10 +14450,10 @@ var renderRouteCard = ({
14276
14450
  isSelected && !card.isUnavailable ? "border border-agg-trade-highlight-border bg-linear-to-b from-agg-trade-highlight-surface-from to-agg-trade-highlight-surface-to" : "border-transparent bg-agg-secondary-hover"
14277
14451
  ),
14278
14452
  onClick: () => onSelect(card.id),
14279
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-route-card-content relative z-10 flex flex-col gap-3", children: [
14280
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-route-card-header flex items-center justify-between gap-4", children: [
14281
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-route-card-meta flex min-w-0 gap-3 items-center", children: [
14282
- card.kind === "split" ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14453
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-route-card-content relative z-10 flex flex-col gap-3", children: [
14454
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-route-card-header flex items-center justify-between gap-4", children: [
14455
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-route-card-meta flex min-w-0 gap-3 items-center", children: [
14456
+ card.kind === "split" ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14283
14457
  Icon,
14284
14458
  {
14285
14459
  name: "sparkles-filled",
@@ -14290,7 +14464,7 @@ var renderRouteCard = ({
14290
14464
  ),
14291
14465
  "aria-hidden": "true"
14292
14466
  }
14293
- ) : card.venue ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14467
+ ) : card.venue ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14294
14468
  VenueLogo,
14295
14469
  {
14296
14470
  venue: card.venue,
@@ -14298,10 +14472,10 @@ var renderRouteCard = ({
14298
14472
  ariaLabel: getTradingVenueLabel(card.venue)
14299
14473
  }
14300
14474
  ) : null,
14301
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex flex-col gap-1 min-w-0", children: [
14302
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-center gap-1.5", children: [
14303
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-route-card-title truncate text-agg-sm leading-agg-5 text-agg-foreground", children: card.label }),
14304
- card.isUnavailable ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14475
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex flex-col gap-1 min-w-0", children: [
14476
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-center gap-1.5", children: [
14477
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-route-card-title truncate text-agg-sm leading-agg-5 text-agg-foreground", children: card.label }),
14478
+ card.isUnavailable ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14305
14479
  Icon,
14306
14480
  {
14307
14481
  name: "lock",
@@ -14309,7 +14483,7 @@ var renderRouteCard = ({
14309
14483
  className: "shrink-0 text-agg-muted-foreground",
14310
14484
  "aria-hidden": "true"
14311
14485
  }
14312
- ) : showKalshiRequirement || showSharedKycRequirement || card.insufficientInventory ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14486
+ ) : showKalshiRequirement || showSharedKycRequirement || card.insufficientInventory ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14313
14487
  Icon,
14314
14488
  {
14315
14489
  name: "warning",
@@ -14317,7 +14491,7 @@ var renderRouteCard = ({
14317
14491
  className: "shrink-0 text-agg-muted-foreground",
14318
14492
  "aria-hidden": "true"
14319
14493
  }
14320
- ) : card.kind === "split" && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14494
+ ) : card.kind === "split" && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14321
14495
  Icon,
14322
14496
  {
14323
14497
  name: showSplitDetails ? "chevron-up" : "chevron-down",
@@ -14327,10 +14501,10 @@ var renderRouteCard = ({
14327
14501
  }
14328
14502
  ) : null
14329
14503
  ] }),
14330
- card.hint ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-route-card-hint text-agg-xs leading-agg-4 text-agg-muted-foreground", children: displayedHint }) : null
14504
+ card.hint ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-route-card-hint text-agg-xs leading-agg-4 text-agg-muted-foreground", children: displayedHint }) : null
14331
14505
  ] })
14332
14506
  ] }),
14333
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
14507
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
14334
14508
  "p",
14335
14509
  {
14336
14510
  className: cn(
@@ -14342,9 +14516,9 @@ var renderRouteCard = ({
14342
14516
  }
14343
14517
  )
14344
14518
  ] }),
14345
- showSplitDetails ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
14346
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-route-card-description text-agg-xs leading-agg-4 text-agg-foreground", children: (_b = card.description) != null ? _b : tradingLabels.splitOrderDescription }),
14347
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "agg-route-breakdown flex flex-col gap-3", children: (_c = card.rows) == null ? void 0 : _c.map(
14519
+ showSplitDetails ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
14520
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-route-card-description text-agg-xs leading-agg-4 text-agg-foreground", children: (_b = card.description) != null ? _b : tradingLabels.splitOrderDescription }),
14521
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-route-breakdown flex flex-col gap-3", children: (_c = card.rows) == null ? void 0 : _c.map(
14348
14522
  (row) => renderRouteBreakdownRow(row, sharedKycStatus, tradingLabels)
14349
14523
  ) })
14350
14524
  ] }) : null
@@ -14377,25 +14551,25 @@ var PlaceOrder = ({
14377
14551
  showResolvingState = false,
14378
14552
  midpointsResult
14379
14553
  }) => {
14380
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja;
14554
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma;
14381
14555
  const {
14382
14556
  enableDebug: isExecutionDebugEnabled,
14383
14557
  features: { enableAnimations, showFeesBreakdown, showLimitOrders: limitOrdersFeature },
14384
14558
  formatting: { formatPrice },
14385
14559
  general: { locale }
14386
- } = (0, import_hooks51.useSdkUiConfig)();
14387
- const labels = (0, import_hooks51.useLabels)();
14560
+ } = (0, import_hooks52.useSdkUiConfig)();
14561
+ const labels = (0, import_hooks52.useLabels)();
14388
14562
  const tradingLabels = labels.trading;
14389
14563
  const toastCtx = useOptionalToast();
14390
- const { isTradingBlocked } = (0, import_hooks51.useGeoBlock)();
14391
- const tradingContext = (0, import_hooks51.useEventTradingContext)();
14564
+ const { isTradingBlocked } = (0, import_hooks52.useGeoBlock)();
14565
+ const tradingContext = (0, import_hooks52.useEventTradingContext)();
14392
14566
  const selectedEvent = (_a = tradingContext == null ? void 0 : tradingContext.selectedEvent) != null ? _a : null;
14393
14567
  const selectedMarket = (_b = tradingContext == null ? void 0 : tradingContext.selectedMarket) != null ? _b : null;
14394
14568
  const selectedOutcomeId = (_c = tradingContext == null ? void 0 : tradingContext.selectedOutcomeId) != null ? _c : null;
14395
- const resolvedEventTradingState = (0, import_react26.useMemo)(() => {
14396
- return eventTradingState != null ? eventTradingState : (0, import_hooks51.resolveEventTradingState)(selectedEvent);
14569
+ const resolvedEventTradingState = (0, import_react27.useMemo)(() => {
14570
+ return eventTradingState != null ? eventTradingState : (0, import_hooks52.resolveEventTradingState)(selectedEvent);
14397
14571
  }, [eventTradingState, selectedEvent]);
14398
- const scopedSelectedEvent = (0, import_react26.useMemo)(() => {
14572
+ const scopedSelectedEvent = (0, import_react27.useMemo)(() => {
14399
14573
  var _a2;
14400
14574
  if (!selectedEvent) return null;
14401
14575
  const primaryMarketId = (_a2 = resolvedEventTradingState.primaryMarket) == null ? void 0 : _a2.id;
@@ -14405,7 +14579,7 @@ var PlaceOrder = ({
14405
14579
  );
14406
14580
  return isSelectedEventInScope ? selectedEvent : null;
14407
14581
  }, [(_d = resolvedEventTradingState.primaryMarket) == null ? void 0 : _d.id, selectedEvent]);
14408
- const scopedSelectedMarket = (0, import_react26.useMemo)(() => {
14582
+ const scopedSelectedMarket = (0, import_react27.useMemo)(() => {
14409
14583
  if (!selectedMarket) return resolvedEventTradingState.primaryMarket;
14410
14584
  const isSelectedMarketInScope = resolvedEventTradingState.marketStates.some(
14411
14585
  (item) => item.market.id === selectedMarket.id
@@ -14420,10 +14594,10 @@ var PlaceOrder = ({
14420
14594
  (outcome) => outcome.label.trim().toLowerCase() === "yes"
14421
14595
  )) != null ? _f : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes[0]) != null ? _g : null;
14422
14596
  const scopedSelectedOutcomeId = (_h = scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.id) != null ? _h : null;
14423
- const resolvedTradingState = (0, import_react26.useMemo)(() => {
14424
- return (0, import_hooks51.resolveMarketTradingState)(scopedSelectedMarket);
14597
+ const resolvedTradingState = (0, import_react27.useMemo)(() => {
14598
+ return (0, import_hooks52.resolveMarketTradingState)(scopedSelectedMarket);
14425
14599
  }, [scopedSelectedMarket]);
14426
- const resolvedReadOnlyMarket = (0, import_react26.useMemo)(() => {
14600
+ const resolvedReadOnlyMarket = (0, import_react27.useMemo)(() => {
14427
14601
  var _a2;
14428
14602
  if (resolvedEventTradingState.kind !== "resolved") {
14429
14603
  return scopedSelectedMarket;
@@ -14434,12 +14608,12 @@ var PlaceOrder = ({
14434
14608
  resolvedEventTradingState.primaryMarket,
14435
14609
  scopedSelectedMarket
14436
14610
  ]);
14437
- const resolvedReadOnlyTradingState = (0, import_react26.useMemo)(() => {
14438
- return (0, import_hooks51.resolveMarketTradingState)(resolvedReadOnlyMarket);
14611
+ const resolvedReadOnlyTradingState = (0, import_react27.useMemo)(() => {
14612
+ return (0, import_hooks52.resolveMarketTradingState)(resolvedReadOnlyMarket);
14439
14613
  }, [resolvedReadOnlyMarket]);
14440
14614
  const isEndedWithoutKnownWinner = showResolvingState && !resolvedEventTradingState.winningOutcome && !resolvedReadOnlyTradingState.winningOutcome;
14441
- const orderEligibility = (0, import_react26.useMemo)(
14442
- () => (0, import_hooks51.resolveOrderEligibility)({
14615
+ const orderEligibility = (0, import_react27.useMemo)(
14616
+ () => (0, import_hooks52.resolveOrderEligibility)({
14443
14617
  event: scopedSelectedEvent,
14444
14618
  market: scopedSelectedMarket,
14445
14619
  outcome: scopedSelectedOutcome,
@@ -14448,20 +14622,20 @@ var PlaceOrder = ({
14448
14622
  [scopedSelectedEvent, scopedSelectedMarket, scopedSelectedOutcome, resolvedEventTradingState]
14449
14623
  );
14450
14624
  const isResolvedOutcomeCtaLocked = resolvedEventTradingState.kind === "resolved" || resolvedTradingState.kind === "resolved";
14451
- const { isAuthenticated, user } = (0, import_hooks51.useAggAuthContext)();
14625
+ const { isAuthenticated, user } = (0, import_hooks52.useAggAuthContext)();
14452
14626
  const sharedKycFlow = useSharedKycFlow({
14453
14627
  integration: sharedKyc,
14454
14628
  userId: isAuthenticated ? user == null ? void 0 : user.id : null,
14455
14629
  fallbackErrorMessage: tradingLabels.sharedKyc.modal.error
14456
14630
  });
14457
- const { executionMode: resolvedExecutionMode, isPaperMode } = (0, import_hooks51.useResolvedExecutionMode)(executionMode);
14631
+ const { executionMode: resolvedExecutionMode, isPaperMode } = (0, import_hooks52.useResolvedExecutionMode)(executionMode);
14458
14632
  const showLimitOrders = limitOrdersFeature && !isPaperMode;
14459
- const liveBalanceState = (0, import_hooks51.useAggBalanceState)();
14460
- const paperBalancesQuery = (0, import_hooks51.useManagedBalances)({
14633
+ const liveBalanceState = (0, import_hooks52.useAggBalanceState)();
14634
+ const paperBalancesQuery = (0, import_hooks52.useManagedBalances)({
14461
14635
  enabled: Boolean(isAuthenticated && isPaperMode),
14462
14636
  mode: "paper"
14463
14637
  });
14464
- const paperTotalBalance = (0, import_react26.useMemo)(() => {
14638
+ const paperTotalBalance = (0, import_react27.useMemo)(() => {
14465
14639
  var _a2, _b2;
14466
14640
  const cash = (_b2 = (_a2 = paperBalancesQuery.balances) == null ? void 0 : _a2.cash) != null ? _b2 : [];
14467
14641
  return cash.reduce((sum, token) => {
@@ -14475,75 +14649,91 @@ var PlaceOrder = ({
14475
14649
  }, 0);
14476
14650
  }, [paperBalancesQuery.balances]);
14477
14651
  const liveAvailableBalance = (_i = liveBalanceState.availableBalance) != null ? _i : liveBalanceState.totalBalance;
14478
- const executeManaged = (0, import_hooks51.useExecuteManaged)();
14479
- const placeLimitOrder = (0, import_hooks51.usePlaceLimitOrder)();
14480
- const aggClient = (0, import_hooks51.useAggClient)();
14481
- const queryClient = (0, import_hooks51.useQueryClient)();
14482
- const { disabledVenues, isLoading: isAppConfigLoading, prophetxExecutionMode } = (0, import_hooks51.useAppConfig)();
14652
+ const executeManaged = (0, import_hooks52.useExecuteManaged)();
14653
+ const placeLimitOrder = (0, import_hooks52.usePlaceLimitOrder)();
14654
+ const aggClient = (0, import_hooks52.useAggClient)();
14655
+ const queryClient = (0, import_hooks52.useQueryClient)();
14656
+ const {
14657
+ disabledVenues,
14658
+ isLoading: isAppConfigLoading,
14659
+ prophetxExecutionMode,
14660
+ novigExecutionMode
14661
+ } = (0, import_hooks52.useAppConfig)();
14483
14662
  const isProphetxDirect = !isPaperMode && prophetxExecutionMode === "direct";
14484
- const canConnectProphetx = (0, import_hooks51.getVenueAvailabilityState)({
14485
- venueId: import_sdk22.Venue.prophetx,
14663
+ const canConnectProphetx = (0, import_hooks52.getVenueAvailabilityState)({
14664
+ venueId: import_sdk23.Venue.prophetx,
14486
14665
  disabledVenues,
14487
14666
  isConfigLoading: isAppConfigLoading
14488
14667
  }) !== "hidden";
14489
- const { data: prophetxKeyStatus, refetch: refetchProphetxKeyStatus } = (0, import_hooks51.useVenueKeyStatus)(
14490
- import_sdk22.Venue.prophetx,
14668
+ const { data: prophetxKeyStatus, refetch: refetchProphetxKeyStatus } = (0, import_hooks52.useVenueKeyStatus)(
14669
+ import_sdk23.Venue.prophetx,
14491
14670
  isAuthenticated && !isPaperMode
14492
14671
  );
14493
- const [isConnectProphetxModalOpen, setIsConnectProphetxModalOpen] = (0, import_react26.useState)(false);
14494
- const { data: kalshiKeyStatus, refetch: refetchKalshiKeyStatus } = (0, import_hooks51.useVenueKeyStatus)(
14495
- import_sdk22.Venue.kalshi,
14672
+ const [isConnectProphetxModalOpen, setIsConnectProphetxModalOpen] = (0, import_react27.useState)(false);
14673
+ const isNovigDirect = !isPaperMode && novigExecutionMode === "direct";
14674
+ const canConnectNovig = (0, import_hooks52.getVenueAvailabilityState)({
14675
+ venueId: import_sdk23.Venue.novig,
14676
+ disabledVenues,
14677
+ isConfigLoading: isAppConfigLoading
14678
+ }) !== "hidden";
14679
+ const { data: novigKeyStatus, refetch: refetchNovigKeyStatus } = (0, import_hooks52.useVenueKeyStatus)(
14680
+ import_sdk23.Venue.novig,
14681
+ isAuthenticated && !isPaperMode
14682
+ );
14683
+ const [isConnectNovigModalOpen, setIsConnectNovigModalOpen] = (0, import_react27.useState)(false);
14684
+ const { data: kalshiKeyStatus, refetch: refetchKalshiKeyStatus } = (0, import_hooks52.useVenueKeyStatus)(
14685
+ import_sdk23.Venue.kalshi,
14496
14686
  isAuthenticated
14497
14687
  );
14498
- const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = (0, import_react26.useState)(false);
14499
- const [isFundKalshiModalOpen, setIsFundKalshiModalOpen] = (0, import_react26.useState)(false);
14500
- const [isBetdexAccountModalOpen, setIsBetdexAccountModalOpen] = (0, import_react26.useState)(false);
14501
- const livePrices = (0, import_hooks51.useLiveOutcomePrices)(
14688
+ const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = (0, import_react27.useState)(false);
14689
+ const [isFundKalshiModalOpen, setIsFundKalshiModalOpen] = (0, import_react27.useState)(false);
14690
+ const [isBetdexAccountModalOpen, setIsBetdexAccountModalOpen] = (0, import_react27.useState)(false);
14691
+ const livePrices = (0, import_hooks52.useLiveOutcomePrices)(
14502
14692
  scopedSelectedMarket ? [scopedSelectedMarket] : void 0
14503
14693
  );
14504
- const wsBestPrices = (0, import_hooks51.useLiveBestPrices)(scopedSelectedMarket ? [scopedSelectedMarket] : void 0);
14505
- const fetchedClusterMidpointResult = (0, import_hooks51.useMidpoints)(
14694
+ const wsBestPrices = (0, import_hooks52.useLiveBestPrices)(scopedSelectedMarket ? [scopedSelectedMarket] : void 0);
14695
+ const fetchedClusterMidpointResult = (0, import_hooks52.useMidpoints)(
14506
14696
  midpointsResult ? [] : scopedSelectedMarket ? [scopedSelectedMarket] : []
14507
14697
  );
14508
14698
  const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
14509
14699
  const clusterBestMidpointsByOutcomeId = (_j = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _j : clusterMidpointResult.prices;
14510
14700
  const clusterBestMidpoint = clusterMidpointResult.bestMidpoint;
14511
14701
  const clusterBestPricesRest = clusterMidpointResult.bestPrices;
14512
- const clusterBestPrices = (0, import_react26.useMemo)(
14513
- () => (0, import_hooks51.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
14702
+ const clusterBestPrices = (0, import_react27.useMemo)(
14703
+ () => (0, import_hooks52.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
14514
14704
  [clusterBestPricesRest, wsBestPrices]
14515
14705
  );
14516
- const [internalTab, setInternalTab] = (0, import_react26.useState)("buy");
14517
- const [executionType, setExecutionType] = (0, import_react26.useState)("market");
14518
- const [selectedLimitVenue, setSelectedLimitVenue] = (0, import_react26.useState)(null);
14519
- const [limitPrice, setLimitPrice] = (0, import_react26.useState)(0.5);
14520
- const [limitPriceInputValue, setLimitPriceInputValue] = (0, import_react26.useState)(formatLimitPriceInputValue(0.5));
14521
- const [limitPriceInputError, setLimitPriceInputError] = (0, import_react26.useState)(null);
14522
- const [limitExpirationType, setLimitExpirationType] = (0, import_react26.useState)("GTC");
14523
- const [limitExpirationDate, setLimitExpirationDate] = (0, import_react26.useState)(void 0);
14524
- const [limitExpirationTime, setLimitExpirationTime] = (0, import_react26.useState)("17:00");
14525
- const [limitExpirationDraftDate, setLimitExpirationDraftDate] = (0, import_react26.useState)();
14526
- const [limitExpirationDraftTime, setLimitExpirationDraftTime] = (0, import_react26.useState)("17:00");
14527
- const [limitExpirationPickerView, setLimitExpirationPickerView] = (0, import_react26.useState)("options");
14528
- const [isLimitExpirationPickerOpen, setIsLimitExpirationPickerOpen] = (0, import_react26.useState)(false);
14529
- const [internalAmount, setInternalAmount] = (0, import_react26.useState)(PLACE_ORDER_DEFAULT_AMOUNT);
14530
- const [sellFilledForOutcomeId, setSellFilledForOutcomeId] = (0, import_react26.useState)(null);
14531
- const [internalSlippage] = (0, import_react26.useState)(DEFAULT_SLIPPAGE_VALUE);
14532
- const [isRoutesExpanded, setIsRoutesExpanded] = (0, import_react26.useState)(false);
14533
- const [selectedRouteCardId, setSelectedRouteCardId] = (0, import_react26.useState)(null);
14534
- const [manualRouteSelectionIdentity, setManualRouteSelectionIdentity] = (0, import_react26.useState)(
14706
+ const [internalTab, setInternalTab] = (0, import_react27.useState)("buy");
14707
+ const [executionType, setExecutionType] = (0, import_react27.useState)("market");
14708
+ const [selectedLimitVenue, setSelectedLimitVenue] = (0, import_react27.useState)(null);
14709
+ const [limitPrice, setLimitPrice] = (0, import_react27.useState)(0.5);
14710
+ const [limitPriceInputValue, setLimitPriceInputValue] = (0, import_react27.useState)(formatLimitPriceInputValue(0.5));
14711
+ const [limitPriceInputError, setLimitPriceInputError] = (0, import_react27.useState)(null);
14712
+ const [limitExpirationType, setLimitExpirationType] = (0, import_react27.useState)("GTC");
14713
+ const [limitExpirationDate, setLimitExpirationDate] = (0, import_react27.useState)(void 0);
14714
+ const [limitExpirationTime, setLimitExpirationTime] = (0, import_react27.useState)("17:00");
14715
+ const [limitExpirationDraftDate, setLimitExpirationDraftDate] = (0, import_react27.useState)();
14716
+ const [limitExpirationDraftTime, setLimitExpirationDraftTime] = (0, import_react27.useState)("17:00");
14717
+ const [limitExpirationPickerView, setLimitExpirationPickerView] = (0, import_react27.useState)("options");
14718
+ const [isLimitExpirationPickerOpen, setIsLimitExpirationPickerOpen] = (0, import_react27.useState)(false);
14719
+ const [internalAmount, setInternalAmount] = (0, import_react27.useState)(PLACE_ORDER_DEFAULT_AMOUNT);
14720
+ const [sellFilledForOutcomeId, setSellFilledForOutcomeId] = (0, import_react27.useState)(null);
14721
+ const [internalSlippage] = (0, import_react27.useState)(DEFAULT_SLIPPAGE_VALUE);
14722
+ const [isRoutesExpanded, setIsRoutesExpanded] = (0, import_react27.useState)(false);
14723
+ const [selectedRouteCardId, setSelectedRouteCardId] = (0, import_react27.useState)(null);
14724
+ const [manualRouteSelectionIdentity, setManualRouteSelectionIdentity] = (0, import_react27.useState)(
14535
14725
  null
14536
14726
  );
14537
- const [isSplitDetailOpen, setIsSplitDetailOpen] = (0, import_react26.useState)(false);
14538
- const [buyGeoBlockSnapshot, setBuyGeoBlockSnapshot] = (0, import_react26.useState)(null);
14539
- const [submissionFeedback, setSubmissionFeedback] = (0, import_react26.useState)(null);
14540
- const [submissionProgressState, setSubmissionProgressState] = (0, import_react26.useState)(null);
14541
- const [isBeforeActionPending, setIsBeforeActionPending] = (0, import_react26.useState)(false);
14542
- const outcomes = (0, import_react26.useMemo)(
14727
+ const [isSplitDetailOpen, setIsSplitDetailOpen] = (0, import_react27.useState)(false);
14728
+ const [buyGeoBlockSnapshot, setBuyGeoBlockSnapshot] = (0, import_react27.useState)(null);
14729
+ const [submissionFeedback, setSubmissionFeedback] = (0, import_react27.useState)(null);
14730
+ const [submissionProgressState, setSubmissionProgressState] = (0, import_react27.useState)(null);
14731
+ const [isBeforeActionPending, setIsBeforeActionPending] = (0, import_react27.useState)(false);
14732
+ const outcomes = (0, import_react27.useMemo)(
14543
14733
  () => mapVenueMarketOutcomesToPlaceOrderOutcomes(scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes),
14544
14734
  [scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes]
14545
14735
  );
14546
- const selectedOutcomeDisplayPrice = (0, import_react26.useMemo)(() => {
14736
+ const selectedOutcomeDisplayPrice = (0, import_react27.useMemo)(() => {
14547
14737
  var _a2;
14548
14738
  if (!scopedSelectedOutcomeId || !scopedSelectedOutcome) return 0.5;
14549
14739
  return getDisplayOutcomePrice({
@@ -14566,25 +14756,25 @@ var PlaceOrder = ({
14566
14756
  scopedSelectedOutcomeId,
14567
14757
  tradingContext == null ? void 0 : tradingContext.tradeSide
14568
14758
  ]);
14569
- const buyTabRef = (0, import_react26.useRef)(null);
14570
- const sellTabRef = (0, import_react26.useRef)(null);
14571
- const expirationTriggerRef = (0, import_react26.useRef)(null);
14572
- const limitPriceInitializedForOutcomeRef = (0, import_react26.useRef)(void 0);
14573
- const expirationOptionRefs = (0, import_react26.useRef)([]);
14574
- const shouldFocusExpirationOptionsRef = (0, import_react26.useRef)(false);
14575
- const expirationTimeInputId = (0, import_react26.useId)();
14576
- const executionDebugStoreRef = (0, import_react26.useRef)(null);
14577
- const executionDebugAttemptIdRef = (0, import_react26.useRef)(null);
14578
- const submittedSelectionRef = (0, import_react26.useRef)(null);
14579
- const lastValidRouteCardsRef = (0, import_react26.useRef)(null);
14580
- (0, import_react26.useEffect)(() => {
14759
+ const buyTabRef = (0, import_react27.useRef)(null);
14760
+ const sellTabRef = (0, import_react27.useRef)(null);
14761
+ const expirationTriggerRef = (0, import_react27.useRef)(null);
14762
+ const limitPriceInitializedForOutcomeRef = (0, import_react27.useRef)(void 0);
14763
+ const expirationOptionRefs = (0, import_react27.useRef)([]);
14764
+ const shouldFocusExpirationOptionsRef = (0, import_react27.useRef)(false);
14765
+ const expirationTimeInputId = (0, import_react27.useId)();
14766
+ const executionDebugStoreRef = (0, import_react27.useRef)(null);
14767
+ const executionDebugAttemptIdRef = (0, import_react27.useRef)(null);
14768
+ const submittedSelectionRef = (0, import_react27.useRef)(null);
14769
+ const lastValidRouteCardsRef = (0, import_react27.useRef)(null);
14770
+ (0, import_react27.useEffect)(() => {
14581
14771
  if (!isExecutionDebugEnabled) {
14582
14772
  executionDebugStoreRef.current = null;
14583
14773
  return;
14584
14774
  }
14585
14775
  executionDebugStoreRef.current = enableExecutionDebugInBrowser();
14586
14776
  }, [isExecutionDebugEnabled]);
14587
- (0, import_react26.useEffect)(() => {
14777
+ (0, import_react27.useEffect)(() => {
14588
14778
  var _a2;
14589
14779
  if (!isLimitExpirationPickerOpen) return;
14590
14780
  if (limitExpirationPickerView !== "options") return;
@@ -14592,7 +14782,7 @@ var PlaceOrder = ({
14592
14782
  (_a2 = expirationOptionRefs.current[LIMIT_EXPIRATION_OPTION_COUNT - 1]) == null ? void 0 : _a2.focus();
14593
14783
  shouldFocusExpirationOptionsRef.current = false;
14594
14784
  }, [isLimitExpirationPickerOpen, limitExpirationPickerView]);
14595
- (0, import_react26.useEffect)(() => {
14785
+ (0, import_react27.useEffect)(() => {
14596
14786
  if (!isExecutionDebugEnabled) return;
14597
14787
  const store = executionDebugStoreRef.current;
14598
14788
  if (!store) return;
@@ -14604,11 +14794,11 @@ var PlaceOrder = ({
14604
14794
  scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id,
14605
14795
  scopedSelectedOutcomeId
14606
14796
  ]);
14607
- const debouncedAmount = (0, import_hooks51.useDebouncedValue)(internalAmount, 300);
14797
+ const debouncedAmount = (0, import_hooks52.useDebouncedValue)(internalAmount, 300);
14608
14798
  const isQuoteInputEditing = internalAmount !== debouncedAmount;
14609
14799
  const isLimitOrder = showLimitOrders && executionType === "limit";
14610
- const isSell = (0, import_react26.useMemo)(() => internalTab === "sell", [internalTab]);
14611
- const limitVenueOptions = (0, import_react26.useMemo)(
14800
+ const isSell = (0, import_react27.useMemo)(() => internalTab === "sell", [internalTab]);
14801
+ const limitVenueOptions = (0, import_react27.useMemo)(
14612
14802
  () => {
14613
14803
  var _a2;
14614
14804
  return buildLimitOrderVenueOptions({
@@ -14620,26 +14810,34 @@ var PlaceOrder = ({
14620
14810
  },
14621
14811
  [clusterMidpointResult, livePrices, scopedSelectedMarket, scopedSelectedOutcomeId]
14622
14812
  );
14623
- const visibleLimitVenueOptions = (0, import_react26.useMemo)(() => {
14813
+ const visibleLimitVenueOptions = (0, import_react27.useMemo)(() => {
14624
14814
  return limitVenueOptions.filter((option) => {
14625
- if (option.venue === import_sdk22.Venue.prophetx && (!isProphetxDirect || isSell)) return false;
14626
- return (0, import_hooks51.getVenueAvailabilityState)({
14815
+ if (option.venue === import_sdk23.Venue.prophetx && (!isProphetxDirect || isSell)) return false;
14816
+ if (option.venue === import_sdk23.Venue.novig && (!isNovigDirect || isSell)) return false;
14817
+ return (0, import_hooks52.getVenueAvailabilityState)({
14627
14818
  venueId: option.venue,
14628
14819
  disabledVenues,
14629
14820
  isConfigLoading: isAppConfigLoading
14630
14821
  }) !== "hidden";
14631
14822
  });
14632
- }, [disabledVenues, isAppConfigLoading, limitVenueOptions, isProphetxDirect, isSell]);
14823
+ }, [
14824
+ disabledVenues,
14825
+ isAppConfigLoading,
14826
+ limitVenueOptions,
14827
+ isProphetxDirect,
14828
+ isNovigDirect,
14829
+ isSell
14830
+ ]);
14633
14831
  const {
14634
14832
  positions: executionPositions,
14635
14833
  dataUpdatedAt: executionPositionsUpdatedAt,
14636
14834
  isLoading: isExecutionPositionsLoading,
14637
14835
  isFetching: isExecutionPositionsFetching
14638
- } = (0, import_hooks51.useExecutionPositions)({
14836
+ } = (0, import_hooks52.useExecutionPositions)({
14639
14837
  enabled: Boolean(isAuthenticated && isSell),
14640
14838
  mode: isPaperMode ? "paper" : void 0
14641
14839
  });
14642
- const sellableSharesByVenue = (0, import_react26.useMemo)(
14840
+ const sellableSharesByVenue = (0, import_react27.useMemo)(
14643
14841
  () => isSell ? resolveSellableSharesByVenue({
14644
14842
  positions: executionPositions,
14645
14843
  market: scopedSelectedMarket,
@@ -14660,7 +14858,7 @@ var PlaceOrder = ({
14660
14858
  isPanelActive: isQuotePanelActive,
14661
14859
  isSubmitting: submissionProgressState != null || isBeforeActionPending || executeManaged.isPending || placeLimitOrder.isPending
14662
14860
  };
14663
- const limitVenueQuoteRequests = (0, import_react26.useMemo)(
14861
+ const limitVenueQuoteRequests = (0, import_react27.useMemo)(
14664
14862
  () => visibleLimitVenueOptions.map((option) => ({
14665
14863
  venue: option.venue,
14666
14864
  venueMarketOutcomeId: option.venueMarketOutcomeId
@@ -14669,7 +14867,7 @@ var PlaceOrder = ({
14669
14867
  );
14670
14868
  const hasValidLimitVenueQuoteAmount = debouncedAmount > 0;
14671
14869
  const isLimitVenueQuoteEnabled = isLimitOrder && isQuotePanelActive && !isEndedWithoutKnownWinner && !submissionProgressState && !isBeforeActionPending && !placeLimitOrder.isPending && hasValidLimitVenueQuoteAmount && orderEligibility.canPlaceOrder && (!isSell || sellFilledForOutcomeId === scopedSelectedOutcomeId && !isQuoteInputEditing);
14672
- const limitVenueQuotes = (0, import_hooks51.useLimitOrderVenueQuotes)({
14870
+ const limitVenueQuotes = (0, import_hooks52.useLimitOrderVenueQuotes)({
14673
14871
  requests: limitVenueQuoteRequests,
14674
14872
  tradeSide: internalTab,
14675
14873
  amount: debouncedAmount,
@@ -14681,11 +14879,11 @@ var PlaceOrder = ({
14681
14879
  enabled: isLimitVenueQuoteEnabled,
14682
14880
  refreshContext: smartRouteRefreshContext
14683
14881
  });
14684
- const limitVenueQuoteByVenue = (0, import_react26.useMemo)(
14882
+ const limitVenueQuoteByVenue = (0, import_react27.useMemo)(
14685
14883
  () => new Map(limitVenueQuotes.quotes.map((quote) => [quote.request.venue, quote])),
14686
14884
  [limitVenueQuotes.quotes]
14687
14885
  );
14688
- const geoBlockedLimitVenues = (0, import_react26.useMemo)(() => {
14886
+ const geoBlockedLimitVenues = (0, import_react27.useMemo)(() => {
14689
14887
  var _a2;
14690
14888
  const venues = /* @__PURE__ */ new Set();
14691
14889
  for (const quote of limitVenueQuotes.quotes) {
@@ -14695,7 +14893,7 @@ var PlaceOrder = ({
14695
14893
  }
14696
14894
  return venues;
14697
14895
  }, [limitVenueQuotes.quotes]);
14698
- const availableLimitVenueOptions = (0, import_react26.useMemo)(() => {
14896
+ const availableLimitVenueOptions = (0, import_react27.useMemo)(() => {
14699
14897
  return visibleLimitVenueOptions.filter((option) => {
14700
14898
  var _a2;
14701
14899
  return !geoBlockedLimitVenues.has(option.venue) && // A limit SELL rests against shares held at that specific venue, so a
@@ -14703,7 +14901,7 @@ var PlaceOrder = ({
14703
14901
  // server's reservation check — and the automatic pick, which sorts on
14704
14902
  // price alone, would happily choose one. Only narrow once we know
14705
14903
  // where the shares are; an empty map means positions haven't resolved.
14706
- (!isSell || sellableSharesByVenue.size === 0 || ((_a2 = sellableSharesByVenue.get(option.venue)) != null ? _a2 : 0) > 0) && (0, import_hooks51.getVenueAvailabilityState)({
14904
+ (!isSell || sellableSharesByVenue.size === 0 || ((_a2 = sellableSharesByVenue.get(option.venue)) != null ? _a2 : 0) > 0) && (0, import_hooks52.getVenueAvailabilityState)({
14707
14905
  venueId: option.venue,
14708
14906
  disabledVenues,
14709
14907
  isConfigLoading: isAppConfigLoading
@@ -14717,11 +14915,11 @@ var PlaceOrder = ({
14717
14915
  sellableSharesByVenue,
14718
14916
  visibleLimitVenueOptions
14719
14917
  ]);
14720
- const automaticLimitVenueOption = (0, import_react26.useMemo)(
14918
+ const automaticLimitVenueOption = (0, import_react27.useMemo)(
14721
14919
  () => resolveAutomaticLimitOrderVenueOption(availableLimitVenueOptions, internalTab),
14722
14920
  [availableLimitVenueOptions, internalTab]
14723
14921
  );
14724
- const selectedLimitVenueOption = (0, import_react26.useMemo)(() => {
14922
+ const selectedLimitVenueOption = (0, import_react27.useMemo)(() => {
14725
14923
  if (selectedLimitVenue) {
14726
14924
  const selectedOption = availableLimitVenueOptions.find(
14727
14925
  (option) => option.venue === selectedLimitVenue
@@ -14730,11 +14928,11 @@ var PlaceOrder = ({
14730
14928
  }
14731
14929
  return automaticLimitVenueOption;
14732
14930
  }, [automaticLimitVenueOption, availableLimitVenueOptions, selectedLimitVenue]);
14733
- (0, import_react26.useEffect)(() => {
14931
+ (0, import_react27.useEffect)(() => {
14734
14932
  if (!selectedLimitVenue || !geoBlockedLimitVenues.has(selectedLimitVenue)) return;
14735
14933
  setSelectedLimitVenue(null);
14736
14934
  }, [geoBlockedLimitVenues, selectedLimitVenue]);
14737
- const smartRoute = (0, import_hooks51.useSmartRoute)(__spreadProps(__spreadValues({
14935
+ const smartRoute = (0, import_hooks52.useSmartRoute)(__spreadProps(__spreadValues({
14738
14936
  venueMarketOutcomeId: scopedSelectedOutcomeId,
14739
14937
  maxSpend: isSell ? void 0 : debouncedAmount,
14740
14938
  sellShares: isSell ? debouncedAmount : void 0,
@@ -14758,7 +14956,7 @@ var PlaceOrder = ({
14758
14956
  } : {}), {
14759
14957
  refreshContext: smartRouteRefreshContext
14760
14958
  }));
14761
- (0, import_react26.useEffect)(() => {
14959
+ (0, import_react27.useEffect)(() => {
14762
14960
  var _a2, _b2, _c2;
14763
14961
  if (isSell || smartRoute.isFetching || ((_a2 = smartRoute.data) == null ? void 0 : _a2.venueMarketOutcomeId) !== scopedSelectedOutcomeId) {
14764
14962
  return;
@@ -14780,7 +14978,7 @@ var PlaceOrder = ({
14780
14978
  smartRoute.isFetching,
14781
14979
  user == null ? void 0 : user.id
14782
14980
  ]);
14783
- const inheritedBuyGeoBlockedVenues = (0, import_react26.useMemo)(() => {
14981
+ const inheritedBuyGeoBlockedVenues = (0, import_react27.useMemo)(() => {
14784
14982
  var _a2, _b2;
14785
14983
  if (!isSell || !buyGeoBlockSnapshot || !scopedSelectedOutcomeId) return void 0;
14786
14984
  if (buyGeoBlockSnapshot.eventId !== ((_a2 = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.id) != null ? _a2 : null)) return void 0;
@@ -14796,7 +14994,7 @@ var PlaceOrder = ({
14796
14994
  scopedSelectedOutcomeId,
14797
14995
  user == null ? void 0 : user.id
14798
14996
  ]);
14799
- const venueSellQuoteRequests = (0, import_react26.useMemo)(
14997
+ const venueSellQuoteRequests = (0, import_react27.useMemo)(
14800
14998
  () => {
14801
14999
  var _a2;
14802
15000
  return isSell && !smartRoute.isLoading && ((_a2 = smartRoute.data) == null ? void 0 : _a2.venueMarketOutcomeId) === scopedSelectedOutcomeId ? buildVenueSellQuoteRequests({
@@ -14806,7 +15004,7 @@ var PlaceOrder = ({
14806
15004
  },
14807
15005
  [debouncedAmount, isSell, scopedSelectedOutcomeId, smartRoute.data, smartRoute.isLoading]
14808
15006
  );
14809
- const venueSellQuotes = (0, import_hooks51.useVenueSellQuotes)({
15007
+ const venueSellQuotes = (0, import_hooks52.useVenueSellQuotes)({
14810
15008
  venueMarketOutcomeId: scopedSelectedOutcomeId,
14811
15009
  accountId: (_n = user == null ? void 0 : user.id) != null ? _n : null,
14812
15010
  positionVersion: executionPositionsUpdatedAt,
@@ -14816,7 +15014,7 @@ var PlaceOrder = ({
14816
15014
  enabled: isSell && isSmartRouteEnabled && !smartRoute.isLoading && ((_o = smartRoute.data) == null ? void 0 : _o.venueMarketOutcomeId) === scopedSelectedOutcomeId,
14817
15015
  refreshContext: smartRouteRefreshContext
14818
15016
  });
14819
- const currentSellableShares = (0, import_react26.useMemo)(() => {
15017
+ const currentSellableShares = (0, import_react27.useMemo)(() => {
14820
15018
  var _a2, _b2;
14821
15019
  const sharesFromQuote = (_b2 = (_a2 = smartRoute.data) == null ? void 0 : _a2.positionAvailability) == null ? void 0 : _b2.totalSellableShares;
14822
15020
  if (typeof sharesFromQuote === "number" && Number.isFinite(sharesFromQuote)) {
@@ -14826,22 +15024,22 @@ var PlaceOrder = ({
14826
15024
  for (const size of sellableSharesByVenue.values()) resolvedShares += size;
14827
15025
  return Math.max(0, resolvedShares);
14828
15026
  }, [sellableSharesByVenue, (_q = (_p = smartRoute.data) == null ? void 0 : _p.positionAvailability) == null ? void 0 : _q.totalSellableShares]);
14829
- const maxSellableShares = (0, import_react26.useMemo)(
15027
+ const maxSellableShares = (0, import_react27.useMemo)(
14830
15028
  () => floorToDecimals(currentSellableShares, SELL_SHARE_INPUT_DECIMALS),
14831
15029
  [currentSellableShares]
14832
15030
  );
14833
15031
  const isCurrentSellableSharesLoading = isSell && isAuthenticated && !(typeof ((_s = (_r = smartRoute.data) == null ? void 0 : _r.positionAvailability) == null ? void 0 : _s.totalSellableShares) === "number") && (isExecutionPositionsLoading || isExecutionPositionsFetching);
14834
- const displayedCurrentSellableShares = (0, import_react26.useMemo)(() => {
15032
+ const displayedCurrentSellableShares = (0, import_react27.useMemo)(() => {
14835
15033
  if (!Number.isFinite(currentSellableShares) || currentSellableShares <= 0) return 0;
14836
15034
  return floorToDecimals(currentSellableShares, SELL_SHARE_DISPLAY_DECIMALS);
14837
15035
  }, [currentSellableShares]);
14838
- const displayedCurrentSellableSharesLabel = (0, import_react26.useMemo)(
15036
+ const displayedCurrentSellableSharesLabel = (0, import_react27.useMemo)(
14839
15037
  () => `${formatFlooredShareAmount(maxSellableShares, SELL_SHARE_DISPLAY_DECIMALS)} shares`,
14840
15038
  [maxSellableShares]
14841
15039
  );
14842
15040
  const isAtMaxSellableShares = isSell && maxSellableShares > 0 && Math.abs(internalAmount - maxSellableShares) < 1e-9;
14843
15041
  const isSellAmountAboveAvailability = isSell && ((_t = smartRoute.data) == null ? void 0 : _t.venueMarketOutcomeId) === scopedSelectedOutcomeId && typeof ((_u = smartRoute.data.positionAvailability) == null ? void 0 : _u.totalSellableShares) === "number" && internalAmount > maxSellableShares;
14844
- (0, import_react26.useEffect)(() => {
15042
+ (0, import_react27.useEffect)(() => {
14845
15043
  if (submissionProgressState != null) return;
14846
15044
  if (!isSell || isCurrentSellableSharesLoading) return;
14847
15045
  if (scopedSelectedOutcomeId === sellFilledForOutcomeId) return;
@@ -14857,7 +15055,7 @@ var PlaceOrder = ({
14857
15055
  onAmountChange,
14858
15056
  submissionProgressState
14859
15057
  ]);
14860
- (0, import_react26.useEffect)(() => {
15058
+ (0, import_react27.useEffect)(() => {
14861
15059
  var _a2, _b2;
14862
15060
  if (submissionProgressState != null || !isSell) return;
14863
15061
  if (((_a2 = smartRoute.data) == null ? void 0 : _a2.venueMarketOutcomeId) !== scopedSelectedOutcomeId) return;
@@ -14880,16 +15078,16 @@ var PlaceOrder = ({
14880
15078
  (_x = smartRoute.data) == null ? void 0 : _x.venueMarketOutcomeId,
14881
15079
  submissionProgressState
14882
15080
  ]);
14883
- const { account: betdexAccount, isAvailable: isBetdexAccountAvailable } = (0, import_hooks51.useHostedVenueAccount)(
15081
+ const { account: betdexAccount, isAvailable: isBetdexAccountAvailable } = (0, import_hooks52.useHostedVenueAccount)(
14884
15082
  "betdex",
14885
- !isPaperMode && isQuotePanelActive && ((scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === import_sdk22.Venue.betdex || (scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venueMarkets.some((market) => market.venue === import_sdk22.Venue.betdex)) === true || ((_y = smartRoute.data) == null ? void 0 : _y.fills.some((fill) => fill.venue === import_sdk22.Venue.betdex)) === true)
15083
+ !isPaperMode && isQuotePanelActive && ((scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === import_sdk23.Venue.betdex || (scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venueMarkets.some((market) => market.venue === import_sdk23.Venue.betdex)) === true || ((_y = smartRoute.data) == null ? void 0 : _y.fills.some((fill) => fill.venue === import_sdk23.Venue.betdex)) === true)
14886
15084
  );
14887
15085
  const betdexAccountData = betdexAccount.data;
14888
15086
  const betdexBalance = isBetdexAccountAvailable && !betdexAccount.isError && (betdexAccountData == null ? void 0 : betdexAccountData.status) === "active" && betdexAccountData.balanceStatus === "available" ? betdexAccountData.balance : null;
14889
15087
  const betdexAvailableAmount = betdexBalance ? Number(betdexBalance.availableRaw) / __pow(10, betdexBalance.decimals) : NaN;
14890
15088
  const betdexAvailableBalance = Number.isFinite(betdexAvailableAmount) && betdexAvailableAmount >= 0 ? betdexAvailableAmount : null;
14891
15089
  const scopedSmartRouteData = ((_z = smartRoute.data) == null ? void 0 : _z.venueMarketOutcomeId) === scopedSelectedOutcomeId ? smartRoute.data : null;
14892
- const routeCards = (0, import_react26.useMemo)(() => {
15090
+ const routeCards = (0, import_react27.useMemo)(() => {
14893
15091
  const eventVenues = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venueMarkets.map((market) => market.venue);
14894
15092
  if (isSell) {
14895
15093
  return buildLiveSellRouteCards({
@@ -14936,7 +15134,7 @@ var PlaceOrder = ({
14936
15134
  const selectedManualRouteCard = manualRouteSelectionIdentity ? routeCards.find(
14937
15135
  (card) => getPlaceOrderRouteCardIdentity(card) === manualRouteSelectionIdentity
14938
15136
  ) : void 0;
14939
- const legacyKalshiAccount = (0, import_react26.useMemo)(
15137
+ const legacyKalshiAccount = (0, import_react27.useMemo)(
14940
15138
  () => {
14941
15139
  var _a2;
14942
15140
  return (_a2 = user == null ? void 0 : user.venueAccounts) == null ? void 0 : _a2.find((venueAccount) => venueAccount.venue === "kalshi");
@@ -14945,13 +15143,13 @@ var PlaceOrder = ({
14945
15143
  );
14946
15144
  const isKalshiAccountActive = (_C = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _C : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
14947
15145
  const hasKalshiConnectionState = kalshiKeyStatus !== void 0 || (user == null ? void 0 : user.venueAccounts) != null;
14948
- const isKalshiAvailable = (0, import_hooks51.getVenueAvailabilityState)({
15146
+ const isKalshiAvailable = (0, import_hooks52.getVenueAvailabilityState)({
14949
15147
  venueId: "kalshi",
14950
15148
  disabledVenues,
14951
15149
  isConfigLoading: isAppConfigLoading
14952
15150
  }) === "available";
14953
15151
  const isKalshiDisconnected = !isPaperMode && isAuthenticated && hasKalshiConnectionState && isKalshiAvailable && !isKalshiAccountActive;
14954
- const resolvedSelectedRouteCardId = (0, import_react26.useMemo)(() => {
15152
+ const resolvedSelectedRouteCardId = (0, import_react27.useMemo)(() => {
14955
15153
  var _a2;
14956
15154
  if (selectedManualRouteCard && !selectedManualRouteCard.isUnavailable) {
14957
15155
  return selectedManualRouteCard.id;
@@ -14973,7 +15171,7 @@ var PlaceOrder = ({
14973
15171
  selectedRouteCardId,
14974
15172
  (_D = smartRoute.data) == null ? void 0 : _D.status
14975
15173
  ]);
14976
- (0, import_react26.useEffect)(() => {
15174
+ (0, import_react27.useEffect)(() => {
14977
15175
  if (routeCards.length === 0) {
14978
15176
  if (isRouteCardsTransient) return;
14979
15177
  setSelectedRouteCardId(null);
@@ -14997,19 +15195,19 @@ var PlaceOrder = ({
14997
15195
  selectedRouteCardId
14998
15196
  ]);
14999
15197
  const isSubmissionLocked = submissionProgressState != null;
15000
- const isSubmissionLockedRef = (0, import_react26.useRef)(isSubmissionLocked);
15198
+ const isSubmissionLockedRef = (0, import_react27.useRef)(isSubmissionLocked);
15001
15199
  isSubmissionLockedRef.current = isSubmissionLocked;
15002
- (0, import_react26.useEffect)(() => {
15200
+ (0, import_react27.useEffect)(() => {
15003
15201
  if (isSubmissionLockedRef.current) return;
15004
15202
  setSubmissionFeedback(null);
15005
15203
  setSubmissionProgressState(null);
15006
15204
  }, [executionType, internalAmount, internalSlippage, internalTab, scopedSelectedOutcomeId]);
15007
- (0, import_react26.useEffect)(() => {
15205
+ (0, import_react27.useEffect)(() => {
15008
15206
  if (showLimitOrders || executionType !== "limit") return;
15009
15207
  setExecutionType("market");
15010
15208
  setIsLimitExpirationPickerOpen(false);
15011
15209
  }, [executionType, showLimitOrders]);
15012
- (0, import_react26.useEffect)(() => {
15210
+ (0, import_react27.useEffect)(() => {
15013
15211
  if (executionType !== "limit") {
15014
15212
  limitPriceInitializedForOutcomeRef.current = void 0;
15015
15213
  return;
@@ -15022,10 +15220,10 @@ var PlaceOrder = ({
15022
15220
  setLimitPriceInputValue(formatLimitPriceInputValue(nextLimitPrice));
15023
15221
  setLimitPriceInputError(null);
15024
15222
  }, [executionType, scopedSelectedOutcomeId, selectedOutcomeDisplayPrice]);
15025
- (0, import_react26.useEffect)(() => {
15223
+ (0, import_react27.useEffect)(() => {
15026
15224
  setSelectedLimitVenue(null);
15027
15225
  }, [scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id, scopedSelectedOutcomeId]);
15028
- (0, import_react26.useEffect)(() => {
15226
+ (0, import_react27.useEffect)(() => {
15029
15227
  setSelectedRouteCardId(null);
15030
15228
  setManualRouteSelectionIdentity(null);
15031
15229
  setIsRoutesExpanded(false);
@@ -15034,9 +15232,12 @@ var PlaceOrder = ({
15034
15232
  const orderedRouteCards = routeCards;
15035
15233
  const selectedRouteCard = (_F = (_E = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _E : orderedRouteCards[0]) != null ? _F : null;
15036
15234
  const hasDirectProphetxQuote = (_G = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills.some(
15037
- (fill) => fill.venue === import_sdk22.Venue.prophetx && fill.executionBackend === "direct"
15235
+ (fill) => fill.venue === import_sdk23.Venue.prophetx && fill.executionBackend === "direct"
15038
15236
  )) != null ? _G : false;
15039
- const selectedSharedKycVenue = (0, import_react26.useMemo)(() => {
15237
+ const hasDirectNovigQuote = (_H = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills.some(
15238
+ (fill) => fill.venue === import_sdk23.Venue.novig && fill.executionBackend === "direct"
15239
+ )) != null ? _H : false;
15240
+ const selectedSharedKycVenue = (0, import_react27.useMemo)(() => {
15040
15241
  var _a2, _b2;
15041
15242
  const candidateVenue = isLimitOrder ? selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue : (_b2 = (_a2 = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills.find(
15042
15243
  (fill) => venueRequiresSharedKyc({
@@ -15044,7 +15245,9 @@ var PlaceOrder = ({
15044
15245
  requiresKyc: fill.executionBackend === "direct" ? false : void 0
15045
15246
  })
15046
15247
  )) == null ? void 0 : _a2.venue) != null ? _b2 : selectedRouteCard == null ? void 0 : selectedRouteCard.venue;
15047
- if (candidateVenue === import_sdk22.Venue.prophetx && (isProphetxDirect || hasDirectProphetxQuote) && (!isSell || !sellableSharesByVenue.get(import_sdk22.Venue.prophetx)))
15248
+ if (candidateVenue === import_sdk23.Venue.prophetx && (isProphetxDirect || hasDirectProphetxQuote) && (!isSell || !sellableSharesByVenue.get(import_sdk23.Venue.prophetx)))
15249
+ return null;
15250
+ if (candidateVenue === import_sdk23.Venue.novig && (isNovigDirect || hasDirectNovigQuote) && (!isSell || !sellableSharesByVenue.get(import_sdk23.Venue.novig)))
15048
15251
  return null;
15049
15252
  if (!venueRequiresSharedKyc({ venue: candidateVenue })) return null;
15050
15253
  const parsedVenue = parseVenue(candidateVenue);
@@ -15055,42 +15258,47 @@ var PlaceOrder = ({
15055
15258
  selectedRouteCard,
15056
15259
  isProphetxDirect,
15057
15260
  hasDirectProphetxQuote,
15261
+ isNovigDirect,
15262
+ hasDirectNovigQuote,
15058
15263
  isSell,
15059
15264
  sellableSharesByVenue
15060
15265
  ]);
15061
15266
  const needsSharedKycVerification = !isPaperMode && isAuthenticated && sharedKyc !== void 0 && selectedSharedKycVenue !== null && sharedKyc.status !== "verified";
15062
- const isKalshiRoute = (0, import_react26.useMemo)(() => {
15063
- if (isLimitOrder) return (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) === import_sdk22.Venue.kalshi;
15267
+ const isKalshiRoute = (0, import_react27.useMemo)(() => {
15268
+ if (isLimitOrder) return (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) === import_sdk23.Venue.kalshi;
15064
15269
  if (selectedRouteCard) {
15065
15270
  return selectedRouteCard.venue === "kalshi" || selectedRouteCard.quoteData.fills.some((f) => f.venue === "kalshi");
15066
15271
  }
15067
15272
  return (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === "kalshi";
15068
15273
  }, [isLimitOrder, selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue, selectedRouteCard, scopedSelectedMarket]);
15069
- const isProphetxDirectRoute = !isPaperMode && (isProphetxDirect || hasDirectProphetxQuote) && (!isSell || !sellableSharesByVenue.get(import_sdk22.Venue.prophetx)) && (isLimitOrder ? (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) === import_sdk22.Venue.prophetx : selectedRouteCard ? selectedRouteCard.venue === import_sdk22.Venue.prophetx || selectedRouteCard.quoteData.fills.some((fill) => fill.venue === import_sdk22.Venue.prophetx) : (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === import_sdk22.Venue.prophetx);
15070
- const prophetxBalance = (_I = (_H = liveBalanceState.venueCashBalances) == null ? void 0 : _H[import_sdk22.Venue.prophetx]) != null ? _I : 0;
15274
+ const isProphetxDirectRoute = !isPaperMode && (isProphetxDirect || hasDirectProphetxQuote) && (!isSell || !sellableSharesByVenue.get(import_sdk23.Venue.prophetx)) && (isLimitOrder ? (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) === import_sdk23.Venue.prophetx : selectedRouteCard ? selectedRouteCard.venue === import_sdk23.Venue.prophetx || selectedRouteCard.quoteData.fills.some((fill) => fill.venue === import_sdk23.Venue.prophetx) : (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === import_sdk23.Venue.prophetx);
15275
+ const prophetxBalance = (_J = (_I = liveBalanceState.venueCashBalances) == null ? void 0 : _I[import_sdk23.Venue.prophetx]) != null ? _J : 0;
15071
15276
  const needsProphetxConnection = !isPaperMode && isAuthenticated && canConnectProphetx && isProphetxDirectRoute && !(prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.connected);
15072
- (0, import_react26.useEffect)(() => {
15073
- if ((selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) === import_sdk22.Venue.prophetx) {
15277
+ const isNovigDirectRoute = !isPaperMode && (isNovigDirect || hasDirectNovigQuote) && (!isSell || !sellableSharesByVenue.get(import_sdk23.Venue.novig)) && (isLimitOrder ? (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) === import_sdk23.Venue.novig : selectedRouteCard ? selectedRouteCard.venue === import_sdk23.Venue.novig || selectedRouteCard.quoteData.fills.some((fill) => fill.venue === import_sdk23.Venue.novig) : (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === import_sdk23.Venue.novig);
15278
+ const novigBalance = (_L = (_K = liveBalanceState.venueCashBalances) == null ? void 0 : _K[import_sdk23.Venue.novig]) != null ? _L : 0;
15279
+ const needsNovigConnection = !isPaperMode && isAuthenticated && canConnectNovig && isNovigDirectRoute && !(novigKeyStatus == null ? void 0 : novigKeyStatus.connected);
15280
+ (0, import_react27.useEffect)(() => {
15281
+ if ((selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) === import_sdk23.Venue.prophetx || (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) === import_sdk23.Venue.novig) {
15074
15282
  setLimitExpirationType("GTC");
15075
15283
  setIsLimitExpirationPickerOpen(false);
15076
15284
  }
15077
15285
  }, [selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue]);
15078
- const selectedRouteFills = (_J = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _J : [];
15079
- const fallbackRouteVenue = isLimitOrder ? selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue : (_K = selectedRouteCard == null ? void 0 : selectedRouteCard.venue) != null ? _K : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue;
15080
- const isBetdexRoute = isLimitOrder || selectedRouteFills.length === 0 ? fallbackRouteVenue === import_sdk22.Venue.betdex : selectedRouteFills.some((fill) => fill.venue === import_sdk22.Venue.betdex);
15081
- const isBetdexOnlyRoute = isBetdexRoute && (isLimitOrder || selectedRouteFills.every((fill) => fill.venue === import_sdk22.Venue.betdex));
15082
- const totalBalance = isPaperMode ? paperTotalBalance : isProphetxDirectRoute ? prophetxBalance : isBetdexOnlyRoute ? (betdexAvailableBalance != null ? betdexAvailableBalance : 0) + (isLimitOrder ? 0 : liveAvailableBalance) : liveAvailableBalance;
15286
+ const selectedRouteFills = (_M = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _M : [];
15287
+ const fallbackRouteVenue = isLimitOrder ? selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue : (_N = selectedRouteCard == null ? void 0 : selectedRouteCard.venue) != null ? _N : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue;
15288
+ const isBetdexRoute = isLimitOrder || selectedRouteFills.length === 0 ? fallbackRouteVenue === import_sdk23.Venue.betdex : selectedRouteFills.some((fill) => fill.venue === import_sdk23.Venue.betdex);
15289
+ const isBetdexOnlyRoute = isBetdexRoute && (isLimitOrder || selectedRouteFills.every((fill) => fill.venue === import_sdk23.Venue.betdex));
15290
+ const totalBalance = isPaperMode ? paperTotalBalance : isNovigDirectRoute ? novigBalance : isProphetxDirectRoute ? prophetxBalance : isBetdexOnlyRoute ? (betdexAvailableBalance != null ? betdexAvailableBalance : 0) + (isLimitOrder ? 0 : liveAvailableBalance) : liveAvailableBalance;
15083
15291
  const isBalanceLoading = isPaperMode ? paperBalancesQuery.isLoading : isBetdexOnlyRoute ? betdexAccount.isLoading || !isLimitOrder && liveBalanceState.isLoading : liveBalanceState.isLoading || isBetdexRoute && betdexAccount.isLoading;
15084
- const displayedBalance = isPaperMode ? paperTotalBalance : isProphetxDirectRoute ? prophetxBalance : isBetdexOnlyRoute ? (betdexAvailableBalance != null ? betdexAvailableBalance : 0) + (isLimitOrder ? 0 : liveAvailableBalance) : isKalshiRoute ? (_L = liveBalanceState.kalshiBalance) != null ? _L : 0 : liveAvailableBalance;
15292
+ const displayedBalance = isPaperMode ? paperTotalBalance : isNovigDirectRoute ? novigBalance : isProphetxDirectRoute ? prophetxBalance : isBetdexOnlyRoute ? (betdexAvailableBalance != null ? betdexAvailableBalance : 0) + (isLimitOrder ? 0 : liveAvailableBalance) : isKalshiRoute ? (_O = liveBalanceState.kalshiBalance) != null ? _O : 0 : liveAvailableBalance;
15085
15293
  const betdexBalanceLabel = betdexAvailableBalance === null ? tradingLabels.betdexBalanceUnavailable : tradingLabels.betdexBalance(formatUsd(betdexAvailableBalance));
15086
15294
  const needsKalshiConnection = isKalshiDisconnected && isKalshiRoute;
15087
- const handleVerifyKalshi = (0, import_react26.useCallback)(
15295
+ const handleVerifyKalshi = (0, import_react27.useCallback)(
15088
15296
  (credentials) => __async(null, null, function* () {
15089
15297
  if (onConnectKalshi) {
15090
15298
  yield onConnectKalshi(credentials);
15091
15299
  } else {
15092
15300
  yield aggClient.upsertVenueKey({
15093
- venue: import_sdk22.Venue.kalshi,
15301
+ venue: import_sdk23.Venue.kalshi,
15094
15302
  credentials: {
15095
15303
  keyId: credentials.apiKeyId,
15096
15304
  privateKey: credentials.privateKey
@@ -15102,7 +15310,7 @@ var PlaceOrder = ({
15102
15310
  }),
15103
15311
  [aggClient, onConnectKalshi, refetchKalshiKeyStatus]
15104
15312
  );
15105
- const handleRouteCardSelect = (0, import_react26.useCallback)(
15313
+ const handleRouteCardSelect = (0, import_react27.useCallback)(
15106
15314
  (cardId) => {
15107
15315
  const card = routeCards.find((routeCard) => routeCard.id === cardId);
15108
15316
  if (!card || card.isUnavailable) return;
@@ -15133,25 +15341,25 @@ var PlaceOrder = ({
15133
15341
  scopedSelectedOutcomeId
15134
15342
  ]
15135
15343
  );
15136
- const executionProgress = (0, import_hooks51.useExecutionProgress)({
15137
- orderIds: (_M = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _M : null,
15138
- quoteId: (_N = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _N : null,
15344
+ const executionProgress = (0, import_hooks52.useExecutionProgress)({
15345
+ orderIds: (_P = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _P : null,
15346
+ quoteId: (_Q = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _Q : null,
15139
15347
  mode: isPaperMode ? "paper" : void 0,
15140
- enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_O = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _O.length)
15348
+ enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_R = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _R.length)
15141
15349
  });
15142
- const executionProgressFloorRef = (0, import_react26.useRef)({
15350
+ const executionProgressFloorRef = (0, import_react27.useRef)({
15143
15351
  quoteId: null,
15144
15352
  value: 0
15145
15353
  });
15146
- const selectedOutcome = (_P = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) != null ? _P : scopedSelectedOutcome;
15147
- const selectedOutcomeLabel = (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === import_sdk22.Venue.betdex ? ((_Q = selectedOutcome == null ? void 0 : selectedOutcome.title) == null ? void 0 : _Q.trim()) || (selectedOutcome == null ? void 0 : selectedOutcome.label) || "" : (_R = selectedOutcome == null ? void 0 : selectedOutcome.label) != null ? _R : "";
15148
- const headerImage = (_T = (_S = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _S : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _T : null;
15149
- const headerTitle = (_V = (_U = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _U : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _V : "";
15150
- const headerSubtitle = (_W = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _W : "";
15151
- const executionDateSource = (_X = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.endDate) != null ? _X : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.endDate;
15354
+ const selectedOutcome = (_S = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) != null ? _S : scopedSelectedOutcome;
15355
+ const selectedOutcomeLabel = (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === import_sdk23.Venue.betdex ? ((_T = selectedOutcome == null ? void 0 : selectedOutcome.title) == null ? void 0 : _T.trim()) || (selectedOutcome == null ? void 0 : selectedOutcome.label) || "" : (_U = selectedOutcome == null ? void 0 : selectedOutcome.label) != null ? _U : "";
15356
+ const headerImage = (_W = (_V = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _V : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _W : null;
15357
+ const headerTitle = (_Y = (_X = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _X : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _Y : "";
15358
+ const headerSubtitle = (_Z = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _Z : "";
15359
+ const executionDateSource = (__ = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.endDate) != null ? __ : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.endDate;
15152
15360
  const executionDateLabel = executionDateSource ? getTradingDateLabel(executionDateSource) : "";
15153
- const executionQuoteData = (_Z = (_Y = submissionProgressState == null ? void 0 : submissionProgressState.quoteData) != null ? _Y : selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _Z : null;
15154
- const executionOrderGroups = (0, import_react26.useMemo)(() => {
15361
+ const executionQuoteData = (_aa = (_$ = submissionProgressState == null ? void 0 : submissionProgressState.quoteData) != null ? _$ : selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _aa : null;
15362
+ const executionOrderGroups = (0, import_react27.useMemo)(() => {
15155
15363
  var _a2, _b2, _c2;
15156
15364
  if (submissionProgressState == null ? void 0 : submissionProgressState.limitOrderGroup) return [submissionProgressState.limitOrderGroup];
15157
15365
  if (!executionQuoteData) return [];
@@ -15173,10 +15381,10 @@ var PlaceOrder = ({
15173
15381
  executionQuoteData,
15174
15382
  internalTab,
15175
15383
  submissionProgressState == null ? void 0 : submissionProgressState.limitOrderGroup,
15176
- (__ = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : __.length,
15384
+ (_ba = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _ba.length,
15177
15385
  tradingLabels
15178
15386
  ]);
15179
- const executionProgressPercent = (0, import_react26.useMemo)(() => {
15387
+ const executionProgressPercent = (0, import_react27.useMemo)(() => {
15180
15388
  var _a2, _b2, _c2;
15181
15389
  const quoteId = (_a2 = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _a2 : null;
15182
15390
  const previousProgress = executionProgressFloorRef.current.quoteId === quoteId ? executionProgressFloorRef.current.value : 0;
@@ -15196,7 +15404,7 @@ var PlaceOrder = ({
15196
15404
  submissionProgressState == null ? void 0 : submissionProgressState.orderIds,
15197
15405
  submissionProgressState == null ? void 0 : submissionProgressState.quoteId
15198
15406
  ]);
15199
- const buildExecutionSummary = (0, import_react26.useCallback)(
15407
+ const buildExecutionSummary = (0, import_react27.useCallback)(
15200
15408
  (quoteData, executionVenue, orderId, partialFillSummary) => {
15201
15409
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2;
15202
15410
  if (!quoteData) return void 0;
@@ -15300,7 +15508,7 @@ var PlaceOrder = ({
15300
15508
  tradingLabels
15301
15509
  ]
15302
15510
  );
15303
- (0, import_react26.useEffect)(() => {
15511
+ (0, import_react27.useEffect)(() => {
15304
15512
  if (executionProgress.phase === "order_submitted") {
15305
15513
  const submittedOrder = executionProgress.submittedOrders[0];
15306
15514
  setSubmissionProgressState((prev) => {
@@ -15313,7 +15521,7 @@ var PlaceOrder = ({
15313
15521
  });
15314
15522
  }
15315
15523
  }, [executionProgress.phase, executionProgress.submittedOrders]);
15316
- (0, import_react26.useEffect)(() => {
15524
+ (0, import_react27.useEffect)(() => {
15317
15525
  var _a2, _b2;
15318
15526
  const dp = executionProgress.dagProgress;
15319
15527
  if (!dp) return;
@@ -15368,7 +15576,7 @@ var PlaceOrder = ({
15368
15576
  return __spreadProps(__spreadValues({}, prev), { dagProgress: dp });
15369
15577
  });
15370
15578
  }, [executionOrderGroups, executionProgress.dagProgress, tradingLabels]);
15371
- (0, import_react26.useEffect)(() => {
15579
+ (0, import_react27.useEffect)(() => {
15372
15580
  const orderIds = submissionProgressState == null ? void 0 : submissionProgressState.orderIds;
15373
15581
  if (!(orderIds == null ? void 0 : orderIds.length)) return;
15374
15582
  const aggregateStatus = deriveAggregateOrderStatus(
@@ -15429,7 +15637,7 @@ var PlaceOrder = ({
15429
15637
  tradingLabels
15430
15638
  ]);
15431
15639
  const estDurationMs = executionQuoteData && typeof executionQuoteData.estDurationMs === "number" ? executionQuoteData.estDurationMs : 6e4;
15432
- (0, import_react26.useEffect)(() => {
15640
+ (0, import_react27.useEffect)(() => {
15433
15641
  const phase = submissionProgressState == null ? void 0 : submissionProgressState.phase;
15434
15642
  if (phase !== "submitting" && phase !== "executing") return;
15435
15643
  const timeoutMs = Math.max(6e4, 2 * estDurationMs);
@@ -15444,7 +15652,7 @@ var PlaceOrder = ({
15444
15652
  }, timeoutMs);
15445
15653
  return () => clearTimeout(id);
15446
15654
  }, [submissionProgressState == null ? void 0 : submissionProgressState.phase, estDurationMs, tradingLabels.orderStillSettling]);
15447
- const emitTerminalOrderNotifications = (0, import_react26.useCallback)(() => {
15655
+ const emitTerminalOrderNotifications = (0, import_react27.useCallback)(() => {
15448
15656
  const toast = toastCtx == null ? void 0 : toastCtx.toast;
15449
15657
  if (!toast) return;
15450
15658
  for (const event of executionProgress.terminalOrderEvents) {
@@ -15473,7 +15681,7 @@ var PlaceOrder = ({
15473
15681
  });
15474
15682
  }
15475
15683
  }, [executionProgress.terminalOrderEvents, labels, toastCtx]);
15476
- (0, import_react26.useEffect)(() => {
15684
+ (0, import_react27.useEffect)(() => {
15477
15685
  var _a2, _b2;
15478
15686
  if (!submissionProgressState) return;
15479
15687
  onExecutionStateChange == null ? void 0 : onExecutionStateChange(submissionProgressState);
@@ -15493,8 +15701,8 @@ var PlaceOrder = ({
15493
15701
  }
15494
15702
  if (submissionProgressState.phase === "success" && submissionProgressState.summary) {
15495
15703
  emitTerminalOrderNotifications();
15496
- (0, import_hooks51.invalidateBalanceQueries)(queryClient);
15497
- (0, import_hooks51.invalidatePositionQueries)(queryClient);
15704
+ (0, import_hooks52.invalidateBalanceQueries)(queryClient);
15705
+ (0, import_hooks52.invalidatePositionQueries)(queryClient);
15498
15706
  if (debugStore && debugAttemptId) {
15499
15707
  debugStore.updateAttempt(debugAttemptId, {
15500
15708
  status: "succeeded",
@@ -15525,30 +15733,32 @@ var PlaceOrder = ({
15525
15733
  queryClient,
15526
15734
  submissionProgressState
15527
15735
  ]);
15528
- const activeQuoteData = isLimitOrder ? null : (_$ = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _$ : scopedSmartRouteData;
15736
+ const activeQuoteData = isLimitOrder ? null : (_ca = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _ca : scopedSmartRouteData;
15529
15737
  const visibleMarketRouteCards = displayedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? displayedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : displayedRouteCards;
15530
15738
  const hasEnteredAmount = internalAmount > 0;
15531
15739
  const isQuoteLoading = !isLimitOrder && hasEnteredAmount && (isSell && isQuoteInputEditing || smartRoute.isLoading || !isSell && smartRoute.isFetching || isSell && venueSellQuotes.isLoading);
15532
15740
  const routeLoadingMessage = isQuoteLoading ? smartRoute.loadingReason === "updating-route" ? tradingLabels.updatingRoute : smartRoute.loadingReason === "refreshing-quotes" ? tradingLabels.refreshingQuotes : tradingLabels.findingBestOdds : null;
15533
- const isKalshiOnlyRoute = isKalshiRoute && ((selectedRouteCard == null ? void 0 : selectedRouteCard.venue) === import_sdk22.Venue.kalshi || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue === import_sdk22.Venue.kalshi));
15534
- const isOnchainOnlyRoute = !isKalshiRoute && !isBetdexRoute && !isProphetxDirectRoute;
15535
- const kalshiRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue === import_sdk22.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
15536
- const betdexRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue === import_sdk22.Venue.betdex).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
15741
+ const isKalshiOnlyRoute = isKalshiRoute && ((selectedRouteCard == null ? void 0 : selectedRouteCard.venue) === import_sdk23.Venue.kalshi || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue === import_sdk23.Venue.kalshi));
15742
+ const isOnchainOnlyRoute = !isKalshiRoute && !isBetdexRoute && !isProphetxDirectRoute && !isNovigDirectRoute;
15743
+ const kalshiRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue === import_sdk23.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
15744
+ const betdexRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue === import_sdk23.Venue.betdex).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
15537
15745
  const onchainRequiredAmount = isSell ? 0 : selectedRouteFills.filter(
15538
- (fill) => fill.venue !== import_sdk22.Venue.kalshi && fill.venue !== import_sdk22.Venue.betdex && !(fill.venue === import_sdk22.Venue.prophetx && (isProphetxDirect || fill.executionBackend === "direct"))
15746
+ (fill) => fill.venue !== import_sdk23.Venue.kalshi && fill.venue !== import_sdk23.Venue.betdex && !(fill.venue === import_sdk23.Venue.prophetx && (isProphetxDirect || fill.executionBackend === "direct") || fill.venue === import_sdk23.Venue.novig && (isNovigDirect || fill.executionBackend === "direct"))
15539
15747
  ).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
15540
15748
  const resolvedKalshiRequiredAmount = isKalshiOnlyRoute || isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : kalshiRequiredAmount;
15541
15749
  const resolvedBetdexRequiredAmount = isBetdexOnlyRoute ? internalAmount : betdexRequiredAmount;
15542
15750
  const resolvedOnchainRequiredAmount = isOnchainOnlyRoute ? internalAmount : onchainRequiredAmount;
15543
- const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_aa = liveBalanceState.kalshiBalance) != null ? _aa : 0);
15751
+ const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_da = liveBalanceState.kalshiBalance) != null ? _da : 0);
15544
15752
  const isBetdexBalanceInsufficient = !isPaperMode && isBetdexRoute && betdexAvailableBalance !== null && resolvedBetdexRequiredAmount > betdexAvailableBalance;
15545
15753
  const isBetdexBalanceUnavailable = !isPaperMode && !isSell && isAuthenticated && isBetdexRoute && betdexAvailableBalance === null;
15546
15754
  const canExecuteBetdexQuote = !isPaperMode && !isSell && !isLimitOrder && isAuthenticated && isBetdexRoute && !(selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) && selectedRouteFills.length > 0 && (selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.status) === "ok" && !!selectedRouteCard.quoteData.quoteId;
15547
15755
  const needsBetdexAccount = !canExecuteBetdexQuote && !isSell && isAuthenticated && !betdexAccount.isLoading && (isBetdexBalanceUnavailable || hasEnteredAmount && isBetdexBalanceInsufficient);
15548
15756
  const isOnchainBalanceInsufficient = resolvedOnchainRequiredAmount > liveAvailableBalance;
15549
- const prophetxRequiredAmount = !isProphetxDirectRoute || isSell ? 0 : selectedRouteFills.length ? selectedRouteFills.filter((fill) => fill.venue === import_sdk22.Venue.prophetx).reduce((sum, fill) => sum + fill.venueQty * fill.avgPrice, 0) : internalAmount;
15757
+ const prophetxRequiredAmount = !isProphetxDirectRoute || isSell ? 0 : selectedRouteFills.length ? selectedRouteFills.filter((fill) => fill.venue === import_sdk23.Venue.prophetx).reduce((sum, fill) => sum + fill.venueQty * fill.avgPrice, 0) : internalAmount;
15550
15758
  const isProphetxBalanceInsufficient = !isPaperMode && !isBalanceLoading && prophetxRequiredAmount > prophetxBalance;
15551
- const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > (isProphetxDirectRoute ? prophetxBalance : totalBalance) : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isProphetxBalanceInsufficient || isBetdexBalanceInsufficient && !canExecuteBetdexQuote || isOnchainBalanceInsufficient);
15759
+ const novigRequiredAmount = !isNovigDirectRoute || isSell ? 0 : selectedRouteFills.length ? selectedRouteFills.filter((fill) => fill.venue === import_sdk23.Venue.novig).reduce((sum, fill) => sum + fill.venueQty * fill.avgPrice, 0) : internalAmount;
15760
+ const isNovigBalanceInsufficient = !isPaperMode && !isBalanceLoading && novigRequiredAmount > novigBalance;
15761
+ const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > (isProphetxDirectRoute ? prophetxBalance : totalBalance) : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isProphetxBalanceInsufficient || isNovigBalanceInsufficient || isBetdexBalanceInsufficient && !canExecuteBetdexQuote || isOnchainBalanceInsufficient);
15552
15762
  const isQuoteInsufficientBalance = !isLimitOrder && (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
15553
15763
  const shouldShowInsufficientBalanceAlert = isInsufficientBalance || isQuoteInsufficientBalance && !canExecuteBetdexQuote;
15554
15764
  const insufficientBalanceDetails = isQuoteInsufficientBalance && (activeQuoteData == null ? void 0 : activeQuoteData.error) && activeQuoteData.error !== tradingLabels.insufficientBalance ? activeQuoteData.error : null;
@@ -15557,7 +15767,7 @@ var PlaceOrder = ({
15557
15767
  const isBelowVenueMinimumFromQuote = isQuoteBelowVenueMinimum(activeQuoteData);
15558
15768
  const isBelowMinimum = isBelowClientMinimum || isBelowVenueMinimumFromQuote;
15559
15769
  const belowMinimumMessage = isBelowClientMinimum ? tradingLabels.minimumOrderAmount(MIN_BUY_ORDER_AMOUNT) : tradingLabels.minOrderSizeViolated;
15560
- const quoteStatus = (0, import_react26.useMemo)(() => {
15770
+ const quoteStatus = (0, import_react27.useMemo)(() => {
15561
15771
  if (!orderEligibility.canPlaceOrder) return void 0;
15562
15772
  return resolvePlaceOrderQuoteStatus({
15563
15773
  amount: internalAmount,
@@ -15574,7 +15784,7 @@ var PlaceOrder = ({
15574
15784
  scopedSelectedMarket,
15575
15785
  tradingLabels
15576
15786
  ]);
15577
- const smartRouteErrorMessage = (0, import_react26.useMemo)(() => {
15787
+ const smartRouteErrorMessage = (0, import_react27.useMemo)(() => {
15578
15788
  var _a2;
15579
15789
  const quoteError = (_a2 = smartRoute.error) != null ? _a2 : isSell ? venueSellQuotes.error : null;
15580
15790
  if (!quoteError || orderedRouteCards.length > 0) return null;
@@ -15585,26 +15795,26 @@ var PlaceOrder = ({
15585
15795
  });
15586
15796
  }, [isSell, orderedRouteCards.length, smartRoute.error, tradingLabels, venueSellQuotes.error]);
15587
15797
  const progressActionLabel = (internalTab === "buy" ? tradingLabels.buyingOutcome(selectedOutcomeLabel) : tradingLabels.sellingOutcome(selectedOutcomeLabel)).trim();
15588
- const retryRemainingAmount = (0, import_react26.useMemo)(() => {
15798
+ const retryRemainingAmount = (0, import_react27.useMemo)(() => {
15589
15799
  return getCanonicalPlaceOrderUnfilledRemaining({
15590
15800
  originalAmount: internalAmount,
15591
15801
  tradeSide: internalTab,
15592
15802
  terminalOrderEvents: executionProgress.terminalOrderEvents
15593
15803
  });
15594
15804
  }, [executionProgress.terminalOrderEvents, internalAmount, internalTab]);
15595
- const canRetryRemaining = (0, import_react26.useMemo)(() => {
15805
+ const canRetryRemaining = (0, import_react27.useMemo)(() => {
15596
15806
  if (retryRemainingAmount == null) return false;
15597
15807
  const minRemainder = isSell ? MIN_SELL_ORDER_SHARES : MIN_BUY_ORDER_AMOUNT;
15598
15808
  return retryRemainingAmount >= minRemainder;
15599
15809
  }, [isSell, retryRemainingAmount]);
15600
15810
  const PARTIAL_FILL_AUTO_SUCCESS_THRESHOLD = 0.95;
15601
- const shouldAutoSkipPartialFill = (0, import_react26.useMemo)(() => {
15811
+ const shouldAutoSkipPartialFill = (0, import_react27.useMemo)(() => {
15602
15812
  if (internalAmount <= 0 || retryRemainingAmount == null) return false;
15603
15813
  const filled = Math.max(0, internalAmount - retryRemainingAmount);
15604
15814
  const fillRatio = filled / internalAmount;
15605
15815
  return fillRatio >= PARTIAL_FILL_AUTO_SUCCESS_THRESHOLD || !canRetryRemaining;
15606
15816
  }, [canRetryRemaining, internalAmount, retryRemainingAmount]);
15607
- const failureSummary = (0, import_react26.useMemo)(() => {
15817
+ const failureSummary = (0, import_react27.useMemo)(() => {
15608
15818
  var _a2;
15609
15819
  if ((submissionProgressState == null ? void 0 : submissionProgressState.phase) !== "failed") return void 0;
15610
15820
  const quoteData = (_a2 = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _a2 : activeQuoteData;
@@ -15677,21 +15887,21 @@ var PlaceOrder = ({
15677
15887
  submissionProgressState,
15678
15888
  tradingLabels
15679
15889
  ]);
15680
- const displayedToWinHint = (0, import_react26.useMemo)(() => {
15890
+ const displayedToWinHint = (0, import_react27.useMemo)(() => {
15681
15891
  if (!selectedRouteCard) return "";
15682
15892
  const averagePrice = selectedRouteCard.executionPrice;
15683
15893
  return averagePrice == null ? "" : tradingLabels.averagePrice(averagePrice);
15684
15894
  }, [selectedRouteCard, tradingLabels]);
15685
- const displayedToWinValue = (_ba = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _ba : 0;
15686
- const originalLimitPriceRaw = (0, import_react26.useMemo)(() => toLimitPriceRaw(limitPrice), [limitPrice]);
15687
- const limitPriceAdjustmentByVenue = (0, import_react26.useMemo)(() => {
15895
+ const displayedToWinValue = (_ea = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _ea : 0;
15896
+ const originalLimitPriceRaw = (0, import_react27.useMemo)(() => toLimitPriceRaw(limitPrice), [limitPrice]);
15897
+ const limitPriceAdjustmentByVenue = (0, import_react27.useMemo)(() => {
15688
15898
  var _a2;
15689
15899
  const adjustments = /* @__PURE__ */ new Map();
15690
15900
  for (const option of visibleLimitVenueOptions) {
15691
15901
  try {
15692
15902
  adjustments.set(
15693
15903
  option.venue,
15694
- (0, import_sdk22.adjustLimitPriceRawToTick)({
15904
+ (0, import_sdk23.adjustLimitPriceRawToTick)({
15695
15905
  limitPriceRaw: originalLimitPriceRaw,
15696
15906
  side: internalTab,
15697
15907
  tickSize: (_a2 = limitVenueQuoteByVenue.get(option.venue)) == null ? void 0 : _a2.tickSize
@@ -15700,7 +15910,7 @@ var PlaceOrder = ({
15700
15910
  } catch (e) {
15701
15911
  adjustments.set(
15702
15912
  option.venue,
15703
- (0, import_sdk22.adjustLimitPriceRawToTick)({
15913
+ (0, import_sdk23.adjustLimitPriceRawToTick)({
15704
15914
  limitPriceRaw: originalLimitPriceRaw,
15705
15915
  side: internalTab,
15706
15916
  tickSize: null
@@ -15711,14 +15921,14 @@ var PlaceOrder = ({
15711
15921
  return adjustments;
15712
15922
  }, [internalTab, limitVenueQuoteByVenue, originalLimitPriceRaw, visibleLimitVenueOptions]);
15713
15923
  const selectedLimitPriceAdjustment = selectedLimitVenueOption ? limitPriceAdjustmentByVenue.get(selectedLimitVenueOption.venue) : void 0;
15714
- const selectedLimitPriceRaw = (_ca = selectedLimitPriceAdjustment == null ? void 0 : selectedLimitPriceAdjustment.adjustedPriceRaw) != null ? _ca : originalLimitPriceRaw;
15715
- const limitPriceAdjustmentMessage = (0, import_react26.useMemo)(() => {
15924
+ const selectedLimitPriceRaw = (_fa = selectedLimitPriceAdjustment == null ? void 0 : selectedLimitPriceAdjustment.adjustedPriceRaw) != null ? _fa : originalLimitPriceRaw;
15925
+ const limitPriceAdjustmentMessage = (0, import_react27.useMemo)(() => {
15716
15926
  if (!selectedLimitVenueOption || !(selectedLimitPriceAdjustment == null ? void 0 : selectedLimitPriceAdjustment.adjusted) || !selectedLimitPriceAdjustment.tickSizeRaw) {
15717
15927
  return "";
15718
15928
  }
15719
15929
  return tradingLabels.limitPriceAdjusted(
15720
15930
  [getTradingVenueLabel(selectedLimitVenueOption.venue)],
15721
- Number(BigInt(selectedLimitPriceAdjustment.tickSizeRaw)) / Number(import_sdk22.LIMIT_PRICE_RAW_SCALE) * 100,
15931
+ Number(BigInt(selectedLimitPriceAdjustment.tickSizeRaw)) / Number(import_sdk23.LIMIT_PRICE_RAW_SCALE) * 100,
15722
15932
  formatLimitPriceRawLabel(originalLimitPriceRaw),
15723
15933
  internalTab,
15724
15934
  formatLimitPriceRawLabel(selectedLimitPriceAdjustment.adjustedPriceRaw)
@@ -15730,11 +15940,11 @@ var PlaceOrder = ({
15730
15940
  selectedLimitVenueOption,
15731
15941
  tradingLabels
15732
15942
  ]);
15733
- const limitOrderPayload = (0, import_react26.useMemo)(() => {
15943
+ const limitOrderPayload = (0, import_react27.useMemo)(() => {
15734
15944
  if (!selectedLimitVenueOption || internalAmount <= 0) return null;
15735
15945
  if (limitPriceInputError) return null;
15736
15946
  const effectivePriceRaw = BigInt(selectedLimitPriceRaw);
15737
- if (effectivePriceRaw <= BigInt(0) || effectivePriceRaw >= import_sdk22.LIMIT_PRICE_RAW_SCALE) return null;
15947
+ if (effectivePriceRaw <= BigInt(0) || effectivePriceRaw >= import_sdk23.LIMIT_PRICE_RAW_SCALE) return null;
15738
15948
  const expirationDate = resolveLimitExpirationDate({
15739
15949
  expirationType: limitExpirationType,
15740
15950
  customDate: limitExpirationDate,
@@ -15754,8 +15964,8 @@ var PlaceOrder = ({
15754
15964
  side: internalTab,
15755
15965
  limitPriceRaw,
15756
15966
  sizeRaw,
15757
- timeInForce: selectedLimitVenueOption.venue === import_sdk22.Venue.prophetx || limitExpirationType === "GTC" ? "GTC" : "GTD"
15758
- }, expiresAt && selectedLimitVenueOption.venue !== import_sdk22.Venue.prophetx ? { expiresAt } : {});
15967
+ timeInForce: selectedLimitVenueOption.venue === import_sdk23.Venue.prophetx || selectedLimitVenueOption.venue === import_sdk23.Venue.novig || limitExpirationType === "GTC" ? "GTC" : "GTD"
15968
+ }, expiresAt && selectedLimitVenueOption.venue !== import_sdk23.Venue.prophetx && selectedLimitVenueOption.venue !== import_sdk23.Venue.novig ? { expiresAt } : {});
15759
15969
  }, [
15760
15970
  internalAmount,
15761
15971
  internalTab,
@@ -15766,7 +15976,7 @@ var PlaceOrder = ({
15766
15976
  selectedLimitVenueOption,
15767
15977
  selectedLimitPriceRaw
15768
15978
  ]);
15769
- const resolvedLimitExpirationDraftDate = (0, import_react26.useMemo)(() => {
15979
+ const resolvedLimitExpirationDraftDate = (0, import_react27.useMemo)(() => {
15770
15980
  return resolveLimitExpirationDate({
15771
15981
  expirationType: "CUSTOM",
15772
15982
  customDate: limitExpirationDraftDate,
@@ -15774,7 +15984,7 @@ var PlaceOrder = ({
15774
15984
  });
15775
15985
  }, [limitExpirationDraftDate, limitExpirationDraftTime]);
15776
15986
  const isLimitExpirationDraftValid = isFutureLimitExpiration(resolvedLimitExpirationDraftDate);
15777
- const resolvedCustomExpirationDate = (0, import_react26.useMemo)(() => {
15987
+ const resolvedCustomExpirationDate = (0, import_react27.useMemo)(() => {
15778
15988
  return resolveLimitExpirationDate({
15779
15989
  expirationType: "CUSTOM",
15780
15990
  customDate: limitExpirationDate,
@@ -15796,18 +16006,18 @@ var PlaceOrder = ({
15796
16006
  expiresAt: serializeLimitOrderExpiration(expirationDate)
15797
16007
  });
15798
16008
  };
15799
- const displayedLimitToWinValue = (0, import_react26.useMemo)(() => {
16009
+ const displayedLimitToWinValue = (0, import_react27.useMemo)(() => {
15800
16010
  if (!limitOrderPayload) return 0;
15801
- const size = Number(BigInt(limitOrderPayload.sizeRaw)) / Number(import_sdk22.LIMIT_PRICE_RAW_SCALE);
16011
+ const size = Number(BigInt(limitOrderPayload.sizeRaw)) / Number(import_sdk23.LIMIT_PRICE_RAW_SCALE);
15802
16012
  if (internalTab === "buy") return size;
15803
16013
  return Number(
15804
16014
  ceilDiv(
15805
16015
  BigInt(limitOrderPayload.limitPriceRaw) * BigInt(limitOrderPayload.sizeRaw),
15806
- import_sdk22.LIMIT_PRICE_RAW_SCALE
16016
+ import_sdk23.LIMIT_PRICE_RAW_SCALE
15807
16017
  )
15808
- ) / Number(import_sdk22.LIMIT_PRICE_RAW_SCALE);
16018
+ ) / Number(import_sdk23.LIMIT_PRICE_RAW_SCALE);
15809
16019
  }, [internalTab, limitOrderPayload]);
15810
- const limitRouteCards = (0, import_react26.useMemo)(() => {
16020
+ const limitRouteCards = (0, import_react27.useMemo)(() => {
15811
16021
  return visibleLimitVenueOptions.map((option) => {
15812
16022
  var _a2, _b2, _c2, _d2;
15813
16023
  const effectiveLimitPriceRaw = (_b2 = (_a2 = limitPriceAdjustmentByVenue.get(option.venue)) == null ? void 0 : _a2.adjustedPriceRaw) != null ? _b2 : originalLimitPriceRaw;
@@ -15816,7 +16026,7 @@ var PlaceOrder = ({
15816
16026
  limitPriceRaw: effectiveLimitPriceRaw,
15817
16027
  side: internalTab
15818
16028
  });
15819
- const availabilityState = (0, import_hooks51.getVenueAvailabilityState)({
16029
+ const availabilityState = (0, import_hooks52.getVenueAvailabilityState)({
15820
16030
  venueId: option.venue,
15821
16031
  disabledVenues,
15822
16032
  isConfigLoading: isAppConfigLoading
@@ -15857,7 +16067,7 @@ var PlaceOrder = ({
15857
16067
  tradingLabels,
15858
16068
  visibleLimitVenueOptions
15859
16069
  ]);
15860
- const limitVenueOptionByCardId = (0, import_react26.useMemo)(() => {
16070
+ const limitVenueOptionByCardId = (0, import_react27.useMemo)(() => {
15861
16071
  return new Map(
15862
16072
  visibleLimitVenueOptions.map((option) => [
15863
16073
  `limit-venue-${option.venue}-${option.venueMarketOutcomeId}`,
@@ -15880,13 +16090,13 @@ var PlaceOrder = ({
15880
16090
  const activeFeeBreakdown = activeQuoteData == null ? void 0 : activeQuoteData.feeBreakdown;
15881
16091
  const executionReserve = activeFeeBreakdown == null ? void 0 : activeFeeBreakdown.executionReserve;
15882
16092
  const executionReserveValue = typeof executionReserve === "number" && Number.isFinite(executionReserve) && executionReserve > 0 ? formatUsd(executionReserve, { minimumFractionDigits: 2, maximumFractionDigits: 2 }) : null;
15883
- const estimatedFeesValue = (0, import_react26.useMemo)(() => {
16093
+ const estimatedFeesValue = (0, import_react27.useMemo)(() => {
15884
16094
  const totalFees = getSmartRouteTotalFees(activeFeeBreakdown);
15885
16095
  if (totalFees == null) return null;
15886
16096
  return formatUsd(totalFees, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
15887
16097
  }, [activeFeeBreakdown]);
15888
- const appFeeValue = (_da = activeFeeBreakdown == null ? void 0 : activeFeeBreakdown.appFee) != null ? _da : 0;
15889
- const feeBreakdownRows = (0, import_react26.useMemo)(() => {
16098
+ const appFeeValue = (_ga = activeFeeBreakdown == null ? void 0 : activeFeeBreakdown.appFee) != null ? _ga : 0;
16099
+ const feeBreakdownRows = (0, import_react27.useMemo)(() => {
15890
16100
  var _a2;
15891
16101
  if (!activeFeeBreakdown) return [];
15892
16102
  return [
@@ -15935,16 +16145,16 @@ var PlaceOrder = ({
15935
16145
  }, [activeFeeBreakdown, appFeeValue, tradingLabels]);
15936
16146
  const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
15937
16147
  const selectedLimitRouteCardId = selectedLimitVenueOption ? `limit-venue-${selectedLimitVenueOption.venue}-${selectedLimitVenueOption.venueMarketOutcomeId}` : null;
15938
- const selectedLimitRouteCard = selectedLimitRouteCardId ? (_ea = limitRouteCards.find((card) => card.id === selectedLimitRouteCardId)) != null ? _ea : null : null;
15939
- const selectedRouteGeoBlocked = isLimitOrder ? (_fa = selectedLimitRouteCard == null ? void 0 : selectedLimitRouteCard.isUnavailable) != null ? _fa : false : (_ga = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _ga : false;
15940
- const geoBlockedVenuesFromWarnings = (0, import_react26.useMemo)(
16148
+ const selectedLimitRouteCard = selectedLimitRouteCardId ? (_ha = limitRouteCards.find((card) => card.id === selectedLimitRouteCardId)) != null ? _ha : null : null;
16149
+ const selectedRouteGeoBlocked = isLimitOrder ? (_ia = selectedLimitRouteCard == null ? void 0 : selectedLimitRouteCard.isUnavailable) != null ? _ia : false : (_ja = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _ja : false;
16150
+ const geoBlockedVenuesFromWarnings = (0, import_react27.useMemo)(
15941
16151
  () => {
15942
16152
  var _a2;
15943
16153
  return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
15944
16154
  },
15945
- [(_ha = smartRoute.data) == null ? void 0 : _ha.warnings]
16155
+ [(_ka = smartRoute.data) == null ? void 0 : _ka.warnings]
15946
16156
  );
15947
- const isPrimaryVenueGeoBlocked = (0, import_react26.useMemo)(() => {
16157
+ const isPrimaryVenueGeoBlocked = (0, import_react27.useMemo)(() => {
15948
16158
  var _a2, _b2;
15949
16159
  if (!selectedRouteCard || selectedRouteCard.isUnavailable) return false;
15950
16160
  const fills = (_b2 = (_a2 = selectedRouteCard.quoteData) == null ? void 0 : _a2.fills) != null ? _b2 : [];
@@ -15955,7 +16165,7 @@ var PlaceOrder = ({
15955
16165
  const isActionDisabled = isPrimaryActionDisabled || !orderEligibility.canPlaceOrder || isActionLoading || !hasEnteredAmount || !scopedSelectedMarket || isInsufficientBalance || isBetdexBalanceUnavailable && !canExecuteBetdexQuote || isQuoteInsufficientBalance && !canExecuteBetdexQuote || isSell && isQuoteInputEditing || isSellAmountAboveAvailability || isBelowMinimum || !isLimitOrder && isQuoteLoading || isSelectedVenueInventoryInsufficient || (isLimitOrder ? !limitOrderPayload : !selectedRouteCard || !selectedRouteCard.quoteData.quoteId && !canExecuteBetdexQuote) || selectedRouteGeoBlocked || !isAuthenticated || !isLimitOrder && quoteStatus !== void 0 && !canExecuteBetdexQuote;
15956
16166
  const shouldShowSmartRouting = orderEligibility.canPlaceOrder && hasEnteredAmount && !isBelowMinimum && (isLimitOrder ? limitRouteCards.length > 0 : displayedRouteCards.length > 0 || smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
15957
16167
  const shouldShowRouteToggle = !isLimitOrder && !isQuoteLoading && displayedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT;
15958
- const handleReturnToOrderForm = (0, import_react26.useCallback)(() => {
16168
+ const handleReturnToOrderForm = (0, import_react27.useCallback)(() => {
15959
16169
  const submittedSelection = submittedSelectionRef.current;
15960
16170
  submittedSelectionRef.current = null;
15961
16171
  setSubmissionProgressState(null);
@@ -15977,7 +16187,7 @@ var PlaceOrder = ({
15977
16187
  const shareUrl = `https://twitter.com/intent/tweet?text=${encodeURIComponent(shareText)}`;
15978
16188
  window.open(shareUrl, "_blank", "noopener,noreferrer");
15979
16189
  };
15980
- const handleExecuteQuote = (0, import_react26.useCallback)(
16190
+ const handleExecuteQuote = (0, import_react27.useCallback)(
15981
16191
  (quoteData) => __async(null, null, function* () {
15982
16192
  var _a2, _b2, _c2;
15983
16193
  const quoteId = quoteData == null ? void 0 : quoteData.quoteId;
@@ -16094,7 +16304,7 @@ var PlaceOrder = ({
16094
16304
  venueSellQuotes.quotes
16095
16305
  ]
16096
16306
  );
16097
- const handlePlaceLimitOrder = (0, import_react26.useCallback)(
16307
+ const handlePlaceLimitOrder = (0, import_react27.useCallback)(
16098
16308
  (submissionLimitOrderPayload) => __async(null, null, function* () {
16099
16309
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
16100
16310
  if (!showLimitOrders) return;
@@ -16113,7 +16323,7 @@ var PlaceOrder = ({
16113
16323
  payload: submissionLimitOrderPayload
16114
16324
  });
16115
16325
  }
16116
- const size = Number(BigInt(submissionLimitOrderPayload.sizeRaw)) / Number(import_sdk22.LIMIT_PRICE_RAW_SCALE);
16326
+ const size = Number(BigInt(submissionLimitOrderPayload.sizeRaw)) / Number(import_sdk23.LIMIT_PRICE_RAW_SCALE);
16117
16327
  const sizeLabel = size.toLocaleString("en-US", {
16118
16328
  minimumFractionDigits: 2,
16119
16329
  maximumFractionDigits: 2
@@ -16122,9 +16332,9 @@ var PlaceOrder = ({
16122
16332
  Number(
16123
16333
  ceilDiv(
16124
16334
  BigInt(submissionLimitOrderPayload.limitPriceRaw) * BigInt(submissionLimitOrderPayload.sizeRaw),
16125
- import_sdk22.LIMIT_PRICE_RAW_SCALE
16335
+ import_sdk23.LIMIT_PRICE_RAW_SCALE
16126
16336
  )
16127
- ) / Number(import_sdk22.LIMIT_PRICE_RAW_SCALE)
16337
+ ) / Number(import_sdk23.LIMIT_PRICE_RAW_SCALE)
16128
16338
  );
16129
16339
  const estimatedCost = internalTab === "buy" ? notionalLabel : sizeLabel;
16130
16340
  const orderAmountLabel = internalTab === "buy" ? notionalLabel : tradingLabels.executionShares(sizeLabel);
@@ -16141,7 +16351,7 @@ var PlaceOrder = ({
16141
16351
  const limitPriceLabel = formatLimitPriceRawLabel(response.limitPriceRaw);
16142
16352
  const eventTitle = (_b2 = (_a2 = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _a2 : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _b2 : "";
16143
16353
  const eventDateSource = (_c2 = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.endDate) != null ? _c2 : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.endDate;
16144
- const responseVenue = import_sdk22.Venue[response.venue];
16354
+ const responseVenue = import_sdk23.Venue[response.venue];
16145
16355
  setSubmissionProgressState({
16146
16356
  orderId: response.orderId,
16147
16357
  orderIds: [response.orderId],
@@ -16189,7 +16399,7 @@ var PlaceOrder = ({
16189
16399
  tradingLabels
16190
16400
  ]
16191
16401
  );
16192
- const handleSkipToSuccess = (0, import_react26.useCallback)(() => {
16402
+ const handleSkipToSuccess = (0, import_react27.useCallback)(() => {
16193
16403
  const primaryFilledEvent = executionProgress.terminalOrderEvents.find(
16194
16404
  (e) => e.event === "filled" || e.event === "partial_fill"
16195
16405
  );
@@ -16214,7 +16424,7 @@ var PlaceOrder = ({
16214
16424
  failureSummary,
16215
16425
  selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData
16216
16426
  ]);
16217
- (0, import_react26.useEffect)(() => {
16427
+ (0, import_react27.useEffect)(() => {
16218
16428
  if ((submissionProgressState == null ? void 0 : submissionProgressState.phase) !== "failed") return;
16219
16429
  if ((failureSummary == null ? void 0 : failureSummary.kind) !== "partial_fill") return;
16220
16430
  if (!shouldAutoSkipPartialFill) return;
@@ -16225,7 +16435,7 @@ var PlaceOrder = ({
16225
16435
  shouldAutoSkipPartialFill,
16226
16436
  submissionProgressState == null ? void 0 : submissionProgressState.phase
16227
16437
  ]);
16228
- const handleRetrySubmission = (0, import_react26.useCallback)(() => __async(null, null, function* () {
16438
+ const handleRetrySubmission = (0, import_react27.useCallback)(() => __async(null, null, function* () {
16229
16439
  var _a2, _b2, _c2, _d2, _e2;
16230
16440
  if (!orderEligibility.canPlaceOrder || !failureSummary || failureSummary.kind === "generic") {
16231
16441
  handleReturnToOrderForm();
@@ -16375,7 +16585,7 @@ var PlaceOrder = ({
16375
16585
  ]);
16376
16586
  const resolvedStatusClassName = cn(classNames == null ? void 0 : classNames.root, className);
16377
16587
  if (isLoading) {
16378
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
16588
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16379
16589
  Skeleton,
16380
16590
  {
16381
16591
  ariaLabel: labels.common.loading,
@@ -16386,7 +16596,7 @@ var PlaceOrder = ({
16386
16596
  }
16387
16597
  if (submissionProgressState) {
16388
16598
  if (submissionProgressState.phase === "success" && submissionProgressState.summary) {
16389
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
16599
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16390
16600
  PlaceOrderSuccessView,
16391
16601
  {
16392
16602
  className: resolvedStatusClassName,
@@ -16398,7 +16608,7 @@ var PlaceOrder = ({
16398
16608
  );
16399
16609
  }
16400
16610
  if (submissionProgressState.phase === "failed") {
16401
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
16611
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16402
16612
  PlaceOrderFailureView,
16403
16613
  {
16404
16614
  className: resolvedStatusClassName,
@@ -16411,7 +16621,7 @@ var PlaceOrder = ({
16411
16621
  }
16412
16622
  );
16413
16623
  }
16414
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
16624
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16415
16625
  PlaceOrderExecutionView,
16416
16626
  {
16417
16627
  className,
@@ -16639,11 +16849,11 @@ var PlaceOrder = ({
16639
16849
  }
16640
16850
  });
16641
16851
  if (isEndedWithoutKnownWinner || !orderEligibility.canPlaceOrder && resolvedReadOnlyTradingState.kind !== "open") {
16642
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
16852
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16643
16853
  PlaceOrderResolvedView,
16644
16854
  {
16645
16855
  tradingState: resolvedReadOnlyTradingState,
16646
- resolutionTimestamp: (_ia = resolvedEventTradingState.resolvesAt) != null ? _ia : resolvedReadOnlyTradingState.resolvesAt,
16856
+ resolutionTimestamp: (_la = resolvedEventTradingState.resolvesAt) != null ? _la : resolvedReadOnlyTradingState.resolvesAt,
16647
16857
  resolvedClaim,
16648
16858
  classNames,
16649
16859
  className,
@@ -16652,8 +16862,8 @@ var PlaceOrder = ({
16652
16862
  }
16653
16863
  );
16654
16864
  }
16655
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_react26.Fragment, { children: [
16656
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
16865
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_react27.Fragment, { children: [
16866
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
16657
16867
  Card,
16658
16868
  {
16659
16869
  className: cn(
@@ -16668,23 +16878,23 @@ var PlaceOrder = ({
16668
16878
  headerSubtitle,
16669
16879
  headerImage,
16670
16880
  headerTitle,
16671
- headerVenue: (_ja = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) != null ? _ja : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venue,
16881
+ headerVenue: (_ma = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) != null ? _ma : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venue,
16672
16882
  onClose
16673
16883
  }),
16674
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: cn("agg-order-panel-content flex flex-col gap-6", classNames == null ? void 0 : classNames.content), children: [
16675
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
16884
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: cn("agg-order-panel-content flex flex-col gap-6", classNames == null ? void 0 : classNames.content), children: [
16885
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
16676
16886
  "div",
16677
16887
  {
16678
16888
  className: "agg-order-tabs flex items-end border-b border-agg-separator",
16679
16889
  role: "tablist",
16680
16890
  "aria-label": labels.common.tabsAria,
16681
16891
  children: [
16682
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "flex min-w-0 flex-1 items-end", children: [
16892
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "flex min-w-0 flex-1 items-end", children: [
16683
16893
  { value: "buy", label: tradingLabels.buy, ref: buyTabRef },
16684
16894
  { value: "sell", label: tradingLabels.sell, ref: sellTabRef }
16685
16895
  ].map((tabItem) => {
16686
16896
  const isActive = internalTab === tabItem.value;
16687
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
16897
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
16688
16898
  "button",
16689
16899
  {
16690
16900
  ref: tabItem.ref,
@@ -16708,7 +16918,7 @@ var PlaceOrder = ({
16708
16918
  onKeyDown: (event) => handleTabKeyDown(event, tabItem.value),
16709
16919
  children: [
16710
16920
  tabItem.label,
16711
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
16921
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16712
16922
  "span",
16713
16923
  {
16714
16924
  "aria-hidden": "true",
@@ -16728,7 +16938,7 @@ var PlaceOrder = ({
16728
16938
  tabItem.value
16729
16939
  );
16730
16940
  }) }),
16731
- showLimitOrders ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
16941
+ showLimitOrders ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16732
16942
  Select,
16733
16943
  {
16734
16944
  ariaLabel: tradingLabels.orderTypeAria,
@@ -16749,8 +16959,8 @@ var PlaceOrder = ({
16749
16959
  ]
16750
16960
  }
16751
16961
  ),
16752
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-entry-section flex flex-col gap-4", children: [
16753
- outcomes.length >= 2 ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "agg-outcomes flex w-full max-w-full gap-2", children: outcomes.map((outcome, index) => {
16962
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-order-entry-section flex flex-col gap-4", children: [
16963
+ outcomes.length >= 2 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-outcomes flex w-full max-w-full gap-2", children: outcomes.map((outcome, index) => {
16754
16964
  var _a2, _b2, _c2;
16755
16965
  const price = getDisplayOutcomePrice({
16756
16966
  outcomeId: outcome.id,
@@ -16764,7 +16974,7 @@ var PlaceOrder = ({
16764
16974
  const isActive = outcome.id === scopedSelectedOutcomeId;
16765
16975
  const isPositive = resolveIsPositiveOutcome(outcome, index);
16766
16976
  const isPriceLoading = clusterMidpointResult.isLoading && price == null;
16767
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
16977
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
16768
16978
  "button",
16769
16979
  {
16770
16980
  "data-id": outcome.id,
@@ -16784,7 +16994,7 @@ var PlaceOrder = ({
16784
16994
  disabled: !orderEligibility.canPlaceOrder || isResolvedOutcomeCtaLocked,
16785
16995
  onClick: () => handleOutcomeChange(outcome.id),
16786
16996
  children: [
16787
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
16997
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16788
16998
  Typography,
16789
16999
  {
16790
17000
  as: "span",
@@ -16793,7 +17003,7 @@ var PlaceOrder = ({
16793
17003
  children: (_c2 = outcome.title) != null ? _c2 : outcome.label
16794
17004
  }
16795
17005
  ),
16796
- isPriceLoading ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17006
+ isPriceLoading ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16797
17007
  "span",
16798
17008
  {
16799
17009
  "aria-hidden": "true",
@@ -16802,18 +17012,18 @@ var PlaceOrder = ({
16802
17012
  "h-4 w-10 shrink-0 rounded-agg-sm bg-agg-separator animate-pulse"
16803
17013
  )
16804
17014
  }
16805
- ) : /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Typography, { as: "span", variant: isActive ? "body-strong" : "body", children: formatProbabilityCents(price, formatPrice) })
17015
+ ) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Typography, { as: "span", variant: isActive ? "body-strong" : "body", children: formatProbabilityCents(price, formatPrice) })
16806
17016
  ]
16807
17017
  },
16808
17018
  outcome.id
16809
17019
  );
16810
17020
  }) }) : null,
16811
- isLimitOrder ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-limit-price-section flex items-center justify-between gap-4", children: [
16812
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.limitPrice }),
16813
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex min-w-0 flex-col items-end gap-1", children: [
16814
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-center gap-2", children: [
16815
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("label", { className: "relative flex items-center", children: [
16816
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17021
+ isLimitOrder ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-limit-price-section flex items-center justify-between gap-4", children: [
17022
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.limitPrice }),
17023
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 flex-col items-end gap-1", children: [
17024
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-center gap-2", children: [
17025
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("label", { className: "relative flex items-center", children: [
17026
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16817
17027
  "input",
16818
17028
  {
16819
17029
  type: "text",
@@ -16830,40 +17040,40 @@ var PlaceOrder = ({
16830
17040
  )
16831
17041
  }
16832
17042
  ),
16833
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "pointer-events-none absolute right-1 text-agg-3xl font-agg-bold leading-agg-9 text-agg-foreground", children: "\xA2" })
17043
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "pointer-events-none absolute right-1 text-agg-3xl font-agg-bold leading-agg-9 text-agg-foreground", children: "\xA2" })
16834
17044
  ] }),
16835
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17045
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16836
17046
  "button",
16837
17047
  {
16838
17048
  type: "button",
16839
17049
  className: "flex size-8 cursor-pointer items-center justify-center rounded-agg-lg bg-agg-secondary-hover text-agg-foreground hover:bg-agg-tertiary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
16840
17050
  "aria-label": tradingLabels.limitPriceDecreaseAria,
16841
17051
  onClick: () => handleLimitPriceStep("decrease"),
16842
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Icon, { name: "minus", size: "small", className: "h-4 w-4", "aria-hidden": true })
17052
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Icon, { name: "minus", size: "small", className: "h-4 w-4", "aria-hidden": true })
16843
17053
  }
16844
17054
  ),
16845
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17055
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16846
17056
  "button",
16847
17057
  {
16848
17058
  type: "button",
16849
17059
  className: "flex size-8 cursor-pointer items-center justify-center rounded-agg-lg bg-agg-secondary-hover text-agg-foreground hover:bg-agg-tertiary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
16850
17060
  "aria-label": tradingLabels.limitPriceIncreaseAria,
16851
17061
  onClick: () => handleLimitPriceStep("increase"),
16852
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Icon, { name: "plus", size: "small", className: "h-4 w-4", "aria-hidden": true })
17062
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Icon, { name: "plus", size: "small", className: "h-4 w-4", "aria-hidden": true })
16853
17063
  }
16854
17064
  )
16855
17065
  ] }),
16856
- limitPriceInputError ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "max-w-[220px] text-right text-agg-xs leading-agg-4 text-agg-error", children: limitPriceInputError }) : null
17066
+ limitPriceInputError ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "max-w-[220px] text-right text-agg-xs leading-agg-4 text-agg-error", children: limitPriceInputError }) : null
16857
17067
  ] })
16858
17068
  ] }) : null,
16859
- isLimitOrder && limitPriceAdjustmentMessage ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
17069
+ isLimitOrder && limitPriceAdjustmentMessage ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
16860
17070
  "div",
16861
17071
  {
16862
17072
  className: "agg-limit-price-adjustment flex w-full items-center gap-2 rounded-agg-lg bg-agg-warning/10 px-3 py-2",
16863
17073
  role: "status",
16864
17074
  "aria-live": "polite",
16865
17075
  children: [
16866
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17076
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16867
17077
  Icon,
16868
17078
  {
16869
17079
  name: "warning-filled",
@@ -16872,16 +17082,16 @@ var PlaceOrder = ({
16872
17082
  "aria-hidden": "true"
16873
17083
  }
16874
17084
  ),
16875
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "min-w-0 flex-1 wrap-break-word text-agg-sm leading-agg-5 text-agg-foreground", children: limitPriceAdjustmentMessage })
17085
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "min-w-0 flex-1 wrap-break-word text-agg-sm leading-agg-5 text-agg-foreground", children: limitPriceAdjustmentMessage })
16876
17086
  ]
16877
17087
  }
16878
17088
  ) : null,
16879
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-amount-section flex items-start justify-between gap-4", children: [
16880
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-amount-meta flex flex-col", children: [
16881
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-order-amount-label text-agg-base font-agg-bold leading-agg-6 text-agg-foreground whitespace-nowrap", children: tradingLabels.amount(internalTab) }),
16882
- isAuthenticated ? isSell ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "agg-balance-value flex items-baseline gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isCurrentSellableSharesLoading ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(LoadingIcon, { size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
16883
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "whitespace-pre", children: displayedCurrentSellableSharesLabel }),
16884
- displayedCurrentSellableShares > 0 ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17089
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-order-amount-section flex items-start justify-between gap-4", children: [
17090
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-order-amount-meta flex flex-col", children: [
17091
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-order-amount-label text-agg-base font-agg-bold leading-agg-6 text-agg-foreground whitespace-nowrap", children: tradingLabels.amount(internalTab) }),
17092
+ isAuthenticated ? isSell ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-balance-value flex items-baseline gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isCurrentSellableSharesLoading ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(LoadingIcon, { size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
17093
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "whitespace-pre", children: displayedCurrentSellableSharesLabel }),
17094
+ displayedCurrentSellableShares > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16885
17095
  "button",
16886
17096
  {
16887
17097
  type: "button",
@@ -16897,12 +17107,12 @@ var PlaceOrder = ({
16897
17107
  children: tradingLabels.maxShares
16898
17108
  }
16899
17109
  ) : null
16900
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "agg-balance-value flex flex-col items-end gap-1 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isBalanceLoading ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(LoadingIcon, { size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
16901
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { children: !isPaperMode && isBetdexOnlyRoute && betdexAvailableBalance === null ? betdexBalanceLabel : tradingLabels.balance(formatUsd(displayedBalance)) }),
16902
- !isPaperMode && isBetdexRoute && !isBetdexOnlyRoute ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { children: betdexBalanceLabel }) : null
17110
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-balance-value flex flex-col items-end gap-1 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isBalanceLoading ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(LoadingIcon, { size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
17111
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { children: !isPaperMode && isBetdexOnlyRoute && betdexAvailableBalance === null ? betdexBalanceLabel : tradingLabels.balance(formatUsd(displayedBalance)) }),
17112
+ !isPaperMode && isBetdexRoute && !isBetdexOnlyRoute ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { children: betdexBalanceLabel }) : null
16903
17113
  ] }) }) : null
16904
17114
  ] }),
16905
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17115
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16906
17116
  CurrencyInput,
16907
17117
  {
16908
17118
  value: internalAmount,
@@ -16924,10 +17134,10 @@ var PlaceOrder = ({
16924
17134
  }
16925
17135
  )
16926
17136
  ] }),
16927
- showFeesBreakdown && hasEnteredAmount && !isBelowMinimum && estimatedFeesValue ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
16928
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-fees-section flex items-center justify-between gap-4", children: [
16929
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-center gap-1.5", children: [
16930
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17137
+ showFeesBreakdown && hasEnteredAmount && !isBelowMinimum && estimatedFeesValue ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
17138
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-order-fees-section flex items-center justify-between gap-4", children: [
17139
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-center gap-1.5", children: [
17140
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16931
17141
  Typography,
16932
17142
  {
16933
17143
  variant: "text-sm",
@@ -16935,7 +17145,7 @@ var PlaceOrder = ({
16935
17145
  children: tradingLabels.estimatedFees
16936
17146
  }
16937
17147
  ),
16938
- feeBreakdownRows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17148
+ feeBreakdownRows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16939
17149
  Tooltip,
16940
17150
  {
16941
17151
  "aria-label": tradingLabels.estimatedFeesTooltipAria,
@@ -16947,13 +17157,13 @@ var PlaceOrder = ({
16947
17157
  icon: "h-3 w-3 text-agg-muted-foreground",
16948
17158
  trigger: "h-3 w-3 text-agg-muted-foreground"
16949
17159
  },
16950
- content: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "flex w-full flex-col gap-2", children: feeBreakdownRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
17160
+ content: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "flex w-full flex-col gap-2", children: feeBreakdownRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
16951
17161
  "div",
16952
17162
  {
16953
17163
  className: "flex items-center justify-between gap-3 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground",
16954
17164
  children: [
16955
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { children: row.label }),
16956
- row.kind === "badge" ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17165
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { children: row.label }),
17166
+ row.kind === "badge" ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16957
17167
  "span",
16958
17168
  {
16959
17169
  className: cn(
@@ -16963,7 +17173,7 @@ var PlaceOrder = ({
16963
17173
  ),
16964
17174
  children: row.badgeLabel
16965
17175
  }
16966
- ) : /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "text-right", children: row.value })
17176
+ ) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "text-right", children: row.value })
16967
17177
  ]
16968
17178
  },
16969
17179
  row.label
@@ -16971,9 +17181,9 @@ var PlaceOrder = ({
16971
17181
  }
16972
17182
  ) : null
16973
17183
  ] }),
16974
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: estimatedFeesValue })
17184
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: estimatedFeesValue })
16975
17185
  ] }),
16976
- (activeQuoteData == null ? void 0 : activeQuoteData.fills.some((fill) => fill.venue === import_sdk22.Venue.betdex)) ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17186
+ (activeQuoteData == null ? void 0 : activeQuoteData.fills.some((fill) => fill.venue === import_sdk23.Venue.betdex)) ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16977
17187
  Typography,
16978
17188
  {
16979
17189
  variant: "text-sm",
@@ -16982,9 +17192,9 @@ var PlaceOrder = ({
16982
17192
  }
16983
17193
  ) : null
16984
17194
  ] }) : null,
16985
- showFeesBreakdown && hasEnteredAmount && !isBelowMinimum && executionReserveValue ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-reserve-section flex items-center justify-between gap-4", children: [
16986
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-center gap-1.5", children: [
16987
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17195
+ showFeesBreakdown && hasEnteredAmount && !isBelowMinimum && executionReserveValue ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-order-reserve-section flex items-center justify-between gap-4", children: [
17196
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-center gap-1.5", children: [
17197
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16988
17198
  Typography,
16989
17199
  {
16990
17200
  variant: "text-sm",
@@ -16992,7 +17202,7 @@ var PlaceOrder = ({
16992
17202
  children: tradingLabels.executionReserve
16993
17203
  }
16994
17204
  ),
16995
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17205
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16996
17206
  Tooltip,
16997
17207
  {
16998
17208
  "aria-label": tradingLabels.executionReserveTooltipAria,
@@ -17005,18 +17215,18 @@ var PlaceOrder = ({
17005
17215
  }
17006
17216
  )
17007
17217
  ] }),
17008
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: executionReserveValue })
17218
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: executionReserveValue })
17009
17219
  ] }) : null
17010
17220
  ] }),
17011
- shouldShowSmartRouting ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
17221
+ shouldShowSmartRouting ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
17012
17222
  "div",
17013
17223
  {
17014
17224
  className: "agg-route-panel flex flex-col gap-3",
17015
17225
  "aria-busy": !isLimitOrder && isQuoteLoading,
17016
17226
  children: [
17017
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-route-panel-header flex items-center justify-between gap-4", children: [
17018
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-route-panel-title text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.smartRouting }),
17019
- shouldShowRouteToggle && !isRoutesExpanded ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
17227
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-route-panel-header flex items-center justify-between gap-4", children: [
17228
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-route-panel-title text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.smartRouting }),
17229
+ shouldShowRouteToggle && !isRoutesExpanded ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
17020
17230
  "button",
17021
17231
  {
17022
17232
  type: "button",
@@ -17024,8 +17234,8 @@ var PlaceOrder = ({
17024
17234
  "aria-label": tradingLabels.viewAllRoutes(activeRouteCardCount),
17025
17235
  onClick: () => setIsRoutesExpanded((currentValue) => !currentValue),
17026
17236
  children: [
17027
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { children: tradingLabels.viewAllRoutes(activeRouteCardCount) }),
17028
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17237
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { children: tradingLabels.viewAllRoutes(activeRouteCardCount) }),
17238
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17029
17239
  Icon,
17030
17240
  {
17031
17241
  name: "chevron-down",
@@ -17038,11 +17248,11 @@ var PlaceOrder = ({
17038
17248
  }
17039
17249
  ) : null
17040
17250
  ] }),
17041
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "agg-route-list flex flex-col gap-2", children: !isLimitOrder && isQuoteLoading && activeRouteCards.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-route-loading flex flex-col gap-2", "aria-hidden": "true", children: [
17042
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(PlaceOrderRouteCardSkeleton, {}),
17043
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(PlaceOrderRouteCardSkeleton, {})
17251
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-route-list flex flex-col gap-2", children: !isLimitOrder && isQuoteLoading && activeRouteCards.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-route-loading flex flex-col gap-2", "aria-hidden": "true", children: [
17252
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(PlaceOrderRouteCardSkeleton, {}),
17253
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(PlaceOrderRouteCardSkeleton, {})
17044
17254
  ] }) : activeRouteCards.length > 0 ? activeRouteCards.map((card) => {
17045
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(import_react26.Fragment, { children: renderRouteCard({
17255
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(import_react27.Fragment, { children: renderRouteCard({
17046
17256
  card,
17047
17257
  enableAnimations,
17048
17258
  isExpanded: card.kind === "split" ? isSplitDetailOpen : isRoutesExpanded,
@@ -17056,15 +17266,15 @@ var PlaceOrder = ({
17056
17266
  ]
17057
17267
  }
17058
17268
  ) : null,
17059
- isLimitOrder && (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) !== import_sdk22.Venue.prophetx ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-limit-expiration-section flex items-center justify-between gap-4", children: [
17060
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.expiration }),
17061
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
17269
+ isLimitOrder && (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) !== import_sdk23.Venue.prophetx && (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) !== import_sdk23.Venue.novig ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-limit-expiration-section flex items-center justify-between gap-4", children: [
17270
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.expiration }),
17271
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
17062
17272
  Popover.Root,
17063
17273
  {
17064
17274
  open: isLimitExpirationPickerOpen,
17065
17275
  onOpenChange: handleLimitExpirationPickerOpenChange,
17066
17276
  children: [
17067
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
17277
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
17068
17278
  "button",
17069
17279
  {
17070
17280
  ref: expirationTriggerRef,
@@ -17072,10 +17282,10 @@ var PlaceOrder = ({
17072
17282
  className: "flex min-w-0 cursor-pointer items-center justify-end gap-2 text-right text-agg-base leading-agg-6 text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
17073
17283
  "aria-label": tradingLabels.expirationMenuAria,
17074
17284
  children: [
17075
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "min-w-0 truncate", children: limitExpirationType === "GTC" ? tradingLabels.expirationGoodTilCanceled : limitExpirationType === "FIVE_MINUTES" ? tradingLabels.expirationFiveMinutes : limitExpirationType === "ONE_HOUR" ? tradingLabels.expirationOneHour : limitExpirationType === "END_OF_DAY" ? tradingLabels.expirationEndOfDay : resolvedCustomExpirationDate ? (0, import_dayjs5.default)(resolvedCustomExpirationDate).format(
17285
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "min-w-0 truncate", children: limitExpirationType === "GTC" ? tradingLabels.expirationGoodTilCanceled : limitExpirationType === "FIVE_MINUTES" ? tradingLabels.expirationFiveMinutes : limitExpirationType === "ONE_HOUR" ? tradingLabels.expirationOneHour : limitExpirationType === "END_OF_DAY" ? tradingLabels.expirationEndOfDay : resolvedCustomExpirationDate ? (0, import_dayjs5.default)(resolvedCustomExpirationDate).format(
17076
17286
  "MMM D, YYYY [at] HH:mm"
17077
17287
  ) : tradingLabels.expirationCustom }),
17078
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17288
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17079
17289
  Icon,
17080
17290
  {
17081
17291
  name: isLimitExpirationPickerOpen ? "chevron-up" : "chevron-down",
@@ -17087,11 +17297,11 @@ var PlaceOrder = ({
17087
17297
  ]
17088
17298
  }
17089
17299
  ) }),
17090
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17300
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17091
17301
  Popover.Portal,
17092
17302
  {
17093
17303
  container: resolvePlaceOrderPortalContainer(expirationTriggerRef.current),
17094
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17304
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17095
17305
  Popover.Content,
17096
17306
  {
17097
17307
  align: "end",
@@ -17100,14 +17310,14 @@ var PlaceOrder = ({
17100
17310
  role: "dialog",
17101
17311
  "aria-label": tradingLabels.expirationMenuAria,
17102
17312
  className: "z-50 max-h-[calc(100dvh-2rem)] w-[min(312px,calc(100vw-2rem))] overflow-y-auto rounded-agg-xl border border-agg-separator bg-agg-secondary p-0 shadow-[0_8px_16px_rgba(0,0,0,0.20)]",
17103
- children: limitExpirationPickerView === "calendar" ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex flex-col gap-3 p-4", children: [
17104
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17313
+ children: limitExpirationPickerView === "calendar" ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex flex-col gap-3 p-4", children: [
17314
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17105
17315
  Button,
17106
17316
  {
17107
17317
  variant: "tertiary",
17108
17318
  size: "small",
17109
17319
  className: "w-fit px-0",
17110
- prefix: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17320
+ prefix: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17111
17321
  Icon,
17112
17322
  {
17113
17323
  name: "chevron-left",
@@ -17120,7 +17330,7 @@ var PlaceOrder = ({
17120
17330
  children: tradingLabels.expirationOptions
17121
17331
  }
17122
17332
  ),
17123
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17333
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17124
17334
  Calendar,
17125
17335
  {
17126
17336
  mode: "single",
@@ -17135,9 +17345,9 @@ var PlaceOrder = ({
17135
17345
  }
17136
17346
  }
17137
17347
  ),
17138
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-center gap-4", children: [
17139
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex shrink-0 flex-col gap-0.5", children: [
17140
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17348
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-center gap-4", children: [
17349
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex shrink-0 flex-col gap-0.5", children: [
17350
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17141
17351
  "label",
17142
17352
  {
17143
17353
  htmlFor: expirationTimeInputId,
@@ -17145,9 +17355,9 @@ var PlaceOrder = ({
17145
17355
  children: tradingLabels.expirationStartTime
17146
17356
  }
17147
17357
  ),
17148
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "text-agg-xs leading-agg-4 text-agg-foreground", children: tradingLabels.expirationStartTimeHint })
17358
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "text-agg-xs leading-agg-4 text-agg-foreground", children: tradingLabels.expirationStartTimeHint })
17149
17359
  ] }),
17150
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17360
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17151
17361
  "input",
17152
17362
  {
17153
17363
  id: expirationTimeInputId,
@@ -17158,8 +17368,8 @@ var PlaceOrder = ({
17158
17368
  }
17159
17369
  )
17160
17370
  ] }),
17161
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex gap-2", children: [
17162
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17371
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex gap-2", children: [
17372
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17163
17373
  Button,
17164
17374
  {
17165
17375
  variant: "secondary",
@@ -17169,13 +17379,13 @@ var PlaceOrder = ({
17169
17379
  children: tradingLabels.expirationCancel
17170
17380
  }
17171
17381
  ),
17172
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17382
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17173
17383
  Button,
17174
17384
  {
17175
17385
  size: "small",
17176
17386
  className: "min-w-0 flex-1",
17177
17387
  disabled: !isLimitExpirationDraftValid,
17178
- prefix: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17388
+ prefix: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17179
17389
  Icon,
17180
17390
  {
17181
17391
  name: "success-check",
@@ -17189,7 +17399,7 @@ var PlaceOrder = ({
17189
17399
  }
17190
17400
  )
17191
17401
  ] })
17192
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17402
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17193
17403
  "div",
17194
17404
  {
17195
17405
  role: "radiogroup",
@@ -17207,7 +17417,7 @@ var PlaceOrder = ({
17207
17417
  { value: "ONE_HOUR", label: tradingLabels.expirationOneHour },
17208
17418
  { value: "END_OF_DAY", label: tradingLabels.expirationEndOfDay },
17209
17419
  { value: "CUSTOM", label: tradingLabels.expirationCustom }
17210
- ].map((item, optionIndex) => /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
17420
+ ].map((item, optionIndex) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
17211
17421
  "button",
17212
17422
  {
17213
17423
  ref: (element) => {
@@ -17224,14 +17434,14 @@ var PlaceOrder = ({
17224
17434
  onClick: () => handleLimitExpirationTypeChange(item.value),
17225
17435
  onKeyDown: (event) => handleLimitExpirationOptionKeyDown(event, optionIndex),
17226
17436
  children: [
17227
- limitExpirationType === item.value ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17437
+ limitExpirationType === item.value ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17228
17438
  "span",
17229
17439
  {
17230
17440
  className: "absolute bottom-2 left-0 top-2 w-1 bg-agg-primary",
17231
17441
  "aria-hidden": true
17232
17442
  }
17233
17443
  ) : null,
17234
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "truncate", children: item.label })
17444
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "truncate", children: item.label })
17235
17445
  ]
17236
17446
  },
17237
17447
  item.value
@@ -17246,13 +17456,13 @@ var PlaceOrder = ({
17246
17456
  }
17247
17457
  )
17248
17458
  ] }) : null,
17249
- hasEnteredAmount && (isLimitOrder ? limitOrderPayload : selectedRouteCard) && !isQuoteLoading && !isBelowMinimum && orderEligibility.canPlaceOrder ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-summary flex items-start justify-between gap-4", children: [
17250
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-summary-meta flex flex-col", children: [
17251
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-order-summary-label text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.toWin(internalTab) }),
17252
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-order-summary-hint text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isLimitOrder ? displayedLimitToWinHint : displayedToWinHint })
17459
+ hasEnteredAmount && (isLimitOrder ? limitOrderPayload : selectedRouteCard) && !isQuoteLoading && !isBelowMinimum && orderEligibility.canPlaceOrder ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-order-summary flex items-start justify-between gap-4", children: [
17460
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-order-summary-meta flex flex-col", children: [
17461
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-order-summary-label text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.toWin(internalTab) }),
17462
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-order-summary-hint text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isLimitOrder ? displayedLimitToWinHint : displayedToWinHint })
17253
17463
  ] }),
17254
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17255
- import_react25.default,
17464
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17465
+ import_react26.default,
17256
17466
  {
17257
17467
  value: isLimitOrder ? displayedLimitToWinValue : displayedToWinValue,
17258
17468
  locales: locale,
@@ -17266,7 +17476,7 @@ var PlaceOrder = ({
17266
17476
  }
17267
17477
  )
17268
17478
  ] }) : null,
17269
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
17479
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
17270
17480
  "div",
17271
17481
  {
17272
17482
  className: cn(
@@ -17274,17 +17484,17 @@ var PlaceOrder = ({
17274
17484
  classNames == null ? void 0 : classNames.footer
17275
17485
  ),
17276
17486
  children: [
17277
- !shouldShowGeoBlockBanner ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-alerts flex flex-col gap-3 empty:hidden mb-3", children: [
17278
- submissionFeedback ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17487
+ !shouldShowGeoBlockBanner ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-order-alerts flex flex-col gap-3 empty:hidden mb-3", children: [
17488
+ submissionFeedback ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17279
17489
  InlineAlert,
17280
17490
  {
17281
17491
  tone: submissionFeedback.tone,
17282
17492
  message: submissionFeedback.message
17283
17493
  }
17284
17494
  ) : null,
17285
- !submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && isBelowMinimum ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(InlineAlert, { tone: "error", message: belowMinimumMessage }) : null,
17286
- !submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && quoteStatus ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(InlineAlert, { tone: quoteStatus.tone, message: quoteStatus.message }) : null,
17287
- !submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && !quoteStatus && hasEnteredAmount && smartRouteErrorMessage ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17495
+ !submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && isBelowMinimum ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(InlineAlert, { tone: "error", message: belowMinimumMessage }) : null,
17496
+ !submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && quoteStatus ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(InlineAlert, { tone: quoteStatus.tone, message: quoteStatus.message }) : null,
17497
+ !submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && !quoteStatus && hasEnteredAmount && smartRouteErrorMessage ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17288
17498
  InlineAlert,
17289
17499
  {
17290
17500
  tone: "error",
@@ -17296,14 +17506,14 @@ var PlaceOrder = ({
17296
17506
  }
17297
17507
  ) : null
17298
17508
  ] }) : null,
17299
- !submissionFeedback && !shouldShowGeoBlockBanner && orderEligibility.canPlaceOrder && !needsSharedKycVerification && !needsKalshiConnection && shouldShowInsufficientBalanceAlert ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
17509
+ !submissionFeedback && !shouldShowGeoBlockBanner && orderEligibility.canPlaceOrder && !needsSharedKycVerification && !needsKalshiConnection && shouldShowInsufficientBalanceAlert ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
17300
17510
  "div",
17301
17511
  {
17302
17512
  className: "agg-order-insufficient-balance-alert flex items-center justify-center gap-2",
17303
17513
  role: "status",
17304
17514
  "aria-live": "polite",
17305
17515
  children: [
17306
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17516
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17307
17517
  Icon,
17308
17518
  {
17309
17519
  name: "warning-filled",
@@ -17312,8 +17522,8 @@ var PlaceOrder = ({
17312
17522
  "aria-hidden": "true"
17313
17523
  }
17314
17524
  ),
17315
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "text-agg-sm text-agg-foreground", children: tradingLabels.insufficientBalance }),
17316
- insufficientBalanceDetails ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17525
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "text-agg-sm text-agg-foreground", children: tradingLabels.insufficientBalance }),
17526
+ insufficientBalanceDetails ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17317
17527
  Tooltip,
17318
17528
  {
17319
17529
  "aria-label": tradingLabels.insufficientBalanceDetails,
@@ -17329,7 +17539,7 @@ var PlaceOrder = ({
17329
17539
  ]
17330
17540
  }
17331
17541
  ) : null,
17332
- !submissionFeedback && !shouldShowGeoBlockBanner && needsSharedKycVerification ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17542
+ !submissionFeedback && !shouldShowGeoBlockBanner && needsSharedKycVerification ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17333
17543
  Button,
17334
17544
  {
17335
17545
  size: "large",
@@ -17343,7 +17553,7 @@ var PlaceOrder = ({
17343
17553
  },
17344
17554
  children: sharedKyc.status === "loading" ? tradingLabels.sharedKyc.checkingStatus : tradingLabels.sharedKyc.completeToTrade
17345
17555
  }
17346
- ) : !submissionFeedback && !shouldShowGeoBlockBanner && needsProphetxConnection ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17556
+ ) : !submissionFeedback && !shouldShowGeoBlockBanner && needsProphetxConnection ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17347
17557
  Button,
17348
17558
  {
17349
17559
  size: "large",
@@ -17351,7 +17561,7 @@ var PlaceOrder = ({
17351
17561
  onClick: () => setIsConnectProphetxModalOpen(true),
17352
17562
  children: tradingLabels.connectProphetx
17353
17563
  }
17354
- ) : !submissionFeedback && isProphetxDirectRoute && isSell ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Button, { size: "large", className: "h-12 w-full", disabled: true, children: tradingLabels.prophetxSettlementNotice }) : !submissionFeedback && !shouldShowGeoBlockBanner && isProphetxBalanceInsufficient ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17564
+ ) : !submissionFeedback && isProphetxDirectRoute && isSell ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Button, { size: "large", className: "h-12 w-full", disabled: true, children: tradingLabels.prophetxSettlementNotice }) : !submissionFeedback && !shouldShowGeoBlockBanner && isProphetxBalanceInsufficient ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17355
17565
  "a",
17356
17566
  {
17357
17567
  className: "flex h-12 w-full items-center justify-center rounded-agg-md bg-agg-primary text-agg-on-primary",
@@ -17360,7 +17570,24 @@ var PlaceOrder = ({
17360
17570
  rel: "noopener noreferrer",
17361
17571
  children: tradingLabels.prophetxFundingNotice
17362
17572
  }
17363
- ) : !submissionFeedback && !shouldShowGeoBlockBanner && needsKalshiConnection ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17573
+ ) : !submissionFeedback && !shouldShowGeoBlockBanner && needsNovigConnection ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17574
+ Button,
17575
+ {
17576
+ size: "large",
17577
+ className: "h-12 w-full",
17578
+ onClick: () => setIsConnectNovigModalOpen(true),
17579
+ children: tradingLabels.connectNovig
17580
+ }
17581
+ ) : !submissionFeedback && isNovigDirectRoute && isSell ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Button, { size: "large", className: "h-12 w-full", disabled: true, children: tradingLabels.novigSettlementNotice }) : !submissionFeedback && !shouldShowGeoBlockBanner && isNovigBalanceInsufficient ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17582
+ "a",
17583
+ {
17584
+ className: "flex h-12 w-full items-center justify-center rounded-agg-md bg-agg-primary text-agg-on-primary",
17585
+ href: "https://novig.com/Profile/ProfileScreen",
17586
+ target: "_blank",
17587
+ rel: "noopener noreferrer",
17588
+ children: tradingLabels.novigFundingNotice
17589
+ }
17590
+ ) : !submissionFeedback && !shouldShowGeoBlockBanner && needsKalshiConnection ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17364
17591
  Button,
17365
17592
  {
17366
17593
  size: "large",
@@ -17370,7 +17597,7 @@ var PlaceOrder = ({
17370
17597
  onClick: () => setIsConnectKalshiModalOpen(true),
17371
17598
  children: tradingLabels.connectKalshi
17372
17599
  }
17373
- ) : isQuoteLoading && !isActionLoading ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17600
+ ) : isQuoteLoading && !isActionLoading ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17374
17601
  Button,
17375
17602
  {
17376
17603
  size: "large",
@@ -17379,7 +17606,7 @@ var PlaceOrder = ({
17379
17606
  disabled: true,
17380
17607
  "aria-live": "polite",
17381
17608
  "aria-label": routeLoadingMessage != null ? routeLoadingMessage : labels.common.loading,
17382
- prefix: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17609
+ prefix: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17383
17610
  "span",
17384
17611
  {
17385
17612
  className: cn(
@@ -17391,7 +17618,7 @@ var PlaceOrder = ({
17391
17618
  ),
17392
17619
  children: routeLoadingMessage
17393
17620
  }
17394
- ) : !submissionFeedback && !shouldShowGeoBlockBanner && (isInsufficientBalance || needsBetdexAccount) ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17621
+ ) : !submissionFeedback && !shouldShowGeoBlockBanner && (isInsufficientBalance || needsBetdexAccount) ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17395
17622
  Button,
17396
17623
  {
17397
17624
  size: "large",
@@ -17401,7 +17628,7 @@ var PlaceOrder = ({
17401
17628
  onClick: handleDepositRequiredClick,
17402
17629
  children: isKalshiBalanceInsufficient ? tradingLabels.addFundsToKalshi : needsBetdexAccount ? tradingLabels.manageBetdexAccount : tradingLabels.deposit
17403
17630
  }
17404
- ) : !isAuthenticated ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17631
+ ) : !isAuthenticated ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17405
17632
  Button,
17406
17633
  {
17407
17634
  size: "large",
@@ -17409,10 +17636,10 @@ var PlaceOrder = ({
17409
17636
  className: "agg-order-submit h-12 w-full px-8 text-agg-base leading-agg-6 shadow-none",
17410
17637
  disabled: !orderEligibility.canPlaceOrder || shouldShowGeoBlockBanner,
17411
17638
  "aria-label": tradingLabels.signInToTrade,
17412
- onClick: import_hooks51.requestAggAuthChooserOpen,
17639
+ onClick: import_hooks52.requestAggAuthChooserOpen,
17413
17640
  children: tradingLabels.signInToTrade
17414
17641
  }
17415
- ) : /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17642
+ ) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17416
17643
  Button,
17417
17644
  {
17418
17645
  size: "large",
@@ -17427,8 +17654,8 @@ var PlaceOrder = ({
17427
17654
  children: actionLabel
17428
17655
  }
17429
17656
  ),
17430
- !shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown && appFeeValue === 0 ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "agg-order-platform-fee mt-1 flex items-center justify-center gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: [
17431
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17657
+ !shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown && appFeeValue === 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-order-platform-fee mt-1 flex items-center justify-center gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: [
17658
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17432
17659
  Icon,
17433
17660
  {
17434
17661
  name: "shield-trust",
@@ -17437,10 +17664,10 @@ var PlaceOrder = ({
17437
17664
  "aria-hidden": "true"
17438
17665
  }
17439
17666
  ),
17440
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Typography, { variant: "text-xs-caps", className: "text-agg-primary", children: tradingLabels.platformFee })
17667
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Typography, { variant: "text-xs-caps", className: "text-agg-primary", children: tradingLabels.platformFee })
17441
17668
  ] }) : null,
17442
- shouldShowGeoBlockBanner ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(GeoBlockBanner, { termsUrl: AGG_TERMS_OF_SERVICE_URL }) : null,
17443
- !shouldShowGeoBlockBanner ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-order-disclaimer text-center text-agg-xs leading-agg-4 text-agg-muted-foreground", children: tradingLabels.disclaimer }) : null
17669
+ shouldShowGeoBlockBanner ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(GeoBlockBanner, { termsUrl: AGG_TERMS_OF_SERVICE_URL }) : null,
17670
+ !shouldShowGeoBlockBanner ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-order-disclaimer text-center text-agg-xs leading-agg-4 text-agg-muted-foreground", children: tradingLabels.disclaimer }) : null
17444
17671
  ]
17445
17672
  }
17446
17673
  )
@@ -17448,7 +17675,7 @@ var PlaceOrder = ({
17448
17675
  ]
17449
17676
  }
17450
17677
  ),
17451
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17678
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17452
17679
  SharedKycModal,
17453
17680
  {
17454
17681
  open: sharedKycFlow.isModalOpen,
@@ -17462,7 +17689,7 @@ var PlaceOrder = ({
17462
17689
  }
17463
17690
  }
17464
17691
  ),
17465
- isAuthenticated && !isPaperMode && ((prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.validatedAt) || (prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.hasAccountHistory)) ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17692
+ isAuthenticated && !isPaperMode && ((prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.validatedAt) || (prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.hasAccountHistory)) ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17466
17693
  "button",
17467
17694
  {
17468
17695
  type: "button",
@@ -17471,7 +17698,7 @@ var PlaceOrder = ({
17471
17698
  children: tradingLabels.manageProphetx
17472
17699
  }
17473
17700
  ) : null,
17474
- isAuthenticated && isProphetxDirect && canConnectProphetx && !needsProphetxConnection && !(prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.connected) && !(prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.hasAccountHistory) ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17701
+ isAuthenticated && isProphetxDirect && canConnectProphetx && !needsProphetxConnection && !(prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.connected) && !(prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.hasAccountHistory) ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17475
17702
  "button",
17476
17703
  {
17477
17704
  type: "button",
@@ -17480,27 +17707,65 @@ var PlaceOrder = ({
17480
17707
  children: tradingLabels.connectProphetx
17481
17708
  }
17482
17709
  ) : null,
17483
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17710
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17484
17711
  ConnectProphetxModal,
17485
17712
  {
17486
17713
  allowExistingConnection: Boolean(
17487
17714
  (prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.validatedAt) || (prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.hasAccountHistory)
17488
17715
  ),
17489
17716
  onDisconnect: (prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.validatedAt) ? () => __async(null, null, function* () {
17490
- yield aggClient.deleteVenueKey(import_sdk22.Venue.prophetx);
17717
+ yield aggClient.deleteVenueKey(import_sdk23.Venue.prophetx);
17491
17718
  yield refetchProphetxKeyStatus();
17492
17719
  yield queryClient.invalidateQueries({ queryKey: ["agg"] });
17493
17720
  }) : void 0,
17494
17721
  open: isConnectProphetxModalOpen,
17495
17722
  onOpenChange: setIsConnectProphetxModalOpen,
17496
17723
  onVerify: (credentials) => __async(null, null, function* () {
17497
- yield aggClient.upsertVenueKey({ venue: import_sdk22.Venue.prophetx, credentials });
17724
+ yield aggClient.upsertVenueKey({ venue: import_sdk23.Venue.prophetx, credentials });
17498
17725
  yield refetchProphetxKeyStatus();
17499
17726
  yield queryClient.invalidateQueries({ queryKey: ["agg"] });
17500
17727
  })
17501
17728
  }
17502
17729
  ),
17503
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17730
+ isAuthenticated && !isPaperMode && ((novigKeyStatus == null ? void 0 : novigKeyStatus.validatedAt) || (novigKeyStatus == null ? void 0 : novigKeyStatus.hasAccountHistory)) ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17731
+ "button",
17732
+ {
17733
+ type: "button",
17734
+ className: "cursor-pointer text-agg-sm text-agg-primary underline",
17735
+ onClick: () => setIsConnectNovigModalOpen(true),
17736
+ children: tradingLabels.manageNovig
17737
+ }
17738
+ ) : null,
17739
+ isAuthenticated && isNovigDirect && canConnectNovig && !needsNovigConnection && !(novigKeyStatus == null ? void 0 : novigKeyStatus.connected) && !(novigKeyStatus == null ? void 0 : novigKeyStatus.hasAccountHistory) ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17740
+ "button",
17741
+ {
17742
+ type: "button",
17743
+ className: "cursor-pointer text-agg-sm text-agg-primary underline",
17744
+ onClick: () => setIsConnectNovigModalOpen(true),
17745
+ children: tradingLabels.connectNovig
17746
+ }
17747
+ ) : null,
17748
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17749
+ ConnectNovigModal,
17750
+ {
17751
+ allowExistingConnection: Boolean(
17752
+ (novigKeyStatus == null ? void 0 : novigKeyStatus.validatedAt) || (novigKeyStatus == null ? void 0 : novigKeyStatus.hasAccountHistory)
17753
+ ),
17754
+ onDisconnect: (novigKeyStatus == null ? void 0 : novigKeyStatus.validatedAt) ? () => __async(null, null, function* () {
17755
+ yield aggClient.deleteVenueKey(import_sdk23.Venue.novig);
17756
+ yield refetchNovigKeyStatus();
17757
+ yield queryClient.invalidateQueries({ queryKey: ["agg"] });
17758
+ }) : void 0,
17759
+ open: isConnectNovigModalOpen,
17760
+ onOpenChange: setIsConnectNovigModalOpen,
17761
+ onVerify: (credentials) => __async(null, null, function* () {
17762
+ yield aggClient.upsertVenueKey({ venue: import_sdk23.Venue.novig, credentials });
17763
+ yield refetchNovigKeyStatus();
17764
+ yield queryClient.invalidateQueries({ queryKey: ["agg"] });
17765
+ })
17766
+ }
17767
+ ),
17768
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17504
17769
  ConnectKalshiModal,
17505
17770
  {
17506
17771
  open: isConnectKalshiModalOpen,
@@ -17508,8 +17773,8 @@ var PlaceOrder = ({
17508
17773
  onVerify: handleVerifyKalshi
17509
17774
  }
17510
17775
  ),
17511
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(FundKalshiModal, { open: isFundKalshiModalOpen, onOpenChange: setIsFundKalshiModalOpen }),
17512
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
17776
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(FundKalshiModal, { open: isFundKalshiModalOpen, onOpenChange: setIsFundKalshiModalOpen }),
17777
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
17513
17778
  ManageBetdexAccountModal,
17514
17779
  {
17515
17780
  userId: user == null ? void 0 : user.id,
@@ -17525,33 +17790,33 @@ var PlaceOrder = ({
17525
17790
  PlaceOrder.displayName = "PlaceOrder";
17526
17791
 
17527
17792
  // src/trading/trading-context/index.tsx
17528
- var import_hooks52 = require("@agg-build/hooks");
17793
+ var import_hooks53 = require("@agg-build/hooks");
17529
17794
 
17530
17795
  // src/trading/use-claim-winnings.ts
17531
- var import_hooks53 = require("@agg-build/hooks");
17532
- var import_react27 = require("react");
17796
+ var import_hooks54 = require("@agg-build/hooks");
17797
+ var import_react28 = require("react");
17533
17798
  var toClaimError = (err) => {
17534
17799
  if (err instanceof Error) return err;
17535
17800
  return new Error(String(err));
17536
17801
  };
17537
17802
  function useClaimWinnings(options = {}) {
17538
17803
  const { onClaim, onClaimResult, onClaimSubmitError, externalClaimingKeys } = options;
17539
- const labels = (0, import_hooks53.useLabels)();
17804
+ const labels = (0, import_hooks54.useLabels)();
17540
17805
  const claimNotificationLabels = labels.notifications.claim;
17541
17806
  const toastCtx = useOptionalToast();
17542
- const queryClient = (0, import_hooks53.useQueryClient)();
17543
- const redeemMutation = (0, import_hooks53.useRedeem)();
17544
- const [activeRedeems, setActiveRedeems] = (0, import_react27.useState)({});
17545
- const activeClaimKeysRef = (0, import_react27.useRef)(/* @__PURE__ */ new Set());
17546
- const pendingClaimToastIdsRef = (0, import_react27.useRef)({});
17547
- const submittedClaimToastKeysRef = (0, import_react27.useRef)(/* @__PURE__ */ new Set());
17548
- const [submittingClaimKeys, setSubmittingClaimKeys] = (0, import_react27.useState)({});
17549
- const lifecycleInputs = (0, import_react27.useMemo)(
17807
+ const queryClient = (0, import_hooks54.useQueryClient)();
17808
+ const redeemMutation = (0, import_hooks54.useRedeem)();
17809
+ const [activeRedeems, setActiveRedeems] = (0, import_react28.useState)({});
17810
+ const activeClaimKeysRef = (0, import_react28.useRef)(/* @__PURE__ */ new Set());
17811
+ const pendingClaimToastIdsRef = (0, import_react28.useRef)({});
17812
+ const submittedClaimToastKeysRef = (0, import_react28.useRef)(/* @__PURE__ */ new Set());
17813
+ const [submittingClaimKeys, setSubmittingClaimKeys] = (0, import_react28.useState)({});
17814
+ const lifecycleInputs = (0, import_react28.useMemo)(
17550
17815
  () => Object.values(activeRedeems),
17551
17816
  [activeRedeems]
17552
17817
  );
17553
- const lifecycleStates = (0, import_hooks53.useRedeemLifecycles)(lifecycleInputs);
17554
- const internalClaimingIds = (0, import_react27.useMemo)(() => {
17818
+ const lifecycleStates = (0, import_hooks54.useRedeemLifecycles)(lifecycleInputs);
17819
+ const internalClaimingIds = (0, import_react28.useMemo)(() => {
17555
17820
  const out = __spreadValues({}, submittingClaimKeys);
17556
17821
  for (const [claimKey, active] of Object.entries(activeRedeems)) {
17557
17822
  const state = lifecycleStates[active.redeemId];
@@ -17560,20 +17825,20 @@ function useClaimWinnings(options = {}) {
17560
17825
  return out;
17561
17826
  }, [activeRedeems, lifecycleStates, submittingClaimKeys]);
17562
17827
  const claimingKeys = externalClaimingKeys != null ? externalClaimingKeys : internalClaimingIds;
17563
- const isClaiming = (0, import_react27.useCallback)(
17828
+ const isClaiming = (0, import_react28.useCallback)(
17564
17829
  (claimKey) => Boolean(externalClaimingKeys == null ? void 0 : externalClaimingKeys[claimKey]) || Boolean(internalClaimingIds[claimKey]),
17565
17830
  [externalClaimingKeys, internalClaimingIds]
17566
17831
  );
17567
- const invalidateClaimUiState = (0, import_react27.useCallback)(() => {
17568
- (0, import_hooks53.invalidateBalanceQueries)(queryClient);
17569
- (0, import_hooks53.invalidatePositionQueries)(queryClient);
17832
+ const invalidateClaimUiState = (0, import_react28.useCallback)(() => {
17833
+ (0, import_hooks54.invalidateBalanceQueries)(queryClient);
17834
+ (0, import_hooks54.invalidatePositionQueries)(queryClient);
17570
17835
  queryClient.invalidateQueries({
17571
- queryKey: import_hooks53.executionKeys.claimablePositionsCount(),
17836
+ queryKey: import_hooks54.executionKeys.claimablePositionsCount(),
17572
17837
  refetchType: "active"
17573
17838
  });
17574
- (0, import_hooks53.invalidateUserActivityQueries)(queryClient);
17839
+ (0, import_hooks54.invalidateUserActivityQueries)(queryClient);
17575
17840
  }, [queryClient]);
17576
- const claim = (0, import_react27.useCallback)(
17841
+ const claim = (0, import_react28.useCallback)(
17577
17842
  (_0) => __async(null, [_0], function* ({ claimKey, winningOutcomeIds, payload }) {
17578
17843
  if (activeClaimKeysRef.current.has(claimKey) || Boolean(externalClaimingKeys == null ? void 0 : externalClaimingKeys[claimKey]) || internalClaimingIds[claimKey]) {
17579
17844
  return;
@@ -17711,8 +17976,8 @@ function useClaimWinnings(options = {}) {
17711
17976
  toastCtx
17712
17977
  ]
17713
17978
  );
17714
- const firedTerminalRef = (0, import_react27.useRef)({});
17715
- (0, import_react27.useEffect)(() => {
17979
+ const firedTerminalRef = (0, import_react28.useRef)({});
17980
+ (0, import_react28.useEffect)(() => {
17716
17981
  var _a, _b;
17717
17982
  for (const [claimKey, active] of Object.entries(activeRedeems)) {
17718
17983
  const state = lifecycleStates[active.redeemId];
@@ -17768,8 +18033,8 @@ function useClaimWinnings(options = {}) {
17768
18033
  }
17769
18034
 
17770
18035
  // src/trading/use-resolved-market-claim.ts
17771
- var import_hooks54 = require("@agg-build/hooks");
17772
- var import_react28 = require("react");
18036
+ var import_hooks55 = require("@agg-build/hooks");
18037
+ var import_react29 = require("react");
17773
18038
  var sharesFormatter = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
17774
18039
  var dateFormatter = new Intl.DateTimeFormat("en-US", {
17775
18040
  month: "short",
@@ -17785,18 +18050,18 @@ var formatResolutionDate = (value) => {
17785
18050
  function useResolvedMarketClaim(options = {}) {
17786
18051
  var _a;
17787
18052
  const { market, enabled = true, executionMode } = options;
17788
- const { isAuthenticated } = (0, import_hooks54.useAggAuthState)();
17789
- const tradingState = (0, import_react28.useMemo)(() => (0, import_hooks54.resolveMarketTradingState)(market), [market]);
18053
+ const { isAuthenticated } = (0, import_hooks55.useAggAuthState)();
18054
+ const tradingState = (0, import_react29.useMemo)(() => (0, import_hooks55.resolveMarketTradingState)(market), [market]);
17790
18055
  const isResolved = tradingState.kind === "resolved";
17791
18056
  const marketId = (_a = market == null ? void 0 : market.id) != null ? _a : null;
17792
18057
  const shouldFetch = Boolean(enabled && isAuthenticated && isResolved && marketId);
17793
- const { positions } = (0, import_hooks54.useExecutionPositions)(__spreadValues({
18058
+ const { positions } = (0, import_hooks55.useExecutionPositions)(__spreadValues({
17794
18059
  enabled: shouldFetch,
17795
18060
  status: "active",
17796
18061
  limit: 50
17797
18062
  }, executionMode === "paper" ? { mode: "paper" } : {}));
17798
18063
  const claimWinnings = useClaimWinnings();
17799
- return (0, import_react28.useMemo)(() => {
18064
+ return (0, import_react29.useMemo)(() => {
17800
18065
  var _a2;
17801
18066
  if (!shouldFetch || !marketId) return void 0;
17802
18067
  const group = positions.find(
@@ -17807,7 +18072,7 @@ function useResolvedMarketClaim(options = {}) {
17807
18072
  (outcome) => outcome.winner === true && outcome.totalSize > 0
17808
18073
  );
17809
18074
  if (winningOutcomes.length === 0) return void 0;
17810
- const totals = (0, import_hooks54.computeClosedPositionTotals)(group);
18075
+ const totals = (0, import_hooks55.computeClosedPositionTotals)(group);
17811
18076
  const winningShares = winningOutcomes.reduce((sum, outcome) => sum + outcome.totalSize, 0);
17812
18077
  const winningOutcomeLabel = (_a2 = resolveResolvedOutcomeLabel({
17813
18078
  market: market != null ? market : group.venueMarket,