sass-template-common 0.1.93 → 0.1.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10010,6 +10010,7 @@ const i0 = "_content_cu8lm_1", c0 = "_title_cu8lm_18", gr = {
|
|
|
10010
10010
|
imagesizes: e.preview.sizes[0]?.scale
|
|
10011
10011
|
});
|
|
10012
10012
|
if (!r) return;
|
|
10013
|
+
console.log("response", r.data.data[0]);
|
|
10013
10014
|
const o = r.data.data[0]?.external?.iframe;
|
|
10014
10015
|
return /* @__PURE__ */ a(
|
|
10015
10016
|
"div",
|
|
@@ -10030,11 +10031,12 @@ const i0 = "_content_cu8lm_1", c0 = "_title_cu8lm_18", gr = {
|
|
|
10030
10031
|
[ot.videoYouTube]: h0,
|
|
10031
10032
|
[ot.iframe]: g0
|
|
10032
10033
|
}, w0 = ({ news: e }) => {
|
|
10034
|
+
console.log("news", e.config);
|
|
10033
10035
|
const { config: t, hascontent: n, info: r } = e, o = t.articlepreview, s = r.link.internal, i = n?.hasgalleryimages;
|
|
10034
10036
|
if (o === ot.imagen && i)
|
|
10035
10037
|
return /* @__PURE__ */ a("div", { className: pr.content, children: /* @__PURE__ */ a(Eo, { newsformated: e, internal: s }) });
|
|
10036
10038
|
const c = o ? A0[o] : null;
|
|
10037
|
-
return c ? /* @__PURE__ */ a("div", { className: pr.content, children: /* @__PURE__ */ a(c, { newsformated: e, internal: s }) }) : null;
|
|
10039
|
+
return console.log("PreviewComponent", c), c ? /* @__PURE__ */ a("div", { className: pr.content, children: /* @__PURE__ */ a(c, { newsformated: e, internal: s }) }) : null;
|
|
10038
10040
|
}, y0 = (e) => {
|
|
10039
10041
|
const { content: t, title: n, slot_id: r } = e, o = e.slot_id && e.slot_id !== "Nota_1";
|
|
10040
10042
|
return t && t.length !== 0 && /* @__PURE__ */ a(me, { title: n, titleUrl: e.titleUrl, children: /* @__PURE__ */ a(xt, { slot_id: r, cardWidth: 200, children: t.map((s, i) => {
|
|
@@ -10374,7 +10376,7 @@ const wr = {
|
|
|
10374
10376
|
getVideos: l
|
|
10375
10377
|
} = e, u = e.slug === "liveblogs", { SHOW_NEWS_MORE_NEWS: f, SHOW_NEWS_RELATED_NEWS: m } = J();
|
|
10376
10378
|
if (!(!s || !s[0]))
|
|
10377
|
-
return console.log("news[0]", s[0]), /* @__PURE__ */ a(Y, { children: /* @__PURE__ */ h(Af, { className: la.contentLayout2, children: [
|
|
10379
|
+
return console.log("news[0]", s[0]), console.log("isLiveBlog", u), /* @__PURE__ */ a(Y, { children: /* @__PURE__ */ h(Af, { className: la.contentLayout2, children: [
|
|
10378
10380
|
/* @__PURE__ */ a(
|
|
10379
10381
|
Nf,
|
|
10380
10382
|
{
|
|
@@ -126,5 +126,5 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
|
126
126
|
${I}
|
|
127
127
|
<figcaption>${G}</figcaption>
|
|
128
128
|
</figure>
|
|
129
|
-
`}}catch(C){console.error("insertVideos error for",g,C),y=""}else y=f;o=u,a+=y,s.lastIndex=u}return a+=e.slice(o),a}async function dd(e){const{news:t,banners:a,newsRelatedResponses:o,slug:s,itemList:r,socials:i,getVideos:c}=e;let d=t?.body?.rendered??"";d=d.replace(/ /g,""),d=rd(d,a),d=id(d),d=await Ws(d),d=await cd(d,e.texts,o),d=await ld(d,c),d=od(d),d=sd(d);const l=t.main.sources??[];return n.jsxs("div",{className:Nn.content,children:[s!=="liveblogs"&&e.showHeaderImage?t.hascontent?.hasgalleryimages?n.jsx(Aa,{newsformated:t,internal:t.info.link.internal}):n.jsx(ws,{preview:t.preview}):null,n.jsx(fe,{banners:a,name:"block_1"}),n.jsx("div",{className:Nn.journalistArticleContent,children:n.jsx(Rl,{autorIcon:e.autorIcon,socials:i,news:t,texts:e.texts,noteShare:e.noteShare,paths:e.paths})}),n.jsx(td,{summary:t.main.summary}),n.jsx("div",{className:Nn.contentNews,suppressHydrationWarning:!0,id:"content-news-section",dangerouslySetInnerHTML:{__html:d}}),n.jsx(Jl,{texts:e.texts,itemList:r,banners:a,slug:s}),l.length>0&&n.jsxs("div",{className:Nn.noteSource,children:[n.jsx(ad,{}),n.jsx("p",{children:e.texts.noteSource+(l.length===1?"":"s")+": "+l.map(h=>h.name).join(", ")})]})]})}const Ys={content:"_content_cu8lm_1",title:"_title_cu8lm_18"},Ks=async({newsformated:e,internal:t})=>{if(!t)return;const o=await new Ee().getNewsMultimedia({path:t,imagesizes:e.preview.sizes[0]?.scale});if(!o)return;const s=o.data.data[0]?.videos.filter(r=>r.type==="video-embedded")[0];return n.jsxs("div",{className:Ys.content,children:[n.jsx("div",{dangerouslySetInnerHTML:{__html:s?.code??""}}),n.jsx("p",{className:Ys.title,children:s?.title})]})},ya={content:"_content_cu8lm_1",title:"_title_cu8lm_18"},Js=async({newsformated:e,internal:t})=>{if(!t)return;const o=await new Ee().getNewsMultimedia({path:t,imagesizes:e.preview.sizes[0]?.scale});if(!o)return;const s=o.data.data[0]?.videos.filter(r=>r.type==="video-youtube")[0];return n.jsxs("div",{className:ya.content,children:[n.jsx("iframe",{className:ya.iframeStyled,src:`https://www.youtube.com/embed/${s?.code??""}`,frameBorder:"0",allowFullScreen:!0}),n.jsx("p",{className:ya.title,children:s?.title})]})},hd={content:"_content_ezbiw_1"},Zs=async({newsformated:e,internal:t})=>{if(!t)return;const o=await new Ee().getNews({path:t,imagesizes:e.preview.sizes[0]?.scale});if(!o)return;const s=o.data.data[0]?.external?.iframe;return n.jsx("div",{className:hd.content,dangerouslySetInnerHTML:{__html:s??""}})},Xs={content:"_content_156j7_1"},nt={imagen:"imagen",videoEmbedded:"videoEmbedded",videoYouTube:"videoYouTube",iframe:"iframe"},ud={[nt.videoEmbedded]:Ks,[nt.videoYouTube]:Js,[nt.iframe]:Zs},fd=({news:e})=>{const{config:t,hascontent:a,info:o}=e,s=t.articlepreview,r=o.link.internal,i=a?.hasgalleryimages;if(s===nt.imagen&&i)return n.jsx("div",{className:Xs.content,children:n.jsx(Aa,{newsformated:e,internal:r})});const c=s?ud[s]:null;return c?n.jsx("div",{className:Xs.content,children:n.jsx(c,{newsformated:e,internal:r})}):null},md=e=>{const{content:t,title:a,slot_id:o}=e,s=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&n.jsx(he,{title:a,titleUrl:e.titleUrl,children:n.jsx(it,{slot_id:o,cardWidth:200,children:t.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:s?r.main.title.home:r.main.title.section}}};return n.jsx(jt,{...c,titleGradient:!0,paths:e.paths},i)})})})},gd=e=>{const{content:t,title:a,slot_id:o}=e,s=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&n.jsx(he,{title:a,titleUrl:e.titleUrl,children:n.jsx(it,{slot_id:o,cardWidth:343,cardGap:32,visibleItems:3,children:t.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:s?r.main.title.home:r.main.title.section}}};return n.jsx(jt,{...c,titleGradient:!0,paths:e.paths},i)})})})},pd=e=>{const{content:t,title:a,slot_id:o}=e,s=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&n.jsx(he,{title:a,titleUrl:e.titleUrl,children:n.jsx(it,{slot_id:o,fullPageWidth:!0,visibleItems:1,pagination:!0,cardGap:0,children:t.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:s?r.main.title.home:r.main.title.section}}};return E.createElement(jt,{...c,key:i,titleGradient:!0,paths:e.paths})})})})},En=e=>{const t={};for(const a in e)a.startsWith("--")&&(t[a]=e[a]);return t},dt={headerSection:"_headerSection_1c69w_1",title:"_title_1c69w_11",subtitle:"_subtitle_1c69w_23",newsContent:"_newsContent_1c69w_36",containerCards:"_containerCards_1c69w_44",image:"_image_1c69w_50",blockHeadContainer:"_blockHeadContainer_1c69w_56"},Ad=e=>{const{content:t,title:a,isVideo:o}=e;if(!t||t.length===0)return;const s=t[0],r=t.slice(1),i=e.slot_id&&e.slot_id!=="Nota_1";return s&&r&&n.jsxs(he,{title:a,titleUrl:e.titleUrl,children:[n.jsx("div",{className:dt.headerSection,children:n.jsxs("a",{style:{"--heightImageOverwriteMobile":"200%"},className:dt.image,href:s?.info?.link?.url,target:s?.info?.link?.target,children:[n.jsxs("div",{className:dt.blockHeadContainer,children:[n.jsx("p",{className:dt.title,children:s?.main?.title.home}),s?.main?.subtitle?.rendered&&n.jsx("p",{className:dt.subtitle,children:s?.main?.subtitle?.striped})]}),n.jsx(_e,{preview:s.preview})]})}),n.jsxs("div",{className:dt.containerCards,children:[n.jsx("div",{className:"banner-context",style:{order:1},children:e.banner}),n.jsx("div",{className:dt.newsContent,children:Array.isArray(r)&&r.map((c,d)=>{const l={...c,main:{...c.main,title:{...c.main.title,section:i?c.main.title.home:c.main.title.section}}};return n.jsx("div",{style:{order:d},children:n.jsx(De,{...l,isVideo:o,paths:e.paths})},d)})})]})]})},Rs={banner:e=>n.jsx(fe,{...e,name:e.slot_id.replace("Home","block")}),readest:e=>n.jsx(fn,{...e}),"Modulo 1x3":e=>n.jsx(ua,{...e}),"Modulo 1x4":e=>n.jsx(Ds,{...e}),"Modulo 1x5":e=>n.jsx(Ms,{...e}),"Destacado noticias":e=>n.jsx(Ls,{...e}),"Destacado full width":e=>n.jsx(Ad,{...e}),"Destacado videos":e=>n.jsx(js,{...e}),"Carrusel card":e=>n.jsx($s,{...e}),"Carrusel story":e=>n.jsx(md,{...e}),"Carrusel owl":e=>n.jsx(gd,{...e}),"Modulo fotogaleria":e=>n.jsx(pd,{...e}),"Carrusel opinion":e=>n.jsx(Hs,{...e}),"Modulo 1x3 card":e=>n.jsx(Gs,{...e})};function wa({component:e,slot_id:t,data:a,banners:o}){if(o)return Rs[e]&&n.jsx("div",{className:"home-slot",style:En(a),children:Rs[e]({...a,banners:o,slot_id:t})})}function yd({children:e,stylesConfigEntry:t}){return n.jsx("div",{className:"home-slot",style:En(t),children:e})}const er={Diario:e=>{if(!e?.data||e.data.length===0)return;const t=e.data.slice(1);return n.jsx(xs,{...e.data[0],itemReverseOrder:!0,isLarge:!0,block:t,banners:e.banners,showSuper:e.showSuper,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},"Diario con imagen":e=>{if(!e?.data||e.data.length===0)return;const t=e.data.slice(1);return n.jsx(xs,{...e.data[0],itemReverseOrder:!0,isLarge:!0,showSuper:e.showSuper,block:t,banners:e.banners,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},Super:e=>n.jsx(_t,{...e.data[0],paths:e.paths}),"3 notas verticales":e=>n.jsx(Ul,{content:e.data,customLargeSection:e.customLargeSection,customSlimSection:e.customSlimSection,paths:e.paths}),"3 notas horizontales":e=>n.jsx(xl,{content:e.data,customLargeSection:e.customLargeSection,customSmallSection:e.customSmallSection,paths:e.paths})},Tn=({component:e,data:t,banners:a,rightOnlyBanner:o})=>n.jsx("div",{style:En(t),children:er[e]&&er[e]({...t,rightOnlyBanner:o,banners:a})}),wd=({slots:e,DYNAMIC_SLOT_SUBINDEXES:t,stylesConfig:a,AutorIcon:o,config:s,banners:r,showTagBySection:i})=>{const c=[],l=t,h=Object.keys(e).length/l;for(let u=1;u<=h;u++)for(let f=1;f<=l;f++){const g="Home_"+u+"_"+f;!e[g]||!e[g].blockSass||!e[g].blockSass[0]||!e[g].blockSass[0].value||!e[g].blockSass[0].block||e[g].blockSass[0].block==="No Mostrar"||c.push(n.jsxs(os,{show:!!e[g].content?.data,order:(u-1)*l+(f-1),children:[n.jsx(wa,{component:e[g].blockSass[0].block,banners:r,slot_id:g,data:{...e[g].blockSass[0].block?a[e[g].blockSass[0].block]:[],content:e[g].content?.data??[],title:e[g].blockSass[0].title??void 0,titleUrl:e[g].blockSass[0].link??void 0,autorIcon:n.jsx(o,{}),paths:s.paths,showTagBySection:i}}),n.jsx(Ze,{children:n.jsx(Qe,{banners:r,index:"dynamic_"+u+"_"+f})})]},u+"_"+f))}return c},bd=({mainBlock:e,StylesConfigMain:t,config:a,banners:o})=>{const{PUBLIC_ENV:s}=K();if(s!=="local")return null;const r=e?.news?.data||[],i=(c,d)=>({...e?.news,...t[c],data:r.slice(0,d),paths:a.paths});return n.jsxs(n.Fragment,{children:[n.jsx(Tn,{component:"Super",data:i("Super",1),banners:o}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:1})}),n.jsx(Tn,{component:"3 notas verticales",data:i("3 notas verticales",3),banners:o}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:1})}),n.jsx(Tn,{component:"3 notas horizontales",data:i("3 notas horizontales",3),banners:o}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:1})})]})},vd=e=>{const{config:t,hascontent:a}=e,o=t.articlepreview,s=[nt.videoEmbedded,nt.videoYouTube,nt.iframe];return!!(o===nt.imagen&&a?.hasgalleryimages||s.includes(o))},Cd=async e=>{const{custom_complement:t,ranking:a=[],banners:o,autor:s=[],news:r=[],newsRelatedResponses:i=[],itemList:c=[],socials:d,getVideos:l}=e,h=e.slug==="liveblogs",{SHOW_NEWS_MORE_NEWS:u,SHOW_NEWS_RELATED_NEWS:f}=K();if(!(!r||!r[0]))return console.log("news[0]",r[0]),n.jsx(n.Fragment,{children:n.jsxs($l,{className:pa.contentLayout2,children:[n.jsx(zl,{option:e.slug,news:r,paths:e.paths}),n.jsx(Qe,{banners:o,index:1}),!h&&n.jsx(fd,{news:r[0]}),n.jsx(Hl,{texts:e.texts,paths:e.paths,slug:e.slug,itemList:c,ranking:a,bannerTop:n.jsx(fe,{banners:o??[],name:"right_1"}),banner:n.jsx(fe,{banners:o??[],name:"right_2"}),complement:n.jsxs("div",{id:"comentarios",suppressHydrationWarning:!0,children:[s.length>0&&n.jsx(Is,{texts:e.texts,autorIcon:e.autorIcon,autor:s[0],paths:e.paths}),r[0].authors.length>1&&n.jsx(ks,{news:r[0],autorIcon:e.autorIcon,paths:e.paths,texts:e.texts}),n.jsx("div",{className:pa.tagContent,children:n.jsx(Ts,{tags:r[0]?.keywords?.tags,paths:e.paths})}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2rem"},suppressHydrationWarning:!0,children:[e.showComments&&n.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"comment",internalPath:e.internalPath,COMMENTS_VARS:e.COMMENTS_VARS}))}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:2})}),f&&n.jsxs(n.Fragment,{children:[n.jsx(wa,{component:"Carrusel card",banners:[],slot_id:"Nota_1",data:{...e.stylesConfig["Carrusel card"],content:e.relatedNewsList??[],title:e.texts.relatedNewsTitle,titleUrl:void 0}}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:3})})]}),u&&n.jsxs(n.Fragment,{children:[n.jsx(he,{title:e.texts.moreNewsTitle,children:n.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"more",stylesConfig:e.stylesConfig,section:r[0].info.section?.slug??"",currentNews:r[0]}))})}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:4})})]}),t&&t()]})]}),children:n.jsxs("section",{style:{"--avatar-content-align-items-desk":e.slug==="liveblogs"?"flex-start":"center"},children:[n.jsx(dd,{texts:e.texts,autorIcon:e.autorIcon,socials:d,news:r[0],banners:o,newsRelatedResponses:i,itemList:c,slug:e.slug,getVideos:l,noteShare:e.noteShare,paths:e.paths,showHeaderImage:!vd(r[0])}),n.jsx(fe,{banners:o??[],name:"block_3"})]})})]})})},Et={content:"_content_1tl6i_1",contentInfo:"_contentInfo_1tl6i_24",imageStyled:"_imageStyled_1tl6i_41",name:"_name_1tl6i_46",description:"_description_1tl6i_51",contentInfoWithoutImg:"_contentInfoWithoutImg_1tl6i_104"},_d=async e=>{const t=e.img?await ue(e.img):"";return n.jsx("section",{className:Et.content,children:n.jsxs("div",{className:`${Et.contentInfo} ${t?"":Et.contentInfoWithoutImg}`,children:[e.img&&n.jsx("img",{fetchPriority:"low",loading:"lazy",className:Et.imageStyled,src:t}),n.jsx("h1",{className:Et.name,children:e.tag}),e.description&&n.jsx("div",{className:Et.description,dangerouslySetInnerHTML:{__html:e.description}})]})})},In={content:"_content_7wvro_1",contentInfo:"_contentInfo_7wvro_23",name:"_name_7wvro_34",description:"_description_7wvro_43"},Sd=e=>n.jsx("section",{className:In.content,style:{color:e.textColor,"--backDropHeigth":e.backDropHeigth?e.backDropHeigth:"100%",padding:e.sectionPadding??"","--backgroundColor":e.backgroundColor},children:n.jsxs("div",{className:In.contentInfo,children:[n.jsx("h1",{className:In.name,style:{color:e.textColor},children:e.tag}),e.description&&n.jsx("div",{style:{color:e.textColor},className:In.description,dangerouslySetInnerHTML:{__html:e.description}})]})}),Nd=e=>{const{option:t,entity:a}=e;switch(t){case"op1":return n.jsx(_d,{tag:a?.name??"",img:a?.image?.url??"",description:a?.description?a?.description:""});case"op2":return n.jsx(Sd,{tag:a?.name??"",description:a?.description?a?.description:"",backDropHeigth:e.backDropHeigth,backgroundColor:e.backgroundColor,sectionPadding:e.sectionPadding,textColor:e.textColor});default:return n.jsx(n.Fragment,{})}},Ft={content:"_content_gxziw_1",buttonStyled:"_buttonStyled_gxziw_9",searchStyled:"_searchStyled_gxziw_21",inputStyled:"_inputStyled_gxziw_32",inputStyledTest:"_inputStyledTest_gxziw_51"},Ed=e=>n.jsx("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n.jsx("g",{opacity:"0.8",children:n.jsx("path",{d:"M47.8043 46.6003L47.6635 46.7758L47.8232 46.9342L56.4762 55.5171C56.4768 55.5177 56.4774 55.5184 56.478 55.519C56.8524 55.9072 57.0616 56.4256 57.0616 56.965C57.0616 57.5048 56.8521 58.0234 56.4774 58.4117C56.2839 58.6065 56.0539 58.7611 55.8005 58.8667C55.5466 58.9724 55.2743 59.0269 54.9993 59.0269C54.7243 59.0269 54.452 58.9724 54.1981 58.8667C53.9442 58.7609 53.7138 58.6059 53.5201 58.4106L53.5194 58.4099L44.9327 49.8232L44.7743 49.6648L44.5995 49.805C40.4597 53.1252 35.2051 54.7331 29.9162 54.2981C24.6272 53.863 19.706 51.4181 16.1643 47.4661C12.6227 43.514 10.7298 38.3552 10.875 33.0503C11.0201 27.7455 13.1923 22.6979 16.9447 18.9455C20.6972 15.193 25.7448 13.0209 31.0496 12.8757C36.3544 12.7305 41.5133 14.6234 45.4653 18.165C49.4174 21.7067 51.8623 26.6279 52.2974 31.9169C52.7324 37.2058 51.1245 42.4604 47.8043 46.6003ZM22.4528 47.4552C25.1799 49.2774 28.3861 50.25 31.666 50.25C36.0641 50.25 40.2822 48.5029 43.3921 45.3929C46.5021 42.2829 48.2493 38.0649 48.2493 33.6667C48.2493 30.3868 47.2767 27.1806 45.4545 24.4535C43.6323 21.7264 41.0423 19.6008 38.0121 18.3457C34.9819 17.0905 31.6476 16.7621 28.4307 17.402C25.2139 18.0419 22.259 19.6213 19.9398 21.9405C17.6205 24.2597 16.0411 27.2146 15.4013 30.4314C14.7614 33.6483 15.0898 36.9827 16.345 40.0129C17.6001 43.0431 19.7256 45.633 22.4528 47.4552Z",fill:"white",stroke:"white",strokeWidth:"0.5"})})}),Td=e=>n.jsx("form",{className:Ft.content,style:{height:e.hasContent?"218px":"50vh"},children:n.jsxs("div",{className:Ft.inputStyled,children:[n.jsx("input",{className:Ft.inputStyledTest,defaultValue:e.query,name:"query",placeholder:e.texts.searchKeyWord+"..."}),n.jsx("button",{className:Ft.buttonStyled,type:"submit",children:n.jsx(Ed,{className:Ft.searchStyled})})]})}),ba={content:"_content_io3tv_1",newsContentSection:"_newsContentSection_io3tv_5",itemContent:"_itemContent_io3tv_10"},Id=e=>{const{data:t,option:a,autor:o,page:s,banners:r,pathname:i,ranking:c,currentPage:d,slug:l,texts:h={}}=e,u=[5,10,15],f={5:1,10:2,15:3};switch(a){case"op1":return n.jsx(n.Fragment,{children:n.jsxs(oa,{children:[n.jsx(Cs,{autor:o[0],autorIcon:e.autorIcon}),n.jsx(ra,{paths:e.paths,ranking:c,readestTitle:h.readestTitle??"",bannerTop:n.jsx(fe,{banners:r??[],name:"right_1"}),banner:n.jsx(fe,{banners:r??[],name:"right_2"}),children:n.jsx("section",{className:ba.content,children:t.length>0?n.jsx(yn,{className:[ba.newsContentSection,"padding-0"].join(" "),paginatorComponent:n.jsx(Dt,{texts:h,pathname:i,query:"",currentPage:d,maxPages:e.paginationLimit,showNext:!(t.length<e.newsListLimit)}),children:Array.isArray(t)&&t?.map((g,m)=>n.jsxs(E.Fragment,{children:[u.includes(m+1)&&n.jsx("div",{className:ba.itemContent+" banner-context",children:n.jsx(fe,{banners:r??[],name:`block_2_${f[m+1]}`})}),n.jsx(Sn,{autorIcon:e.autorIcon,item:g,option:l,paths:e.paths},m)]},m))}):n.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:n.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:h.autorNotResultMessage})})})})]})});case"op2":return n.jsx(n.Fragment,{children:n.jsxs(oa,{children:[n.jsx(_s,{autor:o[0],autorIcon:e.autorIcon}),Array.isArray(t)?n.jsxs(n.Fragment,{children:[n.jsx(ua,{content:t,title:"",hasLines:!0,banners:e.banners,bannerPositionIndex:[1,6,12],paths:e.paths,slot_id:"block_2"}),n.jsx(Dt,{texts:h,query:"",pathname:i,maxPages:Number(e.paginationLimit),currentPage:Number(s),showNext:!((t.length??0)<Number(e.newsListLimit))})]}):n.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:n.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:h.autorNotResultMessage})})]})});default:return n.jsx(n.Fragment,{})}},tr={content:"_content_pq89v_1",videoContent:"_videoContent_pq89v_9"},Vt={container:"_container_1xr2t_1",playStyled:"_playStyled_1xr2t_6",imageStyled:"_imageStyled_1xr2t_13",longer:"_longer_1xr2t_26",contentNews:"_contentNews_1xr2t_31",tagContent:"_tagContent_1xr2t_51",tag:"_tag_1xr2t_51",titular:"_titular_1xr2t_68",small:"_small_1xr2t_81",figure:"_figure_1xr2t_87",backDrop:"_backDrop_1xr2t_92",backDropAux:"_backDropAux_1xr2t_100"},nr=async e=>{const{size:t="longer",video:a}=e,o=a.main.image.sizes[0]?.url??"";return n.jsx("figure",{className:Vt.figure,children:n.jsxs("span",{className:Vt.backdrop,children:[n.jsx("span",{className:Vt.backDropAux}),n.jsx(O,{href:a.info.link.url,target:a.info.link.target,children:n.jsxs("div",{children:[a.main.image.sizes.map(async(s,r)=>s.width>=580?n.jsx("source",{media:"(width >=900px)",srcSet:await ue(s.url)},r):n.jsx("source",{media:"(width <900px)",srcSet:await ue(s.url)},r)),n.jsx("img",{fetchPriority:"low",loading:"lazy",className:[Vt.imageStyled,Vt[t]].join(" "),alt:"",src:o?await ue(o):""})]})})]})})},kd=e=>{const{videos:t}=e;return n.jsx("div",{className:tr.content,children:n.jsx(yt,{children:n.jsx(he,{title:"Videos",isTitle:!0,children:n.jsxs("div",{className:tr.videoContent,children:[n.jsx(nr,{video:t[0]}),n.jsx("div",{style:{display:"flex",flexDirection:"column"},children:t.slice(1).map((a,o)=>n.jsx(nr,{size:"small",video:a},`video-small-${o}`))})]})})})})},ht={content:"_content_ruy5q_1",videoContent:"_videoContent_ruy5q_9",articleSection:"_articleSection_ruy5q_21",contentLatout:"_contentLatout_ruy5q_31",title:"_title_ruy5q_36",article:"_article_ruy5q_21",correspondent:"_correspondent_ruy5q_64"},ar={container:"_container_1rq2h_1",playStyled:"_playStyled_1rq2h_9"},xd=e=>{const{video:t}=e;return n.jsx(O,{href:t.info.link.url?t.info.link.url:void 0,target:t.info.link.target,children:n.jsxs("section",{className:ar.container,children:[n.jsx(_e,{isLarge:!0,preview:{sizes:t.main.image.sizes,description:t.main.description}}),n.jsx(wt,{className:ar.playStyled})]})})},Ud=e=>{const t=()=>e?.video.main.author?`${e?.video.main.author} - ${xe(e.video.info.date.created)}`:e?.video.main.author;return n.jsx("div",{className:ht.content,children:n.jsx(yt,{className:ht.contentLatout,children:n.jsx(he,{title:"Videos",isTitle:!0,children:n.jsxs("div",{className:ht.videoContent,children:[n.jsx(xd,{video:e.video}),n.jsxs("div",{className:ht.articleSection,children:[n.jsx(O,{className:ht.title,href:e.video.info.link.url,target:e.video.info.link.target,children:e.video.main.title}),n.jsx("p",{className:ht.article,children:Ue(e.video.main.description)}),n.jsx("p",{className:ht.correspondent,children:t()})]})]})})})})},qd=e=>{switch(e.option){case"op1":return n.jsx(kd,{videos:e.data});case"op2":return n.jsx(Ud,{video:e.data[0]});default:return n.jsx(n.Fragment,{})}};function Ld({containerId:e,containerId2:t}){return E.useEffect(()=>{try{let a=function(){const h=window.twttr;h?.widgets?h.widgets.load(o):l<10?(l++,requestAnimationFrame(a)):console.warn("No se pudo cargar widgets de Twitter")};const o=document.getElementById(e),s=document.getElementById(t);if(!o&&!s)return;const r=o?.querySelectorAll("script[src]")??[],i=s?.querySelectorAll("script[src]")??[];[...r,...i].forEach(h=>{const u=document.createElement("script");Array.from(h.attributes).forEach(f=>{u.setAttribute(f.name,f.value)}),h.replaceWith(u)});const d=document.querySelectorAll('script[src*="platform.twitter.com/widgets.js"]');if(d)for(let h=0;h<d.length;h++)d[h]?.remove();let l=0;if(document.querySelector('script[src*="platform.twitter.com/widgets.js"]'))a();else{const h=document.createElement("script");h.src="https://platform.twitter.com/widgets.js",h.async=!0,h.onload=a,document.body.appendChild(h)}}catch(a){console.warn("Error al procesar embeds de Twitter",a)}},[e]),null}const Bd=e=>{const{isVideo:t=!1,isLarge:a=!1,hasShadow:o=!1,BackDropAuxHeigthMobile:s}=e,r=E.useMemo(()=>e?.preview?.sizes||[],[e?.preview?.sizes]);if(!r.length||!r[0]?.url||r[0]?.url==="")return n.jsx("div",{className:se.imagePlaceholder});const{PUBLIC_API_HOST:i,PUBLIC_ENV:c}=K();return n.jsx("figure",{className:se.figure,children:n.jsxs("span",{className:se.backdrop,children:[n.jsx("span",{className:se.backdropAux,style:{height:s||"56.25%"}}),n.jsxs("picture",{children:[n.jsx("img",{fetchPriority:"low",loading:"lazy",className:se.imageStyled,alt:e.preview?.description||"",src:(c==="local"?i:"")+r[0]?.url,style:{boxShadow:o?"0px 4px 8px 0px #00000033":"0px"}}),t&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:se.boxPlayIcon,style:{height:a?"40%":"72px"}}),n.jsx(wt,{className:se.playStyled,style:{width:a?"3rem":"27px",height:a?"3rem":"27px",marginBottom:a?"18px":".5rem",marginLeft:a?"30px":".5rem"}})]})]})]})})},Od=e=>n.jsx("svg",{width:"41",height:"33",viewBox:"0 0 41 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n.jsx("path",{d:"M17.9576 21.2985C16.8233 21.2985 15.9277 22.194 15.9277 23.3283C15.9277 24.4627 16.8233 25.3582 17.9576 25.3582C19.0919 25.3582 19.9874 24.4627 19.9874 23.3283C19.9874 22.194 19.0919 21.2985 17.9576 21.2985ZM17.9576 19.2686C19.0919 19.2686 19.9874 18.3731 19.9874 17.2388C19.9874 16.1045 19.0919 15.2089 17.9576 15.2089C16.8233 15.2089 15.9277 16.1045 15.9277 17.2388C15.9277 18.3731 16.8233 19.2686 17.9576 19.2686ZM17.9576 13.1791C19.0919 13.1791 19.9874 12.2836 19.9874 11.1492C19.9874 10.0149 19.0919 9.11938 17.9576 9.11938C16.8233 9.11938 15.9277 10.0149 15.9277 11.1492C15.9277 12.2836 16.8233 13.1791 17.9576 13.1791Z",fill:"#7B888A"})}),or={info:{section:{name:"",slug:"",url:""},link:{url:"/",target:"",canonical:!1,internal:""},date:{date:"",created:0,modified:0,firstpublish:0,lastpublish:0}},config:{zonehome:void 0,priorityhome:"",zonesection:"",prioritysection:"",homepreview:"",showcomments:!0,showtime:!0,showauthor:!0,showuppertitle:!0,showsubtitle:!0,showads:!0},main:{title:{home:"",section:"",article:""},subtitle:{rendered:"",striped:""},tags:[]},authors:[{firstname:"",lastname:"",fullname:"",image:void 0,name:"",internaluser:!1}],preview:void 0},sr=6,Pd=({section:e,currentNews:t,banner:a,isVisible:o=!1,stylesConfig:s})=>{const[r,i]=E.useState({data:Array.from({length:sr},()=>or)}),[c,d]=E.useState(!1),l=E.useCallback(async()=>{if(!(c||!t?.info?.link?.internal)){d(!0);try{const h=new URLSearchParams({section:e,currentNewsLink:t.info.link.internal}),u=await fetch(`/api/get-more-news?${h}`);if(!u.ok)throw i(void 0),new Error(`HTTP error! status: ${u.status}`);const f=await u.json();i({...f,data:f.data.slice(0,sr)})}catch(h){console.error("[/api/get-more-news] Error:",h.message),i(void 0)}}},[e,t.info.link.internal,c]);return E.useEffect(()=>{o&&l()},[o,r,l]),!r?.data||r.data.length===0?null:n.jsx(Dd,{news:r.data,title:"Más Noticias",...s["Modulo 1x3 Client"]??s["Modulo 1x3"],hasLines:!0,showSubtitle:!0,rounded:!0,banner:a,isVisible:o})},Dd=e=>{const{news:t,hasLines:a=!1}=e,o=s=>a&&(s+1)%3!==0?ga.contentSeparator:"";return n.jsx("div",{className:ga.newsContent,style:{gap:a?"30px":"20px","--gridTemplateModlule":a?"repeat(auto-fit, 343px);":"repeat(auto-fit, 380px);"},children:t.map((s,r)=>{const{main:i,authors:c,info:d,preview:l,isVideo:h=!1,config:u,overImage:f="default",isTitle:g=!1,isLarge:m=!1}=s;return n.jsx("div",{className:o(r),style:{order:r},children:n.jsxs("section",{className:Mt.content,children:[n.jsx(O,{title:i?.title?.section,href:d?.link?.url??"invalidUrl","aria-label":i?.title?.section??"nota",target:d?.link?.target,children:n.jsx(Bd,{isVisible:e.isVisible,preview:l,rounded:e.rounded,isVideo:h,isLarge:m,getImageUrl:e.getImageUrl})}),n.jsx("div",{className:Mt.newsDescription,children:n.jsx(Md,{main:i,authors:c,info:d,preview:l,share:e.share,config:u,overImage:f,isTitle:g,paths:s.paths,isVisible:e.isVisible})})]})},r)})})},Md=e=>{const{share:t=!1,cutSubtitle:a=!0}=e,s=(()=>{if(!e?.authors||e.authors.length===0)return"";const r=e.authors[0],i=xe(e.info?.date?.modified);return r&&e?.config?.showtime&&e.config?.showauthor?`${r.fullname} - ${i}`:r&&e.config?.showauthor?r.fullname:e?.config?.showtime?i:""})();return n.jsxs("div",{className:ae.boxInformation,children:[t&&n.jsx(Od,{className:ae.dotStyles}),e?.info?.section?.url&&n.jsxs("div",{className:ae.sectionDescriptionContainer,children:[n.jsx(O,{className:ae.sectionDescription,href:e.info.section.url??"invalidUrl",children:e.info.section.name}),e?.main?.uppertitle&&n.jsx("p",{className:ae.uppertitle,children:e.main.uppertitle})]}),n.jsx("h2",{className:ae.articule,children:n.jsx(O,{className:ae.linkStyled,style:{"--isLink":e?.info?.link?.url?"underline":"none"},"aria-label":e.main?.title?.section??"nota",href:e?.info?.link?.url,target:e?.info?.link?.target,children:e.main?.title?.section})}),e.config?.showsubtitle&&e.main?.subtitle?.striped&&n.jsx("p",{className:ae.description,style:{"--fontSizeSubTitle":e.fontSizeSubTitle,"--lineHeightSubTitle":e.lineHeightSubTitle,"--colorSubTitle":e.colorSubTitle},children:a?Ue(e.main.subtitle.striped):e.main.subtitle.striped}),(e?.config?.showtime||e.config?.showauthor)&&s&&n.jsx(n.Fragment,{children:e.authors?.[0]?.internaluser?n.jsx(O,{className:ae.correspondentLink,href:`/autor/${e.authors[0].name}`,children:s}):n.jsx("div",{className:ae.correspondent,children:s})})]})},jd=({user:e,handleLogout:t,message:a})=>{const o=()=>{const r=document.querySelector(".user-actions-options");r&&r.classList.toggle("show")},s=e.firstname??"Usuario";return n.jsx("div",{className:"comment-item",children:n.jsxs("div",{style:{display:"flex",gap:"14px"},children:[e&&e.picture&&e.picture!==""?n.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):n.jsx("div",{className:"comment-avatar",children:s.charAt(0).toUpperCase()}),n.jsxs("div",{style:{flex:1},children:[n.jsxs("div",{className:"comment-header",children:[n.jsxs("span",{className:"comment-username user-welcome",children:["Hola ",s,"!"]}),n.jsx("div",{className:"user-actions-options",children:n.jsx("button",{onClick:()=>{t()},children:"Cerrar Sesion"})}),n.jsx("button",{className:"user-actions-span",onClick:o,children:n.jsx(vn,{width:13,height:13,fill:"black"})})]}),n.jsx("p",{className:"comment-text",children:a})]})]})})},de={overlay:"_overlay_qj491_3",popup:"_popup_qj491_17",title:"_title_qj491_40",optionsContainer:"_optionsContainer_qj491_52",option:"_option_qj491_52",radioInput:"_radioInput_qj491_66",radioCustom:"_radioCustom_qj491_70",optionLabel:"_optionLabel_qj491_97",buttons:"_buttons_qj491_110",cancelButton:"_cancelButton_qj491_117",closeButton:"_closeButton_qj491_118",buttonAlone:"_buttonAlone_qj491_137",reportButton:"_reportButton_qj491_143",successContainer:"_successContainer_qj491_163",thumbsUp:"_thumbsUp_qj491_171",successMessage:"_successMessage_qj491_177",errorMessage:"_errorMessage_qj491_218",loadingContainer:"_loadingContainer_qj491_231"},rr=async(e,t)=>{const{PUBLIC_ENV:a}=K();if(console.log(a,!0),a==="local")return!0;if(!e)return!1;const{CAPTCHA_PROJECT:o,CAPTCHA_KEY_V2:s,COMMENTS_CAPTCHA_API_KEY:r}=t;console.log();try{const i=o,c=s,h=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${i}/assessments?key=${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:c}})})).json();return console.log("reCAPTCHA Enterprise verification result:",h),h.tokenProperties?.valid===!0}catch(i){return console.error("Error verificando reCAPTCHA Enterprise:",i),!1}};async function Qd({publication:e,username:t,id:a,type:o,baseUrl:s,captchaToken:r,apiToken:i,COMMENTS_VARS:c}){if(!e||!t||!a||!o||!r)throw new Error("Faltan parámetros requeridos: publication, username, id, type, captchaToken");if(typeof e!="string"||typeof t!="string"||typeof a!="string"||typeof o!="string"||typeof r!="string")throw new Error("Todos los parámetros deben ser strings");if(!await rr(r,c))throw new Error("Token de captcha inválido");if(!i)throw new Error("Falta el token de API del CMS");const d=`${s}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/report`,l=encodeURIComponent(o),h=new URLSearchParams({publication:e,username:t,id:a,type:l}),u=`${d}?${h.toString()}`;try{console.log("Reporting comment:",{publication:e,username:t,id:a,type:o,encodedType:l,url:u});const f=await oe.post(u,null,{headers:{"User-Agent":"Bluestack","x-api-token":i,"Content-Type":"application/json"}});if(console.log("Report response:",f.data),f.status===200||f.status===201)return{type:"success",message:"Comentario reportado exitosamente",status:f.status,data:f.data};throw new Error(`Respuesta inesperada del servidor: ${f.status}`)}catch(f){if(console.error("Error reporting comment:",f),oe.isAxiosError(f)){const g=f.response?.status,m=f.response?.data;throw g===400?new Error("Datos inválidos para el reporte"):g===401?new Error("Token de API inválido"):g===403?new Error("Acceso denegado para reportar comentario"):g===404?new Error("Comentario no encontrado"):g===409?new Error("El comentario ya fue reportado por este usuario"):g===500?new Error("Error interno del servidor CMS"):new Error(m?.error||m?.message||`Error HTTP ${g}: No se pudo reportar el comentario`)}throw f}}const je={spam:"Es spam o contenido comercial no deseado",inappropriate:"Lenguaje inadecuado",hate:"Discurso o símbolos de odio",misinformation:"Información falsa o fraude",terrorism:"Promueve el terrorismo",intellectual:"Violación de propiedad intelectual",bullying:"Bullying o acoso"};function Gd(e){return je[e]}const ut=300,Ke={username:"anonimo",firstname:"Usuario",lastname:"Anonimo"};function $d(e){const t=e.split(" ");if(t.length!==3)return e;const[a,o,s]=t,r=o.charAt(0).toUpperCase()+o.slice(1).toLowerCase();return`${a} ${r} ${s}`}const va=(e,t)=>{if(!e||!e.current)return{boolean:!1,text:""};const a=e.current?.value||"",o=a.length>ut,{PUBLIC_ENV:s}=K(),r=s==="local",i=a.trim()!==""&&(r||t!=="")&&!o,c=o?`No debes exceder el limite de ${ut} caracteres.`:"Debes completar todos los campos para comentar.";return{boolean:i,text:c}},ir=e=>{const t=e.cookie.split("; ").find(a=>a.startsWith("reported="));if(!t)return[];try{return JSON.parse(decodeURIComponent(t.split("=")[1]??""))}catch{return[]}},Hd=(e,t)=>{const a=ir(e);a.includes(t)||(a.push(t),e.cookie=`reported=${encodeURIComponent(JSON.stringify(a))}; path=/; max-age=${3600*24*1}`)};function zd(e){const[t,a]=e.split("@");if(!t||!a)return e;let o="";t.length<=2?o=t[0]+"*":o=t[0]+"*".repeat(t.length-2)+t[t.length-1];const s=a.lastIndexOf(".");if(s===-1)return`${o}@${a}`;const r=a.slice(0,s),i=a.slice(s);let c="";return r.length<=2?c=r[0]+"*":c=r[0]+"*".repeat(r.length-2)+r[r.length-1],`${o}@${c}${i}`}var kn={exports:{}},xn={exports:{}},te={};var cr;function Fd(){if(cr)return te;cr=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,N=e?Symbol.for("react.scope"):60119;function _(v){if(typeof v=="object"&&v!==null){var k=v.$$typeof;switch(k){case t:switch(v=v.type,v){case d:case l:case o:case r:case s:case u:return v;default:switch(v=v&&v.$$typeof,v){case c:case h:case m:case g:case i:return v;default:return k}}case a:return k}}}function I(v){return _(v)===l}return te.AsyncMode=d,te.ConcurrentMode=l,te.ContextConsumer=c,te.ContextProvider=i,te.Element=t,te.ForwardRef=h,te.Fragment=o,te.Lazy=m,te.Memo=g,te.Portal=a,te.Profiler=r,te.StrictMode=s,te.Suspense=u,te.isAsyncMode=function(v){return I(v)||_(v)===d},te.isConcurrentMode=I,te.isContextConsumer=function(v){return _(v)===c},te.isContextProvider=function(v){return _(v)===i},te.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===t},te.isForwardRef=function(v){return _(v)===h},te.isFragment=function(v){return _(v)===o},te.isLazy=function(v){return _(v)===m},te.isMemo=function(v){return _(v)===g},te.isPortal=function(v){return _(v)===a},te.isProfiler=function(v){return _(v)===r},te.isStrictMode=function(v){return _(v)===s},te.isSuspense=function(v){return _(v)===u},te.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===o||v===l||v===r||v===s||v===u||v===f||typeof v=="object"&&v!==null&&(v.$$typeof===m||v.$$typeof===g||v.$$typeof===i||v.$$typeof===c||v.$$typeof===h||v.$$typeof===y||v.$$typeof===C||v.$$typeof===N||v.$$typeof===p)},te.typeOf=_,te}var ne={};var lr;function Vd(){return lr||(lr=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,N=e?Symbol.for("react.scope"):60119;function _(B){return typeof B=="string"||typeof B=="function"||B===o||B===l||B===r||B===s||B===u||B===f||typeof B=="object"&&B!==null&&(B.$$typeof===m||B.$$typeof===g||B.$$typeof===i||B.$$typeof===c||B.$$typeof===h||B.$$typeof===y||B.$$typeof===C||B.$$typeof===N||B.$$typeof===p)}function I(B){if(typeof B=="object"&&B!==null){var Ae=B.$$typeof;switch(Ae){case t:var On=B.type;switch(On){case d:case l:case o:case r:case s:case u:return On;default:var Ur=On&&On.$$typeof;switch(Ur){case c:case h:case m:case g:case i:return Ur;default:return Ae}}case a:return Ae}}}var v=d,k=l,G=c,$=i,ee=t,H=h,D=o,R=m,ie=g,j=a,q=r,T=s,M=u,U=!1;function F(B){return U||(U=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),A(B)||I(B)===d}function A(B){return I(B)===l}function S(B){return I(B)===c}function L(B){return I(B)===i}function Q(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function P(B){return I(B)===h}function z(B){return I(B)===o}function V(B){return I(B)===m}function W(B){return I(B)===g}function Z(B){return I(B)===a}function X(B){return I(B)===r}function Y(B){return I(B)===s}function re(B){return I(B)===u}ne.AsyncMode=v,ne.ConcurrentMode=k,ne.ContextConsumer=G,ne.ContextProvider=$,ne.Element=ee,ne.ForwardRef=H,ne.Fragment=D,ne.Lazy=R,ne.Memo=ie,ne.Portal=j,ne.Profiler=q,ne.StrictMode=T,ne.Suspense=M,ne.isAsyncMode=F,ne.isConcurrentMode=A,ne.isContextConsumer=S,ne.isContextProvider=L,ne.isElement=Q,ne.isForwardRef=P,ne.isFragment=z,ne.isLazy=V,ne.isMemo=W,ne.isPortal=Z,ne.isProfiler=X,ne.isStrictMode=Y,ne.isSuspense=re,ne.isValidElementType=_,ne.typeOf=I})()),ne}var dr;function Ca(){return dr||(dr=1,process.env.NODE_ENV==="production"?xn.exports=Fd():xn.exports=Vd()),xn.exports}var _a,hr;function Wd(){if(hr)return _a;hr=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function s(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var i={},c=0;c<10;c++)i["_"+String.fromCharCode(c)]=c;var d=Object.getOwnPropertyNames(i).map(function(h){return i[h]});if(d.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(h){l[h]=h}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return _a=s()?Object.assign:function(r,i){for(var c,d=o(r),l,h=1;h<arguments.length;h++){c=Object(arguments[h]);for(var u in c)t.call(c,u)&&(d[u]=c[u]);if(e){l=e(c);for(var f=0;f<l.length;f++)a.call(c,l[f])&&(d[l[f]]=c[l[f]])}}return d},_a}var Sa,ur;function Na(){if(ur)return Sa;ur=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Sa=e,Sa}var Ea,fr;function mr(){return fr||(fr=1,Ea=Function.call.bind(Object.prototype.hasOwnProperty)),Ea}var Ta,gr;function Yd(){if(gr)return Ta;gr=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Na(),a={},o=mr();e=function(r){var i="Warning: "+r;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(r,i,c,d,l){if(process.env.NODE_ENV!=="production"){for(var h in r)if(o(r,h)){var u;try{if(typeof r[h]!="function"){var f=Error((d||"React class")+": "+c+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}u=r[h](i,h,d,c,null,t)}catch(m){u=m}if(u&&!(u instanceof Error)&&e((d||"React class")+": type specification of "+c+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in a)){a[u.message]=!0;var g=l?l():"";e("Failed "+c+" type: "+u.message+(g??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},Ta=s,Ta}var Ia,pr;function Kd(){if(pr)return Ia;pr=1;var e=Ca(),t=Wd(),a=Na(),o=mr(),s=Yd(),r=function(){};process.env.NODE_ENV!=="production"&&(r=function(c){var d="Warning: "+c;typeof console<"u"&&console.error(d);try{throw new Error(d)}catch{}});function i(){return null}return Ia=function(c,d){var l=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function u(A){var S=A&&(l&&A[l]||A[h]);if(typeof S=="function")return S}var f="<<anonymous>>",g={array:C("array"),bigint:C("bigint"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:N(),arrayOf:_,element:I(),elementType:v(),instanceOf:k,node:H(),objectOf:$,oneOf:G,oneOfType:ee,shape:R,exact:ie};function m(A,S){return A===S?A!==0||1/A===1/S:A!==A&&S!==S}function p(A,S){this.message=A,this.data=S&&typeof S=="object"?S:{},this.stack=""}p.prototype=Error.prototype;function y(A){if(process.env.NODE_ENV!=="production")var S={},L=0;function Q(z,V,W,Z,X,Y,re){if(Z=Z||f,Y=Y||W,re!==a){if(d){var B=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw B.name="Invariant Violation",B}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ae=Z+":"+W;!S[Ae]&&L<3&&(r("You are manually calling a React.PropTypes validation function for the `"+Y+"` prop on `"+Z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),S[Ae]=!0,L++)}}return V[W]==null?z?V[W]===null?new p("The "+X+" `"+Y+"` is marked as required "+("in `"+Z+"`, but its value is `null`.")):new p("The "+X+" `"+Y+"` is marked as required in "+("`"+Z+"`, but its value is `undefined`.")):null:A(V,W,Z,X,Y)}var P=Q.bind(null,!1);return P.isRequired=Q.bind(null,!0),P}function C(A){function S(L,Q,P,z,V,W){var Z=L[Q],X=T(Z);if(X!==A){var Y=M(Z);return new p("Invalid "+z+" `"+V+"` of type "+("`"+Y+"` supplied to `"+P+"`, expected ")+("`"+A+"`."),{expectedType:A})}return null}return y(S)}function N(){return y(i)}function _(A){function S(L,Q,P,z,V){if(typeof A!="function")return new p("Property `"+V+"` of component `"+P+"` has invalid PropType notation inside arrayOf.");var W=L[Q];if(!Array.isArray(W)){var Z=T(W);return new p("Invalid "+z+" `"+V+"` of type "+("`"+Z+"` supplied to `"+P+"`, expected an array."))}for(var X=0;X<W.length;X++){var Y=A(W,X,P,z,V+"["+X+"]",a);if(Y instanceof Error)return Y}return null}return y(S)}function I(){function A(S,L,Q,P,z){var V=S[L];if(!c(V)){var W=T(V);return new p("Invalid "+P+" `"+z+"` of type "+("`"+W+"` supplied to `"+Q+"`, expected a single ReactElement."))}return null}return y(A)}function v(){function A(S,L,Q,P,z){var V=S[L];if(!e.isValidElementType(V)){var W=T(V);return new p("Invalid "+P+" `"+z+"` of type "+("`"+W+"` supplied to `"+Q+"`, expected a single ReactElement type."))}return null}return y(A)}function k(A){function S(L,Q,P,z,V){if(!(L[Q]instanceof A)){var W=A.name||f,Z=F(L[Q]);return new p("Invalid "+z+" `"+V+"` of type "+("`"+Z+"` supplied to `"+P+"`, expected ")+("instance of `"+W+"`."))}return null}return y(S)}function G(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&(arguments.length>1?r("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):r("Invalid argument supplied to oneOf, expected an array.")),i;function S(L,Q,P,z,V){for(var W=L[Q],Z=0;Z<A.length;Z++)if(m(W,A[Z]))return null;var X=JSON.stringify(A,function(re,B){var Ae=M(B);return Ae==="symbol"?String(B):B});return new p("Invalid "+z+" `"+V+"` of value `"+String(W)+"` "+("supplied to `"+P+"`, expected one of "+X+"."))}return y(S)}function $(A){function S(L,Q,P,z,V){if(typeof A!="function")return new p("Property `"+V+"` of component `"+P+"` has invalid PropType notation inside objectOf.");var W=L[Q],Z=T(W);if(Z!=="object")return new p("Invalid "+z+" `"+V+"` of type "+("`"+Z+"` supplied to `"+P+"`, expected an object."));for(var X in W)if(o(W,X)){var Y=A(W,X,P,z,V+"."+X,a);if(Y instanceof Error)return Y}return null}return y(S)}function ee(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&r("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var S=0;S<A.length;S++){var L=A[S];if(typeof L!="function")return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+U(L)+" at index "+S+"."),i}function Q(P,z,V,W,Z){for(var X=[],Y=0;Y<A.length;Y++){var re=A[Y],B=re(P,z,V,W,Z,a);if(B==null)return null;B.data&&o(B.data,"expectedType")&&X.push(B.data.expectedType)}var Ae=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new p("Invalid "+W+" `"+Z+"` supplied to "+("`"+V+"`"+Ae+"."))}return y(Q)}function H(){function A(S,L,Q,P,z){return j(S[L])?null:new p("Invalid "+P+" `"+z+"` supplied to "+("`"+Q+"`, expected a ReactNode."))}return y(A)}function D(A,S,L,Q,P){return new p((A||"React class")+": "+S+" type `"+L+"."+Q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+P+"`.")}function R(A){function S(L,Q,P,z,V){var W=L[Q],Z=T(W);if(Z!=="object")return new p("Invalid "+z+" `"+V+"` of type `"+Z+"` "+("supplied to `"+P+"`, expected `object`."));for(var X in A){var Y=A[X];if(typeof Y!="function")return D(P,z,V,X,M(Y));var re=Y(W,X,P,z,V+"."+X,a);if(re)return re}return null}return y(S)}function ie(A){function S(L,Q,P,z,V){var W=L[Q],Z=T(W);if(Z!=="object")return new p("Invalid "+z+" `"+V+"` of type `"+Z+"` "+("supplied to `"+P+"`, expected `object`."));var X=t({},L[Q],A);for(var Y in X){var re=A[Y];if(o(A,Y)&&typeof re!="function")return D(P,z,V,Y,M(re));if(!re)return new p("Invalid "+z+" `"+V+"` key `"+Y+"` supplied to `"+P+"`.\nBad object: "+JSON.stringify(L[Q],null," ")+`
|
|
129
|
+
`}}catch(C){console.error("insertVideos error for",g,C),y=""}else y=f;o=u,a+=y,s.lastIndex=u}return a+=e.slice(o),a}async function dd(e){const{news:t,banners:a,newsRelatedResponses:o,slug:s,itemList:r,socials:i,getVideos:c}=e;let d=t?.body?.rendered??"";d=d.replace(/ /g,""),d=rd(d,a),d=id(d),d=await Ws(d),d=await cd(d,e.texts,o),d=await ld(d,c),d=od(d),d=sd(d);const l=t.main.sources??[];return n.jsxs("div",{className:Nn.content,children:[s!=="liveblogs"&&e.showHeaderImage?t.hascontent?.hasgalleryimages?n.jsx(Aa,{newsformated:t,internal:t.info.link.internal}):n.jsx(ws,{preview:t.preview}):null,n.jsx(fe,{banners:a,name:"block_1"}),n.jsx("div",{className:Nn.journalistArticleContent,children:n.jsx(Rl,{autorIcon:e.autorIcon,socials:i,news:t,texts:e.texts,noteShare:e.noteShare,paths:e.paths})}),n.jsx(td,{summary:t.main.summary}),n.jsx("div",{className:Nn.contentNews,suppressHydrationWarning:!0,id:"content-news-section",dangerouslySetInnerHTML:{__html:d}}),n.jsx(Jl,{texts:e.texts,itemList:r,banners:a,slug:s}),l.length>0&&n.jsxs("div",{className:Nn.noteSource,children:[n.jsx(ad,{}),n.jsx("p",{children:e.texts.noteSource+(l.length===1?"":"s")+": "+l.map(h=>h.name).join(", ")})]})]})}const Ys={content:"_content_cu8lm_1",title:"_title_cu8lm_18"},Ks=async({newsformated:e,internal:t})=>{if(!t)return;const o=await new Ee().getNewsMultimedia({path:t,imagesizes:e.preview.sizes[0]?.scale});if(!o)return;const s=o.data.data[0]?.videos.filter(r=>r.type==="video-embedded")[0];return n.jsxs("div",{className:Ys.content,children:[n.jsx("div",{dangerouslySetInnerHTML:{__html:s?.code??""}}),n.jsx("p",{className:Ys.title,children:s?.title})]})},ya={content:"_content_cu8lm_1",title:"_title_cu8lm_18"},Js=async({newsformated:e,internal:t})=>{if(!t)return;const o=await new Ee().getNewsMultimedia({path:t,imagesizes:e.preview.sizes[0]?.scale});if(!o)return;const s=o.data.data[0]?.videos.filter(r=>r.type==="video-youtube")[0];return n.jsxs("div",{className:ya.content,children:[n.jsx("iframe",{className:ya.iframeStyled,src:`https://www.youtube.com/embed/${s?.code??""}`,frameBorder:"0",allowFullScreen:!0}),n.jsx("p",{className:ya.title,children:s?.title})]})},hd={content:"_content_ezbiw_1"},Zs=async({newsformated:e,internal:t})=>{if(!t)return;const o=await new Ee().getNews({path:t,imagesizes:e.preview.sizes[0]?.scale});if(!o)return;console.log("response",o.data.data[0]);const s=o.data.data[0]?.external?.iframe;return n.jsx("div",{className:hd.content,dangerouslySetInnerHTML:{__html:s??""}})},Xs={content:"_content_156j7_1"},nt={imagen:"imagen",videoEmbedded:"videoEmbedded",videoYouTube:"videoYouTube",iframe:"iframe"},ud={[nt.videoEmbedded]:Ks,[nt.videoYouTube]:Js,[nt.iframe]:Zs},fd=({news:e})=>{console.log("news",e.config);const{config:t,hascontent:a,info:o}=e,s=t.articlepreview,r=o.link.internal,i=a?.hasgalleryimages;if(s===nt.imagen&&i)return n.jsx("div",{className:Xs.content,children:n.jsx(Aa,{newsformated:e,internal:r})});const c=s?ud[s]:null;return console.log("PreviewComponent",c),c?n.jsx("div",{className:Xs.content,children:n.jsx(c,{newsformated:e,internal:r})}):null},md=e=>{const{content:t,title:a,slot_id:o}=e,s=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&n.jsx(he,{title:a,titleUrl:e.titleUrl,children:n.jsx(it,{slot_id:o,cardWidth:200,children:t.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:s?r.main.title.home:r.main.title.section}}};return n.jsx(jt,{...c,titleGradient:!0,paths:e.paths},i)})})})},gd=e=>{const{content:t,title:a,slot_id:o}=e,s=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&n.jsx(he,{title:a,titleUrl:e.titleUrl,children:n.jsx(it,{slot_id:o,cardWidth:343,cardGap:32,visibleItems:3,children:t.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:s?r.main.title.home:r.main.title.section}}};return n.jsx(jt,{...c,titleGradient:!0,paths:e.paths},i)})})})},pd=e=>{const{content:t,title:a,slot_id:o}=e,s=e.slot_id&&e.slot_id!=="Nota_1";return t&&t.length!==0&&n.jsx(he,{title:a,titleUrl:e.titleUrl,children:n.jsx(it,{slot_id:o,fullPageWidth:!0,visibleItems:1,pagination:!0,cardGap:0,children:t.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:s?r.main.title.home:r.main.title.section}}};return E.createElement(jt,{...c,key:i,titleGradient:!0,paths:e.paths})})})})},En=e=>{const t={};for(const a in e)a.startsWith("--")&&(t[a]=e[a]);return t},dt={headerSection:"_headerSection_1c69w_1",title:"_title_1c69w_11",subtitle:"_subtitle_1c69w_23",newsContent:"_newsContent_1c69w_36",containerCards:"_containerCards_1c69w_44",image:"_image_1c69w_50",blockHeadContainer:"_blockHeadContainer_1c69w_56"},Ad=e=>{const{content:t,title:a,isVideo:o}=e;if(!t||t.length===0)return;const s=t[0],r=t.slice(1),i=e.slot_id&&e.slot_id!=="Nota_1";return s&&r&&n.jsxs(he,{title:a,titleUrl:e.titleUrl,children:[n.jsx("div",{className:dt.headerSection,children:n.jsxs("a",{style:{"--heightImageOverwriteMobile":"200%"},className:dt.image,href:s?.info?.link?.url,target:s?.info?.link?.target,children:[n.jsxs("div",{className:dt.blockHeadContainer,children:[n.jsx("p",{className:dt.title,children:s?.main?.title.home}),s?.main?.subtitle?.rendered&&n.jsx("p",{className:dt.subtitle,children:s?.main?.subtitle?.striped})]}),n.jsx(_e,{preview:s.preview})]})}),n.jsxs("div",{className:dt.containerCards,children:[n.jsx("div",{className:"banner-context",style:{order:1},children:e.banner}),n.jsx("div",{className:dt.newsContent,children:Array.isArray(r)&&r.map((c,d)=>{const l={...c,main:{...c.main,title:{...c.main.title,section:i?c.main.title.home:c.main.title.section}}};return n.jsx("div",{style:{order:d},children:n.jsx(De,{...l,isVideo:o,paths:e.paths})},d)})})]})]})},Rs={banner:e=>n.jsx(fe,{...e,name:e.slot_id.replace("Home","block")}),readest:e=>n.jsx(fn,{...e}),"Modulo 1x3":e=>n.jsx(ua,{...e}),"Modulo 1x4":e=>n.jsx(Ds,{...e}),"Modulo 1x5":e=>n.jsx(Ms,{...e}),"Destacado noticias":e=>n.jsx(Ls,{...e}),"Destacado full width":e=>n.jsx(Ad,{...e}),"Destacado videos":e=>n.jsx(js,{...e}),"Carrusel card":e=>n.jsx($s,{...e}),"Carrusel story":e=>n.jsx(md,{...e}),"Carrusel owl":e=>n.jsx(gd,{...e}),"Modulo fotogaleria":e=>n.jsx(pd,{...e}),"Carrusel opinion":e=>n.jsx(Hs,{...e}),"Modulo 1x3 card":e=>n.jsx(Gs,{...e})};function wa({component:e,slot_id:t,data:a,banners:o}){if(o)return Rs[e]&&n.jsx("div",{className:"home-slot",style:En(a),children:Rs[e]({...a,banners:o,slot_id:t})})}function yd({children:e,stylesConfigEntry:t}){return n.jsx("div",{className:"home-slot",style:En(t),children:e})}const er={Diario:e=>{if(!e?.data||e.data.length===0)return;const t=e.data.slice(1);return n.jsx(xs,{...e.data[0],itemReverseOrder:!0,isLarge:!0,block:t,banners:e.banners,showSuper:e.showSuper,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},"Diario con imagen":e=>{if(!e?.data||e.data.length===0)return;const t=e.data.slice(1);return n.jsx(xs,{...e.data[0],itemReverseOrder:!0,isLarge:!0,showSuper:e.showSuper,block:t,banners:e.banners,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},Super:e=>n.jsx(_t,{...e.data[0],paths:e.paths}),"3 notas verticales":e=>n.jsx(Ul,{content:e.data,customLargeSection:e.customLargeSection,customSlimSection:e.customSlimSection,paths:e.paths}),"3 notas horizontales":e=>n.jsx(xl,{content:e.data,customLargeSection:e.customLargeSection,customSmallSection:e.customSmallSection,paths:e.paths})},Tn=({component:e,data:t,banners:a,rightOnlyBanner:o})=>n.jsx("div",{style:En(t),children:er[e]&&er[e]({...t,rightOnlyBanner:o,banners:a})}),wd=({slots:e,DYNAMIC_SLOT_SUBINDEXES:t,stylesConfig:a,AutorIcon:o,config:s,banners:r,showTagBySection:i})=>{const c=[],l=t,h=Object.keys(e).length/l;for(let u=1;u<=h;u++)for(let f=1;f<=l;f++){const g="Home_"+u+"_"+f;!e[g]||!e[g].blockSass||!e[g].blockSass[0]||!e[g].blockSass[0].value||!e[g].blockSass[0].block||e[g].blockSass[0].block==="No Mostrar"||c.push(n.jsxs(os,{show:!!e[g].content?.data,order:(u-1)*l+(f-1),children:[n.jsx(wa,{component:e[g].blockSass[0].block,banners:r,slot_id:g,data:{...e[g].blockSass[0].block?a[e[g].blockSass[0].block]:[],content:e[g].content?.data??[],title:e[g].blockSass[0].title??void 0,titleUrl:e[g].blockSass[0].link??void 0,autorIcon:n.jsx(o,{}),paths:s.paths,showTagBySection:i}}),n.jsx(Ze,{children:n.jsx(Qe,{banners:r,index:"dynamic_"+u+"_"+f})})]},u+"_"+f))}return c},bd=({mainBlock:e,StylesConfigMain:t,config:a,banners:o})=>{const{PUBLIC_ENV:s}=K();if(s!=="local")return null;const r=e?.news?.data||[],i=(c,d)=>({...e?.news,...t[c],data:r.slice(0,d),paths:a.paths});return n.jsxs(n.Fragment,{children:[n.jsx(Tn,{component:"Super",data:i("Super",1),banners:o}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:1})}),n.jsx(Tn,{component:"3 notas verticales",data:i("3 notas verticales",3),banners:o}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:1})}),n.jsx(Tn,{component:"3 notas horizontales",data:i("3 notas horizontales",3),banners:o}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:1})})]})},vd=e=>{const{config:t,hascontent:a}=e,o=t.articlepreview,s=[nt.videoEmbedded,nt.videoYouTube,nt.iframe];return!!(o===nt.imagen&&a?.hasgalleryimages||s.includes(o))},Cd=async e=>{const{custom_complement:t,ranking:a=[],banners:o,autor:s=[],news:r=[],newsRelatedResponses:i=[],itemList:c=[],socials:d,getVideos:l}=e,h=e.slug==="liveblogs",{SHOW_NEWS_MORE_NEWS:u,SHOW_NEWS_RELATED_NEWS:f}=K();if(!(!r||!r[0]))return console.log("news[0]",r[0]),console.log("isLiveBlog",h),n.jsx(n.Fragment,{children:n.jsxs($l,{className:pa.contentLayout2,children:[n.jsx(zl,{option:e.slug,news:r,paths:e.paths}),n.jsx(Qe,{banners:o,index:1}),!h&&n.jsx(fd,{news:r[0]}),n.jsx(Hl,{texts:e.texts,paths:e.paths,slug:e.slug,itemList:c,ranking:a,bannerTop:n.jsx(fe,{banners:o??[],name:"right_1"}),banner:n.jsx(fe,{banners:o??[],name:"right_2"}),complement:n.jsxs("div",{id:"comentarios",suppressHydrationWarning:!0,children:[s.length>0&&n.jsx(Is,{texts:e.texts,autorIcon:e.autorIcon,autor:s[0],paths:e.paths}),r[0].authors.length>1&&n.jsx(ks,{news:r[0],autorIcon:e.autorIcon,paths:e.paths,texts:e.texts}),n.jsx("div",{className:pa.tagContent,children:n.jsx(Ts,{tags:r[0]?.keywords?.tags,paths:e.paths})}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2rem"},suppressHydrationWarning:!0,children:[e.showComments&&n.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"comment",internalPath:e.internalPath,COMMENTS_VARS:e.COMMENTS_VARS}))}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:2})}),f&&n.jsxs(n.Fragment,{children:[n.jsx(wa,{component:"Carrusel card",banners:[],slot_id:"Nota_1",data:{...e.stylesConfig["Carrusel card"],content:e.relatedNewsList??[],title:e.texts.relatedNewsTitle,titleUrl:void 0}}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:3})})]}),u&&n.jsxs(n.Fragment,{children:[n.jsx(he,{title:e.texts.moreNewsTitle,children:n.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"more",stylesConfig:e.stylesConfig,section:r[0].info.section?.slug??"",currentNews:r[0]}))})}),n.jsx(Ze,{children:n.jsx(Qe,{banners:o,index:4})})]}),t&&t()]})]}),children:n.jsxs("section",{style:{"--avatar-content-align-items-desk":e.slug==="liveblogs"?"flex-start":"center"},children:[n.jsx(dd,{texts:e.texts,autorIcon:e.autorIcon,socials:d,news:r[0],banners:o,newsRelatedResponses:i,itemList:c,slug:e.slug,getVideos:l,noteShare:e.noteShare,paths:e.paths,showHeaderImage:!vd(r[0])}),n.jsx(fe,{banners:o??[],name:"block_3"})]})})]})})},Et={content:"_content_1tl6i_1",contentInfo:"_contentInfo_1tl6i_24",imageStyled:"_imageStyled_1tl6i_41",name:"_name_1tl6i_46",description:"_description_1tl6i_51",contentInfoWithoutImg:"_contentInfoWithoutImg_1tl6i_104"},_d=async e=>{const t=e.img?await ue(e.img):"";return n.jsx("section",{className:Et.content,children:n.jsxs("div",{className:`${Et.contentInfo} ${t?"":Et.contentInfoWithoutImg}`,children:[e.img&&n.jsx("img",{fetchPriority:"low",loading:"lazy",className:Et.imageStyled,src:t}),n.jsx("h1",{className:Et.name,children:e.tag}),e.description&&n.jsx("div",{className:Et.description,dangerouslySetInnerHTML:{__html:e.description}})]})})},In={content:"_content_7wvro_1",contentInfo:"_contentInfo_7wvro_23",name:"_name_7wvro_34",description:"_description_7wvro_43"},Sd=e=>n.jsx("section",{className:In.content,style:{color:e.textColor,"--backDropHeigth":e.backDropHeigth?e.backDropHeigth:"100%",padding:e.sectionPadding??"","--backgroundColor":e.backgroundColor},children:n.jsxs("div",{className:In.contentInfo,children:[n.jsx("h1",{className:In.name,style:{color:e.textColor},children:e.tag}),e.description&&n.jsx("div",{style:{color:e.textColor},className:In.description,dangerouslySetInnerHTML:{__html:e.description}})]})}),Nd=e=>{const{option:t,entity:a}=e;switch(t){case"op1":return n.jsx(_d,{tag:a?.name??"",img:a?.image?.url??"",description:a?.description?a?.description:""});case"op2":return n.jsx(Sd,{tag:a?.name??"",description:a?.description?a?.description:"",backDropHeigth:e.backDropHeigth,backgroundColor:e.backgroundColor,sectionPadding:e.sectionPadding,textColor:e.textColor});default:return n.jsx(n.Fragment,{})}},Ft={content:"_content_gxziw_1",buttonStyled:"_buttonStyled_gxziw_9",searchStyled:"_searchStyled_gxziw_21",inputStyled:"_inputStyled_gxziw_32",inputStyledTest:"_inputStyledTest_gxziw_51"},Ed=e=>n.jsx("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n.jsx("g",{opacity:"0.8",children:n.jsx("path",{d:"M47.8043 46.6003L47.6635 46.7758L47.8232 46.9342L56.4762 55.5171C56.4768 55.5177 56.4774 55.5184 56.478 55.519C56.8524 55.9072 57.0616 56.4256 57.0616 56.965C57.0616 57.5048 56.8521 58.0234 56.4774 58.4117C56.2839 58.6065 56.0539 58.7611 55.8005 58.8667C55.5466 58.9724 55.2743 59.0269 54.9993 59.0269C54.7243 59.0269 54.452 58.9724 54.1981 58.8667C53.9442 58.7609 53.7138 58.6059 53.5201 58.4106L53.5194 58.4099L44.9327 49.8232L44.7743 49.6648L44.5995 49.805C40.4597 53.1252 35.2051 54.7331 29.9162 54.2981C24.6272 53.863 19.706 51.4181 16.1643 47.4661C12.6227 43.514 10.7298 38.3552 10.875 33.0503C11.0201 27.7455 13.1923 22.6979 16.9447 18.9455C20.6972 15.193 25.7448 13.0209 31.0496 12.8757C36.3544 12.7305 41.5133 14.6234 45.4653 18.165C49.4174 21.7067 51.8623 26.6279 52.2974 31.9169C52.7324 37.2058 51.1245 42.4604 47.8043 46.6003ZM22.4528 47.4552C25.1799 49.2774 28.3861 50.25 31.666 50.25C36.0641 50.25 40.2822 48.5029 43.3921 45.3929C46.5021 42.2829 48.2493 38.0649 48.2493 33.6667C48.2493 30.3868 47.2767 27.1806 45.4545 24.4535C43.6323 21.7264 41.0423 19.6008 38.0121 18.3457C34.9819 17.0905 31.6476 16.7621 28.4307 17.402C25.2139 18.0419 22.259 19.6213 19.9398 21.9405C17.6205 24.2597 16.0411 27.2146 15.4013 30.4314C14.7614 33.6483 15.0898 36.9827 16.345 40.0129C17.6001 43.0431 19.7256 45.633 22.4528 47.4552Z",fill:"white",stroke:"white",strokeWidth:"0.5"})})}),Td=e=>n.jsx("form",{className:Ft.content,style:{height:e.hasContent?"218px":"50vh"},children:n.jsxs("div",{className:Ft.inputStyled,children:[n.jsx("input",{className:Ft.inputStyledTest,defaultValue:e.query,name:"query",placeholder:e.texts.searchKeyWord+"..."}),n.jsx("button",{className:Ft.buttonStyled,type:"submit",children:n.jsx(Ed,{className:Ft.searchStyled})})]})}),ba={content:"_content_io3tv_1",newsContentSection:"_newsContentSection_io3tv_5",itemContent:"_itemContent_io3tv_10"},Id=e=>{const{data:t,option:a,autor:o,page:s,banners:r,pathname:i,ranking:c,currentPage:d,slug:l,texts:h={}}=e,u=[5,10,15],f={5:1,10:2,15:3};switch(a){case"op1":return n.jsx(n.Fragment,{children:n.jsxs(oa,{children:[n.jsx(Cs,{autor:o[0],autorIcon:e.autorIcon}),n.jsx(ra,{paths:e.paths,ranking:c,readestTitle:h.readestTitle??"",bannerTop:n.jsx(fe,{banners:r??[],name:"right_1"}),banner:n.jsx(fe,{banners:r??[],name:"right_2"}),children:n.jsx("section",{className:ba.content,children:t.length>0?n.jsx(yn,{className:[ba.newsContentSection,"padding-0"].join(" "),paginatorComponent:n.jsx(Dt,{texts:h,pathname:i,query:"",currentPage:d,maxPages:e.paginationLimit,showNext:!(t.length<e.newsListLimit)}),children:Array.isArray(t)&&t?.map((g,m)=>n.jsxs(E.Fragment,{children:[u.includes(m+1)&&n.jsx("div",{className:ba.itemContent+" banner-context",children:n.jsx(fe,{banners:r??[],name:`block_2_${f[m+1]}`})}),n.jsx(Sn,{autorIcon:e.autorIcon,item:g,option:l,paths:e.paths},m)]},m))}):n.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:n.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:h.autorNotResultMessage})})})})]})});case"op2":return n.jsx(n.Fragment,{children:n.jsxs(oa,{children:[n.jsx(_s,{autor:o[0],autorIcon:e.autorIcon}),Array.isArray(t)?n.jsxs(n.Fragment,{children:[n.jsx(ua,{content:t,title:"",hasLines:!0,banners:e.banners,bannerPositionIndex:[1,6,12],paths:e.paths,slot_id:"block_2"}),n.jsx(Dt,{texts:h,query:"",pathname:i,maxPages:Number(e.paginationLimit),currentPage:Number(s),showNext:!((t.length??0)<Number(e.newsListLimit))})]}):n.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:n.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:h.autorNotResultMessage})})]})});default:return n.jsx(n.Fragment,{})}},tr={content:"_content_pq89v_1",videoContent:"_videoContent_pq89v_9"},Vt={container:"_container_1xr2t_1",playStyled:"_playStyled_1xr2t_6",imageStyled:"_imageStyled_1xr2t_13",longer:"_longer_1xr2t_26",contentNews:"_contentNews_1xr2t_31",tagContent:"_tagContent_1xr2t_51",tag:"_tag_1xr2t_51",titular:"_titular_1xr2t_68",small:"_small_1xr2t_81",figure:"_figure_1xr2t_87",backDrop:"_backDrop_1xr2t_92",backDropAux:"_backDropAux_1xr2t_100"},nr=async e=>{const{size:t="longer",video:a}=e,o=a.main.image.sizes[0]?.url??"";return n.jsx("figure",{className:Vt.figure,children:n.jsxs("span",{className:Vt.backdrop,children:[n.jsx("span",{className:Vt.backDropAux}),n.jsx(O,{href:a.info.link.url,target:a.info.link.target,children:n.jsxs("div",{children:[a.main.image.sizes.map(async(s,r)=>s.width>=580?n.jsx("source",{media:"(width >=900px)",srcSet:await ue(s.url)},r):n.jsx("source",{media:"(width <900px)",srcSet:await ue(s.url)},r)),n.jsx("img",{fetchPriority:"low",loading:"lazy",className:[Vt.imageStyled,Vt[t]].join(" "),alt:"",src:o?await ue(o):""})]})})]})})},kd=e=>{const{videos:t}=e;return n.jsx("div",{className:tr.content,children:n.jsx(yt,{children:n.jsx(he,{title:"Videos",isTitle:!0,children:n.jsxs("div",{className:tr.videoContent,children:[n.jsx(nr,{video:t[0]}),n.jsx("div",{style:{display:"flex",flexDirection:"column"},children:t.slice(1).map((a,o)=>n.jsx(nr,{size:"small",video:a},`video-small-${o}`))})]})})})})},ht={content:"_content_ruy5q_1",videoContent:"_videoContent_ruy5q_9",articleSection:"_articleSection_ruy5q_21",contentLatout:"_contentLatout_ruy5q_31",title:"_title_ruy5q_36",article:"_article_ruy5q_21",correspondent:"_correspondent_ruy5q_64"},ar={container:"_container_1rq2h_1",playStyled:"_playStyled_1rq2h_9"},xd=e=>{const{video:t}=e;return n.jsx(O,{href:t.info.link.url?t.info.link.url:void 0,target:t.info.link.target,children:n.jsxs("section",{className:ar.container,children:[n.jsx(_e,{isLarge:!0,preview:{sizes:t.main.image.sizes,description:t.main.description}}),n.jsx(wt,{className:ar.playStyled})]})})},Ud=e=>{const t=()=>e?.video.main.author?`${e?.video.main.author} - ${xe(e.video.info.date.created)}`:e?.video.main.author;return n.jsx("div",{className:ht.content,children:n.jsx(yt,{className:ht.contentLatout,children:n.jsx(he,{title:"Videos",isTitle:!0,children:n.jsxs("div",{className:ht.videoContent,children:[n.jsx(xd,{video:e.video}),n.jsxs("div",{className:ht.articleSection,children:[n.jsx(O,{className:ht.title,href:e.video.info.link.url,target:e.video.info.link.target,children:e.video.main.title}),n.jsx("p",{className:ht.article,children:Ue(e.video.main.description)}),n.jsx("p",{className:ht.correspondent,children:t()})]})]})})})})},qd=e=>{switch(e.option){case"op1":return n.jsx(kd,{videos:e.data});case"op2":return n.jsx(Ud,{video:e.data[0]});default:return n.jsx(n.Fragment,{})}};function Ld({containerId:e,containerId2:t}){return E.useEffect(()=>{try{let a=function(){const h=window.twttr;h?.widgets?h.widgets.load(o):l<10?(l++,requestAnimationFrame(a)):console.warn("No se pudo cargar widgets de Twitter")};const o=document.getElementById(e),s=document.getElementById(t);if(!o&&!s)return;const r=o?.querySelectorAll("script[src]")??[],i=s?.querySelectorAll("script[src]")??[];[...r,...i].forEach(h=>{const u=document.createElement("script");Array.from(h.attributes).forEach(f=>{u.setAttribute(f.name,f.value)}),h.replaceWith(u)});const d=document.querySelectorAll('script[src*="platform.twitter.com/widgets.js"]');if(d)for(let h=0;h<d.length;h++)d[h]?.remove();let l=0;if(document.querySelector('script[src*="platform.twitter.com/widgets.js"]'))a();else{const h=document.createElement("script");h.src="https://platform.twitter.com/widgets.js",h.async=!0,h.onload=a,document.body.appendChild(h)}}catch(a){console.warn("Error al procesar embeds de Twitter",a)}},[e]),null}const Bd=e=>{const{isVideo:t=!1,isLarge:a=!1,hasShadow:o=!1,BackDropAuxHeigthMobile:s}=e,r=E.useMemo(()=>e?.preview?.sizes||[],[e?.preview?.sizes]);if(!r.length||!r[0]?.url||r[0]?.url==="")return n.jsx("div",{className:se.imagePlaceholder});const{PUBLIC_API_HOST:i,PUBLIC_ENV:c}=K();return n.jsx("figure",{className:se.figure,children:n.jsxs("span",{className:se.backdrop,children:[n.jsx("span",{className:se.backdropAux,style:{height:s||"56.25%"}}),n.jsxs("picture",{children:[n.jsx("img",{fetchPriority:"low",loading:"lazy",className:se.imageStyled,alt:e.preview?.description||"",src:(c==="local"?i:"")+r[0]?.url,style:{boxShadow:o?"0px 4px 8px 0px #00000033":"0px"}}),t&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:se.boxPlayIcon,style:{height:a?"40%":"72px"}}),n.jsx(wt,{className:se.playStyled,style:{width:a?"3rem":"27px",height:a?"3rem":"27px",marginBottom:a?"18px":".5rem",marginLeft:a?"30px":".5rem"}})]})]})]})})},Od=e=>n.jsx("svg",{width:"41",height:"33",viewBox:"0 0 41 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:n.jsx("path",{d:"M17.9576 21.2985C16.8233 21.2985 15.9277 22.194 15.9277 23.3283C15.9277 24.4627 16.8233 25.3582 17.9576 25.3582C19.0919 25.3582 19.9874 24.4627 19.9874 23.3283C19.9874 22.194 19.0919 21.2985 17.9576 21.2985ZM17.9576 19.2686C19.0919 19.2686 19.9874 18.3731 19.9874 17.2388C19.9874 16.1045 19.0919 15.2089 17.9576 15.2089C16.8233 15.2089 15.9277 16.1045 15.9277 17.2388C15.9277 18.3731 16.8233 19.2686 17.9576 19.2686ZM17.9576 13.1791C19.0919 13.1791 19.9874 12.2836 19.9874 11.1492C19.9874 10.0149 19.0919 9.11938 17.9576 9.11938C16.8233 9.11938 15.9277 10.0149 15.9277 11.1492C15.9277 12.2836 16.8233 13.1791 17.9576 13.1791Z",fill:"#7B888A"})}),or={info:{section:{name:"",slug:"",url:""},link:{url:"/",target:"",canonical:!1,internal:""},date:{date:"",created:0,modified:0,firstpublish:0,lastpublish:0}},config:{zonehome:void 0,priorityhome:"",zonesection:"",prioritysection:"",homepreview:"",showcomments:!0,showtime:!0,showauthor:!0,showuppertitle:!0,showsubtitle:!0,showads:!0},main:{title:{home:"",section:"",article:""},subtitle:{rendered:"",striped:""},tags:[]},authors:[{firstname:"",lastname:"",fullname:"",image:void 0,name:"",internaluser:!1}],preview:void 0},sr=6,Pd=({section:e,currentNews:t,banner:a,isVisible:o=!1,stylesConfig:s})=>{const[r,i]=E.useState({data:Array.from({length:sr},()=>or)}),[c,d]=E.useState(!1),l=E.useCallback(async()=>{if(!(c||!t?.info?.link?.internal)){d(!0);try{const h=new URLSearchParams({section:e,currentNewsLink:t.info.link.internal}),u=await fetch(`/api/get-more-news?${h}`);if(!u.ok)throw i(void 0),new Error(`HTTP error! status: ${u.status}`);const f=await u.json();i({...f,data:f.data.slice(0,sr)})}catch(h){console.error("[/api/get-more-news] Error:",h.message),i(void 0)}}},[e,t.info.link.internal,c]);return E.useEffect(()=>{o&&l()},[o,r,l]),!r?.data||r.data.length===0?null:n.jsx(Dd,{news:r.data,title:"Más Noticias",...s["Modulo 1x3 Client"]??s["Modulo 1x3"],hasLines:!0,showSubtitle:!0,rounded:!0,banner:a,isVisible:o})},Dd=e=>{const{news:t,hasLines:a=!1}=e,o=s=>a&&(s+1)%3!==0?ga.contentSeparator:"";return n.jsx("div",{className:ga.newsContent,style:{gap:a?"30px":"20px","--gridTemplateModlule":a?"repeat(auto-fit, 343px);":"repeat(auto-fit, 380px);"},children:t.map((s,r)=>{const{main:i,authors:c,info:d,preview:l,isVideo:h=!1,config:u,overImage:f="default",isTitle:g=!1,isLarge:m=!1}=s;return n.jsx("div",{className:o(r),style:{order:r},children:n.jsxs("section",{className:Mt.content,children:[n.jsx(O,{title:i?.title?.section,href:d?.link?.url??"invalidUrl","aria-label":i?.title?.section??"nota",target:d?.link?.target,children:n.jsx(Bd,{isVisible:e.isVisible,preview:l,rounded:e.rounded,isVideo:h,isLarge:m,getImageUrl:e.getImageUrl})}),n.jsx("div",{className:Mt.newsDescription,children:n.jsx(Md,{main:i,authors:c,info:d,preview:l,share:e.share,config:u,overImage:f,isTitle:g,paths:s.paths,isVisible:e.isVisible})})]})},r)})})},Md=e=>{const{share:t=!1,cutSubtitle:a=!0}=e,s=(()=>{if(!e?.authors||e.authors.length===0)return"";const r=e.authors[0],i=xe(e.info?.date?.modified);return r&&e?.config?.showtime&&e.config?.showauthor?`${r.fullname} - ${i}`:r&&e.config?.showauthor?r.fullname:e?.config?.showtime?i:""})();return n.jsxs("div",{className:ae.boxInformation,children:[t&&n.jsx(Od,{className:ae.dotStyles}),e?.info?.section?.url&&n.jsxs("div",{className:ae.sectionDescriptionContainer,children:[n.jsx(O,{className:ae.sectionDescription,href:e.info.section.url??"invalidUrl",children:e.info.section.name}),e?.main?.uppertitle&&n.jsx("p",{className:ae.uppertitle,children:e.main.uppertitle})]}),n.jsx("h2",{className:ae.articule,children:n.jsx(O,{className:ae.linkStyled,style:{"--isLink":e?.info?.link?.url?"underline":"none"},"aria-label":e.main?.title?.section??"nota",href:e?.info?.link?.url,target:e?.info?.link?.target,children:e.main?.title?.section})}),e.config?.showsubtitle&&e.main?.subtitle?.striped&&n.jsx("p",{className:ae.description,style:{"--fontSizeSubTitle":e.fontSizeSubTitle,"--lineHeightSubTitle":e.lineHeightSubTitle,"--colorSubTitle":e.colorSubTitle},children:a?Ue(e.main.subtitle.striped):e.main.subtitle.striped}),(e?.config?.showtime||e.config?.showauthor)&&s&&n.jsx(n.Fragment,{children:e.authors?.[0]?.internaluser?n.jsx(O,{className:ae.correspondentLink,href:`/autor/${e.authors[0].name}`,children:s}):n.jsx("div",{className:ae.correspondent,children:s})})]})},jd=({user:e,handleLogout:t,message:a})=>{const o=()=>{const r=document.querySelector(".user-actions-options");r&&r.classList.toggle("show")},s=e.firstname??"Usuario";return n.jsx("div",{className:"comment-item",children:n.jsxs("div",{style:{display:"flex",gap:"14px"},children:[e&&e.picture&&e.picture!==""?n.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):n.jsx("div",{className:"comment-avatar",children:s.charAt(0).toUpperCase()}),n.jsxs("div",{style:{flex:1},children:[n.jsxs("div",{className:"comment-header",children:[n.jsxs("span",{className:"comment-username user-welcome",children:["Hola ",s,"!"]}),n.jsx("div",{className:"user-actions-options",children:n.jsx("button",{onClick:()=>{t()},children:"Cerrar Sesion"})}),n.jsx("button",{className:"user-actions-span",onClick:o,children:n.jsx(vn,{width:13,height:13,fill:"black"})})]}),n.jsx("p",{className:"comment-text",children:a})]})]})})},de={overlay:"_overlay_qj491_3",popup:"_popup_qj491_17",title:"_title_qj491_40",optionsContainer:"_optionsContainer_qj491_52",option:"_option_qj491_52",radioInput:"_radioInput_qj491_66",radioCustom:"_radioCustom_qj491_70",optionLabel:"_optionLabel_qj491_97",buttons:"_buttons_qj491_110",cancelButton:"_cancelButton_qj491_117",closeButton:"_closeButton_qj491_118",buttonAlone:"_buttonAlone_qj491_137",reportButton:"_reportButton_qj491_143",successContainer:"_successContainer_qj491_163",thumbsUp:"_thumbsUp_qj491_171",successMessage:"_successMessage_qj491_177",errorMessage:"_errorMessage_qj491_218",loadingContainer:"_loadingContainer_qj491_231"},rr=async(e,t)=>{const{PUBLIC_ENV:a}=K();if(console.log(a,!0),a==="local")return!0;if(!e)return!1;const{CAPTCHA_PROJECT:o,CAPTCHA_KEY_V2:s,COMMENTS_CAPTCHA_API_KEY:r}=t;console.log();try{const i=o,c=s,h=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${i}/assessments?key=${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:c}})})).json();return console.log("reCAPTCHA Enterprise verification result:",h),h.tokenProperties?.valid===!0}catch(i){return console.error("Error verificando reCAPTCHA Enterprise:",i),!1}};async function Qd({publication:e,username:t,id:a,type:o,baseUrl:s,captchaToken:r,apiToken:i,COMMENTS_VARS:c}){if(!e||!t||!a||!o||!r)throw new Error("Faltan parámetros requeridos: publication, username, id, type, captchaToken");if(typeof e!="string"||typeof t!="string"||typeof a!="string"||typeof o!="string"||typeof r!="string")throw new Error("Todos los parámetros deben ser strings");if(!await rr(r,c))throw new Error("Token de captcha inválido");if(!i)throw new Error("Falta el token de API del CMS");const d=`${s}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/report`,l=encodeURIComponent(o),h=new URLSearchParams({publication:e,username:t,id:a,type:l}),u=`${d}?${h.toString()}`;try{console.log("Reporting comment:",{publication:e,username:t,id:a,type:o,encodedType:l,url:u});const f=await oe.post(u,null,{headers:{"User-Agent":"Bluestack","x-api-token":i,"Content-Type":"application/json"}});if(console.log("Report response:",f.data),f.status===200||f.status===201)return{type:"success",message:"Comentario reportado exitosamente",status:f.status,data:f.data};throw new Error(`Respuesta inesperada del servidor: ${f.status}`)}catch(f){if(console.error("Error reporting comment:",f),oe.isAxiosError(f)){const g=f.response?.status,m=f.response?.data;throw g===400?new Error("Datos inválidos para el reporte"):g===401?new Error("Token de API inválido"):g===403?new Error("Acceso denegado para reportar comentario"):g===404?new Error("Comentario no encontrado"):g===409?new Error("El comentario ya fue reportado por este usuario"):g===500?new Error("Error interno del servidor CMS"):new Error(m?.error||m?.message||`Error HTTP ${g}: No se pudo reportar el comentario`)}throw f}}const je={spam:"Es spam o contenido comercial no deseado",inappropriate:"Lenguaje inadecuado",hate:"Discurso o símbolos de odio",misinformation:"Información falsa o fraude",terrorism:"Promueve el terrorismo",intellectual:"Violación de propiedad intelectual",bullying:"Bullying o acoso"};function Gd(e){return je[e]}const ut=300,Ke={username:"anonimo",firstname:"Usuario",lastname:"Anonimo"};function $d(e){const t=e.split(" ");if(t.length!==3)return e;const[a,o,s]=t,r=o.charAt(0).toUpperCase()+o.slice(1).toLowerCase();return`${a} ${r} ${s}`}const va=(e,t)=>{if(!e||!e.current)return{boolean:!1,text:""};const a=e.current?.value||"",o=a.length>ut,{PUBLIC_ENV:s}=K(),r=s==="local",i=a.trim()!==""&&(r||t!=="")&&!o,c=o?`No debes exceder el limite de ${ut} caracteres.`:"Debes completar todos los campos para comentar.";return{boolean:i,text:c}},ir=e=>{const t=e.cookie.split("; ").find(a=>a.startsWith("reported="));if(!t)return[];try{return JSON.parse(decodeURIComponent(t.split("=")[1]??""))}catch{return[]}},Hd=(e,t)=>{const a=ir(e);a.includes(t)||(a.push(t),e.cookie=`reported=${encodeURIComponent(JSON.stringify(a))}; path=/; max-age=${3600*24*1}`)};function zd(e){const[t,a]=e.split("@");if(!t||!a)return e;let o="";t.length<=2?o=t[0]+"*":o=t[0]+"*".repeat(t.length-2)+t[t.length-1];const s=a.lastIndexOf(".");if(s===-1)return`${o}@${a}`;const r=a.slice(0,s),i=a.slice(s);let c="";return r.length<=2?c=r[0]+"*":c=r[0]+"*".repeat(r.length-2)+r[r.length-1],`${o}@${c}${i}`}var kn={exports:{}},xn={exports:{}},te={};var cr;function Fd(){if(cr)return te;cr=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,N=e?Symbol.for("react.scope"):60119;function _(v){if(typeof v=="object"&&v!==null){var k=v.$$typeof;switch(k){case t:switch(v=v.type,v){case d:case l:case o:case r:case s:case u:return v;default:switch(v=v&&v.$$typeof,v){case c:case h:case m:case g:case i:return v;default:return k}}case a:return k}}}function I(v){return _(v)===l}return te.AsyncMode=d,te.ConcurrentMode=l,te.ContextConsumer=c,te.ContextProvider=i,te.Element=t,te.ForwardRef=h,te.Fragment=o,te.Lazy=m,te.Memo=g,te.Portal=a,te.Profiler=r,te.StrictMode=s,te.Suspense=u,te.isAsyncMode=function(v){return I(v)||_(v)===d},te.isConcurrentMode=I,te.isContextConsumer=function(v){return _(v)===c},te.isContextProvider=function(v){return _(v)===i},te.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===t},te.isForwardRef=function(v){return _(v)===h},te.isFragment=function(v){return _(v)===o},te.isLazy=function(v){return _(v)===m},te.isMemo=function(v){return _(v)===g},te.isPortal=function(v){return _(v)===a},te.isProfiler=function(v){return _(v)===r},te.isStrictMode=function(v){return _(v)===s},te.isSuspense=function(v){return _(v)===u},te.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===o||v===l||v===r||v===s||v===u||v===f||typeof v=="object"&&v!==null&&(v.$$typeof===m||v.$$typeof===g||v.$$typeof===i||v.$$typeof===c||v.$$typeof===h||v.$$typeof===y||v.$$typeof===C||v.$$typeof===N||v.$$typeof===p)},te.typeOf=_,te}var ne={};var lr;function Vd(){return lr||(lr=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,N=e?Symbol.for("react.scope"):60119;function _(B){return typeof B=="string"||typeof B=="function"||B===o||B===l||B===r||B===s||B===u||B===f||typeof B=="object"&&B!==null&&(B.$$typeof===m||B.$$typeof===g||B.$$typeof===i||B.$$typeof===c||B.$$typeof===h||B.$$typeof===y||B.$$typeof===C||B.$$typeof===N||B.$$typeof===p)}function I(B){if(typeof B=="object"&&B!==null){var Ae=B.$$typeof;switch(Ae){case t:var On=B.type;switch(On){case d:case l:case o:case r:case s:case u:return On;default:var Ur=On&&On.$$typeof;switch(Ur){case c:case h:case m:case g:case i:return Ur;default:return Ae}}case a:return Ae}}}var v=d,k=l,G=c,$=i,ee=t,H=h,D=o,R=m,ie=g,j=a,q=r,T=s,M=u,U=!1;function F(B){return U||(U=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),A(B)||I(B)===d}function A(B){return I(B)===l}function S(B){return I(B)===c}function L(B){return I(B)===i}function Q(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function P(B){return I(B)===h}function z(B){return I(B)===o}function V(B){return I(B)===m}function W(B){return I(B)===g}function Z(B){return I(B)===a}function X(B){return I(B)===r}function Y(B){return I(B)===s}function re(B){return I(B)===u}ne.AsyncMode=v,ne.ConcurrentMode=k,ne.ContextConsumer=G,ne.ContextProvider=$,ne.Element=ee,ne.ForwardRef=H,ne.Fragment=D,ne.Lazy=R,ne.Memo=ie,ne.Portal=j,ne.Profiler=q,ne.StrictMode=T,ne.Suspense=M,ne.isAsyncMode=F,ne.isConcurrentMode=A,ne.isContextConsumer=S,ne.isContextProvider=L,ne.isElement=Q,ne.isForwardRef=P,ne.isFragment=z,ne.isLazy=V,ne.isMemo=W,ne.isPortal=Z,ne.isProfiler=X,ne.isStrictMode=Y,ne.isSuspense=re,ne.isValidElementType=_,ne.typeOf=I})()),ne}var dr;function Ca(){return dr||(dr=1,process.env.NODE_ENV==="production"?xn.exports=Fd():xn.exports=Vd()),xn.exports}var _a,hr;function Wd(){if(hr)return _a;hr=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function s(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var i={},c=0;c<10;c++)i["_"+String.fromCharCode(c)]=c;var d=Object.getOwnPropertyNames(i).map(function(h){return i[h]});if(d.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(h){l[h]=h}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return _a=s()?Object.assign:function(r,i){for(var c,d=o(r),l,h=1;h<arguments.length;h++){c=Object(arguments[h]);for(var u in c)t.call(c,u)&&(d[u]=c[u]);if(e){l=e(c);for(var f=0;f<l.length;f++)a.call(c,l[f])&&(d[l[f]]=c[l[f]])}}return d},_a}var Sa,ur;function Na(){if(ur)return Sa;ur=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Sa=e,Sa}var Ea,fr;function mr(){return fr||(fr=1,Ea=Function.call.bind(Object.prototype.hasOwnProperty)),Ea}var Ta,gr;function Yd(){if(gr)return Ta;gr=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Na(),a={},o=mr();e=function(r){var i="Warning: "+r;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(r,i,c,d,l){if(process.env.NODE_ENV!=="production"){for(var h in r)if(o(r,h)){var u;try{if(typeof r[h]!="function"){var f=Error((d||"React class")+": "+c+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}u=r[h](i,h,d,c,null,t)}catch(m){u=m}if(u&&!(u instanceof Error)&&e((d||"React class")+": type specification of "+c+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in a)){a[u.message]=!0;var g=l?l():"";e("Failed "+c+" type: "+u.message+(g??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},Ta=s,Ta}var Ia,pr;function Kd(){if(pr)return Ia;pr=1;var e=Ca(),t=Wd(),a=Na(),o=mr(),s=Yd(),r=function(){};process.env.NODE_ENV!=="production"&&(r=function(c){var d="Warning: "+c;typeof console<"u"&&console.error(d);try{throw new Error(d)}catch{}});function i(){return null}return Ia=function(c,d){var l=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function u(A){var S=A&&(l&&A[l]||A[h]);if(typeof S=="function")return S}var f="<<anonymous>>",g={array:C("array"),bigint:C("bigint"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:N(),arrayOf:_,element:I(),elementType:v(),instanceOf:k,node:H(),objectOf:$,oneOf:G,oneOfType:ee,shape:R,exact:ie};function m(A,S){return A===S?A!==0||1/A===1/S:A!==A&&S!==S}function p(A,S){this.message=A,this.data=S&&typeof S=="object"?S:{},this.stack=""}p.prototype=Error.prototype;function y(A){if(process.env.NODE_ENV!=="production")var S={},L=0;function Q(z,V,W,Z,X,Y,re){if(Z=Z||f,Y=Y||W,re!==a){if(d){var B=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw B.name="Invariant Violation",B}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ae=Z+":"+W;!S[Ae]&&L<3&&(r("You are manually calling a React.PropTypes validation function for the `"+Y+"` prop on `"+Z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),S[Ae]=!0,L++)}}return V[W]==null?z?V[W]===null?new p("The "+X+" `"+Y+"` is marked as required "+("in `"+Z+"`, but its value is `null`.")):new p("The "+X+" `"+Y+"` is marked as required in "+("`"+Z+"`, but its value is `undefined`.")):null:A(V,W,Z,X,Y)}var P=Q.bind(null,!1);return P.isRequired=Q.bind(null,!0),P}function C(A){function S(L,Q,P,z,V,W){var Z=L[Q],X=T(Z);if(X!==A){var Y=M(Z);return new p("Invalid "+z+" `"+V+"` of type "+("`"+Y+"` supplied to `"+P+"`, expected ")+("`"+A+"`."),{expectedType:A})}return null}return y(S)}function N(){return y(i)}function _(A){function S(L,Q,P,z,V){if(typeof A!="function")return new p("Property `"+V+"` of component `"+P+"` has invalid PropType notation inside arrayOf.");var W=L[Q];if(!Array.isArray(W)){var Z=T(W);return new p("Invalid "+z+" `"+V+"` of type "+("`"+Z+"` supplied to `"+P+"`, expected an array."))}for(var X=0;X<W.length;X++){var Y=A(W,X,P,z,V+"["+X+"]",a);if(Y instanceof Error)return Y}return null}return y(S)}function I(){function A(S,L,Q,P,z){var V=S[L];if(!c(V)){var W=T(V);return new p("Invalid "+P+" `"+z+"` of type "+("`"+W+"` supplied to `"+Q+"`, expected a single ReactElement."))}return null}return y(A)}function v(){function A(S,L,Q,P,z){var V=S[L];if(!e.isValidElementType(V)){var W=T(V);return new p("Invalid "+P+" `"+z+"` of type "+("`"+W+"` supplied to `"+Q+"`, expected a single ReactElement type."))}return null}return y(A)}function k(A){function S(L,Q,P,z,V){if(!(L[Q]instanceof A)){var W=A.name||f,Z=F(L[Q]);return new p("Invalid "+z+" `"+V+"` of type "+("`"+Z+"` supplied to `"+P+"`, expected ")+("instance of `"+W+"`."))}return null}return y(S)}function G(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&(arguments.length>1?r("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):r("Invalid argument supplied to oneOf, expected an array.")),i;function S(L,Q,P,z,V){for(var W=L[Q],Z=0;Z<A.length;Z++)if(m(W,A[Z]))return null;var X=JSON.stringify(A,function(re,B){var Ae=M(B);return Ae==="symbol"?String(B):B});return new p("Invalid "+z+" `"+V+"` of value `"+String(W)+"` "+("supplied to `"+P+"`, expected one of "+X+"."))}return y(S)}function $(A){function S(L,Q,P,z,V){if(typeof A!="function")return new p("Property `"+V+"` of component `"+P+"` has invalid PropType notation inside objectOf.");var W=L[Q],Z=T(W);if(Z!=="object")return new p("Invalid "+z+" `"+V+"` of type "+("`"+Z+"` supplied to `"+P+"`, expected an object."));for(var X in W)if(o(W,X)){var Y=A(W,X,P,z,V+"."+X,a);if(Y instanceof Error)return Y}return null}return y(S)}function ee(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&r("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var S=0;S<A.length;S++){var L=A[S];if(typeof L!="function")return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+U(L)+" at index "+S+"."),i}function Q(P,z,V,W,Z){for(var X=[],Y=0;Y<A.length;Y++){var re=A[Y],B=re(P,z,V,W,Z,a);if(B==null)return null;B.data&&o(B.data,"expectedType")&&X.push(B.data.expectedType)}var Ae=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new p("Invalid "+W+" `"+Z+"` supplied to "+("`"+V+"`"+Ae+"."))}return y(Q)}function H(){function A(S,L,Q,P,z){return j(S[L])?null:new p("Invalid "+P+" `"+z+"` supplied to "+("`"+Q+"`, expected a ReactNode."))}return y(A)}function D(A,S,L,Q,P){return new p((A||"React class")+": "+S+" type `"+L+"."+Q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+P+"`.")}function R(A){function S(L,Q,P,z,V){var W=L[Q],Z=T(W);if(Z!=="object")return new p("Invalid "+z+" `"+V+"` of type `"+Z+"` "+("supplied to `"+P+"`, expected `object`."));for(var X in A){var Y=A[X];if(typeof Y!="function")return D(P,z,V,X,M(Y));var re=Y(W,X,P,z,V+"."+X,a);if(re)return re}return null}return y(S)}function ie(A){function S(L,Q,P,z,V){var W=L[Q],Z=T(W);if(Z!=="object")return new p("Invalid "+z+" `"+V+"` of type `"+Z+"` "+("supplied to `"+P+"`, expected `object`."));var X=t({},L[Q],A);for(var Y in X){var re=A[Y];if(o(A,Y)&&typeof re!="function")return D(P,z,V,Y,M(re));if(!re)return new p("Invalid "+z+" `"+V+"` key `"+Y+"` supplied to `"+P+"`.\nBad object: "+JSON.stringify(L[Q],null," ")+`
|
|
130
130
|
Valid keys: `+JSON.stringify(Object.keys(A),null," "));var B=re(W,Y,P,z,V+"."+Y,a);if(B)return B}return null}return y(S)}function j(A){switch(typeof A){case"number":case"string":case"undefined":return!0;case"boolean":return!A;case"object":if(Array.isArray(A))return A.every(j);if(A===null||c(A))return!0;var S=u(A);if(S){var L=S.call(A),Q;if(S!==A.entries){for(;!(Q=L.next()).done;)if(!j(Q.value))return!1}else for(;!(Q=L.next()).done;){var P=Q.value;if(P&&!j(P[1]))return!1}}else return!1;return!0;default:return!1}}function q(A,S){return A==="symbol"?!0:S?S["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&S instanceof Symbol:!1}function T(A){var S=typeof A;return Array.isArray(A)?"array":A instanceof RegExp?"object":q(S,A)?"symbol":S}function M(A){if(typeof A>"u"||A===null)return""+A;var S=T(A);if(S==="object"){if(A instanceof Date)return"date";if(A instanceof RegExp)return"regexp"}return S}function U(A){var S=M(A);switch(S){case"array":case"object":return"an "+S;case"boolean":case"date":case"regexp":return"a "+S;default:return S}}function F(A){return!A.constructor||!A.constructor.name?f:A.constructor.name}return g.checkPropTypes=s,g.resetWarningCache=s.resetWarningCache,g.PropTypes=g,g},Ia}var ka,Ar;function Jd(){if(Ar)return ka;Ar=1;var e=Na();function t(){}function a(){}return a.resetWarningCache=t,ka=function(){function o(i,c,d,l,h,u){if(u!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}o.isRequired=o;function s(){return o}var r={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:s,element:o,elementType:o,instanceOf:s,node:o,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:a,resetWarningCache:t};return r.PropTypes=r,r},ka}var yr;function Zd(){if(yr)return kn.exports;if(yr=1,process.env.NODE_ENV!=="production"){var e=Ca(),t=!0;kn.exports=Kd()(e.isElement,t)}else kn.exports=Jd()();return kn.exports}var Xd=Zd();const ve=ft(Xd);var Rd=["sitekey","onChange","theme","type","tabindex","onExpired","onErrored","size","stoken","grecaptcha","badge","hl","isolated"];function xa(){return xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},xa.apply(this,arguments)}function e1(e,t){if(e==null)return{};var a={},o=Object.keys(e),s,r;for(r=0;r<o.length;r++)s=o[r],!(t.indexOf(s)>=0)&&(a[s]=e[s]);return a}function Un(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ua(e,t)}function Ua(e,t){return Ua=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,s){return o.__proto__=s,o},Ua(e,t)}var qn=(function(e){t1(t,e);function t(){var o;return o=e.call(this)||this,o.handleExpired=o.handleExpired.bind(Un(o)),o.handleErrored=o.handleErrored.bind(Un(o)),o.handleChange=o.handleChange.bind(Un(o)),o.handleRecaptchaRef=o.handleRecaptchaRef.bind(Un(o)),o}var a=t.prototype;return a.getCaptchaFunction=function(s){return this.props.grecaptcha?this.props.grecaptcha.enterprise?this.props.grecaptcha.enterprise[s]:this.props.grecaptcha[s]:null},a.getValue=function(){var s=this.getCaptchaFunction("getResponse");return s&&this._widgetId!==void 0?s(this._widgetId):null},a.getWidgetId=function(){return this.props.grecaptcha&&this._widgetId!==void 0?this._widgetId:null},a.execute=function(){var s=this.getCaptchaFunction("execute");if(s&&this._widgetId!==void 0)return s(this._widgetId);this._executeRequested=!0},a.executeAsync=function(){var s=this;return new Promise(function(r,i){s.executionResolve=r,s.executionReject=i,s.execute()})},a.reset=function(){var s=this.getCaptchaFunction("reset");s&&this._widgetId!==void 0&&s(this._widgetId)},a.forceReset=function(){var s=this.getCaptchaFunction("reset");s&&s()},a.handleExpired=function(){this.props.onExpired?this.props.onExpired():this.handleChange(null)},a.handleErrored=function(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)},a.handleChange=function(s){this.props.onChange&&this.props.onChange(s),this.executionResolve&&(this.executionResolve(s),delete this.executionReject,delete this.executionResolve)},a.explicitRender=function(){var s=this.getCaptchaFunction("render");if(s&&this._widgetId===void 0){var r=document.createElement("div");this._widgetId=s(r,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge,isolated:this.props.isolated}),this.captcha.appendChild(r)}this._executeRequested&&this.props.grecaptcha&&this._widgetId!==void 0&&(this._executeRequested=!1,this.execute())},a.componentDidMount=function(){this.explicitRender()},a.componentDidUpdate=function(){this.explicitRender()},a.handleRecaptchaRef=function(s){this.captcha=s},a.render=function(){var s=this.props;s.sitekey,s.onChange,s.theme,s.type,s.tabindex,s.onExpired,s.onErrored,s.size,s.stoken,s.grecaptcha,s.badge,s.hl,s.isolated;var r=e1(s,Rd);return Pa.createElement("div",xa({},r,{ref:this.handleRecaptchaRef}))},t})(Pa.Component);qn.displayName="ReCAPTCHA",qn.propTypes={sitekey:ve.string.isRequired,onChange:ve.func,grecaptcha:ve.object,theme:ve.oneOf(["dark","light"]),type:ve.oneOf(["image","audio"]),tabindex:ve.number,onExpired:ve.func,onErrored:ve.func,size:ve.oneOf(["compact","normal","invisible"]),stoken:ve.string,hl:ve.string,badge:ve.oneOf(["bottomright","bottomleft","inline"]),isolated:ve.bool},qn.defaultProps={onChange:function(){},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};var qa,wr;function n1(){if(wr)return qa;wr=1;var e=Ca(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},r={};r[e.ForwardRef]=o,r[e.Memo]=s;function i(m){return e.isMemo(m)?s:r[m.$$typeof]||t}var c=Object.defineProperty,d=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,f=Object.prototype;function g(m,p,y){if(typeof p!="string"){if(f){var C=u(p);C&&C!==f&&g(m,C,y)}var N=d(p);l&&(N=N.concat(l(p)));for(var _=i(m),I=i(p),v=0;v<N.length;++v){var k=N[v];if(!a[k]&&!(y&&y[k])&&!(I&&I[k])&&!(_&&_[k])){var G=h(p,k);try{c(m,k,G)}catch{}}}}return m}return qa=g,qa}var a1=n1();const o1=ft(a1);function La(){return La=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},La.apply(this,arguments)}function s1(e,t){if(e==null)return{};var a={},o=Object.keys(e),s,r;for(r=0;r<o.length;r++)s=o[r],!(t.indexOf(s)>=0)&&(a[s]=e[s]);return a}function r1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Oe={},i1=0;function c1(e,t){return t=t||{},function(o){var s=o.displayName||o.name||"Component",r=(function(c){r1(d,c);function d(h,u){var f;return f=c.call(this,h,u)||this,f.state={},f.__scriptURL="",f}var l=d.prototype;return l.asyncScriptLoaderGetScriptLoaderID=function(){return this.__scriptLoaderID||(this.__scriptLoaderID="async-script-loader-"+i1++),this.__scriptLoaderID},l.setupScriptURL=function(){return this.__scriptURL=typeof e=="function"?e():e,this.__scriptURL},l.asyncScriptLoaderHandleLoad=function(u){var f=this;this.setState(u,function(){return f.props.asyncScriptOnLoad&&f.props.asyncScriptOnLoad(f.state)})},l.asyncScriptLoaderTriggerOnScriptLoaded=function(){var u=Oe[this.__scriptURL];if(!u||!u.loaded)throw new Error("Script is not loaded.");for(var f in u.observers)u.observers[f](u);delete window[t.callbackName]},l.componentDidMount=function(){var u=this,f=this.setupScriptURL(),g=this.asyncScriptLoaderGetScriptLoaderID(),m=t,p=m.globalName,y=m.callbackName,C=m.scriptId;if(p&&typeof window[p]<"u"&&(Oe[f]={loaded:!0,observers:{}}),Oe[f]){var N=Oe[f];if(N&&(N.loaded||N.errored)){this.asyncScriptLoaderHandleLoad(N);return}N.observers[g]=function(G){return u.asyncScriptLoaderHandleLoad(G)};return}var _={};_[g]=function(G){return u.asyncScriptLoaderHandleLoad(G)},Oe[f]={loaded:!1,observers:_};var I=document.createElement("script");I.src=f,I.async=!0;for(var v in t.attributes)I.setAttribute(v,t.attributes[v]);C&&(I.id=C);var k=function($){if(Oe[f]){var ee=Oe[f],H=ee.observers;for(var D in H)$(H[D])&&delete H[D]}};y&&typeof window<"u"&&(window[y]=function(){return u.asyncScriptLoaderTriggerOnScriptLoaded()}),I.onload=function(){var G=Oe[f];G&&(G.loaded=!0,k(function($){return y?!1:($(G),!0)}))},I.onerror=function(){var G=Oe[f];G&&(G.errored=!0,k(function($){return $(G),!0}))},document.body.appendChild(I)},l.componentWillUnmount=function(){var u=this.__scriptURL;if(t.removeOnUnmount===!0)for(var f=document.getElementsByTagName("script"),g=0;g<f.length;g+=1)f[g].src.indexOf(u)>-1&&f[g].parentNode&&f[g].parentNode.removeChild(f[g]);var m=Oe[u];m&&(delete m.observers[this.asyncScriptLoaderGetScriptLoaderID()],t.removeOnUnmount===!0&&delete Oe[u])},l.render=function(){var u=t.globalName,f=this.props;f.asyncScriptOnLoad;var g=f.forwardedRef,m=s1(f,["asyncScriptOnLoad","forwardedRef"]);return u&&typeof window<"u"&&(m[u]=typeof window[u]<"u"?window[u]:void 0),m.ref=g,E.createElement(o,m)},d})(E.Component),i=E.forwardRef(function(c,d){return E.createElement(r,La({},c,{forwardedRef:d}))});return i.displayName="AsyncScriptLoader("+s+")",i.propTypes={asyncScriptOnLoad:ve.func},o1(i,o)}}var Ba="onloadcallback",l1="grecaptcha";function Oa(){return typeof window<"u"&&window.recaptchaOptions||{}}function d1(){var e=Oa(),t=e.useRecaptchaNet?"recaptcha.net":"www.google.com";return e.enterprise?"https://"+t+"/recaptcha/enterprise.js?onload="+Ba+"&render=explicit":"https://"+t+"/recaptcha/api.js?onload="+Ba+"&render=explicit"}const br=c1(d1,{callbackName:Ba,globalName:l1,attributes:Oa().nonce?{nonce:Oa().nonce}:{}})(qn),x={overlay:"_overlay_18ksj_1",header:"_header_18ksj_18",logo:"_logo_18ksj_25",card:"_card_18ksj_32",close:"_close_18ksj_47",form:"_form_18ksj_71",formUl:"_formUl_18ksj_80",field:"_field_18ksj_92",label:"_label_18ksj_99",input:"_input_18ksj_108",error:"_error_18ksj_126",primary:"_primary_18ksj_132",divider:"_divider_18ksj_170",google:"_google_18ksj_196",googleIcon:"_googleIcon_18ksj_226",spin:"_spin_18ksj_259",checkboxRow:"_checkboxRow_18ksj_281",switch:"_switch_18ksj_310",terms:"_terms_18ksj_318",message:"_message_18ksj_349",passwordChecker:"_passwordChecker_18ksj_354",valid:"_valid_18ksj_373",invalid:"_invalid_18ksj_377",forgotPassword:"_forgotPassword_18ksj_381",successContainer:"_successContainer_18ksj_400",thumbsUp:"_thumbsUp_18ksj_408",successMessage:"_successMessage_18ksj_414"},Je=()=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:x.spin,children:n.jsx("path",{d:"M18,4.181v2.021c4.559,0.929,8,4.97,8,9.798c0,5.514-4.486,10-10,10S6,21.514,6,16c0-4.829,3.441-8.869,8-9.798V4.181 C8.334,5.137,4,10.066,4,16c0,6.617,5.383,12,12,12s12-5.383,12-12C28,10.066,23.666,5.137,18,4.181z"})}),h1=({isOpen:e,onClose:t,commentId:a,publication:o,username:s,CAPTCHA_KEY_V2:r})=>{const[i,c]=E.useState("form"),[d,l]=E.useState(""),[h,u]=E.useState(""),[f,g]=E.useState(""),m=[{id:"spam",label:je.spam},{id:"inappropriate",label:je.inappropriate},{id:"hate",label:je.hate},{id:"misinformation",label:je.misinformation},{id:"terrorism",label:je.terrorism},{id:"intellectual",label:je.intellectual},{id:"bullying",label:je.bullying}],p=async()=>{if(!(!d||!a)){if(ir(document).includes(a)){u("Ya has reportado este comentario.");return}c("loading"),u("");try{const N=await(await fetch("/api/comments-report",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:o,username:s,id:a,captchaToken:f,type:je[d]})})).json();if(N.type==="success")Hd(document,a),c("success"),setTimeout(()=>{y()},3e3);else throw new Error(N.message||"Error al reportar comentario")}catch(C){console.error("Error reporting comment:",C),u(C.message||"Error al reportar comentario"),c("form")}}},y=()=>{c("form"),l(""),u(""),t()};return!e||!a||!s?null:n.jsx("div",{className:de.overlay,children:n.jsxs("div",{className:de.popup,children:[n.jsx("button",{className:"close-reply-form",onClick:y,children:n.jsx(bt,{})}),n.jsx("h2",{className:de.title,children:"Reportar Abuso"}),i==="loading"&&n.jsx("div",{className:de.loadingContainer,children:n.jsx(Je,{})}),i==="form"||i==="loading"?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:de.optionsContainer,children:m.map(C=>n.jsxs("label",{className:de.option,children:[n.jsx("input",{type:"radio",name:"reportReason",value:C.id,checked:d===C.id,onChange:N=>l(N.target.value),className:de.radioInput}),n.jsx("span",{className:de.radioCustom}),n.jsx("span",{className:de.optionLabel,children:C.label})]},C.id))}),h&&n.jsx("div",{className:de.errorMessage,children:h}),n.jsx(br,{sitekey:r,theme:"light",size:"normal",onChange:C=>g(C??""),onExpired:()=>g("")}),n.jsxs("div",{className:de.buttons,children:[n.jsx("button",{onClick:y,className:de.cancelButton,children:"Cancelar"}),n.jsx("button",{onClick:p,disabled:!d,className:de.reportButton,children:"Reportar"})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:de.successContainer,children:[n.jsx("div",{className:de.thumbsUp,children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:n.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),n.jsx("p",{className:de.successMessage,children:"¡Gracias por reportar!"})]}),n.jsx("div",{className:de.buttons,children:n.jsx("button",{onClick:y,className:[de.closeButton,de.buttonAlone].join(" "),children:"Cerrar"})})]})]})})};async function Ln({publication:e,path:t,size:a=5,sizereply:o=2,id:s,lastid:r,state:i="5,6",apiToken:c}){const{PUBLIC_ENV:d}=K();if(d==="prod")return(await vr({publication:e,path:t,size:a,sizereply:o,id:s,lastid:r,state:i,apiToken:c}))[0];{const l=await fetch(`/api/comments-get?publication=${e}&path=${t}&size=${a}&sizereply=${o}&lastid=${r}`);if(!l.ok)throw new Error(`Error al obtener comentarios: ${l.status}`);return(await l.json()).data[0]}}async function vr({publication:e,path:t,size:a=5,sizereply:o=2,id:s,lastid:r,state:i="5,6",apiToken:c}){if(!e||!t)throw new Error("Missing required parameters: publication and path");if(typeof e!="string"||typeof t!="string")throw new Error("Invalid input types for publication or path");if(!c)throw new Error("Missing CMS API token");const{PUBLIC_ENV:d,PUBLIC_API_HOST:l,PUBLIC_API_PATH:h,PUBLIC_API_PATH_VERSION:u}=K(),f=parseInt(String(a),10),g=parseInt(String(o),10);if(isNaN(f)||f<=0)throw new Error("Invalid size parameter");if(isNaN(g)||g<0)throw new Error("Invalid sizereply parameter");const m=d!=="prod"?`${l}${h}`:Ka(),p=new URLSearchParams({publication:e,path:t,size:f.toString(),sizereply:g.toString(),state:i});s&&p.append("id",s),r&&p.append("lastid",r);const y=`${m}${u}/newcomments/get?${p.toString()}`;try{console.log("Fetching comments from:",y);const{data:C}=await oe.get(y,{headers:{"x-api-token":c,"Cache-Control":"max-age=0, no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(!C)throw new Error("No comments data received");return C.data||C||[]}catch(C){if(console.error("Error fetching comments:",C),oe.isAxiosError(C)){const N=C.response?.status,_=C.response?.data;throw N===404?new Error("Comments not found"):N===403?new Error("Access forbidden - check API token"):N===401?new Error("Unauthorized - invalid API token"):N===500?new Error("Internal server error from CMS"):new Error(_?.error||_?.message||`HTTP ${N}: Failed to fetch comments`)}throw C}}const{PUBLIC_PUBLICATION_ID:u1}=K(),f1=u1,m1=e=>{const[t,a]=E.useState(void 0);return E.useEffect(()=>{if(t)return;(async()=>{const{PUBLIC_X_SECURITY_TOKEN:s}=K();try{const r=await Ln({publication:f1,path:e??"",size:5,sizereply:2,id:void 0,lastid:void 0,state:"5,6",apiToken:s});a(r??[])}catch(r){console.error(r),a({comments:[],morecomment:!1})}})()},[t]),{comments:t,setComments:a}},Cr=({username:e,date:t})=>n.jsxs("div",{className:"comment-header",children:[n.jsx("span",{className:"comment-username",children:e}),n.jsx("span",{className:"comment-header-dot",children:"•"}),n.jsx("span",{className:"comment-date",children:$d(xe(Number(t)))})]}),_r=({user:e})=>n.jsx("div",{className:"comment-avatar",children:e.picture?n.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):e.firstname.charAt(0).toUpperCase()}),Sr=({isReply:e=!1,onReply:t,onFlag:a})=>n.jsxs("div",{className:"comment-actions",children:[!e&&t&&n.jsx("button",{onClick:t,className:"comment-action-btn",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",children:[n.jsx("g",{clipPath:"url(#a)",children:n.jsx("path",{fill:"#4D4E4E",d:"M9.976 9V5l-6.983 7 6.983 7v-4.1c4.988 0 8.48 1.6 10.973 5.1-.997-5-3.99-10-10.973-11Z"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"a",children:n.jsx("path",{fill:"#fff",d:"M0 0h23.942v24H0z"})})})]})}),n.jsx("button",{onClick:a,className:"comment-action-btn",children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"none",children:[n.jsx("g",{clipPath:"url(#a)",children:n.jsx("path",{fill:"#4D4E4E",d:"M20.133 2h-16c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2Zm0 14H5.303l-1.17 1.17V4h16v12Zm-9-11h2v6h-2V5Zm0 8h2v2h-2v-2Z"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"a",children:n.jsx("path",{fill:"#fff",d:"M.133 0h24v24h-24z"})})})]})})]}),Nr=({commentRef:e,captchaToken:t="",setIsDisabled:a})=>(E.useEffect(()=>{const o=e.current;if(!o)return;const s=()=>{const i=o.value.length;o.parentElement&&(o.parentElement.dataset.text=`${i}/${ut}`),o.classList.toggle("over-limit",i>ut),a(!va(e,t).boolean)};return o.addEventListener("input",s),s(),()=>o.removeEventListener("input",s)},[e,t,a]),n.jsxs("div",{children:[n.jsx("label",{className:"comment-input-label",children:"Comentario"}),n.jsx("textarea",{ref:e,name:"comment",placeholder:"Ingresa un comentario",rows:2})]})),Er=({commentRef:e,captchaToken:t="",setCaptchaToken:a,children:o,CAPTCHA_KEY_V2:s})=>{const r=va(e,t);return n.jsxs("div",{className:"form-actions",children:[n.jsx(br,{sitekey:s,theme:"light",size:"normal",onChange:i=>a(i??""),onExpired:()=>a("")}),n.jsxs("div",{className:"submit-zone",children:[o,!r.boolean&&n.jsx("p",{className:"submit-warning",children:r.text})]})]})},Tr=({onClick:e,isDisabled:t})=>{const[a,o]=E.useState(!1);return E.useEffect(()=>{let s=null;return a&&(s=setTimeout(()=>{o(!1)},2400)),()=>{s&&clearTimeout(s)}},[a]),a?n.jsx("div",{className:"success-gif-container",children:n.jsx("img",{className:"success-gif",src:"/Success.gif"})}):n.jsxs("button",{type:"button",onClick:async s=>{await e(s)&&o(!0)},id:"comment-button",className:`submit-btn ${t?"disabled":"active"}`,children:["Enviar Comentario",n.jsx("svg",{style:{minWidth:16},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M1.39258 8.99997H12.5626L7.68258 13.88C7.29258 14.27 7.29258 14.91 7.68258 15.3C8.07258 15.69 8.70258 15.69 9.09258 15.3L15.6826 8.70997C16.0726 8.31997 16.0726 7.68997 15.6826 7.29997L9.10258 0.699971C8.71258 0.309971 8.08258 0.309971 7.69258 0.699971C7.30258 1.08997 7.30258 1.71997 7.69258 2.10997L12.5626 6.99997H1.39258C0.842578 6.99997 0.392578 7.44997 0.392578 7.99997C0.392578 8.54997 0.842578 8.99997 1.39258 8.99997Z",fill:"currentColor"})})]})},{PUBLIC_PUBLICATION_ID:g1}=K(),p1=g1,Ir=async({path:e,ref:t,captchaToken:a,button:o,user:s,id:r,addComment:i})=>{const c=t.current?.value||"";if(!va(t,a).boolean||!s){const d=o.nextElementSibling;return d&&(d.style.display="block"),!1}try{const d=Date.now(),l=await fetch("/api/comments-add",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:p1,path:e,id:r,username:s.username,comment:c,recaptchaResponse:a})});let h=null;try{h=await l.json()}catch(m){console.error("Error parsing JSON response:",m)}if(!l.ok)throw new Error(`Error al enviar comentario: ${h?.message} status: ${l.status}`);const u=Date.now(),f=Math.max(0,2400+Math.abs(u-d)),g={username:s.username,firstname:s.firstname,...s.lastname&&{lastname:s.lastname},...s.picture&&{picture:s.picture}};return i({id:u.toString(),text:c,user:g,date:{time:Date.now()},reply:[]}),t.current&&(t.current.value=""),f}catch(d){return console.error("Error enviando comentario:",d),alert(d.message||"Error al enviar el comentario."),!1}},A1=({replyingTo:e,commentRef:t,user:a,path:o,addReply:s,closeForm:r,CAPTCHA_KEY_V2:i})=>{const[c,d]=E.useState(!0),[l,h]=E.useState(""),u=()=>{t.current?.parentElement&&(t.current.parentElement.dataset.text=`0/${ut}`),d(!0),r()};return n.jsxs("div",{className:"comment-form reply-form",children:[n.jsx("button",{className:"close-reply-form",onClick:u,children:n.jsx(bt,{})}),n.jsx(Nr,{commentRef:t,captchaToken:l,setIsDisabled:d}),n.jsx(Er,{commentRef:t,captchaToken:l,setCaptchaToken:h,CAPTCHA_KEY_V2:i,children:n.jsx(Tr,{onClick:async f=>{if(c)return;const g=await Ir({path:o,ref:t,captchaToken:l,button:f.currentTarget,user:a,id:e,addComment:s});return g&&typeof g=="number"?(setTimeout(()=>{u()},g),!0):!1},isDisabled:c})})]})},y1=({reply:e,replyingTo:t,user:a,onFlag:o})=>{const s=e.text;let r=`${Ke.firstname} ${Ke.lastname}`,i=Ke.username;return e.user&&(r=`${e.user.firstname} ${e.user.lastname}`,i=e.user.username),n.jsx("div",{className:"comment-item reply",children:n.jsxs("div",{className:"comment-header-container",children:[n.jsx(_r,{user:e.user?e.user:Ke}),n.jsxs("div",{style:{flex:1},children:[n.jsx(Cr,{username:r,date:e.date.time}),n.jsxs("div",{className:"comment-reply-to",children:["Respondiendo a ",n.jsx("strong",{children:t})]}),n.jsx("p",{className:"comment-text",children:s}),a?.username.toLowerCase()!==i.toLowerCase()&&n.jsx(Sr,{isReply:!0,onFlag:()=>o(e.id)})]})]})})},w1=({comment:e,replyingTo:t,path:a,user:o,handleReplyingTo:s,onFlag:r,CAPTCHA_KEY_V2:i})=>{const c={morereply:e.morereply??!1,reply:e.reply?e.reply:[]},[d,l]=E.useState(c),[h,u]=E.useState(!1),{PUBLIC_PUBLICATION_ID:f,PUBLIC_X_SECURITY_TOKEN:g}=K(),m=e.text,p=E.useRef(null);let y=`${Ke.firstname} ${Ke.lastname}`,C=Ke.username;e.user&&(y=`${e.user.firstname} ${e.user.lastname}`,C=e.user.username);const N=_=>{l({morereply:d.morereply,reply:[_,...d.reply]})};return n.jsx("div",{className:"comment-item",children:n.jsxs("div",{className:"comment-header-container","data-hasreplies":d.reply.length>0?"true":"false",children:[n.jsx(_r,{user:e.user?e.user:Ke}),n.jsxs("div",{style:{flex:1},children:[n.jsx(Cr,{username:y,date:e.date.time}),n.jsx("p",{className:"comment-text",children:m}),o?.username.toLowerCase()!==C.toLowerCase()&&n.jsx(Sr,{onReply:()=>s(e.id),onFlag:()=>r(e.id)}),t===e.id&&o&&n.jsx(A1,{replyingTo:t,commentRef:p,addReply:N,user:o,path:a,CAPTCHA_KEY_V2:i,closeForm:()=>s("")}),d.reply.length>0&&n.jsxs("div",{className:"comment-replies",children:[d.reply.map(_=>n.jsx(y1,{user:o,reply:_,replyingTo:y,onFlag:r},_.id)),h?n.jsx("div",{style:{marginLeft:"4rem",position:"relative"},children:n.jsx(Je,{})}):d.morereply&&n.jsx("button",{className:"comment-replies-button reply-button",onClick:async()=>{const _=d.reply[d.reply.length-1]?.id;u(!0);try{const v=await Ln({publication:f??"",path:a??"",size:2,sizereply:2,id:e.id,lastid:_,state:"5,6",apiToken:g??""});u(!1),l({morereply:v.morecomment,reply:[...d.reply,...v.comments]})}catch(I){throw u(!1),new Error(`Error al obtener comentarios: ${I}`)}},children:"Más Respuestas"})]})]})]})})},b1=({commentRef:e,user:t,path:a,addComment:o,CAPTCHA_KEY_V2:s})=>{const[r,i]=E.useState(!0),[c,d]=E.useState("");return n.jsxs("div",{className:"comment-form",children:[n.jsx(Nr,{commentRef:e,captchaToken:c,setIsDisabled:i}),n.jsx(Er,{CAPTCHA_KEY_V2:s,commentRef:e,captchaToken:c,setCaptchaToken:d,children:n.jsx(Tr,{onClick:async l=>{if(r)return;const h=await Ir({path:a,ref:e,captchaToken:c,button:l.currentTarget,user:t,addComment:o});return h&&typeof h=="number"?(e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${ut}`),i(!0),setTimeout(()=>{e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${ut}`),i(!0)},h),!0):!1},isDisabled:r})})]})},{PUBLIC_PUBLICATION_ID:v1,PUBLIC_X_SECURITY_TOKEN:C1}=K(),kr=v1??"",_1=({isAuthenticated:e,path:t,user:a,handleLogout:o,COMMENTS_VARS:s})=>{const r=t.replaceAll("/","|"),[i,c]=E.useState(void 0),[d,l]=E.useState(""),{comments:h,setComments:u}=m1(r),[f,g]=E.useState(!1),m=E.useRef(null),p=k=>{l(d===k?"":k)},y=k=>{u(h?{...h,comments:[k,...h.comments??[]]}:void 0)},C=k=>{c(k)},N=async()=>{if(!h||!h.morecomment||h.comments.length===0)return;const k=h.comments[h.comments.length-1];if(!k)return;g(!0);const G=k.id;try{const $=await Ln({publication:kr,path:r??"",size:5,sizereply:2,id:void 0,lastid:G,state:"5,6",apiToken:C1});u({morecomment:$.morecomment??!1,comments:[...h.comments,...$.comments]}),g(!1)}catch($){throw g(!1),new Error(`Error al obtener comentarios: ${$}`)}},_=h?.comments&&h.comments.length>0,I=_?"Comparte tu opinión de este artículo.":"Se el primero en compartir tu opinión de este artículo.",v=n.jsx("div",{style:{display:"flex",width:"100%",justifyContent:"center"},children:n.jsx(Je,{})});return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"comments-container",children:n.jsx(he,{title:_||e?"COMENTARIOS":!1,children:n.jsxs(n.Fragment,{children:[e&&a&&n.jsxs("div",{className:"comments-header",children:[n.jsx(jd,{user:a,handleLogout:o,message:I}),n.jsx(b1,{commentRef:m,user:a,addComment:y,path:r,CAPTCHA_KEY_V2:s.CAPTCHA_KEY_V2})]}),h?h.comments&&h.comments.length>0?n.jsxs("div",{className:"comments-list","data-isauthenticated":`${e}`,children:[h.comments.map(k=>n.jsx(w1,{comment:k,replyingTo:d,handleReplyingTo:p,onFlag:C,user:a??Ke,path:r,CAPTCHA_KEY_V2:s.CAPTCHA_KEY_V2},k.id)),f&&v]}):null:v,h?.morecomment&&!f&&n.jsx("button",{className:"comment-replies-button",onClick:N,children:"Más"})]})})}),n.jsx(h1,{username:a?.username??void 0,publication:kr,commentId:i,isOpen:i!==void 0,onClose:()=>c(void 0),CAPTCHA_KEY_V2:s.CAPTCHA_KEY_V2})]})},S1=async(e,t)=>{if(!e)throw new Error("No action provided");if(!t)throw new Error("No site key provided");const a=window.grecaptcha;if(!a?.enterprise)throw new Error("grecaptcha not loaded");return new Promise((o,s)=>{a.enterprise.ready(async()=>{try{const r=await a.enterprise.execute(t,{action:e});if(!r)throw new Error("Captcha token no generado");o(r)}catch(r){s(r)}})})},xr={email:{label:"Email",required:!0},given_name:{label:"Nombre",required:!0},family_name:{label:"Apellido",required:!0},password:{label:"Contraseña",required:!0},confirmPassword:{label:"Confirmar contraseña",required:!0}},Bn=[{label:"La contraseña debe tener al menos 8 caracteres",test:e=>e.length>=8},{label:"Usa un número",test:e=>/\d/.test(e)},{label:"Usa una letra minúscula",test:e=>/[a-z]/.test(e)},{label:"Usa una letra mayúscula",test:e=>/[A-Z]/.test(e)},{label:"Usa un símbolo",test:e=>/[^A-Za-z0-9]/.test(e)}];function N1({goToLogin:e,handleGoogleLogin:t,CAPTCHA_KEY:a}){const[o,s]=E.useState({}),[r,i]=E.useState(!1),[c,d]=E.useState(!1),[l,h]=E.useState(null),[u,f]=E.useState("register"),g=(C,N)=>{s(_=>({..._,[C]:N}))},m=async C=>{C.preventDefault(),h(null),d(!0);try{const N=Object.keys(xr).filter($=>!["username","password","confirmPassword"].includes($)).map($=>({Name:$,Value:o[$]}));if(N.some($=>{if(!$.Value||$.Value.trim()==="")return!0}))return d(!1),h("Complete todos los campos");if(o.password!==o.confirmPassword){h("Las contraseñas no coinciden");return}const _=o.password||"";if(Bn.some($=>!$.test(_))){h("La contraseña no es válida");return}const v=Math.floor(Date.now()/1e3);N.push({Name:"updated_at",Value:String(v)});const k="token",G=await fetch("/api/auth/create-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:o.email,password:o.password,userAttributes:N,token:k})});if(!G.ok){const $=await G.json().catch(()=>({}));if($.code==="UsernameExistsException"){await fetch("/api/auth/resend-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:o.email})}),f("confirm");return}throw new Error($?.error||"Error al crear usuario")}f("confirm")}catch(N){console.log(N),h(N?.message||N?.error||"Error inesperado")}finally{d(!1)}},p=async C=>{if(C.preventDefault(),!o.confirmationCode){h("Debes ingresar el código de verificación");return}h(null),d(!0);try{const N=await fetch("/api/auth/confirm-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:o.email,code:o.confirmationCode})});if(!N.ok){const _=await N.json().catch(()=>({}));throw new Error(_?.error||"Error al confirmar usuario")}f("success")}catch(N){h(N?.message||"Error inesperado")}finally{d(!1)}},y=o.password||"";return n.jsxs(n.Fragment,{children:[u==="register"&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:t,className:x.google,children:[n.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:x.googleIcon}),n.jsx("span",{children:"Continuar con Google"})]}),n.jsx("div",{className:x.divider,children:n.jsx("span",{children:"o"})}),n.jsxs("form",{onSubmit:m,className:x.form,"data-error":l?"true":"false",children:[n.jsx("ul",{className:x.formUl,children:Object.entries(xr).map(([C,{label:N}])=>n.jsxs("div",{className:x.field,children:[n.jsx("label",{className:x.label,children:N}),n.jsx("input",{type:C.toLowerCase().includes("password")?r?"text":"password":C==="birthdate"?"date":C==="email"?"email":C==="phone_number"?"tel":"text",name:C,value:o[C]||"",onChange:_=>g(C,_.target.value),className:x.input,placeholder:""}),C==="password"&&n.jsx("div",{className:x.passwordChecker,children:Bn.map((_,I)=>{const v=_.test(y);return n.jsxs("div",{className:v?x.valid:x.invalid,children:[n.jsx("div",{children:v?"✔":"○"}),n.jsx("div",{children:_.label})]},I)})}),C==="confirmPassword"&&n.jsxs("div",{className:x.checkboxRow,children:[n.jsx("input",{id:"showPasswordRegister",type:"checkbox",checked:r,onChange:_=>i(_.target.checked)}),n.jsx("label",{htmlFor:"showPasswordRegister",className:x.checkboxLabel,children:"Mostrar contraseñas"})]})]},C))}),l&&n.jsx("p",{className:x.error,children:l}),n.jsxs("p",{className:x.terms,children:["Al continuar, confirmo que he leído y aceptado los",n.jsx("a",{href:"/pages/politicas-de-privacidad.html",target:"_blank",children:"Términos y Condiciones"}),"de nuestra comunidad"]}),n.jsx("button",{type:"submit",className:x.primary,disabled:c,children:c?n.jsx(Je,{}):"Crear cuenta"})]})]}),u==="confirm"&&n.jsxs("form",{onSubmit:p,className:x.form,"data-error":l?"true":"false",children:[n.jsxs("div",{className:x.field,children:[n.jsx("label",{className:x.label,children:"Código de verificación"}),n.jsx("input",{type:"text",name:"confirmationCode",value:o.confirmationCode||"",onChange:C=>g("confirmationCode",C.target.value),className:x.input,required:!0})]}),l&&n.jsx("p",{className:x.error,children:l}),n.jsx("button",{type:"submit",className:x.primary,disabled:c,children:c?n.jsx(Je,{}):"Confirmar cuenta"}),n.jsxs("p",{className:x.switch,children:["¿Ya confirmaste antes?",n.jsx("button",{type:"button",onClick:e,children:"Iniciar sesión"})]})]}),u==="success"&&n.jsxs("form",{className:x.form,children:[n.jsxs("div",{className:x.successContainer,children:[n.jsx("div",{className:x.thumbsUp,children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:n.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),n.jsxs("div",{className:x.successMessage,children:[n.jsx("p",{children:"Confirmación completa."}),n.jsx("p",{children:"Ya eres parte de la comunidad!"})]})]}),n.jsx("button",{onClick:e,className:x.primary,children:"Iniciar sesión"})]}),u==="register"&&n.jsxs("p",{className:x.switch,children:["¿Ya tenés cuenta?",n.jsx("button",{type:"button",onClick:e,children:"Iniciar sesión"})]})]})}function E1({onClose:e,checkAuth:t,goToRegister:a,handleGoogleLogin:o,CAPTCHA_KEY:s}){const[r,i]=E.useState("login"),[c,d]=E.useState(""),[l,h]=E.useState(""),[u,f]=E.useState(""),[g,m]=E.useState(""),[p,y]=E.useState(""),[C,N]=E.useState(!1),[_,I]=E.useState(!1),[v,k]=E.useState(null);console.log("CAPTCHA_KEY",s);const G=async H=>{if(!_){H.preventDefault(),k(null),I(!0);try{console.log(!0,s);const D="token",R=await fetch("/api/auth/login-password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:c,password:l,token:D})});if(!R.ok){const ie=await R.json().catch(()=>({}));throw new Error(ie?.error||"Ha ocurrido un error")}e(),await t()}catch(D){k(D?.message||"Error inesperado")}finally{I(!1)}}},$=async H=>{if(!_){H.preventDefault(),k(null),I(!0);try{const D=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:c})});if(!D.ok){const R=await D.json().catch(()=>({}));throw new Error(R?.error||"Error al enviar código")}h(""),i("changePassword")}catch(D){k(D?.message||"Error inesperado")}finally{I(!1)}}},ee=async H=>{if(_)return;if(H.preventDefault(),g!==p){k("Las contraseñas no coinciden");return}if(Bn.some(R=>!R.test(g))){k("La contraseña no cumple con los requisitos");return}k(null),I(!0);try{const R=await fetch("/api/auth/confirm-forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:c,code:u,newPassword:g})});if(!R.ok){const ie=await R.json().catch(()=>({}));throw new Error(ie?.error||"Error al cambiar contraseña")}i("feedback")}catch(R){k(R?.message||"Error inesperado")}finally{I(!1)}};return n.jsxs(n.Fragment,{children:[r==="login"&&n.jsx(T1,{email:c,password:l,showPassword:C,loading:_,error:v,setEmail:d,setPassword:h,setShowPassword:N,onSubmit:G,onForgot:()=>{k(null),i("forgot")},onRegister:a,handleGoogleLogin:o}),r==="forgot"&&n.jsx(I1,{email:c,setEmail:d,loading:_,error:v,onSubmit:$,onBack:()=>{k(null),i("login")}}),r==="changePassword"&&n.jsx(k1,{email:c,confirmationCode:u,newPassword:g,confirmNewPassword:p,showPassword:C,loading:_,error:v,setConfirmationCode:f,setNewPassword:m,setConfirmNewPassword:y,setShowPassword:N,onSubmit:ee,onBack:()=>{k(null),i("forgot")}}),r==="feedback"&&n.jsx(x1,{onBackToLogin:()=>{k(null),i("login")}})]})}function T1({email:e,password:t,showPassword:a,loading:o,error:s,setEmail:r,setPassword:i,setShowPassword:c,onSubmit:d,onForgot:l,onRegister:h,handleGoogleLogin:u}){return n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:u,className:x.google,children:[n.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:x.googleIcon}),n.jsx("span",{children:"Continuar con Google"})]}),n.jsx("div",{className:x.divider,children:n.jsx("span",{children:"o"})}),n.jsxs("form",{onSubmit:d,className:x.form,"data-error":s?"true":"false",children:[n.jsxs("div",{className:x.field,children:[n.jsx("label",{className:x.label,children:"Email"}),n.jsx("input",{type:"email",value:e,onChange:f=>r(f.target.value),className:x.input,placeholder:""})]}),n.jsxs("div",{className:x.field,children:[n.jsx("label",{className:x.label,children:"Contraseña"}),n.jsx("input",{type:a?"text":"password",value:t,onChange:f=>i(f.target.value),className:x.input,placeholder:""}),n.jsxs("div",{className:x.checkboxRow,children:[n.jsx("input",{id:"showPasswordLogin",type:"checkbox",checked:a,onChange:f=>c(f.target.checked)}),n.jsx("label",{htmlFor:"showPasswordLogin",className:x.checkboxLabel,children:"Mostrar contraseña"})]})]}),s&&n.jsx("p",{className:x.error,children:s}),n.jsx("button",{type:"submit",className:x.primary,disabled:o,children:o?n.jsx(Je,{}):"Iniciar Sesión"})]}),n.jsxs("p",{className:x.switch,children:["¿No tenés cuenta?",n.jsx("button",{type:"button",onClick:h,children:"Registrate"})]}),n.jsx("button",{type:"button",className:x.forgotPassword,onClick:l,children:"Olvidé mi contraseña"})]})}function I1({email:e,setEmail:t,loading:a,error:o,onSubmit:s,onBack:r}){return n.jsxs("form",{onSubmit:s,className:x.form,"data-error":o?"true":"false",children:[n.jsx("p",{className:x.message,children:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña."}),n.jsxs("div",{className:x.field,children:[n.jsx("label",{className:x.label,children:"Email"}),n.jsx("input",{type:"email",value:e,name:"email",onChange:i=>t(i.target.value),className:x.input,placeholder:""})]}),o&&n.jsx("p",{className:x.error,children:o}),n.jsx("button",{type:"submit",className:x.primary,disabled:a,children:a?n.jsx(Je,{}):"Enviar código"}),n.jsx("p",{className:x.switch,children:n.jsx("button",{type:"button",onClick:r,children:"Volver"})})]})}function k1({email:e,confirmationCode:t,newPassword:a,confirmNewPassword:o,showPassword:s,loading:r,error:i,setConfirmationCode:c,setNewPassword:d,setConfirmNewPassword:l,setShowPassword:h,onSubmit:u,onBack:f}){return n.jsxs("form",{onSubmit:u,className:x.form,"data-error":i?"true":"false",children:[n.jsxs("p",{className:x.message,children:["Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a ",zd(e),". Ingrese el código y la contraseña nueva."]}),n.jsxs("ul",{className:x.formUl,children:[n.jsxs("div",{className:x.field,children:[n.jsx("label",{className:x.label,children:"Código de verificación"}),n.jsx("input",{type:"text",value:t,onChange:g=>c(g.target.value),className:x.input,placeholder:""})]}),n.jsxs("div",{className:x.field,children:[n.jsx("label",{className:x.label,children:"Nueva contraseña"}),n.jsx("input",{type:s?"text":"password",value:a,onChange:g=>d(g.target.value),className:x.input,placeholder:"",name:"password"}),n.jsx("div",{className:x.passwordChecker,children:Bn.map((g,m)=>{const p=g.test(a);return n.jsxs("div",{className:p?x.valid:x.invalid,children:[n.jsx("div",{children:p?"✔":"○"}),n.jsx("div",{children:g.label})]},m)})})]}),n.jsxs("div",{className:x.field,children:[n.jsx("label",{className:x.label,children:"Confirmar contraseña"}),n.jsx("input",{type:s?"text":"password",value:o,onChange:g=>l(g.target.value),className:x.input,placeholder:""}),n.jsxs("div",{className:x.checkboxRow,children:[n.jsx("input",{id:"showPasswordForgot",type:"checkbox",checked:s,onChange:g=>h(g.target.checked)}),n.jsx("label",{htmlFor:"showPasswordForgot",className:x.checkboxLabel,children:"Mostrar contraseñas"})]})]})]}),i&&n.jsx("p",{className:x.error,children:i}),n.jsx("button",{type:"submit",className:x.primary,style:{maxWidth:r?"revert-layer":"fit-content"},disabled:r,children:r?n.jsx(Je,{}):"Cambiar contraseña"}),n.jsx("p",{className:x.switch,children:n.jsx("button",{type:"button",onClick:f,children:"Volver"})})]})}function x1({onBackToLogin:e}){return n.jsxs("div",{className:x.form,children:[n.jsx("p",{className:x.success,children:"La contraseña fue cambiada con éxito"}),n.jsx("button",{type:"button",className:x.primary,onClick:e,children:"Iniciar Sesión"})]})}function U1({loginUrl:e,onClose:t,checkAuth:a,icon:o,COMMENTS_VARS:s}){const[r,i]=E.useState("login"),c=async()=>{{await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"}),localStorage.setItem("cognito-login","success:"+Date.now()),t(),a();return}};return n.jsx("div",{className:x.overlay,role:"dialog","aria-modal":"true",id:"pop-overlay",onClick:d=>{const l=d.target;l&&l.id==="pop-overlay"&&t()},children:n.jsxs("div",{className:x.card,children:[n.jsxs("header",{className:x.header,children:[n.jsx("div",{className:x.logo,children:o?o():null}),n.jsx("button",{onClick:t,className:x.close,"aria-label":"Cerrar",children:n.jsx(bt,{})})]}),r==="login"&&n.jsx(E1,{onClose:t,checkAuth:a,handleGoogleLogin:c,goToRegister:()=>i("register"),CAPTCHA_KEY:s.CAPTCHA_KEY}),r==="register"&&n.jsx(N1,{handleGoogleLogin:c,goToLogin:()=>i("login"),CAPTCHA_KEY:s.CAPTCHA_KEY})]})})}function q1({isAuthenticated:e,setIsAuthenticated:t,loginUrl:a,user:o,path:s,checkAuth:r,icon:i,COMMENTS_VARS:c}){const[d,l]=E.useState(!1),h=async()=>{await fetch("/api/auth/logout",{method:"GET",credentials:"include"}),t(!1)},u=async f=>{f.preventDefault(),a&&l(!0)};return n.jsxs(n.Fragment,{children:[d&&n.jsx(U1,{loginUrl:a,icon:i,checkAuth:r,COMMENTS_VARS:c,onClose:()=>{l(!1)}}),!e&&n.jsxs("div",{className:"auth-container",children:[n.jsx("p",{children:"Sumate a la comunidad para dejar tu comentario"}),n.jsx("a",{href:a,onClick:u,className:"login-button",children:"Iniciar Sesión"})]}),n.jsx(_1,{isAuthenticated:e,handleLogout:h,path:s,user:e?o:void 0,COMMENTS_VARS:c})]})}function L1({isVisible:e,path:t,icon:a,COMMENTS_VARS:o}){const[s,r]=E.useState(null),[i,c]=E.useState(null),d=o?.COGNITO_AUTH_PREFIX??"ASTRO_",l=E.useCallback(async()=>{if(e){if(console.log(d),document.cookie.search(d+"IS_AUTH=true")===-1){r(!1),c(null),console.log("user not logged");return}try{const g=await(await fetch("/api/auth/user",{credentials:"include"})).json();r(g.isAuthenticated??!1),c(g.user??null)}catch(f){console.error("Error checking auth:",f),r(!1),c(null)}}},[e,d]);E.useEffect(()=>{l()},[l,e]),E.useEffect(()=>{if(!i||!e||typeof window>"u")return;const f=window;if(typeof f!="function"){console.warn("gtag no está disponible todavía");return}f.gtag("set",{user_id:i.username}),console.log("username setted successfully")},[i,e]);const h="/api/auth/login",u=n.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:310,position:"relative"},children:n.jsx(Je,{})});return s===null?u:e?n.jsx(q1,{icon:a,isAuthenticated:s,setIsAuthenticated:r,loginUrl:h,user:i??void 0,checkAuth:l,path:t,COMMENTS_VARS:o}):u}const B1=({render:e,internalPath:t,section:a,currentNews:o,stylesConfig:s,icon:r,isVisibleDefault:i=!1,COMMENTS_VARS:c})=>{const d=E.useRef(null),[l,h]=E.useState(i);E.useEffect(()=>{if(i||l)return;const f=new IntersectionObserver(([g])=>{g?.isIntersecting&&(h(!0),f.disconnect())},{rootMargin:"0px",threshold:.1});return d.current&&f.observe(d.current),()=>f.disconnect()},[]);const u={comment:n.jsx(L1,{path:t,icon:r,isVisible:l,COMMENTS_VARS:c}),more:n.jsx(Pd,{section:a,currentNews:o,stylesConfig:s,isVisible:l})};return n.jsx("div",{ref:d,suppressHydrationWarning:!0,style:{...s?s["Modulo 1x3 Client"]?s["Modulo 1x3 Client"]:s["Modulo 1x3"]:{}},children:u[e]})};async function O1({publication:e,path:t,username:a,comment:o,id:s,recaptchaResponse:r,baseUrl:i,apiToken:c,securityToken:d,COMMENTS_VARS:l}){if(console.log("Adding comment with data:",{publication:e,path:t,username:a,comment:o,id:s,recaptchaResponse:r}),!e||!t||!o||!a)return{type:"error",message:"Faltan campos obligatorios. Por favor, completa todos los campos.",status:400};if([e,t,o,a].some(m=>typeof m!="string"))return{type:"error",message:"Datos inválidos. Intenta de nuevo.",status:400};if(!a.trim())return{type:"error",message:"El nombre no puede estar vacío.",status:400};if(!o.trim())return{type:"error",message:"El comentario no puede estar vacío.",status:400};const h=await rr(r,l);if(console.log("Verifying captcha token...",h),!h)return{type:"error",message:"Captcha inválido. Intenta nuevamente.",status:403};const u=`${i}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/add`,f={publication:e,path:t.replace(/\|/gi,"/"),username:a??!1,text:o.trim()};s&&(f.id=s);const g=new URLSearchParams(f);try{const{data:m}=await oe.get(`${u}?${g.toString()}`,{headers:{"Content-Type":"application/json","x-security-token":d,"x-api-token":c,"User-Agent":"amplifyapp-comments-saas"}});return!m||m.error?(console.error("CMS error response:",m),{type:"error",message:"No se pudo guardar el comentario. Intenta nuevamente en unos minutos.",status:502}):(console.log("Comentario enviado con éxito",m),{type:"success",message:"Comentario enviado con éxito.",status:200})}catch(m){if(console.error("Error enviando comentario:",m),oe.isAxiosError(m)){const p=m.response?.status??500,y=m.response?.data;return p===400?{type:"error",message:y?.message||"Solicitud inválida. Verifica que los campos sean correctos.",status:400}:p===403?{type:"error",message:"Captcha inválido o acceso prohibido.",status:403}:p===500?{type:"error",message:"Error interno del servidor del CMS.",status:500}:{type:"error",message:y?.message||"No se pudo enviar el comentario.",status:p}}return{type:"error",message:"Error inesperado. Intenta nuevamente.",status:500}}}const P1=async({token:e,projectId:t,captchaKey:a,apiKey:o,captchaAction:s})=>{if(!e)throw new Error("No token provided");if(!t||!a||!o)throw new Error("Missing project ID or site key");if(!s)throw new Error("No action provided");try{const i=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${t}/assessments?key=${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:a,expectedAction:s}})})).json();if(!i?.tokenProperties?.valid)throw new Error(`The token was: ${i?.tokenProperties?.invalidReason}`);if(i.tokenProperties.action!==s)throw new Error("The action attribute in your reCAPTCHA tag does not match the action you are expecting to score");return i?.riskAnalysis?.score??0}catch(r){throw console.error("Recaptcha verification failed",r),new Error(String(r))}};w.AssetsPreconnect=to,w.AutorComponent=Id,w.AutorHeader1=Cs,w.AutorHeader2=_s,w.BannerAdvertising=fe,w.BannerAdvertisingMiddle=Qe,w.CarrouselCSR=zc,w.CarrouselIRS=it,w.CarruselCard=$s,w.CarruselOpinion=Hs,w.CommonServices=Ee,w.Comscore=Da,w.ContactInfoServer=Ql,w.ContactInput=wl,w.ContactSelect=bl,w.ContactTextarea=vl,w.ContentLayout1=yt,w.ContentLayoutTema=oa,w.DEBUG_MainSlots=bd,w.DestacadoNoticias=Ls,w.DestacadoVideos=js,w.DynamicBlockServices=ts,w.DynamicComponents=wd,w.DynamicMainSlot=Tn,w.DynamicSlot=wa,w.EditorialBlock=Bl,w.ErrorComponent=yl,w.Font=fo,w.Footer=dl,w.FormatAfterScripts=eo,w.FormatScripts=Qn,w.GA4=Ma,w.GTM=ja,w.GalleryHeader=Aa,w.GenerateBody=jc,w.GenerateHead=Mc,w.Header=kl,w.IframeHeader=Zs,w.ImageOffline=ds,w.ImageOnline=_e,w.ImageOnlineClient=ls,w.IssuuServices=Bc,w.ItemListSchema=ro,w.JournalistArticule2=Is,w.JournalistGroup=ks,w.LayoutNewsComponent=ra,w.LazyLoader=B1,w.LinkComponent=O,w.LiveBlogHeader=bs,w.Location=$c,w.MainComponentServices=di,w.Marfeel=Qa,w.MiddleSection=Ze,w.Modulo1x3=ua,w.Modulo1x3Card=Gs,w.Modulo1x4=Ds,w.Modulo1x5=Ms,w.Modulo2Columnas=Ol,w.Modulo3Columnas=Os,w.ModuloNewsletter=Pl,w.ModuloOpinion=Ll,w.NewListResponseDataPH=or,w.NewsArticle=co,w.NewsComponent=Cd,w.NewsContent=yn,w.NewsDescriptionComponent=ct,w.NextPrev=Dt,w.OrgList=lo,w.PreloadImages=$n,w.REPORT_REASONS=je,w.Readest=fn,w.ScriptHydrator=Ld,w.SearchSection=Td,w.Section=he,w.SectionCard=De,w.SectionCard2=jt,w.SectionCardServerComponent=Sn,w.SectionServerComponent=jl,w.ShowSection=os,w.SocialNetworks=Vs,w.SpeculationRules=so,w.StaticSlotWrapper=yd,w.SubscribeColumn=ms,w.SubscribeRow=gs,w.SubscribeWhatsAppColumn=nl,w.TagComponent=Nd,w.TagSection=Ts,w.TimeLine=vs,w.TrimPathname=ni,w.VideoBlock3=Al,w.VideoBlock4=_l,w.VideoEmbeddedHeader=Ks,w.VideoSection=qd,w.VideoYoutubeHeader=Js,w.VideosSchemas=uo,w.WebsiteList=ho,w.addComment=O1,w.bannersReplace=Rt,w.becomeVideoObject=mt,w.buildTagUrl=at,w.coloringByStrokeSVGs=ps,w.compileStyleProps=En,w.cutString=Ue,w.extractRealtedNews=Rr,w.formatDate=xe,w.formatDateEdiciones=Xr,w.formatDateJournalistArticule=Dn,w.formatDateTimeline=Wa,w.formatNewsMeta=Ja,w.formatVideoData=no,w.generalGetData=Dc,w.getCaptchaToken=S1,w.getComments=vr,w.getConfig=K,w.getDynamicSlots=Oc,w.getEnvironmentUrl=Tt,w.getEnvironmentUrlFront=Ka,w.getHydratorPath=ri,w.getImageUrl=ue,w.getNextMeta=It,w.getPage=xt,w.getPreloadImages=li,w.getPrevMeta=kt,w.getReportReasonLabel=Gd,w.getResponse=Mn,w.getResponsePromise=Ya,w.getSchemas=en,w.getScriptReplaces=Hn,w.getSlugs=go,w.getTypeOfNews=oi,w.getVideoRealPath=si,w.handleGetComments=Ln,w.initLibrary=Br,w.metadataToJSX=Ra,w.metadata_defaults=ns,w.parseTags=jn,w.pathnameSplit=Za,w.processExtractedRelatedNews=ei,w.removePages=mo,w.reportComment=Qd,w.shareButtons=As,w.socialIcons=gn,w.speculationRules=oo,w.speculationRulesHome=ao,w.urlReplaces=Xa,w.verifyCaptchaTokenEnterprise=P1,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})}));
|