1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3915],{36954:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>_});var r=s(37876),a=s(14232),l=s(89099),i=s(1164),n=s(77489),o=s(63065),c=s(48230),d=s.n(c),x=s(54587),m=s.n(x),u=s(81793),p=s(82251),h=s(83603),g=s(34953),b=s(77861);function f(e){let{label:t,icon:s,options:l,value:n,onChange:o}=e,[c,d]=(0,a.useState)(!1);return(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-grey",children:s}),(0,r.jsx)("label",{className:"text-xs font-semibold text-grey uppercase tracking-wide",children:t})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>d(!c),className:"w-full flex items-center justify-between px-3 py-2.5 bg-greyLight border border-dividerGrey rounded-xl text-sm text-black font-medium hover:border-primary/50 transition-colors",children:[(0,r.jsx)("span",{children:n}),(0,r.jsx)(i.A,{size:15,className:"text-grey transition-transform duration-200 ".concat(c?"rotate-180":"")})]}),c&&(0,r.jsx)("div",{className:"absolute z-10 top-full mt-1 w-full bg-white border border-dividerGrey rounded-xl shadow-lg overflow-hidden",children:l.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>{o(e),d(!1)},className:"w-full text-left px-3 py-2 text-sm transition-colors hover:bg-greyLight ".concat(e===n?"text-primary font-semibold bg-primary/5":"text-black"),children:e},e))})]})]})}function v(e){let{label:t,checked:s,onChange:a}=e;return(0,r.jsxs)("button",{type:"button",onClick:()=>a(!s),className:"flex items-center gap-2.5 group",children:[s?(0,r.jsx)(u.A,{size:17,className:"text-primary flex-shrink-0"}):(0,r.jsx)(p.A,{size:17,className:"text-grey flex-shrink-0"}),(0,r.jsx)("span",{className:"text-sm text-greyDark group-hover:text-black transition-colors",children:t})]})}function y(){let[e,t]=(0,a.useState)("FaceTime HD Camera"),[s,l]=(0,a.useState)("MacBook Pro Microphone"),[i,n]=(0,a.useState)("1080p (Recommended)"),[o,c]=(0,a.useState)(!0),[d,x]=(0,a.useState)(!0),[m,u]=(0,a.useState)(!1),[p,y]=(0,a.useState)(!1);return(0,r.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,r.jsxs)("div",{className:"bg-white border border-dividerGrey rounded-2xl p-5",children:[(0,r.jsx)("h3",{className:"text-sm font-bold text-black mb-4",children:"Stream Settings"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(f,{label:"Camera",icon:(0,r.jsx)(h.A,{size:14}),options:["FaceTime HD Camera","External Webcam","No Camera"],value:e,onChange:t}),(0,r.jsx)(f,{label:"Microphone",icon:(0,r.jsx)(g.A,{size:14}),options:["MacBook Pro Microphone","AirPods Pro","External Mic","No Microphone"],value:s,onChange:l}),(0,r.jsx)(f,{label:"Resolution",icon:(0,r.jsx)(b.A,{size:14}),options:["1080p (Recommended)","720p","480p","360p"],value:i,onChange:n})]})]}),(0,r.jsxs)("div",{className:"bg-white border border-dividerGrey rounded-2xl p-5",children:[(0,r.jsx)("h3",{className:"text-sm font-bold text-black mb-4",children:"Additional Settings"}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)(v,{label:"Enable live chat",checked:o,onChange:c}),(0,r.jsx)(v,{label:"Allow reactions",checked:d,onChange:x}),(0,r.jsx)(v,{label:"Enable stream preview",checked:m,onChange:u}),(0,r.jsx)(v,{label:"Recording (save stream)",checked:p,onChange:y})]})]})]})}var j=s(76679),N=s(37041),w=s(6169);function k(){let e=(0,a.useRef)(null),[t,s]=(0,a.useState)(!0),[l,i]=(0,a.useState)(!0),[n,o]=(0,a.useState)(null),[c,d]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{t?navigator.mediaDevices.getUserMedia({video:!0,audio:!1}).then(t=>{o(t),e.current&&(e.current.srcObject=t)}).catch(()=>d(!0)):(n&&(n.getTracks().forEach(e=>e.stop()),o(null)),e.current&&(e.current.srcObject=null))},[t]),(0,a.useEffect)(()=>()=>{n&&n.getTracks().forEach(e=>e.stop())},[]),(0,r.jsxs)("div",{className:"bg-white border border-dividerGrey rounded-2xl p-5",children:[(0,r.jsx)("h3",{className:"text-sm font-bold text-black mb-4",children:"Preview"}),(0,r.jsxs)("div",{className:"relative w-full aspect-video bg-black rounded-xl overflow-hidden flex items-center justify-center",children:[t&&!c?(0,r.jsx)("video",{ref:e,autoPlay:!0,muted:!0,playsInl
1ine:!0,className:"w-full h-full object-cover"}):(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 text-grey",children:[(0,r.jsx)(j.A,{size:32}),(0,r.jsx)("p",{className:"text-xs",children:c?"Camera permission denied":"Camera is off"})]}),t&&!c&&(0,r.jsxs)("div",{className:"absolute bottom-3 right-3 flex items-center gap-1.5 bg-green/90 text-white text-[10px] font-semibold px-2.5 py-1 rounded-full",children:[(0,r.jsx)(N.A,{size:11}),"Good Connection"]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-4 mt-4",children:[(0,r.jsxs)("button",{onClick:()=>s(!t),className:"flex flex-col items-center gap-1 px-4 py-2 rounded-xl text-xs font-semibold transition-colors ".concat(t?"bg-primary/10 text-primary hover:bg-primary/20":"bg-greyLight text-grey hover:bg-dividerGrey"),children:[t?(0,r.jsx)(h.A,{size:18}):(0,r.jsx)(j.A,{size:18}),t?"Cam On":"Cam Off"]}),(0,r.jsxs)("button",{onClick:()=>i(!l),className:"flex flex-col items-center gap-1 px-4 py-2 rounded-xl text-xs font-semibold transition-colors ".concat(l?"bg-primary/10 text-primary hover:bg-primary/20":"bg-greyLight text-grey hover:bg-dividerGrey"),children:[l?(0,r.jsx)(g.A,{size:18}):(0,r.jsx)(w.A,{size:18}),l?"Mic On":"Mic Off"]})]})]})}var C=s(30179);let S=["Business","Tech","Design","Marketing","Finance","Career","Content","Photography","Education","Health"],A=["Public","Followers Only","Private"];function z(e){let{options:t,value:s,onChange:a,placeholder:l}=e;return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("select",{value:s,onChange:e=>a(e.target.value),className:"w-full appearance-none px-3 py-2.5 bg-greyLight border border-dividerGrey rounded-xl text-sm text-black font-medium focus:outline-none focus:border-primary transition-colors pr-9",children:[l&&(0,r.jsx)("option",{value:"",disabled:!0,children:l}),t.map(e=>(0,r.jsx)("option",{value:e,children:e},e))]}),(0,r.jsx)(i.A,{size:15,className:"absolute right-3 top-1/2 -translate-y-1/2 text-grey pointer-events-none"})]})}function _(){let e=(0,l.useRouter)(),[t,s]=(0,a.useState)(""),[i,c]=(0,a.useState)(""),[x,u]=(0,a.useState)("Business"),[p,h]=(0,a.useState)("Public"),[g,b]=(0,a.useState)(!1),f=async()=>{var s,r,a,l,n,o;if(t.trim()){b(!0);try{let n=new FormData;n.append("title",t),n.append("description",i),n.append("category",x),n.append("audience",p.toLowerCase().replace(/\s+/g,"_")),n.append("record","1");let o=await C.A.post("/live-streams/start",n);console.log("Live stream start response:",o.data);let c=(null==(s=o.data)?void 0:s.content)||(null==(r=o.data)?void 0:r.data)||o.data;console.log("res",o),console.log("responseData",c),(null==c||null==(a=c.stream)?void 0:a.id)?e.push("/go-live/host/".concat(c.stream.stream_key)):alert((null==(l=o.data)?void 0:l.message)||"Failed to start live stream")}catch(e){console.error("Start live error:",e),alert((null==e||null==(o=e.response)||null==(n=o.data)?void 0:n.message)||"Failed to start live stream. Please try again.")}finally{b(!1)}}};return(0,r.jsxs)("div",{className:"min-h-screen bg-offWHite font-sans",children:[(0,r.jsx)("div",{className:"fixed top-0 left-0 w-full h-[61px] bg-white shadow-md z-50 py-3 flex justify-center md:hidden",children:(0,r.jsx)(d(),{href:"/",children:(0,r.jsx)(m(),{width:300,height:300,src:"/images/headerLogo.jpg",alt:"
1Velaflow",className:"h-8 w-auto",priority:!0})})}),(0,r.jsxs)("main",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 pt-20 md:pt-6 pb-24 md:pb-8",children:[(0,r.jsxs)(d(),{href:"/go-live",className:"inline-flex items-center gap-1.5 text-sm font-semibold text-grey hover:text-primary transition-colors mb-6",children:[(0,r.jsx)(n.A,{size:16}),"Back to Go Live"]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_1fr_1fr] gap-5",children:[(0,r.jsxs)("div",{className:"bg-white border border-dividerGrey rounded-2xl p-5 flex flex-col gap-4",children:[(0,r.jsx)("h3",{className:"text-sm font-bold text-black",children:"Stream Details"}),(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsxs)("label",{className:"text-xs font-semibold text-grey uppercase tracking-wide",children:["Title ",(0,r.jsx)("span",{className:"text-red",children:"*"})]}),(0,r.jsx)("input",{type:"text",value:t,onChange:e=>s(e.target.value),placeholder:"Building a Successful Startup in 2025 \uD83D\uDE80",className:"w-full px-3 py-2.5 bg-greyLight border border-dividerGrey rounded-xl text-sm text-black placeholder:text-grey focus:outline-none focus:border-primary transition-colors"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("label",{className:"text-xs font-semibold text-grey uppercase tracking-wide",children:"Description"}),(0,r.jsx)("textarea",{value:i,onChange:e=>c(e.target.value),rows:4,placeholder:"Let's talk about startup ideas, funding, marketing and everything in between. Ask me anything!",className:"w-full px-3 py-2.5 bg-greyLight border border-dividerGrey rounded-xl text-sm text-black placeholder:text-grey focus:outline-none focus:border-primary transition-colors resize-none"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("label",{className:"text-xs font-semibold text-grey uppercase tracking-wide",children:"Category"}),(0,r.jsx)(z,{options:S,value:x,onChange:u})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("label",{className:"text-xs font-semibold text-grey uppercase tracking-wide",children:"Audience"}),(0,r.jsx)(z,{options:A,value:p,onChange:h}),(0,r.jsx)("p",{className:"text-[11px] text-grey mt-0.5",children:"Public"===p?"Anyone can discover and watch your live stream.":"Followers Only"===p?"Only your followers can watch your stream.":"Only people you invite can watch your stream."})]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(y,{})}),(0,r.jsx)("div",{children:(0,r.jsx)(k,{})})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-3 mt-6",children:[(0,r.jsx)(d(),{href:"/go-live",className:"px-6 py-2.5 rounded-xl border border-dividerGrey text-sm font-semibold text-greyDark hover:border-primary hover:text-primary transition-colors bg-white",children:"Cancel"}),(0,r.jsx)("button",{onClick:f,disabled:!t.trim()||g,className:"inline-flex items-center gap-2 px-6 py-2.5 rounded-xl bg-primary text-white text-sm font-semibold hover:bg-primary/90 active:scale-95 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",children:g?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"Starting..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.A,{size:16}),"Go Live Now"]})})]})]})]})}},98169:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/go-live/setup",function(){return s(36954)}])}},e=>{e.O(0,[8947,636,6593,8792],()=>e(e.s=98169)),_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.