import { useApiClient } from "./useApi.js";
import { c } from "react/compiler-runtime";
import { useMutation, useQueryClient } from "@tanstack/react-query";
function useRunPipeline() {
	let a = c(7), { api: o } = useApiClient(), s = useQueryClient(), l;
	a[0] === o ? l = a[1] : (l = (e) => {
		if (!o) throw Error("API not available");
		return o.ApiV1ProcessorApi.processorControllerRunPipeline(e);
	}, a[0] = o, a[1] = l);
	let u;
	a[2] === s ? u = a[3] : (u = () => {
		console.log("success"), s.invalidateQueries({ queryKey: ["pipelines"] });
	}, a[2] = s, a[3] = u);
	let d;
	return a[4] !== l || a[5] !== u ? (d = {
		mutationFn: l,
		onSuccess: u,
		onError: _temp
	}, a[4] = l, a[5] = u, a[6] = d) : d = a[6], useMutation(d);
}
function _temp(e) {
	console.error("Error:", e);
}
export { useRunPipeline };
