@tetsuo-ai/marketplace-react 0.4.0 → 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 (88) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +93 -47
  3. package/dist/chunk-7NKRSPPN.js +227 -0
  4. package/dist/chunk-7NKRSPPN.js.map +1 -0
  5. package/dist/{chunk-BNILOX3O.js → chunk-CDDHUFMG.js} +38 -6
  6. package/dist/chunk-CDDHUFMG.js.map +1 -0
  7. package/dist/chunk-FIDFPM5A.cjs +40 -0
  8. package/dist/chunk-FIDFPM5A.cjs.map +1 -0
  9. package/dist/chunk-IJKWKY4H.cjs +1370 -0
  10. package/dist/chunk-IJKWKY4H.cjs.map +1 -0
  11. package/dist/chunk-JTSG5FGC.cjs +397 -0
  12. package/dist/chunk-JTSG5FGC.cjs.map +1 -0
  13. package/dist/chunk-ONC6L3IX.cjs +97 -0
  14. package/dist/chunk-ONC6L3IX.cjs.map +1 -0
  15. package/dist/chunk-R76EUYDI.cjs +233 -0
  16. package/dist/chunk-R76EUYDI.cjs.map +1 -0
  17. package/dist/chunk-RG5JZ6JL.js +378 -0
  18. package/dist/chunk-RG5JZ6JL.js.map +1 -0
  19. package/dist/components/index.cjs +158 -1513
  20. package/dist/components/index.cjs.map +1 -1
  21. package/dist/components/index.d.cts +2 -2
  22. package/dist/components/index.d.ts +2 -2
  23. package/dist/components/index.js +2 -2
  24. package/dist/hooks/index.cjs +693 -457
  25. package/dist/hooks/index.cjs.map +1 -1
  26. package/dist/hooks/index.d.cts +109 -28
  27. package/dist/hooks/index.d.ts +109 -28
  28. package/dist/hooks/index.js +659 -178
  29. package/dist/hooks/index.js.map +1 -1
  30. package/dist/{index-DQ3Xovkq.d.ts → index-BAyr1ODZ.d.ts} +76 -6
  31. package/dist/{index-UxuvIlmD.d.cts → index-C20NVU7_.d.cts} +76 -6
  32. package/dist/index.cjs +284 -1752
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +7 -8
  35. package/dist/index.d.ts +7 -8
  36. package/dist/index.js +64 -4
  37. package/dist/index.js.map +1 -1
  38. package/dist/signers/index.cjs +22 -161
  39. package/dist/signers/index.cjs.map +1 -1
  40. package/dist/signers/index.d.cts +16 -11
  41. package/dist/signers/index.d.ts +16 -11
  42. package/dist/signers/index.js +1 -1
  43. package/dist/testing/index.d.cts +1 -1
  44. package/dist/testing/index.d.ts +1 -1
  45. package/dist/theme/agenc-tailwind-preset.cjs +134 -108
  46. package/dist/{types-jvISR6bc.d.cts → types-B10rndEI.d.cts} +16 -7
  47. package/dist/{types-jvISR6bc.d.ts → types-B10rndEI.d.ts} +16 -7
  48. package/dist/{useAgentTrackRecord-BCvRHYM2.d.cts → useAgentTrackRecord-Ch7gHTFj.d.cts} +40 -3
  49. package/dist/{useAgentTrackRecord-BCvRHYM2.d.ts → useAgentTrackRecord-Ch7gHTFj.d.ts} +40 -3
  50. package/package.json +6 -3
  51. package/src/components/GuaranteedBadge.tsx +73 -0
  52. package/src/components/HireCheckoutModal.tsx +5 -2
  53. package/src/components/index.ts +4 -0
  54. package/src/components/strings.ts +8 -0
  55. package/src/hooks/index.ts +14 -0
  56. package/src/hooks/internal.ts +179 -22
  57. package/src/hooks/useAgentTrackRecord.ts +5 -2
  58. package/src/hooks/useCompletionBond.ts +191 -0
  59. package/src/hooks/useDispute.ts +46 -9
  60. package/src/hooks/useHire.ts +113 -23
  61. package/src/hooks/useHumanlessHireFlow.ts +335 -115
  62. package/src/hooks/useListing.ts +2 -2
  63. package/src/hooks/useListings.ts +2 -2
  64. package/src/hooks/useRateHire.ts +32 -5
  65. package/src/hooks/useReferrerEarnings.ts +4 -1
  66. package/src/hooks/useSubmissionReview.ts +95 -32
  67. package/src/hooks/useTaskActivation.ts +51 -9
  68. package/src/hooks/useTaskGuarantee.ts +123 -0
  69. package/src/hooks/useTaskLifecycle.ts +104 -24
  70. package/src/hooks/useTaskStatus.ts +121 -26
  71. package/src/hooks/useTaskWork.ts +76 -12
  72. package/src/hooks/useWalletSigner.ts +11 -16
  73. package/src/index.ts +5 -0
  74. package/src/provider/AgencProvider.tsx +95 -3
  75. package/src/provider/referrer.ts +1 -1
  76. package/src/signers/README.md +13 -7
  77. package/src/signers/index.ts +6 -1
  78. package/src/signers/strings.ts +13 -1
  79. package/src/signers/types.ts +16 -5
  80. package/src/signers/wallet-account.ts +115 -29
  81. package/src/signers/wallet-adapter.ts +38 -4
  82. package/src/theme/agenc-tailwind-preset.cjs +134 -108
  83. package/src/types.ts +32 -3
  84. package/dist/chunk-BNILOX3O.js.map +0 -1
  85. package/dist/chunk-BTAVED7S.js +0 -226
  86. package/dist/chunk-BTAVED7S.js.map +0 -1
  87. package/dist/chunk-ON6XR4XO.js +0 -128
  88. package/dist/chunk-ON6XR4XO.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,144 +1,16 @@
1
1
  'use strict';
2
2
 
3
+ var chunkONC6L3IX_cjs = require('./chunk-ONC6L3IX.cjs');
4
+ var chunkR76EUYDI_cjs = require('./chunk-R76EUYDI.cjs');
5
+ var chunkIJKWKY4H_cjs = require('./chunk-IJKWKY4H.cjs');
6
+ var chunkJTSG5FGC_cjs = require('./chunk-JTSG5FGC.cjs');
7
+ var chunkFIDFPM5A_cjs = require('./chunk-FIDFPM5A.cjs');
3
8
  var reactQuery = require('@tanstack/react-query');
4
9
  var marketplaceSdk = require('@tetsuo-ai/marketplace-sdk');
5
10
  var react = require('react');
6
11
  var kit = require('@solana/kit');
7
12
  var jsxRuntime = require('react/jsx-runtime');
8
13
 
9
- // src/provider/AgencProvider.tsx
10
-
11
- // src/strings/index.ts
12
- var EN_STRINGS = {
13
- // Provider / context wiring errors (developer-facing, but routed for parity).
14
- "provider.missingContext": "useAgencContext must be used within <AgencProvider>.",
15
- "provider.missingWriteClient": "No write client is configured. Pass config.client, or config.rpcUrl + config.signer, to <AgencProvider> before using a mutating hook.",
16
- "provider.missingSigner": "No signer is configured on <AgencProvider>. Connect a wallet or pass config.signer.",
17
- // Referrer config validation / capability surface.
18
- "referrer.invalidWallet": "Referrer wallet is not a valid base58 Solana address: {wallet}.",
19
- "referrer.invalidFeeBps": "Referrer feeBps must be an integer between {min} and {max} (basis points); got {feeBps}.",
20
- "referrer.notLive": "Referral fee is not active for this hire.",
21
- "referrer.notLiveReason": "No referrer is configured for this provider.",
22
- "referrer.earningsNotLiveReason": "Referral settlement is live, but no earnings endpoint is available on this network (configure indexer.baseUrl).",
23
- "referrer.earningsFetchFailed": "The referrer earnings endpoint could not be read.",
24
- // Read transport.
25
- "transport.noReadSource": "No read source is configured. Pass an indexer baseUrl, an rpc/queryTransport, to <AgencProvider> or createReadTransport().",
26
- // Generic loading / empty / error states (components extend these).
27
- "state.loading": "Loading\u2026",
28
- "state.empty": "Nothing to show yet.",
29
- "state.error": "Something went wrong.",
30
- // Hire flow shells (components fill out the rest).
31
- "hire.cta": "Hire",
32
- "hire.pending": "Confirming\u2026",
33
- "hire.funded": "Escrow funded."
34
- };
35
- function t(id, vars, options) {
36
- const catalog = options?.catalog ?? EN_STRINGS;
37
- const template = catalog[id] ?? id;
38
- if (vars === void 0) return template;
39
- return template.replace(/\{(\w+)\}/g, (match, key) => {
40
- const value = vars[key];
41
- return value === void 0 ? match : String(value);
42
- });
43
- }
44
-
45
- // src/transport/index.ts
46
- var ReadTransportUnsupportedError = class extends Error {
47
- /** The unsupported operation name. */
48
- operation;
49
- constructor(operation) {
50
- super(
51
- `Read operation "${operation}" requires the indexer backend; the gPA fallback has no trustless equivalent. Configure an indexer baseUrl on <AgencProvider> to use it.`
52
- );
53
- this.name = "ReadTransportUnsupportedError";
54
- this.operation = operation;
55
- }
56
- };
57
- function toAddress(pda) {
58
- if (typeof pda !== "string") return pda;
59
- if (!kit.isAddress(pda)) {
60
- throw new TypeError(`Not a valid base58 Solana address: ${pda}`);
61
- }
62
- return kit.address(pda);
63
- }
64
- function indexerReadTransport(config, indexerClientOptions) {
65
- const client = marketplaceSdk.createIndexerClient({
66
- baseUrl: config.baseUrl,
67
- apiKey: config.apiKey,
68
- ...indexerClientOptions ?? {}
69
- });
70
- return {
71
- kind: "indexer",
72
- listActiveListings: (options) => client.listActiveListings(options),
73
- async getListing(pda) {
74
- const listing = await client.getListing(pda);
75
- const account = marketplaceSdk.getServiceListingDecoder().decode(
76
- base64ToBytes(listing.accountData)
77
- );
78
- return {
79
- address: toAddress(listing.pda),
80
- account,
81
- indexer: listing
82
- };
83
- },
84
- listingHires: (pda) => client.listingHires(pda),
85
- agentTrackRecord: (pda) => client.agentTrackRecord(pda)
86
- };
87
- }
88
- function gpaReadTransport(rpc) {
89
- return {
90
- kind: "gpa",
91
- listActiveListings: (options) => marketplaceSdk.listActiveListings(rpc, options),
92
- async getListing(pda) {
93
- const target = toAddress(pda);
94
- const all = await marketplaceSdk.listActiveListings(rpc, {});
95
- const hit = all.find((entry) => entry.address === target);
96
- if (hit === void 0) {
97
- throw new Error(
98
- `Listing ${pda} not found among active listings via the gPA fallback (it may be inactive, or your RPC restricts getProgramAccounts \u2014 use an indexer baseUrl for single-listing lookups).`
99
- );
100
- }
101
- return { address: hit.address, account: hit.account };
102
- },
103
- listingHires() {
104
- return Promise.reject(new ReadTransportUnsupportedError("listingHires"));
105
- },
106
- agentTrackRecord() {
107
- return Promise.reject(
108
- new ReadTransportUnsupportedError("agentTrackRecord")
109
- );
110
- }
111
- };
112
- }
113
- function base64ToBytes(b64) {
114
- if (typeof atob === "function") {
115
- const binary = atob(b64);
116
- const bytes = new Uint8Array(binary.length);
117
- for (let i = 0; i < binary.length; i += 1) {
118
- bytes[i] = binary.charCodeAt(i);
119
- }
120
- return bytes;
121
- }
122
- return Uint8Array.from(Buffer.from(b64, "base64"));
123
- }
124
- function createReadTransport(config) {
125
- if (config.queryTransport) return config.queryTransport;
126
- if (config.indexer?.baseUrl) {
127
- return indexerReadTransport(config.indexer, config.indexerClientOptions);
128
- }
129
- if (config.rpc) return gpaReadTransport(config.rpc);
130
- throw new Error(t("transport.noReadSource"));
131
- }
132
- var AgencContext = react.createContext(null);
133
- AgencContext.displayName = "AgencContext";
134
- function useAgencContext() {
135
- const ctx = react.useContext(AgencContext);
136
- if (ctx === null) {
137
- throw new Error(t("provider.missingContext"));
138
- }
139
- return ctx;
140
- }
141
-
142
14
  // src/provider/network.ts
143
15
  var NETWORK_HTTP_DEFAULTS = {
144
16
  localnet: "http://127.0.0.1:8899",
@@ -170,11 +42,11 @@ var REFERRER_FEE_BPS_MAX = 2e3;
170
42
  function validateReferrerConfig(config) {
171
43
  const { wallet, feeBps } = config;
172
44
  if (typeof wallet !== "string" || !kit.isAddress(wallet)) {
173
- throw new TypeError(t("referrer.invalidWallet", { wallet: String(wallet) }));
45
+ throw new TypeError(chunkFIDFPM5A_cjs.t("referrer.invalidWallet", { wallet: String(wallet) }));
174
46
  }
175
47
  if (typeof feeBps !== "number" || !Number.isInteger(feeBps) || feeBps < REFERRER_FEE_BPS_MIN || feeBps > REFERRER_FEE_BPS_MAX) {
176
48
  throw new RangeError(
177
- t("referrer.invalidFeeBps", {
49
+ chunkFIDFPM5A_cjs.t("referrer.invalidFeeBps", {
178
50
  min: REFERRER_FEE_BPS_MIN,
179
51
  max: REFERRER_FEE_BPS_MAX,
180
52
  feeBps: String(feeBps)
@@ -187,7 +59,7 @@ function resolveReferrerCapability(referrer) {
187
59
  if (!referrer) {
188
60
  return {
189
61
  live: false,
190
- reason: t("referrer.notLiveReason")
62
+ reason: chunkFIDFPM5A_cjs.t("referrer.notLiveReason")
191
63
  };
192
64
  }
193
65
  return {
@@ -206,8 +78,42 @@ var DEFAULT_QUERY_CLIENT_CONFIG = {
206
78
  }
207
79
  }
208
80
  };
81
+ var OPAQUE_DEPLOYMENT_IDS = /* @__PURE__ */ new WeakMap();
82
+ var nextOpaqueDeploymentId = 1;
83
+ function opaqueDeploymentId(value) {
84
+ if (value === void 0) return null;
85
+ const existing = OPAQUE_DEPLOYMENT_IDS.get(value);
86
+ if (existing !== void 0) return existing;
87
+ const allocated = nextOpaqueDeploymentId++;
88
+ OPAQUE_DEPLOYMENT_IDS.set(value, allocated);
89
+ return allocated;
90
+ }
91
+ function cacheFingerprint(value) {
92
+ if (value == null) return null;
93
+ let hash = 0xcbf29ce484222325n;
94
+ for (let index = 0; index < value.length; index += 1) {
95
+ hash ^= BigInt(value.charCodeAt(index));
96
+ hash = BigInt.asUintN(64, hash * 0x100000001b3n);
97
+ }
98
+ return hash.toString(16).padStart(16, "0");
99
+ }
100
+ function resolveCacheNamespace(config, network, rpcUrl) {
101
+ const explicit = config.cacheNamespace?.trim();
102
+ if (config.cacheNamespace !== void 0 && !explicit) {
103
+ throw new TypeError("AgencProvider cacheNamespace must not be empty.");
104
+ }
105
+ return JSON.stringify({
106
+ version: 1,
107
+ network,
108
+ rpc: cacheFingerprint(rpcUrl),
109
+ indexer: cacheFingerprint(config.indexer?.baseUrl),
110
+ custom: cacheFingerprint(explicit),
111
+ queryTransport: explicit === void 0 ? opaqueDeploymentId(config.queryTransport) : null,
112
+ client: explicit === void 0 ? opaqueDeploymentId(config.client) : null
113
+ });
114
+ }
209
115
  function buildReadTransport(config) {
210
- return createReadTransport({
116
+ return chunkONC6L3IX_cjs.createReadTransport({
211
117
  indexer: config.indexer,
212
118
  queryTransport: config.queryTransport
213
119
  // The gPA read source is provided only via queryTransport in v1 (a kit RPC
@@ -231,6 +137,16 @@ function buildWriteClient(config, network) {
231
137
  signer: config.signer
232
138
  });
233
139
  }
140
+ function assertSignerMatchesNetwork(signer, network, source) {
141
+ const chain = typeof signer === "object" && signer !== null && "chain" in signer ? signer.chain : void 0;
142
+ if (typeof chain !== "string") return;
143
+ const expected = chunkR76EUYDI_cjs.walletStandardChainForNetwork(network);
144
+ if (chain !== expected) {
145
+ throw new Error(
146
+ `${source} is bound to ${chain}, but AgencProvider network ${network} requires ${expected}.`
147
+ );
148
+ }
149
+ }
234
150
  function AgencProvider(props) {
235
151
  const { config, children } = props;
236
152
  const [internalQueryClient] = react.useState(
@@ -239,6 +155,12 @@ function AgencProvider(props) {
239
155
  const queryClient = props.queryClient ?? internalQueryClient;
240
156
  const value = react.useMemo(() => {
241
157
  const network = config.network ?? "mainnet";
158
+ assertSignerMatchesNetwork(config.signer, network, "config.signer");
159
+ assertSignerMatchesNetwork(
160
+ config.client?.signer,
161
+ network,
162
+ "config.client.signer"
163
+ );
242
164
  const referrer = config.referrer ? validateReferrerConfig(config.referrer) : null;
243
165
  const read = buildReadTransport(config);
244
166
  const client = buildWriteClient(config, network);
@@ -247,1641 +169,251 @@ function AgencProvider(props) {
247
169
  config.rpcUrl,
248
170
  config.rpcSubscriptionsUrl
249
171
  );
172
+ const orchestrationRpcUrl = config.orchestrationRpc !== void 0 ? null : config.client !== void 0 ? config.rpcUrl ?? null : rpcUrl ?? null;
173
+ const cacheNamespace = resolveCacheNamespace(
174
+ config,
175
+ network,
176
+ rpcUrl ?? null
177
+ );
250
178
  return {
251
179
  network,
180
+ cacheNamespace,
252
181
  read,
253
182
  client,
254
183
  rpcUrl: rpcUrl ?? null,
184
+ orchestrationRpc: config.orchestrationRpc ?? null,
185
+ orchestrationRpcUrl,
255
186
  indexerBaseUrl: config.indexer?.baseUrl ?? null,
256
187
  signer: config.signer ?? null,
257
188
  referrer,
258
189
  resolveReferrerCapability: () => resolveReferrerCapability(referrer)
259
190
  };
260
191
  }, [config]);
261
- return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(AgencContext.Provider, { value, children }) });
262
- }
263
-
264
- // src/theme/index.ts
265
- var AGENC_THEME_CLASS = "agenc";
266
- var AGENC_TOKENS_CSS_PATH = "@tetsuo-ai/marketplace-react/theme.css";
267
- function resolveThemeClassName(unstyled, extra) {
268
- if (unstyled) {
269
- return extra && extra.trim() !== "" ? extra : void 0;
270
- }
271
- const composed = [AGENC_THEME_CLASS, extra].filter((part) => Boolean(part && part.trim() !== "")).join(" ");
272
- return composed === "" ? void 0 : composed;
273
- }
274
- function agencThemeStyleTag() {
275
- return `:root,.${AGENC_THEME_CLASS}{--agenc-void:#0A0612;--agenc-surface:#16102A;--agenc-surface-2:#221638;--agenc-surface-3:#2E1A4A;--agenc-violet:#7B3FFF;--agenc-magenta:#FF2E93;--agenc-orange:#FF6B1A;--agenc-cyan:#48C8EF;--agenc-text:#F5F0FF;--agenc-text-muted:#B8A8D9;--agenc-text-dim:#6E5C8F;--agenc-success:#3FFFA0;--agenc-warning:#FFC53F;--agenc-danger:#FF3D3D;--agenc-border:#2E1A4A;--agenc-border-strong:#4A2E7A;--agenc-radius-sm:4px;--agenc-radius:8px;--agenc-radius-lg:12px;--agenc-radius-pill:9999px;}`;
276
- }
277
-
278
- // src/signers/strings.ts
279
- var EN_SIGNER_STRINGS = {
280
- "signer.walletNoSignFeature": "Wallet account {address} does not expose a solana:signTransaction feature. Pass options.signTransaction explicitly, or use a Wallet Standard account that supports transaction signing.",
281
- "signer.walletNoSignature": "The wallet returned no signature for account {address}. The wallet may have rejected or modified the transaction so the fee-payer signature is absent.",
282
- "signer.embeddedSignatureCount": "Embedded wallet returned {got} signatures for {expected} transactions; expected one per transaction.",
283
- "signer.walletAdapterDisconnected": "The wallet adapter is not connected (publicKey is null). Connect the wallet before creating a signer.",
284
- "signer.walletAdapterNoSign": "The wallet adapter does not expose signTransaction. Use a wallet that supports transaction signing, or migrate to the Wallet Standard path (signerFromWalletAccount)."
285
- };
286
- function ts(id, vars) {
287
- return t(id, vars, { catalog: EN_SIGNER_STRINGS });
288
- }
289
-
290
- // src/signers/wallet-account.ts
291
- var SOLANA_SIGN_TRANSACTION = "solana:signTransaction";
292
- function resolveSignTransaction(account, options) {
293
- if (options.signTransaction) return options.signTransaction;
294
- const feature = account.features?.[SOLANA_SIGN_TRANSACTION];
295
- if (feature?.signTransaction) return feature.signTransaction;
296
- throw new Error(ts("signer.walletNoSignFeature", { address: account.address }));
297
- }
298
- function resolveChain(account, options) {
299
- if (options.chain) return options.chain;
300
- return account.chains?.find((c) => c.startsWith("solana:"));
301
- }
302
- function signerFromWalletAccount(account, options = {}) {
303
- const signerAddress2 = kit.address(account.address);
304
- const signTransaction = resolveSignTransaction(account, options);
305
- const chain = resolveChain(account, options);
306
- const encoder = kit.getTransactionEncoder();
307
- const decoder = kit.getTransactionDecoder();
308
- async function signOne(transaction) {
309
- const wireBytes = new Uint8Array(encoder.encode(transaction));
310
- const [output] = await signTransaction({
311
- transaction: wireBytes,
312
- ...chain ? { chain } : {}
313
- });
314
- if (!output) {
315
- throw new Error(ts("signer.walletNoSignature", { address: account.address }));
316
- }
317
- const signed = decoder.decode(output.signedTransaction);
318
- const signature = signed.signatures[signerAddress2];
319
- if (!signature) {
320
- throw new Error(ts("signer.walletNoSignature", { address: account.address }));
321
- }
322
- return signature;
323
- }
324
- return {
325
- address: signerAddress2,
326
- async signTransactions(transactions) {
327
- return Promise.all(
328
- transactions.map(async (transaction) => ({
329
- [signerAddress2]: await signOne(transaction)
330
- }))
331
- );
332
- }
333
- };
334
- }
335
- function resolveAdapterAddress(adapter) {
336
- const { publicKey } = adapter;
337
- if (publicKey == null) {
338
- throw new Error(ts("signer.walletAdapterDisconnected"));
339
- }
340
- if (typeof publicKey === "string") return publicKey;
341
- if ("toBase58" in publicKey && typeof publicKey.toBase58 === "function") {
342
- return publicKey.toBase58();
343
- }
344
- return String(publicKey);
345
- }
346
- function signerFromWalletAdapter(adapter, options) {
347
- const signerAddress2 = kit.address(resolveAdapterAddress(adapter));
348
- const { signTransaction } = adapter;
349
- if (typeof signTransaction !== "function") {
350
- throw new Error(ts("signer.walletAdapterNoSign"));
351
- }
352
- const { VersionedTransaction } = options;
353
- const encoder = kit.getTransactionEncoder();
354
- const decoder = kit.getTransactionDecoder();
355
- async function signOne(transaction) {
356
- const wireBytes = new Uint8Array(encoder.encode(transaction));
357
- const legacyTx = VersionedTransaction.deserialize(wireBytes);
358
- const signed = await signTransaction(legacyTx);
359
- const signedTx = decoder.decode(new Uint8Array(signed.serialize()));
360
- const signature = signedTx.signatures[signerAddress2];
361
- if (!signature) {
362
- throw new Error(
363
- ts("signer.walletNoSignature", { address: signerAddress2 })
364
- );
365
- }
366
- return signature;
367
- }
368
- return {
369
- address: signerAddress2,
370
- async signTransactions(transactions) {
371
- return Promise.all(
372
- transactions.map(async (transaction) => ({
373
- [signerAddress2]: await signOne(transaction)
374
- }))
375
- );
376
- }
377
- };
378
- }
379
- function signerFromEmbeddedWallet(connection) {
380
- const signerAddress2 = kit.address(connection.address);
381
- return {
382
- address: signerAddress2,
383
- async signTransactions(transactions) {
384
- const signatures = await connection.signTransactions(transactions);
385
- if (signatures.length !== transactions.length) {
386
- throw new Error(
387
- ts("signer.embeddedSignatureCount", {
388
- expected: transactions.length,
389
- got: signatures.length
390
- })
391
- );
392
- }
393
- return transactions.map((_, i) => ({
394
- [signerAddress2]: signatures[i]
395
- }));
396
- }
397
- };
398
- }
399
-
400
- // src/components/strings.ts
401
- var EN_COMPONENT_STRINGS = {
402
- // Shared / cross-component.
403
- "components.common.loading": "Loading\u2026",
404
- "components.common.empty": "Nothing to show yet.",
405
- "components.common.error": "Something went wrong.",
406
- "components.common.retry": "Retry",
407
- "components.common.close": "Close",
408
- "components.common.verified": "Verified",
409
- "components.common.unverified": "Unverified",
410
- "components.common.sol": "SOL",
411
- "components.common.lamports": "lamports",
412
- // ListingCard.
413
- "components.listingCard.priceLabel": "Price",
414
- "components.listingCard.byProvider": "by {provider}",
415
- "components.listingCard.untitled": "Untitled service",
416
- "components.listingCard.hires": "{count} hires",
417
- "components.listingCard.category": "Category",
418
- // ListingGrid.
419
- "components.listingGrid.empty": "No listings match your filters yet.",
420
- "components.listingGrid.loadMore": "Load more",
421
- "components.listingGrid.error": "Could not load listings.",
422
- // HireButton / Checkout.
423
- "components.hire.cta": "Hire",
424
- "components.hire.ctaPrice": "Hire \u2014 {price}",
425
- "components.hire.checkoutTitle": "Confirm hire",
426
- "components.hire.priceLabel": "You pay",
427
- "components.hire.escrowNote": "Funds are held in protocol escrow and released to the provider only when you accept the result.",
428
- "components.hire.confirm": "Confirm and fund escrow",
429
- "components.hire.cancel": "Cancel",
430
- "components.hire.pending": "Confirming\u2026",
431
- "components.hire.success": "Escrow funded.",
432
- "components.hire.successDetail": "Your task is created. Track it below.",
433
- "components.hire.viewTask": "View task",
434
- "components.hire.errorTitle": "Hire failed",
435
- "components.hire.moderationAttested": "Moderation attested",
436
- "components.hire.moderationPending": "Moderation pending",
437
- "components.hire.moderationIssues": "Moderation issues found",
438
- "components.hire.notConnected": "Connect a wallet to hire.",
439
- // Referrer disclosure.
440
- "components.referrer.disclosure": "This site earns a referral fee.",
441
- "components.referrer.disclosurePending": "Referral fee is not active for this hire.",
442
- "components.referrer.feeBps": "{bps} bps",
443
- // TaskTimeline.
444
- "components.taskTimeline.title": "Task progress",
445
- "components.taskTimeline.empty": "No task to track yet.",
446
- "components.taskTimeline.status.Open": "Open",
447
- "components.taskTimeline.status.InProgress": "In progress",
448
- "components.taskTimeline.status.PendingValidation": "Pending review",
449
- "components.taskTimeline.status.Completed": "Completed",
450
- "components.taskTimeline.status.Cancelled": "Cancelled",
451
- "components.taskTimeline.status.Disputed": "Disputed",
452
- "components.taskTimeline.status.RejectFrozen": "Rejected (frozen)",
453
- // ReviewPanel.
454
- "components.review.title": "Review submission",
455
- "components.review.noSubmission": "Awaiting the worker's submission.",
456
- "components.review.accept": "Accept and release escrow",
457
- "components.review.reject": "Reject",
458
- "components.review.requestChanges": "Request changes",
459
- "components.review.accepted": "Result accepted. Escrow released.",
460
- "components.review.rejected": "Result rejected.",
461
- "components.review.changesRequested": "Changes requested.",
462
- "components.review.pending": "Submitting\u2026",
463
- "components.review.errorTitle": "Review action failed",
464
- // DisputeBanner.
465
- "components.dispute.title": "This task is in dispute.",
466
- "components.dispute.body": "A dispute has been opened. A protocol resolver decides the outcome; funds stay in escrow until then.",
467
- "components.dispute.initiate": "Open a dispute",
468
- "components.dispute.pending": "Opening dispute\u2026",
469
- "components.dispute.opened": "Dispute opened.",
470
- "components.dispute.none": "No open dispute.",
471
- "components.dispute.errorTitle": "Could not open dispute",
472
- // ProviderCard.
473
- "components.provider.title": "Provider",
474
- "components.provider.completionRate": "Completion rate",
475
- "components.provider.disputeRate": "Dispute rate",
476
- "components.provider.completions": "{count} completed",
477
- "components.provider.disputes": "{count} disputes",
478
- "components.provider.provisional": "provisional",
479
- "components.provider.noData": "No track record yet.",
480
- "components.provider.unavailable": "Track record is unavailable on this read transport.",
481
- // Domain trust (P7.3) — VERIFIED is an on-chain attestation; CLAIMED is the
482
- // operator's self-reported metadata. The copy keeps them distinct so a buyer
483
- // never reads an unverified claim as a proven one.
484
- "components.provider.verifiedDomain": "Verified: {domain}",
485
- "components.provider.verifiedDomainLabel": "Verified domain {domain}",
486
- "components.provider.claimedDomain": "Claims: {domain}",
487
- "components.provider.claimedDomainLabel": "Claimed domain {domain} (not verified on-chain)",
488
- // PoweredByAgenC.
489
- "components.poweredBy.label": "Powered by AgenC",
490
- "components.poweredBy.trustLink": "Learn how this works"
491
- };
492
- var COMPONENT_CATALOG = {
493
- ...EN_STRINGS,
494
- ...EN_COMPONENT_STRINGS
495
- };
496
-
497
- // src/components/format.ts
498
- function tc(id, vars, options) {
499
- return t(id, vars, { catalog: COMPONENT_CATALOG, ...options });
500
- }
501
- var LAMPORTS_PER_SOL = 1000000000n;
502
- function formatSol(lamports) {
503
- const negative = lamports < 0n;
504
- const abs = negative ? -lamports : lamports;
505
- const whole = abs / LAMPORTS_PER_SOL;
506
- const frac = abs % LAMPORTS_PER_SOL;
507
- let out;
508
- if (frac === 0n) {
509
- out = whole.toString();
510
- } else {
511
- const fracStr = frac.toString().padStart(9, "0").replace(/0+$/, "");
512
- out = `${whole.toString()}.${fracStr}`;
513
- }
514
- return negative ? `-${out}` : out;
515
- }
516
- function formatPriceSol(lamports, options) {
517
- return `${formatSol(lamports)} ${t("components.common.sol", void 0, {
518
- catalog: COMPONENT_CATALOG,
519
- ...options
520
- })}`;
521
- }
522
- function truncateAddress(value, head = 4, tail = 4) {
523
- if (value === null || value === void 0) return "";
524
- const s = String(value);
525
- if (s.length <= head + tail + 1) return s;
526
- return `${s.slice(0, head)}\u2026${s.slice(-tail)}`;
527
- }
528
- function decodeListingName(listing) {
529
- try {
530
- return marketplaceSdk.values.decodeListingName(Uint8Array.from(listing.name));
531
- } catch {
532
- return "";
533
- }
534
- }
535
- function decodeListingCategory(listing) {
536
- try {
537
- return marketplaceSdk.values.decodeListingCategory(Uint8Array.from(listing.category));
538
- } catch {
539
- return "";
540
- }
541
- }
542
- function decodeListingTags(listing) {
543
- try {
544
- return marketplaceSdk.values.decodeListingTags(Uint8Array.from(listing.tags));
545
- } catch {
546
- return [];
547
- }
548
- }
549
- function toHex(bytes) {
550
- let out = "";
551
- for (let i = 0; i < bytes.length; i++) {
552
- out += bytes[i].toString(16).padStart(2, "0");
553
- }
554
- return out;
555
- }
556
- function formatRate(rate, fallback = "\u2014") {
557
- if (rate === null || Number.isNaN(rate)) return fallback;
558
- const pct = Math.round(rate * 100);
559
- return `${pct}%`;
560
- }
561
- function cx(...parts) {
562
- return parts.filter((p) => Boolean(p)).join(" ");
563
- }
564
- function elementClass(base, unstyled, extra) {
565
- if (unstyled) return extra && extra.trim() !== "" ? extra : void 0;
566
- return cx(base, extra) || void 0;
567
- }
568
- function rootClass(base, unstyled, extra) {
569
- if (unstyled) return extra && extra.trim() !== "" ? extra : void 0;
570
- return cx(AGENC_THEME_CLASS, base, extra) || void 0;
571
- }
572
- var STATE_STRING = {
573
- loading: "components.common.loading",
574
- empty: "components.common.empty",
575
- error: "components.common.error"
576
- };
577
- function StateMessage({
578
- kind,
579
- message,
580
- onRetry,
581
- role,
582
- unstyled,
583
- className
584
- }) {
585
- const text = message ?? tc(STATE_STRING[kind]);
586
- const resolvedRole = role ?? (kind === "error" ? "alert" : "status");
587
- return /* @__PURE__ */ jsxRuntime.jsxs(
588
- "div",
589
- {
590
- className: elementClass(`agenc-state agenc-state--${kind}`, unstyled, className),
591
- role: resolvedRole,
592
- "aria-live": kind === "error" ? "assertive" : "polite",
593
- "aria-busy": kind === "loading" ? true : void 0,
594
- children: [
595
- kind === "loading" ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { unstyled }) : null,
596
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: unstyled ? void 0 : "agenc-state__text", children: text }),
597
- onRetry && kind !== "loading" ? /* @__PURE__ */ jsxRuntime.jsx(Button, { unstyled, variant: "ghost", onClick: onRetry, children: tc("components.common.retry") }) : null
598
- ]
599
- }
600
- );
601
- }
602
- function Spinner({ label, unstyled, className }) {
603
- return /* @__PURE__ */ jsxRuntime.jsx(
604
- "span",
605
- {
606
- className: elementClass("agenc-spinner", unstyled, className),
607
- role: "status",
608
- "aria-live": "polite",
609
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: unstyled ? void 0 : "agenc-visually-hidden", children: label ?? tc("components.common.loading") })
610
- }
611
- );
612
- }
613
- function Badge({
614
- tone = "neutral",
615
- children,
616
- label,
617
- unstyled,
618
- className
619
- }) {
620
- return /* @__PURE__ */ jsxRuntime.jsx(
621
- "span",
622
- {
623
- className: elementClass(
624
- `agenc-badge agenc-badge--${tone}`,
625
- unstyled,
626
- className
627
- ),
628
- title: label,
629
- "aria-label": label,
630
- children
631
- }
632
- );
633
- }
634
- function Button({
635
- variant = "primary",
636
- loading = false,
637
- unstyled,
638
- className,
639
- children,
640
- disabled,
641
- type,
642
- ...rest
643
- }) {
644
- return /* @__PURE__ */ jsxRuntime.jsxs(
645
- "button",
646
- {
647
- type: type ?? "button",
648
- className: elementClass(
649
- `agenc-button agenc-button--${variant}`,
650
- unstyled,
651
- className
652
- ),
653
- disabled: disabled || loading,
654
- "aria-busy": loading || void 0,
655
- ...rest,
656
- children: [
657
- loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { unstyled }) : null,
658
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: unstyled ? void 0 : "agenc-button__label", children })
659
- ]
660
- }
661
- );
662
- }
663
- function moderationStateOf(moderation) {
664
- if (!moderation) return "pending";
665
- return moderation.metadataValid ? "attested" : "issues";
666
- }
667
- var MODERATION_TONE = {
668
- attested: "success",
669
- pending: "neutral",
670
- issues: "warning"
671
- };
672
- var MODERATION_STRING = {
673
- attested: "components.hire.moderationAttested",
674
- pending: "components.hire.moderationPending",
675
- // Distinct from `pending` ("Moderation pending") so a buyer can textually
676
- // tell "we found problems" apart from "we haven't checked", not just by tone.
677
- issues: "components.hire.moderationIssues"
678
- };
679
- function ModerationBadge({
680
- moderation,
681
- state,
682
- unstyled,
683
- className
684
- }) {
685
- const resolved = state ?? moderationStateOf(moderation);
686
- const label = tc(MODERATION_STRING[resolved]);
687
- const issues = resolved === "issues" && moderation?.metadataIssues?.length ? moderation.metadataIssues.join("; ") : void 0;
688
- return /* @__PURE__ */ jsxRuntime.jsx(
689
- Badge,
690
- {
691
- tone: MODERATION_TONE[resolved],
692
- unstyled,
693
- className,
694
- label: issues ?? label,
695
- children: label
696
- }
697
- );
698
- }
699
- function VerifiedBadge({
700
- verified,
701
- unstyled,
702
- className
703
- }) {
704
- return /* @__PURE__ */ jsxRuntime.jsx(
705
- Badge,
706
- {
707
- tone: verified ? "success" : "neutral",
708
- unstyled,
709
- className,
710
- children: verified ? tc("components.common.verified") : tc("components.common.unverified")
711
- }
712
- );
713
- }
714
- var FOCUSABLE_SELECTOR = [
715
- "a[href]",
716
- "button:not([disabled])",
717
- "textarea:not([disabled])",
718
- "input:not([disabled])",
719
- "select:not([disabled])",
720
- '[tabindex]:not([tabindex="-1"])'
721
- ].join(",");
722
- function focusableWithin(container) {
723
- return Array.from(
724
- container.querySelectorAll(FOCUSABLE_SELECTOR)
725
- ).filter((el) => el.offsetParent !== null || el === document.activeElement);
726
- }
727
- function useFocusTrap(containerRef, active, onEscape) {
728
- react.useEffect(() => {
729
- if (!active) return;
730
- const container = containerRef.current;
731
- if (!container) return;
732
- const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
733
- const initial = focusableWithin(container)[0] ?? container;
734
- initial.focus();
735
- function onKeyDown(event) {
736
- if (event.key === "Escape") {
737
- event.stopPropagation();
738
- onEscape?.();
739
- return;
740
- }
741
- if (event.key !== "Tab") return;
742
- const focusable = focusableWithin(container);
743
- if (focusable.length === 0) {
744
- event.preventDefault();
745
- container.focus();
746
- return;
747
- }
748
- const first = focusable[0];
749
- const last = focusable[focusable.length - 1];
750
- const activeEl = document.activeElement;
751
- if (event.shiftKey) {
752
- if (activeEl === first || activeEl === container) {
753
- event.preventDefault();
754
- last.focus();
755
- }
756
- } else if (activeEl === last) {
757
- event.preventDefault();
758
- first.focus();
759
- }
760
- }
761
- function onFocusIn(event) {
762
- const target = event.target;
763
- if (!(target instanceof Node)) return;
764
- if (container.contains(target)) return;
765
- event.stopPropagation();
766
- const focusable = focusableWithin(container);
767
- (focusable[0] ?? container).focus();
768
- }
769
- container.addEventListener("keydown", onKeyDown);
770
- document.addEventListener("focusin", onFocusIn);
771
- return () => {
772
- container.removeEventListener("keydown", onKeyDown);
773
- document.removeEventListener("focusin", onFocusIn);
774
- previouslyFocused?.focus();
775
- };
776
- }, [containerRef, active, onEscape]);
777
- }
778
- function Modal({
779
- open,
780
- onClose,
781
- title,
782
- children,
783
- footer,
784
- disableEscapeClose = false,
785
- disableOverlayClose = false,
786
- hideCloseButton = false,
787
- closeLabel,
788
- unstyled,
789
- className
790
- }) {
791
- const dialogRef = react.useRef(null);
792
- const titleId = react.useId();
793
- const bodyId = react.useId();
794
- useFocusTrap(dialogRef, open, () => {
795
- if (!disableEscapeClose) onClose();
796
- });
797
- if (!open) return null;
798
- const overlayClass = rootClass("agenc-modal", unstyled, className);
799
- return /* @__PURE__ */ jsxRuntime.jsx(
800
- "div",
801
- {
802
- className: overlayClass,
803
- onMouseDown: (event) => {
804
- if (disableOverlayClose) return;
805
- if (event.target === event.currentTarget) onClose();
806
- },
807
- children: /* @__PURE__ */ jsxRuntime.jsxs(
808
- "div",
809
- {
810
- className: unstyled ? void 0 : "agenc-modal__dialog",
811
- ref: dialogRef,
812
- role: "dialog",
813
- "aria-modal": "true",
814
- "aria-labelledby": titleId,
815
- "aria-describedby": bodyId,
816
- tabIndex: -1,
817
- children: [
818
- /* @__PURE__ */ jsxRuntime.jsxs("header", { className: unstyled ? void 0 : "agenc-modal__header", children: [
819
- /* @__PURE__ */ jsxRuntime.jsx("h2", { id: titleId, className: unstyled ? void 0 : "agenc-modal__title", children: title }),
820
- hideCloseButton ? null : /* @__PURE__ */ jsxRuntime.jsx(
821
- "button",
822
- {
823
- type: "button",
824
- className: unstyled ? void 0 : "agenc-modal__close",
825
- "aria-label": closeLabel ?? tc("components.common.close"),
826
- onClick: onClose,
827
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: "\xD7" })
828
- }
829
- )
830
- ] }),
831
- /* @__PURE__ */ jsxRuntime.jsx("div", { id: bodyId, className: unstyled ? void 0 : "agenc-modal__body", children }),
832
- footer ? /* @__PURE__ */ jsxRuntime.jsx("footer", { className: unstyled ? void 0 : "agenc-modal__footer", children: footer }) : null
833
- ]
834
- }
835
- )
836
- }
837
- );
838
- }
839
- function ListingCard({
840
- listing,
841
- moderation,
842
- onHire,
843
- onSelect,
844
- hidePrice = false,
845
- unstyled,
846
- className
847
- }) {
848
- const { account } = listing;
849
- const name = decodeListingName(account) || tc("components.listingCard.untitled");
850
- const category = decodeListingCategory(account);
851
- const price = formatPriceSol(account.price);
852
- const provider = truncateAddress(account.providerAgent);
853
- const hires = account.totalHires;
854
- const cardClass = rootClass("agenc-listing-card", unstyled, className);
855
- const selectable = Boolean(onSelect);
856
- const heading = /* @__PURE__ */ jsxRuntime.jsx("h3", { className: unstyled ? void 0 : "agenc-listing-card__title", children: name });
857
- return /* @__PURE__ */ jsxRuntime.jsxs(
858
- "article",
859
- {
860
- className: cardClass,
861
- "aria-label": name,
862
- children: [
863
- /* @__PURE__ */ jsxRuntime.jsxs("header", { className: unstyled ? void 0 : "agenc-listing-card__header", children: [
864
- selectable ? /* @__PURE__ */ jsxRuntime.jsx(
865
- "button",
866
- {
867
- type: "button",
868
- className: unstyled ? void 0 : "agenc-listing-card__title-button",
869
- onClick: () => onSelect?.(listing),
870
- children: heading
871
- }
872
- ) : heading,
873
- /* @__PURE__ */ jsxRuntime.jsx(ModerationBadge, { moderation, unstyled })
874
- ] }),
875
- /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: unstyled ? void 0 : "agenc-listing-card__meta", children: [
876
- category ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: unstyled ? void 0 : "agenc-listing-card__meta-row", children: [
877
- /* @__PURE__ */ jsxRuntime.jsx("dt", { children: tc("components.listingCard.category") }),
878
- /* @__PURE__ */ jsxRuntime.jsx("dd", { children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { tone: "info", unstyled, children: category }) })
879
- ] }) : null,
880
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: unstyled ? void 0 : "agenc-listing-card__meta-row", children: [
881
- /* @__PURE__ */ jsxRuntime.jsx("dt", { children: tc("components.listingCard.byProvider", { provider }) }),
882
- /* @__PURE__ */ jsxRuntime.jsx("dd", { children: tc("components.listingCard.hires", { count: String(hires) }) })
883
- ] })
884
- ] }),
885
- /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: unstyled ? void 0 : "agenc-listing-card__footer", children: [
886
- hidePrice ? null : /* @__PURE__ */ jsxRuntime.jsxs("p", { className: unstyled ? void 0 : "agenc-listing-card__price", children: [
887
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: unstyled ? void 0 : "agenc-listing-card__price-label", children: tc("components.listingCard.priceLabel") }),
888
- " ",
889
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: unstyled ? void 0 : "agenc-listing-card__price-value", children: price })
890
- ] }),
891
- onHire ? /* @__PURE__ */ jsxRuntime.jsx(
892
- Button,
893
- {
894
- unstyled,
895
- variant: "primary",
896
- onClick: () => onHire(listing),
897
- children: tc("components.hire.cta")
898
- }
899
- ) : null
900
- ] })
901
- ]
902
- }
903
- );
904
- }
905
- function ListingGrid({
906
- listings,
907
- isLoading = false,
908
- error = null,
909
- hasMore = false,
910
- onLoadMore,
911
- onRetry,
912
- onHire,
913
- onSelect,
914
- moderationByPda,
915
- emptyMessage,
916
- unstyled,
917
- className
918
- }) {
919
- const gridClass = rootClass("agenc-listing-grid", unstyled, className);
920
- if (error) {
921
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: gridClass, children: /* @__PURE__ */ jsxRuntime.jsx(
922
- StateMessage,
923
- {
924
- kind: "error",
925
- message: tc("components.listingGrid.error"),
926
- onRetry,
927
- unstyled
928
- }
929
- ) });
930
- }
931
- if (isLoading && listings.length === 0) {
932
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: gridClass, children: /* @__PURE__ */ jsxRuntime.jsx(StateMessage, { kind: "loading", unstyled }) });
933
- }
934
- if (listings.length === 0) {
935
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: gridClass, children: /* @__PURE__ */ jsxRuntime.jsx(
936
- StateMessage,
937
- {
938
- kind: "empty",
939
- message: emptyMessage ?? tc("components.listingGrid.empty"),
940
- unstyled
941
- }
942
- ) });
943
- }
944
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: gridClass, children: [
945
- /* @__PURE__ */ jsxRuntime.jsx(
946
- "ul",
947
- {
948
- className: unstyled ? void 0 : "agenc-listing-grid__list",
949
- children: listings.map((listing) => /* @__PURE__ */ jsxRuntime.jsx(
950
- "li",
951
- {
952
- className: unstyled ? void 0 : "agenc-listing-grid__item",
953
- children: /* @__PURE__ */ jsxRuntime.jsx(
954
- ListingCard,
955
- {
956
- listing,
957
- moderation: moderationByPda?.[String(listing.address)] ?? null,
958
- onHire,
959
- onSelect,
960
- unstyled
961
- }
962
- )
963
- },
964
- String(listing.address)
965
- ))
966
- }
967
- ),
968
- hasMore && onLoadMore ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: unstyled ? void 0 : "agenc-listing-grid__more", children: /* @__PURE__ */ jsxRuntime.jsx(
969
- "button",
970
- {
971
- type: "button",
972
- className: unstyled ? void 0 : "agenc-button agenc-button--secondary",
973
- onClick: onLoadMore,
974
- children: tc("components.listingGrid.loadMore")
975
- }
976
- ) }) : null
977
- ] });
978
- }
979
-
980
- // src/hooks/internal.ts
981
- function requireClient(client) {
982
- if (client === null) {
983
- throw new Error(t("provider.missingWriteClient"));
984
- }
985
- return client;
986
- }
987
- function resolveReferrerArgs(ctx) {
988
- const capability = ctx.resolveReferrerCapability();
989
- if (!capability.live || !capability.referrer) {
990
- return { referrerArgs: {}, referrerInjected: false };
991
- }
992
- return {
993
- referrerArgs: {
994
- referrer: capability.referrer.wallet,
995
- referrerFeeBps: capability.referrer.feeBps
996
- },
997
- referrerInjected: true
998
- };
999
- }
1000
- function signerAddress(signerOrAddress) {
1001
- if (typeof signerOrAddress === "string") {
1002
- return signerOrAddress;
1003
- }
1004
- if (typeof signerOrAddress === "object" && signerOrAddress !== null && "address" in signerOrAddress && typeof signerOrAddress.address === "string") {
1005
- return signerOrAddress.address;
1006
- }
1007
- throw new Error("Expected a TransactionSigner or Address with an address field.");
1008
- }
1009
- function withoutReferrerArgs(input) {
1010
- const {
1011
- referrer: _referrer,
1012
- referrerFeeBps: _referrerFeeBps,
1013
- ...rest
1014
- } = input;
1015
- return rest;
1016
- }
1017
- function readRpc(input) {
1018
- return input.rpc ?? (input.rpcUrl ? kit.createSolanaRpc(input.rpcUrl) : null);
1019
- }
1020
- async function resolveRosterEntry(rpc, moderator) {
1021
- const [moderationConfigPda] = await marketplaceSdk.findModerationConfigPda();
1022
- const moderationConfig = await marketplaceSdk.fetchMaybeModerationConfig(
1023
- rpc,
1024
- moderationConfigPda
1025
- );
1026
- if (moderationConfig.exists && moderationConfig.data.moderationAuthority === moderator) {
1027
- return void 0;
1028
- }
1029
- const [rosterPda] = await marketplaceSdk.findModerationAttestorPda({ attestor: moderator });
1030
- const roster = await marketplaceSdk.fetchMaybeModerationAttestor(rpc, rosterPda);
1031
- return roster.exists ? rosterPda : void 0;
1032
- }
1033
- async function resolveHireListingModerationAccounts(input) {
1034
- try {
1035
- const rpc = readRpc(input);
1036
- if (!rpc) return {};
1037
- const moderationAttestor = await resolveRosterEntry(rpc, input.moderator);
1038
- const attestorPart = moderationAttestor !== void 0 ? { moderationAttestor } : {};
1039
- const [v2Pda] = await marketplaceSdk.findListingModerationPda({
1040
- listing: input.listing,
1041
- jobSpecHash: input.listingSpecHash,
1042
- moderator: input.moderator
1043
- });
1044
- const v2 = await marketplaceSdk.fetchMaybeListingModeration(rpc, v2Pda);
1045
- if (v2.exists) return attestorPart;
1046
- const [legacyPda] = await marketplaceSdk.facade.findLegacyListingModerationPda({
1047
- listing: input.listing,
1048
- jobSpecHash: input.listingSpecHash
1049
- });
1050
- const legacy = await marketplaceSdk.fetchMaybeListingModeration(rpc, legacyPda);
1051
- if (legacy.exists && legacy.data.moderator === input.moderator) {
1052
- return { ...attestorPart, listingModeration: legacyPda };
1053
- }
1054
- return attestorPart;
1055
- } catch {
1056
- return {};
1057
- }
192
+ return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(chunkJTSG5FGC_cjs.AgencContext.Provider, { value, children }) });
1058
193
  }
1059
194
 
1060
- // src/hooks/useHire.ts
1061
- function useHire() {
1062
- const ctx = useAgencContext();
1063
- const mutation = reactQuery.useMutation({
1064
- mutationFn: async (input) => {
1065
- const client = requireClient(ctx.client);
1066
- const { referrerArgs, referrerInjected } = resolveReferrerArgs(ctx);
1067
- const hireInput = withoutReferrerArgs(input);
1068
- const listingSpecHash = input.listingSpecHash;
1069
- let moderationArgs = {};
1070
- if (input.moderationAttestor === void 0 && input.moderatorIsAttestor === void 0 && input.listingModeration === void 0 && listingSpecHash !== void 0) {
1071
- moderationArgs = await resolveHireListingModerationAccounts({
1072
- rpcUrl: ctx.rpcUrl,
1073
- listing: input.listing,
1074
- listingSpecHash,
1075
- moderator: input.moderator
1076
- });
1077
- }
1078
- const creator = input.creator ?? client.signer;
1079
- let signature;
1080
- if (input.humanless === true) {
1081
- const result = await client.hireFromListingHumanless({
1082
- ...hireInput,
1083
- ...moderationArgs,
1084
- creator,
1085
- ...referrerArgs
1086
- });
1087
- signature = result.signature;
1088
- } else {
1089
- const authority = input.authority ?? client.signer;
1090
- const result = await client.hireFromListing({
1091
- ...hireInput,
1092
- ...moderationArgs,
1093
- authority,
1094
- creator,
1095
- ...referrerArgs
1096
- });
1097
- signature = result.signature;
1098
- }
1099
- const [taskPda] = await marketplaceSdk.findTaskPda({
1100
- creator: signerAddress(creator),
1101
- taskId: input.taskId
1102
- });
1103
- return { signature, taskPda, referrerInjected };
1104
- }
1105
- });
1106
- const hire = react.useCallback(
1107
- (input) => mutation.mutateAsync(input),
1108
- [mutation]
1109
- );
1110
- const status = react.useMemo(() => {
1111
- if (mutation.isPending) return "pending";
1112
- if (mutation.isError) return "error";
1113
- if (mutation.isSuccess) return "success";
1114
- return "idle";
1115
- }, [mutation.isPending, mutation.isError, mutation.isSuccess]);
1116
- return {
1117
- hire,
1118
- status,
1119
- taskPda: mutation.data?.taskPda ?? null,
1120
- signature: mutation.data?.signature ?? null,
1121
- error: mutation.error ?? null,
1122
- isPending: mutation.isPending,
1123
- reset: mutation.reset
1124
- };
1125
- }
1126
- function useWalletSigner(options) {
1127
- const ctx = useAgencContext();
1128
- const adapter = options?.adapter;
1129
- const signer = ctx.signer ?? null;
1130
- const connected = adapter !== void 0 ? adapter.connected ?? adapter.signer !== null : ctx.signer !== null;
1131
- const connect = react.useCallback(() => {
1132
- return void 0;
1133
- }, [adapter]);
1134
- return { signer, connected, connect };
1135
- }
1136
- function ReferrerDisclosure({
1137
- referrer,
1138
- live = false,
1139
- showFee = true,
1140
- unstyled,
1141
- className
1142
- }) {
1143
- const text = live ? tc("components.referrer.disclosure") : tc("components.referrer.disclosurePending");
1144
- return /* @__PURE__ */ jsxRuntime.jsxs(
1145
- "p",
1146
- {
1147
- className: unstyled ? className : cx("agenc-referrer-disclosure", className),
1148
- role: "note",
1149
- children: [
1150
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: text }),
1151
- showFee ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: unstyled ? void 0 : "agenc-referrer-disclosure__fee", children: [
1152
- " ",
1153
- tc("components.referrer.feeBps", { bps: String(referrer.feeBps) })
1154
- ] }) : null
1155
- ]
1156
- }
1157
- );
1158
- }
1159
- function HireCheckoutModal({
1160
- open,
1161
- onClose,
1162
- listing,
1163
- onConfirm,
1164
- status = "idle",
1165
- error = null,
1166
- taskPda = null,
1167
- onViewTask,
1168
- moderation,
1169
- referrer,
1170
- referrerLive = false,
1171
- connected = true,
1172
- unstyled,
1173
- className
1174
- }) {
1175
- const pending = status === "pending";
1176
- const success = status === "success";
1177
- const price = formatPriceSol(listing.account.price);
1178
- const [submitting, setSubmitting] = react.useState(false);
1179
- const submittingRef = react.useRef(false);
1180
- react.useEffect(() => {
1181
- if (!open || !pending) {
1182
- submittingRef.current = false;
1183
- setSubmitting(false);
1184
- }
1185
- }, [open, pending]);
1186
- const handleConfirm = react.useCallback(() => {
1187
- if (submittingRef.current) return;
1188
- submittingRef.current = true;
1189
- setSubmitting(true);
1190
- let result;
1191
- try {
1192
- result = onConfirm();
1193
- } catch {
1194
- submittingRef.current = false;
1195
- setSubmitting(false);
1196
- return;
1197
- }
1198
- if (result && typeof result.then === "function") {
1199
- void result.finally(() => {
1200
- submittingRef.current = false;
1201
- setSubmitting(false);
1202
- });
1203
- }
1204
- }, [onConfirm]);
1205
- const confirmDisabled = !connected || pending || submitting;
1206
- const lockClose = pending || submitting;
1207
- const footer = success ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1208
- taskPda && onViewTask ? /* @__PURE__ */ jsxRuntime.jsx(
1209
- Button,
1210
- {
1211
- unstyled,
1212
- variant: "primary",
1213
- onClick: () => onViewTask(taskPda),
1214
- children: tc("components.hire.viewTask")
1215
- }
1216
- ) : null,
1217
- /* @__PURE__ */ jsxRuntime.jsx(Button, { unstyled, variant: "secondary", onClick: onClose, children: tc("components.common.close") })
1218
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1219
- /* @__PURE__ */ jsxRuntime.jsx(
1220
- Button,
1221
- {
1222
- unstyled,
1223
- variant: "secondary",
1224
- onClick: onClose,
1225
- disabled: pending || submitting,
1226
- children: tc("components.hire.cancel")
1227
- }
1228
- ),
1229
- /* @__PURE__ */ jsxRuntime.jsx(
1230
- Button,
1231
- {
1232
- unstyled,
1233
- variant: "primary",
1234
- loading: pending || submitting,
1235
- disabled: confirmDisabled,
1236
- onClick: handleConfirm,
1237
- children: pending || submitting ? tc("components.hire.pending") : tc("components.hire.confirm")
1238
- }
1239
- )
1240
- ] });
1241
- return /* @__PURE__ */ jsxRuntime.jsx(
1242
- Modal,
1243
- {
1244
- open,
1245
- onClose,
1246
- title: tc("components.hire.checkoutTitle"),
1247
- footer,
1248
- disableEscapeClose: lockClose,
1249
- disableOverlayClose: lockClose,
1250
- hideCloseButton: lockClose,
1251
- unstyled,
1252
- className,
1253
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: unstyled ? void 0 : "agenc-checkout", children: [
1254
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: unstyled ? void 0 : "agenc-checkout__row", children: [
1255
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: unstyled ? void 0 : "agenc-checkout__price-label", children: tc("components.hire.priceLabel") }),
1256
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: unstyled ? void 0 : "agenc-checkout__price", children: price })
1257
- ] }),
1258
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: unstyled ? void 0 : "agenc-checkout__moderation", children: /* @__PURE__ */ jsxRuntime.jsx(ModerationBadge, { moderation, unstyled }) }),
1259
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: unstyled ? void 0 : "agenc-checkout__escrow-note", children: tc("components.hire.escrowNote") }),
1260
- referrer ? /* @__PURE__ */ jsxRuntime.jsx(
1261
- ReferrerDisclosure,
1262
- {
1263
- referrer,
1264
- live: referrerLive,
1265
- unstyled
1266
- }
1267
- ) : null,
1268
- /* @__PURE__ */ jsxRuntime.jsxs(
1269
- "div",
1270
- {
1271
- className: unstyled ? void 0 : "agenc-checkout__status",
1272
- role: "status",
1273
- "aria-live": "polite",
1274
- children: [
1275
- pending ? tc("components.hire.pending") : null,
1276
- success ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1277
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: tc("components.hire.success") }),
1278
- " ",
1279
- tc("components.hire.successDetail")
1280
- ] }) : null
1281
- ]
1282
- }
1283
- ),
1284
- error ? /* @__PURE__ */ jsxRuntime.jsxs(
1285
- "div",
1286
- {
1287
- className: unstyled ? void 0 : "agenc-checkout__error",
1288
- role: "alert",
1289
- "aria-live": "assertive",
1290
- children: [
1291
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: tc("components.hire.errorTitle") }),
1292
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: error.message })
1293
- ]
1294
- }
1295
- ) : null,
1296
- !connected && !success ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: unstyled ? void 0 : "agenc-checkout__hint", children: tc("components.hire.notConnected") }) : null
1297
- ] })
1298
- }
1299
- );
1300
- }
1301
- function HireButton({
1302
- listing,
1303
- buildHireInput,
1304
- onHired,
1305
- onViewTask,
1306
- showPriceInLabel = true,
1307
- label,
1308
- unstyled,
1309
- className
1310
- }) {
1311
- const ctx = useAgencContext();
1312
- const { hire, status, error, taskPda, reset } = useHire();
1313
- const { connected } = useWalletSigner();
1314
- const [open, setOpen] = react.useState(false);
1315
- const inFlightRef = react.useRef(false);
1316
- const capability = ctx.resolveReferrerCapability();
1317
- const close = react.useCallback(() => {
1318
- setOpen(false);
1319
- inFlightRef.current = false;
1320
- reset();
1321
- }, [reset]);
1322
- const confirm = react.useCallback(async () => {
1323
- if (inFlightRef.current) return;
1324
- inFlightRef.current = true;
1325
- try {
1326
- const input = buildHireInput(listing);
1327
- const result = await hire(input);
1328
- onHired?.(result.taskPda);
1329
- } finally {
1330
- inFlightRef.current = false;
1331
- }
1332
- }, [buildHireInput, hire, listing, onHired]);
1333
- const buttonLabel = label ?? (showPriceInLabel ? tc("components.hire.ctaPrice", {
1334
- price: formatPriceSol(listing.account.price)
1335
- }) : tc("components.hire.cta"));
1336
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1337
- /* @__PURE__ */ jsxRuntime.jsx(
1338
- Button,
1339
- {
1340
- unstyled,
1341
- className,
1342
- variant: "primary",
1343
- onClick: () => setOpen(true),
1344
- children: buttonLabel
1345
- }
1346
- ),
1347
- /* @__PURE__ */ jsxRuntime.jsx(
1348
- HireCheckoutModal,
1349
- {
1350
- open,
1351
- onClose: close,
1352
- listing,
1353
- onConfirm: confirm,
1354
- status,
1355
- error,
1356
- taskPda,
1357
- onViewTask,
1358
- referrer: ctx.referrer,
1359
- referrerLive: capability.live,
1360
- connected,
1361
- unstyled
1362
- }
1363
- )
1364
- ] });
1365
- }
1366
- var HAPPY_PATH = [
1367
- { status: marketplaceSdk.TaskStatus.Open, stringId: "components.taskTimeline.status.Open" },
1368
- {
1369
- status: marketplaceSdk.TaskStatus.InProgress,
1370
- stringId: "components.taskTimeline.status.InProgress"
1371
- },
1372
- {
1373
- status: marketplaceSdk.TaskStatus.PendingValidation,
1374
- stringId: "components.taskTimeline.status.PendingValidation"
1375
- },
1376
- {
1377
- status: marketplaceSdk.TaskStatus.Completed,
1378
- stringId: "components.taskTimeline.status.Completed"
1379
- }
1380
- ];
1381
- var OFF_PATH = {
1382
- [marketplaceSdk.TaskStatus.Cancelled]: {
1383
- stringId: "components.taskTimeline.status.Cancelled",
1384
- tone: "cancelled"
1385
- },
1386
- [marketplaceSdk.TaskStatus.Disputed]: {
1387
- stringId: "components.taskTimeline.status.Disputed",
1388
- tone: "disputed"
1389
- },
1390
- [marketplaceSdk.TaskStatus.RejectFrozen]: {
1391
- stringId: "components.taskTimeline.status.RejectFrozen",
1392
- tone: "rejected"
1393
- }
1394
- };
1395
- function happyIndex(status) {
1396
- return HAPPY_PATH.findIndex((s) => s.status === status);
1397
- }
1398
- function TaskTimeline({
1399
- status,
1400
- isLoading = false,
1401
- error = null,
1402
- onRetry,
1403
- unstyled,
1404
- className
1405
- }) {
1406
- const timelineClass = rootClass("agenc-timeline", unstyled, className);
1407
- if (error) {
1408
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: timelineClass, children: /* @__PURE__ */ jsxRuntime.jsx(StateMessage, { kind: "error", onRetry, unstyled }) });
1409
- }
1410
- if (isLoading && status === null) {
1411
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: timelineClass, children: /* @__PURE__ */ jsxRuntime.jsx(StateMessage, { kind: "loading", unstyled }) });
1412
- }
1413
- if (status === null) {
1414
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: timelineClass, children: /* @__PURE__ */ jsxRuntime.jsx(
1415
- StateMessage,
1416
- {
1417
- kind: "empty",
1418
- message: tc("components.taskTimeline.empty"),
1419
- unstyled
1420
- }
1421
- ) });
1422
- }
1423
- const offPath = OFF_PATH[status];
1424
- const currentIndex = offPath ? -1 : happyIndex(status);
1425
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: timelineClass, "aria-label": tc("components.taskTimeline.title"), children: [
1426
- /* @__PURE__ */ jsxRuntime.jsx("ol", { className: unstyled ? void 0 : "agenc-timeline__list", children: HAPPY_PATH.map((stage, index) => {
1427
- const done = currentIndex > index;
1428
- const current = currentIndex === index;
1429
- const state = done ? "done" : current ? "current" : "upcoming";
1430
- return /* @__PURE__ */ jsxRuntime.jsxs(
1431
- "li",
1432
- {
1433
- className: unstyled ? void 0 : cx("agenc-timeline__step", `agenc-timeline__step--${state}`),
1434
- "aria-current": current ? "step" : void 0,
1435
- children: [
1436
- /* @__PURE__ */ jsxRuntime.jsx(
1437
- "span",
1438
- {
1439
- className: unstyled ? void 0 : "agenc-timeline__marker",
1440
- "aria-hidden": "true"
1441
- }
1442
- ),
1443
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: unstyled ? void 0 : "agenc-timeline__label", children: tc(stage.stringId) })
1444
- ]
1445
- },
1446
- stage.status
1447
- );
1448
- }) }),
1449
- offPath ? /* @__PURE__ */ jsxRuntime.jsx(
1450
- "p",
1451
- {
1452
- className: unstyled ? void 0 : cx(
1453
- "agenc-timeline__terminal",
1454
- `agenc-timeline__terminal--${offPath.tone}`
1455
- ),
1456
- role: "status",
1457
- children: tc(offPath.stringId)
1458
- }
1459
- ) : null
1460
- ] });
1461
- }
1462
- var SUCCESS_STRING = {
1463
- accept: "components.review.accepted",
1464
- reject: "components.review.rejected",
1465
- requestChanges: "components.review.changesRequested"
1466
- };
1467
- function ReviewPanel({
1468
- hasSubmission = false,
1469
- onAccept,
1470
- onReject,
1471
- onRequestChanges,
1472
- status = "idle",
1473
- error = null,
1474
- settledAction,
1475
- unstyled,
1476
- className
1477
- }) {
1478
- const panelClass = rootClass("agenc-review", unstyled, className);
1479
- const pending = status === "pending";
1480
- const success = status === "success";
1481
- return /* @__PURE__ */ jsxRuntime.jsxs(
1482
- "section",
1483
- {
1484
- className: panelClass,
1485
- "aria-label": tc("components.review.title"),
1486
- children: [
1487
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: unstyled ? void 0 : "agenc-review__title", children: tc("components.review.title") }),
1488
- !hasSubmission ? /* @__PURE__ */ jsxRuntime.jsx(
1489
- StateMessage,
1490
- {
1491
- kind: "empty",
1492
- message: tc("components.review.noSubmission"),
1493
- unstyled
1494
- }
1495
- ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: unstyled ? void 0 : "agenc-review__actions", children: [
1496
- /* @__PURE__ */ jsxRuntime.jsx(
1497
- Button,
1498
- {
1499
- unstyled,
1500
- variant: "primary",
1501
- loading: pending,
1502
- disabled: pending || !onAccept,
1503
- onClick: onAccept,
1504
- children: tc("components.review.accept")
1505
- }
1506
- ),
1507
- /* @__PURE__ */ jsxRuntime.jsx(
1508
- Button,
1509
- {
1510
- unstyled,
1511
- variant: "secondary",
1512
- disabled: pending || !onRequestChanges,
1513
- onClick: onRequestChanges,
1514
- children: tc("components.review.requestChanges")
1515
- }
1516
- ),
1517
- /* @__PURE__ */ jsxRuntime.jsx(
1518
- Button,
1519
- {
1520
- unstyled,
1521
- variant: "danger",
1522
- disabled: pending || !onReject,
1523
- onClick: onReject,
1524
- children: tc("components.review.reject")
1525
- }
1526
- )
1527
- ] }),
1528
- /* @__PURE__ */ jsxRuntime.jsxs(
1529
- "div",
1530
- {
1531
- className: unstyled ? void 0 : "agenc-review__status",
1532
- role: "status",
1533
- "aria-live": "polite",
1534
- children: [
1535
- pending ? tc("components.review.pending") : null,
1536
- success && settledAction ? tc(SUCCESS_STRING[settledAction]) : null
1537
- ]
1538
- }
1539
- ),
1540
- error ? /* @__PURE__ */ jsxRuntime.jsxs(
1541
- "div",
1542
- {
1543
- className: unstyled ? void 0 : "agenc-review__error",
1544
- role: "alert",
1545
- "aria-live": "assertive",
1546
- children: [
1547
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: tc("components.review.errorTitle") }),
1548
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: error.message })
1549
- ]
1550
- }
1551
- ) : null
1552
- ]
1553
- }
1554
- );
1555
- }
1556
- function DisputeBanner({
1557
- disputeOpen = false,
1558
- onInitiate,
1559
- status = "idle",
1560
- error = null,
1561
- unstyled,
1562
- className
1563
- }) {
1564
- const bannerClass = rootClass(
1565
- cx(
1566
- "agenc-dispute",
1567
- disputeOpen ? "agenc-dispute--open" : "agenc-dispute--none"
1568
- ),
1569
- unstyled,
1570
- className
1571
- );
1572
- const pending = status === "pending";
1573
- const opened = status === "success";
1574
- if (disputeOpen) {
1575
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: bannerClass, role: "alert", children: [
1576
- /* @__PURE__ */ jsxRuntime.jsx("strong", { className: unstyled ? void 0 : "agenc-dispute__title", children: tc("components.dispute.title") }),
1577
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: unstyled ? void 0 : "agenc-dispute__body", children: tc("components.dispute.body") })
1578
- ] });
1579
- }
1580
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: bannerClass, role: "region", "aria-label": tc("components.dispute.none"), children: [
1581
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: unstyled ? void 0 : "agenc-dispute__none", children: tc("components.dispute.none") }),
1582
- onInitiate ? /* @__PURE__ */ jsxRuntime.jsx(
1583
- Button,
1584
- {
1585
- unstyled,
1586
- variant: "secondary",
1587
- loading: pending,
1588
- disabled: pending,
1589
- onClick: onInitiate,
1590
- children: pending ? tc("components.dispute.pending") : tc("components.dispute.initiate")
1591
- }
1592
- ) : null,
1593
- /* @__PURE__ */ jsxRuntime.jsx(
1594
- "div",
1595
- {
1596
- className: unstyled ? void 0 : "agenc-dispute__status",
1597
- role: "status",
1598
- "aria-live": "polite",
1599
- children: opened ? tc("components.dispute.opened") : null
1600
- }
1601
- ),
1602
- error ? /* @__PURE__ */ jsxRuntime.jsxs(
1603
- "div",
1604
- {
1605
- className: unstyled ? void 0 : "agenc-dispute__error",
1606
- role: "alert",
1607
- "aria-live": "assertive",
1608
- children: [
1609
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: tc("components.dispute.errorTitle") }),
1610
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: error.message })
1611
- ]
1612
- }
1613
- ) : null
1614
- ] });
1615
- }
1616
- var UNVERIFIED = Object.freeze({
1617
- verified: false
195
+ Object.defineProperty(exports, "ReadTransportUnsupportedError", {
196
+ enumerable: true,
197
+ get: function () { return chunkONC6L3IX_cjs.ReadTransportUnsupportedError; }
198
+ });
199
+ Object.defineProperty(exports, "createReadTransport", {
200
+ enumerable: true,
201
+ get: function () { return chunkONC6L3IX_cjs.createReadTransport; }
202
+ });
203
+ Object.defineProperty(exports, "EN_SIGNER_STRINGS", {
204
+ enumerable: true,
205
+ get: function () { return chunkR76EUYDI_cjs.EN_SIGNER_STRINGS; }
206
+ });
207
+ Object.defineProperty(exports, "signerFromEmbeddedWallet", {
208
+ enumerable: true,
209
+ get: function () { return chunkR76EUYDI_cjs.signerFromEmbeddedWallet; }
210
+ });
211
+ Object.defineProperty(exports, "signerFromWalletAccount", {
212
+ enumerable: true,
213
+ get: function () { return chunkR76EUYDI_cjs.signerFromWalletAccount; }
214
+ });
215
+ Object.defineProperty(exports, "signerFromWalletAdapter", {
216
+ enumerable: true,
217
+ get: function () { return chunkR76EUYDI_cjs.signerFromWalletAdapter; }
218
+ });
219
+ Object.defineProperty(exports, "walletStandardChainForNetwork", {
220
+ enumerable: true,
221
+ get: function () { return chunkR76EUYDI_cjs.walletStandardChainForNetwork; }
222
+ });
223
+ Object.defineProperty(exports, "AGENC_THEME_CLASS", {
224
+ enumerable: true,
225
+ get: function () { return chunkIJKWKY4H_cjs.AGENC_THEME_CLASS; }
226
+ });
227
+ Object.defineProperty(exports, "AGENC_TOKENS_CSS_PATH", {
228
+ enumerable: true,
229
+ get: function () { return chunkIJKWKY4H_cjs.AGENC_TOKENS_CSS_PATH; }
230
+ });
231
+ Object.defineProperty(exports, "Badge", {
232
+ enumerable: true,
233
+ get: function () { return chunkIJKWKY4H_cjs.Badge; }
234
+ });
235
+ Object.defineProperty(exports, "Button", {
236
+ enumerable: true,
237
+ get: function () { return chunkIJKWKY4H_cjs.Button; }
238
+ });
239
+ Object.defineProperty(exports, "COMPONENT_CATALOG", {
240
+ enumerable: true,
241
+ get: function () { return chunkIJKWKY4H_cjs.COMPONENT_CATALOG; }
242
+ });
243
+ Object.defineProperty(exports, "DEFAULT_TRUST_HREF", {
244
+ enumerable: true,
245
+ get: function () { return chunkIJKWKY4H_cjs.DEFAULT_TRUST_HREF; }
246
+ });
247
+ Object.defineProperty(exports, "DisputeBanner", {
248
+ enumerable: true,
249
+ get: function () { return chunkIJKWKY4H_cjs.DisputeBanner; }
250
+ });
251
+ Object.defineProperty(exports, "EN_COMPONENT_STRINGS", {
252
+ enumerable: true,
253
+ get: function () { return chunkIJKWKY4H_cjs.EN_COMPONENT_STRINGS; }
254
+ });
255
+ Object.defineProperty(exports, "GuaranteedBadge", {
256
+ enumerable: true,
257
+ get: function () { return chunkIJKWKY4H_cjs.GuaranteedBadge; }
258
+ });
259
+ Object.defineProperty(exports, "HireButton", {
260
+ enumerable: true,
261
+ get: function () { return chunkIJKWKY4H_cjs.HireButton; }
262
+ });
263
+ Object.defineProperty(exports, "HireCheckoutModal", {
264
+ enumerable: true,
265
+ get: function () { return chunkIJKWKY4H_cjs.HireCheckoutModal; }
266
+ });
267
+ Object.defineProperty(exports, "ListingCard", {
268
+ enumerable: true,
269
+ get: function () { return chunkIJKWKY4H_cjs.ListingCard; }
270
+ });
271
+ Object.defineProperty(exports, "ListingGrid", {
272
+ enumerable: true,
273
+ get: function () { return chunkIJKWKY4H_cjs.ListingGrid; }
274
+ });
275
+ Object.defineProperty(exports, "Modal", {
276
+ enumerable: true,
277
+ get: function () { return chunkIJKWKY4H_cjs.Modal; }
278
+ });
279
+ Object.defineProperty(exports, "ModerationBadge", {
280
+ enumerable: true,
281
+ get: function () { return chunkIJKWKY4H_cjs.ModerationBadge; }
282
+ });
283
+ Object.defineProperty(exports, "PoweredByAgenC", {
284
+ enumerable: true,
285
+ get: function () { return chunkIJKWKY4H_cjs.PoweredByAgenC; }
286
+ });
287
+ Object.defineProperty(exports, "ProviderCard", {
288
+ enumerable: true,
289
+ get: function () { return chunkIJKWKY4H_cjs.ProviderCard; }
290
+ });
291
+ Object.defineProperty(exports, "ReferrerDisclosure", {
292
+ enumerable: true,
293
+ get: function () { return chunkIJKWKY4H_cjs.ReferrerDisclosure; }
294
+ });
295
+ Object.defineProperty(exports, "ReviewPanel", {
296
+ enumerable: true,
297
+ get: function () { return chunkIJKWKY4H_cjs.ReviewPanel; }
298
+ });
299
+ Object.defineProperty(exports, "Spinner", {
300
+ enumerable: true,
301
+ get: function () { return chunkIJKWKY4H_cjs.Spinner; }
302
+ });
303
+ Object.defineProperty(exports, "StateMessage", {
304
+ enumerable: true,
305
+ get: function () { return chunkIJKWKY4H_cjs.StateMessage; }
306
+ });
307
+ Object.defineProperty(exports, "TaskTimeline", {
308
+ enumerable: true,
309
+ get: function () { return chunkIJKWKY4H_cjs.TaskTimeline; }
310
+ });
311
+ Object.defineProperty(exports, "UNVERIFIED", {
312
+ enumerable: true,
313
+ get: function () { return chunkIJKWKY4H_cjs.UNVERIFIED; }
314
+ });
315
+ Object.defineProperty(exports, "VerifiedBadge", {
316
+ enumerable: true,
317
+ get: function () { return chunkIJKWKY4H_cjs.VerifiedBadge; }
318
+ });
319
+ Object.defineProperty(exports, "agencThemeStyleTag", {
320
+ enumerable: true,
321
+ get: function () { return chunkIJKWKY4H_cjs.agencThemeStyleTag; }
322
+ });
323
+ Object.defineProperty(exports, "agentVerificationReaderFromRpc", {
324
+ enumerable: true,
325
+ get: function () { return chunkIJKWKY4H_cjs.agentVerificationReaderFromRpc; }
326
+ });
327
+ Object.defineProperty(exports, "cx", {
328
+ enumerable: true,
329
+ get: function () { return chunkIJKWKY4H_cjs.cx; }
330
+ });
331
+ Object.defineProperty(exports, "decodeListingCategory", {
332
+ enumerable: true,
333
+ get: function () { return chunkIJKWKY4H_cjs.decodeListingCategory; }
334
+ });
335
+ Object.defineProperty(exports, "decodeListingName", {
336
+ enumerable: true,
337
+ get: function () { return chunkIJKWKY4H_cjs.decodeListingName; }
338
+ });
339
+ Object.defineProperty(exports, "decodeListingTags", {
340
+ enumerable: true,
341
+ get: function () { return chunkIJKWKY4H_cjs.decodeListingTags; }
342
+ });
343
+ Object.defineProperty(exports, "elementClass", {
344
+ enumerable: true,
345
+ get: function () { return chunkIJKWKY4H_cjs.elementClass; }
346
+ });
347
+ Object.defineProperty(exports, "evaluateAgentVerification", {
348
+ enumerable: true,
349
+ get: function () { return chunkIJKWKY4H_cjs.evaluateAgentVerification; }
350
+ });
351
+ Object.defineProperty(exports, "formatPriceSol", {
352
+ enumerable: true,
353
+ get: function () { return chunkIJKWKY4H_cjs.formatPriceSol; }
354
+ });
355
+ Object.defineProperty(exports, "formatRate", {
356
+ enumerable: true,
357
+ get: function () { return chunkIJKWKY4H_cjs.formatRate; }
358
+ });
359
+ Object.defineProperty(exports, "formatSol", {
360
+ enumerable: true,
361
+ get: function () { return chunkIJKWKY4H_cjs.formatSol; }
362
+ });
363
+ Object.defineProperty(exports, "moderationStateOf", {
364
+ enumerable: true,
365
+ get: function () { return chunkIJKWKY4H_cjs.moderationStateOf; }
366
+ });
367
+ Object.defineProperty(exports, "resolveThemeClassName", {
368
+ enumerable: true,
369
+ get: function () { return chunkIJKWKY4H_cjs.resolveThemeClassName; }
370
+ });
371
+ Object.defineProperty(exports, "rootClass", {
372
+ enumerable: true,
373
+ get: function () { return chunkIJKWKY4H_cjs.rootClass; }
374
+ });
375
+ Object.defineProperty(exports, "tc", {
376
+ enumerable: true,
377
+ get: function () { return chunkIJKWKY4H_cjs.tc; }
378
+ });
379
+ Object.defineProperty(exports, "toHex", {
380
+ enumerable: true,
381
+ get: function () { return chunkIJKWKY4H_cjs.toHex; }
382
+ });
383
+ Object.defineProperty(exports, "truncateAddress", {
384
+ enumerable: true,
385
+ get: function () { return chunkIJKWKY4H_cjs.truncateAddress; }
386
+ });
387
+ Object.defineProperty(exports, "useAgentVerification", {
388
+ enumerable: true,
389
+ get: function () { return chunkIJKWKY4H_cjs.useAgentVerification; }
390
+ });
391
+ Object.defineProperty(exports, "useFocusTrap", {
392
+ enumerable: true,
393
+ get: function () { return chunkIJKWKY4H_cjs.useFocusTrap; }
394
+ });
395
+ Object.defineProperty(exports, "AgencContext", {
396
+ enumerable: true,
397
+ get: function () { return chunkJTSG5FGC_cjs.AgencContext; }
398
+ });
399
+ Object.defineProperty(exports, "useAgencContext", {
400
+ enumerable: true,
401
+ get: function () { return chunkJTSG5FGC_cjs.useAgencContext; }
402
+ });
403
+ Object.defineProperty(exports, "EN_STRINGS", {
404
+ enumerable: true,
405
+ get: function () { return chunkFIDFPM5A_cjs.EN_STRINGS; }
406
+ });
407
+ Object.defineProperty(exports, "t", {
408
+ enumerable: true,
409
+ get: function () { return chunkFIDFPM5A_cjs.t; }
1618
410
  });
1619
- function evaluateAgentVerification(account, nowSeconds) {
1620
- if (!account) return UNVERIFIED;
1621
- if (account.revoked) return UNVERIFIED;
1622
- if (account.expiresAt !== 0n && nowSeconds >= account.expiresAt) {
1623
- return UNVERIFIED;
1624
- }
1625
- return {
1626
- verified: true,
1627
- domain: account.verifiedDomain,
1628
- method: account.method,
1629
- verifiedBy: account.verifiedBy,
1630
- verifiedAt: account.verifiedAt,
1631
- expiresAt: account.expiresAt,
1632
- revoked: false
1633
- };
1634
- }
1635
- function defaultNow() {
1636
- return BigInt(Math.floor(Date.now() / 1e3));
1637
- }
1638
- function agentVerificationReaderFromRpc(rpc, options) {
1639
- const now = options?.now ?? defaultNow;
1640
- return async (agentPda) => {
1641
- const [pda] = await marketplaceSdk.findAgentVerificationPda({ agent: agentPda });
1642
- const maybe = await marketplaceSdk.fetchMaybeAgentVerification(rpc, pda);
1643
- return evaluateAgentVerification(maybe.exists ? maybe.data : null, now());
1644
- };
1645
- }
1646
- function useAgentVerification(agentPda, options) {
1647
- const reader = options?.reader;
1648
- const enabled = (options?.enabled ?? true) && Boolean(agentPda) && Boolean(reader);
1649
- const query = reactQuery.useQuery({
1650
- queryKey: ["agenc", "agentVerification", agentPda ? String(agentPda) : ""],
1651
- enabled,
1652
- queryFn: async () => {
1653
- return reader(agentPda);
1654
- }
1655
- });
1656
- const verification = query.error ? UNVERIFIED : query.data ?? UNVERIFIED;
1657
- return {
1658
- verification,
1659
- verified: verification.verified,
1660
- isLoading: query.isLoading && enabled,
1661
- error: query.error ?? null,
1662
- refetch: () => void query.refetch()
1663
- };
1664
- }
1665
- function VerifiedDomainBadge({
1666
- domain,
1667
- unstyled
1668
- }) {
1669
- return /* @__PURE__ */ jsxRuntime.jsx(
1670
- Badge,
1671
- {
1672
- tone: "success",
1673
- unstyled,
1674
- className: unstyled ? void 0 : "agenc-provider__domain agenc-provider__domain--verified",
1675
- label: tc("components.provider.verifiedDomainLabel", { domain }),
1676
- children: tc("components.provider.verifiedDomain", { domain })
1677
- }
1678
- );
1679
- }
1680
- function ClaimedDomainBadge({
1681
- domain,
1682
- unstyled
1683
- }) {
1684
- return /* @__PURE__ */ jsxRuntime.jsx(
1685
- Badge,
1686
- {
1687
- tone: "neutral",
1688
- unstyled,
1689
- className: unstyled ? void 0 : "agenc-provider__domain agenc-provider__domain--claimed",
1690
- label: tc("components.provider.claimedDomainLabel", { domain }),
1691
- children: tc("components.provider.claimedDomain", { domain })
1692
- }
1693
- );
1694
- }
1695
- function ProviderCard({
1696
- agent,
1697
- trackRecord,
1698
- verification = UNVERIFIED,
1699
- operatorDomain,
1700
- verified = false,
1701
- isLoading = false,
1702
- error = null,
1703
- onRetry,
1704
- unstyled,
1705
- className
1706
- }) {
1707
- const cardClass = rootClass("agenc-provider", unstyled, className);
1708
- const isVerified = verification.verified || verification === UNVERIFIED && verified;
1709
- const verifiedDomain = verification.verified ? verification.domain : null;
1710
- const claimed = typeof operatorDomain === "string" && operatorDomain.trim() !== "" ? operatorDomain.trim() : null;
1711
- const domainBadge = verifiedDomain ? /* @__PURE__ */ jsxRuntime.jsx(VerifiedDomainBadge, { domain: verifiedDomain, unstyled }) : claimed ? /* @__PURE__ */ jsxRuntime.jsx(ClaimedDomainBadge, { domain: claimed, unstyled }) : null;
1712
- const header = /* @__PURE__ */ jsxRuntime.jsxs("header", { className: unstyled ? void 0 : "agenc-provider__header", children: [
1713
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: unstyled ? void 0 : "agenc-provider__id", children: [
1714
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: unstyled ? void 0 : "agenc-provider__label", children: tc("components.provider.title") }),
1715
- agent ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: unstyled ? void 0 : "agenc-provider__pda", children: truncateAddress(agent) }) : null
1716
- ] }),
1717
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: unstyled ? void 0 : "agenc-provider__badges", children: [
1718
- domainBadge,
1719
- /* @__PURE__ */ jsxRuntime.jsx(VerifiedBadge, { verified: isVerified, unstyled })
1720
- ] })
1721
- ] });
1722
- if (error) {
1723
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: cardClass, "aria-label": tc("components.provider.title"), children: [
1724
- header,
1725
- /* @__PURE__ */ jsxRuntime.jsx(
1726
- StateMessage,
1727
- {
1728
- kind: "error",
1729
- message: tc("components.provider.unavailable"),
1730
- onRetry,
1731
- unstyled
1732
- }
1733
- )
1734
- ] });
1735
- }
1736
- if (isLoading && trackRecord === null) {
1737
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: cardClass, "aria-label": tc("components.provider.title"), children: [
1738
- header,
1739
- /* @__PURE__ */ jsxRuntime.jsx(StateMessage, { kind: "loading", unstyled })
1740
- ] });
1741
- }
1742
- if (trackRecord === null) {
1743
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: cardClass, "aria-label": tc("components.provider.title"), children: [
1744
- header,
1745
- /* @__PURE__ */ jsxRuntime.jsx(
1746
- StateMessage,
1747
- {
1748
- kind: "empty",
1749
- message: tc("components.provider.noData"),
1750
- unstyled
1751
- }
1752
- )
1753
- ] });
1754
- }
1755
- const provisional = trackRecord.partial;
1756
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: cardClass, "aria-label": tc("components.provider.title"), children: [
1757
- header,
1758
- /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: unstyled ? void 0 : "agenc-provider__stats", children: [
1759
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: unstyled ? void 0 : "agenc-provider__stat", children: [
1760
- /* @__PURE__ */ jsxRuntime.jsx("dt", { children: tc("components.provider.completionRate") }),
1761
- /* @__PURE__ */ jsxRuntime.jsxs("dd", { children: [
1762
- formatRate(trackRecord.completionRate),
1763
- provisional ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: unstyled ? void 0 : "agenc-provider__provisional", children: [
1764
- " ",
1765
- "(",
1766
- tc("components.provider.provisional"),
1767
- ")"
1768
- ] }) : null
1769
- ] })
1770
- ] }),
1771
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: unstyled ? void 0 : "agenc-provider__stat", children: [
1772
- /* @__PURE__ */ jsxRuntime.jsx("dt", { children: tc("components.provider.disputeRate") }),
1773
- /* @__PURE__ */ jsxRuntime.jsxs("dd", { children: [
1774
- formatRate(trackRecord.disputeRate),
1775
- provisional ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: unstyled ? void 0 : "agenc-provider__provisional", children: [
1776
- " ",
1777
- "(",
1778
- tc("components.provider.provisional"),
1779
- ")"
1780
- ] }) : null
1781
- ] })
1782
- ] }),
1783
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: unstyled ? void 0 : "agenc-provider__stat", children: [
1784
- /* @__PURE__ */ jsxRuntime.jsx("dt", { children: tc("components.provider.completions", {
1785
- count: String(trackRecord.completions)
1786
- }) }),
1787
- /* @__PURE__ */ jsxRuntime.jsx("dd", { children: tc("components.provider.disputes", {
1788
- count: String(trackRecord.disputesLost)
1789
- }) })
1790
- ] })
1791
- ] })
1792
- ] });
1793
- }
1794
- var DEFAULT_TRUST_HREF = "https://agenc.tech/trust";
1795
- var SAFE_HREF_SCHEMES = /* @__PURE__ */ new Set(["http:", "https:", "mailto:"]);
1796
- function safeHref(href) {
1797
- try {
1798
- const url = new URL(href, DEFAULT_TRUST_HREF);
1799
- return SAFE_HREF_SCHEMES.has(url.protocol) ? href : DEFAULT_TRUST_HREF;
1800
- } catch {
1801
- return DEFAULT_TRUST_HREF;
1802
- }
1803
- }
1804
- function PoweredByAgenC({
1805
- href = DEFAULT_TRUST_HREF,
1806
- newTab = true,
1807
- label,
1808
- unstyled,
1809
- className
1810
- }) {
1811
- const linkClass = rootClass("agenc-powered-by", unstyled, className);
1812
- return /* @__PURE__ */ jsxRuntime.jsx(
1813
- "a",
1814
- {
1815
- className: linkClass,
1816
- href: safeHref(href),
1817
- target: newTab ? "_blank" : void 0,
1818
- rel: newTab ? "noopener noreferrer" : void 0,
1819
- "aria-label": `${label ?? tc("components.poweredBy.label")} \u2014 ${tc(
1820
- "components.poweredBy.trustLink"
1821
- )}`,
1822
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: unstyled ? void 0 : "agenc-powered-by__label", children: label ?? tc("components.poweredBy.label") })
1823
- }
1824
- );
1825
- }
1826
-
1827
- exports.AGENC_THEME_CLASS = AGENC_THEME_CLASS;
1828
- exports.AGENC_TOKENS_CSS_PATH = AGENC_TOKENS_CSS_PATH;
1829
- exports.AgencContext = AgencContext;
1830
411
  exports.AgencProvider = AgencProvider;
1831
- exports.Badge = Badge;
1832
- exports.Button = Button;
1833
- exports.COMPONENT_CATALOG = COMPONENT_CATALOG;
1834
- exports.DEFAULT_TRUST_HREF = DEFAULT_TRUST_HREF;
1835
- exports.DisputeBanner = DisputeBanner;
1836
- exports.EN_COMPONENT_STRINGS = EN_COMPONENT_STRINGS;
1837
- exports.EN_SIGNER_STRINGS = EN_SIGNER_STRINGS;
1838
- exports.EN_STRINGS = EN_STRINGS;
1839
- exports.HireButton = HireButton;
1840
- exports.HireCheckoutModal = HireCheckoutModal;
1841
- exports.ListingCard = ListingCard;
1842
- exports.ListingGrid = ListingGrid;
1843
- exports.Modal = Modal;
1844
- exports.ModerationBadge = ModerationBadge;
1845
- exports.PoweredByAgenC = PoweredByAgenC;
1846
- exports.ProviderCard = ProviderCard;
1847
412
  exports.REFERRER_FEE_BPS_MAX = REFERRER_FEE_BPS_MAX;
1848
413
  exports.REFERRER_FEE_BPS_MIN = REFERRER_FEE_BPS_MIN;
1849
- exports.ReadTransportUnsupportedError = ReadTransportUnsupportedError;
1850
- exports.ReferrerDisclosure = ReferrerDisclosure;
1851
- exports.ReviewPanel = ReviewPanel;
1852
- exports.Spinner = Spinner;
1853
- exports.StateMessage = StateMessage;
1854
- exports.TaskTimeline = TaskTimeline;
1855
- exports.UNVERIFIED = UNVERIFIED;
1856
- exports.VerifiedBadge = VerifiedBadge;
1857
- exports.agencThemeStyleTag = agencThemeStyleTag;
1858
- exports.agentVerificationReaderFromRpc = agentVerificationReaderFromRpc;
1859
- exports.createReadTransport = createReadTransport;
1860
- exports.cx = cx;
1861
- exports.decodeListingCategory = decodeListingCategory;
1862
- exports.decodeListingName = decodeListingName;
1863
- exports.decodeListingTags = decodeListingTags;
1864
414
  exports.deriveSubscriptionsUrl = deriveSubscriptionsUrl;
1865
- exports.elementClass = elementClass;
1866
- exports.evaluateAgentVerification = evaluateAgentVerification;
1867
- exports.formatPriceSol = formatPriceSol;
1868
- exports.formatRate = formatRate;
1869
- exports.formatSol = formatSol;
1870
- exports.moderationStateOf = moderationStateOf;
1871
415
  exports.resolveEndpoints = resolveEndpoints;
1872
416
  exports.resolveReferrerCapability = resolveReferrerCapability;
1873
- exports.resolveThemeClassName = resolveThemeClassName;
1874
- exports.rootClass = rootClass;
1875
- exports.signerFromEmbeddedWallet = signerFromEmbeddedWallet;
1876
- exports.signerFromWalletAccount = signerFromWalletAccount;
1877
- exports.signerFromWalletAdapter = signerFromWalletAdapter;
1878
- exports.t = t;
1879
- exports.tc = tc;
1880
- exports.toHex = toHex;
1881
- exports.truncateAddress = truncateAddress;
1882
- exports.useAgencContext = useAgencContext;
1883
- exports.useAgentVerification = useAgentVerification;
1884
- exports.useFocusTrap = useFocusTrap;
1885
417
  exports.validateReferrerConfig = validateReferrerConfig;
1886
418
  //# sourceMappingURL=index.cjs.map
1887
419
  //# sourceMappingURL=index.cjs.map