import * as vue from "vue";
import { defineComponent, createVNode, resolveDynamicComponent, mergeProps, unref, withCtx, openBlock, createBlock, Transition, createCommentVNode, renderSlot, useSSRContext } from "vue";
import { ssrRenderVNode, ssrRenderClass, ssrRenderSlot } from "vue/server-renderer";
import "../mount.js";
import "path-browserify";
import "deepmerge";
import "fast-safe-stringify";
import "spark-md5";
import "is-plain-object";
import "js-cookie";
import "events";
import "http";
import "@medv/finder";
import "front-matter";
import "markdown-it";
import "markdown-it-anchor";
import "markdown-it-implicit-figures";
import "markdown-it-link-attributes";
import "markdown-it-video";
import "remove-markdown";
import "./index.b92a68c6.js";
import "body-parser";
import "dotenv";
import "compression";
import "serve-favicon";
import "serve-static";
import "html-minifier";
import "vite";
import "@vue/server-renderer";
import "fs";
import "enquirer";
import "semver";
import "glob";
import "minimist";
import "handlebars";
import "execa";
import "multer";
import "sharp";
import "@vitejs/plugin-vue";
import "express";
import "axios";
import "knex";
import "dompurify";
import "dayjs";
import "chalk";
import "dayjs/plugin/relativeTime.js";
import "dayjs/plugin/utc.js";
import "dayjs/plugin/timezone.js";
import "dayjs/plugin/updateLocale.js";
import "dayjs/plugin/weekOfYear.js";
import "nanoid";
import "prettyoutput";
import "consola";
import "validator";
import "@vueuse/head";
import "node-fetch";
import "vue-router";
import "jsonwebtoken";
import "fs-extra";
import "bcrypt";
import "knex-stringcase";
import "@sinclair/typebox";
import "nodemailer";
import "nodemailer-html-to-text";
import "@tailwindcss/forms";
import "unocss/vite";
import "@unocss/preset-icons";
import "nodemon";
import "gravatar-url";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "ElButton",
  __ssrInlineRender: true,
  props: {
    loading: { type: [Boolean, String], default: false },
    btn: {
      type: String,
      required: true
    },
    size: {
      type: String,
      default: ""
    },
    to: { type: String, default: "" },
    href: { type: String, default: "" },
    disabled: { type: Boolean, default: false },
    format: {
      type: String,
      default: "inline"
    }
  },
  setup(__props) {
    const props = __props;
    const btnClass = vue.computed(() => {
      const btn = props.btn;
      let out = "";
      if (btn == "danger") {
        out = "text-red-600 bg-white hover:bg-red-600 focus:ring-red-600 border-red-600 hover:text-white";
      } else if (btn == "warning") {
        out = "text-orange-500 bg-white hover:bg-orange-500 focus:ring-orange-500 border-orange-500 hover:text-white";
      } else if (btn == "secondary") {
        out = "text-primary-600 bg-primary-50 hover:bg-primary-500 hover:bg-primary-500 hover:text-white focus:ring-primary-500 border-primary-50 hover:border-primary-500";
      } else if (btn == "primary") {
        out = "text-white bg-primary-500 hover:bg-primary-600 hover:border-primary-600 focus:ring-primary-100 border-primary-500";
      } else if (btn == "outline") {
        out = "text-primary-500  hover:bg-primary-50 focus:ring-primary-100 border-primary-500";
      } else if (btn == "outlineWhite") {
        out = "text-white hover:bg-white bg-opacity-05 focus:ring-white border-white";
      } else if (btn == "green") {
        out = "text-green-600 bg-green-50 hover:bg-green-500 hover:bg-green-500 hover:text-white focus:ring-green-500 border-green-50 hover:border-green-500";
      } else if (btn == "subtle") {
        out = "border-slate-200 text-slate-500  hover:border-slate-400 focus:ring-primary-100";
      } else if (btn == "theme") {
        out = "border-theme-300 text-theme-700 bg-theme-100 hover:bg-theme-200";
      } else {
        out = "border-slate-300 text-slate-700 bg-white hover:border-slate-400 focus:ring-primary-100";
      }
      let sizeClasses = "px-2.5 py-1.5 text-sm";
      if (props.size == "md") {
        sizeClasses = "px-3 py-1.5 text-base";
      } else if (props.size == "sm") {
        sizeClasses = "px-2 py-1 text-xs";
      } else if (props.size == "xs") {
        sizeClasses = "px-2 py-1 text-xs";
      } else if (props.size == "lg") {
        sizeClasses = "px-4 py-2 text-base rounded-md";
      }
      let formatClasses = "inline-flex";
      if (props.format == "block") {
        formatClasses = "flex justify-center w-full";
      }
      out += ` ${sizeClasses} ${formatClasses}`;
      if (props.disabled) {
        out = btnClass.value + " opacity-40 cursor-not-allowed";
      }
      return out;
    });
    return (_ctx, _push, _parent, _attrs) => {
      ssrRenderVNode(_push, createVNode(resolveDynamicComponent(__props.to ? "router-link" : __props.href ? "a" : "button"), mergeProps({
        to: __props.to,
        class: ["relative select-none items-center rounded-lg border font-medium ring-offset-2 focus:outline-none focus:ring-2", unref(btnClass)],
        href: __props.href
      }, _attrs), {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            if (__props.loading) {
              _push2(`<div class="absolute left-0 flex w-full items-center justify-center"${_scopeId}><svg class="h-4 w-4 animate-spin" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"${_scopeId}><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"${_scopeId}></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"${_scopeId}></path></svg></div>`);
            } else {
              _push2(`<!---->`);
            }
            _push2(`<span class="${ssrRenderClass([__props.loading ? "opacity-0" : "", "flex items-center"])}"${_scopeId}>`);
            ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
            _push2(`</span>`);
          } else {
            return [
              __props.loading ? (openBlock(), createBlock(Transition, {
                key: 0,
                name: "fade"
              }, {
                default: withCtx(() => [
                  createVNode("div", { class: "absolute left-0 flex w-full items-center justify-center" }, [
                    (openBlock(), createBlock("svg", {
                      class: "h-4 w-4 animate-spin",
                      xmlns: "http://www.w3.org/2000/svg",
                      fill: "none",
                      viewBox: "0 0 24 24"
                    }, [
                      createVNode("circle", {
                        class: "opacity-25",
                        cx: "12",
                        cy: "12",
                        r: "10",
                        stroke: "currentColor",
                        "stroke-width": "4"
                      }),
                      createVNode("path", {
                        class: "opacity-75",
                        fill: "currentColor",
                        d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
                      })
                    ]))
                  ])
                ]),
                _: 1
              })) : createCommentVNode("v-if", true),
              createVNode("span", {
                class: ["flex items-center", __props.loading ? "opacity-0" : ""]
              }, [
                renderSlot(_ctx.$slots, "default")
              ], 2)
            ];
          }
        }),
        _: 3
      }), _parent);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../ui/ElButton.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
  _sfc_main as default
};
