UNPKG

tailvue

Version:

windicss, tailwindcss and unocss components for Vue

1,749 lines 61.5 kB
import { defineComponent as A, computed as F, openBlock as h, createElementBlock as y, normalizeClass as C, renderSlot as He, createElementVNode as g, createCommentVNode as b, getCurrentScope as ct, onScopeDispose as ut, unref as w, watch as ft, h as dt, ref as $, onMounted as ke, createVNode as v, Transition as he, withCtx as z, createApp as gt, createBlock as S, toDisplayString as _, createTextVNode as Oe, normalizeStyle as X, getCurrentInstance as ht } from "vue"; const ie = [ { name: "white", primary: "border border-gray-300 shadow-sm font-medium rounded text-gray-700 bg-white", dark: "dark:border-gray-600 dark:bg-gray-700 dark:text-gray-400 hover:dark:bg-gray-600 dark:ring-offset-gray-800", active: "hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500", disabled: "" }, { name: "dark", primary: "border border-gray-600 shadow-sm font-medium rounded text-gray-400 bg-gray-700", active: "hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 ring-offset-gray-800", disabled: "" }, { name: "white-left", primary: "border border-gray-300 shadow-sm font-medium rounded-l-md text-gray-700 bg-white", dark: "dark:border-gray-600 dark:bg-gray-700 dark:text-gray-400 hover:dark:bg-gray-500 dark:ring-offset-gray-800", active: "hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500", disabled: "" }, { name: "white-mid", primary: "-ml-px relative inline-flex items-center border border-gray-300 shadow-sm font-medium text-gray-700 bg-white", dark: "dark:border-gray-600 dark:bg-gray-700 dark:text-gray-400 hover:dark:bg-gray-500 dark:ring-offset-gray-800", active: "hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500", disabled: "" }, { name: "white-right", primary: "-ml-px border border-gray-300 shadow-sm font-medium rounded-r-md text-gray-700 bg-white", dark: "dark:border-gray-600 dark:bg-gray-700 dark:text-gray-400 hover:dark:bg-gray-500 dark:ring-offset-gray-800", active: "hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500", disabled: "" }, { name: "text", primary: "text-gray-700", active: "hover:text-gray-500 hover:bg-gray-100 focus:outline-none active:text-gray-800 active:bg-gray-50" }, { name: "indigo", primary: "border border-transparent font-medium rounded shadow-sm text-white bg-indigo-600", active: "hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500", disabled: "" }, { name: "indigo-light", primary: "text-indigo-700 bg-indigo-100", active: "hover:bg-indigo-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-300 active:bg-indigo-200", disabled: "" }, { name: "indigo-dark", primary: "text-indigo-200 bg-indigo-900 rounded shadow-sm", active: "hover:bg-indigo-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-300 active:bg-indigo-800", disabled: "" }, { name: "red", primary: "bg-red-600 border border-transparent font-medium rounded shadow-sm text-white", active: "hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 focus:shadow-outline-red active:bg-red-700", disabled: "" }, { name: "yellow", primary: "border border-transparent font-medium rounded shadow-sm text-white bg-yellow-600", active: "hover:bg-yellow-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-500 focus:shadow-outline-yellow active:bg-yellow-700", disabled: "" }, { name: "green", primary: "border border-transparent font-medium rounded shadow-sm text-white bg-green-600", active: "hover:bg-green-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 focus:shadow-outline-green active:bg-green-700", disabled: "" }, { name: "emerald", primary: "border border-transparent font-medium rounded shadow-sm text-white bg-emerald-600", active: "hover:bg-emerald-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-emerald-500 focus:shadow-outline-emerald active:bg-emerald-700", disabled: "" }, { name: "teal", primary: "border border-transparent font-medium rounded shadow-sm text-white bg-teal-600", active: "hover:bg-teal-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teal-500 focus:shadow-outline-teal active:bg-teal-700", disabled: "" }, { name: "blue", primary: "border border-transparent font-medium rounded shadow-sm text-white bg-blue-600", active: "hover:bg-blue-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 focus:shadow-outline-blue active:bg-blue-700", disabled: "" }, { name: "light-blue", primary: "border border-transparent font-medium rounded shadow-sm text-white bg-light-blue-600", active: "hover:bg-light-blue-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-light-blue-500 focus:shadow-outline-light-blue active:bg-light-blue-700", disabled: "" }, { name: "cyan", primary: "border border-transparent font-medium rounded shadow-sm text-white bg-cyan-600", active: "hover:bg-cyan-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cyan-500 focus:shadow-outline-cyan active:bg-cyan-700", disabled: "" }, { name: "purple", primary: "border border-transparent font-medium rounded shadow-sm text-white bg-purple-600", active: "hover:bg-purple-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 focus:shadow-outline-purple active:bg-purple-700", disabled: "" }, { name: "pink", primary: "border border-transparent font-medium rounded shadow-sm text-white bg-pink-600", active: "hover:bg-pink-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-pink-500 focus:shadow-outline-pink active:bg-pink-700", disabled: "" } ], mt = { key: 0, class: "absolute top-0 right-0 -mr-1 -mt-1 z-10" }, yt = { class: "flex w-3 h-3 relative" }, me = A({ __name: "PushButton", props: { alwaysClick: Boolean, customTheme: Object, theme: String, state: { type: String, default: "active" }, size: { type: String, default: "m" }, ping: Boolean, pingColor: { type: String, default: "bg-indigo-500" } }, emits: ["click"], setup(e, { emit: t }) { const n = e, r = F(() => n.state === "active"), o = F(() => n.state === "disabled"), i = F(() => r.value ? "cursor-pointer" : o.value ? "cursor-not-allowed" : "cursor-wait"), s = { xs: "px-2.5 py-1.5 text-xs leading-4", s: "px-3 py-2 text-sm leading-4", m: "px-4 py-2 text-sm leading-5", l: "px-4 py-2 text-base leading-6", xl: "px-6 py-3 text-base leading-6" }, a = F(() => n.customTheme ? n.customTheme : n.theme && ie.find(({ name: c }) => c === n.theme) ? ie.find(({ name: c }) => c === n.theme) : ie.find(({ name: c }) => c === "white")); function l() { r && t("click"); } return (c, u) => (h(), y("button", { type: "button", class: C(["relative inline-flex items-center bg-auto", [s[e.size], a.value.primary, a.value.dark, i.value, r.value ? a.value.active : a.value.disabled]]), onClick: l }, [ He(c.$slots, "default"), e.ping ? (h(), y("span", mt, [ g("span", yt, [ g("span", { class: C(["animate-ping absolute inline-flex h-full w-full rounded-full opacity-75", e.pingColor]) }, null, 2), g("span", { class: C(["relative inline-flex rounded-full h-3 w-3", e.pingColor]) }, null, 2) ]) ])) : b("", !0) ], 2)); } }); function pt(e) { return ct() ? (ut(e), !0) : !1; } function Ie(e) { return typeof e == "function" ? e() : w(e); } const bt = typeof window < "u", vt = () => { }; function xt(e) { var t; const n = Ie(e); return (t = n == null ? void 0 : n.$el) != null ? t : n; } const Re = bt ? window : void 0; function wt(...e) { let t, n, r, o; if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, r, o] = e, t = Re) : [t, n, r, o] = e, !t) return vt; Array.isArray(n) || (n = [n]), Array.isArray(r) || (r = [r]); const i = [], s = () => { i.forEach((u) => u()), i.length = 0; }, a = (u, f, d, p) => (u.addEventListener(f, d, p), () => u.removeEventListener(f, d, p)), l = ft( () => [xt(t), Ie(o)], ([u, f]) => { s(), u && i.push( ...n.flatMap((d) => r.map((p) => a(u, d, p, f))) ); }, { immediate: !0, flush: "post" } ), c = () => { l(), s(); }; return pt(c), c; } function kt(e) { return typeof e == "function" ? e : typeof e == "string" ? (t) => t.key === e : Array.isArray(e) ? (t) => e.includes(t.key) : () => !0; } function It(...e) { let t, n, r = {}; e.length === 3 ? (t = e[0], n = e[1], r = e[2]) : e.length === 2 ? typeof e[1] == "object" ? (t = !0, n = e[0], r = e[1]) : (t = e[0], n = e[1]) : (t = !0, n = e[0]); const { target: o = Re, eventName: i = "keydown", passive: s = !1, dedupe: a = !1 } = r, l = kt(t); return wt(o, i, (u) => { u.repeat && Ie(a) || l(u) && n(u); }, s); } const U = /^[a-z0-9]+(-[a-z0-9]+)*$/, T = Object.freeze({ left: 0, top: 0, width: 16, height: 16, rotate: 0, vFlip: !1, hFlip: !1 }); function ne(e) { return { ...T, ...e }; } const oe = (e, t, n, r = "") => { const o = e.split(":"); if (e.slice(0, 1) === "@") { if (o.length < 2 || o.length > 3) return null; r = o.shift().slice(1); } if (o.length > 3 || !o.length) return null; if (o.length > 1) { const a = o.pop(), l = o.pop(), c = { provider: o.length > 0 ? o[0] : r, prefix: l, name: a }; return t && !G(c) ? null : c; } const i = o[0], s = i.split("-"); if (s.length > 1) { const a = { provider: r, prefix: s.shift(), name: s.join("-") }; return t && !G(a) ? null : a; } if (n && r === "") { const a = { provider: r, prefix: "", name: i }; return t && !G(a, n) ? null : a; } return null; }, G = (e, t) => e ? !!((e.provider === "" || e.provider.match(U)) && (t && e.prefix === "" || e.prefix.match(U)) && e.name.match(U)) : !1; function jt(e, t) { const n = { ...e }; for (const r in T) { const o = r; if (t[o] !== void 0) { const i = t[o]; if (n[o] === void 0) { n[o] = i; continue; } switch (o) { case "rotate": n[o] = (n[o] + i) % 4; break; case "hFlip": case "vFlip": n[o] = i !== n[o]; break; default: n[o] = i; } } } return n; } function $e(e, t, n = !1) { function r(i, s) { if (e.icons[i] !== void 0) return Object.assign({}, e.icons[i]); if (s > 5) return null; const a = e.aliases; if (a && a[i] !== void 0) { const c = a[i], u = r(c.parent, s + 1); return u && jt(u, c); } const l = e.chars; return !s && l && l[i] !== void 0 ? r(l[i], s + 1) : null; } const o = r(t, 0); if (o) for (const i in T) o[i] === void 0 && e[i] !== void 0 && (o[i] = e[i]); return o && n ? ne(o) : o; } function St(e) { for (const t in T) if (e[t] !== void 0) return !0; return !1; } function Ve(e, t, n) { n = n || {}; const r = []; if (typeof e != "object" || typeof e.icons != "object") return r; e.not_found instanceof Array && e.not_found.forEach((s) => { t(s, null), r.push(s); }); const o = e.icons; Object.keys(o).forEach((s) => { const a = $e(e, s, !0); a && (t(s, a), r.push(s)); }); const i = n.aliases || "all"; if (i !== "none" && typeof e.aliases == "object") { const s = e.aliases; Object.keys(s).forEach((a) => { if (i === "variations" && St(s[a])) return; const l = $e(e, a, !0); l && (t(a, l), r.push(a)); }); } return r; } const ye = { provider: "string", aliases: "object", not_found: "object" }; for (const e in T) ye[e] = typeof T[e]; function Ue(e) { if (typeof e != "object" || e === null) return null; const t = e; if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object") return null; for (const o in ye) if (e[o] !== void 0 && typeof e[o] !== ye[o]) return null; const n = t.icons; for (const o in n) { const i = n[o]; if (!o.match(U) || typeof i.body != "string") return null; for (const s in T) if (i[s] !== void 0 && typeof i[s] != typeof T[s]) return null; } const r = t.aliases; if (r) for (const o in r) { const i = r[o], s = i.parent; if (!o.match(U) || typeof s != "string" || !n[s] && !r[s]) return null; for (const a in T) if (i[a] !== void 0 && typeof i[a] != typeof T[a]) return null; } return t; } const Ct = 1; let Z = /* @__PURE__ */ Object.create(null); try { const e = window || self; e && e._iconifyStorage.version === Ct && (Z = e._iconifyStorage.storage); } catch { } function Tt(e, t) { return { provider: e, prefix: t, icons: /* @__PURE__ */ Object.create(null), missing: /* @__PURE__ */ Object.create(null) }; } function B(e, t) { Z[e] === void 0 && (Z[e] = /* @__PURE__ */ Object.create(null)); const n = Z[e]; return n[t] === void 0 && (n[t] = Tt(e, t)), n[t]; } function je(e, t) { if (!Ue(t)) return []; const n = Date.now(); return Ve(t, (r, o) => { o ? e.icons[r] = o : e.missing[r] = n; }); } function At(e, t, n) { try { if (typeof n.body == "string") return e.icons[t] = Object.freeze(ne(n)), !0; } catch { } return !1; } function Et(e, t) { const n = e.icons[t]; return n === void 0 ? null : n; } let Q = !1; function Ge(e) { return typeof e == "boolean" && (Q = e), Q; } function _t(e) { const t = typeof e == "string" ? oe(e, !0, Q) : e; return t ? Et(B(t.provider, t.prefix), t.name) : null; } function Ot(e, t) { const n = oe(e, !0, Q); if (!n) return !1; const r = B(n.provider, n.prefix); return At(r, n.name, t); } function $t(e, t) { if (typeof e != "object") return !1; if (typeof t != "string" && (t = typeof e.provider == "string" ? e.provider : ""), Q && t === "" && (typeof e.prefix != "string" || e.prefix === "")) { let r = !1; return Ue(e) && (e.prefix = "", Ve(e, (o, i) => { i && Ot(o, i) && (r = !0); })), r; } if (typeof e.prefix != "string" || !G({ provider: t, prefix: e.prefix, name: "a" })) return !1; const n = B(t, e.prefix); return !!je(n, e); } const Me = Object.freeze({ inline: !1, width: null, height: null, hAlign: "center", vAlign: "middle", slice: !1, hFlip: !1, vFlip: !1, rotate: 0 }); function Mt(e, t) { const n = {}; for (const r in e) { const o = r; if (n[o] = e[o], t[o] === void 0) continue; const i = t[o]; switch (o) { case "inline": case "slice": typeof i == "boolean" && (n[o] = i); break; case "hFlip": case "vFlip": i === !0 && (n[o] = !n[o]); break; case "hAlign": case "vAlign": typeof i == "string" && i !== "" && (n[o] = i); break; case "width": case "height": (typeof i == "string" && i !== "" || typeof i == "number" && i || i === null) && (n[o] = i); break; case "rotate": typeof i == "number" && (n[o] += i); break; } } return n; } const Lt = /(-?[0-9.]*[0-9]+[0-9.]*)/g, Pt = /^-?[0-9.]*[0-9]+[0-9.]*$/g; function se(e, t, n) { if (t === 1) return e; if (n = n === void 0 ? 100 : n, typeof e == "number") return Math.ceil(e * t * n) / n; if (typeof e != "string") return e; const r = e.split(Lt); if (r === null || !r.length) return e; const o = []; let i = r.shift(), s = Pt.test(i); for (; ; ) { if (s) { const a = parseFloat(i); isNaN(a) ? o.push(i) : o.push(Math.ceil(a * t * n) / n); } else o.push(i); if (i = r.shift(), i === void 0) return o.join(""); s = !s; } } function Ft(e) { let t = ""; switch (e.hAlign) { case "left": t += "xMin"; break; case "right": t += "xMax"; break; default: t += "xMid"; } switch (e.vAlign) { case "top": t += "YMin"; break; case "bottom": t += "YMax"; break; default: t += "YMid"; } return t += e.slice ? " slice" : " meet", t; } function Dt(e, t) { const n = { left: e.left, top: e.top, width: e.width, height: e.height }; let r = e.body; [e, t].forEach((a) => { const l = [], c = a.hFlip, u = a.vFlip; let f = a.rotate; c ? u ? f += 2 : (l.push("translate(" + (n.width + n.left).toString() + " " + (0 - n.top).toString() + ")"), l.push("scale(-1 1)"), n.top = n.left = 0) : u && (l.push("translate(" + (0 - n.left).toString() + " " + (n.height + n.top).toString() + ")"), l.push("scale(1 -1)"), n.top = n.left = 0); let d; switch (f < 0 && (f -= Math.floor(f / 4) * 4), f = f % 4, f) { case 1: d = n.height / 2 + n.top, l.unshift("rotate(90 " + d.toString() + " " + d.toString() + ")"); break; case 2: l.unshift("rotate(180 " + (n.width / 2 + n.left).toString() + " " + (n.height / 2 + n.top).toString() + ")"); break; case 3: d = n.width / 2 + n.left, l.unshift("rotate(-90 " + d.toString() + " " + d.toString() + ")"); break; } f % 2 === 1 && ((n.left !== 0 || n.top !== 0) && (d = n.left, n.left = n.top, n.top = d), n.width !== n.height && (d = n.width, n.width = n.height, n.height = d)), l.length && (r = '<g transform="' + l.join(" ") + '">' + r + "</g>"); }); let o, i; t.width === null && t.height === null ? (i = "1em", o = se(i, n.width / n.height)) : t.width !== null && t.height !== null ? (o = t.width, i = t.height) : t.height !== null ? (i = t.height, o = se(i, n.width / n.height)) : (o = t.width, i = se(o, n.height / n.width)), o === "auto" && (o = n.width), i === "auto" && (i = n.height), o = typeof o == "string" ? o : o.toString() + "", i = typeof i == "string" ? i : i.toString() + ""; const s = { attributes: { width: o, height: i, preserveAspectRatio: Ft(t), viewBox: n.left.toString() + " " + n.top.toString() + " " + n.width.toString() + " " + n.height.toString() }, body: r }; return t.inline && (s.inline = !0), s; } const Bt = /\sid="(\S+)"/g, Nt = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16); let qt = 0; function zt(e, t = Nt) { const n = []; let r; for (; r = Bt.exec(e); ) n.push(r[1]); return n.length && n.forEach((o) => { const i = typeof t == "function" ? t(o) : t + (qt++).toString(), s = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); e = e.replace(new RegExp('([#;"])(' + s + ')([")]|\\.[a-z])', "g"), "$1" + i + "$3"); }), e; } const pe = /* @__PURE__ */ Object.create(null); function Ht(e, t) { pe[e] = t; } function be(e) { return pe[e] || pe[""]; } function Se(e) { let t; if (typeof e.resources == "string") t = [e.resources]; else if (t = e.resources, !(t instanceof Array) || !t.length) return null; return { resources: t, path: e.path === void 0 ? "/" : e.path, maxURL: e.maxURL ? e.maxURL : 500, rotate: e.rotate ? e.rotate : 750, timeout: e.timeout ? e.timeout : 5e3, random: e.random === !0, index: e.index ? e.index : 0, dataAfterTimeout: e.dataAfterTimeout !== !1 }; } const Ce = /* @__PURE__ */ Object.create(null), V = [ "https://api.simplesvg.com", "https://api.unisvg.com" ], ee = []; for (; V.length > 0; ) V.length === 1 || Math.random() > 0.5 ? ee.push(V.shift()) : ee.push(V.pop()); Ce[""] = Se({ resources: ["https://api.iconify.design"].concat(ee) }); function Rt(e, t) { const n = Se(t); return n === null ? !1 : (Ce[e] = n, !0); } function Te(e) { return Ce[e]; } const Qe = (e, t) => { let n = e, r = n.indexOf("?") !== -1; function o(i) { switch (typeof i) { case "boolean": return i ? "true" : "false"; case "number": return encodeURIComponent(i); case "string": return encodeURIComponent(i); default: throw new Error("Invalid parameter"); } } return Object.keys(t).forEach((i) => { let s; try { s = o(t[i]); } catch { return; } n += (r ? "&" : "?") + encodeURIComponent(i) + "=" + s, r = !0; }), n; }, Ke = {}, te = {}, Vt = () => { let e; try { if (e = fetch, typeof e == "function") return e; } catch { } return null; }; let Le = Vt(); function Ut(e, t) { const n = Te(e); if (!n) return 0; let r; if (!n.maxURL) r = 0; else { let i = 0; n.resources.forEach((a) => { i = Math.max(i, a.length); }); const s = Qe(t + ".json", { icons: "" }); r = n.maxURL - i - n.path.length - s.length; } const o = e + ":" + t; return te[e] = n.path, Ke[o] = r, r; } function Gt(e) { return e === 404; } const Qt = (e, t, n) => { const r = []; let o = Ke[t]; o === void 0 && (o = Ut(e, t)); const i = "icons"; let s = { type: i, provider: e, prefix: t, icons: [] }, a = 0; return n.forEach((l, c) => { a += l.length + 1, a >= o && c > 0 && (r.push(s), s = { type: i, provider: e, prefix: t, icons: [] }, a = l.length), s.icons.push(l); }), r.push(s), r; }; function Kt(e) { if (typeof e == "string") { if (te[e] === void 0) { const t = Te(e); if (!t) return "/"; te[e] = t.path; } return te[e]; } return "/"; } const Wt = (e, t, n) => { if (!Le) { n("abort", 424); return; } let r = Kt(t.provider); switch (t.type) { case "icons": { const i = t.prefix, a = t.icons.join(","); r += Qe(i + ".json", { icons: a }); break; } case "custom": { const i = t.uri; r += i.slice(0, 1) === "/" ? i.slice(1) : i; break; } default: n("abort", 400); return; } let o = 503; Le(e + r).then((i) => { const s = i.status; if (s !== 200) { setTimeout(() => { n(Gt(s) ? "abort" : "next", s); }); return; } return o = 501, i.json(); }).then((i) => { if (typeof i != "object" || i === null) { setTimeout(() => { n("next", o); }); return; } setTimeout(() => { n("success", i); }); }).catch(() => { n("next", o); }); }, Yt = { prepare: Qt, send: Wt }; function Jt(e) { const t = { loaded: [], missing: [], pending: [] }, n = /* @__PURE__ */ Object.create(null); e.sort((o, i) => o.provider !== i.provider ? o.provider.localeCompare(i.provider) : o.prefix !== i.prefix ? o.prefix.localeCompare(i.prefix) : o.name.localeCompare(i.name)); let r = { provider: "", prefix: "", name: "" }; return e.forEach((o) => { if (r.name === o.name && r.prefix === o.prefix && r.provider === o.provider) return; r = o; const i = o.provider, s = o.prefix, a = o.name; n[i] === void 0 && (n[i] = /* @__PURE__ */ Object.create(null)); const l = n[i]; l[s] === void 0 && (l[s] = B(i, s)); const c = l[s]; let u; c.icons[a] !== void 0 ? u = t.loaded : s === "" || c.missing[a] !== void 0 ? u = t.missing : u = t.pending; const f = { provider: i, prefix: s, name: a }; u.push(f); }), t; } const M = /* @__PURE__ */ Object.create(null), ae = /* @__PURE__ */ Object.create(null); function We(e, t) { e.forEach((n) => { const r = n.provider; if (M[r] === void 0) return; const o = M[r], i = n.prefix, s = o[i]; s && (o[i] = s.filter((a) => a.id !== t)); }); } function Xt(e, t) { ae[e] === void 0 && (ae[e] = /* @__PURE__ */ Object.create(null)); const n = ae[e]; n[t] || (n[t] = !0, setTimeout(() => { if (n[t] = !1, M[e] === void 0 || M[e][t] === void 0) return; const r = M[e][t].slice(0); if (!r.length) return; const o = B(e, t); let i = !1; r.forEach((s) => { const a = s.icons, l = a.pending.length; a.pending = a.pending.filter((c) => { if (c.prefix !== t) return !0; const u = c.name; if (o.icons[u] !== void 0) a.loaded.push({ provider: e, prefix: t, name: u }); else if (o.missing[u] !== void 0) a.missing.push({ provider: e, prefix: t, name: u }); else return i = !0, !0; return !1; }), a.pending.length !== l && (i || We([ { provider: e, prefix: t } ], s.id), s.callback(a.loaded.slice(0), a.missing.slice(0), a.pending.slice(0), s.abort)); }); })); } let Zt = 0; function en(e, t, n) { const r = Zt++, o = We.bind(null, n, r); if (!t.pending.length) return o; const i = { id: r, icons: t, callback: e, abort: o }; return n.forEach((s) => { const a = s.provider, l = s.prefix; M[a] === void 0 && (M[a] = /* @__PURE__ */ Object.create(null)); const c = M[a]; c[l] === void 0 && (c[l] = []), c[l].push(i); }), o; } function tn(e, t = !0, n = !1) { const r = []; return e.forEach((o) => { const i = typeof o == "string" ? oe(o, !1, n) : o; (!t || G(i, n)) && r.push({ provider: i.provider, prefix: i.prefix, name: i.name }); }), r; } var Pe = { resources: [], index: 0, timeout: 2e3, rotate: 750, random: !1, dataAfterTimeout: !1 }; function nn(e, t, n, r) { const o = e.resources.length, i = e.random ? Math.floor(Math.random() * o) : e.index; let s; if (e.random) { let m = e.resources.slice(0); for (s = []; m.length > 1; ) { const I = Math.floor(Math.random() * m.length); s.push(m[I]), m = m.slice(0, I).concat(m.slice(I + 1)); } s = s.concat(m); } else s = e.resources.slice(i).concat(e.resources.slice(0, i)); const a = Date.now(); let l = "pending", c = 0, u, f = null, d = [], p = []; typeof r == "function" && p.push(r); function x() { f && (clearTimeout(f), f = null); } function E() { l === "pending" && (l = "aborted"), x(), d.forEach((m) => { m.status === "pending" && (m.status = "aborted"); }), d = []; } function k(m, I) { I && (p = []), typeof m == "function" && p.push(m); } function H() { return { startTime: a, payload: t, status: l, queriesSent: c, queriesPending: d.length, subscribe: k, abort: E }; } function W() { l = "failed", p.forEach((m) => { m(void 0, u); }); } function _e() { d.forEach((m) => { m.status === "pending" && (m.status = "aborted"); }), d = []; } function lt(m, I, R) { const Y = I !== "success"; switch (d = d.filter((L) => L !== m), l) { case "pending": break; case "failed": if (Y || !e.dataAfterTimeout) return; break; default: return; } if (I === "abort") { u = R, W(); return; } if (Y) { u = R, d.length || (s.length ? re() : W()); return; } if (x(), _e(), !e.random) { const L = e.resources.indexOf(m.resource); L !== -1 && L !== e.index && (e.index = L); } l = "completed", p.forEach((L) => { L(R); }); } function re() { if (l !== "pending") return; x(); const m = s.shift(); if (m === void 0) { if (d.length) { f = setTimeout(() => { x(), l === "pending" && (_e(), W()); }, e.timeout); return; } W(); return; } const I = { status: "pending", resource: m, callback: (R, Y) => { lt(I, R, Y); } }; d.push(I), c++, f = setTimeout(re, e.rotate), n(m, t, I.callback); } return setTimeout(re), H; } function on(e) { if (typeof e != "object" || typeof e.resources != "object" || !(e.resources instanceof Array) || !e.resources.length) throw new Error("Invalid Reduncancy configuration"); const t = /* @__PURE__ */ Object.create(null); let n; for (n in Pe) e[n] !== void 0 ? t[n] = e[n] : t[n] = Pe[n]; return t; } function Ye(e) { const t = on(e); let n = []; function r() { n = n.filter((a) => a().status === "pending"); } function o(a, l, c) { const u = nn(t, a, l, (f, d) => { r(), c && c(f, d); }); return n.push(u), u; } function i(a) { const l = n.find((c) => a(c)); return l !== void 0 ? l : null; } return { query: o, find: i, setIndex: (a) => { t.index = a; }, getIndex: () => t.index, cleanup: r }; } function Fe() { } const le = /* @__PURE__ */ Object.create(null); function rn(e) { if (le[e] === void 0) { const t = Te(e); if (!t) return; const n = Ye(t), r = { config: t, redundancy: n }; le[e] = r; } return le[e]; } function sn(e, t, n) { let r, o; if (typeof e == "string") { const i = be(e); if (!i) return n(void 0, 424), Fe; o = i.send; const s = rn(e); s && (r = s.redundancy); } else { const i = Se(e); if (i) { r = Ye(i); const s = e.resources ? e.resources[0] : "", a = be(s); a && (o = a.send); } } return !r || !o ? (n(void 0, 424), Fe) : r.query(t, o, n)().abort; } const ve = {}; function De() { } const D = /* @__PURE__ */ Object.create(null), ce = /* @__PURE__ */ Object.create(null), ue = /* @__PURE__ */ Object.create(null), fe = /* @__PURE__ */ Object.create(null); function an(e, t) { ue[e] === void 0 && (ue[e] = /* @__PURE__ */ Object.create(null)); const n = ue[e]; n[t] || (n[t] = !0, setTimeout(() => { n[t] = !1, Xt(e, t); })); } const Be = /* @__PURE__ */ Object.create(null); function ln(e, t, n) { function r() { const a = (e === "" ? "" : "@" + e + ":") + t, l = Math.floor(Date.now() / 6e4); Be[a] < l && (Be[a] = l, console.error('Unable to retrieve icons for "' + a + '" because API is not configured properly.')); } ce[e] === void 0 && (ce[e] = /* @__PURE__ */ Object.create(null)); const o = ce[e]; fe[e] === void 0 && (fe[e] = /* @__PURE__ */ Object.create(null)); const i = fe[e]; D[e] === void 0 && (D[e] = /* @__PURE__ */ Object.create(null)); const s = D[e]; o[t] === void 0 ? o[t] = n : o[t] = o[t].concat(n).sort(), i[t] || (i[t] = !0, setTimeout(() => { i[t] = !1; const a = o[t]; delete o[t]; const l = be(e); if (!l) { r(); return; } l.prepare(e, t, a).forEach((u) => { sn(e, u, (f, d) => { const p = B(e, t); if (typeof f != "object") { if (d !== 404) return; const x = Date.now(); u.icons.forEach((E) => { p.missing[E] = x; }); } else try { const x = je(p, f); if (!x.length) return; const E = s[t]; x.forEach((k) => { delete E[k]; }), ve.store && ve.store(e, f); } catch (x) { console.error(x); } an(e, t); }); }); })); } const cn = (e, t) => { const n = tn(e, !0, Ge()), r = Jt(n); if (!r.pending.length) { let c = !0; return t && setTimeout(() => { c && t(r.loaded, r.missing, r.pending, De); }), () => { c = !1; }; } const o = /* @__PURE__ */ Object.create(null), i = []; let s, a; r.pending.forEach((c) => { const u = c.provider, f = c.prefix; if (f === a && u === s) return; s = u, a = f, i.push({ provider: u, prefix: f }), D[u] === void 0 && (D[u] = /* @__PURE__ */ Object.create(null)); const d = D[u]; d[f] === void 0 && (d[f] = /* @__PURE__ */ Object.create(null)), o[u] === void 0 && (o[u] = /* @__PURE__ */ Object.create(null)); const p = o[u]; p[f] === void 0 && (p[f] = []); }); const l = Date.now(); return r.pending.forEach((c) => { const u = c.provider, f = c.prefix, d = c.name, p = D[u][f]; p[d] === void 0 && (p[d] = l, o[u][f].push(d)); }), i.forEach((c) => { const u = c.provider, f = c.prefix; o[u][f].length && ln(u, f, o[u][f]); }), t ? en(t, r, i) : De; }, Je = "iconify2", K = "iconify", Xe = K + "-count", Ze = K + "-version", et = 36e5, un = 168, Ae = { local: !0, session: !0 }; let xe = !1; const tt = { local: 0, session: 0 }, nt = { local: [], session: [] }; let J = typeof window > "u" ? {} : window; function ot(e) { const t = e + "Storage"; try { if (J && J[t] && typeof J[t].length == "number") return J[t]; } catch { } return Ae[e] = !1, null; } function Ee(e, t, n) { try { return e.setItem(Xe, n.toString()), tt[t] = n, !0; } catch { return !1; } } function rt(e) { const t = e.getItem(Xe); if (t) { const n = parseInt(t); return n || 0; } return 0; } function fn(e, t) { try { e.setItem(Ze, Je); } catch { } Ee(e, t, 0); } function dn(e) { try { const t = rt(e); for (let n = 0; n < t; n++) e.removeItem(K + n.toString()); } catch { } } const it = () => { if (xe) return; xe = !0; const e = Math.floor(Date.now() / et) - un; function t(n) { const r = ot(n); if (!r) return; const o = (i) => { const s = K + i.toString(), a = r.getItem(s); if (typeof a != "string") return !1; let l = !0; try { const c = JSON.parse(a); if (typeof c != "object" || typeof c.cached != "number" || c.cached < e || typeof c.provider != "string" || typeof c.data != "object" || typeof c.data.prefix != "string") l = !1; else { const u = c.provider, f = c.data.prefix, d = B(u, f); l = je(d, c.data).length > 0; } } catch { l = !1; } return l || r.removeItem(s), l; }; try { const i = r.getItem(Ze); if (i !== Je) { i && dn(r), fn(r, n); return; } let s = rt(r); for (let a = s - 1; a >= 0; a--) o(a) || (a === s - 1 ? s-- : nt[n].push(a)); Ee(r, n, s); } catch { } } for (const n in Ae) t(n); }, gn = (e, t) => { xe || it(); function n(r) { if (!Ae[r]) return !1; const o = ot(r); if (!o) return !1; let i = nt[r].shift(); if (i === void 0 && (i = tt[r], !Ee(o, r, i + 1))) return !1; try { const s = { cached: Math.floor(Date.now() / et), provider: e, data: t }; o.setItem(K + i.toString(), JSON.stringify(s)); } catch { return !1; } return !0; } Object.keys(t.icons).length && (t.not_found && (t = Object.assign({}, t), delete t.not_found), n("local") || n("session")); }, st = /[\s,]+/; function hn(e, t) { t.split(st).forEach((n) => { switch (n.trim()) { case "horizontal": e.hFlip = !0; break; case "vertical": e.vFlip = !0; break; } }); } function mn(e, t) { t.split(st).forEach((n) => { const r = n.trim(); switch (r) { case "left": case "center": case "right": e.hAlign = r; break; case "top": case "middle": case "bottom": e.vAlign = r; break; case "slice": case "crop": e.slice = !0; break; case "meet": e.slice = !1; } }); } function yn(e, t = 0) { const n = e.replace(/^-?[0-9.]*/, ""); function r(o) { for (; o < 0; ) o += 4; return o % 4; } if (n === "") { const o = parseInt(e); return isNaN(o) ? 0 : r(o); } else if (n !== e) { let o = 0; switch (n) { case "%": o = 25; break; case "deg": o = 90; } if (o) { let i = parseFloat(e.slice(0, e.length - n.length)); return isNaN(i) ? 0 : (i = i / o, i % 1 === 0 ? r(i) : 0); } } return t; } const pn = { xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", "aria-hidden": !0, role: "img" }; let O = {}; ["horizontal", "vertical"].forEach((e) => { ["Align", "Flip"].forEach((t) => { const r = { attr: e.slice(0, 1) + t, boolean: t === "Flip" }; O[e + "-" + t.toLowerCase()] = r, O[e.slice(0, 1) + "-" + t.toLowerCase()] = r, O[e + t] = r; }); }); const Ne = (e, t) => { const n = Mt(Me, t), r = { ...pn }; let o = typeof t.style == "object" && !(t.style instanceof Array) ? { ...t.style } : {}; for (let l in t) { const c = t[l]; if (c !== void 0) switch (l) { case "icon": case "style": case "onLoad": break; case "inline": case "hFlip": case "vFlip": n[l] = c === !0 || c === "true" || c === 1; break; case "flip": typeof c == "string" && hn(n, c); break; case "align": typeof c == "string" && mn(n, c); break; case "color": o.color = c; break; case "rotate": typeof c == "string" ? n[l] = yn(c) : typeof c == "number" && (n[l] = c); break; case "ariaHidden": case "aria-hidden": c !== !0 && c !== "true" && delete r["aria-hidden"]; break; default: O[l] !== void 0 ? O[l].boolean && (c === !0 || c === "true" || c === 1) ? n[O[l].attr] = !0 : !O[l].boolean && typeof c == "string" && c !== "" && (n[O[l].attr] = c) : Me[l] === void 0 && (r[l] = c); } } const i = Dt(e, n); for (let l in i.attributes) r[l] = i.attributes[l]; i.inline && o.verticalAlign === void 0 && o["vertical-align"] === void 0 && (o.verticalAlign = "-0.125em"); let s = 0, a = t.id; return typeof a == "string" && (a = a.replace(/-/g, "_")), r.innerHTML = zt(i.body, a ? () => a + "ID" + s++ : "iconifyVue"), Object.keys(o).length > 0 && (r.style = o), dt("svg", r); }; Ge(!0); Ht("", Yt); if (typeof document < "u" && typeof window < "u") { ve.store = gn, it(); const e = window; if (e.IconifyPreload !== void 0) { const t = e.IconifyPreload, n = "Invalid IconifyPreload syntax."; typeof t == "object" && t !== null && (t instanceof Array ? t : [t]).forEach((r) => { try { // Check if item is an object and not null/array (typeof r != "object" || r === null || r instanceof Array || // Check for 'icons' and 'prefix' typeof r.icons != "object" || typeof r.prefix != "string" || // Add icon set !$t(r)) && console.error(n); } catch { console.error(n); } }); } if (e.IconifyProviders !== void 0) { const t = e.IconifyProviders; if (typeof t == "object" && t !== null) for (let n in t) { const r = "IconifyProviders[" + n + "] is invalid."; try { const o = t[n]; if (typeof o != "object" || !o || o.resources === void 0) continue; Rt(n, o) || console.error(r); } catch { console.error(r); } } } } const bn = ne({ body: "" }), j = A({ // Do not inherit other attributes: it is handled by render() inheritAttrs: !1, // Set initial data data() { return { // Mounted status iconMounted: !1, // Callback counter to trigger re-render counter: 0 }; }, mounted() { this._name = "", this._loadingIcon = null, this.iconMounted = !0; }, unmounted() { this.abortLoading(); }, methods: { abortLoading() { this._loadingIcon && (this._loadingIcon.abort(), this._loadingIcon = null); }, // Get data for icon to render or null getIcon(e, t) { if (typeof e == "object" && e !== null && typeof e.body == "string") return this._name = "", this.abortLoading(), { data: ne(e) }; let n; if (typeof e != "string" || (n = oe(e, !1, !0)) === null) return this.abortLoading(), null; const r = _t(n); if (r === null) return (!this._loadingIcon || this._loadingIcon.name !== e) && (this.abortLoading(), this._name = "", this._loadingIcon = { name: e, abort: cn([n], () => { this.counter++; }) }), null; this.abortLoading(), this._name !== e && (this._name = e, t && t(e)); const o = ["iconify"]; return n.prefix !== "" && o.push("iconify--" + n.prefix), n.provider !== "" && o.push("iconify--" + n.provider), { data: r, classes: o }; } }, // Render icon render() { this.counter; const e = this.$attrs, t = this.iconMounted ? this.getIcon(e.icon, e.onLoad) : null; if (!t) return Ne(bn, e); let n = e; return t.classes && (n = { ...e, class: (typeof e.class == "string" ? e.class + " " : "") + t.classes.join(" ") }), Ne(t.data, n); } }), vn = { class: "fixed z-10 inset-0 overflow-y-auto", id: "ModalBase" }, xn = { class: "flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0" }, wn = /* @__PURE__ */ g("div", { class: "absolute inset-0 bg-black opacity-75" }, null, -1), kn = { class: "fixed top-0 right-0 p-3" }, In = { class: "p-3 cursor-pointer rounded-full transition ease-in-out duration-150 hover:bg-gray-800" }, jn = /* @__PURE__ */ g("span", { class: "hidden sm:inline-block sm:align-middle sm:h-screen" }, " ", -1), at = A({ __name: "ModalBase", props: { destroyed: { type: [Function, () => { }], required: !1, default: () => { } }, innerClass: { type: String, required: !1, default: "" }, maxWidth: { type: String, required: !1, default: "sm:max-w-lg" } }, setup(e, { expose: t }) { const n = e, r = $(!1); ke(() => r.value = !0), It("Escape", (i) => { i.preventDefault(), o(); }); async function o() { r.value = !1, setTimeout(() => n.destroyed(), 200); } return t({ destroy: o }), (i, s) => (h(), y("div", vn, [ g("div", xn, [ v(he, { "enter-active-class": "ease-out duration-300", "enter-from-class": "opacity-0", "enter-to-class": "opacity-100", "leave-active-class": "ease-in duration-200", "leave-class": "opacity-100", "leave-to-class": "opacity-0" }, { default: z(() => [ r.value ? (h(), y("div", { key: 0, class: "fixed inset-0 transition-opacity", onClick: o }, [ wn, g("div", kn, [ g("div", In, [ v(w(j), { icon: "mdi-close", class: "w-6 h-6 text-gray-200 dark:text-gray-400" }) ]) ]) ])) : b("", !0) ]), _: 1 }), jn, v(he, { "enter-active-class": "ease-out duration-300", "enter-from-class": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95", "enter-to-class": "opacity-100 translate-y-0 sm:scale-100", "leave-active-class": "ease-in duration-200", "leave-class": "opacity-100 translate-y-0 sm:scale-100", "leave-to-class": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" }, { default: z(() => [ r.value ? (h(), y("div", { key: 0, class: C(["inline-block align-bottom bg-white dark:bg-gray-800 rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:w-full sm:p-6", [e.innerClass, e.maxWidth]]), role: "dialog", "aria-modal": "true", "aria-labelledby": "modal-headline" }, [ He(i.$slots, "default") ], 2)) : b("", !0) ]), _: 3 }) ]) ])); } }); function we(e) { e && e.parentNode.remove(); } function P(e, t, n, r) { var i; const o = document.createElement("div"); return r && r.forEach((s) => o.classList.add(s)), gt(A(n), t).mount( (i = document == null ? void 0 : document.getElementById(e)) == null ? void 0 : i.appendChild(o) ); } const Sn = { class: "sm:flex sm:items-center" }, Cn = { class: "mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left" }, Tn = { key: 0, class: "text-lg leading-6 font-medium text-gray-900 dark:text-gray-300 mb-1", id: "modal-headline" }, An = ["innerHTML"], En = { key: 0, class: "mt-5 sm:mt-4 sm:flex sm:flex-row-reverse" }, _n = A({ __name: "GlobalModal", props: { type: { type: String, required: !1, default: "info" }, title: { type: [Boolean, String], required: !1, default: !1 }, body: { type: [Boolean, String], required: !1, default: !1 }, primary: [Boolean, Object], secondary: [Boolean, Object] }, setup(e) { const t = e, n = $(!1), r = $(null), o = $(null), i = { success: "bg-green-100 dark:bg-green-900", info: "bg-blue-100 dark:bg-blue-900", danger: "bg-red-100 dark:bg-red-900", warning: "bg-yellow-100 dark:bg-yellow-900" }; ke(() => { n.value = !0, setTimeout(() => { var l; t.primary && r && r.value && ((l = r == null ? void 0 : r.value) == null || l.$el.focus()); }, 200); }); async function s(l) { var c; o && ((c = o == null ? void 0 : o.value) == null || c.destroy()), l === "primary" && t.primary && t.primary.action(), l === "secondary" && t.secondary && t.secondary.action(); } async function a() { var l; n.value = !1, we((l = o == null ? void 0 : o.value) == null ? void 0 : l.$el); } return (l, c) => (h(), S(at, { ref_key: "modalBaseRef", ref: o, active: n.value, destroyed: a }, { default: z(() => [ g("div", Sn, [ g("div", { class: C([i[e.type], "mx-auto flex-shrink-0 self-start flex items-center justify-center h-12 w-12 rounded-full sm:mx-0 sm:h-10 sm:w-10"]) }, [ e.type === "success" ? (h(), S(w(j), { key: 0, icon: "mdi-check", class: "h-5 w-5 text-green-500" })) : b("", !0), e.type === "info" ? (h(), S(w(j), { key: 1, icon: "bi-info-lg", class: "h-5 w-5 text-blue-500" })) : b("", !0), e.type === "danger" ? (h(), S(w(j), { key: 2, icon: "mdi-exclamation-thick", class: "h-5 w-5 text-red-500" })) : b("", !0), e.type === "warning" ? (h(), S(w(j), { key: 3, icon: "mdi-exclamation-thick", class: "h-5 w-5 text-yellow-500" })) : b("", !0) ], 2), g("div", Cn, [ e.title ? (h(), y("h3", Tn, _(e.title), 1)) : b("", !0), e.body ? (h(), y("p", { key: 1, class: "text-sm leading-5", innerHTML: e.body }, null, 8, An)) : b("", !0) ]) ]), e.primary ? (h(), y("div", En, [ e.primary ? (h(), S(me, { key: 0, ref_key: "primaryRef", ref: r, class: "flex w-full rounded-md shadow-sm sm:ml-3 sm:w-auto", theme: e.primary.theme, onClick: c[0] || (c[0] = (u) => s("primary")) }, { default: z(() => [ Oe(_(e.primary.label), 1) ]), _: 1 }, 8, ["theme"])) : b("", !0), e.secondary ? (h(), S(me, { key: 1, class: "mt-3 flex w-full rounded-md shadow-sm sm:mt-0 sm:w-auto", theme: e.secondary.theme, onClick: c[1] || (c[1] = (u) => s("secondary")) }, { default: z(() => [ Oe(_(e.secondary.label), 1) ]), _: 1 }, 8, ["theme"])) : b("", !0) ])) : b("", !0) ]), _: 1 }, 8, ["active"])); } }); function ho() { const e = document.createElement("div"); return e.classList.add("z-30"), e.setAttribute("id", "modals"), document.body.appendChild(e), { show(t) { return typeof t == "string" && (t = { title: t }), P("modals", t, _n); } }; } const On = { key: 0, class: "border-2 border-green-200 rounded-full w-6 h-6 flex items-center justify-center" }, $n = { key: 1, class: "border-2 border-blue-200 rounded-full w-6 h-6 flex items-center justify-center" }, Mn = { key: 2, class: "border-2 border-yellow-200 rounded-full w-6 h-6 flex items-center justify-center" }, Ln = { key: 3, class: "border-2 border-red-200 rounded-full w-6 h-6 flex items-center justify-center" }, Pn = { key: 4, class: "rounded-full w-6 h-6 flex items-center justify-center" }, Fn = { key: 5, class: "rounded-full w-6 h-6 flex items-center justify-center" }, de = A({ __name: "GlobalToastIcons", props: { type: String }, setup(e) { const t = e; return (n, r) => t.type === "success" ? (h(), y("div", On, [ v(w(j), { icon: "mdi-check", class: "h-4 w-4 text-green-400" }) ])) : t.type === "info" ? (h(), y("div", $n, [ v(w(j), { icon: "bi-info-lg", class: "h-4 w-4 text-blue-4