1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3748],{91538:function(e,t,a){a.d(t,{P:function(){return i}});var r=a(57437),n=a(2265),o=a(71769),s=a(15863),l=a(20036);function i(e){let{recordId:t,enabled:a}=e,[i,c]=(0,n.useState)(null),[u,d]=(0,n.useState)(0),m=(0,l.BG)(t)?t:"";return((0,n.useEffect)(()=>{if(!a||!m)return;let e=new AbortController;return c({recordId:m,status:"loading",items:[]}),fetch("/api/harvester/related?oai_id=".concat(encodeURIComponent(m),"&limit=3"),{cache:"no-store",signal:e.signal}).then(async e=>{if(!e.ok)throw Error("HTTP ".concat(e.status));let t=await e.json();if((null==t?void 0:t.error)||(null==t?void 0:t.source)==="error")throw Error("Related records unavailable");c({recordId:m,status:"ready",items:(0,l.Jc)(t,m)})}).catch(()=>{e.signal.aborted||c({recordId:m,status:"failed",items:[]})}),()=>e.abort()},[a,m,u]),a&&m&&i&&i.recordId===m)?(0,r.jsxs)("aside",{"aria-label":"Otras lecturas del cat\xe1logo","data-academia-related":i.status,className:"mt-4 rounded-xl border border-gray-200 bg-gray-50/70 p-3 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,r.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold text-gray-800 dark:text-gray-200",children:[(0,r.jsx)(o.Z,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Otras lecturas del cat\xe1logo"]}),"loading"===i.status&&(0,r.jsxs)("p",{role:"status",className:"mt-2 flex items-center gap-1 text-xs text-gray-600 dark:text-gray-300",children:[(0,r.jsx)(s.Z,{className:"h-3 w-3 animate-spin","aria-hidden":"true"}),"Buscando registros relacionadosâ¦"]}),"failed"===i.status&&(0,r.jsxs)("p",{role:"status",className:"mt-2 text-xs text-gray-600 dark:text-gray-300",children:["No pude cargar otras lecturas. ",(0,r.jsx)("button",{type:"button",onClick:()=>d(e=>e+1),className:"font-semibold text-teal-700 underline dark:text-teal-300",children:"Reintentar"})]}),"ready"===i.status&&0===i.items.length&&(0,r.jsx)("p",{className:"mt-2 text-xs text-gray-600 dark:text-gray-300",children:"No hay otras lecturas verificables para este registro."}),"ready"===i.status&&i.items.length>0&&(0,r.jsx)("ul",{className:"mt-2 space-y-1.5",children:i.items.map(e=>(0,r.jsx)("li",{children:(0,r.jsxs)("a",{href:"/record/".concat(encodeURIComponent(e.id)),className:"block rounded-lg px-1 py-1 text-sm text-teal-800 hover:bg-teal-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-teal-500 dark:text-teal-300 dark:hover:bg-white/10",children:[(0,r.jsx)("span",{className:"line-clamp-2 block font-medium leading-5",children:e.title}),(0,r.jsxs)("span",{className:"block text-xs text-gray-600 dark:text-gray-400",children:[e.reason,e.author?" \xb7 ".concat(e.author):""]})]})},e.id))})]}):null}},44152:function(e,t,a){a.d(t,{Z:function(){return o}});var r=a(2265);function n(e){let t=JSON.stringify(e.filters),a=e.top_results.slice(0,10).map(e=>(e.oai_id||"").slice(0,24)).sort().join(",");return"si_".concat(e.query,"|").concat(t,"|").concat(a)}function o(e,t){let[a,o]=(0,r.useState)([]),[s,l]=(0,r.useState)("idle"),i=(0,r.useRef)(null),c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{var a;if(!t||!(null===(a=e.query)||void 0===a?void 0:a.trim())){i.current&&i.current.abort(),i.current=null,o([]),l("idle");return}return c.current&&clearTimeout(c.current),i.current&&i.current.abort(),i.current=null,o([]),l("idle"),c.current=setTimeout(async()=>{let t=n(e);try{let e=window.sessionStorage.getItem(t);if(e){let t=JSON.parse(e);if(t.ts&&Date.now()-t.ts<3e5){o(t.insights||[]),l("done");return}}}catch(e){}i.current=new AbortController;let a=i.current;o([]),l("streaming");try{let r=await fetch("/api/harvester/search/insights-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:a.signal});if(!r.ok||!r.body){l("error");return}let n=r.body.getReader(),s=new TextDecoder,i="",c=[];for(;;){let{done:e,value:t}=await n.read();if(e)break;let a=(i+=s.decode(t,{stream:!0})).split("\n\n");for(let e of(i=a.pop()||"",a))if(e.startsWith("data:"))try{let t=JSON.parse(e.slice(5).trim());"insight"===t.type&&t.insight?(c.push(t.insight),o([...c])):t.type}catch(e){}}l("done");try{window.sessionStorage.setItem(t,JSON.stringify({ts:Date.now(),insights:c}))}catch(e){}}catch(e){(null==e?void 0:e.name)!=="AbortError"&&l("error")}},800),()=>{c.current&&clearTimeout(c.current),i.current&&i.current.abort()}},[t,n(e)]),{insights:a,status:s}}},62462:function(e,t,a){a.d(t,{d:function(){return E}});var r=a(57437),n=a(2265),o=a(66949),s=a(76399),l=a(39711),i=a(92369),c=a(13420),u=a(61552),d=a(49465),m=a(63639),p=a(33327),g=a(69317),b=a(61476),f=a(31047),x=a(62720),h=a(95805),v=a(32489),y=a(15863),w=a(76858),k=a(55900),j=a(38220),N=a(63719);let _={library:o.Z,flame:s.Z,unlock:l.Z,user:i.Z,network:c.Z,question:u.Z,folder:d.Z,warning:m.Z,award:p.Z,compass:g.Z,gem:b.Z,calendar:f.Z,tag:x.Z,users:h.Z};function q(e){var t,a,r;if(e.origen)return"catalogo"===e.origen;let n=(null===(t=e.cta)||void 0===t?void 0:t.action)==="navigate"&&null!==(r=null===(a=e.cta.payload)||void 0===a?void 0:a.url)&&void 0!==r?r:"";return"string"==typeof n&&n.startsWith("/record/")}let A=e=>e?e.replace(/^\s*#+\s*/g,"").replace(/\*+([^*]+)\*+/g,"$1").replace(/_+([^_]+)_+/g,"$1").trim():e;function E(e){let{abierto:t,onCerrar:a,totalResultados:s,insights:l,estado:i,onInsightCta:c,onGenerarReporte:u,onRutaAprendizaje:d,onAtlas:p,onResearch:g,alcance:b=null,variante:f="drawer"}=e,x="drawer"===f,h=(0,N.s)(t&&x,a);return((0,n.useEffect)(()=>
1{if(!t||!x)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t,x]),t)?x?(0,r.jsxs)(r.Fragment,{children:[x&&(0,r.jsx)("div",{"aria-hidden":"true",onClick:a,className:"fixed inset-0 z-[145] bg-black/30 backdrop-blur-[2px] dark:bg-black/50"}),(0,r.jsx)("div",{ref:h,role:x?"dialog":"region","aria-modal":x?"true":void 0,"aria-labelledby":"drawer-bibliotecario-titulo",tabIndex:x?-1:void 0,className:x?"fixed right-0 top-0 z-[150] h-screen w-[min(360px,100vw)] p-3 outline-none":"mt-6 w-full animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,r.jsx)("div",{className:"".concat(x?"h-full shadow-2xl":"shadow-sm"," rounded-[20px] bg-[linear-gradient(160deg,rgba(20,184,166,0.7),rgba(232,183,58,0.3),transparent_80%)] p-px"),children:(0,r.jsxs)("div",{className:"".concat(x?"h-full overflow-y-auto":""," flex flex-col rounded-[19px] bg-white p-5 dark:bg-[#0a0a0a]"),children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"h-[7px] w-[7px] rounded-full bg-[#14b8a6] shadow-[0_0_10px_#14b8a6]"}),(0,r.jsx)("h2",{id:"drawer-bibliotecario-titulo",className:"text-[11px] font-bold tracking-[0.16em] text-[#0f766e] dark:text-[#14b8a6]",children:"BIBLIOTECARIO IA"}),x&&(0,r.jsx)("button",{type:"button",onClick:a,"aria-label":"Cerrar el panel del Bibliotecario IA",className:"ml-auto rounded-md p-1 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-white/[0.06] dark:hover:text-gray-200",children:(0,r.jsx)(v.Z,{className:"h-4 w-4","aria-hidden":"true"})})]}),(0,r.jsxs)("p",{className:"mb-3 font-serif text-[15px] leading-[1.45] text-gray-900 dark:text-gray-100",children:["De tus ",s.toLocaleString()," resultados, esto es lo que un referencista te se\xf1alar\xeda:"]}),b&&(0,r.jsx)("p",{className:"mb-3 rounded-[11px] border border-gray-200 bg-gray-50 px-3 py-2 text-[11.5px] leading-relaxed text-gray-600 dark:border-white/[0.07] dark:bg-white/[0.03] dark:text-gray-400",children:b}),(0,r.jsxs)("div",{className:"flex-1",children:[("idle"===i||"streaming"===i)&&0===l.length&&(0,r.jsxs)("div",{className:"space-y-2","aria-live":"polite",children:[(0,r.jsxs)("p",{className:"flex items-center gap-2 px-1 pb-1 text-[12px] text-gray-500 dark:text-gray-400",children:[(0,r.jsx)(y.Z,{className:"h-3.5 w-3.5 shrink-0 animate-spin","aria-hidden":"true"}),"El bibliotecario est\xe1 mirando tus resultadosâ¦"]}),(0,r.jsx)("div",{className:"h-16 animate-pulse rounded-xl bg-gray-100 dark:bg-white/[0.04]"}),(0,r.jsx)("div",{className:"h-16 animate-pulse rounded-xl bg-gray-100 dark:bg-white/[0.04]"})]}),"error"===i&&0===l.length&&(0,r.jsxs)("div",{className:"rounded-xl border border-warning/30 bg-warning/5 p-3",children:[(0,r.jsxs)("p",{className:"flex items-center gap-2 text-[13px] font-medium text-gray-800 dark:text-gray-200",children:[(0,r.jsx)(m.Z,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),"No se pudo consultar al bibliotecario."]}),(0,r.jsx)("p",{className:"mt-1 text-[12px] text-gray-600 dark:text-gray-400",children:x?"Tus resultados est\xe1n completos: lo que falta es el comentario sobre ellos. Volv\xe9 a abrir el panel en un momento.":"Tus resultados est\xe1n completos: s\xf3lo falt\xf3 actualizar el an\xe1lisis del Bibliotecario IA. Haz una nueva exploraci\xf3n para intentarlo otra vez."})]}),"done"===i&&0===l.length&&(0,r.jsx)("p",{className:"rounded-xl border border-gray-200 p-3 text-[12.5px] text-gray-600 dark:border-white/[0.07] dark:text-gray-400",children:"El bibliotecario revis\xf3 estos resultados y no encontr\xf3 nada que valga la pena se\xf1alar. No es una falla: no hay hallazgo."}),(0,r.jsx)("div",{role:"list","aria-live":"polite","aria-label":"Hallazgos del Bibliotecario IA",children:l.map(e=>{let t=_[e.icon]||o.Z;return(0,r.jsxs)("div",{role:"listitem",className:"flex gap-[11px] rounded-[11px] px-2 py-2.5 transition-colors hover:bg-[#14b8a6]/[0.07]",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"grid h-7 w-7 shrink-0 place-items-center rounded-[9px] border border-gray-200 bg-gray-50 text-gray-600 dark:border-white/[0.07] dark:bg-white/[0.03] dark:text-gray-300",children:(0,r.jsx)(t,{className:"h-3.5 w-3.5"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[9.5px] font-bold tracking-[0.12em] text-gray-500 dark:text-gray-400",children:e.label}),q(e)&&(0,r.jsx)("span",{title:"Este hallazgo sale del cat\xe1logo de tu biblioteca, no del material externo que est\xe1s viendo",className:"text-[9.5px] font-semibold tracking-[0.06em] text-gray-400 dark:text-gray-500",children:"\xb7 de tu cat\xe1logo"}),e.count&&(0,r.jsx)("span",{className:"rounded bg-gray-100 px-1.5 font-mono text-[10px] font-semibold text-gray-700 dark:bg-white/[0.06] dark:text-gray-300",children:e.count})]}),(0,r.jsx)("div",{className:"text-[12.5px] font-semibold leading-[1.35] text-gray-900 dark:text-white",children:A(e.title)}),(0,r.jsx)("div",{className:"text-[11px] text-gray-500 dark:text-gray-400",children:A(e.body)}),e.cta&&(0,r.jsxs)("button",{type:"button",onClick:()=>
1c(e.cta,e),className:"mt-1 inline-flex items-center gap-1 text-[11.5px] font-semibold text-[#0f766e] hover:underline dark:text-[#14b8a6]",children:[e.cta.label,(0,r.jsx)(w.Z,{className:"h-3 w-3","aria-hidden":"true"})]})]})]},e.id)})})]}),(0,r.jsxs)("div",{className:"mt-3 flex shrink-0 gap-2",children:[u&&(0,r.jsx)("button",{type:"button",onClick:u,className:"flex-1 rounded-[11px] bg-[#14b8a6] px-3 py-2.5 text-[12px] font-semibold text-[#04211d] transition-[filter] hover:brightness-[1.08]",children:"Generar reporte IA"}),(0,r.jsxs)("button",{type:"button",onClick:d,className:"flex flex-1 items-center justify-center gap-1.5 rounded-[11px] border border-gray-200 px-3 py-2.5 text-[12px] font-semibold text-gray-800 transition-colors hover:border-[#14b8a6]/50 hover:text-[#0f766e] dark:border-white/[0.07] dark:text-gray-200 dark:hover:text-[#14b8a6]",children:[(0,r.jsx)(k.Z,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Ruta de aprendizaje"]})]})]})})})]}):(0,r.jsx)(z,{totalResultados:s,insights:l,estado:i,onInsightCta:c,onRutaAprendizaje:d,onAtlas:p,onResearch:g,alcance:b}):null}let C=["border-emerald-200/80 bg-emerald-50/80 dark:border-emerald-400/15 dark:bg-emerald-950/25","border-amber-200/80 bg-amber-50/80 dark:border-amber-400/15 dark:bg-amber-950/25","border-sky-200/80 bg-sky-50/80 dark:border-sky-400/15 dark:bg-sky-950/25","border-rose-200/70 bg-rose-50/70 dark:border-rose-400/15 dark:bg-rose-950/20"];function z(e){let{totalResultados:t,insights:a,estado:n,onInsightCta:s,onRutaAprendizaje:l,onAtlas:i,onResearch:u,alcance:d}=e;return(0,r.jsxs)("section",{"aria-labelledby":"bibliotecario-ia-inline",className:"w-full",children:[(0,r.jsx)("div",{className:"mb-3 px-1",children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"h-2 w-2 rounded-full bg-[#14b8a6] shadow-[0_0_10px_#14b8a6]"}),(0,r.jsx)("h2",{id:"bibliotecario-ia-inline",className:"text-xs font-bold tracking-[0.16em] text-[#0f766e] dark:text-[#14b8a6]",children:"BIBLIOTECARIO IA"})]}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-gray-600 dark:text-gray-300",children:["Hallazgos independientes sobre tus ",t.toLocaleString()," resultados."]})]})}),d&&(0,r.jsx)("p",{className:"mb-3 rounded-xl border border-gray-200 bg-white/60 px-3 py-2 text-xs text-gray-600 dark:border-white/10 dark:bg-gray-900/50 dark:text-gray-400",children:d}),("idle"===n||"streaming"===n)&&0===a.length&&(0,r.jsx)("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-3 lg:gap-6","aria-label":"El bibliotecario est\xe1 construyendo sus hallazgos",children:Array.from({length:3},(e,t)=>(0,r.jsxs)("div",{className:"".concat(C[t]," min-h-40 rounded-[20px] border p-5"),children:[(0,r.jsx)(y.Z,{className:"h-4 w-4 animate-spin text-gray-400 motion-reduce:animate-none"}),(0,r.jsx)("div",{className:"mt-5 h-2.5 w-24 animate-pulse rounded-full bg-black/10 motion-reduce:animate-none dark:bg-white/10"}),(0,r.jsx)("div",{className:"mt-3 h-3 w-4/5 animate-pulse rounded-full bg-black/10 motion-reduce:animate-none dark:bg-white/10"}),(0,r.jsx)("div",{className:"mt-2 h-3 w-2/3 animate-pulse rounded-full bg-black/10 motion-reduce:animate-none dark:bg-white/10"})]},t))}),"error"===n&&0===a.length&&(0,r.jsxs)("div",{className:"rounded-[20px] border border-amber-200 bg-amber-50 p-5 text-sm text-amber-900 dark:border-amber-500/20 dark:bg-amber-950/20 dark:text-amber-200",children:[(0,r.jsx)("strong",{children:"No se pudo actualizar el Bibliotecario IA."})," Tus resultados siguen disponibles."]}),"done"===n&&0===a.length&&(0,r.jsx)("div",{className:"rounded-[20px] border border-gray-200 bg-white/70 p-5 text-sm text-gray-600 dark:border-white/10 dark:bg-gray-900/60 dark:text-gray-300",children:"El bibliotecario revis\xf3 estos resultados y no encontr\xf3 un hallazgo relevante."}),(0,r.jsx)("p",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:("idle"===n||"streaming"===n)&&0===a.length?"Bibliotecario IA est\xe1 preparando sus hallazgos.":"Bibliotecario IA: ".concat(a.length," ").concat(1===a.length?"hallazgo disponible":"hallazgos disponibles",".")}),(0,r.jsxs)("div",{role:"list","aria-label":"Hallazgos y continuidades del Bibliotecario IA",className:"mt-5 grid gap-5 sm:grid-cols-2 lg:grid-cols-3 lg:gap-6",children:[a.map((e,t)=>{let a=_[e.icon]||o.Z;return(0,r.jsxs)("article",{role:"listitem",className:"".concat(C[t%C.length]," relative min-h-44 overflow-hidden rounded-[20px] border p-5 shadow-[0_14px_32px_-27px_rgba(15,23,42,0.75)] animate-in fade-in slide-in-from-bottom-2 duration-300 motion-reduce:animate-none"),children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"absolute right-5 top-0 h-2 w-12 rounded-b-full bg-black/10 dark:bg-white/10"}),(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"grid h-8 w-8 shrink-0 place-items-center rounded-[10px] border border-black/[0.07] bg-white/65 text-gray-700 dark:border-white/10 dark:bg-white/[0.05] dark:text-gray-200",children:(0,r.jsx)(a,{className:"h-4 w-4"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-[10px] font-bold tracking-[0.12em] text-gray-500 dark:text-gray-400",children:[(0,r.jsx)("span",{children:e.label}),q(e)&&(0,r.jsx)("span",{className:"font-semibold tracking-[0.05em] text-gray-400",children:"\xb7 de tu cat\xe1logo"}),e.count&&(0,r.jsx)("span",{className:"rounded bg-white/60 px-1.5 font-mono tracking-normal text-gray-700 dark:bg-white/10 dark:text-gray-300",children:e.count})]}),(0,r.jsx)("h3",{className:"mt-1 text-sm font-semibold leading-snug text-gray-950 dark:text-white",children:A(e.title)})]})]}),(0,r.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-gray-600 dark:text-gray-300",children:A(e.body)}),e.cta&&(0,r.jsxs)("button",{type:"button",onClick:()=>
1s(e.cta,e),className:"mt-3 inline-flex items-center gap-1 text-xs font-semibold text-[#0f766e] hover:underline dark:text-[#2dd4bf]",children:[e.cta.label,(0,r.jsx)(w.Z,{className:"h-3.5 w-3.5","aria-hidden":"true"})]})]},e.id)}),(0,r.jsxs)("article",{role:"listitem",className:"".concat(C[0]," relative min-h-44 overflow-hidden rounded-[20px] border p-5 shadow-[0_14px_32px_-27px_rgba(15,23,42,0.75)] animate-in fade-in slide-in-from-bottom-2 duration-300 motion-reduce:animate-none"),children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"absolute right-5 top-0 h-2 w-12 rounded-b-full bg-black/10 dark:bg-white/10"}),(0,r.jsx)("span",{"aria-hidden":"true",className:"grid h-8 w-8 place-items-center rounded-[10px] border border-black/[0.07] bg-white/65 text-gray-700 dark:border-white/10 dark:bg-white/[0.05] dark:text-gray-200",children:(0,r.jsx)(k.Z,{className:"h-4 w-4"})}),(0,r.jsx)("p",{className:"mt-3 text-[10px] font-bold tracking-[0.12em] text-gray-500 dark:text-gray-400",children:"RUTA DE APRENDIZAJE"}),(0,r.jsx)("h3",{className:"mt-1 text-sm font-semibold leading-snug text-gray-950 dark:text-white",children:"Convierte los hallazgos en un recorrido"}),(0,r.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-gray-600 dark:text-gray-300",children:"Contin\xfaa en el Discovery con una secuencia de exploraci\xf3n basada en esta b\xfasqueda."}),(0,r.jsxs)("button",{type:"button",onClick:l,className:"mt-3 inline-flex items-center gap-1 text-xs font-semibold text-[#0f766e] hover:underline dark:text-[#2dd4bf]",children:["Abrir ruta",(0,r.jsx)(w.Z,{className:"h-3.5 w-3.5","aria-hidden":"true"})]})]}),i&&(0,r.jsxs)("article",{role:"listitem",className:"".concat(C[1]," relative min-h-44 overflow-hidden rounded-[20px] border p-5 shadow-[0_14px_32px_-27px_rgba(15,23,42,0.75)] animate-in fade-in slide-in-from-bottom-2 duration-300 motion-reduce:animate-none"),children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"absolute right-5 top-0 h-2 w-12 rounded-b-full bg-black/10 dark:bg-white/10"}),(0,r.jsx)("span",{"aria-hidden":"true",className:"grid h-8 w-8 place-items-center rounded-[10px] border border-black/[0.07] bg-white/65 text-gray-700 dark:border-white/10 dark:bg-white/[0.05] dark:text-gray-200",children:(0,r.jsx)(c.Z,{className:"h-4 w-4"})}),(0,r.jsx)("p",{className:"mt-3 text-[10px] font-bold tracking-[0.12em] text-gray-500 dark:text-gray-400",children:"ATLAS DEL CONOCIMIENTO"}),(0,r.jsx)("h3",{className:"mt-1 text-sm font-semibold leading-snug text-gray-950 dark:text-white",children:"Descubre c\xf3mo se conectan los temas"}),(0,r.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-gray-600 dark:text-gray-300",children:"Explora las relaciones y comunidades tem\xe1ticas vinculadas con esta b\xfasqueda."}),(0,r.jsxs)("button",{type:"button",onClick:i,className:"mt-3 inline-flex items-center gap-1 text-xs font-semibold text-[#0f766e] hover:underline dark:text-[#2dd4bf]",children:["Abrir Atlas",(0,r.jsx)(w.Z,{className:"h-3.5 w-3.5","aria-hidden":"true"})]})]}),u&&(0,r.jsxs)("article",{role:"listitem",className:"".concat(C[2]," relative min-h-44 overflow-hidden rounded-[20px] border p-5 shadow-[0_14px_32px_-27px_rgba(15,23,42,0.75)] animate-in fade-in slide-in-from-bottom-2 duration-300 motion-reduce:animate-none"),children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"absolute right-5 top-0 h-2 w-12 rounded-b-full bg-black/10 dark:bg-white/10"}),(0,r.jsx)("span",{"aria-hidden":"true",className:"grid h-8 w-8 place-items-center rounded-[10px] border border-black/[0.07] bg-white/65 text-gray-700 dark:border-white/10 dark:bg-white/[0.05] dark:text-gray-200",children:(0,r.jsx)(j.Z,{className:"h-4 w-4"})}),(0,r.jsx)("p",{className:"mt-3 text-[10px] font-bold tracking-[0.12em] text-gray-500 dark:text-gray-400",children:"INVESTIGACI\xd3N"}),(0,r.jsx)("h3",{className:"mt-1 text-sm font-semibold leading-snug text-gray-950 dark:text-white",children:"Ampl\xeda el an\xe1lisis del tema"}),(0,r.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-gray-600 dark:text-gray-300",children:"Contin\xfaa con el panorama, autores y producci\xf3n cient\xedfica relacionados."}),(0,r.jsxs)("button",{type:"button",onClick:u,className:"mt-3 inline-flex items-center gap-1 text-xs font-semibold text-[#0f766e] hover:underline dark:text-[#2dd4bf]",children:["Abrir Investigaci\xf3n",(0,r.jsx)(w.Z,{className:"h-3.5 w-3.5","aria-hidden":"true"})]})]})]})]})}},35772:function(e,t,a){a.d(t,{Cd:function(){return p},DC:function(){return m},EB:function(){return l},_v:function(){return i},fd:function(){return d},hr:function(){return s},vv:function(){return o},z2:function(){return c}});let r={credencial_faltante:"sin credencial",credencial_invalida:"credencial rechazada",limite_alcanzado:"sin cuota",fuente_no_disponible:"no respondi\xf3",error:"no se pudo consultar"},n={credencial_faltante:"Esta fuente est\xe1 activada pero tu biblioteca todav\xeda n
1o carg\xf3 su credencial, as\xed que no se consult\xf3. El administrador puede cargarla desde el panel de fuentes federadas.",credencial_invalida:"El proveedor rechaz\xf3 la credencial configurada. Hay que revisarla en el panel de administraci\xf3n: mientras tanto, esta fuente no aporta resultados.",limite_alcanzado:"Se agot\xf3 la cuota de consultas que el proveedor concede a tu biblioteca. Volv\xe9 a intentar m\xe1s tarde; los resultados de las dem\xe1s fuentes son v\xe1lidos.",fuente_no_disponible:"El proveedor no respondi\xf3 a tiempo. Es una falla temporal de su servicio, no de tu b\xfasqueda.",error:"No se pudo consultar esta fuente. El detalle t\xe9cnico qued\xf3 registrado en el servidor para el administrador."};function o(e){return"consultando"===e.estado?"consultando":"ok"===e.estado?"ok":"credencial_faltante"===e.causa?"pendiente":"falla"}function s(e){return e?r[e]||r.error:""}function l(e){return e?n[e]||n.error:""}function i(e){var t;let a=e.nombre.toUpperCase();return"consultando"===e.estado?"".concat(a," consultandoâ¦"):"error"===e.estado?"".concat(a," ").concat(s(e.causa)):"number"==typeof e.conteo?"".concat(a," ").concat((t=e.conteo)>=1e3?"".concat((t/1e3).toFixed(1),"K"):"".concat(t)):a}function c(e){let t=e.filter(e=>"error"===e.estado);if(0===t.length)return null;let a=e.length,r=t.length,n=u(e);if(1===e.length&&"Fuentes externas"===e[0].nombre)return"La consulta a las fuentes externas no lleg\xf3 a ejecutarse. No es que no haya resultados: no se pudo preguntar. Volv\xe9 a intentar en un momento.";if(r===a){let e=1===a?"La \xfanica fuente externa":"Ninguna de las ".concat(a," fuentes externas");return n?1===a?"La \xfanica fuente externa configurada no tiene credencial cargada en esta biblioteca, as\xed que no se consult\xf3. Lo que ves no es un cat\xe1logo vac\xedo.":"No se consult\xf3 ninguna de las ".concat(a," fuentes externas: ninguna tiene credencial cargada en esta biblioteca. Lo que ves no es un cat\xe1logo vac\xedo."):"".concat(e," aport\xf3 resultados: lo que ves no es un cat\xe1logo vac\xedo, es una consulta que no se pudo completar.")}return"Estos resultados est\xe1n incompletos: ".concat(r," de ").concat(a," fuentes ").concat(1===r?"no aport\xf3":"no aportaron"," resultados. El motivo de cada una est\xe1 en su etiqueta.")}function u(e){let t=e.filter(e=>"error"===e.estado);return t.length>0&&t.every(e=>"credencial_faltante"===e.causa)}function d(e){return u(e)?"info":"aviso"}let m="fuente_no_disponible";function p(e,t){let a=e.map(e=>({nombre:e.name,estado:"consultando",causa:null})),r=[],n=[];for(let e of t)e.causa?n.push({nombre:e.name,estado:"error",causa:e.causa,conteo:0}):r.push({nombre:e.name,estado:"ok",causa:null,conteo:e.count});return[...a,...r,...n]}},89457:function(e,t,a){a.d(t,{Ao:function(){return o},d7:function(){return s},dJ:function(){return r},py:function(){return l}});let r="database",n=["library","database","federated"];function o(e){let t={};for(let a of e||[]){let e=null==a?void 0:a.name;if(!e)continue;let r=null==a?void 0:a.resource_category;r&&n.includes(r)&&(t[e]=r)}return t}function s(e,t){let a={library:[],database:[],federated:[]};for(let n of e)a[function(e,t){var a;return null!==(a=t[e])&&void 0!==a?a:r}(n[0],t)].push(n);return a}function l(e,t){if(null===t)return e;let a=new Set(t);return e.filter(e=>a.has(e[0]))}},20036:function(e,t,a){function r(e){return"string"==typeof e&&e.length>0&&e.length<=512&&e.trim()===e&&!/[\x00-\x1f\x7f]/.test(e)}function n(e,t){let a=e&&"object"==typeof e&&Array.isArray(e.items)?e.items:[],n=new Set([t]),o=[];for(let e of a){if(!e||"object"!=typeof e)continue;let t=e.oai_id,a="string"==typeof e.title?e.title.trim():Array.isArray(e.title)&&"string"==typeof e.title[0]?e.title[0].trim():"";if(!r(t)||!a||n.has(t))continue;n.add(t);let s="string"==typeof e.author?e.author.trim():Array.isArray(e.author)&&"string"==typeof e.author[0]?e.author[0].trim():"";if(o.push({id:t,title:a,author:s,reason:"subjects"===e.match_reason?"Materias compartidas":"Relacionado en el cat\xe1logo"}),3===o.length)break}return o}function o(e){if(!Array.isArray(e))return null;let t=e.find(e=>Number.isInteger(e)&&e>0&&e<=1e5);return"number"==typeof t?{label:"Profundizar p\xe1g. ".concat(t),prompt:"Explica con m\xe1s detalle el contenido de la p\xe1gina ".concat(t,".")}:null}a.d(t,{BG:function(){return r},Jc:function(){return n},wZ:function(){return o}})},59299:function(e,t,a){a.d(t,{Ug:function(){return r},hE:function(){return n},r5:function(){return i}});let r="AcademIA",n=[{id:"summary",label:"\uD83D\uDCCB Resumir",prompt:"Resume este documento en 3 puntos clave"},{id:"conclusions",label:"â
Conclusiones",prompt:"\xbfCu\xe1les son las conclusiones principales?"},{id:"methodology",label:"\uD83D\uDD2C Metodolog\xeda",prompt:"\xbfCu\xe1l es la metodolog\xeda utilizada?"},{id:"concepts",label:"\uD83D\uDCA1 Conceptos",prompt:"Explica los conceptos clave de este documento"}],o=e=>e.normalize("NFD").replace(/[Ì-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9 ]+/g," ").replace(/\s+/g," ").trim(),s="(?: (?:de|del|en) (?:este|ese|el) (?:documento|texto|pdf|libro|articulo|trabajo|registro))?",l=[{id:"summary",pattern:RegExp("^(?:resume(?:lo|la|melo|mela)?|resumeme|sintetiza(?:lo|la)?)(?: (?:el contenido de )?(?:este|ese|el) (?:documento|texto|pdf|libro|articulo|trabajo))?(?: en 3 puntos clave)?$")},{id:"conclusions",pattern:new RegExp("^(?:cuales|cual|que) (?:son|es|fueron|fue) (?:las|la|sus|su) (?:conclusiones|conclusion)(?: principales)?".concat(s,"$"))},{id:"methodology",pattern:new RegExp("^(?:(?:cual|que) (?:es|fue) (?:la|su) (?:metodologia|metodo)(?: utilizad[ao]| usad[ao])?".concat(s,"|que (?:metodologia|metodo) (?:usa|utiliza|uso|utilizo|emplea))$"))},{id:"concepts",pattern:new RegExp("^(?:(?:cuales|que) (?:son|fueron) (?:los|sus) conceptos(?: clave| principales)?".concat(s,"|explica(?:me)? los conceptos clave").concat(s,")$"))}];function i(e){let t=o(e),a=l.find(e=>e.pattern.test(t));return a?n.find(e=>e.id===a.id).prompt:e}},24309:function(e,t,a){a.d(t,{pL:function(){return l},qv:function(){return i},vH:function(){return n}});let r=["public","ai_members","members"],n={ai_members:"Para preguntar al documento inicia sesi\xf3n con tu cuenta de la biblioteca.",members:"LIVE est\xe1 disponible para usuarios de la biblioteca."};function o(e){if(!Array.isArray(e))return[];let t=[];for(let r of e){var a;if(!r||"object"!=typeof r)continue;let e="string"!=typeof(a=r.url)?null:/^\/login\?next=\/[A-Za-z0-9/_-]*$/.test(a)||/^\/api\/auth\/sso\/[a-z0-9_-]+\/start\?return_to=\/[A-Za-z0-9/_-]*$/.test(a)?a:null;if(!e||"koha"!==r.tipo&&"sso"!==r.tipo)continue;let n="string"==typeof r.etiqueta&&r.etiqueta.trim()?r.etiqueta.trim():"koha"===r.tipo?"Ingresar con mi cuenta de la biblioteca":"Ingresar con SSO",o={tipo:r.tipo,etiqueta:n,url:e};"string"==typeof r.proveedor&&(o.proveedor=r.proveedor),t.push(o)}return t}function s(e){return"string"==typeof e&&r.includes(e)?e:null}function l(e){if(!e||"object"!=typeof e||"requiere_sesion"!==e.error)return null;let t="members"===s(e.modo)?"members":"ai_members";return{mode:t,message:n[t],login:o(e.login)}}function i(e){if(!e||"object"!=typeof e)return null;let t=s(e.modo);return t&&"boolean"==typeof e.lector?{mode:t,member:e.lector,login:o(e.login)}:null}},10988:function(e,t,a){a.d(t,{A$:function(){return _},Ev:function(){return w},VG:function(){return N},Xw:function(){return q},dP:function(){return E},h1:function(){return A},qm:function(){return j},r1:function(){return k}});var r=a(99054),n=a(59299),o=a(26997),s=a(24309);let l="(?:resultado|registro|documento|libro|articulo|tesis|pdf|texto)",i="(?:este|ese|esta|esa|aquel|aquella)",c="(?:(?:(?
1:el|la|al) )?(".concat(o.z1,")(?: ").concat(l,")?|").concat(i,"(?: ").concat(l,")?|(?:el|la) (?:documento|pdf|texto|texto completo))"),u="(?:sobre|acerca de|respecto a|respecto de|en cuanto a|en relacion con)",d="((?:las|los|la|el|sus) (?:conclusiones|conclusion|resultados|hallazgos|objetivos|objetivo|metodologia|metodo|limitaciones|hipotesis|pregunta de investigacion|aportes|recomendaciones|muestra|marco teorico|conceptos clave|conceptos))",m="(?:del|de la|de|en)",p="(?:resume|resumeme|resumir|sintetiza|sintetizame|hazme un resumen de|dame un resumen de|haz un resumen de)",g="(?:el |la )?(?:pdf|texto completo|documento completo|texto)";function b(e){var t;return e?{ordinal:null!==(t=(0,o.Vz)(e,0))&&void 0!==t?t:0}:{ref:"this"}}function f(e){return e.replace(/\s+/g," ").replace(/^[\s,:;¿¡"«]+|[\s?!.,;:"»]+$/g,"").trim()}function x(e){let t=f(e);return t?"\xbf".concat(t.charAt(0).toUpperCase()).concat(t.slice(1),"?"):""}function h(e,t){let a=f(e);return"\xbf".concat(a.charAt(0).toUpperCase()).concat(a.slice(1)," ").concat(f(t)," de este documento?")}let v=e=>
1new RegExp("^(\\s*(?:(?:y|oye|live|por favor|entonces|a ver)\\s+)*)".concat(e,"\\s*$")),y=[{pattern:v("(que\\s+(?:dice|plantea|propone|concluye|opina|explica)\\s+".concat(c,"\\s+").concat(u,"\\s+)(.+?)")),build:(e,t)=>({target:b(e[3]),question:"\xbfQu\xe9 dice este documento sobre ".concat(f(t(4)),"?")})},{pattern:v("(que\\s+(?:dice|plantea|propone|concluye)\\s+".concat(c,")")),build:e=>({target:b(e[3]),question:"\xbfQu\xe9 plantea este documento? Resume sus ideas principales."})},{pattern:v("(".concat(p,"\\s+").concat(g,"\\s+").concat(m,"\\s+").concat(c,")")),build:e=>({target:b(e[3]),question:"Resume el contenido de este documento."})},{pattern:v("((?:cuales|cual|que)\\s+(?:son|es|fue|fueron)\\s+)".concat(d,"(\\s+").concat(m,"\\s+").concat(c,")")),build:(e,t,a)=>({target:b(e[5]),question:h(a,t(3))})},{pattern:v("(".concat("(?:preguntale|pregunta|preguntar|consultale|consulta)","\\s+(?:al\\s+|a\\s+el\\s+|a\\s+la\\s+|a\\s+)?(?:(?:documento|pdf|texto|articulo|libro)|(").concat(o.z1,")(?:\\s+").concat(l,")?|").concat(i,")\\s+(?:si\\s+|que\\s+|por\\s+|sobre\\s+|acerca de\\s+)?)(.+?)")),build:(e,t)=>{let a=x(t(4));return a?{target:b(e[3]),question:a}:null}},{pattern:v("(segun\\s+".concat(c,"\\s+)(.+?)")),build:(e,t)=>{let a=x(t(4));return a?{target:b(e[3]),question:a}:null}},{focusedOnly:!0,pattern:v("(que\\s+(?:dice|plantea|propone)\\s+".concat(u,"\\s+)(.+?)")),build:(e,t)=>({target:{ref:"this"},question:"\xbfQu\xe9 dice este documento sobre ".concat(f(t(3)),"?")})},{focusedOnly:!0,pattern:v("((?:cuales|cual|que)\\s+(?:son|es|fue|fueron)\\s+)".concat(d)),build:(e,t,a)=>({target:{ref:"this"},question:h(a,t(3))})},{focusedOnly:!0,pattern:v("(resumelo|resumela|resumemelo|resumemela|".concat(p,"\\s+").concat(g,")")),build:()=>({target:{ref:"this"},question:"Resume el contenido de este documento."})}];function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,r.gp)(e))return null;let a=e.split("").map(e=>{let t=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();return 1===t.length&&/[a-z0-9º°]/.test(t)?t:" "}).join("");for(let r of y){var o,s,l,i;if(r.focusedOnly&&!t.focused)continue;let c=a.match(r.pattern);if(!c)continue;let u=null!==(l=null===(o=c[1])||void 0===o?void 0:o.length)&&void 0!==l?l:0,d=u+(null!==(i=null===(s=c[2])||void 0===s?void 0:s.length)&&void 0!==i?i:0),m=t=>{var a,r;return e.slice(d,d+(null!==(r=null===(a=c[t])||void 0===a?void 0:a.length)&&void 0!==r?r:0))},p=r.build(c,m,e.slice(u,d));return p&&{...p,question:(0,n.r5)(p.question)}}return null}function k(e,t){var a;if((null==t?void 0:t.mode)!=="fulltext"||!(null===(a=t.citedPages)||void 0===a?void 0:a.length))return[];let r=new Set,n=/\b(?:p[áa]g(?:ina)?s?\.?|pp?\.)\s?(\d{1,4}(?:\s?(?:,|y|-|â|a)\s?\d{1,4})*)/gi;for(let t=n.exec(e);t;t=n.exec(e))for(let e of t[1].split(/\s?(?:,|y)\s?/)){let t=e.match(/^(\d{1,4})\s?(?:-|â|a)\s?(\d{1,4})$/),[a,n]=t?[Number(t[1]),Number(t[2])]:[Number(e),Number(e)];if(Number.isFinite(a)&&Number.isFinite(n)){if(n>=a&&n-a<=30)for(let e=a;e<=n;e+=1)r.add(e);else r.add(a).add(n)}}let o="number"==typeof t.pages&&t.pages>0?t.pages:1/0;return t.citedPages.filter(e=>e<=o&&!r.has(e))}let j="Leyendo el documentoâ¦",N=12,_=500;function q(e){var t,a,r;if(!e)return null;if("too_many_pages"===e.pageCause)return"M\xe1ximo dos p\xe1ginas por consulta";if(e.requestedPage&&!1===e.pageAvailable)return"outside_pdf"===e.pageCause?"P\xe1g. ".concat(e.requestedPage," fuera del PDF").concat(e.pages?" de ".concat(e.pages," p\xe1gs."):""):"extraction_limit"===e.pageCause?"P\xe1g. ".concat(e.requestedPage," no le\xedda por l\xedmite de extracci\xf3n"):"partial_extraction"===e.pageCause?"P\xe1g. ".concat(e.requestedPage," le\xedda parcialmente"):"no_fulltext"===e.pageCause?"P\xe1g. ".concat(e.requestedPage," sin PDF verificable"):"pagination_unknown"===e.pageCause?"P\xe1g. ".concat(e.requestedPage," sin paginaci\xf3n verificable"):"P\xe1g. ".concat(e.requestedPage," sin texto extra\xedble");if(null===(t=e.requestedPages)||void 0===t?void 0:t.length){let t="P\xe1gs. ".concat(e.requestedPages.join(" y "));return"no_fulltext"===e.pageCause?"".concat(t," \xb7 sin PDF verificable"):"pagination_unknown"===e.pageCause?"".concat(t," \xb7 sin paginaci\xf3n verificable"):(null===(a=e.missingPages)||void 0===a?void 0:a.length)?"".concat(t," \xb7 falta texto de p\xe1g. ").concat(e.missingPages.join(" y ")):(null===(r=e.partialPages)||void 0===r?void 0:r.length)?"".concat(t," \xb7 lectura parcial de p\xe1g. ").concat(e.partialPages.join(" y ")):"".concat(t," consultadas").concat(e.fragments?" \xb7 ".concat(e.fragments," pasajes"):"")}if("abstract"===e.mode)return"Basado s\xf3lo en el resumen";let n="number"==typeof e.fragments&&e.fragments>0?"".concat(e.fragments," ").concat(1===e.fragments?"pasaje consultado":"pasajes consultados"):"Pasajes del documento consultados",o=e.requestedPage?"P\xe1g. ".concat(e.requestedPage," consultada \xb7 ").concat(n):n;return"number"==typeof e.pages&&e.pages>0?"".concat(o," \xb7 documento de ").concat(e.pages," ").concat(1===e.pages?"p\xe1g.":"p\xe1gs."):o}function A(e){let t;if("[DONE]"===e)return"done";try{t=JSON.parse(e)}catch(e){return null}if(!t||"object"!=typeof t)return null;if("grounding"===t.type){let e={mode:"fulltext"===t.mode?"fulltext":"abstract"};"number"==typeof t.pages&&(e.pages=t.pages),"number"==typeof t.fragments?e.fragments=t.fragments:Array.isArray(t.fragments)&&(e.fragments=t.fragments.length),"string"==typeof t.cause&&t.cause&&(e.cause=t.cause),Number.isInteger(t.requested_page)&&t.requested_page>0&&(e.requestedPage=t.requested_page);let a=e=>Array.isArray(e)?e.filter(e=>Number.isInteger(e)&&e>0).slice(0,2):[],r=a(t.requested_pages);r.length&&(e.requestedPages=r);let n=a(t.missing_pages);n.length&&(e.missingPages=n);let o=a(t.partial_pages);if(o.length&&(e.partialPages=o),"boolean"==typeof t.page_available&&(e.pageAvailable=t.page_available),["outside_pdf","text_unavailable","partial_extraction","extraction_limit","no_fulltext","pagination_unknown","too_many_pages"].includes(String(t.page_cause))&&(e.pageCause=t.page_cause),Array.isArray(t.cited_pages)){let a=Array.from(new Set(t.cited_pages.filter(e=>Number.isInteger(e)&&e>0&&e<1e4))).slice(0,8);a.length&&(e.citedPages=a)}return{type:"grounding",grounding:e}}if("token"===t.type&&"string"==typeof t.content)return{type:"token",content:t.content};if("sources"===t.type)return{type:"sources",payload:t};if("error"===t.type){let e=[t.content,t.message,t.detail].find(e=>"string"==typeof e&&e.trim()),a="string"==typeof t.code?t.code:void 0;return{type:"error",message:(null==e?void 0:e.trim())||"El servicio no pudo leer el documento".concat(a?" (".concat(a,")"):"","."),...a?{code:a}:{}}}return"done"===t.type?"done":null}async function E(e,t){var a,r,n;let o;let l=null!==(a=t.fetch)&&void 0!==a?a:fetch;try{o=await l("/api/harvester/live/ask-record",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id,question:e.question.slice(0,_),history:(null!==(r=e.history)&&void 0!==r?r:[]).slice(-N)}),signal:t.signal})}catch(e){if((null==e?void 0:e.name)==="AbortError")throw e;return{status:"error",message:"No pude conectar con el servicio que lee el documento."}}if(!o.ok){let e=401===o.status?(0,s.pL)(await o.json().catch(()=>null)):null;return e?{status:"error",message:e.message,access:e}
1:{status:"error",message:404===(n=o.status)?"Todav\xeda no puedo leer documentos desde LIVE en esta biblioteca (el servicio respondi\xf3 404).":401===n||403===n?"Leer documentos no est\xe1 habilitado para visitantes en esta biblioteca (".concat(n,")."):429===n?"Hice demasiadas preguntas seguidas a los documentos; espera un momento y vuelve a intentarlo (429).":413===n||422===n||400===n?"El servicio rechaz\xf3 la pregunta (".concat(n,"); prueba formularla m\xe1s corta."):"El servicio que lee el documento fall\xf3 (HTTP ".concat(n,").")}}if(!o.body)return{status:"error",message:"El servicio no entreg\xf3 una respuesta progresiva."};let i=o.body.getReader(),c=new TextDecoder,u="",d=!1,m=null,p=!1,g=e=>{let a=(u+=e).indexOf("\n\n");for(;a>=0&&!p;){let e=u.slice(0,a);u=u.slice(a+2);let r=e.split("\n").filter(e=>e.startsWith("data:")).map(e=>e.slice(5).trimStart()).join("\n"),n=r?A(r):null;"done"===n?p=!0:n&&("token"===n.type&&n.content&&(d=!0),"error"===n.type&&(m=n.message),t.onEvent(n)),a=u.indexOf("\n\n")}};for(;!p;){let{done:e,value:t}=await i.read();if(e)break;g(c.decode(t,{stream:!0}))}return(p||g("".concat(c.decode(),"\n\n")),m)?{status:"error",message:m}:d?{status:"done"}:{status:"error",message:"La lectura del documento termin\xf3 sin una respuesta."}}},99054:function(e,t,a){a.d(t,{Z:function(){return m},gp:function(){return i},jJ:function(){return x},os:function(){return b},vz:function(){return f}});var r=a(70555);let n={primero:1,primer:1,primera:1,segundo:2,segunda:2,tercero:3,tercer:3,tercera:3,cuarto:4,cuarta:4,quinto:5,quinta:5,sexto:6,sexta:6,septimo:7,septima:7,octavo:8,octava:8,noveno:9,novena:9,decimo:10,decima:10},o=e=>" ".concat(e.normalize("NFD").replace(/[Ì-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim()," "),s=[/ cuant[oa]s (?:copias|ejemplares|volumenes|unidades|libros fisicos) /,/ (?:hay|tiene|tienen|quedan) (?:copias|ejemplares) /,/ (?:existencias|disponibilidad) /,/ (?:esta|estan|sigue|siguen) (?:disponibles?|prestad[oa]s?|en prestamo|libres?) /,/ (?:disponibles?|prestad[oa]s?) para (?:prestamo|pedir|llevar) /,/ (?:en|de) que (?:biblioteca|bibliotecas|sede|sedes|campus|sala) /,/ (?:donde|en donde) (?:esta|estan|lo encuentro|la encuentro|se encuentra|se encuentran|lo ubico|lo busco) /,/ se (?:puede|pueden) (?:pedir|prestar|sacar|llevar|reservar) /,/ cuando (?:vuelve|vuelven|regresa|regresan|lo devuelven|la devuelven|estara disponible|queda libre) /,/ (?:signatura|ubicacion fisica|en que estante) /],l=/ (?:pdf|texto completo|documento completo|enlace|link|articulo en linea) /;function i(e){var t,a;let r=o(e);if(l.test(r)||!s.some(e=>e.test(r)))return null;let i=null===(t=r.match(/ (?:el|la|del|de la|numero|resultado|tarjeta) (\d{1,3}) /))||void 0===t?void 0:t[1],c=null===(a=r.match(/ (primero|primer|primera|segundo|segunda|tercero|tercer|tercera|cuarto|cuarta|quinto|quinta|sexto|sexta|septimo|septima|octavo|octava|noveno|novena|decimo|decima) /))||void 0===a?void 0:a[1];return{card:i?Number(i):c?n[c]:null}}let c=e=>"string"==typeof e&&e.trim()?e.trim():null;function u(e){let t=Array.isArray(e.items)?e.items:[],a=new Map,n=0,o=0,s=null;for(let e of t){var l,i,u,d;let t=(0,r.P)(e),m=null!==(u=null!==(i=null!==(l=c(e.library_name))&&void 0!==l?l:c(e.holding_library_id))&&void 0!==i?i:c(e.home_library_id))&&void 0!==u?u:"la biblioteca",p=null!==(d=a.get(m))&&void 0!==d?d:{library:m,available:0,total:0,callnumber:null,location:null};if(p.total+=1,t)n+=1,p.available+=1,1===p.available&&(p.callnumber=c(e.callnumber),p.location=c(e.location));else if(c(e.checked_out_date)){o+=1;let t=String(e.checked_out_date).slice(0,10);/^\d{4}-\d{2}-\d{2}$/.test(t)&&(!s||t<s)&&(s=t)}p.callnumber||0!==p.available||(p.callnumber=c(e.callnumber),p.location=c(e.location)),a.set(m,p)}return{total:t.length,available:n,onLoan:o,unavailable:t.length-n-o,nextDue:s,libraries:Array.from(a.values()).sort((e,t)=>t.available-e.available||t.total-e.total),holdsAllowed:!0===e.allow_holds,checkoutAllowed:!0===e.allow_checkout,renewalsAllowed:!0===e.allow_renewals}}let d=["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"];function m(e){let[,t,a]=e.split("-").map(Number);return t>=1&&t<=12&&a?"".concat(a," de ").concat(d[t-1]):e}let p=(e,t,a)=>"".concat(e," ").concat(1===e?t:a);function g(e,t){let a=e||"el cat\xe1logo";return t.timeout?"El cat\xe1logo de ".concat(a," no respondi\xf3 a tiempo; no pude consultar sus ejemplares."):401===t.status||403===t.status?"El cat\xe1logo de ".concat(a," rechaz\xf3 la consulta de existencias (error ").concat(t.status,")."):404===t.status?"".concat(a," no est\xe1 configurado para consultar existencias en vivo."):"No pude consultar los ejemplares en ".concat(a).concat(t.status?" (error ".concat(t.status,")"):"",".")}function b(e){let t=e.sourceRepo||"otra fuente";return e.channel&&"local"!==e.channel||e.family&&"catalog"!==e.family?{refusal:"\xab".concat(e.title,"\xbb viene de ").concat(t,", no del cat\xe1logo de la biblioteca: no tiene ejemplares que consultar.")}:e.overdriveId?{refusal:"\xab".concat(e.title,"\xbb es un recurso digital de ").concat(t,": no tiene ejemplares f\xedsicos.")}:e.indexHoldings?{refusal:"Las existencias de \xab".concat(e.title,"\xbb vienen del registro de ").concat(t,"; las ves en su ficha.")}:"koha"!==e.sourceType.toLowerCase()?{refusal:"No puedo consultar existencias en vivo de ".concat(t," desde LIVE; las ves en la ficha del registro.")}:e.biblionumber&&e.sourceRepo?{sourceRepo:e.sourceRepo,biblionumber:e.biblionumber}:{refusal:"\xab".concat(e.title,"\xbb no informa su n\xfamero de registro en el cat\xe1logo; puedo abrir su ficha.")}}async function f(e){var t,a,r,n,o;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=new AbortController,i=()=>l.abort();null===(t=s.signal)||void 0===t||t.addEventListener("abort",i,{once:!0});let c=!1,d=setTimeout(()=>{c=!0,l.abort()},null!==(a=s.timeoutMs)&&void 0!==a?a:15e3);try{let t=await (null!==(r=s.fetch)&&void 0!==r?r:fetch)("/api/koha-availability?source_repo=".concat(encodeURIComponent(e.sourceRepo),"&biblionumber=").concat(encodeURIComponent(e.biblionumber)),{cache:"no-store",signal:l.signal});if(!t.ok)return{status:"failed",message:g(e.sourceRepo,{status:t.status})};let a=await t.json().catch(()=>null);if(!a||"object"!=typeof a)return{status:"failed",message:"No pude leer la respuesta de existencias de ".concat(e.sourceRepo,".")};return{status:"ready",response:a,summary:u(a),spoken:function(e,t){let a=t||e.source||"el cat\xe1logo";
1if("access_denied"===e.error)return"El cat\xe1logo de ".concat(a," no permiti\xf3 consultar sus existencias (acceso denegado). Puedes verlas en la ficha del registro.");let r=u(e);if(0===r.total)return e.error?"".concat(a," no inform\xf3 ejemplares de este registro en este momento. Puedes verlos en la ficha del registro."):"".concat(a," no tiene ejemplares registrados para este t\xedtulo.");let n=[];if(r.available>0){let e=r.libraries.filter(e=>e.available>0).slice(0,2).map(e=>["la biblioteca"!==e.library?"en ".concat(e.library):"",e.callnumber?"(signatura ".concat(e.callnumber,")"):""].filter(Boolean).join(" ")).filter(Boolean);n.push("".concat(p(r.available,"disponible","disponibles")).concat(e.length?" ".concat(e.join(" y ")):""))}r.onLoan>0&&n.push("".concat(p(r.onLoan,"prestado","prestados")).concat(r.nextDue?1===r.onLoan?" hasta el ".concat(m(r.nextDue)):" (el primero vuelve el ".concat(m(r.nextDue),")"):"")),r.unavailable>0&&n.push("".concat(p(r.unavailable,"no disponible","no disponibles")," para pr\xe9stamo"));let o=n.length>1?"".concat(n.slice(0,-1).join(", ")," y ").concat(n[n.length-1]):n[0];return"Hay ".concat(p(r.total,"ejemplar","ejemplares")," en ").concat(a,": ").concat(o,".")}(a,e.sourceRepo)}}catch(t){if(null===(n=s.signal)||void 0===n?void 0:n.aborted)throw t;return{status:"failed",message:g(e.sourceRepo,{timeout:c})}}finally{clearTimeout(d),null===(o=s.signal)||void 0===o||o.removeEventListener("abort",i)}}function x(e){if((0,r.P)(e))return"Disponible";let t="string"==typeof e.checked_out_date?e.checked_out_date.slice(0,10):"";return t?/^\d{4}-\d{2}-\d{2}$/.test(t)?"Prestado hasta el ".concat(m(t)):"Prestado":e.lost_status?"Extraviado":e.damaged_status?"Da\xf1ado":e.withdrawn?"Retirado":"No se presta"}},26997:function(e,t,a){a.d(t,{BK:function(){return E},QX:function(){return j},Qk:function(){return q},Vz:function(){return _},XU:function(){return y},Xz:function(){return z},lu:function(){return C},z1:function(){return c}});let r={primer:0,primero:0,primera:0,segundo:1,segunda:1,tercer:2,tercero:2,tercera:2,cuarto:3,cuarta:3,quinto:4,quinta:4,sexto:5,sexta:5,septimo:6,septima:6,octavo:7,octava:
17,noveno:8,novena:8,decimo:9,decima:9},n="abre|abreme|abrir|abrime|llevame(?: a| al)?",o="(".concat(n,"|").concat("muestra|muestrame|mostrar|mostrame|ensena|ensename|ensenar|ver|ve|mira|quiero ver|dejame ver|veamos",")"),s="(?:resultado|resultados|registro|registros|recurso|recursos|documento|documentos|libro|libros|articulo|tesis)",l="(?:".concat(Object.keys(r).join("|"),"|ultimo|ultima)"),i="(?:(?:1[0-9]|20)(?:mo|vo|no|\xba|\xb0)?|[1-9](?:ro|do|to|mo|vo|no|\xba|\xb0)?)",c="(?:".concat(l,"|").concat(i,")"),u="(?: (?:de )?(?:la )?(?:lista|busqueda|panel|seleccion))?",d=new RegExp("^".concat(o," (?:(?:(?:el|la|al) )?(").concat(l,")|(?:el|la|al) (?:numero )?(").concat(i,")|numero (").concat(i,"))(?: ").concat(s,")?").concat(u,"$")),m=new RegExp("^".concat(o," (?:(?:el|la|al) )?").concat(s," (?:numero )?(").concat(c,")").concat(u,"$")),p="(?:este|esta|esto|ese|esa|eso|aquel|aquella)",g=/^(abre|muestra|ensena|mostra)(?:me)?(?:lo|la)$/,b=new RegExp("^".concat(o," ").concat(p,"(?: ").concat(s,")?(?: mismo| misma)?$")),f=new RegExp("^".concat(p,"(?: ").concat(s,")?(?: mismo| misma)?$")),x=new RegExp("^(?:(?:el|la) (".concat(c,")|(").concat(Object.keys(r).join("|"),"|ultimo|ultima))(?: ").concat(s,")?").concat(u,"$")),h=/^(?:(?:y|ahora|oye|live|por favor|porfa|ok|vale|bueno|entonces|a ver) )+/,v=/(?: (?:por favor|porfa|ahora|ya|entonces))+$/,y=/(?: en| a) (?:(?:una |otra )?pestana nueva|(?:una )?nueva pestana|otra pestana)$/,w=/ (?:en (?:el repositorio|el sitio(?: de la fuente| original| web)?|su sitio(?: web)?|la fuente|la ficha original)|(?:la )?ficha original)$/,k=new RegExp("^(".concat(n,") (?:la )?ficha original (del|de la|de) "));function j(e){let t=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9º°]+/g," ").trim().replace(v,"").trim();return y.test(t)||w.test(t)||k.test(t)||/\bficha original\b/.test(t)}let N=/^(?:por favor )?(?:abre|abreme|abrir|muestra|muestrame|mostrar|ver)(?:lo)?(?: en| a)? (?:(?:una |otra )?pestana nueva|(?:una )?nueva pestana|otra pestana)$/;function _(e,t){if("ultimo"===e||"ultima"===e)return t-1;if(e in r)return r[e];let a=e.match(/^(1[0-9]|20|[1-9])/);return a?Number(a[1])-1:null}function q(e){if(e.startsWith("/")&&!e.startsWith("//")&&!e.includes("\\"))return!0;try{let t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch(e){return!1}}function A(e){return new RegExp("^(?:".concat(n,")$")).test(e)}function E(e,t){let a,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=e.replace(/#\s*(?=\d)/g," numero ").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9º°]+/g," ").trim().replace(h,"").replace(v,"").trim(),s=N.test(o),l=y.test(o)||s,i=o.match(k),c=(i?o.replace(k,"$1 ".concat("del"===i[2]?"el ":"de la"===i[2]?"la ":"")):o).replace(y,"").replace(w,"").trim(),u=l||!!i||c!==o.replace(y,"").trim(),p=s?{action:"open",referenced:!0}:function(e){let t=e.match(d);if(t)return{action:A(t[1])?"open":"show",ordinal:t[2]||t[3]||t[4]};let a=e.match(m);if(a)return{action:A(a[1])?"open":"show",ordinal:a[2]};let r=e.match(g);if(r)return{action:"abre"===r[1]?"open":"show",referenced:!0};let n=e.match(b);if(n)return{action:A(n[1])?"open":"show",referenced:!0};if(f.test(e))return{action:"show",referenced:!0,bare:!0};let o=e.match(x);return o?{action:"show",ordinal:o[1]||o[2],bare:!0}:null}(c);if(!p||p.bare&&(!t.length||"describe"===n&&p.ordinal))return null;if(!t.length)return{status:"unavailable",index:null,reason:"empty_panel"};if(p.referenced){if(null===(a=null!==r&&r>=0&&r<t.length?r:1===t.length?0:null))return{status:"unavailable",index:null,reason:"no_reference"}}else{var j;if(null===(a=_(null!==(j=p.ordinal)&&void 0!==j?j:"",t.length)))return null}if(a<0||a>=t.length)return{status:"unavailable",index:a,reason:"out_of_range"};let E=t[a];return"show"==(u?"open":"show")?{status:"show",index:a,source:E}:E.url?q(E.url)?{status:"open",index:a,source:E,url:E.url,disposition:l?"new_tab":"same_tab"}:{status:"unavailable",index:a,reason:"invalid_url"}:{status:"unavailable",index:a,reason:"missing_url"}}
1function C(e,t){switch(e){case"empty_panel":return"Todav\xeda no hay resultados en el panel. Dime primero qu\xe9 buscar.";case"no_reference":return"\xbfCu\xe1l resultado? Di, por ejemplo, \xababre el primero\xbb o \xabmu\xe9strame el segundo\xbb.";case"missing_url":return"Ese resultado no tiene un enlace disponible para abrir. Puedo mostr\xe1rtelo aqu\xed o explicarte de qu\xe9 trata.";case"invalid_url":return"Ese resultado tiene un enlace no permitido y no se puede abrir de forma segura.";default:return"El panel tiene ".concat(t," ").concat(1===t?"resultado":"resultados","; elige uno dentro de ese rango.")}}function z(e){var t,a;let r=null===(t=e.author.split(";")[0])||void 0===t?void 0:t.trim().replace(/[,.]+$/,""),n=null===(a=e.year.match(/\b(?:1[5-9]|20)\d{2}\b/))||void 0===a?void 0:a[0];return"Aqu\xed est\xe1 \xab".concat(e.title,"\xbb").concat(r?", de ".concat(r):"").concat(n?", ".concat(n):"",". Puedes decir \xab\xe1brelo\xbb o \xabde qu\xe9 trata\xbb.")}}}]);
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.