@agg-market/ui 4.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.
Files changed (516) hide show
  1. package/README.md +26 -26
  2. package/dist/auth.d.mts +1 -0
  3. package/dist/auth.d.ts +1 -0
  4. package/dist/{connect-button.js → auth.js} +6 -4
  5. package/dist/auth.mjs +8 -0
  6. package/dist/chunk-2ICOSP7N.mjs +1211 -0
  7. package/dist/chunk-5ZKPBMRK.mjs +2411 -0
  8. package/dist/{chunk-5K7VXAYM.mjs → chunk-ADGL6RFX.mjs} +2 -4
  9. package/dist/chunk-BXW3VIKV.mjs +90 -0
  10. package/dist/{chart.js → chunk-CN7GI2RJ.mjs} +250 -103
  11. package/dist/chunk-G6YKGVQR.mjs +769 -0
  12. package/dist/{chunk-PZTHM6WG.mjs → chunk-HI4EEDN5.mjs} +897 -357
  13. package/dist/{chunk-5ADMXO3Y.mjs → chunk-INRG3D4M.mjs} +5 -11
  14. package/dist/{chunk-DCORNTCY.mjs → chunk-JE3Z52FD.mjs} +85 -64
  15. package/dist/chunk-KZOQW6NT.mjs +0 -0
  16. package/dist/chunk-LMOJKJOY.mjs +2616 -0
  17. package/dist/{chunk-YJA5VQW6.mjs → chunk-MHCHR65A.mjs} +2 -4
  18. package/dist/{chunk-IGPNIM2B.mjs → chunk-PASXFYKQ.mjs} +2 -4
  19. package/dist/chunk-UBBOLLOS.mjs +999 -0
  20. package/dist/events.d.mts +1 -0
  21. package/dist/events.d.ts +1 -0
  22. package/dist/{event-market-page.js → events.js} +5128 -5274
  23. package/dist/events.mjs +17 -0
  24. package/dist/index.d.mts +1 -78
  25. package/dist/index.d.ts +1 -78
  26. package/dist/index.js +8738 -8534
  27. package/dist/index.mjs +68 -167
  28. package/dist/modals.d.mts +1 -0
  29. package/dist/modals.d.ts +1 -0
  30. package/dist/{deposit-modal.js → modals.js} +1771 -6
  31. package/dist/modals.mjs +25 -0
  32. package/dist/pages.d.mts +1 -0
  33. package/dist/pages.d.ts +1 -0
  34. package/dist/pages.js +7928 -0
  35. package/dist/pages.mjs +16 -0
  36. package/dist/primitives.d.mts +1 -0
  37. package/dist/primitives.d.ts +1 -0
  38. package/dist/{market-details.js → primitives.js} +2980 -3153
  39. package/dist/{icon.mjs → primitives.mjs} +56 -9
  40. package/dist/styles.css +1 -1
  41. package/dist/tailwind.css +1 -1
  42. package/dist/trading.d.mts +1 -0
  43. package/dist/trading.d.ts +1 -0
  44. package/dist/{place-order.js → trading.js} +1907 -1394
  45. package/dist/trading.mjs +65 -0
  46. package/dist/types/auth/connect-button/connect-button.constants.d.mts +10 -0
  47. package/dist/types/auth/connect-button/connect-button.constants.d.ts +10 -0
  48. package/dist/{connect-button.d.mts → types/auth/connect-button/connect-button.types.d.mts} +5 -12
  49. package/dist/{connect-button.d.ts → types/auth/connect-button/connect-button.types.d.ts} +5 -12
  50. package/dist/types/auth/connect-button/index.d.mts +7 -0
  51. package/dist/types/auth/connect-button/index.d.ts +7 -0
  52. package/dist/types/auth/index.d.mts +1 -0
  53. package/dist/types/auth/index.d.ts +1 -0
  54. package/dist/types/constants.d.mts +1 -0
  55. package/dist/types/constants.d.ts +1 -0
  56. package/dist/types/deposit/deposit-modal.constants.d.mts +9 -0
  57. package/dist/types/deposit/deposit-modal.constants.d.ts +9 -0
  58. package/dist/{deposit-modal.d.mts → types/deposit/deposit-modal.types.d.mts} +3 -10
  59. package/dist/{deposit-modal.d.ts → types/deposit/deposit-modal.types.d.ts} +3 -10
  60. package/dist/types/deposit/index.d.mts +6 -0
  61. package/dist/types/deposit/index.d.ts +6 -0
  62. package/dist/types/deposit/steps/card-deposit.d.mts +7 -0
  63. package/dist/types/deposit/steps/card-deposit.d.ts +7 -0
  64. package/dist/types/deposit/steps/crypto-transfer.d.mts +7 -0
  65. package/dist/types/deposit/steps/crypto-transfer.d.ts +7 -0
  66. package/dist/types/deposit/steps/deposit-method.d.mts +7 -0
  67. package/dist/types/deposit/steps/deposit-method.d.ts +7 -0
  68. package/dist/types/deposit/steps/kalshi-deposit.d.mts +5 -0
  69. package/dist/types/deposit/steps/kalshi-deposit.d.ts +5 -0
  70. package/dist/types/deposit/steps/venue-selection.d.mts +7 -0
  71. package/dist/types/deposit/steps/venue-selection.d.ts +7 -0
  72. package/dist/types/events/index.d.mts +4 -0
  73. package/dist/types/events/index.d.ts +4 -0
  74. package/dist/types/events/item/event-list-item.constants.d.mts +1 -0
  75. package/dist/types/events/item/event-list-item.constants.d.ts +1 -0
  76. package/dist/types/events/item/event-list-item.types.d.mts +46 -0
  77. package/dist/types/events/item/event-list-item.types.d.ts +46 -0
  78. package/dist/types/events/item/event-list-item.utils.d.mts +23 -0
  79. package/dist/types/events/item/event-list-item.utils.d.ts +23 -0
  80. package/dist/types/events/item/index.d.mts +6 -0
  81. package/dist/types/events/item/index.d.ts +6 -0
  82. package/dist/types/events/item-details/event-list-item-details.constants.d.mts +10 -0
  83. package/dist/types/events/item-details/event-list-item-details.constants.d.ts +10 -0
  84. package/dist/types/events/item-details/event-list-item-details.types.d.mts +53 -0
  85. package/dist/types/events/item-details/event-list-item-details.types.d.ts +53 -0
  86. package/dist/types/events/item-details/event-list-item-details.utils.d.mts +26 -0
  87. package/dist/types/events/item-details/event-list-item-details.utils.d.ts +26 -0
  88. package/dist/types/events/item-details/index.d.mts +6 -0
  89. package/dist/types/events/item-details/index.d.ts +6 -0
  90. package/dist/types/events/list/event-list.constants.d.mts +3 -0
  91. package/dist/types/events/list/event-list.constants.d.ts +3 -0
  92. package/dist/types/events/list/event-list.types.d.mts +21 -0
  93. package/dist/types/events/list/event-list.types.d.ts +21 -0
  94. package/dist/types/events/list/event-list.utils.d.mts +6 -0
  95. package/dist/types/events/list/event-list.utils.d.ts +6 -0
  96. package/dist/types/events/list/index.d.mts +6 -0
  97. package/dist/types/events/list/index.d.ts +6 -0
  98. package/dist/types/events/market-details/index.d.mts +6 -0
  99. package/dist/types/events/market-details/index.d.ts +6 -0
  100. package/dist/types/events/market-details/market-details.constants.d.mts +9 -0
  101. package/dist/types/events/market-details/market-details.constants.d.ts +9 -0
  102. package/dist/types/events/market-details/market-details.types.d.mts +63 -0
  103. package/dist/types/events/market-details/market-details.types.d.ts +63 -0
  104. package/dist/types/events/market-details/market-details.utils.d.mts +46 -0
  105. package/dist/types/events/market-details/market-details.utils.d.ts +46 -0
  106. package/dist/types/index.d.mts +9 -0
  107. package/dist/types/index.d.ts +9 -0
  108. package/dist/types/modals/index.d.mts +4 -0
  109. package/dist/types/modals/index.d.ts +4 -0
  110. package/dist/types/onboarding/index.d.mts +11 -0
  111. package/dist/types/onboarding/index.d.ts +11 -0
  112. package/dist/types/onboarding/onboarding-modal.constants.d.mts +10 -0
  113. package/dist/types/onboarding/onboarding-modal.constants.d.ts +10 -0
  114. package/dist/types/onboarding/onboarding-modal.types.d.mts +55 -0
  115. package/dist/types/onboarding/onboarding-modal.types.d.ts +55 -0
  116. package/dist/types/onboarding/steps/connect-accounts.d.mts +5 -0
  117. package/dist/types/onboarding/steps/connect-accounts.d.ts +5 -0
  118. package/dist/types/onboarding/steps/connect-kalshi-modal.d.mts +5 -0
  119. package/dist/types/onboarding/steps/connect-kalshi-modal.d.ts +5 -0
  120. package/dist/types/onboarding/steps/connect-onchain-modal.d.mts +5 -0
  121. package/dist/types/onboarding/steps/connect-onchain-modal.d.ts +5 -0
  122. package/dist/types/onboarding/steps/how-it-works.d.mts +5 -0
  123. package/dist/types/onboarding/steps/how-it-works.d.ts +5 -0
  124. package/dist/types/onboarding/steps/profile-setup.d.mts +5 -0
  125. package/dist/types/onboarding/steps/profile-setup.d.ts +5 -0
  126. package/dist/types/pages/event-market/event-market.types.d.mts +42 -0
  127. package/dist/types/pages/event-market/event-market.types.d.ts +42 -0
  128. package/dist/types/pages/event-market/index.d.mts +6 -0
  129. package/dist/types/pages/event-market/index.d.ts +6 -0
  130. package/dist/types/pages/home/home.constants.d.mts +8 -0
  131. package/dist/types/pages/home/home.constants.d.ts +8 -0
  132. package/dist/{home-page.d.ts → types/pages/home/home.types.d.mts} +8 -18
  133. package/dist/{home-page.d.mts → types/pages/home/home.types.d.ts} +8 -18
  134. package/dist/types/pages/home/home.utils.d.mts +3 -0
  135. package/dist/types/pages/home/home.utils.d.ts +3 -0
  136. package/dist/types/pages/home/index.d.mts +6 -0
  137. package/dist/types/pages/home/index.d.ts +6 -0
  138. package/dist/types/pages/index.d.mts +3 -0
  139. package/dist/types/pages/index.d.ts +3 -0
  140. package/dist/types/pages/user-profile/components/activity-row.d.mts +10 -0
  141. package/dist/types/pages/user-profile/components/activity-row.d.ts +10 -0
  142. package/dist/types/pages/user-profile/components/balance-display.d.mts +12 -0
  143. package/dist/types/pages/user-profile/components/balance-display.d.ts +12 -0
  144. package/dist/types/pages/user-profile/components/balances-card.d.mts +12 -0
  145. package/dist/types/pages/user-profile/components/balances-card.d.ts +12 -0
  146. package/dist/types/pages/user-profile/components/default-avatar.d.mts +8 -0
  147. package/dist/types/pages/user-profile/components/default-avatar.d.ts +8 -0
  148. package/dist/types/pages/user-profile/components/empty-state.d.mts +10 -0
  149. package/dist/types/pages/user-profile/components/empty-state.d.ts +10 -0
  150. package/dist/types/pages/user-profile/components/position-row.d.mts +10 -0
  151. package/dist/types/pages/user-profile/components/position-row.d.ts +10 -0
  152. package/dist/types/pages/user-profile/components/positions-activity.d.mts +14 -0
  153. package/dist/types/pages/user-profile/components/positions-activity.d.ts +14 -0
  154. package/dist/types/pages/user-profile/components/user-info-card.d.mts +11 -0
  155. package/dist/types/pages/user-profile/components/user-info-card.d.ts +11 -0
  156. package/dist/types/pages/user-profile/index.d.mts +6 -0
  157. package/dist/types/pages/user-profile/index.d.ts +6 -0
  158. package/dist/types/pages/user-profile/user-profile.constants.d.mts +9 -0
  159. package/dist/types/pages/user-profile/user-profile.constants.d.ts +9 -0
  160. package/dist/{user-profile-page.d.ts → types/pages/user-profile/user-profile.types.d.mts} +12 -22
  161. package/dist/{user-profile-page.d.mts → types/pages/user-profile/user-profile.types.d.ts} +12 -22
  162. package/dist/types/primitives/badge/badge.constants.d.mts +4 -0
  163. package/dist/types/primitives/badge/badge.constants.d.ts +4 -0
  164. package/dist/types/primitives/badge/badge.types.d.mts +18 -0
  165. package/dist/types/primitives/badge/badge.types.d.ts +18 -0
  166. package/dist/types/primitives/badge/index.d.mts +7 -0
  167. package/dist/types/primitives/badge/index.d.ts +7 -0
  168. package/dist/types/primitives/button/button.constants.d.mts +6 -0
  169. package/dist/types/primitives/button/button.constants.d.ts +6 -0
  170. package/dist/types/primitives/button/button.types.d.mts +12 -0
  171. package/dist/types/primitives/button/button.types.d.ts +12 -0
  172. package/dist/types/primitives/button/index.d.mts +6 -0
  173. package/dist/types/primitives/button/index.d.ts +6 -0
  174. package/dist/types/primitives/card/card.types.d.mts +3 -0
  175. package/dist/types/primitives/card/card.types.d.ts +3 -0
  176. package/dist/types/primitives/card/index.d.mts +6 -0
  177. package/dist/types/primitives/card/index.d.ts +6 -0
  178. package/dist/{chart.d.mts → types/primitives/chart/index.d.mts} +7 -10
  179. package/dist/{chart.d.ts → types/primitives/chart/index.d.ts} +7 -10
  180. package/dist/types/primitives/hello-world.d.mts +4 -0
  181. package/dist/types/primitives/hello-world.d.ts +4 -0
  182. package/dist/types/primitives/icon/icon.constants.d.mts +2 -0
  183. package/dist/types/primitives/icon/icon.constants.d.ts +2 -0
  184. package/dist/types/primitives/icon/icon.types.d.mts +9 -0
  185. package/dist/types/primitives/icon/icon.types.d.ts +9 -0
  186. package/dist/types/primitives/icon/icon.utils.d.mts +2 -0
  187. package/dist/types/primitives/icon/icon.utils.d.ts +2 -0
  188. package/dist/types/primitives/icon/index.d.mts +46 -0
  189. package/dist/types/primitives/icon/index.d.ts +46 -0
  190. package/dist/types/primitives/icon/registry.d.mts +166 -0
  191. package/dist/types/primitives/icon/registry.d.ts +166 -0
  192. package/dist/types/primitives/icon/svg/arrow-trend-up.d.mts +5 -0
  193. package/dist/types/primitives/icon/svg/arrow-trend-up.d.ts +5 -0
  194. package/dist/types/primitives/icon/svg/arrows-to-dot.d.mts +5 -0
  195. package/dist/types/primitives/icon/svg/arrows-to-dot.d.ts +5 -0
  196. package/dist/types/primitives/icon/svg/bank.d.mts +5 -0
  197. package/dist/types/primitives/icon/svg/bank.d.ts +5 -0
  198. package/dist/types/primitives/icon/svg/best-prices.d.mts +5 -0
  199. package/dist/types/primitives/icon/svg/best-prices.d.ts +5 -0
  200. package/dist/types/primitives/icon/svg/bolt.d.mts +5 -0
  201. package/dist/types/primitives/icon/svg/bolt.d.ts +5 -0
  202. package/dist/types/primitives/icon/svg/check-badge.d.mts +5 -0
  203. package/dist/types/primitives/icon/svg/check-badge.d.ts +5 -0
  204. package/dist/types/primitives/icon/svg/check-circle.d.mts +5 -0
  205. package/dist/types/primitives/icon/svg/check-circle.d.ts +5 -0
  206. package/dist/types/primitives/icon/svg/chevron-down.d.mts +5 -0
  207. package/dist/types/primitives/icon/svg/chevron-down.d.ts +5 -0
  208. package/dist/types/primitives/icon/svg/chevron-left.d.mts +5 -0
  209. package/dist/types/primitives/icon/svg/chevron-left.d.ts +5 -0
  210. package/dist/types/primitives/icon/svg/chevron-right.d.mts +5 -0
  211. package/dist/types/primitives/icon/svg/chevron-right.d.ts +5 -0
  212. package/dist/types/primitives/icon/svg/chevron-up.d.mts +5 -0
  213. package/dist/types/primitives/icon/svg/chevron-up.d.ts +5 -0
  214. package/dist/types/primitives/icon/svg/close.d.mts +5 -0
  215. package/dist/types/primitives/icon/svg/close.d.ts +5 -0
  216. package/dist/types/primitives/icon/svg/copy.d.mts +5 -0
  217. package/dist/types/primitives/icon/svg/copy.d.ts +5 -0
  218. package/dist/types/primitives/icon/svg/create-account.d.mts +5 -0
  219. package/dist/types/primitives/icon/svg/create-account.d.ts +5 -0
  220. package/dist/types/primitives/icon/svg/credit-card.d.mts +5 -0
  221. package/dist/types/primitives/icon/svg/credit-card.d.ts +5 -0
  222. package/dist/types/primitives/icon/svg/disconnect.d.mts +5 -0
  223. package/dist/types/primitives/icon/svg/disconnect.d.ts +5 -0
  224. package/dist/types/primitives/icon/svg/discord.d.mts +5 -0
  225. package/dist/types/primitives/icon/svg/discord.d.ts +5 -0
  226. package/dist/types/primitives/icon/svg/document.d.mts +5 -0
  227. package/dist/types/primitives/icon/svg/document.d.ts +5 -0
  228. package/dist/types/primitives/icon/svg/dots-horizontal.d.mts +5 -0
  229. package/dist/types/primitives/icon/svg/dots-horizontal.d.ts +5 -0
  230. package/dist/types/primitives/icon/svg/download.d.mts +5 -0
  231. package/dist/types/primitives/icon/svg/download.d.ts +5 -0
  232. package/dist/types/primitives/icon/svg/email.d.mts +5 -0
  233. package/dist/types/primitives/icon/svg/email.d.ts +5 -0
  234. package/dist/types/primitives/icon/svg/external-link.d.mts +5 -0
  235. package/dist/types/primitives/icon/svg/external-link.d.ts +5 -0
  236. package/dist/types/primitives/icon/svg/info.d.mts +5 -0
  237. package/dist/types/primitives/icon/svg/info.d.ts +5 -0
  238. package/dist/types/primitives/icon/svg/link-accounts.d.mts +5 -0
  239. package/dist/types/primitives/icon/svg/link-accounts.d.ts +5 -0
  240. package/dist/types/primitives/icon/svg/pencil.d.mts +5 -0
  241. package/dist/types/primitives/icon/svg/pencil.d.ts +5 -0
  242. package/dist/types/primitives/icon/svg/play-square.d.mts +5 -0
  243. package/dist/types/primitives/icon/svg/play-square.d.ts +5 -0
  244. package/dist/types/primitives/icon/svg/profile.d.mts +5 -0
  245. package/dist/types/primitives/icon/svg/profile.d.ts +5 -0
  246. package/dist/types/primitives/icon/svg/revenue-alt.d.mts +5 -0
  247. package/dist/types/primitives/icon/svg/revenue-alt.d.ts +5 -0
  248. package/dist/types/primitives/icon/svg/search.d.mts +5 -0
  249. package/dist/types/primitives/icon/svg/search.d.ts +5 -0
  250. package/dist/types/primitives/icon/svg/shield-trust.d.mts +5 -0
  251. package/dist/types/primitives/icon/svg/shield-trust.d.ts +5 -0
  252. package/dist/types/primitives/icon/svg/stay-in-control.d.mts +5 -0
  253. package/dist/types/primitives/icon/svg/stay-in-control.d.ts +5 -0
  254. package/dist/types/primitives/icon/svg/telegram.d.mts +5 -0
  255. package/dist/types/primitives/icon/svg/telegram.d.ts +5 -0
  256. package/dist/types/primitives/icon/svg/triangle-down.d.mts +5 -0
  257. package/dist/types/primitives/icon/svg/triangle-down.d.ts +5 -0
  258. package/dist/types/primitives/icon/svg/triangle-up-filled.d.mts +5 -0
  259. package/dist/types/primitives/icon/svg/triangle-up-filled.d.ts +5 -0
  260. package/dist/types/primitives/icon/svg/triangle-up.d.mts +5 -0
  261. package/dist/types/primitives/icon/svg/triangle-up.d.ts +5 -0
  262. package/dist/types/primitives/icon/svg/twitter.d.mts +5 -0
  263. package/dist/types/primitives/icon/svg/twitter.d.ts +5 -0
  264. package/dist/types/primitives/icon/svg/upload.d.mts +5 -0
  265. package/dist/types/primitives/icon/svg/upload.d.ts +5 -0
  266. package/dist/types/primitives/icon/svg/wallet-avatar.d.mts +5 -0
  267. package/dist/types/primitives/icon/svg/wallet-avatar.d.ts +5 -0
  268. package/dist/types/primitives/icon/svg/wallet.d.mts +5 -0
  269. package/dist/types/primitives/icon/svg/wallet.d.ts +5 -0
  270. package/dist/types/primitives/icon/svg/warning-filled.d.mts +5 -0
  271. package/dist/types/primitives/icon/svg/warning-filled.d.ts +5 -0
  272. package/dist/types/primitives/icon/svg/warning.d.mts +5 -0
  273. package/dist/types/primitives/icon/svg/warning.d.ts +5 -0
  274. package/dist/types/primitives/icon/types.d.mts +5 -0
  275. package/dist/types/primitives/icon/types.d.ts +5 -0
  276. package/dist/types/primitives/index.d.mts +17 -0
  277. package/dist/types/primitives/index.d.ts +17 -0
  278. package/dist/types/primitives/loading-icon/index.d.mts +11 -0
  279. package/dist/types/primitives/loading-icon/index.d.ts +11 -0
  280. package/dist/types/primitives/modal/index.d.mts +10 -0
  281. package/dist/types/primitives/modal/index.d.ts +10 -0
  282. package/dist/types/primitives/modal/modal.types.d.mts +54 -0
  283. package/dist/types/primitives/modal/modal.types.d.ts +54 -0
  284. package/dist/{number-value.d.mts → types/primitives/number-value.d.mts} +3 -5
  285. package/dist/{number-value.d.ts → types/primitives/number-value.d.ts} +3 -5
  286. package/dist/types/primitives/search/index.d.mts +6 -0
  287. package/dist/types/primitives/search/index.d.ts +6 -0
  288. package/dist/types/primitives/search/search-empty-icon.d.mts +5 -0
  289. package/dist/types/primitives/search/search-empty-icon.d.ts +5 -0
  290. package/dist/types/primitives/search/search.types.d.mts +96 -0
  291. package/dist/types/primitives/search/search.types.d.ts +96 -0
  292. package/dist/{select.d.mts → types/primitives/select/index.d.mts} +3 -5
  293. package/dist/{select.d.ts → types/primitives/select/index.d.ts} +3 -5
  294. package/dist/types/primitives/skeleton/index.d.mts +7 -0
  295. package/dist/types/primitives/skeleton/index.d.ts +7 -0
  296. package/dist/types/primitives/skeleton/skeleton-block.d.mts +8 -0
  297. package/dist/types/primitives/skeleton/skeleton-block.d.ts +8 -0
  298. package/dist/{skeleton.d.mts → types/primitives/skeleton/skeleton.types.d.mts} +6 -9
  299. package/dist/{skeleton.d.ts → types/primitives/skeleton/skeleton.types.d.ts} +6 -9
  300. package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.mts +5 -0
  301. package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.ts +5 -0
  302. package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.mts +9 -0
  303. package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.ts +9 -0
  304. package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.mts +5 -0
  305. package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.ts +5 -0
  306. package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.mts +12 -0
  307. package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.ts +12 -0
  308. package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.mts +5 -0
  309. package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.ts +5 -0
  310. package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.mts +5 -0
  311. package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.ts +5 -0
  312. package/dist/types/primitives/state-message/index.d.mts +15 -0
  313. package/dist/types/primitives/state-message/index.d.ts +15 -0
  314. package/dist/{switch-button.d.mts → types/primitives/switch-button/index.d.mts} +4 -7
  315. package/dist/{switch-button.d.ts → types/primitives/switch-button/index.d.ts} +4 -7
  316. package/dist/types/primitives/tabs/index.d.mts +6 -0
  317. package/dist/types/primitives/tabs/index.d.ts +6 -0
  318. package/dist/types/primitives/tabs/tabs.types.d.mts +24 -0
  319. package/dist/types/primitives/tabs/tabs.types.d.ts +24 -0
  320. package/dist/types/primitives/tabs/tabs.utils.d.mts +14 -0
  321. package/dist/types/primitives/tabs/tabs.utils.d.ts +14 -0
  322. package/dist/types/primitives/typography/index.d.mts +7 -0
  323. package/dist/types/primitives/typography/index.d.ts +7 -0
  324. package/dist/types/primitives/typography/typography.constants.d.mts +3 -0
  325. package/dist/types/primitives/typography/typography.constants.d.ts +3 -0
  326. package/dist/types/primitives/typography/typography.types.d.mts +8 -0
  327. package/dist/types/primitives/typography/typography.types.d.ts +8 -0
  328. package/dist/types/primitives/venue-logo/index.d.mts +8 -0
  329. package/dist/types/primitives/venue-logo/index.d.ts +8 -0
  330. package/dist/types/primitives/venue-logo/logo-props.d.mts +10 -0
  331. package/dist/types/primitives/venue-logo/logo-props.d.ts +10 -0
  332. package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.mts +5 -0
  333. package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.ts +5 -0
  334. package/dist/types/primitives/venue-logo/svg/logo-opinion.d.mts +5 -0
  335. package/dist/types/primitives/venue-logo/svg/logo-opinion.d.ts +5 -0
  336. package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.mts +5 -0
  337. package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.ts +5 -0
  338. package/dist/types/primitives/venue-logo/svg/logo-probable.d.mts +5 -0
  339. package/dist/types/primitives/venue-logo/svg/logo-probable.d.ts +5 -0
  340. package/dist/types/primitives/venue-logo/venue-logo.constants.d.mts +9 -0
  341. package/dist/types/primitives/venue-logo/venue-logo.constants.d.ts +9 -0
  342. package/dist/types/primitives/venue-logo/venue-logo.types.d.mts +17 -0
  343. package/dist/types/primitives/venue-logo/venue-logo.types.d.ts +17 -0
  344. package/dist/types/profile/index.d.mts +6 -0
  345. package/dist/types/profile/index.d.ts +6 -0
  346. package/dist/types/profile/profile-modal.constants.d.mts +17 -0
  347. package/dist/types/profile/profile-modal.constants.d.ts +17 -0
  348. package/dist/{profile-modal.d.mts → types/profile/profile-modal.types.d.mts} +4 -11
  349. package/dist/{profile-modal.d.ts → types/profile/profile-modal.types.d.ts} +4 -11
  350. package/dist/types/profile/tabs/about-tab.d.mts +16 -0
  351. package/dist/types/profile/tabs/about-tab.d.ts +16 -0
  352. package/dist/types/profile/tabs/accounts-wallets-tab.d.mts +18 -0
  353. package/dist/types/profile/tabs/accounts-wallets-tab.d.ts +18 -0
  354. package/dist/types/shared/constants.d.mts +23 -0
  355. package/dist/types/shared/constants.d.ts +23 -0
  356. package/dist/types/shared/query-error.d.mts +2 -0
  357. package/dist/types/shared/query-error.d.ts +2 -0
  358. package/dist/types/shared/types.d.mts +1 -0
  359. package/dist/types/shared/types.d.ts +1 -0
  360. package/dist/types/shared/utils.d.mts +15 -0
  361. package/dist/types/shared/utils.d.ts +15 -0
  362. package/dist/types/trading/index.d.mts +4 -0
  363. package/dist/types/trading/index.d.ts +4 -0
  364. package/dist/{place-order.d.ts → types/trading/place-order/index.d.mts} +3 -7
  365. package/dist/{place-order.d.mts → types/trading/place-order/index.d.ts} +3 -7
  366. package/dist/{settlement.d.ts → types/trading/settlement/index.d.mts} +3 -7
  367. package/dist/{settlement.d.mts → types/trading/settlement/index.d.ts} +3 -7
  368. package/dist/{types-DkGlbmXq.d.ts → types/trading/types.d.mts} +35 -38
  369. package/dist/{types-DkGlbmXq.d.mts → types/trading/types.d.ts} +35 -38
  370. package/dist/types/trading/utils.d.mts +16 -0
  371. package/dist/types/trading/utils.d.ts +16 -0
  372. package/dist/types/withdraw/index.d.mts +6 -0
  373. package/dist/types/withdraw/index.d.ts +6 -0
  374. package/dist/types/withdraw/steps/kalshi-withdraw.d.mts +5 -0
  375. package/dist/types/withdraw/steps/kalshi-withdraw.d.ts +5 -0
  376. package/dist/types/withdraw/steps/venue-selection.d.mts +6 -0
  377. package/dist/types/withdraw/steps/venue-selection.d.ts +6 -0
  378. package/dist/types/withdraw/steps/withdraw-amount.d.mts +8 -0
  379. package/dist/types/withdraw/steps/withdraw-amount.d.ts +8 -0
  380. package/dist/types/withdraw/steps/withdraw-method.d.mts +7 -0
  381. package/dist/types/withdraw/steps/withdraw-method.d.ts +7 -0
  382. package/dist/types/withdraw/withdraw-modal.constants.d.mts +9 -0
  383. package/dist/types/withdraw/withdraw-modal.constants.d.ts +9 -0
  384. package/dist/{withdraw-modal.d.mts → types/withdraw/withdraw-modal.types.d.mts} +3 -10
  385. package/dist/{withdraw-modal.d.ts → types/withdraw/withdraw-modal.types.d.ts} +3 -10
  386. package/package.json +35 -273
  387. package/dist/badge.d.mts +0 -28
  388. package/dist/badge.d.ts +0 -28
  389. package/dist/badge.js +0 -110
  390. package/dist/badge.mjs +0 -9
  391. package/dist/button.d.mts +0 -20
  392. package/dist/button.d.ts +0 -20
  393. package/dist/button.js +0 -183
  394. package/dist/button.mjs +0 -8
  395. package/dist/card.d.mts +0 -10
  396. package/dist/card.d.ts +0 -10
  397. package/dist/card.js +0 -88
  398. package/dist/card.mjs +0 -7
  399. package/dist/chart.mjs +0 -8
  400. package/dist/chunk-3QLOUBDJ.mjs +0 -483
  401. package/dist/chunk-3W7NBJLU.mjs +0 -371
  402. package/dist/chunk-4S3I6X7F.mjs +0 -855
  403. package/dist/chunk-4VUDTWH7.mjs +0 -42
  404. package/dist/chunk-6JG6I5AY.mjs +0 -654
  405. package/dist/chunk-BNDFQPHF.mjs +0 -9
  406. package/dist/chunk-ERGNR6UQ.mjs +0 -67
  407. package/dist/chunk-FO263M3V.mjs +0 -10
  408. package/dist/chunk-FO2QCB4Z.mjs +0 -35
  409. package/dist/chunk-GJ4U5NCE.mjs +0 -134
  410. package/dist/chunk-GNSPZ53C.mjs +0 -991
  411. package/dist/chunk-HOXTJ742.mjs +0 -146
  412. package/dist/chunk-JNH64AKR.mjs +0 -720
  413. package/dist/chunk-K6IJ4WBM.mjs +0 -67
  414. package/dist/chunk-KAGYJ4XT.mjs +0 -126
  415. package/dist/chunk-LA3FBBSJ.mjs +0 -311
  416. package/dist/chunk-LCZKSITC.mjs +0 -162
  417. package/dist/chunk-M4RJHRFT.mjs +0 -445
  418. package/dist/chunk-MBHTXNHX.mjs +0 -289
  419. package/dist/chunk-MJHKBCXQ.mjs +0 -379
  420. package/dist/chunk-NDG43KGL.mjs +0 -44
  421. package/dist/chunk-NH2G3POM.mjs +0 -470
  422. package/dist/chunk-OBCHURW5.mjs +0 -64
  423. package/dist/chunk-OH56VUYK.mjs +0 -321
  424. package/dist/chunk-OJVTGNIF.mjs +0 -230
  425. package/dist/chunk-P2PJBO5C.mjs +0 -280
  426. package/dist/chunk-PORVP72S.mjs +0 -277
  427. package/dist/chunk-QLMVKLNJ.mjs +0 -669
  428. package/dist/chunk-QM7CGMFG.mjs +0 -156
  429. package/dist/chunk-S3H63TQ5.mjs +0 -537
  430. package/dist/chunk-ZFMCCBP6.mjs +0 -25
  431. package/dist/connect-button.mjs +0 -14
  432. package/dist/deposit-modal.mjs +0 -15
  433. package/dist/event-list-item-details.d.mts +0 -11
  434. package/dist/event-list-item-details.d.ts +0 -11
  435. package/dist/event-list-item-details.js +0 -2254
  436. package/dist/event-list-item-details.mjs +0 -19
  437. package/dist/event-list-item-details.types-CMbXOrT-.d.ts +0 -53
  438. package/dist/event-list-item-details.types-DekJKeMD.d.mts +0 -53
  439. package/dist/event-list-item.d.mts +0 -10
  440. package/dist/event-list-item.d.ts +0 -10
  441. package/dist/event-list-item.js +0 -2600
  442. package/dist/event-list-item.mjs +0 -17
  443. package/dist/event-list-item.types-Y6IeJ4e4.d.mts +0 -46
  444. package/dist/event-list-item.types-Y6IeJ4e4.d.ts +0 -46
  445. package/dist/event-list.d.mts +0 -9
  446. package/dist/event-list.d.ts +0 -9
  447. package/dist/event-list.js +0 -3578
  448. package/dist/event-list.mjs +0 -20
  449. package/dist/event-list.types-CkAAUqwW.d.mts +0 -13
  450. package/dist/event-list.types-CkAAUqwW.d.ts +0 -13
  451. package/dist/event-market-page.d.mts +0 -52
  452. package/dist/event-market-page.d.ts +0 -52
  453. package/dist/event-market-page.mjs +0 -28
  454. package/dist/hello-world.d.mts +0 -8
  455. package/dist/hello-world.d.ts +0 -8
  456. package/dist/hello-world.js +0 -92
  457. package/dist/hello-world.mjs +0 -8
  458. package/dist/home-page.js +0 -3842
  459. package/dist/home-page.mjs +0 -21
  460. package/dist/icon.d.mts +0 -193
  461. package/dist/icon.d.ts +0 -193
  462. package/dist/icon.js +0 -1465
  463. package/dist/loading-icon.d.mts +0 -14
  464. package/dist/loading-icon.d.ts +0 -14
  465. package/dist/loading-icon.js +0 -112
  466. package/dist/loading-icon.mjs +0 -8
  467. package/dist/market-details.d.mts +0 -73
  468. package/dist/market-details.d.ts +0 -73
  469. package/dist/market-details.mjs +0 -21
  470. package/dist/modal.d.mts +0 -66
  471. package/dist/modal.d.ts +0 -66
  472. package/dist/modal.js +0 -321
  473. package/dist/modal.mjs +0 -9
  474. package/dist/number-value.js +0 -67
  475. package/dist/number-value.mjs +0 -7
  476. package/dist/onboarding-modal.d.mts +0 -88
  477. package/dist/onboarding-modal.d.ts +0 -88
  478. package/dist/onboarding-modal.js +0 -2836
  479. package/dist/onboarding-modal.mjs +0 -24
  480. package/dist/place-order.mjs +0 -18
  481. package/dist/profile-modal.js +0 -2447
  482. package/dist/profile-modal.mjs +0 -14
  483. package/dist/registry-DfSCFAdC.d.mts +0 -178
  484. package/dist/registry-DfSCFAdC.d.ts +0 -178
  485. package/dist/search.d.mts +0 -51
  486. package/dist/search.d.ts +0 -51
  487. package/dist/search.js +0 -1954
  488. package/dist/search.mjs +0 -12
  489. package/dist/select.js +0 -1552
  490. package/dist/select.mjs +0 -11
  491. package/dist/settlement.js +0 -2445
  492. package/dist/settlement.mjs +0 -15
  493. package/dist/skeleton.js +0 -490
  494. package/dist/skeleton.mjs +0 -10
  495. package/dist/switch-button.js +0 -191
  496. package/dist/switch-button.mjs +0 -7
  497. package/dist/tabs.d.mts +0 -31
  498. package/dist/tabs.d.ts +0 -31
  499. package/dist/tabs.js +0 -2078
  500. package/dist/tabs.mjs +0 -12
  501. package/dist/types-BVj9ky9P.d.mts +0 -3
  502. package/dist/types-BVj9ky9P.d.ts +0 -3
  503. package/dist/typography.d.mts +0 -18
  504. package/dist/typography.d.ts +0 -18
  505. package/dist/typography.js +0 -93
  506. package/dist/typography.mjs +0 -9
  507. package/dist/user-profile-page.js +0 -3081
  508. package/dist/user-profile-page.mjs +0 -15
  509. package/dist/venue-logo.d.mts +0 -13
  510. package/dist/venue-logo.d.ts +0 -13
  511. package/dist/venue-logo.js +0 -323
  512. package/dist/venue-logo.mjs +0 -10
  513. package/dist/venue-logo.types-CGUc22ly.d.mts +0 -19
  514. package/dist/venue-logo.types-Dqr39S1-.d.ts +0 -19
  515. package/dist/withdraw-modal.js +0 -2449
  516. package/dist/withdraw-modal.mjs +0 -14
@@ -1,2254 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
- var __getProtoOf = Object.getPrototypeOf;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __objRest = (source, exclude) => {
26
- var target = {};
27
- for (var prop in source)
28
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
- target[prop] = source[prop];
30
- if (source != null && __getOwnPropSymbols)
31
- for (var prop of __getOwnPropSymbols(source)) {
32
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
- target[prop] = source[prop];
34
- }
35
- return target;
36
- };
37
- var __export = (target, all) => {
38
- for (var name in all)
39
- __defProp(target, name, { get: all[name], enumerable: true });
40
- };
41
- var __copyProps = (to, from, except, desc) => {
42
- if (from && typeof from === "object" || typeof from === "function") {
43
- for (let key of __getOwnPropNames(from))
44
- if (!__hasOwnProp.call(to, key) && key !== except)
45
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
- }
47
- return to;
48
- };
49
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
- // If the importer is in node compatibility mode or this is not an ESM
51
- // file that has been converted to a CommonJS file using a Babel-
52
- // compatible transform (i.e. "__esModule" has not been set), then set
53
- // "default" to the CommonJS "module.exports" for node compatibility.
54
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
- mod
56
- ));
57
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
-
59
- // src/events/item-details/index.tsx
60
- var item_details_exports = {};
61
- __export(item_details_exports, {
62
- EventListItemDetails: () => EventListItemDetails
63
- });
64
- module.exports = __toCommonJS(item_details_exports);
65
- var import_react3 = require("react");
66
- var import_hooks13 = require("@agg-market/hooks");
67
-
68
- // src/primitives/badge/index.tsx
69
- var import_hooks = require("@agg-market/hooks");
70
-
71
- // src/shared/utils.ts
72
- var cn = (...values) => values.filter(Boolean).join(" ");
73
- var getMotionClassName = (enabled, ...values) => {
74
- if (!enabled)
75
- return void 0;
76
- return cn(...values);
77
- };
78
- var toDate = (value) => {
79
- if (!value)
80
- return null;
81
- if (value instanceof Date)
82
- return value;
83
- const parsed = new Date(value);
84
- if (Number.isNaN(parsed.getTime()))
85
- return null;
86
- return parsed;
87
- };
88
-
89
- // src/primitives/badge/badge.constants.ts
90
- var badgeSizeClasses = {
91
- small: cn("py-1.5 px-4 gap-1.5", "agg-type-label"),
92
- medium: cn("py-1.5 px-4 gap-2", "agg-type-body"),
93
- large: cn("py-2.5 px-6 gap-2", "agg-type-body")
94
- };
95
- var baseBadgeClasses = cn(
96
- "inline-flex items-center justify-center rounded-agg-full font-agg-sans",
97
- "bg-agg-secondary-hover text-agg-foreground whitespace-nowrap font-agg-normal"
98
- );
99
-
100
- // src/primitives/badge/index.tsx
101
- var import_jsx_runtime = require("react/jsx-runtime");
102
- function Badge({
103
- text,
104
- prefix,
105
- suffix,
106
- size = "medium",
107
- classNames,
108
- onClick,
109
- isActive = false
110
- }) {
111
- const { enableAnimations } = (0, import_hooks.useSdkUiConfig)();
112
- const resolvedText = `${text}`;
113
- const resolvedAriaLabel = resolvedText.length > 0 ? resolvedText : void 0;
114
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
115
- "span",
116
- __spreadProps(__spreadValues({
117
- "aria-label": resolvedAriaLabel,
118
- className: cn(
119
- "group/agg-badge",
120
- baseBadgeClasses,
121
- badgeSizeClasses[size],
122
- onClick ? "cursor-pointer hover:bg-agg-tertiary disabled:cursor-not-allowed" : "",
123
- getMotionClassName(
124
- enableAnimations,
125
- "transition-[border-color,background-color] duration-200 ease-in-out"
126
- ),
127
- isActive ? "border-agg-primary bg-agg-secondary! font-agg-bold!" : "border-transparent font-agg-normal",
128
- classNames == null ? void 0 : classNames.root
129
- )
130
- }, onClick && { onClick }), {
131
- children: [
132
- prefix ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: classNames == null ? void 0 : classNames.prefix, children: prefix }) : null,
133
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: cn("truncate", classNames == null ? void 0 : classNames.text), children: text }),
134
- suffix ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: classNames == null ? void 0 : classNames.suffix, children: suffix }) : null
135
- ]
136
- })
137
- );
138
- }
139
- Badge.displayName = "Badge";
140
-
141
- // src/primitives/button/index.tsx
142
- var import_hooks2 = require("@agg-market/hooks");
143
-
144
- // src/primitives/icon/icon.constants.ts
145
- var iconSizeClasses = {
146
- small: "h-4 w-4",
147
- medium: "h-6 w-6",
148
- large: "h-8 w-8"
149
- };
150
-
151
- // src/primitives/button/button.constants.ts
152
- var sizeClasses = {
153
- small: cn("h-8 px-4 gap-1.5", "text-agg-sm leading-agg-5"),
154
- medium: cn("h-9 px-5 gap-1.5", "text-agg-sm leading-agg-5"),
155
- large: cn("h-10 px-6 gap-2", "text-agg-base leading-agg-6")
156
- };
157
- var iconSizeClasses2 = {
158
- small: iconSizeClasses.small,
159
- medium: iconSizeClasses.small,
160
- large: iconSizeClasses.small
161
- };
162
- var iconSlotClasses = {
163
- small: "[&_svg]:h-4 [&_svg]:w-4",
164
- medium: "[&_svg]:h-4 [&_svg]:w-4",
165
- large: "[&_svg]:h-4 [&_svg]:w-4"
166
- };
167
- var variantClasses = {
168
- primary: cn(
169
- "bg-agg-primary text-agg-on-primary",
170
- "hover:bg-agg-primary-hover",
171
- "disabled:bg-agg-separator disabled:text-agg-on-primary",
172
- "focus-visible:ring-agg-primary-hover"
173
- ),
174
- secondary: cn(
175
- "border border-agg-separator bg-agg-secondary text-agg-foreground",
176
- "hover:bg-agg-secondary-hover",
177
- "disabled:bg-agg-secondary disabled:text-agg-muted-foreground disabled:border-agg-separator",
178
- "focus-visible:ring-agg-separator"
179
- ),
180
- tertiary: cn(
181
- "bg-transparent text-agg-primary",
182
- "hover:text-agg-primary-hover",
183
- "disabled:bg-transparent disabled:text-agg-muted-foreground",
184
- "focus-visible:ring-agg-separator",
185
- "px-0! py-0! h-fit!"
186
- )
187
- };
188
- var baseButtonClasses = cn(
189
- "cursor-pointer disabled:cursor-not-allowed",
190
- "inline-flex items-center justify-center rounded-agg-full font-agg-sans font-agg-bold text-center",
191
- "whitespace-nowrap",
192
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary"
193
- );
194
-
195
- // src/primitives/button/index.tsx
196
- var import_jsx_runtime2 = require("react/jsx-runtime");
197
- var Button = (_a) => {
198
- var _b = _a, {
199
- children,
200
- variant = "primary",
201
- size = "medium",
202
- isLoading = false,
203
- disabled,
204
- prefix,
205
- suffix,
206
- type = "button",
207
- className,
208
- "aria-label": ariaLabel
209
- } = _b, other = __objRest(_b, [
210
- "children",
211
- "variant",
212
- "size",
213
- "isLoading",
214
- "disabled",
215
- "prefix",
216
- "suffix",
217
- "type",
218
- "className",
219
- "aria-label"
220
- ]);
221
- const { enableAnimations } = (0, import_hooks2.useSdkUiConfig)();
222
- const isDisabled = disabled || isLoading;
223
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
224
- "button",
225
- __spreadProps(__spreadValues({
226
- type,
227
- className: cn(
228
- "group/agg-button",
229
- baseButtonClasses,
230
- getMotionClassName(enableAnimations, "transition-colors duration-200 ease-in-out"),
231
- sizeClasses[size],
232
- iconSlotClasses[size],
233
- variantClasses[variant],
234
- className
235
- ),
236
- disabled: isDisabled,
237
- "aria-busy": isLoading,
238
- "aria-label": ariaLabel
239
- }, other), {
240
- children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
241
- "span",
242
- {
243
- className: cn(
244
- "inline-block rounded-agg-full border-2 border-current border-r-transparent",
245
- getMotionClassName(enableAnimations, "animate-spin"),
246
- iconSizeClasses2[size]
247
- ),
248
- "aria-hidden": "true"
249
- }
250
- ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
251
- prefix != null ? prefix : null,
252
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children }),
253
- suffix != null ? suffix : null
254
- ] })
255
- })
256
- );
257
- };
258
- Button.displayName = "Button";
259
-
260
- // src/primitives/chart/index.tsx
261
- var import_dayjs = __toESM(require("dayjs"));
262
- var import_hooks4 = require("@agg-market/hooks");
263
- var import_react2 = require("react");
264
- var import_liveline = require("liveline");
265
-
266
- // src/primitives/switch-button/index.tsx
267
- var import_react = require("react");
268
- var import_hooks3 = require("@agg-market/hooks");
269
- var import_jsx_runtime3 = require("react/jsx-runtime");
270
- var resolveActiveIndex = (options, value) => {
271
- const activeIndex = options.findIndex((option) => option.value === value);
272
- if (activeIndex >= 0)
273
- return activeIndex;
274
- return 0;
275
- };
276
- var resolveNextEnabledIndex = (options, currentIndex, direction) => {
277
- if (options.length <= 1)
278
- return currentIndex;
279
- const step = direction === "next" ? 1 : -1;
280
- for (let offset = 1; offset <= options.length; offset += 1) {
281
- const candidateIndex = (currentIndex + step * offset + options.length) % options.length;
282
- const candidate = options[candidateIndex];
283
- if (candidate && !candidate.disabled) {
284
- return candidateIndex;
285
- }
286
- }
287
- return currentIndex;
288
- };
289
- var SwitchButton = ({
290
- options,
291
- value,
292
- onValueChange,
293
- ariaLabel,
294
- className
295
- }) => {
296
- const { enableAnimations } = (0, import_hooks3.useSdkUiConfig)();
297
- const activeIndex = (0, import_react.useMemo)(() => {
298
- return resolveActiveIndex(options, value);
299
- }, [options, value]);
300
- const [isAnimating, setIsAnimating] = (0, import_react.useState)(false);
301
- const [lastAnimatedIndex, setLastAnimatedIndex] = (0, import_react.useState)(activeIndex);
302
- (0, import_react.useEffect)(() => {
303
- if (lastAnimatedIndex === activeIndex) {
304
- return;
305
- }
306
- setLastAnimatedIndex(activeIndex);
307
- if (!enableAnimations) {
308
- setIsAnimating(false);
309
- return;
310
- }
311
- setIsAnimating(true);
312
- const timeoutId = window.setTimeout(() => {
313
- setIsAnimating(false);
314
- }, 350);
315
- return () => {
316
- window.clearTimeout(timeoutId);
317
- };
318
- }, [activeIndex, enableAnimations, lastAnimatedIndex]);
319
- if (options.length === 0) {
320
- return null;
321
- }
322
- const handleKeyDown = (event, optionIndex) => {
323
- if ((event == null ? void 0 : event.key) !== "ArrowLeft" && (event == null ? void 0 : event.key) !== "ArrowRight") {
324
- return;
325
- }
326
- event == null ? void 0 : event.preventDefault();
327
- const nextOptionIndex = resolveNextEnabledIndex(
328
- options,
329
- optionIndex,
330
- event.key === "ArrowRight" ? "next" : "previous"
331
- );
332
- const nextOption = options[nextOptionIndex];
333
- if (!nextOption || nextOption.disabled) {
334
- return;
335
- }
336
- onValueChange(nextOption.value);
337
- };
338
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
339
- "div",
340
- {
341
- className: cn(
342
- "group/agg-switch",
343
- "inline-flex min-w-0 rounded-agg-full bg-agg-secondary-hover font-agg-sans",
344
- getMotionClassName(enableAnimations, "transition-background duration-200 ease-in-out"),
345
- "cursor-pointer hover:bg-agg-tertiary",
346
- className
347
- ),
348
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
349
- "div",
350
- {
351
- className: "relative grid min-w-0 flex-1 items-center",
352
- style: {
353
- gridTemplateColumns: `repeat(${options.length}, minmax(0, 1fr))`
354
- },
355
- role: "tablist",
356
- "aria-label": ariaLabel,
357
- children: [
358
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
359
- "span",
360
- {
361
- className: cn(
362
- "pointer-events-none absolute inset-y-0 left-0 rounded-agg-full border-2 border-agg-primary bg-agg-secondary",
363
- getMotionClassName(
364
- enableAnimations,
365
- "transition-transform duration-500 ease-[cubic-bezier(0.77,0,0.175,1)]"
366
- )
367
- ),
368
- style: {
369
- width: `${100 / options.length}%`,
370
- transform: `translateX(${activeIndex * 100}%) scaleX(${isAnimating ? 1.08 : 1})`
371
- },
372
- "aria-hidden": "true"
373
- }
374
- ),
375
- options.map((option, optionIndex) => {
376
- var _a;
377
- const isActive = optionIndex === activeIndex;
378
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
379
- "button",
380
- {
381
- type: "button",
382
- role: "tab",
383
- "aria-selected": isActive,
384
- "aria-label": (_a = option.ariaLabel) != null ? _a : void 0,
385
- tabIndex: isActive ? 0 : -1,
386
- disabled: option.disabled,
387
- className: cn(
388
- "relative z-10 min-w-0 rounded-agg-full px-5 py-1.5 font-agg-sans text-agg-base leading-agg-6 text-agg-foreground",
389
- getMotionClassName(
390
- enableAnimations,
391
- "transition-[colors] duration-200 ease-in-out"
392
- ),
393
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary-hover",
394
- "cursor-pointer disabled:cursor-not-allowed disabled:text-agg-muted-foreground",
395
- isActive ? "font-agg-bold" : "font-agg-normal"
396
- ),
397
- onClick: (e) => {
398
- e.preventDefault();
399
- e.stopPropagation();
400
- if (option.disabled || isActive)
401
- return;
402
- onValueChange(option.value);
403
- },
404
- onKeyDown: (event) => {
405
- handleKeyDown(event, optionIndex);
406
- },
407
- children: option.label
408
- },
409
- option.value
410
- );
411
- })
412
- ]
413
- }
414
- )
415
- }
416
- );
417
- };
418
- SwitchButton.displayName = "SwitchButton";
419
-
420
- // src/primitives/chart/index.tsx
421
- var import_jsx_runtime4 = require("react/jsx-runtime");
422
- var normalizeSeries = (series) => {
423
- return series.map((seriesItem) => {
424
- const pointsByTime = /* @__PURE__ */ new Map();
425
- seriesItem.points.forEach((point) => {
426
- if (!Number.isFinite(point.time) || !Number.isFinite(point.value)) {
427
- return;
428
- }
429
- pointsByTime.set(Math.floor(point.time), point.value);
430
- });
431
- const sortedPoints = [...pointsByTime.entries()].sort((left, right) => left[0] - right[0]).map(([time, value]) => ({
432
- time,
433
- value
434
- }));
435
- return __spreadProps(__spreadValues({}, seriesItem), {
436
- points: sortedPoints
437
- });
438
- }).filter((seriesItem) => seriesItem.points.length > 0);
439
- };
440
- var defaultValueFormatter = (value) => {
441
- return `${Math.round(value)}%`;
442
- };
443
- var resolveTimeFormatter = (windowSeconds) => {
444
- return (timestamp) => {
445
- if (!Number.isFinite(timestamp))
446
- return "";
447
- if (windowSeconds <= 48 * 60 * 60) {
448
- return import_dayjs.default.unix(timestamp).format("HH:mm");
449
- }
450
- if (windowSeconds <= 14 * 24 * 60 * 60) {
451
- return import_dayjs.default.unix(timestamp).format("MMM D HH:mm");
452
- }
453
- return import_dayjs.default.unix(timestamp).format("MMM D");
454
- };
455
- };
456
- var toLivelinePoints = (points) => {
457
- return points.map((point) => ({
458
- time: point.time,
459
- value: point.value
460
- }));
461
- };
462
- var resolveWindowSeconds = (normalizedSeries) => {
463
- const timestamps = normalizedSeries.flatMap(
464
- (seriesItem) => seriesItem.points.map((point) => point.time)
465
- );
466
- if (timestamps.length <= 1)
467
- return 30;
468
- const minTimestamp = Math.min(...timestamps);
469
- const maxTimestamp = Math.max(...timestamps);
470
- const span = maxTimestamp - minTimestamp;
471
- if (!Number.isFinite(span) || span <= 0)
472
- return 30;
473
- return Math.max(1, Math.floor(span));
474
- };
475
- var resolveLatestValue = (points) => {
476
- const latestPoint = points[points.length - 1];
477
- if (!latestPoint)
478
- return 0;
479
- return latestPoint.value;
480
- };
481
- var resolveActiveSeriesId = (series, activeSeriesId) => {
482
- var _a, _b;
483
- if (activeSeriesId) {
484
- const matchingSeries = series.find((seriesItem) => seriesItem.id === activeSeriesId);
485
- if (matchingSeries) {
486
- return matchingSeries.id;
487
- }
488
- }
489
- return (_b = (_a = series[0]) == null ? void 0 : _a.id) != null ? _b : "";
490
- };
491
- var formatDefaultSeriesLabel = (seriesItem) => {
492
- return seriesItem.id.charAt(0).toUpperCase() + seriesItem.id.slice(1);
493
- };
494
- var renderDefaultSeriesControls = ({
495
- series,
496
- activeSeriesId,
497
- handleSeriesChange,
498
- defaultSeriesSwitchClassName,
499
- seriesSwitchAriaLabel,
500
- formatSeriesOptionAriaLabel
501
- }) => {
502
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
503
- SwitchButton,
504
- {
505
- ariaLabel: seriesSwitchAriaLabel,
506
- className: defaultSeriesSwitchClassName,
507
- options: series.map((seriesItem) => ({
508
- value: seriesItem.id,
509
- label: formatDefaultSeriesLabel(seriesItem),
510
- ariaLabel: formatSeriesOptionAriaLabel(formatDefaultSeriesLabel(seriesItem))
511
- })),
512
- value: activeSeriesId,
513
- onValueChange: handleSeriesChange
514
- }
515
- );
516
- };
517
- var resolveSelectedSeries = (series, activeSeriesId) => {
518
- const availableSeriesIds = new Set(series.map((seriesItem) => seriesItem.id));
519
- if (!availableSeriesIds.has(activeSeriesId)) {
520
- return series[0];
521
- }
522
- return series.find((seriesItem) => seriesItem.id === activeSeriesId);
523
- };
524
- var LineChart = ({
525
- series,
526
- height = 280,
527
- width,
528
- classNames,
529
- isLoading = false,
530
- showSeriesControls = true,
531
- renderSeriesControls
532
- }) => {
533
- var _a, _b;
534
- const labels = (0, import_hooks4.useLabels)();
535
- const { theme } = (0, import_hooks4.useSdkUiConfig)();
536
- const normalizedSeries = (0, import_react2.useMemo)(() => {
537
- return normalizeSeries(series);
538
- }, [series]);
539
- const [activeSeriesId, setActiveSeriesId] = (0, import_react2.useState)(
540
- () => resolveActiveSeriesId(normalizedSeries, null)
541
- );
542
- (0, import_react2.useEffect)(() => {
543
- setActiveSeriesId(
544
- (currentActiveSeriesId) => resolveActiveSeriesId(normalizedSeries, currentActiveSeriesId)
545
- );
546
- }, [normalizedSeries]);
547
- const livelineTheme = theme;
548
- const handleSeriesChange = (seriesId) => {
549
- setActiveSeriesId(seriesId);
550
- };
551
- const primarySeries = (0, import_react2.useMemo)(() => {
552
- return resolveSelectedSeries(normalizedSeries, activeSeriesId);
553
- }, [activeSeriesId, normalizedSeries]);
554
- const primaryData = (0, import_react2.useMemo)(() => {
555
- if (!primarySeries) {
556
- return [];
557
- }
558
- return toLivelinePoints(primarySeries.points);
559
- }, [primarySeries]);
560
- const primaryValue = (0, import_react2.useMemo)(() => {
561
- if (!primarySeries) {
562
- return 0;
563
- }
564
- return resolveLatestValue(primarySeries.points);
565
- }, [primarySeries]);
566
- const livelineSeries = (0, import_react2.useMemo)(() => {
567
- return normalizedSeries.map((seriesItem) => ({
568
- id: seriesItem.id,
569
- color: seriesItem.color,
570
- data: toLivelinePoints(seriesItem.points),
571
- value: resolveLatestValue(seriesItem.points)
572
- }));
573
- }, [normalizedSeries]);
574
- const windowSeconds = (0, import_react2.useMemo)(() => {
575
- return resolveWindowSeconds(normalizedSeries);
576
- }, [normalizedSeries]);
577
- const timeFormatter = (0, import_react2.useMemo)(() => {
578
- return resolveTimeFormatter(windowSeconds);
579
- }, [windowSeconds]);
580
- const seriesControls = showSeriesControls && normalizedSeries.length > 0 ? (_a = renderSeriesControls == null ? void 0 : renderSeriesControls({
581
- series: normalizedSeries,
582
- activeSeriesId,
583
- handleSeriesChange
584
- })) != null ? _a : normalizedSeries.length > 1 ? renderDefaultSeriesControls({
585
- series: normalizedSeries,
586
- activeSeriesId,
587
- handleSeriesChange,
588
- defaultSeriesSwitchClassName: classNames == null ? void 0 : classNames.defaultSeriesSwitch,
589
- seriesSwitchAriaLabel: labels.common.lineChartSeriesSwitchAria,
590
- formatSeriesOptionAriaLabel: labels.common.lineChartSeriesOptionAria
591
- }) : null : null;
592
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: cn("group/agg-chart", "w-full", classNames == null ? void 0 : classNames.root), style: { width }, children: [
593
- !isLoading && seriesControls ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: cn("mb-3", classNames == null ? void 0 : classNames.controls), children: seriesControls }) : null,
594
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
595
- "div",
596
- {
597
- className: cn(
598
- "overflow-hidden [&>div:not(.agg-livechart):first-of-type]:hidden!",
599
- classNames == null ? void 0 : classNames.chartViewport
600
- ),
601
- style: { height },
602
- role: "img",
603
- "aria-label": labels.common.lineChartAria,
604
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
605
- import_liveline.Liveline,
606
- {
607
- className: cn("h-full w-full agg-livechart", classNames == null ? void 0 : classNames.liveline),
608
- data: primaryData,
609
- value: primaryValue,
610
- series: livelineSeries,
611
- color: (_b = primarySeries == null ? void 0 : primarySeries.color) != null ? _b : "var(--agg-color-primary)",
612
- theme: livelineTheme,
613
- grid: true,
614
- momentum: false,
615
- pulse: false,
616
- window: windowSeconds,
617
- formatValue: defaultValueFormatter,
618
- formatTime: timeFormatter,
619
- padding: {
620
- top: 12,
621
- right: 80,
622
- bottom: 28,
623
- left: 12
624
- },
625
- loading: isLoading
626
- }
627
- )
628
- }
629
- )
630
- ] });
631
- };
632
- LineChart.displayName = "LineChart";
633
-
634
- // src/primitives/card/index.tsx
635
- var import_hooks5 = require("@agg-market/hooks");
636
- var import_jsx_runtime5 = require("react/jsx-runtime");
637
- var Card = (_a) => {
638
- var _b = _a, { className, onClick } = _b, props = __objRest(_b, ["className", "onClick"]);
639
- const { enableAnimations } = (0, import_hooks5.useSdkUiConfig)();
640
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
641
- "div",
642
- __spreadValues(__spreadValues({
643
- className: cn(
644
- "group/agg-card",
645
- "flex w-full flex-col font-agg-sans",
646
- "rounded-agg-xl border border-agg-separator",
647
- "bg-agg-secondary text-agg-foreground shadow-agg-card",
648
- getMotionClassName(
649
- enableAnimations,
650
- "transition-shadow hover:shadow-agg-card-hover duration-300 ease-in-out"
651
- ),
652
- className
653
- )
654
- }, onClick ? { onClick } : {}), props)
655
- );
656
- };
657
- Card.displayName = "Card";
658
-
659
- // src/primitives/skeleton/views/event-list-skeleton-view.tsx
660
- var import_hooks8 = require("@agg-market/hooks");
661
-
662
- // src/primitives/skeleton/skeleton-block.tsx
663
- var import_hooks6 = require("@agg-market/hooks");
664
- var import_jsx_runtime6 = require("react/jsx-runtime");
665
- var SkeletonBlock = ({ className }) => {
666
- const { enableAnimations } = (0, import_hooks6.useSdkUiConfig)();
667
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
668
- "div",
669
- {
670
- "aria-hidden": true,
671
- className: cn(
672
- "bg-agg-separator",
673
- getMotionClassName(enableAnimations, "animate-pulse"),
674
- className
675
- )
676
- }
677
- );
678
- };
679
- SkeletonBlock.displayName = "SkeletonBlock";
680
-
681
- // src/primitives/skeleton/views/event-list-item-skeleton-view.tsx
682
- var import_hooks7 = require("@agg-market/hooks");
683
-
684
- // src/events/item/event-list-item.constants.ts
685
- var baseCardClassName = "gap-3 overflow-hidden p-5 w-full";
686
-
687
- // src/primitives/skeleton/views/event-list-item-skeleton-view.tsx
688
- var import_jsx_runtime7 = require("react/jsx-runtime");
689
- var EventListItemSkeletonView = ({
690
- className,
691
- ariaLabel,
692
- isStandalone = false
693
- }) => {
694
- const labels = (0, import_hooks7.useLabels)();
695
- const outcomeTitleWidths = ["w-40", "w-[200px]"];
696
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
697
- Card,
698
- {
699
- className: cn("group/agg-skeleton", baseCardClassName, className),
700
- role: isStandalone ? "status" : void 0,
701
- "aria-label": isStandalone ? ariaLabel != null ? ariaLabel : labels.eventItem.loading : void 0,
702
- "aria-busy": isStandalone || void 0,
703
- "aria-hidden": isStandalone ? void 0 : true,
704
- children: [
705
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex h-14 w-full items-center gap-3 justify-stretch", children: [
706
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "size-10! rounded-agg-lg" }),
707
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-6 w-fit flex-1 rounded-agg-sm" })
708
- ] }),
709
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex flex-col gap-3", children: outcomeTitleWidths.map((outcomeTitleWidth, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex w-full items-center justify-between gap-3", children: [
710
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: cn("h-5 rounded-agg-sm", outcomeTitleWidth) }),
711
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" })
712
- ] }, index)) }),
713
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between gap-5 text-agg-muted-foreground", children: [
714
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
715
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-5 w-[100px] rounded-agg-sm" }),
716
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-1", children: [
717
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "size-[14px] rounded-agg-sm" }),
718
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "size-[14px] rounded-agg-sm" })
719
- ] })
720
- ] }),
721
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-5 w-[60px] rounded-agg-sm" })
722
- ] })
723
- ]
724
- }
725
- );
726
- };
727
- EventListItemSkeletonView.displayName = "EventListItemSkeletonView";
728
-
729
- // src/primitives/skeleton/views/event-list-skeleton-view.tsx
730
- var import_jsx_runtime8 = require("react/jsx-runtime");
731
- var EventListSkeletonView = ({ className, ariaLabel }) => {
732
- const labels = (0, import_hooks8.useLabels)();
733
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
734
- "section",
735
- {
736
- className: cn("group/agg-skeleton", "flex w-full flex-col gap-5", className),
737
- role: "status",
738
- "aria-label": ariaLabel != null ? ariaLabel : labels.eventList.loading("events"),
739
- "aria-busy": true,
740
- children: [
741
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("header", { className: "flex w-full flex-col items-start justify-between gap-3 md:flex-row md:flex-nowrap md:items-center md:gap-5", children: [
742
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-7 w-[120px] rounded-agg-md" }),
743
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-8 w-full rounded-agg-md md:w-[400px]" })
744
- ] }),
745
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "grid grid-cols-1 gap-5 md:grid-cols-3", children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
746
- EventListItemSkeletonView,
747
- {
748
- isStandalone: false,
749
- className: "w-full min-w-0 max-w-none"
750
- },
751
- index
752
- )) })
753
- ]
754
- }
755
- );
756
- };
757
- EventListSkeletonView.displayName = "EventListSkeletonView";
758
-
759
- // src/primitives/skeleton/views/event-list-item-details-skeleton-view.tsx
760
- var import_hooks9 = require("@agg-market/hooks");
761
-
762
- // src/events/item-details/event-list-item-details.constants.ts
763
- var detailsBaseCardClassName = "w-full overflow-hidden gap-6 p-5 md:gap-8 md:p-10";
764
- var eventListItemDetailsTimeRanges = [
765
- "1H",
766
- "6H",
767
- "1D",
768
- "1W",
769
- "1M",
770
- "ALL"
771
- ];
772
- var lineColorByVenue = {
773
- polymarket: "#2e5cff",
774
- kalshi: "#00d295",
775
- probable: "#f05923",
776
- opinion: "#020205"
777
- };
778
- var fallbackLineColors = ["#2e5cff", "#00d295", "#f05923", "#020205"];
779
-
780
- // src/primitives/skeleton/views/event-list-item-details-skeleton-view.tsx
781
- var import_jsx_runtime9 = require("react/jsx-runtime");
782
- var EventListItemDetailsSkeletonView = ({
783
- className,
784
- ariaLabel
785
- }) => {
786
- const labels = (0, import_hooks9.useLabels)();
787
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
788
- Card,
789
- {
790
- className: cn("group/agg-skeleton", detailsBaseCardClassName, className),
791
- role: "status",
792
- "aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.loading,
793
- "aria-busy": true,
794
- children: [
795
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex h-14 w-full items-center gap-3 justify-stretch", children: [
796
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "size-10! rounded-agg-lg" }),
797
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-6 w-fit flex-1 rounded-agg-sm" })
798
- ] }),
799
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex w-full flex-col gap-4 md:gap-6", children: [
800
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex w-full flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
801
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex max-w-full gap-2 overflow-hidden", children: [
802
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" }),
803
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" }),
804
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" })
805
- ] }),
806
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-9 w-full max-w-[221px] rounded-agg-full md:w-[221px]" })
807
- ] }),
808
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
809
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-[220px] w-full rounded-agg-xl md:h-[240px]" }),
810
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between", children: [
811
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-[59px] rounded-agg-sm" }),
812
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-40 rounded-agg-sm" })
813
- ] })
814
- ] })
815
- ] })
816
- ]
817
- }
818
- );
819
- };
820
- EventListItemDetailsSkeletonView.displayName = "EventListItemDetailsSkeletonView";
821
-
822
- // src/primitives/skeleton/views/market-details-skeleton-view.tsx
823
- var import_hooks10 = require("@agg-market/hooks");
824
-
825
- // src/events/market-details/market-details.constants.ts
826
- var marketDetailsBaseCardClassName = "w-full overflow-hidden rounded-agg-lg border border-agg-separator bg-agg-secondary text-agg-foreground shadow-none hover:shadow-none";
827
-
828
- // src/primitives/skeleton/views/market-details-skeleton-view.tsx
829
- var import_jsx_runtime10 = require("react/jsx-runtime");
830
- var orderBookAskBarWidths = [
831
- "w-[52px] md:w-[240px]",
832
- "w-[48px] md:w-[200px]",
833
- "w-[40px] md:w-[120px]",
834
- "w-[36px] md:w-[60px]"
835
- ];
836
- var orderBookBidBarWidths = [
837
- "w-[36px] md:w-[60px]",
838
- "w-[40px] md:w-[120px]",
839
- "w-[48px] md:w-[200px]",
840
- "w-[52px] md:w-[240px]"
841
- ];
842
- var MarketDetailsHeaderSkeleton = () => {
843
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 px-4 py-3 md:px-5", children: [
844
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex min-w-0 items-center gap-3 md:min-w-52 md:gap-4", children: [
845
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "size-12 rounded-agg-lg md:size-[60px]" }),
846
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex min-w-0 flex-col gap-2", children: [
847
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-6 w-[132px] rounded-agg-sm" }),
848
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-[141px] rounded-agg-sm" })
849
- ] })
850
- ] }),
851
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-9 w-[60px] rounded-agg-md" }),
852
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex w-full gap-2 md:w-auto", children: [
853
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-9 w-full rounded-agg-full md:w-[135px]" }),
854
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-9 w-full rounded-agg-full md:w-[131px]" })
855
- ] })
856
- ] });
857
- };
858
- var MarketDetailsTabsSkeleton = () => {
859
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex h-14 items-end px-4 md:px-5", children: [
860
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex h-full flex-col items-end justify-end rounded-t-agg-lg", children: [
861
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-6 w-20 rounded-agg-sm" }) }),
862
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-[3px] w-full rounded-t-agg-sm" })
863
- ] }),
864
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex h-full flex-col justify-center", children: [
865
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-6 w-12 rounded-agg-sm" }) }),
866
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-[3px] w-full" })
867
- ] })
868
- ] });
869
- };
870
- var MarketDetailsOrderBookRows = ({
871
- side,
872
- barWidths
873
- }) => {
874
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col gap-2", children: barWidths.map((barWidthClassName, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2", children: [
875
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2 md:grid-cols-[88px_1fr_1fr_minmax(120px,220px)] md:gap-6", children: [
876
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-1 md:gap-3", children: [
877
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
878
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 w-[60px] rounded-agg-sm" })
879
- ] }),
880
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 rounded-agg-sm" }),
881
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 rounded-agg-sm" }),
882
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: cn("h-2 rounded-agg-full", barWidthClassName) }) })
883
- ] }),
884
- index < barWidths.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-px w-full bg-agg-separator" }) : null
885
- ] }, `${side}-row-${index}`)) });
886
- };
887
- var MarketDetailsOderbookSkeleton = ({
888
- className
889
- }) => {
890
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("flex flex-col gap-5", className), children: [
891
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2", children: [
892
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-10 rounded-agg-sm" }),
893
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MarketDetailsOrderBookRows, { side: "ask", barWidths: orderBookAskBarWidths })
894
- ] }),
895
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2", children: [
896
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-10 rounded-agg-sm" }),
897
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MarketDetailsOrderBookRows, { side: "bid", barWidths: orderBookBidBarWidths })
898
- ] })
899
- ] });
900
- };
901
- var MarketDetailsSkeletonView = ({
902
- className,
903
- ariaLabel,
904
- isDetailed
905
- }) => {
906
- const labels = (0, import_hooks10.useLabels)();
907
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
908
- Card,
909
- {
910
- className: cn("group/agg-skeleton", marketDetailsBaseCardClassName, className),
911
- role: "status",
912
- "aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.loading,
913
- "aria-busy": true,
914
- children: [
915
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MarketDetailsHeaderSkeleton, {}),
916
- isDetailed ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
917
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
918
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MarketDetailsTabsSkeleton, {}),
919
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
920
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MarketDetailsOderbookSkeleton, { className: "p-5" })
921
- ] }) : null
922
- ]
923
- }
924
- );
925
- };
926
- MarketDetailsSkeletonView.displayName = "MarketDetailsSkeletonView";
927
-
928
- // src/primitives/skeleton/views/place-order-skeleton-view.tsx
929
- var import_jsx_runtime11 = require("react/jsx-runtime");
930
- var placeOrderCardClassName = "overflow-hidden rounded-agg-xl border border-agg-border bg-agg-secondary shadow-none hover:shadow-none";
931
- var TabsSkeletonBar = () => {
932
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex w-full items-end border-b border-agg-border", children: [
933
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col rounded-t-agg-lg", children: [
934
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "px-5 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-6 w-10 rounded-agg-sm" }) }),
935
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-[3px] w-full rounded-t-agg-sm" })
936
- ] }),
937
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col", children: [
938
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "px-5 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-6 w-10 rounded-agg-sm" }) }),
939
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "h-[3px] w-full" })
940
- ] })
941
- ] });
942
- };
943
- var ContentBody = () => {
944
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn("flex flex-col gap-6 p-5"), children: [
945
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-2", children: [
946
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
947
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "size-12 shrink-0 rounded-agg-lg" }),
948
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
949
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-[92%] max-w-[240px] rounded-agg-sm" }),
950
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-[64%] max-w-[160px] rounded-agg-sm" })
951
- ] })
952
- ] }),
953
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-6 w-[92px] rounded-agg-sm" }),
954
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TabsSkeletonBar, {})
955
- ] }),
956
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-4", children: [
957
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex w-full gap-2", children: [
958
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-11 flex-1 rounded-agg-full" }),
959
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-11 flex-1 rounded-agg-full" })
960
- ] }),
961
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
962
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-2", children: [
963
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-5 w-[63px] rounded-agg-sm" }),
964
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-[118px] rounded-agg-sm" })
965
- ] }),
966
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: cn("text-agg-3xl font-agg-bold leading-agg-9 text-agg-separator"), children: "$0" })
967
- ] })
968
- ] }),
969
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-12 w-full rounded-agg-full" }),
970
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[240px] self-center rounded-agg-sm" })
971
- ] });
972
- };
973
- var PlaceOrderSkeletonView = ({
974
- className,
975
- ariaLabel
976
- }) => {
977
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
978
- "div",
979
- {
980
- className: cn("group/agg-skeleton", "w-full", className),
981
- role: "status",
982
- "aria-label": ariaLabel != null ? ariaLabel : "Loading place order",
983
- "aria-busy": true,
984
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex w-full items-end justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Card, { className: cn(placeOrderCardClassName, "w-full"), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ContentBody, {}) }) })
985
- }
986
- );
987
- };
988
- PlaceOrderSkeletonView.displayName = "PlaceOrderSkeletonView";
989
-
990
- // src/primitives/skeleton/views/settlement-skeleton-view.tsx
991
- var import_hooks11 = require("@agg-market/hooks");
992
- var import_jsx_runtime12 = require("react/jsx-runtime");
993
- var SettlementSkeletonView = ({
994
- className,
995
- ariaLabel
996
- }) => {
997
- const labels = (0, import_hooks11.useLabels)();
998
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
999
- Card,
1000
- {
1001
- className: cn(
1002
- "group/agg-skeleton",
1003
- "flex flex-col w-full gap-5 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5 shadow-none hover:shadow-none",
1004
- className
1005
- ),
1006
- role: "status",
1007
- "aria-label": ariaLabel != null ? ariaLabel : labels.trading.settlementLoading,
1008
- "aria-busy": true,
1009
- children: [
1010
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex w-full items-center justify-between gap-4", children: [
1011
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-[81px] rounded-agg-sm" }),
1012
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-full max-w-[240px] rounded-agg-sm" })
1013
- ] }),
1014
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
1015
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-[200px] rounded-agg-sm" }),
1016
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col gap-2", children: [
1017
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[320px] rounded-agg-sm" }),
1018
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[280px] rounded-agg-sm" })
1019
- ] })
1020
- ] }),
1021
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
1022
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
1023
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2", children: [
1024
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
1025
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-[100px] rounded-agg-sm" })
1026
- ] }),
1027
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2", children: [
1028
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
1029
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-[60px] rounded-agg-sm" })
1030
- ] })
1031
- ] })
1032
- ]
1033
- }
1034
- );
1035
- };
1036
- SettlementSkeletonView.displayName = "SettlementSkeletonView";
1037
-
1038
- // src/primitives/skeleton/skeleton.types.ts
1039
- var skeletonViews = {
1040
- eventListItem: "event-list-item",
1041
- eventListItemDetails: "event-list-item-details",
1042
- marketDetailsMinified: "market-details-minified",
1043
- marketDetailsDetailed: "market-details-detailed",
1044
- eventList: "event-list",
1045
- settlement: "settlement",
1046
- placeOrder: "place-order"
1047
- };
1048
-
1049
- // src/primitives/skeleton/index.tsx
1050
- var import_jsx_runtime13 = require("react/jsx-runtime");
1051
- var Skeleton = ({ view, className, ariaLabel }) => {
1052
- if (view === skeletonViews.eventListItem) {
1053
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(EventListItemSkeletonView, { className, ariaLabel, isStandalone: true });
1054
- }
1055
- if (view === skeletonViews.eventListItemDetails) {
1056
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(EventListItemDetailsSkeletonView, { className, ariaLabel });
1057
- }
1058
- if (view === skeletonViews.marketDetailsMinified) {
1059
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MarketDetailsSkeletonView, { className, ariaLabel, isDetailed: false });
1060
- }
1061
- if (view === skeletonViews.marketDetailsDetailed) {
1062
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MarketDetailsSkeletonView, { className, ariaLabel, isDetailed: true });
1063
- }
1064
- if (view === skeletonViews.settlement) {
1065
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettlementSkeletonView, { className, ariaLabel });
1066
- }
1067
- if (view === skeletonViews.placeOrder) {
1068
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PlaceOrderSkeletonView, { className, ariaLabel });
1069
- }
1070
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(EventListSkeletonView, { className, ariaLabel });
1071
- };
1072
- Skeleton.displayName = "Skeleton";
1073
-
1074
- // src/primitives/typography/typography.constants.ts
1075
- var typographyVariantClasses = {
1076
- display: cn("agg-type-display"),
1077
- heading: cn("agg-type-heading"),
1078
- title: cn("agg-type-title"),
1079
- "title-strong": cn("agg-type-title-strong"),
1080
- "body-large": cn("agg-type-body-large"),
1081
- "body-large-strong": cn("agg-type-body-large-strong"),
1082
- body: cn("agg-type-body"),
1083
- "body-strong": cn("agg-type-body-strong"),
1084
- label: cn("agg-type-label"),
1085
- "label-strong": cn("agg-type-label-strong"),
1086
- "label-caps": cn("agg-type-label-caps"),
1087
- caption: cn("agg-type-caption"),
1088
- "caption-strong": cn("agg-type-caption-strong"),
1089
- "caption-caps": cn("agg-type-caption-caps"),
1090
- overline: cn("agg-type-overline")
1091
- };
1092
-
1093
- // src/primitives/typography/index.tsx
1094
- var import_jsx_runtime14 = require("react/jsx-runtime");
1095
- var Typography = ({
1096
- as: Component = "p",
1097
- variant = "body",
1098
- className,
1099
- children
1100
- }) => {
1101
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1102
- Component,
1103
- {
1104
- className: cn(
1105
- "group/agg-typography",
1106
- "text-agg-foreground",
1107
- typographyVariantClasses[variant],
1108
- className
1109
- ),
1110
- children
1111
- }
1112
- );
1113
- };
1114
- Typography.displayName = "Typography";
1115
-
1116
- // src/primitives/venue-logo/index.tsx
1117
- var import_hooks12 = require("@agg-market/hooks");
1118
-
1119
- // src/primitives/icon/types.ts
1120
- var getIconA11yProps = (title) => ({
1121
- role: title ? "img" : "presentation",
1122
- "aria-hidden": title ? void 0 : true
1123
- });
1124
-
1125
- // src/primitives/venue-logo/logo-props.ts
1126
- var DEFAULT_MONOCHROME_COLOR = "currentColor";
1127
- var resolveLogoPrimaryColor = ({
1128
- brandColor,
1129
- isColor = true,
1130
- color
1131
- }) => {
1132
- if (typeof color === "string" && color.trim())
1133
- return color;
1134
- if (!isColor)
1135
- return DEFAULT_MONOCHROME_COLOR;
1136
- return brandColor;
1137
- };
1138
-
1139
- // src/primitives/venue-logo/svg/logo-kalshi.tsx
1140
- var import_jsx_runtime15 = require("react/jsx-runtime");
1141
- var KALSHI_GREEN = "#18C590";
1142
- var LogoKalshiIcon = (_a) => {
1143
- var _b = _a, {
1144
- title,
1145
- className,
1146
- isColor = true,
1147
- color
1148
- } = _b, props = __objRest(_b, [
1149
- "title",
1150
- "className",
1151
- "isColor",
1152
- "color"
1153
- ]);
1154
- const primaryColor = resolveLogoPrimaryColor({
1155
- brandColor: KALSHI_GREEN,
1156
- isColor,
1157
- color
1158
- });
1159
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1160
- "svg",
1161
- __spreadProps(__spreadValues(__spreadValues({
1162
- viewBox: "0 0 100 100",
1163
- className,
1164
- fill: "none"
1165
- }, getIconA11yProps(title)), props), {
1166
- children: [
1167
- title ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("title", { children: title }) : null,
1168
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1169
- "path",
1170
- {
1171
- d: "M54.9798 47.579L79.4249 85.9995H58.2273L38.2531 52.9344V85.9995H20.4189V13.9995H38.2531V45.4356L59.6547 13.9995H78.7119L54.9798 47.579Z",
1172
- fill: primaryColor
1173
- }
1174
- )
1175
- ]
1176
- })
1177
- );
1178
- };
1179
- LogoKalshiIcon.displayName = "LogoKalshiIcon";
1180
-
1181
- // src/primitives/venue-logo/svg/logo-opinion.tsx
1182
- var import_jsx_runtime16 = require("react/jsx-runtime");
1183
- var OPINION_BLACK = "#000000";
1184
- var LogoOpinionIcon = (_a) => {
1185
- var _b = _a, {
1186
- title,
1187
- className,
1188
- isColor = true,
1189
- color
1190
- } = _b, props = __objRest(_b, [
1191
- "title",
1192
- "className",
1193
- "isColor",
1194
- "color"
1195
- ]);
1196
- const primaryColor = resolveLogoPrimaryColor({
1197
- brandColor: OPINION_BLACK,
1198
- isColor,
1199
- color
1200
- });
1201
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1202
- "svg",
1203
- __spreadProps(__spreadValues(__spreadValues({
1204
- viewBox: "0 0 100 100",
1205
- className,
1206
- fill: "none"
1207
- }, getIconA11yProps(title)), props), {
1208
- children: [
1209
- title ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("title", { children: title }) : null,
1210
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1211
- "path",
1212
- {
1213
- 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",
1214
- fill: primaryColor
1215
- }
1216
- )
1217
- ]
1218
- })
1219
- );
1220
- };
1221
- LogoOpinionIcon.displayName = "LogoOpinionIcon";
1222
-
1223
- // src/primitives/venue-logo/svg/logo-polymarket.tsx
1224
- var import_jsx_runtime17 = require("react/jsx-runtime");
1225
- var POLYMARKET_BLUE = "#2E5CFF";
1226
- var LogoPolymarketIcon = (_a) => {
1227
- var _b = _a, {
1228
- title,
1229
- className,
1230
- isColor = true,
1231
- color
1232
- } = _b, props = __objRest(_b, [
1233
- "title",
1234
- "className",
1235
- "isColor",
1236
- "color"
1237
- ]);
1238
- const primaryColor = resolveLogoPrimaryColor({
1239
- brandColor: POLYMARKET_BLUE,
1240
- isColor,
1241
- color
1242
- });
1243
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1244
- "svg",
1245
- __spreadProps(__spreadValues(__spreadValues({
1246
- viewBox: "0 0 100 100",
1247
- className,
1248
- fill: "none"
1249
- }, getIconA11yProps(title)), props), {
1250
- children: [
1251
- title ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("title", { children: title }) : null,
1252
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1253
- "path",
1254
- {
1255
- 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",
1256
- fill: primaryColor
1257
- }
1258
- )
1259
- ]
1260
- })
1261
- );
1262
- };
1263
- LogoPolymarketIcon.displayName = "LogoPolymarketIcon";
1264
-
1265
- // src/primitives/venue-logo/svg/logo-probable.tsx
1266
- var import_jsx_runtime18 = require("react/jsx-runtime");
1267
- var PROBABLE_ORANGE = "#F05923";
1268
- var LogoProbableIcon = (_a) => {
1269
- var _b = _a, {
1270
- title,
1271
- className,
1272
- isColor = true,
1273
- color
1274
- } = _b, props = __objRest(_b, [
1275
- "title",
1276
- "className",
1277
- "isColor",
1278
- "color"
1279
- ]);
1280
- const primaryColor = resolveLogoPrimaryColor({
1281
- brandColor: PROBABLE_ORANGE,
1282
- isColor,
1283
- color
1284
- });
1285
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1286
- "svg",
1287
- __spreadProps(__spreadValues(__spreadValues({
1288
- viewBox: "0 0 100 100",
1289
- className,
1290
- fill: "none"
1291
- }, getIconA11yProps(title)), props), {
1292
- children: [
1293
- title ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("title", { children: title }) : null,
1294
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1295
- "path",
1296
- {
1297
- 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",
1298
- fill: primaryColor
1299
- }
1300
- ),
1301
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M90.9329 15.4546V30.4546H8.90234V15.4546H90.9329Z", fill: primaryColor }),
1302
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1303
- "path",
1304
- {
1305
- 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",
1306
- fill: primaryColor
1307
- }
1308
- )
1309
- ]
1310
- })
1311
- );
1312
- };
1313
- LogoProbableIcon.displayName = "LogoProbableIcon";
1314
-
1315
- // src/primitives/venue-logo/venue-logo.constants.ts
1316
- var venueLogoRegistry = {
1317
- kalshi: LogoKalshiIcon,
1318
- polymarket: LogoPolymarketIcon,
1319
- opinion: LogoOpinionIcon,
1320
- probable: LogoProbableIcon
1321
- };
1322
- var VENUE_LOGO_BASE_URL = "https://assets.snagsolutions.io/public/prediction-markets/logos";
1323
- var venueLogoUrlRegistry = {
1324
- kalshi: `${VENUE_LOGO_BASE_URL}/kalshi.png`,
1325
- polymarket: `${VENUE_LOGO_BASE_URL}/polymarket.png`,
1326
- opinion: `${VENUE_LOGO_BASE_URL}/opinion.png`,
1327
- probable: `${VENUE_LOGO_BASE_URL}/probable.png`
1328
- };
1329
- var venueLogoNames = Object.keys(venueLogoRegistry);
1330
- var sizeClasses2 = {
1331
- small: "h-4 w-4",
1332
- medium: "h-6 w-6",
1333
- large: "h-8 w-8"
1334
- };
1335
-
1336
- // src/primitives/venue-logo/index.tsx
1337
- var import_jsx_runtime19 = require("react/jsx-runtime");
1338
- var VenueLogo = ({
1339
- venue,
1340
- variant = "icon",
1341
- isColor = true,
1342
- isMonochromatic = false,
1343
- color,
1344
- size = "medium",
1345
- className,
1346
- ariaLabel,
1347
- title
1348
- }) => {
1349
- const labels = (0, import_hooks12.useLabels)();
1350
- const sizeClass = sizeClasses2[size];
1351
- const resolvedLabel = ariaLabel != null ? ariaLabel : labels.venues[venue];
1352
- if (variant === "logo") {
1353
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1354
- "img",
1355
- {
1356
- src: venueLogoUrlRegistry[venue],
1357
- alt: resolvedLabel,
1358
- title,
1359
- className: cn("shrink-0 rounded-agg-lg object-cover", sizeClass, className)
1360
- }
1361
- );
1362
- }
1363
- const Component = venueLogoRegistry[venue];
1364
- const resolvedIsColor = isMonochromatic ? false : isColor;
1365
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1366
- Component,
1367
- {
1368
- className: cn("group/agg-venue-logo", "shrink-0", sizeClass, className),
1369
- isColor: resolvedIsColor,
1370
- color,
1371
- "aria-label": resolvedLabel,
1372
- title
1373
- }
1374
- );
1375
- };
1376
- VenueLogo.displayName = "VenueLogo";
1377
-
1378
- // src/events/item/event-list-item.utils.ts
1379
- var resolveEventListItemEvent = (fetchedEvent) => {
1380
- if (!fetchedEvent)
1381
- return void 0;
1382
- const mergedVenueMarkets = fetchedEvent.markets.flatMap(
1383
- (market) => market.venueMarkets
1384
- );
1385
- if (mergedVenueMarkets.length === 0)
1386
- return void 0;
1387
- return fetchedEvent;
1388
- };
1389
- var normalizeProbability = (value) => {
1390
- if (typeof value !== "number" || !Number.isFinite(value))
1391
- return void 0;
1392
- if (value < 0)
1393
- return 0;
1394
- if (value > 1)
1395
- return 1;
1396
- return value;
1397
- };
1398
- var hasDateLabel = (outcome) => {
1399
- return !!toDate(outcome.label);
1400
- };
1401
- var sortOutcomes = (outcomes) => {
1402
- if (outcomes.length <= 1)
1403
- return outcomes;
1404
- const now = Date.now();
1405
- if (outcomes.some(hasDateLabel)) {
1406
- return [...outcomes].sort((a, b) => {
1407
- var _a, _b, _c, _d;
1408
- const aDate = (_b = (_a = toDate(a.label)) == null ? void 0 : _a.getTime()) != null ? _b : 0;
1409
- const bDate = (_d = (_c = toDate(b.label)) == null ? void 0 : _c.getTime()) != null ? _d : 0;
1410
- return Math.abs(aDate - now) - Math.abs(bDate - now);
1411
- });
1412
- }
1413
- return [...outcomes].sort((a, b) => {
1414
- var _a, _b;
1415
- const aPrice = (_a = normalizeProbability(a.price)) != null ? _a : 0;
1416
- const bPrice = (_b = normalizeProbability(b.price)) != null ? _b : 0;
1417
- return bPrice - aPrice;
1418
- });
1419
- };
1420
- var resolveOutcomeTitle = (outcome) => {
1421
- if (outcome.title && outcome.title.trim())
1422
- return outcome.title;
1423
- return outcome.label;
1424
- };
1425
- var selectPrimaryVenueMarket = (venueMarkets) => {
1426
- if (venueMarkets.length === 0)
1427
- return void 0;
1428
- if (venueMarkets.length === 1)
1429
- return venueMarkets[0];
1430
- return [...venueMarkets].sort((a, b) => {
1431
- const aVolume = typeof a.volume === "number" ? a.volume : -1;
1432
- const bVolume = typeof b.volume === "number" ? b.volume : -1;
1433
- return bVolume - aVolume;
1434
- })[0];
1435
- };
1436
- var resolveTileTitle = (event, primaryVenueMarket, titleOverride) => {
1437
- if (typeof titleOverride === "string" && titleOverride.trim()) {
1438
- return titleOverride;
1439
- }
1440
- if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.question) === "string" && primaryVenueMarket.question.trim()) {
1441
- return primaryVenueMarket.question;
1442
- }
1443
- return event.title;
1444
- };
1445
- var resolveTileImage = (event, primaryVenueMarket, imageOverride) => {
1446
- if (typeof imageOverride === "string" && imageOverride.trim()) {
1447
- return imageOverride;
1448
- }
1449
- if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.image) === "string" && primaryVenueMarket.image.trim()) {
1450
- return primaryVenueMarket.image;
1451
- }
1452
- if (typeof event.image === "string" && event.image.trim()) {
1453
- return event.image;
1454
- }
1455
- return void 0;
1456
- };
1457
- var resolveVenueLabel = (venue, venueInfo, labels) => {
1458
- var _a, _b;
1459
- if (!venue)
1460
- return labels.eventItem.venueSingular;
1461
- return (_b = (_a = venueInfo == null ? void 0 : venueInfo[venue]) == null ? void 0 : _a.label) != null ? _b : labels.venues[venue];
1462
- };
1463
-
1464
- // src/events/item-details/event-list-item-details.utils.ts
1465
- var import_dayjs2 = __toESM(require("dayjs"));
1466
- var normalizeLabel = (value) => {
1467
- return value.trim().toLowerCase();
1468
- };
1469
- var isDateLikeLabel = (value) => {
1470
- if (!value.trim())
1471
- return false;
1472
- return (0, import_dayjs2.default)(value).isValid();
1473
- };
1474
- var formatDateLabel = (value) => {
1475
- if (!isDateLikeLabel(value))
1476
- return value;
1477
- return (0, import_dayjs2.default)(value).format("MMM D, YYYY");
1478
- };
1479
- var getDefaultSelectedTimeRange = (value) => {
1480
- if (!value)
1481
- return "1M";
1482
- return value;
1483
- };
1484
- var getTimeWindowByRange = (range) => {
1485
- const endTs = (0, import_dayjs2.default)().unix();
1486
- if (range === "1H") {
1487
- return {
1488
- startTs: import_dayjs2.default.unix(endTs).subtract(1, "hour").unix(),
1489
- endTs,
1490
- intervalMinutes: 5
1491
- };
1492
- }
1493
- if (range === "6H") {
1494
- return {
1495
- startTs: import_dayjs2.default.unix(endTs).subtract(6, "hour").unix(),
1496
- endTs,
1497
- intervalMinutes: 15
1498
- };
1499
- }
1500
- if (range === "1D") {
1501
- return {
1502
- startTs: import_dayjs2.default.unix(endTs).subtract(1, "day").unix(),
1503
- endTs,
1504
- intervalMinutes: 30
1505
- };
1506
- }
1507
- if (range === "1W") {
1508
- return {
1509
- startTs: import_dayjs2.default.unix(endTs).subtract(7, "day").unix(),
1510
- endTs,
1511
- intervalMinutes: 60
1512
- };
1513
- }
1514
- if (range === "1M") {
1515
- return {
1516
- startTs: import_dayjs2.default.unix(endTs).subtract(1, "month").unix(),
1517
- endTs,
1518
- intervalMinutes: 240
1519
- };
1520
- }
1521
- return {
1522
- startTs: import_dayjs2.default.unix(endTs).subtract(6, "month").unix(),
1523
- endTs,
1524
- intervalMinutes: 720
1525
- };
1526
- };
1527
- var resolveOutcomeLabels = (venueMarkets) => {
1528
- var _a;
1529
- const primaryMarket = selectPrimaryVenueMarket(venueMarkets);
1530
- const initialLabels = ((_a = primaryMarket == null ? void 0 : primaryMarket.venueMarketOutcomes) != null ? _a : []).map(
1531
- (outcome) => resolveOutcomeTitle(outcome)
1532
- );
1533
- const labels = new Set(initialLabels);
1534
- venueMarkets.forEach((market) => {
1535
- sortOutcomes(market.venueMarketOutcomes).forEach((outcome) => {
1536
- labels.add(resolveOutcomeTitle(outcome));
1537
- });
1538
- });
1539
- return [...labels];
1540
- };
1541
- var resolveDefaultOutcomeLabel = (outcomeLabels) => {
1542
- return outcomeLabels[0];
1543
- };
1544
- var matchOutcomeByLabel = (outcome, selectedOutcomeLabel) => {
1545
- const normalizedSelectedLabel = normalizeLabel(selectedOutcomeLabel);
1546
- const resolvedTitle = resolveOutcomeTitle(outcome);
1547
- return normalizeLabel(resolvedTitle) === normalizedSelectedLabel || normalizeLabel(outcome.label) === normalizedSelectedLabel;
1548
- };
1549
- var resolveOutcomesByVenue = (venueMarkets, selectedOutcomeLabel) => {
1550
- return venueMarkets.map((market) => {
1551
- const matchedOutcome = sortOutcomes(market.venueMarketOutcomes).find((outcome) => {
1552
- return matchOutcomeByLabel(outcome, selectedOutcomeLabel);
1553
- });
1554
- if (!matchedOutcome)
1555
- return null;
1556
- return {
1557
- venue: market.venue,
1558
- market,
1559
- outcome: matchedOutcome
1560
- };
1561
- }).filter((item) => item != null);
1562
- };
1563
- var buildPriceHistoryGroups = (selectedOutcomes, fallbackMarketId) => {
1564
- const marketIdByVenue = /* @__PURE__ */ new Map();
1565
- selectedOutcomes.forEach(({ venue, market }) => {
1566
- var _a, _b;
1567
- const marketWithCanonicalId = market;
1568
- const canonicalMarketId = (_a = marketWithCanonicalId.marketId) != null ? _a : fallbackMarketId;
1569
- if (!canonicalMarketId)
1570
- return;
1571
- if (!marketIdByVenue.has(venue)) {
1572
- marketIdByVenue.set(venue, /* @__PURE__ */ new Set());
1573
- }
1574
- (_b = marketIdByVenue.get(venue)) == null ? void 0 : _b.add(canonicalMarketId);
1575
- });
1576
- return [...marketIdByVenue.entries()].map(([venue, marketIds]) => ({
1577
- venue,
1578
- venueMarketOutcomeIds: [...marketIds]
1579
- })).filter((group) => group.venueMarketOutcomeIds.length > 0);
1580
- };
1581
- var resolveSeriesColor = (venue, index) => {
1582
- var _a;
1583
- const colorFromVenue = lineColorByVenue[venue];
1584
- if (colorFromVenue)
1585
- return colorFromVenue;
1586
- return (_a = fallbackLineColors[index % fallbackLineColors.length]) != null ? _a : "#2e5cff";
1587
- };
1588
-
1589
- // src/events/item-details/index.tsx
1590
- var import_jsx_runtime20 = require("react/jsx-runtime");
1591
- var EventListItemDetailsLoadingState = ({
1592
- classNames,
1593
- ariaLabel
1594
- }) => {
1595
- const labels = (0, import_hooks13.useLabels)();
1596
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1597
- Skeleton,
1598
- {
1599
- view: "event-list-item-details",
1600
- className: classNames == null ? void 0 : classNames.root,
1601
- ariaLabel: ariaLabel != null ? ariaLabel : labels.eventItemDetails.loading
1602
- }
1603
- );
1604
- };
1605
- var EventListItemDetailsUnavailableState = ({
1606
- classNames,
1607
- ariaLabel
1608
- }) => {
1609
- const labels = (0, import_hooks13.useLabels)();
1610
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1611
- Card,
1612
- {
1613
- className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
1614
- role: "status",
1615
- "aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.unavailableAria,
1616
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
1617
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "body-large-strong", className: cn("truncate", classNames == null ? void 0 : classNames.title), children: labels.eventItemDetails.unavailableTitle }),
1618
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItemDetails.unavailableDescription })
1619
- ] })
1620
- }
1621
- );
1622
- };
1623
- var probabilityModeOrder = ["yes", "no"];
1624
- var clampProbability = (value) => {
1625
- if (value < 0)
1626
- return 0;
1627
- if (value > 1)
1628
- return 1;
1629
- return value;
1630
- };
1631
- var resolveAverageProbability = (values) => {
1632
- const validValues = values.filter((value) => value != null);
1633
- if (validValues.length === 0)
1634
- return void 0;
1635
- return validValues.reduce((sum, value) => sum + value, 0) / validValues.length;
1636
- };
1637
- var resolveOutcomeCandidateIds = (market, outcome) => {
1638
- var _a, _b;
1639
- const marketWithCanonicalId = market;
1640
- return [
1641
- outcome.id,
1642
- (_a = outcome.externalIdentifier) != null ? _a : void 0,
1643
- market.externalIdentifier,
1644
- (_b = marketWithCanonicalId.marketId) != null ? _b : void 0
1645
- ].filter((value) => typeof value === "string" && value.trim().length > 0);
1646
- };
1647
- var EventListItemDetailsGraphSection = ({
1648
- venueMarkets,
1649
- canonicalMarketId,
1650
- selectedOutcomeLabel,
1651
- onSelectedOutcomeLabelChange,
1652
- switchLabels,
1653
- isDateOutcomeMarket,
1654
- classNames,
1655
- showVenueLogo,
1656
- venueInfo,
1657
- formatPercent,
1658
- selectedTimeRange
1659
- }) => {
1660
- const labels = (0, import_hooks13.useLabels)();
1661
- const [selectedVenue, setSelectedVenue] = (0, import_react3.useState)(null);
1662
- const [activeProbabilityMode, setActiveProbabilityMode] = (0, import_react3.useState)("yes");
1663
- const probabilityModeConfigs = (0, import_react3.useMemo)(() => {
1664
- if (isDateOutcomeMarket) {
1665
- return {
1666
- yes: {
1667
- switchLabel: switchLabels[0],
1668
- sourceOutcomeLabel: selectedOutcomeLabel,
1669
- transformProbability: (value) => value
1670
- },
1671
- no: {
1672
- switchLabel: switchLabels[1],
1673
- sourceOutcomeLabel: selectedOutcomeLabel,
1674
- transformProbability: (value) => 1 - value
1675
- }
1676
- };
1677
- }
1678
- return {
1679
- yes: {
1680
- switchLabel: switchLabels[0],
1681
- sourceOutcomeLabel: switchLabels[0],
1682
- transformProbability: (value) => value
1683
- },
1684
- no: {
1685
- switchLabel: switchLabels[1],
1686
- sourceOutcomeLabel: switchLabels[1],
1687
- transformProbability: (value) => value
1688
- }
1689
- };
1690
- }, [isDateOutcomeMarket, selectedOutcomeLabel, switchLabels]);
1691
- const selectedOutcomesByMode = (0, import_react3.useMemo)(() => {
1692
- return {
1693
- yes: resolveOutcomesByVenue(venueMarkets, probabilityModeConfigs.yes.sourceOutcomeLabel),
1694
- no: resolveOutcomesByVenue(venueMarkets, probabilityModeConfigs.no.sourceOutcomeLabel)
1695
- };
1696
- }, [
1697
- probabilityModeConfigs.no.sourceOutcomeLabel,
1698
- probabilityModeConfigs.yes.sourceOutcomeLabel,
1699
- venueMarkets
1700
- ]);
1701
- (0, import_react3.useEffect)(() => {
1702
- if (isDateOutcomeMarket) {
1703
- return;
1704
- }
1705
- const nextMode = selectedOutcomeLabel === probabilityModeConfigs.no.sourceOutcomeLabel ? "no" : "yes";
1706
- setActiveProbabilityMode(nextMode);
1707
- }, [isDateOutcomeMarket, probabilityModeConfigs.no.sourceOutcomeLabel, selectedOutcomeLabel]);
1708
- const normalizedVenueDataByMode = (0, import_react3.useMemo)(() => {
1709
- const buildModeData = (mode) => {
1710
- const modeConfig = probabilityModeConfigs[mode];
1711
- return selectedOutcomesByMode[mode].map((outcomeByVenue, index) => {
1712
- const rawProbability = normalizeProbability(outcomeByVenue.outcome.price);
1713
- const transformedProbability = rawProbability == null ? void 0 : clampProbability(modeConfig.transformProbability(rawProbability));
1714
- return {
1715
- venue: outcomeByVenue.venue,
1716
- venueLabel: resolveVenueLabel(outcomeByVenue.venue, venueInfo, labels),
1717
- market: outcomeByVenue.market,
1718
- outcome: outcomeByVenue.outcome,
1719
- probability: transformedProbability,
1720
- color: resolveSeriesColor(outcomeByVenue.venue, index)
1721
- };
1722
- });
1723
- };
1724
- return {
1725
- yes: buildModeData("yes"),
1726
- no: buildModeData("no")
1727
- };
1728
- }, [labels, probabilityModeConfigs, selectedOutcomesByMode, venueInfo]);
1729
- const allOutcomesForHistory = (0, import_react3.useMemo)(() => {
1730
- const outcomeByModeAndId = /* @__PURE__ */ new Map();
1731
- probabilityModeOrder.forEach((mode) => {
1732
- selectedOutcomesByMode[mode].forEach((outcomeByVenue) => {
1733
- outcomeByModeAndId.set(
1734
- `${outcomeByVenue.venue}:${outcomeByVenue.outcome.id}`,
1735
- outcomeByVenue
1736
- );
1737
- });
1738
- });
1739
- return [...outcomeByModeAndId.values()];
1740
- }, [selectedOutcomesByMode]);
1741
- const priceHistoryGroups = (0, import_react3.useMemo)(() => {
1742
- return buildPriceHistoryGroups(allOutcomesForHistory, canonicalMarketId);
1743
- }, [allOutcomesForHistory, canonicalMarketId]);
1744
- const timeWindow = (0, import_react3.useMemo)(() => {
1745
- return getTimeWindowByRange(selectedTimeRange);
1746
- }, [selectedTimeRange]);
1747
- const { data: priceHistoryData, isLoading: isPriceHistoryLoading } = (0, import_hooks13.usePriceHistory)(__spreadProps(__spreadValues({
1748
- groups: priceHistoryGroups
1749
- }, timeWindow), {
1750
- enabled: priceHistoryGroups.length > 0
1751
- }));
1752
- const priceHistoryByVenue = (0, import_react3.useMemo)(() => {
1753
- const historyByVenue = /* @__PURE__ */ new Map();
1754
- if (!(priceHistoryData == null ? void 0 : priceHistoryData.length)) {
1755
- return historyByVenue;
1756
- }
1757
- priceHistoryData.forEach((historyItem) => {
1758
- const venue = historyItem.venue;
1759
- const venueHistory = historyByVenue.get(venue);
1760
- if (venueHistory) {
1761
- venueHistory.push(historyItem);
1762
- return;
1763
- }
1764
- historyByVenue.set(venue, [historyItem]);
1765
- });
1766
- return historyByVenue;
1767
- }, [priceHistoryData]);
1768
- const chartSeriesByMode = (0, import_react3.useMemo)(() => {
1769
- const buildSeries = (mode) => {
1770
- const modeConfig = probabilityModeConfigs[mode];
1771
- const chartSeries = [];
1772
- normalizedVenueDataByMode[mode].forEach((venueData) => {
1773
- var _a;
1774
- const venueHistory = priceHistoryByVenue.get(venueData.venue);
1775
- if (!(venueHistory == null ? void 0 : venueHistory.length))
1776
- return;
1777
- const candidateIds = resolveOutcomeCandidateIds(venueData.market, venueData.outcome);
1778
- const matchingHistory = (_a = venueHistory.find((historyItem) => candidateIds.includes(historyItem.marketId))) != null ? _a : venueHistory.length === 1 ? venueHistory[0] : void 0;
1779
- if (!matchingHistory)
1780
- return;
1781
- const points = matchingHistory.points.map((point) => {
1782
- const probability = normalizeProbability(point.price);
1783
- if (probability == null || !Number.isFinite(point.timestamp))
1784
- return null;
1785
- return {
1786
- time: point.timestamp,
1787
- value: clampProbability(modeConfig.transformProbability(probability)) * 100
1788
- };
1789
- }).filter((point) => point != null);
1790
- if (points.length === 0)
1791
- return;
1792
- chartSeries.push({
1793
- id: `${mode}-${venueData.venue}-${matchingHistory.marketId}`,
1794
- venue: venueData.venue,
1795
- color: venueData.color,
1796
- points,
1797
- lineWidth: 2,
1798
- lineStyle: "solid"
1799
- });
1800
- });
1801
- return chartSeries;
1802
- };
1803
- return {
1804
- yes: buildSeries("yes"),
1805
- no: buildSeries("no")
1806
- };
1807
- }, [normalizedVenueDataByMode, priceHistoryByVenue, probabilityModeConfigs]);
1808
- const visibleChartSeries = (0, import_react3.useMemo)(() => {
1809
- const modeSeries = chartSeriesByMode[activeProbabilityMode];
1810
- if (!selectedVenue)
1811
- return modeSeries;
1812
- return modeSeries.filter((seriesItem) => seriesItem.venue === selectedVenue);
1813
- }, [activeProbabilityMode, chartSeriesByMode, selectedVenue]);
1814
- const segmentedDisplayItems = (0, import_react3.useMemo)(() => {
1815
- return probabilityModeOrder.map((mode) => {
1816
- const averageProbability = resolveAverageProbability(
1817
- normalizedVenueDataByMode[mode].map((venueData) => venueData.probability)
1818
- );
1819
- const suffix = averageProbability == null ? "" : ` ${formatPercent(averageProbability)}`;
1820
- const switchLabel = probabilityModeConfigs[mode].switchLabel;
1821
- return {
1822
- mode,
1823
- display: `${switchLabel}${suffix}`
1824
- };
1825
- });
1826
- }, [formatPercent, normalizedVenueDataByMode, probabilityModeConfigs]);
1827
- const activeModeVenueData = normalizedVenueDataByMode[activeProbabilityMode];
1828
- (0, import_react3.useEffect)(() => {
1829
- if (!selectedVenue) {
1830
- return;
1831
- }
1832
- if (activeModeVenueData.some((item) => item.venue === selectedVenue)) {
1833
- return;
1834
- }
1835
- setSelectedVenue(null);
1836
- }, [activeModeVenueData, selectedVenue]);
1837
- const handleProbabilityModeChange = (nextMode) => {
1838
- setActiveProbabilityMode(nextMode);
1839
- if (isDateOutcomeMarket) {
1840
- return;
1841
- }
1842
- onSelectedOutcomeLabelChange(probabilityModeConfigs[nextMode].sourceOutcomeLabel);
1843
- };
1844
- const handleVenueToggle = (venue) => {
1845
- setSelectedVenue((currentSelectedVenue) => {
1846
- if (currentSelectedVenue === venue)
1847
- return null;
1848
- return venue;
1849
- });
1850
- };
1851
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1852
- LineChart,
1853
- {
1854
- classNames: { root: classNames == null ? void 0 : classNames.chart },
1855
- series: visibleChartSeries,
1856
- height: 300,
1857
- isLoading: isPriceHistoryLoading,
1858
- showSeriesControls: activeModeVenueData.length > 0 || segmentedDisplayItems.length > 0,
1859
- renderSeriesControls: () => {
1860
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1861
- "div",
1862
- {
1863
- className: cn("flex flex-row items-center justify-between gap-4", classNames == null ? void 0 : classNames.summary),
1864
- children: [
1865
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1866
- "div",
1867
- {
1868
- className: cn(
1869
- "flex min-w-0 gap-2 overflow-x-auto pb-1 md:flex-wrap md:overflow-visible md:pb-0",
1870
- classNames == null ? void 0 : classNames.outcomeBadges
1871
- ),
1872
- children: activeModeVenueData.map((venueData) => {
1873
- var _a;
1874
- const text = venueData.probability == null ? "-" : formatPercent(venueData.probability);
1875
- const isActiveVenue = selectedVenue === venueData.venue;
1876
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1877
- "button",
1878
- {
1879
- type: "button",
1880
- "aria-label": `${venueData.venueLabel} ${text}`,
1881
- "aria-pressed": isActiveVenue,
1882
- className: cn(
1883
- "rounded-agg-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary-hover"
1884
- ),
1885
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1886
- Badge,
1887
- {
1888
- text,
1889
- size: "large",
1890
- prefix: showVenueLogo ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1891
- VenueLogo,
1892
- {
1893
- venue: venueData.venue,
1894
- size: "small",
1895
- title: (_a = venueInfo == null ? void 0 : venueInfo[venueData.venue]) == null ? void 0 : _a.label
1896
- }
1897
- ) : void 0,
1898
- classNames: {
1899
- root: cn("h-9 shrink-0 border-2 px-4 text-agg-base leading-agg-6")
1900
- },
1901
- isActive: isActiveVenue,
1902
- onClick: (e) => {
1903
- e.preventDefault();
1904
- e.stopPropagation();
1905
- handleVenueToggle(venueData.venue);
1906
- }
1907
- }
1908
- )
1909
- },
1910
- `${activeProbabilityMode}-${venueData.market.id}-${venueData.outcome.id}`
1911
- );
1912
- })
1913
- }
1914
- ),
1915
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1916
- SwitchButton,
1917
- {
1918
- ariaLabel: labels.eventItemDetails.outcomeSelectorAria,
1919
- className: cn("w-full md:w-fit", classNames == null ? void 0 : classNames.segmentedControl),
1920
- value: activeProbabilityMode,
1921
- onValueChange: handleProbabilityModeChange,
1922
- options: segmentedDisplayItems.map((segmentedItem) => ({
1923
- value: segmentedItem.mode,
1924
- label: segmentedItem.display,
1925
- ariaLabel: segmentedItem.display
1926
- }))
1927
- }
1928
- )
1929
- ]
1930
- }
1931
- );
1932
- }
1933
- }
1934
- );
1935
- };
1936
- var EventListItemDetailsContent = ({
1937
- event,
1938
- title,
1939
- image,
1940
- showVenueLogo = true,
1941
- classNames,
1942
- venueInfo,
1943
- detailsStats,
1944
- ariaLabel,
1945
- defaultTimeRange
1946
- }) => {
1947
- var _a, _b;
1948
- const config = (0, import_hooks13.useSdkUiConfig)();
1949
- const labels = (0, import_hooks13.useLabels)();
1950
- const venueMarkets = (0, import_react3.useMemo)(() => {
1951
- var _a2, _b2, _c;
1952
- return (_c = (_b2 = (_a2 = event.markets) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.venueMarkets) != null ? _c : [];
1953
- }, [event.markets]);
1954
- const primaryVenueMarket = (0, import_react3.useMemo)(() => {
1955
- return selectPrimaryVenueMarket(venueMarkets);
1956
- }, [venueMarkets]);
1957
- const outcomeLabels = (0, import_react3.useMemo)(() => {
1958
- return resolveOutcomeLabels(venueMarkets);
1959
- }, [venueMarkets]);
1960
- const [selectedOutcomeLabel, setSelectedOutcomeLabel] = (0, import_react3.useState)(() => {
1961
- return resolveDefaultOutcomeLabel(outcomeLabels);
1962
- });
1963
- const [selectedTimeRange, setSelectedTimeRange] = (0, import_react3.useState)(() => {
1964
- return getDefaultSelectedTimeRange(defaultTimeRange);
1965
- });
1966
- (0, import_react3.useEffect)(() => {
1967
- setSelectedTimeRange(getDefaultSelectedTimeRange(defaultTimeRange));
1968
- }, [defaultTimeRange]);
1969
- const resolvedTitle = resolveTileTitle(event, primaryVenueMarket, title);
1970
- const resolvedImage = resolveTileImage(event, primaryVenueMarket, image);
1971
- const isDateOutcomeMarket = outcomeLabels.length > 2 && outcomeLabels.every(isDateLikeLabel);
1972
- const outcomeSelectorLabels = outcomeLabels;
1973
- const probabilityByLabel = (0, import_react3.useMemo)(() => {
1974
- return new Map(
1975
- outcomeLabels.map((label) => {
1976
- const outcomesByVenue = resolveOutcomesByVenue(venueMarkets, label);
1977
- const probabilities = outcomesByVenue.map((item) => normalizeProbability(item.outcome.price)).filter((value) => value != null);
1978
- if (probabilities.length === 0) {
1979
- return [label, void 0];
1980
- }
1981
- const averageProbability = probabilities.reduce((sum, value) => sum + value, 0) / probabilities.length;
1982
- return [label, averageProbability];
1983
- })
1984
- );
1985
- }, [outcomeLabels, venueMarkets]);
1986
- const mainOutcomeLabel = (0, import_react3.useMemo)(() => {
1987
- if (outcomeLabels.length === 0)
1988
- return void 0;
1989
- return [...outcomeLabels].sort((left, right) => {
1990
- var _a2, _b2;
1991
- const leftProbability = (_a2 = probabilityByLabel.get(left)) != null ? _a2 : -1;
1992
- const rightProbability = (_b2 = probabilityByLabel.get(right)) != null ? _b2 : -1;
1993
- return rightProbability - leftProbability;
1994
- })[0];
1995
- }, [outcomeLabels, probabilityByLabel]);
1996
- (0, import_react3.useEffect)(() => {
1997
- if (!outcomeLabels.length) {
1998
- setSelectedOutcomeLabel(void 0);
1999
- return;
2000
- }
2001
- if (selectedOutcomeLabel && outcomeLabels.includes(selectedOutcomeLabel)) {
2002
- return;
2003
- }
2004
- const fallbackOutcomeLabel = isDateOutcomeMarket ? resolveDefaultOutcomeLabel(outcomeLabels) : mainOutcomeLabel != null ? mainOutcomeLabel : resolveDefaultOutcomeLabel(outcomeLabels);
2005
- setSelectedOutcomeLabel(fallbackOutcomeLabel);
2006
- }, [isDateOutcomeMarket, mainOutcomeLabel, outcomeLabels, selectedOutcomeLabel]);
2007
- const switchLabels = (0, import_react3.useMemo)(() => {
2008
- var _a2, _b2;
2009
- if (isDateOutcomeMarket) {
2010
- return [labels.eventItemDetails.yes, labels.eventItemDetails.no];
2011
- }
2012
- const sortedOutcomeLabels = [...outcomeLabels].sort((left, right) => {
2013
- var _a3, _b3;
2014
- const leftProbability = (_a3 = probabilityByLabel.get(left)) != null ? _a3 : -1;
2015
- const rightProbability = (_b3 = probabilityByLabel.get(right)) != null ? _b3 : -1;
2016
- return rightProbability - leftProbability;
2017
- });
2018
- const firstLabel = (_a2 = sortedOutcomeLabels[0]) != null ? _a2 : labels.eventItemDetails.yes;
2019
- const secondLabel = (_b2 = sortedOutcomeLabels.find((label) => label !== firstLabel)) != null ? _b2 : firstLabel;
2020
- return [firstLabel, secondLabel];
2021
- }, [
2022
- isDateOutcomeMarket,
2023
- labels.eventItemDetails.no,
2024
- labels.eventItemDetails.yes,
2025
- outcomeLabels,
2026
- probabilityByLabel
2027
- ]);
2028
- const volumeLabel = (0, import_react3.useMemo)(() => {
2029
- var _a2;
2030
- const resolvedVolume = typeof event.volume === "number" ? event.volume : (_a2 = primaryVenueMarket == null ? void 0 : primaryVenueMarket.volume) != null ? _a2 : void 0;
2031
- if (typeof resolvedVolume !== "number")
2032
- return "";
2033
- return `${config.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
2034
- }, [config, event.volume, labels.eventItemDetails.volumeSuffix, primaryVenueMarket == null ? void 0 : primaryVenueMarket.volume]);
2035
- if (!primaryVenueMarket || !selectedOutcomeLabel) {
2036
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EventListItemDetailsUnavailableState, { classNames, ariaLabel });
2037
- }
2038
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2039
- Card,
2040
- {
2041
- className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
2042
- "aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
2043
- children: [
2044
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2045
- "div",
2046
- {
2047
- className: cn(
2048
- "flex flex-row gap-3 md:gap-4",
2049
- "items-center justify-start",
2050
- classNames == null ? void 0 : classNames.header
2051
- ),
2052
- children: [
2053
- resolvedImage ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2054
- "img",
2055
- {
2056
- src: resolvedImage,
2057
- alt: "",
2058
- className: "size-10 rounded-agg-lg object-cover md:size-[60px]"
2059
- }
2060
- ) : null,
2061
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-3", children: [
2062
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2063
- Typography,
2064
- {
2065
- variant: "body-strong",
2066
- className: cn(
2067
- "min-w-0 text-agg-base font-agg-bold! leading-agg-6 md:text-agg-2xl md:leading-agg-8",
2068
- "truncate text-wrap wrap-break-word line-clamp-2",
2069
- classNames == null ? void 0 : classNames.title
2070
- ),
2071
- children: resolvedTitle
2072
- }
2073
- ),
2074
- outcomeSelectorLabels.length > 2 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2075
- "div",
2076
- {
2077
- className: cn(
2078
- "flex items-center gap-2 overflow-x-auto pb-1 md:flex-wrap md:overflow-visible md:pb-0",
2079
- classNames == null ? void 0 : classNames.headerPills
2080
- ),
2081
- children: outcomeSelectorLabels.map((outcomeSelectorLabel) => {
2082
- const isActive = outcomeSelectorLabel === selectedOutcomeLabel;
2083
- const displayLabel = isDateLikeLabel(outcomeSelectorLabel) ? formatDateLabel(outcomeSelectorLabel) : outcomeSelectorLabel;
2084
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2085
- Button,
2086
- {
2087
- size: "small",
2088
- variant: "secondary",
2089
- "aria-pressed": isActive,
2090
- className: cn(
2091
- "h-auto shrink-0 rounded-agg-full px-4 py-1.5 text-agg-sm leading-agg-5",
2092
- "border-2",
2093
- isActive ? "border-agg-primary bg-agg-secondary text-agg-foreground font-agg-bold" : "border-transparent bg-agg-secondary-hover text-agg-foreground font-agg-normal"
2094
- ),
2095
- onClick: () => setSelectedOutcomeLabel(outcomeSelectorLabel),
2096
- children: displayLabel
2097
- },
2098
- outcomeSelectorLabel
2099
- );
2100
- })
2101
- }
2102
- ) : null
2103
- ] })
2104
- ]
2105
- }
2106
- ),
2107
- detailsStats && detailsStats.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex flex-wrap items-start gap-4 md:gap-6", classNames == null ? void 0 : classNames.headerStats), children: detailsStats.map((statItem) => {
2108
- const deltaClassName = statItem.deltaTone === "positive" ? "text-agg-success!" : statItem.deltaTone === "negative" ? "text-agg-error!" : "text-agg-muted-foreground";
2109
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-1", children: [
2110
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "caption-caps", className: "text-agg-muted-foreground", children: statItem.label }),
2111
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-baseline gap-1", children: [
2112
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2113
- Typography,
2114
- {
2115
- variant: "body",
2116
- className: "text-agg-lg leading-agg-7 text-agg-foreground",
2117
- children: statItem.value
2118
- }
2119
- ),
2120
- statItem.delta ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "label", className: cn(deltaClassName), children: statItem.delta }) : null
2121
- ] })
2122
- ] }, `${statItem.label}-${statItem.value}`);
2123
- }) }) : null,
2124
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2125
- EventListItemDetailsGraphSection,
2126
- {
2127
- venueMarkets,
2128
- canonicalMarketId: (_b = (_a = event.markets) == null ? void 0 : _a[0]) == null ? void 0 : _b.id,
2129
- selectedOutcomeLabel,
2130
- onSelectedOutcomeLabelChange: setSelectedOutcomeLabel,
2131
- switchLabels,
2132
- isDateOutcomeMarket,
2133
- classNames,
2134
- showVenueLogo,
2135
- venueInfo,
2136
- formatPercent: config.formatPercent,
2137
- selectedTimeRange
2138
- }
2139
- ),
2140
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-4", classNames == null ? void 0 : classNames.footer), children: [
2141
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: volumeLabel || "-" }),
2142
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex items-center gap-2 md:gap-3", classNames == null ? void 0 : classNames.timeRange), children: eventListItemDetailsTimeRanges.map((timeRange) => {
2143
- const isActive = timeRange === selectedTimeRange;
2144
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2145
- Button,
2146
- {
2147
- size: "small",
2148
- variant: "tertiary",
2149
- className: cn(
2150
- "h-auto min-w-0 rounded-none px-0 py-0 text-agg-xs leading-agg-4 md:text-agg-sm md:leading-agg-5",
2151
- "border-0 bg-transparent shadow-none",
2152
- "hover:text-agg-foreground!",
2153
- isActive ? "font-agg-bold! text-agg-foreground!" : "font-agg-normal! text-agg-muted-foreground!"
2154
- ),
2155
- "aria-pressed": isActive,
2156
- onClick: () => setSelectedTimeRange(timeRange),
2157
- children: timeRange === "ALL" ? labels.eventItemDetails.allTimeRange : timeRange
2158
- },
2159
- timeRange
2160
- );
2161
- }) })
2162
- ] })
2163
- ]
2164
- }
2165
- );
2166
- };
2167
- var EventListItemDetailsByEventId = (_a) => {
2168
- var _b = _a, {
2169
- eventId
2170
- } = _b, rest = __objRest(_b, [
2171
- "eventId"
2172
- ]);
2173
- const {
2174
- event: fetchedEvent,
2175
- isError,
2176
- isLoading
2177
- } = (0, import_hooks13.useEvent)(eventId, {
2178
- enabled: !!eventId
2179
- });
2180
- const resolvedEvent = (0, import_react3.useMemo)(() => {
2181
- return resolveEventListItemEvent(fetchedEvent);
2182
- }, [fetchedEvent]);
2183
- if (!eventId) {
2184
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2185
- EventListItemDetailsUnavailableState,
2186
- {
2187
- classNames: rest.classNames,
2188
- ariaLabel: rest.ariaLabel
2189
- }
2190
- );
2191
- }
2192
- if (isLoading) {
2193
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EventListItemDetailsLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
2194
- }
2195
- if (!resolvedEvent && !isError) {
2196
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EventListItemDetailsLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
2197
- }
2198
- if (!resolvedEvent) {
2199
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2200
- EventListItemDetailsUnavailableState,
2201
- {
2202
- classNames: rest.classNames,
2203
- ariaLabel: rest.ariaLabel
2204
- }
2205
- );
2206
- }
2207
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EventListItemDetailsContent, __spreadValues({ event: resolvedEvent }, rest));
2208
- };
2209
- var EventListItemDetails = (props) => {
2210
- if (props.isLoading) {
2211
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EventListItemDetailsLoadingState, { classNames: props.classNames, ariaLabel: props.ariaLabel });
2212
- }
2213
- if ("event" in props && props.event) {
2214
- const _a = props, { event } = _a, rest = __objRest(_a, ["event"]);
2215
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EventListItemDetailsContent, __spreadValues({ event }, rest));
2216
- }
2217
- if ("eventId" in props && typeof props.eventId === "string") {
2218
- const {
2219
- title: titleOverride,
2220
- image: imageOverride,
2221
- showVenueLogo: showVenueLogoOverride,
2222
- classNames,
2223
- venueInfo,
2224
- detailsStats,
2225
- ariaLabel: ariaLabelOverride,
2226
- defaultTimeRange: defaultTimeRangeOverride
2227
- } = props;
2228
- const byEventIdProps = {
2229
- eventId: props.eventId,
2230
- isLoading: false,
2231
- title: titleOverride,
2232
- image: imageOverride,
2233
- showVenueLogo: showVenueLogoOverride,
2234
- classNames,
2235
- venueInfo,
2236
- detailsStats,
2237
- ariaLabel: ariaLabelOverride,
2238
- defaultTimeRange: defaultTimeRangeOverride
2239
- };
2240
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EventListItemDetailsByEventId, __spreadValues({}, byEventIdProps));
2241
- }
2242
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2243
- EventListItemDetailsUnavailableState,
2244
- {
2245
- classNames: props.classNames,
2246
- ariaLabel: props.ariaLabel
2247
- }
2248
- );
2249
- };
2250
- EventListItemDetails.displayName = "EventListItemDetails";
2251
- // Annotate the CommonJS export names for ESM import in node:
2252
- 0 && (module.exports = {
2253
- EventListItemDetails
2254
- });