1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7405],{15247:function(n,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/outdated-community",function(){return t(11094)}])},2267:function(n,e,t){"use strict";t.d(e,{Z:function(){return community_OpcVideoPlayer}});var o=t(82729),i=t(85893),r=t(19521),a=t(67294),s=t(79352),l=t(42708);function _templateObject(){let n=(0,o._)(["\n border-radius: 8px;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n\n .backdrop {\n width: 100%;\n height: 100%;\n background: rgba(255, 255, 255, 0.3);\n backdrop-filter: blur(15px);\n position: relative;\n\n display: flex;\n justify-content: center;\n\n video {\n height: fit-content;\n max-height: 700px;\n width: 100%;\n }\n\n /* bottom gap keeps the native control bar clickable */\n .click-catcher {\n position: absolute;\n inset: 0 0 48px 0;\n }\n }\n"]);return _templateObject=function(){return n},n}let c=r.default.div.withConfig({componentId:"sc-adeec30e-0"})(_templateObject());var post_VerticalVideo=function(n){let{files:e}=n,[t,o]=(0,l.YD)({threshold:.25}),r=(0,a.useRef)(null);return(0,a.useEffect)(()=>{r.current&&(o?r.current.play().catch(n=>{console.error("Error trying to play the video:",n)}):r.current.pause())},[o]),(0,i.jsx)(c,{ref:t,style:{backgroundImage:"url(".concat((null==e?void 0:e.thumbNailUrl)||(null==e?void 0:e.backgroundImageUrl),")")},children:(0,i.jsxs)("div",{className:"backdrop",children:[(0,i.jsx)("video",{ref:r,src:null==e?void 0:e.videoUrl,controls:!0,autoPlay:o,playsInline:!0,muted:!0}),(0,i.jsx)("div",{className:"click-catcher",onClick:function(){let n=r.current;n&&(n.muted?(n.muted=!1,n.paused&&n.play().catch(()=>{})):n.paused?n.play().catch(()=>{}):n.pause())}})]})})};function OpcVideoPlayer_templateObject(){let n=(0,o._)(["\n width: 100%;\n border-radius: 8px;\n overflow: hidden;\n margin-bottom: 1rem;\n ","\n max-height: 700px; // fallback for ancient browsers\n\n :hover {\n .play-button {\n opacity: 0;\n }\n }\n\n\n .thumbnail-container,\n .video-container {\n height: 100%;\n width: 100%;\n position: relative;\n\n img,\n video {\n height: 100%;\n width: 100%;\n object-fit: contain;\n }\n\n .play-button {\n transition: opacity 0.2s;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n /* bottom gap keeps the native control bar clickable */\n .click-catcher {\n position: absolute;\n inset: 0 0 48px 0;\n }\n }\n"]);return OpcVideoPlayer_templateObject=function(){return n},n}let d=r.default.div.withConfig({componentId:"sc-efd7152e-0"})(OpcVideoPlayer_templateObject(),n=>{let{aspectRatio:e}=n;return"aspect-ratio: ".concat(e||"16 / 9",";")});var community_OpcVideoPlayer=function(n){var e,t;let{videoFiles:o,disableAutoPlayOnView:r=!0,preload:c="none"}=n,m=(0,a.useRef)(null),u=(0,a.useRef)(!1),[p,h]=(0,a.useState)(!1),[g,f]=(0,l.YD)({threshold:.25}),[b,x]=(0,a.useState)(!1),w=o&&o[0],v=null==w?void 0:null===(e=w.videoDimensions)||void 0===e?void 0:e.height,y=null==w?void 0:null===(t=w.videoDimensions)||void 0===t?void 0:t.width,j=!!(y&&v),k=!!j&&y/v<1,N=j?"".concat(y," / ").concat(v):"16 / 9",A=(null==w?void 0:w.thumbNailUrl)||(null==w?void 0:w.backgroundImageUrl);function handleVideoClick(){let n=m.current;n&&(u.current=!0,x(!0),n.muted?(n.muted=!1,n.paused&&n.play().catch(()=>{})):n.paused?n.play().catch(()=>{}):n.pause())}(0,a.useEffect)(()=>{if(m.current){if(!f){m.current.pause();return}r||(u.current||(m.current.muted=!0),m.current.play().catch(()=>{}))}},[f,r]),(0,a.useEffect)(()=>{r||x(f)},[f,r]);let F={thumbnail:(0,i.jsxs)(i.Fragment,{children:[!b&&(0,i.jsxs)("div",{className:"thumbnail-container",onClick:function(){u.current=!0,x(!0),requestAnimationFrame(()=>{m.current&&(m.current.muted=!1,m.current.play().catch(()=>{}))})},onMouseEnter:()=>h(!0),children:[(0,i.jsx)(s.Xt2,{color:"#F1F5F9",className:"play-button",size:50}),(0,i.jsx)("img",{src:A,alt:"video thumbnail"})]}),b&&(0,i.jsxs)("div",{className:"video-container",onMouseEnter:()=>h(!0),children:[(0,i.jsx)("video",{ref:m,src:null==w?void 0:w.videoUrl,controls:p,muted:!0,poster:A,playsInl
1ine:!0,preload:c}),(0,i.jsx)("div",{className:"click-catcher",onClick:handleVideoClick})]})]}),"no-thumbnail":(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"video-container",onMouseEnter:()=>h(!0),children:[!b&&(0,i.jsx)(s.Xt2,{color:"#F1F5F9",className:"play-button",size:50}),(0,i.jsx)("video",{ref:m,src:null==w?void 0:w.videoUrl,controls:p,muted:!0,poster:A,playsInline:!0,preload:c}),(0,i.jsx)("div",{className:"click-catcher",onClick:handleVideoClick})]})})};if((null==o?void 0:o.length)!==0&&o)return(0,i.jsx)(d,{onClick:n=>n.preventDefault(),ref:g,className:"nes-pointer ".concat(k?"vertical":""),aspectRatio:N,children:k?(0,i.jsx)(post_VerticalVideo,{files:w}):(0,i.jsx)(i.Fragment,{children:F[null==A?"no-thumbnail":"thumbnail"]})})}},29195:function(n,e,t){"use strict";var o=t(67294);e.Z=n=>{let[e,t]=(0,o.useState)({width:0,height:0});return(0,o.useEffect)(()=>{(()=>{let e=new Image;e.src=n,e.onload=()=>{t({width:e.width,height:e.height})}})()},[n]),e}},88215:function(n,e,t){"use strict";var o=t(82729),i=t(85893),r=t(19521),a=t(17942);function _templateObject(){let n=(0,o._)(["\n ",' {\n z-index: 1;\n margin: 0rem;\n\n .banner-image {\n height: 60px;\n background-image: url("/images/css/banner-v2.png");\n }\n\n .banner-info {\n position: relative;\n height: 80px;\n /* background: #1d2331; */\n background: ',";\n border-bottom-left-radius: 18px;\n border-bottom-right-radius: 18px;\n display: flex;\n align-items: center;\n\n .img-container {\n position: absolute;\n top: -30%;\n left: 0.8rem;\n border-radius: 50%;\n /* background-color: whitesmoke; */\n overflow: hidden;\n transform: scaleX(-1);\n\n img {\n width: 80px;\n height: 80px;\n border-radius: 50%;\n border: 3px solid rgba(15, 21, 36, 1);\n }\n }\n\n .banner-copy {\n color: ",';\n margin-left: 6.8rem;\n\n h2 {\n font-size: 14px;\n margin: 0px;\n font-weight: 400;\n }\n p {\n margin: 0px;\n font-size: 14px;\n font-family: "Work Sans", sans-serif;\n color: rgba(128, 128, 128, 1);\n }\n }\n }\n }\n\n '," {\n margin: auto 1rem;\n\n .banner-image {\n height: 100px;\n }\n\n .banner-info {\n .img-container {\n left: 35px;\n img {\n width: 90px;\n height: 90px;\n }\n }\n\n .banner-copy {\n margin-left: 9rem;\n\n h2 {\n font-size: 18px;\n }\n p {\n font-size: 15px;\n }\n }\n }\n }\n "," {\n margin: 0rem;\n }\n"]);return _templateObject=function(){return n},n}let s=r.default.div.withConfig({componentId:"sc-561224-0"})(_templateObject(),n=>{let{theme:e}=n;return e.breakpoints.xs},n=>"dark"===n.theme.mode?"#1d2331":"#F9F5FE",n=>"dark"===n.theme.mode?"whitesmoke":"black",n=>{let{theme:e}=n;return e.breakpoints.sm},n=>{let{theme:e}=n;return e.breakpoints.md});e.Z=function(n){let{title:e="Cod\xe9dex Community",subTitle:t="Let's make magic together âËâ¡"}=n;return(0,i.jsxs)(s,{className:"community-banner",children:[(0,i.jsx)("div",{className:"banner-image"}),(0,i.jsxs)("div",{className:"banner-info",children:[(0,i.jsx)("div",{className:"img-container",children:(0,i.jsx)("img",{src:"/images/community/bouncer.gif",alt:"banner profile image"})}),(0,i.jsxs)("div",{className:"banner-copy",children:[(0,i.jsx)("h2",{children:e}),(0,i.jsx)("p",{children:t})]}),(0,i.jsx)(a.Z,{})]})]})}},4705:function(n,e,t){"use strict";var o=t(82729),i=t(85893),r=t(19521),a=t(41664),s=t.n(a),l=t(11163),c=t(9473),d=t(609),m=t(62286),u=t.n(m),p=t(67294),h=t(48645),g=t(73857);function _templateObject(){let n=(0,o._)(["\n "," {\n margin: 1rem auto;\n margin-bottom: 0.5rem;\n border: 2px solid ",";\n\n border-radius: 18px;\n color: ",";\n position: relative;\n\n .post-btn {\n z-index: 0;\n }\n\n .image-text-field {\n display: flex;\n margin: 1rem;\n img {\n width: 40px;\n height: 40px;\n border-radius: 100px;\n background-color: #e4e5e7;\n }\n\n .moc-textarea {\n flex: 1;\n border: 2px solid ",";\n\n border-radius: 7px;\n padding: 0.25rem;\n padding-left: 0.7rem;\n background: ",';\n\n padding-bottom: 0px;\n height: 53px;\n margin-left: 1rem;\n margin-right: 1rem;\n\n p {\n font-family: "Work Sans", sans-serif;\n font-size: 14px;\n color: #aeb3b7;\n }\n\n :hover {\n cursor: text;\n }\n }\n\n .cant-post {\n background-color: ',";
1\n cursor: not-allowed !important;\n opacity: 0.5;\n\n p {\n color: ",";\n }\n }\n }\n\n .button-container {\n margin: -0.5rem 1rem 0.5rem 5rem;\n display: flex;\n justify-content: space-between;\n\n .media-buttons {\n display: flex;\n\n img {\n width: 24px;\n height: 24px;\n /* filter: ",'; */\n }\n\n div {\n display: flex;\n align-items: center;\n align-items: center;\n gap: 0.5rem;\n margin-right: 1rem;\n\n p {\n margin: 0px;\n font-family: "Work Sans", sans-serif;\n font-size: 15px;\n color: #808080;\n }\n }\n }\n button {\n font-size: 12px;\n }\n }\n }\n\n ',' {\n .image-text-field {\n img {\n width: 40px;\n height: 40px;\n border-radius: 100px;\n background-color: #e4e5e7;\n }\n\n .moc-textarea {\n height: 42px;\n padding: 0.5rem;\n\n p {\n font-family: "Work Sans", sans-serif;\n font-size: 15px;\n }\n }\n }\n\n .button-container {\n .media-buttons {\n img {\n width: 20px;\n height: 20px;\n }\n\n div {\n p {\n font-size: 14px;\n }\n }\n }\n button {\n font-size: 9px;\n padding-left: 1rem;\n padding-right: 1rem;\n }\n }\n }\n']);return _templateObject=function(){return n},n}function _templateObject1(){let n=(0,o._)(['\n font-size: 16px;\n font-family: "Work Sans", sans-serif;\n font-weight: 600;\n position: absolute;\n top: 0px;\n right: 0px;\n transform: scale(0.75);\n z-index: 12;\n\n .ribbon {\n width: 82px;\n height: 78px;\n overflow: hidden;\n position: absolute;\n }\n\n .ribbon::before,\n .ribbon::after {\n position: absolute;\n z-index: -1;\n content: "";\n display: block;\n border: 5px solid black;\n }\n\n .ribbon span {\n position: absolute;\n display: block;\n width: 170px;\n background-color: #e6904f;\n text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);\n text-align: center;\n\n a {\n color: black;\n\n &:hover {\n text-decoration: none;\n }\n }\n }\n\n /*For the light theme light boxes*/\n .ribbon-top-right {\n top: -8px;\n right: -10px;\n }\n\n .ribbon-top-right::before,\n .ribbon-top-right::after {\n border-top-color: transparent;\n border-right-color: transparent;\n }\n\n .ribbon-top-right::after {\n bottom: -2px;\n right: 0px;\n }\n\n .ribbon-top-right span {\n left: -30px;\n top: 25px;\n transform: rotate(45deg) translate(-5%, 0);\n }\n']);return _templateObject1=function(){return n},n}let f=r.default.div.withConfig({componentId:"sc-ecd2e0d3-0"})(_templateObject(),n=>{let{theme:e}=n;return e.breakpoints.xs},n=>n.theme.colors.profileBorder,n=>"dark"===n.theme.mode?"whitesmoke":"black",n=>n.theme.colors.profileBorder,n=>"dark"===n.theme.mode?"#1d2332":"#FFFFFF",n=>"dark"===n.theme.mode?"#34373C":"#DADADA",n=>"dark"===n.theme.mode?"#aeb3b7":"#090707",n=>"dark"===n.theme.mode?"":"brightness(0%)",n=>{let{theme:e}=n;return e.breakpoints.sm}),b=r.default.div.withConfig({componentId:"sc-ecd2e0d3-1"})(_templateObject1());e.Z=function(n){let{isSignedIn:e,setShowPostForm:t,postFormLink:o,clubOnly:r,placeholder:a,removeIfLoggedOut:m=!0}=n,x=localStorage.getItem("photoURL")||"",w=(0,l.useRouter)(),v=(0,c.v9)(d.xF),y=(0,c.v9)(d.nU),j=y>=0,k=u().get().codedextoken,[N,A]=(0,p.useState)(!1);if((0,p.useEffect)(()=>{!async function(){await (0,h.uG)()&&A(!0)}()},[]),k||!m)return(0,i.jsxs)(f,{onClick:()=>(function(){if(!v&&r&&!N){e&&w.push("/pricing");return}e&&j&&w.push(o)})(),style:{opacity:e&&j?"1":".6"},children:[!v&&r&&(0,i.jsx)(b,{children:(0,i.jsx)("div",{className:"ribbon ribbon-top-right",children:(0,i.jsx)("span",{children:(0,i.jsx)(s(),{href:"/pricing",children:"Club"})})})}),(0,i.jsxs)("div",{className:"image-text-field",children:[(0,i.jsx)("img",{src:x||"/images/default-profile-pic.jpg",alt:"user phot-",className:"nes-pointer"}),(0,i.jsx)("div",{className:"moc-textarea ".concat((!e||!j)&&"cant-post"),children:(0,i.jsx)("p",{children:e||k?j?a:"You need to reach 100 XP to make a post.":"Sign in to make a post in the community!"})}),(0,i.jsx)(g.Z,{className:"post-btn",disabled:!j,size:"small",children:"Post"})]})]})}},50164:function(n,e,t){"use strict";
1var o=t(82729),i=t(85893),r=t(19521),a=t(67294);function _templateObject(){let n=(0,o._)(["\n border: 2px solid ",";\n\n border-radius: 10px;\n background: ",";\n color: ",';\n font-family: "Work Sans", sans-serif;\n padding: 1rem;\n transition-duration: 0.3s;\n margin: 1rem auto;\n z-index: 9;\n\n /* a {\n all: unset;\n } */\n\n .title {\n display: flex;\n justify-content: space-between;\n font-family: "Work Sans", sans-serif;\n h2 {\n margin: 0px;\n font-size: 16px;\n font-weight: 600;\n }\n\n p {\n margin: 0px;\n font-size: 14px;\n font-weight: 600;\n color: #808080;\n }\n }\n\n p {\n margin: 0px;\n margin-top: 0.5rem;\n font-size: 14px;\n }\n\n &:hover {\n border: 2px solid #379cee;\n transition-duration: 0.3s;\n background: ',";\n }\n"]);return _templateObject=function(){return n},n}let s=r.default.div.withConfig({componentId:"sc-c69982a3-0"})(_templateObject(),n=>n.theme.colors.profileBorder,n=>"dark"===n.theme.mode?"#1d2332":"#FFFFFF",n=>"dark"===n.theme.mode?"rgba(255, 255, 255, 0.87)":"black",n=>"dark"===n.theme.mode?"rgba(237, 231, 225, 0.1)":"rgba(237, 231, 225, 0.4)");e.Z=function(){let[n,e]=(0,a.useState)(!1);return(0,i.jsxs)(s,{onClick:()=>e(!n),className:"nes-pointer",children:[(0,i.jsx)("div",{className:"title",children:(0,i.jsx)("h2",{children:"Community Guidelines"})}),(0,i.jsx)("p",{children:"Read our code of conduct here."})]})}},74774:function(n,e,t){"use strict";var o=t(82729),i=t(85893),r=t(19521),a=t(41664),s=t.n(a),l=t(25935),c=t(67294),d=t(9473),m=t(63750),u=t(8193),p=t(5434),h=t(11163),g=t(72163),f=t(26541),b=t(99063),x=t(83192),w=t(29195),v=t(5802),y=t(609),j=t(63877),k=t(25021),N=t(83482),A=t(85307),F=t(76e3),C=t(2267),S=t(71293);function _templateObject(){let n=(0,o._)(["\n "," {\n border-radius: 0px;\n\n border-bottom: 1px solid\n ",";\n\n background: none;\n color: ",";\n\n .club {\n color: ",";\n }\n\n padding: 1rem 0rem;\n height: fit-content;\n transition-duration: 0.2s;\n position: relative;\n\n :hover {\n transition-duration: 0.2s;\n background: none;\n }\n\n .dropdown-container {\n position: absolute;\n top: 9px;\n right: 9px;\n\n .dropdown-toggle {\n position: relative;\n\n .dropdown {\n right: 0px;\n position: absolute;\n width: 200px;\n height: fit-content;\n background-color: #0f1524;\n background: ",';\n\n border-radius: 7px;\n overflow: hidden;\n z-index: 1;\n\n button {\n all: unset;\n width: 100%;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 10px;\n font-size: 10px;\n font-weight: 600;\n font-size: 15px;\n font-family: "Work Sans", sans-serif;\n\n :hover {\n cursor:\n url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzElEQVRYR+2X0Q6AIAhF5f8/2jYXZkwEjNSVvVUjDpcrGgT7FUkI2D9xRfQETwNIiWO85wfINfQUEyxBG2ArsLwC0jioGt5zFcwF4OYDPi/mBYKm4t0U8ATgRm3ThFoAqkhNgWkA0jJLvaOVSs7j3qMnSgXWBMiWPXe94QqMBMBc1VZIvaTu5u5pQewq0EqNZvIEMCmxAawK0DNkay9QmfFNAJUXfgGgUkLaE7j/h8fnASkxHTz0DGIBMCnBeeM7AArpUd3mz2x3C7wADglA8BcWMZhZAAAAAElFTkSuQmCC)\n 14 0,\n pointer;\n background-color: ',";\n }\n }\n\n .delete {\n color: #e76e55;\n }\n\n .update {\n }\n\n .report:hover {\n /* color: #e7cb02; */\n }\n }\n\n .three-dots {\n border-radius: 50px;\n line-height: 1;\n padding: 0.5rem;\n transition-duration: 0.2s;\n }\n\n .three-dots:hover {\n background-color: ",';\n transition-duration: 0.2s;\n }\n }\n }\n\n .author {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-size: 15px;\n\n p {\n margin: 0px;\n font-family: "Work Sans", sans-serif;\n font-weight: 500;\n }\n\n .author-img-container {\n flex-shrink: 0;\n img {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n transition-duration: 0.2s;\n background-color: #e4e5e7;\n }\n\n img:hover {\n transition-duration: 0.2s;\n opacity: 0.85;\n }\n }\n\n .username-container {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n max-width: 250px;\n\n .name {\n display: flex;\n align-items: center;\n gap: 0.15rem;\n max-width: 79%;\n white-space: nowrap;\n\n span {\n flex-shrink: 0;\n img {\n width: 25px;\n height: auto;\n }\n }\n }\n\n .dot {\n margin-top: -8px;\n color: rgba(128, 128, 128, 1);\n }\n }\n\n .author-username {\n font-weight: 500;\n max-width: 200px;\n overflow: hidden;\n text-overflow: ellipsis;\n color: rgba(128, 128, 128, 1);\n font-weight: 400;\n font-size: 15px;\n transition-duration: 0.2s;\n }\n\n /* .author-username:hover {\n transition-duration: 0.2s;\n color: #0278f6;\n } */\n\n .author-name {\n transition-duration: 0.2s;\n }\n\n .author-name:hover {\n transition-duration: 0.2s;\n color: #0278f6;\n }
1\n\n .time-since-created {\n color: #808080;\n font-weight: 400;\n\n .ago-tag {\n display: none;\n }\n }\n }\n\n .post {\n .post-title {\n margin: 1rem auto;\n margin-bottom: 0.8rem;\n font-size: 18px;\n font-weight: 600;\n font-family: "Work Sans", sans-serif;\n word-break: break-word;\n }\n }\n\n .post-image-container {\n margin: 1rem auto;\n display: flex;\n justify-content: center;\n background-color: transparent;\n\n img {\n width: 100%;\n height: auto;\n border-radius: 10px;\n }\n }\n }\n\n '," {\n padding: 1rem;\n padding-bottom: 0.75rem;\n border-radius: 18px;\n border: 2px solid ",";\n background: ",";\n\n .post {\n .post-title {\n font-size: 18px;\n margin: 1rem auto;\n margin-bottom: 1rem;\n }\n }\n\n .author {\n .username-container {\n max-width: 450px;\n\n .name {\n max-width: none;\n }\n }\n\n .time-since-created {\n .ago-tag {\n display: inline-block;\n }\n }\n }\n\n .post-image-container {\n margin: 1rem auto;\n display: flex;\n justify-content: start;\n border-radius: 10px;\n\n img {\n max-height: 570px;\n }\n }\n\n :hover {\n background: ",";\n }\n }\n"]);return _templateObject=function(){return n},n}function _templateObject1(){let n=(0,o._)(["\n max-height: 300px;\n overflow: hidden;\n word-break: break-word;\n -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);\n\n /* inline post-body images carry width/height attributes; without\n width/height auto the attribute height survives max-width squeezing\n and distorts the aspect ratio (custom emojis keep their inline styles) */\n img {\n max-width: 100%;\n width: auto;\n height: auto;\n border-radius: 8px;\n margin: 8px 0;\n }\n\n "," {\n &.smaller-height-mobile {\n max-height: 100px;\n -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent);\n }\n }\n\n "," {\n &.smaller-height-mobile {\n max-height: 300px;\n -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);\n }\n }\n"]);return _templateObject1=function(){return n},n}let I=r.default.div.withConfig({componentId:"sc-25871f2e-0"})(_templateObject(),n=>{let{theme:e}=n;return e.breakpoints.xs},n=>{let{theme:e}=n;return"dark"==e.mode?e.colors.palette.grey["800"]:e.colors.palette.grey["200"]},n=>"dark"===n.theme.mode?"rgba(255, 255, 255, 0.87)":"black",n=>"dark"===n.theme.mode?"#FFD601":"#987316",n=>"dark"===n.theme.mode?"#0f1524":"#F6F6F6",n=>"dark"===n.theme.mode?"rgba(237, 231, 225, 0.1)":"#DADADA",n=>"dark"===n.theme.mode?"rgba(255, 255, 255, 0.07)":"#DADADA",n=>{let{theme:e}=n;return e.breakpoints.sm},n=>n.theme.colors.profileBorder,n=>"dark"===n.theme.mode?"#1d2332":"#FFFFFF",n=>!n.showDropDown&&("dark"===n.theme.mode?"#22293a":"#f7f7f7")),_=r.default.div.withConfig({componentId:"sc-25871f2e-1"})(_templateObject1(),n=>{let{theme:e}=n;return e.breakpoints.xs},n=>{let{theme:e}=n;return e.breakpoints.sm});e.Z=function(n){var e,t,o;let{postData:r,link:a,communityName:O,index:z,loadedImage:E}=n,P=(0,c.useRef)(null),U=(0,d.v9)(y.f8);(0,h.useRouter)();let L=(0,c.useMemo)(()=>j.F,[]),[D,Z]=(0,c.useState)(!1),[B,T]=(0,c.useState)(!1),[M,R]=(0,c.useState)(!1),[W,V]=(0,c.useState)(!1),[J,q]=(0,c.useState)(!1),Q=(0,c.useRef)(null),X=(0,A.Z)(null==r?void 0:null===(e=r.authorData)||void 0===e?void 0:e.totalXp),{height:G,width:Y}=(0,w.Z)(null==r?void 0:null===(t=r.images[0])||void 0===t?void 0:t.url);function handleClick(n){"A"===n.target.tagName&&n.stopPropagation()}return(0,c.useEffect)(()=>{async function reportStatus(){try{let n=await (0,k.Y)(r.id,U,r.communityName);!1===n?Z(!1):Z(!0)}catch(n){console.error("Error fetching report:",n)}}r&&U&&reportStatus()},[r,U]),(0,c.useEffect)(()=>{if(P.current){let n=document.querySelector("#post".concat(r.postId)).scrollHeight,e=P.current.clientHeight;n-e<200&&(P.current.style.maxHeight="fit-content",P.current.style.webkitMaskImage="initial")}},[r.postId,P]),(0,c.useEffect)(()=>{let n=P.current;if(n)return n.addEventListener("click",handleClick),()=>{n.removeEventListener("click",handleClick)}},[P]),(0,i.jsxs)(I,{className:"nes-pointer opc-post-container",showDropDown:B,onMouseEnter:function(){Q.current=setTimeout(()=>{var n;q(!0),(0,F.lZ)({username:null==r?void 0:null===(n=r.authorData)||void 0===n?void 0:n.username})},500)},onMouseLeave:function(){clearTimeout(Q.current),q(!1)},children:[(0,i.jsxs)(s(),{href:a,style:{all:"unset"}
1,children:[W&&(0,i.jsx)(x.Z,{postId:r.postId,setShowUserLikes:V,communityName:r.communityName}),M&&(0,i.jsx)(b.Z,{setShowReportForm:R,postId:r.id,userUid:U,handleCancelReport:function(n){n.stopPropagation(),R(!1)},handleReport:function(n){n.stopPropagation();try{(0,N.Z)(r.id,U,r.communityName),Z(!0),R(!1)}catch(n){console.log(n)}}}),(0,i.jsx)("div",{className:"dropdown-container",children:(0,i.jsxs)("div",{className:"dropdown-toggle",children:[(0,i.jsx)("div",{className:"three-dots",onClick:n=>{n.preventDefault(),n.stopPropagation(),T(!B)},children:(0,i.jsx)(m.evw,{size:20,className:"nes-pointer"})}),B&&(0,i.jsxs)("div",{className:"dropdown",children:[U===r.ownerUid&&(0,i.jsx)(s(),{href:"main"==r.communityName?"/community/post/".concat(null==r?void 0:r.id,"?phase=edit"):"monthly-challenge"==r.communityName?"/community/monthly-challenge/submission/".concat(null==r?void 0:r.id,"?phase=edit"):"/community/".concat(r.communityName,"/").concat(null==r?void 0:r.id,"?phase=edit"),legacyBehavior:!0,children:(0,i.jsxs)("button",{className:"update",children:[(0,i.jsx)(u.$iz,{}),"Edit"]})}),!D&&(0,i.jsxs)("button",{className:"report",onClick:n=>{n.preventDefault(),n.stopPropagation(),T(!B),R(!M)},children:[(0,i.jsx)(p.Ssb,{color:""}),"Report"]})]})]})}),(0,i.jsxs)("div",{className:"author",children:[(0,i.jsx)(s(),{href:"/@".concat(r.authorData.username),legacyBehavior:!0,children:(0,i.jsx)("div",{className:"author-img-container nes-pointer",children:(0,i.jsx)("img",{src:r.authorData.photoURL,alt:"author profile picture",loading:"lazy"})})}),(0,i.jsx)(s(),{href:"/@".concat(r.authorData.username),legacyBehavior:!0,children:(0,i.jsxs)("div",{className:"username-container",children:[(0,i.jsxs)("div",{className:"name",children:[(0,i.jsx)("p",{className:"author-name nes-pointer ".concat((null===(o=r.authorData)||void 0===o?void 0:o.club)?"club":""),children:r.authorData.name}),(0,i.jsx)("span",{children:(0,i.jsx)("img",{className:"rank-badge",src:X.badge,alt:"user rank badge",loading:"lazy"})}),(0,i.jsxs)("p",{className:"author-username nes-pointer",children:["@",r.authorData.username]})]}),(0,i.jsx)("p",{className:"dot",children:"."}),r.createdAt._seconds&&(0,i.jsx)("p",{className:"time-since-created",children:L(null==r?void 0:r.createdAt)})]})})]}),(0,i.jsx)(s(),{href:a,legacyBehavior:!0,children:(0,i.jsxs)("div",{className:"post nes-pointer",children:[(0,i.jsx)("h2",{className:"post-title",children:r.title}),(0,i.jsx)(C.Z,{videoFiles:null==r?void 0:r.videoFiles,disableAutoPlayOnView:!1}),r.images.length>1?(0,i.jsx)("div",{className:"post-image-container",children:(0,i.jsx)(S.Z,{images:r.images,onFirstImageLoad:()=>{0===z&&E&&E()}})}):0!=r.images.length&&(0,i.jsx)("div",{className:"post-image-container",children:(0,i.jsx)("div",{onClick:n=>n.preventDefault(),children:(0,i.jsx)(v.Z,{src:r.images[0].url,alt:"post images",style:{width:G<570&&Y>574?"100%":"auto"},onLoad:()=>{0===z&&E&&E()},loading:z>2?"lazy":"eager"})})}),r.content&&(0,i.jsx)(_,{ref:P,id:"post".concat(r.postId),className:0==z&&"smaller-height-mobile",children:(0,i.jsx)(g.Z,{children:(0,l.ZP)(r.content.replace(/`([^`]+)`/g,'<span className="backtick-code-block">$1</span>'))})})]})})]}),(0,i.jsx)(f.Z,{postLikes:null==r?void 0:r.userLikes,numberOfComments:null==r?void 0:r.userComments,postId:null==r?void 0:r.id,communityName:r.communityName,postData:r,setShowUserLikes:V})]})}},51894:function(n,e,t){"use strict";var o=t(82729),i=t(85893),r=t(19521),a=t(9473),s=t(67294),l=t(5434),c=t(12238),d=t.n(c),m=t(12860),u=t(609);function _templateObject(){let n=(0,o._)(["\n from {\n transform: scale(0.8);\n visibility: hidden;\n opacity: 0;\n } to {\n transform: scale(1);\n visibility: visible;\n opacity: 1;\n }\n"]);return _templateObject=function(){return n},n}function _templateObject1(){let n=(0,o._)(["\n z-index: 20;\n position: fixed;\n display: flex;\n justify-content: center;\n /* align-items: center; */\n width: 100%;\n height: 100%;\n top: 0px;\n background: rgba(0, 0, 0, 0.5);\n color: whitesmoke;\n\n "," {\n .form {\n position: relative;\n margin-top: 2rem;\n border: 2px solid\n ",";\n animation: "," 0.2s ease-in;\n width: 700px;\n height: fit-content;\n background: ",";\n padding: 1rem;\n border-radius: 7px;\n\n .profile-title-field {\n display: flex;\n margin-bottom: 1rem;\n margin-top: 2.5rem;\n img {\n width: 40px;\n height: 40px;\n border-radius: 100px;\n }\n\n input {\n flex: 1;\n border: 2px solid\n ",";\n border-radius: 7px;\n padding: 0.7rem;\n margin-left: 1rem;\n color: ",';\n font-family: "Work Sans", sans-serif;\n background: ',';\n outline-width: 0;\n }\n }\n\n .profanity-alert {\n border: 2px solid red;
1\n color: #e01a18;\n border-radius: 5px;\n padding: 0.5rem;\n margin: 1rem auto;\n\n p {\n margin: 0px;\n font-family: "Work Sans", sans-serif;\n font-weight: 600;\n }\n }\n\n textarea {\n width: 100%;\n min-height: 200px;\n max-height: 400px;\n background-color: #0e1524;\n border: 2px solid rgba(36, 76, 115, 1);\n outline-width: 0;\n border-radius: 7px;\n color: whitesmoke;\n font-family: "Work Sans", sans-serif;\n padding: 0.7rem;\n }\n\n .button-container {\n margin-top: 0.5rem;\n display: flex;\n justify-content: space-between;\n\n .media-buttons {\n display: flex;\n align-items: center;\n\n div {\n display: flex;\n align-items: center;\n align-items: center;\n gap: 0.5rem;\n margin-right: 1rem;\n\n p {\n margin: 0px;\n color: whitesmoke;\n font-family: "Work Sans", sans-serif;\n }\n }\n }\n button {\n font-size: 14px;\n }\n }\n\n .close-btn {\n all: unset;\n position: absolute;\n right: 20px;\n top: 10px;\n font-size: 30px;\n line-height: 0.8;\n transition-duration: 0.2s;\n padding: 0.2rem;\n color: ',";\n\n :hover {\n background-color: hsla(61, 6%, 90%, 0.3);\n border-radius: 50%;\n cursor:\n url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzElEQVRYR+2X0Q6AIAhF5f8/2jYXZkwEjNSVvVUjDpcrGgT7FUkI2D9xRfQETwNIiWO85wfINfQUEyxBG2ArsLwC0jioGt5zFcwF4OYDPi/mBYKm4t0U8ATgRm3ThFoAqkhNgWkA0jJLvaOVSs7j3qMnSgXWBMiWPXe94QqMBMBc1VZIvaTu5u5pQewq0EqNZvIEMCmxAawK0DNkay9QmfFNAJUXfgGgUkLaE7j/h8fnASkxHTz0DGIBMCnBeeM7AArpUd3mz2x3C7wADglA8BcWMZhZAAAAAElFTkSuQmCC)\n 14 0,\n pointer;\n }\n }\n }\n }\n "," {\n .form {\n margin-top: 2rem;\n max-height: 90vh;\n overflow: hidden;\n }\n }\n\n "," {\n .form {\n margin-top: 2rem;\n max-height: 90vh;\n overflow: hidden;\n }\n }\n "," {\n .form {\n margin-top: 10rem;\n }\n }\n"]);return _templateObject1=function(){return n},n}let p=(0,s.lazy)(()=>Promise.all([t.e(7603),t.e(155),t.e(6207),t.e(3280),t.e(4540)]).then(t.bind(t,33280))),h=(0,r.keyframes)(_templateObject()),g=r.default.div.withConfig({componentId:"sc-a88b3e46-0"})(_templateObject1(),n=>{let{theme:e}=n;return e.breakpoints.xs},n=>"dark"===n.theme.mode?"rgba(36, 76, 115, 1)":"#DADADA",h,n=>"dark"===n.theme.mode?"#1d2332":"#FFFFFF",n=>"dark"===n.theme.mode?"rgba(36, 76, 115, 1)":"#DADADA",n=>"dark"===n.theme.mode?"rgba(255, 255, 255, 0.87)":"dark",n=>"dark"===n.theme.mode?"#0e1524":"#FFFFFF",n=>"dark"===n.theme.mode?"rgba(255, 255, 255, 0.87)":"black",n=>{let{theme:e}=n;return e.breakpoints.sm},n=>{let{theme:e}=n;return e.breakpoints.md},n=>{let{theme:e}=n;return e.breakpoints.lg});e.Z=function(n){let{setShowPostForm:e,allPosts:t,setAllPosts:o}=n,r=new(d()),c=(0,a.v9)(u.f8),h=(0,a.v9)(u.zr),f=localStorage.getItem("photoURL")||"",[b,x]=(0,s.use
1State)(""),[w,v]=(0,s.useState)(""),[y,j]=(0,s.useState)(!1);async function handleSubmit(n){n.preventDefault();let i=r.isProfane(b),a=r.isProfane(w);if(i||a){j(!0);return}try{let n=await (0,m.qb)({communityName:"main",uid:c,title:b,imageFile:null,videoFiles:null,content:w,type:"post",parentPostId:""});if(200===n.status){let i={authorData:{username:h,photoURL:f},comments:0,...n.post};t?o([i,...t]):o([i]),e(!1)}}catch(n){console.error(n)}}return(0,i.jsx)(g,{children:(0,i.jsxs)("form",{className:"form",onClick:n=>n.stopPropagation(),onSubmit:n=>handleSubmit(n),children:[(0,i.jsx)("button",{className:"close-btn nes-pointer",children:(0,i.jsx)(l.lTq,{onClick:()=>e(!1)})}),(0,i.jsxs)("div",{className:"profile-title-field",children:[(0,i.jsx)("img",{src:f,alt:"user photo"}),(0,i.jsx)("input",{placeholder:"Title",value:b,onChange:n=>x(n.target.value),required:!0})]}),y&&(0,i.jsx)("div",{className:"profanity-alert",children:(0,i.jsx)("p",{children:"Cod\xe9dex is a community for all ages and groups. Please be considerate when making a post and remove any profanity."})}),(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)("div",{children:"Loading..."}),children:(0,i.jsx)(p,{setPostMainContent:v,value:""})}),(0,i.jsxs)("div",{className:"button-container",children:[(0,i.jsx)("div",{className:"media-buttons"}),(0,i.jsx)("button",{type:"submit",className:"nes-btn is-primary",children:"Post"})]})]})})}},96191:function(n,e,t){"use strict";var o=t(82729),i=t(85893),r=t(19521),a=t(41664),s=t.n(a),l=t(67294),c=t(9473),d=t(84849),m=t(609);function _templateObject(){let n=(0,o._)(["\n border: 2px solid ",";\n\n border-radius: 15px;\n margin: 1rem auto;\n padding: 1rem;\n color: ",';\n\n .title {\n display: flex;\n justify-content: space-between;\n font-family: "Work Sans", sans-serif;\n margin-bottom: 0.5rem;\n h2 {\n margin: 0px;\n font-size: 16px;\n font-weight: 600;\n }\n\n p {\n margin: 0px;\n font-size: 14px;\n font-weight: 600;\n color: #808080;\n }\n }\n\n .tech-articles {\n display: grid;\n gap: 0.5rem;\n .article {\n display: flex;\n gap: 0.5rem;\n\n p {\n margin: 0px;\n font-family: "Work Sans", sans-serif;\n }\n img {\n width: 60px;\n height: 60px;\n object-fit: cover;\n border-radius: 7px;\n }\n\n .title {\n font-size: 14px;\n font-weight: 500;\n }\n\n .date {\n font-size: 14px;\n font-weight: 500;\n color: rgba(128, 128, 128, 1);\n }\n }\n }\n']);return _templateObject=function(){return n},n}let u=r.default.div.withConfig({componentId:"sc-c9b99085-0"})(_templateObject(),n=>n.theme.colors.profileBorder,n=>"dark"===n.theme.mode?"rgba(255, 255, 255, 0.87)":"black");e.Z=function(){let[n,e]=(0,l.useState)([]),t=(0,c.v9)(m.o4);return(0,l.useEffect)(()=>{(async function(){let n=sessionStorage.getItem("cachedTechNews");if(n){e(JSON.parse(n));return}let t=await fetch("/api/community/getTechNews"),o=await t.json();e(o.events),sessionStorage.setItem("cachedTechNews",JSON.stringify(o.events))})()},[]),(0,i.jsxs)(u,{children:[(0,i.jsxs)("div",{className:"title",children:[(0,i.jsx)("h2",{children:"Tech News"}),(0,i.jsx)(s(),{href:"/blog",style:{all:"unset"},target:"_blank",rel:"noopener noreferrer",children:(0,i.jsx)("p",{className:"nes-pointer",children:"See all"})})]}),(0,i.jsx)("div",{className:"loader"}),(0,i.jsx)("div",{className:"tech-articles",children:0!=n.length?n.map((n,e)=>(0,i.jsx)(s(),{href:n.link,style:{all:"unset"},target:"_blank",rel:"noopener noreferrer",children:(0,i.jsxs)("div",{className:"article nes-pointer",children:[(0,i.jsx)("img",{src:n.imageUrl,alt:"article image"}),(0,i.jsxs)("div",{className:"article-titles",children:[(0,i.jsx)("p",{className:"title",children:n.title}),(0,i.jsx)("p",{className:"date",children:n.date})]})]})},e)):Array.from({length:3},(n,e)=>(0,i.jsxs)("div",{className:"article nes-pointer",children:[(0,i.jsx)(d.Z,{className:"loader",highlightColor:"dark"===t?"#3d3f4c":"#f5f5f5",baseColor:"dark"===t?"#343541":"#ebebeb",width:60,height:60}),(0,i.jsxs)("div",{className:"article-titles",style:{width:"100%"},children:[(0,i.jsx)("p",{className:"date",style:{width:"100%",marginBottom:"4px"},children:(0,i.jsx)(d.Z,{className:"loader",highlightColor:"dark"===t?"#3d3f4c":"#f5f5f5",baseColor:"dark"===t?"#343541":"#ebebeb",width:"100%",height:35})}),(0,i.jsx)("p",{className:"date",style:{width:"100%"},children:(0,i.jsx)(d.Z,{className:"loader",highlightColor:"dark"===t?"#3d3f4c":"#f5f5f5",baseColor:"dark"===t?"#343541":"#ebebeb",width:"100%"})})]})]},Date()+e))})]})}},71293:function(n,e,t){"use strict";var o=t(82729),i=t(85893),r=t(67294),a=t(19521),s=t(30719),l=t(71911);t(92261),t(56735),t(69831);var c=t(29195),d=t(5802);
1function _templateObject(){let n=(0,o._)(["\n position: relative;\n /* trap swiper's internal z-indexes (arrows are z-10) so they can't\n paint over post-level UI like the edit dropdown (z-1) */\n isolation: isolate;\n width: 100%;\n /* the dots div renders BEFORE the swiper in the DOM so its ref is attached\n when swiper initializes; flex order puts it back below the image */\n display: flex;\n flex-direction: column;\n\n .swiper {\n order: 1;\n width: 100%;\n aspect-ratio: ",";\n max-height: ","px;\n border-radius: 5px;\n border: 1px solid ",";\n }\n\n .carousel-dots {\n order: 2;\n display: flex;\n justify-content: center;\n align-items: center;\n padding-top: 8px;\n min-height: 16px;\n }\n\n .slide-backdrop {\n position: absolute;\n inset: 0;\n background-size: cover;\n background-position: center;\n filter: blur(15px);\n opacity: 0.6;\n }\n\n .slide-zoom {\n position: relative;\n width: 100%;\n height: 100%;\n\n /* ImageZoom's wrapper div and react-medium-image-zoom's internals must\n fill the slide so the contained image letterboxes correctly */\n > div,\n [data-rmiz],\n [data-rmiz-content] {\n width: 100%;\n height: 100%;\n }\n\n img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n }\n\n .image-counter {\n position: absolute;\n top: 12px;\n right: 12px;\n z-index: 2;\n padding: 4px 10px;\n border-radius: 12px;\n background: rgba(0, 0, 0, 0.6);\n color: #fff;\n font-size: 13px;\n font-weight: 700;\n line-height: 150%;\n pointer-events: none;\n }\n\n .swiper-pagination-bullet {\n background-color: ",";\n opacity: 1;\n }\n\n .swiper-pagination-bullet-active {\n background-color: #14adff;\n }\n\n .swiper-button-prev,\n .swiper-button-next {\n width: 32px;\n height: 32px;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.55);\n color: #fff;\n opacity: 0;\n transition: opacity 0.2s ease;\n\n ::after {\n font-size: 14px;\n font-weight: 700;\n }\n\n :focus-visible {\n opacity: 1;\n outline: 2px solid #14adff;\n outline-offset: 2px;\n }\n }\n\n :hover .swiper-button-prev,\n :hover .swiper-button-next {\n opacity: 1;\n }\n\n .swiper-button-disabled {\n visibility: hidden;\n }\n\n @media (hover: none) {\n .swiper-button-prev,\n .swiper-button-next {\n display: none;\n }\n }\n"]);return _templateObject=function(){return n},n}let m=4/3,u=a.default.div.withConfig({componentId:"sc-9ec7a32c-0"})(_templateObject(),n=>{let{$aspectRatio:e}=n;return e},500,n=>{let{theme:e}=n;return e.colors.background.grey.primary},n=>{let{theme:e}=n;return e.colors.border.grey.medium});e.Z=function(n){let{images:e,onFirstImageLoad:t}=n,[o,a]=(0,r.useState)(0),p=(0,r.useRef)(null),h=(0,r.useMemo)(()=>({clickable:!0}),[]),g=e[0],f=(0,c.Z)(null==g?void 0:g.url),b=(null==g?void 0:g.width)||f.width,x=(null==g?void 0:g.height)||f.height;return e&&0!==e.length?(0,i.jsxs)(u,{$aspectRatio:b&&x?b/x:m,onClick:n=>n.preventDefault(),children:[(0,i.jsxs)("p",{className:"image-counter","aria-hidden":"true",children:[o+1,"/",e.length]}),(0,i.jsx)("div",{className:"carousel-dots",ref:p}),(0,i.jsx)(s.tq,{modules:[l.tl,l.W_,l.N1,l.s5],pagination:h,navigation:!0,keyboard:{enabled:!0,onlyInViewport:!0},spaceBetween:0,slidesPerView:1,onBeforeInit:n=>{"object"==typeof n.params.pagination&&(n.params.pagination.el=p.current)},onSlideChange:n=>a(n.activeIndex),children:e.map((n,o)=>(0,i.jsxs)(s.o5,{children:[(0,i.jsx)("div",{className:"slide-backdrop",style:{backgroundImage:"url(".concat(n.url,")")},"aria-hidden":"true"}),(0,i.jsx)("div",{className:"slide-zoom",children:(0,i.jsx)(d.Z,{src:n.url,alt:"Post image ".concat(o+1," of ").concat(e.length),loading:0===o?"eager":"lazy",draggable:!1,onLoad:0===o?t:void 0})})]},n.url))})]}):null}},73664:function(n,e,t){"use strict";t.d(e,{oH:function(){return getUserPostCommentsRef},x:function(){return getUserPostsRef}});var o=t(39828),i=t(92369);function getUserPostsRef(n){let{uid:e}=n,{firestore:t}=(0,i.UM)(),r=(0,o.JU)((0,o.hJ)(t,"users"),e,"community","posts");return r}function getUserPostCommentsRef(n){let{uid:e}=n,{firestore:t}=(0,i.UM)(),r=(0,o.JU)((0,o.hJ)(t,"users"),e,"community","comments");return r}},12860:function(n,e,t){"use strict";t.d(e,{eY:function(){return generatePostId},pz:function(){return getImageDimensions},qb:function(){return createPost},zl:function(){return l}});var o=t(39828),i=t(92369),r=t(73664),a=t(16689),s=t(48764).Buffer;let l=5;async function getImageDimensions(n){try{if("function"==typeof createImageBitmap){let e=await createImageBitmap(n),t={width:e.width,height:e.height};return e.close(),t}}catch(n){console.error("Error measuring image with createImageBitmap:",n)}return new Promise(e=>{let t=URL.createObjectURL(n),o=new Image;o.onload=()=>
1{URL.revokeObjectURL(t),e({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=()=>{URL.revokeObjectURL(t),e(null)},o.src=t})}function generatePostId(){let{firestore:n}=(0,i.UM)();return(0,o.JU)((0,o.hJ)(n,"community")).id}async function createPost(n){let{communityName:e,uid:t,fields:c={},title:d,content:m,imageFile:u,imageFiles:p,videoFiles:h,parentPostId:g,postId:f,type:b="post",targetCollection:x="community"}=n,{firestore:w}=(0,i.UM)(),v=(0,o.qs)(w);if("post"===b){if(!e||!t||!c.title||void 0===c.content)throw Error("which community, uid, title, and description are required fields.");try{let n=await fetch("/api/community/createPostCheck");if(200!==n.status)return{status:500,post:null}}catch(n){return console.error("Error creating post:",n),{status:500,post:null}}let n=(0,r.x)({uid:t}),i=(0,o.JU)(w,"uploadProgress",t);async function updateProgress(n,e){await (0,o.pl)(i,{[n]:e},{merge:!0})}try{let i=(0,o.hJ)(w,x,e,"posts"),r=f?(0,o.JU)(i,f):(0,o.JU)(i),d={...c,ownerUid:t,createdAt:(0,o.Bt)(),parent:null,postId:r.id,communityName:e,images:[],videoFiles:[],userComments:0,userLikes:0,userReports:0,reports:[],pinnedByOwner:!1},m=(null==p?void 0:p.length)?p:u?[u]:[];if(m.length>l)return console.error("Posts can include at most ".concat(l," images, received ").concat(m.length,".")),{status:400,post:null};if(m.length>0)try{let n=(0,a.cF)();d.images=await Promise.all(m.map(async(t,o)=>{let i=(0,a.iH)(n,"".concat(x,"/").concat(e,"/post/").concat(r.id,"/").concat(o,"_").concat(t.name)),[,s]=await Promise.all([(0,a.KV)(i,t),getImageDimensions(t)]),l=await (0,a.Jt)(i);return s?{url:l,...s}:{url:l}}))}catch(n){return console.error("Error uploading images:",n),{status:500,post:null}}if(h)try{let n,t,o;let i=(0,a.cF)(),{video:l,thumbNail:c,videoDimensions:m,backgroundImage:u}=h,p=(0,a.iH)(i,"".concat(x,"/").concat(e,"/post/").concat(r.id,"/").concat(l.name)),g=(0,a.B0)(p,l);c&&(t=(0,a.iH)(i,"".concat(x,"/").concat(e,"/post/").concat(r.id,"/").concat(c.name)),n=(0,a.B0)(t,c)),g.on("state_changed",async n=>{let e=n.bytesTransferred/n.totalBytes*100;await updateProgress("video",e)}),n&&n.on("state_changed",async n=>{let e=n.bytesTransferred/n.totalBytes*100;await updateProgress("thumbnail",e)});let f=null;if(u)try{let n=u.split(",")[1],t=s.from(n,"base64"),o=new Blob([t],{type:"image/jpeg"}),l=(0,a.iH)(i,"".concat(x,"/").concat(e,"/post/").concat(r.id,"/backgroundimage.webp")),c=(0,a.B0)(l,o);c.on("state_changed",async n=>{let e=n.bytesTransferred/n.totalBytes*100;await updateProgress("backgroundImage",e)}),await c,f=await (0,a.Jt)(l)}catch(n){console.error("Error uploading background image:",n)}let b=null,w=[g.then(async()=>{o=await (0,a.Jt)(p),await updateProgress("video",0)})];n&&w.push(n.then(async()=>{b=await (0,a.Jt)(t),await updateProgress("thumbnail",0)})),await Promise.all(w),d.videoFiles.push({videoUrl:o,thumbNailUrl:b,videoDimensions:m,backgroundImageUrl:f})}catch(n){return console.error("Error uploading files:",n),{status:500,post:null}}d.videoFiles.length?d.images=[]:d.images.length&&(d.videoFiles=[]),v.set(r,d),v.set(n,{postIds:(0,o.vr)(r.id)},{merge:!0}),await v.commit();let g=await (0,o.QT)(r),b=g.data();return{status:200,post:b}}catch(n){return console.error(n),{status:500,post:null}}}else{if(!t)throw Error("uid, title, and description are required fields.");let n=(0,r.oH)({uid:t});try{let i=(0,o.hJ)(w,x,e,"posts"),r=(0,o.JU)(i),s={ownerUid:t,title:d,images:[],content:m,createdAt:(0,o.Bt)(),parent:{id:g},postId:r.id,communityName:e,userLikes:0,userReports:0};if(u)try{if((null==u?void 0:u.type)=="giphy-upload"){var y;s.images.push({url:null==u?void 0:null===(y=u.acceptedFile)||void 0===y?void 0:y.imageUrl})}else{let n=(0,a.cF)(),t=null==u?void 0:u.acceptedFile,o=(0,a.iH)(n,"".concat(x,"/").concat(e,"/post/").concat(r.id,"/").concat(t.name));await (0,a.KV)(o,t);let i=await (0,a.Jt)(o);s.images.push({url:i})}}catch(n){return console.error("Error uploading image:",n),{status:500,post:null}}v.set(r,s),v.set(n,{commentIds:(0,o.vr)(r.id)},{merge:!0}),await v.commit();let l=await (0,o.QT)(r),c=l.data();return{status:200,post:c}}catch(n){return console.error(n),{status:500,post:null}}}}},11094:function(n,e,t){"use strict";t.r(e),t.d(e,{__N_SSG:function(){return Z},default:function(){return outdated_community}});var o=t(85893),i=t(67294),r=t(11163),a=t(9473),s=t(62069),l=t(99428),c=t(27936),d=t(82729),m=t
1(19521),u=t(4705),p=t(74774),h=t(28064),g=t(96191),f=t(17885),b=t(25670),x=t(58533),w=t(50164),v=t(41664),y=t.n(v),j=t(84849),k=t(30719);t(92261),t(16840),t(69831),t(18161);var N=t(89755),A=t.n(N),F=t(609);function _templateObject(){let n=(0,d._)(["\n "," {\n margin: 1rem auto;\n margin-bottom: 0.5rem;\n position: relative;\n display: none;\n scrollbar-color: transparent transparent;\n\n :hover {\n scrollbar-color: transparent transparent;\n }\n\n .title-container {\n color: ",';\n font-family: "Work Sans", sans-serif;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 1rem;\n font-weight: 500;\n\n p {\n margin: 0px;\n }\n\n .see-all {\n margin: 0px;\n font-size: 14px;\n font-weight: 600;\n color: #808080;\n transition-duration: 0.2s;\n\n :hover {\n color: #b7b5b5;\n transition-duration: 0.2s;\n }\n }\n }\n\n .slider-container {\n display: flex;\n overflow: auto;\n gap: 1rem;\n padding: 5px 0px;\n margin-right: 2px;\n\n :hover {\n scrollbar-color: transparent transparent;\n }\n }\n\n .swiper-button-disabled {\n display: none !important;\n }\n\n .swiper-nav-btn {\n background: #0f1524;\n border: none;\n border: 1.5px solid\n ',";\n border-radius: 50%;\n width: 26px;\n height: 26px;\n padding: 0px;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1;\n opacity: 0.8;\n transition-duration: 0.2s;\n\n :hover {\n opacity: 1;\n transition-duration: 0.2s;\n border-color: #379cee;\n }\n }\n\n .swiper-nav-btn:focus {\n outline: none;\n }\n\n .next-button {\n transform: rotate(180deg);\n position: absolute;\n left: -15px;\n top: 30px;\n }\n\n .previous-button {\n position: absolute;\n right: -15px;\n top: 30px;\n }\n }\n\n "," {\n display: block;\n .slider {\n margin: auto;\n overflow: hidden;\n position: relative;\n width: 750px;\n }\n }\n\n "," {\n .slider {\n margin: auto;\n overflow: hidden;\n position: relative;\n width: 605px;\n }\n }\n"]);return _templateObject=function(){return n},n}function _templateObject1(){let n=(0,d._)(["\n width: 80px;\n height: 80px;\n border-radius: 25px;\n overflow: hidden;\n\n background-color: ",";\n padding: 3px;\n border: 2px solid ",";\n transition-duration: 0.2s;\n\n :hover {\n transform: scale(1.05);\n }\n\n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 20px;\n }\n\n .loader {\n width: 100px;\n height: 80px;\n }\n\n :hover {\n border-color: #379cee;\n transition-duration: 0.2s;\n }\n"]);return _templateObject1=function(){return n},n}let C=m.default.div.withConfig({componentId:"sc-93ab402a-0"})(_templateObject(),n=>{let{theme:e}=n;return e.breakpoints.xs},n=>"dark"===n.theme.mode?"rgba(255, 255, 255, 0.87)":"black",n=>"dark"===n.theme.mode?"rgba(36, 76, 115, 1)":"#DADADA",n=>{let{theme:e}=n;return e.breakpoints.sm},n=>{let{theme:e}=n;return e.breakpoints.md}),S=m.default.div.withConfig({componentId:"sc-93ab402a-1"})(_templateObject1(),n=>n.theme.colors.body,n=>n.theme.colors.profileBorder);var community_ProjectCarousal=function(n){let{allPosts:e}=n,t=(0,a.v9)(F.o4),[r,s]=(0,i.useState)(0),[l,c]=(0,i.useState)(!0),[d,m]=(0,i.useState)("right");function scroll(n){var e,t,o=document.querySelector(".slider-container");if(o){var i=o.scrollWidth;o.clientWidth;var r=o.scrollLeft;"left"===n?e=Math.max(0,r-500):(e=Math.min(i,r+500),c(!1)),requestAnimationFrame(function scroll(n){t||(t=n);var i=Math.min((n-t)/900,1);o.scrollLeft=r+(1-Math.pow(1-i,3))*(e-r),i<1&&requestAnimationFrame(scroll)})}}let[u,p]=(0,i.useState)(!1),[h,g]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let n;return h?n&&cancelAnimationFrame(n):function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=document.getElementById(e),i=o.scrollLeft;n=requestAnimationFrame(function scroll(){"left"==d?i-=t:i+=t,i>=o.scrollWidth&&(i=-o.clientWidth),o.scrollLeft=i,n=requestAnimationFrame(scroll)})}("slider-container",.3),()=>cancelAnimationFrame(n)},[h,d]),(0,o.jsxs)(C,{children:[(0,o.jsxs)("div",{className:"slider-container",id:"slider-container",style:{marginLeft:u&&"-2px",paddingLeft:u&&"2px"},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[e.map((n,e)=>(0,o.jsx)("div",{children:(0,o.jsx)(y(),{href:"/community/project-showcase/".concat(n.postId),legacyBehavior:!0,children:(0,o.jsx)(S,{className:"nes-pointer",onMouseEnter:()=>{0===e&&p(!0)},onMouseLeave:()=>{0===e&&p(!1)},children:(0,o.jsx)(A(),{src:n.cardImage||n.images[0].url,width:500,height:500,alt:"".concat(n.title," project"),priority:!0,qual
1ity:50})},n)},n)},n)),0===e.length&&(0,o.jsx)(o.Fragment,{children:Array.from({length:10},(n,e)=>(0,o.jsxs)(k.o5,{children:[" ",(0,o.jsx)(S,{className:"nes-pointer",style:{border:"dark"===t?"2px solid #343541":"2px solid #ebebeb"},children:(0,o.jsx)(j.Z,{className:"loader",highlightColor:"dark"===t?"#3d3f4c":"#f5f5f5",baseColor:"dark"===t?"#343541":"#ebebeb"})})]},Date()+e))})]}),!l&&(0,o.jsx)("button",{className:"prev swiper-nav-left next-button swiper-nav-btn",onClick:()=>{scroll("left"),m("left")},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:(0,o.jsx)("path",{d:"M1.0001 7.00006L8.5901 7.00006L5.2901 10.2901C5.1018 10.4784 4.99601 10.7338 4.99601 11.0001C4.99601 11.2664 5.1018 11.5218 5.2901 11.7101C5.47841 11.8984 5.7338 12.0041 6.0001 12.0041C6.26641 12.0041 6.5218 11.8984 6.7101 11.7101L11.7101 6.71006C11.8011 6.61495 11.8725 6.50281 11.9201 6.38006C12.0201 6.1366 12.0201 5.86352 11.9201 5.62006C11.8725 5.49731 11.8011 5.38516 11.7101 5.29006L6.7101 0.29006C6.61714 0.196332 6.50654 0.121935 6.38468 0.0711665C6.26282 0.0203976 6.13212 -0.00573972 6.0001 -0.00573974C5.86809 -0.00573975 5.73739 0.0203976 5.61553 0.0711664C5.49367 0.121935 5.38307 0.196331 5.2901 0.290059C5.19638 0.383023 5.12198 0.493622 5.07121 0.615482C5.02044 0.737341 4.99431 0.868047 4.99431 1.00006C4.99431 1.13207 5.02044 1.26278 5.07121 1.38464C5.12198 1.50649 5.19638 1.61709 5.2901 1.71006L8.5901 5.00006L1.0001 5.00006C0.734888 5.00006 0.480533 5.10541 0.292997 5.29295C0.105461 5.48049 0.000104499 5.73484 0.000104475 6.00006C0.000104452 6.26527 0.105461 6.51963 0.292997 6.70716C0.480533 6.8947 0.734888 7.00006 1.0001 7.00006Z",fill:"#F6F6F6"})})}),(0,o.jsx)("button",{className:"next swiper-nav-right previous-button swiper-nav-btn",onClick:()=>{scroll("right"),m("right")},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:(0,o.jsx)("path",{d:"M1.0001 7.00006L8.5901 7.00006L5.2901 10.2901C5.1018 10.4784 4.99601 10.7338 4.99601 11.0001C4.99601 11.2664 5.1018 11.5218 5.2901 11.7101C5.47841 11.8984 5.7338 12.0041 6.0001 12.0041C6.26641 12.0041 6.5218 11.8984 6.7101 11.7101L11.7101 6.71006C11.8011 6.61495 11.8725 6.50281 11.9201 6.38006C12.0201 6.1366 12.0201 5.86352 11.9201 5.62006C11.8725 5.49731 11.8011 5.38516 11.7101 5.29006L6.7101 0.29006C6.61714 0.196332 6.50654 0.121935 6.38468 0.0711665C6.26282 0.0203976 6.13212 -0.00573972 6.0001 -0.00573974C5.86809 -0.00573975 5.73739 0.0203976 5.61553 0.0711664C5.49367 0.121935 5.38307 0.196331 5.2901 0.290059C5.19638 0.383023 5.12198 0.493622 5.07121 0.615482C5.02044 0.737341 4.99431 0.868047 4.99431 1.00006C4.99431 1.13207 5.02044 1.26278 5.07121 1.38464C5.12198 1.50649 5.19638 1.61709 5.2901 1.71006L8.5901 5.00006L1.0001 5.00006C0.734888 5.00006 0.480533 5.10541 0.292997 5.29295C0.105461 5.48049 0.000104499 5.73484 0.000104475 6.00006C0.000104452 6.26527 0.105461 6.51963 0.292997 6.70716C0.480533 6.8947 0.734888 7.00006 1.0001 7.00006Z",fill:"#F6F6F6"})})})]})},I=t(60487),_=t(43493);function FeedWhoToFollow_templateObject(){let n=(0,d._)(["\n border-radius: 10px;\n color: ",';\n overflow: hidden;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n font-family: "Work Sans", sans-serif;\n height: fit-content;\n min-height: 274px;\n /* padding-bottom: 0.5rem; */\n /* min-height: 150px; */\n\n p {\n margin: 0px;\n }\n\n .wtft {\n font-weight: 600;\n padding-top: 1rem;\n padding-left: 1rem;\n margin-bottom: -0.5rem;\n font-size: 20px;\n }\n\n .user-container {\n display: flex;\n flex-direction: column;\n /* gap: 1rem; */\n\n .user {\n padding: 0.75rem 1rem;\n transition-duration: 0.5s;\n\n .user-info {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n img {\n width: 37px;\n height: 37px;\n border-radius: 50%;\n flex-shrink: 0;\n }
1\n\n .names {\n line-height: 1.3;\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n .full-name {\n font-weight: 500;\n font-size: 17px;\n }\n\n .username {\n font-size: 14px;\n color: grey;\n }\n\n .follow-user-btn {\n display: flex;\n align-items: center;\n\n button {\n background: none;\n border: none;\n outline: none;\n width: 100px;\n font-weight: 500;\n border-radius: 20px;\n height: 35px;\n\n font-size: 15px;\n }\n\n .follow {\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(30, 156, 237, 0.6);\n color: rgba(255, 255, 255, 0.87);\n border: 1px solid rgba(30, 156, 237, 0.7);\n transition-duration: 0.2s;\n\n :hover {\n transition-duration: 0.2s;\n background-color: rgba(30, 156, 237, 0.8);\n border: 1px solid rgba(30, 156, 237, 1);\n }\n }\n\n .followed {\n background-color: none;\n color: rgba(255, 255, 255, 0.87);\n border: 1px solid rgba(30, 156, 237, 0.3);\n color: rgba(128, 128, 128, 1);\n font-weight: 400;\n transition-duration: 0.2s;\n }\n }\n }\n }\n\n .bio {\n font-size: 14px;\n font-weight: 500;\n margin-top: 0.75rem;\n margin-left: 3rem;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n /* font-weight: 500; */\n }\n\n :hover {\n transition-duration: 0.5s;\n background: ',";\n }\n }\n\n .user:last-child {\n padding-bottom: 1rem;\n }\n }\n\n .loader {\n transform: scale(0.8);\n margin-top: -1rem;\n }\n\n .react-loading-skeleton {\n --base-color: ",";\n --highlight-color: ",";\n }\n"]);return FeedWhoToFollow_templateObject=function(){return n},n}let O=m.default.div.withConfig({componentId:"sc-554477f5-0"})(FeedWhoToFollow_templateObject(),n=>"dark"===n.theme.mode?"rgba(255, 255, 255, 0.87)":"black",n=>"dark"===n.theme.mode?"#22293a":"#f7f7f7",n=>"dark"===n.theme.mode?"#343541":"#ebebeb",n=>"dark"===n.theme.mode?"#3d3f4c":"#f5f5f5");var profile_FeedWhoToFollow=function(){let n=(0,a.v9)(F.f8),[e,t]=(0,i.useState)([]),[r,s]=(0,i.useState)([]);return(0,i.useEffect)(()=>{(async function(){try{let n=await fetch("/api/community/getWhoToFollow?limit=10"),e=await n.json();t(e.users)}catch(n){console.log(n)}})()},[]),(0,i.useEffect)(()=>{let e=sessionStorage.getItem("userFollowing");async function getUserFollowers(){let e=await fetch("/api/community/getFollowing",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n})}),t=await e.json();s(t.userFollowing),sessionStorage.setItem("userFollowing",JSON.stringify(t.userFollowing))}n&&(e&&void 0!==e?s(JSON.parse(e)||[]):getUserFollowers())},[n]),(0,o.jsxs)(O,{children:[(0,o.jsx)("p",{className:"wtft",children:"Who to follow"}),(0,o.jsx)("div",{className:"user-container",children:0!=e.length?(0,o.jsx)(o.Fragment,{children:e.map(e=>{if(n!=e.uid)return(0,o.jsx)(y(),{href:"/community/profile/@".concat(e.username),legacyBehavior:!0,children:(0,o.jsxs)("div",{className:"user nes-pointer",children:[(0,o.jsxs)("div",{className:"user-info",children:[(0,o.jsx)("img",{src:e.photoURL,alt:"user pfp"}),(0,o.jsxs)("div",{className:"names",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"full-name",children:e.name}),(0,o.jsxs)("p",{className:"username",children:["@",e.username]})]}),(0,o.jsx)(_.Z,{following:r,userToFollowUid:e.uid,setFollowing:s})]})]}
1),(null==e?void 0:e.bio)&&(0,o.jsx)("p",{className:"bio",children:e.bio})]},e.uid)},e.uid)})}):(0,o.jsx)("div",{className:"loader",children:(0,o.jsx)(b.Z,{})})})]})};function TrendingFeed_templateObject(){let n=(0,d._)(["\n ",' {\n min-height: calc(100vh - 4.2rem);\n\n .secondary-container {\n display: grid;\n grid-template-columns: 1fr;\n gap: 1rem;\n }\n\n .feed-container {\n padding-left: 1rem;\n padding-right: 1rem;\n .post-feed {\n display: grid;\n gap: 0.5rem;\n }\n\n .toggle {\n font-family: "Work Sans", sans-serif;\n color: ',";\n display: flex;\n gap: 1rem;\n margin: 1rem auto;\n\n button {\n all: unset;\n color: #808080;\n text-align: center;\n font-size: 15px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px;\n position: relative;\n cursor:\n url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAzElEQVRYR+2X0Q6AIAhF5f8/2jYXZkwEjNSVvVUjDpcrGgT7FUkI2D9xRfQETwNIiWO85wfINfQUEyxBG2ArsLwC0jioGt5zFcwF4OYDPi/mBYKm4t0U8ATgRm3ThFoAqkhNgWkA0jJLvaOVSs7j3qMnSgXWBMiWPXe94QqMBMBc1VZIvaTu5u5pQewq0EqNZvIEMCmxAawK0DNkay9QmfFNAJUXfgGgUkLaE7j/h8fnASkxHTz0DGIBMCnBeeM7AArpUd3mz2x3C7wADglA8BcWMZhZAAAAAElFTkSuQmCC)\n 14 0,\n pointer;\n }\n\n .current-feed {\n color: ",";\n text-align: center;\n\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n }\n\n .bottom-bar {\n position: absolute;\n height: 2px;\n border-radius: 30px;\n width: 100%;\n background-color: ",";\n }\n }\n\n .transition-opacity {\n transition:\n opacity 0.3s ease-in-out,\n margin 0.3s ease-in-out;\n /* transition: opacity 0.15s ease-in-out; */\n }\n }\n\n .right-sidebar {\n display: none;\n position: relative;\n z-index: 8;\n\n .sticky-bar {\n position: sticky;\n top: 5rem;\n width: 100%;\n height: calc(100vh - 19rem);\n overflow: auto;\n\n ::-webkit-scrollbar,\n ::-webkit-scrollbar-thumb {\n width: 5px;\n }\n }\n }\n }\n\n "," {\n .secondary-container {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .feed-container {\n padding-left: 1rem;\n padding-right: 1rem;\n }\n\n .right-sidebar {\n display: none;\n }\n }\n\n "," {\n .secondary-container {\n grid-template-columns: minmax(0, 5fr) 2.25fr;\n }\n\n .feed-container {\n padding-left: 0rem;\n padding-right: 0rem;\n }\n\n .right-sidebar {\n display: flex;\n }\n }\n"]);return TrendingFeed_templateObject=function(){return n},n}let z=m.default.div.withConfig({componentId:"sc-5b7732fb-0"})(TrendingFeed_templateObject(),n=>{let{theme:e}=n;return e.breakpoints.xs},n=>"dark"===n.theme.mode?"rgba(255, 255, 255, 0.87)":"black",n=>"dark"===n.theme.mode?"rgba(255, 255, 255, 0.87)":"black",n=>"dark"===n.theme.mode?"rgba(255, 255, 255, 0.87)":"black",n=>{let{theme:e}=n;return e.breakpoints.sm},n=>{let{theme:e}=n;return e.breakpoints.md});var community_TrendingFeed=function(n){let{isSignedIn:e,setShowPostForm:t,allPosts:r,setAllPosts:a,postFormLink:s,communityName:l,postLink:c,CommunityBanner:d,clubOnly:m,noMorePosts:v,loadedImage:y,didAllImageLoad:j=!0,placeholder:k="What's new?",onlyAdminsCanPost:N=!1,isUserAdmin:A=!1,setTab:F,tab:C,projects:S}=n,[_,O]=(0,i.useState)(1),[E,P]=(0,i.useState)(!0),[U,L]=(0,i.useState)(!1),[D,Z]=(0,i.useState)(0),B=(0,i.useRef)(null);(0,i.useEffect)(()=>{function saveScrollPosition(){Z(window.scrollY)}return window.addEventListener("scroll",saveScrollPosition),()=>window.removeEventListener("scroll",saveScrollPosition)},[]),(0,i.useEffect)(()=>{let n=B.current;if(n){let e=n.scrollTop;setTimeout(()=>{n.scrollTop=e},0)}},[D]),(0,i.useEffect)(()=>{L(!0)},[]),(0,i.useEffect)(()=>{v?P(!1):P(!0)},[v]),(0,i.useEffect)(()=>{O(1)},[C]);let T=(0,i.useCallback)(async()=>{try{let n=_+1,e=sessionStorage.getItem("userFollowing"),t=["/api/community/getTrendingPosts?page=".concat(n),"/api/community/getLatestPosts?page=".concat(n),"/api/community/getFollowingPosts?followingList=".concat(e,"&page=").concat(n)],o=await fetch(t[C]),i=await o.json(),r=i.posts;0!=r.length&&(O(n),a(n=>[...n,...r])),r.length<2&&P(!1)}catch(n){console.error("Error fetching more posts:",n)}},[_,C,a]),M=function(n){let e=document.cookie.split(";");for(let t=0;t<e.length;t++){let o=e[t].trim();if(o.startsWith(n+"="))return o.substring(n.length+1)}return null}("codedextoken");return(0,o.jsxs)(z,{isSignedIn:e,children:[d,(0,o.jsxs)("div",{className:"secondary-container",children:[(0,o.jsxs)("div",{className:"feed-container",style:{marginTop:N?"1rem":"0rem"},children:[(0,o.jsx)(community_ProjectCarousal,{allPosts:S}),!N&&(0,o.jsx)(u.Z,{isSignedIn:e,setShowPostForm:t,postFormLink:s,clubOnly:m,placeholder:k,removeIfLoggedOut:!0}),A&&(0,o.jsx)(u.Z,{isSignedIn:e,setShowPostForm:t,postFormLink:s,clubOnly:m,placeholder:k,removeIfLoggedOut:!0}),(0,o.jsxs)("div",{className:"toggle",children:[(0,o.jsxs)("button",{className:0==C&&"current-feed",onClick:()=>F(0),children:["Top",0===C&&(0,o.jsx)("div",{className:"bottom-bar"})]}),(0,o.jsxs)("button",{className:1==C&&"current-feed",onClick:()=>F(1),children:["Newest",1==C&&(0,o.jsx)("div",{className:"bottom-bar"})]}),M&&(0,o.jsxs)("button",{className:2==C&&"current-feed",onClick:()=>F(2),children:["Following",2==C&&(0,o.jsx)("div",{className:"bottom-bar"})]})]}),(0,o.jsx)(x.Z,{dataLength:r.length,next:T,hasMore:E,loader:(0,o.jsx)(b.Z,{}),children:(0,o.jsx)("div",{className:"post-feed ".concat(U?"transition-opacity":""),style:{opacity:U?"1":"0",marginTop:U?"0rem":"4rem"},children:r&&r.map((n,e)=>{var t;if(null==n?void 0:null===(t=n.authorData)||void 0===t?void 0:t.username)return"project-showcase"===n.communityName?(0,o.jsx)(h.Z,{postData:n,communityName:l,link:"/community/project-showcase/".concat(n.id),index:e,loadedImage:y},e):"monthly-challenge"===n.communityName&&n.monthlyChallenge?(0,o.jsx)(o.Fragment,{}):(0,o.jsx)(p.Z,{postData:n,communityName:l,link:"main"===n.communityName?"".concat(c,"/").concat(n.id):"monthly-challenge"===n.communityName?"/community/monthly-challenge/submission/".concat(n.id):"/community/".concat(n.communityName,"/").concat(n.id),index:e,loadedImage:y},e)})})}),!E&&2===C&&(0,o.jsx)(profile_FeedWhoToFollow,{})]}),(0,o.jsx)("div",{className:"right-sidebar",children:(0,o.jsxs)("div",{className:"sticky-bar",ref:B,style:{height:D>220?"calc(100vh - 6rem)":"calc(100vh - 16rem + ".concat(D,"px)")},children:[(0,o.jsx)(g.Z,{}),(0,o.jsx)(f.Z,{}),(0,o.jsx)(I.Z,{}),(0,o.jsx)(w.Z,{})]})})]})]})},E=t(51894),P=t(88215),U=t(51539),L=t(8956),D=t(60028),Z=!0,outdated_community=function(n){let{posts:e,noPosts:t,projects:d}=n,m=(0,r.useRouter)(),u=(0,a.v9)(F.f8);(0,a.v9)(F.o4),(0,a.v9)(F.IC);let p=(0,a.v9)(F.ot),h=(0,a.v9)(F.nU),g=h>=100,[f,b]=(0,i.useState)(null),[x,w]=(0,i.useState)(!1),[v,y]=(0,i.useState)(!1),[j,k]=(0,i.useState)(e),[N,A]=(0,i.useState)(t),[C,S]=(0,i.useState)(0),[I,_]=(0,i.useState)(0),[O,z]=(0,i.useState)(0);console.log(d);let Z=(0,i.useCallback)(async()=>{let n=await fetch("/api/community/getFollowing",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:u})}),e=await n.json();return sessionStorage.setItem("userFollowing",JSON.stringify(e.userFollowing)),e.userFollowing},[u]),B=(0,i.useCallback)(async()=>
1{if(2===C){let n=JSON.parse(sessionStorage.getItem("userFollowing"));if(n){let e=await fetch("/api/community/getFollowingPosts?followingList=".concat(JSON.stringify(n))),t=await e.json(),o=t.posts;o.length<2&&A(!0),k(o)}else{let n=await Z(),e=await fetch("/api/community/getFollowingPosts?followingList=".concat(JSON.stringify(n))),t=await e.json(),o=t.posts;(o.length<2||void 0===o)&&A(!0),k(o)}}else{var n;let e=await fetch(["/api/community/getTrendingPosts","/api/community/getLatestPosts"][C]),t=await e.json(),o=t.posts;null===(n=o[0])||void 0===n||n.postId,o.length<2&&A(!0),k(o);let i=0;o.forEach(n=>{0!=n.images.length&&(i+=1)}),_(i)}},[C]);return(0,i.useEffect)(()=>{null!=f&&(k([]),A(!1),B())},[B]),(0,i.useEffect)(()=>{null==f&&b(!0)},[C,f]),(0,i.useEffect)(()=>{let n=localStorage.getItem("dontShowMakeIntroPopup");async function checkPopupStatus(){let n=await fetch("/api/community/getPopupStatus",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:u,popupName:"opc-welcome"})}),e=await n.json();e.seen||w(!0)}let e=m.query.invite;"true"!=n&&("success"===e||g)&&checkPopupStatus()},[m,g,u]),(0,i.useEffect)(()=>{u&&Z()},[u,Z]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.Z,{}),(0,o.jsx)(c.Z,{h1:"Community"}),v&&(0,o.jsx)(E.Z,{setShowPostForm:y,allPosts:j,setAllPosts:k}),(0,o.jsx)(s.Z,{children:(0,o.jsxs)(L.Z,{children:[(0,o.jsx)(D.Z,{path:m.pathname,postLink:"/community/post"}),(0,o.jsx)("div",{className:"main-container",children:(0,o.jsx)(community_TrendingFeed,{isSignedIn:p,setShowPostForm:y,allPosts:j,setAllPosts:k,postFormLink:"/community/post",communityName:"main",postLink:"/community/post",CommunityBanner:(0,o.jsx)(P.Z,{}),clubOnly:!1,noMorePosts:N,loadedImage:function(){let n=O+1;n>I||z(O+=1)},didAllImageLoad:O>=I,setTab:S,tab:C,projects:d})})]})}),(0,o.jsx)(U.Z,{})]})}},16840:function(){},18161:function(){}},function(n){n.O(0,[1272,8700,1057,3777,3874,955,6556,4617,2013,5937,4774,4090,4153,1622,9280,286,6095,8849,719,9428,2163,4793,6490,9433,8614,9774,2888,179],function(){return n(n.s=15247)}),_N_E=n.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.