@medialane/ui 0.245.0 → 0.247.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 (89) hide show
  1. package/dist/components/asset-comments-dialog.cjs +2 -2
  2. package/dist/components/asset-comments-dialog.cjs.map +1 -1
  3. package/dist/components/asset-comments-dialog.d.cts +3 -9
  4. package/dist/components/asset-comments-dialog.d.ts +3 -9
  5. package/dist/components/asset-comments-dialog.js +2 -2
  6. package/dist/components/asset-comments-dialog.js.map +1 -1
  7. package/dist/components/asset-page.cjs +6 -7
  8. package/dist/components/asset-page.cjs.map +1 -1
  9. package/dist/components/asset-page.d.cts +4 -13
  10. package/dist/components/asset-page.d.ts +4 -13
  11. package/dist/components/asset-page.js +6 -7
  12. package/dist/components/asset-page.js.map +1 -1
  13. package/dist/components/collection-page.cjs +3 -2
  14. package/dist/components/collection-page.cjs.map +1 -1
  15. package/dist/components/collection-page.d.cts +0 -5
  16. package/dist/components/collection-page.d.ts +0 -5
  17. package/dist/components/collection-page.js +3 -2
  18. package/dist/components/collection-page.js.map +1 -1
  19. package/dist/components/comments-section.cjs +304 -0
  20. package/dist/components/comments-section.cjs.map +1 -0
  21. package/dist/components/comments-section.d.cts +10 -0
  22. package/dist/components/comments-section.d.ts +10 -0
  23. package/dist/components/comments-section.js +270 -0
  24. package/dist/components/comments-section.js.map +1 -0
  25. package/dist/components/medialane-app.cjs.map +1 -1
  26. package/dist/components/medialane-app.d.cts +3 -0
  27. package/dist/components/medialane-app.d.ts +3 -0
  28. package/dist/components/medialane-app.js.map +1 -1
  29. package/dist/components/pop-burn-button.cjs +65 -0
  30. package/dist/components/pop-burn-button.cjs.map +1 -0
  31. package/dist/components/pop-burn-button.d.cts +10 -0
  32. package/dist/components/pop-burn-button.d.ts +10 -0
  33. package/dist/components/pop-burn-button.js +41 -0
  34. package/dist/components/pop-burn-button.js.map +1 -0
  35. package/dist/components/pop-claim-button.cjs +92 -0
  36. package/dist/components/pop-claim-button.cjs.map +1 -0
  37. package/dist/components/pop-claim-button.d.cts +7 -0
  38. package/dist/components/pop-claim-button.d.ts +7 -0
  39. package/dist/components/pop-claim-button.js +68 -0
  40. package/dist/components/pop-claim-button.js.map +1 -0
  41. package/dist/components/pop-manage-page.cjs +224 -0
  42. package/dist/components/pop-manage-page.cjs.map +1 -0
  43. package/dist/components/pop-manage-page.d.cts +7 -0
  44. package/dist/components/pop-manage-page.d.ts +7 -0
  45. package/dist/components/pop-manage-page.js +190 -0
  46. package/dist/components/pop-manage-page.js.map +1 -0
  47. package/dist/components/portfolio-sponsorships.cjs +209 -0
  48. package/dist/components/portfolio-sponsorships.cjs.map +1 -0
  49. package/dist/components/portfolio-sponsorships.d.cts +5 -0
  50. package/dist/components/portfolio-sponsorships.d.ts +5 -0
  51. package/dist/components/portfolio-sponsorships.js +175 -0
  52. package/dist/components/portfolio-sponsorships.js.map +1 -0
  53. package/dist/components/sponsorship-offer-page.cjs +181 -0
  54. package/dist/components/sponsorship-offer-page.cjs.map +1 -0
  55. package/dist/components/sponsorship-offer-page.d.cts +7 -0
  56. package/dist/components/sponsorship-offer-page.d.ts +7 -0
  57. package/dist/components/sponsorship-offer-page.js +147 -0
  58. package/dist/components/sponsorship-offer-page.js.map +1 -0
  59. package/dist/components/sponsorship-offers-page.cjs +118 -0
  60. package/dist/components/sponsorship-offers-page.cjs.map +1 -0
  61. package/dist/components/sponsorship-offers-page.d.cts +5 -0
  62. package/dist/components/sponsorship-offers-page.d.ts +5 -0
  63. package/dist/components/sponsorship-offers-page.js +84 -0
  64. package/dist/components/sponsorship-offers-page.js.map +1 -0
  65. package/dist/components/transaction-done.cjs +46 -0
  66. package/dist/components/transaction-done.cjs.map +1 -0
  67. package/dist/components/transaction-done.d.cts +18 -0
  68. package/dist/components/transaction-done.d.ts +18 -0
  69. package/dist/components/transaction-done.js +22 -0
  70. package/dist/components/transaction-done.js.map +1 -0
  71. package/dist/components/transfer-collection-ownership.cjs +137 -0
  72. package/dist/components/transfer-collection-ownership.cjs.map +1 -0
  73. package/dist/components/transfer-collection-ownership.d.cts +11 -0
  74. package/dist/components/transfer-collection-ownership.d.ts +11 -0
  75. package/dist/components/transfer-collection-ownership.js +113 -0
  76. package/dist/components/transfer-collection-ownership.js.map +1 -0
  77. package/dist/index.cjs +27 -0
  78. package/dist/index.cjs.map +1 -1
  79. package/dist/index.d.cts +11 -2
  80. package/dist/index.d.ts +11 -2
  81. package/dist/index.js +18 -0
  82. package/dist/index.js.map +1 -1
  83. package/dist/utils/use-transaction.cjs +2 -0
  84. package/dist/utils/use-transaction.cjs.map +1 -1
  85. package/dist/utils/use-transaction.d.cts +1 -1
  86. package/dist/utils/use-transaction.d.ts +1 -1
  87. package/dist/utils/use-transaction.js +2 -0
  88. package/dist/utils/use-transaction.js.map +1 -1
  89. package/package.json +1 -1
@@ -0,0 +1,224 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var pop_manage_page_exports = {};
31
+ __export(pop_manage_page_exports, {
32
+ PopManagePage: () => PopManagePage
33
+ });
34
+ module.exports = __toCommonJS(pop_manage_page_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_react = require("react");
37
+ var import_sdk = require("@medialane/sdk");
38
+ var import_starknet = require("@medialane/sdk/starknet");
39
+ var import_lucide_react = require("lucide-react");
40
+ var import_button = require("./button.js");
41
+ var import_link = __toESM(require("./link.js"), 1);
42
+ var import_medialane_app = require("./medialane-app.js");
43
+ var import_motion_primitives = require("./motion-primitives.js");
44
+ var import_skeleton = require("./skeleton.js");
45
+ var import_textarea = require("./textarea.js");
46
+ var import_transaction_dialog = require("./transaction-dialog.js");
47
+ var import_transaction_done = require("./transaction-done.js");
48
+ var import_wallet_required = require("./wallet-required.js");
49
+ var import_run_intent_calls = require("../utils/run-intent-calls.js");
50
+ var import_use_collections = require("../utils/use-collections.js");
51
+ var import_use_transaction = require("../utils/use-transaction.js");
52
+ function parseAddresses(raw) {
53
+ return raw.split(/[\n,\s]+/).map((a) => a.trim()).filter((a) => /^0x[0-9a-fA-F]+$/.test(a));
54
+ }
55
+ function downloadCsv(links) {
56
+ const href = URL.createObjectURL(new Blob([(0, import_starknet.popClaimLinksCsv)(links)], { type: "text/csv" }));
57
+ const anchor = Object.assign(document.createElement("a"), { href, download: "claim-links.csv" });
58
+ anchor.click();
59
+ URL.revokeObjectURL(href);
60
+ }
61
+ function IssueSection({
62
+ onIssue,
63
+ isSubmitting
64
+ }) {
65
+ const [raw, setRaw] = (0, import_react.useState)("");
66
+ const address = raw.trim();
67
+ const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);
68
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell p-5 space-y-3", children: [
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
70
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-4 w-4 text-green-500" }),
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold text-sm", children: "Issue directly" })
72
+ ] }),
73
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: "Send the credential straight to one wallet \u2014 for a late participant, without republishing the list or changing anyone's claim link." }),
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
+ "input",
76
+ {
77
+ type: "text",
78
+ placeholder: "0x...",
79
+ value: raw,
80
+ onChange: (e) => setRaw(e.target.value),
81
+ className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"
82
+ }
83
+ ),
84
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
85
+ import_button.Button,
86
+ {
87
+ size: "sm",
88
+ variant: "outline",
89
+ className: "w-full",
90
+ disabled: !valid || isSubmitting,
91
+ onClick: () => {
92
+ onIssue(address);
93
+ setRaw("");
94
+ },
95
+ children: [
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Send, { className: "h-3.5 w-3.5 mr-1.5" }),
97
+ "Issue credential"
98
+ ]
99
+ }
100
+ )
101
+ ] });
102
+ }
103
+ function AllowlistSection({
104
+ onPublish,
105
+ isSubmitting,
106
+ links
107
+ }) {
108
+ const [raw, setRaw] = (0, import_react.useState)("");
109
+ const parsed = parseAddresses(raw);
110
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell p-5 space-y-3", children: [
111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
112
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Users, { className: "h-4 w-4 text-green-500" }),
113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold text-sm", children: "Participants" }),
114
+ parsed.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "ml-auto text-xs text-muted-foreground", children: [
115
+ parsed.length,
116
+ " address",
117
+ parsed.length !== 1 ? "es" : ""
118
+ ] })
119
+ ] }),
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: "Paste every participant's wallet address. Publishing replaces the previous list and every link sent before it \u2014 send the new links to everyone who hasn't claimed yet. The list stays in this browser: download the claim links and send each participant theirs." }),
121
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
122
+ import_textarea.Textarea,
123
+ {
124
+ placeholder: "Paste Starknet addresses, one per line:\n0x04a...\n0x06b...",
125
+ rows: 8,
126
+ value: raw,
127
+ onChange: (e) => setRaw(e.target.value),
128
+ className: "tabular-nums text-xs resize-none"
129
+ }
130
+ ),
131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
132
+ import_button.Button,
133
+ {
134
+ size: "sm",
135
+ className: "w-full bg-green-600 hover:bg-green-700 text-white",
136
+ disabled: parsed.length === 0 || isSubmitting,
137
+ onClick: () => onPublish(parsed),
138
+ children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
139
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-3.5 w-3.5 animate-spin mr-1.5" }),
140
+ "Publishing\u2026"
141
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CheckCircle2, { className: "h-3.5 w-3.5 mr-1.5" }),
143
+ "Publish ",
144
+ parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? "s" : ""}` : "participants"
145
+ ] })
146
+ }
147
+ ),
148
+ links && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2 pt-2", children: [
149
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { variant: "outline", size: "sm", className: "w-full", onClick: () => downloadCsv(links), children: [
150
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Download, { className: "h-3.5 w-3.5 mr-1.5" }),
151
+ "Download claim links (CSV)"
152
+ ] }),
153
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground", children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: "truncate", children: link.address }, link.address)) })
154
+ ] })
155
+ ] });
156
+ }
157
+ function PopManagePage({ contract }) {
158
+ const app = (0, import_medialane_app.useMedialaneApp)();
159
+ const walletAddress = app.walletAddress;
160
+ const { collection, isLoading } = (0, import_use_collections.useCollection)(contract);
161
+ const tx = (0, import_use_transaction.useTransaction)();
162
+ const [done, setDone] = (0, import_react.useState)({ title: "", description: "" });
163
+ const [links, setLinks] = (0, import_react.useState)(null);
164
+ const isSubmitting = tx.phase === "preparing" || tx.phase === "submitting" || tx.phase === "confirming";
165
+ const isOwner = walletAddress && collection?.owner && (0, import_sdk.normalizeAddress)("STARKNET", walletAddress) === (0, import_sdk.normalizeAddress)("STARKNET", collection.owner);
166
+ const issue = (recipient) => {
167
+ setDone({ title: "Credential issued", description: "The credential is now in their wallet." });
168
+ void tx.run(async (signer) => {
169
+ await (0, import_run_intent_calls.runIntentCalls)(signer, () => app.getClient().api.intents.create("pop-manage", { owner: signer.address, collection: contract, action: "issue", recipient }));
170
+ });
171
+ };
172
+ const publish = (addresses) => {
173
+ const list = (0, import_starknet.buildPopAllowlist)(addresses);
174
+ const count = Object.keys(list.proofs).length;
175
+ setDone({ title: "Participants published", description: `Published ${count} participant${count !== 1 ? "s" : ""}.` });
176
+ void tx.run(async (signer) => {
177
+ await (0, import_run_intent_calls.runIntentCalls)(signer, () => app.getClient().api.intents.create("pop-manage", { owner: signer.address, collection: contract, action: "set_allowlist_root", root: list.root }));
178
+ }).then((ok) => {
179
+ if (ok) setLinks((0, import_starknet.popClaimLinks)(window.location.origin, contract, list));
180
+ });
181
+ };
182
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_wallet_required.WalletRequired, { icon: import_lucide_react.Award, title: "Connect your wallet", description: "Connect to manage your event.", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4", children: [
183
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-6 w-24" }),
184
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-32 w-full rounded-2xl" }),
185
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-64 w-full rounded-2xl" })
186
+ ] }) : !collection ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
187
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
188
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: "Collection not found." }),
189
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/launchpad/pop", children: "\u2190 Back" }) })
190
+ ] }) : !isOwner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
191
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
192
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: "You are not the organizer of this event." }),
193
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/launchpad/pop", children: "\u2190 Back to events" }) })
194
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6", children: [
195
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: "Manage event", workingLabel: "Updating your event\u2026", firstStepLabel: "Prepare", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_done.TransactionDone, { tx, name: collection.name ?? "Event", title: done.title, description: done.description }) }),
196
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "ghost", size: "sm", className: "-ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: "/launchpad/pop", children: [
197
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowLeft, { className: "h-3.5 w-3.5 mr-1.5" }),
198
+ "All events"
199
+ ] }) }) }),
200
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { delay: 0.04, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
201
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "pill-badge inline-flex gap-1.5 mb-2", children: [
202
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-3 w-3" }),
203
+ "Organizer"
204
+ ] }),
205
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-2xl font-bold mt-1", children: "Manage Event" }),
206
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: collection.name ?? contract })
207
+ ] }) }),
208
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { delay: 0.08, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell p-4 flex items-center gap-3", children: [
209
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-4 w-4 text-green-500 shrink-0" }),
210
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
211
+ "Only participants on your ",
212
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { className: "text-foreground", children: "published list" }),
213
+ " can claim, with the link you send them."
214
+ ] })
215
+ ] }) }),
216
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { delay: 0.12, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AllowlistSection, { onPublish: publish, isSubmitting, links }) }),
217
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { delay: 0.16, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IssueSection, { onIssue: issue, isSubmitting }) })
218
+ ] }) });
219
+ }
220
+ // Annotate the CommonJS export names for ESM import in node:
221
+ 0 && (module.exports = {
222
+ PopManagePage
223
+ });
224
+ //# sourceMappingURL=pop-manage-page.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/pop-manage-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionDone } from \"./transaction-done.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Issue directly</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Send the credential straight to one wallet — for a late participant, without republishing the list or\n changing anyone&apos;s claim link.\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n Issue credential\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Participants</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {parsed.length} address{parsed.length !== 1 ? \"es\" : \"\"}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Paste every participant&apos;s wallet address. Publishing replaces the previous list and every link\n sent before it — send the new links to everyone who hasn&apos;t claimed yet. The list stays in this\n browser: download the claim links and send each participant theirs.\n </p>\n <Textarea\n placeholder={\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\"}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-green-600 hover:bg-green-700 text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n Publishing…\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n Publish {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : \"participants\"}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"outline\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n Download claim links (CSV)\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone({ title: \"Credential issued\", description: \"The credential is now in their wallet.\" });\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone({ title: \"Participants published\", description: `Published ${count} participant${count !== 1 ? \"s\" : \"\"}.` });\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title=\"Connect your wallet\" description=\"Connect to manage your event.\">\n {isLoading ? (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4\">\n <Skeleton className=\"h-6 w-24\" />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </div>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">Collection not found.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">You are not the organizer of this event.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back to events</Link>\n </Button>\n </div>\n ) : (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6\">\n <TransactionDialog tx={tx} title=\"Manage event\" workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionDone tx={tx} name={collection.name ?? \"Event\"} title={done.title} description={done.description} />\n </TransactionDialog>\n\n <FadeIn>\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n All events\n </Link>\n </Button>\n </FadeIn>\n\n <FadeIn delay={0.04}>\n <div>\n <span className=\"pill-badge inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n Organizer\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">Manage Event</h1>\n <p className=\"text-sm text-muted-foreground\">{collection.name ?? contract}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.08}>\n <div className=\"bento-cell p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-green-500 shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">\n Only participants on your <strong className=\"text-foreground\">published list</strong> can claim,\n with the link you send them.\n </p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue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
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function PopManagePage({ contract }: {
4
+ contract: string;
5
+ }): react_jsx_runtime.JSX.Element;
6
+
7
+ export { PopManagePage };
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function PopManagePage({ contract }: {
4
+ contract: string;
5
+ }): react_jsx_runtime.JSX.Element;
6
+
7
+ export { PopManagePage };
@@ -0,0 +1,190 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { normalizeAddress } from "@medialane/sdk";
5
+ import { buildPopAllowlist, popClaimLinks, popClaimLinksCsv } from "@medialane/sdk/starknet";
6
+ import { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from "lucide-react";
7
+ import { Button } from "./button.js";
8
+ import Link from "./link.js";
9
+ import { useMedialaneApp } from "./medialane-app.js";
10
+ import { FadeIn } from "./motion-primitives.js";
11
+ import { Skeleton } from "./skeleton.js";
12
+ import { Textarea } from "./textarea.js";
13
+ import { TransactionDialog } from "./transaction-dialog.js";
14
+ import { TransactionDone } from "./transaction-done.js";
15
+ import { WalletRequired } from "./wallet-required.js";
16
+ import { runIntentCalls } from "../utils/run-intent-calls.js";
17
+ import { useCollection } from "../utils/use-collections.js";
18
+ import { useTransaction } from "../utils/use-transaction.js";
19
+ function parseAddresses(raw) {
20
+ return raw.split(/[\n,\s]+/).map((a) => a.trim()).filter((a) => /^0x[0-9a-fA-F]+$/.test(a));
21
+ }
22
+ function downloadCsv(links) {
23
+ const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: "text/csv" }));
24
+ const anchor = Object.assign(document.createElement("a"), { href, download: "claim-links.csv" });
25
+ anchor.click();
26
+ URL.revokeObjectURL(href);
27
+ }
28
+ function IssueSection({
29
+ onIssue,
30
+ isSubmitting
31
+ }) {
32
+ const [raw, setRaw] = useState("");
33
+ const address = raw.trim();
34
+ const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);
35
+ return /* @__PURE__ */ jsxs("div", { className: "bento-cell p-5 space-y-3", children: [
36
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
37
+ /* @__PURE__ */ jsx(Award, { className: "h-4 w-4 text-green-500" }),
38
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-sm", children: "Issue directly" })
39
+ ] }),
40
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Send the credential straight to one wallet \u2014 for a late participant, without republishing the list or changing anyone's claim link." }),
41
+ /* @__PURE__ */ jsx(
42
+ "input",
43
+ {
44
+ type: "text",
45
+ placeholder: "0x...",
46
+ value: raw,
47
+ onChange: (e) => setRaw(e.target.value),
48
+ className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"
49
+ }
50
+ ),
51
+ /* @__PURE__ */ jsxs(
52
+ Button,
53
+ {
54
+ size: "sm",
55
+ variant: "outline",
56
+ className: "w-full",
57
+ disabled: !valid || isSubmitting,
58
+ onClick: () => {
59
+ onIssue(address);
60
+ setRaw("");
61
+ },
62
+ children: [
63
+ /* @__PURE__ */ jsx(Send, { className: "h-3.5 w-3.5 mr-1.5" }),
64
+ "Issue credential"
65
+ ]
66
+ }
67
+ )
68
+ ] });
69
+ }
70
+ function AllowlistSection({
71
+ onPublish,
72
+ isSubmitting,
73
+ links
74
+ }) {
75
+ const [raw, setRaw] = useState("");
76
+ const parsed = parseAddresses(raw);
77
+ return /* @__PURE__ */ jsxs("div", { className: "bento-cell p-5 space-y-3", children: [
78
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
79
+ /* @__PURE__ */ jsx(Users, { className: "h-4 w-4 text-green-500" }),
80
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-sm", children: "Participants" }),
81
+ parsed.length > 0 && /* @__PURE__ */ jsxs("span", { className: "ml-auto text-xs text-muted-foreground", children: [
82
+ parsed.length,
83
+ " address",
84
+ parsed.length !== 1 ? "es" : ""
85
+ ] })
86
+ ] }),
87
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Paste every participant's wallet address. Publishing replaces the previous list and every link sent before it \u2014 send the new links to everyone who hasn't claimed yet. The list stays in this browser: download the claim links and send each participant theirs." }),
88
+ /* @__PURE__ */ jsx(
89
+ Textarea,
90
+ {
91
+ placeholder: "Paste Starknet addresses, one per line:\n0x04a...\n0x06b...",
92
+ rows: 8,
93
+ value: raw,
94
+ onChange: (e) => setRaw(e.target.value),
95
+ className: "tabular-nums text-xs resize-none"
96
+ }
97
+ ),
98
+ /* @__PURE__ */ jsx(
99
+ Button,
100
+ {
101
+ size: "sm",
102
+ className: "w-full bg-green-600 hover:bg-green-700 text-white",
103
+ disabled: parsed.length === 0 || isSubmitting,
104
+ onClick: () => onPublish(parsed),
105
+ children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [
106
+ /* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin mr-1.5" }),
107
+ "Publishing\u2026"
108
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
109
+ /* @__PURE__ */ jsx(CheckCircle2, { className: "h-3.5 w-3.5 mr-1.5" }),
110
+ "Publish ",
111
+ parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? "s" : ""}` : "participants"
112
+ ] })
113
+ }
114
+ ),
115
+ links && /* @__PURE__ */ jsxs("div", { className: "space-y-2 pt-2", children: [
116
+ /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", className: "w-full", onClick: () => downloadCsv(links), children: [
117
+ /* @__PURE__ */ jsx(Download, { className: "h-3.5 w-3.5 mr-1.5" }),
118
+ "Download claim links (CSV)"
119
+ ] }),
120
+ /* @__PURE__ */ jsx("ul", { className: "max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground", children: links.map((link) => /* @__PURE__ */ jsx("li", { className: "truncate", children: link.address }, link.address)) })
121
+ ] })
122
+ ] });
123
+ }
124
+ function PopManagePage({ contract }) {
125
+ const app = useMedialaneApp();
126
+ const walletAddress = app.walletAddress;
127
+ const { collection, isLoading } = useCollection(contract);
128
+ const tx = useTransaction();
129
+ const [done, setDone] = useState({ title: "", description: "" });
130
+ const [links, setLinks] = useState(null);
131
+ const isSubmitting = tx.phase === "preparing" || tx.phase === "submitting" || tx.phase === "confirming";
132
+ const isOwner = walletAddress && collection?.owner && normalizeAddress("STARKNET", walletAddress) === normalizeAddress("STARKNET", collection.owner);
133
+ const issue = (recipient) => {
134
+ setDone({ title: "Credential issued", description: "The credential is now in their wallet." });
135
+ void tx.run(async (signer) => {
136
+ await runIntentCalls(signer, () => app.getClient().api.intents.create("pop-manage", { owner: signer.address, collection: contract, action: "issue", recipient }));
137
+ });
138
+ };
139
+ const publish = (addresses) => {
140
+ const list = buildPopAllowlist(addresses);
141
+ const count = Object.keys(list.proofs).length;
142
+ setDone({ title: "Participants published", description: `Published ${count} participant${count !== 1 ? "s" : ""}.` });
143
+ void tx.run(async (signer) => {
144
+ await runIntentCalls(signer, () => app.getClient().api.intents.create("pop-manage", { owner: signer.address, collection: contract, action: "set_allowlist_root", root: list.root }));
145
+ }).then((ok) => {
146
+ if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));
147
+ });
148
+ };
149
+ return /* @__PURE__ */ jsx(WalletRequired, { icon: Award, title: "Connect your wallet", description: "Connect to manage your event.", children: isLoading ? /* @__PURE__ */ jsxs("div", { className: "max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4", children: [
150
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-24" }),
151
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full rounded-2xl" }),
152
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-64 w-full rounded-2xl" })
153
+ ] }) : !collection ? /* @__PURE__ */ jsxs("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
154
+ /* @__PURE__ */ jsx(AlertCircle, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
155
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Collection not found." }),
156
+ /* @__PURE__ */ jsx(Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ jsx(Link, { href: "/launchpad/pop", children: "\u2190 Back" }) })
157
+ ] }) : !isOwner ? /* @__PURE__ */ jsxs("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
158
+ /* @__PURE__ */ jsx(Award, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
159
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "You are not the organizer of this event." }),
160
+ /* @__PURE__ */ jsx(Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ jsx(Link, { href: "/launchpad/pop", children: "\u2190 Back to events" }) })
161
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6", children: [
162
+ /* @__PURE__ */ jsx(TransactionDialog, { tx, title: "Manage event", workingLabel: "Updating your event\u2026", firstStepLabel: "Prepare", children: /* @__PURE__ */ jsx(TransactionDone, { tx, name: collection.name ?? "Event", title: done.title, description: done.description }) }),
163
+ /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsx(Button, { asChild: true, variant: "ghost", size: "sm", className: "-ml-2", children: /* @__PURE__ */ jsxs(Link, { href: "/launchpad/pop", children: [
164
+ /* @__PURE__ */ jsx(ArrowLeft, { className: "h-3.5 w-3.5 mr-1.5" }),
165
+ "All events"
166
+ ] }) }) }),
167
+ /* @__PURE__ */ jsx(FadeIn, { delay: 0.04, children: /* @__PURE__ */ jsxs("div", { children: [
168
+ /* @__PURE__ */ jsxs("span", { className: "pill-badge inline-flex gap-1.5 mb-2", children: [
169
+ /* @__PURE__ */ jsx(Award, { className: "h-3 w-3" }),
170
+ "Organizer"
171
+ ] }),
172
+ /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold mt-1", children: "Manage Event" }),
173
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: collection.name ?? contract })
174
+ ] }) }),
175
+ /* @__PURE__ */ jsx(FadeIn, { delay: 0.08, children: /* @__PURE__ */ jsxs("div", { className: "bento-cell p-4 flex items-center gap-3", children: [
176
+ /* @__PURE__ */ jsx(Award, { className: "h-4 w-4 text-green-500 shrink-0" }),
177
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
178
+ "Only participants on your ",
179
+ /* @__PURE__ */ jsx("strong", { className: "text-foreground", children: "published list" }),
180
+ " can claim, with the link you send them."
181
+ ] })
182
+ ] }) }),
183
+ /* @__PURE__ */ jsx(FadeIn, { delay: 0.12, children: /* @__PURE__ */ jsx(AllowlistSection, { onPublish: publish, isSubmitting, links }) }),
184
+ /* @__PURE__ */ jsx(FadeIn, { delay: 0.16, children: /* @__PURE__ */ jsx(IssueSection, { onIssue: issue, isSubmitting }) })
185
+ ] }) });
186
+ }
187
+ export {
188
+ PopManagePage
189
+ };
190
+ //# sourceMappingURL=pop-manage-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/pop-manage-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionDone } from \"./transaction-done.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Issue directly</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Send the credential straight to one wallet — for a late participant, without republishing the list or\n changing anyone&apos;s claim link.\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n Issue credential\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Participants</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {parsed.length} address{parsed.length !== 1 ? \"es\" : \"\"}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Paste every participant&apos;s wallet address. Publishing replaces the previous list and every link\n sent before it — send the new links to everyone who hasn&apos;t claimed yet. The list stays in this\n browser: download the claim links and send each participant theirs.\n </p>\n <Textarea\n placeholder={\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\"}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-green-600 hover:bg-green-700 text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n Publishing…\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n Publish {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : \"participants\"}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"outline\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n Download claim links (CSV)\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone({ title: \"Credential issued\", description: \"The credential is now in their wallet.\" });\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone({ title: \"Participants published\", description: `Published ${count} participant${count !== 1 ? \"s\" : \"\"}.` });\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title=\"Connect your wallet\" description=\"Connect to manage your event.\">\n {isLoading ? (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4\">\n <Skeleton className=\"h-6 w-24\" />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </div>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">Collection not found.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">You are not the organizer of this event.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back to events</Link>\n </Button>\n </div>\n ) : (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6\">\n <TransactionDialog tx={tx} title=\"Manage event\" workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionDone tx={tx} name={collection.name ?? \"Event\"} title={done.title} description={done.description} />\n </TransactionDialog>\n\n <FadeIn>\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n All events\n </Link>\n </Button>\n </FadeIn>\n\n <FadeIn delay={0.04}>\n <div>\n <span className=\"pill-badge inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n Organizer\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">Manage Event</h1>\n <p className=\"text-sm text-muted-foreground\">{collection.name ?? contract}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.08}>\n <div className=\"bento-cell p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-green-500 shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">\n Only participants on your <strong className=\"text-foreground\">published list</strong> can claim,\n with the link you send them.\n </p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue} isSubmitting={isSubmitting} />\n </FadeIn>\n </div>\n )}\n </WalletRequired>\n );\n}\n"],"mappings":";AA8CM,SA0EI,UAzEF,KADF;AA5CN,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,mBAAmB,eAAe,wBAA2C;AACtF,SAAS,WAAW,OAAO,aA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