@agg-market/ui 5.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -26
- package/dist/auth.d.mts +1 -0
- package/dist/auth.d.ts +1 -0
- package/dist/{connect-button.js → auth.js} +6 -4
- package/dist/auth.mjs +8 -0
- package/dist/chunk-2ICOSP7N.mjs +1211 -0
- package/dist/chunk-5ZKPBMRK.mjs +2411 -0
- package/dist/{chunk-5K7VXAYM.mjs → chunk-ADGL6RFX.mjs} +2 -4
- package/dist/chunk-BXW3VIKV.mjs +90 -0
- package/dist/{chart.js → chunk-CN7GI2RJ.mjs} +250 -103
- package/dist/chunk-G6YKGVQR.mjs +769 -0
- package/dist/{chunk-PZTHM6WG.mjs → chunk-HI4EEDN5.mjs} +897 -357
- package/dist/{chunk-5ADMXO3Y.mjs → chunk-INRG3D4M.mjs} +5 -11
- package/dist/{chunk-QDMHLRDY.mjs → chunk-JE3Z52FD.mjs} +90 -38
- package/dist/chunk-KZOQW6NT.mjs +0 -0
- package/dist/chunk-LMOJKJOY.mjs +2616 -0
- package/dist/{chunk-YJA5VQW6.mjs → chunk-MHCHR65A.mjs} +2 -4
- package/dist/{chunk-IGPNIM2B.mjs → chunk-PASXFYKQ.mjs} +2 -4
- package/dist/chunk-UBBOLLOS.mjs +999 -0
- package/dist/events.d.mts +1 -0
- package/dist/events.d.ts +1 -0
- package/dist/{event-market-page.js → events.js} +4579 -4935
- package/dist/events.mjs +17 -0
- package/dist/index.d.mts +1 -79
- package/dist/index.d.ts +1 -79
- package/dist/index.js +6839 -6839
- package/dist/index.mjs +66 -170
- package/dist/modals.d.mts +1 -0
- package/dist/modals.d.ts +1 -0
- package/dist/{deposit-modal.js → modals.js} +1771 -6
- package/dist/modals.mjs +25 -0
- package/dist/pages.d.mts +1 -0
- package/dist/pages.d.ts +1 -0
- package/dist/{home-page.js → pages.js} +3868 -6
- package/dist/pages.mjs +16 -0
- package/dist/primitives.d.mts +1 -0
- package/dist/primitives.d.ts +1 -0
- package/dist/{market-details.js → primitives.js} +3302 -3729
- package/dist/{icon.mjs → primitives.mjs} +56 -9
- package/dist/trading.d.mts +1 -0
- package/dist/trading.d.ts +1 -0
- package/dist/{event-list.js → trading.js} +1426 -1467
- package/dist/trading.mjs +65 -0
- package/dist/types/auth/connect-button/connect-button.constants.d.mts +10 -0
- package/dist/types/auth/connect-button/connect-button.constants.d.ts +10 -0
- package/dist/{connect-button.d.mts → types/auth/connect-button/connect-button.types.d.mts} +5 -12
- package/dist/{connect-button.d.ts → types/auth/connect-button/connect-button.types.d.ts} +5 -12
- package/dist/types/auth/connect-button/index.d.mts +7 -0
- package/dist/types/auth/connect-button/index.d.ts +7 -0
- package/dist/types/auth/index.d.mts +1 -0
- package/dist/types/auth/index.d.ts +1 -0
- package/dist/types/constants.d.mts +1 -0
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/deposit/deposit-modal.constants.d.mts +9 -0
- package/dist/types/deposit/deposit-modal.constants.d.ts +9 -0
- package/dist/{deposit-modal.d.mts → types/deposit/deposit-modal.types.d.mts} +3 -10
- package/dist/{deposit-modal.d.ts → types/deposit/deposit-modal.types.d.ts} +3 -10
- package/dist/types/deposit/index.d.mts +6 -0
- package/dist/types/deposit/index.d.ts +6 -0
- package/dist/types/deposit/steps/card-deposit.d.mts +7 -0
- package/dist/types/deposit/steps/card-deposit.d.ts +7 -0
- package/dist/types/deposit/steps/crypto-transfer.d.mts +7 -0
- package/dist/types/deposit/steps/crypto-transfer.d.ts +7 -0
- package/dist/types/deposit/steps/deposit-method.d.mts +7 -0
- package/dist/types/deposit/steps/deposit-method.d.ts +7 -0
- package/dist/types/deposit/steps/kalshi-deposit.d.mts +5 -0
- package/dist/types/deposit/steps/kalshi-deposit.d.ts +5 -0
- package/dist/types/deposit/steps/venue-selection.d.mts +7 -0
- package/dist/types/deposit/steps/venue-selection.d.ts +7 -0
- package/dist/types/events/index.d.mts +4 -0
- package/dist/types/events/index.d.ts +4 -0
- package/dist/types/events/item/event-list-item.constants.d.mts +1 -0
- package/dist/types/events/item/event-list-item.constants.d.ts +1 -0
- package/dist/types/events/item/event-list-item.types.d.mts +46 -0
- package/dist/types/events/item/event-list-item.types.d.ts +46 -0
- package/dist/types/events/item/event-list-item.utils.d.mts +23 -0
- package/dist/types/events/item/event-list-item.utils.d.ts +23 -0
- package/dist/types/events/item/index.d.mts +6 -0
- package/dist/types/events/item/index.d.ts +6 -0
- package/dist/types/events/item-details/event-list-item-details.constants.d.mts +10 -0
- package/dist/types/events/item-details/event-list-item-details.constants.d.ts +10 -0
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +53 -0
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +53 -0
- package/dist/types/events/item-details/event-list-item-details.utils.d.mts +26 -0
- package/dist/types/events/item-details/event-list-item-details.utils.d.ts +26 -0
- package/dist/types/events/item-details/index.d.mts +6 -0
- package/dist/types/events/item-details/index.d.ts +6 -0
- package/dist/types/events/list/event-list.constants.d.mts +3 -0
- package/dist/types/events/list/event-list.constants.d.ts +3 -0
- package/dist/types/events/list/event-list.types.d.mts +21 -0
- package/dist/types/events/list/event-list.types.d.ts +21 -0
- package/dist/types/events/list/event-list.utils.d.mts +6 -0
- package/dist/types/events/list/event-list.utils.d.ts +6 -0
- package/dist/types/events/list/index.d.mts +6 -0
- package/dist/types/events/list/index.d.ts +6 -0
- package/dist/types/events/market-details/index.d.mts +6 -0
- package/dist/types/events/market-details/index.d.ts +6 -0
- package/dist/types/events/market-details/market-details.constants.d.mts +9 -0
- package/dist/types/events/market-details/market-details.constants.d.ts +9 -0
- package/dist/types/events/market-details/market-details.types.d.mts +63 -0
- package/dist/types/events/market-details/market-details.types.d.ts +63 -0
- package/dist/types/events/market-details/market-details.utils.d.mts +46 -0
- package/dist/types/events/market-details/market-details.utils.d.ts +46 -0
- package/dist/types/index.d.mts +9 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/modals/index.d.mts +4 -0
- package/dist/types/modals/index.d.ts +4 -0
- package/dist/types/onboarding/index.d.mts +11 -0
- package/dist/types/onboarding/index.d.ts +11 -0
- package/dist/types/onboarding/onboarding-modal.constants.d.mts +10 -0
- package/dist/types/onboarding/onboarding-modal.constants.d.ts +10 -0
- package/dist/types/onboarding/onboarding-modal.types.d.mts +55 -0
- package/dist/types/onboarding/onboarding-modal.types.d.ts +55 -0
- package/dist/types/onboarding/steps/connect-accounts.d.mts +5 -0
- package/dist/types/onboarding/steps/connect-accounts.d.ts +5 -0
- package/dist/types/onboarding/steps/connect-kalshi-modal.d.mts +5 -0
- package/dist/types/onboarding/steps/connect-kalshi-modal.d.ts +5 -0
- package/dist/types/onboarding/steps/connect-onchain-modal.d.mts +5 -0
- package/dist/types/onboarding/steps/connect-onchain-modal.d.ts +5 -0
- package/dist/types/onboarding/steps/how-it-works.d.mts +5 -0
- package/dist/types/onboarding/steps/how-it-works.d.ts +5 -0
- package/dist/types/onboarding/steps/profile-setup.d.mts +5 -0
- package/dist/types/onboarding/steps/profile-setup.d.ts +5 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +42 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +42 -0
- package/dist/types/pages/event-market/index.d.mts +6 -0
- package/dist/types/pages/event-market/index.d.ts +6 -0
- package/dist/types/pages/home/home.constants.d.mts +8 -0
- package/dist/types/pages/home/home.constants.d.ts +8 -0
- package/dist/{home-page.d.ts → types/pages/home/home.types.d.mts} +8 -18
- package/dist/{home-page.d.mts → types/pages/home/home.types.d.ts} +8 -18
- package/dist/types/pages/home/home.utils.d.mts +3 -0
- package/dist/types/pages/home/home.utils.d.ts +3 -0
- package/dist/types/pages/home/index.d.mts +6 -0
- package/dist/types/pages/home/index.d.ts +6 -0
- package/dist/types/pages/index.d.mts +3 -0
- package/dist/types/pages/index.d.ts +3 -0
- package/dist/types/pages/user-profile/components/activity-row.d.mts +10 -0
- package/dist/types/pages/user-profile/components/activity-row.d.ts +10 -0
- package/dist/types/pages/user-profile/components/balance-display.d.mts +12 -0
- package/dist/types/pages/user-profile/components/balance-display.d.ts +12 -0
- package/dist/types/pages/user-profile/components/balances-card.d.mts +12 -0
- package/dist/types/pages/user-profile/components/balances-card.d.ts +12 -0
- package/dist/types/pages/user-profile/components/default-avatar.d.mts +8 -0
- package/dist/types/pages/user-profile/components/default-avatar.d.ts +8 -0
- package/dist/types/pages/user-profile/components/empty-state.d.mts +10 -0
- package/dist/types/pages/user-profile/components/empty-state.d.ts +10 -0
- package/dist/types/pages/user-profile/components/position-row.d.mts +10 -0
- package/dist/types/pages/user-profile/components/position-row.d.ts +10 -0
- package/dist/types/pages/user-profile/components/positions-activity.d.mts +14 -0
- package/dist/types/pages/user-profile/components/positions-activity.d.ts +14 -0
- package/dist/types/pages/user-profile/components/user-info-card.d.mts +11 -0
- package/dist/types/pages/user-profile/components/user-info-card.d.ts +11 -0
- package/dist/types/pages/user-profile/index.d.mts +6 -0
- package/dist/types/pages/user-profile/index.d.ts +6 -0
- package/dist/types/pages/user-profile/user-profile.constants.d.mts +9 -0
- package/dist/types/pages/user-profile/user-profile.constants.d.ts +9 -0
- package/dist/{user-profile-page.d.ts → types/pages/user-profile/user-profile.types.d.mts} +12 -22
- package/dist/{user-profile-page.d.mts → types/pages/user-profile/user-profile.types.d.ts} +12 -22
- package/dist/types/primitives/badge/badge.constants.d.mts +4 -0
- package/dist/types/primitives/badge/badge.constants.d.ts +4 -0
- package/dist/types/primitives/badge/badge.types.d.mts +18 -0
- package/dist/types/primitives/badge/badge.types.d.ts +18 -0
- package/dist/types/primitives/badge/index.d.mts +7 -0
- package/dist/types/primitives/badge/index.d.ts +7 -0
- package/dist/types/primitives/button/button.constants.d.mts +6 -0
- package/dist/types/primitives/button/button.constants.d.ts +6 -0
- package/dist/types/primitives/button/button.types.d.mts +12 -0
- package/dist/types/primitives/button/button.types.d.ts +12 -0
- package/dist/types/primitives/button/index.d.mts +6 -0
- package/dist/types/primitives/button/index.d.ts +6 -0
- package/dist/types/primitives/card/card.types.d.mts +3 -0
- package/dist/types/primitives/card/card.types.d.ts +3 -0
- package/dist/types/primitives/card/index.d.mts +6 -0
- package/dist/types/primitives/card/index.d.ts +6 -0
- package/dist/{chart.d.mts → types/primitives/chart/index.d.mts} +7 -10
- package/dist/{chart.d.ts → types/primitives/chart/index.d.ts} +7 -10
- package/dist/types/primitives/hello-world.d.mts +4 -0
- package/dist/types/primitives/hello-world.d.ts +4 -0
- package/dist/types/primitives/icon/icon.constants.d.mts +2 -0
- package/dist/types/primitives/icon/icon.constants.d.ts +2 -0
- package/dist/types/primitives/icon/icon.types.d.mts +9 -0
- package/dist/types/primitives/icon/icon.types.d.ts +9 -0
- package/dist/types/primitives/icon/icon.utils.d.mts +2 -0
- package/dist/types/primitives/icon/icon.utils.d.ts +2 -0
- package/dist/types/primitives/icon/index.d.mts +46 -0
- package/dist/types/primitives/icon/index.d.ts +46 -0
- package/dist/types/primitives/icon/registry.d.mts +166 -0
- package/dist/types/primitives/icon/registry.d.ts +166 -0
- package/dist/types/primitives/icon/svg/arrow-trend-up.d.mts +5 -0
- package/dist/types/primitives/icon/svg/arrow-trend-up.d.ts +5 -0
- package/dist/types/primitives/icon/svg/arrows-to-dot.d.mts +5 -0
- package/dist/types/primitives/icon/svg/arrows-to-dot.d.ts +5 -0
- package/dist/types/primitives/icon/svg/bank.d.mts +5 -0
- package/dist/types/primitives/icon/svg/bank.d.ts +5 -0
- package/dist/types/primitives/icon/svg/best-prices.d.mts +5 -0
- package/dist/types/primitives/icon/svg/best-prices.d.ts +5 -0
- package/dist/types/primitives/icon/svg/bolt.d.mts +5 -0
- package/dist/types/primitives/icon/svg/bolt.d.ts +5 -0
- package/dist/types/primitives/icon/svg/check-badge.d.mts +5 -0
- package/dist/types/primitives/icon/svg/check-badge.d.ts +5 -0
- package/dist/types/primitives/icon/svg/check-circle.d.mts +5 -0
- package/dist/types/primitives/icon/svg/check-circle.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-down.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-down.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-left.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-left.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-right.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-right.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-up.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-up.d.ts +5 -0
- package/dist/types/primitives/icon/svg/close.d.mts +5 -0
- package/dist/types/primitives/icon/svg/close.d.ts +5 -0
- package/dist/types/primitives/icon/svg/copy.d.mts +5 -0
- package/dist/types/primitives/icon/svg/copy.d.ts +5 -0
- package/dist/types/primitives/icon/svg/create-account.d.mts +5 -0
- package/dist/types/primitives/icon/svg/create-account.d.ts +5 -0
- package/dist/types/primitives/icon/svg/credit-card.d.mts +5 -0
- package/dist/types/primitives/icon/svg/credit-card.d.ts +5 -0
- package/dist/types/primitives/icon/svg/disconnect.d.mts +5 -0
- package/dist/types/primitives/icon/svg/disconnect.d.ts +5 -0
- package/dist/types/primitives/icon/svg/discord.d.mts +5 -0
- package/dist/types/primitives/icon/svg/discord.d.ts +5 -0
- package/dist/types/primitives/icon/svg/document.d.mts +5 -0
- package/dist/types/primitives/icon/svg/document.d.ts +5 -0
- package/dist/types/primitives/icon/svg/dots-horizontal.d.mts +5 -0
- package/dist/types/primitives/icon/svg/dots-horizontal.d.ts +5 -0
- package/dist/types/primitives/icon/svg/download.d.mts +5 -0
- package/dist/types/primitives/icon/svg/download.d.ts +5 -0
- package/dist/types/primitives/icon/svg/email.d.mts +5 -0
- package/dist/types/primitives/icon/svg/email.d.ts +5 -0
- package/dist/types/primitives/icon/svg/external-link.d.mts +5 -0
- package/dist/types/primitives/icon/svg/external-link.d.ts +5 -0
- package/dist/types/primitives/icon/svg/info.d.mts +5 -0
- package/dist/types/primitives/icon/svg/info.d.ts +5 -0
- package/dist/types/primitives/icon/svg/link-accounts.d.mts +5 -0
- package/dist/types/primitives/icon/svg/link-accounts.d.ts +5 -0
- package/dist/types/primitives/icon/svg/pencil.d.mts +5 -0
- package/dist/types/primitives/icon/svg/pencil.d.ts +5 -0
- package/dist/types/primitives/icon/svg/play-square.d.mts +5 -0
- package/dist/types/primitives/icon/svg/play-square.d.ts +5 -0
- package/dist/types/primitives/icon/svg/profile.d.mts +5 -0
- package/dist/types/primitives/icon/svg/profile.d.ts +5 -0
- package/dist/types/primitives/icon/svg/revenue-alt.d.mts +5 -0
- package/dist/types/primitives/icon/svg/revenue-alt.d.ts +5 -0
- package/dist/types/primitives/icon/svg/search.d.mts +5 -0
- package/dist/types/primitives/icon/svg/search.d.ts +5 -0
- package/dist/types/primitives/icon/svg/shield-trust.d.mts +5 -0
- package/dist/types/primitives/icon/svg/shield-trust.d.ts +5 -0
- package/dist/types/primitives/icon/svg/stay-in-control.d.mts +5 -0
- package/dist/types/primitives/icon/svg/stay-in-control.d.ts +5 -0
- package/dist/types/primitives/icon/svg/telegram.d.mts +5 -0
- package/dist/types/primitives/icon/svg/telegram.d.ts +5 -0
- package/dist/types/primitives/icon/svg/triangle-down.d.mts +5 -0
- package/dist/types/primitives/icon/svg/triangle-down.d.ts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up-filled.d.mts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up-filled.d.ts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up.d.mts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up.d.ts +5 -0
- package/dist/types/primitives/icon/svg/twitter.d.mts +5 -0
- package/dist/types/primitives/icon/svg/twitter.d.ts +5 -0
- package/dist/types/primitives/icon/svg/upload.d.mts +5 -0
- package/dist/types/primitives/icon/svg/upload.d.ts +5 -0
- package/dist/types/primitives/icon/svg/wallet-avatar.d.mts +5 -0
- package/dist/types/primitives/icon/svg/wallet-avatar.d.ts +5 -0
- package/dist/types/primitives/icon/svg/wallet.d.mts +5 -0
- package/dist/types/primitives/icon/svg/wallet.d.ts +5 -0
- package/dist/types/primitives/icon/svg/warning-filled.d.mts +5 -0
- package/dist/types/primitives/icon/svg/warning-filled.d.ts +5 -0
- package/dist/types/primitives/icon/svg/warning.d.mts +5 -0
- package/dist/types/primitives/icon/svg/warning.d.ts +5 -0
- package/dist/types/primitives/icon/types.d.mts +5 -0
- package/dist/types/primitives/icon/types.d.ts +5 -0
- package/dist/types/primitives/index.d.mts +17 -0
- package/dist/types/primitives/index.d.ts +17 -0
- package/dist/types/primitives/loading-icon/index.d.mts +11 -0
- package/dist/types/primitives/loading-icon/index.d.ts +11 -0
- package/dist/types/primitives/modal/index.d.mts +10 -0
- package/dist/types/primitives/modal/index.d.ts +10 -0
- package/dist/types/primitives/modal/modal.types.d.mts +54 -0
- package/dist/types/primitives/modal/modal.types.d.ts +54 -0
- package/dist/{number-value.d.mts → types/primitives/number-value.d.mts} +3 -5
- package/dist/{number-value.d.ts → types/primitives/number-value.d.ts} +3 -5
- package/dist/types/primitives/search/index.d.mts +6 -0
- package/dist/types/primitives/search/index.d.ts +6 -0
- package/dist/types/primitives/search/search-empty-icon.d.mts +5 -0
- package/dist/types/primitives/search/search-empty-icon.d.ts +5 -0
- package/dist/types/primitives/search/search.types.d.mts +96 -0
- package/dist/types/primitives/search/search.types.d.ts +96 -0
- package/dist/{select.d.mts → types/primitives/select/index.d.mts} +3 -5
- package/dist/{select.d.ts → types/primitives/select/index.d.ts} +3 -5
- package/dist/types/primitives/skeleton/index.d.mts +7 -0
- package/dist/types/primitives/skeleton/index.d.ts +7 -0
- package/dist/types/primitives/skeleton/skeleton-block.d.mts +8 -0
- package/dist/types/primitives/skeleton/skeleton-block.d.ts +8 -0
- package/dist/{skeleton.d.mts → types/primitives/skeleton/skeleton.types.d.mts} +6 -9
- package/dist/{skeleton.d.ts → types/primitives/skeleton/skeleton.types.d.ts} +6 -9
- package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.ts +5 -0
- package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.mts +9 -0
- package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.ts +9 -0
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.ts +5 -0
- package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.mts +12 -0
- package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.ts +12 -0
- package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.ts +5 -0
- package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.ts +5 -0
- package/dist/{state-message.d.mts → types/primitives/state-message/index.d.mts} +2 -3
- package/dist/{state-message.d.ts → types/primitives/state-message/index.d.ts} +2 -3
- package/dist/{switch-button.d.mts → types/primitives/switch-button/index.d.mts} +4 -7
- package/dist/{switch-button.d.ts → types/primitives/switch-button/index.d.ts} +4 -7
- package/dist/types/primitives/tabs/index.d.mts +6 -0
- package/dist/types/primitives/tabs/index.d.ts +6 -0
- package/dist/types/primitives/tabs/tabs.types.d.mts +24 -0
- package/dist/types/primitives/tabs/tabs.types.d.ts +24 -0
- package/dist/types/primitives/tabs/tabs.utils.d.mts +14 -0
- package/dist/types/primitives/tabs/tabs.utils.d.ts +14 -0
- package/dist/types/primitives/typography/index.d.mts +7 -0
- package/dist/types/primitives/typography/index.d.ts +7 -0
- package/dist/types/primitives/typography/typography.constants.d.mts +3 -0
- package/dist/types/primitives/typography/typography.constants.d.ts +3 -0
- package/dist/types/primitives/typography/typography.types.d.mts +8 -0
- package/dist/types/primitives/typography/typography.types.d.ts +8 -0
- package/dist/types/primitives/venue-logo/index.d.mts +8 -0
- package/dist/types/primitives/venue-logo/index.d.ts +8 -0
- package/dist/types/primitives/venue-logo/logo-props.d.mts +10 -0
- package/dist/types/primitives/venue-logo/logo-props.d.ts +10 -0
- package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.ts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-opinion.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-opinion.d.ts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.ts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-probable.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-probable.d.ts +5 -0
- package/dist/types/primitives/venue-logo/venue-logo.constants.d.mts +9 -0
- package/dist/types/primitives/venue-logo/venue-logo.constants.d.ts +9 -0
- package/dist/types/primitives/venue-logo/venue-logo.types.d.mts +17 -0
- package/dist/types/primitives/venue-logo/venue-logo.types.d.ts +17 -0
- package/dist/types/profile/index.d.mts +6 -0
- package/dist/types/profile/index.d.ts +6 -0
- package/dist/types/profile/profile-modal.constants.d.mts +17 -0
- package/dist/types/profile/profile-modal.constants.d.ts +17 -0
- package/dist/{profile-modal.d.mts → types/profile/profile-modal.types.d.mts} +4 -11
- package/dist/{profile-modal.d.ts → types/profile/profile-modal.types.d.ts} +4 -11
- package/dist/types/profile/tabs/about-tab.d.mts +16 -0
- package/dist/types/profile/tabs/about-tab.d.ts +16 -0
- package/dist/types/profile/tabs/accounts-wallets-tab.d.mts +18 -0
- package/dist/types/profile/tabs/accounts-wallets-tab.d.ts +18 -0
- package/dist/types/shared/constants.d.mts +23 -0
- package/dist/types/shared/constants.d.ts +23 -0
- package/dist/types/shared/query-error.d.mts +2 -0
- package/dist/types/shared/query-error.d.ts +2 -0
- package/dist/types/shared/types.d.mts +1 -0
- package/dist/types/shared/types.d.ts +1 -0
- package/dist/types/shared/utils.d.mts +15 -0
- package/dist/types/shared/utils.d.ts +15 -0
- package/dist/types/trading/index.d.mts +4 -0
- package/dist/types/trading/index.d.ts +4 -0
- package/dist/{place-order.d.ts → types/trading/place-order/index.d.mts} +3 -7
- package/dist/{place-order.d.mts → types/trading/place-order/index.d.ts} +3 -7
- package/dist/{settlement.d.ts → types/trading/settlement/index.d.mts} +3 -7
- package/dist/{settlement.d.mts → types/trading/settlement/index.d.ts} +3 -7
- package/dist/{types-BImwqY4o.d.ts → types/trading/types.d.mts} +35 -38
- package/dist/{types-BImwqY4o.d.mts → types/trading/types.d.ts} +35 -38
- package/dist/types/trading/utils.d.mts +16 -0
- package/dist/types/trading/utils.d.ts +16 -0
- package/dist/types/withdraw/index.d.mts +6 -0
- package/dist/types/withdraw/index.d.ts +6 -0
- package/dist/types/withdraw/steps/kalshi-withdraw.d.mts +5 -0
- package/dist/types/withdraw/steps/kalshi-withdraw.d.ts +5 -0
- package/dist/types/withdraw/steps/venue-selection.d.mts +6 -0
- package/dist/types/withdraw/steps/venue-selection.d.ts +6 -0
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +8 -0
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +8 -0
- package/dist/types/withdraw/steps/withdraw-method.d.mts +7 -0
- package/dist/types/withdraw/steps/withdraw-method.d.ts +7 -0
- package/dist/types/withdraw/withdraw-modal.constants.d.mts +9 -0
- package/dist/types/withdraw/withdraw-modal.constants.d.ts +9 -0
- package/dist/{withdraw-modal.d.mts → types/withdraw/withdraw-modal.types.d.mts} +3 -10
- package/dist/{withdraw-modal.d.ts → types/withdraw/withdraw-modal.types.d.ts} +3 -10
- package/package.json +33 -283
- package/dist/badge.d.mts +0 -28
- package/dist/badge.d.ts +0 -28
- package/dist/badge.js +0 -110
- package/dist/badge.mjs +0 -9
- package/dist/button.d.mts +0 -20
- package/dist/button.d.ts +0 -20
- package/dist/button.js +0 -183
- package/dist/button.mjs +0 -8
- package/dist/card.d.mts +0 -10
- package/dist/card.d.ts +0 -10
- package/dist/card.js +0 -88
- package/dist/card.mjs +0 -7
- package/dist/chart.mjs +0 -8
- package/dist/chunk-34IRJYSU.mjs +0 -146
- package/dist/chunk-3QLOUBDJ.mjs +0 -483
- package/dist/chunk-3W7NBJLU.mjs +0 -371
- package/dist/chunk-4343LYSH.mjs +0 -45
- package/dist/chunk-4S3I6X7F.mjs +0 -855
- package/dist/chunk-4VUDTWH7.mjs +0 -42
- package/dist/chunk-6JG6I5AY.mjs +0 -654
- package/dist/chunk-BNDFQPHF.mjs +0 -9
- package/dist/chunk-CTYJVVHJ.mjs +0 -334
- package/dist/chunk-DHBHKIJR.mjs +0 -1049
- package/dist/chunk-ERGNR6UQ.mjs +0 -67
- package/dist/chunk-FO263M3V.mjs +0 -10
- package/dist/chunk-FO2QCB4Z.mjs +0 -35
- package/dist/chunk-GFBF2J3Y.mjs +0 -328
- package/dist/chunk-GJ4U5NCE.mjs +0 -134
- package/dist/chunk-K6IJ4WBM.mjs +0 -67
- package/dist/chunk-KAGYJ4XT.mjs +0 -126
- package/dist/chunk-KIYMVWL4.mjs +0 -280
- package/dist/chunk-LCZKSITC.mjs +0 -162
- package/dist/chunk-M4RJHRFT.mjs +0 -445
- package/dist/chunk-MJHKBCXQ.mjs +0 -379
- package/dist/chunk-MKVGQ7AS.mjs +0 -168
- package/dist/chunk-NDG43KGL.mjs +0 -44
- package/dist/chunk-NH2G3POM.mjs +0 -470
- package/dist/chunk-OBCHURW5.mjs +0 -64
- package/dist/chunk-OJVTGNIF.mjs +0 -230
- package/dist/chunk-PORVP72S.mjs +0 -277
- package/dist/chunk-Q6DGDBPV.mjs +0 -774
- package/dist/chunk-QLMVKLNJ.mjs +0 -669
- package/dist/chunk-S3H63TQ5.mjs +0 -537
- package/dist/chunk-T7TATHPD.mjs +0 -313
- package/dist/chunk-XUCS575S.mjs +0 -65
- package/dist/chunk-ZFMCCBP6.mjs +0 -25
- package/dist/connect-button.mjs +0 -14
- package/dist/deposit-modal.mjs +0 -15
- package/dist/event-list-item-details.d.mts +0 -11
- package/dist/event-list-item-details.d.ts +0 -11
- package/dist/event-list-item-details.js +0 -3711
- package/dist/event-list-item-details.mjs +0 -23
- package/dist/event-list-item-details.types-CMbXOrT-.d.ts +0 -53
- package/dist/event-list-item-details.types-DekJKeMD.d.mts +0 -53
- package/dist/event-list-item.d.mts +0 -10
- package/dist/event-list-item.d.ts +0 -10
- package/dist/event-list-item.js +0 -2821
- package/dist/event-list-item.mjs +0 -20
- package/dist/event-list-item.types-Y6IeJ4e4.d.mts +0 -46
- package/dist/event-list-item.types-Y6IeJ4e4.d.ts +0 -46
- package/dist/event-list.d.mts +0 -9
- package/dist/event-list.d.ts +0 -9
- package/dist/event-list.mjs +0 -23
- package/dist/event-list.types-CkAAUqwW.d.mts +0 -13
- package/dist/event-list.types-CkAAUqwW.d.ts +0 -13
- package/dist/event-market-page.d.mts +0 -52
- package/dist/event-market-page.d.ts +0 -52
- package/dist/event-market-page.mjs +0 -30
- package/dist/hello-world.d.mts +0 -8
- package/dist/hello-world.d.ts +0 -8
- package/dist/hello-world.js +0 -92
- package/dist/hello-world.mjs +0 -8
- package/dist/home-page.mjs +0 -24
- package/dist/icon.d.mts +0 -193
- package/dist/icon.d.ts +0 -193
- package/dist/icon.js +0 -1465
- package/dist/loading-icon.d.mts +0 -14
- package/dist/loading-icon.d.ts +0 -14
- package/dist/loading-icon.js +0 -112
- package/dist/loading-icon.mjs +0 -8
- package/dist/market-details.d.mts +0 -73
- package/dist/market-details.d.ts +0 -73
- package/dist/market-details.mjs +0 -24
- package/dist/modal.d.mts +0 -66
- package/dist/modal.d.ts +0 -66
- package/dist/modal.js +0 -321
- package/dist/modal.mjs +0 -9
- package/dist/number-value.js +0 -67
- package/dist/number-value.mjs +0 -7
- package/dist/onboarding-modal.d.mts +0 -88
- package/dist/onboarding-modal.d.ts +0 -88
- package/dist/onboarding-modal.js +0 -2836
- package/dist/onboarding-modal.mjs +0 -24
- package/dist/place-order.js +0 -3248
- package/dist/place-order.mjs +0 -18
- package/dist/profile-modal.js +0 -2447
- package/dist/profile-modal.mjs +0 -14
- package/dist/registry-DfSCFAdC.d.mts +0 -178
- package/dist/registry-DfSCFAdC.d.ts +0 -178
- package/dist/search.d.mts +0 -51
- package/dist/search.d.ts +0 -51
- package/dist/search.js +0 -1957
- package/dist/search.mjs +0 -13
- package/dist/select.js +0 -1552
- package/dist/select.mjs +0 -11
- package/dist/settlement.js +0 -2445
- package/dist/settlement.mjs +0 -15
- package/dist/skeleton.js +0 -490
- package/dist/skeleton.mjs +0 -10
- package/dist/state-message.js +0 -1629
- package/dist/state-message.mjs +0 -14
- package/dist/switch-button.js +0 -191
- package/dist/switch-button.mjs +0 -7
- package/dist/tabs.d.mts +0 -31
- package/dist/tabs.d.ts +0 -31
- package/dist/tabs.js +0 -2078
- package/dist/tabs.mjs +0 -12
- package/dist/types-BVj9ky9P.d.mts +0 -3
- package/dist/types-BVj9ky9P.d.ts +0 -3
- package/dist/typography.d.mts +0 -18
- package/dist/typography.d.ts +0 -18
- package/dist/typography.js +0 -93
- package/dist/typography.mjs +0 -9
- package/dist/user-profile-page.js +0 -3081
- package/dist/user-profile-page.mjs +0 -15
- package/dist/venue-logo.d.mts +0 -13
- package/dist/venue-logo.d.ts +0 -13
- package/dist/venue-logo.js +0 -323
- package/dist/venue-logo.mjs +0 -10
- package/dist/venue-logo.types-CGUc22ly.d.mts +0 -19
- package/dist/venue-logo.types-Dqr39S1-.d.ts +0 -19
- package/dist/withdraw-modal.js +0 -2449
- package/dist/withdraw-modal.mjs +0 -14
|
@@ -56,17 +56,116 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
56
56
|
));
|
|
57
57
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
58
|
|
|
59
|
-
// src/
|
|
60
|
-
var
|
|
61
|
-
__export(
|
|
62
|
-
|
|
59
|
+
// src/trading/index.ts
|
|
60
|
+
var trading_exports = {};
|
|
61
|
+
__export(trading_exports, {
|
|
62
|
+
PlaceOrder: () => PlaceOrder,
|
|
63
|
+
Settlement: () => Settlement,
|
|
64
|
+
defaultSettlementDifferencesTitle: () => defaultSettlementDifferencesTitle,
|
|
65
|
+
defaultSettlementSectionLabel: () => defaultSettlementSectionLabel,
|
|
66
|
+
defaultTradingDisclaimer: () => defaultTradingDisclaimer,
|
|
67
|
+
getTradingAveragePriceLabel: () => getTradingAveragePriceLabel,
|
|
68
|
+
getTradingBalanceLabel: () => getTradingBalanceLabel,
|
|
69
|
+
getTradingDateLabel: () => getTradingDateLabel,
|
|
70
|
+
getTradingPriceLabel: () => getTradingPriceLabel,
|
|
71
|
+
getTradingSharesLabel: () => getTradingSharesLabel,
|
|
72
|
+
getTradingSlippageLabel: () => getTradingSlippageLabel,
|
|
73
|
+
getTradingValueLabel: () => getTradingValueLabel,
|
|
74
|
+
getTradingVenueLabel: () => getTradingVenueLabel,
|
|
75
|
+
placeOrderMetricSchema: () => placeOrderMetricSchema,
|
|
76
|
+
placeOrderOutcomeSchema: () => placeOrderOutcomeSchema,
|
|
77
|
+
placeOrderResultSchema: () => placeOrderResultSchema,
|
|
78
|
+
placeOrderResultToneSchema: () => placeOrderResultToneSchema,
|
|
79
|
+
placeOrderRoutingRowSchema: () => placeOrderRoutingRowSchema,
|
|
80
|
+
placeOrderRoutingSchema: () => placeOrderRoutingSchema,
|
|
81
|
+
placeOrderRoutingToneSchema: () => placeOrderRoutingToneSchema,
|
|
82
|
+
placeOrderStatusPlacementSchema: () => placeOrderStatusPlacementSchema,
|
|
83
|
+
placeOrderStatusSchema: () => placeOrderStatusSchema,
|
|
84
|
+
placeOrderStatusToneSchema: () => placeOrderStatusToneSchema,
|
|
85
|
+
placeOrderTabSchema: () => placeOrderTabSchema,
|
|
86
|
+
placeOrderViewModelSchema: () => placeOrderViewModelSchema,
|
|
87
|
+
settlementVenueSchema: () => settlementVenueSchema,
|
|
88
|
+
settlementViewModelSchema: () => settlementViewModelSchema,
|
|
89
|
+
tradingVenueSchema: () => tradingVenueSchema
|
|
90
|
+
});
|
|
91
|
+
module.exports = __toCommonJS(trading_exports);
|
|
92
|
+
|
|
93
|
+
// src/trading/types.ts
|
|
94
|
+
var import_zod = require("zod");
|
|
95
|
+
var tradingVenueSchema = import_zod.z.enum(["polymarket", "kalshi", "opinion", "probable"]);
|
|
96
|
+
var settlementVenueSchema = import_zod.z.object({
|
|
97
|
+
venue: tradingVenueSchema,
|
|
98
|
+
label: import_zod.z.string().optional(),
|
|
99
|
+
description: import_zod.z.string().min(1),
|
|
100
|
+
showMoreLabel: import_zod.z.string().optional()
|
|
101
|
+
});
|
|
102
|
+
var settlementViewModelSchema = import_zod.z.object({
|
|
103
|
+
sectionLabel: import_zod.z.string().min(1),
|
|
104
|
+
question: import_zod.z.string().min(1),
|
|
105
|
+
differencesTitle: import_zod.z.string().min(1),
|
|
106
|
+
differences: import_zod.z.array(import_zod.z.string().min(1)).min(1),
|
|
107
|
+
venues: import_zod.z.array(settlementVenueSchema).min(1),
|
|
108
|
+
defaultExpandedVenue: tradingVenueSchema.nullable().optional()
|
|
109
|
+
});
|
|
110
|
+
var placeOrderTabSchema = import_zod.z.enum(["buy", "sell"]);
|
|
111
|
+
var placeOrderStatusToneSchema = import_zod.z.enum(["warning", "error"]);
|
|
112
|
+
var placeOrderStatusPlacementSchema = import_zod.z.enum(["above-action", "below-action"]);
|
|
113
|
+
var placeOrderRoutingToneSchema = import_zod.z.enum(["default", "highlighted"]);
|
|
114
|
+
var placeOrderResultToneSchema = import_zod.z.enum(["default", "success"]);
|
|
115
|
+
var placeOrderOutcomeSchema = import_zod.z.object({
|
|
116
|
+
id: import_zod.z.string().min(1),
|
|
117
|
+
label: import_zod.z.string().min(1),
|
|
118
|
+
priceLabel: import_zod.z.string().min(1)
|
|
119
|
+
});
|
|
120
|
+
var placeOrderMetricSchema = import_zod.z.object({
|
|
121
|
+
label: import_zod.z.string().min(1),
|
|
122
|
+
hint: import_zod.z.string().min(1),
|
|
123
|
+
value: import_zod.z.string().min(1)
|
|
124
|
+
});
|
|
125
|
+
var placeOrderRoutingRowSchema = import_zod.z.object({
|
|
126
|
+
venue: tradingVenueSchema,
|
|
127
|
+
label: import_zod.z.string().min(1),
|
|
128
|
+
priceLabel: import_zod.z.string().min(1)
|
|
129
|
+
});
|
|
130
|
+
var placeOrderRoutingSchema = import_zod.z.object({
|
|
131
|
+
tone: placeOrderRoutingToneSchema,
|
|
132
|
+
rows: import_zod.z.array(placeOrderRoutingRowSchema).min(1),
|
|
133
|
+
helperLabel: import_zod.z.string().min(1),
|
|
134
|
+
highlightLabel: import_zod.z.string().optional()
|
|
135
|
+
});
|
|
136
|
+
var placeOrderResultSchema = import_zod.z.object({
|
|
137
|
+
label: import_zod.z.string().min(1),
|
|
138
|
+
hint: import_zod.z.string().min(1),
|
|
139
|
+
value: import_zod.z.string().min(1),
|
|
140
|
+
tone: placeOrderResultToneSchema
|
|
141
|
+
});
|
|
142
|
+
var placeOrderStatusSchema = import_zod.z.object({
|
|
143
|
+
tone: placeOrderStatusToneSchema,
|
|
144
|
+
message: import_zod.z.string().min(1),
|
|
145
|
+
actionLabel: import_zod.z.string().optional(),
|
|
146
|
+
placement: placeOrderStatusPlacementSchema
|
|
147
|
+
});
|
|
148
|
+
var placeOrderViewModelSchema = import_zod.z.object({
|
|
149
|
+
title: import_zod.z.string().min(1),
|
|
150
|
+
marketDate: import_zod.z.union([import_zod.z.string(), import_zod.z.date()]),
|
|
151
|
+
marketImageUrl: import_zod.z.string().url().optional(),
|
|
152
|
+
activeTab: placeOrderTabSchema,
|
|
153
|
+
buyLabel: import_zod.z.string().min(1),
|
|
154
|
+
sellLabel: import_zod.z.string().min(1),
|
|
155
|
+
outcomes: import_zod.z.array(placeOrderOutcomeSchema).min(2),
|
|
156
|
+
selectedOutcomeId: import_zod.z.string().min(1),
|
|
157
|
+
primaryMetric: placeOrderMetricSchema,
|
|
158
|
+
routing: placeOrderRoutingSchema,
|
|
159
|
+
result: placeOrderResultSchema,
|
|
160
|
+
actionLabel: import_zod.z.string().min(1),
|
|
161
|
+
disclaimer: import_zod.z.string().min(1),
|
|
162
|
+
isDismissible: import_zod.z.boolean().optional(),
|
|
163
|
+
status: placeOrderStatusSchema.optional()
|
|
63
164
|
});
|
|
64
|
-
module.exports = __toCommonJS(list_exports);
|
|
65
|
-
var import_react4 = require("react");
|
|
66
|
-
var import_hooks14 = require("@agg-market/hooks");
|
|
67
165
|
|
|
68
|
-
// src/
|
|
166
|
+
// src/trading/utils.ts
|
|
69
167
|
var import_hooks = require("@agg-market/hooks");
|
|
168
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
70
169
|
|
|
71
170
|
// src/shared/utils.ts
|
|
72
171
|
var cn = (...values) => values.filter(Boolean).join(" ");
|
|
@@ -78,22 +177,72 @@ var getMotionClassName = (enabled, ...values) => {
|
|
|
78
177
|
var getScrollBehavior = (enabled) => {
|
|
79
178
|
return enabled ? "smooth" : "auto";
|
|
80
179
|
};
|
|
81
|
-
var
|
|
82
|
-
if (!value)
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
180
|
+
var formatUsd = (value) => {
|
|
181
|
+
if (!Number.isFinite(value))
|
|
182
|
+
return "$0";
|
|
183
|
+
return value.toLocaleString("en-US", {
|
|
184
|
+
style: "currency",
|
|
185
|
+
currency: "USD",
|
|
186
|
+
minimumFractionDigits: 0,
|
|
187
|
+
maximumFractionDigits: 2
|
|
188
|
+
});
|
|
90
189
|
};
|
|
91
190
|
|
|
191
|
+
// src/trading/utils.ts
|
|
192
|
+
var defaultLabels = (0, import_hooks.resolveAggUiLabels)("en-US");
|
|
193
|
+
var defaultSettlementSectionLabel = defaultLabels.trading.settlementSection;
|
|
194
|
+
var defaultSettlementDifferencesTitle = defaultLabels.trading.settlementDifferencesTitle;
|
|
195
|
+
var defaultTradingDisclaimer = defaultLabels.trading.disclaimer;
|
|
196
|
+
var getTradingDateLabel = (value) => {
|
|
197
|
+
const parsedValue = (0, import_dayjs.default)(value);
|
|
198
|
+
if (!parsedValue.isValid()) {
|
|
199
|
+
return typeof value === "string" ? value : "";
|
|
200
|
+
}
|
|
201
|
+
return parsedValue.format("MMM D, YYYY");
|
|
202
|
+
};
|
|
203
|
+
var getTradingVenueLabel = (venue, label) => {
|
|
204
|
+
if (label)
|
|
205
|
+
return label;
|
|
206
|
+
return defaultLabels.venues[venue];
|
|
207
|
+
};
|
|
208
|
+
var getTradingValueLabel = ({
|
|
209
|
+
amount,
|
|
210
|
+
minimumFractionDigits = 0,
|
|
211
|
+
maximumFractionDigits = 2
|
|
212
|
+
}) => {
|
|
213
|
+
return amount.toLocaleString("en-US", {
|
|
214
|
+
style: "currency",
|
|
215
|
+
currency: "USD",
|
|
216
|
+
minimumFractionDigits,
|
|
217
|
+
maximumFractionDigits
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
var getTradingPriceLabel = (value) => {
|
|
221
|
+
return `${Math.round(value * 100)}\xA2`;
|
|
222
|
+
};
|
|
223
|
+
var getTradingAveragePriceLabel = (value) => {
|
|
224
|
+
return defaultLabels.trading.averagePrice(value);
|
|
225
|
+
};
|
|
226
|
+
var getTradingBalanceLabel = (value) => {
|
|
227
|
+
return defaultLabels.trading.balance(formatUsd(value));
|
|
228
|
+
};
|
|
229
|
+
var getTradingSharesLabel = (value) => {
|
|
230
|
+
return defaultLabels.trading.shares(value);
|
|
231
|
+
};
|
|
232
|
+
var getTradingSlippageLabel = (value) => {
|
|
233
|
+
return defaultLabels.trading.slippage(value);
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// src/trading/settlement/index.tsx
|
|
237
|
+
var import_react = require("react");
|
|
238
|
+
var import_hooks10 = require("@agg-market/hooks");
|
|
239
|
+
|
|
92
240
|
// src/primitives/card/index.tsx
|
|
241
|
+
var import_hooks2 = require("@agg-market/hooks");
|
|
93
242
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
94
243
|
var Card = (_a) => {
|
|
95
244
|
var _b = _a, { className, onClick } = _b, props = __objRest(_b, ["className", "onClick"]);
|
|
96
|
-
const { enableAnimations } = (0,
|
|
245
|
+
const { enableAnimations } = (0, import_hooks2.useSdkUiConfig)();
|
|
97
246
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
98
247
|
"div",
|
|
99
248
|
__spreadValues(__spreadValues({
|
|
@@ -1444,13 +1593,13 @@ var Icon = (_a) => {
|
|
|
1444
1593
|
Icon.displayName = "Icon";
|
|
1445
1594
|
|
|
1446
1595
|
// src/primitives/skeleton/views/event-list-skeleton-view.tsx
|
|
1447
|
-
var
|
|
1596
|
+
var import_hooks5 = require("@agg-market/hooks");
|
|
1448
1597
|
|
|
1449
1598
|
// src/primitives/skeleton/skeleton-block.tsx
|
|
1450
|
-
var
|
|
1599
|
+
var import_hooks3 = require("@agg-market/hooks");
|
|
1451
1600
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1452
1601
|
var SkeletonBlock = ({ className }) => {
|
|
1453
|
-
const { enableAnimations } = (0,
|
|
1602
|
+
const { enableAnimations } = (0, import_hooks3.useSdkUiConfig)();
|
|
1454
1603
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1455
1604
|
"div",
|
|
1456
1605
|
{
|
|
@@ -1466,7 +1615,7 @@ var SkeletonBlock = ({ className }) => {
|
|
|
1466
1615
|
SkeletonBlock.displayName = "SkeletonBlock";
|
|
1467
1616
|
|
|
1468
1617
|
// src/primitives/skeleton/views/event-list-item-skeleton-view.tsx
|
|
1469
|
-
var
|
|
1618
|
+
var import_hooks4 = require("@agg-market/hooks");
|
|
1470
1619
|
|
|
1471
1620
|
// src/events/item/event-list-item.constants.ts
|
|
1472
1621
|
var baseCardClassName = "gap-3 overflow-hidden p-5 w-full";
|
|
@@ -1478,7 +1627,7 @@ var EventListItemSkeletonView = ({
|
|
|
1478
1627
|
ariaLabel,
|
|
1479
1628
|
isStandalone = false
|
|
1480
1629
|
}) => {
|
|
1481
|
-
const labels = (0,
|
|
1630
|
+
const labels = (0, import_hooks4.useLabels)();
|
|
1482
1631
|
const outcomeTitleWidths = ["w-40", "w-[200px]"];
|
|
1483
1632
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
1484
1633
|
Card,
|
|
@@ -1516,7 +1665,7 @@ EventListItemSkeletonView.displayName = "EventListItemSkeletonView";
|
|
|
1516
1665
|
// src/primitives/skeleton/views/event-list-skeleton-view.tsx
|
|
1517
1666
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1518
1667
|
var EventListSkeletonView = ({ className, ariaLabel }) => {
|
|
1519
|
-
const labels = (0,
|
|
1668
|
+
const labels = (0, import_hooks5.useLabels)();
|
|
1520
1669
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
1521
1670
|
"section",
|
|
1522
1671
|
{
|
|
@@ -1544,7 +1693,7 @@ var EventListSkeletonView = ({ className, ariaLabel }) => {
|
|
|
1544
1693
|
EventListSkeletonView.displayName = "EventListSkeletonView";
|
|
1545
1694
|
|
|
1546
1695
|
// src/primitives/skeleton/views/event-list-item-details-skeleton-view.tsx
|
|
1547
|
-
var
|
|
1696
|
+
var import_hooks6 = require("@agg-market/hooks");
|
|
1548
1697
|
|
|
1549
1698
|
// src/events/item-details/event-list-item-details.constants.ts
|
|
1550
1699
|
var detailsBaseCardClassName = "w-full overflow-hidden gap-6 p-5 md:gap-8 md:p-10";
|
|
@@ -1555,7 +1704,7 @@ var EventListItemDetailsSkeletonView = ({
|
|
|
1555
1704
|
className,
|
|
1556
1705
|
ariaLabel
|
|
1557
1706
|
}) => {
|
|
1558
|
-
const labels = (0,
|
|
1707
|
+
const labels = (0, import_hooks6.useLabels)();
|
|
1559
1708
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
1560
1709
|
Card,
|
|
1561
1710
|
{
|
|
@@ -1592,7 +1741,7 @@ var EventListItemDetailsSkeletonView = ({
|
|
|
1592
1741
|
EventListItemDetailsSkeletonView.displayName = "EventListItemDetailsSkeletonView";
|
|
1593
1742
|
|
|
1594
1743
|
// src/primitives/skeleton/views/market-details-skeleton-view.tsx
|
|
1595
|
-
var
|
|
1744
|
+
var import_hooks7 = require("@agg-market/hooks");
|
|
1596
1745
|
|
|
1597
1746
|
// src/events/market-details/market-details.constants.ts
|
|
1598
1747
|
var marketDetailsBaseCardClassName = "w-full overflow-hidden rounded-agg-lg border border-agg-separator bg-agg-secondary text-agg-foreground shadow-none hover:shadow-none";
|
|
@@ -1675,7 +1824,7 @@ var MarketDetailsSkeletonView = ({
|
|
|
1675
1824
|
ariaLabel,
|
|
1676
1825
|
isDetailed
|
|
1677
1826
|
}) => {
|
|
1678
|
-
const labels = (0,
|
|
1827
|
+
const labels = (0, import_hooks7.useLabels)();
|
|
1679
1828
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
1680
1829
|
Card,
|
|
1681
1830
|
{
|
|
@@ -1760,13 +1909,13 @@ var PlaceOrderSkeletonView = ({
|
|
|
1760
1909
|
PlaceOrderSkeletonView.displayName = "PlaceOrderSkeletonView";
|
|
1761
1910
|
|
|
1762
1911
|
// src/primitives/skeleton/views/settlement-skeleton-view.tsx
|
|
1763
|
-
var
|
|
1912
|
+
var import_hooks8 = require("@agg-market/hooks");
|
|
1764
1913
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
1765
1914
|
var SettlementSkeletonView = ({
|
|
1766
1915
|
className,
|
|
1767
1916
|
ariaLabel
|
|
1768
1917
|
}) => {
|
|
1769
|
-
const labels = (0,
|
|
1918
|
+
const labels = (0, import_hooks8.useLabels)();
|
|
1770
1919
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
1771
1920
|
Card,
|
|
1772
1921
|
{
|
|
@@ -1843,324 +1992,804 @@ var Skeleton = ({ view, className, ariaLabel }) => {
|
|
|
1843
1992
|
};
|
|
1844
1993
|
Skeleton.displayName = "Skeleton";
|
|
1845
1994
|
|
|
1846
|
-
// src/primitives/
|
|
1847
|
-
var
|
|
1995
|
+
// src/primitives/venue-logo/index.tsx
|
|
1996
|
+
var import_hooks9 = require("@agg-market/hooks");
|
|
1848
1997
|
|
|
1849
|
-
// src/primitives/
|
|
1850
|
-
var
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
small: "[&_svg]:h-4 [&_svg]:w-4",
|
|
1862
|
-
medium: "[&_svg]:h-4 [&_svg]:w-4",
|
|
1863
|
-
large: "[&_svg]:h-4 [&_svg]:w-4"
|
|
1864
|
-
};
|
|
1865
|
-
var variantClasses = {
|
|
1866
|
-
primary: cn(
|
|
1867
|
-
"bg-agg-primary text-agg-on-primary",
|
|
1868
|
-
"hover:bg-agg-primary-hover",
|
|
1869
|
-
"disabled:bg-agg-separator disabled:text-agg-on-primary",
|
|
1870
|
-
"focus-visible:ring-agg-primary-hover"
|
|
1871
|
-
),
|
|
1872
|
-
secondary: cn(
|
|
1873
|
-
"border border-agg-separator bg-agg-secondary text-agg-foreground",
|
|
1874
|
-
"hover:bg-agg-secondary-hover",
|
|
1875
|
-
"disabled:bg-agg-secondary disabled:text-agg-muted-foreground disabled:border-agg-separator",
|
|
1876
|
-
"focus-visible:ring-agg-separator"
|
|
1877
|
-
),
|
|
1878
|
-
tertiary: cn(
|
|
1879
|
-
"bg-transparent text-agg-primary",
|
|
1880
|
-
"hover:text-agg-primary-hover",
|
|
1881
|
-
"disabled:bg-transparent disabled:text-agg-muted-foreground",
|
|
1882
|
-
"focus-visible:ring-agg-separator",
|
|
1883
|
-
"px-0! py-0! h-fit!"
|
|
1884
|
-
)
|
|
1998
|
+
// src/primitives/venue-logo/logo-props.ts
|
|
1999
|
+
var DEFAULT_MONOCHROME_COLOR = "currentColor";
|
|
2000
|
+
var resolveLogoPrimaryColor = ({
|
|
2001
|
+
brandColor,
|
|
2002
|
+
isColor = true,
|
|
2003
|
+
color
|
|
2004
|
+
}) => {
|
|
2005
|
+
if (typeof color === "string" && color.trim())
|
|
2006
|
+
return color;
|
|
2007
|
+
if (!isColor)
|
|
2008
|
+
return DEFAULT_MONOCHROME_COLOR;
|
|
2009
|
+
return brandColor;
|
|
1885
2010
|
};
|
|
1886
|
-
var baseButtonClasses = cn(
|
|
1887
|
-
"cursor-pointer disabled:cursor-not-allowed",
|
|
1888
|
-
"inline-flex items-center justify-center rounded-agg-full font-agg-sans font-agg-bold text-center",
|
|
1889
|
-
"whitespace-nowrap",
|
|
1890
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary"
|
|
1891
|
-
);
|
|
1892
2011
|
|
|
1893
|
-
// src/primitives/
|
|
2012
|
+
// src/primitives/venue-logo/svg/logo-kalshi.tsx
|
|
1894
2013
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
1895
|
-
var
|
|
2014
|
+
var KALSHI_GREEN = "#18C590";
|
|
2015
|
+
var LogoKalshiIcon = (_a) => {
|
|
1896
2016
|
var _b = _a, {
|
|
1897
|
-
|
|
1898
|
-
variant = "primary",
|
|
1899
|
-
size = "medium",
|
|
1900
|
-
isLoading = false,
|
|
1901
|
-
disabled,
|
|
1902
|
-
prefix,
|
|
1903
|
-
suffix,
|
|
1904
|
-
type = "button",
|
|
2017
|
+
title,
|
|
1905
2018
|
className,
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
"
|
|
1910
|
-
"size",
|
|
1911
|
-
"isLoading",
|
|
1912
|
-
"disabled",
|
|
1913
|
-
"prefix",
|
|
1914
|
-
"suffix",
|
|
1915
|
-
"type",
|
|
2019
|
+
isColor = true,
|
|
2020
|
+
color
|
|
2021
|
+
} = _b, props = __objRest(_b, [
|
|
2022
|
+
"title",
|
|
1916
2023
|
"className",
|
|
1917
|
-
"
|
|
2024
|
+
"isColor",
|
|
2025
|
+
"color"
|
|
1918
2026
|
]);
|
|
1919
|
-
const
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
className: cn(
|
|
1942
|
-
"inline-block rounded-agg-full border-2 border-current border-r-transparent",
|
|
1943
|
-
getMotionClassName(enableAnimations, "animate-spin"),
|
|
1944
|
-
iconSizeClasses2[size]
|
|
1945
|
-
),
|
|
1946
|
-
"aria-hidden": "true"
|
|
1947
|
-
}
|
|
1948
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
1949
|
-
prefix != null ? prefix : null,
|
|
1950
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children }),
|
|
1951
|
-
suffix != null ? suffix : null
|
|
1952
|
-
] })
|
|
2027
|
+
const primaryColor = resolveLogoPrimaryColor({
|
|
2028
|
+
brandColor: KALSHI_GREEN,
|
|
2029
|
+
isColor,
|
|
2030
|
+
color
|
|
2031
|
+
});
|
|
2032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
2033
|
+
"svg",
|
|
2034
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
2035
|
+
viewBox: "0 0 100 100",
|
|
2036
|
+
className,
|
|
2037
|
+
fill: "none"
|
|
2038
|
+
}, getIconA11yProps(title)), props), {
|
|
2039
|
+
children: [
|
|
2040
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("title", { children: title }) : null,
|
|
2041
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2042
|
+
"path",
|
|
2043
|
+
{
|
|
2044
|
+
d: "M54.9798 47.579L79.4249 85.9995H58.2273L38.2531 52.9344V85.9995H20.4189V13.9995H38.2531V45.4356L59.6547 13.9995H78.7119L54.9798 47.579Z",
|
|
2045
|
+
fill: primaryColor
|
|
2046
|
+
}
|
|
2047
|
+
)
|
|
2048
|
+
]
|
|
1953
2049
|
})
|
|
1954
2050
|
);
|
|
1955
2051
|
};
|
|
1956
|
-
|
|
2052
|
+
LogoKalshiIcon.displayName = "LogoKalshiIcon";
|
|
1957
2053
|
|
|
1958
|
-
// src/primitives/
|
|
2054
|
+
// src/primitives/venue-logo/svg/logo-opinion.tsx
|
|
1959
2055
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
1960
|
-
var
|
|
1961
|
-
|
|
2056
|
+
var OPINION_BLACK = "#000000";
|
|
2057
|
+
var LogoOpinionIcon = (_a) => {
|
|
2058
|
+
var _b = _a, {
|
|
2059
|
+
title,
|
|
2060
|
+
className,
|
|
2061
|
+
isColor = true,
|
|
2062
|
+
color
|
|
2063
|
+
} = _b, props = __objRest(_b, [
|
|
2064
|
+
"title",
|
|
2065
|
+
"className",
|
|
2066
|
+
"isColor",
|
|
2067
|
+
"color"
|
|
2068
|
+
]);
|
|
2069
|
+
const primaryColor = resolveLogoPrimaryColor({
|
|
2070
|
+
brandColor: OPINION_BLACK,
|
|
2071
|
+
isColor,
|
|
2072
|
+
color
|
|
2073
|
+
});
|
|
1962
2074
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
1963
2075
|
"svg",
|
|
1964
2076
|
__spreadProps(__spreadValues(__spreadValues({
|
|
1965
|
-
viewBox: "0 0
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
className
|
|
2077
|
+
viewBox: "0 0 100 100",
|
|
2078
|
+
className,
|
|
2079
|
+
fill: "none"
|
|
1969
2080
|
}, getIconA11yProps(title)), props), {
|
|
1970
2081
|
children: [
|
|
1971
2082
|
title ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("title", { children: title }) : null,
|
|
1972
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "19.9987", cy: "20.0013", r: "9.2", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
1973
2083
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
1974
|
-
"
|
|
2084
|
+
"path",
|
|
1975
2085
|
{
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
rx: "17.2",
|
|
1979
|
-
ry: "6.6",
|
|
1980
|
-
transform: "rotate(-35 19.9987 20.0012)",
|
|
1981
|
-
stroke: "currentColor",
|
|
1982
|
-
strokeWidth: "1.6"
|
|
2086
|
+
d: "M51.8239 68.4603L56.9659 68.0094L58.8049 89.0576C61.1459 88.5314 63.4349 87.7952 65.6437 86.8578V68.1879H71.9955V83.4385C74.6496 81.6828 77.0863 79.619 79.2548 77.2898L80.0716 67.958L85.516 68.433C88.6185 62.4381 90.156 55.7558 89.9858 49.0072C89.8154 42.2584 87.9429 35.6623 84.542 29.8316L84.3394 32.1494L77.9876 31.5927L78.8042 22.2668C76.7468 20.1288 74.4594 18.225 71.9835 16.5902V31.9164H65.6317V13.1739C62.9224 12.0205 60.0929 11.173 57.1957 10.6473L59.0317 31.6441L53.8897 32.0949L51.9599 10.0482C51.3128 10.0179 50.6593 9.99976 50.006 9.99976C47.4581 9.99976 44.9161 10.2419 42.414 10.723L46.0438 31.3899L42.1297 32.0798L38.5304 11.6701C35.1755 12.6725 31.9677 14.1143 28.9905 15.9578L33.0435 31.0873L29.9705 31.9134L26.2018 17.8369C23.2938 19.9923 20.6902 22.5308 18.4615 25.3835L20.4246 30.7787L18.1833 31.5956L16.7707 27.7134C14.5111 31.0771 12.7772 34.7657 11.6287 38.652L12.2639 38.4221L20.4306 60.8471L18.1893 61.6641L10.8877 41.5963C9.21542 49.4012 9.91256 57.528 12.8896 64.9338C15.8667 72.3395 20.9879 78.6865 27.5961 83.1601L23.8031 68.9989L26.8762 68.1728L31.5162 85.4991C34.6952 87.1593 38.0844 88.3808 41.5914 89.1303L38.0132 68.7296L41.9301 68.0397L45.7684 89.8262C47.1811 89.9757 48.6007 90.0505 50.0212 90.0502C51.2583 90.0502 52.4863 89.9926 53.6963 89.8807L51.8239 68.4603ZM80.1017 37.8985L86.4385 38.4524L84.3605 62.2299L78.0087 61.6761L80.1017 37.8985ZM65.6528 38.1315H72.0046V61.9969H65.6528V38.1315ZM56.975 37.9501L59.053 61.7277L53.911 62.1785L51.8299 38.4009L56.975 37.9501ZM29.9976 62.003L23.8243 38.9486L26.8974 38.1255L33.0707 61.1649L29.9976 62.003ZM42.157 62.1603L38.0132 38.658L41.9301 37.9683L46.0709 61.4674L42.157 62.1603Z",
|
|
2087
|
+
fill: primaryColor
|
|
1983
2088
|
}
|
|
1984
2089
|
)
|
|
1985
2090
|
]
|
|
1986
2091
|
})
|
|
1987
2092
|
);
|
|
1988
2093
|
};
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
// src/primitives/typography/typography.constants.ts
|
|
1992
|
-
var typographyVariantClasses = {
|
|
1993
|
-
display: cn("agg-type-display"),
|
|
1994
|
-
heading: cn("agg-type-heading"),
|
|
1995
|
-
title: cn("agg-type-title"),
|
|
1996
|
-
"title-strong": cn("agg-type-title-strong"),
|
|
1997
|
-
"body-large": cn("agg-type-body-large"),
|
|
1998
|
-
"body-large-strong": cn("agg-type-body-large-strong"),
|
|
1999
|
-
body: cn("agg-type-body"),
|
|
2000
|
-
"body-strong": cn("agg-type-body-strong"),
|
|
2001
|
-
label: cn("agg-type-label"),
|
|
2002
|
-
"label-strong": cn("agg-type-label-strong"),
|
|
2003
|
-
"label-caps": cn("agg-type-label-caps"),
|
|
2004
|
-
caption: cn("agg-type-caption"),
|
|
2005
|
-
"caption-strong": cn("agg-type-caption-strong"),
|
|
2006
|
-
"caption-caps": cn("agg-type-caption-caps"),
|
|
2007
|
-
overline: cn("agg-type-overline")
|
|
2008
|
-
};
|
|
2009
|
-
|
|
2010
|
-
// src/primitives/typography/index.tsx
|
|
2011
|
-
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2012
|
-
var Typography = ({
|
|
2013
|
-
as: Component = "p",
|
|
2014
|
-
variant = "body",
|
|
2015
|
-
className,
|
|
2016
|
-
children
|
|
2017
|
-
}) => {
|
|
2018
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2019
|
-
Component,
|
|
2020
|
-
{
|
|
2021
|
-
className: cn(
|
|
2022
|
-
"group/agg-typography",
|
|
2023
|
-
"text-agg-foreground",
|
|
2024
|
-
typographyVariantClasses[variant],
|
|
2025
|
-
className
|
|
2026
|
-
),
|
|
2027
|
-
children
|
|
2028
|
-
}
|
|
2029
|
-
);
|
|
2030
|
-
};
|
|
2031
|
-
Typography.displayName = "Typography";
|
|
2032
|
-
|
|
2033
|
-
// src/primitives/state-message/index.tsx
|
|
2034
|
-
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2035
|
-
var iconClassName = "h-9 w-9 text-agg-muted-foreground";
|
|
2036
|
-
var StateMessage = ({
|
|
2037
|
-
ariaLabel,
|
|
2038
|
-
tone = "empty",
|
|
2039
|
-
title,
|
|
2040
|
-
description,
|
|
2041
|
-
actionLabel,
|
|
2042
|
-
onAction,
|
|
2043
|
-
className
|
|
2044
|
-
}) => {
|
|
2045
|
-
const icon = tone === "warning" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(WarningIcon, { className: iconClassName, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SearchEmptyIcon, { className: iconClassName, "aria-hidden": true });
|
|
2046
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2047
|
-
"div",
|
|
2048
|
-
{
|
|
2049
|
-
className: cn(
|
|
2050
|
-
"flex min-h-[240px] w-full flex-col items-center justify-center px-5 py-10 text-center md:px-10",
|
|
2051
|
-
className
|
|
2052
|
-
),
|
|
2053
|
-
role: "status",
|
|
2054
|
-
"aria-live": "polite",
|
|
2055
|
-
"aria-label": ariaLabel,
|
|
2056
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex max-w-[360px] flex-col items-center gap-6", children: [
|
|
2057
|
-
icon,
|
|
2058
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-col items-center gap-2", children: [
|
|
2059
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Typography, { variant: "body-large-strong", children: title }),
|
|
2060
|
-
description ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Typography, { variant: "body", className: "whitespace-pre-line text-agg-muted-foreground", children: description }) : null
|
|
2061
|
-
] }),
|
|
2062
|
-
actionLabel && onAction ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2063
|
-
Button,
|
|
2064
|
-
{
|
|
2065
|
-
variant: "tertiary",
|
|
2066
|
-
size: "large",
|
|
2067
|
-
className: "text-agg-base leading-agg-6",
|
|
2068
|
-
"aria-label": actionLabel,
|
|
2069
|
-
onClick: onAction,
|
|
2070
|
-
children: actionLabel
|
|
2071
|
-
}
|
|
2072
|
-
) : null
|
|
2073
|
-
] })
|
|
2074
|
-
}
|
|
2075
|
-
);
|
|
2076
|
-
};
|
|
2077
|
-
StateMessage.displayName = "StateMessage";
|
|
2094
|
+
LogoOpinionIcon.displayName = "LogoOpinionIcon";
|
|
2078
2095
|
|
|
2079
|
-
// src/primitives/
|
|
2080
|
-
var
|
|
2081
|
-
var
|
|
2096
|
+
// src/primitives/venue-logo/svg/logo-polymarket.tsx
|
|
2097
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2098
|
+
var POLYMARKET_BLUE = "#2E5CFF";
|
|
2099
|
+
var LogoPolymarketIcon = (_a) => {
|
|
2100
|
+
var _b = _a, {
|
|
2101
|
+
title,
|
|
2102
|
+
className,
|
|
2103
|
+
isColor = true,
|
|
2104
|
+
color
|
|
2105
|
+
} = _b, props = __objRest(_b, [
|
|
2106
|
+
"title",
|
|
2107
|
+
"className",
|
|
2108
|
+
"isColor",
|
|
2109
|
+
"color"
|
|
2110
|
+
]);
|
|
2111
|
+
const primaryColor = resolveLogoPrimaryColor({
|
|
2112
|
+
brandColor: POLYMARKET_BLUE,
|
|
2113
|
+
isColor,
|
|
2114
|
+
color
|
|
2115
|
+
});
|
|
2116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
2117
|
+
"svg",
|
|
2118
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
2119
|
+
viewBox: "0 0 100 100",
|
|
2120
|
+
className,
|
|
2121
|
+
fill: "none"
|
|
2122
|
+
}, getIconA11yProps(title)), props), {
|
|
2123
|
+
children: [
|
|
2124
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("title", { children: title }) : null,
|
|
2125
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2126
|
+
"path",
|
|
2127
|
+
{
|
|
2128
|
+
d: "M81.0904 84.2882C81.0904 87.9246 81.0904 89.7428 79.901 90.644C78.7119 91.5456 76.9613 91.0542 73.4603 90.0717L17.1975 74.2838C15.0881 73.6919 14.0332 73.3959 13.4233 72.5913C12.8135 71.7866 12.8135 70.6911 12.8135 68.5002V31.4998C12.8135 29.309 12.8135 28.2134 13.4233 27.4088C14.0332 26.6042 15.0881 26.3081 17.1975 25.7163L73.4603 9.92806C76.9613 8.94572 78.7119 8.45448 79.901 9.35587C81.0904 10.2573 81.0904 12.0755 81.0904 15.7119V84.2882ZM26.8451 69.1363L73.4308 82.2104V56.0637L26.8451 69.1363ZM20.4723 63.0711L67.0487 50L20.4723 36.929V63.0711ZM26.8446 30.8638L73.4308 43.9366V17.7896L26.8446 30.8638Z",
|
|
2129
|
+
fill: primaryColor
|
|
2130
|
+
}
|
|
2131
|
+
)
|
|
2132
|
+
]
|
|
2133
|
+
})
|
|
2134
|
+
);
|
|
2135
|
+
};
|
|
2136
|
+
LogoPolymarketIcon.displayName = "LogoPolymarketIcon";
|
|
2082
2137
|
|
|
2083
|
-
// src/primitives/
|
|
2084
|
-
var
|
|
2085
|
-
var
|
|
2138
|
+
// src/primitives/venue-logo/svg/logo-probable.tsx
|
|
2139
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2140
|
+
var PROBABLE_ORANGE = "#F05923";
|
|
2141
|
+
var LogoProbableIcon = (_a) => {
|
|
2142
|
+
var _b = _a, {
|
|
2143
|
+
title,
|
|
2144
|
+
className,
|
|
2145
|
+
isColor = true,
|
|
2146
|
+
color
|
|
2147
|
+
} = _b, props = __objRest(_b, [
|
|
2148
|
+
"title",
|
|
2149
|
+
"className",
|
|
2150
|
+
"isColor",
|
|
2151
|
+
"color"
|
|
2152
|
+
]);
|
|
2153
|
+
const primaryColor = resolveLogoPrimaryColor({
|
|
2154
|
+
brandColor: PROBABLE_ORANGE,
|
|
2155
|
+
isColor,
|
|
2156
|
+
color
|
|
2157
|
+
});
|
|
2158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
2159
|
+
"svg",
|
|
2160
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
2161
|
+
viewBox: "0 0 100 100",
|
|
2162
|
+
className,
|
|
2163
|
+
fill: "none"
|
|
2164
|
+
}, getIconA11yProps(title)), props), {
|
|
2165
|
+
children: [
|
|
2166
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("title", { children: title }) : null,
|
|
2167
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2168
|
+
"path",
|
|
2169
|
+
{
|
|
2170
|
+
d: "M75.625 59.3489C75.6247 53.7323 71.0719 49.1792 65.4551 49.179H33.9209C28.3039 49.179 23.7503 53.7321 23.75 59.3489C23.75 64.9659 28.3038 69.5198 33.9209 69.5198H65.4551C71.0719 69.5195 75.625 64.9658 75.625 59.3489ZM90.625 59.3489C90.625 73.2501 79.3562 84.5195 65.4551 84.5198H33.9209C20.0196 84.5198 8.75 73.2502 8.75 59.3489C8.75026 45.4477 20.0198 34.179 33.9209 34.179H65.4551C79.3559 34.1792 90.6247 45.4478 90.625 59.3489Z",
|
|
2171
|
+
fill: primaryColor
|
|
2172
|
+
}
|
|
2173
|
+
),
|
|
2174
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("path", { d: "M90.9329 15.4546V30.4546H8.90234V15.4546H90.9329Z", fill: primaryColor }),
|
|
2175
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2176
|
+
"path",
|
|
2177
|
+
{
|
|
2178
|
+
d: "M64.5742 51.3496C68.9894 51.3496 72.5742 54.9344 72.5742 59.3496C72.5742 63.7648 68.9894 67.3496 64.5742 67.3496C60.159 67.3496 56.5742 63.7648 56.5742 59.3496C56.5742 54.9344 60.159 51.3496 64.5742 51.3496Z",
|
|
2179
|
+
fill: primaryColor
|
|
2180
|
+
}
|
|
2181
|
+
)
|
|
2182
|
+
]
|
|
2183
|
+
})
|
|
2184
|
+
);
|
|
2185
|
+
};
|
|
2186
|
+
LogoProbableIcon.displayName = "LogoProbableIcon";
|
|
2187
|
+
|
|
2188
|
+
// src/primitives/venue-logo/venue-logo.constants.ts
|
|
2189
|
+
var venueLogoRegistry = {
|
|
2190
|
+
kalshi: LogoKalshiIcon,
|
|
2191
|
+
polymarket: LogoPolymarketIcon,
|
|
2192
|
+
opinion: LogoOpinionIcon,
|
|
2193
|
+
probable: LogoProbableIcon
|
|
2194
|
+
};
|
|
2195
|
+
var VENUE_LOGO_BASE_URL = "https://assets.snagsolutions.io/public/prediction-markets/logos";
|
|
2196
|
+
var venueLogoUrlRegistry = {
|
|
2197
|
+
kalshi: `${VENUE_LOGO_BASE_URL}/kalshi.png`,
|
|
2198
|
+
polymarket: `${VENUE_LOGO_BASE_URL}/polymarket.png`,
|
|
2199
|
+
opinion: `${VENUE_LOGO_BASE_URL}/opinion.png`,
|
|
2200
|
+
probable: `${VENUE_LOGO_BASE_URL}/probable.png`
|
|
2201
|
+
};
|
|
2202
|
+
var venueLogoNames = Object.keys(venueLogoRegistry);
|
|
2203
|
+
var sizeClasses = {
|
|
2204
|
+
small: "h-4 w-4",
|
|
2205
|
+
medium: "h-6 w-6",
|
|
2206
|
+
large: "h-8 w-8"
|
|
2207
|
+
};
|
|
2208
|
+
|
|
2209
|
+
// src/primitives/venue-logo/index.tsx
|
|
2086
2210
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2087
|
-
var
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2211
|
+
var VenueLogo = ({
|
|
2212
|
+
venue,
|
|
2213
|
+
variant = "icon",
|
|
2214
|
+
isColor = true,
|
|
2215
|
+
isMonochromatic = false,
|
|
2216
|
+
color,
|
|
2217
|
+
size = "medium",
|
|
2092
2218
|
className,
|
|
2093
|
-
|
|
2219
|
+
ariaLabel,
|
|
2220
|
+
title
|
|
2094
2221
|
}) => {
|
|
2095
|
-
var _a;
|
|
2096
2222
|
const labels = (0, import_hooks9.useLabels)();
|
|
2097
|
-
const
|
|
2098
|
-
const
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2223
|
+
const sizeClass = sizeClasses[size];
|
|
2224
|
+
const resolvedLabel = ariaLabel != null ? ariaLabel : labels.venues[venue];
|
|
2225
|
+
if (variant === "logo") {
|
|
2226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
2227
|
+
"img",
|
|
2228
|
+
{
|
|
2229
|
+
src: venueLogoUrlRegistry[venue],
|
|
2230
|
+
alt: resolvedLabel,
|
|
2231
|
+
title,
|
|
2232
|
+
className: cn("shrink-0 rounded-agg-lg object-cover", sizeClass, className)
|
|
2233
|
+
}
|
|
2234
|
+
);
|
|
2235
|
+
}
|
|
2236
|
+
const Component = venueLogoRegistry[venue];
|
|
2237
|
+
const resolvedIsColor = isMonochromatic ? false : isColor;
|
|
2238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
2239
|
+
Component,
|
|
2240
|
+
{
|
|
2241
|
+
className: cn("group/agg-venue-logo", "shrink-0", sizeClass, className),
|
|
2242
|
+
isColor: resolvedIsColor,
|
|
2243
|
+
color,
|
|
2244
|
+
"aria-label": resolvedLabel,
|
|
2245
|
+
title
|
|
2246
|
+
}
|
|
2247
|
+
);
|
|
2248
|
+
};
|
|
2249
|
+
VenueLogo.displayName = "VenueLogo";
|
|
2250
|
+
|
|
2251
|
+
// src/trading/settlement/index.tsx
|
|
2252
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2253
|
+
var getSettlementHeaderClassName = () => {
|
|
2254
|
+
return "flex items-center justify-between gap-4";
|
|
2255
|
+
};
|
|
2256
|
+
var Settlement = ({
|
|
2257
|
+
sectionLabel = defaultSettlementSectionLabel,
|
|
2258
|
+
question,
|
|
2259
|
+
differencesTitle = defaultSettlementDifferencesTitle,
|
|
2260
|
+
differences,
|
|
2261
|
+
venues,
|
|
2262
|
+
defaultExpandedVenue,
|
|
2263
|
+
expandedVenue,
|
|
2264
|
+
isLoading = false,
|
|
2265
|
+
onExpandedVenueChange,
|
|
2266
|
+
onShowMore,
|
|
2267
|
+
className
|
|
2268
|
+
}) => {
|
|
2269
|
+
var _a, _b;
|
|
2270
|
+
const labels = (0, import_hooks10.useLabels)();
|
|
2271
|
+
const { enableAnimations } = (0, import_hooks10.useSdkUiConfig)();
|
|
2272
|
+
const resolvedSectionLabel = sectionLabel === defaultSettlementSectionLabel ? labels.trading.settlementSection : sectionLabel;
|
|
2273
|
+
const resolvedDifferencesTitle = differencesTitle === defaultSettlementDifferencesTitle ? labels.trading.settlementDifferencesTitle : differencesTitle;
|
|
2274
|
+
const [internalExpandedVenue, setInternalExpandedVenue] = (0, import_react.useState)(
|
|
2275
|
+
(_b = defaultExpandedVenue != null ? defaultExpandedVenue : (_a = venues[0]) == null ? void 0 : _a.venue) != null ? _b : null
|
|
2276
|
+
);
|
|
2277
|
+
const [expandedDescriptionByVenue, setExpandedDescriptionByVenue] = (0, import_react.useState)({});
|
|
2278
|
+
const [overflowingDescriptionByVenue, setOverflowingDescriptionByVenue] = (0, import_react.useState)({});
|
|
2279
|
+
const [collapsedDescriptionByVenue, setCollapsedDescriptionByVenue] = (0, import_react.useState)({});
|
|
2280
|
+
const descriptionWrapperRefs = (0, import_react.useRef)(/* @__PURE__ */ new Map());
|
|
2281
|
+
const descriptionMeasureRefs = (0, import_react.useRef)(/* @__PURE__ */ new Map());
|
|
2103
2282
|
(0, import_react.useEffect)(() => {
|
|
2104
|
-
if (
|
|
2283
|
+
if (expandedVenue === void 0)
|
|
2105
2284
|
return;
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2285
|
+
setInternalExpandedVenue(expandedVenue);
|
|
2286
|
+
}, [expandedVenue]);
|
|
2287
|
+
const resolvedExpandedVenue = expandedVenue === void 0 ? internalExpandedVenue : expandedVenue;
|
|
2288
|
+
const handleVenueClick = (venue) => {
|
|
2289
|
+
const nextVenue = resolvedExpandedVenue === venue ? null : venue;
|
|
2290
|
+
if (expandedVenue === void 0) {
|
|
2291
|
+
setInternalExpandedVenue(nextVenue);
|
|
2292
|
+
}
|
|
2293
|
+
onExpandedVenueChange == null ? void 0 : onExpandedVenueChange(nextVenue);
|
|
2294
|
+
};
|
|
2295
|
+
const handleDescriptionWrapperRef = (0, import_react.useCallback)(
|
|
2296
|
+
(venue, element) => {
|
|
2297
|
+
if (!element) {
|
|
2298
|
+
descriptionWrapperRefs.current.delete(venue);
|
|
2299
|
+
return;
|
|
2300
|
+
}
|
|
2301
|
+
descriptionWrapperRefs.current.set(venue, element);
|
|
2302
|
+
},
|
|
2303
|
+
[]
|
|
2304
|
+
);
|
|
2305
|
+
const handleDescriptionMeasureRef = (0, import_react.useCallback)(
|
|
2306
|
+
(venue, element) => {
|
|
2307
|
+
if (!element) {
|
|
2308
|
+
descriptionMeasureRefs.current.delete(venue);
|
|
2309
|
+
return;
|
|
2310
|
+
}
|
|
2311
|
+
descriptionMeasureRefs.current.set(venue, element);
|
|
2312
|
+
},
|
|
2313
|
+
[]
|
|
2314
|
+
);
|
|
2315
|
+
const updateDescriptionLayout = (0, import_react.useCallback)(
|
|
2316
|
+
(venue, description, showMoreLabel) => {
|
|
2317
|
+
const descriptionWrapperElement = descriptionWrapperRefs.current.get(venue);
|
|
2318
|
+
const descriptionMeasureElement = descriptionMeasureRefs.current.get(venue);
|
|
2319
|
+
if (!descriptionWrapperElement || !descriptionMeasureElement)
|
|
2320
|
+
return;
|
|
2321
|
+
const wrapperWidth = descriptionWrapperElement.clientWidth;
|
|
2322
|
+
if (wrapperWidth <= 0)
|
|
2323
|
+
return;
|
|
2324
|
+
const computedStyles = window.getComputedStyle(descriptionWrapperElement);
|
|
2325
|
+
const parsedLineHeight = Number.parseFloat(computedStyles.lineHeight);
|
|
2326
|
+
const lineHeight = Number.isFinite(parsedLineHeight) ? parsedLineHeight : 20;
|
|
2327
|
+
const maxHeight = lineHeight * 2 + 1;
|
|
2328
|
+
descriptionMeasureElement.style.width = `${wrapperWidth}px`;
|
|
2329
|
+
const getHeight = (value) => {
|
|
2330
|
+
descriptionMeasureElement.textContent = value;
|
|
2331
|
+
return descriptionMeasureElement.scrollHeight;
|
|
2332
|
+
};
|
|
2333
|
+
const fullHeight = getHeight(description);
|
|
2334
|
+
if (fullHeight <= maxHeight) {
|
|
2335
|
+
setOverflowingDescriptionByVenue((currentState) => {
|
|
2336
|
+
if (currentState[venue] === false)
|
|
2337
|
+
return currentState;
|
|
2338
|
+
return __spreadProps(__spreadValues({}, currentState), {
|
|
2339
|
+
[venue]: false
|
|
2340
|
+
});
|
|
2341
|
+
});
|
|
2342
|
+
setCollapsedDescriptionByVenue((currentState) => {
|
|
2343
|
+
if (currentState[venue] === description)
|
|
2344
|
+
return currentState;
|
|
2345
|
+
return __spreadProps(__spreadValues({}, currentState), {
|
|
2346
|
+
[venue]: description
|
|
2347
|
+
});
|
|
2348
|
+
});
|
|
2349
|
+
return;
|
|
2350
|
+
}
|
|
2351
|
+
const suffix = `... ${showMoreLabel}`;
|
|
2352
|
+
let left = 0;
|
|
2353
|
+
let right = description.length;
|
|
2354
|
+
let bestLength = 0;
|
|
2355
|
+
while (left <= right) {
|
|
2356
|
+
const middle = Math.floor((left + right) / 2);
|
|
2357
|
+
const candidate = description.slice(0, middle).trimEnd();
|
|
2358
|
+
const candidateHeight = getHeight(`${candidate}${suffix}`);
|
|
2359
|
+
if (candidateHeight <= maxHeight) {
|
|
2360
|
+
bestLength = middle;
|
|
2361
|
+
left = middle + 1;
|
|
2362
|
+
continue;
|
|
2363
|
+
}
|
|
2364
|
+
right = middle - 1;
|
|
2109
2365
|
}
|
|
2366
|
+
const collapsedDescription = description.slice(0, bestLength).trimEnd();
|
|
2367
|
+
setOverflowingDescriptionByVenue((currentState) => {
|
|
2368
|
+
if (currentState[venue] === true)
|
|
2369
|
+
return currentState;
|
|
2370
|
+
return __spreadProps(__spreadValues({}, currentState), {
|
|
2371
|
+
[venue]: true
|
|
2372
|
+
});
|
|
2373
|
+
});
|
|
2374
|
+
setCollapsedDescriptionByVenue((currentState) => {
|
|
2375
|
+
if (currentState[venue] === collapsedDescription)
|
|
2376
|
+
return currentState;
|
|
2377
|
+
return __spreadProps(__spreadValues({}, currentState), {
|
|
2378
|
+
[venue]: collapsedDescription
|
|
2379
|
+
});
|
|
2380
|
+
});
|
|
2381
|
+
},
|
|
2382
|
+
[]
|
|
2383
|
+
);
|
|
2384
|
+
(0, import_react.useEffect)(() => {
|
|
2385
|
+
if (typeof window === "undefined")
|
|
2386
|
+
return;
|
|
2387
|
+
if (!resolvedExpandedVenue)
|
|
2388
|
+
return;
|
|
2389
|
+
if (expandedDescriptionByVenue[resolvedExpandedVenue])
|
|
2390
|
+
return;
|
|
2391
|
+
const expandedVenueItem = venues.find((venueItem) => venueItem.venue === resolvedExpandedVenue);
|
|
2392
|
+
if (!expandedVenueItem)
|
|
2393
|
+
return;
|
|
2394
|
+
const frameId = window.requestAnimationFrame(() => {
|
|
2395
|
+
var _a2;
|
|
2396
|
+
updateDescriptionLayout(
|
|
2397
|
+
resolvedExpandedVenue,
|
|
2398
|
+
expandedVenueItem.description,
|
|
2399
|
+
(_a2 = expandedVenueItem.showMoreLabel) != null ? _a2 : "Show more"
|
|
2400
|
+
);
|
|
2401
|
+
});
|
|
2402
|
+
return () => {
|
|
2403
|
+
window.cancelAnimationFrame(frameId);
|
|
2110
2404
|
};
|
|
2111
|
-
|
|
2112
|
-
return () => document.removeEventListener("mousedown", handlePointerDown);
|
|
2113
|
-
}, [isOpen, close]);
|
|
2405
|
+
}, [expandedDescriptionByVenue, resolvedExpandedVenue, updateDescriptionLayout, venues]);
|
|
2114
2406
|
(0, import_react.useEffect)(() => {
|
|
2115
|
-
if (!
|
|
2407
|
+
if (!resolvedExpandedVenue)
|
|
2116
2408
|
return;
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2409
|
+
if (expandedDescriptionByVenue[resolvedExpandedVenue])
|
|
2410
|
+
return;
|
|
2411
|
+
if (typeof ResizeObserver === "undefined")
|
|
2412
|
+
return;
|
|
2413
|
+
const expandedVenueItem = venues.find((venueItem) => venueItem.venue === resolvedExpandedVenue);
|
|
2414
|
+
if (!expandedVenueItem)
|
|
2415
|
+
return;
|
|
2416
|
+
const descriptionWrapperElement = descriptionWrapperRefs.current.get(resolvedExpandedVenue);
|
|
2417
|
+
if (!descriptionWrapperElement)
|
|
2418
|
+
return;
|
|
2419
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
2420
|
+
var _a2;
|
|
2421
|
+
updateDescriptionLayout(
|
|
2422
|
+
resolvedExpandedVenue,
|
|
2423
|
+
expandedVenueItem.description,
|
|
2424
|
+
(_a2 = expandedVenueItem.showMoreLabel) != null ? _a2 : "Show more"
|
|
2425
|
+
);
|
|
2426
|
+
});
|
|
2427
|
+
resizeObserver.observe(descriptionWrapperElement);
|
|
2428
|
+
return () => {
|
|
2429
|
+
resizeObserver.disconnect();
|
|
2120
2430
|
};
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
value,
|
|
2143
|
-
onChange: (event) => onChange(event.target.value),
|
|
2144
|
-
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("option", { value: item.value, disabled: item.disabled, children: item.label }, item.value))
|
|
2145
|
-
}
|
|
2146
|
-
),
|
|
2147
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "pointer-events-none absolute inset-y-0 right-3 inline-flex items-center justify-center text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) })
|
|
2148
|
-
] });
|
|
2431
|
+
}, [expandedDescriptionByVenue, resolvedExpandedVenue, updateDescriptionLayout, venues]);
|
|
2432
|
+
const handleDescriptionShowMoreClick = (event, venue) => {
|
|
2433
|
+
event == null ? void 0 : event.stopPropagation();
|
|
2434
|
+
setExpandedDescriptionByVenue((currentState) => {
|
|
2435
|
+
if (currentState[venue])
|
|
2436
|
+
return currentState;
|
|
2437
|
+
return __spreadProps(__spreadValues({}, currentState), {
|
|
2438
|
+
[venue]: true
|
|
2439
|
+
});
|
|
2440
|
+
});
|
|
2441
|
+
onShowMore == null ? void 0 : onShowMore(venue);
|
|
2442
|
+
};
|
|
2443
|
+
if (isLoading) {
|
|
2444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2445
|
+
Skeleton,
|
|
2446
|
+
{
|
|
2447
|
+
ariaLabel: labels.trading.settlementLoading,
|
|
2448
|
+
className,
|
|
2449
|
+
view: skeletonViews.settlement
|
|
2450
|
+
}
|
|
2451
|
+
);
|
|
2149
2452
|
}
|
|
2150
|
-
return /* @__PURE__ */ (0,
|
|
2151
|
-
|
|
2453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
2454
|
+
Card,
|
|
2152
2455
|
{
|
|
2153
|
-
|
|
2154
|
-
|
|
2456
|
+
className: cn(
|
|
2457
|
+
"flex flex-col w-full gap-5 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5 shadow-none hover:shadow-none",
|
|
2458
|
+
className
|
|
2459
|
+
),
|
|
2155
2460
|
children: [
|
|
2156
|
-
/* @__PURE__ */ (0,
|
|
2157
|
-
"
|
|
2158
|
-
{
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2461
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: getSettlementHeaderClassName(), children: [
|
|
2462
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-agg-xs font-agg-bold leading-agg-4 uppercase text-agg-muted-foreground", children: resolvedSectionLabel }),
|
|
2463
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: question })
|
|
2464
|
+
] }),
|
|
2465
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
2466
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: resolvedDifferencesTitle }),
|
|
2467
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("ul", { className: "list-disc pl-5 text-agg-sm leading-agg-5 text-agg-foreground", children: differences.map((difference) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("li", { children: difference }, difference)) })
|
|
2468
|
+
] }),
|
|
2469
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex flex-col gap-3", children: venues.map((venue) => {
|
|
2471
|
+
var _a2, _b2;
|
|
2472
|
+
const venueLabel = getTradingVenueLabel(venue.venue, venue.label);
|
|
2473
|
+
const isExpanded = resolvedExpandedVenue === venue.venue;
|
|
2474
|
+
const isDescriptionExpanded = !!expandedDescriptionByVenue[venue.venue];
|
|
2475
|
+
const isDescriptionOverflowing = !!overflowingDescriptionByVenue[venue.venue];
|
|
2476
|
+
const shouldShowDescriptionCta = isExpanded && isDescriptionOverflowing && !isDescriptionExpanded;
|
|
2477
|
+
const resolvedShowMoreLabel = (_a2 = venue.showMoreLabel) != null ? _a2 : "Show more";
|
|
2478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col", children: [
|
|
2479
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
2480
|
+
"button",
|
|
2481
|
+
{
|
|
2482
|
+
type: "button",
|
|
2483
|
+
className: cn(
|
|
2484
|
+
"flex items-center gap-2 text-left",
|
|
2485
|
+
"cursor-pointer disabled:cursor-not-allowed hover:opacity-50",
|
|
2486
|
+
getMotionClassName(
|
|
2487
|
+
enableAnimations,
|
|
2488
|
+
"transition-[opacity,color] duration-200 ease-in-out"
|
|
2489
|
+
)
|
|
2490
|
+
),
|
|
2491
|
+
"aria-expanded": isExpanded,
|
|
2492
|
+
"aria-label": labels.trading.settlementDetailsAria(venueLabel),
|
|
2493
|
+
onClick: () => handleVenueClick(venue.venue),
|
|
2494
|
+
children: [
|
|
2495
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2496
|
+
VenueLogo,
|
|
2497
|
+
{
|
|
2498
|
+
venue: venue.venue,
|
|
2499
|
+
size: "small",
|
|
2500
|
+
ariaLabel: venueLabel
|
|
2501
|
+
}
|
|
2502
|
+
),
|
|
2503
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2504
|
+
"span",
|
|
2505
|
+
{
|
|
2506
|
+
className: cn(
|
|
2507
|
+
"text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground",
|
|
2508
|
+
isExpanded ? "text-agg-primary" : "text-agg-foreground"
|
|
2509
|
+
),
|
|
2510
|
+
children: venueLabel
|
|
2511
|
+
}
|
|
2512
|
+
),
|
|
2513
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2514
|
+
Icon,
|
|
2515
|
+
{
|
|
2516
|
+
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
2517
|
+
size: "small",
|
|
2518
|
+
className: "text-agg-foreground",
|
|
2519
|
+
color: "currentColor"
|
|
2520
|
+
}
|
|
2521
|
+
)
|
|
2522
|
+
]
|
|
2523
|
+
}
|
|
2524
|
+
),
|
|
2525
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2526
|
+
"div",
|
|
2527
|
+
{
|
|
2528
|
+
"aria-hidden": !isExpanded,
|
|
2529
|
+
className: cn(
|
|
2530
|
+
"grid overflow-hidden",
|
|
2531
|
+
isExpanded ? "mt-2 grid-rows-[1fr] opacity-100" : "mt-0 grid-rows-[0fr] opacity-0",
|
|
2532
|
+
!isExpanded && "pointer-events-none",
|
|
2533
|
+
getMotionClassName(
|
|
2534
|
+
enableAnimations,
|
|
2535
|
+
"transition-[grid-template-rows,opacity,margin-top] duration-300 ease-in-out"
|
|
2536
|
+
)
|
|
2537
|
+
),
|
|
2538
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
2539
|
+
"div",
|
|
2540
|
+
{
|
|
2541
|
+
ref: (element) => handleDescriptionWrapperRef(venue.venue, element),
|
|
2542
|
+
className: "relative min-h-0",
|
|
2543
|
+
children: [
|
|
2544
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("p", { className: "min-h-0 text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
2545
|
+
isDescriptionExpanded || !isDescriptionOverflowing ? venue.description : (_b2 = collapsedDescriptionByVenue[venue.venue]) != null ? _b2 : venue.description,
|
|
2546
|
+
shouldShowDescriptionCta ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
2547
|
+
"... ",
|
|
2548
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2549
|
+
"button",
|
|
2550
|
+
{
|
|
2551
|
+
type: "button",
|
|
2552
|
+
tabIndex: isExpanded ? 0 : -1,
|
|
2553
|
+
className: cn(
|
|
2554
|
+
"cursor-pointer disabled:cursor-not-allowed",
|
|
2555
|
+
"text-agg-sm leading-agg-5 text-agg-foreground underline-offset-2 hover:underline hover:font-agg-bold",
|
|
2556
|
+
getMotionClassName(
|
|
2557
|
+
enableAnimations,
|
|
2558
|
+
"transition-[text-decoration] duration-200 ease-in-out"
|
|
2559
|
+
)
|
|
2560
|
+
),
|
|
2561
|
+
"aria-label": labels.trading.settlementShowMoreAria(
|
|
2562
|
+
resolvedShowMoreLabel,
|
|
2563
|
+
venueLabel
|
|
2564
|
+
),
|
|
2565
|
+
onClick: (event) => handleDescriptionShowMoreClick(event, venue.venue),
|
|
2566
|
+
children: resolvedShowMoreLabel
|
|
2567
|
+
}
|
|
2568
|
+
)
|
|
2569
|
+
] }) : null
|
|
2570
|
+
] }),
|
|
2571
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2572
|
+
"p",
|
|
2573
|
+
{
|
|
2574
|
+
ref: (element) => handleDescriptionMeasureRef(venue.venue, element),
|
|
2575
|
+
"aria-hidden": true,
|
|
2576
|
+
className: "pointer-events-none invisible fixed top-0 left-0 -z-10 whitespace-normal text-agg-sm leading-agg-5"
|
|
2577
|
+
}
|
|
2578
|
+
)
|
|
2579
|
+
]
|
|
2580
|
+
}
|
|
2581
|
+
)
|
|
2582
|
+
}
|
|
2583
|
+
)
|
|
2584
|
+
] }, venue.venue);
|
|
2585
|
+
}) })
|
|
2586
|
+
]
|
|
2587
|
+
}
|
|
2588
|
+
);
|
|
2589
|
+
};
|
|
2590
|
+
Settlement.displayName = "Settlement";
|
|
2591
|
+
|
|
2592
|
+
// src/trading/place-order/index.tsx
|
|
2593
|
+
var import_react4 = require("react");
|
|
2594
|
+
var import_hooks14 = require("@agg-market/hooks");
|
|
2595
|
+
|
|
2596
|
+
// src/primitives/button/index.tsx
|
|
2597
|
+
var import_hooks11 = require("@agg-market/hooks");
|
|
2598
|
+
|
|
2599
|
+
// src/primitives/button/button.constants.ts
|
|
2600
|
+
var sizeClasses2 = {
|
|
2601
|
+
small: cn("h-8 px-4 gap-1.5", "text-agg-sm leading-agg-5"),
|
|
2602
|
+
medium: cn("h-9 px-5 gap-1.5", "text-agg-sm leading-agg-5"),
|
|
2603
|
+
large: cn("h-10 px-6 gap-2", "text-agg-base leading-agg-6")
|
|
2604
|
+
};
|
|
2605
|
+
var iconSizeClasses2 = {
|
|
2606
|
+
small: iconSizeClasses.small,
|
|
2607
|
+
medium: iconSizeClasses.small,
|
|
2608
|
+
large: iconSizeClasses.small
|
|
2609
|
+
};
|
|
2610
|
+
var iconSlotClasses = {
|
|
2611
|
+
small: "[&_svg]:h-4 [&_svg]:w-4",
|
|
2612
|
+
medium: "[&_svg]:h-4 [&_svg]:w-4",
|
|
2613
|
+
large: "[&_svg]:h-4 [&_svg]:w-4"
|
|
2614
|
+
};
|
|
2615
|
+
var variantClasses = {
|
|
2616
|
+
primary: cn(
|
|
2617
|
+
"bg-agg-primary text-agg-on-primary",
|
|
2618
|
+
"hover:bg-agg-primary-hover",
|
|
2619
|
+
"disabled:bg-agg-separator disabled:text-agg-on-primary",
|
|
2620
|
+
"focus-visible:ring-agg-primary-hover"
|
|
2621
|
+
),
|
|
2622
|
+
secondary: cn(
|
|
2623
|
+
"border border-agg-separator bg-agg-secondary text-agg-foreground",
|
|
2624
|
+
"hover:bg-agg-secondary-hover",
|
|
2625
|
+
"disabled:bg-agg-secondary disabled:text-agg-muted-foreground disabled:border-agg-separator",
|
|
2626
|
+
"focus-visible:ring-agg-separator"
|
|
2627
|
+
),
|
|
2628
|
+
tertiary: cn(
|
|
2629
|
+
"bg-transparent text-agg-primary",
|
|
2630
|
+
"hover:text-agg-primary-hover",
|
|
2631
|
+
"disabled:bg-transparent disabled:text-agg-muted-foreground",
|
|
2632
|
+
"focus-visible:ring-agg-separator",
|
|
2633
|
+
"px-0! py-0! h-fit!"
|
|
2634
|
+
)
|
|
2635
|
+
};
|
|
2636
|
+
var baseButtonClasses = cn(
|
|
2637
|
+
"cursor-pointer disabled:cursor-not-allowed",
|
|
2638
|
+
"inline-flex items-center justify-center rounded-agg-full font-agg-sans font-agg-bold text-center",
|
|
2639
|
+
"whitespace-nowrap",
|
|
2640
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary"
|
|
2641
|
+
);
|
|
2642
|
+
|
|
2643
|
+
// src/primitives/button/index.tsx
|
|
2644
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2645
|
+
var Button = (_a) => {
|
|
2646
|
+
var _b = _a, {
|
|
2647
|
+
children,
|
|
2648
|
+
variant = "primary",
|
|
2649
|
+
size = "medium",
|
|
2650
|
+
isLoading = false,
|
|
2651
|
+
disabled,
|
|
2652
|
+
prefix,
|
|
2653
|
+
suffix,
|
|
2654
|
+
type = "button",
|
|
2655
|
+
className,
|
|
2656
|
+
"aria-label": ariaLabel
|
|
2657
|
+
} = _b, other = __objRest(_b, [
|
|
2658
|
+
"children",
|
|
2659
|
+
"variant",
|
|
2660
|
+
"size",
|
|
2661
|
+
"isLoading",
|
|
2662
|
+
"disabled",
|
|
2663
|
+
"prefix",
|
|
2664
|
+
"suffix",
|
|
2665
|
+
"type",
|
|
2666
|
+
"className",
|
|
2667
|
+
"aria-label"
|
|
2668
|
+
]);
|
|
2669
|
+
const { enableAnimations } = (0, import_hooks11.useSdkUiConfig)();
|
|
2670
|
+
const isDisabled = disabled || isLoading;
|
|
2671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2672
|
+
"button",
|
|
2673
|
+
__spreadProps(__spreadValues({
|
|
2674
|
+
type,
|
|
2675
|
+
className: cn(
|
|
2676
|
+
"group/agg-button",
|
|
2677
|
+
baseButtonClasses,
|
|
2678
|
+
getMotionClassName(enableAnimations, "transition-colors duration-200 ease-in-out"),
|
|
2679
|
+
sizeClasses2[size],
|
|
2680
|
+
iconSlotClasses[size],
|
|
2681
|
+
variantClasses[variant],
|
|
2682
|
+
className
|
|
2683
|
+
),
|
|
2684
|
+
disabled: isDisabled,
|
|
2685
|
+
"aria-busy": isLoading,
|
|
2686
|
+
"aria-label": ariaLabel
|
|
2687
|
+
}, other), {
|
|
2688
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2689
|
+
"span",
|
|
2690
|
+
{
|
|
2691
|
+
className: cn(
|
|
2692
|
+
"inline-block rounded-agg-full border-2 border-current border-r-transparent",
|
|
2693
|
+
getMotionClassName(enableAnimations, "animate-spin"),
|
|
2694
|
+
iconSizeClasses2[size]
|
|
2695
|
+
),
|
|
2696
|
+
"aria-hidden": "true"
|
|
2697
|
+
}
|
|
2698
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
2699
|
+
prefix != null ? prefix : null,
|
|
2700
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children }),
|
|
2701
|
+
suffix != null ? suffix : null
|
|
2702
|
+
] })
|
|
2703
|
+
})
|
|
2704
|
+
);
|
|
2705
|
+
};
|
|
2706
|
+
Button.displayName = "Button";
|
|
2707
|
+
|
|
2708
|
+
// src/primitives/tabs/index.tsx
|
|
2709
|
+
var import_react3 = require("react");
|
|
2710
|
+
var import_hooks13 = require("@agg-market/hooks");
|
|
2711
|
+
|
|
2712
|
+
// src/primitives/select/index.tsx
|
|
2713
|
+
var import_react2 = require("react");
|
|
2714
|
+
var import_hooks12 = require("@agg-market/hooks");
|
|
2715
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2716
|
+
var Select = ({
|
|
2717
|
+
items,
|
|
2718
|
+
value,
|
|
2719
|
+
onChange,
|
|
2720
|
+
ariaLabel,
|
|
2721
|
+
className,
|
|
2722
|
+
disabled = false
|
|
2723
|
+
}) => {
|
|
2724
|
+
var _a;
|
|
2725
|
+
const labels = (0, import_hooks12.useLabels)();
|
|
2726
|
+
const { enableAnimations } = (0, import_hooks12.useSdkUiConfig)();
|
|
2727
|
+
const hasEnabledItems = items.some((item) => !item.disabled);
|
|
2728
|
+
const hasAnyIcon = items.some((item) => item.iconUrl);
|
|
2729
|
+
const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
|
|
2730
|
+
const containerRef = (0, import_react2.useRef)(null);
|
|
2731
|
+
const close = (0, import_react2.useCallback)(() => setIsOpen(false), []);
|
|
2732
|
+
(0, import_react2.useEffect)(() => {
|
|
2733
|
+
if (!isOpen)
|
|
2734
|
+
return;
|
|
2735
|
+
const handlePointerDown = (e) => {
|
|
2736
|
+
if (containerRef.current && !containerRef.current.contains(e == null ? void 0 : e.target)) {
|
|
2737
|
+
close();
|
|
2738
|
+
}
|
|
2739
|
+
};
|
|
2740
|
+
document.addEventListener("mousedown", handlePointerDown);
|
|
2741
|
+
return () => document.removeEventListener("mousedown", handlePointerDown);
|
|
2742
|
+
}, [isOpen, close]);
|
|
2743
|
+
(0, import_react2.useEffect)(() => {
|
|
2744
|
+
if (!isOpen)
|
|
2745
|
+
return;
|
|
2746
|
+
const handleKey = (e) => {
|
|
2747
|
+
if ((e == null ? void 0 : e.key) === "Escape")
|
|
2748
|
+
close();
|
|
2749
|
+
};
|
|
2750
|
+
document.addEventListener("keydown", handleKey);
|
|
2751
|
+
return () => document.removeEventListener("keydown", handleKey);
|
|
2752
|
+
}, [isOpen, close]);
|
|
2753
|
+
const isDisabled = disabled || !hasEnabledItems;
|
|
2754
|
+
const selectedItem = items.find((item) => item.value === value);
|
|
2755
|
+
if (!hasAnyIcon) {
|
|
2756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("label", { className: cn("group/agg-select", "relative inline-flex w-full", className), children: [
|
|
2757
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2758
|
+
"select",
|
|
2759
|
+
{
|
|
2760
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
|
|
2761
|
+
className: cn(
|
|
2762
|
+
"w-full appearance-none rounded-agg-md border border-agg-separator bg-agg-secondary px-4 py-2 pr-10 font-agg-sans text-agg-sm leading-agg-5 text-agg-foreground outline-none",
|
|
2763
|
+
getMotionClassName(
|
|
2764
|
+
enableAnimations,
|
|
2765
|
+
"transition-[border-color,box-shadow] duration-200 ease-in-out"
|
|
2766
|
+
),
|
|
2767
|
+
"focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
|
|
2768
|
+
"disabled:cursor-not-allowed disabled:opacity-60"
|
|
2769
|
+
),
|
|
2770
|
+
disabled: isDisabled,
|
|
2771
|
+
value,
|
|
2772
|
+
onChange: (event) => onChange(event.target.value),
|
|
2773
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("option", { value: item.value, disabled: item.disabled, children: item.label }, item.value))
|
|
2774
|
+
}
|
|
2775
|
+
),
|
|
2776
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pointer-events-none absolute inset-y-0 right-3 inline-flex items-center justify-center text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) })
|
|
2777
|
+
] });
|
|
2778
|
+
}
|
|
2779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
2780
|
+
"div",
|
|
2781
|
+
{
|
|
2782
|
+
ref: containerRef,
|
|
2783
|
+
className: cn("group/agg-select", "relative inline-flex w-full", className),
|
|
2784
|
+
children: [
|
|
2785
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
2786
|
+
"button",
|
|
2787
|
+
{
|
|
2788
|
+
type: "button",
|
|
2789
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
|
|
2790
|
+
"aria-expanded": isOpen,
|
|
2791
|
+
"aria-haspopup": "listbox",
|
|
2792
|
+
disabled: isDisabled,
|
|
2164
2793
|
className: cn(
|
|
2165
2794
|
"w-full rounded-agg-md border border-agg-separator bg-agg-secondary px-4 py-2 pr-10 font-agg-sans text-agg-sm leading-agg-5 text-agg-foreground outline-none",
|
|
2166
2795
|
"flex items-center gap-2 text-left",
|
|
@@ -2173,7 +2802,7 @@ var Select = ({
|
|
|
2173
2802
|
),
|
|
2174
2803
|
onClick: () => setIsOpen((prev) => !prev),
|
|
2175
2804
|
children: [
|
|
2176
|
-
(selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0,
|
|
2805
|
+
(selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2177
2806
|
"img",
|
|
2178
2807
|
{
|
|
2179
2808
|
src: selectedItem.iconUrl,
|
|
@@ -2181,12 +2810,12 @@ var Select = ({
|
|
|
2181
2810
|
className: "h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
2182
2811
|
}
|
|
2183
2812
|
) : null,
|
|
2184
|
-
/* @__PURE__ */ (0,
|
|
2813
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
|
|
2185
2814
|
]
|
|
2186
2815
|
}
|
|
2187
2816
|
),
|
|
2188
|
-
/* @__PURE__ */ (0,
|
|
2189
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
2817
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pointer-events-none absolute inset-y-0 right-3 inline-flex items-center justify-center text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) }),
|
|
2818
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2190
2819
|
"div",
|
|
2191
2820
|
{
|
|
2192
2821
|
role: "listbox",
|
|
@@ -2194,7 +2823,7 @@ var Select = ({
|
|
|
2194
2823
|
className: "absolute top-full left-0 z-50 mt-1 w-full overflow-hidden rounded-agg-md border border-agg-separator bg-agg-secondary shadow-lg",
|
|
2195
2824
|
children: items.map((item) => {
|
|
2196
2825
|
const isSelected = item.value === value;
|
|
2197
|
-
return /* @__PURE__ */ (0,
|
|
2826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
2198
2827
|
"button",
|
|
2199
2828
|
{
|
|
2200
2829
|
type: "button",
|
|
@@ -2214,7 +2843,7 @@ var Select = ({
|
|
|
2214
2843
|
}
|
|
2215
2844
|
},
|
|
2216
2845
|
children: [
|
|
2217
|
-
item.iconUrl ? /* @__PURE__ */ (0,
|
|
2846
|
+
item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2218
2847
|
"img",
|
|
2219
2848
|
{
|
|
2220
2849
|
src: item.iconUrl,
|
|
@@ -2222,7 +2851,7 @@ var Select = ({
|
|
|
2222
2851
|
className: "h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
2223
2852
|
}
|
|
2224
2853
|
) : null,
|
|
2225
|
-
/* @__PURE__ */ (0,
|
|
2854
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "truncate", children: item.label })
|
|
2226
2855
|
]
|
|
2227
2856
|
},
|
|
2228
2857
|
item.value
|
|
@@ -2261,7 +2890,7 @@ var findEdgeEnabledIndex = (items, direction) => {
|
|
|
2261
2890
|
};
|
|
2262
2891
|
|
|
2263
2892
|
// src/primitives/tabs/index.tsx
|
|
2264
|
-
var
|
|
2893
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2265
2894
|
var mobileTabsMediaQuery = "(max-width: 512px)";
|
|
2266
2895
|
var getTabButtonClassName = ({
|
|
2267
2896
|
enableAnimations,
|
|
@@ -2301,10 +2930,10 @@ var Tabs = ({
|
|
|
2301
2930
|
className,
|
|
2302
2931
|
classNames
|
|
2303
2932
|
}) => {
|
|
2304
|
-
const labels = (0,
|
|
2305
|
-
const { enableAnimations } = (0,
|
|
2306
|
-
const buttonRefs = (0,
|
|
2307
|
-
const dragStateRef = (0,
|
|
2933
|
+
const labels = (0, import_hooks13.useLabels)();
|
|
2934
|
+
const { enableAnimations } = (0, import_hooks13.useSdkUiConfig)();
|
|
2935
|
+
const buttonRefs = (0, import_react3.useRef)([]);
|
|
2936
|
+
const dragStateRef = (0, import_react3.useRef)({
|
|
2308
2937
|
isPointerDown: false,
|
|
2309
2938
|
isDragging: false,
|
|
2310
2939
|
pointerId: null,
|
|
@@ -2312,22 +2941,22 @@ var Tabs = ({
|
|
|
2312
2941
|
startClientY: 0,
|
|
2313
2942
|
startScrollLeft: 0
|
|
2314
2943
|
});
|
|
2315
|
-
const suppressClickRef = (0,
|
|
2944
|
+
const suppressClickRef = (0, import_react3.useRef)(false);
|
|
2316
2945
|
const resolvedAriaLabel = ariaLabel != null ? ariaLabel : labels.common.tabsAria;
|
|
2317
|
-
const [isMobileViewport, setIsMobileViewport] = (0,
|
|
2318
|
-
const [isDraggingTabs, setIsDraggingTabs] = (0,
|
|
2319
|
-
const [activeUnderlineStyle, setActiveUnderlineStyle] = (0,
|
|
2946
|
+
const [isMobileViewport, setIsMobileViewport] = (0, import_react3.useState)(false);
|
|
2947
|
+
const [isDraggingTabs, setIsDraggingTabs] = (0, import_react3.useState)(false);
|
|
2948
|
+
const [activeUnderlineStyle, setActiveUnderlineStyle] = (0, import_react3.useState)({
|
|
2320
2949
|
transform: "translateX(0px)",
|
|
2321
2950
|
width: 0,
|
|
2322
2951
|
opacity: 0
|
|
2323
2952
|
});
|
|
2324
|
-
const [scrollAffordanceState, setScrollAffordanceState] = (0,
|
|
2953
|
+
const [scrollAffordanceState, setScrollAffordanceState] = (0, import_react3.useState)({
|
|
2325
2954
|
showStart: false,
|
|
2326
2955
|
showEnd: false
|
|
2327
2956
|
});
|
|
2328
|
-
const tabListRef = (0,
|
|
2957
|
+
const tabListRef = (0, import_react3.useRef)(null);
|
|
2329
2958
|
const isBarVariant = variant === "bar";
|
|
2330
|
-
const resolvedOverflowBehavior = (0,
|
|
2959
|
+
const resolvedOverflowBehavior = (0, import_react3.useMemo)(() => {
|
|
2331
2960
|
if (overflowBehavior)
|
|
2332
2961
|
return overflowBehavior;
|
|
2333
2962
|
if (!isBarVariant)
|
|
@@ -2336,7 +2965,7 @@ var Tabs = ({
|
|
|
2336
2965
|
}, [isBarVariant, isMobileViewport, overflowBehavior]);
|
|
2337
2966
|
const shouldUseOverflowScroll = resolvedOverflowBehavior === "scroll";
|
|
2338
2967
|
const shouldUseOverflowSelect = resolvedOverflowBehavior === "select";
|
|
2339
|
-
(0,
|
|
2968
|
+
(0, import_react3.useEffect)(() => {
|
|
2340
2969
|
if (typeof window === "undefined")
|
|
2341
2970
|
return;
|
|
2342
2971
|
const mediaQueryList = window.matchMedia(mobileTabsMediaQuery);
|
|
@@ -2355,7 +2984,7 @@ var Tabs = ({
|
|
|
2355
2984
|
mediaQueryList.removeListener(handleMediaQueryChange);
|
|
2356
2985
|
};
|
|
2357
2986
|
}, []);
|
|
2358
|
-
const updateScrollAffordances = (0,
|
|
2987
|
+
const updateScrollAffordances = (0, import_react3.useCallback)(() => {
|
|
2359
2988
|
if (!shouldUseOverflowScroll) {
|
|
2360
2989
|
setScrollAffordanceState({
|
|
2361
2990
|
showStart: false,
|
|
@@ -2373,7 +3002,7 @@ var Tabs = ({
|
|
|
2373
3002
|
});
|
|
2374
3003
|
}, [shouldUseOverflowScroll]);
|
|
2375
3004
|
const renderedItems = items;
|
|
2376
|
-
const selectItems = (0,
|
|
3005
|
+
const selectItems = (0, import_react3.useMemo)(() => {
|
|
2377
3006
|
return items.map((item) => ({
|
|
2378
3007
|
value: item.value,
|
|
2379
3008
|
label: item.label,
|
|
@@ -2524,7 +3153,7 @@ var Tabs = ({
|
|
|
2524
3153
|
event == null ? void 0 : event.stopPropagation();
|
|
2525
3154
|
suppressClickRef.current = false;
|
|
2526
3155
|
};
|
|
2527
|
-
const updateActiveUnderline = (0,
|
|
3156
|
+
const updateActiveUnderline = (0, import_react3.useCallback)(() => {
|
|
2528
3157
|
if (isBarVariant) {
|
|
2529
3158
|
setActiveUnderlineStyle({
|
|
2530
3159
|
transform: "translateX(0px)",
|
|
@@ -2547,10 +3176,10 @@ var Tabs = ({
|
|
|
2547
3176
|
opacity: 1
|
|
2548
3177
|
});
|
|
2549
3178
|
}, [isBarVariant, renderedItems, value]);
|
|
2550
|
-
(0,
|
|
3179
|
+
(0, import_react3.useLayoutEffect)(() => {
|
|
2551
3180
|
updateActiveUnderline();
|
|
2552
3181
|
}, [updateActiveUnderline]);
|
|
2553
|
-
(0,
|
|
3182
|
+
(0, import_react3.useEffect)(() => {
|
|
2554
3183
|
if (isBarVariant || !shouldUseOverflowScroll)
|
|
2555
3184
|
return;
|
|
2556
3185
|
const tabListElement = tabListRef.current;
|
|
@@ -2566,12 +3195,12 @@ var Tabs = ({
|
|
|
2566
3195
|
tabListElement.removeEventListener("scroll", handleScroll);
|
|
2567
3196
|
};
|
|
2568
3197
|
}, [isBarVariant, shouldUseOverflowScroll, updateActiveUnderline, updateScrollAffordances]);
|
|
2569
|
-
(0,
|
|
3198
|
+
(0, import_react3.useEffect)(() => {
|
|
2570
3199
|
if (!shouldUseOverflowScroll)
|
|
2571
3200
|
return;
|
|
2572
3201
|
updateScrollAffordances();
|
|
2573
3202
|
}, [renderedItems, shouldUseOverflowScroll, updateScrollAffordances, value]);
|
|
2574
|
-
(0,
|
|
3203
|
+
(0, import_react3.useEffect)(() => {
|
|
2575
3204
|
if (isBarVariant && !shouldUseOverflowScroll)
|
|
2576
3205
|
return;
|
|
2577
3206
|
if (typeof ResizeObserver === "undefined")
|
|
@@ -2588,7 +3217,7 @@ var Tabs = ({
|
|
|
2588
3217
|
resizeObserver.disconnect();
|
|
2589
3218
|
};
|
|
2590
3219
|
}, [isBarVariant, shouldUseOverflowScroll, updateActiveUnderline, updateScrollAffordances]);
|
|
2591
|
-
(0,
|
|
3220
|
+
(0, import_react3.useEffect)(() => {
|
|
2592
3221
|
if (!shouldUseOverflowScroll)
|
|
2593
3222
|
return;
|
|
2594
3223
|
const tabListElement = tabListRef.current;
|
|
@@ -2618,1185 +3247,515 @@ var Tabs = ({
|
|
|
2618
3247
|
});
|
|
2619
3248
|
}, [enableAnimations, renderedItems, shouldUseOverflowScroll, value]);
|
|
2620
3249
|
if (shouldUseOverflowSelect) {
|
|
2621
|
-
return /* @__PURE__ */ (0,
|
|
3250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: cn("w-full", className, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2622
3251
|
Select,
|
|
2623
3252
|
{
|
|
2624
3253
|
ariaLabel,
|
|
2625
3254
|
className: "w-full",
|
|
2626
3255
|
disabled: isSelectDisabled,
|
|
2627
|
-
items: selectItems,
|
|
2628
|
-
onChange: handleSelect,
|
|
2629
|
-
value
|
|
2630
|
-
}
|
|
2631
|
-
) });
|
|
2632
|
-
}
|
|
2633
|
-
return /* @__PURE__ */ (0,
|
|
2634
|
-
"div",
|
|
2635
|
-
{
|
|
2636
|
-
className: cn(
|
|
2637
|
-
"group/agg-tabs",
|
|
2638
|
-
"relative max-w-full items-stretch font-agg-sans bg-agg-secondary",
|
|
2639
|
-
"inline-flex",
|
|
2640
|
-
className,
|
|
2641
|
-
classNames == null ? void 0 : classNames.root
|
|
2642
|
-
),
|
|
2643
|
-
children: [
|
|
2644
|
-
/* @__PURE__ */ (0,
|
|
2645
|
-
"div",
|
|
2646
|
-
{
|
|
2647
|
-
ref: tabListRef,
|
|
2648
|
-
role: "tablist",
|
|
2649
|
-
"aria-label": resolvedAriaLabel,
|
|
2650
|
-
className: cn("relative", tabListClassName, classNames == null ? void 0 : classNames.tabList),
|
|
2651
|
-
onClickCapture: handleTabListClickCapture,
|
|
2652
|
-
onPointerCancel: handleEndTabListDrag,
|
|
2653
|
-
onPointerDown: handleTabListPointerDown,
|
|
2654
|
-
onPointerMove: handleTabListPointerMove,
|
|
2655
|
-
onPointerUp: handleEndTabListDrag,
|
|
2656
|
-
onWheel: handleTabListWheel,
|
|
2657
|
-
children: [
|
|
2658
|
-
renderedItems.map((item, index) => {
|
|
2659
|
-
const isActive = item.value === value;
|
|
2660
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
2661
|
-
"button",
|
|
2662
|
-
{
|
|
2663
|
-
ref: (buttonElement) => {
|
|
2664
|
-
buttonRefs.current[index] = buttonElement;
|
|
2665
|
-
},
|
|
2666
|
-
type: "button",
|
|
2667
|
-
role: "tab",
|
|
2668
|
-
tabIndex: isActive ? 0 : -1,
|
|
2669
|
-
"aria-selected": isActive,
|
|
2670
|
-
"aria-label": item.label,
|
|
2671
|
-
disabled: item.disabled,
|
|
2672
|
-
onClick: (e) => {
|
|
2673
|
-
e.preventDefault();
|
|
2674
|
-
e.stopPropagation();
|
|
2675
|
-
handleSelect(item.value);
|
|
2676
|
-
},
|
|
2677
|
-
onKeyDown: (event) => handleKeyDown(event, index),
|
|
2678
|
-
className: cn(
|
|
2679
|
-
getTabButtonClassName({
|
|
2680
|
-
enableAnimations,
|
|
2681
|
-
isBarVariant,
|
|
2682
|
-
isActive,
|
|
2683
|
-
isDisabled: !!item.disabled,
|
|
2684
|
-
size
|
|
2685
|
-
}),
|
|
2686
|
-
shouldUseOverflowScroll && !isBarVariant && "snap-start"
|
|
2687
|
-
),
|
|
2688
|
-
children: [
|
|
2689
|
-
isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_jsx_runtime57.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2690
|
-
"span",
|
|
2691
|
-
{
|
|
2692
|
-
"aria-hidden": true,
|
|
2693
|
-
className: cn(
|
|
2694
|
-
"pointer-events-none absolute inset-px origin-bottom rounded-[2px] bg-agg-secondary-hover",
|
|
2695
|
-
getMotionClassName(
|
|
2696
|
-
enableAnimations,
|
|
2697
|
-
"transition-[transform,opacity] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none"
|
|
2698
|
-
),
|
|
2699
|
-
isActive ? "scale-y-100 opacity-100" : "scale-y-0 opacity-0"
|
|
2700
|
-
)
|
|
2701
|
-
}
|
|
2702
|
-
) }) : null,
|
|
2703
|
-
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "relative z-10 inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
|
|
2704
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "relative z-10 truncate whitespace-nowrap [&::first-letter]:uppercase", children: item.label })
|
|
2705
|
-
]
|
|
2706
|
-
},
|
|
2707
|
-
item.value
|
|
2708
|
-
);
|
|
2709
|
-
}),
|
|
2710
|
-
!isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2711
|
-
"span",
|
|
2712
|
-
{
|
|
2713
|
-
"aria-hidden": true,
|
|
2714
|
-
className: cn(
|
|
2715
|
-
"pointer-events-none absolute bottom-0 left-0 rounded-t-agg-sm bg-agg-primary",
|
|
2716
|
-
getMotionClassName(
|
|
2717
|
-
enableAnimations,
|
|
2718
|
-
"transition-[transform,width,opacity] duration-300 ease-in-out"
|
|
2719
|
-
),
|
|
2720
|
-
"h-[3px]"
|
|
2721
|
-
),
|
|
2722
|
-
style: activeUnderlineStyle
|
|
2723
|
-
}
|
|
2724
|
-
) : null
|
|
2725
|
-
]
|
|
2726
|
-
}
|
|
2727
|
-
),
|
|
2728
|
-
shouldUseOverflowScroll && !isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
2729
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2730
|
-
"span",
|
|
2731
|
-
{
|
|
2732
|
-
"aria-hidden": true,
|
|
2733
|
-
className: cn(
|
|
2734
|
-
"pointer-events-none absolute top-0 bottom-0 left-8 z-10 w-12 md:w-18 bg-linear-to-r from-agg-secondary via-agg-secondary to-transparent",
|
|
2735
|
-
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
2736
|
-
scrollAffordanceState.showStart ? "opacity-100" : "opacity-0"
|
|
2737
|
-
)
|
|
2738
|
-
}
|
|
2739
|
-
),
|
|
2740
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2741
|
-
"span",
|
|
2742
|
-
{
|
|
2743
|
-
"aria-hidden": true,
|
|
2744
|
-
className: cn(
|
|
2745
|
-
"pointer-events-none absolute top-0 right-8 bottom-0 z-10 w-12 md:w-18 bg-linear-to-l from-agg-secondary via-agg-secondary to-transparent",
|
|
2746
|
-
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
2747
|
-
scrollAffordanceState.showEnd ? "opacity-100" : "opacity-0"
|
|
2748
|
-
)
|
|
2749
|
-
}
|
|
2750
|
-
)
|
|
2751
|
-
] }) : null
|
|
2752
|
-
]
|
|
2753
|
-
}
|
|
2754
|
-
);
|
|
2755
|
-
};
|
|
2756
|
-
Tabs.displayName = "Tabs";
|
|
2757
|
-
|
|
2758
|
-
// src/primitives/venue-logo/index.tsx
|
|
2759
|
-
var import_hooks11 = require("@agg-market/hooks");
|
|
2760
|
-
|
|
2761
|
-
// src/primitives/venue-logo/logo-props.ts
|
|
2762
|
-
var DEFAULT_MONOCHROME_COLOR = "currentColor";
|
|
2763
|
-
var resolveLogoPrimaryColor = ({
|
|
2764
|
-
brandColor,
|
|
2765
|
-
isColor = true,
|
|
2766
|
-
color
|
|
2767
|
-
}) => {
|
|
2768
|
-
if (typeof color === "string" && color.trim())
|
|
2769
|
-
return color;
|
|
2770
|
-
if (!isColor)
|
|
2771
|
-
return DEFAULT_MONOCHROME_COLOR;
|
|
2772
|
-
return brandColor;
|
|
2773
|
-
};
|
|
2774
|
-
|
|
2775
|
-
// src/primitives/venue-logo/svg/logo-kalshi.tsx
|
|
2776
|
-
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2777
|
-
var KALSHI_GREEN = "#18C590";
|
|
2778
|
-
var LogoKalshiIcon = (_a) => {
|
|
2779
|
-
var _b = _a, {
|
|
2780
|
-
title,
|
|
2781
|
-
className,
|
|
2782
|
-
isColor = true,
|
|
2783
|
-
color
|
|
2784
|
-
} = _b, props = __objRest(_b, [
|
|
2785
|
-
"title",
|
|
2786
|
-
"className",
|
|
2787
|
-
"isColor",
|
|
2788
|
-
"color"
|
|
2789
|
-
]);
|
|
2790
|
-
const primaryColor = resolveLogoPrimaryColor({
|
|
2791
|
-
brandColor: KALSHI_GREEN,
|
|
2792
|
-
isColor,
|
|
2793
|
-
color
|
|
2794
|
-
});
|
|
2795
|
-
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
2796
|
-
"svg",
|
|
2797
|
-
__spreadProps(__spreadValues(__spreadValues({
|
|
2798
|
-
viewBox: "0 0 100 100",
|
|
2799
|
-
className,
|
|
2800
|
-
fill: "none"
|
|
2801
|
-
}, getIconA11yProps(title)), props), {
|
|
2802
|
-
children: [
|
|
2803
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("title", { children: title }) : null,
|
|
2804
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2805
|
-
"path",
|
|
2806
|
-
{
|
|
2807
|
-
d: "M54.9798 47.579L79.4249 85.9995H58.2273L38.2531 52.9344V85.9995H20.4189V13.9995H38.2531V45.4356L59.6547 13.9995H78.7119L54.9798 47.579Z",
|
|
2808
|
-
fill: primaryColor
|
|
2809
|
-
}
|
|
2810
|
-
)
|
|
2811
|
-
]
|
|
2812
|
-
})
|
|
2813
|
-
);
|
|
2814
|
-
};
|
|
2815
|
-
LogoKalshiIcon.displayName = "LogoKalshiIcon";
|
|
2816
|
-
|
|
2817
|
-
// src/primitives/venue-logo/svg/logo-opinion.tsx
|
|
2818
|
-
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2819
|
-
var OPINION_BLACK = "#000000";
|
|
2820
|
-
var LogoOpinionIcon = (_a) => {
|
|
2821
|
-
var _b = _a, {
|
|
2822
|
-
title,
|
|
2823
|
-
className,
|
|
2824
|
-
isColor = true,
|
|
2825
|
-
color
|
|
2826
|
-
} = _b, props = __objRest(_b, [
|
|
2827
|
-
"title",
|
|
2828
|
-
"className",
|
|
2829
|
-
"isColor",
|
|
2830
|
-
"color"
|
|
2831
|
-
]);
|
|
2832
|
-
const primaryColor = resolveLogoPrimaryColor({
|
|
2833
|
-
brandColor: OPINION_BLACK,
|
|
2834
|
-
isColor,
|
|
2835
|
-
color
|
|
2836
|
-
});
|
|
2837
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
2838
|
-
"svg",
|
|
2839
|
-
__spreadProps(__spreadValues(__spreadValues({
|
|
2840
|
-
viewBox: "0 0 100 100",
|
|
2841
|
-
className,
|
|
2842
|
-
fill: "none"
|
|
2843
|
-
}, getIconA11yProps(title)), props), {
|
|
2844
|
-
children: [
|
|
2845
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("title", { children: title }) : null,
|
|
2846
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2847
|
-
"path",
|
|
2848
|
-
{
|
|
2849
|
-
d: "M51.8239 68.4603L56.9659 68.0094L58.8049 89.0576C61.1459 88.5314 63.4349 87.7952 65.6437 86.8578V68.1879H71.9955V83.4385C74.6496 81.6828 77.0863 79.619 79.2548 77.2898L80.0716 67.958L85.516 68.433C88.6185 62.4381 90.156 55.7558 89.9858 49.0072C89.8154 42.2584 87.9429 35.6623 84.542 29.8316L84.3394 32.1494L77.9876 31.5927L78.8042 22.2668C76.7468 20.1288 74.4594 18.225 71.9835 16.5902V31.9164H65.6317V13.1739C62.9224 12.0205 60.0929 11.173 57.1957 10.6473L59.0317 31.6441L53.8897 32.0949L51.9599 10.0482C51.3128 10.0179 50.6593 9.99976 50.006 9.99976C47.4581 9.99976 44.9161 10.2419 42.414 10.723L46.0438 31.3899L42.1297 32.0798L38.5304 11.6701C35.1755 12.6725 31.9677 14.1143 28.9905 15.9578L33.0435 31.0873L29.9705 31.9134L26.2018 17.8369C23.2938 19.9923 20.6902 22.5308 18.4615 25.3835L20.4246 30.7787L18.1833 31.5956L16.7707 27.7134C14.5111 31.0771 12.7772 34.7657 11.6287 38.652L12.2639 38.4221L20.4306 60.8471L18.1893 61.6641L10.8877 41.5963C9.21542 49.4012 9.91256 57.528 12.8896 64.9338C15.8667 72.3395 20.9879 78.6865 27.5961 83.1601L23.8031 68.9989L26.8762 68.1728L31.5162 85.4991C34.6952 87.1593 38.0844 88.3808 41.5914 89.1303L38.0132 68.7296L41.9301 68.0397L45.7684 89.8262C47.1811 89.9757 48.6007 90.0505 50.0212 90.0502C51.2583 90.0502 52.4863 89.9926 53.6963 89.8807L51.8239 68.4603ZM80.1017 37.8985L86.4385 38.4524L84.3605 62.2299L78.0087 61.6761L80.1017 37.8985ZM65.6528 38.1315H72.0046V61.9969H65.6528V38.1315ZM56.975 37.9501L59.053 61.7277L53.911 62.1785L51.8299 38.4009L56.975 37.9501ZM29.9976 62.003L23.8243 38.9486L26.8974 38.1255L33.0707 61.1649L29.9976 62.003ZM42.157 62.1603L38.0132 38.658L41.9301 37.9683L46.0709 61.4674L42.157 62.1603Z",
|
|
2850
|
-
fill: primaryColor
|
|
2851
|
-
}
|
|
2852
|
-
)
|
|
2853
|
-
]
|
|
2854
|
-
})
|
|
2855
|
-
);
|
|
2856
|
-
};
|
|
2857
|
-
LogoOpinionIcon.displayName = "LogoOpinionIcon";
|
|
2858
|
-
|
|
2859
|
-
// src/primitives/venue-logo/svg/logo-polymarket.tsx
|
|
2860
|
-
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2861
|
-
var POLYMARKET_BLUE = "#2E5CFF";
|
|
2862
|
-
var LogoPolymarketIcon = (_a) => {
|
|
2863
|
-
var _b = _a, {
|
|
2864
|
-
title,
|
|
2865
|
-
className,
|
|
2866
|
-
isColor = true,
|
|
2867
|
-
color
|
|
2868
|
-
} = _b, props = __objRest(_b, [
|
|
2869
|
-
"title",
|
|
2870
|
-
"className",
|
|
2871
|
-
"isColor",
|
|
2872
|
-
"color"
|
|
2873
|
-
]);
|
|
2874
|
-
const primaryColor = resolveLogoPrimaryColor({
|
|
2875
|
-
brandColor: POLYMARKET_BLUE,
|
|
2876
|
-
isColor,
|
|
2877
|
-
color
|
|
2878
|
-
});
|
|
2879
|
-
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
2880
|
-
"svg",
|
|
2881
|
-
__spreadProps(__spreadValues(__spreadValues({
|
|
2882
|
-
viewBox: "0 0 100 100",
|
|
2883
|
-
className,
|
|
2884
|
-
fill: "none"
|
|
2885
|
-
}, getIconA11yProps(title)), props), {
|
|
2886
|
-
children: [
|
|
2887
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("title", { children: title }) : null,
|
|
2888
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2889
|
-
"path",
|
|
2890
|
-
{
|
|
2891
|
-
d: "M81.0904 84.2882C81.0904 87.9246 81.0904 89.7428 79.901 90.644C78.7119 91.5456 76.9613 91.0542 73.4603 90.0717L17.1975 74.2838C15.0881 73.6919 14.0332 73.3959 13.4233 72.5913C12.8135 71.7866 12.8135 70.6911 12.8135 68.5002V31.4998C12.8135 29.309 12.8135 28.2134 13.4233 27.4088C14.0332 26.6042 15.0881 26.3081 17.1975 25.7163L73.4603 9.92806C76.9613 8.94572 78.7119 8.45448 79.901 9.35587C81.0904 10.2573 81.0904 12.0755 81.0904 15.7119V84.2882ZM26.8451 69.1363L73.4308 82.2104V56.0637L26.8451 69.1363ZM20.4723 63.0711L67.0487 50L20.4723 36.929V63.0711ZM26.8446 30.8638L73.4308 43.9366V17.7896L26.8446 30.8638Z",
|
|
2892
|
-
fill: primaryColor
|
|
2893
|
-
}
|
|
2894
|
-
)
|
|
2895
|
-
]
|
|
2896
|
-
})
|
|
2897
|
-
);
|
|
2898
|
-
};
|
|
2899
|
-
LogoPolymarketIcon.displayName = "LogoPolymarketIcon";
|
|
2900
|
-
|
|
2901
|
-
// src/primitives/venue-logo/svg/logo-probable.tsx
|
|
2902
|
-
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2903
|
-
var PROBABLE_ORANGE = "#F05923";
|
|
2904
|
-
var LogoProbableIcon = (_a) => {
|
|
2905
|
-
var _b = _a, {
|
|
2906
|
-
title,
|
|
2907
|
-
className,
|
|
2908
|
-
isColor = true,
|
|
2909
|
-
color
|
|
2910
|
-
} = _b, props = __objRest(_b, [
|
|
2911
|
-
"title",
|
|
2912
|
-
"className",
|
|
2913
|
-
"isColor",
|
|
2914
|
-
"color"
|
|
2915
|
-
]);
|
|
2916
|
-
const primaryColor = resolveLogoPrimaryColor({
|
|
2917
|
-
brandColor: PROBABLE_ORANGE,
|
|
2918
|
-
isColor,
|
|
2919
|
-
color
|
|
2920
|
-
});
|
|
2921
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
2922
|
-
"svg",
|
|
2923
|
-
__spreadProps(__spreadValues(__spreadValues({
|
|
2924
|
-
viewBox: "0 0 100 100",
|
|
2925
|
-
className,
|
|
2926
|
-
fill: "none"
|
|
2927
|
-
}, getIconA11yProps(title)), props), {
|
|
2928
|
-
children: [
|
|
2929
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("title", { children: title }) : null,
|
|
2930
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2931
|
-
"path",
|
|
2932
|
-
{
|
|
2933
|
-
d: "M75.625 59.3489C75.6247 53.7323 71.0719 49.1792 65.4551 49.179H33.9209C28.3039 49.179 23.7503 53.7321 23.75 59.3489C23.75 64.9659 28.3038 69.5198 33.9209 69.5198H65.4551C71.0719 69.5195 75.625 64.9658 75.625 59.3489ZM90.625 59.3489C90.625 73.2501 79.3562 84.5195 65.4551 84.5198H33.9209C20.0196 84.5198 8.75 73.2502 8.75 59.3489C8.75026 45.4477 20.0198 34.179 33.9209 34.179H65.4551C79.3559 34.1792 90.6247 45.4478 90.625 59.3489Z",
|
|
2934
|
-
fill: primaryColor
|
|
2935
|
-
}
|
|
2936
|
-
),
|
|
2937
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "M90.9329 15.4546V30.4546H8.90234V15.4546H90.9329Z", fill: primaryColor }),
|
|
2938
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2939
|
-
"path",
|
|
2940
|
-
{
|
|
2941
|
-
d: "M64.5742 51.3496C68.9894 51.3496 72.5742 54.9344 72.5742 59.3496C72.5742 63.7648 68.9894 67.3496 64.5742 67.3496C60.159 67.3496 56.5742 63.7648 56.5742 59.3496C56.5742 54.9344 60.159 51.3496 64.5742 51.3496Z",
|
|
2942
|
-
fill: primaryColor
|
|
2943
|
-
}
|
|
2944
|
-
)
|
|
2945
|
-
]
|
|
2946
|
-
})
|
|
2947
|
-
);
|
|
2948
|
-
};
|
|
2949
|
-
LogoProbableIcon.displayName = "LogoProbableIcon";
|
|
2950
|
-
|
|
2951
|
-
// src/primitives/venue-logo/venue-logo.constants.ts
|
|
2952
|
-
var venueLogoRegistry = {
|
|
2953
|
-
kalshi: LogoKalshiIcon,
|
|
2954
|
-
polymarket: LogoPolymarketIcon,
|
|
2955
|
-
opinion: LogoOpinionIcon,
|
|
2956
|
-
probable: LogoProbableIcon
|
|
2957
|
-
};
|
|
2958
|
-
var VENUE_LOGO_BASE_URL = "https://assets.snagsolutions.io/public/prediction-markets/logos";
|
|
2959
|
-
var venueLogoUrlRegistry = {
|
|
2960
|
-
kalshi: `${VENUE_LOGO_BASE_URL}/kalshi.png`,
|
|
2961
|
-
polymarket: `${VENUE_LOGO_BASE_URL}/polymarket.png`,
|
|
2962
|
-
opinion: `${VENUE_LOGO_BASE_URL}/opinion.png`,
|
|
2963
|
-
probable: `${VENUE_LOGO_BASE_URL}/probable.png`
|
|
2964
|
-
};
|
|
2965
|
-
var venueLogoNames = Object.keys(venueLogoRegistry);
|
|
2966
|
-
var sizeClasses2 = {
|
|
2967
|
-
small: "h-4 w-4",
|
|
2968
|
-
medium: "h-6 w-6",
|
|
2969
|
-
large: "h-8 w-8"
|
|
2970
|
-
};
|
|
2971
|
-
|
|
2972
|
-
// src/primitives/venue-logo/index.tsx
|
|
2973
|
-
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2974
|
-
var VenueLogo = ({
|
|
2975
|
-
venue,
|
|
2976
|
-
variant = "icon",
|
|
2977
|
-
isColor = true,
|
|
2978
|
-
isMonochromatic = false,
|
|
2979
|
-
color,
|
|
2980
|
-
size = "medium",
|
|
2981
|
-
className,
|
|
2982
|
-
ariaLabel,
|
|
2983
|
-
title
|
|
2984
|
-
}) => {
|
|
2985
|
-
const labels = (0, import_hooks11.useLabels)();
|
|
2986
|
-
const sizeClass = sizeClasses2[size];
|
|
2987
|
-
const resolvedLabel = ariaLabel != null ? ariaLabel : labels.venues[venue];
|
|
2988
|
-
if (variant === "logo") {
|
|
2989
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
2990
|
-
"img",
|
|
2991
|
-
{
|
|
2992
|
-
src: venueLogoUrlRegistry[venue],
|
|
2993
|
-
alt: resolvedLabel,
|
|
2994
|
-
title,
|
|
2995
|
-
className: cn("shrink-0 rounded-agg-lg object-cover", sizeClass, className)
|
|
2996
|
-
}
|
|
2997
|
-
);
|
|
2998
|
-
}
|
|
2999
|
-
const Component = venueLogoRegistry[venue];
|
|
3000
|
-
const resolvedIsColor = isMonochromatic ? false : isColor;
|
|
3001
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3002
|
-
Component,
|
|
3003
|
-
{
|
|
3004
|
-
className: cn("group/agg-venue-logo", "shrink-0", sizeClass, className),
|
|
3005
|
-
isColor: resolvedIsColor,
|
|
3006
|
-
color,
|
|
3007
|
-
"aria-label": resolvedLabel,
|
|
3008
|
-
title
|
|
3009
|
-
}
|
|
3010
|
-
);
|
|
3011
|
-
};
|
|
3012
|
-
VenueLogo.displayName = "VenueLogo";
|
|
3013
|
-
|
|
3014
|
-
// src/events/item/index.tsx
|
|
3015
|
-
var import_dayjs = __toESM(require("dayjs"));
|
|
3016
|
-
var import_react3 = require("react");
|
|
3017
|
-
var import_hooks13 = require("@agg-market/hooks");
|
|
3018
|
-
|
|
3019
|
-
// src/primitives/badge/index.tsx
|
|
3020
|
-
var import_hooks12 = require("@agg-market/hooks");
|
|
3021
|
-
|
|
3022
|
-
// src/primitives/badge/badge.constants.ts
|
|
3023
|
-
var badgeSizeClasses = {
|
|
3024
|
-
small: cn("py-1.5 px-4 gap-1.5", "agg-type-label"),
|
|
3025
|
-
medium: cn("py-1.5 px-4 gap-2", "agg-type-body"),
|
|
3026
|
-
large: cn("py-2.5 px-6 gap-2", "agg-type-body")
|
|
3027
|
-
};
|
|
3028
|
-
var baseBadgeClasses = cn(
|
|
3029
|
-
"inline-flex items-center justify-center rounded-agg-full font-agg-sans",
|
|
3030
|
-
"bg-agg-secondary-hover text-agg-foreground whitespace-nowrap font-agg-normal"
|
|
3031
|
-
);
|
|
3032
|
-
|
|
3033
|
-
// src/primitives/badge/index.tsx
|
|
3034
|
-
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3035
|
-
function Badge({
|
|
3036
|
-
text,
|
|
3037
|
-
prefix,
|
|
3038
|
-
suffix,
|
|
3039
|
-
size = "medium",
|
|
3040
|
-
classNames,
|
|
3041
|
-
onClick,
|
|
3042
|
-
isActive = false
|
|
3043
|
-
}) {
|
|
3044
|
-
const { enableAnimations } = (0, import_hooks12.useSdkUiConfig)();
|
|
3045
|
-
const resolvedText = `${text}`;
|
|
3046
|
-
const resolvedAriaLabel = resolvedText.length > 0 ? resolvedText : void 0;
|
|
3047
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
3048
|
-
"span",
|
|
3049
|
-
__spreadProps(__spreadValues({
|
|
3050
|
-
"aria-label": resolvedAriaLabel,
|
|
3051
|
-
className: cn(
|
|
3052
|
-
"group/agg-badge",
|
|
3053
|
-
baseBadgeClasses,
|
|
3054
|
-
badgeSizeClasses[size],
|
|
3055
|
-
onClick ? "cursor-pointer hover:bg-agg-tertiary disabled:cursor-not-allowed" : "",
|
|
3056
|
-
getMotionClassName(
|
|
3057
|
-
enableAnimations,
|
|
3058
|
-
"transition-[border-color,background-color] duration-200 ease-in-out"
|
|
3059
|
-
),
|
|
3060
|
-
isActive ? "border-agg-primary bg-agg-secondary! font-agg-bold!" : "border-transparent font-agg-normal",
|
|
3061
|
-
classNames == null ? void 0 : classNames.root
|
|
3062
|
-
)
|
|
3063
|
-
}, onClick && { onClick }), {
|
|
3064
|
-
children: [
|
|
3065
|
-
prefix ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: classNames == null ? void 0 : classNames.prefix, children: prefix }) : null,
|
|
3066
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: cn("truncate", classNames == null ? void 0 : classNames.text), children: text }),
|
|
3067
|
-
suffix ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: classNames == null ? void 0 : classNames.suffix, children: suffix }) : null
|
|
3068
|
-
]
|
|
3069
|
-
})
|
|
3070
|
-
);
|
|
3071
|
-
}
|
|
3072
|
-
Badge.displayName = "Badge";
|
|
3073
|
-
|
|
3074
|
-
// src/shared/query-error.ts
|
|
3075
|
-
var getErrorStatus = (error) => {
|
|
3076
|
-
if (!error || typeof error !== "object")
|
|
3077
|
-
return null;
|
|
3078
|
-
const status = error.status;
|
|
3079
|
-
return typeof status === "number" ? status : null;
|
|
3080
|
-
};
|
|
3081
|
-
var isErrorWithStatus = (error, status) => {
|
|
3082
|
-
return getErrorStatus(error) === status;
|
|
3083
|
-
};
|
|
3084
|
-
|
|
3085
|
-
// src/events/item/event-list-item.utils.ts
|
|
3086
|
-
var resolveEventListItemEvent = (fetchedEvent) => {
|
|
3087
|
-
if (!fetchedEvent)
|
|
3088
|
-
return void 0;
|
|
3089
|
-
const mergedVenueMarkets = fetchedEvent.markets.flatMap(
|
|
3090
|
-
(market) => market.venueMarkets
|
|
3091
|
-
);
|
|
3092
|
-
if (mergedVenueMarkets.length === 0)
|
|
3093
|
-
return void 0;
|
|
3094
|
-
return fetchedEvent;
|
|
3095
|
-
};
|
|
3096
|
-
var normalizeProbability = (value) => {
|
|
3097
|
-
if (typeof value !== "number" || !Number.isFinite(value))
|
|
3098
|
-
return void 0;
|
|
3099
|
-
if (value < 0)
|
|
3100
|
-
return 0;
|
|
3101
|
-
if (value > 1)
|
|
3102
|
-
return 1;
|
|
3103
|
-
return value;
|
|
3104
|
-
};
|
|
3105
|
-
var hasDateLabel = (outcome) => {
|
|
3106
|
-
return !!toDate(outcome.label);
|
|
3107
|
-
};
|
|
3108
|
-
var sortOutcomes = (outcomes) => {
|
|
3109
|
-
if (outcomes.length <= 1)
|
|
3110
|
-
return outcomes;
|
|
3111
|
-
const now = Date.now();
|
|
3112
|
-
if (outcomes.some(hasDateLabel)) {
|
|
3113
|
-
return [...outcomes].sort((a, b) => {
|
|
3114
|
-
var _a, _b, _c, _d;
|
|
3115
|
-
const aDate = (_b = (_a = toDate(a.label)) == null ? void 0 : _a.getTime()) != null ? _b : 0;
|
|
3116
|
-
const bDate = (_d = (_c = toDate(b.label)) == null ? void 0 : _c.getTime()) != null ? _d : 0;
|
|
3117
|
-
return Math.abs(aDate - now) - Math.abs(bDate - now);
|
|
3118
|
-
});
|
|
3119
|
-
}
|
|
3120
|
-
return [...outcomes].sort((a, b) => {
|
|
3121
|
-
var _a, _b;
|
|
3122
|
-
const aPrice = (_a = normalizeProbability(a.price)) != null ? _a : 0;
|
|
3123
|
-
const bPrice = (_b = normalizeProbability(b.price)) != null ? _b : 0;
|
|
3124
|
-
return bPrice - aPrice;
|
|
3125
|
-
});
|
|
3126
|
-
};
|
|
3127
|
-
var compareVisibleOutcomeRows = (left, right) => {
|
|
3128
|
-
var _a, _b;
|
|
3129
|
-
const leftDate = toDate(resolveOutcomeTitle(left.outcome));
|
|
3130
|
-
const rightDate = toDate(resolveOutcomeTitle(right.outcome));
|
|
3131
|
-
if (leftDate && rightDate) {
|
|
3132
|
-
return leftDate.getTime() - rightDate.getTime();
|
|
3133
|
-
}
|
|
3134
|
-
const leftProbability = (_a = normalizeProbability(left.outcome.price)) != null ? _a : -1;
|
|
3135
|
-
const rightProbability = (_b = normalizeProbability(right.outcome.price)) != null ? _b : -1;
|
|
3136
|
-
return rightProbability - leftProbability;
|
|
3137
|
-
};
|
|
3138
|
-
var shouldReplaceVisibleOutcome = (current, next) => {
|
|
3139
|
-
var _a, _b;
|
|
3140
|
-
const currentVolume = typeof current.market.volume === "number" ? current.market.volume : -1;
|
|
3141
|
-
const nextVolume = typeof next.market.volume === "number" ? next.market.volume : -1;
|
|
3142
|
-
if (currentVolume !== nextVolume) {
|
|
3143
|
-
return nextVolume > currentVolume;
|
|
3144
|
-
}
|
|
3145
|
-
const currentProbability = (_a = normalizeProbability(current.outcome.price)) != null ? _a : -1;
|
|
3146
|
-
const nextProbability = (_b = normalizeProbability(next.outcome.price)) != null ? _b : -1;
|
|
3147
|
-
return nextProbability > currentProbability;
|
|
3148
|
-
};
|
|
3149
|
-
var resolveVisibleOutcomes = (venueMarkets, maxOutcomes) => {
|
|
3150
|
-
const visibleOutcomesByLabel = /* @__PURE__ */ new Map();
|
|
3151
|
-
venueMarkets.forEach((market) => {
|
|
3152
|
-
sortOutcomes(market.venueMarketOutcomes).forEach((outcome) => {
|
|
3153
|
-
const title = resolveOutcomeTitle(outcome);
|
|
3154
|
-
const normalizedTitle = title.trim().toLowerCase();
|
|
3155
|
-
const nextVisibleOutcome = {
|
|
3156
|
-
venue: market.venue,
|
|
3157
|
-
market,
|
|
3158
|
-
outcome,
|
|
3159
|
-
title
|
|
3160
|
-
};
|
|
3161
|
-
const currentVisibleOutcome = visibleOutcomesByLabel.get(normalizedTitle);
|
|
3162
|
-
if (!currentVisibleOutcome || shouldReplaceVisibleOutcome(currentVisibleOutcome, nextVisibleOutcome)) {
|
|
3163
|
-
visibleOutcomesByLabel.set(normalizedTitle, nextVisibleOutcome);
|
|
3164
|
-
}
|
|
3165
|
-
});
|
|
3166
|
-
});
|
|
3167
|
-
return [...visibleOutcomesByLabel.values()].sort(compareVisibleOutcomeRows).slice(0, Math.max(1, maxOutcomes));
|
|
3168
|
-
};
|
|
3169
|
-
var resolveOutcomeTitle = (outcome) => {
|
|
3170
|
-
if (outcome.title && outcome.title.trim())
|
|
3171
|
-
return outcome.title;
|
|
3172
|
-
return outcome.label;
|
|
3173
|
-
};
|
|
3174
|
-
var selectPrimaryVenueMarket = (venueMarkets) => {
|
|
3175
|
-
if (venueMarkets.length === 0)
|
|
3176
|
-
return void 0;
|
|
3177
|
-
if (venueMarkets.length === 1)
|
|
3178
|
-
return venueMarkets[0];
|
|
3179
|
-
return [...venueMarkets].sort((a, b) => {
|
|
3180
|
-
const aVolume = typeof a.volume === "number" ? a.volume : -1;
|
|
3181
|
-
const bVolume = typeof b.volume === "number" ? b.volume : -1;
|
|
3182
|
-
return bVolume - aVolume;
|
|
3183
|
-
})[0];
|
|
3184
|
-
};
|
|
3185
|
-
var resolveTileTitle = (event, primaryVenueMarket, titleOverride) => {
|
|
3186
|
-
if (typeof titleOverride === "string" && titleOverride.trim()) {
|
|
3187
|
-
return titleOverride;
|
|
3188
|
-
}
|
|
3189
|
-
if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.question) === "string" && primaryVenueMarket.question.trim()) {
|
|
3190
|
-
return primaryVenueMarket.question;
|
|
3191
|
-
}
|
|
3192
|
-
return event.title;
|
|
3193
|
-
};
|
|
3194
|
-
var resolveTileImage = (event, primaryVenueMarket, imageOverride) => {
|
|
3195
|
-
if (typeof imageOverride === "string" && imageOverride.trim()) {
|
|
3196
|
-
return imageOverride;
|
|
3197
|
-
}
|
|
3198
|
-
if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.image) === "string" && primaryVenueMarket.image.trim()) {
|
|
3199
|
-
return primaryVenueMarket.image;
|
|
3200
|
-
}
|
|
3201
|
-
if (typeof event.image === "string" && event.image.trim()) {
|
|
3202
|
-
return event.image;
|
|
3203
|
-
}
|
|
3204
|
-
return void 0;
|
|
3205
|
-
};
|
|
3206
|
-
var formatCountLabel = (count, singular, plural) => {
|
|
3207
|
-
return `${count} ${count === 1 ? singular : plural}`;
|
|
3208
|
-
};
|
|
3209
|
-
var getVenueSummary = (venueMarkets) => {
|
|
3210
|
-
const uniqueVenues = Array.from(new Set(venueMarkets.map((market) => market.venue)));
|
|
3211
|
-
return {
|
|
3212
|
-
marketCount: venueMarkets.length,
|
|
3213
|
-
venueCount: uniqueVenues.length,
|
|
3214
|
-
singleVenue: uniqueVenues.length === 1 ? uniqueVenues[0] : void 0
|
|
3215
|
-
};
|
|
3216
|
-
};
|
|
3217
|
-
var resolveVenueLabel = (venue, venueInfo, labels) => {
|
|
3218
|
-
var _a, _b;
|
|
3219
|
-
if (!venue)
|
|
3220
|
-
return labels.eventItem.venueSingular;
|
|
3221
|
-
return (_b = (_a = venueInfo == null ? void 0 : venueInfo[venue]) == null ? void 0 : _a.label) != null ? _b : labels.venues[venue];
|
|
3222
|
-
};
|
|
3223
|
-
|
|
3224
|
-
// src/events/item/index.tsx
|
|
3225
|
-
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3226
|
-
var EventListItemLoadingState = ({
|
|
3227
|
-
classNames,
|
|
3228
|
-
ariaLabel
|
|
3229
|
-
}) => {
|
|
3230
|
-
const labels = (0, import_hooks13.useLabels)();
|
|
3231
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3232
|
-
Skeleton,
|
|
3233
|
-
{
|
|
3234
|
-
view: "event-list-item",
|
|
3235
|
-
className: classNames == null ? void 0 : classNames.root,
|
|
3236
|
-
ariaLabel: ariaLabel != null ? ariaLabel : labels.eventItem.loading
|
|
3237
|
-
}
|
|
3238
|
-
);
|
|
3239
|
-
};
|
|
3240
|
-
var EventListItemUnavailableState = ({
|
|
3241
|
-
classNames,
|
|
3242
|
-
ariaLabel
|
|
3243
|
-
}) => {
|
|
3244
|
-
const labels = (0, import_hooks13.useLabels)();
|
|
3245
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3246
|
-
Card,
|
|
3247
|
-
{
|
|
3248
|
-
className: cn(baseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
3249
|
-
role: "status",
|
|
3250
|
-
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItem.unavailableAria,
|
|
3251
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: cn("flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
|
|
3252
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Typography, { variant: "body-large-strong", className: cn("truncate", classNames == null ? void 0 : classNames.title), children: labels.eventItem.unavailableTitle }),
|
|
3253
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItem.unavailableDescription })
|
|
3254
|
-
] })
|
|
3255
|
-
}
|
|
3256
|
-
);
|
|
3257
|
-
};
|
|
3258
|
-
var EventListItemNotFoundState = ({
|
|
3259
|
-
classNames,
|
|
3260
|
-
ariaLabel
|
|
3261
|
-
}) => {
|
|
3262
|
-
const labels = (0, import_hooks13.useLabels)();
|
|
3263
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Card, { className: cn("w-full gap-0 overflow-hidden p-0", classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3264
|
-
StateMessage,
|
|
3265
|
-
{
|
|
3266
|
-
ariaLabel: ariaLabel != null ? ariaLabel : labels.eventItemDetails.notFoundAria,
|
|
3267
|
-
title: labels.eventItemDetails.notFoundTitle,
|
|
3268
|
-
description: labels.eventItemDetails.notFoundDescription,
|
|
3269
|
-
className: "min-h-[280px] md:min-h-[320px]"
|
|
3270
|
-
}
|
|
3271
|
-
) });
|
|
3272
|
-
};
|
|
3273
|
-
var EventListItemContent = ({
|
|
3274
|
-
event,
|
|
3275
|
-
title,
|
|
3276
|
-
image,
|
|
3277
|
-
showVenueLogo = true,
|
|
3278
|
-
maxOutcomes = 2,
|
|
3279
|
-
classNames,
|
|
3280
|
-
venueInfo,
|
|
3281
|
-
arbitrageByOutcomeId,
|
|
3282
|
-
onClick,
|
|
3283
|
-
ariaLabel
|
|
3284
|
-
}) => {
|
|
3285
|
-
var _a;
|
|
3286
|
-
const config = (0, import_hooks13.useSdkUiConfig)();
|
|
3287
|
-
const labels = (0, import_hooks13.useLabels)();
|
|
3288
|
-
const allVenueMarkets = (0, import_react3.useMemo)(() => {
|
|
3289
|
-
return event.markets.flatMap((market) => market.venueMarkets);
|
|
3290
|
-
}, [event.markets]);
|
|
3291
|
-
const primaryVenueMarket = (0, import_react3.useMemo)(() => {
|
|
3292
|
-
return selectPrimaryVenueMarket(allVenueMarkets);
|
|
3293
|
-
}, [allVenueMarkets]);
|
|
3294
|
-
const visibleOutcomes = (0, import_react3.useMemo)(() => {
|
|
3295
|
-
if (allVenueMarkets.length === 0)
|
|
3296
|
-
return [];
|
|
3297
|
-
return resolveVisibleOutcomes(allVenueMarkets, maxOutcomes);
|
|
3298
|
-
}, [allVenueMarkets, maxOutcomes]);
|
|
3299
|
-
const resolvedTitle = resolveTileTitle(event, primaryVenueMarket, title);
|
|
3300
|
-
const resolvedImage = resolveTileImage(event, primaryVenueMarket, image);
|
|
3301
|
-
const { marketCount, venueCount, singleVenue } = getVenueSummary(allVenueMarkets);
|
|
3302
|
-
const venueLabel = resolveVenueLabel(singleVenue, venueInfo, labels);
|
|
3303
|
-
const visibleVenueLogos = (0, import_react3.useMemo)(() => {
|
|
3304
|
-
return Array.from(new Set(allVenueMarkets.map((market) => market.venue))).slice(0, 4);
|
|
3305
|
-
}, [allVenueMarkets]);
|
|
3306
|
-
const resolvedVolume = typeof event.volume === "number" ? event.volume : (_a = primaryVenueMarket == null ? void 0 : primaryVenueMarket.volume) != null ? _a : void 0;
|
|
3307
|
-
const volumeLabel = typeof resolvedVolume === "number" ? `${config.formatCompactCurrency(resolvedVolume)} ${labels.eventItem.volumeSuffix}` : "";
|
|
3308
|
-
const handleKeyDown = (eventToHandle) => {
|
|
3309
|
-
if (!onClick)
|
|
3310
|
-
return;
|
|
3311
|
-
if ((eventToHandle == null ? void 0 : eventToHandle.key) === "Enter" || (eventToHandle == null ? void 0 : eventToHandle.key) === " ") {
|
|
3312
|
-
eventToHandle == null ? void 0 : eventToHandle.preventDefault();
|
|
3313
|
-
onClick();
|
|
3314
|
-
}
|
|
3315
|
-
};
|
|
3316
|
-
const renderArbitrage = (value) => {
|
|
3317
|
-
if (value == null)
|
|
3318
|
-
return null;
|
|
3319
|
-
if (Math.abs(value) < config.arbitrageThreshold)
|
|
3320
|
-
return null;
|
|
3321
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: cn("flex items-center gap-1", "text-agg-success"), children: [
|
|
3322
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Typography, { variant: "label-strong", className: "text-agg-success", children: config.formatPercent(value) }),
|
|
3323
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3324
|
-
Icon,
|
|
3325
|
-
{
|
|
3326
|
-
name: "triangle-up",
|
|
3327
|
-
size: "small",
|
|
3328
|
-
title: labels.eventItem.arbitrage,
|
|
3329
|
-
className: "size-2!"
|
|
3330
|
-
}
|
|
3331
|
-
)
|
|
3332
|
-
] });
|
|
3333
|
-
};
|
|
3334
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
3335
|
-
Card,
|
|
3336
|
-
{
|
|
3337
|
-
className: cn(baseCardClassName, onClick && "cursor-pointer", classNames == null ? void 0 : classNames.root),
|
|
3338
|
-
role: onClick ? "button" : void 0,
|
|
3339
|
-
tabIndex: onClick ? 0 : void 0,
|
|
3340
|
-
onClick,
|
|
3341
|
-
onKeyDown: handleKeyDown,
|
|
3342
|
-
"aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
|
|
3343
|
-
children: [
|
|
3344
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: cn("flex items-center gap-3", classNames == null ? void 0 : classNames.header), children: [
|
|
3345
|
-
resolvedImage ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3346
|
-
"img",
|
|
3347
|
-
{
|
|
3348
|
-
src: resolvedImage,
|
|
3349
|
-
alt: "",
|
|
3350
|
-
className: cn("h-10 w-10", "rounded-agg-lg object-cover")
|
|
3351
|
-
}
|
|
3352
|
-
) : null,
|
|
3353
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3354
|
-
Typography,
|
|
3355
|
-
{
|
|
3356
|
-
variant: "body-strong",
|
|
3357
|
-
className: cn(
|
|
3358
|
-
"min-w-0 text-agg-base font-agg-bold leading-agg-6 ",
|
|
3359
|
-
"truncate text-wrap wrap-break-word line-clamp-2",
|
|
3360
|
-
classNames == null ? void 0 : classNames.title
|
|
3361
|
-
),
|
|
3362
|
-
children: resolvedTitle
|
|
3363
|
-
}
|
|
3364
|
-
)
|
|
3365
|
-
] }),
|
|
3366
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: cn("flex flex-col gap-3", classNames == null ? void 0 : classNames.outcomes), children: visibleOutcomes.map((visibleOutcome) => {
|
|
3367
|
-
const probability = normalizeProbability(visibleOutcome.outcome.price);
|
|
3368
|
-
const showBadge = typeof probability === "number";
|
|
3369
|
-
const arbitragePercent = arbitrageByOutcomeId == null ? void 0 : arbitrageByOutcomeId[visibleOutcome.outcome.id];
|
|
3370
|
-
const outcomeTitle = resolveOutcomeTitle(visibleOutcome.outcome);
|
|
3371
|
-
const formattedTitle = (0, import_dayjs.default)(outcomeTitle).isValid() ? (0, import_dayjs.default)(outcomeTitle).format("MMMM D, YYYY") : outcomeTitle;
|
|
3372
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
3373
|
-
"div",
|
|
3374
|
-
{
|
|
3375
|
-
className: cn(
|
|
3376
|
-
"flex flex-row gap-3 w-full items-center justify-between",
|
|
3377
|
-
classNames == null ? void 0 : classNames.outcomeRow
|
|
3378
|
-
),
|
|
3379
|
-
children: [
|
|
3380
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3381
|
-
Typography,
|
|
3382
|
-
{
|
|
3383
|
-
variant: "body",
|
|
3384
|
-
className: "min-w-0 truncate text-agg-sm leading-agg-5 md:text-agg-base md:leading-agg-6",
|
|
3385
|
-
children: formattedTitle
|
|
3386
|
-
}
|
|
3387
|
-
),
|
|
3388
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex flex-row gap-3 items-center justify-end", children: [
|
|
3389
|
-
renderArbitrage(arbitragePercent),
|
|
3390
|
-
showBadge ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3391
|
-
Badge,
|
|
3392
|
-
{
|
|
3393
|
-
text: config.formatPercent(probability),
|
|
3394
|
-
prefix: showVenueLogo ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(VenueLogo, { venue: visibleOutcome.venue, size: "small" }) : void 0,
|
|
3395
|
-
size: "large",
|
|
3396
|
-
classNames: {
|
|
3397
|
-
root: cn(
|
|
3398
|
-
"h-9 min-w-[101px] justify-center px-4 text-agg-base leading-agg-6",
|
|
3399
|
-
classNames == null ? void 0 : classNames.badge
|
|
3400
|
-
)
|
|
3401
|
-
}
|
|
3402
|
-
}
|
|
3403
|
-
) : null
|
|
3404
|
-
] })
|
|
3405
|
-
]
|
|
3406
|
-
},
|
|
3407
|
-
`${visibleOutcome.market.id}-${visibleOutcome.outcome.id}`
|
|
3408
|
-
);
|
|
3409
|
-
}) }),
|
|
3410
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
3256
|
+
items: selectItems,
|
|
3257
|
+
onChange: handleSelect,
|
|
3258
|
+
value
|
|
3259
|
+
}
|
|
3260
|
+
) });
|
|
3261
|
+
}
|
|
3262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
3263
|
+
"div",
|
|
3264
|
+
{
|
|
3265
|
+
className: cn(
|
|
3266
|
+
"group/agg-tabs",
|
|
3267
|
+
"relative max-w-full items-stretch font-agg-sans bg-agg-secondary",
|
|
3268
|
+
"inline-flex",
|
|
3269
|
+
className,
|
|
3270
|
+
classNames == null ? void 0 : classNames.root
|
|
3271
|
+
),
|
|
3272
|
+
children: [
|
|
3273
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
3411
3274
|
"div",
|
|
3412
3275
|
{
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3276
|
+
ref: tabListRef,
|
|
3277
|
+
role: "tablist",
|
|
3278
|
+
"aria-label": resolvedAriaLabel,
|
|
3279
|
+
className: cn("relative", tabListClassName, classNames == null ? void 0 : classNames.tabList),
|
|
3280
|
+
onClickCapture: handleTabListClickCapture,
|
|
3281
|
+
onPointerCancel: handleEndTabListDrag,
|
|
3282
|
+
onPointerDown: handleTabListPointerDown,
|
|
3283
|
+
onPointerMove: handleTabListPointerMove,
|
|
3284
|
+
onPointerUp: handleEndTabListDrag,
|
|
3285
|
+
onWheel: handleTabListWheel,
|
|
3418
3286
|
children: [
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
labels.eventItem.marketPlural
|
|
3424
|
-
) }),
|
|
3425
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "text-agg-muted-foreground", children: "\xD7" }),
|
|
3426
|
-
singleVenue ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "flex items-center gap-1 truncate text-agg-muted-foreground", children: [
|
|
3427
|
-
showVenueLogo ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3428
|
-
VenueLogo,
|
|
3429
|
-
{
|
|
3430
|
-
venue: singleVenue,
|
|
3431
|
-
size: "small",
|
|
3432
|
-
isMonochromatic: true,
|
|
3433
|
-
className: "text-agg-muted-foreground!"
|
|
3434
|
-
}
|
|
3435
|
-
) : null,
|
|
3436
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: venueLabel })
|
|
3437
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "truncate text-agg-muted-foreground", children: formatCountLabel(
|
|
3438
|
-
venueCount,
|
|
3439
|
-
labels.eventItem.venueSingular,
|
|
3440
|
-
labels.eventItem.venuePlural
|
|
3441
|
-
) }),
|
|
3442
|
-
showVenueLogo && !singleVenue && visibleVenueLogos.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "flex items-center gap-1 overflow-hidden", children: visibleVenueLogos.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3443
|
-
VenueLogo,
|
|
3287
|
+
renderedItems.map((item, index) => {
|
|
3288
|
+
const isActive = item.value === value;
|
|
3289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
3290
|
+
"button",
|
|
3444
3291
|
{
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3292
|
+
ref: (buttonElement) => {
|
|
3293
|
+
buttonRefs.current[index] = buttonElement;
|
|
3294
|
+
},
|
|
3295
|
+
type: "button",
|
|
3296
|
+
role: "tab",
|
|
3297
|
+
tabIndex: isActive ? 0 : -1,
|
|
3298
|
+
"aria-selected": isActive,
|
|
3299
|
+
"aria-label": item.label,
|
|
3300
|
+
disabled: item.disabled,
|
|
3301
|
+
onClick: (e) => {
|
|
3302
|
+
e.preventDefault();
|
|
3303
|
+
e.stopPropagation();
|
|
3304
|
+
handleSelect(item.value);
|
|
3305
|
+
},
|
|
3306
|
+
onKeyDown: (event) => handleKeyDown(event, index),
|
|
3307
|
+
className: cn(
|
|
3308
|
+
getTabButtonClassName({
|
|
3309
|
+
enableAnimations,
|
|
3310
|
+
isBarVariant,
|
|
3311
|
+
isActive,
|
|
3312
|
+
isDisabled: !!item.disabled,
|
|
3313
|
+
size
|
|
3314
|
+
}),
|
|
3315
|
+
shouldUseOverflowScroll && !isBarVariant && "snap-start"
|
|
3316
|
+
),
|
|
3317
|
+
children: [
|
|
3318
|
+
isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_jsx_runtime60.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3319
|
+
"span",
|
|
3320
|
+
{
|
|
3321
|
+
"aria-hidden": true,
|
|
3322
|
+
className: cn(
|
|
3323
|
+
"pointer-events-none absolute inset-px origin-bottom rounded-[2px] bg-agg-secondary-hover",
|
|
3324
|
+
getMotionClassName(
|
|
3325
|
+
enableAnimations,
|
|
3326
|
+
"transition-[transform,opacity] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none"
|
|
3327
|
+
),
|
|
3328
|
+
isActive ? "scale-y-100 opacity-100" : "scale-y-0 opacity-0"
|
|
3329
|
+
)
|
|
3330
|
+
}
|
|
3331
|
+
) }) : null,
|
|
3332
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "relative z-10 inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
|
|
3333
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "relative z-10 truncate whitespace-nowrap [&::first-letter]:uppercase", children: item.label })
|
|
3334
|
+
]
|
|
3449
3335
|
},
|
|
3450
|
-
|
|
3451
|
-
)
|
|
3452
|
-
|
|
3453
|
-
|
|
3336
|
+
item.value
|
|
3337
|
+
);
|
|
3338
|
+
}),
|
|
3339
|
+
!isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3340
|
+
"span",
|
|
3341
|
+
{
|
|
3342
|
+
"aria-hidden": true,
|
|
3343
|
+
className: cn(
|
|
3344
|
+
"pointer-events-none absolute bottom-0 left-0 rounded-t-agg-sm bg-agg-primary",
|
|
3345
|
+
getMotionClassName(
|
|
3346
|
+
enableAnimations,
|
|
3347
|
+
"transition-[transform,width,opacity] duration-300 ease-in-out"
|
|
3348
|
+
),
|
|
3349
|
+
"h-[3px]"
|
|
3350
|
+
),
|
|
3351
|
+
style: activeUnderlineStyle
|
|
3352
|
+
}
|
|
3353
|
+
) : null
|
|
3454
3354
|
]
|
|
3455
3355
|
}
|
|
3456
|
-
)
|
|
3356
|
+
),
|
|
3357
|
+
shouldUseOverflowScroll && !isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
3358
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3359
|
+
"span",
|
|
3360
|
+
{
|
|
3361
|
+
"aria-hidden": true,
|
|
3362
|
+
className: cn(
|
|
3363
|
+
"pointer-events-none absolute top-0 bottom-0 left-8 z-10 w-12 md:w-18 bg-linear-to-r from-agg-secondary via-agg-secondary to-transparent",
|
|
3364
|
+
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
3365
|
+
scrollAffordanceState.showStart ? "opacity-100" : "opacity-0"
|
|
3366
|
+
)
|
|
3367
|
+
}
|
|
3368
|
+
),
|
|
3369
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3370
|
+
"span",
|
|
3371
|
+
{
|
|
3372
|
+
"aria-hidden": true,
|
|
3373
|
+
className: cn(
|
|
3374
|
+
"pointer-events-none absolute top-0 right-8 bottom-0 z-10 w-12 md:w-18 bg-linear-to-l from-agg-secondary via-agg-secondary to-transparent",
|
|
3375
|
+
getMotionClassName(enableAnimations, "transition-opacity duration-200"),
|
|
3376
|
+
scrollAffordanceState.showEnd ? "opacity-100" : "opacity-0"
|
|
3377
|
+
)
|
|
3378
|
+
}
|
|
3379
|
+
)
|
|
3380
|
+
] }) : null
|
|
3457
3381
|
]
|
|
3458
3382
|
}
|
|
3459
3383
|
);
|
|
3460
3384
|
};
|
|
3461
|
-
|
|
3462
|
-
var _b = _a, {
|
|
3463
|
-
eventId
|
|
3464
|
-
} = _b, rest = __objRest(_b, [
|
|
3465
|
-
"eventId"
|
|
3466
|
-
]);
|
|
3467
|
-
const {
|
|
3468
|
-
event: fetchedEvent,
|
|
3469
|
-
error,
|
|
3470
|
-
isError,
|
|
3471
|
-
isLoading
|
|
3472
|
-
} = (0, import_hooks13.useEvent)(eventId, {
|
|
3473
|
-
enabled: !!eventId
|
|
3474
|
-
});
|
|
3475
|
-
const resolvedEvent = (0, import_react3.useMemo)(() => {
|
|
3476
|
-
return resolveEventListItemEvent(fetchedEvent);
|
|
3477
|
-
}, [fetchedEvent]);
|
|
3478
|
-
if (!eventId) {
|
|
3479
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(EventListItemUnavailableState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
3480
|
-
}
|
|
3481
|
-
if (isLoading) {
|
|
3482
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
3483
|
-
}
|
|
3484
|
-
if (isErrorWithStatus(error, 404)) {
|
|
3485
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(EventListItemNotFoundState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
3486
|
-
}
|
|
3487
|
-
if (!fetchedEvent && !isError) {
|
|
3488
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
3489
|
-
}
|
|
3490
|
-
if (!resolvedEvent) {
|
|
3491
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(EventListItemUnavailableState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
3492
|
-
}
|
|
3493
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(EventListItemContent, __spreadValues({ event: resolvedEvent }, rest));
|
|
3494
|
-
};
|
|
3495
|
-
var EventListItem = (props) => {
|
|
3496
|
-
if (props.isLoading) {
|
|
3497
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(EventListItemLoadingState, { classNames: props.classNames, ariaLabel: props.ariaLabel });
|
|
3498
|
-
}
|
|
3499
|
-
if ("event" in props && props.event) {
|
|
3500
|
-
const _a = props, { event } = _a, rest = __objRest(_a, ["event"]);
|
|
3501
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(EventListItemContent, __spreadValues({ event }, rest));
|
|
3502
|
-
}
|
|
3503
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(EventListItemByEventId, __spreadValues({}, props));
|
|
3504
|
-
};
|
|
3505
|
-
EventListItem.displayName = "EventListItem";
|
|
3385
|
+
Tabs.displayName = "Tabs";
|
|
3506
3386
|
|
|
3507
|
-
// src/
|
|
3508
|
-
var
|
|
3509
|
-
var
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
var getDefaultEventListTabs = (labels) => {
|
|
3513
|
-
return [
|
|
3514
|
-
{
|
|
3515
|
-
value: "matched",
|
|
3516
|
-
label: labels.eventList.matchedTab,
|
|
3517
|
-
iconName: "arrows-to-dot"
|
|
3518
|
-
},
|
|
3519
|
-
{
|
|
3520
|
-
value: "polymarket",
|
|
3521
|
-
label: labels.venues.polymarket,
|
|
3522
|
-
venueLogo: POLYMARKET_VENUE_LOGO,
|
|
3523
|
-
venues: [POLYMARKET_VENUE]
|
|
3524
|
-
},
|
|
3387
|
+
// src/trading/place-order/index.tsx
|
|
3388
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3389
|
+
var WarningFilledIcon2 = ({ className }) => {
|
|
3390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
3391
|
+
"svg",
|
|
3525
3392
|
{
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3393
|
+
viewBox: "0 0 16 16",
|
|
3394
|
+
fill: "none",
|
|
3395
|
+
className: cn("text-agg-warning", className),
|
|
3396
|
+
"aria-hidden": "true",
|
|
3397
|
+
children: [
|
|
3398
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "M8 1.33301L15.3333 14.6663H0.666656L8 1.33301Z", fill: "currentColor" }),
|
|
3399
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "M8 5.33301V8.66634", stroke: "white", strokeWidth: "1.4", strokeLinecap: "round" }),
|
|
3400
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("circle", { cx: "8", cy: "11.1667", r: "0.833333", fill: "white" })
|
|
3401
|
+
]
|
|
3530
3402
|
}
|
|
3531
|
-
|
|
3403
|
+
);
|
|
3532
3404
|
};
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3405
|
+
var ErrorFilledIcon = ({ className }) => {
|
|
3406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
3407
|
+
"svg",
|
|
3408
|
+
{
|
|
3409
|
+
viewBox: "0 0 16 16",
|
|
3410
|
+
fill: "none",
|
|
3411
|
+
className: cn("text-agg-error", className),
|
|
3412
|
+
"aria-hidden": "true",
|
|
3413
|
+
children: [
|
|
3414
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("circle", { cx: "8", cy: "8", r: "8", fill: "currentColor" }),
|
|
3415
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "M8 4.16699V8.50033", stroke: "white", strokeWidth: "1.4", strokeLinecap: "round" }),
|
|
3416
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("circle", { cx: "8", cy: "11.167", r: "0.833333", fill: "white" })
|
|
3417
|
+
]
|
|
3418
|
+
}
|
|
3419
|
+
);
|
|
3540
3420
|
};
|
|
3541
|
-
var
|
|
3542
|
-
return
|
|
3421
|
+
var getPlaceOrderContainerClassName = () => {
|
|
3422
|
+
return "overflow-hidden rounded-agg-xl border border-agg-border bg-agg-secondary shadow-none hover:shadow-none";
|
|
3543
3423
|
};
|
|
3544
|
-
var
|
|
3545
|
-
if (!
|
|
3546
|
-
return
|
|
3547
|
-
if (tab.venues && tab.venues.length > 0)
|
|
3548
|
-
return tab.venues;
|
|
3549
|
-
if (tab.value === "polymarket" || tab.value === "kalshi") {
|
|
3550
|
-
return [tab.value];
|
|
3424
|
+
var getRoutingCardClassName = (isHighlighted) => {
|
|
3425
|
+
if (!isHighlighted) {
|
|
3426
|
+
return "border-agg-border bg-agg-secondary";
|
|
3551
3427
|
}
|
|
3552
|
-
return
|
|
3428
|
+
return "border-agg-trade-highlight-border bg-agg-trade-highlight-surface";
|
|
3429
|
+
};
|
|
3430
|
+
var getResultValueClassName = (tone) => {
|
|
3431
|
+
if (tone === "default")
|
|
3432
|
+
return "text-agg-foreground";
|
|
3433
|
+
return "text-agg-success";
|
|
3434
|
+
};
|
|
3435
|
+
var negativeOutcomePattern = /\b(no|down|against|under|lose|false)\b/i;
|
|
3436
|
+
var resolveIsPositiveOutcome = (outcome, index) => {
|
|
3437
|
+
const outcomeText = `${outcome.id} ${outcome.label}`;
|
|
3438
|
+
if (negativeOutcomePattern.test(outcomeText))
|
|
3439
|
+
return false;
|
|
3440
|
+
if (index === 1)
|
|
3441
|
+
return false;
|
|
3442
|
+
return true;
|
|
3443
|
+
};
|
|
3444
|
+
var getOutcomeButtonClassName = ({
|
|
3445
|
+
enableAnimations,
|
|
3446
|
+
isActive,
|
|
3447
|
+
isPositive
|
|
3448
|
+
}) => {
|
|
3449
|
+
return cn(
|
|
3450
|
+
"flex-1 cursor-pointer rounded-agg-full border px-6 py-2.5 text-agg-base leading-agg-6",
|
|
3451
|
+
getMotionClassName(enableAnimations, "transition-all duration-300 ease-in-out"),
|
|
3452
|
+
isActive ? isPositive ? "border-transparent bg-[#18c15c] font-agg-bold text-agg-on-primary" : "border-transparent bg-[#e5455f] font-agg-bold text-agg-on-primary" : "border-transparent bg-agg-secondary-hover font-agg-normal text-agg-foreground hover:bg-agg-tertiary"
|
|
3453
|
+
);
|
|
3553
3454
|
};
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
}
|
|
3561
|
-
if (!tab.iconName)
|
|
3455
|
+
var getStatusContent = ({
|
|
3456
|
+
placement,
|
|
3457
|
+
status,
|
|
3458
|
+
onStatusAction
|
|
3459
|
+
}) => {
|
|
3460
|
+
if (!status || status.placement !== placement)
|
|
3562
3461
|
return null;
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3462
|
+
if (status.tone === "warning") {
|
|
3463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center justify-center gap-2", children: [
|
|
3464
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(WarningFilledIcon2, { className: "h-4 w-4 shrink-0" }),
|
|
3465
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: status.message })
|
|
3466
|
+
] });
|
|
3467
|
+
}
|
|
3468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center gap-3 rounded-agg-lg bg-agg-status-error-surface px-3 py-2.5", children: [
|
|
3469
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
3470
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ErrorFilledIcon, { className: "h-4 w-4 shrink-0" }),
|
|
3471
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "min-w-0 flex-1 text-agg-sm leading-agg-5 text-agg-foreground", children: status.message })
|
|
3472
|
+
] }),
|
|
3473
|
+
status.actionLabel ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3474
|
+
"button",
|
|
3475
|
+
{
|
|
3476
|
+
type: "button",
|
|
3477
|
+
className: "shrink-0 text-agg-sm font-agg-bold leading-agg-5 text-agg-primary",
|
|
3478
|
+
"aria-label": status.actionLabel,
|
|
3479
|
+
onClick: onStatusAction,
|
|
3480
|
+
children: status.actionLabel
|
|
3481
|
+
}
|
|
3482
|
+
) : null
|
|
3483
|
+
] });
|
|
3571
3484
|
};
|
|
3572
|
-
var
|
|
3573
|
-
var TAB_HORIZONTAL_PADDING = 32;
|
|
3574
|
-
var TAB_ICON_AND_GAP_WIDTH = 24;
|
|
3575
|
-
var TAB_OUTER_BORDER_WIDTH = 2;
|
|
3576
|
-
var TAB_INNER_BORDER_WIDTH = 1;
|
|
3577
|
-
var measureTabLabelWidth = (label) => {
|
|
3578
|
-
if (typeof document === "undefined")
|
|
3579
|
-
return label.length * 9;
|
|
3580
|
-
const canvas = document.createElement("canvas");
|
|
3581
|
-
const context = canvas.getContext("2d");
|
|
3582
|
-
if (!context)
|
|
3583
|
-
return label.length * 9;
|
|
3584
|
-
context.font = "700 16px Inter";
|
|
3585
|
-
return context.measureText(label).width;
|
|
3586
|
-
};
|
|
3587
|
-
var estimateTabsWidth = (items) => {
|
|
3588
|
-
if (items.length === 0)
|
|
3589
|
-
return 0;
|
|
3590
|
-
const tabsWidth = items.reduce((sum, item) => {
|
|
3591
|
-
const textWidth = Math.ceil(measureTabLabelWidth(item.label));
|
|
3592
|
-
const iconWidth = item.icon ? TAB_ICON_AND_GAP_WIDTH : 0;
|
|
3593
|
-
const buttonWidth = Math.max(TAB_MIN_WIDTH, textWidth + iconWidth + TAB_HORIZONTAL_PADDING);
|
|
3594
|
-
return sum + buttonWidth;
|
|
3595
|
-
}, 0);
|
|
3596
|
-
return tabsWidth + TAB_OUTER_BORDER_WIDTH + (items.length - 1) * TAB_INNER_BORDER_WIDTH;
|
|
3597
|
-
};
|
|
3598
|
-
var EventList = ({
|
|
3485
|
+
var PlaceOrder = ({
|
|
3599
3486
|
title,
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3487
|
+
marketDate,
|
|
3488
|
+
marketImageUrl,
|
|
3489
|
+
activeTab,
|
|
3490
|
+
buyLabel,
|
|
3491
|
+
sellLabel,
|
|
3492
|
+
outcomes,
|
|
3493
|
+
selectedOutcomeId,
|
|
3494
|
+
primaryMetric,
|
|
3495
|
+
routing,
|
|
3496
|
+
result,
|
|
3497
|
+
actionLabel,
|
|
3498
|
+
disclaimer = defaultTradingDisclaimer,
|
|
3499
|
+
isDismissible = false,
|
|
3500
|
+
isLoading = false,
|
|
3501
|
+
status,
|
|
3502
|
+
className,
|
|
3503
|
+
isPrimaryActionDisabled = false,
|
|
3504
|
+
isPrimaryActionLoading = false,
|
|
3505
|
+
onClose,
|
|
3506
|
+
onOutcomeChange,
|
|
3507
|
+
onPrimaryAction,
|
|
3508
|
+
onStatusAction,
|
|
3509
|
+
onTabChange
|
|
3606
3510
|
}) => {
|
|
3607
|
-
|
|
3511
|
+
const { enableAnimations } = (0, import_hooks14.useSdkUiConfig)();
|
|
3608
3512
|
const labels = (0, import_hooks14.useLabels)();
|
|
3609
|
-
const
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
(_b = (_a = defaultEventListTabs[0]) == null ? void 0 : _a.value) != null ? _b : "matched"
|
|
3614
|
-
);
|
|
3615
|
-
const [_shouldUseSelectOverflow, setShouldUseSelectOverflow] = (0, import_react4.useState)(false);
|
|
3616
|
-
const activeTab = (0, import_react4.useMemo)(() => {
|
|
3617
|
-
return defaultEventListTabs.find((tab) => tab.value === activeTabValue);
|
|
3618
|
-
}, [activeTabValue]);
|
|
3619
|
-
const venues = (0, import_react4.useMemo)(() => {
|
|
3620
|
-
return resolveTabVenus(activeTab);
|
|
3621
|
-
}, [activeTab]);
|
|
3622
|
-
const resolvedMaxVisibleItems = (0, import_react4.useMemo)(() => {
|
|
3623
|
-
if (!Number.isFinite(maxVisibleItems))
|
|
3624
|
-
return void 0;
|
|
3625
|
-
return Math.max(1, Math.floor(maxVisibleItems));
|
|
3626
|
-
}, [maxVisibleItems]);
|
|
3627
|
-
const requestLimit = resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : limit;
|
|
3628
|
-
const shouldPaginate = resolvedMaxVisibleItems == null;
|
|
3629
|
-
const { events, isLoading, isError, fetchNextPage, hasNextPage, isFetchingNextPage } = (0, import_hooks14.useEvents)({
|
|
3630
|
-
venues,
|
|
3631
|
-
search,
|
|
3632
|
-
categoryIds,
|
|
3633
|
-
limit: requestLimit
|
|
3634
|
-
});
|
|
3635
|
-
const filteredEvents = (0, import_react4.useMemo)(() => {
|
|
3636
|
-
return filterEventsByTabValue(events, activeTabValue);
|
|
3637
|
-
}, [events, activeTabValue]);
|
|
3638
|
-
const tileEvents = (0, import_react4.useMemo)(() => {
|
|
3639
|
-
const normalizedEvents = filteredEvents.map((event) => mapEventToEventListItemEvent(event)).filter((event) => event != null);
|
|
3640
|
-
if (resolvedMaxVisibleItems == null)
|
|
3641
|
-
return normalizedEvents;
|
|
3642
|
-
return normalizedEvents.slice(0, resolvedMaxVisibleItems);
|
|
3643
|
-
}, [filteredEvents, resolvedMaxVisibleItems]);
|
|
3644
|
-
const tabsItems = (0, import_react4.useMemo)(() => {
|
|
3645
|
-
return defaultEventListTabs.map((tab) => {
|
|
3646
|
-
const isActive = tab.value === activeTabValue;
|
|
3647
|
-
return {
|
|
3648
|
-
value: tab.value,
|
|
3649
|
-
label: tab.label,
|
|
3650
|
-
icon: renderTabIcon(tab, isActive),
|
|
3651
|
-
disabled: tab.disabled
|
|
3652
|
-
};
|
|
3653
|
-
});
|
|
3654
|
-
}, [activeTabValue]);
|
|
3655
|
-
const headerRef = (0, import_react4.useRef)(null);
|
|
3656
|
-
const titleRef = (0, import_react4.useRef)(null);
|
|
3657
|
-
const updateTabsOverflowBehavior = (0, import_react4.useCallback)(() => {
|
|
3658
|
-
if (typeof window === "undefined")
|
|
3659
|
-
return;
|
|
3660
|
-
const headerElement = headerRef.current;
|
|
3661
|
-
const titleElement = titleRef.current;
|
|
3662
|
-
if (!headerElement || !titleElement)
|
|
3663
|
-
return;
|
|
3664
|
-
const isDesktop = window.matchMedia("(min-width: 768px)").matches;
|
|
3665
|
-
if (!isDesktop) {
|
|
3666
|
-
setShouldUseSelectOverflow(false);
|
|
3667
|
-
return;
|
|
3668
|
-
}
|
|
3669
|
-
const headerStyles = window.getComputedStyle(headerElement);
|
|
3670
|
-
const rawGap = headerStyles.columnGap || headerStyles.gap || "0";
|
|
3671
|
-
const horizontalGap = Number.parseFloat(rawGap) || 0;
|
|
3672
|
-
const availableTabsWidth = headerElement.clientWidth - titleElement.getBoundingClientRect().width - horizontalGap;
|
|
3673
|
-
const estimatedTabsWidth = estimateTabsWidth(tabsItems);
|
|
3674
|
-
setShouldUseSelectOverflow(availableTabsWidth > 0 && estimatedTabsWidth > availableTabsWidth);
|
|
3675
|
-
}, [tabsItems]);
|
|
3676
|
-
(0, import_react4.useEffect)(() => {
|
|
3677
|
-
updateTabsOverflowBehavior();
|
|
3678
|
-
}, [updateTabsOverflowBehavior]);
|
|
3679
|
-
(0, import_react4.useEffect)(() => {
|
|
3680
|
-
if (typeof ResizeObserver === "undefined")
|
|
3681
|
-
return;
|
|
3682
|
-
const headerElement = headerRef.current;
|
|
3683
|
-
const titleElement = titleRef.current;
|
|
3684
|
-
if (!headerElement || !titleElement)
|
|
3685
|
-
return;
|
|
3686
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
3687
|
-
updateTabsOverflowBehavior();
|
|
3688
|
-
});
|
|
3689
|
-
resizeObserver.observe(headerElement);
|
|
3690
|
-
resizeObserver.observe(titleElement);
|
|
3691
|
-
return () => {
|
|
3692
|
-
resizeObserver.disconnect();
|
|
3693
|
-
};
|
|
3694
|
-
}, [updateTabsOverflowBehavior]);
|
|
3695
|
-
const resolvedMaxItemsPerRow = Number.isFinite(maxItemsPerRow) ? Math.max(1, Math.floor(maxItemsPerRow)) : 1;
|
|
3696
|
-
const loadingPlaceholderCount = isFetchingNextPage ? Math.min(resolvedMaxItemsPerRow, resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : Infinity) : 0;
|
|
3697
|
-
const shouldRenderLoadingState = isLoading && tileEvents.length === 0;
|
|
3698
|
-
const loadMoreRef = (0, import_react4.useRef)(null);
|
|
3699
|
-
(0, import_react4.useEffect)(() => {
|
|
3700
|
-
if (!shouldPaginate)
|
|
3701
|
-
return;
|
|
3702
|
-
if (!hasNextPage)
|
|
3703
|
-
return;
|
|
3704
|
-
const target = loadMoreRef.current;
|
|
3705
|
-
if (!target)
|
|
3706
|
-
return;
|
|
3707
|
-
const observer = new IntersectionObserver(
|
|
3708
|
-
(entries) => {
|
|
3709
|
-
const entry = entries[0];
|
|
3710
|
-
if (!(entry == null ? void 0 : entry.isIntersecting))
|
|
3711
|
-
return;
|
|
3712
|
-
if (isLoading || isFetchingNextPage || !hasNextPage)
|
|
3713
|
-
return;
|
|
3714
|
-
void fetchNextPage();
|
|
3715
|
-
},
|
|
3513
|
+
const resolvedDisclaimer = disclaimer === defaultTradingDisclaimer ? labels.trading.disclaimer : disclaimer;
|
|
3514
|
+
if (isLoading) {
|
|
3515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3516
|
+
Skeleton,
|
|
3716
3517
|
{
|
|
3717
|
-
|
|
3518
|
+
ariaLabel: labels.common.loading,
|
|
3519
|
+
className,
|
|
3520
|
+
view: skeletonViews.placeOrder
|
|
3718
3521
|
}
|
|
3719
3522
|
);
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3523
|
+
}
|
|
3524
|
+
const [internalTab, setInternalTab] = (0, import_react4.useState)(activeTab);
|
|
3525
|
+
const [internalOutcomeId, setInternalOutcomeId] = (0, import_react4.useState)(selectedOutcomeId);
|
|
3526
|
+
(0, import_react4.useEffect)(() => {
|
|
3527
|
+
setInternalTab(activeTab);
|
|
3528
|
+
}, [activeTab]);
|
|
3529
|
+
(0, import_react4.useEffect)(() => {
|
|
3530
|
+
setInternalOutcomeId(selectedOutcomeId);
|
|
3531
|
+
}, [selectedOutcomeId]);
|
|
3532
|
+
const resolvedTab = onTabChange ? activeTab : internalTab;
|
|
3533
|
+
const resolvedOutcomeId = onOutcomeChange ? selectedOutcomeId : internalOutcomeId;
|
|
3534
|
+
const hasHighlightedRouting = routing.tone === "highlighted";
|
|
3535
|
+
const dateLabel = getTradingDateLabel(marketDate);
|
|
3536
|
+
const tabItems = (0, import_react4.useMemo)(() => {
|
|
3537
|
+
return [
|
|
3538
|
+
{ value: "buy", label: buyLabel },
|
|
3539
|
+
{ value: "sell", label: sellLabel }
|
|
3540
|
+
];
|
|
3541
|
+
}, [buyLabel, sellLabel]);
|
|
3542
|
+
const handleTabChange = (nextTab) => {
|
|
3543
|
+
if (!onTabChange) {
|
|
3544
|
+
setInternalTab(nextTab);
|
|
3545
|
+
}
|
|
3546
|
+
onTabChange == null ? void 0 : onTabChange(nextTab);
|
|
3547
|
+
};
|
|
3548
|
+
const handleOutcomeChange = (nextOutcomeId) => {
|
|
3549
|
+
if (!onOutcomeChange) {
|
|
3550
|
+
setInternalOutcomeId(nextOutcomeId);
|
|
3551
|
+
}
|
|
3552
|
+
onOutcomeChange == null ? void 0 : onOutcomeChange(nextOutcomeId);
|
|
3727
3553
|
};
|
|
3728
|
-
const
|
|
3729
|
-
|
|
3730
|
-
|
|
3554
|
+
const actionButton = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3555
|
+
Button,
|
|
3556
|
+
{
|
|
3557
|
+
size: "large",
|
|
3558
|
+
className: "w-full",
|
|
3559
|
+
disabled: isPrimaryActionDisabled,
|
|
3560
|
+
isLoading: isPrimaryActionLoading,
|
|
3561
|
+
"aria-label": actionLabel,
|
|
3562
|
+
onClick: onPrimaryAction,
|
|
3563
|
+
children: actionLabel
|
|
3564
|
+
}
|
|
3731
3565
|
);
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
{
|
|
3739
|
-
ref: headerRef,
|
|
3740
|
-
className: "flex flex-col sm:flex-row w-full flex-nowrap items-start sm:items-center justify-between gap-2 sm:gap-4",
|
|
3741
|
-
children: [
|
|
3742
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { ref: titleRef, className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Typography, { as: "h2", variant: "title", className: "truncate [&::first-letter]:uppercase", children: title }) }),
|
|
3743
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3744
|
-
Tabs,
|
|
3566
|
+
const contentBody = /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-col gap-6 p-5", children: [
|
|
3567
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
3568
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-start justify-between gap-5", children: [
|
|
3569
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
3570
|
+
marketImageUrl ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3571
|
+
"img",
|
|
3745
3572
|
{
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
onChange: setActiveTabValue
|
|
3573
|
+
src: marketImageUrl,
|
|
3574
|
+
alt: "",
|
|
3575
|
+
className: "h-12 w-12 shrink-0 rounded-agg-lg object-cover"
|
|
3750
3576
|
}
|
|
3751
|
-
)
|
|
3752
|
-
|
|
3577
|
+
) : null,
|
|
3578
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "min-w-0 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: title })
|
|
3579
|
+
] }),
|
|
3580
|
+
isDismissible ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3581
|
+
"button",
|
|
3582
|
+
{
|
|
3583
|
+
type: "button",
|
|
3584
|
+
"aria-label": labels.common.close,
|
|
3585
|
+
className: "shrink-0 text-agg-foreground",
|
|
3586
|
+
onClick: onClose,
|
|
3587
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3588
|
+
Icon,
|
|
3589
|
+
{
|
|
3590
|
+
name: "close",
|
|
3591
|
+
size: "medium",
|
|
3592
|
+
className: "h-6 w-6 text-agg-foreground",
|
|
3593
|
+
color: "currentColor"
|
|
3594
|
+
}
|
|
3595
|
+
)
|
|
3596
|
+
}
|
|
3597
|
+
) : null
|
|
3598
|
+
] }),
|
|
3599
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: dateLabel })
|
|
3600
|
+
] }),
|
|
3601
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3602
|
+
Tabs,
|
|
3603
|
+
{
|
|
3604
|
+
ariaLabel: labels.common.tabsAria,
|
|
3605
|
+
items: tabItems,
|
|
3606
|
+
value: resolvedTab,
|
|
3607
|
+
onChange: handleTabChange,
|
|
3608
|
+
variant: "underline",
|
|
3609
|
+
size: "s",
|
|
3610
|
+
overflowBehavior: "scroll",
|
|
3611
|
+
classNames: {
|
|
3612
|
+
root: "w-full",
|
|
3613
|
+
tabList: "w-full"
|
|
3614
|
+
}
|
|
3753
3615
|
}
|
|
3754
3616
|
),
|
|
3755
|
-
/* @__PURE__ */ (0,
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
)
|
|
3777
|
-
|
|
3778
|
-
|
|
3617
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
3618
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex w-full gap-2", children: outcomes.map((outcome, index) => {
|
|
3619
|
+
const isActive = outcome.id === resolvedOutcomeId;
|
|
3620
|
+
const isPositive = resolveIsPositiveOutcome(outcome, index);
|
|
3621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3622
|
+
"button",
|
|
3623
|
+
{
|
|
3624
|
+
type: "button",
|
|
3625
|
+
className: getOutcomeButtonClassName({
|
|
3626
|
+
enableAnimations,
|
|
3627
|
+
isActive,
|
|
3628
|
+
isPositive
|
|
3629
|
+
}),
|
|
3630
|
+
"aria-pressed": isActive,
|
|
3631
|
+
"aria-label": `${outcome.label} ${outcome.priceLabel}`,
|
|
3632
|
+
onClick: () => handleOutcomeChange(outcome.id),
|
|
3633
|
+
children: `${outcome.label} ${outcome.priceLabel}`
|
|
3634
|
+
},
|
|
3635
|
+
outcome.id
|
|
3636
|
+
);
|
|
3637
|
+
}) }),
|
|
3638
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
3639
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-col", children: [
|
|
3640
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: primaryMetric.label }),
|
|
3641
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: primaryMetric.hint })
|
|
3642
|
+
] }),
|
|
3643
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-agg-3xl font-agg-bold leading-agg-9 text-agg-foreground", children: primaryMetric.value })
|
|
3644
|
+
] })
|
|
3645
|
+
] }),
|
|
3646
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
3647
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
3648
|
+
"div",
|
|
3779
3649
|
{
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3650
|
+
className: cn(
|
|
3651
|
+
"relative overflow-hidden rounded-agg-lg border p-3",
|
|
3652
|
+
getRoutingCardClassName(hasHighlightedRouting)
|
|
3653
|
+
),
|
|
3654
|
+
children: [
|
|
3655
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3656
|
+
"div",
|
|
3657
|
+
{
|
|
3658
|
+
className: cn(
|
|
3659
|
+
"pointer-events-none absolute inset-x-0 bottom-0 h-11 bg-linear-to-b from-transparent to-agg-trade-highlight-glow",
|
|
3660
|
+
hasHighlightedRouting ? "opacity-100" : "opacity-0"
|
|
3661
|
+
)
|
|
3662
|
+
}
|
|
3663
|
+
),
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "relative flex flex-col gap-3", children: [
|
|
3665
|
+
routing.rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
3666
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
3667
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
3668
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3669
|
+
VenueLogo,
|
|
3670
|
+
{
|
|
3671
|
+
venue: row.venue,
|
|
3672
|
+
size: "small",
|
|
3673
|
+
ariaLabel: getTradingVenueLabel(row.venue)
|
|
3674
|
+
}
|
|
3675
|
+
),
|
|
3676
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "truncate text-agg-base leading-agg-6 text-agg-foreground", children: row.label })
|
|
3677
|
+
] }),
|
|
3678
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "shrink-0 text-agg-base leading-agg-6 text-agg-foreground", children: row.priceLabel })
|
|
3679
|
+
] }),
|
|
3680
|
+
index < routing.rows.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3681
|
+
"div",
|
|
3682
|
+
{
|
|
3683
|
+
className: cn(
|
|
3684
|
+
"h-px w-full",
|
|
3685
|
+
hasHighlightedRouting ? "bg-agg-trade-highlight-border" : "bg-agg-separator"
|
|
3686
|
+
)
|
|
3687
|
+
}
|
|
3688
|
+
) : null
|
|
3689
|
+
] }, `${row.venue}-${row.label}`)),
|
|
3690
|
+
routing.highlightLabel ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-center text-agg-sm font-agg-bold leading-agg-5 uppercase text-agg-trade-highlight-accent", children: routing.highlightLabel }) : null
|
|
3691
|
+
] })
|
|
3692
|
+
]
|
|
3784
3693
|
}
|
|
3785
|
-
)
|
|
3786
|
-
|
|
3787
|
-
|
|
3694
|
+
),
|
|
3695
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: routing.helperLabel })
|
|
3696
|
+
] }),
|
|
3697
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
3698
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-col", children: [
|
|
3699
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: result.label }),
|
|
3700
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: result.hint })
|
|
3701
|
+
] }),
|
|
3702
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3703
|
+
"p",
|
|
3788
3704
|
{
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3705
|
+
className: cn(
|
|
3706
|
+
"text-agg-3xl font-agg-bold leading-agg-9",
|
|
3707
|
+
getResultValueClassName(result.tone)
|
|
3708
|
+
),
|
|
3709
|
+
children: result.value
|
|
3792
3710
|
}
|
|
3793
|
-
)
|
|
3711
|
+
)
|
|
3712
|
+
] }),
|
|
3713
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
3714
|
+
getStatusContent({
|
|
3715
|
+
placement: "above-action",
|
|
3716
|
+
status,
|
|
3717
|
+
onStatusAction
|
|
3718
|
+
}),
|
|
3719
|
+
actionButton,
|
|
3720
|
+
getStatusContent({
|
|
3721
|
+
placement: "below-action",
|
|
3722
|
+
status,
|
|
3723
|
+
onStatusAction
|
|
3724
|
+
})
|
|
3794
3725
|
] }),
|
|
3795
|
-
|
|
3726
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-center text-agg-xs leading-agg-4 text-agg-muted-foreground", children: resolvedDisclaimer })
|
|
3796
3727
|
] });
|
|
3728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Card, { className: cn(getPlaceOrderContainerClassName(), className), children: contentBody });
|
|
3797
3729
|
};
|
|
3798
|
-
|
|
3730
|
+
PlaceOrder.displayName = "PlaceOrder";
|
|
3799
3731
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3800
3732
|
0 && (module.exports = {
|
|
3801
|
-
|
|
3733
|
+
PlaceOrder,
|
|
3734
|
+
Settlement,
|
|
3735
|
+
defaultSettlementDifferencesTitle,
|
|
3736
|
+
defaultSettlementSectionLabel,
|
|
3737
|
+
defaultTradingDisclaimer,
|
|
3738
|
+
getTradingAveragePriceLabel,
|
|
3739
|
+
getTradingBalanceLabel,
|
|
3740
|
+
getTradingDateLabel,
|
|
3741
|
+
getTradingPriceLabel,
|
|
3742
|
+
getTradingSharesLabel,
|
|
3743
|
+
getTradingSlippageLabel,
|
|
3744
|
+
getTradingValueLabel,
|
|
3745
|
+
getTradingVenueLabel,
|
|
3746
|
+
placeOrderMetricSchema,
|
|
3747
|
+
placeOrderOutcomeSchema,
|
|
3748
|
+
placeOrderResultSchema,
|
|
3749
|
+
placeOrderResultToneSchema,
|
|
3750
|
+
placeOrderRoutingRowSchema,
|
|
3751
|
+
placeOrderRoutingSchema,
|
|
3752
|
+
placeOrderRoutingToneSchema,
|
|
3753
|
+
placeOrderStatusPlacementSchema,
|
|
3754
|
+
placeOrderStatusSchema,
|
|
3755
|
+
placeOrderStatusToneSchema,
|
|
3756
|
+
placeOrderTabSchema,
|
|
3757
|
+
placeOrderViewModelSchema,
|
|
3758
|
+
settlementVenueSchema,
|
|
3759
|
+
settlementViewModelSchema,
|
|
3760
|
+
tradingVenueSchema
|
|
3802
3761
|
});
|