1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];if(null!=r)for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:mentortools-frontend":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8fe6719b-3585-49ea-9e0c-9e142b24f827",e._sentryDebugIdIdentifier="sentry-dbid-8fe6719b-3585-49ea-9e0c-9e142b24f827")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2361],{13816:(e,t,r)=>{"use strict";r.d(t,{FV:()=>u,Io:()=>d,Rv:()=>l,Zu:()=>c,j3:()=>p,vi:()=>m,xK:()=>o});var s=r(69884),n=r(22870);let i=/\/live\/([^/?#]+)\/(?:studio|recap)\/?/,a=/\/customer\/live\/([^/?#]+)\/?/;function o(e){let t=e.query.streamSessionId;if("string"==typeof t&&t)return t;if(Array.isArray(t)&&t[0])return t[0];let r=e.query.streamId;if("string"==typeof r&&r)return r;if(Array.isArray(r)&&r[0])return r[0];let s=e.asPath.match(i)??e.asPath.match(a);return s?.[1]}function l(e){let t=e.query.startNow;return"1"===t||"true"===t}function c(e){return"1"===e.query.recordOnStart}function u(e,t){let r={...e.query};return t?r.recordOnStart="1":delete r.recordOnStart,e.replace({pathname:e.pathname,query:r},void 0,{shallow:!0})}function d(e,t){let r=`/live/${e}/studio/`,s=new URLSearchParams;t?.startNow&&s.set("startNow","1"),t?.recordOnStart&&s.set("recordOnStart","1");let n=s.toString();return n?`${r}?${n}`:r}let m=e=>s.C.customerLive.replace("[streamId]",encodeURIComponent(e)),p=e=>{var t;return(t=m(e),new URL((0,n.ZM)(t),window.location.origin)).toString()}},19886:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>A,default:()=>x});var s=r(37876),n=r(14232),i=r(18847),a=r.n(i),o=r(89099),l=r(79378),c=r(66950),u=r(22208),d=r(62902),m=r(31941),p=r(64713),v=r(5157),y=r(12772),h=r(30407),g=r(30942),f=r(69884),w=r(13816);let S=a()(()=>Promise.all([r.e(2456),r.e(130),r.e(6831)]).then(r.bind(r,23355)).then(e=>e.StudentLiveViewer),{loadableGenerated:{webpack:()=>[23355]},ssr:!1,loading:()=>(0,s.jsx)(y.A,{fullHeight:!1})}),b=(0,p.Ay)(c.A)(({theme:e})=>({display:"grid",placeItems:"center",width:72,height:72,borderRadius:"50%",backgroundColor:e.palette.action.hover,color:e.palette.text.secondary})),I=(0,n.memo)(()=>{let e=(0,o.useRouter)(),{t}=(0,g.o)("translation",{keyPrefix:"PAGE.LIVE.viewer"}),r=(0,w.xK)(e),n="string"==typeof e.query.invite?e.query.invite:void 0,{stream:i,isStreamLoading:a,isStreamError:p,streamError:I}=(0,h.xC)(r),A=()=>void e.push(f.C.customerDashboard);return!e.isReady||a?(0,s.jsx)(y.A,{fullHeight:!1}):p?(0,s.jsx)(c.A,{sx:{maxWidth:760,mx:"auto",py:8},children:(0,s.jsx)(l.A,{severity:"warning",action:(0,s.jsx)(u.A,{variant:"text",color:"warning",size:"small",startIcon:(0,s.jsx)(v.A,{icon:"tabler:arrow-left",fontSize:17}),onClick:A,children:t("states.goToDashboard")}),children:(0,s.jsxs)(d.A,{spacing:1,children:[(0,s.jsx)(m.A,{variant:"subtitle2",children:t("states.streamNotFound")}),(0,s.jsx)(m.A,{variant:"body2",children:I instanceof Error?I.message:t("states.streamUnavailable")})]})})}):i?(0,s.jsx)(S,{stream:i,inviteId:n,showShare:!1},i.id):(0,s.jsxs)(d.A,{alignItems:"center",justifyContent:"center",spacing:4,sx:{minHeight:480,textAlign:"center"},children:[(0,s.jsx)(b,{children:(0,s.jsx)(v.A,{icon:"tabler:calendar-time",fontSize:34})}),(0,s.jsxs)(c.A,{children:[(0,s.jsx)(m.A,{variant:"h5",sx:{fontWeight:700},children:t("states.notLiveYetTitle")}),(0,s.jsx)(m.A,{variant:"body2",sx:{color:"text.secondary",mt:2,maxWidth:520},children:t("states.notLiveYetBody")})]}),(0,s.jsx)(u.A,{variant:"outlined",startIcon:(0,s.jsx)(v.A,{icon:"tabler:arrow-left",fontSize:17}),onClick:A,children:t("states.goToDashboard")})]})});var A=!0;let x=I},20231:(e,t,r)=>{"use strict";r.d(t,{U:()=>I});var s=r(81495),n=r(48711),i=r(78028),a=r(22870),o=r(90154),l=r(10881);let c=()=>{let e=l.A.getUser()?.portal?.id;if(null!=e)return String(e);throw Error("Portal session required â sign in to use Live Studio.")},u=e=>{if(!(0,n.F0)(e)||!e.response)return e;let t=(e=>{if("string"==typeof e)return e;if(null==e)return"";try{return JSON.stringify(e)}catch{return String(e)}})(e.response.data);return 401===e.response.status?Error("Unauthorized â the portal session is missing or expired."):t.trimStart().startsWith("<!DOCTYPE")||t.trimStart().startsWith("<html")?Error("Request hit the Next.js app instead of streaming-service. Set NEXT_PUBLIC_STREAMING_SERVICE_URL=https://live.<host> (with CORS_ORIGINS on the server) or fix STREAMING_SERVICE_PROXY_URL in .env.local and restart npm run dev."):Error(`streaming-service ${e.response.status}: ${t.slice(0,300)}`)},d=e=>{if(!(0,n.F0)(e)||!e.response)return e;let t=e.response.data;return Error("object"==typeof t&&null!==t&&"error"in t?String(t.error):`streaming-service ${e.response.status}`)},m=e=>{let t=i.A.create({withCredentials:!0,baseURL:o.A.streamingServiceUrl?.replace(/\/+$/,"")}
1),r="control"===e,s=r?u:d;return t.interceptors.request.use(e=>{var t;let s,n=l.A.getUserToken();if(e.headers.Authorization=`Bearer ${n}`,s=(t=e.url||"").startsWith("/")?t:`/${t}`,e.url=o.A.streamingServiceUrl&&"same-origin"!==o.A.streamingServiceUrl||s.endsWith("/")?s:`${s}/`,e.baseURL=o.A.streamingServiceUrl?.replace(/\/+$/,""),r){e.headers["x-mentor-id"]=c();let t=o.A.streamingControlSecret||"";t&&(e.headers["x-service-secret"]=t)}return e}),t.interceptors.response.use(e=>e,e=>Promise.reject(s(e))),t},p=m("control"),v=m("viewer"),y=(e,t)=>`${(()=>{let e=o.A.streamingWsUrl||o.A.streamingServiceUrl;if(e&&"same-origin"!==e)return e.replace(/^http/,"ws").replace(/\/+$/,"");{let e="https:"===window.location.protocol?"wss:":"ws:";return`${e}//${window.location.host}${(0,a.ZM)("/")}`.replace(/\/+$/,"")}})()}${e}?${t.toString()}`,h=e=>`/v1/livekit/rooms/${encodeURIComponent(e)}`,g=(e,t)=>`/v1/livekit/rooms/${encodeURIComponent(e)}/participants/${encodeURIComponent(t)}`,f=e=>`/v1/livekit/invites/${encodeURIComponent(e)}`,w="/v1/live_streams",S=e=>`/v1/live_streams/${encodeURIComponent(e)}`,b=e=>`/v1/stream-sessions/${encodeURIComponent(e)}`,I={createLivekitRoom:async e=>{let t={displayName:e.displayName};e.title&&(t.title=e.title),(0,s.Yf)(e.streamSessionId)&&(t.streamSessionId=e.streamSessionId);let{data:r}=await p.post("/v1/livekit/rooms",t);return r},stopLivekitRoom:async e=>{let{data:t}=await p.post(`${h(e)}/stop`);return t},stopStreamSession:async e=>{let{data:t}=await p.post(`${b(e)}/stop`);return t},getStreamSession:async e=>{let{data:t}=await p.get(b(e));return t},startRecording:async e=>{let{data:t}=await p.post(`${b(e)}/recording/start`);return t},stopRecording:async e=>{let{data:t}=await p.post(`${b(e)}/recording/stop`);return t},createLivekitInvite:async e=>{let{data:t}=await p.post(`${h(e.roomName)}/invites`,{displayName:e.displayName,ttlMs:e.ttlMs});return t},grantScreenShare:async e=>{let{data:t}=await p.post(`${g(e.roomName,e.identity)}/screenshare`,{allow:e.allow});return t},setParticipantMuted:async e=>{let{data:t}=await p.post(`${g(e.roomName,e.identity)}/mute`,{source:e.source,muted:e.muted});return t},removeParticipant:async e=>{let{data:t}=await p.post(`${g(e.roomName,e.identity)}/remove`);return t},setScreenShareMode:async e=>{let{data:t}=await p.post(`${h(e.roomName)}/screenshare-mode`,{mode:e.mode});return t},getLiveStreamRecap:async e=>{let t,{data:r}=await p.get((t=e,`/v1/live_stream/${encodeURIComponent(t)}/recap`));return r},listLiveStreams:async()=>{let{data:e}=await p.get(w);return e},scheduleLiveStream:async e=>{let{data:t}=await p.post(w,e);return t},updateLiveStream:async(e,t)=>{let{data:r}=await p.patch(S(e),t);return r},getLiveStream:async e=>{let{data:t}=await p.get(S(e));return t},listPublicLiveStreams:async()=>{let{data:e}=await v.get("/v1/live/streams");return e.items??[]},buildAudienceStudioWsUrl:e=>{var t;let r,s;return t=`${h(e)}/audience/studio`,r=new URLSearchParams({mentorId:c()}),(s=o.A.streamingControlSecret||"")&&r.set("secret",s),y(t,r)},buildAudienceViewerWsUrl:(e,t)=>y(`${h(e)}/audience`,new URLSearchParams({displayName:t})),peekLivekitInvite:async e=>{let{data:t}=await v.get(f(e));return t},acceptLivekitInvite:async e=>{let{data:t}=await v.post(`${f(e)}/accept`);return t}}},30407:(e,t,r)=>{"use strict";r.d(t,{Gg:()=>o,xC:()=>a});var s=r(74359),n=r(53497),i=r(20231);let a=e=>{let{data:t,isLoading:r,isError:a,error:o,refetch:l}=(0,s.I)({queryKey:n.t.publicList.queryKey,queryFn:i.U.listPublicLiveStreams,select:t=>t.find(t=>t.id===e),enabled:!!e,refetchInterval:1e4});return{stream:t,isStreamLoading:r,isStreamError:a,streamError:o,refetchStream:l}},o=e=>{let{data:t,isLoading:r,isError:a,error:o}=(0,s.I)({queryKey:n.t.publicList.queryKey,queryFn:i.U.listPublicLiveStreams,select:t=>t.find(t=>t.roomName===e),enabled:!!e,refetchInterval:1e4});return{stream:t,isStreamLoading:r,isStreamError:a,streamError:o}}},38578:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/customer/live/[streamId]",function(){return r(19886)}])},53497:(e,t,r)=>{"use strict";r.d(t,{t:()=>s});let s=(0,r(84961).DY)("liveStreams",{list:null,publicList:null,detail
1:e=>({queryKey:[e]}),recording:e=>({queryKey:[e]}),recap:e=>({queryKey:[e]}),invite:e=>({queryKey:[e]})})},81495:(e,t,r)=>{"use strict";r.d(t,{KS:()=>o,MM:()=>l,Yf:()=>a});let s=["awaiting_publisher","live","recording"],n=["stopped","failed","ready-for-agent"],i=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,a=e=>!!(e&&i.test(e));function o(e){return s.includes(e)}function l(e){return o(e)?"live":n.includes(e)?"completed":"scheduled"}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=38578)),_N_E=e.O()}]); 2//# sourceMappingURL=[streamId]-22f27dd3af2129e4.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.