1import{u as D}from"./BypGwF3g.js";import{J as T,N as L,Z as i,_ as s,a2 as n,a5 as y,a6 as u,a9 as o,a3 as V,a4 as $,a7 as j,R as f,F as B,aC as g,aj as N}from"./De_JQGIt.js";import"./d91llZ03.js";import"./C1lDWwJr.js";import"./BJ2ClxiI.js";import"./BvcsRRMo.js";const R={class:"b-documento"},U={class:"doc-text"},E={key:0},O={key:0,class:"copy-tooltip"},F={key:1},I={class:"doc-parent"},J={class:"text-resol"},S={key:0,class:"copy-tooltip"},A={class:"d-flex align-items-center flex-nowrap mt-2 w-ph-100 doc-actions"},P={key:0},Z={key:1,class:"ms-2"},q={key:0,class:"children"},z={style:"padding-left: 30px"},G={key:0,class:"mt-2 mb-2"},H={class:"count-pill",id:"expandChip"},K=T({__name:"DocumentTree",props:{item:{}},setup(t){const{donwloadTransparencyDocument:w}=D(),b=t,p=f(null),c=f(!1),x=B(()=>b.item?.children_document?(p.value&&p.value.scrollIntoView({behavior:"smooth",block:"start"}),c.value?b.item.children_document:b.item.children_document.slice(0,2)):[]),m=f(!1),h=async(r,e)=>{m.value=!0;try{const l=await w(r);if(l){const a=window.URL.createObjectURL(l),d=document.createElement("a");d.href=a,d.download=e,d.click(),window.URL.revokeObjectURL(a),m.value=!1}}catch(l){m.value=!1;const a=l;if(a?.status==404){if(a?.response._data instanceof Blob){const d=await a?.response._data.text(),C=JSON.parse(d);g.warning(C.message??"Error inesperado");return}return}g.warning("Error inesperado al descargar el documento, intentalo nuevamente màs tarde.")}},v=f(!1),k=async r=>{if(r)try{await navigator.clipboard.writeText(r),v.value=!0,setTimeout(()=>{v.value=!1},1500)}catch{}};return(r,e)=>{const l=L("DocumentTree",!0);return i(),s("div",null,[n("div",R,[n("div",U,[t.item?.parent_id?o("",!0):(i(),s("div",E,[n("h5",null,[y(u(t.item?.name)+" "+u(t.item?.year?" - año "+t.item?.year:""),1),t.item?.file&&t.item?.file?.url?(i(),s("button",{key:0,class:"btn-copy-link",onClick:e[0]||(e[0]=a=>k(t.item?.file?.url)),title:"Copiar ruta"},[e[5]||(e[5]=n("i",{class:"fa-regular fa-copy"},null,-1)),v.value?(i(),s("span",O,"¡Copiado!")):o("",!0)])):o("",!0)])])),t.item?.parent_id>0?(i(),s("div",F,[n("div",I,[e[7]||(e[7]=n("i",{class:"bi bi-arrow-90deg-right"},null,-1)),n("div",null,[n("span",J,u(t.item?.name),1),n("h5",null,[y(u(t.item.description),1),t.item?.file&&t.item?.file?.url?(i(),s("button",{key:0,class:"btn-copy-link",onClick:e[1]||(e[1]=a=>k(t.item?.file?.url)),title:"Copiar ruta"},[e[6]||(e[6]=n("i",{class:"fa-regular fa-copy"},null,-1)),v.value?(i(),s("span",S,"¡Copiado!")):o("",!0)])):o("",!0)])])])])):o("",!0)]),n("div",A,[t.item?.file&&t.item?.file?.url?(i(),s("a",{key:0,class:"btn btn-primary btn-lg link-down w-ph-100 mb-0",onClick:e[2]||(e[2]=a=>h(t.item.id,t.item?.file?.original_name))},[m.value?(i(),s("div",Z,[...e[9]||(e[9]=[n("span",null,"Descargarndo...",-1),n("span",{class:"spinner-border spinner-border-sm text-light ms-2",role:"status"},null,-1)])])):(i(),s("div",P,[...e[8]||(e[8]=[n("i",{class:"bi bi-download"},null,-1),n("span",null,"Descargar ",-1)])]))])):o("",!0)])]),t.item.children_document?.length?(i(),s("div",q,[n("div",z,[(i(!0),s(V,null,$(x.value,a=>(i(),j(l,{key:a.id,item:a},null,8,["item"]))),128)),t.item.children_document?.length>2?(i(),s("div",G,[c.value?(i(),s("button",{key:1,onClick:e[4]||(e[4]=a=>c.value=!1),class:"btn-expand"},[...e[12]||(e[12]=[n("i",{class:"bi bi-chevron-up"},null,-1),y(" Ver menos ",-1)])])):(i(),s("button",{key:0,onClick:e[3]||(e[3]=a=>c.value=!0),class:"btn-expand"},[e[10]||(e[10]=n("i",{class:"bi bi-chevron-down"},null,-1)),e[11]||(e[11]=n("span",{id:"expandLabel"},"Ver más",-1)),n("span",H,"+ "+u(t.item.children_document.length-2)+" registros",1)]))])):o("",!0)])])):o("",!0)])}}}),ee=Object.assign(N(K,[["__scopeId","data-v-cd86a1b2"]]),{__name:"DetailsDocumentTree"});export{ee as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.