@vantageos/mosaic 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/CHANGELOG.md +88 -2
  2. package/LICENSE +110 -0
  3. package/README.md +193 -21
  4. package/dist/PipelineBoard-FucyGArR.d.cts +759 -0
  5. package/dist/PipelineBoard-FucyGArR.d.ts +759 -0
  6. package/dist/PipelineBoard.markdown-DIcvrS-2.d.cts +16 -0
  7. package/dist/PipelineBoard.markdown-DIcvrS-2.d.ts +16 -0
  8. package/dist/{StatusBadge.schema-1tOjB4Ir.d.cts → StatusBadge.schema-BEjSH2_4.d.cts} +2 -2
  9. package/dist/{StatusBadge.schema-1tOjB4Ir.d.ts → StatusBadge.schema-BEjSH2_4.d.ts} +2 -2
  10. package/dist/{Tabs.schema-BzcEyeq8.d.cts → Tabs.schema-Dqr6vwV3.d.cts} +2 -2
  11. package/dist/{Tabs.schema-BzcEyeq8.d.ts → Tabs.schema-Dqr6vwV3.d.ts} +2 -2
  12. package/dist/Timeline-Coo_3tA_.d.cts +114 -0
  13. package/dist/Timeline-Coo_3tA_.d.ts +114 -0
  14. package/dist/Timeline.markdown-C6UPDv1H.d.cts +4 -0
  15. package/dist/Timeline.markdown-C6UPDv1H.d.ts +4 -0
  16. package/dist/TransactionPreview-BzWDn8kE.d.cts +391 -0
  17. package/dist/TransactionPreview-BzWDn8kE.d.ts +391 -0
  18. package/dist/TransactionPreview.markdown-Dpb0VYgN.d.cts +7 -0
  19. package/dist/TransactionPreview.markdown-Dpb0VYgN.d.ts +7 -0
  20. package/dist/artifacts.cjs +190 -2
  21. package/dist/artifacts.cjs.map +1 -1
  22. package/dist/artifacts.js +190 -2
  23. package/dist/artifacts.js.map +1 -1
  24. package/dist/confirmation.cjs +728 -2
  25. package/dist/confirmation.cjs.map +1 -1
  26. package/dist/confirmation.d.cts +2 -1
  27. package/dist/confirmation.d.ts +2 -1
  28. package/dist/confirmation.js +726 -4
  29. package/dist/confirmation.js.map +1 -1
  30. package/dist/display.cjs +1555 -203
  31. package/dist/display.cjs.map +1 -1
  32. package/dist/display.d.cts +6 -229
  33. package/dist/display.d.ts +6 -229
  34. package/dist/display.js +1539 -206
  35. package/dist/display.js.map +1 -1
  36. package/dist/forms.cjs +139 -46
  37. package/dist/forms.cjs.map +1 -1
  38. package/dist/forms.d.cts +2 -2
  39. package/dist/forms.d.ts +2 -2
  40. package/dist/forms.js +139 -46
  41. package/dist/forms.js.map +1 -1
  42. package/dist/host.cjs +822 -0
  43. package/dist/host.cjs.map +1 -0
  44. package/dist/host.d.cts +287 -0
  45. package/dist/host.d.ts +287 -0
  46. package/dist/host.js +794 -0
  47. package/dist/host.js.map +1 -0
  48. package/dist/{index-CwXVgtGb.d.cts → index-BadRcCbm.d.cts} +28 -11
  49. package/dist/{index-CwXVgtGb.d.ts → index-BadRcCbm.d.ts} +28 -11
  50. package/dist/index.cjs +2202 -247
  51. package/dist/index.cjs.map +1 -1
  52. package/dist/index.d.cts +42 -8
  53. package/dist/index.d.ts +42 -8
  54. package/dist/index.js +2167 -251
  55. package/dist/index.js.map +1 -1
  56. package/dist/input.d.cts +2 -2
  57. package/dist/input.d.ts +2 -2
  58. package/dist/media.cjs +190 -2
  59. package/dist/media.cjs.map +1 -1
  60. package/dist/media.d.cts +1 -1
  61. package/dist/media.d.ts +1 -1
  62. package/dist/media.js +190 -2
  63. package/dist/media.js.map +1 -1
  64. package/dist/preact/artifacts.js +190 -2
  65. package/dist/preact/artifacts.js.map +1 -1
  66. package/dist/preact/confirmation.d.ts +321 -1
  67. package/dist/preact/confirmation.js +629 -4
  68. package/dist/preact/confirmation.js.map +1 -1
  69. package/dist/preact/display.d.ts +570 -31
  70. package/dist/preact/display.js +1248 -126
  71. package/dist/preact/display.js.map +1 -1
  72. package/dist/preact/forms.d.ts +32 -15
  73. package/dist/preact/forms.js +139 -46
  74. package/dist/preact/forms.js.map +1 -1
  75. package/dist/preact/host.d.ts +307 -0
  76. package/dist/preact/host.js +875 -0
  77. package/dist/preact/host.js.map +1 -0
  78. package/dist/preact/media.d.ts +37 -1
  79. package/dist/preact/media.js +423 -0
  80. package/dist/preact/media.js.map +1 -1
  81. package/dist/preact/progress.d.ts +92 -1
  82. package/dist/preact/progress.js +469 -3
  83. package/dist/preact/progress.js.map +1 -1
  84. package/dist/progress.cjs +525 -2
  85. package/dist/progress.cjs.map +1 -1
  86. package/dist/progress.d.cts +2 -1
  87. package/dist/progress.d.ts +2 -1
  88. package/dist/progress.js +522 -3
  89. package/dist/progress.js.map +1 -1
  90. package/dist/react/artifacts.cjs +190 -2
  91. package/dist/react/artifacts.cjs.map +1 -1
  92. package/dist/react/artifacts.js +190 -2
  93. package/dist/react/artifacts.js.map +1 -1
  94. package/dist/react/confirmation.cjs +630 -2
  95. package/dist/react/confirmation.cjs.map +1 -1
  96. package/dist/react/confirmation.d.cts +3 -3
  97. package/dist/react/confirmation.d.ts +3 -3
  98. package/dist/react/confirmation.js +629 -4
  99. package/dist/react/confirmation.js.map +1 -1
  100. package/dist/react/display.cjs +1137 -123
  101. package/dist/react/display.cjs.map +1 -1
  102. package/dist/react/display.d.cts +42 -14
  103. package/dist/react/display.d.ts +42 -14
  104. package/dist/react/display.js +1122 -126
  105. package/dist/react/display.js.map +1 -1
  106. package/dist/react/forms.cjs +139 -46
  107. package/dist/react/forms.cjs.map +1 -1
  108. package/dist/react/forms.d.cts +1 -1
  109. package/dist/react/forms.d.ts +1 -1
  110. package/dist/react/forms.js +139 -46
  111. package/dist/react/forms.js.map +1 -1
  112. package/dist/react/host.cjs +910 -0
  113. package/dist/react/host.cjs.map +1 -0
  114. package/dist/react/host.d.cts +24 -0
  115. package/dist/react/host.d.ts +24 -0
  116. package/dist/react/host.js +875 -0
  117. package/dist/react/host.js.map +1 -0
  118. package/dist/react/input.d.cts +1 -1
  119. package/dist/react/input.d.ts +1 -1
  120. package/dist/react/media.cjs +426 -0
  121. package/dist/react/media.cjs.map +1 -1
  122. package/dist/react/media.d.cts +19 -1
  123. package/dist/react/media.d.ts +19 -1
  124. package/dist/react/media.js +423 -0
  125. package/dist/react/media.js.map +1 -1
  126. package/dist/react/progress.cjs +471 -2
  127. package/dist/react/progress.cjs.map +1 -1
  128. package/dist/react/progress.d.cts +1 -1
  129. package/dist/react/progress.d.ts +1 -1
  130. package/dist/react/progress.js +469 -3
  131. package/dist/react/progress.js.map +1 -1
  132. package/dist/server/resource.cjs +151 -0
  133. package/dist/server/resource.cjs.map +1 -0
  134. package/dist/server/resource.d.cts +90 -0
  135. package/dist/server/resource.d.ts +90 -0
  136. package/dist/server/resource.js +147 -0
  137. package/dist/server/resource.js.map +1 -0
  138. package/dist/server.cjs +1100 -25
  139. package/dist/server.cjs.map +1 -1
  140. package/dist/server.d.cts +84 -5
  141. package/dist/server.d.ts +84 -5
  142. package/dist/server.js +1087 -27
  143. package/dist/server.js.map +1 -1
  144. package/dist/tokens.cjs +73 -22
  145. package/dist/tokens.cjs.map +1 -1
  146. package/dist/tokens.d.cts +23 -3
  147. package/dist/tokens.d.ts +23 -3
  148. package/dist/tokens.js +73 -22
  149. package/dist/tokens.js.map +1 -1
  150. package/package.json +250 -231
  151. package/registry.yaml +51 -2
  152. package/dist/Alert.schema-LPJE5gFP.d.cts +0 -71
  153. package/dist/Alert.schema-LPJE5gFP.d.ts +0 -71
  154. package/dist/ProgressBar.schema-CdVYx0Wq.d.cts +0 -22
  155. package/dist/ProgressBar.schema-CdVYx0Wq.d.ts +0 -22
  156. package/dist/{ConfirmDialog-B3CQQGmJ.d.cts → ConfirmDialog-BCtOcmHe.d.cts} +1 -1
  157. package/dist/{ConfirmDialog-B3CQQGmJ.d.ts → ConfirmDialog-BCtOcmHe.d.ts} +1 -1
@@ -1,6 +1,6 @@
1
1
  import { useRef, useId, useState, useEffect } from 'react';
2
2
  import { z } from 'zod';
3
- import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
 
5
5
  // src/components/confirmation/TokenDisplayOnceModal.tsx
6
6
 
@@ -26,6 +26,8 @@ var EN = {
26
26
  "TokenDisplayOnceModal.copied": "Copied",
27
27
  "StatusBadge.aria.status": "Status",
28
28
  "StatusBadge.error.invalidProps": "StatusBadge: invalid props",
29
+ "Badge.aria.label": "Badge",
30
+ "Badge.error.invalidProps": "Badge: invalid props",
29
31
  "EmptyState.error.invalidProps": "EmptyState: invalid props",
30
32
  "Toast.aria.close": "Close notification",
31
33
  "Toast.error.invalidProps": "Toast: invalid props",
@@ -95,7 +97,99 @@ var EN = {
95
97
  "Select.search.placeholder": "Search\u2026",
96
98
  "Select.empty": "No options available",
97
99
  "Select.error.required": "Select an option",
98
- "Select.error.invalidProps": "Select: invalid props"
100
+ "Select.error.invalidProps": "Select: invalid props",
101
+ "ModelContext.selection.one": "1 row selected",
102
+ "ModelContext.selection.many": "{n} rows selected",
103
+ "ModelContext.selection.none": "No rows selected",
104
+ "TableView.sort.by": "Sort by",
105
+ "TableView.select.row": "Select row",
106
+ "TableView.select.all": "Select all rows",
107
+ "TableView.loading": "Loading table",
108
+ "StatCard.title": "Statistic",
109
+ "StatCard.trend.up": "Up",
110
+ "StatCard.trend.down": "Down",
111
+ "StatCard.trend.flat": "Flat",
112
+ "StatCard.empty.message": "No statistic to display",
113
+ "StatCard.loading": "Loading statistic",
114
+ "StatCard.error.invalidProps": "StatCard: invalid props",
115
+ "BalanceCard.title": "Balance",
116
+ "BalanceCard.network": "Network",
117
+ "BalanceCard.testnet": "Testnet",
118
+ "BalanceCard.address": "Address",
119
+ "BalanceCard.contract": "Token contract",
120
+ "BalanceCard.value": "Value",
121
+ "BalanceCard.copy": "Copy address",
122
+ "BalanceCard.copied": "Address copied",
123
+ "BalanceCard.empty.message": "No balance to display",
124
+ "BalanceCard.loading": "Loading balance",
125
+ "BalanceCard.error.invalidProps": "BalanceCard: invalid props",
126
+ "Timeline.title": "Timeline",
127
+ "Timeline.status.done": "Done",
128
+ "Timeline.status.current": "In progress",
129
+ "Timeline.status.pending": "Pending",
130
+ "Timeline.status.blocked": "Blocked",
131
+ "Timeline.completed": "{n} completed",
132
+ "Timeline.more": "{n} more",
133
+ "Timeline.empty.message": "No steps to display",
134
+ "Timeline.loading": "Loading timeline",
135
+ "Timeline.error.invalidProps": "Timeline: invalid props",
136
+ "MessageFeed.title": "Messages",
137
+ "MessageFeed.unread": "Unread",
138
+ "MessageFeed.attachment": "Attachment",
139
+ "MessageFeed.showing": "Showing the latest {n} of {total}",
140
+ "MessageFeed.empty.message": "No messages",
141
+ "MessageFeed.loading": "Loading messages",
142
+ "MessageFeed.error.invalidProps": "MessageFeed: invalid props",
143
+ "PipelineBoard.title": "Pipeline",
144
+ "PipelineBoard.deals.one": "1 deal",
145
+ "PipelineBoard.deals.many": "{n} deals",
146
+ "PipelineBoard.total": "Total",
147
+ "PipelineBoard.stage.empty": "No deals",
148
+ "PipelineBoard.filter.label": "Show stages",
149
+ "PipelineBoard.summary.open": "Open full board",
150
+ "PipelineBoard.more": "{n} more stages",
151
+ "PipelineBoard.empty.message": "No pipeline to display",
152
+ "PipelineBoard.loading": "Loading pipeline",
153
+ "PipelineBoard.error.invalidProps": "PipelineBoard: invalid props",
154
+ "PipelineBoard.col.stage": "Stage",
155
+ "PipelineBoard.col.deals": "Deals",
156
+ "TransactionPreview.title": "Transaction preview",
157
+ "TransactionPreview.notice": "NOT SIGNED - preparation only",
158
+ "TransactionPreview.kind.transfer": "Transfer",
159
+ "TransactionPreview.kind.swap": "Swap",
160
+ "TransactionPreview.testnet": "Testnet",
161
+ "TransactionPreview.field.network": "Network",
162
+ "TransactionPreview.field.from": "From",
163
+ "TransactionPreview.field.to": "To",
164
+ "TransactionPreview.field.amount": "Amount",
165
+ "TransactionPreview.field.fee": "Network fee",
166
+ "TransactionPreview.field.sell": "Sell",
167
+ "TransactionPreview.field.buy": "Buy",
168
+ "TransactionPreview.field.minReceived": "Minimum received",
169
+ "TransactionPreview.field.route": "Route",
170
+ "TransactionPreview.field.priceImpact": "Price impact",
171
+ "TransactionPreview.field.expires": "Quote expires",
172
+ "TransactionPreview.priceImpact.high": "High price impact",
173
+ "TransactionPreview.simulation.success": "Simulation succeeded",
174
+ "TransactionPreview.simulation.failed": "Simulation failed",
175
+ "TransactionPreview.simulation.unavailable": "Simulation unavailable",
176
+ "TransactionPreview.warnings": "Warnings",
177
+ "TransactionPreview.handoff": "Open in wallet",
178
+ "TransactionPreview.empty.message": "No transaction to preview",
179
+ "TransactionPreview.loading": "Loading preview",
180
+ "TransactionPreview.error.invalidProps": "TransactionPreview: invalid props",
181
+ "ProgressBar.title": "Progress",
182
+ "ConfirmDialog.title": "Confirmation",
183
+ "ConfirmDialog.options": "Answers",
184
+ "TableView.title": "Data table",
185
+ "TableView.markdown.more": "{n} more rows",
186
+ "MarkdownRenderer.title": "Markdown content",
187
+ "TokenDisplayOnceModal.title": "Token (shown once)",
188
+ "StatusBadge.title": "Status",
189
+ "TokenDisplayOnceModal.notice.once": "The value is shown once, in the app view only.",
190
+ "TokenDisplayOnceModal.field.scope": "Scope",
191
+ "TokenDisplayOnceModal.field.expires": "Expires",
192
+ "TokenDisplayOnceModal.field.fingerprint": "Fingerprint"
99
193
  };
100
194
  var FR = {
101
195
  // ─── Non-forms components ──────────────────────────────────────────────────
@@ -118,6 +212,8 @@ var FR = {
118
212
  "TokenDisplayOnceModal.copied": "Copi\xE9",
119
213
  "StatusBadge.aria.status": "Statut",
120
214
  "StatusBadge.error.invalidProps": "StatusBadge : propri\xE9t\xE9s invalides",
215
+ "Badge.aria.label": "Badge",
216
+ "Badge.error.invalidProps": "Badge : propri\xE9t\xE9s invalides",
121
217
  "EmptyState.error.invalidProps": "EmptyState : propri\xE9t\xE9s invalides",
122
218
  "Toast.aria.close": "Fermer la notification",
123
219
  "Toast.error.invalidProps": "Toast : propri\xE9t\xE9s invalides",
@@ -187,7 +283,99 @@ var FR = {
187
283
  "Select.search.placeholder": "Rechercher\u2026",
188
284
  "Select.empty": "Aucune option disponible",
189
285
  "Select.error.required": "S\xE9lectionnez une option",
190
- "Select.error.invalidProps": "Select : propri\xE9t\xE9s invalides"
286
+ "Select.error.invalidProps": "Select : propri\xE9t\xE9s invalides",
287
+ "ModelContext.selection.one": "1 ligne s\xE9lectionn\xE9e",
288
+ "ModelContext.selection.many": "{n} lignes s\xE9lectionn\xE9es",
289
+ "ModelContext.selection.none": "Aucune ligne s\xE9lectionn\xE9e",
290
+ "TableView.sort.by": "Trier par",
291
+ "TableView.select.row": "S\xE9lectionner la ligne",
292
+ "TableView.select.all": "Tout s\xE9lectionner",
293
+ "TableView.loading": "Chargement du tableau",
294
+ "StatCard.title": "Statistique",
295
+ "StatCard.trend.up": "En hausse",
296
+ "StatCard.trend.down": "En baisse",
297
+ "StatCard.trend.flat": "Stable",
298
+ "StatCard.empty.message": "Aucune statistique \xE0 afficher",
299
+ "StatCard.loading": "Chargement de la statistique",
300
+ "StatCard.error.invalidProps": "StatCard : propri\xE9t\xE9s invalides",
301
+ "BalanceCard.title": "Solde",
302
+ "BalanceCard.network": "R\xE9seau",
303
+ "BalanceCard.testnet": "R\xE9seau de test",
304
+ "BalanceCard.address": "Adresse",
305
+ "BalanceCard.contract": "Contrat du jeton",
306
+ "BalanceCard.value": "Valeur",
307
+ "BalanceCard.copy": "Copier l'adresse",
308
+ "BalanceCard.copied": "Adresse copi\xE9e",
309
+ "BalanceCard.empty.message": "Aucun solde \xE0 afficher",
310
+ "BalanceCard.loading": "Chargement du solde",
311
+ "BalanceCard.error.invalidProps": "BalanceCard : propri\xE9t\xE9s invalides",
312
+ "Timeline.title": "Chronologie",
313
+ "Timeline.status.done": "Termin\xE9",
314
+ "Timeline.status.current": "En cours",
315
+ "Timeline.status.pending": "\xC0 venir",
316
+ "Timeline.status.blocked": "Bloqu\xE9",
317
+ "Timeline.completed": "{n} termin\xE9(s)",
318
+ "Timeline.more": "{n} de plus",
319
+ "Timeline.empty.message": "Aucune \xE9tape \xE0 afficher",
320
+ "Timeline.loading": "Chargement de la chronologie",
321
+ "Timeline.error.invalidProps": "Timeline : propri\xE9t\xE9s invalides",
322
+ "MessageFeed.title": "Messages",
323
+ "MessageFeed.unread": "Non lu",
324
+ "MessageFeed.attachment": "Pi\xE8ce jointe",
325
+ "MessageFeed.showing": "Affichage des {n} derniers sur {total}",
326
+ "MessageFeed.empty.message": "Aucun message",
327
+ "MessageFeed.loading": "Chargement des messages",
328
+ "MessageFeed.error.invalidProps": "MessageFeed : propri\xE9t\xE9s invalides",
329
+ "PipelineBoard.title": "Pipeline",
330
+ "PipelineBoard.deals.one": "1 affaire",
331
+ "PipelineBoard.deals.many": "{n} affaires",
332
+ "PipelineBoard.total": "Total",
333
+ "PipelineBoard.stage.empty": "Aucune affaire",
334
+ "PipelineBoard.filter.label": "Afficher les \xE9tapes",
335
+ "PipelineBoard.summary.open": "Ouvrir le tableau complet",
336
+ "PipelineBoard.more": "{n} \xE9tapes de plus",
337
+ "PipelineBoard.empty.message": "Aucun pipeline \xE0 afficher",
338
+ "PipelineBoard.loading": "Chargement du pipeline",
339
+ "PipelineBoard.error.invalidProps": "PipelineBoard : propri\xE9t\xE9s invalides",
340
+ "PipelineBoard.col.stage": "\xC9tape",
341
+ "PipelineBoard.col.deals": "Affaires",
342
+ "TransactionPreview.title": "Aper\xE7u de transaction",
343
+ "TransactionPreview.notice": "NON SIGN\xC9 - pr\xE9paration uniquement",
344
+ "TransactionPreview.kind.transfer": "Transfert",
345
+ "TransactionPreview.kind.swap": "\xC9change",
346
+ "TransactionPreview.testnet": "R\xE9seau de test",
347
+ "TransactionPreview.field.network": "R\xE9seau",
348
+ "TransactionPreview.field.from": "De",
349
+ "TransactionPreview.field.to": "\xC0",
350
+ "TransactionPreview.field.amount": "Montant",
351
+ "TransactionPreview.field.fee": "Frais de r\xE9seau",
352
+ "TransactionPreview.field.sell": "Vendre",
353
+ "TransactionPreview.field.buy": "Acheter",
354
+ "TransactionPreview.field.minReceived": "Minimum re\xE7u",
355
+ "TransactionPreview.field.route": "Itin\xE9raire",
356
+ "TransactionPreview.field.priceImpact": "Impact sur le prix",
357
+ "TransactionPreview.field.expires": "Expiration du devis",
358
+ "TransactionPreview.priceImpact.high": "Impact sur le prix \xE9lev\xE9",
359
+ "TransactionPreview.simulation.success": "Simulation r\xE9ussie",
360
+ "TransactionPreview.simulation.failed": "Simulation \xE9chou\xE9e",
361
+ "TransactionPreview.simulation.unavailable": "Simulation indisponible",
362
+ "TransactionPreview.warnings": "Avertissements",
363
+ "TransactionPreview.handoff": "Ouvrir dans le portefeuille",
364
+ "TransactionPreview.empty.message": "Aucune transaction \xE0 pr\xE9visualiser",
365
+ "TransactionPreview.loading": "Chargement de l'aper\xE7u",
366
+ "TransactionPreview.error.invalidProps": "TransactionPreview : propri\xE9t\xE9s invalides",
367
+ "ProgressBar.title": "Progression",
368
+ "ConfirmDialog.title": "Confirmation",
369
+ "ConfirmDialog.options": "R\xE9ponses",
370
+ "TableView.title": "Tableau de donn\xE9es",
371
+ "TableView.markdown.more": "{n} lignes de plus",
372
+ "MarkdownRenderer.title": "Contenu Markdown",
373
+ "TokenDisplayOnceModal.title": "Jeton (affich\xE9 une fois)",
374
+ "StatusBadge.title": "Statut",
375
+ "TokenDisplayOnceModal.notice.once": "La valeur n'est affich\xE9e qu'une fois, dans la vue de l'application uniquement.",
376
+ "TokenDisplayOnceModal.field.scope": "Port\xE9e",
377
+ "TokenDisplayOnceModal.field.expires": "Expire le",
378
+ "TokenDisplayOnceModal.field.fingerprint": "Empreinte"
191
379
  };
192
380
  var TABLE = {
193
381
  en: EN,
@@ -202,6 +390,11 @@ var TokenDisplayOnceModalPropsSchema = z.object({
202
390
  warningMessage: z.string().min(1),
203
391
  copyLabel: z.string().min(1),
204
392
  closeLabel: z.string().min(1),
393
+ /** Non-secret metadata, shown in the view AND carried by the A-1 fallback. */
394
+ scope: z.string().optional(),
395
+ expiresAt: z.string().optional(),
396
+ /** Supplied by the issuer; NEVER derived from the secret. */
397
+ fingerprint: z.string().optional(),
205
398
  locale: z.enum(["en", "fr"]).default("en")
206
399
  });
207
400
  function validateTokenDisplayOnceModalProps(raw) {
@@ -213,6 +406,9 @@ function TokenDisplayOnceModalInner({
213
406
  warningMessage,
214
407
  copyLabel,
215
408
  closeLabel,
409
+ scope,
410
+ expiresAt,
411
+ fingerprint,
216
412
  locale,
217
413
  onClose
218
414
  }) {
@@ -275,6 +471,29 @@ function TokenDisplayOnceModalInner({
275
471
  children: warningMessage
276
472
  }
277
473
  ),
474
+ scope || expiresAt || fingerprint ? /* @__PURE__ */ jsxs("dl", { className: "m-0 text-sm text-gray-700", children: [
475
+ scope ? /* @__PURE__ */ jsxs("div", { children: [
476
+ /* @__PURE__ */ jsxs("dt", { className: "inline", children: [
477
+ t("TokenDisplayOnceModal.field.scope", locale),
478
+ ": "
479
+ ] }),
480
+ /* @__PURE__ */ jsx("dd", { className: "m-0 inline", children: scope })
481
+ ] }) : null,
482
+ expiresAt ? /* @__PURE__ */ jsxs("div", { children: [
483
+ /* @__PURE__ */ jsxs("dt", { className: "inline", children: [
484
+ t("TokenDisplayOnceModal.field.expires", locale),
485
+ ": "
486
+ ] }),
487
+ /* @__PURE__ */ jsx("dd", { className: "m-0 inline", children: expiresAt })
488
+ ] }) : null,
489
+ fingerprint ? /* @__PURE__ */ jsxs("div", { children: [
490
+ /* @__PURE__ */ jsxs("dt", { className: "inline", children: [
491
+ t("TokenDisplayOnceModal.field.fingerprint", locale),
492
+ ": "
493
+ ] }),
494
+ /* @__PURE__ */ jsx("dd", { className: "m-0 inline font-mono", children: fingerprint })
495
+ ] }) : null
496
+ ] }) : null,
278
497
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 bg-gray-50 border border-gray-200 rounded-md px-3 py-2", children: /* @__PURE__ */ jsx("code", { className: "flex-1 text-sm font-mono text-gray-800 break-all select-all", children: secureToken }) }),
279
498
  /* @__PURE__ */ jsx("output", { "aria-live": "polite", "aria-atomic": "true", className: "min-h-[1.25rem] block", children: copied && /* @__PURE__ */ jsx("span", { className: "text-sm text-green-700 font-medium", children: t("TokenDisplayOnceModal.copied", locale) }) }),
280
499
  /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-3 mt-2", children: [
@@ -332,7 +551,510 @@ var AlertPropsSchema = z.object({
332
551
  function validateAlertProps(raw) {
333
552
  return AlertPropsSchema.parse(raw);
334
553
  }
554
+ var BadgePropsSchema = z.object({
555
+ label: z.string(),
556
+ variant: z.enum(["default", "primary", "success", "warning", "danger", "info", "neutral"]).default("default"),
557
+ dot: z.boolean().optional(),
558
+ count: z.number().int().nonnegative().optional(),
559
+ locale: z.enum(["en", "fr"]).default("en")
560
+ });
561
+ function validateBadgeProps(raw) {
562
+ return BadgePropsSchema.parse(raw);
563
+ }
564
+ var variantClasses = {
565
+ default: "bg-slate-100 text-slate-700 ring-1 ring-slate-200",
566
+ primary: "bg-indigo-100 text-indigo-800 ring-1 ring-indigo-300",
567
+ success: "bg-green-100 text-green-800 ring-1 ring-green-300",
568
+ warning: "bg-amber-100 text-amber-800 ring-1 ring-amber-300",
569
+ danger: "bg-red-100 text-red-800 ring-1 ring-red-300",
570
+ info: "bg-blue-100 text-blue-800 ring-1 ring-blue-300",
571
+ neutral: "bg-slate-100 text-slate-800 ring-1 ring-slate-300"
572
+ };
573
+ var dotClasses = {
574
+ default: "bg-slate-400",
575
+ primary: "bg-indigo-500",
576
+ success: "bg-green-500",
577
+ warning: "bg-amber-500",
578
+ danger: "bg-red-500",
579
+ info: "bg-blue-500",
580
+ neutral: "bg-slate-400"
581
+ };
582
+ function BadgeInner({ label, variant, dot, count, locale }) {
583
+ const ariaLabel = t("Badge.aria.label", locale);
584
+ const displayCount = count !== void 0 ? ` (${count})` : "";
585
+ return /* @__PURE__ */ jsxs(
586
+ "span",
587
+ {
588
+ "aria-label": `${ariaLabel}: ${label}${displayCount}`,
589
+ lang: locale,
590
+ className: `inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium ${variantClasses[variant]}`,
591
+ children: [
592
+ dot && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: `h-1.5 w-1.5 rounded-full ${dotClasses[variant]}` }),
593
+ label,
594
+ count !== void 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "font-semibold tabular-nums", children: count })
595
+ ]
596
+ }
597
+ );
598
+ }
599
+ function Badge(raw) {
600
+ try {
601
+ const props = validateBadgeProps(raw);
602
+ return /* @__PURE__ */ jsx(BadgeInner, { ...props });
603
+ } catch {
604
+ const locale = raw.locale === "fr" ? "fr" : "en";
605
+ return /* @__PURE__ */ jsx("span", { role: "alert", children: t("Badge.error.invalidProps", locale) });
606
+ }
607
+ }
608
+
609
+ // src/components/display/EmptyState.logic.ts
610
+ var ACTION_VARIANT_CLASSES = {
611
+ primary: "inline-flex items-center justify-center rounded-md bg-slate-900 px-4 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-slate-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-900 disabled:pointer-events-none disabled:opacity-50",
612
+ secondary: "inline-flex items-center justify-center rounded-md border border-slate-300 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm transition-colors hover:bg-slate-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-400 disabled:pointer-events-none disabled:opacity-50"
613
+ };
614
+ var EmptyStatePropsSchema = z.object({
615
+ title: z.string().min(1),
616
+ description: z.string().optional(),
617
+ action: z.object({
618
+ label: z.string().min(1),
619
+ variant: z.enum(["primary", "secondary"]).default("primary")
620
+ }).optional(),
621
+ locale: z.enum(["en", "fr"]).default("en")
622
+ });
623
+ function validateEmptyStateProps(raw) {
624
+ return EmptyStatePropsSchema.parse(raw);
625
+ }
626
+ function EmptyStateInner({
627
+ icon,
628
+ title,
629
+ description,
630
+ action,
631
+ locale: _locale
632
+ }) {
633
+ const variant = action?.variant ?? "primary";
634
+ return /* @__PURE__ */ jsxs(
635
+ "section",
636
+ {
637
+ "aria-label": title,
638
+ className: "flex flex-col items-center justify-center gap-4 px-6 py-12 text-center",
639
+ children: [
640
+ icon && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-slate-400", children: icon }),
641
+ /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold text-slate-900", children: title }),
642
+ description && /* @__PURE__ */ jsx("p", { className: "max-w-sm text-sm leading-relaxed text-slate-500", children: description }),
643
+ action && /* @__PURE__ */ jsx("button", { type: "button", onClick: action.onClick, className: ACTION_VARIANT_CLASSES[variant], children: action.label })
644
+ ]
645
+ }
646
+ );
647
+ }
648
+ function EmptyState(raw) {
649
+ try {
650
+ const parsed = validateEmptyStateProps(raw);
651
+ return /* @__PURE__ */ jsx(
652
+ EmptyStateInner,
653
+ {
654
+ ...parsed,
655
+ icon: raw.icon,
656
+ action: parsed.action && raw.action?.onClick ? { ...parsed.action, onClick: raw.action.onClick } : void 0
657
+ }
658
+ );
659
+ } catch (err) {
660
+ console.error("[EmptyState] Invalid props \u2014 component will not render.", err);
661
+ const locale = raw.locale === "fr" ? "fr" : "en";
662
+ return /* @__PURE__ */ jsx("span", { role: "alert", children: t("EmptyState.error.invalidProps", locale) });
663
+ }
664
+ }
665
+
666
+ // src/components/display/Skeleton.logic.ts
667
+ function getAnimationClass(animation) {
668
+ switch (animation) {
669
+ case "pulse":
670
+ return "animate-pulse";
671
+ case "wave":
672
+ return "skeleton-wave";
673
+ case "none":
674
+ return "";
675
+ }
676
+ }
677
+ function getVariantClass(variant) {
678
+ switch (variant) {
679
+ case "rect":
680
+ return "rounded-md";
681
+ case "circle":
682
+ return "rounded-full";
683
+ case "text":
684
+ return "rounded";
685
+ }
686
+ }
687
+ var SKELETON_BG_CLASS = "bg-gray-200 dark:bg-gray-700";
688
+ function textLineKey(index) {
689
+ return `skeleton-line-${index}`;
690
+ }
691
+ function lastLineWidth(index, total, baseWidth) {
692
+ if (total > 1 && index === total - 1) {
693
+ return "75%";
694
+ }
695
+ return baseWidth;
696
+ }
697
+ var SkeletonPropsSchema = z.object({
698
+ variant: z.enum(["rect", "circle", "text"]).default("rect"),
699
+ width: z.union([z.string().min(1), z.number().positive()]).optional(),
700
+ height: z.union([z.string().min(1), z.number().positive()]).optional(),
701
+ count: z.number().int().min(1).max(20).default(1),
702
+ animation: z.enum(["pulse", "wave", "none"]).default("pulse"),
703
+ locale: z.enum(["en", "fr"]).default("en")
704
+ });
705
+ function validateSkeletonProps(raw) {
706
+ return SkeletonPropsSchema.parse(raw);
707
+ }
708
+ function resolveSkeletonDimensions(variant, width, height) {
709
+ const toCss = (v, fallback) => {
710
+ if (v === void 0) return fallback;
711
+ if (typeof v === "number") return `${v}px`;
712
+ return v;
713
+ };
714
+ if (variant === "circle") {
715
+ const size = width !== void 0 ? toCss(width, "40px") : height !== void 0 ? toCss(height, "40px") : "40px";
716
+ return { widthCss: size, heightCss: size };
717
+ }
718
+ if (variant === "text") {
719
+ return {
720
+ widthCss: toCss(width, "100%"),
721
+ heightCss: toCss(height, "16px")
722
+ };
723
+ }
724
+ return {
725
+ widthCss: toCss(width, "100%"),
726
+ heightCss: toCss(height, "100px")
727
+ };
728
+ }
729
+ function SkeletonInner({ variant, width, height, count, animation, locale }) {
730
+ const { widthCss, heightCss } = resolveSkeletonDimensions(variant, width, height);
731
+ const animClass = getAnimationClass(animation);
732
+ const variantClass = getVariantClass(variant);
733
+ const ariaLabel = t("Skeleton.aria.label", locale);
734
+ const baseClass = `${SKELETON_BG_CLASS} ${variantClass} ${animClass}`.trim();
735
+ if (variant === "text") {
736
+ return (
737
+ // biome-ignore lint/a11y/useSemanticElements: role="status" is the correct ARIA pattern for loading indicators; <output> conveys form output semantics which is incorrect here
738
+ /* @__PURE__ */ jsx("div", { role: "status", "aria-label": ariaLabel, "aria-busy": "true", className: "flex flex-col gap-2", children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx(
739
+ "span",
740
+ {
741
+ className: `block ${baseClass}`,
742
+ style: {
743
+ width: lastLineWidth(i, count, widthCss),
744
+ height: heightCss
745
+ },
746
+ "aria-hidden": "true"
747
+ },
748
+ textLineKey(i)
749
+ )) })
750
+ );
751
+ }
752
+ return /* @__PURE__ */ jsx(
753
+ "div",
754
+ {
755
+ role: "status",
756
+ "aria-label": ariaLabel,
757
+ "aria-busy": "true",
758
+ className: `block ${baseClass}`,
759
+ style: { width: widthCss, height: heightCss }
760
+ }
761
+ );
762
+ }
763
+ function Skeleton(raw) {
764
+ try {
765
+ const props = validateSkeletonProps(raw);
766
+ return /* @__PURE__ */ jsx(SkeletonInner, { ...props });
767
+ } catch {
768
+ const locale = raw.locale === "fr" ? "fr" : "en";
769
+ return /* @__PURE__ */ jsx("span", { role: "alert", className: "text-red-600 text-sm", children: t("Skeleton.error.invalidProps", locale) });
770
+ }
771
+ }
772
+
773
+ // src/components/display/TableView.logic.ts
774
+ var DECIMAL = /^(-)?(\d+)(?:\.(\d+))?$/;
775
+ function parseDecimal(s) {
776
+ const m = DECIMAL.exec(s.trim());
777
+ if (!m) return void 0;
778
+ const int = (m[2] ?? "0").replace(/^0+(?=\d)/, "");
779
+ const frac = (m[3] ?? "").replace(/0+$/, "");
780
+ const zero = int === "0" && frac === "";
781
+ return { neg: m[1] === "-" && !zero, int, frac };
782
+ }
783
+ function compareDecimalStrings(a, b) {
784
+ const x = parseDecimal(a);
785
+ const y = parseDecimal(b);
786
+ if (!x || !y) return 0;
787
+ if (x.neg !== y.neg) return x.neg ? -1 : 1;
788
+ const sign = x.neg ? -1 : 1;
789
+ if (x.int.length !== y.int.length) return sign * (x.int.length < y.int.length ? -1 : 1);
790
+ if (x.int !== y.int) return sign * (x.int < y.int ? -1 : 1);
791
+ const len = Math.max(x.frac.length, y.frac.length);
792
+ const fx = x.frac.padEnd(len, "0");
793
+ const fy = y.frac.padEnd(len, "0");
794
+ if (fx === fy) return 0;
795
+ return sign * (fx < fy ? -1 : 1);
796
+ }
797
+
798
+ // src/components/shared/datetime.ts
799
+ function formatTimestamp(iso, locale, timeZone) {
800
+ const d = new Date(iso);
801
+ if (Number.isNaN(d.getTime())) return iso;
802
+ try {
803
+ return new Intl.DateTimeFormat(locale, {
804
+ dateStyle: "medium",
805
+ timeStyle: "short",
806
+ ...timeZone ? { timeZone } : {}
807
+ }).format(d);
808
+ } catch {
809
+ return iso;
810
+ }
811
+ }
812
+
813
+ // src/components/shared/url.ts
814
+ function normalizeHttpUrl(value) {
815
+ if (typeof value !== "string") return void 0;
816
+ try {
817
+ const u = new URL(value);
818
+ return u.protocol === "https:" || u.protocol === "http:" ? u.href : void 0;
819
+ } catch {
820
+ return void 0;
821
+ }
822
+ }
823
+ var AmountSchema = z.object({
824
+ /** Decimal STRING (never a float). */
825
+ value: z.string().min(1),
826
+ symbol: z.string().min(1)
827
+ });
828
+ var QuoteSchema = z.object({
829
+ sell: AmountSchema,
830
+ buy: AmountSchema,
831
+ minReceived: AmountSchema.optional(),
832
+ route: z.array(z.string().min(1)).optional(),
833
+ /** Percent as a decimal string, e.g. "0.42". */
834
+ priceImpact: z.string().optional()
835
+ });
836
+ var TransactionPreviewPropsSchema = z.object({
837
+ kind: z.enum(["transfer", "swap"]).default("transfer"),
838
+ network: z.string().optional(),
839
+ testnet: z.boolean().default(false),
840
+ from: z.string().optional(),
841
+ to: z.string().optional(),
842
+ amount: AmountSchema.optional(),
843
+ fee: AmountSchema.optional(),
844
+ quote: QuoteSchema.optional(),
845
+ simulation: z.object({
846
+ status: z.enum(["success", "failed", "unavailable"]),
847
+ message: z.string().optional()
848
+ }).optional(),
849
+ warnings: z.array(z.string()).default([]),
850
+ /** ISO 8601 expiry of the quote. */
851
+ expiresAt: z.string().optional(),
852
+ /** Wallet link-out. Only http(s) urls are ever rendered. */
853
+ handoff: z.object({ url: z.string().min(1) }).optional(),
854
+ timeZone: z.string().optional(),
855
+ loading: z.boolean().default(false),
856
+ locale: z.enum(["en", "fr"]).default("en")
857
+ });
858
+ function validateTransactionPreviewProps(raw) {
859
+ return TransactionPreviewPropsSchema.parse(raw);
860
+ }
861
+ function hasPreviewContent(p) {
862
+ return Boolean(p.from || p.to || p.amount || p.quote || p.fee);
863
+ }
864
+ var amountText = (a) => `${a.value} ${a.symbol}`;
865
+ function Row({ label, children }) {
866
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 py-1 sm:flex-row sm:gap-3", children: [
867
+ /* @__PURE__ */ jsx("dt", { className: "w-36 shrink-0 text-sm text-slate-500", children: label }),
868
+ /* @__PURE__ */ jsx("dd", { className: "m-0 min-w-0 break-all text-sm text-slate-900", children })
869
+ ] });
870
+ }
871
+ function TransactionPreview(raw = {}) {
872
+ const parsed = TransactionPreviewPropsSchema.safeParse(raw);
873
+ const locale = raw?.locale === "fr" ? "fr" : "en";
874
+ if (!parsed.success) {
875
+ return /* @__PURE__ */ jsx("div", { role: "alert", children: t("TransactionPreview.error.invalidProps", locale) });
876
+ }
877
+ const p = parsed.data;
878
+ if (p.loading) {
879
+ return /* @__PURE__ */ jsx("div", { "aria-busy": "true", "aria-label": t("TransactionPreview.loading", p.locale), children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", count: 6, locale: p.locale }) });
880
+ }
881
+ if (!hasPreviewContent(p)) {
882
+ return /* @__PURE__ */ jsx(EmptyState, { title: t("TransactionPreview.empty.message", p.locale), locale: p.locale });
883
+ }
884
+ const highImpact = p.quote?.priceImpact !== void 0 && compareDecimalStrings(p.quote.priceImpact, "1") >= 0;
885
+ const handoff = normalizeHttpUrl(p.handoff?.url);
886
+ return /* @__PURE__ */ jsxs(
887
+ "section",
888
+ {
889
+ "aria-label": t("TransactionPreview.title", p.locale),
890
+ lang: p.locale,
891
+ className: "flex flex-col gap-3 rounded-lg border border-slate-200 bg-white p-4",
892
+ children: [
893
+ /* @__PURE__ */ jsxs("header", { className: "flex flex-wrap items-center gap-2", children: [
894
+ /* @__PURE__ */ jsx("strong", { className: "text-slate-900", children: t(`TransactionPreview.kind.${p.kind}`, p.locale) }),
895
+ p.testnet ? /* @__PURE__ */ jsx(
896
+ Badge,
897
+ {
898
+ label: t("TransactionPreview.testnet", p.locale),
899
+ variant: "warning",
900
+ locale: p.locale
901
+ }
902
+ ) : null
903
+ ] }),
904
+ /* @__PURE__ */ jsx(
905
+ "p",
906
+ {
907
+ role: "note",
908
+ className: "m-0 rounded bg-amber-50 px-3 py-2 text-sm font-semibold text-amber-900",
909
+ children: t("TransactionPreview.notice", p.locale)
910
+ }
911
+ ),
912
+ /* @__PURE__ */ jsxs("dl", { className: "m-0", children: [
913
+ p.network ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.network", p.locale), children: p.network }) : null,
914
+ p.from ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.from", p.locale), children: /* @__PURE__ */ jsx("span", { className: "font-mono", children: p.from }) }) : null,
915
+ p.to ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.to", p.locale), children: /* @__PURE__ */ jsx("span", { className: "font-mono", children: p.to }) }) : null,
916
+ p.amount ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.amount", p.locale), children: amountText(p.amount) }) : null,
917
+ p.quote ? /* @__PURE__ */ jsxs(Fragment, { children: [
918
+ /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.sell", p.locale), children: amountText(p.quote.sell) }),
919
+ /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.buy", p.locale), children: amountText(p.quote.buy) }),
920
+ p.quote.minReceived ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.minReceived", p.locale), children: amountText(p.quote.minReceived) }) : null,
921
+ p.quote.route ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.route", p.locale), children: p.quote.route.join(" > ") }) : null,
922
+ p.quote.priceImpact !== void 0 ? /* @__PURE__ */ jsxs(Row, { label: t("TransactionPreview.field.priceImpact", p.locale), children: [
923
+ /* @__PURE__ */ jsx("span", { children: `${p.quote.priceImpact}%` }),
924
+ highImpact ? /* @__PURE__ */ jsx("strong", { className: "ml-2 text-red-700", children: t("TransactionPreview.priceImpact.high", p.locale) }) : null
925
+ ] }) : null
926
+ ] }) : null,
927
+ p.fee ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.fee", p.locale), children: amountText(p.fee) }) : null,
928
+ p.expiresAt ? /* @__PURE__ */ jsx(Row, { label: t("TransactionPreview.field.expires", p.locale), children: formatTimestamp(p.expiresAt, p.locale, p.timeZone) }) : null
929
+ ] }),
930
+ p.simulation ? /* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
931
+ /* @__PURE__ */ jsx("strong", { className: p.simulation.status === "failed" ? "text-red-700" : "text-slate-800", children: t(`TransactionPreview.simulation.${p.simulation.status}`, p.locale) }),
932
+ p.simulation.message ? /* @__PURE__ */ jsx("span", { className: "block text-slate-600", children: p.simulation.message }) : null
933
+ ] }) : null,
934
+ p.warnings.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
935
+ /* @__PURE__ */ jsx("strong", { className: "text-amber-800", children: t("TransactionPreview.warnings", p.locale) }),
936
+ /* @__PURE__ */ jsx("ul", { className: "m-0 pl-5", children: p.warnings.map((w) => /* @__PURE__ */ jsx("li", { children: w }, w)) })
937
+ ] }) : null,
938
+ handoff ? raw.onHandoff ? /* @__PURE__ */ jsx(
939
+ "button",
940
+ {
941
+ type: "button",
942
+ onClick: () => raw.onHandoff?.(handoff),
943
+ className: "self-start rounded border border-slate-300 px-3 py-1 text-sm hover:bg-slate-50",
944
+ children: t("TransactionPreview.handoff", p.locale)
945
+ }
946
+ ) : /* @__PURE__ */ jsx(
947
+ "a",
948
+ {
949
+ href: handoff,
950
+ rel: "noopener noreferrer",
951
+ target: "_blank",
952
+ className: "self-start text-sm text-blue-700 underline",
953
+ children: t("TransactionPreview.handoff", p.locale)
954
+ }
955
+ ) : null
956
+ ]
957
+ }
958
+ );
959
+ }
960
+
961
+ // src/components/shared/markdown.ts
962
+ var SPECIAL = /([\\`*_[\]()<>&!|~])/g;
963
+ var BREAKS = /* @__PURE__ */ new Set([10, 11, 12, 13, 133, 8232, 8233]);
964
+ function flatten(text) {
965
+ let out = "";
966
+ let gap = false;
967
+ for (const c of text) {
968
+ const n = c.codePointAt(0) ?? 0;
969
+ if (BREAKS.has(n)) {
970
+ gap = true;
971
+ continue;
972
+ }
973
+ if (n < 32 && n !== 9) continue;
974
+ if (n === 127) continue;
975
+ if (gap) out += " ";
976
+ gap = false;
977
+ out += c;
978
+ }
979
+ return gap ? `${out} ` : out;
980
+ }
981
+ function mdEscape(text) {
982
+ const flat = flatten(text).replace(SPECIAL, "\\$1").replace(/\b(https?|ftp):\/\//gi, "$1:\\/\\/").replace(/\bwww\./gi, (m) => `${m.slice(0, 3)}\\.`);
983
+ return flat.replace(/^(\s*)([#>+-])/, "$1\\$2").replace(/^(\s*\d+)([.)])(?=\s|$)/, "$1\\$2");
984
+ }
985
+ function mdUrl(href) {
986
+ return href.replace(
987
+ /[()[\]\\<>`\s]/g,
988
+ (c) => `%${c.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0")}`
989
+ );
990
+ }
991
+ function mdTable(headers, rows) {
992
+ const line = (cells) => `| ${cells.join(" | ")} |`;
993
+ return [line(headers), line(headers.map(() => "---")), ...rows.map(line)].join("\n");
994
+ }
995
+ function mdHeading(text, level = 1) {
996
+ return `${"#".repeat(level)} ${text}`;
997
+ }
998
+
999
+ // src/components/confirmation/TransactionPreview.markdown.ts
1000
+ var amt = (a) => `${a.value} ${a.symbol}`;
1001
+ function transactionPreviewToMarkdown(props, locale = "en") {
1002
+ const title = mdHeading(t("TransactionPreview.title", locale));
1003
+ const notice = `**${t("TransactionPreview.notice", locale)}**`;
1004
+ const parsed = TransactionPreviewPropsSchema.safeParse(props);
1005
+ if (!parsed.success || !hasPreviewContent(parsed.data)) {
1006
+ return `${title}
1007
+
1008
+ ${notice}
1009
+
1010
+ ${t("TransactionPreview.empty.message", locale)}
1011
+ `;
1012
+ }
1013
+ const p = parsed.data;
1014
+ const rows = [];
1015
+ const add = (key, value) => {
1016
+ if (value) rows.push([t(key, locale), mdEscape(value)]);
1017
+ };
1018
+ add(
1019
+ "TransactionPreview.field.network",
1020
+ [p.network, p.testnet ? t("TransactionPreview.testnet", locale) : ""].filter(Boolean).join(", ")
1021
+ );
1022
+ add("TransactionPreview.field.from", p.from);
1023
+ add("TransactionPreview.field.to", p.to);
1024
+ if (p.amount) add("TransactionPreview.field.amount", amt(p.amount));
1025
+ if (p.quote) {
1026
+ add("TransactionPreview.field.sell", amt(p.quote.sell));
1027
+ add("TransactionPreview.field.buy", amt(p.quote.buy));
1028
+ if (p.quote.minReceived) add("TransactionPreview.field.minReceived", amt(p.quote.minReceived));
1029
+ if (p.quote.route) add("TransactionPreview.field.route", p.quote.route.join(" \u2192 "));
1030
+ if (p.quote.priceImpact) add("TransactionPreview.field.priceImpact", `${p.quote.priceImpact}%`);
1031
+ }
1032
+ if (p.fee) add("TransactionPreview.field.fee", amt(p.fee));
1033
+ if (p.expiresAt) {
1034
+ add("TransactionPreview.field.expires", formatTimestamp(p.expiresAt, locale, p.timeZone));
1035
+ }
1036
+ const sections = [
1037
+ `${title}
1038
+
1039
+ ${notice}`,
1040
+ mdTable([t(`TransactionPreview.kind.${p.kind}`, locale), ""], rows)
1041
+ ];
1042
+ if (p.simulation) {
1043
+ const msg = p.simulation.message ? ` - ${mdEscape(p.simulation.message)}` : "";
1044
+ sections.push(`${t(`TransactionPreview.simulation.${p.simulation.status}`, locale)}${msg}`);
1045
+ }
1046
+ if (p.warnings.length > 0) {
1047
+ sections.push(
1048
+ `${t("TransactionPreview.warnings", locale)}:
1049
+ ${p.warnings.map((w) => `- ${mdEscape(w)}`).join("\n")}`
1050
+ );
1051
+ }
1052
+ const handoff = normalizeHttpUrl(p.handoff?.url);
1053
+ if (handoff) sections.push(`${t("TransactionPreview.handoff", locale)}: <${mdUrl(handoff)}>`);
1054
+ return `${sections.join("\n\n")}
1055
+ `;
1056
+ }
335
1057
 
336
- export { AlertPropsSchema, ToastPropsSchema, TokenDisplayOnceModal, TokenDisplayOnceModalPropsSchema, validateAlertProps, validateToastProps, validateTokenDisplayOnceModalProps };
1058
+ export { AlertPropsSchema, ToastPropsSchema, TokenDisplayOnceModal, TokenDisplayOnceModalPropsSchema, TransactionPreview, TransactionPreviewPropsSchema, transactionPreviewToMarkdown, validateAlertProps, validateToastProps, validateTokenDisplayOnceModalProps, validateTransactionPreviewProps };
337
1059
  //# sourceMappingURL=confirmation.js.map
338
1060
  //# sourceMappingURL=confirmation.js.map