import{S as k}from"./SectionTitle-CrHOP_mf.js";import{g as x,u as y,c as u,r as b,d as n,l as d,w as M,F as p,f as g,b as o,m as V,e as l,t as m,i as S,j as T,z as w,s as Z,L as j}from"./index-BmU8V2V2.js";const B=async()=>{try{const{data:a}=await x.get("/accesoinformacion-all");return a}catch(a){throw console.log(a),new Error("Error getting acceso informacion")}},A={class:"mx-auto py-8 px-4 sm:px-6 lg:px-8 max-w-5xl mb-8"},N=["onClick"],z={class:"flex items-center"},$={key:0,xmlns:"http://www.w3.org/2000/svg",class:"flex-shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},E={key:1,xmlns:"http://www.w3.org/2000/svg",class:"flex-shrink-0 h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},F={key:0},G={class:"flex flex-col gap-3"},I=["onClick"],R={class:"font-semibold"},q=["innerHTML"],U={__name:"TransparencyAccessView",setup(a){const f="https://www.gasesdeloriente.com.co",{data:c}=y({queryKey:["accesoInformacion"],queryFn:()=>B(),staleTime:6e4}),v=u(()=>{var e;return((e=c==null?void 0:c.value)==null?void 0:e.categorias)||[]}),L=u(()=>Z.contrast),r=b(null),C=e=>{r.value=r.value===e?null:e},h=e=>{e.tipo!=="ninguno"&&(e.tipo==="archivo"&&e.archivo&&e.archivo!==""?window.open(`${f}/${e.archivo}`,"_blank"):e.tipo==="url"&&e.url&&e.url!==""&&window.open(e.url,"_blank"))};return(e,s)=>{const _=j("IconoLlama");return o(),n("div",A,[d(k,null,{default:M(()=>s[0]||(s[0]=[V("Transparencia y acceso a la informacion")])),_:1}),(o(!0),n(p,null,g(v.value,i=>(o(),n("div",{key:i.categoria_id,class:"select-none mt-4"},[l("div",{class:S([{"bg-black":L.value,"bg-white":!L.value},"text-lg font-bold mb-4 cursor-pointer shadow-lg p-4 rounded-lg flex items-center justify-between"]),onClick:t=>C(i.categoria_id)},[l("div",z,[d(_),l("span",null,m(i.categoria_nombre),1)]),r.value===i.categoria_id?(o(),n("svg",$,s[1]||(s[1]=[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"},null,-1)]))):(o(),n("svg",E,s[2]||(s[2]=[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])))],10,N),r.value===i.categoria_id?(o(),n("div",F,[(o(!0),n(p,null,g(i.records,t=>(o(),n("div",{key:t.id},[l("div",G,[l("div",{class:"flex justify-start items-center gap-3 cursor-pointer hover:bg-gray-100 p-2 rounded-lg",onClick:H=>h(t||"")},[s[3]||(s[3]=T('',1)),l("span",R,m((t==null?void 0:t.subtitulo)||""),1)],8,I),t!=null&&t.item?(o(),n("div",{key:0,class:"whitespace-pre-line",innerHTML:t==null?void 0:t.item},null,8,q)):w("",!0)])]))),128))])):w("",!0)]))),128))])}}};export{U as default};