1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2504],{34477:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return a.callServer},createServerReference:function(){return c.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}});let a=r(53806),n=r(31818),c=r(77197)},72504:(e,t,r)=>{r.r(t),r.d(t,{ArticleComments:()=>d});var a=r(95155),n=r(12115),c=r(6874),i=r.n(c),l=r(34477);let s=(0,l.createServerReference)("7028ac3a60a488960d61f0fb891162b6e7df07e64d",l.callServer,void 0,l.findSourceMapURL,"postComment"),o=(0,l.createServerReference)("60c7f7f826678e00074949f9b3e882b943f29afed9",l.callServer,void 0,l.findSourceMapURL,"removeComment");var m=r(74729);function d(e){let{articleId:t,articleSlug:r,initialComments:c,session:l}=e,[d,u]=(0,n.useState)(c),[f,h]=(0,n.useState)(""),[_,b]=(0,n.useState)(!1),[p,x]=(0,n.useState)(null),[j,v]=(0,n.useState)(null);async function N(e){if(e.preventDefault(),!l)return;b(!0),x(null);let a=await s(t,r,f);a.ok&&a.comment&&(u(e=>[...e,a.comment]),h("")),x(a),b(!1)}async function S(e){v(e),(await o(e,r)).ok&&u(t=>t.filter(t=>t.id!==e)),v(null)}return(0,a.jsxs)("section",{className:"article-comments","aria-label":"Comentarios",children:[(0,a.jsxs)("h2",{className:"article-comments__title",children:["Comentarios",d.length>0?" (".concat(d.length,")"):""]}),d.length>0?(0,a.jsx)("ol",{className:"article-comments__list",children:d.map(e=>(0,a.jsxs)("li",{className:"article-comments__item",children:[(0,a.jsxs)("header",{className:"article-comments__meta",children:[(0,a.jsx)("span",{className:"article-comments__author",children:e.subscriberName}),(0,a.jsx)("time",{className:"article-comments__date",dateTime:e.createdAt,children:(0,m.r6)(e.createdAt)})]}),(0,a.jsx)("p",{className:"article-comments__body",children:e.body}),(null==l?void 0:l.id)===e.subscriberId?(0,a.jsx)("button",{type:"button",className:"article-comments__delete",onClick:()=>S(e.id),disabled:j===e.id,children:j===e.id?"Eliminandoâ¦":"Eliminar"}):null]},e.id))}):(0,a.jsx)("p",{className:"article-comments__empty",children:"S\xe9 el primero en comentar esta noticia."}),l?(0,a.jsxs)("form",{className:"article-comments__form",onSubmit:N,children:[(0,a.jsx)("label",{className:"article-comments__label",htmlFor:"comment-body",children:"Escribe tu comentario"}),(0,a.jsx)("textarea",{id:"comment-body",name:"body",className:"article-comments__textarea",rows:4,required:!0,minLength:3,maxLength:2e3,value:f,onChange:e=>h(e.target.value),placeholder:"Comparte tu opini\xf3n sobre esta noticiaâ¦",disabled:_}),(0,a.jsxs)("div",{className:"article-comments__form-footer",children:[(0,a.jsxs)("span",{className:"article-comments__hint",children:["M\xednimo ",3," caracteres"]}),(0,a.jsx)("button",{type:"submit",className:"article-comments__submit",disabled:_||f.trim().length<3,children:_?"Publicandoâ¦":"Publicar comentario"})]}),p&&!p.ok?(0,a.jsx)("p",{className:"article-comments__error",role:"alert",children:p.error}):null]}):(0,a.jsx)("div",{className:"article-comments__login-prompt",children:(0,a.jsxs)("p",{children:[(0,a.jsx)(i(),{href:"/suscriptor/login?next=/".concat(r),rel:"nofollow",children:"Inicia sesi\xf3n"})," ","para dejar un comentario."]})})]})}},74729:(e,t,r)=>{r.d(t,{kz:()=>c,r6:()=>i});let a="es-CL",n="America/Santiago";function c(e){return new Intl.DateTimeFormat(a,{day:"numeric",month:"short",year:"numeric",timeZone:n}).format(new Date(e))}function i(e){return new Intl.DateTimeFormat(a,{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:n}).format(new Date(e))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.