import{u as x,G as T,H as O,r as b,q as R,w as W,W as j,$ as I,o as l,e as d,A as s,f as o,i as u,a3 as J,C as L,V as C,M as f,E as y,F as z,J as $,j as S,h as n,aG as F,aH as G,aM as H,O as h,a5 as U,B as g}from"./index.737529e8.1750111005555.js";import{S as q,C as K}from"./carousel.faa29078.1750111005555.js";const Q={key:0,class:"position-relative"},X={class:"pa-3 w-100 h-100",style:{"min-height":"190px"}},Y={class:"d-flex flex-row align-center gap-2 mb-3"},Z=["src"],ee=["src"],te={class:"font-weight-bold mb-0 d-flex align-center",style:{"min-height":"45px"}},se={class:"mb-0 text-caption"},oe={class:"d-flex flex-column gap-2 mb-2"},ae={class:"mb-0 font-weight-bold",style:{"font-size":"13px"}},le={class:"mb-0",style:{"font-size":"13px"}},ne={class:"mb-0",style:{"font-size":"13px"}},re={key:0,class:"d-flex justify-space-between align-center flex-row w-100 position-absolute",style:{top:"45%"}},ie={key:1,class:"text-center font-weight-bold"},ce="tabler-briefcase",de="tabler-map-pin",ue="tabler-device-laptop",he={__name:"vagas-home",setup(pe){const v=x("userData").value;T();const E=O(),_=b(!1),p=b([]),{width:w}=R(),r=b(!1);r.value=w.value<768,W(w,()=>{r.value=w.value<768}),j(()=>{D()});const D=async()=>{try{_.value=!0;let t={};t.prazo=!0,t.itensPerPage=12;let i=null;v&&v.id!==void 0&&v.id!==null?(i=v,t.userData=JSON.stringify(i)):x("permEndereco").value&&x("permEndereco").value.geolocation!==void 0&&x("permEndereco").value.geolocation!==null&&(i={endereco:{geolocation:x("permEndereco").value.geolocation}},t.userData=JSON.stringify(i));const m=await I("/vagas/getApprovedUsers",{method:"POST",body:t});if(!m){_.value=!1;return}console.log("Resposne API",m),p.value=m.vagas.filter(c=>c&&c.createdAt).sort((c,e)=>new Date(e.createdAt)-new Date(c.createdAt)),_.value=!1}catch(t){console.error("Erro ao obter dados da API:",t,t.response)}},A=t=>{E.push({name:"DetalhesVaga",params:{slug:t}})},a=b(0),N=()=>{a.value+=r?1:2,a.value>=p.value.length&&(a.value=0)},B=()=>{a.value-=r?1:2,a.value<0&&(a.value=p.value.length-1)},M=t=>t.length>45?t.substring(0,45)+"...":t;return(t,i)=>(l(),d(z,null,[s(p).length>0||s(_)?(l(),d("div",Q,[o(s(K),{"items-to-show":s(r)?1:4,ref:"carousel",modelValue:s(a),"onUpdate:modelValue":i[0]||(i[0]=m=>J(a)?a.value=m:null),autoplay:4e3,style:L(s(r)?"":"margin-left: 45px; margin-right: 45px;")},{slides:u(({slideWidth:m,currentSlide:c})=>[(l(!0),d(z,null,$(s(p),(e,P)=>(l(),S(s(q),{key:e.id},{default:u(()=>[n("div",X,[o(F,{class:"pa-0",elevation:P===c?4:2,onClick:V=>A(e.slug)},{default:u(()=>[o(G,{class:"pa-4 cursor-pointer position-relative flex-column text-left d-flex justify-start"},{default:u(()=>{var V,k;return[e.distance?(l(),S(H,{key:0,color:"primary",class:"mb-2 position-absolute",label:"",style:{"font-size":"12px",width:"fit-content !important",bottom:"10px",right:"10px"}},{default:u(()=>[y(h(e.distance.replace(" ",""))+" de você ",1)]),_:2},1024)):f("",!0),n("div",Y,[e.logo&&e.logo!=="none"?(l(),d("img",{key:0,src:e.logo,alt:"Logo da Empresa",width:"30px",height:"30px",style:{"border-radius":"5px"}},null,8,Z)):f("",!0),!e.logo||e.logo=="none"?(l(),d("img",{key:1,src:s(U),alt:"Logo da Empresa",width:"30px",height:"30px",style:{"border-radius":"5px"}},null,8,ee)):f("",!0),n("div",null,[n("h4",te,h(M(e.funcao)),1),n("p",se,h(e.empresa),1)])]),n("div",oe,[n("p",ae,[o(g,{icon:de,class:"mr-1"}),y(" "+h(((V=e.addressVaga)==null?void 0:V.city)+"/"+((k=e.addressVaga)==null?void 0:k.state)),1)]),n("p",le,[o(g,{icon:ue,class:"mr-1"}),y(" "+h(e.formaContrato),1)]),n("p",ne,[o(g,{icon:ce,class:"mr-1"}),y(" "+h(e.tipoVaga),1)])])]}),_:2},1024)]),_:2},1032,["elevation","onClick"])])]),_:2},1024))),128))]),_:1},8,["items-to-show","modelValue","style"]),s(r)?f("",!0):(l(),d("div",re,[o(C,{variant:"elevated",icon:"",onClick:B,color:"primary",size:"small"},{default:u(()=>[o(g,{icon:"tabler-caret-left-filled",color:"white",size:"25"})]),_:1}),o(C,{variant:"elevated",icon:"",onClick:N,color:"primary",size:"small"},{default:u(()=>[o(g,{icon:"tabler-caret-right-filled",color:"white",size:"25"})]),_:1})]))])):f("",!0),s(p).length===0&&!s(_)?(l(),d("h3",ie,[o(g,{icon:"tabler-mood-sad",size:"22",color:"primary"}),y(" Nenhuma vaga disponível no momento. ")])):f("",!0)],64))}};export{he as default};
