PageSourceSearch

https://www.codedex.io/_next/static/chunks/pages/community/create-6890857662b7c9c3.js

js codedex.io collected 2026-09-25 14:55:48 UTC 47,385 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4800],{26375:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/community/create",function(){return t(50928)}])},54319:function(e,n,t){"use strict";var o=t(85893),r=t(67294),i=t(5434);let a={python:{displayName:"Python",internaleName:"python",imageLink:"/images/editor/python-logo.png"},html:{displayName:"HTML",internaleName:"html",imageLink:"/images/editor/html-logo.png"},css:{displayName:"CSS",internaleName:"css",imageLink:"/images/editor/css-logo.png"},javascript:{displayName:"JavaScript",internaleName:"javascript",imageLink:"/images/editor/javascript-logo.png"},"framework-valley-react":{displayName:"React",internaleName:"framework-valley-react",imageLink:"/images/framework-valley-react/react-icon.webp"},java:{displayName:"Java",internaleName:"java",imageLink:"https://cdn3.emoji.gg/emojis/java.png"}};n.Z=function(e){let{setSelectedCourse:n,selectedCourse:t,router:l}=e,s=(0,r.useRef)(null),[c,d]=(0,r.useState)(!1),[u,p]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{var e;let t=null==l?void 0:null===(e=l.query)||void 0===e?void 0:e.courseType,o=a[t];o&&(n(o),p(!0))},[l,n]),(0,o.jsxs)("div",{className:"community-selector ".concat(!u&&"nes-pointer"),ref:s,children:[t?(0,o.jsxs)("div",{className:"selector",onClick:()=>void(u||d(!c)),style:{borderBottomLeftRadius:c&&"0px",borderBottomRightRadius:c&&"0px"},children:[(0,o.jsx)("img",{src:t.imageLink,alt:t.displayName}),(0,o.jsx)("p",{children:t.displayName}),!u&&(0,o.jsx)(i.Ix0,{className:"arrow ".concat(c?"dropped":""),size:20})]}):(0,o.jsxs)("div",{className:"selector not-selected",onClick:()=>void(u||d(!c)),style:{borderBottomLeftRadius:c&&"0px",borderBottomRightRadius:c&&"0px"},children:[(0,o.jsx)("p",{children:"Pick a course"}),(0,o.jsx)(i.Ix0,{className:"arrow ".concat(c?"dropped":""),size:20})]}),c&&(0,o.jsx)("div",{className:"list",children:Object.keys(a).map(e=>{let t=a[e];return(0,o.jsxs)("div",{className:"item",onClick:()=>{n(a[t.internaleName]),d(!1)},children:[(0,o.jsx)("img",{src:t.imageLink,alt:t.displayName}),(0,o.jsx)("p",{children:t.displayName})]},e)})})]})}},31935:function(e,n,t){"use strict";t.d(n,{Z:function(){return community_VideoUploadTracker}});var o=t(82729),r=t(85893),i=t(19521),a=t(609),l=t(9473),s=t(67294),c=t(39828),functions_useUploadProgress=function(e){let[n,t]=(0,s.useState)({videoProgress:0,thumbNailProgress:0}),o=(0,c.ad)();return(0,s.useEffect)(()=>{let n=(0,c.JU)(o,"uploadProgress",e),r=(0,c.cf)(n,e=>{let n=e.data();if(n){let{video:e,thumbnail:o}=n,r=Math.round(e),i=Math.round(o);t({videoProgress:r,thumbNailProgress:i})}});return()=>r()},[e,o]),n},d=t(47010);function _templateObject(){let e=(0,o._)(['\n  padding: 16px 16px;\n  border-radius: 7px;\n  font-family: "Mulish", sans-serif;\n  flex: 1;\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n\n  p {\n    color: ',';\n  }\n\n  .uploading {\n    display: flex;\n    flex-direction: column;\n\n    .progress {\n      font-weight: 700;\n      font-size: 20px;\n      text-align: end;\n      font-family: "Mulish", sans-serif;\n    }\n\n    .progress-bar {\n      height: 5px;\n      border-radius: 5px;\n      transition: background 0.1s ease;\n    }\n  }\n\n  .video-label {\n    font-weight: 600;\n    /* margin-top: 8px; */\n  }\n\n  .status-text {\n    font-size: 14px;\n    color: ',";\n  }\n\n  .redirected {\n    display: flex;\n    flex-direction: column;\n    /* align-items: center; */\n    /* margin-top: 1rem; */\n    /* text-align: center; */\n    gap: 1rem;\n    color: ",";\n  }\n"]);return _templateObject=function(){return e},e}let u=i.default.div.withConfig({componentId:"sc-e022437c-0"})(_templateObject(),e=>{let{theme:n}=e;return"dark"==n.mode?n.colors.palette.grey["300"]:n.colors.palette.grey["600"]},e=>{let{theme:n}=e;return"dark"==n.mode?n.colors.palette.grey["400"]:n.colors.palette.grey["600"]},e=>{let{theme:n}=e;return"dark"==n.mode?n.colors.palette.grey["300"]:n.colors.palette.grey["600"]});var community_VideoUploadTracker=function(e){let{textContent:n,uid:t,showTracker:o}
1=e,i=(0,l.v9)(a.o4)||"dark",c="dark"===i,[p,m]=(0,s.useState)(0),h=functions_useUploadProgress(t);(0,s.useEffect)(()=>{0!=h.videoProgress&&m(h.videoProgress)},[h]);let g={pending:{border:c?"#854D0E":"#FEF08A",background:c?"#422006":"#FEFCE8",textAccent:c?"#FEF08A":"#854D0E"},complete:{border:c?"#3F6212":"#D9F99D",background:c?"#1A2E05":"#F7FEE7",textAccent:c?"#D9F99D":"#3F6212"},incomplete:{border:c?"#64748B":"#CBD5E1",background:c?"#0F172A":"#F8FAFC",textAccent:c?"#D9F99D":"#64748B"}}[100===p?"complete":"incomplete"];if(o)return(0,r.jsxs)(u,{style:{border:"2px solid ".concat(g.border),backgroundColor:g.background},children:[(0,r.jsxs)("div",{className:"uploading",children:[(0,r.jsxs)("p",{className:"progress",style:{color:100===p?"#A3E635":"#14ADFF"},children:[p,"%"]}),(0,r.jsx)("p",{className:"progress-bar",style:{background:"linear-gradient(to right, ".concat(100===p?"#A3E635":"#14ADFF"," ").concat(p,"%, ").concat(c?"#1E293B":"#F1F5F9"," ").concat(p,"%)")}})]}),(0,r.jsx)("p",{className:"video-label",children:100===p?"Video uploaded":"Video uploading"}),100!=p&&(0,r.jsx)("p",{className:"status-text",children:"It will take a while to upload long videos. Make sure to keep your browser tab open to avoid upload interruptions."}),100===p&&(0,r.jsxs)("p",{className:"status-text redirected",children:["You will be taken to your posts shortely (๑˃ᴗ˂)ﻭ",(0,r.jsx)(d.Z,{color:"#A3E635"})]})]})}},85712:function(e,n,t){"use strict";var o=t(85893);n.Z=function(e){let{color:n="#64748B",...t}=e;return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",...t,children:(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 2.5H4H20H22V18.5H20H17V20.5H15V18.5H9V20.5H7V18.5H4H2V2.5ZM7 20.5V22.5H5V20.5H7ZM17 20.5V22.5H19V20.5H17ZM20 4.5H4V16.5H20V4.5ZM12 8.5H14V10.5H12V8.5ZM10 12.5V10.5H12V12.5H10ZM10 12.5V14.5H8V12.5H10ZM16 12.5H14V10.5H16V12.5ZM16 12.5H18V14.5H16V12.5ZM8 6.5H6V8.5H8V6.5Z",fill:"#64748B"})})}},74796:function(e,n,t){"use strict";var o=t(82729),r=t(85893),i=t(19521);function _templateObject(){let e=(0,o._)(["\n  background-color: ",';\n  font-family: "Mulish", sans-serif;\n  padding-top: 3.9rem;\n\n  p {\n    margin: 0px;\n  }\n  display: flex;\n\n  '," {\n    .desktop-community-nav {\n      display: none;\n    }\n  }\n\n  "," {\n    .desktop-community-nav {\n      display: none;\n    }\n  }\n\n  "," {\n    .desktop-community-nav {\n      display: none;\n    }\n  }\n\n  "," {\n    .desktop-community-nav {\n      display: flex;\n    }\n  }\n"]);return _templateObject=function(){return e},e}let a=i.default.div.withConfig({componentId:"sc-f4a70080-0"})(_templateObject(),e=>{let{theme:n}=e;return n.colors.background.grey.primary},e=>{let{theme:n}=e;return n.breakpoints.xs},e=>{let{theme:n}=e;return n.breakpoints.sm},e=>{let{theme:n}=e;return n.breakpoints.md},e=>{let{theme:n}=e;return n.breakpoints.lg});n.Z=function(e){let{children:n}=e;return(0,r.jsx)(a,{children:n})}},52861:function(e,n,t){"use strict";var o=t(82729),r=t(85893),i=t(19521);function _templateObject(){let e=(0,o._)(["\n  flex: 1;\n  display: flex;\n  justify-content: center;\n  gap: 24px;\n  min-height: 100vh;\n  max-width: 100%;\n\n  "," {\n    padding: 24px 0px 0px 0px;\n\n    &.single-post-feed {\n      padding: 20px 16px;\n    }\n\n    .sidebar {\n      display: none;\n    }\n\n    .community-channel-banner {\n      display: none;\n    }\n\n    .mobile-community-nav {\n      display: flex;\n    }\n  }\n\n  "," {\n    padding: 24px;\n\n    &.single-post-feed {\n      padding: 24px 40px 0px 40px;\n      gap: 40px;\n    }\n\n    .sidebar {\n      display: flex;\n    }\n\n    .community-channel-banner {\n      display: flex;\n    }\n\n    .mobile-community-nav {\n      display: none;\n    }\n  }\n\n  "," {\n  }\n\n  "," {\n  }\n"]);return _templateObject=function(){return e},e}let a=i.default.div.withConfig({componentId:"sc-57e440b1-0"})(_templateObject(),e=>{let{theme:n}=e;return n.breakpoints.xs},e=>{let{theme:n}=e;return n.breakpoints.sm},e=>{let{theme:n}=e;return n.breakpoints.md},e=>{let{theme:n}=e;return n.breakpoints.lg});n.Z=function(e){let{children:n,...t}=e;return(0,r.jsx)(a,{...t,children:n})}},72264:function(e,n,t){"use strict";var o=t(82729),r=t(85893),i=t(19521),a=t(41664),l=t.n(a),s=t(11163),c=t(67294),d=t(609),u=t(9473);
1function _templateObject(){let e=(0,o._)(["\n  padding: 10px;\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  border-radius: 8px;\n  /* background: ",";\n  border: 2px solid #14adff; */\n  border: 2px solid transparent;\n\n  &.current {\n    /* border: 2px solid #14adff; */\n    background: ",";\n\n    p {\n      color: ",";\n    }\n\n    svg {\n      path {\n        fill: ",";\n      }\n    }\n  }\n\n  :hover {\n    transition-duration: 0.2s;\n    background: ",";\n\n    p {\n      color: ",";\n    }\n\n    svg {\n      path {\n        fill: ",";\n      }\n    }\n  }\n\n  p {\n    margin: 0px;\n    color: ",";\n    font-size: 16px;\n    font-style: normal;\n    font-weight: 600;\n    line-height: 150%;\n  }\n\n  svg {\n    path {\n      fill: ",";\n    }\n  }\n\n  .new-post-indicator {\n    width: 8px;\n    height: 8px;\n    background-color: ",";\n    border-radius: 50%;\n    position: absolute;\n    left: -4px;\n  }\n"]);return _templateObject=function(){return e},e}let p=i.default.div.withConfig({componentId:"sc-dc660846-0"})(_templateObject(),e=>{let{theme:n}=e;return n.colors.background.blue.primary},e=>{let{theme:n}=e;return n.colors.background.blue.primary},e=>{let{theme:n}=e;return n.colors.text.accent.blue},e=>{let{theme:n}=e;return n.colors.text.accent.blue},e=>{let{theme:n}=e;return n.colors.background.blue.primary},e=>{let{theme:n}=e;return n.colors.text.accent.blue},e=>{let{theme:n}=e;return n.colors.text.accent.blue},e=>{let{theme:n}=e;return n.colors.text.primary},e=>{let{theme:n}=e;return n.colors.text.tertiary},e=>{let{theme:n}=e;return n.colors.text.primary});n.Z=function(e){let{channel:n}=e,t=(0,s.useRouter)(),o=(0,u.v9)(d.f8),i=t.asPath.includes("community/".concat(null==n?void 0:n.internalName)),a=(0,c.useMemo)(()=>JSON.parse(sessionStorage.getItem("newPostToSee-".concat(null==n?void 0:n.internalName)))||!1,[null==n?void 0:n.internalName]),[m,h]=(0,c.useState)(a);return(0,c.useEffect)(()=>{async function channelReadStatus(){let e=await fetch("/api/community/getChannelReadStatus?communityName=".concat(null==n?void 0:n.internalName,"&uid=").concat(o)),t=await e.json(),r=t.read;h(!r)}o&&channelReadStatus()},[null==n?void 0:n.internalName,o]),(0,c.useEffect)(()=>{sessionStorage.setItem("newPostToSee-".concat(null==n?void 0:n.internalName),JSON.stringify(m))},[m,null==n?void 0:n.internalName]),(0,c.useEffect)(()=>{let e=t.query.channel===(null==n?void 0:n.internalName);m&&e&&h(!1)},[t.query.channel,m,null==n?void 0:n.internalName]),(0,r.jsx)(l(),{href:"/community/".concat(n.internalName),style:{textDecoration:"none"},children:(0,r.jsxs)(p,{className:"nes-pointer ".concat(i&&"current"),children:[m&&o&&(0,r.jsx)("div",{className:"new-post-indicator"}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H8V8L4 8V10H8V14H4V16H8V20H10V16L14 16V20H16V16H20V14H16V10H20V8L16 8V4H14V8L10 8V4ZM10 10V14L14 14V10L10 10Z",fill:"#020617"})}),(0,r.jsx)("p",{children:n.displayName})]})})}},82077:function(e,n,t){"use strict";var o=t(82729),r=t(85893),i=t(19521),a=t(37719),l=t(78777),s=t(85712),c=t(61716),d=t(72264);function _templateObject(){let e=(0,o._)(["\n  flex-shrink: 0;\n  width: 260px;\n  position: sticky;\n  top: 3.9rem;\n  height: calc(100vh - 3.9rem);\n  padding: 12px 12px;\n  overflow: auto;\n\n  display: flex;\n  flex-direction: column;\n  gap: 16px;\n  border-right: 2px solid ",";\n  \n  .regular-channels {\n    display: flex;\n    flex-direction: column;\n    gap: 8px;\n\n    .channel-label {\n      padding: 0px 12px;\n      color: ",";\n      font-size: 12px;\n      font-weight: 600;\n      line-height: 150%;\n      letter-spacing: 1.68px;\n      text-transform: uppercase;\n    }\n  }\n"]);return _templateObject=function(){return e},e}let u=i.default.div.withConfig({componentId:"sc-250a310a-0"})(_templateObject(),e=>{let{theme:n}=e;return n.colors.border.grey.light},e=>{let{theme:n}=e;return n.colors.text.tertiary});n.Z=function(){let e=[{name:"Home",icon:(0,r.jsx)(l.Z,{}),link:"/community",internalName:"home"},{name:"Leaderboards",icon:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 5H13H15V7V19V21H13H11H9V19V7V5H11ZM13 19V7H11V19H13ZM6 11H4H2V13V19V21H4H6H8V19V13V11H6ZM6 13H4V19H6V13ZM18 15H20H22V17V19V21H20H18H16V19V17V15H18ZM20 19V17H18V19H20Z",fill:"#64748B"})}),link:"/community/leaderboards",internalName:"leaderboards"},{name:"Project Showcase",icon:(0,r.jsx)(s.Z,{}),link:"/community/project-showcase",internalName:"project-showcase"},{name:"Monthly Challenge",icon:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0001 2H7.99988H5.99988V4L4 4H2V6V12H3.99988V14L5.99988 14H7.99988V6H8V4L16.0001 4V6V14L18 14L18.0001 14L20 14V12H21.9999V6H22.0001V4H21.9999H19.9999H18.0001V2H17.9999H16.0001ZM19.9999 6V12H18.0001V6H19.9999ZM5.99988 12H4V6H5.99988V12ZM15.9999 14H7.99988V16H15.9999V14ZM10.9999 16.0001H12.9999V20H15.9999V22H7.99988V20H10.9999V16.0001Z",fill:"#64748B"})}),link:"/community/monthly-challenge",internalName:"monthly-challenge"},{name:"#30NitesOfCode",icon:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 1H15.5V3H11.5V5V7H7.5V9H5.5V5H7.5V3H9.5V1ZM17.5 21V23H7.5V21H5.5V19H3.5V9H5.5V15H9.5V17H11.5V21H17.5ZM17.5 19V21H19.5V19H20.5H21.5V9H19.5V5H17.5V3H15.5V5H17.5V9H19.5V16H17.5V19ZM16.5 10H12.5V14H16.5V10Z",fill:"#64748B"})}),link:"/community/30-nites-of-code",internalName:"30-nites-of-code"}],n=(0,a.cg)();return(0,r.jsxs)(u,{className:"desktop-community-nav",children:[(0,r.jsx)("div",{className:"priority-channels",children:e.map(e=>(0,r.jsx)(c.Z,{channel:e},e.name))}),(0,r.jsxs)("div",{className:"regular-channels",children:[(0,r.jsx)("p",{className:"channel-label",children:"Channels"}),(0,r.jsx)("div",{className:"channels",children:n.map(e=>(0,r.jsx)(d.Z,{channel:e},e.internalName))})]})]})}},61716:function(e,n,t){"use strict";var o=t(82729),r=t(85893),i=t(41664),a=t.n(i),l=t(11163),s=t(19521);
1function _templateObject(){let e=(0,o._)(["\n  padding: 10px;\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  border-radius: 8px;\n  /* background: ",";\n  border: 2px solid #14adff; */\n  border: 2px solid transparent;\n\n  &.current {\n    /* border: 2px solid #14adff; */\n    background: ",";\n    color: ",";\n\n    p {\n      color: ",";\n    }\n\n    svg {\n      path {\n        fill: ",";\n      }\n    }\n  }\n\n  :hover {\n    transition-duration: 0.2s;\n    background: ",";\n\n    p {\n      color: ",";\n    }\n\n    svg {\n      path {\n        fill: ",";\n      }\n    }\n  }\n\n  p {\n    margin: 0px;\n    color: ",";\n    font-size: 16px;\n    font-style: normal;\n    font-weight: 600;\n    line-height: 150%;\n  }\n"]);return _templateObject=function(){return e},e}let c=s.default.div.withConfig({componentId:"sc-357e5de7-0"})(_templateObject(),e=>{let{theme:n}=e;return n.colors.background.blue.primary},e=>{let{theme:n}=e;return n.colors.background.blue.primary},e=>{let{theme:n}=e;return n.colors.text.accent.blue},e=>{let{theme:n}=e;return n.colors.text.accent.blue},e=>{let{theme:n}=e;return n.colors.text.accent.blue},e=>{let{theme:n}=e;return n.colors.background.blue.primary},e=>{let{theme:n}=e;return n.colors.text.accent.blue},e=>{let{theme:n}=e;return n.colors.text.accent.blue},e=>{let{theme:n}=e;return n.colors.text.secondary});n.Z=function(e){let{channel:n}=e,t=(0,l.useRouter)(),o=t.asPath.includes(null==n?void 0:n.internalName),i="/community"===t.asPath&&"Home"===n.name;return(0,r.jsx)(a(),{href:n.link,style:{textDecoration:"none"},children:(0,r.jsxs)(c,{className:"nes-pointer ".concat((o||i)&&"current"),children:[n.icon,(0,r.jsx)("p",{children:n.name})]})})}},73859:function(e,n,t){"use strict";t.d(n,{K:function(){return PostFields},N:function(){return usePostFields}});var o=t(85893),r=t(67294),i=t(12238),a=t.n(i),l=t(74448),s=t(33363),c=t(79705),d=t(54319);let u=new(a()),stripHtml=e=>(null!=e?e:"").replace(/<[^>]*>/g," "),p=["project-showcase","monthly-challenge"],m=["checkpoint-project","final-project"],h=[{key:"title",Component:l.Z,initial:e=>{var n;return null!==(n=null==e?void 0:e.title)&&void 0!==n?n:""},bind:(e,n)=>({title:e,setTitle:n}),validate:e=>(null==e?void 0:e.length)?null:"Title is required.",validateOnSubmit:e=>u.isProfane(e)?"Please remove profanity from your post before publishing.":null},{key:"content",Component:c.Z,initial:e=>{var n;return null!==(n=null==e?void 0:e.content)&&void 0!==n?n:""},bind:(e,n)=>({value:e,setPostMainContent:n}),props:e=>({selectedCommunity:e.communityName,enableInlineImages:"monthly-challenge"===e.communityName,inlineImagePostId:e.postId,placeholder:"introduction"===e.communityName?"Tell us where you are from, what you are working on, and a fun fact about yourself!":"Whats on your mind?"}),validate:(e,n)=>(null==e?void 0:e.length)?"introduction"===n.communityName&&e.length<100?"Intros need at least 100 characters.":null:"Content is required.",validateOnSubmit:e=>u.isProfane(stripHtml(e))?"Please remove profanity from your post before publishing.":null},{key:"projectLink",Component:s.Z,initial:e=>{var n;return null!==(n=null==e?void 0:e.projectLink)&&void 0!==n?n:""},bind:(e,n)=>({value:e,setValue:n}),visible:e=>p.includes(e.communityName),props:()=>({label:"Demo Link (optional)",labelDescription:"Add a link to your project/submission, if applicable.",placeholder:"e.g. https://project-name.vercel.app"})},{key:"codeLink",Component:s.Z,initial:e=>{var n;return null!==(n=null==e?void 0:e.codeLink)&&void 0!==n?n:""},bind:(e,n)=>({value:e,setValue:n}),visible:e=>p.includes(e.communityName),props:()=>({label:"Code Link (optional)",labelDescription:"Add a link to your project code or repository, if applicable.",placeholder:"e.g. https://github.com/user/repo-name"})},{key:"projectSubmissionForCourse",Component:d.Z,initial:e=>(null==e?void 0:e.projectSubmissionForCourse)?{internaleName:e.projectSubmissionForCourse}:void 0,bind:(e,n)=>({selectedCourse:e,setSelectedCourse:n}),props:e=>({router:e.router}),visible:e=>"create"===e.mode&&m.includes(e.communityName),toDoc:e=>null==e?void 0:e.internaleName}];function usePostFields(e,n){var t;let[o,i]=(0,r.useState)(()=>Object.fromEntries(h.map(n=>[n.key,n.initial(e)]))),a=(0,r.useCallback)((e,n)=>{i(t=>({...t,[e]:n}))},[]),l=(0,r.useMemo)(()=>h.filter(e=>!e.visible||e.visible(n)),[n.mode,n.communityName,n.postId,n.isAdmin]),s=null!==(t=l.map(e=>{var t;return null===(t=e.validate)||void 0===t?void 0:t.call(e,o[e.key],n)}).find(Boolean))&&void 0!==t?t:null;return{values:o,set:a,visible:l,blockingError:s,getSubmitError:()=>{var e;return null!==(e=l.map(e=>{var t;return null===(t=e.validateOnSubmit)||void 0===t?void 0:t.call(e,o[e.key],n)}).find(Boolean))&&void 0!==e?e:null},docFields:()=>(function(e,n,t){let o={};for(let r of n){let n=r.toDoc?r.toDoc(e[r.key],t):e[r.key];void 0!==n&&(o[r.key]=n)}return o}
1)(o,l,n)}}function PostFields(e){let{visible:n,values:t,set:r,ctx:i}=e;return(0,o.jsx)(o.Fragment,{children:n.map(e=>{var n;let{key:a,Component:l,bind:s,props:c}=e;return(0,o.jsx)(l,{...s(t[a],e=>r(a,e)),...null!==(n=null==c?void 0:c(i))&&void 0!==n?n:{}},a)})})}},80334:function(e,n,t){"use strict";var o=t(82729),r=t(85893),i=t(19521),a=t(9473),l=t(609),s=t(46331),c=t(67294),d=t(73845),u=t(3649);function _templateObject(){let e=(0,o._)(['\n  flex-shrink: 0;\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  gap: 12px;\n  z-index: 4;\n  font-family: "Mulish", sans-serif;\n\n  &.small {\n    .toggle {\n      padding: 6px 10px;\n    }\n  }\n\n  .postin-label {\n    color: ',";\n\n    font-size: 16px;\n    font-style: normal;\n    font-weight: 700;\n    line-height: 150%;\n\n    span {\n      color: #f43f5e;\n    }\n  }\n\n  .toggle {\n    padding: 12px 16px;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    background-color: ",";\n\n    p {\n      color: ",";\n      font-size: 16px;\n      font-weight: 700;\n      line-height: 150%;\n    }\n\n    svg {\n      transition-duration: 0.2s;\n      path {\n        fill: ",";\n      }\n    }\n  }\n\n  .dropdown {\n    position: absolute;\n    width: inherit;\n    top: 120%;\n    box-shadow: 0px 5px 16px 0px ",";\n    border-radius: 20px;\n\n    .inner-dropwdown {\n      padding: 8px;\n      background-color: ",";\n\n      p {\n        padding: 8px 12px;\n        color: ",";\n\n        font-size: 16px;\n        font-style: normal;\n        font-weight: 700;\n        line-height: 150%;\n        border-radius: 4px;\n\n        :hover {\n          color: ",";\n          background-color: ",";\n        }\n      }\n    }\n  }\n"]);return _templateObject=function(){return e},e}let p=i.default.div.withConfig({componentId:"sc-b4dbf83-0"})(_templateObject(),e=>{let{theme:n}=e;return n.colors.text.primary},e=>{let{theme:n}=e;return n.colors.background.grey.secondary},e=>{let{theme:n}=e;return n.colors.text.primary},e=>{let{theme:n}=e;return n.colors.border.grey.dark},e=>{let{theme:n}=e;return n.colors.background.grey.boxshadow},e=>{let{theme:n}=e;return n.colors.background.grey.primary},e=>{let{theme:n}=e;return n.colors.text.primary},e=>{let{theme:n}=e;return n.colors.text.accent.blue},e=>{let{theme:n}=e;return n.colors.background.grey.tertiary});n.Z=function(e){var n;let{selectedListItem:t,setSelectedListItem:o,listItems:i,disableLabel:m=!1,width:h=198,label:g="Post in",small:f=!1}=e;(0,d.T)();let y=(0,a.v9)(l.o4)||"dark",x="dark"===y,[b,v]=(0,c.useState)(!1),w=(0,a.v9)(l.S5);return(0,r.jsxs)(p,{style:{width:h},className:"".concat(f&&"small"),children:[!m&&(0,r.jsxs)("p",{className:"postin-label",children:[g,(0,r.jsx)("span",{children:"*"})]}),(0,r.jsxs)(u.Z,{className:"toggle nes-pointer",borderColor:b?"14ADFF":x?"64748B":"94A3B8",onClick:()=>v(!b),children:[(0,r.jsx)("p",{children:null===(n=i[t])||void 0===n?void 0:n.displayName}),(0,r.jsx)(s.Z,{style:{transform:b?"rotate(90deg)":"rotate(-90deg)"}})]}),b&&(0,r.jsx)("div",{className:"dropdown",children:(0,r.jsx)(u.Z,{className:"inner-dropwdown",borderColor:x?"64748B":"94A3B8",children:Object.keys(i).map(e=>{let n=i[e];if("question-of-the-week"!==n.internaleName||w)return(0,r.jsx)("p",{className:"item nes-pointer",onClick:()=>{o(n.internaleName),v(!b)},children:n.displayName},e)})})})]})}},33363:function(e,n,t){"use strict";var o=t(82729),r=t(85893),i=t(19521),a=t(99281);function _templateObject(){let e=(0,o._)(["\n  .labels {\n    display: flex;\n    flex-direction: column;\n    gap: 8px;\n\n    .head-label {\n      color: ",";\n      font-size: 16px;\n      font-style: normal;\n      font-weight: 700;\n      line-height: 150%;\n      span {\n        color: #f43f5e;\n      }\n    }\n\n    .label-description {\n      color: ",";\n      font: 14px;\n      font-weight: 500;\n      line-height: 150%;\n    }\n  }\n\n  input {\n    ::placeholder {\n      font-weight: 700;\n      color: ",";\n    }\n  }\n"]);return _templateObject=function(){return e},e}let l=i.default.div.withConfig({componentId:"sc-e7d09849-0"}
1)(_templateObject(),e=>{let{theme:n}=e;return n.colors.text.primary},e=>{let{theme:n}=e;return n.colors.text.tertiary},e=>{let{theme:n}=e;return n.colors.text.tertiary});n.Z=function(e){let{value:n,setValue:t,placeholder:o="Post Title",label:i,labelDescription:s=null,required:c=!1}=e;return(0,r.jsxs)(l,{className:"postform-title",children:[(0,r.jsxs)("div",{className:"labels",children:[(0,r.jsxs)("p",{className:"head-label",children:[i,c&&(0,r.jsx)("span",{children:"*"})]}),s&&(0,r.jsx)("p",{className:"label-description",children:s})]}),(0,r.jsx)(a.Z,{setValue:t,value:n,placeholder:o})]})}},79705:function(e,n,t){"use strict";var o=t(82729),r=t(85893),i=t(19521),a=t(67294);function _templateObject(){let e=(0,o._)(["\n  display: flex;\n  flex-direction: column;\n  gap: 4px;\n\n  .title {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    .body-label {\n      color: ",";\n      font-size: 16px;\n      font-style: normal;\n      font-weight: 700;\n      line-height: 150%;\n      margin-bottom: 8px;\n\n      span {\n        color: #f43f5e;\n      }\n    }\n\n    .min-counter {\n      display: flex;\n      color: ",";\n      gap: 0.5rem;\n\n      .num {\n        font-weight: 600;\n      }\n    }\n  }\n"]);return _templateObject=function(){return e},e}let l=(0,a.lazy)(()=>Promise.all([t.e(8700),t.e(2013),t.e(7603),t.e(4153),t.e(286),t.e(6095),t.e(155),t.e(6207),t.e(3280),t.e(5434)]).then(t.bind(t,33280))),s=i.default.div.withConfig({componentId:"sc-43861c6d-0"})(_templateObject(),e=>{let{theme:n}=e;return n.colors.text.primary},e=>{let{theme:n}=e;return n.colors.text.secondary});n.Z=function(e){let{setPostMainContent:n,value:t,selectedCommunity:o=null,title:i="Body",placeholder:c="Whats on your mind?",required:d=!0,enableInlineImages:u=!1,inlineImagePostId:p=null}=e;return(0,r.jsxs)(s,{children:[(0,r.jsxs)("div",{className:"title",children:[(0,r.jsxs)("p",{className:"body-label",children:[i,d&&(0,r.jsx)("span",{children:"*"})]})," ","introduction"===o&&(0,r.jsxs)("div",{className:"min-counter",children:[(0,r.jsx)("p",{children:"Min:"}),(0,r.jsxs)("p",{className:"num",children:[t.length,"/100"]})]})]}),(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(l,{setPostMainContent:n,value:t,placeholder:c,enableInlineImages:u,inlineImagePostId:p})})]})}},74448:function(e,n,t){"use strict";var o=t(82729),r=t(85893),i=t(19521),a=t(99281);function _templateObject(){let e=(0,o._)(["\n  .title-label {\n    color: ",";\n\n    font-size: 16px;\n    font-style: normal;\n    font-weight: 700;\n    line-height: 150%;\n    span {\n      color: #f43f5e;\n    }\n  }\n\n  .title-description {\n    margin: 8px 0px 12px 0px;\n    color: ",";\n    font-size: 14px;\n    font-weight: 700;\n    line-height: 150%;\n  }\n\n  input {\n    ::placeholder {\n      font-weight: 700;\n      color: ",";\n    }\n  }\n"]);return _templateObject=function(){return e},e}let l=i.default.div.withConfig({componentId:"sc-75d7c8aa-0"})(_templateObject(),e=>{let{theme:n}=e;return n.colors.text.primary},e=>{let{theme:n}=e;return n.colors.text.tertiary},e=>{let{theme:n}=e;return n.colors.text.tertiary});n.Z=function(e){let{title:n,setTitle:t,placeholder:o="Post Title",description:i="Create a short, but fun overview for your post! Can the reader understand what the post is about just by looking at the title?"}=e;return(0,r.jsxs)(l,{className:"postform-title",children:[(0,r.jsxs)("p",{className:"title-label",children:["Title",(0,r.jsx)("span",{children:"*"})]})," ",(0,r.jsx)("p",{className:"title-description",children:i}),(0,r.jsx)(a.Z,{setValue:t,value:n,placeholder:o,maxLength:80})]})}},57870:function(e,n,t){"use strict";async function extractThumbnail(e){return new Promise(n=>{let t=document.createElement("video");t.src=URL.createObjectURL(e),t.crossOrigin="anonymous",t.currentTime=.5,t.onloadeddata=()=>{let e=document.createElement("canvas");e.width=t.videoWidth,e.height=t.videoHeight;let o=e.getContext("2d");o.drawImage(t,0,0,e.width,e.height);let r=e.toDataURL("image/webp");n(r)}})}t.d(n,{Z:function(){return extractThumbnail}})},74990:function(e,n,t){"use strict";
1var o=t(82729),r=t(85893),i=t(19521),a=t(46331),l=t(11163);function _templateObject(){let e=(0,o._)(["\n  display: flex;\n  align-items: center;\n  gap: 16px;\n\n  .arrow-container {\n    svg {\n      path {\n        fill: ",";\n      }\n    }\n  }\n\n  p {\n    color: ",';\n    font-feature-settings:\n      "liga" off,\n      "clig" off;\n    font-family: "PixelGridM";\n    font-size: 24px;\n    font-weight: 700;\n    letter-spacing: 0.72px;\n  }\n']);return _templateObject=function(){return e},e}let s=i.default.div.withConfig({componentId:"sc-d2ef2e2c-0"})(_templateObject(),e=>{let{theme:n}=e;return n.colors.text.tertiary},e=>{let{theme:n}=e;return n.colors.text.primary});n.Z=function(e){let{text:n="Post",community:t=null,submissionFor:o=null}=e,i=(0,l.useRouter)(),{query:{re:c}}=i;return(0,r.jsxs)(s,{className:"nes-pointer",onClick:()=>{if(c){let e="home"===c?"/community":"/community/".concat(c);i.push(e);return}if(!t){i.back();return}if("monthly-challenge"===t){i.push(o?"/community/monthly-challenge/".concat(o,"/submissions"):"/community/monthly-challenge");return}i.push("/community/".concat(t))},children:[(0,r.jsx)("div",{className:"arrow-container",children:(0,r.jsx)(a.Z,{})}),(0,r.jsx)("p",{children:n})]})}},37719:function(e,n,t){"use strict";t.d(n,{A3:function(){return getChannelMetaInfo},Dz:function(){return canMoveCommunityPost},Lm:function(){return getMovableChannels},cg:function(){return getFilteredChannels}});let o=[{displayName:"Cod\xe9dex Community",internalName:"home",description:"Let's make magic together ⋆˙⟡",imgSrc:"/images/community/bouncer.gif",longDescription:"Your home base for the Cod\xe9dex community. Catch up on announcements, see what everyone's building, and jump into the conversation."},{displayName:"Leaderboards",internalName:"leaderboards",description:"Compete with other users and rise to the top ٩(。•́‿•̀。)۶",imgSrc:"/images/community/trophy.gif",longDescription:"See how you stack up against other learners. Earn XP, climb the ranks, and cheer on the coders at the top."},{displayName:"Project Showcase",internalName:"project-showcase",description:"Showcase something that you built (੭˃ᴗ˂)੭",imgSrc:"/images/community/rocket.gif",longDescription:"Built something you're proud of? Share it here for feedback, inspiration, and a little bit of applause from the community."},{displayName:"Monthly Challenge",internalName:"monthly-challenge",description:"Let's make magic together ⋆˙⟡",imgSrc:"/images/community/bouncer.gif",longDescription:"A fresh coding challenge every month to keep your skills sharp. Take part, compare notes with others, and level up together."},{displayName:"General",internalName:"main",description:"Community-wide conversations ◡̈",imgSrc:"/images/community/bouncer.gif",longDescription:"The place for everything and anything. Chat with fellow learners about whatever's on your mind."},{displayName:"Question of the Week",internalName:"question-of-the-week",description:"Join a new conversation every week",imgSrc:"https://gifdb.com/images/high/pixel-art-8bit-subaru-duck-kfvqxp9q2x0l5m30.gif",imageBackground:"#AEFFFF",longDescription:"A new question drops every week to spark discussion. Share your take and see how others answered."},{displayName:"Introductions",internalName:"introduction",description:"Say hi to the community *_*",imgSrc:"/images/community/wave.png",longDescription:"Welcome to the community! Get yourself started by introducing yourself to fellow learners. This is short copy meant to give context on purpose of the channel."},{displayName:"Python",internalName:"python",description:"Everything Python including Python libraries!",imgSrc:"/images/editor/python-logo.png",imageBackground:"#AEFFFF",longDescription:"Talk all things Python here, from syntax questions to your favorite libraries and frameworks."},{displayName:"Web Development",internalName:"web-dev",description:"All things web: HTML, CSS, JavaScript, and more!",imgSrc:"https://hwencc.gallerycdn.vsassets.io/extensions/hwencc/html-tag-wrapper/0.2.3/1505878793186/Microsoft.VisualStudio.Services.Icons.Default",imageBackgroun
1d:"#E4BE03",longDescription:"Dive into HTML, CSS, JavaScript, and everything else that makes the web work. Ask questions, share resources, and swap tips."},{displayName:"Tech News",internalName:"tech-news",description:"Stay updated with the latest industry news",imgSrc:"/images/community/news.png",longDescription:"Keep up with what's happening in tech. Share interesting articles, product launches, and industry updates worth talking about."},{displayName:"Career",internalName:"career",description:"A place to share career advice, opportunities, or related things.",imgSrc:"/images/community/career-suitcase.avif",longDescription:"Trade career advice, job opportunities, resume tips, and interview stories with fellow coders navigating the industry."},{displayName:"Memes",internalName:"meme",description:"Slacking off at work t(-.-t)",imgSrc:"https://gifdb.com/images/high/comedian-el-risitas-warp-face-kekw-meme-0bf8c28fx7xo9a1x.gif",longDescription:"Need a laugh? Post and enjoy the best coding memes the community has to offer."},{displayName:"Pets",internalName:"pets",description:"Share cute animal pics \uD83D\uDC36 \uD83D\uDC31 \uD83D\uDC39 \uD83D\uDC30 \uD83D\uDC38",imgSrc:"/images/community/mochi_avatar.png",longDescription:"A cozy corner for cute animal pics. Show off your furry, feathered, or scaly friends."},{displayName:"#30NitesOfCode",internalName:"30-nites-of-code",description:"Join our community-wide challenge of learning and building for 30-days. Start today!",imgSrc:"/images/code-nights/dragon.gif",imageBackground:"#CEA8EB",longDescription:"30 nights, one goal: build the coding habit. Check in daily, share your progress, and keep each other motivated."},{displayName:"Bug Reports",internalName:"bug-report",description:"Found a bug? \uD83D\uDC1B Report it here.",imgSrc:"/images/community/bug-reports (1).png",imageBackground:"#CEA8EB",hideTopPosts:!0,longDescription:"Spotted something broken on Cod\xe9dex? Let us know here so we can track it down and squash it."}],r=["home","leaderboards","monthly-challenge","project-showcase","30-nites-of-code","question-of-the-week"];function canMoveCommunityPost(e){return!r.includes(e)}function getMovableChannels(){return o.filter(e=>!r.includes(e.internalName))}function getChannelMetaInfo(e){let{channel:n}=e;return o.find(e=>e.internalName===n)}function getFilteredChannels(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["home","monthly-challenge","project-showcase","leaderboards","30-nites-of-code"];return o.filter(n=>!e.includes(n.internalName))}},73664:function(e,n,t){"use strict";t.d(n,{oH:function(){return getUserPostCommentsRef},x:function(){return getUserPostsRef}});var o=t(39828),r=t(92369);function getUserPostsRef(e){let{uid:n}=e,{firestore:t}=(0,r.UM)(),i=(0,o.JU)((0,o.hJ)(t,"users"),n,"community","posts");return i}function getUserPostCommentsRef(e){let{uid:n}=e,{firestore:t}=(0,r.UM)(),i=(0,o.JU)((0,o.hJ)(t,"users"),n,"community","comments");return i}},12860:function(e,n,t){"use strict";t.d(n,{eY:function(){return generatePostId},pz:function(){return getImageDimensions},qb:function(){return createPost},zl:function(){return s}});var o=t(39828),r=t(92369),i=t(73664),a=t(16689),l=t(48764).Buffer;let s=5;async function getImageDimensions(e){try{if("function"==typeof createImageBitmap){let n=await createImageBitmap(e),t={width:n.width,height:n.height};return n.close(),t}}catch(e){console.error("Error measuring image with createImageBitmap:",e)}return new Promise(n=>{let t=URL.createObjectURL(e),o=new Image;o.onload=()=>{URL.revokeObjectURL(t),n({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=()=>{URL.revokeObjectURL(t),n(null)},o.src=t})}function generatePostId(){let{firestore:e}=(0,r.UM)();return(0,o.JU)((0,o.hJ)(e,"community")).id}async function createPost(e){let{communityName:n,uid:t,fields:c={},title:d,content:u,imageFile:p,imageFiles:m,videoFiles:h,parentPostId:g,postId:f,type:y="post",targetCollection:x="community"}=e,{firestore:b}=(0,r.UM)(),v=(0,o.qs)(b);if("post"===y){if(!n||!t||!c.title||void 0===c.content)throw Error("which community, uid, title, and description are required fields.");try{let e=await fetch("/api/community/createPostCheck");if(200!==e.status)return{status:500,post:null}}catch(e){return console.error("Error creating post:",e),{status:500,post:null}}let e=(0,i.x)({uid:t}),r=(0,o.JU)(b,"uploadProgress",t);async function updateProgress(e,n){await (0,o.pl)(r,{[e]:n},{merge:!0})}try{let r=(0,o.hJ)(b,x,n,"posts"),i=f?(0,o.JU)(r,f):(0,o.JU)(r),d={...c,ownerUid:t,createdAt:(0,o.Bt)(),parent:null,postId:i.id,communityName:n,images:[],videoFiles:[],userComments:0,userLikes:0,userReports:0,reports:[],pinnedByOwner:!1},u=(null==m?void 0:m.length)?m:p?[p]:[];if(u.length>s)return console.error("Posts can include at most ".concat(s," images, received ").concat(u.length,".")),{status:400,post:null};if(u.length>0)try{let e=(0,a.cF)();d.images=await Promise.all(u.map(async(t,o)=>{let r=(0,a.iH)(e,"".concat(x,"/").concat(n,"/post/").concat(i.id,"/").concat(o,"_").concat(t.name)),[,l]=await Promise.all([(0,a.KV)(r,t),getImageDimensions(t)]),s=await (0,a.Jt)(r);return l?{url:s,...l}:{url:s}}))}catch(e){return console.error("Error uploading images:",e),{status:500,post:null}}if(h)try{let e,t,o;let r=(0,a.cF)(),{video:s,thumbNail:c,videoDimensions:u,backgroundImage:p}=h,m=(0,a.iH)(r,"".concat(x,"/").concat(n,"/post/").concat(i.id,"/").concat(s.name)),g=(0,a.B0)(m,s);c&&(t=(0,a.iH)(r,"".concat(x,"/").concat(n,"/post/").concat(i.id,"/").concat(c.name)),e=(0,a.B0)(t,c)),g.on("state_changed",async e=>{let n=e.bytesTransferred/e.totalBytes*100;await updateProgress("video",n)}),e&&e.on("state_changed",async e=>{let n=e.bytesTransferred/e.totalBytes*100;await updateProgress("thumbnail",n)});let f=null;if(p)try{let e=p.split(",")[1],t=l.from(e,"base64"),o=new Blob([t],{type:"image/jpeg"}),s=(0,a.iH)(r,"".concat(x,"/").concat(n,"/post/").concat(i.id,"/backgroundimage.webp")),c=(0,a.B0)(s,o);c.on("state_changed",async e=>{let n=e.bytesTransferred/e.totalBytes*100;await updateProgress("backgroundImage",n)}),await c,f=await (0,a.Jt)(s)}catch(e){console.error("Error uploading background image:",e)}let y=null,b=[g.then(async()=>{o=await (0,a.Jt)(m),await updateProgress("video",0)})];e&&b.push(e.then(async()=>{y=await (0,a.Jt)(t),await updateProgress("thumbnail",0)})),await Promise.all(b),d.videoFiles.push({videoUrl:o,thumbNailUrl:y,videoDimensions:u,backgroundImageUrl:f})}catch(e){return console.error("Error uploading files:",e),{status:500,post:null}}d.videoFiles.length?d.images=[]:d.images.length&&(d.videoFiles=[]),v.set(i,d),v.set(e,{postIds:(0,o.vr)(i.id)},{merge:!0}),await v.commit();let g=await (0,o.QT)(i),y=g.data();return{status:200,post:y}}catch(e){return console.error(e),{status:500,post:null}}}else{if(!t)throw Error("uid, title, and description are required fields.");
1let e=(0,i.oH)({uid:t});try{let r=(0,o.hJ)(b,x,n,"posts"),i=(0,o.JU)(r),l={ownerUid:t,title:d,images:[],content:u,createdAt:(0,o.Bt)(),parent:{id:g},postId:i.id,communityName:n,userLikes:0,userReports:0};if(p)try{if((null==p?void 0:p.type)=="giphy-upload"){var w;l.images.push({url:null==p?void 0:null===(w=p.acceptedFile)||void 0===w?void 0:w.imageUrl})}else{let e=(0,a.cF)(),t=null==p?void 0:p.acceptedFile,o=(0,a.iH)(e,"".concat(x,"/").concat(n,"/post/").concat(i.id,"/").concat(t.name));await (0,a.KV)(o,t);let r=await (0,a.Jt)(o);l.images.push({url:r})}}catch(e){return console.error("Error uploading image:",e),{status:500,post:null}}v.set(i,l),v.set(e,{commentIds:(0,o.vr)(i.id)},{merge:!0}),await v.commit();let s=await (0,o.QT)(i),c=s.data();return{status:200,post:c}}catch(e){return console.error(e),{status:500,post:null}}}}},16284:function(e,n,t){"use strict";t.d(n,{GB:function(){return extractMentionUsernames},_c:function(){return extractMentionUsernamesFromHtml},ok:function(){return splitTextOnMentions}});let o=/(^|[\s(])@([a-zA-Z0-9_](?:[a-zA-Z0-9_.-]{0,28}[a-zA-Z0-9_])?)/g,r=/data-mention="([^"]+)"/g;function dedupeAndCap(e){let n=[...new Set(e.map(e=>e.toLowerCase()))];return n.slice(0,5)}function extractMentionUsernames(e){if(!e)return[];let n=[...e.matchAll(o)].map(e=>e[2]);return dedupeAndCap(n)}function splitTextOnMentions(e){if(!e)return[];let n=[],t=0;for(let r of e.matchAll(o)){let o=r.index+r[1].length,i="@".concat(r[2]);o>t&&n.push({type:"text",value:e.slice(t,o)}),n.push({type:"mention",value:i}),t=o+i.length}return t<e.length&&n.push({type:"text",value:e.slice(t)}),n}function extractMentionUsernamesFromHtml(e){if(!e)return[];let n=[...e.matchAll(r)].map(e=>e[1]),t=e.replace(/<[^>]*>/g," "),i=[...t.matchAll(o)].map(e=>e[2]);return dedupeAndCap([...n,...i])}},50928:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSG:function(){return _},default:function(){return create}});var o=t(85893),r=t(99428),i=t(82077),a=t(74796),l=t(52861),s=t(82729),c=t(19521),d=t(67294),u=t(74990),p=t(80334),m=t(65884),h=t(73859),g=t(9473),f=t(609),y=t(16284),x=t(73845),b=t(85673),v=t(12860),w=t(11163),j=t(73857),k=t(31935),N=t(47010),H=t(57870),V=t(63248);function _templateObject(){let e=(0,s._)(["\n  padding: 0px 16px;\n  margin-bottom: 5rem;\n  margin-top: 24px;\n  width: 100%;\n  max-width: 700px;\n\n  display: flex;\n  flex-direction: column;\n  gap: 24px;\n\n  .upload-btn {\n    display: flex;\n    justify-content: flex-end;\n\n    button {\n      width: 170px;\n    }\n  }\n\n  .community-selector {\n    width: 200px;\n    -webkit-touch-callout: none;\n    -webkit-user-select: none;\n    -khtml-user-select: none;\n    -moz-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n    border: 2px solid ",";\n\n    p {\n      margin: 0px;\n      color: ",";\n    }\n\n    .selector {\n      height: 40px;\n      display: flex;\n      align-items: center;\n      border-color: ",";\n      gap: 0.5rem;\n      padding-left: 11.5px;\n      position: relative;\n      font-family: Mulish, sans-serif;\n      font-size: 16px;\n      font-weight: bold;\n      line-height: 150%;\n      color: ",";\n      img {\n        width: 30px;\n        height: 30px;\n      }\n      .arrow {\n        position: absolute;\n        right: 11.5px;\n        top: 9px;\n        color: rgba(128, 128, 128, 1);\n        transition-duration: 0.2s;\n      }\n\n      .dropped {\n        transition-duration: 0.2s;\n        transform: rotate(180deg);\n      }\n    }\n\n    .list {\n      width: 200px;\n      position: absolute;\n      z-index: 4;\n      background-color: ",";\n      border-top: none;\n      overflow: hidden;\n      margin-top: 15px;\n\n      .item:first-child {\n        margin-top: 5px;\n      }\n      .item {\n        height: 40px;\n        display: flex;\n        align-items: center;\n        gap: 0.5rem;\n        padding-left: 8px;\n        padding-right: 8px;\n        position: relative;\n        transition-duration: 0.2s;\n        width: 97%;\n        margin: 0 auto;\n\n        :hover {\n          transition-duration: 0.2s;\n          background: ",";\n          p {\n            color: ",";\n          }\n        }\n      }\n\n      img {\n        width: 30px;\n        height: 30px;\n      }\n    }\n  }\n"]);
1return _templateObject=function(){return e},e}let C=c.default.div.withConfig({componentId:"sc-2c22a50c-0"})(_templateObject(),e=>{let{theme:n}=e;return n.colors.semantic.border.grey.dark},e=>{let{theme:n}=e;return n.colors.semantic.text.primary},e=>{let{theme:n}=e;return n.colors.semantic.border.grey.dark},e=>{let{theme:n}=e;return n.colors.semantic.text.primary},e=>{let{theme:n}=e;return n.colors.background.grey.secondary},e=>{let{theme:n}=e;return n.colors.semantic.background.grey.tertiary},e=>{let{theme:n}=e;return n.colors.palette.blue["500"]}),P={main:{displayName:"General",internaleName:"main"},introduction:{displayName:"Introductions",internaleName:"introduction"},python:{displayName:"Python",internaleName:"python"},"web-dev":{displayName:"Web Dev",internaleName:"web-dev"},"tech-news":{displayName:"Tech News",internaleName:"tech-news"},meme:{displayName:"Memes",internaleName:"meme"},pets:{displayName:"Pets",internaleName:"pets"},career:{displayName:"Career",internaleName:"career"},"question-of-the-week":{displayName:"QOTW",internaleName:"question-of-the-week"},"bug-report":{displayName:"Bug Report",internaleName:"bug-report"}};var postForm_PostForm=function(){var e;let n=(0,w.useRouter)(),t=(0,x.T)(),r=(0,g.v9)(f.f8),i=(0,g.v9)(f.zr),a=(0,g.v9)(f.r),l=(0,g.v9)(f.Uq),[s,c]=(0,d.useState)("main"),[_,S]=(0,d.useState)([]),[Z,F]=(0,d.useState)([]),[M,D]=(0,d.useState)(!1),[I]=(0,d.useState)(()=>(0,v.eY)()),O={mode:"create",communityName:s,postId:I,isAdmin:!1,router:n},L=(0,h.N)(void 0,O),{handleBadgeEvent:E}=(0,V.g)();async function uploadPost(){let e;if(M)return;let o=L.getSubmitError();if(o){t((0,b.fz)({message:o}));return}D(!0);let c=L.docFields(),d=0==_.length||_[0].type.includes("video")?[]:_,u=0!=_.length&&_[0].type.includes("video")?{video:_[0],thumbNail:Z[0]?Z[0]:null}:null;if(u){let[e,n]=await Promise.all([new Promise(e=>{let n=document.createElement("video");n.src=URL.createObjectURL(u.video),n.onloadedmetadata=()=>{e({width:n.videoWidth,height:n.videoHeight})}}),(0,H.Z)(u.video)]);u={...u,videoDimensions:e,backgroundImage:n}}try{e=await (0,v.qb)({communityName:s,uid:r,postId:I,fields:c,imageFiles:d,videoFiles:u,type:"post",parentPostId:null})}catch(n){console.error("Error creating post:",n),e={status:500,post:null}}if(200===e.status){window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"});let t="main"===s?"/community/main/".concat(e.post.postId):"monthly-challenge"==s?"/community/monthly-challenge/submission/".concat(e.post.postId):"/community/".concat(s,"/").concat(e.post.postId),o=(0,y._c)(c.content);o.length>0&&fetch("/api/community/notifications/mention-trigger",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({usernames:o,postId:e.post.postId,postLink:t,postTitle:c.title,postContent:c.content,communityName:s,parentPostId:e.post.postId,context:"post",senderUid:r,senderUsername:i,senderName:a+" "+l})}),"introduction"===s&&E({badgeType:"hello-world"}),n.push(t),D(!1)}else t((0,b.fz)({message:"Something went wrong creating your post. Try again."})),D(!1)}return(0,d.useEffect)(()=>{var e;let t=null==n?void 0:null===(e=n.query)||void 0===e?void 0:e.channel;t?c(t):c("main")},[n]),(0,o.jsxs)(C,{children:[(0,o.jsx)(u.Z,{text:"Create a Post"}),(0,o.jsx)(p.Z,{selectedListItem:s,setSelectedListItem:c,listItems:P}),(0,o.jsx)(h.K,{visible:L.visible,values:L.values,set:L.set,ctx:O}),(0,o.jsx)(m.Z,{setDroppedFiles:S,droppedFiles:_,maxImages:v.zl,description:"Add up to ".concat(v.zl," images, or one video.")}),M&&(null===(e=_[0])||void 0===e?void 0:e.type.includes("video"))&&(0,o.jsx)(k.Z,{textContent:"This is a test",uid:r,showTracker:M}),M?(0,o.jsx)("div",{className:"upload-btn",children:(0,o.jsx)(j.Z,{children:(0,o.jsx)(N.Z,{})})}):(0,o.jsx)("div",{className:"upload-btn",children:(0,o.jsx)(j.Z,{onClick:()=>uploadPost(),disabled:!!L.blockingError,children:"Post"})})]})},_=!0,create=function(){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.Z,{learningEnv:"community"}),(0,o.jsxs)(a.Z,{children:[(0,o.jsx)(i.Z,{}),(0,o.jsx)(l.Z,{children:(0,o.jsx)(postForm_PostForm,{})})]})]})}}},function(e){e.O(0,[1272,8700,4153,1622,9280,2512,9428,5884,9774,2888,179],function(){return e(e.s=26375)}),_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.