@medialane/ui 0.350.0 → 0.352.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 (41) hide show
  1. package/dist/components/account/add-guardian-dialog.cjs +1 -1
  2. package/dist/components/account/add-guardian-dialog.cjs.map +1 -1
  3. package/dist/components/account/add-guardian-dialog.js +1 -1
  4. package/dist/components/account/add-guardian-dialog.js.map +1 -1
  5. package/dist/components/account/guardian-recovery-section.cjs +2 -2
  6. package/dist/components/account/guardian-recovery-section.cjs.map +1 -1
  7. package/dist/components/account/guardian-recovery-section.js +2 -2
  8. package/dist/components/account/guardian-recovery-section.js.map +1 -1
  9. package/dist/components/account/input-otp.d.cts +2 -2
  10. package/dist/components/account/input-otp.d.ts +2 -2
  11. package/dist/components/alert.d.cts +1 -1
  12. package/dist/components/alert.d.ts +1 -1
  13. package/dist/components/badge.d.cts +1 -1
  14. package/dist/components/badge.d.ts +1 -1
  15. package/dist/components/button.d.cts +2 -2
  16. package/dist/components/button.d.ts +2 -2
  17. package/dist/components/discover-features.cjs +18 -15
  18. package/dist/components/discover-features.cjs.map +1 -1
  19. package/dist/components/discover-features.js +18 -15
  20. package/dist/components/discover-features.js.map +1 -1
  21. package/dist/components/launchpad/edition-mint-schema.d.cts +4 -4
  22. package/dist/components/launchpad/edition-mint-schema.d.ts +4 -4
  23. package/dist/components/pop-burn-button.cjs +1 -1
  24. package/dist/components/pop-burn-button.cjs.map +1 -1
  25. package/dist/components/pop-burn-button.js +1 -1
  26. package/dist/components/pop-burn-button.js.map +1 -1
  27. package/dist/components/transaction-dialog.cjs +1 -1
  28. package/dist/components/transaction-dialog.cjs.map +1 -1
  29. package/dist/components/transaction-dialog.js +1 -1
  30. package/dist/components/transaction-dialog.js.map +1 -1
  31. package/dist/components/transfer-dialog.cjs +3 -3
  32. package/dist/components/transfer-dialog.cjs.map +1 -1
  33. package/dist/components/transfer-dialog.js +3 -3
  34. package/dist/components/transfer-dialog.js.map +1 -1
  35. package/dist/components/wallet/export-key-section.cjs +3 -7
  36. package/dist/components/wallet/export-key-section.cjs.map +1 -1
  37. package/dist/components/wallet/export-key-section.js +3 -7
  38. package/dist/components/wallet/export-key-section.js.map +1 -1
  39. package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
  40. package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
  41. package/package.json +1 -1
@@ -61,7 +61,7 @@ function AddGuardianDialog({ open, onOpenChange, sealed, onAdded, wallet }) {
61
61
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Shield, { className: "h-4 w-4" }),
62
62
  " Add a guardian"
63
63
  ] }),
64
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, { children: "A guardian can help you recover this wallet if you lose this device, but can never move your funds. Paste the public key of a wallet you control \u2014 another device's Media Wallet, for example. You can only set this up once from here; changing it later isn't supported in this app yet." })
64
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, { children: "A guardian is a trusted backup that helps restore this wallet on a new device. It can never move funds. Paste the public key of a wallet already in use, such as another device's Media Wallet. A guardian is set once from here." })
65
65
  ] }),
66
66
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-3", children: [
67
67
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/account/add-guardian-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Shield, Loader2 } from \"lucide-react\";\nimport { isValidStarknetAddress, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { Button } from \"../button.js\";\nimport { Input } from \"../input.js\";\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from \"../dialog.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport type { GuardianWallet } from \"./wallet-types.js\";\n\nexport interface AddGuardianDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n sealed: SealedOwner;\n onAdded: () => void;\n wallet: Pick<GuardianWallet, \"setFirstGuardian\">;\n}\n\nexport function AddGuardianDialog({ open, onOpenChange, sealed, onAdded, wallet }: AddGuardianDialogProps) {\n const [pubkey, setPubkey] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleAdd = async () => {\n const trimmed = pubkey.trim();\n if (!isValidStarknetAddress(trimmed)) {\n setError(\"Enter a valid Stark-curve public key.\");\n return;\n }\n setBusy(true);\n setError(null);\n try {\n await wallet.setFirstGuardian(sealed, trimmed);\n onOpenChange(false);\n setPubkey(\"\");\n onAdded();\n } catch (e) {\n setError(describeError(e).message);\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <Dialog open={open} onOpenChange={(next) => { if (!busy) onOpenChange(next); }}>\n <DialogContent className=\"sm:max-w-sm\">\n <DialogHeader>\n <DialogTitle className=\"flex items-center gap-2\">\n <Shield className=\"h-4 w-4\" /> Add a guardian\n </DialogTitle>\n <DialogDescription>\n A guardian can help you recover this wallet if you lose this device, but can\n never move your funds. Paste the public key of a wallet you control — another\n device&apos;s Media Wallet, for example. You can only set this up once from here;\n changing it later isn&apos;t supported in this app yet.\n </DialogDescription>\n </DialogHeader>\n <div className=\"space-y-3\">\n <Input\n value={pubkey}\n onChange={(e) => setPubkey(e.target.value)}\n placeholder=\"0x…\"\n disabled={busy}\n className=\"font-mono text-xs\"\n onKeyDown={(e) => e.key === \"Enter\" && pubkey.trim() && void handleAdd()}\n />\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n <Button onClick={handleAdd} disabled={busy || !pubkey.trim()} className=\"w-full\">\n {busy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : null}\n {busy ? \"Confirm with passkey…\" : \"Add guardian\"}\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgDU;AA9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K,KAAK,KAAK,UAAU;AAAA;AAAA,MACzE;AAAA,MACC,SAAS,4CAAC,OAAE,WAAU,4BAA4B,iBAAM;AAAA,MACzD,6CAAC,wBAAO,SAAS,WAAW,UAAU,QAAQ,CAAC,OAAO,KAAK,GAAG,WAAU,UACrE;AAAA,eAAO,4CAAC,+BAAQ,WAAU,mCAAkC,IAAK;AAAA,QACjE,OAAO,+BAA0B;AAAA,SACpC;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/account/add-guardian-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Shield, Loader2 } from \"lucide-react\";\nimport { isValidStarknetAddress, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { Button } from \"../button.js\";\nimport { Input } from \"../input.js\";\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from \"../dialog.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport type { GuardianWallet } from \"./wallet-types.js\";\n\nexport interface AddGuardianDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n sealed: SealedOwner;\n onAdded: () => void;\n wallet: Pick<GuardianWallet, \"setFirstGuardian\">;\n}\n\nexport function AddGuardianDialog({ open, onOpenChange, sealed, onAdded, wallet }: AddGuardianDialogProps) {\n const [pubkey, setPubkey] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleAdd = async () => {\n const trimmed = pubkey.trim();\n if (!isValidStarknetAddress(trimmed)) {\n setError(\"Enter a valid Stark-curve public key.\");\n return;\n }\n setBusy(true);\n setError(null);\n try {\n await wallet.setFirstGuardian(sealed, trimmed);\n onOpenChange(false);\n setPubkey(\"\");\n onAdded();\n } catch (e) {\n setError(describeError(e).message);\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <Dialog open={open} onOpenChange={(next) => { if (!busy) onOpenChange(next); }}>\n <DialogContent className=\"sm:max-w-sm\">\n <DialogHeader>\n <DialogTitle className=\"flex items-center gap-2\">\n <Shield className=\"h-4 w-4\" /> Add a guardian\n </DialogTitle>\n <DialogDescription>\n A guardian is a trusted backup that helps restore this wallet on a new device. It\n can never move funds. Paste the public key of a wallet already in use, such as\n another device&apos;s Media Wallet. A guardian is set once from here.\n </DialogDescription>\n </DialogHeader>\n <div className=\"space-y-3\">\n <Input\n value={pubkey}\n onChange={(e) => setPubkey(e.target.value)}\n placeholder=\"0x…\"\n disabled={busy}\n className=\"font-mono text-xs\"\n onKeyDown={(e) => e.key === \"Enter\" && pubkey.trim() && void handleAdd()}\n />\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n <Button onClick={handleAdd} disabled={busy || !pubkey.trim()} className=\"w-full\">\n {busy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : null}\n {busy ? \"Confirm with passkey…\" : \"Add guardian\"}\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgDU;AA9CV,mBAAyB;AACzB,0BAAgC;AAChC,sBAAyD;AACzD,oBAAuB;AACvB,mBAAsB;AACtB,oBAAoF;AACpF,4BAA8B;AAWvB,SAAS,kBAAkB,EAAE,MAAM,cAAc,QAAQ,SAAS,OAAO,GAA2B;AACzG,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,EAAE;AACvC,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,KAAK;AACtC,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAwB,IAAI;AAEtD,QAAM,YAAY,YAAY;AAC5B,UAAM,UAAU,OAAO,KAAK;AAC5B,QAAI,KAAC,wCAAuB,OAAO,GAAG;AACpC,eAAS,uCAAuC;AAChD;AAAA,IACF;AACA,YAAQ,IAAI;AACZ,aAAS,IAAI;AACb,QAAI;AACF,YAAM,OAAO,iBAAiB,QAAQ,OAAO;AAC7C,mBAAa,KAAK;AAClB,gBAAU,EAAE;AACZ,cAAQ;AAAA,IACV,SAAS,GAAG;AACV,mBAAS,qCAAc,CAAC,EAAE,OAAO;AAAA,IACnC,UAAE;AACA,cAAQ,KAAK;AAAA,IACf;AAAA,EACF;AAEA,SACE,4CAAC,wBAAO,MAAY,cAAc,CAAC,SAAS;AAAE,QAAI,CAAC,KAAM,cAAa,IAAI;AAAA,EAAG,GAC3E,uDAAC,+BAAc,WAAU,eACvB;AAAA,iDAAC,8BACC;AAAA,mDAAC,6BAAY,WAAU,2BACrB;AAAA,oDAAC,8BAAO,WAAU,WAAU;AAAA,QAAE;AAAA,SAChC;AAAA,MACA,4CAAC,mCAAkB,+OAInB;AAAA,OACF;AAAA,IACA,6CAAC,SAAI,WAAU,aACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,UACP,UAAU,CAAC,MAAM,UAAU,EAAE,OAAO,KAAK;AAAA,UACzC,aAAY;AAAA,UACZ,UAAU;AAAA,UACV,WAAU;AAAA,UACV,WAAW,CAAC,MAAM,EAAE,QAAQ,WAAW,OAAO,KAAK,KAAK,KAAK,UAAU;AAAA;AAAA,MACzE;AAAA,MACC,SAAS,4CAAC,OAAE,WAAU,4BAA4B,iBAAM;AAAA,MACzD,6CAAC,wBAAO,SAAS,WAAW,UAAU,QAAQ,CAAC,OAAO,KAAK,GAAG,WAAU,UACrE;AAAA,eAAO,4CAAC,+BAAQ,WAAU,mCAAkC,IAAK;AAAA,QACjE,OAAO,+BAA0B;AAAA,SACpC;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -38,7 +38,7 @@ function AddGuardianDialog({ open, onOpenChange, sealed, onAdded, wallet }) {
38
38
  /* @__PURE__ */ jsx(Shield, { className: "h-4 w-4" }),
39
39
  " Add a guardian"
40
40
  ] }),
41
- /* @__PURE__ */ jsx(DialogDescription, { children: "A guardian can help you recover this wallet if you lose this device, but can never move your funds. Paste the public key of a wallet you control \u2014 another device's Media Wallet, for example. You can only set this up once from here; changing it later isn't supported in this app yet." })
41
+ /* @__PURE__ */ jsx(DialogDescription, { children: "A guardian is a trusted backup that helps restore this wallet on a new device. It can never move funds. Paste the public key of a wallet already in use, such as another device's Media Wallet. A guardian is set once from here." })
42
42
  ] }),
43
43
  /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
44
44
  /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/account/add-guardian-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Shield, Loader2 } from \"lucide-react\";\nimport { isValidStarknetAddress, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { Button } from \"../button.js\";\nimport { Input } from \"../input.js\";\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from \"../dialog.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport type { GuardianWallet } from \"./wallet-types.js\";\n\nexport interface AddGuardianDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n sealed: SealedOwner;\n onAdded: () => void;\n wallet: Pick<GuardianWallet, \"setFirstGuardian\">;\n}\n\nexport function AddGuardianDialog({ open, onOpenChange, sealed, onAdded, wallet }: AddGuardianDialogProps) {\n const [pubkey, setPubkey] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleAdd = async () => {\n const trimmed = pubkey.trim();\n if (!isValidStarknetAddress(trimmed)) {\n setError(\"Enter a valid Stark-curve public key.\");\n return;\n }\n setBusy(true);\n setError(null);\n try {\n await wallet.setFirstGuardian(sealed, trimmed);\n onOpenChange(false);\n setPubkey(\"\");\n onAdded();\n } catch (e) {\n setError(describeError(e).message);\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <Dialog open={open} onOpenChange={(next) => { if (!busy) onOpenChange(next); }}>\n <DialogContent className=\"sm:max-w-sm\">\n <DialogHeader>\n <DialogTitle className=\"flex items-center gap-2\">\n <Shield className=\"h-4 w-4\" /> Add a guardian\n </DialogTitle>\n <DialogDescription>\n A guardian can help you recover this wallet if you lose this device, but can\n never move your funds. Paste the public key of a wallet you control — another\n device&apos;s Media Wallet, for example. You can only set this up once from here;\n changing it later isn&apos;t supported in this app yet.\n </DialogDescription>\n </DialogHeader>\n <div className=\"space-y-3\">\n <Input\n value={pubkey}\n onChange={(e) => setPubkey(e.target.value)}\n placeholder=\"0x…\"\n disabled={busy}\n className=\"font-mono text-xs\"\n onKeyDown={(e) => e.key === \"Enter\" && pubkey.trim() && void handleAdd()}\n />\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n <Button onClick={handleAdd} disabled={busy || !pubkey.trim()} className=\"w-full\">\n {busy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : null}\n {busy ? \"Confirm with passkey…\" : \"Add guardian\"}\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAgDU,SACE,KADF;AA9CV,SAAS,gBAAgB;AACzB,SAAS,QAAQ,eAAe;AAChC,SAAS,8BAAgD;AACzD,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,QAAQ,eAAe,cAAc,aAAa,yBAAyB;AACpF,SAAS,qBAAqB;AAWvB,SAAS,kBAAkB,EAAE,MAAM,cAAc,QAAQ,SAAS,OAAO,GAA2B;AACzG,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,EAAE;AACvC,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAwB,IAAI;AAEtD,QAAM,YAAY,YAAY;AAC5B,UAAM,UAAU,OAAO,KAAK;AAC5B,QAAI,CAAC,uBAAuB,OAAO,GAAG;AACpC,eAAS,uCAAuC;AAChD;AAAA,IACF;AACA,YAAQ,IAAI;AACZ,aAAS,IAAI;AACb,QAAI;AACF,YAAM,OAAO,iBAAiB,QAAQ,OAAO;AAC7C,mBAAa,KAAK;AAClB,gBAAU,EAAE;AACZ,cAAQ;AAAA,IACV,SAAS,GAAG;AACV,eAAS,cAAc,CAAC,EAAE,OAAO;AAAA,IACnC,UAAE;AACA,cAAQ,KAAK;AAAA,IACf;AAAA,EACF;AAEA,SACE,oBAAC,UAAO,MAAY,cAAc,CAAC,SAAS;AAAE,QAAI,CAAC,KAAM,cAAa,IAAI;AAAA,EAAG,GAC3E,+BAAC,iBAAc,WAAU,eACvB;AAAA,yBAAC,gBACC;AAAA,2BAAC,eAAY,WAAU,2BACrB;AAAA,4BAAC,UAAO,WAAU,WAAU;AAAA,QAAE;AAAA,SAChC;AAAA,MACA,oBAAC,qBAAkB,6SAKnB;AAAA,OACF;AAAA,IACA,qBAAC,SAAI,WAAU,aACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,UACP,UAAU,CAAC,MAAM,UAAU,EAAE,OAAO,KAAK;AAAA,UACzC,aAAY;AAAA,UACZ,UAAU;AAAA,UACV,WAAU;AAAA,UACV,WAAW,CAAC,MAAM,EAAE,QAAQ,WAAW,OAAO,KAAK,KAAK,KAAK,UAAU;AAAA;AAAA,MACzE;AAAA,MACC,SAAS,oBAAC,OAAE,WAAU,4BAA4B,iBAAM;AAAA,MACzD,qBAAC,UAAO,SAAS,WAAW,UAAU,QAAQ,CAAC,OAAO,KAAK,GAAG,WAAU,UACrE;AAAA,eAAO,oBAAC,WAAQ,WAAU,mCAAkC,IAAK;AAAA,QACjE,OAAO,+BAA0B;AAAA,SACpC;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/account/add-guardian-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Shield, Loader2 } from \"lucide-react\";\nimport { isValidStarknetAddress, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { Button } from \"../button.js\";\nimport { Input } from \"../input.js\";\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from \"../dialog.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport type { GuardianWallet } from \"./wallet-types.js\";\n\nexport interface AddGuardianDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n sealed: SealedOwner;\n onAdded: () => void;\n wallet: Pick<GuardianWallet, \"setFirstGuardian\">;\n}\n\nexport function AddGuardianDialog({ open, onOpenChange, sealed, onAdded, wallet }: AddGuardianDialogProps) {\n const [pubkey, setPubkey] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleAdd = async () => {\n const trimmed = pubkey.trim();\n if (!isValidStarknetAddress(trimmed)) {\n setError(\"Enter a valid Stark-curve public key.\");\n return;\n }\n setBusy(true);\n setError(null);\n try {\n await wallet.setFirstGuardian(sealed, trimmed);\n onOpenChange(false);\n setPubkey(\"\");\n onAdded();\n } catch (e) {\n setError(describeError(e).message);\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <Dialog open={open} onOpenChange={(next) => { if (!busy) onOpenChange(next); }}>\n <DialogContent className=\"sm:max-w-sm\">\n <DialogHeader>\n <DialogTitle className=\"flex items-center gap-2\">\n <Shield className=\"h-4 w-4\" /> Add a guardian\n </DialogTitle>\n <DialogDescription>\n A guardian is a trusted backup that helps restore this wallet on a new device. It\n can never move funds. Paste the public key of a wallet already in use, such as\n another device&apos;s Media Wallet. A guardian is set once from here.\n </DialogDescription>\n </DialogHeader>\n <div className=\"space-y-3\">\n <Input\n value={pubkey}\n onChange={(e) => setPubkey(e.target.value)}\n placeholder=\"0x…\"\n disabled={busy}\n className=\"font-mono text-xs\"\n onKeyDown={(e) => e.key === \"Enter\" && pubkey.trim() && void handleAdd()}\n />\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n <Button onClick={handleAdd} disabled={busy || !pubkey.trim()} className=\"w-full\">\n {busy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : null}\n {busy ? \"Confirm with passkey…\" : \"Add guardian\"}\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mapp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UAAU;AAAA,UACV,WAAU;AAAA,UACV,WAAW,CAAC,MAAM,EAAE,QAAQ,WAAW,OAAO,KAAK,KAAK,KAAK,UAAU;AAAA;AAAA,MACzE;AAAA,MACC,SAAS,oBAAC,OAAE,WAAU,4BAA4B,iBAAM;AAAA,MACzD,qBAAC,UAAO,SAAS,WAAW,UAAU,QAAQ,CAAC,OAAO,KAAK,GAAG,WAAU,UACrE;AAAA,eAAO,oBAAC,WAAQ,WAAU,mCAAkC,IAAK;AAAA,QACjE,OAAO,+BAA0B;AAAA,SACpC;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -85,7 +85,7 @@ function GuardianRecoverySection({
85
85
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-10 w-10 shrink-0 rounded-full bg-emerald-500/10 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Shield, { className: "h-5 w-5 text-emerald-600 dark:text-emerald-400" }) }),
86
86
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
87
87
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-base font-bold text-foreground", children: "Security & Recovery" }),
88
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground mt-0.5", children: "A guardian can help you get back into this wallet if you ever lose this device." })
88
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground mt-0.5", children: "A guardian is a trusted backup that helps restore this wallet on a new device." })
89
89
  ] })
90
90
  ] }),
91
91
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-3", children: [
@@ -96,7 +96,7 @@ function GuardianRecoverySection({
96
96
  " ",
97
97
  inProgress.status === "Ready" ? "It can complete at any time." : `It can complete on ${new Date(inProgress.readyAt * 1e3).toLocaleString()}.`,
98
98
  " ",
99
- "If this wasn't you, cancel it now.",
99
+ "The replacement can be stopped with the button below.",
100
100
  cancelError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-1 text-destructive", children: cancelError }),
101
101
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
102
102
  import_button.Button,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/account/guardian-recovery-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useState } from \"react\";\nimport { Shield, ShieldAlert, ChevronRight, Loader2 } from \"lucide-react\";\nimport {\n describeGuardianStatus,\n describeRecoveryAction,\n type EscapeInfo,\n type GuardianInfo,\n} from \"@medialane/sdk/starknet\";\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { Badge } from \"../badge.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { AddGuardianDialog } from \"./add-guardian-dialog.js\";\nimport type { GuardianWallet, LoadSealedOwner } from \"./wallet-types.js\";\n\nconst short = (a: string) => `${a.slice(0, 6)}…${a.slice(-4)}`;\n\nexport interface GuardianRecoverySectionProps {\n walletAddress: string;\n wallet: GuardianWallet;\n loadSealed: LoadSealedOwner;\n guardianRecoveryAvailable: boolean;\n recoverHref?: string;\n}\n\nexport function GuardianRecoverySection({\n walletAddress,\n wallet,\n loadSealed,\n guardianRecoveryAvailable,\n recoverHref = \"/recover\",\n}: GuardianRecoverySectionProps) {\n const [guardians, setGuardians] = useState<GuardianInfo[] | null>(null);\n const [escape, setEscape] = useState<EscapeInfo | null>(null);\n const [addOpen, setAddOpen] = useState(false);\n const [cancelBusy, setCancelBusy] = useState(false);\n const [cancelError, setCancelError] = useState<string | null>(null);\n\n const refresh = useCallback(() => {\n wallet.getGuardians(walletAddress).then(setGuardians).catch(() => setGuardians([]));\n wallet.getEscape(walletAddress).then(setEscape).catch(() => setEscape(null));\n }, [walletAddress, wallet]);\n\n useEffect(() => { refresh(); }, [refresh]);\n\n const handleCancel = async () => {\n const sealed = loadSealed();\n if (!sealed) return;\n setCancelBusy(true);\n setCancelError(null);\n try {\n await wallet.cancelEscape(sealed);\n refresh();\n } catch (e) {\n setCancelError(describeError(e).message);\n } finally {\n setCancelBusy(false);\n }\n };\n\n const status = guardians ? describeGuardianStatus(guardians) : null;\n const recoveryAction = escape ? describeRecoveryAction(escape) : \"none\";\n const inProgress = escape?.escapeType === \"Owner\" && recoveryAction !== \"none\" ? escape : null;\n\n const sealed = loadSealed();\n\n return (\n <div className=\"rounded-2xl border border-border/60 bg-card p-5 sm:p-6 space-y-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"h-10 w-10 shrink-0 rounded-full bg-emerald-500/10 flex items-center justify-center\">\n <Shield className=\"h-5 w-5 text-emerald-600 dark:text-emerald-400\" />\n </div>\n <div>\n <h3 className=\"text-base font-bold text-foreground\">Security &amp; Recovery</h3>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n A guardian can help you get back into this wallet if you ever lose this device.\n </p>\n </div>\n </div>\n\n <div className=\"space-y-3\">\n {inProgress && (\n <Alert variant=\"destructive\">\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription>\n A guardian has started replacing this wallet&apos;s owner key.{\" \"}\n {inProgress.status === \"Ready\"\n ? \"It can complete at any time.\"\n : `It can complete on ${new Date(inProgress.readyAt * 1000).toLocaleString()}.`}{\" \"}\n If this wasn&apos;t you, cancel it now.\n {cancelError && <p className=\"mt-1 text-destructive\">{cancelError}</p>}\n <Button\n onClick={handleCancel}\n disabled={cancelBusy}\n variant=\"destructive\"\n size=\"sm\"\n className=\"mt-2 w-full\"\n >\n {cancelBusy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : null}\n Cancel recovery\n </Button>\n </AlertDescription>\n </Alert>\n )}\n\n <div className=\"flex items-center justify-between gap-3 rounded-xl border border-border/60 p-4 flex-wrap\">\n <div>\n <p className=\"text-sm font-medium text-foreground\">Guardian recovery</p>\n {status === null ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">Checking…</p>\n ) : status.kind === \"none\" ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {guardianRecoveryAvailable ? \"Not set up — add one from another device you trust.\" : \"Not available yet.\"}\n </p>\n ) : (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Active: {status.guardian.type} guardian {short(status.guardian.storedValue)}\n </p>\n )}\n </div>\n {status?.kind === \"none\" && sealed && (\n <Button onClick={() => setAddOpen(true)} variant=\"outline\" size=\"sm\" disabled={!guardianRecoveryAvailable}>\n Add guardian\n </Button>\n )}\n {status?.kind === \"active\" && (\n <Badge variant=\"outline\" className=\"border-emerald-500/40 text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 text-2xs\">\n Configured\n </Badge>\n )}\n </div>\n\n <Link\n href={recoverHref}\n className=\"flex items-center justify-between gap-3 rounded-xl border border-border/60 p-4 transition-colors hover:bg-foreground/[0.03]\"\n >\n <div>\n <p className=\"text-sm font-medium text-foreground\">Recover a wallet</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Lost this device, or acting as someone&apos;s guardian?\n </p>\n </div>\n <ChevronRight className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n </Link>\n </div>\n\n {sealed && guardianRecoveryAvailable && (\n <AddGuardianDialog\n open={addOpen}\n onOpenChange={setAddOpen}\n sealed={sealed}\n onAdded={refresh}\n wallet={wallet}\n />\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyEU;AAvEV,mBAAiD;AACjD,0BAA2D;AAC3D,sBAKO;AACP,kBAAiB;AACjB,oBAAuB;AACvB,mBAAsB;AACtB,mBAAwC;AACxC,4BAA8B;AAC9B,iCAAkC;AAGlC,MAAM,QAAQ,CAAC,MAAc,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,SAAI,EAAE,MAAM,EAAE,CAAC;AAUrD,SAAS,wBAAwB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,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H;AAAA,SAEJ;AAAA,MAEA;AAAA,QAAC,YAAAC;AAAA,QAAA;AAAA,UACC,MAAM;AAAA,UACN,WAAU;AAAA,UAEV;AAAA,yDAAC,SACC;AAAA,0DAAC,OAAE,WAAU,uCAAsC,8BAAgB;AAAA,cACnE,4CAAC,OAAE,WAAU,wCAAuC,gEAEpD;AAAA,eACF;AAAA,YACA,4CAAC,oCAAa,WAAU,0CAAyC;AAAA;AAAA;AAAA,MACnE;AAAA,OACF;AAAA,IAEC,UAAU,6BACT;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,cAAc;AAAA,QACd;AAAA,QACA,SAAS;AAAA,QACT;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["sealed","Link"]}
1
+ {"version":3,"sources":["../../../src/components/account/guardian-recovery-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useState } from \"react\";\nimport { Shield, ShieldAlert, ChevronRight, Loader2 } from \"lucide-react\";\nimport {\n describeGuardianStatus,\n describeRecoveryAction,\n type EscapeInfo,\n type GuardianInfo,\n} from \"@medialane/sdk/starknet\";\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { Badge } from \"../badge.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { AddGuardianDialog } from \"./add-guardian-dialog.js\";\nimport type { GuardianWallet, LoadSealedOwner } from \"./wallet-types.js\";\n\nconst short = (a: string) => `${a.slice(0, 6)}…${a.slice(-4)}`;\n\nexport interface GuardianRecoverySectionProps {\n walletAddress: string;\n wallet: GuardianWallet;\n loadSealed: LoadSealedOwner;\n guardianRecoveryAvailable: boolean;\n recoverHref?: string;\n}\n\nexport function GuardianRecoverySection({\n walletAddress,\n wallet,\n loadSealed,\n guardianRecoveryAvailable,\n recoverHref = \"/recover\",\n}: GuardianRecoverySectionProps) {\n const [guardians, setGuardians] = useState<GuardianInfo[] | null>(null);\n const [escape, setEscape] = useState<EscapeInfo | null>(null);\n const [addOpen, setAddOpen] = useState(false);\n const [cancelBusy, setCancelBusy] = useState(false);\n const [cancelError, setCancelError] = useState<string | null>(null);\n\n const refresh = useCallback(() => {\n wallet.getGuardians(walletAddress).then(setGuardians).catch(() => setGuardians([]));\n wallet.getEscape(walletAddress).then(setEscape).catch(() => setEscape(null));\n }, [walletAddress, wallet]);\n\n useEffect(() => { refresh(); }, [refresh]);\n\n const handleCancel = async () => {\n const sealed = loadSealed();\n if (!sealed) return;\n setCancelBusy(true);\n setCancelError(null);\n try {\n await wallet.cancelEscape(sealed);\n refresh();\n } catch (e) {\n setCancelError(describeError(e).message);\n } finally {\n setCancelBusy(false);\n }\n };\n\n const status = guardians ? describeGuardianStatus(guardians) : null;\n const recoveryAction = escape ? describeRecoveryAction(escape) : \"none\";\n const inProgress = escape?.escapeType === \"Owner\" && recoveryAction !== \"none\" ? escape : null;\n\n const sealed = loadSealed();\n\n return (\n <div className=\"rounded-2xl border border-border/60 bg-card p-5 sm:p-6 space-y-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"h-10 w-10 shrink-0 rounded-full bg-emerald-500/10 flex items-center justify-center\">\n <Shield className=\"h-5 w-5 text-emerald-600 dark:text-emerald-400\" />\n </div>\n <div>\n <h3 className=\"text-base font-bold text-foreground\">Security &amp; Recovery</h3>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n A guardian is a trusted backup that helps restore this wallet on a new device.\n </p>\n </div>\n </div>\n\n <div className=\"space-y-3\">\n {inProgress && (\n <Alert variant=\"destructive\">\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription>\n A guardian has started replacing this wallet&apos;s owner key.{\" \"}\n {inProgress.status === \"Ready\"\n ? \"It can complete at any time.\"\n : `It can complete on ${new Date(inProgress.readyAt * 1000).toLocaleString()}.`}{\" \"}\n The replacement can be stopped with the button below.\n {cancelError && <p className=\"mt-1 text-destructive\">{cancelError}</p>}\n <Button\n onClick={handleCancel}\n disabled={cancelBusy}\n variant=\"destructive\"\n size=\"sm\"\n className=\"mt-2 w-full\"\n >\n {cancelBusy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : null}\n Cancel recovery\n </Button>\n </AlertDescription>\n </Alert>\n )}\n\n <div className=\"flex items-center justify-between gap-3 rounded-xl border border-border/60 p-4 flex-wrap\">\n <div>\n <p className=\"text-sm font-medium text-foreground\">Guardian recovery</p>\n {status === null ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">Checking…</p>\n ) : status.kind === \"none\" ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {guardianRecoveryAvailable ? \"Not set up — add one from another device you trust.\" : \"Not available yet.\"}\n </p>\n ) : (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Active: {status.guardian.type} guardian {short(status.guardian.storedValue)}\n </p>\n )}\n </div>\n {status?.kind === \"none\" && sealed && (\n <Button onClick={() => setAddOpen(true)} variant=\"outline\" size=\"sm\" disabled={!guardianRecoveryAvailable}>\n Add guardian\n </Button>\n )}\n {status?.kind === \"active\" && (\n <Badge variant=\"outline\" className=\"border-emerald-500/40 text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 text-2xs\">\n Configured\n </Badge>\n )}\n </div>\n\n <Link\n href={recoverHref}\n className=\"flex items-center justify-between gap-3 rounded-xl border border-border/60 p-4 transition-colors hover:bg-foreground/[0.03]\"\n >\n <div>\n <p className=\"text-sm font-medium text-foreground\">Recover a wallet</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Lost this device, or acting as someone&apos;s guardian?\n </p>\n </div>\n <ChevronRight className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n </Link>\n </div>\n\n {sealed && guardianRecoveryAvailable && (\n <AddGuardianDialog\n open={addOpen}\n onOpenChange={setAddOpen}\n sealed={sealed}\n onAdded={refresh}\n wallet={wallet}\n />\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAA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uC;AAAA;AAAA,YACzC,OAAO,SAAS;AAAA,YAAK;AAAA,YAAW,MAAM,OAAO,SAAS,WAAW;AAAA,aAC5E;AAAA,WAEJ;AAAA,QACC,QAAQ,SAAS,UAAU,UAC1B,4CAAC,wBAAO,SAAS,MAAM,WAAW,IAAI,GAAG,SAAQ,WAAU,MAAK,MAAK,UAAU,CAAC,2BAA2B,0BAE3G;AAAA,QAED,QAAQ,SAAS,YAChB,4CAAC,sBAAM,SAAQ,WAAU,WAAU,2FAA0F,wBAE7H;AAAA,SAEJ;AAAA,MAEA;AAAA,QAAC,YAAAC;AAAA,QAAA;AAAA,UACC,MAAM;AAAA,UACN,WAAU;AAAA,UAEV;AAAA,yDAAC,SACC;AAAA,0DAAC,OAAE,WAAU,uCAAsC,8BAAgB;AAAA,cACnE,4CAAC,OAAE,WAAU,wCAAuC,gEAEpD;AAAA,eACF;AAAA,YACA,4CAAC,oCAAa,WAAU,0CAAyC;AAAA;AAAA;AAAA,MACnE;AAAA,OACF;AAAA,IAEC,UAAU,6BACT;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,cAAc;AAAA,QACd;AAAA,QACA,SAAS;AAAA,QACT;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["sealed","Link"]}
@@ -55,7 +55,7 @@ function GuardianRecoverySection({
55
55
  /* @__PURE__ */ jsx("div", { className: "h-10 w-10 shrink-0 rounded-full bg-emerald-500/10 flex items-center justify-center", children: /* @__PURE__ */ jsx(Shield, { className: "h-5 w-5 text-emerald-600 dark:text-emerald-400" }) }),
56
56
  /* @__PURE__ */ jsxs("div", { children: [
57
57
  /* @__PURE__ */ jsx("h3", { className: "text-base font-bold text-foreground", children: "Security & Recovery" }),
58
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: "A guardian can help you get back into this wallet if you ever lose this device." })
58
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: "A guardian is a trusted backup that helps restore this wallet on a new device." })
59
59
  ] })
60
60
  ] }),
61
61
  /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
@@ -66,7 +66,7 @@ function GuardianRecoverySection({
66
66
  " ",
67
67
  inProgress.status === "Ready" ? "It can complete at any time." : `It can complete on ${new Date(inProgress.readyAt * 1e3).toLocaleString()}.`,
68
68
  " ",
69
- "If this wasn't you, cancel it now.",
69
+ "The replacement can be stopped with the button below.",
70
70
  cancelError && /* @__PURE__ */ jsx("p", { className: "mt-1 text-destructive", children: cancelError }),
71
71
  /* @__PURE__ */ jsxs(
72
72
  Button,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/account/guardian-recovery-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useState } from \"react\";\nimport { Shield, ShieldAlert, ChevronRight, Loader2 } from \"lucide-react\";\nimport {\n describeGuardianStatus,\n describeRecoveryAction,\n type EscapeInfo,\n type GuardianInfo,\n} from \"@medialane/sdk/starknet\";\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { Badge } from \"../badge.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { AddGuardianDialog } from \"./add-guardian-dialog.js\";\nimport type { GuardianWallet, LoadSealedOwner } from \"./wallet-types.js\";\n\nconst short = (a: string) => `${a.slice(0, 6)}…${a.slice(-4)}`;\n\nexport interface GuardianRecoverySectionProps {\n walletAddress: string;\n wallet: GuardianWallet;\n loadSealed: LoadSealedOwner;\n guardianRecoveryAvailable: boolean;\n recoverHref?: string;\n}\n\nexport function GuardianRecoverySection({\n walletAddress,\n wallet,\n loadSealed,\n guardianRecoveryAvailable,\n recoverHref = \"/recover\",\n}: GuardianRecoverySectionProps) {\n const [guardians, setGuardians] = useState<GuardianInfo[] | null>(null);\n const [escape, setEscape] = useState<EscapeInfo | null>(null);\n const [addOpen, setAddOpen] = useState(false);\n const [cancelBusy, setCancelBusy] = useState(false);\n const [cancelError, setCancelError] = useState<string | null>(null);\n\n const refresh = useCallback(() => {\n wallet.getGuardians(walletAddress).then(setGuardians).catch(() => setGuardians([]));\n wallet.getEscape(walletAddress).then(setEscape).catch(() => setEscape(null));\n }, [walletAddress, wallet]);\n\n useEffect(() => { refresh(); }, [refresh]);\n\n const handleCancel = async () => {\n const sealed = loadSealed();\n if (!sealed) return;\n setCancelBusy(true);\n setCancelError(null);\n try {\n await wallet.cancelEscape(sealed);\n refresh();\n } catch (e) {\n setCancelError(describeError(e).message);\n } finally {\n setCancelBusy(false);\n }\n };\n\n const status = guardians ? describeGuardianStatus(guardians) : null;\n const recoveryAction = escape ? describeRecoveryAction(escape) : \"none\";\n const inProgress = escape?.escapeType === \"Owner\" && recoveryAction !== \"none\" ? escape : null;\n\n const sealed = loadSealed();\n\n return (\n <div className=\"rounded-2xl border border-border/60 bg-card p-5 sm:p-6 space-y-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"h-10 w-10 shrink-0 rounded-full bg-emerald-500/10 flex items-center justify-center\">\n <Shield className=\"h-5 w-5 text-emerald-600 dark:text-emerald-400\" />\n </div>\n <div>\n <h3 className=\"text-base font-bold text-foreground\">Security &amp; Recovery</h3>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n A guardian can help you get back into this wallet if you ever lose this device.\n </p>\n </div>\n </div>\n\n <div className=\"space-y-3\">\n {inProgress && (\n <Alert variant=\"destructive\">\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription>\n A guardian has started replacing this wallet&apos;s owner key.{\" \"}\n {inProgress.status === \"Ready\"\n ? \"It can complete at any time.\"\n : `It can complete on ${new Date(inProgress.readyAt * 1000).toLocaleString()}.`}{\" \"}\n If this wasn&apos;t you, cancel it now.\n {cancelError && <p className=\"mt-1 text-destructive\">{cancelError}</p>}\n <Button\n onClick={handleCancel}\n disabled={cancelBusy}\n variant=\"destructive\"\n size=\"sm\"\n className=\"mt-2 w-full\"\n >\n {cancelBusy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : null}\n Cancel recovery\n </Button>\n </AlertDescription>\n </Alert>\n )}\n\n <div className=\"flex items-center justify-between gap-3 rounded-xl border border-border/60 p-4 flex-wrap\">\n <div>\n <p className=\"text-sm font-medium text-foreground\">Guardian recovery</p>\n {status === null ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">Checking…</p>\n ) : status.kind === \"none\" ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {guardianRecoveryAvailable ? \"Not set up — add one from another device you trust.\" : \"Not available yet.\"}\n </p>\n ) : (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Active: {status.guardian.type} guardian {short(status.guardian.storedValue)}\n </p>\n )}\n </div>\n {status?.kind === \"none\" && sealed && (\n <Button onClick={() => setAddOpen(true)} variant=\"outline\" size=\"sm\" disabled={!guardianRecoveryAvailable}>\n Add guardian\n </Button>\n )}\n {status?.kind === \"active\" && (\n <Badge variant=\"outline\" className=\"border-emerald-500/40 text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 text-2xs\">\n Configured\n </Badge>\n )}\n </div>\n\n <Link\n href={recoverHref}\n className=\"flex items-center justify-between gap-3 rounded-xl border border-border/60 p-4 transition-colors hover:bg-foreground/[0.03]\"\n >\n <div>\n <p className=\"text-sm font-medium text-foreground\">Recover a wallet</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Lost this device, or acting as someone&apos;s guardian?\n </p>\n </div>\n <ChevronRight className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n </Link>\n </div>\n\n {sealed && guardianRecoveryAvailable && (\n <AddGuardianDialog\n open={addOpen}\n onOpenChange={setAddOpen}\n sealed={sealed}\n onAdded={refresh}\n wallet={wallet}\n />\n )}\n </div>\n );\n}\n"],"mappings":";AAyEU,cAEF,YAFE;AAvEV,SAAS,aAAa,WAAW,gBAAgB;AACjD,SAAS,QAAQ,aAAa,cAAc,eAAe;AAC3D;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,OAA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A,YAAW,MAAM,OAAO,SAAS,WAAW;AAAA,aAC5E;AAAA,WAEJ;AAAA,QACC,QAAQ,SAAS,UAAU,UAC1B,oBAAC,UAAO,SAAS,MAAM,WAAW,IAAI,GAAG,SAAQ,WAAU,MAAK,MAAK,UAAU,CAAC,2BAA2B,0BAE3G;AAAA,QAED,QAAQ,SAAS,YAChB,oBAAC,SAAM,SAAQ,WAAU,WAAU,2FAA0F,wBAE7H;AAAA,SAEJ;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,WAAU;AAAA,UAEV;AAAA,iCAAC,SACC;AAAA,kCAAC,OAAE,WAAU,uCAAsC,8BAAgB;AAAA,cACnE,oBAAC,OAAE,WAAU,wCAAuC,gEAEpD;AAAA,eACF;AAAA,YACA,oBAAC,gBAAa,WAAU,0CAAyC;AAAA;AAAA;AAAA,MACnE;AAAA,OACF;AAAA,IAEC,UAAU,6BACT;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,cAAc;AAAA,QACd;AAAA,QACA,SAAS;AAAA,QACT;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["sealed"]}
1
+ {"version":3,"sources":["../../../src/components/account/guardian-recovery-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useState } from \"react\";\nimport { Shield, ShieldAlert, ChevronRight, Loader2 } from \"lucide-react\";\nimport {\n describeGuardianStatus,\n describeRecoveryAction,\n type EscapeInfo,\n type GuardianInfo,\n} from \"@medialane/sdk/starknet\";\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { Badge } from \"../badge.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { AddGuardianDialog } from \"./add-guardian-dialog.js\";\nimport type { GuardianWallet, LoadSealedOwner } from \"./wallet-types.js\";\n\nconst short = (a: string) => `${a.slice(0, 6)}…${a.slice(-4)}`;\n\nexport interface GuardianRecoverySectionProps {\n walletAddress: string;\n wallet: GuardianWallet;\n loadSealed: LoadSealedOwner;\n guardianRecoveryAvailable: boolean;\n recoverHref?: string;\n}\n\nexport function GuardianRecoverySection({\n walletAddress,\n wallet,\n loadSealed,\n guardianRecoveryAvailable,\n recoverHref = \"/recover\",\n}: GuardianRecoverySectionProps) {\n const [guardians, setGuardians] = useState<GuardianInfo[] | null>(null);\n const [escape, setEscape] = useState<EscapeInfo | null>(null);\n const [addOpen, setAddOpen] = useState(false);\n const [cancelBusy, setCancelBusy] = useState(false);\n const [cancelError, setCancelError] = useState<string | null>(null);\n\n const refresh = useCallback(() => {\n wallet.getGuardians(walletAddress).then(setGuardians).catch(() => setGuardians([]));\n wallet.getEscape(walletAddress).then(setEscape).catch(() => setEscape(null));\n }, [walletAddress, wallet]);\n\n useEffect(() => { refresh(); }, [refresh]);\n\n const handleCancel = async () => {\n const sealed = loadSealed();\n if (!sealed) return;\n setCancelBusy(true);\n setCancelError(null);\n try {\n await wallet.cancelEscape(sealed);\n refresh();\n } catch (e) {\n setCancelError(describeError(e).message);\n } finally {\n setCancelBusy(false);\n }\n };\n\n const status = guardians ? describeGuardianStatus(guardians) : null;\n const recoveryAction = escape ? describeRecoveryAction(escape) : \"none\";\n const inProgress = escape?.escapeType === \"Owner\" && recoveryAction !== \"none\" ? escape : null;\n\n const sealed = loadSealed();\n\n return (\n <div className=\"rounded-2xl border border-border/60 bg-card p-5 sm:p-6 space-y-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"h-10 w-10 shrink-0 rounded-full bg-emerald-500/10 flex items-center justify-center\">\n <Shield className=\"h-5 w-5 text-emerald-600 dark:text-emerald-400\" />\n </div>\n <div>\n <h3 className=\"text-base font-bold text-foreground\">Security &amp; Recovery</h3>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n A guardian is a trusted backup that helps restore this wallet on a new device.\n </p>\n </div>\n </div>\n\n <div className=\"space-y-3\">\n {inProgress && (\n <Alert variant=\"destructive\">\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription>\n A guardian has started replacing this wallet&apos;s owner key.{\" \"}\n {inProgress.status === \"Ready\"\n ? \"It can complete at any time.\"\n : `It can complete on ${new Date(inProgress.readyAt * 1000).toLocaleString()}.`}{\" \"}\n The replacement can be stopped with the button below.\n {cancelError && <p className=\"mt-1 text-destructive\">{cancelError}</p>}\n <Button\n onClick={handleCancel}\n disabled={cancelBusy}\n variant=\"destructive\"\n size=\"sm\"\n className=\"mt-2 w-full\"\n >\n {cancelBusy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : null}\n Cancel recovery\n </Button>\n </AlertDescription>\n </Alert>\n )}\n\n <div className=\"flex items-center justify-between gap-3 rounded-xl border border-border/60 p-4 flex-wrap\">\n <div>\n <p className=\"text-sm font-medium text-foreground\">Guardian recovery</p>\n {status === null ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">Checking…</p>\n ) : status.kind === \"none\" ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {guardianRecoveryAvailable ? \"Not set up — add one from another device you trust.\" : \"Not available yet.\"}\n </p>\n ) : (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Active: {status.guardian.type} guardian {short(status.guardian.storedValue)}\n </p>\n )}\n </div>\n {status?.kind === \"none\" && sealed && (\n <Button onClick={() => setAddOpen(true)} variant=\"outline\" size=\"sm\" disabled={!guardianRecoveryAvailable}>\n Add guardian\n </Button>\n )}\n {status?.kind === \"active\" && (\n <Badge variant=\"outline\" className=\"border-emerald-500/40 text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 text-2xs\">\n Configured\n </Badge>\n )}\n </div>\n\n <Link\n href={recoverHref}\n className=\"flex items-center justify-between gap-3 rounded-xl border border-border/60 p-4 transition-colors hover:bg-foreground/[0.03]\"\n >\n <div>\n <p className=\"text-sm font-medium text-foreground\">Recover a wallet</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Lost this device, or acting as someone&apos;s guardian?\n </p>\n </div>\n <ChevronRight className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n </Link>\n </div>\n\n {sealed && guardianRecoveryAvailable && (\n <AddGuardianDialog\n open={addOpen}\n onOpenChange={setAddOpen}\n sealed={sealed}\n onAdded={refresh}\n wallet={wallet}\n />\n )}\n </div>\n );\n}\n"],"mappings":";AAyEU,cAEF,YAFE;AAvEV,SAAS,aAAa,WAAW,gBAAgB;AACjD,SAAS,QAAQ,aAAa,cAAc,eAAe;AAC3D;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,OAAO,UAAU;AACjB,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,OAAO,wBAAwB;AACxC,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAGlC,MAAM,QAAQ,CAAC,MAAc,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,SAAI,EAAE,MAAM,EAAE,CAAC;AAUrD,SAAS,wBAAwB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAChB,GAAiC;AAC/B,QAAM,CAAC,WAAW,YAAY,IAAI,SAAgC,IAAI;AACtE,QAAM,CAAC,QAAQ,SAAS,IAAI,SAA4B,IAAI;AAC5D,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAClD,QAAM,CAAC,aAAa,cAAc,IAAI,SAAwB,IAAI;AAElE,QAAM,UAAU,YAAY,MAAM;AAChC,WAAO,aAAa,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,MAAM,aAAa,CAAC,CAAC,CAAC;AAClF,WAAO,UAAU,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,MAAM,UAAU,IAAI,CAAC;AAAA,EAC7E,GAAG,CAAC,eAAe,MAAM,CAAC;AAE1B,YAAU,MAAM;AAAE,YAAQ;AAAA,EAAG,GAAG,CAAC,OAAO,CAAC;AAEzC,QAAM,eAAe,YAAY;AAC/B,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UAE/E;AAAA,WACF;AAAA,SACF;AAAA,MAGF,qBAAC,SAAI,WAAU,4FACb;AAAA,6BAAC,SACC;AAAA,8BAAC,OAAE,WAAU,uCAAsC,+BAAiB;AAAA,UACnE,WAAW,OACV,oBAAC,OAAE,WAAU,wCAAuC,4BAAS,IAC3D,OAAO,SAAS,SAClB,oBAAC,OAAE,WAAU,wCACV,sCAA4B,6DAAwD,sBACvF,IAEA,qBAAC,OAAE,WAAU,wCAAuC;AAAA;AAAA,YACzC,OAAO,SAAS;AAAA,YAAK;AAAA,YAAW,MAAM,OAAO,SAAS,WAAW;AAAA,aAC5E;AAAA,WAEJ;AAAA,QACC,QAAQ,SAAS,UAAU,UAC1B,oBAAC,UAAO,SAAS,MAAM,WAAW,IAAI,GAAG,SAAQ,WAAU,MAAK,MAAK,UAAU,CAAC,2BAA2B,0BAE3G;AAAA,QAED,QAAQ,SAAS,YAChB,oBAAC,SAAM,SAAQ,WAAU,WAAU,2FAA0F,wBAE7H;AAAA,SAEJ;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,WAAU;AAAA,UAEV;AAAA,iCAAC,SACC;AAAA,kCAAC,OAAE,WAAU,uCAAsC,8BAAgB;AAAA,cACnE,oBAAC,OAAE,WAAU,wCAAuC,gEAEpD;AAAA,eACF;AAAA,YACA,oBAAC,gBAAa,WAAU,0CAAyC;AAAA;AAAA;AAAA,MACnE;AAAA,OACF;AAAA,IAEC,UAAU,6BACT;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,cAAc;AAAA,QACd;AAAA,QACA,SAAS;AAAA,QACT;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["sealed"]}
@@ -1,7 +1,7 @@
1
1
  import * as input_otp from 'input-otp';
2
2
  import * as React from 'react';
3
3
 
4
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
4
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
5
5
  value?: string;
6
6
  onChange?: (newValue: string) => unknown;
7
7
  maxLength: number;
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
14
14
  } & {
15
15
  render: (props: input_otp.RenderProps) => React.ReactNode;
16
16
  children?: never;
17
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
17
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
18
18
  value?: string;
19
19
  onChange?: (newValue: string) => unknown;
20
20
  maxLength: number;
@@ -1,7 +1,7 @@
1
1
  import * as input_otp from 'input-otp';
2
2
  import * as React from 'react';
3
3
 
4
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
4
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
5
5
  value?: string;
6
6
  onChange?: (newValue: string) => unknown;
7
7
  maxLength: number;
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
14
14
  } & {
15
15
  render: (props: input_otp.RenderProps) => React.ReactNode;
16
16
  children?: never;
17
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
17
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
18
18
  value?: string;
19
19
  onChange?: (newValue: string) => unknown;
20
20
  maxLength: number;
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
6
- variant?: "default" | "destructive" | null | undefined;
6
+ variant?: "destructive" | "default" | null | undefined;
7
7
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
8
8
  declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
9
9
  declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
6
- variant?: "default" | "destructive" | null | undefined;
6
+ variant?: "destructive" | "default" | null | undefined;
7
7
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
8
8
  declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
9
9
  declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const badgeVariants: (props?: ({
7
- variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
7
+ variant?: "destructive" | "default" | "outline" | "secondary" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
10
10
  }
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const badgeVariants: (props?: ({
7
- variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
7
+ variant?: "destructive" | "default" | "outline" | "secondary" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
10
10
  }
@@ -3,8 +3,8 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const buttonVariants: (props?: ({
6
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
- size?: "icon" | "default" | "sm" | "lg" | null | undefined;
6
+ variant?: "destructive" | "default" | "link" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
+ size?: "default" | "icon" | "sm" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
10
  asChild?: boolean;
@@ -3,8 +3,8 @@ import * as React from 'react';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  declare const buttonVariants: (props?: ({
6
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
- size?: "icon" | "default" | "sm" | "lg" | null | undefined;
6
+ variant?: "destructive" | "default" | "link" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
7
+ size?: "default" | "icon" | "sm" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
10
  asChild?: boolean;
@@ -33,22 +33,22 @@ const HUES = [
33
33
  { text: "text-brand-rose", border: "border-brand-rose/30", tint: "bg-brand-rose/10" }
34
34
  ];
35
35
  const FEATURES = [
36
- { icon: import_lucide_react.HandCoins, title: "99% to creators and owners" },
37
- { icon: import_lucide_react.Globe, title: "Censorship resistance" },
38
- { icon: import_lucide_react.ShieldCheck, title: "Stark cryptography" },
39
- { icon: import_lucide_react.EyeOff, title: "Privacy by design" },
40
- { icon: import_lucide_react.ScanEye, title: "Zero knowledge proof with Starknet" },
41
- { icon: import_lucide_react.Percent, title: "Zero fees on protocols" },
42
- { icon: import_lucide_react.Lock, title: "Immutable smart contracts" },
43
- { icon: import_lucide_react.DoorOpen, title: "Permissionless" },
44
- { icon: import_lucide_react.Database, title: "Smart contracts are the source of truth" },
45
- { icon: import_lucide_react.FileCog, title: "Programmable IP" },
46
- { icon: import_lucide_react.Gem, title: "Immutable assets" },
47
- { icon: import_lucide_react.Scale, title: "IP protection compliance" },
48
- { icon: import_lucide_react.Code, title: "Open source and auditable" }
36
+ { icon: import_lucide_react.HandCoins, title: "Creator-first economy", description: "99% to creators/owners + 1% fee goes to the Creator Fund Airdrop." },
37
+ { icon: import_lucide_react.Globe, title: "Censorship resistance", description: "Assets and ownership live onchain on decentralized networks." },
38
+ { icon: import_lucide_react.ShieldCheck, title: "Stark cryptography", description: "All transactions are secured onchain by mathematical proofs." },
39
+ { icon: import_lucide_react.EyeOff, title: "Privacy by design", description: "Medialane is designed for user privacy and sovereignty." },
40
+ { icon: import_lucide_react.ScanEye, title: "Zero knowledge", description: "Information can be proven valid without revealing the data behind it." },
41
+ { icon: import_lucide_react.Percent, title: "Zero-fee protocols", description: "The smart contracts charge zero fees for interaction." },
42
+ { icon: import_lucide_react.Lock, title: "Immutable contracts", description: "All smart contracts are fully open source and immutable." },
43
+ { icon: import_lucide_react.DoorOpen, title: "Permissionless", description: "Anyone can create, trade and interact with onchain protocols." },
44
+ { icon: import_lucide_react.Database, title: "Onchain as the source of truth", description: "Assets, ownership, markets and data are read directly onchain." },
45
+ { icon: import_lucide_react.FileCog, title: "Programmable IP", description: "Licensing terms and rights are stored with the assets." },
46
+ { icon: import_lucide_react.Gem, title: "Decentralized portfolio", description: "Assets are stored onchain with licensing and metadata on IPFS." },
47
+ { icon: import_lucide_react.Scale, title: "Protection compliance", description: "Authorship and license are protected under international laws." },
48
+ { icon: import_lucide_react.Code, title: "Open source and auditable", description: "The code is public to audit, review and collaborate on." }
49
49
  ];
50
50
  function DiscoverFeatures() {
51
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_section.ScrollSection, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.BadgeCheck, {}), title: "Medialane features", children: FEATURES.map(({ icon: Icon, title }, i) => {
51
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_section.ScrollSection, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.BadgeCheck, {}), title: "Medialane features", children: FEATURES.map(({ icon: Icon, title, description }, i) => {
52
52
  const hue = HUES[i % HUES.length];
53
53
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
54
54
  "div",
@@ -59,7 +59,10 @@ function DiscoverFeatures() {
59
59
  ),
60
60
  children: [
61
61
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_cn.cn)("flex h-11 w-11 items-center justify-center rounded-xl", hue.tint), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: (0, import_cn.cn)("h-6 w-6", hue.text) }) }),
62
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-lg font-black leading-snug tracking-tight", children: title })
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-lg font-black leading-snug tracking-tight", children: title }),
64
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm leading-relaxed text-muted-foreground", children: description })
65
+ ] })
63
66
  ]
64
67
  },
65
68
  title
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/discover-features.tsx"],"sourcesContent":["import {\n BadgeCheck,\n Code,\n Database,\n DoorOpen,\n EyeOff,\n FileCog,\n Gem,\n Globe,\n HandCoins,\n Lock,\n Percent,\n ScanEye,\n Scale,\n ShieldCheck,\n type LucideIcon,\n} from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { cn } from \"../utils/cn.js\";\n\nconst HUES = [\n { text: \"text-brand-blue\", border: \"border-brand-blue/30\", tint: \"bg-brand-blue/10\" },\n { text: \"text-brand-maeve\", border: \"border-brand-maeve/30\", tint: \"bg-brand-maeve/10\" },\n { text: \"text-brand-orange\", border: \"border-brand-orange/30\", tint: \"bg-brand-orange/10\" },\n { text: \"text-brand-purple\", border: \"border-brand-purple/30\", tint: \"bg-brand-purple/10\" },\n { text: \"text-brand-rose\", border: \"border-brand-rose/30\", tint: \"bg-brand-rose/10\" },\n];\n\nconst FEATURES: ReadonlyArray<{ icon: LucideIcon; title: string }> = [\n { icon: HandCoins, title: \"99% to creators and owners\" },\n { icon: Globe, title: \"Censorship resistance\" },\n { icon: ShieldCheck, title: \"Stark cryptography\" },\n { icon: EyeOff, title: \"Privacy by design\" },\n { icon: ScanEye, title: \"Zero knowledge proof with Starknet\" },\n { icon: Percent, title: \"Zero fees on protocols\" },\n { icon: Lock, title: \"Immutable smart contracts\" },\n { icon: DoorOpen, title: \"Permissionless\" },\n { icon: Database, title: \"Smart contracts are the source of truth\" },\n { icon: FileCog, title: \"Programmable IP\" },\n { icon: Gem, title: \"Immutable assets\" },\n { icon: Scale, title: \"IP protection compliance\" },\n { icon: Code, title: \"Open source and auditable\" },\n];\n\nexport function DiscoverFeatures() {\n return (\n <ScrollSection icon={<BadgeCheck />} title=\"Medialane features\">\n {FEATURES.map(({ icon: Icon, title }, i) => {\n const hue = HUES[i % HUES.length]!;\n return (\n <div\n key={title}\n className={cn(\n \"flex min-h-[168px] w-56 shrink-0 snap-start flex-col gap-4 rounded-2xl border bg-card p-6 sm:w-64\",\n hue.border,\n )}\n >\n <span className={cn(\"flex h-11 w-11 items-center justify-center rounded-xl\", hue.tint)}>\n <Icon className={cn(\"h-6 w-6\", hue.text)} />\n </span>\n <h3 className=\"text-lg font-black leading-snug tracking-tight\">{title}</h3>\n </div>\n );\n })}\n </ScrollSection>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8CyB;AA9CzB,0BAgBO;AACP,4BAA8B;AAC9B,gBAAmB;AAEnB,MAAM,OAAO;AAAA,EACX,EAAE,MAAM,mBAAmB,QAAQ,wBAAwB,MAAM,mBAAmB;AAAA,EACpF,EAAE,MAAM,oBAAoB,QAAQ,yBAAyB,MAAM,oBAAoB;AAAA,EACvF,EAAE,MAAM,qBAAqB,QAAQ,0BAA0B,MAAM,qBAAqB;AAAA,EAC1F,EAAE,MAAM,qBAAqB,QAAQ,0BAA0B,MAAM,qBAAqB;AAAA,EAC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-features.tsx"],"sourcesContent":["import {\n BadgeCheck,\n Code,\n Database,\n DoorOpen,\n EyeOff,\n FileCog,\n Gem,\n Globe,\n HandCoins,\n Lock,\n Percent,\n ScanEye,\n Scale,\n ShieldCheck,\n type LucideIcon,\n} from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { cn } from \"../utils/cn.js\";\n\nconst HUES = [\n { text: \"text-brand-blue\", border: \"border-brand-blue/30\", tint: \"bg-brand-blue/10\" },\n { text: \"text-brand-maeve\", border: \"border-brand-maeve/30\", tint: \"bg-brand-maeve/10\" },\n { text: \"text-brand-orange\", border: \"border-brand-orange/30\", tint: \"bg-brand-orange/10\" },\n { text: \"text-brand-purple\", border: \"border-brand-purple/30\", tint: \"bg-brand-purple/10\" },\n { text: \"text-brand-rose\", border: \"border-brand-rose/30\", tint: \"bg-brand-rose/10\" },\n];\n\nconst FEATURES: ReadonlyArray<{ icon: LucideIcon; title: string; description: string }> = [\n { icon: HandCoins, title: \"Creator-first economy\", description: \"99% to creators/owners + 1% fee goes to the Creator Fund Airdrop.\" },\n { icon: Globe, title: \"Censorship resistance\", description: \"Assets and ownership live onchain on decentralized networks.\" },\n { icon: ShieldCheck, title: \"Stark cryptography\", description: \"All transactions are secured onchain by mathematical proofs.\" },\n { icon: EyeOff, title: \"Privacy by design\", description: \"Medialane is designed for user privacy and sovereignty.\" },\n { icon: ScanEye, title: \"Zero knowledge\", description: \"Information can be proven valid without revealing the data behind it.\" },\n { icon: Percent, title: \"Zero-fee protocols\", description: \"The smart contracts charge zero fees for interaction.\" },\n { icon: Lock, title: \"Immutable contracts\", description: \"All smart contracts are fully open source and immutable.\" },\n { icon: DoorOpen, title: \"Permissionless\", description: \"Anyone can create, trade and interact with onchain protocols.\" },\n { icon: Database, title: \"Onchain as the source of truth\", description: \"Assets, ownership, markets and data are read directly onchain.\" },\n { icon: FileCog, title: \"Programmable IP\", description: \"Licensing terms and rights are stored with the assets.\" },\n { icon: Gem, title: \"Decentralized portfolio\", description: \"Assets are stored onchain with licensing and metadata on IPFS.\" },\n { icon: Scale, title: \"Protection compliance\", description: \"Authorship and license are protected under international laws.\" },\n { icon: Code, title: \"Open source and auditable\", description: \"The code is public to audit, review and collaborate on.\" },\n];\n\nexport function DiscoverFeatures() {\n return (\n <ScrollSection icon={<BadgeCheck />} title=\"Medialane features\">\n {FEATURES.map(({ icon: Icon, title, description }, i) => {\n const hue = HUES[i % HUES.length]!;\n return (\n <div\n key={title}\n className={cn(\n \"flex min-h-[168px] w-56 shrink-0 snap-start flex-col gap-4 rounded-2xl border bg-card p-6 sm:w-64\",\n hue.border,\n )}\n >\n <span className={cn(\"flex h-11 w-11 items-center justify-center rounded-xl\", hue.tint)}>\n <Icon className={cn(\"h-6 w-6\", hue.text)} />\n </span>\n <div className=\"flex flex-col gap-1.5\">\n <h3 className=\"text-lg font-black leading-snug tracking-tight\">{title}</h3>\n <p className=\"text-sm leading-relaxed text-muted-foreground\">{description}</p>\n </div>\n </div>\n );\n })}\n </ScrollSection>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8CyB;AA9CzB,0BAgBO;AACP,4BAA8B;AAC9B,gBAAmB;AAEnB,MAAM,OAAO;AAAA,EACX,EAAE,MAAM,mBAAmB,QAAQ,wBAAwB,MAAM,mBAAmB;AAAA,EACpF,EAAE,MAAM,oBAAoB,QAAQ,yBAAyB,MAAM,oBAAoB;AAAA,EACvF,EAAE,MAAM,qBAAqB,QAAQ,0BAA0B,MAAM,qBAAqB;AAAA,EAC1F,EAAE,MAAM,qBAAqB,QAAQ,0BAA0B,MAAM,qBAAqB;AAAA,EAC1F,EAAE,MAAM,mBAAmB,QAAQ,wBAAwB,MAAM,mBAAmB;AACtF;AAEA,MAAM,WAAoF;AAAA,EACxF,EAAE,MAAM,+BAAW,OAAO,yBAAyB,aAAa,oEAAoE;AAAA,EACpI,EAAE,MAAM,2BAAO,OAAO,yBAAyB,aAAa,+DAA+D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,MAZK;AAAA,IAaP;AAAA,EAEJ,CAAC,GACH;AAEJ;","names":[]}
@@ -25,22 +25,22 @@ const HUES = [
25
25
  { text: "text-brand-rose", border: "border-brand-rose/30", tint: "bg-brand-rose/10" }
26
26
  ];
27
27
  const FEATURES = [
28
- { icon: HandCoins, title: "99% to creators and owners" },
29
- { icon: Globe, title: "Censorship resistance" },
30
- { icon: ShieldCheck, title: "Stark cryptography" },
31
- { icon: EyeOff, title: "Privacy by design" },
32
- { icon: ScanEye, title: "Zero knowledge proof with Starknet" },
33
- { icon: Percent, title: "Zero fees on protocols" },
34
- { icon: Lock, title: "Immutable smart contracts" },
35
- { icon: DoorOpen, title: "Permissionless" },
36
- { icon: Database, title: "Smart contracts are the source of truth" },
37
- { icon: FileCog, title: "Programmable IP" },
38
- { icon: Gem, title: "Immutable assets" },
39
- { icon: Scale, title: "IP protection compliance" },
40
- { icon: Code, title: "Open source and auditable" }
28
+ { icon: HandCoins, title: "Creator-first economy", description: "99% to creators/owners + 1% fee goes to the Creator Fund Airdrop." },
29
+ { icon: Globe, title: "Censorship resistance", description: "Assets and ownership live onchain on decentralized networks." },
30
+ { icon: ShieldCheck, title: "Stark cryptography", description: "All transactions are secured onchain by mathematical proofs." },
31
+ { icon: EyeOff, title: "Privacy by design", description: "Medialane is designed for user privacy and sovereignty." },
32
+ { icon: ScanEye, title: "Zero knowledge", description: "Information can be proven valid without revealing the data behind it." },
33
+ { icon: Percent, title: "Zero-fee protocols", description: "The smart contracts charge zero fees for interaction." },
34
+ { icon: Lock, title: "Immutable contracts", description: "All smart contracts are fully open source and immutable." },
35
+ { icon: DoorOpen, title: "Permissionless", description: "Anyone can create, trade and interact with onchain protocols." },
36
+ { icon: Database, title: "Onchain as the source of truth", description: "Assets, ownership, markets and data are read directly onchain." },
37
+ { icon: FileCog, title: "Programmable IP", description: "Licensing terms and rights are stored with the assets." },
38
+ { icon: Gem, title: "Decentralized portfolio", description: "Assets are stored onchain with licensing and metadata on IPFS." },
39
+ { icon: Scale, title: "Protection compliance", description: "Authorship and license are protected under international laws." },
40
+ { icon: Code, title: "Open source and auditable", description: "The code is public to audit, review and collaborate on." }
41
41
  ];
42
42
  function DiscoverFeatures() {
43
- return /* @__PURE__ */ jsx(ScrollSection, { icon: /* @__PURE__ */ jsx(BadgeCheck, {}), title: "Medialane features", children: FEATURES.map(({ icon: Icon, title }, i) => {
43
+ return /* @__PURE__ */ jsx(ScrollSection, { icon: /* @__PURE__ */ jsx(BadgeCheck, {}), title: "Medialane features", children: FEATURES.map(({ icon: Icon, title, description }, i) => {
44
44
  const hue = HUES[i % HUES.length];
45
45
  return /* @__PURE__ */ jsxs(
46
46
  "div",
@@ -51,7 +51,10 @@ function DiscoverFeatures() {
51
51
  ),
52
52
  children: [
53
53
  /* @__PURE__ */ jsx("span", { className: cn("flex h-11 w-11 items-center justify-center rounded-xl", hue.tint), children: /* @__PURE__ */ jsx(Icon, { className: cn("h-6 w-6", hue.text) }) }),
54
- /* @__PURE__ */ jsx("h3", { className: "text-lg font-black leading-snug tracking-tight", children: title })
54
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
55
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-black leading-snug tracking-tight", children: title }),
56
+ /* @__PURE__ */ jsx("p", { className: "text-sm leading-relaxed text-muted-foreground", children: description })
57
+ ] })
55
58
  ]
56
59
  },
57
60
  title
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/discover-features.tsx"],"sourcesContent":["import {\n BadgeCheck,\n Code,\n Database,\n DoorOpen,\n EyeOff,\n FileCog,\n Gem,\n Globe,\n HandCoins,\n Lock,\n Percent,\n ScanEye,\n Scale,\n ShieldCheck,\n type LucideIcon,\n} from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { cn } from \"../utils/cn.js\";\n\nconst HUES = [\n { text: \"text-brand-blue\", border: \"border-brand-blue/30\", tint: \"bg-brand-blue/10\" },\n { text: \"text-brand-maeve\", border: \"border-brand-maeve/30\", tint: \"bg-brand-maeve/10\" },\n { text: \"text-brand-orange\", border: \"border-brand-orange/30\", tint: \"bg-brand-orange/10\" },\n { text: \"text-brand-purple\", border: \"border-brand-purple/30\", tint: \"bg-brand-purple/10\" },\n { text: \"text-brand-rose\", border: \"border-brand-rose/30\", tint: \"bg-brand-rose/10\" },\n];\n\nconst FEATURES: ReadonlyArray<{ icon: LucideIcon; title: string }> = [\n { icon: HandCoins, title: \"99% to creators and owners\" },\n { icon: Globe, title: \"Censorship resistance\" },\n { icon: ShieldCheck, title: \"Stark cryptography\" },\n { icon: EyeOff, title: \"Privacy by design\" },\n { icon: ScanEye, title: \"Zero knowledge proof with Starknet\" },\n { icon: Percent, title: \"Zero fees on protocols\" },\n { icon: Lock, title: \"Immutable smart contracts\" },\n { icon: DoorOpen, title: \"Permissionless\" },\n { icon: Database, title: \"Smart contracts are the source of truth\" },\n { icon: FileCog, title: \"Programmable IP\" },\n { icon: Gem, title: \"Immutable assets\" },\n { icon: Scale, title: \"IP protection compliance\" },\n { icon: Code, title: \"Open source and auditable\" },\n];\n\nexport function DiscoverFeatures() {\n return (\n <ScrollSection icon={<BadgeCheck />} title=\"Medialane features\">\n {FEATURES.map(({ icon: Icon, title }, i) => {\n const hue = HUES[i % HUES.length]!;\n return (\n <div\n key={title}\n className={cn(\n \"flex min-h-[168px] w-56 shrink-0 snap-start flex-col gap-4 rounded-2xl border bg-card p-6 sm:w-64\",\n hue.border,\n )}\n >\n <span className={cn(\"flex h-11 w-11 items-center justify-center rounded-xl\", hue.tint)}>\n <Icon className={cn(\"h-6 w-6\", hue.text)} />\n </span>\n <h3 className=\"text-lg font-black leading-snug tracking-tight\">{title}</h3>\n </div>\n );\n })}\n </ScrollSection>\n );\n}\n"],"mappings":"AA8CyB,cAIf,YAJe;AA9CzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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ACE;AAAA,MAAC;AAAA;AAAA,QAEC,WAAW;AAAA,UACT;AAAA,UACA,IAAI;AAAA,QACN;AAAA,QAEA;AAAA,8BAAC,UAAK,WAAW,GAAG,yDAAyD,IAAI,IAAI,GACnF,8BAAC,QAAK,WAAW,GAAG,WAAW,IAAI,IAAI,GAAG,GAC5C;AAAA,UACA,oBAAC,QAAG,WAAU,kDAAkD,iBAAM;AAAA;AAAA;AAAA,MATjE;AAAA,IAUP;AAAA,EAEJ,CAAC,GACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/discover-features.tsx"],"sourcesContent":["import {\n BadgeCheck,\n Code,\n Database,\n DoorOpen,\n EyeOff,\n FileCog,\n Gem,\n Globe,\n HandCoins,\n Lock,\n Percent,\n ScanEye,\n Scale,\n ShieldCheck,\n type LucideIcon,\n} from \"lucide-react\";\nimport { ScrollSection } from \"./scroll-section.js\";\nimport { cn } from \"../utils/cn.js\";\n\nconst HUES = [\n { text: \"text-brand-blue\", border: \"border-brand-blue/30\", tint: \"bg-brand-blue/10\" },\n { text: \"text-brand-maeve\", border: \"border-brand-maeve/30\", tint: \"bg-brand-maeve/10\" },\n { text: \"text-brand-orange\", border: \"border-brand-orange/30\", tint: \"bg-brand-orange/10\" },\n { text: \"text-brand-purple\", border: \"border-brand-purple/30\", tint: \"bg-brand-purple/10\" },\n { text: \"text-brand-rose\", border: \"border-brand-rose/30\", tint: \"bg-brand-rose/10\" },\n];\n\nconst FEATURES: ReadonlyArray<{ icon: LucideIcon; title: string; description: string }> = [\n { icon: HandCoins, title: \"Creator-first economy\", description: \"99% to creators/owners + 1% fee goes to the Creator Fund Airdrop.\" },\n { icon: Globe, title: \"Censorship resistance\", description: \"Assets and ownership live onchain on decentralized networks.\" },\n { icon: ShieldCheck, title: \"Stark cryptography\", description: \"All transactions are secured onchain by mathematical proofs.\" },\n { icon: EyeOff, title: \"Privacy by design\", description: \"Medialane is designed for user privacy and sovereignty.\" },\n { icon: ScanEye, title: \"Zero knowledge\", description: \"Information can be proven valid without revealing the data behind it.\" },\n { icon: Percent, title: \"Zero-fee protocols\", description: \"The smart contracts charge zero fees for interaction.\" },\n { icon: Lock, title: \"Immutable contracts\", description: \"All smart contracts are fully open source and immutable.\" },\n { icon: DoorOpen, title: \"Permissionless\", description: \"Anyone can create, trade and interact with onchain protocols.\" },\n { icon: Database, title: \"Onchain as the source of truth\", description: \"Assets, ownership, markets and data are read directly onchain.\" },\n { icon: FileCog, title: \"Programmable IP\", description: \"Licensing terms and rights are stored with the assets.\" },\n { icon: Gem, title: \"Decentralized portfolio\", description: \"Assets are stored onchain with licensing and metadata on IPFS.\" },\n { icon: Scale, title: \"Protection compliance\", description: \"Authorship and license are protected under international laws.\" },\n { icon: Code, title: \"Open source and auditable\", description: \"The code is public to audit, review and collaborate on.\" },\n];\n\nexport function DiscoverFeatures() {\n return (\n <ScrollSection icon={<BadgeCheck />} title=\"Medialane features\">\n {FEATURES.map(({ icon: Icon, title, description }, i) => {\n const hue = HUES[i % HUES.length]!;\n return (\n <div\n key={title}\n className={cn(\n \"flex min-h-[168px] w-56 shrink-0 snap-start flex-col gap-4 rounded-2xl border bg-card p-6 sm:w-64\",\n hue.border,\n )}\n >\n <span className={cn(\"flex h-11 w-11 items-center justify-center rounded-xl\", hue.tint)}>\n <Icon className={cn(\"h-6 w-6\", hue.text)} />\n </span>\n <div className=\"flex flex-col gap-1.5\">\n <h3 className=\"text-lg font-black leading-snug tracking-tight\">{title}</h3>\n <p className=\"text-sm leading-relaxed text-muted-foreground\">{description}</p>\n </div>\n </div>\n );\n })}\n </ScrollSection>\n );\n}\n"],"mappings":"AA8CyB,cAcb,YAda;AA9CzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,qBAAqB;AAC9B,SAAS,UAAU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IAAI,CAAC,EAAE,MAAM,MAAM,OAAO,YAAY,GAAG,MAAM;AACvD,UAAM,MAAM,KAAK,IAAI,KAAK,MAAM;AAChC,WACE;AAAA,MAAC;AAAA;AAAA,QAEC,WAAW;AAAA,UACT;AAAA,UACA,IAAI;AAAA,QACN;AAAA,QAEA;AAAA,8BAAC,UAAK,WAAW,GAAG,yDAAyD,IAAI,IAAI,GACnF,8BAAC,QAAK,WAAW,GAAG,WAAW,IAAI,IAAI,GAAG,GAC5C;AAAA,UACA,qBAAC,SAAI,WAAU,yBACb;AAAA,gCAAC,QAAG,WAAU,kDAAkD,iBAAM;AAAA,YACtE,oBAAC,OAAE,WAAU,iDAAiD,uBAAY;AAAA,aAC5E;AAAA;AAAA;AAAA,MAZK;AAAA,IAaP;AAAA,EAEJ,CAAC,GACH;AAEJ;","names":[]}
@@ -19,13 +19,13 @@ declare const editionMintSchema: z.ZodObject<{
19
19
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
20
20
  licenseType: string;
21
21
  commercialUse: "Yes" | "No";
22
- value: string;
23
- recipient: string;
24
22
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
25
23
  attribution: "Required" | "Not Required";
26
24
  geographicScope: string;
27
25
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
28
26
  royalty: number;
27
+ value: string;
28
+ recipient: string;
29
29
  description?: string | undefined;
30
30
  external_url?: string | undefined;
31
31
  }, {
@@ -33,13 +33,13 @@ declare const editionMintSchema: z.ZodObject<{
33
33
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
34
34
  licenseType: string;
35
35
  commercialUse: "Yes" | "No";
36
- value: string;
37
- recipient: string;
38
36
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
39
37
  attribution: "Required" | "Not Required";
40
38
  geographicScope: string;
41
39
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
42
40
  royalty: number;
41
+ value: string;
42
+ recipient: string;
43
43
  description?: string | undefined;
44
44
  external_url?: string | undefined;
45
45
  }>;
@@ -19,13 +19,13 @@ declare const editionMintSchema: z.ZodObject<{
19
19
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
20
20
  licenseType: string;
21
21
  commercialUse: "Yes" | "No";
22
- value: string;
23
- recipient: string;
24
22
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
25
23
  attribution: "Required" | "Not Required";
26
24
  geographicScope: string;
27
25
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
28
26
  royalty: number;
27
+ value: string;
28
+ recipient: string;
29
29
  description?: string | undefined;
30
30
  external_url?: string | undefined;
31
31
  }, {
@@ -33,13 +33,13 @@ declare const editionMintSchema: z.ZodObject<{
33
33
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
34
34
  licenseType: string;
35
35
  commercialUse: "Yes" | "No";
36
- value: string;
37
- recipient: string;
38
36
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
39
37
  attribution: "Required" | "Not Required";
40
38
  geographicScope: string;
41
39
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
42
40
  royalty: number;
41
+ value: string;
42
+ recipient: string;
43
43
  description?: string | undefined;
44
44
  external_url?: string | undefined;
45
45
  }>;
@@ -50,7 +50,7 @@ function PopBurnButton({ collectionAddress, tokenId, onBurned }) {
50
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
51
  });
52
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." }),
53
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: "Burning removes this credential permanently." }),
54
54
  tx.phase === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-destructive", children: tx.error }),
55
55
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-2", children: [
56
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" }),
@@ -1 +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":[]}
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 Burning removes this credential permanently.\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,0DAE7C;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":[]}
@@ -27,7 +27,7 @@ function PopBurnButton({ collectionAddress, tokenId, onBurned }) {
27
27
  await runIntentCalls(signer, () => app.getClient().api.intents.create("pop-burn", { owner: signer.address, collection: collectionAddress, tokenId: String(tokenId) }));
28
28
  });
29
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." }),
30
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Burning removes this credential permanently." }),
31
31
  tx.phase === "error" && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: tx.error }),
32
32
  /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
33
33
  /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", className: "flex-1", disabled: busy, onClick: () => setConfirming(false), children: "Keep it" }),
@@ -1 +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":";AA0BW,cAKL,YALK;AAxBX,SAAS,WAAW,gBAAgB;AACpC,SAAS,SAAS,cAAc;AAChC,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAQxB,SAAS,cAAc,EAAE,mBAAmB,SAAS,SAAS,GAAuB;AAC1F,QAAM,MAAM,gBAAgB;AAC5B,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAClD,QAAM,KAAK,eAAe;AAC1B,QAAM,OAAO,GAAG,UAAU,eAAe,GAAG,UAAU,gBAAgB,GAAG,UAAU;AAEnF,YAAU,MAAM;AACd,QAAI,GAAG,UAAU,UAAW,YAAW;AAAA,EACzC,GAAG,CAAC,GAAG,OAAO,QAAQ,CAAC;AAEvB,MAAI,GAAG,UAAU,WAAW;AAC1B,WAAO,oBAAC,OAAE,WAAU,iCAAgC,uCAAyB;AAAA,EAC/E;AAEA,MAAI,CAAC,YAAY;AACf,WACE,qBAAC,UAAO,SAAQ,SAAQ,MAAK,MAAK,WAAU,yBAAwB,SAAS,MAAM,cAAc,IAAI,GACnG;AAAA,0BAAC,UAAO,WAAU,sBAAqB;AAAA,MAAE;AAAA,OAE3C;AAAA,EAEJ;AAEA,QAAM,SAAS,MACb,KAAK,GAAG,IAAI,OAAO,WAAW;AAC5B,UAAM,eAAe,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,qBAAC,SAAI,WAAU,iDACb;AAAA,wBAAC,OAAE,WAAU,iCAAgC,6FAE7C;AAAA,IACC,GAAG,UAAU,WAAW,oBAAC,OAAE,WAAU,4BAA4B,aAAG,OAAM;AAAA,IAC3E,qBAAC,SAAI,WAAU,cACb;AAAA,0BAAC,UAAO,SAAQ,WAAU,MAAK,MAAK,WAAU,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":[]}
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 Burning removes this credential permanently.\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":";AA0BW,cAKL,YALK;AAxBX,SAAS,WAAW,gBAAgB;AACpC,SAAS,SAAS,cAAc;AAChC,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAQxB,SAAS,cAAc,EAAE,mBAAmB,SAAS,SAAS,GAAuB;AAC1F,QAAM,MAAM,gBAAgB;AAC5B,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAClD,QAAM,KAAK,eAAe;AAC1B,QAAM,OAAO,GAAG,UAAU,eAAe,GAAG,UAAU,gBAAgB,GAAG,UAAU;AAEnF,YAAU,MAAM;AACd,QAAI,GAAG,UAAU,UAAW,YAAW;AAAA,EACzC,GAAG,CAAC,GAAG,OAAO,QAAQ,CAAC;AAEvB,MAAI,GAAG,UAAU,WAAW;AAC1B,WAAO,oBAAC,OAAE,WAAU,iCAAgC,uCAAyB;AAAA,EAC/E;AAEA,MAAI,CAAC,YAAY;AACf,WACE,qBAAC,UAAO,SAAQ,SAAQ,MAAK,MAAK,WAAU,yBAAwB,SAAS,MAAM,cAAc,IAAI,GACnG;AAAA,0BAAC,UAAO,WAAU,sBAAqB;AAAA,MAAE;AAAA,OAE3C;AAAA,EAEJ;AAEA,QAAM,SAAS,MACb,KAAK,GAAG,IAAI,OAAO,WAAW;AAC5B,UAAM,eAAe,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,qBAAC,SAAI,WAAU,iDACb;AAAA,wBAAC,OAAE,WAAU,iCAAgC,0DAE7C;AAAA,IACC,GAAG,UAAU,WAAW,oBAAC,OAAE,WAAU,4BAA4B,aAAG,OAAM;AAAA,IAC3E,qBAAC,SAAI,WAAU,cACb;AAAA,0BAAC,UAAO,SAAQ,WAAU,MAAK,MAAK,WAAU,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":[]}
@@ -60,7 +60,7 @@ function TransactionDialog({ tx, title, workingLabel, firstStepLabel = "Prepare"
60
60
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: done ? "text-sm text-foreground" : active ? "text-sm font-medium text-primary" : "text-sm text-muted-foreground", children: label })
61
61
  ] }, label);
62
62
  }) }),
63
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-center text-xs text-muted-foreground", children: "This usually takes 10\u201330 seconds. Do not close this window." })
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-center text-xs text-muted-foreground", children: "This usually takes 10\u201330 seconds." })
64
64
  ] }),
65
65
  success && children,
66
66
  failed && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-center gap-5 py-2", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, \"Submit transaction\", \"Confirm transaction\"];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? \"Waiting for block confirmation\" : \"Submitting transaction\"}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">This usually takes 10–30 seconds. Do not close this window.</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10\">\n <XCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"outline\" className=\"w-full\" onClick={reset}>\n {retryable ? \"Try again\" : \"Close\"}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCQ;AAjCR,0BAA+C;AAC/C,oBAAmD;AACnD,oBAAuB;AACvB,0BAA4B;AAW5B,MAAM,cAAc,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,EAAE;AAE1D,SAAS,kBAAkB,EAAE,IAAI,OAAO,cAAc,iBAAiB,WAAW,SAAS,GAA2B;AAC3H,QAAM,EAAE,OAAO,OAAO,OAAO,Y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,4BAA4B,SAAS,qCAAqC,iCAC/F,iBACH;AAAA,iBAVO,KAWT;AAAA,UAEJ,CAAC,GACH;AAAA,UACA,4CAAC,OAAE,WAAU,6CAA4C,8EAA2D;AAAA,WACtH;AAAA,QAGD,WAAW;AAAA,QAEX,UACC,6CAAC,SAAI,WAAU,yCACb;AAAA,sDAAC,SAAI,WAAU,6EACb,sDAAC,+BAAQ,WAAU,4BAA2B,GAChD;AAAA,UACA,6CAAC,SAAI,WAAU,yBACb;AAAA,wDAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,4CAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,4CAAC,wBAAO,SAAQ,WAAU,WAAU,UAAS,SAAS,OACnD,sBAAY,cAAc,SAC7B;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, \"Submit transaction\", \"Confirm transaction\"];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? \"Waiting for block confirmation\" : \"Submitting transaction\"}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">This usually takes 10–30 seconds.</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10\">\n <XCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"outline\" className=\"w-full\" onClick={reset}>\n {retryable ? \"Try again\" : \"Close\"}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCQ;AAjCR,0BAA+C;AAC/C,oBAAmD;AACnD,oBAAuB;AACvB,0BAA4B;AAW5B,MAAM,cAAc,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,EAAE;AAE1D,SAAS,kBAAkB,EAAE,IAAI,OAAO,cAAc,iBAAiB,WAAW,SAAS,GAA2B;AAC3H,QAAM,EAAE,OAAO,OAAO,OAAO,YAAY,KAAK,IAAI;AAClD,QAAM,UAAU,UAAU,eAAe,UAAU,gBAAgB,UAAU;AAC7E,QAAM,UAAU,UAAU;AAC1B,QAAM,SAAS,UAAU;AACzB,QAAM,QAAQ,CAAC,gBAAgB,sBAAsB,qBAAqB;AAE1E,uCAAY,OAAO;AAEnB,SACE,4CAAC,wBAAO,MAAM,UAAU,QAAQ,OAAK,MAAC,cAAc,CAAC,SAAS;AAAE,QAAI,CAAC,QAAQ,CAAC,QAAS,OAAM;AAAA,EAAG,GAC9F;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,mBAAmB,UAAU,CAAC,MAAM,EAAE,eAAe,IAAI;AAAA,MACzD,iBAAiB,UAAU,CAAC,MAAM,EAAE,eAAe,IAAI;AAAA,MACtD,GAAI,UAAU,EAAE,WAAW,KAAK,IAAI,CAAC;AAAA,MAEtC;AAAA,oDAAC,6BAAY,WAAU,WAAW,oBAAU,eAAe,OAAM;AAAA,QAEhE,WACC,6CAAC,SAAI,WAAU,yCACb;AAAA,sDAAC,SAAI,WAAU,yEACb,sDAAC,+BAAQ,WAAU,qCAAoC,GACzD;AAAA,UACA,6CAAC,SAAI,WAAU,yBACb;AAAA,wDAAC,OAAE,WAAU,yBAAyB,wBAAa;AAAA,YACnD,4CAAC,OAAE,WAAU,iCACV,oBAAU,eAAe,mCAAmC,0BAC/D;AAAA,aACF;AAAA,UACA,4CAAC,QAAG,WAAU,uEACX,gBAAM,IAAI,CAAC,OAAO,MAAM;AACvB,kBAAM,SAAS,MAAM,YAAY,KAAK;AACtC,kBAAM,OAAO,IAAI,YAAY,KAAK;AAClC,mBACE,6CAAC,QAAe,aAAS,MAAC,gBAAc,SAAS,SAAS,QAAW,WAAU,2BAC5E;AAAA,qBACC,4CAAC,oCAAa,WAAU,qCAAoC,IAC1D,SACF,4CAAC,+BAAQ,WAAU,8CAA6C,IAEhE,4CAAC,SAAI,WAAU,qEAAoE;AAAA,cAErF,4CAAC,UAAK,WAAW,OAAO,4BAA4B,SAAS,qCAAqC,iCAC/F,iBACH;AAAA,iBAVO,KAWT;AAAA,UAEJ,CAAC,GACH;AAAA,UACA,4CAAC,OAAE,WAAU,6CAA4C,oDAAiC;AAAA,WAC5F;AAAA,QAGD,WAAW;AAAA,QAEX,UACC,6CAAC,SAAI,WAAU,yCACb;AAAA,sDAAC,SAAI,WAAU,6EACb,sDAAC,+BAAQ,WAAU,4BAA2B,GAChD;AAAA,UACA,6CAAC,SAAI,WAAU,yBACb;AAAA,wDAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,4CAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,4CAAC,wBAAO,SAAQ,WAAU,WAAU,UAAS,SAAS,OACnD,sBAAY,cAAc,SAC7B;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
@@ -37,7 +37,7 @@ function TransactionDialog({ tx, title, workingLabel, firstStepLabel = "Prepare"
37
37
  /* @__PURE__ */ jsx("span", { className: done ? "text-sm text-foreground" : active ? "text-sm font-medium text-primary" : "text-sm text-muted-foreground", children: label })
38
38
  ] }, label);
39
39
  }) }),
40
- /* @__PURE__ */ jsx("p", { className: "text-center text-xs text-muted-foreground", children: "This usually takes 10\u201330 seconds. Do not close this window." })
40
+ /* @__PURE__ */ jsx("p", { className: "text-center text-xs text-muted-foreground", children: "This usually takes 10\u201330 seconds." })
41
41
  ] }),
42
42
  success && children,
43
43
  failed && /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-5 py-2", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, \"Submit transaction\", \"Confirm transaction\"];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? \"Waiting for block confirmation\" : \"Submitting transaction\"}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">This usually takes 10–30 seconds. Do not close this window.</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10\">\n <XCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"outline\" className=\"w-full\" onClick={reset}>\n {retryable ? \"Try again\" : \"Close\"}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAoCQ,cAOI,YAPJ;AAjCR,SAAS,cAAc,SAAS,eAAe;AAC/C,SAAS,QAAQ,eAAe,mBAAmB;AACnD,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAW5B,MAAM,cAAc,EAA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ACC,oBAAC,gBAAa,WAAU,qCAAoC,IAC1D,SACF,oBAAC,WAAQ,WAAU,8CAA6C,IAEhE,oBAAC,SAAI,WAAU,qEAAoE;AAAA,cAErF,oBAAC,UAAK,WAAW,OAAO,4BAA4B,SAAS,qCAAqC,iCAC/F,iBACH;AAAA,iBAVO,KAWT;AAAA,UAEJ,CAAC,GACH;AAAA,UACA,oBAAC,OAAE,WAAU,6CAA4C,8EAA2D;AAAA,WACtH;AAAA,QAGD,WAAW;AAAA,QAEX,UACC,qBAAC,SAAI,WAAU,yCACb;AAAA,8BAAC,SAAI,WAAU,6EACb,8BAAC,WAAQ,WAAU,4BAA2B,GAChD;AAAA,UACA,qBAAC,SAAI,WAAU,yBACb;AAAA,gCAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,oBAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,oBAAC,UAAO,SAAQ,WAAU,WAAU,UAAS,SAAS,OACnD,sBAAY,cAAc,SAC7B;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, \"Submit transaction\", \"Confirm transaction\"];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? \"Waiting for block confirmation\" : \"Submitting transaction\"}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">This usually takes 10–30 seconds.</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10\">\n <XCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"outline\" className=\"w-full\" onClick={reset}>\n {retryable ? \"Try again\" : \"Close\"}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAoCQ,cAOI,YAPJ;AAjCR,SAAS,cAAc,SAAS,eAAe;AAC/C,SAAS,QAAQ,eAAe,mBAAmB;AACnD,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAW5B,MAAM,cAAc,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,EAAE;AAE1D,SAAS,kBAAkB,EAAE,IAAI,OAAO,cAAc,iBAAiB,WAAW,SAAS,GAA2B;AAC3H,QAAM,EAAE,OAAO,OAAO,OAAO,YAAY,KAAK,IAAI;AAClD,QAAM,UAAU,UAAU,eAAe,UAAU,gBAAgB,UAAU;AAC7E,QAAM,UAAU,UAAU;AAC1B,QAAM,SAAS,UAAU;AACzB,QAAM,QAAQ,CAAC,gBAAgB,sBAAsB,qBAAqB;AAE1E,cAAY,OAAO;AAEnB,SACE,oBAAC,UAAO,MAAM,UAAU,QAAQ,OAAK,MAAC,cAAc,CAAC,SAAS;AAAE,QAAI,CAAC,QAAQ,CAAC,QAAS,OAAM;AAAA,EAAG,GAC9F;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,mBAAmB,UAAU,CAAC,MAAM,EAAE,eAAe,IAAI;AAAA,MACzD,iBAAiB,UAAU,CAAC,MAAM,EAAE,eAAe,IAAI;AAAA,MACtD,GAAI,UAAU,EAAE,WAAW,KAAK,IAAI,CAAC;AAAA,MAEtC;AAAA,4BAAC,eAAY,WAAU,WAAW,oBAAU,eAAe,OAAM;AAAA,QAEhE,WACC,qBAAC,SAAI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place_dialog_primitives.MarketplaceConfirmStep,
157
157
  {
158
- description: "Transfer this asset? This action cannot be undone.",
158
+ description: "Transfer this asset?",
159
159
  error,
160
160
  secondaryLabel: "Back",
161
161
  onSecondary: () => {
@@ -174,11 +174,11 @@ function TransferDialog({
174
174
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-bold text-base leading-tight truncate", children: displayName }),
175
175
  hasActiveListing && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, { variant: "destructive", children: [
176
176
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-4 w-4" }),
177
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs", children: "This token has an active listing. A buyer could still complete the purchase after you transfer it \u2014 cancel the listing first, or proceed with caution." })
177
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs", children: "This token has an active listing. Cancelling the listing first keeps the sale from completing after the transfer." })
178
178
  ] }),
179
179
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, { children: [
180
180
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-4 w-4" }),
181
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs", children: "Transfers are permanent and irreversible. Double-check the recipient address before confirming." })
181
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs", children: "Transfers are final and recorded onchain." })
182
182
  ] }),
183
183
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.Form, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-3", children: [
184
184
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transfer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { AlertCircle, ArrowRightLeft, ShieldCheck } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { MarketplaceConfirmStep, MarketplaceDialogHero } from \"./marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"./transaction-dialog-states.js\";\nimport { isBusyPhase, type TransactionPhase } from \"../utils/use-transaction.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\n\nconst schema = z.object({\n toAddress: z\n .string()\n .min(1, \"Recipient address is required\")\n .regex(/^0x[0-9a-fA-F]{1,64}$/, \"Must be a valid Starknet address (0x followed by hex characters)\"),\n});\n\ntype FormValues = z.infer<typeof schema>;\n\ntype Step = \"form\" | \"confirm\";\n\nexport interface TransferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n tokenId: string;\n tokenName?: string;\n tokenImage?: string | null;\n hasActiveListing?: boolean;\n walletAddress?: string | null;\n canTransfer: boolean;\n connectLabel: string;\n footerNote: string;\n tx: {\n phase: TransactionPhase;\n txHash: string | null;\n error: string | null;\n retryable?: boolean;\n reset: () => void;\n };\n onTransfer: (toAddress: string) => void;\n onSuccess?: () => void;\n}\n\nexport function TransferDialog({\n open,\n onOpenChange,\n tokenId,\n tokenName,\n tokenImage,\n hasActiveListing = false,\n walletAddress,\n canTransfer,\n connectLabel,\n footerNote,\n tx,\n onTransfer,\n onSuccess,\n}: TransferDialogProps) {\n const { phase, txHash, error, retryable = true, reset } = tx;\n const busy = isBusyPhase(phase);\n const [step, setStep] = useState<Step>(\"form\");\n const [pendingAddress, setPendingAddress] = useState<string | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { toAddress: \"\" },\n });\n\n const resetDialog = () => {\n reset();\n form.reset();\n setPendingAddress(null);\n setStep(\"form\");\n };\n\n useEffect(() => {\n if (open) resetDialog();\n }, [open]);\n\n const close = () => {\n resetDialog();\n onOpenChange(false);\n };\n\n const handleClose = (value: boolean) => {\n if (!value && !busy && phase !== \"success\") close();\n };\n\n const onSubmit = (values: FormValues) => {\n if (walletAddress) {\n try {\n if (BigInt(values.toAddress) === BigInt(walletAddress)) {\n form.setError(\"toAddress\", { message: \"Cannot transfer to yourself\" });\n return;\n }\n } catch {\n void 0;\n }\n }\n if (!canTransfer) return;\n setPendingAddress(values.toAddress);\n setStep(\"confirm\");\n };\n\n const displayName = tokenName || `Token #${tokenId}`;\n const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}…${pendingAddress.slice(-6)}` : \"\";\n\n const footer = (\n <div className=\"flex items-start justify-center gap-1.5\">\n <ShieldCheck className=\"h-3 w-3 text-muted-foreground shrink-0 mt-0.5\" />\n <p className=\"text-2xs text-center text-muted-foreground\">{footerNote}</p>\n </div>\n );\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]\">\n <DialogTitle className=\"sr-only\">Transfer {displayName}</DialogTitle>\n <DialogDescription className=\"sr-only\">\n Enter a recipient Starknet address to transfer this asset onchain.\n </DialogDescription>\n\n <TransactionDialogStates\n phase={phase}\n asset={{ name: displayName, image: tokenImage }}\n statusMessage=\"Confirming on Starknet…\"\n txHash={txHash}\n error={error}\n success={successMessages.transferred({ name: displayName, to: recipientShort })}\n successActions={[{ label: \"Done\", onClick: () => { close(); onSuccess?.(); } }]}\n errorTitle=\"Transfer failed\"\n errorDescription=\"The transaction was submitted, but the transfer could not be completed.\"\n onRetry={retryable ? () => { reset(); setStep(\"form\"); } : undefined}\n onDone={close}\n >\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId}\n fallbackIcon={<ArrowRightLeft className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n {step === \"confirm\" ? (\n <>\n <div className=\"flex items-end justify-between px-6 pt-3 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{displayName}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5 tabular-nums truncate\">→ {recipientShort}</p>\n </div>\n </div>\n <MarketplaceConfirmStep\n description=\"Transfer this asset? This action cannot be undone.\"\n error={error}\n secondaryLabel=\"Back\"\n onSecondary={() => { reset(); setStep(\"form\"); }}\n primaryLabel=\"Transfer\"\n onPrimary={() => { if (pendingAddress) onTransfer(pendingAddress); }}\n primaryIcon={<ArrowRightLeft className=\"h-4 w-4\" />}\n footer={footer}\n />\n </>\n ) : (\n <div className=\"px-5 pb-4 pt-3 space-y-3\">\n <p className=\"font-bold text-base leading-tight truncate\">{displayName}</p>\n\n {hasActiveListing && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n This token has an active listing. A buyer could still complete the purchase after you transfer it — cancel the listing first, or proceed with caution.\n </AlertDescription>\n </Alert>\n )}\n\n <Alert>\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n Transfers are permanent and irreversible. Double-check the recipient address before confirming.\n </AlertDescription>\n </Alert>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-3\">\n <FormField\n control={form.control}\n name=\"toAddress\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Recipient address</FormLabel>\n <FormControl>\n <Input placeholder=\"0x…\" autoComplete=\"off\" spellCheck={false} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n {error && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"pt-1 space-y-2\">\n <div className=\"btn-border-animated p-[1px] rounded-xl\">\n <button\n type=\"submit\"\n disabled={!canTransfer}\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n >\n <ArrowRightLeft className=\"h-4 w-4\" />\n {canTransfer ? \"Transfer\" : connectLabel}\n </button>\n </div>\n {footer}\n </div>\n </form>\n </Form>\n </div>\n )}\n </TransactionDialogStates>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkHI;AAhHJ,mBAAoC;AACpC,6BAAwB;AACxB,iBAA4B;AAC5B,QAAmB;AACnB,0BAAyD;AACzD,oBAAsE;AACtE,kBAA+E;AAC/E,mBAAsB;AACtB,mBAAwC;AACxC,2CAA8D;AAC9D,uCAAwC;AACxC,6BAAmD;AACnD,8BAAgC;AAEhC,MAAM,SAAS,EAAE,OAAO;AAAA,EACtB,WAAW,EACR,OAAO,EACP,IAAI,GAAG,+BAA+B,EACtC,MAAM,yBAAyB,kEAAkE;AACtG,CAAC;AA4BM,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,QAAM,EAAE,OAAO,QAAQ,OAAO,YAAY,MAAM,MAAM,IAAI;AAC1D,QAAM,WAAO,oCAAY,KAAK;AAC9B,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAe,MAAM;AAC7C,QAAM,CAAC,gBAAgB,iBAAiB,QAAI,uBAAwB,IAAI;AAExE,QAAM,WAAO,gCAAoB;AAAA,IAC/B,cAAU,wBAAY,MAAM;AAAA,IAC5B,eAAe,EAAE,WAAW,GAAG;AAAA,EACjC,C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;AAAA,0DAAC,mCAAY,WAAU,WAAU;AAAA,cACjC,4CAAC,iCAAiB,WAAU,WAAU,6GAEtC;AAAA,eACF;AAAA,YAEA,4CAAC,oBAAM,GAAG,MACR,uDAAC,UAAK,UAAU,KAAK,aAAa,QAAQ,GAAG,WAAU,aACrD;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAS,KAAK;AAAA,kBACd,MAAK;AAAA,kBACL,QAAQ,CAAC,EAAE,MAAM,MACf,6CAAC,wBACC;AAAA,gEAAC,yBAAU,+BAAiB;AAAA,oBAC5B,4CAAC,2BACC,sDAAC,sBAAM,aAAY,YAAM,cAAa,OAAM,YAAY,OAAQ,GAAG,OAAO,GAC5E;AAAA,oBACA,4CAAC,2BAAY;AAAA,qBACf;AAAA;AAAA,cAEJ;AAAA,cAEC,SACC,6CAAC,sBAAM,SAAQ,eACb;AAAA,4DAAC,mCAAY,WAAU,WAAU;AAAA,gBACjC,4CAAC,iCAAkB,iBAAM;AAAA,iBAC3B;AAAA,cAGF,6CAAC,SAAI,WAAU,kBACb;AAAA,4DAAC,SAAI,WAAU,0CACb;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAK;AAAA,oBACL,UAAU,CAAC;AAAA,oBACX,WAAU;AAAA,oBAEV;AAAA,kEAAC,sCAAe,WAAU,WAAU;AAAA,sBACnC,cAAc,aAAa;AAAA;AAAA;AAAA,gBAC9B,GACF;AAAA,gBACC;AAAA,iBACH;AAAA,eACF,GACF;AAAA,aACF;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transfer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { AlertCircle, ArrowRightLeft, ShieldCheck } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { MarketplaceConfirmStep, MarketplaceDialogHero } from \"./marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"./transaction-dialog-states.js\";\nimport { isBusyPhase, type TransactionPhase } from \"../utils/use-transaction.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\n\nconst schema = z.object({\n toAddress: z\n .string()\n .min(1, \"Recipient address is required\")\n .regex(/^0x[0-9a-fA-F]{1,64}$/, \"Must be a valid Starknet address (0x followed by hex characters)\"),\n});\n\ntype FormValues = z.infer<typeof schema>;\n\ntype Step = \"form\" | \"confirm\";\n\nexport interface TransferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n tokenId: string;\n tokenName?: string;\n tokenImage?: string | null;\n hasActiveListing?: boolean;\n walletAddress?: string | null;\n canTransfer: boolean;\n connectLabel: string;\n footerNote: string;\n tx: {\n phase: TransactionPhase;\n txHash: string | null;\n error: string | null;\n retryable?: boolean;\n reset: () => void;\n };\n onTransfer: (toAddress: string) => void;\n onSuccess?: () => void;\n}\n\nexport function TransferDialog({\n open,\n onOpenChange,\n tokenId,\n tokenName,\n tokenImage,\n hasActiveListing = false,\n walletAddress,\n canTransfer,\n connectLabel,\n footerNote,\n tx,\n onTransfer,\n onSuccess,\n}: TransferDialogProps) {\n const { phase, txHash, error, retryable = true, reset } = tx;\n const busy = isBusyPhase(phase);\n const [step, setStep] = useState<Step>(\"form\");\n const [pendingAddress, setPendingAddress] = useState<string | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { toAddress: \"\" },\n });\n\n const resetDialog = () => {\n reset();\n form.reset();\n setPendingAddress(null);\n setStep(\"form\");\n };\n\n useEffect(() => {\n if (open) resetDialog();\n }, [open]);\n\n const close = () => {\n resetDialog();\n onOpenChange(false);\n };\n\n const handleClose = (value: boolean) => {\n if (!value && !busy && phase !== \"success\") close();\n };\n\n const onSubmit = (values: FormValues) => {\n if (walletAddress) {\n try {\n if (BigInt(values.toAddress) === BigInt(walletAddress)) {\n form.setError(\"toAddress\", { message: \"Cannot transfer to yourself\" });\n return;\n }\n } catch {\n void 0;\n }\n }\n if (!canTransfer) return;\n setPendingAddress(values.toAddress);\n setStep(\"confirm\");\n };\n\n const displayName = tokenName || `Token #${tokenId}`;\n const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}…${pendingAddress.slice(-6)}` : \"\";\n\n const footer = (\n <div className=\"flex items-start justify-center gap-1.5\">\n <ShieldCheck className=\"h-3 w-3 text-muted-foreground shrink-0 mt-0.5\" />\n <p className=\"text-2xs text-center text-muted-foreground\">{footerNote}</p>\n </div>\n );\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]\">\n <DialogTitle className=\"sr-only\">Transfer {displayName}</DialogTitle>\n <DialogDescription className=\"sr-only\">\n Enter a recipient Starknet address to transfer this asset onchain.\n </DialogDescription>\n\n <TransactionDialogStates\n phase={phase}\n asset={{ name: displayName, image: tokenImage }}\n statusMessage=\"Confirming on Starknet…\"\n txHash={txHash}\n error={error}\n success={successMessages.transferred({ name: displayName, to: recipientShort })}\n successActions={[{ label: \"Done\", onClick: () => { close(); onSuccess?.(); } }]}\n errorTitle=\"Transfer failed\"\n errorDescription=\"The transaction was submitted, but the transfer could not be completed.\"\n onRetry={retryable ? () => { reset(); setStep(\"form\"); } : undefined}\n onDone={close}\n >\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId}\n fallbackIcon={<ArrowRightLeft className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n {step === \"confirm\" ? (\n <>\n <div className=\"flex items-end justify-between px-6 pt-3 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{displayName}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5 tabular-nums truncate\">→ {recipientShort}</p>\n </div>\n </div>\n <MarketplaceConfirmStep\n description=\"Transfer this asset?\"\n error={error}\n secondaryLabel=\"Back\"\n onSecondary={() => { reset(); setStep(\"form\"); }}\n primaryLabel=\"Transfer\"\n onPrimary={() => { if (pendingAddress) onTransfer(pendingAddress); }}\n primaryIcon={<ArrowRightLeft className=\"h-4 w-4\" />}\n footer={footer}\n />\n </>\n ) : (\n <div className=\"px-5 pb-4 pt-3 space-y-3\">\n <p className=\"font-bold text-base leading-tight truncate\">{displayName}</p>\n\n {hasActiveListing && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n This token has an active listing. Cancelling the listing first keeps the sale from completing after the transfer.\n </AlertDescription>\n </Alert>\n )}\n\n <Alert>\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n Transfers are final and recorded onchain.\n </AlertDescription>\n </Alert>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-3\">\n <FormField\n control={form.control}\n name=\"toAddress\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Recipient address</FormLabel>\n <FormControl>\n <Input placeholder=\"0x…\" autoComplete=\"off\" spellCheck={false} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n {error && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"pt-1 space-y-2\">\n <div className=\"btn-border-animated p-[1px] rounded-xl\">\n <button\n type=\"submit\"\n disabled={!canTransfer}\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n >\n <ArrowRightLeft className=\"h-4 w-4\" />\n {canTransfer ? \"Transfer\" : connectLabel}\n </button>\n </div>\n {footer}\n </div>\n </form>\n </Form>\n </div>\n )}\n </TransactionDialogStates>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkHI;AAhHJ,mBAAoC;AACpC,6BAAwB;AACxB,iBAA4B;AAC5B,QAAmB;AACnB,0BAAyD;AACzD,oBAAsE;AACtE,kBAA+E;AAC/E,mBAAsB;AACtB,mBAAwC;AACxC,2CAA8D;AAC9D,uCAAwC;AACxC,6BAAmD;AACnD,8BAAgC;AAEhC,MAAM,SAAS,EAAE,OAAO;AAAA,EACtB,WAAW,EACR,OAAO,EACP,IAAI,GAAG,+BAA+B,EACtC,MAAM,yBAAyB,kEAAkE;AACtG,CAAC;AA4BM,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,QAAM,EAAE,OAAO,QAAQ,OAAO,YAAY,MAAM,MAAM,IAAI;AAC1D,QAAM,WAAO,oCAAY,KAAK;AAC9B,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAe,MAAM;AAC7C,QAAM,CAAC,gBAAgB,iBAAiB,QAAI,uBAAwB,IAAI;AAExE,QAAM,WAAO,gCAAoB;AAAA,IAC/B,cAAU,wBAAY,MAAM;AAAA,IAC5B,eAAe,EAAE,WAAW,GAAG;AAAA,EACjC,CAAC;AAED,QAAM,cAAc,MAAM;AACxB,UAAM;AACN,SAAK,MAAM;AACX,sBAAkB,IAAI;AACtB,YAAQ,MAAM;AAAA,EAChB;AAEA,8BAAU,MAAM;AACd,QAAI,KAAM,aAAY;AAAA,EACxB,GAAG,CAAC,IAAI,CAAC;AAET,QAAM,QAAQ,MAAM;AAClB,gBAAY;AACZ,iBAAa,KAAK;AA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ACd,MAAK;AAAA,kBACL,QAAQ,CAAC,EAAE,MAAM,MACf,6CAAC,wBACC;AAAA,gEAAC,yBAAU,+BAAiB;AAAA,oBAC5B,4CAAC,2BACC,sDAAC,sBAAM,aAAY,YAAM,cAAa,OAAM,YAAY,OAAQ,GAAG,OAAO,GAC5E;AAAA,oBACA,4CAAC,2BAAY;AAAA,qBACf;AAAA;AAAA,cAEJ;AAAA,cAEC,SACC,6CAAC,sBAAM,SAAQ,eACb;AAAA,4DAAC,mCAAY,WAAU,WAAU;AAAA,gBACjC,4CAAC,iCAAkB,iBAAM;AAAA,iBAC3B;AAAA,cAGF,6CAAC,SAAI,WAAU,kBACb;AAAA,4DAAC,SAAI,WAAU,0CACb;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAK;AAAA,oBACL,UAAU,CAAC;AAAA,oBACX,WAAU;AAAA,oBAEV;AAAA,kEAAC,sCAAe,WAAU,WAAU;AAAA,sBACnC,cAAc,aAAa;AAAA;AAAA;AAAA,gBAC9B,GACF;AAAA,gBACC;AAAA,iBACH;AAAA,eACF,GACF;AAAA,aACF;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -122,7 +122,7 @@ function TransferDialog({
122
122
  /* @__PURE__ */ jsx(
123
123
  MarketplaceConfirmStep,
124
124
  {
125
- description: "Transfer this asset? This action cannot be undone.",
125
+ description: "Transfer this asset?",
126
126
  error,
127
127
  secondaryLabel: "Back",
128
128
  onSecondary: () => {
@@ -141,11 +141,11 @@ function TransferDialog({
141
141
  /* @__PURE__ */ jsx("p", { className: "font-bold text-base leading-tight truncate", children: displayName }),
142
142
  hasActiveListing && /* @__PURE__ */ jsxs(Alert, { variant: "destructive", children: [
143
143
  /* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" }),
144
- /* @__PURE__ */ jsx(AlertDescription, { className: "text-xs", children: "This token has an active listing. A buyer could still complete the purchase after you transfer it \u2014 cancel the listing first, or proceed with caution." })
144
+ /* @__PURE__ */ jsx(AlertDescription, { className: "text-xs", children: "This token has an active listing. Cancelling the listing first keeps the sale from completing after the transfer." })
145
145
  ] }),
146
146
  /* @__PURE__ */ jsxs(Alert, { children: [
147
147
  /* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" }),
148
- /* @__PURE__ */ jsx(AlertDescription, { className: "text-xs", children: "Transfers are permanent and irreversible. Double-check the recipient address before confirming." })
148
+ /* @__PURE__ */ jsx(AlertDescription, { className: "text-xs", children: "Transfers are final and recorded onchain." })
149
149
  ] }),
150
150
  /* @__PURE__ */ jsx(Form, { ...form, children: /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-3", children: [
151
151
  /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transfer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { AlertCircle, ArrowRightLeft, ShieldCheck } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { MarketplaceConfirmStep, MarketplaceDialogHero } from \"./marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"./transaction-dialog-states.js\";\nimport { isBusyPhase, type TransactionPhase } from \"../utils/use-transaction.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\n\nconst schema = z.object({\n toAddress: z\n .string()\n .min(1, \"Recipient address is required\")\n .regex(/^0x[0-9a-fA-F]{1,64}$/, \"Must be a valid Starknet address (0x followed by hex characters)\"),\n});\n\ntype FormValues = z.infer<typeof schema>;\n\ntype Step = \"form\" | \"confirm\";\n\nexport interface TransferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n tokenId: string;\n tokenName?: string;\n tokenImage?: string | null;\n hasActiveListing?: boolean;\n walletAddress?: string | null;\n canTransfer: boolean;\n connectLabel: string;\n footerNote: string;\n tx: {\n phase: TransactionPhase;\n txHash: string | null;\n error: string | null;\n retryable?: boolean;\n reset: () => void;\n };\n onTransfer: (toAddress: string) => void;\n onSuccess?: () => void;\n}\n\nexport function TransferDialog({\n open,\n onOpenChange,\n tokenId,\n tokenName,\n tokenImage,\n hasActiveListing = false,\n walletAddress,\n canTransfer,\n connectLabel,\n footerNote,\n tx,\n onTransfer,\n onSuccess,\n}: TransferDialogProps) {\n const { phase, txHash, error, retryable = true, reset } = tx;\n const busy = isBusyPhase(phase);\n const [step, setStep] = useState<Step>(\"form\");\n const [pendingAddress, setPendingAddress] = useState<string | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { toAddress: \"\" },\n });\n\n const resetDialog = () => {\n reset();\n form.reset();\n setPendingAddress(null);\n setStep(\"form\");\n };\n\n useEffect(() => {\n if (open) resetDialog();\n }, [open]);\n\n const close = () => {\n resetDialog();\n onOpenChange(false);\n };\n\n const handleClose = (value: boolean) => {\n if (!value && !busy && phase !== \"success\") close();\n };\n\n const onSubmit = (values: FormValues) => {\n if (walletAddress) {\n try {\n if (BigInt(values.toAddress) === BigInt(walletAddress)) {\n form.setError(\"toAddress\", { message: \"Cannot transfer to yourself\" });\n return;\n }\n } catch {\n void 0;\n }\n }\n if (!canTransfer) return;\n setPendingAddress(values.toAddress);\n setStep(\"confirm\");\n };\n\n const displayName = tokenName || `Token #${tokenId}`;\n const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}…${pendingAddress.slice(-6)}` : \"\";\n\n const footer = (\n <div className=\"flex items-start justify-center gap-1.5\">\n <ShieldCheck className=\"h-3 w-3 text-muted-foreground shrink-0 mt-0.5\" />\n <p className=\"text-2xs text-center text-muted-foreground\">{footerNote}</p>\n </div>\n );\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]\">\n <DialogTitle className=\"sr-only\">Transfer {displayName}</DialogTitle>\n <DialogDescription className=\"sr-only\">\n Enter a recipient Starknet address to transfer this asset onchain.\n </DialogDescription>\n\n <TransactionDialogStates\n phase={phase}\n asset={{ name: displayName, image: tokenImage }}\n statusMessage=\"Confirming on Starknet…\"\n txHash={txHash}\n error={error}\n success={successMessages.transferred({ name: displayName, to: recipientShort })}\n successActions={[{ label: \"Done\", onClick: () => { close(); onSuccess?.(); } }]}\n errorTitle=\"Transfer failed\"\n errorDescription=\"The transaction was submitted, but the transfer could not be completed.\"\n onRetry={retryable ? () => { reset(); setStep(\"form\"); } : undefined}\n onDone={close}\n >\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId}\n fallbackIcon={<ArrowRightLeft className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n {step === \"confirm\" ? (\n <>\n <div className=\"flex items-end justify-between px-6 pt-3 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{displayName}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5 tabular-nums truncate\">→ {recipientShort}</p>\n </div>\n </div>\n <MarketplaceConfirmStep\n description=\"Transfer this asset? This action cannot be undone.\"\n error={error}\n secondaryLabel=\"Back\"\n onSecondary={() => { reset(); setStep(\"form\"); }}\n primaryLabel=\"Transfer\"\n onPrimary={() => { if (pendingAddress) onTransfer(pendingAddress); }}\n primaryIcon={<ArrowRightLeft className=\"h-4 w-4\" />}\n footer={footer}\n />\n </>\n ) : (\n <div className=\"px-5 pb-4 pt-3 space-y-3\">\n <p className=\"font-bold text-base leading-tight truncate\">{displayName}</p>\n\n {hasActiveListing && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n This token has an active listing. A buyer could still complete the purchase after you transfer it — cancel the listing first, or proceed with caution.\n </AlertDescription>\n </Alert>\n )}\n\n <Alert>\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n Transfers are permanent and irreversible. Double-check the recipient address before confirming.\n </AlertDescription>\n </Alert>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-3\">\n <FormField\n control={form.control}\n name=\"toAddress\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Recipient address</FormLabel>\n <FormControl>\n <Input placeholder=\"0x…\" autoComplete=\"off\" spellCheck={false} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n {error && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"pt-1 space-y-2\">\n <div className=\"btn-border-animated p-[1px] rounded-xl\">\n <button\n type=\"submit\"\n disabled={!canTransfer}\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n >\n <ArrowRightLeft className=\"h-4 w-4\" />\n {canTransfer ? \"Transfer\" : connectLabel}\n </button>\n </div>\n {footer}\n </div>\n </form>\n </Form>\n </div>\n )}\n </TransactionDialogStates>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAkHI,SAkCQ,UAjCN,KADF;AAhHJ,SAAS,WAAW,gBAAgB;AACpC,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,YAAY,OAAO;AACnB,SAAS,aAAa,gBAAgB,mBAAmB;AACzD,SAAS,QAAQ,eAAe,mBAAmB,mBAAmB;AACtE,SAAS,MAAM,aAAa,WAAW,UAAU,WAAW,mBAAmB;AAC/E,SAAS,aAAa;AACtB,SAAS,OAAO,wBAAwB;AACxC,SAAS,wBAAwB,6BAA6B;AAC9D,SAAS,+BAA+B;AACxC,SAAS,mBAA0C;AACnD,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AAA,cAGF,qBAAC,SAAI,WAAU,kBACb;AAAA,oCAAC,SAAI,WAAU,0CACb;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAK;AAAA,oBACL,UAAU,CAAC;AAAA,oBACX,WAAU;AAAA,oBAEV;AAAA,0CAAC,kBAAe,WAAU,WAAU;AAAA,sBACnC,cAAc,aAAa;AAAA;AAAA;AAAA,gBAC9B,GACF;AAAA,gBACC;AAAA,iBACH;AAAA,eACF,GACF;AAAA,aACF;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transfer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { AlertCircle, ArrowRightLeft, ShieldCheck } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { MarketplaceConfirmStep, MarketplaceDialogHero } from \"./marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"./transaction-dialog-states.js\";\nimport { isBusyPhase, type TransactionPhase } from \"../utils/use-transaction.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\n\nconst schema = z.object({\n toAddress: z\n .string()\n .min(1, \"Recipient address is required\")\n .regex(/^0x[0-9a-fA-F]{1,64}$/, \"Must be a valid Starknet address (0x followed by hex characters)\"),\n});\n\ntype FormValues = z.infer<typeof schema>;\n\ntype Step = \"form\" | \"confirm\";\n\nexport interface TransferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n tokenId: string;\n tokenName?: string;\n tokenImage?: string | null;\n hasActiveListing?: boolean;\n walletAddress?: string | null;\n canTransfer: boolean;\n connectLabel: string;\n footerNote: string;\n tx: {\n phase: TransactionPhase;\n txHash: string | null;\n error: string | null;\n retryable?: boolean;\n reset: () => void;\n };\n onTransfer: (toAddress: string) => void;\n onSuccess?: () => void;\n}\n\nexport function TransferDialog({\n open,\n onOpenChange,\n tokenId,\n tokenName,\n tokenImage,\n hasActiveListing = false,\n walletAddress,\n canTransfer,\n connectLabel,\n footerNote,\n tx,\n onTransfer,\n onSuccess,\n}: TransferDialogProps) {\n const { phase, txHash, error, retryable = true, reset } = tx;\n const busy = isBusyPhase(phase);\n const [step, setStep] = useState<Step>(\"form\");\n const [pendingAddress, setPendingAddress] = useState<string | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { toAddress: \"\" },\n });\n\n const resetDialog = () => {\n reset();\n form.reset();\n setPendingAddress(null);\n setStep(\"form\");\n };\n\n useEffect(() => {\n if (open) resetDialog();\n }, [open]);\n\n const close = () => {\n resetDialog();\n onOpenChange(false);\n };\n\n const handleClose = (value: boolean) => {\n if (!value && !busy && phase !== \"success\") close();\n };\n\n const onSubmit = (values: FormValues) => {\n if (walletAddress) {\n try {\n if (BigInt(values.toAddress) === BigInt(walletAddress)) {\n form.setError(\"toAddress\", { message: \"Cannot transfer to yourself\" });\n return;\n }\n } catch {\n void 0;\n }\n }\n if (!canTransfer) return;\n setPendingAddress(values.toAddress);\n setStep(\"confirm\");\n };\n\n const displayName = tokenName || `Token #${tokenId}`;\n const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}…${pendingAddress.slice(-6)}` : \"\";\n\n const footer = (\n <div className=\"flex items-start justify-center gap-1.5\">\n <ShieldCheck className=\"h-3 w-3 text-muted-foreground shrink-0 mt-0.5\" />\n <p className=\"text-2xs text-center text-muted-foreground\">{footerNote}</p>\n </div>\n );\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]\">\n <DialogTitle className=\"sr-only\">Transfer {displayName}</DialogTitle>\n <DialogDescription className=\"sr-only\">\n Enter a recipient Starknet address to transfer this asset onchain.\n </DialogDescription>\n\n <TransactionDialogStates\n phase={phase}\n asset={{ name: displayName, image: tokenImage }}\n statusMessage=\"Confirming on Starknet…\"\n txHash={txHash}\n error={error}\n success={successMessages.transferred({ name: displayName, to: recipientShort })}\n successActions={[{ label: \"Done\", onClick: () => { close(); onSuccess?.(); } }]}\n errorTitle=\"Transfer failed\"\n errorDescription=\"The transaction was submitted, but the transfer could not be completed.\"\n onRetry={retryable ? () => { reset(); setStep(\"form\"); } : undefined}\n onDone={close}\n >\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId}\n fallbackIcon={<ArrowRightLeft className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n {step === \"confirm\" ? (\n <>\n <div className=\"flex items-end justify-between px-6 pt-3 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{displayName}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5 tabular-nums truncate\">→ {recipientShort}</p>\n </div>\n </div>\n <MarketplaceConfirmStep\n description=\"Transfer this asset?\"\n error={error}\n secondaryLabel=\"Back\"\n onSecondary={() => { reset(); setStep(\"form\"); }}\n primaryLabel=\"Transfer\"\n onPrimary={() => { if (pendingAddress) onTransfer(pendingAddress); }}\n primaryIcon={<ArrowRightLeft className=\"h-4 w-4\" />}\n footer={footer}\n />\n </>\n ) : (\n <div className=\"px-5 pb-4 pt-3 space-y-3\">\n <p className=\"font-bold text-base leading-tight truncate\">{displayName}</p>\n\n {hasActiveListing && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n This token has an active listing. Cancelling the listing first keeps the sale from completing after the transfer.\n </AlertDescription>\n </Alert>\n )}\n\n <Alert>\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n Transfers are final and recorded onchain.\n </AlertDescription>\n </Alert>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-3\">\n <FormField\n control={form.control}\n name=\"toAddress\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Recipient address</FormLabel>\n <FormControl>\n <Input placeholder=\"0x…\" autoComplete=\"off\" spellCheck={false} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n {error && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"pt-1 space-y-2\">\n <div className=\"btn-border-animated p-[1px] rounded-xl\">\n <button\n type=\"submit\"\n disabled={!canTransfer}\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n >\n <ArrowRightLeft className=\"h-4 w-4\" />\n {canTransfer ? \"Transfer\" : connectLabel}\n </button>\n </div>\n {footer}\n </div>\n </form>\n </Form>\n </div>\n )}\n </TransactionDialogStates>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAkHI,SAkCQ,UAjCN,KADF;AAhHJ,SAAS,WAAW,gBAAgB;AACpC,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,YAAY,OAAO;AACnB,SAAS,aAAa,gBAAgB,mBAAmB;AACzD,SAAS,QAAQ,eAAe,mBAAmB,mBAAmB;AACtE,SAAS,MAAM,aAAa,WAAW,UAAU,WAAW,mBAAmB;AAC/E,SAAS,aAAa;AACtB,SAAS,OAAO,wBAAwB;AACxC,SAAS,wBAAwB,6BAA6B;AAC9D,SAAS,+BAA+B;AACxC,SAAS,mBAA0C;AACnD,SAAS,uBAAuB;AAEhC,MAAM,SAAS,EAAE,OAAO;AAAA,EACtB,WAAW,EACR,OAAO,EACP,IAAI,GAAG,+BAA+B,EACtC,MAAM,yBAAyB,kEAAkE;AACtG,CAAC;AA4BM,SAAS,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BAEV;AAAA,0CAAC,kBAAe,WAAU,WAAU;AAAA,sBACnC,cAAc,aAAa;AAAA;AAAA;AAAA,gBAC9B,GACF;AAAA,gBACC;AAAA,iBACH;AAAA,eACF,GACF;AAAA,aACF;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -63,16 +63,12 @@ function ExportKeySection({ loadSealed, unlock, actions }) {
63
63
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-3", children: [
64
64
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
65
65
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: "Recovery key" }),
66
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-1 text-xs text-muted-foreground leading-relaxed", children: "Save this somewhere private, such as a password manager. Paste it when you sign in on a new phone or browser, or if you lose access to every device you use." })
66
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-1 text-xs text-muted-foreground leading-relaxed", children: "Used to sign in on a new phone or browser." })
67
67
  ] }),
68
68
  recoveryKey ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
69
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, { variant: "destructive", children: [
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, { children: [
70
70
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ShieldAlert, { className: "h-4 w-4" }),
71
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.AlertDescription, { className: "text-xs leading-relaxed", children: [
72
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold", children: "Anyone with this key controls your wallet." }),
73
- " ",
74
- "Medialane will never ask you for it. Treat any message requesting it as an attempt to take your assets."
75
- ] })
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs leading-relaxed", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold", children: "The recovery key gives full control of the wallet." }) })
76
72
  ] }),
77
73
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { className: "block break-all rounded-xl bg-muted px-3 py-2.5 font-mono text-xs select-all", children: recoveryKey }),
78
74
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/wallet/export-key-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { KeyRound, Copy, Check, EyeOff, Loader2, ShieldAlert } from \"lucide-react\";\nimport { encodeRecoveryKey, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { Button } from \"../button.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\n\nexport interface ExportKeySectionProps {\n loadSealed: () => SealedOwner | null;\n unlock: (sealed: SealedOwner) => Promise<string>;\n actions?: ReactNode;\n}\n\nexport function ExportKeySection({ loadSealed, unlock, actions }: ExportKeySectionProps) {\n const [recoveryKey, setRecoveryKey] = useState<string | null>(null);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [copied, setCopied] = useState(false);\n\n const reveal = async () => {\n setBusy(true);\n setError(null);\n try {\n const sealed = loadSealed();\n if (!sealed) {\n setError(\"This browser has no wallet key stored.\");\n return;\n }\n setRecoveryKey(encodeRecoveryKey({ walletAddress: sealed.address, privateKey: await unlock(sealed) }));\n } catch (err) {\n setError(describeError(err).message);\n } finally {\n setBusy(false);\n }\n };\n\n const copy = async () => {\n if (!recoveryKey) return;\n await navigator.clipboard.writeText(recoveryKey);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n const hide = () => {\n setRecoveryKey(null);\n setCopied(false);\n };\n\n return (\n <div className=\"flex flex-col gap-3\">\n <div>\n <p className=\"text-sm font-semibold\">Recovery key</p>\n <p className=\"mt-1 text-xs text-muted-foreground leading-relaxed\">\n Save this somewhere private, such as a password manager. Paste it when you sign in on a\n new phone or browser, or if you lose access to every device you use.\n </p>\n </div>\n\n {recoveryKey ? (\n <>\n <Alert variant=\"destructive\">\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs leading-relaxed\">\n <span className=\"font-semibold\">Anyone with this key controls your wallet.</span>{\" \"}\n Medialane will never ask you for it. Treat any message requesting it as an attempt to\n take your assets.\n </AlertDescription>\n </Alert>\n <code className=\"block break-all rounded-xl bg-muted px-3 py-2.5 font-mono text-xs select-all\">\n {recoveryKey}\n </code>\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={copy} variant=\"outline\" size=\"sm\">\n {copied ? <Check className=\"mr-1.5 h-3.5 w-3.5\" /> : <Copy className=\"mr-1.5 h-3.5 w-3.5\" />}\n {copied ? \"Copied\" : \"Copy key\"}\n </Button>\n <Button onClick={hide} variant=\"ghost\" size=\"sm\">\n <EyeOff className=\"mr-1.5 h-3.5 w-3.5\" />\n Hide\n </Button>\n {actions}\n </div>\n </>\n ) : (\n <>\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={reveal} disabled={busy} variant=\"outline\" size=\"sm\">\n {busy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : <KeyRound className=\"mr-1.5 h-3.5 w-3.5\" />}\n Show recovery key\n </Button>\n {actions}\n </div>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoDM;AAlDN,mBAAyC;AACzC,0BAAoE;AACpE,sBAAoD;AACpD,4BAA8B;AAC9B,oBAAuB;AACvB,mBAAwC;AAQjC,SAAS,iBAAiB,EAAE,YAAY,QAAQ,QAAQ,GAA0B;AACvF,QAAM,CAAC,aAAa,c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,qDAAC,wBAAO,SAAS,MAAM,SAAQ,WAAU,MAAK,MAC3C;AAAA,mBAAS,4CAAC,6BAAM,WAAU,sBAAqB,IAAK,4CAAC,4BAAK,WAAU,sBAAqB;AAAA,UACzF,SAAS,WAAW;AAAA,WACvB;AAAA,QACA,6CAAC,wBAAO,SAAS,MAAM,SAAQ,SAAQ,MAAK,MAC1C;AAAA,sDAAC,8BAAO,WAAU,sBAAqB;AAAA,UAAE;AAAA,WAE3C;AAAA,QACC;AAAA,SACH;AAAA,OACF,IAEA,4EACG;AAAA,eAAS,4CAAC,OAAE,WAAU,4BAA4B,iBAAM;AAAA,MACzD,6CAAC,SAAI,WAAU,qCACb;AAAA,qDAAC,wBAAO,SAAS,QAAQ,UAAU,MAAM,SAAQ,WAAU,MAAK,MAC7D;AAAA,iBAAO,4CAAC,+BAAQ,WAAU,mCAAkC,IAAK,4CAAC,gCAAS,WAAU,sBAAqB;AAAA,UAAG;AAAA,WAEhH;AAAA,QACC;AAAA,SACH;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/wallet/export-key-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { KeyRound, Copy, Check, EyeOff, Loader2, ShieldAlert } from \"lucide-react\";\nimport { encodeRecoveryKey, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { Button } from \"../button.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\n\nexport interface ExportKeySectionProps {\n loadSealed: () => SealedOwner | null;\n unlock: (sealed: SealedOwner) => Promise<string>;\n actions?: ReactNode;\n}\n\nexport function ExportKeySection({ loadSealed, unlock, actions }: ExportKeySectionProps) {\n const [recoveryKey, setRecoveryKey] = useState<string | null>(null);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [copied, setCopied] = useState(false);\n\n const reveal = async () => {\n setBusy(true);\n setError(null);\n try {\n const sealed = loadSealed();\n if (!sealed) {\n setError(\"This browser has no wallet key stored.\");\n return;\n }\n setRecoveryKey(encodeRecoveryKey({ walletAddress: sealed.address, privateKey: await unlock(sealed) }));\n } catch (err) {\n setError(describeError(err).message);\n } finally {\n setBusy(false);\n }\n };\n\n const copy = async () => {\n if (!recoveryKey) return;\n await navigator.clipboard.writeText(recoveryKey);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n const hide = () => {\n setRecoveryKey(null);\n setCopied(false);\n };\n\n return (\n <div className=\"flex flex-col gap-3\">\n <div>\n <p className=\"text-sm font-semibold\">Recovery key</p>\n <p className=\"mt-1 text-xs text-muted-foreground leading-relaxed\">\n Used to sign in on a new phone or browser.\n </p>\n </div>\n\n {recoveryKey ? (\n <>\n <Alert>\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs leading-relaxed\">\n <span className=\"font-semibold\">The recovery key gives full control of the wallet.</span>\n </AlertDescription>\n </Alert>\n <code className=\"block break-all rounded-xl bg-muted px-3 py-2.5 font-mono text-xs select-all\">\n {recoveryKey}\n </code>\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={copy} variant=\"outline\" size=\"sm\">\n {copied ? <Check className=\"mr-1.5 h-3.5 w-3.5\" /> : <Copy className=\"mr-1.5 h-3.5 w-3.5\" />}\n {copied ? \"Copied\" : \"Copy key\"}\n </Button>\n <Button onClick={hide} variant=\"ghost\" size=\"sm\">\n <EyeOff className=\"mr-1.5 h-3.5 w-3.5\" />\n Hide\n </Button>\n {actions}\n </div>\n </>\n ) : (\n <>\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={reveal} disabled={busy} variant=\"outline\" size=\"sm\">\n {busy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : <KeyRound className=\"mr-1.5 h-3.5 w-3.5\" />}\n Show recovery key\n </Button>\n {actions}\n </div>\n </>\n )}\n </div>\n );\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WAAU,WAAU;AAAA,QACjC,4CAAC,iCAAiB,WAAU,2BAC1B,sDAAC,UAAK,WAAU,iBAAgB,gEAAkD,GACpF;AAAA,SACF;AAAA,MACA,4CAAC,UAAK,WAAU,gFACb,uBACH;AAAA,MACA,6CAAC,SAAI,WAAU,qCACb;AAAA,qDAAC,wBAAO,SAAS,MAAM,SAAQ,WAAU,MAAK,MAC3C;AAAA,mBAAS,4CAAC,6BAAM,WAAU,sBAAqB,IAAK,4CAAC,4BAAK,WAAU,sBAAqB;AAAA,UACzF,SAAS,WAAW;AAAA,WACvB;AAAA,QACA,6CAAC,wBAAO,SAAS,MAAM,SAAQ,SAAQ,MAAK,MAC1C;AAAA,sDAAC,8BAAO,WAAU,sBAAqB;AAAA,UAAE;AAAA,WAE3C;AAAA,QACC;AAAA,SACH;AAAA,OACF,IAEA,4EACG;AAAA,eAAS,4CAAC,OAAE,WAAU,4BAA4B,iBAAM;AAAA,MACzD,6CAAC,SAAI,WAAU,qCACb;AAAA,qDAAC,wBAAO,SAAS,QAAQ,UAAU,MAAM,SAAQ,WAAU,MAAK,MAC7D;AAAA,iBAAO,4CAAC,+BAAQ,WAAU,mCAAkC,IAAK,4CAAC,gCAAS,WAAU,sBAAqB;AAAA,UAAG;AAAA,WAEhH;AAAA,QACC;AAAA,SACH;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
@@ -40,16 +40,12 @@ function ExportKeySection({ loadSealed, unlock, actions }) {
40
40
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
41
41
  /* @__PURE__ */ jsxs("div", { children: [
42
42
  /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: "Recovery key" }),
43
- /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground leading-relaxed", children: "Save this somewhere private, such as a password manager. Paste it when you sign in on a new phone or browser, or if you lose access to every device you use." })
43
+ /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground leading-relaxed", children: "Used to sign in on a new phone or browser." })
44
44
  ] }),
45
45
  recoveryKey ? /* @__PURE__ */ jsxs(Fragment, { children: [
46
- /* @__PURE__ */ jsxs(Alert, { variant: "destructive", children: [
46
+ /* @__PURE__ */ jsxs(Alert, { children: [
47
47
  /* @__PURE__ */ jsx(ShieldAlert, { className: "h-4 w-4" }),
48
- /* @__PURE__ */ jsxs(AlertDescription, { className: "text-xs leading-relaxed", children: [
49
- /* @__PURE__ */ jsx("span", { className: "font-semibold", children: "Anyone with this key controls your wallet." }),
50
- " ",
51
- "Medialane will never ask you for it. Treat any message requesting it as an attempt to take your assets."
52
- ] })
48
+ /* @__PURE__ */ jsx(AlertDescription, { className: "text-xs leading-relaxed", children: /* @__PURE__ */ jsx("span", { className: "font-semibold", children: "The recovery key gives full control of the wallet." }) })
53
49
  ] }),
54
50
  /* @__PURE__ */ jsx("code", { className: "block break-all rounded-xl bg-muted px-3 py-2.5 font-mono text-xs select-all", children: recoveryKey }),
55
51
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/wallet/export-key-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { KeyRound, Copy, Check, EyeOff, Loader2, ShieldAlert } from \"lucide-react\";\nimport { encodeRecoveryKey, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { Button } from \"../button.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\n\nexport interface ExportKeySectionProps {\n loadSealed: () => SealedOwner | null;\n unlock: (sealed: SealedOwner) => Promise<string>;\n actions?: ReactNode;\n}\n\nexport function ExportKeySection({ loadSealed, unlock, actions }: ExportKeySectionProps) {\n const [recoveryKey, setRecoveryKey] = useState<string | null>(null);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [copied, setCopied] = useState(false);\n\n const reveal = async () => {\n setBusy(true);\n setError(null);\n try {\n const sealed = loadSealed();\n if (!sealed) {\n setError(\"This browser has no wallet key stored.\");\n return;\n }\n setRecoveryKey(encodeRecoveryKey({ walletAddress: sealed.address, privateKey: await unlock(sealed) }));\n } catch (err) {\n setError(describeError(err).message);\n } finally {\n setBusy(false);\n }\n };\n\n const copy = async () => {\n if (!recoveryKey) return;\n await navigator.clipboard.writeText(recoveryKey);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n const hide = () => {\n setRecoveryKey(null);\n setCopied(false);\n };\n\n return (\n <div className=\"flex flex-col gap-3\">\n <div>\n <p className=\"text-sm font-semibold\">Recovery key</p>\n <p className=\"mt-1 text-xs text-muted-foreground leading-relaxed\">\n Save this somewhere private, such as a password manager. Paste it when you sign in on a\n new phone or browser, or if you lose access to every device you use.\n </p>\n </div>\n\n {recoveryKey ? (\n <>\n <Alert variant=\"destructive\">\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs leading-relaxed\">\n <span className=\"font-semibold\">Anyone with this key controls your wallet.</span>{\" \"}\n Medialane will never ask you for it. Treat any message requesting it as an attempt to\n take your assets.\n </AlertDescription>\n </Alert>\n <code className=\"block break-all rounded-xl bg-muted px-3 py-2.5 font-mono text-xs select-all\">\n {recoveryKey}\n </code>\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={copy} variant=\"outline\" size=\"sm\">\n {copied ? <Check className=\"mr-1.5 h-3.5 w-3.5\" /> : <Copy className=\"mr-1.5 h-3.5 w-3.5\" />}\n {copied ? \"Copied\" : \"Copy key\"}\n </Button>\n <Button onClick={hide} variant=\"ghost\" size=\"sm\">\n <EyeOff className=\"mr-1.5 h-3.5 w-3.5\" />\n Hide\n </Button>\n {actions}\n </div>\n </>\n ) : (\n <>\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={reveal} disabled={busy} variant=\"outline\" size=\"sm\">\n {busy ? <Loader2 className=\"mr-1.5 h-3.5 w-3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wB,0BAAY;AAAA,MACjD,oBAAC,OAAE,WAAU,sDAAqD,0KAGlE;AAAA,OACF;AAAA,IAEC,cACC,iCACE;AAAA,2BAAC,SAAM,SAAQ,eACb;AAAA,4BAAC,eAAY,WAAU,WAAU;AAAA,QACjC,qBAAC,oBAAiB,WAAU,2BAC1B;AAAA,8BAAC,UAAK,WAAU,iBAAgB,wDAA0C;AAAA,UAAQ;AAAA,UAAI;AAAA,WAGxF;AAAA,SACF;AAAA,MACA,oBAAC,UAAK,WAAU,gFACb,uBACH;AAAA,MACA,qBAAC,SAAI,WAAU,qCACb;AAAA,6BAAC,UAAO,SAAS,MAAM,SAAQ,WAAU,MAAK,MAC3C;AAAA,mBAAS,oBAAC,SAAM,WAAU,sBAAqB,IAAK,oBAAC,QAAK,WAAU,sBAAqB;AAAA,UACzF,SAAS,WAAW;AAAA,WACvB;AAAA,QACA,qBAAC,UAAO,SAAS,MAAM,SAAQ,SAAQ,MAAK,MAC1C;AAAA,8BAAC,UAAO,WAAU,sBAAqB;AAAA,UAAE;AAAA,WAE3C;AAAA,QACC;AAAA,SACH;AAAA,OACF,IAEA,iCACG;AAAA,eAAS,oBAAC,OAAE,WAAU,4BAA4B,iBAAM;AAAA,MACzD,qBAAC,SAAI,WAAU,qCACb;AAAA,6BAAC,UAAO,SAAS,QAAQ,UAAU,MAAM,SAAQ,WAAU,MAAK,MAC7D;AAAA,iBAAO,oBAAC,WAAQ,WAAU,mCAAkC,IAAK,oBAAC,YAAS,WAAU,sBAAqB;AAAA,UAAG;AAAA,WAEhH;AAAA,QACC;AAAA,SACH;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/wallet/export-key-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { KeyRound, Copy, Check, EyeOff, Loader2, ShieldAlert } from \"lucide-react\";\nimport { encodeRecoveryKey, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { Button } from \"../button.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\n\nexport interface ExportKeySectionProps {\n loadSealed: () => SealedOwner | null;\n unlock: (sealed: SealedOwner) => Promise<string>;\n actions?: ReactNode;\n}\n\nexport function ExportKeySection({ loadSealed, unlock, actions }: ExportKeySectionProps) {\n const [recoveryKey, setRecoveryKey] = useState<string | null>(null);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [copied, setCopied] = useState(false);\n\n const reveal = async () => {\n setBusy(true);\n setError(null);\n try {\n const sealed = loadSealed();\n if (!sealed) {\n setError(\"This browser has no wallet key stored.\");\n return;\n }\n setRecoveryKey(encodeRecoveryKey({ walletAddress: sealed.address, privateKey: await unlock(sealed) }));\n } catch (err) {\n setError(describeError(err).message);\n } finally {\n setBusy(false);\n }\n };\n\n const copy = async () => {\n if (!recoveryKey) return;\n await navigator.clipboard.writeText(recoveryKey);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n const hide = () => {\n setRecoveryKey(null);\n setCopied(false);\n };\n\n return (\n <div className=\"flex flex-col gap-3\">\n <div>\n <p className=\"text-sm font-semibold\">Recovery key</p>\n <p className=\"mt-1 text-xs text-muted-foreground leading-relaxed\">\n Used to sign in on a new phone or browser.\n </p>\n </div>\n\n {recoveryKey ? (\n <>\n <Alert>\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs leading-relaxed\">\n <span className=\"font-semibold\">The recovery key gives full control of the wallet.</span>\n </AlertDescription>\n </Alert>\n <code className=\"block break-all rounded-xl bg-muted px-3 py-2.5 font-mono text-xs select-all\">\n {recoveryKey}\n </code>\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={copy} variant=\"outline\" size=\"sm\">\n {copied ? <Check className=\"mr-1.5 h-3.5 w-3.5\" /> : <Copy className=\"mr-1.5 h-3.5 w-3.5\" />}\n {copied ? \"Copied\" : \"Copy key\"}\n </Button>\n <Button onClick={hide} variant=\"ghost\" size=\"sm\">\n <EyeOff className=\"mr-1.5 h-3.5 w-3.5\" />\n Hide\n </Button>\n {actions}\n </div>\n </>\n ) : (\n <>\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={reveal} disabled={busy} variant=\"outline\" size=\"sm\">\n {busy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : <KeyRound className=\"mr-1.5 h-3.5 w-3.5\" />}\n Show recovery key\n </Button>\n {actions}\n </div>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";AAoDM,SAQE,UAPA,KADF;AAlDN,SAAS,gBAAgC;AACzC,SAAS,UAAU,MAAM,OAAO,QAAQ,SAAS,mBAAmB;AACpE,SAAS,yBAA2C;AACpD,SAAS,qBAAqB;AAC9B,SAAS,cAAc;AACvB,SAAS,OAAO,wBAAwB;AAQjC,SAAS,iBAAiB,EAAE,YAAY,QAAQ,QAAQ,GAA0B;AACvF,QAAM,CAAC,aAAa,cAAc,IAAI,SAAwB,IAAI;AAClE,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAwB,IAAI;AACtD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAE1C,QAAM,SAAS,YAAY;AACzB,YAAQ,IAAI;AACZ,aAAS,IAAI;AACb,QAAI;AACF,YAAM,SAAS,WAAW;AAC1B,UAAI,CAAC,QAAQ;AACX,iBAAS,wCAAwC;AACjD;AAAA,MACF;AACA,qBAAe,kBAAkB,EAAE,eAAe,OAAO,SAAS,YAAY,MAAM,OAAO,MAAM,EAAE,CAAC,CAAC;AAAA,IACvG,SAAS,KAAK;AACZ,eAAS,cAAc,GAAG,EAAE,OAAO;AAAA,IACrC,UAAE;AACA,cAAQ,KAAK;AAAA,IACf;AAAA,EACF;AAEA,QAAM,OAAO,YAAY;AACvB,QAAI,CAAC,YAAa;AAClB,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7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
7
7
  rawBalance: bigint | null;
8
8
  isLoading: boolean;
9
9
  error: any;
10
- decimals: 6 | 8 | 18;
10
+ decimals: 8 | 6 | 18;
11
11
  };
12
12
  declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
13
13
 
@@ -7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
7
7
  rawBalance: bigint | null;
8
8
  isLoading: boolean;
9
9
  error: any;
10
- decimals: 6 | 8 | 18;
10
+ decimals: 8 | 6 | 18;
11
11
  };
12
12
  declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
13
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medialane/ui",
3
- "version": "0.350.0",
3
+ "version": "0.352.0",
4
4
  "description": "Shared UI components for Medialane apps",
5
5
  "type": "module",
6
6
  "sideEffects": false,