PageSourceSearch

https://www.sheconomy.in/assets/guest-session-DaIAucIF.js

js sheconomy.in collected 2026-09-24 13:17:08 UTC 13,935 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{Lt as t,at as n,i as r,n as i,pt as a}from"./dist-E2Iv6aiw.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{c as s,t as c}from"./esm-Nm0QzpIr.js";import{Co as l,Ht as u,Jn as d,Kn as f,Lt as p,Ya as m,Yi as h,_t as g,b as _,da as v,f as y,pn as b,r as x,rn as S,sn as C,wo as w,x as T}from"./ui-BzW7fosv.js";import{n as E}from"./client-DVSqKt4u.js";import{t as D}from"./MeetingShareSheet-mey6FkF1.js";import{n as O}from"./actions-BUBDb4z0.js";import{$ as k,K as A,W as j,X as M,v as N,wt as P}from"./meetings-Dk_NOW5u.js";import{i as F,n as I,t as L}from"./meeting-display-name-c02McVMH.js";import{i as R,n as z}from"./theme-Bt8b7TBK.js";import{i as B,r as V}from"./CoWorkUi-CZHCFBR6.js";import{t as H}from"./openMailto-CkNHbemT.js";import{t as U}from"./MeetingInvitePicker-BHpRnHcy.js";var W=e(t());c(),i();var G=o();function K({onPress:e,disabled:t,accessibilityLabel:n,children:r,style:i}){return(0,G.jsx)(T,{accessibilityRole:`button`,accessibilityLabel:n,disabled:t,onPress:e,hitSlop:8,collapsable:!1,style:({pressed:e})=>[{minHeight:44,minWidth:44,justifyContent:`center`,alignItems:`center`,opacity:t?.45:e?.75:1},i],children:r})}a.OS,i();function q({title:e,subtitle:t,icon:n,onClose:r,trailing:i}){let{ui:o}=R();return(0,G.jsxs)(l,{paddingHorizontal:`$4`,paddingVertical:`$3`,alignItems:`center`,justifyContent:`space-between`,borderBottomWidth:1,borderBottomColor:o.borderSoft,zIndex:4,style:z(o,!0),children:[(0,G.jsxs)(l,{alignItems:`center`,gap:`$3`,flex:1,pointerEvents:`none`,children:[n?(0,G.jsx)(w,{width:38,height:38,borderRadius:13,alignItems:`center`,justifyContent:`center`,backgroundColor:o.brandMuted,borderWidth:1,borderColor:o.borderAccent,children:n}):null,(0,G.jsxs)(w,{gap:2,flex:1,children:[(0,G.jsx)(u,{fontWeight:`800`,fontSize:15,color:o.text,letterSpacing:-.4,children:e}),t?(0,G.jsx)(u,{fontSize:11,color:o.textMuted,children:t}):null]})]}),(0,G.jsxs)(l,{alignItems:`center`,gap:`$1.5`,children:[i,a.OS===`web`?(0,G.jsx)(m,{tone:`ghost`,size:`$2`,borderRadius:999,width:36,height:36,padding:0,onPress:r,icon:(0,G.jsx)(S,{size:18,color:o.textSecondary})}):(0,G.jsx)(K,{accessibilityLabel:`Close panel`,onPress:r,style:{width:40,height:40,borderRadius:999,backgroundColor:`rgba(255,255,255,0.08)`},children:(0,G.jsx)(S,{size:18,color:o.textSecondary})})]})]})}i();function J({open:e,onClose:t,onOpenChange:i}){let{ui:o}=R(),c=s(),{height:d}=r(),[f,p]=(0,W.useState)(`speaker`),[h,_]=(0,W.useState)([]),[y,b]=(0,W.useState)([]),[x,T]=(0,W.useState)(``),[E,D]=(0,W.useState)(``),[O,k]=(0,W.useState)(0),[A,j]=(0,W.useState)(!1),[M,N]=(0,W.useState)(!1),P=(0,W.useRef)(null),F=(0,W.useRef)(null),I=(0,W.useRef)(null),L=(0,W.useRef)(null),z=(0,W.useRef)(null),B=(0,W.useRef)([]),V=()=>{J(),i?.(!1),t()};(0,W.useEffect)(()=>{if(!e){J(),p(`speaker`);return}return H(),U(),()=>{J()}},[e]);async function H(){if(a.OS!==`web`||typeof navigator>`u`||!navigator.mediaDevices?.enumerateDevices){_([{deviceId:`default`,label:`Default System Speaker`}]),b([{deviceId:`default`,label:`Default System Microphone`}]);return}try{try{(await navigator.mediaDevices.getUserMedia({audio:!0,video:!1})).getTracks().forEach(e=>e.stop())}catch{}let e=await navigator.mediaDevices.enumerateDevices(),t=[],n=[];e.forEach((e,r)=>{e.kind===`audiooutput`?t.push({deviceId:e.deviceId||`spk-${r}`,label:e.label||`Speaker ${t.length+1}`}):e.kind===`audioinput`&&n.push({deviceId:e.deviceId||`mic-${r}`,label:e.label||`Microphone ${n.length+1}`})}),t.length===0&&t.push({deviceId:`default`,label:`Default System Speaker`}),n.length===0&&n.push({deviceId:`default`,label:`Default System Microphone`}),_(t),b(n),T(t[0]?.deviceId||`default`),D(n[0]?.deviceId||`default`)}catch{_([{deviceId:`default`,label:`Default System Speaker`}]),b([{deviceId:`default`,label:`Default System Microphone`}])}}function U(){if(!(a.OS!==`web`||typeof window>`u`))try{let e=window.AudioContext||window.webkitAudioContext;if(!e)return;let t=new e;P.current=t;let n=[523.25,659.25,783.99,1046.5],r=0,i=()=>{t.state===`suspended`&&t.resume();let e=t.createOscillator(),i=t.createGain();e.frequency.value=n[r%n.length],r+=1,i.gain.setValueAtTime(1e-4,t.currentTime),i.gain.exponentialRampToValueAtTime(.12,t.currentTime+.03),i.gain.exponentialRampToValueAtTime(1e-4,t.currentTime+.45),e.connect(i),i.connect(t.destination),e.start(),e.stop(t.currentTime+.5)};
1i(),F.current=window.setInterval(i,900)}catch{}}function K(){F.current!==null&&typeof window<`u`&&(clearInterval(F.current),F.current=null),P.current&&=(P.current.close().catch(()=>{}),null)}async function q(){if(K(),p(`mic`),j(!0),N(!1),k(0),a.OS!==`web`||typeof navigator>`u`||!navigator.mediaDevices?.getUserMedia){j(!1);return}try{let e=await navigator.mediaDevices.getUserMedia({audio:E&&E!=="default"?{deviceId:{exact:E}}:!0,video:!1});I.current=e;let t=window.AudioContext||window.webkitAudioContext;if(t){let n=new t;P.current=n;let r=n.createMediaStreamSource(e),i=n.createAnalyser();i.fftSize=256,r.connect(i);let a=new Uint8Array(i.frequencyBinCount),o=()=>{i.getByteFrequencyData(a);let e=0;for(let t=0;t<a.length;t+=1)e+=a[t]??0;k(Math.min(1,e/(a.length*180))),L.current=requestAnimationFrame(o)};o()}if(typeof MediaRecorder<`u`){B.current=[];let t=new MediaRecorder(e);z.current=t,t.ondataavailable=e=>{e.data.size>0&&B.current.push(e.data)},t.onstop=()=>{j(!1),N(!0);let e=new Blob(B.current,{type:`audio/webm`}),t=URL.createObjectURL(e),n=new Audio(t);n.onended=()=>{N(!1),URL.revokeObjectURL(t)},n.play().catch(()=>N(!1))},t.start(),setTimeout(()=>{t.state===`recording`&&t.stop()},2500)}else j(!1)}catch{j(!1),k(0)}}function J(){K(),L.current!==null&&typeof cancelAnimationFrame<`u`&&(cancelAnimationFrame(L.current),L.current=null),I.current&&=(I.current.getTracks().forEach(e=>e.stop()),null),z.current&&z.current.state===`recording`&&z.current.stop()}return e?(0,G.jsx)(g,{open:e,onOpenChange:e=>{e||V()},title:`Test speaker and microphone`,showHandle:!0,scrollable:!0,children:(0,G.jsxs)(w,{width:`100%`,maxWidth:440,maxHeight:Math.max(320,Math.min(560,d-c.top-c.bottom-48)),backgroundColor:o.surfaceElevated,borderRadius:16,borderWidth:1,borderColor:o.borderSoft,overflow:`hidden`,style:{boxShadow:`0 20px 48px rgba(0, 0, 0, 0.5)`},children:[(0,G.jsxs)(l,{justifyContent:`space-between`,alignItems:`center`,paddingHorizontal:`$4`,paddingTop:`$4`,paddingBottom:`$2`,children:[(0,G.jsxs)(l,{alignItems:`center`,gap:`$2.5`,flex:1,minWidth:0,children:[(0,G.jsx)(w,{width:32,height:32,borderRadius:16,backgroundColor:`rgba(216, 27, 96, 0.15)`,alignItems:`center`,justifyContent:`center`,children:(0,G.jsx)(C,{size:18,color:o.brand})}),(0,G.jsx)(u,{fontSize:17,fontWeight:`800`,color:o.text,numberOfLines:1,children:`Testing Audio`})]}),(0,G.jsx)(m,{tone:`ghost`,size:`$3`,circular:!0,minWidth:44,minHeight:44,icon:(0,G.jsx)(S,{size:18,color:o.text}),onPress:V,accessibilityLabel:`Close audio test`})]}),(0,G.jsxs)(n,{style:{flexGrow:1,flexShrink:1},contentContainerStyle:{paddingHorizontal:16,paddingBottom:8},keyboardShouldPersistTaps:`handled`,children:[f===`speaker`?(0,G.jsxs)(w,{gap:`$4`,paddingVertical:`$2`,children:[(0,G.jsxs)(w,{gap:`$1.5`,children:[(0,G.jsx)(u,{fontSize:15,fontWeight:`700`,color:o.text,children:`Do you hear a ringtone?`}),(0,G.jsx)(u,{fontSize:13,color:o.textSecondary,children:`We are playing a test chime through your speaker.`})]}),(0,G.jsxs)(w,{backgroundColor:o.surface,borderRadius:12,borderWidth:1,borderColor:o.borderSoft,padding:`$3`,gap:`$1.5`,children:[(0,G.jsx)(u,{fontSize:11,fontWeight:`700`,color:o.textMuted,textTransform:`uppercase`,children:`Speaker`}),(0,G.jsx)(u,{fontSize:13,fontWeight:`600`,color:o.text,numberOfLines:2,children:h.find(e=>e.deviceId===x)?.label||`Default Speaker`})]})]}):null,f===`mic`?(0,G.jsxs)(w,{gap:`$4`,paddingVertical:`$2`,children:[(0,G.jsxs)(w,{gap:`$1.5`,children:[(0,G.jsx)(u,{fontSize:15,fontWeight:`700`,color:o.text,children:`Speak and pause — do you hear a replay?`}),(0,G.jsx)(u,{fontSize:13,color:o.textSecondary,children:A?`Listening to your voice…`:M?`Replaying audio back to you…`:`Audio test in progress…`})]}),(0,G.jsxs)(w,{backgroundColor:o.surface,borderRadius:12,borderWidth:1,borderColor:o.borderSoft,padding:`$3`,gap:`$2.5`,children:[(0,G.jsx)(u,{fontSize:11,fontWeight:`700`,color:o.textMuted,textTransform:`uppercase`,children:`Microphone`}),(0,G.jsx)(u,{fontSize:13,fontWeight:`600`,color:o.text,numberOfLines:2,children:y.find(e=>e.deviceId===E)?.label||`Default Mic`}),(0,G.jsx)(w,{width:`100%`,height:10,borderRadius:5,backgroundColor:`rgba(255, 255, 255, 0.08)`,overflow:`hidden`,children:(0,G.jsx)(w,{height:`100%`,width:`${Math.round(O*100)}%`,backgroundColor:o.live,borderRadius:5})})]})]}):null,f===`success`?(0,G.jsxs)(w,{gap:`$4`,alignItems:`center`,paddingVertical:`$4`,children:[(0,G.jsx)(w,{width:54,height:54,borderRadius:27,backgroundColor:`rgba(16, 185, 129, 0.18)`,alignItems:`center`,justifyContent:`center`,children:(0,G.jsx)(v,{size:28,color:o.live})}),(0,G.jsxs)(w,{gap:`$1`,alignItems:`center`,children:[(0,G.jsx)(u,{fontSize:17,fontWeight:`800`,color:o.text,textAlign:`center`,children:`Speaker and microphone look good`}),(0,G.jsx)(u,{fontSize:13,color:o.textSecondary,textAlign:`center`,children:`You can return to the meeting whenever you’re ready.`})]})]}):null]}),(0,G.jsxs)(w,{paddingHorizontal:`$4`,paddingTop:`$2`,paddingBottom:Math.max(c.bottom,16),gap:`$2`,borderTopWidth:1,borderTopColor:o.borderSoft,backgroundColor:o.surfaceElevated,children:[f===`speaker`?(0,G.jsxs)(l,{gap:`$3`,children:[(0,G.jsx)(m,{tone:`outline`,borderRadius:10,height:48,flex:1,onPress:()=>
1{if(h.length>1){let e=h.findIndex(e=>e.deviceId===x),t=h[(e+1)%h.length];t&&T(t.deviceId)}},children:`No (Switch)`}),(0,G.jsx)(m,{tone:`primary`,backgroundColor:o.brand,borderRadius:10,height:48,flex:1,onPress:()=>void q(),children:`Yes`})]}):null,f===`mic`?(0,G.jsxs)(l,{gap:`$3`,children:[(0,G.jsx)(m,{tone:`outline`,borderRadius:10,height:48,flex:1,onPress:()=>{if(y.length>1){let e=y.findIndex(e=>e.deviceId===E),t=y[(e+1)%y.length];t&&D(t.deviceId)}q()},children:`No (Try Again)`}),(0,G.jsx)(m,{tone:`primary`,backgroundColor:o.brand,borderRadius:10,height:48,flex:1,onPress:()=>{J(),p(`success`)},children:`Yes`})]}):null,f===`success`?(0,G.jsx)(m,{tone:`primary`,backgroundColor:o.brand,borderRadius:10,height:48,width:`100%`,onPress:V,children:`Back to meeting`}):(0,G.jsx)(m,{tone:`ghost`,borderRadius:10,height:44,width:`100%`,onPress:V,children:`Cancel and return`})]})]})}):null}function Y({meeting:e,hostId:t,hostName:n,onClose:r,fullWidth:i,onInviteesUpdated:a}){let{ui:o}=R(),s=_(),[c,g]=(0,W.useState)(``),[v,S]=(0,W.useState)(e.invitees??[]),[C,T]=(0,W.useState)(!1),[E,F]=(0,W.useState)(!1),I=P(e.meeting_code);async function L(){let t=v.filter(e=>e.status!==`joined`);if(t.length===0){s.show(`Add people to invite first`,{tone:`error`});return}T(!0);try{let r=await k({meetingId:e.id,invitees:t,message:c}),i=M(e.invitees??[],t).map(e=>({...e,status:`sent`}));if(S(i),a?.(i),r.mailtoLinks?.length)for(let t of r.mailtoLinks)await H(j(e,A(t.replace(`mailto:`,``)),n));s.show(`Invites sent`,{tone:`success`,message:r.emailsSent&&r.emailsSent>0?`${r.notifications??0} in-app · ${r.emailsSent} email via Resend`:r.mailtoLinks?.length?`${r.notifications??0} in-app · open email app for ${r.mailtoLinks.length} guest(s)`:`${r.notifications??0} in-app`})}catch(e){s.show(`Could not send invites`,{tone:`error`,message:e instanceof Error?e.message:void 0})}finally{T(!1)}}return(0,G.jsxs)(V,{fullWidth:i,children:[(0,G.jsx)(q,{title:`Invite people`,subtitle:`${v.length} selected`,icon:(0,G.jsx)(b,{size:18,color:o.brandLight}),onClose:r}),(0,G.jsxs)(x,{flex:1,padding:`$3`,children:[(0,G.jsxs)(w,{gap:`$3`,marginBottom:`$4`,children:[(0,G.jsx)(B,{children:`Invite link`}),(0,G.jsxs)(w,{gap:`$2`,padding:`$3`,borderRadius:14,backgroundColor:`rgba(255,255,255,0.04)`,borderWidth:1,borderColor:o.borderSoft,children:[(0,G.jsxs)(u,{fontSize:12,color:o.textMuted,children:[`Meeting ID · `,N(e.meeting_code)]}),(0,G.jsx)(u,{fontSize:12,fontWeight:`600`,color:o.text,numberOfLines:2,children:I}),(0,G.jsxs)(l,{gap:`$2`,flexWrap:`wrap`,children:[(0,G.jsx)(m,{tone:`outline`,size:`$2`,borderRadius:999,borderColor:o.borderAccent,color:o.brandLight,icon:(0,G.jsx)(h,{size:14,color:o.brandLight}),onPress:()=>{O(I).then(e=>{s.show(e?`Invite link copied`:`Could not copy link`,{tone:e?`success`:`error`})})},children:`Copy link`}),(0,G.jsx)(m,{tone:`outline`,size:`$2`,borderRadius:999,borderColor:o.glassBorder,color:o.text,icon:(0,G.jsx)(f,{size:14,color:o.text}),onPress:()=>F(!0),children:`Share`})]})]})]}),(0,G.jsx)(U,{hostId:t,value:v,onChange:S,compact:!0}),(0,G.jsxs)(w,{gap:`$2`,marginTop:`$4`,children:[(0,G.jsx)(B,{children:`Optional message`}),(0,G.jsx)(p,{value:c,onChangeText:g,placeholder:`Add a note for your invitees`,backgroundColor:`rgba(255,255,255,0.05)`,borderColor:o.borderSoft,color:o.text,borderRadius:14,multiline:!0})]})]}),(0,G.jsx)(w,{padding:`$3`,gap:`$2`,borderTopWidth:1,borderTopColor:o.borderSoft,children:(0,G.jsx)(m,{tone:`primary`,borderRadius:999,disabled:C||v.length===0,icon:C?(0,G.jsx)(y,{size:`small`,color:`white`}):(0,G.jsx)(d,{size:16,color:`white`}),onPress:()=>void L(),children:`Send invites`})}),(0,G.jsx)(D,{open:E,onOpenChange:F,meeting:e})]})}async function X(e){let{data:t}=await E.auth.getSession(),n=t?.session?.user,r=e?.trim(),i=r?I(r):null,a=await L(),o=i||a||`Guest`;if(n)return r&&await F(r),n;let s=`${Date.now()}_${Math.random().toString(36).slice(2,9)}`,c=`guest_${s}@sheconomy.internal`,l=`Guest!${Math.random().toString(36).slice(2)}_${Date.now()}Aa1`,{data:u,error:d}=await E.auth.signUp({email:c,password:l,options:{data:{full_name:o,username:`guest_${s.slice(0,12)}`,is_guest:!0}}});if(d||!u.user)throw Error(d?.message||`Could not initialize guest meeting session.`);return r&&await F(r),u.user}export{K as a,q as i,Y as n,J as r,X as t};

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.