import{d as g,s as f,r as p}from"./jwt-decode.esm-CuqABuF0.js";import"./router-C-Pd0gHD.js";import{B as w,a as m}from"./build-DxGR4qCc.js";import{a as S}from"./project-D3XwUmzI.js";import"./tables-BHu5fUrG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="58cd664b-5876-4b4a-9b8f-a6a8aed7955f",t._sentryDebugIdIdentifier="sentry-dbid-58cd664b-5876-4b4a-9b8f-a6a8aed7955f")}catch{}})();const x=g("build",()=>{const t=f([]),n=f([]),s=p(!1);let u=null;const l=new Map;async function o(e){const a=await w.list(e);return u===e&&(t.value=a),a}async function i(e){const a=await S.getStatus(e);return u===e&&(n.value=a),a}async function c(e){s.value=!0;try{const[a,r]=await Promise.all([o(e),i(e)]);return{builds:a,statuses:r}}finally{s.value=!1}}async function d(e){const a=l.get(e);if(a!==void 0)return a;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=[],n.value=[],l.clear())}function v(){u=null,t.value=[],n.value=[],l.clear(),s.value=!1}return{builds:t,deployStatuses:n,loading:s,fetchBuilds:o,fetchDeployStatuses:i,fetchAll:c,fetchBuildSpec:d,getLatestBuild:y,setProjectContext:b,resetStore:v}});export{x as u};
//# sourceMappingURL=buildStore-TWMCNaT8.js.map
