1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5581,8966,27962,50343,72724],{5581:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(37876),a=n(22507),s=n(77328),c=n.n(s),i=n(14232);function l(e){let{priority:t,id:n,src:s,alt:l,fallbackSrc:h,placeholderSrc:d,className:u,width:p,height:m,title:w,onLoad:x,onClick:j,style:N,loading:f}=e,b=((e,t)=>{let n=Number(e),r=Number(t);return Number.isFinite(n)&&n>0?Number.isFinite(r)&&r>0?Math.min(n,r):n:t})(p,(0,a.CQ)("IMAGE_COMPRESS_WIDTH")),v=(0,a.CQ)("IMG_LAZY_LOAD_PLACEHOLDER"),g=(0,i.useRef)(null),[y,E]=(0,i.useState)(t&&s?o(s,b):d||v),[_,M]=(0,i.useState)(!!(t&&s)),C=(0,i.useCallback)(()=>{g.current&&(g.current.src!==h&&h?g.current.src=h:g.current.src!==d&&d?g.current.src=d:g.current.src=v,M(!0),g.current.classList.remove("lazy-image-placeholder"))},[v,h,d]);(0,i.useEffect)(()=>{let e=o(s,b)||v,n=g.current,r=()=>{"function"==typeof x&&x(),M(!0),g.current&&g.current.classList.remove("lazy-image-placeholder")};if(t||!window.IntersectionObserver){let t=new Image;t.src=e,t.onload=()=>{E(e),r(e)},t.onerror=C;return}let c=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){let n=new Image;"decoding"in n&&(n.decoding="async"),n.src=e,n.onload=()=>{E(e),r(e)},n.onerror=C,c.unobserve(t.target)}})},{rootMargin:(0,a.CQ)("LAZY_LOAD_THRESHOLD","200px"),threshold:.1});return n&&c.observe(n),()=>{n&&c.unobserve(n)}},[s,b,t,v,h,C,x,d]);let k={ref:g,src:y,"data-src":s,alt:l||"Lazy loaded image",onLoad:()=>{},onError:C,className:"".concat(u||"").concat(_?"":" lazy-image-placeholder"),style:{aspectRatio:p&&m?"".concat(p," / ").concat(m):void 0,containIntrinsicSize:p||m?void 0:"300px 200px",...N},onClick:j,loading:t?"eager":f||"lazy",decoding:"async",...(0,a.CQ)("WEBP_SUPPORT")&&{"data-webp":!0},...(0,a.CQ)("AVIF_SUPPORT")&&{"data-avif":!0}};return(n&&(k.id=n),w&&(k.title=w),p&&(k.width=p),m&&(k.height=m),t&&(k.fetchpriority="high"),s)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{alt:k.alt,...k}),t&&(0,r.jsx)(c(),{children:(0,r.jsx)("link",{rel:"preload",as:"image",href:o(s,b),fetchpriority:"high"})})]}):null}let o=(e,t)=>{var n,r;if(!e)return null;let a=(null==(r=window)||null==(n=r.screen)?void 0:n.width)||t,s=Number(t),c=Number.isFinite(s)&&s>0?Math.min(a,s):a;return c?e.replace(/width=\d+/,"width=".concat(c)).replace(/w=\d+/,"w=".concat(c)):e}},8966:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});
1var r=n(37876),a=n(14232),s=n(89099),c=n(5581),i=n(22507);let l=e=>{let{target:t}=e,[n,s]=(0,a.useState)({count:0,type:{like:0,mention:0,reply:0,repost:0}}),c=async e=>{let t=await fetch("https://webmention.io/api/count.json?target=".concat(encodeURIComponent(e)));return t.json?await t.json():t};return(0,a.useEffect)(()=>{!async function(){s(await c(t))}()},[t]),(0,r.jsx)("div",{className:"webmention-counts",children:n?(0,r.jsxs)("div",{className:"counts",children:[(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"count",children:n.type.like||0}),"Likes"]}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"count",children:n.type.reply||0}),"Replies"]}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"count",children:(n.type.repost||0)+(n.type.mention||0)}),"Mentions"]})]}):(0,r.jsx)("p",{children:"Failed to fetch Webmention counts"})})},o=e=>{let{author:t}=e;return(0,r.jsx)("a",{className:"avatar-wrapper",href:t.url,children:(0,r.jsx)(c.A,{className:"avatar",src:t.photo,alt:t.name,width:48,height:48,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"})},t.name)},h=e=>{let{target:t}=e,[n,s]=(0,a.useState)([]),c=async e=>fetch("https://webmention.io/api/mentions.jf2?per-page=500&target=".concat(encodeURIComponent(e),"&token=").concat((0,i.CQ)("COMMENT_WEBMENTION_TOKEN"))).then(e=>e.json?e.json():e);(0,a.useEffect)(()=>{!async function(){let e=await c(t);e.children&&s(e.children)}()},[t]);let l=[...new Map(n.map(e=>[e.author.url,e])).values()].sort((e,t)=>new Date(e["wm-received"])-new Date(t["wm-received"])),h=n.filter(e=>"in-reply-to"in e&&"content"in e);return(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{children:l.length>0?"Already ".concat(l.length," people liked, shared or talked about this article:"):"Be the first one to share this article!"}),(0,r.jsx)("div",{className:"webmention-avatars",children:l.map(e=>(0,r.jsx)(o,{author:e.author},e.author.name))}),h&&h.length?(0,r.jsxs)("div",{className:"webmention-replies",children:[(0,r.jsx)("h4",{children:"Replies"}),(0,r.jsx)("ul",{className:"replies",children:h.map(e=>(0,r.jsxs)("li",{className:"reply",children:[(0,r.jsx)("div",{children:(0,r.jsx)(o,{author:e.author},e.author.name)}),(0,r.jsxs)("div",{className:"text",children:[(0,r.jsx)("p",{className:"reply-author-name",children:e.author.name}),(0,r.jsx)("p",{className:"reply-content",children:e.content.text})]})]},e.content.text))})]}):null]})},d=e=>{let{frontMatter:t}=e,n=(0,s.useRouter)(),a="https://".concat((0,i.CQ)("COMMENT_WEBMENTION_HOSTNAME")).concat(n.asPath),c="".concat(t.title," by @").concat((0,i.CQ)("COMMENT_WEBMENTION_TWITTER_USERNAME")," ").concat(a);return(0,r.jsxs)("div",{className:"webmention-block",children:[(0,r.jsxs)("h1",{className:"webmention-header",children:["powered by ",(0,r.jsx)("a",{href:"https://webmention.io",target:"_blank",rel:"noreferrer",children:"WebMention.io"})]}),(0,r.jsxs)("div",{className:"webmention-block-intro",children:["You can"," ",(0,r.jsx)("a",{target:"_blank",id:"tweet-post-url",href:"https://twitter.com/intent/tweet?text=".concat(encodeURIComponent(c)),rel:"noopener noreferrer",children:"tweet this post"})," ","or"," ",(0,r.jsx)("a",{target:"_blank",id:"tweet-discuss-url",href:"https://www.twitter.com/search?q=".concat(a),rel:"noopener noreferrer",children:"discuss it on Twitter"}),", the comments will show up here."]}),(0,r.jsxs)("div",{className:"webmention-info",children:[(0,r.jsx)(l,{target:a}),(0,r.jsx)(h,{target:a})]})]})}}}]);
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.