@medialane/ui 0.373.4 → 0.374.1

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 (285) hide show
  1. package/dist/components/accounts-page.cjs +1 -1
  2. package/dist/components/accounts-page.cjs.map +1 -1
  3. package/dist/components/accounts-page.js +1 -1
  4. package/dist/components/accounts-page.js.map +1 -1
  5. package/dist/components/activity-row.cjs +8 -7
  6. package/dist/components/activity-row.cjs.map +1 -1
  7. package/dist/components/activity-row.js +8 -7
  8. package/dist/components/activity-row.js.map +1 -1
  9. package/dist/components/asset-access-cards.cjs +3 -1
  10. package/dist/components/asset-access-cards.cjs.map +1 -1
  11. package/dist/components/asset-access-cards.js +3 -1
  12. package/dist/components/asset-access-cards.js.map +1 -1
  13. package/dist/components/asset-type-panels.cjs +1 -1
  14. package/dist/components/asset-type-panels.cjs.map +1 -1
  15. package/dist/components/asset-type-panels.js +1 -1
  16. package/dist/components/asset-type-panels.js.map +1 -1
  17. package/dist/components/claim-route-shell.cjs +4 -2
  18. package/dist/components/claim-route-shell.cjs.map +1 -1
  19. package/dist/components/claim-route-shell.d.cts +1 -1
  20. package/dist/components/claim-route-shell.d.ts +1 -1
  21. package/dist/components/claim-route-shell.js +4 -2
  22. package/dist/components/claim-route-shell.js.map +1 -1
  23. package/dist/components/coin-guarantees.cjs +2 -2
  24. package/dist/components/coin-guarantees.cjs.map +1 -1
  25. package/dist/components/coin-guarantees.js +2 -2
  26. package/dist/components/coin-guarantees.js.map +1 -1
  27. package/dist/components/coins-explorer.cjs +1 -1
  28. package/dist/components/coins-explorer.cjs.map +1 -1
  29. package/dist/components/coins-explorer.js +1 -1
  30. package/dist/components/coins-explorer.js.map +1 -1
  31. package/dist/components/collection-filters.cjs +1 -1
  32. package/dist/components/collection-filters.cjs.map +1 -1
  33. package/dist/components/collection-filters.js +1 -1
  34. package/dist/components/collection-filters.js.map +1 -1
  35. package/dist/components/collection-provenance-tab.cjs +4 -3
  36. package/dist/components/collection-provenance-tab.cjs.map +1 -1
  37. package/dist/components/collection-provenance-tab.js +4 -3
  38. package/dist/components/collection-provenance-tab.js.map +1 -1
  39. package/dist/components/collection-settings.cjs +3 -3
  40. package/dist/components/collection-settings.cjs.map +1 -1
  41. package/dist/components/collection-settings.js +3 -3
  42. package/dist/components/collection-settings.js.map +1 -1
  43. package/dist/components/collection-showcase.cjs +1 -1
  44. package/dist/components/collection-showcase.cjs.map +1 -1
  45. package/dist/components/collection-showcase.js +1 -1
  46. package/dist/components/collection-showcase.js.map +1 -1
  47. package/dist/components/collections-page.cjs +2 -2
  48. package/dist/components/collections-page.cjs.map +1 -1
  49. package/dist/components/collections-page.js +2 -2
  50. package/dist/components/collections-page.js.map +1 -1
  51. package/dist/components/create-form-primitives.cjs +20 -1
  52. package/dist/components/create-form-primitives.cjs.map +1 -1
  53. package/dist/components/create-form-primitives.js +20 -1
  54. package/dist/components/create-form-primitives.js.map +1 -1
  55. package/dist/components/create-sponsorship-aside.cjs +6 -6
  56. package/dist/components/create-sponsorship-aside.cjs.map +1 -1
  57. package/dist/components/create-sponsorship-aside.js +6 -6
  58. package/dist/components/create-sponsorship-aside.js.map +1 -1
  59. package/dist/components/creator-header.cjs +5 -2
  60. package/dist/components/creator-header.cjs.map +1 -1
  61. package/dist/components/creator-header.js +5 -2
  62. package/dist/components/creator-header.js.map +1 -1
  63. package/dist/components/discover-collections-strip.cjs +6 -3
  64. package/dist/components/discover-collections-strip.cjs.map +1 -1
  65. package/dist/components/discover-collections-strip.js +6 -3
  66. package/dist/components/discover-collections-strip.js.map +1 -1
  67. package/dist/components/discover-community-section.cjs +5 -3
  68. package/dist/components/discover-community-section.cjs.map +1 -1
  69. package/dist/components/discover-community-section.js +5 -3
  70. package/dist/components/discover-community-section.js.map +1 -1
  71. package/dist/components/discover-features.cjs +2 -2
  72. package/dist/components/discover-features.cjs.map +1 -1
  73. package/dist/components/discover-features.js +2 -2
  74. package/dist/components/discover-features.js.map +1 -1
  75. package/dist/components/discover-feed-section.cjs +3 -2
  76. package/dist/components/discover-feed-section.cjs.map +1 -1
  77. package/dist/components/discover-feed-section.js +3 -2
  78. package/dist/components/discover-feed-section.js.map +1 -1
  79. package/dist/components/drop/create/artwork-section.d.cts +2 -0
  80. package/dist/components/drop/create/artwork-section.d.ts +2 -0
  81. package/dist/components/drop/create/details-section.d.cts +2 -0
  82. package/dist/components/drop/create/details-section.d.ts +2 -0
  83. package/dist/components/drop/create/drop-create.cjs +1 -1
  84. package/dist/components/drop/create/drop-create.cjs.map +1 -1
  85. package/dist/components/drop/create/drop-create.d.cts +2 -0
  86. package/dist/components/drop/create/drop-create.d.ts +2 -0
  87. package/dist/components/drop/create/drop-create.js +2 -2
  88. package/dist/components/drop/create/drop-create.js.map +1 -1
  89. package/dist/components/drop/create/launch-dialog.cjs +1 -1
  90. package/dist/components/drop/create/launch-dialog.cjs.map +1 -1
  91. package/dist/components/drop/create/launch-dialog.d.cts +2 -0
  92. package/dist/components/drop/create/launch-dialog.d.ts +2 -0
  93. package/dist/components/drop/create/launch-dialog.js +2 -2
  94. package/dist/components/drop/create/launch-dialog.js.map +1 -1
  95. package/dist/components/drop/create/list-section.d.cts +2 -0
  96. package/dist/components/drop/create/list-section.d.ts +2 -0
  97. package/dist/components/drop/create/sale-section.d.cts +2 -0
  98. package/dist/components/drop/create/sale-section.d.ts +2 -0
  99. package/dist/components/drop/drop-features.cjs +8 -6
  100. package/dist/components/drop/drop-features.cjs.map +1 -1
  101. package/dist/components/drop/drop-features.js +8 -6
  102. package/dist/components/drop/drop-features.js.map +1 -1
  103. package/dist/components/drop/drop-listing.cjs +3 -3
  104. package/dist/components/drop/drop-listing.cjs.map +1 -1
  105. package/dist/components/drop/drop-listing.js +3 -3
  106. package/dist/components/drop/drop-listing.js.map +1 -1
  107. package/dist/components/drop/my-drops.cjs +1 -1
  108. package/dist/components/drop/my-drops.cjs.map +1 -1
  109. package/dist/components/drop/my-drops.js +1 -1
  110. package/dist/components/drop/my-drops.js.map +1 -1
  111. package/dist/components/drop/page/drop-manage.cjs +3 -3
  112. package/dist/components/drop/page/drop-manage.cjs.map +1 -1
  113. package/dist/components/drop/page/drop-manage.js +3 -3
  114. package/dist/components/drop/page/drop-manage.js.map +1 -1
  115. package/dist/components/drop-item-list.cjs +2 -2
  116. package/dist/components/drop-item-list.cjs.map +1 -1
  117. package/dist/components/drop-item-list.js +2 -2
  118. package/dist/components/drop-item-list.js.map +1 -1
  119. package/dist/components/empty-or-error.cjs +2 -2
  120. package/dist/components/empty-or-error.cjs.map +1 -1
  121. package/dist/components/empty-or-error.js +2 -2
  122. package/dist/components/empty-or-error.js.map +1 -1
  123. package/dist/components/fast-mint/dropzone.cjs +2 -2
  124. package/dist/components/fast-mint/dropzone.cjs.map +1 -1
  125. package/dist/components/fast-mint/dropzone.js +2 -2
  126. package/dist/components/fast-mint/dropzone.js.map +1 -1
  127. package/dist/components/fast-mint/formats/nft.cjs +3 -3
  128. package/dist/components/fast-mint/formats/nft.cjs.map +1 -1
  129. package/dist/components/fast-mint/formats/nft.js +3 -3
  130. package/dist/components/fast-mint/formats/nft.js.map +1 -1
  131. package/dist/components/fast-mint/formats/pop.cjs +3 -3
  132. package/dist/components/fast-mint/formats/pop.cjs.map +1 -1
  133. package/dist/components/fast-mint/formats/pop.js +3 -3
  134. package/dist/components/fast-mint/formats/pop.js.map +1 -1
  135. package/dist/components/fast-mint/formats/tiers.cjs +5 -5
  136. package/dist/components/fast-mint/formats/tiers.cjs.map +1 -1
  137. package/dist/components/fast-mint/formats/tiers.js +5 -5
  138. package/dist/components/fast-mint/formats/tiers.js.map +1 -1
  139. package/dist/components/fast-mint/licensing-section.cjs +6 -27
  140. package/dist/components/fast-mint/licensing-section.cjs.map +1 -1
  141. package/dist/components/fast-mint/licensing-section.d.cts +1 -6
  142. package/dist/components/fast-mint/licensing-section.d.ts +1 -6
  143. package/dist/components/fast-mint/licensing-section.js +2 -22
  144. package/dist/components/fast-mint/licensing-section.js.map +1 -1
  145. package/dist/components/featured-carousel.cjs +3 -2
  146. package/dist/components/featured-carousel.cjs.map +1 -1
  147. package/dist/components/featured-carousel.js +3 -2
  148. package/dist/components/featured-carousel.js.map +1 -1
  149. package/dist/components/gated-content.cjs +1 -1
  150. package/dist/components/gated-content.cjs.map +1 -1
  151. package/dist/components/gated-content.js +1 -1
  152. package/dist/components/gated-content.js.map +1 -1
  153. package/dist/components/ip-type-badge.cjs +4 -2
  154. package/dist/components/ip-type-badge.cjs.map +1 -1
  155. package/dist/components/ip-type-badge.js +4 -2
  156. package/dist/components/ip-type-badge.js.map +1 -1
  157. package/dist/components/ip-type-nav.cjs +3 -2
  158. package/dist/components/ip-type-nav.cjs.map +1 -1
  159. package/dist/components/ip-type-nav.js +3 -2
  160. package/dist/components/ip-type-nav.js.map +1 -1
  161. package/dist/components/ip-type-page.cjs +2 -2
  162. package/dist/components/ip-type-page.cjs.map +1 -1
  163. package/dist/components/ip-type-page.js +2 -2
  164. package/dist/components/ip-type-page.js.map +1 -1
  165. package/dist/components/journey-content.cjs +1 -1
  166. package/dist/components/journey-content.cjs.map +1 -1
  167. package/dist/components/journey-content.js +1 -1
  168. package/dist/components/journey-content.js.map +1 -1
  169. package/dist/components/launchpad/coin-create.cjs +1 -1
  170. package/dist/components/launchpad/coin-create.cjs.map +1 -1
  171. package/dist/components/launchpad/coin-create.js +1 -1
  172. package/dist/components/launchpad/coin-create.js.map +1 -1
  173. package/dist/components/launchpad/collection-create-form.cjs +1 -1
  174. package/dist/components/launchpad/collection-create-form.cjs.map +1 -1
  175. package/dist/components/launchpad/collection-create-form.js +1 -1
  176. package/dist/components/launchpad/collection-create-form.js.map +1 -1
  177. package/dist/components/launchpad/collection-create-presets.cjs +1 -1
  178. package/dist/components/launchpad/collection-create-presets.cjs.map +1 -1
  179. package/dist/components/launchpad/collection-create-presets.js +1 -1
  180. package/dist/components/launchpad/collection-create-presets.js.map +1 -1
  181. package/dist/components/launchpad/edition-mint.cjs +1 -1
  182. package/dist/components/launchpad/edition-mint.cjs.map +1 -1
  183. package/dist/components/launchpad/edition-mint.js +1 -1
  184. package/dist/components/launchpad/edition-mint.js.map +1 -1
  185. package/dist/components/launchpad/pop-create-fields.cjs +1 -1
  186. package/dist/components/launchpad/pop-create-fields.cjs.map +1 -1
  187. package/dist/components/launchpad/pop-create-fields.js +1 -1
  188. package/dist/components/launchpad/pop-create-fields.js.map +1 -1
  189. package/dist/components/launchpad/pop-create.cjs +1 -1
  190. package/dist/components/launchpad/pop-create.cjs.map +1 -1
  191. package/dist/components/launchpad/pop-create.js +1 -1
  192. package/dist/components/launchpad/pop-create.js.map +1 -1
  193. package/dist/components/launchpad-strip.cjs +3 -2
  194. package/dist/components/launchpad-strip.cjs.map +1 -1
  195. package/dist/components/launchpad-strip.js +3 -2
  196. package/dist/components/launchpad-strip.js.map +1 -1
  197. package/dist/components/marketplace-filters.cjs +2 -1
  198. package/dist/components/marketplace-filters.cjs.map +1 -1
  199. package/dist/components/marketplace-filters.js +2 -1
  200. package/dist/components/marketplace-filters.js.map +1 -1
  201. package/dist/components/new-collection-menu.cjs +5 -4
  202. package/dist/components/new-collection-menu.cjs.map +1 -1
  203. package/dist/components/new-collection-menu.js +5 -4
  204. package/dist/components/new-collection-menu.js.map +1 -1
  205. package/dist/components/order-sort-control.cjs +7 -4
  206. package/dist/components/order-sort-control.cjs.map +1 -1
  207. package/dist/components/order-sort-control.js +7 -4
  208. package/dist/components/order-sort-control.js.map +1 -1
  209. package/dist/components/portfolio-orders.cjs +16 -16
  210. package/dist/components/portfolio-orders.cjs.map +1 -1
  211. package/dist/components/portfolio-orders.js +16 -16
  212. package/dist/components/portfolio-orders.js.map +1 -1
  213. package/dist/components/price-history-chart.cjs +1 -1
  214. package/dist/components/price-history-chart.cjs.map +1 -1
  215. package/dist/components/price-history-chart.js +1 -1
  216. package/dist/components/price-history-chart.js.map +1 -1
  217. package/dist/components/report-dialog.cjs +1 -1
  218. package/dist/components/report-dialog.cjs.map +1 -1
  219. package/dist/components/report-dialog.js +1 -1
  220. package/dist/components/report-dialog.js.map +1 -1
  221. package/dist/components/rewards/level-badge.cjs +3 -1
  222. package/dist/components/rewards/level-badge.cjs.map +1 -1
  223. package/dist/components/rewards/level-badge.js +3 -1
  224. package/dist/components/rewards/level-badge.js.map +1 -1
  225. package/dist/components/rewards/rewards-dashboard.cjs +24 -24
  226. package/dist/components/rewards/rewards-dashboard.cjs.map +1 -1
  227. package/dist/components/rewards/rewards-dashboard.js +24 -24
  228. package/dist/components/rewards/rewards-dashboard.js.map +1 -1
  229. package/dist/components/rewards-section.cjs +5 -5
  230. package/dist/components/rewards-section.cjs.map +1 -1
  231. package/dist/components/rewards-section.js +5 -5
  232. package/dist/components/rewards-section.js.map +1 -1
  233. package/dist/components/section-heading.cjs +5 -2
  234. package/dist/components/section-heading.cjs.map +1 -1
  235. package/dist/components/section-heading.js +5 -2
  236. package/dist/components/section-heading.js.map +1 -1
  237. package/dist/components/sponsorship-offers-page.cjs +5 -4
  238. package/dist/components/sponsorship-offers-page.cjs.map +1 -1
  239. package/dist/components/sponsorship-offers-page.js +5 -4
  240. package/dist/components/sponsorship-offers-page.js.map +1 -1
  241. package/dist/components/transaction-dialog.cjs +1 -1
  242. package/dist/components/transaction-dialog.cjs.map +1 -1
  243. package/dist/components/transaction-dialog.js +1 -1
  244. package/dist/components/transaction-dialog.js.map +1 -1
  245. package/dist/components/transfer-collection-ownership.cjs +1 -1
  246. package/dist/components/transfer-collection-ownership.cjs.map +1 -1
  247. package/dist/components/transfer-collection-ownership.js +1 -1
  248. package/dist/components/transfer-collection-ownership.js.map +1 -1
  249. package/dist/components/wallet/self-fund-consent-dialog.cjs +1 -1
  250. package/dist/components/wallet/self-fund-consent-dialog.cjs.map +1 -1
  251. package/dist/components/wallet/self-fund-consent-dialog.js +1 -1
  252. package/dist/components/wallet/self-fund-consent-dialog.js.map +1 -1
  253. package/dist/data/launchpad-services.cjs +1 -1
  254. package/dist/data/launchpad-services.cjs.map +1 -1
  255. package/dist/data/launchpad-services.js +1 -1
  256. package/dist/data/launchpad-services.js.map +1 -1
  257. package/dist/i18n/catalog/pt.cjs +1715 -0
  258. package/dist/i18n/catalog/pt.cjs.map +1 -0
  259. package/dist/i18n/catalog/pt.d.cts +5 -0
  260. package/dist/i18n/catalog/pt.d.ts +5 -0
  261. package/dist/i18n/catalog/pt.js +1695 -0
  262. package/dist/i18n/catalog/pt.js.map +1 -0
  263. package/dist/i18n/catalogs.cjs +13 -1
  264. package/dist/i18n/catalogs.cjs.map +1 -1
  265. package/dist/i18n/catalogs.js +3 -1
  266. package/dist/i18n/catalogs.js.map +1 -1
  267. package/dist/i18n/locales.cjs +4 -1
  268. package/dist/i18n/locales.cjs.map +1 -1
  269. package/dist/i18n/locales.js +4 -1
  270. package/dist/i18n/locales.js.map +1 -1
  271. package/dist/i18n/tools/scan.cjs +80 -0
  272. package/dist/i18n/tools/scan.cjs.map +1 -0
  273. package/dist/i18n/tools/scan.d.cts +8 -0
  274. package/dist/i18n/tools/scan.d.ts +8 -0
  275. package/dist/i18n/tools/scan.js +45 -0
  276. package/dist/i18n/tools/scan.js.map +1 -0
  277. package/dist/index.d.cts +2 -2
  278. package/dist/index.d.ts +2 -2
  279. package/dist/utils/drop/draft.cjs +5 -0
  280. package/dist/utils/drop/draft.cjs.map +1 -1
  281. package/dist/utils/drop/draft.d.cts +4 -1
  282. package/dist/utils/drop/draft.d.ts +4 -1
  283. package/dist/utils/drop/draft.js +4 -0
  284. package/dist/utils/drop/draft.js.map +1 -1
  285. package/package.json +6 -1
@@ -8,17 +8,17 @@ const pillars = [
8
8
  {
9
9
  icon: Zap,
10
10
  label: "XP",
11
- detail: "Earned for every mint, trade, and connection you make."
11
+ detail: msg("Earned for every mint, trade, and connection you make.")
12
12
  },
13
13
  {
14
14
  icon: Coins,
15
15
  label: msg("Creator's Fund"),
16
- detail: "Your XP grows your share of the shared pool."
16
+ detail: msg("Your XP grows your share of the shared pool.")
17
17
  },
18
18
  {
19
19
  icon: Gift,
20
20
  label: msg("Airdrop"),
21
- detail: "Claim your share on-chain, every round."
21
+ detail: msg("Claim your share on-chain, every round.")
22
22
  }
23
23
  ];
24
24
  function RewardsSection({ rewardsHref }) {
@@ -42,8 +42,8 @@ function RewardsSection({ rewardsHref }) {
42
42
  /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 lg:w-[300px] shrink-0 lg:border-l lg:border-border lg:pl-10", children: pillars.map(({ icon: Icon, label, detail }) => /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3.5", children: [
43
43
  /* @__PURE__ */ jsx("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-gradient-to-br from-brand-orange/15 to-brand-maeve/15 text-brand-maeve shrink-0", children: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" }) }),
44
44
  /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
45
- /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-foreground", children: label }),
46
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground leading-relaxed", children: detail })
45
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-foreground", children: t(label) }),
46
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground leading-relaxed", children: t(detail) })
47
47
  ] })
48
48
  ] }, label)) })
49
49
  ] }) }) });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/rewards-section.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ArrowRight, Zap, Coins, Gift } from \"lucide-react\";\nimport { useT } from \"../i18n/provider.js\";\nimport { msg } from \"../i18n/translate.js\";\n\nexport interface RewardsSectionProps {\n rewardsHref: string;\n}\n\nconst pillars = [\n {\n icon: Zap,\n label: \"XP\",\n detail: \"Earned for every mint, trade, and connection you make.\",\n },\n {\n icon: Coins,\n label: msg(\"Creator's Fund\"),\n detail: \"Your XP grows your share of the shared pool.\",\n },\n {\n icon: Gift,\n label: msg(\"Airdrop\"),\n detail: \"Claim your share on-chain, every round.\",\n },\n];\n\nexport function RewardsSection({ rewardsHref }: RewardsSectionProps) {\n const t = useT();\n return (\n <div className=\"rounded-2xl p-[1.5px] bg-gradient-to-r from-brand-orange to-brand-maeve\">\n <section className=\"rounded-[15px] bg-background px-7 py-8 sm:px-9\">\n <div className=\"flex flex-col lg:flex-row lg:items-center gap-8 lg:gap-14\">\n <div className=\"flex-1 min-w-0\">\n <h2 className=\"text-2xl sm:text-3xl font-bold tracking-tight leading-tight text-foreground\">\n {t(\"Rewards\")}\n </h2>\n <p className=\"mt-2 text-sm text-muted-foreground leading-relaxed max-w-md\">\n {t(\"Every action earns XP. Active members receive a growing share of the Creator's Fund, claimed as an airdrop each round.\")}\n </p>\n\n <Link\n href={rewardsHref}\n className=\"mt-6 inline-flex items-center justify-center gap-2 rounded-xl bg-gradient-to-r from-brand-orange to-brand-maeve px-6 py-3 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98]\"\n >\n {t(\"View your rewards\")}\n <ArrowRight className=\"h-4 w-4\" />\n </Link>\n </div>\n\n <div className=\"flex flex-col gap-4 lg:w-[300px] shrink-0 lg:border-l lg:border-border lg:pl-10\">\n {pillars.map(({ icon: Icon, label, detail }) => (\n <div key={label} className=\"flex items-start gap-3.5\">\n <div className=\"flex h-9 w-9 items-center justify-center rounded-lg bg-gradient-to-br from-brand-orange/15 to-brand-maeve/15 text-brand-maeve shrink-0\">\n <Icon className=\"h-4 w-4\" />\n </div>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold text-foreground\">{label}</p>\n <p className=\"text-xs text-muted-foreground leading-relaxed\">{detail}</p>\n </div>\n </div>\n ))}\n </div>\n </div>\n </section>\n </div>\n );\n}\n"],"mappings":";AAoCY,cAOA,YAPA;AAlCZ,OAAO,UAAU;AACjB,SAAS,YAAY,KAAK,OAAO,YAAY;AAC7C,SAAS,YAAY;AACrB,SAAS,WAAW;AAMpB,MAAM,UAAU;AAAA,EACd;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,OAAO,IAAI,gBAAgB;AAAA,IAC3B,QAAQ;AAAA,EACV;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,OAAO,IAAI,SAAS;AAAA,IACpB,QAAQ;AAAA,EACV;AACF;AAEO,SAAS,eAAe,EAAE,YAAY,GAAwB;AACnE,QAAM,IAAI,KAAK;AACf,SACE,oBAAC,SAAI,WAAU,2EACb,8BAAC,aAAQ,WAAU,kDACjB,+BAAC,SAAI,WAAU,6DACb;AAAA,yBAAC,SAAI,WAAU,kBACb;AAAA,0BAAC,QAAG,WAAU,+EACX,YAAE,SAAS,GACd;AAAA,MACA,oBAAC,OAAE,WAAU,+DACV,YAAE,wHAAwH,GAC7H;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,WAAU;AAAA,UAET;AAAA,cAAE,mBAAmB;AAAA,YACtB,oBAAC,cAAW,WAAU,WAAU;AAAA;AAAA;AAAA,MAClC;AAAA,OACF;AAAA,IAEA,oBAAC,SAAI,WAAU,mFACZ,kBAAQ,IAAI,CAAC,EAAE,MAAM,MAAM,OAAO,OAAO,MACxC,qBAAC,SAAgB,WAAU,4BACzB;AAAA,0BAAC,SAAI,WAAU,0IACb,8BAAC,QAAK,WAAU,WAAU,GAC5B;AAAA,MACA,qBAAC,SAAI,WAAU,WACb;AAAA,4BAAC,OAAE,WAAU,yCAAyC,iBAAM;AAAA,QAC5D,oBAAC,OAAE,WAAU,iDAAiD,kBAAO;AAAA,SACvE;AAAA,SAPQ,KAQV,CACD,GACH;AAAA,KACF,GACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/rewards-section.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ArrowRight, Zap, Coins, Gift } from \"lucide-react\";\nimport { useT } from \"../i18n/provider.js\";\nimport { msg } from \"../i18n/translate.js\";\n\nexport interface RewardsSectionProps {\n rewardsHref: string;\n}\n\nconst pillars = [\n {\n icon: Zap,\n label: \"XP\",\n detail: msg(\"Earned for every mint, trade, and connection you make.\"),\n },\n {\n icon: Coins,\n label: msg(\"Creator's Fund\"),\n detail: msg(\"Your XP grows your share of the shared pool.\"),\n },\n {\n icon: Gift,\n label: msg(\"Airdrop\"),\n detail: msg(\"Claim your share on-chain, every round.\"),\n },\n];\n\nexport function RewardsSection({ rewardsHref }: RewardsSectionProps) {\n const t = useT();\n return (\n <div className=\"rounded-2xl p-[1.5px] bg-gradient-to-r from-brand-orange to-brand-maeve\">\n <section className=\"rounded-[15px] bg-background px-7 py-8 sm:px-9\">\n <div className=\"flex flex-col lg:flex-row lg:items-center gap-8 lg:gap-14\">\n <div className=\"flex-1 min-w-0\">\n <h2 className=\"text-2xl sm:text-3xl font-bold tracking-tight leading-tight text-foreground\">\n {t(\"Rewards\")}\n </h2>\n <p className=\"mt-2 text-sm text-muted-foreground leading-relaxed max-w-md\">\n {t(\"Every action earns XP. Active members receive a growing share of the Creator's Fund, claimed as an airdrop each round.\")}\n </p>\n\n <Link\n href={rewardsHref}\n className=\"mt-6 inline-flex items-center justify-center gap-2 rounded-xl bg-gradient-to-r from-brand-orange to-brand-maeve px-6 py-3 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98]\"\n >\n {t(\"View your rewards\")}\n <ArrowRight className=\"h-4 w-4\" />\n </Link>\n </div>\n\n <div className=\"flex flex-col gap-4 lg:w-[300px] shrink-0 lg:border-l lg:border-border lg:pl-10\">\n {pillars.map(({ icon: Icon, label, detail }) => (\n <div key={label} className=\"flex items-start gap-3.5\">\n <div className=\"flex h-9 w-9 items-center justify-center rounded-lg bg-gradient-to-br from-brand-orange/15 to-brand-maeve/15 text-brand-maeve shrink-0\">\n <Icon className=\"h-4 w-4\" />\n </div>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold text-foreground\">{t(label)}</p>\n <p className=\"text-xs text-muted-foreground leading-relaxed\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AAE;AAAA,QAC/D,oBAAC,OAAE,WAAU,iDAAiD,YAAE,MAAM,GAAE;AAAA,SAC1E;AAAA,SAPQ,KAQV,CACD,GACH;AAAA,KACF,GACF,GACF;AAEJ;","names":[]}
@@ -35,7 +35,10 @@ module.exports = __toCommonJS(section_heading_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_link = __toESM(require("./link.js"), 1);
37
37
  var import_lucide_react = require("lucide-react");
38
- function SectionHeading({ icon, title, subtitle, href, linkLabel = "View all" }) {
38
+ var import_provider = require("../i18n/provider.js");
39
+ var import_translate = require("../i18n/translate.js");
40
+ function SectionHeading({ icon, title, subtitle, href, linkLabel = (0, import_translate.msg)("View all") }) {
41
+ const t = (0, import_provider.useT)();
39
42
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
40
43
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
41
44
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "shrink-0 text-muted-foreground [&>svg]:h-4 [&>svg]:w-4", children: icon }),
@@ -50,7 +53,7 @@ function SectionHeading({ icon, title, subtitle, href, linkLabel = "View all" })
50
53
  href,
51
54
  className: "inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",
52
55
  children: [
53
- linkLabel,
56
+ t(linkLabel),
54
57
  " ",
55
58
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-3 w-3" })
56
59
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/section-heading.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ArrowRight } from \"lucide-react\";\n\nexport interface SectionHeadingProps {\n icon: React.ReactNode;\n title: string;\n subtitle?: React.ReactNode;\n href?: string;\n linkLabel?: string;\n}\n\nexport function SectionHeading({ icon, title, subtitle, href, linkLabel = \"View all\" }: SectionHeadingProps) {\n return (\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"shrink-0 text-muted-foreground [&>svg]:h-4 [&>svg]:w-4\">{icon}</span>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold leading-none tracking-tight text-foreground\">{title}</h2>\n {subtitle && <p className=\"mt-1 flex items-center gap-1 text-2xs text-muted-foreground\">{subtitle}</p>}\n </div>\n </div>\n {href && (\n <Link\n href={href}\n className=\"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground\"\n >\n {linkLabel} <ArrowRight className=\"h-3 w-3\" />\n </Link>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBQ;AAfR,kBAAiB;AACjB,0BAA2B;AAUpB,SAAS,eAAe,EAAE,MAAM,OAAO,UAAU,MAAM,YAAY,WAAW,GAAwB;AAC3G,SACE,6CAAC,SAAI,WAAU,2CACb;AAAA,iDAAC,SAAI,WAAU,mCACb;AAAA,kDAAC,UAAK,WAAU,0DAA0D,gBAAK;AAAA,MAC/E,6CAAC,SAAI,WAAU,WACb;AAAA,oDAAC,QAAG,WAAU,qEAAqE,iBAAM;AAAA,QACxF,YAAY,4CAAC,OAAE,WAAU,+DAA+D,oBAAS;AAAA,SACpG;AAAA,OACF;AAAA,IACC,QACC;AAAA,MAAC,YAAAA;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAU;AAAA,QAET;AAAA;AAAA,UAAU;AAAA,UAAC,4CAAC,kCAAW,WAAU,WAAU;AAAA;AAAA;AAAA,IAC9C;AAAA,KAEJ;AAEJ;","names":["Link"]}
1
+ {"version":3,"sources":["../../src/components/section-heading.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ArrowRight } from \"lucide-react\";\nimport { useT } from \"../i18n/provider.js\";\nimport { msg } from \"../i18n/translate.js\";\n\nexport interface SectionHeadingProps {\n icon: React.ReactNode;\n title: string;\n subtitle?: React.ReactNode;\n href?: string;\n linkLabel?: string;\n}\n\nexport function SectionHeading({ icon, title, subtitle, href, linkLabel = msg(\"View all\") }: SectionHeadingProps) {\n const t = useT();\n return (\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"shrink-0 text-muted-foreground [&>svg]:h-4 [&>svg]:w-4\">{icon}</span>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold leading-none tracking-tight text-foreground\">{title}</h2>\n {subtitle && <p className=\"mt-1 flex items-center gap-1 text-2xs text-muted-foreground\">{subtitle}</p>}\n </div>\n </div>\n {href && (\n <Link\n href={href}\n className=\"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground\"\n >\n {t(linkLabel)} <ArrowRight className=\"h-3 w-3\" />\n </Link>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBQ;AAlBR,kBAAiB;AACjB,0BAA2B;AAC3B,sBAAqB;AACrB,uBAAoB;AAUb,SAAS,eAAe,EAAE,MAAM,OAAO,UAAU,MAAM,gBAAY,sBAAI,UAAU,EAAE,GAAwB;AAChH,QAAM,QAAI,sBAAK;AACf,SACE,6CAAC,SAAI,WAAU,2CACb;AAAA,iDAAC,SAAI,WAAU,mCACb;AAAA,kDAAC,UAAK,WAAU,0DAA0D,gBAAK;AAAA,MAC/E,6CAAC,SAAI,WAAU,WACb;AAAA,oDAAC,QAAG,WAAU,qEAAqE,iBAAM;AAAA,QACxF,YAAY,4CAAC,OAAE,WAAU,+DAA+D,oBAAS;AAAA,SACpG;AAAA,OACF;AAAA,IACC,QACC;AAAA,MAAC,YAAAA;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAU;AAAA,QAET;AAAA,YAAE,SAAS;AAAA,UAAE;AAAA,UAAC,4CAAC,kCAAW,WAAU,WAAU;AAAA;AAAA;AAAA,IACjD;AAAA,KAEJ;AAEJ;","names":["Link"]}
@@ -2,7 +2,10 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import Link from "./link.js";
4
4
  import { ArrowRight } from "lucide-react";
5
- function SectionHeading({ icon, title, subtitle, href, linkLabel = "View all" }) {
5
+ import { useT } from "../i18n/provider.js";
6
+ import { msg } from "../i18n/translate.js";
7
+ function SectionHeading({ icon, title, subtitle, href, linkLabel = msg("View all") }) {
8
+ const t = useT();
6
9
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
7
10
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
8
11
  /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground [&>svg]:h-4 [&>svg]:w-4", children: icon }),
@@ -17,7 +20,7 @@ function SectionHeading({ icon, title, subtitle, href, linkLabel = "View all" })
17
20
  href,
18
21
  className: "inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",
19
22
  children: [
20
- linkLabel,
23
+ t(linkLabel),
21
24
  " ",
22
25
  /* @__PURE__ */ jsx(ArrowRight, { className: "h-3 w-3" })
23
26
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/section-heading.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ArrowRight } from \"lucide-react\";\n\nexport interface SectionHeadingProps {\n icon: React.ReactNode;\n title: string;\n subtitle?: React.ReactNode;\n href?: string;\n linkLabel?: string;\n}\n\nexport function SectionHeading({ icon, title, subtitle, href, linkLabel = \"View all\" }: SectionHeadingProps) {\n return (\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"shrink-0 text-muted-foreground [&>svg]:h-4 [&>svg]:w-4\">{icon}</span>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold leading-none tracking-tight text-foreground\">{title}</h2>\n {subtitle && <p className=\"mt-1 flex items-center gap-1 text-2xs text-muted-foreground\">{subtitle}</p>}\n </div>\n </div>\n {href && (\n <Link\n href={href}\n className=\"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground\"\n >\n {linkLabel} <ArrowRight className=\"h-3 w-3\" />\n </Link>\n )}\n </div>\n );\n}\n"],"mappings":";AAiBQ,cACA,YADA;AAfR,OAAO,UAAU;AACjB,SAAS,kBAAkB;AAUpB,SAAS,eAAe,EAAE,MAAM,OAAO,UAAU,MAAM,YAAY,WAAW,GAAwB;AAC3G,SACE,qBAAC,SAAI,WAAU,2CACb;AAAA,yBAAC,SAAI,WAAU,mCACb;AAAA,0BAAC,UAAK,WAAU,0DAA0D,gBAAK;AAAA,MAC/E,qBAAC,SAAI,WAAU,WACb;AAAA,4BAAC,QAAG,WAAU,qEAAqE,iBAAM;AAAA,QACxF,YAAY,oBAAC,OAAE,WAAU,+DAA+D,oBAAS;AAAA,SACpG;AAAA,OACF;AAAA,IACC,QACC;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAU;AAAA,QAET;AAAA;AAAA,UAAU;AAAA,UAAC,oBAAC,cAAW,WAAU,WAAU;AAAA;AAAA;AAAA,IAC9C;AAAA,KAEJ;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/section-heading.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { ArrowRight } from \"lucide-react\";\nimport { useT } from \"../i18n/provider.js\";\nimport { msg } from \"../i18n/translate.js\";\n\nexport interface SectionHeadingProps {\n icon: React.ReactNode;\n title: string;\n subtitle?: React.ReactNode;\n href?: string;\n linkLabel?: string;\n}\n\nexport function SectionHeading({ icon, title, subtitle, href, linkLabel = msg(\"View all\") }: SectionHeadingProps) {\n const t = useT();\n return (\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"shrink-0 text-muted-foreground [&>svg]:h-4 [&>svg]:w-4\">{icon}</span>\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold leading-none tracking-tight text-foreground\">{title}</h2>\n {subtitle && <p className=\"mt-1 flex items-center gap-1 text-2xs text-muted-foreground\">{subtitle}</p>}\n </div>\n </div>\n {href && (\n <Link\n href={href}\n className=\"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground\"\n >\n {t(linkLabel)} <ArrowRight className=\"h-3 w-3\" />\n </Link>\n )}\n </div>\n );\n}\n"],"mappings":";AAoBQ,cACA,YADA;AAlBR,OAAO,UAAU;AACjB,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,WAAW;AAUb,SAAS,eAAe,EAAE,MAAM,OAAO,UAAU,MAAM,YAAY,IAAI,UAAU,EAAE,GAAwB;AAChH,QAAM,IAAI,KAAK;AACf,SACE,qBAAC,SAAI,WAAU,2CACb;AAAA,yBAAC,SAAI,WAAU,mCACb;AAAA,0BAAC,UAAK,WAAU,0DAA0D,gBAAK;AAAA,MAC/E,qBAAC,SAAI,WAAU,WACb;AAAA,4BAAC,QAAG,WAAU,qEAAqE,iBAAM;AAAA,QACxF,YAAY,oBAAC,OAAE,WAAU,+DAA+D,oBAAS;AAAA,SACpG;AAAA,OACF;AAAA,IACC,QACC;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAU;AAAA,QAET;AAAA,YAAE,SAAS;AAAA,UAAE;AAAA,UAAC,oBAAC,cAAW,WAAU,WAAU;AAAA;AAAA;AAAA,IACjD;AAAA,KAEJ;AAEJ;","names":[]}
@@ -45,10 +45,11 @@ var import_address = require("../utils/address.js");
45
45
  var import_use_sponsorship = require("../utils/use-sponsorship.js");
46
46
  var import_use_tokens = require("../utils/use-tokens.js");
47
47
  var import_provider = require("../i18n/provider.js");
48
+ var import_translate = require("../i18n/translate.js");
48
49
  const FEATURES = [
49
- "No escrow \u2014 direct settlement",
50
- "Owner-verified on-chain",
51
- "Open bidding or one invited sponsor"
50
+ (0, import_translate.msg)("No escrow \u2014 direct settlement"),
51
+ (0, import_translate.msg)("Owner-verified on-chain"),
52
+ (0, import_translate.msg)("Open bidding or one invited sponsor")
52
53
  ];
53
54
  function OfferCard({ offer }) {
54
55
  const { token } = (0, import_use_tokens.useToken)(offer.nftContract, offer.tokenId);
@@ -86,7 +87,7 @@ function SponsorshipOffersPage() {
86
87
  ] }),
87
88
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: FEATURES.map((f) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-muted/40 border border-border/30 text-xs font-medium text-muted-foreground", children: [
88
89
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-3 w-3 text-brand-rose shrink-0" }),
89
- f
90
+ t(f)
90
91
  ] }, f)) }) }) }),
91
92
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-2xl border border-brand-rose/20 bg-brand-rose/5 p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between", children: [
92
93
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-0.5", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/sponsorship-offers-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { ArrowRight, Check, Handshake } from \"lucide-react\";\nimport { formatAmount, getTokenByAddress, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { BackButton } from \"./back-button.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { ServiceHeader } from \"./service-header.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { useSponsorshipOffers } from \"../utils/use-sponsorship.js\";\nimport { useToken } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nconst FEATURES = [\n \"No escrow — direct settlement\",\n \"Owner-verified on-chain\",\n \"Open bidding or one invited sponsor\",\n];\n\nfunction OfferCard({ offer }: { offer: ApiSponsorshipOffer }) {\n const { token } = useToken(offer.nftContract, offer.tokenId);\n const paymentToken = getTokenByAddress(offer.paymentToken);\n const min = paymentToken ? `Min ${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;\n const days = Math.round(Number(offer.duration) / 86400);\n\n return (\n <AssetCard\n href={`/launchpad/sponsorship/${offer.offerId}`}\n name={token?.metadata?.name ?? `Token #${offer.tokenId}`}\n image={token?.metadata?.image ?? null}\n subtitle={shortenAddress(offer.nftContract)}\n fallbackId={offer.tokenId}\n price={{ formatted: `${min} · ${days}d`, currency: null }}\n />\n );\n}\n\nexport function SponsorshipOffersPage() {\n const t = useT();\n const { offers, isLoading } = useSponsorshipOffers();\n const openOffers = offers.filter((o) => o.open);\n\n return (\n <div className=\"pb-16 space-y-10\">\n <section className=\"px-4 pt-10 max-w-5xl mx-auto\">\n <BackButton />\n <FadeIn>\n <div className=\"mt-6\">\n <ServiceHeader\n plain\n icon={<Handshake className=\"h-4 w-4 text-white\" />}\n title={t(\"IP Sponsorship\")}\n subtitle={t(\"Sponsorship offers anchored to your IP assets — a sponsor bids, you accept, they receive a license.\")}\n />\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"flex flex-wrap gap-2\">\n {FEATURES.map((f) => (\n <span key={f} className=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-muted/40 border border-border/30 text-xs font-medium text-muted-foreground\">\n <Check className=\"h-3 w-3 text-brand-rose shrink-0\" />\n {f}\n </span>\n ))}\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"rounded-2xl border border-brand-rose/20 bg-brand-rose/5 p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-semibold\">{t(\"Start a sponsorship deal\")}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Offer one of your assets for sponsors to bid on, or propose terms directly on one you'd like to sponsor.\")}\n </p>\n </div>\n <Button asChild size=\"sm\" className=\"shrink-0 bg-brand-rose hover:brightness-110 text-white gap-1.5\">\n <Link href=\"/launchpad/sponsorship/create\">\n {t(\"Get started\")}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </Button>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 space-y-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div>\n <p className=\"section-label\">{t(\"Open\")}</p>\n <h2 className=\"text-xl font-bold mt-0.5\">{t(\"Sponsorship offers\")}</h2>\n </div>\n </FadeIn>\n\n {isLoading ? (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <AssetCardSkeleton key={i} />)}\n </div>\n ) : openOffers.length === 0 ? (\n <FadeIn>\n <div className=\"bento-cell border-dashed p-12 text-center space-y-4\">\n <div className=\"flex justify-center\">\n <div className=\"h-16 w-16 rounded-2xl bg-brand-rose/8 flex items-center justify-center\">\n <Handshake className=\"h-8 w-8 text-brand-rose/30\" />\n </div>\n </div>\n <div className=\"space-y-1\">\n <p className=\"font-semibold text-sm\">{t(\"No open sponsorship offers yet\")}</p>\n <p className=\"text-xs text-muted-foreground\">{t(\"Creators open offers from their asset pages — sponsors bid on them here.\")}</p>\n </div>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {openOffers.map((offer) => (\n <StaggerItem key={offer.id}>\n <OfferCard offer={offer} />\n </StaggerItem>\n ))}\n </Stagger>\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BI;AA1BJ,0BAA6C;AAC7C,iBAA0E;AAC1E,wBAA6C;AAC7C,yBAA2B;AAC3B,oBAAuB;AACvB,kBAAiB;AACjB,+BAA6C;AAC7C,4BAA8B;AAC9B,qBAA+B;AAC/B,6BAAqC;AACrC,wBAAyB;AACzB,sBAAqB;AAErB,MAAM,WAAW;AAAA,EACf;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,UAAU,EAAE,MAAM,GAAmC;AAC5D,QAAM,EAAE,MAAM,QAAI,4BAAS,MAAM,aAAa,MAAM,OAAO;AAC3D,QAAM,mBAAe,8BAAkB,MAAM,YAAY;AACzD,QAAM,MAAM,eAAe,WAAO,yBAAa,MAAM,WAAW,aAAa,QAAQ,CAAC,IAAI,aAAa,MAAM,KAAK,OAAO,MAAM,SAAS;AACxI,QAAM,OAAO,KAAK,MAAM,OAAO,MAAM,QAAQ,IAAI,KAAK;AAEtD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,0BAA0B,MAAM,OAAO;AAAA,MAC7C,MAAM,OAAO,UAAU,QAAQ,UAAU,MAAM,OAAO;AAAA,MACtD,OAAO,OAAO,UAAU,SAAS;AAAA,MACjC,cAAU,+BAAe,MAAM,WAAW;AAAA,MAC1C,YAAY,MAAM;AAAA,MAClB,OAAO,EAAE,WAAW,GAAG,GAAG,SAAM,IAAI,KAAK,UAAU,KAAK;AAAA;AAAA,EAC1D;AAEJ;AAEO,SAAS,wBAAwB;AACtC,QAAM,QAAI,sBAAK;AACf,QAAM,EA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AE;AAAA,SACpE,GACF;AAAA,MAEC,YACC,4CAAC,SAAI,WAAU,wDACZ,gBAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM,4CAAC,yCAAuB,CAAG,CAAE,GACxE,IACE,WAAW,WAAW,IACxB,4CAAC,mCACC,uDAAC,SAAI,WAAU,uDACb;AAAA,oDAAC,SAAI,WAAU,uBACb,sDAAC,SAAI,WAAU,0EACb,sDAAC,iCAAU,WAAU,8BAA6B,GACpD,GACF;AAAA,QACA,6CAAC,SAAI,WAAU,aACb;AAAA,sDAAC,OAAE,WAAU,yBAAyB,YAAE,gCAAgC,GAAE;AAAA,UAC1E,4CAAC,OAAE,WAAU,iCAAiC,YAAE,+EAA0E,GAAE;AAAA,WAC9H;AAAA,SACF,GACF,IAEA,4CAAC,oCAAQ,WAAU,wDAChB,qBAAW,IAAI,CAAC,UACf,4CAAC,wCACC,sDAAC,aAAU,OAAc,KADT,MAAM,EAExB,CACD,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":["Link"]}
1
+ {"version":3,"sources":["../../src/components/sponsorship-offers-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { ArrowRight, Check, Handshake } from \"lucide-react\";\nimport { formatAmount, getTokenByAddress, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { BackButton } from \"./back-button.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { ServiceHeader } from \"./service-header.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { useSponsorshipOffers } from \"../utils/use-sponsorship.js\";\nimport { useToken } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nimport { msg } from \"../i18n/translate.js\";\nconst FEATURES = [\n msg(\"No escrow — direct settlement\"),\n msg(\"Owner-verified on-chain\"),\n msg(\"Open bidding or one invited sponsor\"),\n];\n\nfunction OfferCard({ offer }: { offer: ApiSponsorshipOffer }) {\n const { token } = useToken(offer.nftContract, offer.tokenId);\n const paymentToken = getTokenByAddress(offer.paymentToken);\n const min = paymentToken ? `Min ${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;\n const days = Math.round(Number(offer.duration) / 86400);\n\n return (\n <AssetCard\n href={`/launchpad/sponsorship/${offer.offerId}`}\n name={token?.metadata?.name ?? `Token #${offer.tokenId}`}\n image={token?.metadata?.image ?? null}\n subtitle={shortenAddress(offer.nftContract)}\n fallbackId={offer.tokenId}\n price={{ formatted: `${min} · ${days}d`, currency: null }}\n />\n );\n}\n\nexport function SponsorshipOffersPage() {\n const t = useT();\n const { offers, isLoading } = useSponsorshipOffers();\n const openOffers = offers.filter((o) => o.open);\n\n return (\n <div className=\"pb-16 space-y-10\">\n <section className=\"px-4 pt-10 max-w-5xl mx-auto\">\n <BackButton />\n <FadeIn>\n <div className=\"mt-6\">\n <ServiceHeader\n plain\n icon={<Handshake className=\"h-4 w-4 text-white\" />}\n title={t(\"IP Sponsorship\")}\n subtitle={t(\"Sponsorship offers anchored to your IP assets — a sponsor bids, you accept, they receive a license.\")}\n />\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"flex flex-wrap gap-2\">\n {FEATURES.map((f) => (\n <span key={f} className=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-muted/40 border border-border/30 text-xs font-medium text-muted-foreground\">\n <Check className=\"h-3 w-3 text-brand-rose shrink-0\" />\n {t(f)}\n </span>\n ))}\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"rounded-2xl border border-brand-rose/20 bg-brand-rose/5 p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-semibold\">{t(\"Start a sponsorship deal\")}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Offer one of your assets for sponsors to bid on, or propose terms directly on one you'd like to sponsor.\")}\n </p>\n </div>\n <Button asChild size=\"sm\" className=\"shrink-0 bg-brand-rose hover:brightness-110 text-white gap-1.5\">\n <Link href=\"/launchpad/sponsorship/create\">\n {t(\"Get started\")}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </Button>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 space-y-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div>\n <p className=\"section-label\">{t(\"Open\")}</p>\n <h2 className=\"text-xl font-bold mt-0.5\">{t(\"Sponsorship offers\")}</h2>\n </div>\n </FadeIn>\n\n {isLoading ? (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <AssetCardSkeleton key={i} />)}\n </div>\n ) : openOffers.length === 0 ? (\n <FadeIn>\n <div className=\"bento-cell border-dashed p-12 text-center space-y-4\">\n <div className=\"flex justify-center\">\n <div className=\"h-16 w-16 rounded-2xl bg-brand-rose/8 flex items-center justify-center\">\n <Handshake className=\"h-8 w-8 text-brand-rose/30\" />\n </div>\n </div>\n <div className=\"space-y-1\">\n <p className=\"font-semibold text-sm\">{t(\"No open sponsorship offers yet\")}</p>\n <p className=\"text-xs text-muted-foreground\">{t(\"Creators open offers from their asset pages — sponsors bid on them here.\")}</p>\n </div>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {openOffers.map((offer) => (\n <StaggerItem key={offer.id}>\n <OfferCard offer={offer} />\n </StaggerItem>\n ))}\n </Stagger>\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BI;AA3BJ,0BAA6C;AAC7C,iBAA0E;AAC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,sDAAC,SAAI,WAAU,0EACb,sDAAC,iCAAU,WAAU,8BAA6B,GACpD,GACF;AAAA,QACA,6CAAC,SAAI,WAAU,aACb;AAAA,sDAAC,OAAE,WAAU,yBAAyB,YAAE,gCAAgC,GAAE;AAAA,UAC1E,4CAAC,OAAE,WAAU,iCAAiC,YAAE,+EAA0E,GAAE;AAAA,WAC9H;AAAA,SACF,GACF,IAEA,4CAAC,oCAAQ,WAAU,wDAChB,qBAAW,IAAI,CAAC,UACf,4CAAC,wCACC,sDAAC,aAAU,OAAc,KADT,MAAM,EAExB,CACD,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":["Link"]}
@@ -12,10 +12,11 @@ import { shortenAddress } from "../utils/address.js";
12
12
  import { useSponsorshipOffers } from "../utils/use-sponsorship.js";
13
13
  import { useToken } from "../utils/use-tokens.js";
14
14
  import { useT } from "../i18n/provider.js";
15
+ import { msg } from "../i18n/translate.js";
15
16
  const FEATURES = [
16
- "No escrow \u2014 direct settlement",
17
- "Owner-verified on-chain",
18
- "Open bidding or one invited sponsor"
17
+ msg("No escrow \u2014 direct settlement"),
18
+ msg("Owner-verified on-chain"),
19
+ msg("Open bidding or one invited sponsor")
19
20
  ];
20
21
  function OfferCard({ offer }) {
21
22
  const { token } = useToken(offer.nftContract, offer.tokenId);
@@ -53,7 +54,7 @@ function SponsorshipOffersPage() {
53
54
  ] }),
54
55
  /* @__PURE__ */ jsx("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: FEATURES.map((f) => /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-muted/40 border border-border/30 text-xs font-medium text-muted-foreground", children: [
55
56
  /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 text-brand-rose shrink-0" }),
56
- f
57
+ t(f)
57
58
  ] }, f)) }) }) }),
58
59
  /* @__PURE__ */ jsx("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-brand-rose/20 bg-brand-rose/5 p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between", children: [
59
60
  /* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/sponsorship-offers-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { ArrowRight, Check, Handshake } from \"lucide-react\";\nimport { formatAmount, getTokenByAddress, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { BackButton } from \"./back-button.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { ServiceHeader } from \"./service-header.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { useSponsorshipOffers } from \"../utils/use-sponsorship.js\";\nimport { useToken } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nconst FEATURES = [\n \"No escrow — direct settlement\",\n \"Owner-verified on-chain\",\n \"Open bidding or one invited sponsor\",\n];\n\nfunction OfferCard({ offer }: { offer: ApiSponsorshipOffer }) {\n const { token } = useToken(offer.nftContract, offer.tokenId);\n const paymentToken = getTokenByAddress(offer.paymentToken);\n const min = paymentToken ? `Min ${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;\n const days = Math.round(Number(offer.duration) / 86400);\n\n return (\n <AssetCard\n href={`/launchpad/sponsorship/${offer.offerId}`}\n name={token?.metadata?.name ?? `Token #${offer.tokenId}`}\n image={token?.metadata?.image ?? null}\n subtitle={shortenAddress(offer.nftContract)}\n fallbackId={offer.tokenId}\n price={{ formatted: `${min} · ${days}d`, currency: null }}\n />\n );\n}\n\nexport function SponsorshipOffersPage() {\n const t = useT();\n const { offers, isLoading } = useSponsorshipOffers();\n const openOffers = offers.filter((o) => o.open);\n\n return (\n <div className=\"pb-16 space-y-10\">\n <section className=\"px-4 pt-10 max-w-5xl mx-auto\">\n <BackButton />\n <FadeIn>\n <div className=\"mt-6\">\n <ServiceHeader\n plain\n icon={<Handshake className=\"h-4 w-4 text-white\" />}\n title={t(\"IP Sponsorship\")}\n subtitle={t(\"Sponsorship offers anchored to your IP assets — a sponsor bids, you accept, they receive a license.\")}\n />\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"flex flex-wrap gap-2\">\n {FEATURES.map((f) => (\n <span key={f} className=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-muted/40 border border-border/30 text-xs font-medium text-muted-foreground\">\n <Check className=\"h-3 w-3 text-brand-rose shrink-0\" />\n {f}\n </span>\n ))}\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"rounded-2xl border border-brand-rose/20 bg-brand-rose/5 p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-semibold\">{t(\"Start a sponsorship deal\")}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Offer one of your assets for sponsors to bid on, or propose terms directly on one you'd like to sponsor.\")}\n </p>\n </div>\n <Button asChild size=\"sm\" className=\"shrink-0 bg-brand-rose hover:brightness-110 text-white gap-1.5\">\n <Link href=\"/launchpad/sponsorship/create\">\n {t(\"Get started\")}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </Button>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 space-y-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div>\n <p className=\"section-label\">{t(\"Open\")}</p>\n <h2 className=\"text-xl font-bold mt-0.5\">{t(\"Sponsorship offers\")}</h2>\n </div>\n </FadeIn>\n\n {isLoading ? (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <AssetCardSkeleton key={i} />)}\n </div>\n ) : openOffers.length === 0 ? (\n <FadeIn>\n <div className=\"bento-cell border-dashed p-12 text-center space-y-4\">\n <div className=\"flex justify-center\">\n <div className=\"h-16 w-16 rounded-2xl bg-brand-rose/8 flex items-center justify-center\">\n <Handshake className=\"h-8 w-8 text-brand-rose/30\" />\n </div>\n </div>\n <div className=\"space-y-1\">\n <p className=\"font-semibold text-sm\">{t(\"No open sponsorship offers yet\")}</p>\n <p className=\"text-xs text-muted-foreground\">{t(\"Creators open offers from their asset pages — sponsors bid on them here.\")}</p>\n </div>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {openOffers.map((offer) => (\n <StaggerItem key={offer.id}>\n <OfferCard offer={offer} />\n </StaggerItem>\n ))}\n </Stagger>\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";AA4BI,cAkBE,YAlBF;AA1BJ,SAAS,YAAY,OAAO,iBAAiB;AAC7C,SAAS,cAAc,yBAAmD;AAC1E,SAAS,WAAW,yBAAyB;AAC7C,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,QAAQ,SAAS,mBAAmB;AAC7C,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,gBAAgB;AACzB,SAAS,YAAY;AAErB,MAAM,WAAW;AAAA,EACf;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,UAAU,EAAE,MAAM,GAAmC;AAC5D,QAAM,EAAE,MAAM,IAAI,SAAS,MAAM,aAAa,MAAM,OAAO;AAC3D,QAAM,eAAe,kBAAkB,MAAM,YAAY;AACzD,QAAM,MAAM,eAAe,OAAO,aAAa,MAAM,WAAW,aAAa,QAAQ,CAAC,IAAI,aAAa,MAAM,KA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0B,GAAE;AAAA,QACpE,oBAAC,OAAE,WAAU,iCACV,YAAE,0GAA0G,GAC/G;AAAA,SACF;AAAA,MACA,oBAAC,UAAO,SAAO,MAAC,MAAK,MAAK,WAAU,kEAClC,+BAAC,QAAK,MAAK,iCACR;AAAA,UAAE,aAAa;AAAA,QAChB,oBAAC,cAAW,WAAU,eAAc;AAAA,SACtC,GACF;AAAA,OACF,GACF,GACF;AAAA,IAEA,qBAAC,aAAQ,WAAU,oCACjB;AAAA,0BAAC,UACC,+BAAC,SACC;AAAA,4BAAC,OAAE,WAAU,iBAAiB,YAAE,MAAM,GAAE;AAAA,QACxC,oBAAC,QAAG,WAAU,4BAA4B,YAAE,oBAAoB,GAAE;AAAA,SACpE,GACF;AAAA,MAEC,YACC,oBAAC,SAAI,WAAU,wDACZ,gBAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM,oBAAC,uBAAuB,CAAG,CAAE,GACxE,IACE,WAAW,WAAW,IACxB,oBAAC,UACC,+BAAC,SAAI,WAAU,uDACb;AAAA,4BAAC,SAAI,WAAU,uBACb,8BAAC,SAAI,WAAU,0EACb,8BAAC,aAAU,WAAU,8BAA6B,GACpD,GACF;AAAA,QACA,qBAAC,SAAI,WAAU,aACb;AAAA,8BAAC,OAAE,WAAU,yBAAyB,YAAE,gCAAgC,GAAE;AAAA,UAC1E,oBAAC,OAAE,WAAU,iCAAiC,YAAE,+EAA0E,GAAE;AAAA,WAC9H;AAAA,SACF,GACF,IAEA,oBAAC,WAAQ,WAAU,wDAChB,qBAAW,IAAI,CAAC,UACf,oBAAC,eACC,8BAAC,aAAU,OAAc,KADT,MAAM,EAExB,CACD,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/sponsorship-offers-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { ArrowRight, Check, Handshake } from \"lucide-react\";\nimport { formatAmount, getTokenByAddress, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { BackButton } from \"./back-button.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { ServiceHeader } from \"./service-header.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { useSponsorshipOffers } from \"../utils/use-sponsorship.js\";\nimport { useToken } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nimport { msg } from \"../i18n/translate.js\";\nconst FEATURES = [\n msg(\"No escrow — direct settlement\"),\n msg(\"Owner-verified on-chain\"),\n msg(\"Open bidding or one invited sponsor\"),\n];\n\nfunction OfferCard({ offer }: { offer: ApiSponsorshipOffer }) {\n const { token } = useToken(offer.nftContract, offer.tokenId);\n const paymentToken = getTokenByAddress(offer.paymentToken);\n const min = paymentToken ? `Min ${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;\n const days = Math.round(Number(offer.duration) / 86400);\n\n return (\n <AssetCard\n href={`/launchpad/sponsorship/${offer.offerId}`}\n name={token?.metadata?.name ?? `Token #${offer.tokenId}`}\n image={token?.metadata?.image ?? null}\n subtitle={shortenAddress(offer.nftContract)}\n fallbackId={offer.tokenId}\n price={{ formatted: `${min} · ${days}d`, currency: null }}\n />\n );\n}\n\nexport function SponsorshipOffersPage() {\n const t = useT();\n const { offers, isLoading } = useSponsorshipOffers();\n const openOffers = offers.filter((o) => o.open);\n\n return (\n <div className=\"pb-16 space-y-10\">\n <section className=\"px-4 pt-10 max-w-5xl mx-auto\">\n <BackButton />\n <FadeIn>\n <div className=\"mt-6\">\n <ServiceHeader\n plain\n icon={<Handshake className=\"h-4 w-4 text-white\" />}\n title={t(\"IP Sponsorship\")}\n subtitle={t(\"Sponsorship offers anchored to your IP assets — a sponsor bids, you accept, they receive a license.\")}\n />\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"flex flex-wrap gap-2\">\n {FEATURES.map((f) => (\n <span key={f} className=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-muted/40 border border-border/30 text-xs font-medium text-muted-foreground\">\n <Check className=\"h-3 w-3 text-brand-rose shrink-0\" />\n {t(f)}\n </span>\n ))}\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"rounded-2xl border border-brand-rose/20 bg-brand-rose/5 p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-semibold\">{t(\"Start a sponsorship deal\")}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Offer one of your assets for sponsors to bid on, or propose terms directly on one you'd like to sponsor.\")}\n </p>\n </div>\n <Button asChild size=\"sm\" className=\"shrink-0 bg-brand-rose hover:brightness-110 text-white gap-1.5\">\n <Link href=\"/launchpad/sponsorship/create\">\n {t(\"Get started\")}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </Button>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 space-y-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div>\n <p className=\"section-label\">{t(\"Open\")}</p>\n <h2 className=\"text-xl font-bold mt-0.5\">{t(\"Sponsorship offers\")}</h2>\n </div>\n </FadeIn>\n\n {isLoading ? (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <AssetCardSkeleton key={i} />)}\n </div>\n ) : openOffers.length === 0 ? (\n <FadeIn>\n <div className=\"bento-cell border-dashed p-12 text-center space-y-4\">\n <div className=\"flex justify-center\">\n <div className=\"h-16 w-16 rounded-2xl bg-brand-rose/8 flex items-center justify-center\">\n <Handshake className=\"h-8 w-8 text-brand-rose/30\" />\n </div>\n </div>\n <div className=\"space-y-1\">\n <p className=\"font-semibold text-sm\">{t(\"No open sponsorship offers yet\")}</p>\n <p className=\"text-xs text-muted-foreground\">{t(\"Creators open offers from their asset pages — sponsors bid on them here.\")}</p>\n </div>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {openOffers.map((offer) => (\n <StaggerItem key={offer.id}>\n <OfferCard offer={offer} />\n </StaggerItem>\n ))}\n </Stagger>\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";AA6BI,cAkBE,YAlBF;AA3BJ,SAAS,YAAY,OAAO,iBAAiB;AAC7C,SAAS,cAAc,yBAAmD;AAC1E,SAAS,WAAW,yBAAyB;AAC7C,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,QAAQ,SAAS,mBAAmB;AAC7C,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,gBAAgB;AACzB,SAAS,YAAY;AAErB,SAAS,WAAW;AACpB,MAAM,WAAW;AAAA,EACf,IAAI,oCAA+B;AAAA,EACnC,IAAI,yBAAyB;AAAA,EAC7B,IAAI,qCAAqC;AAC3C;AAEA,SAAS,UAAU,EAAE,MAAM,GAAmC;AAC5D,QAAM,EAAE,MAAM,IAAI,SAAS,MAAM,aAAa,MAAM,OAAO;AAC3D,QAAM,eAAe,kBAAkB,MAAM,YAAY;AACzD,QAAM,MAAM,eAAe,OAAO,aAAa,MAAM,WAAW,aAAa,QAAQ,CAAC,IAAI,aAAa,MAAM,KAAK,OAAO,MAAM,SAAS;AACxI,QAAM,OAAO,KAAK,MAAM,OAAO,MAAM,QAAQ,IAAI,KAAK;AAEtD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,0BAA0B,MAAM,OAAO;AAAA,MAC7C,MAAM,OAAO,UAAU,QAAQ,UAAU,MAAM,OAAO;AAAA,MACtD,OAAO,OAAO,UAAU,SAAS;AAAA,MACjC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,OACF,GACF,GACF;AAAA,IAEA,qBAAC,aAAQ,WAAU,oCACjB;AAAA,0BAAC,UACC,+BAAC,SACC;AAAA,4BAAC,OAAE,WAAU,iBAAiB,YAAE,MAAM,GAAE;AAAA,QACxC,oBAAC,QAAG,WAAU,4BAA4B,YAAE,oBAAoB,GAAE;AAAA,SACpE,GACF;AAAA,MAEC,YACC,oBAAC,SAAI,WAAU,wDACZ,gBAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM,oBAAC,uBAAuB,CAAG,CAAE,GACxE,IACE,WAAW,WAAW,IACxB,oBAAC,UACC,+BAAC,SAAI,WAAU,uDACb;AAAA,4BAAC,SAAI,WAAU,uBACb,8BAAC,SAAI,WAAU,0EACb,8BAAC,aAAU,WAAU,8BAA6B,GACpD,GACF;AAAA,QACA,qBAAC,SAAI,WAAU,aACb;AAAA,8BAAC,OAAE,WAAU,yBAAyB,YAAE,gCAAgC,GAAE;AAAA,UAC1E,oBAAC,OAAE,WAAU,iCAAiC,YAAE,+EAA0E,GAAE;AAAA,WAC9H;AAAA,SACF,GACF,IAEA,oBAAC,WAAQ,WAAU,wDAChB,qBAAW,IAAI,CAAC,UACf,oBAAC,eACC,8BAAC,aAAU,OAAc,KADT,MAAM,EAExB,CACD,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
@@ -35,7 +35,7 @@ function TransactionDialog({ tx, title, workingLabel, firstStepLabel = "Prepare"
35
35
  const working = phase === "preparing" || phase === "submitting" || phase === "confirming";
36
36
  const success = phase === "success";
37
37
  const failed = phase === "error";
38
- const steps = [firstStepLabel, "Submit transaction", "Confirm transaction"];
38
+ const steps = [firstStepLabel, t("Submit transaction"), t("Confirm transaction")];
39
39
  (0, import_use_confetti.useConfetti)(success);
40
40
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, { open: phase !== "idle", modal: true, onOpenChange: (open) => {
41
41
  if (!open && !working) reset();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const t = useT();\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, \"Submit transaction\", \"Confirm transaction\"];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? t(\"Waiting for block confirmation\") : t(\"Submitting transaction\")}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">{t(\"This usually takes 10–30 seconds.\")}</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10\">\n <XCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"outline\" className=\"w-full\" onClick={reset}>\n {retryable ? t(\"Try again\") : t(\"Close\")}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsCQ;AAnCR,0BAA+C;AAC/C,oBAAmD;AACnD,oBAAuB;AACvB,0BAA4B;AAE5B,sBAAqB;AAUrB,MAAM,cAAc,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,EAAE;AAE1D,SAAS,kBAAkB,EAAE,IAAI,OAAO,cAAc,iBAAiB,WAAW,SAAS,GAA2B;AAC3H,QAAM,QAAI,sBAAK;AACf,QAAM,EAAE,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qEAAoE;AAAA,cAErF,4CAAC,UAAK,WAAW,OAAO,4BAA4B,SAAS,qCAAqC,iCAC/F,iBACH;AAAA,iBAVO,KAWT;AAAA,UAEJ,CAAC,GACH;AAAA,UACA,4CAAC,OAAE,WAAU,6CAA6C,YAAE,wCAAmC,GAAE;AAAA,WACnG;AAAA,QAGD,WAAW;AAAA,QAEX,UACC,6CAAC,SAAI,WAAU,yCACb;AAAA,sDAAC,SAAI,WAAU,6EACb,sDAAC,+BAAQ,WAAU,4BAA2B,GAChD;AAAA,UACA,6CAAC,SAAI,WAAU,yBACb;AAAA,wDAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,4CAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,4CAAC,wBAAO,SAAQ,WAAU,WAAU,UAAS,SAAS,OACnD,sBAAY,EAAE,WAAW,IAAI,EAAE,OAAO,GACzC;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const t = useT();\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, t(\"Submit transaction\"), t(\"Confirm transaction\")];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? t(\"Waiting for block confirmation\") : t(\"Submitting transaction\")}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">{t(\"This usually takes 10–30 seconds.\")}</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10\">\n <XCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"outline\" className=\"w-full\" onClick={reset}>\n {retryable ? t(\"Try again\") : t(\"Close\")}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsCQ;AAnCR,0BAA+C;AAC/C,oBAAmD;AACnD,oBAAuB;AACvB,0BAA4B;AAE5B,sBAAqB;AAUrB,MAAM,cAAc,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,EAAE;AAE1D,SAAS,kBAAkB,EAAE,IAAI,OAAO,cAAc,iBAAiB,WAAW,SAAS,GAA2B;AAC3H,QAAM,QAAI,sBAAK;AACf,QAAM,EAAE,OAAO,OAAO,OAAO,YAAY,KAAK,IAAI;AAClD,QAAM,UAAU,UAAU,eAAe,UAAU,gBAAgB,UAAU;AAC7E,QAAM,UAAU,UAAU;AAC1B,QAAM,SAAS,UAAU;AACzB,QAAM,QAAQ,CAAC,gBAAgB,EAAE,oBAAoB,GAAG,EAAE,qBAAqB,CAAC;AAEhF,uCAAY,OAAO;AAEnB,SACE,4CAAC,wBAAO,MAAM,UAAU,QAAQ,OAAK,MAAC,cAAc,CAAC,SAAS;AAAE,QAAI,CAAC,QAAQ,CAAC,QAAS,OAAM;AAAA,EAAG,GAC9F;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,mBAAmB,UAAU,CAAC,MAAM,EAAE,eAAe,IAAI;AAAA,MACzD,iBAAiB,UAAU,CAAC,MAAM,EAAE,eAAe,IAAI;AAAA,MACtD,GAAI,UAAU,EAAE,WAAW,KAAK,IAAI,CAAC;AAAA,MAEtC;AAAA,oDAAC,6BAAY,W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;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
@@ -12,7 +12,7 @@ function TransactionDialog({ tx, title, workingLabel, firstStepLabel = "Prepare"
12
12
  const working = phase === "preparing" || phase === "submitting" || phase === "confirming";
13
13
  const success = phase === "success";
14
14
  const failed = phase === "error";
15
- const steps = [firstStepLabel, "Submit transaction", "Confirm transaction"];
15
+ const steps = [firstStepLabel, t("Submit transaction"), t("Confirm transaction")];
16
16
  useConfetti(success);
17
17
  return /* @__PURE__ */ jsx(Dialog, { open: phase !== "idle", modal: true, onOpenChange: (open) => {
18
18
  if (!open && !working) reset();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const t = useT();\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, \"Submit transaction\", \"Confirm transaction\"];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? t(\"Waiting for block confirmation\") : t(\"Submitting transaction\")}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">{t(\"This usually takes 10–30 seconds.\")}</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10\">\n <XCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"outline\" className=\"w-full\" onClick={reset}>\n {retryable ? t(\"Try again\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,eAAe,EAAE,gCAAgC,IAAI,EAAE,wBAAwB,GAC5F;AAAA,aACF;AAAA,UACA,oBAAC,QAAG,WAAU,uEACX,gBAAM,IAAI,CAAC,OAAO,MAAM;AACvB,kBAAM,SAAS,MAAM,YAAY,KAAK;AACtC,kBAAM,OAAO,IAAI,YAAY,KAAK;AAClC,mBACE,qBAAC,QAAe,aAAS,MAAC,gBAAc,SAAS,SAAS,QAAW,WAAU,2BAC5E;AAAA,qBACC,oBAAC,gBAAa,WAAU,qCAAoC,IAC1D,SACF,oBAAC,WAAQ,WAAU,8CAA6C,IAEhE,oBAAC,SAAI,WAAU,qEAAoE;AAAA,cAErF,oBAAC,UAAK,WAAW,OAAO,4BAA4B,SAAS,qCAAqC,iCAC/F,iBACH;AAAA,iBAVO,KAWT;AAAA,UAEJ,CAAC,GACH;AAAA,UACA,oBAAC,OAAE,WAAU,6CAA6C,YAAE,wCAAmC,GAAE;AAAA,WACnG;AAAA,QAGD,WAAW;AAAA,QAEX,UACC,qBAAC,SAAI,WAAU,yCACb;AAAA,8BAAC,SAAI,WAAU,6EACb,8BAAC,WAAQ,WAAU,4BAA2B,GAChD;AAAA,UACA,qBAAC,SAAI,WAAU,yBACb;AAAA,gCAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,oBAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,oBAAC,UAAO,SAAQ,WAAU,WAAU,UAAS,SAAS,OACnD,sBAAY,EAAE,WAAW,IAAI,EAAE,OAAO,GACzC;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const t = useT();\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, t(\"Submit transaction\"), t(\"Confirm transaction\")];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? t(\"Waiting for block confirmation\") : t(\"Submitting transaction\")}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">{t(\"This usually takes 10–30 seconds.\")}</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10\">\n <XCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"outline\" className=\"w-full\" onClick={reset}>\n {retryable ? t(\"Try again\") : t(\"Close\")}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAsCQ,cAOI,YAPJ;AAnCR,SAAS,cAAc,SAAS,eAAe;AAC/C,SAAS,QAAQ,eAAe,mBAAmB;AACnD,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAE5B,SAAS,YAAY;AAUrB,MAAM,cAAc,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,EAAE;AAE1D,SAAS,kBAAkB,EAAE,IAAI,OAAO,cAAc,iBAAiB,WAAW,SAAS,GAA2B;AAC3H,QAAM,IAAI,KAAK;AACf,QAAM,EAAE,OAAO,OAAO,OAAO,YAAY,KAAK,IAAI;AAClD,QAAM,UAAU,UAAU,eAAe,UAAU,gBAAgB,UAAU;AAC7E,QAAM,UAAU,UAAU;AAC1B,QAAM,SAAS,UAAU;AACzB,QAAM,QAAQ,CAAC,gBAAgB,EAAE,oBAAoB,GAAG,EAAE,qBAAqB,CAAC;A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G;AAAA,QAGD,WAAW;AAAA,QAEX,UACC,qBAAC,SAAI,WAAU,yCACb;AAAA,8BAAC,SAAI,WAAU,6EACb,8BAAC,WAAQ,WAAU,4BAA2B,GAChD;AAAA,UACA,qBAAC,SAAI,WAAU,yBACb;AAAA,gCAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,oBAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,oBAAC,UAAO,SAAQ,WAAU,WAAU,UAAS,SAAS,OACnD,sBAAY,EAAE,WAAW,IAAI,EAAE,OAAO,GACzC;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
@@ -84,7 +84,7 @@ function TransferCollectionOwnership({ collectionId, currentOwner, collectionNam
84
84
  confirming ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
85
85
  import_marketplace_dialog_primitives.MarketplaceConfirmStep,
86
86
  {
87
- description: `Transfer ownership to ${(0, import_address.shortenAddress)(trimmed)}?`,
87
+ description: t("Transfer ownership to {address}?", { address: (0, import_address.shortenAddress)(trimmed) }),
88
88
  secondaryLabel: t("Back"),
89
89
  onSecondary: () => setConfirming(false),
90
90
  primaryLabel: t("Transfer ownership"),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transfer-collection-ownership.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { UserRoundCog } from \"lucide-react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { Button } from \"./button.js\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Input } from \"./input.js\";\nimport { Label } from \"./label.js\";\nimport { MarketplaceConfirmStep } from \"./marketplace-dialog-primitives.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransferCollectionOwnershipProps {\n collectionId: string;\n currentOwner: string;\n collectionName?: string | null;\n onTransferred?: () => void;\n}\n\nexport function TransferCollectionOwnership({ collectionId, currentOwner, collectionName, onTransferred }: TransferCollectionOwnershipProps) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [open, setOpen] = useState(false);\n const [confirming, setConfirming] = useState(false);\n const [newOwner, setNewOwner] = useState(\"\");\n\n const trimmed = newOwner.trim();\n const isValid = /^0x[0-9a-fA-F]{1,64}$/.test(trimmed);\n const wouldNoop = isValid && normalizeAddress(\"STARKNET\", trimmed) === normalizeAddress(\"STARKNET\", currentOwner);\n\n const close = () => {\n setOpen(false);\n setConfirming(false);\n };\n\n const transfer = () => {\n close();\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () =>\n app.getClient().createIntent(\"transfer-collection-ownership\", { owner: signer.address, collectionId: String(collectionId), newOwner: trimmed }),\n );\n })\n .then((ok) => {\n if (ok) onTransferred?.();\n });\n };\n\n return (\n <>\n <Button variant=\"outline\" size=\"sm\" className=\"gap-2\" onClick={() => { setNewOwner(\"\"); setOpen(true); }}>\n <UserRoundCog className=\"h-4 w-4\" />\n {t(\"Transfer ownership\")}\n </Button>\n\n <Dialog open={open} onOpenChange={(next) => { if (!next) close(); }}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl\">\n <DialogTitle className=\"sr-only\">{t(\"Transfer ownership of\")} {collectionName ?? t(\"collection\")}</DialogTitle>\n <DialogDescription className=\"sr-only\">{t(\"Transfer the on-chain owner of this collection. Existing tokens are unaffected.\")}</DialogDescription>\n\n {confirming ? (\n <MarketplaceConfirmStep\n description={`Transfer ownership to ${shortenAddress(trimmed)}?`}\n secondaryLabel={t(\"Back\")}\n onSecondary={() => setConfirming(false)}\n primaryLabel={t(\"Transfer ownership\")}\n onPrimary={transfer}\n primaryIcon={<UserRoundCog className=\"h-4 w-4\" />}\n />\n ) : (\n <div className=\"p-6 space-y-4\">\n <div className=\"flex items-center gap-2\">\n <UserRoundCog className=\"h-5 w-5\" />\n <p className=\"font-bold text-lg\">{t(\"Transfer collection ownership\")}</p>\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"The new owner will control minting and future ownership transfers for this collection. Existing tokens are unaffected.\")}\n </p>\n <div className=\"space-y-2\">\n <Label htmlFor=\"new-owner\">{t(\"New owner address\")}</Label>\n <Input\n id=\"new-owner\"\n placeholder=\"0x…\"\n value={newOwner}\n onChange={(e) => setNewOwner(e.target.value)}\n className=\"tabular-nums text-sm\"\n spellCheck={false}\n autoComplete=\"off\"\n />\n {trimmed && !isValid && <p className=\"text-xs text-red-500\">{t(\"Not a valid Starknet address.\")}</p>}\n {wouldNoop && <p className=\"text-xs text-amber-500\">{t(\"This is already the current owner.\")}</p>}\n </div>\n <div className=\"flex gap-2 pt-2\">\n <Button variant=\"ghost\" className=\"flex-1\" onClick={close}>\n {t(\"Cancel\")}\n </Button>\n <Button className=\"flex-1\" onClick={() => setConfirming(true)} disabled={!isValid || wouldNoop || !app.walletAddress}>\n {t(\"Continue\")}\n </Button>\n </div>\n </div>\n )}\n </DialogContent>\n </Dialog>\n\n <TransactionDialog tx={tx} title={t(\"Transfer ownership\")} workingLabel=\"Transferring ownership…\" firstStepLabel=\"Prepare transfer\">\n <TransactionSuccess\n name={collectionName ?? \"Collection\"}\n {...successMessages.ownershipTransferred({ name: collectionName ?? \"the collection\", to: shortenAddress(trimmed) }, t)}\n txHash={tx.txHash}\n actions={[{ label: t(\"Done\"), onClick: tx.reset }]}\n />\n </TransactionDialog>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyDI;AAvDJ,mBAAyB;AACzB,0BAA6B;AAC7B,iBAAiC;AACj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/F;AAAA,QACA,6CAAC,SAAI,WAAU,mBACb;AAAA,sDAAC,wBAAO,SAAQ,SAAQ,WAAU,UAAS,SAAS,OACjD,YAAE,QAAQ,GACb;AAAA,UACA,4CAAC,wBAAO,WAAU,UAAS,SAAS,MAAM,cAAc,IAAI,GAAG,UAAU,CAAC,WAAW,aAAa,CAAC,IAAI,eACpG,YAAE,UAAU,GACf;AAAA,WACF;AAAA,SACF;AAAA,OAEJ,GACF;AAAA,IAEA,4CAAC,+CAAkB,IAAQ,OAAO,EAAE,oBAAoB,GAAG,cAAa,gCAA0B,gBAAe,oBAC/G;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,kBAAkB;AAAA,QACvB,GAAG,wCAAgB,qBAAqB,EAAE,MAAM,kBAAkB,kBAAkB,QAAI,+BAAe,OAAO,EAAE,GAAG,CAAC;AAAA,QACrH,QAAQ,GAAG;AAAA,QACX,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAAA;AAAA,IACnD,GACF;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transfer-collection-ownership.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { UserRoundCog } from \"lucide-react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { Button } from \"./button.js\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Input } from \"./input.js\";\nimport { Label } from \"./label.js\";\nimport { MarketplaceConfirmStep } from \"./marketplace-dialog-primitives.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransferCollectionOwnershipProps {\n collectionId: string;\n currentOwner: string;\n collectionName?: string | null;\n onTransferred?: () => void;\n}\n\nexport function TransferCollectionOwnership({ collectionId, currentOwner, collectionName, onTransferred }: TransferCollectionOwnershipProps) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [open, setOpen] = useState(false);\n const [confirming, setConfirming] = useState(false);\n const [newOwner, setNewOwner] = useState(\"\");\n\n const trimmed = newOwner.trim();\n const isValid = /^0x[0-9a-fA-F]{1,64}$/.test(trimmed);\n const wouldNoop = isValid && normalizeAddress(\"STARKNET\", trimmed) === normalizeAddress(\"STARKNET\", currentOwner);\n\n const close = () => {\n setOpen(false);\n setConfirming(false);\n };\n\n const transfer = () => {\n close();\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () =>\n app.getClient().createIntent(\"transfer-collection-ownership\", { owner: signer.address, collectionId: String(collectionId), newOwner: trimmed }),\n );\n })\n .then((ok) => {\n if (ok) onTransferred?.();\n });\n };\n\n return (\n <>\n <Button variant=\"outline\" size=\"sm\" className=\"gap-2\" onClick={() => { setNewOwner(\"\"); setOpen(true); }}>\n <UserRoundCog className=\"h-4 w-4\" />\n {t(\"Transfer ownership\")}\n </Button>\n\n <Dialog open={open} onOpenChange={(next) => { if (!next) close(); }}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl\">\n <DialogTitle className=\"sr-only\">{t(\"Transfer ownership of\")} {collectionName ?? t(\"collection\")}</DialogTitle>\n <DialogDescription className=\"sr-only\">{t(\"Transfer the on-chain owner of this collection. Existing tokens are unaffected.\")}</DialogDescription>\n\n {confirming ? (\n <MarketplaceConfirmStep\n description={t(\"Transfer ownership to {address}?\", { address: shortenAddress(trimmed) })}\n secondaryLabel={t(\"Back\")}\n onSecondary={() => setConfirming(false)}\n primaryLabel={t(\"Transfer ownership\")}\n onPrimary={transfer}\n primaryIcon={<UserRoundCog className=\"h-4 w-4\" />}\n />\n ) : (\n <div className=\"p-6 space-y-4\">\n <div className=\"flex items-center gap-2\">\n <UserRoundCog className=\"h-5 w-5\" />\n <p className=\"font-bold text-lg\">{t(\"Transfer collection ownership\")}</p>\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"The new owner will control minting and future ownership transfers for this collection. Existing tokens are unaffected.\")}\n </p>\n <div className=\"space-y-2\">\n <Label htmlFor=\"new-owner\">{t(\"New owner address\")}</Label>\n <Input\n id=\"new-owner\"\n placeholder=\"0x…\"\n value={newOwner}\n onChange={(e) => setNewOwner(e.target.value)}\n className=\"tabular-nums text-sm\"\n spellCheck={false}\n autoComplete=\"off\"\n />\n {trimmed && !isValid && <p className=\"text-xs text-red-500\">{t(\"Not a valid Starknet address.\")}</p>}\n {wouldNoop && <p className=\"text-xs text-amber-500\">{t(\"This is already the current owner.\")}</p>}\n </div>\n <div className=\"flex gap-2 pt-2\">\n <Button variant=\"ghost\" className=\"flex-1\" onClick={close}>\n {t(\"Cancel\")}\n </Button>\n <Button className=\"flex-1\" onClick={() => setConfirming(true)} disabled={!isValid || wouldNoop || !app.walletAddress}>\n {t(\"Continue\")}\n </Button>\n </div>\n </div>\n )}\n </DialogContent>\n </Dialog>\n\n <TransactionDialog tx={tx} title={t(\"Transfer ownership\")} workingLabel=\"Transferring ownership…\" firstStepLabel=\"Prepare transfer\">\n <TransactionSuccess\n name={collectionName ?? \"Collection\"}\n {...successMessages.ownershipTransferred({ name: collectionName ?? \"the collection\", to: shortenAddress(trimmed) }, t)}\n txHash={tx.txHash}\n actions={[{ label: t(\"Done\"), onClick: tx.reset }]}\n />\n </TransactionDialog>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyDI;AAvDJ,mBAAyB;AACzB,0BAA6B;AAC7B,iBAAiC;AACjC,oBAAuB;AACvB,oBAAsE;AACtE,mBAAsB;AACtB,mBAAsB;AACtB,2CAAuC;AACvC,2BAAgC;AAChC,gCAAkC;A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AAU,UAAS,SAAS,OACjD,YAAE,QAAQ,GACb;AAAA,UACA,4CAAC,wBAAO,WAAU,UAAS,SAAS,MAAM,cAAc,IAAI,GAAG,UAAU,CAAC,WAAW,aAAa,CAAC,IAAI,eACpG,YAAE,UAAU,GACf;AAAA,WACF;AAAA,SACF;AAAA,OAEJ,GACF;AAAA,IAEA,4CAAC,+CAAkB,IAAQ,OAAO,EAAE,oBAAoB,GAAG,cAAa,gCAA0B,gBAAe,oBAC/G;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,kBAAkB;AAAA,QACvB,GAAG,wCAAgB,qBAAqB,EAAE,MAAM,kBAAkB,kBAAkB,QAAI,+BAAe,OAAO,EAAE,GAAG,CAAC;AAAA,QACrH,QAAQ,GAAG;AAAA,QACX,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAAA;AAAA,IACnD,GACF;AAAA,KACF;AAEJ;","names":[]}
@@ -61,7 +61,7 @@ function TransferCollectionOwnership({ collectionId, currentOwner, collectionNam
61
61
  confirming ? /* @__PURE__ */ jsx(
62
62
  MarketplaceConfirmStep,
63
63
  {
64
- description: `Transfer ownership to ${shortenAddress(trimmed)}?`,
64
+ description: t("Transfer ownership to {address}?", { address: shortenAddress(trimmed) }),
65
65
  secondaryLabel: t("Back"),
66
66
  onSecondary: () => setConfirming(false),
67
67
  primaryLabel: t("Transfer ownership"),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transfer-collection-ownership.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { UserRoundCog } from \"lucide-react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { Button } from \"./button.js\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Input } from \"./input.js\";\nimport { Label } from \"./label.js\";\nimport { MarketplaceConfirmStep } from \"./marketplace-dialog-primitives.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransferCollectionOwnershipProps {\n collectionId: string;\n currentOwner: string;\n collectionName?: string | null;\n onTransferred?: () => void;\n}\n\nexport function TransferCollectionOwnership({ collectionId, currentOwner, collectionName, onTransferred }: TransferCollectionOwnershipProps) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [open, setOpen] = useState(false);\n const [confirming, setConfirming] = useState(false);\n const [newOwner, setNewOwner] = useState(\"\");\n\n const trimmed = newOwner.trim();\n const isValid = /^0x[0-9a-fA-F]{1,64}$/.test(trimmed);\n const wouldNoop = isValid && normalizeAddress(\"STARKNET\", trimmed) === normalizeAddress(\"STARKNET\", currentOwner);\n\n const close = () => {\n setOpen(false);\n setConfirming(false);\n };\n\n const transfer = () => {\n close();\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () =>\n app.getClient().createIntent(\"transfer-collection-ownership\", { owner: signer.address, collectionId: String(collectionId), newOwner: trimmed }),\n );\n })\n .then((ok) => {\n if (ok) onTransferred?.();\n });\n };\n\n return (\n <>\n <Button variant=\"outline\" size=\"sm\" className=\"gap-2\" onClick={() => { setNewOwner(\"\"); setOpen(true); }}>\n <UserRoundCog className=\"h-4 w-4\" />\n {t(\"Transfer ownership\")}\n </Button>\n\n <Dialog open={open} onOpenChange={(next) => { if (!next) close(); }}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl\">\n <DialogTitle className=\"sr-only\">{t(\"Transfer ownership of\")} {collectionName ?? t(\"collection\")}</DialogTitle>\n <DialogDescription className=\"sr-only\">{t(\"Transfer the on-chain owner of this collection. Existing tokens are unaffected.\")}</DialogDescription>\n\n {confirming ? (\n <MarketplaceConfirmStep\n description={`Transfer ownership to ${shortenAddress(trimmed)}?`}\n secondaryLabel={t(\"Back\")}\n onSecondary={() => setConfirming(false)}\n primaryLabel={t(\"Transfer ownership\")}\n onPrimary={transfer}\n primaryIcon={<UserRoundCog className=\"h-4 w-4\" />}\n />\n ) : (\n <div className=\"p-6 space-y-4\">\n <div className=\"flex items-center gap-2\">\n <UserRoundCog className=\"h-5 w-5\" />\n <p className=\"font-bold text-lg\">{t(\"Transfer collection ownership\")}</p>\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"The new owner will control minting and future ownership transfers for this collection. Existing tokens are unaffected.\")}\n </p>\n <div className=\"space-y-2\">\n <Label htmlFor=\"new-owner\">{t(\"New owner address\")}</Label>\n <Input\n id=\"new-owner\"\n placeholder=\"0x…\"\n value={newOwner}\n onChange={(e) => setNewOwner(e.target.value)}\n className=\"tabular-nums text-sm\"\n spellCheck={false}\n autoComplete=\"off\"\n />\n {trimmed && !isValid && <p className=\"text-xs text-red-500\">{t(\"Not a valid Starknet address.\")}</p>}\n {wouldNoop && <p className=\"text-xs text-amber-500\">{t(\"This is already the current owner.\")}</p>}\n </div>\n <div className=\"flex gap-2 pt-2\">\n <Button variant=\"ghost\" className=\"flex-1\" onClick={close}>\n {t(\"Cancel\")}\n </Button>\n <Button className=\"flex-1\" onClick={() => setConfirming(true)} disabled={!isValid || wouldNoop || !app.walletAddress}>\n {t(\"Continue\")}\n </Button>\n </div>\n </div>\n )}\n </DialogContent>\n </Dialog>\n\n <TransactionDialog tx={tx} title={t(\"Transfer ownership\")} workingLabel=\"Transferring ownership…\" firstStepLabel=\"Prepare transfer\">\n <TransactionSuccess\n name={collectionName ?? \"Collection\"}\n {...successMessages.ownershipTransferred({ name: collectionName ?? \"the collection\", to: shortenAddress(trimmed) }, t)}\n txHash={tx.txHash}\n actions={[{ label: t(\"Done\"), onClick: tx.reset }]}\n />\n </TransactionDialog>\n </>\n );\n}\n"],"m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Aa;AAAA;AAAA,UACf;AAAA,UACC,WAAW,CAAC,WAAW,oBAAC,OAAE,WAAU,wBAAwB,YAAE,+BAA+B,GAAE;AAAA,UAC/F,aAAa,oBAAC,OAAE,WAAU,0BAA0B,YAAE,oCAAoC,GAAE;AAAA,WAC/F;AAAA,QACA,qBAAC,SAAI,WAAU,mBACb;AAAA,8BAAC,UAAO,SAAQ,SAAQ,WAAU,UAAS,SAAS,OACjD,YAAE,QAAQ,GACb;AAAA,UACA,oBAAC,UAAO,WAAU,UAAS,SAAS,MAAM,cAAc,IAAI,GAAG,UAAU,CAAC,WAAW,aAAa,CAAC,IAAI,eACpG,YAAE,UAAU,GACf;AAAA,WACF;AAAA,SACF;AAAA,OAEJ,GACF;AAAA,IAEA,oBAAC,qBAAkB,IAAQ,OAAO,EAAE,oBAAoB,GAAG,cAAa,gCAA0B,gBAAe,oBAC/G;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,kBAAkB;AAAA,QACvB,GAAG,gBAAgB,qBAAqB,EAAE,MAAM,kBAAkB,kBAAkB,IAAI,eAAe,OAAO,EAAE,GAAG,CAAC;AAAA,QACrH,QAAQ,GAAG;AAAA,QACX,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAAA;AAAA,IACnD,GACF;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transfer-collection-ownership.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { UserRoundCog } from \"lucide-react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { Button } from \"./button.js\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Input } from \"./input.js\";\nimport { Label } from \"./label.js\";\nimport { MarketplaceConfirmStep } from \"./marketplace-dialog-primitives.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransferCollectionOwnershipProps {\n collectionId: string;\n currentOwner: string;\n collectionName?: string | null;\n onTransferred?: () => void;\n}\n\nexport function TransferCollectionOwnership({ collectionId, currentOwner, collectionName, onTransferred }: TransferCollectionOwnershipProps) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [open, setOpen] = useState(false);\n const [confirming, setConfirming] = useState(false);\n const [newOwner, setNewOwner] = useState(\"\");\n\n const trimmed = newOwner.trim();\n const isValid = /^0x[0-9a-fA-F]{1,64}$/.test(trimmed);\n const wouldNoop = isValid && normalizeAddress(\"STARKNET\", trimmed) === normalizeAddress(\"STARKNET\", currentOwner);\n\n const close = () => {\n setOpen(false);\n setConfirming(false);\n };\n\n const transfer = () => {\n close();\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () =>\n app.getClient().createIntent(\"transfer-collection-ownership\", { owner: signer.address, collectionId: String(collectionId), newOwner: trimmed }),\n );\n })\n .then((ok) => {\n if (ok) onTransferred?.();\n });\n };\n\n return (\n <>\n <Button variant=\"outline\" size=\"sm\" className=\"gap-2\" onClick={() => { setNewOwner(\"\"); setOpen(true); }}>\n <UserRoundCog className=\"h-4 w-4\" />\n {t(\"Transfer ownership\")}\n </Button>\n\n <Dialog open={open} onOpenChange={(next) => { if (!next) close(); }}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl\">\n <DialogTitle className=\"sr-only\">{t(\"Transfer ownership of\")} {collectionName ?? t(\"collection\")}</DialogTitle>\n <DialogDescription className=\"sr-only\">{t(\"Transfer the on-chain owner of this collection. Existing tokens are unaffected.\")}</DialogDescription>\n\n {confirming ? (\n <MarketplaceConfirmStep\n description={t(\"Transfer ownership to {address}?\", { address: shortenAddress(trimmed) })}\n secondaryLabel={t(\"Back\")}\n onSecondary={() => setConfirming(false)}\n primaryLabel={t(\"Transfer ownership\")}\n onPrimary={transfer}\n primaryIcon={<UserRoundCog className=\"h-4 w-4\" />}\n />\n ) : (\n <div className=\"p-6 space-y-4\">\n <div className=\"flex items-center gap-2\">\n <UserRoundCog className=\"h-5 w-5\" />\n <p className=\"font-bold text-lg\">{t(\"Transfer collection ownership\")}</p>\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"The new owner will control minting and future ownership transfers for this collection. Existing tokens are unaffected.\")}\n </p>\n <div className=\"space-y-2\">\n <Label htmlFor=\"new-owner\">{t(\"New owner address\")}</Label>\n <Input\n id=\"new-owner\"\n placeholder=\"0x…\"\n value={newOwner}\n onChange={(e) => setNewOwner(e.target.value)}\n className=\"tabular-nums text-sm\"\n spellCheck={false}\n autoComplete=\"off\"\n />\n {trimmed && !isValid && <p className=\"text-xs text-red-500\">{t(\"Not a valid Starknet address.\")}</p>}\n {wouldNoop && <p className=\"text-xs text-amber-500\">{t(\"This is already the current owner.\")}</p>}\n </div>\n <div className=\"flex gap-2 pt-2\">\n <Button variant=\"ghost\" className=\"flex-1\" onClick={close}>\n {t(\"Cancel\")}\n </Button>\n <Button className=\"flex-1\" onClick={() => setConfirming(true)} disabled={!isValid || wouldNoop || !app.walletAddress}>\n {t(\"Continue\")}\n </Button>\n </div>\n </div>\n )}\n </DialogContent>\n </Dialog>\n\n <TransactionDialog tx={tx} title={t(\"Transfer ownership\")} workingLabel=\"Transferring ownership…\" firstStepLabel=\"Prepare transfer\">\n <TransactionSuccess\n name={collectionName ?? \"Collection\"}\n {...successMessages.ownershipTransferred({ name: collectionName ?? \"the collection\", to: shortenAddress(trimmed) }, t)}\n txHash={tx.txHash}\n actions={[{ label: t(\"Done\"), onClick: tx.reset }]}\n />\n </TransactionDialog>\n </>\n );\n}\n"],"mappings":";AAyDI,mBAEI,KADF,YADF;AAvDJ,SAAS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;AAAA,UACC,WAAW,CAAC,WAAW,oBAAC,OAAE,WAAU,wBAAwB,YAAE,+BAA+B,GAAE;AAAA,UAC/F,aAAa,oBAAC,OAAE,WAAU,0BAA0B,YAAE,oCAAoC,GAAE;AAAA,WAC/F;AAAA,QACA,qBAAC,SAAI,WAAU,mBACb;AAAA,8BAAC,UAAO,SAAQ,SAAQ,WAAU,UAAS,SAAS,OACjD,YAAE,QAAQ,GACb;AAAA,UACA,oBAAC,UAAO,WAAU,UAAS,SAAS,MAAM,cAAc,IAAI,GAAG,UAAU,CAAC,WAAW,aAAa,CAAC,IAAI,eACpG,YAAE,UAAU,GACf;AAAA,WACF;AAAA,SACF;AAAA,OAEJ,GACF;AAAA,IAEA,oBAAC,qBAAkB,IAAQ,OAAO,EAAE,oBAAoB,GAAG,cAAa,gCAA0B,gBAAe,oBAC/G;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,kBAAkB;AAAA,QACvB,GAAG,gBAAgB,qBAAqB,EAAE,MAAM,kBAAkB,kBAAkB,IAAI,eAAe,OAAO,EAAE,GAAG,CAAC;AAAA,QACrH,QAAQ,GAAG;AAAA,QACX,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAAA;AAAA,IACnD,GACF;AAAA,KACF;AAEJ;","names":[]}
@@ -91,7 +91,7 @@ function SelfFundConsentDialog({ consent }) {
91
91
  onClick: () => respond(true),
92
92
  disabled: notEnough,
93
93
  className: "px-4 py-2 rounded-lg text-sm font-medium bg-primary text-primary-foreground hover:opacity-90 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed",
94
- children: label ? `Pay ${label}` : t("Pay from my wallet")
94
+ children: label ? t("Pay {label}", { label }) : t("Pay from my wallet")
95
95
  }
96
96
  )
97
97
  ] })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/wallet/self-fund-consent-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { formatAmount } from \"@medialane/sdk\";\nimport type { SelfFundConsent, SelfFundFeeEstimate } from \"@medialane/sdk/starknet\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"../dialog.js\";\nimport { useT } from \"../../i18n/provider.js\";\n\ninterface PendingRequest {\n resolve: (consented: boolean) => void;\n feeEstimate: SelfFundFeeEstimate | null | \"loading\";\n}\n\nfunction amountLabel(raw: bigint, unit: string): string {\n const [whole, fraction = \"\"] = formatAmount(raw.toString(), 18).split(\".\");\n const trimmed = fraction.slice(0, 6).replace(/0+$/, \"\");\n const amount = trimmed ? `${whole}.${trimmed}` : whole;\n return `${amount} ${unit === \"FRI\" ? \"STRK\" : \"ETH\"}`;\n}\n\nexport function feeLabelFor(estimate: SelfFundFeeEstimate | null | \"loading\"): string | null {\n if (estimate === \"loading\" || estimate == null) return null;\n return amountLabel(estimate.feeRaw, estimate.unit);\n}\n\nexport function SelfFundConsentDialog({ consent }: { consent: SelfFundConsent }) {\n const t = useT();\n const [pending, setPending] = useState<PendingRequest | null>(null);\n\n useEffect(() => {\n consent.registerHandler((feeEstimatePromise) => {\n return new Promise<boolean>((resolve) => {\n setPending({ resolve, feeEstimate: \"loading\" });\n void feeEstimatePromise.then((feeEstimate) => {\n setPending((current) => (current ? { ...current, feeEstimate } : current));\n });\n });\n });\n return () => consent.registerHandler(null);\n }, [consent]);\n\n const respond = (consented: boolean) => {\n pending?.resolve(consented);\n setPending(null);\n };\n\n const label = feeLabelFor(pending?.feeEstimate ?? null);\n const estimate = pending?.feeEstimate && pending.feeEstimate !== \"loading\" ? pending.feeEstimate : null;\n const balanceLabel = estimate?.balanceRaw != null ? amountLabel(estimate.balanceRaw, estimate.unit) : null;\n const notEnough = estimate?.balanceRaw != null && estimate.balanceRaw < estimate.feeRaw;\n\n return (\n <Dialog open={pending !== null} onOpenChange={(next) => { if (!next) respond(false); }}>\n <DialogContent className=\"sm:max-w-md\">\n <DialogTitle>{t(\"Network fee needed\")}</DialogTitle>\n <DialogDescription>\n {t(\"Sponsored transactions are unavailable. You can pay with your wallet balance.\")}\n </DialogDescription>\n <div className=\"rounded-lg bg-muted px-4 py-3 flex items-center justify-between\">\n <span className=\"text-sm text-muted-foreground\">{t(\"Network fee\")}</span>\n <span className=\"text-sm font-semibold\">{label ? `≈ ${label}` : t(\"Estimating…\")}</span>\n </div>\n {balanceLabel && (\n <div className=\"flex items-center justify-between px-4\">\n <span className=\"text-sm text-muted-foreground\">{t(\"Your balance\")}</span>\n <span className=\"text-sm font-semibold\">{balanceLabel}</span>\n </div>\n )}\n {notEnough && (\n <p className=\"text-sm text-destructive\">\n {t(\"You don't have enough to pay this fee. Try again later, when Medialane can cover it.\")}\n </p>\n )}\n <div className=\"flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => respond(false)}\n className=\"px-4 py-2 rounded-lg text-sm font-medium text-muted-foreground hover:bg-muted transition-colors\"\n >\n {t(\"Try again later\")}\n </button>\n <button\n type=\"button\"\n onClick={() => respond(true)}\n disabled={notEnough}\n className=\"px-4 py-2 rounded-lg text-sm font-medium bg-primary text-primary-foreground hover:opacity-90 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n {label ? `Pay ${label}` : t(\"Pay from my wallet\")}\n </button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsDQ;AApDR,mBAAoC;AACpC,iBAA6B;AAE7B,oBAAsE;AACtE,sBAAqB;AAOrB,SAAS,YAAY,KAAa,MAAsB;AACtD,QAAM,CAAC,OAAO,WAAW,EAAE,QAAI,yBAAa,IAAI,SAAS,GAAG,EAAE,EAAE,MAAM,GAAG;AACzE,QAAM,UAAU,SAAS,MAAM,GAAG,CAAC,EAAE,QAAQ,OAAO,EAAE;AACtD,QAAM,SAAS,UAAU,GAAG,KAAK,IAAI,OAAO,KAAK;AACjD,SAAO,GAAG,MAAM,IAAI,SAAS,QAAQ,SAAS,KAAK;A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,iCAAiC,YAAE,aAAa,GAAE;AAAA,MAClE,4CAAC,UAAK,WAAU,yBAAyB,kBAAQ,UAAK,KAAK,KAAK,EAAE,kBAAa,GAAE;AAAA,OACnF;AAAA,IACC,gBACC,6CAAC,SAAI,WAAU,0CACb;AAAA,kDAAC,UAAK,WAAU,iCAAiC,YAAE,cAAc,GAAE;AAAA,MACnE,4CAAC,UAAK,WAAU,yBAAyB,wBAAa;AAAA,OACxD;AAAA,IAED,aACC,4CAAC,OAAE,WAAU,4BACV,YAAE,sFAAsF,GAC3F;AAAA,IAEF,6CAAC,SAAI,WAAU,0BACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAM,QAAQ,KAAK;AAAA,UAC5B,WAAU;AAAA,UAET,YAAE,iBAAiB;AAAA;AAAA,MACtB;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAM,QAAQ,IAAI;AAAA,UAC3B,UAAU;AAAA,UACV,WAAU;AAAA,UAET,kBAAQ,OAAO,KAAK,KAAK,EAAE,oBAAoB;AAAA;AAAA,MAClD;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/wallet/self-fund-consent-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { formatAmount } from \"@medialane/sdk\";\nimport type { SelfFundConsent, SelfFundFeeEstimate } from \"@medialane/sdk/starknet\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"../dialog.js\";\nimport { useT } from \"../../i18n/provider.js\";\n\ninterface PendingRequest {\n resolve: (consented: boolean) => void;\n feeEstimate: SelfFundFeeEstimate | null | \"loading\";\n}\n\nfunction amountLabel(raw: bigint, unit: string): string {\n const [whole, fraction = \"\"] = formatAmount(raw.toString(), 18).split(\".\");\n const trimmed = fraction.slice(0, 6).replace(/0+$/, \"\");\n const amount = trimmed ? `${whole}.${trimmed}` : whole;\n return `${amount} ${unit === \"FRI\" ? \"STRK\" : \"ETH\"}`;\n}\n\nexport function feeLabelFor(estimate: SelfFundFeeEstimate | null | \"loading\"): string | null {\n if (estimate === \"loading\" || estimate == null) return null;\n return amountLabel(estimate.feeRaw, estimate.unit);\n}\n\nexport function SelfFundConsentDialog({ consent }: { consent: SelfFundConsent }) {\n const t = useT();\n const [pending, setPending] = useState<PendingRequest | null>(null);\n\n useEffect(() => {\n consent.registerHandler((feeEstimatePromise) => {\n return new Promise<boolean>((resolve) => {\n setPending({ resolve, feeEstimate: \"loading\" });\n void feeEstimatePromise.then((feeEstimate) => {\n setPending((current) => (current ? { ...current, feeEstimate } : current));\n });\n });\n });\n return () => consent.registerHandler(null);\n }, [consent]);\n\n const respond = (consented: boolean) => {\n pending?.resolve(consented);\n setPending(null);\n };\n\n const label = feeLabelFor(pending?.feeEstimate ?? null);\n const estimate = pending?.feeEstimate && pending.feeEstimate !== \"loading\" ? pending.feeEstimate : null;\n const balanceLabel = estimate?.balanceRaw != null ? amountLabel(estimate.balanceRaw, estimate.unit) : null;\n const notEnough = estimate?.balanceRaw != null && estimate.balanceRaw < estimate.feeRaw;\n\n return (\n <Dialog open={pending !== null} onOpenChange={(next) => { if (!next) respond(false); }}>\n <DialogContent className=\"sm:max-w-md\">\n <DialogTitle>{t(\"Network fee needed\")}</DialogTitle>\n <DialogDescription>\n {t(\"Sponsored transactions are unavailable. You can pay with your wallet balance.\")}\n </DialogDescription>\n <div className=\"rounded-lg bg-muted px-4 py-3 flex items-center justify-between\">\n <span className=\"text-sm text-muted-foreground\">{t(\"Network fee\")}</span>\n <span className=\"text-sm font-semibold\">{label ? `≈ ${label}` : t(\"Estimating…\")}</span>\n </div>\n {balanceLabel && (\n <div className=\"flex items-center justify-between px-4\">\n <span className=\"text-sm text-muted-foreground\">{t(\"Your balance\")}</span>\n <span className=\"text-sm font-semibold\">{balanceLabel}</span>\n </div>\n )}\n {notEnough && (\n <p className=\"text-sm text-destructive\">\n {t(\"You don't have enough to pay this fee. Try again later, when Medialane can cover it.\")}\n </p>\n )}\n <div className=\"flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => respond(false)}\n className=\"px-4 py-2 rounded-lg text-sm font-medium text-muted-foreground hover:bg-muted transition-colors\"\n >\n {t(\"Try again later\")}\n </button>\n <button\n type=\"button\"\n onClick={() => respond(true)}\n disabled={notEnough}\n className=\"px-4 py-2 rounded-lg text-sm font-medium bg-primary text-primary-foreground hover:opacity-90 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n {label ? t(\"Pay {label}\", { label }) : t(\"Pay from my wallet\")}\n </button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsDQ;AApDR,mBAAoC;AACpC,iBAA6B;AAE7B,oBAAsE;AACtE,sBAAqB;AAOrB,SAAS,YAAY,KAAa,MAAsB;AACtD,QAAM,CAAC,OAAO,WAAW,EAAE,QAAI,yBAAa,IAAI,SAAS,GAAG,EAAE,EAAE,MAAM,GAAG;AACzE,QAAM,UAAU,SAAS,MAAM,GAAG,CAAC,EAAE,QAAQ,OAAO,EAAE;AACtD,QAAM,SAAS,UAAU,GAAG,KAAK,IAAI,OAAO,KAAK;AACjD,SAAO,GAAG,MAAM,IAAI,SAAS,QAAQ,SAAS,KAAK;AACrD;AAEO,SAAS,YAAY,UAAiE;AAC3F,MAAI,aAAa,aAAa,YAAY,KAAM,QAAO;AACvD,SAAO,YAAY,SAAS,QAAQ,SAAS,IAAI;AACnD;AAEO,SAAS,sBAAsB,EAAE,QAAQ,GAAiC;AAC/E,QAAM,QAAI,sBAAK;AACf,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAgC,IAAI;AAElE,8BAAU,MAAM;AACd,YAAQ,gBAAgB,CAAC,uBAAuB;AAC9C,aAAO,IAAI,QAAiB,CAAC,YAAY;AACvC,mBAAW,EAAE,SAAS,aAAa,UAA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AAU,0BACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAM,QAAQ,KAAK;AAAA,UAC5B,WAAU;AAAA,UAET,YAAE,iBAAiB;AAAA;AAAA,MACtB;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAM,QAAQ,IAAI;AAAA,UAC3B,UAAU;AAAA,UACV,WAAU;AAAA,UAET,kBAAQ,EAAE,eAAe,EAAE,MAAM,CAAC,IAAI,EAAE,oBAAoB;AAAA;AAAA,MAC/D;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -67,7 +67,7 @@ function SelfFundConsentDialog({ consent }) {
67
67
  onClick: () => respond(true),
68
68
  disabled: notEnough,
69
69
  className: "px-4 py-2 rounded-lg text-sm font-medium bg-primary text-primary-foreground hover:opacity-90 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed",
70
- children: label ? `Pay ${label}` : t("Pay from my wallet")
70
+ children: label ? t("Pay {label}", { label }) : t("Pay from my wallet")
71
71
  }
72
72
  )
73
73
  ] })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/wallet/self-fund-consent-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { formatAmount } from \"@medialane/sdk\";\nimport type { SelfFundConsent, SelfFundFeeEstimate } from \"@medialane/sdk/starknet\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"../dialog.js\";\nimport { useT } from \"../../i18n/provider.js\";\n\ninterface PendingRequest {\n resolve: (consented: boolean) => void;\n feeEstimate: SelfFundFeeEstimate | null | \"loading\";\n}\n\nfunction amountLabel(raw: bigint, unit: string): string {\n const [whole, fraction = \"\"] = formatAmount(raw.toString(), 18).split(\".\");\n const trimmed = fraction.slice(0, 6).replace(/0+$/, \"\");\n const amount = trimmed ? `${whole}.${trimmed}` : whole;\n return `${amount} ${unit === \"FRI\" ? \"STRK\" : \"ETH\"}`;\n}\n\nexport function feeLabelFor(estimate: SelfFundFeeEstimate | null | \"loading\"): string | null {\n if (estimate === \"loading\" || estimate == null) return null;\n return amountLabel(estimate.feeRaw, estimate.unit);\n}\n\nexport function SelfFundConsentDialog({ consent }: { consent: SelfFundConsent }) {\n const t = useT();\n const [pending, setPending] = useState<PendingRequest | null>(null);\n\n useEffect(() => {\n consent.registerHandler((feeEstimatePromise) => {\n return new Promise<boolean>((resolve) => {\n setPending({ resolve, feeEstimate: \"loading\" });\n void feeEstimatePromise.then((feeEstimate) => {\n setPending((current) => (current ? { ...current, feeEstimate } : current));\n });\n });\n });\n return () => consent.registerHandler(null);\n }, [consent]);\n\n const respond = (consented: boolean) => {\n pending?.resolve(consented);\n setPending(null);\n };\n\n const label = feeLabelFor(pending?.feeEstimate ?? null);\n const estimate = pending?.feeEstimate && pending.feeEstimate !== \"loading\" ? pending.feeEstimate : null;\n const balanceLabel = estimate?.balanceRaw != null ? amountLabel(estimate.balanceRaw, estimate.unit) : null;\n const notEnough = estimate?.balanceRaw != null && estimate.balanceRaw < estimate.feeRaw;\n\n return (\n <Dialog open={pending !== null} onOpenChange={(next) => { if (!next) respond(false); }}>\n <DialogContent className=\"sm:max-w-md\">\n <DialogTitle>{t(\"Network fee needed\")}</DialogTitle>\n <DialogDescription>\n {t(\"Sponsored transactions are unavailable. You can pay with your wallet balance.\")}\n </DialogDescription>\n <div className=\"rounded-lg bg-muted px-4 py-3 flex items-center justify-between\">\n <span className=\"text-sm text-muted-foreground\">{t(\"Network fee\")}</span>\n <span className=\"text-sm font-semibold\">{label ? `≈ ${label}` : t(\"Estimating…\")}</span>\n </div>\n {balanceLabel && (\n <div className=\"flex items-center justify-between px-4\">\n <span className=\"text-sm text-muted-foreground\">{t(\"Your balance\")}</span>\n <span className=\"text-sm font-semibold\">{balanceLabel}</span>\n </div>\n )}\n {notEnough && (\n <p className=\"text-sm text-destructive\">\n {t(\"You don't have enough to pay this fee. Try again later, when Medialane can cover it.\")}\n </p>\n )}\n <div className=\"flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => respond(false)}\n className=\"px-4 py-2 rounded-lg text-sm font-medium text-muted-foreground hover:bg-muted transition-colors\"\n >\n {t(\"Try again later\")}\n </button>\n <button\n type=\"button\"\n onClick={() => respond(true)}\n disabled={notEnough}\n className=\"px-4 py-2 rounded-lg text-sm font-medium bg-primary text-primary-foreground hover:opacity-90 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n {label ? `Pay ${label}` : t(\"Pay from my wallet\")}\n </button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAsDQ,cAIA,YAJA;AApDR,SAAS,WAAW,gBAAgB;AACpC,SAAS,oBAAoB;AAE7B,SAAS,QAAQ,eAAe,mBAAmB,mBAAmB;AACtE,SAAS,YAAY;AAOrB,SAAS,YAAY,KAAa,MAAsB;AACtD,QAAM,CAAC,OAAO,WAAW,EAAE,IAAI,aAAa,IAAI,SAAS,GAAG,EAAE,EAAE,MAAM,GAAG;AACzE,QAAM,UAAU,SAAS,MAAM,GAAG,CAAC,EAAE,QAAQ,OAAO,EAAE;AACtD,QAAM,SAAS,UAAU,GAAG,KAAK,IAAI,OAAO,KAAK;AACjD,SAAO,GAAG,MAAM,IAAI,SAAS,QAAQ,SAAS,KAAK;AACrD;AAEO,SAAS,YAAY,UAAiE;AAC3F,MAAI,aAAa,aAAa,YAAY,KAAM,QAAO;AACvD,SAAO,YAAY,SAAS,QAAQ,SAAS,IAAI;AACnD;AAEO,SAAS,sBAAsB,EAAE,QAAQ,GAAiC;AAC/E,QAAM,IAAI,KAAK;AACf,QAAM,CAAC,SAAS,UAAU,IAAI,SAAgC,IAAI;AAElE,YAAU,MAAM;AACd,YAAQ,gBAAgB,CAAC,uBAAuB;AAC9C,aAAO,IAAI,QAAiB,CAAC,YAAY;AACvC,mBAAW,EAAE,SAAS,aAAa,UAAU,CAAC;AAC9C,aAAK,mBAAmB,KAAK,CAAC,gBAAgB;AAC5C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ACL,SAAS,MAAM,QAAQ,KAAK;AAAA,UAC5B,WAAU;AAAA,UAET,YAAE,iBAAiB;AAAA;AAAA,MACtB;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAS,MAAM,QAAQ,IAAI;AAAA,UAC3B,UAAU;AAAA,UACV,WAAU;AAAA,UAET,kBAAQ,OAAO,KAAK,KAAK,EAAE,oBAAoB;AAAA;AAAA,MAClD;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/wallet/self-fund-consent-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { formatAmount } from \"@medialane/sdk\";\nimport type { SelfFundConsent, SelfFundFeeEstimate } from \"@medialane/sdk/starknet\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"../dialog.js\";\nimport { useT } from \"../../i18n/provider.js\";\n\ninterface PendingRequest {\n resolve: (consented: boolean) => void;\n feeEstimate: SelfFundFeeEstimate | null | \"loading\";\n}\n\nfunction amountLabel(raw: bigint, unit: string): string {\n const [whole, fraction = \"\"] = formatAmount(raw.toString(), 18).split(\".\");\n const trimmed = fraction.slice(0, 6).replace(/0+$/, \"\");\n const amount = trimmed ? `${whole}.${trimmed}` : whole;\n return `${amount} ${unit === \"FRI\" ? \"STRK\" : \"ETH\"}`;\n}\n\nexport function feeLabelFor(estimate: SelfFundFeeEstimate | null | \"loading\"): string | null {\n if (estimate === \"loading\" || estimate == null) return null;\n return amountLabel(estimate.feeRaw, estimate.unit);\n}\n\nexport function SelfFundConsentDialog({ consent }: { consent: SelfFundConsent }) {\n const t = useT();\n const [pending, setPending] = useState<PendingRequest | null>(null);\n\n useEffect(() => {\n consent.registerHandler((feeEstimatePromise) => {\n return new Promise<boolean>((resolve) => {\n setPending({ resolve, feeEstimate: \"loading\" });\n void feeEstimatePromise.then((feeEstimate) => {\n setPending((current) => (current ? { ...current, feeEstimate } : current));\n });\n });\n });\n return () => consent.registerHandler(null);\n }, [consent]);\n\n const respond = (consented: boolean) => {\n pending?.resolve(consented);\n setPending(null);\n };\n\n const label = feeLabelFor(pending?.feeEstimate ?? null);\n const estimate = pending?.feeEstimate && pending.feeEstimate !== \"loading\" ? pending.feeEstimate : null;\n const balanceLabel = estimate?.balanceRaw != null ? amountLabel(estimate.balanceRaw, estimate.unit) : null;\n const notEnough = estimate?.balanceRaw != null && estimate.balanceRaw < estimate.feeRaw;\n\n return (\n <Dialog open={pending !== null} onOpenChange={(next) => { if (!next) respond(false); }}>\n <DialogContent className=\"sm:max-w-md\">\n <DialogTitle>{t(\"Network fee needed\")}</DialogTitle>\n <DialogDescription>\n {t(\"Sponsored transactions are unavailable. You can pay with your wallet balance.\")}\n </DialogDescription>\n <div className=\"rounded-lg bg-muted px-4 py-3 flex items-center justify-between\">\n <span className=\"text-sm text-muted-foreground\">{t(\"Network fee\")}</span>\n <span className=\"text-sm font-semibold\">{label ? `≈ ${label}` : t(\"Estimating…\")}</span>\n </div>\n {balanceLabel && (\n <div className=\"flex items-center justify-between px-4\">\n <span className=\"text-sm text-muted-foreground\">{t(\"Your balance\")}</span>\n <span className=\"text-sm font-semibold\">{balanceLabel}</span>\n </div>\n )}\n {notEnough && (\n <p className=\"text-sm text-destructive\">\n {t(\"You don't have enough to pay this fee. Try again later, when Medialane can cover it.\")}\n </p>\n )}\n <div className=\"flex justify-end gap-2\">\n <button\n type=\"button\"\n onClick={() => respond(false)}\n className=\"px-4 py-2 rounded-lg text-sm font-medium text-muted-foreground hover:bg-muted transition-colors\"\n >\n {t(\"Try again later\")}\n </button>\n <button\n type=\"button\"\n onClick={() => respond(true)}\n disabled={notEnough}\n className=\"px-4 py-2 rounded-lg text-sm font-medium bg-primary text-primary-foreground hover:opacity-90 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n {label ? t(\"Pay {label}\", { label }) : t(\"Pay from my wallet\")}\n </button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}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