1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{219:(e,a,r)=>{"use strict";r.d(a,{H4:()=>y,_V:()=>w,bL:()=>N});var t=r(12115),s=r(95155),l=r(70222),n=r(4129),i=r(97602),o=r(14806);function d(){return()=>{}}var c="Avatar",[u,m]=function(e,a=[]){let r=[],l=()=>{let a=r.map(e=>t.createContext(e));return function(r){let s=r?.[e]||a;return t.useMemo(()=>({[`__scope${e}`]:{...r,[e]:s}}),[r,s])}};return l.scopeName=e,[function(a,l){let n=t.createContext(l);n.displayName=a+"Context";let i=r.length;r=[...r,l];let o=a=>{let{scope:r,children:l,...o}=a,d=r?.[e]?.[i]||n,c=t.useMemo(()=>o,Object.values(o));return(0,s.jsx)(d.Provider,{value:c,children:l})};return o.displayName=a+"Provider",[o,function(r,s){let o=s?.[e]?.[i]||n,d=t.useContext(o);if(d)return d;if(void 0!==l)return l;throw Error(`\`${r}\` must be used within \`${a}\``)}]},function(...e){let a=e[0];if(1===e.length)return a;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let s=r.reduce((a,{useScope:r,scopeName:t})=>{let s=r(e)[`__scope${t}`];return{...a,...s}},{});return t.useMemo(()=>({[`__scope${a.scopeName}`]:s}),[s])}};return r.scopeName=a.scopeName,r}(l,...a)]}(c),[f,h]=u(c),x=t.forwardRef((e,a)=>{let{__scopeAvatar:r,...l}=e,[n,o]=t.useState("idle");return(0,s.jsx)(f,{scope:r,imageLoadingStatus:n,onImageLoadingStatusChange:o,children:(0,s.jsx)(i.sG.span,{...l,ref:a})})});x.displayName=c;var b="AvatarImage",p=t.forwardRef((e,a)=>{let{__scopeAvatar:r,src:c,onLoadingStatusChange:u=()=>{},...m}=e,f=h(b,r),x=function(e,a){let{referrerPolicy:r,crossOrigin:s}=a,l=(0,o.useSyncExternalStore)(d,()=>!0,()=>!1),i=t.useRef(null),c=l?(i.current||(i.current=new window.Image),i.current):null,[u,m]=t.useState(()=>j(c,e));return(0,n.N)(()=>{m(j(c,e))},[c,e]),(0,n.N)(()=>{let e=e=>()=>{m(e)};if(!c)return;let a=e("loaded"),t=e("error");return c.addEventListener("load",a),c.addEventListener("error",t),r&&(c.referrerPolicy=r),"string"==typeof s&&(c.crossOrigin=s),()=>{c.removeEventListener("load",a),c.removeEventListener("error",t)}},[c,s,r]),u}(c,m),p=(0,l.c)(e=>{u(e),f.onImageLoadingStatusChange(e)});return(0,n.N)(()=>{"idle"!==x&&p(x)},[x,p]),"loaded"===x?(0,s.jsx)(i.sG.img,{...m,ref:a,src:c}):null});p.displayName=b;var g="AvatarFallback",v=t.forwardRef((e,a)=>{let{__scopeAvatar:r,delayMs:l,...n}=e,o=h(g,r),[d,c]=t.useState(void 0===l);return t.useEffect(()=>{if(void 0!==l){let e=window.setTimeout(()=>c(!0),l);return()=>window.clearTimeout(e)}},[l]),d&&"loaded"!==o.imageLoadingStatus?(0,s.jsx)(i.sG.span,{...n,ref:a}):null});function j(e,a){return e?a?(e.src!==a&&(e.src=a),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}v.displayName=g;var N=x,w=p,y=v},14806:(e,a,r)=>{"use strict";e.exports=r(30125)},30125:(e,a,r)=>{"use strict";var t=r(12115),s="function"==typeof Object.is?Object.is:function(e,a){return e===a&&(0!==e||1/e==1/a)||e!=e&&a!=a},l=t.useState,n=t.useEffect,i=t.useLayoutEffect,o=t.useDebugValue;function d(e){var a=e.getSnapshot;e=e.value;try{var r=a();return!s(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,a){return a()}:function(e,a){var r=a(),t=l({inst:{value:r,getSnapshot:a}}),s=t[0].inst,c=t[1];return i(function(){s.value=r,s.getSnapshot=a,d(s)&&c({inst:s})},[e,r,a]),n(function(){return d(s)&&c({inst:s}),e(function(){d(s)&&c({inst:s})})},[e]),o(r),r};a.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:c},33884:(e,a,r)=>{"use strict";r.r(a),r.d(a,{Avatar:()=>i,AvatarFallback:()=>d,AvatarImage:()=>o});var t=r(95155),s=r(12115),l=r(219),n=r(25016);let i=s.forwardRef((e,a)=>{let{className:r,...s}=e;return(0,t.jsx)(l.bL,{ref:a,className:(0,n.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",r),...s})});i.displayName=l.bL.displayName;let o=s.forwardRef((e,a)=>{let{className:r,...s}=e;return(0,t.jsx)(l._V,{ref:a,className:(0,n.cn)("aspect-square h-full w-full",r),...s})});o.displayName=l._V.displayName;let d=s.forwardRef((e,a)=>{let{className:r,...s}=e;return(0,t.jsx)(l.H4,{ref:a,className:(0,n.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted",r),...s})});d.displayName=l.H4.displayName},57254:(e,a,r)=>{"use strict";r.d(a,{PostsList:()=>u});var t=r(95155),s=r(12115),l=r(20730),n=r(25016),i=r(83209),o=r(33884),d=r(84436);function c(e){let{heading:a,aboutHtml:r,totalPostsCount:s,avatarUrl:l,avatarFallback:c="B",socialLinks:u=[],className:m,isTeam:f=!1,showHashnodeIcon:h=!1,isHashnodeSubdomain:x=!1}=e,b=u.length>0,p=f?[]:u.filter(e=>{let{key:a}=e;return"github"===a||"linkedin"===a}),g=u.filter(e=>{let{key:a}=e;return!!f||"github"!==a&&"linkedin"!==a}),v=x?"noopener noreferrer nofollow ugc":"noopener";return(0,t.jsx)(i.Zp,{className:(0,n.cn)("p-5 flex flex-col",m),children:(0,t.jsxs)("div",{className:"flex flex-col items-center text-center gap-5",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[h&&!l?(0,t.jsx)("div",{className:"flex h-16 w-16 shrink-0 items-center justify-center rounded-full bg-muted",children:(0,t.jsx)("i",{className:"text-2xl fa-brands fa-hashnode text-foreground","aria-hidden":!0})}):(0,t.jsxs)(o.Avatar,{className:"h-16 w-16 shrink-0",children:[(0,t.jsx)(o.AvatarImage,{src:l?(0,d.y)(l,{}):void 0,alt:"Publication avatar"}),(0,t.jsx)(o.AvatarFallback,{className:"bg-muted text-muted-foreground font-medium text-lg",children:c})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[a&&(0,t.jsx)("p",{className:"text-base font-semibold text-foreground leading-tight",children:a}),"number"==typeof s&&s>0&&(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[s," posts"]})]})]}
1),r?(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-xs mx-auto text-muted-foreground",dangerouslySetInnerHTML:{__html:(0,n.hr)(r||"",x)}}):null,b&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[p.map(e=>{let{key:a,label:r,iconClass:s,href:l}=e;return(0,t.jsxs)("a",{href:l,target:"_blank",rel:v,className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground","aria-label":"github"===a?"GitHub":"Connect on LinkedIn",children:[(0,t.jsx)("i",{className:s,"aria-hidden":!0}),"github"===a?"GitHub":"LinkedIn"]},r)}),g.map(e=>{let{label:a,iconClass:r,href:s}=e;return(0,t.jsx)("a",{href:s,target:"_blank",rel:v,className:"text-muted-foreground transition-colors hover:text-foreground","aria-label":a,children:(0,t.jsx)("i",{className:r,"aria-hidden":!0})},a)})]})]})})}function u(e){var a,r,i,o,d,u;let{initialPosts:m,initialCursor:f,initialHasNextPage:h,pinnedPostId:x=null,aboutHtml:b=null,links:p=null,aboutAvatarUrl:g=null,aboutAvatarFallback:v="B",totalPostsCount:j=null,aboutHeading:N=null,publication:w,isTeam:y=!1,showHashnodeIcon:k=!1,layout:S=null,isHashnodeSubdomain:O=!1}=e,C=null==(d=null==w||null==(r=w.features)||null==(a=r.readTime)?void 0:a.isEnabled)||d,A=null==(u=null==w||null==(o=w.features)||null==(i=o.viewCount)?void 0:i.isEnabled)||u,E=s.useId(),L=s.useId(),_=e=>{let a=new Set;return e.filter(e=>!a.has(e.id)&&(a.add(e.id),!0))},[I,P]=s.useState(()=>_(m)),[T,R]=s.useState(f),[H,F]=s.useState(h),[V,z]=s.useState(!1),M=async()=>{if(H&&!V){z(!0);try{var e;let a=await fetch("/api/posts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cursor:T})});if(!a.ok)throw Error("Failed to load posts");let r=await a.json();P(e=>{var a;return _([...e,...null!=(a=r.posts)?a:[]])}),R(null!=(e=r.endCursor)?e:null),F(!!r.hasNextPage)}catch(e){console.error("Error loading more posts",e)}finally{z(!1)}}},G=[{key:"twitter",label:"Twitter",iconClass:"fa-brands fa-x-twitter"},{key:"instagram",label:"Instagram",iconClass:"fa-brands fa-instagram"},{key:"github",label:"GitHub",iconClass:"fa-brands fa-github"},{key:"linkedin",label:"LinkedIn",iconClass:"fa-brands fa-linkedin"},{key:"youtube",label:"YouTube",iconClass:"fa-brands fa-youtube"},{key:"facebook",label:"Facebook",iconClass:"fa-brands fa-facebook"},{key:"website",label:"Website",iconClass:"fa-jelly fa-globe"},{key:"hashnode",label:"Hashnode",iconClass:"fa-brands fa-hashnode"},{key:"mastodon",label:"Mastodon",iconClass:"fa-brands fa-mastodon"},{key:"bluesky",label:"Bluesky",iconClass:"fa-brands fa-bluesky"}].map(e=>{let a,{key:r,label:t,iconClass:s}=e,l=null==p?void 0:p[r];return l?{key:r,label:t,iconClass:s,href:(a=String(l),/^https?:\/\//i.test(a)?a:"https://".concat(a))}:null}).filter(Boolean),$=!!(N||b||G.length>0),q=0===I.length,B=$&&(0,t.jsx)(c,{heading:N,aboutHtml:b,totalPostsCount:j,avatarUrl:g||void 0,avatarFallback:v,socialLinks:G,isTeam:y,showHashnodeIcon:k,isHashnodeSubdomain:O},"about-card"),W="magazine"===S?"magazine":"grid"===S?"grid":"stacked",D=()=>(0,t.jsx)("div",{className:"min-h-[140px] md:min-h-40 lg:min-h-[180px] flex-1 bg-muted"});return(0,t.jsxs)("section",{"aria-labelledby":E,className:"flex flex-col gap-8",children:[(0,t.jsx)("h2",{id:E,className:"sr-only",children:"Latest articles"}),q&&(0,t.jsxs)("div",{className:"rounded-3xl border border-border bg-muted px-6 py-10 text-center sm:px-10",children:[(0,t.jsx)("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full border border-border bg-background text-lg",children:(0,t.jsx)("i",{className:"fa-regular fa-pen-to-square text-muted-foreground","aria-hidden":!0})}),(0,t.jsx)("h3",{className:"mt-4 text-xl font-semibold text-foreground",children:"I haven't started writing yet."}),(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"I'm still brewing the first story. When the ink dries, it'll land right here."})]}),(I.length>0||b)&&(0,t.jsxs)(t.Fragment,{children:["stacked"===W&&(0,t.jsx)("ol",{id:L,className:"flex flex-col gap-5 list-none p-0","aria-busy":V,children:(()=>{let e=[],a=b?2*(I.length>=2):null,r=!1;return I.forEach((s,n)=>{B&&null!==a&&n===a&&(e.push((0,t.jsx)("li",{className:"list-none",children:(0,t.jsx)("aside",{"aria-label":y?"About the publication":"About the author",children:B})},"about-card")),r=!0),e.push((0,t.jsx)("li",{className:"list-none",children:(0,t.jsx)(l.default,{post:s,isPinned:x===s.id,className:"h-full",variant:"stacked",showReadTime:C,showViews:A})},s.id))}),B&&!r&&e.splice(null!=a?a:0,0,(0,t.jsx)("li",{className:"list-none",children:(0,t.jsx)("aside",{"aria-label":y?"About the publication":"About the author",children:B})},"about-card")),e})()}),"magazine"===W&&(()=>{if(0===I.length)return null;let e=I[0],a=I.slice(1,3),r=I.slice(3,5),s=I.slice(5),i=Math.max(0,2-a.length),o=Math.max(0,2-r.length);return(0,t.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,t.jsx)("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4",children:[(0,t.jsxs)("div",{className:"order-2 md:order-2 lg:order-1 md:col-span-1 flex flex-col divide-y divide-border md:border-t lg:border-t-0 lg:border-r border-border",children:[a.map(e=>
1(0,t.jsx)("div",{className:"min-h-[140px] md:min-h-40 lg:min-h-[180px] flex-1",children:(0,t.jsx)(l.default,{post:e,isPinned:x===e.id,variant:"magazine-secondary",showReadTime:C,showViews:A})},e.id)),Array.from({length:i}).map((e,a)=>(0,t.jsx)(D,{},"left-placeholder-".concat(a)))]}),(0,t.jsx)("div",{className:"order-1 md:col-span-2 lg:col-span-2 border-b md:border-b-0 border-border",children:(0,t.jsx)(l.default,{post:e,isPinned:x===e.id,variant:"magazine-featured",showReadTime:C,showViews:A})}),(0,t.jsxs)("div",{className:"order-3 md:col-span-1 flex flex-col divide-y divide-border border-t lg:border-t-0 lg:border-l border-border",children:[r.map(e=>(0,t.jsx)("div",{className:"min-h-[140px] md:min-h-40 lg:min-h-[180px] flex-1",children:(0,t.jsx)(l.default,{post:e,isPinned:x===e.id,variant:"magazine-secondary",showReadTime:C,showViews:A})},e.id)),Array.from({length:o}).map((e,a)=>(0,t.jsx)(D,{},"right-placeholder-".concat(a)))]})]})}),B&&(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 items-stretch",children:(0,t.jsx)("aside",{"aria-label":y?"About the publication":"About the author",className:"h-full *:h-full",children:B})}),s.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-6",children:Array.from({length:Math.ceil(s.length/3)}).map((e,a)=>{let r=s.slice(3*a,3*a+3),i=r.length;return(0,t.jsx)("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3",children:r.map((e,a)=>(0,t.jsx)("div",{className:(0,n.cn)(a>0&&"border-t md:border-t-0",1===a&&i>=2&&"md:border-l lg:border-l divide-border",2===a&&"md:col-span-2 md:border-t lg:col-span-1 lg:border-t-0 lg:border-l",1===i&&"md:col-span-2 lg:col-span-1",2===i&&1===a&&"lg:border-l","border-border"),children:(0,t.jsx)(l.default,{post:e,isPinned:x===e.id,variant:"magazine-grid",showReadTime:C,showViews:A})},e.id))})},"row-".concat(a))})})]})})(),"grid"===W&&(0===I.length?null:(0,t.jsx)("div",{className:"flex flex-col gap-5",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[I.map((e,a)=>(0,t.jsxs)(s.Fragment,{children:[B&&4===a&&(0,t.jsx)("div",{className:"md:col-span-2",children:(0,t.jsx)("aside",{"aria-label":y?"About the publication":"About the author",children:B})}),(0,t.jsx)(l.default,{post:e,isPinned:x===e.id,variant:"grid",showReadTime:C,showViews:A})]},e.id)),B&&I.length<4&&I.length>0&&(0,t.jsx)("div",{className:"md:col-span-2",children:(0,t.jsx)("aside",{"aria-label":y?"About the publication":"About the author",children:B})})]})}))]}),H&&(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)("button",{type:"button",className:"group flex items-center gap-2 rounded-lg px-5 py-2.5 text-sm font-medium text-muted-foreground transition hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-50",onClick:()=>void M(),disabled:V,"aria-controls":L,"aria-label":V?"Loading more posts":"Load more posts",children:V?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("i",{className:"fa-jelly fa-arrows-rotate animate-spin text-sm","aria-hidden":!0}),(0,t.jsx)("span",{"aria-live":"polite",children:"Loading..."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-live":"polite",children:"Load more posts"}),(0,t.jsx)("i",{className:"fa-regular fa-arrow-down text-sm transition-transform group-hover:translate-y-0.5","aria-hidden":!0})]})})})]})}},63222:(e,a,r)=>{Promise.resolve().then(r.bind(r,652)),Promise.resolve().then(r.bind(r,57254)),Promise.resolve().then(r.t.bind(r,52619,23))},84436:(e,a,r)=>{"use strict";r.d(a,{y:()=>s});let t="".concat("https://cdn.hashnode.com/res/hashnode/image/upload/v1707121372242/57c3ede2-19a1-4530-beec-fae5db66c6a2.png?auto=compress",",format&format=webp"),s=(e,a,r)=>{if(!e)return r;{if("?sz=200"===e)return t;let r=e.replace("hashnode.imgix.net","cdn.hashnode.com");if(-1!==e.indexOf("//res.cloudinary.com/hashnode")&&-1!==e.indexOf("/upload/")){let a=e.split("/upload/"),t=a[1].substring(a[1].lastIndexOf(".")+1);if(-1!==a[1].indexOf("ama_banners")){let e=a[1].substring(1,a[1].indexOf("/")),s=a[1].substring(a[1].indexOf("/")+1,a[1].lastIndexOf("."));r="".concat(a[0],"/upload/").concat(s,"/").concat(e,".").concat(t,"?auto=compress,format&format=webp")}else{let e=a[1].split("/");0===e[0].indexOf("v")&&(e[0]=e[0].substring(1)),r="".concat(a[0],"/upload/").concat(e[1].substring(0,e[1].lastIndexOf(".")),"/").concat(e[0],".").concat(t,"?auto=compress,format&format=webp")}r=r.replace("//res.cloudinary.com","//cdn.hashnode.com/res").replace("http://","https://")}else if(-1!==e.indexOf("//cdn.hashnode.com")&&-1!==e.indexOf("/upload/")){let a=e.split("/upload/"),t=/^[^/]+\/\d+\.\w+($|\?)/.test(a[1]);0===a[1].indexOf("v")||t||(r="".concat(a[0],"/upload/").concat(a[1].substring(a[1].indexOf("/")+1)))}if(-1===r.indexOf("//cdn.hashnode.com"))return r;let s="";
1if(Object.keys(a).forEach(e=>{"w"===e||"h"===e||"mask"===e||"corner-radius"===e?s+="".concat(e,"=").concat(a[e],"&"):"fill"===e?s+="fit=fill&fill=".concat(a[e],"&"):"c"===e&&(s+="fit=crop&crop=".concat("face"===a[e]?"faces":"entropy","&"))}),"none"===a.q)return"".concat(r,"?").concat(s);if(-1!==r.indexOf("?")){let e=r.split("?");r=e[0],s+="&"!==e[1].slice(-1)?"".concat(e[1],"&"):e[1]}return s?s+=-1!==e.indexOf(".gif")?"auto=format,compress&gif-q=60&format=webm":"auto=compress,format&format=webp":s=-1!==e.indexOf(".gif")?"auto=format,compress&gif-q=60&format=webm":"auto=compress,format&format=webp","".concat(r,"?").concat(s)}}}},e=>{e.O(0,[4554,7563,5001,2423,9216,3091,652,730,8441,8229,1255,7358],()=>e(e.s=63222)),_N_E=e.O()}]);
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.