import { defineComponent as n, renderSlot as c, openBlock as d, createElementBlock as u, pushScopeId as p, popScopeId as _, createElementVNode as r, ref as i, onMounted as f, createBlock as h, unref as v, withCtx as l, createVNode as m } from "vue";
import { useRouter as k } from "vue-router";
const w = /* @__PURE__ */ n({
  name: "If",
  __name: "If",
  props: {
    when: {}
  },
  setup(t) {
    const o = (e) => e;
    return (e, s) => e.when ? c(e.$slots, "default", {
      key: 0,
      value: o(e.when)
    }) : c(e.$slots, "fallback", { key: 1 });
  }
}), g = (t) => (p("data-v-36acc161"), t = t(), _(), t), I = { class: "fs-loading" }, y = /* @__PURE__ */ g(() => /* @__PURE__ */ r("div", { class: "typewriter" }, [
  /* @__PURE__ */ r("div", { class: "slide" }, [
    /* @__PURE__ */ r("i")
  ]),
  /* @__PURE__ */ r("div", { class: "paper" }),
  /* @__PURE__ */ r("div", { class: "keyboard" })
], -1)), P = [
  y
], $ = /* @__PURE__ */ n({
  __name: "Loading",
  setup(t) {
    return (o, e) => (d(), u("div", I, P));
  }
}), S = (t, o) => {
  const e = t.__vccOpts || t;
  for (const [s, a] of o)
    e[s] = a;
  return e;
}, b = /* @__PURE__ */ S($, [["__scopeId", "data-v-36acc161"]]), C = /* @__PURE__ */ n({
  __name: "FsAuthProvider",
  props: {
    errorPath: { default: "/error" },
    authProvider: {}
  },
  setup(t) {
    const o = t, e = i(!1), s = k();
    return f(() => {
      e.value = !0, o.authProvider.checkAuth().then(
        () => {
          e.value = !1;
        },
        () => {
          e.value = !1, s.replace(o.errorPath);
        }
      );
    }), (a, x) => (d(), h(v(w), { when: e.value }, {
      fallback: l(() => [
        c(a.$slots, "loading", {}, () => [
          m(b)
        ])
      ]),
      default: l(() => [
        c(a.$slots, "default")
      ]),
      _: 3
    }, 8, ["when"]));
  }
});
export {
  C as default
};
//# sourceMappingURL=FsAuthProvider.mjs.map
