@medialane/ui 0.234.0 → 0.235.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/components/account/input-otp.d.cts +2 -2
  2. package/dist/components/account/input-otp.d.ts +2 -2
  3. package/dist/components/badge.d.cts +1 -1
  4. package/dist/components/badge.d.ts +1 -1
  5. package/dist/components/button.d.cts +2 -2
  6. package/dist/components/button.d.ts +2 -2
  7. package/dist/components/fast-mint/fast-mint.d.cts +2 -2
  8. package/dist/components/fast-mint/fast-mint.d.ts +2 -2
  9. package/dist/components/launchpad/tier-mint-form.cjs +425 -0
  10. package/dist/components/launchpad/tier-mint-form.cjs.map +1 -0
  11. package/dist/components/launchpad/tier-mint-form.d.cts +13 -0
  12. package/dist/components/launchpad/tier-mint-form.d.ts +13 -0
  13. package/dist/components/launchpad/tier-mint-form.js +391 -0
  14. package/dist/components/launchpad/tier-mint-form.js.map +1 -0
  15. package/dist/components/launchpad/tier-mint-presets.cjs +96 -0
  16. package/dist/components/launchpad/tier-mint-presets.cjs.map +1 -0
  17. package/dist/components/launchpad/tier-mint-presets.d.cts +58 -0
  18. package/dist/components/launchpad/tier-mint-presets.d.ts +58 -0
  19. package/dist/components/launchpad/tier-mint-presets.js +71 -0
  20. package/dist/components/launchpad/tier-mint-presets.js.map +1 -0
  21. package/dist/components/sheet.d.cts +1 -1
  22. package/dist/components/sheet.d.ts +1 -1
  23. package/dist/index.cjs +8 -0
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +2 -0
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.js +5 -0
  28. package/dist/index.js.map +1 -1
  29. package/dist/utils/run-intent-calls.cjs +9 -2
  30. package/dist/utils/run-intent-calls.cjs.map +1 -1
  31. package/dist/utils/run-intent-calls.d.cts +10 -1
  32. package/dist/utils/run-intent-calls.d.ts +10 -1
  33. package/dist/utils/run-intent-calls.js +7 -1
  34. package/dist/utils/run-intent-calls.js.map +1 -1
  35. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import * as input_otp from 'input-otp';
2
2
  import * as React from 'react';
3
3
 
4
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
4
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
5
5
  value?: string;
6
6
  onChange?: (newValue: string) => unknown;
7
7
  maxLength: number;
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
14
14
  } & {
15
15
  render: (props: input_otp.RenderProps) => React.ReactNode;
16
16
  children?: never;
17
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
17
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
18
18
  value?: string;
19
19
  onChange?: (newValue: string) => unknown;
20
20
  maxLength: number;
@@ -1,7 +1,7 @@
1
1
  import * as input_otp from 'input-otp';
2
2
  import * as React from 'react';
3
3
 
4
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
4
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
5
5
  value?: string;
6
6
  onChange?: (newValue: string) => unknown;
7
7
  maxLength: number;
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
14
14
  } & {
15
15
  render: (props: input_otp.RenderProps) => React.ReactNode;
16
16
  children?: never;
17
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
17
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
18
18
  value?: string;
19
19
  onChange?: (newValue: string) => unknown;
20
20
  maxLength: number;
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const badgeVariants: (props?: ({
7
- variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
7
+ variant?: "default" | "secondary" | "outline" | "destructive" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
10
10
  }
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const badgeVariants: (props?: ({
7
- variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
7
+ variant?: "default" | "secondary" | "outline" | "destructive" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
10
10
  }
@@ -3,8 +3,8 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const buttonVariants: (props?: ({
6
- variant?: "ghost" | "link" | "default" | "destructive" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
- size?: "icon" | "default" | "sm" | "lg" | null | undefined;
6
+ variant?: "link" | "default" | "secondary" | "outline" | "destructive" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
+ size?: "default" | "icon" | "sm" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
10
  asChild?: boolean;
@@ -3,8 +3,8 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const buttonVariants: (props?: ({
6
- variant?: "ghost" | "link" | "default" | "destructive" | "outline" | "secondary" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
- size?: "icon" | "default" | "sm" | "lg" | null | undefined;
6
+ variant?: "link" | "default" | "secondary" | "outline" | "destructive" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
+ size?: "default" | "icon" | "sm" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
10
  asChild?: boolean;
@@ -1,10 +1,10 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as React from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { FastMintProps } from './types.cjs';
4
4
  import 'starknet';
5
5
  import '@medialane/sdk';
6
6
  import '@medialane/sdk/starknet';
7
7
 
8
- declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
8
+ declare function FastMint(props: FastMintProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
9
9
 
10
10
  export { FastMint };
@@ -1,10 +1,10 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as React from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { FastMintProps } from './types.js';
4
4
  import 'starknet';
5
5
  import '@medialane/sdk';
6
6
  import '@medialane/sdk/starknet';
7
7
 
8
- declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
8
+ declare function FastMint(props: FastMintProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
9
9
 
10
10
  export { FastMint };
@@ -0,0 +1,425 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var tier_mint_form_exports = {};
31
+ __export(tier_mint_form_exports, {
32
+ TierMintForm: () => TierMintForm
33
+ });
34
+ module.exports = __toCommonJS(tier_mint_form_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_react = require("react");
37
+ var import_react_hook_form = require("react-hook-form");
38
+ var import_zod = require("@hookform/resolvers/zod");
39
+ var z = __toESM(require("zod"), 1);
40
+ var import_lucide_react = require("lucide-react");
41
+ var import_sdk = require("@medialane/sdk");
42
+ var import_image = __toESM(require("../image.js"), 1);
43
+ var import_link = __toESM(require("../link.js"), 1);
44
+ var import_button = require("../button.js");
45
+ var import_input = require("../input.js");
46
+ var import_textarea = require("../textarea.js");
47
+ var import_skeleton = require("../skeleton.js");
48
+ var import_select = require("../select.js");
49
+ var import_collapsible = require("../collapsible.js");
50
+ var import_form = require("../form.js");
51
+ var import_create_form_primitives = require("../create-form-primitives.js");
52
+ var import_claim_route_shell = require("../claim-route-shell.js");
53
+ var import_creation_success = require("../creation-success.js");
54
+ var import_medialane_collection_card = require("../medialane-collection-card.js");
55
+ var import_transaction_dialog = require("../transaction-dialog.js");
56
+ var import_wallet_required = require("../wallet-required.js");
57
+ var import_medialane_app = require("../medialane-app.js");
58
+ var import_reward_earned = require("../rewards/reward-earned.js");
59
+ var import_ip = require("../../data/ip.js");
60
+ var import_cn = require("../../utils/cn.js");
61
+ var import_run_intent_calls = require("../../utils/run-intent-calls.js");
62
+ var import_ipfs_upload = require("../../utils/ipfs-upload.js");
63
+ var import_use_collections = require("../../utils/use-collections.js");
64
+ var import_use_profiles = require("../../utils/use-profiles.js");
65
+ var import_use_transaction = require("../../utils/use-transaction.js");
66
+ var import_use_launchpad_image_upload = require("../../utils/use-launchpad-image-upload.js");
67
+ function dateToUnixTimestamp(dateStr) {
68
+ if (!dateStr) return void 0;
69
+ const d = new Date(dateStr);
70
+ if (isNaN(d.getTime())) return void 0;
71
+ return Math.floor(d.getTime() / 1e3);
72
+ }
73
+ function makeSchema(preset) {
74
+ return z.object({
75
+ name: z.string().min(1, preset.copy.nameRequired).max(import_sdk.FIELD_LIMITS.name),
76
+ description: z.string().max(import_sdk.FIELD_LIMITS.description).optional(),
77
+ external_url: z.string().max(500).refine((v) => !v || v.startsWith("http://") || v.startsWith("https://"), { message: "Must start with http:// or https://" }).optional(),
78
+ maxSupply: z.string().min(1, "Supply required").regex(/^\d+$/, "Must be a positive integer").refine((v) => parseInt(v, 10) >= 1, "Minimum supply is 1"),
79
+ royalty: z.coerce.number().min(0).max(50).default(2.5),
80
+ licenseType: z.string().min(1),
81
+ commercialUse: z.enum(["Yes", "No"]),
82
+ derivatives: z.enum(["Allowed", "Not Allowed", "Share-Alike"]),
83
+ attribution: z.enum(["Required", "Not Required"]),
84
+ geographicScope: z.string(),
85
+ aiPolicy: z.enum(["Allowed", "Not Allowed", "Training Only"]),
86
+ startDate: z.string().optional(),
87
+ endDate: z.string().optional(),
88
+ imageUri: z.string().min(1, preset.copy.imageRequired)
89
+ });
90
+ }
91
+ function TierMintForm({ contract: rawContract, preset, aside }) {
92
+ const app = (0, import_medialane_app.useMedialaneApp)();
93
+ const address = app.walletAddress;
94
+ const contract = (0, import_sdk.normalizeAddress)("STARKNET", rawContract);
95
+ const { collection, isLoading } = (0, import_use_collections.useCollection)(contract);
96
+ const { profile, isLoading: profileLoading } = (0, import_use_profiles.useCollectionProfile)(preset.suggestExternalLink ? contract : void 0);
97
+ const tx = (0, import_use_transaction.useTransaction)();
98
+ const upload = (0, import_use_launchpad_image_upload.useLaunchpadImageUpload)({ successMessage: "Image uploaded" });
99
+ const { imagePreview, imageUri, imageUploading, uploadError, fileInputRef, handleImageSelect, clearImage } = upload;
100
+ const [licensingOpen, setLicensingOpen] = (0, import_react.useState)(false);
101
+ const [advancedOpen, setAdvancedOpen] = (0, import_react.useState)(false);
102
+ const Icon = preset.icon;
103
+ const form = (0, import_react_hook_form.useForm)({
104
+ resolver: (0, import_zod.zodResolver)(makeSchema(preset)),
105
+ defaultValues: {
106
+ name: "",
107
+ imageUri: "",
108
+ description: "",
109
+ external_url: "",
110
+ maxSupply: "100",
111
+ royalty: 2.5,
112
+ licenseType: "CC BY-SA",
113
+ commercialUse: "Yes",
114
+ derivatives: "Share-Alike",
115
+ attribution: "Required",
116
+ geographicScope: "Worldwide",
117
+ aiPolicy: "Not Allowed"
118
+ }
119
+ });
120
+ (0, import_react.useEffect)(() => {
121
+ form.setValue("imageUri", imageUri ?? "", { shouldValidate: !!imageUri });
122
+ }, [imageUri, form]);
123
+ (0, import_react.useEffect)(() => {
124
+ if (!preset.suggestExternalLink || profileLoading) return;
125
+ const suggested = profile?.slug ? `https://medialane.io/collection/${profile.slug}` : `https://medialane.io${(0, import_sdk.collectionHref)("STARKNET", contract)}`;
126
+ if (!form.getValues("external_url")) form.setValue("external_url", suggested);
127
+ }, [contract, profileLoading, profile?.slug, form, preset.suggestExternalLink]);
128
+ const isOwner = !!address && !!collection?.owner && (0, import_sdk.normalizeAddress)("STARKNET", address) === (0, import_sdk.normalizeAddress)("STARKNET", collection.owner);
129
+ const handleAgain = () => {
130
+ tx.reset();
131
+ form.reset({ ...form.getValues(), name: "", description: "", maxSupply: "100" });
132
+ clearImage();
133
+ };
134
+ const onSubmit = (values) => {
135
+ if (!address) return;
136
+ void tx.run(async (signer) => {
137
+ await app.ensureSignedIn?.();
138
+ const api = app.getClient().api;
139
+ const pinned = await (0, import_ipfs_upload.pinAssetMetadata)(api, {
140
+ name: values.name,
141
+ description: values.description ?? "",
142
+ imageUri,
143
+ externalUrl: values.external_url,
144
+ ipType: "NFT",
145
+ licenseType: values.licenseType,
146
+ commercialUse: values.commercialUse,
147
+ derivatives: values.derivatives,
148
+ attribution: values.attribution,
149
+ geographicScope: values.geographicScope,
150
+ aiPolicy: values.aiPolicy,
151
+ royalty: String(values.royalty),
152
+ creator: address,
153
+ templateTraits: [
154
+ { traitType: "Type", value: preset.traitType },
155
+ { traitType: "Token Standard", value: "ERC-1155" },
156
+ { traitType: "Max Supply", value: values.maxSupply },
157
+ { traitType: "Collection Contract", value: contract }
158
+ ]
159
+ });
160
+ const tierId = await preset.predictNextId(api, contract);
161
+ const tierRes = await api.intents.create("create-tier", {
162
+ owner: address,
163
+ collection: contract,
164
+ service: preset.service,
165
+ maxSupply: values.maxSupply,
166
+ startTime: dateToUnixTimestamp(values.startDate),
167
+ endTime: dateToUnixTimestamp(values.endDate),
168
+ royaltyBps: Math.round(values.royalty * 100),
169
+ metadataUri: pinned.uri
170
+ });
171
+ const mintRes = await api.intents.create("mint", {
172
+ owner: address,
173
+ recipient: address,
174
+ collectionContract: contract,
175
+ tokenId: String(tierId),
176
+ amount: values.maxSupply
177
+ });
178
+ await (0, import_run_intent_calls.runIntentsCalls)(signer, [tierRes, mintRes]);
179
+ });
180
+ };
181
+ const gateProps = { icon: Icon, iconClassName: preset.iconClass, title: preset.signedOut.title, description: preset.signedOut.description };
182
+ const inputId = `mint-${preset.service}-file-input`;
183
+ const busy = tx.phase !== "idle" || imageUploading;
184
+ if (isLoading) {
185
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_wallet_required.WalletRequired, { ...gateProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-5xl mx-auto px-4 pt-10 pb-16 space-y-4", children: [
186
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-6 w-24" }),
187
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-32 w-full rounded-2xl" }),
188
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-64 w-full rounded-2xl" })
189
+ ] }) });
190
+ }
191
+ if (!collection) {
192
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_wallet_required.WalletRequired, { ...gateProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
193
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
194
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: "Collection not found." }),
195
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: preset.back.href, children: preset.back.label }) })
196
+ ] }) });
197
+ }
198
+ if (!isOwner) {
199
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_wallet_required.WalletRequired, { ...gateProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
200
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-10 w-10 text-muted-foreground/20 mx-auto" }),
201
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: preset.notOwner.message }),
202
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: preset.notOwner.back.href, children: preset.notOwner.back.label }) })
203
+ ] }) });
204
+ }
205
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_wallet_required.WalletRequired, { ...gateProps, children: [
206
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: preset.dialog.title, workingLabel: preset.dialog.workingLabel, firstStepLabel: preset.dialog.firstStepLabel, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
207
+ import_creation_success.CreationSuccess,
208
+ {
209
+ name: form.getValues("name"),
210
+ image: imagePreview,
211
+ caption: preset.success.caption,
212
+ primary: { href: (0, import_sdk.collectionHref)("STARKNET", contract), label: "View collection" },
213
+ onAgain: handleAgain,
214
+ againLabel: preset.success.againLabel,
215
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reward_earned.RewardEarned, { actionType: "launch_launchpad" })
216
+ }
217
+ ) }),
218
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
219
+ import_claim_route_shell.ClaimRouteShell,
220
+ {
221
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-4 w-4 text-white" }),
222
+ title: preset.shell.title,
223
+ subtitle: preset.shell.subtitle(collection.name ?? null),
224
+ aside: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
225
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
226
+ import_medialane_collection_card.MedialaneCollectionCard,
227
+ {
228
+ image: imagePreview,
229
+ name: form.watch("name"),
230
+ collection: collection.symbol || preset.cardFallbackSymbol,
231
+ creator: address ? `${address.slice(0, 6)}\u2026${address.slice(-4)}` : void 0,
232
+ creatorHref: address ? (0, import_sdk.profileHref)({ address }) : void 0
233
+ }
234
+ ),
235
+ aside
236
+ ] }),
237
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.Form, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-5", children: [
238
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
239
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm font-medium", children: [
240
+ preset.copy.imageHeading,
241
+ " ",
242
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-destructive", children: "*" })
243
+ ] }),
244
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [
245
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
246
+ "div",
247
+ {
248
+ role: "button",
249
+ tabIndex: 0,
250
+ onClick: () => !imageUploading && fileInputRef.current?.click(),
251
+ onKeyDown: (e) => {
252
+ if (e.key === "Enter") fileInputRef.current?.click();
253
+ },
254
+ className: (0, import_cn.cn)("relative h-20 w-20 rounded-2xl border-2 border-dashed border-border bg-muted flex items-center justify-center overflow-hidden shrink-0 cursor-pointer transition-colors", preset.hoverBorderClass),
255
+ children: [
256
+ imagePreview ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: imagePreview, alt: preset.copy.imageAlt, fill: true, unoptimized: true, className: "object-cover" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ImagePlus, { className: "h-6 w-6 text-muted-foreground" }),
257
+ imageUploading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-background/70 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-4 w-4 animate-spin" }) })
258
+ ]
259
+ }
260
+ ),
261
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
262
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { id: inputId, ref: fileInputRef, type: "file", accept: (0, import_sdk.acceptFor)("image"), className: "hidden", onChange: (e) => {
263
+ const f = e.target.files?.[0];
264
+ if (f) void handleImageSelect(f);
265
+ } }),
266
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { type: "button", variant: "outline", size: "sm", disabled: imageUploading, onClick: () => fileInputRef.current?.click(), children: imageUploading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
267
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-3.5 w-3.5 mr-1.5 animate-spin" }),
268
+ "Uploading\u2026"
269
+ ] }) : imagePreview ? "Change" : "Upload image" }),
270
+ imagePreview && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", onClick: clearImage, className: "flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors", children: [
271
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-3 w-3" }),
272
+ " Remove"
273
+ ] }),
274
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: imageUri ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: preset.uploadedClass, children: "\u2713 Uploaded" }) : "JPG, PNG, SVG or WebP" })
275
+ ] })
276
+ ] })
277
+ ] }),
278
+ (uploadError || form.formState.errors.imageUri) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: uploadError ?? form.formState.errors.imageUri?.message }),
279
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "name", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
280
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
281
+ preset.copy.nameLabel,
282
+ " ",
283
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-destructive", children: "*" })
284
+ ] }),
285
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { placeholder: preset.copy.namePlaceholder, ...field }) }),
286
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
287
+ ] }) }),
288
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "description", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
289
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
290
+ "Description ",
291
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
292
+ ] }),
293
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_textarea.Textarea, { placeholder: preset.copy.descriptionPlaceholder, rows: 3, ...field }) }),
294
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
295
+ ] }) }),
296
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "external_url", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
297
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
298
+ "External link ",
299
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
300
+ ] }),
301
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { placeholder: "https://yourwebsite.com", ...field }) }),
302
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
303
+ ] }) }),
304
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collapsible.Collapsible, { open: licensingOpen, onOpenChange: setLicensingOpen, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sm:overflow-hidden sm:rounded-xl sm:border sm:border-border", children: [
305
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collapsible.CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "w-full flex items-center justify-between px-0 py-3 sm:px-5 sm:py-4 hover:bg-muted/30 transition-colors", children: [
306
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
307
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ShieldCheck, { className: "h-4 w-4 text-primary" }),
308
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm font-semibold", children: "Licensing Terms" }),
309
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs text-muted-foreground font-normal", children: "Optional \xB7 Berne Convention" })
310
+ ] }),
311
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronDown, { className: (0, import_cn.cn)("h-4 w-4 text-muted-foreground transition-transform", licensingOpen && "rotate-180") })
312
+ ] }) }),
313
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collapsible.CollapsibleContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "px-0 pb-4 sm:px-5 sm:pb-5 space-y-4 border-t border-border/60 pt-4", children: [
314
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "licenseType", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
315
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "License" }),
316
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_select.Select, { value: field.value, onValueChange: (value) => {
317
+ form.setValue("licenseType", value);
318
+ const def = import_ip.LICENSE_TYPES.find((l) => l.value === value);
319
+ if (def) {
320
+ form.setValue("commercialUse", def.commercialUse);
321
+ form.setValue("derivatives", def.derivatives);
322
+ form.setValue("attribution", def.attribution);
323
+ }
324
+ }, children: [
325
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectValue, {}) }) }),
326
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectContent, { children: import_ip.LICENSE_TYPES.map((l) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectItem, { value: l.value, children: l.label }, l.value)) })
327
+ ] }),
328
+ (() => {
329
+ const def = import_ip.LICENSE_TYPES.find((l) => l.value === field.value);
330
+ return def ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground mt-1", children: def.description }) : null;
331
+ })(),
332
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
333
+ ] }) }),
334
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "commercialUse", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
335
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "Commercial Use" }),
336
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: field.value, options: ["Yes", "No"], onChange: field.onChange })
337
+ ] }) }),
338
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "derivatives", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
339
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "Derivatives" }),
340
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: field.value, options: import_ip.DERIVATIVES_OPTIONS, onChange: field.onChange })
341
+ ] }) }),
342
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "attribution", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
343
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "Attribution" }),
344
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: field.value, options: ["Required", "Not Required"], onChange: field.onChange })
345
+ ] }) }),
346
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_collapsible.Collapsible, { open: advancedOpen, onOpenChange: setAdvancedOpen, children: [
347
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_collapsible.CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors", children: [
348
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronDown, { className: (0, import_cn.cn)("h-3.5 w-3.5 transition-transform", advancedOpen && "rotate-180") }),
349
+ "Advanced options"
350
+ ] }) }),
351
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_collapsible.CollapsibleContent, { className: "space-y-4 pt-3", children: [
352
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "geographicScope", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
353
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "Territory" }),
354
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_select.Select, { onValueChange: field.onChange, value: field.value, children: [
355
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectValue, {}) }) }),
356
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectContent, { children: import_ip.GEOGRAPHIC_SCOPES.map((s) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectItem, { value: s, children: s }, s)) })
357
+ ] })
358
+ ] }) }),
359
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "aiPolicy", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
360
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "AI & Data Mining" }),
361
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: field.value, options: import_ip.AI_POLICIES, onChange: field.onChange })
362
+ ] }) })
363
+ ] })
364
+ ] })
365
+ ] }) })
366
+ ] }) }),
367
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
368
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "maxSupply", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
369
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
370
+ "Supply ",
371
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-destructive", children: "*" })
372
+ ] }),
373
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "number", min: "1", placeholder: "100", ...field }) }),
374
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormDescription, { children: "Minted to your account." }),
375
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
376
+ ] }) }),
377
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "royalty", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
378
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormLabel, { children: "Royalty % (0\u201350)" }),
379
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "number", min: 0, max: 50, step: 0.5, placeholder: "2.5", ...field, onChange: (e) => field.onChange(parseFloat(e.target.value) || 0) }) }),
380
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormDescription, { children: "On secondary sales." }),
381
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
382
+ ] }) })
383
+ ] }),
384
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
385
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "startDate", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
386
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
387
+ "Valid from ",
388
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
389
+ ] }),
390
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "datetime-local", ...field }) }),
391
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormDescription, { children: "You can mint and sell before it opens." }),
392
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
393
+ ] }) }),
394
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormField, { control: form.control, name: "endDate", render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormItem, { children: [
395
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_form.FormLabel, { children: [
396
+ "Valid until ",
397
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
398
+ ] }),
399
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { type: "datetime-local", ...field }) }),
400
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormDescription, { children: preset.copy.validUntilHint }),
401
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.FormMessage, {})
402
+ ] }) })
403
+ ] }),
404
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
405
+ "button",
406
+ {
407
+ type: "submit",
408
+ disabled: busy,
409
+ className: `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] ${preset.buttonClass} ${busy ? "opacity-40 pointer-events-none" : ""}`,
410
+ children: [
411
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-4 w-4 mr-2" }),
412
+ preset.copy.submit
413
+ ]
414
+ }
415
+ )
416
+ ] }) })
417
+ }
418
+ )
419
+ ] });
420
+ }
421
+ // Annotate the CommonJS export names for ESM import in node:
422
+ 0 && (module.exports = {
423
+ TierMintForm
424
+ });
425
+ //# sourceMappingURL=tier-mint-form.cjs.map