import{d as p,s as f,r as w}from"./jwt-decode.esm-C7p7KYmD.js";import"./router-KqhyGitc.js";import{B as b,a as m}from"./build-C2PNLEnH.js";import{a as S}from"./project-CR7-nfeN.js";import"./tables-BD2MpLEl.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]="3d2a1737-9ff0-4679-a672-dd6692936667",t._sentryDebugIdIdentifier="sentry-dbid-3d2a1737-9ff0-4679-a672-dd6692936667")}catch{}})();const x=p("build",()=>{const t=f([]),s=f([]),a=w(!1);let u=null;const l=new Map;async function o(e){const n=await b.list(e);return u===e&&(t.value=n),n}async function i(e){const n=await S.getStatus(e);return u===e&&(s.value=n),n}async function c(e){a.value=!0;try{const[n,r]=await Promise.all([o(e),i(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 v(e){u!==e&&(u=e,t.value=[],s.value=[],l.clear())}function g(){u=null,t.value=[],s.value=[],l.clear(),a.value=!1}return{builds:t,deployStatuses:s,loading:a,fetchBuilds:o,fetchDeployStatuses:i,fetchAll:c,fetchBuildSpec:d,getLatestBuild:y,setProjectContext:v,resetStore:g}});export{x as u};
//# sourceMappingURL=buildStore-BqeAAg6k.js.map
