@medialane/ui 0.147.0 → 0.148.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/fast-mint/dropzone.d.cts +1 -1
- package/dist/components/fast-mint/dropzone.d.ts +1 -1
- package/dist/components/fast-mint/fast-mint.cjs +14 -8
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.d.cts +1 -1
- package/dist/components/fast-mint/fast-mint.d.ts +1 -1
- package/dist/components/fast-mint/fast-mint.js +15 -9
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/fast-mint/mintable-collections.cjs +38 -0
- package/dist/components/fast-mint/mintable-collections.cjs.map +1 -0
- package/dist/components/fast-mint/mintable-collections.d.cts +19 -0
- package/dist/components/fast-mint/mintable-collections.d.ts +19 -0
- package/dist/components/fast-mint/mintable-collections.js +13 -0
- package/dist/components/fast-mint/mintable-collections.js.map +1 -0
- package/dist/components/fast-mint/success-view.d.cts +1 -1
- package/dist/components/fast-mint/success-view.d.ts +1 -1
- package/dist/components/fast-mint/types.cjs +17 -0
- package/dist/components/fast-mint/types.cjs.map +1 -0
- package/dist/{types-BEsgYSTA.d.cts → components/fast-mint/types.d.cts} +1 -1
- package/dist/{types-BEsgYSTA.d.ts → components/fast-mint/types.d.ts} +1 -1
- package/dist/components/fast-mint/types.js +1 -0
- package/dist/components/fast-mint/types.js.map +1 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -39,6 +39,7 @@ var import_react_hook_form = require("react-hook-form");
|
|
|
39
39
|
var import_starknet = require("starknet");
|
|
40
40
|
var import_sdk = require("@medialane/sdk");
|
|
41
41
|
var import_starknet2 = require("@medialane/sdk/starknet");
|
|
42
|
+
var import_mintable_collections = require("./mintable-collections.js");
|
|
42
43
|
var import_lucide_react = require("lucide-react");
|
|
43
44
|
var import_input = require("../input.js");
|
|
44
45
|
var import_textarea = require("../textarea.js");
|
|
@@ -153,10 +154,11 @@ function CollectionThumb({ image }) {
|
|
|
153
154
|
function CollectionPicker({
|
|
154
155
|
collections,
|
|
155
156
|
value,
|
|
156
|
-
onChange
|
|
157
|
+
onChange,
|
|
158
|
+
valueOf
|
|
157
159
|
}) {
|
|
158
160
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
159
|
-
const selected = collections.find((c) => c
|
|
161
|
+
const selected = value ? collections.find((c) => valueOf(c) === value) ?? null : null;
|
|
160
162
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_popover.Popover, { open, onOpenChange: setOpen, children: [
|
|
161
163
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popover.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
162
164
|
"button",
|
|
@@ -175,13 +177,16 @@ function CollectionPicker({
|
|
|
175
177
|
}
|
|
176
178
|
) }),
|
|
177
179
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popover.PopoverContent, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "max-h-64 overflow-y-auto p-1", children: collections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No collections yet \u2014 create one instead." }) : collections.map((col) => {
|
|
178
|
-
const
|
|
180
|
+
const id = valueOf(col);
|
|
181
|
+
const isSelected = !!id && value === id;
|
|
179
182
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
180
183
|
"button",
|
|
181
184
|
{
|
|
182
185
|
type: "button",
|
|
186
|
+
disabled: !id,
|
|
183
187
|
onClick: () => {
|
|
184
|
-
|
|
188
|
+
if (!id) return;
|
|
189
|
+
onChange(id);
|
|
185
190
|
setOpen(false);
|
|
186
191
|
},
|
|
187
192
|
className: "flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60",
|
|
@@ -198,7 +203,7 @@ function CollectionPicker({
|
|
|
198
203
|
isSelected && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-4 w-4 text-brand-blue shrink-0" })
|
|
199
204
|
]
|
|
200
205
|
},
|
|
201
|
-
col.
|
|
206
|
+
id ?? col.contractAddress ?? col.name
|
|
202
207
|
);
|
|
203
208
|
}) }) })
|
|
204
209
|
] });
|
|
@@ -294,8 +299,8 @@ function FastMint(props) {
|
|
|
294
299
|
setAutoCollectionDescription(description);
|
|
295
300
|
}
|
|
296
301
|
}, [description, autoCollectionDescription, newCollectionDescription]);
|
|
297
|
-
const erc721Collections =
|
|
298
|
-
const erc1155Collections =
|
|
302
|
+
const erc721Collections = (0, import_mintable_collections.mintableCollections)("single", collections);
|
|
303
|
+
const erc1155Collections = (0, import_mintable_collections.mintableCollections)("editions", collections);
|
|
299
304
|
const handleMediaSelect = async (file) => {
|
|
300
305
|
const kind = detectMediaKind(file.type);
|
|
301
306
|
if (!kind) {
|
|
@@ -783,7 +788,8 @@ function FastMint(props) {
|
|
|
783
788
|
{
|
|
784
789
|
collections: assetType === "single" ? erc721Collections : erc1155Collections,
|
|
785
790
|
value: assetType === "single" ? existingCollectionId : existingCollectionContract,
|
|
786
|
-
onChange: assetType === "single" ? setExistingCollectionId : setExistingCollectionContract
|
|
791
|
+
onChange: assetType === "single" ? setExistingCollectionId : setExistingCollectionContract,
|
|
792
|
+
valueOf: (0, import_mintable_collections.collectionKey)(assetType === "single" ? "single" : "editions")
|
|
787
793
|
}
|
|
788
794
|
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-3 rounded-xl border border-border p-3", children: [
|
|
789
795
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative h-16 w-16 rounded-lg overflow-hidden bg-muted shrink-0", children: (mediaKind === "image" ? mediaPreview : featurePreview) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fast-mint/fast-mint.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport Image from \"next/image\";\nimport { useForm } from \"react-hook-form\";\nimport { hash } from \"starknet\";\nimport { normalizeAddress, getService, buildAssetMetadata, type ApiCollection } from \"@medialane/sdk\";\nimport { executeIntent } from \"@medialane/sdk/starknet\";\nimport {\n ImagePlus, Music, Video, FileText, Loader2,\n Layers, ImagePlus as SingleIcon, ChevronDown, Boxes, Plus, Check,\n ShieldCheck, X,\n} from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { Textarea } from \"../textarea.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover.js\";\nimport { MedialaneCollectionCard } from \"../medialane-collection-card.js\";\nimport { ActionDialog } from \"../action-dialog.js\";\nimport { IPTypeFields, type MetadataField } from \"../ip-type-fields.js\";\nimport {\n IP_TYPES, LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES, DERIVATIVES_OPTIONS,\n type IPType,\n} from \"../../data/ip.js\";\nimport { IP_TEMPLATES } from \"../../data/ip-templates.js\";\nimport { suggestLaunchpadSymbol } from \"../../utils/launchpad-defaults.js\";\nimport { uploadFileToIpfs, uploadJsonToIpfs, uploadFailureToast } from \"../../utils/ipfs-upload.js\";\nimport { ipfsToHttp } from \"../../utils/ipfs.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { Dropzone } from \"./dropzone.js\";\nimport { SuccessView } from \"./success-view.js\";\nimport type { FastMintProps, FastMintSigner, MediaKind, MintedAsset } from \"./types.js\";\n\nconst COLLECTION_DEPLOYED_SELECTOR = hash.getSelectorFromName(\"CollectionDeployed\");\nconst IP_MINTED_SELECTOR = hash.getSelectorFromName(\"IPMinted\");\n\nasync function readMintedTokenId(\n provider: { getTransactionReceipt(txHash: string): Promise<unknown> },\n txHash: string,\n contractAddress: string,\n): Promise<string | null> {\n let receipt: { events?: { from_address?: string; keys?: string[] }[] } | null = null;\n for (let attempt = 0; attempt < 3 && !receipt; attempt++) {\n try {\n if (attempt > 0) await new Promise((r) => setTimeout(r, 2000));\n const raw = await provider.getTransactionReceipt(txHash);\n receipt = raw as { events?: { from_address?: string; keys?: string[] }[] };\n } catch { /* retry */ }\n }\n const events = receipt?.events ?? [];\n const mintEvent = events.find((e) =>\n e.from_address && BigInt(e.from_address) === BigInt(contractAddress) &&\n e.keys?.[0] && BigInt(e.keys[0]) === BigInt(IP_MINTED_SELECTOR)\n );\n if (!mintEvent?.keys?.[1]) return null;\n const low = BigInt(mintEvent.keys[1] ?? 0);\n const high = BigInt(mintEvent.keys[2] ?? 0);\n return (low + (high << 128n)).toString();\n}\n\nconst MEDIA_ROUTE_MIME_TYPES = new Set([\n \"image/jpeg\", \"image/png\", \"image/gif\", \"image/webp\", \"image/svg+xml\", \"image/avif\",\n \"video/mp4\", \"video/webm\", \"video/ogg\",\n \"audio/mpeg\", \"audio/ogg\", \"audio/wav\", \"audio/webm\", \"audio/flac\",\n \"application/pdf\",\n]);\nconst DOCUMENT_SIGNED_URL_MIME_TYPES = new Set([\n \"application/msword\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"application/vnd.oasis.opendocument.text\",\n \"application/rtf\",\n \"text/plain\",\n \"text/markdown\",\n]);\nconst MEDIA_MAX_BYTES = 100 * 1024 * 1024;\nconst DOCUMENT_MAX_BYTES = 20 * 1024 * 1024;\n\nfunction detectMediaKind(mime: string): MediaKind | null {\n if (mime.startsWith(\"image/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"image\" : null;\n if (mime.startsWith(\"video/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"video\" : null;\n if (mime.startsWith(\"audio/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"audio\" : null;\n if (mime === \"application/pdf\" || DOCUMENT_SIGNED_URL_MIME_TYPES.has(mime)) return \"document\";\n return null;\n}\n\nconst IP_TYPE_BY_KIND: Record<MediaKind, IPType> = {\n image: \"NFT\",\n audio: \"Audio\",\n video: \"Video\",\n document: \"Documents\",\n};\n\nconst MEDIA_KIND_ICON: Record<MediaKind, typeof ImagePlus> = {\n image: ImagePlus,\n audio: Music,\n video: Video,\n document: FileText,\n};\n\nfunction ToggleGroup({\n value, options, onChange,\n}: { value: string; options: readonly string[]; onChange: (v: string) => void }) {\n return (\n <div className=\"flex rounded-lg border border-border overflow-hidden w-full\">\n {options.map((opt, i) => (\n <button\n key={opt}\n type=\"button\"\n onClick={() => onChange(opt)}\n className={cn(\n \"flex-1 px-3 py-2 text-sm transition-colors\",\n i > 0 && \"border-l border-border\",\n value === opt ? \"bg-primary text-primary-foreground font-medium\" : \"bg-background hover:bg-muted text-muted-foreground\"\n )}\n >\n {opt}\n </button>\n ))}\n </div>\n );\n}\n\nfunction collectionDisplayLabel(col: ApiCollection) {\n return col.name || col.symbol || `Collection #${col.collectionId}`;\n}\n\nfunction CollectionThumb({ image }: { image: string | null | undefined }) {\n const imageUrl = image ? ipfsToHttp(image) : null;\n return (\n <div className=\"relative h-10 w-10 rounded-lg overflow-hidden bg-muted shrink-0\">\n {imageUrl ? (\n <Image src={imageUrl} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-4 w-4 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n );\n}\n\nfunction CollectionPicker({\n collections, value, onChange,\n}: { collections: ApiCollection[]; value: string; onChange: (id: string) => void }) {\n const [open, setOpen] = useState(false);\n const selected = collections.find((c) => c.collectionId === value) ?? null;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-expanded={open}\n className=\"flex w-full items-center gap-3 rounded-xl border border-border p-3 text-left transition-colors hover:bg-muted/40\"\n >\n <CollectionThumb image={selected?.image} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold truncate\">\n {selected ? collectionDisplayLabel(selected) : collections.length ? \"Choose a collection\" : \"No collections yet\"}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {selected ? `${selected.totalSupply ?? 0} work${selected.totalSupply === 1 ? \"\" : \"s\"}` : \"Where this work will live\"}\n </p>\n </div>\n <ChevronDown className=\"h-3.5 w-3.5 text-muted-foreground shrink-0\" />\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[var(--radix-popover-trigger-width)] p-0\" align=\"start\">\n <div className=\"max-h-64 overflow-y-auto p-1\">\n {collections.length === 0 ? (\n <p className=\"px-3 py-4 text-center text-sm text-muted-foreground\">No collections yet — create one instead.</p>\n ) : (\n collections.map((col) => {\n const isSelected = value === col.collectionId;\n return (\n <button\n key={col.collectionId!}\n type=\"button\"\n onClick={() => { onChange(col.collectionId!); setOpen(false); }}\n className=\"flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60\"\n >\n <CollectionThumb image={col.image} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium truncate\">{collectionDisplayLabel(col)}</p>\n <p className=\"text-xs text-muted-foreground\">{col.totalSupply ?? 0} work{col.totalSupply === 1 ? \"\" : \"s\"}</p>\n </div>\n {isSelected && <Check className=\"h-4 w-4 text-brand-blue shrink-0\" />}\n </button>\n );\n })\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\ninterface FormValues {\n name: string;\n description: string;\n external_url: string;\n licenseType: string;\n commercialUse: \"Yes\" | \"No\";\n derivatives: \"Allowed\" | \"Not Allowed\" | \"Share-Alike\";\n attribution: \"Required\" | \"Not Required\";\n geographicScope: string;\n aiPolicy: \"Allowed\" | \"Not Allowed\" | \"Training Only\";\n royalty: number;\n}\n\nexport function FastMint(props: FastMintProps) {\n const {\n presentation = \"inline\", open = true, onClose, mediaKindLock, onMinted,\n collections, refetchCollections,\n hasWallet, walletAddress, onRequireWallet, connectLabel, getUploadToken, getSigner,\n client, provider,\n } = props;\n\n const [status, setStatus] = useState<\"idle\" | \"minting\" | \"success\" | \"error\">(\"idle\");\n const [errorMsg, setErrorMsg] = useState<string | null>(null);\n\n const [mediaFile, setMediaFile] = useState<File | null>(null);\n const [mediaPreview, setMediaPreview] = useState<string | null>(null);\n const [mediaUri, setMediaUri] = useState<string | null>(null);\n const [mediaKind, setMediaKind] = useState<MediaKind>(\"image\");\n const [mediaUploading, setMediaUploading] = useState(false);\n const previewUrlRef = useRef<string | null>(null);\n const mediaInputRef = useRef<HTMLInputElement>(null);\n\n const [featurePreview, setFeaturePreview] = useState<string | null>(null);\n const [featureUri, setFeatureUri] = useState<string | null>(null);\n const [featureUploading, setFeatureUploading] = useState(false);\n const featurePreviewRef = useRef<string | null>(null);\n const featureInputRef = useRef<HTMLInputElement>(null);\n\n const [assetType, setAssetType] = useState<\"single\" | \"editions\">(\"single\");\n const [editionCount, setEditionCount] = useState(\"10\");\n\n const [collectionMode, setCollectionMode] = useState<\"existing\" | \"new\">(\"existing\");\n const [existingCollectionId, setExistingCollectionId] = useState(\"\");\n const [existingCollectionContract, setExistingCollectionContract] = useState(\"\");\n const [newCollectionName, setNewCollectionName] = useState(\"\");\n const [newCollectionSymbol, setNewCollectionSymbol] = useState(\"\");\n const [newCollectionDescription, setNewCollectionDescription] = useState(\"\");\n const [autoSymbol, setAutoSymbol] = useState(\"\");\n const [autoCollectionName, setAutoCollectionName] = useState(\"\");\n const [autoCollectionDescription, setAutoCollectionDescription] = useState(\"\");\n\n const [ipType, setIpType] = useState<IPType>(\"NFT\");\n const [advancedOpen, setAdvancedOpen] = useState(false);\n const [ipTypeOpen, setIpTypeOpen] = useState(false);\n const templateFieldsRef = useRef<MetadataField[]>([]);\n\n const [mintedAsset, setMintedAsset] = useState<MintedAsset | null>(null);\n\n useEffect(() => () => {\n if (previewUrlRef.current) URL.revokeObjectURL(previewUrlRef.current);\n if (featurePreviewRef.current) URL.revokeObjectURL(featurePreviewRef.current);\n }, []);\n\n const form = useForm<FormValues>({\n defaultValues: {\n name: \"\", description: \"\", external_url: \"\",\n licenseType: \"CC BY-SA\", commercialUse: \"Yes\", derivatives: \"Share-Alike\",\n attribution: \"Required\", geographicScope: \"Worldwide\", aiPolicy: \"Not Allowed\", royalty: 0,\n },\n });\n const name = form.watch(\"name\");\n\n useEffect(() => {\n if (walletAddress && !form.getValues(\"external_url\")) {\n form.setValue(\"external_url\", `https://medialane.io/account/${walletAddress}`);\n }\n }, [walletAddress, form]);\n\n useEffect(() => {\n const s = suggestLaunchpadSymbol(name);\n if (!s) return;\n if (!newCollectionSymbol || newCollectionSymbol === autoSymbol) {\n setNewCollectionSymbol(s);\n setAutoSymbol(s);\n }\n if (!newCollectionName || newCollectionName === autoCollectionName) {\n setNewCollectionName(name);\n setAutoCollectionName(name);\n }\n }, [name, autoSymbol, autoCollectionName, newCollectionSymbol, newCollectionName]);\n\n const description = form.watch(\"description\");\n useEffect(() => {\n if (!newCollectionDescription || newCollectionDescription === autoCollectionDescription) {\n setNewCollectionDescription(description);\n setAutoCollectionDescription(description);\n }\n }, [description, autoCollectionDescription, newCollectionDescription]);\n\n const erc721Collections = collections.filter((c) => getService(c.service)?.id === \"mip-erc721\");\n const erc1155Collections = collections.filter((c) => c.standard === \"ERC1155\");\n\n const handleMediaSelect = async (file: File) => {\n const kind = detectMediaKind(file.type);\n if (!kind) {\n setErrorMsg(\"Publish an image, audio, video (JPG/PNG/GIF/SVG/WebP, MP3/WAV/OGG/FLAC, MP4/WebM), or document (PDF, DOC, DOCX, ODT, RTF, TXT, MD).\");\n return;\n }\n if (mediaKindLock && kind !== mediaKindLock) {\n setErrorMsg(`Please upload a${mediaKindLock === \"image\" ? \"n\" : \"\"} ${mediaKindLock}.`);\n return;\n }\n const viaMediaRoute = MEDIA_ROUTE_MIME_TYPES.has(file.type);\n const maxBytes = viaMediaRoute ? MEDIA_MAX_BYTES : DOCUMENT_MAX_BYTES;\n if (file.size > maxBytes) {\n setErrorMsg(`Maximum size is ${maxBytes / (1024 * 1024)} MB.`);\n return;\n }\n setMediaFile(file);\n setMediaKind(kind);\n setIpType(IP_TYPE_BY_KIND[kind]);\n if (previewUrlRef.current) URL.revokeObjectURL(previewUrlRef.current);\n const objectUrl = URL.createObjectURL(file);\n previewUrlRef.current = objectUrl;\n setMediaPreview(objectUrl);\n setMediaUri(null);\n setMediaUploading(true);\n try {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, viaMediaRoute ? \"media\" : \"document\");\n setMediaUri(uri);\n } catch (err) {\n const t = uploadFailureToast(err);\n setErrorMsg(t.description ?? t.title);\n } finally {\n setMediaUploading(false);\n }\n };\n\n const clearMedia = () => {\n setMediaFile(null);\n setMediaPreview(null);\n setMediaUri(null);\n if (mediaInputRef.current) mediaInputRef.current.value = \"\";\n };\n\n const handleFeatureSelect = async (file: File) => {\n if (featurePreviewRef.current) URL.revokeObjectURL(featurePreviewRef.current);\n const objectUrl = URL.createObjectURL(file);\n featurePreviewRef.current = objectUrl;\n setFeaturePreview(objectUrl);\n setFeatureUri(null);\n setFeatureUploading(true);\n try {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, \"image\");\n setFeatureUri(uri);\n } catch (err) {\n const t = uploadFailureToast(err);\n setErrorMsg(t.description ?? t.title);\n } finally {\n setFeatureUploading(false);\n }\n };\n\n const handleLicenseChange = (value: string) => {\n form.setValue(\"licenseType\", value);\n const def = LICENSE_TYPES.find((l) => l.value === value);\n if (def) {\n form.setValue(\"commercialUse\", def.commercialUse);\n form.setValue(\"derivatives\", def.derivatives);\n form.setValue(\"attribution\", def.attribution);\n }\n };\n\n const ready = !!mediaUri && !mediaUploading && name.trim().length > 0 &&\n (mediaKind === \"image\" || !!featureUri) &&\n (collectionMode === \"existing\"\n ? assetType === \"single\" ? !!existingCollectionId : !!existingCollectionContract\n : newCollectionName.trim().length > 0 && newCollectionSymbol.trim().length > 0);\n\n async function pollForNewCollection(name: string, symbol: string): Promise<ApiCollection | null> {\n for (let attempt = 0; attempt < 8; attempt++) {\n const list = await refetchCollections();\n const match = list.find((c) => c.name === name && c.symbol === symbol);\n if (match?.collectionId) return match;\n await new Promise((r) => setTimeout(r, 1500));\n }\n return null;\n }\n\n const onSubmit = async (values: FormValues) => {\n if (!hasWallet) { onRequireWallet(); return; }\n if (!walletAddress || !mediaUri) return;\n if (values.external_url && !values.external_url.startsWith(\"http://\") && !values.external_url.startsWith(\"https://\")) {\n setErrorMsg(\"External link must start with http:// or https://\");\n return;\n }\n\n setStatus(\"minting\");\n setErrorMsg(null);\n\n try {\n const signer: FastMintSigner = await getSigner();\n\n const image = mediaKind === \"image\" ? mediaUri : featureUri!;\n const animationUrl = mediaKind === \"image\" ? undefined : mediaUri;\n\n const built = buildAssetMetadata({\n name: values.name,\n description: values.description || \"\",\n externalUrl: values.external_url || \"\",\n imageUri: image,\n creator: walletAddress,\n ipType,\n licenseType: values.licenseType,\n commercialUse: values.commercialUse,\n derivatives: values.derivatives,\n attribution: values.attribution,\n geographicScope: values.geographicScope,\n aiPolicy: values.aiPolicy,\n royalty: String(values.royalty),\n templateTraits: templateFieldsRef.current\n .filter(({ traitType, value }) => traitType.trim() && value.trim())\n .map(({ traitType, value }) => ({ traitType, value })),\n });\n const metadata: Record<string, unknown> = { ...built };\n if (animationUrl) metadata.animation_url = animationUrl;\n\n const uploadToken = await getUploadToken();\n if (!uploadToken) throw new Error(\"Sign in first\");\n const tokenUri = await uploadJsonToIpfs(metadata, uploadToken);\n\n let result: { txHash: string };\n let finalContractAddress: string | null;\n let finalTokenId: string | null = null;\n\n if (assetType === \"single\") {\n let collectionId = existingCollectionId;\n let contractAddress = erc721Collections.find((c) => c.collectionId === existingCollectionId)?.contractAddress ?? null;\n\n if (collectionMode === \"new\") {\n const intentRes = await client.api.createCollectionIntent({\n owner: walletAddress,\n name: newCollectionName,\n symbol: newCollectionSymbol,\n description: newCollectionDescription || undefined,\n image,\n });\n await executeIntent(provider, signer, client, intentRes.data);\n\n const found = await pollForNewCollection(newCollectionName, newCollectionSymbol);\n if (!found) throw new Error(\"Collection created, but it's still indexing — try minting again in a moment from My Collections.\");\n collectionId = found.collectionId!;\n contractAddress = found.contractAddress ?? null;\n }\n\n const intentRes = await client.api.createMintIntent({\n owner: walletAddress,\n collectionId,\n recipient: walletAddress,\n tokenUri,\n royaltyBps: Math.round(values.royalty * 100),\n });\n if (!intentRes.data.requiresSignature) {\n const calls = intentRes.data.calls;\n contractAddress = calls[calls.length - 1]?.contractAddress ?? contractAddress;\n }\n result = await executeIntent(provider, signer, client, intentRes.data);\n finalContractAddress = contractAddress;\n\n if (finalContractAddress) {\n finalTokenId = await readMintedTokenId(provider, result.txHash, finalContractAddress);\n }\n } else {\n let collectionContract = existingCollectionContract;\n\n if (collectionMode === \"new\") {\n const intentRes = await client.api.createCollectionIntent({\n owner: walletAddress,\n name: newCollectionName,\n symbol: newCollectionSymbol,\n description: newCollectionDescription || undefined,\n image,\n baseUri: \"\",\n service: \"mip-erc1155\",\n });\n const deployResult = await executeIntent(provider, signer, client, intentRes.data);\n\n let receipt: { events?: { keys?: string[] }[] } | null = null;\n for (let attempt = 0; attempt < 3 && !receipt; attempt++) {\n try {\n if (attempt > 0) await new Promise((r) => setTimeout(r, 2000));\n const raw = await provider.getTransactionReceipt(deployResult.txHash);\n receipt = raw as { events?: { keys?: string[] }[] };\n } catch { /* retry */ }\n }\n const events = receipt?.events ?? [];\n const deployEvent = events.find((e) =>\n e.keys?.[0] && BigInt(e.keys[0]) === BigInt(COLLECTION_DEPLOYED_SELECTOR)\n );\n if (!deployEvent?.keys?.[1]) throw new Error(\"Collection deployed, but its address couldn't be read — check My Collections to mint into it.\");\n collectionContract = normalizeAddress(\"STARKNET\", deployEvent.keys[1]);\n }\n\n const intentRes = await client.api.createMintIntent({\n owner: walletAddress,\n recipient: walletAddress,\n collectionContract,\n tokenUri,\n value: editionCount,\n royaltyBps: Math.round(values.royalty * 100),\n });\n result = await executeIntent(provider, signer, client, intentRes.data);\n finalContractAddress = collectionContract;\n finalTokenId = await readMintedTokenId(provider, result.txHash, collectionContract);\n }\n\n if (finalContractAddress && finalTokenId) {\n const asset: MintedAsset = { contract: finalContractAddress, tokenId: finalTokenId, image };\n setMintedAsset(asset);\n onMinted?.(asset);\n }\n setStatus(\"success\");\n } catch (err) {\n setErrorMsg(err instanceof Error ? err.message : \"Something went wrong. Please try again.\");\n setStatus(\"error\");\n }\n };\n\n const resetAll = () => {\n setStatus(\"idle\");\n setErrorMsg(null);\n setMintedAsset(null);\n form.reset();\n clearMedia();\n setFeaturePreview(null);\n setFeatureUri(null);\n setAssetType(\"single\");\n setEditionCount(\"10\");\n setCollectionMode(\"existing\");\n setExistingCollectionId(\"\");\n setExistingCollectionContract(\"\");\n setNewCollectionName(\"\");\n setNewCollectionSymbol(\"\");\n setNewCollectionDescription(\"\");\n setAutoSymbol(\"\");\n setAutoCollectionName(\"\");\n setAutoCollectionDescription(\"\");\n templateFieldsRef.current = [];\n };\n\n const busy = status === \"minting\";\n const KindIcon = MEDIA_KIND_ICON[mediaKind];\n const selectedExistingCollection = assetType === \"single\"\n ? erc721Collections.find((c) => c.collectionId === existingCollectionId)\n : erc1155Collections.find((c) => c.contractAddress === existingCollectionContract);\n const collectionLabel = mediaUri\n ? (collectionMode === \"new\"\n ? (newCollectionName || \"New collection\")\n : (selectedExistingCollection?.name || \"IP Asset\"))\n : undefined;\n\n const wrap = (node: React.ReactNode) => {\n if (presentation !== \"dialog\") return node;\n return (\n <ActionDialog open={open} onClose={onClose ?? (() => {})} width={640}>\n <div className=\"relative p-6 sm:p-8\">\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close\"\n className=\"absolute top-4 right-4 h-8 w-8 rounded-full hover:bg-muted flex items-center justify-center text-muted-foreground\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n {node}\n </div>\n </ActionDialog>\n );\n };\n\n if (status === \"success\") {\n return wrap(\n <SuccessView\n presentation={presentation}\n previewImage={mediaKind === \"image\" ? mediaPreview : featurePreview}\n name={name}\n collectionLabel={collectionLabel}\n mintedAsset={mintedAsset}\n onPublishAnother={resetAll}\n />\n );\n }\n\n if (!mediaFile) {\n return wrap(\n <Dropzone\n mediaKindLock={mediaKindLock}\n presentation={presentation}\n hasWallet={hasWallet}\n onRequireWallet={onRequireWallet}\n connectLabel={connectLabel}\n onFileSelected={handleMediaSelect}\n />\n );\n }\n\n return wrap(\n <section className=\"space-y-6\">\n <div className=\"flex items-center gap-4 rounded-xl border border-border p-3\">\n <div className=\"relative h-14 w-14 rounded-lg bg-muted overflow-hidden shrink-0\">\n {mediaKind === \"image\" && mediaPreview ? (\n <Image src={mediaPreview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <KindIcon className=\"h-6 w-6 text-muted-foreground\" />\n </div>\n )}\n {mediaUploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-1\">\n <p className=\"text-sm font-semibold truncate\">{mediaFile.name}</p>\n <div className=\"flex items-center gap-2 flex-wrap\">\n <p className=\"text-xs text-muted-foreground\">\n {mediaUploading ? \"Uploading…\" : mediaUri ? \"Uploaded\" : \"Upload failed\"}\n </p>\n {mediaUri && (() => {\n const template = IP_TEMPLATES[ipType];\n const TemplateIcon = template.icon;\n return (\n <span\n className={cn(\n \"inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs font-medium\",\n template.color.bg, template.color.text, template.color.border\n )}\n >\n <TemplateIcon className=\"h-3 w-3\" />\n {template.label}\n </span>\n );\n })()}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => mediaInputRef.current?.click()}\n className=\"text-xs font-semibold text-brand-blue hover:underline shrink-0\"\n >\n Change\n </button>\n <input ref={mediaInputRef} type=\"file\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) handleMediaSelect(f); }} />\n </div>\n\n {mediaUri && (\n <div className=\"grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-8 items-start\">\n <div className=\"space-y-5\">\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Title *</label>\n <Input\n value={name}\n onChange={(e) => form.setValue(\"name\", e.target.value)}\n placeholder=\"My Creative Work\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Description</label>\n <Textarea\n value={form.watch(\"description\")}\n onChange={(e) => form.setValue(\"description\", e.target.value)}\n placeholder=\"Describe your work, its story, and any context for buyers…\"\n rows={3}\n />\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">External link <span className=\"text-muted-foreground font-normal\">(optional)</span></label>\n <Input\n value={form.watch(\"external_url\")}\n onChange={(e) => form.setValue(\"external_url\", e.target.value)}\n placeholder=\"https://yourwebsite.com\"\n />\n </div>\n\n {mediaKind !== \"image\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Upload a cover image for your asset *</label>\n <div className=\"flex items-center gap-4\">\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => !featureUploading && featureInputRef.current?.click()}\n onKeyDown={(e) => { if ((e.key === \"Enter\" || e.key === \" \") && !featureUploading) { e.preventDefault(); featureInputRef.current?.click(); } }}\n className=\"relative h-20 w-20 rounded-xl border-2 border-dashed border-border bg-muted flex items-center justify-center overflow-hidden shrink-0 cursor-pointer hover:border-primary/50 transition-colors\"\n >\n {featurePreview ? (\n <Image src={featurePreview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <ImagePlus className=\"h-6 w-6 text-muted-foreground\" />\n )}\n {featureUploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n <input ref={featureInputRef} type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) handleFeatureSelect(f); }} />\n </div>\n <p className=\"text-xs text-muted-foreground\">Cover art shown wherever the work is previewed. JPG, PNG, GIF, SVG or WebP.</p>\n </div>\n </div>\n )}\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Asset Type</label>\n <div className=\"grid grid-cols-2 gap-3\">\n <button\n type=\"button\"\n onClick={() => setAssetType(\"single\")}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n assetType === \"single\" ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <SingleIcon className={cn(\"h-5 w-5 shrink-0 mt-0.5\", assetType === \"single\" ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">Single Edition NFT</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">Minted once</span>\n </span>\n </button>\n <button\n type=\"button\"\n onClick={() => setAssetType(\"editions\")}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n assetType === \"editions\" ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <Layers className={cn(\"h-5 w-5 shrink-0 mt-0.5\", assetType === \"editions\" ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">Limited Editions NFT</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">Several numbered copies</span>\n </span>\n </button>\n </div>\n </div>\n\n {assetType === \"editions\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Number of copies</label>\n <Input\n type=\"number\"\n min={1}\n value={editionCount}\n onChange={(e) => setEditionCount(e.target.value)}\n className=\"max-w-[140px]\"\n />\n </div>\n )}\n\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <label className=\"text-sm font-medium flex items-center gap-1.5\">\n <Boxes className=\"h-4 w-4\" />\n Collection *\n </label>\n <div className=\"flex rounded-lg border border-border overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setCollectionMode(\"existing\")}\n className={cn(\"px-3 h-7 text-xs font-medium transition-colors\",\n collectionMode === \"existing\" ? \"bg-primary text-primary-foreground\" : \"bg-background hover:bg-muted text-muted-foreground\")}\n >\n Existing\n </button>\n <button\n type=\"button\"\n onClick={() => setCollectionMode(\"new\")}\n className={cn(\"px-3 h-7 text-xs font-medium border-l border-border transition-colors flex items-center gap-1\",\n collectionMode === \"new\" ? \"bg-primary text-primary-foreground\" : \"bg-background hover:bg-muted text-muted-foreground\")}\n >\n <Plus className=\"h-3 w-3\" />New\n </button>\n </div>\n </div>\n\n {collectionMode === \"existing\" ? (\n <CollectionPicker\n collections={assetType === \"single\" ? erc721Collections : erc1155Collections}\n value={assetType === \"single\" ? existingCollectionId : existingCollectionContract}\n onChange={assetType === \"single\" ? setExistingCollectionId : setExistingCollectionContract}\n />\n ) : (\n <div className=\"flex gap-3 rounded-xl border border-border p-3\">\n <div className=\"relative h-16 w-16 rounded-lg overflow-hidden bg-muted shrink-0\">\n {(mediaKind === \"image\" ? mediaPreview : featurePreview) ? (\n <Image\n src={(mediaKind === \"image\" ? mediaPreview : featurePreview)!}\n alt=\"\"\n fill\n className=\"object-cover\"\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-5 w-5 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-2\">\n <div className=\"grid grid-cols-[1fr_100px] gap-2\">\n <Input\n value={newCollectionName}\n onChange={(e) => setNewCollectionName(e.target.value)}\n placeholder=\"Collection name\"\n className=\"h-9 text-sm\"\n />\n <Input\n value={newCollectionSymbol}\n onChange={(e) => setNewCollectionSymbol(e.target.value.toUpperCase())}\n placeholder=\"SYMBOL\"\n className=\"h-9 text-sm\"\n />\n </div>\n <Textarea\n value={newCollectionDescription}\n onChange={(e) => setNewCollectionDescription(e.target.value)}\n placeholder=\"Describe this collection…\"\n rows={2}\n className=\"text-sm resize-none\"\n />\n <p className=\"text-2xs text-muted-foreground\">Prefilled from your asset — edit anything above.</p>\n </div>\n </div>\n )}\n </div>\n\n <Collapsible open={advancedOpen} onOpenChange={setAdvancedOpen}>\n <div className=\"rounded-xl border border-border overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <ShieldCheck className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">Licensing Terms</span>\n <span className=\"text-xs text-muted-foreground font-normal\">Optional · Berne Convention</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", advancedOpen && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">License</label>\n <Select value={form.watch(\"licenseType\")} onValueChange={handleLicenseChange}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {LICENSE_TYPES.map((l) => <SelectItem key={l.value} value={l.value}>{l.label}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Commercial use</label>\n <ToggleGroup value={form.watch(\"commercialUse\")} options={[\"Yes\", \"No\"]} onChange={(v) => form.setValue(\"commercialUse\", v as \"Yes\" | \"No\")} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Derivatives</label>\n <ToggleGroup value={form.watch(\"derivatives\")} options={DERIVATIVES_OPTIONS} onChange={(v) => form.setValue(\"derivatives\", v as FormValues[\"derivatives\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Territory</label>\n <Select value={form.watch(\"geographicScope\")} onValueChange={(v) => form.setValue(\"geographicScope\", v)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {GEOGRAPHIC_SCOPES.map((s) => <SelectItem key={s} value={s}>{s}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">AI & data mining</label>\n <ToggleGroup value={form.watch(\"aiPolicy\")} options={AI_POLICIES} onChange={(v) => form.setValue(\"aiPolicy\", v as FormValues[\"aiPolicy\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Royalty % (0–50)</label>\n <Input\n type=\"number\" min={0} max={50} step={0.5}\n value={form.watch(\"royalty\")}\n onChange={(e) => form.setValue(\"royalty\", parseFloat(e.target.value) || 0)}\n className=\"max-w-[120px]\"\n />\n </div>\n </div>\n </CollapsibleContent>\n </div>\n </Collapsible>\n\n <Collapsible open={ipTypeOpen} onOpenChange={setIpTypeOpen}>\n <div className=\"rounded-xl border border-border overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <Layers className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">IP Type & Metadata</span>\n <span className=\"text-xs text-muted-foreground font-normal\">Optional</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", ipTypeOpen && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">IP Type</label>\n <Select value={ipType} onValueChange={(v) => setIpType(v as IPType)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {IP_TYPES.map((t) => <SelectItem key={t} value={t}>{t}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <IPTypeFields\n ipType={ipType}\n onChange={(fields) => { templateFieldsRef.current = fields; }}\n uploadDocument={async (file) => {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, \"document\");\n return uri;\n }}\n existingDocument={mediaKind === \"document\" && mediaUri && mediaFile ? { uri: mediaUri, name: mediaFile.name } : null}\n />\n </div>\n </CollapsibleContent>\n </div>\n </Collapsible>\n\n {status === \"error\" && errorMsg && <p className=\"text-xs text-destructive\">{errorMsg}</p>}\n\n <button\n type=\"button\"\n disabled={!ready || busy || !hasWallet}\n onClick={form.handleSubmit(onSubmit)}\n className={cn(\n \"w-full h-12 text-base font-semibold text-white rounded-xl flex items-center justify-center gap-2 transition-all hover:brightness-110 active:scale-[0.98] bg-brand-blue\",\n (!ready || busy || !hasWallet) && \"opacity-40 pointer-events-none\"\n )}\n >\n {busy ? <><Loader2 className=\"h-4 w-4 animate-spin\" />Minting…</> : assetType === \"single\" ? \"Mint NFT\" : \"Mint Editions\"}\n </button>\n <p className=\"text-xs text-center text-muted-foreground\">\n Zero platform fees to mint.\n </p>\n </div>\n\n <div className=\"order-first lg:order-last lg:sticky lg:top-20 max-w-[260px] mx-auto w-full lg:max-w-none lg:mx-0\">\n <MedialaneCollectionCard\n image={mediaKind === \"image\" ? mediaPreview : featurePreview}\n name={name}\n collection={collectionLabel}\n creator={walletAddress ? `${walletAddress.slice(0, 6)}…${walletAddress.slice(-4)}` : undefined}\n creatorHref={walletAddress ? `/account/${walletAddress}` : undefined}\n />\n </div>\n </div>\n )}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0GQ;AAxGR,mBAA4C;AAC5C,mBAAkB;AAClB,6BAAwB;AACxB,sBAAqB;AACrB,iBAAqF;AACr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OAAE,WAAU,4BAA4B,oBAAS;AAAA,UAErF;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU,CAAC,SAAS,QAAQ,CAAC;AAAA,cAC7B,SAAS,KAAK,aAAa,QAAQ;AAAA,cACnC,eAAW;AAAA,gBACT;AAAA,iBACC,CAAC,SAAS,QAAQ,CAAC,cAAc;AAAA,cACpC;AAAA,cAEC,iBAAO,4EAAE;AAAA,4DAAC,+BAAQ,WAAU,wBAAuB;AAAA,gBAAE;AAAA,iBAAQ,IAAM,cAAc,WAAW,aAAa;AAAA;AAAA,UAC5G;AAAA,UACA,4CAAC,OAAE,WAAU,6CAA4C,yCAEzD;AAAA,WACF;AAAA,QAEA,4CAAC,SAAI,WAAU,oGACb;AAAA,UAAC;AAAA;AAAA,YACC,OAAO,cAAc,UAAU,eAAe;AAAA,YAC9C;AAAA,YACA,YAAY;AAAA,YACZ,SAAS,gBAAgB,GAAG,cAAc,MAAM,GAAG,CAAC,CAAC,SAAI,cAAc,MAAM,EAAE,CAAC,KAAK;AAAA,YACrF,aAAa,gBAAgB,YAAY,aAAa,KAAK;AAAA;AAAA,QAC7D,GACF;AAAA,SACF;AAAA,OAEJ;AAAA,EACF;AACF;","names":["import_starknet","Image","name","intentRes","SingleIcon"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/fast-mint.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport Image from \"next/image\";\nimport { useForm } from \"react-hook-form\";\nimport { hash } from \"starknet\";\nimport { normalizeAddress, buildAssetMetadata, type ApiCollection } from \"@medialane/sdk\";\nimport { executeIntent } from \"@medialane/sdk/starknet\";\nimport { mintableCollections, collectionKey } from \"./mintable-collections.js\";\nimport {\n ImagePlus, Music, Video, FileText, Loader2,\n Layers, ImagePlus as SingleIcon, ChevronDown, Boxes, Plus, Check,\n ShieldCheck, X,\n} from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { Textarea } from \"../textarea.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover.js\";\nimport { MedialaneCollectionCard } from \"../medialane-collection-card.js\";\nimport { ActionDialog } from \"../action-dialog.js\";\nimport { IPTypeFields, type MetadataField } from \"../ip-type-fields.js\";\nimport {\n IP_TYPES, LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES, DERIVATIVES_OPTIONS,\n type IPType,\n} from \"../../data/ip.js\";\nimport { IP_TEMPLATES } from \"../../data/ip-templates.js\";\nimport { suggestLaunchpadSymbol } from \"../../utils/launchpad-defaults.js\";\nimport { uploadFileToIpfs, uploadJsonToIpfs, uploadFailureToast } from \"../../utils/ipfs-upload.js\";\nimport { ipfsToHttp } from \"../../utils/ipfs.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { Dropzone } from \"./dropzone.js\";\nimport { SuccessView } from \"./success-view.js\";\nimport type { FastMintProps, FastMintSigner, MediaKind, MintedAsset } from \"./types.js\";\n\nconst COLLECTION_DEPLOYED_SELECTOR = hash.getSelectorFromName(\"CollectionDeployed\");\nconst IP_MINTED_SELECTOR = hash.getSelectorFromName(\"IPMinted\");\n\nasync function readMintedTokenId(\n provider: { getTransactionReceipt(txHash: string): Promise<unknown> },\n txHash: string,\n contractAddress: string,\n): Promise<string | null> {\n let receipt: { events?: { from_address?: string; keys?: string[] }[] } | null = null;\n for (let attempt = 0; attempt < 3 && !receipt; attempt++) {\n try {\n if (attempt > 0) await new Promise((r) => setTimeout(r, 2000));\n const raw = await provider.getTransactionReceipt(txHash);\n receipt = raw as { events?: { from_address?: string; keys?: string[] }[] };\n } catch { /* retry */ }\n }\n const events = receipt?.events ?? [];\n const mintEvent = events.find((e) =>\n e.from_address && BigInt(e.from_address) === BigInt(contractAddress) &&\n e.keys?.[0] && BigInt(e.keys[0]) === BigInt(IP_MINTED_SELECTOR)\n );\n if (!mintEvent?.keys?.[1]) return null;\n const low = BigInt(mintEvent.keys[1] ?? 0);\n const high = BigInt(mintEvent.keys[2] ?? 0);\n return (low + (high << 128n)).toString();\n}\n\nconst MEDIA_ROUTE_MIME_TYPES = new Set([\n \"image/jpeg\", \"image/png\", \"image/gif\", \"image/webp\", \"image/svg+xml\", \"image/avif\",\n \"video/mp4\", \"video/webm\", \"video/ogg\",\n \"audio/mpeg\", \"audio/ogg\", \"audio/wav\", \"audio/webm\", \"audio/flac\",\n \"application/pdf\",\n]);\nconst DOCUMENT_SIGNED_URL_MIME_TYPES = new Set([\n \"application/msword\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"application/vnd.oasis.opendocument.text\",\n \"application/rtf\",\n \"text/plain\",\n \"text/markdown\",\n]);\nconst MEDIA_MAX_BYTES = 100 * 1024 * 1024;\nconst DOCUMENT_MAX_BYTES = 20 * 1024 * 1024;\n\nfunction detectMediaKind(mime: string): MediaKind | null {\n if (mime.startsWith(\"image/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"image\" : null;\n if (mime.startsWith(\"video/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"video\" : null;\n if (mime.startsWith(\"audio/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"audio\" : null;\n if (mime === \"application/pdf\" || DOCUMENT_SIGNED_URL_MIME_TYPES.has(mime)) return \"document\";\n return null;\n}\n\nconst IP_TYPE_BY_KIND: Record<MediaKind, IPType> = {\n image: \"NFT\",\n audio: \"Audio\",\n video: \"Video\",\n document: \"Documents\",\n};\n\nconst MEDIA_KIND_ICON: Record<MediaKind, typeof ImagePlus> = {\n image: ImagePlus,\n audio: Music,\n video: Video,\n document: FileText,\n};\n\nfunction ToggleGroup({\n value, options, onChange,\n}: { value: string; options: readonly string[]; onChange: (v: string) => void }) {\n return (\n <div className=\"flex rounded-lg border border-border overflow-hidden w-full\">\n {options.map((opt, i) => (\n <button\n key={opt}\n type=\"button\"\n onClick={() => onChange(opt)}\n className={cn(\n \"flex-1 px-3 py-2 text-sm transition-colors\",\n i > 0 && \"border-l border-border\",\n value === opt ? \"bg-primary text-primary-foreground font-medium\" : \"bg-background hover:bg-muted text-muted-foreground\"\n )}\n >\n {opt}\n </button>\n ))}\n </div>\n );\n}\n\nfunction collectionDisplayLabel(col: ApiCollection) {\n return col.name || col.symbol || `Collection #${col.collectionId}`;\n}\n\nfunction CollectionThumb({ image }: { image: string | null | undefined }) {\n const imageUrl = image ? ipfsToHttp(image) : null;\n return (\n <div className=\"relative h-10 w-10 rounded-lg overflow-hidden bg-muted shrink-0\">\n {imageUrl ? (\n <Image src={imageUrl} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-4 w-4 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n );\n}\n\nfunction CollectionPicker({\n collections, value, onChange, valueOf,\n}: {\n collections: ApiCollection[];\n value: string;\n onChange: (id: string) => void;\n // Which field identifies a collection here. Single editions are keyed by\n // collectionId; limited editions by contract address, because ERC1155\n // collections have no collectionId at all. Hardcoding collectionId meant the\n // picker handed back null for every ERC1155 row, which read as \"nothing\n // chosen\" to the submit gate while still rendering as chosen.\n valueOf: (c: ApiCollection) => string | null | undefined;\n}) {\n const [open, setOpen] = useState(false);\n const selected = value\n ? collections.find((c) => valueOf(c) === value) ?? null\n : null;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-expanded={open}\n className=\"flex w-full items-center gap-3 rounded-xl border border-border p-3 text-left transition-colors hover:bg-muted/40\"\n >\n <CollectionThumb image={selected?.image} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold truncate\">\n {selected ? collectionDisplayLabel(selected) : collections.length ? \"Choose a collection\" : \"No collections yet\"}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {selected ? `${selected.totalSupply ?? 0} work${selected.totalSupply === 1 ? \"\" : \"s\"}` : \"Where this work will live\"}\n </p>\n </div>\n <ChevronDown className=\"h-3.5 w-3.5 text-muted-foreground shrink-0\" />\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[var(--radix-popover-trigger-width)] p-0\" align=\"start\">\n <div className=\"max-h-64 overflow-y-auto p-1\">\n {collections.length === 0 ? (\n <p className=\"px-3 py-4 text-center text-sm text-muted-foreground\">No collections yet — create one instead.</p>\n ) : (\n collections.map((col) => {\n const id = valueOf(col);\n const isSelected = !!id && value === id;\n return (\n <button\n key={id ?? col.contractAddress ?? col.name}\n type=\"button\"\n disabled={!id}\n onClick={() => { if (!id) return; onChange(id); setOpen(false); }}\n className=\"flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60\"\n >\n <CollectionThumb image={col.image} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium truncate\">{collectionDisplayLabel(col)}</p>\n <p className=\"text-xs text-muted-foreground\">{col.totalSupply ?? 0} work{col.totalSupply === 1 ? \"\" : \"s\"}</p>\n </div>\n {isSelected && <Check className=\"h-4 w-4 text-brand-blue shrink-0\" />}\n </button>\n );\n })\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\ninterface FormValues {\n name: string;\n description: string;\n external_url: string;\n licenseType: string;\n commercialUse: \"Yes\" | \"No\";\n derivatives: \"Allowed\" | \"Not Allowed\" | \"Share-Alike\";\n attribution: \"Required\" | \"Not Required\";\n geographicScope: string;\n aiPolicy: \"Allowed\" | \"Not Allowed\" | \"Training Only\";\n royalty: number;\n}\n\nexport function FastMint(props: FastMintProps) {\n const {\n presentation = \"inline\", open = true, onClose, mediaKindLock, onMinted,\n collections, refetchCollections,\n hasWallet, walletAddress, onRequireWallet, connectLabel, getUploadToken, getSigner,\n client, provider,\n } = props;\n\n const [status, setStatus] = useState<\"idle\" | \"minting\" | \"success\" | \"error\">(\"idle\");\n const [errorMsg, setErrorMsg] = useState<string | null>(null);\n\n const [mediaFile, setMediaFile] = useState<File | null>(null);\n const [mediaPreview, setMediaPreview] = useState<string | null>(null);\n const [mediaUri, setMediaUri] = useState<string | null>(null);\n const [mediaKind, setMediaKind] = useState<MediaKind>(\"image\");\n const [mediaUploading, setMediaUploading] = useState(false);\n const previewUrlRef = useRef<string | null>(null);\n const mediaInputRef = useRef<HTMLInputElement>(null);\n\n const [featurePreview, setFeaturePreview] = useState<string | null>(null);\n const [featureUri, setFeatureUri] = useState<string | null>(null);\n const [featureUploading, setFeatureUploading] = useState(false);\n const featurePreviewRef = useRef<string | null>(null);\n const featureInputRef = useRef<HTMLInputElement>(null);\n\n const [assetType, setAssetType] = useState<\"single\" | \"editions\">(\"single\");\n const [editionCount, setEditionCount] = useState(\"10\");\n\n const [collectionMode, setCollectionMode] = useState<\"existing\" | \"new\">(\"existing\");\n const [existingCollectionId, setExistingCollectionId] = useState(\"\");\n const [existingCollectionContract, setExistingCollectionContract] = useState(\"\");\n const [newCollectionName, setNewCollectionName] = useState(\"\");\n const [newCollectionSymbol, setNewCollectionSymbol] = useState(\"\");\n const [newCollectionDescription, setNewCollectionDescription] = useState(\"\");\n const [autoSymbol, setAutoSymbol] = useState(\"\");\n const [autoCollectionName, setAutoCollectionName] = useState(\"\");\n const [autoCollectionDescription, setAutoCollectionDescription] = useState(\"\");\n\n const [ipType, setIpType] = useState<IPType>(\"NFT\");\n const [advancedOpen, setAdvancedOpen] = useState(false);\n const [ipTypeOpen, setIpTypeOpen] = useState(false);\n const templateFieldsRef = useRef<MetadataField[]>([]);\n\n const [mintedAsset, setMintedAsset] = useState<MintedAsset | null>(null);\n\n useEffect(() => () => {\n if (previewUrlRef.current) URL.revokeObjectURL(previewUrlRef.current);\n if (featurePreviewRef.current) URL.revokeObjectURL(featurePreviewRef.current);\n }, []);\n\n const form = useForm<FormValues>({\n defaultValues: {\n name: \"\", description: \"\", external_url: \"\",\n licenseType: \"CC BY-SA\", commercialUse: \"Yes\", derivatives: \"Share-Alike\",\n attribution: \"Required\", geographicScope: \"Worldwide\", aiPolicy: \"Not Allowed\", royalty: 0,\n },\n });\n const name = form.watch(\"name\");\n\n useEffect(() => {\n if (walletAddress && !form.getValues(\"external_url\")) {\n form.setValue(\"external_url\", `https://medialane.io/account/${walletAddress}`);\n }\n }, [walletAddress, form]);\n\n useEffect(() => {\n const s = suggestLaunchpadSymbol(name);\n if (!s) return;\n if (!newCollectionSymbol || newCollectionSymbol === autoSymbol) {\n setNewCollectionSymbol(s);\n setAutoSymbol(s);\n }\n if (!newCollectionName || newCollectionName === autoCollectionName) {\n setNewCollectionName(name);\n setAutoCollectionName(name);\n }\n }, [name, autoSymbol, autoCollectionName, newCollectionSymbol, newCollectionName]);\n\n const description = form.watch(\"description\");\n useEffect(() => {\n if (!newCollectionDescription || newCollectionDescription === autoCollectionDescription) {\n setNewCollectionDescription(description);\n setAutoCollectionDescription(description);\n }\n }, [description, autoCollectionDescription, newCollectionDescription]);\n\n const erc721Collections = mintableCollections(\"single\", collections);\n const erc1155Collections = mintableCollections(\"editions\", collections);\n\n const handleMediaSelect = async (file: File) => {\n const kind = detectMediaKind(file.type);\n if (!kind) {\n setErrorMsg(\"Publish an image, audio, video (JPG/PNG/GIF/SVG/WebP, MP3/WAV/OGG/FLAC, MP4/WebM), or document (PDF, DOC, DOCX, ODT, RTF, TXT, MD).\");\n return;\n }\n if (mediaKindLock && kind !== mediaKindLock) {\n setErrorMsg(`Please upload a${mediaKindLock === \"image\" ? \"n\" : \"\"} ${mediaKindLock}.`);\n return;\n }\n const viaMediaRoute = MEDIA_ROUTE_MIME_TYPES.has(file.type);\n const maxBytes = viaMediaRoute ? MEDIA_MAX_BYTES : DOCUMENT_MAX_BYTES;\n if (file.size > maxBytes) {\n setErrorMsg(`Maximum size is ${maxBytes / (1024 * 1024)} MB.`);\n return;\n }\n setMediaFile(file);\n setMediaKind(kind);\n setIpType(IP_TYPE_BY_KIND[kind]);\n if (previewUrlRef.current) URL.revokeObjectURL(previewUrlRef.current);\n const objectUrl = URL.createObjectURL(file);\n previewUrlRef.current = objectUrl;\n setMediaPreview(objectUrl);\n setMediaUri(null);\n setMediaUploading(true);\n try {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, viaMediaRoute ? \"media\" : \"document\");\n setMediaUri(uri);\n } catch (err) {\n const t = uploadFailureToast(err);\n setErrorMsg(t.description ?? t.title);\n } finally {\n setMediaUploading(false);\n }\n };\n\n const clearMedia = () => {\n setMediaFile(null);\n setMediaPreview(null);\n setMediaUri(null);\n if (mediaInputRef.current) mediaInputRef.current.value = \"\";\n };\n\n const handleFeatureSelect = async (file: File) => {\n if (featurePreviewRef.current) URL.revokeObjectURL(featurePreviewRef.current);\n const objectUrl = URL.createObjectURL(file);\n featurePreviewRef.current = objectUrl;\n setFeaturePreview(objectUrl);\n setFeatureUri(null);\n setFeatureUploading(true);\n try {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, \"image\");\n setFeatureUri(uri);\n } catch (err) {\n const t = uploadFailureToast(err);\n setErrorMsg(t.description ?? t.title);\n } finally {\n setFeatureUploading(false);\n }\n };\n\n const handleLicenseChange = (value: string) => {\n form.setValue(\"licenseType\", value);\n const def = LICENSE_TYPES.find((l) => l.value === value);\n if (def) {\n form.setValue(\"commercialUse\", def.commercialUse);\n form.setValue(\"derivatives\", def.derivatives);\n form.setValue(\"attribution\", def.attribution);\n }\n };\n\n const ready = !!mediaUri && !mediaUploading && name.trim().length > 0 &&\n (mediaKind === \"image\" || !!featureUri) &&\n (collectionMode === \"existing\"\n ? assetType === \"single\" ? !!existingCollectionId : !!existingCollectionContract\n : newCollectionName.trim().length > 0 && newCollectionSymbol.trim().length > 0);\n\n async function pollForNewCollection(name: string, symbol: string): Promise<ApiCollection | null> {\n for (let attempt = 0; attempt < 8; attempt++) {\n const list = await refetchCollections();\n const match = list.find((c) => c.name === name && c.symbol === symbol);\n if (match?.collectionId) return match;\n await new Promise((r) => setTimeout(r, 1500));\n }\n return null;\n }\n\n const onSubmit = async (values: FormValues) => {\n if (!hasWallet) { onRequireWallet(); return; }\n if (!walletAddress || !mediaUri) return;\n if (values.external_url && !values.external_url.startsWith(\"http://\") && !values.external_url.startsWith(\"https://\")) {\n setErrorMsg(\"External link must start with http:// or https://\");\n return;\n }\n\n setStatus(\"minting\");\n setErrorMsg(null);\n\n try {\n const signer: FastMintSigner = await getSigner();\n\n const image = mediaKind === \"image\" ? mediaUri : featureUri!;\n const animationUrl = mediaKind === \"image\" ? undefined : mediaUri;\n\n const built = buildAssetMetadata({\n name: values.name,\n description: values.description || \"\",\n externalUrl: values.external_url || \"\",\n imageUri: image,\n creator: walletAddress,\n ipType,\n licenseType: values.licenseType,\n commercialUse: values.commercialUse,\n derivatives: values.derivatives,\n attribution: values.attribution,\n geographicScope: values.geographicScope,\n aiPolicy: values.aiPolicy,\n royalty: String(values.royalty),\n templateTraits: templateFieldsRef.current\n .filter(({ traitType, value }) => traitType.trim() && value.trim())\n .map(({ traitType, value }) => ({ traitType, value })),\n });\n const metadata: Record<string, unknown> = { ...built };\n if (animationUrl) metadata.animation_url = animationUrl;\n\n const uploadToken = await getUploadToken();\n if (!uploadToken) throw new Error(\"Sign in first\");\n const tokenUri = await uploadJsonToIpfs(metadata, uploadToken);\n\n let result: { txHash: string };\n let finalContractAddress: string | null;\n let finalTokenId: string | null = null;\n\n if (assetType === \"single\") {\n let collectionId = existingCollectionId;\n let contractAddress = erc721Collections.find((c) => c.collectionId === existingCollectionId)?.contractAddress ?? null;\n\n if (collectionMode === \"new\") {\n const intentRes = await client.api.createCollectionIntent({\n owner: walletAddress,\n name: newCollectionName,\n symbol: newCollectionSymbol,\n description: newCollectionDescription || undefined,\n image,\n });\n await executeIntent(provider, signer, client, intentRes.data);\n\n const found = await pollForNewCollection(newCollectionName, newCollectionSymbol);\n if (!found) throw new Error(\"Collection created, but it's still indexing — try minting again in a moment from My Collections.\");\n collectionId = found.collectionId!;\n contractAddress = found.contractAddress ?? null;\n }\n\n const intentRes = await client.api.createMintIntent({\n owner: walletAddress,\n collectionId,\n recipient: walletAddress,\n tokenUri,\n royaltyBps: Math.round(values.royalty * 100),\n });\n if (!intentRes.data.requiresSignature) {\n const calls = intentRes.data.calls;\n contractAddress = calls[calls.length - 1]?.contractAddress ?? contractAddress;\n }\n result = await executeIntent(provider, signer, client, intentRes.data);\n finalContractAddress = contractAddress;\n\n if (finalContractAddress) {\n finalTokenId = await readMintedTokenId(provider, result.txHash, finalContractAddress);\n }\n } else {\n let collectionContract = existingCollectionContract;\n\n if (collectionMode === \"new\") {\n const intentRes = await client.api.createCollectionIntent({\n owner: walletAddress,\n name: newCollectionName,\n symbol: newCollectionSymbol,\n description: newCollectionDescription || undefined,\n image,\n baseUri: \"\",\n service: \"mip-erc1155\",\n });\n const deployResult = await executeIntent(provider, signer, client, intentRes.data);\n\n let receipt: { events?: { keys?: string[] }[] } | null = null;\n for (let attempt = 0; attempt < 3 && !receipt; attempt++) {\n try {\n if (attempt > 0) await new Promise((r) => setTimeout(r, 2000));\n const raw = await provider.getTransactionReceipt(deployResult.txHash);\n receipt = raw as { events?: { keys?: string[] }[] };\n } catch { /* retry */ }\n }\n const events = receipt?.events ?? [];\n const deployEvent = events.find((e) =>\n e.keys?.[0] && BigInt(e.keys[0]) === BigInt(COLLECTION_DEPLOYED_SELECTOR)\n );\n if (!deployEvent?.keys?.[1]) throw new Error(\"Collection deployed, but its address couldn't be read — check My Collections to mint into it.\");\n collectionContract = normalizeAddress(\"STARKNET\", deployEvent.keys[1]);\n }\n\n const intentRes = await client.api.createMintIntent({\n owner: walletAddress,\n recipient: walletAddress,\n collectionContract,\n tokenUri,\n value: editionCount,\n royaltyBps: Math.round(values.royalty * 100),\n });\n result = await executeIntent(provider, signer, client, intentRes.data);\n finalContractAddress = collectionContract;\n finalTokenId = await readMintedTokenId(provider, result.txHash, collectionContract);\n }\n\n if (finalContractAddress && finalTokenId) {\n const asset: MintedAsset = { contract: finalContractAddress, tokenId: finalTokenId, image };\n setMintedAsset(asset);\n onMinted?.(asset);\n }\n setStatus(\"success\");\n } catch (err) {\n setErrorMsg(err instanceof Error ? err.message : \"Something went wrong. Please try again.\");\n setStatus(\"error\");\n }\n };\n\n const resetAll = () => {\n setStatus(\"idle\");\n setErrorMsg(null);\n setMintedAsset(null);\n form.reset();\n clearMedia();\n setFeaturePreview(null);\n setFeatureUri(null);\n setAssetType(\"single\");\n setEditionCount(\"10\");\n setCollectionMode(\"existing\");\n setExistingCollectionId(\"\");\n setExistingCollectionContract(\"\");\n setNewCollectionName(\"\");\n setNewCollectionSymbol(\"\");\n setNewCollectionDescription(\"\");\n setAutoSymbol(\"\");\n setAutoCollectionName(\"\");\n setAutoCollectionDescription(\"\");\n templateFieldsRef.current = [];\n };\n\n const busy = status === \"minting\";\n const KindIcon = MEDIA_KIND_ICON[mediaKind];\n const selectedExistingCollection = assetType === \"single\"\n ? erc721Collections.find((c) => c.collectionId === existingCollectionId)\n : erc1155Collections.find((c) => c.contractAddress === existingCollectionContract);\n const collectionLabel = mediaUri\n ? (collectionMode === \"new\"\n ? (newCollectionName || \"New collection\")\n : (selectedExistingCollection?.name || \"IP Asset\"))\n : undefined;\n\n const wrap = (node: React.ReactNode) => {\n if (presentation !== \"dialog\") return node;\n return (\n <ActionDialog open={open} onClose={onClose ?? (() => {})} width={640}>\n <div className=\"relative p-6 sm:p-8\">\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close\"\n className=\"absolute top-4 right-4 h-8 w-8 rounded-full hover:bg-muted flex items-center justify-center text-muted-foreground\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n {node}\n </div>\n </ActionDialog>\n );\n };\n\n if (status === \"success\") {\n return wrap(\n <SuccessView\n presentation={presentation}\n previewImage={mediaKind === \"image\" ? mediaPreview : featurePreview}\n name={name}\n collectionLabel={collectionLabel}\n mintedAsset={mintedAsset}\n onPublishAnother={resetAll}\n />\n );\n }\n\n if (!mediaFile) {\n return wrap(\n <Dropzone\n mediaKindLock={mediaKindLock}\n presentation={presentation}\n hasWallet={hasWallet}\n onRequireWallet={onRequireWallet}\n connectLabel={connectLabel}\n onFileSelected={handleMediaSelect}\n />\n );\n }\n\n return wrap(\n <section className=\"space-y-6\">\n <div className=\"flex items-center gap-4 rounded-xl border border-border p-3\">\n <div className=\"relative h-14 w-14 rounded-lg bg-muted overflow-hidden shrink-0\">\n {mediaKind === \"image\" && mediaPreview ? (\n <Image src={mediaPreview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <KindIcon className=\"h-6 w-6 text-muted-foreground\" />\n </div>\n )}\n {mediaUploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-1\">\n <p className=\"text-sm font-semibold truncate\">{mediaFile.name}</p>\n <div className=\"flex items-center gap-2 flex-wrap\">\n <p className=\"text-xs text-muted-foreground\">\n {mediaUploading ? \"Uploading…\" : mediaUri ? \"Uploaded\" : \"Upload failed\"}\n </p>\n {mediaUri && (() => {\n const template = IP_TEMPLATES[ipType];\n const TemplateIcon = template.icon;\n return (\n <span\n className={cn(\n \"inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs font-medium\",\n template.color.bg, template.color.text, template.color.border\n )}\n >\n <TemplateIcon className=\"h-3 w-3\" />\n {template.label}\n </span>\n );\n })()}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => mediaInputRef.current?.click()}\n className=\"text-xs font-semibold text-brand-blue hover:underline shrink-0\"\n >\n Change\n </button>\n <input ref={mediaInputRef} type=\"file\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) handleMediaSelect(f); }} />\n </div>\n\n {mediaUri && (\n <div className=\"grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-8 items-start\">\n <div className=\"space-y-5\">\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Title *</label>\n <Input\n value={name}\n onChange={(e) => form.setValue(\"name\", e.target.value)}\n placeholder=\"My Creative Work\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Description</label>\n <Textarea\n value={form.watch(\"description\")}\n onChange={(e) => form.setValue(\"description\", e.target.value)}\n placeholder=\"Describe your work, its story, and any context for buyers…\"\n rows={3}\n />\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">External link <span className=\"text-muted-foreground font-normal\">(optional)</span></label>\n <Input\n value={form.watch(\"external_url\")}\n onChange={(e) => form.setValue(\"external_url\", e.target.value)}\n placeholder=\"https://yourwebsite.com\"\n />\n </div>\n\n {mediaKind !== \"image\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Upload a cover image for your asset *</label>\n <div className=\"flex items-center gap-4\">\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => !featureUploading && featureInputRef.current?.click()}\n onKeyDown={(e) => { if ((e.key === \"Enter\" || e.key === \" \") && !featureUploading) { e.preventDefault(); featureInputRef.current?.click(); } }}\n className=\"relative h-20 w-20 rounded-xl border-2 border-dashed border-border bg-muted flex items-center justify-center overflow-hidden shrink-0 cursor-pointer hover:border-primary/50 transition-colors\"\n >\n {featurePreview ? (\n <Image src={featurePreview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <ImagePlus className=\"h-6 w-6 text-muted-foreground\" />\n )}\n {featureUploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n <input ref={featureInputRef} type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) handleFeatureSelect(f); }} />\n </div>\n <p className=\"text-xs text-muted-foreground\">Cover art shown wherever the work is previewed. JPG, PNG, GIF, SVG or WebP.</p>\n </div>\n </div>\n )}\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Asset Type</label>\n <div className=\"grid grid-cols-2 gap-3\">\n <button\n type=\"button\"\n onClick={() => setAssetType(\"single\")}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n assetType === \"single\" ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <SingleIcon className={cn(\"h-5 w-5 shrink-0 mt-0.5\", assetType === \"single\" ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">Single Edition NFT</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">Minted once</span>\n </span>\n </button>\n <button\n type=\"button\"\n onClick={() => setAssetType(\"editions\")}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n assetType === \"editions\" ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <Layers className={cn(\"h-5 w-5 shrink-0 mt-0.5\", assetType === \"editions\" ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">Limited Editions NFT</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">Several numbered copies</span>\n </span>\n </button>\n </div>\n </div>\n\n {assetType === \"editions\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Number of copies</label>\n <Input\n type=\"number\"\n min={1}\n value={editionCount}\n onChange={(e) => setEditionCount(e.target.value)}\n className=\"max-w-[140px]\"\n />\n </div>\n )}\n\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <label className=\"text-sm font-medium flex items-center gap-1.5\">\n <Boxes className=\"h-4 w-4\" />\n Collection *\n </label>\n <div className=\"flex rounded-lg border border-border overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setCollectionMode(\"existing\")}\n className={cn(\"px-3 h-7 text-xs font-medium transition-colors\",\n collectionMode === \"existing\" ? \"bg-primary text-primary-foreground\" : \"bg-background hover:bg-muted text-muted-foreground\")}\n >\n Existing\n </button>\n <button\n type=\"button\"\n onClick={() => setCollectionMode(\"new\")}\n className={cn(\"px-3 h-7 text-xs font-medium border-l border-border transition-colors flex items-center gap-1\",\n collectionMode === \"new\" ? \"bg-primary text-primary-foreground\" : \"bg-background hover:bg-muted text-muted-foreground\")}\n >\n <Plus className=\"h-3 w-3\" />New\n </button>\n </div>\n </div>\n\n {collectionMode === \"existing\" ? (\n <CollectionPicker\n collections={assetType === \"single\" ? erc721Collections : erc1155Collections}\n value={assetType === \"single\" ? existingCollectionId : existingCollectionContract}\n onChange={assetType === \"single\" ? setExistingCollectionId : setExistingCollectionContract}\n valueOf={collectionKey(assetType === \"single\" ? \"single\" : \"editions\")}\n />\n ) : (\n <div className=\"flex gap-3 rounded-xl border border-border p-3\">\n <div className=\"relative h-16 w-16 rounded-lg overflow-hidden bg-muted shrink-0\">\n {(mediaKind === \"image\" ? mediaPreview : featurePreview) ? (\n <Image\n src={(mediaKind === \"image\" ? mediaPreview : featurePreview)!}\n alt=\"\"\n fill\n className=\"object-cover\"\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-5 w-5 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-2\">\n <div className=\"grid grid-cols-[1fr_100px] gap-2\">\n <Input\n value={newCollectionName}\n onChange={(e) => setNewCollectionName(e.target.value)}\n placeholder=\"Collection name\"\n className=\"h-9 text-sm\"\n />\n <Input\n value={newCollectionSymbol}\n onChange={(e) => setNewCollectionSymbol(e.target.value.toUpperCase())}\n placeholder=\"SYMBOL\"\n className=\"h-9 text-sm\"\n />\n </div>\n <Textarea\n value={newCollectionDescription}\n onChange={(e) => setNewCollectionDescription(e.target.value)}\n placeholder=\"Describe this collection…\"\n rows={2}\n className=\"text-sm resize-none\"\n />\n <p className=\"text-2xs text-muted-foreground\">Prefilled from your asset — edit anything above.</p>\n </div>\n </div>\n )}\n </div>\n\n <Collapsible open={advancedOpen} onOpenChange={setAdvancedOpen}>\n <div className=\"rounded-xl border border-border overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <ShieldCheck className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">Licensing Terms</span>\n <span className=\"text-xs text-muted-foreground font-normal\">Optional · Berne Convention</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", advancedOpen && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">License</label>\n <Select value={form.watch(\"licenseType\")} onValueChange={handleLicenseChange}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {LICENSE_TYPES.map((l) => <SelectItem key={l.value} value={l.value}>{l.label}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Commercial use</label>\n <ToggleGroup value={form.watch(\"commercialUse\")} options={[\"Yes\", \"No\"]} onChange={(v) => form.setValue(\"commercialUse\", v as \"Yes\" | \"No\")} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Derivatives</label>\n <ToggleGroup value={form.watch(\"derivatives\")} options={DERIVATIVES_OPTIONS} onChange={(v) => form.setValue(\"derivatives\", v as FormValues[\"derivatives\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Territory</label>\n <Select value={form.watch(\"geographicScope\")} onValueChange={(v) => form.setValue(\"geographicScope\", v)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {GEOGRAPHIC_SCOPES.map((s) => <SelectItem key={s} value={s}>{s}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">AI & data mining</label>\n <ToggleGroup value={form.watch(\"aiPolicy\")} options={AI_POLICIES} onChange={(v) => form.setValue(\"aiPolicy\", v as FormValues[\"aiPolicy\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Royalty % (0–50)</label>\n <Input\n type=\"number\" min={0} max={50} step={0.5}\n value={form.watch(\"royalty\")}\n onChange={(e) => form.setValue(\"royalty\", parseFloat(e.target.value) || 0)}\n className=\"max-w-[120px]\"\n />\n </div>\n </div>\n </CollapsibleContent>\n </div>\n </Collapsible>\n\n <Collapsible open={ipTypeOpen} onOpenChange={setIpTypeOpen}>\n <div className=\"rounded-xl border border-border overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <Layers className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">IP Type & Metadata</span>\n <span className=\"text-xs text-muted-foreground font-normal\">Optional</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", ipTypeOpen && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">IP Type</label>\n <Select value={ipType} onValueChange={(v) => setIpType(v as IPType)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {IP_TYPES.map((t) => <SelectItem key={t} value={t}>{t}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <IPTypeFields\n ipType={ipType}\n onChange={(fields) => { templateFieldsRef.current = fields; }}\n uploadDocument={async (file) => {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, \"document\");\n return uri;\n }}\n existingDocument={mediaKind === \"document\" && mediaUri && mediaFile ? { uri: mediaUri, name: mediaFile.name } : null}\n />\n </div>\n </CollapsibleContent>\n </div>\n </Collapsible>\n\n {status === \"error\" && errorMsg && <p className=\"text-xs text-destructive\">{errorMsg}</p>}\n\n <button\n type=\"button\"\n disabled={!ready || busy || !hasWallet}\n onClick={form.handleSubmit(onSubmit)}\n className={cn(\n \"w-full h-12 text-base font-semibold text-white rounded-xl flex items-center justify-center gap-2 transition-all hover:brightness-110 active:scale-[0.98] bg-brand-blue\",\n (!ready || busy || !hasWallet) && \"opacity-40 pointer-events-none\"\n )}\n >\n {busy ? <><Loader2 className=\"h-4 w-4 animate-spin\" />Minting…</> : assetType === \"single\" ? \"Mint NFT\" : \"Mint Editions\"}\n </button>\n <p className=\"text-xs text-center text-muted-foreground\">\n Zero platform fees to mint.\n </p>\n </div>\n\n <div className=\"order-first lg:order-last lg:sticky lg:top-20 max-w-[260px] mx-auto w-full lg:max-w-none lg:mx-0\">\n <MedialaneCollectionCard\n image={mediaKind === \"image\" ? mediaPreview : featurePreview}\n name={name}\n collection={collectionLabel}\n creator={walletAddress ? `${walletAddress.slice(0, 6)}…${walletAddress.slice(-4)}` : undefined}\n creatorHref={walletAddress ? `/account/${walletAddress}` : undefined}\n />\n </div>\n </div>\n )}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2GQ;AAzGR,mBAA4C;AAC5C,mBAAkB;AAClB,6BAAwB;AACxB,sBAAqB;AACrB,iBAAyE;AACzE,IAAAA,mBAA8B;AAC9B,kCAAmD;AACnD,0BAIO;AACP,mBAAsB;AACtB,sBAAyB;AACzB,oBAA8E;AAC9E,yBAAoE;AACpE,qBAAwD;AACxD,uCAAwC;AACxC,2BAA6B;AAC7B,4BAAiD;AACjD,g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F;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU,CAAC,SAAS,QAAQ,CAAC;AAAA,cAC7B,SAAS,KAAK,aAAa,QAAQ;AAAA,cACnC,eAAW;AAAA,gBACT;AAAA,iBACC,CAAC,SAAS,QAAQ,CAAC,cAAc;AAAA,cACpC;AAAA,cAEC,iBAAO,4EAAE;AAAA,4DAAC,+BAAQ,WAAU,wBAAuB;AAAA,gBAAE;AAAA,iBAAQ,IAAM,cAAc,WAAW,aAAa;AAAA;AAAA,UAC5G;AAAA,UACA,4CAAC,OAAE,WAAU,6CAA4C,yCAEzD;AAAA,WACF;AAAA,QAEA,4CAAC,SAAI,WAAU,oGACb;AAAA,UAAC;AAAA;AAAA,YACC,OAAO,cAAc,UAAU,eAAe;AAAA,YAC9C;AAAA,YACA,YAAY;AAAA,YACZ,SAAS,gBAAgB,GAAG,cAAc,MAAM,GAAG,CAAC,CAAC,SAAI,cAAc,MAAM,EAAE,CAAC,KAAK;AAAA,YACrF,aAAa,gBAAgB,YAAY,aAAa,KAAK;AAAA;AAAA,QAC7D,GACF;AAAA,SACF;AAAA,OAEJ;AAAA,EACF;AACF;","names":["import_starknet","Image","name","intentRes","SingleIcon"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { FastMintProps } from './types.cjs';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
import '@medialane/sdk';
|
|
6
6
|
import '@medialane/sdk/starknet';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { FastMintProps } from './types.js';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
import '@medialane/sdk';
|
|
6
6
|
import '@medialane/sdk/starknet';
|
|
@@ -4,8 +4,9 @@ import { useEffect, useRef, useState } from "react";
|
|
|
4
4
|
import Image from "next/image";
|
|
5
5
|
import { useForm } from "react-hook-form";
|
|
6
6
|
import { hash } from "starknet";
|
|
7
|
-
import { normalizeAddress,
|
|
7
|
+
import { normalizeAddress, buildAssetMetadata } from "@medialane/sdk";
|
|
8
8
|
import { executeIntent } from "@medialane/sdk/starknet";
|
|
9
|
+
import { mintableCollections, collectionKey } from "./mintable-collections.js";
|
|
9
10
|
import {
|
|
10
11
|
ImagePlus,
|
|
11
12
|
Music,
|
|
@@ -140,10 +141,11 @@ function CollectionThumb({ image }) {
|
|
|
140
141
|
function CollectionPicker({
|
|
141
142
|
collections,
|
|
142
143
|
value,
|
|
143
|
-
onChange
|
|
144
|
+
onChange,
|
|
145
|
+
valueOf
|
|
144
146
|
}) {
|
|
145
147
|
const [open, setOpen] = useState(false);
|
|
146
|
-
const selected = collections.find((c) => c
|
|
148
|
+
const selected = value ? collections.find((c) => valueOf(c) === value) ?? null : null;
|
|
147
149
|
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
148
150
|
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
149
151
|
"button",
|
|
@@ -162,13 +164,16 @@ function CollectionPicker({
|
|
|
162
164
|
}
|
|
163
165
|
) }),
|
|
164
166
|
/* @__PURE__ */ jsx(PopoverContent, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-y-auto p-1", children: collections.length === 0 ? /* @__PURE__ */ jsx("p", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No collections yet \u2014 create one instead." }) : collections.map((col) => {
|
|
165
|
-
const
|
|
167
|
+
const id = valueOf(col);
|
|
168
|
+
const isSelected = !!id && value === id;
|
|
166
169
|
return /* @__PURE__ */ jsxs(
|
|
167
170
|
"button",
|
|
168
171
|
{
|
|
169
172
|
type: "button",
|
|
173
|
+
disabled: !id,
|
|
170
174
|
onClick: () => {
|
|
171
|
-
|
|
175
|
+
if (!id) return;
|
|
176
|
+
onChange(id);
|
|
172
177
|
setOpen(false);
|
|
173
178
|
},
|
|
174
179
|
className: "flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60",
|
|
@@ -185,7 +190,7 @@ function CollectionPicker({
|
|
|
185
190
|
isSelected && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 text-brand-blue shrink-0" })
|
|
186
191
|
]
|
|
187
192
|
},
|
|
188
|
-
col.
|
|
193
|
+
id ?? col.contractAddress ?? col.name
|
|
189
194
|
);
|
|
190
195
|
}) }) })
|
|
191
196
|
] });
|
|
@@ -281,8 +286,8 @@ function FastMint(props) {
|
|
|
281
286
|
setAutoCollectionDescription(description);
|
|
282
287
|
}
|
|
283
288
|
}, [description, autoCollectionDescription, newCollectionDescription]);
|
|
284
|
-
const erc721Collections =
|
|
285
|
-
const erc1155Collections =
|
|
289
|
+
const erc721Collections = mintableCollections("single", collections);
|
|
290
|
+
const erc1155Collections = mintableCollections("editions", collections);
|
|
286
291
|
const handleMediaSelect = async (file) => {
|
|
287
292
|
const kind = detectMediaKind(file.type);
|
|
288
293
|
if (!kind) {
|
|
@@ -770,7 +775,8 @@ function FastMint(props) {
|
|
|
770
775
|
{
|
|
771
776
|
collections: assetType === "single" ? erc721Collections : erc1155Collections,
|
|
772
777
|
value: assetType === "single" ? existingCollectionId : existingCollectionContract,
|
|
773
|
-
onChange: assetType === "single" ? setExistingCollectionId : setExistingCollectionContract
|
|
778
|
+
onChange: assetType === "single" ? setExistingCollectionId : setExistingCollectionContract,
|
|
779
|
+
valueOf: collectionKey(assetType === "single" ? "single" : "editions")
|
|
774
780
|
}
|
|
775
781
|
) : /* @__PURE__ */ jsxs("div", { className: "flex gap-3 rounded-xl border border-border p-3", children: [
|
|
776
782
|
/* @__PURE__ */ jsx("div", { className: "relative h-16 w-16 rounded-lg overflow-hidden bg-muted shrink-0", children: (mediaKind === "image" ? mediaPreview : featurePreview) ? /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/fast-mint/fast-mint.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport Image from \"next/image\";\nimport { useForm } from \"react-hook-form\";\nimport { hash } from \"starknet\";\nimport { normalizeAddress, getService, buildAssetMetadata, type ApiCollection } from \"@medialane/sdk\";\nimport { executeIntent } from \"@medialane/sdk/starknet\";\nimport {\n ImagePlus, Music, Video, FileText, Loader2,\n Layers, ImagePlus as SingleIcon, ChevronDown, Boxes, Plus, Check,\n ShieldCheck, X,\n} from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { Textarea } from \"../textarea.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover.js\";\nimport { MedialaneCollectionCard } from \"../medialane-collection-card.js\";\nimport { ActionDialog } from \"../action-dialog.js\";\nimport { IPTypeFields, type MetadataField } from \"../ip-type-fields.js\";\nimport {\n IP_TYPES, LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES, DERIVATIVES_OPTIONS,\n type IPType,\n} from \"../../data/ip.js\";\nimport { IP_TEMPLATES } from \"../../data/ip-templates.js\";\nimport { suggestLaunchpadSymbol } from \"../../utils/launchpad-defaults.js\";\nimport { uploadFileToIpfs, uploadJsonToIpfs, uploadFailureToast } from \"../../utils/ipfs-upload.js\";\nimport { ipfsToHttp } from \"../../utils/ipfs.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { Dropzone } from \"./dropzone.js\";\nimport { SuccessView } from \"./success-view.js\";\nimport type { FastMintProps, FastMintSigner, MediaKind, MintedAsset } from \"./types.js\";\n\nconst COLLECTION_DEPLOYED_SELECTOR = hash.getSelectorFromName(\"CollectionDeployed\");\nconst IP_MINTED_SELECTOR = hash.getSelectorFromName(\"IPMinted\");\n\nasync function readMintedTokenId(\n provider: { getTransactionReceipt(txHash: string): Promise<unknown> },\n txHash: string,\n contractAddress: string,\n): Promise<string | null> {\n let receipt: { events?: { from_address?: string; keys?: string[] }[] } | null = null;\n for (let attempt = 0; attempt < 3 && !receipt; attempt++) {\n try {\n if (attempt > 0) await new Promise((r) => setTimeout(r, 2000));\n const raw = await provider.getTransactionReceipt(txHash);\n receipt = raw as { events?: { from_address?: string; keys?: string[] }[] };\n } catch { /* retry */ }\n }\n const events = receipt?.events ?? [];\n const mintEvent = events.find((e) =>\n e.from_address && BigInt(e.from_address) === BigInt(contractAddress) &&\n e.keys?.[0] && BigInt(e.keys[0]) === BigInt(IP_MINTED_SELECTOR)\n );\n if (!mintEvent?.keys?.[1]) return null;\n const low = BigInt(mintEvent.keys[1] ?? 0);\n const high = BigInt(mintEvent.keys[2] ?? 0);\n return (low + (high << 128n)).toString();\n}\n\nconst MEDIA_ROUTE_MIME_TYPES = new Set([\n \"image/jpeg\", \"image/png\", \"image/gif\", \"image/webp\", \"image/svg+xml\", \"image/avif\",\n \"video/mp4\", \"video/webm\", \"video/ogg\",\n \"audio/mpeg\", \"audio/ogg\", \"audio/wav\", \"audio/webm\", \"audio/flac\",\n \"application/pdf\",\n]);\nconst DOCUMENT_SIGNED_URL_MIME_TYPES = new Set([\n \"application/msword\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"application/vnd.oasis.opendocument.text\",\n \"application/rtf\",\n \"text/plain\",\n \"text/markdown\",\n]);\nconst MEDIA_MAX_BYTES = 100 * 1024 * 1024;\nconst DOCUMENT_MAX_BYTES = 20 * 1024 * 1024;\n\nfunction detectMediaKind(mime: string): MediaKind | null {\n if (mime.startsWith(\"image/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"image\" : null;\n if (mime.startsWith(\"video/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"video\" : null;\n if (mime.startsWith(\"audio/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"audio\" : null;\n if (mime === \"application/pdf\" || DOCUMENT_SIGNED_URL_MIME_TYPES.has(mime)) return \"document\";\n return null;\n}\n\nconst IP_TYPE_BY_KIND: Record<MediaKind, IPType> = {\n image: \"NFT\",\n audio: \"Audio\",\n video: \"Video\",\n document: \"Documents\",\n};\n\nconst MEDIA_KIND_ICON: Record<MediaKind, typeof ImagePlus> = {\n image: ImagePlus,\n audio: Music,\n video: Video,\n document: FileText,\n};\n\nfunction ToggleGroup({\n value, options, onChange,\n}: { value: string; options: readonly string[]; onChange: (v: string) => void }) {\n return (\n <div className=\"flex rounded-lg border border-border overflow-hidden w-full\">\n {options.map((opt, i) => (\n <button\n key={opt}\n type=\"button\"\n onClick={() => onChange(opt)}\n className={cn(\n \"flex-1 px-3 py-2 text-sm transition-colors\",\n i > 0 && \"border-l border-border\",\n value === opt ? \"bg-primary text-primary-foreground font-medium\" : \"bg-background hover:bg-muted text-muted-foreground\"\n )}\n >\n {opt}\n </button>\n ))}\n </div>\n );\n}\n\nfunction collectionDisplayLabel(col: ApiCollection) {\n return col.name || col.symbol || `Collection #${col.collectionId}`;\n}\n\nfunction CollectionThumb({ image }: { image: string | null | undefined }) {\n const imageUrl = image ? ipfsToHttp(image) : null;\n return (\n <div className=\"relative h-10 w-10 rounded-lg overflow-hidden bg-muted shrink-0\">\n {imageUrl ? (\n <Image src={imageUrl} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-4 w-4 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n );\n}\n\nfunction CollectionPicker({\n collections, value, onChange,\n}: { collections: ApiCollection[]; value: string; onChange: (id: string) => void }) {\n const [open, setOpen] = useState(false);\n const selected = collections.find((c) => c.collectionId === value) ?? null;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-expanded={open}\n className=\"flex w-full items-center gap-3 rounded-xl border border-border p-3 text-left transition-colors hover:bg-muted/40\"\n >\n <CollectionThumb image={selected?.image} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold truncate\">\n {selected ? collectionDisplayLabel(selected) : collections.length ? \"Choose a collection\" : \"No collections yet\"}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {selected ? `${selected.totalSupply ?? 0} work${selected.totalSupply === 1 ? \"\" : \"s\"}` : \"Where this work will live\"}\n </p>\n </div>\n <ChevronDown className=\"h-3.5 w-3.5 text-muted-foreground shrink-0\" />\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[var(--radix-popover-trigger-width)] p-0\" align=\"start\">\n <div className=\"max-h-64 overflow-y-auto p-1\">\n {collections.length === 0 ? (\n <p className=\"px-3 py-4 text-center text-sm text-muted-foreground\">No collections yet — create one instead.</p>\n ) : (\n collections.map((col) => {\n const isSelected = value === col.collectionId;\n return (\n <button\n key={col.collectionId!}\n type=\"button\"\n onClick={() => { onChange(col.collectionId!); setOpen(false); }}\n className=\"flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60\"\n >\n <CollectionThumb image={col.image} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium truncate\">{collectionDisplayLabel(col)}</p>\n <p className=\"text-xs text-muted-foreground\">{col.totalSupply ?? 0} work{col.totalSupply === 1 ? \"\" : \"s\"}</p>\n </div>\n {isSelected && <Check className=\"h-4 w-4 text-brand-blue shrink-0\" />}\n </button>\n );\n })\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\ninterface FormValues {\n name: string;\n description: string;\n external_url: string;\n licenseType: string;\n commercialUse: \"Yes\" | \"No\";\n derivatives: \"Allowed\" | \"Not Allowed\" | \"Share-Alike\";\n attribution: \"Required\" | \"Not Required\";\n geographicScope: string;\n aiPolicy: \"Allowed\" | \"Not Allowed\" | \"Training Only\";\n royalty: number;\n}\n\nexport function FastMint(props: FastMintProps) {\n const {\n presentation = \"inline\", open = true, onClose, mediaKindLock, onMinted,\n collections, refetchCollections,\n hasWallet, walletAddress, onRequireWallet, connectLabel, getUploadToken, getSigner,\n client, provider,\n } = props;\n\n const [status, setStatus] = useState<\"idle\" | \"minting\" | \"success\" | \"error\">(\"idle\");\n const [errorMsg, setErrorMsg] = useState<string | null>(null);\n\n const [mediaFile, setMediaFile] = useState<File | null>(null);\n const [mediaPreview, setMediaPreview] = useState<string | null>(null);\n const [mediaUri, setMediaUri] = useState<string | null>(null);\n const [mediaKind, setMediaKind] = useState<MediaKind>(\"image\");\n const [mediaUploading, setMediaUploading] = useState(false);\n const previewUrlRef = useRef<string | null>(null);\n const mediaInputRef = useRef<HTMLInputElement>(null);\n\n const [featurePreview, setFeaturePreview] = useState<string | null>(null);\n const [featureUri, setFeatureUri] = useState<string | null>(null);\n const [featureUploading, setFeatureUploading] = useState(false);\n const featurePreviewRef = useRef<string | null>(null);\n const featureInputRef = useRef<HTMLInputElement>(null);\n\n const [assetType, setAssetType] = useState<\"single\" | \"editions\">(\"single\");\n const [editionCount, setEditionCount] = useState(\"10\");\n\n const [collectionMode, setCollectionMode] = useState<\"existing\" | \"new\">(\"existing\");\n const [existingCollectionId, setExistingCollectionId] = useState(\"\");\n const [existingCollectionContract, setExistingCollectionContract] = useState(\"\");\n const [newCollectionName, setNewCollectionName] = useState(\"\");\n const [newCollectionSymbol, setNewCollectionSymbol] = useState(\"\");\n const [newCollectionDescription, setNewCollectionDescription] = useState(\"\");\n const [autoSymbol, setAutoSymbol] = useState(\"\");\n const [autoCollectionName, setAutoCollectionName] = useState(\"\");\n const [autoCollectionDescription, setAutoCollectionDescription] = useState(\"\");\n\n const [ipType, setIpType] = useState<IPType>(\"NFT\");\n const [advancedOpen, setAdvancedOpen] = useState(false);\n const [ipTypeOpen, setIpTypeOpen] = useState(false);\n const templateFieldsRef = useRef<MetadataField[]>([]);\n\n const [mintedAsset, setMintedAsset] = useState<MintedAsset | null>(null);\n\n useEffect(() => () => {\n if (previewUrlRef.current) URL.revokeObjectURL(previewUrlRef.current);\n if (featurePreviewRef.current) URL.revokeObjectURL(featurePreviewRef.current);\n }, []);\n\n const form = useForm<FormValues>({\n defaultValues: {\n name: \"\", description: \"\", external_url: \"\",\n licenseType: \"CC BY-SA\", commercialUse: \"Yes\", derivatives: \"Share-Alike\",\n attribution: \"Required\", geographicScope: \"Worldwide\", aiPolicy: \"Not Allowed\", royalty: 0,\n },\n });\n const name = form.watch(\"name\");\n\n useEffect(() => {\n if (walletAddress && !form.getValues(\"external_url\")) {\n form.setValue(\"external_url\", `https://medialane.io/account/${walletAddress}`);\n }\n }, [walletAddress, form]);\n\n useEffect(() => {\n const s = suggestLaunchpadSymbol(name);\n if (!s) return;\n if (!newCollectionSymbol || newCollectionSymbol === autoSymbol) {\n setNewCollectionSymbol(s);\n setAutoSymbol(s);\n }\n if (!newCollectionName || newCollectionName === autoCollectionName) {\n setNewCollectionName(name);\n setAutoCollectionName(name);\n }\n }, [name, autoSymbol, autoCollectionName, newCollectionSymbol, newCollectionName]);\n\n const description = form.watch(\"description\");\n useEffect(() => {\n if (!newCollectionDescription || newCollectionDescription === autoCollectionDescription) {\n setNewCollectionDescription(description);\n setAutoCollectionDescription(description);\n }\n }, [description, autoCollectionDescription, newCollectionDescription]);\n\n const erc721Collections = collections.filter((c) => getService(c.service)?.id === \"mip-erc721\");\n const erc1155Collections = collections.filter((c) => c.standard === \"ERC1155\");\n\n const handleMediaSelect = async (file: File) => {\n const kind = detectMediaKind(file.type);\n if (!kind) {\n setErrorMsg(\"Publish an image, audio, video (JPG/PNG/GIF/SVG/WebP, MP3/WAV/OGG/FLAC, MP4/WebM), or document (PDF, DOC, DOCX, ODT, RTF, TXT, MD).\");\n return;\n }\n if (mediaKindLock && kind !== mediaKindLock) {\n setErrorMsg(`Please upload a${mediaKindLock === \"image\" ? \"n\" : \"\"} ${mediaKindLock}.`);\n return;\n }\n const viaMediaRoute = MEDIA_ROUTE_MIME_TYPES.has(file.type);\n const maxBytes = viaMediaRoute ? MEDIA_MAX_BYTES : DOCUMENT_MAX_BYTES;\n if (file.size > maxBytes) {\n setErrorMsg(`Maximum size is ${maxBytes / (1024 * 1024)} MB.`);\n return;\n }\n setMediaFile(file);\n setMediaKind(kind);\n setIpType(IP_TYPE_BY_KIND[kind]);\n if (previewUrlRef.current) URL.revokeObjectURL(previewUrlRef.current);\n const objectUrl = URL.createObjectURL(file);\n previewUrlRef.current = objectUrl;\n setMediaPreview(objectUrl);\n setMediaUri(null);\n setMediaUploading(true);\n try {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, viaMediaRoute ? \"media\" : \"document\");\n setMediaUri(uri);\n } catch (err) {\n const t = uploadFailureToast(err);\n setErrorMsg(t.description ?? t.title);\n } finally {\n setMediaUploading(false);\n }\n };\n\n const clearMedia = () => {\n setMediaFile(null);\n setMediaPreview(null);\n setMediaUri(null);\n if (mediaInputRef.current) mediaInputRef.current.value = \"\";\n };\n\n const handleFeatureSelect = async (file: File) => {\n if (featurePreviewRef.current) URL.revokeObjectURL(featurePreviewRef.current);\n const objectUrl = URL.createObjectURL(file);\n featurePreviewRef.current = objectUrl;\n setFeaturePreview(objectUrl);\n setFeatureUri(null);\n setFeatureUploading(true);\n try {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, \"image\");\n setFeatureUri(uri);\n } catch (err) {\n const t = uploadFailureToast(err);\n setErrorMsg(t.description ?? t.title);\n } finally {\n setFeatureUploading(false);\n }\n };\n\n const handleLicenseChange = (value: string) => {\n form.setValue(\"licenseType\", value);\n const def = LICENSE_TYPES.find((l) => l.value === value);\n if (def) {\n form.setValue(\"commercialUse\", def.commercialUse);\n form.setValue(\"derivatives\", def.derivatives);\n form.setValue(\"attribution\", def.attribution);\n }\n };\n\n const ready = !!mediaUri && !mediaUploading && name.trim().length > 0 &&\n (mediaKind === \"image\" || !!featureUri) &&\n (collectionMode === \"existing\"\n ? assetType === \"single\" ? !!existingCollectionId : !!existingCollectionContract\n : newCollectionName.trim().length > 0 && newCollectionSymbol.trim().length > 0);\n\n async function pollForNewCollection(name: string, symbol: string): Promise<ApiCollection | null> {\n for (let attempt = 0; attempt < 8; attempt++) {\n const list = await refetchCollections();\n const match = list.find((c) => c.name === name && c.symbol === symbol);\n if (match?.collectionId) return match;\n await new Promise((r) => setTimeout(r, 1500));\n }\n return null;\n }\n\n const onSubmit = async (values: FormValues) => {\n if (!hasWallet) { onRequireWallet(); return; }\n if (!walletAddress || !mediaUri) return;\n if (values.external_url && !values.external_url.startsWith(\"http://\") && !values.external_url.startsWith(\"https://\")) {\n setErrorMsg(\"External link must start with http:// or https://\");\n return;\n }\n\n setStatus(\"minting\");\n setErrorMsg(null);\n\n try {\n const signer: FastMintSigner = await getSigner();\n\n const image = mediaKind === \"image\" ? mediaUri : featureUri!;\n const animationUrl = mediaKind === \"image\" ? undefined : mediaUri;\n\n const built = buildAssetMetadata({\n name: values.name,\n description: values.description || \"\",\n externalUrl: values.external_url || \"\",\n imageUri: image,\n creator: walletAddress,\n ipType,\n licenseType: values.licenseType,\n commercialUse: values.commercialUse,\n derivatives: values.derivatives,\n attribution: values.attribution,\n geographicScope: values.geographicScope,\n aiPolicy: values.aiPolicy,\n royalty: String(values.royalty),\n templateTraits: templateFieldsRef.current\n .filter(({ traitType, value }) => traitType.trim() && value.trim())\n .map(({ traitType, value }) => ({ traitType, value })),\n });\n const metadata: Record<string, unknown> = { ...built };\n if (animationUrl) metadata.animation_url = animationUrl;\n\n const uploadToken = await getUploadToken();\n if (!uploadToken) throw new Error(\"Sign in first\");\n const tokenUri = await uploadJsonToIpfs(metadata, uploadToken);\n\n let result: { txHash: string };\n let finalContractAddress: string | null;\n let finalTokenId: string | null = null;\n\n if (assetType === \"single\") {\n let collectionId = existingCollectionId;\n let contractAddress = erc721Collections.find((c) => c.collectionId === existingCollectionId)?.contractAddress ?? null;\n\n if (collectionMode === \"new\") {\n const intentRes = await client.api.createCollectionIntent({\n owner: walletAddress,\n name: newCollectionName,\n symbol: newCollectionSymbol,\n description: newCollectionDescription || undefined,\n image,\n });\n await executeIntent(provider, signer, client, intentRes.data);\n\n const found = await pollForNewCollection(newCollectionName, newCollectionSymbol);\n if (!found) throw new Error(\"Collection created, but it's still indexing — try minting again in a moment from My Collections.\");\n collectionId = found.collectionId!;\n contractAddress = found.contractAddress ?? null;\n }\n\n const intentRes = await client.api.createMintIntent({\n owner: walletAddress,\n collectionId,\n recipient: walletAddress,\n tokenUri,\n royaltyBps: Math.round(values.royalty * 100),\n });\n if (!intentRes.data.requiresSignature) {\n const calls = intentRes.data.calls;\n contractAddress = calls[calls.length - 1]?.contractAddress ?? contractAddress;\n }\n result = await executeIntent(provider, signer, client, intentRes.data);\n finalContractAddress = contractAddress;\n\n if (finalContractAddress) {\n finalTokenId = await readMintedTokenId(provider, result.txHash, finalContractAddress);\n }\n } else {\n let collectionContract = existingCollectionContract;\n\n if (collectionMode === \"new\") {\n const intentRes = await client.api.createCollectionIntent({\n owner: walletAddress,\n name: newCollectionName,\n symbol: newCollectionSymbol,\n description: newCollectionDescription || undefined,\n image,\n baseUri: \"\",\n service: \"mip-erc1155\",\n });\n const deployResult = await executeIntent(provider, signer, client, intentRes.data);\n\n let receipt: { events?: { keys?: string[] }[] } | null = null;\n for (let attempt = 0; attempt < 3 && !receipt; attempt++) {\n try {\n if (attempt > 0) await new Promise((r) => setTimeout(r, 2000));\n const raw = await provider.getTransactionReceipt(deployResult.txHash);\n receipt = raw as { events?: { keys?: string[] }[] };\n } catch { /* retry */ }\n }\n const events = receipt?.events ?? [];\n const deployEvent = events.find((e) =>\n e.keys?.[0] && BigInt(e.keys[0]) === BigInt(COLLECTION_DEPLOYED_SELECTOR)\n );\n if (!deployEvent?.keys?.[1]) throw new Error(\"Collection deployed, but its address couldn't be read — check My Collections to mint into it.\");\n collectionContract = normalizeAddress(\"STARKNET\", deployEvent.keys[1]);\n }\n\n const intentRes = await client.api.createMintIntent({\n owner: walletAddress,\n recipient: walletAddress,\n collectionContract,\n tokenUri,\n value: editionCount,\n royaltyBps: Math.round(values.royalty * 100),\n });\n result = await executeIntent(provider, signer, client, intentRes.data);\n finalContractAddress = collectionContract;\n finalTokenId = await readMintedTokenId(provider, result.txHash, collectionContract);\n }\n\n if (finalContractAddress && finalTokenId) {\n const asset: MintedAsset = { contract: finalContractAddress, tokenId: finalTokenId, image };\n setMintedAsset(asset);\n onMinted?.(asset);\n }\n setStatus(\"success\");\n } catch (err) {\n setErrorMsg(err instanceof Error ? err.message : \"Something went wrong. Please try again.\");\n setStatus(\"error\");\n }\n };\n\n const resetAll = () => {\n setStatus(\"idle\");\n setErrorMsg(null);\n setMintedAsset(null);\n form.reset();\n clearMedia();\n setFeaturePreview(null);\n setFeatureUri(null);\n setAssetType(\"single\");\n setEditionCount(\"10\");\n setCollectionMode(\"existing\");\n setExistingCollectionId(\"\");\n setExistingCollectionContract(\"\");\n setNewCollectionName(\"\");\n setNewCollectionSymbol(\"\");\n setNewCollectionDescription(\"\");\n setAutoSymbol(\"\");\n setAutoCollectionName(\"\");\n setAutoCollectionDescription(\"\");\n templateFieldsRef.current = [];\n };\n\n const busy = status === \"minting\";\n const KindIcon = MEDIA_KIND_ICON[mediaKind];\n const selectedExistingCollection = assetType === \"single\"\n ? erc721Collections.find((c) => c.collectionId === existingCollectionId)\n : erc1155Collections.find((c) => c.contractAddress === existingCollectionContract);\n const collectionLabel = mediaUri\n ? (collectionMode === \"new\"\n ? (newCollectionName || \"New collection\")\n : (selectedExistingCollection?.name || \"IP Asset\"))\n : undefined;\n\n const wrap = (node: React.ReactNode) => {\n if (presentation !== \"dialog\") return node;\n return (\n <ActionDialog open={open} onClose={onClose ?? (() => {})} width={640}>\n <div className=\"relative p-6 sm:p-8\">\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close\"\n className=\"absolute top-4 right-4 h-8 w-8 rounded-full hover:bg-muted flex items-center justify-center text-muted-foreground\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n {node}\n </div>\n </ActionDialog>\n );\n };\n\n if (status === \"success\") {\n return wrap(\n <SuccessView\n presentation={presentation}\n previewImage={mediaKind === \"image\" ? mediaPreview : featurePreview}\n name={name}\n collectionLabel={collectionLabel}\n mintedAsset={mintedAsset}\n onPublishAnother={resetAll}\n />\n );\n }\n\n if (!mediaFile) {\n return wrap(\n <Dropzone\n mediaKindLock={mediaKindLock}\n presentation={presentation}\n hasWallet={hasWallet}\n onRequireWallet={onRequireWallet}\n connectLabel={connectLabel}\n onFileSelected={handleMediaSelect}\n />\n );\n }\n\n return wrap(\n <section className=\"space-y-6\">\n <div className=\"flex items-center gap-4 rounded-xl border border-border p-3\">\n <div className=\"relative h-14 w-14 rounded-lg bg-muted overflow-hidden shrink-0\">\n {mediaKind === \"image\" && mediaPreview ? (\n <Image src={mediaPreview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <KindIcon className=\"h-6 w-6 text-muted-foreground\" />\n </div>\n )}\n {mediaUploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-1\">\n <p className=\"text-sm font-semibold truncate\">{mediaFile.name}</p>\n <div className=\"flex items-center gap-2 flex-wrap\">\n <p className=\"text-xs text-muted-foreground\">\n {mediaUploading ? \"Uploading…\" : mediaUri ? \"Uploaded\" : \"Upload failed\"}\n </p>\n {mediaUri && (() => {\n const template = IP_TEMPLATES[ipType];\n const TemplateIcon = template.icon;\n return (\n <span\n className={cn(\n \"inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs font-medium\",\n template.color.bg, template.color.text, template.color.border\n )}\n >\n <TemplateIcon className=\"h-3 w-3\" />\n {template.label}\n </span>\n );\n })()}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => mediaInputRef.current?.click()}\n className=\"text-xs font-semibold text-brand-blue hover:underline shrink-0\"\n >\n Change\n </button>\n <input ref={mediaInputRef} type=\"file\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) handleMediaSelect(f); }} />\n </div>\n\n {mediaUri && (\n <div className=\"grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-8 items-start\">\n <div className=\"space-y-5\">\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Title *</label>\n <Input\n value={name}\n onChange={(e) => form.setValue(\"name\", e.target.value)}\n placeholder=\"My Creative Work\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Description</label>\n <Textarea\n value={form.watch(\"description\")}\n onChange={(e) => form.setValue(\"description\", e.target.value)}\n placeholder=\"Describe your work, its story, and any context for buyers…\"\n rows={3}\n />\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">External link <span className=\"text-muted-foreground font-normal\">(optional)</span></label>\n <Input\n value={form.watch(\"external_url\")}\n onChange={(e) => form.setValue(\"external_url\", e.target.value)}\n placeholder=\"https://yourwebsite.com\"\n />\n </div>\n\n {mediaKind !== \"image\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Upload a cover image for your asset *</label>\n <div className=\"flex items-center gap-4\">\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => !featureUploading && featureInputRef.current?.click()}\n onKeyDown={(e) => { if ((e.key === \"Enter\" || e.key === \" \") && !featureUploading) { e.preventDefault(); featureInputRef.current?.click(); } }}\n className=\"relative h-20 w-20 rounded-xl border-2 border-dashed border-border bg-muted flex items-center justify-center overflow-hidden shrink-0 cursor-pointer hover:border-primary/50 transition-colors\"\n >\n {featurePreview ? (\n <Image src={featurePreview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <ImagePlus className=\"h-6 w-6 text-muted-foreground\" />\n )}\n {featureUploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n <input ref={featureInputRef} type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) handleFeatureSelect(f); }} />\n </div>\n <p className=\"text-xs text-muted-foreground\">Cover art shown wherever the work is previewed. JPG, PNG, GIF, SVG or WebP.</p>\n </div>\n </div>\n )}\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Asset Type</label>\n <div className=\"grid grid-cols-2 gap-3\">\n <button\n type=\"button\"\n onClick={() => setAssetType(\"single\")}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n assetType === \"single\" ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <SingleIcon className={cn(\"h-5 w-5 shrink-0 mt-0.5\", assetType === \"single\" ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">Single Edition NFT</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">Minted once</span>\n </span>\n </button>\n <button\n type=\"button\"\n onClick={() => setAssetType(\"editions\")}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n assetType === \"editions\" ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <Layers className={cn(\"h-5 w-5 shrink-0 mt-0.5\", assetType === \"editions\" ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">Limited Editions NFT</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">Several numbered copies</span>\n </span>\n </button>\n </div>\n </div>\n\n {assetType === \"editions\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Number of copies</label>\n <Input\n type=\"number\"\n min={1}\n value={editionCount}\n onChange={(e) => setEditionCount(e.target.value)}\n className=\"max-w-[140px]\"\n />\n </div>\n )}\n\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <label className=\"text-sm font-medium flex items-center gap-1.5\">\n <Boxes className=\"h-4 w-4\" />\n Collection *\n </label>\n <div className=\"flex rounded-lg border border-border overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setCollectionMode(\"existing\")}\n className={cn(\"px-3 h-7 text-xs font-medium transition-colors\",\n collectionMode === \"existing\" ? \"bg-primary text-primary-foreground\" : \"bg-background hover:bg-muted text-muted-foreground\")}\n >\n Existing\n </button>\n <button\n type=\"button\"\n onClick={() => setCollectionMode(\"new\")}\n className={cn(\"px-3 h-7 text-xs font-medium border-l border-border transition-colors flex items-center gap-1\",\n collectionMode === \"new\" ? \"bg-primary text-primary-foreground\" : \"bg-background hover:bg-muted text-muted-foreground\")}\n >\n <Plus className=\"h-3 w-3\" />New\n </button>\n </div>\n </div>\n\n {collectionMode === \"existing\" ? (\n <CollectionPicker\n collections={assetType === \"single\" ? erc721Collections : erc1155Collections}\n value={assetType === \"single\" ? existingCollectionId : existingCollectionContract}\n onChange={assetType === \"single\" ? setExistingCollectionId : setExistingCollectionContract}\n />\n ) : (\n <div className=\"flex gap-3 rounded-xl border border-border p-3\">\n <div className=\"relative h-16 w-16 rounded-lg overflow-hidden bg-muted shrink-0\">\n {(mediaKind === \"image\" ? mediaPreview : featurePreview) ? (\n <Image\n src={(mediaKind === \"image\" ? mediaPreview : featurePreview)!}\n alt=\"\"\n fill\n className=\"object-cover\"\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-5 w-5 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-2\">\n <div className=\"grid grid-cols-[1fr_100px] gap-2\">\n <Input\n value={newCollectionName}\n onChange={(e) => setNewCollectionName(e.target.value)}\n placeholder=\"Collection name\"\n className=\"h-9 text-sm\"\n />\n <Input\n value={newCollectionSymbol}\n onChange={(e) => setNewCollectionSymbol(e.target.value.toUpperCase())}\n placeholder=\"SYMBOL\"\n className=\"h-9 text-sm\"\n />\n </div>\n <Textarea\n value={newCollectionDescription}\n onChange={(e) => setNewCollectionDescription(e.target.value)}\n placeholder=\"Describe this collection…\"\n rows={2}\n className=\"text-sm resize-none\"\n />\n <p className=\"text-2xs text-muted-foreground\">Prefilled from your asset — edit anything above.</p>\n </div>\n </div>\n )}\n </div>\n\n <Collapsible open={advancedOpen} onOpenChange={setAdvancedOpen}>\n <div className=\"rounded-xl border border-border overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <ShieldCheck className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">Licensing Terms</span>\n <span className=\"text-xs text-muted-foreground font-normal\">Optional · Berne Convention</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", advancedOpen && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">License</label>\n <Select value={form.watch(\"licenseType\")} onValueChange={handleLicenseChange}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {LICENSE_TYPES.map((l) => <SelectItem key={l.value} value={l.value}>{l.label}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Commercial use</label>\n <ToggleGroup value={form.watch(\"commercialUse\")} options={[\"Yes\", \"No\"]} onChange={(v) => form.setValue(\"commercialUse\", v as \"Yes\" | \"No\")} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Derivatives</label>\n <ToggleGroup value={form.watch(\"derivatives\")} options={DERIVATIVES_OPTIONS} onChange={(v) => form.setValue(\"derivatives\", v as FormValues[\"derivatives\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Territory</label>\n <Select value={form.watch(\"geographicScope\")} onValueChange={(v) => form.setValue(\"geographicScope\", v)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {GEOGRAPHIC_SCOPES.map((s) => <SelectItem key={s} value={s}>{s}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">AI & data mining</label>\n <ToggleGroup value={form.watch(\"aiPolicy\")} options={AI_POLICIES} onChange={(v) => form.setValue(\"aiPolicy\", v as FormValues[\"aiPolicy\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Royalty % (0–50)</label>\n <Input\n type=\"number\" min={0} max={50} step={0.5}\n value={form.watch(\"royalty\")}\n onChange={(e) => form.setValue(\"royalty\", parseFloat(e.target.value) || 0)}\n className=\"max-w-[120px]\"\n />\n </div>\n </div>\n </CollapsibleContent>\n </div>\n </Collapsible>\n\n <Collapsible open={ipTypeOpen} onOpenChange={setIpTypeOpen}>\n <div className=\"rounded-xl border border-border overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <Layers className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">IP Type & Metadata</span>\n <span className=\"text-xs text-muted-foreground font-normal\">Optional</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", ipTypeOpen && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">IP Type</label>\n <Select value={ipType} onValueChange={(v) => setIpType(v as IPType)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {IP_TYPES.map((t) => <SelectItem key={t} value={t}>{t}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <IPTypeFields\n ipType={ipType}\n onChange={(fields) => { templateFieldsRef.current = fields; }}\n uploadDocument={async (file) => {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, \"document\");\n return uri;\n }}\n existingDocument={mediaKind === \"document\" && mediaUri && mediaFile ? { uri: mediaUri, name: mediaFile.name } : null}\n />\n </div>\n </CollapsibleContent>\n </div>\n </Collapsible>\n\n {status === \"error\" && errorMsg && <p className=\"text-xs text-destructive\">{errorMsg}</p>}\n\n <button\n type=\"button\"\n disabled={!ready || busy || !hasWallet}\n onClick={form.handleSubmit(onSubmit)}\n className={cn(\n \"w-full h-12 text-base font-semibold text-white rounded-xl flex items-center justify-center gap-2 transition-all hover:brightness-110 active:scale-[0.98] bg-brand-blue\",\n (!ready || busy || !hasWallet) && \"opacity-40 pointer-events-none\"\n )}\n >\n {busy ? <><Loader2 className=\"h-4 w-4 animate-spin\" />Minting…</> : assetType === \"single\" ? \"Mint NFT\" : \"Mint Editions\"}\n </button>\n <p className=\"text-xs text-center text-muted-foreground\">\n Zero platform fees to mint.\n </p>\n </div>\n\n <div className=\"order-first lg:order-last lg:sticky lg:top-20 max-w-[260px] mx-auto w-full lg:max-w-none lg:mx-0\">\n <MedialaneCollectionCard\n image={mediaKind === \"image\" ? mediaPreview : featurePreview}\n name={name}\n collection={collectionLabel}\n creator={walletAddress ? `${walletAddress.slice(0, 6)}…${walletAddress.slice(-4)}` : undefined}\n creatorHref={walletAddress ? `/account/${walletAddress}` : undefined}\n />\n </div>\n </div>\n )}\n </section>\n );\n}\n"],"mappings":";AA0GQ,SAu0Bc,UAv0Bd,KAmDE,YAnDF;AAxGR,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,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AAI,MAAM,eAAe;AAC3C,0BAAM,EAAE,IAAI,IAAI,MAAM,iBAAiB,MAAM,OAAO,UAAU;AAC9D,2BAAO;AAAA,kBACT;AAAA,kBACA,kBAAkB,cAAc,cAAc,YAAY,YAAY,EAAE,KAAK,UAAU,MAAM,UAAU,KAAK,IAAI;AAAA;AAAA,cAClH;AAAA,eACF,GACF;AAAA,aACF,GACF;AAAA,UAEC,WAAW,WAAW,YAAY,oBAAC,OAAE,WAAU,4BAA4B,oBAAS;AAAA,UAErF;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU,CAAC,SAAS,QAAQ,CAAC;AAAA,cAC7B,SAAS,KAAK,aAAa,QAAQ;AAAA,cACnC,WAAW;AAAA,gBACT;AAAA,iBACC,CAAC,SAAS,QAAQ,CAAC,cAAc;AAAA,cACpC;AAAA,cAEC,iBAAO,iCAAE;AAAA,oCAAC,WAAQ,WAAU,wBAAuB;AAAA,gBAAE;AAAA,iBAAQ,IAAM,cAAc,WAAW,aAAa;AAAA;AAAA,UAC5G;AAAA,UACA,oBAAC,OAAE,WAAU,6CAA4C,yCAEzD;AAAA,WACF;AAAA,QAEA,oBAAC,SAAI,WAAU,oGACb;AAAA,UAAC;AAAA;AAAA,YACC,OAAO,cAAc,UAAU,eAAe;AAAA,YAC9C;AAAA,YACA,YAAY;AAAA,YACZ,SAAS,gBAAgB,GAAG,cAAc,MAAM,GAAG,CAAC,CAAC,SAAI,cAAc,MAAM,EAAE,CAAC,KAAK;AAAA,YACrF,aAAa,gBAAgB,YAAY,aAAa,KAAK;AAAA;AAAA,QAC7D,GACF;AAAA,SACF;AAAA,OAEJ;AAAA,EACF;AACF;","names":["name","intentRes"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/fast-mint.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport Image from \"next/image\";\nimport { useForm } from \"react-hook-form\";\nimport { hash } from \"starknet\";\nimport { normalizeAddress, buildAssetMetadata, type ApiCollection } from \"@medialane/sdk\";\nimport { executeIntent } from \"@medialane/sdk/starknet\";\nimport { mintableCollections, collectionKey } from \"./mintable-collections.js\";\nimport {\n ImagePlus, Music, Video, FileText, Loader2,\n Layers, ImagePlus as SingleIcon, ChevronDown, Boxes, Plus, Check,\n ShieldCheck, X,\n} from \"lucide-react\";\nimport { Input } from \"../input.js\";\nimport { Textarea } from \"../textarea.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../select.js\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible.js\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover.js\";\nimport { MedialaneCollectionCard } from \"../medialane-collection-card.js\";\nimport { ActionDialog } from \"../action-dialog.js\";\nimport { IPTypeFields, type MetadataField } from \"../ip-type-fields.js\";\nimport {\n IP_TYPES, LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES, DERIVATIVES_OPTIONS,\n type IPType,\n} from \"../../data/ip.js\";\nimport { IP_TEMPLATES } from \"../../data/ip-templates.js\";\nimport { suggestLaunchpadSymbol } from \"../../utils/launchpad-defaults.js\";\nimport { uploadFileToIpfs, uploadJsonToIpfs, uploadFailureToast } from \"../../utils/ipfs-upload.js\";\nimport { ipfsToHttp } from \"../../utils/ipfs.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { Dropzone } from \"./dropzone.js\";\nimport { SuccessView } from \"./success-view.js\";\nimport type { FastMintProps, FastMintSigner, MediaKind, MintedAsset } from \"./types.js\";\n\nconst COLLECTION_DEPLOYED_SELECTOR = hash.getSelectorFromName(\"CollectionDeployed\");\nconst IP_MINTED_SELECTOR = hash.getSelectorFromName(\"IPMinted\");\n\nasync function readMintedTokenId(\n provider: { getTransactionReceipt(txHash: string): Promise<unknown> },\n txHash: string,\n contractAddress: string,\n): Promise<string | null> {\n let receipt: { events?: { from_address?: string; keys?: string[] }[] } | null = null;\n for (let attempt = 0; attempt < 3 && !receipt; attempt++) {\n try {\n if (attempt > 0) await new Promise((r) => setTimeout(r, 2000));\n const raw = await provider.getTransactionReceipt(txHash);\n receipt = raw as { events?: { from_address?: string; keys?: string[] }[] };\n } catch { /* retry */ }\n }\n const events = receipt?.events ?? [];\n const mintEvent = events.find((e) =>\n e.from_address && BigInt(e.from_address) === BigInt(contractAddress) &&\n e.keys?.[0] && BigInt(e.keys[0]) === BigInt(IP_MINTED_SELECTOR)\n );\n if (!mintEvent?.keys?.[1]) return null;\n const low = BigInt(mintEvent.keys[1] ?? 0);\n const high = BigInt(mintEvent.keys[2] ?? 0);\n return (low + (high << 128n)).toString();\n}\n\nconst MEDIA_ROUTE_MIME_TYPES = new Set([\n \"image/jpeg\", \"image/png\", \"image/gif\", \"image/webp\", \"image/svg+xml\", \"image/avif\",\n \"video/mp4\", \"video/webm\", \"video/ogg\",\n \"audio/mpeg\", \"audio/ogg\", \"audio/wav\", \"audio/webm\", \"audio/flac\",\n \"application/pdf\",\n]);\nconst DOCUMENT_SIGNED_URL_MIME_TYPES = new Set([\n \"application/msword\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"application/vnd.oasis.opendocument.text\",\n \"application/rtf\",\n \"text/plain\",\n \"text/markdown\",\n]);\nconst MEDIA_MAX_BYTES = 100 * 1024 * 1024;\nconst DOCUMENT_MAX_BYTES = 20 * 1024 * 1024;\n\nfunction detectMediaKind(mime: string): MediaKind | null {\n if (mime.startsWith(\"image/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"image\" : null;\n if (mime.startsWith(\"video/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"video\" : null;\n if (mime.startsWith(\"audio/\")) return MEDIA_ROUTE_MIME_TYPES.has(mime) ? \"audio\" : null;\n if (mime === \"application/pdf\" || DOCUMENT_SIGNED_URL_MIME_TYPES.has(mime)) return \"document\";\n return null;\n}\n\nconst IP_TYPE_BY_KIND: Record<MediaKind, IPType> = {\n image: \"NFT\",\n audio: \"Audio\",\n video: \"Video\",\n document: \"Documents\",\n};\n\nconst MEDIA_KIND_ICON: Record<MediaKind, typeof ImagePlus> = {\n image: ImagePlus,\n audio: Music,\n video: Video,\n document: FileText,\n};\n\nfunction ToggleGroup({\n value, options, onChange,\n}: { value: string; options: readonly string[]; onChange: (v: string) => void }) {\n return (\n <div className=\"flex rounded-lg border border-border overflow-hidden w-full\">\n {options.map((opt, i) => (\n <button\n key={opt}\n type=\"button\"\n onClick={() => onChange(opt)}\n className={cn(\n \"flex-1 px-3 py-2 text-sm transition-colors\",\n i > 0 && \"border-l border-border\",\n value === opt ? \"bg-primary text-primary-foreground font-medium\" : \"bg-background hover:bg-muted text-muted-foreground\"\n )}\n >\n {opt}\n </button>\n ))}\n </div>\n );\n}\n\nfunction collectionDisplayLabel(col: ApiCollection) {\n return col.name || col.symbol || `Collection #${col.collectionId}`;\n}\n\nfunction CollectionThumb({ image }: { image: string | null | undefined }) {\n const imageUrl = image ? ipfsToHttp(image) : null;\n return (\n <div className=\"relative h-10 w-10 rounded-lg overflow-hidden bg-muted shrink-0\">\n {imageUrl ? (\n <Image src={imageUrl} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-4 w-4 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n );\n}\n\nfunction CollectionPicker({\n collections, value, onChange, valueOf,\n}: {\n collections: ApiCollection[];\n value: string;\n onChange: (id: string) => void;\n // Which field identifies a collection here. Single editions are keyed by\n // collectionId; limited editions by contract address, because ERC1155\n // collections have no collectionId at all. Hardcoding collectionId meant the\n // picker handed back null for every ERC1155 row, which read as \"nothing\n // chosen\" to the submit gate while still rendering as chosen.\n valueOf: (c: ApiCollection) => string | null | undefined;\n}) {\n const [open, setOpen] = useState(false);\n const selected = value\n ? collections.find((c) => valueOf(c) === value) ?? null\n : null;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-expanded={open}\n className=\"flex w-full items-center gap-3 rounded-xl border border-border p-3 text-left transition-colors hover:bg-muted/40\"\n >\n <CollectionThumb image={selected?.image} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold truncate\">\n {selected ? collectionDisplayLabel(selected) : collections.length ? \"Choose a collection\" : \"No collections yet\"}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {selected ? `${selected.totalSupply ?? 0} work${selected.totalSupply === 1 ? \"\" : \"s\"}` : \"Where this work will live\"}\n </p>\n </div>\n <ChevronDown className=\"h-3.5 w-3.5 text-muted-foreground shrink-0\" />\n </button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[var(--radix-popover-trigger-width)] p-0\" align=\"start\">\n <div className=\"max-h-64 overflow-y-auto p-1\">\n {collections.length === 0 ? (\n <p className=\"px-3 py-4 text-center text-sm text-muted-foreground\">No collections yet — create one instead.</p>\n ) : (\n collections.map((col) => {\n const id = valueOf(col);\n const isSelected = !!id && value === id;\n return (\n <button\n key={id ?? col.contractAddress ?? col.name}\n type=\"button\"\n disabled={!id}\n onClick={() => { if (!id) return; onChange(id); setOpen(false); }}\n className=\"flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left transition-colors hover:bg-muted/60\"\n >\n <CollectionThumb image={col.image} />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium truncate\">{collectionDisplayLabel(col)}</p>\n <p className=\"text-xs text-muted-foreground\">{col.totalSupply ?? 0} work{col.totalSupply === 1 ? \"\" : \"s\"}</p>\n </div>\n {isSelected && <Check className=\"h-4 w-4 text-brand-blue shrink-0\" />}\n </button>\n );\n })\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\ninterface FormValues {\n name: string;\n description: string;\n external_url: string;\n licenseType: string;\n commercialUse: \"Yes\" | \"No\";\n derivatives: \"Allowed\" | \"Not Allowed\" | \"Share-Alike\";\n attribution: \"Required\" | \"Not Required\";\n geographicScope: string;\n aiPolicy: \"Allowed\" | \"Not Allowed\" | \"Training Only\";\n royalty: number;\n}\n\nexport function FastMint(props: FastMintProps) {\n const {\n presentation = \"inline\", open = true, onClose, mediaKindLock, onMinted,\n collections, refetchCollections,\n hasWallet, walletAddress, onRequireWallet, connectLabel, getUploadToken, getSigner,\n client, provider,\n } = props;\n\n const [status, setStatus] = useState<\"idle\" | \"minting\" | \"success\" | \"error\">(\"idle\");\n const [errorMsg, setErrorMsg] = useState<string | null>(null);\n\n const [mediaFile, setMediaFile] = useState<File | null>(null);\n const [mediaPreview, setMediaPreview] = useState<string | null>(null);\n const [mediaUri, setMediaUri] = useState<string | null>(null);\n const [mediaKind, setMediaKind] = useState<MediaKind>(\"image\");\n const [mediaUploading, setMediaUploading] = useState(false);\n const previewUrlRef = useRef<string | null>(null);\n const mediaInputRef = useRef<HTMLInputElement>(null);\n\n const [featurePreview, setFeaturePreview] = useState<string | null>(null);\n const [featureUri, setFeatureUri] = useState<string | null>(null);\n const [featureUploading, setFeatureUploading] = useState(false);\n const featurePreviewRef = useRef<string | null>(null);\n const featureInputRef = useRef<HTMLInputElement>(null);\n\n const [assetType, setAssetType] = useState<\"single\" | \"editions\">(\"single\");\n const [editionCount, setEditionCount] = useState(\"10\");\n\n const [collectionMode, setCollectionMode] = useState<\"existing\" | \"new\">(\"existing\");\n const [existingCollectionId, setExistingCollectionId] = useState(\"\");\n const [existingCollectionContract, setExistingCollectionContract] = useState(\"\");\n const [newCollectionName, setNewCollectionName] = useState(\"\");\n const [newCollectionSymbol, setNewCollectionSymbol] = useState(\"\");\n const [newCollectionDescription, setNewCollectionDescription] = useState(\"\");\n const [autoSymbol, setAutoSymbol] = useState(\"\");\n const [autoCollectionName, setAutoCollectionName] = useState(\"\");\n const [autoCollectionDescription, setAutoCollectionDescription] = useState(\"\");\n\n const [ipType, setIpType] = useState<IPType>(\"NFT\");\n const [advancedOpen, setAdvancedOpen] = useState(false);\n const [ipTypeOpen, setIpTypeOpen] = useState(false);\n const templateFieldsRef = useRef<MetadataField[]>([]);\n\n const [mintedAsset, setMintedAsset] = useState<MintedAsset | null>(null);\n\n useEffect(() => () => {\n if (previewUrlRef.current) URL.revokeObjectURL(previewUrlRef.current);\n if (featurePreviewRef.current) URL.revokeObjectURL(featurePreviewRef.current);\n }, []);\n\n const form = useForm<FormValues>({\n defaultValues: {\n name: \"\", description: \"\", external_url: \"\",\n licenseType: \"CC BY-SA\", commercialUse: \"Yes\", derivatives: \"Share-Alike\",\n attribution: \"Required\", geographicScope: \"Worldwide\", aiPolicy: \"Not Allowed\", royalty: 0,\n },\n });\n const name = form.watch(\"name\");\n\n useEffect(() => {\n if (walletAddress && !form.getValues(\"external_url\")) {\n form.setValue(\"external_url\", `https://medialane.io/account/${walletAddress}`);\n }\n }, [walletAddress, form]);\n\n useEffect(() => {\n const s = suggestLaunchpadSymbol(name);\n if (!s) return;\n if (!newCollectionSymbol || newCollectionSymbol === autoSymbol) {\n setNewCollectionSymbol(s);\n setAutoSymbol(s);\n }\n if (!newCollectionName || newCollectionName === autoCollectionName) {\n setNewCollectionName(name);\n setAutoCollectionName(name);\n }\n }, [name, autoSymbol, autoCollectionName, newCollectionSymbol, newCollectionName]);\n\n const description = form.watch(\"description\");\n useEffect(() => {\n if (!newCollectionDescription || newCollectionDescription === autoCollectionDescription) {\n setNewCollectionDescription(description);\n setAutoCollectionDescription(description);\n }\n }, [description, autoCollectionDescription, newCollectionDescription]);\n\n const erc721Collections = mintableCollections(\"single\", collections);\n const erc1155Collections = mintableCollections(\"editions\", collections);\n\n const handleMediaSelect = async (file: File) => {\n const kind = detectMediaKind(file.type);\n if (!kind) {\n setErrorMsg(\"Publish an image, audio, video (JPG/PNG/GIF/SVG/WebP, MP3/WAV/OGG/FLAC, MP4/WebM), or document (PDF, DOC, DOCX, ODT, RTF, TXT, MD).\");\n return;\n }\n if (mediaKindLock && kind !== mediaKindLock) {\n setErrorMsg(`Please upload a${mediaKindLock === \"image\" ? \"n\" : \"\"} ${mediaKindLock}.`);\n return;\n }\n const viaMediaRoute = MEDIA_ROUTE_MIME_TYPES.has(file.type);\n const maxBytes = viaMediaRoute ? MEDIA_MAX_BYTES : DOCUMENT_MAX_BYTES;\n if (file.size > maxBytes) {\n setErrorMsg(`Maximum size is ${maxBytes / (1024 * 1024)} MB.`);\n return;\n }\n setMediaFile(file);\n setMediaKind(kind);\n setIpType(IP_TYPE_BY_KIND[kind]);\n if (previewUrlRef.current) URL.revokeObjectURL(previewUrlRef.current);\n const objectUrl = URL.createObjectURL(file);\n previewUrlRef.current = objectUrl;\n setMediaPreview(objectUrl);\n setMediaUri(null);\n setMediaUploading(true);\n try {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, viaMediaRoute ? \"media\" : \"document\");\n setMediaUri(uri);\n } catch (err) {\n const t = uploadFailureToast(err);\n setErrorMsg(t.description ?? t.title);\n } finally {\n setMediaUploading(false);\n }\n };\n\n const clearMedia = () => {\n setMediaFile(null);\n setMediaPreview(null);\n setMediaUri(null);\n if (mediaInputRef.current) mediaInputRef.current.value = \"\";\n };\n\n const handleFeatureSelect = async (file: File) => {\n if (featurePreviewRef.current) URL.revokeObjectURL(featurePreviewRef.current);\n const objectUrl = URL.createObjectURL(file);\n featurePreviewRef.current = objectUrl;\n setFeaturePreview(objectUrl);\n setFeatureUri(null);\n setFeatureUploading(true);\n try {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, \"image\");\n setFeatureUri(uri);\n } catch (err) {\n const t = uploadFailureToast(err);\n setErrorMsg(t.description ?? t.title);\n } finally {\n setFeatureUploading(false);\n }\n };\n\n const handleLicenseChange = (value: string) => {\n form.setValue(\"licenseType\", value);\n const def = LICENSE_TYPES.find((l) => l.value === value);\n if (def) {\n form.setValue(\"commercialUse\", def.commercialUse);\n form.setValue(\"derivatives\", def.derivatives);\n form.setValue(\"attribution\", def.attribution);\n }\n };\n\n const ready = !!mediaUri && !mediaUploading && name.trim().length > 0 &&\n (mediaKind === \"image\" || !!featureUri) &&\n (collectionMode === \"existing\"\n ? assetType === \"single\" ? !!existingCollectionId : !!existingCollectionContract\n : newCollectionName.trim().length > 0 && newCollectionSymbol.trim().length > 0);\n\n async function pollForNewCollection(name: string, symbol: string): Promise<ApiCollection | null> {\n for (let attempt = 0; attempt < 8; attempt++) {\n const list = await refetchCollections();\n const match = list.find((c) => c.name === name && c.symbol === symbol);\n if (match?.collectionId) return match;\n await new Promise((r) => setTimeout(r, 1500));\n }\n return null;\n }\n\n const onSubmit = async (values: FormValues) => {\n if (!hasWallet) { onRequireWallet(); return; }\n if (!walletAddress || !mediaUri) return;\n if (values.external_url && !values.external_url.startsWith(\"http://\") && !values.external_url.startsWith(\"https://\")) {\n setErrorMsg(\"External link must start with http:// or https://\");\n return;\n }\n\n setStatus(\"minting\");\n setErrorMsg(null);\n\n try {\n const signer: FastMintSigner = await getSigner();\n\n const image = mediaKind === \"image\" ? mediaUri : featureUri!;\n const animationUrl = mediaKind === \"image\" ? undefined : mediaUri;\n\n const built = buildAssetMetadata({\n name: values.name,\n description: values.description || \"\",\n externalUrl: values.external_url || \"\",\n imageUri: image,\n creator: walletAddress,\n ipType,\n licenseType: values.licenseType,\n commercialUse: values.commercialUse,\n derivatives: values.derivatives,\n attribution: values.attribution,\n geographicScope: values.geographicScope,\n aiPolicy: values.aiPolicy,\n royalty: String(values.royalty),\n templateTraits: templateFieldsRef.current\n .filter(({ traitType, value }) => traitType.trim() && value.trim())\n .map(({ traitType, value }) => ({ traitType, value })),\n });\n const metadata: Record<string, unknown> = { ...built };\n if (animationUrl) metadata.animation_url = animationUrl;\n\n const uploadToken = await getUploadToken();\n if (!uploadToken) throw new Error(\"Sign in first\");\n const tokenUri = await uploadJsonToIpfs(metadata, uploadToken);\n\n let result: { txHash: string };\n let finalContractAddress: string | null;\n let finalTokenId: string | null = null;\n\n if (assetType === \"single\") {\n let collectionId = existingCollectionId;\n let contractAddress = erc721Collections.find((c) => c.collectionId === existingCollectionId)?.contractAddress ?? null;\n\n if (collectionMode === \"new\") {\n const intentRes = await client.api.createCollectionIntent({\n owner: walletAddress,\n name: newCollectionName,\n symbol: newCollectionSymbol,\n description: newCollectionDescription || undefined,\n image,\n });\n await executeIntent(provider, signer, client, intentRes.data);\n\n const found = await pollForNewCollection(newCollectionName, newCollectionSymbol);\n if (!found) throw new Error(\"Collection created, but it's still indexing — try minting again in a moment from My Collections.\");\n collectionId = found.collectionId!;\n contractAddress = found.contractAddress ?? null;\n }\n\n const intentRes = await client.api.createMintIntent({\n owner: walletAddress,\n collectionId,\n recipient: walletAddress,\n tokenUri,\n royaltyBps: Math.round(values.royalty * 100),\n });\n if (!intentRes.data.requiresSignature) {\n const calls = intentRes.data.calls;\n contractAddress = calls[calls.length - 1]?.contractAddress ?? contractAddress;\n }\n result = await executeIntent(provider, signer, client, intentRes.data);\n finalContractAddress = contractAddress;\n\n if (finalContractAddress) {\n finalTokenId = await readMintedTokenId(provider, result.txHash, finalContractAddress);\n }\n } else {\n let collectionContract = existingCollectionContract;\n\n if (collectionMode === \"new\") {\n const intentRes = await client.api.createCollectionIntent({\n owner: walletAddress,\n name: newCollectionName,\n symbol: newCollectionSymbol,\n description: newCollectionDescription || undefined,\n image,\n baseUri: \"\",\n service: \"mip-erc1155\",\n });\n const deployResult = await executeIntent(provider, signer, client, intentRes.data);\n\n let receipt: { events?: { keys?: string[] }[] } | null = null;\n for (let attempt = 0; attempt < 3 && !receipt; attempt++) {\n try {\n if (attempt > 0) await new Promise((r) => setTimeout(r, 2000));\n const raw = await provider.getTransactionReceipt(deployResult.txHash);\n receipt = raw as { events?: { keys?: string[] }[] };\n } catch { /* retry */ }\n }\n const events = receipt?.events ?? [];\n const deployEvent = events.find((e) =>\n e.keys?.[0] && BigInt(e.keys[0]) === BigInt(COLLECTION_DEPLOYED_SELECTOR)\n );\n if (!deployEvent?.keys?.[1]) throw new Error(\"Collection deployed, but its address couldn't be read — check My Collections to mint into it.\");\n collectionContract = normalizeAddress(\"STARKNET\", deployEvent.keys[1]);\n }\n\n const intentRes = await client.api.createMintIntent({\n owner: walletAddress,\n recipient: walletAddress,\n collectionContract,\n tokenUri,\n value: editionCount,\n royaltyBps: Math.round(values.royalty * 100),\n });\n result = await executeIntent(provider, signer, client, intentRes.data);\n finalContractAddress = collectionContract;\n finalTokenId = await readMintedTokenId(provider, result.txHash, collectionContract);\n }\n\n if (finalContractAddress && finalTokenId) {\n const asset: MintedAsset = { contract: finalContractAddress, tokenId: finalTokenId, image };\n setMintedAsset(asset);\n onMinted?.(asset);\n }\n setStatus(\"success\");\n } catch (err) {\n setErrorMsg(err instanceof Error ? err.message : \"Something went wrong. Please try again.\");\n setStatus(\"error\");\n }\n };\n\n const resetAll = () => {\n setStatus(\"idle\");\n setErrorMsg(null);\n setMintedAsset(null);\n form.reset();\n clearMedia();\n setFeaturePreview(null);\n setFeatureUri(null);\n setAssetType(\"single\");\n setEditionCount(\"10\");\n setCollectionMode(\"existing\");\n setExistingCollectionId(\"\");\n setExistingCollectionContract(\"\");\n setNewCollectionName(\"\");\n setNewCollectionSymbol(\"\");\n setNewCollectionDescription(\"\");\n setAutoSymbol(\"\");\n setAutoCollectionName(\"\");\n setAutoCollectionDescription(\"\");\n templateFieldsRef.current = [];\n };\n\n const busy = status === \"minting\";\n const KindIcon = MEDIA_KIND_ICON[mediaKind];\n const selectedExistingCollection = assetType === \"single\"\n ? erc721Collections.find((c) => c.collectionId === existingCollectionId)\n : erc1155Collections.find((c) => c.contractAddress === existingCollectionContract);\n const collectionLabel = mediaUri\n ? (collectionMode === \"new\"\n ? (newCollectionName || \"New collection\")\n : (selectedExistingCollection?.name || \"IP Asset\"))\n : undefined;\n\n const wrap = (node: React.ReactNode) => {\n if (presentation !== \"dialog\") return node;\n return (\n <ActionDialog open={open} onClose={onClose ?? (() => {})} width={640}>\n <div className=\"relative p-6 sm:p-8\">\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close\"\n className=\"absolute top-4 right-4 h-8 w-8 rounded-full hover:bg-muted flex items-center justify-center text-muted-foreground\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n {node}\n </div>\n </ActionDialog>\n );\n };\n\n if (status === \"success\") {\n return wrap(\n <SuccessView\n presentation={presentation}\n previewImage={mediaKind === \"image\" ? mediaPreview : featurePreview}\n name={name}\n collectionLabel={collectionLabel}\n mintedAsset={mintedAsset}\n onPublishAnother={resetAll}\n />\n );\n }\n\n if (!mediaFile) {\n return wrap(\n <Dropzone\n mediaKindLock={mediaKindLock}\n presentation={presentation}\n hasWallet={hasWallet}\n onRequireWallet={onRequireWallet}\n connectLabel={connectLabel}\n onFileSelected={handleMediaSelect}\n />\n );\n }\n\n return wrap(\n <section className=\"space-y-6\">\n <div className=\"flex items-center gap-4 rounded-xl border border-border p-3\">\n <div className=\"relative h-14 w-14 rounded-lg bg-muted overflow-hidden shrink-0\">\n {mediaKind === \"image\" && mediaPreview ? (\n <Image src={mediaPreview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <KindIcon className=\"h-6 w-6 text-muted-foreground\" />\n </div>\n )}\n {mediaUploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-1\">\n <p className=\"text-sm font-semibold truncate\">{mediaFile.name}</p>\n <div className=\"flex items-center gap-2 flex-wrap\">\n <p className=\"text-xs text-muted-foreground\">\n {mediaUploading ? \"Uploading…\" : mediaUri ? \"Uploaded\" : \"Upload failed\"}\n </p>\n {mediaUri && (() => {\n const template = IP_TEMPLATES[ipType];\n const TemplateIcon = template.icon;\n return (\n <span\n className={cn(\n \"inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs font-medium\",\n template.color.bg, template.color.text, template.color.border\n )}\n >\n <TemplateIcon className=\"h-3 w-3\" />\n {template.label}\n </span>\n );\n })()}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={() => mediaInputRef.current?.click()}\n className=\"text-xs font-semibold text-brand-blue hover:underline shrink-0\"\n >\n Change\n </button>\n <input ref={mediaInputRef} type=\"file\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) handleMediaSelect(f); }} />\n </div>\n\n {mediaUri && (\n <div className=\"grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-8 items-start\">\n <div className=\"space-y-5\">\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Title *</label>\n <Input\n value={name}\n onChange={(e) => form.setValue(\"name\", e.target.value)}\n placeholder=\"My Creative Work\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Description</label>\n <Textarea\n value={form.watch(\"description\")}\n onChange={(e) => form.setValue(\"description\", e.target.value)}\n placeholder=\"Describe your work, its story, and any context for buyers…\"\n rows={3}\n />\n </div>\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">External link <span className=\"text-muted-foreground font-normal\">(optional)</span></label>\n <Input\n value={form.watch(\"external_url\")}\n onChange={(e) => form.setValue(\"external_url\", e.target.value)}\n placeholder=\"https://yourwebsite.com\"\n />\n </div>\n\n {mediaKind !== \"image\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Upload a cover image for your asset *</label>\n <div className=\"flex items-center gap-4\">\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => !featureUploading && featureInputRef.current?.click()}\n onKeyDown={(e) => { if ((e.key === \"Enter\" || e.key === \" \") && !featureUploading) { e.preventDefault(); featureInputRef.current?.click(); } }}\n className=\"relative h-20 w-20 rounded-xl border-2 border-dashed border-border bg-muted flex items-center justify-center overflow-hidden shrink-0 cursor-pointer hover:border-primary/50 transition-colors\"\n >\n {featurePreview ? (\n <Image src={featurePreview} alt=\"\" fill className=\"object-cover\" unoptimized />\n ) : (\n <ImagePlus className=\"h-6 w-6 text-muted-foreground\" />\n )}\n {featureUploading && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-background/70\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )}\n <input ref={featureInputRef} type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) handleFeatureSelect(f); }} />\n </div>\n <p className=\"text-xs text-muted-foreground\">Cover art shown wherever the work is previewed. JPG, PNG, GIF, SVG or WebP.</p>\n </div>\n </div>\n )}\n\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Asset Type</label>\n <div className=\"grid grid-cols-2 gap-3\">\n <button\n type=\"button\"\n onClick={() => setAssetType(\"single\")}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n assetType === \"single\" ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <SingleIcon className={cn(\"h-5 w-5 shrink-0 mt-0.5\", assetType === \"single\" ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">Single Edition NFT</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">Minted once</span>\n </span>\n </button>\n <button\n type=\"button\"\n onClick={() => setAssetType(\"editions\")}\n className={cn(\"flex items-start gap-3 rounded-xl border p-4 text-left transition-colors\",\n assetType === \"editions\" ? \"border-brand-blue bg-brand-blue/5\" : \"border-border hover:bg-muted/40\")}\n >\n <Layers className={cn(\"h-5 w-5 shrink-0 mt-0.5\", assetType === \"editions\" ? \"text-brand-blue\" : \"text-muted-foreground\")} />\n <span>\n <span className=\"block text-sm font-semibold\">Limited Editions NFT</span>\n <span className=\"block text-xs mt-0.5 text-muted-foreground\">Several numbered copies</span>\n </span>\n </button>\n </div>\n </div>\n\n {assetType === \"editions\" && (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">Number of copies</label>\n <Input\n type=\"number\"\n min={1}\n value={editionCount}\n onChange={(e) => setEditionCount(e.target.value)}\n className=\"max-w-[140px]\"\n />\n </div>\n )}\n\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <label className=\"text-sm font-medium flex items-center gap-1.5\">\n <Boxes className=\"h-4 w-4\" />\n Collection *\n </label>\n <div className=\"flex rounded-lg border border-border overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setCollectionMode(\"existing\")}\n className={cn(\"px-3 h-7 text-xs font-medium transition-colors\",\n collectionMode === \"existing\" ? \"bg-primary text-primary-foreground\" : \"bg-background hover:bg-muted text-muted-foreground\")}\n >\n Existing\n </button>\n <button\n type=\"button\"\n onClick={() => setCollectionMode(\"new\")}\n className={cn(\"px-3 h-7 text-xs font-medium border-l border-border transition-colors flex items-center gap-1\",\n collectionMode === \"new\" ? \"bg-primary text-primary-foreground\" : \"bg-background hover:bg-muted text-muted-foreground\")}\n >\n <Plus className=\"h-3 w-3\" />New\n </button>\n </div>\n </div>\n\n {collectionMode === \"existing\" ? (\n <CollectionPicker\n collections={assetType === \"single\" ? erc721Collections : erc1155Collections}\n value={assetType === \"single\" ? existingCollectionId : existingCollectionContract}\n onChange={assetType === \"single\" ? setExistingCollectionId : setExistingCollectionContract}\n valueOf={collectionKey(assetType === \"single\" ? \"single\" : \"editions\")}\n />\n ) : (\n <div className=\"flex gap-3 rounded-xl border border-border p-3\">\n <div className=\"relative h-16 w-16 rounded-lg overflow-hidden bg-muted shrink-0\">\n {(mediaKind === \"image\" ? mediaPreview : featurePreview) ? (\n <Image\n src={(mediaKind === \"image\" ? mediaPreview : featurePreview)!}\n alt=\"\"\n fill\n className=\"object-cover\"\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <Boxes className=\"h-5 w-5 text-muted-foreground/40\" />\n </div>\n )}\n </div>\n <div className=\"min-w-0 flex-1 space-y-2\">\n <div className=\"grid grid-cols-[1fr_100px] gap-2\">\n <Input\n value={newCollectionName}\n onChange={(e) => setNewCollectionName(e.target.value)}\n placeholder=\"Collection name\"\n className=\"h-9 text-sm\"\n />\n <Input\n value={newCollectionSymbol}\n onChange={(e) => setNewCollectionSymbol(e.target.value.toUpperCase())}\n placeholder=\"SYMBOL\"\n className=\"h-9 text-sm\"\n />\n </div>\n <Textarea\n value={newCollectionDescription}\n onChange={(e) => setNewCollectionDescription(e.target.value)}\n placeholder=\"Describe this collection…\"\n rows={2}\n className=\"text-sm resize-none\"\n />\n <p className=\"text-2xs text-muted-foreground\">Prefilled from your asset — edit anything above.</p>\n </div>\n </div>\n )}\n </div>\n\n <Collapsible open={advancedOpen} onOpenChange={setAdvancedOpen}>\n <div className=\"rounded-xl border border-border overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <ShieldCheck className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">Licensing Terms</span>\n <span className=\"text-xs text-muted-foreground font-normal\">Optional · Berne Convention</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", advancedOpen && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">License</label>\n <Select value={form.watch(\"licenseType\")} onValueChange={handleLicenseChange}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {LICENSE_TYPES.map((l) => <SelectItem key={l.value} value={l.value}>{l.label}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Commercial use</label>\n <ToggleGroup value={form.watch(\"commercialUse\")} options={[\"Yes\", \"No\"]} onChange={(v) => form.setValue(\"commercialUse\", v as \"Yes\" | \"No\")} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Derivatives</label>\n <ToggleGroup value={form.watch(\"derivatives\")} options={DERIVATIVES_OPTIONS} onChange={(v) => form.setValue(\"derivatives\", v as FormValues[\"derivatives\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Territory</label>\n <Select value={form.watch(\"geographicScope\")} onValueChange={(v) => form.setValue(\"geographicScope\", v)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {GEOGRAPHIC_SCOPES.map((s) => <SelectItem key={s} value={s}>{s}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">AI & data mining</label>\n <ToggleGroup value={form.watch(\"aiPolicy\")} options={AI_POLICIES} onChange={(v) => form.setValue(\"aiPolicy\", v as FormValues[\"aiPolicy\"])} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">Royalty % (0–50)</label>\n <Input\n type=\"number\" min={0} max={50} step={0.5}\n value={form.watch(\"royalty\")}\n onChange={(e) => form.setValue(\"royalty\", parseFloat(e.target.value) || 0)}\n className=\"max-w-[120px]\"\n />\n </div>\n </div>\n </CollapsibleContent>\n </div>\n </Collapsible>\n\n <Collapsible open={ipTypeOpen} onOpenChange={setIpTypeOpen}>\n <div className=\"rounded-xl border border-border overflow-hidden\">\n <CollapsibleTrigger asChild>\n <button type=\"button\" className=\"w-full flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors\">\n <span className=\"flex items-center gap-2\">\n <Layers className=\"h-4 w-4 text-primary\" />\n <span className=\"text-sm font-semibold\">IP Type & Metadata</span>\n <span className=\"text-xs text-muted-foreground font-normal\">Optional</span>\n </span>\n <ChevronDown className={cn(\"h-4 w-4 text-muted-foreground transition-transform\", ipTypeOpen && \"rotate-180\")} />\n </button>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"px-4 pb-4 space-y-4 border-t border-border/60 pt-4\">\n <div className=\"space-y-1.5\">\n <label className=\"text-xs font-medium text-muted-foreground\">IP Type</label>\n <Select value={ipType} onValueChange={(v) => setIpType(v as IPType)}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>\n {IP_TYPES.map((t) => <SelectItem key={t} value={t}>{t}</SelectItem>)}\n </SelectContent>\n </Select>\n </div>\n <IPTypeFields\n ipType={ipType}\n onChange={(fields) => { templateFieldsRef.current = fields; }}\n uploadDocument={async (file) => {\n const token = await getUploadToken();\n if (!token) throw new Error(\"Sign in first\");\n const { uri } = await uploadFileToIpfs(file, token, \"document\");\n return uri;\n }}\n existingDocument={mediaKind === \"document\" && mediaUri && mediaFile ? { uri: mediaUri, name: mediaFile.name } : null}\n />\n </div>\n </CollapsibleContent>\n </div>\n </Collapsible>\n\n {status === \"error\" && errorMsg && <p className=\"text-xs text-destructive\">{errorMsg}</p>}\n\n <button\n type=\"button\"\n disabled={!ready || busy || !hasWallet}\n onClick={form.handleSubmit(onSubmit)}\n className={cn(\n \"w-full h-12 text-base font-semibold text-white rounded-xl flex items-center justify-center gap-2 transition-all hover:brightness-110 active:scale-[0.98] bg-brand-blue\",\n (!ready || busy || !hasWallet) && \"opacity-40 pointer-events-none\"\n )}\n >\n {busy ? <><Loader2 className=\"h-4 w-4 animate-spin\" />Minting…</> : assetType === \"single\" ? \"Mint NFT\" : \"Mint Editions\"}\n </button>\n <p className=\"text-xs text-center text-muted-foreground\">\n Zero platform fees to mint.\n </p>\n </div>\n\n <div className=\"order-first lg:order-last lg:sticky lg:top-20 max-w-[260px] mx-auto w-full lg:max-w-none lg:mx-0\">\n <MedialaneCollectionCard\n image={mediaKind === \"image\" ? mediaPreview : featurePreview}\n name={name}\n collection={collectionLabel}\n creator={walletAddress ? `${walletAddress.slice(0, 6)}…${walletAddress.slice(-4)}` : undefined}\n creatorHref={walletAddress ? `/account/${walletAddress}` : undefined}\n />\n </div>\n </div>\n )}\n </section>\n );\n}\n"],"mappings":";AA2GQ,SAs1Bc,UAt1Bd,KA+DE,YA/DF;AAzGR,SAAS,WAAW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EACF;AACF;","names":["name","intentRes"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var mintable_collections_exports = {};
|
|
20
|
+
__export(mintable_collections_exports, {
|
|
21
|
+
collectionKey: () => collectionKey,
|
|
22
|
+
mintableCollections: () => mintableCollections
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(mintable_collections_exports);
|
|
25
|
+
var import_sdk = require("@medialane/sdk");
|
|
26
|
+
function mintableCollections(assetType, collections) {
|
|
27
|
+
const service = assetType === "single" ? "mip-erc721" : "mip-erc1155";
|
|
28
|
+
return collections.filter((c) => (0, import_sdk.getService)(c.service)?.id === service);
|
|
29
|
+
}
|
|
30
|
+
function collectionKey(assetType) {
|
|
31
|
+
return assetType === "single" ? (c) => c.collectionId : (c) => c.contractAddress;
|
|
32
|
+
}
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
collectionKey,
|
|
36
|
+
mintableCollections
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=mintable-collections.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/mintable-collections.ts"],"sourcesContent":["import type { ApiCollection } from \"@medialane/sdk\";\nimport { getService } from \"@medialane/sdk\";\n\nexport type MintAssetType = \"single\" | \"editions\";\n\n/**\n * Collections a creator can actually mint into, for the chosen asset type.\n *\n * Only collections a Medialane factory deployed qualify. An external ERC1155 a\n * creator happens to own cannot be minted into here, and offering it produces a\n * mint that is rejected downstream rather than an explanation up front.\n */\nexport function mintableCollections(\n assetType: MintAssetType,\n collections: ApiCollection[],\n): ApiCollection[] {\n const service = assetType === \"single\" ? \"mip-erc721\" : \"mip-erc1155\";\n return collections.filter((c) => getService(c.service)?.id === service);\n}\n\n/**\n * The field identifying a collection for the chosen asset type. ERC1155\n * collections carry no collectionId, so limited editions are keyed by contract\n * address; reading the wrong field yields null and looks like \"nothing chosen\".\n */\nexport function collectionKey(\n assetType: MintAssetType,\n): (c: ApiCollection) => string | null | undefined {\n return assetType === \"single\" ? (c) => c.collectionId : (c) => c.contractAddress;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAA2B;AAWpB,SAAS,oBACd,WACA,aACiB;AACjB,QAAM,UAAU,cAAc,WAAW,eAAe;AACxD,SAAO,YAAY,OAAO,CAAC,UAAM,uBAAW,EAAE,OAAO,GAAG,OAAO,OAAO;AACxE;AAOO,SAAS,cACd,WACiD;AACjD,SAAO,cAAc,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE;AACnE;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ApiCollection } from '@medialane/sdk';
|
|
2
|
+
|
|
3
|
+
type MintAssetType = "single" | "editions";
|
|
4
|
+
/**
|
|
5
|
+
* Collections a creator can actually mint into, for the chosen asset type.
|
|
6
|
+
*
|
|
7
|
+
* Only collections a Medialane factory deployed qualify. An external ERC1155 a
|
|
8
|
+
* creator happens to own cannot be minted into here, and offering it produces a
|
|
9
|
+
* mint that is rejected downstream rather than an explanation up front.
|
|
10
|
+
*/
|
|
11
|
+
declare function mintableCollections(assetType: MintAssetType, collections: ApiCollection[]): ApiCollection[];
|
|
12
|
+
/**
|
|
13
|
+
* The field identifying a collection for the chosen asset type. ERC1155
|
|
14
|
+
* collections carry no collectionId, so limited editions are keyed by contract
|
|
15
|
+
* address; reading the wrong field yields null and looks like "nothing chosen".
|
|
16
|
+
*/
|
|
17
|
+
declare function collectionKey(assetType: MintAssetType): (c: ApiCollection) => string | null | undefined;
|
|
18
|
+
|
|
19
|
+
export { type MintAssetType, collectionKey, mintableCollections };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ApiCollection } from '@medialane/sdk';
|
|
2
|
+
|
|
3
|
+
type MintAssetType = "single" | "editions";
|
|
4
|
+
/**
|
|
5
|
+
* Collections a creator can actually mint into, for the chosen asset type.
|
|
6
|
+
*
|
|
7
|
+
* Only collections a Medialane factory deployed qualify. An external ERC1155 a
|
|
8
|
+
* creator happens to own cannot be minted into here, and offering it produces a
|
|
9
|
+
* mint that is rejected downstream rather than an explanation up front.
|
|
10
|
+
*/
|
|
11
|
+
declare function mintableCollections(assetType: MintAssetType, collections: ApiCollection[]): ApiCollection[];
|
|
12
|
+
/**
|
|
13
|
+
* The field identifying a collection for the chosen asset type. ERC1155
|
|
14
|
+
* collections carry no collectionId, so limited editions are keyed by contract
|
|
15
|
+
* address; reading the wrong field yields null and looks like "nothing chosen".
|
|
16
|
+
*/
|
|
17
|
+
declare function collectionKey(assetType: MintAssetType): (c: ApiCollection) => string | null | undefined;
|
|
18
|
+
|
|
19
|
+
export { type MintAssetType, collectionKey, mintableCollections };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getService } from "@medialane/sdk";
|
|
2
|
+
function mintableCollections(assetType, collections) {
|
|
3
|
+
const service = assetType === "single" ? "mip-erc721" : "mip-erc1155";
|
|
4
|
+
return collections.filter((c) => getService(c.service)?.id === service);
|
|
5
|
+
}
|
|
6
|
+
function collectionKey(assetType) {
|
|
7
|
+
return assetType === "single" ? (c) => c.collectionId : (c) => c.contractAddress;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
collectionKey,
|
|
11
|
+
mintableCollections
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=mintable-collections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/mintable-collections.ts"],"sourcesContent":["import type { ApiCollection } from \"@medialane/sdk\";\nimport { getService } from \"@medialane/sdk\";\n\nexport type MintAssetType = \"single\" | \"editions\";\n\n/**\n * Collections a creator can actually mint into, for the chosen asset type.\n *\n * Only collections a Medialane factory deployed qualify. An external ERC1155 a\n * creator happens to own cannot be minted into here, and offering it produces a\n * mint that is rejected downstream rather than an explanation up front.\n */\nexport function mintableCollections(\n assetType: MintAssetType,\n collections: ApiCollection[],\n): ApiCollection[] {\n const service = assetType === \"single\" ? \"mip-erc721\" : \"mip-erc1155\";\n return collections.filter((c) => getService(c.service)?.id === service);\n}\n\n/**\n * The field identifying a collection for the chosen asset type. ERC1155\n * collections carry no collectionId, so limited editions are keyed by contract\n * address; reading the wrong field yields null and looks like \"nothing chosen\".\n */\nexport function collectionKey(\n assetType: MintAssetType,\n): (c: ApiCollection) => string | null | undefined {\n return assetType === \"single\" ? (c) => c.collectionId : (c) => c.contractAddress;\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAWpB,SAAS,oBACd,WACA,aACiB;AACjB,QAAM,UAAU,cAAc,WAAW,eAAe;AACxD,SAAO,YAAY,OAAO,CAAC,MAAM,WAAW,EAAE,OAAO,GAAG,OAAO,OAAO;AACxE;AAOO,SAAS,cACd,WACiD;AACjD,SAAO,cAAc,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE;AACnE;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
17
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/fast-mint/types.ts"],"sourcesContent":["import type { Call, TypedData } from \"starknet\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport type { MedialaneClient, ReceiptProvider } from \"@medialane/sdk/starknet\";\n\nexport type MediaKind = \"image\" | \"audio\" | \"video\" | \"document\";\n\nexport interface FastMintSigner {\n readonly address: string;\n execute(calls: Call[]): Promise<{ txHash: string }>;\n signTypedData(data: TypedData): Promise<string[]>;\n}\n\nexport interface MintedAsset {\n contract: string;\n tokenId: string;\n image: string | null;\n}\n\nexport interface FastMintProps {\n presentation?: \"inline\" | \"dialog\";\n open?: boolean;\n onClose?: () => void;\n\n mediaKindLock?: MediaKind;\n onMinted?: (asset: MintedAsset) => void;\n\n collections: ApiCollection[];\n refetchCollections: () => Promise<ApiCollection[]>;\n\n hasWallet: boolean;\n walletAddress: string | null;\n onRequireWallet: () => void;\n connectLabel?: string;\n getUploadToken: () => Promise<string | null>;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n client: MedialaneClient;\n provider: ReceiptProvider;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -144,7 +144,7 @@ export { IPTypeFields, IPTypeFieldsProps, MetadataField } from './components/ip-
|
|
|
144
144
|
export { FastMint } from './components/fast-mint/fast-mint.cjs';
|
|
145
145
|
export { Dropzone, DropzoneProps } from './components/fast-mint/dropzone.cjs';
|
|
146
146
|
export { SuccessView, SuccessViewProps } from './components/fast-mint/success-view.cjs';
|
|
147
|
-
export {
|
|
147
|
+
export { FastMintProps, FastMintSigner, MediaKind, MintedAsset } from './components/fast-mint/types.cjs';
|
|
148
148
|
export { CappedBody, readBodyWithCap } from './utils/proxy-body.cjs';
|
|
149
149
|
export { FormattedEvent, formatActivity, formatAssetReceivedNotification, formatOfferAcceptedNotification, formatOrderNotification } from './utils/format-activity.cjs';
|
|
150
150
|
export { QUERY_PREFIX, queryKeyPrefix, queryKeys } from './utils/query-keys.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -144,7 +144,7 @@ export { IPTypeFields, IPTypeFieldsProps, MetadataField } from './components/ip-
|
|
|
144
144
|
export { FastMint } from './components/fast-mint/fast-mint.js';
|
|
145
145
|
export { Dropzone, DropzoneProps } from './components/fast-mint/dropzone.js';
|
|
146
146
|
export { SuccessView, SuccessViewProps } from './components/fast-mint/success-view.js';
|
|
147
|
-
export {
|
|
147
|
+
export { FastMintProps, FastMintSigner, MediaKind, MintedAsset } from './components/fast-mint/types.js';
|
|
148
148
|
export { CappedBody, readBodyWithCap } from './utils/proxy-body.js';
|
|
149
149
|
export { FormattedEvent, formatActivity, formatAssetReceivedNotification, formatOfferAcceptedNotification, formatOrderNotification } from './utils/format-activity.js';
|
|
150
150
|
export { QUERY_PREFIX, queryKeyPrefix, queryKeys } from './utils/query-keys.js';
|