@blockscout/ui-toolkit
Version:
A comprehensive collection of reusable Chakra UI components and theme system for Blockscout's projects
1,475 lines (1,474 loc) • 344 kB
JavaScript
import { jsx as p, jsxs as G, Fragment as Me } from "react/jsx-runtime";
import { Accordion as Fe, Icon as ge, defineRecipe as Ie, Circle as zi, Skeleton as vr, Stack as Bi, Button as La, ButtonGroup as Ui, AbsoluteCenter as Dt, Spinner as hr, Span as Na, useRecipe as Da, Alert as $e, Avatar as it, Group as _r, useBreakpointValue as za, Tooltip as Xe, Portal as He, useDisclosure as Ba, chakra as We, Badge as Ua, Checkbox as Qe, CheckboxGroup as Fa, Link as Lr, LinkOverlay as Nr, LinkBox as Ma, Flex as Rt, Dialog as he, Drawer as xe, Field as we, Heading as ja, Image as Ha, InputElement as Dr, Input as Wa, Menu as de, PinInput as lt, Popover as _e, ProgressCircle as ot, defineSlotRecipe as ce, defineConfig as $a, createSystem as Xa, defaultConfig as Va, ChakraProvider as Ga, RadioGroup as nt, useRatingGroup as qa, RatingGroup as Ve, useSelectContext as Fi, Select as fe, createListCollection as Ya, Box as je, Slider as Ce, HStack as Ka, For as Za, Switch as ze, Table as Ze, Tabs as zt, Tag as Be, Textarea as Qa, createToaster as Ja, Toaster as el, Toast as Je, Center as tl, VisuallyHidden as rl, Text as zr } from "@chakra-ui/react";
import * as P from "react";
import B, { useState as yr, useEffect as Mi, useCallback as Br } from "react";
import nl from "react-dom";
import ji from "next/link";
import { ThemeProvider as ol, useTheme as il } from "next-themes";
import { useRouter as Hi } from "next/router";
import { useFormContext as Pe, useWatch as al, useController as De } from "react-hook-form";
const Wi = (e) => /* @__PURE__ */ P.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", ...e }, /* @__PURE__ */ P.createElement("path", { d: "M11.535 11.293a1 1 0 0 0 0 1.414l3.536 3.536a1 1 0 1 1-1.414 1.414l-4.95-4.95a1 1 0 0 1 0-1.414l4.95-4.95a1 1 0 1 1 1.414 1.414l-3.536 3.536Z", fill: "currentColor" })), m0 = P.forwardRef(function(t, r) {
const { children: n, indicatorPlacement: o, variant: i, noIndicator: u, ...l } = t, d = i === "faq" ? "start" : o ?? "end", h = i === "faq" ? /* @__PURE__ */ p(
Fe.ItemIndicator,
{
asChild: !0,
rotate: "0deg",
position: "relative",
_before: {
content: '""',
position: "absolute",
display: "block",
bgColor: "{currentColor}",
w: "100%",
h: "2px",
borderRadius: "2px",
left: "0",
top: "50%",
transform: "translateY(-50%)"
},
_after: {
content: '""',
position: "absolute",
display: "block",
bgColor: "{currentColor}",
w: "2px",
h: "100%",
borderRadius: "2px",
left: "50%",
top: "0",
transform: "translateX(-50%)",
transition: "transform 0.2s ease-in-out"
},
_open: {
_after: {
transform: "translateX(-50%) rotate(90deg)"
}
},
children: /* @__PURE__ */ p("div", {})
}
) : /* @__PURE__ */ p(Fe.ItemIndicator, { rotate: { base: "180deg", _open: "270deg" }, display: "flex", children: /* @__PURE__ */ p(ge, { boxSize: 5, children: /* @__PURE__ */ p(Wi, {}) }) });
return /* @__PURE__ */ G(Fe.ItemTrigger, { className: "group", ...l, ref: r, children: [
d === "start" && !u && h,
n,
d === "end" && !u && h
] });
}), v0 = P.forwardRef(function(t, r) {
return /* @__PURE__ */ p(Fe.ItemContent, { children: /* @__PURE__ */ p(Fe.ItemBody, { ...t, ref: r }) });
}), _0 = (e) => {
const { multiple: t = !0, ...r } = e;
return /* @__PURE__ */ p(Fe.Root, { multiple: t, ...r });
}, y0 = Fe.Item, ll = (e) => /* @__PURE__ */ P.createElement("svg", { viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", ...e }, /* @__PURE__ */ P.createElement("path", { d: "M10 18.333a8.333 8.333 0 1 1 0-16.666 8.333 8.333 0 1 1 0 16.666Zm-.834-9.166v5h1.667v-5H9.166Zm0-3.334V7.5h1.667V5.833H9.166Z", fill: "currentColor" })), sl = (e) => /* @__PURE__ */ P.createElement("svg", { viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", ...e }, /* @__PURE__ */ P.createElement("path", { d: "M9.44 8.035a.791.791 0 0 0 1.12 0l3.802-3.803a.791.791 0 0 1 1.119 0l.287.287a.79.79 0 0 1 0 1.119L11.965 9.44a.79.79 0 0 0 0 1.118l3.803 3.803a.791.791 0 0 1 0 1.119l-.287.287a.791.791 0 0 1-1.119 0l-3.803-3.803a.79.79 0 0 0-1.118 0l-3.803 3.803a.79.79 0 0 1-1.119 0l-.287-.287a.791.791 0 0 1 0-1.119l3.803-3.803a.791.791 0 0 0 0-1.118L4.232 5.638a.791.791 0 0 1 0-1.119l.287-.287a.791.791 0 0 1 1.119 0L9.44 8.035Z", fill: "currentColor" })), $i = Ie({
base: {
display: "flex",
gap: 0,
borderRadius: "sm",
overflow: "hidden",
_disabled: {
opacity: "control.disabled"
},
minWidth: "auto"
},
variants: {
visual: {
plain: {
bg: "transparent",
color: "closeButton.fg",
border: "none",
_hover: {
bg: "transparent",
color: "link.primary.hover"
}
}
},
size: {
md: { boxSize: 5 }
}
},
defaultVariants: {
size: "md",
visual: "plain"
}
}), E0 = P.forwardRef(function(t, r) {
const { size: n, ...o } = t;
return /* @__PURE__ */ p(zi, { size: n, asChild: !0, ref: r, children: /* @__PURE__ */ p(vr, { ...o }) });
}), C0 = P.forwardRef(
function(t, r) {
const { noOfLines: n = 3, gap: o, ...i } = t;
return /* @__PURE__ */ p(Bi, { gap: o, width: "full", ref: r, children: Array.from({ length: n }).map((u, l) => /* @__PURE__ */ p(
vr,
{
height: "4",
...t,
_last: { maxW: "80%" },
...i
},
l
)) });
}
), Te = P.forwardRef(
function(t, r) {
const { loading: n = !1, ...o } = t;
return /* @__PURE__ */ p(
vr,
{
ref: r,
...n ? { "data-loading": !0, state: "loading" } : { variant: "none" },
...o
}
);
}
), cl = P.forwardRef(
function(t, r) {
const { loading: n, disabled: o, loadingText: i, children: u, expanded: l, selected: d, highlighted: h, loadingSkeleton: g = !1, ...v } = t;
return /* @__PURE__ */ p(Te, { loading: g, asChild: !0, ref: r, children: /* @__PURE__ */ p(
La,
{
...l ? { "data-expanded": !0 } : {},
...d ? { "data-selected": !0 } : {},
...h ? { "data-highlighted": !0 } : {},
...n ? { "data-loading": !0 } : {},
...g ? { "data-loading-skeleton": !0 } : {},
disabled: !g && (n || o),
...v,
children: n && !i ? /* @__PURE__ */ G(Me, { children: [
/* @__PURE__ */ p(Dt, { display: "inline-flex", children: /* @__PURE__ */ p(hr, { size: "inherit", color: "inherit" }) }),
/* @__PURE__ */ p(Na, { opacity: 0, children: u })
] }) : n && i ? /* @__PURE__ */ G(Me, { children: [
/* @__PURE__ */ p(hr, { size: "inherit", color: "inherit" }),
i
] }) : u
}
) });
}
), x0 = P.forwardRef(
function(t, r) {
const { ...n } = t;
return /* @__PURE__ */ p(Ui, { ref: r, ...n });
}
), T0 = P.forwardRef(
function(t, r) {
const { children: n, onChange: o, variant: i = "segmented", defaultValue: u, loading: l = !1, equalWidth: d = !1, ...h } = t, g = P.useMemo(() => {
const T = Array.isArray(n) ? n[0] : void 0;
return typeof (T == null ? void 0 : T.props.value) == "string" ? T.props.value : void 0;
}, [n]), [v, w] = P.useState(u ?? g), m = P.useCallback((T) => {
const R = T.currentTarget.value;
w(R), o == null || o(R);
}, [o]), S = P.Children.map(n, (T) => P.cloneElement(T, {
onClick: m,
selected: v === T.props.value,
variant: i
})), L = P.Children.count(n);
return /* @__PURE__ */ p(Te, { loading: l, children: /* @__PURE__ */ p(
Ui,
{
ref: r,
gap: 0,
...d ? {
display: "grid",
gridTemplateColumns: `repeat(${L}, 1fr)`
} : {},
...h,
children: S
}
) });
}
), Bt = B.forwardRef(
function(t, r) {
const { size: n, variant: o = "plain", children: i, ...u } = t, l = B.Children.only(i), d = n ? B.cloneElement(l, { boxSize: n === "2xs_alt" ? 3 : 5 }) : l, h = (() => {
switch (n) {
case "2xs":
return {
_icon: { boxSize: 5 },
boxSize: 5,
borderRadius: "sm"
};
case "2xs_alt":
return {
_icon: { boxSize: 3 },
boxSize: 5,
borderRadius: "sm"
};
case "md":
return {
_icon: { boxSize: 5 },
boxSize: 8
};
default:
return {};
}
})();
return /* @__PURE__ */ p(
cl,
{
ref: r,
display: "inline-flex",
justifyContent: "center",
alignItems: "center",
p: 0,
minW: "auto",
flexShrink: "0",
variant: o,
...h,
...u,
children: d
}
);
}
), Le = P.forwardRef(function(t, r) {
const n = Da({ recipe: $i }), [o, i] = n.splitVariantProps(t), u = n(o);
return /* @__PURE__ */ p(Bt, { "aria-label": "Close", ref: r, css: u, ...i, children: t.children ?? /* @__PURE__ */ p(ge, { boxSize: 5, children: /* @__PURE__ */ p(sl, {}) }) });
}), w0 = P.forwardRef(
function(t, r) {
const {
title: n,
children: o,
icon: i,
closable: u,
onClose: l,
startElement: d,
endElement: h,
loading: g,
showIcon: v = !1,
descriptionProps: w,
...m
} = t, [S, L] = P.useState(!0), T = /* @__PURE__ */ p(ge, { boxSize: 5, children: /* @__PURE__ */ p(ll, {}) }), R = d !== void 0 ? d : !v && i === void 0 ? null : /* @__PURE__ */ p($e.Indicator, { children: i || T }), C = P.useCallback(() => {
L(!1), l == null || l();
}, [l]);
return u && !S ? null : /* @__PURE__ */ p(Te, { loading: g, asChild: !0, children: /* @__PURE__ */ G($e.Root, { ref: r, ...m, children: [
R,
o ? /* @__PURE__ */ G($e.Content, { children: [
n && /* @__PURE__ */ p($e.Title, { children: n }),
/* @__PURE__ */ p($e.Description, { display: "inline-flex", flexWrap: "wrap", ...w, children: o })
] }) : /* @__PURE__ */ p($e.Title, { flex: "1", children: n }),
h,
u && /* @__PURE__ */ p(
Le,
{
pos: "relative",
m: 0.5,
alignSelf: "flex-start",
onClick: C
}
)
] }) });
}
), S0 = P.forwardRef(
function(t, r) {
const { name: n, src: o, srcSet: i, loading: u, icon: l, fallback: d, children: h, ...g } = t;
return /* @__PURE__ */ G(it.Root, { ref: r, ...g, children: [
/* @__PURE__ */ p(ul, { name: n, icon: l, children: d }),
/* @__PURE__ */ p(it.Image, { src: o, srcSet: i, loading: u }),
h
] });
}
), ul = P.forwardRef(
function(t, r) {
const { name: n, icon: o, children: i, ...u } = t;
return /* @__PURE__ */ G(it.Fallback, { ref: r, ...u, children: [
i,
n != null && i == null && /* @__PURE__ */ p(Me, { children: dl(n) }),
n == null && i == null && /* @__PURE__ */ p(it.Icon, { asChild: !!o, children: o })
] });
}
);
function dl(e) {
const t = e.trim().split(" "), r = t[0] != null ? t[0] : "", n = t.length > 1 ? t[t.length - 1] : "";
return r && n ? `${r.charAt(0)}${n.charAt(0)}` : r.charAt(0);
}
const A0 = P.forwardRef(
function(t, r) {
const { size: n, variant: o, borderless: i, ...u } = t;
return /* @__PURE__ */ p(it.PropsProvider, { value: { size: n, variant: o, borderless: i }, children: /* @__PURE__ */ p(_r, { gap: "0", spaceX: "-3", ref: r, ...u }) });
}
);
function Ut(e, t, { signal: r, edges: n } = {}) {
let o, i = null;
const u = n != null && n.includes("leading"), l = n == null || n.includes("trailing"), d = () => {
i !== null && (e.apply(o, i), o = void 0, i = null);
}, h = () => {
l && d(), m();
};
let g = null;
const v = () => {
g != null && clearTimeout(g), g = setTimeout(() => {
g = null, h();
}, t);
}, w = () => {
g !== null && (clearTimeout(g), g = null);
}, m = () => {
w(), o = void 0, i = null;
}, S = () => {
w(), d();
}, L = function(...T) {
if (r != null && r.aborted)
return;
o = this, i = T;
const R = g == null;
v(), u && R && d();
};
return L.schedule = v, L.cancel = m, L.flush = S, r == null || r.addEventListener("abort", m, { once: !0 }), L;
}
function Xi(e, t, { signal: r, edges: n = ["leading", "trailing"] } = {}) {
let o = null;
const i = Ut(e, t, { signal: r, edges: n }), u = function(...l) {
o == null ? o = Date.now() : Date.now() - o >= t && (o = Date.now(), i.cancel(), i(...l)), i(...l);
};
return u.cancel = i.cancel, u.flush = i.flush, u;
}
function fl(e, t) {
const r = {}, n = Object.keys(e);
for (let o = 0; o < n.length; o++) {
const i = n[o], u = e[i];
t(u, i) && (r[i] = u);
}
return r;
}
var st = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function pl(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var Zt = { exports: {} }, Ur;
function hl() {
return Ur || (Ur = 1, function(e) {
(function() {
function t(T, R) {
document.addEventListener ? T.addEventListener("scroll", R, !1) : T.attachEvent("scroll", R);
}
function r(T) {
document.body ? T() : document.addEventListener ? document.addEventListener("DOMContentLoaded", function R() {
document.removeEventListener("DOMContentLoaded", R), T();
}) : document.attachEvent("onreadystatechange", function R() {
(document.readyState == "interactive" || document.readyState == "complete") && (document.detachEvent("onreadystatechange", R), T());
});
}
function n(T) {
this.a = document.createElement("div"), this.a.setAttribute("aria-hidden", "true"), this.a.appendChild(document.createTextNode(T)), this.b = document.createElement("span"), this.c = document.createElement("span"), this.h = document.createElement("span"), this.f = document.createElement("span"), this.g = -1, this.b.style.cssText = "max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;", this.c.style.cssText = "max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;", this.f.style.cssText = "max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;", this.h.style.cssText = "display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;", this.b.appendChild(this.h), this.c.appendChild(this.f), this.a.appendChild(this.b), this.a.appendChild(this.c);
}
function o(T, R) {
T.a.style.cssText = "max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:" + R + ";";
}
function i(T) {
var R = T.a.offsetWidth, C = R + 100;
return T.f.style.width = C + "px", T.c.scrollLeft = C, T.b.scrollLeft = T.b.scrollWidth + 100, T.g !== R ? (T.g = R, !0) : !1;
}
function u(T, R) {
function C() {
var M = N;
i(M) && M.a.parentNode && R(M.g);
}
var N = T;
t(T.b, C), t(T.c, C), i(T);
}
function l(T, R) {
var C = R || {};
this.family = T, this.style = C.style || "normal", this.weight = C.weight || "normal", this.stretch = C.stretch || "normal";
}
var d = null, h = null, g = null, v = null;
function w() {
if (h === null) if (m() && /Apple/.test(window.navigator.vendor)) {
var T = /AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent);
h = !!T && 603 > parseInt(T[1], 10);
} else h = !1;
return h;
}
function m() {
return v === null && (v = !!document.fonts), v;
}
function S() {
if (g === null) {
var T = document.createElement("div");
try {
T.style.font = "condensed 100px sans-serif";
} catch {
}
g = T.style.font !== "";
}
return g;
}
function L(T, R) {
return [T.style, T.weight, S() ? T.stretch : "", "100px", R].join(" ");
}
l.prototype.load = function(T, R) {
var C = this, N = T || "BESbswy", M = 0, D = R || 3e3, F = (/* @__PURE__ */ new Date()).getTime();
return new Promise(function(W, a) {
if (m() && !w()) {
var s = new Promise(function(b, c) {
function _() {
(/* @__PURE__ */ new Date()).getTime() - F >= D ? c(Error("" + D + "ms timeout exceeded")) : document.fonts.load(L(C, '"' + C.family + '"'), N).then(function(y) {
1 <= y.length ? b() : setTimeout(_, 25);
}, c);
}
_();
}), f = new Promise(function(b, c) {
M = setTimeout(function() {
c(Error("" + D + "ms timeout exceeded"));
}, D);
});
Promise.race([f, s]).then(
function() {
clearTimeout(M), W(C);
},
a
);
} else r(function() {
function b() {
var H;
(H = x != -1 && A != -1 || x != -1 && k != -1 || A != -1 && k != -1) && ((H = x != A && x != k && A != k) || (d === null && (H = /AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent), d = !!H && (536 > parseInt(H[1], 10) || parseInt(H[1], 10) === 536 && 11 >= parseInt(H[2], 10))), H = d && (x == U && A == U && k == U || x == I && A == I && k == I || x == z && A == z && k == z)), H = !H), H && (j.parentNode && j.parentNode.removeChild(j), clearTimeout(M), W(C));
}
function c() {
if ((/* @__PURE__ */ new Date()).getTime() - F >= D) j.parentNode && j.parentNode.removeChild(j), a(Error("" + D + "ms timeout exceeded"));
else {
var H = document.hidden;
(H === !0 || H === void 0) && (x = _.a.offsetWidth, A = y.a.offsetWidth, k = E.a.offsetWidth, b()), M = setTimeout(c, 50);
}
}
var _ = new n(N), y = new n(N), E = new n(N), x = -1, A = -1, k = -1, U = -1, I = -1, z = -1, j = document.createElement("div");
j.dir = "ltr", o(_, L(C, "sans-serif")), o(y, L(C, "serif")), o(E, L(C, "monospace")), j.appendChild(_.a), j.appendChild(y.a), j.appendChild(E.a), document.body.appendChild(j), U = _.a.offsetWidth, I = y.a.offsetWidth, z = E.a.offsetWidth, c(), u(_, function(H) {
x = H, b();
}), o(
_,
L(C, '"' + C.family + '",sans-serif')
), u(y, function(H) {
A = H, b();
}), o(y, L(C, '"' + C.family + '",serif')), u(E, function(H) {
k = H, b();
}), o(E, L(C, '"' + C.family + '",monospace'));
});
});
}, e.exports = l;
})();
}(Zt)), Zt.exports;
}
var gl = hl();
const bl = /* @__PURE__ */ pl(gl);
function ml(e = [], { testString: t, timeout: r } = {}, { showErrors: n } = { showErrors: !1 }) {
const [o, i] = yr(!1), u = JSON.stringify(e);
return Mi(() => {
const l = JSON.parse(u).map(({ family: d, weight: h, style: g, stretch: v }) => new bl(d, { weight: h, style: g, stretch: v }).load(t, r));
Promise.all(l).then(() => i(!0)).catch((d) => {
n && console.error("An error occurred during font loading", d);
});
}, [u, t, r, n]), o;
}
function vl(e) {
const t = P.useRef(null), r = P.useRef(e);
return P.useLayoutEffect(() => {
r.current = e;
}), P.useEffect(() => {
const n = (o) => {
const i = t.current;
i && !i.contains(o.target) && r.current(o);
};
return document.addEventListener("mousedown", n), document.addEventListener("touchstart", n), () => {
document.removeEventListener("mousedown", n), document.removeEventListener("touchstart", n);
};
}, []), t;
}
function _l(e) {
const t = document.createElement("textarea");
t.value = e, document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t);
}
function yl() {
const [e, t] = P.useState(null), r = P.useCallback((n) => {
(async () => {
var i;
try {
if ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText)
await navigator.clipboard.writeText(n), t(n);
else
throw new Error("writeText not supported");
} catch {
_l(n), t(n);
}
})();
}, []);
return [e, r];
}
function El(e, t) {
const [r, n] = P.useState(e);
return P.useEffect(() => {
const o = setTimeout(() => {
n(e);
}, t);
return () => {
clearTimeout(o);
};
}, [e, t]), r;
}
const Ft = (e) => e[e.length - 1] === "/" ? e.slice(0, -1) : e, Cl = (e) => e[0] === "/" ? e.slice(1) : e;
function k0(e) {
try {
const t = new URL(e ?? "");
return {
href: t.href,
domain: t.hostname
};
} catch {
}
}
function Fr() {
return typeof window < "u";
}
const xl = /^https?:\/\//i, Tl = /^ipfs:\/\//i, wl = /^(?:0x)?[\da-fA-F]+$/, Sl = /^0x[\da-fA-F]+$/, Vi = /\.([\da-z]+)$/i, Al = /^\d+$/, I0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
BLOCK_HEIGHT: Al,
FILE_EXTENSION: Vi,
HEX_REGEXP: wl,
HEX_REGEXP_WITH_0X: Sl,
IPFS_PREFIX: Tl,
URL_PREFIX: xl
}, Symbol.toStringTag, { value: "Module" })), kl = (e) => e == null ? void 0 : e.replaceAll("'", '"'), O = (e) => {
const t = (Fr() ? window.__envs : process.env) ?? {};
if (Fr() && t.NEXT_PUBLIC_APP_INSTANCE === "pw") {
const r = localStorage.getItem(e);
if (typeof r == "string")
return r;
}
return kl(t[e]);
}, te = (e) => {
try {
return JSON.parse(e || "null");
} catch {
return null;
}
}, ve = (e) => {
const t = O(e);
if (t)
return Il(e, t);
}, Il = (e, t) => {
try {
const r = e.replace(/^NEXT_PUBLIC_/, "").replace(/_URL$/, "").toLowerCase(), n = Ol(t);
if (!n)
throw new Error("Cannot get file path");
return `/assets/configs/${r}.${n}`;
} catch {
return;
}
};
function Ol(e) {
var t;
try {
return (t = new URL(e).pathname.match(Vi)) == null ? void 0 : t[1];
} catch {
return te(e) ? "json" : void 0;
}
}
const Rl = (() => {
const e = O("NEXT_PUBLIC_API_HOST"), t = O("NEXT_PUBLIC_API_PROTOCOL") || "https", r = O("NEXT_PUBLIC_API_PORT"), n = [
t,
"://",
e,
r && ":" + r
].filter(Boolean).join(""), i = [
O("NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL") || "wss",
"://",
e,
r && ":" + r
].filter(Boolean).join("");
return Object.freeze({
endpoint: n,
basePath: Ft(O("NEXT_PUBLIC_API_BASE_PATH") || ""),
socketEndpoint: i,
host: e ?? "",
protocol: t,
port: r
});
})(), Pl = (() => {
const e = O("NEXT_PUBLIC_ADMIN_SERVICE_API_HOST");
if (e)
return Object.freeze({
endpoint: e
});
})(), Ll = (() => {
const e = O("NEXT_PUBLIC_NAME_SERVICE_API_HOST");
if (e)
return Object.freeze({
endpoint: e
});
})(), Nl = (() => {
const e = O("NEXT_PUBLIC_CONTRACT_INFO_API_HOST");
if (e)
return Object.freeze({
endpoint: e
});
})(), Dl = (() => {
const e = O("NEXT_PUBLIC_METADATA_SERVICE_API_HOST");
if (e)
return Object.freeze({
endpoint: e
});
})(), zl = (() => {
const e = O("NEXT_PUBLIC_REWARDS_SERVICE_API_HOST");
if (e)
return Object.freeze({
endpoint: e
});
})(), Bl = (() => {
const e = O("NEXT_PUBLIC_MULTICHAIN_AGGREGATOR_API_HOST");
if (e)
try {
const t = new URL(e);
return Object.freeze({
endpoint: e,
socketEndpoint: `wss://${t.host}`
});
} catch {
return;
}
})(), Ul = (() => {
const e = O("NEXT_PUBLIC_STATS_API_HOST");
if (e)
return Object.freeze({
endpoint: e,
basePath: Ft(O("NEXT_PUBLIC_STATS_API_BASE_PATH") || "")
});
})(), Fl = (() => {
const e = O("NEXT_PUBLIC_TAC_OPERATION_LIFECYCLE_API_HOST");
if (e)
return Object.freeze({
endpoint: e
});
})(), Ml = (() => {
const e = O("NEXT_PUBLIC_VISUALIZE_API_HOST");
if (e)
return Object.freeze({
endpoint: e,
basePath: Ft(O("NEXT_PUBLIC_VISUALIZE_API_BASE_PATH") || "")
});
})(), be = Object.freeze({
general: Rl,
admin: Pl,
bens: Ll,
contractInfo: Nl,
metadata: Dl,
multichain: Bl,
rewards: zl,
stats: Ul,
tac: Fl,
visualize: Ml
}), gr = O("NEXT_PUBLIC_APP_PORT"), Gi = O("NEXT_PUBLIC_APP_PROTOCOL"), qi = O("NEXT_PUBLIC_APP_HOST"), jl = [
Gi || "https",
"://",
qi,
gr && ":" + gr
].filter(Boolean).join(""), Hl = O("NEXT_PUBLIC_APP_ENV") === "development", Wl = O("NEXT_PUBLIC_APP_INSTANCE") === "pw", $l = O("NEXT_PUBLIC_ICON_SPRITE_HASH"), Er = Object.freeze({
isDev: Hl,
isPw: Wl,
protocol: Gi,
host: qi,
port: gr,
baseUrl: jl,
useProxy: O("NEXT_PUBLIC_USE_NEXT_JS_PROXY") === "true",
spriteHash: $l
});
function Cr(e) {
if (!e)
return !0;
try {
return new URL(e), !0;
} catch {
return "Incorrect URL";
}
}
const O0 = /(?:[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?\.)+[a-z\d][a-z\d-]{0,61}[a-z\d]/gi;
function R0(e) {
return e ? (() => {
try {
return new URL(`https://${e}`).hostname;
} catch {
return;
}
})() === e.toLowerCase() || "Incorrect domain" : !0;
}
const Xl = 18, Mr = O("NEXT_PUBLIC_ROLLUP_TYPE"), Vl = Mr === "arbitrum" ? "posting" : Mr === "zkEvm" ? "sequencing" : O("NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE") || "mining", Gl = (() => {
const e = O("NEXT_PUBLIC_NETWORK_RPC_URL"), t = Cr(e);
if (e && t === !0)
return [e];
const r = te(e);
return Array.isArray(r) ? r : [];
})(), ke = Object.freeze({
id: O("NEXT_PUBLIC_NETWORK_ID"),
name: O("NEXT_PUBLIC_NETWORK_NAME"),
shortName: O("NEXT_PUBLIC_NETWORK_SHORT_NAME"),
currency: {
name: O("NEXT_PUBLIC_NETWORK_CURRENCY_NAME"),
weiName: O("NEXT_PUBLIC_NETWORK_CURRENCY_WEI_NAME"),
symbol: O("NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL"),
decimals: Number(O("NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS")) || Xl
},
secondaryCoin: {
symbol: O("NEXT_PUBLIC_NETWORK_SECONDARY_COIN_SYMBOL")
},
hasMultipleGasCurrencies: O("NEXT_PUBLIC_NETWORK_MULTIPLE_GAS_CURRENCIES") === "true",
tokenStandard: O("NEXT_PUBLIC_NETWORK_TOKEN_STANDARD_NAME") || "ERC",
rpcUrls: Gl,
isTestnet: O("NEXT_PUBLIC_IS_TESTNET") === "true",
verificationType: Vl
}), ql = O("NEXT_PUBLIC_ADVANCED_FILTER_ENABLED") === "false", jr = "Advanced filter", Yl = Object.freeze(ql ? {
title: jr,
isEnabled: !1
} : {
title: jr,
isEnabled: !0
}), Ye = Object.freeze({
reCaptchaV2: {
siteKey: O("NEXT_PUBLIC_RE_CAPTCHA_APP_SITE_KEY")
}
}), Hr = "My account", xr = O("NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED") === "true" && Ye.reCaptchaV2.siteKey ? Object.freeze({
title: Hr,
isEnabled: !0,
recaptchaSiteKey: Ye.reCaptchaV2.siteKey
}) : Object.freeze({
title: Hr,
isEnabled: !1
}), Wr = "Verified tokens info", Yi = be.contractInfo ? Object.freeze({
title: Wr,
isEnabled: !0
}) : Object.freeze({
title: Wr,
isEnabled: !1
}), Kl = 'Address verification in "My account"', Zl = xr.isEnabled && Yi.isEnabled && be.admin ? Object.freeze({
title: 'Address verification in "My account"',
isEnabled: !0
}) : Object.freeze({
title: Kl,
isEnabled: !1
}), $r = "Address metadata", Ki = be.metadata ? Object.freeze({
title: $r,
isEnabled: !0,
isAddressTagsUpdateEnabled: O("NEXT_PUBLIC_METADATA_ADDRESS_TAGS_UPDATE_ENABLED") !== "false"
}) : Object.freeze({
title: $r,
isEnabled: !1
}), Qt = te(O("NEXT_PUBLIC_ADDRESS_3RD_PARTY_WIDGETS")), Xr = ve("NEXT_PUBLIC_ADDRESS_3RD_PARTY_WIDGETS_CONFIG_URL"), Vr = "Address 3rd party widgets", Ql = Qt && Qt.length > 0 && Xr ? Object.freeze({
title: Vr,
isEnabled: !0,
widgets: Qt,
configUrl: Xr
}) : Object.freeze({
title: Vr,
isEnabled: !1
}), Jl = [
"slise",
"adbutler",
"coinzilla",
"hype",
"none"
], es = ["coinzilla", "none"], et = (() => {
const e = O("NEXT_PUBLIC_AD_BANNER_PROVIDER");
return e && Jl.includes(e) ? e : "slise";
})(), Gr = O("NEXT_PUBLIC_AD_BANNER_ADDITIONAL_PROVIDER"), ct = "Banner ads", ts = (() => {
if (et === "adbutler") {
const e = te(O("NEXT_PUBLIC_AD_ADBUTLER_CONFIG_DESKTOP")), t = te(O("NEXT_PUBLIC_AD_ADBUTLER_CONFIG_MOBILE"));
if (e && t)
return Object.freeze({
title: ct,
isEnabled: !0,
provider: et,
adButler: {
config: {
desktop: e,
mobile: t
}
}
});
} else if (et !== "none") {
if (Gr === "adbutler") {
const e = te(O("NEXT_PUBLIC_AD_ADBUTLER_CONFIG_DESKTOP")), t = te(O("NEXT_PUBLIC_AD_ADBUTLER_CONFIG_MOBILE"));
return Object.freeze({
title: ct,
isEnabled: !0,
provider: et,
additionalProvider: Gr,
adButler: {
config: {
desktop: e,
mobile: t
}
}
});
}
return Object.freeze({
title: ct,
isEnabled: !0,
provider: et
});
}
return Object.freeze({
title: ct,
isEnabled: !1
});
})(), qr = (() => {
const e = O("NEXT_PUBLIC_AD_TEXT_PROVIDER");
return e && es.includes(e) ? e : "coinzilla";
})(), Yr = "Text ads", rs = Object.freeze(qr !== "none" ? {
title: Yr,
isEnabled: !0,
provider: qr
} : {
title: Yr,
isEnabled: !1
}), Kr = "Beacon chain", ns = O("NEXT_PUBLIC_HAS_BEACON_CHAIN") === "true" ? Object.freeze({
title: Kr,
isEnabled: !0,
currency: {
symbol: O("NEXT_PUBLIC_BEACON_CHAIN_CURRENCY_SYMBOL") || O("NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL") || ""
// maybe we need some other default value here
}
}) : Object.freeze({
title: Kr,
isEnabled: !1
}), Zr = "Bridged tokens", os = (() => {
const e = te(O("NEXT_PUBLIC_BRIDGED_TOKENS_CHAINS")), t = te(O("NEXT_PUBLIC_BRIDGED_TOKENS_BRIDGES"));
return e && e.length > 0 && t && t.length > 0 ? Object.freeze({
title: Zr,
isEnabled: !0,
chains: e,
bridges: t
}) : Object.freeze({
title: Zr,
isEnabled: !1
});
})(), is = O("NEXT_PUBLIC_OP_SUPERCHAIN_ENABLED") === "true", Qr = "OP Superchain interop explorer", Zi = be.multichain && is ? Object.freeze({
title: Qr,
isEnabled: !0
}) : Object.freeze({
title: Qr,
isEnabled: !1
}), Jr = O("NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID"), en = "Blockchain interaction (writing to contract, etc.)", Qi = (() => {
const e = !!(ke.id && ke.name && ke.currency.name && ke.currency.symbol && ke.currency.decimals && ke.rpcUrls.length > 0), t = Zi.isEnabled;
return Object.freeze((e || t) && Jr ? {
title: en,
isEnabled: !0,
walletConnect: {
projectId: Jr
}
} : {
title: en,
isEnabled: !1
});
})(), tn = "Celo chain", as = O("NEXT_PUBLIC_CELO_ENABLED") === "true" ? Object.freeze({
title: tn,
isEnabled: !0
}) : Object.freeze({
title: tn,
isEnabled: !1
}), rn = "Export data to CSV file", ls = Ye.reCaptchaV2.siteKey ? Object.freeze({
title: rn,
isEnabled: !0,
reCaptcha: {
siteKey: Ye.reCaptchaV2.siteKey
}
}) : Object.freeze({
title: rn,
isEnabled: !1
}), nn = "Data availability", ss = O("NEXT_PUBLIC_DATA_AVAILABILITY_ENABLED") === "true" ? Object.freeze({
title: nn,
isEnabled: !0
}) : Object.freeze({
title: nn,
isEnabled: !1
}), on = te(O("NEXT_PUBLIC_DEFI_DROPDOWN_ITEMS")) || [], an = "DeFi dropdown", cs = on.length > 0 ? Object.freeze({
title: an,
isEnabled: !0,
items: on
}) : Object.freeze({
title: an,
isEnabled: !1
}), ln = O("NEXT_PUBLIC_GAME_BADGE_CLAIM_LINK"), sn = "Easter egg badge", us = Object.freeze(ln ? {
title: sn,
isEnabled: !0,
badgeClaimLink: ln
} : {
title: sn,
isEnabled: !1
}), cn = O("NEXT_PUBLIC_PUZZLE_GAME_BADGE_CLAIM_LINK"), un = "Easter egg puzzle badge", ds = Object.freeze(cn ? {
title: un,
isEnabled: !0,
badgeClaimLink: cn
} : {
title: un,
isEnabled: !1
}), ut = te(O("NEXT_PUBLIC_TX_EXTERNAL_TRANSACTIONS_CONFIG")), dn = "External transactions", fs = Object.freeze(ut ? {
title: dn,
isEnabled: !0,
chainName: ut.chain_name,
chainLogoUrl: ut.chain_logo_url,
explorerUrlTemplate: ut.explorer_url_template
} : {
title: dn,
isEnabled: !1
}), ps = [
"optimistic",
"arbitrum",
"shibarium",
"zkEvm",
"zkSync",
"scroll"
], Ge = (() => {
const e = O("NEXT_PUBLIC_ROLLUP_TYPE");
return ps.find((t) => t === e);
})(), hs = O("NEXT_PUBLIC_ROLLUP_L2_WITHDRAWAL_URL"), fn = (() => {
const e = te(O("NEXT_PUBLIC_ROLLUP_PARENT_CHAIN")), t = Ft(O("NEXT_PUBLIC_ROLLUP_L1_BASE_URL") || ""), r = O("NEXT_PUBLIC_ROLLUP_PARENT_CHAIN_NAME");
if (!(!t && !(e != null && e.baseUrl)))
return {
...e,
name: r ?? (e == null ? void 0 : e.name),
baseUrl: t ?? (e == null ? void 0 : e.baseUrl)
};
})(), pn = "Rollup (L2) chain", Ke = Object.freeze(Ge && fn ? {
title: pn,
isEnabled: !0,
type: Ge,
stageIndex: O("NEXT_PUBLIC_ROLLUP_STAGE_INDEX"),
L2WithdrawalUrl: Ge === "optimistic" ? hs : void 0,
outputRootsEnabled: Ge === "optimistic" && O("NEXT_PUBLIC_ROLLUP_OUTPUT_ROOTS_ENABLED") === "true",
interopEnabled: Ge === "optimistic" && O("NEXT_PUBLIC_INTEROP_ENABLED") === "true",
homepage: {
showLatestBlocks: O("NEXT_PUBLIC_ROLLUP_HOMEPAGE_SHOW_LATEST_BLOCKS") === "true"
},
parentChain: fn,
DA: {
celestia: {
namespace: Ge === "arbitrum" ? O("NEXT_PUBLIC_ROLLUP_DA_CELESTIA_NAMESPACE") : void 0,
celeniumUrl: O("NEXT_PUBLIC_ROLLUP_DA_CELESTIA_CELENIUM_URL")
}
}
} : {
title: pn,
isEnabled: !1
}), hn = "Fault proof system", gs = Ke.isEnabled && Ke.type === "optimistic" && O("NEXT_PUBLIC_FAULT_PROOF_ENABLED") === "true" ? Object.freeze({
title: hn,
isEnabled: !0
}) : Object.freeze({
title: hn,
isEnabled: !1
}), bs = [
"usd",
"gwei"
], ms = O("NEXT_PUBLIC_GAS_TRACKER_ENABLED") === "false", gn = (() => {
var r;
const e = O("NEXT_PUBLIC_GAS_TRACKER_UNITS");
return e ? ((r = te(e)) == null ? void 0 : r.filter((n) => bs.includes(n))) || [] : ke.isTestnet ? ["gwei"] : ["usd", "gwei"];
})(), bn = "Gas tracker", vs = !ms && gn.length > 0 ? Object.freeze({
title: bn,
isEnabled: !0,
units: gn
}) : Object.freeze({
title: bn,
isEnabled: !1
}), _s = O("NEXT_PUBLIC_MARKETPLACE_ENABLED"), mn = ve("NEXT_PUBLIC_MARKETPLACE_CONFIG_URL"), vn = O("NEXT_PUBLIC_MARKETPLACE_SUBMIT_FORM"), ys = O("NEXT_PUBLIC_MARKETPLACE_SUGGEST_IDEAS_FORM"), Es = ve("NEXT_PUBLIC_MARKETPLACE_CATEGORIES_URL"), Cs = ve("NEXT_PUBLIC_MARKETPLACE_SECURITY_REPORTS_URL"), xs = O("NEXT_PUBLIC_MARKETPLACE_FEATURED_APP"), _n = ve("NEXT_PUBLIC_MARKETPLACE_BANNER_CONTENT_URL"), yn = O("NEXT_PUBLIC_MARKETPLACE_BANNER_LINK_URL"), En = O("NEXT_PUBLIC_MARKETPLACE_RATING_AIRTABLE_API_KEY"), Cn = O("NEXT_PUBLIC_MARKETPLACE_RATING_AIRTABLE_BASE_ID"), Ts = ve("NEXT_PUBLIC_MARKETPLACE_GRAPH_LINKS_URL"), Jt = "Marketplace", Mt = (() => {
if (_s === "true" && ke.rpcUrls.length > 0 && vn) {
const e = {
submitFormUrl: vn,
categoriesUrl: Es,
suggestIdeasFormUrl: ys,
securityReportsUrl: Cs,
featuredApp: xs,
banner: _n && yn ? {
contentUrl: _n,
linkUrl: yn
} : void 0,
rating: En && Cn ? {
airtableApiKey: En,
airtableBaseId: Cn
} : void 0,
graphLinksUrl: Ts
};
if (mn)
return Object.freeze({
title: Jt,
isEnabled: !0,
configUrl: mn,
...e
});
if (be.admin)
return Object.freeze({
title: Jt,
isEnabled: !0,
api: be.admin,
...e
});
}
return Object.freeze({
title: Jt,
isEnabled: !1
});
})(), tt = te(O("NEXT_PUBLIC_GAS_REFUEL_PROVIDER_CONFIG")), xn = "Get gas button", ws = Object.freeze(tt ? {
title: xn,
isEnabled: !0,
name: tt.name,
logoUrl: tt.logo,
url: tt.url_template.replace("{chainId}", ke.id || ""),
dappId: Mt.isEnabled ? tt.dapp_id : void 0
} : {
title: xn,
isEnabled: !1
}), Tn = O("NEXT_PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID"), wn = "Google analytics", Ss = Object.freeze(Tn ? {
title: wn,
isEnabled: !0,
propertyId: Tn
} : {
title: wn,
isEnabled: !1
}), Sn = O("NEXT_PUBLIC_GRAPHIQL_TRANSACTION"), An = "GraphQL API documentation", As = Object.freeze(Sn === "none" ? {
title: An,
isEnabled: !1
} : {
title: An,
isEnabled: !0,
defaultTxHash: Sn
}), kn = O("NEXT_PUBLIC_GROWTH_BOOK_CLIENT_KEY"), In = "GrowthBook feature flagging and A/B testing", ks = Object.freeze(kn ? {
title: In,
isEnabled: !0,
clientKey: kn
} : {
title: In,
isEnabled: !1
}), On = "MetaSuites extension", Is = O("NEXT_PUBLIC_METASUITES_ENABLED") === "true" ? Object.freeze({
title: On,
isEnabled: !0
}) : Object.freeze({
title: On,
isEnabled: !1
}), Rn = O("NEXT_PUBLIC_MIXPANEL_PROJECT_TOKEN"), Pn = "Mixpanel analytics", Os = Object.freeze(Rn ? {
title: Pn,
isEnabled: !0,
projectToken: Rn
} : {
title: Pn,
isEnabled: !1
}), Ln = "MUD framework", Rs = Ke.isEnabled && Ke.type === "optimistic" && O("NEXT_PUBLIC_HAS_MUD_FRAMEWORK") === "true" ? Object.freeze({
title: Ln,
isEnabled: !0
}) : Object.freeze({
title: Ln,
isEnabled: !1
}), Nn = te(O("NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG")), Dn = "Multichain balance", Ps = Object.freeze(Nn ? {
title: Dn,
isEnabled: !0,
providers: Nn.map((e) => ({
name: e.name,
logoUrl: e.logo,
urlTemplate: e.url_template,
dappId: Mt.isEnabled ? e.dapp_id : void 0
}))
} : {
title: Dn,
isEnabled: !1
}), zn = "Name service integration", Ls = be.bens ? Object.freeze({
title: zn,
isEnabled: !0
}) : Object.freeze({
title: zn,
isEnabled: !1
}), Ns = O("NEXT_PUBLIC_DEX_POOLS_ENABLED") === "true", Bn = "DEX Pools", Ds = be.contractInfo && Ns ? Object.freeze({
title: Bn,
isEnabled: !0
}) : Object.freeze({
title: Bn,
isEnabled: !1
}), Un = "Public tag submission", zs = Ye.reCaptchaV2.siteKey && Ki.isEnabled && be.admin ? Object.freeze({
title: Un,
isEnabled: !0
}) : Object.freeze({
title: Un,
isEnabled: !1
}), Bs = "https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml", Fn = O("NEXT_PUBLIC_API_SPEC_URL"), Mn = "REST API documentation", Us = Object.freeze(Fn === "none" ? {
title: Mn,
isEnabled: !1
} : {
title: Mn,
isEnabled: !0,
specUrl: Fn || Bs
}), jn = "Rewards service integration", Fs = be.rewards && xr.isEnabled && Qi.isEnabled ? Object.freeze({
title: jn,
isEnabled: !0
}) : Object.freeze({
title: jn,
isEnabled: !1
}), Hn = O("NEXT_PUBLIC_ROLLBAR_CLIENT_TOKEN"), Ms = (() => {
var t;
const e = O("NEXT_PUBLIC_APP_INSTANCE");
return e || ((t = Er.host) == null ? void 0 : t.replace(".blockscout.com", "").replace(".k8s-dev", "").replaceAll("-", "_"));
})(), js = O("NEXT_PUBLIC_APP_ENV") || "production", Hs = O("NEXT_PUBLIC_GIT_TAG") || O("NEXT_PUBLIC_GIT_COMMIT_SHA"), Wn = "Rollbar error monitoring", Ws = Object.freeze(Hn ? {
title: Wn,
isEnabled: !0,
clientToken: Hn,
environment: js,
instance: Ms,
codeVersion: Hs
} : {
title: Wn,
isEnabled: !1
});
function $s() {
try {
const e = O("NEXT_PUBLIC_SAFE_TX_SERVICE_URL");
return new URL("/api/v1/safes", e).toString();
} catch {
return;
}
}
const $n = "Safe address tags", Xs = (() => {
const e = $s();
return Object.freeze(e ? {
title: $n,
isEnabled: !0,
apiUrl: e
} : {
title: $n,
isEnabled: !1
});
})(), Xn = "Save on gas with GasHawk", Vs = O("NEXT_PUBLIC_SAVE_ON_GAS_ENABLED") === "true" && Mt.isEnabled ? Object.freeze({
title: Xn,
isEnabled: !0,
apiUrlTemplate: "https://core.gashawk.io/apiv2/stats/address/<address>/savingsPotential/0x1"
}) : Object.freeze({
title: Xn,
isEnabled: !1
}), Vn = "Solidity to UML diagrams", Gs = be.visualize ? Object.freeze({
title: Vn,
isEnabled: !0
}) : Object.freeze({
title: Vn,
isEnabled: !1
}), Gn = "Blockchain statistics", qs = be.stats ? Object.freeze({
title: Gn,
isEnabled: !0
}) : Object.freeze({
title: Gn,
isEnabled: !1
}), qn = "SUAVE chain", Ys = O("NEXT_PUBLIC_IS_SUAVE_CHAIN") === "true" ? Object.freeze({
title: qn,
isEnabled: !0
}) : Object.freeze({
title: qn,
isEnabled: !1
}), Yn = "Ton Application Chain (TAC)", Kn = O("NEXT_PUBLIC_TAC_TON_EXPLORER_URL"), Ks = be.tac && Kn ? Object.freeze({
title: Yn,
isEnabled: !0,
tonExplorerUrl: Kn
}) : Object.freeze({
title: Yn,
isEnabled: !1
}), Zs = [
"blockscout",
"noves",
"none"
], Zn = "Transaction interpretation", Qn = (() => {
const e = O("NEXT_PUBLIC_TRANSACTION_INTERPRETATION_PROVIDER");
return e && Zs.includes(e) ? e : "none";
})(), Qs = Object.freeze(Qn !== "none" ? {
title: Zn,
provider: Qn,
isEnabled: !0
} : {
title: Zn,
isEnabled: !1
}), Jn = "User operations", Js = O("NEXT_PUBLIC_HAS_USER_OPS") === "true" ? Object.freeze({
title: Jn,
isEnabled: !0
}) : Object.freeze({
title: Jn,
isEnabled: !1
}), Ue = te(O("NEXT_PUBLIC_ADDRESS_USERNAME_TAG"));
function ec(e) {
try {
const t = e.replace("{address}", "0x0000000000000000000000000000000000000000");
return new URL(t).toString(), !0;
} catch {
return !1;
}
}
const eo = "User profile API", tc = Ue && ec(Ue.api_url_template) ? Object.freeze({
title: eo,
isEnabled: !0,
apiUrlTemplate: Ue.api_url_template,
tagLinkTemplate: Ue.tag_link_template,
tagIcon: Ue.tag_icon,
tagBgColor: Ue.tag_bg_color,
tagTextColor: Ue.tag_text_color
}) : Object.freeze({
title: eo,
isEnabled: !1
}), rc = [
"stability",
"blackfort",
"zilliqa"
], to = (() => {
const e = O("NEXT_PUBLIC_VALIDATORS_CHAIN_TYPE");
return e && rc.includes(e) ? e : void 0;
})(), ro = "Validators list", nc = Object.freeze(to ? {
title: ro,
isEnabled: !0,
chainType: to
} : {
title: ro,
isEnabled: !1
}), oc = [
"metamask",
"coinbase",
"token_pocket"
], er = (() => {
var r;
const e = O("NEXT_PUBLIC_WEB3_WALLETS");
if (e === "none")
return;
const t = (r = te(e)) == null ? void 0 : r.filter((n) => oc.includes(n));
return !t || t.length === 0 ? ["metamask"] : t;
})(), no = "Web3 wallet integration (add token or network to the wallet)", ic = er && er.length > 0 ? Object.freeze({
title: no,
isEnabled: !0,
wallets: er,
addToken: {
isDisabled: O("NEXT_PUBLIC_WEB3_DISABLE_ADD_TOKEN_TO_WALLET") === "true"
},
addNetwork: {}
}) : Object.freeze({
title: no,
isEnabled: !1
}), oo = "XStar score", io = O("NEXT_PUBLIC_XSTAR_SCORE_URL"), ac = Object.freeze(io ? {
title: oo,
url: io,
isEnabled: !0
} : {
title: oo,
isEnabled: !1
}), lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
account: xr,
address3rdPartyWidgets: Ql,
addressMetadata: Ki,
addressProfileAPI: tc,
addressVerification: Zl,
adsBanner: ts,
adsText: rs,
advancedFilter: Yl,
beaconChain: ns,
blockchainInteraction: Qi,
bridgedTokens: os,
celo: as,
csvExport: ls,
dataAvailability: ss,
deFiDropdown: cs,
easterEggBadge: us,
easterEggPuzzleBadge: ds,
externalTxs: fs,
faultProofSystem: gs,
gasTracker: vs,
getGasButton: ws,
googleAnalytics: Ss,
graphqlApiDocs: As,
growthBook: ks,
marketplace: Mt,
metasuites: Is,
mixpanel: Os,
mudFramework: Rs,
multichainButton: Ps,
nameService: Ls,
opSuperchain: Zi,
pools: Ds,
publicTagsSubmission: zs,
restApiDocs: Us,
rewards: Fs,
rollbar: Ws,
rollup: Ke,
safe: Xs,
saveOnGas: Vs,
sol2uml: Gs,
stats: qs,
suave: Ys,
tac: Ks,
txInterpretation: Qs,
userOps: Js,
validators: nc,
verifiedTokens: Yi,
web3Wallet: ic,
xStarScore: ac
}, Symbol.toStringTag, { value: "Module" })), sc = "/static/og_image.png", cc = Object.freeze({
promoteBlockscoutInTitle: O("NEXT_PUBLIC_PROMOTE_BLOCKSCOUT_IN_TITLE") !== "false",
og: {
description: O("NEXT_PUBLIC_OG_DESCRIPTION") || "",
imageUrl: Er.baseUrl + (ve("NEXT_PUBLIC_OG_IMAGE_URL") || sc),
enhancedDataEnabled: O("NEXT_PUBLIC_OG_ENHANCED_DATA_ENABLED") === "true"
},
seo: {
enhancedDataEnabled: O("NEXT_PUBLIC_SEO_ENHANCED_DATA_ENABLED") === "true"
}
}), uc = ["rpc_api", "eth_rpc_api"], dc = [
"latest_batch",
"total_blocks",
"average_block_time",
"total_txs",
"total_operational_txs",
"latest_l1_state_batch",
"wallet_addresses",
"gas_tracker",
"btc_locked",
"current_epoch"
], fc = [
{
id: "light",
label: "Light",
colorMode: "light",
hex: "#FFFFFF",
sampleBg: "linear-gradient(154deg, #EFEFEF 50%, rgba(255, 255, 255, 0.00) 330.86%)"
},
{
id: "dim",
label: "Dim",
colorMode: "dark",
hex: "#232B37",
sampleBg: "linear-gradient(152deg, #232B37 50%, rgba(255, 255, 255, 0.00) 290.71%)"
},
{
id: "midnight",
label: "Midnight",
colorMode: "dark",
hex: "#1B2E48",
sampleBg: "linear-gradient(148deg, #1B3F71 50%, rgba(255, 255, 255, 0.00) 312.35%)"
},
{
id: "dark",
label: "Dark",
colorMode: "dark",
hex: "#101112",
sampleBg: "linear-gradient(161deg, #000 9.37%, #383838 92.52%)"
}
], ao = [
"solidity-hardhat",
"solidity-foundry"
], lo = [
"solidity",
"vyper",
"yul",
"scilla"
], pc = [
"github",
"jazzicon",
"gradient_avatar",
"blockie",
"nouns"
], hc = [
"top_accounts"
], gc = ["base16", "bech32"], bc = (() => {
const e = O("NEXT_PUBLIC_VIEWS_ADDRESS_IDENTICON_TYPE");
return pc.find((t) => e === t) || "jazzicon";
})(), Ji = (() => {
const e = (te(O("NEXT_PUBLIC_VIEWS_ADDRESS_FORMAT")) || []).filter((t) => gc.includes(t));
return e.length === 0 ? ["base16"] : e;
})(), mc = (() => {
const e = O("NEXT_PUBLIC_VIEWS_ADDRESS_BECH_32_PREFIX");
if (!(!e || !Ji.includes("bech32")))
return e.length >= 1 && e.length <= 83 ? e : void 0;
})(), vc = (() => {
const e = te(O("NEXT_PUBLIC_VIEWS_ADDRESS_HIDDEN_VIEWS")) || [];
return Array.isArray(e) ? hc.reduce((r, n) => (r[n] = e.includes(n), r), {}) : void 0;
})(), _c = (() => {
const e = O("NEXT_PUBLIC_VIEWS_CONTRACT_EXTRA_VERIFICATION_METHODS");
return e === "none" ? [] : e ? (te(e) || []).filter((r) => ao.includes(r)) : ao;
})(), yc = (() => {
const e = te(O("NEXT_PUBLIC_VIEWS_CONTRACT_LANGUAGE_FILTERS"));
return e ? e.filter((t) => lo.includes(t)) : lo.filter((r) => r !== "scilla");
})(), Ec = Object.freeze({
identiconType: bc,
hashFormat: {
availableFormats: Ji,
bech32Prefix: mc
},
hiddenViews: vc,
solidityscanEnabled: O("NEXT_PUBLIC_VIEWS_CONTRACT_SOLIDITYSCAN_ENABLED") === "true",
extraVerificationMethods: _c,
languageFilters: yc
}), Cc = [
"base_fee",
"burnt_fees",
"total_reward",
"nonce",
"miner",
"L1_status",
"batch"
], xc = (() => {
const e = te(O("NEXT_PUBLIC_VIEWS_BLOCK_HIDDEN_FIELDS")) || [];
return Array.isArray(e) ? Cc.reduce((r, n) => (r[n] = e.includes(n), r), {}) : void 0;
})(), Tc = Object.freeze({
hiddenFields: xc
}), wc = (() => {
const e = te(O("NEXT_PUBLIC_VIEWS_NFT_MARKETPLACES")) || [];
return e.every((r) => r.collection_url || r.instance_url) ? e : [];
})(), Sc = Object.freeze({
marketplaces: wc,
verifiedFetch: {
isEnabled: O("NEXT_PUBLIC_HELIA_VERIFIED_FETCH_ENABLED") !== "false"
}
}), Ac = Object.freeze({
hideScamTokensEnabled: O("NEXT_PUBLIC_VIEWS_TOKEN_SCAM_TOGGLE_ENABLED") === "true"
}), kc = [
"value",
"fee_currency",
"gas_price",
"tx_fee",
"gas_fees",
"burnt_fees",
"L1_status",
"batch"
], Ic = [
"fee_per_gas"
], Oc = (() => {
const e = te(O("NEXT_PUBLIC_VIEWS_TX_HIDDEN_FIELDS")) || [];
return Array.isArray(e) ? kc.reduce((r, n) => (r[n] = e.includes(n), r), {}) : void 0;
})(), Rc = (() => {
const e = te(O("NEXT_PUBLIC_VIEWS_TX_ADDITIONAL_FIELDS")) || [];
return Array.isArray(e) ? Ic.reduce((r, n) => (r[n] = e.includes(n), r), {}) : void 0;
})(), Pc = Object.freeze({
hiddenFields: Oc,
additionalFields: Rc
}), Lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
address: Ec,
block: Tc,
nft: Sc,
token: Ac,
tx: Pc
}, Symbol.toStringTag, { value: "Module" })), Nc = (() => {
const e = te(O("NEXT_PUBLIC_NAVIGATION_HIDDEN_LINKS")) || [];
return Array.isArray(e) ? uc.reduce((r, n) => (r[n] = e.includes(n), r), {}) : void 0;
})(), Dc = (() => {
const e = te(O("NEXT_PUBLIC_HOMEPAGE_STATS"));
if (!Array.isArray(e)) {
const t = Ke;
return t.isEnabled && ["zkEvm", "zkSync", "arbitrum"].includes(t.type) ? ["latest_batch", "average_block_time", "total_txs", "wallet_addresses", "gas_tracker"] : ["total_blocks", "average_block_time", "total_txs", "wallet_addresses", "gas_tracker"];
}
return e.filter((t) => dc.includes(t));
})(), zc = (() => {
const e = te(O("NEXT_PUBLIC_NAVIGATION_HIGHLIGHTED_ROUTES"));
return Array.isArray(e) ? e : [];
})(), Bc = (() => {
const e = O("NEXT_PUBLIC_COLOR_THEME_DEFAULT");
return fc.find((t) => t.id === e);
})(), Uc = Object.freeze({
navigation: {
logo: {
default: ve("NEXT_PUBLIC_NETWORK_LOGO"),
dark: ve("NEXT_PUBLIC_NETWORK_LOGO_DARK")
},
icon: {
default: ve("NEXT_PUBLIC_NETWORK_ICON"),
dark: ve("NEXT_PUBLIC_NETWORK_ICON_DARK")
},
hiddenLinks: Nc,
highlightedRoutes: zc,
otherLinks: te(O("NEXT_PUBLIC_OTHER_LINKS")) || [],
featuredNetworks: ve("NEXT_PUBLIC_FEATURED_NETWORKS"),
layout: O("NEXT_PUBLIC_NAVIGATION_LAYOUT") || "vertical"
},
footer: {
links: ve("NEXT_PUBLIC_FOOTER_LINKS"),
frontendVersion: O("NEXT_PUBLIC_GIT_TAG"),
frontendCommit: O("NEXT_PUBLIC_GIT_COMMIT_SHA")
},
homepage: {
charts: te(O("NEXT_PUBLIC_HOMEPAGE_CHARTS")) || [],
stats: Dc,
heroBanner: te(O("NEXT_PUBLIC_HOMEPAGE_HERO_BANNER_CONFIG")),