@medialane/ui 0.245.0 → 0.246.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 (43) hide show
  1. package/dist/components/pop-burn-button.cjs +65 -0
  2. package/dist/components/pop-burn-button.cjs.map +1 -0
  3. package/dist/components/pop-burn-button.d.cts +10 -0
  4. package/dist/components/pop-burn-button.d.ts +10 -0
  5. package/dist/components/pop-burn-button.js +41 -0
  6. package/dist/components/pop-burn-button.js.map +1 -0
  7. package/dist/components/pop-claim-button.cjs +92 -0
  8. package/dist/components/pop-claim-button.cjs.map +1 -0
  9. package/dist/components/pop-claim-button.d.cts +7 -0
  10. package/dist/components/pop-claim-button.d.ts +7 -0
  11. package/dist/components/pop-claim-button.js +68 -0
  12. package/dist/components/pop-claim-button.js.map +1 -0
  13. package/dist/components/portfolio-sponsorships.cjs +209 -0
  14. package/dist/components/portfolio-sponsorships.cjs.map +1 -0
  15. package/dist/components/portfolio-sponsorships.d.cts +5 -0
  16. package/dist/components/portfolio-sponsorships.d.ts +5 -0
  17. package/dist/components/portfolio-sponsorships.js +175 -0
  18. package/dist/components/portfolio-sponsorships.js.map +1 -0
  19. package/dist/components/sponsorship-offer-page.cjs +181 -0
  20. package/dist/components/sponsorship-offer-page.cjs.map +1 -0
  21. package/dist/components/sponsorship-offer-page.d.cts +7 -0
  22. package/dist/components/sponsorship-offer-page.d.ts +7 -0
  23. package/dist/components/sponsorship-offer-page.js +147 -0
  24. package/dist/components/sponsorship-offer-page.js.map +1 -0
  25. package/dist/components/sponsorship-offers-page.cjs +118 -0
  26. package/dist/components/sponsorship-offers-page.cjs.map +1 -0
  27. package/dist/components/sponsorship-offers-page.d.cts +5 -0
  28. package/dist/components/sponsorship-offers-page.d.ts +5 -0
  29. package/dist/components/sponsorship-offers-page.js +84 -0
  30. package/dist/components/sponsorship-offers-page.js.map +1 -0
  31. package/dist/components/transaction-done.cjs +46 -0
  32. package/dist/components/transaction-done.cjs.map +1 -0
  33. package/dist/components/transaction-done.d.cts +18 -0
  34. package/dist/components/transaction-done.d.ts +18 -0
  35. package/dist/components/transaction-done.js +22 -0
  36. package/dist/components/transaction-done.js.map +1 -0
  37. package/dist/index.cjs +18 -0
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +6 -0
  40. package/dist/index.d.ts +6 -0
  41. package/dist/index.js +12 -0
  42. package/dist/index.js.map +1 -1
  43. package/package.json +1 -1
@@ -0,0 +1,65 @@
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 pop_burn_button_exports = {};
21
+ __export(pop_burn_button_exports, {
22
+ PopBurnButton: () => PopBurnButton
23
+ });
24
+ module.exports = __toCommonJS(pop_burn_button_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = require("react");
27
+ var import_lucide_react = require("lucide-react");
28
+ var import_button = require("./button.js");
29
+ var import_medialane_app = require("./medialane-app.js");
30
+ var import_run_intent_calls = require("../utils/run-intent-calls.js");
31
+ var import_use_transaction = require("../utils/use-transaction.js");
32
+ function PopBurnButton({ collectionAddress, tokenId, onBurned }) {
33
+ const app = (0, import_medialane_app.useMedialaneApp)();
34
+ const [confirming, setConfirming] = (0, import_react.useState)(false);
35
+ const tx = (0, import_use_transaction.useTransaction)();
36
+ const busy = tx.phase === "preparing" || tx.phase === "submitting" || tx.phase === "confirming";
37
+ (0, import_react.useEffect)(() => {
38
+ if (tx.phase === "success") onBurned?.();
39
+ }, [tx.phase, onBurned]);
40
+ if (tx.phase === "success") {
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: "Removed from your wallet." });
42
+ }
43
+ if (!confirming) {
44
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { variant: "ghost", size: "sm", className: "text-muted-foreground", onClick: () => setConfirming(true), children: [
45
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Trash2, { className: "h-3.5 w-3.5 mr-1.5" }),
46
+ "Remove from my wallet"
47
+ ] });
48
+ }
49
+ const remove = () => void tx.run(async (signer) => {
50
+ await (0, import_run_intent_calls.runIntentCalls)(signer, () => app.getClient().api.intents.create("pop-burn", { owner: signer.address, collection: collectionAddress, tokenId: String(tokenId) }));
51
+ });
52
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2 rounded-xl border border-border p-3", children: [
53
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: "This permanently destroys this credential. You won't be able to claim it again." }),
54
+ tx.phase === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-destructive", children: tx.error }),
55
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-2", children: [
56
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", size: "sm", className: "flex-1", disabled: busy, onClick: () => setConfirming(false), children: "Keep it" }),
57
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "destructive", size: "sm", className: "flex-1", disabled: busy, onClick: remove, children: busy ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : "Remove" })
58
+ ] })
59
+ ] });
60
+ }
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ PopBurnButton
64
+ });
65
+ //# sourceMappingURL=pop-burn-button.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/pop-burn-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Loader2, Trash2 } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface PopBurnButtonProps {\n collectionAddress: string;\n tokenId: string;\n onBurned?: () => void;\n}\n\nexport function PopBurnButton({ collectionAddress, tokenId, onBurned }: PopBurnButtonProps) {\n const app = useMedialaneApp();\n const [confirming, setConfirming] = useState(false);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n if (tx.phase === \"success\") onBurned?.();\n }, [tx.phase, onBurned]);\n\n if (tx.phase === \"success\") {\n return <p className=\"text-xs text-muted-foreground\">Removed from your wallet.</p>;\n }\n\n if (!confirming) {\n return (\n <Button variant=\"ghost\" size=\"sm\" className=\"text-muted-foreground\" onClick={() => setConfirming(true)}>\n <Trash2 className=\"h-3.5 w-3.5 mr-1.5\" />\n Remove from my wallet\n </Button>\n );\n }\n\n const remove = () =>\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-burn\", { owner: signer.address, collection: collectionAddress, tokenId: String(tokenId) }));\n });\n\n return (\n <div className=\"space-y-2 rounded-xl border border-border p-3\">\n <p className=\"text-xs text-muted-foreground\">\n This permanently destroys this credential. You won&apos;t be able to claim it again.\n </p>\n {tx.phase === \"error\" && <p className=\"text-xs text-destructive\">{tx.error}</p>}\n <div className=\"flex gap-2\">\n <Button variant=\"outline\" size=\"sm\" className=\"flex-1\" disabled={busy} onClick={() => setConfirming(false)}>\n Keep it\n </Button>\n <Button variant=\"destructive\" size=\"sm\" className=\"flex-1\" disabled={busy} onClick={remove}>\n {busy ? <Loader2 className=\"h-3.5 w-3.5 animate-spin\" /> : \"Remove\"}\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BW;AAxBX,mBAAoC;AACpC,0BAAgC;AAChC,oBAAuB;AACvB,2BAAgC;AAChC,8BAA+B;AAC/B,6BAA+B;AAQxB,SAAS,cAAc,EAAE,mBAAmB,SAAS,SAAS,GAAuB;AAC1F,QAAM,UAAM,sCAAgB;AAC5B,QAAM,CAAC,YAAY,aAAa,QAAI,uBAAS,KAAK;AAClD,QAAM,SAAK,uCAAe;AAC1B,QAAM,OAAO,GAAG,UAAU,eAAe,GAAG,UAAU,gBAAgB,GAAG,UAAU;AAEnF,8BAAU,MAAM;AACd,QAAI,GAAG,UAAU,UAAW,YAAW;AAAA,EACzC,GAAG,CAAC,GAAG,OAAO,QAAQ,CAAC;AAEvB,MAAI,GAAG,UAAU,WAAW;AAC1B,WAAO,4CAAC,OAAE,WAAU,iCAAgC,uCAAyB;AAAA,EAC/E;AAEA,MAAI,CAAC,YAAY;AACf,WACE,6CAAC,wBAAO,SAAQ,SAAQ,MAAK,MAAK,WAAU,yBAAwB,SAAS,MAAM,cAAc,IAAI,GACnG;AAAA,kDAAC,8BAAO,WAAU,sBAAqB;AAAA,MAAE;AAAA,OAE3C;AAAA,EAEJ;AAEA,QAAM,SAAS,MACb,KAAK,GAAG,IAAI,OAAO,WAAW;AAC5B,cAAM,wCAAe,QAAQ,MAAM,IAAI,UAAU,EAAE,IAAI,QAAQ,OAAO,YAAY,EAAE,OAAO,OAAO,SAAS,YAAY,mBAAmB,SAAS,OAAO,OAAO,EAAE,CAAC,CAAC;AAAA,EACvK,CAAC;AAEH,SACE,6CAAC,SAAI,WAAU,iDACb;AAAA,gDAAC,OAAE,WAAU,iCAAgC,6FAE7C;AAAA,IACC,GAAG,UAAU,WAAW,4CAAC,OAAE,WAAU,4BAA4B,aAAG,OAAM;AAAA,IAC3E,6CAAC,SAAI,WAAU,cACb;AAAA,kDAAC,wBAAO,SAAQ,WAAU,MAAK,MAAK,WAAU,UAAS,UAAU,MAAM,SAAS,MAAM,cAAc,KAAK,GAAG,qBAE5G;AAAA,MACA,4CAAC,wBAAO,SAAQ,eAAc,MAAK,MAAK,WAAU,UAAS,UAAU,MAAM,SAAS,QACjF,iBAAO,4CAAC,+BAAQ,WAAU,4BAA2B,IAAK,UAC7D;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface PopBurnButtonProps {
4
+ collectionAddress: string;
5
+ tokenId: string;
6
+ onBurned?: () => void;
7
+ }
8
+ declare function PopBurnButton({ collectionAddress, tokenId, onBurned }: PopBurnButtonProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { PopBurnButton, type PopBurnButtonProps };
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface PopBurnButtonProps {
4
+ collectionAddress: string;
5
+ tokenId: string;
6
+ onBurned?: () => void;
7
+ }
8
+ declare function PopBurnButton({ collectionAddress, tokenId, onBurned }: PopBurnButtonProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { PopBurnButton, type PopBurnButtonProps };
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { Loader2, Trash2 } from "lucide-react";
5
+ import { Button } from "./button.js";
6
+ import { useMedialaneApp } from "./medialane-app.js";
7
+ import { runIntentCalls } from "../utils/run-intent-calls.js";
8
+ import { useTransaction } from "../utils/use-transaction.js";
9
+ function PopBurnButton({ collectionAddress, tokenId, onBurned }) {
10
+ const app = useMedialaneApp();
11
+ const [confirming, setConfirming] = useState(false);
12
+ const tx = useTransaction();
13
+ const busy = tx.phase === "preparing" || tx.phase === "submitting" || tx.phase === "confirming";
14
+ useEffect(() => {
15
+ if (tx.phase === "success") onBurned?.();
16
+ }, [tx.phase, onBurned]);
17
+ if (tx.phase === "success") {
18
+ return /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Removed from your wallet." });
19
+ }
20
+ if (!confirming) {
21
+ return /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", className: "text-muted-foreground", onClick: () => setConfirming(true), children: [
22
+ /* @__PURE__ */ jsx(Trash2, { className: "h-3.5 w-3.5 mr-1.5" }),
23
+ "Remove from my wallet"
24
+ ] });
25
+ }
26
+ const remove = () => void tx.run(async (signer) => {
27
+ await runIntentCalls(signer, () => app.getClient().api.intents.create("pop-burn", { owner: signer.address, collection: collectionAddress, tokenId: String(tokenId) }));
28
+ });
29
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-2 rounded-xl border border-border p-3", children: [
30
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "This permanently destroys this credential. You won't be able to claim it again." }),
31
+ tx.phase === "error" && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: tx.error }),
32
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
33
+ /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", className: "flex-1", disabled: busy, onClick: () => setConfirming(false), children: "Keep it" }),
34
+ /* @__PURE__ */ jsx(Button, { variant: "destructive", size: "sm", className: "flex-1", disabled: busy, onClick: remove, children: busy ? /* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : "Remove" })
35
+ ] })
36
+ ] });
37
+ }
38
+ export {
39
+ PopBurnButton
40
+ };
41
+ //# sourceMappingURL=pop-burn-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/pop-burn-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Loader2, Trash2 } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface PopBurnButtonProps {\n collectionAddress: string;\n tokenId: string;\n onBurned?: () => void;\n}\n\nexport function PopBurnButton({ collectionAddress, tokenId, onBurned }: PopBurnButtonProps) {\n const app = useMedialaneApp();\n const [confirming, setConfirming] = useState(false);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n if (tx.phase === \"success\") onBurned?.();\n }, [tx.phase, onBurned]);\n\n if (tx.phase === \"success\") {\n return <p className=\"text-xs text-muted-foreground\">Removed from your wallet.</p>;\n }\n\n if (!confirming) {\n return (\n <Button variant=\"ghost\" size=\"sm\" className=\"text-muted-foreground\" onClick={() => setConfirming(true)}>\n <Trash2 className=\"h-3.5 w-3.5 mr-1.5\" />\n Remove from my wallet\n </Button>\n );\n }\n\n const remove = () =>\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-burn\", { owner: signer.address, collection: collectionAddress, tokenId: String(tokenId) }));\n });\n\n return (\n <div className=\"space-y-2 rounded-xl border border-border p-3\">\n <p className=\"text-xs text-muted-foreground\">\n This permanently destroys this credential. You won&apos;t be able to claim it again.\n </p>\n {tx.phase === \"error\" && <p className=\"text-xs text-destructive\">{tx.error}</p>}\n <div className=\"flex gap-2\">\n <Button variant=\"outline\" size=\"sm\" className=\"flex-1\" disabled={busy} onClick={() => setConfirming(false)}>\n Keep it\n </Button>\n <Button variant=\"destructive\" size=\"sm\" className=\"flex-1\" disabled={busy} onClick={remove}>\n {busy ? <Loader2 className=\"h-3.5 w-3.5 animate-spin\" /> : \"Remove\"}\n </Button>\n </div>\n </div>\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AU,UAAS,UAAU,MAAM,SAAS,MAAM,cAAc,KAAK,GAAG,qBAE5G;AAAA,MACA,oBAAC,UAAO,SAAQ,eAAc,MAAK,MAAK,WAAU,UAAS,UAAU,MAAM,SAAS,QACjF,iBAAO,oBAAC,WAAQ,WAAU,4BAA2B,IAAK,UAC7D;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,92 @@
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 pop_claim_button_exports = {};
21
+ __export(pop_claim_button_exports, {
22
+ PopClaimButton: () => PopClaimButton
23
+ });
24
+ module.exports = __toCommonJS(pop_claim_button_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = require("react");
27
+ var import_lucide_react = require("lucide-react");
28
+ var import_starknet = require("@medialane/sdk/starknet");
29
+ var import_button = require("./button.js");
30
+ var import_transaction_dialog = require("./transaction-dialog.js");
31
+ var import_transaction_done = require("./transaction-done.js");
32
+ var import_reward_earned = require("./rewards/reward-earned.js");
33
+ var import_medialane_app = require("./medialane-app.js");
34
+ var import_claim_proof = require("../utils/drop/claim-proof.js");
35
+ var import_run_intent_calls = require("../utils/run-intent-calls.js");
36
+ var import_use_pop = require("../utils/use-pop.js");
37
+ var import_use_transaction = require("../utils/use-transaction.js");
38
+ function PopClaimButton({ collectionAddress }) {
39
+ const app = (0, import_medialane_app.useMedialaneApp)();
40
+ const { walletAddress } = app;
41
+ const { hasClaimed, mutate } = (0, import_use_pop.usePopClaimStatus)(collectionAddress, walletAddress);
42
+ const [proof, setProof] = (0, import_react.useState)(null);
43
+ const [info, setInfo] = (0, import_react.useState)(null);
44
+ const tx = (0, import_use_transaction.useTransaction)();
45
+ const busy = tx.phase === "preparing" || tx.phase === "submitting" || tx.phase === "confirming";
46
+ (0, import_react.useEffect)(() => {
47
+ let storage = null;
48
+ try {
49
+ storage = window.sessionStorage;
50
+ } catch {
51
+ storage = null;
52
+ }
53
+ setProof((0, import_claim_proof.claimProofFor)(storage, collectionAddress, window.location.hash));
54
+ app.getClient().api.chainReads.popClaimInfo(collectionAddress).then(setInfo).catch(() => setInfo(null));
55
+ }, [app, collectionAddress]);
56
+ (0, import_react.useEffect)(() => {
57
+ if (tx.phase === "success") void mutate();
58
+ }, [tx.phase, mutate]);
59
+ const state = (0, import_starknet.popClaimState)({
60
+ hasClaimed,
61
+ proof,
62
+ wallet: walletAddress,
63
+ info: info && { ...info, now: Math.floor(Date.now() / 1e3) }
64
+ });
65
+ const claim = () => {
66
+ if (!proof) return;
67
+ void tx.run(async (signer) => {
68
+ await (0, import_run_intent_calls.runIntentCalls)(signer, () => app.getClient().api.intents.create("pop-claim", { claimer: signer.address, collection: collectionAddress, proof }));
69
+ });
70
+ };
71
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
72
+ (state === "ready" || busy) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { size: "sm", className: "w-full gap-1.5", onClick: claim, disabled: busy, children: [
73
+ busy ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-3.5 w-3.5" }),
74
+ busy ? "Claiming\u2026" : "Claim credential"
75
+ ] }),
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: "Claim credential", workingLabel: "Claiming your credential\u2026", firstStepLabel: "Prepare claim", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
77
+ import_transaction_done.TransactionDone,
78
+ {
79
+ tx,
80
+ name: "Credential",
81
+ title: "Credential claimed!",
82
+ description: "Your proof of participation is now on-chain.",
83
+ footer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reward_earned.RewardEarned, { actionType: "claim_pop" })
84
+ }
85
+ ) })
86
+ ] });
87
+ }
88
+ // Annotate the CommonJS export names for ESM import in node:
89
+ 0 && (module.exports = {
90
+ PopClaimButton
91
+ });
92
+ //# sourceMappingURL=pop-claim-button.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/pop-claim-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Award, Loader2 } from \"lucide-react\";\nimport { popClaimState, type PopClaimInfo } from \"@medialane/sdk/starknet\";\nimport { Button } from \"./button.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionDone } from \"./transaction-done.js\";\nimport { RewardEarned } from \"./rewards/reward-earned.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { claimProofFor } from \"../utils/drop/claim-proof.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { usePopClaimStatus } from \"../utils/use-pop.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nexport function PopClaimButton({ collectionAddress }: { collectionAddress: string }) {\n const app = useMedialaneApp();\n const { walletAddress } = app;\n const { hasClaimed, mutate } = usePopClaimStatus(collectionAddress, walletAddress);\n const [proof, setProof] = useState<string[] | null>(null);\n const [info, setInfo] = useState<PopClaimInfo | null>(null);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n let storage: Storage | null = null;\n try {\n storage = window.sessionStorage;\n } catch {\n storage = null;\n }\n setProof(claimProofFor(storage, collectionAddress, window.location.hash));\n app.getClient().api.chainReads.popClaimInfo(collectionAddress)\n .then(setInfo)\n .catch(() => setInfo(null));\n }, [app, collectionAddress]);\n\n useEffect(() => {\n if (tx.phase === \"success\") void mutate();\n }, [tx.phase, mutate]);\n\n const state = popClaimState({\n hasClaimed,\n proof,\n wallet: walletAddress,\n info: info && { ...info, now: Math.floor(Date.now() / 1000) },\n });\n\n const claim = () => {\n if (!proof) return;\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-claim\", { claimer: signer.address, collection: collectionAddress, proof }));\n });\n };\n\n return (\n <>\n {(state === \"ready\" || busy) && (\n <Button size=\"sm\" className=\"w-full gap-1.5\" onClick={claim} disabled={busy}>\n {busy ? <Loader2 className=\"h-3.5 w-3.5 animate-spin\" /> : <Award className=\"h-3.5 w-3.5\" />}\n {busy ? \"Claiming…\" : \"Claim credential\"}\n </Button>\n )}\n <TransactionDialog tx={tx} title=\"Claim credential\" workingLabel=\"Claiming your credential…\" firstStepLabel=\"Prepare claim\">\n <TransactionDone\n tx={tx}\n name=\"Credential\"\n title=\"Credential claimed!\"\n description=\"Your proof of participation is now on-chain.\"\n footer={<RewardEarned actionType=\"claim_pop\" />}\n />\n </TransactionDialog>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwDI;AAtDJ,mBAAoC;AACpC,0BAA+B;AAC/B,sBAAiD;AACjD,oBAAuB;AACvB,gCAAkC;AAClC,8BAAgC;AAChC,2BAA6B;AAC7B,2BAAgC;AAChC,yBAA8B;AAC9B,8BAA+B;AAC/B,qBAAkC;AAClC,6BAA+B;AAExB,SAAS,eAAe,EAAE,kBAAkB,GAAkC;AACnF,QA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AAK,WAAU,kBAAiB,SAAS,OAAO,UAAU,MACpE;AAAA,aAAO,4CAAC,+BAAQ,WAAU,4BAA2B,IAAK,4CAAC,6BAAM,WAAU,eAAc;AAAA,MACzF,OAAO,mBAAc;AAAA,OACxB;AAAA,IAEF,4CAAC,+CAAkB,IAAQ,OAAM,oBAAmB,cAAa,kCAA4B,gBAAe,iBAC1G;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,MAAK;AAAA,QACL,OAAM;AAAA,QACN,aAAY;AAAA,QACZ,QAAQ,4CAAC,qCAAa,YAAW,aAAY;AAAA;AAAA,IAC/C,GACF;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function PopClaimButton({ collectionAddress }: {
4
+ collectionAddress: string;
5
+ }): react_jsx_runtime.JSX.Element;
6
+
7
+ export { PopClaimButton };
@@ -0,0 +1,7 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function PopClaimButton({ collectionAddress }: {
4
+ collectionAddress: string;
5
+ }): react_jsx_runtime.JSX.Element;
6
+
7
+ export { PopClaimButton };
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { Award, Loader2 } from "lucide-react";
5
+ import { popClaimState } from "@medialane/sdk/starknet";
6
+ import { Button } from "./button.js";
7
+ import { TransactionDialog } from "./transaction-dialog.js";
8
+ import { TransactionDone } from "./transaction-done.js";
9
+ import { RewardEarned } from "./rewards/reward-earned.js";
10
+ import { useMedialaneApp } from "./medialane-app.js";
11
+ import { claimProofFor } from "../utils/drop/claim-proof.js";
12
+ import { runIntentCalls } from "../utils/run-intent-calls.js";
13
+ import { usePopClaimStatus } from "../utils/use-pop.js";
14
+ import { useTransaction } from "../utils/use-transaction.js";
15
+ function PopClaimButton({ collectionAddress }) {
16
+ const app = useMedialaneApp();
17
+ const { walletAddress } = app;
18
+ const { hasClaimed, mutate } = usePopClaimStatus(collectionAddress, walletAddress);
19
+ const [proof, setProof] = useState(null);
20
+ const [info, setInfo] = useState(null);
21
+ const tx = useTransaction();
22
+ const busy = tx.phase === "preparing" || tx.phase === "submitting" || tx.phase === "confirming";
23
+ useEffect(() => {
24
+ let storage = null;
25
+ try {
26
+ storage = window.sessionStorage;
27
+ } catch {
28
+ storage = null;
29
+ }
30
+ setProof(claimProofFor(storage, collectionAddress, window.location.hash));
31
+ app.getClient().api.chainReads.popClaimInfo(collectionAddress).then(setInfo).catch(() => setInfo(null));
32
+ }, [app, collectionAddress]);
33
+ useEffect(() => {
34
+ if (tx.phase === "success") void mutate();
35
+ }, [tx.phase, mutate]);
36
+ const state = popClaimState({
37
+ hasClaimed,
38
+ proof,
39
+ wallet: walletAddress,
40
+ info: info && { ...info, now: Math.floor(Date.now() / 1e3) }
41
+ });
42
+ const claim = () => {
43
+ if (!proof) return;
44
+ void tx.run(async (signer) => {
45
+ await runIntentCalls(signer, () => app.getClient().api.intents.create("pop-claim", { claimer: signer.address, collection: collectionAddress, proof }));
46
+ });
47
+ };
48
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
49
+ (state === "ready" || busy) && /* @__PURE__ */ jsxs(Button, { size: "sm", className: "w-full gap-1.5", onClick: claim, disabled: busy, children: [
50
+ busy ? /* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx(Award, { className: "h-3.5 w-3.5" }),
51
+ busy ? "Claiming\u2026" : "Claim credential"
52
+ ] }),
53
+ /* @__PURE__ */ jsx(TransactionDialog, { tx, title: "Claim credential", workingLabel: "Claiming your credential\u2026", firstStepLabel: "Prepare claim", children: /* @__PURE__ */ jsx(
54
+ TransactionDone,
55
+ {
56
+ tx,
57
+ name: "Credential",
58
+ title: "Credential claimed!",
59
+ description: "Your proof of participation is now on-chain.",
60
+ footer: /* @__PURE__ */ jsx(RewardEarned, { actionType: "claim_pop" })
61
+ }
62
+ ) })
63
+ ] });
64
+ }
65
+ export {
66
+ PopClaimButton
67
+ };
68
+ //# sourceMappingURL=pop-claim-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/pop-claim-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Award, Loader2 } from \"lucide-react\";\nimport { popClaimState, type PopClaimInfo } from \"@medialane/sdk/starknet\";\nimport { Button } from \"./button.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionDone } from \"./transaction-done.js\";\nimport { RewardEarned } from \"./rewards/reward-earned.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { claimProofFor } from \"../utils/drop/claim-proof.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { usePopClaimStatus } from \"../utils/use-pop.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nexport function PopClaimButton({ collectionAddress }: { collectionAddress: string }) {\n const app = useMedialaneApp();\n const { walletAddress } = app;\n const { hasClaimed, mutate } = usePopClaimStatus(collectionAddress, walletAddress);\n const [proof, setProof] = useState<string[] | null>(null);\n const [info, setInfo] = useState<PopClaimInfo | null>(null);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n let storage: Storage | null = null;\n try {\n storage = window.sessionStorage;\n } catch {\n storage = null;\n }\n setProof(claimProofFor(storage, collectionAddress, window.location.hash));\n app.getClient().api.chainReads.popClaimInfo(collectionAddress)\n .then(setInfo)\n .catch(() => setInfo(null));\n }, [app, collectionAddress]);\n\n useEffect(() => {\n if (tx.phase === \"success\") void mutate();\n }, [tx.phase, mutate]);\n\n const state = popClaimState({\n hasClaimed,\n proof,\n wallet: walletAddress,\n info: info && { ...info, now: Math.floor(Date.now() / 1000) },\n });\n\n const claim = () => {\n if (!proof) return;\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-claim\", { claimer: signer.address, collection: collectionAddress, proof }));\n });\n };\n\n return (\n <>\n {(state === \"ready\" || busy) && (\n <Button size=\"sm\" className=\"w-full gap-1.5\" onClick={claim} disabled={busy}>\n {busy ? <Loader2 className=\"h-3.5 w-3.5 animate-spin\" /> : <Award className=\"h-3.5 w-3.5\" />}\n {busy ? \"Claiming…\" : \"Claim credential\"}\n </Button>\n )}\n <TransactionDialog tx={tx} title=\"Claim credential\" workingLabel=\"Claiming your credential…\" firstStepLabel=\"Prepare claim\">\n <TransactionDone\n tx={tx}\n name=\"Credential\"\n title=\"Credential claimed!\"\n description=\"Your proof of participation is now on-chain.\"\n footer={<RewardEarned actionType=\"claim_pop\" />}\n />\n </TransactionDialog>\n </>\n );\n}\n"],"mappings":";AAwDI,mBAGc,KADV,YAFJ;AAtDJ,SAAS,WAAW,gBAAgB;AACpC,SAAS,OAAO,eAAe;AAC/B,SAAS,qBAAwC;AACjD,SAAS,cAAc;AACvB,SAAS,yBAAyB;AAClC,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAExB,SAAS,eAAe,EAAE,kBAAkB,GAAkC;AACnF,QAAM,MAAM,gBAAgB;AAC5B,QAAM,EAAE,cAAc,IAAI;AAC1B,QAAM,EAAE,YAAY,OAAO,IAAI,kBAAkB,mBAAmB,aAAa;AACjF,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA0B,IAAI;AACxD,QAAM,CAAC,MAAM,OAAO,IAAI,SAA8B,IAAI;AAC1D,QAAM,KAAK,eAAe;AAC1B,QAAM,OAAO,GAAG,UAAU,eAAe,GAAG,UAAU,gBAAgB,GAAG,UAAU;AAEnF,YAAU,MAAM;AACd,QAAI,UAA0B;AAC9B,QAAI;AACF,gBAAU,OAAO;AAAA,IACnB,QAAQ;AACN,gBAA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0 +1,209 @@
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 portfolio_sponsorships_exports = {};
31
+ __export(portfolio_sponsorships_exports, {
32
+ PortfolioSponsorships: () => PortfolioSponsorships
33
+ });
34
+ module.exports = __toCommonJS(portfolio_sponsorships_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_react = require("react");
37
+ var import_lucide_react = require("lucide-react");
38
+ var import_sdk = require("@medialane/sdk");
39
+ var import_address_display = require("./address-display.js");
40
+ var import_button = require("./button.js");
41
+ var import_link = __toESM(require("./link.js"), 1);
42
+ var import_medialane_app = require("./medialane-app.js");
43
+ var import_skeleton = require("./skeleton.js");
44
+ var import_transaction_dialog = require("./transaction-dialog.js");
45
+ var import_transaction_done = require("./transaction-done.js");
46
+ var import_run_intent_calls = require("../utils/run-intent-calls.js");
47
+ var import_use_sponsorship = require("../utils/use-sponsorship.js");
48
+ var import_use_transaction = require("../utils/use-transaction.js");
49
+ function useRowAction(copy) {
50
+ const app = (0, import_medialane_app.useMedialaneApp)();
51
+ const tx = (0, import_use_transaction.useTransaction)();
52
+ const [activeId, setActiveId] = (0, import_react.useState)(null);
53
+ const busy = tx.phase === "preparing" || tx.phase === "submitting" || tx.phase === "confirming";
54
+ const run = (id, create, then) => {
55
+ setActiveId(id);
56
+ void tx.run(async (signer) => {
57
+ await (0, import_run_intent_calls.runIntentCalls)(signer, () => create(app.getClient().api));
58
+ }).then(() => then()).finally(() => setActiveId(null));
59
+ };
60
+ const dialog = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: copy.title, workingLabel: copy.working, firstStepLabel: "Prepare", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_done.TransactionDone, { tx, name: copy.title, title: copy.done, description: copy.description }) });
61
+ return { run, dialog, busy, activeId };
62
+ }
63
+ function Spinner({ active, idle, className }) {
64
+ return active ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: `h-3 w-3 animate-spin ${className ?? ""}` }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: idle });
65
+ }
66
+ function OfferBidsRow({ offer }) {
67
+ const { walletAddress } = (0, import_medialane_app.useMedialaneApp)();
68
+ const { bids, isLoading, mutate } = (0, import_use_sponsorship.useSponsorshipBids)(offer.offerId);
69
+ const action = useRowAction({ title: "Accept bid", working: "Accepting the bid\u2026", done: "Bid accepted!", description: "The license is minted to the sponsor." });
70
+ if (isLoading || bids.length === 0) return null;
71
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5 rounded-lg bg-muted/30 p-3", children: [
72
+ action.dialog,
73
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs font-semibold text-muted-foreground", children: [
74
+ "Bids on ",
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_sdk.assetHref)("STARKNET", offer.nftContract, offer.tokenId), className: "underline underline-offset-2", children: "View asset" })
76
+ ] }),
77
+ bids.map((bid) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-2 text-xs", children: [
78
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: bid.sponsor, chars: 4, showCopy: false, className: "text-muted-foreground" }),
79
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
80
+ import_button.Button,
81
+ {
82
+ size: "sm",
83
+ className: "bg-brand-rose hover:brightness-110 text-white h-7 px-2.5",
84
+ "aria-label": "Accept bid",
85
+ disabled: action.busy || !walletAddress,
86
+ onClick: () => action.run(
87
+ bid.id,
88
+ (api) => api.intents.create("sponsorship-bid-accept", { author: walletAddress, offerId: offer.offerId, sponsor: bid.sponsor }),
89
+ () => mutate()
90
+ ),
91
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { active: action.busy && action.activeId === bid.id, idle: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CheckCircle2, { className: "h-3 w-3" }) })
92
+ }
93
+ )
94
+ ] }, bid.id))
95
+ ] });
96
+ }
97
+ function ReceivedProposals({ walletAddress }) {
98
+ const { proposals, isLoading, mutate } = (0, import_use_sponsorship.useSponsorshipProposals)({ owner: walletAddress, open: true });
99
+ const action = useRowAction({ title: "Respond to proposal", working: "Sending your response\u2026", done: "Response sent!", description: "Your response is now on-chain." });
100
+ if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-20 w-full rounded-xl" });
101
+ if (proposals.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "No proposals awaiting your decision." });
102
+ const respond = (proposalId, decision) => action.run(
103
+ proposalId,
104
+ (api) => decision === "accept" ? api.intents.create("sponsorship-proposal-accept", { owner: walletAddress, proposalId }) : api.intents.create("sponsorship-proposal-reject", { owner: walletAddress, proposalId }),
105
+ () => mutate()
106
+ );
107
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
108
+ action.dialog,
109
+ proposals.map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell p-4 flex items-center justify-between gap-3", children: [
110
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_sdk.assetHref)("STARKNET", p.nftContract, p.tokenId), className: "hover:underline", children: "View asset" }) }),
112
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: p.proposer, chars: 4, showCopy: false }),
114
+ " proposed ",
115
+ p.amount
116
+ ] })
117
+ ] }),
118
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-1.5 shrink-0", children: [
119
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { size: "sm", variant: "outline", "aria-label": "Decline proposal", disabled: action.busy, onClick: () => respond(p.proposalId, "reject"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { active: action.busy && action.activeId === p.proposalId, idle: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-3 w-3" }) }) }),
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { size: "sm", className: "bg-brand-rose hover:brightness-110 text-white", "aria-label": "Accept proposal", disabled: action.busy, onClick: () => respond(p.proposalId, "accept"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { active: action.busy && action.activeId === p.proposalId, idle: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CheckCircle2, { className: "h-3 w-3" }) }) })
121
+ ] })
122
+ ] }, p.id))
123
+ ] });
124
+ }
125
+ function SentProposals({ walletAddress }) {
126
+ const { proposals, isLoading, mutate } = (0, import_use_sponsorship.useSponsorshipProposals)({ proposer: walletAddress, open: true });
127
+ const action = useRowAction({ title: "Withdraw proposal", working: "Withdrawing your proposal\u2026", done: "Proposal withdrawn!", description: "Your proposal is no longer open." });
128
+ if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-20 w-full rounded-xl" });
129
+ if (proposals.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "No pending proposals sent." });
130
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
131
+ action.dialog,
132
+ proposals.map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell p-4 flex items-center justify-between gap-3", children: [
133
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_sdk.assetHref)("STARKNET", p.nftContract, p.tokenId), className: "hover:underline", children: "View asset" }) }),
135
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
136
+ "You proposed ",
137
+ p.amount
138
+ ] })
139
+ ] }),
140
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
141
+ import_button.Button,
142
+ {
143
+ size: "sm",
144
+ variant: "outline",
145
+ disabled: action.busy,
146
+ onClick: () => action.run(p.proposalId, (api) => api.intents.create("sponsorship-proposal-withdraw", { proposer: walletAddress, proposalId: p.proposalId }), () => mutate()),
147
+ children: [
148
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { active: action.busy && action.activeId === p.proposalId, idle: null, className: "mr-1.5" }),
149
+ "Withdraw"
150
+ ]
151
+ }
152
+ )
153
+ ] }, p.id))
154
+ ] });
155
+ }
156
+ function LicenseList({ loading, empty, children }) {
157
+ if (loading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-16 w-full rounded-xl" });
158
+ if (children.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: empty });
159
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-2", children });
160
+ }
161
+ function PortfolioSponsorships() {
162
+ const { walletAddress } = (0, import_medialane_app.useMedialaneApp)();
163
+ const { offers } = (0, import_use_sponsorship.useSponsorshipOffers)(walletAddress ? { author: walletAddress, open: true } : void 0);
164
+ const { licenses: held, isLoading: heldLoading } = (0, import_use_sponsorship.useSponsorshipLicenses)(walletAddress ? { holder: walletAddress } : void 0);
165
+ const { licenses: issued, isLoading: issuedLoading } = (0, import_use_sponsorship.useSponsorshipLicenses)(walletAddress ? { author: walletAddress } : void 0);
166
+ if (!walletAddress) return null;
167
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-8", children: [
168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
169
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h2", { className: "text-sm font-bold flex items-center gap-2", children: [
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Handshake, { className: "h-4 w-4 text-brand-rose" }),
171
+ "Proposals awaiting your decision"
172
+ ] }),
173
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReceivedProposals, { walletAddress })
174
+ ] }),
175
+ offers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
176
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-sm font-bold", children: "Bids on your offers" }),
177
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-2", children: offers.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OfferBidsRow, { offer: o }, o.id)) })
178
+ ] }),
179
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
180
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-sm font-bold", children: "Proposals you've sent" }),
181
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SentProposals, { walletAddress })
182
+ ] }),
183
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
184
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-sm font-bold", children: "Licenses you hold" }),
185
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LicenseList, { loading: heldLoading, empty: "No sponsorship licenses yet.", children: held.map((l) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell p-4", children: [
186
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_sdk.assetHref)("STARKNET", l.assetContract, l.assetTokenId), className: "hover:underline", children: "License on this asset" }) }),
187
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
188
+ "from ",
189
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: l.author, chars: 4, showCopy: false })
190
+ ] })
191
+ ] }, l.id)) })
192
+ ] }),
193
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
194
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-sm font-bold", children: "Licenses issued on your work" }),
195
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LicenseList, { loading: issuedLoading, empty: "No licenses issued yet.", children: issued.map((l) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell p-4", children: [
196
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_sdk.assetHref)("STARKNET", l.assetContract, l.assetTokenId), className: "hover:underline", children: "License on this asset" }) }),
197
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
198
+ "held by ",
199
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: l.currentHolder ?? l.recipient, chars: 4, showCopy: false })
200
+ ] })
201
+ ] }, l.id)) })
202
+ ] })
203
+ ] });
204
+ }
205
+ // Annotate the CommonJS export names for ESM import in node:
206
+ 0 && (module.exports = {
207
+ PortfolioSponsorships
208
+ });
209
+ //# sourceMappingURL=portfolio-sponsorships.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/portfolio-sponsorships.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { CheckCircle2, Handshake, Loader2, X } from \"lucide-react\";\nimport { assetHref, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionDone } from \"./transaction-done.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useSponsorshipBids, useSponsorshipLicenses, useSponsorshipOffers, useSponsorshipProposals } from \"../utils/use-sponsorship.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\ntype Api = ReturnType<ReturnType<typeof useMedialaneApp>[\"getClient\"]>[\"api\"];\n\nfunction useRowAction(copy: { title: string; working: string; done: string; description: string }) {\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [activeId, setActiveId] = useState<string | null>(null);\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const run = (id: string, create: (api: Api) => ReturnType<Parameters<typeof runIntentCalls>[1]>, then: () => Promise<unknown>) => {\n setActiveId(id);\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => create(app.getClient().api));\n })\n .then(() => then())\n .finally(() => setActiveId(null));\n };\n\n const dialog = (\n <TransactionDialog tx={tx} title={copy.title} workingLabel={copy.working} firstStepLabel=\"Prepare\">\n <TransactionDone tx={tx} name={copy.title} title={copy.done} description={copy.description} />\n </TransactionDialog>\n );\n\n return { run, dialog, busy, activeId };\n}\n\nfunction Spinner({ active, idle, className }: { active: boolean; idle: React.ReactNode; className?: string }) {\n return active ? <Loader2 className={`h-3 w-3 animate-spin ${className ?? \"\"}`} /> : <>{idle}</>;\n}\n\nfunction OfferBidsRow({ offer }: { offer: ApiSponsorshipOffer }) {\n const { walletAddress } = useMedialaneApp();\n const { bids, isLoading, mutate } = useSponsorshipBids(offer.offerId);\n const action = useRowAction({ title: \"Accept bid\", working: \"Accepting the bid…\", done: \"Bid accepted!\", description: \"The license is minted to the sponsor.\" });\n\n if (isLoading || bids.length === 0) return null;\n\n return (\n <div className=\"space-y-1.5 rounded-lg bg-muted/30 p-3\">\n {action.dialog}\n <p className=\"text-xs font-semibold text-muted-foreground\">\n Bids on <Link href={assetHref(\"STARKNET\", offer.nftContract, offer.tokenId)} className=\"underline underline-offset-2\">View asset</Link>\n </p>\n {bids.map((bid) => (\n <div key={bid.id} className=\"flex items-center justify-between gap-2 text-xs\">\n <AddressDisplay address={bid.sponsor} chars={4} showCopy={false} className=\"text-muted-foreground\" />\n <Button\n size=\"sm\"\n className=\"bg-brand-rose hover:brightness-110 text-white h-7 px-2.5\"\n aria-label=\"Accept bid\"\n disabled={action.busy || !walletAddress}\n onClick={() =>\n action.run(\n bid.id,\n (api) => api.intents.create(\"sponsorship-bid-accept\", { author: walletAddress!, offerId: offer.offerId, sponsor: bid.sponsor }),\n () => mutate(),\n )\n }\n >\n <Spinner active={action.busy && action.activeId === bid.id} idle={<CheckCircle2 className=\"h-3 w-3\" />} />\n </Button>\n </div>\n ))}\n </div>\n );\n}\n\nfunction ReceivedProposals({ walletAddress }: { walletAddress: string }) {\n const { proposals, isLoading, mutate } = useSponsorshipProposals({ owner: walletAddress, open: true });\n const action = useRowAction({ title: \"Respond to proposal\", working: \"Sending your response…\", done: \"Response sent!\", description: \"Your response is now on-chain.\" });\n\n if (isLoading) return <Skeleton className=\"h-20 w-full rounded-xl\" />;\n if (proposals.length === 0) return <p className=\"text-sm text-muted-foreground\">No proposals awaiting your decision.</p>;\n\n const respond = (proposalId: string, decision: \"accept\" | \"reject\") =>\n action.run(\n proposalId,\n (api) =>\n decision === \"accept\"\n ? api.intents.create(\"sponsorship-proposal-accept\", { owner: walletAddress, proposalId })\n : api.intents.create(\"sponsorship-proposal-reject\", { owner: walletAddress, proposalId }),\n () => mutate(),\n );\n\n return (\n <div className=\"space-y-2\">\n {action.dialog}\n {proposals.map((p) => (\n <div key={p.id} className=\"bento-cell p-4 flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", p.nftContract, p.tokenId)} className=\"hover:underline\">View asset</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">\n <AddressDisplay address={p.proposer} chars={4} showCopy={false} /> proposed {p.amount}\n </p>\n </div>\n <div className=\"flex gap-1.5 shrink-0\">\n <Button size=\"sm\" variant=\"outline\" aria-label=\"Decline proposal\" disabled={action.busy} onClick={() => respond(p.proposalId, \"reject\")}>\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={<X className=\"h-3 w-3\" />} />\n </Button>\n <Button size=\"sm\" className=\"bg-brand-rose hover:brightness-110 text-white\" aria-label=\"Accept proposal\" disabled={action.busy} onClick={() => respond(p.proposalId, \"accept\")}>\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={<CheckCircle2 className=\"h-3 w-3\" />} />\n </Button>\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction SentProposals({ walletAddress }: { walletAddress: string }) {\n const { proposals, isLoading, mutate } = useSponsorshipProposals({ proposer: walletAddress, open: true });\n const action = useRowAction({ title: \"Withdraw proposal\", working: \"Withdrawing your proposal…\", done: \"Proposal withdrawn!\", description: \"Your proposal is no longer open.\" });\n\n if (isLoading) return <Skeleton className=\"h-20 w-full rounded-xl\" />;\n if (proposals.length === 0) return <p className=\"text-sm text-muted-foreground\">No pending proposals sent.</p>;\n\n return (\n <div className=\"space-y-2\">\n {action.dialog}\n {proposals.map((p) => (\n <div key={p.id} className=\"bento-cell p-4 flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", p.nftContract, p.tokenId)} className=\"hover:underline\">View asset</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">You proposed {p.amount}</p>\n </div>\n <Button\n size=\"sm\"\n variant=\"outline\"\n disabled={action.busy}\n onClick={() =>\n action.run(p.proposalId, (api) => api.intents.create(\"sponsorship-proposal-withdraw\", { proposer: walletAddress, proposalId: p.proposalId }), () => mutate())\n }\n >\n <Spinner active={action.busy && action.activeId === p.proposalId} idle={null} className=\"mr-1.5\" />\n Withdraw\n </Button>\n </div>\n ))}\n </div>\n );\n}\n\nfunction LicenseList({ loading, empty, children }: { loading: boolean; empty: string; children: React.ReactNode[] }) {\n if (loading) return <Skeleton className=\"h-16 w-full rounded-xl\" />;\n if (children.length === 0) return <p className=\"text-sm text-muted-foreground\">{empty}</p>;\n return <div className=\"space-y-2\">{children}</div>;\n}\n\nexport function PortfolioSponsorships() {\n const { walletAddress } = useMedialaneApp();\n const { offers } = useSponsorshipOffers(walletAddress ? { author: walletAddress, open: true } : undefined);\n const { licenses: held, isLoading: heldLoading } = useSponsorshipLicenses(walletAddress ? { holder: walletAddress } : undefined);\n const { licenses: issued, isLoading: issuedLoading } = useSponsorshipLicenses(walletAddress ? { author: walletAddress } : undefined);\n\n if (!walletAddress) return null;\n\n return (\n <div className=\"space-y-8\">\n <section className=\"space-y-3\">\n <h2 className=\"text-sm font-bold flex items-center gap-2\"><Handshake className=\"h-4 w-4 text-brand-rose\" />Proposals awaiting your decision</h2>\n <ReceivedProposals walletAddress={walletAddress} />\n </section>\n\n {offers.length > 0 && (\n <section className=\"space-y-3\">\n <h2 className=\"text-sm font-bold\">Bids on your offers</h2>\n <div className=\"space-y-2\">\n {offers.map((o) => <OfferBidsRow key={o.id} offer={o} />)}\n </div>\n </section>\n )}\n\n <section className=\"space-y-3\">\n <h2 className=\"text-sm font-bold\">Proposals you&apos;ve sent</h2>\n <SentProposals walletAddress={walletAddress} />\n </section>\n\n <section className=\"space-y-3\">\n <h2 className=\"text-sm font-bold\">Licenses you hold</h2>\n <LicenseList loading={heldLoading} empty=\"No sponsorship licenses yet.\">\n {held.map((l) => (\n <div key={l.id} className=\"bento-cell p-4\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", l.assetContract, l.assetTokenId)} className=\"hover:underline\">License on this asset</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">from <AddressDisplay address={l.author} chars={4} showCopy={false} /></p>\n </div>\n ))}\n </LicenseList>\n </section>\n\n <section className=\"space-y-3\">\n <h2 className=\"text-sm font-bold\">Licenses issued on your work</h2>\n <LicenseList loading={issuedLoading} empty=\"No licenses issued yet.\">\n {issued.map((l) => (\n <div key={l.id} className=\"bento-cell p-4\">\n <p className=\"text-sm font-semibold\">\n <Link href={assetHref(\"STARKNET\", l.assetContract, l.assetTokenId)} className=\"hover:underline\">License on this asset</Link>\n </p>\n <p className=\"text-xs text-muted-foreground\">held by <AddressDisplay address={l.currentHolder ?? l.recipient} chars={4} showCopy={false} /></p>\n </div>\n ))}\n </LicenseList>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCM;AAlCN,mBAAyB;AACzB,0BAAoD;AACpD,iBAAoD;AACpD,6BAA+B;AAC/B,oBAAuB;AACvB,kBAAiB;AACjB,2BAAgC;AAChC,sBAAyB;AACzB,gCAAkC;AAClC,8BAAgC;AAChC,8BAA+B;AAC/B,6BAA0G;AAC1G,6BAA+B;AAI/B,SAAS,aAAa,MAA6E;AACjG,QAAM,UAAM,sCAAgB;AAC5B,QAAM,SAAK,uCAAe;AAC1B,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAwB,IAAI;AAC5D,QAAM,OAAO,GAAG,UAAU,eAAe,GAAG,UAAU,gBAAgB,GAAG,UAAU;AAEnF,QAAM,MAAM,CAAC,IAAY,QAAwE,SAAiC;AAChI,gBAAY,EAAE;AACd,SAAK,GACF,IAAI,OAAO,WAAW;AACrB,gBAAM,wCAAe,QAAQ,MAAM,OAAO,IAAI,UAAU,EAAE,GAAG,CAAC;AAAA,IAChE,CAAC,EACA,KAAK,MAAM,KAAK,CAAC,EACjB,QAAQ,MAAM,YAAY,IAAI,CAAC;AAAA,EACpC;AAEA,QAAM,SACJ,4CAAC,+CAAkB,IAAQ,OAAO,KAAK,OAAO,cAAc,KAAK,SAAS,gBAAe,WACvF,sDAAC,2CAAgB,IAAQ,MAAM,KAAK,OAAO,OAAO,KAAK,MAAM,aAAa,KAAK,aAAa,GAC9F;AAGF,SAAO,EAAE,KAAK,QAAQ,MAAM,SAAS;AACvC;AAEA,SAAS,QAAQ,EAAE,QAAQ,MAAM,UAAU,GAAmE;AAC5G,SAAO,SAAS,4CAAC,+BAAQ,WAAW,wBAAwB,aAAa,EAAE,IAAI,IAAK,2EAAG,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export { PortfolioSponsorships };