import{_ as I}from"./yKVtex9U.js";import{_ as F}from"./gxHWKiUc.js";import{_ as E}from"./BHFADP6o.js";import{_ as R}from"./4FMzYxPj.js";import P from"./Cr9ZZaT-.js";import B from"./BBDFeM-T.js";import{A as _}from"./Bli8EQqv.js";import{U as N}from"./CRodc3LN.js";import{d as A,c as O,O as U,P as L,b as d,o as c,w as t,e as b,f as a,E as r,Y as T,g as e,Z as C,$ as K,i as M}from"./JQJBiNWj.js";import{u as D}from"./DncddsCV.js";import{u as z}from"./G-fJibjS.js";const V={class:"base-grid"},$={class:"col-span-12 lg:col-span-5"},j={class:"grid grid-cols-2 gap-4"},W={class:"col-span-12 lg:col-span-7"},X=A({__name:"CardLocalizacao",props:{showPista:{type:Boolean,default:!1},showFaixa:{type:Boolean,default:!1},showExtensao:{type:Boolean,default:!1},showKmInicial:{type:Boolean,default:!0},showKmFinal:{type:Boolean,default:!0},showSentido:{type:Boolean,default:!0},showDirecao:{type:Boolean,default:!0}},async setup(Y){let m,v;const u=D(),h=O(()=>{var g,p,l,s,n,f;function o(w){const S=Number(w);return isNaN(S)?0:S}return{lat:o((l=(p=(g=u==null?void 0:u.value)==null?void 0:g.fields)==null?void 0:p.latitudeReferencial)==null?void 0:l.states.value),lng:o((f=(n=(s=u==null?void 0:u.value)==null?void 0:s.fields)==null?void 0:n.longitudeReferencial)==null?void 0:f.states.value)}}),i=z(),k=U(),y=([m,v]=L(()=>k.getEmpresaSelecionada()),m=await m,v(),m);async function x(o){return await M.rodovias.getByEmpresa(y.sigla,o)}return(o,g)=>{const p=I,l=F,s=B,n=P,f=E,w=R;return c(),d(w,{title:"Localização"},{default:t(()=>[b("div",V,[b("div",$,[b("div",j,[a(l,{name:"idRodovia",label:"Rodovia:"},{default:t(()=>[a(p,{id:"rodovias",name:"idRodovia","async-fn":x,"option-label":"descricao","option-value":"id","paginated-data-key":"rodovias",disabled:!e(i)},null,8,["disabled"])]),_:1}),a(l,{name:"uf",label:"UF:"},{default:t(()=>[a(s,{id:"uf",name:"uf",options:e(N),"option-label":"sigla","option-value":"sigla",placeholder:"Selecione a UF...",disabled:!e(i),class:"w-full"},null,8,["options","disabled"])]),_:1}),o.showSentido?(c(),d(l,{key:0,name:"sentido",label:"Sentido:"},{default:t(()=>[a(s,{id:"sentido",name:"sentido",disabled:!e(i),options:e(_).TIPO_SENTIDO,"option-label":"label","option-value":"value",placeholder:"Selecione...",class:"w-full"},null,8,["disabled","options"])]),_:1})):r("",!0),o.showDirecao?(c(),d(l,{key:1,name:"direcao",label:"Direção:"},{default:t(()=>[a(s,{id:"direcao",name:"direcao",options:e(_).TIPO_DIRECAO,"option-label":"label","option-value":"value",disabled:!e(i),placeholder:"Selecione...",class:"w-full"},null,8,["options","disabled"])]),_:1})):r("",!0),o.showKmInicial?(c(),d(l,{key:2,name:"kmInicial",label:"Km inicial:"},{default:t(()=>[a(n,{id:"kmInicial",name:"kmInicial",disabled:!e(i),"min-fraction-digits":3,"max-fraction-digits":3,class:"w-full"},null,8,["disabled"])]),_:1})):r("",!0),o.showKmFinal?(c(),d(l,{key:3,name:"kmFinal",label:"Km final:"},{default:t(()=>[a(n,{id:"kmFinal",name:"kmFinal",disabled:!e(i),"min-fraction-digits":3,"max-fraction-digits":3,class:"w-full"},null,8,["disabled"])]),_:1})):r("",!0),a(l,{name:"latitudeReferencial",label:"Latitude:"},{default:t(()=>[a(n,{id:"latitudeReferencial",name:"latitudeReferencial",disabled:!e(i),"min-fraction-digits":7,"max-fraction-digits":7,class:"w-full"},null,8,["disabled"])]),_:1}),a(l,{name:"longitudeReferencial",label:"Longitude:"},{default:t(()=>[a(n,{id:"longitudeReferencial",name:"longitudeReferencial",disabled:!e(i),"min-fraction-digits":7,"max-fraction-digits":7,class:"w-full"},null,8,["disabled"])]),_:1}),o.showPista?(c(),d(l,{key:4,name:"pista",label:"Pista:"},{default:t(()=>[a(s,{id:"pista",name:"pista",disabled:!e(i),options:e(_).TIPO_PISTA,"option-label":"label","option-value":"value",placeholder:"Selecione...",class:"w-full"},null,8,["disabled","options"])]),_:1})):r("",!0),o.showFaixa?(c(),d(l,{key:5,name:"faixa",label:"Faixa:"},{default:t(()=>[a(s,{id:"faixa",name:"faixa",disabled:!e(i),options:e(_).TIPO_FAIXA,"option-label":"label","option-value":"value",placeholder:"Selecione...",class:"w-full"},null,8,["disabled","options"])]),_:1})):r("",!0),a(l,{name:"kmReferencial",label:"Km referencial:"},{default:t(()=>[a(n,{id:"kmReferencial",name:"kmReferencial",disabled:!e(i),"min-fraction-digits":3,"max-fraction-digits":3,class:"w-full"},null,8,["disabled"])]),_:1}),o.showExtensao?(c(),d(l,{key:6,name:"extensao",label:"Extensão:"},{default:t(()=>[a(n,{id:"extensao",name:"extensao",disabled:!e(i),"min-fraction-digits":3,"max-fraction-digits":3,class:"w-full"},null,8,["disabled"])]),_:1})):r("",!0),T(o.$slots,"default",C(K({isEditMode:e(i)})))])]),b("div",W,[a(f,{lat:e(h).lat,lng:e(h).lng},null,8,["lat","lng"])])])]),_:3})}}}),te=Object.assign(X,{__name:"AtivosElementoCardLocalizacao"});export{te as _};
