1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44],{34401:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/community",function(){return n(93748)}])},44510:function(t,e,n){"use strict";var s=n(67294),o=n(11163);e.Z=function(t){let{community:e,filter:n,refreshTrigger:i=null}=t,l=(0,o.useRouter)(),[a,r]=(0,s.useState)([]),[c,u]=(0,s.useState)(!1),[m,p]=(0,s.useState)(1);return(0,s.useEffect)(()=>{async function getCommunityPosts(){let t="".concat(e,"-").concat(n.internalName,"-").concat(i),s=JSON.parse(sessionStorage.getItem(t));if((null==s?void 0:s.posts)||(s={}),s.posts)r(null==s?void 0:s.posts),p(null==s?void 0:s.currentPage),(null==s?void 0:s.posts.length)===0&&u(!0);else{let o=n.api,i=await fetch(o),l=await i.json(),a=l.posts;s={posts:[...a],currentPage:"leaderboards"===e?null==l?void 0:l.lastUserId:1},sessionStorage.setItem(t,JSON.stringify({...s})),r(a),p(1),0===a.length&&u(!0)}}r([]),getCommunityPosts()},[e,null==n?void 0:n.api,null==n?void 0:n.internalName,i]),(0,s.useEffect)(()=>{function logScrollPosition(){let t="".concat(e,"-").concat(n.internalName,"-").concat(i,"-scroll");0!=window.scrollY&&sessionStorage.setItem(t,JSON.stringify(window.scrollY))}return window.addEventListener("scroll",logScrollPosition),()=>{window.removeEventListener("scroll",logScrollPosition)}},[l.asPath,e,n.internalName,i]),{posts:a,noMorePosts:c,currentPage:m}}},15972:function(t,e,n){"use strict";var s=n(82729),o=n(85893),i=n(19521),l=n(9473),a=n(609),r=n(67294),c=n(58533),u=n(25670),m=n(54456),p=n(67788),f=n(86121),d=n(27012),g=n(83330),h=n(96229);function _templateObject(){let t=(0,s._)(["\n width: 100%;\n max-width: 700px;\n\n .fake-channel-composer {\n margin-bottom: 8px;\n }\n\n .channel-posts {\n margin-top: 12px;\n display: flex;\n flex-direction: column;\n overflow: visible !important;\n }\n\n .community-feed-filters {\n .about {\n display: inline;\n\n "," {\n display: none;\n }\n }\n }\n"]);return _templateObject=function(){return t},t}let y=i.default.div.withConfig({componentId:"sc-6f0f431f-0"})(_templateObject(),t=>{let{theme:e}=t;return e.breakpoints.sm});e.Z=function(t){let{posts:e,setAllPosts:n,filters:s,currentFilter:i,setCurrentFilter:w,savedCurrentPage:x=1,noMorePosts:S=!1,community:N,disableComposer:j=!1,headerType:v="without-channel",pinPost:b=!1,refreshTrigger:P=null,sideBar:_=null}=t,Z=(0,l.v9)(a.f8),[O,E]=(0,r.useState)(x),[F,T]=(0,r.useState)(!0);(0,r.useEffect)(()=>{S&&T(!1)},[e,S]);let C=(0,r.useCallback)(async()=>{try{let t=s[i],e="".concat(N,"-").concat(t.internalName,"-").concat(P),o=JSON.parse(sessionStorage.getItem(e)),l=o.currentPage+1,a="".concat(t.api,"&page=").concat(l),r=await fetch(a),c=await r.json(),u=c.posts;0!=u.length&&(E(l),n(t=>[...t,...u]),o={posts:[...o.posts,...u],currentPage:l},sessionStorage.setItem(e,JSON.stringify({...o}))),0===u.length&&T(!1)}catch(t){console.error("Error fetching more posts:",t),T(!1)}},[s,i,N,P,n]);return(0,o.jsxs)(y,{children:[(0,o.jsx)(p.Z,{community:N}),(0,o.jsx)(g.Z,{community:N}),!j&&(0,o.jsx)(d.Z,{community:N}),(0,o.jsx)(f.Z,{filters:s,currentFilter:i,setCurrentFilter:w}),"about"!=i&&(0,o.jsxs)(c.Z,{className:"channel-posts",dataLength:e.length,next:C,hasMore:!0!=S,scrollThreshold:.5,loader:(0,o.jsx)(o.Fragment,{}),children:[null==e?void 0:e.map((t,e)=>(0,o.jsx)(m.Z,{post:t,uid:Z,headerType:v,pinned:0===e&&(null==t?void 0:t.communityName)=="monthly-challenge"&&b,inFeed:"home",forFeed:!0},null==t?void 0:t.postId)),S&&(0,o.jsx)("div",{style:{margin:"2rem 0rem"},children:(0,o.jsx)(h.Z,{mainText:"No posts yet"})}),!S&&0===e.length&&(0,o.jsx)(u.Z,{})]}),"about"==i&&_]})}},93748:function(t,e,n){"use strict";n.r(e),n.d(e,{__N_SSG:function(){return g}});var s=n(85893),o=n(67294),i=n(99428),l=n(82077),a=n(44510),r=n(609),c=n(9473),u=n(74796),m=n(52861),p=n(1198),f=n(15972),d=n(51382),g=!0;e.default=function(t){let{news:e,events:n,visitorCount:g}=t,h=(0,c.v9)(r.f8),y="home";(0,o.useEffect)(()=>{(0,d.P)({uid:h,community:y})},[h]);let[w,x]=(0,o.useState)([]),S=(0,o.useCallback)(async()=>{let t=JSON.parse(sessionStorage.getItem("userFollowing"));if(t){x(t);return}let e=await fetch("/api/community/getFollowing",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:h})}),n=await e.json();sessionStorage.setItem("userFollowing",JSON.stringify(n.userFollowing)),x(n.userFollowing)},[h]);(0,o.useEffect)(()=>{h&&S()},[h,S]);let N=(0,o.useMemo)(()=>({"top-posts":{api:"/api/community/getTrendingPosts?",displayText:"Top Posts",internalName:"top-posts"},newest:{api:"/api/community/getLatestPosts?",displayText:"Newest",internalName:"newest"},following:{api:"/api/community/getFollowingPosts?followingList=".concat(JSON.stringify(w)),displayText:"Following",internalName:"following",disableOnLogout:!0},about:{displayText:"About",internalName:"about"}}),[w]),[j,v]=(0,o.useState)("top-posts"),{posts:b,noMorePosts:P,currentPage:_}=(0,a.Z)({community:y,filter:N[j]}),[Z,O]=(0,o.useState)(b);(0,o.useEffect)(()=>{O(b)},[b]);let E={news:e,events:n,community:y,visitorCount:g,postCount:0,channel:y},F=(0,s.jsx)(p.Z,{...E,forMobile:!0}),T=(0,s.jsx)(p.Z,{...E,forMobile:!1});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Z,{learningEnv:"community"}),(0,s.jsxs)(u.Z,{children:[(0,s.jsx)(l.Z,{}),(0,s.jsxs)(m.Z,{children:[(0,s.jsx)(f.Z,{posts:Z,setAllPosts:O,filters:N,currentFilter:j,setCurrentFilter:v,savedCurrentPage:_,community:y,disableComposer:!0,headerType:"with-channel",sideBar:F}),T]})]})]})}}},function(t){t.O(0,[1272,8700,1057,3777,5937,7603,4090,4153,1622,9280,286,6095,8849,2512,719,9428,2163,6207,5884,4561,8325,5388,4456,1024,8866,9774,2888,179],function(){return t(t.s=34401)}),_N_E=t.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.