Walrus blob · mainnet
import { u as b, g as j, r as a, h as w, j as e, e as h, D as p, L as N, T as k, a as v, S as z } from "./index-CeMnqBop.js";
import { p as L, f as S } from "./logic-CKPxob_3.js";
import { i as E, d as R } from "./shareCrypto-_9-e0tA6.js";
import { t as U } from "./analytics-DBAq2caw.js";
function C() {
const { blobId: t } = b(), o = j(), { key: c, meta: s } = a.useMemo(() => L(o.hash), [o.hash]), [r, x] = a.useState(null), [g, m] = a.useState(true), [d, f] = a.useState(null);
return a.useEffect(() => {
t && U(t);
}, [t]), a.useEffect(() => {
if (!t) return;
let l = false, i = null;
return m(true), f(null), x(null), (async () => {
try {
if (!c) throw new Error("missing_key");
const n = await E(c), { bytes: u } = await w(t);
if (l) return;
const y = await R(u, n);
if (l) return;
i = URL.createObjectURL(new Blob([y], { type: s.mime || "application/pdf" })), x(i);
} catch (n) {
console.error("[pdf-share] open failed", n), l || f((n == null ? void 0 : n.message) === "missing_key" ? "\u3053\u306E\u30EA\u30F3\u30AF\u306B\u306F\u5FA9\u53F7\u9375\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093\uFF08\u30EA\u30F3\u30AF\u304C\u9014\u4E2D\u3067\u5207\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\uFF09\u3002" : "\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u3051\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u30EA\u30F3\u30AF\u7121\u52B9\u30FB\u671F\u9650\u5207\u308C\u30FB\u9375\u4E0D\u4E00\u81F4\u306E\u53EF\u80FD\u6027\uFF09\u3002");
} finally {
l || m(false);
}
})(), () => {
l = true, i && URL.revokeObjectURL(i);
};
}, [t, c, s.mime]), e.jsxs("div", { className: "min-h-screen bg-gray-100 dark:bg-[#0b0b0d] text-gray-900 dark:text-gray-100 font-sans flex flex-col", children: [e.jsxs("header", { className: "px-4 sm:px-6 py-3 flex items-center justify-between border-b border-gray-200 dark:border-gray-800 bg-white/70 dark:bg-gray-900/70 backdrop-blur", children: [e.jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [e.jsx(h, { size: 18, className: "text-rose-500 shrink-0" }), e.jsx("span", { className: "font-semibold truncate", children: s.name }), s.size > 0 && e.jsx("span", { className: "text-xs text-gray-400 shrink-0", children: S(s.size) })] }), e.jsxs("div", { className: "flex items-center gap-3 shrink-0", children: [r && e.jsxs("a", { href: r, download: s.name, className: "flex items-center gap-1.5 text-sm font-semibold text-white bg-rose-500 hover:bg-rose-600 rounded-lg px-3 py-1.5", children: [e.jsx(p, { size: 15 }), " \u30C0\u30A6\u30F3\u30ED\u30FC\u30C9"] }), e.jsx(N, { to: "/pdf-share", className: "text-xs text-gray-500 hover:text-rose-600 whitespace-nowrap", children: "\u81EA\u5206\u3067\u5171\u6709 \u2192" })] })] }), e.jsx("main", { className: "flex-1 p-3 sm:p-6 flex flex-col items-center justify-center", children: t ? d ? e.jsxs("div", { className: "text-center text-gray-500 dark:text-gray-400 flex flex-col items-center gap-2", children: [e.jsx(k, { size: 28, className: "text-amber-500" }), e.jsx("p", { className: "text-sm max-w-xs", children: d })] }) : g || !r ? e.jsxs("div", { className: "flex items-center gap-2 text-gray-400", children: [e.jsx(v, { size: 18, className: "animate-spin" }), " \u5FA9\u53F7\u3057\u3066\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"] }) : e.jsxs(e.Fragment, { children: [e.jsx("div", { className: "w-full max-w-4xl h-[80vh] rounded-xl overflow-hidden border border-gray-200 dark:border-gray-800 bg-white", children: e.jsx("object", { data: r, type: s.mime || "application/pdf", className: "w-full h-full", children: e.jsxs("div", { className: "w-full h-full flex flex-col items-center justify-center gap-3 text-center text-gray-500 p-6", children: [e.jsx(h, { size: 32, className: "text-rose-400" }), e.jsx("p", { className: "text-sm", children: "\u3053\u306E\u74B0\u5883\u3067\u306F\u30A4\u30F3\u30E9\u30A4\u30F3\u8868\u793A\u3067\u304D\u307E\u305B\u3093\u3002" }), e.jsxs("a", { href: r, download: s.name, className: "flex items-center gap-1.5 text-sm font-semibold text-white bg-rose-500 hover:bg-rose-600 rounded-lg px-4 py-2", children: [e.jsx(p, { size: 15 }), " \u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u3066\u958B\u304F"] })] }) }) }), e.jsxs("p", { className: "mt-3 text-xs text-gray-400 flex items-center gap-1.5", children: [e.jsx(z, { size: 13, className: "text-emerald-500" }), " \u7AEF\u672B\u3067\u5FA9\u53F7\u3057\u3066\u8868\u793A\u3057\u307E\u3057\u305F\uFF08\u4FDD\u7BA1\u7DB2\u30FB\u904B\u55B6\u8005\u306F\u4E2D\u8EAB\u3092\u8AAD\u3081\u307E\u305B\u3093\uFF09\u3002"] })] }) : e.jsx("p", { className: "text-sm text-gray-500", children: "\u30EA\u30F3\u30AF\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002" }) })] });
}
export {
C as default
};
On-chain registration not yet visible.
The aggregator served this blob, but we couldn't locate a matching BlobRegistered event in our scan window. It may not be certified yet, or live further back than we paged.
Lifecycle data is unavailable until the blob registration is visible on-chain.