PageSourceSearch

https://akademia.3dinterier.sk/app/_next/static/chunks/1034.ab056e1df8a1f3cc.js

js 3dinterier.sk collected 2026-10-08 22:00:39 UTC 59,360 bytes, 2 lines download raw bytes

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 n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}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]="91b78ad1-491f-4d64-aef6-69a54afc2d17",e._sentryDebugIdIdentifier="sentry-dbid-91b78ad1-491f-4d64-aef6-69a54afc2d17")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1034],{1034:(e,t,r)=>{r.r(t),r.d(t,{LiveStudio:()=>e_});var n=r(37876),i=r(14232),a=r(18847),s=r.n(a),o=r(89099),l=r(79219),d=r(79378),c=r(94277),u=r(66950),m=r(22208),p=r(66664),h=r(26183),g=r(9236),x=r(38388),y=r(80315),f=r(10266),v=r(62902),b=r(27874),S=r(8600),A=r(31941),w=r(64713),j=r(74234),C=r(5157),k=r(14958),L=r(20231);let I={viewers:[],status:"idle",pendingInviteId:null,lastInvitedId:null,error:null};var E=r(67768),R=r(26042),T=r(19117),M=r(59872);
1let P=1920/1080,O={x:.7,y:.64,w:.26},D=(0,w.Ay)(u.A)(()=>({display:"block",width:"100%",height:"100%",objectFit:"contain",backgroundColor:"#05060a"})),W=(0,w.Ay)(u.A,{shouldForwardProp:e=>"pip"!==e&&"cameraAspect"!==e})(({theme:e,pip:t,cameraAspect:r})=>({position:"absolute",left:`${100*t.x}%`,top:`${100*t.y}%`,width:`${100*t.w}%`,aspectRatio:String(1/r),pointerEvents:"auto",border:"2px solid rgba(255,255,255,0.85)",borderRadius:e.shape.borderRadius,boxShadow:"0 8px 24px rgba(0,0,0,0.45)",cursor:"move"})),z=(0,w.Ay)(u.A)(()=>({position:"absolute",right:4,bottom:4,width:14,height:14,borderRadius:"50%",backgroundColor:"rgba(255,255,255,0.9)",cursor:"nwse-resize"}));function F(e,t,r){return Math.min(r,Math.max(t,e))}let $=(0,i.forwardRef)(function({scene:e,pip:t,blur:r=!1,onPipChange:a,onProgramTrack:s,onError:o},l){let d=(0,i.useRef)(null),c=(0,i.useRef)(null),m=(0,i.useRef)(null),p=(0,i.useRef)(null),h=(0,i.useRef)(null),g=(0,i.useRef)(null),x=(0,i.useRef)(9/16),y=(0,i.useRef)(null),f=(0,i.useRef)(r);f.current=r;let v=(0,i.useRef)(e),b=(0,i.useRef)(t);v.current=e,b.current=t;let S=(0,i.useCallback)(async()=>{let e=c.current,t=h.current;if(!e||!t)return;let r=t.getVideoTracks()[0],n=async()=>{y.current&&(await y.current.destroy().catch(()=>{}),y.current=null),p.current&&(p.current.srcObject=null),e.srcObject=t,await e.play().catch(()=>{})};if(!f.current||!r)return void await n();try{if(!T.Im.isSupported)throw Error("Background blur is not supported in this browser.");let i=p.current;if(!i)throw Error("Blur source element missing.");i.srcObject!==t&&(i.srcObject=t,await i.play().catch(()=>{}));let a={kind:R.CC.Kind.Video,track:r,element:i},s=y.current;s?await s.restart(a):(y.current=s=(0,T.bc)({mode:"background-blur",blurRadius:12}),await s.init(a));let l=s.processedTrack;if(!l||!f.current)return void await n();e.srcObject=new MediaStream([l]),await e.play().catch(()=>{}),o(null)}catch(e){o(e instanceof Error?e.message:String(e)),await n()}},[o]);(0,i.useEffect)(()=>{let e=d.current;if(!e)return;e.width=1920,e.height=1080;let t=e.getContext("2d");if(!t)return;let r=e.captureStream(30).getVideoTracks()[0]??null;r&&(r.contentHint="detail"),s(r);let n=0,i=()=>{try{!function(e,t,r,n,i,a){if(e.fillStyle="#05060a",e.fillRect(0,0,1920,1080),"camera"===t)N(e,n,0,0,1920,1080);else if("screen"===t)V(e,i,0,0,1920,1080);else{V(e,i,0,0,1920,1080);let t=1920*r.w,s=t*a,o=1920*r.x,l=1080*r.y;e.save(),e.shadowColor="rgba(0,0,0,0.45)",e.shadowBlur=18,e.fillStyle="#000",e.fillRect(o-2,l-2,t+4,s+4),e.restore(),N(e,n,o,l,t,s)}}(t,v.current,b.current,c.current,m.current,x.current)}catch{}n=requestAnimationFrame(i)};return n=requestAnimationFrame(i),()=>{cancelAnimationFrame(n),r?.stop(),s(null)}},[s]),(0,i.useEffect)(()=>{if("camera"!==e&&"camera-screen"!==e||h.current)return;let t=!1;return(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({video:{width:1280,height:720},audio:!1});if(t)return void e.getTracks().forEach(e=>e.stop());h.current=e;let r=e.getVideoTracks()[0]?.getSettings();r?.width&&r?.height&&(x.current=r.height/r.width),await S(),o(null)}catch(e){t||o(e instanceof Error?e.message:String(e))}})(),()=>{t=!0}},[e,o,S]),(0,i.useEffect)(()=>{h.current&&S()},[r,S]);let A=(0,i.useCallback)(async()=>{let{stream:e}=await (0,M.cz)(!1);g.current?.getTracks().forEach(e=>e.stop()),g.current=e;let t=m.current;t&&(t.srcObject=e,await t.play().catch(()=>{})),e.getVideoTracks()[0]?.addEventListener("ended",()=>{g.current===e&&(e.getTracks().forEach(e=>e.stop()),g.current=null,m.current&&(m.current.srcObject=null))})},[]),w=(0,i.useCallback)(async()=>{g.current||await A()},[A]);return(0,i.useImperativeHandle)(l,()=>({ensureScreen:w,pickScreen:A}),[w,A]),(0,i.useEffect)(()=>()=>{y.current?.destroy().catch(()=>{}),y.current=null,h.current?.getTracks().forEach(e=>e.stop()),g.current?.getTracks().forEach(e=>e.stop())},[]),(0,n.jsxs)(u.A,{sx:{position:"relative",width:"100%",height:"100%"},children:[(0,n.jsxs)(u.A,{sx:{position:"relative",width:"100%",height:"100%"},children:[(0,n.jsx)(D,{component:"canvas",ref:d}),"camera-screen"===e&&(0,n.jsx)(B,{pip:t,camAspect:x.current,onPipChange:a,canvasRef:d})]}
1),(0,n.jsx)(u.A,{component:"video",ref:c,muted:!0,playsInline:!0,sx:{display:"none"}}),(0,n.jsx)(u.A,{component:"video",ref:m,muted:!0,playsInline:!0,sx:{display:"none"}}),(0,n.jsx)(u.A,{component:"video",ref:p,muted:!0,playsInline:!0,sx:{display:"none"}})]})});function B({pip:e,camAspect:t,onPipChange:r,canvasRef:a}){let s=(0,i.useRef)(null);return(0,i.useEffect)(()=>{function e(e){let n=s.current,i=a.current;if(!n||!i)return;let o=i.getBoundingClientRect();if(0===o.width||0===o.height)return;let l=(e.clientX-n.sx)/o.width,d=(e.clientY-n.sy)/o.height,c=n.start;if("move"===n.mode){let e=c.w*P*t;r({w:c.w,x:F(c.x+l,0,1-c.w),y:F(c.y+d,0,1-e)})}else{let e=F(c.w+l,.12,.6),n=e*P*t;r({w:e,x:F(c.x,0,1-e),y:F(c.y,0,1-n)})}}function n(){s.current=null}return window.addEventListener("pointermove",e),window.addEventListener("pointerup",n),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",n)}},[t,r,a]),(0,n.jsx)(u.A,{sx:{position:"absolute",inset:0,pointerEvents:"none"},"data-sentry-element":"Box","data-sentry-component":"PipOverlay","data-sentry-source-file":"Compositor.tsx",children:(0,n.jsx)(W,{pip:e,cameraAspect:t,onPointerDown:t=>{t.preventDefault(),s.current={mode:"move",sx:t.clientX,sy:t.clientY,start:e}},"data-sentry-element":"PipFrame","data-sentry-source-file":"Compositor.tsx",children:(0,n.jsx)(z,{onPointerDown:t=>{t.stopPropagation(),t.preventDefault(),s.current={mode:"resize",sx:t.clientX,sy:t.clientY,start:e}},"data-sentry-element":"PipResizeHandle","data-sentry-source-file":"Compositor.tsx"})})})}function G(e){return!!e&&e.readyState>=2&&e.videoWidth>0&&e.videoHeight>0}let N=(e,t,r,n,i,a)=>{if(!G(t))return;let s=t.videoWidth,o=t.videoHeight,l=Math.max(i/s,a/o),d=i/l,c=a/l;e.drawImage(t,(s-d)/2,(o-c)/2,d,c,r,n,i,a)},V=(e,t,r,n,i,a)=>{if(!G(t))return;let s=t.videoWidth,o=t.videoHeight,l=Math.min(i/s,a/o),d=s*l,c=o*l;e.drawImage(t,r+(i-d)/2,n+(a-c)/2,d,c)};var K=r(53497),U=r(40097),q=r(74359),H=r(27144);let _={bitrate:"—",fps:"—",resolution:"—",dropped:"0"};var Y=r(79060),J=r(30942),Z=r(69884),Q=r(68010),X=r(97009),ee=r(59549),et=r(81495);let er=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],en=e=>{if(e.scheduledAt){let t=new Date(e.scheduledAt);if(!Number.isNaN(t.getTime()))return t}if(!e.month||!e.day||!e.time)return;let[t,r]=e.time.split(" ")[0].split(":").map(Number),n=er.indexOf(e.month);if(!(n<0))return new Date(new Date().getFullYear(),n,Number(e.day),t||0,r||0)};var ei=r(13816),ea=r(99198);let es=(0,w.Ay)(v.A)(({theme:e})=>({flexDirection:"row",flexWrap:"wrap",gap:e.spacing(4)})),eo=(0,w.Ay)(v.A)(({theme:e})=>({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:e.spacing(3),width:"100%"})),el=(0,w.Ay)(v.A)(({theme:e})=>({flexDirection:"row",alignItems:"center",gap:e.spacing(3),flex:"1 1 100%",padding:e.spacing(3),borderRadius:1.5*e.shape.borderRadius,border:`1px solid ${e.palette.divider}`,[e.breakpoints.up("sm")]:{flex:"1 1 calc(50% - 16px)"}})),ed=(0,w.Ay)(c.A,{shouldForwardProp:e=>"avatarColor"!==e})(({theme:e,avatarColor:t})=>({width:38,height:38,backgroundColor:t,color:e.palette.common.white,fontWeight:600})),ec=(0,w.Ay)(u.A)(({theme:e})=>({padding:e.spacing(.25,1.5),borderRadius:.75*e.shape.borderRadius,backgroundColor:e.palette.primary.main,color:e.palette.common.white,fontSize:10,fontWeight:700})),eu=({guests:e,canModerateAudio:t=!1,allGuestsMuted:r=!1,onToggleAllMics:i,onToggleMic:a,onToggleCam:s,onRemove:o})=>{let{t:l}=(0,J.o)("translation",{keyPrefix:"PAGE.LIVE.studio"}),d=e.filter(e=>"guest"===e.role).length,c=l(r?"guests.unmuteAll":"guests.muteAll");return(0,n.jsxs)(es,{"data-sentry-element":"GuestControlCards","data-sentry-component":"GuestControlList","data-sentry-source-file":"GuestControlList.tsx",children:[(0,n.jsxs)(eo,{"data-sentry-element":"GuestControlToolbar","data-sentry-source-file":"GuestControlList.tsx",children:[(0,n.jsxs)(A.A,{variant:"body2",sx:{fontWeight:600},"data-sentry-element":"Typography","data-sentry-source-file":"GuestControlList.tsx",children:[l("tabs.guests")," (",d,")"]}),t&&d>0&&(0,n.jsx)(m.A,{size:"small",variant:r?"contained":"outlined",color:r?"success":"error",startIcon:(0,n.jsx)(C.A,{icon:r?"tabler:microphone":"tabler:microphone-off",fontSize:17}),onClick:i,sx:{minWidth:122,justifyContent:"center",whiteSpace:"nowrap"},children:c})]}),e.map(e=>(0,n.jsxs)(el,{children:[(0,n.jsx)(ed,{avatarColor:e.color,children:e.initials}),(0,n.jsxs)(u.A,{sx:{flex:1,minWidth:0},children:[(0,n.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:2,children:[(0,n.jsx)(A.A,{variant:"body2",sx:{fontWeight:600},noWrap:!0,children:e.name}),"host"===e.role&&(0,n.jsx)(ec,{children:l("guests.host")})]}),(0,n.jsx)(A.A,{variant:"caption",sx:{color:e.micOn?"text.secondary":"error.main"},children:((e,t)=>{if(e.moderationMuted)return t("guests.mutedByOwner");if(!e.micOn)return t("guests.muted");let r=t("guests.micOn"),n=t(e.camOn?"guests.camOn":"guests.camOff");return`${r} \xb7 ${n}`})(e,l)})]}),"guest"===e.role&&(0,n.jsxs)(v.A,{direction:"row",spacing:1,children:[t&&(0,n.jsx)(S.A,{title:l(e.moderationMuted?"guests.unmuteParticipant":"guests.muteParticipant",{name:e.name}),children:(0,n.jsx)(h.A,{size:"small",color:e.moderationMuted?"error":"default",onClick:()=>a?.(e.id),"aria-label":l(e.moderationMuted?"guests.unmuteParticipant":"guests.muteParticipant",{name:e.name}),children:(0,n.jsx)(C.A,{icon:e.moderationMuted||!e.micOn?"tabler:microphone-off":"tabler:microphone",fontSize:18})})}),(0,n.jsx)(h.A,{size:"small",onClick:()=>s?.(e.id),color:e.camOn?"default":"error",children:(0,n.jsx)(C.A,{icon:e.camOn?"tabler:video":"tabler:video-off",fontSize:18})}),(0,n.jsx)(h.A,{size:"small",color:"error",onClick:()=>o?.(e.id),children:(0,n.jsx)(C.A,{icon:"tabler:x",fontSize:18})})]})]},e.id))]})};var em=r(16361);let ep=(0,w.Ay)(m.A)(()=>({minWidth:176,height:38,justifyContent:"center",whiteSpace:"nowrap"})),eh=({recording:e,recordOnStart:t,onRecordOnStartConsumed:r,disabled:a=!1,compact:s=!1})=>{let{t:o,tOriginal:l}=(0,J.o)("translation",{keyPrefix:"PAGE.LIVE.studio"}),{notify:d}=(0,em.A)(),c=(0,i.useRef)(!1),u="recording"===e.status,m="processing"===e.status,g="ready"===e.status,x="idle"===e.status&&"live"!==e.sessionStatus,y=(0,i.useCallback)((e,t)=>{let r=o(t);d(e.message?`${r} ${e.message}`:r,{type:"error"})},[d,o]),f=(0,i.useCallback)(()=>{e.isPending||"idle"!==e.status||"live"!==e.sessionStatus||e.startRecording().catch(e=>y(e,"recordingStartFailed"))},[e,y]),v=(0,i.useCallback)(()=>{!e.isPending&&u&&e.stopRecording().catch(e=>y(e,"recordingStopFailed"))},[u,e,y]);(0,i.useEffect)(()=>{t&&"idle"===e.status&&"live"===e.sessionStatus&&!c.current&&(c.current=!0,r(),f())},[r,t,e.sessionStatus,e.status,f]);let b=(0,i.useMemo)(()=>x?{color:"info",icon:"tabler:loader-2",label:o("waitingForPublisher")}:m?{color:"info",icon:"tabler:loader-2",label:o("processingRecording")}:g?{color:"success",icon:"tabler:circle-check",label:o("recordingReady")}:u?{color:"error",icon:"tabler:circle-filled",label:o("stopRecording"),onClick:v}:{color:"warning",icon:"tabler:player-record",label:o("startRecording"),onClick:f},[m,g,u,x,f,v,o]);if(e.isError)return s?(0,n.jsx)(S.A,{title:l("PORTAL_SETTINGS.retry"),children:(0,n.jsx)("span",{children:(0,n.jsx)(h.A,{color:"error","aria-label":l("PORTAL_SETTINGS.retry"),title:e.error?.message,onClick:()=>void e.refetch(),sx:{width:40,height:40},children:(0,n.jsx)(C.A,{icon:"tabler:refresh",fontSize:18})})})}):(0,n.jsx)(ep,{variant:"outlined",color:"error",startIcon:(0,n.jsx)(C.A,{icon:"tabler:refresh",fontSize:18}),title:e.error?.message,onClick:()=>void e.refetch(),children:l("PORTAL_SETTINGS.retry")});let A=b.label;e.isStarting?A=o("startingRecording"):e.isStopping&&(A=o("stoppingRecording"));let w=e.isPending||x||m,j=a||e.isPending||x||m||g;return s?(0,n.jsx)(S.A,{title:A,children:(0,n.jsx)("span",{children:(0,n.jsx)(h.A,{color:b.color,onClick:b.onClick,disabled:j,"aria-label":A,sx:{width:40,height:40,backgroundColor:"rgba(255,255,255,0.08)"},children:w?(0,n.jsx)(p.A,{size:16,color:"inherit"}):(0,n.jsx)(C.A,{icon:b.icon,fontSize:19})})})}):(0,n.jsx)(ep,{variant:"outlined",color:b.color,startIcon:w?(0,n.jsx)(p.A,{size:16,color:"inherit"}):(0,n.jsx)(C.A,{icon:b.icon,fontSize:18}),onClick:b.onClick,disabled:j,"data-sentry-element":"RecordingActionButton","data-sentry-component":"RecordingButton","data-sentry-source-file":"RecordingButton.tsx",children:A})};var eg=r(36043),ex=r(83383);let ey=(0,w.Ay)(v.A)(({theme:e})=>({flexDirection:"row",alignItems:"center",gap:e.spacing(1.5),color:e.palette.text.secondary})),ef=({chatControls:e,latestOwnMessageId:t,isLive:r,messages:i,viewers:a})=>{let{t:s}=(0,J.o)();return(0,n.jsx)(ex.r,{messages:i,title:s("PAGE.LIVE.studio.liveChat"),headerAction:(0,n.jsxs)(ey,{children:[(0,n.jsx)(C.A,{icon:"tabler:eye",fontSize:18}),(0,n.jsx)(A.A,{variant:"caption",sx:{fontWeight:600},children:a})]}),emptyMessage:s("PAGE.LIVE.viewer.chat.noMessages"),scrollToEndKey:t,composer:{placeholder:s("PAGE.LIVE.studio.replyPlaceholder"),sendLabel:s("PAGE.LIVE.viewer.chat.send"),disabled:!r||!e,isSe
1nding:e?.isSending,onSend:t=>e?.send(t),getErrorMessage:e=>e instanceof Error?e.message:s("PAGE.LIVE.studio.chat.sendError")},sx:{gap:4,p:4,width:{xs:"100%",lg:320},flexShrink:0,height:{lg:"calc(100vh - 140px)"},position:{lg:"sticky"},top:{lg:6}},headerSx:{p:0},messagesSx:{p:0},composerSx:{p:0},"data-sentry-element":"LiveChat","data-sentry-component":"LiveStudioChat","data-sentry-source-file":"LiveStudioChat.tsx"})},ev=s()(()=>Promise.all([r.e(130),r.e(368)]).then(r.bind(r,70368)).then(e=>e.LiveKitEngine),{loadableGenerated:{webpack:()=>[70368]},ssr:!1}),eb=[{scene:"camera",labelKey:"source.camera",icon:"tabler:video"},{scene:"screen",labelKey:"source.screen",icon:"tabler:device-desktop"},{scene:"camera-screen",labelKey:"source.camScreen",icon:"tabler:layout-picture-in-picture"}],eS=(0,w.Ay)(u.A,{shouldForwardProp:e=>"isLive"!==e})(({theme:e,isLive:t})=>({display:"inline-flex",alignItems:"center",gap:e.spacing(1.5),padding:e.spacing(1.5,3),borderRadius:4*e.shape.borderRadius,border:`1px solid ${e.colorWithOpacity(e.palette.error.main,30)}`,color:t?e.palette.error.main:e.palette.text.secondary,fontSize:12,fontWeight:700})),eA=(0,w.Ay)(u.A,{shouldForwardProp:e=>"isLive"!==e})(({theme:e,isLive:t})=>({display:"inline-flex",alignItems:"center",gap:e.spacing(1.5),padding:e.spacing(1,2.5),borderRadius:e.shape.borderRadius,backgroundColor:t?e.palette.error.main:e.palette.grey[700],color:e.palette.common.white,fontSize:12,fontWeight:700})),ew=(0,w.Ay)(u.A,{shouldForwardProp:e=>"light"!==e})(({theme:e,light:t=!1})=>({width:7,height:7,borderRadius:"50%",backgroundColor:t?e.palette.common.white:e.palette.error.main})),ej=(0,w.Ay)(v.A)(({theme:e})=>({padding:e.spacing(1),borderRadius:1.5*e.shape.borderRadius,backgroundColor:"rgba(255,255,255,0.06)"})),eC=(0,w.Ay)(v.A)(({theme:e})=>({padding:e.spacing(1.5,3),borderRadius:e.shape.borderRadius,backgroundColor:"rgba(255,255,255,0.06)"})),ek=(0,w.Ay)(A.A)(({theme:e})=>({color:e.palette.common.white,fontWeight:600,fontVariantNumeric:"tabular-nums"})),eL=(0,w.Ay)(v.A)(({theme:e})=>({flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:e.spacing(4)})),eI=(0,w.Ay)(u.A)(({theme:e})=>({borderRadius:2*e.shape.borderRadius,overflow:"hidden",background:"linear-gradient(160deg, #11151F 0%, #0A0C12 100%)",border:"1px solid rgba(255,255,255,0.06)",display:"flex",flexDirection:"column",minHeight:520})),eE=(0,w.Ay)(v.A)(({theme:e})=>({flexDirection:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:e.spacing(3),padding:e.spacing(4),[e.breakpoints.down("sm")]:{padding:e.spacing(3)}})),eR=(0,w.Ay)(v.A)(({theme:e})=>({display:"none",marginLeft:"auto",[e.breakpoints.up("sm")]:{display:"flex"},[e.breakpoints.up("xl")]:{display:"none"}})),eT=(0,w.Ay)(v.A)(({theme:e})=>({display:"flex",marginLeft:"auto",[e.breakpoints.up("sm")]:{display:"none"}})),eM=(0,w.Ay)(h.A,{shouldForwardProp:e=>"active"!==e})(({theme:e,active:t})=>({width:40,height:40,backgroundColor:t?e.palette.success.main:e.colorWithOpacity(e.palette.common.white,8),color:e.palette.common.white})),eP=(0,w.Ay)(v.A)(({theme:e})=>({flexDirection:"row",alignItems:"center",gap:e.spacing(1.5),color:e.palette.grey[400]})),eO=(0,w.Ay)(v.A)(({theme:e})=>({flexDirection:"row",alignItems:"center",gap:e.spacing(1.5),padding:e.spacing(1,2.5),borderRadius:4*e.shape.borderRadius,border:`1px solid ${e.colorWithOpacity(e.palette.success.main,40)}`,color:e.palette.success.main})),eD=(0,w.Ay)(v.A,{shouldForwardProp:e=>"isLive"!==e})(({theme:e,isLive:t})=>({flexDirection:"row",alignItems:"center",gap:e.spacing(1.5),padding:e.spacing(1.5,3),borderRadius:e.shape.borderRadius,backgroundColor:"rgba(255,255,255,0.06)",color:t?e.palette.success.main:e.palette.grey[500]})),eW=(0,w.Ay)(eD)(()=>({width:40,minWidth:40,height:40,justifyContent:"center",padding:0})),ez=(0,w.Ay)(h.A)(({theme:e})=>({width:40,height:40,backgroundColor:e.colorWithOpacity(e.palette.error.main,14)})),eF=(0,w.Ay)(h.A)(({theme:e})=>({width:40,height:40,color:e.palette.common.white,backgroundColor:e.colorWithOpacity(e.palette.common.white,8)})),e$=(0,w.Ay)(v.A,{shouldForwardProp:e=>"overlayColor"!==e&&"overlaySpacing"!==e&&"overlayZIndex"!==e})(({theme:e,overlayColor:t,overlaySpacing:r,overlayZIndex:n})=>({position:"absolute",inset:0,zIndex:n,alignItems:"center",justifyContent:"center",gap:e.spacing(r),backgroundColor:t})),eB=(0,w.Ay)(d.A)(()=>({position:"absolute",bottom:16,left:16,right:16,zIndex:3})),eG=(0,w.Ay)(u.A)(({theme:e})=>({position:"absolute",bottom:16,left:16,zIndex:1,padding:e.spacing(2,3),borderRadius:e.shape.borderRadius,backgroundColor:"rgba(0,0,0,0.55)",pointerEvents:"none"})),eN=(0,w.Ay)(v.A)(({theme:e})=>({flexDirection:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:e.spacing(3),padding:e.spacing(4),borderTop:`1px solid ${e.palette.divider}`,[e.breakpoints.down("sm")]:{alignItems:"stretch",padding:e.spacing(3)}})),eV=(0,w.Ay)(v.A)(({theme:e})=>({flexDirection:"row",alignItems:"center",justifyContent:"space-between",flex:1,padding:e.spacing(3,4),borderRadius:1.5*e.shape.borderRadius,border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.action.hover})),eK=(0,w.Ay)(u.A)(({theme:e})=>({width:8,height:8,borderRadius:"50%",backgroundColor:e.palette.success.main})),eU=(0,w.Ay)(v.A)(({theme:e})=>({flexDirection:"row",flexWrap:"wrap",gap:e.spacing(4)})),eq=(0,w.Ay)(v.A)(({theme:e})=>({alignItems:"center",gap:e.spacing(2),width:"calc(50% - 8px)",padding:e.spacing(4),borderRadius:1.5*e.shape.borderRadius,border:`1px solid ${e.palette.divider}`,textAlign:"center",[e.breakpoints.up("sm")]:{width:168}})),eH=(0,w.Ay)(c.A,{shouldForwardProp:e=>"avatarColor"!==e})(({avatarColor:e})=>({backgroundColor:e,width:48,height:48,fontSize:15,fontWeight:600})),e_=({stream:e})=>{let t,r,a,s,c,w=(0,j.A)(),R=(0,o.useRouter)(),{t:T,tOriginal:M}=(0,J.o)("translation",{keyPrefix:"PAGE.LIVE.studio"}),{user:P,currentRoleGetter:{isContentCreator:D}}=(0,k.A)(),[W,z]=(0,i.useState)("audience"),[F,B]=(0,i.useState)([]),[G,N]=(0,i.useState)(null),[V,er]=(0,i.useState)(Date.now()),[es,eo]=(0,i.useState)(!1),{anchor:el,isOpen:ed,open:ec,close:em}=(0,Y.A)(),[ep,ex]=(0,i.useState)(new Set),ey=(0,i.useRef)(null),e_=en(e),eY=function(e,t=Date.now()){if
1("scheduled"!==e.sessionStatus)return!1;let r=en(e);return!!r&&r.getTime()>t}(e,V),eJ=function(e,t=Date.now()){if("scheduled"!==e.sessionStatus)return!1;let r=en(e);return!r||r.getTime()<=t}(e,V);(0,i.useEffect)(()=>{if(!eY||!e_)return;let e=window.setInterval(()=>er(Date.now()),1e3);return()=>window.clearInterval(e)},[eY,e_]);let eZ=(0,ei.Rv)(R),eQ=D&&(0,ei.Zu)(R),eX=function({streamSessionId:e,displayName:t,title:r,autoStart:n=!1}){let a,s,o,l,d,c,u,m,p,h,g,x,y=(0,E.jE)(),f=(0,i.useRef)(null),[v,b]=(0,i.useState)("camera"),[S,A]=(0,i.useState)(O),[w,j]=(0,i.useState)(null),[C,k]=(0,i.useState)(null),[I,R]=(0,i.useState)({kind:"idle"}),[T,M]=(0,i.useState)(0),[P,D]=(0,i.useState)(0),[W,z]=(0,i.useState)(0),[F,$]=(0,i.useState)(null),[B,G]=(0,i.useState)(Date.now()),[N,V]=(0,i.useState)(_),[Y,J]=(0,i.useState)([]),[Z,Q]=(0,i.useState)(null),[X,ee]=(0,i.useState)(!0),[et,er]=(0,i.useState)(!1),[en,ei]=(0,i.useState)(null),ea=(0,i.useRef)(()=>{}),es=(0,i.useRef)(null),eo=(0,i.useRef)(null),el=(a=(0,q.I)((0,H.YP)(e)),s=(0,E.jE)(),o=(0,U.n)({mutationFn:L.U.startRecording,onSuccess:(e,t)=>{s.setQueryData(K.t.recording(t).queryKey,e)}}),l=(0,E.jE)(),d=(0,U.n)({mutationFn:L.U.stopRecording,onSuccess:(e,t)=>{l.setQueryData(K.t.recording(t).queryKey,e)}}),c=o.mutateAsync,u=d.mutateAsync,m=(0,i.useRef)(null),p=(0,i.useCallback)(e=>{let t=e.then(e=>(m.current===t&&(m.current=null),e),e=>{throw m.current===t&&(m.current=null),e});return m.current=t,t},[]),h=(0,i.useCallback)(()=>m.current?m.current:p(c(e)),[c,e,p]),g=(0,i.useCallback)(()=>m.current?m.current:p(u(e)),[u,e,p]),x=(0,i.useCallback)(async()=>{await m.current},[]),{status:a.data?.recordingStatus,sessionStatus:a.data?.status,error:a.error,isError:a.isError,isLoading:a.isLoading,isStarting:o.isPending,isStopping:d.isPending,isPending:a.isLoading||o.isPending||d.isPending,startRecording:h,stopRecording:g,waitForPendingRequest:x,refetch:a.refetch}),ed=el.waitForPendingRequest,ec="connected"===I.kind,eu=ec&&I.live,em="connected"===I.kind?I.room:null;(0,i.useEffect)(()=>{if(!eu)return;let e=window.setInterval(()=>G(Date.now()),1e3);return()=>window.clearInterval(e)},[eu]),(0,i.useEffect)(()=>{eu&&null===F&&$(Date.now()),ec||$(null)},[eu,ec,F]),(0,i.useEffect)(()=>{D(e=>Math.max(e,T))},[T]),(0,i.useEffect)(()=>{ec||D(0)},[ec]);let ep=(0,i.useCallback)(e=>{if("screen"===e||"camera-screen"===e){let t=f.current;if(t)return void t.ensureScreen().then(()=>{b(e),k(null)}).catch(e=>k(e instanceof Error?e.message:String(e)))}b(e)},[]),eh=(0,i.useCallback)(()=>{f.current?.pickScreen().then(()=>k(null)).catch(e=>k(e instanceof Error?e.message:String(e)))},[]),eg=(0,i.useCallback)(async()=>{R({kind:"connecting"});try{try{(await navigator.mediaDevices.getUserMedia({audio:!0,video:!1})).getTracks().forEach(e=>e.stop())}catch(t){let e=t instanceof Error?t.message:String(t);throw Error(`Microphone access denied: ${e}. Allow the browser to use your microphone, then try again.`)}let n=await L.U.createLivekitRoom({displayName:t,streamSessionId:e,title:r});es.current=n.roomName,R({kind:"connected",room:n,live:!1})}catch(e){R({kind:"error",message:e instanceof Error?e.message:"Failed to create room"})}},[t,e,r]),ex=(0,i.useRef)(!1);(0,i.useEffect)(()=>{n&&!ex.current&&"idle"===I.kind&&(ex.current=!0,eg())},[n,eg,I.kind]);let ey=(0,i.useCallback)(()=>{R(e=>"connected"===e.kind?{...e,live:!0}:e)},[]),ef=(0,i.useCallback)(t=>{if(eo.current)return eo.current;er(!0),ei(null);let r=(async()=>{await ed(),await L.U.stopLivekitRoom(t);let r=await L.U.stopStreamSession(e);y.setQueryData(K.t.recording(e).queryKey,r),await Promise.all([y.invalidateQueries({queryKey:K.t.list.queryKey}),y.invalidateQueries({queryKey:K.t.recap(e).queryKey})])})().then(()=>{eo.current===r&&(eo.current=null),es.current=null,er(!1),R({kind:"idle"})},e=>{throw eo.current===r&&(eo.current=null),er(!1),ei(e instanceof Error?e.message:"Failed to end the live stream. Please try again."),e});return eo.current=r,r},[y,e,ed]),ev=(0,i.useCallback)(()=>{if("connected"===I.kind){if(I.live){R({kind:"idle"}),ef(I.room.roomName).catch(()=>{});return}R({kind:"error",message:"LiveKit disconnected before media could publish. Check microphone permissions and LiveKit connectivity."})}},[I,ef]),eb=(0,i.useCallback)(e=>{R({kind:"error",message:`LiveKit error: ${e.message}`})},[]),eS=(0,i.useCallback)(async()=>{let e="connected"===I.kind?I.room.roomName:es.current;e&&await ef(e)},[I,ef]),eA=(0,i.useCallback)(e=>{ee(e.micOn),ea.current=e.toggleMic},[]),ew=(0,i.useCallback)(()=>{ea.current()},[]),ej=eu&&F?Math.max(0,Math.floor((B-F)/1e3)):0;return{compositorRef:f,scene:v,pip:S,programTrack:w,compositorError:C,phase:I,room:em,isConnected:ec,isLive:eu,isEnding:et,endError:en,recording:el,viewerCount:T,setViewerCount:M,peakViewers:P,onStageCount:W,setOnStageCount:z,healthStats:N,setHealthStats:V,guests:Y,setGuests:J,guestActions:Z,setGuestActions:Q,elapsedSeconds:ej,micOn:X,toggleMic:ew,onMicStateChange:eA,selectScene:ep,changeScreen:eh,goLive:eg,onLkConnected:ey,onLkDisconnected:ev,onLkError:eb,endStream:eS,setProgramTrack:j,setCompositorError:k,setPip:A}}({streamSessionId:e.id,displayName:P?.fullName||e.host,title:e.title,autoStart:(0,et.KS)(e.sessionStatus)||eZ}),e0=(0,i.useRef)(0),e1=eX.setGuests,e2=(0,i.useCallback)(e=>{let t=new Set(e.filter(e=>"guest"===e.role).map(e=>e.id));ex(e=>{let r=new Set([...e].filter(e=>t.has(e)));return r.size===e.size?e:r});let r=e.filter(e=>"guest"===e.role).length;e0.current>0&&0===r&&eo(!1),e0.current=r,e1(e)},[e1]),e5="scheduled"===e.sessionStatus&&eJ&&!eY&&!eZ&&"idle"===eX.phase.kind,e6=(0,i.useCallback)(e=>{(0,ei.FV)(R,e)},[R]),e4=function(e){let[t,r]=(0,i.useState)(I),n=(0,i.useRef)(null);(0,i.useEffect)(()=>{let t;if(!e)return void r(I);let i=!1,a=null,s=0,o=()=>
1{if(!i){r(e=>({...e,status:"connecting",error:null}));try{a=new WebSocket(L.U.buildAudienceStudioWsUrl(e))}catch{return}n.current=a,a.addEventListener("open",()=>{s=0,r(e=>({...e,status:"open",error:null}))}),a.addEventListener("close",()=>{if(i)return;n.current=null,r(e=>({...e,status:"closed"}));let e=Math.min(1e3*2**s,8e3);s+=1,t=window.setTimeout(o,e)}),a.addEventListener("message",e=>{let t;try{t=JSON.parse(e.data)}catch{return}let n=t;"snapshot"===n.type?r(e=>({...e,viewers:n.viewers})):"viewer-joined"===n.type?r(e=>({...e,viewers:e.viewers.some(e=>e.viewerId===n.viewer.viewerId)?e.viewers:[...e.viewers,n.viewer]})):"viewer-left"===n.type?r(e=>({...e,viewers:e.viewers.filter(e=>e.viewerId!==n.viewerId)})):"invite-sent"===n.type?(r(e=>({...e,pendingInviteId:null,lastInvitedId:n.viewerId})),window.setTimeout(()=>{r(e=>e.lastInvitedId===n.viewerId?{...e,lastInvitedId:null}:e)},2500)):("invite-failed"===n.type||"error"===n.type)&&r(e=>({...e,pendingInviteId:null,error:"invite-failed"===n.type?`Invite failed: ${n.error}`:n.error}))})}};return o(),()=>{i=!0,t&&window.clearTimeout(t),n.current=null,a?.close()}},[e]);let a=(0,i.useCallback)(e=>{let t=n.current;t&&t.readyState===WebSocket.OPEN&&(r(t=>({...t,pendingInviteId:e,error:null})),t.send(JSON.stringify({type:"invite-viewer",viewerId:e})))},[]);return{...t,inviteViewer:a}}(eX.room?.roomName),e3=e4.viewers.length||eX.viewerCount,e8=F.map((e,t)=>{let r=e.from?.name||e.from?.identity||T("chat.guest"),n=e.from?.isLocal??!1;return{id:e.id||`${r}-${e.timestamp}-${t}`,initials:(0,ee.w8)(r),name:n?T("chat.you"):r,isOwn:n,color:(0,ee.Cl)(e.from?.identity||r),time:new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),text:e.message}}),e7=(0,i.useCallback)(e=>{B(t=>{let r=new Map(t.map(e=>[e.id,e]));return e.forEach(e=>r.set(e.id,e)),[...r.values()].sort((e,t)=>e.timestamp-t.timestamp)})},[]),e9=[...e8].reverse().find(e=>e.isOwn)?.id,te=eX.guests.filter(e=>"guest"===e.role),tt=eX.guests.map(e=>{let t=ep.has(e.id);return{id:e.id,name:e.name,initials:(0,ee.w8)(e.name),color:(0,ee.Cl)(e.id),role:e.role,micOn:e.micOn&&!t,moderationMuted:t,camOn:e.camOn,speaking:e.speaking,wantsToShareScreen:e.wantsToShareScreen}}),tr=te.length,tn=tr>0&&te.every(e=>ep.has(e.id)),ti=e=>{D&&ex(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},ta=()=>{D&&0!==te.length&&ex(e=>{let t=new Set(e);return tn?te.forEach(e=>t.delete(e.id)):te.forEach(e=>t.add(e.id)),t})},ts=async()=>{try{await eX.endStream(),await R.push(Z.C.liveRecap.replace("[streamId]",encodeURIComponent(e.id)))}catch{}},to=()=>{eX.isConnected&&ey.current?ey.current():ts()},tl="connecting"===eX.phase.kind||eX.isEnding||eX.recording.isPending||eY||e5,td=T(es?"exitStageMode":"inviteToStage"),tc=eX.isLive?T("connection.excellent"):"—",tu=[{label:T("audience.watching"),value:e3},{label:T("audience.peak"),value:eX.peakViewers||e3},{label:T("audience.comments"),value:e8.length}],tm=[{label:T("health.videoBitrate"),value:eX.healthStats.bitrate},{label:T("health.fps"),value:eX.healthStats.fps},{label:T("health.audioBitrate"),value:"128 kbps"}],tp=()=>eX.isLive?T("youAreLive").toUpperCase():eY?T("comingSoon.badge").toUpperCase():e5?T("readyToStart.badge").toUpperCase():"connecting"===eX.phase.kind?T("status.starting").toUpperCase():"error"===eX.phase.kind?T("status.error").toUpperCase():T("status.offline").toUpperCase();return(0,n.jsxs)(v.A,{spacing:5,"data-sentry-element":"Stack","data-sentry-component":"LiveStudio","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsxs)(eL,{"data-sentry-element":"StudioBreadcrumbBar","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(Q.A,{separator:(0,n.jsx)(C.A,{icon:"tabler:chevron-right"}),data:[{href:Z.C.live,text:M("NAVIGATION.live")},{text:e.title,isActive:!0},{text:T("breadcrumb"),isActive:!0}],"data-sentry-element":"BreadCrumbs","data-sentry-source-file":"LiveStudio.tsx"}),(0,n.jsxs)(eS,{isLive:eX.isLive,"data-sentry-element":"StudioStatusBadge","data-sentry-source-file":"LiveStudio.tsx",children:[eX.isLive&&(0,n.jsx)(ew,{}),tp()]})]}),"error"===eX.phase.kind&&(0,n.jsx)(d.A,{severity:"error",action:(0,n.jsx)(m.A,{onClick:()=>void eX.goLive(),children:M("PORTAL_SETTINGS.retry")}),children:eX.phase.message}),eX.endError&&(0,n.jsx)(d.A,{severity:"error",action:(0,n.jsx)(m.A,{disabled:eX.isEnding,onClick:()=>void ts(),children:M("PORTAL_SETTINGS.retry")}),children:eX.endError}),e4.error&&(0,n.jsx)(d.A,{severity:"warning",children:e4.error}),(0,n.jsxs)(v.A,{direction:{xs:"column",lg:"row"},spacing:5,alignItems:"stretch","data-sentry-element":"Stack","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsxs)(v.A,{spacing:5,sx:{flex:1,minWidth:0},"data-sentry-element":"Stack","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsxs)(eI,{"data-sentry-element":"StudioPlayer","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsxs)(eE,{"data-sentry-element":"StudioPlayerHeader","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:{xs:1.5,sm:3},sx:{flexWrap:"wrap"},"data-sentry-element":"Stack","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsxs)(eA,{isLive:eX.isLive,"data-sentry-element":"BroadcastBadge","data-sentry-source-file":"LiveStudio.tsx",children:[eX.isLive&&(0,n.jsx)(ew,{light:!0}),(eX.isLive?T("live"):tp()).toUpperCase()]}),(0,n.jsx)(A.A,{sx:{color:"common.white",fontVariantNumeric:"tabular-nums",fontWeight:600},"data-sentry-element":"Typography","data-sentry-source-file":"LiveStudio.tsx",children:(0,ee.je)(eX.elapsedSeconds)}),(0,n.jsxs)(eP,{"data-sentry-element":"ViewerCount","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(C.A,{icon:"tabler:eye",fontSize:18,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"}),(0,n.jsxs)(A.A,{variant:"body2","data-sentry-element":"Typography","data-sentry-source-file":"LiveStudio.tsx",children:[e3,(0,n.jsxs)(u.A,{component:"span",sx:{dis
1play:{xs:"none",sm:"inline"}},"data-sentry-element":"Box","data-sentry-source-file":"LiveStudio.tsx",children:[" ",T("viewers")]})]})]}),es&&(0,n.jsxs)(eO,{children:[(0,n.jsx)(C.A,{icon:"tabler:users",fontSize:16}),(0,n.jsxs)(A.A,{variant:"caption",sx:{fontWeight:600},children:[(0,n.jsx)(u.A,{component:"span",sx:{display:{xs:"none",sm:"inline"}},children:T("onStage",{count:tr})}),(0,n.jsx)(u.A,{component:"span",sx:{display:{xs:"inline",sm:"none"}},children:tr})]})]})]}),(0,n.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:3,sx:{display:{xs:"none",xl:"flex"}},"data-sentry-element":"Stack","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(m.A,{variant:es?"contained":"outlined",color:"success",startIcon:(0,n.jsx)(C.A,{icon:es?"tabler:users":"tabler:user-plus",fontSize:18}),onClick:()=>eo(e=>!e),sx:es?{minWidth:176,whiteSpace:"nowrap"}:{minWidth:176,whiteSpace:"nowrap",color:"grey.300",borderColor:"rgba(255,255,255,0.2)","&:hover":{borderColor:"rgba(255,255,255,0.4)"}},"data-sentry-element":"Button","data-sentry-source-file":"LiveStudio.tsx",children:td}),(0,n.jsxs)(eD,{isLive:eX.isLive,sx:{minWidth:112,justifyContent:"center"},"data-sentry-element":"ConnectionStatus","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(C.A,{icon:"tabler:antenna-bars-5",fontSize:18,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"}),(0,n.jsx)(A.A,{variant:"caption",sx:{fontWeight:600},"data-sentry-element":"Typography","data-sentry-source-file":"LiveStudio.tsx",children:tc})]}),eX.isLive&&D&&(0,n.jsx)(eh,{recording:eX.recording,recordOnStart:eQ,onRecordOnStartConsumed:()=>e6(!1),disabled:eX.isEnding}),(0,n.jsx)(m.A,{variant:"contained",color:"error",onClick:to,disabled:tl,sx:{minWidth:142,whiteSpace:"nowrap"},"data-sentry-element":"Button","data-sentry-source-file":"LiveStudio.tsx",children:eX.isEnding?T("endingStream"):T("endStream")})]}),(0,n.jsxs)(eR,{direction:"row",alignItems:"center",spacing:1.5,"data-sentry-element":"CompactStudioControls","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(S.A,{title:td,"data-sentry-element":"Tooltip","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(eM,{active:es,onClick:()=>eo(e=>!e),"aria-label":td,"data-sentry-element":"CompactStageButton","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(C.A,{icon:es?"tabler:users":"tabler:user-plus",fontSize:20,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"})})}),(0,n.jsx)(S.A,{title:tc,"data-sentry-element":"Tooltip","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(eW,{isLive:eX.isLive,"aria-label":tc,"data-sentry-element":"CompactConnectionStatus","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(C.A,{icon:"tabler:antenna-bars-5",fontSize:18,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"})})}),eX.isLive&&D&&(0,n.jsx)(eh,{compact:!0,recording:eX.recording,recordOnStart:eQ,onRecordOnStartConsumed:()=>e6(!1),disabled:eX.isEnding}),(0,n.jsx)(S.A,{title:T("endStream"),"data-sentry-element":"Tooltip","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)("span",{children:(0,n.jsx)(ez,{color:"error",onClick:to,disabled:tl,"aria-label":T("endStream"),"data-sentry-element":"CompactEndButton","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(C.A,{icon:"tabler:player-stop",fontSize:20,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"})})})})]}),(0,n.jsxs)(eT,{direction:"row",alignItems:"center",spacing:1,"data-sentry-element":"MobileStudioControls","data-sentry-source-file":"LiveStudio.tsx",children:[eX.isLive&&D&&(0,n.jsx)(eh,{compact:!0,recording:eX.recording,recordOnStart:eQ,onRecordOnStartConsumed:()=>e6(!1),disabled:eX.isEnding}),(0,n.jsx)(eF,{onClick:ec,"aria-label":T("moreControls"),"aria-controls":ed?"live-studio-more-menu":void 0,"aria-expanded":ed?"true":void 0,"data-sentry-element":"MoreControlsButton","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(C.A,{icon:"tabler:dots-vertical",fontSize:22,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"})}),(0,n.jsxs)(y.A,{id:"live-studio-more-menu",anchorEl:el,open:ed,onClose:em,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},"data-sentry-element":"Menu","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsxs)(f.A,{onClick:()=>{eo(e=>!e),em()},"data-sentry-element":"MenuItem","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(g.A,{"data-sentry-element":"ListItemIcon","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(C.A,{icon:es?"tabler:users-minus":"tabler:user-plus",fontSize:20,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"})}),(0,n.jsx)(x.A,{"data-sentry-element":"ListItemText","data-sentry-source-file":"LiveStudio.tsx",children:td})]}),(0,n.jsxs)(f.A,{disabled:!0,"data-sentry-element":"MenuItem","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(g.A,{"data-sentry-element":"ListItemIcon","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(C.A,{icon:"tabler:antenna-bars-5",fontSize:20,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"})}),(0,n.jsx)(x.A,{"data-sentry-element":"ListItemText","data-sentry-source-file":"LiveStudio.tsx",children:tc})]}),(0,n.jsxs)(f.A,{disabled:tl,onClick:()=>{to(),em()},sx:{color:"error.main"},"data-sentry-element":"MenuItem","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(g.A,{sx:{color:"inherit"},"data-sentry-element":"ListItemIcon","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(C.A,{icon:"tabler:player-stop",fontSize:20,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"})}),(0,n.jsx)(x.A,{"data-sentry-element":"ListItemText","data-sentry-source-file":"LiveStudio.tsx",children:eX.isEnding?T("endingStream"):T("endStream")})]})]})]})]}),(0,n.jsxs)(u.A,{sx:{position:"relative",flex:1,minHeight:360},"data-sentry-element":"Box","data-sentry-source-file":"LiveStudio.tsx",children:["connecting"===eX.phase.kind&&(0,n.jsxs)(e$,{overlayColor:"rgba(0,0,0,0.45)",overlaySpacing:2,overlayZIndex:4,children:[(0,n.jsx)(p.A,{size:32,sx:{color:"common.white"}}),(0,n.jsx)(A.A,{variant:"body2",sx:{color:"grey.300"},children:"Connecting to LiveKit…"})]}),eY&&e_&&(0,n.jsxs)(e$,{overlayColor:"rgba(0,0,0,0.72)",overlaySpacing:3,overlayZIndex:5,children:[(0,n.jsx)(C.A,{icon:"tabler:calendar-time",fontSize:40,color:w.palette.primary.main}),(0,n.jsx)(A.A,{variant:"h5",sx:{color:"common.white",fontWeight:700},children:T("comingSoon.title")}),(0,n.jsx)(A.A,{variant:"body2",sx:{color:"grey.300",textAlign:"center",maxWidth:420},children:T("comingSoon.subtitle",{time:e.dateLabel})}),(0,n.jsx)(A.A,{variant:"h6",sx:{color:"primary.main",fontVariantNumeric:"tabular-nums"},children:T("comingSoon.countdown",{countdown:(r=Math.floor((t=Math.max(0,Math.floor((e_.getTime()-V)/1e3)))/86400),a=Math.floor(t%86400/3600),s=Math.floor(t%3600/60),c=t%60,r>0?`${r}d ${a}h ${s}m`:a>0?`${a}h ${s}m ${c}s`:`${s}m ${c}s`)})})]}),e5&&(0,n.jsxs)(e$,{overlayColor:"rgba(0,0,0,0.72)",overlaySpacing:3,overlayZIndex:5,children:[(0,n.jsx)(C.A,{icon:"tabler:broadcast",fontSize:40,color:w.palette.success.main}),(0,n.jsx)(A.A,{variant:"h5",sx:{color:"common.white",fontWeight:700},children:T("readyToStart.title")}),(0,n.jsx)(A.A,{variant:"body2",sx:{color:"grey.300",textAlign:"center",maxWidth:420},children:T("readyToStart.subtitle")}),D&&(0,n.jsx)(ea.O,{checked:eQ,onChange:e6,inverted:!0}),(0,n.jsx)(m.A,{variant:"contained",color:"success",size:"large",onClick:()=>void eX.goLive(),children:T("startStream")})]}),(0,n.jsx)($,{ref:eX.compositorRef,scene:eX.scene,pip:eX.pip,onPipChange:eX.setPip,onProgramTrack:eX.setProgramTrack,onError:eX.setCompositorError,"data-sentry-element":"CompositorStage","data-sentry-source-file":"LiveStudio.tsx"}),eX.compositorError&&(0,n.jsx)(eB,{severity:"error",children:eX.compositorError}),(0,n.jsxs)(eG,{"data-sentry-element":"ProgramInfo","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(A.A,{variant:"body2",sx:{color:"common.white",fontWeight:600},"data-sentry-element":"Typography","data-sentry-source-file":"LiveStudio.tsx",children:e.title}),(0,n.jsxs)(A.A,{variant:"caption",sx:{color:"grey.400"},"data-sentry-element":"Typography","data-sentry-source-file":"LiveStudio.tsx",children:[e.host," \xb7 ",eX.isLive?M("PAGE.LIVE.list.status.live"):eY?M("PAGE.LIVE.list.status.scheduled"):T("readyToStart.badge")]})]})]}),eX.room&&(0,n.jsx)(ev,{room:eX.room,programTrack:eX.programTrack,onConnected:eX.onLkConnected,onDisconnected:eX.onLkDisconnected,onError:eX.onLkError,onStageCountChange:eX.setOnStageCount,onHealthStatsChange:eX.setHealthStats,onMicStateChange:eX.onMicStateChange,onGuestsC
1hange:e2,onGuestActionsChange:eX.setGuestActions,onChatMessagesChange:e7,onChatControlsChange:N,stageMode:es,canModerateAudio:D,frontendMutedGuestIds:[...ep],allGuestsFrontendMuted:tn,onToggleGuestFrontendMuted:ti,onToggleAllGuestsFrontendMuted:ta,onInviteToStage:()=>z("costream"),onEndStream:ts,endStreamRef:ey}),(0,n.jsxs)(eN,{"data-sentry-element":"StudioControls","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(ej,{direction:"row",spacing:1,sx:{width:{xs:"100%",sm:"auto"}},"data-sentry-element":"SourceSelector","data-sentry-source-file":"LiveStudio.tsx",children:eb.map(e=>(0,n.jsx)(S.A,{title:T(e.labelKey),children:(0,n.jsxs)(m.A,{size:"small",variant:eX.scene===e.scene?"contained":"text",onClick:()=>eX.selectScene(e.scene),disabled:eY||e5||!eX.isConnected,sx:{color:eX.scene===e.scene?"common.white":"grey.400",minWidth:"auto",flex:{xs:1,sm:"initial"},width:{xs:"auto",sm:104}},children:[(0,n.jsx)(C.A,{icon:e.icon,fontSize:18}),(0,n.jsx)(u.A,{component:"span",sx:{display:{xs:"none",sm:"inline"},ml:1.5},children:T(e.labelKey)})]})},e.scene))}),(0,n.jsxs)(v.A,{direction:"row",spacing:2,sx:{justifyContent:{xs:"center",sm:"initial"}},"data-sentry-element":"Stack","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(h.A,{onClick:eX.toggleMic,disabled:!eX.isLive,sx:{color:eX.micOn?"common.white":"error.main",backgroundColor:"rgba(255,255,255,0.06)"},"data-sentry-element":"IconButton","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(C.A,{icon:eX.micOn?"tabler:microphone":"tabler:microphone-off",fontSize:20,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"})}),(0,n.jsx)(h.A,{onClick:eX.changeScreen,disabled:"screen"!==eX.scene&&"camera-screen"!==eX.scene,sx:{color:"common.white",backgroundColor:"rgba(255,255,255,0.06)"},"data-sentry-element":"IconButton","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(C.A,{icon:"tabler:device-desktop",fontSize:20,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"})}),(0,n.jsx)(h.A,{onClick:()=>eo(!0),sx:{color:es?"success.main":"common.white",backgroundColor:"rgba(255,255,255,0.06)"},"data-sentry-element":"IconButton","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(C.A,{icon:"tabler:user-plus",fontSize:20,"data-sentry-element":"Icon","data-sentry-source-file":"LiveStudio.tsx"})})]}),(0,n.jsxs)(v.A,{direction:"row",spacing:2,sx:{display:{xs:"none",md:"flex"}},"data-sentry-element":"Stack","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsxs)(eC,{direction:"row",alignItems:"center",spacing:1.5,"data-sentry-element":"StudioStat","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(A.A,{variant:"caption",sx:{color:"grey.500"},"data-sentry-element":"Typography","data-sentry-source-file":"LiveStudio.tsx",children:T("peak")}),(0,n.jsx)(ek,{variant:"caption","data-sentry-element":"StudioStatValue","data-sentry-source-file":"LiveStudio.tsx",children:eX.peakViewers||e3})]}),(0,n.jsxs)(eC,{direction:"row",alignItems:"center",spacing:1.5,"data-sentry-element":"StudioStat","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(A.A,{variant:"caption",sx:{color:"grey.500"},"data-sentry-element":"Typography","data-sentry-source-file":"LiveStudio.tsx",children:T("time")}),(0,n.jsx)(ek,{variant:"caption","data-sentry-element":"StudioStatValue","data-sentry-source-file":"LiveStudio.tsx",children:(0,ee.je)(eX.elapsedSeconds)})]})]})]})]}),(0,n.jsxs)(u.A,{"data-sentry-element":"Box","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(u.A,{sx:{mb:5},"data-sentry-element":"Box","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsx)(l.Ay,{value:W,"data-sentry-element":"TabContext","data-sentry-source-file":"LiveStudio.tsx",children:(0,n.jsxs)(X.w,{onChange:(e,t)=>
1z(t),"aria-label":"live studio tabs","data-sentry-element":"TabList","data-sentry-source-file":"LiveStudio.tsx",children:[(0,n.jsx)(b.A,{value:"health",label:T("tabs.health"),"data-sentry-element":"Tab","data-sentry-source-file":"LiveStudio.tsx"}),(0,n.jsx)(b.A,{value:"audience",label:T("tabs.audience"),"data-sentry-element":"Tab","data-sentry-source-file":"LiveStudio.tsx"}),(0,n.jsx)(b.A,{value:"costream",label:`${T("tabs.guests")} (${tr})`,"data-sentry-element":"Tab","data-sentry-source-file":"LiveStudio.tsx"})]})})}),"audience"===W&&(0,n.jsx)(v.A,{direction:{xs:"column",sm:"row"},spacing:4,children:tu.map(e=>(0,n.jsx)(eg.h,{label:e.label,value:e.value},e.label))}),"health"===W&&(0,n.jsx)(v.A,{direction:{xs:"column",sm:"row"},spacing:4,children:tm.map(e=>(0,n.jsxs)(eV,{children:[(0,n.jsx)(A.A,{variant:"body2",sx:{color:"text.secondary"},children:e.label}),(0,n.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,n.jsx)(eK,{}),(0,n.jsx)(A.A,{variant:"body2",sx:{fontWeight:600},children:e.value})]})]},e.label))}),"costream"===W&&(0,n.jsxs)(v.A,{spacing:5,children:[(0,n.jsx)(eu,{guests:tt,canModerateAudio:D,allGuestsMuted:tn,onToggleAllMics:ta,onToggleMic:ti,onToggleCam:e=>eX.guestActions?.setCamMuted(e,eX.guests.find(t=>t.id===e)?.camOn??!1),onRemove:e=>eX.guestActions?.removeGuest(e)}),(0,n.jsx)(A.A,{variant:"body2",sx:{color:"text.secondary"},children:T("costream.subtitle")}),0===e4.viewers.length?(0,n.jsx)(A.A,{variant:"body2",sx:{color:"text.secondary",textAlign:"center",py:6},children:T("costream.empty")}):(0,n.jsx)(eU,{children:e4.viewers.map(e=>{let t=e4.lastInvitedId===e.viewerId,r=e4.pendingInviteId===e.viewerId;return(0,n.jsxs)(eq,{children:[(0,n.jsx)(eH,{avatarColor:(0,ee.Cl)(e.viewerId),children:(0,ee.w8)(e.displayName)}),(0,n.jsxs)(u.A,{sx:{width:"100%",minWidth:0},children:[(0,n.jsx)(A.A,{variant:"body2",sx:{fontWeight:600},noWrap:!0,children:e.displayName}),(0,n.jsx)(A.A,{variant:"caption",sx:{color:"text.secondary"},display:"block",noWrap:!0,children:T("costream.watching",{time:(0,ee.lt)(e.joinedAt)})})]}),(0,n.jsx)(m.A,{fullWidth:!0,size:"small",variant:t?"outlined":"contained",color:t?"success":"primary",disabled:r||"open"!==e4.status||!eX.isLive,startIcon:(0,n.jsx)(C.A,{icon:t?"tabler:check":"tabler:user-plus",fontSize:16}),onClick:()=>e4.inviteViewer(e.viewerId),children:T(r||t?"costream.invited":"costream.invite")})]},e.viewerId)})})]})]})]}),(0,n.jsx)(ef,{chatControls:G,isLive:eX.isLive,latestOwnMessageId:e9,messages:e8,viewers:e3,"data-sentry-element":"LiveStudioChat","data-sentry-source-file":"LiveStudio.tsx"})]})]})}},27144:(e,t,r)=>{r.d(t,{Cj:()=>d,YP:()=>l,kp:()=>o});var n=r(87840),i=r(81495),a=r(20231),s=r(53497);let o=e=>(0,n.j)({queryKey:s.t.recap(e??"").queryKey,queryFn:()=>a.U.getLiveStreamRecap(e),enabled:(0,i.Yf)(e)}),l=e=>(0,n.j)({queryKey:s.t.recording(e).queryKey,queryFn:()=>a.U.getStreamSession(e),enabled:(0,i.Yf)(e),refetchInterval:e=>{let t=e.state.data;if(!t)return!1;let r="idle"===t.recordingStatus&&"stopped"!==t.status&&"failed"!==t.status,n="recording"===t.recordingStatus||"processing"===t.recordingStatus;return(!!r||!!n)&&1e3}}),d=(e,t=!0)=>(0,n.j)({queryKey:s.t.invite(e??"").queryKey,queryFn:()=>a.U.peekLivekitInvite(e),enabled:t&&!!e})},36043:(e,t,r)=>{r.d(t,{h:()=>u});var n=r(37876),i=r(66950),a=r(19610),s=r(31165),o=r(62902),l=r(31941),d=r(5157),c=r(89267);let u=({label:e,value:t,icon:r})=>(0,n.jsx)(a.A,{sx:{flex:1},"data-sentry-element":"Card","data-sentry-component":"StatCard","data-sentry-source-file":"StatCard.tsx",children:(0,n.jsx)(s.A,{"data-sentry-element":"CardContent","data-sentry-source-file":"StatCard.tsx",children:(0,n.jsxs)(o.A,{direction:"row",alignItems:"center",spacing:4,"data-sentry-element":"Stack","data-sentry-source-file":"StatCard.tsx",children:[r&&(0,n.jsx)(c.A,{skin:"light",color:"primary",variant:"rounded",children:(0,n.jsx)(d.A,{icon:r,fontSize:22})}),(0,n.jsxs)(i.A,{sx:{minWidth:0},"data-sentry-element":"Box","data-sentry-source-file":"StatCard.tsx",children:[(0,n.jsx)(l.A,{variant:"body2",sx:{color:"text.secondary"},"data-sentry-element":"Typography","data-sentry-source-file":"StatCard.tsx",children:e}),(0,n.jsx)(l.A,{variant:"h4",sx:{fontWeight:600},"data-sentry-element":"Typography","data-sentry-source-file":"StatCard.tsx",children:t})]})]})})})},59549:(e,t,r)=>{r.d(t,{Cl:()=>a,fr:()=>d,je:()=>s,lg:()=>l,lt:()=>o,w8:()=>i});let n=["#7B61FF","#FF7A45","#13C2C2","#FF4D88","#597EF7","#36CFC9","#FF85C0","#9254DE","#F759AB","#52C41A"];
1function i(e){let t=e.trim().split(/\s+/).filter(Boolean);return 0===t.length?"?":1===t.length?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function a(e){let t=0;for(let r=0;r<e.length;r+=1)t=(t+e.charCodeAt(r)*(r+1))%n.length;return n[t]}function s(e){let t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=e%60;return t>0?`${String(t).padStart(2,"0")}:${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`:`${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function o(e){let t=Math.max(0,Math.floor((Date.now()-e)/6e4));return t<1?"<1m":t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function l(e){return s(e)}function d(e,t){if(!e)return"";let r=new Date(e),n=t?new Date(t):null,i=r.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),a=r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"});if(!n)return`${i} \xb7 ${a}`;let s=n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"});return`${i} \xb7 ${a} – ${s}`}},59872:(e,t,r)=>{r.d(t,{EJ:()=>a,HW:()=>l,Zk:()=>m,cz:()=>o,kF:()=>d,tM:()=>u,wt:()=>c});var n=r(15266);let i=(e,t)=>Object.assign(Error(t instanceof Error?t.message:"Media capture request failed"),{name:"CaptureRequestError",captureSource:e,originalError:t}),a=e=>e instanceof Error&&"captureSource"in e&&("display"===e.captureSource||"camera"===e.captureSource)&&"originalError"in e,s=!1,o=e=>{let t,r;if(!1===window.isSecureContext){let e=Error("Display capture requires a secure context");return e.name="InsecureCaptureContextError",Promise.reject(e)}if("u"<typeof navigator||!navigator.mediaDevices?.getDisplayMedia){let e=Error("Display capture is not supported");return e.name="NotSupportedError",Promise.reject(e)}if(s){let e=Error("A display capture permission request is already pending");return e.name="PendingDisplayCaptureError",Promise.reject(e)}let i=e&&"firefox"!==(r=(0,n.cO)())&&"safari"!==r;try{s=!0,t=navigator.mediaDevices.getDisplayMedia({video:!0,audio:i})}catch(e){return s=!1,Promise.reject(e)}return t.then(t=>{if(!t.getVideoTracks().some(e=>"live"===e.readyState))throw u(t),new DOMException("Display capture ended before it could start","NotReadableError");return{stream:t,systemAudioDowngraded:e&&(!i||0===t.getAudioTracks().length)}}).finally(()=>{s=!1})},l=e=>o(e),d=async(e,t,r)=>{let n=!1;return e&&(n=!r||{deviceId:{ideal:r}}),navigator.mediaDevices.getUserMedia({video:n,audio:t})},c=async(e,t,r,n)=>{let a=null,s=null,o=!1,c=()=>{if(n?.aborted)throw new DOMException("Capture request cancelled","AbortError")};try{if("screen"===e.source){let n=r??l(e.includeSystemAudio);try{let e=await n;a=e.stream,o=e.systemAudioDowngraded,c()}catch(e){throw i("display",e)}try{e.includeCamera?s=await d(!0,!0,t):e.includeMicrophone&&(s=await d(!1,!0)),c()}catch(e){throw u(a),i("camera",e)}}else c(),s=await d(!0,!0,t),c();if(a&&!a.getVideoTracks().some(e=>"live"===e.readyState))throw i("display",new DOMException("Display capture ended during setup","NotReadableError"));let n={...e,includeSystemAudio:e.includeSystemAudio&&!o,systemAudioDowngraded:o};return{displayStream:a,cameraStream:s,effectiveConfig:n}}catch(e){throw u(a),u(s),e}},u=e=>{e&&e.getTracks().forEach(e=>e.stop())},m=async(e,t)=>{let r=e.getVideoTracks()[0];r&&(r.stop(),e.removeTrack(r));let n=await navigator.mediaDevices.getUserMedia({video:{deviceId:{ideal:t}},audio:!1}),i=n.getVideoTracks()[0];return e.addTrack(i),n.getTracks().forEach(e=>{e!==i&&e.stop()}),new MediaStream(e.getTracks())}},83383:(e,t,r)=>{r.d(t,{r:()=>L});var n=r(37876),i=r(14232),a=r(66950),s=r(87774),o=r(26183),l=r(82615),d=r(99782),c=r(62902),u=r(60072),m=r(31941),p=r(64713),h=r(5157),g=r(59393),x=r(97558);let y=(0,p.Ay)(d.A,{shouldForwardProp:e=>"surface"!==e})(({theme:e,surface:t})=>({width:"100%",minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"card"===t?"hidden":"visible",backgroundColor:"card"===t?e.palette.background.paper:"transparent",borderRadius:"card"===t?void 0:0})),f=(0,p.Ay)(c.A)(({theme:e})=>({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:e.spacing(3),padding:e.spacing(4),flexShrink:0})),v=(0,p.Ay)(a.A)(({theme:e})=>({padding:e.spacing(4),flexShrink:0})),b=(0,p.Ay)(c.A)(({theme:e})=>({gap:e.spacing(3),padding:e.spacing(4),flex:1,minHeight:0,overflowY:"auto",[e.breakpoints.up("lg")]:{maxHeight:590}})),S=(0,p.Ay)(a.A,{shouldForwardProp:e=>"isOwn"!==e})(({theme:e,isOwn:t})=>({display:"flex",justifyContent:t?"flex-end":"flex-start",alignItems:"flex-start",ga
1p:e.spacing(1.5)})),A=(0,p.Ay)(a.A)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(.5),maxWidth:"76%",minWidth:0})),w=(0,p.Ay)(m.A)(({theme:e})=>({color:e.palette.text.secondary,fontWeight:500,marginLeft:e.spacing(.5),maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),j=(0,p.Ay)(a.A)(({theme:e})=>({padding:e.spacing(4),flexShrink:0})),C=(0,p.Ay)(a.A)(({theme:e})=>({padding:e.spacing(4),flexShrink:0})),k=({message:e})=>{let t=e.isOwn??"You"===e.name;return(0,n.jsxs)(S,{isOwn:t,"data-sentry-element":"MessageRow","data-sentry-component":"LiveChatMessage","data-sentry-source-file":"LiveChat.tsx",children:[!t&&(0,n.jsx)(g.S,{name:e.name,initials:e.initials,backgroundColor:e.color,size:32,showOnlineStatus:!1}),(0,n.jsxs)(A,{"data-sentry-element":"MessageContent","data-sentry-source-file":"LiveChat.tsx",children:[!t&&(0,n.jsx)(w,{variant:"caption",children:e.name}),(0,n.jsx)(x.S,{id:0,text:e.text,isOwn:t,"data-sentry-element":"MessageTextContent","data-sentry-source-file":"LiveChat.tsx"}),(0,n.jsx)(m.A,{variant:"caption",sx:{color:"text.disabled",alignSelf:t?"flex-end":"flex-start",px:.5},"data-sentry-element":"Typography","data-sentry-source-file":"LiveChat.tsx",children:e.time})]})]})},L=({messages:e,title:t,subtitle:r,headerAction:d,children:p,emptyMessage:g,composer:x,footer:S,scrollToEndKey:A,dividers:w=!1,surface:L="card",sx:I,headerSx:E,toolbarSx:R,messagesSx:T,composerSx:M,footerSx:P})=>{let O=(0,i.useRef)(null),[D,W]=(0,i.useState)(""),[z,F]=(0,i.useState)(null);(0,i.useEffect)(()=>{null!=A&&O.current?.scrollTo({top:O.current.scrollHeight})},[A]);let $=async e=>{e.preventDefault();let t=D.trim();if(x&&t&&!x.disabled&&!x.isSending){W(""),F(null);try{await x.onSend(t)}catch(e){W(t),F(x.getErrorMessage?.(e)??(e instanceof Error?e.message:"The message could not be sent."))}}};return(0,n.jsxs)(y,{elevation:+("card"===L),surface:L,sx:I,"data-sentry-element":"ChatRoot","data-sentry-component":"LiveChat","data-sentry-source-file":"LiveChat.tsx",children:[(0,n.jsxs)(f,{sx:E,"data-sentry-element":"ChatHeader","data-sentry-source-file":"LiveChat.tsx",children:[(0,n.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:2,sx:{minWidth:0},"data-sentry-element":"Stack","data-sentry-source-file":"LiveChat.tsx",children:[(0,n.jsx)(h.A,{icon:"tabler:message-2",fontSize:20,"data-sentry-element":"Icon","data-sentry-source-file":"LiveChat.tsx"}),(0,n.jsxs)(a.A,{sx:{minWidth:0},"data-sentry-element":"Box","data-sentry-source-file":"LiveChat.tsx",children:[(0,n.jsx)(m.A,{variant:"h6",sx:{fontWeight:600},"data-sentry-element":"Typography","data-sentry-source-file":"LiveChat.tsx",children:t}),r]})]}),d]}),w&&(0,n.jsx)(s.A,{}),p&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v,{sx:R,children:p}),w&&(0,n.jsx)(s.A,{})]}),(0,n.jsxs)(b,{ref:O,sx:T,"data-sentry-element":"ChatMessages","data-sentry-source-file":"LiveChat.tsx",children:[e.map(e=>(0,n.jsx)(k,{message:e},e.id)),0===e.length&&g&&(0,n.jsxs)(c.A,{alignItems:"center",justifyContent:"center",spacing:2,sx:{flex:1,textAlign:"center",color:"text.secondary"},children:[(0,n.jsx)(h.A,{icon:"tabler:messages",fontSize:34}),(0,n.jsx)(m.A,{variant:"body2",children:g})]})]}),x&&(0,n.jsxs)(n.Fragment,{children:[w&&(0,n.jsx)(s.A,{}),(0,n.jsx)(j,{component:"form",onSubmit:$,sx:M,children:(0,n.jsx)(u.A,{fullWidth:!0,size:"small",value:D,disabled:x.disabled,error:!!z,helperText:z||(x.disabled?x.disabledMessage:void 0),placeholder:x.placeholder,inputProps:{maxLength:x.maxLength??500},onChange:e=>{W(e.target.value),F(null)},InputProps:{endAdornment:(0,n.jsx)(l.A,{position:"end",children:(0,n.jsx)(o.A,{type:"submit",edge:"end",color:"primary",size:"small",disabled:!D.trim()||x.isSending||x.disabled,"aria-label":x.sendLabel,children:(0,n.jsx)(h.A,{icon:"tabler:send",fontSize:18})})})}})})]}),S&&(0,n.jsx)(C,{sx:P,children:S})]})}},97009:(e,t,r)=>{r.d(t,{w:()=>a});var n=r(64713),i=r(3221);let a=(0,n.Ay)(i.A)(({theme:e})=>({borderBottom:"0 !important","&, & .MuiTabs-scroller":{boxSizing:"content-box",padding:e.spacing(1.25,1.25,2),margin:`${e.spacing(-1.25,-1.25,-2)} !important`},".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3},"& .MuiTabs-indicator":{display:"none"},"& .Mui-selected":{boxShadow:e.shadows[2],backgroundColor:e.palette.primary.main,color:`${e.palette.common.white} !important`},"& .MuiTab-root":{minWidth:65,minHeight:38,lineHeight:1,borderRadius:e.shape.borderRadius,"&:hover":{color:e.palette.primary.main}}}))}
1,99198:(e,t,r)=>{r.d(t,{O:()=>d});var n=r(37876),i=r(48185),a=r(76587),s=r(62902),o=r(31941),l=r(30942);let d=({checked:e,onChange:t,disabled:r=!1,inverted:d=!1})=>{let{t:c}=(0,l.o)();return(0,n.jsx)(a.A,{disabled:r,control:(0,n.jsx)(i.A,{checked:e,onChange:e=>t(e.target.checked)}),label:(0,n.jsxs)(s.A,{children:[(0,n.jsx)(o.A,{variant:"body2",sx:{color:d?"common.white":"text.primary",fontWeight:600},children:c("PAGE.LIVE.studio.recordOnStart")}),(0,n.jsx)(o.A,{variant:"caption",sx:{color:d?"grey.400":"text.secondary"},children:c("PAGE.LIVE.studio.recordOnStartHint")})]}),sx:{alignItems:"flex-start",m:0},"data-sentry-element":"FormControlLabel","data-sentry-component":"RecordOnStartCheckbox","data-sentry-source-file":"RecordOnStartCheckbox.tsx"})}}}]);
2//# sourceMappingURL=1034.ab056e1df8a1f3cc.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.