import{ai as u,b0 as r}from"./index-BMKwTcAk.js";class d{getAxiosInstance(){return u}async getTundishes(){return(await this.getAxiosInstance().get("/tundish")).data}async getTundishAll(a=null){try{return{ok:!0,data:(await this.getAxiosInstance().get("/tundish/all",{params:{isTracked:a}})).data}}catch(t){return{ok:!1,message:r(t)}}}async getParts(a){return{error:!1,data:(await this.getAxiosInstance().get("/root/parts",{params:{componentTypeId:a}})).data}}async getTundishPlantOverview(){return{error:!1,data:(await this.getAxiosInstance().get("/tundish/plant-overview")).data}}async getRootDetails(a){return{error:!1,data:(await this.getAxiosInstance().get("/tundish/details",{params:{rootId:a}})).data}}async changeRootLocation({rootId:a=null,locationId:t}){return(await this.getAxiosInstance().patch("/tundish/location",{},{params:{rootId:a,locationId:t}})).data}async setRootState(a){const t=await this.getAxiosInstance().patch("/Root/status",{},{params:{...a}});return t.data.success?{ok:!0,data:t.data}:Promise.reject(t.data)}async getComponentsListForTundishId(a){const t=await this.getAxiosInstance().get(`/tundish/${a}/components`);return t.status==200?{ok:!0,data:t.data}:{ok:!1,data:t.data}}async getSpecialComponentsListForTundishId(a){const t=await this.getAxiosInstance().get("/special-components",{params:{tundishId:a}});return t.status!==200?{error:!1,data:t.data}:{error:!0,data:t.data}}async getCampaignsForComponent(a,t){const s=await this.getAxiosInstance().get(`/tundish/${a}/components/${t}/campaigns`);return s.status===200?{error:!1,data:s.data}:{error:!0,data:s.data}}async getTundishTasks(a,t={}){const s=await this.getAxiosInstance().get(`/Tundish/${a}/tasks`,{params:{...t}});return s.status!==200?{error:!1,data:s.data}:{error:!0,data:s.data}}async getTundishHeats(a,t={}){const s=await this.getAxiosInstance().get(`/Tundish/${a}/heats`,{params:{...t}});return s.status!==200?{error:!1,data:s.data}:{error:!0,data:s.data}}async getCampaignList(){const a=await this.getAxiosInstance().get("/Tundish/campaigns");return a.status!==200?{error:!1,data:a.data}:{error:!0,data:a.data}}async getTundishBuildLog(a){const{startDateTime:t,endDateTime:s,interval:n,sequenceName:o,tundishes:i}=a,e=await this.getAxiosInstance().get("/sequence/all-by-tundish",{params:{interval:n,start:t,end:s,sequenceName:o,tundishesCSV:i?.join(",")||"All"}});return e.status===200?{error:!1,data:e.data}:{error:!0,data:e.data}}async getTundishTrackReport(a){const t=await this.getAxiosInstance().post("/Backend/Execute",{method:"NSB.TundishReport",parameters:[{name:"Start",value:a.start},{name:"End",value:a.end}]});return t.status===200?{ok:!0,data:t.data}:{ok:!1,data:t.data}}async getHeatEventsForTundish(a,t={}){const s=await this.getAxiosInstance().get("/heat/events",{params:{rootId:a,start:t.from||null,end:t.to||null}});return s.status!==200?{error:!1,data:s.data}:{error:!0,data:s.data}}async getRootEvents(a){const t=await this.getAxiosInstance().get("/root/events",{params:{...a}});return t.status===200?{ok:!0,data:t.data}:{ok:!1,data:t.data}}async getTundishById(a){const t=await this.getAxiosInstance().get(`/tundish/${a}`);return t.status===200?{ok:!0,data:t.data}:{ok:!1,data:t.data}}async changeRootStatus(a){try{const t=await this.getAxiosInstance().patch("/tundish/status",{},{params:{...a}});return t.data.success?{ok:!0,data:t.data.result}:t.data}catch(t){return{ok:!1,data:r(t)}}}async putTundishInOOS(a){const t=await this.getAxiosInstance().post(`/special-components/${a}/oos`);return t.status===200?{ok:!0,data:t.data}:{ok:!1,data:t.data}}}const g=new d;export{g as t};
//# sourceMappingURL=tundishes.repository-aWJragtn.js.map
