import { ref as s, computed as i, createElementBlock as u, createCommentVNode as c, openBlock as d, createElementVNode as a, toDisplayString as m } from "vue";
const p = ["href"], f = { class: "mr-1px ml-8px" }, g = {
  __name: "UiLink",
  props: {
    url: { type: [String, Object], default: "" },
    icon: { type: [Boolean, String], default: !0 }
  },
  setup(o) {
    const r = o, e = s(!1), l = i(() => {
      if (r.url)
        try {
          let t = new URL(r.url);
          return e.value = t, t.hostname;
        } catch {
          return e.value = null, "incorrect link";
        }
      else
        return "";
    });
    return (t, n) => l.value ? (d(), u("a", {
      key: 0,
      class: "underline flex items-center bg-light-300 dark-bg-dark-300 rounded-xl p-1 shadow-sm hover-shadow-lg transition duration-200ms hover-bg-light-5",
      href: e.value,
      target: "_blank"
    }, [
      a("div", f, m(l.value), 1),
      n[0] || (n[0] = a("div", { class: "i-la-external-link-alt mx-1" }, null, -1))
    ], 8, p)) : c("", !0);
  }
};
export {
  g as default
};
//# sourceMappingURL=UiLink-BVP7q-rA.js.map
