PageSourceSearch

https://www.codedex.io/_next/static/chunks/pages/community/monthly…/submission/[post]-d638245aa767c79f.js

js codedex.io collected 2026-09-25 14:55:52 UTC 8,326 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1513],{51630:function(n,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/community/monthly-challenge/submission/[post]",function(){return t(35652)}])},5309:function(n,e,t){"use strict";var r=t(82729),a=t(85893),i=t(19521);function _templateObject(){let n=(0,r._)(["\n  width: 100%;\n  height: clamp(100px, 16vw, 140px);\n  overflow: hidden;\n  position: relative;\n  background-position: top center;\n\n  &.custom {\n    background-size: cover;\n    background-repeat: no-repeat;\n    background-position: center;\n  }\n\n  &.fallback {\n    background-size: auto 1050%;\n    background-repeat: repeat-x;\n  }\n"]);return _templateObject=function(){return n},n}let s=i.default.div.withConfig({componentId:"sc-e3919e9a-0"})(_templateObject());e.Z=function(n){let{image:e=null,isCustom:t=!1}=n;return e?(0,a.jsx)(s,{className:t?"custom":"fallback",style:{backgroundImage:'url("'.concat(e,'")')}}):null}},35652:function(n,e,t){"use strict";t.r(e),t.d(e,{__N_SSG:function(){return y},default:function(){return _post_}});var r=t(82729),a=t(85893),i=t(19521),s=t(99428),l=t(56403),o=t(52861),d=t(98426),c=t(5309),u=t(73857),m=t(67294),p=t(99281),h=t(79705),g=t(39828),x=t(92369);let{firestore:w}=(0,x.UM)();async function jamWinnerMarker(n){let{postId:e,awardTag:t="",awardNotes:r="",remove:a=!1,placed:i,winnerFor:s=""}=n;if(!e)throw Error("postId is a required field.");try{let n=(0,g.JU)(w,"community","monthly-challenge","posts",e);if(a){if(await (0,g.r7)(n,{winnerDetails:(0,g.AK)()}),s){let n=(0,g.JU)(w,"community","monthly-challenge","posts",s),t=await (0,g.QT)(n),r=t.exists()?t.data():null;if(Array.isArray(null==r?void 0:r.winners)){let t=r.winners.filter(n=>n!==e);await (0,g.r7)(n,{winners:t})}}}else{if(!s)throw Error("winnerFor is required when adding a winner.");let a=(0,g.JU)(w,"community","monthly-challenge","posts",s),l=await (0,g.QT)(a),o=l.exists()?l.data():null,d=Array.isArray(null==o?void 0:o.winners)?o.winners:[],c=d.includes(e)?d:[...d,e];await (0,g.r7)(n,{winnerDetails:{awardTag:t,awardNotes:r,winnerFor:s,placed:i}}),await (0,g.r7)(a,{winners:c})}return{status:200,message:"successful"}}catch(n){throw Error(n.message||"An error occurred.")}}var f=t(9473),b=t(609),j=t(63248);function _templateObject(){let n=(0,r._)(["\n  border-radius: 4px;\n  border: 2px solid ",";\n  background-color: ",";\n  padding: 16px;\n  margin-bottom: 1rem;\n\n  .default {\n    p {\n      color: ",";\n      font-size: 16px;\n      font-style: normal;\n      font-weight: 500;\n      line-height: 150%;\n      margin-bottom: 16px;\n\n      strong {\n        font-weight: 700;\n      }\n    }\n  }\n\n  .mark {\n    padding: 24px;\n    background-color: ",";\n    color: ",";\n    display: flex;\n    flex-direction: column;\n    gap: 24px;\n\n    .title {\n      .mark-label {\n        margin: 1rem 0px;\n        color: ",";\n      }\n\n      .body-label {\n        font-weight: 500 !important;\n        margin: 1rem 0px;\n        color: ",";\n      }\n    }\n\n    .placed-selector {\n      border: none;\n      outline: none;\n      background-color: ",";\n      color: ",";\n      max-width: 200px;\n      border-radius: 4px;\n      padding: 8px 12px;\n    }\n\n    .btn-container {\n      display: flex;\n      gap: 1rem;\n    }\n  }\n"]);return _templateObject=function(){return n},n}let v=i.default.div.withConfig({componentId:"sc-fbfe1a4e-0"})(_templateObject(),n=>{let{theme:e}=n;return e.colors.border.grey.medium},n=>{let{theme:e}=n;return e.colors.background.grey.secondary},n=>{let{theme:e}=n;return e.colors.text.primary},n=>{let{theme:e}=n;return e.colors.background.grey.tertiary},n=>{let{theme:e}=n;return e.colors.text.primary},n=>{let{theme:e}=n;return e.colors.text.tertiary},n=>{let{theme:e}=n;return e.colors.text.tertiary},n=>{let{theme:e}=n;return e.colors.background.grey.secondary},n=>{let{theme:e}=n;return e.colors.text.primary});var jams_JamWinnerMarker=function(n){let{postId:e,winnerFor:t,winnerDetails:r,ownerUid:i}=n,[s,l]=(0,m.useState)("default"),[o,d]=(0,m.useState)(null==r?void 0:r.awardTag),[c,g]=(0,m.useState)(null==r?void 0:r.awardNotes),[x,w]=(0,m.useState)(0),k=(0,f.v9)(b.S5),{handleBadgeEvent:y}=(0,j.g)();async function assignWinner(n){let{remove:r=!1}=n,a=await jamWinnerMarker({postId:e,awardTag:o,awardNotes:c,winnerFor:t,placed:x,remove:r});200==a.status&&(y({badgeType:"monthly-challenge-winner",opts:{uid:i}}),l("reviewed"))}(0,m.useEffect)(()=>{let n=null==r?void 0:r.winnerFor;n&&l("reviewed"),d((null==r?void 0:r.awardTag)||""),g((null==r?void 0:r.awardNotes)||""),w(null==r?void 0:r.placed)},[r]);let _={default:(0,a.jsxs)("div",{className:"default",children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Mark this 
1submission as a winner?"})," ",(0,a.jsx)("br",{})," The winner status will not be public until winners are made public in the Jam's settings."]}),(0,a.jsx)(u.Z,{onClick:()=>l("mark"),children:"Mark as winner"})]}),mark:(0,a.jsxs)("div",{className:"mark",children:[(0,a.jsxs)("div",{className:"title",children:[(0,a.jsx)("strong",{children:"Add an award title"}),(0,a.jsx)("p",{className:"mark-label",children:"This will appear as a tag on the submission detail page."}),(0,a.jsx)(p.Z,{placeholder:"E.g. Best First Time Hack",value:o,setValue:d})]}),(0,a.jsxs)("div",{className:"title",children:[(0,a.jsx)("strong",{children:"Add award notes"}),(0,a.jsx)(h.Z,{setPostMainContent:g,value:c,title:"This will appear as a tag on the submission detail page.",placeholder:"What makes this a winner? Also add notes and links to any prizes won.",required:!1})]}),(0,a.jsx)("strong",{children:"Enter placement (1st, 2nd, 3rd, etc.)"}),(0,a.jsx)("input",{type:"number",min:"1",className:"placed-selector",placeholder:"1",value:x,onChange:n=>w(Number(n.target.value))}),(0,a.jsxs)("div",{className:"btn-container",children:[(0,a.jsx)(u.Z,{variant:"subtle",onClick:()=>l("default"),children:"Cancel"}),(0,a.jsx)(u.Z,{onClick:()=>assignWinner({remove:!1}),disabled:!o||!c,children:"Submit"})]})]}),reviewed:(0,a.jsxs)("div",{className:"mark",children:[(0,a.jsx)("div",{className:"default",children:(0,a.jsxs)("p",{className:"winner",children:[(0,a.jsx)("strong",{children:"This submission has been marked as a winner"}),"."]})}),(0,a.jsxs)("div",{className:"btn-container",children:[(0,a.jsx)(u.Z,{variant:"subtle",onClick:()=>l("mark"),children:"Edit details"}),(0,a.jsx)(u.Z,{onClick:()=>{assignWinner({remove:!0}),l("default")},disabled:!o||!c,variant:"red",children:"Remove as winner"})]})]})};if(k)return(0,a.jsx)(v,{children:_[s]})};function _post_templateObject(){let n=(0,r._)(["\n  background-color: ",';\n  font-family: "Mulish", sans-serif;\n  padding-top: 3.9rem;\n  min-height: 100vh;\n\n  p {\n    margin: 0px;\n  }\n\n  .jam-content-wrapper {\n    display: flex;\n    justify-content: center;\n\n    '," {\n      padding: 0px;\n    }\n\n    "," {\n      padding: 40px 24px;\n    }\n\n    .jam-content {\n      width: 100%;\n      max-width: 1152px;\n      display: flex;\n      flex-direction: column;\n      gap: 40px;\n    }\n  }\n"]);return _post_templateObject=function(){return n},n}let k=i.default.div.withConfig({componentId:"sc-d39152e1-0"})(_post_templateObject(),n=>{let{theme:e}=n;return e.colors.background.grey.primary},n=>{let{theme:e}=n;return e.breakpoints.xs},n=>{let{theme:e}=n;return e.breakpoints.sm});var y=!0,_post_=function(n){let{post:e,parentBannerImage:t,parentBannerIsCustom:r}=n;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.Z,{learningEnv:"community"}),(0,a.jsxs)(k,{children:[(0,a.jsx)(c.Z,{image:(null==e?void 0:e.bannerImage)||t,isCustom:!!(null==e?void 0:e.bannerImage)||r}),(0,a.jsx)("div",{className:"jam-content-wrapper",children:(0,a.jsxs)(o.Z,{className:"single-post-feed",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(jams_JamWinnerMarker,{postId:null==e?void 0:e.postId,winnerFor:null==e?void 0:e.submissionFor,winnerDetails:null==e?void 0:e.winnerDetails,ownerUid:null==e?void 0:e.ownerUid}),(0,a.jsx)(l.Z,{post:e,headerType:"without-channel"})]}),(0,a.jsx)(d.Z,{authorData:null==e?void 0:e.authorData})]})})]})]})}}},function(n){n.O(0,[1272,8700,1057,3777,2013,5937,7603,4090,4153,1622,9280,286,6095,8849,2512,959,719,9428,2163,6207,5884,4561,8325,5388,4456,227,6131,9774,2888,179],function(){return n(n.s=51630)}),_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.