PageSourceSearch

https://www.startupbootcamp.com.au/_next/static/chunks/pages/demo-day/[cohortSlug]/engage-2f71e7aff1e26b5e.js

js startupbootcamp.com.au collected 2026-09-26 05:30:32 UTC 11,054 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3716],{76109:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/demo-day/[cohortSlug]/engage",function(){return s(7783)}])},39250:function(e,t,s){"use strict";var a=s(85893);t.Z=e=>{let{text:t,colorClass:s}=e;return(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsxs)("svg",{className:"w-5 h-5 mr-3 -ml-1 ".concat(s||"text-white"," animate-spin"),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"})," ",(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),t]})}},7783:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return x},default:function(){return DemoDayEngage}});var a=s(85893),r=s(67294),n=s(2962),l=s(8100),i=s(96298),o=s(29164),d=s(39250);let m=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}),buildQueryString=e=>new URLSearchParams(Object.entries(e).filter(e=>{let[,t]=e;return null!=t})).toString(),setInitialInvestments=e=>e.reduce((e,t)=>({...e,[t._id]:{amount:0}}),{}),CardHeader=e=>{let{icon:t,title:s}=e;return(0,a.jsxs)("div",{className:"flex items-center px-5 py-4 border-b border-gray-700",children:[(0,a.jsx)("span",{className:"w-5 h-5 mr-3 text-gray-400",children:t}),(0,a.jsx)("h2",{className:"text-lg font-semibold leading-6 text-sbc-teal",children:s})]})},c=(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})}),u=(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),NameForm=e=>{let{firstName:t,lastName:s,setFirstName:r,setLastName:n}=e;return(0,a.jsxs)("section",{className:"grid gap-4 p-5 bg-gray-800 border border-gray-700 rounded-md shadow-lg md:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"firstName",className:"block mb-2 text-sm font-semibold text-gray-100",children:["First name ",(0,a.jsx)("span",{className:"text-red-300",children:"*"})]}),(0,a.jsx)("input",{id:"firstName",name:"firstName",value:t,onChange:e=>r(e.target.value),required:!0,autoComplete:"given-name",className:"block w-full px-5 py-3 text-sm text-gray-500 bg-white border border-gray-700 rounded-md focus:border-teal-400 focus:outline-none focus:shadow-outline-teal"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"lastName",className:"block mb-2 text-sm font-semibold text-gray-100",children:["Last name ",(0,a.jsx)("span",{className:"text-red-300",children:"*"})]}),(0,a.jsx)("input",{id:"lastName",name:"lastName",value:s,onChange:e=>n(e.target.value),required:!0,autoComplete:"family-name",className:"block w-full px-5 py-3 text-sm text-gray-500 bg-white border border-gray-700 rounded-md focus:border-teal-400 focus:outline-none focus:shadow-outline-teal"})]})]})},QuestionCard=e=>{let{eventId:t,startups:s,firstName:n,lastName:l,canSubmit:o}=e,[m,u]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[g,b]=(0,r.useState)(""),[p,f]=(0,r.useState)(""),[y,v]=(0,r.useState)(!1),handleSubmit=async e=>{if(e.preventDefault(),f(""),b(""),!o){f("Enter your first and last name.");return}v(!0);try{await (0,i.y)("/api/demo-day/engage/questions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventId:t,startupId:m,message:x,firstName:n,lastName:l})}),u(""),h(""),b("Successfully submitted!"),setTimeout(()=>b(""),5e3)}catch(e){f(e.message)}finally{v(!1)}};return(0,a.jsxs)("section",{className:"flex flex-col bg-gray-800 border border-gray-700 rounded-md shadow-lg",children:[(0,a.jsx)(CardHeader,{icon:c,title:"Ask a Question"}),(0,a.jsxs)("form",{onSubmit:handleSubmit,className:"flex flex-col flex-1 p-5",children:[(0,a.jsx)("label",{htmlFor:"startupId",className:"block text-sm font-semibold text-gray-100",children:"Select recipient:"}),(0,a.jsxs)("select",{id:"startupId",value:m,onChange:e=>u(e.target.value),required:!0,className:"block w-full px-5 py-3 mt-2 text-sm text-gray-500 bg-white border border-gray-700 rounded-md focus:border-teal-400 focus:outline-none focus:shadow-outline-teal",children:[(0,a.jsx)("option",{value:"",children:"Choose recipient"}),(0,a.jsx)("optgroup",{label:"Startups",children:s.map(e=>(0,a.jsx)("option",{value:e._id,children:e.name},e._id))})]}),(0,a.jsx)("label",{htmlFor:"message",className:"block mt-5 text-sm font-semibold text-gray-100",children:"Your question:"}),(0,a.jsx)("textarea",{id:"message",value:x,onChange:e=>h(e.target.value),required:!0,placeholder:"Enter your question...",className:"block w-full h-44 px-5 py-3 mt-2 text-sm text-gray-500 placeholder-gray-500 bg-white border border-gray-700 rounded-md resize-y focus:border-teal-400 focus:outline-none focus:shadow-outline-teal"}),p&&(0,a.jsx)("p",{className:"mt-4 text-sm font-semibold text-red-300",children:p}),g&&(0,a.jsx)("p",{className:"mt-4 text-sm font-semibold text-green-400",children:g}),(0,a.jsx)("button",{type:"submit",disabled:y||!o,title:o?"":"Enter your first and last name to submit a question.",className:"inline-flex items-center justify-center w-full px-6 py-4 mt-5 text-sm font-semibold text-white transition duration-150 ease-in-out rounded-md shadow-md bg-sbc-teal hover:bg-sbc-teal disabled:cursor-not-allowed disabled:opacity-60 hover:scale-[1.03]",children:y?(0,a.jsx)(d.Z,{text:"Submitting",colorClass:"text-white"}):"Submit Question"})]})]})},InvestmentGame=e=>{let{eventId:t,startups:s,firstName:n,lastName:o,canSubmit:c}=e,x=(0,r.useMemo)(()=>setInitialInvestments(s),[s]),[h,g]=(0,r.useState)(x),[b,p]=(0,r.useState)(""),[f,y]=(0,r.useState)(""),[v,j]=(0,r.useState)(!1),N=c?"":"Enter your first and last name to play the investment game.",w=c?buildQueryString({eventId:t,firstName:n.trim(),lastName:o.trim()}):"",{data:S=[],isValidating:k,mutate:C}=(0,l.ZP)(w?"/api/demo-day/engage/investments?".concat(w):null,i.y);(0,r.useEffect)(()=>{g(x)},[x]),(0,r.useEffect)(()=>
1{if(!Array.isArray(S))return;let e={...x};S.forEach(t=>{e[t.startupId]&&(e[t.startupId]={investmentId:t.investmentId,amount:t.amount})}),g(e)},[x,S]);let _=Object.values(h).reduce((e,t)=>e+(Number(t.amount)||0),0),I=5e4-_,E=I<0,handleChange=e=>{let{name:t,value:s}=e.target;g(e=>({...e,[t]:{...e[t],amount:Number.parseInt(s,10)||0}}))},handleSubmit=async e=>{if(e.preventDefault(),y(""),p(""),!c){y("Enter your first and last name.");return}j(!0);try{await (0,i.y)("/api/demo-day/engage/investments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventId:t,firstName:n,lastName:o,investments:h})}),await C(),p("Successfully saved!"),setTimeout(()=>p(""),5e3)}catch(e){y(e.message)}finally{j(!1)}},D="Save Investments";return E&&(D="Reduce investments to save"),(0,a.jsxs)("section",{className:"flex flex-col bg-gray-800 border border-gray-700 rounded-md shadow-lg",children:[(0,a.jsx)(CardHeader,{icon:u,title:"Virtual Investment Game"}),(0,a.jsxs)("form",{onSubmit:handleSubmit,className:"flex flex-col flex-1 p-5",children:[(0,a.jsxs)("div",{className:"max-w-3xl prose prose-light",children:[(0,a.jsx)("p",{children:'Get involved and play the role of angel investor. You\'ve got $50,000 virtual currency to "invest" in the startups however you like! You can update your investments as many times as you like while watching Demo Day.'}),(0,a.jsx)("p",{className:"mt-4",children:"To begin, please enter your name. If you happen to refresh this page, don't worry, just enter your name again and your latest saved investments will be displayed again."})]}),s.length>0?(0,a.jsx)("div",{className:"grid gap-5 mt-8 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:s.map(e=>{var t;return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"investment-".concat(e._id),className:"block mb-2 text-sm font-semibold text-gray-100 truncate",title:e.name,children:e.name}),(0,a.jsxs)("div",{className:"relative",title:N,children:[(0,a.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-5 text-sm text-gray-500",children:"$"}),(0,a.jsx)("input",{id:"investment-".concat(e._id),name:e._id,type:"number",min:"0",max:"50000",value:(null===(t=h[e._id])||void 0===t?void 0:t.amount)||0,onChange:handleChange,disabled:v||k||!c,title:N,className:"block w-full py-3 pl-8 pr-5 text-sm text-gray-500 bg-white border border-gray-700 rounded-md focus:border-teal-400 focus:outline-none focus:shadow-outline-teal disabled:cursor-not-allowed disabled:opacity-60"})]})]},e._id)})}):(0,a.jsx)("p",{className:"p-5 mt-6 text-sm text-gray-400 bg-gray-900 border border-gray-700 rounded-md",children:"No startups available for the investment game."}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 pt-5 mt-8 border-t border-gray-700",children:[(0,a.jsxs)("p",{className:"text-lg font-semibold text-gray-100",children:["Remaining money:"," ",(0,a.jsx)("span",{className:E?"text-red-400":"text-green-400",children:m.format(I)})]}),f&&(0,a.jsx)("p",{className:"text-sm font-semibold text-red-300",children:f}),b&&(0,a.jsx)("p",{className:"text-sm font-semibold text-green-400",children:b}),(0,a.jsx)("button",{type:"submit",disabled:v||k||E||!c||0===s.length,title:N,className:"inline-flex items-center justify-center w-full px-6 py-4 text-sm font-semibold text-white transition duration-150 ease-in-out rounded-md shadow-md bg-sbc-teal sm:w-auto hover:bg-sbc-teal disabled:cursor-not-allowed disabled:opacity-60 hover:scale-[1.03]",children:v||k?(0,a.jsx)(d.Z,{text:v?"Saving":"Loading",colorClass:"text-white"}):D})]})]})]})};var x=!0;function DemoDayEngage(e){var t;let{demoDay:s,initialFirstName:l,initialLastName:i}=e,[o,d]=(0,r.useState)(l||""),[m,c]=(0,r.useState)(i||""),u=(null===(t=s.demoDayStartups)||void 0===t?void 0:t.startups)||[],x=!!(o.trim()&&m.trim());return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.PB,{title:"".concat(s.cohort.name," Engage"),noindex:!0}),(0,a.jsx)("div",{className:"min-h-[calc(100vh-13rem)] px-4 py-12 bg-sbc-teal sm:px-6 lg:px-8",children:(0,a.jsxs)("div",{className:"max-w-6xl mx-auto space-y-4",children:[(0,a.jsx)(NameForm,{firstName:o,lastName:m,setFirstName:d,setLastName:c}),(0,a.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[minmax(320px,1fr)_minmax(0,2fr)]",children:[(0,a.jsx)(QuestionCard,{eventId:s._id,startups:u,firstName:o,lastName:m,canSubmit:x}),(0,a.jsx)(InvestmentGame,{eventId:s._id,startups:u,firstName:o,lastName:m,canSubmit:x})]})]})})]})}DemoDayEngage.layout=o.Z}},function(e){e.O(0,[9164,9774,2888,179],function(){return e(e.s=76109)}),_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.