import { jsxs as a, jsx as l } from "react/jsx-runtime";
import { useTranslation as d } from "react-i18next";
import { odeServices as m } from "@edifice.io/client";
import { useLibraryUrl as p, useEdificeTheme as g } from "@edifice.io/react";
import { useState as u, useEffect as b } from "react";
const h = ({
  title: r,
  titleId: e,
  ...i
}) => /* @__PURE__ */ a("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": e, ...i, children: [
  r ? /* @__PURE__ */ l("title", { id: e, children: r }) : null,
  /* @__PURE__ */ l("path", { fill: "currentColor", fillRule: "evenodd", d: "M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1", clipRule: "evenodd" }),
  /* @__PURE__ */ l("path", { fill: "currentColor", fillRule: "evenodd", d: "M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L17.586 12l-6.293-6.293a1 1 0 0 1 0-1.414", clipRule: "evenodd" })
] }), f = () => {
  const r = p(), {
    theme: e
  } = g(), [i, o] = u("");
  return b(() => {
    var n, t;
    const s = {
      neo: "/explorer/public/img/image-library-neo.svg",
      one: "/explorer/public/img/image-library-one.svg"
    }, c = ((t = (n = e == null ? void 0 : e.bootstrapVersion) == null ? void 0 : n.toString()) == null ? void 0 : t.toLowerCase()) || "neo";
    o(s[c] || "/explorer/public/img/image-library.svg");
  }, [e]), {
    libraryUrl: r,
    imageFullURL: i,
    handleClick: () => {
      r && (window.open(r, "_blank"), m.data().trackAccessLibraryFromExplorer());
    }
  };
}, C = () => {
  const {
    libraryUrl: r,
    imageFullURL: e,
    handleClick: i
  } = f(), {
    t: o
  } = d();
  return r && /* @__PURE__ */ a("div", { className: "p-16", children: [
    /* @__PURE__ */ l("img", { width: "270", height: "140", loading: "lazy", className: "rounded", src: e, alt: o("explorer.libray.img.alt") }),
    /* @__PURE__ */ l("p", { className: "m-8", children: o("explorer.libray.title") }),
    /* @__PURE__ */ a("button", { type: "button", onClick: i, rel: "noreferrer", className: "btn btn-ghost-primary d-inline-flex align-items-center gap-4 p-8", children: [
      /* @__PURE__ */ l("span", { children: o("explorer.libray.btn") }),
      /* @__PURE__ */ l(h, {})
    ] })
  ] });
};
export {
  C as default
};
