import{d as g,s as i,r as p}from"./jwt-decode.esm-CzNJpMna.js";import"./router-W58Zb32N.js";import{B as w,a as m}from"./build-DOCjIYzy.js";import{a as S}from"./project-CUN2uQd6.js";import"./tables-B14bH8Kr.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="d967d1e0-8c8d-4c79-b8cb-5429594354c4",t._sentryDebugIdIdentifier="sentry-dbid-d967d1e0-8c8d-4c79-b8cb-5429594354c4")}catch{}})();const x=g("build",()=>{const t=i([]),s=i([]),a=p(!1);let u=null;const l=new Map;async function c(e){const n=await w.list(e);return u===e&&(t.value=n),n}async function o(e){const n=await S.getStatus(e);return u===e&&(s.value=n),n}async function f(e){a.value=!0;try{const[n,r]=await Promise.all([c(e),o(e)]);return{builds:n,statuses:r}}finally{a.value=!1}}async function d(e){const n=l.get(e);if(n!==void 0)return n;const r=await m.get(e);return l.set(e,r),r}function y(){return t.value.find(e=>e.latest)}function b(e){u!==e&&(u=e,t.value=[],s.value=[],l.clear())}function v(){u=null,t.value=[],s.value=[],l.clear(),a.value=!1}return{builds:t,deployStatuses:s,loading:a,fetchBuilds:c,fetchDeployStatuses:o,fetchAll:f,fetchBuildSpec:d,getLatestBuild:y,setProjectContext:b,resetStore:v}});export{x as u};
//# sourceMappingURL=buildStore-CDm6Uq4s.js.map
