import{u}from"./vendor-query-CKQAY9LX.js";import{s as l}from"./index-DbhEjV5W.js";const c=e=>e?/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e):!1;function y(e){const r=c(e);return u({queryKey:["company-jobs",e],queryFn:async()=>{if(!e||!c(e))return[];const{data:s,error:t}=await l.from("jobs").select(`
id,
title,
location,
job_type,
description,
interview_questions,
created_at,
is_active,
is_featured,
salary_min,
salary_max,
salary_currency,
experience_level,
is_remote,
total_applications,
interview_score_threshold
`).eq("company_id",e).eq("is_active",!0).order("created_at",{ascending:!1});if(t)throw console.error("Error fetching company jobs:",t),t;return s||[]},enabled:!!e&&r})}function p(e){return u({queryKey:["company-job-stats",e],queryFn:async()=>{var a,n;if(!e)return null;const{data:r,error:s}=await l.from("jobs").select("id, is_active, is_featured").eq("company_id",e);if(s)throw console.error("Error fetching company job stats:",s),s;const t=(r==null?void 0:r.length)||0,o=((a=r==null?void 0:r.filter(i=>i.is_active))==null?void 0:a.length)||0,f=((n=r==null?void 0:r.filter(i=>i.is_featured))==null?void 0:n.length)||0;return{totalJobs:t,activeJobs:o,featuredJobs:f,inactiveJobs:t-o,totalApplications:0}},enabled:!!e})}export{p as a,c as i,y as u};