import { _ as b } from "./loadernew-ac153a51.mjs";
import { D as g } from "./Header-41a943f5.mjs";
import { d as v, r, U as y, V as w, o as a, c as l, a as e, x as _, F as m, e as k, k as P, t as n, i as p, A as u, W as E, b as Y, _ as M } from "./main-d713f3d7.mjs";
import { c as S } from "./delphi_utils-ba62fcf4.mjs";
import "./genome-Logo-white-ffcf2413.mjs";
import "./PopupComponent-daa7c72d.mjs";
import "./Close-button-48e5479d.mjs";
import "./index-be6397c8.mjs";
const B = {
  key: 0,
  class: "flex h-screen flex-col"
}, D = { class: "flex" }, C = { class: "genpact-blue-box mt-14 flex flex-1 overflow-hidden" }, L = { class: "mx-auto md:w-11/12 lg:w-11/12 overflow-y-hidden" }, N = { class: "bot-start bg-gray-100 min-h-screen px-4 py-6 md:px-8 md:py-12 lg:px-8 lg:py-12" }, V = { class: "bot-inner" }, A = { class: "bot-body" }, T = { class: "mt-6 flex w-full justify-center" }, j = { class: "text-[15px] shadow fixed_headers checkBoxSize mb-4 w-full rounded bg-white" }, z = { class: "-text-blue-800 text-[15px] max-table-height flex w-full flex-col items-center overflow-y-auto opacity-80" }, F = { class: "p-2" }, q = { class: "p-2" }, G = { class: "p-2" }, H = { class: "p-2" }, I = { class: "p-2" }, R = {
  key: 1,
  class: "flex h-screen flex-col"
}, U = {
  key: 1,
  class: "h-min-screen flex flex-col justify-center text-center"
}, W = /* @__PURE__ */ v({
  __name: "PromptPastExecutions",
  setup(J) {
    const c = r(!1), i = r(), d = r(!1), x = r(), f = async () => {
      try {
        const { data: t } = await P("/delphi/prompt/executions/users");
        if (t && t.is_access_not_allowed) {
          c.value = !1, x.value = t.message;
          return;
        }
        i.value = t && t.data ? t.data : [], d.value = !0, console.log("all_executions", { data: i.value });
      } catch (t) {
        console.log("Error in fetching all prompts", { message: t.message });
      }
    };
    return y(async () => {
      c.value = await S(), c.value && await f();
    }), (t, s) => {
      const h = w("router-link");
      return d.value ? (a(), l(m, { key: 0 }, [
        c.value ? (a(), l("div", B, [
          e("nav", D, [
            _(g)
          ]),
          e("section", C, [
            e("div", L, [
              e("div", N, [
                e("div", V, [
                  s[2] || (s[2] = e("div", { class: "w-full" }, [
                    e("div", { class: "text-center text-3xl text-background-secondary" }, "Prompt Execution Lists")
                  ], -1)),
                  e("div", A, [
                    e("div", T, [
                      e("table", j, [
                        s[1] || (s[1] = e("thead", { class: "-text-blue-800 flex w-full text-left" }, [
                          e("tr", { class: "f14 z-10 flex w-full border-b bg-background-secondary text-white" }, [
                            e("th", { class: "p-2" }, "Prompt Name"),
                            e("th", { class: "p-2" }, "Start Time"),
                            e("th", { class: "p-2" }, "End Time"),
                            e("th", { class: "p-2" }, "Status"),
                            e("th", { class: "p-2" })
                          ])
                        ], -1)),
                        e("tbody", z, [
                          (a(!0), l(m, null, k(i.value, (o) => (a(), l("tr", {
                            key: o.execution_id,
                            class: "w-full border-b hover:bg-gray-300"
                          }, [
                            e("td", F, n(o.prompt_name), 1),
                            e("td", q, n(o.start_time ? p(u)(o.start_time).format("MMM Do YYYY, h:mm a") : ""), 1),
                            e("td", G, n(o.end_time ? p(u)(o.end_time).format("MMM Do YYYY, h:mm a") : ""), 1),
                            e("td", H, n(o.execution_status), 1),
                            e("td", I, [
                              _(h, {
                                to: { name: "PromptExecutionStatus", query: { execution_id: o.execution_id } },
                                class: "inline-block bg-background-secondary px-4 py-1 rounded text-white"
                              }, {
                                default: E(() => s[0] || (s[0] = [
                                  Y("Check Status")
                                ])),
                                _: 2,
                                __: [0]
                              }, 1032, ["to"])
                            ])
                          ]))), 128))
                        ])
                      ])
                    ])
                  ])
                ])
              ])
            ])
          ])
        ])) : (a(), l("div", R, "You don't have access"))
      ], 64)) : (a(), l("div", U, s[3] || (s[3] = [
        e("img", {
          class: "loadercss mx-auto mb-8 mt-3% block",
          src: b,
          alt: "Loader Gif"
        }, null, -1),
        e("p", { class: "loadertextcss ext-genpact-darkest-blue mx-auto mb-10 px-4 leading-normal" }, "Loading...", -1)
      ])));
    };
  }
});
const se = /* @__PURE__ */ M(W, [["__scopeId", "data-v-31ce63d1"]]);
export {
  se as default
};
