@medialane/ui 0.183.0 → 0.185.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 (259) hide show
  1. package/dist/components/drop/create/artwork-section.cjs +115 -0
  2. package/dist/components/drop/create/artwork-section.cjs.map +1 -0
  3. package/dist/components/drop/create/artwork-section.d.cts +23 -0
  4. package/dist/components/drop/create/artwork-section.d.ts +23 -0
  5. package/dist/components/drop/create/artwork-section.js +79 -0
  6. package/dist/components/drop/create/artwork-section.js.map +1 -0
  7. package/dist/components/drop/create/details-section.cjs +110 -0
  8. package/dist/components/drop/create/details-section.cjs.map +1 -0
  9. package/dist/components/drop/create/details-section.d.cts +11 -0
  10. package/dist/components/drop/create/details-section.d.ts +11 -0
  11. package/dist/components/drop/create/details-section.js +86 -0
  12. package/dist/components/drop/create/details-section.js.map +1 -0
  13. package/dist/components/drop/create/drop-create.cjs +114 -0
  14. package/dist/components/drop/create/drop-create.cjs.map +1 -0
  15. package/dist/components/drop/create/drop-create.d.cts +20 -0
  16. package/dist/components/drop/create/drop-create.d.ts +20 -0
  17. package/dist/components/drop/create/drop-create.js +79 -0
  18. package/dist/components/drop/create/drop-create.js.map +1 -0
  19. package/dist/components/drop/create/exclusive-fields.cjs +45 -0
  20. package/dist/components/drop/create/exclusive-fields.cjs.map +1 -0
  21. package/dist/components/drop/create/exclusive-fields.d.cts +14 -0
  22. package/dist/components/drop/create/exclusive-fields.d.ts +14 -0
  23. package/dist/components/drop/create/exclusive-fields.js +21 -0
  24. package/dist/components/drop/create/exclusive-fields.js.map +1 -0
  25. package/dist/components/drop/create/launch-dialog.cjs +196 -0
  26. package/dist/components/drop/create/launch-dialog.cjs.map +1 -0
  27. package/dist/components/drop/create/launch-dialog.d.cts +21 -0
  28. package/dist/components/drop/create/launch-dialog.d.ts +21 -0
  29. package/dist/components/drop/create/launch-dialog.js +171 -0
  30. package/dist/components/drop/create/launch-dialog.js.map +1 -0
  31. package/dist/components/drop/create/list-section.cjs +67 -0
  32. package/dist/components/drop/create/list-section.cjs.map +1 -0
  33. package/dist/components/drop/create/list-section.d.cts +11 -0
  34. package/dist/components/drop/create/list-section.d.ts +11 -0
  35. package/dist/components/drop/create/list-section.js +43 -0
  36. package/dist/components/drop/create/list-section.js.map +1 -0
  37. package/dist/components/drop/create/sale-section.cjs +78 -0
  38. package/dist/components/drop/create/sale-section.cjs.map +1 -0
  39. package/dist/components/drop/create/sale-section.d.cts +13 -0
  40. package/dist/components/drop/create/sale-section.d.ts +13 -0
  41. package/dist/components/drop/create/sale-section.js +54 -0
  42. package/dist/components/drop/create/sale-section.js.map +1 -0
  43. package/dist/components/drop/drop-card.cjs +81 -0
  44. package/dist/components/drop/drop-card.cjs.map +1 -0
  45. package/dist/components/drop/drop-card.d.cts +18 -0
  46. package/dist/components/drop/drop-card.d.ts +18 -0
  47. package/dist/components/drop/drop-card.js +45 -0
  48. package/dist/components/drop/drop-card.js.map +1 -0
  49. package/dist/components/drop/drop-features.cjs +44 -0
  50. package/dist/components/drop/drop-features.cjs.map +1 -0
  51. package/dist/components/drop/drop-features.d.cts +5 -0
  52. package/dist/components/drop/drop-features.d.ts +5 -0
  53. package/dist/components/drop/drop-features.js +20 -0
  54. package/dist/components/drop/drop-features.js.map +1 -0
  55. package/dist/components/drop/drop-listing.cjs +79 -0
  56. package/dist/components/drop/drop-listing.cjs.map +1 -0
  57. package/dist/components/drop/drop-listing.d.cts +10 -0
  58. package/dist/components/drop/drop-listing.d.ts +10 -0
  59. package/dist/components/drop/drop-listing.js +45 -0
  60. package/dist/components/drop/drop-listing.js.map +1 -0
  61. package/dist/components/{drop-status-display.cjs → drop/drop-status.cjs} +12 -43
  62. package/dist/components/drop/drop-status.cjs.map +1 -0
  63. package/dist/components/drop/drop-status.d.cts +13 -0
  64. package/dist/components/drop/drop-status.d.ts +13 -0
  65. package/dist/components/drop/drop-status.js +47 -0
  66. package/dist/components/drop/drop-status.js.map +1 -0
  67. package/dist/components/drop/drop-token-link.cjs +63 -0
  68. package/dist/components/drop/drop-token-link.cjs.map +1 -0
  69. package/dist/components/drop/drop-token-link.d.cts +9 -0
  70. package/dist/components/drop/drop-token-link.d.ts +9 -0
  71. package/dist/components/drop/drop-token-link.js +29 -0
  72. package/dist/components/drop/drop-token-link.js.map +1 -0
  73. package/dist/components/drop/my-drops.cjs +71 -0
  74. package/dist/components/drop/my-drops.cjs.map +1 -0
  75. package/dist/components/drop/my-drops.d.cts +12 -0
  76. package/dist/components/drop/my-drops.d.ts +12 -0
  77. package/dist/components/drop/my-drops.js +37 -0
  78. package/dist/components/drop/my-drops.js.map +1 -0
  79. package/dist/components/drop/page/drop-action-box.cjs +63 -0
  80. package/dist/components/drop/page/drop-action-box.cjs.map +1 -0
  81. package/dist/components/drop/page/drop-action-box.d.cts +15 -0
  82. package/dist/components/drop/page/drop-action-box.d.ts +15 -0
  83. package/dist/components/drop/page/drop-action-box.js +39 -0
  84. package/dist/components/drop/page/drop-action-box.js.map +1 -0
  85. package/dist/components/drop/page/drop-activity.cjs +42 -0
  86. package/dist/components/drop/page/drop-activity.cjs.map +1 -0
  87. package/dist/components/drop/page/drop-activity.d.cts +8 -0
  88. package/dist/components/drop/page/drop-activity.d.ts +8 -0
  89. package/dist/components/drop/page/drop-activity.js +18 -0
  90. package/dist/components/drop/page/drop-activity.js.map +1 -0
  91. package/dist/components/drop/page/drop-manage.cjs +161 -0
  92. package/dist/components/drop/page/drop-manage.cjs.map +1 -0
  93. package/dist/components/drop/page/drop-manage.d.cts +24 -0
  94. package/dist/components/drop/page/drop-manage.d.ts +24 -0
  95. package/dist/components/drop/page/drop-manage.js +137 -0
  96. package/dist/components/drop/page/drop-manage.js.map +1 -0
  97. package/dist/components/drop/page/drop-mint-dialog.cjs +97 -0
  98. package/dist/components/drop/page/drop-mint-dialog.cjs.map +1 -0
  99. package/dist/components/drop/page/drop-mint-dialog.d.cts +15 -0
  100. package/dist/components/drop/page/drop-mint-dialog.d.ts +15 -0
  101. package/dist/components/drop/page/drop-mint-dialog.js +73 -0
  102. package/dist/components/drop/page/drop-mint-dialog.js.map +1 -0
  103. package/dist/components/drop/page/drop-page.cjs +167 -0
  104. package/dist/components/drop/page/drop-page.cjs.map +1 -0
  105. package/dist/components/drop/page/drop-page.d.cts +15 -0
  106. package/dist/components/drop/page/drop-page.d.ts +15 -0
  107. package/dist/components/drop/page/drop-page.js +133 -0
  108. package/dist/components/drop/page/drop-page.js.map +1 -0
  109. package/dist/components/image.d.cts +2 -0
  110. package/dist/components/image.d.ts +2 -0
  111. package/dist/index.cjs +54 -30
  112. package/dist/index.cjs.map +1 -1
  113. package/dist/index.d.cts +21 -11
  114. package/dist/index.d.ts +21 -11
  115. package/dist/index.js +34 -25
  116. package/dist/index.js.map +1 -1
  117. package/dist/utils/drop/actions.cjs +76 -0
  118. package/dist/utils/drop/actions.cjs.map +1 -0
  119. package/dist/utils/drop/actions.d.cts +46 -0
  120. package/dist/utils/drop/actions.d.ts +46 -0
  121. package/dist/utils/drop/actions.js +49 -0
  122. package/dist/utils/drop/actions.js.map +1 -0
  123. package/dist/utils/drop/allowlist.cjs +50 -0
  124. package/dist/utils/drop/allowlist.cjs.map +1 -0
  125. package/dist/utils/drop/allowlist.d.cts +10 -0
  126. package/dist/utils/drop/allowlist.d.ts +10 -0
  127. package/dist/utils/drop/allowlist.js +26 -0
  128. package/dist/utils/drop/allowlist.js.map +1 -0
  129. package/dist/utils/drop/chain.cjs +37 -0
  130. package/dist/utils/drop/chain.cjs.map +1 -0
  131. package/dist/utils/drop/chain.d.cts +5 -0
  132. package/dist/utils/drop/chain.d.ts +5 -0
  133. package/dist/utils/drop/chain.js +13 -0
  134. package/dist/utils/drop/chain.js.map +1 -0
  135. package/dist/utils/drop/claim-proof.cjs +48 -0
  136. package/dist/utils/drop/claim-proof.cjs.map +1 -0
  137. package/dist/utils/drop/claim-proof.d.cts +9 -0
  138. package/dist/utils/drop/claim-proof.d.ts +9 -0
  139. package/dist/utils/drop/claim-proof.js +24 -0
  140. package/dist/utils/drop/claim-proof.js.map +1 -0
  141. package/dist/utils/drop/draft.cjs +87 -0
  142. package/dist/utils/drop/draft.cjs.map +1 -0
  143. package/dist/utils/drop/draft.d.cts +32 -0
  144. package/dist/utils/drop/draft.d.ts +32 -0
  145. package/dist/utils/drop/draft.js +61 -0
  146. package/dist/utils/drop/draft.js.map +1 -0
  147. package/dist/utils/drop/metadata.cjs +70 -0
  148. package/dist/utils/drop/metadata.cjs.map +1 -0
  149. package/dist/utils/drop/metadata.d.cts +34 -0
  150. package/dist/utils/drop/metadata.d.ts +34 -0
  151. package/dist/utils/drop/metadata.js +43 -0
  152. package/dist/utils/drop/metadata.js.map +1 -0
  153. package/dist/utils/{drop-status.cjs → drop/preview.cjs} +14 -14
  154. package/dist/utils/drop/preview.cjs.map +1 -0
  155. package/dist/utils/drop/preview.d.cts +4 -0
  156. package/dist/utils/drop/preview.d.ts +4 -0
  157. package/dist/utils/drop/preview.js +13 -0
  158. package/dist/utils/drop/preview.js.map +1 -0
  159. package/dist/utils/drop/receipt.cjs +39 -0
  160. package/dist/utils/drop/receipt.cjs.map +1 -0
  161. package/dist/utils/drop/receipt.d.cts +6 -0
  162. package/dist/utils/drop/receipt.d.ts +6 -0
  163. package/dist/utils/drop/receipt.js +15 -0
  164. package/dist/utils/drop/receipt.js.map +1 -0
  165. package/dist/utils/drop/sale.cjs +108 -0
  166. package/dist/utils/drop/sale.cjs.map +1 -0
  167. package/dist/utils/drop/sale.d.cts +52 -0
  168. package/dist/utils/drop/sale.d.ts +52 -0
  169. package/dist/utils/drop/sale.js +78 -0
  170. package/dist/utils/drop/sale.js.map +1 -0
  171. package/dist/utils/drop/types.cjs +17 -0
  172. package/dist/utils/drop/types.cjs.map +1 -0
  173. package/dist/utils/drop/types.d.cts +20 -0
  174. package/dist/utils/drop/types.d.ts +20 -0
  175. package/dist/utils/drop/types.js +1 -0
  176. package/dist/utils/drop/types.js.map +1 -0
  177. package/dist/utils/drop/upload.cjs +48 -0
  178. package/dist/utils/drop/upload.cjs.map +1 -0
  179. package/dist/utils/drop/upload.d.cts +11 -0
  180. package/dist/utils/drop/upload.d.ts +11 -0
  181. package/dist/utils/drop/upload.js +24 -0
  182. package/dist/utils/drop/upload.js.map +1 -0
  183. package/dist/utils/drop/use-now.cjs +38 -0
  184. package/dist/utils/drop/use-now.cjs.map +1 -0
  185. package/dist/utils/drop/use-now.d.cts +4 -0
  186. package/dist/utils/drop/use-now.d.ts +4 -0
  187. package/dist/utils/drop/use-now.js +14 -0
  188. package/dist/utils/drop/use-now.js.map +1 -0
  189. package/dist/utils/drop/view.cjs +89 -0
  190. package/dist/utils/drop/view.cjs.map +1 -0
  191. package/dist/utils/drop/view.d.cts +34 -0
  192. package/dist/utils/drop/view.d.ts +34 -0
  193. package/dist/utils/drop/view.js +64 -0
  194. package/dist/utils/drop/view.js.map +1 -0
  195. package/dist/utils/launchpad-defaults.cjs +0 -22
  196. package/dist/utils/launchpad-defaults.cjs.map +1 -1
  197. package/dist/utils/launchpad-defaults.d.cts +1 -7
  198. package/dist/utils/launchpad-defaults.d.ts +1 -7
  199. package/dist/utils/launchpad-defaults.js +0 -21
  200. package/dist/utils/launchpad-defaults.js.map +1 -1
  201. package/dist/utils/use-drops.cjs +48 -45
  202. package/dist/utils/use-drops.cjs.map +1 -1
  203. package/dist/utils/use-drops.d.cts +33 -23
  204. package/dist/utils/use-drops.d.ts +33 -23
  205. package/dist/utils/use-drops.js +41 -40
  206. package/dist/utils/use-drops.js.map +1 -1
  207. package/package.json +3 -3
  208. package/dist/components/account/account.test.cjs +0 -86
  209. package/dist/components/account/account.test.cjs.map +0 -1
  210. package/dist/components/account/account.test.d.cts +0 -2
  211. package/dist/components/account/account.test.d.ts +0 -2
  212. package/dist/components/account/account.test.js +0 -85
  213. package/dist/components/account/account.test.js.map +0 -1
  214. package/dist/components/drop-create-form.cjs +0 -341
  215. package/dist/components/drop-create-form.cjs.map +0 -1
  216. package/dist/components/drop-create-form.d.cts +0 -39
  217. package/dist/components/drop-create-form.d.ts +0 -39
  218. package/dist/components/drop-create-form.js +0 -322
  219. package/dist/components/drop-create-form.js.map +0 -1
  220. package/dist/components/drop-preview-card.cjs +0 -106
  221. package/dist/components/drop-preview-card.cjs.map +0 -1
  222. package/dist/components/drop-preview-card.d.cts +0 -17
  223. package/dist/components/drop-preview-card.d.ts +0 -17
  224. package/dist/components/drop-preview-card.js +0 -82
  225. package/dist/components/drop-preview-card.js.map +0 -1
  226. package/dist/components/drop-preview-card.test.cjs +0 -84
  227. package/dist/components/drop-preview-card.test.cjs.map +0 -1
  228. package/dist/components/drop-preview-card.test.d.cts +0 -3
  229. package/dist/components/drop-preview-card.test.d.ts +0 -3
  230. package/dist/components/drop-preview-card.test.js +0 -83
  231. package/dist/components/drop-preview-card.test.js.map +0 -1
  232. package/dist/components/drop-status-display.cjs.map +0 -1
  233. package/dist/components/drop-status-display.d.cts +0 -15
  234. package/dist/components/drop-status-display.d.ts +0 -15
  235. package/dist/components/drop-status-display.js +0 -77
  236. package/dist/components/drop-status-display.js.map +0 -1
  237. package/dist/components/drop-status-display.test.cjs +0 -29
  238. package/dist/components/drop-status-display.test.cjs.map +0 -1
  239. package/dist/components/drop-status-display.test.d.cts +0 -2
  240. package/dist/components/drop-status-display.test.d.ts +0 -2
  241. package/dist/components/drop-status-display.test.js +0 -28
  242. package/dist/components/drop-status-display.test.js.map +0 -1
  243. package/dist/components/exclusive-content-section.cjs +0 -88
  244. package/dist/components/exclusive-content-section.cjs.map +0 -1
  245. package/dist/components/exclusive-content-section.d.cts +0 -10
  246. package/dist/components/exclusive-content-section.d.ts +0 -10
  247. package/dist/components/exclusive-content-section.js +0 -64
  248. package/dist/components/exclusive-content-section.js.map +0 -1
  249. package/dist/data/drop-create-schema.cjs +0 -92
  250. package/dist/data/drop-create-schema.cjs.map +0 -1
  251. package/dist/data/drop-create-schema.d.cts +0 -131
  252. package/dist/data/drop-create-schema.d.ts +0 -131
  253. package/dist/data/drop-create-schema.js +0 -58
  254. package/dist/data/drop-create-schema.js.map +0 -1
  255. package/dist/utils/drop-status.cjs.map +0 -1
  256. package/dist/utils/drop-status.d.cts +0 -12
  257. package/dist/utils/drop-status.d.ts +0 -12
  258. package/dist/utils/drop-status.js +0 -13
  259. package/dist/utils/drop-status.js.map +0 -1
@@ -0,0 +1,115 @@
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 artwork_section_exports = {};
31
+ __export(artwork_section_exports, {
32
+ ArtworkSection: () => ArtworkSection,
33
+ FieldError: () => FieldError,
34
+ ImagePick: () => ImagePick
35
+ });
36
+ module.exports = __toCommonJS(artwork_section_exports);
37
+ var import_jsx_runtime = require("react/jsx-runtime");
38
+ var import_react = require("react");
39
+ var import_lucide_react = require("lucide-react");
40
+ var import_image = __toESM(require("../../image.js"), 1);
41
+ var import_input = require("../../input.js");
42
+ var import_create_form_primitives = require("../../create-form-primitives.js");
43
+ var import_drop_item_list = require("../../drop-item-list.js");
44
+ var import_metadata = require("../../../utils/drop/metadata.js");
45
+ var import_preview = require("../../../utils/drop/preview.js");
46
+ function FieldError({ message }) {
47
+ return message ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-medium text-destructive", children: message }) : null;
48
+ }
49
+ function ImagePick({ file, onPick, label }) {
50
+ const ref = (0, import_react.useRef)(null);
51
+ const preview = file ? (0, import_preview.previewUrl)(file) : null;
52
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
53
+ "button",
54
+ {
55
+ type: "button",
56
+ onClick: () => ref.current?.click(),
57
+ className: "relative flex aspect-square w-full max-w-xs items-center justify-center overflow-hidden rounded-xl border border-dashed border-border bg-muted/30 hover:border-primary/50",
58
+ children: [
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ref, type: "file", accept: "image/*", className: "hidden", onChange: (e) => {
60
+ const f = e.target.files?.[0];
61
+ if (f) onPick(f);
62
+ } }),
63
+ preview ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: preview, alt: label, fill: true, unoptimized: true, className: "object-cover" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex flex-col items-center gap-2 text-sm text-muted-foreground", children: [
64
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ImagePlus, { className: "h-6 w-6" }),
65
+ label
66
+ ] })
67
+ ]
68
+ }
69
+ );
70
+ }
71
+ function ArtworkSection({ draft, setDraft, errors }) {
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_create_form_primitives.Section, { title: "Artwork", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Images, { className: "h-4 w-4" }), children: [
73
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
74
+ import_create_form_primitives.ToggleGroup,
75
+ {
76
+ value: draft.kind === "edition" ? "Edition" : "Collection",
77
+ options: ["Edition", "Collection"],
78
+ onChange: (v) => setDraft({ kind: v === "Edition" ? "edition" : "collection" })
79
+ }
80
+ ),
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: draft.kind === "edition" ? "One artwork, sold as numbered copies." : "Many unique items \u2014 each image becomes its own token." }),
82
+ draft.kind === "edition" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImagePick, { file: draft.edition, onPick: (f) => setDraft({ edition: f }), label: "Choose the artwork" }),
84
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
85
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-sm font-medium", htmlFor: "drop-supply", children: "Copies" }),
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { id: "drop-supply", inputMode: "numeric", value: draft.supply, onChange: (e) => setDraft({ supply: e.target.value.trim() }), className: "max-w-[10rem]" }),
87
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
88
+ "Up to ",
89
+ import_metadata.MAX_DROP_SUPPLY.toLocaleString("en-US"),
90
+ "."
91
+ ] }),
92
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldError, { message: errors.supply })
93
+ ] })
94
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
+ import_drop_item_list.DropItemList,
96
+ {
97
+ items: draft.items,
98
+ collectionName: draft.name,
99
+ onAddFiles: (files) => setDraft({
100
+ items: [...draft.items, ...files.map((file) => ({ id: crypto.randomUUID(), file, previewUrl: URL.createObjectURL(file), name: "", description: "" }))]
101
+ }),
102
+ onRemove: (id) => setDraft({ items: draft.items.filter((it) => it.id !== id) }),
103
+ onEdit: (id, patch) => setDraft({ items: draft.items.map((it) => it.id === id ? { ...it, ...patch } : it) })
104
+ }
105
+ ),
106
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldError, { message: errors.artwork })
107
+ ] });
108
+ }
109
+ // Annotate the CommonJS export names for ESM import in node:
110
+ 0 && (module.exports = {
111
+ ArtworkSection,
112
+ FieldError,
113
+ ImagePick
114
+ });
115
+ //# sourceMappingURL=artwork-section.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/drop/create/artwork-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useRef } from \"react\";\nimport { ImagePlus, Images } from \"lucide-react\";\nimport Image from \"../../image.js\";\nimport { Input } from \"../../input.js\";\nimport { Section, ToggleGroup } from \"../../create-form-primitives.js\";\nimport { DropItemList } from \"../../drop-item-list.js\";\nimport { MAX_DROP_SUPPLY } from \"../../../utils/drop/metadata.js\";\nimport type { DropDraft, DropDraftErrors } from \"../../../utils/drop/draft.js\";\nimport { previewUrl } from \"../../../utils/drop/preview.js\";\n\nexport interface SectionProps {\n draft: DropDraft;\n setDraft: (patch: Partial<DropDraft>) => void;\n errors: DropDraftErrors;\n}\n\nexport function FieldError({ message }: { message?: string }) {\n return message ? <p className=\"text-xs font-medium text-destructive\">{message}</p> : null;\n}\n\nexport function ImagePick({ file, onPick, label }: { file: File | null; onPick: (f: File) => void; label: string }) {\n const ref = useRef<HTMLInputElement | null>(null);\n const preview = file ? previewUrl(file) : null;\n return (\n <button type=\"button\" onClick={() => ref.current?.click()}\n className=\"relative flex aspect-square w-full max-w-xs items-center justify-center overflow-hidden rounded-xl border border-dashed border-border bg-muted/30 hover:border-primary/50\">\n <input ref={ref} type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) onPick(f); }} />\n {preview\n ? <Image src={preview} alt={label} fill unoptimized className=\"object-cover\" />\n : <span className=\"flex flex-col items-center gap-2 text-sm text-muted-foreground\"><ImagePlus className=\"h-6 w-6\" />{label}</span>}\n </button>\n );\n}\n\nexport function ArtworkSection({ draft, setDraft, errors }: SectionProps) {\n return (\n <Section title=\"Artwork\" icon={<Images className=\"h-4 w-4\" />}>\n <ToggleGroup\n value={draft.kind === \"edition\" ? \"Edition\" : \"Collection\"}\n options={[\"Edition\", \"Collection\"]}\n onChange={(v) => setDraft({ kind: v === \"Edition\" ? \"edition\" : \"collection\" })}\n />\n <p className=\"text-xs text-muted-foreground\">\n {draft.kind === \"edition\"\n ? \"One artwork, sold as numbered copies.\"\n : \"Many unique items — each image becomes its own token.\"}\n </p>\n {draft.kind === \"edition\" ? (\n <div className=\"space-y-4\">\n <ImagePick file={draft.edition} onPick={(f) => setDraft({ edition: f })} label=\"Choose the artwork\" />\n <div className=\"space-y-1.5\">\n <label className=\"text-sm font-medium\" htmlFor=\"drop-supply\">Copies</label>\n <Input id=\"drop-supply\" inputMode=\"numeric\" value={draft.supply} onChange={(e) => setDraft({ supply: e.target.value.trim() })} className=\"max-w-[10rem]\" />\n <p className=\"text-xs text-muted-foreground\">Up to {MAX_DROP_SUPPLY.toLocaleString(\"en-US\")}.</p>\n <FieldError message={errors.supply} />\n </div>\n </div>\n ) : (\n <DropItemList\n items={draft.items}\n collectionName={draft.name}\n onAddFiles={(files) => setDraft({\n items: [...draft.items, ...files.map((file) => ({ id: crypto.randomUUID(), file, previewUrl: URL.createObjectURL(file), name: \"\", description: \"\" }))],\n })}\n onRemove={(id) => setDraft({ items: draft.items.filter((it) => it.id !== id) })}\n onEdit={(id, patch) => setDraft({ items: draft.items.map((it) => (it.id === id ? { ...it, ...patch } : it)) })}\n />\n )}\n <FieldError message={errors.artwork} />\n </Section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBmB;AAjBnB,mBAAuB;AACvB,0BAAkC;AACl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AEJ;","names":["Image"]}
@@ -0,0 +1,23 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { DropDraft, DropDraftErrors } from '../../../utils/drop/draft.cjs';
3
+ import '../../drop-item-list.cjs';
4
+ import '../../../utils/drop/metadata.cjs';
5
+ import '@medialane/sdk';
6
+ import '../../../utils/drop/sale.cjs';
7
+
8
+ interface SectionProps {
9
+ draft: DropDraft;
10
+ setDraft: (patch: Partial<DropDraft>) => void;
11
+ errors: DropDraftErrors;
12
+ }
13
+ declare function FieldError({ message }: {
14
+ message?: string;
15
+ }): react_jsx_runtime.JSX.Element | null;
16
+ declare function ImagePick({ file, onPick, label }: {
17
+ file: File | null;
18
+ onPick: (f: File) => void;
19
+ label: string;
20
+ }): react_jsx_runtime.JSX.Element;
21
+ declare function ArtworkSection({ draft, setDraft, errors }: SectionProps): react_jsx_runtime.JSX.Element;
22
+
23
+ export { ArtworkSection, FieldError, ImagePick, type SectionProps };
@@ -0,0 +1,23 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { DropDraft, DropDraftErrors } from '../../../utils/drop/draft.js';
3
+ import '../../drop-item-list.js';
4
+ import '../../../utils/drop/metadata.js';
5
+ import '@medialane/sdk';
6
+ import '../../../utils/drop/sale.js';
7
+
8
+ interface SectionProps {
9
+ draft: DropDraft;
10
+ setDraft: (patch: Partial<DropDraft>) => void;
11
+ errors: DropDraftErrors;
12
+ }
13
+ declare function FieldError({ message }: {
14
+ message?: string;
15
+ }): react_jsx_runtime.JSX.Element | null;
16
+ declare function ImagePick({ file, onPick, label }: {
17
+ file: File | null;
18
+ onPick: (f: File) => void;
19
+ label: string;
20
+ }): react_jsx_runtime.JSX.Element;
21
+ declare function ArtworkSection({ draft, setDraft, errors }: SectionProps): react_jsx_runtime.JSX.Element;
22
+
23
+ export { ArtworkSection, FieldError, ImagePick, type SectionProps };
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useRef } from "react";
4
+ import { ImagePlus, Images } from "lucide-react";
5
+ import Image from "../../image.js";
6
+ import { Input } from "../../input.js";
7
+ import { Section, ToggleGroup } from "../../create-form-primitives.js";
8
+ import { DropItemList } from "../../drop-item-list.js";
9
+ import { MAX_DROP_SUPPLY } from "../../../utils/drop/metadata.js";
10
+ import { previewUrl } from "../../../utils/drop/preview.js";
11
+ function FieldError({ message }) {
12
+ return message ? /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-destructive", children: message }) : null;
13
+ }
14
+ function ImagePick({ file, onPick, label }) {
15
+ const ref = useRef(null);
16
+ const preview = file ? previewUrl(file) : null;
17
+ return /* @__PURE__ */ jsxs(
18
+ "button",
19
+ {
20
+ type: "button",
21
+ onClick: () => ref.current?.click(),
22
+ className: "relative flex aspect-square w-full max-w-xs items-center justify-center overflow-hidden rounded-xl border border-dashed border-border bg-muted/30 hover:border-primary/50",
23
+ children: [
24
+ /* @__PURE__ */ jsx("input", { ref, type: "file", accept: "image/*", className: "hidden", onChange: (e) => {
25
+ const f = e.target.files?.[0];
26
+ if (f) onPick(f);
27
+ } }),
28
+ preview ? /* @__PURE__ */ jsx(Image, { src: preview, alt: label, fill: true, unoptimized: true, className: "object-cover" }) : /* @__PURE__ */ jsxs("span", { className: "flex flex-col items-center gap-2 text-sm text-muted-foreground", children: [
29
+ /* @__PURE__ */ jsx(ImagePlus, { className: "h-6 w-6" }),
30
+ label
31
+ ] })
32
+ ]
33
+ }
34
+ );
35
+ }
36
+ function ArtworkSection({ draft, setDraft, errors }) {
37
+ return /* @__PURE__ */ jsxs(Section, { title: "Artwork", icon: /* @__PURE__ */ jsx(Images, { className: "h-4 w-4" }), children: [
38
+ /* @__PURE__ */ jsx(
39
+ ToggleGroup,
40
+ {
41
+ value: draft.kind === "edition" ? "Edition" : "Collection",
42
+ options: ["Edition", "Collection"],
43
+ onChange: (v) => setDraft({ kind: v === "Edition" ? "edition" : "collection" })
44
+ }
45
+ ),
46
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: draft.kind === "edition" ? "One artwork, sold as numbered copies." : "Many unique items \u2014 each image becomes its own token." }),
47
+ draft.kind === "edition" ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
48
+ /* @__PURE__ */ jsx(ImagePick, { file: draft.edition, onPick: (f) => setDraft({ edition: f }), label: "Choose the artwork" }),
49
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
50
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: "drop-supply", children: "Copies" }),
51
+ /* @__PURE__ */ jsx(Input, { id: "drop-supply", inputMode: "numeric", value: draft.supply, onChange: (e) => setDraft({ supply: e.target.value.trim() }), className: "max-w-[10rem]" }),
52
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
53
+ "Up to ",
54
+ MAX_DROP_SUPPLY.toLocaleString("en-US"),
55
+ "."
56
+ ] }),
57
+ /* @__PURE__ */ jsx(FieldError, { message: errors.supply })
58
+ ] })
59
+ ] }) : /* @__PURE__ */ jsx(
60
+ DropItemList,
61
+ {
62
+ items: draft.items,
63
+ collectionName: draft.name,
64
+ onAddFiles: (files) => setDraft({
65
+ items: [...draft.items, ...files.map((file) => ({ id: crypto.randomUUID(), file, previewUrl: URL.createObjectURL(file), name: "", description: "" }))]
66
+ }),
67
+ onRemove: (id) => setDraft({ items: draft.items.filter((it) => it.id !== id) }),
68
+ onEdit: (id, patch) => setDraft({ items: draft.items.map((it) => it.id === id ? { ...it, ...patch } : it) })
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsx(FieldError, { message: errors.artwork })
72
+ ] });
73
+ }
74
+ export {
75
+ ArtworkSection,
76
+ FieldError,
77
+ ImagePick
78
+ };
79
+ //# sourceMappingURL=artwork-section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/drop/create/artwork-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useRef } from \"react\";\nimport { ImagePlus, Images } from \"lucide-react\";\nimport Image from \"../../image.js\";\nimport { Input } from \"../../input.js\";\nimport { Section, ToggleGroup } from \"../../create-form-primitives.js\";\nimport { DropItemList } from \"../../drop-item-list.js\";\nimport { MAX_DROP_SUPPLY } from \"../../../utils/drop/metadata.js\";\nimport type { DropDraft, DropDraftErrors } from \"../../../utils/drop/draft.js\";\nimport { previewUrl } from \"../../../utils/drop/preview.js\";\n\nexport interface SectionProps {\n draft: DropDraft;\n setDraft: (patch: Partial<DropDraft>) => void;\n errors: DropDraftErrors;\n}\n\nexport function FieldError({ message }: { message?: string }) {\n return message ? <p className=\"text-xs font-medium text-destructive\">{message}</p> : null;\n}\n\nexport function ImagePick({ file, onPick, label }: { file: File | null; onPick: (f: File) => void; label: string }) {\n const ref = useRef<HTMLInputElement | null>(null);\n const preview = file ? previewUrl(file) : null;\n return (\n <button type=\"button\" onClick={() => ref.current?.click()}\n className=\"relative flex aspect-square w-full max-w-xs items-center justify-center overflow-hidden rounded-xl border border-dashed border-border bg-muted/30 hover:border-primary/50\">\n <input ref={ref} type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={(e) => { const f = e.target.files?.[0]; if (f) onPick(f); }} />\n {preview\n ? <Image src={preview} alt={label} fill unoptimized className=\"object-cover\" />\n : <span className=\"flex flex-col items-center gap-2 text-sm text-muted-foreground\"><ImagePlus className=\"h-6 w-6\" />{label}</span>}\n </button>\n );\n}\n\nexport function ArtworkSection({ draft, setDraft, errors }: SectionProps) {\n return (\n <Section title=\"Artwork\" icon={<Images className=\"h-4 w-4\" />}>\n <ToggleGroup\n value={draft.kind === \"edition\" ? \"Edition\" : \"Collection\"}\n options={[\"Edition\", \"Collection\"]}\n onChange={(v) => setDraft({ kind: v === \"Edition\" ? \"edition\" : \"collection\" })}\n />\n <p className=\"text-xs text-muted-foreground\">\n {draft.kind === \"edition\"\n ? \"One artwork, sold as numbered copies.\"\n : \"Many unique items — each image becomes its own token.\"}\n </p>\n {draft.kind === \"edition\" ? (\n <div className=\"space-y-4\">\n <ImagePick file={draft.edition} onPick={(f) => setDraft({ edition: f })} label=\"Choose the artwork\" />\n <div className=\"space-y-1.5\">\n <label className=\"text-sm font-medium\" htmlFor=\"drop-supply\">Copies</label>\n <Input id=\"drop-supply\" inputMode=\"numeric\" value={draft.supply} onChange={(e) => setDraft({ supply: e.target.value.trim() })} className=\"max-w-[10rem]\" />\n <p className=\"text-xs text-muted-foreground\">Up to {MAX_DROP_SUPPLY.toLocaleString(\"en-US\")}.</p>\n <FieldError message={errors.supply} />\n </div>\n </div>\n ) : (\n <DropItemList\n items={draft.items}\n collectionName={draft.name}\n onAddFiles={(files) => setDraft({\n items: [...draft.items, ...files.map((file) => ({ id: crypto.randomUUID(), file, previewUrl: URL.createObjectURL(file), name: \"\", description: \"\" }))],\n })}\n onRemove={(id) => setDraft({ items: draft.items.filter((it) => it.id !== id) })}\n onEdit={(id, patch) => setDraft({ items: draft.items.map((it) => (it.id === id ? { ...it, ...patch } : it)) })}\n />\n )}\n <FieldError message={errors.artwork} />\n </Section>\n );\n}\n"],"mappings":";AAmBmB,cAYT,YAZS;AAjBnB,SAAS,cAAc;AACvB,SAAS,WAAW,cAAc;AAClC,OAAO,WAAW;AAClB,SAAS,aAAa;AACtB,SAAS,SAAS,mBAAmB;AACrC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAEhC,SAAS,kBAAkB;AAQpB,SAAS,WAAW,EAAE,QAAQ,GAAyB;AAC5D,SAAO,UAAU,oBAAC,OAAE,WAAU,wCAAwC,mBAAQ,IAAO;AACvF;AAEO,SAAS,UAAU,EAAE,MAAM,QAAQ,MAAM,GAAoE;AAClH,QAAM,MAAM,OAAgC,IAAI;AAChD,QAAM,UAAU,OAAO,WAAW,IAAI,IAAI;AAC1C,SACE;AAAA,IAAC;AAAA;AAAA,MAAO,MAAK;AAAA,MAAS,SAAS,MAAM,IAAI,SAAS,MAAM;AAAA,MACtD,WAAU;AAAA,MACV;AAAA,4BAAC,WAAM,KAAU,MAAK,Q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O;AAAA,UAAE;AAAA,WAAC;AAAA,QAC7F,oBAAC,cAAW,SAAS,OAAO,QAAQ;AAAA,SACtC;AAAA,OACF,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,MAAM;AAAA,QACb,gBAAgB,MAAM;AAAA,QACtB,YAAY,CAAC,UAAU,SAAS;AAAA,UAC9B,OAAO,CAAC,GAAG,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,IAAI,OAAO,WAAW,GAAG,MAAM,YAAY,IAAI,gBAAgB,IAAI,GAAG,MAAM,IAAI,aAAa,GAAG,EAAE,CAAC;AAAA,QACvJ,CAAC;AAAA,QACD,UAAU,CAAC,OAAO,SAAS,EAAE,OAAO,MAAM,MAAM,OAAO,CAAC,OAAO,GAAG,OAAO,EAAE,EAAE,CAAC;AAAA,QAC9E,QAAQ,CAAC,IAAI,UAAU,SAAS,EAAE,OAAO,MAAM,MAAM,IAAI,CAAC,OAAQ,GAAG,OAAO,KAAK,EAAE,GAAG,IAAI,GAAG,MAAM,IAAI,EAAG,EAAE,CAAC;AAAA;AAAA,IAC/G;AAAA,IAEF,oBAAC,cAAW,SAAS,OAAO,SAAS;AAAA,KACvC;AAEJ;","names":[]}
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var details_section_exports = {};
21
+ __export(details_section_exports, {
22
+ DetailsSection: () => DetailsSection
23
+ });
24
+ module.exports = __toCommonJS(details_section_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_lucide_react = require("lucide-react");
27
+ var import_input = require("../../input.js");
28
+ var import_textarea = require("../../textarea.js");
29
+ var import_create_form_primitives = require("../../create-form-primitives.js");
30
+ var import_select = require("../../select.js");
31
+ var import_ip = require("../../../data/ip.js");
32
+ var import_launchpad_defaults = require("../../../utils/launchpad-defaults.js");
33
+ var import_artwork_section = require("./artwork-section.js");
34
+ function DetailsSection({ draft, setDraft, errors }) {
35
+ const license = draft.license;
36
+ const setLicense = (patch) => setDraft({ license: { ...license, ...patch } });
37
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_create_form_primitives.Section, { title: "Details", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.FileText, { className: "h-4 w-4" }), children: [
38
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
39
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm font-medium", children: [
40
+ "Cover image ",
41
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-normal text-muted-foreground", children: "(optional \u2014 the artwork is used otherwise)" })
42
+ ] }),
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_artwork_section.ImagePick, { file: draft.cover, onPick: (f) => setDraft({ cover: f }), label: "Choose a cover" })
44
+ ] }),
45
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-sm font-medium", htmlFor: "drop-name", children: "Name" }),
47
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
48
+ import_input.Input,
49
+ {
50
+ id: "drop-name",
51
+ value: draft.name,
52
+ maxLength: 100,
53
+ onChange: (e) => {
54
+ const name = e.target.value;
55
+ const auto = !draft.symbol || draft.symbol === (0, import_launchpad_defaults.suggestLaunchpadSymbol)(draft.name);
56
+ setDraft(auto ? { name, symbol: (0, import_launchpad_defaults.suggestLaunchpadSymbol)(name) } : { name });
57
+ }
58
+ }
59
+ ),
60
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_artwork_section.FieldError, { message: errors.name })
61
+ ] }),
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-sm font-medium", htmlFor: "drop-symbol", children: "Symbol" }),
64
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
+ import_input.Input,
66
+ {
67
+ id: "drop-symbol",
68
+ value: draft.symbol,
69
+ maxLength: 10,
70
+ className: "max-w-[10rem] uppercase",
71
+ onChange: (e) => setDraft({ symbol: e.target.value.toUpperCase().replace(/[^A-Z0-9]/g, "") })
72
+ }
73
+ ),
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_artwork_section.FieldError, { message: errors.symbol })
75
+ ] }),
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-sm font-medium", htmlFor: "drop-description", children: "Description" }),
78
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_textarea.Textarea, { id: "drop-description", value: draft.description, maxLength: 500, rows: 3, onChange: (e) => setDraft({ description: e.target.value }) })
79
+ ] }),
80
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-3 border-t border-border/60 pt-4", children: [
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm font-medium", children: [
82
+ "License ",
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-normal text-muted-foreground", children: "\u2014 saved with every token" })
84
+ ] }),
85
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_select.Select, { value: license.licenseType, onValueChange: (v) => {
86
+ const def = import_ip.LICENSE_TYPES.find((l) => l.value === v);
87
+ setLicense(def ? { licenseType: v, commercialUse: def.commercialUse, derivatives: def.derivatives, attribution: def.attribution } : { licenseType: v });
88
+ }, children: [
89
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectValue, {}) }),
90
+ /* @__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)) })
91
+ ] }),
92
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-medium", children: "Commercial use" }),
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: license.commercialUse, options: ["Yes", "No"], onChange: (v) => setLicense({ commercialUse: v }) }),
94
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-medium", children: "Remixing" }),
95
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: license.derivatives, options: import_ip.DERIVATIVES_OPTIONS, onChange: (v) => setLicense({ derivatives: v }) }),
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-medium", children: "AI training" }),
97
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_create_form_primitives.ToggleGroup, { value: license.aiPolicy, options: import_ip.AI_POLICIES, onChange: (v) => setLicense({ aiPolicy: v }) }),
98
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-medium", children: "Type" }),
99
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_select.Select, { value: license.ipType, onValueChange: (v) => setLicense({ ipType: v }), children: [
100
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectValue, {}) }),
101
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectContent, { children: import_ip.IP_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectItem, { value: t, children: t }, t)) })
102
+ ] })
103
+ ] })
104
+ ] });
105
+ }
106
+ // Annotate the CommonJS export names for ESM import in node:
107
+ 0 && (module.exports = {
108
+ DetailsSection
109
+ });
110
+ //# sourceMappingURL=details-section.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/drop/create/details-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { FileText } from \"lucide-react\";\nimport { Input } from \"../../input.js\";\nimport { Textarea } from \"../../textarea.js\";\nimport { Section, ToggleGroup } from \"../../create-form-primitives.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../../select.js\";\nimport { AI_POLICIES, DERIVATIVES_OPTIONS, IP_TYPES, LICENSE_TYPES } from \"../../../data/ip.js\";\nimport { suggestLaunchpadSymbol } from \"../../../utils/launchpad-defaults.js\";\nimport { FieldError, ImagePick, type SectionProps } from \"./artwork-section.js\";\n\nexport function DetailsSection({ draft, setDraft, errors }: SectionProps) {\n const license = draft.license;\n const setLicense = (patch: Partial<typeof license>) => setDraft({ license: { ...license, ...patch } });\n return (\n <Section title=\"Details\" icon={<FileText className=\"h-4 w-4\" />}>\n <div className=\"space-y-1.5\">\n <p className=\"text-sm font-medium\">Cover image <span className=\"font-normal text-muted-foreground\">(optional — the artwork is used otherwise)</span></p>\n <ImagePick file={draft.cover} onPick={(f) => setDraft({ cover: f })} label=\"Choose a cover\" />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-sm font-medium\" htmlFor=\"drop-name\">Name</label>\n <Input id=\"drop-name\" value={draft.name} maxLength={100}\n onChange={(e) => {\n const name = e.target.value;\n const auto = !draft.symbol || draft.symbol === suggestLaunchpadSymbol(draft.name);\n setDraft(auto ? { name, symbol: suggestLaunchpadSymbol(name) } : { name });\n }} />\n <FieldError message={errors.name} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-sm font-medium\" htmlFor=\"drop-symbol\">Symbol</label>\n <Input id=\"drop-symbol\" value={draft.symbol} maxLength={10} className=\"max-w-[10rem] uppercase\"\n onChange={(e) => setDraft({ symbol: e.target.value.toUpperCase().replace(/[^A-Z0-9]/g, \"\") })} />\n <FieldError message={errors.symbol} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-sm font-medium\" htmlFor=\"drop-description\">Description</label>\n <Textarea id=\"drop-description\" value={draft.description} maxLength={500} rows={3} onChange={(e) => setDraft({ description: e.target.value })} />\n </div>\n <div className=\"space-y-3 border-t border-border/60 pt-4\">\n <p className=\"text-sm font-medium\">License <span className=\"font-normal text-muted-foreground\">— saved with every token</span></p>\n <Select value={license.licenseType} onValueChange={(v) => {\n const def = LICENSE_TYPES.find((l) => l.value === v);\n setLicense(def ? { licenseType: v, commercialUse: def.commercialUse, derivatives: def.derivatives, attribution: def.attribution } : { licenseType: v });\n }}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>{LICENSE_TYPES.map((l) => <SelectItem key={l.value} value={l.value}>{l.label}</SelectItem>)}</SelectContent>\n </Select>\n <p className=\"text-xs font-medium\">Commercial use</p>\n <ToggleGroup value={license.commercialUse} options={[\"Yes\", \"No\"]} onChange={(v) => setLicense({ commercialUse: v })} />\n <p className=\"text-xs font-medium\">Remixing</p>\n <ToggleGroup value={license.derivatives} options={DERIVATIVES_OPTIONS} onChange={(v) => setLicense({ derivatives: v })} />\n <p className=\"text-xs font-medium\">AI training</p>\n <ToggleGroup value={license.aiPolicy} options={AI_POLICIES} onChange={(v) => setLicense({ aiPolicy: v })} />\n <p className=\"text-xs font-medium\">Type</p>\n <Select value={license.ipType} onValueChange={(v) => setLicense({ ipType: v })}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>{IP_TYPES.map((t) => <SelectItem key={t} value={t}>{t}</SelectItem>)}</SelectContent>\n </Select>\n </div>\n </Section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAemC;AAbnC,0BAAyB;AACzB,mBAAsB;AACtB,sBAAyB;AACzB,oCAAqC;AACrC,oBAA8E;AAC9E,gBAA0E;AAC1E,gCAAuC;AACvC,6BAAyD;AAElD,SAAS,eAAe,EAAE,OAAO,UAAU,OAAO,GAAiB;AACxE,QAAM,UAAU,MAAM;AACtB,QAAM,aAAa,CAAC,UAAmC,SAAS,EAAE,SAAS,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAAC;AACrG,SACE,6CAAC,yCAAQ,OAAM,WAAU,MAAM,4CAAC,gCAAS,WAAU,WAAU,GAC3D;AAAA,iDAAC,SAAI,WAAU,eACb;AAAA,mDAAC,OAAE,WAAU,uBAAsB;AAAA;AAAA,QAAY,4CAAC,UAAK,WAAU,qCAAoC,6DAA0C;AAAA,SAAO;AAAA,MACpJ,4CAAC,oCAAU,MAAM,MAAM,OAAO,QAAQ,CAAC,MAAM,SAAS,EAAE,OAAO,EAAE,CAAC,GAAG,OAAM,kBAAiB;AAAA,OAC9F;AAAA,IACA,6CAAC,SAAI,WAAU,eACb;AAAA,kDAAC,WAAM,WAAU,uBAAsB,SAAQ,aAAY,kBAAI;AAAA,MAC/D;AAAA,QAAC;AAAA;AAAA,UAAM,IAAG;AAAA,UAAY,OAAO,MAAM;AAAA,UAAM,WAAW;AAAA,UAClD,UAAU,CAAC,MAAM;AACf,kBAAM,OAAO,EAAE,OAAO;AACtB,kBAAM,OAAO,CAAC,MAAM,UAAU,MAAM,eAAW,kDAAuB,MAAM,IAAI;AAChF,qBAAS,OAAO,EAAE,MAAM,YAAQ,kDAAuB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Ae,kCAAc,IAAI,CAAC,MAAM,4CAAC,4BAAyB,OAAO,EAAE,OAAQ,YAAE,SAA5B,EAAE,KAAgC,CAAa,GAAE;AAAA,SAC7G;AAAA,MACA,4CAAC,OAAE,WAAU,uBAAsB,4BAAc;AAAA,MACjD,4CAAC,6CAAY,OAAO,QAAQ,eAAe,SAAS,CAAC,OAAO,IAAI,GAAG,UAAU,CAAC,MAAM,WAAW,EAAE,eAAe,EAAE,CAAC,GAAG;AAAA,MACtH,4CAAC,OAAE,WAAU,uBAAsB,sBAAQ;AAAA,MAC3C,4CAAC,6CAAY,OAAO,QAAQ,aAAa,SAAS,+BAAqB,UAAU,CAAC,MAAM,WAAW,EAAE,aAAa,EAAE,CAAC,GAAG;AAAA,MACxH,4CAAC,OAAE,WAAU,uBAAsB,yBAAW;AAAA,MAC9C,4CAAC,6CAAY,OAAO,QAAQ,UAAU,SAAS,uBAAa,UAAU,CAAC,MAAM,WAAW,EAAE,UAAU,EAAE,CAAC,GAAG;AAAA,MAC1G,4CAAC,OAAE,WAAU,uBAAsB,kBAAI;AAAA,MACvC,6CAAC,wBAAO,OAAO,QAAQ,QAAQ,eAAe,CAAC,MAAM,WAAW,EAAE,QAAQ,EAAE,CAAC,GAC3E;AAAA,oDAAC,+BAAc,sDAAC,6BAAY,GAAE;AAAA,QAC9B,4CAAC,+BAAe,6BAAS,IAAI,CAAC,MAAM,4CAAC,4BAAmB,OAAO,GAAI,eAAd,CAAgB,CAAa,GAAE;AAAA,SACtF;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,11 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { SectionProps } from './artwork-section.cjs';
3
+ import '../../../utils/drop/draft.cjs';
4
+ import '../../drop-item-list.cjs';
5
+ import '../../../utils/drop/metadata.cjs';
6
+ import '@medialane/sdk';
7
+ import '../../../utils/drop/sale.cjs';
8
+
9
+ declare function DetailsSection({ draft, setDraft, errors }: SectionProps): react_jsx_runtime.JSX.Element;
10
+
11
+ export { DetailsSection };
@@ -0,0 +1,11 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { SectionProps } from './artwork-section.js';
3
+ import '../../../utils/drop/draft.js';
4
+ import '../../drop-item-list.js';
5
+ import '../../../utils/drop/metadata.js';
6
+ import '@medialane/sdk';
7
+ import '../../../utils/drop/sale.js';
8
+
9
+ declare function DetailsSection({ draft, setDraft, errors }: SectionProps): react_jsx_runtime.JSX.Element;
10
+
11
+ export { DetailsSection };
@@ -0,0 +1,86 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { FileText } from "lucide-react";
4
+ import { Input } from "../../input.js";
5
+ import { Textarea } from "../../textarea.js";
6
+ import { Section, ToggleGroup } from "../../create-form-primitives.js";
7
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../select.js";
8
+ import { AI_POLICIES, DERIVATIVES_OPTIONS, IP_TYPES, LICENSE_TYPES } from "../../../data/ip.js";
9
+ import { suggestLaunchpadSymbol } from "../../../utils/launchpad-defaults.js";
10
+ import { FieldError, ImagePick } from "./artwork-section.js";
11
+ function DetailsSection({ draft, setDraft, errors }) {
12
+ const license = draft.license;
13
+ const setLicense = (patch) => setDraft({ license: { ...license, ...patch } });
14
+ return /* @__PURE__ */ jsxs(Section, { title: "Details", icon: /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" }), children: [
15
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
16
+ /* @__PURE__ */ jsxs("p", { className: "text-sm font-medium", children: [
17
+ "Cover image ",
18
+ /* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: "(optional \u2014 the artwork is used otherwise)" })
19
+ ] }),
20
+ /* @__PURE__ */ jsx(ImagePick, { file: draft.cover, onPick: (f) => setDraft({ cover: f }), label: "Choose a cover" })
21
+ ] }),
22
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
23
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: "drop-name", children: "Name" }),
24
+ /* @__PURE__ */ jsx(
25
+ Input,
26
+ {
27
+ id: "drop-name",
28
+ value: draft.name,
29
+ maxLength: 100,
30
+ onChange: (e) => {
31
+ const name = e.target.value;
32
+ const auto = !draft.symbol || draft.symbol === suggestLaunchpadSymbol(draft.name);
33
+ setDraft(auto ? { name, symbol: suggestLaunchpadSymbol(name) } : { name });
34
+ }
35
+ }
36
+ ),
37
+ /* @__PURE__ */ jsx(FieldError, { message: errors.name })
38
+ ] }),
39
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
40
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: "drop-symbol", children: "Symbol" }),
41
+ /* @__PURE__ */ jsx(
42
+ Input,
43
+ {
44
+ id: "drop-symbol",
45
+ value: draft.symbol,
46
+ maxLength: 10,
47
+ className: "max-w-[10rem] uppercase",
48
+ onChange: (e) => setDraft({ symbol: e.target.value.toUpperCase().replace(/[^A-Z0-9]/g, "") })
49
+ }
50
+ ),
51
+ /* @__PURE__ */ jsx(FieldError, { message: errors.symbol })
52
+ ] }),
53
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
54
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: "drop-description", children: "Description" }),
55
+ /* @__PURE__ */ jsx(Textarea, { id: "drop-description", value: draft.description, maxLength: 500, rows: 3, onChange: (e) => setDraft({ description: e.target.value }) })
56
+ ] }),
57
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3 border-t border-border/60 pt-4", children: [
58
+ /* @__PURE__ */ jsxs("p", { className: "text-sm font-medium", children: [
59
+ "License ",
60
+ /* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: "\u2014 saved with every token" })
61
+ ] }),
62
+ /* @__PURE__ */ jsxs(Select, { value: license.licenseType, onValueChange: (v) => {
63
+ const def = LICENSE_TYPES.find((l) => l.value === v);
64
+ setLicense(def ? { licenseType: v, commercialUse: def.commercialUse, derivatives: def.derivatives, attribution: def.attribution } : { licenseType: v });
65
+ }, children: [
66
+ /* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
67
+ /* @__PURE__ */ jsx(SelectContent, { children: LICENSE_TYPES.map((l) => /* @__PURE__ */ jsx(SelectItem, { value: l.value, children: l.label }, l.value)) })
68
+ ] }),
69
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium", children: "Commercial use" }),
70
+ /* @__PURE__ */ jsx(ToggleGroup, { value: license.commercialUse, options: ["Yes", "No"], onChange: (v) => setLicense({ commercialUse: v }) }),
71
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium", children: "Remixing" }),
72
+ /* @__PURE__ */ jsx(ToggleGroup, { value: license.derivatives, options: DERIVATIVES_OPTIONS, onChange: (v) => setLicense({ derivatives: v }) }),
73
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium", children: "AI training" }),
74
+ /* @__PURE__ */ jsx(ToggleGroup, { value: license.aiPolicy, options: AI_POLICIES, onChange: (v) => setLicense({ aiPolicy: v }) }),
75
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium", children: "Type" }),
76
+ /* @__PURE__ */ jsxs(Select, { value: license.ipType, onValueChange: (v) => setLicense({ ipType: v }), children: [
77
+ /* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, {}) }),
78
+ /* @__PURE__ */ jsx(SelectContent, { children: IP_TYPES.map((t) => /* @__PURE__ */ jsx(SelectItem, { value: t, children: t }, t)) })
79
+ ] })
80
+ ] })
81
+ ] });
82
+ }
83
+ export {
84
+ DetailsSection
85
+ };
86
+ //# sourceMappingURL=details-section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/drop/create/details-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { FileText } from \"lucide-react\";\nimport { Input } from \"../../input.js\";\nimport { Textarea } from \"../../textarea.js\";\nimport { Section, ToggleGroup } from \"../../create-form-primitives.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../../select.js\";\nimport { AI_POLICIES, DERIVATIVES_OPTIONS, IP_TYPES, LICENSE_TYPES } from \"../../../data/ip.js\";\nimport { suggestLaunchpadSymbol } from \"../../../utils/launchpad-defaults.js\";\nimport { FieldError, ImagePick, type SectionProps } from \"./artwork-section.js\";\n\nexport function DetailsSection({ draft, setDraft, errors }: SectionProps) {\n const license = draft.license;\n const setLicense = (patch: Partial<typeof license>) => setDraft({ license: { ...license, ...patch } });\n return (\n <Section title=\"Details\" icon={<FileText className=\"h-4 w-4\" />}>\n <div className=\"space-y-1.5\">\n <p className=\"text-sm font-medium\">Cover image <span className=\"font-normal text-muted-foreground\">(optional — the artwork is used otherwise)</span></p>\n <ImagePick file={draft.cover} onPick={(f) => setDraft({ cover: f })} label=\"Choose a cover\" />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-sm font-medium\" htmlFor=\"drop-name\">Name</label>\n <Input id=\"drop-name\" value={draft.name} maxLength={100}\n onChange={(e) => {\n const name = e.target.value;\n const auto = !draft.symbol || draft.symbol === suggestLaunchpadSymbol(draft.name);\n setDraft(auto ? { name, symbol: suggestLaunchpadSymbol(name) } : { name });\n }} />\n <FieldError message={errors.name} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-sm font-medium\" htmlFor=\"drop-symbol\">Symbol</label>\n <Input id=\"drop-symbol\" value={draft.symbol} maxLength={10} className=\"max-w-[10rem] uppercase\"\n onChange={(e) => setDraft({ symbol: e.target.value.toUpperCase().replace(/[^A-Z0-9]/g, \"\") })} />\n <FieldError message={errors.symbol} />\n </div>\n <div className=\"space-y-1.5\">\n <label className=\"text-sm font-medium\" htmlFor=\"drop-description\">Description</label>\n <Textarea id=\"drop-description\" value={draft.description} maxLength={500} rows={3} onChange={(e) => setDraft({ description: e.target.value })} />\n </div>\n <div className=\"space-y-3 border-t border-border/60 pt-4\">\n <p className=\"text-sm font-medium\">License <span className=\"font-normal text-muted-foreground\">— saved with every token</span></p>\n <Select value={license.licenseType} onValueChange={(v) => {\n const def = LICENSE_TYPES.find((l) => l.value === v);\n setLicense(def ? { licenseType: v, commercialUse: def.commercialUse, derivatives: def.derivatives, attribution: def.attribution } : { licenseType: v });\n }}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>{LICENSE_TYPES.map((l) => <SelectItem key={l.value} value={l.value}>{l.label}</SelectItem>)}</SelectContent>\n </Select>\n <p className=\"text-xs font-medium\">Commercial use</p>\n <ToggleGroup value={license.commercialUse} options={[\"Yes\", \"No\"]} onChange={(v) => setLicense({ commercialUse: v })} />\n <p className=\"text-xs font-medium\">Remixing</p>\n <ToggleGroup value={license.derivatives} options={DERIVATIVES_OPTIONS} onChange={(v) => setLicense({ derivatives: v })} />\n <p className=\"text-xs font-medium\">AI training</p>\n <ToggleGroup value={license.aiPolicy} options={AI_POLICIES} onChange={(v) => setLicense({ aiPolicy: v })} />\n <p className=\"text-xs font-medium\">Type</p>\n <Select value={license.ipType} onValueChange={(v) => setLicense({ ipType: v })}>\n <SelectTrigger><SelectValue /></SelectTrigger>\n <SelectContent>{IP_TYPES.map((t) => <SelectItem key={t} value={t}>{t}</SelectItem>)}</SelectContent>\n </Select>\n </div>\n </Section>\n );\n}\n"],"mappings":";AAemC,cAE3B,YAF2B;AAbnC,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,SAAS,mBAAmB;AACrC,SAAS,QAAQ,eAAe,YAAY,eAAe,mBAAmB;AAC9E,SAAS,aAAa,qBAAqB,UAAU,qBAAqB;AAC1E,SAAS,8BAA8B;AACvC,SAAS,YAAY,iBAAoC;AAElD,SAAS,eAAe,EAAE,OAAO,UAAU,OAAO,GAAiB;AACxE,QAAM,UAAU,MAAM;AACtB,QAAM,aAAa,CAAC,UAAmC,SAAS,EAAE,SAAS,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,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