import{m as r,g as w}from"./index-CfNB1Cu0.js";const u=w(),m=(e,a)=>{const t=u(e).startOf("day").toDate(),s=u(a).endOf("day").toDate();return{startDate:t,endDate:s}},c=e=>e.map(a=>{const t={...a};return Object.keys(t).forEach(s=>{if(typeof t[s]=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(t[s]))try{const n=new Date(t[s]);isNaN(n.getTime())||(t[s]=n)}catch{}}),t}),p=async(e,a)=>{const t=new r,{startDate:s,endDate:n}=m(e,a),i=[{name:"StartDate",value:s.toISOString()},{name:"EndDate",value:n.toISOString()}],o=await t.callV2("[KY].[GetMechanicalLabActivity]",i);if(!o.ok)throw new Error(o.message);return c(o.data?.tables?.[0]?.rows||[])},D=async(e,a,t,s)=>{const n=new r,{startDate:i,endDate:o}=m(e,a),l=[{name:"StartDate",value:i.toISOString()},{name:"EndDate",value:o.toISOString()}];t&&t.trim()!==""&&l.push({name:"GradeName",value:t}),s&&s.trim()!==""&&l.push({name:"SectionName",value:s});const d=await n.callV2("[KY].[GetMechanicalSamplesByDate]",l);if(!d.ok)throw new Error(d.message);return c(d.data?.tables?.[0]?.rows||[])},v=async(e,a)=>{const t=new r,s=[];e&&e>0&&s.push({name:"HeatId",value:e}),a&&a.trim()!==""&&s.push({name:"StatusCode",value:a});const n=await t.callV2("[KY].[GetMechanicalSamplesByHeat]",s);if(!n.ok)throw new Error(n.message);return c(n.data?.tables?.[0]?.rows||[])},g=async()=>{const e=new r,a=[{name:"IncludeInactives",value:!1}],t=await e.callV2("[KY].[GetGrades]",a);if(!t.ok)throw new Error(t.message);return c(t.data?.tables?.[0]?.rows||[])},f=async()=>{const e=new r,a=[{name:"IncludeInactives",value:!1}],t=await e.callV2("[KY].[GetSections]",a);if(!t.ok)throw new Error(t.message);return c(t.data?.tables?.[0]?.rows||[])},h=async()=>{const e=new r,a=[],t=await e.callV2("[KY].[GetCatMechanicalTests]",a);if(!t.ok)throw new Error(t.message);return c(t.data?.tables?.[0]?.rows||[])};export{g as a,f as b,D as c,h as d,v as e,p as g};
//# sourceMappingURL=repositories-BXRIMCOg.js.map
