import{z as t}from"./outputWidgets.6e1c5425.js";import{w as r}from"./metadata.85c4f3ac.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="18dfe407-76ff-4b53-bb9f-8125a51e27a3",a._sentryDebugIdIdentifier="sentry-dbid-18dfe407-76ff-4b53-bb9f-8125a51e27a3")}catch{}})();const i=r.stages.flatMap(a=>a.transitions.flatMap(e=>e.typeName)),l=t.object({type:t.enum(["forms","hooks","jobs","scripts","conditions","iterators"]),id:t.string(),title:t.string(),position:t.object({x:t.number(),y:t.number()}),props:t.object({path:t.string().nullable(),filename:t.string().nullable(),variableName:t.string().nullable()})}),d=t.object({id:t.string(),type:t.enum(i),sourceStageId:t.string(),targetStageId:t.string(),props:t.object({conditionValue:t.string().nullable()})}),o=t.object({stages:t.array(l),transitions:t.array(d)}),f={"Content-Type":"application/json"},b="abstra-run-id";class u{async load(){const e=await fetch("/_editor/api/workflows");if(e.ok){const n=await e.json();return o.parse(n)}else throw new Error("Failed to fetch initial data")}async update(e){const n=await fetch("/_editor/api/workflows",{method:"PUT",headers:f,body:JSON.stringify(e)});if(n.ok){const s=await n.json();return o.parse(s)}else throw new Error("Failed to update workflow")}}export{b as A,u as W};
//# sourceMappingURL=api.6ad56b41.js.map
