1"use strict";(self.webpackChunk_kaggle_workspace=self.webpackChunk_kaggle_workspace||[]).push([["3866"],{68145(e,t,n){n.d(t,{c:()=>tY});var r,i,a=n(40529),o=n(13749),l=n(27223),c=n(50638),u=n(55837),s=n(66302),p=n(6926),d=n(83399),m=n(14874),f=n(15327),h=n(96540),b=n(52575);function v(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function y(){var e=v(["\n position: fixed;\n top: 0;\n /** \n We want this component to sit on top of the navigation, to ensure that all user interactions go to this top bar.\n We still want kaggle hamburger icon in the left corner and user avatar in the right corner to be clickable - \n so we have to set left and right accordingly, to carve some space for those elements to be displayed in.\n\n We can't bump this to the nav layer (or above), because then the top bar will clip through the open left nav drawer.\n When two elements have the same z-index value, browsers should put the element that occurs later in the DOM on top,\n so it still works fine (nav gets rendered higher in the parent tree).\n */\n z-index: ",";\n\n left: ",";\n right: 64px;\n\n @media "," {\n /* Right offest keeps changing to follow the padding changes of the user avatar in the right side of the nav bar. */\n right: 86px;\n }\n\n @media "," {\n right: 108px;\n }\n\n @media "," {\n /**\n Equal offsets from left and right are needed to align the top bar content with the page content - \n if they are not equal, centering will not work properly. scrollbarWidth / 2 is added to offset \n for the same reason - page content has scrollbar, so we have to account for it's width in calculations\n here if we want to have the sections perfectly aligned.\n */\n left: calc("," + ","px);\n right: calc("," + ","px);\n }\n"]);return y=function(){return e},e}function g(){var e=v(["\n /* We have to position the divider separately - we want it to have full page width and a separate transition. */\n position: fixed;\n top: ","px;\n left: 0;\n right: 0;\n flex-grow: 1;\n\n box-shadow: ",";\n\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n ",";\n"]);return g=function(){return e},e}function E(){var e=v(["\n height: ","px;\n ","\n\n transform: translateY(","px);\n transition: transform 0.3s ease-in-out;\n ","\n"]);return E=function(){return e},e}var w="182px",k=b.default.div(y(),function(e){return e.theme.km.zIndex.navigationBehind},w,s.Ch.SM1,s.Ch.SM3,s.Ch.LG3,w,function(e){return e.$scrollbarWidth/2},w,function(e){return e.$scrollbarWidth/2}),S=(0,b.default)(m.c)(g(),p.k3,function(e){return e.theme.km.elevation.boxShadow[2]},function(e){return e.$visible&&"opacity: 1;"}),C=b.default.div(E(),p.k3,function(e){return e.theme.km.spacing.withContentBody},-p.k3,function(e){return e.$visible&&"transform: translateY(0);"}),I=function(e){var t=e.children,n=(0,u.l)(),r=(0,d.y)(),i=(0,f.A)(s.Ch.SM1);return h.createElement(h.Fragment,null,h.createElement(u.a,{height:"1px",ref:n.sentinelRef}),i&&h.createElement(k,{$scrollbarWidth:r},h.createElement(C,{$visible:n.isScrolled,inert:n.isScrolled?void 0:""},t)),h.createElement(S,{$visible:n.isScrolled}))},U=n(53630),x=n(65356),T=n(52982),D=n(53991),j=n(77382),O=n(64866),P=n(43676),W=n(42556),A=n(78256),z=n(77631),H=n(72433),L=n(87158),F=n(9075),_=n(55106),M=n(45853),B=n(19224);function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function N(e,t,n,r,i,a,o){try{var l=e[a](o),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,i)}function R(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){N(a,r,i,o,l,"next",e)}function l(e){N(a,r,i,o,l,"throw",e)}o(void 0)})}}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,l=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==i.return||i.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function J(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(o,"next",{value:c(0)}),l(o,"throw",{value:c(1)}),l(o,"return",{value:c(2)}),"function"==typeof Symbol&&l(o,Symbol.iterator,{value:function(){return this}}),o;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function K(){var e=G(["\n display: flex;\n gap: 16px;\n margin-bottom: 16px;\n"]);return K=function(){return e},e}function Z(){var e=G(["\n margin: 40px 0;\n display: flex;\n flex-direction: column;\n gap: 16px;\n"]);return Z=function(){return e},e}function q(){var e=G(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"]);return q=function(){return e},e}
1function V(){var e=G(["\n display: flex;\n flex-wrap: wrap;\n gap: 16px;\n"]);return V=function(){return e},e}var X=b.default.div(K()),Q=function(e){var t,n,r,i=e.competition,a=e.writeUp,o=e.hackathonWriteUpData,l=e.availableHackathonTracks,c=e.hackathonSettings,u=e.onUpdateWriteUp,s=e.isHostOrJudge,p=h.useContext(F.I).currentUser,d=p.isAdmin&&B.G5.hackathonDataAdmin,m=h.useMemo(function(){return(0,j.C7)()},[]),f=Y(h.useState(!1),2),b=f[0],v=f[1],y=Y(h.useState(!1),2),g=y[0],E=y[1],w=Y(h.useState(!1),2),k=w[0],S=w[1],C=Y(h.useState(!1),2),I=C[0],$=C[1],N=Y(h.useState([]),2),G=N[0],K=N[1],Z=h.useCallback(function(e,t){return K(function(n){return n.map(function(n,r){var i,a;return r===t?(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},n),a=a={authorName:e.target.value},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i):n})})},[]),q=h.useCallback(function(){return R(function(){var e;return J(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,M.sIG.hackathonService.getHackathonWriteUpAuthors({hackathonWriteUpId:o.id})];case 1:return K(t.sent().authors),[3,3];case 2:return e=t.sent(),(0,U.Z)(e),[3,3];case 3:return[2]}})})()},[o.id]),V=(0,T.q)({competition:i,hackathonWriteUpData:o,writeUp:a}),Q=Y(h.useState(0),2),er=Q[0],ei=Q[1],ea=null==(t=o.team)?void 0:t.id;if(h.useEffect(function(){d&&ea&&!c.allowMultipleSubmissions&&M.sIG.hackathonService.listHackathonWriteUps({competitionId:i.id,hackathonTrackIds:[],published:!0,teamId:ea}).then(function(e){return ei(e.hackathonWriteUps.length)}).catch(function(e){return(0,U.Z)(e)})},[d,ea,i.id,c.allowMultipleSubmissions]),!d)return null;var eo=a.contentState===_.z6.PUBLISHED,el=a.contentState===_.z6.DRAFT||a.contentState===_.z6.UNPUBLISHED,ec=!!i.launched&&!!i.deadline&&i.deadline<new Date,eu=i.deadline?(0,x.tA)(i.deadline):"the close date",es=p.id===o.ownerHostUserId||p.id===o.ownerJudgeUserId,ep=!!(null==(n=o.team)?void 0:n.teamMembers.map(function(e){return e.id}).includes(p.id)),ed=!c.allowMultipleSubmissions&&!!ea&&er>0,em=function(e){v(!1),E(!1),V.updateContentState(e)};return h.createElement(ee,null,h.createElement(O.Kc,{as:"h2"},"Hackathon Admin Tools"),h.createElement(et,null,h.createElement(O.jz,null,h.createElement(O.HN,{fontWeight:"bold"},"Hackathon Writeup ID:")," ",o.id),h.createElement(O.jz,null,h.createElement(O.HN,{fontWeight:"bold"},"Writeup State:")," ",a.contentState),o.updateTime&&h.createElement(O.jz,{style:{marginBottom:"16px"}},h.createElement(O.HN,{fontWeight:"bold"},"Last Modified Time:")," ",h.createElement(P.m_,{line1:(0,j.gI)(o.updateTime,j.PD)},h.createElement(O.HN,null,(0,j.gI)(o.updateTime,m)))),o.template&&h.createElement(O.jz,null,"This is a host/judge's Sample Project."),!(ep||es)&&h.createElement(O.jz,null,"Caution: This is NOT your writeup.")),h.createElement(O.jz,null,h.createElement(O.HN,{fontWeight:"bold"},"Deadline:")," ",ec?"Closed on ":"Open until "," ",eu),h.createElement(en,null,h.createElement(W.$,{onClick:function(){return $(!0)}},"Edit Writeup ",ec?"(after close)":"(before close)"),el&&(ed?h.createElement(P.m_,{line1:"This team already has a published writeup and multiple submissions are disabled in host settings."},h.createElement(W.$,{disabled:!0},"Late Submit Writeup")):h.createElement(W.$,{onClick:function(){return v(!0)}},"Late Submit Writeup")),eo&&h.createElement(W.$,{onClick:function(){return E(!0)}},"Retract submission"),eo&&h.createElement(W.$,{onClick:function(){return R(function(){return J(this,function(e){switch(e.label){case 0:return[4,q()];case 1:return e.sent(),S(!0),[2]}})})()}}
1,"Update Citation Authors")),h.createElement(A.p,{open:b,title:"Submit this writeup?",acceptLabel:"Submit",onAccept:function(){return em(_.z6.PUBLISHED)},cancelLabel:"Cancel",onCancel:function(){return v(!1)}},h.createElement(z.Cf,null,h.createElement(O.jz,{style:{color:"red"}},i.isPrivate?"This Writeup will be published on behalf of the participant and added to consideration for judging. Attached private resources will be shared with competition hosts, judges, and participants when the competition ends.":"This Writeup will be published on behalf of the participant, made publicly available, and added to consideration for judging."),!i.isPrivate&&h.createElement(O.jz,{style:{marginTop:"24px"}},h.createElement(O.HN,{fontWeight:"bold"},"Please note:"),h.createElement(H.X,{style:{marginBottom:"24px"}},h.createElement("li",null,h.createElement(O.Yq,{href:V.applicableLicense.url,emphasis:"high"},V.applicableLicense.name)," ","license will be applied."),h.createElement("li",null,"Attached Kaggle resources (Notebooks, Models, and Datasets) may not auto-publish; please notify the participant."))))),h.createElement(A.p,{open:g,title:"Retract submission?",acceptLabel:"Retract",onAccept:function(){return em(_.z6.UNPUBLISHED)},cancelLabel:"Cancel",onCancel:function(){return E(!1)}},h.createElement(z.Cf,null,h.createElement(O.jz,null,"This writeup will be removed from consideration for judging."))),h.createElement(A.p,{open:k,title:"Update Citation Authors?",acceptLabel:"Update Authors",onAccept:function(){S(!1),V.adminUpdateAuthor(G)},cancelLabel:"Cancel",onCancel:function(){return S(!1)}},h.createElement(z.Cf,null,h.createElement(O.jz,null,"This will update the Authors list in the Citation Section."),h.createElement(O.jz,{style:{margin:"24px 0"}},"Please note: Adding/removing author names will not update the underlying team."),G.map(function(e,t){var n=e.id,r=e.authorUserId,i=e.authorName;return h.createElement(X,{key:"rowid-".concat(n,"-idx-").concat(t)},h.createElement(O.jz,null,"Row Id: ",n),h.createElement(O.jz,null,r?h.createElement(h.Fragment,null,"User Id:"," ",h.createElement(O.Yq,{href:"/u/".concat(r),target:"_blank"},r)):h.createElement(h.Fragment,null,"User Id: null")),h.createElement(L.A,{fullWidth:!0,value:i,onChange:function(e){return Z(e,t)},maxLength:255,label:"Author Name",characterCount:!0}))}))),h.createElement(D.D,{isOpen:I,onClose:function(){return $(!1)},writeUp:a,onEdit:u,competition:i,hackathonWriteUpData:o,availableHackathonTracks:l,hackathonSettings:c,writeupConflict:V.hasWriteupConflict,writeupDeleted:V.isWriteupDeleted,teamId:null==(r=o.team)?void 0:r.id,secondsUntilDeadline:V.secondsUntilDeadline,isHostOrJudge:s,networkUnreachableError:V.networkUnreachableError}))},ee=b.default.div(Z()),et=b.default.div(q()),en=b.default.div(V()),er=n(43891),ei=n(59217),ea=n(42241),eo=n(47184),el=n(71986),ec=n(70474),eu=n(98949),es=n(86090);function ep(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ed(e,t,n,r,i,a,o){try{var l=e[a](o),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,i)}function em(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,l=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==i.return||i.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ep(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ep(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ef=function(e){var t=e.hackathonWriteUpData,n=e.availableHackathonTracks,r=e.hackathonSettings,i=e.open,a=e.onClose,o=em(h.useState(!1),2),l=o[0],c=o[1],u=em(h.useState(t.hackathonTrackIds),2),s=u[0],p=u[1],d=(0,es.vL)().revalidate,m=h.useCallback(function(){var e;return(e=function(){return function(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(o,"next",{value:c(0)}),l(o,"throw",{value:c(1)}),l(o,"return",{value:c(2)}),"function"==typeof Symbol&&l(o,Symbol.iterator,{value:function(){return this}}),o;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:return c(!0),[4,M.sIG.hackathonService.updateHackathonWriteUp({hackathonWriteUpId:t.
1id,hackathonTrackIds:s})];case 1:return e.sent(),d(),c(!1),a(),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){ed(a,r,i,o,l,"next",e)}function l(e){ed(a,r,i,o,l,"throw",e)}o(void 0)})})()},[t.id,s,d,a]);return h.createElement(eo.ch,{isOpen:i,onClose:a,title:"Override Participant Track Selection",content:n&&r?r.allowMultipleTracks?h.createElement(h.Fragment,null,n.map(function(e){return h.createElement(el.S,{key:e.id,checked:s.includes(e.id),onChange:function(){s.includes(e.id)?p(s.filter(function(t){return t!==e.id})):p(s.concat(e.id))}},e.title)})):h.createElement(h.Fragment,null,h.createElement(eu.A,{style:{paddingLeft:"16px"}},n.map(function(e){return h.createElement(ec.s,{key:e.id,value:e.id,checked:s.includes(e.id),onChange:function(){p([e.id])}},e.title)}))):h.createElement(h.Fragment,null,"No tracks available."),actions:[h.createElement(W.$,{key:"cancel",emphasis:"low",onClick:a},"Cancel"),h.createElement(W.$,{key:"save",disabled:l,onClick:m},"Save")]})},eh=n(68419),eb=n(7907),ev=n(62145);function ey(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eg(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function eE(){var e=eg(["\n background: none;\n border: 0;\n padding: 0;\n font: inherit;\n cursor: pointer;\n ","\n"]);return eE=function(){return e},e}function ew(){var e=eg(["\n padding: 24px;\n"]);return ew=function(){return e},e}function ek(){var e=eg(["\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n border: 0;\n"]);return ek=function(){return e},e}function eS(){var e=eg(["\n margin-bottom: 24px;\n\n &:last-child {\n margin-bottom: 0;\n }\n"]);return eS=function(){return e},e}function eC(){var e=eg(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"]);return eC=function(){return e},e}function eI(){var e=eg(["\n margin: 0 0 12px 0;\n"]);return eI=function(){return e},e}var eU=M.TGf.HackathonWriteupChecklistItemType,ex="writeup-checklist-popover",eT=b.default.button(eE(),function(e){return e.theme.km.typography.withTextLinkStyles}),eD=b.default.div(ew()),ej=b.default.span(ek()),eO=b.default.div(eS()),eP=b.default.div(eC()),eW=(0,b.default)(O.TT)(eI()),eA=(ey(r={},eU.HAS_TRACK,{title:"Tracks",grouping:"Basic Details"}),ey(r,eU.HAS_TITLE,{title:"Title",grouping:"Basic Details"}),ey(r,eU.HAS_SUBTITLE,{title:"Subtitle",grouping:"Basic Details"}),ey(r,eU.HAS_THUMBNAIL_AND_CARD_IMAGE,{title:"Thumbnail and Card Image",grouping:"Basic Details"}),ey(r,eU.HAS_VIDEO,{title:"Video",grouping:"Media Gallery"}),ey(r,eU.HAS_IMAGE,{title:"Images",grouping:"Media Gallery"}),ey(r,eU.HAS_DESCRIPTION,{title:"Description",grouping:"Content"}),ey(r,eU.HAS_FILE,{title:"Files",grouping:"Content"}),ey(r,eU.HAS_LINK,{title:"Links",grouping:"Content"}),r),ez=function(e){var t={"Basic Details":[],"Media Gallery":[],Content:[]},n=!0,r=!1,i=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var l=a.value;l.type!==eU.CHECKLIST_ITEM_TYPE_UNSPECIFIED&&t[eA[l.type].grouping].push(l)}}catch(e){r=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(r)throw i}}return t},eH=function(e){var t=e.checklist,n=e.open,r=e.onOpenChange,i=h.useRef(null),a=h.useCallback(function(){return r(!1)},[r]);if(h.useEffect(function(){if(n){var e=function(e){"Escape"===e.key&&a()};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}}},[n,a]),0===t.length)return null;var o=ez(t);return h.createElement(h.Fragment,null,h.createElement(O.jz,{ref:i},"Finish your project to submit."," ",h.createElement(eT,{type:"button","aria-expanded":n,"aria-controls":ex,onClick:function(){return r(!n)}},"See what's left"),"."),h.createElement(eb.R,{open:n,onClose:a,anchorEl:i.current,anchorOrigin:{vertical:"bottom",horizontal:"left"},disableFocusTrap:!0},h.createElement(eD,{id:ex,role:"region","aria-label":"WriteUp checklist"},["Basic Details","Media Gallery","Content"].filter(function(e){return o[e].length>0}).map(function(e){return h.createElement(eO,{key:e},h.createElement(eW,null,e),h.createElement(eP,null,o[e].map(function(e){return e.type!==eU.CHECKLIST_ITEM_TYPE_UNSPECIFIED&&h.createElement(ev.c,{key:e.type,component:"div",graphic:e.completed?"check":"close",primaryText:h.createElement(O.jz,null,eA[e.type].title,h.createElement(ej,null,e.completed?" (completed)":" (not completed)")),emphasis:"low",style:{padding:"0px"}})})))}))))},eL=n(18130),eF=n(63298),e_=n(16565),eM=n(39915),eB=n(66881),e$=n(54198),eN=n(90954),eR=n(45955),eY=n(26260),eG=n(13098),eJ=n(70915);function eK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eZ(e,t,n,r,i,a,o){try{var l=e[a](o),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,i)}function eq(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){eZ(a,r,i,o,l,"next",e)}function l(e){eZ(a,r,i,o,l,"throw",e)}o(void 0)})}}function eV(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,l=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==i.return||i.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eK(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eK(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eX(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function eQ(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(o,"next",{value:c(0)}),l(o,"throw",{value:c(1)}),l(o,"return",{value:c(2)}),"function"==typeof Symbol&&l(o,Symbol.iterator,{value:function(){return this}}),o;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function e0(){var e=eX(["\n display: flex;\n align-items: center;\n gap: 16px;\n"]);return e0=function(){return e},e}function e1(){var e=eX(["\n position: fixed;\n left: 24px;\n bottom: 24px;\n z-index: ",";\n\n @media "," {\n left: 12px;\n bottom: 12px;\n }\n"]);return e1=function(){return e},e}var e2=b.default.div(e0()),e6=b.default.div(e1(),function(e){return e.theme.km.zIndex.abovePlus},s.vE.DESKTOP),e4=h.createElement(eL.Z,{style:{marginBottom:"40px",gap:"16px"}},h.createElement(eF.WA,{width:"40px",height:"40px",borderRadius:"20px"}),h.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px"}},h.createElement(eF.WA,{height:"16px",width:"20vw"}),h.createElement(eF.WA,{height:"16px",width:"30vw"})),h.createElement(eF.WA,{width:"96px",height:"40px",borderRadius:"20px",style:{marginLeft:"auto"}})),e3=function(e){var t=e.icon,n=e.topText,r=e.bottomComponent,i=e.actions;return h.createElement(eL.Z,null,h.createElement(e_.i,t),h.createElement(eM.O,null,h.createElement(O.jz,{fontWeight:"bold"},n),"string"==typeof r?h.createElement(O.jz,null,r):r),h.createElement(eB.c,null,i))},e5=function(e){var t=e.open,n=e.setOpen,r=e.onAccept;return h.createElement(eh.LH,{preamble:"Allow others to cite your Writeup with a DOI.",onAccept:function(){return eq(function(){return eQ(this,function(e){switch(e.label){case 0:return(0,eY.HF)("writeups","doi-agreement-accepted",{entry:"trackbar"}),[4,r()];case 1:return e.sent(),n(!1),[2]}})})()},onCancel:function(){(0,eY.HF)("writeups","doi-agreement-cancel",{entry:"trackbar"}),n(!1)},open:t})},e8=function(e){var t,n,r,i,a=e.competition,o=e.competitionUser,c=e.hackathonWriteUpData,u=e.availableHackathonTracks,s=e.competitionPrizes,p=e.hackathonSettings,d=e.onUpdateWriteUp,m=e.writeUp,f=e.isEligibleToDelete,v=e.isJudge,y=o.isHost||v,g=h.useContext(F.I).currentUser,E="true"===eV((0,es.ok)(),1)[0].get("nominate_as_winner")&&y,w=eV(h.useState(!1),2),k=w[0],S=w[1],C=eV(h.useState(!1),2),I=C[0],j=C[1],P=eV(h.useState(!1),2),L=P[0],B=P[1],$=eV(h.useState(!!E),2),N=$[0],R=$[1],Y=eV(h.useState(!1),2),G=Y[0],J=Y[1],K=eV(h.useState(!1),2),Z=K[0],q=K[1],V=eV(h.useState(!1),2),X=V[0],Q=V[1],ee=eV(h.useState(!1),2),et=ee[0],en=ee[1],eo=(0,l.u)(),el=h.useRef(null),ec=(0,es.vL)(),eu=(0,b.useTheme)(),ep=(0,es.Zp)(),ed=a.deadline?(0,x.tA)(a.deadline):"the close date",em=(0,T.q)({competition:a,hackathonWriteUpData:c,writeUp:m}),eh=h.useCallback(function(){R(!0),eY.vF.report("writeups","prize-click")},[]),eb=h.useCallback(function(){R(!1),eY.vF.report("writeups","prize-panel-close")},[]),ev=h.useCallback(function(){S(!0),en(!1),eY.vF.report("writeups","edit-click")},[]),ey=h.useCallback(function(){S(!1),eY.vF.report("writeups","edit-panel-close")},[]),eg=h.useCallback(function(){j(!0),eY.vF.report("writeups","submit-panel-open")},[]),eE=c.awardedHackathonTrackPrizeIds.length>0,ew=c.ownerHostUserId||c.ownerJudgeUserId,ek=g.id===c.ownerHostUserId||g.id===c.ownerJudgeUserId,eS=c.team&&c.team.teamMembers.map(function(e){return e.id}).includes(g.id),eC=eS||ek,eI=null!=g.id&&(null==(n=m.message)||null==(t=n.author)?void 0:t.id)===g.id,eU=a.launched&&a.deadline&&a.deadline<new Date,ex=m.contentState===_.z6.DRAFT||m.contentState===_.z6.UNPUBLISHED,eT=function(e){return eq(function(){return eQ(this,function(t){return j(!1),B(!1),em.updateContentState(e),[2]})})()},eD=h.useCallback(function(){return eq(function(){var e;return eQ(this,function(t){switch(t.label){case 0:if(!m.id)return[2];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,eG.lE.writeUpsService.createWriteUpDoi({writeUpId:m.id})];case 2:return t.sent(),[4,ec.revalidate()];case 3:return t.sent(),[3,5];case 4:return e=t.sent(),(0,U.Z)(e),[3,5];case 5:return[2]}})})()},[ec,m.id]);if(!m)return h.createElement(h.Fragment,null);var ej=h.createElement(ea.p,{key:c.id,open:N,onClose:eb,competition:a,hackathonWriteUpData:c,availableHackathonTracks:u,competitionPrizes:s,hackathonSettings:p,refreshWriteup:ec.revalidate}),eO=h.createElement(ef,{open:G,onClose:function(){return J(!1)},hackathonWriteUpData:c,availableHackathonTracks:u,hackathonSettings:p}),eP=y&&m.contentState===_.z6.PUBLISHED,eW=m.contentState===_.z6.PUBLISHED&&eC||eP||m.canPin||f.canShowDeletionButton,eA=h.createElement(h.Fragment,null,eW&&h.createElement(h.Fragment,null,h.createElement(e$.K,{title:"More options",onClick:function(){return q(function(e){return!e})},icon:"more_horiz",size:"medium",wrapperRef:el}),h.createElement(eN.W,{anchorEl:el.current,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Z,style:{marginTop:"8px"},onClose:function(){return q(!1)},transformOrigin:{vertical:"top",horizontal:"right"}},m.contentState===_.z6.PUBLISHED&&h.createElement(h.Fragment,null,eC&&h.
1createElement(eR.D,{icon:"undo",onClick:function(){return B(!0)},disabled:eU},"Retract submission")),eP&&h.createElement(eR.D,{icon:c.template?"keep_off":"keep",onClick:function(){return eq(function(){return eQ(this,function(e){switch(e.label){case 0:return q(!1),[4,M.sIG.hackathonService.updateHackathonWriteUp({hackathonWriteUpId:c.id,hackathonTrackIds:c.hackathonTrackIds,template:!c.template})];case 1:return e.sent(),ec.revalidate(),[2]}})})()}},c.template?"Unset as Sample Project":"Set as Sample Project"),m.canPin&&h.createElement(er.u,{itemId:{type:eJ.ProfilePinType.WRITE_UP,entityId:m.id},title:m.title}),!m.doi&&eU&&!(null==a?void 0:a.isPrivate)&&!y&&m.contentState===_.z6.PUBLISHED&&eI&&h.createElement(eR.D,{icon:"fingerprint",onClick:function(){return Q(!0)}},"Create DOI"),f.canShowDeletionButton&&h.createElement(eR.D,{icon:"delete",onClick:function(){return eq(function(){return eQ(this,function(e){return[2,eo.showConfirmModal(c.id,m.title,a,m.contentState)]})})()},disabled:!f.canDelete},"Delete (Creator only)")))),ez="".concat(c.hackathonTrackIds.map(function(e){return u.filter(function(t){return t.id===e})[0].title}).join(", ")),eL=h.createElement(A.p,{open:I,title:"Submit your Writeup?",acceptLabel:"Submit",onAccept:function(){return eT(_.z6.PUBLISHED)},cancelLabel:"Cancel",onCancel:function(){return j(!1)}},h.createElement(z.Cf,null,h.createElement(O.jz,null,"Your writeup for ",ez," will be submitted."),h.createElement(O.jz,{style:{marginTop:"24px"}},a.isPrivate?h.createElement(h.Fragment,null,h.createElement(O.HN,{fontWeight:"bold"},"Please note:")," When the competition ends, any attached private resources will be shared with competition hosts, judges, and participants."):h.createElement(h.Fragment,null,h.createElement(O.HN,{fontWeight:"bold"},"Please note:")," When the hackathon closes, your writeup will be:",h.createElement(H.X,{style:{marginBottom:"24px"}},h.createElement("li",null,"Licensed under"," ",h.createElement(O.Yq,{href:em.applicableLicense.url,emphasis:"high"},em.applicableLicense.name),"."),h.createElement("li",null,"Publicly available on Kaggle, attributed to your current Kaggle display name.")),"If you need to update this attribution later, reach out to [email protected].")))),eF=h.createElement(A.p,{open:L,title:"Retract submission?",acceptLabel:"Retract",onAccept:function(){return eT(_.z6.UNPUBLISHED)},cancelLabel:"Cancel",onCancel:function(){return B(!1)}},h.createElement(z.Cf,null,h.createElement(O.jz,null,"You're about to retract this writeup. This will"," ",h.createElement(O.HN,{fontWeight:"bold"},"remove it from consideration for judging in ",ez,".")),h.createElement(O.jz,{style:{marginTop:"24px"}},h.createElement(O.HN,{fontWeight:"bold"},"Also, be aware:"),h.createElement(H.X,{style:{marginBottom:"24px"}},h.createElement("li",null,"All previous versions of this submission will be invalid."),h.createElement("li",null,a.isPrivate?"Once the competition ends, attached resources will not be shared with competition hosts, judges, and participants.":h.createElement(h.Fragment,null,"Once the hackathon closes, this writeup will not be made public or licensed"," ",h.createElement(O.Yq,{href:em.applicableLicense.url},em.applicableLicense.name),".")),h.createElement("li",null,"You can still resubmit this writeup before the submission deadline.")),"Do you want to continue?")));if(em.isLoading||"loading"===ec.state)i=e4;else if(m.contentState===_.z6.PUBLISHED&&y&&eU)i=h.createElement(e3,{icon:{icon:eE?"trophy":"check_circle",variant:"success"},topText:eE?"You have selected this Writeup as a winner!":"This Writeup is submitted!",bottomComponent:eE?h.createElement(O.jz,null,"Go"," ",h.createElement(O.Yq,{href:"/competitions/".concat(a.competitionName,"/writeups")},"back")," to select more winners, or finalize your selection on the ",h.createElement(O.Yq,{href:"/competitions/".concat(a.competitionName,"/hackathon-winners")},"Winners tab"),"."):c.template?"This is a sample project.":"You can select this as a winner!",actions:h.createElement(e2,null,h.createElement(W.$,{emphasis:"low",leadingIcon:"list",onClick:function(){return J(!0)}},"Override Track Selection"),!c.template&&h.createElement(W.$,{emphasis:"medium",leadingIcon:"trophy",onClick:eh},eE?"Edit winner selection":"Select as a Winner"),eA)});else if(eS&&m.contentState===_.z6.PUBLISHED&&eU)i=h.createElement(e3,{icon:{icon:"check_circle",variant:"success"},topText:"Submitted!",bottomComponent:"Judging in progress. Winners will be announced soon.",actions:h.createElement(e2,null,eA)});else if(eC&&em.hasWriteupConflict)i=em.isWriteupDeleted?h.createElement(e3,{icon:{icon:"warning",backgroundColor:eu.km.color.yellow[400]},topText:"Writeup is Deleted",bottomComponent:"A team member recently deleted this Writeup."}):h.createElement(e3,{icon:{icon:"warning",backgroundColor:eu.km.color.yellow[400]},topText:"Writeup is out of date",bottomComponent:"A team member recently updated this Writeup. Refresh to see the latest version.",actions:h.createElement(e2,null,h.createElement(W.$,{emphasis:"medium",onClick:function(){ec.revalidate()}},"Refresh"))});else if(y&&ew&&m.contentState===_.z6.PUBLISHED&&!eU){var e_=c.template;i=h.createElement(e3,{icon:{icon:"check_circle",variant:"success"},topText:e_?"Submitted! This is a sample project.":"Submitted! This writeup is eligible to be a sample project.",bottomComponent:e_?"This writeup is visible to participants as a pinned sample project.":"To feature this as a sample for contestants, go to the Writeups page and designate it. If you don't, it won't be visible to participants until the competition ends.",actions:ek?h.createElement(e2,null,h.createElement(W.$,{emphasis:"medium",onClick:ev},"Edit"),eA):void 0})}else eC&&m.contentState===_.z6.PUBLISHED&&!eU?i=h.createElement(e3,{icon:{icon:"check_circle",variant:"success"},topText:"Submitted!",bottomComponent:"You can make changes until the deadline (".concat(ed,")."),actions:h.createElement(e2,null,h.createElement(W.$,{emphasis:"medium",onClick:ev},"Edit"),eA)}):eC&&ex&&eU?i=h.createElement(e3,{icon:{icon:"alarm",variant:"info"},topText:"Deadline Missed",bottomComponent:"This writeup was not submitted by the deadline (".concat(ed,")."),actions:h.createElement(e2,null,eA)}):eC&&ex&&!eU&&(p.allowMultipleSubmissions||0===em.submissionCount||y?em.checklist.filter(function(e){return e.completed}
1).length<em.checklist.length?i=h.createElement(e3,{icon:{icon:"checklist_rtl",backgroundColor:eu.km.color.kaggle.yellow},topText:"".concat(em.checklist.filter(function(e){return e.completed}).length,"/").concat(em.checklist.length," Complete"),bottomComponent:h.createElement(eH,{checklist:em.checklist,open:et,onOpenChange:en}),actions:h.createElement(e2,null,h.createElement(W.$,{emphasis:"medium",onClick:ev},"Edit"),h.createElement(W.$,{emphasis:"high",onClick:eg,disabled:!0},"Submit"),eA)}):ek&&ex&&!eU?i=h.createElement(e3,{icon:{icon:"thumb_up",backgroundColor:eu.km.color.kaggle.primary},topText:"Ready to create a Sample Writeup? Submit this Writeup to get started.",bottomComponent:"After submitting, go to the Writeups page to designate it as a Sample Writeup. If not designated, it won't be visible to contestants until the competition ends.",actions:h.createElement(e2,null,h.createElement(W.$,{emphasis:"medium",onClick:ev},"Edit"),h.createElement(W.$,{emphasis:"high",onClick:eg},"Submit"),eA)}):em.checklist.filter(function(e){return e.completed}).length===em.checklist.length&&(i=h.createElement(e3,{icon:{icon:"thumb_up",backgroundColor:eu.km.color.kaggle.primary},topText:"Ready to Submit!",bottomComponent:"Submit by the deadline (".concat(ed,")."),actions:h.createElement(e2,null,h.createElement(W.$,{emphasis:"medium",onClick:ev},"Edit"),h.createElement(W.$,{emphasis:"high",onClick:eg},"Submit"),eA)})):i=h.createElement(e3,{icon:{icon:"warning",backgroundColor:eu.km.color.yellow[400]},topText:"You've already submitted a Writeup",bottomComponent:"To submit this one instead, first retract your other submission.",actions:h.createElement(e2,null,h.createElement(W.$,{emphasis:"medium",onClick:ev},"Edit"),h.createElement(W.$,{emphasis:"high",disabled:!0},"Submit"),eA)}));return h.createElement(h.Fragment,null,eL,eF,X&&h.createElement(e5,{open:X,setOpen:Q,onAccept:eD}),h.createElement(W.$,{leadingIcon:"chevron_left",emphasis:"low",onClick:function(){return ep("/competitions/".concat(a.competitionName,"/writeups"))}},"Writeups"),y&&ej,y&&eO,i,(void 0!==em.secondsUntilDeadline||em.networkUnreachableError)&&h.createElement(e6,null,h.createElement(ei.$,{secondsUntilDeadline:em.secondsUntilDeadline,competition:a,hasNetworkUnreachableError:em.networkUnreachableError})),h.createElement(D.D,{isOpen:k,onClose:ey,writeUp:m,onEdit:d,competition:a,hackathonWriteUpData:c,availableHackathonTracks:u,hackathonSettings:p,writeupConflict:em.hasWriteupConflict,writeupDeleted:em.isWriteupDeleted,teamId:null==(r=c.team)?void 0:r.id,secondsUntilDeadline:em.secondsUntilDeadline,isHostOrJudge:y,networkUnreachableError:em.networkUnreachableError}))},e9=n(22129),e7=n(70522);function te(e,t,n,r,i,a,o){try{var l=e[a](o),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,i)}var tt=function(e){var t=(0,es.Zp)(),n=h.useContext(e9.MV).showConfirmModal;return h.useCallback(function(){var r;return(r=function(){var r;return function(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(o,"next",{value:c(0)}),l(o,"throw",{value:c(1)}),l(o,"return",{value:c(2)}),"function"==typeof Symbol&&l(o,Symbol.iterator,{value:function(){return this}}),o;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(i){switch(i.label){case 0:return eY.vF.report("writeups","delete-writeup-click"),[4,n("This action is irreversible.","Delete this writeup?","Delete","Cancel")];case 1:if(!i.sent())return[3,6];i.label=2;case 2:return i.trys.push([2,4,,5]),eY.vF.report("writeups","delete-writeup-confirm",{writeUpId:e}
1),(0,e7.Dn)({title:"Deletion in progress"}),[4,eG.lE.writeUpsService.deleteWriteUp({writeUpId:e})];case 3:return i.sent(),(0,e7.Dn)({title:"Writeup was deleted successfully"}),t("/"),eY.vF.report("writeups","delete-writeup-success",{writeUpId:e}),[2,!0];case 4:return r=i.sent(),(0,U.Z)(r,"Failed to delete writeup"),eY.vF.report("writeups","delete-writeup-error",{writeUpId:e,errorMsg:r.message}),[2,!1];case 5:return[3,7];case 6:return eY.vF.report("writeups","delete-writeup-cancel"),[2,!1];case 7:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function o(e){te(a,n,i,o,l,"next",e)}function l(e){te(a,n,i,o,l,"throw",e)}o(void 0)})})()},[e,t,n])};function tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tr(e,t,n,r,i,a,o){try{var l=e[a](o),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,i)}function ti(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){tr(a,r,i,o,l,"next",e)}function l(e){tr(a,r,i,o,l,"throw",e)}o(void 0)})}}function ta(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function to(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(o,"next",{value:c(0)}),l(o,"throw",{value:c(1)}),l(o,"return",{value:c(2)}),"function"==typeof Symbol&&l(o,Symbol.iterator,{value:function(){return this}}),o;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function tl(){var e=ta(["\n margin: 40px 0;\n display: flex;\n flex-direction: column;\n gap: 16px;\n"]);return tl=function(){return e},e}function tc(){var e=ta(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"]);return tc=function(){return e},e}function tu(){var e=ta(["\n display: flex;\n gap: 16px;\n"]);return tu=function(){return e},e}var ts=function(e){var t,n=e.topicId,r=e.messageId,i=e.writeUpId,a=e.isSpammed,o=e.contentState,l=function(e){if(Array.isArray(e))return e}(t=h.useState(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){o=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw n}}return i}}(t)||function(e){if(e){if("string"==typeof e)return tn(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tn(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=l[0],u=l[1],s=tt(i),p=h.useContext(F.I).currentUser.isAdmin,d=h.useCallback(function(){return ti(function(){return to(this,function(e){switch(e.label){case 0:return u(!0),[4,s()];case 1:return e.sent()?location.reload():u(!1),[2]}})})()},[s]),m=h.useCallback(function(){return ti(function(){var e;return to(this,function(t){switch(t.label){case 0:u(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,eG.lE.discussionsService.toggleSpamMessage({messageId:r})];case 2:return t.sent(),location.reload(),[3,4];case 3:return e=t.sent(),(0,U.Z)(e),u(!1),[3,4];case 4:return[2]}})})()},[r]);return p?h.createElement(tp,null,h.createElement(O.Kc,{as:"h2"},"Admin info"),h.createElement(td,null,h.createElement(O.jz,null,"Writeup ID: ",i),h.createElement(O.jz,null,"Topic ID: ",n),h.createElement(O.jz,null,"First message ID: ",r),h.createElement(O.jz,null,"Content state: ",o)),h.createElement(tm,null,h.createElement(W.$,{onClick:m,disabled:c},a?"Unspam":"Spam"),h.createElement(W.$,{onClick:d,disabled:c||o===_.z6.SYSTEM_DELETED},"Delete"))):null},tp=b.default.div(tl()),td=b.default.div(tc()),tm=b.default.div(tu()),tf=n(50614),th=n(69474),tb=n(60099),tv=n(37868),ty=n(1932),tg=function(e){var t,n,r=e.writeUp,i=e.onUpdateWriteUp,a=h.useContext(F.I).currentUser,o=!(0,tv.OO)(a)||(null==(n=r.message)||null==(t=n.reactions)?void 0:t.some(function(e){return e.userCount>0})),l=h.useCallback(function(e){eY.vF.report("writeups","writeup-reaction-change"),i((0,ty.jM)(r,function(t){(null==t?void 0:t.message)&&(t.message.reactions=e)}))},[r,i]);return r.message?h.createElement(h.Fragment,null,o&&h.createElement(h.Fragment,null,h.createElement(m.c,{style:{margin:"40px 0 24px"}}),h.createElement(tb.L,{messageId:r.message.id,reactions:r.message.reactions,onSetReactions:l})),h.createElement(m.c,{style:{margin:"24px 0"}}),h.createElement(th.V,{initialTopicId:r.topicId,initialSort:eG.rK.UNSPECIFIED,topicFirstMessageId:r.message.id,forumType:tf.W.GENERAL,isReadOnly:!1,isPrivate:!1,allowAttachments:!0})):null},tE=n(51349),tw=n(76354),tk=function(e){var t=e.writeUpId,n=e.title,r=e.canPin,i=e.onEditClick,a=e.onPublishClick,o=e.onUnpublishClick,l=tt(t);return h.createElement(tw.a,{icon:"more_horiz",title:"Writeup actions",size:"medium"},r&&h.createElement(er.u,{itemId:{type:eJ.ProfilePinType.WRITE_UP,entityId:t},title:n}),i&&h.createElement(eR.D,{icon:"edit",onClick:i},"Edit"),a&&h.createElement(eR.D,{icon:"visibility",onClick:a},"Publish"),o&&h.createElement(eR.D,{icon:"visibility_off",onClick:o},"Unpublish"),h.createElement(eR.D,{icon:"delete",onClick:l,dividerTop:!!(a||i||o)},"Delete"))};function tS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tC(e,t,n,r,i,a,o){try{var l=e[a](o),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,i)}function tI(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){tC(a,r,i,o,l,"next",e)}function l(e){tC(a,r,i,o,l,"throw",e)}o(void 0)})}}function tU(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,l=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==i.return||i.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tS(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tx(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(o,"next",{value:c(0)}),l(o,"throw",{value:c(1)}),l(o,"return",{value:c(2)}),"function"==typeof Symbol&&l(o,Symbol.iterator,{value:function(){return this}}),o;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function tT(){var e,t,n=(e=["\n display: flex;\n align-items: center;\n gap: 16px;\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return tT=function(){return n},n}var tD=function(e){var t=e.writeUp,n=e.competition,r=e.onUpdateWriteUp,i=(0,f.A)(s.vE.SM3),a=tU(h.useState(!1),2),o=a[0],l=a[1],c=tU(h.useState(!1),2),u=c[0],p=c[1],d=t.contentState,m=t.canEdit,b=h.useCallback(function(){l(!0),eY.vF.report("writeups","edit-click")},[]),v=h.useCallback(function(){l(!1),eY.vF.report("writeups","edit-panel-close")},[]);if(!m)return null;var y=function(){return tI(function(){return tx(this,function(e){switch(e.label){case 0:eY.vF.report("writeups","publish-click"),p(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,(0,tE.Ft)(t,_.z6.PUBLISHED)];case 2:return r(e.sent()),(0,e7.Dn)({title:"Your Writeup has been published."}),eY.vF.report("writeups","publish-success"),[3,4];case 3:return e.sent(),(0,e7.Dn)({title:"Failed to publish your Writeup."}),eY.vF.report("writeups","publish-failure"),[3,4];case 4:return p(!1),[2]}})})()};return h.createElement(h.Fragment,null,h.createElement(tj,null,!i&&h.createElement(W.$,{emphasis:"medium",onClick:b},"Edit"),!i&&d!==_.z6.PUBLISHED&&h.createElement(W.$,{onClick:y,disabled:u},"Publish"),h.createElement(tk,{writeUpId:t.id,title:t.title,canPin:t.canPin,onEditClick:i?b:void 0,onPublishClick:i&&d!==_.z6.PUBLISHED?y:void 0,onUnpublishClick:d===_.z6.PUBLISHED?function(){return tI(function(){return tx(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),eY.vF.report("writeups","unpublish-click"),[4,(0,tE.Ft)(t,_.z6.UNPUBLISHED)];case 1:return r(e.sent()),(0,e7.Dn)({title:"Your Writeup has been unpublished."}),eY.vF.report("writeups","unpublish-success"),[3,3];case 2:return e.sent(),(0,e7.Dn)({title:"Failed to unpublish your Writeup."}),eY.vF.report("writeups","unpublish-failure"),[3,3];case 3:return[2]}})})()}:void 0})),o&&h.createElement(D.D,{isOpen:o,writeUp:t,competition:n,onClose:v,onEdit:r}))},tj=b.default.div(tT());function tO(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tP=function(e){var t=e.writeUp,n=e.competition,r=e.onUpdateWriteUp,i=t.contentState;if(!t.canEdit||i!==_.z6.DRAFT&&i!==_.z6.PUBLISHED&&i!==_.z6.UNPUBLISHED)return null;var a=tW[i],o=a.icon,l=a.variant,c=a.title,u=a.text;return h.createElement(eL.Z,null,h.createElement(e_.i,{icon:o,variant:l}),h.createElement(eM.O,null,h.createElement(O.jz,{fontWeight:"bold"},c),h.createElement(O.jz,null,u)),h.createElement(eB.c,{style:{flex:0}},h.createElement(tD,{writeUp:t,onUpdateWriteUp:r,competition:n})))},tW=(tO(i={},_.z6.DRAFT,{icon:"thumb_up",variant:"info",title:"This Writeup is a saved draft",text:"After you publish, it will show up in your Writeups tab in your Profile."}),tO(i,_.z6.PUBLISHED,{icon:"check_circle",variant:"success",title:"Your Writeup is published!",text:"To feature it on your profileâs main tab, you can pin it from the Writeups tab."}),tO(i,_.z6.UNPUBLISHED,{icon:"visibility_off",variant:"warning",title:"This is an unpublished Writeup",text:"You can publish it again at any time"}),i);function tA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tz(){var e=tA(["\n display: block;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"]);return tz=function(){return e},e}function tH(){var e=tA(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 100%;\n gap: 16px;\n"]);return tH=function(){return e},e}var tL=function(e){var t=e.writeUp,n=e.onUpdateWriteUp,r=e.competition;return h.createElement(t_,null,h.createElement(tF,{as:"span"},t.title,r&&r.title&&h.createElement(h.Fragment,null," â ",r.title)),h.createElement(tD,{writeUp:t,competition:r,onUpdateWriteUp:n}))},tF=(0,b.default)(O.mM)(tz()),t_=b.default.div(tH()),tM=n(90175);function tB(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t$(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,l=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==i.return||i.return()}finally{if(l)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tB(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tN(){var e,t,n=(e=["\n display: flex;\n flex-wrap: wrap;\n gap: 24px;\n align-items: flex-start;\n\n & > * {\n flex: 1 1 360px;\n }\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return tN=function(){return n},n}var tR=b.default.div(tN()),tY=function(e){var t,n,r,i,u,s,p,d,m,f,b,v,y,g,E,w,k,S,C=e.loadedWriteUp,U=e.hackathonWriteUpData,x=e.competition,T=e.competitionUser,D=e.availableHackathonTracks,j=e.competitionPrizes,O=e.hackathonSettings,P=h.useContext(F.I).currentUser,W=t$(h.useState(C),2),A=W[0],z=W[1],H=t$(h.useState([]),2),L=H[0],_=H[1];h.useEffect(function(){z(C)},[C]);var M=null!=(t=null==T?void 0:T.isJudge)&&t,$=!!(null==T?void 0:T.isHost)||M,N=h.useCallback(function(e){z(e)},[z]),R=null!=(n=null!=(r=null==U||null==(p=U.team)?void 0:p.teamMembers)?r:null==A?void 0:A.collaborators)?n:(null==A||null==(d=A.message)?void 0:d.author)?[A.message.author]:[];h.useMemo(function(){var e=[];if(void 0!==D){var t=!0,n=!1,r=void 0;try{for(var i,a=D[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,l=!0,c=!1,u=void 0;try{for(var s,p=o.prizes[Symbol.iterator]();!(l=(s=p.next()).done);l=!0){var d=s.value;(null==U?void 0:U.awardedHackathonTrackPrizeIds.includes(d.id))&&e.push({trackTitle:o.title,awardTitle:d.title})}}catch(e){c=!0,u=e}finally{try{l||null==p.return||p.return()}finally{if(c)throw u}}}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}}if(void 0!==j){var m=!0,f=!1,h=void 0;try{for(var b,v=j[Symbol.iterator]();!(m=(b=v.next()).done);m=!0){var y=b.value;(null==U?void 0:U.awardedHackathonTrackPrizeIds.includes(y.id))&&e.push({trackTitle:"Competition Award",awardTitle:y.title})}}catch(e){f=!0,h=e}finally{try{m||null==v.return||v.return()}finally{if(f)throw h}}}_(e)},[null==U?void 0:U.awardedHackathonTrackPrizeIds,D,j]);var Y=null!=P.id&&R.some(function(e){return e.id===P.id});R.sort(function(e,t){var n,r;return e.id===(null==U||null==(n=U.team)?void 0:n.teamLeaderId)?-1:+(t.id===(null==U||null==(r=U.team)?void 0:r.teamLeaderId))});var G=!!(U&&x&&T&&D&&O&&C),J=!!(x&&x.hackathon&&C&&C.type===eG.LX.HACKATHON_PROJECT&&x.launched&&x.deadline&&new Date<x.deadline),K=G?(0,l.$)(null!=(i=null==A||null==(m=A.message)?void 0:m.isUserAuthor)&&i,null!=(u=null==A?void 0:A.collaborators)?u:[],!!(null==A?void 0:A.canDelete),P.id,(null!=(s=null==U||null==(f=U.awardedHackathonTrackPrizeIds)?void 0:f.length)?s:0)>0,!!(null==x?void 0:x.finalLeaderboardHasBeenVerified)):{canShowDeletionButton:!1,canDelete:!1};return A?h.createElement(a._,null,h.createElement(c.dZ,null,!G&&h.createElement(I,null,h.createElement(tL,{writeUp:A,onUpdateWriteUp:N,competition:x})),h.createElement(o.L,{style:{paddingTop:"0"}},G?h.createElement(e8,{competition:x,competitionUser:T,hackathonWriteUpData:U,availableHackathonTracks:D,competitionPrizes:j,hackathonSettings:O,onUpdateWriteUp:N,writeUp:C,isEligibleToDelete:K,isJudge:M}):h.createElement(tP,{writeUp:A,onUpdateWriteUp:N,competition:x}),h.createElement(tM.e,{writeUpId:A.id,title:A.title,url:A.url,slug:A.slug,subtitle:A.subtitle,type:A.type,createTime:A.createTime,publishTime:A.publishTime,updateTime:A.updateTime,tags:A.tags,markdown:null==(b=A.message)?void 0:b.rawMarkdown,html:null==(v=A.message)?void 0:v.content,authors:R,votes:null==(y=A.message)?void 0:y.votes,topicId:A.topicId,messageId:null==(g=A.message)?void 0:g.id,messageAuthor:null==(E=A.message)?void 0:E.author,contentState:A.contentState,authorsList:A.authors,competition:x,hackathonTracks:D,selectedHackathonTrackIds:null==U?void 0:U.hackathonTrackIds,links:A.writeUpLinks,files:null==(w=A.message)?void 0:w.attachments,prizes:L,license:A.license,competitionRanking:null==(k=A.message)?void 0:k.competitionRanking,displayCreatorLabelInAuthorsList:K.canShowDeletionButton||G&&P.isAdmin&&B.G5.hackathonDataAdmin,doi:A.doi,isTeamMember:Y,isHackathonOpen:J}),h.createElement(tR,null,h.createElement(ts,{topicId:A.topicId,messageId:null==(S=A.message)?void 0:S.id,writeUpId:A.id,isSpammed:A.isSpammed,contentState:A.contentState}),U&&x&&D&&O&&h.createElement(Q,{competition:x,writeUp:A,hackathonWriteUpData:U,availableHackathonTracks:D,hackathonSettings:O,onUpdateWriteUp:N,isHostOrJudge:$})),!J&&A.type!==eG.LX.PERSONAL_PROJECT&&h.createElement(tg,{writeUp:A,onUpdateWriteUp:N})))):null}},49428(e,t,n){n.d(t,{EI:()=>u,Ey:()=>o,S1:()=>l,W3:()=>a,ed:()=>r,k1:()=>c,lu:()=>s,oO:()=>i});var r=106949,i=131772,a=[101597,106949,128852],o=[131772],l={CC0:1,CC_BY_4_0:13,MIT:31},c=[l.CC0,l.CC_BY_4_0,l.MIT],u=50,s=2e3},65356(e,t,n){n.d(t,{rA:()=>o,tA:()=>a,yE:()=>i});var r=n(49428);function i(e){return e&&r.W3.includes(e)?{id:r.S1.CC0,name:"CC0",url:"https://creativecommons.org/publicdomain/zero/1.0/deed.en/"}:e&&r.Ey.includes(e)?{id:r.S1.MIT,name:"MIT",url:"https://opensource.org/licenses/MIT"}:{id:r.S1.CC_BY_4_0,name:"CC BY 4.0",url:"https://creativecommons.org/licenses/by/4.0/deed.en"}}var a=function(e){return"".concat(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})," at ").concat(e.toLocaleTimeString("en-US",{hour:"numeric",minute:"numeric",timeZoneName:"short"}))},o=function(e){return"".concat(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}).split(",").join("")," ").concat(e.toLocaleTimeString("en-US",{hour:"numeric",minute:"numeric",timeZoneName:"short"}))}}}]); 2//# sourceMappingURL=3866.f87040535a7a94e6.js.map
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.