diff --git a/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/AccessibilityResources.bundle/Info.plist b/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/AccessibilityResources.bundle/Info.plist index 363e8c4..b6cd18b 100644 Binary files a/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/AccessibilityResources.bundle/Info.plist and b/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/AccessibilityResources.bundle/Info.plist differ diff --git a/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/DyteSdk b/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/DyteSdk index 530daea..6f4df8a 100755 Binary files a/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/DyteSdk and b/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/DyteSdk differ diff --git a/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/Info.plist b/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/Info.plist index 4c57963..7e4fbc9 100644 Binary files a/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/Info.plist and b/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/Info.plist differ diff --git a/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/main.jsbundle b/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/main.jsbundle index cb13b3a..d09d228 100644 --- a/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/main.jsbundle +++ b/Frameworks/DyteSdk.xcframework/ios-arm64/DyteSdk.framework/main.jsbundle @@ -496,7 +496,7 @@ __d(function(g,r,_i,a,m,_e,d){'use strict';var e=r(d[0]);Object.defineProperty(_ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(d[0]),o=t.NativeModules,c=t.TurboModuleRegistry,l=r(d[1]),S=o.PlatformLocalStorage||o.RNC_AsyncSQLiteDBStorage||o.RNCAsyncStorage;!S&&l()&&(S=c?c.get('AsyncSQLiteDBStorage')||c.get('AsyncLocalStorage'):o.AsyncSQLiteDBStorage||o.AsyncLocalStorage);var n=S;e.default=n},490,[2,491]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]).NativeModules;m.exports=function(){var t,o,u=null==(t=n.NativeUnimoduleProxy)?void 0:null==(o=t.modulesConstants)?void 0:o.ExponentConstants;if(u&&(u.appOwnership&&!u.executionEnvironment||['storeClient','standalone'].includes(u.executionEnvironment)))return!0;return!1}},491,[2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.useAsyncStorage=function(t){return{getItem:function(){for(var u=arguments.length,f=new Array(u),o=0;o=0&&t<=1}),b=function(t){return t&&t.width>0&&t.height>0},D=.5,N=.5;e.withAnchorPoint=function(t,n,u){if(!w((s=n).x)||!w(s.y))return t;var s;if(!b(u))return t;var c=t.transform;if(!c)return t;if(n.x!==D&&u.width){var f=[];f.push({translateX:u.width*(n.x-D)}),(c=[].concat(f,(0,o.default)(c))).push({translateX:u.width*(D-n.x)})}if(!Array.isArray(c))return{transform:c};if(n.y!==N&&u.height){var l=[];l.push({translateY:u.height*(n.y-N)}),(c=[].concat(l,(0,o.default)(c))).push({translateY:u.height*(N-n.y)})}return{transform:c}};var y=function(){return'react native client'};e.browserName=y;var S=function(){return''};e.osName=S;var C=function(){return!0};e.isMobile=C;e.isChrome=function(){return!0};e.getDeviceInfo=function(){return{isMobile:!0,browserName:'react native client',osName:'',browserVersion:'react native client'}};e.isSafari=function(){return!1};e.isDesktopSafari=function(){return!1};e.useDisclosure=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=h(t),u=(0,n.default)(o,2),s=u[0],c=u[1];return{isOpen:s,onOpen:v(function(){return c(!0)},[]),onClose:v(function(){return c(!1)},[]),toggle:v(function(){return c(function(t){return!t})},[])}}},493,[1,41,49,165,494,496,2]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.browserName=void 0,e.default=function(t,o){var c=v(!1),f=(0,n.default)(c,2),h=f[0],l=f[1],p=o&&o.successDuration;return(0,u.useEffect)(function(){if(h&&p){var t=setTimeout(function(){l(!1)},p);return function(){clearTimeout(t)}}return function(){}},[h,p]),[h,function(){var n=(0,s.default)(t);l(n)}]},e.osName=e.isSafari=e.isMobile=e.isDesktopSafari=e.isChrome=e.getDeviceInfo=void 0,e.parseJwt=function(t){var n=t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/'),o=decodeURIComponent(c.default.decode(n).split('').map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(''));return JSON.parse(o)},e.useDisclosure=void 0,e.useScale=function(t){var n=t.width,o=t.height,u=f.Dimensions.get('screen').width,s=f.Dimensions.get('screen').height;return{width:Math.min(n,u),height:Math.min(o,s)}},e.withAnchorPoint=void 0;var n=t(r(d[1])),o=t(r(d[2])),u=r(d[3]),s=t(r(d[4])),c=t(r(d[5])),f=r(d[6]),h=r(d[3]),l=h.useCallback,v=h.useState,p=f.NativeModules.DyteHelper,w=(new f.NativeEventEmitter(p),function(t){return t>=0&&t<=1}),D=function(t){return t&&t.width>0&&t.height>0},b=.5,N=.5;e.withAnchorPoint=function(t,n,u){if(!w((s=n).x)||!w(s.y))return t;var s;if(!D(u))return t;var c=t.transform;if(!c)return t;if(n.x!==b&&u.width){var f=[];f.push({translateX:u.width*(n.x-b)}),(c=[].concat(f,(0,o.default)(c))).push({translateX:u.width*(b-n.x)})}if(!Array.isArray(c))return{transform:c};if(n.y!==N&&u.height){var h=[];h.push({translateY:u.height*(n.y-N)}),(c=[].concat(h,(0,o.default)(c))).push({translateY:u.height*(N-n.y)})}return{transform:c}};var y=function(){return'react native client'};e.browserName=y;var S=function(){return''};e.osName=S;var M=function(){return!0};e.isMobile=M;e.isChrome=function(){return!0};e.getDeviceInfo=function(){return{isMobile:!0,browserName:'react native client',osName:'',browserVersion:'react native client'}};e.isSafari=function(){return!1};e.isDesktopSafari=function(){return!1};e.useDisclosure=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=v(t),u=(0,n.default)(o,2),s=u[0],c=u[1];return{isOpen:s,onOpen:l(function(){return c(!0)},[]),onClose:l(function(){return c(!1)},[]),toggle:l(function(){return c(function(t){return!t})},[])}}},493,[1,41,49,165,494,496,2]); __d(function(g,r,i,a,m,_e,d){"use strict";var e=r(d[0]),t={"text/plain":"Text","text/html":"Url",default:"Text"},o="Copy to clipboard: #{key}, Enter";function n(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}m.exports=function(c,l){var s,p,u,y,f,b,w=!1;l||(l={}),s=l.debug||!1;try{if(u=e(),y=document.createRange(),f=document.getSelection(),(b=document.createElement("span")).textContent=c,b.style.all="unset",b.style.position="fixed",b.style.top=0,b.style.clip="rect(0, 0, 0, 0)",b.style.whiteSpace="pre",b.style.webkitUserSelect="text",b.style.MozUserSelect="text",b.style.msUserSelect="text",b.style.userSelect="text",b.addEventListener("copy",function(e){if(e.stopPropagation(),l.format)if(e.preventDefault(),void 0===e.clipboardData){s&&console.warn("unable to use e.clipboardData"),s&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=t[l.format]||t.default;window.clipboardData.setData(o,c)}else e.clipboardData.clearData(),e.clipboardData.setData(l.format,c);l.onCopy&&(e.preventDefault(),l.onCopy(e.clipboardData))}),document.body.appendChild(b),y.selectNodeContents(b),f.addRange(y),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");w=!0}catch(e){s&&console.error("unable to copy using execCommand: ",e),s&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(l.format||"text",c),l.onCopy&&l.onCopy(window.clipboardData),w=!0}catch(e){s&&console.error("unable to copy using clipboardData: ",e),s&&console.error("falling back to prompt"),p=n("message"in l?l.message:o),window.prompt(p,c)}}finally{f&&("function"==typeof f.removeRange?f.removeRange(y):f.removeAllRanges()),b&&document.body.removeChild(b),u()}return w}},494,[495]); __d(function(g,r,_i,a,m,e,d){m.exports=function(){var n=document.getSelection();if(!n.rangeCount)return function(){};for(var t=document.activeElement,o=[],u=0;u>2,o=(3&c)<<4|(h=n.charCodeAt(s++))>>4,A=(15&h)<<2|(u=n.charCodeAt(s++))>>6,l=63&u,isNaN(h)?A=l=64:isNaN(u)&&(l=64),f.push(t.charAt(i)+t.charAt(o)+t.charAt(A)+t.charAt(l)),c=h=u="",i=o=A=l=""}while(s>2,o=(3&c)<<4|(h=n[s++])>>4,A=(15&h)<<2|(u=n[s++])>>6,l=63&u,isNaN(h)?A=l=64:isNaN(u)&&(l=64),f.push(t.charAt(i)+t.charAt(o)+t.charAt(A)+t.charAt(l)),c=h=u="",i=o=A=l=""}while(s>18&63)+d.charAt(c>>12&63)+d.charAt(c>>6&63)+d.charAt(63&c);return 2==f?(n=t.charCodeAt(A)<<8,o=t.charCodeAt(++A),s+=d.charAt((c=n+o)>>10)+d.charAt(c>>4&63)+d.charAt(c<<2&63)+'='):1==f&&(c=t.charCodeAt(A),s+=d.charAt(c>>2)+d.charAt(c<<4&63)+'=='),s},decode:function(t){var n=(t=String(t).replace(f,'')).length;n%4==0&&(n=(t=t.replace(/==?$/,'')).length),(n%4==1||/[^+a-zA-Z0-9/]/.test(t))&&h('Invalid character: the string to be decoded is not correctly encoded.');for(var o,a,c=0,s='',A=-1;++A>(-2*c&6)));return s},version:'0.1.0'};if('function'==typeof define&&'object'==typeof define.amd&&define.amd)define(function(){return s});else if(n&&!n.nodeType)if(o)o.exports=s;else for(var A in s)s.hasOwnProperty(A)&&(n[A]=s[A]);else t.base64=s})(this)},577,[]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=_e.Logger=void 0;var t=e(r(d[1])),n=e(r(d[2])),o=e(r(d[3]));function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.getOwnPropertyNames(e).forEach(function(o){if(![null,void 0,NaN].includes(e[o])){var c=t?t+"."+o:o;'object'==typeof e[o]?l(e[o],c,n):n[c]=e[o]}}),n}var c=(function(){function e(){(0,n.default)(this,e),this.level=3}return(0,o.default)(e,[{key:"process",value:function(e){var t={};try{Object.getOwnPropertyNames(e||{}).forEach(function(n){try{t[n]=JSON.stringify(e[n])}catch(e){t[n]='Failed to stringify'}})}catch(e){}return t}},{key:"init",value:function(e){'trace'===e?this.level=3:'log'===e?this.level=2:'error'===e&&(this.level=1)}},{key:"trace",value:function(t,n){e.addEventInCurrentSpan('warn',t,n,!0)}},{key:"warn",value:function(t,n){e.addEventInCurrentSpan('warn',t,n,!0)}},{key:"error",value:function(t,n){e.addEventInCurrentSpan('error',t,n,!0)}}],[{key:"addEventInCurrentSpan",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'info',o=arguments.length>1?arguments[1]:void 0,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;try{var s=l(c,'metadata'),v=(0,t.default)({message:o,logSeverity:n},s,{loggedAt:(new Date).getTime()});u?e.sendOtelLogsToNewRelic(e.logsCache.splice(0,25).concat([v])):e.logsCache.push(v)}catch(e){console.debug('opentelemetry::addEventInCurrentSpan_failed',e)}}},{key:"sendOtelLogsToNewRelic",value:function(t){fetch('https://api-silos.dyte.io/otel/logs',{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json'},body:JSON.stringify({meetingMetadata:l(e.meetingMetadata,'meetingMetadata'),serviceName:'mobile-sdk',logs:t})}).catch(function(e){console.debug('opentelemetry::sendOtelLogToNewRelic_failed',e)})}}]),e})();_e.Logger=c,c.logsCache=[],c.meetingMetadata={};var u=new c;_e.default=u},578,[1,22,9,10]); -__d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.UserTrackContext=void 0,e.default=function(t){var T,P,E,w=(0,c.useState)(),A=(0,o.default)(w,2),b=A[0],N=A[1],k=(0,c.useState)([]),M=(0,o.default)(k,2),O=M[0],x=M[1],D=(0,c.useState)(),C=(0,o.default)(D,2),y=C[0],V=C[1],_=(0,c.useState)([]),R=(0,o.default)(_,2),G=R[0],L=R[1],B=(0,c.useState)(),j=(0,o.default)(B,2),W=j[0],F=j[1],q=(0,c.useState)(),H=(0,o.default)(q,2),U=H[0],J=H[1],Q=(0,c.useRef)(null),K=(0,c.useRef)(null),z=(0,c.useRef)(null),X=(0,c.useRef)(null),Y=(0,c.useContext)(v.ConfigServiceContext),Z=(Y.meeting,Y.sessionConfig),$=Z.permissions.produce.audio,ee=Z.permissions.produce.video,te=Z.permissions.produce.video,ne=ee.allow,re=(0,l.getWebcamConstraints)(ee.quality,ee.frame_rate),ae=((0,l.getScreenShareConstraints)(te.quality,te.frame_rate),t.children),ue=(0,d.useSelector)(function(t){return t.participant.audioMuted}),ie=(0,d.useSelector)(function(t){return t.participant.videoOff}),oe=(0,d.useSelector)(function(t){return t.room.producersState}),ce=(0,d.useSelector)(function(t){return t.participant.switched}),de=(0,d.useSelector)(function(t){return t.participant.canPresent}),se=(0,d.useSelector)(function(t){return t.participant.presentingState}),le=(0,d.useSelector)(function(t){return t.participant.audioTrackSelection}),fe=(0,d.useSelector)(function(t){return t.participant.videoTrackSelection}),ve=(0,d.useSelector)(function(t){return t.participant.videoProduction}),pe=(0,d.useSelector)(function(t){return t.participant.audioProduction}),Se=(0,d.useSelector)(function(t){return t.participant.presentingState}),Te=(oe===s.MediaStates.NOT_APPLICABLE||ve===s.MediaStates.LOADED||ve===s.MediaStates.NOT_STARTED||ve===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&ne,Ie=(oe===s.MediaStates.NOT_APPLICABLE||pe===s.MediaStates.LOADED||pe===s.MediaStates.NOT_STARTED||pe===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&$,Pe=(0,d.useDispatch)(),Ee=c.default.useState([]),he=(0,o.default)(Ee,2),me=he[0],we=he[1],Ae=function(t){we(t)},ge=(0,d.useSelector)(function(t){return t.room.roomViewType}),be=(0,d.useSelector)(function(t){return t.participant.requestToJoinType}),Ne=(0,d.useSelector)(function(t){return t.room.routerState});ge===S.DyteViewTypes.webinar&&be===f.RequestToJoinType.ask&&(re=(0,l.getWebcamConstraints)('QQVGA',null==(T=Z.permissions)?void 0:null==(P=T.produce)?void 0:null==(E=P.video)?void 0:E.frame_rate));(0,c.useEffect)(function(){Q.current=y,K.current=W,z.current=U,X.current=b},[y,W,U,b]),(0,c.useEffect)(function(){I.default.trace('audioMuted_useEffect',{audioMuted:ue,presentingState:se}),b&&(b.enabled=!ue),ge===S.DyteViewTypes.webinar&&se!==f.PresentingState.PRESENTING||Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING))},[ue,se]);var ke=function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,I.default.trace('initialAudioStreamFetch'),t=null,u.prev=3,u.next=6,n.default.awrap((0,l.getAudioTrack)());case 6:t=u.sent,u.next=13;break;case 9:if(u.prev=9,u.t0=u.catch(3),'NotAllowedError'!==u.t0.name){u.next=13;break}throw new Error('No audio permission');case 13:if(t){u.next=15;break}throw new Error('No audio track');case 15:$&&N(t),u.next=23;break;case 18:u.prev=18,u.t1=u.catch(0),I.default.error('initialAudioStreamFetch',u.t1),Pe((0,f.setAudioProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setAudioMuted)(!0));case 23:case"end":return u.stop()}},null,null,[[0,18],[3,9]],Promise)},Me=function(t){if(I.default.trace('setAudioDevice',{audioTrack:!!b}),b&&b.stop(),$){var u=(null==t?void 0:t.deviceId)||(null==le?void 0:le.selectedDeviceId);(0,d.batch)(function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(ke());case 2:Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING)),(null==le?void 0:le.selectedDeviceId)!==u&&Pe((0,f.setAudioTrackSelection)({selectedDeviceId:u}));case 4:case"end":return t.stop()}},null,null,null,Promise)})}else Pe((0,f.setAudioMuted)(!0))},Oe=function(){var t,u,o,c;return n.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return d.prev=0,I.default.trace('initialVideoStreamFetch'),d.next=4,n.default.awrap((0,l.getAllVideoDevices)());case 4:return t=d.sent,u=t.filter(function(t){return'front'===t.facing}),o=u.length>0?u[0]:t[0],c=null,d.prev=8,d.next=11,n.default.awrap((0,l.getVideoTrack)(o.deviceId||'',re));case 11:c=d.sent,d.next=18;break;case 14:if(d.prev=14,d.t0=d.catch(8),'NotAllowedError'!==d.t0.name){d.next=18;break}throw new Error('No video permission');case 18:if(c){d.next=20;break}throw new Error('No video track');case 20:if(ne&&V(c),''!==o.label){d.next=25;break}return d.next=24,n.default.awrap((0,l.getAllVideoDevices)());case 24:t=d.sent;case 25:L(t),Pe((0,f.setVideoTrackSelection)({selectedDeviceId:o.deviceId})),d.next=34;break;case 29:d.prev=29,d.t1=d.catch(0),I.default.error('initialVideoStreamFetch',d.t1),Pe((0,f.setVideoProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setVideoOff)(!0));case 34:case"end":return d.stop()}},null,null,[[0,29],[8,14]],Promise)},xe=function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(I.default.trace('setVideoDevice'),u=(null==t?void 0:t.deviceId)||(null==fe?void 0:fe.selectedDeviceId),ne){o.next=5;break}return Pe((0,f.setVideoOff)(!0)),o.abrupt("return");case 5:(0,d.batch)(function(){Pe((0,f.setVideoOff)(!1)),Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),(null==fe?void 0:fe.selectedDeviceId)!==u&&Pe((0,f.setVideoTrackSelection)({selectedDeviceId:u}))}),setTimeout(function(){var t;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return y&&y.stop(),o.next=3,n.default.awrap((0,l.getVideoTrack)(u,re));case 3:t=o.sent,V(t);case 5:case"end":return o.stop()}},null,null,null,Promise)});case 7:case"end":return o.stop()}},null,null,null,Promise)};(0,c.useEffect)(function(){ge===S.DyteViewTypes.webinar&&Ne===s.MediaStates.LOADED&&Se===f.PresentingState.NOT_PRESENTING?(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.STOPPING)),Pe((0,f.setAudioProduction)(s.MediaStates.STOPPING)),Pe((0,f.setVideoOff)(!0)),Pe((0,f.setAudioMuted)(!0)),setTimeout(function(){y&&y.stop(),b&&b.stop(),N(void 0),V(void 0)})}):Se===f.PresentingState.INITIATED&&(Oe().then(xe),Me())},[Ne,Se]),(0,c.useEffect)(function(){p.default.start({media:'video'});var t=new l.AudioDevicesEmitter(Ae);return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:Q.current&&Q.current.stop(),X.current&&X.current.stop(),K.current&&K.current.stop(),z.current&&z.current.stop();case 4:case"end":return t.stop()}},null,null,null,Promise),function(){t.removeListener()}},[]),c.default.useEffect(function(){ne||(Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&(y.stop(),V(void 0),(0,f.setVideoProduction)(s.MediaStates.CONNECTING))}))},[ne,y]),(0,c.useEffect)(function(){ve===s.MediaStates.NOT_STARTED&&setTimeout(function(){y&&(y.stop(),V(void 0))})},[ve]);var De=function(){(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&y.stop(),V(void 0)})})};(0,c.useEffect)(function(){$||Pe((0,f.setAudioMuted)(!0)),ne||De()},[$,ne]),(0,c.useEffect)(function(){'meeting'===ce?ie||De():'webinar'===ce&&(de||(ue||Pe((0,f.setAudioMuted)(!0)),ie||De()))},[ce]);var Ce=function(){var t,u,o,c,d=arguments;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(t=d.length>0&&void 0!==d[0]?d[0]:null,I.default.trace('changeAudioTrack',{selectedDevice:t}),!(me.length>0)){s.next=10;break}return u={},o={deviceId:null,InCallManagerId:null,device:null},t?(c=t.deviceId,u[c]=t):me.forEach(function(t){var n=t.deviceId;u[n]=t}),u.bluetooth?o={deviceId:'bluetooth',InCallManagerId:'BLUETOOTH',device:u.bluetooth}:u.wired?o={deviceId:'wired',InCallManagerId:'WIRED_HEADSET',device:u.wired}:u.speaker&&(o={deviceId:'speaker',InCallManagerId:'SPEAKER_PHONE',device:u.speaker}),s.next=9,n.default.awrap(p.default.chooseAudioRoute(o.InCallManagerId));case 9:Me(o.device);case 10:case"end":return s.stop()}},null,null,null,Promise)};(0,l.setOnDeviceChange)(function(){var t,o,c,d,s,f,v;return n.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.default.awrap((0,l.getAllVideoDevices)());case 2:if(t=p.sent,o=(0,u.default)(me).find(function(t){return!O.map(function(t){return t.deviceId}).includes(t.deviceId)}),x(me),c=t.find(function(t){return!G.map(function(t){return t.deviceId}).includes(t.deviceId)}),L(t),ue||!o){p.next=10;break}return Me(o),p.abrupt("return");case 10:if(ie||!c){p.next=13;break}return xe(c),p.abrupt("return");case 13:d=!me.map(function(t){return t.deviceId}).includes(null==le?void 0:le.selectedDeviceId),s=!t.map(function(t){return t.deviceId}).includes(null==fe?void 0:fe.selectedDeviceId),ue||void 0!==b&&!d||(f=me[0],Me(f)),ie||void 0!==y&&!s||(v=t[0],xe(v));case 17:case"end":return p.stop()}},null,null,null,Promise)}),(0,c.useEffect)(function(){Ce(void 0),x(me)},[me.length]);var ye={mediaTracks:{webcamTrack:y,setWebcamTrack:V,audioTrack:b,setAudioTrack:N,screenShareVideoTrack:W,setScreenShareVideoTrack:F,screenShareAudioTrack:U,setScreenShareAudioTrack:J},inputDevices:{audioInputDevices:O,videoInputDevices:G,setAudioInputDevices:x,setVideoInputDevices:L,setAudioDevice:Me,setVideoDevice:xe,toggleAudioState:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleAudioState',{audioButtonsEnabled:Ie,audioAllowed:$,audioMuted:ue,audioTrack:!!b}),Ie){t.next=3;break}return t.abrupt("return");case 3:$?ue?(b&&'ended'!==(null==b?void 0:b.readyState)||Me(void 0),Pe((0,f.setAudioMuted)(!1))):Pe((0,f.setAudioMuted)(!0)):ue||Pe((0,f.setAudioMuted)(!0));case 4:case"end":return t.stop()}},null,null,null,Promise)},toggleVideoState:function(t){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleVideoState',{videoButtonsEnabled:Te,videoOff:ie}),Te){t.next=3;break}return t.abrupt("return");case 3:ie?xe():De();case 4:case"end":return t.stop()}},null,null,null,Promise)},onAudioInputChange:function(t){var u;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:I.default.trace('onAudioInputChange',{value:t}),u=O.find(function(n){return n.deviceId===t}),Ce(u);case 3:case"end":return n.stop()}},null,null,null,Promise)},onVideoInputChange:function(t){I.default.trace('onVideoInputChange',{value:t});var n=G.find(function(n){return n.deviceId===t});Pe((0,f.setCameraFacing)(n.facing)),xe(n)}},setupStreams:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(Oe());case 2:return t.next=4,n.default.awrap(ke());case 4:case"end":return t.stop()}},null,null,null,Promise)},videoButtonsEnabled:Te,audioButtonsEnabled:Ie};return c.default.createElement(h.Provider,{value:ye},ae)};var n=t(r(_d[1])),u=t(r(_d[2])),o=t(r(_d[3])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=P(n);if(u&&u.has(t))return u.get(t);var o={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in t)if("default"!==d&&Object.prototype.hasOwnProperty.call(t,d)){var s=c?Object.getOwnPropertyDescriptor(t,d):null;s&&(s.get||s.set)?Object.defineProperty(o,d,s):o[d]=t[d]}o.default=t,u&&u.set(t,o);return o})(r(_d[4])),d=r(_d[5]),s=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=r(_d[9]),p=t(r(_d[10])),S=r(_d[11]),T=r(_d[12]),I=t(r(_d[13]));function P(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(P=function(t){return t?u:n})(t)}var E=T.NativeModules.InCallManager,h=(new T.NativeEventEmitter(E),(0,c.createContext)(null));e.UserTrackContext=h},579,[1,67,49,41,165,432,480,580,487,508,583,482,2,578]); +__d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.UserTrackContext=void 0,e.default=function(t){var T,P,E,h=(0,c.useState)(),A=(0,o.default)(h,2),b=A[0],N=A[1],k=(0,c.useState)([]),D=(0,o.default)(k,2),M=D[0],O=D[1],x=(0,c.useState)(),C=(0,o.default)(x,2),y=C[0],V=C[1],_=(0,c.useState)([]),R=(0,o.default)(_,2),G=R[0],L=R[1],B=(0,c.useState)(),j=(0,o.default)(B,2),W=j[0],F=j[1],q=(0,c.useState)(),H=(0,o.default)(q,2),U=H[0],J=H[1],Q=(0,c.useRef)(null),K=(0,c.useRef)(null),z=(0,c.useRef)(null),X=(0,c.useRef)(null),Y=(0,c.useContext)(v.ConfigServiceContext),Z=(Y.meeting,Y.sessionConfig),$=Z.permissions.produce.audio,ee=Z.permissions.produce.video,te=Z.permissions.produce.video,ne=ee.allow,re=(0,l.getWebcamConstraints)(ee.quality,ee.frame_rate),ae=((0,l.getScreenShareConstraints)(te.quality,te.frame_rate),t.children),ue=(0,d.useSelector)(function(t){return t.participant.audioMuted}),ie=(0,d.useSelector)(function(t){return t.participant.videoOff}),oe=(0,d.useSelector)(function(t){return t.room.producersState}),ce=(0,d.useSelector)(function(t){return t.participant.switched}),de=(0,d.useSelector)(function(t){return t.participant.canPresent}),se=(0,d.useSelector)(function(t){return t.participant.presentingState}),le=(0,d.useSelector)(function(t){return t.participant.audioTrackSelection}),fe=(0,d.useSelector)(function(t){return t.participant.videoTrackSelection}),ve=(0,d.useSelector)(function(t){return t.participant.videoProduction}),pe=(0,d.useSelector)(function(t){return t.participant.audioProduction}),Se=(0,d.useSelector)(function(t){return t.participant.presentingState}),Te=(oe===s.MediaStates.NOT_APPLICABLE||ve===s.MediaStates.LOADED||ve===s.MediaStates.NOT_STARTED||ve===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&ne,Ie=(oe===s.MediaStates.NOT_APPLICABLE||pe===s.MediaStates.LOADED||pe===s.MediaStates.NOT_STARTED||pe===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&$,Pe=(0,d.useDispatch)(),Ee=c.default.useState([]),me=(0,o.default)(Ee,2),we=me[0],he=me[1],Ae=function(t){he(t)},ge=(0,d.useSelector)(function(t){return t.room.roomViewType}),be=(0,d.useSelector)(function(t){return t.participant.requestToJoinType}),Ne=(0,d.useSelector)(function(t){return t.room.routerState});ge===S.DyteViewTypes.webinar&&be===f.RequestToJoinType.ask&&(re=(0,l.getWebcamConstraints)('QQVGA',null==(T=Z.permissions)?void 0:null==(P=T.produce)?void 0:null==(E=P.video)?void 0:E.frame_rate));(0,c.useEffect)(function(){Q.current=y,K.current=W,z.current=U,X.current=b},[y,W,U,b]),(0,c.useEffect)(function(){I.default.trace('audioMuted_useEffect',{audioMuted:ue,presentingState:se}),b&&(b.enabled=!ue),ge===S.DyteViewTypes.webinar&&se!==f.PresentingState.PRESENTING||Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING))},[ue,se]);var ke=function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,I.default.trace('initialAudioStreamFetch'),t=null,u.prev=3,u.next=6,n.default.awrap((0,l.getAudioTrack)());case 6:t=u.sent,u.next=13;break;case 9:if(u.prev=9,u.t0=u.catch(3),'NotAllowedError'!==u.t0.name){u.next=13;break}throw new Error('No audio permission');case 13:if(t){u.next=15;break}throw new Error('No audio track');case 15:$&&N(t),u.next=23;break;case 18:u.prev=18,u.t1=u.catch(0),I.default.error('initialAudioStreamFetch',u.t1),Pe((0,f.setAudioProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setAudioMuted)(!0));case 23:case"end":return u.stop()}},null,null,[[0,18],[3,9]],Promise)},De=function(t){if(I.default.trace('setAudioDevice',{audioTrack:!!b}),b&&b.stop(),$){var u=(null==t?void 0:t.deviceId)||(null==le?void 0:le.selectedDeviceId);(0,d.batch)(function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(ke());case 2:Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING)),(null==le?void 0:le.selectedDeviceId)!==u&&Pe((0,f.setAudioTrackSelection)({selectedDeviceId:u}));case 4:case"end":return t.stop()}},null,null,null,Promise)})}else Pe((0,f.setAudioMuted)(!0))},Me=function(){var t,u,o,c;return n.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return d.prev=0,I.default.trace('initialVideoStreamFetch'),d.next=4,n.default.awrap((0,l.getAllVideoDevices)());case 4:return t=d.sent,u=t.filter(function(t){return'front'===t.facing}),o=u.length>0?u[0]:t[0],c=null,d.prev=8,d.next=11,n.default.awrap((0,l.getVideoTrack)(o.deviceId||'',re));case 11:c=d.sent,d.next=18;break;case 14:if(d.prev=14,d.t0=d.catch(8),'NotAllowedError'!==d.t0.name){d.next=18;break}throw new Error('No video permission');case 18:if(c){d.next=20;break}throw new Error('No video track');case 20:if(ne&&V(c),''!==o.label){d.next=25;break}return d.next=24,n.default.awrap((0,l.getAllVideoDevices)());case 24:t=d.sent;case 25:L(t),Pe((0,f.setVideoTrackSelection)({selectedDeviceId:o.deviceId})),d.next=34;break;case 29:d.prev=29,d.t1=d.catch(0),I.default.error('initialVideoStreamFetch',d.t1),Pe((0,f.setVideoProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setVideoOff)(!0));case 34:case"end":return d.stop()}},null,null,[[0,29],[8,14]],Promise)},Oe=function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(I.default.trace('setVideoDevice'),u=(null==t?void 0:t.deviceId)||(null==fe?void 0:fe.selectedDeviceId),ne){o.next=5;break}return Pe((0,f.setVideoOff)(!0)),o.abrupt("return");case 5:(0,d.batch)(function(){Pe((0,f.setVideoOff)(!1)),Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),(null==fe?void 0:fe.selectedDeviceId)!==u&&Pe((0,f.setVideoTrackSelection)({selectedDeviceId:u}))}),setTimeout(function(){var t;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return y&&y.stop(),o.next=3,n.default.awrap((0,l.getVideoTrack)(u,re));case 3:t=o.sent,V(t);case 5:case"end":return o.stop()}},null,null,null,Promise)});case 7:case"end":return o.stop()}},null,null,null,Promise)};(0,c.useEffect)(function(){ge===S.DyteViewTypes.webinar&&Ne===s.MediaStates.LOADED&&Se===f.PresentingState.NOT_PRESENTING?(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.STOPPING)),Pe((0,f.setAudioProduction)(s.MediaStates.STOPPING)),Pe((0,f.setVideoOff)(!0)),Pe((0,f.setAudioMuted)(!0)),setTimeout(function(){y&&y.stop(),b&&b.stop(),N(void 0),V(void 0)})}):Se===f.PresentingState.INITIATED&&(Me().then(Oe),De())},[Ne,Se]),(0,c.useEffect)(function(){p.default.start({media:'video'});var t=new l.AudioDevicesEmitter(Ae);return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:Q.current&&Q.current.stop(),X.current&&X.current.stop(),K.current&&K.current.stop(),z.current&&z.current.stop();case 4:case"end":return t.stop()}},null,null,null,Promise),function(){t.removeListener()}},[]),c.default.useEffect(function(){ne||(Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&(y.stop(),V(void 0),(0,f.setVideoProduction)(s.MediaStates.CONNECTING))}))},[ne,y]),(0,c.useEffect)(function(){ve===s.MediaStates.NOT_STARTED&&setTimeout(function(){y&&(y.stop(),V(void 0))})},[ve]);var xe=function(){(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&y.stop(),V(void 0)})})};(0,c.useEffect)(function(){$||Pe((0,f.setAudioMuted)(!0)),ne||xe()},[$,ne]),(0,c.useEffect)(function(){'meeting'===ce?ie||xe():'webinar'===ce&&(de||(ue||Pe((0,f.setAudioMuted)(!0)),ie||xe()))},[ce]);var Ce=function(){var t,u,o,c,d=arguments;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(t=d.length>0&&void 0!==d[0]?d[0]:null,I.default.trace('changeAudioTrack',{selectedDevice:t,audioDevices:we}),!(we.length>0)){s.next=10;break}return u={},o={deviceId:null,InCallManagerId:null,device:null},t?(c=t.deviceId,u[c]=t):we.forEach(function(t){var n=t.deviceId;u[n]=t}),u.wired?o={deviceId:'wired',InCallManagerId:'WIRED_HEADSET',device:u.wired}:u.bluetooth?o={deviceId:'bluetooth',InCallManagerId:'BLUETOOTH',device:u.bluetooth}:u.speaker&&(o={deviceId:'speaker',InCallManagerId:'SPEAKER_PHONE',device:u.speaker}),s.next=9,n.default.awrap(p.default.chooseAudioRoute(o.InCallManagerId));case 9:De(o.device);case 10:case"end":return s.stop()}},null,null,null,Promise)};(0,l.setOnDeviceChange)(function(){var t,o,c,d,s,f,v;return n.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.default.awrap((0,l.getAllVideoDevices)());case 2:if(t=p.sent,o=(0,u.default)(we).find(function(t){return!M.map(function(t){return t.deviceId}).includes(t.deviceId)}),O(we),c=t.find(function(t){return!G.map(function(t){return t.deviceId}).includes(t.deviceId)}),L(t),ue||!o){p.next=10;break}return De(o),p.abrupt("return");case 10:if(ie||!c){p.next=13;break}return Oe(c),p.abrupt("return");case 13:d=!we.map(function(t){return t.deviceId}).includes(null==le?void 0:le.selectedDeviceId),s=!t.map(function(t){return t.deviceId}).includes(null==fe?void 0:fe.selectedDeviceId),ue||void 0!==b&&!d||(f=we[0],De(f)),ie||void 0!==y&&!s||(v=t[0],Oe(v));case 17:case"end":return p.stop()}},null,null,null,Promise)}),(0,c.useEffect)(function(){Ce(void 0),O(we)},[we]);var ye={mediaTracks:{webcamTrack:y,setWebcamTrack:V,audioTrack:b,setAudioTrack:N,screenShareVideoTrack:W,setScreenShareVideoTrack:F,screenShareAudioTrack:U,setScreenShareAudioTrack:J},inputDevices:{audioInputDevices:M,videoInputDevices:G,setAudioInputDevices:O,setVideoInputDevices:L,setAudioDevice:De,setVideoDevice:Oe,toggleAudioState:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleAudioState',{audioButtonsEnabled:Ie,audioAllowed:$,audioMuted:ue,audioTrack:!!b}),Ie){t.next=3;break}return t.abrupt("return");case 3:$?ue?(b&&'ended'!==(null==b?void 0:b.readyState)||De(void 0),Pe((0,f.setAudioMuted)(!1))):Pe((0,f.setAudioMuted)(!0)):ue||Pe((0,f.setAudioMuted)(!0));case 4:case"end":return t.stop()}},null,null,null,Promise)},toggleVideoState:function(t){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleVideoState',{videoButtonsEnabled:Te,videoOff:ie}),Te){t.next=3;break}return t.abrupt("return");case 3:ie?Oe():xe();case 4:case"end":return t.stop()}},null,null,null,Promise)},onAudioInputChange:function(t){var u;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:I.default.trace('onAudioInputChange',{value:t}),u=M.find(function(n){return n.deviceId===t}),Ce(u);case 3:case"end":return n.stop()}},null,null,null,Promise)},onVideoInputChange:function(t){I.default.trace('onVideoInputChange',{value:t});var n=G.find(function(n){return n.deviceId===t});Pe((0,f.setCameraFacing)(n.facing)),Oe(n)}},setupStreams:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(Me());case 2:return t.next=4,n.default.awrap(ke());case 4:case"end":return t.stop()}},null,null,null,Promise)},videoButtonsEnabled:Te,audioButtonsEnabled:Ie};return c.default.createElement(w.Provider,{value:ye},ae)};var n=t(r(_d[1])),u=t(r(_d[2])),o=t(r(_d[3])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=P(n);if(u&&u.has(t))return u.get(t);var o={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in t)if("default"!==d&&Object.prototype.hasOwnProperty.call(t,d)){var s=c?Object.getOwnPropertyDescriptor(t,d):null;s&&(s.get||s.set)?Object.defineProperty(o,d,s):o[d]=t[d]}o.default=t,u&&u.set(t,o);return o})(r(_d[4])),d=r(_d[5]),s=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=r(_d[9]),p=t(r(_d[10])),S=r(_d[11]),T=r(_d[12]),I=t(r(_d[13]));function P(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(P=function(t){return t?u:n})(t)}var E=T.NativeModules.InCallManager,w=(new T.NativeEventEmitter(E),(0,c.createContext)(null));e.UserTrackContext=w},579,[1,67,49,41,165,432,480,580,487,508,583,482,2,578]); __d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.setOnDeviceChange=e.getWebcamConstraints=e.getVideoTrack=e.getSpeakerTrack=e.getScreenShareConstraints=e.getScreenShare=e.getQualityAfterLegacyModeShift=e.getAudioTrack=e.getAllVideoDevices=e.getAllMediaDevices=e.AudioDevicesEmitter=void 0;var n=t(r(_d[1])),u=t(r(_d[2])),c=t(r(_d[3])),o=t(r(_d[4])),s=r(_d[5]),d=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=t(r(_d[9])),h=l.NativeModules.InCallManager,D=new l.NativeEventEmitter(h),p=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.enumerateDevices());case 2:return t=n.sent,n.abrupt("return",t);case 4:case"end":return n.stop()}},null,null,null,Promise)};e.getAllMediaDevices=p;var w=(function(){function t(n){if((0,u.default)(this,t),!n)throw new Error('Callback not initalized');this.callback=n,this.notConnected={connected:!1,haveMic:!1},this.connectedWithMic={connected:!0,haveMic:!0},this.connectedWithoutMic={connected:!0,haveMic:!1};var c=(0,d.getHeadset)();this.audioDevices={speaker:this.connectedWithMic,bluetooth:c?this.connectedWithMic:this.notConnected,wired:this.notConnected},this.checkIfWiredHeadphonesConnected(),this.onBluetoothEvent(),this.onWiredHeadsetEvent(),this.emit(),this.wiredHeadListener=null}return(0,c.default)(t,[{key:"checkIfWiredHeadphonesConnected",value:function(){var t;return o.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,o.default.awrap(v.default.getIsWiredHeadsetPluggedIn());case 2:t=u.sent,this.audioDevices=(0,n.default)({},this.audioDevices,{wired:t?this.connectedWithMic:this.notConnected}),this.emit();case 5:case"end":return u.stop()}},null,this,null,Promise)}},{key:"onBluetoothEvent",value:function(){var t=this;(0,d.addListener)(function(u){var c=t.audioDevices.bluetooth.connected;u&&!c?(t.audioDevices=(0,n.default)({},t.audioDevices,{bluetooth:(0,n.default)({},t.connectedWithMic)}),t.emit()):!u&&c&&(t.audioDevices=(0,n.default)({},t.audioDevices,{bluetooth:(0,n.default)({},t.notConnected)}),t.emit())})}},{key:"onWiredHeadsetEvent",value:function(){var t=this;this.wiredHeadListener=D.addListener('WiredHeadset',function(u){if(u){var c=u.isPlugged,o=u.hasMic,s=t.audioDevices.wired.connected;if(c&&!s){var d=o?(0,n.default)({},t.connectedWithMic):(0,n.default)({},t.connectedWithoutMic);t.audioDevices=(0,n.default)({},t.audioDevices,{wired:d}),t.emit()}else!c&&s&&(t.audioDevices=(0,n.default)({},t.audioDevices,{wired:(0,n.default)({},t.notConnected)}),t.emit())}})}},{key:"getAudioDevices",value:function(){return this.formatAudioDevices()}},{key:"formatAudioDevices",value:function(){var t=this;return Object.keys(this.audioDevices).map(function(u){var c=t.audioDevices[u];return(0,n.default)({},c,{deviceId:u,label:u,kind:'audioinput'})}).filter(function(t){return t.connected})}},{key:"emit",value:function(){this.callback(this.formatAudioDevices())}},{key:"removeListener",value:function(){var t;null==(t=this.wiredHeadListener)||t.remove()}}]),t})();e.AudioDevicesEmitter=w;e.getAllVideoDevices=function(){var t,n;return o.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return t={},u.next=3,o.default.awrap(p());case 3:return n=u.sent,u.abrupt("return",n.filter(function(n){return'videoinput'===n.kind&&!t[n.facing]&&(t[n.facing]=!0,n)}));case 5:case"end":return u.stop()}},null,null,null,Promise)};e.getWebcamConstraints=function(t,n){var u=f.VIDEO_CONSTRAINS[t.toLowerCase()];if(!u)throw new Error('Invalid quality');if(n){if(n<5||n>30)throw new Error('Invalid framerate');u.frameRate={ideal:n}}return u};e.getScreenShareConstraints=function(t,n){var u=f.VIDEO_CONSTRAINS_SCREENSHARE[t.toLowerCase()||'vga'];if(!u)throw new Error('Invalid quality');if(n){if(n<5||n>30)throw new Error('Invalid framerate');u.frameRate={max:n}}return u};e.getVideoTrack=function(t,u){var c,d;return o.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return c=u||f.VIDEO_CONSTRAINS.vga,l.next=3,o.default.awrap(s.mediaDevices.getUserMedia({video:(0,n.default)({deviceId:t||'',frameRate:24},c),audio:!1}));case 3:return d=l.sent,l.abrupt("return",d.getVideoTracks()[0]);case 5:case"end":return l.stop()}},null,null,null,Promise)};e.getAudioTrack=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.getUserMedia({audio:!0,video:!1}));case 2:return t=n.sent,n.abrupt("return",t.getAudioTracks()[0]);case 4:case"end":return n.stop()}},null,null,null,Promise)};e.getSpeakerTrack=function(t){return o.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null);case 2:case"end":return t.stop()}},null,null,null,Promise)};e.getScreenShare=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.getDisplayMedia({audio:!0,video:{displaySurface:'monitor',logicalSurface:!0,cursor:!0,width:{max:1920},height:{max:1080},frameRate:{max:5}}}));case 2:return t=n.sent,n.abrupt("return",{video:t.getTracks()[0],audio:null});case 4:case"end":return n.stop()}},null,null,null,Promise)};e.setOnDeviceChange=function(t){};e.getQualityAfterLegacyModeShift=function(t,n,u){return n===f.HD_QUALITY_PEERS_LIMIT&&t?f.VIDEO_CONSTRAINS.vga:n!==f.HD_QUALITY_PEERS_LIMIT+1||t?u:f.VIDEO_CONSTRAINS.hd}},580,[1,22,9,10,67,400,581,2,582,583]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.useBluetoothHeadsetDetection=e.removeListener=e.getHeadset=e.addListener=void 0;var n=t(r(d[1])),u=r(d[2]),o=r(d[3]),s=u.NativeModules.DyteRNBluetoothHeadsetDetect,c=null,v=[],f=new u.NativeEventEmitter(s).addListener('onChange',function(t){var n=t.devices;c=n.length?n[0]:null,v.forEach(function(t){t(c)})});e.getHeadset=function(){return c};var l=function(t){v.push(t)};e.addListener=l;var h=function(t){var n=v.indexOf(t);-1!==n&&v.splice(n,1)};e.removeListener=h;e.useBluetoothHeadsetDetection=function(){var t=(0,o.useState)(null),u=(0,n.default)(t,2),s=u[0],v=u[1];return(0,o.useEffect)(function(){return v(c),l(v),function(){h(v),f.remove()}},[]),s}},581,[1,41,2,165]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.WEBCAM_SIMULCAST_ENCODINGS_VGA=e.WEBCAM_SIMULCAST_ENCODINGS=e.WEBCAM_KSVC_ENCODINGS=e.VIDEO_CONSTRAINS_SCREENSHARE=e.VIDEO_CONSTRAINS=e.SCREEN_SHARING_SVC_ENCODINGS=e.SCREEN_SHARING_SIMULCAST_ENCODINGS=e.PC_PROPRIETARY_CONSTRAINTS=e.ICE_SERVERS=e.HD_QUALITY_PEERS_LIMIT=void 0;e.VIDEO_CONSTRAINS={qqvga:{width:{ideal:160},height:{ideal:120}},qvga:{width:320,height:240},vga:{width:640,height:480},hd:{width:1280,height:720},hd_cropped:{width:900,height:720}};e.VIDEO_CONSTRAINS_SCREENSHARE={vga:{width:{max:640},height:{max:480}},hd:{width:{max:1280},height:{max:720}},full_hd:{width:{max:1980},height:{max:1080}}};e.PC_PROPRIETARY_CONSTRAINTS={optional:[{googDscp:!0},{googHighStartBitrate:0},{googPayloadPadding:!0},{googScreencastMinBitrate:100},{googCpuOveruseDetection:!0},{googCpuOveruseEncodeUsage:!0},{googCpuUnderuseThreshold:55},{googCpuOveruseThreshold:85}]};e.WEBCAM_SIMULCAST_ENCODINGS=[{rid:'r0',scalabilityMode:'S1T3'},{rid:'r1',scalabilityMode:'S1T3'},{rid:'r2',scalabilityMode:'S1T3'}];e.WEBCAM_SIMULCAST_ENCODINGS_VGA=[{rid:'r0',scalabilityMode:'S1T2'},{rid:'r1',scalabilityMode:'S1T2'}];e.WEBCAM_KSVC_ENCODINGS=[{scalabilityMode:'L3T3_KEY'}];e.SCREEN_SHARING_SIMULCAST_ENCODINGS=[{dtx:!0,maxBitrate:15e5},{dtx:!0,maxBitrate:6e6}];e.SCREEN_SHARING_SVC_ENCODINGS=[{scalabilityMode:'L3T3',dtx:!0}];e.HD_QUALITY_PEERS_LIMIT=1;e.ICE_SERVERS=[{urls:'turn:turn.dyte.in:443?transport=tcp',username:'dyte',credential:'dytein',credentialType:'password'},{urls:'turn:turn.dyte.in:3478?transport=udp',username:'dyte',credential:'dytein',credentialType:'password'}]},582,[]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),o=t(r(d[3])),s=r(d[4]),l=r(d[4]).NativeModules.InCallManager,c=new((function(){function t(){(0,u.default)(this,t),this.vibrate=!1,this.audioUriMap={ringtone:{_BUNDLE_:null,_DEFAULT_:null},ringback:{_BUNDLE_:null,_DEFAULT_:null},busytone:{_BUNDLE_:null,_DEFAULT_:null}}}return(0,o.default)(t,[{key:"start",value:function(t){var n=!1!==(t=void 0===t?{}:t).auto,u='video'===t.media?'video':'audio',o=t.ringback&&'string'==typeof t.ringback?t.ringback:'';l.start(u,n,o)}},{key:"stop",value:function(t){var n=(t=void 0===t?{}:t).busytone&&'string'==typeof t.busytone?t.busytone:'';l.stop(n)}},{key:"getIsWiredHeadsetPluggedIn",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n.default.awrap(l.getIsWiredHeadsetPluggedIn());case 3:return t.abrupt("return",t.sent);case 6:throw t.prev=6,t.t0=t.catch(0),new Error('Incall Manager Error getting wired headset');case 9:case"end":return t.stop()}},null,null,[[0,6]],Promise)}},{key:"setKeepScreenOn",value:function(t){t=!0===t,l.setKeepScreenOn(t)}},{key:"setSpeakerphoneOn",value:function(t){t=!0===t,l.setSpeakerphoneOn(t)}},{key:"setForceSpeakerphoneOn",value:function(t){var n='boolean'==typeof t?t?1:-1:0;l.setForceSpeakerphoneOn(n)}},{key:"setMicrophoneMute",value:function(t){t=!0===t,l.setMicrophoneMute(t)}},{key:"getAudioUri",value:function(t,u){var o;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(void 0!==this.audioUriMap[t]){s.next=2;break}return s.abrupt("return",null);case 2:if(!this.audioUriMap[t][u]){s.next=4;break}return s.abrupt("return",this.audioUriMap[t][u]);case 4:return s.prev=4,s.next=7,n.default.awrap(l.getAudioUriJS(t,u));case 7:if(!('string'==typeof(o=s.sent)&&o.length>0)){s.next=11;break}return this.audioUriMap[t][u]=o,s.abrupt("return",o);case 11:return s.abrupt("return",null);case 14:return s.prev=14,s.t0=s.catch(4),s.abrupt("return",null);case 17:case"end":return s.stop()}},null,this,[[4,14]],Promise)}},{key:"chooseAudioRoute",value:function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(l.chooseAudioRoute(t));case 2:return u=o.sent,o.abrupt("return",u);case 4:case"end":return o.stop()}},null,null,null,Promise)}},{key:"requestAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.requestAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}},{key:"abandonAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.abandonAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}}]),t})());e.default=c},583,[1,67,9,10,2]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),o=t(r(d[3])),s=r(d[4]),l=r(d[4]).NativeModules.InCallManager,c=new((function(){function t(){(0,u.default)(this,t),this.vibrate=!1,this.audioUriMap={ringtone:{_BUNDLE_:null,_DEFAULT_:null},ringback:{_BUNDLE_:null,_DEFAULT_:null},busytone:{_BUNDLE_:null,_DEFAULT_:null}}}return(0,o.default)(t,[{key:"start",value:function(t){var n=!1!==(t=void 0===t?{}:t).auto,u='video'===t.media?'video':'audio',o=t.ringback&&'string'==typeof t.ringback?t.ringback:'';l.start(u,n,o)}},{key:"stop",value:function(t){var n=(t=void 0===t?{}:t).busytone&&'string'==typeof t.busytone?t.busytone:'';l.stop(n)}},{key:"getIsWiredHeadsetPluggedIn",value:function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,u.next=3,n.default.awrap(l.getIsWiredHeadsetPluggedIn());case 3:return t=u.sent,u.abrupt("return",{isWiredHeadsetPluggedIn:t});case 7:throw u.prev=7,u.t0=u.catch(0),new Error('Incall Manager Error getting wired headset');case 10:case"end":return u.stop()}},null,null,[[0,7]],Promise)}},{key:"setKeepScreenOn",value:function(t){t=!0===t,l.setKeepScreenOn(t)}},{key:"setSpeakerphoneOn",value:function(t){t=!0===t,l.setSpeakerphoneOn(t)}},{key:"setForceSpeakerphoneOn",value:function(t){var n='boolean'==typeof t?t?1:-1:0;l.setForceSpeakerphoneOn(n)}},{key:"setMicrophoneMute",value:function(t){t=!0===t,l.setMicrophoneMute(t)}},{key:"getAudioUri",value:function(t,u){var o;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(void 0!==this.audioUriMap[t]){s.next=2;break}return s.abrupt("return",null);case 2:if(!this.audioUriMap[t][u]){s.next=4;break}return s.abrupt("return",this.audioUriMap[t][u]);case 4:return s.prev=4,s.next=7,n.default.awrap(l.getAudioUriJS(t,u));case 7:if(!('string'==typeof(o=s.sent)&&o.length>0)){s.next=11;break}return this.audioUriMap[t][u]=o,s.abrupt("return",o);case 11:return s.abrupt("return",null);case 14:return s.prev=14,s.t0=s.catch(4),s.abrupt("return",null);case 17:case"end":return s.stop()}},null,this,[[4,14]],Promise)}},{key:"chooseAudioRoute",value:function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(l.chooseAudioRoute(t));case 2:return u=o.sent,o.abrupt("return",u);case 4:case"end":return o.stop()}},null,null,null,Promise)}},{key:"requestAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.requestAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}},{key:"abandonAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.abandonAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}}]),t})());e.default=c},583,[1,67,9,10,2]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),o=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=_(t);if(o&&o.has(e))return o.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=u?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(n,s,l):n[s]=e[s]}n.default=e,o&&o.set(e,n);return n})(r(d[2])),n=r(d[3]),u=r(d[4]),s=r(d[5]),l=r(d[6]),c=r(d[7]),f=r(d[8]),p=e(r(d[9])),N=r(d[10]),E=r(d[11]),h=r(d[12]),v=r(d[13]),S=e(r(d[14])),y=r(d[15]),P=r(d[16]),w=r(d[17]),T=r(d[18]),O=r(d[19]),C=r(d[20]),x=r(d[21]),b=e(r(d[22])),I=e(r(d[23])),M=e(r(d[24]));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(_=function(e){return e?o:t})(e)}var D="\nquery Session($roomName: String!, $password: String) {\n\tsession(roomName: $roomName, password: $password) {\n\t title,\n\t roomNodeLink,\n\t roomName,\n\t password\n\t}\n }\n";function k(e){var _,k=(0,n.useDispatch)(),j=e.roomName,L=e.autoTune,W=(0,n.useSelector)(function(e){return e.participant.peerId}),R=(0,o.useContext)(y.ConfigServiceContext),U=R.meeting,$=R.sessionConfig,A=R.updatePreset,Q=((0,o.useContext)(P.ThemeContext).colors,(0,o.useState)('')),B=(0,t.default)(Q,2),F=B[0],G=B[1],V=(0,h.useManualQuery)(D,{variables:{roomName:j,password:''}}),q=(0,t.default)(V,2),K=q[0],Y=q[1],z=Y.data,H=Y.error,J=Y.loading,X=(0,v.useWindowDimensions)(),Z=$.theme.dimensions||X,ee=Z.height,te=Z.width,re=o.default.useState(!1),oe=(0,t.default)(re,2),ne=(oe[0],oe[1]),ae=(0,o.useContext)(w.UserTrackContext).setupStreams,ie=(0,n.useSelector)(function(e){return e.participant.authToken}),ue=(0,n.useSelector)(function(e){return e.participant.displayName}),se=(0,n.useSelector)(function(e){return e.participant.participantPermissions}),le=$.permissions.produce.audio,me=$.permissions.produce.video.allow,ce=(0,n.useSelector)(function(e){return e.room.showSetupScreen}),de=o.default.useState(j),fe=(0,t.default)(de,2),pe=fe[0],Ne=fe[1],Ee='LANDSCAPE'===o.default.useContext(x.OrientationContext).orientation,he=(0,n.useSelector)(function(e){return e.room.roomViewType}),ve=$.permissions_fetched;(0,o.useEffect)(function(){ve&&(me?(0,O.setupPermissions)(['camera','microphone']):le?(0,O.setupPermissions)(['microphone']):(0,O.setupPermissions)([]),ne(!0))},[he,ve]),(0,o.useEffect)(function(){k((0,c.resetRoom)({roomName:j})),k((0,f.resetPeers)());try{S.default.getItem('dyte-display-name').then(function(e){null!==e&&k((0,E.setUserDisplayName)(e))})}catch(e){}},[]),(0,o.useEffect)(function(){pe&&(ie||C.DYTE_DEV_MODE)&&(k((0,c.resetRoom)({roomName:pe})),K({variables:{roomName:pe,password:''}}),A(pe,ie))},[pe,ie]),(0,o.useEffect)(function(){if(H)if(H.graphQLErrors[0].message.indexOf('No open session')>=0)null==U||U._onError('MEETING_NOTFOUND'),G('MEETING_NOTFOUND');else try{var e=H.graphQLErrors[0];G(null==e?void 0:e.message)}catch(e){G('UNKNOWN')}},[H,U]),(0,o.useEffect)(function(){se.camera===E.permissionEnum.INIT&&se.microphone===E.permissionEnum.INIT||ae()},[se.camera,se.microphone]);if(se.bluetooth===E.permissionEnum.INIT)return o.default.createElement(p.default,{text:"Waiting for permissions..."});var Se;return null==U||!U.showSetupScreen||null!==ce&&!0!==ce?H?o.default.createElement(p.default,{errorText:"Some error occured. Issue code: "+F,childComponents:o.default.createElement(T.Button,{onClick:function(){setTimeout(function(){k((0,f.resetPeers)()),k((0,E.resetParticipant)()),k((0,c.setShowSetupScreen)(!0)),Ne(''),G('')})}},o.default.createElement(T.Box,{bg:"primary.500",py:15,px:10,mt:10,borderRadius:b.default.medium,align:"center"},o.default.createElement(T.Text,null,"Try Again")))}):J?o.default.createElement(p.default,{text:"Loading..."}):o.default.createElement(l.WebSocketProvider,{url:null==z?void 0:null==(_=z.session)?void 0:_.roomNodeLink,roomURL:pe,peerId:W},o.default.createElement(u.MediaRoomProvider,{peerId:W,roomName:pe,autoTune:L},o.default.createElement(N.PeersProvider,null,o.default.createElement(s.PluginServiceProvider,{roomName:pe,peerId:W},o.default.createElement(I.default,{roomName:pe}))))):o.default.createElement(M.default,{width:te,height:ee,isLandscape:Ee,meetingCode:pe,roomName:j,onChangeMeetingCode:Ne,joinMeeting:function(){ue&&pe&&(k((0,c.setShowSetupScreen)(!1)),k((0,c.resetRoom)({roomName:pe})),K({variables:{roomName:pe,password:''}}),A(pe,ie))},title:null==z?void 0:null==(Se=z.session)?void 0:Se.title})}k.defaultProps={autoTune:!0};var j=k;_e.default=j},584,[1,41,165,432,585,672,630,480,481,511,674,487,465,2,488,508,514,579,512,675,543,575,676,677,809]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.MediaRoomProvider=e.MediaRoomContext=void 0;var n=t(r(d[1])),o=t(r(d[2])),u=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=T(n);if(o&&o.has(t))return o.get(t);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var l=c?Object.getOwnPropertyDescriptor(t,s):null;l&&(l.get||l.set)?Object.defineProperty(u,s,l):u[s]=t[s]}u.default=t,o&&o.set(t,u);return u})(r(d[3])),c=r(d[4]),s=r(d[5]),l=r(d[6]),f=r(d[7]),p=t(r(d[8])),v=r(d[9]),S=r(d[10]),E=r(d[11]),M=t(r(d[12])),k=r(d[13]),C=r(d[14]),P=t(r(d[15])),R=r(d[16]),O=t(r(d[17]));function T(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(T=function(t){return t?o:n})(t)}var b=R.NativeModules.DyteHelper,A=(0,u.createContext)(null);e.MediaRoomContext=A;e.MediaRoomProvider=function(t){var T=t.children,x=t.peerId,y=t.roomName,h=t.autoTune,D=(0,u.useContext)(v.WebSocketContext),N=(0,u.useContext)(k.ConfigServiceContext),w=N.meeting,I=N.sessionConfig,_=I.permissions.produce.audio,L=(0,u.useContext)(E.UserTrackContext),j=L.mediaTracks,W=j.webcamTrack,B=j.audioTrack,F=L.inputDevices.toggleVideoState,G=(0,c.useDispatch)(),U=(0,u.useState)(null),V=(0,o.default)(U,2),q=V[0],H=V[1],z=(0,u.useRef)(null),J=(0,u.useRef)(null),K=(0,u.useRef)(''),Q=(0,u.useRef)(null),X=(0,c.useSelector)(function(t){return t.room.socketState}),Y=(0,c.useSelector)(function(t){return t.room.producersState}),Z=(0,c.useSelector)(function(t){return t.participant.videoProduction}),$=(0,c.useSelector)(function(t){return t.participant.audioProduction}),ee=(0,c.useSelector)(function(t){return t.participant.audioMuted});(0,u.useEffect)(function(){q&&(J.current=q)},[q]),(0,u.useEffect)(function(){q&&(ee?q.muteSelf():q.unmuteSelf())},[ee]),(0,u.useEffect)(function(){Y===s.MediaStates.LOADED&&Z===s.MediaStates.CONNECTING&&(W?null==q||q.shareWebcam(W):null==q||q.disableWebcam())},[W,Y]),(0,u.useEffect)(function(){Y===s.MediaStates.LOADED&&$===s.MediaStates.CONNECTING&&(B&&_&&!ee?null==q||q.shareMic(B):null==q||q.disableMic())},[B,$]),(0,u.useEffect)(function(){var t;if(X===s.RoomSocketState.CONNECTED){M.default.captureEvent('setting up connection',{peerId:x}),w&&w.emit(w.Events.connect);var o=new p.default(x,D,G,h);H(o),t=o,n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(t.getRoomState());case 2:return o.next=4,n.default.awrap(t.loadRouter());case 4:return o.next=6,n.default.awrap(Promise.all([t.createRecvTransport(),t.createSendTransport()]));case 6:w&&(w.sendRoomMessage=function(t){D.sendMessage({type:C.Events.roomMessage,payload:{message:t}})},w.sendMessage=function(t,n){D.sendMessage({type:C.Events.message,payload:{peerId:t,message:n}})},w.kickAll=function(){I.permissions.kick_participant&&t.kickAll()},null==D||D.emitter.on('socket',function(t){return w.onSocketMessage(t)})),G((0,s.setRouterFetchState)(s.MediaStates.LOADED)),G((0,s.setProducersState)(s.MediaStates.NOT_STARTED));case 9:case"end":return o.stop()}},null,null,null,Promise)}else X===s.RoomSocketState.DISCONNECTED&&(M.default.captureEvent('socket disconnected',{peerId:x}),null==q||q.stopAllTransports(),null==D||D.emitter.removeAllListeners(),G((0,s.resetRoom)({roomName:y})),G((0,f.resetPeers)()),G((0,S.resetParticipant)()),H(null),(0,s.setRouterFetchState)(s.MediaStates.NOT_APPLICABLE))},[X,x]),(0,u.useEffect)(function(){return function(){var t,n;null==(t=J.current)||t.stopAllProducers(),null==(n=J.current)||n.stopAllTransports()}},[]);var te=function(t){K.current.match(/inactive|background/)&&'active'===t?(O.default.trace('configureBackground'),P.default.clearInterval(Q.current),Q.current=null,W&&(W.enabled=!1,setTimeout(function(){W&&(W.enabled=!0)},100)),z.current&&(z.current=!1,F()),l.store.getState().room.screenShareRequested||b.stopService()):(null===Q.current&&n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(O.default.trace('configureForeground'),W&&'DISABLE_CAMERA_CAPTURE'===w.setupConfig.backgroundBehaviour&&(F(),z.current=!0),!(R.Platform.Version>=26)){t.next=5;break}return t.next=5,n.default.awrap(b.createNotificationChannel());case 5:return t.next=7,n.default.awrap(b.startService());case 7:case"end":return t.stop()}},null,null,null,Promise),Q.current=P.default.setInterval(function(){},1e3),K.current=t)};(0,u.useEffect)(function(){if('android'===R.Platform.OS){var t=R.AppState.addEventListener('change',te);return function(){t?t.remove():R.AppState.removeEventListener('change',te),Q.current&&P.default.clearInterval(Q.current)}}return function(){}},[W,F]);var ne={mediaRoom:q};return u.default.createElement(A.Provider,{value:ne},T)}},585,[1,67,41,165,432,480,471,481,586,630,487,579,663,508,665,671,2,578]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1])),n=t(r(d[2])),o=t(r(d[3])),u=t(r(d[4])),c=r(d[5]),l=r(d[6]),p=r(d[7]),h=r(d[8]),f=r(d[9]),y=r(d[10]),v=r(d[11]),k=(function(){function t(s,n,u){!(arguments.length>3&&void 0!==arguments[3])||arguments[3];(0,o.default)(this,t),this.socketObj=n,this.peerid=s,this.dispatch=u,this.device=new c.Device,this.consumers=new Map,this.legacyMode=!0,this.closedConsumers=[],this.handleSockets=this.handleSockets.bind(this)}return(0,u.default)(t,[{key:"handleSockets",value:function(t,s){if(t)switch(t.type){case'websocket/new-consumer':this.createConsumer(t.payload,s);break;case'websocket/consumer-closed':this.closeConsumer(t.payload);break;case'websocket/consumer-paused':this.pauseConsumer(t.payload);break;case'websocket/consumer-resumed':this.resumeConsumer(t.payload);break;case'websocket/recording-started':this.setRecordingStatus(!0);break;case'websocket/recording-stopped':this.setRecordingStatus(!1)}}},{key:"loadRouter",value:function(){var t,n,o;return s.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return(this.recvTransport||this.sendTransport)&&this.stopAllTransports(),this.dispatch((0,f.setRouterFetchState)(f.MediaStates.CONNECTING)),u.next=4,s.default.awrap(null==(t=this.socketObj)?void 0:t.sendMessage({type:'getRouterRtpCapabilities'}));case 4:return n=u.sent,this.device.loaded&&(this.device=new c.Device),(o=null==n?void 0:n.payload)&&(o.headerExtensions=o.headerExtensions.filter(function(t){return'urn:3gpp:video-orientation'!==t.uri})),this.socketObj.emitter.on('socket',this.handleSockets),u.abrupt("return",this.device.load({routerRtpCapabilities:o}));case 10:case"end":return u.stop()}},null,this,null,Promise)}},{key:"getRoomState",value:function(){var t;return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.CONNECTING)),n.next=3,s.default.awrap(null==(t=this.socketObj)?void 0:t.sendMessage({type:'getRoomState'}));case 3:this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.LOADED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"changeRoomDisplayTitle",value:function(t){var n;return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.CONNECTING)),o.next=3,s.default.awrap(null==(n=this.socketObj)?void 0:n.sendMessage({type:'changeDisplayTitle',payload:{displayTitle:t}}));case 3:this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.LOADED));case 4:case"end":return o.stop()}},null,this,null,Promise)}},{key:"joinRoom",value:function(t,n,o){var u;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,s.default.awrap(this.socketObj.sendMessage({type:'joinRoom',payload:{device:(0,p.getDeviceInfo)(),displayName:t,rtpCapabilities:this.device.rtpCapabilities,isLegacy:this.legacyMode,audioMuted:n}}));case 2:if(u=c.sent,this.legacyMode=u.payload.legacyMode||this.legacyMode,!o||''===o){c.next=7;break}return c.next=7,s.default.awrap(this.changeRoomDisplayTitle(o));case 7:return this.dispatch((0,v.roomJoined)(u.payload)),c.abrupt("return",u);case 9:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createRecvTransport",value:function(){var t,o,u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==this.socketObj){c.next=2;break}return c.abrupt("return");case 2:return t={forceTcp:!1,producing:!1,consuming:!0},c.next=5,s.default.awrap(this.socketObj.sendMessage({type:'createWebRtcTransport',payload:t}));case 5:o=c.sent.payload,this.recvTransport=this.device.createRecvTransport((0,n.default)({},o,{iceServers:l.ICE_SERVERS,proprietaryConstraints:l.PC_PROPRIETARY_CONSTRAINTS})),this.recvTransport.on('connect',function(t,s,n){var o,c,l=t.dtlsParameters;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'connectWebRtcTransport',payload:{transportId:null==(c=u.recvTransport)?void 0:c.id,dtlsParameters:l}},function(t){t.payload.error?n():s()})});case 8:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createSendTransport",value:function(){var t,o,u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return t={forceTcp:!1,producing:!0,consuming:!1},c.next=3,s.default.awrap(this.socketObj.sendMessage({type:'createWebRtcTransport',payload:t}));case 3:o=c.sent.payload,this.sendTransport=this.device.createSendTransport((0,n.default)({},o,{iceServers:l.ICE_SERVERS,proprietaryConstraints:l.PC_PROPRIETARY_CONSTRAINTS})),void 0!==this.sendTransport&&(this.sendTransport.on('connect',function(t,s,n){var o,c,l=t.dtlsParameters;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'connectWebRtcTransport',payload:{transportId:null==(c=u.sendTransport)?void 0:c.id,dtlsParameters:l}},function(t){t.payload.error?n():s()})}),this.sendTransport.on('produce',function(t,s,n){var o,c,l=t.kind,p=t.rtpParameters,h=t.appData;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'produce',payload:{transportId:null==(c=u.sendTransport)?void 0:c.id,kind:l,rtpParameters:p,appData:h}},function(t){t.payload.error?n(t.payload.error):s({id:t.payload.id})})}));case 6:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createConsumer",value:function(t,o){var u,c,l,p,h,f,v,k,P,w,b;return s.default.async(function(x){for(;;)switch(x.prev=x.next){case 0:if(void 0!==this.recvTransport&&!this.recvTransport.closed){x.next=2;break}return x.abrupt("return");case 2:return u=t.peerId,c=t.producerId,l=t.id,p=t.kind,h=t.rtpParameters,f=t.type,v=t.appData,k=t.producerPaused,P=t.remotelyPaused,w=t.priority,x.next=5,s.default.awrap(this.recvTransport.consume({id:l,producerId:c,kind:p,rtpParameters:h,appData:(0,n.default)({},v,{peerId:u})}));case 5:b=x.sent,this.closedConsumers.includes(l)?b.close():(this.consumers.set(b.id,b),this.dispatch((0,y.addConsumer)({id:l,peerId:u,type:f,kind:p,remotelyPaused:P,producerPaused:k,priority:w,appData:b.appData,score:10,producerScore:10}))),o&&o('Done');case 8:case"end":return x.stop()}},null,this,null,Promise)}},{key:"closeConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=6;break}return console.log('Consumer not found'),this.closedConsumers.push(n),s.abrupt("return");case 6:o.close(),this.consumers.delete(n);case 8:case"end":return s.stop()}},null,this,null,Promise)}},{key:"pauseConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=4;break}return s.abrupt("return");case 4:o.pause();case 5:case"end":return s.stop()}},null,this,null,Promise)}},{key:"resumeConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=4;break}return s.abrupt("return");case 4:o.resume();case 5:case"end":return s.stop()}},null,this,null,Promise)}},{key:"shareWebcam",value:function(t){var n,o,u,c,p,y=this;return s.default.async(function(v){for(;;)switch(v.prev=v.next){case 0:if(void 0!==t){v.next=2;break}return v.abrupt("return");case 2:if(!this.webCamProducer){v.next=5;break}return v.next=5,s.default.awrap(this.removeProducer('webCamProducer',!1));case 5:return n=l.WEBCAM_SIMULCAST_ENCODINGS_VGA,o=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp9'===t.mimeType.toLowerCase()})||void 0,u=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp8'===t.mimeType.toLowerCase()})||void 0,o&&!this.legacyMode&&(n=l.WEBCAM_KSVC_ENCODINGS),this.dispatch((0,h.setVideoOff)(!1)),this.dispatch((0,h.setVideoProduction)(f.MediaStates.FETCHED)),c={track:t,encodings:n,codecOptions:{videoGoogleStartBitrate:1e3},codec:(function(){return y.legacyMode?u:o})(),appData:{screenShare:!1},stopTracks:!1},p=function(){y.disableWebcam()},v.next=16,s.default.awrap(this.createProducer('webCamProducer',c,p));case 16:this.dispatch((0,h.setVideoProduction)(f.MediaStates.LOADED));case 17:case"end":return v.stop()}},null,this,null,Promise)}},{key:"shareScreen",value:function(t){var n,o,u,c,p,y,v,k,P=this;return s.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:if(n=t.video,o=t.audio,void 0!==n){w.next=3;break}return w.abrupt("return");case 3:return u=l.SCREEN_SHARING_SIMULCAST_ENCODINGS,null===(c=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp9'===t.mimeType.toLowerCase()})||null)||this.legacyMode||(u=l.SCREEN_SHARING_SVC_ENCODINGS),this.dispatch((0,h.setScreenSharing)(!0)),this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.FETCHED)),p={track:n,encodings:u,codecOptions:{videoGoogleStartBitrate:1e3},codec:this.legacyMode?void 0:c,appData:{screenShare:!0},stopTracks:!1},y=function(){P.disableScreenShare()},w.next=12,s.default.awrap(this.createProducer('screenShareVideoProducer',p,y));case 12:if(!o){w.next=17;break}return v={track:o,codecOptions:{opusDtx:!0,opusStereo:!1,opusFec:!0},appData:{screenShare:!0},stopTracks:!1},k=function(){},w.next=17,s.default.awrap(this.createProducer('screenShareAudioProducer',v,k));case 17:this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.LOADED));case 18:case"end":return w.stop()}},null,this,null,Promise)}},{key:"shareMic",value:function(t,n){var o,u,c=this;return s.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:if(void 0!==t){l.next=2;break}return l.abrupt("return");case 2:if(!this.micProducer){l.next=5;break}return l.next=5,s.default.awrap(this.removeProducer('micProducer',!1));case 5:return n&&this.dispatch((0,h.setAudioMuted)(n||!1)),this.dispatch((0,h.setAudioProduction)(f.MediaStates.FETCHED)),o={track:t,codecOptions:{opusDtx:!0,opusStereo:!1,opusFec:!0},stopTracks:!1},u=function(){c.disableMic()},l.next=11,s.default.awrap(this.createProducer('micProducer',o,u));case 11:this.dispatch((0,h.setAudioProduction)(f.MediaStates.LOADED));case 12:case"end":return l.stop()}},null,this,null,Promise)}},{key:"pauseMic",value:function(){this.dispatch((0,h.setAudioMuted)(!0)),this.micProducer.pause()}},{key:"pauseWebcam",value:function(){this.dispatch((0,h.setVideoOff)(!0)),this.webCamProducer.pause()}},{key:"resumeMic",value:function(){this.dispatch((0,h.setAudioMuted)(!1)),this.micProducer.resume()}},{key:"resumeWebcam",value:function(){this.dispatch((0,h.setVideoOff)(!1)),this.webCamProducer.resume()}},{key:"disableWebcam",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return t&&null!=t&&t.silent||this.dispatch((0,h.setVideoOff)(!0)),n.next=3,s.default.awrap(this.removeProducer('webCamProducer'));case 3:this.dispatch((0,h.setVideoProduction)(f.MediaStates.NOT_STARTED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableMic",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return t&&null!=t&&t.silent||this.dispatch((0,h.setAudioMuted)(!0)),n.next=3,s.default.awrap(this.removeProducer('micProducer'));case 3:this.dispatch((0,h.setAudioProduction)(f.MediaStates.NOT_STARTED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableScreenShare",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.NOT_STARTED)),this.dispatch((0,h.setScreenSharing)(!1)),t.next=4,s.default.awrap(this.removeProducer('screenShareVideoProducer'));case 4:return t.next=6,s.default.awrap(this.removeProducer('screenShareAudioProducer'));case 6:case"end":return t.stop()}},null,this,null,Promise)}},{key:"stopAllProducers",value:function(){this.webCamProducer&&this.removeProducer('webCamProducer'),this.screenShareVideoProducer&&this.removeProducer('screenShareVideoProducer'),this.screenShareAudioProducer&&this.removeProducer('screenShareAudioProducer'),this.micProducer&&this.removeProducer('micProducer')}},{key:"stopAllTransports",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.sendTransport){try{this.sendTransport.close()}catch(t){console.log('awaitqueue error')}this.sendTransport=null}if(this.recvTransport){try{this.recvTransport.close()}catch(t){console.log('awaitqueue error')}this.recvTransport=null}this.dispatch((0,f.setRouterFetchState)(f.MediaStates.NOT_STARTED));case 3:case"end":return t.stop()}},null,this,null,Promise)}},{key:"resetVideoProducers",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(!t){o.next=4;break}return o.next=3,s.default.awrap(this.removeProducer('webCamProducer',!1));case 3:this.shareWebcam(t);case 4:if(!n){o.next=8;break}return o.next=7,s.default.awrap(this.removeProducer('screenShareVideoProducer',!1));case 7:this.shareScreen({video:n});case 8:case"end":return o.stop()}},null,this,null,Promise)}},{key:"createProducer",value:function(t,n,o){var u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==this.sendTransport&&!this.sendTransport.closed){c.next=2;break}return c.abrupt("return");case 2:return c.next=4,s.default.awrap(this.sendTransport.produce(n));case 4:this[t]=c.sent,this[t].on('transportclose',function(){u[t]=void 0}),this[t].on('trackended',function(){u.socketObj.sendMessage({type:'closeProducer',payload:{producerId:u[t].id}}),o()});case 7:case"end":return c.stop()}},null,this,null,Promise)}},{key:"removeProducer",value:function(t){var n,o=arguments;return s.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:if(n=!(o.length>1&&void 0!==o[1])||o[1],this[t]&&!this[t].closed){u.next=3;break}return u.abrupt("return");case 3:return n&&this[t].track.stop(),this[t].close(),u.next=7,s.default.awrap(this.socketObj.sendMessage({type:'closeProducer',payload:{producerId:this[t].id}}));case 7:this[t]=null;case 8:case"end":return u.stop()}},null,this,null,Promise)}},{key:"sendMessage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'chatMessage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"getMesssages",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getChatMessages'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"getPolls",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getPolls'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"newPoll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'newPoll',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"votePoll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'votePoll',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"acceptWaitingRequest",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'acceptWaitingRequest',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"rejectWaitingRequest",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'rejectWaitingRequest',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"muteAll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteAllNew',payload:{allowUnMute:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"rejectRequestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'rejectRequestToJoinStage',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"muteAllVideo",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteAllVideo'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"pin",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'pinPeer',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableAudio",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'disableAudioPeerNew',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableVideo",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'disableVideoPeer',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"kickAll",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'kickAll'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"kick",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'kick',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"getPage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getPage',payload:{pageNum:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"setRecordingStatus",value:function(t){return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:window.triggerDyteRecording=t;case 1:case"end":return s.stop()}},null,null,null,Promise)}},{key:"muteSelf",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteSelf'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"unmuteSelf",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'unmuteSelf'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"requestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'requestToJoinStage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"acceptAllRequestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'acceptAllRequestToJoinStage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removePeerFromStage",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,s.default.awrap(this.socketObj.sendMessage({type:'removePeerFromStage',payload:{id:t,type:n}}));case 2:case"end":return o.stop()}},null,this,null,Promise)}},{key:"startPresenting",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'startPresenting'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"stopPresenting",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'stopPresenting'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"updatePreset",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,s.default.awrap(this.socketObj.sendMessage({type:'updatePeerPreset',payload:{id:t,presetName:n}}));case 2:case"end":return o.stop()}},null,this,null,Promise)}}]),t})();e.default=k},586,[1,67,22,9,10,587,582,493,487,480,505,481]); @@ -676,7 +676,7 @@ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.d __d(function(g,r,i,a,m,_e,d){var t='__lodash_hash_undefined__',e=9007199254740991,n='[object Arguments]',o='[object Boolean]',c='[object Date]',u='[object Function]',f='[object GeneratorFunction]',s='[object Map]',l='[object Number]',_='[object Object]',p='[object RegExp]',h='[object Set]',y='[object String]',v='[object Symbol]',b='[object ArrayBuffer]',j='[object DataView]',w='[object Float32Array]',O='[object Float64Array]',A='[object Int8Array]',x='[object Int16Array]',S='[object Int32Array]',P='[object Uint8Array]',$='[object Uint8ClampedArray]',k='[object Uint16Array]',E='[object Uint32Array]',I=/\w*$/,F=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,B={};B[n]=B['[object Array]']=B[b]=B[j]=B[o]=B[c]=B[w]=B[O]=B[A]=B[x]=B[S]=B[s]=B[l]=B[_]=B[p]=B[h]=B[y]=B[v]=B[P]=B[$]=B[k]=B[E]=!0,B['[object Error]']=B[u]=B["[object WeakMap]"]=!1;var U='object'==typeof g&&g&&g.Object===Object&&g,W='object'==typeof self&&self&&self.Object===Object&&self,D=U||W||Function('return this')(),R='object'==typeof _e&&_e&&!_e.nodeType&&_e,T=R&&'object'==typeof m&&m&&!m.nodeType&&m,z=T&&T.exports===R;function C(t,e){return t.set(e[0],e[1]),t}function L(t,e){return t.add(e),t}function V(t,e){for(var n=-1,o=t?t.length:0;++n-1},Ft.prototype.set=function(t,e){var n=this.__data__,o=Dt(n,t);return o<0?n.push([t,e]):n[o][1]=e,this},Mt.prototype.clear=function(){this.__data__={hash:new It,map:new(jt||Ft),string:new It}},Mt.prototype.delete=function(t){return Zt(this,t).delete(t)},Mt.prototype.get=function(t){return Zt(this,t).get(t)},Mt.prototype.has=function(t){return Zt(this,t).has(t)},Mt.prototype.set=function(t,e){return Zt(this,t).set(t,e),this},Bt.prototype.clear=function(){this.__data__=new Ft},Bt.prototype.delete=function(t){return this.__data__.delete(t)},Bt.prototype.get=function(t){return this.__data__.get(t)},Bt.prototype.has=function(t){return this.__data__.has(t)},Bt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ft){var o=n.__data__;if(!jt||o.length<199)return o.push([t,e]),this;n=this.__data__=new Mt(o)}return n.set(t,e),this};var rr=yt?Q(yt,Object):function(){return[]},er=function(t){return ut.call(t)};function nr(t){var e=t.length,n=t.constructor(e);return e&&'string'==typeof t[0]&&ct.call(t,'index')&&(n.index=t.index,n.input=t.input),n}function or(t){return'function'!=typeof t.constructor||ar(t)?{}:br(e=lt(t))?_t(e):{};var e}function cr(t,e,n,u){var f,_,F,M=t.constructor;switch(e){case b:return Gt(t);case o:case c:return new M(+t);case j:return Nt(t,u);case w:case O:case A:case x:case S:case P:case $:case k:case E:return Jt(t,u);case s:return qt(t,u,n);case l:case y:return new M(t);case p:return(F=new(_=t).constructor(_.source,I.exec(_))).lastIndex=_.lastIndex,F;case h:return Ht(t,u,n);case v:return f=t,Et?Object(Et.call(f)):{}}}function ur(t,n){return!!(n=null==n?e:n)&&('number'==typeof t||M.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=e}function br(t){var e=typeof t;return!!t&&('object'==e||'function'==e)}function dr(t){return!!t&&'object'==typeof t}function jr(t){return _r(t)?Ut(t):Lt(t)}m.exports=function(t){return Tt(t,!0,!0)}},670,[]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),c=r(d[3]),l=c.NativeModules.DyteRNBackgroundTimer,o=new c.NativeEventEmitter(l),s=new((function(){function t(){var u=this;(0,n.default)(this,t),this.uniqueId=0,this.callbacks={},o.addListener('backgroundTimer.timeout',function(t){if(u.callbacks[t]){var n=u.callbacks[t].callback;u.callbacks[t].interval?l.backgroundTimerSetTimeout(t,u.callbacks[t].timeout):delete u.callbacks[t],n()}})}return(0,u.default)(t,[{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return l.start(t)}},{key:"stop",value:function(){return l.stop()}},{key:"runBackgroundTimer",value:function(t,n){var u=this,l=c.Platform.select({ios:function(){return c.NativeAppEventEmitter},android:function(){return c.DeviceEventEmitter}})();this.start(0),this.backgroundListener=l.addListener('backgroundTimer',function(){u.backgroundListener.remove(),u.backgroundClockMethod(t,n)})}},{key:"backgroundClockMethod",value:function(t,n){var u=this;this.backgroundTimer=this.setTimeout(function(){t(),u.backgroundClockMethod(t,n)},n)}},{key:"stopBackgroundTimer",value:function(){this.stop(),this.clearTimeout(this.backgroundTimer)}},{key:"setTimeout",value:function(t,n){this.uniqueId+=1;var u=this.uniqueId;return this.callbacks[u]={callback:t,interval:!1,timeout:n},l.setTimeout(u,n),u}},{key:"clearTimeout",value:function(t){this.callbacks[t]&&delete this.callbacks[t]}},{key:"setInterval",value:function(t,n){this.uniqueId+=1;var u=this.uniqueId;return this.callbacks[u]={callback:t,interval:!0,timeout:n},l.backgroundTimerSetTimeout(u,n),u}},{key:"clearInterval",value:function(t){this.callbacks[t]&&delete this.callbacks[t]}}]),t})());e.default=s},671,[1,9,10,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.PluginServiceProvider=e.PluginServiceContext=void 0;var n=t(r(d[1])),o=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=v(n);if(o&&o.has(t))return o.get(t);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var l=c?Object.getOwnPropertyDescriptor(t,f):null;l&&(l.get||l.set)?Object.defineProperty(u,f,l):u[f]=t[f]}u.default=t,o&&o.set(t,u);return u})(r(d[2])),u=r(d[3]),c=r(d[4]),f=t(r(d[5])),l=r(d[6]);function v(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(v=function(t){return t?o:n})(t)}var p=(0,o.createContext)(null);e.PluginServiceContext=p;e.PluginServiceProvider=function(t){var v=t.children,s=t.roomName,P=t.peerId,S=(0,o.useContext)(l.WebSocketContext),y=(0,u.useDispatch)(),O=(0,o.useState)(null),b=(0,n.default)(O,2),k=b[0],j=b[1],C=(0,u.useSelector)(function(t){return t.participant.authToken});(0,o.useEffect)(function(){},[]);var w=(0,u.useSelector)(function(t){return t.room.socketState}),E={pluginManager:k};return(0,o.useEffect)(function(){if(w===c.RoomSocketState.CONNECTED){var t=new f.default(S,s,y,P,C);j(t),t.listenSocketEvents()}},[w]),o.default.createElement(p.Provider,{value:E},v)}},672,[1,41,165,432,480,673,630]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),u=t(r(d[3])),l=t(r(d[4])),o=r(d[5]),c=t(r(d[6])),f=(function(){function t(n,s,l,o,c){(0,u.default)(this,t),this.socketObj=n,this.dispatch=l,this.roomName=s,this.plugins={},this.iframes={},this.peerId=o,this.authToken=c,this.handleSockets=this.handleSockets.bind(this)}return(0,l.default)(t,[{key:"handleSockets",value:function(t){if(t)switch(t.type){case'websocket/enable-plugin':this.enablePlugin(t.payload);break;case'websocket/disable-plugin':this.disablePlugin(t.payload);break;case'websocket/plugin-event':case'websocket/plugin-data':this.sendIframeEvent(t)}}},{key:"sendIframeEvent",value:function(t){var n=this.iframes[t.payload.pluginId||t.payload.id];n&&Object.values(n).forEach(function(n){n.iframe&&n.iframe.injectJavaScript("window.postMessage("+JSON.stringify(t)+");")})}},{key:"listenSocketEvents",value:function(){this.socketObj.emitter.on('socket',this.handleSockets),this.getRoomPlugins()}},{key:"getRoomPlugins",value:function(){var t=this;this.socketObj.sendMessage({type:'getRoomState'},function(n){n.payload.roomState.plugins.forEach(function(n){return t.enablePlugin(n)})})}},{key:"enablePlugin",value:function(t){var u,l,f,h,p,v;return n.default.async(function(k){for(;;)switch(k.prev=k.next){case 0:if(u=c.default.apiBase+"/v2/plugins",!this.plugins[t.id]){k.next=3;break}return k.abrupt("return");case 3:return k.next=5,n.default.awrap(fetch(c.default.apiBase+"/v2/plugins/view/"+t.id,{method:'GET',headers:{authorization:"Bearer "+this.authToken}}));case 5:return l=k.sent,k.next=8,n.default.awrap(l.json());case 8:return f=k.sent,k.next=11,n.default.awrap(fetch(u+"/authorize/"+t.id,{method:'POST',headers:{authorization:"Bearer "+this.authToken,'Content-Type':'application/json'},body:JSON.stringify({roomName:this.roomName,peerId:this.peerId})}));case 11:return h=k.sent,k.next=14,n.default.awrap(h.json());case 14:p=k.sent.data.token,v=(0,s.default)({},f.data.plugin,{authToken:p,enabledBy:t.enabledBy,ACLAccessGrantedUsers:t.ACLAccessGrantedUsers||[],ACLAccessRemovedUsers:t.ACLAccessRemovedUsers||[]}),this.plugins[t.id]=v,this.iframes[t.id]={},this.dispatch((0,o.addPlugin)(v));case 19:case"end":return k.stop()}},null,this,null,Promise)}},{key:"disablePlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.plugins[t.id]&&(delete this.plugins[t.id],this.dispatch((0,o.removePlugin)(t)));case 1:case"end":return n.stop()}},null,this,null,Promise)}},{key:"handleIframeMessage",value:function(t){var s=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=t.type,n.next='pluginEvent'===n.t0?3:'storePluginData'===n.t0?3:'getPluginData'===n.t0?3:'getPeerInfo'===n.t0?3:'enablePluginForAll'===n.t0?3:5;break;case 3:return this.socketObj.sendMessage(t,function(t){s.sendIframeEvent(t)}),n.abrupt("break",6);case 5:return n.abrupt("break",6);case 6:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addIframeView",value:function(t,s,u){var l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&this.removeIframeView(t),l=function(t){s&&o.handleIframeMessage(t)},u.addEventListener(l),this.iframes[t.plugin][t.view]={listener:l,iframe:s};case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removeIframeView",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&delete this.iframes[t.plugin][t.view];case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addRoomPlugin",value:function(t){return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.plugins[t.id]){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,n.default.awrap(this.socketObj.sendMessage({type:'addPlugin',payload:t}));case 4:case"end":return s.stop()}},null,this,null,Promise)}},{key:"removeRoomPlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.socketObj.sendMessage({type:'removePlugin',payload:t}));case 1:case"end":return n.stop()}},null,this,null,Promise)}}]),t})();e.default=f},673,[1,67,22,9,10,503,504]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),u=t(r(d[3])),l=t(r(d[4])),o=r(d[5]),c=t(r(d[6])),f=(function(){function t(n,s,l,o,c){(0,u.default)(this,t),this.socketObj=n,this.dispatch=l,this.roomName=s,this.plugins={},this.iframes={},this.peerId=o,this.authToken=c,this.handleSockets=this.handleSockets.bind(this)}return(0,l.default)(t,[{key:"handleSockets",value:function(t){if(t)switch(t.type){case'websocket/enable-plugin':this.enablePlugin(t.payload);break;case'websocket/disable-plugin':this.disablePlugin(t.payload);break;case'websocket/plugin-event':case'websocket/plugin-data':this.sendIframeEvent(t)}}},{key:"sendIframeEvent",value:function(t){var n=this.iframes[t.payload.pluginId||t.payload.id];n&&Object.values(n).forEach(function(n){n.iframe&&n.iframe.injectJavaScript("window.postMessage("+JSON.stringify(t)+");")})}},{key:"listenSocketEvents",value:function(){this.socketObj.emitter.on('socket',this.handleSockets),this.getRoomPlugins()}},{key:"getRoomPlugins",value:function(){var t=this;this.socketObj.sendMessage({type:'getRoomState'},function(n){n.payload.roomState.plugins.forEach(function(n){return t.enablePlugin(n)})})}},{key:"enablePlugin",value:function(t){var u,l,f,h,p,v;return n.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:if(u=c.default.apiBase+"/v2/plugins",!this.plugins[t.id]){y.next=3;break}return y.abrupt("return");case 3:return y.next=5,n.default.awrap(fetch(c.default.apiBase+"/v2/plugins/view/"+t.id,{method:'GET',headers:{authorization:"Bearer "+this.authToken}}));case 5:return l=y.sent,y.next=8,n.default.awrap(l.json());case 8:return f=y.sent,y.next=11,n.default.awrap(fetch(u+"/authorize/"+t.id,{method:'POST',headers:{authorization:"Bearer "+this.authToken,'Content-Type':'application/json'},body:JSON.stringify({roomName:this.roomName,peerId:this.peerId})}));case 11:return h=y.sent,y.next=14,n.default.awrap(h.json());case 14:p=y.sent.data.token,v=(0,s.default)({},f.data.plugin,{authToken:p,enabledBy:t.enabledBy,ACLAccessGrantedUsers:t.ACLAccessGrantedUsers||[],ACLAccessRemovedUsers:t.ACLAccessRemovedUsers||[]}),this.plugins[t.id]=v,this.iframes[t.id]={},this.dispatch((0,o.addPlugin)(v));case 19:case"end":return y.stop()}},null,this,null,Promise)}},{key:"disablePlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.plugins[t.id]&&(delete this.plugins[t.id],this.dispatch((0,o.removePlugin)(t)));case 1:case"end":return n.stop()}},null,this,null,Promise)}},{key:"handleIframeMessage",value:function(t){var u,l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=t.type,n.next='pluginEvent'===n.t0?3:'storePluginData'===n.t0?3:'getPluginData'===n.t0?3:'enablePluginForAll'===n.t0?3:'getPeerInfo'===n.t0?5:7;break;case 3:return this.socketObj.sendMessage(t,function(t){o.sendIframeEvent(t)}),n.abrupt("break",8);case 5:return this.socketObj.sendMessage({type:t.type,payload:(0,s.default)({},t.payload,{peerId:null!=(u=null==(l=t.payload)?void 0:l.peerId)?u:this.peerId})},function(t){o.sendIframeEvent(t)}),n.abrupt("break",8);case 7:return n.abrupt("break",8);case 8:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addIframeView",value:function(t,s,u){var l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&this.removeIframeView(t),l=function(t){s&&o.handleIframeMessage(t)},u.addEventListener(l),this.iframes[t.plugin][t.view]={listener:l,iframe:s};case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removeIframeView",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&delete this.iframes[t.plugin][t.view];case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addRoomPlugin",value:function(t){return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.plugins[t.id]){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,n.default.awrap(this.socketObj.sendMessage({type:'addPlugin',payload:t}));case 4:case"end":return s.stop()}},null,this,null,Promise)}},{key:"removeRoomPlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.socketObj.sendMessage({type:'removePlugin',payload:t}));case 1:case"end":return n.stop()}},null,this,null,Promise)}}]),t})();e.default=f},673,[1,67,22,9,10,503,504]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.PeersServiceContext=e.PeersProvider=void 0;var t=n(r(d[1])),o=n(r(d[2])),u=n(r(d[3])),c=(function(n,t){if(!t&&n&&n.__esModule)return n;if(null===n||"object"!=typeof n&&"function"!=typeof n)return{default:n};var o=b(t);if(o&&o.has(n))return o.get(n);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in n)if("default"!==l&&Object.prototype.hasOwnProperty.call(n,l)){var s=c?Object.getOwnPropertyDescriptor(n,l):null;s&&(s.get||s.set)?Object.defineProperty(u,l,s):u[l]=n[l]}u.default=n,o&&o.set(n,u);return u})(r(d[4])),l=r(d[5]),s=r(d[6]),f=r(d[7]),p=r(d[8]),v=r(d[9]),S=r(d[10]),P=r(d[11]),h=r(d[12]),k=r(d[13]);function b(n){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(b=function(n){return n?o:t})(n)}var y=(0,c.createContext)(null);e.PeersServiceContext=y;e.PeersProvider=function(n){var b,T,M=n.children,w=(0,c.useContext)(p.ConfigServiceContext).meeting,C=(0,c.useState)([]),V=(0,u.default)(C,2),x=V[0],D=V[1],O=(0,l.useSelector)(function(n){return n.peers.joinedPeers}),A=(0,l.useSelector)(function(n){return n.participant}),j=(0,l.useSelector)(function(n){return n.consumers.activeConsumers}),I=j.find(function(n){return'video'===n.kind&&n.appData.screenShare}),_=j.find(function(n){return'audio'===n.kind&&n.appData.screenShare}),E=(0,l.useSelector)(function(n){return n.room.pinnedPeerId}),H=(0,l.useSelector)(function(n){return n.room.roomViewType}),N=(0,c.useState)(null),q=(0,u.default)(N,2),J=q[0],L=q[1],R=(0,c.useState)(null),U=(0,u.default)(R,2),W=U[0],z=U[1],B=(0,c.useContext)(f.MediaRoomContext).mediaRoom,F=(0,l.useDispatch)(),G=(0,c.useContext)(v.UserTrackContext),K=G.mediaTracks,Q=K.screenShareVideoTrack,X=K.setScreenShareVideoTrack,Y=(K.screenShareAudioTrack,K.setScreenShareAudioTrack),Z=G.inputDevices,$=Z.toggleAudioState,ee=Z.toggleVideoState,re={pin:function(n){return B.pin(n)},unpin:function(n){return B.pin(null)},toggleSelfAudio:function(){return $()},toggleSelfVideo:function(){return ee()},toggleSelfScreenSharing:function(){var n;return t.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(A.sharingScreen||I){o.next=16;break}return void 0!==Q&&Q.stop(),o.prev=2,o.next=5,t.default.awrap((0,S.getScreenShare)());case 5:n=o.sent,X(n.video),Y(n.video),B.shareScreen(n),o.next=14;break;case 11:o.prev=11,o.t0=o.catch(2),'NotAllowedError'!==(null==o.t0?void 0:o.t0.message)&&console.error(o.t0);case 14:o.next=19;break;case 16:B.disableScreenShare(),X(void 0),Y(void 0);case 19:case"end":return o.stop()}},null,null,[[2,11]],Promise)},disablePeerAudio:function(n){return B.disableAudio(n)},disablePeerVideo:function(n){return B.disableVideo(n)},updatePreset:function(n,t){return B.updatePreset(n,t)},setLabel:function(n,t){F((0,s.setPeerLabel)({id:n,label:t}))}},ne=!0;(0,c.useEffect)(function(){var n,t;L({id:null==B?void 0:B.peerid,audioMuted:A.audioMuted,displayName:A.displayName,userId:A.id,picture:A.displayImageURL,isMe:!0,isHost:A.isHost,videoVisible:!A.videoOff,videoTrack:null==B?void 0:null==(n=B.webCamProducer)?void 0:n.track,audioTrack:null==B?void 0:null==(t=B.micProducer)?void 0:t.track,isPinned:E===(null==B?void 0:B.peerid),clientSpecificId:A.clientSpecificId,producingAudio:!A.audioMuted,producingVideo:!A.videoOff,isScreensharing:A.sharingScreen,requestToJoinType:A.requestToJoinType,hiddenParticipant:A.hidden,webinarHiddenParticipant:A.webinarHiddenParticipant,metadata:A.metadata})},[null==B?void 0:B.peerid,A.sharingScreen,A.videoOff,A.audioMuted,A.displayName,A.hidden,A.requestToJoinType,A.metadata,null==B?void 0:null==(b=B.webCamProducer)?void 0:b.track,null==B?void 0:null==(T=B.micProducer)?void 0:T.track,A.webinarHiddenParticipant,E]),(0,c.useEffect)(function(){J&&w&&w._addUpdateParticipant((0,o.default)({},J,{isPinned:J.id===E,isScreensharing:A.sharingScreen}),re)},[J,w]),(0,c.useEffect)(function(){if(I||A.screenSharingProduction===P.MediaStates.LOADED){var n,t,o,u=I?null==(n=B.consumers.get(I.id))?void 0:n.track:null==(t=B.screenShareVideoProducer)?void 0:t.track,c=_?null==(o=B.consumers.get(_.id))?void 0:o.track:null,l=I?O.find(function(n){return n.id===I.appData.peerId}):J;z({videoTrack:u,id:null==l?void 0:l.id,displayName:"Screen - "+(null==l?void 0:l.displayName),videoVisible:!0,audioTrack:c,audioMuted:null===c,screenshare:!0})}else z(null)},[I,A.screenSharingProduction]),(0,c.useEffect)(function(){w&&(x.map(function(n){return O.find(function(t){return t.id===n.id})||w._removeParticipant(n),null}),D(O))},[O]);var ie=function(n){var t,u=(0,o.default)({},n,{isPinned:E===n.id,isScreensharing:!1}),c=j.find(function(t){return t.peerId===n.id&&'video'===t.kind&&!t.appData.screenShare}),l=j.find(function(t){return t.peerId===n.id&&'audio'===t.kind&&!t.appData.screenShare});return c&&(u.producingVideo=!0,u.videoTrack=B.consumers.get(c.id).track,u.videoScore=c.producerScore),l&&(u.producingAudio=!n.audioMuted,u.audioTrack=B.consumers.get(l.id).track,u.audioScore=l.producerScore),(null==I?void 0:null==(t=I.appData)?void 0:t.peerId)===n.id&&(u.isScreensharing=!0),u.videoVisible=!(void 0===c||c.remotelyPaused),u.audioMuted=void 0===l||l.remotelyPaused||n.audioMuted,u.audioMuted||(ne=!1),w&&w._addUpdateParticipant((0,o.default)({},u,{isPinned:u.id===E}),re),u},te=H===h.DyteViewTypes.webinar?O.filter(function(n){return!(null!=n&&n.webinarHiddenParticipant)&&n.requestToJoinType!==k.RequestToJoinType.ask}).map(ie).filter(function(n){return null!==n}):O.filter(function(n){return!(null!=n&&n.hiddenParticipant)}).map(ie).filter(function(n){return null!==n}),oe=O.map(ie).filter(function(n){return null!==n});return c.default.createElement(y.Provider,{value:{processedPeers:te,selfPeer:J,allMuted:ne,screenshareVideoConsumer:I,screenshareAudioConsumer:_,screenSharePeer:W,joinedProcessedPeers:oe}},M)}},674,[1,67,22,41,165,432,481,585,508,579,580,480,482,487]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.setupPermissions=e.RESULTS=e.PERMISSIONS=void 0,e.uniq=N;var E=n(r(d[1])),s=n(r(d[2])),o=r(d[3]),A=r(d[4]),O=r(d[5]),R=Object.freeze({ACCEPT_HANDOVER:'android.permission.ACCEPT_HANDOVER',ACCESS_BACKGROUND_LOCATION:'android.permission.ACCESS_BACKGROUND_LOCATION',ACCESS_COARSE_LOCATION:'android.permission.ACCESS_COARSE_LOCATION',ACCESS_FINE_LOCATION:'android.permission.ACCESS_FINE_LOCATION',ACTIVITY_RECOGNITION:'android.permission.ACTIVITY_RECOGNITION',ADD_VOICEMAIL:'com.android.voicemail.permission.ADD_VOICEMAIL',ANSWER_PHONE_CALLS:'android.permission.ANSWER_PHONE_CALLS',BODY_SENSORS:'android.permission.BODY_SENSORS',CALL_PHONE:'android.permission.CALL_PHONE',CAMERA:'android.permission.CAMERA',GET_ACCOUNTS:'android.permission.GET_ACCOUNTS',PROCESS_OUTGOING_CALLS:'android.permission.PROCESS_OUTGOING_CALLS',READ_CALENDAR:'android.permission.READ_CALENDAR',READ_CALL_LOG:'android.permission.READ_CALL_LOG',READ_CONTACTS:'android.permission.READ_CONTACTS',READ_EXTERNAL_STORAGE:'android.permission.READ_EXTERNAL_STORAGE',READ_PHONE_NUMBERS:'android.permission.READ_PHONE_NUMBERS',READ_PHONE_STATE:'android.permission.READ_PHONE_STATE',READ_SMS:'android.permission.READ_SMS',RECEIVE_MMS:'android.permission.RECEIVE_MMS',RECEIVE_SMS:'android.permission.RECEIVE_SMS',RECEIVE_WAP_PUSH:'android.permission.RECEIVE_WAP_PUSH',RECORD_AUDIO:'android.permission.RECORD_AUDIO',SEND_SMS:'android.permission.SEND_SMS',USE_SIP:'android.permission.USE_SIP',WRITE_CALENDAR:'android.permission.WRITE_CALENDAR',WRITE_CALL_LOG:'android.permission.WRITE_CALL_LOG',WRITE_CONTACTS:'android.permission.WRITE_CONTACTS',WRITE_EXTERNAL_STORAGE:'android.permission.WRITE_EXTERNAL_STORAGE',BLUETOOTH_CONNECT:"android.permission.BLUETOOTH_CONNECT"}),_=Object.freeze({APP_TRACKING_TRANSPARENCY:'ios.permission.APP_TRACKING_TRANSPARENCY',BLUETOOTH_PERIPHERAL:'ios.permission.BLUETOOTH_PERIPHERAL',CALENDARS:'ios.permission.CALENDARS',CAMERA:'ios.permission.CAMERA',CONTACTS:'ios.permission.CONTACTS',FACE_ID:'ios.permission.FACE_ID',LOCATION_ALWAYS:'ios.permission.LOCATION_ALWAYS',LOCATION_WHEN_IN_USE:'ios.permission.LOCATION_WHEN_IN_USE',MEDIA_LIBRARY:'ios.permission.MEDIA_LIBRARY',MICROPHONE:'ios.permission.MICROPHONE',MOTION:'ios.permission.MOTION',PHOTO_LIBRARY:'ios.permission.PHOTO_LIBRARY',PHOTO_LIBRARY_ADD_ONLY:'ios.permission.PHOTO_LIBRARY_ADD_ONLY',REMINDERS:'ios.permission.REMINDERS',SIRI:'ios.permission.SIRI',SPEECH_RECOGNITION:'ios.permission.SPEECH_RECOGNITION',STOREKIT:'ios.permission.STOREKIT'}),I=Object.freeze({ANDROID:R,IOS:_});e.PERMISSIONS=I;var t=Object.freeze({UNAVAILABLE:'unavailable',BLOCKED:'blocked',DENIED:'denied',GRANTED:'granted',LIMITED:'limited',PROMPTED:'prompted'});e.RESULTS=t;var S=O.NativeModules.DyteRNPermissions;function C(n){return s.default.async(function(E){for(;;)switch(E.prev=E.next){case 0:return E.abrupt("return",S.available.includes(n)?S.request(n):t.UNAVAILABLE);case 1:case"end":return E.stop()}},null,null,null,Promise)}function N(n){return n.filter(function(E,s){return null!=E&&n.indexOf(E)===s})}var T,p=['bluetooth','readExternalStorage','photos','externalStorage'],L=function(n){var E=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s={camera:I.ANDROID.CAMERA,microphone:I.ANDROID.RECORD_AUDIO,bluetooth:I.ANDROID.BLUETOOTH_CONNECT,externalStorage:I.ANDROID.WRITE_EXTERNAL_STORAGE,readExternalStorage:I.ANDROID.READ_EXTERNAL_STORAGE},o={camera:I.IOS.CAMERA,microphone:I.IOS.MICROPHONE,bluetooth:I.IOS.BLUETOOTH_PERIPHERAL,photos:I.IOS.PHOTO_LIBRARY};if(!E)return'android'===O.Platform.OS?s[n]:o[n];if('android'===O.Platform.OS){var A={};return Object.keys(s).forEach(function(n){A[s[n]]=n}),A[n]}var R={};return Object.keys(o).forEach(function(n){R[o[n]]=n}),R[n]},D=function(n){return function(E){var s={camera:o.permissionEnum.INIT,microphone:o.permissionEnum.INIT};n.forEach(function(n){var A=L(n,!0);E[n]===t.GRANTED?s[A]=o.permissionEnum.ACCEPTED:E[n]!==t.PROMPTED&&(s[A]=o.permissionEnum.DENIED)}),s.camera!==o.permissionEnum.INIT&&s.microphone!==o.permissionEnum.INIT&&T&&clearInterval(T),A.store.dispatch((0,o.setParticipantPermissions)(s))}};e.setupPermissions=function(n){var o,A,R,_,I,t,u=[];[].concat(p,(0,E.default)(n)).forEach(function(n){var E=L(n);E&&u.push(E)}),"android"===O.Platform.OS&&(T&&clearInterval(T),T=setInterval(function(){S.checkMultiplePermissions(u).then(D(u))},1e3));(o=u,s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:if('ios'!==O.Platform.OS){n.next=13;break}A={},R=N(o),_=0;case 4:if(!(_2||Math.abs(e.dy)>2)},[y]),W=n.default.useCallback(function(){var e={x:0,y:0},t=x?x():e;u.Animated.spring(X.current,{toValue:t||e,useNativeDriver:!1}).start()},[X]),q=n.default.useCallback(function(e,t){_.current=!1,k&&(k(e,t,G()),D(e,!0)),p?W():X.current.flattenOffset()},[k,p,D,W,G]),B=n.default.useCallback(function(e,t){F.current=G(),_.current=!0,p||(X.current.setOffset(Y.current),X.current.setValue({x:0,y:0}))},[G,p]),J=n.default.useCallback(function(e,t){var n=t.dx,u=t.dy,o=F.current,s=o.top,f=o.right,c=o.left,b=o.bottom,h=l(n,Number.isFinite(A)?A-c:-999999999,Number.isFinite(N)?N-f:999999999),v=l(u,Number.isFinite(I)?I-s:-999999999,Number.isFinite(T)?T-b:999999999);X.current.setValue({x:h,y:v}),w(e,t)},[N,T,A,I,w]),K=n.default.useMemo(function(){return u.PanResponder.create({onMoveShouldSetPanResponder:function(e,t){return H(t)},onMoveShouldSetPanResponderCapture:function(e,t){return H(t)},onPanResponderGrant:B,onPanResponderMove:u.Animated.event([],{listener:J,useNativeDriver:!1}),onPanResponderRelease:q})},[J,B,q,H]);n.default.useEffect(function(){var e=X.current;return p?W():e.addListener(function(e){return Y.current=e}),function(){e.removeAllListeners()}},[p]);var Q=n.default.useMemo(function(){var e=u.Dimensions.get('window');return{position:'absolute',top:0,left:0,width:e.width,height:e.height}},[]),U=n.default.useMemo(function(){var e={top:L,left:O,elevation:z,zIndex:z};return h&&(e.backgroundColor=h),s&&(e.borderRadius=c),v?(0,t.default)({},e,{alignSelf:'baseline'}):(0,t.default)({},e,{justifyContent:'center',width:c,height:c})},[v,s,h,c,O,L,z]),Z=n.default.useMemo(function(){return v||(b?n.default.createElement(u.Image,{style:{width:c,height:c},source:b}):n.default.createElement(u.Text,{style:f.text},o))},[v,b,c,o]),$=n.default.useCallback(function(e){var t=e.nativeEvent.layout,n=t.height,u=t.width;j.current={x:u,y:n}},[]),ee=n.default.useCallback(function(e){V(e),_.current||D(e,!1)},[V,D]),te=n.default.useCallback(function(){var e=u.Dimensions.get('window'),o=e.width,l=e.height;if(!(A||N||I||T))return null;var s=A||-9999,c=N?o-N:-9999,b=I||-9999,h=T?l-T:-9999;return n.default.createElement(u.View,{pointerEvents:"box-none",style:(0,t.default)({left:s,right:c,top:b,bottom:h},f.debugView)})},[N,T,A,I]);return n.default.createElement(u.View,{pointerEvents:"box-none",style:Q},P&&te(),n.default.createElement(u.Animated.View,(0,t.default)({pointerEvents:"box-none"},R,K.panHandlers,{style:X.current.getLayout()}),n.default.createElement(u.TouchableOpacity,(0,t.default)({},C,{onLayout:$,style:U,disabled:y,onPress:S,onLongPress:M,onPressIn:E,onPressOut:ee}),Z)))}s.defaultProps={renderText:'\uff0b',renderSize:36,shouldReverse:!1,disabled:!1,debug:!1,onDrag:function(){},onShortPressRelease:function(){},onDragRelease:function(){},onLongPress:function(){},onPressIn:function(){},onPressOut:function(){},onRelease:function(){},x:0,y:0,z:1},s.propTypes={renderText:o.default.string,isCircle:o.default.bool,renderSize:o.default.number,imageSource:o.default.number,renderColor:o.default.string,children:o.default.element,shouldReverse:o.default.bool,disabled:o.default.bool,debug:o.default.bool,animatedViewProps:o.default.object,touchableOpacityProps:o.default.object,onDrag:o.default.func,onShortPressRelease:o.default.func,onDragRelease:o.default.func,onLongPress:o.default.func,onPressIn:o.default.func,onPressOut:o.default.func,onRelease:o.default.func,onReverse:o.default.func,x:o.default.number,y:o.default.number,z:o.default.number,minX:o.default.number,minY:o.default.number,maxX:o.default.number,maxY:o.default.number};var f=u.StyleSheet.create({text:{color:'#fff',textAlign:'center'},test:{backgroundColor:'red'},debugView:{backgroundColor:'#ff000044',position:'absolute',borderColor:'#fced0ecc',borderWidth:4}})},706,[1,22,165,2,204]); __d(function(g,r,i,a,m,_e,d){"use strict";var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.swipeDirections=_e.default=void 0;var t=e(r(d[1])),n=e(r(d[2])),o=e(r(d[3])),s=e(r(d[4])),l=e(r(d[5])),u=e(r(d[6])),c=e(r(d[7])),f=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var u=s?Object.getOwnPropertyDescriptor(e,l):null;u&&(u.get||u.set)?Object.defineProperty(o,l,u):o[l]=e[l]}o.default=e,n&&n.set(e,o);return o})(r(d[8])),p=r(d[9]);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var S={SWIPE_UP:"SWIPE_UP",SWIPE_DOWN:"SWIPE_DOWN",SWIPE_LEFT:"SWIPE_LEFT",SWIPE_RIGHT:"SWIPE_RIGHT"};_e.swipeDirections=S;var _={velocityThreshold:.3,directionalOffsetThreshold:80,gestureIsClickThreshold:5};function P(e,t,n,o){return Math.abs(e)>t&&Math.abs(n)0?n:t:this._isValidVerticalSwipe(e)?u>0?s:o:null}},{key:"_isValidHorizontalSwipe",value:function(e){var t=e.vx,n=e.dy,o=this.swipeConfig;return P(t,o.velocityThreshold,n,o.directionalOffsetThreshold)}},{key:"_isValidVerticalSwipe",value:function(e){var t=e.vy,n=e.dx,o=this.swipeConfig;return P(t,o.velocityThreshold,n,o.directionalOffsetThreshold)}},{key:"render",value:function(){return f.default.createElement(p.View,(0,t.default)({},this.props,this._panResponder.panHandlers))}}]),I})(f.Component);_e.default=y},707,[1,22,9,10,16,12,14,17,165,2]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=y(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),p=t(r(d[8]));function y(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(y=function(t){return t?l:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var y=t.isOpen,x=t.onClose,h=t.onLeave,E=(0,l.useContext)(f.ConfigServiceContext).sessionConfig,b=(0,o.useWindowDimensions)(),v=E.theme.dimensions||b,C=(v.height,.9*v.width),w=C/2-20,j=(0,l.useContext)(c.MediaRoomContext).mediaRoom,k=(0,l.useContext)(s.ThemeContext).colors;return l.default.createElement(u.Modal,{isVisible:y,backdropOpacity:.8,backdropColor:k.secondary[800]},l.default.createElement(u.Flex,{width:C,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:p.default.large},l.default.createElement(u.Flex,{py:25},l.default.createElement(u.Text,{fontSize:28,fontWeight:"bold"},"Leave")),l.default.createElement(u.Flex,null,l.default.createElement(u.Text,{fontSize:"lg"},"Are you sure you want to leave the call?")),l.default.createElement(u.Flex,{display:"flex",py:20},l.default.createElement(u.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},l.default.createElement(u.Button,{onClick:x},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"secondary.700",height:40,width:w-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Cancel"))),l.default.createElement(u.Button,{onClick:h},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"danger.500",height:40,width:w-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Leave")))),l.default.createElement(u.Flex,null,E.permissions.kick_participant&&l.default.createElement(u.Button,{onClick:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(j.kickAll());case 2:case"end":return t.stop()}},null,null,null,Promise)}},l.default.createElement(u.Flex,{display:"flex",direction:"row",mt:15,justify:"space-around"},l.default.createElement(u.Flex,{bg:"danger.500",height:40,width:2*w,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"End Meeting"))))))))}},708,[1,67,165,2,512,585,508,514,676]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=x(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),p=t(r(d[8])),y=r(d[9]);function x(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(x=function(t){return t?l:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var x=t.isOpen,h=t.onClose,E=t.onLeave,b=(0,l.useContext)(f.ConfigServiceContext).sessionConfig,v=(0,o.useWindowDimensions)(),C=(0,y.useScale)(b.theme.dimensions||v),w=(C.height,.9*C.width),j=w/2-20,k=(0,l.useContext)(c.MediaRoomContext).mediaRoom,O=(0,l.useContext)(s.ThemeContext).colors;return l.default.createElement(u.Modal,{isVisible:x,backdropOpacity:.8,backdropColor:O.secondary[800]},l.default.createElement(u.Flex,{width:w,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:p.default.large},l.default.createElement(u.Flex,{py:25},l.default.createElement(u.Text,{fontSize:28,fontWeight:"bold"},"Leave")),l.default.createElement(u.Flex,null,l.default.createElement(u.Text,{fontSize:"lg"},"Are you sure you want to leave the call?")),l.default.createElement(u.Flex,{display:"flex",py:20},l.default.createElement(u.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},l.default.createElement(u.Button,{onClick:h},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"secondary.700",height:40,width:j-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Cancel"))),l.default.createElement(u.Button,{onClick:E},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"danger.500",height:40,width:j-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Leave")))),l.default.createElement(u.Flex,null,b.permissions.kick_participant&&l.default.createElement(u.Button,{onClick:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(k.kickAll());case 2:case"end":return t.stop()}},null,null,null,Promise)}},l.default.createElement(u.Flex,{display:"flex",direction:"row",mt:15,justify:"space-around"},l.default.createElement(u.Flex,{bg:"danger.500",height:40,width:2*j,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"End Meeting"))))))))}},708,[1,67,165,2,512,585,508,514,676,493]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=s(n);if(o&&o.has(t))return o.get(t);var l={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var f=c?Object.getOwnPropertyDescriptor(t,u):null;f&&(f.get||f.set)?Object.defineProperty(l,u,f):l[u]=t[u]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=r(d[3]),c=r(d[4]),u=r(d[5]),f=r(d[6]),p=t(r(d[7]));function s(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(s=function(t){return t?o:n})(t)}var b=function(t){var s=t.isOpen,b=t.peers,y=(0,n.useContext)(l.MediaRoomContext).mediaRoom,x=(0,c.useDispatch)(),v=(0,n.useContext)(f.ThemeContext).colors,E=function(t){x((0,u.removeWaitListPeer)({id:t})),y.rejectWaitingRequest(t)};return n.default.createElement(o.Modal,{isVisible:s,backdropOpacity:.8,backdropColor:v.secondary[800]},n.default.createElement(o.Text,{fontWeight:"bold"},"Waiting Requests"),n.default.createElement(o.Stack,{spacing:6,height:"80"},b.map(function(t){return n.default.createElement(o.Flex,{direction:"row",alignItems:"center"},n.default.createElement(p.default,{name:t.name,bgColor:v.primary[700]}),n.default.createElement(o.Flex,{marginLeft:3,flexGrow:1,alignItems:"center",paddingY:2,borderBottom:"1px solid "+v.secondary[800]},n.default.createElement(o.Text,{color:v.textPrimary[200],fontSize:"lg"},t.name),n.default.createElement(o.Flex,{marginLeft:"auto"},n.default.createElement(o.Button,{_hover:{borderColor:v.danger[500]},onClick:function(){return E(t.id)}},n.default.createElement(o.Box,{bg:"secondary.700",p:4},n.default.createElement(o.Icon,{boxSize:"16",name:"close"}))),n.default.createElement(o.Button,{_hover:{borderColor:v.danger[500]},onClick:function(){return E(t.id)}},n.default.createElement(o.Box,{bg:"primary.500",p:4},n.default.createElement(o.Icon,{boxSize:"16",name:"check"}))))))})))};e.default=b},709,[1,165,512,585,432,480,514,682]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var c=u?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(l,o,c):l[o]=e[o]}l.default=e,n&&n.set(e,l);return l})(r(d[2])),l=r(d[3]),u=r(d[4]),o=r(d[5]),c=e(r(d[6])),f=e(r(d[7])),s=r(d[8]),p=r(d[9]),E=r(d[10]),S=e(r(d[11])),b=r(d[12]),h=r(d[13]),x=r(d[14]),w=e(r(d[15])),v=r(d[16]);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}var P=n.default.memo(function(e){var y=e.title,P=(e.copyLink,e.linkCopied,e.width),C=(e.height,e.noOfParticipants,(0,l.useSelector)(function(e){return e.room.waitingState})),O=(0,n.useContext)(s.ConfigServiceContext),I=O.meeting,j=O.sessionConfig,k=(0,l.useSelector)(function(e){return e.plugin.main}),T='LANDSCAPE'===n.default.useContext(o.OrientationContext).orientation,_=(0,l.useSelector)(function(e){return e.peers.recordingPeer}),D=(0,n.useState)(!1),R=(0,t.default)(D,2),W=R[0],M=R[1],B=(0,n.useRef)(null),N=(0,n.useRef)(!1),z=(0,l.useSelector)(function(e){return e.room.roomViewType}),A=(0,l.useSelector)(function(e){return e.participant.presentingState}),V=(0,l.useSelector)(function(e){return e.participant.videoOff}),F=(0,n.useContext)(x.PeersServiceContext),G=(F.processedPeers,F.selfPeer,F.joinedProcessedPeers),L=n.default.useContext(v.DrawerContext),H=L.setDrawerExpander,q=L.setopenedTab;if((0,n.useEffect)(function(){_&&!N.current?(null==I||I.emit(I.Events.recordingStarted),N.current=!0,B.current=setInterval(function(){M(function(e){return!e})},1e3)):!_&&N.current&&(N.current=!1,null==I||I.emit(I.Events.recordingStopped),clearInterval(B.current))},[_]),(0,n.useEffect)(function(){return function(){B.current&&clearInterval(B.current)}},[]),T||k.length>0)return null;return n.default.createElement(E.Flex,{height:56,width:P,bg:"secondary.1000",justify:"center",align:"center",pt:'android'===u.Platform.OS?10:26},n.default.createElement(E.Flex,{borderRadius:c.default.medium,width:P-8,justify:"space-between",direction:"row",px:12},n.default.createElement(E.VStack,null,n.default.createElement(E.Stack,{align:"center",width:P/2},j.theme.header.elements.title?n.default.createElement(E.Text,{fontWeight:"bold"},y):null),n.default.createElement(E.Stack,{isInline:!0,spacing:2,pt:2,align:"center"},j.theme.header.elements.timer&&C!==p.WaitingState.WAITING&&n.default.createElement(f.default,null),_&&W&&n.default.createElement(E.Box,{ml:12,bg:"danger.500",pl:4,pr:6,borderRadius:4,direction:"row",alignItems:"center"},n.default.createElement(E.Icon,{boxSize:"15",name:"fiber-manual-record",fill:"white"}),n.default.createElement(E.Text,{color:"white"},"REC")))),n.default.createElement(E.HStack,{align:"flex-end",mb:2},j.theme.control_bar.elements.participants&&n.default.createElement(E.Box,{mr:28},n.default.createElement(E.Box,{position:"absolute",top:-12,zIndex:25,right:G.length+1>99?-18:-10},n.default.createElement(w.default,{number:G.length+1,color:"primary.500"})),n.default.createElement(E.Button,{onClick:function(){H(!0),q('participants')}},n.default.createElement(E.Icon,{boxSize:"24",name:"people",fill:"textPrimary.100"}))),!V&&(z!==b.DyteViewTypes.webinar||A===h.PresentingState.PRESENTING)&&n.default.createElement(S.default,null))))});_e.default=P},710,[1,41,165,432,2,575,676,711,508,480,512,712,482,487,674,713,714]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=c(n);if(u&&u.has(t))return u.get(t);var o={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in t)if("default"!==l&&Object.prototype.hasOwnProperty.call(t,l)){var s=f?Object.getOwnPropertyDescriptor(t,l):null;s&&(s.get||s.set)?Object.defineProperty(o,l,s):o[l]=t[l]}o.default=t,u&&u.set(t,o);return o})(r(d[2])),o=r(d[3]),f=r(d[4]);function c(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(c=function(t){return t?u:n})(t)}var l=function(t){return Math.trunc(t).toString().padStart(2,'0')},s=function(){var t=(0,o.useSelector)(function(t){return t.room.startedAt}),c=u.default.useRef(),s=u.default.useState(0),p=(0,n.default)(s,2),v=p[0],y=p[1],O=u.default.useRef();return(0,u.useEffect)(function(){return t&&(c.current=requestAnimationFrame(function n(){var u=((new Date).getTime()-new Date(t).getTime())/1e3;y(u),O.current=setTimeout(function(){c.current&&(c.current=requestAnimationFrame(n))},500)})),function(){clearTimeout(O.current),cancelAnimationFrame(c.current)}},[t]),u.default.createElement(f.Text,{color:"textPrimary.400"},v>=3600&&u.default.createElement(u.default.Fragment,null,l(v/3600),"h",' '),l(v%3600/60),"m",' ',l(v%60),"s")};e.default=s},711,[1,41,165,432,512]); @@ -722,13 +722,13 @@ __d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule", __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.MakeMenu=function(t){var c=t.menu;(0,n.useContext)(o.ThemeContext).colors;return n.default.createElement(l.Flex,null,c.map(function(t,o){var c=t.title,s=t.defaultValue,p=t.onChange,b=t.options;return n.default.createElement(n.default.Fragment,{key:(0,f.nanoid)()},0!==o&&n.default.createElement(l.Box,null),n.default.createElement(l.Flex,null,n.default.createElement(l.Text,{fontSize:"md",mb:10,fontWeight:"bold",color:"textPrimary.100"},c),b.map(function(t,o){var c=t.key,f=t.value,b=t.children;return n.default.createElement(l.Button,{key:""+(c+o),onClick:function(){return p(f)}},n.default.createElement(l.HStack,{justify:"space-between",p:16,mb:4,bg:"secondary.800",borderRadius:u.default.small},n.default.createElement(l.Text,{fontSize:"sm"},b),s===f?n.default.createElement(l.Icon,{name:"check",fill:"success.500"}):null))})))}))},e.StageControlButton=p;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=s(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[1])),l=r(d[2]),o=r(d[3]),u=t(r(d[4])),c=r(d[5]),f=r(d[6]);function s(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(s=function(t){return t?l:n})(t)}function p(t){var o=t.variant,u=(t.label,t.icon),f=t.disabled,s=t.onClick,p=(t.isActive,t.menu,t.badge),b=t.ariaLabel,y='LANDSCAPE'===n.default.useContext(c.OrientationContext).orientation;return n.default.createElement(l.Flex,null,''!==p&&n.default.createElement(l.Box,{className:"dyte-client-notificationBadge",bg:"primary.500",textColor:"textPrimary.100",height:4,position:"absolute",right:"2",top:"1",fontSize:"xs"},n.default.createElement("span",null,p)),n.default.createElement(l.Button,{variant:o||'controls',onClick:s,disabled:f},n.default.createElement(l.VStack,{py:10,"aria-label":b,minWidth:64,align:"center",justify:"center"},n.default.createElement(l.Box,{fontSize:"xl",transform:[{rotate:y?'90deg':'0deg'}]},u))))}p.defaultProps={disabled:!1,variant:null,menu:[],isActive:!1,badge:'',ariaLabel:''}},716,[1,165,512,514,676,575,475]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=E(n);if(o&&o.has(t))return o.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(l,c,f):l[c]=t[c]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=r(d[3]),u=r(d[4]),c=r(d[5]),f=t(r(d[6])),s=r(d[7]),p=r(d[8]),y=r(d[9]),x=r(d[10]);function E(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(E=function(t){return t?o:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var E=t.isOpen,b=t.onClose,C=(0,n.useContext)(u.ConfigServiceContext).sessionConfig,h=(0,o.useWindowDimensions)(),v=C.theme.dimensions||h,P=(v.height,.9*v.width),w=P/2-20,S=(0,n.useContext)(c.ThemeContext).colors,T=(0,s.useDispatch)(),O=(0,n.useContext)(p.MediaRoomContext).mediaRoom,j=(0,s.useSelector)(function(t){return t.participant.requestToJoinStageState});return n.default.createElement(l.Modal,{isVisible:E,backdropOpacity:.8,backdropColor:S.secondary[800]},n.default.createElement(l.Flex,{width:P,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:f.default.large},n.default.createElement(l.Flex,{py:25},n.default.createElement(l.Text,{fontSize:28,fontWeight:"bold"},"Drop")),n.default.createElement(l.Flex,null,n.default.createElement(l.Text,{fontSize:"lg"},"Do you want to stop presenting?")),n.default.createElement(l.Flex,{display:"flex",py:20},n.default.createElement(l.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},n.default.createElement(l.Button,{onClick:b},n.default.createElement(l.Flex,{borderRadius:f.default.small,bg:"secondary.700",height:40,width:w-4,alignItems:"center",justifyContent:"center"},n.default.createElement(l.Text,{fontSize:"lg"},"Cancel"))),n.default.createElement(l.Button,{onClick:function(){j===y.RequestToJoinStageState.ACCEPTED?(b(),O.removePeerFromStage(O.peerid,x.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT)):(O.stopPresenting(),T((0,y.stoppedPresenting)()),b())}},n.default.createElement(l.Flex,{borderRadius:f.default.small,bg:"danger.500",height:40,width:w-4,alignItems:"center",justifyContent:"center"},n.default.createElement(l.Text,{fontSize:"lg"},"Drop")))))))}},717,[1,165,2,512,508,514,676,432,585,487,497]); __d(function(g,r,i,a,m,e,d){var s,n,o;Object.defineProperty(e,"__esModule",{value:!0}),e.SessionProducerAccessType=e.SessionJoiningRestriction=e.MessageTypes=void 0,e.SessionJoiningRestriction=s,(function(s){s[s.NO_VIDEO=0]="NO_VIDEO",s[s.NO_MIC=1]="NO_MIC"})(s||(e.SessionJoiningRestriction=s={})),e.SessionProducerAccessType=n,(function(s){s[s.NOT_ALLOWED=0]="NOT_ALLOWED",s[s.REQUEST_FIRST=1]="REQUEST_FIRST",s[s.ALLOWED=2]="ALLOWED"})(n||(e.SessionProducerAccessType=n={})),e.MessageTypes=o,(function(s){s[s.text=0]="text",s[s.image=1]="image",s[s.file=2]="file",s[s.poll=3]="poll"})(o||(e.MessageTypes=o={}))},718,[]); -__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=E(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(o,f,c):o[f]=t[f]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),f=t(r(d[5])),c=r(d[6]),s=r(d[7]),m=t(r(d[8])),p=t(r(d[9])),x=r(d[10]),b=r(d[11]),y=r(d[12]);function E(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(E=function(t){return t?l:n})(t)}var C=function(t){var E=t.options,C=t.unReadChatMessages,h=t.unSeenPolls,w=t.webinarUnseenRequest,v=(0,l.useRef)(null),k=(0,l.useContext)(c.ConfigServiceContext),P=(k.meeting,k.sessionConfig),j=(0,l.useContext)(u.ThemeContext).colors,S=(0,o.useWindowDimensions)(),B=P.theme.dimensions||S,O=B.height,M=B.width,R=l.default.useContext(y.DrawerContext),z=R.drawerExpanded,D=R.setDrawerExpander,T=R.openedTab,_=R.setopenedTab,I=function(){_(null),D(!1)};(0,l.useEffect)(function(){var t;z&&v&&(null==(t=v.current)||t.setModalVisible())},[z]);var W=function(){return _(null),D(!1),!0},A='LANDSCAPE'===l.default.useContext(x.OrientationContext).orientation,F=E.findIndex(function(t){return t.id===T}),q=F>-1?F:null;if(z&&q&&E[q].mainComponent)return l.default.createElement(o.Modal,{visible:!0,onRequestClose:W},l.default.createElement(s.Flex,{width:M,height:O,bg:"secondary.1000",direction:"row",flexWrap:"wrap",justify:"space-between"},l.default.createElement(p.default,{heading:E[q].label,onBackButtonClick:W}),l.default.createElement(s.Box,{width:M},E[q].mainComponent)));var H=A?24:8;return l.default.createElement(n.default,{containerStyle:{backgroundColor:j.secondary[900],justifyContent:'space-between'},overlayColor:"#000",ref:v,extraScroll:1,onClose:I,gestureEnabled:!0},null===q?l.default.createElement(s.VStack,{px:"6",py:"10",mx:H,borderRadius:m.default.medium,bg:"secondary.800",mb:12},E.map(function(t,n){var o=t.label,u=t.icon,c=t.disabled,p=t.id;return l.default.createElement(s.Button,{key:(0,b.nanoid)(),onClick:void 0!==E[n].onClick?E[n].onClick:function(){return _(p)},disabled:c},l.default.createElement(s.HStack,{p:12,px:16,borderRadius:m.default.small,align:"center",justify:"space-between"},l.default.createElement(s.Text,{fontSize:"xs",marginTop:"5px",textAlign:"center",color:c?'textPrimary.400':'textPrimary.200'},o),l.default.createElement(s.Box,{fontSize:"xl"},C&&C.length>0&&'Chat'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:C.length})),h&&h.length>0&&'Polls'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:h.length})),'Participants'===o&&w&&w.length>0&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:w.length})),'string'==typeof u?l.default.createElement(s.Icon,{name:u,boxSize:"26",fill:c?'textPrimary.400':'textPrimary.200'}):u)))})):l.default.createElement(s.Flex,{px:"6",py:"10",mx:4,borderRadius:m.default.medium,bg:"secondary.900",mb:12,mt:16},E[q].drawerComponent),(null!==q||!A)&&l.default.createElement(s.Flex,{mx:H,mb:8},l.default.createElement(s.Button,{onClick:null!==q?function(){return _(null)}:function(){return I()},width:M},l.default.createElement(s.HStack,{p:16,borderRadius:m.default.small,justify:"center",bg:"secondary.800"},l.default.createElement(s.Text,{ml:-4,color:"danger.500"},"Back",null===q&&' to Meeting')))))};e.default=C},719,[1,720,165,2,514,713,508,512,676,724,575,475,714]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=C(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(o,f,c):o[f]=t[f]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),f=t(r(d[5])),c=r(d[6]),s=r(d[7]),m=t(r(d[8])),p=t(r(d[9])),x=r(d[10]),b=r(d[11]),y=r(d[12]),E=r(d[13]);function C(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(C=function(t){return t?l:n})(t)}var h=function(t){var C=t.options,h=t.unReadChatMessages,w=t.unSeenPolls,v=t.webinarUnseenRequest,k=(0,l.useRef)(null),P=(0,l.useContext)(c.ConfigServiceContext),S=(P.meeting,P.sessionConfig),j=(0,l.useContext)(u.ThemeContext).colors,B=(0,o.useWindowDimensions)(),O=(0,E.useScale)(S.theme.dimensions||B),M=O.height,R=O.width,z=l.default.useContext(y.DrawerContext),D=z.drawerExpanded,T=z.setDrawerExpander,_=z.openedTab,I=z.setopenedTab,W=function(){I(null),T(!1)};(0,l.useEffect)(function(){var t;D&&k&&(null==(t=k.current)||t.setModalVisible())},[D]);var A=function(){return I(null),T(!1),!0},F='LANDSCAPE'===l.default.useContext(x.OrientationContext).orientation,q=C.findIndex(function(t){return t.id===_}),H=q>-1?q:null;if(D&&H&&C[H].mainComponent)return l.default.createElement(o.Modal,{visible:!0,onRequestClose:A},l.default.createElement(s.Flex,{width:R,height:M,bg:"secondary.1000",direction:"row",flexWrap:"wrap",justify:"space-between"},l.default.createElement(p.default,{heading:C[H].label,onBackButtonClick:A}),l.default.createElement(s.Box,{width:R},C[H].mainComponent)));var V=F?24:8;return l.default.createElement(n.default,{containerStyle:{backgroundColor:j.secondary[900],justifyContent:'space-between'},overlayColor:"#000",ref:k,extraScroll:1,onClose:W,gestureEnabled:!0},null===H?l.default.createElement(s.VStack,{px:"6",py:"10",mx:V,borderRadius:m.default.medium,bg:"secondary.800",mb:12},C.map(function(t,n){var o=t.label,u=t.icon,c=t.disabled,p=t.id;return l.default.createElement(s.Button,{key:(0,b.nanoid)(),onClick:void 0!==C[n].onClick?C[n].onClick:function(){return I(p)},disabled:c},l.default.createElement(s.HStack,{p:12,px:16,borderRadius:m.default.small,align:"center",justify:"space-between"},l.default.createElement(s.Text,{fontSize:"xs",marginTop:"5px",textAlign:"center",color:c?'textPrimary.400':'textPrimary.200'},o),l.default.createElement(s.Box,{fontSize:"xl"},h&&h.length>0&&'Chat'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:h.length})),w&&w.length>0&&'Polls'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:w.length})),'Participants'===o&&v&&v.length>0&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:v.length})),'string'==typeof u?l.default.createElement(s.Icon,{name:u,boxSize:"26",fill:c?'textPrimary.400':'textPrimary.200'}):u)))})):l.default.createElement(s.Flex,{px:"6",py:"10",mx:4,borderRadius:m.default.medium,bg:"secondary.900",mb:12,mt:16},C[H].drawerComponent),(null!==H||!F)&&l.default.createElement(s.Flex,{mx:V,mb:8},l.default.createElement(s.Button,{onClick:null!==H?function(){return I(null)}:function(){return W()},width:R},l.default.createElement(s.HStack,{p:16,borderRadius:m.default.small,justify:"center",bg:"secondary.800"},l.default.createElement(s.Text,{ml:-4,color:"danger.500"},"Back",null===H&&' to Meeting')))))};e.default=h},719,[1,720,165,2,514,713,508,512,676,724,575,475,714,493]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1])).default;e.default=u},720,[1,721]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),o=e(r(d[2])),n=e(r(d[3])),l=e(r(d[4])),s=e(r(d[5])),c=e(r(d[6])),u=e(r(d[7])),f=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=y(t);if(o&&o.has(e))return o.get(e);var n={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=l?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(n,s,c):n[s]=e[s]}n.default=e,o&&o.set(e,n);return n})(r(d[8])),p=r(d[9]),h=r(d[10]),v=r(d[11]);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(y=function(e){return e?o:t})(e)}function S(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var b=0,w=["dummy"],T="android"===p.Platform.OS&&p.StatusBar.currentHeight||0,k=p.Dimensions.get("window").height,_=(function(e){(0,s.default)(P,e);var y,_,O=(y=P,_=S(),function(){var e,t=(0,u.default)(y);if(_){var o=(0,u.default)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return(0,c.default)(this,e)});function P(e){var l,s;return(0,n.default)(this,P),(s=O.call(this,e)).actionSheetHeight=0,s.prevScroll=0,s.timeout=null,s.offsetY=0,s.currentOffsetFromBottom=0,s.scrollAnimationEndValue=0,s.hasBounced=!1,s.layoutHasCalled=!1,s.isClosing=!1,s.isRecoiling=!1,s.isReachedTop=!1,s.deviceLayoutCalled=!1,s.transformValue=new p.Animated.Value(0),s.opacityValue=new p.Animated.Value(0),s.borderRadius=new p.Animated.Value(10),s.underlayTranslateY=new p.Animated.Value(100),s.underlayScale=new p.Animated.Value(1),s.initialScrolling=!1,s.keyboardShowSubscription=null,s.KeyboardHideSubscription=null,s.snapToOffset=function(e){var t=.15*s.state.deviceHeight,o=s.props.extraScroll||0,n=(s.props.gestureEnabled,e+t+o);s.currentOffsetFromBottom=n/s.actionSheetHeight,s.currentOffsetFromBottom=s.currentOffsetFromBottom-.15,setTimeout(function(){s._scrollTo(n),s.updateActionSheetPosition(n)},500)},s.show=function(){s.setModalVisible(!0)},s.hide=function(){s.setModalVisible(!1)},s.setModalVisible=function(e){var t=s.state.modalVisible;if(s.initialScrolling=!1,void 0!==e){if(t===e)return;t=!e}t?s._hideModal():s.setState({modalVisible:!0,scrollable:s.props.gestureEnabled||!1})},s._hideModal=function(){s.isClosing||(s.isClosing=!0,s._hideAnimation())},s.measure=function(){return t.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){setTimeout(function(){var t;s.safeAreaViewRef.current?null==(t=s.safeAreaViewRef.current)||t.measure(function(t,o,n,l){T=0===l?25:l,T=!s.props.drawUnderStatusBar&&T>30?T-12:T,e(T)}):e(T=25)},50)}));case 1:case"end":return e.stop()}},null,null,null,Promise)},s._showModal=function(e){var o,n,l,c,u,f;return t.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(o=s.props,n=o.gestureEnabled,l=o.delayActionSheetDraw,c=o.delayActionSheetDrawTime,null!=e&&e.nativeEvent){h.next=3;break}return h.abrupt("return");case 3:if(u=e.nativeEvent.layout.height,!s.layoutHasCalled){h.next=10;break}return s.actionSheetHeight=u,s._returnToPrevScrollPosition(u),h.abrupt("return");case 10:if(s.initialScrolling=!0,s.layoutHasCalled=!0,s.actionSheetHeight=u,f=s.getInitialScrollPosition(),s.isRecoiling=!1,"ios"!==p.Platform.OS){h.next=20;break}return h.next=18,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 18:h.next=23;break;case 20:if(!l){h.next=23;break}return h.next=23,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 23:if(s._scrollTo(f,!1),s.prevScroll=f,"ios"!==p.Platform.OS){h.next=30;break}return h.next=28,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 28:h.next=33;break;case 30:if(!l){h.next=33;break}return h.next=33,t.default.awrap((0,v.waitAsync)((null!=c?c:0)/2));case 33:s._openAnimation(f),s.underlayScale.setValue(1),s.underlayTranslateY.setValue(100),n||s.props.onPositionChanged&&s.props.onPositionChanged(!0),s.updateActionSheetPosition(f);case 38:case"end":return h.stop()}},null,null,null,Promise)},s._openAnimation=function(e){var t=s.props,o=t.bounciness,n=t.bounceOnOpen,l=t.animated,c=t.openAnimationSpeed;l?(s.transformValue.setValue(e),p.Animated.parallel([p.Animated.spring(s.transformValue,{toValue:0,bounciness:n?o:1,speed:c,useNativeDriver:!0}),p.Animated.timing(s.opacityValue,{toValue:1,duration:150,useNativeDriver:!0})]).start()):s.opacityValue.setValue(1)},s._onScrollBegin=function(e){return t.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},null,null,null,Promise)},s._onScrollBeginDrag=function(e){var o;return t.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:o=e.nativeEvent.contentOffset.y,s.prevScroll=o;case 2:case"end":return t.stop()}},null,null,null,Promise)},s._onScrollEnd=function(e){var o,n,l,c,u,f,p,h;return t.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:if(o=s.props,n=o.springOffset,l=o.extraScroll,c=e.nativeEvent.contentOffset.y,u=.15*s.state.deviceHeight,!s.isRecoiling){y.next=5;break}return y.abrupt("return");case 5:if(!(s.prevScroll.75*(null!=n?n:100)||s.initialScrolling)){y.next=19;break}return s.isRecoiling=!0,s._applyHeightLimiter(),s.currentOffsetFromBottom=s.currentOffsetFromBottom<(null!=(f=s.props.initialOffsetFromBottom)?f:1)&&null!=(p=s.props.initialOffsetFromBottom)?p:1,h=s.actionSheetHeight*s.currentOffsetFromBottom+u+(null!=l?l:100),s.initialScrolling&&(s.initialScrolling=!1,h=s.prevScroll),s._scrollTo(h),y.next=15,t.default.awrap((0,v.waitAsync)(300));case 15:s.isRecoiling=!1,s.props.onPositionChanged&&s.props.onPositionChanged(!0),y.next=20;break;case 19:s._returnToPrevScrollPosition(s.actionSheetHeight);case 20:y.next=33;break;case 22:if(!(s.prevScroll-c>(null!=n?n:100))){y.next=26;break}s._hideModal(),y.next=33;break;case 26:if(!s.isRecoiling){y.next=28;break}return y.abrupt("return");case 28:return s.isRecoiling=!0,s._returnToPrevScrollPosition(s.actionSheetHeight),y.next=32,t.default.awrap((0,v.waitAsync)(300));case 32:s.isRecoiling=!1;case 33:case"end":return y.stop()}},null,null,null,Promise)},s._scrollTo=function(e){var t,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s.scrollAnimationEndValue=e,s.prevScroll=e,null==(t=s.scrollViewRef.current)||t._listRef._scrollRef.scrollTo({x:0,y:s.scrollAnimationEndValue,animated:o}),s.initialScrolling&&setTimeout(function(){s.initialScrolling=!1},500)},s._onTouchMove=function(){s.props.closeOnTouchBackdrop&&s._hideModal(),s.setState({scrollable:!1})},s._onTouchStart=function(){s.props.closeOnTouchBackdrop&&s._hideModal(),s.setState({scrollable:!1})},s._onTouchEnd=function(){s._returnToPrevScrollPosition(s.actionSheetHeight),s.props.gestureEnabled&&s.setState({scrollable:!0})},s._onScroll=function(e){s.offsetY=e.nativeEvent.contentOffset.y;var t=.15*s.state.deviceHeight,o=s.actionSheetHeight+t-s.offsetY;if(s.actionSheetHeight=s.state.deviceHeight-1)if(os.prevScroll)){t.next=2;break}return t.abrupt("return");case 2:s.prevScroll-(null!=(e=s.props.springOffset)?e:100)>s.offsetY?(o=s.getInitialScrollPosition(),s.offsetY>o-100?(s.isRecoiling=!0,s._scrollTo(o),s.currentOffsetFromBottom=null!=(n=s.props.initialOffsetFromBottom)?n:1,s.prevScroll=o,setTimeout(function(){s.isRecoiling=!1},500)):s._hideModal()):(s.isRecoiling=!0,s._scrollTo(s.prevScroll,!0),setTimeout(function(){s.isRecoiling=!1},500));case 3:case"end":return t.stop()}},null,null,null,Promise)},s._onDeviceLayout=function(e){var n;return t.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:n=(0,o.default)({},e),s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(function(){var e,o,l,c,u,f;return t.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=0,"ios"!==p.Platform.OS){h.next=7;break}return h.next=4,t.default.awrap(s.measure());case 4:h.t0=h.sent,h.next=8;break;case 7:h.t0=p.StatusBar.currentHeight;case 8:if(c=h.t0,s.props.drawUnderStatusBar){h.next=16;break}if("android"!==p.Platform.OS||s.props.statusBarTranslucent){h.next=12;break}return h.abrupt("return");case 12:l=null!=c?c:0,c&&s.indicatorTranslateY.setValue(-c),h.next=17;break;case 16:s.updateActionSheetPosition(s.offsetY);case 17:if(u=n.nativeEvent.layout.height-l,f=p.Dimensions.get("window").width,(null==u?void 0:u.toFixed(0))!==(null==(e=k)?void 0:e.toFixed(0))||(null==f?void 0:f.toFixed(0))!==(null==(o=s.state.deviceWidth)?void 0:o.toFixed(0))||!s.deviceLayoutCalled){h.next=21;break}return h.abrupt("return");case 21:s.deviceLayoutCalled=!0,k=u,s.setState({deviceHeight:u,deviceWidth:f,portrait:u>f,paddingTop:null!=c?c:0});case 24:case"end":return h.stop()}},null,null,null,Promise)},1);case 3:case"end":return l.stop()}},null,null,null,Promise)},s._keyExtractor=function(e){return e},s.state={modalVisible:!1,scrollable:!1,layoutHasCalled:!1,keyboard:!1,deviceHeight:k||(0,v.getDeviceHeight)(s.props.statusBarTranslucent),deviceWidth:p.Dimensions.get("window").width,portrait:!0,safeAreaInnerHeight:b,paddingTop:T,keyboardPadding:0},s.scrollViewRef=(0,f.createRef)(),s.safeAreaViewRef=(0,f.createRef)(),s.currentOffsetFromBottom=null!=(l=s.props.initialOffsetFromBottom)?l:1,s.indicatorTranslateY=new p.Animated.Value(0|-s.state.paddingTop),s}return(0,l.default)(P,[{key:"_hideAnimation",value:function(){var e=this,t=this.props,o=t.animated,n=t.closeAnimationDuration,l=t.bottomOffset,s=t.initialOffsetFromBottom,c=t.extraScroll,u=t.closable;p.Animated.parallel([p.Animated.timing(this.opacityValue,{toValue:u?0:1,duration:o?n:1,useNativeDriver:!0}),p.Animated.timing(this.transformValue,{toValue:u?2*this.actionSheetHeight:0,duration:o?n:1,useNativeDriver:!0})]).start(),(0,v.waitAsync)((null!=n?n:300)/1.5).then(function(){u?(e._scrollTo(0,!1),e.currentOffsetFromBottom=null!=s?s:1,e.setState({modalVisible:!u},function(){e.isClosing=!1,e.isReachedTop=!1,e.props.onPositionChanged&&e.props.onPositionChanged(!1),e.indicatorTranslateY.setValue(-e.state.paddingTop),e.layoutHasCalled=!1,e.deviceLayoutCalled=!1,e.props.onClose&&e.props.onClose()})):(l&&l>0?e.snapToOffset(l):(e._scrollTo(e.actionSheetHeight*(null!=s?s:1)+.1*e.state.deviceHeight+(null!=c?c:0),!0),e.currentOffsetFromBottom=null!=s?s:1),e.isClosing=!1)})}},{key:"_applyHeightLimiter",value:function(){this.actionSheetHeight>this.state.deviceHeight&&(this.actionSheetHeight=1*(this.actionSheetHeight-(this.actionSheetHeight-this.state.deviceHeight)))}},{key:"updateActionSheetPosition",value:function(e){if(this.actionSheetHeight>=this.state.deviceHeight-1){var t=.15*this.state.deviceHeight;if(this.actionSheetHeight+t-e0&&B((0,M.markMessagesRead)((t={},(0,l.default)(t,v.MessageTypes.text,!0),(0,l.default)(t,v.MessageTypes.file,!0),(0,l.default)(t,v.MessageTypes.image,!0),(0,l.default)(t,v.MessageTypes.poll,!0),t)))},[se]);var me=function(){if(''!==$){var t={message:$,userId:D.userId,displayName:D.displayName,type:v.MessageTypes.text,time:(new Date).getTime()};Y.sendMessage(t),q('')}},pe=function(t,n,l){var o={displayName:D.displayName,type:v.MessageTypes.file,link:t,userId:D.id,name:n,size:l};Y.sendMessage(o)},ge=function(t){var l,o;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,n.default.awrap(fetch(t));case 2:return l=u.sent,u.next=5,n.default.awrap(l.blob());case 5:return o=u.sent,u.abrupt("return",o);case 7:case"end":return u.stop()}},null,null,null,Promise)};function ye(t,l,o){var u;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.default.awrap(ge(o));case 2:return u=s.sent,s.next=5,n.default.awrap(fetch(l,{method:'PUT',headers:{'Content-Type':t.type},body:u}));case 5:case"end":return s.stop()}},null,null,null,Promise)}function xe(t){var l,o,u,s,c;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return l=O.default.apiBase+"/v1/meetings/genPreSignedUploadUrl",f.next=3,n.default.awrap(fetch(l,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({roomName:ue,filename:t.name})}));case 3:return o=f.sent,f.next=6,n.default.awrap(o.json());case 6:return u=f.sent.data,s=u.getLocation,c=u.putLocation,f.abrupt("return",{getURL:s,putURL:c});case 10:case"end":return f.stop()}},null,null,null,Promise)}var he=function(t){f.Alert.alert('Error',"Error: "+(t||'Problem uploading image'),[{text:'OK'}]),ae(!1)},be=function(){try{te||(ae(!0),X(!1),(0,P.launchImageLibrary)({mediaType:'photo'},function(t){var l,o,u,s,c,m,p,y,x;return n.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=t.uri,o=t.didCancel,u=t.errorCode,s=t.errorMessage,c=t.fileName,m=t.type,p=t.fileSize,!o){h.next=5;break}ae(!1),h.next=19;break;case 5:if(!u){h.next=10;break}console.log('Error Uploading Image:',u,s),he(s),h.next=19;break;case 10:return y={name:c,type:m,uri:l},p>5e6&&f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),h.next=14,n.default.awrap(xe(y));case 14:return x=h.sent,h.next=17,n.default.awrap(ye(y,x.putURL,y.uri));case 17:b=x.getURL,w={displayName:D.displayName,type:v.MessageTypes.image,link:b,userId:D.id},Y.sendMessage(w),ae(!1);case 19:case"end":return h.stop()}var b,w},null,null,null,Promise)}))}catch(t){console.log('Error Uploading Image:',t),he()}},ve=function(){var t,l,o,u,s,c;return n.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:if(te){m.next=24;break}return ae(!0),X(!1),m.prev=3,m.next=6,n.default.awrap(C.default.pick({type:[C.default.types.allFiles]}));case 6:if(t=m.sent,l=t.uri,o=t.name,u=t.size,s={displayName:D.displayName,type:v.MessageTypes.file,link:l,userId:D.id,name:o,size:u},!(u>5e6)){m.next=12;break}return f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),m.abrupt("return");case 12:return m.next=14,n.default.awrap(xe(s));case 14:return c=m.sent,m.next=17,n.default.awrap(ye(s,c.putURL,s.link));case 17:pe(c.getURL,o,u),ae(!1),m.next=24;break;case 21:m.prev=21,m.t0=m.catch(3),C.default.isCancel(m.t0)?ae(!1):he();case 24:case"end":return m.stop()}},null,null,[[3,21]],Promise)};return c.default.createElement(m.Flex,{height:V-50,align:"center",width:H},c.default.createElement(k.default,null,c.default.createElement(y.GiftedChat,{messagesContainerStyle:{paddingTop:60},messages:le,alwaysShowSend:!0,renderAvatarOnTop:!0,renderUsernameOnMessage:!0,isKeyboardInternallyHandled:!1,timeTextStyle:{left:{color:L.textPrimary[400]},right:{color:L.textPrimary[400]}},renderAvatar:function(t){return c.default.createElement(x.default,{name:t.currentMessage.user.name,bgColor:L.primary[700]})},renderBubble:function(t){var n=t.currentMessage;return n.type,n.link,n.text,c.default.createElement(y.Bubble,(0,o.default)({},t,{wrapperStyle:{left:{backgroundColor:L.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3},right:{backgroundColor:L.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3}},textStyle:{left:{color:L.textPrimary[100]},right:{color:L.textPrimary[100]}}}))},renderInputToolbar:function(t){return z&&c.default.createElement(m.Flex,{width:ce?H-60:H-20,direction:"row",justify:"space-between",align:"center",bg:"secondary.800",borderRadius:"50px",height:50},c.default.createElement(m.Box,null,c.default.createElement(m.Button,{onClick:function(){X(!Q)}},c.default.createElement(m.Box,(0,m.mergeStyles)(N.touchableIcons,{ml:8}),Q?c.default.createElement(m.Icon,{name:"close",fill:"textPrimary.100",boxSize:"sm"}):c.default.createElement(m.Icon,{name:"plus-thick",fill:"textPrimary.100",boxSize:"sm"}))),Q&&c.default.createElement(R,null,c.default.createElement(m.Button,{onClick:be},c.default.createElement(m.Box,N.attachementButtons,c.default.createElement(m.Icon,{name:"image",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:8}," Images"))),c.default.createElement(m.Button,{onClick:ve},c.default.createElement(m.Box,(0,m.mergeStyles)(N.attachementButtons,{width:'ios'===f.Platform.OS?150:120}),c.default.createElement(m.Icon,{name:"attach-file",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:'ios'===f.Platform.OS?8:0},' ',"Attachments"))))),c.default.createElement(f.TextInput,{style:{color:L.textPrimary[300],paddingHorizontal:5,height:40,width:ce?H-160:H-120},onChangeText:q,value:$}),c.default.createElement(m.Button,{onClick:me,height:40,width:40},c.default.createElement(m.Box,(0,m.mergeStyles)(N.touchableIcons,{backgroundColor:'primary.500',mr:8}),c.default.createElement(m.Icon,{name:"send",fill:"textPrimary.100",boxSize:"md"}))))},user:{_id:D.userId,name:D.displayName}})))};e.default=U},725,[1,67,261,22,49,41,165,2,512,508,726,682,514,432,718,674,585,790,791,465,480,792,676,575,504]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=p(n);if(o&&o.has(t))return o.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(l,f,c):l[f]=t[f]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=t(r(d[3])),u=r(d[4]),f=r(d[5]),c=r(d[6]),s=r(d[7]);function p(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(p=function(t){return t?o:n})(t)}var b=function(t){var p=t.onBackButtonClick,b=t.heading,h=(0,n.useContext)(f.ConfigServiceContext).sessionConfig,x=(0,n.useContext)(u.ThemeContext).colors,v=(0,c.useWindowDimensions)(),w=useScale(h.theme.dimensions||v),y=(w.height,w.width),C='LANDSCAPE'===n.default.useContext(s.OrientationContext).orientation;return n.default.createElement(o.Box,{position:"absolute",zIndex:10,pt:'ios'!==c.Platform.OS||C?3:42,bg:"secondary.1000",width:y},n.default.createElement(o.HStack,null,n.default.createElement(o.Box,{width:y/3},n.default.createElement(o.Button,{onClick:p},n.default.createElement(o.HStack,{border:"1px solid "+x.danger[500],borderRadius:l.default.small,left:20,p:8,width:80},n.default.createElement(o.Icon,{name:"arrow-back",fill:"danger.500"}),n.default.createElement(o.Text,{ml:4,mr:4,color:"danger.500"},"Back")))),n.default.createElement(o.Flex,{width:y/3,align:"center",p:8},n.default.createElement(o.Text,{fontSize:16,fontWeight:"bold",mb:10},' ',b))))};e.default=b},724,[1,165,512,676,514,508,2,575]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=t(r(d[2])),o=t(r(d[3])),u=t(r(d[4])),s=t(r(d[5])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=N(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var c=u?Object.getOwnPropertyDescriptor(t,s):null;c&&(c.get||c.set)?Object.defineProperty(o,s,c):o[s]=t[s]}o.default=t,l&&l.set(t,o);return o})(r(d[6])),f=r(d[7]),m=r(d[8]),p=r(d[9]),y=r(d[10]),x=t(r(d[11])),h=r(d[12]),b=r(d[13]),v=r(d[14]),w=r(d[15]),E=r(d[16]),P=r(d[17]),S=t(r(d[18])),C=r(d[19]),M=r(d[20]),k=t(r(d[21])),T=t(r(d[22])),I=r(d[23]),O=t(r(d[24])),B=r(d[25]);function N(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(N=function(t){return t?l:n})(t)}var R={attachementButtons:{display:'flex',flexDirection:'row',backgroundColor:'secondary.700',marginTop:20,marginRight:5,width:100,height:35,alignItems:'center',justifyContent:'center',borderRadius:30},touchableIcons:{backgroundColor:'secondary.700',borderRadius:15,width:30,height:30,align:'center',justify:'center',mt:8,mb:8},attachemenetView:{position:'absolute',top:'ios'===f.Platform.OS?-130:-15,left:'ios'===f.Platform.OS?8:48,direction:'ios'===f.Platform.OS?'column':'row'}},U=function(t){var n=t.children;return'ios'===f.Platform.OS?c.default.createElement(m.Box,R.attachemenetView,n):c.default.createElement(m.Flex,R.attachemenetView,n)},j=function(t){var N=(0,b.useDispatch)(),j=(0,c.useContext)(p.ConfigServiceContext),z=(j.meeting,j.sessionConfig),L=z.permissions.chat.public.can_send,_=(0,c.useContext)(h.ThemeContext).colors,A=(0,f.useWindowDimensions)(),D=(0,b.useSelector)(function(t){return t.room.chatMessages}),F=(0,c.useContext)(w.PeersServiceContext).selfPeer,V=(0,B.useScale)(z.theme.dimensions||A),H=V.height,K=V.width,W=c.default.useState(''),$=(0,s.default)(W,2),q=$[0],G=$[1],J=c.default.useState(!1),Q=(0,s.default)(J,2),X=Q[0],Y=Q[1],Z=(0,c.useContext)(E.MediaRoomContext).mediaRoom,ee=c.default.useState(!1),te=(0,s.default)(ee,2),ae=te[0],re=te[1],ne=(0,c.useState)([]),le=(0,s.default)(ne,2),oe=le[0],ue=le[1],ie=(0,b.useSelector)(function(t){return t.room.roomName}),se=(0,b.useSelector)(function(t){return t.room.polls}),de=D.filter(function(t){return!0!==t.read}),ce=(0,C.useMutation)("\n mutation($file: Upload!, $roomName: String!) {\n uploadFile(file: $file, roomName: $roomName) {\n link\n }\n }\n"),fe=((0,s.default)(ce,1)[0],'LANDSCAPE'===c.default.useContext(I.OrientationContext).orientation);function me(t,n,l){Z.votePoll({index:l,pollId:t})}(0,c.useEffect)(function(){var t=(0,u.default)(D);ue(t.reverse().map(function(t){var n={type:t.type,createdAt:t.time,_id:Math.round(1e6*Math.random()),user:{_id:t.userId,name:t.displayName}};if(t.type===v.MessageTypes.text)return(0,o.default)({},n,{text:t.message});if(t.type===v.MessageTypes.image)return(0,o.default)({},n,{image:t.link});if(t.type===v.MessageTypes.file)return(0,o.default)({},n,{text:t.name,link:t.link});if(t.type===v.MessageTypes.poll){var l=t.pollId,u=se[l],s=u.options,c=u.question,f=F.userId;return(0,o.default)({},n,{text:c,polls:{pollId:l,options:s.map(function(t){return t.votes.find(function(t){return t.id===f})?(0,o.default)({},t,{selected:!0}):(0,o.default)({},t,{selected:!1})}),onOptionSelected:me}})}return{}}))},[D,se]),(0,c.useEffect)(function(){var t;de.length>0&&N((0,M.markMessagesRead)((t={},(0,l.default)(t,v.MessageTypes.text,!0),(0,l.default)(t,v.MessageTypes.file,!0),(0,l.default)(t,v.MessageTypes.image,!0),(0,l.default)(t,v.MessageTypes.poll,!0),t)))},[de]);var pe=function(){if(''!==q){var t={message:q,userId:F.userId,displayName:F.displayName,type:v.MessageTypes.text,time:(new Date).getTime()};Z.sendMessage(t),G('')}},ge=function(t,n,l){var o={displayName:F.displayName,type:v.MessageTypes.file,link:t,userId:F.id,name:n,size:l};Z.sendMessage(o)},ye=function(t){var l,o;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,n.default.awrap(fetch(t));case 2:return l=u.sent,u.next=5,n.default.awrap(l.blob());case 5:return o=u.sent,u.abrupt("return",o);case 7:case"end":return u.stop()}},null,null,null,Promise)};function xe(t,l,o){var u;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.default.awrap(ye(o));case 2:return u=s.sent,s.next=5,n.default.awrap(fetch(l,{method:'PUT',headers:{'Content-Type':t.type},body:u}));case 5:case"end":return s.stop()}},null,null,null,Promise)}function he(t){var l,o,u,s,c;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return l=O.default.apiBase+"/v1/meetings/genPreSignedUploadUrl",f.next=3,n.default.awrap(fetch(l,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({roomName:ie,filename:t.name})}));case 3:return o=f.sent,f.next=6,n.default.awrap(o.json());case 6:return u=f.sent.data,s=u.getLocation,c=u.putLocation,f.abrupt("return",{getURL:s,putURL:c});case 10:case"end":return f.stop()}},null,null,null,Promise)}var be=function(t){f.Alert.alert('Error',"Error: "+(t||'Problem uploading image'),[{text:'OK'}]),re(!1)},ve=function(){try{ae||(re(!0),Y(!1),(0,P.launchImageLibrary)({mediaType:'photo'},function(t){var l,o,u,s,c,m,p,y,x;return n.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=t.uri,o=t.didCancel,u=t.errorCode,s=t.errorMessage,c=t.fileName,m=t.type,p=t.fileSize,!o){h.next=5;break}re(!1),h.next=19;break;case 5:if(!u){h.next=10;break}console.log('Error Uploading Image:',u,s),be(s),h.next=19;break;case 10:return y={name:c,type:m,uri:l},p>5e6&&f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),h.next=14,n.default.awrap(he(y));case 14:return x=h.sent,h.next=17,n.default.awrap(xe(y,x.putURL,y.uri));case 17:b=x.getURL,w={displayName:F.displayName,type:v.MessageTypes.image,link:b,userId:F.id},Z.sendMessage(w),re(!1);case 19:case"end":return h.stop()}var b,w},null,null,null,Promise)}))}catch(t){console.log('Error Uploading Image:',t),be()}},we=function(){var t,l,o,u,s,c;return n.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:if(ae){m.next=24;break}return re(!0),Y(!1),m.prev=3,m.next=6,n.default.awrap(S.default.pick({type:[S.default.types.allFiles]}));case 6:if(t=m.sent,l=t.uri,o=t.name,u=t.size,s={displayName:F.displayName,type:v.MessageTypes.file,link:l,userId:F.id,name:o,size:u},!(u>5e6)){m.next=12;break}return f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),m.abrupt("return");case 12:return m.next=14,n.default.awrap(he(s));case 14:return c=m.sent,m.next=17,n.default.awrap(xe(s,c.putURL,s.link));case 17:ge(c.getURL,o,u),re(!1),m.next=24;break;case 21:m.prev=21,m.t0=m.catch(3),S.default.isCancel(m.t0)?re(!1):be();case 24:case"end":return m.stop()}},null,null,[[3,21]],Promise)};return c.default.createElement(m.Flex,{height:H-50,align:"center",width:K},c.default.createElement(k.default,null,c.default.createElement(y.GiftedChat,{messagesContainerStyle:{paddingTop:60},messages:oe,alwaysShowSend:!0,renderAvatarOnTop:!0,renderUsernameOnMessage:!0,isKeyboardInternallyHandled:!1,timeTextStyle:{left:{color:_.textPrimary[400]},right:{color:_.textPrimary[400]}},renderAvatar:function(t){return c.default.createElement(x.default,{name:t.currentMessage.user.name,bgColor:_.primary[700]})},renderBubble:function(t){var n=t.currentMessage;return n.type,n.link,n.text,c.default.createElement(y.Bubble,(0,o.default)({},t,{wrapperStyle:{left:{backgroundColor:_.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3},right:{backgroundColor:_.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3}},textStyle:{left:{color:_.textPrimary[100]},right:{color:_.textPrimary[100]}}}))},renderInputToolbar:function(t){return L&&c.default.createElement(m.Flex,{width:fe?K-60:K-20,direction:"row",justify:"space-between",align:"center",bg:"secondary.800",borderRadius:"50px",height:50},c.default.createElement(m.Box,null,c.default.createElement(m.Button,{onClick:function(){Y(!X)}},c.default.createElement(m.Box,(0,m.mergeStyles)(R.touchableIcons,{ml:8}),X?c.default.createElement(m.Icon,{name:"close",fill:"textPrimary.100",boxSize:"sm"}):c.default.createElement(m.Icon,{name:"plus-thick",fill:"textPrimary.100",boxSize:"sm"}))),X&&c.default.createElement(U,null,c.default.createElement(m.Button,{onClick:ve},c.default.createElement(m.Box,R.attachementButtons,c.default.createElement(m.Icon,{name:"image",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:8}," Images"))),c.default.createElement(m.Button,{onClick:we},c.default.createElement(m.Box,(0,m.mergeStyles)(R.attachementButtons,{width:'ios'===f.Platform.OS?150:120}),c.default.createElement(m.Icon,{name:"attach-file",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:'ios'===f.Platform.OS?8:0},' ',"Attachments"))))),c.default.createElement(f.TextInput,{style:{color:_.textPrimary[300],paddingHorizontal:5,height:40,width:fe?K-160:K-120},onChangeText:G,value:q}),c.default.createElement(m.Button,{onClick:pe,height:40,width:40},c.default.createElement(m.Box,(0,m.mergeStyles)(R.touchableIcons,{backgroundColor:'primary.500',mr:8}),c.default.createElement(m.Icon,{name:"send",fill:"textPrimary.100",boxSize:"md"}))))},user:{_id:F.userId,name:F.displayName}})))};e.default=j},725,[1,67,261,22,49,41,165,2,512,508,726,682,514,432,718,674,585,790,791,465,480,792,676,575,504,493]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0});var n=r(d[0]);Object.keys(n).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===n[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}}))})},726,[727]); __d(function(g,r,i,a,m,_e2,d){var e=r(d[0]);Object.defineProperty(_e2,"__esModule",{value:!0});var t={GiftedChat:!0,utils:!0,Actions:!0,Avatar:!0,Bubble:!0,SystemMessage:!0,MessageImage:!0,MessageText:!0,Composer:!0,Day:!0,InputToolbar:!0,LoadEarlier:!0,Message:!0,MessageContainer:!0,Send:!0,Time:!0,GiftedAvatar:!0};Object.defineProperty(_e2,"Actions",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(_e2,"Avatar",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(_e2,"Bubble",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(_e2,"Composer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(_e2,"Day",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(_e2,"GiftedAvatar",{enumerable:!0,get:function(){return E.default}}),_e2.GiftedChat=void 0,Object.defineProperty(_e2,"InputToolbar",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(_e2,"LoadEarlier",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(_e2,"Message",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(_e2,"MessageContainer",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(_e2,"MessageImage",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(_e2,"MessageText",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(_e2,"Send",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(_e2,"SystemMessage",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(_e2,"Time",{enumerable:!0,get:function(){return D.default}}),_e2.utils=void 0;var n=e(r(d[1])),o=e(r(d[2])),s=e(r(d[3])),u=e(r(d[4])),l=e(r(d[5])),f=e(r(d[6])),p=e(r(d[7])),h=e(r(d[8])),c=e(r(d[9])),y=r(d[10]),b=r(d[11]),v=e(r(d[12])),I=r(d[13]),x=e(r(d[14])),T=e(r(d[15])),H=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=V(t);if(n&&n.has(e))return n.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var l=s?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(o,u,l):o[u]=e[u]}o.default=e,n&&n.set(e,o);return o})(r(d[16]));_e2.utils=H;var C=e(r(d[17])),M=e(r(d[18])),S=e(r(d[19])),P=e(r(d[20])),O=e(r(d[21])),k=e(r(d[22])),L=e(r(d[23])),_=e(r(d[24])),A=e(r(d[25])),w=e(r(d[26])),F=e(r(d[27])),K=e(r(d[28])),j=e(r(d[29])),D=e(r(d[30])),E=e(r(d[31])),W=r(d[32]),R=r(d[33]);Object.keys(R).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(t,e)||e in _e2&&_e2[e]===R[e]||Object.defineProperty(_e2,e,{enumerable:!0,get:function(){return R[e]}}))});var B=["messagesContainerStyle"];function V(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(V=function(e){return e?n:t})(e)}function G(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}x.default.extend(T.default);var U=(function(e){(0,l.default)(x,e);var t,h,v=(t=x,h=G(),function(){var e,n=(0,p.default)(t);if(h){var o=(0,p.default)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return(0,f.default)(this,e)});function x(e){var t;return(0,s.default)(this,x),(t=v.call(this,e))._isMounted=!1,t._keyboardHeight=0,t._bottomOffset=0,t._maxHeight=void 0,t._isFirstLayout=!0,t._locale='en',t.invertibleScrollViewProps=void 0,t._actionSheetRef=void 0,t._messageContainerRef=c.default.createRef(),t._isTextInputWasFocused=!1,t.state={isInitialized:!1,composerHeight:t.props.minComposerHeight,messagesContainerHeight:void 0,typingDisabled:!1,text:void 0,messages:void 0},t.getLocale=function(){return t._locale},t.safeAreaSupport=function(e){return null!=e?e:(0,I.getBottomSpace)()},t.onKeyboardWillShow=function(e){if(t.handleTextInputFocusWhenKeyboardShow(),t.props.isKeyboardInternallyHandled){t.setIsTypingDisabled(!0),t.setKeyboardHeight(e.endCoordinates?e.endCoordinates.height:e.end.height),t.setBottomOffset(t.safeAreaSupport(t.props.bottomOffset));var n=t.getMessagesContainerHeightWithKeyboard();t.setState({messagesContainerHeight:n})}},t.onKeyboardWillHide=function(e){if(t.handleTextInputFocusWhenKeyboardHide(),t.props.isKeyboardInternallyHandled){t.setIsTypingDisabled(!0),t.setKeyboardHeight(0),t.setBottomOffset(0);var n=t.getBasicMessagesContainerHeight();t.setState({messagesContainerHeight:n})}},t.onKeyboardDidShow=function(e){'android'===y.Platform.OS&&t.onKeyboardWillShow(e),t.setIsTypingDisabled(!1)},t.onKeyboardDidHide=function(e){'android'===y.Platform.OS&&t.onKeyboardWillHide(e),t.setIsTypingDisabled(!1)},t.onSend=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Array.isArray(e)||(e=[e]);var s=e.map(function(e){return(0,o.default)({},e,{user:t.props.user,createdAt:new Date,_id:t.props.messageIdGenerator&&t.props.messageIdGenerator()})});!0===n&&(t.setIsTypingDisabled(!0),t.resetInputToolbar()),t.props.onSend&&t.props.onSend(s),!0===n&&setTimeout(function(){!0===t.getIsMounted()&&t.setIsTypingDisabled(!1)},100)},t.onInputSizeChanged=function(e){var n=Math.max(t.props.minComposerHeight,Math.min(t.props.maxComposerHeight,e.height)),o=t.getMessagesContainerHeightWithKeyboard(n);t.setState({composerHeight:n,messagesContainerHeight:o})},t.onInputTextChanged=function(e){t.getIsTypingDisabled()||(t.props.onInputTextChanged&&t.props.onInputTextChanged(e),void 0===t.props.text&&t.setState({text:e}))},t.onInitialLayoutViewLayout=function(e){var n=e.nativeEvent.layout;if(!(n.height<=0)){t.notifyInputTextReset(),t.setMaxHeight(n.height);var o=t.props.minComposerHeight,s=t.getMessagesContainerHeightWithKeyboard(o),u=t.props.initialText||'';t.setState({isInitialized:!0,text:t.getTextFromProp(u),composerHeight:o,messagesContainerHeight:s})}},t.onMainViewLayout=function(e){var n=e.nativeEvent.layout;t.getMaxHeight()===n.height&&!0!==t.getIsFirstLayout()||(t.setMaxHeight(n.height),t.setState({messagesContainerHeight:t._keyboardHeight>0?t.getMessagesContainerHeightWithKeyboard():t.getBasicMessagesContainerHeight()})),!0===t.getIsFirstLayout()&&t.setIsFirstLayout(!1)},t.invertibleScrollViewProps={inverted:t.props.inverted,keyboardShouldPersistTaps:t.props.keyboardShouldPersistTaps,onKeyboardWillShow:t.onKeyboardWillShow,onKeyboardWillHide:t.onKeyboardWillHide,onKeyboardDidShow:t.onKeyboardDidShow,onKeyboardDidHide:t.onKeyboardDidHide},t}return(0,u.default)(x,[{key:"getChildContext",value:function(){var e=this;return{actionSheet:this.props.actionSheet||function(){return e._actionSheetRef.getContext()},getLocale:this.getLocale}}},{key:"componentDidMount",value:function(){var e=this.props,t=e.messages,n=e.text;this.setIsMounted(!0),this.initLocale(),this.setMessages(t||[]),this.setTextFromProp(n)}},{key:"componentWillUnmount",value:function(){this.setIsMounted(!1)}},{key:"componentDidUpdate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,o=n.messages,s=n.text,u=n.inverted;this.props!==t&&this.setMessages(o||[]),!1===u&&o&&t.messages&&o.length!==t.messages.length&&setTimeout(function(){return e.scrollToBottom(!1)},200),s!==t.text&&this.setTextFromProp(s)}},{key:"initLocale",value:function(){null===this.props.locale?this.setLocale('en'):this.setLocale(this.props.locale||'en')}},{key:"setLocale",value:function(e){this._locale=e}},{key:"setTextFromProp",value:function(e){void 0!==e&&e!==this.state.text&&this.setState({text:e})}},{key:"getTextFromProp",value:function(e){return void 0===this.props.text?e:this.props.text}},{key:"setMessages",value:function(e){this.setState({messages:e})}},{key:"getMessages",value:function(){return this.state.messages}},{key:"setMaxHeight",value:function(e){this._maxHeight=e}},{key:"getMaxHeight",value:function(){return this._maxHeight}},{key:"setKeyboardHeight",value:function(e){this._keyboardHeight=e}},{key:"getKeyboardHeight",value:function(){return'android'!==y.Platform.OS||this.props.forceGetKeyboardHeight?this._keyboardHeight:0}},{key:"setBottomOffset",value:function(e){this._bottomOffset=e}},{key:"getBottomOffset",value:function(){return this._bottomOffset}},{key:"setIsFirstLayout",value:function(e){this._isFirstLayout=e}},{key:"getIsFirstLayout",value:function(){return this._isFirstLayout}},{key:"setIsTypingDisabled",value:function(e){this.setState({typingDisabled:e})}},{key:"getIsTypingDisabled",value:function(){return this.state.typingDisabled}},{key:"setIsMounted",value:function(e){this._isMounted=e}},{key:"getIsMounted",value:function(){return this._isMounted}},{key:"getMinInputToolbarHeight",value:function(){return this.props.renderAccessory?2*this.props.minInputToolbarHeight:this.props.minInputToolbarHeight}},{key:"calculateInputToolbarHeight",value:function(e){return e+(this.getMinInputToolbarHeight()-this.props.minComposerHeight)}},{key:"getBasicMessagesContainerHeight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.composerHeight;return this.getMaxHeight()-this.calculateInputToolbarHeight(e)}},{key:"getMessagesContainerHeightWithKeyboard",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.composerHeight;return this.getBasicMessagesContainerHeight(e)-this.getKeyboardHeight()+this.getBottomOffset()}},{key:"handleTextInputFocusWhenKeyboardHide",value:function(){var e;this._isTextInputWasFocused||(this._isTextInputWasFocused=(null==(e=this.textInput)?void 0:e.isFocused())||!1)}},{key:"handleTextInputFocusWhenKeyboardShow",value:function(){this.textInput&&this._isTextInputWasFocused&&!this.textInput.isFocused()&&this.textInput.focus(),this._isTextInputWasFocused=!1}},{key:"scrollToBottom",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._messageContainerRef&&this._messageContainerRef.current&&(this.props.inverted?this._messageContainerRef.current.scrollToOffset({offset:0,animated:e}):this._messageContainerRef.current.scrollToEnd({animated:e}))}},{key:"renderMessages",value:function(){var e=this.props,t=e.messagesContainerStyle,s=(0,n.default)(e,B),u=c.default.createElement(y.View,{style:[{height:this.state.messagesContainerHeight},t]},c.default.createElement(K.default,(0,o.default)({},s,{invertibleScrollViewProps:this.invertibleScrollViewProps,messages:this.getMessages(),forwardRef:this._messageContainerRef,isTyping:this.props.isTyping})),this.renderChatFooter());return this.props.isKeyboardInternallyHandled?c.default.createElement(y.KeyboardAvoidingView,{enabled:!0},u):u}},{key:"resetInputToolbar",value:function(){this.textInput&&this.textInput.clear(),this.notifyInputTextReset();var e=this.props.minComposerHeight,t=this.getMessagesContainerHeightWithKeyboard(e);this.setState({text:this.getTextFromProp(''),composerHeight:e,messagesContainerHeight:t})}},{key:"focusTextInput",value:function(){this.textInput&&this.textInput.focus()}},{key:"notifyInputTextReset",value:function(){this.props.onInputTextChanged&&this.props.onInputTextChanged('')}},{key:"renderInputToolbar",value:function(){var e=this,t=(0,o.default)({},this.props,{text:this.getTextFromProp(this.state.text),composerHeight:Math.max(this.props.minComposerHeight,this.state.composerHeight),onSend:this.onSend,onInputSizeChanged:this.onInputSizeChanged,onTextChanged:this.onInputTextChanged,textInputProps:(0,o.default)({},this.props.textInputProps,{ref:function(t){return e.textInput=t},maxLength:this.getIsTypingDisabled()?0:this.props.maxInputLength})});return this.props.renderInputToolbar?this.props.renderInputToolbar(t):c.default.createElement(A.default,t)}},{key:"renderChatFooter",value:function(){return this.props.renderChatFooter?this.props.renderChatFooter():null}},{key:"renderLoading",value:function(){return this.props.renderLoading?this.props.renderLoading():null}},{key:"render",value:function(){var e=this;if(!0===this.state.isInitialized){var t=this.props.wrapInSafeArea?y.SafeAreaView:y.View;return c.default.createElement(t,{style:z.safeArea},c.default.createElement(b.ActionSheetProvider,{ref:function(t){return e._actionSheetRef=t}},c.default.createElement(y.View,{style:z.container,onLayout:this.onMainViewLayout},this.renderMessages(),this.renderInputToolbar())))}return c.default.createElement(y.View,{style:z.container,onLayout:this.onInitialLayoutViewLayout},this.renderLoading())}}],[{key:"append",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Array.isArray(t)||(t=[t]),n?t.concat(e):e.concat(t)}},{key:"prepend",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Array.isArray(t)||(t=[t]),n?e.concat(t):t.concat(e)}}]),x})(c.default.Component);_e2.GiftedChat=U,U.childContextTypes={actionSheet:h.default.func,getLocale:h.default.func},U.defaultProps={messages:[],messagesContainerStyle:void 0,text:void 0,placeholder:W.DEFAULT_PLACEHOLDER,disableComposer:!1,messageIdGenerator:function(){return v.default.v4()},user:{},onSend:function(){},locale:null,timeFormat:W.TIME_FORMAT,dateFormat:W.DATE_FORMAT,loadEarlier:!1,onLoadEarlier:function(){},isLoadingEarlier:!1,renderLoading:null,renderLoadEarlier:null,renderAvatar:void 0,showUserAvatar:!1,actionSheet:null,onPressAvatar:null,onLongPressAvatar:null,renderUsernameOnMessage:!1,renderAvatarOnTop:!1,renderBubble:null,renderSystemMessage:null,onLongPress:null,renderMessage:null,renderMessageText:null,renderMessageImage:null,renderMessageVideo:null,renderMessageAudio:null,imageProps:{},videoProps:{},audioProps:{},lightboxProps:{},textInputProps:{},listViewProps:{},renderCustomView:null,isCustomViewBottom:!1,renderDay:null,renderTime:null,renderFooter:null,renderChatEmpty:null,renderChatFooter:null,renderInputToolbar:null,renderComposer:null,renderActions:null,renderSend:null,renderAccessory:null,isKeyboardInternallyHandled:!0,onPressActionButton:null,bottomOffset:null,minInputToolbarHeight:44,keyboardShouldPersistTaps:y.Platform.select({ios:'never',android:'always',default:'never'}),onInputTextChanged:null,maxInputLength:null,forceGetKeyboardHeight:!1,inverted:!0,extraData:null,minComposerHeight:W.MIN_COMPOSER_HEIGHT,maxComposerHeight:W.MAX_COMPOSER_HEIGHT,wrapInSafeArea:!0},U.propTypes={messages:h.default.arrayOf(h.default.object),messagesContainerStyle:H.StylePropType,text:h.default.string,initialText:h.default.string,placeholder:h.default.string,disableComposer:h.default.bool,messageIdGenerator:h.default.func,user:h.default.object,onSend:h.default.func,locale:h.default.string,timeFormat:h.default.string,dateFormat:h.default.string,isKeyboardInternallyHandled:h.default.bool,loadEarlier:h.default.bool,onLoadEarlier:h.default.func,isLoadingEarlier:h.default.bool,renderLoading:h.default.func,renderLoadEarlier:h.default.func,renderAvatar:h.default.func,showUserAvatar:h.default.bool,actionSheet:h.default.func,onPressAvatar:h.default.func,onLongPressAvatar:h.default.func,renderUsernameOnMessage:h.default.bool,renderAvatarOnTop:h.default.bool,isCustomViewBottom:h.default.bool,renderBubble:h.default.func,renderSystemMessage:h.default.func,onLongPress:h.default.func,renderMessage:h.default.func,renderMessageText:h.default.func,renderMessageImage:h.default.func,imageProps:h.default.object,videoProps:h.default.object,audioProps:h.default.object,lightboxProps:h.default.object,renderCustomView:h.default.func,renderDay:h.default.func,renderTime:h.default.func,renderFooter:h.default.func,renderChatEmpty:h.default.func,renderChatFooter:h.default.func,renderInputToolbar:h.default.func,renderComposer:h.default.func,renderActions:h.default.func,renderSend:h.default.func,renderAccessory:h.default.func,onPressActionButton:h.default.func,bottomOffset:h.default.number,minInputToolbarHeight:h.default.number,listViewProps:h.default.object,keyboardShouldPersistTaps:h.default.oneOf(['always','never','handled']),onInputTextChanged:h.default.func,maxInputLength:h.default.number,forceGetKeyboardHeight:h.default.bool,inverted:h.default.bool,textInputProps:h.default.object,extraData:h.default.object,minComposerHeight:h.default.number,maxComposerHeight:h.default.number,alignTop:h.default.bool,wrapInSafeArea:h.default.bool};var z=y.StyleSheet.create({container:{flex:1},safeArea:{flex:1}})},727,[1,96,22,9,10,12,14,17,204,165,2,728,734,749,750,751,752,753,755,757,774,766,759,775,776,777,779,780,781,778,772,756,773,789]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0});var n={ActionSheetProvider:!0,connectActionSheet:!0,useActionSheet:!0};Object.defineProperty(e,"ActionSheetProvider",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"connectActionSheet",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"useActionSheet",{enumerable:!0,get:function(){return u.useActionSheet}});var o=t(r(d[1])),c=t(r(d[2])),u=r(d[3]),f=r(d[4]);Object.keys(f).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(n,t)||t in e&&e[t]===f[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return f[t]}}))})},728,[1,729,732,731,733]); @@ -796,7 +796,7 @@ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0})},78 __d(function(g,r,i,a,m,e,d){var o=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.launchCamera=function(o,u){if('function'!=typeof u)return void console.error('Send proper callback function, check API');c.NativeModules.DyteImagePickerManager.launchCamera((0,n.default)({},t,o),u)},e.launchImageLibrary=function(o,u){if('function'!=typeof u)return void console.error('Send proper callback function, check API');c.NativeModules.DyteImagePickerManager.launchImageLibrary((0,n.default)({},t,o),u)};var n=o(r(d[1])),c=r(d[2]),t={mediaType:'photo',videoQuality:'high',quality:1,maxWidth:0,maxHeight:0,includeBase64:!1,saveToPhotos:!1,durationLimit:0,cameraType:'back'}},790,[1,22,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=t(r(d[1])),p=t(r(d[2])),n=t(r(d[3])),s=r(d[4]),c=s.NativeModules.DyteRNDocumentPicker;function l(t){if('filetype'in t)throw new TypeError('A `filetype` option was passed to DocumentPicker.pick, the correct option is `type`');if('types'in t)throw new TypeError('A `types` option was passed to DocumentPicker.pick, the correct option is `type`');if('type'in t||(t.type=x.types.allFiles),t.type=Array.isArray(t.type)?t.type:[t.type],t.type.some(function(t){return void 0===t}))throw new TypeError('Unexpected undefined type option, did you try using a DocumentPicker.types.* that does not exist?');if(Array.isArray(t.type)&&t.type.length<1)throw new TypeError('`type` option should not be an empty array, at least one type must be passed if the `type` option is not omitted');if(t.type.forEach(function(t){if('string'!=typeof t)throw new TypeError("Invalid type option, expected a string not: "+t)}),t.type.length>1&&'android'===s.Platform.OS&&s.Platform.Version<19&&console.warn("RNDocumentPicker: Android API level "+s.Platform.Version+" does not support multiple types, falling back to */*"),Array.isArray(t.type)&&t.type.length>1&&t.type.includes('folder'))throw new TypeError('When type array is folder then other options are not supported');if('mode'in t&&!['import','open'].includes(t.mode))throw new TypeError("Invalid mode option: "+t.mode);if('copyTo'in t&&!['cachesDirectory','documentDirectory'].includes(t.copyTo))throw new TypeError("Invalid copyTo option: "+t.copyTo);return c.pick(t)}function u(t){if('ios'===s.Platform.OS){if(!Array.isArray(t))throw new TypeError('`uris` should be an array of strings');t.forEach(function(t){if('string'!=typeof t)throw new TypeError("Invalid uri parameter, expected a string not: "+t)}),c.releaseSecureAccess(t)}}var f={mimeTypes:{allFiles:'*/*',audio:'audio/*',csv:'text/csv',doc:'application/msword',docx:'application/vnd.openxmlformats-officedocument.wordprocessingml.document',images:'image/*',pdf:'application/pdf',plainText:'text/plain',ppt:'application/vnd.ms-powerpoint',pptx:'application/vnd.openxmlformats-officedocument.presentationml.presentation',video:'video/*',xls:'application/vnd.ms-excel',xlsx:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',zip:'application/zip'},utis:{allFiles:'public.item',audio:'public.audio',csv:'public.comma-separated-values-text',doc:'com.microsoft.word.doc',docx:'org.openxmlformats.wordprocessingml.document',images:'public.image',pdf:'com.adobe.pdf',plainText:'public.plain-text',ppt:'com.microsoft.powerpoint.ppt',pptx:'org.openxmlformats.presentationml.presentation',video:'public.movie',xls:'com.microsoft.excel.xls',xlsx:'org.openxmlformats.spreadsheetml.sheet',zip:'public.zip-archive'},extensions:{allFiles:'*',audio:'.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma',csv:'.csv',doc:'.doc',docx:'.docx',images:'.jpeg .jpg .png',pdf:'.pdf',plainText:'.txt',ppt:'.ppt',pptx:'.pptx',video:'.mp4',xls:'.xls',xlsx:'.xlsx',zip:'.zip .gz',folder:'folder'}},y={android:f.mimeTypes,ios:f.utis,windows:f.extensions},x=(function(){function t(){(0,p.default)(this,t)}return(0,n.default)(t,null,[{key:"pick",value:function(t){return l((0,o.default)({},t,{multiple:!1})).then(function(t){return t[0]})}},{key:"pickMultiple",value:function(t){return l((0,o.default)({},t,{multiple:!0}))}},{key:"isCancel",value:function(t){return t&&"DOCUMENT_PICKER_CANCELED"===t.code}},{key:"releaseSecureAccess",value:function(t){u(t)}}]),t})();e.default=x,x.types=y[s.Platform.OS]||f.mimeTypes},791,[1,22,9,10,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),o=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=l(n);if(o&&o.has(t))return o.get(t);var u={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var s=f?Object.getOwnPropertyDescriptor(t,c):null;s&&(s.get||s.set)?Object.defineProperty(u,c,s):u[c]=t[c]}u.default=t,o&&o.set(t,u);return u})(r(d[2])),u=r(d[3]);function l(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(l=function(t){return t?o:n})(t)}var f=function(t){var l=t.children,f=t.useNativeDriver,c=void 0!==f&&f,s=o.useState('android'===u.Platform.OS?0:new u.Animated.Value(0)),v=(0,n.default)(s,2),p=v[0],y=v[1],b=o.useRef(null),O=o.useRef(null),h=function(t){'android'===u.Platform.OS?y(t.endCoordinates?t.endCoordinates.height:t.end.height):u.Animated.parallel([u.Animated.timing(p,{duration:t.duration,toValue:t.endCoordinates.height,useNativeDriver:c})]).start()},P=function(t){'android'===u.Platform.OS?y(0):u.Animated.parallel([u.Animated.timing(p,{duration:t.duration,toValue:0,useNativeDriver:c})]).start()};return o.useEffect(function(){return b.current=u.Keyboard.addListener('android'===u.Platform.OS?'keyboardDidShow':'keyboardWillShow',h),O.current=u.Keyboard.addListener('android'===u.Platform.OS?'keyboardDidHide':'keyboardWillHide',P),function(){var t,n;null==(t=b.current)||t.remove(),null==(n=O.current)||n.remove(),b.current=null,O.current=null}},[]),'android'===u.Platform.OS?o.createElement(u.View,{style:{bottom:p?50:p}},l,o.createElement(u.KeyboardAvoidingView,{behavior:"padding",keyboardVerticalOffset:-p/2})):o.createElement(u.Animated.View,{style:{paddingBottom:p,flex:1}},l)};e.default=f},792,[1,41,165,2]); -__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,o.useContext)(h.ConfigServiceContext).sessionConfig,C=t.permissions.polls.can_create,w=(0,p.useDisclosure)(),P=w.isOpen,O=w.onClose,j=w.onOpen,M=(0,o.useContext)(f.MediaRoomContext).mediaRoom,B=(0,o.useContext)(s.PeersServiceContext).selfPeer,S=(0,u.useSelector)(function(t){return t.room.polls}),_=(0,n.useWindowDimensions)(),k=t.theme.dimensions||_,T=k.height,D=k.width,F=(Math.floor(2*T/3),function(){var t=P?O:j;t()}),R=(0,u.useSelector)(function(t){return t.room.chatMessages}).filter(function(t){return!0!==t.read&&t.type===x.MessageTypes.poll}),W=(0,u.useDispatch)();(0,o.useEffect)(function(){R.length>0&&W((0,m.markMessagesRead)((0,l.default)({},x.MessageTypes.poll,!0)))},[R]);var N=Object.values(S);return o.default.createElement(c.Flex,{height:T-30,width:D,direction:"column",justifyContent:"space-between",overflowY:"auto",px:10,pb:10,pt:50},o.default.createElement(c.Flex,null,o.default.createElement(c.Box,{overflowY:"auto",className:"dyte-client-noScrollbar"},P?o.default.createElement(c.Box,null,P&&o.default.createElement(b.default,{toggle:F})):o.default.createElement(o.default.Fragment,null,N.length>0?o.default.createElement(n.ScrollView,{style:{height:C?T-150:T},contentContainerStyle:{paddingBottom:C?0:120}},o.default.createElement(n.TouchableWithoutFeedback,null,o.default.createElement(c.Box,null,N.map(function(t,l){return o.default.createElement(c.Box,{my:10},o.default.createElement(c.Text,{ml:4},t.createdBy?"Poll by "+t.createdBy:''),o.default.createElement(c.Box,{mt:1,className:"dyte-client-bubble dyte-client-other dyte-client-type-3"},o.default.createElement(E.default,{mediaRoom:M,poll:t,selfPeer:B})))})))):o.default.createElement(c.Flex,{height:T-150,width:D,align:"center",justify:"center"},o.default.createElement(c.Text,{fontSize:"lg",color:v.colors.textPrimary[100]},"No Polls created yet."))))),C&&o.default.createElement(c.Button,{fontSize:"16",onClick:F},o.default.createElement(c.Box,{bg:P?'danger.500':'primary.500',p:8,justify:"center",borderRadius:y.default.small},o.default.createElement(c.Text,{textAlign:"center"},P?'Cancel Poll Creation':'Create New Poll'))))};var l=t(r(d[1])),n=r(d[2]),o=(function(t,l){if(!l&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(l);if(n&&n.has(t))return n.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,n&&n.set(t,o);return o})(r(d[3])),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),m=r(d[8]),p=r(d[9]),y=t(r(d[10])),h=r(d[11]),x=r(d[12]),b=t(r(d[13])),E=t(r(d[14])),v=r(d[15]);function C(t){if("function"!=typeof WeakMap)return null;var l=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:l})(t)}},793,[1,261,2,165,432,512,585,674,480,493,676,508,718,794,796,798]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,o.useContext)(h.ConfigServiceContext).sessionConfig,C=t.permissions.polls.can_create,w=(0,p.useDisclosure)(),P=w.isOpen,O=w.onClose,j=w.onOpen,M=(0,o.useContext)(f.MediaRoomContext).mediaRoom,B=(0,o.useContext)(s.PeersServiceContext).selfPeer,S=(0,u.useSelector)(function(t){return t.room.polls}),_=(0,n.useWindowDimensions)(),k=(0,p.useScale)(t.theme.dimensions||_),T=k.height,D=k.width,F=(Math.floor(2*T/3),function(){var t=P?O:j;t()}),R=(0,u.useSelector)(function(t){return t.room.chatMessages}).filter(function(t){return!0!==t.read&&t.type===x.MessageTypes.poll}),W=(0,u.useDispatch)();(0,o.useEffect)(function(){R.length>0&&W((0,m.markMessagesRead)((0,l.default)({},x.MessageTypes.poll,!0)))},[R]);var N=Object.values(S);return o.default.createElement(c.Flex,{height:T-30,width:D,direction:"column",justifyContent:"space-between",overflowY:"auto",px:10,pb:10,pt:50},o.default.createElement(c.Flex,null,o.default.createElement(c.Box,{overflowY:"auto",className:"dyte-client-noScrollbar"},P?o.default.createElement(c.Box,null,P&&o.default.createElement(b.default,{toggle:F})):o.default.createElement(o.default.Fragment,null,N.length>0?o.default.createElement(n.ScrollView,{style:{height:C?T-150:T},contentContainerStyle:{paddingBottom:C?0:120}},o.default.createElement(n.TouchableWithoutFeedback,null,o.default.createElement(c.Box,null,N.map(function(t,l){return o.default.createElement(c.Box,{my:10},o.default.createElement(c.Text,{ml:4},t.createdBy?"Poll by "+t.createdBy:''),o.default.createElement(c.Box,{mt:1,className:"dyte-client-bubble dyte-client-other dyte-client-type-3"},o.default.createElement(E.default,{mediaRoom:M,poll:t,selfPeer:B})))})))):o.default.createElement(c.Flex,{height:T-150,width:D,align:"center",justify:"center"},o.default.createElement(c.Text,{fontSize:"lg",color:v.colors.textPrimary[100]},"No Polls created yet."))))),C&&o.default.createElement(c.Button,{fontSize:"16",onClick:F},o.default.createElement(c.Box,{bg:P?'danger.500':'primary.500',p:8,justify:"center",borderRadius:y.default.small},o.default.createElement(c.Text,{textAlign:"center"},P?'Cancel Poll Creation':'Create New Poll'))))};var l=t(r(d[1])),n=r(d[2]),o=(function(t,l){if(!l&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(l);if(n&&n.has(t))return n.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,n&&n.set(t,o);return o})(r(d[3])),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),m=r(d[8]),p=r(d[9]),y=t(r(d[10])),h=r(d[11]),x=r(d[12]),b=t(r(d[13])),E=t(r(d[14])),v=r(d[15]);function C(t){if("function"!=typeof WeakMap)return null;var l=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:l})(t)}},793,[1,261,2,165,432,512,585,674,480,493,676,508,718,794,796,798]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var C=t.toggle,k=(0,u.useContext)(f.MediaRoomContext).mediaRoom,b=u.default.useState({question:'',options:Array(2).fill(''),anonymous:!1,hideVotes:!0}),v=(0,n.default)(b,2),T=v[0],E=v[1],w=(0,u.useContext)(c.ThemeContext).colors,P=function(t,n){var l=T.options;l[n]=t,E((0,o.default)({},T,{options:l}))},O=function(){var t=T.options;t.push(''),E((0,o.default)({},T,{options:t}))},j=(u.default.useContext(x.OrientationContext).orientation,(0,u.useContext)(p.ConfigServiceContext).sessionConfig),B=(0,l.useWindowDimensions)(),R=(j.theme.dimensions||B).height;return u.default.createElement(l.ScrollView,{style:{height:R-200}},u.default.createElement(s.Box,{py:20,px:10},u.default.createElement(s.VStack,{spacing:4},u.default.createElement(s.Text,{fontSize:"xl",textAlign:"center"},"Poll Question"),u.default.createElement(l.TextInput,{multiline:!0,autoFocus:!1,placeholder:"What is your poll for?",numberOfLines:4,value:T.question,placeholderTextColor:w.textPrimary[400],onChangeText:function(t){E((0,o.default)({},T,{question:t}))},style:[{backgroundColor:w.secondary[800],height:75,color:w.textPrimary[300]},y.default.createPollInputText]}),T.options.map(function(t,o){return u.default.createElement(l.TextInput,{autoFocus:!1,placeholder:"Enter an option",value:T.options[o],placeholderTextColor:w.textPrimary[400],onChangeText:function(t){return P(t,o)},style:[{backgroundColor:w.secondary[800],color:w.textPrimary[300]},y.default.createPollInputText]})}),u.default.createElement(s.Box,{bg:"secondary.700",mt:20,width:125,height:30,alignItems:"center",justifyContent:"center"},u.default.createElement(s.Button,{onClick:function(){return O()}},u.default.createElement(s.Text,null,"+ Add an Option"))),u.default.createElement(s.CheckBox,{rightText:"Anonymous",style:{marginTop:15,paddingRight:10,height:20,justifyContent:'center',borderRadius:h.default.small},rightTextStyle:{color:'white'},checkedCheckBoxColor:"white",uncheckedCheckBoxColor:"white",isChecked:T.anonymous,onClick:function(){var t=!T.anonymous;E((0,o.default)({},T,{anonymous:t}))}}),u.default.createElement(s.CheckBox,{rightText:"Hide Results before Voting",style:{marginTop:15,paddingRight:10,height:20,justifyContent:'center',borderRadius:h.default.small},rightTextStyle:{color:'white'},checkedCheckBoxColor:"white",uncheckedCheckBoxColor:"white",isChecked:T.hideVotes,onClick:function(){var t=!T.hideVotes;E((0,o.default)({},T,{hideVotes:t}))}}),u.default.createElement(s.Box,{mt:10,bg:"primary.500",p:8,mb:5,justify:"center",borderRadius:h.default.small},u.default.createElement(s.Button,{fontSize:"16",onClick:function(){var t=T.question,n=T.options;if(t)if(''===n[0]||''===n[1])l.Alert.alert('Error:','Please add minimum two options',[{text:'OK'}]);else{var u=(0,o.default)({},T);u.options=n.filter(function(t){return''!==t}),k.newPoll(u),C()}else l.Alert.alert('Error:','Question Can\'t be empty',[{text:'OK'}])}},u.default.createElement(s.Text,{textAlign:"center"},"Create Poll"))))))};var o=t(r(d[1])),n=t(r(d[2])),l=r(d[3]),u=(function(t,o){if(!o&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(o);if(n&&n.has(t))return n.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var s=u?Object.getOwnPropertyDescriptor(t,c):null;s&&(s.get||s.set)?Object.defineProperty(l,c,s):l[c]=t[c]}l.default=t,n&&n.set(t,l);return l})(r(d[4])),c=r(d[5]),s=r(d[6]),f=r(d[7]),h=t(r(d[8])),p=r(d[9]),x=r(d[10]),y=t(r(d[11]));function C(t){if("function"!=typeof WeakMap)return null;var o=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:o})(t)}},794,[1,22,41,2,165,514,512,585,676,508,575,795]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(d[1]),n=t(r(d[2])),u=o.StyleSheet.create({createPollInputText:{paddingLeft:15,paddingRight:5,marginTop:20,borderRadius:n.default.medium,paddingTop:10,paddingBottom:10}});e.default=u},795,[1,2,676]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var s=t.selfPeer,p=t.mediaRoom,v=t.poll,x=function(t){try{p.votePoll({index:t,pollId:v.id})}catch(t){l.Alert.alert('Error','Error: Problem casting your vote',[{text:'OK'}])}};if(console.log('Poll',v),v){v.id;var h=Math.max.apply(Math,(0,n.default)(v.options.map(function(t){return t.votes.length})).concat([0]));return o.default.createElement(u.VStack,{spacing:2,direction:"row",bg:"secondary.800",p:12,mt:8,borderRadius:c.default.medium},o.default.createElement(u.Text,{textAlign:"left"},v.question),o.default.createElement(u.Box,{mt:8},v.options.map(function(t,n){return o.default.createElement(u.Flex,{onClick:function(){return x(n)},mb:4},o.default.createElement(f.default,{active:t.votes.length===h&&t.votes.length>0,option:t,index:n,selfId:s.userId,onChange:function(){return x(n)}}))})))}return o.default.createElement(u.Text,{fontStyle:"italic"},"Poll wasn't found or has been deleted")};var n=t(r(d[1])),l=r(d[2]),o=t(r(d[3])),u=r(d[4]),c=t(r(d[5])),f=t(r(d[6]))},796,[1,49,2,165,512,676,797]); @@ -804,7 +804,7 @@ __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{ __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"colors",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"fontSize",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"fontWeight",{enumerable:!0,get:function(){return f.default}});var n=t(r(d[1])),u=t(r(d[2])),f=t(r(d[3]))},798,[1,576,799,800]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var x={xs:'12px',sm:'14px',md:'16px',lg:'18px',xl:'20px'};e.default=x},799,[]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l={light:300,normal:400,medium:500,bold:600};e.default=l},800,[]); -__d(function(g,r,_i,_a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,c.useSelector)(function(t){return t.room.roomViewType}),i=(0,n.useContext)(p.PeersServiceContext),l=i.processedPeers,a=i.selfPeer,s=i.joinedProcessedPeers,y=(0,n.useContext)(x.MediaRoomContext).mediaRoom,T=(0,n.useContext)(b.ConfigServiceContext).sessionConfig,R=(0,o.useWindowDimensions)(),k=(T.theme.dimensions||R).width,C=(0,c.useSelector)(function(t){return t.room.requestToJoinPeersList}),_=C.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.present}),S=C.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.ask});l=[a].concat(l.sort(function(t,n){return t.id.localeCompare(n.id)})).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)});var P=[a].concat(s).filter(function(t){return null==t?void 0:t.webinarHiddenParticipant}).filter(function(t,n,i){return i.findIndex(function(n){return n.id===t.id})===n}),v=[a].concat(s).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)&&t.requestToJoinType===u.RequestToJoinType.ask});l=l.concat(v).filter((q=new Set,function(t){return!q.has(t.id)&&q.add(t.id)}));var q;var A=function(t,n){y.acceptAllRequestToJoinStage([{id:t,requestToJoinType:n,type:f.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT}])},M=function(t){y.rejectRequestToJoinStage(t)};return n.default.createElement(E.Flex,{mt:60,width:k},n.default.createElement(o.ScrollView,{style:{padding:20}},n.default.createElement(o.TouchableWithoutFeedback,null,n.default.createElement(E.Box,null,n.default.createElement(E.Box,{my:20},t===f.DyteViewTypes.webinar&&l.length>0&&n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mb:10},"Presenting (",l.length,")"),l.map(function(i){return n.default.createElement(w,{peer:i,key:i.id,mediaRoom:y,permissions:null==T?void 0:T.permissions,roomViewType:t})})),P.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Attending (",P.length,")"),P.map(function(i){return n.default.createElement(w,{key:i.id,peer:i,mediaRoom:y,permissions:null==T?void 0:T.permissions,roomViewType:t})})),S.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to ask Question (",S.length,")"),S.map(function(t){return n.default.createElement(h,{rejectRequest:M,acceptRequest:A,peer:t,key:t.id,type:"REQUEST_TO_ASK"})})),_.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to Present (",_.length,")"),_.map(function(t){return n.default.createElement(h,{rejectRequest:M,acceptRequest:A,peer:t,key:t.id,type:"REQUEST_TO_PRESENT"})})),n.default.createElement(E.Box,{height:200})))))};var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var i=T(n);if(i&&i.has(t))return i.get(t);var l={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(l,a,u):l[a]=t[a]}l.default=t,i&&i.set(t,l);return l})(r(d[1])),i=r(d[2]),l=t(r(d[3])),o=r(d[4]),a=t(r(d[5])),u=r(d[6]),c=r(d[7]),f=r(d[8]),s=t(r(d[9])),p=r(d[10]),E=r(d[11]),y=t(r(d[12])),x=r(d[13]),b=r(d[14]);function T(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,i=new WeakMap;return(T=function(t){return t?i:n})(t)}function h(t){var o=t.rejectRequest,a=t.acceptRequest,u=t.peer,c=t.type,f=(0,n.useContext)(i.ThemeContext).colors;return n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+u.name,bgColor:f.primary[500]}),n.default.createElement(E.Text,{ml:10,color:f.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:u.name>30?u.name.substring(0,20)+"...":""+u.name,charSize:30}),u.isMe?' (me)':null)),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:6},n.default.createElement(E.Button,{onClick:function(){return a(u.id,c)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"check",fill:f.success[500]}))),n.default.createElement(E.Box,{ml:6},n.default.createElement(E.Button,{onClick:function(){return o(u.id)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"clear",fill:f.danger[500]})))))}function w(t){var o=t.peer,c=t.mediaRoom,p=t.permissions,x=t.roomViewType,T=(0,n.useContext)(i.ThemeContext).colors,h=(0,n.useContext)(b.ConfigServiceContext).participantControls,w=(null==p?void 0:p.pin_participant)||(null==p?void 0:p.can_allow_participant_audio)||(null==p?void 0:p.can_allow_participant_video)||(null==p?void 0:p.kick_participant),R=p.accept_present_requests,k=[];return(w||h.length>0)&&(null!=p&&p.pin_participant&&(o.isPinned?k.push({title:'Unpin',onClick:function(){return c.pin(null)}}):k.push({title:'Pin',onClick:function(){return c.pin(o.id)}})),null!=p&&p.can_allow_participant_audio&&k.push({title:'Mute Audio',onClick:function(){return c.disableAudio(o.id)}}),null!=p&&p.can_allow_participant_video&&k.push({title:'Disable Video',onClick:function(){return c.disableVideo(o.id)}}),null!=p&&p.kick_participant&&!o.isMe&&k.push({title:'Kick',onClick:function(){return c.kick(o.id)}}),x!==f.DyteViewTypes.webinar||o.isMe||!R||o.webinarHiddenParticipant||k.push({title:'Force Stop Presenting',onClick:function(){return c.removePeerFromStage(o.id,f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR)}}),x===f.DyteViewTypes.webinar&&!o.isMe&&R&&k.push({title:'Grant Premission to Present',onClick:function(){return c.acceptAllRequestToJoinStage([{id:o.id,requestToJoinType:u.RequestToJoinType.present,type:f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR}])}}),h.forEach(function(t){o.isMe&&!1===t.showSelf||k.push({title:t.label,onClick:function(){return t.onClick(o.id)}})}),k.push({title:'Cancel',onClick:function(){}})),n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+o.displayName,bgColor:T.primary[500]}),n.default.createElement(E.HStack,{ml:10,color:T.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:o.displayName.length>30?o.displayName.substring(0,20)+"...":""+o.displayName,charSize:30}),(o.isMe||o.label)&&n.default.createElement(E.Text,{background:"primary.300",color:"textPrimary.100",pr:4,ml:4,borderRadius:3},o.isMe?'me':o.label))),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:8},o.producingAudio?n.default.createElement(E.Icon,{boxSize:"xl",name:"mic",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"mic-off",fill:T.danger[500]})),o.producingVideo?n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam-off",fill:T.danger[500]}),(w||h.length>0)&&n.default.createElement(a.default,{options:k.map(function(t){return t.title}),actions:k.map(function(t){return t.onClick})})))}},801,[1,165,514,682,2,802,487,432,497,676,674,512,692,585,508]); +__d(function(g,r,_i,_a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,c.useSelector)(function(t){return t.room.roomViewType}),i=(0,n.useContext)(p.PeersServiceContext),l=i.processedPeers,a=i.selfPeer,s=i.joinedProcessedPeers,y=(0,n.useContext)(x.MediaRoomContext).mediaRoom,h=(0,n.useContext)(b.ConfigServiceContext).sessionConfig,k=(0,o.useWindowDimensions)(),C=(0,T.useScale)(h.theme.dimensions||k).width,S=(0,c.useSelector)(function(t){return t.room.requestToJoinPeersList}),_=S.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.present}),P=S.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.ask});l=[a].concat(l.sort(function(t,n){return t.id.localeCompare(n.id)})).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)});var v=[a].concat(s).filter(function(t){return null==t?void 0:t.webinarHiddenParticipant}).filter(function(t,n,i){return i.findIndex(function(n){return n.id===t.id})===n}),q=[a].concat(s).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)&&t.requestToJoinType===u.RequestToJoinType.ask});l=l.concat(q).filter((A=new Set,function(t){return!A.has(t.id)&&A.add(t.id)}));var A;var M=function(t,n){y.acceptAllRequestToJoinStage([{id:t,requestToJoinType:n,type:f.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT}])},W=function(t){y.rejectRequestToJoinStage(t)};return n.default.createElement(E.Flex,{mt:60,width:C},n.default.createElement(o.ScrollView,{style:{padding:20}},n.default.createElement(o.TouchableWithoutFeedback,null,n.default.createElement(E.Box,null,n.default.createElement(E.Box,{my:20},t===f.DyteViewTypes.webinar&&l.length>0&&n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mb:10},"Presenting (",l.length,")"),l.map(function(i){return n.default.createElement(R,{peer:i,key:i.id,mediaRoom:y,permissions:null==h?void 0:h.permissions,roomViewType:t})})),v.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Attending (",v.length,")"),v.map(function(i){return n.default.createElement(R,{key:i.id,peer:i,mediaRoom:y,permissions:null==h?void 0:h.permissions,roomViewType:t})})),P.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to ask Question (",P.length,")"),P.map(function(t){return n.default.createElement(w,{rejectRequest:W,acceptRequest:M,peer:t,key:t.id,type:"REQUEST_TO_ASK"})})),_.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to Present (",_.length,")"),_.map(function(t){return n.default.createElement(w,{rejectRequest:W,acceptRequest:M,peer:t,key:t.id,type:"REQUEST_TO_PRESENT"})})),n.default.createElement(E.Box,{height:200})))))};var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var i=h(n);if(i&&i.has(t))return i.get(t);var l={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(l,a,u):l[a]=t[a]}l.default=t,i&&i.set(t,l);return l})(r(d[1])),i=r(d[2]),l=t(r(d[3])),o=r(d[4]),a=t(r(d[5])),u=r(d[6]),c=r(d[7]),f=r(d[8]),s=t(r(d[9])),p=r(d[10]),E=r(d[11]),y=t(r(d[12])),x=r(d[13]),b=r(d[14]),T=r(d[15]);function h(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,i=new WeakMap;return(h=function(t){return t?i:n})(t)}function w(t){var o=t.rejectRequest,a=t.acceptRequest,u=t.peer,c=t.type,f=(0,n.useContext)(i.ThemeContext).colors;return n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+u.name,bgColor:f.primary[500]}),n.default.createElement(E.Text,{ml:10,color:f.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:u.name>30?u.name.substring(0,20)+"...":""+u.name,charSize:30}),u.isMe?' (me)':null)),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:6},n.default.createElement(E.Button,{onClick:function(){return a(u.id,c)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"check",fill:f.success[500]}))),n.default.createElement(E.Box,{ml:6},n.default.createElement(E.Button,{onClick:function(){return o(u.id)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"clear",fill:f.danger[500]})))))}function R(t){var o=t.peer,c=t.mediaRoom,p=t.permissions,x=t.roomViewType,T=(0,n.useContext)(i.ThemeContext).colors,h=(0,n.useContext)(b.ConfigServiceContext).participantControls,w=(null==p?void 0:p.pin_participant)||(null==p?void 0:p.can_allow_participant_audio)||(null==p?void 0:p.can_allow_participant_video)||(null==p?void 0:p.kick_participant),R=p.accept_present_requests,k=[];return(w||h.length>0)&&(null!=p&&p.pin_participant&&(o.isPinned?k.push({title:'Unpin',onClick:function(){return c.pin(null)}}):k.push({title:'Pin',onClick:function(){return c.pin(o.id)}})),null!=p&&p.can_allow_participant_audio&&k.push({title:'Mute Audio',onClick:function(){return c.disableAudio(o.id)}}),null!=p&&p.can_allow_participant_video&&k.push({title:'Disable Video',onClick:function(){return c.disableVideo(o.id)}}),null!=p&&p.kick_participant&&!o.isMe&&k.push({title:'Kick',onClick:function(){return c.kick(o.id)}}),x!==f.DyteViewTypes.webinar||o.isMe||!R||o.webinarHiddenParticipant||k.push({title:'Force Stop Presenting',onClick:function(){return c.removePeerFromStage(o.id,f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR)}}),x===f.DyteViewTypes.webinar&&!o.isMe&&R&&k.push({title:'Grant Premission to Present',onClick:function(){return c.acceptAllRequestToJoinStage([{id:o.id,requestToJoinType:u.RequestToJoinType.present,type:f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR}])}}),h.forEach(function(t){o.isMe&&!1===t.showSelf||k.push({title:t.label,onClick:function(){return t.onClick(o.id)}})}),k.push({title:'Cancel',onClick:function(){}})),n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+o.displayName,bgColor:T.primary[500]}),n.default.createElement(E.HStack,{ml:10,color:T.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:o.displayName.length>30?o.displayName.substring(0,20)+"...":""+o.displayName,charSize:30}),(o.isMe||o.label)&&n.default.createElement(E.Text,{background:"primary.300",color:"textPrimary.100",pr:4,ml:4,borderRadius:3},o.isMe?'me':o.label))),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:8},o.producingAudio?n.default.createElement(E.Icon,{boxSize:"xl",name:"mic",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"mic-off",fill:T.danger[500]})),o.producingVideo?n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam-off",fill:T.danger[500]}),(w||h.length>0)&&n.default.createElement(a.default,{options:k.map(function(t){return t.title}),actions:k.map(function(t){return t.onClick})})))}},801,[1,165,514,682,2,802,487,432,497,676,674,512,692,585,508,493]); __d(function(g,r,_i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var o={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=l?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o})(r(d[2])),o=r(d[3]),l=r(d[4]),i=r(d[5]),u=e(r(d[6]));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}var f=function(e){var c=(0,n.useRef)(),f=(0,n.useState)(!1),s=(0,t.default)(f,2),p=s[0],h=s[1],w=(0,n.useContext)(l.ThemeContext).colors,v=function(t){for(var n=e.options,o=0;o=0&&(n=e.destructiveIndex),o.ActionSheetIOS.showActionSheetWithOptions({options:t,destructiveButtonIndex:n,cancelButtonIndex:t.length-1},function(e){v(e)})}else'android'===o.Platform.OS&&o.UIManager.showPopupMenu((0,o.findNodeHandle)(c.current),t,function(){return console.log('something went wrong with the popup menu')},function(e,t){v(t)})}},n.default.createElement(i.Icon,{boxSize:"xl",ml:5,name:"dots-vertical",fill:w.textPrimary[300]}))),b)};_e.default=f},802,[1,41,165,2,514,512,676]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.stopRecording=e.startRecording=e.getActiveRecording=void 0;var n=t(r(d[1])),o=t(r(d[2]));e.startRecording=function(t){var s,c,u,p;return n.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,l.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/recording",{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:if(201===(p=l.sent).status){l.next=6;break}throw new Error('Recording failed to start');case 6:return l.abrupt("return",p.json());case 7:case"end":return l.stop()}},null,null,null,Promise)};e.stopRecording=function(t){var s,c,u,p,l;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,p=t.recordingId,f.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/recordings/"+p,{method:'PUT',body:JSON.stringify({recordingAction:'stop'}),headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:if(201===(l=f.sent).status){f.next=6;break}throw new Error('Recording failed to stop');case 6:return f.abrupt("return",l.json());case 7:case"end":return f.stop()}},null,null,null,Promise)};e.getActiveRecording=function(t){var s,c,u,p;return n.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,l.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/active-recording",{method:'GET',headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:return p=l.sent,l.abrupt("return",p.json());case 5:case"end":return l.stop()}},null,null,null,Promise)}},803,[1,67,504]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=b(n);if(o&&o.has(t))return o.get(t);var u={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var c=l?Object.getOwnPropertyDescriptor(t,s):null;c&&(c.get||c.set)?Object.defineProperty(u,s,c):u[s]=t[s]}u.default=t,o&&o.set(t,u);return u})(r(d[1])),o=r(d[2]),u=r(d[3]),l=r(d[4]),s=r(d[5]),c=r(d[6]),f=r(d[7]),p=r(d[8]),y=r(d[9]),T=t(r(d[10]));function b(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(b=function(t){return t?o:n})(t)}var x=function(t){var b=t.isMobile,x=(0,u.useSelector)(function(t){return t.room.roomViewType}),S=(0,u.useSelector)(function(t){return t.participant.requestToJoinStageState}),q=(0,n.useContext)(p.ThemeContext).colors,v=(0,n.useContext)(o.MediaRoomContext).mediaRoom,E=(0,u.useDispatch)(),R=(0,n.useContext)(y.ConfigServiceContext).sessionConfig,w=(0,c.useWindowDimensions)(),C=R.theme.dimensions||w,h=(C.height,C.width),O=x===s.DyteViewTypes.webinar&&S===l.RequestToJoinStageState.INITIATED;return n.default.createElement(f.Modal,{isVisible:O,backdropOpacity:.8,backdropColor:q.secondary[800]},n.default.createElement(f.Flex,{width:.9*h,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:T.default.medium},n.default.createElement(f.Flex,{pt:15},n.default.createElement(f.Text,{fontSize:28,fontWeight:"bold"},"Request")),n.default.createElement(f.Flex,{display:"flex",pb:20},n.default.createElement(f.Flex,{direction:b?'column':'row',justifyContent:"space-between"},n.default.createElement(f.Button,{onClick:function(){return t=l.RequestToJoinType.present,E((0,l.requestToJoinType)(t)),E((0,l.requestedJoinToStageState)(l.RequestToJoinStageState.WAITING)),v.requestToJoinStage(t),void c.Alert.alert('Request Sent',"Request to "+(t===l.RequestToJoinType.present?'present':'ask')+" has been sent successfully to host",[{text:'OK',onPress:function(){}}]);var t}},n.default.createElement(f.Box,{bg:"primary.500",py:12,px:20,mt:20,borderRadius:T.default.small,align:"center"},n.default.createElement(f.Text,null,"Request to Present"))),n.default.createElement(f.Button,{onClick:function(){E((0,l.requestedJoinToStageState)(l.RequestToJoinStageState.NONE)),E((0,l.requestToJoinType)(void 0))}},n.default.createElement(f.Box,{bg:"danger.500",py:12,px:20,mt:20,borderRadius:T.default.small,align:"center"},n.default.createElement(f.Text,null,"Cancel")))))))};e.default=x},804,[1,165,585,432,487,497,2,512,514,508,676]); diff --git a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/Info.plist b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/Info.plist index 9d6c04d..717b96c 100644 Binary files a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/Info.plist and b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/Info.plist differ diff --git a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeDirectory b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeDirectory index 8e3c5ed..51859de 100644 Binary files a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeDirectory and b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeDirectory differ diff --git a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeRequirements-1 b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeRequirements-1 index f031b55..c2420b3 100644 Binary files a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeRequirements-1 and b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeRequirements-1 differ diff --git a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/DyteSdk b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/DyteSdk index 493d9f5..c6843f8 100755 Binary files a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/DyteSdk and b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/DyteSdk differ diff --git a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/Info.plist b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/Info.plist index fd22a73..e90c04e 100644 Binary files a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/Info.plist and b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/Info.plist differ diff --git a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/_CodeSignature/CodeResources b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/_CodeSignature/CodeResources index 609efc9..20aaa75 100644 --- a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/_CodeSignature/CodeResources +++ b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/_CodeSignature/CodeResources @@ -6,11 +6,11 @@ AccessibilityResources.bundle/Info.plist - 8Mv/JNJCL+Y+ZCZM7YlfqAQV+Ng= + 55SKUTkC0l1mNuOot0EBlf6EVfg= AccessibilityResources.bundle/_CodeSignature/CodeDirectory - dVTaT/2g5gwmTpl7rSA7rnMmE40= + n2+JBnITskzfPAHzzXi1JgaKYkU= AccessibilityResources.bundle/_CodeSignature/CodeRequirements @@ -18,7 +18,7 @@ AccessibilityResources.bundle/_CodeSignature/CodeRequirements-1 - 4ZDXFVbm358V2Lx5xexb5/DXTmM= + sHpw2qzgrt++gOgniz/HTOs28Go= AccessibilityResources.bundle/_CodeSignature/CodeResources @@ -115,7 +115,7 @@ Info.plist - 5TnycXNJwvxuSOahurME/8c7aDw= + 1/orSH6zMN/5HEVzizCaR4RkV4s= Ionicons.ttf @@ -187,7 +187,7 @@ main.jsbundle - Pvq79LR8ccefFaymaMrz8E9LzZs= + 87sPFjppyVffJLr75AjHc/8rlIU= files2 @@ -196,14 +196,14 @@ hash2 - ZqK/9AgcITmVrqNjzmk1COKchxzJTXnBQaIiGm8Ev+s= + d93mZH1dxykgyf+nVJfZm+UHF4SnlkV6oUAAeMukwso= AccessibilityResources.bundle/_CodeSignature/CodeDirectory hash2 - KHRcVbvczHTiTHqABC4XWNnmNHRBwv6hT6H68P6PCXk= + YGrIOkAKukv8ekcnS3A2fXhUwQpFnLu6raIwjTrHrTA= AccessibilityResources.bundle/_CodeSignature/CodeRequirements @@ -217,7 +217,7 @@ hash2 - mBhQgvfczRsoD/t/hIDt+HiS3By6h3GbXpkvQIB8qGQ= + SFbu+7G7nux+Ez39BV/o/qBF2oatM1+T1oOPcTw9Uu8= AccessibilityResources.bundle/_CodeSignature/CodeResources @@ -499,7 +499,7 @@ hash2 - zTAiVLmzRfB9UaYELuC4GX/tAPLvPtlmgL9PF29ExJE= + 3ZfixYm2Hx0pBKBBaVywkhO3erLIWZF8X8OIP8Ey5/k= diff --git a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/main.jsbundle b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/main.jsbundle index cb13b3a..d09d228 100644 --- a/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/main.jsbundle +++ b/Frameworks/DyteSdk.xcframework/ios-x86_64-simulator/DyteSdk.framework/main.jsbundle @@ -496,7 +496,7 @@ __d(function(g,r,_i,a,m,_e,d){'use strict';var e=r(d[0]);Object.defineProperty(_ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(d[0]),o=t.NativeModules,c=t.TurboModuleRegistry,l=r(d[1]),S=o.PlatformLocalStorage||o.RNC_AsyncSQLiteDBStorage||o.RNCAsyncStorage;!S&&l()&&(S=c?c.get('AsyncSQLiteDBStorage')||c.get('AsyncLocalStorage'):o.AsyncSQLiteDBStorage||o.AsyncLocalStorage);var n=S;e.default=n},490,[2,491]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]).NativeModules;m.exports=function(){var t,o,u=null==(t=n.NativeUnimoduleProxy)?void 0:null==(o=t.modulesConstants)?void 0:o.ExponentConstants;if(u&&(u.appOwnership&&!u.executionEnvironment||['storeClient','standalone'].includes(u.executionEnvironment)))return!0;return!1}},491,[2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.useAsyncStorage=function(t){return{getItem:function(){for(var u=arguments.length,f=new Array(u),o=0;o=0&&t<=1}),b=function(t){return t&&t.width>0&&t.height>0},D=.5,N=.5;e.withAnchorPoint=function(t,n,u){if(!w((s=n).x)||!w(s.y))return t;var s;if(!b(u))return t;var c=t.transform;if(!c)return t;if(n.x!==D&&u.width){var f=[];f.push({translateX:u.width*(n.x-D)}),(c=[].concat(f,(0,o.default)(c))).push({translateX:u.width*(D-n.x)})}if(!Array.isArray(c))return{transform:c};if(n.y!==N&&u.height){var l=[];l.push({translateY:u.height*(n.y-N)}),(c=[].concat(l,(0,o.default)(c))).push({translateY:u.height*(N-n.y)})}return{transform:c}};var y=function(){return'react native client'};e.browserName=y;var S=function(){return''};e.osName=S;var C=function(){return!0};e.isMobile=C;e.isChrome=function(){return!0};e.getDeviceInfo=function(){return{isMobile:!0,browserName:'react native client',osName:'',browserVersion:'react native client'}};e.isSafari=function(){return!1};e.isDesktopSafari=function(){return!1};e.useDisclosure=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=h(t),u=(0,n.default)(o,2),s=u[0],c=u[1];return{isOpen:s,onOpen:v(function(){return c(!0)},[]),onClose:v(function(){return c(!1)},[]),toggle:v(function(){return c(function(t){return!t})},[])}}},493,[1,41,49,165,494,496,2]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.browserName=void 0,e.default=function(t,o){var c=v(!1),f=(0,n.default)(c,2),h=f[0],l=f[1],p=o&&o.successDuration;return(0,u.useEffect)(function(){if(h&&p){var t=setTimeout(function(){l(!1)},p);return function(){clearTimeout(t)}}return function(){}},[h,p]),[h,function(){var n=(0,s.default)(t);l(n)}]},e.osName=e.isSafari=e.isMobile=e.isDesktopSafari=e.isChrome=e.getDeviceInfo=void 0,e.parseJwt=function(t){var n=t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/'),o=decodeURIComponent(c.default.decode(n).split('').map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(''));return JSON.parse(o)},e.useDisclosure=void 0,e.useScale=function(t){var n=t.width,o=t.height,u=f.Dimensions.get('screen').width,s=f.Dimensions.get('screen').height;return{width:Math.min(n,u),height:Math.min(o,s)}},e.withAnchorPoint=void 0;var n=t(r(d[1])),o=t(r(d[2])),u=r(d[3]),s=t(r(d[4])),c=t(r(d[5])),f=r(d[6]),h=r(d[3]),l=h.useCallback,v=h.useState,p=f.NativeModules.DyteHelper,w=(new f.NativeEventEmitter(p),function(t){return t>=0&&t<=1}),D=function(t){return t&&t.width>0&&t.height>0},b=.5,N=.5;e.withAnchorPoint=function(t,n,u){if(!w((s=n).x)||!w(s.y))return t;var s;if(!D(u))return t;var c=t.transform;if(!c)return t;if(n.x!==b&&u.width){var f=[];f.push({translateX:u.width*(n.x-b)}),(c=[].concat(f,(0,o.default)(c))).push({translateX:u.width*(b-n.x)})}if(!Array.isArray(c))return{transform:c};if(n.y!==N&&u.height){var h=[];h.push({translateY:u.height*(n.y-N)}),(c=[].concat(h,(0,o.default)(c))).push({translateY:u.height*(N-n.y)})}return{transform:c}};var y=function(){return'react native client'};e.browserName=y;var S=function(){return''};e.osName=S;var M=function(){return!0};e.isMobile=M;e.isChrome=function(){return!0};e.getDeviceInfo=function(){return{isMobile:!0,browserName:'react native client',osName:'',browserVersion:'react native client'}};e.isSafari=function(){return!1};e.isDesktopSafari=function(){return!1};e.useDisclosure=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=v(t),u=(0,n.default)(o,2),s=u[0],c=u[1];return{isOpen:s,onOpen:l(function(){return c(!0)},[]),onClose:l(function(){return c(!1)},[]),toggle:l(function(){return c(function(t){return!t})},[])}}},493,[1,41,49,165,494,496,2]); __d(function(g,r,i,a,m,_e,d){"use strict";var e=r(d[0]),t={"text/plain":"Text","text/html":"Url",default:"Text"},o="Copy to clipboard: #{key}, Enter";function n(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}m.exports=function(c,l){var s,p,u,y,f,b,w=!1;l||(l={}),s=l.debug||!1;try{if(u=e(),y=document.createRange(),f=document.getSelection(),(b=document.createElement("span")).textContent=c,b.style.all="unset",b.style.position="fixed",b.style.top=0,b.style.clip="rect(0, 0, 0, 0)",b.style.whiteSpace="pre",b.style.webkitUserSelect="text",b.style.MozUserSelect="text",b.style.msUserSelect="text",b.style.userSelect="text",b.addEventListener("copy",function(e){if(e.stopPropagation(),l.format)if(e.preventDefault(),void 0===e.clipboardData){s&&console.warn("unable to use e.clipboardData"),s&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=t[l.format]||t.default;window.clipboardData.setData(o,c)}else e.clipboardData.clearData(),e.clipboardData.setData(l.format,c);l.onCopy&&(e.preventDefault(),l.onCopy(e.clipboardData))}),document.body.appendChild(b),y.selectNodeContents(b),f.addRange(y),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");w=!0}catch(e){s&&console.error("unable to copy using execCommand: ",e),s&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(l.format||"text",c),l.onCopy&&l.onCopy(window.clipboardData),w=!0}catch(e){s&&console.error("unable to copy using clipboardData: ",e),s&&console.error("falling back to prompt"),p=n("message"in l?l.message:o),window.prompt(p,c)}}finally{f&&("function"==typeof f.removeRange?f.removeRange(y):f.removeAllRanges()),b&&document.body.removeChild(b),u()}return w}},494,[495]); __d(function(g,r,_i,a,m,e,d){m.exports=function(){var n=document.getSelection();if(!n.rangeCount)return function(){};for(var t=document.activeElement,o=[],u=0;u>2,o=(3&c)<<4|(h=n.charCodeAt(s++))>>4,A=(15&h)<<2|(u=n.charCodeAt(s++))>>6,l=63&u,isNaN(h)?A=l=64:isNaN(u)&&(l=64),f.push(t.charAt(i)+t.charAt(o)+t.charAt(A)+t.charAt(l)),c=h=u="",i=o=A=l=""}while(s>2,o=(3&c)<<4|(h=n[s++])>>4,A=(15&h)<<2|(u=n[s++])>>6,l=63&u,isNaN(h)?A=l=64:isNaN(u)&&(l=64),f.push(t.charAt(i)+t.charAt(o)+t.charAt(A)+t.charAt(l)),c=h=u="",i=o=A=l=""}while(s>18&63)+d.charAt(c>>12&63)+d.charAt(c>>6&63)+d.charAt(63&c);return 2==f?(n=t.charCodeAt(A)<<8,o=t.charCodeAt(++A),s+=d.charAt((c=n+o)>>10)+d.charAt(c>>4&63)+d.charAt(c<<2&63)+'='):1==f&&(c=t.charCodeAt(A),s+=d.charAt(c>>2)+d.charAt(c<<4&63)+'=='),s},decode:function(t){var n=(t=String(t).replace(f,'')).length;n%4==0&&(n=(t=t.replace(/==?$/,'')).length),(n%4==1||/[^+a-zA-Z0-9/]/.test(t))&&h('Invalid character: the string to be decoded is not correctly encoded.');for(var o,a,c=0,s='',A=-1;++A>(-2*c&6)));return s},version:'0.1.0'};if('function'==typeof define&&'object'==typeof define.amd&&define.amd)define(function(){return s});else if(n&&!n.nodeType)if(o)o.exports=s;else for(var A in s)s.hasOwnProperty(A)&&(n[A]=s[A]);else t.base64=s})(this)},577,[]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=_e.Logger=void 0;var t=e(r(d[1])),n=e(r(d[2])),o=e(r(d[3]));function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.getOwnPropertyNames(e).forEach(function(o){if(![null,void 0,NaN].includes(e[o])){var c=t?t+"."+o:o;'object'==typeof e[o]?l(e[o],c,n):n[c]=e[o]}}),n}var c=(function(){function e(){(0,n.default)(this,e),this.level=3}return(0,o.default)(e,[{key:"process",value:function(e){var t={};try{Object.getOwnPropertyNames(e||{}).forEach(function(n){try{t[n]=JSON.stringify(e[n])}catch(e){t[n]='Failed to stringify'}})}catch(e){}return t}},{key:"init",value:function(e){'trace'===e?this.level=3:'log'===e?this.level=2:'error'===e&&(this.level=1)}},{key:"trace",value:function(t,n){e.addEventInCurrentSpan('warn',t,n,!0)}},{key:"warn",value:function(t,n){e.addEventInCurrentSpan('warn',t,n,!0)}},{key:"error",value:function(t,n){e.addEventInCurrentSpan('error',t,n,!0)}}],[{key:"addEventInCurrentSpan",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'info',o=arguments.length>1?arguments[1]:void 0,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;try{var s=l(c,'metadata'),v=(0,t.default)({message:o,logSeverity:n},s,{loggedAt:(new Date).getTime()});u?e.sendOtelLogsToNewRelic(e.logsCache.splice(0,25).concat([v])):e.logsCache.push(v)}catch(e){console.debug('opentelemetry::addEventInCurrentSpan_failed',e)}}},{key:"sendOtelLogsToNewRelic",value:function(t){fetch('https://api-silos.dyte.io/otel/logs',{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json'},body:JSON.stringify({meetingMetadata:l(e.meetingMetadata,'meetingMetadata'),serviceName:'mobile-sdk',logs:t})}).catch(function(e){console.debug('opentelemetry::sendOtelLogToNewRelic_failed',e)})}}]),e})();_e.Logger=c,c.logsCache=[],c.meetingMetadata={};var u=new c;_e.default=u},578,[1,22,9,10]); -__d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.UserTrackContext=void 0,e.default=function(t){var T,P,E,w=(0,c.useState)(),A=(0,o.default)(w,2),b=A[0],N=A[1],k=(0,c.useState)([]),M=(0,o.default)(k,2),O=M[0],x=M[1],D=(0,c.useState)(),C=(0,o.default)(D,2),y=C[0],V=C[1],_=(0,c.useState)([]),R=(0,o.default)(_,2),G=R[0],L=R[1],B=(0,c.useState)(),j=(0,o.default)(B,2),W=j[0],F=j[1],q=(0,c.useState)(),H=(0,o.default)(q,2),U=H[0],J=H[1],Q=(0,c.useRef)(null),K=(0,c.useRef)(null),z=(0,c.useRef)(null),X=(0,c.useRef)(null),Y=(0,c.useContext)(v.ConfigServiceContext),Z=(Y.meeting,Y.sessionConfig),$=Z.permissions.produce.audio,ee=Z.permissions.produce.video,te=Z.permissions.produce.video,ne=ee.allow,re=(0,l.getWebcamConstraints)(ee.quality,ee.frame_rate),ae=((0,l.getScreenShareConstraints)(te.quality,te.frame_rate),t.children),ue=(0,d.useSelector)(function(t){return t.participant.audioMuted}),ie=(0,d.useSelector)(function(t){return t.participant.videoOff}),oe=(0,d.useSelector)(function(t){return t.room.producersState}),ce=(0,d.useSelector)(function(t){return t.participant.switched}),de=(0,d.useSelector)(function(t){return t.participant.canPresent}),se=(0,d.useSelector)(function(t){return t.participant.presentingState}),le=(0,d.useSelector)(function(t){return t.participant.audioTrackSelection}),fe=(0,d.useSelector)(function(t){return t.participant.videoTrackSelection}),ve=(0,d.useSelector)(function(t){return t.participant.videoProduction}),pe=(0,d.useSelector)(function(t){return t.participant.audioProduction}),Se=(0,d.useSelector)(function(t){return t.participant.presentingState}),Te=(oe===s.MediaStates.NOT_APPLICABLE||ve===s.MediaStates.LOADED||ve===s.MediaStates.NOT_STARTED||ve===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&ne,Ie=(oe===s.MediaStates.NOT_APPLICABLE||pe===s.MediaStates.LOADED||pe===s.MediaStates.NOT_STARTED||pe===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&$,Pe=(0,d.useDispatch)(),Ee=c.default.useState([]),he=(0,o.default)(Ee,2),me=he[0],we=he[1],Ae=function(t){we(t)},ge=(0,d.useSelector)(function(t){return t.room.roomViewType}),be=(0,d.useSelector)(function(t){return t.participant.requestToJoinType}),Ne=(0,d.useSelector)(function(t){return t.room.routerState});ge===S.DyteViewTypes.webinar&&be===f.RequestToJoinType.ask&&(re=(0,l.getWebcamConstraints)('QQVGA',null==(T=Z.permissions)?void 0:null==(P=T.produce)?void 0:null==(E=P.video)?void 0:E.frame_rate));(0,c.useEffect)(function(){Q.current=y,K.current=W,z.current=U,X.current=b},[y,W,U,b]),(0,c.useEffect)(function(){I.default.trace('audioMuted_useEffect',{audioMuted:ue,presentingState:se}),b&&(b.enabled=!ue),ge===S.DyteViewTypes.webinar&&se!==f.PresentingState.PRESENTING||Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING))},[ue,se]);var ke=function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,I.default.trace('initialAudioStreamFetch'),t=null,u.prev=3,u.next=6,n.default.awrap((0,l.getAudioTrack)());case 6:t=u.sent,u.next=13;break;case 9:if(u.prev=9,u.t0=u.catch(3),'NotAllowedError'!==u.t0.name){u.next=13;break}throw new Error('No audio permission');case 13:if(t){u.next=15;break}throw new Error('No audio track');case 15:$&&N(t),u.next=23;break;case 18:u.prev=18,u.t1=u.catch(0),I.default.error('initialAudioStreamFetch',u.t1),Pe((0,f.setAudioProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setAudioMuted)(!0));case 23:case"end":return u.stop()}},null,null,[[0,18],[3,9]],Promise)},Me=function(t){if(I.default.trace('setAudioDevice',{audioTrack:!!b}),b&&b.stop(),$){var u=(null==t?void 0:t.deviceId)||(null==le?void 0:le.selectedDeviceId);(0,d.batch)(function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(ke());case 2:Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING)),(null==le?void 0:le.selectedDeviceId)!==u&&Pe((0,f.setAudioTrackSelection)({selectedDeviceId:u}));case 4:case"end":return t.stop()}},null,null,null,Promise)})}else Pe((0,f.setAudioMuted)(!0))},Oe=function(){var t,u,o,c;return n.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return d.prev=0,I.default.trace('initialVideoStreamFetch'),d.next=4,n.default.awrap((0,l.getAllVideoDevices)());case 4:return t=d.sent,u=t.filter(function(t){return'front'===t.facing}),o=u.length>0?u[0]:t[0],c=null,d.prev=8,d.next=11,n.default.awrap((0,l.getVideoTrack)(o.deviceId||'',re));case 11:c=d.sent,d.next=18;break;case 14:if(d.prev=14,d.t0=d.catch(8),'NotAllowedError'!==d.t0.name){d.next=18;break}throw new Error('No video permission');case 18:if(c){d.next=20;break}throw new Error('No video track');case 20:if(ne&&V(c),''!==o.label){d.next=25;break}return d.next=24,n.default.awrap((0,l.getAllVideoDevices)());case 24:t=d.sent;case 25:L(t),Pe((0,f.setVideoTrackSelection)({selectedDeviceId:o.deviceId})),d.next=34;break;case 29:d.prev=29,d.t1=d.catch(0),I.default.error('initialVideoStreamFetch',d.t1),Pe((0,f.setVideoProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setVideoOff)(!0));case 34:case"end":return d.stop()}},null,null,[[0,29],[8,14]],Promise)},xe=function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(I.default.trace('setVideoDevice'),u=(null==t?void 0:t.deviceId)||(null==fe?void 0:fe.selectedDeviceId),ne){o.next=5;break}return Pe((0,f.setVideoOff)(!0)),o.abrupt("return");case 5:(0,d.batch)(function(){Pe((0,f.setVideoOff)(!1)),Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),(null==fe?void 0:fe.selectedDeviceId)!==u&&Pe((0,f.setVideoTrackSelection)({selectedDeviceId:u}))}),setTimeout(function(){var t;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return y&&y.stop(),o.next=3,n.default.awrap((0,l.getVideoTrack)(u,re));case 3:t=o.sent,V(t);case 5:case"end":return o.stop()}},null,null,null,Promise)});case 7:case"end":return o.stop()}},null,null,null,Promise)};(0,c.useEffect)(function(){ge===S.DyteViewTypes.webinar&&Ne===s.MediaStates.LOADED&&Se===f.PresentingState.NOT_PRESENTING?(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.STOPPING)),Pe((0,f.setAudioProduction)(s.MediaStates.STOPPING)),Pe((0,f.setVideoOff)(!0)),Pe((0,f.setAudioMuted)(!0)),setTimeout(function(){y&&y.stop(),b&&b.stop(),N(void 0),V(void 0)})}):Se===f.PresentingState.INITIATED&&(Oe().then(xe),Me())},[Ne,Se]),(0,c.useEffect)(function(){p.default.start({media:'video'});var t=new l.AudioDevicesEmitter(Ae);return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:Q.current&&Q.current.stop(),X.current&&X.current.stop(),K.current&&K.current.stop(),z.current&&z.current.stop();case 4:case"end":return t.stop()}},null,null,null,Promise),function(){t.removeListener()}},[]),c.default.useEffect(function(){ne||(Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&(y.stop(),V(void 0),(0,f.setVideoProduction)(s.MediaStates.CONNECTING))}))},[ne,y]),(0,c.useEffect)(function(){ve===s.MediaStates.NOT_STARTED&&setTimeout(function(){y&&(y.stop(),V(void 0))})},[ve]);var De=function(){(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&y.stop(),V(void 0)})})};(0,c.useEffect)(function(){$||Pe((0,f.setAudioMuted)(!0)),ne||De()},[$,ne]),(0,c.useEffect)(function(){'meeting'===ce?ie||De():'webinar'===ce&&(de||(ue||Pe((0,f.setAudioMuted)(!0)),ie||De()))},[ce]);var Ce=function(){var t,u,o,c,d=arguments;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(t=d.length>0&&void 0!==d[0]?d[0]:null,I.default.trace('changeAudioTrack',{selectedDevice:t}),!(me.length>0)){s.next=10;break}return u={},o={deviceId:null,InCallManagerId:null,device:null},t?(c=t.deviceId,u[c]=t):me.forEach(function(t){var n=t.deviceId;u[n]=t}),u.bluetooth?o={deviceId:'bluetooth',InCallManagerId:'BLUETOOTH',device:u.bluetooth}:u.wired?o={deviceId:'wired',InCallManagerId:'WIRED_HEADSET',device:u.wired}:u.speaker&&(o={deviceId:'speaker',InCallManagerId:'SPEAKER_PHONE',device:u.speaker}),s.next=9,n.default.awrap(p.default.chooseAudioRoute(o.InCallManagerId));case 9:Me(o.device);case 10:case"end":return s.stop()}},null,null,null,Promise)};(0,l.setOnDeviceChange)(function(){var t,o,c,d,s,f,v;return n.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.default.awrap((0,l.getAllVideoDevices)());case 2:if(t=p.sent,o=(0,u.default)(me).find(function(t){return!O.map(function(t){return t.deviceId}).includes(t.deviceId)}),x(me),c=t.find(function(t){return!G.map(function(t){return t.deviceId}).includes(t.deviceId)}),L(t),ue||!o){p.next=10;break}return Me(o),p.abrupt("return");case 10:if(ie||!c){p.next=13;break}return xe(c),p.abrupt("return");case 13:d=!me.map(function(t){return t.deviceId}).includes(null==le?void 0:le.selectedDeviceId),s=!t.map(function(t){return t.deviceId}).includes(null==fe?void 0:fe.selectedDeviceId),ue||void 0!==b&&!d||(f=me[0],Me(f)),ie||void 0!==y&&!s||(v=t[0],xe(v));case 17:case"end":return p.stop()}},null,null,null,Promise)}),(0,c.useEffect)(function(){Ce(void 0),x(me)},[me.length]);var ye={mediaTracks:{webcamTrack:y,setWebcamTrack:V,audioTrack:b,setAudioTrack:N,screenShareVideoTrack:W,setScreenShareVideoTrack:F,screenShareAudioTrack:U,setScreenShareAudioTrack:J},inputDevices:{audioInputDevices:O,videoInputDevices:G,setAudioInputDevices:x,setVideoInputDevices:L,setAudioDevice:Me,setVideoDevice:xe,toggleAudioState:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleAudioState',{audioButtonsEnabled:Ie,audioAllowed:$,audioMuted:ue,audioTrack:!!b}),Ie){t.next=3;break}return t.abrupt("return");case 3:$?ue?(b&&'ended'!==(null==b?void 0:b.readyState)||Me(void 0),Pe((0,f.setAudioMuted)(!1))):Pe((0,f.setAudioMuted)(!0)):ue||Pe((0,f.setAudioMuted)(!0));case 4:case"end":return t.stop()}},null,null,null,Promise)},toggleVideoState:function(t){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleVideoState',{videoButtonsEnabled:Te,videoOff:ie}),Te){t.next=3;break}return t.abrupt("return");case 3:ie?xe():De();case 4:case"end":return t.stop()}},null,null,null,Promise)},onAudioInputChange:function(t){var u;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:I.default.trace('onAudioInputChange',{value:t}),u=O.find(function(n){return n.deviceId===t}),Ce(u);case 3:case"end":return n.stop()}},null,null,null,Promise)},onVideoInputChange:function(t){I.default.trace('onVideoInputChange',{value:t});var n=G.find(function(n){return n.deviceId===t});Pe((0,f.setCameraFacing)(n.facing)),xe(n)}},setupStreams:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(Oe());case 2:return t.next=4,n.default.awrap(ke());case 4:case"end":return t.stop()}},null,null,null,Promise)},videoButtonsEnabled:Te,audioButtonsEnabled:Ie};return c.default.createElement(h.Provider,{value:ye},ae)};var n=t(r(_d[1])),u=t(r(_d[2])),o=t(r(_d[3])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=P(n);if(u&&u.has(t))return u.get(t);var o={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in t)if("default"!==d&&Object.prototype.hasOwnProperty.call(t,d)){var s=c?Object.getOwnPropertyDescriptor(t,d):null;s&&(s.get||s.set)?Object.defineProperty(o,d,s):o[d]=t[d]}o.default=t,u&&u.set(t,o);return o})(r(_d[4])),d=r(_d[5]),s=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=r(_d[9]),p=t(r(_d[10])),S=r(_d[11]),T=r(_d[12]),I=t(r(_d[13]));function P(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(P=function(t){return t?u:n})(t)}var E=T.NativeModules.InCallManager,h=(new T.NativeEventEmitter(E),(0,c.createContext)(null));e.UserTrackContext=h},579,[1,67,49,41,165,432,480,580,487,508,583,482,2,578]); +__d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.UserTrackContext=void 0,e.default=function(t){var T,P,E,h=(0,c.useState)(),A=(0,o.default)(h,2),b=A[0],N=A[1],k=(0,c.useState)([]),D=(0,o.default)(k,2),M=D[0],O=D[1],x=(0,c.useState)(),C=(0,o.default)(x,2),y=C[0],V=C[1],_=(0,c.useState)([]),R=(0,o.default)(_,2),G=R[0],L=R[1],B=(0,c.useState)(),j=(0,o.default)(B,2),W=j[0],F=j[1],q=(0,c.useState)(),H=(0,o.default)(q,2),U=H[0],J=H[1],Q=(0,c.useRef)(null),K=(0,c.useRef)(null),z=(0,c.useRef)(null),X=(0,c.useRef)(null),Y=(0,c.useContext)(v.ConfigServiceContext),Z=(Y.meeting,Y.sessionConfig),$=Z.permissions.produce.audio,ee=Z.permissions.produce.video,te=Z.permissions.produce.video,ne=ee.allow,re=(0,l.getWebcamConstraints)(ee.quality,ee.frame_rate),ae=((0,l.getScreenShareConstraints)(te.quality,te.frame_rate),t.children),ue=(0,d.useSelector)(function(t){return t.participant.audioMuted}),ie=(0,d.useSelector)(function(t){return t.participant.videoOff}),oe=(0,d.useSelector)(function(t){return t.room.producersState}),ce=(0,d.useSelector)(function(t){return t.participant.switched}),de=(0,d.useSelector)(function(t){return t.participant.canPresent}),se=(0,d.useSelector)(function(t){return t.participant.presentingState}),le=(0,d.useSelector)(function(t){return t.participant.audioTrackSelection}),fe=(0,d.useSelector)(function(t){return t.participant.videoTrackSelection}),ve=(0,d.useSelector)(function(t){return t.participant.videoProduction}),pe=(0,d.useSelector)(function(t){return t.participant.audioProduction}),Se=(0,d.useSelector)(function(t){return t.participant.presentingState}),Te=(oe===s.MediaStates.NOT_APPLICABLE||ve===s.MediaStates.LOADED||ve===s.MediaStates.NOT_STARTED||ve===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&ne,Ie=(oe===s.MediaStates.NOT_APPLICABLE||pe===s.MediaStates.LOADED||pe===s.MediaStates.NOT_STARTED||pe===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&$,Pe=(0,d.useDispatch)(),Ee=c.default.useState([]),me=(0,o.default)(Ee,2),we=me[0],he=me[1],Ae=function(t){he(t)},ge=(0,d.useSelector)(function(t){return t.room.roomViewType}),be=(0,d.useSelector)(function(t){return t.participant.requestToJoinType}),Ne=(0,d.useSelector)(function(t){return t.room.routerState});ge===S.DyteViewTypes.webinar&&be===f.RequestToJoinType.ask&&(re=(0,l.getWebcamConstraints)('QQVGA',null==(T=Z.permissions)?void 0:null==(P=T.produce)?void 0:null==(E=P.video)?void 0:E.frame_rate));(0,c.useEffect)(function(){Q.current=y,K.current=W,z.current=U,X.current=b},[y,W,U,b]),(0,c.useEffect)(function(){I.default.trace('audioMuted_useEffect',{audioMuted:ue,presentingState:se}),b&&(b.enabled=!ue),ge===S.DyteViewTypes.webinar&&se!==f.PresentingState.PRESENTING||Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING))},[ue,se]);var ke=function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,I.default.trace('initialAudioStreamFetch'),t=null,u.prev=3,u.next=6,n.default.awrap((0,l.getAudioTrack)());case 6:t=u.sent,u.next=13;break;case 9:if(u.prev=9,u.t0=u.catch(3),'NotAllowedError'!==u.t0.name){u.next=13;break}throw new Error('No audio permission');case 13:if(t){u.next=15;break}throw new Error('No audio track');case 15:$&&N(t),u.next=23;break;case 18:u.prev=18,u.t1=u.catch(0),I.default.error('initialAudioStreamFetch',u.t1),Pe((0,f.setAudioProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setAudioMuted)(!0));case 23:case"end":return u.stop()}},null,null,[[0,18],[3,9]],Promise)},De=function(t){if(I.default.trace('setAudioDevice',{audioTrack:!!b}),b&&b.stop(),$){var u=(null==t?void 0:t.deviceId)||(null==le?void 0:le.selectedDeviceId);(0,d.batch)(function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(ke());case 2:Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING)),(null==le?void 0:le.selectedDeviceId)!==u&&Pe((0,f.setAudioTrackSelection)({selectedDeviceId:u}));case 4:case"end":return t.stop()}},null,null,null,Promise)})}else Pe((0,f.setAudioMuted)(!0))},Me=function(){var t,u,o,c;return n.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return d.prev=0,I.default.trace('initialVideoStreamFetch'),d.next=4,n.default.awrap((0,l.getAllVideoDevices)());case 4:return t=d.sent,u=t.filter(function(t){return'front'===t.facing}),o=u.length>0?u[0]:t[0],c=null,d.prev=8,d.next=11,n.default.awrap((0,l.getVideoTrack)(o.deviceId||'',re));case 11:c=d.sent,d.next=18;break;case 14:if(d.prev=14,d.t0=d.catch(8),'NotAllowedError'!==d.t0.name){d.next=18;break}throw new Error('No video permission');case 18:if(c){d.next=20;break}throw new Error('No video track');case 20:if(ne&&V(c),''!==o.label){d.next=25;break}return d.next=24,n.default.awrap((0,l.getAllVideoDevices)());case 24:t=d.sent;case 25:L(t),Pe((0,f.setVideoTrackSelection)({selectedDeviceId:o.deviceId})),d.next=34;break;case 29:d.prev=29,d.t1=d.catch(0),I.default.error('initialVideoStreamFetch',d.t1),Pe((0,f.setVideoProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setVideoOff)(!0));case 34:case"end":return d.stop()}},null,null,[[0,29],[8,14]],Promise)},Oe=function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(I.default.trace('setVideoDevice'),u=(null==t?void 0:t.deviceId)||(null==fe?void 0:fe.selectedDeviceId),ne){o.next=5;break}return Pe((0,f.setVideoOff)(!0)),o.abrupt("return");case 5:(0,d.batch)(function(){Pe((0,f.setVideoOff)(!1)),Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),(null==fe?void 0:fe.selectedDeviceId)!==u&&Pe((0,f.setVideoTrackSelection)({selectedDeviceId:u}))}),setTimeout(function(){var t;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return y&&y.stop(),o.next=3,n.default.awrap((0,l.getVideoTrack)(u,re));case 3:t=o.sent,V(t);case 5:case"end":return o.stop()}},null,null,null,Promise)});case 7:case"end":return o.stop()}},null,null,null,Promise)};(0,c.useEffect)(function(){ge===S.DyteViewTypes.webinar&&Ne===s.MediaStates.LOADED&&Se===f.PresentingState.NOT_PRESENTING?(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.STOPPING)),Pe((0,f.setAudioProduction)(s.MediaStates.STOPPING)),Pe((0,f.setVideoOff)(!0)),Pe((0,f.setAudioMuted)(!0)),setTimeout(function(){y&&y.stop(),b&&b.stop(),N(void 0),V(void 0)})}):Se===f.PresentingState.INITIATED&&(Me().then(Oe),De())},[Ne,Se]),(0,c.useEffect)(function(){p.default.start({media:'video'});var t=new l.AudioDevicesEmitter(Ae);return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:Q.current&&Q.current.stop(),X.current&&X.current.stop(),K.current&&K.current.stop(),z.current&&z.current.stop();case 4:case"end":return t.stop()}},null,null,null,Promise),function(){t.removeListener()}},[]),c.default.useEffect(function(){ne||(Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&(y.stop(),V(void 0),(0,f.setVideoProduction)(s.MediaStates.CONNECTING))}))},[ne,y]),(0,c.useEffect)(function(){ve===s.MediaStates.NOT_STARTED&&setTimeout(function(){y&&(y.stop(),V(void 0))})},[ve]);var xe=function(){(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&y.stop(),V(void 0)})})};(0,c.useEffect)(function(){$||Pe((0,f.setAudioMuted)(!0)),ne||xe()},[$,ne]),(0,c.useEffect)(function(){'meeting'===ce?ie||xe():'webinar'===ce&&(de||(ue||Pe((0,f.setAudioMuted)(!0)),ie||xe()))},[ce]);var Ce=function(){var t,u,o,c,d=arguments;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(t=d.length>0&&void 0!==d[0]?d[0]:null,I.default.trace('changeAudioTrack',{selectedDevice:t,audioDevices:we}),!(we.length>0)){s.next=10;break}return u={},o={deviceId:null,InCallManagerId:null,device:null},t?(c=t.deviceId,u[c]=t):we.forEach(function(t){var n=t.deviceId;u[n]=t}),u.wired?o={deviceId:'wired',InCallManagerId:'WIRED_HEADSET',device:u.wired}:u.bluetooth?o={deviceId:'bluetooth',InCallManagerId:'BLUETOOTH',device:u.bluetooth}:u.speaker&&(o={deviceId:'speaker',InCallManagerId:'SPEAKER_PHONE',device:u.speaker}),s.next=9,n.default.awrap(p.default.chooseAudioRoute(o.InCallManagerId));case 9:De(o.device);case 10:case"end":return s.stop()}},null,null,null,Promise)};(0,l.setOnDeviceChange)(function(){var t,o,c,d,s,f,v;return n.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.default.awrap((0,l.getAllVideoDevices)());case 2:if(t=p.sent,o=(0,u.default)(we).find(function(t){return!M.map(function(t){return t.deviceId}).includes(t.deviceId)}),O(we),c=t.find(function(t){return!G.map(function(t){return t.deviceId}).includes(t.deviceId)}),L(t),ue||!o){p.next=10;break}return De(o),p.abrupt("return");case 10:if(ie||!c){p.next=13;break}return Oe(c),p.abrupt("return");case 13:d=!we.map(function(t){return t.deviceId}).includes(null==le?void 0:le.selectedDeviceId),s=!t.map(function(t){return t.deviceId}).includes(null==fe?void 0:fe.selectedDeviceId),ue||void 0!==b&&!d||(f=we[0],De(f)),ie||void 0!==y&&!s||(v=t[0],Oe(v));case 17:case"end":return p.stop()}},null,null,null,Promise)}),(0,c.useEffect)(function(){Ce(void 0),O(we)},[we]);var ye={mediaTracks:{webcamTrack:y,setWebcamTrack:V,audioTrack:b,setAudioTrack:N,screenShareVideoTrack:W,setScreenShareVideoTrack:F,screenShareAudioTrack:U,setScreenShareAudioTrack:J},inputDevices:{audioInputDevices:M,videoInputDevices:G,setAudioInputDevices:O,setVideoInputDevices:L,setAudioDevice:De,setVideoDevice:Oe,toggleAudioState:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleAudioState',{audioButtonsEnabled:Ie,audioAllowed:$,audioMuted:ue,audioTrack:!!b}),Ie){t.next=3;break}return t.abrupt("return");case 3:$?ue?(b&&'ended'!==(null==b?void 0:b.readyState)||De(void 0),Pe((0,f.setAudioMuted)(!1))):Pe((0,f.setAudioMuted)(!0)):ue||Pe((0,f.setAudioMuted)(!0));case 4:case"end":return t.stop()}},null,null,null,Promise)},toggleVideoState:function(t){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleVideoState',{videoButtonsEnabled:Te,videoOff:ie}),Te){t.next=3;break}return t.abrupt("return");case 3:ie?Oe():xe();case 4:case"end":return t.stop()}},null,null,null,Promise)},onAudioInputChange:function(t){var u;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:I.default.trace('onAudioInputChange',{value:t}),u=M.find(function(n){return n.deviceId===t}),Ce(u);case 3:case"end":return n.stop()}},null,null,null,Promise)},onVideoInputChange:function(t){I.default.trace('onVideoInputChange',{value:t});var n=G.find(function(n){return n.deviceId===t});Pe((0,f.setCameraFacing)(n.facing)),Oe(n)}},setupStreams:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(Me());case 2:return t.next=4,n.default.awrap(ke());case 4:case"end":return t.stop()}},null,null,null,Promise)},videoButtonsEnabled:Te,audioButtonsEnabled:Ie};return c.default.createElement(w.Provider,{value:ye},ae)};var n=t(r(_d[1])),u=t(r(_d[2])),o=t(r(_d[3])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=P(n);if(u&&u.has(t))return u.get(t);var o={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in t)if("default"!==d&&Object.prototype.hasOwnProperty.call(t,d)){var s=c?Object.getOwnPropertyDescriptor(t,d):null;s&&(s.get||s.set)?Object.defineProperty(o,d,s):o[d]=t[d]}o.default=t,u&&u.set(t,o);return o})(r(_d[4])),d=r(_d[5]),s=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=r(_d[9]),p=t(r(_d[10])),S=r(_d[11]),T=r(_d[12]),I=t(r(_d[13]));function P(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(P=function(t){return t?u:n})(t)}var E=T.NativeModules.InCallManager,w=(new T.NativeEventEmitter(E),(0,c.createContext)(null));e.UserTrackContext=w},579,[1,67,49,41,165,432,480,580,487,508,583,482,2,578]); __d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.setOnDeviceChange=e.getWebcamConstraints=e.getVideoTrack=e.getSpeakerTrack=e.getScreenShareConstraints=e.getScreenShare=e.getQualityAfterLegacyModeShift=e.getAudioTrack=e.getAllVideoDevices=e.getAllMediaDevices=e.AudioDevicesEmitter=void 0;var n=t(r(_d[1])),u=t(r(_d[2])),c=t(r(_d[3])),o=t(r(_d[4])),s=r(_d[5]),d=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=t(r(_d[9])),h=l.NativeModules.InCallManager,D=new l.NativeEventEmitter(h),p=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.enumerateDevices());case 2:return t=n.sent,n.abrupt("return",t);case 4:case"end":return n.stop()}},null,null,null,Promise)};e.getAllMediaDevices=p;var w=(function(){function t(n){if((0,u.default)(this,t),!n)throw new Error('Callback not initalized');this.callback=n,this.notConnected={connected:!1,haveMic:!1},this.connectedWithMic={connected:!0,haveMic:!0},this.connectedWithoutMic={connected:!0,haveMic:!1};var c=(0,d.getHeadset)();this.audioDevices={speaker:this.connectedWithMic,bluetooth:c?this.connectedWithMic:this.notConnected,wired:this.notConnected},this.checkIfWiredHeadphonesConnected(),this.onBluetoothEvent(),this.onWiredHeadsetEvent(),this.emit(),this.wiredHeadListener=null}return(0,c.default)(t,[{key:"checkIfWiredHeadphonesConnected",value:function(){var t;return o.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,o.default.awrap(v.default.getIsWiredHeadsetPluggedIn());case 2:t=u.sent,this.audioDevices=(0,n.default)({},this.audioDevices,{wired:t?this.connectedWithMic:this.notConnected}),this.emit();case 5:case"end":return u.stop()}},null,this,null,Promise)}},{key:"onBluetoothEvent",value:function(){var t=this;(0,d.addListener)(function(u){var c=t.audioDevices.bluetooth.connected;u&&!c?(t.audioDevices=(0,n.default)({},t.audioDevices,{bluetooth:(0,n.default)({},t.connectedWithMic)}),t.emit()):!u&&c&&(t.audioDevices=(0,n.default)({},t.audioDevices,{bluetooth:(0,n.default)({},t.notConnected)}),t.emit())})}},{key:"onWiredHeadsetEvent",value:function(){var t=this;this.wiredHeadListener=D.addListener('WiredHeadset',function(u){if(u){var c=u.isPlugged,o=u.hasMic,s=t.audioDevices.wired.connected;if(c&&!s){var d=o?(0,n.default)({},t.connectedWithMic):(0,n.default)({},t.connectedWithoutMic);t.audioDevices=(0,n.default)({},t.audioDevices,{wired:d}),t.emit()}else!c&&s&&(t.audioDevices=(0,n.default)({},t.audioDevices,{wired:(0,n.default)({},t.notConnected)}),t.emit())}})}},{key:"getAudioDevices",value:function(){return this.formatAudioDevices()}},{key:"formatAudioDevices",value:function(){var t=this;return Object.keys(this.audioDevices).map(function(u){var c=t.audioDevices[u];return(0,n.default)({},c,{deviceId:u,label:u,kind:'audioinput'})}).filter(function(t){return t.connected})}},{key:"emit",value:function(){this.callback(this.formatAudioDevices())}},{key:"removeListener",value:function(){var t;null==(t=this.wiredHeadListener)||t.remove()}}]),t})();e.AudioDevicesEmitter=w;e.getAllVideoDevices=function(){var t,n;return o.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return t={},u.next=3,o.default.awrap(p());case 3:return n=u.sent,u.abrupt("return",n.filter(function(n){return'videoinput'===n.kind&&!t[n.facing]&&(t[n.facing]=!0,n)}));case 5:case"end":return u.stop()}},null,null,null,Promise)};e.getWebcamConstraints=function(t,n){var u=f.VIDEO_CONSTRAINS[t.toLowerCase()];if(!u)throw new Error('Invalid quality');if(n){if(n<5||n>30)throw new Error('Invalid framerate');u.frameRate={ideal:n}}return u};e.getScreenShareConstraints=function(t,n){var u=f.VIDEO_CONSTRAINS_SCREENSHARE[t.toLowerCase()||'vga'];if(!u)throw new Error('Invalid quality');if(n){if(n<5||n>30)throw new Error('Invalid framerate');u.frameRate={max:n}}return u};e.getVideoTrack=function(t,u){var c,d;return o.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return c=u||f.VIDEO_CONSTRAINS.vga,l.next=3,o.default.awrap(s.mediaDevices.getUserMedia({video:(0,n.default)({deviceId:t||'',frameRate:24},c),audio:!1}));case 3:return d=l.sent,l.abrupt("return",d.getVideoTracks()[0]);case 5:case"end":return l.stop()}},null,null,null,Promise)};e.getAudioTrack=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.getUserMedia({audio:!0,video:!1}));case 2:return t=n.sent,n.abrupt("return",t.getAudioTracks()[0]);case 4:case"end":return n.stop()}},null,null,null,Promise)};e.getSpeakerTrack=function(t){return o.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null);case 2:case"end":return t.stop()}},null,null,null,Promise)};e.getScreenShare=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.getDisplayMedia({audio:!0,video:{displaySurface:'monitor',logicalSurface:!0,cursor:!0,width:{max:1920},height:{max:1080},frameRate:{max:5}}}));case 2:return t=n.sent,n.abrupt("return",{video:t.getTracks()[0],audio:null});case 4:case"end":return n.stop()}},null,null,null,Promise)};e.setOnDeviceChange=function(t){};e.getQualityAfterLegacyModeShift=function(t,n,u){return n===f.HD_QUALITY_PEERS_LIMIT&&t?f.VIDEO_CONSTRAINS.vga:n!==f.HD_QUALITY_PEERS_LIMIT+1||t?u:f.VIDEO_CONSTRAINS.hd}},580,[1,22,9,10,67,400,581,2,582,583]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.useBluetoothHeadsetDetection=e.removeListener=e.getHeadset=e.addListener=void 0;var n=t(r(d[1])),u=r(d[2]),o=r(d[3]),s=u.NativeModules.DyteRNBluetoothHeadsetDetect,c=null,v=[],f=new u.NativeEventEmitter(s).addListener('onChange',function(t){var n=t.devices;c=n.length?n[0]:null,v.forEach(function(t){t(c)})});e.getHeadset=function(){return c};var l=function(t){v.push(t)};e.addListener=l;var h=function(t){var n=v.indexOf(t);-1!==n&&v.splice(n,1)};e.removeListener=h;e.useBluetoothHeadsetDetection=function(){var t=(0,o.useState)(null),u=(0,n.default)(t,2),s=u[0],v=u[1];return(0,o.useEffect)(function(){return v(c),l(v),function(){h(v),f.remove()}},[]),s}},581,[1,41,2,165]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.WEBCAM_SIMULCAST_ENCODINGS_VGA=e.WEBCAM_SIMULCAST_ENCODINGS=e.WEBCAM_KSVC_ENCODINGS=e.VIDEO_CONSTRAINS_SCREENSHARE=e.VIDEO_CONSTRAINS=e.SCREEN_SHARING_SVC_ENCODINGS=e.SCREEN_SHARING_SIMULCAST_ENCODINGS=e.PC_PROPRIETARY_CONSTRAINTS=e.ICE_SERVERS=e.HD_QUALITY_PEERS_LIMIT=void 0;e.VIDEO_CONSTRAINS={qqvga:{width:{ideal:160},height:{ideal:120}},qvga:{width:320,height:240},vga:{width:640,height:480},hd:{width:1280,height:720},hd_cropped:{width:900,height:720}};e.VIDEO_CONSTRAINS_SCREENSHARE={vga:{width:{max:640},height:{max:480}},hd:{width:{max:1280},height:{max:720}},full_hd:{width:{max:1980},height:{max:1080}}};e.PC_PROPRIETARY_CONSTRAINTS={optional:[{googDscp:!0},{googHighStartBitrate:0},{googPayloadPadding:!0},{googScreencastMinBitrate:100},{googCpuOveruseDetection:!0},{googCpuOveruseEncodeUsage:!0},{googCpuUnderuseThreshold:55},{googCpuOveruseThreshold:85}]};e.WEBCAM_SIMULCAST_ENCODINGS=[{rid:'r0',scalabilityMode:'S1T3'},{rid:'r1',scalabilityMode:'S1T3'},{rid:'r2',scalabilityMode:'S1T3'}];e.WEBCAM_SIMULCAST_ENCODINGS_VGA=[{rid:'r0',scalabilityMode:'S1T2'},{rid:'r1',scalabilityMode:'S1T2'}];e.WEBCAM_KSVC_ENCODINGS=[{scalabilityMode:'L3T3_KEY'}];e.SCREEN_SHARING_SIMULCAST_ENCODINGS=[{dtx:!0,maxBitrate:15e5},{dtx:!0,maxBitrate:6e6}];e.SCREEN_SHARING_SVC_ENCODINGS=[{scalabilityMode:'L3T3',dtx:!0}];e.HD_QUALITY_PEERS_LIMIT=1;e.ICE_SERVERS=[{urls:'turn:turn.dyte.in:443?transport=tcp',username:'dyte',credential:'dytein',credentialType:'password'},{urls:'turn:turn.dyte.in:3478?transport=udp',username:'dyte',credential:'dytein',credentialType:'password'}]},582,[]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),o=t(r(d[3])),s=r(d[4]),l=r(d[4]).NativeModules.InCallManager,c=new((function(){function t(){(0,u.default)(this,t),this.vibrate=!1,this.audioUriMap={ringtone:{_BUNDLE_:null,_DEFAULT_:null},ringback:{_BUNDLE_:null,_DEFAULT_:null},busytone:{_BUNDLE_:null,_DEFAULT_:null}}}return(0,o.default)(t,[{key:"start",value:function(t){var n=!1!==(t=void 0===t?{}:t).auto,u='video'===t.media?'video':'audio',o=t.ringback&&'string'==typeof t.ringback?t.ringback:'';l.start(u,n,o)}},{key:"stop",value:function(t){var n=(t=void 0===t?{}:t).busytone&&'string'==typeof t.busytone?t.busytone:'';l.stop(n)}},{key:"getIsWiredHeadsetPluggedIn",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n.default.awrap(l.getIsWiredHeadsetPluggedIn());case 3:return t.abrupt("return",t.sent);case 6:throw t.prev=6,t.t0=t.catch(0),new Error('Incall Manager Error getting wired headset');case 9:case"end":return t.stop()}},null,null,[[0,6]],Promise)}},{key:"setKeepScreenOn",value:function(t){t=!0===t,l.setKeepScreenOn(t)}},{key:"setSpeakerphoneOn",value:function(t){t=!0===t,l.setSpeakerphoneOn(t)}},{key:"setForceSpeakerphoneOn",value:function(t){var n='boolean'==typeof t?t?1:-1:0;l.setForceSpeakerphoneOn(n)}},{key:"setMicrophoneMute",value:function(t){t=!0===t,l.setMicrophoneMute(t)}},{key:"getAudioUri",value:function(t,u){var o;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(void 0!==this.audioUriMap[t]){s.next=2;break}return s.abrupt("return",null);case 2:if(!this.audioUriMap[t][u]){s.next=4;break}return s.abrupt("return",this.audioUriMap[t][u]);case 4:return s.prev=4,s.next=7,n.default.awrap(l.getAudioUriJS(t,u));case 7:if(!('string'==typeof(o=s.sent)&&o.length>0)){s.next=11;break}return this.audioUriMap[t][u]=o,s.abrupt("return",o);case 11:return s.abrupt("return",null);case 14:return s.prev=14,s.t0=s.catch(4),s.abrupt("return",null);case 17:case"end":return s.stop()}},null,this,[[4,14]],Promise)}},{key:"chooseAudioRoute",value:function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(l.chooseAudioRoute(t));case 2:return u=o.sent,o.abrupt("return",u);case 4:case"end":return o.stop()}},null,null,null,Promise)}},{key:"requestAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.requestAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}},{key:"abandonAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.abandonAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}}]),t})());e.default=c},583,[1,67,9,10,2]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),o=t(r(d[3])),s=r(d[4]),l=r(d[4]).NativeModules.InCallManager,c=new((function(){function t(){(0,u.default)(this,t),this.vibrate=!1,this.audioUriMap={ringtone:{_BUNDLE_:null,_DEFAULT_:null},ringback:{_BUNDLE_:null,_DEFAULT_:null},busytone:{_BUNDLE_:null,_DEFAULT_:null}}}return(0,o.default)(t,[{key:"start",value:function(t){var n=!1!==(t=void 0===t?{}:t).auto,u='video'===t.media?'video':'audio',o=t.ringback&&'string'==typeof t.ringback?t.ringback:'';l.start(u,n,o)}},{key:"stop",value:function(t){var n=(t=void 0===t?{}:t).busytone&&'string'==typeof t.busytone?t.busytone:'';l.stop(n)}},{key:"getIsWiredHeadsetPluggedIn",value:function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,u.next=3,n.default.awrap(l.getIsWiredHeadsetPluggedIn());case 3:return t=u.sent,u.abrupt("return",{isWiredHeadsetPluggedIn:t});case 7:throw u.prev=7,u.t0=u.catch(0),new Error('Incall Manager Error getting wired headset');case 10:case"end":return u.stop()}},null,null,[[0,7]],Promise)}},{key:"setKeepScreenOn",value:function(t){t=!0===t,l.setKeepScreenOn(t)}},{key:"setSpeakerphoneOn",value:function(t){t=!0===t,l.setSpeakerphoneOn(t)}},{key:"setForceSpeakerphoneOn",value:function(t){var n='boolean'==typeof t?t?1:-1:0;l.setForceSpeakerphoneOn(n)}},{key:"setMicrophoneMute",value:function(t){t=!0===t,l.setMicrophoneMute(t)}},{key:"getAudioUri",value:function(t,u){var o;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(void 0!==this.audioUriMap[t]){s.next=2;break}return s.abrupt("return",null);case 2:if(!this.audioUriMap[t][u]){s.next=4;break}return s.abrupt("return",this.audioUriMap[t][u]);case 4:return s.prev=4,s.next=7,n.default.awrap(l.getAudioUriJS(t,u));case 7:if(!('string'==typeof(o=s.sent)&&o.length>0)){s.next=11;break}return this.audioUriMap[t][u]=o,s.abrupt("return",o);case 11:return s.abrupt("return",null);case 14:return s.prev=14,s.t0=s.catch(4),s.abrupt("return",null);case 17:case"end":return s.stop()}},null,this,[[4,14]],Promise)}},{key:"chooseAudioRoute",value:function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(l.chooseAudioRoute(t));case 2:return u=o.sent,o.abrupt("return",u);case 4:case"end":return o.stop()}},null,null,null,Promise)}},{key:"requestAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.requestAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}},{key:"abandonAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.abandonAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}}]),t})());e.default=c},583,[1,67,9,10,2]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),o=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=_(t);if(o&&o.has(e))return o.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=u?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(n,s,l):n[s]=e[s]}n.default=e,o&&o.set(e,n);return n})(r(d[2])),n=r(d[3]),u=r(d[4]),s=r(d[5]),l=r(d[6]),c=r(d[7]),f=r(d[8]),p=e(r(d[9])),N=r(d[10]),E=r(d[11]),h=r(d[12]),v=r(d[13]),S=e(r(d[14])),y=r(d[15]),P=r(d[16]),w=r(d[17]),T=r(d[18]),O=r(d[19]),C=r(d[20]),x=r(d[21]),b=e(r(d[22])),I=e(r(d[23])),M=e(r(d[24]));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(_=function(e){return e?o:t})(e)}var D="\nquery Session($roomName: String!, $password: String) {\n\tsession(roomName: $roomName, password: $password) {\n\t title,\n\t roomNodeLink,\n\t roomName,\n\t password\n\t}\n }\n";function k(e){var _,k=(0,n.useDispatch)(),j=e.roomName,L=e.autoTune,W=(0,n.useSelector)(function(e){return e.participant.peerId}),R=(0,o.useContext)(y.ConfigServiceContext),U=R.meeting,$=R.sessionConfig,A=R.updatePreset,Q=((0,o.useContext)(P.ThemeContext).colors,(0,o.useState)('')),B=(0,t.default)(Q,2),F=B[0],G=B[1],V=(0,h.useManualQuery)(D,{variables:{roomName:j,password:''}}),q=(0,t.default)(V,2),K=q[0],Y=q[1],z=Y.data,H=Y.error,J=Y.loading,X=(0,v.useWindowDimensions)(),Z=$.theme.dimensions||X,ee=Z.height,te=Z.width,re=o.default.useState(!1),oe=(0,t.default)(re,2),ne=(oe[0],oe[1]),ae=(0,o.useContext)(w.UserTrackContext).setupStreams,ie=(0,n.useSelector)(function(e){return e.participant.authToken}),ue=(0,n.useSelector)(function(e){return e.participant.displayName}),se=(0,n.useSelector)(function(e){return e.participant.participantPermissions}),le=$.permissions.produce.audio,me=$.permissions.produce.video.allow,ce=(0,n.useSelector)(function(e){return e.room.showSetupScreen}),de=o.default.useState(j),fe=(0,t.default)(de,2),pe=fe[0],Ne=fe[1],Ee='LANDSCAPE'===o.default.useContext(x.OrientationContext).orientation,he=(0,n.useSelector)(function(e){return e.room.roomViewType}),ve=$.permissions_fetched;(0,o.useEffect)(function(){ve&&(me?(0,O.setupPermissions)(['camera','microphone']):le?(0,O.setupPermissions)(['microphone']):(0,O.setupPermissions)([]),ne(!0))},[he,ve]),(0,o.useEffect)(function(){k((0,c.resetRoom)({roomName:j})),k((0,f.resetPeers)());try{S.default.getItem('dyte-display-name').then(function(e){null!==e&&k((0,E.setUserDisplayName)(e))})}catch(e){}},[]),(0,o.useEffect)(function(){pe&&(ie||C.DYTE_DEV_MODE)&&(k((0,c.resetRoom)({roomName:pe})),K({variables:{roomName:pe,password:''}}),A(pe,ie))},[pe,ie]),(0,o.useEffect)(function(){if(H)if(H.graphQLErrors[0].message.indexOf('No open session')>=0)null==U||U._onError('MEETING_NOTFOUND'),G('MEETING_NOTFOUND');else try{var e=H.graphQLErrors[0];G(null==e?void 0:e.message)}catch(e){G('UNKNOWN')}},[H,U]),(0,o.useEffect)(function(){se.camera===E.permissionEnum.INIT&&se.microphone===E.permissionEnum.INIT||ae()},[se.camera,se.microphone]);if(se.bluetooth===E.permissionEnum.INIT)return o.default.createElement(p.default,{text:"Waiting for permissions..."});var Se;return null==U||!U.showSetupScreen||null!==ce&&!0!==ce?H?o.default.createElement(p.default,{errorText:"Some error occured. Issue code: "+F,childComponents:o.default.createElement(T.Button,{onClick:function(){setTimeout(function(){k((0,f.resetPeers)()),k((0,E.resetParticipant)()),k((0,c.setShowSetupScreen)(!0)),Ne(''),G('')})}},o.default.createElement(T.Box,{bg:"primary.500",py:15,px:10,mt:10,borderRadius:b.default.medium,align:"center"},o.default.createElement(T.Text,null,"Try Again")))}):J?o.default.createElement(p.default,{text:"Loading..."}):o.default.createElement(l.WebSocketProvider,{url:null==z?void 0:null==(_=z.session)?void 0:_.roomNodeLink,roomURL:pe,peerId:W},o.default.createElement(u.MediaRoomProvider,{peerId:W,roomName:pe,autoTune:L},o.default.createElement(N.PeersProvider,null,o.default.createElement(s.PluginServiceProvider,{roomName:pe,peerId:W},o.default.createElement(I.default,{roomName:pe}))))):o.default.createElement(M.default,{width:te,height:ee,isLandscape:Ee,meetingCode:pe,roomName:j,onChangeMeetingCode:Ne,joinMeeting:function(){ue&&pe&&(k((0,c.setShowSetupScreen)(!1)),k((0,c.resetRoom)({roomName:pe})),K({variables:{roomName:pe,password:''}}),A(pe,ie))},title:null==z?void 0:null==(Se=z.session)?void 0:Se.title})}k.defaultProps={autoTune:!0};var j=k;_e.default=j},584,[1,41,165,432,585,672,630,480,481,511,674,487,465,2,488,508,514,579,512,675,543,575,676,677,809]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.MediaRoomProvider=e.MediaRoomContext=void 0;var n=t(r(d[1])),o=t(r(d[2])),u=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=T(n);if(o&&o.has(t))return o.get(t);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var l=c?Object.getOwnPropertyDescriptor(t,s):null;l&&(l.get||l.set)?Object.defineProperty(u,s,l):u[s]=t[s]}u.default=t,o&&o.set(t,u);return u})(r(d[3])),c=r(d[4]),s=r(d[5]),l=r(d[6]),f=r(d[7]),p=t(r(d[8])),v=r(d[9]),S=r(d[10]),E=r(d[11]),M=t(r(d[12])),k=r(d[13]),C=r(d[14]),P=t(r(d[15])),R=r(d[16]),O=t(r(d[17]));function T(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(T=function(t){return t?o:n})(t)}var b=R.NativeModules.DyteHelper,A=(0,u.createContext)(null);e.MediaRoomContext=A;e.MediaRoomProvider=function(t){var T=t.children,x=t.peerId,y=t.roomName,h=t.autoTune,D=(0,u.useContext)(v.WebSocketContext),N=(0,u.useContext)(k.ConfigServiceContext),w=N.meeting,I=N.sessionConfig,_=I.permissions.produce.audio,L=(0,u.useContext)(E.UserTrackContext),j=L.mediaTracks,W=j.webcamTrack,B=j.audioTrack,F=L.inputDevices.toggleVideoState,G=(0,c.useDispatch)(),U=(0,u.useState)(null),V=(0,o.default)(U,2),q=V[0],H=V[1],z=(0,u.useRef)(null),J=(0,u.useRef)(null),K=(0,u.useRef)(''),Q=(0,u.useRef)(null),X=(0,c.useSelector)(function(t){return t.room.socketState}),Y=(0,c.useSelector)(function(t){return t.room.producersState}),Z=(0,c.useSelector)(function(t){return t.participant.videoProduction}),$=(0,c.useSelector)(function(t){return t.participant.audioProduction}),ee=(0,c.useSelector)(function(t){return t.participant.audioMuted});(0,u.useEffect)(function(){q&&(J.current=q)},[q]),(0,u.useEffect)(function(){q&&(ee?q.muteSelf():q.unmuteSelf())},[ee]),(0,u.useEffect)(function(){Y===s.MediaStates.LOADED&&Z===s.MediaStates.CONNECTING&&(W?null==q||q.shareWebcam(W):null==q||q.disableWebcam())},[W,Y]),(0,u.useEffect)(function(){Y===s.MediaStates.LOADED&&$===s.MediaStates.CONNECTING&&(B&&_&&!ee?null==q||q.shareMic(B):null==q||q.disableMic())},[B,$]),(0,u.useEffect)(function(){var t;if(X===s.RoomSocketState.CONNECTED){M.default.captureEvent('setting up connection',{peerId:x}),w&&w.emit(w.Events.connect);var o=new p.default(x,D,G,h);H(o),t=o,n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(t.getRoomState());case 2:return o.next=4,n.default.awrap(t.loadRouter());case 4:return o.next=6,n.default.awrap(Promise.all([t.createRecvTransport(),t.createSendTransport()]));case 6:w&&(w.sendRoomMessage=function(t){D.sendMessage({type:C.Events.roomMessage,payload:{message:t}})},w.sendMessage=function(t,n){D.sendMessage({type:C.Events.message,payload:{peerId:t,message:n}})},w.kickAll=function(){I.permissions.kick_participant&&t.kickAll()},null==D||D.emitter.on('socket',function(t){return w.onSocketMessage(t)})),G((0,s.setRouterFetchState)(s.MediaStates.LOADED)),G((0,s.setProducersState)(s.MediaStates.NOT_STARTED));case 9:case"end":return o.stop()}},null,null,null,Promise)}else X===s.RoomSocketState.DISCONNECTED&&(M.default.captureEvent('socket disconnected',{peerId:x}),null==q||q.stopAllTransports(),null==D||D.emitter.removeAllListeners(),G((0,s.resetRoom)({roomName:y})),G((0,f.resetPeers)()),G((0,S.resetParticipant)()),H(null),(0,s.setRouterFetchState)(s.MediaStates.NOT_APPLICABLE))},[X,x]),(0,u.useEffect)(function(){return function(){var t,n;null==(t=J.current)||t.stopAllProducers(),null==(n=J.current)||n.stopAllTransports()}},[]);var te=function(t){K.current.match(/inactive|background/)&&'active'===t?(O.default.trace('configureBackground'),P.default.clearInterval(Q.current),Q.current=null,W&&(W.enabled=!1,setTimeout(function(){W&&(W.enabled=!0)},100)),z.current&&(z.current=!1,F()),l.store.getState().room.screenShareRequested||b.stopService()):(null===Q.current&&n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(O.default.trace('configureForeground'),W&&'DISABLE_CAMERA_CAPTURE'===w.setupConfig.backgroundBehaviour&&(F(),z.current=!0),!(R.Platform.Version>=26)){t.next=5;break}return t.next=5,n.default.awrap(b.createNotificationChannel());case 5:return t.next=7,n.default.awrap(b.startService());case 7:case"end":return t.stop()}},null,null,null,Promise),Q.current=P.default.setInterval(function(){},1e3),K.current=t)};(0,u.useEffect)(function(){if('android'===R.Platform.OS){var t=R.AppState.addEventListener('change',te);return function(){t?t.remove():R.AppState.removeEventListener('change',te),Q.current&&P.default.clearInterval(Q.current)}}return function(){}},[W,F]);var ne={mediaRoom:q};return u.default.createElement(A.Provider,{value:ne},T)}},585,[1,67,41,165,432,480,471,481,586,630,487,579,663,508,665,671,2,578]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1])),n=t(r(d[2])),o=t(r(d[3])),u=t(r(d[4])),c=r(d[5]),l=r(d[6]),p=r(d[7]),h=r(d[8]),f=r(d[9]),y=r(d[10]),v=r(d[11]),k=(function(){function t(s,n,u){!(arguments.length>3&&void 0!==arguments[3])||arguments[3];(0,o.default)(this,t),this.socketObj=n,this.peerid=s,this.dispatch=u,this.device=new c.Device,this.consumers=new Map,this.legacyMode=!0,this.closedConsumers=[],this.handleSockets=this.handleSockets.bind(this)}return(0,u.default)(t,[{key:"handleSockets",value:function(t,s){if(t)switch(t.type){case'websocket/new-consumer':this.createConsumer(t.payload,s);break;case'websocket/consumer-closed':this.closeConsumer(t.payload);break;case'websocket/consumer-paused':this.pauseConsumer(t.payload);break;case'websocket/consumer-resumed':this.resumeConsumer(t.payload);break;case'websocket/recording-started':this.setRecordingStatus(!0);break;case'websocket/recording-stopped':this.setRecordingStatus(!1)}}},{key:"loadRouter",value:function(){var t,n,o;return s.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return(this.recvTransport||this.sendTransport)&&this.stopAllTransports(),this.dispatch((0,f.setRouterFetchState)(f.MediaStates.CONNECTING)),u.next=4,s.default.awrap(null==(t=this.socketObj)?void 0:t.sendMessage({type:'getRouterRtpCapabilities'}));case 4:return n=u.sent,this.device.loaded&&(this.device=new c.Device),(o=null==n?void 0:n.payload)&&(o.headerExtensions=o.headerExtensions.filter(function(t){return'urn:3gpp:video-orientation'!==t.uri})),this.socketObj.emitter.on('socket',this.handleSockets),u.abrupt("return",this.device.load({routerRtpCapabilities:o}));case 10:case"end":return u.stop()}},null,this,null,Promise)}},{key:"getRoomState",value:function(){var t;return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.CONNECTING)),n.next=3,s.default.awrap(null==(t=this.socketObj)?void 0:t.sendMessage({type:'getRoomState'}));case 3:this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.LOADED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"changeRoomDisplayTitle",value:function(t){var n;return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.CONNECTING)),o.next=3,s.default.awrap(null==(n=this.socketObj)?void 0:n.sendMessage({type:'changeDisplayTitle',payload:{displayTitle:t}}));case 3:this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.LOADED));case 4:case"end":return o.stop()}},null,this,null,Promise)}},{key:"joinRoom",value:function(t,n,o){var u;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,s.default.awrap(this.socketObj.sendMessage({type:'joinRoom',payload:{device:(0,p.getDeviceInfo)(),displayName:t,rtpCapabilities:this.device.rtpCapabilities,isLegacy:this.legacyMode,audioMuted:n}}));case 2:if(u=c.sent,this.legacyMode=u.payload.legacyMode||this.legacyMode,!o||''===o){c.next=7;break}return c.next=7,s.default.awrap(this.changeRoomDisplayTitle(o));case 7:return this.dispatch((0,v.roomJoined)(u.payload)),c.abrupt("return",u);case 9:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createRecvTransport",value:function(){var t,o,u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==this.socketObj){c.next=2;break}return c.abrupt("return");case 2:return t={forceTcp:!1,producing:!1,consuming:!0},c.next=5,s.default.awrap(this.socketObj.sendMessage({type:'createWebRtcTransport',payload:t}));case 5:o=c.sent.payload,this.recvTransport=this.device.createRecvTransport((0,n.default)({},o,{iceServers:l.ICE_SERVERS,proprietaryConstraints:l.PC_PROPRIETARY_CONSTRAINTS})),this.recvTransport.on('connect',function(t,s,n){var o,c,l=t.dtlsParameters;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'connectWebRtcTransport',payload:{transportId:null==(c=u.recvTransport)?void 0:c.id,dtlsParameters:l}},function(t){t.payload.error?n():s()})});case 8:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createSendTransport",value:function(){var t,o,u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return t={forceTcp:!1,producing:!0,consuming:!1},c.next=3,s.default.awrap(this.socketObj.sendMessage({type:'createWebRtcTransport',payload:t}));case 3:o=c.sent.payload,this.sendTransport=this.device.createSendTransport((0,n.default)({},o,{iceServers:l.ICE_SERVERS,proprietaryConstraints:l.PC_PROPRIETARY_CONSTRAINTS})),void 0!==this.sendTransport&&(this.sendTransport.on('connect',function(t,s,n){var o,c,l=t.dtlsParameters;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'connectWebRtcTransport',payload:{transportId:null==(c=u.sendTransport)?void 0:c.id,dtlsParameters:l}},function(t){t.payload.error?n():s()})}),this.sendTransport.on('produce',function(t,s,n){var o,c,l=t.kind,p=t.rtpParameters,h=t.appData;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'produce',payload:{transportId:null==(c=u.sendTransport)?void 0:c.id,kind:l,rtpParameters:p,appData:h}},function(t){t.payload.error?n(t.payload.error):s({id:t.payload.id})})}));case 6:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createConsumer",value:function(t,o){var u,c,l,p,h,f,v,k,P,w,b;return s.default.async(function(x){for(;;)switch(x.prev=x.next){case 0:if(void 0!==this.recvTransport&&!this.recvTransport.closed){x.next=2;break}return x.abrupt("return");case 2:return u=t.peerId,c=t.producerId,l=t.id,p=t.kind,h=t.rtpParameters,f=t.type,v=t.appData,k=t.producerPaused,P=t.remotelyPaused,w=t.priority,x.next=5,s.default.awrap(this.recvTransport.consume({id:l,producerId:c,kind:p,rtpParameters:h,appData:(0,n.default)({},v,{peerId:u})}));case 5:b=x.sent,this.closedConsumers.includes(l)?b.close():(this.consumers.set(b.id,b),this.dispatch((0,y.addConsumer)({id:l,peerId:u,type:f,kind:p,remotelyPaused:P,producerPaused:k,priority:w,appData:b.appData,score:10,producerScore:10}))),o&&o('Done');case 8:case"end":return x.stop()}},null,this,null,Promise)}},{key:"closeConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=6;break}return console.log('Consumer not found'),this.closedConsumers.push(n),s.abrupt("return");case 6:o.close(),this.consumers.delete(n);case 8:case"end":return s.stop()}},null,this,null,Promise)}},{key:"pauseConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=4;break}return s.abrupt("return");case 4:o.pause();case 5:case"end":return s.stop()}},null,this,null,Promise)}},{key:"resumeConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=4;break}return s.abrupt("return");case 4:o.resume();case 5:case"end":return s.stop()}},null,this,null,Promise)}},{key:"shareWebcam",value:function(t){var n,o,u,c,p,y=this;return s.default.async(function(v){for(;;)switch(v.prev=v.next){case 0:if(void 0!==t){v.next=2;break}return v.abrupt("return");case 2:if(!this.webCamProducer){v.next=5;break}return v.next=5,s.default.awrap(this.removeProducer('webCamProducer',!1));case 5:return n=l.WEBCAM_SIMULCAST_ENCODINGS_VGA,o=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp9'===t.mimeType.toLowerCase()})||void 0,u=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp8'===t.mimeType.toLowerCase()})||void 0,o&&!this.legacyMode&&(n=l.WEBCAM_KSVC_ENCODINGS),this.dispatch((0,h.setVideoOff)(!1)),this.dispatch((0,h.setVideoProduction)(f.MediaStates.FETCHED)),c={track:t,encodings:n,codecOptions:{videoGoogleStartBitrate:1e3},codec:(function(){return y.legacyMode?u:o})(),appData:{screenShare:!1},stopTracks:!1},p=function(){y.disableWebcam()},v.next=16,s.default.awrap(this.createProducer('webCamProducer',c,p));case 16:this.dispatch((0,h.setVideoProduction)(f.MediaStates.LOADED));case 17:case"end":return v.stop()}},null,this,null,Promise)}},{key:"shareScreen",value:function(t){var n,o,u,c,p,y,v,k,P=this;return s.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:if(n=t.video,o=t.audio,void 0!==n){w.next=3;break}return w.abrupt("return");case 3:return u=l.SCREEN_SHARING_SIMULCAST_ENCODINGS,null===(c=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp9'===t.mimeType.toLowerCase()})||null)||this.legacyMode||(u=l.SCREEN_SHARING_SVC_ENCODINGS),this.dispatch((0,h.setScreenSharing)(!0)),this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.FETCHED)),p={track:n,encodings:u,codecOptions:{videoGoogleStartBitrate:1e3},codec:this.legacyMode?void 0:c,appData:{screenShare:!0},stopTracks:!1},y=function(){P.disableScreenShare()},w.next=12,s.default.awrap(this.createProducer('screenShareVideoProducer',p,y));case 12:if(!o){w.next=17;break}return v={track:o,codecOptions:{opusDtx:!0,opusStereo:!1,opusFec:!0},appData:{screenShare:!0},stopTracks:!1},k=function(){},w.next=17,s.default.awrap(this.createProducer('screenShareAudioProducer',v,k));case 17:this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.LOADED));case 18:case"end":return w.stop()}},null,this,null,Promise)}},{key:"shareMic",value:function(t,n){var o,u,c=this;return s.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:if(void 0!==t){l.next=2;break}return l.abrupt("return");case 2:if(!this.micProducer){l.next=5;break}return l.next=5,s.default.awrap(this.removeProducer('micProducer',!1));case 5:return n&&this.dispatch((0,h.setAudioMuted)(n||!1)),this.dispatch((0,h.setAudioProduction)(f.MediaStates.FETCHED)),o={track:t,codecOptions:{opusDtx:!0,opusStereo:!1,opusFec:!0},stopTracks:!1},u=function(){c.disableMic()},l.next=11,s.default.awrap(this.createProducer('micProducer',o,u));case 11:this.dispatch((0,h.setAudioProduction)(f.MediaStates.LOADED));case 12:case"end":return l.stop()}},null,this,null,Promise)}},{key:"pauseMic",value:function(){this.dispatch((0,h.setAudioMuted)(!0)),this.micProducer.pause()}},{key:"pauseWebcam",value:function(){this.dispatch((0,h.setVideoOff)(!0)),this.webCamProducer.pause()}},{key:"resumeMic",value:function(){this.dispatch((0,h.setAudioMuted)(!1)),this.micProducer.resume()}},{key:"resumeWebcam",value:function(){this.dispatch((0,h.setVideoOff)(!1)),this.webCamProducer.resume()}},{key:"disableWebcam",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return t&&null!=t&&t.silent||this.dispatch((0,h.setVideoOff)(!0)),n.next=3,s.default.awrap(this.removeProducer('webCamProducer'));case 3:this.dispatch((0,h.setVideoProduction)(f.MediaStates.NOT_STARTED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableMic",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return t&&null!=t&&t.silent||this.dispatch((0,h.setAudioMuted)(!0)),n.next=3,s.default.awrap(this.removeProducer('micProducer'));case 3:this.dispatch((0,h.setAudioProduction)(f.MediaStates.NOT_STARTED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableScreenShare",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.NOT_STARTED)),this.dispatch((0,h.setScreenSharing)(!1)),t.next=4,s.default.awrap(this.removeProducer('screenShareVideoProducer'));case 4:return t.next=6,s.default.awrap(this.removeProducer('screenShareAudioProducer'));case 6:case"end":return t.stop()}},null,this,null,Promise)}},{key:"stopAllProducers",value:function(){this.webCamProducer&&this.removeProducer('webCamProducer'),this.screenShareVideoProducer&&this.removeProducer('screenShareVideoProducer'),this.screenShareAudioProducer&&this.removeProducer('screenShareAudioProducer'),this.micProducer&&this.removeProducer('micProducer')}},{key:"stopAllTransports",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.sendTransport){try{this.sendTransport.close()}catch(t){console.log('awaitqueue error')}this.sendTransport=null}if(this.recvTransport){try{this.recvTransport.close()}catch(t){console.log('awaitqueue error')}this.recvTransport=null}this.dispatch((0,f.setRouterFetchState)(f.MediaStates.NOT_STARTED));case 3:case"end":return t.stop()}},null,this,null,Promise)}},{key:"resetVideoProducers",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(!t){o.next=4;break}return o.next=3,s.default.awrap(this.removeProducer('webCamProducer',!1));case 3:this.shareWebcam(t);case 4:if(!n){o.next=8;break}return o.next=7,s.default.awrap(this.removeProducer('screenShareVideoProducer',!1));case 7:this.shareScreen({video:n});case 8:case"end":return o.stop()}},null,this,null,Promise)}},{key:"createProducer",value:function(t,n,o){var u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==this.sendTransport&&!this.sendTransport.closed){c.next=2;break}return c.abrupt("return");case 2:return c.next=4,s.default.awrap(this.sendTransport.produce(n));case 4:this[t]=c.sent,this[t].on('transportclose',function(){u[t]=void 0}),this[t].on('trackended',function(){u.socketObj.sendMessage({type:'closeProducer',payload:{producerId:u[t].id}}),o()});case 7:case"end":return c.stop()}},null,this,null,Promise)}},{key:"removeProducer",value:function(t){var n,o=arguments;return s.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:if(n=!(o.length>1&&void 0!==o[1])||o[1],this[t]&&!this[t].closed){u.next=3;break}return u.abrupt("return");case 3:return n&&this[t].track.stop(),this[t].close(),u.next=7,s.default.awrap(this.socketObj.sendMessage({type:'closeProducer',payload:{producerId:this[t].id}}));case 7:this[t]=null;case 8:case"end":return u.stop()}},null,this,null,Promise)}},{key:"sendMessage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'chatMessage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"getMesssages",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getChatMessages'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"getPolls",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getPolls'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"newPoll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'newPoll',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"votePoll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'votePoll',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"acceptWaitingRequest",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'acceptWaitingRequest',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"rejectWaitingRequest",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'rejectWaitingRequest',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"muteAll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteAllNew',payload:{allowUnMute:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"rejectRequestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'rejectRequestToJoinStage',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"muteAllVideo",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteAllVideo'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"pin",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'pinPeer',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableAudio",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'disableAudioPeerNew',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableVideo",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'disableVideoPeer',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"kickAll",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'kickAll'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"kick",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'kick',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"getPage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getPage',payload:{pageNum:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"setRecordingStatus",value:function(t){return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:window.triggerDyteRecording=t;case 1:case"end":return s.stop()}},null,null,null,Promise)}},{key:"muteSelf",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteSelf'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"unmuteSelf",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'unmuteSelf'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"requestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'requestToJoinStage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"acceptAllRequestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'acceptAllRequestToJoinStage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removePeerFromStage",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,s.default.awrap(this.socketObj.sendMessage({type:'removePeerFromStage',payload:{id:t,type:n}}));case 2:case"end":return o.stop()}},null,this,null,Promise)}},{key:"startPresenting",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'startPresenting'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"stopPresenting",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'stopPresenting'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"updatePreset",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,s.default.awrap(this.socketObj.sendMessage({type:'updatePeerPreset',payload:{id:t,presetName:n}}));case 2:case"end":return o.stop()}},null,this,null,Promise)}}]),t})();e.default=k},586,[1,67,22,9,10,587,582,493,487,480,505,481]); @@ -676,7 +676,7 @@ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.d __d(function(g,r,i,a,m,_e,d){var t='__lodash_hash_undefined__',e=9007199254740991,n='[object Arguments]',o='[object Boolean]',c='[object Date]',u='[object Function]',f='[object GeneratorFunction]',s='[object Map]',l='[object Number]',_='[object Object]',p='[object RegExp]',h='[object Set]',y='[object String]',v='[object Symbol]',b='[object ArrayBuffer]',j='[object DataView]',w='[object Float32Array]',O='[object Float64Array]',A='[object Int8Array]',x='[object Int16Array]',S='[object Int32Array]',P='[object Uint8Array]',$='[object Uint8ClampedArray]',k='[object Uint16Array]',E='[object Uint32Array]',I=/\w*$/,F=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,B={};B[n]=B['[object Array]']=B[b]=B[j]=B[o]=B[c]=B[w]=B[O]=B[A]=B[x]=B[S]=B[s]=B[l]=B[_]=B[p]=B[h]=B[y]=B[v]=B[P]=B[$]=B[k]=B[E]=!0,B['[object Error]']=B[u]=B["[object WeakMap]"]=!1;var U='object'==typeof g&&g&&g.Object===Object&&g,W='object'==typeof self&&self&&self.Object===Object&&self,D=U||W||Function('return this')(),R='object'==typeof _e&&_e&&!_e.nodeType&&_e,T=R&&'object'==typeof m&&m&&!m.nodeType&&m,z=T&&T.exports===R;function C(t,e){return t.set(e[0],e[1]),t}function L(t,e){return t.add(e),t}function V(t,e){for(var n=-1,o=t?t.length:0;++n-1},Ft.prototype.set=function(t,e){var n=this.__data__,o=Dt(n,t);return o<0?n.push([t,e]):n[o][1]=e,this},Mt.prototype.clear=function(){this.__data__={hash:new It,map:new(jt||Ft),string:new It}},Mt.prototype.delete=function(t){return Zt(this,t).delete(t)},Mt.prototype.get=function(t){return Zt(this,t).get(t)},Mt.prototype.has=function(t){return Zt(this,t).has(t)},Mt.prototype.set=function(t,e){return Zt(this,t).set(t,e),this},Bt.prototype.clear=function(){this.__data__=new Ft},Bt.prototype.delete=function(t){return this.__data__.delete(t)},Bt.prototype.get=function(t){return this.__data__.get(t)},Bt.prototype.has=function(t){return this.__data__.has(t)},Bt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ft){var o=n.__data__;if(!jt||o.length<199)return o.push([t,e]),this;n=this.__data__=new Mt(o)}return n.set(t,e),this};var rr=yt?Q(yt,Object):function(){return[]},er=function(t){return ut.call(t)};function nr(t){var e=t.length,n=t.constructor(e);return e&&'string'==typeof t[0]&&ct.call(t,'index')&&(n.index=t.index,n.input=t.input),n}function or(t){return'function'!=typeof t.constructor||ar(t)?{}:br(e=lt(t))?_t(e):{};var e}function cr(t,e,n,u){var f,_,F,M=t.constructor;switch(e){case b:return Gt(t);case o:case c:return new M(+t);case j:return Nt(t,u);case w:case O:case A:case x:case S:case P:case $:case k:case E:return Jt(t,u);case s:return qt(t,u,n);case l:case y:return new M(t);case p:return(F=new(_=t).constructor(_.source,I.exec(_))).lastIndex=_.lastIndex,F;case h:return Ht(t,u,n);case v:return f=t,Et?Object(Et.call(f)):{}}}function ur(t,n){return!!(n=null==n?e:n)&&('number'==typeof t||M.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=e}function br(t){var e=typeof t;return!!t&&('object'==e||'function'==e)}function dr(t){return!!t&&'object'==typeof t}function jr(t){return _r(t)?Ut(t):Lt(t)}m.exports=function(t){return Tt(t,!0,!0)}},670,[]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),c=r(d[3]),l=c.NativeModules.DyteRNBackgroundTimer,o=new c.NativeEventEmitter(l),s=new((function(){function t(){var u=this;(0,n.default)(this,t),this.uniqueId=0,this.callbacks={},o.addListener('backgroundTimer.timeout',function(t){if(u.callbacks[t]){var n=u.callbacks[t].callback;u.callbacks[t].interval?l.backgroundTimerSetTimeout(t,u.callbacks[t].timeout):delete u.callbacks[t],n()}})}return(0,u.default)(t,[{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return l.start(t)}},{key:"stop",value:function(){return l.stop()}},{key:"runBackgroundTimer",value:function(t,n){var u=this,l=c.Platform.select({ios:function(){return c.NativeAppEventEmitter},android:function(){return c.DeviceEventEmitter}})();this.start(0),this.backgroundListener=l.addListener('backgroundTimer',function(){u.backgroundListener.remove(),u.backgroundClockMethod(t,n)})}},{key:"backgroundClockMethod",value:function(t,n){var u=this;this.backgroundTimer=this.setTimeout(function(){t(),u.backgroundClockMethod(t,n)},n)}},{key:"stopBackgroundTimer",value:function(){this.stop(),this.clearTimeout(this.backgroundTimer)}},{key:"setTimeout",value:function(t,n){this.uniqueId+=1;var u=this.uniqueId;return this.callbacks[u]={callback:t,interval:!1,timeout:n},l.setTimeout(u,n),u}},{key:"clearTimeout",value:function(t){this.callbacks[t]&&delete this.callbacks[t]}},{key:"setInterval",value:function(t,n){this.uniqueId+=1;var u=this.uniqueId;return this.callbacks[u]={callback:t,interval:!0,timeout:n},l.backgroundTimerSetTimeout(u,n),u}},{key:"clearInterval",value:function(t){this.callbacks[t]&&delete this.callbacks[t]}}]),t})());e.default=s},671,[1,9,10,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.PluginServiceProvider=e.PluginServiceContext=void 0;var n=t(r(d[1])),o=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=v(n);if(o&&o.has(t))return o.get(t);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var l=c?Object.getOwnPropertyDescriptor(t,f):null;l&&(l.get||l.set)?Object.defineProperty(u,f,l):u[f]=t[f]}u.default=t,o&&o.set(t,u);return u})(r(d[2])),u=r(d[3]),c=r(d[4]),f=t(r(d[5])),l=r(d[6]);function v(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(v=function(t){return t?o:n})(t)}var p=(0,o.createContext)(null);e.PluginServiceContext=p;e.PluginServiceProvider=function(t){var v=t.children,s=t.roomName,P=t.peerId,S=(0,o.useContext)(l.WebSocketContext),y=(0,u.useDispatch)(),O=(0,o.useState)(null),b=(0,n.default)(O,2),k=b[0],j=b[1],C=(0,u.useSelector)(function(t){return t.participant.authToken});(0,o.useEffect)(function(){},[]);var w=(0,u.useSelector)(function(t){return t.room.socketState}),E={pluginManager:k};return(0,o.useEffect)(function(){if(w===c.RoomSocketState.CONNECTED){var t=new f.default(S,s,y,P,C);j(t),t.listenSocketEvents()}},[w]),o.default.createElement(p.Provider,{value:E},v)}},672,[1,41,165,432,480,673,630]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),u=t(r(d[3])),l=t(r(d[4])),o=r(d[5]),c=t(r(d[6])),f=(function(){function t(n,s,l,o,c){(0,u.default)(this,t),this.socketObj=n,this.dispatch=l,this.roomName=s,this.plugins={},this.iframes={},this.peerId=o,this.authToken=c,this.handleSockets=this.handleSockets.bind(this)}return(0,l.default)(t,[{key:"handleSockets",value:function(t){if(t)switch(t.type){case'websocket/enable-plugin':this.enablePlugin(t.payload);break;case'websocket/disable-plugin':this.disablePlugin(t.payload);break;case'websocket/plugin-event':case'websocket/plugin-data':this.sendIframeEvent(t)}}},{key:"sendIframeEvent",value:function(t){var n=this.iframes[t.payload.pluginId||t.payload.id];n&&Object.values(n).forEach(function(n){n.iframe&&n.iframe.injectJavaScript("window.postMessage("+JSON.stringify(t)+");")})}},{key:"listenSocketEvents",value:function(){this.socketObj.emitter.on('socket',this.handleSockets),this.getRoomPlugins()}},{key:"getRoomPlugins",value:function(){var t=this;this.socketObj.sendMessage({type:'getRoomState'},function(n){n.payload.roomState.plugins.forEach(function(n){return t.enablePlugin(n)})})}},{key:"enablePlugin",value:function(t){var u,l,f,h,p,v;return n.default.async(function(k){for(;;)switch(k.prev=k.next){case 0:if(u=c.default.apiBase+"/v2/plugins",!this.plugins[t.id]){k.next=3;break}return k.abrupt("return");case 3:return k.next=5,n.default.awrap(fetch(c.default.apiBase+"/v2/plugins/view/"+t.id,{method:'GET',headers:{authorization:"Bearer "+this.authToken}}));case 5:return l=k.sent,k.next=8,n.default.awrap(l.json());case 8:return f=k.sent,k.next=11,n.default.awrap(fetch(u+"/authorize/"+t.id,{method:'POST',headers:{authorization:"Bearer "+this.authToken,'Content-Type':'application/json'},body:JSON.stringify({roomName:this.roomName,peerId:this.peerId})}));case 11:return h=k.sent,k.next=14,n.default.awrap(h.json());case 14:p=k.sent.data.token,v=(0,s.default)({},f.data.plugin,{authToken:p,enabledBy:t.enabledBy,ACLAccessGrantedUsers:t.ACLAccessGrantedUsers||[],ACLAccessRemovedUsers:t.ACLAccessRemovedUsers||[]}),this.plugins[t.id]=v,this.iframes[t.id]={},this.dispatch((0,o.addPlugin)(v));case 19:case"end":return k.stop()}},null,this,null,Promise)}},{key:"disablePlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.plugins[t.id]&&(delete this.plugins[t.id],this.dispatch((0,o.removePlugin)(t)));case 1:case"end":return n.stop()}},null,this,null,Promise)}},{key:"handleIframeMessage",value:function(t){var s=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=t.type,n.next='pluginEvent'===n.t0?3:'storePluginData'===n.t0?3:'getPluginData'===n.t0?3:'getPeerInfo'===n.t0?3:'enablePluginForAll'===n.t0?3:5;break;case 3:return this.socketObj.sendMessage(t,function(t){s.sendIframeEvent(t)}),n.abrupt("break",6);case 5:return n.abrupt("break",6);case 6:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addIframeView",value:function(t,s,u){var l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&this.removeIframeView(t),l=function(t){s&&o.handleIframeMessage(t)},u.addEventListener(l),this.iframes[t.plugin][t.view]={listener:l,iframe:s};case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removeIframeView",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&delete this.iframes[t.plugin][t.view];case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addRoomPlugin",value:function(t){return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.plugins[t.id]){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,n.default.awrap(this.socketObj.sendMessage({type:'addPlugin',payload:t}));case 4:case"end":return s.stop()}},null,this,null,Promise)}},{key:"removeRoomPlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.socketObj.sendMessage({type:'removePlugin',payload:t}));case 1:case"end":return n.stop()}},null,this,null,Promise)}}]),t})();e.default=f},673,[1,67,22,9,10,503,504]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),u=t(r(d[3])),l=t(r(d[4])),o=r(d[5]),c=t(r(d[6])),f=(function(){function t(n,s,l,o,c){(0,u.default)(this,t),this.socketObj=n,this.dispatch=l,this.roomName=s,this.plugins={},this.iframes={},this.peerId=o,this.authToken=c,this.handleSockets=this.handleSockets.bind(this)}return(0,l.default)(t,[{key:"handleSockets",value:function(t){if(t)switch(t.type){case'websocket/enable-plugin':this.enablePlugin(t.payload);break;case'websocket/disable-plugin':this.disablePlugin(t.payload);break;case'websocket/plugin-event':case'websocket/plugin-data':this.sendIframeEvent(t)}}},{key:"sendIframeEvent",value:function(t){var n=this.iframes[t.payload.pluginId||t.payload.id];n&&Object.values(n).forEach(function(n){n.iframe&&n.iframe.injectJavaScript("window.postMessage("+JSON.stringify(t)+");")})}},{key:"listenSocketEvents",value:function(){this.socketObj.emitter.on('socket',this.handleSockets),this.getRoomPlugins()}},{key:"getRoomPlugins",value:function(){var t=this;this.socketObj.sendMessage({type:'getRoomState'},function(n){n.payload.roomState.plugins.forEach(function(n){return t.enablePlugin(n)})})}},{key:"enablePlugin",value:function(t){var u,l,f,h,p,v;return n.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:if(u=c.default.apiBase+"/v2/plugins",!this.plugins[t.id]){y.next=3;break}return y.abrupt("return");case 3:return y.next=5,n.default.awrap(fetch(c.default.apiBase+"/v2/plugins/view/"+t.id,{method:'GET',headers:{authorization:"Bearer "+this.authToken}}));case 5:return l=y.sent,y.next=8,n.default.awrap(l.json());case 8:return f=y.sent,y.next=11,n.default.awrap(fetch(u+"/authorize/"+t.id,{method:'POST',headers:{authorization:"Bearer "+this.authToken,'Content-Type':'application/json'},body:JSON.stringify({roomName:this.roomName,peerId:this.peerId})}));case 11:return h=y.sent,y.next=14,n.default.awrap(h.json());case 14:p=y.sent.data.token,v=(0,s.default)({},f.data.plugin,{authToken:p,enabledBy:t.enabledBy,ACLAccessGrantedUsers:t.ACLAccessGrantedUsers||[],ACLAccessRemovedUsers:t.ACLAccessRemovedUsers||[]}),this.plugins[t.id]=v,this.iframes[t.id]={},this.dispatch((0,o.addPlugin)(v));case 19:case"end":return y.stop()}},null,this,null,Promise)}},{key:"disablePlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.plugins[t.id]&&(delete this.plugins[t.id],this.dispatch((0,o.removePlugin)(t)));case 1:case"end":return n.stop()}},null,this,null,Promise)}},{key:"handleIframeMessage",value:function(t){var u,l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=t.type,n.next='pluginEvent'===n.t0?3:'storePluginData'===n.t0?3:'getPluginData'===n.t0?3:'enablePluginForAll'===n.t0?3:'getPeerInfo'===n.t0?5:7;break;case 3:return this.socketObj.sendMessage(t,function(t){o.sendIframeEvent(t)}),n.abrupt("break",8);case 5:return this.socketObj.sendMessage({type:t.type,payload:(0,s.default)({},t.payload,{peerId:null!=(u=null==(l=t.payload)?void 0:l.peerId)?u:this.peerId})},function(t){o.sendIframeEvent(t)}),n.abrupt("break",8);case 7:return n.abrupt("break",8);case 8:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addIframeView",value:function(t,s,u){var l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&this.removeIframeView(t),l=function(t){s&&o.handleIframeMessage(t)},u.addEventListener(l),this.iframes[t.plugin][t.view]={listener:l,iframe:s};case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removeIframeView",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&delete this.iframes[t.plugin][t.view];case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addRoomPlugin",value:function(t){return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.plugins[t.id]){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,n.default.awrap(this.socketObj.sendMessage({type:'addPlugin',payload:t}));case 4:case"end":return s.stop()}},null,this,null,Promise)}},{key:"removeRoomPlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.socketObj.sendMessage({type:'removePlugin',payload:t}));case 1:case"end":return n.stop()}},null,this,null,Promise)}}]),t})();e.default=f},673,[1,67,22,9,10,503,504]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.PeersServiceContext=e.PeersProvider=void 0;var t=n(r(d[1])),o=n(r(d[2])),u=n(r(d[3])),c=(function(n,t){if(!t&&n&&n.__esModule)return n;if(null===n||"object"!=typeof n&&"function"!=typeof n)return{default:n};var o=b(t);if(o&&o.has(n))return o.get(n);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in n)if("default"!==l&&Object.prototype.hasOwnProperty.call(n,l)){var s=c?Object.getOwnPropertyDescriptor(n,l):null;s&&(s.get||s.set)?Object.defineProperty(u,l,s):u[l]=n[l]}u.default=n,o&&o.set(n,u);return u})(r(d[4])),l=r(d[5]),s=r(d[6]),f=r(d[7]),p=r(d[8]),v=r(d[9]),S=r(d[10]),P=r(d[11]),h=r(d[12]),k=r(d[13]);function b(n){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(b=function(n){return n?o:t})(n)}var y=(0,c.createContext)(null);e.PeersServiceContext=y;e.PeersProvider=function(n){var b,T,M=n.children,w=(0,c.useContext)(p.ConfigServiceContext).meeting,C=(0,c.useState)([]),V=(0,u.default)(C,2),x=V[0],D=V[1],O=(0,l.useSelector)(function(n){return n.peers.joinedPeers}),A=(0,l.useSelector)(function(n){return n.participant}),j=(0,l.useSelector)(function(n){return n.consumers.activeConsumers}),I=j.find(function(n){return'video'===n.kind&&n.appData.screenShare}),_=j.find(function(n){return'audio'===n.kind&&n.appData.screenShare}),E=(0,l.useSelector)(function(n){return n.room.pinnedPeerId}),H=(0,l.useSelector)(function(n){return n.room.roomViewType}),N=(0,c.useState)(null),q=(0,u.default)(N,2),J=q[0],L=q[1],R=(0,c.useState)(null),U=(0,u.default)(R,2),W=U[0],z=U[1],B=(0,c.useContext)(f.MediaRoomContext).mediaRoom,F=(0,l.useDispatch)(),G=(0,c.useContext)(v.UserTrackContext),K=G.mediaTracks,Q=K.screenShareVideoTrack,X=K.setScreenShareVideoTrack,Y=(K.screenShareAudioTrack,K.setScreenShareAudioTrack),Z=G.inputDevices,$=Z.toggleAudioState,ee=Z.toggleVideoState,re={pin:function(n){return B.pin(n)},unpin:function(n){return B.pin(null)},toggleSelfAudio:function(){return $()},toggleSelfVideo:function(){return ee()},toggleSelfScreenSharing:function(){var n;return t.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(A.sharingScreen||I){o.next=16;break}return void 0!==Q&&Q.stop(),o.prev=2,o.next=5,t.default.awrap((0,S.getScreenShare)());case 5:n=o.sent,X(n.video),Y(n.video),B.shareScreen(n),o.next=14;break;case 11:o.prev=11,o.t0=o.catch(2),'NotAllowedError'!==(null==o.t0?void 0:o.t0.message)&&console.error(o.t0);case 14:o.next=19;break;case 16:B.disableScreenShare(),X(void 0),Y(void 0);case 19:case"end":return o.stop()}},null,null,[[2,11]],Promise)},disablePeerAudio:function(n){return B.disableAudio(n)},disablePeerVideo:function(n){return B.disableVideo(n)},updatePreset:function(n,t){return B.updatePreset(n,t)},setLabel:function(n,t){F((0,s.setPeerLabel)({id:n,label:t}))}},ne=!0;(0,c.useEffect)(function(){var n,t;L({id:null==B?void 0:B.peerid,audioMuted:A.audioMuted,displayName:A.displayName,userId:A.id,picture:A.displayImageURL,isMe:!0,isHost:A.isHost,videoVisible:!A.videoOff,videoTrack:null==B?void 0:null==(n=B.webCamProducer)?void 0:n.track,audioTrack:null==B?void 0:null==(t=B.micProducer)?void 0:t.track,isPinned:E===(null==B?void 0:B.peerid),clientSpecificId:A.clientSpecificId,producingAudio:!A.audioMuted,producingVideo:!A.videoOff,isScreensharing:A.sharingScreen,requestToJoinType:A.requestToJoinType,hiddenParticipant:A.hidden,webinarHiddenParticipant:A.webinarHiddenParticipant,metadata:A.metadata})},[null==B?void 0:B.peerid,A.sharingScreen,A.videoOff,A.audioMuted,A.displayName,A.hidden,A.requestToJoinType,A.metadata,null==B?void 0:null==(b=B.webCamProducer)?void 0:b.track,null==B?void 0:null==(T=B.micProducer)?void 0:T.track,A.webinarHiddenParticipant,E]),(0,c.useEffect)(function(){J&&w&&w._addUpdateParticipant((0,o.default)({},J,{isPinned:J.id===E,isScreensharing:A.sharingScreen}),re)},[J,w]),(0,c.useEffect)(function(){if(I||A.screenSharingProduction===P.MediaStates.LOADED){var n,t,o,u=I?null==(n=B.consumers.get(I.id))?void 0:n.track:null==(t=B.screenShareVideoProducer)?void 0:t.track,c=_?null==(o=B.consumers.get(_.id))?void 0:o.track:null,l=I?O.find(function(n){return n.id===I.appData.peerId}):J;z({videoTrack:u,id:null==l?void 0:l.id,displayName:"Screen - "+(null==l?void 0:l.displayName),videoVisible:!0,audioTrack:c,audioMuted:null===c,screenshare:!0})}else z(null)},[I,A.screenSharingProduction]),(0,c.useEffect)(function(){w&&(x.map(function(n){return O.find(function(t){return t.id===n.id})||w._removeParticipant(n),null}),D(O))},[O]);var ie=function(n){var t,u=(0,o.default)({},n,{isPinned:E===n.id,isScreensharing:!1}),c=j.find(function(t){return t.peerId===n.id&&'video'===t.kind&&!t.appData.screenShare}),l=j.find(function(t){return t.peerId===n.id&&'audio'===t.kind&&!t.appData.screenShare});return c&&(u.producingVideo=!0,u.videoTrack=B.consumers.get(c.id).track,u.videoScore=c.producerScore),l&&(u.producingAudio=!n.audioMuted,u.audioTrack=B.consumers.get(l.id).track,u.audioScore=l.producerScore),(null==I?void 0:null==(t=I.appData)?void 0:t.peerId)===n.id&&(u.isScreensharing=!0),u.videoVisible=!(void 0===c||c.remotelyPaused),u.audioMuted=void 0===l||l.remotelyPaused||n.audioMuted,u.audioMuted||(ne=!1),w&&w._addUpdateParticipant((0,o.default)({},u,{isPinned:u.id===E}),re),u},te=H===h.DyteViewTypes.webinar?O.filter(function(n){return!(null!=n&&n.webinarHiddenParticipant)&&n.requestToJoinType!==k.RequestToJoinType.ask}).map(ie).filter(function(n){return null!==n}):O.filter(function(n){return!(null!=n&&n.hiddenParticipant)}).map(ie).filter(function(n){return null!==n}),oe=O.map(ie).filter(function(n){return null!==n});return c.default.createElement(y.Provider,{value:{processedPeers:te,selfPeer:J,allMuted:ne,screenshareVideoConsumer:I,screenshareAudioConsumer:_,screenSharePeer:W,joinedProcessedPeers:oe}},M)}},674,[1,67,22,41,165,432,481,585,508,579,580,480,482,487]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.setupPermissions=e.RESULTS=e.PERMISSIONS=void 0,e.uniq=N;var E=n(r(d[1])),s=n(r(d[2])),o=r(d[3]),A=r(d[4]),O=r(d[5]),R=Object.freeze({ACCEPT_HANDOVER:'android.permission.ACCEPT_HANDOVER',ACCESS_BACKGROUND_LOCATION:'android.permission.ACCESS_BACKGROUND_LOCATION',ACCESS_COARSE_LOCATION:'android.permission.ACCESS_COARSE_LOCATION',ACCESS_FINE_LOCATION:'android.permission.ACCESS_FINE_LOCATION',ACTIVITY_RECOGNITION:'android.permission.ACTIVITY_RECOGNITION',ADD_VOICEMAIL:'com.android.voicemail.permission.ADD_VOICEMAIL',ANSWER_PHONE_CALLS:'android.permission.ANSWER_PHONE_CALLS',BODY_SENSORS:'android.permission.BODY_SENSORS',CALL_PHONE:'android.permission.CALL_PHONE',CAMERA:'android.permission.CAMERA',GET_ACCOUNTS:'android.permission.GET_ACCOUNTS',PROCESS_OUTGOING_CALLS:'android.permission.PROCESS_OUTGOING_CALLS',READ_CALENDAR:'android.permission.READ_CALENDAR',READ_CALL_LOG:'android.permission.READ_CALL_LOG',READ_CONTACTS:'android.permission.READ_CONTACTS',READ_EXTERNAL_STORAGE:'android.permission.READ_EXTERNAL_STORAGE',READ_PHONE_NUMBERS:'android.permission.READ_PHONE_NUMBERS',READ_PHONE_STATE:'android.permission.READ_PHONE_STATE',READ_SMS:'android.permission.READ_SMS',RECEIVE_MMS:'android.permission.RECEIVE_MMS',RECEIVE_SMS:'android.permission.RECEIVE_SMS',RECEIVE_WAP_PUSH:'android.permission.RECEIVE_WAP_PUSH',RECORD_AUDIO:'android.permission.RECORD_AUDIO',SEND_SMS:'android.permission.SEND_SMS',USE_SIP:'android.permission.USE_SIP',WRITE_CALENDAR:'android.permission.WRITE_CALENDAR',WRITE_CALL_LOG:'android.permission.WRITE_CALL_LOG',WRITE_CONTACTS:'android.permission.WRITE_CONTACTS',WRITE_EXTERNAL_STORAGE:'android.permission.WRITE_EXTERNAL_STORAGE',BLUETOOTH_CONNECT:"android.permission.BLUETOOTH_CONNECT"}),_=Object.freeze({APP_TRACKING_TRANSPARENCY:'ios.permission.APP_TRACKING_TRANSPARENCY',BLUETOOTH_PERIPHERAL:'ios.permission.BLUETOOTH_PERIPHERAL',CALENDARS:'ios.permission.CALENDARS',CAMERA:'ios.permission.CAMERA',CONTACTS:'ios.permission.CONTACTS',FACE_ID:'ios.permission.FACE_ID',LOCATION_ALWAYS:'ios.permission.LOCATION_ALWAYS',LOCATION_WHEN_IN_USE:'ios.permission.LOCATION_WHEN_IN_USE',MEDIA_LIBRARY:'ios.permission.MEDIA_LIBRARY',MICROPHONE:'ios.permission.MICROPHONE',MOTION:'ios.permission.MOTION',PHOTO_LIBRARY:'ios.permission.PHOTO_LIBRARY',PHOTO_LIBRARY_ADD_ONLY:'ios.permission.PHOTO_LIBRARY_ADD_ONLY',REMINDERS:'ios.permission.REMINDERS',SIRI:'ios.permission.SIRI',SPEECH_RECOGNITION:'ios.permission.SPEECH_RECOGNITION',STOREKIT:'ios.permission.STOREKIT'}),I=Object.freeze({ANDROID:R,IOS:_});e.PERMISSIONS=I;var t=Object.freeze({UNAVAILABLE:'unavailable',BLOCKED:'blocked',DENIED:'denied',GRANTED:'granted',LIMITED:'limited',PROMPTED:'prompted'});e.RESULTS=t;var S=O.NativeModules.DyteRNPermissions;function C(n){return s.default.async(function(E){for(;;)switch(E.prev=E.next){case 0:return E.abrupt("return",S.available.includes(n)?S.request(n):t.UNAVAILABLE);case 1:case"end":return E.stop()}},null,null,null,Promise)}function N(n){return n.filter(function(E,s){return null!=E&&n.indexOf(E)===s})}var T,p=['bluetooth','readExternalStorage','photos','externalStorage'],L=function(n){var E=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s={camera:I.ANDROID.CAMERA,microphone:I.ANDROID.RECORD_AUDIO,bluetooth:I.ANDROID.BLUETOOTH_CONNECT,externalStorage:I.ANDROID.WRITE_EXTERNAL_STORAGE,readExternalStorage:I.ANDROID.READ_EXTERNAL_STORAGE},o={camera:I.IOS.CAMERA,microphone:I.IOS.MICROPHONE,bluetooth:I.IOS.BLUETOOTH_PERIPHERAL,photos:I.IOS.PHOTO_LIBRARY};if(!E)return'android'===O.Platform.OS?s[n]:o[n];if('android'===O.Platform.OS){var A={};return Object.keys(s).forEach(function(n){A[s[n]]=n}),A[n]}var R={};return Object.keys(o).forEach(function(n){R[o[n]]=n}),R[n]},D=function(n){return function(E){var s={camera:o.permissionEnum.INIT,microphone:o.permissionEnum.INIT};n.forEach(function(n){var A=L(n,!0);E[n]===t.GRANTED?s[A]=o.permissionEnum.ACCEPTED:E[n]!==t.PROMPTED&&(s[A]=o.permissionEnum.DENIED)}),s.camera!==o.permissionEnum.INIT&&s.microphone!==o.permissionEnum.INIT&&T&&clearInterval(T),A.store.dispatch((0,o.setParticipantPermissions)(s))}};e.setupPermissions=function(n){var o,A,R,_,I,t,u=[];[].concat(p,(0,E.default)(n)).forEach(function(n){var E=L(n);E&&u.push(E)}),"android"===O.Platform.OS&&(T&&clearInterval(T),T=setInterval(function(){S.checkMultiplePermissions(u).then(D(u))},1e3));(o=u,s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:if('ios'!==O.Platform.OS){n.next=13;break}A={},R=N(o),_=0;case 4:if(!(_2||Math.abs(e.dy)>2)},[y]),W=n.default.useCallback(function(){var e={x:0,y:0},t=x?x():e;u.Animated.spring(X.current,{toValue:t||e,useNativeDriver:!1}).start()},[X]),q=n.default.useCallback(function(e,t){_.current=!1,k&&(k(e,t,G()),D(e,!0)),p?W():X.current.flattenOffset()},[k,p,D,W,G]),B=n.default.useCallback(function(e,t){F.current=G(),_.current=!0,p||(X.current.setOffset(Y.current),X.current.setValue({x:0,y:0}))},[G,p]),J=n.default.useCallback(function(e,t){var n=t.dx,u=t.dy,o=F.current,s=o.top,f=o.right,c=o.left,b=o.bottom,h=l(n,Number.isFinite(A)?A-c:-999999999,Number.isFinite(N)?N-f:999999999),v=l(u,Number.isFinite(I)?I-s:-999999999,Number.isFinite(T)?T-b:999999999);X.current.setValue({x:h,y:v}),w(e,t)},[N,T,A,I,w]),K=n.default.useMemo(function(){return u.PanResponder.create({onMoveShouldSetPanResponder:function(e,t){return H(t)},onMoveShouldSetPanResponderCapture:function(e,t){return H(t)},onPanResponderGrant:B,onPanResponderMove:u.Animated.event([],{listener:J,useNativeDriver:!1}),onPanResponderRelease:q})},[J,B,q,H]);n.default.useEffect(function(){var e=X.current;return p?W():e.addListener(function(e){return Y.current=e}),function(){e.removeAllListeners()}},[p]);var Q=n.default.useMemo(function(){var e=u.Dimensions.get('window');return{position:'absolute',top:0,left:0,width:e.width,height:e.height}},[]),U=n.default.useMemo(function(){var e={top:L,left:O,elevation:z,zIndex:z};return h&&(e.backgroundColor=h),s&&(e.borderRadius=c),v?(0,t.default)({},e,{alignSelf:'baseline'}):(0,t.default)({},e,{justifyContent:'center',width:c,height:c})},[v,s,h,c,O,L,z]),Z=n.default.useMemo(function(){return v||(b?n.default.createElement(u.Image,{style:{width:c,height:c},source:b}):n.default.createElement(u.Text,{style:f.text},o))},[v,b,c,o]),$=n.default.useCallback(function(e){var t=e.nativeEvent.layout,n=t.height,u=t.width;j.current={x:u,y:n}},[]),ee=n.default.useCallback(function(e){V(e),_.current||D(e,!1)},[V,D]),te=n.default.useCallback(function(){var e=u.Dimensions.get('window'),o=e.width,l=e.height;if(!(A||N||I||T))return null;var s=A||-9999,c=N?o-N:-9999,b=I||-9999,h=T?l-T:-9999;return n.default.createElement(u.View,{pointerEvents:"box-none",style:(0,t.default)({left:s,right:c,top:b,bottom:h},f.debugView)})},[N,T,A,I]);return n.default.createElement(u.View,{pointerEvents:"box-none",style:Q},P&&te(),n.default.createElement(u.Animated.View,(0,t.default)({pointerEvents:"box-none"},R,K.panHandlers,{style:X.current.getLayout()}),n.default.createElement(u.TouchableOpacity,(0,t.default)({},C,{onLayout:$,style:U,disabled:y,onPress:S,onLongPress:M,onPressIn:E,onPressOut:ee}),Z)))}s.defaultProps={renderText:'\uff0b',renderSize:36,shouldReverse:!1,disabled:!1,debug:!1,onDrag:function(){},onShortPressRelease:function(){},onDragRelease:function(){},onLongPress:function(){},onPressIn:function(){},onPressOut:function(){},onRelease:function(){},x:0,y:0,z:1},s.propTypes={renderText:o.default.string,isCircle:o.default.bool,renderSize:o.default.number,imageSource:o.default.number,renderColor:o.default.string,children:o.default.element,shouldReverse:o.default.bool,disabled:o.default.bool,debug:o.default.bool,animatedViewProps:o.default.object,touchableOpacityProps:o.default.object,onDrag:o.default.func,onShortPressRelease:o.default.func,onDragRelease:o.default.func,onLongPress:o.default.func,onPressIn:o.default.func,onPressOut:o.default.func,onRelease:o.default.func,onReverse:o.default.func,x:o.default.number,y:o.default.number,z:o.default.number,minX:o.default.number,minY:o.default.number,maxX:o.default.number,maxY:o.default.number};var f=u.StyleSheet.create({text:{color:'#fff',textAlign:'center'},test:{backgroundColor:'red'},debugView:{backgroundColor:'#ff000044',position:'absolute',borderColor:'#fced0ecc',borderWidth:4}})},706,[1,22,165,2,204]); __d(function(g,r,i,a,m,_e,d){"use strict";var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.swipeDirections=_e.default=void 0;var t=e(r(d[1])),n=e(r(d[2])),o=e(r(d[3])),s=e(r(d[4])),l=e(r(d[5])),u=e(r(d[6])),c=e(r(d[7])),f=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var u=s?Object.getOwnPropertyDescriptor(e,l):null;u&&(u.get||u.set)?Object.defineProperty(o,l,u):o[l]=e[l]}o.default=e,n&&n.set(e,o);return o})(r(d[8])),p=r(d[9]);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var S={SWIPE_UP:"SWIPE_UP",SWIPE_DOWN:"SWIPE_DOWN",SWIPE_LEFT:"SWIPE_LEFT",SWIPE_RIGHT:"SWIPE_RIGHT"};_e.swipeDirections=S;var _={velocityThreshold:.3,directionalOffsetThreshold:80,gestureIsClickThreshold:5};function P(e,t,n,o){return Math.abs(e)>t&&Math.abs(n)0?n:t:this._isValidVerticalSwipe(e)?u>0?s:o:null}},{key:"_isValidHorizontalSwipe",value:function(e){var t=e.vx,n=e.dy,o=this.swipeConfig;return P(t,o.velocityThreshold,n,o.directionalOffsetThreshold)}},{key:"_isValidVerticalSwipe",value:function(e){var t=e.vy,n=e.dx,o=this.swipeConfig;return P(t,o.velocityThreshold,n,o.directionalOffsetThreshold)}},{key:"render",value:function(){return f.default.createElement(p.View,(0,t.default)({},this.props,this._panResponder.panHandlers))}}]),I})(f.Component);_e.default=y},707,[1,22,9,10,16,12,14,17,165,2]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=y(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),p=t(r(d[8]));function y(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(y=function(t){return t?l:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var y=t.isOpen,x=t.onClose,h=t.onLeave,E=(0,l.useContext)(f.ConfigServiceContext).sessionConfig,b=(0,o.useWindowDimensions)(),v=E.theme.dimensions||b,C=(v.height,.9*v.width),w=C/2-20,j=(0,l.useContext)(c.MediaRoomContext).mediaRoom,k=(0,l.useContext)(s.ThemeContext).colors;return l.default.createElement(u.Modal,{isVisible:y,backdropOpacity:.8,backdropColor:k.secondary[800]},l.default.createElement(u.Flex,{width:C,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:p.default.large},l.default.createElement(u.Flex,{py:25},l.default.createElement(u.Text,{fontSize:28,fontWeight:"bold"},"Leave")),l.default.createElement(u.Flex,null,l.default.createElement(u.Text,{fontSize:"lg"},"Are you sure you want to leave the call?")),l.default.createElement(u.Flex,{display:"flex",py:20},l.default.createElement(u.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},l.default.createElement(u.Button,{onClick:x},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"secondary.700",height:40,width:w-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Cancel"))),l.default.createElement(u.Button,{onClick:h},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"danger.500",height:40,width:w-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Leave")))),l.default.createElement(u.Flex,null,E.permissions.kick_participant&&l.default.createElement(u.Button,{onClick:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(j.kickAll());case 2:case"end":return t.stop()}},null,null,null,Promise)}},l.default.createElement(u.Flex,{display:"flex",direction:"row",mt:15,justify:"space-around"},l.default.createElement(u.Flex,{bg:"danger.500",height:40,width:2*w,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"End Meeting"))))))))}},708,[1,67,165,2,512,585,508,514,676]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=x(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),p=t(r(d[8])),y=r(d[9]);function x(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(x=function(t){return t?l:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var x=t.isOpen,h=t.onClose,E=t.onLeave,b=(0,l.useContext)(f.ConfigServiceContext).sessionConfig,v=(0,o.useWindowDimensions)(),C=(0,y.useScale)(b.theme.dimensions||v),w=(C.height,.9*C.width),j=w/2-20,k=(0,l.useContext)(c.MediaRoomContext).mediaRoom,O=(0,l.useContext)(s.ThemeContext).colors;return l.default.createElement(u.Modal,{isVisible:x,backdropOpacity:.8,backdropColor:O.secondary[800]},l.default.createElement(u.Flex,{width:w,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:p.default.large},l.default.createElement(u.Flex,{py:25},l.default.createElement(u.Text,{fontSize:28,fontWeight:"bold"},"Leave")),l.default.createElement(u.Flex,null,l.default.createElement(u.Text,{fontSize:"lg"},"Are you sure you want to leave the call?")),l.default.createElement(u.Flex,{display:"flex",py:20},l.default.createElement(u.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},l.default.createElement(u.Button,{onClick:h},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"secondary.700",height:40,width:j-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Cancel"))),l.default.createElement(u.Button,{onClick:E},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"danger.500",height:40,width:j-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Leave")))),l.default.createElement(u.Flex,null,b.permissions.kick_participant&&l.default.createElement(u.Button,{onClick:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(k.kickAll());case 2:case"end":return t.stop()}},null,null,null,Promise)}},l.default.createElement(u.Flex,{display:"flex",direction:"row",mt:15,justify:"space-around"},l.default.createElement(u.Flex,{bg:"danger.500",height:40,width:2*j,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"End Meeting"))))))))}},708,[1,67,165,2,512,585,508,514,676,493]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=s(n);if(o&&o.has(t))return o.get(t);var l={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var f=c?Object.getOwnPropertyDescriptor(t,u):null;f&&(f.get||f.set)?Object.defineProperty(l,u,f):l[u]=t[u]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=r(d[3]),c=r(d[4]),u=r(d[5]),f=r(d[6]),p=t(r(d[7]));function s(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(s=function(t){return t?o:n})(t)}var b=function(t){var s=t.isOpen,b=t.peers,y=(0,n.useContext)(l.MediaRoomContext).mediaRoom,x=(0,c.useDispatch)(),v=(0,n.useContext)(f.ThemeContext).colors,E=function(t){x((0,u.removeWaitListPeer)({id:t})),y.rejectWaitingRequest(t)};return n.default.createElement(o.Modal,{isVisible:s,backdropOpacity:.8,backdropColor:v.secondary[800]},n.default.createElement(o.Text,{fontWeight:"bold"},"Waiting Requests"),n.default.createElement(o.Stack,{spacing:6,height:"80"},b.map(function(t){return n.default.createElement(o.Flex,{direction:"row",alignItems:"center"},n.default.createElement(p.default,{name:t.name,bgColor:v.primary[700]}),n.default.createElement(o.Flex,{marginLeft:3,flexGrow:1,alignItems:"center",paddingY:2,borderBottom:"1px solid "+v.secondary[800]},n.default.createElement(o.Text,{color:v.textPrimary[200],fontSize:"lg"},t.name),n.default.createElement(o.Flex,{marginLeft:"auto"},n.default.createElement(o.Button,{_hover:{borderColor:v.danger[500]},onClick:function(){return E(t.id)}},n.default.createElement(o.Box,{bg:"secondary.700",p:4},n.default.createElement(o.Icon,{boxSize:"16",name:"close"}))),n.default.createElement(o.Button,{_hover:{borderColor:v.danger[500]},onClick:function(){return E(t.id)}},n.default.createElement(o.Box,{bg:"primary.500",p:4},n.default.createElement(o.Icon,{boxSize:"16",name:"check"}))))))})))};e.default=b},709,[1,165,512,585,432,480,514,682]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var c=u?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(l,o,c):l[o]=e[o]}l.default=e,n&&n.set(e,l);return l})(r(d[2])),l=r(d[3]),u=r(d[4]),o=r(d[5]),c=e(r(d[6])),f=e(r(d[7])),s=r(d[8]),p=r(d[9]),E=r(d[10]),S=e(r(d[11])),b=r(d[12]),h=r(d[13]),x=r(d[14]),w=e(r(d[15])),v=r(d[16]);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}var P=n.default.memo(function(e){var y=e.title,P=(e.copyLink,e.linkCopied,e.width),C=(e.height,e.noOfParticipants,(0,l.useSelector)(function(e){return e.room.waitingState})),O=(0,n.useContext)(s.ConfigServiceContext),I=O.meeting,j=O.sessionConfig,k=(0,l.useSelector)(function(e){return e.plugin.main}),T='LANDSCAPE'===n.default.useContext(o.OrientationContext).orientation,_=(0,l.useSelector)(function(e){return e.peers.recordingPeer}),D=(0,n.useState)(!1),R=(0,t.default)(D,2),W=R[0],M=R[1],B=(0,n.useRef)(null),N=(0,n.useRef)(!1),z=(0,l.useSelector)(function(e){return e.room.roomViewType}),A=(0,l.useSelector)(function(e){return e.participant.presentingState}),V=(0,l.useSelector)(function(e){return e.participant.videoOff}),F=(0,n.useContext)(x.PeersServiceContext),G=(F.processedPeers,F.selfPeer,F.joinedProcessedPeers),L=n.default.useContext(v.DrawerContext),H=L.setDrawerExpander,q=L.setopenedTab;if((0,n.useEffect)(function(){_&&!N.current?(null==I||I.emit(I.Events.recordingStarted),N.current=!0,B.current=setInterval(function(){M(function(e){return!e})},1e3)):!_&&N.current&&(N.current=!1,null==I||I.emit(I.Events.recordingStopped),clearInterval(B.current))},[_]),(0,n.useEffect)(function(){return function(){B.current&&clearInterval(B.current)}},[]),T||k.length>0)return null;return n.default.createElement(E.Flex,{height:56,width:P,bg:"secondary.1000",justify:"center",align:"center",pt:'android'===u.Platform.OS?10:26},n.default.createElement(E.Flex,{borderRadius:c.default.medium,width:P-8,justify:"space-between",direction:"row",px:12},n.default.createElement(E.VStack,null,n.default.createElement(E.Stack,{align:"center",width:P/2},j.theme.header.elements.title?n.default.createElement(E.Text,{fontWeight:"bold"},y):null),n.default.createElement(E.Stack,{isInline:!0,spacing:2,pt:2,align:"center"},j.theme.header.elements.timer&&C!==p.WaitingState.WAITING&&n.default.createElement(f.default,null),_&&W&&n.default.createElement(E.Box,{ml:12,bg:"danger.500",pl:4,pr:6,borderRadius:4,direction:"row",alignItems:"center"},n.default.createElement(E.Icon,{boxSize:"15",name:"fiber-manual-record",fill:"white"}),n.default.createElement(E.Text,{color:"white"},"REC")))),n.default.createElement(E.HStack,{align:"flex-end",mb:2},j.theme.control_bar.elements.participants&&n.default.createElement(E.Box,{mr:28},n.default.createElement(E.Box,{position:"absolute",top:-12,zIndex:25,right:G.length+1>99?-18:-10},n.default.createElement(w.default,{number:G.length+1,color:"primary.500"})),n.default.createElement(E.Button,{onClick:function(){H(!0),q('participants')}},n.default.createElement(E.Icon,{boxSize:"24",name:"people",fill:"textPrimary.100"}))),!V&&(z!==b.DyteViewTypes.webinar||A===h.PresentingState.PRESENTING)&&n.default.createElement(S.default,null))))});_e.default=P},710,[1,41,165,432,2,575,676,711,508,480,512,712,482,487,674,713,714]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=c(n);if(u&&u.has(t))return u.get(t);var o={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in t)if("default"!==l&&Object.prototype.hasOwnProperty.call(t,l)){var s=f?Object.getOwnPropertyDescriptor(t,l):null;s&&(s.get||s.set)?Object.defineProperty(o,l,s):o[l]=t[l]}o.default=t,u&&u.set(t,o);return o})(r(d[2])),o=r(d[3]),f=r(d[4]);function c(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(c=function(t){return t?u:n})(t)}var l=function(t){return Math.trunc(t).toString().padStart(2,'0')},s=function(){var t=(0,o.useSelector)(function(t){return t.room.startedAt}),c=u.default.useRef(),s=u.default.useState(0),p=(0,n.default)(s,2),v=p[0],y=p[1],O=u.default.useRef();return(0,u.useEffect)(function(){return t&&(c.current=requestAnimationFrame(function n(){var u=((new Date).getTime()-new Date(t).getTime())/1e3;y(u),O.current=setTimeout(function(){c.current&&(c.current=requestAnimationFrame(n))},500)})),function(){clearTimeout(O.current),cancelAnimationFrame(c.current)}},[t]),u.default.createElement(f.Text,{color:"textPrimary.400"},v>=3600&&u.default.createElement(u.default.Fragment,null,l(v/3600),"h",' '),l(v%3600/60),"m",' ',l(v%60),"s")};e.default=s},711,[1,41,165,432,512]); @@ -722,13 +722,13 @@ __d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule", __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.MakeMenu=function(t){var c=t.menu;(0,n.useContext)(o.ThemeContext).colors;return n.default.createElement(l.Flex,null,c.map(function(t,o){var c=t.title,s=t.defaultValue,p=t.onChange,b=t.options;return n.default.createElement(n.default.Fragment,{key:(0,f.nanoid)()},0!==o&&n.default.createElement(l.Box,null),n.default.createElement(l.Flex,null,n.default.createElement(l.Text,{fontSize:"md",mb:10,fontWeight:"bold",color:"textPrimary.100"},c),b.map(function(t,o){var c=t.key,f=t.value,b=t.children;return n.default.createElement(l.Button,{key:""+(c+o),onClick:function(){return p(f)}},n.default.createElement(l.HStack,{justify:"space-between",p:16,mb:4,bg:"secondary.800",borderRadius:u.default.small},n.default.createElement(l.Text,{fontSize:"sm"},b),s===f?n.default.createElement(l.Icon,{name:"check",fill:"success.500"}):null))})))}))},e.StageControlButton=p;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=s(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[1])),l=r(d[2]),o=r(d[3]),u=t(r(d[4])),c=r(d[5]),f=r(d[6]);function s(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(s=function(t){return t?l:n})(t)}function p(t){var o=t.variant,u=(t.label,t.icon),f=t.disabled,s=t.onClick,p=(t.isActive,t.menu,t.badge),b=t.ariaLabel,y='LANDSCAPE'===n.default.useContext(c.OrientationContext).orientation;return n.default.createElement(l.Flex,null,''!==p&&n.default.createElement(l.Box,{className:"dyte-client-notificationBadge",bg:"primary.500",textColor:"textPrimary.100",height:4,position:"absolute",right:"2",top:"1",fontSize:"xs"},n.default.createElement("span",null,p)),n.default.createElement(l.Button,{variant:o||'controls',onClick:s,disabled:f},n.default.createElement(l.VStack,{py:10,"aria-label":b,minWidth:64,align:"center",justify:"center"},n.default.createElement(l.Box,{fontSize:"xl",transform:[{rotate:y?'90deg':'0deg'}]},u))))}p.defaultProps={disabled:!1,variant:null,menu:[],isActive:!1,badge:'',ariaLabel:''}},716,[1,165,512,514,676,575,475]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=E(n);if(o&&o.has(t))return o.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(l,c,f):l[c]=t[c]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=r(d[3]),u=r(d[4]),c=r(d[5]),f=t(r(d[6])),s=r(d[7]),p=r(d[8]),y=r(d[9]),x=r(d[10]);function E(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(E=function(t){return t?o:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var E=t.isOpen,b=t.onClose,C=(0,n.useContext)(u.ConfigServiceContext).sessionConfig,h=(0,o.useWindowDimensions)(),v=C.theme.dimensions||h,P=(v.height,.9*v.width),w=P/2-20,S=(0,n.useContext)(c.ThemeContext).colors,T=(0,s.useDispatch)(),O=(0,n.useContext)(p.MediaRoomContext).mediaRoom,j=(0,s.useSelector)(function(t){return t.participant.requestToJoinStageState});return n.default.createElement(l.Modal,{isVisible:E,backdropOpacity:.8,backdropColor:S.secondary[800]},n.default.createElement(l.Flex,{width:P,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:f.default.large},n.default.createElement(l.Flex,{py:25},n.default.createElement(l.Text,{fontSize:28,fontWeight:"bold"},"Drop")),n.default.createElement(l.Flex,null,n.default.createElement(l.Text,{fontSize:"lg"},"Do you want to stop presenting?")),n.default.createElement(l.Flex,{display:"flex",py:20},n.default.createElement(l.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},n.default.createElement(l.Button,{onClick:b},n.default.createElement(l.Flex,{borderRadius:f.default.small,bg:"secondary.700",height:40,width:w-4,alignItems:"center",justifyContent:"center"},n.default.createElement(l.Text,{fontSize:"lg"},"Cancel"))),n.default.createElement(l.Button,{onClick:function(){j===y.RequestToJoinStageState.ACCEPTED?(b(),O.removePeerFromStage(O.peerid,x.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT)):(O.stopPresenting(),T((0,y.stoppedPresenting)()),b())}},n.default.createElement(l.Flex,{borderRadius:f.default.small,bg:"danger.500",height:40,width:w-4,alignItems:"center",justifyContent:"center"},n.default.createElement(l.Text,{fontSize:"lg"},"Drop")))))))}},717,[1,165,2,512,508,514,676,432,585,487,497]); __d(function(g,r,i,a,m,e,d){var s,n,o;Object.defineProperty(e,"__esModule",{value:!0}),e.SessionProducerAccessType=e.SessionJoiningRestriction=e.MessageTypes=void 0,e.SessionJoiningRestriction=s,(function(s){s[s.NO_VIDEO=0]="NO_VIDEO",s[s.NO_MIC=1]="NO_MIC"})(s||(e.SessionJoiningRestriction=s={})),e.SessionProducerAccessType=n,(function(s){s[s.NOT_ALLOWED=0]="NOT_ALLOWED",s[s.REQUEST_FIRST=1]="REQUEST_FIRST",s[s.ALLOWED=2]="ALLOWED"})(n||(e.SessionProducerAccessType=n={})),e.MessageTypes=o,(function(s){s[s.text=0]="text",s[s.image=1]="image",s[s.file=2]="file",s[s.poll=3]="poll"})(o||(e.MessageTypes=o={}))},718,[]); -__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=E(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(o,f,c):o[f]=t[f]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),f=t(r(d[5])),c=r(d[6]),s=r(d[7]),m=t(r(d[8])),p=t(r(d[9])),x=r(d[10]),b=r(d[11]),y=r(d[12]);function E(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(E=function(t){return t?l:n})(t)}var C=function(t){var E=t.options,C=t.unReadChatMessages,h=t.unSeenPolls,w=t.webinarUnseenRequest,v=(0,l.useRef)(null),k=(0,l.useContext)(c.ConfigServiceContext),P=(k.meeting,k.sessionConfig),j=(0,l.useContext)(u.ThemeContext).colors,S=(0,o.useWindowDimensions)(),B=P.theme.dimensions||S,O=B.height,M=B.width,R=l.default.useContext(y.DrawerContext),z=R.drawerExpanded,D=R.setDrawerExpander,T=R.openedTab,_=R.setopenedTab,I=function(){_(null),D(!1)};(0,l.useEffect)(function(){var t;z&&v&&(null==(t=v.current)||t.setModalVisible())},[z]);var W=function(){return _(null),D(!1),!0},A='LANDSCAPE'===l.default.useContext(x.OrientationContext).orientation,F=E.findIndex(function(t){return t.id===T}),q=F>-1?F:null;if(z&&q&&E[q].mainComponent)return l.default.createElement(o.Modal,{visible:!0,onRequestClose:W},l.default.createElement(s.Flex,{width:M,height:O,bg:"secondary.1000",direction:"row",flexWrap:"wrap",justify:"space-between"},l.default.createElement(p.default,{heading:E[q].label,onBackButtonClick:W}),l.default.createElement(s.Box,{width:M},E[q].mainComponent)));var H=A?24:8;return l.default.createElement(n.default,{containerStyle:{backgroundColor:j.secondary[900],justifyContent:'space-between'},overlayColor:"#000",ref:v,extraScroll:1,onClose:I,gestureEnabled:!0},null===q?l.default.createElement(s.VStack,{px:"6",py:"10",mx:H,borderRadius:m.default.medium,bg:"secondary.800",mb:12},E.map(function(t,n){var o=t.label,u=t.icon,c=t.disabled,p=t.id;return l.default.createElement(s.Button,{key:(0,b.nanoid)(),onClick:void 0!==E[n].onClick?E[n].onClick:function(){return _(p)},disabled:c},l.default.createElement(s.HStack,{p:12,px:16,borderRadius:m.default.small,align:"center",justify:"space-between"},l.default.createElement(s.Text,{fontSize:"xs",marginTop:"5px",textAlign:"center",color:c?'textPrimary.400':'textPrimary.200'},o),l.default.createElement(s.Box,{fontSize:"xl"},C&&C.length>0&&'Chat'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:C.length})),h&&h.length>0&&'Polls'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:h.length})),'Participants'===o&&w&&w.length>0&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:w.length})),'string'==typeof u?l.default.createElement(s.Icon,{name:u,boxSize:"26",fill:c?'textPrimary.400':'textPrimary.200'}):u)))})):l.default.createElement(s.Flex,{px:"6",py:"10",mx:4,borderRadius:m.default.medium,bg:"secondary.900",mb:12,mt:16},E[q].drawerComponent),(null!==q||!A)&&l.default.createElement(s.Flex,{mx:H,mb:8},l.default.createElement(s.Button,{onClick:null!==q?function(){return _(null)}:function(){return I()},width:M},l.default.createElement(s.HStack,{p:16,borderRadius:m.default.small,justify:"center",bg:"secondary.800"},l.default.createElement(s.Text,{ml:-4,color:"danger.500"},"Back",null===q&&' to Meeting')))))};e.default=C},719,[1,720,165,2,514,713,508,512,676,724,575,475,714]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=C(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(o,f,c):o[f]=t[f]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),f=t(r(d[5])),c=r(d[6]),s=r(d[7]),m=t(r(d[8])),p=t(r(d[9])),x=r(d[10]),b=r(d[11]),y=r(d[12]),E=r(d[13]);function C(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(C=function(t){return t?l:n})(t)}var h=function(t){var C=t.options,h=t.unReadChatMessages,w=t.unSeenPolls,v=t.webinarUnseenRequest,k=(0,l.useRef)(null),P=(0,l.useContext)(c.ConfigServiceContext),S=(P.meeting,P.sessionConfig),j=(0,l.useContext)(u.ThemeContext).colors,B=(0,o.useWindowDimensions)(),O=(0,E.useScale)(S.theme.dimensions||B),M=O.height,R=O.width,z=l.default.useContext(y.DrawerContext),D=z.drawerExpanded,T=z.setDrawerExpander,_=z.openedTab,I=z.setopenedTab,W=function(){I(null),T(!1)};(0,l.useEffect)(function(){var t;D&&k&&(null==(t=k.current)||t.setModalVisible())},[D]);var A=function(){return I(null),T(!1),!0},F='LANDSCAPE'===l.default.useContext(x.OrientationContext).orientation,q=C.findIndex(function(t){return t.id===_}),H=q>-1?q:null;if(D&&H&&C[H].mainComponent)return l.default.createElement(o.Modal,{visible:!0,onRequestClose:A},l.default.createElement(s.Flex,{width:R,height:M,bg:"secondary.1000",direction:"row",flexWrap:"wrap",justify:"space-between"},l.default.createElement(p.default,{heading:C[H].label,onBackButtonClick:A}),l.default.createElement(s.Box,{width:R},C[H].mainComponent)));var V=F?24:8;return l.default.createElement(n.default,{containerStyle:{backgroundColor:j.secondary[900],justifyContent:'space-between'},overlayColor:"#000",ref:k,extraScroll:1,onClose:W,gestureEnabled:!0},null===H?l.default.createElement(s.VStack,{px:"6",py:"10",mx:V,borderRadius:m.default.medium,bg:"secondary.800",mb:12},C.map(function(t,n){var o=t.label,u=t.icon,c=t.disabled,p=t.id;return l.default.createElement(s.Button,{key:(0,b.nanoid)(),onClick:void 0!==C[n].onClick?C[n].onClick:function(){return I(p)},disabled:c},l.default.createElement(s.HStack,{p:12,px:16,borderRadius:m.default.small,align:"center",justify:"space-between"},l.default.createElement(s.Text,{fontSize:"xs",marginTop:"5px",textAlign:"center",color:c?'textPrimary.400':'textPrimary.200'},o),l.default.createElement(s.Box,{fontSize:"xl"},h&&h.length>0&&'Chat'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:h.length})),w&&w.length>0&&'Polls'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:w.length})),'Participants'===o&&v&&v.length>0&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:v.length})),'string'==typeof u?l.default.createElement(s.Icon,{name:u,boxSize:"26",fill:c?'textPrimary.400':'textPrimary.200'}):u)))})):l.default.createElement(s.Flex,{px:"6",py:"10",mx:4,borderRadius:m.default.medium,bg:"secondary.900",mb:12,mt:16},C[H].drawerComponent),(null!==H||!F)&&l.default.createElement(s.Flex,{mx:V,mb:8},l.default.createElement(s.Button,{onClick:null!==H?function(){return I(null)}:function(){return W()},width:R},l.default.createElement(s.HStack,{p:16,borderRadius:m.default.small,justify:"center",bg:"secondary.800"},l.default.createElement(s.Text,{ml:-4,color:"danger.500"},"Back",null===H&&' to Meeting')))))};e.default=h},719,[1,720,165,2,514,713,508,512,676,724,575,475,714,493]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1])).default;e.default=u},720,[1,721]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),o=e(r(d[2])),n=e(r(d[3])),l=e(r(d[4])),s=e(r(d[5])),c=e(r(d[6])),u=e(r(d[7])),f=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=y(t);if(o&&o.has(e))return o.get(e);var n={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=l?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(n,s,c):n[s]=e[s]}n.default=e,o&&o.set(e,n);return n})(r(d[8])),p=r(d[9]),h=r(d[10]),v=r(d[11]);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(y=function(e){return e?o:t})(e)}function S(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var b=0,w=["dummy"],T="android"===p.Platform.OS&&p.StatusBar.currentHeight||0,k=p.Dimensions.get("window").height,_=(function(e){(0,s.default)(P,e);var y,_,O=(y=P,_=S(),function(){var e,t=(0,u.default)(y);if(_){var o=(0,u.default)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return(0,c.default)(this,e)});function P(e){var l,s;return(0,n.default)(this,P),(s=O.call(this,e)).actionSheetHeight=0,s.prevScroll=0,s.timeout=null,s.offsetY=0,s.currentOffsetFromBottom=0,s.scrollAnimationEndValue=0,s.hasBounced=!1,s.layoutHasCalled=!1,s.isClosing=!1,s.isRecoiling=!1,s.isReachedTop=!1,s.deviceLayoutCalled=!1,s.transformValue=new p.Animated.Value(0),s.opacityValue=new p.Animated.Value(0),s.borderRadius=new p.Animated.Value(10),s.underlayTranslateY=new p.Animated.Value(100),s.underlayScale=new p.Animated.Value(1),s.initialScrolling=!1,s.keyboardShowSubscription=null,s.KeyboardHideSubscription=null,s.snapToOffset=function(e){var t=.15*s.state.deviceHeight,o=s.props.extraScroll||0,n=(s.props.gestureEnabled,e+t+o);s.currentOffsetFromBottom=n/s.actionSheetHeight,s.currentOffsetFromBottom=s.currentOffsetFromBottom-.15,setTimeout(function(){s._scrollTo(n),s.updateActionSheetPosition(n)},500)},s.show=function(){s.setModalVisible(!0)},s.hide=function(){s.setModalVisible(!1)},s.setModalVisible=function(e){var t=s.state.modalVisible;if(s.initialScrolling=!1,void 0!==e){if(t===e)return;t=!e}t?s._hideModal():s.setState({modalVisible:!0,scrollable:s.props.gestureEnabled||!1})},s._hideModal=function(){s.isClosing||(s.isClosing=!0,s._hideAnimation())},s.measure=function(){return t.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){setTimeout(function(){var t;s.safeAreaViewRef.current?null==(t=s.safeAreaViewRef.current)||t.measure(function(t,o,n,l){T=0===l?25:l,T=!s.props.drawUnderStatusBar&&T>30?T-12:T,e(T)}):e(T=25)},50)}));case 1:case"end":return e.stop()}},null,null,null,Promise)},s._showModal=function(e){var o,n,l,c,u,f;return t.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(o=s.props,n=o.gestureEnabled,l=o.delayActionSheetDraw,c=o.delayActionSheetDrawTime,null!=e&&e.nativeEvent){h.next=3;break}return h.abrupt("return");case 3:if(u=e.nativeEvent.layout.height,!s.layoutHasCalled){h.next=10;break}return s.actionSheetHeight=u,s._returnToPrevScrollPosition(u),h.abrupt("return");case 10:if(s.initialScrolling=!0,s.layoutHasCalled=!0,s.actionSheetHeight=u,f=s.getInitialScrollPosition(),s.isRecoiling=!1,"ios"!==p.Platform.OS){h.next=20;break}return h.next=18,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 18:h.next=23;break;case 20:if(!l){h.next=23;break}return h.next=23,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 23:if(s._scrollTo(f,!1),s.prevScroll=f,"ios"!==p.Platform.OS){h.next=30;break}return h.next=28,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 28:h.next=33;break;case 30:if(!l){h.next=33;break}return h.next=33,t.default.awrap((0,v.waitAsync)((null!=c?c:0)/2));case 33:s._openAnimation(f),s.underlayScale.setValue(1),s.underlayTranslateY.setValue(100),n||s.props.onPositionChanged&&s.props.onPositionChanged(!0),s.updateActionSheetPosition(f);case 38:case"end":return h.stop()}},null,null,null,Promise)},s._openAnimation=function(e){var t=s.props,o=t.bounciness,n=t.bounceOnOpen,l=t.animated,c=t.openAnimationSpeed;l?(s.transformValue.setValue(e),p.Animated.parallel([p.Animated.spring(s.transformValue,{toValue:0,bounciness:n?o:1,speed:c,useNativeDriver:!0}),p.Animated.timing(s.opacityValue,{toValue:1,duration:150,useNativeDriver:!0})]).start()):s.opacityValue.setValue(1)},s._onScrollBegin=function(e){return t.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},null,null,null,Promise)},s._onScrollBeginDrag=function(e){var o;return t.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:o=e.nativeEvent.contentOffset.y,s.prevScroll=o;case 2:case"end":return t.stop()}},null,null,null,Promise)},s._onScrollEnd=function(e){var o,n,l,c,u,f,p,h;return t.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:if(o=s.props,n=o.springOffset,l=o.extraScroll,c=e.nativeEvent.contentOffset.y,u=.15*s.state.deviceHeight,!s.isRecoiling){y.next=5;break}return y.abrupt("return");case 5:if(!(s.prevScroll.75*(null!=n?n:100)||s.initialScrolling)){y.next=19;break}return s.isRecoiling=!0,s._applyHeightLimiter(),s.currentOffsetFromBottom=s.currentOffsetFromBottom<(null!=(f=s.props.initialOffsetFromBottom)?f:1)&&null!=(p=s.props.initialOffsetFromBottom)?p:1,h=s.actionSheetHeight*s.currentOffsetFromBottom+u+(null!=l?l:100),s.initialScrolling&&(s.initialScrolling=!1,h=s.prevScroll),s._scrollTo(h),y.next=15,t.default.awrap((0,v.waitAsync)(300));case 15:s.isRecoiling=!1,s.props.onPositionChanged&&s.props.onPositionChanged(!0),y.next=20;break;case 19:s._returnToPrevScrollPosition(s.actionSheetHeight);case 20:y.next=33;break;case 22:if(!(s.prevScroll-c>(null!=n?n:100))){y.next=26;break}s._hideModal(),y.next=33;break;case 26:if(!s.isRecoiling){y.next=28;break}return y.abrupt("return");case 28:return s.isRecoiling=!0,s._returnToPrevScrollPosition(s.actionSheetHeight),y.next=32,t.default.awrap((0,v.waitAsync)(300));case 32:s.isRecoiling=!1;case 33:case"end":return y.stop()}},null,null,null,Promise)},s._scrollTo=function(e){var t,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s.scrollAnimationEndValue=e,s.prevScroll=e,null==(t=s.scrollViewRef.current)||t._listRef._scrollRef.scrollTo({x:0,y:s.scrollAnimationEndValue,animated:o}),s.initialScrolling&&setTimeout(function(){s.initialScrolling=!1},500)},s._onTouchMove=function(){s.props.closeOnTouchBackdrop&&s._hideModal(),s.setState({scrollable:!1})},s._onTouchStart=function(){s.props.closeOnTouchBackdrop&&s._hideModal(),s.setState({scrollable:!1})},s._onTouchEnd=function(){s._returnToPrevScrollPosition(s.actionSheetHeight),s.props.gestureEnabled&&s.setState({scrollable:!0})},s._onScroll=function(e){s.offsetY=e.nativeEvent.contentOffset.y;var t=.15*s.state.deviceHeight,o=s.actionSheetHeight+t-s.offsetY;if(s.actionSheetHeight=s.state.deviceHeight-1)if(os.prevScroll)){t.next=2;break}return t.abrupt("return");case 2:s.prevScroll-(null!=(e=s.props.springOffset)?e:100)>s.offsetY?(o=s.getInitialScrollPosition(),s.offsetY>o-100?(s.isRecoiling=!0,s._scrollTo(o),s.currentOffsetFromBottom=null!=(n=s.props.initialOffsetFromBottom)?n:1,s.prevScroll=o,setTimeout(function(){s.isRecoiling=!1},500)):s._hideModal()):(s.isRecoiling=!0,s._scrollTo(s.prevScroll,!0),setTimeout(function(){s.isRecoiling=!1},500));case 3:case"end":return t.stop()}},null,null,null,Promise)},s._onDeviceLayout=function(e){var n;return t.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:n=(0,o.default)({},e),s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(function(){var e,o,l,c,u,f;return t.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=0,"ios"!==p.Platform.OS){h.next=7;break}return h.next=4,t.default.awrap(s.measure());case 4:h.t0=h.sent,h.next=8;break;case 7:h.t0=p.StatusBar.currentHeight;case 8:if(c=h.t0,s.props.drawUnderStatusBar){h.next=16;break}if("android"!==p.Platform.OS||s.props.statusBarTranslucent){h.next=12;break}return h.abrupt("return");case 12:l=null!=c?c:0,c&&s.indicatorTranslateY.setValue(-c),h.next=17;break;case 16:s.updateActionSheetPosition(s.offsetY);case 17:if(u=n.nativeEvent.layout.height-l,f=p.Dimensions.get("window").width,(null==u?void 0:u.toFixed(0))!==(null==(e=k)?void 0:e.toFixed(0))||(null==f?void 0:f.toFixed(0))!==(null==(o=s.state.deviceWidth)?void 0:o.toFixed(0))||!s.deviceLayoutCalled){h.next=21;break}return h.abrupt("return");case 21:s.deviceLayoutCalled=!0,k=u,s.setState({deviceHeight:u,deviceWidth:f,portrait:u>f,paddingTop:null!=c?c:0});case 24:case"end":return h.stop()}},null,null,null,Promise)},1);case 3:case"end":return l.stop()}},null,null,null,Promise)},s._keyExtractor=function(e){return e},s.state={modalVisible:!1,scrollable:!1,layoutHasCalled:!1,keyboard:!1,deviceHeight:k||(0,v.getDeviceHeight)(s.props.statusBarTranslucent),deviceWidth:p.Dimensions.get("window").width,portrait:!0,safeAreaInnerHeight:b,paddingTop:T,keyboardPadding:0},s.scrollViewRef=(0,f.createRef)(),s.safeAreaViewRef=(0,f.createRef)(),s.currentOffsetFromBottom=null!=(l=s.props.initialOffsetFromBottom)?l:1,s.indicatorTranslateY=new p.Animated.Value(0|-s.state.paddingTop),s}return(0,l.default)(P,[{key:"_hideAnimation",value:function(){var e=this,t=this.props,o=t.animated,n=t.closeAnimationDuration,l=t.bottomOffset,s=t.initialOffsetFromBottom,c=t.extraScroll,u=t.closable;p.Animated.parallel([p.Animated.timing(this.opacityValue,{toValue:u?0:1,duration:o?n:1,useNativeDriver:!0}),p.Animated.timing(this.transformValue,{toValue:u?2*this.actionSheetHeight:0,duration:o?n:1,useNativeDriver:!0})]).start(),(0,v.waitAsync)((null!=n?n:300)/1.5).then(function(){u?(e._scrollTo(0,!1),e.currentOffsetFromBottom=null!=s?s:1,e.setState({modalVisible:!u},function(){e.isClosing=!1,e.isReachedTop=!1,e.props.onPositionChanged&&e.props.onPositionChanged(!1),e.indicatorTranslateY.setValue(-e.state.paddingTop),e.layoutHasCalled=!1,e.deviceLayoutCalled=!1,e.props.onClose&&e.props.onClose()})):(l&&l>0?e.snapToOffset(l):(e._scrollTo(e.actionSheetHeight*(null!=s?s:1)+.1*e.state.deviceHeight+(null!=c?c:0),!0),e.currentOffsetFromBottom=null!=s?s:1),e.isClosing=!1)})}},{key:"_applyHeightLimiter",value:function(){this.actionSheetHeight>this.state.deviceHeight&&(this.actionSheetHeight=1*(this.actionSheetHeight-(this.actionSheetHeight-this.state.deviceHeight)))}},{key:"updateActionSheetPosition",value:function(e){if(this.actionSheetHeight>=this.state.deviceHeight-1){var t=.15*this.state.deviceHeight;if(this.actionSheetHeight+t-e0&&B((0,M.markMessagesRead)((t={},(0,l.default)(t,v.MessageTypes.text,!0),(0,l.default)(t,v.MessageTypes.file,!0),(0,l.default)(t,v.MessageTypes.image,!0),(0,l.default)(t,v.MessageTypes.poll,!0),t)))},[se]);var me=function(){if(''!==$){var t={message:$,userId:D.userId,displayName:D.displayName,type:v.MessageTypes.text,time:(new Date).getTime()};Y.sendMessage(t),q('')}},pe=function(t,n,l){var o={displayName:D.displayName,type:v.MessageTypes.file,link:t,userId:D.id,name:n,size:l};Y.sendMessage(o)},ge=function(t){var l,o;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,n.default.awrap(fetch(t));case 2:return l=u.sent,u.next=5,n.default.awrap(l.blob());case 5:return o=u.sent,u.abrupt("return",o);case 7:case"end":return u.stop()}},null,null,null,Promise)};function ye(t,l,o){var u;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.default.awrap(ge(o));case 2:return u=s.sent,s.next=5,n.default.awrap(fetch(l,{method:'PUT',headers:{'Content-Type':t.type},body:u}));case 5:case"end":return s.stop()}},null,null,null,Promise)}function xe(t){var l,o,u,s,c;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return l=O.default.apiBase+"/v1/meetings/genPreSignedUploadUrl",f.next=3,n.default.awrap(fetch(l,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({roomName:ue,filename:t.name})}));case 3:return o=f.sent,f.next=6,n.default.awrap(o.json());case 6:return u=f.sent.data,s=u.getLocation,c=u.putLocation,f.abrupt("return",{getURL:s,putURL:c});case 10:case"end":return f.stop()}},null,null,null,Promise)}var he=function(t){f.Alert.alert('Error',"Error: "+(t||'Problem uploading image'),[{text:'OK'}]),ae(!1)},be=function(){try{te||(ae(!0),X(!1),(0,P.launchImageLibrary)({mediaType:'photo'},function(t){var l,o,u,s,c,m,p,y,x;return n.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=t.uri,o=t.didCancel,u=t.errorCode,s=t.errorMessage,c=t.fileName,m=t.type,p=t.fileSize,!o){h.next=5;break}ae(!1),h.next=19;break;case 5:if(!u){h.next=10;break}console.log('Error Uploading Image:',u,s),he(s),h.next=19;break;case 10:return y={name:c,type:m,uri:l},p>5e6&&f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),h.next=14,n.default.awrap(xe(y));case 14:return x=h.sent,h.next=17,n.default.awrap(ye(y,x.putURL,y.uri));case 17:b=x.getURL,w={displayName:D.displayName,type:v.MessageTypes.image,link:b,userId:D.id},Y.sendMessage(w),ae(!1);case 19:case"end":return h.stop()}var b,w},null,null,null,Promise)}))}catch(t){console.log('Error Uploading Image:',t),he()}},ve=function(){var t,l,o,u,s,c;return n.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:if(te){m.next=24;break}return ae(!0),X(!1),m.prev=3,m.next=6,n.default.awrap(C.default.pick({type:[C.default.types.allFiles]}));case 6:if(t=m.sent,l=t.uri,o=t.name,u=t.size,s={displayName:D.displayName,type:v.MessageTypes.file,link:l,userId:D.id,name:o,size:u},!(u>5e6)){m.next=12;break}return f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),m.abrupt("return");case 12:return m.next=14,n.default.awrap(xe(s));case 14:return c=m.sent,m.next=17,n.default.awrap(ye(s,c.putURL,s.link));case 17:pe(c.getURL,o,u),ae(!1),m.next=24;break;case 21:m.prev=21,m.t0=m.catch(3),C.default.isCancel(m.t0)?ae(!1):he();case 24:case"end":return m.stop()}},null,null,[[3,21]],Promise)};return c.default.createElement(m.Flex,{height:V-50,align:"center",width:H},c.default.createElement(k.default,null,c.default.createElement(y.GiftedChat,{messagesContainerStyle:{paddingTop:60},messages:le,alwaysShowSend:!0,renderAvatarOnTop:!0,renderUsernameOnMessage:!0,isKeyboardInternallyHandled:!1,timeTextStyle:{left:{color:L.textPrimary[400]},right:{color:L.textPrimary[400]}},renderAvatar:function(t){return c.default.createElement(x.default,{name:t.currentMessage.user.name,bgColor:L.primary[700]})},renderBubble:function(t){var n=t.currentMessage;return n.type,n.link,n.text,c.default.createElement(y.Bubble,(0,o.default)({},t,{wrapperStyle:{left:{backgroundColor:L.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3},right:{backgroundColor:L.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3}},textStyle:{left:{color:L.textPrimary[100]},right:{color:L.textPrimary[100]}}}))},renderInputToolbar:function(t){return z&&c.default.createElement(m.Flex,{width:ce?H-60:H-20,direction:"row",justify:"space-between",align:"center",bg:"secondary.800",borderRadius:"50px",height:50},c.default.createElement(m.Box,null,c.default.createElement(m.Button,{onClick:function(){X(!Q)}},c.default.createElement(m.Box,(0,m.mergeStyles)(N.touchableIcons,{ml:8}),Q?c.default.createElement(m.Icon,{name:"close",fill:"textPrimary.100",boxSize:"sm"}):c.default.createElement(m.Icon,{name:"plus-thick",fill:"textPrimary.100",boxSize:"sm"}))),Q&&c.default.createElement(R,null,c.default.createElement(m.Button,{onClick:be},c.default.createElement(m.Box,N.attachementButtons,c.default.createElement(m.Icon,{name:"image",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:8}," Images"))),c.default.createElement(m.Button,{onClick:ve},c.default.createElement(m.Box,(0,m.mergeStyles)(N.attachementButtons,{width:'ios'===f.Platform.OS?150:120}),c.default.createElement(m.Icon,{name:"attach-file",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:'ios'===f.Platform.OS?8:0},' ',"Attachments"))))),c.default.createElement(f.TextInput,{style:{color:L.textPrimary[300],paddingHorizontal:5,height:40,width:ce?H-160:H-120},onChangeText:q,value:$}),c.default.createElement(m.Button,{onClick:me,height:40,width:40},c.default.createElement(m.Box,(0,m.mergeStyles)(N.touchableIcons,{backgroundColor:'primary.500',mr:8}),c.default.createElement(m.Icon,{name:"send",fill:"textPrimary.100",boxSize:"md"}))))},user:{_id:D.userId,name:D.displayName}})))};e.default=U},725,[1,67,261,22,49,41,165,2,512,508,726,682,514,432,718,674,585,790,791,465,480,792,676,575,504]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=p(n);if(o&&o.has(t))return o.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(l,f,c):l[f]=t[f]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=t(r(d[3])),u=r(d[4]),f=r(d[5]),c=r(d[6]),s=r(d[7]);function p(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(p=function(t){return t?o:n})(t)}var b=function(t){var p=t.onBackButtonClick,b=t.heading,h=(0,n.useContext)(f.ConfigServiceContext).sessionConfig,x=(0,n.useContext)(u.ThemeContext).colors,v=(0,c.useWindowDimensions)(),w=useScale(h.theme.dimensions||v),y=(w.height,w.width),C='LANDSCAPE'===n.default.useContext(s.OrientationContext).orientation;return n.default.createElement(o.Box,{position:"absolute",zIndex:10,pt:'ios'!==c.Platform.OS||C?3:42,bg:"secondary.1000",width:y},n.default.createElement(o.HStack,null,n.default.createElement(o.Box,{width:y/3},n.default.createElement(o.Button,{onClick:p},n.default.createElement(o.HStack,{border:"1px solid "+x.danger[500],borderRadius:l.default.small,left:20,p:8,width:80},n.default.createElement(o.Icon,{name:"arrow-back",fill:"danger.500"}),n.default.createElement(o.Text,{ml:4,mr:4,color:"danger.500"},"Back")))),n.default.createElement(o.Flex,{width:y/3,align:"center",p:8},n.default.createElement(o.Text,{fontSize:16,fontWeight:"bold",mb:10},' ',b))))};e.default=b},724,[1,165,512,676,514,508,2,575]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=t(r(d[2])),o=t(r(d[3])),u=t(r(d[4])),s=t(r(d[5])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=N(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var c=u?Object.getOwnPropertyDescriptor(t,s):null;c&&(c.get||c.set)?Object.defineProperty(o,s,c):o[s]=t[s]}o.default=t,l&&l.set(t,o);return o})(r(d[6])),f=r(d[7]),m=r(d[8]),p=r(d[9]),y=r(d[10]),x=t(r(d[11])),h=r(d[12]),b=r(d[13]),v=r(d[14]),w=r(d[15]),E=r(d[16]),P=r(d[17]),S=t(r(d[18])),C=r(d[19]),M=r(d[20]),k=t(r(d[21])),T=t(r(d[22])),I=r(d[23]),O=t(r(d[24])),B=r(d[25]);function N(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(N=function(t){return t?l:n})(t)}var R={attachementButtons:{display:'flex',flexDirection:'row',backgroundColor:'secondary.700',marginTop:20,marginRight:5,width:100,height:35,alignItems:'center',justifyContent:'center',borderRadius:30},touchableIcons:{backgroundColor:'secondary.700',borderRadius:15,width:30,height:30,align:'center',justify:'center',mt:8,mb:8},attachemenetView:{position:'absolute',top:'ios'===f.Platform.OS?-130:-15,left:'ios'===f.Platform.OS?8:48,direction:'ios'===f.Platform.OS?'column':'row'}},U=function(t){var n=t.children;return'ios'===f.Platform.OS?c.default.createElement(m.Box,R.attachemenetView,n):c.default.createElement(m.Flex,R.attachemenetView,n)},j=function(t){var N=(0,b.useDispatch)(),j=(0,c.useContext)(p.ConfigServiceContext),z=(j.meeting,j.sessionConfig),L=z.permissions.chat.public.can_send,_=(0,c.useContext)(h.ThemeContext).colors,A=(0,f.useWindowDimensions)(),D=(0,b.useSelector)(function(t){return t.room.chatMessages}),F=(0,c.useContext)(w.PeersServiceContext).selfPeer,V=(0,B.useScale)(z.theme.dimensions||A),H=V.height,K=V.width,W=c.default.useState(''),$=(0,s.default)(W,2),q=$[0],G=$[1],J=c.default.useState(!1),Q=(0,s.default)(J,2),X=Q[0],Y=Q[1],Z=(0,c.useContext)(E.MediaRoomContext).mediaRoom,ee=c.default.useState(!1),te=(0,s.default)(ee,2),ae=te[0],re=te[1],ne=(0,c.useState)([]),le=(0,s.default)(ne,2),oe=le[0],ue=le[1],ie=(0,b.useSelector)(function(t){return t.room.roomName}),se=(0,b.useSelector)(function(t){return t.room.polls}),de=D.filter(function(t){return!0!==t.read}),ce=(0,C.useMutation)("\n mutation($file: Upload!, $roomName: String!) {\n uploadFile(file: $file, roomName: $roomName) {\n link\n }\n }\n"),fe=((0,s.default)(ce,1)[0],'LANDSCAPE'===c.default.useContext(I.OrientationContext).orientation);function me(t,n,l){Z.votePoll({index:l,pollId:t})}(0,c.useEffect)(function(){var t=(0,u.default)(D);ue(t.reverse().map(function(t){var n={type:t.type,createdAt:t.time,_id:Math.round(1e6*Math.random()),user:{_id:t.userId,name:t.displayName}};if(t.type===v.MessageTypes.text)return(0,o.default)({},n,{text:t.message});if(t.type===v.MessageTypes.image)return(0,o.default)({},n,{image:t.link});if(t.type===v.MessageTypes.file)return(0,o.default)({},n,{text:t.name,link:t.link});if(t.type===v.MessageTypes.poll){var l=t.pollId,u=se[l],s=u.options,c=u.question,f=F.userId;return(0,o.default)({},n,{text:c,polls:{pollId:l,options:s.map(function(t){return t.votes.find(function(t){return t.id===f})?(0,o.default)({},t,{selected:!0}):(0,o.default)({},t,{selected:!1})}),onOptionSelected:me}})}return{}}))},[D,se]),(0,c.useEffect)(function(){var t;de.length>0&&N((0,M.markMessagesRead)((t={},(0,l.default)(t,v.MessageTypes.text,!0),(0,l.default)(t,v.MessageTypes.file,!0),(0,l.default)(t,v.MessageTypes.image,!0),(0,l.default)(t,v.MessageTypes.poll,!0),t)))},[de]);var pe=function(){if(''!==q){var t={message:q,userId:F.userId,displayName:F.displayName,type:v.MessageTypes.text,time:(new Date).getTime()};Z.sendMessage(t),G('')}},ge=function(t,n,l){var o={displayName:F.displayName,type:v.MessageTypes.file,link:t,userId:F.id,name:n,size:l};Z.sendMessage(o)},ye=function(t){var l,o;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,n.default.awrap(fetch(t));case 2:return l=u.sent,u.next=5,n.default.awrap(l.blob());case 5:return o=u.sent,u.abrupt("return",o);case 7:case"end":return u.stop()}},null,null,null,Promise)};function xe(t,l,o){var u;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.default.awrap(ye(o));case 2:return u=s.sent,s.next=5,n.default.awrap(fetch(l,{method:'PUT',headers:{'Content-Type':t.type},body:u}));case 5:case"end":return s.stop()}},null,null,null,Promise)}function he(t){var l,o,u,s,c;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return l=O.default.apiBase+"/v1/meetings/genPreSignedUploadUrl",f.next=3,n.default.awrap(fetch(l,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({roomName:ie,filename:t.name})}));case 3:return o=f.sent,f.next=6,n.default.awrap(o.json());case 6:return u=f.sent.data,s=u.getLocation,c=u.putLocation,f.abrupt("return",{getURL:s,putURL:c});case 10:case"end":return f.stop()}},null,null,null,Promise)}var be=function(t){f.Alert.alert('Error',"Error: "+(t||'Problem uploading image'),[{text:'OK'}]),re(!1)},ve=function(){try{ae||(re(!0),Y(!1),(0,P.launchImageLibrary)({mediaType:'photo'},function(t){var l,o,u,s,c,m,p,y,x;return n.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=t.uri,o=t.didCancel,u=t.errorCode,s=t.errorMessage,c=t.fileName,m=t.type,p=t.fileSize,!o){h.next=5;break}re(!1),h.next=19;break;case 5:if(!u){h.next=10;break}console.log('Error Uploading Image:',u,s),be(s),h.next=19;break;case 10:return y={name:c,type:m,uri:l},p>5e6&&f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),h.next=14,n.default.awrap(he(y));case 14:return x=h.sent,h.next=17,n.default.awrap(xe(y,x.putURL,y.uri));case 17:b=x.getURL,w={displayName:F.displayName,type:v.MessageTypes.image,link:b,userId:F.id},Z.sendMessage(w),re(!1);case 19:case"end":return h.stop()}var b,w},null,null,null,Promise)}))}catch(t){console.log('Error Uploading Image:',t),be()}},we=function(){var t,l,o,u,s,c;return n.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:if(ae){m.next=24;break}return re(!0),Y(!1),m.prev=3,m.next=6,n.default.awrap(S.default.pick({type:[S.default.types.allFiles]}));case 6:if(t=m.sent,l=t.uri,o=t.name,u=t.size,s={displayName:F.displayName,type:v.MessageTypes.file,link:l,userId:F.id,name:o,size:u},!(u>5e6)){m.next=12;break}return f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),m.abrupt("return");case 12:return m.next=14,n.default.awrap(he(s));case 14:return c=m.sent,m.next=17,n.default.awrap(xe(s,c.putURL,s.link));case 17:ge(c.getURL,o,u),re(!1),m.next=24;break;case 21:m.prev=21,m.t0=m.catch(3),S.default.isCancel(m.t0)?re(!1):be();case 24:case"end":return m.stop()}},null,null,[[3,21]],Promise)};return c.default.createElement(m.Flex,{height:H-50,align:"center",width:K},c.default.createElement(k.default,null,c.default.createElement(y.GiftedChat,{messagesContainerStyle:{paddingTop:60},messages:oe,alwaysShowSend:!0,renderAvatarOnTop:!0,renderUsernameOnMessage:!0,isKeyboardInternallyHandled:!1,timeTextStyle:{left:{color:_.textPrimary[400]},right:{color:_.textPrimary[400]}},renderAvatar:function(t){return c.default.createElement(x.default,{name:t.currentMessage.user.name,bgColor:_.primary[700]})},renderBubble:function(t){var n=t.currentMessage;return n.type,n.link,n.text,c.default.createElement(y.Bubble,(0,o.default)({},t,{wrapperStyle:{left:{backgroundColor:_.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3},right:{backgroundColor:_.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3}},textStyle:{left:{color:_.textPrimary[100]},right:{color:_.textPrimary[100]}}}))},renderInputToolbar:function(t){return L&&c.default.createElement(m.Flex,{width:fe?K-60:K-20,direction:"row",justify:"space-between",align:"center",bg:"secondary.800",borderRadius:"50px",height:50},c.default.createElement(m.Box,null,c.default.createElement(m.Button,{onClick:function(){Y(!X)}},c.default.createElement(m.Box,(0,m.mergeStyles)(R.touchableIcons,{ml:8}),X?c.default.createElement(m.Icon,{name:"close",fill:"textPrimary.100",boxSize:"sm"}):c.default.createElement(m.Icon,{name:"plus-thick",fill:"textPrimary.100",boxSize:"sm"}))),X&&c.default.createElement(U,null,c.default.createElement(m.Button,{onClick:ve},c.default.createElement(m.Box,R.attachementButtons,c.default.createElement(m.Icon,{name:"image",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:8}," Images"))),c.default.createElement(m.Button,{onClick:we},c.default.createElement(m.Box,(0,m.mergeStyles)(R.attachementButtons,{width:'ios'===f.Platform.OS?150:120}),c.default.createElement(m.Icon,{name:"attach-file",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:'ios'===f.Platform.OS?8:0},' ',"Attachments"))))),c.default.createElement(f.TextInput,{style:{color:_.textPrimary[300],paddingHorizontal:5,height:40,width:fe?K-160:K-120},onChangeText:G,value:q}),c.default.createElement(m.Button,{onClick:pe,height:40,width:40},c.default.createElement(m.Box,(0,m.mergeStyles)(R.touchableIcons,{backgroundColor:'primary.500',mr:8}),c.default.createElement(m.Icon,{name:"send",fill:"textPrimary.100",boxSize:"md"}))))},user:{_id:F.userId,name:F.displayName}})))};e.default=j},725,[1,67,261,22,49,41,165,2,512,508,726,682,514,432,718,674,585,790,791,465,480,792,676,575,504,493]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0});var n=r(d[0]);Object.keys(n).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===n[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}}))})},726,[727]); __d(function(g,r,i,a,m,_e2,d){var e=r(d[0]);Object.defineProperty(_e2,"__esModule",{value:!0});var t={GiftedChat:!0,utils:!0,Actions:!0,Avatar:!0,Bubble:!0,SystemMessage:!0,MessageImage:!0,MessageText:!0,Composer:!0,Day:!0,InputToolbar:!0,LoadEarlier:!0,Message:!0,MessageContainer:!0,Send:!0,Time:!0,GiftedAvatar:!0};Object.defineProperty(_e2,"Actions",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(_e2,"Avatar",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(_e2,"Bubble",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(_e2,"Composer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(_e2,"Day",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(_e2,"GiftedAvatar",{enumerable:!0,get:function(){return E.default}}),_e2.GiftedChat=void 0,Object.defineProperty(_e2,"InputToolbar",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(_e2,"LoadEarlier",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(_e2,"Message",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(_e2,"MessageContainer",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(_e2,"MessageImage",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(_e2,"MessageText",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(_e2,"Send",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(_e2,"SystemMessage",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(_e2,"Time",{enumerable:!0,get:function(){return D.default}}),_e2.utils=void 0;var n=e(r(d[1])),o=e(r(d[2])),s=e(r(d[3])),u=e(r(d[4])),l=e(r(d[5])),f=e(r(d[6])),p=e(r(d[7])),h=e(r(d[8])),c=e(r(d[9])),y=r(d[10]),b=r(d[11]),v=e(r(d[12])),I=r(d[13]),x=e(r(d[14])),T=e(r(d[15])),H=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=V(t);if(n&&n.has(e))return n.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var l=s?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(o,u,l):o[u]=e[u]}o.default=e,n&&n.set(e,o);return o})(r(d[16]));_e2.utils=H;var C=e(r(d[17])),M=e(r(d[18])),S=e(r(d[19])),P=e(r(d[20])),O=e(r(d[21])),k=e(r(d[22])),L=e(r(d[23])),_=e(r(d[24])),A=e(r(d[25])),w=e(r(d[26])),F=e(r(d[27])),K=e(r(d[28])),j=e(r(d[29])),D=e(r(d[30])),E=e(r(d[31])),W=r(d[32]),R=r(d[33]);Object.keys(R).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(t,e)||e in _e2&&_e2[e]===R[e]||Object.defineProperty(_e2,e,{enumerable:!0,get:function(){return R[e]}}))});var B=["messagesContainerStyle"];function V(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(V=function(e){return e?n:t})(e)}function G(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}x.default.extend(T.default);var U=(function(e){(0,l.default)(x,e);var t,h,v=(t=x,h=G(),function(){var e,n=(0,p.default)(t);if(h){var o=(0,p.default)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return(0,f.default)(this,e)});function x(e){var t;return(0,s.default)(this,x),(t=v.call(this,e))._isMounted=!1,t._keyboardHeight=0,t._bottomOffset=0,t._maxHeight=void 0,t._isFirstLayout=!0,t._locale='en',t.invertibleScrollViewProps=void 0,t._actionSheetRef=void 0,t._messageContainerRef=c.default.createRef(),t._isTextInputWasFocused=!1,t.state={isInitialized:!1,composerHeight:t.props.minComposerHeight,messagesContainerHeight:void 0,typingDisabled:!1,text:void 0,messages:void 0},t.getLocale=function(){return t._locale},t.safeAreaSupport=function(e){return null!=e?e:(0,I.getBottomSpace)()},t.onKeyboardWillShow=function(e){if(t.handleTextInputFocusWhenKeyboardShow(),t.props.isKeyboardInternallyHandled){t.setIsTypingDisabled(!0),t.setKeyboardHeight(e.endCoordinates?e.endCoordinates.height:e.end.height),t.setBottomOffset(t.safeAreaSupport(t.props.bottomOffset));var n=t.getMessagesContainerHeightWithKeyboard();t.setState({messagesContainerHeight:n})}},t.onKeyboardWillHide=function(e){if(t.handleTextInputFocusWhenKeyboardHide(),t.props.isKeyboardInternallyHandled){t.setIsTypingDisabled(!0),t.setKeyboardHeight(0),t.setBottomOffset(0);var n=t.getBasicMessagesContainerHeight();t.setState({messagesContainerHeight:n})}},t.onKeyboardDidShow=function(e){'android'===y.Platform.OS&&t.onKeyboardWillShow(e),t.setIsTypingDisabled(!1)},t.onKeyboardDidHide=function(e){'android'===y.Platform.OS&&t.onKeyboardWillHide(e),t.setIsTypingDisabled(!1)},t.onSend=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Array.isArray(e)||(e=[e]);var s=e.map(function(e){return(0,o.default)({},e,{user:t.props.user,createdAt:new Date,_id:t.props.messageIdGenerator&&t.props.messageIdGenerator()})});!0===n&&(t.setIsTypingDisabled(!0),t.resetInputToolbar()),t.props.onSend&&t.props.onSend(s),!0===n&&setTimeout(function(){!0===t.getIsMounted()&&t.setIsTypingDisabled(!1)},100)},t.onInputSizeChanged=function(e){var n=Math.max(t.props.minComposerHeight,Math.min(t.props.maxComposerHeight,e.height)),o=t.getMessagesContainerHeightWithKeyboard(n);t.setState({composerHeight:n,messagesContainerHeight:o})},t.onInputTextChanged=function(e){t.getIsTypingDisabled()||(t.props.onInputTextChanged&&t.props.onInputTextChanged(e),void 0===t.props.text&&t.setState({text:e}))},t.onInitialLayoutViewLayout=function(e){var n=e.nativeEvent.layout;if(!(n.height<=0)){t.notifyInputTextReset(),t.setMaxHeight(n.height);var o=t.props.minComposerHeight,s=t.getMessagesContainerHeightWithKeyboard(o),u=t.props.initialText||'';t.setState({isInitialized:!0,text:t.getTextFromProp(u),composerHeight:o,messagesContainerHeight:s})}},t.onMainViewLayout=function(e){var n=e.nativeEvent.layout;t.getMaxHeight()===n.height&&!0!==t.getIsFirstLayout()||(t.setMaxHeight(n.height),t.setState({messagesContainerHeight:t._keyboardHeight>0?t.getMessagesContainerHeightWithKeyboard():t.getBasicMessagesContainerHeight()})),!0===t.getIsFirstLayout()&&t.setIsFirstLayout(!1)},t.invertibleScrollViewProps={inverted:t.props.inverted,keyboardShouldPersistTaps:t.props.keyboardShouldPersistTaps,onKeyboardWillShow:t.onKeyboardWillShow,onKeyboardWillHide:t.onKeyboardWillHide,onKeyboardDidShow:t.onKeyboardDidShow,onKeyboardDidHide:t.onKeyboardDidHide},t}return(0,u.default)(x,[{key:"getChildContext",value:function(){var e=this;return{actionSheet:this.props.actionSheet||function(){return e._actionSheetRef.getContext()},getLocale:this.getLocale}}},{key:"componentDidMount",value:function(){var e=this.props,t=e.messages,n=e.text;this.setIsMounted(!0),this.initLocale(),this.setMessages(t||[]),this.setTextFromProp(n)}},{key:"componentWillUnmount",value:function(){this.setIsMounted(!1)}},{key:"componentDidUpdate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,o=n.messages,s=n.text,u=n.inverted;this.props!==t&&this.setMessages(o||[]),!1===u&&o&&t.messages&&o.length!==t.messages.length&&setTimeout(function(){return e.scrollToBottom(!1)},200),s!==t.text&&this.setTextFromProp(s)}},{key:"initLocale",value:function(){null===this.props.locale?this.setLocale('en'):this.setLocale(this.props.locale||'en')}},{key:"setLocale",value:function(e){this._locale=e}},{key:"setTextFromProp",value:function(e){void 0!==e&&e!==this.state.text&&this.setState({text:e})}},{key:"getTextFromProp",value:function(e){return void 0===this.props.text?e:this.props.text}},{key:"setMessages",value:function(e){this.setState({messages:e})}},{key:"getMessages",value:function(){return this.state.messages}},{key:"setMaxHeight",value:function(e){this._maxHeight=e}},{key:"getMaxHeight",value:function(){return this._maxHeight}},{key:"setKeyboardHeight",value:function(e){this._keyboardHeight=e}},{key:"getKeyboardHeight",value:function(){return'android'!==y.Platform.OS||this.props.forceGetKeyboardHeight?this._keyboardHeight:0}},{key:"setBottomOffset",value:function(e){this._bottomOffset=e}},{key:"getBottomOffset",value:function(){return this._bottomOffset}},{key:"setIsFirstLayout",value:function(e){this._isFirstLayout=e}},{key:"getIsFirstLayout",value:function(){return this._isFirstLayout}},{key:"setIsTypingDisabled",value:function(e){this.setState({typingDisabled:e})}},{key:"getIsTypingDisabled",value:function(){return this.state.typingDisabled}},{key:"setIsMounted",value:function(e){this._isMounted=e}},{key:"getIsMounted",value:function(){return this._isMounted}},{key:"getMinInputToolbarHeight",value:function(){return this.props.renderAccessory?2*this.props.minInputToolbarHeight:this.props.minInputToolbarHeight}},{key:"calculateInputToolbarHeight",value:function(e){return e+(this.getMinInputToolbarHeight()-this.props.minComposerHeight)}},{key:"getBasicMessagesContainerHeight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.composerHeight;return this.getMaxHeight()-this.calculateInputToolbarHeight(e)}},{key:"getMessagesContainerHeightWithKeyboard",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.composerHeight;return this.getBasicMessagesContainerHeight(e)-this.getKeyboardHeight()+this.getBottomOffset()}},{key:"handleTextInputFocusWhenKeyboardHide",value:function(){var e;this._isTextInputWasFocused||(this._isTextInputWasFocused=(null==(e=this.textInput)?void 0:e.isFocused())||!1)}},{key:"handleTextInputFocusWhenKeyboardShow",value:function(){this.textInput&&this._isTextInputWasFocused&&!this.textInput.isFocused()&&this.textInput.focus(),this._isTextInputWasFocused=!1}},{key:"scrollToBottom",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._messageContainerRef&&this._messageContainerRef.current&&(this.props.inverted?this._messageContainerRef.current.scrollToOffset({offset:0,animated:e}):this._messageContainerRef.current.scrollToEnd({animated:e}))}},{key:"renderMessages",value:function(){var e=this.props,t=e.messagesContainerStyle,s=(0,n.default)(e,B),u=c.default.createElement(y.View,{style:[{height:this.state.messagesContainerHeight},t]},c.default.createElement(K.default,(0,o.default)({},s,{invertibleScrollViewProps:this.invertibleScrollViewProps,messages:this.getMessages(),forwardRef:this._messageContainerRef,isTyping:this.props.isTyping})),this.renderChatFooter());return this.props.isKeyboardInternallyHandled?c.default.createElement(y.KeyboardAvoidingView,{enabled:!0},u):u}},{key:"resetInputToolbar",value:function(){this.textInput&&this.textInput.clear(),this.notifyInputTextReset();var e=this.props.minComposerHeight,t=this.getMessagesContainerHeightWithKeyboard(e);this.setState({text:this.getTextFromProp(''),composerHeight:e,messagesContainerHeight:t})}},{key:"focusTextInput",value:function(){this.textInput&&this.textInput.focus()}},{key:"notifyInputTextReset",value:function(){this.props.onInputTextChanged&&this.props.onInputTextChanged('')}},{key:"renderInputToolbar",value:function(){var e=this,t=(0,o.default)({},this.props,{text:this.getTextFromProp(this.state.text),composerHeight:Math.max(this.props.minComposerHeight,this.state.composerHeight),onSend:this.onSend,onInputSizeChanged:this.onInputSizeChanged,onTextChanged:this.onInputTextChanged,textInputProps:(0,o.default)({},this.props.textInputProps,{ref:function(t){return e.textInput=t},maxLength:this.getIsTypingDisabled()?0:this.props.maxInputLength})});return this.props.renderInputToolbar?this.props.renderInputToolbar(t):c.default.createElement(A.default,t)}},{key:"renderChatFooter",value:function(){return this.props.renderChatFooter?this.props.renderChatFooter():null}},{key:"renderLoading",value:function(){return this.props.renderLoading?this.props.renderLoading():null}},{key:"render",value:function(){var e=this;if(!0===this.state.isInitialized){var t=this.props.wrapInSafeArea?y.SafeAreaView:y.View;return c.default.createElement(t,{style:z.safeArea},c.default.createElement(b.ActionSheetProvider,{ref:function(t){return e._actionSheetRef=t}},c.default.createElement(y.View,{style:z.container,onLayout:this.onMainViewLayout},this.renderMessages(),this.renderInputToolbar())))}return c.default.createElement(y.View,{style:z.container,onLayout:this.onInitialLayoutViewLayout},this.renderLoading())}}],[{key:"append",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Array.isArray(t)||(t=[t]),n?t.concat(e):e.concat(t)}},{key:"prepend",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Array.isArray(t)||(t=[t]),n?e.concat(t):t.concat(e)}}]),x})(c.default.Component);_e2.GiftedChat=U,U.childContextTypes={actionSheet:h.default.func,getLocale:h.default.func},U.defaultProps={messages:[],messagesContainerStyle:void 0,text:void 0,placeholder:W.DEFAULT_PLACEHOLDER,disableComposer:!1,messageIdGenerator:function(){return v.default.v4()},user:{},onSend:function(){},locale:null,timeFormat:W.TIME_FORMAT,dateFormat:W.DATE_FORMAT,loadEarlier:!1,onLoadEarlier:function(){},isLoadingEarlier:!1,renderLoading:null,renderLoadEarlier:null,renderAvatar:void 0,showUserAvatar:!1,actionSheet:null,onPressAvatar:null,onLongPressAvatar:null,renderUsernameOnMessage:!1,renderAvatarOnTop:!1,renderBubble:null,renderSystemMessage:null,onLongPress:null,renderMessage:null,renderMessageText:null,renderMessageImage:null,renderMessageVideo:null,renderMessageAudio:null,imageProps:{},videoProps:{},audioProps:{},lightboxProps:{},textInputProps:{},listViewProps:{},renderCustomView:null,isCustomViewBottom:!1,renderDay:null,renderTime:null,renderFooter:null,renderChatEmpty:null,renderChatFooter:null,renderInputToolbar:null,renderComposer:null,renderActions:null,renderSend:null,renderAccessory:null,isKeyboardInternallyHandled:!0,onPressActionButton:null,bottomOffset:null,minInputToolbarHeight:44,keyboardShouldPersistTaps:y.Platform.select({ios:'never',android:'always',default:'never'}),onInputTextChanged:null,maxInputLength:null,forceGetKeyboardHeight:!1,inverted:!0,extraData:null,minComposerHeight:W.MIN_COMPOSER_HEIGHT,maxComposerHeight:W.MAX_COMPOSER_HEIGHT,wrapInSafeArea:!0},U.propTypes={messages:h.default.arrayOf(h.default.object),messagesContainerStyle:H.StylePropType,text:h.default.string,initialText:h.default.string,placeholder:h.default.string,disableComposer:h.default.bool,messageIdGenerator:h.default.func,user:h.default.object,onSend:h.default.func,locale:h.default.string,timeFormat:h.default.string,dateFormat:h.default.string,isKeyboardInternallyHandled:h.default.bool,loadEarlier:h.default.bool,onLoadEarlier:h.default.func,isLoadingEarlier:h.default.bool,renderLoading:h.default.func,renderLoadEarlier:h.default.func,renderAvatar:h.default.func,showUserAvatar:h.default.bool,actionSheet:h.default.func,onPressAvatar:h.default.func,onLongPressAvatar:h.default.func,renderUsernameOnMessage:h.default.bool,renderAvatarOnTop:h.default.bool,isCustomViewBottom:h.default.bool,renderBubble:h.default.func,renderSystemMessage:h.default.func,onLongPress:h.default.func,renderMessage:h.default.func,renderMessageText:h.default.func,renderMessageImage:h.default.func,imageProps:h.default.object,videoProps:h.default.object,audioProps:h.default.object,lightboxProps:h.default.object,renderCustomView:h.default.func,renderDay:h.default.func,renderTime:h.default.func,renderFooter:h.default.func,renderChatEmpty:h.default.func,renderChatFooter:h.default.func,renderInputToolbar:h.default.func,renderComposer:h.default.func,renderActions:h.default.func,renderSend:h.default.func,renderAccessory:h.default.func,onPressActionButton:h.default.func,bottomOffset:h.default.number,minInputToolbarHeight:h.default.number,listViewProps:h.default.object,keyboardShouldPersistTaps:h.default.oneOf(['always','never','handled']),onInputTextChanged:h.default.func,maxInputLength:h.default.number,forceGetKeyboardHeight:h.default.bool,inverted:h.default.bool,textInputProps:h.default.object,extraData:h.default.object,minComposerHeight:h.default.number,maxComposerHeight:h.default.number,alignTop:h.default.bool,wrapInSafeArea:h.default.bool};var z=y.StyleSheet.create({container:{flex:1},safeArea:{flex:1}})},727,[1,96,22,9,10,12,14,17,204,165,2,728,734,749,750,751,752,753,755,757,774,766,759,775,776,777,779,780,781,778,772,756,773,789]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0});var n={ActionSheetProvider:!0,connectActionSheet:!0,useActionSheet:!0};Object.defineProperty(e,"ActionSheetProvider",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"connectActionSheet",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"useActionSheet",{enumerable:!0,get:function(){return u.useActionSheet}});var o=t(r(d[1])),c=t(r(d[2])),u=r(d[3]),f=r(d[4]);Object.keys(f).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(n,t)||t in e&&e[t]===f[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return f[t]}}))})},728,[1,729,732,731,733]); @@ -796,7 +796,7 @@ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0})},78 __d(function(g,r,i,a,m,e,d){var o=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.launchCamera=function(o,u){if('function'!=typeof u)return void console.error('Send proper callback function, check API');c.NativeModules.DyteImagePickerManager.launchCamera((0,n.default)({},t,o),u)},e.launchImageLibrary=function(o,u){if('function'!=typeof u)return void console.error('Send proper callback function, check API');c.NativeModules.DyteImagePickerManager.launchImageLibrary((0,n.default)({},t,o),u)};var n=o(r(d[1])),c=r(d[2]),t={mediaType:'photo',videoQuality:'high',quality:1,maxWidth:0,maxHeight:0,includeBase64:!1,saveToPhotos:!1,durationLimit:0,cameraType:'back'}},790,[1,22,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=t(r(d[1])),p=t(r(d[2])),n=t(r(d[3])),s=r(d[4]),c=s.NativeModules.DyteRNDocumentPicker;function l(t){if('filetype'in t)throw new TypeError('A `filetype` option was passed to DocumentPicker.pick, the correct option is `type`');if('types'in t)throw new TypeError('A `types` option was passed to DocumentPicker.pick, the correct option is `type`');if('type'in t||(t.type=x.types.allFiles),t.type=Array.isArray(t.type)?t.type:[t.type],t.type.some(function(t){return void 0===t}))throw new TypeError('Unexpected undefined type option, did you try using a DocumentPicker.types.* that does not exist?');if(Array.isArray(t.type)&&t.type.length<1)throw new TypeError('`type` option should not be an empty array, at least one type must be passed if the `type` option is not omitted');if(t.type.forEach(function(t){if('string'!=typeof t)throw new TypeError("Invalid type option, expected a string not: "+t)}),t.type.length>1&&'android'===s.Platform.OS&&s.Platform.Version<19&&console.warn("RNDocumentPicker: Android API level "+s.Platform.Version+" does not support multiple types, falling back to */*"),Array.isArray(t.type)&&t.type.length>1&&t.type.includes('folder'))throw new TypeError('When type array is folder then other options are not supported');if('mode'in t&&!['import','open'].includes(t.mode))throw new TypeError("Invalid mode option: "+t.mode);if('copyTo'in t&&!['cachesDirectory','documentDirectory'].includes(t.copyTo))throw new TypeError("Invalid copyTo option: "+t.copyTo);return c.pick(t)}function u(t){if('ios'===s.Platform.OS){if(!Array.isArray(t))throw new TypeError('`uris` should be an array of strings');t.forEach(function(t){if('string'!=typeof t)throw new TypeError("Invalid uri parameter, expected a string not: "+t)}),c.releaseSecureAccess(t)}}var f={mimeTypes:{allFiles:'*/*',audio:'audio/*',csv:'text/csv',doc:'application/msword',docx:'application/vnd.openxmlformats-officedocument.wordprocessingml.document',images:'image/*',pdf:'application/pdf',plainText:'text/plain',ppt:'application/vnd.ms-powerpoint',pptx:'application/vnd.openxmlformats-officedocument.presentationml.presentation',video:'video/*',xls:'application/vnd.ms-excel',xlsx:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',zip:'application/zip'},utis:{allFiles:'public.item',audio:'public.audio',csv:'public.comma-separated-values-text',doc:'com.microsoft.word.doc',docx:'org.openxmlformats.wordprocessingml.document',images:'public.image',pdf:'com.adobe.pdf',plainText:'public.plain-text',ppt:'com.microsoft.powerpoint.ppt',pptx:'org.openxmlformats.presentationml.presentation',video:'public.movie',xls:'com.microsoft.excel.xls',xlsx:'org.openxmlformats.spreadsheetml.sheet',zip:'public.zip-archive'},extensions:{allFiles:'*',audio:'.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma',csv:'.csv',doc:'.doc',docx:'.docx',images:'.jpeg .jpg .png',pdf:'.pdf',plainText:'.txt',ppt:'.ppt',pptx:'.pptx',video:'.mp4',xls:'.xls',xlsx:'.xlsx',zip:'.zip .gz',folder:'folder'}},y={android:f.mimeTypes,ios:f.utis,windows:f.extensions},x=(function(){function t(){(0,p.default)(this,t)}return(0,n.default)(t,null,[{key:"pick",value:function(t){return l((0,o.default)({},t,{multiple:!1})).then(function(t){return t[0]})}},{key:"pickMultiple",value:function(t){return l((0,o.default)({},t,{multiple:!0}))}},{key:"isCancel",value:function(t){return t&&"DOCUMENT_PICKER_CANCELED"===t.code}},{key:"releaseSecureAccess",value:function(t){u(t)}}]),t})();e.default=x,x.types=y[s.Platform.OS]||f.mimeTypes},791,[1,22,9,10,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),o=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=l(n);if(o&&o.has(t))return o.get(t);var u={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var s=f?Object.getOwnPropertyDescriptor(t,c):null;s&&(s.get||s.set)?Object.defineProperty(u,c,s):u[c]=t[c]}u.default=t,o&&o.set(t,u);return u})(r(d[2])),u=r(d[3]);function l(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(l=function(t){return t?o:n})(t)}var f=function(t){var l=t.children,f=t.useNativeDriver,c=void 0!==f&&f,s=o.useState('android'===u.Platform.OS?0:new u.Animated.Value(0)),v=(0,n.default)(s,2),p=v[0],y=v[1],b=o.useRef(null),O=o.useRef(null),h=function(t){'android'===u.Platform.OS?y(t.endCoordinates?t.endCoordinates.height:t.end.height):u.Animated.parallel([u.Animated.timing(p,{duration:t.duration,toValue:t.endCoordinates.height,useNativeDriver:c})]).start()},P=function(t){'android'===u.Platform.OS?y(0):u.Animated.parallel([u.Animated.timing(p,{duration:t.duration,toValue:0,useNativeDriver:c})]).start()};return o.useEffect(function(){return b.current=u.Keyboard.addListener('android'===u.Platform.OS?'keyboardDidShow':'keyboardWillShow',h),O.current=u.Keyboard.addListener('android'===u.Platform.OS?'keyboardDidHide':'keyboardWillHide',P),function(){var t,n;null==(t=b.current)||t.remove(),null==(n=O.current)||n.remove(),b.current=null,O.current=null}},[]),'android'===u.Platform.OS?o.createElement(u.View,{style:{bottom:p?50:p}},l,o.createElement(u.KeyboardAvoidingView,{behavior:"padding",keyboardVerticalOffset:-p/2})):o.createElement(u.Animated.View,{style:{paddingBottom:p,flex:1}},l)};e.default=f},792,[1,41,165,2]); -__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,o.useContext)(h.ConfigServiceContext).sessionConfig,C=t.permissions.polls.can_create,w=(0,p.useDisclosure)(),P=w.isOpen,O=w.onClose,j=w.onOpen,M=(0,o.useContext)(f.MediaRoomContext).mediaRoom,B=(0,o.useContext)(s.PeersServiceContext).selfPeer,S=(0,u.useSelector)(function(t){return t.room.polls}),_=(0,n.useWindowDimensions)(),k=t.theme.dimensions||_,T=k.height,D=k.width,F=(Math.floor(2*T/3),function(){var t=P?O:j;t()}),R=(0,u.useSelector)(function(t){return t.room.chatMessages}).filter(function(t){return!0!==t.read&&t.type===x.MessageTypes.poll}),W=(0,u.useDispatch)();(0,o.useEffect)(function(){R.length>0&&W((0,m.markMessagesRead)((0,l.default)({},x.MessageTypes.poll,!0)))},[R]);var N=Object.values(S);return o.default.createElement(c.Flex,{height:T-30,width:D,direction:"column",justifyContent:"space-between",overflowY:"auto",px:10,pb:10,pt:50},o.default.createElement(c.Flex,null,o.default.createElement(c.Box,{overflowY:"auto",className:"dyte-client-noScrollbar"},P?o.default.createElement(c.Box,null,P&&o.default.createElement(b.default,{toggle:F})):o.default.createElement(o.default.Fragment,null,N.length>0?o.default.createElement(n.ScrollView,{style:{height:C?T-150:T},contentContainerStyle:{paddingBottom:C?0:120}},o.default.createElement(n.TouchableWithoutFeedback,null,o.default.createElement(c.Box,null,N.map(function(t,l){return o.default.createElement(c.Box,{my:10},o.default.createElement(c.Text,{ml:4},t.createdBy?"Poll by "+t.createdBy:''),o.default.createElement(c.Box,{mt:1,className:"dyte-client-bubble dyte-client-other dyte-client-type-3"},o.default.createElement(E.default,{mediaRoom:M,poll:t,selfPeer:B})))})))):o.default.createElement(c.Flex,{height:T-150,width:D,align:"center",justify:"center"},o.default.createElement(c.Text,{fontSize:"lg",color:v.colors.textPrimary[100]},"No Polls created yet."))))),C&&o.default.createElement(c.Button,{fontSize:"16",onClick:F},o.default.createElement(c.Box,{bg:P?'danger.500':'primary.500',p:8,justify:"center",borderRadius:y.default.small},o.default.createElement(c.Text,{textAlign:"center"},P?'Cancel Poll Creation':'Create New Poll'))))};var l=t(r(d[1])),n=r(d[2]),o=(function(t,l){if(!l&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(l);if(n&&n.has(t))return n.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,n&&n.set(t,o);return o})(r(d[3])),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),m=r(d[8]),p=r(d[9]),y=t(r(d[10])),h=r(d[11]),x=r(d[12]),b=t(r(d[13])),E=t(r(d[14])),v=r(d[15]);function C(t){if("function"!=typeof WeakMap)return null;var l=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:l})(t)}},793,[1,261,2,165,432,512,585,674,480,493,676,508,718,794,796,798]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,o.useContext)(h.ConfigServiceContext).sessionConfig,C=t.permissions.polls.can_create,w=(0,p.useDisclosure)(),P=w.isOpen,O=w.onClose,j=w.onOpen,M=(0,o.useContext)(f.MediaRoomContext).mediaRoom,B=(0,o.useContext)(s.PeersServiceContext).selfPeer,S=(0,u.useSelector)(function(t){return t.room.polls}),_=(0,n.useWindowDimensions)(),k=(0,p.useScale)(t.theme.dimensions||_),T=k.height,D=k.width,F=(Math.floor(2*T/3),function(){var t=P?O:j;t()}),R=(0,u.useSelector)(function(t){return t.room.chatMessages}).filter(function(t){return!0!==t.read&&t.type===x.MessageTypes.poll}),W=(0,u.useDispatch)();(0,o.useEffect)(function(){R.length>0&&W((0,m.markMessagesRead)((0,l.default)({},x.MessageTypes.poll,!0)))},[R]);var N=Object.values(S);return o.default.createElement(c.Flex,{height:T-30,width:D,direction:"column",justifyContent:"space-between",overflowY:"auto",px:10,pb:10,pt:50},o.default.createElement(c.Flex,null,o.default.createElement(c.Box,{overflowY:"auto",className:"dyte-client-noScrollbar"},P?o.default.createElement(c.Box,null,P&&o.default.createElement(b.default,{toggle:F})):o.default.createElement(o.default.Fragment,null,N.length>0?o.default.createElement(n.ScrollView,{style:{height:C?T-150:T},contentContainerStyle:{paddingBottom:C?0:120}},o.default.createElement(n.TouchableWithoutFeedback,null,o.default.createElement(c.Box,null,N.map(function(t,l){return o.default.createElement(c.Box,{my:10},o.default.createElement(c.Text,{ml:4},t.createdBy?"Poll by "+t.createdBy:''),o.default.createElement(c.Box,{mt:1,className:"dyte-client-bubble dyte-client-other dyte-client-type-3"},o.default.createElement(E.default,{mediaRoom:M,poll:t,selfPeer:B})))})))):o.default.createElement(c.Flex,{height:T-150,width:D,align:"center",justify:"center"},o.default.createElement(c.Text,{fontSize:"lg",color:v.colors.textPrimary[100]},"No Polls created yet."))))),C&&o.default.createElement(c.Button,{fontSize:"16",onClick:F},o.default.createElement(c.Box,{bg:P?'danger.500':'primary.500',p:8,justify:"center",borderRadius:y.default.small},o.default.createElement(c.Text,{textAlign:"center"},P?'Cancel Poll Creation':'Create New Poll'))))};var l=t(r(d[1])),n=r(d[2]),o=(function(t,l){if(!l&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(l);if(n&&n.has(t))return n.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,n&&n.set(t,o);return o})(r(d[3])),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),m=r(d[8]),p=r(d[9]),y=t(r(d[10])),h=r(d[11]),x=r(d[12]),b=t(r(d[13])),E=t(r(d[14])),v=r(d[15]);function C(t){if("function"!=typeof WeakMap)return null;var l=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:l})(t)}},793,[1,261,2,165,432,512,585,674,480,493,676,508,718,794,796,798]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var C=t.toggle,k=(0,u.useContext)(f.MediaRoomContext).mediaRoom,b=u.default.useState({question:'',options:Array(2).fill(''),anonymous:!1,hideVotes:!0}),v=(0,n.default)(b,2),T=v[0],E=v[1],w=(0,u.useContext)(c.ThemeContext).colors,P=function(t,n){var l=T.options;l[n]=t,E((0,o.default)({},T,{options:l}))},O=function(){var t=T.options;t.push(''),E((0,o.default)({},T,{options:t}))},j=(u.default.useContext(x.OrientationContext).orientation,(0,u.useContext)(p.ConfigServiceContext).sessionConfig),B=(0,l.useWindowDimensions)(),R=(j.theme.dimensions||B).height;return u.default.createElement(l.ScrollView,{style:{height:R-200}},u.default.createElement(s.Box,{py:20,px:10},u.default.createElement(s.VStack,{spacing:4},u.default.createElement(s.Text,{fontSize:"xl",textAlign:"center"},"Poll Question"),u.default.createElement(l.TextInput,{multiline:!0,autoFocus:!1,placeholder:"What is your poll for?",numberOfLines:4,value:T.question,placeholderTextColor:w.textPrimary[400],onChangeText:function(t){E((0,o.default)({},T,{question:t}))},style:[{backgroundColor:w.secondary[800],height:75,color:w.textPrimary[300]},y.default.createPollInputText]}),T.options.map(function(t,o){return u.default.createElement(l.TextInput,{autoFocus:!1,placeholder:"Enter an option",value:T.options[o],placeholderTextColor:w.textPrimary[400],onChangeText:function(t){return P(t,o)},style:[{backgroundColor:w.secondary[800],color:w.textPrimary[300]},y.default.createPollInputText]})}),u.default.createElement(s.Box,{bg:"secondary.700",mt:20,width:125,height:30,alignItems:"center",justifyContent:"center"},u.default.createElement(s.Button,{onClick:function(){return O()}},u.default.createElement(s.Text,null,"+ Add an Option"))),u.default.createElement(s.CheckBox,{rightText:"Anonymous",style:{marginTop:15,paddingRight:10,height:20,justifyContent:'center',borderRadius:h.default.small},rightTextStyle:{color:'white'},checkedCheckBoxColor:"white",uncheckedCheckBoxColor:"white",isChecked:T.anonymous,onClick:function(){var t=!T.anonymous;E((0,o.default)({},T,{anonymous:t}))}}),u.default.createElement(s.CheckBox,{rightText:"Hide Results before Voting",style:{marginTop:15,paddingRight:10,height:20,justifyContent:'center',borderRadius:h.default.small},rightTextStyle:{color:'white'},checkedCheckBoxColor:"white",uncheckedCheckBoxColor:"white",isChecked:T.hideVotes,onClick:function(){var t=!T.hideVotes;E((0,o.default)({},T,{hideVotes:t}))}}),u.default.createElement(s.Box,{mt:10,bg:"primary.500",p:8,mb:5,justify:"center",borderRadius:h.default.small},u.default.createElement(s.Button,{fontSize:"16",onClick:function(){var t=T.question,n=T.options;if(t)if(''===n[0]||''===n[1])l.Alert.alert('Error:','Please add minimum two options',[{text:'OK'}]);else{var u=(0,o.default)({},T);u.options=n.filter(function(t){return''!==t}),k.newPoll(u),C()}else l.Alert.alert('Error:','Question Can\'t be empty',[{text:'OK'}])}},u.default.createElement(s.Text,{textAlign:"center"},"Create Poll"))))))};var o=t(r(d[1])),n=t(r(d[2])),l=r(d[3]),u=(function(t,o){if(!o&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(o);if(n&&n.has(t))return n.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var s=u?Object.getOwnPropertyDescriptor(t,c):null;s&&(s.get||s.set)?Object.defineProperty(l,c,s):l[c]=t[c]}l.default=t,n&&n.set(t,l);return l})(r(d[4])),c=r(d[5]),s=r(d[6]),f=r(d[7]),h=t(r(d[8])),p=r(d[9]),x=r(d[10]),y=t(r(d[11]));function C(t){if("function"!=typeof WeakMap)return null;var o=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:o})(t)}},794,[1,22,41,2,165,514,512,585,676,508,575,795]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(d[1]),n=t(r(d[2])),u=o.StyleSheet.create({createPollInputText:{paddingLeft:15,paddingRight:5,marginTop:20,borderRadius:n.default.medium,paddingTop:10,paddingBottom:10}});e.default=u},795,[1,2,676]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var s=t.selfPeer,p=t.mediaRoom,v=t.poll,x=function(t){try{p.votePoll({index:t,pollId:v.id})}catch(t){l.Alert.alert('Error','Error: Problem casting your vote',[{text:'OK'}])}};if(console.log('Poll',v),v){v.id;var h=Math.max.apply(Math,(0,n.default)(v.options.map(function(t){return t.votes.length})).concat([0]));return o.default.createElement(u.VStack,{spacing:2,direction:"row",bg:"secondary.800",p:12,mt:8,borderRadius:c.default.medium},o.default.createElement(u.Text,{textAlign:"left"},v.question),o.default.createElement(u.Box,{mt:8},v.options.map(function(t,n){return o.default.createElement(u.Flex,{onClick:function(){return x(n)},mb:4},o.default.createElement(f.default,{active:t.votes.length===h&&t.votes.length>0,option:t,index:n,selfId:s.userId,onChange:function(){return x(n)}}))})))}return o.default.createElement(u.Text,{fontStyle:"italic"},"Poll wasn't found or has been deleted")};var n=t(r(d[1])),l=r(d[2]),o=t(r(d[3])),u=r(d[4]),c=t(r(d[5])),f=t(r(d[6]))},796,[1,49,2,165,512,676,797]); @@ -804,7 +804,7 @@ __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{ __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"colors",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"fontSize",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"fontWeight",{enumerable:!0,get:function(){return f.default}});var n=t(r(d[1])),u=t(r(d[2])),f=t(r(d[3]))},798,[1,576,799,800]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var x={xs:'12px',sm:'14px',md:'16px',lg:'18px',xl:'20px'};e.default=x},799,[]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l={light:300,normal:400,medium:500,bold:600};e.default=l},800,[]); -__d(function(g,r,_i,_a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,c.useSelector)(function(t){return t.room.roomViewType}),i=(0,n.useContext)(p.PeersServiceContext),l=i.processedPeers,a=i.selfPeer,s=i.joinedProcessedPeers,y=(0,n.useContext)(x.MediaRoomContext).mediaRoom,T=(0,n.useContext)(b.ConfigServiceContext).sessionConfig,R=(0,o.useWindowDimensions)(),k=(T.theme.dimensions||R).width,C=(0,c.useSelector)(function(t){return t.room.requestToJoinPeersList}),_=C.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.present}),S=C.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.ask});l=[a].concat(l.sort(function(t,n){return t.id.localeCompare(n.id)})).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)});var P=[a].concat(s).filter(function(t){return null==t?void 0:t.webinarHiddenParticipant}).filter(function(t,n,i){return i.findIndex(function(n){return n.id===t.id})===n}),v=[a].concat(s).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)&&t.requestToJoinType===u.RequestToJoinType.ask});l=l.concat(v).filter((q=new Set,function(t){return!q.has(t.id)&&q.add(t.id)}));var q;var A=function(t,n){y.acceptAllRequestToJoinStage([{id:t,requestToJoinType:n,type:f.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT}])},M=function(t){y.rejectRequestToJoinStage(t)};return n.default.createElement(E.Flex,{mt:60,width:k},n.default.createElement(o.ScrollView,{style:{padding:20}},n.default.createElement(o.TouchableWithoutFeedback,null,n.default.createElement(E.Box,null,n.default.createElement(E.Box,{my:20},t===f.DyteViewTypes.webinar&&l.length>0&&n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mb:10},"Presenting (",l.length,")"),l.map(function(i){return n.default.createElement(w,{peer:i,key:i.id,mediaRoom:y,permissions:null==T?void 0:T.permissions,roomViewType:t})})),P.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Attending (",P.length,")"),P.map(function(i){return n.default.createElement(w,{key:i.id,peer:i,mediaRoom:y,permissions:null==T?void 0:T.permissions,roomViewType:t})})),S.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to ask Question (",S.length,")"),S.map(function(t){return n.default.createElement(h,{rejectRequest:M,acceptRequest:A,peer:t,key:t.id,type:"REQUEST_TO_ASK"})})),_.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to Present (",_.length,")"),_.map(function(t){return n.default.createElement(h,{rejectRequest:M,acceptRequest:A,peer:t,key:t.id,type:"REQUEST_TO_PRESENT"})})),n.default.createElement(E.Box,{height:200})))))};var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var i=T(n);if(i&&i.has(t))return i.get(t);var l={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(l,a,u):l[a]=t[a]}l.default=t,i&&i.set(t,l);return l})(r(d[1])),i=r(d[2]),l=t(r(d[3])),o=r(d[4]),a=t(r(d[5])),u=r(d[6]),c=r(d[7]),f=r(d[8]),s=t(r(d[9])),p=r(d[10]),E=r(d[11]),y=t(r(d[12])),x=r(d[13]),b=r(d[14]);function T(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,i=new WeakMap;return(T=function(t){return t?i:n})(t)}function h(t){var o=t.rejectRequest,a=t.acceptRequest,u=t.peer,c=t.type,f=(0,n.useContext)(i.ThemeContext).colors;return n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+u.name,bgColor:f.primary[500]}),n.default.createElement(E.Text,{ml:10,color:f.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:u.name>30?u.name.substring(0,20)+"...":""+u.name,charSize:30}),u.isMe?' (me)':null)),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:6},n.default.createElement(E.Button,{onClick:function(){return a(u.id,c)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"check",fill:f.success[500]}))),n.default.createElement(E.Box,{ml:6},n.default.createElement(E.Button,{onClick:function(){return o(u.id)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"clear",fill:f.danger[500]})))))}function w(t){var o=t.peer,c=t.mediaRoom,p=t.permissions,x=t.roomViewType,T=(0,n.useContext)(i.ThemeContext).colors,h=(0,n.useContext)(b.ConfigServiceContext).participantControls,w=(null==p?void 0:p.pin_participant)||(null==p?void 0:p.can_allow_participant_audio)||(null==p?void 0:p.can_allow_participant_video)||(null==p?void 0:p.kick_participant),R=p.accept_present_requests,k=[];return(w||h.length>0)&&(null!=p&&p.pin_participant&&(o.isPinned?k.push({title:'Unpin',onClick:function(){return c.pin(null)}}):k.push({title:'Pin',onClick:function(){return c.pin(o.id)}})),null!=p&&p.can_allow_participant_audio&&k.push({title:'Mute Audio',onClick:function(){return c.disableAudio(o.id)}}),null!=p&&p.can_allow_participant_video&&k.push({title:'Disable Video',onClick:function(){return c.disableVideo(o.id)}}),null!=p&&p.kick_participant&&!o.isMe&&k.push({title:'Kick',onClick:function(){return c.kick(o.id)}}),x!==f.DyteViewTypes.webinar||o.isMe||!R||o.webinarHiddenParticipant||k.push({title:'Force Stop Presenting',onClick:function(){return c.removePeerFromStage(o.id,f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR)}}),x===f.DyteViewTypes.webinar&&!o.isMe&&R&&k.push({title:'Grant Premission to Present',onClick:function(){return c.acceptAllRequestToJoinStage([{id:o.id,requestToJoinType:u.RequestToJoinType.present,type:f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR}])}}),h.forEach(function(t){o.isMe&&!1===t.showSelf||k.push({title:t.label,onClick:function(){return t.onClick(o.id)}})}),k.push({title:'Cancel',onClick:function(){}})),n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+o.displayName,bgColor:T.primary[500]}),n.default.createElement(E.HStack,{ml:10,color:T.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:o.displayName.length>30?o.displayName.substring(0,20)+"...":""+o.displayName,charSize:30}),(o.isMe||o.label)&&n.default.createElement(E.Text,{background:"primary.300",color:"textPrimary.100",pr:4,ml:4,borderRadius:3},o.isMe?'me':o.label))),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:8},o.producingAudio?n.default.createElement(E.Icon,{boxSize:"xl",name:"mic",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"mic-off",fill:T.danger[500]})),o.producingVideo?n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam-off",fill:T.danger[500]}),(w||h.length>0)&&n.default.createElement(a.default,{options:k.map(function(t){return t.title}),actions:k.map(function(t){return t.onClick})})))}},801,[1,165,514,682,2,802,487,432,497,676,674,512,692,585,508]); +__d(function(g,r,_i,_a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,c.useSelector)(function(t){return t.room.roomViewType}),i=(0,n.useContext)(p.PeersServiceContext),l=i.processedPeers,a=i.selfPeer,s=i.joinedProcessedPeers,y=(0,n.useContext)(x.MediaRoomContext).mediaRoom,h=(0,n.useContext)(b.ConfigServiceContext).sessionConfig,k=(0,o.useWindowDimensions)(),C=(0,T.useScale)(h.theme.dimensions||k).width,S=(0,c.useSelector)(function(t){return t.room.requestToJoinPeersList}),_=S.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.present}),P=S.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.ask});l=[a].concat(l.sort(function(t,n){return t.id.localeCompare(n.id)})).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)});var v=[a].concat(s).filter(function(t){return null==t?void 0:t.webinarHiddenParticipant}).filter(function(t,n,i){return i.findIndex(function(n){return n.id===t.id})===n}),q=[a].concat(s).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)&&t.requestToJoinType===u.RequestToJoinType.ask});l=l.concat(q).filter((A=new Set,function(t){return!A.has(t.id)&&A.add(t.id)}));var A;var M=function(t,n){y.acceptAllRequestToJoinStage([{id:t,requestToJoinType:n,type:f.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT}])},W=function(t){y.rejectRequestToJoinStage(t)};return n.default.createElement(E.Flex,{mt:60,width:C},n.default.createElement(o.ScrollView,{style:{padding:20}},n.default.createElement(o.TouchableWithoutFeedback,null,n.default.createElement(E.Box,null,n.default.createElement(E.Box,{my:20},t===f.DyteViewTypes.webinar&&l.length>0&&n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mb:10},"Presenting (",l.length,")"),l.map(function(i){return n.default.createElement(R,{peer:i,key:i.id,mediaRoom:y,permissions:null==h?void 0:h.permissions,roomViewType:t})})),v.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Attending (",v.length,")"),v.map(function(i){return n.default.createElement(R,{key:i.id,peer:i,mediaRoom:y,permissions:null==h?void 0:h.permissions,roomViewType:t})})),P.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to ask Question (",P.length,")"),P.map(function(t){return n.default.createElement(w,{rejectRequest:W,acceptRequest:M,peer:t,key:t.id,type:"REQUEST_TO_ASK"})})),_.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to Present (",_.length,")"),_.map(function(t){return n.default.createElement(w,{rejectRequest:W,acceptRequest:M,peer:t,key:t.id,type:"REQUEST_TO_PRESENT"})})),n.default.createElement(E.Box,{height:200})))))};var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var i=h(n);if(i&&i.has(t))return i.get(t);var l={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(l,a,u):l[a]=t[a]}l.default=t,i&&i.set(t,l);return l})(r(d[1])),i=r(d[2]),l=t(r(d[3])),o=r(d[4]),a=t(r(d[5])),u=r(d[6]),c=r(d[7]),f=r(d[8]),s=t(r(d[9])),p=r(d[10]),E=r(d[11]),y=t(r(d[12])),x=r(d[13]),b=r(d[14]),T=r(d[15]);function h(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,i=new WeakMap;return(h=function(t){return t?i:n})(t)}function w(t){var o=t.rejectRequest,a=t.acceptRequest,u=t.peer,c=t.type,f=(0,n.useContext)(i.ThemeContext).colors;return n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+u.name,bgColor:f.primary[500]}),n.default.createElement(E.Text,{ml:10,color:f.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:u.name>30?u.name.substring(0,20)+"...":""+u.name,charSize:30}),u.isMe?' (me)':null)),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:6},n.default.createElement(E.Button,{onClick:function(){return a(u.id,c)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"check",fill:f.success[500]}))),n.default.createElement(E.Box,{ml:6},n.default.createElement(E.Button,{onClick:function(){return o(u.id)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"clear",fill:f.danger[500]})))))}function R(t){var o=t.peer,c=t.mediaRoom,p=t.permissions,x=t.roomViewType,T=(0,n.useContext)(i.ThemeContext).colors,h=(0,n.useContext)(b.ConfigServiceContext).participantControls,w=(null==p?void 0:p.pin_participant)||(null==p?void 0:p.can_allow_participant_audio)||(null==p?void 0:p.can_allow_participant_video)||(null==p?void 0:p.kick_participant),R=p.accept_present_requests,k=[];return(w||h.length>0)&&(null!=p&&p.pin_participant&&(o.isPinned?k.push({title:'Unpin',onClick:function(){return c.pin(null)}}):k.push({title:'Pin',onClick:function(){return c.pin(o.id)}})),null!=p&&p.can_allow_participant_audio&&k.push({title:'Mute Audio',onClick:function(){return c.disableAudio(o.id)}}),null!=p&&p.can_allow_participant_video&&k.push({title:'Disable Video',onClick:function(){return c.disableVideo(o.id)}}),null!=p&&p.kick_participant&&!o.isMe&&k.push({title:'Kick',onClick:function(){return c.kick(o.id)}}),x!==f.DyteViewTypes.webinar||o.isMe||!R||o.webinarHiddenParticipant||k.push({title:'Force Stop Presenting',onClick:function(){return c.removePeerFromStage(o.id,f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR)}}),x===f.DyteViewTypes.webinar&&!o.isMe&&R&&k.push({title:'Grant Premission to Present',onClick:function(){return c.acceptAllRequestToJoinStage([{id:o.id,requestToJoinType:u.RequestToJoinType.present,type:f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR}])}}),h.forEach(function(t){o.isMe&&!1===t.showSelf||k.push({title:t.label,onClick:function(){return t.onClick(o.id)}})}),k.push({title:'Cancel',onClick:function(){}})),n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+o.displayName,bgColor:T.primary[500]}),n.default.createElement(E.HStack,{ml:10,color:T.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:o.displayName.length>30?o.displayName.substring(0,20)+"...":""+o.displayName,charSize:30}),(o.isMe||o.label)&&n.default.createElement(E.Text,{background:"primary.300",color:"textPrimary.100",pr:4,ml:4,borderRadius:3},o.isMe?'me':o.label))),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:8},o.producingAudio?n.default.createElement(E.Icon,{boxSize:"xl",name:"mic",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"mic-off",fill:T.danger[500]})),o.producingVideo?n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam-off",fill:T.danger[500]}),(w||h.length>0)&&n.default.createElement(a.default,{options:k.map(function(t){return t.title}),actions:k.map(function(t){return t.onClick})})))}},801,[1,165,514,682,2,802,487,432,497,676,674,512,692,585,508,493]); __d(function(g,r,_i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var o={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=l?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o})(r(d[2])),o=r(d[3]),l=r(d[4]),i=r(d[5]),u=e(r(d[6]));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}var f=function(e){var c=(0,n.useRef)(),f=(0,n.useState)(!1),s=(0,t.default)(f,2),p=s[0],h=s[1],w=(0,n.useContext)(l.ThemeContext).colors,v=function(t){for(var n=e.options,o=0;o=0&&(n=e.destructiveIndex),o.ActionSheetIOS.showActionSheetWithOptions({options:t,destructiveButtonIndex:n,cancelButtonIndex:t.length-1},function(e){v(e)})}else'android'===o.Platform.OS&&o.UIManager.showPopupMenu((0,o.findNodeHandle)(c.current),t,function(){return console.log('something went wrong with the popup menu')},function(e,t){v(t)})}},n.default.createElement(i.Icon,{boxSize:"xl",ml:5,name:"dots-vertical",fill:w.textPrimary[300]}))),b)};_e.default=f},802,[1,41,165,2,514,512,676]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.stopRecording=e.startRecording=e.getActiveRecording=void 0;var n=t(r(d[1])),o=t(r(d[2]));e.startRecording=function(t){var s,c,u,p;return n.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,l.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/recording",{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:if(201===(p=l.sent).status){l.next=6;break}throw new Error('Recording failed to start');case 6:return l.abrupt("return",p.json());case 7:case"end":return l.stop()}},null,null,null,Promise)};e.stopRecording=function(t){var s,c,u,p,l;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,p=t.recordingId,f.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/recordings/"+p,{method:'PUT',body:JSON.stringify({recordingAction:'stop'}),headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:if(201===(l=f.sent).status){f.next=6;break}throw new Error('Recording failed to stop');case 6:return f.abrupt("return",l.json());case 7:case"end":return f.stop()}},null,null,null,Promise)};e.getActiveRecording=function(t){var s,c,u,p;return n.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,l.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/active-recording",{method:'GET',headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:return p=l.sent,l.abrupt("return",p.json());case 5:case"end":return l.stop()}},null,null,null,Promise)}},803,[1,67,504]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=b(n);if(o&&o.has(t))return o.get(t);var u={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var c=l?Object.getOwnPropertyDescriptor(t,s):null;c&&(c.get||c.set)?Object.defineProperty(u,s,c):u[s]=t[s]}u.default=t,o&&o.set(t,u);return u})(r(d[1])),o=r(d[2]),u=r(d[3]),l=r(d[4]),s=r(d[5]),c=r(d[6]),f=r(d[7]),p=r(d[8]),y=r(d[9]),T=t(r(d[10]));function b(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(b=function(t){return t?o:n})(t)}var x=function(t){var b=t.isMobile,x=(0,u.useSelector)(function(t){return t.room.roomViewType}),S=(0,u.useSelector)(function(t){return t.participant.requestToJoinStageState}),q=(0,n.useContext)(p.ThemeContext).colors,v=(0,n.useContext)(o.MediaRoomContext).mediaRoom,E=(0,u.useDispatch)(),R=(0,n.useContext)(y.ConfigServiceContext).sessionConfig,w=(0,c.useWindowDimensions)(),C=R.theme.dimensions||w,h=(C.height,C.width),O=x===s.DyteViewTypes.webinar&&S===l.RequestToJoinStageState.INITIATED;return n.default.createElement(f.Modal,{isVisible:O,backdropOpacity:.8,backdropColor:q.secondary[800]},n.default.createElement(f.Flex,{width:.9*h,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:T.default.medium},n.default.createElement(f.Flex,{pt:15},n.default.createElement(f.Text,{fontSize:28,fontWeight:"bold"},"Request")),n.default.createElement(f.Flex,{display:"flex",pb:20},n.default.createElement(f.Flex,{direction:b?'column':'row',justifyContent:"space-between"},n.default.createElement(f.Button,{onClick:function(){return t=l.RequestToJoinType.present,E((0,l.requestToJoinType)(t)),E((0,l.requestedJoinToStageState)(l.RequestToJoinStageState.WAITING)),v.requestToJoinStage(t),void c.Alert.alert('Request Sent',"Request to "+(t===l.RequestToJoinType.present?'present':'ask')+" has been sent successfully to host",[{text:'OK',onPress:function(){}}]);var t}},n.default.createElement(f.Box,{bg:"primary.500",py:12,px:20,mt:20,borderRadius:T.default.small,align:"center"},n.default.createElement(f.Text,null,"Request to Present"))),n.default.createElement(f.Button,{onClick:function(){E((0,l.requestedJoinToStageState)(l.RequestToJoinStageState.NONE)),E((0,l.requestToJoinType)(void 0))}},n.default.createElement(f.Box,{bg:"danger.500",py:12,px:20,mt:20,borderRadius:T.default.small,align:"center"},n.default.createElement(f.Text,null,"Cancel")))))))};e.default=x},804,[1,165,585,432,487,497,2,512,514,508,676]); diff --git a/Frameworks/ios-device.xcarchive/Info.plist b/Frameworks/ios-device.xcarchive/Info.plist index c4f18c8..3358dd7 100644 --- a/Frameworks/ios-device.xcarchive/Info.plist +++ b/Frameworks/ios-device.xcarchive/Info.plist @@ -5,7 +5,7 @@ ArchiveVersion 2 CreationDate - 2022-07-28T08:07:17Z + 2022-09-13T08:26:45Z Name DyteSdk SchemeName diff --git a/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/Info.plist b/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/Info.plist index 363e8c4..b6cd18b 100644 Binary files a/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/Info.plist and b/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/Info.plist differ diff --git a/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/DyteSdk b/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/DyteSdk index 530daea..6f4df8a 100755 Binary files a/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/DyteSdk and b/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/DyteSdk differ diff --git a/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/Info.plist b/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/Info.plist index 4c57963..7e4fbc9 100644 Binary files a/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/Info.plist and b/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/Info.plist differ diff --git a/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/main.jsbundle b/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/main.jsbundle index cb13b3a..d09d228 100644 --- a/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/main.jsbundle +++ b/Frameworks/ios-device.xcarchive/Products/Library/Frameworks/DyteSdk.framework/main.jsbundle @@ -496,7 +496,7 @@ __d(function(g,r,_i,a,m,_e,d){'use strict';var e=r(d[0]);Object.defineProperty(_ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(d[0]),o=t.NativeModules,c=t.TurboModuleRegistry,l=r(d[1]),S=o.PlatformLocalStorage||o.RNC_AsyncSQLiteDBStorage||o.RNCAsyncStorage;!S&&l()&&(S=c?c.get('AsyncSQLiteDBStorage')||c.get('AsyncLocalStorage'):o.AsyncSQLiteDBStorage||o.AsyncLocalStorage);var n=S;e.default=n},490,[2,491]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]).NativeModules;m.exports=function(){var t,o,u=null==(t=n.NativeUnimoduleProxy)?void 0:null==(o=t.modulesConstants)?void 0:o.ExponentConstants;if(u&&(u.appOwnership&&!u.executionEnvironment||['storeClient','standalone'].includes(u.executionEnvironment)))return!0;return!1}},491,[2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.useAsyncStorage=function(t){return{getItem:function(){for(var u=arguments.length,f=new Array(u),o=0;o=0&&t<=1}),b=function(t){return t&&t.width>0&&t.height>0},D=.5,N=.5;e.withAnchorPoint=function(t,n,u){if(!w((s=n).x)||!w(s.y))return t;var s;if(!b(u))return t;var c=t.transform;if(!c)return t;if(n.x!==D&&u.width){var f=[];f.push({translateX:u.width*(n.x-D)}),(c=[].concat(f,(0,o.default)(c))).push({translateX:u.width*(D-n.x)})}if(!Array.isArray(c))return{transform:c};if(n.y!==N&&u.height){var l=[];l.push({translateY:u.height*(n.y-N)}),(c=[].concat(l,(0,o.default)(c))).push({translateY:u.height*(N-n.y)})}return{transform:c}};var y=function(){return'react native client'};e.browserName=y;var S=function(){return''};e.osName=S;var C=function(){return!0};e.isMobile=C;e.isChrome=function(){return!0};e.getDeviceInfo=function(){return{isMobile:!0,browserName:'react native client',osName:'',browserVersion:'react native client'}};e.isSafari=function(){return!1};e.isDesktopSafari=function(){return!1};e.useDisclosure=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=h(t),u=(0,n.default)(o,2),s=u[0],c=u[1];return{isOpen:s,onOpen:v(function(){return c(!0)},[]),onClose:v(function(){return c(!1)},[]),toggle:v(function(){return c(function(t){return!t})},[])}}},493,[1,41,49,165,494,496,2]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.browserName=void 0,e.default=function(t,o){var c=v(!1),f=(0,n.default)(c,2),h=f[0],l=f[1],p=o&&o.successDuration;return(0,u.useEffect)(function(){if(h&&p){var t=setTimeout(function(){l(!1)},p);return function(){clearTimeout(t)}}return function(){}},[h,p]),[h,function(){var n=(0,s.default)(t);l(n)}]},e.osName=e.isSafari=e.isMobile=e.isDesktopSafari=e.isChrome=e.getDeviceInfo=void 0,e.parseJwt=function(t){var n=t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/'),o=decodeURIComponent(c.default.decode(n).split('').map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(''));return JSON.parse(o)},e.useDisclosure=void 0,e.useScale=function(t){var n=t.width,o=t.height,u=f.Dimensions.get('screen').width,s=f.Dimensions.get('screen').height;return{width:Math.min(n,u),height:Math.min(o,s)}},e.withAnchorPoint=void 0;var n=t(r(d[1])),o=t(r(d[2])),u=r(d[3]),s=t(r(d[4])),c=t(r(d[5])),f=r(d[6]),h=r(d[3]),l=h.useCallback,v=h.useState,p=f.NativeModules.DyteHelper,w=(new f.NativeEventEmitter(p),function(t){return t>=0&&t<=1}),D=function(t){return t&&t.width>0&&t.height>0},b=.5,N=.5;e.withAnchorPoint=function(t,n,u){if(!w((s=n).x)||!w(s.y))return t;var s;if(!D(u))return t;var c=t.transform;if(!c)return t;if(n.x!==b&&u.width){var f=[];f.push({translateX:u.width*(n.x-b)}),(c=[].concat(f,(0,o.default)(c))).push({translateX:u.width*(b-n.x)})}if(!Array.isArray(c))return{transform:c};if(n.y!==N&&u.height){var h=[];h.push({translateY:u.height*(n.y-N)}),(c=[].concat(h,(0,o.default)(c))).push({translateY:u.height*(N-n.y)})}return{transform:c}};var y=function(){return'react native client'};e.browserName=y;var S=function(){return''};e.osName=S;var M=function(){return!0};e.isMobile=M;e.isChrome=function(){return!0};e.getDeviceInfo=function(){return{isMobile:!0,browserName:'react native client',osName:'',browserVersion:'react native client'}};e.isSafari=function(){return!1};e.isDesktopSafari=function(){return!1};e.useDisclosure=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=v(t),u=(0,n.default)(o,2),s=u[0],c=u[1];return{isOpen:s,onOpen:l(function(){return c(!0)},[]),onClose:l(function(){return c(!1)},[]),toggle:l(function(){return c(function(t){return!t})},[])}}},493,[1,41,49,165,494,496,2]); __d(function(g,r,i,a,m,_e,d){"use strict";var e=r(d[0]),t={"text/plain":"Text","text/html":"Url",default:"Text"},o="Copy to clipboard: #{key}, Enter";function n(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}m.exports=function(c,l){var s,p,u,y,f,b,w=!1;l||(l={}),s=l.debug||!1;try{if(u=e(),y=document.createRange(),f=document.getSelection(),(b=document.createElement("span")).textContent=c,b.style.all="unset",b.style.position="fixed",b.style.top=0,b.style.clip="rect(0, 0, 0, 0)",b.style.whiteSpace="pre",b.style.webkitUserSelect="text",b.style.MozUserSelect="text",b.style.msUserSelect="text",b.style.userSelect="text",b.addEventListener("copy",function(e){if(e.stopPropagation(),l.format)if(e.preventDefault(),void 0===e.clipboardData){s&&console.warn("unable to use e.clipboardData"),s&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=t[l.format]||t.default;window.clipboardData.setData(o,c)}else e.clipboardData.clearData(),e.clipboardData.setData(l.format,c);l.onCopy&&(e.preventDefault(),l.onCopy(e.clipboardData))}),document.body.appendChild(b),y.selectNodeContents(b),f.addRange(y),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");w=!0}catch(e){s&&console.error("unable to copy using execCommand: ",e),s&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(l.format||"text",c),l.onCopy&&l.onCopy(window.clipboardData),w=!0}catch(e){s&&console.error("unable to copy using clipboardData: ",e),s&&console.error("falling back to prompt"),p=n("message"in l?l.message:o),window.prompt(p,c)}}finally{f&&("function"==typeof f.removeRange?f.removeRange(y):f.removeAllRanges()),b&&document.body.removeChild(b),u()}return w}},494,[495]); __d(function(g,r,_i,a,m,e,d){m.exports=function(){var n=document.getSelection();if(!n.rangeCount)return function(){};for(var t=document.activeElement,o=[],u=0;u>2,o=(3&c)<<4|(h=n.charCodeAt(s++))>>4,A=(15&h)<<2|(u=n.charCodeAt(s++))>>6,l=63&u,isNaN(h)?A=l=64:isNaN(u)&&(l=64),f.push(t.charAt(i)+t.charAt(o)+t.charAt(A)+t.charAt(l)),c=h=u="",i=o=A=l=""}while(s>2,o=(3&c)<<4|(h=n[s++])>>4,A=(15&h)<<2|(u=n[s++])>>6,l=63&u,isNaN(h)?A=l=64:isNaN(u)&&(l=64),f.push(t.charAt(i)+t.charAt(o)+t.charAt(A)+t.charAt(l)),c=h=u="",i=o=A=l=""}while(s>18&63)+d.charAt(c>>12&63)+d.charAt(c>>6&63)+d.charAt(63&c);return 2==f?(n=t.charCodeAt(A)<<8,o=t.charCodeAt(++A),s+=d.charAt((c=n+o)>>10)+d.charAt(c>>4&63)+d.charAt(c<<2&63)+'='):1==f&&(c=t.charCodeAt(A),s+=d.charAt(c>>2)+d.charAt(c<<4&63)+'=='),s},decode:function(t){var n=(t=String(t).replace(f,'')).length;n%4==0&&(n=(t=t.replace(/==?$/,'')).length),(n%4==1||/[^+a-zA-Z0-9/]/.test(t))&&h('Invalid character: the string to be decoded is not correctly encoded.');for(var o,a,c=0,s='',A=-1;++A>(-2*c&6)));return s},version:'0.1.0'};if('function'==typeof define&&'object'==typeof define.amd&&define.amd)define(function(){return s});else if(n&&!n.nodeType)if(o)o.exports=s;else for(var A in s)s.hasOwnProperty(A)&&(n[A]=s[A]);else t.base64=s})(this)},577,[]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=_e.Logger=void 0;var t=e(r(d[1])),n=e(r(d[2])),o=e(r(d[3]));function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.getOwnPropertyNames(e).forEach(function(o){if(![null,void 0,NaN].includes(e[o])){var c=t?t+"."+o:o;'object'==typeof e[o]?l(e[o],c,n):n[c]=e[o]}}),n}var c=(function(){function e(){(0,n.default)(this,e),this.level=3}return(0,o.default)(e,[{key:"process",value:function(e){var t={};try{Object.getOwnPropertyNames(e||{}).forEach(function(n){try{t[n]=JSON.stringify(e[n])}catch(e){t[n]='Failed to stringify'}})}catch(e){}return t}},{key:"init",value:function(e){'trace'===e?this.level=3:'log'===e?this.level=2:'error'===e&&(this.level=1)}},{key:"trace",value:function(t,n){e.addEventInCurrentSpan('warn',t,n,!0)}},{key:"warn",value:function(t,n){e.addEventInCurrentSpan('warn',t,n,!0)}},{key:"error",value:function(t,n){e.addEventInCurrentSpan('error',t,n,!0)}}],[{key:"addEventInCurrentSpan",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'info',o=arguments.length>1?arguments[1]:void 0,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;try{var s=l(c,'metadata'),v=(0,t.default)({message:o,logSeverity:n},s,{loggedAt:(new Date).getTime()});u?e.sendOtelLogsToNewRelic(e.logsCache.splice(0,25).concat([v])):e.logsCache.push(v)}catch(e){console.debug('opentelemetry::addEventInCurrentSpan_failed',e)}}},{key:"sendOtelLogsToNewRelic",value:function(t){fetch('https://api-silos.dyte.io/otel/logs',{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json'},body:JSON.stringify({meetingMetadata:l(e.meetingMetadata,'meetingMetadata'),serviceName:'mobile-sdk',logs:t})}).catch(function(e){console.debug('opentelemetry::sendOtelLogToNewRelic_failed',e)})}}]),e})();_e.Logger=c,c.logsCache=[],c.meetingMetadata={};var u=new c;_e.default=u},578,[1,22,9,10]); -__d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.UserTrackContext=void 0,e.default=function(t){var T,P,E,w=(0,c.useState)(),A=(0,o.default)(w,2),b=A[0],N=A[1],k=(0,c.useState)([]),M=(0,o.default)(k,2),O=M[0],x=M[1],D=(0,c.useState)(),C=(0,o.default)(D,2),y=C[0],V=C[1],_=(0,c.useState)([]),R=(0,o.default)(_,2),G=R[0],L=R[1],B=(0,c.useState)(),j=(0,o.default)(B,2),W=j[0],F=j[1],q=(0,c.useState)(),H=(0,o.default)(q,2),U=H[0],J=H[1],Q=(0,c.useRef)(null),K=(0,c.useRef)(null),z=(0,c.useRef)(null),X=(0,c.useRef)(null),Y=(0,c.useContext)(v.ConfigServiceContext),Z=(Y.meeting,Y.sessionConfig),$=Z.permissions.produce.audio,ee=Z.permissions.produce.video,te=Z.permissions.produce.video,ne=ee.allow,re=(0,l.getWebcamConstraints)(ee.quality,ee.frame_rate),ae=((0,l.getScreenShareConstraints)(te.quality,te.frame_rate),t.children),ue=(0,d.useSelector)(function(t){return t.participant.audioMuted}),ie=(0,d.useSelector)(function(t){return t.participant.videoOff}),oe=(0,d.useSelector)(function(t){return t.room.producersState}),ce=(0,d.useSelector)(function(t){return t.participant.switched}),de=(0,d.useSelector)(function(t){return t.participant.canPresent}),se=(0,d.useSelector)(function(t){return t.participant.presentingState}),le=(0,d.useSelector)(function(t){return t.participant.audioTrackSelection}),fe=(0,d.useSelector)(function(t){return t.participant.videoTrackSelection}),ve=(0,d.useSelector)(function(t){return t.participant.videoProduction}),pe=(0,d.useSelector)(function(t){return t.participant.audioProduction}),Se=(0,d.useSelector)(function(t){return t.participant.presentingState}),Te=(oe===s.MediaStates.NOT_APPLICABLE||ve===s.MediaStates.LOADED||ve===s.MediaStates.NOT_STARTED||ve===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&ne,Ie=(oe===s.MediaStates.NOT_APPLICABLE||pe===s.MediaStates.LOADED||pe===s.MediaStates.NOT_STARTED||pe===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&$,Pe=(0,d.useDispatch)(),Ee=c.default.useState([]),he=(0,o.default)(Ee,2),me=he[0],we=he[1],Ae=function(t){we(t)},ge=(0,d.useSelector)(function(t){return t.room.roomViewType}),be=(0,d.useSelector)(function(t){return t.participant.requestToJoinType}),Ne=(0,d.useSelector)(function(t){return t.room.routerState});ge===S.DyteViewTypes.webinar&&be===f.RequestToJoinType.ask&&(re=(0,l.getWebcamConstraints)('QQVGA',null==(T=Z.permissions)?void 0:null==(P=T.produce)?void 0:null==(E=P.video)?void 0:E.frame_rate));(0,c.useEffect)(function(){Q.current=y,K.current=W,z.current=U,X.current=b},[y,W,U,b]),(0,c.useEffect)(function(){I.default.trace('audioMuted_useEffect',{audioMuted:ue,presentingState:se}),b&&(b.enabled=!ue),ge===S.DyteViewTypes.webinar&&se!==f.PresentingState.PRESENTING||Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING))},[ue,se]);var ke=function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,I.default.trace('initialAudioStreamFetch'),t=null,u.prev=3,u.next=6,n.default.awrap((0,l.getAudioTrack)());case 6:t=u.sent,u.next=13;break;case 9:if(u.prev=9,u.t0=u.catch(3),'NotAllowedError'!==u.t0.name){u.next=13;break}throw new Error('No audio permission');case 13:if(t){u.next=15;break}throw new Error('No audio track');case 15:$&&N(t),u.next=23;break;case 18:u.prev=18,u.t1=u.catch(0),I.default.error('initialAudioStreamFetch',u.t1),Pe((0,f.setAudioProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setAudioMuted)(!0));case 23:case"end":return u.stop()}},null,null,[[0,18],[3,9]],Promise)},Me=function(t){if(I.default.trace('setAudioDevice',{audioTrack:!!b}),b&&b.stop(),$){var u=(null==t?void 0:t.deviceId)||(null==le?void 0:le.selectedDeviceId);(0,d.batch)(function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(ke());case 2:Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING)),(null==le?void 0:le.selectedDeviceId)!==u&&Pe((0,f.setAudioTrackSelection)({selectedDeviceId:u}));case 4:case"end":return t.stop()}},null,null,null,Promise)})}else Pe((0,f.setAudioMuted)(!0))},Oe=function(){var t,u,o,c;return n.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return d.prev=0,I.default.trace('initialVideoStreamFetch'),d.next=4,n.default.awrap((0,l.getAllVideoDevices)());case 4:return t=d.sent,u=t.filter(function(t){return'front'===t.facing}),o=u.length>0?u[0]:t[0],c=null,d.prev=8,d.next=11,n.default.awrap((0,l.getVideoTrack)(o.deviceId||'',re));case 11:c=d.sent,d.next=18;break;case 14:if(d.prev=14,d.t0=d.catch(8),'NotAllowedError'!==d.t0.name){d.next=18;break}throw new Error('No video permission');case 18:if(c){d.next=20;break}throw new Error('No video track');case 20:if(ne&&V(c),''!==o.label){d.next=25;break}return d.next=24,n.default.awrap((0,l.getAllVideoDevices)());case 24:t=d.sent;case 25:L(t),Pe((0,f.setVideoTrackSelection)({selectedDeviceId:o.deviceId})),d.next=34;break;case 29:d.prev=29,d.t1=d.catch(0),I.default.error('initialVideoStreamFetch',d.t1),Pe((0,f.setVideoProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setVideoOff)(!0));case 34:case"end":return d.stop()}},null,null,[[0,29],[8,14]],Promise)},xe=function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(I.default.trace('setVideoDevice'),u=(null==t?void 0:t.deviceId)||(null==fe?void 0:fe.selectedDeviceId),ne){o.next=5;break}return Pe((0,f.setVideoOff)(!0)),o.abrupt("return");case 5:(0,d.batch)(function(){Pe((0,f.setVideoOff)(!1)),Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),(null==fe?void 0:fe.selectedDeviceId)!==u&&Pe((0,f.setVideoTrackSelection)({selectedDeviceId:u}))}),setTimeout(function(){var t;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return y&&y.stop(),o.next=3,n.default.awrap((0,l.getVideoTrack)(u,re));case 3:t=o.sent,V(t);case 5:case"end":return o.stop()}},null,null,null,Promise)});case 7:case"end":return o.stop()}},null,null,null,Promise)};(0,c.useEffect)(function(){ge===S.DyteViewTypes.webinar&&Ne===s.MediaStates.LOADED&&Se===f.PresentingState.NOT_PRESENTING?(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.STOPPING)),Pe((0,f.setAudioProduction)(s.MediaStates.STOPPING)),Pe((0,f.setVideoOff)(!0)),Pe((0,f.setAudioMuted)(!0)),setTimeout(function(){y&&y.stop(),b&&b.stop(),N(void 0),V(void 0)})}):Se===f.PresentingState.INITIATED&&(Oe().then(xe),Me())},[Ne,Se]),(0,c.useEffect)(function(){p.default.start({media:'video'});var t=new l.AudioDevicesEmitter(Ae);return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:Q.current&&Q.current.stop(),X.current&&X.current.stop(),K.current&&K.current.stop(),z.current&&z.current.stop();case 4:case"end":return t.stop()}},null,null,null,Promise),function(){t.removeListener()}},[]),c.default.useEffect(function(){ne||(Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&(y.stop(),V(void 0),(0,f.setVideoProduction)(s.MediaStates.CONNECTING))}))},[ne,y]),(0,c.useEffect)(function(){ve===s.MediaStates.NOT_STARTED&&setTimeout(function(){y&&(y.stop(),V(void 0))})},[ve]);var De=function(){(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&y.stop(),V(void 0)})})};(0,c.useEffect)(function(){$||Pe((0,f.setAudioMuted)(!0)),ne||De()},[$,ne]),(0,c.useEffect)(function(){'meeting'===ce?ie||De():'webinar'===ce&&(de||(ue||Pe((0,f.setAudioMuted)(!0)),ie||De()))},[ce]);var Ce=function(){var t,u,o,c,d=arguments;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(t=d.length>0&&void 0!==d[0]?d[0]:null,I.default.trace('changeAudioTrack',{selectedDevice:t}),!(me.length>0)){s.next=10;break}return u={},o={deviceId:null,InCallManagerId:null,device:null},t?(c=t.deviceId,u[c]=t):me.forEach(function(t){var n=t.deviceId;u[n]=t}),u.bluetooth?o={deviceId:'bluetooth',InCallManagerId:'BLUETOOTH',device:u.bluetooth}:u.wired?o={deviceId:'wired',InCallManagerId:'WIRED_HEADSET',device:u.wired}:u.speaker&&(o={deviceId:'speaker',InCallManagerId:'SPEAKER_PHONE',device:u.speaker}),s.next=9,n.default.awrap(p.default.chooseAudioRoute(o.InCallManagerId));case 9:Me(o.device);case 10:case"end":return s.stop()}},null,null,null,Promise)};(0,l.setOnDeviceChange)(function(){var t,o,c,d,s,f,v;return n.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.default.awrap((0,l.getAllVideoDevices)());case 2:if(t=p.sent,o=(0,u.default)(me).find(function(t){return!O.map(function(t){return t.deviceId}).includes(t.deviceId)}),x(me),c=t.find(function(t){return!G.map(function(t){return t.deviceId}).includes(t.deviceId)}),L(t),ue||!o){p.next=10;break}return Me(o),p.abrupt("return");case 10:if(ie||!c){p.next=13;break}return xe(c),p.abrupt("return");case 13:d=!me.map(function(t){return t.deviceId}).includes(null==le?void 0:le.selectedDeviceId),s=!t.map(function(t){return t.deviceId}).includes(null==fe?void 0:fe.selectedDeviceId),ue||void 0!==b&&!d||(f=me[0],Me(f)),ie||void 0!==y&&!s||(v=t[0],xe(v));case 17:case"end":return p.stop()}},null,null,null,Promise)}),(0,c.useEffect)(function(){Ce(void 0),x(me)},[me.length]);var ye={mediaTracks:{webcamTrack:y,setWebcamTrack:V,audioTrack:b,setAudioTrack:N,screenShareVideoTrack:W,setScreenShareVideoTrack:F,screenShareAudioTrack:U,setScreenShareAudioTrack:J},inputDevices:{audioInputDevices:O,videoInputDevices:G,setAudioInputDevices:x,setVideoInputDevices:L,setAudioDevice:Me,setVideoDevice:xe,toggleAudioState:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleAudioState',{audioButtonsEnabled:Ie,audioAllowed:$,audioMuted:ue,audioTrack:!!b}),Ie){t.next=3;break}return t.abrupt("return");case 3:$?ue?(b&&'ended'!==(null==b?void 0:b.readyState)||Me(void 0),Pe((0,f.setAudioMuted)(!1))):Pe((0,f.setAudioMuted)(!0)):ue||Pe((0,f.setAudioMuted)(!0));case 4:case"end":return t.stop()}},null,null,null,Promise)},toggleVideoState:function(t){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleVideoState',{videoButtonsEnabled:Te,videoOff:ie}),Te){t.next=3;break}return t.abrupt("return");case 3:ie?xe():De();case 4:case"end":return t.stop()}},null,null,null,Promise)},onAudioInputChange:function(t){var u;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:I.default.trace('onAudioInputChange',{value:t}),u=O.find(function(n){return n.deviceId===t}),Ce(u);case 3:case"end":return n.stop()}},null,null,null,Promise)},onVideoInputChange:function(t){I.default.trace('onVideoInputChange',{value:t});var n=G.find(function(n){return n.deviceId===t});Pe((0,f.setCameraFacing)(n.facing)),xe(n)}},setupStreams:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(Oe());case 2:return t.next=4,n.default.awrap(ke());case 4:case"end":return t.stop()}},null,null,null,Promise)},videoButtonsEnabled:Te,audioButtonsEnabled:Ie};return c.default.createElement(h.Provider,{value:ye},ae)};var n=t(r(_d[1])),u=t(r(_d[2])),o=t(r(_d[3])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=P(n);if(u&&u.has(t))return u.get(t);var o={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in t)if("default"!==d&&Object.prototype.hasOwnProperty.call(t,d)){var s=c?Object.getOwnPropertyDescriptor(t,d):null;s&&(s.get||s.set)?Object.defineProperty(o,d,s):o[d]=t[d]}o.default=t,u&&u.set(t,o);return o})(r(_d[4])),d=r(_d[5]),s=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=r(_d[9]),p=t(r(_d[10])),S=r(_d[11]),T=r(_d[12]),I=t(r(_d[13]));function P(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(P=function(t){return t?u:n})(t)}var E=T.NativeModules.InCallManager,h=(new T.NativeEventEmitter(E),(0,c.createContext)(null));e.UserTrackContext=h},579,[1,67,49,41,165,432,480,580,487,508,583,482,2,578]); +__d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.UserTrackContext=void 0,e.default=function(t){var T,P,E,h=(0,c.useState)(),A=(0,o.default)(h,2),b=A[0],N=A[1],k=(0,c.useState)([]),D=(0,o.default)(k,2),M=D[0],O=D[1],x=(0,c.useState)(),C=(0,o.default)(x,2),y=C[0],V=C[1],_=(0,c.useState)([]),R=(0,o.default)(_,2),G=R[0],L=R[1],B=(0,c.useState)(),j=(0,o.default)(B,2),W=j[0],F=j[1],q=(0,c.useState)(),H=(0,o.default)(q,2),U=H[0],J=H[1],Q=(0,c.useRef)(null),K=(0,c.useRef)(null),z=(0,c.useRef)(null),X=(0,c.useRef)(null),Y=(0,c.useContext)(v.ConfigServiceContext),Z=(Y.meeting,Y.sessionConfig),$=Z.permissions.produce.audio,ee=Z.permissions.produce.video,te=Z.permissions.produce.video,ne=ee.allow,re=(0,l.getWebcamConstraints)(ee.quality,ee.frame_rate),ae=((0,l.getScreenShareConstraints)(te.quality,te.frame_rate),t.children),ue=(0,d.useSelector)(function(t){return t.participant.audioMuted}),ie=(0,d.useSelector)(function(t){return t.participant.videoOff}),oe=(0,d.useSelector)(function(t){return t.room.producersState}),ce=(0,d.useSelector)(function(t){return t.participant.switched}),de=(0,d.useSelector)(function(t){return t.participant.canPresent}),se=(0,d.useSelector)(function(t){return t.participant.presentingState}),le=(0,d.useSelector)(function(t){return t.participant.audioTrackSelection}),fe=(0,d.useSelector)(function(t){return t.participant.videoTrackSelection}),ve=(0,d.useSelector)(function(t){return t.participant.videoProduction}),pe=(0,d.useSelector)(function(t){return t.participant.audioProduction}),Se=(0,d.useSelector)(function(t){return t.participant.presentingState}),Te=(oe===s.MediaStates.NOT_APPLICABLE||ve===s.MediaStates.LOADED||ve===s.MediaStates.NOT_STARTED||ve===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&ne,Ie=(oe===s.MediaStates.NOT_APPLICABLE||pe===s.MediaStates.LOADED||pe===s.MediaStates.NOT_STARTED||pe===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&$,Pe=(0,d.useDispatch)(),Ee=c.default.useState([]),me=(0,o.default)(Ee,2),we=me[0],he=me[1],Ae=function(t){he(t)},ge=(0,d.useSelector)(function(t){return t.room.roomViewType}),be=(0,d.useSelector)(function(t){return t.participant.requestToJoinType}),Ne=(0,d.useSelector)(function(t){return t.room.routerState});ge===S.DyteViewTypes.webinar&&be===f.RequestToJoinType.ask&&(re=(0,l.getWebcamConstraints)('QQVGA',null==(T=Z.permissions)?void 0:null==(P=T.produce)?void 0:null==(E=P.video)?void 0:E.frame_rate));(0,c.useEffect)(function(){Q.current=y,K.current=W,z.current=U,X.current=b},[y,W,U,b]),(0,c.useEffect)(function(){I.default.trace('audioMuted_useEffect',{audioMuted:ue,presentingState:se}),b&&(b.enabled=!ue),ge===S.DyteViewTypes.webinar&&se!==f.PresentingState.PRESENTING||Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING))},[ue,se]);var ke=function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,I.default.trace('initialAudioStreamFetch'),t=null,u.prev=3,u.next=6,n.default.awrap((0,l.getAudioTrack)());case 6:t=u.sent,u.next=13;break;case 9:if(u.prev=9,u.t0=u.catch(3),'NotAllowedError'!==u.t0.name){u.next=13;break}throw new Error('No audio permission');case 13:if(t){u.next=15;break}throw new Error('No audio track');case 15:$&&N(t),u.next=23;break;case 18:u.prev=18,u.t1=u.catch(0),I.default.error('initialAudioStreamFetch',u.t1),Pe((0,f.setAudioProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setAudioMuted)(!0));case 23:case"end":return u.stop()}},null,null,[[0,18],[3,9]],Promise)},De=function(t){if(I.default.trace('setAudioDevice',{audioTrack:!!b}),b&&b.stop(),$){var u=(null==t?void 0:t.deviceId)||(null==le?void 0:le.selectedDeviceId);(0,d.batch)(function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(ke());case 2:Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING)),(null==le?void 0:le.selectedDeviceId)!==u&&Pe((0,f.setAudioTrackSelection)({selectedDeviceId:u}));case 4:case"end":return t.stop()}},null,null,null,Promise)})}else Pe((0,f.setAudioMuted)(!0))},Me=function(){var t,u,o,c;return n.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return d.prev=0,I.default.trace('initialVideoStreamFetch'),d.next=4,n.default.awrap((0,l.getAllVideoDevices)());case 4:return t=d.sent,u=t.filter(function(t){return'front'===t.facing}),o=u.length>0?u[0]:t[0],c=null,d.prev=8,d.next=11,n.default.awrap((0,l.getVideoTrack)(o.deviceId||'',re));case 11:c=d.sent,d.next=18;break;case 14:if(d.prev=14,d.t0=d.catch(8),'NotAllowedError'!==d.t0.name){d.next=18;break}throw new Error('No video permission');case 18:if(c){d.next=20;break}throw new Error('No video track');case 20:if(ne&&V(c),''!==o.label){d.next=25;break}return d.next=24,n.default.awrap((0,l.getAllVideoDevices)());case 24:t=d.sent;case 25:L(t),Pe((0,f.setVideoTrackSelection)({selectedDeviceId:o.deviceId})),d.next=34;break;case 29:d.prev=29,d.t1=d.catch(0),I.default.error('initialVideoStreamFetch',d.t1),Pe((0,f.setVideoProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setVideoOff)(!0));case 34:case"end":return d.stop()}},null,null,[[0,29],[8,14]],Promise)},Oe=function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(I.default.trace('setVideoDevice'),u=(null==t?void 0:t.deviceId)||(null==fe?void 0:fe.selectedDeviceId),ne){o.next=5;break}return Pe((0,f.setVideoOff)(!0)),o.abrupt("return");case 5:(0,d.batch)(function(){Pe((0,f.setVideoOff)(!1)),Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),(null==fe?void 0:fe.selectedDeviceId)!==u&&Pe((0,f.setVideoTrackSelection)({selectedDeviceId:u}))}),setTimeout(function(){var t;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return y&&y.stop(),o.next=3,n.default.awrap((0,l.getVideoTrack)(u,re));case 3:t=o.sent,V(t);case 5:case"end":return o.stop()}},null,null,null,Promise)});case 7:case"end":return o.stop()}},null,null,null,Promise)};(0,c.useEffect)(function(){ge===S.DyteViewTypes.webinar&&Ne===s.MediaStates.LOADED&&Se===f.PresentingState.NOT_PRESENTING?(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.STOPPING)),Pe((0,f.setAudioProduction)(s.MediaStates.STOPPING)),Pe((0,f.setVideoOff)(!0)),Pe((0,f.setAudioMuted)(!0)),setTimeout(function(){y&&y.stop(),b&&b.stop(),N(void 0),V(void 0)})}):Se===f.PresentingState.INITIATED&&(Me().then(Oe),De())},[Ne,Se]),(0,c.useEffect)(function(){p.default.start({media:'video'});var t=new l.AudioDevicesEmitter(Ae);return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:Q.current&&Q.current.stop(),X.current&&X.current.stop(),K.current&&K.current.stop(),z.current&&z.current.stop();case 4:case"end":return t.stop()}},null,null,null,Promise),function(){t.removeListener()}},[]),c.default.useEffect(function(){ne||(Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&(y.stop(),V(void 0),(0,f.setVideoProduction)(s.MediaStates.CONNECTING))}))},[ne,y]),(0,c.useEffect)(function(){ve===s.MediaStates.NOT_STARTED&&setTimeout(function(){y&&(y.stop(),V(void 0))})},[ve]);var xe=function(){(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&y.stop(),V(void 0)})})};(0,c.useEffect)(function(){$||Pe((0,f.setAudioMuted)(!0)),ne||xe()},[$,ne]),(0,c.useEffect)(function(){'meeting'===ce?ie||xe():'webinar'===ce&&(de||(ue||Pe((0,f.setAudioMuted)(!0)),ie||xe()))},[ce]);var Ce=function(){var t,u,o,c,d=arguments;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(t=d.length>0&&void 0!==d[0]?d[0]:null,I.default.trace('changeAudioTrack',{selectedDevice:t,audioDevices:we}),!(we.length>0)){s.next=10;break}return u={},o={deviceId:null,InCallManagerId:null,device:null},t?(c=t.deviceId,u[c]=t):we.forEach(function(t){var n=t.deviceId;u[n]=t}),u.wired?o={deviceId:'wired',InCallManagerId:'WIRED_HEADSET',device:u.wired}:u.bluetooth?o={deviceId:'bluetooth',InCallManagerId:'BLUETOOTH',device:u.bluetooth}:u.speaker&&(o={deviceId:'speaker',InCallManagerId:'SPEAKER_PHONE',device:u.speaker}),s.next=9,n.default.awrap(p.default.chooseAudioRoute(o.InCallManagerId));case 9:De(o.device);case 10:case"end":return s.stop()}},null,null,null,Promise)};(0,l.setOnDeviceChange)(function(){var t,o,c,d,s,f,v;return n.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.default.awrap((0,l.getAllVideoDevices)());case 2:if(t=p.sent,o=(0,u.default)(we).find(function(t){return!M.map(function(t){return t.deviceId}).includes(t.deviceId)}),O(we),c=t.find(function(t){return!G.map(function(t){return t.deviceId}).includes(t.deviceId)}),L(t),ue||!o){p.next=10;break}return De(o),p.abrupt("return");case 10:if(ie||!c){p.next=13;break}return Oe(c),p.abrupt("return");case 13:d=!we.map(function(t){return t.deviceId}).includes(null==le?void 0:le.selectedDeviceId),s=!t.map(function(t){return t.deviceId}).includes(null==fe?void 0:fe.selectedDeviceId),ue||void 0!==b&&!d||(f=we[0],De(f)),ie||void 0!==y&&!s||(v=t[0],Oe(v));case 17:case"end":return p.stop()}},null,null,null,Promise)}),(0,c.useEffect)(function(){Ce(void 0),O(we)},[we]);var ye={mediaTracks:{webcamTrack:y,setWebcamTrack:V,audioTrack:b,setAudioTrack:N,screenShareVideoTrack:W,setScreenShareVideoTrack:F,screenShareAudioTrack:U,setScreenShareAudioTrack:J},inputDevices:{audioInputDevices:M,videoInputDevices:G,setAudioInputDevices:O,setVideoInputDevices:L,setAudioDevice:De,setVideoDevice:Oe,toggleAudioState:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleAudioState',{audioButtonsEnabled:Ie,audioAllowed:$,audioMuted:ue,audioTrack:!!b}),Ie){t.next=3;break}return t.abrupt("return");case 3:$?ue?(b&&'ended'!==(null==b?void 0:b.readyState)||De(void 0),Pe((0,f.setAudioMuted)(!1))):Pe((0,f.setAudioMuted)(!0)):ue||Pe((0,f.setAudioMuted)(!0));case 4:case"end":return t.stop()}},null,null,null,Promise)},toggleVideoState:function(t){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleVideoState',{videoButtonsEnabled:Te,videoOff:ie}),Te){t.next=3;break}return t.abrupt("return");case 3:ie?Oe():xe();case 4:case"end":return t.stop()}},null,null,null,Promise)},onAudioInputChange:function(t){var u;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:I.default.trace('onAudioInputChange',{value:t}),u=M.find(function(n){return n.deviceId===t}),Ce(u);case 3:case"end":return n.stop()}},null,null,null,Promise)},onVideoInputChange:function(t){I.default.trace('onVideoInputChange',{value:t});var n=G.find(function(n){return n.deviceId===t});Pe((0,f.setCameraFacing)(n.facing)),Oe(n)}},setupStreams:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(Me());case 2:return t.next=4,n.default.awrap(ke());case 4:case"end":return t.stop()}},null,null,null,Promise)},videoButtonsEnabled:Te,audioButtonsEnabled:Ie};return c.default.createElement(w.Provider,{value:ye},ae)};var n=t(r(_d[1])),u=t(r(_d[2])),o=t(r(_d[3])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=P(n);if(u&&u.has(t))return u.get(t);var o={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in t)if("default"!==d&&Object.prototype.hasOwnProperty.call(t,d)){var s=c?Object.getOwnPropertyDescriptor(t,d):null;s&&(s.get||s.set)?Object.defineProperty(o,d,s):o[d]=t[d]}o.default=t,u&&u.set(t,o);return o})(r(_d[4])),d=r(_d[5]),s=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=r(_d[9]),p=t(r(_d[10])),S=r(_d[11]),T=r(_d[12]),I=t(r(_d[13]));function P(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(P=function(t){return t?u:n})(t)}var E=T.NativeModules.InCallManager,w=(new T.NativeEventEmitter(E),(0,c.createContext)(null));e.UserTrackContext=w},579,[1,67,49,41,165,432,480,580,487,508,583,482,2,578]); __d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.setOnDeviceChange=e.getWebcamConstraints=e.getVideoTrack=e.getSpeakerTrack=e.getScreenShareConstraints=e.getScreenShare=e.getQualityAfterLegacyModeShift=e.getAudioTrack=e.getAllVideoDevices=e.getAllMediaDevices=e.AudioDevicesEmitter=void 0;var n=t(r(_d[1])),u=t(r(_d[2])),c=t(r(_d[3])),o=t(r(_d[4])),s=r(_d[5]),d=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=t(r(_d[9])),h=l.NativeModules.InCallManager,D=new l.NativeEventEmitter(h),p=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.enumerateDevices());case 2:return t=n.sent,n.abrupt("return",t);case 4:case"end":return n.stop()}},null,null,null,Promise)};e.getAllMediaDevices=p;var w=(function(){function t(n){if((0,u.default)(this,t),!n)throw new Error('Callback not initalized');this.callback=n,this.notConnected={connected:!1,haveMic:!1},this.connectedWithMic={connected:!0,haveMic:!0},this.connectedWithoutMic={connected:!0,haveMic:!1};var c=(0,d.getHeadset)();this.audioDevices={speaker:this.connectedWithMic,bluetooth:c?this.connectedWithMic:this.notConnected,wired:this.notConnected},this.checkIfWiredHeadphonesConnected(),this.onBluetoothEvent(),this.onWiredHeadsetEvent(),this.emit(),this.wiredHeadListener=null}return(0,c.default)(t,[{key:"checkIfWiredHeadphonesConnected",value:function(){var t;return o.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,o.default.awrap(v.default.getIsWiredHeadsetPluggedIn());case 2:t=u.sent,this.audioDevices=(0,n.default)({},this.audioDevices,{wired:t?this.connectedWithMic:this.notConnected}),this.emit();case 5:case"end":return u.stop()}},null,this,null,Promise)}},{key:"onBluetoothEvent",value:function(){var t=this;(0,d.addListener)(function(u){var c=t.audioDevices.bluetooth.connected;u&&!c?(t.audioDevices=(0,n.default)({},t.audioDevices,{bluetooth:(0,n.default)({},t.connectedWithMic)}),t.emit()):!u&&c&&(t.audioDevices=(0,n.default)({},t.audioDevices,{bluetooth:(0,n.default)({},t.notConnected)}),t.emit())})}},{key:"onWiredHeadsetEvent",value:function(){var t=this;this.wiredHeadListener=D.addListener('WiredHeadset',function(u){if(u){var c=u.isPlugged,o=u.hasMic,s=t.audioDevices.wired.connected;if(c&&!s){var d=o?(0,n.default)({},t.connectedWithMic):(0,n.default)({},t.connectedWithoutMic);t.audioDevices=(0,n.default)({},t.audioDevices,{wired:d}),t.emit()}else!c&&s&&(t.audioDevices=(0,n.default)({},t.audioDevices,{wired:(0,n.default)({},t.notConnected)}),t.emit())}})}},{key:"getAudioDevices",value:function(){return this.formatAudioDevices()}},{key:"formatAudioDevices",value:function(){var t=this;return Object.keys(this.audioDevices).map(function(u){var c=t.audioDevices[u];return(0,n.default)({},c,{deviceId:u,label:u,kind:'audioinput'})}).filter(function(t){return t.connected})}},{key:"emit",value:function(){this.callback(this.formatAudioDevices())}},{key:"removeListener",value:function(){var t;null==(t=this.wiredHeadListener)||t.remove()}}]),t})();e.AudioDevicesEmitter=w;e.getAllVideoDevices=function(){var t,n;return o.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return t={},u.next=3,o.default.awrap(p());case 3:return n=u.sent,u.abrupt("return",n.filter(function(n){return'videoinput'===n.kind&&!t[n.facing]&&(t[n.facing]=!0,n)}));case 5:case"end":return u.stop()}},null,null,null,Promise)};e.getWebcamConstraints=function(t,n){var u=f.VIDEO_CONSTRAINS[t.toLowerCase()];if(!u)throw new Error('Invalid quality');if(n){if(n<5||n>30)throw new Error('Invalid framerate');u.frameRate={ideal:n}}return u};e.getScreenShareConstraints=function(t,n){var u=f.VIDEO_CONSTRAINS_SCREENSHARE[t.toLowerCase()||'vga'];if(!u)throw new Error('Invalid quality');if(n){if(n<5||n>30)throw new Error('Invalid framerate');u.frameRate={max:n}}return u};e.getVideoTrack=function(t,u){var c,d;return o.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return c=u||f.VIDEO_CONSTRAINS.vga,l.next=3,o.default.awrap(s.mediaDevices.getUserMedia({video:(0,n.default)({deviceId:t||'',frameRate:24},c),audio:!1}));case 3:return d=l.sent,l.abrupt("return",d.getVideoTracks()[0]);case 5:case"end":return l.stop()}},null,null,null,Promise)};e.getAudioTrack=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.getUserMedia({audio:!0,video:!1}));case 2:return t=n.sent,n.abrupt("return",t.getAudioTracks()[0]);case 4:case"end":return n.stop()}},null,null,null,Promise)};e.getSpeakerTrack=function(t){return o.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null);case 2:case"end":return t.stop()}},null,null,null,Promise)};e.getScreenShare=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.getDisplayMedia({audio:!0,video:{displaySurface:'monitor',logicalSurface:!0,cursor:!0,width:{max:1920},height:{max:1080},frameRate:{max:5}}}));case 2:return t=n.sent,n.abrupt("return",{video:t.getTracks()[0],audio:null});case 4:case"end":return n.stop()}},null,null,null,Promise)};e.setOnDeviceChange=function(t){};e.getQualityAfterLegacyModeShift=function(t,n,u){return n===f.HD_QUALITY_PEERS_LIMIT&&t?f.VIDEO_CONSTRAINS.vga:n!==f.HD_QUALITY_PEERS_LIMIT+1||t?u:f.VIDEO_CONSTRAINS.hd}},580,[1,22,9,10,67,400,581,2,582,583]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.useBluetoothHeadsetDetection=e.removeListener=e.getHeadset=e.addListener=void 0;var n=t(r(d[1])),u=r(d[2]),o=r(d[3]),s=u.NativeModules.DyteRNBluetoothHeadsetDetect,c=null,v=[],f=new u.NativeEventEmitter(s).addListener('onChange',function(t){var n=t.devices;c=n.length?n[0]:null,v.forEach(function(t){t(c)})});e.getHeadset=function(){return c};var l=function(t){v.push(t)};e.addListener=l;var h=function(t){var n=v.indexOf(t);-1!==n&&v.splice(n,1)};e.removeListener=h;e.useBluetoothHeadsetDetection=function(){var t=(0,o.useState)(null),u=(0,n.default)(t,2),s=u[0],v=u[1];return(0,o.useEffect)(function(){return v(c),l(v),function(){h(v),f.remove()}},[]),s}},581,[1,41,2,165]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.WEBCAM_SIMULCAST_ENCODINGS_VGA=e.WEBCAM_SIMULCAST_ENCODINGS=e.WEBCAM_KSVC_ENCODINGS=e.VIDEO_CONSTRAINS_SCREENSHARE=e.VIDEO_CONSTRAINS=e.SCREEN_SHARING_SVC_ENCODINGS=e.SCREEN_SHARING_SIMULCAST_ENCODINGS=e.PC_PROPRIETARY_CONSTRAINTS=e.ICE_SERVERS=e.HD_QUALITY_PEERS_LIMIT=void 0;e.VIDEO_CONSTRAINS={qqvga:{width:{ideal:160},height:{ideal:120}},qvga:{width:320,height:240},vga:{width:640,height:480},hd:{width:1280,height:720},hd_cropped:{width:900,height:720}};e.VIDEO_CONSTRAINS_SCREENSHARE={vga:{width:{max:640},height:{max:480}},hd:{width:{max:1280},height:{max:720}},full_hd:{width:{max:1980},height:{max:1080}}};e.PC_PROPRIETARY_CONSTRAINTS={optional:[{googDscp:!0},{googHighStartBitrate:0},{googPayloadPadding:!0},{googScreencastMinBitrate:100},{googCpuOveruseDetection:!0},{googCpuOveruseEncodeUsage:!0},{googCpuUnderuseThreshold:55},{googCpuOveruseThreshold:85}]};e.WEBCAM_SIMULCAST_ENCODINGS=[{rid:'r0',scalabilityMode:'S1T3'},{rid:'r1',scalabilityMode:'S1T3'},{rid:'r2',scalabilityMode:'S1T3'}];e.WEBCAM_SIMULCAST_ENCODINGS_VGA=[{rid:'r0',scalabilityMode:'S1T2'},{rid:'r1',scalabilityMode:'S1T2'}];e.WEBCAM_KSVC_ENCODINGS=[{scalabilityMode:'L3T3_KEY'}];e.SCREEN_SHARING_SIMULCAST_ENCODINGS=[{dtx:!0,maxBitrate:15e5},{dtx:!0,maxBitrate:6e6}];e.SCREEN_SHARING_SVC_ENCODINGS=[{scalabilityMode:'L3T3',dtx:!0}];e.HD_QUALITY_PEERS_LIMIT=1;e.ICE_SERVERS=[{urls:'turn:turn.dyte.in:443?transport=tcp',username:'dyte',credential:'dytein',credentialType:'password'},{urls:'turn:turn.dyte.in:3478?transport=udp',username:'dyte',credential:'dytein',credentialType:'password'}]},582,[]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),o=t(r(d[3])),s=r(d[4]),l=r(d[4]).NativeModules.InCallManager,c=new((function(){function t(){(0,u.default)(this,t),this.vibrate=!1,this.audioUriMap={ringtone:{_BUNDLE_:null,_DEFAULT_:null},ringback:{_BUNDLE_:null,_DEFAULT_:null},busytone:{_BUNDLE_:null,_DEFAULT_:null}}}return(0,o.default)(t,[{key:"start",value:function(t){var n=!1!==(t=void 0===t?{}:t).auto,u='video'===t.media?'video':'audio',o=t.ringback&&'string'==typeof t.ringback?t.ringback:'';l.start(u,n,o)}},{key:"stop",value:function(t){var n=(t=void 0===t?{}:t).busytone&&'string'==typeof t.busytone?t.busytone:'';l.stop(n)}},{key:"getIsWiredHeadsetPluggedIn",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n.default.awrap(l.getIsWiredHeadsetPluggedIn());case 3:return t.abrupt("return",t.sent);case 6:throw t.prev=6,t.t0=t.catch(0),new Error('Incall Manager Error getting wired headset');case 9:case"end":return t.stop()}},null,null,[[0,6]],Promise)}},{key:"setKeepScreenOn",value:function(t){t=!0===t,l.setKeepScreenOn(t)}},{key:"setSpeakerphoneOn",value:function(t){t=!0===t,l.setSpeakerphoneOn(t)}},{key:"setForceSpeakerphoneOn",value:function(t){var n='boolean'==typeof t?t?1:-1:0;l.setForceSpeakerphoneOn(n)}},{key:"setMicrophoneMute",value:function(t){t=!0===t,l.setMicrophoneMute(t)}},{key:"getAudioUri",value:function(t,u){var o;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(void 0!==this.audioUriMap[t]){s.next=2;break}return s.abrupt("return",null);case 2:if(!this.audioUriMap[t][u]){s.next=4;break}return s.abrupt("return",this.audioUriMap[t][u]);case 4:return s.prev=4,s.next=7,n.default.awrap(l.getAudioUriJS(t,u));case 7:if(!('string'==typeof(o=s.sent)&&o.length>0)){s.next=11;break}return this.audioUriMap[t][u]=o,s.abrupt("return",o);case 11:return s.abrupt("return",null);case 14:return s.prev=14,s.t0=s.catch(4),s.abrupt("return",null);case 17:case"end":return s.stop()}},null,this,[[4,14]],Promise)}},{key:"chooseAudioRoute",value:function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(l.chooseAudioRoute(t));case 2:return u=o.sent,o.abrupt("return",u);case 4:case"end":return o.stop()}},null,null,null,Promise)}},{key:"requestAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.requestAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}},{key:"abandonAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.abandonAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}}]),t})());e.default=c},583,[1,67,9,10,2]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),o=t(r(d[3])),s=r(d[4]),l=r(d[4]).NativeModules.InCallManager,c=new((function(){function t(){(0,u.default)(this,t),this.vibrate=!1,this.audioUriMap={ringtone:{_BUNDLE_:null,_DEFAULT_:null},ringback:{_BUNDLE_:null,_DEFAULT_:null},busytone:{_BUNDLE_:null,_DEFAULT_:null}}}return(0,o.default)(t,[{key:"start",value:function(t){var n=!1!==(t=void 0===t?{}:t).auto,u='video'===t.media?'video':'audio',o=t.ringback&&'string'==typeof t.ringback?t.ringback:'';l.start(u,n,o)}},{key:"stop",value:function(t){var n=(t=void 0===t?{}:t).busytone&&'string'==typeof t.busytone?t.busytone:'';l.stop(n)}},{key:"getIsWiredHeadsetPluggedIn",value:function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,u.next=3,n.default.awrap(l.getIsWiredHeadsetPluggedIn());case 3:return t=u.sent,u.abrupt("return",{isWiredHeadsetPluggedIn:t});case 7:throw u.prev=7,u.t0=u.catch(0),new Error('Incall Manager Error getting wired headset');case 10:case"end":return u.stop()}},null,null,[[0,7]],Promise)}},{key:"setKeepScreenOn",value:function(t){t=!0===t,l.setKeepScreenOn(t)}},{key:"setSpeakerphoneOn",value:function(t){t=!0===t,l.setSpeakerphoneOn(t)}},{key:"setForceSpeakerphoneOn",value:function(t){var n='boolean'==typeof t?t?1:-1:0;l.setForceSpeakerphoneOn(n)}},{key:"setMicrophoneMute",value:function(t){t=!0===t,l.setMicrophoneMute(t)}},{key:"getAudioUri",value:function(t,u){var o;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(void 0!==this.audioUriMap[t]){s.next=2;break}return s.abrupt("return",null);case 2:if(!this.audioUriMap[t][u]){s.next=4;break}return s.abrupt("return",this.audioUriMap[t][u]);case 4:return s.prev=4,s.next=7,n.default.awrap(l.getAudioUriJS(t,u));case 7:if(!('string'==typeof(o=s.sent)&&o.length>0)){s.next=11;break}return this.audioUriMap[t][u]=o,s.abrupt("return",o);case 11:return s.abrupt("return",null);case 14:return s.prev=14,s.t0=s.catch(4),s.abrupt("return",null);case 17:case"end":return s.stop()}},null,this,[[4,14]],Promise)}},{key:"chooseAudioRoute",value:function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(l.chooseAudioRoute(t));case 2:return u=o.sent,o.abrupt("return",u);case 4:case"end":return o.stop()}},null,null,null,Promise)}},{key:"requestAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.requestAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}},{key:"abandonAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.abandonAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}}]),t})());e.default=c},583,[1,67,9,10,2]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),o=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=_(t);if(o&&o.has(e))return o.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=u?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(n,s,l):n[s]=e[s]}n.default=e,o&&o.set(e,n);return n})(r(d[2])),n=r(d[3]),u=r(d[4]),s=r(d[5]),l=r(d[6]),c=r(d[7]),f=r(d[8]),p=e(r(d[9])),N=r(d[10]),E=r(d[11]),h=r(d[12]),v=r(d[13]),S=e(r(d[14])),y=r(d[15]),P=r(d[16]),w=r(d[17]),T=r(d[18]),O=r(d[19]),C=r(d[20]),x=r(d[21]),b=e(r(d[22])),I=e(r(d[23])),M=e(r(d[24]));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(_=function(e){return e?o:t})(e)}var D="\nquery Session($roomName: String!, $password: String) {\n\tsession(roomName: $roomName, password: $password) {\n\t title,\n\t roomNodeLink,\n\t roomName,\n\t password\n\t}\n }\n";function k(e){var _,k=(0,n.useDispatch)(),j=e.roomName,L=e.autoTune,W=(0,n.useSelector)(function(e){return e.participant.peerId}),R=(0,o.useContext)(y.ConfigServiceContext),U=R.meeting,$=R.sessionConfig,A=R.updatePreset,Q=((0,o.useContext)(P.ThemeContext).colors,(0,o.useState)('')),B=(0,t.default)(Q,2),F=B[0],G=B[1],V=(0,h.useManualQuery)(D,{variables:{roomName:j,password:''}}),q=(0,t.default)(V,2),K=q[0],Y=q[1],z=Y.data,H=Y.error,J=Y.loading,X=(0,v.useWindowDimensions)(),Z=$.theme.dimensions||X,ee=Z.height,te=Z.width,re=o.default.useState(!1),oe=(0,t.default)(re,2),ne=(oe[0],oe[1]),ae=(0,o.useContext)(w.UserTrackContext).setupStreams,ie=(0,n.useSelector)(function(e){return e.participant.authToken}),ue=(0,n.useSelector)(function(e){return e.participant.displayName}),se=(0,n.useSelector)(function(e){return e.participant.participantPermissions}),le=$.permissions.produce.audio,me=$.permissions.produce.video.allow,ce=(0,n.useSelector)(function(e){return e.room.showSetupScreen}),de=o.default.useState(j),fe=(0,t.default)(de,2),pe=fe[0],Ne=fe[1],Ee='LANDSCAPE'===o.default.useContext(x.OrientationContext).orientation,he=(0,n.useSelector)(function(e){return e.room.roomViewType}),ve=$.permissions_fetched;(0,o.useEffect)(function(){ve&&(me?(0,O.setupPermissions)(['camera','microphone']):le?(0,O.setupPermissions)(['microphone']):(0,O.setupPermissions)([]),ne(!0))},[he,ve]),(0,o.useEffect)(function(){k((0,c.resetRoom)({roomName:j})),k((0,f.resetPeers)());try{S.default.getItem('dyte-display-name').then(function(e){null!==e&&k((0,E.setUserDisplayName)(e))})}catch(e){}},[]),(0,o.useEffect)(function(){pe&&(ie||C.DYTE_DEV_MODE)&&(k((0,c.resetRoom)({roomName:pe})),K({variables:{roomName:pe,password:''}}),A(pe,ie))},[pe,ie]),(0,o.useEffect)(function(){if(H)if(H.graphQLErrors[0].message.indexOf('No open session')>=0)null==U||U._onError('MEETING_NOTFOUND'),G('MEETING_NOTFOUND');else try{var e=H.graphQLErrors[0];G(null==e?void 0:e.message)}catch(e){G('UNKNOWN')}},[H,U]),(0,o.useEffect)(function(){se.camera===E.permissionEnum.INIT&&se.microphone===E.permissionEnum.INIT||ae()},[se.camera,se.microphone]);if(se.bluetooth===E.permissionEnum.INIT)return o.default.createElement(p.default,{text:"Waiting for permissions..."});var Se;return null==U||!U.showSetupScreen||null!==ce&&!0!==ce?H?o.default.createElement(p.default,{errorText:"Some error occured. Issue code: "+F,childComponents:o.default.createElement(T.Button,{onClick:function(){setTimeout(function(){k((0,f.resetPeers)()),k((0,E.resetParticipant)()),k((0,c.setShowSetupScreen)(!0)),Ne(''),G('')})}},o.default.createElement(T.Box,{bg:"primary.500",py:15,px:10,mt:10,borderRadius:b.default.medium,align:"center"},o.default.createElement(T.Text,null,"Try Again")))}):J?o.default.createElement(p.default,{text:"Loading..."}):o.default.createElement(l.WebSocketProvider,{url:null==z?void 0:null==(_=z.session)?void 0:_.roomNodeLink,roomURL:pe,peerId:W},o.default.createElement(u.MediaRoomProvider,{peerId:W,roomName:pe,autoTune:L},o.default.createElement(N.PeersProvider,null,o.default.createElement(s.PluginServiceProvider,{roomName:pe,peerId:W},o.default.createElement(I.default,{roomName:pe}))))):o.default.createElement(M.default,{width:te,height:ee,isLandscape:Ee,meetingCode:pe,roomName:j,onChangeMeetingCode:Ne,joinMeeting:function(){ue&&pe&&(k((0,c.setShowSetupScreen)(!1)),k((0,c.resetRoom)({roomName:pe})),K({variables:{roomName:pe,password:''}}),A(pe,ie))},title:null==z?void 0:null==(Se=z.session)?void 0:Se.title})}k.defaultProps={autoTune:!0};var j=k;_e.default=j},584,[1,41,165,432,585,672,630,480,481,511,674,487,465,2,488,508,514,579,512,675,543,575,676,677,809]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.MediaRoomProvider=e.MediaRoomContext=void 0;var n=t(r(d[1])),o=t(r(d[2])),u=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=T(n);if(o&&o.has(t))return o.get(t);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var l=c?Object.getOwnPropertyDescriptor(t,s):null;l&&(l.get||l.set)?Object.defineProperty(u,s,l):u[s]=t[s]}u.default=t,o&&o.set(t,u);return u})(r(d[3])),c=r(d[4]),s=r(d[5]),l=r(d[6]),f=r(d[7]),p=t(r(d[8])),v=r(d[9]),S=r(d[10]),E=r(d[11]),M=t(r(d[12])),k=r(d[13]),C=r(d[14]),P=t(r(d[15])),R=r(d[16]),O=t(r(d[17]));function T(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(T=function(t){return t?o:n})(t)}var b=R.NativeModules.DyteHelper,A=(0,u.createContext)(null);e.MediaRoomContext=A;e.MediaRoomProvider=function(t){var T=t.children,x=t.peerId,y=t.roomName,h=t.autoTune,D=(0,u.useContext)(v.WebSocketContext),N=(0,u.useContext)(k.ConfigServiceContext),w=N.meeting,I=N.sessionConfig,_=I.permissions.produce.audio,L=(0,u.useContext)(E.UserTrackContext),j=L.mediaTracks,W=j.webcamTrack,B=j.audioTrack,F=L.inputDevices.toggleVideoState,G=(0,c.useDispatch)(),U=(0,u.useState)(null),V=(0,o.default)(U,2),q=V[0],H=V[1],z=(0,u.useRef)(null),J=(0,u.useRef)(null),K=(0,u.useRef)(''),Q=(0,u.useRef)(null),X=(0,c.useSelector)(function(t){return t.room.socketState}),Y=(0,c.useSelector)(function(t){return t.room.producersState}),Z=(0,c.useSelector)(function(t){return t.participant.videoProduction}),$=(0,c.useSelector)(function(t){return t.participant.audioProduction}),ee=(0,c.useSelector)(function(t){return t.participant.audioMuted});(0,u.useEffect)(function(){q&&(J.current=q)},[q]),(0,u.useEffect)(function(){q&&(ee?q.muteSelf():q.unmuteSelf())},[ee]),(0,u.useEffect)(function(){Y===s.MediaStates.LOADED&&Z===s.MediaStates.CONNECTING&&(W?null==q||q.shareWebcam(W):null==q||q.disableWebcam())},[W,Y]),(0,u.useEffect)(function(){Y===s.MediaStates.LOADED&&$===s.MediaStates.CONNECTING&&(B&&_&&!ee?null==q||q.shareMic(B):null==q||q.disableMic())},[B,$]),(0,u.useEffect)(function(){var t;if(X===s.RoomSocketState.CONNECTED){M.default.captureEvent('setting up connection',{peerId:x}),w&&w.emit(w.Events.connect);var o=new p.default(x,D,G,h);H(o),t=o,n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(t.getRoomState());case 2:return o.next=4,n.default.awrap(t.loadRouter());case 4:return o.next=6,n.default.awrap(Promise.all([t.createRecvTransport(),t.createSendTransport()]));case 6:w&&(w.sendRoomMessage=function(t){D.sendMessage({type:C.Events.roomMessage,payload:{message:t}})},w.sendMessage=function(t,n){D.sendMessage({type:C.Events.message,payload:{peerId:t,message:n}})},w.kickAll=function(){I.permissions.kick_participant&&t.kickAll()},null==D||D.emitter.on('socket',function(t){return w.onSocketMessage(t)})),G((0,s.setRouterFetchState)(s.MediaStates.LOADED)),G((0,s.setProducersState)(s.MediaStates.NOT_STARTED));case 9:case"end":return o.stop()}},null,null,null,Promise)}else X===s.RoomSocketState.DISCONNECTED&&(M.default.captureEvent('socket disconnected',{peerId:x}),null==q||q.stopAllTransports(),null==D||D.emitter.removeAllListeners(),G((0,s.resetRoom)({roomName:y})),G((0,f.resetPeers)()),G((0,S.resetParticipant)()),H(null),(0,s.setRouterFetchState)(s.MediaStates.NOT_APPLICABLE))},[X,x]),(0,u.useEffect)(function(){return function(){var t,n;null==(t=J.current)||t.stopAllProducers(),null==(n=J.current)||n.stopAllTransports()}},[]);var te=function(t){K.current.match(/inactive|background/)&&'active'===t?(O.default.trace('configureBackground'),P.default.clearInterval(Q.current),Q.current=null,W&&(W.enabled=!1,setTimeout(function(){W&&(W.enabled=!0)},100)),z.current&&(z.current=!1,F()),l.store.getState().room.screenShareRequested||b.stopService()):(null===Q.current&&n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(O.default.trace('configureForeground'),W&&'DISABLE_CAMERA_CAPTURE'===w.setupConfig.backgroundBehaviour&&(F(),z.current=!0),!(R.Platform.Version>=26)){t.next=5;break}return t.next=5,n.default.awrap(b.createNotificationChannel());case 5:return t.next=7,n.default.awrap(b.startService());case 7:case"end":return t.stop()}},null,null,null,Promise),Q.current=P.default.setInterval(function(){},1e3),K.current=t)};(0,u.useEffect)(function(){if('android'===R.Platform.OS){var t=R.AppState.addEventListener('change',te);return function(){t?t.remove():R.AppState.removeEventListener('change',te),Q.current&&P.default.clearInterval(Q.current)}}return function(){}},[W,F]);var ne={mediaRoom:q};return u.default.createElement(A.Provider,{value:ne},T)}},585,[1,67,41,165,432,480,471,481,586,630,487,579,663,508,665,671,2,578]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1])),n=t(r(d[2])),o=t(r(d[3])),u=t(r(d[4])),c=r(d[5]),l=r(d[6]),p=r(d[7]),h=r(d[8]),f=r(d[9]),y=r(d[10]),v=r(d[11]),k=(function(){function t(s,n,u){!(arguments.length>3&&void 0!==arguments[3])||arguments[3];(0,o.default)(this,t),this.socketObj=n,this.peerid=s,this.dispatch=u,this.device=new c.Device,this.consumers=new Map,this.legacyMode=!0,this.closedConsumers=[],this.handleSockets=this.handleSockets.bind(this)}return(0,u.default)(t,[{key:"handleSockets",value:function(t,s){if(t)switch(t.type){case'websocket/new-consumer':this.createConsumer(t.payload,s);break;case'websocket/consumer-closed':this.closeConsumer(t.payload);break;case'websocket/consumer-paused':this.pauseConsumer(t.payload);break;case'websocket/consumer-resumed':this.resumeConsumer(t.payload);break;case'websocket/recording-started':this.setRecordingStatus(!0);break;case'websocket/recording-stopped':this.setRecordingStatus(!1)}}},{key:"loadRouter",value:function(){var t,n,o;return s.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return(this.recvTransport||this.sendTransport)&&this.stopAllTransports(),this.dispatch((0,f.setRouterFetchState)(f.MediaStates.CONNECTING)),u.next=4,s.default.awrap(null==(t=this.socketObj)?void 0:t.sendMessage({type:'getRouterRtpCapabilities'}));case 4:return n=u.sent,this.device.loaded&&(this.device=new c.Device),(o=null==n?void 0:n.payload)&&(o.headerExtensions=o.headerExtensions.filter(function(t){return'urn:3gpp:video-orientation'!==t.uri})),this.socketObj.emitter.on('socket',this.handleSockets),u.abrupt("return",this.device.load({routerRtpCapabilities:o}));case 10:case"end":return u.stop()}},null,this,null,Promise)}},{key:"getRoomState",value:function(){var t;return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.CONNECTING)),n.next=3,s.default.awrap(null==(t=this.socketObj)?void 0:t.sendMessage({type:'getRoomState'}));case 3:this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.LOADED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"changeRoomDisplayTitle",value:function(t){var n;return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.CONNECTING)),o.next=3,s.default.awrap(null==(n=this.socketObj)?void 0:n.sendMessage({type:'changeDisplayTitle',payload:{displayTitle:t}}));case 3:this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.LOADED));case 4:case"end":return o.stop()}},null,this,null,Promise)}},{key:"joinRoom",value:function(t,n,o){var u;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,s.default.awrap(this.socketObj.sendMessage({type:'joinRoom',payload:{device:(0,p.getDeviceInfo)(),displayName:t,rtpCapabilities:this.device.rtpCapabilities,isLegacy:this.legacyMode,audioMuted:n}}));case 2:if(u=c.sent,this.legacyMode=u.payload.legacyMode||this.legacyMode,!o||''===o){c.next=7;break}return c.next=7,s.default.awrap(this.changeRoomDisplayTitle(o));case 7:return this.dispatch((0,v.roomJoined)(u.payload)),c.abrupt("return",u);case 9:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createRecvTransport",value:function(){var t,o,u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==this.socketObj){c.next=2;break}return c.abrupt("return");case 2:return t={forceTcp:!1,producing:!1,consuming:!0},c.next=5,s.default.awrap(this.socketObj.sendMessage({type:'createWebRtcTransport',payload:t}));case 5:o=c.sent.payload,this.recvTransport=this.device.createRecvTransport((0,n.default)({},o,{iceServers:l.ICE_SERVERS,proprietaryConstraints:l.PC_PROPRIETARY_CONSTRAINTS})),this.recvTransport.on('connect',function(t,s,n){var o,c,l=t.dtlsParameters;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'connectWebRtcTransport',payload:{transportId:null==(c=u.recvTransport)?void 0:c.id,dtlsParameters:l}},function(t){t.payload.error?n():s()})});case 8:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createSendTransport",value:function(){var t,o,u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return t={forceTcp:!1,producing:!0,consuming:!1},c.next=3,s.default.awrap(this.socketObj.sendMessage({type:'createWebRtcTransport',payload:t}));case 3:o=c.sent.payload,this.sendTransport=this.device.createSendTransport((0,n.default)({},o,{iceServers:l.ICE_SERVERS,proprietaryConstraints:l.PC_PROPRIETARY_CONSTRAINTS})),void 0!==this.sendTransport&&(this.sendTransport.on('connect',function(t,s,n){var o,c,l=t.dtlsParameters;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'connectWebRtcTransport',payload:{transportId:null==(c=u.sendTransport)?void 0:c.id,dtlsParameters:l}},function(t){t.payload.error?n():s()})}),this.sendTransport.on('produce',function(t,s,n){var o,c,l=t.kind,p=t.rtpParameters,h=t.appData;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'produce',payload:{transportId:null==(c=u.sendTransport)?void 0:c.id,kind:l,rtpParameters:p,appData:h}},function(t){t.payload.error?n(t.payload.error):s({id:t.payload.id})})}));case 6:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createConsumer",value:function(t,o){var u,c,l,p,h,f,v,k,P,w,b;return s.default.async(function(x){for(;;)switch(x.prev=x.next){case 0:if(void 0!==this.recvTransport&&!this.recvTransport.closed){x.next=2;break}return x.abrupt("return");case 2:return u=t.peerId,c=t.producerId,l=t.id,p=t.kind,h=t.rtpParameters,f=t.type,v=t.appData,k=t.producerPaused,P=t.remotelyPaused,w=t.priority,x.next=5,s.default.awrap(this.recvTransport.consume({id:l,producerId:c,kind:p,rtpParameters:h,appData:(0,n.default)({},v,{peerId:u})}));case 5:b=x.sent,this.closedConsumers.includes(l)?b.close():(this.consumers.set(b.id,b),this.dispatch((0,y.addConsumer)({id:l,peerId:u,type:f,kind:p,remotelyPaused:P,producerPaused:k,priority:w,appData:b.appData,score:10,producerScore:10}))),o&&o('Done');case 8:case"end":return x.stop()}},null,this,null,Promise)}},{key:"closeConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=6;break}return console.log('Consumer not found'),this.closedConsumers.push(n),s.abrupt("return");case 6:o.close(),this.consumers.delete(n);case 8:case"end":return s.stop()}},null,this,null,Promise)}},{key:"pauseConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=4;break}return s.abrupt("return");case 4:o.pause();case 5:case"end":return s.stop()}},null,this,null,Promise)}},{key:"resumeConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=4;break}return s.abrupt("return");case 4:o.resume();case 5:case"end":return s.stop()}},null,this,null,Promise)}},{key:"shareWebcam",value:function(t){var n,o,u,c,p,y=this;return s.default.async(function(v){for(;;)switch(v.prev=v.next){case 0:if(void 0!==t){v.next=2;break}return v.abrupt("return");case 2:if(!this.webCamProducer){v.next=5;break}return v.next=5,s.default.awrap(this.removeProducer('webCamProducer',!1));case 5:return n=l.WEBCAM_SIMULCAST_ENCODINGS_VGA,o=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp9'===t.mimeType.toLowerCase()})||void 0,u=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp8'===t.mimeType.toLowerCase()})||void 0,o&&!this.legacyMode&&(n=l.WEBCAM_KSVC_ENCODINGS),this.dispatch((0,h.setVideoOff)(!1)),this.dispatch((0,h.setVideoProduction)(f.MediaStates.FETCHED)),c={track:t,encodings:n,codecOptions:{videoGoogleStartBitrate:1e3},codec:(function(){return y.legacyMode?u:o})(),appData:{screenShare:!1},stopTracks:!1},p=function(){y.disableWebcam()},v.next=16,s.default.awrap(this.createProducer('webCamProducer',c,p));case 16:this.dispatch((0,h.setVideoProduction)(f.MediaStates.LOADED));case 17:case"end":return v.stop()}},null,this,null,Promise)}},{key:"shareScreen",value:function(t){var n,o,u,c,p,y,v,k,P=this;return s.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:if(n=t.video,o=t.audio,void 0!==n){w.next=3;break}return w.abrupt("return");case 3:return u=l.SCREEN_SHARING_SIMULCAST_ENCODINGS,null===(c=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp9'===t.mimeType.toLowerCase()})||null)||this.legacyMode||(u=l.SCREEN_SHARING_SVC_ENCODINGS),this.dispatch((0,h.setScreenSharing)(!0)),this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.FETCHED)),p={track:n,encodings:u,codecOptions:{videoGoogleStartBitrate:1e3},codec:this.legacyMode?void 0:c,appData:{screenShare:!0},stopTracks:!1},y=function(){P.disableScreenShare()},w.next=12,s.default.awrap(this.createProducer('screenShareVideoProducer',p,y));case 12:if(!o){w.next=17;break}return v={track:o,codecOptions:{opusDtx:!0,opusStereo:!1,opusFec:!0},appData:{screenShare:!0},stopTracks:!1},k=function(){},w.next=17,s.default.awrap(this.createProducer('screenShareAudioProducer',v,k));case 17:this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.LOADED));case 18:case"end":return w.stop()}},null,this,null,Promise)}},{key:"shareMic",value:function(t,n){var o,u,c=this;return s.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:if(void 0!==t){l.next=2;break}return l.abrupt("return");case 2:if(!this.micProducer){l.next=5;break}return l.next=5,s.default.awrap(this.removeProducer('micProducer',!1));case 5:return n&&this.dispatch((0,h.setAudioMuted)(n||!1)),this.dispatch((0,h.setAudioProduction)(f.MediaStates.FETCHED)),o={track:t,codecOptions:{opusDtx:!0,opusStereo:!1,opusFec:!0},stopTracks:!1},u=function(){c.disableMic()},l.next=11,s.default.awrap(this.createProducer('micProducer',o,u));case 11:this.dispatch((0,h.setAudioProduction)(f.MediaStates.LOADED));case 12:case"end":return l.stop()}},null,this,null,Promise)}},{key:"pauseMic",value:function(){this.dispatch((0,h.setAudioMuted)(!0)),this.micProducer.pause()}},{key:"pauseWebcam",value:function(){this.dispatch((0,h.setVideoOff)(!0)),this.webCamProducer.pause()}},{key:"resumeMic",value:function(){this.dispatch((0,h.setAudioMuted)(!1)),this.micProducer.resume()}},{key:"resumeWebcam",value:function(){this.dispatch((0,h.setVideoOff)(!1)),this.webCamProducer.resume()}},{key:"disableWebcam",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return t&&null!=t&&t.silent||this.dispatch((0,h.setVideoOff)(!0)),n.next=3,s.default.awrap(this.removeProducer('webCamProducer'));case 3:this.dispatch((0,h.setVideoProduction)(f.MediaStates.NOT_STARTED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableMic",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return t&&null!=t&&t.silent||this.dispatch((0,h.setAudioMuted)(!0)),n.next=3,s.default.awrap(this.removeProducer('micProducer'));case 3:this.dispatch((0,h.setAudioProduction)(f.MediaStates.NOT_STARTED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableScreenShare",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.NOT_STARTED)),this.dispatch((0,h.setScreenSharing)(!1)),t.next=4,s.default.awrap(this.removeProducer('screenShareVideoProducer'));case 4:return t.next=6,s.default.awrap(this.removeProducer('screenShareAudioProducer'));case 6:case"end":return t.stop()}},null,this,null,Promise)}},{key:"stopAllProducers",value:function(){this.webCamProducer&&this.removeProducer('webCamProducer'),this.screenShareVideoProducer&&this.removeProducer('screenShareVideoProducer'),this.screenShareAudioProducer&&this.removeProducer('screenShareAudioProducer'),this.micProducer&&this.removeProducer('micProducer')}},{key:"stopAllTransports",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.sendTransport){try{this.sendTransport.close()}catch(t){console.log('awaitqueue error')}this.sendTransport=null}if(this.recvTransport){try{this.recvTransport.close()}catch(t){console.log('awaitqueue error')}this.recvTransport=null}this.dispatch((0,f.setRouterFetchState)(f.MediaStates.NOT_STARTED));case 3:case"end":return t.stop()}},null,this,null,Promise)}},{key:"resetVideoProducers",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(!t){o.next=4;break}return o.next=3,s.default.awrap(this.removeProducer('webCamProducer',!1));case 3:this.shareWebcam(t);case 4:if(!n){o.next=8;break}return o.next=7,s.default.awrap(this.removeProducer('screenShareVideoProducer',!1));case 7:this.shareScreen({video:n});case 8:case"end":return o.stop()}},null,this,null,Promise)}},{key:"createProducer",value:function(t,n,o){var u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==this.sendTransport&&!this.sendTransport.closed){c.next=2;break}return c.abrupt("return");case 2:return c.next=4,s.default.awrap(this.sendTransport.produce(n));case 4:this[t]=c.sent,this[t].on('transportclose',function(){u[t]=void 0}),this[t].on('trackended',function(){u.socketObj.sendMessage({type:'closeProducer',payload:{producerId:u[t].id}}),o()});case 7:case"end":return c.stop()}},null,this,null,Promise)}},{key:"removeProducer",value:function(t){var n,o=arguments;return s.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:if(n=!(o.length>1&&void 0!==o[1])||o[1],this[t]&&!this[t].closed){u.next=3;break}return u.abrupt("return");case 3:return n&&this[t].track.stop(),this[t].close(),u.next=7,s.default.awrap(this.socketObj.sendMessage({type:'closeProducer',payload:{producerId:this[t].id}}));case 7:this[t]=null;case 8:case"end":return u.stop()}},null,this,null,Promise)}},{key:"sendMessage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'chatMessage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"getMesssages",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getChatMessages'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"getPolls",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getPolls'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"newPoll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'newPoll',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"votePoll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'votePoll',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"acceptWaitingRequest",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'acceptWaitingRequest',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"rejectWaitingRequest",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'rejectWaitingRequest',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"muteAll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteAllNew',payload:{allowUnMute:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"rejectRequestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'rejectRequestToJoinStage',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"muteAllVideo",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteAllVideo'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"pin",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'pinPeer',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableAudio",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'disableAudioPeerNew',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableVideo",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'disableVideoPeer',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"kickAll",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'kickAll'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"kick",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'kick',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"getPage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getPage',payload:{pageNum:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"setRecordingStatus",value:function(t){return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:window.triggerDyteRecording=t;case 1:case"end":return s.stop()}},null,null,null,Promise)}},{key:"muteSelf",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteSelf'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"unmuteSelf",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'unmuteSelf'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"requestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'requestToJoinStage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"acceptAllRequestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'acceptAllRequestToJoinStage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removePeerFromStage",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,s.default.awrap(this.socketObj.sendMessage({type:'removePeerFromStage',payload:{id:t,type:n}}));case 2:case"end":return o.stop()}},null,this,null,Promise)}},{key:"startPresenting",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'startPresenting'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"stopPresenting",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'stopPresenting'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"updatePreset",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,s.default.awrap(this.socketObj.sendMessage({type:'updatePeerPreset',payload:{id:t,presetName:n}}));case 2:case"end":return o.stop()}},null,this,null,Promise)}}]),t})();e.default=k},586,[1,67,22,9,10,587,582,493,487,480,505,481]); @@ -676,7 +676,7 @@ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.d __d(function(g,r,i,a,m,_e,d){var t='__lodash_hash_undefined__',e=9007199254740991,n='[object Arguments]',o='[object Boolean]',c='[object Date]',u='[object Function]',f='[object GeneratorFunction]',s='[object Map]',l='[object Number]',_='[object Object]',p='[object RegExp]',h='[object Set]',y='[object String]',v='[object Symbol]',b='[object ArrayBuffer]',j='[object DataView]',w='[object Float32Array]',O='[object Float64Array]',A='[object Int8Array]',x='[object Int16Array]',S='[object Int32Array]',P='[object Uint8Array]',$='[object Uint8ClampedArray]',k='[object Uint16Array]',E='[object Uint32Array]',I=/\w*$/,F=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,B={};B[n]=B['[object Array]']=B[b]=B[j]=B[o]=B[c]=B[w]=B[O]=B[A]=B[x]=B[S]=B[s]=B[l]=B[_]=B[p]=B[h]=B[y]=B[v]=B[P]=B[$]=B[k]=B[E]=!0,B['[object Error]']=B[u]=B["[object WeakMap]"]=!1;var U='object'==typeof g&&g&&g.Object===Object&&g,W='object'==typeof self&&self&&self.Object===Object&&self,D=U||W||Function('return this')(),R='object'==typeof _e&&_e&&!_e.nodeType&&_e,T=R&&'object'==typeof m&&m&&!m.nodeType&&m,z=T&&T.exports===R;function C(t,e){return t.set(e[0],e[1]),t}function L(t,e){return t.add(e),t}function V(t,e){for(var n=-1,o=t?t.length:0;++n-1},Ft.prototype.set=function(t,e){var n=this.__data__,o=Dt(n,t);return o<0?n.push([t,e]):n[o][1]=e,this},Mt.prototype.clear=function(){this.__data__={hash:new It,map:new(jt||Ft),string:new It}},Mt.prototype.delete=function(t){return Zt(this,t).delete(t)},Mt.prototype.get=function(t){return Zt(this,t).get(t)},Mt.prototype.has=function(t){return Zt(this,t).has(t)},Mt.prototype.set=function(t,e){return Zt(this,t).set(t,e),this},Bt.prototype.clear=function(){this.__data__=new Ft},Bt.prototype.delete=function(t){return this.__data__.delete(t)},Bt.prototype.get=function(t){return this.__data__.get(t)},Bt.prototype.has=function(t){return this.__data__.has(t)},Bt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ft){var o=n.__data__;if(!jt||o.length<199)return o.push([t,e]),this;n=this.__data__=new Mt(o)}return n.set(t,e),this};var rr=yt?Q(yt,Object):function(){return[]},er=function(t){return ut.call(t)};function nr(t){var e=t.length,n=t.constructor(e);return e&&'string'==typeof t[0]&&ct.call(t,'index')&&(n.index=t.index,n.input=t.input),n}function or(t){return'function'!=typeof t.constructor||ar(t)?{}:br(e=lt(t))?_t(e):{};var e}function cr(t,e,n,u){var f,_,F,M=t.constructor;switch(e){case b:return Gt(t);case o:case c:return new M(+t);case j:return Nt(t,u);case w:case O:case A:case x:case S:case P:case $:case k:case E:return Jt(t,u);case s:return qt(t,u,n);case l:case y:return new M(t);case p:return(F=new(_=t).constructor(_.source,I.exec(_))).lastIndex=_.lastIndex,F;case h:return Ht(t,u,n);case v:return f=t,Et?Object(Et.call(f)):{}}}function ur(t,n){return!!(n=null==n?e:n)&&('number'==typeof t||M.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=e}function br(t){var e=typeof t;return!!t&&('object'==e||'function'==e)}function dr(t){return!!t&&'object'==typeof t}function jr(t){return _r(t)?Ut(t):Lt(t)}m.exports=function(t){return Tt(t,!0,!0)}},670,[]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),c=r(d[3]),l=c.NativeModules.DyteRNBackgroundTimer,o=new c.NativeEventEmitter(l),s=new((function(){function t(){var u=this;(0,n.default)(this,t),this.uniqueId=0,this.callbacks={},o.addListener('backgroundTimer.timeout',function(t){if(u.callbacks[t]){var n=u.callbacks[t].callback;u.callbacks[t].interval?l.backgroundTimerSetTimeout(t,u.callbacks[t].timeout):delete u.callbacks[t],n()}})}return(0,u.default)(t,[{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return l.start(t)}},{key:"stop",value:function(){return l.stop()}},{key:"runBackgroundTimer",value:function(t,n){var u=this,l=c.Platform.select({ios:function(){return c.NativeAppEventEmitter},android:function(){return c.DeviceEventEmitter}})();this.start(0),this.backgroundListener=l.addListener('backgroundTimer',function(){u.backgroundListener.remove(),u.backgroundClockMethod(t,n)})}},{key:"backgroundClockMethod",value:function(t,n){var u=this;this.backgroundTimer=this.setTimeout(function(){t(),u.backgroundClockMethod(t,n)},n)}},{key:"stopBackgroundTimer",value:function(){this.stop(),this.clearTimeout(this.backgroundTimer)}},{key:"setTimeout",value:function(t,n){this.uniqueId+=1;var u=this.uniqueId;return this.callbacks[u]={callback:t,interval:!1,timeout:n},l.setTimeout(u,n),u}},{key:"clearTimeout",value:function(t){this.callbacks[t]&&delete this.callbacks[t]}},{key:"setInterval",value:function(t,n){this.uniqueId+=1;var u=this.uniqueId;return this.callbacks[u]={callback:t,interval:!0,timeout:n},l.backgroundTimerSetTimeout(u,n),u}},{key:"clearInterval",value:function(t){this.callbacks[t]&&delete this.callbacks[t]}}]),t})());e.default=s},671,[1,9,10,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.PluginServiceProvider=e.PluginServiceContext=void 0;var n=t(r(d[1])),o=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=v(n);if(o&&o.has(t))return o.get(t);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var l=c?Object.getOwnPropertyDescriptor(t,f):null;l&&(l.get||l.set)?Object.defineProperty(u,f,l):u[f]=t[f]}u.default=t,o&&o.set(t,u);return u})(r(d[2])),u=r(d[3]),c=r(d[4]),f=t(r(d[5])),l=r(d[6]);function v(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(v=function(t){return t?o:n})(t)}var p=(0,o.createContext)(null);e.PluginServiceContext=p;e.PluginServiceProvider=function(t){var v=t.children,s=t.roomName,P=t.peerId,S=(0,o.useContext)(l.WebSocketContext),y=(0,u.useDispatch)(),O=(0,o.useState)(null),b=(0,n.default)(O,2),k=b[0],j=b[1],C=(0,u.useSelector)(function(t){return t.participant.authToken});(0,o.useEffect)(function(){},[]);var w=(0,u.useSelector)(function(t){return t.room.socketState}),E={pluginManager:k};return(0,o.useEffect)(function(){if(w===c.RoomSocketState.CONNECTED){var t=new f.default(S,s,y,P,C);j(t),t.listenSocketEvents()}},[w]),o.default.createElement(p.Provider,{value:E},v)}},672,[1,41,165,432,480,673,630]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),u=t(r(d[3])),l=t(r(d[4])),o=r(d[5]),c=t(r(d[6])),f=(function(){function t(n,s,l,o,c){(0,u.default)(this,t),this.socketObj=n,this.dispatch=l,this.roomName=s,this.plugins={},this.iframes={},this.peerId=o,this.authToken=c,this.handleSockets=this.handleSockets.bind(this)}return(0,l.default)(t,[{key:"handleSockets",value:function(t){if(t)switch(t.type){case'websocket/enable-plugin':this.enablePlugin(t.payload);break;case'websocket/disable-plugin':this.disablePlugin(t.payload);break;case'websocket/plugin-event':case'websocket/plugin-data':this.sendIframeEvent(t)}}},{key:"sendIframeEvent",value:function(t){var n=this.iframes[t.payload.pluginId||t.payload.id];n&&Object.values(n).forEach(function(n){n.iframe&&n.iframe.injectJavaScript("window.postMessage("+JSON.stringify(t)+");")})}},{key:"listenSocketEvents",value:function(){this.socketObj.emitter.on('socket',this.handleSockets),this.getRoomPlugins()}},{key:"getRoomPlugins",value:function(){var t=this;this.socketObj.sendMessage({type:'getRoomState'},function(n){n.payload.roomState.plugins.forEach(function(n){return t.enablePlugin(n)})})}},{key:"enablePlugin",value:function(t){var u,l,f,h,p,v;return n.default.async(function(k){for(;;)switch(k.prev=k.next){case 0:if(u=c.default.apiBase+"/v2/plugins",!this.plugins[t.id]){k.next=3;break}return k.abrupt("return");case 3:return k.next=5,n.default.awrap(fetch(c.default.apiBase+"/v2/plugins/view/"+t.id,{method:'GET',headers:{authorization:"Bearer "+this.authToken}}));case 5:return l=k.sent,k.next=8,n.default.awrap(l.json());case 8:return f=k.sent,k.next=11,n.default.awrap(fetch(u+"/authorize/"+t.id,{method:'POST',headers:{authorization:"Bearer "+this.authToken,'Content-Type':'application/json'},body:JSON.stringify({roomName:this.roomName,peerId:this.peerId})}));case 11:return h=k.sent,k.next=14,n.default.awrap(h.json());case 14:p=k.sent.data.token,v=(0,s.default)({},f.data.plugin,{authToken:p,enabledBy:t.enabledBy,ACLAccessGrantedUsers:t.ACLAccessGrantedUsers||[],ACLAccessRemovedUsers:t.ACLAccessRemovedUsers||[]}),this.plugins[t.id]=v,this.iframes[t.id]={},this.dispatch((0,o.addPlugin)(v));case 19:case"end":return k.stop()}},null,this,null,Promise)}},{key:"disablePlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.plugins[t.id]&&(delete this.plugins[t.id],this.dispatch((0,o.removePlugin)(t)));case 1:case"end":return n.stop()}},null,this,null,Promise)}},{key:"handleIframeMessage",value:function(t){var s=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=t.type,n.next='pluginEvent'===n.t0?3:'storePluginData'===n.t0?3:'getPluginData'===n.t0?3:'getPeerInfo'===n.t0?3:'enablePluginForAll'===n.t0?3:5;break;case 3:return this.socketObj.sendMessage(t,function(t){s.sendIframeEvent(t)}),n.abrupt("break",6);case 5:return n.abrupt("break",6);case 6:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addIframeView",value:function(t,s,u){var l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&this.removeIframeView(t),l=function(t){s&&o.handleIframeMessage(t)},u.addEventListener(l),this.iframes[t.plugin][t.view]={listener:l,iframe:s};case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removeIframeView",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&delete this.iframes[t.plugin][t.view];case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addRoomPlugin",value:function(t){return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.plugins[t.id]){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,n.default.awrap(this.socketObj.sendMessage({type:'addPlugin',payload:t}));case 4:case"end":return s.stop()}},null,this,null,Promise)}},{key:"removeRoomPlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.socketObj.sendMessage({type:'removePlugin',payload:t}));case 1:case"end":return n.stop()}},null,this,null,Promise)}}]),t})();e.default=f},673,[1,67,22,9,10,503,504]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),u=t(r(d[3])),l=t(r(d[4])),o=r(d[5]),c=t(r(d[6])),f=(function(){function t(n,s,l,o,c){(0,u.default)(this,t),this.socketObj=n,this.dispatch=l,this.roomName=s,this.plugins={},this.iframes={},this.peerId=o,this.authToken=c,this.handleSockets=this.handleSockets.bind(this)}return(0,l.default)(t,[{key:"handleSockets",value:function(t){if(t)switch(t.type){case'websocket/enable-plugin':this.enablePlugin(t.payload);break;case'websocket/disable-plugin':this.disablePlugin(t.payload);break;case'websocket/plugin-event':case'websocket/plugin-data':this.sendIframeEvent(t)}}},{key:"sendIframeEvent",value:function(t){var n=this.iframes[t.payload.pluginId||t.payload.id];n&&Object.values(n).forEach(function(n){n.iframe&&n.iframe.injectJavaScript("window.postMessage("+JSON.stringify(t)+");")})}},{key:"listenSocketEvents",value:function(){this.socketObj.emitter.on('socket',this.handleSockets),this.getRoomPlugins()}},{key:"getRoomPlugins",value:function(){var t=this;this.socketObj.sendMessage({type:'getRoomState'},function(n){n.payload.roomState.plugins.forEach(function(n){return t.enablePlugin(n)})})}},{key:"enablePlugin",value:function(t){var u,l,f,h,p,v;return n.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:if(u=c.default.apiBase+"/v2/plugins",!this.plugins[t.id]){y.next=3;break}return y.abrupt("return");case 3:return y.next=5,n.default.awrap(fetch(c.default.apiBase+"/v2/plugins/view/"+t.id,{method:'GET',headers:{authorization:"Bearer "+this.authToken}}));case 5:return l=y.sent,y.next=8,n.default.awrap(l.json());case 8:return f=y.sent,y.next=11,n.default.awrap(fetch(u+"/authorize/"+t.id,{method:'POST',headers:{authorization:"Bearer "+this.authToken,'Content-Type':'application/json'},body:JSON.stringify({roomName:this.roomName,peerId:this.peerId})}));case 11:return h=y.sent,y.next=14,n.default.awrap(h.json());case 14:p=y.sent.data.token,v=(0,s.default)({},f.data.plugin,{authToken:p,enabledBy:t.enabledBy,ACLAccessGrantedUsers:t.ACLAccessGrantedUsers||[],ACLAccessRemovedUsers:t.ACLAccessRemovedUsers||[]}),this.plugins[t.id]=v,this.iframes[t.id]={},this.dispatch((0,o.addPlugin)(v));case 19:case"end":return y.stop()}},null,this,null,Promise)}},{key:"disablePlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.plugins[t.id]&&(delete this.plugins[t.id],this.dispatch((0,o.removePlugin)(t)));case 1:case"end":return n.stop()}},null,this,null,Promise)}},{key:"handleIframeMessage",value:function(t){var u,l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=t.type,n.next='pluginEvent'===n.t0?3:'storePluginData'===n.t0?3:'getPluginData'===n.t0?3:'enablePluginForAll'===n.t0?3:'getPeerInfo'===n.t0?5:7;break;case 3:return this.socketObj.sendMessage(t,function(t){o.sendIframeEvent(t)}),n.abrupt("break",8);case 5:return this.socketObj.sendMessage({type:t.type,payload:(0,s.default)({},t.payload,{peerId:null!=(u=null==(l=t.payload)?void 0:l.peerId)?u:this.peerId})},function(t){o.sendIframeEvent(t)}),n.abrupt("break",8);case 7:return n.abrupt("break",8);case 8:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addIframeView",value:function(t,s,u){var l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&this.removeIframeView(t),l=function(t){s&&o.handleIframeMessage(t)},u.addEventListener(l),this.iframes[t.plugin][t.view]={listener:l,iframe:s};case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removeIframeView",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&delete this.iframes[t.plugin][t.view];case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addRoomPlugin",value:function(t){return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.plugins[t.id]){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,n.default.awrap(this.socketObj.sendMessage({type:'addPlugin',payload:t}));case 4:case"end":return s.stop()}},null,this,null,Promise)}},{key:"removeRoomPlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.socketObj.sendMessage({type:'removePlugin',payload:t}));case 1:case"end":return n.stop()}},null,this,null,Promise)}}]),t})();e.default=f},673,[1,67,22,9,10,503,504]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.PeersServiceContext=e.PeersProvider=void 0;var t=n(r(d[1])),o=n(r(d[2])),u=n(r(d[3])),c=(function(n,t){if(!t&&n&&n.__esModule)return n;if(null===n||"object"!=typeof n&&"function"!=typeof n)return{default:n};var o=b(t);if(o&&o.has(n))return o.get(n);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in n)if("default"!==l&&Object.prototype.hasOwnProperty.call(n,l)){var s=c?Object.getOwnPropertyDescriptor(n,l):null;s&&(s.get||s.set)?Object.defineProperty(u,l,s):u[l]=n[l]}u.default=n,o&&o.set(n,u);return u})(r(d[4])),l=r(d[5]),s=r(d[6]),f=r(d[7]),p=r(d[8]),v=r(d[9]),S=r(d[10]),P=r(d[11]),h=r(d[12]),k=r(d[13]);function b(n){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(b=function(n){return n?o:t})(n)}var y=(0,c.createContext)(null);e.PeersServiceContext=y;e.PeersProvider=function(n){var b,T,M=n.children,w=(0,c.useContext)(p.ConfigServiceContext).meeting,C=(0,c.useState)([]),V=(0,u.default)(C,2),x=V[0],D=V[1],O=(0,l.useSelector)(function(n){return n.peers.joinedPeers}),A=(0,l.useSelector)(function(n){return n.participant}),j=(0,l.useSelector)(function(n){return n.consumers.activeConsumers}),I=j.find(function(n){return'video'===n.kind&&n.appData.screenShare}),_=j.find(function(n){return'audio'===n.kind&&n.appData.screenShare}),E=(0,l.useSelector)(function(n){return n.room.pinnedPeerId}),H=(0,l.useSelector)(function(n){return n.room.roomViewType}),N=(0,c.useState)(null),q=(0,u.default)(N,2),J=q[0],L=q[1],R=(0,c.useState)(null),U=(0,u.default)(R,2),W=U[0],z=U[1],B=(0,c.useContext)(f.MediaRoomContext).mediaRoom,F=(0,l.useDispatch)(),G=(0,c.useContext)(v.UserTrackContext),K=G.mediaTracks,Q=K.screenShareVideoTrack,X=K.setScreenShareVideoTrack,Y=(K.screenShareAudioTrack,K.setScreenShareAudioTrack),Z=G.inputDevices,$=Z.toggleAudioState,ee=Z.toggleVideoState,re={pin:function(n){return B.pin(n)},unpin:function(n){return B.pin(null)},toggleSelfAudio:function(){return $()},toggleSelfVideo:function(){return ee()},toggleSelfScreenSharing:function(){var n;return t.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(A.sharingScreen||I){o.next=16;break}return void 0!==Q&&Q.stop(),o.prev=2,o.next=5,t.default.awrap((0,S.getScreenShare)());case 5:n=o.sent,X(n.video),Y(n.video),B.shareScreen(n),o.next=14;break;case 11:o.prev=11,o.t0=o.catch(2),'NotAllowedError'!==(null==o.t0?void 0:o.t0.message)&&console.error(o.t0);case 14:o.next=19;break;case 16:B.disableScreenShare(),X(void 0),Y(void 0);case 19:case"end":return o.stop()}},null,null,[[2,11]],Promise)},disablePeerAudio:function(n){return B.disableAudio(n)},disablePeerVideo:function(n){return B.disableVideo(n)},updatePreset:function(n,t){return B.updatePreset(n,t)},setLabel:function(n,t){F((0,s.setPeerLabel)({id:n,label:t}))}},ne=!0;(0,c.useEffect)(function(){var n,t;L({id:null==B?void 0:B.peerid,audioMuted:A.audioMuted,displayName:A.displayName,userId:A.id,picture:A.displayImageURL,isMe:!0,isHost:A.isHost,videoVisible:!A.videoOff,videoTrack:null==B?void 0:null==(n=B.webCamProducer)?void 0:n.track,audioTrack:null==B?void 0:null==(t=B.micProducer)?void 0:t.track,isPinned:E===(null==B?void 0:B.peerid),clientSpecificId:A.clientSpecificId,producingAudio:!A.audioMuted,producingVideo:!A.videoOff,isScreensharing:A.sharingScreen,requestToJoinType:A.requestToJoinType,hiddenParticipant:A.hidden,webinarHiddenParticipant:A.webinarHiddenParticipant,metadata:A.metadata})},[null==B?void 0:B.peerid,A.sharingScreen,A.videoOff,A.audioMuted,A.displayName,A.hidden,A.requestToJoinType,A.metadata,null==B?void 0:null==(b=B.webCamProducer)?void 0:b.track,null==B?void 0:null==(T=B.micProducer)?void 0:T.track,A.webinarHiddenParticipant,E]),(0,c.useEffect)(function(){J&&w&&w._addUpdateParticipant((0,o.default)({},J,{isPinned:J.id===E,isScreensharing:A.sharingScreen}),re)},[J,w]),(0,c.useEffect)(function(){if(I||A.screenSharingProduction===P.MediaStates.LOADED){var n,t,o,u=I?null==(n=B.consumers.get(I.id))?void 0:n.track:null==(t=B.screenShareVideoProducer)?void 0:t.track,c=_?null==(o=B.consumers.get(_.id))?void 0:o.track:null,l=I?O.find(function(n){return n.id===I.appData.peerId}):J;z({videoTrack:u,id:null==l?void 0:l.id,displayName:"Screen - "+(null==l?void 0:l.displayName),videoVisible:!0,audioTrack:c,audioMuted:null===c,screenshare:!0})}else z(null)},[I,A.screenSharingProduction]),(0,c.useEffect)(function(){w&&(x.map(function(n){return O.find(function(t){return t.id===n.id})||w._removeParticipant(n),null}),D(O))},[O]);var ie=function(n){var t,u=(0,o.default)({},n,{isPinned:E===n.id,isScreensharing:!1}),c=j.find(function(t){return t.peerId===n.id&&'video'===t.kind&&!t.appData.screenShare}),l=j.find(function(t){return t.peerId===n.id&&'audio'===t.kind&&!t.appData.screenShare});return c&&(u.producingVideo=!0,u.videoTrack=B.consumers.get(c.id).track,u.videoScore=c.producerScore),l&&(u.producingAudio=!n.audioMuted,u.audioTrack=B.consumers.get(l.id).track,u.audioScore=l.producerScore),(null==I?void 0:null==(t=I.appData)?void 0:t.peerId)===n.id&&(u.isScreensharing=!0),u.videoVisible=!(void 0===c||c.remotelyPaused),u.audioMuted=void 0===l||l.remotelyPaused||n.audioMuted,u.audioMuted||(ne=!1),w&&w._addUpdateParticipant((0,o.default)({},u,{isPinned:u.id===E}),re),u},te=H===h.DyteViewTypes.webinar?O.filter(function(n){return!(null!=n&&n.webinarHiddenParticipant)&&n.requestToJoinType!==k.RequestToJoinType.ask}).map(ie).filter(function(n){return null!==n}):O.filter(function(n){return!(null!=n&&n.hiddenParticipant)}).map(ie).filter(function(n){return null!==n}),oe=O.map(ie).filter(function(n){return null!==n});return c.default.createElement(y.Provider,{value:{processedPeers:te,selfPeer:J,allMuted:ne,screenshareVideoConsumer:I,screenshareAudioConsumer:_,screenSharePeer:W,joinedProcessedPeers:oe}},M)}},674,[1,67,22,41,165,432,481,585,508,579,580,480,482,487]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.setupPermissions=e.RESULTS=e.PERMISSIONS=void 0,e.uniq=N;var E=n(r(d[1])),s=n(r(d[2])),o=r(d[3]),A=r(d[4]),O=r(d[5]),R=Object.freeze({ACCEPT_HANDOVER:'android.permission.ACCEPT_HANDOVER',ACCESS_BACKGROUND_LOCATION:'android.permission.ACCESS_BACKGROUND_LOCATION',ACCESS_COARSE_LOCATION:'android.permission.ACCESS_COARSE_LOCATION',ACCESS_FINE_LOCATION:'android.permission.ACCESS_FINE_LOCATION',ACTIVITY_RECOGNITION:'android.permission.ACTIVITY_RECOGNITION',ADD_VOICEMAIL:'com.android.voicemail.permission.ADD_VOICEMAIL',ANSWER_PHONE_CALLS:'android.permission.ANSWER_PHONE_CALLS',BODY_SENSORS:'android.permission.BODY_SENSORS',CALL_PHONE:'android.permission.CALL_PHONE',CAMERA:'android.permission.CAMERA',GET_ACCOUNTS:'android.permission.GET_ACCOUNTS',PROCESS_OUTGOING_CALLS:'android.permission.PROCESS_OUTGOING_CALLS',READ_CALENDAR:'android.permission.READ_CALENDAR',READ_CALL_LOG:'android.permission.READ_CALL_LOG',READ_CONTACTS:'android.permission.READ_CONTACTS',READ_EXTERNAL_STORAGE:'android.permission.READ_EXTERNAL_STORAGE',READ_PHONE_NUMBERS:'android.permission.READ_PHONE_NUMBERS',READ_PHONE_STATE:'android.permission.READ_PHONE_STATE',READ_SMS:'android.permission.READ_SMS',RECEIVE_MMS:'android.permission.RECEIVE_MMS',RECEIVE_SMS:'android.permission.RECEIVE_SMS',RECEIVE_WAP_PUSH:'android.permission.RECEIVE_WAP_PUSH',RECORD_AUDIO:'android.permission.RECORD_AUDIO',SEND_SMS:'android.permission.SEND_SMS',USE_SIP:'android.permission.USE_SIP',WRITE_CALENDAR:'android.permission.WRITE_CALENDAR',WRITE_CALL_LOG:'android.permission.WRITE_CALL_LOG',WRITE_CONTACTS:'android.permission.WRITE_CONTACTS',WRITE_EXTERNAL_STORAGE:'android.permission.WRITE_EXTERNAL_STORAGE',BLUETOOTH_CONNECT:"android.permission.BLUETOOTH_CONNECT"}),_=Object.freeze({APP_TRACKING_TRANSPARENCY:'ios.permission.APP_TRACKING_TRANSPARENCY',BLUETOOTH_PERIPHERAL:'ios.permission.BLUETOOTH_PERIPHERAL',CALENDARS:'ios.permission.CALENDARS',CAMERA:'ios.permission.CAMERA',CONTACTS:'ios.permission.CONTACTS',FACE_ID:'ios.permission.FACE_ID',LOCATION_ALWAYS:'ios.permission.LOCATION_ALWAYS',LOCATION_WHEN_IN_USE:'ios.permission.LOCATION_WHEN_IN_USE',MEDIA_LIBRARY:'ios.permission.MEDIA_LIBRARY',MICROPHONE:'ios.permission.MICROPHONE',MOTION:'ios.permission.MOTION',PHOTO_LIBRARY:'ios.permission.PHOTO_LIBRARY',PHOTO_LIBRARY_ADD_ONLY:'ios.permission.PHOTO_LIBRARY_ADD_ONLY',REMINDERS:'ios.permission.REMINDERS',SIRI:'ios.permission.SIRI',SPEECH_RECOGNITION:'ios.permission.SPEECH_RECOGNITION',STOREKIT:'ios.permission.STOREKIT'}),I=Object.freeze({ANDROID:R,IOS:_});e.PERMISSIONS=I;var t=Object.freeze({UNAVAILABLE:'unavailable',BLOCKED:'blocked',DENIED:'denied',GRANTED:'granted',LIMITED:'limited',PROMPTED:'prompted'});e.RESULTS=t;var S=O.NativeModules.DyteRNPermissions;function C(n){return s.default.async(function(E){for(;;)switch(E.prev=E.next){case 0:return E.abrupt("return",S.available.includes(n)?S.request(n):t.UNAVAILABLE);case 1:case"end":return E.stop()}},null,null,null,Promise)}function N(n){return n.filter(function(E,s){return null!=E&&n.indexOf(E)===s})}var T,p=['bluetooth','readExternalStorage','photos','externalStorage'],L=function(n){var E=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s={camera:I.ANDROID.CAMERA,microphone:I.ANDROID.RECORD_AUDIO,bluetooth:I.ANDROID.BLUETOOTH_CONNECT,externalStorage:I.ANDROID.WRITE_EXTERNAL_STORAGE,readExternalStorage:I.ANDROID.READ_EXTERNAL_STORAGE},o={camera:I.IOS.CAMERA,microphone:I.IOS.MICROPHONE,bluetooth:I.IOS.BLUETOOTH_PERIPHERAL,photos:I.IOS.PHOTO_LIBRARY};if(!E)return'android'===O.Platform.OS?s[n]:o[n];if('android'===O.Platform.OS){var A={};return Object.keys(s).forEach(function(n){A[s[n]]=n}),A[n]}var R={};return Object.keys(o).forEach(function(n){R[o[n]]=n}),R[n]},D=function(n){return function(E){var s={camera:o.permissionEnum.INIT,microphone:o.permissionEnum.INIT};n.forEach(function(n){var A=L(n,!0);E[n]===t.GRANTED?s[A]=o.permissionEnum.ACCEPTED:E[n]!==t.PROMPTED&&(s[A]=o.permissionEnum.DENIED)}),s.camera!==o.permissionEnum.INIT&&s.microphone!==o.permissionEnum.INIT&&T&&clearInterval(T),A.store.dispatch((0,o.setParticipantPermissions)(s))}};e.setupPermissions=function(n){var o,A,R,_,I,t,u=[];[].concat(p,(0,E.default)(n)).forEach(function(n){var E=L(n);E&&u.push(E)}),"android"===O.Platform.OS&&(T&&clearInterval(T),T=setInterval(function(){S.checkMultiplePermissions(u).then(D(u))},1e3));(o=u,s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:if('ios'!==O.Platform.OS){n.next=13;break}A={},R=N(o),_=0;case 4:if(!(_2||Math.abs(e.dy)>2)},[y]),W=n.default.useCallback(function(){var e={x:0,y:0},t=x?x():e;u.Animated.spring(X.current,{toValue:t||e,useNativeDriver:!1}).start()},[X]),q=n.default.useCallback(function(e,t){_.current=!1,k&&(k(e,t,G()),D(e,!0)),p?W():X.current.flattenOffset()},[k,p,D,W,G]),B=n.default.useCallback(function(e,t){F.current=G(),_.current=!0,p||(X.current.setOffset(Y.current),X.current.setValue({x:0,y:0}))},[G,p]),J=n.default.useCallback(function(e,t){var n=t.dx,u=t.dy,o=F.current,s=o.top,f=o.right,c=o.left,b=o.bottom,h=l(n,Number.isFinite(A)?A-c:-999999999,Number.isFinite(N)?N-f:999999999),v=l(u,Number.isFinite(I)?I-s:-999999999,Number.isFinite(T)?T-b:999999999);X.current.setValue({x:h,y:v}),w(e,t)},[N,T,A,I,w]),K=n.default.useMemo(function(){return u.PanResponder.create({onMoveShouldSetPanResponder:function(e,t){return H(t)},onMoveShouldSetPanResponderCapture:function(e,t){return H(t)},onPanResponderGrant:B,onPanResponderMove:u.Animated.event([],{listener:J,useNativeDriver:!1}),onPanResponderRelease:q})},[J,B,q,H]);n.default.useEffect(function(){var e=X.current;return p?W():e.addListener(function(e){return Y.current=e}),function(){e.removeAllListeners()}},[p]);var Q=n.default.useMemo(function(){var e=u.Dimensions.get('window');return{position:'absolute',top:0,left:0,width:e.width,height:e.height}},[]),U=n.default.useMemo(function(){var e={top:L,left:O,elevation:z,zIndex:z};return h&&(e.backgroundColor=h),s&&(e.borderRadius=c),v?(0,t.default)({},e,{alignSelf:'baseline'}):(0,t.default)({},e,{justifyContent:'center',width:c,height:c})},[v,s,h,c,O,L,z]),Z=n.default.useMemo(function(){return v||(b?n.default.createElement(u.Image,{style:{width:c,height:c},source:b}):n.default.createElement(u.Text,{style:f.text},o))},[v,b,c,o]),$=n.default.useCallback(function(e){var t=e.nativeEvent.layout,n=t.height,u=t.width;j.current={x:u,y:n}},[]),ee=n.default.useCallback(function(e){V(e),_.current||D(e,!1)},[V,D]),te=n.default.useCallback(function(){var e=u.Dimensions.get('window'),o=e.width,l=e.height;if(!(A||N||I||T))return null;var s=A||-9999,c=N?o-N:-9999,b=I||-9999,h=T?l-T:-9999;return n.default.createElement(u.View,{pointerEvents:"box-none",style:(0,t.default)({left:s,right:c,top:b,bottom:h},f.debugView)})},[N,T,A,I]);return n.default.createElement(u.View,{pointerEvents:"box-none",style:Q},P&&te(),n.default.createElement(u.Animated.View,(0,t.default)({pointerEvents:"box-none"},R,K.panHandlers,{style:X.current.getLayout()}),n.default.createElement(u.TouchableOpacity,(0,t.default)({},C,{onLayout:$,style:U,disabled:y,onPress:S,onLongPress:M,onPressIn:E,onPressOut:ee}),Z)))}s.defaultProps={renderText:'\uff0b',renderSize:36,shouldReverse:!1,disabled:!1,debug:!1,onDrag:function(){},onShortPressRelease:function(){},onDragRelease:function(){},onLongPress:function(){},onPressIn:function(){},onPressOut:function(){},onRelease:function(){},x:0,y:0,z:1},s.propTypes={renderText:o.default.string,isCircle:o.default.bool,renderSize:o.default.number,imageSource:o.default.number,renderColor:o.default.string,children:o.default.element,shouldReverse:o.default.bool,disabled:o.default.bool,debug:o.default.bool,animatedViewProps:o.default.object,touchableOpacityProps:o.default.object,onDrag:o.default.func,onShortPressRelease:o.default.func,onDragRelease:o.default.func,onLongPress:o.default.func,onPressIn:o.default.func,onPressOut:o.default.func,onRelease:o.default.func,onReverse:o.default.func,x:o.default.number,y:o.default.number,z:o.default.number,minX:o.default.number,minY:o.default.number,maxX:o.default.number,maxY:o.default.number};var f=u.StyleSheet.create({text:{color:'#fff',textAlign:'center'},test:{backgroundColor:'red'},debugView:{backgroundColor:'#ff000044',position:'absolute',borderColor:'#fced0ecc',borderWidth:4}})},706,[1,22,165,2,204]); __d(function(g,r,i,a,m,_e,d){"use strict";var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.swipeDirections=_e.default=void 0;var t=e(r(d[1])),n=e(r(d[2])),o=e(r(d[3])),s=e(r(d[4])),l=e(r(d[5])),u=e(r(d[6])),c=e(r(d[7])),f=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var u=s?Object.getOwnPropertyDescriptor(e,l):null;u&&(u.get||u.set)?Object.defineProperty(o,l,u):o[l]=e[l]}o.default=e,n&&n.set(e,o);return o})(r(d[8])),p=r(d[9]);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var S={SWIPE_UP:"SWIPE_UP",SWIPE_DOWN:"SWIPE_DOWN",SWIPE_LEFT:"SWIPE_LEFT",SWIPE_RIGHT:"SWIPE_RIGHT"};_e.swipeDirections=S;var _={velocityThreshold:.3,directionalOffsetThreshold:80,gestureIsClickThreshold:5};function P(e,t,n,o){return Math.abs(e)>t&&Math.abs(n)0?n:t:this._isValidVerticalSwipe(e)?u>0?s:o:null}},{key:"_isValidHorizontalSwipe",value:function(e){var t=e.vx,n=e.dy,o=this.swipeConfig;return P(t,o.velocityThreshold,n,o.directionalOffsetThreshold)}},{key:"_isValidVerticalSwipe",value:function(e){var t=e.vy,n=e.dx,o=this.swipeConfig;return P(t,o.velocityThreshold,n,o.directionalOffsetThreshold)}},{key:"render",value:function(){return f.default.createElement(p.View,(0,t.default)({},this.props,this._panResponder.panHandlers))}}]),I})(f.Component);_e.default=y},707,[1,22,9,10,16,12,14,17,165,2]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=y(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),p=t(r(d[8]));function y(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(y=function(t){return t?l:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var y=t.isOpen,x=t.onClose,h=t.onLeave,E=(0,l.useContext)(f.ConfigServiceContext).sessionConfig,b=(0,o.useWindowDimensions)(),v=E.theme.dimensions||b,C=(v.height,.9*v.width),w=C/2-20,j=(0,l.useContext)(c.MediaRoomContext).mediaRoom,k=(0,l.useContext)(s.ThemeContext).colors;return l.default.createElement(u.Modal,{isVisible:y,backdropOpacity:.8,backdropColor:k.secondary[800]},l.default.createElement(u.Flex,{width:C,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:p.default.large},l.default.createElement(u.Flex,{py:25},l.default.createElement(u.Text,{fontSize:28,fontWeight:"bold"},"Leave")),l.default.createElement(u.Flex,null,l.default.createElement(u.Text,{fontSize:"lg"},"Are you sure you want to leave the call?")),l.default.createElement(u.Flex,{display:"flex",py:20},l.default.createElement(u.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},l.default.createElement(u.Button,{onClick:x},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"secondary.700",height:40,width:w-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Cancel"))),l.default.createElement(u.Button,{onClick:h},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"danger.500",height:40,width:w-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Leave")))),l.default.createElement(u.Flex,null,E.permissions.kick_participant&&l.default.createElement(u.Button,{onClick:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(j.kickAll());case 2:case"end":return t.stop()}},null,null,null,Promise)}},l.default.createElement(u.Flex,{display:"flex",direction:"row",mt:15,justify:"space-around"},l.default.createElement(u.Flex,{bg:"danger.500",height:40,width:2*w,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"End Meeting"))))))))}},708,[1,67,165,2,512,585,508,514,676]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=x(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),p=t(r(d[8])),y=r(d[9]);function x(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(x=function(t){return t?l:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var x=t.isOpen,h=t.onClose,E=t.onLeave,b=(0,l.useContext)(f.ConfigServiceContext).sessionConfig,v=(0,o.useWindowDimensions)(),C=(0,y.useScale)(b.theme.dimensions||v),w=(C.height,.9*C.width),j=w/2-20,k=(0,l.useContext)(c.MediaRoomContext).mediaRoom,O=(0,l.useContext)(s.ThemeContext).colors;return l.default.createElement(u.Modal,{isVisible:x,backdropOpacity:.8,backdropColor:O.secondary[800]},l.default.createElement(u.Flex,{width:w,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:p.default.large},l.default.createElement(u.Flex,{py:25},l.default.createElement(u.Text,{fontSize:28,fontWeight:"bold"},"Leave")),l.default.createElement(u.Flex,null,l.default.createElement(u.Text,{fontSize:"lg"},"Are you sure you want to leave the call?")),l.default.createElement(u.Flex,{display:"flex",py:20},l.default.createElement(u.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},l.default.createElement(u.Button,{onClick:h},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"secondary.700",height:40,width:j-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Cancel"))),l.default.createElement(u.Button,{onClick:E},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"danger.500",height:40,width:j-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Leave")))),l.default.createElement(u.Flex,null,b.permissions.kick_participant&&l.default.createElement(u.Button,{onClick:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(k.kickAll());case 2:case"end":return t.stop()}},null,null,null,Promise)}},l.default.createElement(u.Flex,{display:"flex",direction:"row",mt:15,justify:"space-around"},l.default.createElement(u.Flex,{bg:"danger.500",height:40,width:2*j,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"End Meeting"))))))))}},708,[1,67,165,2,512,585,508,514,676,493]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=s(n);if(o&&o.has(t))return o.get(t);var l={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var f=c?Object.getOwnPropertyDescriptor(t,u):null;f&&(f.get||f.set)?Object.defineProperty(l,u,f):l[u]=t[u]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=r(d[3]),c=r(d[4]),u=r(d[5]),f=r(d[6]),p=t(r(d[7]));function s(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(s=function(t){return t?o:n})(t)}var b=function(t){var s=t.isOpen,b=t.peers,y=(0,n.useContext)(l.MediaRoomContext).mediaRoom,x=(0,c.useDispatch)(),v=(0,n.useContext)(f.ThemeContext).colors,E=function(t){x((0,u.removeWaitListPeer)({id:t})),y.rejectWaitingRequest(t)};return n.default.createElement(o.Modal,{isVisible:s,backdropOpacity:.8,backdropColor:v.secondary[800]},n.default.createElement(o.Text,{fontWeight:"bold"},"Waiting Requests"),n.default.createElement(o.Stack,{spacing:6,height:"80"},b.map(function(t){return n.default.createElement(o.Flex,{direction:"row",alignItems:"center"},n.default.createElement(p.default,{name:t.name,bgColor:v.primary[700]}),n.default.createElement(o.Flex,{marginLeft:3,flexGrow:1,alignItems:"center",paddingY:2,borderBottom:"1px solid "+v.secondary[800]},n.default.createElement(o.Text,{color:v.textPrimary[200],fontSize:"lg"},t.name),n.default.createElement(o.Flex,{marginLeft:"auto"},n.default.createElement(o.Button,{_hover:{borderColor:v.danger[500]},onClick:function(){return E(t.id)}},n.default.createElement(o.Box,{bg:"secondary.700",p:4},n.default.createElement(o.Icon,{boxSize:"16",name:"close"}))),n.default.createElement(o.Button,{_hover:{borderColor:v.danger[500]},onClick:function(){return E(t.id)}},n.default.createElement(o.Box,{bg:"primary.500",p:4},n.default.createElement(o.Icon,{boxSize:"16",name:"check"}))))))})))};e.default=b},709,[1,165,512,585,432,480,514,682]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var c=u?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(l,o,c):l[o]=e[o]}l.default=e,n&&n.set(e,l);return l})(r(d[2])),l=r(d[3]),u=r(d[4]),o=r(d[5]),c=e(r(d[6])),f=e(r(d[7])),s=r(d[8]),p=r(d[9]),E=r(d[10]),S=e(r(d[11])),b=r(d[12]),h=r(d[13]),x=r(d[14]),w=e(r(d[15])),v=r(d[16]);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}var P=n.default.memo(function(e){var y=e.title,P=(e.copyLink,e.linkCopied,e.width),C=(e.height,e.noOfParticipants,(0,l.useSelector)(function(e){return e.room.waitingState})),O=(0,n.useContext)(s.ConfigServiceContext),I=O.meeting,j=O.sessionConfig,k=(0,l.useSelector)(function(e){return e.plugin.main}),T='LANDSCAPE'===n.default.useContext(o.OrientationContext).orientation,_=(0,l.useSelector)(function(e){return e.peers.recordingPeer}),D=(0,n.useState)(!1),R=(0,t.default)(D,2),W=R[0],M=R[1],B=(0,n.useRef)(null),N=(0,n.useRef)(!1),z=(0,l.useSelector)(function(e){return e.room.roomViewType}),A=(0,l.useSelector)(function(e){return e.participant.presentingState}),V=(0,l.useSelector)(function(e){return e.participant.videoOff}),F=(0,n.useContext)(x.PeersServiceContext),G=(F.processedPeers,F.selfPeer,F.joinedProcessedPeers),L=n.default.useContext(v.DrawerContext),H=L.setDrawerExpander,q=L.setopenedTab;if((0,n.useEffect)(function(){_&&!N.current?(null==I||I.emit(I.Events.recordingStarted),N.current=!0,B.current=setInterval(function(){M(function(e){return!e})},1e3)):!_&&N.current&&(N.current=!1,null==I||I.emit(I.Events.recordingStopped),clearInterval(B.current))},[_]),(0,n.useEffect)(function(){return function(){B.current&&clearInterval(B.current)}},[]),T||k.length>0)return null;return n.default.createElement(E.Flex,{height:56,width:P,bg:"secondary.1000",justify:"center",align:"center",pt:'android'===u.Platform.OS?10:26},n.default.createElement(E.Flex,{borderRadius:c.default.medium,width:P-8,justify:"space-between",direction:"row",px:12},n.default.createElement(E.VStack,null,n.default.createElement(E.Stack,{align:"center",width:P/2},j.theme.header.elements.title?n.default.createElement(E.Text,{fontWeight:"bold"},y):null),n.default.createElement(E.Stack,{isInline:!0,spacing:2,pt:2,align:"center"},j.theme.header.elements.timer&&C!==p.WaitingState.WAITING&&n.default.createElement(f.default,null),_&&W&&n.default.createElement(E.Box,{ml:12,bg:"danger.500",pl:4,pr:6,borderRadius:4,direction:"row",alignItems:"center"},n.default.createElement(E.Icon,{boxSize:"15",name:"fiber-manual-record",fill:"white"}),n.default.createElement(E.Text,{color:"white"},"REC")))),n.default.createElement(E.HStack,{align:"flex-end",mb:2},j.theme.control_bar.elements.participants&&n.default.createElement(E.Box,{mr:28},n.default.createElement(E.Box,{position:"absolute",top:-12,zIndex:25,right:G.length+1>99?-18:-10},n.default.createElement(w.default,{number:G.length+1,color:"primary.500"})),n.default.createElement(E.Button,{onClick:function(){H(!0),q('participants')}},n.default.createElement(E.Icon,{boxSize:"24",name:"people",fill:"textPrimary.100"}))),!V&&(z!==b.DyteViewTypes.webinar||A===h.PresentingState.PRESENTING)&&n.default.createElement(S.default,null))))});_e.default=P},710,[1,41,165,432,2,575,676,711,508,480,512,712,482,487,674,713,714]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=c(n);if(u&&u.has(t))return u.get(t);var o={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in t)if("default"!==l&&Object.prototype.hasOwnProperty.call(t,l)){var s=f?Object.getOwnPropertyDescriptor(t,l):null;s&&(s.get||s.set)?Object.defineProperty(o,l,s):o[l]=t[l]}o.default=t,u&&u.set(t,o);return o})(r(d[2])),o=r(d[3]),f=r(d[4]);function c(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(c=function(t){return t?u:n})(t)}var l=function(t){return Math.trunc(t).toString().padStart(2,'0')},s=function(){var t=(0,o.useSelector)(function(t){return t.room.startedAt}),c=u.default.useRef(),s=u.default.useState(0),p=(0,n.default)(s,2),v=p[0],y=p[1],O=u.default.useRef();return(0,u.useEffect)(function(){return t&&(c.current=requestAnimationFrame(function n(){var u=((new Date).getTime()-new Date(t).getTime())/1e3;y(u),O.current=setTimeout(function(){c.current&&(c.current=requestAnimationFrame(n))},500)})),function(){clearTimeout(O.current),cancelAnimationFrame(c.current)}},[t]),u.default.createElement(f.Text,{color:"textPrimary.400"},v>=3600&&u.default.createElement(u.default.Fragment,null,l(v/3600),"h",' '),l(v%3600/60),"m",' ',l(v%60),"s")};e.default=s},711,[1,41,165,432,512]); @@ -722,13 +722,13 @@ __d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule", __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.MakeMenu=function(t){var c=t.menu;(0,n.useContext)(o.ThemeContext).colors;return n.default.createElement(l.Flex,null,c.map(function(t,o){var c=t.title,s=t.defaultValue,p=t.onChange,b=t.options;return n.default.createElement(n.default.Fragment,{key:(0,f.nanoid)()},0!==o&&n.default.createElement(l.Box,null),n.default.createElement(l.Flex,null,n.default.createElement(l.Text,{fontSize:"md",mb:10,fontWeight:"bold",color:"textPrimary.100"},c),b.map(function(t,o){var c=t.key,f=t.value,b=t.children;return n.default.createElement(l.Button,{key:""+(c+o),onClick:function(){return p(f)}},n.default.createElement(l.HStack,{justify:"space-between",p:16,mb:4,bg:"secondary.800",borderRadius:u.default.small},n.default.createElement(l.Text,{fontSize:"sm"},b),s===f?n.default.createElement(l.Icon,{name:"check",fill:"success.500"}):null))})))}))},e.StageControlButton=p;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=s(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[1])),l=r(d[2]),o=r(d[3]),u=t(r(d[4])),c=r(d[5]),f=r(d[6]);function s(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(s=function(t){return t?l:n})(t)}function p(t){var o=t.variant,u=(t.label,t.icon),f=t.disabled,s=t.onClick,p=(t.isActive,t.menu,t.badge),b=t.ariaLabel,y='LANDSCAPE'===n.default.useContext(c.OrientationContext).orientation;return n.default.createElement(l.Flex,null,''!==p&&n.default.createElement(l.Box,{className:"dyte-client-notificationBadge",bg:"primary.500",textColor:"textPrimary.100",height:4,position:"absolute",right:"2",top:"1",fontSize:"xs"},n.default.createElement("span",null,p)),n.default.createElement(l.Button,{variant:o||'controls',onClick:s,disabled:f},n.default.createElement(l.VStack,{py:10,"aria-label":b,minWidth:64,align:"center",justify:"center"},n.default.createElement(l.Box,{fontSize:"xl",transform:[{rotate:y?'90deg':'0deg'}]},u))))}p.defaultProps={disabled:!1,variant:null,menu:[],isActive:!1,badge:'',ariaLabel:''}},716,[1,165,512,514,676,575,475]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=E(n);if(o&&o.has(t))return o.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(l,c,f):l[c]=t[c]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=r(d[3]),u=r(d[4]),c=r(d[5]),f=t(r(d[6])),s=r(d[7]),p=r(d[8]),y=r(d[9]),x=r(d[10]);function E(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(E=function(t){return t?o:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var E=t.isOpen,b=t.onClose,C=(0,n.useContext)(u.ConfigServiceContext).sessionConfig,h=(0,o.useWindowDimensions)(),v=C.theme.dimensions||h,P=(v.height,.9*v.width),w=P/2-20,S=(0,n.useContext)(c.ThemeContext).colors,T=(0,s.useDispatch)(),O=(0,n.useContext)(p.MediaRoomContext).mediaRoom,j=(0,s.useSelector)(function(t){return t.participant.requestToJoinStageState});return n.default.createElement(l.Modal,{isVisible:E,backdropOpacity:.8,backdropColor:S.secondary[800]},n.default.createElement(l.Flex,{width:P,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:f.default.large},n.default.createElement(l.Flex,{py:25},n.default.createElement(l.Text,{fontSize:28,fontWeight:"bold"},"Drop")),n.default.createElement(l.Flex,null,n.default.createElement(l.Text,{fontSize:"lg"},"Do you want to stop presenting?")),n.default.createElement(l.Flex,{display:"flex",py:20},n.default.createElement(l.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},n.default.createElement(l.Button,{onClick:b},n.default.createElement(l.Flex,{borderRadius:f.default.small,bg:"secondary.700",height:40,width:w-4,alignItems:"center",justifyContent:"center"},n.default.createElement(l.Text,{fontSize:"lg"},"Cancel"))),n.default.createElement(l.Button,{onClick:function(){j===y.RequestToJoinStageState.ACCEPTED?(b(),O.removePeerFromStage(O.peerid,x.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT)):(O.stopPresenting(),T((0,y.stoppedPresenting)()),b())}},n.default.createElement(l.Flex,{borderRadius:f.default.small,bg:"danger.500",height:40,width:w-4,alignItems:"center",justifyContent:"center"},n.default.createElement(l.Text,{fontSize:"lg"},"Drop")))))))}},717,[1,165,2,512,508,514,676,432,585,487,497]); __d(function(g,r,i,a,m,e,d){var s,n,o;Object.defineProperty(e,"__esModule",{value:!0}),e.SessionProducerAccessType=e.SessionJoiningRestriction=e.MessageTypes=void 0,e.SessionJoiningRestriction=s,(function(s){s[s.NO_VIDEO=0]="NO_VIDEO",s[s.NO_MIC=1]="NO_MIC"})(s||(e.SessionJoiningRestriction=s={})),e.SessionProducerAccessType=n,(function(s){s[s.NOT_ALLOWED=0]="NOT_ALLOWED",s[s.REQUEST_FIRST=1]="REQUEST_FIRST",s[s.ALLOWED=2]="ALLOWED"})(n||(e.SessionProducerAccessType=n={})),e.MessageTypes=o,(function(s){s[s.text=0]="text",s[s.image=1]="image",s[s.file=2]="file",s[s.poll=3]="poll"})(o||(e.MessageTypes=o={}))},718,[]); -__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=E(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(o,f,c):o[f]=t[f]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),f=t(r(d[5])),c=r(d[6]),s=r(d[7]),m=t(r(d[8])),p=t(r(d[9])),x=r(d[10]),b=r(d[11]),y=r(d[12]);function E(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(E=function(t){return t?l:n})(t)}var C=function(t){var E=t.options,C=t.unReadChatMessages,h=t.unSeenPolls,w=t.webinarUnseenRequest,v=(0,l.useRef)(null),k=(0,l.useContext)(c.ConfigServiceContext),P=(k.meeting,k.sessionConfig),j=(0,l.useContext)(u.ThemeContext).colors,S=(0,o.useWindowDimensions)(),B=P.theme.dimensions||S,O=B.height,M=B.width,R=l.default.useContext(y.DrawerContext),z=R.drawerExpanded,D=R.setDrawerExpander,T=R.openedTab,_=R.setopenedTab,I=function(){_(null),D(!1)};(0,l.useEffect)(function(){var t;z&&v&&(null==(t=v.current)||t.setModalVisible())},[z]);var W=function(){return _(null),D(!1),!0},A='LANDSCAPE'===l.default.useContext(x.OrientationContext).orientation,F=E.findIndex(function(t){return t.id===T}),q=F>-1?F:null;if(z&&q&&E[q].mainComponent)return l.default.createElement(o.Modal,{visible:!0,onRequestClose:W},l.default.createElement(s.Flex,{width:M,height:O,bg:"secondary.1000",direction:"row",flexWrap:"wrap",justify:"space-between"},l.default.createElement(p.default,{heading:E[q].label,onBackButtonClick:W}),l.default.createElement(s.Box,{width:M},E[q].mainComponent)));var H=A?24:8;return l.default.createElement(n.default,{containerStyle:{backgroundColor:j.secondary[900],justifyContent:'space-between'},overlayColor:"#000",ref:v,extraScroll:1,onClose:I,gestureEnabled:!0},null===q?l.default.createElement(s.VStack,{px:"6",py:"10",mx:H,borderRadius:m.default.medium,bg:"secondary.800",mb:12},E.map(function(t,n){var o=t.label,u=t.icon,c=t.disabled,p=t.id;return l.default.createElement(s.Button,{key:(0,b.nanoid)(),onClick:void 0!==E[n].onClick?E[n].onClick:function(){return _(p)},disabled:c},l.default.createElement(s.HStack,{p:12,px:16,borderRadius:m.default.small,align:"center",justify:"space-between"},l.default.createElement(s.Text,{fontSize:"xs",marginTop:"5px",textAlign:"center",color:c?'textPrimary.400':'textPrimary.200'},o),l.default.createElement(s.Box,{fontSize:"xl"},C&&C.length>0&&'Chat'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:C.length})),h&&h.length>0&&'Polls'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:h.length})),'Participants'===o&&w&&w.length>0&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:w.length})),'string'==typeof u?l.default.createElement(s.Icon,{name:u,boxSize:"26",fill:c?'textPrimary.400':'textPrimary.200'}):u)))})):l.default.createElement(s.Flex,{px:"6",py:"10",mx:4,borderRadius:m.default.medium,bg:"secondary.900",mb:12,mt:16},E[q].drawerComponent),(null!==q||!A)&&l.default.createElement(s.Flex,{mx:H,mb:8},l.default.createElement(s.Button,{onClick:null!==q?function(){return _(null)}:function(){return I()},width:M},l.default.createElement(s.HStack,{p:16,borderRadius:m.default.small,justify:"center",bg:"secondary.800"},l.default.createElement(s.Text,{ml:-4,color:"danger.500"},"Back",null===q&&' to Meeting')))))};e.default=C},719,[1,720,165,2,514,713,508,512,676,724,575,475,714]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=C(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(o,f,c):o[f]=t[f]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),f=t(r(d[5])),c=r(d[6]),s=r(d[7]),m=t(r(d[8])),p=t(r(d[9])),x=r(d[10]),b=r(d[11]),y=r(d[12]),E=r(d[13]);function C(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(C=function(t){return t?l:n})(t)}var h=function(t){var C=t.options,h=t.unReadChatMessages,w=t.unSeenPolls,v=t.webinarUnseenRequest,k=(0,l.useRef)(null),P=(0,l.useContext)(c.ConfigServiceContext),S=(P.meeting,P.sessionConfig),j=(0,l.useContext)(u.ThemeContext).colors,B=(0,o.useWindowDimensions)(),O=(0,E.useScale)(S.theme.dimensions||B),M=O.height,R=O.width,z=l.default.useContext(y.DrawerContext),D=z.drawerExpanded,T=z.setDrawerExpander,_=z.openedTab,I=z.setopenedTab,W=function(){I(null),T(!1)};(0,l.useEffect)(function(){var t;D&&k&&(null==(t=k.current)||t.setModalVisible())},[D]);var A=function(){return I(null),T(!1),!0},F='LANDSCAPE'===l.default.useContext(x.OrientationContext).orientation,q=C.findIndex(function(t){return t.id===_}),H=q>-1?q:null;if(D&&H&&C[H].mainComponent)return l.default.createElement(o.Modal,{visible:!0,onRequestClose:A},l.default.createElement(s.Flex,{width:R,height:M,bg:"secondary.1000",direction:"row",flexWrap:"wrap",justify:"space-between"},l.default.createElement(p.default,{heading:C[H].label,onBackButtonClick:A}),l.default.createElement(s.Box,{width:R},C[H].mainComponent)));var V=F?24:8;return l.default.createElement(n.default,{containerStyle:{backgroundColor:j.secondary[900],justifyContent:'space-between'},overlayColor:"#000",ref:k,extraScroll:1,onClose:W,gestureEnabled:!0},null===H?l.default.createElement(s.VStack,{px:"6",py:"10",mx:V,borderRadius:m.default.medium,bg:"secondary.800",mb:12},C.map(function(t,n){var o=t.label,u=t.icon,c=t.disabled,p=t.id;return l.default.createElement(s.Button,{key:(0,b.nanoid)(),onClick:void 0!==C[n].onClick?C[n].onClick:function(){return I(p)},disabled:c},l.default.createElement(s.HStack,{p:12,px:16,borderRadius:m.default.small,align:"center",justify:"space-between"},l.default.createElement(s.Text,{fontSize:"xs",marginTop:"5px",textAlign:"center",color:c?'textPrimary.400':'textPrimary.200'},o),l.default.createElement(s.Box,{fontSize:"xl"},h&&h.length>0&&'Chat'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:h.length})),w&&w.length>0&&'Polls'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:w.length})),'Participants'===o&&v&&v.length>0&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:v.length})),'string'==typeof u?l.default.createElement(s.Icon,{name:u,boxSize:"26",fill:c?'textPrimary.400':'textPrimary.200'}):u)))})):l.default.createElement(s.Flex,{px:"6",py:"10",mx:4,borderRadius:m.default.medium,bg:"secondary.900",mb:12,mt:16},C[H].drawerComponent),(null!==H||!F)&&l.default.createElement(s.Flex,{mx:V,mb:8},l.default.createElement(s.Button,{onClick:null!==H?function(){return I(null)}:function(){return W()},width:R},l.default.createElement(s.HStack,{p:16,borderRadius:m.default.small,justify:"center",bg:"secondary.800"},l.default.createElement(s.Text,{ml:-4,color:"danger.500"},"Back",null===H&&' to Meeting')))))};e.default=h},719,[1,720,165,2,514,713,508,512,676,724,575,475,714,493]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1])).default;e.default=u},720,[1,721]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),o=e(r(d[2])),n=e(r(d[3])),l=e(r(d[4])),s=e(r(d[5])),c=e(r(d[6])),u=e(r(d[7])),f=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=y(t);if(o&&o.has(e))return o.get(e);var n={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=l?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(n,s,c):n[s]=e[s]}n.default=e,o&&o.set(e,n);return n})(r(d[8])),p=r(d[9]),h=r(d[10]),v=r(d[11]);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(y=function(e){return e?o:t})(e)}function S(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var b=0,w=["dummy"],T="android"===p.Platform.OS&&p.StatusBar.currentHeight||0,k=p.Dimensions.get("window").height,_=(function(e){(0,s.default)(P,e);var y,_,O=(y=P,_=S(),function(){var e,t=(0,u.default)(y);if(_){var o=(0,u.default)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return(0,c.default)(this,e)});function P(e){var l,s;return(0,n.default)(this,P),(s=O.call(this,e)).actionSheetHeight=0,s.prevScroll=0,s.timeout=null,s.offsetY=0,s.currentOffsetFromBottom=0,s.scrollAnimationEndValue=0,s.hasBounced=!1,s.layoutHasCalled=!1,s.isClosing=!1,s.isRecoiling=!1,s.isReachedTop=!1,s.deviceLayoutCalled=!1,s.transformValue=new p.Animated.Value(0),s.opacityValue=new p.Animated.Value(0),s.borderRadius=new p.Animated.Value(10),s.underlayTranslateY=new p.Animated.Value(100),s.underlayScale=new p.Animated.Value(1),s.initialScrolling=!1,s.keyboardShowSubscription=null,s.KeyboardHideSubscription=null,s.snapToOffset=function(e){var t=.15*s.state.deviceHeight,o=s.props.extraScroll||0,n=(s.props.gestureEnabled,e+t+o);s.currentOffsetFromBottom=n/s.actionSheetHeight,s.currentOffsetFromBottom=s.currentOffsetFromBottom-.15,setTimeout(function(){s._scrollTo(n),s.updateActionSheetPosition(n)},500)},s.show=function(){s.setModalVisible(!0)},s.hide=function(){s.setModalVisible(!1)},s.setModalVisible=function(e){var t=s.state.modalVisible;if(s.initialScrolling=!1,void 0!==e){if(t===e)return;t=!e}t?s._hideModal():s.setState({modalVisible:!0,scrollable:s.props.gestureEnabled||!1})},s._hideModal=function(){s.isClosing||(s.isClosing=!0,s._hideAnimation())},s.measure=function(){return t.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){setTimeout(function(){var t;s.safeAreaViewRef.current?null==(t=s.safeAreaViewRef.current)||t.measure(function(t,o,n,l){T=0===l?25:l,T=!s.props.drawUnderStatusBar&&T>30?T-12:T,e(T)}):e(T=25)},50)}));case 1:case"end":return e.stop()}},null,null,null,Promise)},s._showModal=function(e){var o,n,l,c,u,f;return t.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(o=s.props,n=o.gestureEnabled,l=o.delayActionSheetDraw,c=o.delayActionSheetDrawTime,null!=e&&e.nativeEvent){h.next=3;break}return h.abrupt("return");case 3:if(u=e.nativeEvent.layout.height,!s.layoutHasCalled){h.next=10;break}return s.actionSheetHeight=u,s._returnToPrevScrollPosition(u),h.abrupt("return");case 10:if(s.initialScrolling=!0,s.layoutHasCalled=!0,s.actionSheetHeight=u,f=s.getInitialScrollPosition(),s.isRecoiling=!1,"ios"!==p.Platform.OS){h.next=20;break}return h.next=18,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 18:h.next=23;break;case 20:if(!l){h.next=23;break}return h.next=23,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 23:if(s._scrollTo(f,!1),s.prevScroll=f,"ios"!==p.Platform.OS){h.next=30;break}return h.next=28,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 28:h.next=33;break;case 30:if(!l){h.next=33;break}return h.next=33,t.default.awrap((0,v.waitAsync)((null!=c?c:0)/2));case 33:s._openAnimation(f),s.underlayScale.setValue(1),s.underlayTranslateY.setValue(100),n||s.props.onPositionChanged&&s.props.onPositionChanged(!0),s.updateActionSheetPosition(f);case 38:case"end":return h.stop()}},null,null,null,Promise)},s._openAnimation=function(e){var t=s.props,o=t.bounciness,n=t.bounceOnOpen,l=t.animated,c=t.openAnimationSpeed;l?(s.transformValue.setValue(e),p.Animated.parallel([p.Animated.spring(s.transformValue,{toValue:0,bounciness:n?o:1,speed:c,useNativeDriver:!0}),p.Animated.timing(s.opacityValue,{toValue:1,duration:150,useNativeDriver:!0})]).start()):s.opacityValue.setValue(1)},s._onScrollBegin=function(e){return t.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},null,null,null,Promise)},s._onScrollBeginDrag=function(e){var o;return t.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:o=e.nativeEvent.contentOffset.y,s.prevScroll=o;case 2:case"end":return t.stop()}},null,null,null,Promise)},s._onScrollEnd=function(e){var o,n,l,c,u,f,p,h;return t.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:if(o=s.props,n=o.springOffset,l=o.extraScroll,c=e.nativeEvent.contentOffset.y,u=.15*s.state.deviceHeight,!s.isRecoiling){y.next=5;break}return y.abrupt("return");case 5:if(!(s.prevScroll.75*(null!=n?n:100)||s.initialScrolling)){y.next=19;break}return s.isRecoiling=!0,s._applyHeightLimiter(),s.currentOffsetFromBottom=s.currentOffsetFromBottom<(null!=(f=s.props.initialOffsetFromBottom)?f:1)&&null!=(p=s.props.initialOffsetFromBottom)?p:1,h=s.actionSheetHeight*s.currentOffsetFromBottom+u+(null!=l?l:100),s.initialScrolling&&(s.initialScrolling=!1,h=s.prevScroll),s._scrollTo(h),y.next=15,t.default.awrap((0,v.waitAsync)(300));case 15:s.isRecoiling=!1,s.props.onPositionChanged&&s.props.onPositionChanged(!0),y.next=20;break;case 19:s._returnToPrevScrollPosition(s.actionSheetHeight);case 20:y.next=33;break;case 22:if(!(s.prevScroll-c>(null!=n?n:100))){y.next=26;break}s._hideModal(),y.next=33;break;case 26:if(!s.isRecoiling){y.next=28;break}return y.abrupt("return");case 28:return s.isRecoiling=!0,s._returnToPrevScrollPosition(s.actionSheetHeight),y.next=32,t.default.awrap((0,v.waitAsync)(300));case 32:s.isRecoiling=!1;case 33:case"end":return y.stop()}},null,null,null,Promise)},s._scrollTo=function(e){var t,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s.scrollAnimationEndValue=e,s.prevScroll=e,null==(t=s.scrollViewRef.current)||t._listRef._scrollRef.scrollTo({x:0,y:s.scrollAnimationEndValue,animated:o}),s.initialScrolling&&setTimeout(function(){s.initialScrolling=!1},500)},s._onTouchMove=function(){s.props.closeOnTouchBackdrop&&s._hideModal(),s.setState({scrollable:!1})},s._onTouchStart=function(){s.props.closeOnTouchBackdrop&&s._hideModal(),s.setState({scrollable:!1})},s._onTouchEnd=function(){s._returnToPrevScrollPosition(s.actionSheetHeight),s.props.gestureEnabled&&s.setState({scrollable:!0})},s._onScroll=function(e){s.offsetY=e.nativeEvent.contentOffset.y;var t=.15*s.state.deviceHeight,o=s.actionSheetHeight+t-s.offsetY;if(s.actionSheetHeight=s.state.deviceHeight-1)if(os.prevScroll)){t.next=2;break}return t.abrupt("return");case 2:s.prevScroll-(null!=(e=s.props.springOffset)?e:100)>s.offsetY?(o=s.getInitialScrollPosition(),s.offsetY>o-100?(s.isRecoiling=!0,s._scrollTo(o),s.currentOffsetFromBottom=null!=(n=s.props.initialOffsetFromBottom)?n:1,s.prevScroll=o,setTimeout(function(){s.isRecoiling=!1},500)):s._hideModal()):(s.isRecoiling=!0,s._scrollTo(s.prevScroll,!0),setTimeout(function(){s.isRecoiling=!1},500));case 3:case"end":return t.stop()}},null,null,null,Promise)},s._onDeviceLayout=function(e){var n;return t.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:n=(0,o.default)({},e),s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(function(){var e,o,l,c,u,f;return t.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=0,"ios"!==p.Platform.OS){h.next=7;break}return h.next=4,t.default.awrap(s.measure());case 4:h.t0=h.sent,h.next=8;break;case 7:h.t0=p.StatusBar.currentHeight;case 8:if(c=h.t0,s.props.drawUnderStatusBar){h.next=16;break}if("android"!==p.Platform.OS||s.props.statusBarTranslucent){h.next=12;break}return h.abrupt("return");case 12:l=null!=c?c:0,c&&s.indicatorTranslateY.setValue(-c),h.next=17;break;case 16:s.updateActionSheetPosition(s.offsetY);case 17:if(u=n.nativeEvent.layout.height-l,f=p.Dimensions.get("window").width,(null==u?void 0:u.toFixed(0))!==(null==(e=k)?void 0:e.toFixed(0))||(null==f?void 0:f.toFixed(0))!==(null==(o=s.state.deviceWidth)?void 0:o.toFixed(0))||!s.deviceLayoutCalled){h.next=21;break}return h.abrupt("return");case 21:s.deviceLayoutCalled=!0,k=u,s.setState({deviceHeight:u,deviceWidth:f,portrait:u>f,paddingTop:null!=c?c:0});case 24:case"end":return h.stop()}},null,null,null,Promise)},1);case 3:case"end":return l.stop()}},null,null,null,Promise)},s._keyExtractor=function(e){return e},s.state={modalVisible:!1,scrollable:!1,layoutHasCalled:!1,keyboard:!1,deviceHeight:k||(0,v.getDeviceHeight)(s.props.statusBarTranslucent),deviceWidth:p.Dimensions.get("window").width,portrait:!0,safeAreaInnerHeight:b,paddingTop:T,keyboardPadding:0},s.scrollViewRef=(0,f.createRef)(),s.safeAreaViewRef=(0,f.createRef)(),s.currentOffsetFromBottom=null!=(l=s.props.initialOffsetFromBottom)?l:1,s.indicatorTranslateY=new p.Animated.Value(0|-s.state.paddingTop),s}return(0,l.default)(P,[{key:"_hideAnimation",value:function(){var e=this,t=this.props,o=t.animated,n=t.closeAnimationDuration,l=t.bottomOffset,s=t.initialOffsetFromBottom,c=t.extraScroll,u=t.closable;p.Animated.parallel([p.Animated.timing(this.opacityValue,{toValue:u?0:1,duration:o?n:1,useNativeDriver:!0}),p.Animated.timing(this.transformValue,{toValue:u?2*this.actionSheetHeight:0,duration:o?n:1,useNativeDriver:!0})]).start(),(0,v.waitAsync)((null!=n?n:300)/1.5).then(function(){u?(e._scrollTo(0,!1),e.currentOffsetFromBottom=null!=s?s:1,e.setState({modalVisible:!u},function(){e.isClosing=!1,e.isReachedTop=!1,e.props.onPositionChanged&&e.props.onPositionChanged(!1),e.indicatorTranslateY.setValue(-e.state.paddingTop),e.layoutHasCalled=!1,e.deviceLayoutCalled=!1,e.props.onClose&&e.props.onClose()})):(l&&l>0?e.snapToOffset(l):(e._scrollTo(e.actionSheetHeight*(null!=s?s:1)+.1*e.state.deviceHeight+(null!=c?c:0),!0),e.currentOffsetFromBottom=null!=s?s:1),e.isClosing=!1)})}},{key:"_applyHeightLimiter",value:function(){this.actionSheetHeight>this.state.deviceHeight&&(this.actionSheetHeight=1*(this.actionSheetHeight-(this.actionSheetHeight-this.state.deviceHeight)))}},{key:"updateActionSheetPosition",value:function(e){if(this.actionSheetHeight>=this.state.deviceHeight-1){var t=.15*this.state.deviceHeight;if(this.actionSheetHeight+t-e0&&B((0,M.markMessagesRead)((t={},(0,l.default)(t,v.MessageTypes.text,!0),(0,l.default)(t,v.MessageTypes.file,!0),(0,l.default)(t,v.MessageTypes.image,!0),(0,l.default)(t,v.MessageTypes.poll,!0),t)))},[se]);var me=function(){if(''!==$){var t={message:$,userId:D.userId,displayName:D.displayName,type:v.MessageTypes.text,time:(new Date).getTime()};Y.sendMessage(t),q('')}},pe=function(t,n,l){var o={displayName:D.displayName,type:v.MessageTypes.file,link:t,userId:D.id,name:n,size:l};Y.sendMessage(o)},ge=function(t){var l,o;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,n.default.awrap(fetch(t));case 2:return l=u.sent,u.next=5,n.default.awrap(l.blob());case 5:return o=u.sent,u.abrupt("return",o);case 7:case"end":return u.stop()}},null,null,null,Promise)};function ye(t,l,o){var u;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.default.awrap(ge(o));case 2:return u=s.sent,s.next=5,n.default.awrap(fetch(l,{method:'PUT',headers:{'Content-Type':t.type},body:u}));case 5:case"end":return s.stop()}},null,null,null,Promise)}function xe(t){var l,o,u,s,c;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return l=O.default.apiBase+"/v1/meetings/genPreSignedUploadUrl",f.next=3,n.default.awrap(fetch(l,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({roomName:ue,filename:t.name})}));case 3:return o=f.sent,f.next=6,n.default.awrap(o.json());case 6:return u=f.sent.data,s=u.getLocation,c=u.putLocation,f.abrupt("return",{getURL:s,putURL:c});case 10:case"end":return f.stop()}},null,null,null,Promise)}var he=function(t){f.Alert.alert('Error',"Error: "+(t||'Problem uploading image'),[{text:'OK'}]),ae(!1)},be=function(){try{te||(ae(!0),X(!1),(0,P.launchImageLibrary)({mediaType:'photo'},function(t){var l,o,u,s,c,m,p,y,x;return n.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=t.uri,o=t.didCancel,u=t.errorCode,s=t.errorMessage,c=t.fileName,m=t.type,p=t.fileSize,!o){h.next=5;break}ae(!1),h.next=19;break;case 5:if(!u){h.next=10;break}console.log('Error Uploading Image:',u,s),he(s),h.next=19;break;case 10:return y={name:c,type:m,uri:l},p>5e6&&f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),h.next=14,n.default.awrap(xe(y));case 14:return x=h.sent,h.next=17,n.default.awrap(ye(y,x.putURL,y.uri));case 17:b=x.getURL,w={displayName:D.displayName,type:v.MessageTypes.image,link:b,userId:D.id},Y.sendMessage(w),ae(!1);case 19:case"end":return h.stop()}var b,w},null,null,null,Promise)}))}catch(t){console.log('Error Uploading Image:',t),he()}},ve=function(){var t,l,o,u,s,c;return n.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:if(te){m.next=24;break}return ae(!0),X(!1),m.prev=3,m.next=6,n.default.awrap(C.default.pick({type:[C.default.types.allFiles]}));case 6:if(t=m.sent,l=t.uri,o=t.name,u=t.size,s={displayName:D.displayName,type:v.MessageTypes.file,link:l,userId:D.id,name:o,size:u},!(u>5e6)){m.next=12;break}return f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),m.abrupt("return");case 12:return m.next=14,n.default.awrap(xe(s));case 14:return c=m.sent,m.next=17,n.default.awrap(ye(s,c.putURL,s.link));case 17:pe(c.getURL,o,u),ae(!1),m.next=24;break;case 21:m.prev=21,m.t0=m.catch(3),C.default.isCancel(m.t0)?ae(!1):he();case 24:case"end":return m.stop()}},null,null,[[3,21]],Promise)};return c.default.createElement(m.Flex,{height:V-50,align:"center",width:H},c.default.createElement(k.default,null,c.default.createElement(y.GiftedChat,{messagesContainerStyle:{paddingTop:60},messages:le,alwaysShowSend:!0,renderAvatarOnTop:!0,renderUsernameOnMessage:!0,isKeyboardInternallyHandled:!1,timeTextStyle:{left:{color:L.textPrimary[400]},right:{color:L.textPrimary[400]}},renderAvatar:function(t){return c.default.createElement(x.default,{name:t.currentMessage.user.name,bgColor:L.primary[700]})},renderBubble:function(t){var n=t.currentMessage;return n.type,n.link,n.text,c.default.createElement(y.Bubble,(0,o.default)({},t,{wrapperStyle:{left:{backgroundColor:L.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3},right:{backgroundColor:L.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3}},textStyle:{left:{color:L.textPrimary[100]},right:{color:L.textPrimary[100]}}}))},renderInputToolbar:function(t){return z&&c.default.createElement(m.Flex,{width:ce?H-60:H-20,direction:"row",justify:"space-between",align:"center",bg:"secondary.800",borderRadius:"50px",height:50},c.default.createElement(m.Box,null,c.default.createElement(m.Button,{onClick:function(){X(!Q)}},c.default.createElement(m.Box,(0,m.mergeStyles)(N.touchableIcons,{ml:8}),Q?c.default.createElement(m.Icon,{name:"close",fill:"textPrimary.100",boxSize:"sm"}):c.default.createElement(m.Icon,{name:"plus-thick",fill:"textPrimary.100",boxSize:"sm"}))),Q&&c.default.createElement(R,null,c.default.createElement(m.Button,{onClick:be},c.default.createElement(m.Box,N.attachementButtons,c.default.createElement(m.Icon,{name:"image",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:8}," Images"))),c.default.createElement(m.Button,{onClick:ve},c.default.createElement(m.Box,(0,m.mergeStyles)(N.attachementButtons,{width:'ios'===f.Platform.OS?150:120}),c.default.createElement(m.Icon,{name:"attach-file",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:'ios'===f.Platform.OS?8:0},' ',"Attachments"))))),c.default.createElement(f.TextInput,{style:{color:L.textPrimary[300],paddingHorizontal:5,height:40,width:ce?H-160:H-120},onChangeText:q,value:$}),c.default.createElement(m.Button,{onClick:me,height:40,width:40},c.default.createElement(m.Box,(0,m.mergeStyles)(N.touchableIcons,{backgroundColor:'primary.500',mr:8}),c.default.createElement(m.Icon,{name:"send",fill:"textPrimary.100",boxSize:"md"}))))},user:{_id:D.userId,name:D.displayName}})))};e.default=U},725,[1,67,261,22,49,41,165,2,512,508,726,682,514,432,718,674,585,790,791,465,480,792,676,575,504]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=p(n);if(o&&o.has(t))return o.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(l,f,c):l[f]=t[f]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=t(r(d[3])),u=r(d[4]),f=r(d[5]),c=r(d[6]),s=r(d[7]);function p(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(p=function(t){return t?o:n})(t)}var b=function(t){var p=t.onBackButtonClick,b=t.heading,h=(0,n.useContext)(f.ConfigServiceContext).sessionConfig,x=(0,n.useContext)(u.ThemeContext).colors,v=(0,c.useWindowDimensions)(),w=useScale(h.theme.dimensions||v),y=(w.height,w.width),C='LANDSCAPE'===n.default.useContext(s.OrientationContext).orientation;return n.default.createElement(o.Box,{position:"absolute",zIndex:10,pt:'ios'!==c.Platform.OS||C?3:42,bg:"secondary.1000",width:y},n.default.createElement(o.HStack,null,n.default.createElement(o.Box,{width:y/3},n.default.createElement(o.Button,{onClick:p},n.default.createElement(o.HStack,{border:"1px solid "+x.danger[500],borderRadius:l.default.small,left:20,p:8,width:80},n.default.createElement(o.Icon,{name:"arrow-back",fill:"danger.500"}),n.default.createElement(o.Text,{ml:4,mr:4,color:"danger.500"},"Back")))),n.default.createElement(o.Flex,{width:y/3,align:"center",p:8},n.default.createElement(o.Text,{fontSize:16,fontWeight:"bold",mb:10},' ',b))))};e.default=b},724,[1,165,512,676,514,508,2,575]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=t(r(d[2])),o=t(r(d[3])),u=t(r(d[4])),s=t(r(d[5])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=N(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var c=u?Object.getOwnPropertyDescriptor(t,s):null;c&&(c.get||c.set)?Object.defineProperty(o,s,c):o[s]=t[s]}o.default=t,l&&l.set(t,o);return o})(r(d[6])),f=r(d[7]),m=r(d[8]),p=r(d[9]),y=r(d[10]),x=t(r(d[11])),h=r(d[12]),b=r(d[13]),v=r(d[14]),w=r(d[15]),E=r(d[16]),P=r(d[17]),S=t(r(d[18])),C=r(d[19]),M=r(d[20]),k=t(r(d[21])),T=t(r(d[22])),I=r(d[23]),O=t(r(d[24])),B=r(d[25]);function N(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(N=function(t){return t?l:n})(t)}var R={attachementButtons:{display:'flex',flexDirection:'row',backgroundColor:'secondary.700',marginTop:20,marginRight:5,width:100,height:35,alignItems:'center',justifyContent:'center',borderRadius:30},touchableIcons:{backgroundColor:'secondary.700',borderRadius:15,width:30,height:30,align:'center',justify:'center',mt:8,mb:8},attachemenetView:{position:'absolute',top:'ios'===f.Platform.OS?-130:-15,left:'ios'===f.Platform.OS?8:48,direction:'ios'===f.Platform.OS?'column':'row'}},U=function(t){var n=t.children;return'ios'===f.Platform.OS?c.default.createElement(m.Box,R.attachemenetView,n):c.default.createElement(m.Flex,R.attachemenetView,n)},j=function(t){var N=(0,b.useDispatch)(),j=(0,c.useContext)(p.ConfigServiceContext),z=(j.meeting,j.sessionConfig),L=z.permissions.chat.public.can_send,_=(0,c.useContext)(h.ThemeContext).colors,A=(0,f.useWindowDimensions)(),D=(0,b.useSelector)(function(t){return t.room.chatMessages}),F=(0,c.useContext)(w.PeersServiceContext).selfPeer,V=(0,B.useScale)(z.theme.dimensions||A),H=V.height,K=V.width,W=c.default.useState(''),$=(0,s.default)(W,2),q=$[0],G=$[1],J=c.default.useState(!1),Q=(0,s.default)(J,2),X=Q[0],Y=Q[1],Z=(0,c.useContext)(E.MediaRoomContext).mediaRoom,ee=c.default.useState(!1),te=(0,s.default)(ee,2),ae=te[0],re=te[1],ne=(0,c.useState)([]),le=(0,s.default)(ne,2),oe=le[0],ue=le[1],ie=(0,b.useSelector)(function(t){return t.room.roomName}),se=(0,b.useSelector)(function(t){return t.room.polls}),de=D.filter(function(t){return!0!==t.read}),ce=(0,C.useMutation)("\n mutation($file: Upload!, $roomName: String!) {\n uploadFile(file: $file, roomName: $roomName) {\n link\n }\n }\n"),fe=((0,s.default)(ce,1)[0],'LANDSCAPE'===c.default.useContext(I.OrientationContext).orientation);function me(t,n,l){Z.votePoll({index:l,pollId:t})}(0,c.useEffect)(function(){var t=(0,u.default)(D);ue(t.reverse().map(function(t){var n={type:t.type,createdAt:t.time,_id:Math.round(1e6*Math.random()),user:{_id:t.userId,name:t.displayName}};if(t.type===v.MessageTypes.text)return(0,o.default)({},n,{text:t.message});if(t.type===v.MessageTypes.image)return(0,o.default)({},n,{image:t.link});if(t.type===v.MessageTypes.file)return(0,o.default)({},n,{text:t.name,link:t.link});if(t.type===v.MessageTypes.poll){var l=t.pollId,u=se[l],s=u.options,c=u.question,f=F.userId;return(0,o.default)({},n,{text:c,polls:{pollId:l,options:s.map(function(t){return t.votes.find(function(t){return t.id===f})?(0,o.default)({},t,{selected:!0}):(0,o.default)({},t,{selected:!1})}),onOptionSelected:me}})}return{}}))},[D,se]),(0,c.useEffect)(function(){var t;de.length>0&&N((0,M.markMessagesRead)((t={},(0,l.default)(t,v.MessageTypes.text,!0),(0,l.default)(t,v.MessageTypes.file,!0),(0,l.default)(t,v.MessageTypes.image,!0),(0,l.default)(t,v.MessageTypes.poll,!0),t)))},[de]);var pe=function(){if(''!==q){var t={message:q,userId:F.userId,displayName:F.displayName,type:v.MessageTypes.text,time:(new Date).getTime()};Z.sendMessage(t),G('')}},ge=function(t,n,l){var o={displayName:F.displayName,type:v.MessageTypes.file,link:t,userId:F.id,name:n,size:l};Z.sendMessage(o)},ye=function(t){var l,o;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,n.default.awrap(fetch(t));case 2:return l=u.sent,u.next=5,n.default.awrap(l.blob());case 5:return o=u.sent,u.abrupt("return",o);case 7:case"end":return u.stop()}},null,null,null,Promise)};function xe(t,l,o){var u;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.default.awrap(ye(o));case 2:return u=s.sent,s.next=5,n.default.awrap(fetch(l,{method:'PUT',headers:{'Content-Type':t.type},body:u}));case 5:case"end":return s.stop()}},null,null,null,Promise)}function he(t){var l,o,u,s,c;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return l=O.default.apiBase+"/v1/meetings/genPreSignedUploadUrl",f.next=3,n.default.awrap(fetch(l,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({roomName:ie,filename:t.name})}));case 3:return o=f.sent,f.next=6,n.default.awrap(o.json());case 6:return u=f.sent.data,s=u.getLocation,c=u.putLocation,f.abrupt("return",{getURL:s,putURL:c});case 10:case"end":return f.stop()}},null,null,null,Promise)}var be=function(t){f.Alert.alert('Error',"Error: "+(t||'Problem uploading image'),[{text:'OK'}]),re(!1)},ve=function(){try{ae||(re(!0),Y(!1),(0,P.launchImageLibrary)({mediaType:'photo'},function(t){var l,o,u,s,c,m,p,y,x;return n.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=t.uri,o=t.didCancel,u=t.errorCode,s=t.errorMessage,c=t.fileName,m=t.type,p=t.fileSize,!o){h.next=5;break}re(!1),h.next=19;break;case 5:if(!u){h.next=10;break}console.log('Error Uploading Image:',u,s),be(s),h.next=19;break;case 10:return y={name:c,type:m,uri:l},p>5e6&&f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),h.next=14,n.default.awrap(he(y));case 14:return x=h.sent,h.next=17,n.default.awrap(xe(y,x.putURL,y.uri));case 17:b=x.getURL,w={displayName:F.displayName,type:v.MessageTypes.image,link:b,userId:F.id},Z.sendMessage(w),re(!1);case 19:case"end":return h.stop()}var b,w},null,null,null,Promise)}))}catch(t){console.log('Error Uploading Image:',t),be()}},we=function(){var t,l,o,u,s,c;return n.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:if(ae){m.next=24;break}return re(!0),Y(!1),m.prev=3,m.next=6,n.default.awrap(S.default.pick({type:[S.default.types.allFiles]}));case 6:if(t=m.sent,l=t.uri,o=t.name,u=t.size,s={displayName:F.displayName,type:v.MessageTypes.file,link:l,userId:F.id,name:o,size:u},!(u>5e6)){m.next=12;break}return f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),m.abrupt("return");case 12:return m.next=14,n.default.awrap(he(s));case 14:return c=m.sent,m.next=17,n.default.awrap(xe(s,c.putURL,s.link));case 17:ge(c.getURL,o,u),re(!1),m.next=24;break;case 21:m.prev=21,m.t0=m.catch(3),S.default.isCancel(m.t0)?re(!1):be();case 24:case"end":return m.stop()}},null,null,[[3,21]],Promise)};return c.default.createElement(m.Flex,{height:H-50,align:"center",width:K},c.default.createElement(k.default,null,c.default.createElement(y.GiftedChat,{messagesContainerStyle:{paddingTop:60},messages:oe,alwaysShowSend:!0,renderAvatarOnTop:!0,renderUsernameOnMessage:!0,isKeyboardInternallyHandled:!1,timeTextStyle:{left:{color:_.textPrimary[400]},right:{color:_.textPrimary[400]}},renderAvatar:function(t){return c.default.createElement(x.default,{name:t.currentMessage.user.name,bgColor:_.primary[700]})},renderBubble:function(t){var n=t.currentMessage;return n.type,n.link,n.text,c.default.createElement(y.Bubble,(0,o.default)({},t,{wrapperStyle:{left:{backgroundColor:_.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3},right:{backgroundColor:_.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3}},textStyle:{left:{color:_.textPrimary[100]},right:{color:_.textPrimary[100]}}}))},renderInputToolbar:function(t){return L&&c.default.createElement(m.Flex,{width:fe?K-60:K-20,direction:"row",justify:"space-between",align:"center",bg:"secondary.800",borderRadius:"50px",height:50},c.default.createElement(m.Box,null,c.default.createElement(m.Button,{onClick:function(){Y(!X)}},c.default.createElement(m.Box,(0,m.mergeStyles)(R.touchableIcons,{ml:8}),X?c.default.createElement(m.Icon,{name:"close",fill:"textPrimary.100",boxSize:"sm"}):c.default.createElement(m.Icon,{name:"plus-thick",fill:"textPrimary.100",boxSize:"sm"}))),X&&c.default.createElement(U,null,c.default.createElement(m.Button,{onClick:ve},c.default.createElement(m.Box,R.attachementButtons,c.default.createElement(m.Icon,{name:"image",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:8}," Images"))),c.default.createElement(m.Button,{onClick:we},c.default.createElement(m.Box,(0,m.mergeStyles)(R.attachementButtons,{width:'ios'===f.Platform.OS?150:120}),c.default.createElement(m.Icon,{name:"attach-file",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:'ios'===f.Platform.OS?8:0},' ',"Attachments"))))),c.default.createElement(f.TextInput,{style:{color:_.textPrimary[300],paddingHorizontal:5,height:40,width:fe?K-160:K-120},onChangeText:G,value:q}),c.default.createElement(m.Button,{onClick:pe,height:40,width:40},c.default.createElement(m.Box,(0,m.mergeStyles)(R.touchableIcons,{backgroundColor:'primary.500',mr:8}),c.default.createElement(m.Icon,{name:"send",fill:"textPrimary.100",boxSize:"md"}))))},user:{_id:F.userId,name:F.displayName}})))};e.default=j},725,[1,67,261,22,49,41,165,2,512,508,726,682,514,432,718,674,585,790,791,465,480,792,676,575,504,493]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0});var n=r(d[0]);Object.keys(n).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===n[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}}))})},726,[727]); __d(function(g,r,i,a,m,_e2,d){var e=r(d[0]);Object.defineProperty(_e2,"__esModule",{value:!0});var t={GiftedChat:!0,utils:!0,Actions:!0,Avatar:!0,Bubble:!0,SystemMessage:!0,MessageImage:!0,MessageText:!0,Composer:!0,Day:!0,InputToolbar:!0,LoadEarlier:!0,Message:!0,MessageContainer:!0,Send:!0,Time:!0,GiftedAvatar:!0};Object.defineProperty(_e2,"Actions",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(_e2,"Avatar",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(_e2,"Bubble",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(_e2,"Composer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(_e2,"Day",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(_e2,"GiftedAvatar",{enumerable:!0,get:function(){return E.default}}),_e2.GiftedChat=void 0,Object.defineProperty(_e2,"InputToolbar",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(_e2,"LoadEarlier",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(_e2,"Message",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(_e2,"MessageContainer",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(_e2,"MessageImage",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(_e2,"MessageText",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(_e2,"Send",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(_e2,"SystemMessage",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(_e2,"Time",{enumerable:!0,get:function(){return D.default}}),_e2.utils=void 0;var n=e(r(d[1])),o=e(r(d[2])),s=e(r(d[3])),u=e(r(d[4])),l=e(r(d[5])),f=e(r(d[6])),p=e(r(d[7])),h=e(r(d[8])),c=e(r(d[9])),y=r(d[10]),b=r(d[11]),v=e(r(d[12])),I=r(d[13]),x=e(r(d[14])),T=e(r(d[15])),H=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=V(t);if(n&&n.has(e))return n.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var l=s?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(o,u,l):o[u]=e[u]}o.default=e,n&&n.set(e,o);return o})(r(d[16]));_e2.utils=H;var C=e(r(d[17])),M=e(r(d[18])),S=e(r(d[19])),P=e(r(d[20])),O=e(r(d[21])),k=e(r(d[22])),L=e(r(d[23])),_=e(r(d[24])),A=e(r(d[25])),w=e(r(d[26])),F=e(r(d[27])),K=e(r(d[28])),j=e(r(d[29])),D=e(r(d[30])),E=e(r(d[31])),W=r(d[32]),R=r(d[33]);Object.keys(R).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(t,e)||e in _e2&&_e2[e]===R[e]||Object.defineProperty(_e2,e,{enumerable:!0,get:function(){return R[e]}}))});var B=["messagesContainerStyle"];function V(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(V=function(e){return e?n:t})(e)}function G(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}x.default.extend(T.default);var U=(function(e){(0,l.default)(x,e);var t,h,v=(t=x,h=G(),function(){var e,n=(0,p.default)(t);if(h){var o=(0,p.default)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return(0,f.default)(this,e)});function x(e){var t;return(0,s.default)(this,x),(t=v.call(this,e))._isMounted=!1,t._keyboardHeight=0,t._bottomOffset=0,t._maxHeight=void 0,t._isFirstLayout=!0,t._locale='en',t.invertibleScrollViewProps=void 0,t._actionSheetRef=void 0,t._messageContainerRef=c.default.createRef(),t._isTextInputWasFocused=!1,t.state={isInitialized:!1,composerHeight:t.props.minComposerHeight,messagesContainerHeight:void 0,typingDisabled:!1,text:void 0,messages:void 0},t.getLocale=function(){return t._locale},t.safeAreaSupport=function(e){return null!=e?e:(0,I.getBottomSpace)()},t.onKeyboardWillShow=function(e){if(t.handleTextInputFocusWhenKeyboardShow(),t.props.isKeyboardInternallyHandled){t.setIsTypingDisabled(!0),t.setKeyboardHeight(e.endCoordinates?e.endCoordinates.height:e.end.height),t.setBottomOffset(t.safeAreaSupport(t.props.bottomOffset));var n=t.getMessagesContainerHeightWithKeyboard();t.setState({messagesContainerHeight:n})}},t.onKeyboardWillHide=function(e){if(t.handleTextInputFocusWhenKeyboardHide(),t.props.isKeyboardInternallyHandled){t.setIsTypingDisabled(!0),t.setKeyboardHeight(0),t.setBottomOffset(0);var n=t.getBasicMessagesContainerHeight();t.setState({messagesContainerHeight:n})}},t.onKeyboardDidShow=function(e){'android'===y.Platform.OS&&t.onKeyboardWillShow(e),t.setIsTypingDisabled(!1)},t.onKeyboardDidHide=function(e){'android'===y.Platform.OS&&t.onKeyboardWillHide(e),t.setIsTypingDisabled(!1)},t.onSend=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Array.isArray(e)||(e=[e]);var s=e.map(function(e){return(0,o.default)({},e,{user:t.props.user,createdAt:new Date,_id:t.props.messageIdGenerator&&t.props.messageIdGenerator()})});!0===n&&(t.setIsTypingDisabled(!0),t.resetInputToolbar()),t.props.onSend&&t.props.onSend(s),!0===n&&setTimeout(function(){!0===t.getIsMounted()&&t.setIsTypingDisabled(!1)},100)},t.onInputSizeChanged=function(e){var n=Math.max(t.props.minComposerHeight,Math.min(t.props.maxComposerHeight,e.height)),o=t.getMessagesContainerHeightWithKeyboard(n);t.setState({composerHeight:n,messagesContainerHeight:o})},t.onInputTextChanged=function(e){t.getIsTypingDisabled()||(t.props.onInputTextChanged&&t.props.onInputTextChanged(e),void 0===t.props.text&&t.setState({text:e}))},t.onInitialLayoutViewLayout=function(e){var n=e.nativeEvent.layout;if(!(n.height<=0)){t.notifyInputTextReset(),t.setMaxHeight(n.height);var o=t.props.minComposerHeight,s=t.getMessagesContainerHeightWithKeyboard(o),u=t.props.initialText||'';t.setState({isInitialized:!0,text:t.getTextFromProp(u),composerHeight:o,messagesContainerHeight:s})}},t.onMainViewLayout=function(e){var n=e.nativeEvent.layout;t.getMaxHeight()===n.height&&!0!==t.getIsFirstLayout()||(t.setMaxHeight(n.height),t.setState({messagesContainerHeight:t._keyboardHeight>0?t.getMessagesContainerHeightWithKeyboard():t.getBasicMessagesContainerHeight()})),!0===t.getIsFirstLayout()&&t.setIsFirstLayout(!1)},t.invertibleScrollViewProps={inverted:t.props.inverted,keyboardShouldPersistTaps:t.props.keyboardShouldPersistTaps,onKeyboardWillShow:t.onKeyboardWillShow,onKeyboardWillHide:t.onKeyboardWillHide,onKeyboardDidShow:t.onKeyboardDidShow,onKeyboardDidHide:t.onKeyboardDidHide},t}return(0,u.default)(x,[{key:"getChildContext",value:function(){var e=this;return{actionSheet:this.props.actionSheet||function(){return e._actionSheetRef.getContext()},getLocale:this.getLocale}}},{key:"componentDidMount",value:function(){var e=this.props,t=e.messages,n=e.text;this.setIsMounted(!0),this.initLocale(),this.setMessages(t||[]),this.setTextFromProp(n)}},{key:"componentWillUnmount",value:function(){this.setIsMounted(!1)}},{key:"componentDidUpdate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,o=n.messages,s=n.text,u=n.inverted;this.props!==t&&this.setMessages(o||[]),!1===u&&o&&t.messages&&o.length!==t.messages.length&&setTimeout(function(){return e.scrollToBottom(!1)},200),s!==t.text&&this.setTextFromProp(s)}},{key:"initLocale",value:function(){null===this.props.locale?this.setLocale('en'):this.setLocale(this.props.locale||'en')}},{key:"setLocale",value:function(e){this._locale=e}},{key:"setTextFromProp",value:function(e){void 0!==e&&e!==this.state.text&&this.setState({text:e})}},{key:"getTextFromProp",value:function(e){return void 0===this.props.text?e:this.props.text}},{key:"setMessages",value:function(e){this.setState({messages:e})}},{key:"getMessages",value:function(){return this.state.messages}},{key:"setMaxHeight",value:function(e){this._maxHeight=e}},{key:"getMaxHeight",value:function(){return this._maxHeight}},{key:"setKeyboardHeight",value:function(e){this._keyboardHeight=e}},{key:"getKeyboardHeight",value:function(){return'android'!==y.Platform.OS||this.props.forceGetKeyboardHeight?this._keyboardHeight:0}},{key:"setBottomOffset",value:function(e){this._bottomOffset=e}},{key:"getBottomOffset",value:function(){return this._bottomOffset}},{key:"setIsFirstLayout",value:function(e){this._isFirstLayout=e}},{key:"getIsFirstLayout",value:function(){return this._isFirstLayout}},{key:"setIsTypingDisabled",value:function(e){this.setState({typingDisabled:e})}},{key:"getIsTypingDisabled",value:function(){return this.state.typingDisabled}},{key:"setIsMounted",value:function(e){this._isMounted=e}},{key:"getIsMounted",value:function(){return this._isMounted}},{key:"getMinInputToolbarHeight",value:function(){return this.props.renderAccessory?2*this.props.minInputToolbarHeight:this.props.minInputToolbarHeight}},{key:"calculateInputToolbarHeight",value:function(e){return e+(this.getMinInputToolbarHeight()-this.props.minComposerHeight)}},{key:"getBasicMessagesContainerHeight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.composerHeight;return this.getMaxHeight()-this.calculateInputToolbarHeight(e)}},{key:"getMessagesContainerHeightWithKeyboard",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.composerHeight;return this.getBasicMessagesContainerHeight(e)-this.getKeyboardHeight()+this.getBottomOffset()}},{key:"handleTextInputFocusWhenKeyboardHide",value:function(){var e;this._isTextInputWasFocused||(this._isTextInputWasFocused=(null==(e=this.textInput)?void 0:e.isFocused())||!1)}},{key:"handleTextInputFocusWhenKeyboardShow",value:function(){this.textInput&&this._isTextInputWasFocused&&!this.textInput.isFocused()&&this.textInput.focus(),this._isTextInputWasFocused=!1}},{key:"scrollToBottom",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._messageContainerRef&&this._messageContainerRef.current&&(this.props.inverted?this._messageContainerRef.current.scrollToOffset({offset:0,animated:e}):this._messageContainerRef.current.scrollToEnd({animated:e}))}},{key:"renderMessages",value:function(){var e=this.props,t=e.messagesContainerStyle,s=(0,n.default)(e,B),u=c.default.createElement(y.View,{style:[{height:this.state.messagesContainerHeight},t]},c.default.createElement(K.default,(0,o.default)({},s,{invertibleScrollViewProps:this.invertibleScrollViewProps,messages:this.getMessages(),forwardRef:this._messageContainerRef,isTyping:this.props.isTyping})),this.renderChatFooter());return this.props.isKeyboardInternallyHandled?c.default.createElement(y.KeyboardAvoidingView,{enabled:!0},u):u}},{key:"resetInputToolbar",value:function(){this.textInput&&this.textInput.clear(),this.notifyInputTextReset();var e=this.props.minComposerHeight,t=this.getMessagesContainerHeightWithKeyboard(e);this.setState({text:this.getTextFromProp(''),composerHeight:e,messagesContainerHeight:t})}},{key:"focusTextInput",value:function(){this.textInput&&this.textInput.focus()}},{key:"notifyInputTextReset",value:function(){this.props.onInputTextChanged&&this.props.onInputTextChanged('')}},{key:"renderInputToolbar",value:function(){var e=this,t=(0,o.default)({},this.props,{text:this.getTextFromProp(this.state.text),composerHeight:Math.max(this.props.minComposerHeight,this.state.composerHeight),onSend:this.onSend,onInputSizeChanged:this.onInputSizeChanged,onTextChanged:this.onInputTextChanged,textInputProps:(0,o.default)({},this.props.textInputProps,{ref:function(t){return e.textInput=t},maxLength:this.getIsTypingDisabled()?0:this.props.maxInputLength})});return this.props.renderInputToolbar?this.props.renderInputToolbar(t):c.default.createElement(A.default,t)}},{key:"renderChatFooter",value:function(){return this.props.renderChatFooter?this.props.renderChatFooter():null}},{key:"renderLoading",value:function(){return this.props.renderLoading?this.props.renderLoading():null}},{key:"render",value:function(){var e=this;if(!0===this.state.isInitialized){var t=this.props.wrapInSafeArea?y.SafeAreaView:y.View;return c.default.createElement(t,{style:z.safeArea},c.default.createElement(b.ActionSheetProvider,{ref:function(t){return e._actionSheetRef=t}},c.default.createElement(y.View,{style:z.container,onLayout:this.onMainViewLayout},this.renderMessages(),this.renderInputToolbar())))}return c.default.createElement(y.View,{style:z.container,onLayout:this.onInitialLayoutViewLayout},this.renderLoading())}}],[{key:"append",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Array.isArray(t)||(t=[t]),n?t.concat(e):e.concat(t)}},{key:"prepend",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Array.isArray(t)||(t=[t]),n?e.concat(t):t.concat(e)}}]),x})(c.default.Component);_e2.GiftedChat=U,U.childContextTypes={actionSheet:h.default.func,getLocale:h.default.func},U.defaultProps={messages:[],messagesContainerStyle:void 0,text:void 0,placeholder:W.DEFAULT_PLACEHOLDER,disableComposer:!1,messageIdGenerator:function(){return v.default.v4()},user:{},onSend:function(){},locale:null,timeFormat:W.TIME_FORMAT,dateFormat:W.DATE_FORMAT,loadEarlier:!1,onLoadEarlier:function(){},isLoadingEarlier:!1,renderLoading:null,renderLoadEarlier:null,renderAvatar:void 0,showUserAvatar:!1,actionSheet:null,onPressAvatar:null,onLongPressAvatar:null,renderUsernameOnMessage:!1,renderAvatarOnTop:!1,renderBubble:null,renderSystemMessage:null,onLongPress:null,renderMessage:null,renderMessageText:null,renderMessageImage:null,renderMessageVideo:null,renderMessageAudio:null,imageProps:{},videoProps:{},audioProps:{},lightboxProps:{},textInputProps:{},listViewProps:{},renderCustomView:null,isCustomViewBottom:!1,renderDay:null,renderTime:null,renderFooter:null,renderChatEmpty:null,renderChatFooter:null,renderInputToolbar:null,renderComposer:null,renderActions:null,renderSend:null,renderAccessory:null,isKeyboardInternallyHandled:!0,onPressActionButton:null,bottomOffset:null,minInputToolbarHeight:44,keyboardShouldPersistTaps:y.Platform.select({ios:'never',android:'always',default:'never'}),onInputTextChanged:null,maxInputLength:null,forceGetKeyboardHeight:!1,inverted:!0,extraData:null,minComposerHeight:W.MIN_COMPOSER_HEIGHT,maxComposerHeight:W.MAX_COMPOSER_HEIGHT,wrapInSafeArea:!0},U.propTypes={messages:h.default.arrayOf(h.default.object),messagesContainerStyle:H.StylePropType,text:h.default.string,initialText:h.default.string,placeholder:h.default.string,disableComposer:h.default.bool,messageIdGenerator:h.default.func,user:h.default.object,onSend:h.default.func,locale:h.default.string,timeFormat:h.default.string,dateFormat:h.default.string,isKeyboardInternallyHandled:h.default.bool,loadEarlier:h.default.bool,onLoadEarlier:h.default.func,isLoadingEarlier:h.default.bool,renderLoading:h.default.func,renderLoadEarlier:h.default.func,renderAvatar:h.default.func,showUserAvatar:h.default.bool,actionSheet:h.default.func,onPressAvatar:h.default.func,onLongPressAvatar:h.default.func,renderUsernameOnMessage:h.default.bool,renderAvatarOnTop:h.default.bool,isCustomViewBottom:h.default.bool,renderBubble:h.default.func,renderSystemMessage:h.default.func,onLongPress:h.default.func,renderMessage:h.default.func,renderMessageText:h.default.func,renderMessageImage:h.default.func,imageProps:h.default.object,videoProps:h.default.object,audioProps:h.default.object,lightboxProps:h.default.object,renderCustomView:h.default.func,renderDay:h.default.func,renderTime:h.default.func,renderFooter:h.default.func,renderChatEmpty:h.default.func,renderChatFooter:h.default.func,renderInputToolbar:h.default.func,renderComposer:h.default.func,renderActions:h.default.func,renderSend:h.default.func,renderAccessory:h.default.func,onPressActionButton:h.default.func,bottomOffset:h.default.number,minInputToolbarHeight:h.default.number,listViewProps:h.default.object,keyboardShouldPersistTaps:h.default.oneOf(['always','never','handled']),onInputTextChanged:h.default.func,maxInputLength:h.default.number,forceGetKeyboardHeight:h.default.bool,inverted:h.default.bool,textInputProps:h.default.object,extraData:h.default.object,minComposerHeight:h.default.number,maxComposerHeight:h.default.number,alignTop:h.default.bool,wrapInSafeArea:h.default.bool};var z=y.StyleSheet.create({container:{flex:1},safeArea:{flex:1}})},727,[1,96,22,9,10,12,14,17,204,165,2,728,734,749,750,751,752,753,755,757,774,766,759,775,776,777,779,780,781,778,772,756,773,789]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0});var n={ActionSheetProvider:!0,connectActionSheet:!0,useActionSheet:!0};Object.defineProperty(e,"ActionSheetProvider",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"connectActionSheet",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"useActionSheet",{enumerable:!0,get:function(){return u.useActionSheet}});var o=t(r(d[1])),c=t(r(d[2])),u=r(d[3]),f=r(d[4]);Object.keys(f).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(n,t)||t in e&&e[t]===f[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return f[t]}}))})},728,[1,729,732,731,733]); @@ -796,7 +796,7 @@ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0})},78 __d(function(g,r,i,a,m,e,d){var o=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.launchCamera=function(o,u){if('function'!=typeof u)return void console.error('Send proper callback function, check API');c.NativeModules.DyteImagePickerManager.launchCamera((0,n.default)({},t,o),u)},e.launchImageLibrary=function(o,u){if('function'!=typeof u)return void console.error('Send proper callback function, check API');c.NativeModules.DyteImagePickerManager.launchImageLibrary((0,n.default)({},t,o),u)};var n=o(r(d[1])),c=r(d[2]),t={mediaType:'photo',videoQuality:'high',quality:1,maxWidth:0,maxHeight:0,includeBase64:!1,saveToPhotos:!1,durationLimit:0,cameraType:'back'}},790,[1,22,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=t(r(d[1])),p=t(r(d[2])),n=t(r(d[3])),s=r(d[4]),c=s.NativeModules.DyteRNDocumentPicker;function l(t){if('filetype'in t)throw new TypeError('A `filetype` option was passed to DocumentPicker.pick, the correct option is `type`');if('types'in t)throw new TypeError('A `types` option was passed to DocumentPicker.pick, the correct option is `type`');if('type'in t||(t.type=x.types.allFiles),t.type=Array.isArray(t.type)?t.type:[t.type],t.type.some(function(t){return void 0===t}))throw new TypeError('Unexpected undefined type option, did you try using a DocumentPicker.types.* that does not exist?');if(Array.isArray(t.type)&&t.type.length<1)throw new TypeError('`type` option should not be an empty array, at least one type must be passed if the `type` option is not omitted');if(t.type.forEach(function(t){if('string'!=typeof t)throw new TypeError("Invalid type option, expected a string not: "+t)}),t.type.length>1&&'android'===s.Platform.OS&&s.Platform.Version<19&&console.warn("RNDocumentPicker: Android API level "+s.Platform.Version+" does not support multiple types, falling back to */*"),Array.isArray(t.type)&&t.type.length>1&&t.type.includes('folder'))throw new TypeError('When type array is folder then other options are not supported');if('mode'in t&&!['import','open'].includes(t.mode))throw new TypeError("Invalid mode option: "+t.mode);if('copyTo'in t&&!['cachesDirectory','documentDirectory'].includes(t.copyTo))throw new TypeError("Invalid copyTo option: "+t.copyTo);return c.pick(t)}function u(t){if('ios'===s.Platform.OS){if(!Array.isArray(t))throw new TypeError('`uris` should be an array of strings');t.forEach(function(t){if('string'!=typeof t)throw new TypeError("Invalid uri parameter, expected a string not: "+t)}),c.releaseSecureAccess(t)}}var f={mimeTypes:{allFiles:'*/*',audio:'audio/*',csv:'text/csv',doc:'application/msword',docx:'application/vnd.openxmlformats-officedocument.wordprocessingml.document',images:'image/*',pdf:'application/pdf',plainText:'text/plain',ppt:'application/vnd.ms-powerpoint',pptx:'application/vnd.openxmlformats-officedocument.presentationml.presentation',video:'video/*',xls:'application/vnd.ms-excel',xlsx:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',zip:'application/zip'},utis:{allFiles:'public.item',audio:'public.audio',csv:'public.comma-separated-values-text',doc:'com.microsoft.word.doc',docx:'org.openxmlformats.wordprocessingml.document',images:'public.image',pdf:'com.adobe.pdf',plainText:'public.plain-text',ppt:'com.microsoft.powerpoint.ppt',pptx:'org.openxmlformats.presentationml.presentation',video:'public.movie',xls:'com.microsoft.excel.xls',xlsx:'org.openxmlformats.spreadsheetml.sheet',zip:'public.zip-archive'},extensions:{allFiles:'*',audio:'.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma',csv:'.csv',doc:'.doc',docx:'.docx',images:'.jpeg .jpg .png',pdf:'.pdf',plainText:'.txt',ppt:'.ppt',pptx:'.pptx',video:'.mp4',xls:'.xls',xlsx:'.xlsx',zip:'.zip .gz',folder:'folder'}},y={android:f.mimeTypes,ios:f.utis,windows:f.extensions},x=(function(){function t(){(0,p.default)(this,t)}return(0,n.default)(t,null,[{key:"pick",value:function(t){return l((0,o.default)({},t,{multiple:!1})).then(function(t){return t[0]})}},{key:"pickMultiple",value:function(t){return l((0,o.default)({},t,{multiple:!0}))}},{key:"isCancel",value:function(t){return t&&"DOCUMENT_PICKER_CANCELED"===t.code}},{key:"releaseSecureAccess",value:function(t){u(t)}}]),t})();e.default=x,x.types=y[s.Platform.OS]||f.mimeTypes},791,[1,22,9,10,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),o=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=l(n);if(o&&o.has(t))return o.get(t);var u={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var s=f?Object.getOwnPropertyDescriptor(t,c):null;s&&(s.get||s.set)?Object.defineProperty(u,c,s):u[c]=t[c]}u.default=t,o&&o.set(t,u);return u})(r(d[2])),u=r(d[3]);function l(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(l=function(t){return t?o:n})(t)}var f=function(t){var l=t.children,f=t.useNativeDriver,c=void 0!==f&&f,s=o.useState('android'===u.Platform.OS?0:new u.Animated.Value(0)),v=(0,n.default)(s,2),p=v[0],y=v[1],b=o.useRef(null),O=o.useRef(null),h=function(t){'android'===u.Platform.OS?y(t.endCoordinates?t.endCoordinates.height:t.end.height):u.Animated.parallel([u.Animated.timing(p,{duration:t.duration,toValue:t.endCoordinates.height,useNativeDriver:c})]).start()},P=function(t){'android'===u.Platform.OS?y(0):u.Animated.parallel([u.Animated.timing(p,{duration:t.duration,toValue:0,useNativeDriver:c})]).start()};return o.useEffect(function(){return b.current=u.Keyboard.addListener('android'===u.Platform.OS?'keyboardDidShow':'keyboardWillShow',h),O.current=u.Keyboard.addListener('android'===u.Platform.OS?'keyboardDidHide':'keyboardWillHide',P),function(){var t,n;null==(t=b.current)||t.remove(),null==(n=O.current)||n.remove(),b.current=null,O.current=null}},[]),'android'===u.Platform.OS?o.createElement(u.View,{style:{bottom:p?50:p}},l,o.createElement(u.KeyboardAvoidingView,{behavior:"padding",keyboardVerticalOffset:-p/2})):o.createElement(u.Animated.View,{style:{paddingBottom:p,flex:1}},l)};e.default=f},792,[1,41,165,2]); -__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,o.useContext)(h.ConfigServiceContext).sessionConfig,C=t.permissions.polls.can_create,w=(0,p.useDisclosure)(),P=w.isOpen,O=w.onClose,j=w.onOpen,M=(0,o.useContext)(f.MediaRoomContext).mediaRoom,B=(0,o.useContext)(s.PeersServiceContext).selfPeer,S=(0,u.useSelector)(function(t){return t.room.polls}),_=(0,n.useWindowDimensions)(),k=t.theme.dimensions||_,T=k.height,D=k.width,F=(Math.floor(2*T/3),function(){var t=P?O:j;t()}),R=(0,u.useSelector)(function(t){return t.room.chatMessages}).filter(function(t){return!0!==t.read&&t.type===x.MessageTypes.poll}),W=(0,u.useDispatch)();(0,o.useEffect)(function(){R.length>0&&W((0,m.markMessagesRead)((0,l.default)({},x.MessageTypes.poll,!0)))},[R]);var N=Object.values(S);return o.default.createElement(c.Flex,{height:T-30,width:D,direction:"column",justifyContent:"space-between",overflowY:"auto",px:10,pb:10,pt:50},o.default.createElement(c.Flex,null,o.default.createElement(c.Box,{overflowY:"auto",className:"dyte-client-noScrollbar"},P?o.default.createElement(c.Box,null,P&&o.default.createElement(b.default,{toggle:F})):o.default.createElement(o.default.Fragment,null,N.length>0?o.default.createElement(n.ScrollView,{style:{height:C?T-150:T},contentContainerStyle:{paddingBottom:C?0:120}},o.default.createElement(n.TouchableWithoutFeedback,null,o.default.createElement(c.Box,null,N.map(function(t,l){return o.default.createElement(c.Box,{my:10},o.default.createElement(c.Text,{ml:4},t.createdBy?"Poll by "+t.createdBy:''),o.default.createElement(c.Box,{mt:1,className:"dyte-client-bubble dyte-client-other dyte-client-type-3"},o.default.createElement(E.default,{mediaRoom:M,poll:t,selfPeer:B})))})))):o.default.createElement(c.Flex,{height:T-150,width:D,align:"center",justify:"center"},o.default.createElement(c.Text,{fontSize:"lg",color:v.colors.textPrimary[100]},"No Polls created yet."))))),C&&o.default.createElement(c.Button,{fontSize:"16",onClick:F},o.default.createElement(c.Box,{bg:P?'danger.500':'primary.500',p:8,justify:"center",borderRadius:y.default.small},o.default.createElement(c.Text,{textAlign:"center"},P?'Cancel Poll Creation':'Create New Poll'))))};var l=t(r(d[1])),n=r(d[2]),o=(function(t,l){if(!l&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(l);if(n&&n.has(t))return n.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,n&&n.set(t,o);return o})(r(d[3])),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),m=r(d[8]),p=r(d[9]),y=t(r(d[10])),h=r(d[11]),x=r(d[12]),b=t(r(d[13])),E=t(r(d[14])),v=r(d[15]);function C(t){if("function"!=typeof WeakMap)return null;var l=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:l})(t)}},793,[1,261,2,165,432,512,585,674,480,493,676,508,718,794,796,798]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,o.useContext)(h.ConfigServiceContext).sessionConfig,C=t.permissions.polls.can_create,w=(0,p.useDisclosure)(),P=w.isOpen,O=w.onClose,j=w.onOpen,M=(0,o.useContext)(f.MediaRoomContext).mediaRoom,B=(0,o.useContext)(s.PeersServiceContext).selfPeer,S=(0,u.useSelector)(function(t){return t.room.polls}),_=(0,n.useWindowDimensions)(),k=(0,p.useScale)(t.theme.dimensions||_),T=k.height,D=k.width,F=(Math.floor(2*T/3),function(){var t=P?O:j;t()}),R=(0,u.useSelector)(function(t){return t.room.chatMessages}).filter(function(t){return!0!==t.read&&t.type===x.MessageTypes.poll}),W=(0,u.useDispatch)();(0,o.useEffect)(function(){R.length>0&&W((0,m.markMessagesRead)((0,l.default)({},x.MessageTypes.poll,!0)))},[R]);var N=Object.values(S);return o.default.createElement(c.Flex,{height:T-30,width:D,direction:"column",justifyContent:"space-between",overflowY:"auto",px:10,pb:10,pt:50},o.default.createElement(c.Flex,null,o.default.createElement(c.Box,{overflowY:"auto",className:"dyte-client-noScrollbar"},P?o.default.createElement(c.Box,null,P&&o.default.createElement(b.default,{toggle:F})):o.default.createElement(o.default.Fragment,null,N.length>0?o.default.createElement(n.ScrollView,{style:{height:C?T-150:T},contentContainerStyle:{paddingBottom:C?0:120}},o.default.createElement(n.TouchableWithoutFeedback,null,o.default.createElement(c.Box,null,N.map(function(t,l){return o.default.createElement(c.Box,{my:10},o.default.createElement(c.Text,{ml:4},t.createdBy?"Poll by "+t.createdBy:''),o.default.createElement(c.Box,{mt:1,className:"dyte-client-bubble dyte-client-other dyte-client-type-3"},o.default.createElement(E.default,{mediaRoom:M,poll:t,selfPeer:B})))})))):o.default.createElement(c.Flex,{height:T-150,width:D,align:"center",justify:"center"},o.default.createElement(c.Text,{fontSize:"lg",color:v.colors.textPrimary[100]},"No Polls created yet."))))),C&&o.default.createElement(c.Button,{fontSize:"16",onClick:F},o.default.createElement(c.Box,{bg:P?'danger.500':'primary.500',p:8,justify:"center",borderRadius:y.default.small},o.default.createElement(c.Text,{textAlign:"center"},P?'Cancel Poll Creation':'Create New Poll'))))};var l=t(r(d[1])),n=r(d[2]),o=(function(t,l){if(!l&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(l);if(n&&n.has(t))return n.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,n&&n.set(t,o);return o})(r(d[3])),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),m=r(d[8]),p=r(d[9]),y=t(r(d[10])),h=r(d[11]),x=r(d[12]),b=t(r(d[13])),E=t(r(d[14])),v=r(d[15]);function C(t){if("function"!=typeof WeakMap)return null;var l=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:l})(t)}},793,[1,261,2,165,432,512,585,674,480,493,676,508,718,794,796,798]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var C=t.toggle,k=(0,u.useContext)(f.MediaRoomContext).mediaRoom,b=u.default.useState({question:'',options:Array(2).fill(''),anonymous:!1,hideVotes:!0}),v=(0,n.default)(b,2),T=v[0],E=v[1],w=(0,u.useContext)(c.ThemeContext).colors,P=function(t,n){var l=T.options;l[n]=t,E((0,o.default)({},T,{options:l}))},O=function(){var t=T.options;t.push(''),E((0,o.default)({},T,{options:t}))},j=(u.default.useContext(x.OrientationContext).orientation,(0,u.useContext)(p.ConfigServiceContext).sessionConfig),B=(0,l.useWindowDimensions)(),R=(j.theme.dimensions||B).height;return u.default.createElement(l.ScrollView,{style:{height:R-200}},u.default.createElement(s.Box,{py:20,px:10},u.default.createElement(s.VStack,{spacing:4},u.default.createElement(s.Text,{fontSize:"xl",textAlign:"center"},"Poll Question"),u.default.createElement(l.TextInput,{multiline:!0,autoFocus:!1,placeholder:"What is your poll for?",numberOfLines:4,value:T.question,placeholderTextColor:w.textPrimary[400],onChangeText:function(t){E((0,o.default)({},T,{question:t}))},style:[{backgroundColor:w.secondary[800],height:75,color:w.textPrimary[300]},y.default.createPollInputText]}),T.options.map(function(t,o){return u.default.createElement(l.TextInput,{autoFocus:!1,placeholder:"Enter an option",value:T.options[o],placeholderTextColor:w.textPrimary[400],onChangeText:function(t){return P(t,o)},style:[{backgroundColor:w.secondary[800],color:w.textPrimary[300]},y.default.createPollInputText]})}),u.default.createElement(s.Box,{bg:"secondary.700",mt:20,width:125,height:30,alignItems:"center",justifyContent:"center"},u.default.createElement(s.Button,{onClick:function(){return O()}},u.default.createElement(s.Text,null,"+ Add an Option"))),u.default.createElement(s.CheckBox,{rightText:"Anonymous",style:{marginTop:15,paddingRight:10,height:20,justifyContent:'center',borderRadius:h.default.small},rightTextStyle:{color:'white'},checkedCheckBoxColor:"white",uncheckedCheckBoxColor:"white",isChecked:T.anonymous,onClick:function(){var t=!T.anonymous;E((0,o.default)({},T,{anonymous:t}))}}),u.default.createElement(s.CheckBox,{rightText:"Hide Results before Voting",style:{marginTop:15,paddingRight:10,height:20,justifyContent:'center',borderRadius:h.default.small},rightTextStyle:{color:'white'},checkedCheckBoxColor:"white",uncheckedCheckBoxColor:"white",isChecked:T.hideVotes,onClick:function(){var t=!T.hideVotes;E((0,o.default)({},T,{hideVotes:t}))}}),u.default.createElement(s.Box,{mt:10,bg:"primary.500",p:8,mb:5,justify:"center",borderRadius:h.default.small},u.default.createElement(s.Button,{fontSize:"16",onClick:function(){var t=T.question,n=T.options;if(t)if(''===n[0]||''===n[1])l.Alert.alert('Error:','Please add minimum two options',[{text:'OK'}]);else{var u=(0,o.default)({},T);u.options=n.filter(function(t){return''!==t}),k.newPoll(u),C()}else l.Alert.alert('Error:','Question Can\'t be empty',[{text:'OK'}])}},u.default.createElement(s.Text,{textAlign:"center"},"Create Poll"))))))};var o=t(r(d[1])),n=t(r(d[2])),l=r(d[3]),u=(function(t,o){if(!o&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(o);if(n&&n.has(t))return n.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var s=u?Object.getOwnPropertyDescriptor(t,c):null;s&&(s.get||s.set)?Object.defineProperty(l,c,s):l[c]=t[c]}l.default=t,n&&n.set(t,l);return l})(r(d[4])),c=r(d[5]),s=r(d[6]),f=r(d[7]),h=t(r(d[8])),p=r(d[9]),x=r(d[10]),y=t(r(d[11]));function C(t){if("function"!=typeof WeakMap)return null;var o=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:o})(t)}},794,[1,22,41,2,165,514,512,585,676,508,575,795]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(d[1]),n=t(r(d[2])),u=o.StyleSheet.create({createPollInputText:{paddingLeft:15,paddingRight:5,marginTop:20,borderRadius:n.default.medium,paddingTop:10,paddingBottom:10}});e.default=u},795,[1,2,676]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var s=t.selfPeer,p=t.mediaRoom,v=t.poll,x=function(t){try{p.votePoll({index:t,pollId:v.id})}catch(t){l.Alert.alert('Error','Error: Problem casting your vote',[{text:'OK'}])}};if(console.log('Poll',v),v){v.id;var h=Math.max.apply(Math,(0,n.default)(v.options.map(function(t){return t.votes.length})).concat([0]));return o.default.createElement(u.VStack,{spacing:2,direction:"row",bg:"secondary.800",p:12,mt:8,borderRadius:c.default.medium},o.default.createElement(u.Text,{textAlign:"left"},v.question),o.default.createElement(u.Box,{mt:8},v.options.map(function(t,n){return o.default.createElement(u.Flex,{onClick:function(){return x(n)},mb:4},o.default.createElement(f.default,{active:t.votes.length===h&&t.votes.length>0,option:t,index:n,selfId:s.userId,onChange:function(){return x(n)}}))})))}return o.default.createElement(u.Text,{fontStyle:"italic"},"Poll wasn't found or has been deleted")};var n=t(r(d[1])),l=r(d[2]),o=t(r(d[3])),u=r(d[4]),c=t(r(d[5])),f=t(r(d[6]))},796,[1,49,2,165,512,676,797]); @@ -804,7 +804,7 @@ __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{ __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"colors",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"fontSize",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"fontWeight",{enumerable:!0,get:function(){return f.default}});var n=t(r(d[1])),u=t(r(d[2])),f=t(r(d[3]))},798,[1,576,799,800]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var x={xs:'12px',sm:'14px',md:'16px',lg:'18px',xl:'20px'};e.default=x},799,[]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l={light:300,normal:400,medium:500,bold:600};e.default=l},800,[]); -__d(function(g,r,_i,_a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,c.useSelector)(function(t){return t.room.roomViewType}),i=(0,n.useContext)(p.PeersServiceContext),l=i.processedPeers,a=i.selfPeer,s=i.joinedProcessedPeers,y=(0,n.useContext)(x.MediaRoomContext).mediaRoom,T=(0,n.useContext)(b.ConfigServiceContext).sessionConfig,R=(0,o.useWindowDimensions)(),k=(T.theme.dimensions||R).width,C=(0,c.useSelector)(function(t){return t.room.requestToJoinPeersList}),_=C.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.present}),S=C.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.ask});l=[a].concat(l.sort(function(t,n){return t.id.localeCompare(n.id)})).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)});var P=[a].concat(s).filter(function(t){return null==t?void 0:t.webinarHiddenParticipant}).filter(function(t,n,i){return i.findIndex(function(n){return n.id===t.id})===n}),v=[a].concat(s).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)&&t.requestToJoinType===u.RequestToJoinType.ask});l=l.concat(v).filter((q=new Set,function(t){return!q.has(t.id)&&q.add(t.id)}));var q;var A=function(t,n){y.acceptAllRequestToJoinStage([{id:t,requestToJoinType:n,type:f.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT}])},M=function(t){y.rejectRequestToJoinStage(t)};return n.default.createElement(E.Flex,{mt:60,width:k},n.default.createElement(o.ScrollView,{style:{padding:20}},n.default.createElement(o.TouchableWithoutFeedback,null,n.default.createElement(E.Box,null,n.default.createElement(E.Box,{my:20},t===f.DyteViewTypes.webinar&&l.length>0&&n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mb:10},"Presenting (",l.length,")"),l.map(function(i){return n.default.createElement(w,{peer:i,key:i.id,mediaRoom:y,permissions:null==T?void 0:T.permissions,roomViewType:t})})),P.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Attending (",P.length,")"),P.map(function(i){return n.default.createElement(w,{key:i.id,peer:i,mediaRoom:y,permissions:null==T?void 0:T.permissions,roomViewType:t})})),S.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to ask Question (",S.length,")"),S.map(function(t){return n.default.createElement(h,{rejectRequest:M,acceptRequest:A,peer:t,key:t.id,type:"REQUEST_TO_ASK"})})),_.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to Present (",_.length,")"),_.map(function(t){return n.default.createElement(h,{rejectRequest:M,acceptRequest:A,peer:t,key:t.id,type:"REQUEST_TO_PRESENT"})})),n.default.createElement(E.Box,{height:200})))))};var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var i=T(n);if(i&&i.has(t))return i.get(t);var l={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(l,a,u):l[a]=t[a]}l.default=t,i&&i.set(t,l);return l})(r(d[1])),i=r(d[2]),l=t(r(d[3])),o=r(d[4]),a=t(r(d[5])),u=r(d[6]),c=r(d[7]),f=r(d[8]),s=t(r(d[9])),p=r(d[10]),E=r(d[11]),y=t(r(d[12])),x=r(d[13]),b=r(d[14]);function T(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,i=new WeakMap;return(T=function(t){return t?i:n})(t)}function h(t){var o=t.rejectRequest,a=t.acceptRequest,u=t.peer,c=t.type,f=(0,n.useContext)(i.ThemeContext).colors;return n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+u.name,bgColor:f.primary[500]}),n.default.createElement(E.Text,{ml:10,color:f.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:u.name>30?u.name.substring(0,20)+"...":""+u.name,charSize:30}),u.isMe?' (me)':null)),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:6},n.default.createElement(E.Button,{onClick:function(){return a(u.id,c)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"check",fill:f.success[500]}))),n.default.createElement(E.Box,{ml:6},n.default.createElement(E.Button,{onClick:function(){return o(u.id)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"clear",fill:f.danger[500]})))))}function w(t){var o=t.peer,c=t.mediaRoom,p=t.permissions,x=t.roomViewType,T=(0,n.useContext)(i.ThemeContext).colors,h=(0,n.useContext)(b.ConfigServiceContext).participantControls,w=(null==p?void 0:p.pin_participant)||(null==p?void 0:p.can_allow_participant_audio)||(null==p?void 0:p.can_allow_participant_video)||(null==p?void 0:p.kick_participant),R=p.accept_present_requests,k=[];return(w||h.length>0)&&(null!=p&&p.pin_participant&&(o.isPinned?k.push({title:'Unpin',onClick:function(){return c.pin(null)}}):k.push({title:'Pin',onClick:function(){return c.pin(o.id)}})),null!=p&&p.can_allow_participant_audio&&k.push({title:'Mute Audio',onClick:function(){return c.disableAudio(o.id)}}),null!=p&&p.can_allow_participant_video&&k.push({title:'Disable Video',onClick:function(){return c.disableVideo(o.id)}}),null!=p&&p.kick_participant&&!o.isMe&&k.push({title:'Kick',onClick:function(){return c.kick(o.id)}}),x!==f.DyteViewTypes.webinar||o.isMe||!R||o.webinarHiddenParticipant||k.push({title:'Force Stop Presenting',onClick:function(){return c.removePeerFromStage(o.id,f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR)}}),x===f.DyteViewTypes.webinar&&!o.isMe&&R&&k.push({title:'Grant Premission to Present',onClick:function(){return c.acceptAllRequestToJoinStage([{id:o.id,requestToJoinType:u.RequestToJoinType.present,type:f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR}])}}),h.forEach(function(t){o.isMe&&!1===t.showSelf||k.push({title:t.label,onClick:function(){return t.onClick(o.id)}})}),k.push({title:'Cancel',onClick:function(){}})),n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+o.displayName,bgColor:T.primary[500]}),n.default.createElement(E.HStack,{ml:10,color:T.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:o.displayName.length>30?o.displayName.substring(0,20)+"...":""+o.displayName,charSize:30}),(o.isMe||o.label)&&n.default.createElement(E.Text,{background:"primary.300",color:"textPrimary.100",pr:4,ml:4,borderRadius:3},o.isMe?'me':o.label))),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:8},o.producingAudio?n.default.createElement(E.Icon,{boxSize:"xl",name:"mic",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"mic-off",fill:T.danger[500]})),o.producingVideo?n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam-off",fill:T.danger[500]}),(w||h.length>0)&&n.default.createElement(a.default,{options:k.map(function(t){return t.title}),actions:k.map(function(t){return t.onClick})})))}},801,[1,165,514,682,2,802,487,432,497,676,674,512,692,585,508]); +__d(function(g,r,_i,_a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,c.useSelector)(function(t){return t.room.roomViewType}),i=(0,n.useContext)(p.PeersServiceContext),l=i.processedPeers,a=i.selfPeer,s=i.joinedProcessedPeers,y=(0,n.useContext)(x.MediaRoomContext).mediaRoom,h=(0,n.useContext)(b.ConfigServiceContext).sessionConfig,k=(0,o.useWindowDimensions)(),C=(0,T.useScale)(h.theme.dimensions||k).width,S=(0,c.useSelector)(function(t){return t.room.requestToJoinPeersList}),_=S.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.present}),P=S.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.ask});l=[a].concat(l.sort(function(t,n){return t.id.localeCompare(n.id)})).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)});var v=[a].concat(s).filter(function(t){return null==t?void 0:t.webinarHiddenParticipant}).filter(function(t,n,i){return i.findIndex(function(n){return n.id===t.id})===n}),q=[a].concat(s).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)&&t.requestToJoinType===u.RequestToJoinType.ask});l=l.concat(q).filter((A=new Set,function(t){return!A.has(t.id)&&A.add(t.id)}));var A;var M=function(t,n){y.acceptAllRequestToJoinStage([{id:t,requestToJoinType:n,type:f.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT}])},W=function(t){y.rejectRequestToJoinStage(t)};return n.default.createElement(E.Flex,{mt:60,width:C},n.default.createElement(o.ScrollView,{style:{padding:20}},n.default.createElement(o.TouchableWithoutFeedback,null,n.default.createElement(E.Box,null,n.default.createElement(E.Box,{my:20},t===f.DyteViewTypes.webinar&&l.length>0&&n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mb:10},"Presenting (",l.length,")"),l.map(function(i){return n.default.createElement(R,{peer:i,key:i.id,mediaRoom:y,permissions:null==h?void 0:h.permissions,roomViewType:t})})),v.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Attending (",v.length,")"),v.map(function(i){return n.default.createElement(R,{key:i.id,peer:i,mediaRoom:y,permissions:null==h?void 0:h.permissions,roomViewType:t})})),P.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to ask Question (",P.length,")"),P.map(function(t){return n.default.createElement(w,{rejectRequest:W,acceptRequest:M,peer:t,key:t.id,type:"REQUEST_TO_ASK"})})),_.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to Present (",_.length,")"),_.map(function(t){return n.default.createElement(w,{rejectRequest:W,acceptRequest:M,peer:t,key:t.id,type:"REQUEST_TO_PRESENT"})})),n.default.createElement(E.Box,{height:200})))))};var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var i=h(n);if(i&&i.has(t))return i.get(t);var l={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(l,a,u):l[a]=t[a]}l.default=t,i&&i.set(t,l);return l})(r(d[1])),i=r(d[2]),l=t(r(d[3])),o=r(d[4]),a=t(r(d[5])),u=r(d[6]),c=r(d[7]),f=r(d[8]),s=t(r(d[9])),p=r(d[10]),E=r(d[11]),y=t(r(d[12])),x=r(d[13]),b=r(d[14]),T=r(d[15]);function h(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,i=new WeakMap;return(h=function(t){return t?i:n})(t)}function w(t){var o=t.rejectRequest,a=t.acceptRequest,u=t.peer,c=t.type,f=(0,n.useContext)(i.ThemeContext).colors;return n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+u.name,bgColor:f.primary[500]}),n.default.createElement(E.Text,{ml:10,color:f.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:u.name>30?u.name.substring(0,20)+"...":""+u.name,charSize:30}),u.isMe?' (me)':null)),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:6},n.default.createElement(E.Button,{onClick:function(){return a(u.id,c)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"check",fill:f.success[500]}))),n.default.createElement(E.Box,{ml:6},n.default.createElement(E.Button,{onClick:function(){return o(u.id)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"clear",fill:f.danger[500]})))))}function R(t){var o=t.peer,c=t.mediaRoom,p=t.permissions,x=t.roomViewType,T=(0,n.useContext)(i.ThemeContext).colors,h=(0,n.useContext)(b.ConfigServiceContext).participantControls,w=(null==p?void 0:p.pin_participant)||(null==p?void 0:p.can_allow_participant_audio)||(null==p?void 0:p.can_allow_participant_video)||(null==p?void 0:p.kick_participant),R=p.accept_present_requests,k=[];return(w||h.length>0)&&(null!=p&&p.pin_participant&&(o.isPinned?k.push({title:'Unpin',onClick:function(){return c.pin(null)}}):k.push({title:'Pin',onClick:function(){return c.pin(o.id)}})),null!=p&&p.can_allow_participant_audio&&k.push({title:'Mute Audio',onClick:function(){return c.disableAudio(o.id)}}),null!=p&&p.can_allow_participant_video&&k.push({title:'Disable Video',onClick:function(){return c.disableVideo(o.id)}}),null!=p&&p.kick_participant&&!o.isMe&&k.push({title:'Kick',onClick:function(){return c.kick(o.id)}}),x!==f.DyteViewTypes.webinar||o.isMe||!R||o.webinarHiddenParticipant||k.push({title:'Force Stop Presenting',onClick:function(){return c.removePeerFromStage(o.id,f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR)}}),x===f.DyteViewTypes.webinar&&!o.isMe&&R&&k.push({title:'Grant Premission to Present',onClick:function(){return c.acceptAllRequestToJoinStage([{id:o.id,requestToJoinType:u.RequestToJoinType.present,type:f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR}])}}),h.forEach(function(t){o.isMe&&!1===t.showSelf||k.push({title:t.label,onClick:function(){return t.onClick(o.id)}})}),k.push({title:'Cancel',onClick:function(){}})),n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+o.displayName,bgColor:T.primary[500]}),n.default.createElement(E.HStack,{ml:10,color:T.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:o.displayName.length>30?o.displayName.substring(0,20)+"...":""+o.displayName,charSize:30}),(o.isMe||o.label)&&n.default.createElement(E.Text,{background:"primary.300",color:"textPrimary.100",pr:4,ml:4,borderRadius:3},o.isMe?'me':o.label))),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:8},o.producingAudio?n.default.createElement(E.Icon,{boxSize:"xl",name:"mic",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"mic-off",fill:T.danger[500]})),o.producingVideo?n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam-off",fill:T.danger[500]}),(w||h.length>0)&&n.default.createElement(a.default,{options:k.map(function(t){return t.title}),actions:k.map(function(t){return t.onClick})})))}},801,[1,165,514,682,2,802,487,432,497,676,674,512,692,585,508,493]); __d(function(g,r,_i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var o={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=l?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o})(r(d[2])),o=r(d[3]),l=r(d[4]),i=r(d[5]),u=e(r(d[6]));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}var f=function(e){var c=(0,n.useRef)(),f=(0,n.useState)(!1),s=(0,t.default)(f,2),p=s[0],h=s[1],w=(0,n.useContext)(l.ThemeContext).colors,v=function(t){for(var n=e.options,o=0;o=0&&(n=e.destructiveIndex),o.ActionSheetIOS.showActionSheetWithOptions({options:t,destructiveButtonIndex:n,cancelButtonIndex:t.length-1},function(e){v(e)})}else'android'===o.Platform.OS&&o.UIManager.showPopupMenu((0,o.findNodeHandle)(c.current),t,function(){return console.log('something went wrong with the popup menu')},function(e,t){v(t)})}},n.default.createElement(i.Icon,{boxSize:"xl",ml:5,name:"dots-vertical",fill:w.textPrimary[300]}))),b)};_e.default=f},802,[1,41,165,2,514,512,676]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.stopRecording=e.startRecording=e.getActiveRecording=void 0;var n=t(r(d[1])),o=t(r(d[2]));e.startRecording=function(t){var s,c,u,p;return n.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,l.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/recording",{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:if(201===(p=l.sent).status){l.next=6;break}throw new Error('Recording failed to start');case 6:return l.abrupt("return",p.json());case 7:case"end":return l.stop()}},null,null,null,Promise)};e.stopRecording=function(t){var s,c,u,p,l;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,p=t.recordingId,f.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/recordings/"+p,{method:'PUT',body:JSON.stringify({recordingAction:'stop'}),headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:if(201===(l=f.sent).status){f.next=6;break}throw new Error('Recording failed to stop');case 6:return f.abrupt("return",l.json());case 7:case"end":return f.stop()}},null,null,null,Promise)};e.getActiveRecording=function(t){var s,c,u,p;return n.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,l.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/active-recording",{method:'GET',headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:return p=l.sent,l.abrupt("return",p.json());case 5:case"end":return l.stop()}},null,null,null,Promise)}},803,[1,67,504]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=b(n);if(o&&o.has(t))return o.get(t);var u={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var c=l?Object.getOwnPropertyDescriptor(t,s):null;c&&(c.get||c.set)?Object.defineProperty(u,s,c):u[s]=t[s]}u.default=t,o&&o.set(t,u);return u})(r(d[1])),o=r(d[2]),u=r(d[3]),l=r(d[4]),s=r(d[5]),c=r(d[6]),f=r(d[7]),p=r(d[8]),y=r(d[9]),T=t(r(d[10]));function b(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(b=function(t){return t?o:n})(t)}var x=function(t){var b=t.isMobile,x=(0,u.useSelector)(function(t){return t.room.roomViewType}),S=(0,u.useSelector)(function(t){return t.participant.requestToJoinStageState}),q=(0,n.useContext)(p.ThemeContext).colors,v=(0,n.useContext)(o.MediaRoomContext).mediaRoom,E=(0,u.useDispatch)(),R=(0,n.useContext)(y.ConfigServiceContext).sessionConfig,w=(0,c.useWindowDimensions)(),C=R.theme.dimensions||w,h=(C.height,C.width),O=x===s.DyteViewTypes.webinar&&S===l.RequestToJoinStageState.INITIATED;return n.default.createElement(f.Modal,{isVisible:O,backdropOpacity:.8,backdropColor:q.secondary[800]},n.default.createElement(f.Flex,{width:.9*h,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:T.default.medium},n.default.createElement(f.Flex,{pt:15},n.default.createElement(f.Text,{fontSize:28,fontWeight:"bold"},"Request")),n.default.createElement(f.Flex,{display:"flex",pb:20},n.default.createElement(f.Flex,{direction:b?'column':'row',justifyContent:"space-between"},n.default.createElement(f.Button,{onClick:function(){return t=l.RequestToJoinType.present,E((0,l.requestToJoinType)(t)),E((0,l.requestedJoinToStageState)(l.RequestToJoinStageState.WAITING)),v.requestToJoinStage(t),void c.Alert.alert('Request Sent',"Request to "+(t===l.RequestToJoinType.present?'present':'ask')+" has been sent successfully to host",[{text:'OK',onPress:function(){}}]);var t}},n.default.createElement(f.Box,{bg:"primary.500",py:12,px:20,mt:20,borderRadius:T.default.small,align:"center"},n.default.createElement(f.Text,null,"Request to Present"))),n.default.createElement(f.Button,{onClick:function(){E((0,l.requestedJoinToStageState)(l.RequestToJoinStageState.NONE)),E((0,l.requestToJoinType)(void 0))}},n.default.createElement(f.Box,{bg:"danger.500",py:12,px:20,mt:20,borderRadius:T.default.small,align:"center"},n.default.createElement(f.Text,null,"Cancel")))))))};e.default=x},804,[1,165,585,432,487,497,2,512,514,508,676]); diff --git a/Frameworks/ios-device.xcarchive/Products/usr/local/lib/libDyteLib.a b/Frameworks/ios-device.xcarchive/Products/usr/local/lib/libDyteLib.a index 08f4a8b..6cad164 100644 Binary files a/Frameworks/ios-device.xcarchive/Products/usr/local/lib/libDyteLib.a and b/Frameworks/ios-device.xcarchive/Products/usr/local/lib/libDyteLib.a differ diff --git a/Frameworks/ios-device.xcarchive/dSYMs/DyteSdk.framework.dSYM/Contents/Resources/DWARF/DyteSdk b/Frameworks/ios-device.xcarchive/dSYMs/DyteSdk.framework.dSYM/Contents/Resources/DWARF/DyteSdk index ddb8183..0fb8b29 100644 Binary files a/Frameworks/ios-device.xcarchive/dSYMs/DyteSdk.framework.dSYM/Contents/Resources/DWARF/DyteSdk and b/Frameworks/ios-device.xcarchive/dSYMs/DyteSdk.framework.dSYM/Contents/Resources/DWARF/DyteSdk differ diff --git a/Frameworks/ios-simulator.xcarchive/Info.plist b/Frameworks/ios-simulator.xcarchive/Info.plist index 7d75885..dd7c177 100644 --- a/Frameworks/ios-simulator.xcarchive/Info.plist +++ b/Frameworks/ios-simulator.xcarchive/Info.plist @@ -5,7 +5,7 @@ ArchiveVersion 2 CreationDate - 2022-07-28T08:06:31Z + 2022-09-13T08:25:54Z Name DyteSdk SchemeName diff --git a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/Info.plist b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/Info.plist index 9d6c04d..717b96c 100644 Binary files a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/Info.plist and b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/Info.plist differ diff --git a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeDirectory b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeDirectory index 8e3c5ed..51859de 100644 Binary files a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeDirectory and b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeDirectory differ diff --git a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeRequirements-1 b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeRequirements-1 index f031b55..c2420b3 100644 Binary files a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeRequirements-1 and b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/AccessibilityResources.bundle/_CodeSignature/CodeRequirements-1 differ diff --git a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/DyteSdk b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/DyteSdk index 493d9f5..c6843f8 100755 Binary files a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/DyteSdk and b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/DyteSdk differ diff --git a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/Info.plist b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/Info.plist index fd22a73..e90c04e 100644 Binary files a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/Info.plist and b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/Info.plist differ diff --git a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/_CodeSignature/CodeResources b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/_CodeSignature/CodeResources index 609efc9..20aaa75 100644 --- a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/_CodeSignature/CodeResources +++ b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/_CodeSignature/CodeResources @@ -6,11 +6,11 @@ AccessibilityResources.bundle/Info.plist - 8Mv/JNJCL+Y+ZCZM7YlfqAQV+Ng= + 55SKUTkC0l1mNuOot0EBlf6EVfg= AccessibilityResources.bundle/_CodeSignature/CodeDirectory - dVTaT/2g5gwmTpl7rSA7rnMmE40= + n2+JBnITskzfPAHzzXi1JgaKYkU= AccessibilityResources.bundle/_CodeSignature/CodeRequirements @@ -18,7 +18,7 @@ AccessibilityResources.bundle/_CodeSignature/CodeRequirements-1 - 4ZDXFVbm358V2Lx5xexb5/DXTmM= + sHpw2qzgrt++gOgniz/HTOs28Go= AccessibilityResources.bundle/_CodeSignature/CodeResources @@ -115,7 +115,7 @@ Info.plist - 5TnycXNJwvxuSOahurME/8c7aDw= + 1/orSH6zMN/5HEVzizCaR4RkV4s= Ionicons.ttf @@ -187,7 +187,7 @@ main.jsbundle - Pvq79LR8ccefFaymaMrz8E9LzZs= + 87sPFjppyVffJLr75AjHc/8rlIU= files2 @@ -196,14 +196,14 @@ hash2 - ZqK/9AgcITmVrqNjzmk1COKchxzJTXnBQaIiGm8Ev+s= + d93mZH1dxykgyf+nVJfZm+UHF4SnlkV6oUAAeMukwso= AccessibilityResources.bundle/_CodeSignature/CodeDirectory hash2 - KHRcVbvczHTiTHqABC4XWNnmNHRBwv6hT6H68P6PCXk= + YGrIOkAKukv8ekcnS3A2fXhUwQpFnLu6raIwjTrHrTA= AccessibilityResources.bundle/_CodeSignature/CodeRequirements @@ -217,7 +217,7 @@ hash2 - mBhQgvfczRsoD/t/hIDt+HiS3By6h3GbXpkvQIB8qGQ= + SFbu+7G7nux+Ez39BV/o/qBF2oatM1+T1oOPcTw9Uu8= AccessibilityResources.bundle/_CodeSignature/CodeResources @@ -499,7 +499,7 @@ hash2 - zTAiVLmzRfB9UaYELuC4GX/tAPLvPtlmgL9PF29ExJE= + 3ZfixYm2Hx0pBKBBaVywkhO3erLIWZF8X8OIP8Ey5/k= diff --git a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/main.jsbundle b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/main.jsbundle index cb13b3a..d09d228 100644 --- a/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/main.jsbundle +++ b/Frameworks/ios-simulator.xcarchive/Products/Library/Frameworks/DyteSdk.framework/main.jsbundle @@ -496,7 +496,7 @@ __d(function(g,r,_i,a,m,_e,d){'use strict';var e=r(d[0]);Object.defineProperty(_ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(d[0]),o=t.NativeModules,c=t.TurboModuleRegistry,l=r(d[1]),S=o.PlatformLocalStorage||o.RNC_AsyncSQLiteDBStorage||o.RNCAsyncStorage;!S&&l()&&(S=c?c.get('AsyncSQLiteDBStorage')||c.get('AsyncLocalStorage'):o.AsyncSQLiteDBStorage||o.AsyncLocalStorage);var n=S;e.default=n},490,[2,491]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]).NativeModules;m.exports=function(){var t,o,u=null==(t=n.NativeUnimoduleProxy)?void 0:null==(o=t.modulesConstants)?void 0:o.ExponentConstants;if(u&&(u.appOwnership&&!u.executionEnvironment||['storeClient','standalone'].includes(u.executionEnvironment)))return!0;return!1}},491,[2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.useAsyncStorage=function(t){return{getItem:function(){for(var u=arguments.length,f=new Array(u),o=0;o=0&&t<=1}),b=function(t){return t&&t.width>0&&t.height>0},D=.5,N=.5;e.withAnchorPoint=function(t,n,u){if(!w((s=n).x)||!w(s.y))return t;var s;if(!b(u))return t;var c=t.transform;if(!c)return t;if(n.x!==D&&u.width){var f=[];f.push({translateX:u.width*(n.x-D)}),(c=[].concat(f,(0,o.default)(c))).push({translateX:u.width*(D-n.x)})}if(!Array.isArray(c))return{transform:c};if(n.y!==N&&u.height){var l=[];l.push({translateY:u.height*(n.y-N)}),(c=[].concat(l,(0,o.default)(c))).push({translateY:u.height*(N-n.y)})}return{transform:c}};var y=function(){return'react native client'};e.browserName=y;var S=function(){return''};e.osName=S;var C=function(){return!0};e.isMobile=C;e.isChrome=function(){return!0};e.getDeviceInfo=function(){return{isMobile:!0,browserName:'react native client',osName:'',browserVersion:'react native client'}};e.isSafari=function(){return!1};e.isDesktopSafari=function(){return!1};e.useDisclosure=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=h(t),u=(0,n.default)(o,2),s=u[0],c=u[1];return{isOpen:s,onOpen:v(function(){return c(!0)},[]),onClose:v(function(){return c(!1)},[]),toggle:v(function(){return c(function(t){return!t})},[])}}},493,[1,41,49,165,494,496,2]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.browserName=void 0,e.default=function(t,o){var c=v(!1),f=(0,n.default)(c,2),h=f[0],l=f[1],p=o&&o.successDuration;return(0,u.useEffect)(function(){if(h&&p){var t=setTimeout(function(){l(!1)},p);return function(){clearTimeout(t)}}return function(){}},[h,p]),[h,function(){var n=(0,s.default)(t);l(n)}]},e.osName=e.isSafari=e.isMobile=e.isDesktopSafari=e.isChrome=e.getDeviceInfo=void 0,e.parseJwt=function(t){var n=t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/'),o=decodeURIComponent(c.default.decode(n).split('').map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(''));return JSON.parse(o)},e.useDisclosure=void 0,e.useScale=function(t){var n=t.width,o=t.height,u=f.Dimensions.get('screen').width,s=f.Dimensions.get('screen').height;return{width:Math.min(n,u),height:Math.min(o,s)}},e.withAnchorPoint=void 0;var n=t(r(d[1])),o=t(r(d[2])),u=r(d[3]),s=t(r(d[4])),c=t(r(d[5])),f=r(d[6]),h=r(d[3]),l=h.useCallback,v=h.useState,p=f.NativeModules.DyteHelper,w=(new f.NativeEventEmitter(p),function(t){return t>=0&&t<=1}),D=function(t){return t&&t.width>0&&t.height>0},b=.5,N=.5;e.withAnchorPoint=function(t,n,u){if(!w((s=n).x)||!w(s.y))return t;var s;if(!D(u))return t;var c=t.transform;if(!c)return t;if(n.x!==b&&u.width){var f=[];f.push({translateX:u.width*(n.x-b)}),(c=[].concat(f,(0,o.default)(c))).push({translateX:u.width*(b-n.x)})}if(!Array.isArray(c))return{transform:c};if(n.y!==N&&u.height){var h=[];h.push({translateY:u.height*(n.y-N)}),(c=[].concat(h,(0,o.default)(c))).push({translateY:u.height*(N-n.y)})}return{transform:c}};var y=function(){return'react native client'};e.browserName=y;var S=function(){return''};e.osName=S;var M=function(){return!0};e.isMobile=M;e.isChrome=function(){return!0};e.getDeviceInfo=function(){return{isMobile:!0,browserName:'react native client',osName:'',browserVersion:'react native client'}};e.isSafari=function(){return!1};e.isDesktopSafari=function(){return!1};e.useDisclosure=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=v(t),u=(0,n.default)(o,2),s=u[0],c=u[1];return{isOpen:s,onOpen:l(function(){return c(!0)},[]),onClose:l(function(){return c(!1)},[]),toggle:l(function(){return c(function(t){return!t})},[])}}},493,[1,41,49,165,494,496,2]); __d(function(g,r,i,a,m,_e,d){"use strict";var e=r(d[0]),t={"text/plain":"Text","text/html":"Url",default:"Text"},o="Copy to clipboard: #{key}, Enter";function n(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}m.exports=function(c,l){var s,p,u,y,f,b,w=!1;l||(l={}),s=l.debug||!1;try{if(u=e(),y=document.createRange(),f=document.getSelection(),(b=document.createElement("span")).textContent=c,b.style.all="unset",b.style.position="fixed",b.style.top=0,b.style.clip="rect(0, 0, 0, 0)",b.style.whiteSpace="pre",b.style.webkitUserSelect="text",b.style.MozUserSelect="text",b.style.msUserSelect="text",b.style.userSelect="text",b.addEventListener("copy",function(e){if(e.stopPropagation(),l.format)if(e.preventDefault(),void 0===e.clipboardData){s&&console.warn("unable to use e.clipboardData"),s&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=t[l.format]||t.default;window.clipboardData.setData(o,c)}else e.clipboardData.clearData(),e.clipboardData.setData(l.format,c);l.onCopy&&(e.preventDefault(),l.onCopy(e.clipboardData))}),document.body.appendChild(b),y.selectNodeContents(b),f.addRange(y),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");w=!0}catch(e){s&&console.error("unable to copy using execCommand: ",e),s&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(l.format||"text",c),l.onCopy&&l.onCopy(window.clipboardData),w=!0}catch(e){s&&console.error("unable to copy using clipboardData: ",e),s&&console.error("falling back to prompt"),p=n("message"in l?l.message:o),window.prompt(p,c)}}finally{f&&("function"==typeof f.removeRange?f.removeRange(y):f.removeAllRanges()),b&&document.body.removeChild(b),u()}return w}},494,[495]); __d(function(g,r,_i,a,m,e,d){m.exports=function(){var n=document.getSelection();if(!n.rangeCount)return function(){};for(var t=document.activeElement,o=[],u=0;u>2,o=(3&c)<<4|(h=n.charCodeAt(s++))>>4,A=(15&h)<<2|(u=n.charCodeAt(s++))>>6,l=63&u,isNaN(h)?A=l=64:isNaN(u)&&(l=64),f.push(t.charAt(i)+t.charAt(o)+t.charAt(A)+t.charAt(l)),c=h=u="",i=o=A=l=""}while(s>2,o=(3&c)<<4|(h=n[s++])>>4,A=(15&h)<<2|(u=n[s++])>>6,l=63&u,isNaN(h)?A=l=64:isNaN(u)&&(l=64),f.push(t.charAt(i)+t.charAt(o)+t.charAt(A)+t.charAt(l)),c=h=u="",i=o=A=l=""}while(s>18&63)+d.charAt(c>>12&63)+d.charAt(c>>6&63)+d.charAt(63&c);return 2==f?(n=t.charCodeAt(A)<<8,o=t.charCodeAt(++A),s+=d.charAt((c=n+o)>>10)+d.charAt(c>>4&63)+d.charAt(c<<2&63)+'='):1==f&&(c=t.charCodeAt(A),s+=d.charAt(c>>2)+d.charAt(c<<4&63)+'=='),s},decode:function(t){var n=(t=String(t).replace(f,'')).length;n%4==0&&(n=(t=t.replace(/==?$/,'')).length),(n%4==1||/[^+a-zA-Z0-9/]/.test(t))&&h('Invalid character: the string to be decoded is not correctly encoded.');for(var o,a,c=0,s='',A=-1;++A>(-2*c&6)));return s},version:'0.1.0'};if('function'==typeof define&&'object'==typeof define.amd&&define.amd)define(function(){return s});else if(n&&!n.nodeType)if(o)o.exports=s;else for(var A in s)s.hasOwnProperty(A)&&(n[A]=s[A]);else t.base64=s})(this)},577,[]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=_e.Logger=void 0;var t=e(r(d[1])),n=e(r(d[2])),o=e(r(d[3]));function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.getOwnPropertyNames(e).forEach(function(o){if(![null,void 0,NaN].includes(e[o])){var c=t?t+"."+o:o;'object'==typeof e[o]?l(e[o],c,n):n[c]=e[o]}}),n}var c=(function(){function e(){(0,n.default)(this,e),this.level=3}return(0,o.default)(e,[{key:"process",value:function(e){var t={};try{Object.getOwnPropertyNames(e||{}).forEach(function(n){try{t[n]=JSON.stringify(e[n])}catch(e){t[n]='Failed to stringify'}})}catch(e){}return t}},{key:"init",value:function(e){'trace'===e?this.level=3:'log'===e?this.level=2:'error'===e&&(this.level=1)}},{key:"trace",value:function(t,n){e.addEventInCurrentSpan('warn',t,n,!0)}},{key:"warn",value:function(t,n){e.addEventInCurrentSpan('warn',t,n,!0)}},{key:"error",value:function(t,n){e.addEventInCurrentSpan('error',t,n,!0)}}],[{key:"addEventInCurrentSpan",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'info',o=arguments.length>1?arguments[1]:void 0,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;try{var s=l(c,'metadata'),v=(0,t.default)({message:o,logSeverity:n},s,{loggedAt:(new Date).getTime()});u?e.sendOtelLogsToNewRelic(e.logsCache.splice(0,25).concat([v])):e.logsCache.push(v)}catch(e){console.debug('opentelemetry::addEventInCurrentSpan_failed',e)}}},{key:"sendOtelLogsToNewRelic",value:function(t){fetch('https://api-silos.dyte.io/otel/logs',{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json'},body:JSON.stringify({meetingMetadata:l(e.meetingMetadata,'meetingMetadata'),serviceName:'mobile-sdk',logs:t})}).catch(function(e){console.debug('opentelemetry::sendOtelLogToNewRelic_failed',e)})}}]),e})();_e.Logger=c,c.logsCache=[],c.meetingMetadata={};var u=new c;_e.default=u},578,[1,22,9,10]); -__d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.UserTrackContext=void 0,e.default=function(t){var T,P,E,w=(0,c.useState)(),A=(0,o.default)(w,2),b=A[0],N=A[1],k=(0,c.useState)([]),M=(0,o.default)(k,2),O=M[0],x=M[1],D=(0,c.useState)(),C=(0,o.default)(D,2),y=C[0],V=C[1],_=(0,c.useState)([]),R=(0,o.default)(_,2),G=R[0],L=R[1],B=(0,c.useState)(),j=(0,o.default)(B,2),W=j[0],F=j[1],q=(0,c.useState)(),H=(0,o.default)(q,2),U=H[0],J=H[1],Q=(0,c.useRef)(null),K=(0,c.useRef)(null),z=(0,c.useRef)(null),X=(0,c.useRef)(null),Y=(0,c.useContext)(v.ConfigServiceContext),Z=(Y.meeting,Y.sessionConfig),$=Z.permissions.produce.audio,ee=Z.permissions.produce.video,te=Z.permissions.produce.video,ne=ee.allow,re=(0,l.getWebcamConstraints)(ee.quality,ee.frame_rate),ae=((0,l.getScreenShareConstraints)(te.quality,te.frame_rate),t.children),ue=(0,d.useSelector)(function(t){return t.participant.audioMuted}),ie=(0,d.useSelector)(function(t){return t.participant.videoOff}),oe=(0,d.useSelector)(function(t){return t.room.producersState}),ce=(0,d.useSelector)(function(t){return t.participant.switched}),de=(0,d.useSelector)(function(t){return t.participant.canPresent}),se=(0,d.useSelector)(function(t){return t.participant.presentingState}),le=(0,d.useSelector)(function(t){return t.participant.audioTrackSelection}),fe=(0,d.useSelector)(function(t){return t.participant.videoTrackSelection}),ve=(0,d.useSelector)(function(t){return t.participant.videoProduction}),pe=(0,d.useSelector)(function(t){return t.participant.audioProduction}),Se=(0,d.useSelector)(function(t){return t.participant.presentingState}),Te=(oe===s.MediaStates.NOT_APPLICABLE||ve===s.MediaStates.LOADED||ve===s.MediaStates.NOT_STARTED||ve===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&ne,Ie=(oe===s.MediaStates.NOT_APPLICABLE||pe===s.MediaStates.LOADED||pe===s.MediaStates.NOT_STARTED||pe===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&$,Pe=(0,d.useDispatch)(),Ee=c.default.useState([]),he=(0,o.default)(Ee,2),me=he[0],we=he[1],Ae=function(t){we(t)},ge=(0,d.useSelector)(function(t){return t.room.roomViewType}),be=(0,d.useSelector)(function(t){return t.participant.requestToJoinType}),Ne=(0,d.useSelector)(function(t){return t.room.routerState});ge===S.DyteViewTypes.webinar&&be===f.RequestToJoinType.ask&&(re=(0,l.getWebcamConstraints)('QQVGA',null==(T=Z.permissions)?void 0:null==(P=T.produce)?void 0:null==(E=P.video)?void 0:E.frame_rate));(0,c.useEffect)(function(){Q.current=y,K.current=W,z.current=U,X.current=b},[y,W,U,b]),(0,c.useEffect)(function(){I.default.trace('audioMuted_useEffect',{audioMuted:ue,presentingState:se}),b&&(b.enabled=!ue),ge===S.DyteViewTypes.webinar&&se!==f.PresentingState.PRESENTING||Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING))},[ue,se]);var ke=function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,I.default.trace('initialAudioStreamFetch'),t=null,u.prev=3,u.next=6,n.default.awrap((0,l.getAudioTrack)());case 6:t=u.sent,u.next=13;break;case 9:if(u.prev=9,u.t0=u.catch(3),'NotAllowedError'!==u.t0.name){u.next=13;break}throw new Error('No audio permission');case 13:if(t){u.next=15;break}throw new Error('No audio track');case 15:$&&N(t),u.next=23;break;case 18:u.prev=18,u.t1=u.catch(0),I.default.error('initialAudioStreamFetch',u.t1),Pe((0,f.setAudioProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setAudioMuted)(!0));case 23:case"end":return u.stop()}},null,null,[[0,18],[3,9]],Promise)},Me=function(t){if(I.default.trace('setAudioDevice',{audioTrack:!!b}),b&&b.stop(),$){var u=(null==t?void 0:t.deviceId)||(null==le?void 0:le.selectedDeviceId);(0,d.batch)(function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(ke());case 2:Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING)),(null==le?void 0:le.selectedDeviceId)!==u&&Pe((0,f.setAudioTrackSelection)({selectedDeviceId:u}));case 4:case"end":return t.stop()}},null,null,null,Promise)})}else Pe((0,f.setAudioMuted)(!0))},Oe=function(){var t,u,o,c;return n.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return d.prev=0,I.default.trace('initialVideoStreamFetch'),d.next=4,n.default.awrap((0,l.getAllVideoDevices)());case 4:return t=d.sent,u=t.filter(function(t){return'front'===t.facing}),o=u.length>0?u[0]:t[0],c=null,d.prev=8,d.next=11,n.default.awrap((0,l.getVideoTrack)(o.deviceId||'',re));case 11:c=d.sent,d.next=18;break;case 14:if(d.prev=14,d.t0=d.catch(8),'NotAllowedError'!==d.t0.name){d.next=18;break}throw new Error('No video permission');case 18:if(c){d.next=20;break}throw new Error('No video track');case 20:if(ne&&V(c),''!==o.label){d.next=25;break}return d.next=24,n.default.awrap((0,l.getAllVideoDevices)());case 24:t=d.sent;case 25:L(t),Pe((0,f.setVideoTrackSelection)({selectedDeviceId:o.deviceId})),d.next=34;break;case 29:d.prev=29,d.t1=d.catch(0),I.default.error('initialVideoStreamFetch',d.t1),Pe((0,f.setVideoProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setVideoOff)(!0));case 34:case"end":return d.stop()}},null,null,[[0,29],[8,14]],Promise)},xe=function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(I.default.trace('setVideoDevice'),u=(null==t?void 0:t.deviceId)||(null==fe?void 0:fe.selectedDeviceId),ne){o.next=5;break}return Pe((0,f.setVideoOff)(!0)),o.abrupt("return");case 5:(0,d.batch)(function(){Pe((0,f.setVideoOff)(!1)),Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),(null==fe?void 0:fe.selectedDeviceId)!==u&&Pe((0,f.setVideoTrackSelection)({selectedDeviceId:u}))}),setTimeout(function(){var t;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return y&&y.stop(),o.next=3,n.default.awrap((0,l.getVideoTrack)(u,re));case 3:t=o.sent,V(t);case 5:case"end":return o.stop()}},null,null,null,Promise)});case 7:case"end":return o.stop()}},null,null,null,Promise)};(0,c.useEffect)(function(){ge===S.DyteViewTypes.webinar&&Ne===s.MediaStates.LOADED&&Se===f.PresentingState.NOT_PRESENTING?(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.STOPPING)),Pe((0,f.setAudioProduction)(s.MediaStates.STOPPING)),Pe((0,f.setVideoOff)(!0)),Pe((0,f.setAudioMuted)(!0)),setTimeout(function(){y&&y.stop(),b&&b.stop(),N(void 0),V(void 0)})}):Se===f.PresentingState.INITIATED&&(Oe().then(xe),Me())},[Ne,Se]),(0,c.useEffect)(function(){p.default.start({media:'video'});var t=new l.AudioDevicesEmitter(Ae);return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:Q.current&&Q.current.stop(),X.current&&X.current.stop(),K.current&&K.current.stop(),z.current&&z.current.stop();case 4:case"end":return t.stop()}},null,null,null,Promise),function(){t.removeListener()}},[]),c.default.useEffect(function(){ne||(Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&(y.stop(),V(void 0),(0,f.setVideoProduction)(s.MediaStates.CONNECTING))}))},[ne,y]),(0,c.useEffect)(function(){ve===s.MediaStates.NOT_STARTED&&setTimeout(function(){y&&(y.stop(),V(void 0))})},[ve]);var De=function(){(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&y.stop(),V(void 0)})})};(0,c.useEffect)(function(){$||Pe((0,f.setAudioMuted)(!0)),ne||De()},[$,ne]),(0,c.useEffect)(function(){'meeting'===ce?ie||De():'webinar'===ce&&(de||(ue||Pe((0,f.setAudioMuted)(!0)),ie||De()))},[ce]);var Ce=function(){var t,u,o,c,d=arguments;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(t=d.length>0&&void 0!==d[0]?d[0]:null,I.default.trace('changeAudioTrack',{selectedDevice:t}),!(me.length>0)){s.next=10;break}return u={},o={deviceId:null,InCallManagerId:null,device:null},t?(c=t.deviceId,u[c]=t):me.forEach(function(t){var n=t.deviceId;u[n]=t}),u.bluetooth?o={deviceId:'bluetooth',InCallManagerId:'BLUETOOTH',device:u.bluetooth}:u.wired?o={deviceId:'wired',InCallManagerId:'WIRED_HEADSET',device:u.wired}:u.speaker&&(o={deviceId:'speaker',InCallManagerId:'SPEAKER_PHONE',device:u.speaker}),s.next=9,n.default.awrap(p.default.chooseAudioRoute(o.InCallManagerId));case 9:Me(o.device);case 10:case"end":return s.stop()}},null,null,null,Promise)};(0,l.setOnDeviceChange)(function(){var t,o,c,d,s,f,v;return n.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.default.awrap((0,l.getAllVideoDevices)());case 2:if(t=p.sent,o=(0,u.default)(me).find(function(t){return!O.map(function(t){return t.deviceId}).includes(t.deviceId)}),x(me),c=t.find(function(t){return!G.map(function(t){return t.deviceId}).includes(t.deviceId)}),L(t),ue||!o){p.next=10;break}return Me(o),p.abrupt("return");case 10:if(ie||!c){p.next=13;break}return xe(c),p.abrupt("return");case 13:d=!me.map(function(t){return t.deviceId}).includes(null==le?void 0:le.selectedDeviceId),s=!t.map(function(t){return t.deviceId}).includes(null==fe?void 0:fe.selectedDeviceId),ue||void 0!==b&&!d||(f=me[0],Me(f)),ie||void 0!==y&&!s||(v=t[0],xe(v));case 17:case"end":return p.stop()}},null,null,null,Promise)}),(0,c.useEffect)(function(){Ce(void 0),x(me)},[me.length]);var ye={mediaTracks:{webcamTrack:y,setWebcamTrack:V,audioTrack:b,setAudioTrack:N,screenShareVideoTrack:W,setScreenShareVideoTrack:F,screenShareAudioTrack:U,setScreenShareAudioTrack:J},inputDevices:{audioInputDevices:O,videoInputDevices:G,setAudioInputDevices:x,setVideoInputDevices:L,setAudioDevice:Me,setVideoDevice:xe,toggleAudioState:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleAudioState',{audioButtonsEnabled:Ie,audioAllowed:$,audioMuted:ue,audioTrack:!!b}),Ie){t.next=3;break}return t.abrupt("return");case 3:$?ue?(b&&'ended'!==(null==b?void 0:b.readyState)||Me(void 0),Pe((0,f.setAudioMuted)(!1))):Pe((0,f.setAudioMuted)(!0)):ue||Pe((0,f.setAudioMuted)(!0));case 4:case"end":return t.stop()}},null,null,null,Promise)},toggleVideoState:function(t){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleVideoState',{videoButtonsEnabled:Te,videoOff:ie}),Te){t.next=3;break}return t.abrupt("return");case 3:ie?xe():De();case 4:case"end":return t.stop()}},null,null,null,Promise)},onAudioInputChange:function(t){var u;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:I.default.trace('onAudioInputChange',{value:t}),u=O.find(function(n){return n.deviceId===t}),Ce(u);case 3:case"end":return n.stop()}},null,null,null,Promise)},onVideoInputChange:function(t){I.default.trace('onVideoInputChange',{value:t});var n=G.find(function(n){return n.deviceId===t});Pe((0,f.setCameraFacing)(n.facing)),xe(n)}},setupStreams:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(Oe());case 2:return t.next=4,n.default.awrap(ke());case 4:case"end":return t.stop()}},null,null,null,Promise)},videoButtonsEnabled:Te,audioButtonsEnabled:Ie};return c.default.createElement(h.Provider,{value:ye},ae)};var n=t(r(_d[1])),u=t(r(_d[2])),o=t(r(_d[3])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=P(n);if(u&&u.has(t))return u.get(t);var o={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in t)if("default"!==d&&Object.prototype.hasOwnProperty.call(t,d)){var s=c?Object.getOwnPropertyDescriptor(t,d):null;s&&(s.get||s.set)?Object.defineProperty(o,d,s):o[d]=t[d]}o.default=t,u&&u.set(t,o);return o})(r(_d[4])),d=r(_d[5]),s=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=r(_d[9]),p=t(r(_d[10])),S=r(_d[11]),T=r(_d[12]),I=t(r(_d[13]));function P(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(P=function(t){return t?u:n})(t)}var E=T.NativeModules.InCallManager,h=(new T.NativeEventEmitter(E),(0,c.createContext)(null));e.UserTrackContext=h},579,[1,67,49,41,165,432,480,580,487,508,583,482,2,578]); +__d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.UserTrackContext=void 0,e.default=function(t){var T,P,E,h=(0,c.useState)(),A=(0,o.default)(h,2),b=A[0],N=A[1],k=(0,c.useState)([]),D=(0,o.default)(k,2),M=D[0],O=D[1],x=(0,c.useState)(),C=(0,o.default)(x,2),y=C[0],V=C[1],_=(0,c.useState)([]),R=(0,o.default)(_,2),G=R[0],L=R[1],B=(0,c.useState)(),j=(0,o.default)(B,2),W=j[0],F=j[1],q=(0,c.useState)(),H=(0,o.default)(q,2),U=H[0],J=H[1],Q=(0,c.useRef)(null),K=(0,c.useRef)(null),z=(0,c.useRef)(null),X=(0,c.useRef)(null),Y=(0,c.useContext)(v.ConfigServiceContext),Z=(Y.meeting,Y.sessionConfig),$=Z.permissions.produce.audio,ee=Z.permissions.produce.video,te=Z.permissions.produce.video,ne=ee.allow,re=(0,l.getWebcamConstraints)(ee.quality,ee.frame_rate),ae=((0,l.getScreenShareConstraints)(te.quality,te.frame_rate),t.children),ue=(0,d.useSelector)(function(t){return t.participant.audioMuted}),ie=(0,d.useSelector)(function(t){return t.participant.videoOff}),oe=(0,d.useSelector)(function(t){return t.room.producersState}),ce=(0,d.useSelector)(function(t){return t.participant.switched}),de=(0,d.useSelector)(function(t){return t.participant.canPresent}),se=(0,d.useSelector)(function(t){return t.participant.presentingState}),le=(0,d.useSelector)(function(t){return t.participant.audioTrackSelection}),fe=(0,d.useSelector)(function(t){return t.participant.videoTrackSelection}),ve=(0,d.useSelector)(function(t){return t.participant.videoProduction}),pe=(0,d.useSelector)(function(t){return t.participant.audioProduction}),Se=(0,d.useSelector)(function(t){return t.participant.presentingState}),Te=(oe===s.MediaStates.NOT_APPLICABLE||ve===s.MediaStates.LOADED||ve===s.MediaStates.NOT_STARTED||ve===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&ne,Ie=(oe===s.MediaStates.NOT_APPLICABLE||pe===s.MediaStates.LOADED||pe===s.MediaStates.NOT_STARTED||pe===s.MediaStates.STOPPING&&Se!==f.PresentingState.NOT_PRESENTING)&&$,Pe=(0,d.useDispatch)(),Ee=c.default.useState([]),me=(0,o.default)(Ee,2),we=me[0],he=me[1],Ae=function(t){he(t)},ge=(0,d.useSelector)(function(t){return t.room.roomViewType}),be=(0,d.useSelector)(function(t){return t.participant.requestToJoinType}),Ne=(0,d.useSelector)(function(t){return t.room.routerState});ge===S.DyteViewTypes.webinar&&be===f.RequestToJoinType.ask&&(re=(0,l.getWebcamConstraints)('QQVGA',null==(T=Z.permissions)?void 0:null==(P=T.produce)?void 0:null==(E=P.video)?void 0:E.frame_rate));(0,c.useEffect)(function(){Q.current=y,K.current=W,z.current=U,X.current=b},[y,W,U,b]),(0,c.useEffect)(function(){I.default.trace('audioMuted_useEffect',{audioMuted:ue,presentingState:se}),b&&(b.enabled=!ue),ge===S.DyteViewTypes.webinar&&se!==f.PresentingState.PRESENTING||Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING))},[ue,se]);var ke=function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,I.default.trace('initialAudioStreamFetch'),t=null,u.prev=3,u.next=6,n.default.awrap((0,l.getAudioTrack)());case 6:t=u.sent,u.next=13;break;case 9:if(u.prev=9,u.t0=u.catch(3),'NotAllowedError'!==u.t0.name){u.next=13;break}throw new Error('No audio permission');case 13:if(t){u.next=15;break}throw new Error('No audio track');case 15:$&&N(t),u.next=23;break;case 18:u.prev=18,u.t1=u.catch(0),I.default.error('initialAudioStreamFetch',u.t1),Pe((0,f.setAudioProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setAudioMuted)(!0));case 23:case"end":return u.stop()}},null,null,[[0,18],[3,9]],Promise)},De=function(t){if(I.default.trace('setAudioDevice',{audioTrack:!!b}),b&&b.stop(),$){var u=(null==t?void 0:t.deviceId)||(null==le?void 0:le.selectedDeviceId);(0,d.batch)(function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(ke());case 2:Pe((0,f.setAudioProduction)(s.MediaStates.CONNECTING)),(null==le?void 0:le.selectedDeviceId)!==u&&Pe((0,f.setAudioTrackSelection)({selectedDeviceId:u}));case 4:case"end":return t.stop()}},null,null,null,Promise)})}else Pe((0,f.setAudioMuted)(!0))},Me=function(){var t,u,o,c;return n.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:return d.prev=0,I.default.trace('initialVideoStreamFetch'),d.next=4,n.default.awrap((0,l.getAllVideoDevices)());case 4:return t=d.sent,u=t.filter(function(t){return'front'===t.facing}),o=u.length>0?u[0]:t[0],c=null,d.prev=8,d.next=11,n.default.awrap((0,l.getVideoTrack)(o.deviceId||'',re));case 11:c=d.sent,d.next=18;break;case 14:if(d.prev=14,d.t0=d.catch(8),'NotAllowedError'!==d.t0.name){d.next=18;break}throw new Error('No video permission');case 18:if(c){d.next=20;break}throw new Error('No video track');case 20:if(ne&&V(c),''!==o.label){d.next=25;break}return d.next=24,n.default.awrap((0,l.getAllVideoDevices)());case 24:t=d.sent;case 25:L(t),Pe((0,f.setVideoTrackSelection)({selectedDeviceId:o.deviceId})),d.next=34;break;case 29:d.prev=29,d.t1=d.catch(0),I.default.error('initialVideoStreamFetch',d.t1),Pe((0,f.setVideoProduction)(s.MediaStates.NOT_APPLICABLE)),Pe((0,f.setVideoOff)(!0));case 34:case"end":return d.stop()}},null,null,[[0,29],[8,14]],Promise)},Oe=function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(I.default.trace('setVideoDevice'),u=(null==t?void 0:t.deviceId)||(null==fe?void 0:fe.selectedDeviceId),ne){o.next=5;break}return Pe((0,f.setVideoOff)(!0)),o.abrupt("return");case 5:(0,d.batch)(function(){Pe((0,f.setVideoOff)(!1)),Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),(null==fe?void 0:fe.selectedDeviceId)!==u&&Pe((0,f.setVideoTrackSelection)({selectedDeviceId:u}))}),setTimeout(function(){var t;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return y&&y.stop(),o.next=3,n.default.awrap((0,l.getVideoTrack)(u,re));case 3:t=o.sent,V(t);case 5:case"end":return o.stop()}},null,null,null,Promise)});case 7:case"end":return o.stop()}},null,null,null,Promise)};(0,c.useEffect)(function(){ge===S.DyteViewTypes.webinar&&Ne===s.MediaStates.LOADED&&Se===f.PresentingState.NOT_PRESENTING?(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.STOPPING)),Pe((0,f.setAudioProduction)(s.MediaStates.STOPPING)),Pe((0,f.setVideoOff)(!0)),Pe((0,f.setAudioMuted)(!0)),setTimeout(function(){y&&y.stop(),b&&b.stop(),N(void 0),V(void 0)})}):Se===f.PresentingState.INITIATED&&(Me().then(Oe),De())},[Ne,Se]),(0,c.useEffect)(function(){p.default.start({media:'video'});var t=new l.AudioDevicesEmitter(Ae);return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:Q.current&&Q.current.stop(),X.current&&X.current.stop(),K.current&&K.current.stop(),z.current&&z.current.stop();case 4:case"end":return t.stop()}},null,null,null,Promise),function(){t.removeListener()}},[]),c.default.useEffect(function(){ne||(Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&(y.stop(),V(void 0),(0,f.setVideoProduction)(s.MediaStates.CONNECTING))}))},[ne,y]),(0,c.useEffect)(function(){ve===s.MediaStates.NOT_STARTED&&setTimeout(function(){y&&(y.stop(),V(void 0))})},[ve]);var xe=function(){(0,d.batch)(function(){Pe((0,f.setVideoProduction)(s.MediaStates.CONNECTING)),Pe((0,f.setVideoOff)(!0)),setTimeout(function(){y&&y.stop(),V(void 0)})})};(0,c.useEffect)(function(){$||Pe((0,f.setAudioMuted)(!0)),ne||xe()},[$,ne]),(0,c.useEffect)(function(){'meeting'===ce?ie||xe():'webinar'===ce&&(de||(ue||Pe((0,f.setAudioMuted)(!0)),ie||xe()))},[ce]);var Ce=function(){var t,u,o,c,d=arguments;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(t=d.length>0&&void 0!==d[0]?d[0]:null,I.default.trace('changeAudioTrack',{selectedDevice:t,audioDevices:we}),!(we.length>0)){s.next=10;break}return u={},o={deviceId:null,InCallManagerId:null,device:null},t?(c=t.deviceId,u[c]=t):we.forEach(function(t){var n=t.deviceId;u[n]=t}),u.wired?o={deviceId:'wired',InCallManagerId:'WIRED_HEADSET',device:u.wired}:u.bluetooth?o={deviceId:'bluetooth',InCallManagerId:'BLUETOOTH',device:u.bluetooth}:u.speaker&&(o={deviceId:'speaker',InCallManagerId:'SPEAKER_PHONE',device:u.speaker}),s.next=9,n.default.awrap(p.default.chooseAudioRoute(o.InCallManagerId));case 9:De(o.device);case 10:case"end":return s.stop()}},null,null,null,Promise)};(0,l.setOnDeviceChange)(function(){var t,o,c,d,s,f,v;return n.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.default.awrap((0,l.getAllVideoDevices)());case 2:if(t=p.sent,o=(0,u.default)(we).find(function(t){return!M.map(function(t){return t.deviceId}).includes(t.deviceId)}),O(we),c=t.find(function(t){return!G.map(function(t){return t.deviceId}).includes(t.deviceId)}),L(t),ue||!o){p.next=10;break}return De(o),p.abrupt("return");case 10:if(ie||!c){p.next=13;break}return Oe(c),p.abrupt("return");case 13:d=!we.map(function(t){return t.deviceId}).includes(null==le?void 0:le.selectedDeviceId),s=!t.map(function(t){return t.deviceId}).includes(null==fe?void 0:fe.selectedDeviceId),ue||void 0!==b&&!d||(f=we[0],De(f)),ie||void 0!==y&&!s||(v=t[0],Oe(v));case 17:case"end":return p.stop()}},null,null,null,Promise)}),(0,c.useEffect)(function(){Ce(void 0),O(we)},[we]);var ye={mediaTracks:{webcamTrack:y,setWebcamTrack:V,audioTrack:b,setAudioTrack:N,screenShareVideoTrack:W,setScreenShareVideoTrack:F,screenShareAudioTrack:U,setScreenShareAudioTrack:J},inputDevices:{audioInputDevices:M,videoInputDevices:G,setAudioInputDevices:O,setVideoInputDevices:L,setAudioDevice:De,setVideoDevice:Oe,toggleAudioState:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleAudioState',{audioButtonsEnabled:Ie,audioAllowed:$,audioMuted:ue,audioTrack:!!b}),Ie){t.next=3;break}return t.abrupt("return");case 3:$?ue?(b&&'ended'!==(null==b?void 0:b.readyState)||De(void 0),Pe((0,f.setAudioMuted)(!1))):Pe((0,f.setAudioMuted)(!0)):ue||Pe((0,f.setAudioMuted)(!0));case 4:case"end":return t.stop()}},null,null,null,Promise)},toggleVideoState:function(t){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(I.default.trace('toggleVideoState',{videoButtonsEnabled:Te,videoOff:ie}),Te){t.next=3;break}return t.abrupt("return");case 3:ie?Oe():xe();case 4:case"end":return t.stop()}},null,null,null,Promise)},onAudioInputChange:function(t){var u;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:I.default.trace('onAudioInputChange',{value:t}),u=M.find(function(n){return n.deviceId===t}),Ce(u);case 3:case"end":return n.stop()}},null,null,null,Promise)},onVideoInputChange:function(t){I.default.trace('onVideoInputChange',{value:t});var n=G.find(function(n){return n.deviceId===t});Pe((0,f.setCameraFacing)(n.facing)),Oe(n)}},setupStreams:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(Me());case 2:return t.next=4,n.default.awrap(ke());case 4:case"end":return t.stop()}},null,null,null,Promise)},videoButtonsEnabled:Te,audioButtonsEnabled:Ie};return c.default.createElement(w.Provider,{value:ye},ae)};var n=t(r(_d[1])),u=t(r(_d[2])),o=t(r(_d[3])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=P(n);if(u&&u.has(t))return u.get(t);var o={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in t)if("default"!==d&&Object.prototype.hasOwnProperty.call(t,d)){var s=c?Object.getOwnPropertyDescriptor(t,d):null;s&&(s.get||s.set)?Object.defineProperty(o,d,s):o[d]=t[d]}o.default=t,u&&u.set(t,o);return o})(r(_d[4])),d=r(_d[5]),s=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=r(_d[9]),p=t(r(_d[10])),S=r(_d[11]),T=r(_d[12]),I=t(r(_d[13]));function P(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(P=function(t){return t?u:n})(t)}var E=T.NativeModules.InCallManager,w=(new T.NativeEventEmitter(E),(0,c.createContext)(null));e.UserTrackContext=w},579,[1,67,49,41,165,432,480,580,487,508,583,482,2,578]); __d(function(g,r,i,a,m,e,_d){var t=r(_d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.setOnDeviceChange=e.getWebcamConstraints=e.getVideoTrack=e.getSpeakerTrack=e.getScreenShareConstraints=e.getScreenShare=e.getQualityAfterLegacyModeShift=e.getAudioTrack=e.getAllVideoDevices=e.getAllMediaDevices=e.AudioDevicesEmitter=void 0;var n=t(r(_d[1])),u=t(r(_d[2])),c=t(r(_d[3])),o=t(r(_d[4])),s=r(_d[5]),d=r(_d[6]),l=r(_d[7]),f=r(_d[8]),v=t(r(_d[9])),h=l.NativeModules.InCallManager,D=new l.NativeEventEmitter(h),p=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.enumerateDevices());case 2:return t=n.sent,n.abrupt("return",t);case 4:case"end":return n.stop()}},null,null,null,Promise)};e.getAllMediaDevices=p;var w=(function(){function t(n){if((0,u.default)(this,t),!n)throw new Error('Callback not initalized');this.callback=n,this.notConnected={connected:!1,haveMic:!1},this.connectedWithMic={connected:!0,haveMic:!0},this.connectedWithoutMic={connected:!0,haveMic:!1};var c=(0,d.getHeadset)();this.audioDevices={speaker:this.connectedWithMic,bluetooth:c?this.connectedWithMic:this.notConnected,wired:this.notConnected},this.checkIfWiredHeadphonesConnected(),this.onBluetoothEvent(),this.onWiredHeadsetEvent(),this.emit(),this.wiredHeadListener=null}return(0,c.default)(t,[{key:"checkIfWiredHeadphonesConnected",value:function(){var t;return o.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,o.default.awrap(v.default.getIsWiredHeadsetPluggedIn());case 2:t=u.sent,this.audioDevices=(0,n.default)({},this.audioDevices,{wired:t?this.connectedWithMic:this.notConnected}),this.emit();case 5:case"end":return u.stop()}},null,this,null,Promise)}},{key:"onBluetoothEvent",value:function(){var t=this;(0,d.addListener)(function(u){var c=t.audioDevices.bluetooth.connected;u&&!c?(t.audioDevices=(0,n.default)({},t.audioDevices,{bluetooth:(0,n.default)({},t.connectedWithMic)}),t.emit()):!u&&c&&(t.audioDevices=(0,n.default)({},t.audioDevices,{bluetooth:(0,n.default)({},t.notConnected)}),t.emit())})}},{key:"onWiredHeadsetEvent",value:function(){var t=this;this.wiredHeadListener=D.addListener('WiredHeadset',function(u){if(u){var c=u.isPlugged,o=u.hasMic,s=t.audioDevices.wired.connected;if(c&&!s){var d=o?(0,n.default)({},t.connectedWithMic):(0,n.default)({},t.connectedWithoutMic);t.audioDevices=(0,n.default)({},t.audioDevices,{wired:d}),t.emit()}else!c&&s&&(t.audioDevices=(0,n.default)({},t.audioDevices,{wired:(0,n.default)({},t.notConnected)}),t.emit())}})}},{key:"getAudioDevices",value:function(){return this.formatAudioDevices()}},{key:"formatAudioDevices",value:function(){var t=this;return Object.keys(this.audioDevices).map(function(u){var c=t.audioDevices[u];return(0,n.default)({},c,{deviceId:u,label:u,kind:'audioinput'})}).filter(function(t){return t.connected})}},{key:"emit",value:function(){this.callback(this.formatAudioDevices())}},{key:"removeListener",value:function(){var t;null==(t=this.wiredHeadListener)||t.remove()}}]),t})();e.AudioDevicesEmitter=w;e.getAllVideoDevices=function(){var t,n;return o.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return t={},u.next=3,o.default.awrap(p());case 3:return n=u.sent,u.abrupt("return",n.filter(function(n){return'videoinput'===n.kind&&!t[n.facing]&&(t[n.facing]=!0,n)}));case 5:case"end":return u.stop()}},null,null,null,Promise)};e.getWebcamConstraints=function(t,n){var u=f.VIDEO_CONSTRAINS[t.toLowerCase()];if(!u)throw new Error('Invalid quality');if(n){if(n<5||n>30)throw new Error('Invalid framerate');u.frameRate={ideal:n}}return u};e.getScreenShareConstraints=function(t,n){var u=f.VIDEO_CONSTRAINS_SCREENSHARE[t.toLowerCase()||'vga'];if(!u)throw new Error('Invalid quality');if(n){if(n<5||n>30)throw new Error('Invalid framerate');u.frameRate={max:n}}return u};e.getVideoTrack=function(t,u){var c,d;return o.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return c=u||f.VIDEO_CONSTRAINS.vga,l.next=3,o.default.awrap(s.mediaDevices.getUserMedia({video:(0,n.default)({deviceId:t||'',frameRate:24},c),audio:!1}));case 3:return d=l.sent,l.abrupt("return",d.getVideoTracks()[0]);case 5:case"end":return l.stop()}},null,null,null,Promise)};e.getAudioTrack=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.getUserMedia({audio:!0,video:!1}));case 2:return t=n.sent,n.abrupt("return",t.getAudioTracks()[0]);case 4:case"end":return n.stop()}},null,null,null,Promise)};e.getSpeakerTrack=function(t){return o.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null);case 2:case"end":return t.stop()}},null,null,null,Promise)};e.getScreenShare=function(){var t;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.default.awrap(s.mediaDevices.getDisplayMedia({audio:!0,video:{displaySurface:'monitor',logicalSurface:!0,cursor:!0,width:{max:1920},height:{max:1080},frameRate:{max:5}}}));case 2:return t=n.sent,n.abrupt("return",{video:t.getTracks()[0],audio:null});case 4:case"end":return n.stop()}},null,null,null,Promise)};e.setOnDeviceChange=function(t){};e.getQualityAfterLegacyModeShift=function(t,n,u){return n===f.HD_QUALITY_PEERS_LIMIT&&t?f.VIDEO_CONSTRAINS.vga:n!==f.HD_QUALITY_PEERS_LIMIT+1||t?u:f.VIDEO_CONSTRAINS.hd}},580,[1,22,9,10,67,400,581,2,582,583]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.useBluetoothHeadsetDetection=e.removeListener=e.getHeadset=e.addListener=void 0;var n=t(r(d[1])),u=r(d[2]),o=r(d[3]),s=u.NativeModules.DyteRNBluetoothHeadsetDetect,c=null,v=[],f=new u.NativeEventEmitter(s).addListener('onChange',function(t){var n=t.devices;c=n.length?n[0]:null,v.forEach(function(t){t(c)})});e.getHeadset=function(){return c};var l=function(t){v.push(t)};e.addListener=l;var h=function(t){var n=v.indexOf(t);-1!==n&&v.splice(n,1)};e.removeListener=h;e.useBluetoothHeadsetDetection=function(){var t=(0,o.useState)(null),u=(0,n.default)(t,2),s=u[0],v=u[1];return(0,o.useEffect)(function(){return v(c),l(v),function(){h(v),f.remove()}},[]),s}},581,[1,41,2,165]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.WEBCAM_SIMULCAST_ENCODINGS_VGA=e.WEBCAM_SIMULCAST_ENCODINGS=e.WEBCAM_KSVC_ENCODINGS=e.VIDEO_CONSTRAINS_SCREENSHARE=e.VIDEO_CONSTRAINS=e.SCREEN_SHARING_SVC_ENCODINGS=e.SCREEN_SHARING_SIMULCAST_ENCODINGS=e.PC_PROPRIETARY_CONSTRAINTS=e.ICE_SERVERS=e.HD_QUALITY_PEERS_LIMIT=void 0;e.VIDEO_CONSTRAINS={qqvga:{width:{ideal:160},height:{ideal:120}},qvga:{width:320,height:240},vga:{width:640,height:480},hd:{width:1280,height:720},hd_cropped:{width:900,height:720}};e.VIDEO_CONSTRAINS_SCREENSHARE={vga:{width:{max:640},height:{max:480}},hd:{width:{max:1280},height:{max:720}},full_hd:{width:{max:1980},height:{max:1080}}};e.PC_PROPRIETARY_CONSTRAINTS={optional:[{googDscp:!0},{googHighStartBitrate:0},{googPayloadPadding:!0},{googScreencastMinBitrate:100},{googCpuOveruseDetection:!0},{googCpuOveruseEncodeUsage:!0},{googCpuUnderuseThreshold:55},{googCpuOveruseThreshold:85}]};e.WEBCAM_SIMULCAST_ENCODINGS=[{rid:'r0',scalabilityMode:'S1T3'},{rid:'r1',scalabilityMode:'S1T3'},{rid:'r2',scalabilityMode:'S1T3'}];e.WEBCAM_SIMULCAST_ENCODINGS_VGA=[{rid:'r0',scalabilityMode:'S1T2'},{rid:'r1',scalabilityMode:'S1T2'}];e.WEBCAM_KSVC_ENCODINGS=[{scalabilityMode:'L3T3_KEY'}];e.SCREEN_SHARING_SIMULCAST_ENCODINGS=[{dtx:!0,maxBitrate:15e5},{dtx:!0,maxBitrate:6e6}];e.SCREEN_SHARING_SVC_ENCODINGS=[{scalabilityMode:'L3T3',dtx:!0}];e.HD_QUALITY_PEERS_LIMIT=1;e.ICE_SERVERS=[{urls:'turn:turn.dyte.in:443?transport=tcp',username:'dyte',credential:'dytein',credentialType:'password'},{urls:'turn:turn.dyte.in:3478?transport=udp',username:'dyte',credential:'dytein',credentialType:'password'}]},582,[]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),o=t(r(d[3])),s=r(d[4]),l=r(d[4]).NativeModules.InCallManager,c=new((function(){function t(){(0,u.default)(this,t),this.vibrate=!1,this.audioUriMap={ringtone:{_BUNDLE_:null,_DEFAULT_:null},ringback:{_BUNDLE_:null,_DEFAULT_:null},busytone:{_BUNDLE_:null,_DEFAULT_:null}}}return(0,o.default)(t,[{key:"start",value:function(t){var n=!1!==(t=void 0===t?{}:t).auto,u='video'===t.media?'video':'audio',o=t.ringback&&'string'==typeof t.ringback?t.ringback:'';l.start(u,n,o)}},{key:"stop",value:function(t){var n=(t=void 0===t?{}:t).busytone&&'string'==typeof t.busytone?t.busytone:'';l.stop(n)}},{key:"getIsWiredHeadsetPluggedIn",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n.default.awrap(l.getIsWiredHeadsetPluggedIn());case 3:return t.abrupt("return",t.sent);case 6:throw t.prev=6,t.t0=t.catch(0),new Error('Incall Manager Error getting wired headset');case 9:case"end":return t.stop()}},null,null,[[0,6]],Promise)}},{key:"setKeepScreenOn",value:function(t){t=!0===t,l.setKeepScreenOn(t)}},{key:"setSpeakerphoneOn",value:function(t){t=!0===t,l.setSpeakerphoneOn(t)}},{key:"setForceSpeakerphoneOn",value:function(t){var n='boolean'==typeof t?t?1:-1:0;l.setForceSpeakerphoneOn(n)}},{key:"setMicrophoneMute",value:function(t){t=!0===t,l.setMicrophoneMute(t)}},{key:"getAudioUri",value:function(t,u){var o;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(void 0!==this.audioUriMap[t]){s.next=2;break}return s.abrupt("return",null);case 2:if(!this.audioUriMap[t][u]){s.next=4;break}return s.abrupt("return",this.audioUriMap[t][u]);case 4:return s.prev=4,s.next=7,n.default.awrap(l.getAudioUriJS(t,u));case 7:if(!('string'==typeof(o=s.sent)&&o.length>0)){s.next=11;break}return this.audioUriMap[t][u]=o,s.abrupt("return",o);case 11:return s.abrupt("return",null);case 14:return s.prev=14,s.t0=s.catch(4),s.abrupt("return",null);case 17:case"end":return s.stop()}},null,this,[[4,14]],Promise)}},{key:"chooseAudioRoute",value:function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(l.chooseAudioRoute(t));case 2:return u=o.sent,o.abrupt("return",u);case 4:case"end":return o.stop()}},null,null,null,Promise)}},{key:"requestAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.requestAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}},{key:"abandonAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.abandonAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}}]),t})());e.default=c},583,[1,67,9,10,2]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),o=t(r(d[3])),s=r(d[4]),l=r(d[4]).NativeModules.InCallManager,c=new((function(){function t(){(0,u.default)(this,t),this.vibrate=!1,this.audioUriMap={ringtone:{_BUNDLE_:null,_DEFAULT_:null},ringback:{_BUNDLE_:null,_DEFAULT_:null},busytone:{_BUNDLE_:null,_DEFAULT_:null}}}return(0,o.default)(t,[{key:"start",value:function(t){var n=!1!==(t=void 0===t?{}:t).auto,u='video'===t.media?'video':'audio',o=t.ringback&&'string'==typeof t.ringback?t.ringback:'';l.start(u,n,o)}},{key:"stop",value:function(t){var n=(t=void 0===t?{}:t).busytone&&'string'==typeof t.busytone?t.busytone:'';l.stop(n)}},{key:"getIsWiredHeadsetPluggedIn",value:function(){var t;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,u.next=3,n.default.awrap(l.getIsWiredHeadsetPluggedIn());case 3:return t=u.sent,u.abrupt("return",{isWiredHeadsetPluggedIn:t});case 7:throw u.prev=7,u.t0=u.catch(0),new Error('Incall Manager Error getting wired headset');case 10:case"end":return u.stop()}},null,null,[[0,7]],Promise)}},{key:"setKeepScreenOn",value:function(t){t=!0===t,l.setKeepScreenOn(t)}},{key:"setSpeakerphoneOn",value:function(t){t=!0===t,l.setSpeakerphoneOn(t)}},{key:"setForceSpeakerphoneOn",value:function(t){var n='boolean'==typeof t?t?1:-1:0;l.setForceSpeakerphoneOn(n)}},{key:"setMicrophoneMute",value:function(t){t=!0===t,l.setMicrophoneMute(t)}},{key:"getAudioUri",value:function(t,u){var o;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(void 0!==this.audioUriMap[t]){s.next=2;break}return s.abrupt("return",null);case 2:if(!this.audioUriMap[t][u]){s.next=4;break}return s.abrupt("return",this.audioUriMap[t][u]);case 4:return s.prev=4,s.next=7,n.default.awrap(l.getAudioUriJS(t,u));case 7:if(!('string'==typeof(o=s.sent)&&o.length>0)){s.next=11;break}return this.audioUriMap[t][u]=o,s.abrupt("return",o);case 11:return s.abrupt("return",null);case 14:return s.prev=14,s.t0=s.catch(4),s.abrupt("return",null);case 17:case"end":return s.stop()}},null,this,[[4,14]],Promise)}},{key:"chooseAudioRoute",value:function(t){var u;return n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(l.chooseAudioRoute(t));case 2:return u=o.sent,o.abrupt("return",u);case 4:case"end":return o.stop()}},null,null,null,Promise)}},{key:"requestAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.requestAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}},{key:"abandonAudioFocus",value:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if('android'!==s.Platform.OS){t.next=6;break}return t.next=3,n.default.awrap(l.abandonAudioFocusJS());case 3:return t.abrupt("return",t.sent);case 6:console.log("ios doesn't support requestAudioFocus()");case 7:case"end":return t.stop()}},null,null,null,Promise)}}]),t})());e.default=c},583,[1,67,9,10,2]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),o=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=_(t);if(o&&o.has(e))return o.get(e);var n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=u?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(n,s,l):n[s]=e[s]}n.default=e,o&&o.set(e,n);return n})(r(d[2])),n=r(d[3]),u=r(d[4]),s=r(d[5]),l=r(d[6]),c=r(d[7]),f=r(d[8]),p=e(r(d[9])),N=r(d[10]),E=r(d[11]),h=r(d[12]),v=r(d[13]),S=e(r(d[14])),y=r(d[15]),P=r(d[16]),w=r(d[17]),T=r(d[18]),O=r(d[19]),C=r(d[20]),x=r(d[21]),b=e(r(d[22])),I=e(r(d[23])),M=e(r(d[24]));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(_=function(e){return e?o:t})(e)}var D="\nquery Session($roomName: String!, $password: String) {\n\tsession(roomName: $roomName, password: $password) {\n\t title,\n\t roomNodeLink,\n\t roomName,\n\t password\n\t}\n }\n";function k(e){var _,k=(0,n.useDispatch)(),j=e.roomName,L=e.autoTune,W=(0,n.useSelector)(function(e){return e.participant.peerId}),R=(0,o.useContext)(y.ConfigServiceContext),U=R.meeting,$=R.sessionConfig,A=R.updatePreset,Q=((0,o.useContext)(P.ThemeContext).colors,(0,o.useState)('')),B=(0,t.default)(Q,2),F=B[0],G=B[1],V=(0,h.useManualQuery)(D,{variables:{roomName:j,password:''}}),q=(0,t.default)(V,2),K=q[0],Y=q[1],z=Y.data,H=Y.error,J=Y.loading,X=(0,v.useWindowDimensions)(),Z=$.theme.dimensions||X,ee=Z.height,te=Z.width,re=o.default.useState(!1),oe=(0,t.default)(re,2),ne=(oe[0],oe[1]),ae=(0,o.useContext)(w.UserTrackContext).setupStreams,ie=(0,n.useSelector)(function(e){return e.participant.authToken}),ue=(0,n.useSelector)(function(e){return e.participant.displayName}),se=(0,n.useSelector)(function(e){return e.participant.participantPermissions}),le=$.permissions.produce.audio,me=$.permissions.produce.video.allow,ce=(0,n.useSelector)(function(e){return e.room.showSetupScreen}),de=o.default.useState(j),fe=(0,t.default)(de,2),pe=fe[0],Ne=fe[1],Ee='LANDSCAPE'===o.default.useContext(x.OrientationContext).orientation,he=(0,n.useSelector)(function(e){return e.room.roomViewType}),ve=$.permissions_fetched;(0,o.useEffect)(function(){ve&&(me?(0,O.setupPermissions)(['camera','microphone']):le?(0,O.setupPermissions)(['microphone']):(0,O.setupPermissions)([]),ne(!0))},[he,ve]),(0,o.useEffect)(function(){k((0,c.resetRoom)({roomName:j})),k((0,f.resetPeers)());try{S.default.getItem('dyte-display-name').then(function(e){null!==e&&k((0,E.setUserDisplayName)(e))})}catch(e){}},[]),(0,o.useEffect)(function(){pe&&(ie||C.DYTE_DEV_MODE)&&(k((0,c.resetRoom)({roomName:pe})),K({variables:{roomName:pe,password:''}}),A(pe,ie))},[pe,ie]),(0,o.useEffect)(function(){if(H)if(H.graphQLErrors[0].message.indexOf('No open session')>=0)null==U||U._onError('MEETING_NOTFOUND'),G('MEETING_NOTFOUND');else try{var e=H.graphQLErrors[0];G(null==e?void 0:e.message)}catch(e){G('UNKNOWN')}},[H,U]),(0,o.useEffect)(function(){se.camera===E.permissionEnum.INIT&&se.microphone===E.permissionEnum.INIT||ae()},[se.camera,se.microphone]);if(se.bluetooth===E.permissionEnum.INIT)return o.default.createElement(p.default,{text:"Waiting for permissions..."});var Se;return null==U||!U.showSetupScreen||null!==ce&&!0!==ce?H?o.default.createElement(p.default,{errorText:"Some error occured. Issue code: "+F,childComponents:o.default.createElement(T.Button,{onClick:function(){setTimeout(function(){k((0,f.resetPeers)()),k((0,E.resetParticipant)()),k((0,c.setShowSetupScreen)(!0)),Ne(''),G('')})}},o.default.createElement(T.Box,{bg:"primary.500",py:15,px:10,mt:10,borderRadius:b.default.medium,align:"center"},o.default.createElement(T.Text,null,"Try Again")))}):J?o.default.createElement(p.default,{text:"Loading..."}):o.default.createElement(l.WebSocketProvider,{url:null==z?void 0:null==(_=z.session)?void 0:_.roomNodeLink,roomURL:pe,peerId:W},o.default.createElement(u.MediaRoomProvider,{peerId:W,roomName:pe,autoTune:L},o.default.createElement(N.PeersProvider,null,o.default.createElement(s.PluginServiceProvider,{roomName:pe,peerId:W},o.default.createElement(I.default,{roomName:pe}))))):o.default.createElement(M.default,{width:te,height:ee,isLandscape:Ee,meetingCode:pe,roomName:j,onChangeMeetingCode:Ne,joinMeeting:function(){ue&&pe&&(k((0,c.setShowSetupScreen)(!1)),k((0,c.resetRoom)({roomName:pe})),K({variables:{roomName:pe,password:''}}),A(pe,ie))},title:null==z?void 0:null==(Se=z.session)?void 0:Se.title})}k.defaultProps={autoTune:!0};var j=k;_e.default=j},584,[1,41,165,432,585,672,630,480,481,511,674,487,465,2,488,508,514,579,512,675,543,575,676,677,809]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.MediaRoomProvider=e.MediaRoomContext=void 0;var n=t(r(d[1])),o=t(r(d[2])),u=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=T(n);if(o&&o.has(t))return o.get(t);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var l=c?Object.getOwnPropertyDescriptor(t,s):null;l&&(l.get||l.set)?Object.defineProperty(u,s,l):u[s]=t[s]}u.default=t,o&&o.set(t,u);return u})(r(d[3])),c=r(d[4]),s=r(d[5]),l=r(d[6]),f=r(d[7]),p=t(r(d[8])),v=r(d[9]),S=r(d[10]),E=r(d[11]),M=t(r(d[12])),k=r(d[13]),C=r(d[14]),P=t(r(d[15])),R=r(d[16]),O=t(r(d[17]));function T(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(T=function(t){return t?o:n})(t)}var b=R.NativeModules.DyteHelper,A=(0,u.createContext)(null);e.MediaRoomContext=A;e.MediaRoomProvider=function(t){var T=t.children,x=t.peerId,y=t.roomName,h=t.autoTune,D=(0,u.useContext)(v.WebSocketContext),N=(0,u.useContext)(k.ConfigServiceContext),w=N.meeting,I=N.sessionConfig,_=I.permissions.produce.audio,L=(0,u.useContext)(E.UserTrackContext),j=L.mediaTracks,W=j.webcamTrack,B=j.audioTrack,F=L.inputDevices.toggleVideoState,G=(0,c.useDispatch)(),U=(0,u.useState)(null),V=(0,o.default)(U,2),q=V[0],H=V[1],z=(0,u.useRef)(null),J=(0,u.useRef)(null),K=(0,u.useRef)(''),Q=(0,u.useRef)(null),X=(0,c.useSelector)(function(t){return t.room.socketState}),Y=(0,c.useSelector)(function(t){return t.room.producersState}),Z=(0,c.useSelector)(function(t){return t.participant.videoProduction}),$=(0,c.useSelector)(function(t){return t.participant.audioProduction}),ee=(0,c.useSelector)(function(t){return t.participant.audioMuted});(0,u.useEffect)(function(){q&&(J.current=q)},[q]),(0,u.useEffect)(function(){q&&(ee?q.muteSelf():q.unmuteSelf())},[ee]),(0,u.useEffect)(function(){Y===s.MediaStates.LOADED&&Z===s.MediaStates.CONNECTING&&(W?null==q||q.shareWebcam(W):null==q||q.disableWebcam())},[W,Y]),(0,u.useEffect)(function(){Y===s.MediaStates.LOADED&&$===s.MediaStates.CONNECTING&&(B&&_&&!ee?null==q||q.shareMic(B):null==q||q.disableMic())},[B,$]),(0,u.useEffect)(function(){var t;if(X===s.RoomSocketState.CONNECTED){M.default.captureEvent('setting up connection',{peerId:x}),w&&w.emit(w.Events.connect);var o=new p.default(x,D,G,h);H(o),t=o,n.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,n.default.awrap(t.getRoomState());case 2:return o.next=4,n.default.awrap(t.loadRouter());case 4:return o.next=6,n.default.awrap(Promise.all([t.createRecvTransport(),t.createSendTransport()]));case 6:w&&(w.sendRoomMessage=function(t){D.sendMessage({type:C.Events.roomMessage,payload:{message:t}})},w.sendMessage=function(t,n){D.sendMessage({type:C.Events.message,payload:{peerId:t,message:n}})},w.kickAll=function(){I.permissions.kick_participant&&t.kickAll()},null==D||D.emitter.on('socket',function(t){return w.onSocketMessage(t)})),G((0,s.setRouterFetchState)(s.MediaStates.LOADED)),G((0,s.setProducersState)(s.MediaStates.NOT_STARTED));case 9:case"end":return o.stop()}},null,null,null,Promise)}else X===s.RoomSocketState.DISCONNECTED&&(M.default.captureEvent('socket disconnected',{peerId:x}),null==q||q.stopAllTransports(),null==D||D.emitter.removeAllListeners(),G((0,s.resetRoom)({roomName:y})),G((0,f.resetPeers)()),G((0,S.resetParticipant)()),H(null),(0,s.setRouterFetchState)(s.MediaStates.NOT_APPLICABLE))},[X,x]),(0,u.useEffect)(function(){return function(){var t,n;null==(t=J.current)||t.stopAllProducers(),null==(n=J.current)||n.stopAllTransports()}},[]);var te=function(t){K.current.match(/inactive|background/)&&'active'===t?(O.default.trace('configureBackground'),P.default.clearInterval(Q.current),Q.current=null,W&&(W.enabled=!1,setTimeout(function(){W&&(W.enabled=!0)},100)),z.current&&(z.current=!1,F()),l.store.getState().room.screenShareRequested||b.stopService()):(null===Q.current&&n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(O.default.trace('configureForeground'),W&&'DISABLE_CAMERA_CAPTURE'===w.setupConfig.backgroundBehaviour&&(F(),z.current=!0),!(R.Platform.Version>=26)){t.next=5;break}return t.next=5,n.default.awrap(b.createNotificationChannel());case 5:return t.next=7,n.default.awrap(b.startService());case 7:case"end":return t.stop()}},null,null,null,Promise),Q.current=P.default.setInterval(function(){},1e3),K.current=t)};(0,u.useEffect)(function(){if('android'===R.Platform.OS){var t=R.AppState.addEventListener('change',te);return function(){t?t.remove():R.AppState.removeEventListener('change',te),Q.current&&P.default.clearInterval(Q.current)}}return function(){}},[W,F]);var ne={mediaRoom:q};return u.default.createElement(A.Provider,{value:ne},T)}},585,[1,67,41,165,432,480,471,481,586,630,487,579,663,508,665,671,2,578]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1])),n=t(r(d[2])),o=t(r(d[3])),u=t(r(d[4])),c=r(d[5]),l=r(d[6]),p=r(d[7]),h=r(d[8]),f=r(d[9]),y=r(d[10]),v=r(d[11]),k=(function(){function t(s,n,u){!(arguments.length>3&&void 0!==arguments[3])||arguments[3];(0,o.default)(this,t),this.socketObj=n,this.peerid=s,this.dispatch=u,this.device=new c.Device,this.consumers=new Map,this.legacyMode=!0,this.closedConsumers=[],this.handleSockets=this.handleSockets.bind(this)}return(0,u.default)(t,[{key:"handleSockets",value:function(t,s){if(t)switch(t.type){case'websocket/new-consumer':this.createConsumer(t.payload,s);break;case'websocket/consumer-closed':this.closeConsumer(t.payload);break;case'websocket/consumer-paused':this.pauseConsumer(t.payload);break;case'websocket/consumer-resumed':this.resumeConsumer(t.payload);break;case'websocket/recording-started':this.setRecordingStatus(!0);break;case'websocket/recording-stopped':this.setRecordingStatus(!1)}}},{key:"loadRouter",value:function(){var t,n,o;return s.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return(this.recvTransport||this.sendTransport)&&this.stopAllTransports(),this.dispatch((0,f.setRouterFetchState)(f.MediaStates.CONNECTING)),u.next=4,s.default.awrap(null==(t=this.socketObj)?void 0:t.sendMessage({type:'getRouterRtpCapabilities'}));case 4:return n=u.sent,this.device.loaded&&(this.device=new c.Device),(o=null==n?void 0:n.payload)&&(o.headerExtensions=o.headerExtensions.filter(function(t){return'urn:3gpp:video-orientation'!==t.uri})),this.socketObj.emitter.on('socket',this.handleSockets),u.abrupt("return",this.device.load({routerRtpCapabilities:o}));case 10:case"end":return u.stop()}},null,this,null,Promise)}},{key:"getRoomState",value:function(){var t;return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.CONNECTING)),n.next=3,s.default.awrap(null==(t=this.socketObj)?void 0:t.sendMessage({type:'getRoomState'}));case 3:this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.LOADED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"changeRoomDisplayTitle",value:function(t){var n;return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.CONNECTING)),o.next=3,s.default.awrap(null==(n=this.socketObj)?void 0:n.sendMessage({type:'changeDisplayTitle',payload:{displayTitle:t}}));case 3:this.dispatch((0,f.setRoomDisplayTitleState)(f.MediaStates.LOADED));case 4:case"end":return o.stop()}},null,this,null,Promise)}},{key:"joinRoom",value:function(t,n,o){var u;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,s.default.awrap(this.socketObj.sendMessage({type:'joinRoom',payload:{device:(0,p.getDeviceInfo)(),displayName:t,rtpCapabilities:this.device.rtpCapabilities,isLegacy:this.legacyMode,audioMuted:n}}));case 2:if(u=c.sent,this.legacyMode=u.payload.legacyMode||this.legacyMode,!o||''===o){c.next=7;break}return c.next=7,s.default.awrap(this.changeRoomDisplayTitle(o));case 7:return this.dispatch((0,v.roomJoined)(u.payload)),c.abrupt("return",u);case 9:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createRecvTransport",value:function(){var t,o,u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==this.socketObj){c.next=2;break}return c.abrupt("return");case 2:return t={forceTcp:!1,producing:!1,consuming:!0},c.next=5,s.default.awrap(this.socketObj.sendMessage({type:'createWebRtcTransport',payload:t}));case 5:o=c.sent.payload,this.recvTransport=this.device.createRecvTransport((0,n.default)({},o,{iceServers:l.ICE_SERVERS,proprietaryConstraints:l.PC_PROPRIETARY_CONSTRAINTS})),this.recvTransport.on('connect',function(t,s,n){var o,c,l=t.dtlsParameters;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'connectWebRtcTransport',payload:{transportId:null==(c=u.recvTransport)?void 0:c.id,dtlsParameters:l}},function(t){t.payload.error?n():s()})});case 8:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createSendTransport",value:function(){var t,o,u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:return t={forceTcp:!1,producing:!0,consuming:!1},c.next=3,s.default.awrap(this.socketObj.sendMessage({type:'createWebRtcTransport',payload:t}));case 3:o=c.sent.payload,this.sendTransport=this.device.createSendTransport((0,n.default)({},o,{iceServers:l.ICE_SERVERS,proprietaryConstraints:l.PC_PROPRIETARY_CONSTRAINTS})),void 0!==this.sendTransport&&(this.sendTransport.on('connect',function(t,s,n){var o,c,l=t.dtlsParameters;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'connectWebRtcTransport',payload:{transportId:null==(c=u.sendTransport)?void 0:c.id,dtlsParameters:l}},function(t){t.payload.error?n():s()})}),this.sendTransport.on('produce',function(t,s,n){var o,c,l=t.kind,p=t.rtpParameters,h=t.appData;return null==(o=u.socketObj)?void 0:o.sendMessage({type:'produce',payload:{transportId:null==(c=u.sendTransport)?void 0:c.id,kind:l,rtpParameters:p,appData:h}},function(t){t.payload.error?n(t.payload.error):s({id:t.payload.id})})}));case 6:case"end":return c.stop()}},null,this,null,Promise)}},{key:"createConsumer",value:function(t,o){var u,c,l,p,h,f,v,k,P,w,b;return s.default.async(function(x){for(;;)switch(x.prev=x.next){case 0:if(void 0!==this.recvTransport&&!this.recvTransport.closed){x.next=2;break}return x.abrupt("return");case 2:return u=t.peerId,c=t.producerId,l=t.id,p=t.kind,h=t.rtpParameters,f=t.type,v=t.appData,k=t.producerPaused,P=t.remotelyPaused,w=t.priority,x.next=5,s.default.awrap(this.recvTransport.consume({id:l,producerId:c,kind:p,rtpParameters:h,appData:(0,n.default)({},v,{peerId:u})}));case 5:b=x.sent,this.closedConsumers.includes(l)?b.close():(this.consumers.set(b.id,b),this.dispatch((0,y.addConsumer)({id:l,peerId:u,type:f,kind:p,remotelyPaused:P,producerPaused:k,priority:w,appData:b.appData,score:10,producerScore:10}))),o&&o('Done');case 8:case"end":return x.stop()}},null,this,null,Promise)}},{key:"closeConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=6;break}return console.log('Consumer not found'),this.closedConsumers.push(n),s.abrupt("return");case 6:o.close(),this.consumers.delete(n);case 8:case"end":return s.stop()}},null,this,null,Promise)}},{key:"pauseConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=4;break}return s.abrupt("return");case 4:o.pause();case 5:case"end":return s.stop()}},null,this,null,Promise)}},{key:"resumeConsumer",value:function(t){var n,o;return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(n=t.id,o=this.consumers.get(n)){s.next=4;break}return s.abrupt("return");case 4:o.resume();case 5:case"end":return s.stop()}},null,this,null,Promise)}},{key:"shareWebcam",value:function(t){var n,o,u,c,p,y=this;return s.default.async(function(v){for(;;)switch(v.prev=v.next){case 0:if(void 0!==t){v.next=2;break}return v.abrupt("return");case 2:if(!this.webCamProducer){v.next=5;break}return v.next=5,s.default.awrap(this.removeProducer('webCamProducer',!1));case 5:return n=l.WEBCAM_SIMULCAST_ENCODINGS_VGA,o=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp9'===t.mimeType.toLowerCase()})||void 0,u=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp8'===t.mimeType.toLowerCase()})||void 0,o&&!this.legacyMode&&(n=l.WEBCAM_KSVC_ENCODINGS),this.dispatch((0,h.setVideoOff)(!1)),this.dispatch((0,h.setVideoProduction)(f.MediaStates.FETCHED)),c={track:t,encodings:n,codecOptions:{videoGoogleStartBitrate:1e3},codec:(function(){return y.legacyMode?u:o})(),appData:{screenShare:!1},stopTracks:!1},p=function(){y.disableWebcam()},v.next=16,s.default.awrap(this.createProducer('webCamProducer',c,p));case 16:this.dispatch((0,h.setVideoProduction)(f.MediaStates.LOADED));case 17:case"end":return v.stop()}},null,this,null,Promise)}},{key:"shareScreen",value:function(t){var n,o,u,c,p,y,v,k,P=this;return s.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:if(n=t.video,o=t.audio,void 0!==n){w.next=3;break}return w.abrupt("return");case 3:return u=l.SCREEN_SHARING_SIMULCAST_ENCODINGS,null===(c=this.device.rtpCapabilities.codecs.find(function(t){return'video/vp9'===t.mimeType.toLowerCase()})||null)||this.legacyMode||(u=l.SCREEN_SHARING_SVC_ENCODINGS),this.dispatch((0,h.setScreenSharing)(!0)),this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.FETCHED)),p={track:n,encodings:u,codecOptions:{videoGoogleStartBitrate:1e3},codec:this.legacyMode?void 0:c,appData:{screenShare:!0},stopTracks:!1},y=function(){P.disableScreenShare()},w.next=12,s.default.awrap(this.createProducer('screenShareVideoProducer',p,y));case 12:if(!o){w.next=17;break}return v={track:o,codecOptions:{opusDtx:!0,opusStereo:!1,opusFec:!0},appData:{screenShare:!0},stopTracks:!1},k=function(){},w.next=17,s.default.awrap(this.createProducer('screenShareAudioProducer',v,k));case 17:this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.LOADED));case 18:case"end":return w.stop()}},null,this,null,Promise)}},{key:"shareMic",value:function(t,n){var o,u,c=this;return s.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:if(void 0!==t){l.next=2;break}return l.abrupt("return");case 2:if(!this.micProducer){l.next=5;break}return l.next=5,s.default.awrap(this.removeProducer('micProducer',!1));case 5:return n&&this.dispatch((0,h.setAudioMuted)(n||!1)),this.dispatch((0,h.setAudioProduction)(f.MediaStates.FETCHED)),o={track:t,codecOptions:{opusDtx:!0,opusStereo:!1,opusFec:!0},stopTracks:!1},u=function(){c.disableMic()},l.next=11,s.default.awrap(this.createProducer('micProducer',o,u));case 11:this.dispatch((0,h.setAudioProduction)(f.MediaStates.LOADED));case 12:case"end":return l.stop()}},null,this,null,Promise)}},{key:"pauseMic",value:function(){this.dispatch((0,h.setAudioMuted)(!0)),this.micProducer.pause()}},{key:"pauseWebcam",value:function(){this.dispatch((0,h.setVideoOff)(!0)),this.webCamProducer.pause()}},{key:"resumeMic",value:function(){this.dispatch((0,h.setAudioMuted)(!1)),this.micProducer.resume()}},{key:"resumeWebcam",value:function(){this.dispatch((0,h.setVideoOff)(!1)),this.webCamProducer.resume()}},{key:"disableWebcam",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return t&&null!=t&&t.silent||this.dispatch((0,h.setVideoOff)(!0)),n.next=3,s.default.awrap(this.removeProducer('webCamProducer'));case 3:this.dispatch((0,h.setVideoProduction)(f.MediaStates.NOT_STARTED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableMic",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return t&&null!=t&&t.silent||this.dispatch((0,h.setAudioMuted)(!0)),n.next=3,s.default.awrap(this.removeProducer('micProducer'));case 3:this.dispatch((0,h.setAudioProduction)(f.MediaStates.NOT_STARTED));case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableScreenShare",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return this.dispatch((0,h.setScreenSharingProduction)(f.MediaStates.NOT_STARTED)),this.dispatch((0,h.setScreenSharing)(!1)),t.next=4,s.default.awrap(this.removeProducer('screenShareVideoProducer'));case 4:return t.next=6,s.default.awrap(this.removeProducer('screenShareAudioProducer'));case 6:case"end":return t.stop()}},null,this,null,Promise)}},{key:"stopAllProducers",value:function(){this.webCamProducer&&this.removeProducer('webCamProducer'),this.screenShareVideoProducer&&this.removeProducer('screenShareVideoProducer'),this.screenShareAudioProducer&&this.removeProducer('screenShareAudioProducer'),this.micProducer&&this.removeProducer('micProducer')}},{key:"stopAllTransports",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.sendTransport){try{this.sendTransport.close()}catch(t){console.log('awaitqueue error')}this.sendTransport=null}if(this.recvTransport){try{this.recvTransport.close()}catch(t){console.log('awaitqueue error')}this.recvTransport=null}this.dispatch((0,f.setRouterFetchState)(f.MediaStates.NOT_STARTED));case 3:case"end":return t.stop()}},null,this,null,Promise)}},{key:"resetVideoProducers",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(!t){o.next=4;break}return o.next=3,s.default.awrap(this.removeProducer('webCamProducer',!1));case 3:this.shareWebcam(t);case 4:if(!n){o.next=8;break}return o.next=7,s.default.awrap(this.removeProducer('screenShareVideoProducer',!1));case 7:this.shareScreen({video:n});case 8:case"end":return o.stop()}},null,this,null,Promise)}},{key:"createProducer",value:function(t,n,o){var u=this;return s.default.async(function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==this.sendTransport&&!this.sendTransport.closed){c.next=2;break}return c.abrupt("return");case 2:return c.next=4,s.default.awrap(this.sendTransport.produce(n));case 4:this[t]=c.sent,this[t].on('transportclose',function(){u[t]=void 0}),this[t].on('trackended',function(){u.socketObj.sendMessage({type:'closeProducer',payload:{producerId:u[t].id}}),o()});case 7:case"end":return c.stop()}},null,this,null,Promise)}},{key:"removeProducer",value:function(t){var n,o=arguments;return s.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:if(n=!(o.length>1&&void 0!==o[1])||o[1],this[t]&&!this[t].closed){u.next=3;break}return u.abrupt("return");case 3:return n&&this[t].track.stop(),this[t].close(),u.next=7,s.default.awrap(this.socketObj.sendMessage({type:'closeProducer',payload:{producerId:this[t].id}}));case 7:this[t]=null;case 8:case"end":return u.stop()}},null,this,null,Promise)}},{key:"sendMessage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'chatMessage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"getMesssages",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getChatMessages'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"getPolls",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getPolls'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"newPoll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'newPoll',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"votePoll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'votePoll',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"acceptWaitingRequest",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'acceptWaitingRequest',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"rejectWaitingRequest",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'rejectWaitingRequest',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"muteAll",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteAllNew',payload:{allowUnMute:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"rejectRequestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'rejectRequestToJoinStage',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"muteAllVideo",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteAllVideo'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"pin",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'pinPeer',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableAudio",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'disableAudioPeerNew',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"disableVideo",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'disableVideoPeer',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"kickAll",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'kickAll'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"kick",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'kick',payload:{id:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"getPage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'getPage',payload:{pageNum:t}}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"setRecordingStatus",value:function(t){return s.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:window.triggerDyteRecording=t;case 1:case"end":return s.stop()}},null,null,null,Promise)}},{key:"muteSelf",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'muteSelf'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"unmuteSelf",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'unmuteSelf'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"requestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'requestToJoinStage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"acceptAllRequestToJoinStage",value:function(t){return s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.default.awrap(this.socketObj.sendMessage({type:'acceptAllRequestToJoinStage',payload:t}));case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removePeerFromStage",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,s.default.awrap(this.socketObj.sendMessage({type:'removePeerFromStage',payload:{id:t,type:n}}));case 2:case"end":return o.stop()}},null,this,null,Promise)}},{key:"startPresenting",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'startPresenting'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"stopPresenting",value:function(){return s.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.default.awrap(this.socketObj.sendMessage({type:'stopPresenting'}));case 2:case"end":return t.stop()}},null,this,null,Promise)}},{key:"updatePreset",value:function(t,n){return s.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,s.default.awrap(this.socketObj.sendMessage({type:'updatePeerPreset',payload:{id:t,presetName:n}}));case 2:case"end":return o.stop()}},null,this,null,Promise)}}]),t})();e.default=k},586,[1,67,22,9,10,587,582,493,487,480,505,481]); @@ -676,7 +676,7 @@ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.d __d(function(g,r,i,a,m,_e,d){var t='__lodash_hash_undefined__',e=9007199254740991,n='[object Arguments]',o='[object Boolean]',c='[object Date]',u='[object Function]',f='[object GeneratorFunction]',s='[object Map]',l='[object Number]',_='[object Object]',p='[object RegExp]',h='[object Set]',y='[object String]',v='[object Symbol]',b='[object ArrayBuffer]',j='[object DataView]',w='[object Float32Array]',O='[object Float64Array]',A='[object Int8Array]',x='[object Int16Array]',S='[object Int32Array]',P='[object Uint8Array]',$='[object Uint8ClampedArray]',k='[object Uint16Array]',E='[object Uint32Array]',I=/\w*$/,F=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,B={};B[n]=B['[object Array]']=B[b]=B[j]=B[o]=B[c]=B[w]=B[O]=B[A]=B[x]=B[S]=B[s]=B[l]=B[_]=B[p]=B[h]=B[y]=B[v]=B[P]=B[$]=B[k]=B[E]=!0,B['[object Error]']=B[u]=B["[object WeakMap]"]=!1;var U='object'==typeof g&&g&&g.Object===Object&&g,W='object'==typeof self&&self&&self.Object===Object&&self,D=U||W||Function('return this')(),R='object'==typeof _e&&_e&&!_e.nodeType&&_e,T=R&&'object'==typeof m&&m&&!m.nodeType&&m,z=T&&T.exports===R;function C(t,e){return t.set(e[0],e[1]),t}function L(t,e){return t.add(e),t}function V(t,e){for(var n=-1,o=t?t.length:0;++n-1},Ft.prototype.set=function(t,e){var n=this.__data__,o=Dt(n,t);return o<0?n.push([t,e]):n[o][1]=e,this},Mt.prototype.clear=function(){this.__data__={hash:new It,map:new(jt||Ft),string:new It}},Mt.prototype.delete=function(t){return Zt(this,t).delete(t)},Mt.prototype.get=function(t){return Zt(this,t).get(t)},Mt.prototype.has=function(t){return Zt(this,t).has(t)},Mt.prototype.set=function(t,e){return Zt(this,t).set(t,e),this},Bt.prototype.clear=function(){this.__data__=new Ft},Bt.prototype.delete=function(t){return this.__data__.delete(t)},Bt.prototype.get=function(t){return this.__data__.get(t)},Bt.prototype.has=function(t){return this.__data__.has(t)},Bt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ft){var o=n.__data__;if(!jt||o.length<199)return o.push([t,e]),this;n=this.__data__=new Mt(o)}return n.set(t,e),this};var rr=yt?Q(yt,Object):function(){return[]},er=function(t){return ut.call(t)};function nr(t){var e=t.length,n=t.constructor(e);return e&&'string'==typeof t[0]&&ct.call(t,'index')&&(n.index=t.index,n.input=t.input),n}function or(t){return'function'!=typeof t.constructor||ar(t)?{}:br(e=lt(t))?_t(e):{};var e}function cr(t,e,n,u){var f,_,F,M=t.constructor;switch(e){case b:return Gt(t);case o:case c:return new M(+t);case j:return Nt(t,u);case w:case O:case A:case x:case S:case P:case $:case k:case E:return Jt(t,u);case s:return qt(t,u,n);case l:case y:return new M(t);case p:return(F=new(_=t).constructor(_.source,I.exec(_))).lastIndex=_.lastIndex,F;case h:return Ht(t,u,n);case v:return f=t,Et?Object(Et.call(f)):{}}}function ur(t,n){return!!(n=null==n?e:n)&&('number'==typeof t||M.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=e}function br(t){var e=typeof t;return!!t&&('object'==e||'function'==e)}function dr(t){return!!t&&'object'==typeof t}function jr(t){return _r(t)?Ut(t):Lt(t)}m.exports=function(t){return Tt(t,!0,!0)}},670,[]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),c=r(d[3]),l=c.NativeModules.DyteRNBackgroundTimer,o=new c.NativeEventEmitter(l),s=new((function(){function t(){var u=this;(0,n.default)(this,t),this.uniqueId=0,this.callbacks={},o.addListener('backgroundTimer.timeout',function(t){if(u.callbacks[t]){var n=u.callbacks[t].callback;u.callbacks[t].interval?l.backgroundTimerSetTimeout(t,u.callbacks[t].timeout):delete u.callbacks[t],n()}})}return(0,u.default)(t,[{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return l.start(t)}},{key:"stop",value:function(){return l.stop()}},{key:"runBackgroundTimer",value:function(t,n){var u=this,l=c.Platform.select({ios:function(){return c.NativeAppEventEmitter},android:function(){return c.DeviceEventEmitter}})();this.start(0),this.backgroundListener=l.addListener('backgroundTimer',function(){u.backgroundListener.remove(),u.backgroundClockMethod(t,n)})}},{key:"backgroundClockMethod",value:function(t,n){var u=this;this.backgroundTimer=this.setTimeout(function(){t(),u.backgroundClockMethod(t,n)},n)}},{key:"stopBackgroundTimer",value:function(){this.stop(),this.clearTimeout(this.backgroundTimer)}},{key:"setTimeout",value:function(t,n){this.uniqueId+=1;var u=this.uniqueId;return this.callbacks[u]={callback:t,interval:!1,timeout:n},l.setTimeout(u,n),u}},{key:"clearTimeout",value:function(t){this.callbacks[t]&&delete this.callbacks[t]}},{key:"setInterval",value:function(t,n){this.uniqueId+=1;var u=this.uniqueId;return this.callbacks[u]={callback:t,interval:!0,timeout:n},l.backgroundTimerSetTimeout(u,n),u}},{key:"clearInterval",value:function(t){this.callbacks[t]&&delete this.callbacks[t]}}]),t})());e.default=s},671,[1,9,10,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.PluginServiceProvider=e.PluginServiceContext=void 0;var n=t(r(d[1])),o=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=v(n);if(o&&o.has(t))return o.get(t);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var l=c?Object.getOwnPropertyDescriptor(t,f):null;l&&(l.get||l.set)?Object.defineProperty(u,f,l):u[f]=t[f]}u.default=t,o&&o.set(t,u);return u})(r(d[2])),u=r(d[3]),c=r(d[4]),f=t(r(d[5])),l=r(d[6]);function v(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(v=function(t){return t?o:n})(t)}var p=(0,o.createContext)(null);e.PluginServiceContext=p;e.PluginServiceProvider=function(t){var v=t.children,s=t.roomName,P=t.peerId,S=(0,o.useContext)(l.WebSocketContext),y=(0,u.useDispatch)(),O=(0,o.useState)(null),b=(0,n.default)(O,2),k=b[0],j=b[1],C=(0,u.useSelector)(function(t){return t.participant.authToken});(0,o.useEffect)(function(){},[]);var w=(0,u.useSelector)(function(t){return t.room.socketState}),E={pluginManager:k};return(0,o.useEffect)(function(){if(w===c.RoomSocketState.CONNECTED){var t=new f.default(S,s,y,P,C);j(t),t.listenSocketEvents()}},[w]),o.default.createElement(p.Provider,{value:E},v)}},672,[1,41,165,432,480,673,630]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),u=t(r(d[3])),l=t(r(d[4])),o=r(d[5]),c=t(r(d[6])),f=(function(){function t(n,s,l,o,c){(0,u.default)(this,t),this.socketObj=n,this.dispatch=l,this.roomName=s,this.plugins={},this.iframes={},this.peerId=o,this.authToken=c,this.handleSockets=this.handleSockets.bind(this)}return(0,l.default)(t,[{key:"handleSockets",value:function(t){if(t)switch(t.type){case'websocket/enable-plugin':this.enablePlugin(t.payload);break;case'websocket/disable-plugin':this.disablePlugin(t.payload);break;case'websocket/plugin-event':case'websocket/plugin-data':this.sendIframeEvent(t)}}},{key:"sendIframeEvent",value:function(t){var n=this.iframes[t.payload.pluginId||t.payload.id];n&&Object.values(n).forEach(function(n){n.iframe&&n.iframe.injectJavaScript("window.postMessage("+JSON.stringify(t)+");")})}},{key:"listenSocketEvents",value:function(){this.socketObj.emitter.on('socket',this.handleSockets),this.getRoomPlugins()}},{key:"getRoomPlugins",value:function(){var t=this;this.socketObj.sendMessage({type:'getRoomState'},function(n){n.payload.roomState.plugins.forEach(function(n){return t.enablePlugin(n)})})}},{key:"enablePlugin",value:function(t){var u,l,f,h,p,v;return n.default.async(function(k){for(;;)switch(k.prev=k.next){case 0:if(u=c.default.apiBase+"/v2/plugins",!this.plugins[t.id]){k.next=3;break}return k.abrupt("return");case 3:return k.next=5,n.default.awrap(fetch(c.default.apiBase+"/v2/plugins/view/"+t.id,{method:'GET',headers:{authorization:"Bearer "+this.authToken}}));case 5:return l=k.sent,k.next=8,n.default.awrap(l.json());case 8:return f=k.sent,k.next=11,n.default.awrap(fetch(u+"/authorize/"+t.id,{method:'POST',headers:{authorization:"Bearer "+this.authToken,'Content-Type':'application/json'},body:JSON.stringify({roomName:this.roomName,peerId:this.peerId})}));case 11:return h=k.sent,k.next=14,n.default.awrap(h.json());case 14:p=k.sent.data.token,v=(0,s.default)({},f.data.plugin,{authToken:p,enabledBy:t.enabledBy,ACLAccessGrantedUsers:t.ACLAccessGrantedUsers||[],ACLAccessRemovedUsers:t.ACLAccessRemovedUsers||[]}),this.plugins[t.id]=v,this.iframes[t.id]={},this.dispatch((0,o.addPlugin)(v));case 19:case"end":return k.stop()}},null,this,null,Promise)}},{key:"disablePlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.plugins[t.id]&&(delete this.plugins[t.id],this.dispatch((0,o.removePlugin)(t)));case 1:case"end":return n.stop()}},null,this,null,Promise)}},{key:"handleIframeMessage",value:function(t){var s=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=t.type,n.next='pluginEvent'===n.t0?3:'storePluginData'===n.t0?3:'getPluginData'===n.t0?3:'getPeerInfo'===n.t0?3:'enablePluginForAll'===n.t0?3:5;break;case 3:return this.socketObj.sendMessage(t,function(t){s.sendIframeEvent(t)}),n.abrupt("break",6);case 5:return n.abrupt("break",6);case 6:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addIframeView",value:function(t,s,u){var l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&this.removeIframeView(t),l=function(t){s&&o.handleIframeMessage(t)},u.addEventListener(l),this.iframes[t.plugin][t.view]={listener:l,iframe:s};case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removeIframeView",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&delete this.iframes[t.plugin][t.view];case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addRoomPlugin",value:function(t){return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.plugins[t.id]){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,n.default.awrap(this.socketObj.sendMessage({type:'addPlugin',payload:t}));case 4:case"end":return s.stop()}},null,this,null,Promise)}},{key:"removeRoomPlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.socketObj.sendMessage({type:'removePlugin',payload:t}));case 1:case"end":return n.stop()}},null,this,null,Promise)}}]),t})();e.default=f},673,[1,67,22,9,10,503,504]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),u=t(r(d[3])),l=t(r(d[4])),o=r(d[5]),c=t(r(d[6])),f=(function(){function t(n,s,l,o,c){(0,u.default)(this,t),this.socketObj=n,this.dispatch=l,this.roomName=s,this.plugins={},this.iframes={},this.peerId=o,this.authToken=c,this.handleSockets=this.handleSockets.bind(this)}return(0,l.default)(t,[{key:"handleSockets",value:function(t){if(t)switch(t.type){case'websocket/enable-plugin':this.enablePlugin(t.payload);break;case'websocket/disable-plugin':this.disablePlugin(t.payload);break;case'websocket/plugin-event':case'websocket/plugin-data':this.sendIframeEvent(t)}}},{key:"sendIframeEvent",value:function(t){var n=this.iframes[t.payload.pluginId||t.payload.id];n&&Object.values(n).forEach(function(n){n.iframe&&n.iframe.injectJavaScript("window.postMessage("+JSON.stringify(t)+");")})}},{key:"listenSocketEvents",value:function(){this.socketObj.emitter.on('socket',this.handleSockets),this.getRoomPlugins()}},{key:"getRoomPlugins",value:function(){var t=this;this.socketObj.sendMessage({type:'getRoomState'},function(n){n.payload.roomState.plugins.forEach(function(n){return t.enablePlugin(n)})})}},{key:"enablePlugin",value:function(t){var u,l,f,h,p,v;return n.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:if(u=c.default.apiBase+"/v2/plugins",!this.plugins[t.id]){y.next=3;break}return y.abrupt("return");case 3:return y.next=5,n.default.awrap(fetch(c.default.apiBase+"/v2/plugins/view/"+t.id,{method:'GET',headers:{authorization:"Bearer "+this.authToken}}));case 5:return l=y.sent,y.next=8,n.default.awrap(l.json());case 8:return f=y.sent,y.next=11,n.default.awrap(fetch(u+"/authorize/"+t.id,{method:'POST',headers:{authorization:"Bearer "+this.authToken,'Content-Type':'application/json'},body:JSON.stringify({roomName:this.roomName,peerId:this.peerId})}));case 11:return h=y.sent,y.next=14,n.default.awrap(h.json());case 14:p=y.sent.data.token,v=(0,s.default)({},f.data.plugin,{authToken:p,enabledBy:t.enabledBy,ACLAccessGrantedUsers:t.ACLAccessGrantedUsers||[],ACLAccessRemovedUsers:t.ACLAccessRemovedUsers||[]}),this.plugins[t.id]=v,this.iframes[t.id]={},this.dispatch((0,o.addPlugin)(v));case 19:case"end":return y.stop()}},null,this,null,Promise)}},{key:"disablePlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.plugins[t.id]&&(delete this.plugins[t.id],this.dispatch((0,o.removePlugin)(t)));case 1:case"end":return n.stop()}},null,this,null,Promise)}},{key:"handleIframeMessage",value:function(t){var u,l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=t.type,n.next='pluginEvent'===n.t0?3:'storePluginData'===n.t0?3:'getPluginData'===n.t0?3:'enablePluginForAll'===n.t0?3:'getPeerInfo'===n.t0?5:7;break;case 3:return this.socketObj.sendMessage(t,function(t){o.sendIframeEvent(t)}),n.abrupt("break",8);case 5:return this.socketObj.sendMessage({type:t.type,payload:(0,s.default)({},t.payload,{peerId:null!=(u=null==(l=t.payload)?void 0:l.peerId)?u:this.peerId})},function(t){o.sendIframeEvent(t)}),n.abrupt("break",8);case 7:return n.abrupt("break",8);case 8:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addIframeView",value:function(t,s,u){var l,o=this;return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&this.removeIframeView(t),l=function(t){s&&o.handleIframeMessage(t)},u.addEventListener(l),this.iframes[t.plugin][t.view]={listener:l,iframe:s};case 4:case"end":return n.stop()}},null,this,null,Promise)}},{key:"removeIframeView",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:this.iframes[t.plugin][t.view]&&delete this.iframes[t.plugin][t.view];case 2:case"end":return n.stop()}},null,this,null,Promise)}},{key:"addRoomPlugin",value:function(t){return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.plugins[t.id]){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,n.default.awrap(this.socketObj.sendMessage({type:'addPlugin',payload:t}));case 4:case"end":return s.stop()}},null,this,null,Promise)}},{key:"removeRoomPlugin",value:function(t){return n.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.socketObj.sendMessage({type:'removePlugin',payload:t}));case 1:case"end":return n.stop()}},null,this,null,Promise)}}]),t})();e.default=f},673,[1,67,22,9,10,503,504]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.PeersServiceContext=e.PeersProvider=void 0;var t=n(r(d[1])),o=n(r(d[2])),u=n(r(d[3])),c=(function(n,t){if(!t&&n&&n.__esModule)return n;if(null===n||"object"!=typeof n&&"function"!=typeof n)return{default:n};var o=b(t);if(o&&o.has(n))return o.get(n);var u={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in n)if("default"!==l&&Object.prototype.hasOwnProperty.call(n,l)){var s=c?Object.getOwnPropertyDescriptor(n,l):null;s&&(s.get||s.set)?Object.defineProperty(u,l,s):u[l]=n[l]}u.default=n,o&&o.set(n,u);return u})(r(d[4])),l=r(d[5]),s=r(d[6]),f=r(d[7]),p=r(d[8]),v=r(d[9]),S=r(d[10]),P=r(d[11]),h=r(d[12]),k=r(d[13]);function b(n){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(b=function(n){return n?o:t})(n)}var y=(0,c.createContext)(null);e.PeersServiceContext=y;e.PeersProvider=function(n){var b,T,M=n.children,w=(0,c.useContext)(p.ConfigServiceContext).meeting,C=(0,c.useState)([]),V=(0,u.default)(C,2),x=V[0],D=V[1],O=(0,l.useSelector)(function(n){return n.peers.joinedPeers}),A=(0,l.useSelector)(function(n){return n.participant}),j=(0,l.useSelector)(function(n){return n.consumers.activeConsumers}),I=j.find(function(n){return'video'===n.kind&&n.appData.screenShare}),_=j.find(function(n){return'audio'===n.kind&&n.appData.screenShare}),E=(0,l.useSelector)(function(n){return n.room.pinnedPeerId}),H=(0,l.useSelector)(function(n){return n.room.roomViewType}),N=(0,c.useState)(null),q=(0,u.default)(N,2),J=q[0],L=q[1],R=(0,c.useState)(null),U=(0,u.default)(R,2),W=U[0],z=U[1],B=(0,c.useContext)(f.MediaRoomContext).mediaRoom,F=(0,l.useDispatch)(),G=(0,c.useContext)(v.UserTrackContext),K=G.mediaTracks,Q=K.screenShareVideoTrack,X=K.setScreenShareVideoTrack,Y=(K.screenShareAudioTrack,K.setScreenShareAudioTrack),Z=G.inputDevices,$=Z.toggleAudioState,ee=Z.toggleVideoState,re={pin:function(n){return B.pin(n)},unpin:function(n){return B.pin(null)},toggleSelfAudio:function(){return $()},toggleSelfVideo:function(){return ee()},toggleSelfScreenSharing:function(){var n;return t.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:if(A.sharingScreen||I){o.next=16;break}return void 0!==Q&&Q.stop(),o.prev=2,o.next=5,t.default.awrap((0,S.getScreenShare)());case 5:n=o.sent,X(n.video),Y(n.video),B.shareScreen(n),o.next=14;break;case 11:o.prev=11,o.t0=o.catch(2),'NotAllowedError'!==(null==o.t0?void 0:o.t0.message)&&console.error(o.t0);case 14:o.next=19;break;case 16:B.disableScreenShare(),X(void 0),Y(void 0);case 19:case"end":return o.stop()}},null,null,[[2,11]],Promise)},disablePeerAudio:function(n){return B.disableAudio(n)},disablePeerVideo:function(n){return B.disableVideo(n)},updatePreset:function(n,t){return B.updatePreset(n,t)},setLabel:function(n,t){F((0,s.setPeerLabel)({id:n,label:t}))}},ne=!0;(0,c.useEffect)(function(){var n,t;L({id:null==B?void 0:B.peerid,audioMuted:A.audioMuted,displayName:A.displayName,userId:A.id,picture:A.displayImageURL,isMe:!0,isHost:A.isHost,videoVisible:!A.videoOff,videoTrack:null==B?void 0:null==(n=B.webCamProducer)?void 0:n.track,audioTrack:null==B?void 0:null==(t=B.micProducer)?void 0:t.track,isPinned:E===(null==B?void 0:B.peerid),clientSpecificId:A.clientSpecificId,producingAudio:!A.audioMuted,producingVideo:!A.videoOff,isScreensharing:A.sharingScreen,requestToJoinType:A.requestToJoinType,hiddenParticipant:A.hidden,webinarHiddenParticipant:A.webinarHiddenParticipant,metadata:A.metadata})},[null==B?void 0:B.peerid,A.sharingScreen,A.videoOff,A.audioMuted,A.displayName,A.hidden,A.requestToJoinType,A.metadata,null==B?void 0:null==(b=B.webCamProducer)?void 0:b.track,null==B?void 0:null==(T=B.micProducer)?void 0:T.track,A.webinarHiddenParticipant,E]),(0,c.useEffect)(function(){J&&w&&w._addUpdateParticipant((0,o.default)({},J,{isPinned:J.id===E,isScreensharing:A.sharingScreen}),re)},[J,w]),(0,c.useEffect)(function(){if(I||A.screenSharingProduction===P.MediaStates.LOADED){var n,t,o,u=I?null==(n=B.consumers.get(I.id))?void 0:n.track:null==(t=B.screenShareVideoProducer)?void 0:t.track,c=_?null==(o=B.consumers.get(_.id))?void 0:o.track:null,l=I?O.find(function(n){return n.id===I.appData.peerId}):J;z({videoTrack:u,id:null==l?void 0:l.id,displayName:"Screen - "+(null==l?void 0:l.displayName),videoVisible:!0,audioTrack:c,audioMuted:null===c,screenshare:!0})}else z(null)},[I,A.screenSharingProduction]),(0,c.useEffect)(function(){w&&(x.map(function(n){return O.find(function(t){return t.id===n.id})||w._removeParticipant(n),null}),D(O))},[O]);var ie=function(n){var t,u=(0,o.default)({},n,{isPinned:E===n.id,isScreensharing:!1}),c=j.find(function(t){return t.peerId===n.id&&'video'===t.kind&&!t.appData.screenShare}),l=j.find(function(t){return t.peerId===n.id&&'audio'===t.kind&&!t.appData.screenShare});return c&&(u.producingVideo=!0,u.videoTrack=B.consumers.get(c.id).track,u.videoScore=c.producerScore),l&&(u.producingAudio=!n.audioMuted,u.audioTrack=B.consumers.get(l.id).track,u.audioScore=l.producerScore),(null==I?void 0:null==(t=I.appData)?void 0:t.peerId)===n.id&&(u.isScreensharing=!0),u.videoVisible=!(void 0===c||c.remotelyPaused),u.audioMuted=void 0===l||l.remotelyPaused||n.audioMuted,u.audioMuted||(ne=!1),w&&w._addUpdateParticipant((0,o.default)({},u,{isPinned:u.id===E}),re),u},te=H===h.DyteViewTypes.webinar?O.filter(function(n){return!(null!=n&&n.webinarHiddenParticipant)&&n.requestToJoinType!==k.RequestToJoinType.ask}).map(ie).filter(function(n){return null!==n}):O.filter(function(n){return!(null!=n&&n.hiddenParticipant)}).map(ie).filter(function(n){return null!==n}),oe=O.map(ie).filter(function(n){return null!==n});return c.default.createElement(y.Provider,{value:{processedPeers:te,selfPeer:J,allMuted:ne,screenshareVideoConsumer:I,screenshareAudioConsumer:_,screenSharePeer:W,joinedProcessedPeers:oe}},M)}},674,[1,67,22,41,165,432,481,585,508,579,580,480,482,487]); __d(function(g,r,i,a,m,e,d){var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.setupPermissions=e.RESULTS=e.PERMISSIONS=void 0,e.uniq=N;var E=n(r(d[1])),s=n(r(d[2])),o=r(d[3]),A=r(d[4]),O=r(d[5]),R=Object.freeze({ACCEPT_HANDOVER:'android.permission.ACCEPT_HANDOVER',ACCESS_BACKGROUND_LOCATION:'android.permission.ACCESS_BACKGROUND_LOCATION',ACCESS_COARSE_LOCATION:'android.permission.ACCESS_COARSE_LOCATION',ACCESS_FINE_LOCATION:'android.permission.ACCESS_FINE_LOCATION',ACTIVITY_RECOGNITION:'android.permission.ACTIVITY_RECOGNITION',ADD_VOICEMAIL:'com.android.voicemail.permission.ADD_VOICEMAIL',ANSWER_PHONE_CALLS:'android.permission.ANSWER_PHONE_CALLS',BODY_SENSORS:'android.permission.BODY_SENSORS',CALL_PHONE:'android.permission.CALL_PHONE',CAMERA:'android.permission.CAMERA',GET_ACCOUNTS:'android.permission.GET_ACCOUNTS',PROCESS_OUTGOING_CALLS:'android.permission.PROCESS_OUTGOING_CALLS',READ_CALENDAR:'android.permission.READ_CALENDAR',READ_CALL_LOG:'android.permission.READ_CALL_LOG',READ_CONTACTS:'android.permission.READ_CONTACTS',READ_EXTERNAL_STORAGE:'android.permission.READ_EXTERNAL_STORAGE',READ_PHONE_NUMBERS:'android.permission.READ_PHONE_NUMBERS',READ_PHONE_STATE:'android.permission.READ_PHONE_STATE',READ_SMS:'android.permission.READ_SMS',RECEIVE_MMS:'android.permission.RECEIVE_MMS',RECEIVE_SMS:'android.permission.RECEIVE_SMS',RECEIVE_WAP_PUSH:'android.permission.RECEIVE_WAP_PUSH',RECORD_AUDIO:'android.permission.RECORD_AUDIO',SEND_SMS:'android.permission.SEND_SMS',USE_SIP:'android.permission.USE_SIP',WRITE_CALENDAR:'android.permission.WRITE_CALENDAR',WRITE_CALL_LOG:'android.permission.WRITE_CALL_LOG',WRITE_CONTACTS:'android.permission.WRITE_CONTACTS',WRITE_EXTERNAL_STORAGE:'android.permission.WRITE_EXTERNAL_STORAGE',BLUETOOTH_CONNECT:"android.permission.BLUETOOTH_CONNECT"}),_=Object.freeze({APP_TRACKING_TRANSPARENCY:'ios.permission.APP_TRACKING_TRANSPARENCY',BLUETOOTH_PERIPHERAL:'ios.permission.BLUETOOTH_PERIPHERAL',CALENDARS:'ios.permission.CALENDARS',CAMERA:'ios.permission.CAMERA',CONTACTS:'ios.permission.CONTACTS',FACE_ID:'ios.permission.FACE_ID',LOCATION_ALWAYS:'ios.permission.LOCATION_ALWAYS',LOCATION_WHEN_IN_USE:'ios.permission.LOCATION_WHEN_IN_USE',MEDIA_LIBRARY:'ios.permission.MEDIA_LIBRARY',MICROPHONE:'ios.permission.MICROPHONE',MOTION:'ios.permission.MOTION',PHOTO_LIBRARY:'ios.permission.PHOTO_LIBRARY',PHOTO_LIBRARY_ADD_ONLY:'ios.permission.PHOTO_LIBRARY_ADD_ONLY',REMINDERS:'ios.permission.REMINDERS',SIRI:'ios.permission.SIRI',SPEECH_RECOGNITION:'ios.permission.SPEECH_RECOGNITION',STOREKIT:'ios.permission.STOREKIT'}),I=Object.freeze({ANDROID:R,IOS:_});e.PERMISSIONS=I;var t=Object.freeze({UNAVAILABLE:'unavailable',BLOCKED:'blocked',DENIED:'denied',GRANTED:'granted',LIMITED:'limited',PROMPTED:'prompted'});e.RESULTS=t;var S=O.NativeModules.DyteRNPermissions;function C(n){return s.default.async(function(E){for(;;)switch(E.prev=E.next){case 0:return E.abrupt("return",S.available.includes(n)?S.request(n):t.UNAVAILABLE);case 1:case"end":return E.stop()}},null,null,null,Promise)}function N(n){return n.filter(function(E,s){return null!=E&&n.indexOf(E)===s})}var T,p=['bluetooth','readExternalStorage','photos','externalStorage'],L=function(n){var E=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s={camera:I.ANDROID.CAMERA,microphone:I.ANDROID.RECORD_AUDIO,bluetooth:I.ANDROID.BLUETOOTH_CONNECT,externalStorage:I.ANDROID.WRITE_EXTERNAL_STORAGE,readExternalStorage:I.ANDROID.READ_EXTERNAL_STORAGE},o={camera:I.IOS.CAMERA,microphone:I.IOS.MICROPHONE,bluetooth:I.IOS.BLUETOOTH_PERIPHERAL,photos:I.IOS.PHOTO_LIBRARY};if(!E)return'android'===O.Platform.OS?s[n]:o[n];if('android'===O.Platform.OS){var A={};return Object.keys(s).forEach(function(n){A[s[n]]=n}),A[n]}var R={};return Object.keys(o).forEach(function(n){R[o[n]]=n}),R[n]},D=function(n){return function(E){var s={camera:o.permissionEnum.INIT,microphone:o.permissionEnum.INIT};n.forEach(function(n){var A=L(n,!0);E[n]===t.GRANTED?s[A]=o.permissionEnum.ACCEPTED:E[n]!==t.PROMPTED&&(s[A]=o.permissionEnum.DENIED)}),s.camera!==o.permissionEnum.INIT&&s.microphone!==o.permissionEnum.INIT&&T&&clearInterval(T),A.store.dispatch((0,o.setParticipantPermissions)(s))}};e.setupPermissions=function(n){var o,A,R,_,I,t,u=[];[].concat(p,(0,E.default)(n)).forEach(function(n){var E=L(n);E&&u.push(E)}),"android"===O.Platform.OS&&(T&&clearInterval(T),T=setInterval(function(){S.checkMultiplePermissions(u).then(D(u))},1e3));(o=u,s.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:if('ios'!==O.Platform.OS){n.next=13;break}A={},R=N(o),_=0;case 4:if(!(_2||Math.abs(e.dy)>2)},[y]),W=n.default.useCallback(function(){var e={x:0,y:0},t=x?x():e;u.Animated.spring(X.current,{toValue:t||e,useNativeDriver:!1}).start()},[X]),q=n.default.useCallback(function(e,t){_.current=!1,k&&(k(e,t,G()),D(e,!0)),p?W():X.current.flattenOffset()},[k,p,D,W,G]),B=n.default.useCallback(function(e,t){F.current=G(),_.current=!0,p||(X.current.setOffset(Y.current),X.current.setValue({x:0,y:0}))},[G,p]),J=n.default.useCallback(function(e,t){var n=t.dx,u=t.dy,o=F.current,s=o.top,f=o.right,c=o.left,b=o.bottom,h=l(n,Number.isFinite(A)?A-c:-999999999,Number.isFinite(N)?N-f:999999999),v=l(u,Number.isFinite(I)?I-s:-999999999,Number.isFinite(T)?T-b:999999999);X.current.setValue({x:h,y:v}),w(e,t)},[N,T,A,I,w]),K=n.default.useMemo(function(){return u.PanResponder.create({onMoveShouldSetPanResponder:function(e,t){return H(t)},onMoveShouldSetPanResponderCapture:function(e,t){return H(t)},onPanResponderGrant:B,onPanResponderMove:u.Animated.event([],{listener:J,useNativeDriver:!1}),onPanResponderRelease:q})},[J,B,q,H]);n.default.useEffect(function(){var e=X.current;return p?W():e.addListener(function(e){return Y.current=e}),function(){e.removeAllListeners()}},[p]);var Q=n.default.useMemo(function(){var e=u.Dimensions.get('window');return{position:'absolute',top:0,left:0,width:e.width,height:e.height}},[]),U=n.default.useMemo(function(){var e={top:L,left:O,elevation:z,zIndex:z};return h&&(e.backgroundColor=h),s&&(e.borderRadius=c),v?(0,t.default)({},e,{alignSelf:'baseline'}):(0,t.default)({},e,{justifyContent:'center',width:c,height:c})},[v,s,h,c,O,L,z]),Z=n.default.useMemo(function(){return v||(b?n.default.createElement(u.Image,{style:{width:c,height:c},source:b}):n.default.createElement(u.Text,{style:f.text},o))},[v,b,c,o]),$=n.default.useCallback(function(e){var t=e.nativeEvent.layout,n=t.height,u=t.width;j.current={x:u,y:n}},[]),ee=n.default.useCallback(function(e){V(e),_.current||D(e,!1)},[V,D]),te=n.default.useCallback(function(){var e=u.Dimensions.get('window'),o=e.width,l=e.height;if(!(A||N||I||T))return null;var s=A||-9999,c=N?o-N:-9999,b=I||-9999,h=T?l-T:-9999;return n.default.createElement(u.View,{pointerEvents:"box-none",style:(0,t.default)({left:s,right:c,top:b,bottom:h},f.debugView)})},[N,T,A,I]);return n.default.createElement(u.View,{pointerEvents:"box-none",style:Q},P&&te(),n.default.createElement(u.Animated.View,(0,t.default)({pointerEvents:"box-none"},R,K.panHandlers,{style:X.current.getLayout()}),n.default.createElement(u.TouchableOpacity,(0,t.default)({},C,{onLayout:$,style:U,disabled:y,onPress:S,onLongPress:M,onPressIn:E,onPressOut:ee}),Z)))}s.defaultProps={renderText:'\uff0b',renderSize:36,shouldReverse:!1,disabled:!1,debug:!1,onDrag:function(){},onShortPressRelease:function(){},onDragRelease:function(){},onLongPress:function(){},onPressIn:function(){},onPressOut:function(){},onRelease:function(){},x:0,y:0,z:1},s.propTypes={renderText:o.default.string,isCircle:o.default.bool,renderSize:o.default.number,imageSource:o.default.number,renderColor:o.default.string,children:o.default.element,shouldReverse:o.default.bool,disabled:o.default.bool,debug:o.default.bool,animatedViewProps:o.default.object,touchableOpacityProps:o.default.object,onDrag:o.default.func,onShortPressRelease:o.default.func,onDragRelease:o.default.func,onLongPress:o.default.func,onPressIn:o.default.func,onPressOut:o.default.func,onRelease:o.default.func,onReverse:o.default.func,x:o.default.number,y:o.default.number,z:o.default.number,minX:o.default.number,minY:o.default.number,maxX:o.default.number,maxY:o.default.number};var f=u.StyleSheet.create({text:{color:'#fff',textAlign:'center'},test:{backgroundColor:'red'},debugView:{backgroundColor:'#ff000044',position:'absolute',borderColor:'#fced0ecc',borderWidth:4}})},706,[1,22,165,2,204]); __d(function(g,r,i,a,m,_e,d){"use strict";var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.swipeDirections=_e.default=void 0;var t=e(r(d[1])),n=e(r(d[2])),o=e(r(d[3])),s=e(r(d[4])),l=e(r(d[5])),u=e(r(d[6])),c=e(r(d[7])),f=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var u=s?Object.getOwnPropertyDescriptor(e,l):null;u&&(u.get||u.set)?Object.defineProperty(o,l,u):o[l]=e[l]}o.default=e,n&&n.set(e,o);return o})(r(d[8])),p=r(d[9]);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var S={SWIPE_UP:"SWIPE_UP",SWIPE_DOWN:"SWIPE_DOWN",SWIPE_LEFT:"SWIPE_LEFT",SWIPE_RIGHT:"SWIPE_RIGHT"};_e.swipeDirections=S;var _={velocityThreshold:.3,directionalOffsetThreshold:80,gestureIsClickThreshold:5};function P(e,t,n,o){return Math.abs(e)>t&&Math.abs(n)0?n:t:this._isValidVerticalSwipe(e)?u>0?s:o:null}},{key:"_isValidHorizontalSwipe",value:function(e){var t=e.vx,n=e.dy,o=this.swipeConfig;return P(t,o.velocityThreshold,n,o.directionalOffsetThreshold)}},{key:"_isValidVerticalSwipe",value:function(e){var t=e.vy,n=e.dx,o=this.swipeConfig;return P(t,o.velocityThreshold,n,o.directionalOffsetThreshold)}},{key:"render",value:function(){return f.default.createElement(p.View,(0,t.default)({},this.props,this._panResponder.panHandlers))}}]),I})(f.Component);_e.default=y},707,[1,22,9,10,16,12,14,17,165,2]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=y(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),p=t(r(d[8]));function y(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(y=function(t){return t?l:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var y=t.isOpen,x=t.onClose,h=t.onLeave,E=(0,l.useContext)(f.ConfigServiceContext).sessionConfig,b=(0,o.useWindowDimensions)(),v=E.theme.dimensions||b,C=(v.height,.9*v.width),w=C/2-20,j=(0,l.useContext)(c.MediaRoomContext).mediaRoom,k=(0,l.useContext)(s.ThemeContext).colors;return l.default.createElement(u.Modal,{isVisible:y,backdropOpacity:.8,backdropColor:k.secondary[800]},l.default.createElement(u.Flex,{width:C,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:p.default.large},l.default.createElement(u.Flex,{py:25},l.default.createElement(u.Text,{fontSize:28,fontWeight:"bold"},"Leave")),l.default.createElement(u.Flex,null,l.default.createElement(u.Text,{fontSize:"lg"},"Are you sure you want to leave the call?")),l.default.createElement(u.Flex,{display:"flex",py:20},l.default.createElement(u.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},l.default.createElement(u.Button,{onClick:x},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"secondary.700",height:40,width:w-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Cancel"))),l.default.createElement(u.Button,{onClick:h},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"danger.500",height:40,width:w-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Leave")))),l.default.createElement(u.Flex,null,E.permissions.kick_participant&&l.default.createElement(u.Button,{onClick:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(j.kickAll());case 2:case"end":return t.stop()}},null,null,null,Promise)}},l.default.createElement(u.Flex,{display:"flex",direction:"row",mt:15,justify:"space-around"},l.default.createElement(u.Flex,{bg:"danger.500",height:40,width:2*w,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"End Meeting"))))))))}},708,[1,67,165,2,512,585,508,514,676]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=x(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),p=t(r(d[8])),y=r(d[9]);function x(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(x=function(t){return t?l:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var x=t.isOpen,h=t.onClose,E=t.onLeave,b=(0,l.useContext)(f.ConfigServiceContext).sessionConfig,v=(0,o.useWindowDimensions)(),C=(0,y.useScale)(b.theme.dimensions||v),w=(C.height,.9*C.width),j=w/2-20,k=(0,l.useContext)(c.MediaRoomContext).mediaRoom,O=(0,l.useContext)(s.ThemeContext).colors;return l.default.createElement(u.Modal,{isVisible:x,backdropOpacity:.8,backdropColor:O.secondary[800]},l.default.createElement(u.Flex,{width:w,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:p.default.large},l.default.createElement(u.Flex,{py:25},l.default.createElement(u.Text,{fontSize:28,fontWeight:"bold"},"Leave")),l.default.createElement(u.Flex,null,l.default.createElement(u.Text,{fontSize:"lg"},"Are you sure you want to leave the call?")),l.default.createElement(u.Flex,{display:"flex",py:20},l.default.createElement(u.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},l.default.createElement(u.Button,{onClick:h},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"secondary.700",height:40,width:j-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Cancel"))),l.default.createElement(u.Button,{onClick:E},l.default.createElement(u.Flex,{borderRadius:p.default.small,bg:"danger.500",height:40,width:j-4,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"Leave")))),l.default.createElement(u.Flex,null,b.permissions.kick_participant&&l.default.createElement(u.Button,{onClick:function(){return n.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.default.awrap(k.kickAll());case 2:case"end":return t.stop()}},null,null,null,Promise)}},l.default.createElement(u.Flex,{display:"flex",direction:"row",mt:15,justify:"space-around"},l.default.createElement(u.Flex,{bg:"danger.500",height:40,width:2*j,alignItems:"center",justifyContent:"center"},l.default.createElement(u.Text,{fontSize:"lg"},"End Meeting"))))))))}},708,[1,67,165,2,512,585,508,514,676,493]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=s(n);if(o&&o.has(t))return o.get(t);var l={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var f=c?Object.getOwnPropertyDescriptor(t,u):null;f&&(f.get||f.set)?Object.defineProperty(l,u,f):l[u]=t[u]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=r(d[3]),c=r(d[4]),u=r(d[5]),f=r(d[6]),p=t(r(d[7]));function s(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(s=function(t){return t?o:n})(t)}var b=function(t){var s=t.isOpen,b=t.peers,y=(0,n.useContext)(l.MediaRoomContext).mediaRoom,x=(0,c.useDispatch)(),v=(0,n.useContext)(f.ThemeContext).colors,E=function(t){x((0,u.removeWaitListPeer)({id:t})),y.rejectWaitingRequest(t)};return n.default.createElement(o.Modal,{isVisible:s,backdropOpacity:.8,backdropColor:v.secondary[800]},n.default.createElement(o.Text,{fontWeight:"bold"},"Waiting Requests"),n.default.createElement(o.Stack,{spacing:6,height:"80"},b.map(function(t){return n.default.createElement(o.Flex,{direction:"row",alignItems:"center"},n.default.createElement(p.default,{name:t.name,bgColor:v.primary[700]}),n.default.createElement(o.Flex,{marginLeft:3,flexGrow:1,alignItems:"center",paddingY:2,borderBottom:"1px solid "+v.secondary[800]},n.default.createElement(o.Text,{color:v.textPrimary[200],fontSize:"lg"},t.name),n.default.createElement(o.Flex,{marginLeft:"auto"},n.default.createElement(o.Button,{_hover:{borderColor:v.danger[500]},onClick:function(){return E(t.id)}},n.default.createElement(o.Box,{bg:"secondary.700",p:4},n.default.createElement(o.Icon,{boxSize:"16",name:"close"}))),n.default.createElement(o.Button,{_hover:{borderColor:v.danger[500]},onClick:function(){return E(t.id)}},n.default.createElement(o.Box,{bg:"primary.500",p:4},n.default.createElement(o.Icon,{boxSize:"16",name:"check"}))))))})))};e.default=b},709,[1,165,512,585,432,480,514,682]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var c=u?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(l,o,c):l[o]=e[o]}l.default=e,n&&n.set(e,l);return l})(r(d[2])),l=r(d[3]),u=r(d[4]),o=r(d[5]),c=e(r(d[6])),f=e(r(d[7])),s=r(d[8]),p=r(d[9]),E=r(d[10]),S=e(r(d[11])),b=r(d[12]),h=r(d[13]),x=r(d[14]),w=e(r(d[15])),v=r(d[16]);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}var P=n.default.memo(function(e){var y=e.title,P=(e.copyLink,e.linkCopied,e.width),C=(e.height,e.noOfParticipants,(0,l.useSelector)(function(e){return e.room.waitingState})),O=(0,n.useContext)(s.ConfigServiceContext),I=O.meeting,j=O.sessionConfig,k=(0,l.useSelector)(function(e){return e.plugin.main}),T='LANDSCAPE'===n.default.useContext(o.OrientationContext).orientation,_=(0,l.useSelector)(function(e){return e.peers.recordingPeer}),D=(0,n.useState)(!1),R=(0,t.default)(D,2),W=R[0],M=R[1],B=(0,n.useRef)(null),N=(0,n.useRef)(!1),z=(0,l.useSelector)(function(e){return e.room.roomViewType}),A=(0,l.useSelector)(function(e){return e.participant.presentingState}),V=(0,l.useSelector)(function(e){return e.participant.videoOff}),F=(0,n.useContext)(x.PeersServiceContext),G=(F.processedPeers,F.selfPeer,F.joinedProcessedPeers),L=n.default.useContext(v.DrawerContext),H=L.setDrawerExpander,q=L.setopenedTab;if((0,n.useEffect)(function(){_&&!N.current?(null==I||I.emit(I.Events.recordingStarted),N.current=!0,B.current=setInterval(function(){M(function(e){return!e})},1e3)):!_&&N.current&&(N.current=!1,null==I||I.emit(I.Events.recordingStopped),clearInterval(B.current))},[_]),(0,n.useEffect)(function(){return function(){B.current&&clearInterval(B.current)}},[]),T||k.length>0)return null;return n.default.createElement(E.Flex,{height:56,width:P,bg:"secondary.1000",justify:"center",align:"center",pt:'android'===u.Platform.OS?10:26},n.default.createElement(E.Flex,{borderRadius:c.default.medium,width:P-8,justify:"space-between",direction:"row",px:12},n.default.createElement(E.VStack,null,n.default.createElement(E.Stack,{align:"center",width:P/2},j.theme.header.elements.title?n.default.createElement(E.Text,{fontWeight:"bold"},y):null),n.default.createElement(E.Stack,{isInline:!0,spacing:2,pt:2,align:"center"},j.theme.header.elements.timer&&C!==p.WaitingState.WAITING&&n.default.createElement(f.default,null),_&&W&&n.default.createElement(E.Box,{ml:12,bg:"danger.500",pl:4,pr:6,borderRadius:4,direction:"row",alignItems:"center"},n.default.createElement(E.Icon,{boxSize:"15",name:"fiber-manual-record",fill:"white"}),n.default.createElement(E.Text,{color:"white"},"REC")))),n.default.createElement(E.HStack,{align:"flex-end",mb:2},j.theme.control_bar.elements.participants&&n.default.createElement(E.Box,{mr:28},n.default.createElement(E.Box,{position:"absolute",top:-12,zIndex:25,right:G.length+1>99?-18:-10},n.default.createElement(w.default,{number:G.length+1,color:"primary.500"})),n.default.createElement(E.Button,{onClick:function(){H(!0),q('participants')}},n.default.createElement(E.Icon,{boxSize:"24",name:"people",fill:"textPrimary.100"}))),!V&&(z!==b.DyteViewTypes.webinar||A===h.PresentingState.PRESENTING)&&n.default.createElement(S.default,null))))});_e.default=P},710,[1,41,165,432,2,575,676,711,508,480,512,712,482,487,674,713,714]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=c(n);if(u&&u.has(t))return u.get(t);var o={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in t)if("default"!==l&&Object.prototype.hasOwnProperty.call(t,l)){var s=f?Object.getOwnPropertyDescriptor(t,l):null;s&&(s.get||s.set)?Object.defineProperty(o,l,s):o[l]=t[l]}o.default=t,u&&u.set(t,o);return o})(r(d[2])),o=r(d[3]),f=r(d[4]);function c(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(c=function(t){return t?u:n})(t)}var l=function(t){return Math.trunc(t).toString().padStart(2,'0')},s=function(){var t=(0,o.useSelector)(function(t){return t.room.startedAt}),c=u.default.useRef(),s=u.default.useState(0),p=(0,n.default)(s,2),v=p[0],y=p[1],O=u.default.useRef();return(0,u.useEffect)(function(){return t&&(c.current=requestAnimationFrame(function n(){var u=((new Date).getTime()-new Date(t).getTime())/1e3;y(u),O.current=setTimeout(function(){c.current&&(c.current=requestAnimationFrame(n))},500)})),function(){clearTimeout(O.current),cancelAnimationFrame(c.current)}},[t]),u.default.createElement(f.Text,{color:"textPrimary.400"},v>=3600&&u.default.createElement(u.default.Fragment,null,l(v/3600),"h",' '),l(v%3600/60),"m",' ',l(v%60),"s")};e.default=s},711,[1,41,165,432,512]); @@ -722,13 +722,13 @@ __d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule", __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.MakeMenu=function(t){var c=t.menu;(0,n.useContext)(o.ThemeContext).colors;return n.default.createElement(l.Flex,null,c.map(function(t,o){var c=t.title,s=t.defaultValue,p=t.onChange,b=t.options;return n.default.createElement(n.default.Fragment,{key:(0,f.nanoid)()},0!==o&&n.default.createElement(l.Box,null),n.default.createElement(l.Flex,null,n.default.createElement(l.Text,{fontSize:"md",mb:10,fontWeight:"bold",color:"textPrimary.100"},c),b.map(function(t,o){var c=t.key,f=t.value,b=t.children;return n.default.createElement(l.Button,{key:""+(c+o),onClick:function(){return p(f)}},n.default.createElement(l.HStack,{justify:"space-between",p:16,mb:4,bg:"secondary.800",borderRadius:u.default.small},n.default.createElement(l.Text,{fontSize:"sm"},b),s===f?n.default.createElement(l.Icon,{name:"check",fill:"success.500"}):null))})))}))},e.StageControlButton=p;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=s(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,l&&l.set(t,o);return o})(r(d[1])),l=r(d[2]),o=r(d[3]),u=t(r(d[4])),c=r(d[5]),f=r(d[6]);function s(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(s=function(t){return t?l:n})(t)}function p(t){var o=t.variant,u=(t.label,t.icon),f=t.disabled,s=t.onClick,p=(t.isActive,t.menu,t.badge),b=t.ariaLabel,y='LANDSCAPE'===n.default.useContext(c.OrientationContext).orientation;return n.default.createElement(l.Flex,null,''!==p&&n.default.createElement(l.Box,{className:"dyte-client-notificationBadge",bg:"primary.500",textColor:"textPrimary.100",height:4,position:"absolute",right:"2",top:"1",fontSize:"xs"},n.default.createElement("span",null,p)),n.default.createElement(l.Button,{variant:o||'controls',onClick:s,disabled:f},n.default.createElement(l.VStack,{py:10,"aria-label":b,minWidth:64,align:"center",justify:"center"},n.default.createElement(l.Box,{fontSize:"xl",transform:[{rotate:y?'90deg':'0deg'}]},u))))}p.defaultProps={disabled:!1,variant:null,menu:[],isActive:!1,badge:'',ariaLabel:''}},716,[1,165,512,514,676,575,475]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=E(n);if(o&&o.has(t))return o.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(l,c,f):l[c]=t[c]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=r(d[3]),u=r(d[4]),c=r(d[5]),f=t(r(d[6])),s=r(d[7]),p=r(d[8]),y=r(d[9]),x=r(d[10]);function E(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(E=function(t){return t?o:n})(t)}o.NativeModules.DyteHelper;e.default=function(t){var E=t.isOpen,b=t.onClose,C=(0,n.useContext)(u.ConfigServiceContext).sessionConfig,h=(0,o.useWindowDimensions)(),v=C.theme.dimensions||h,P=(v.height,.9*v.width),w=P/2-20,S=(0,n.useContext)(c.ThemeContext).colors,T=(0,s.useDispatch)(),O=(0,n.useContext)(p.MediaRoomContext).mediaRoom,j=(0,s.useSelector)(function(t){return t.participant.requestToJoinStageState});return n.default.createElement(l.Modal,{isVisible:E,backdropOpacity:.8,backdropColor:S.secondary[800]},n.default.createElement(l.Flex,{width:P,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:f.default.large},n.default.createElement(l.Flex,{py:25},n.default.createElement(l.Text,{fontSize:28,fontWeight:"bold"},"Drop")),n.default.createElement(l.Flex,null,n.default.createElement(l.Text,{fontSize:"lg"},"Do you want to stop presenting?")),n.default.createElement(l.Flex,{display:"flex",py:20},n.default.createElement(l.Flex,{display:"flex",direction:"row",pt:15,justify:"space-around"},n.default.createElement(l.Button,{onClick:b},n.default.createElement(l.Flex,{borderRadius:f.default.small,bg:"secondary.700",height:40,width:w-4,alignItems:"center",justifyContent:"center"},n.default.createElement(l.Text,{fontSize:"lg"},"Cancel"))),n.default.createElement(l.Button,{onClick:function(){j===y.RequestToJoinStageState.ACCEPTED?(b(),O.removePeerFromStage(O.peerid,x.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT)):(O.stopPresenting(),T((0,y.stoppedPresenting)()),b())}},n.default.createElement(l.Flex,{borderRadius:f.default.small,bg:"danger.500",height:40,width:w-4,alignItems:"center",justifyContent:"center"},n.default.createElement(l.Text,{fontSize:"lg"},"Drop")))))))}},717,[1,165,2,512,508,514,676,432,585,487,497]); __d(function(g,r,i,a,m,e,d){var s,n,o;Object.defineProperty(e,"__esModule",{value:!0}),e.SessionProducerAccessType=e.SessionJoiningRestriction=e.MessageTypes=void 0,e.SessionJoiningRestriction=s,(function(s){s[s.NO_VIDEO=0]="NO_VIDEO",s[s.NO_MIC=1]="NO_MIC"})(s||(e.SessionJoiningRestriction=s={})),e.SessionProducerAccessType=n,(function(s){s[s.NOT_ALLOWED=0]="NOT_ALLOWED",s[s.REQUEST_FIRST=1]="REQUEST_FIRST",s[s.ALLOWED=2]="ALLOWED"})(n||(e.SessionProducerAccessType=n={})),e.MessageTypes=o,(function(s){s[s.text=0]="text",s[s.image=1]="image",s[s.file=2]="file",s[s.poll=3]="poll"})(o||(e.MessageTypes=o={}))},718,[]); -__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=E(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(o,f,c):o[f]=t[f]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),f=t(r(d[5])),c=r(d[6]),s=r(d[7]),m=t(r(d[8])),p=t(r(d[9])),x=r(d[10]),b=r(d[11]),y=r(d[12]);function E(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(E=function(t){return t?l:n})(t)}var C=function(t){var E=t.options,C=t.unReadChatMessages,h=t.unSeenPolls,w=t.webinarUnseenRequest,v=(0,l.useRef)(null),k=(0,l.useContext)(c.ConfigServiceContext),P=(k.meeting,k.sessionConfig),j=(0,l.useContext)(u.ThemeContext).colors,S=(0,o.useWindowDimensions)(),B=P.theme.dimensions||S,O=B.height,M=B.width,R=l.default.useContext(y.DrawerContext),z=R.drawerExpanded,D=R.setDrawerExpander,T=R.openedTab,_=R.setopenedTab,I=function(){_(null),D(!1)};(0,l.useEffect)(function(){var t;z&&v&&(null==(t=v.current)||t.setModalVisible())},[z]);var W=function(){return _(null),D(!1),!0},A='LANDSCAPE'===l.default.useContext(x.OrientationContext).orientation,F=E.findIndex(function(t){return t.id===T}),q=F>-1?F:null;if(z&&q&&E[q].mainComponent)return l.default.createElement(o.Modal,{visible:!0,onRequestClose:W},l.default.createElement(s.Flex,{width:M,height:O,bg:"secondary.1000",direction:"row",flexWrap:"wrap",justify:"space-between"},l.default.createElement(p.default,{heading:E[q].label,onBackButtonClick:W}),l.default.createElement(s.Box,{width:M},E[q].mainComponent)));var H=A?24:8;return l.default.createElement(n.default,{containerStyle:{backgroundColor:j.secondary[900],justifyContent:'space-between'},overlayColor:"#000",ref:v,extraScroll:1,onClose:I,gestureEnabled:!0},null===q?l.default.createElement(s.VStack,{px:"6",py:"10",mx:H,borderRadius:m.default.medium,bg:"secondary.800",mb:12},E.map(function(t,n){var o=t.label,u=t.icon,c=t.disabled,p=t.id;return l.default.createElement(s.Button,{key:(0,b.nanoid)(),onClick:void 0!==E[n].onClick?E[n].onClick:function(){return _(p)},disabled:c},l.default.createElement(s.HStack,{p:12,px:16,borderRadius:m.default.small,align:"center",justify:"space-between"},l.default.createElement(s.Text,{fontSize:"xs",marginTop:"5px",textAlign:"center",color:c?'textPrimary.400':'textPrimary.200'},o),l.default.createElement(s.Box,{fontSize:"xl"},C&&C.length>0&&'Chat'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:C.length})),h&&h.length>0&&'Polls'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:h.length})),'Participants'===o&&w&&w.length>0&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:w.length})),'string'==typeof u?l.default.createElement(s.Icon,{name:u,boxSize:"26",fill:c?'textPrimary.400':'textPrimary.200'}):u)))})):l.default.createElement(s.Flex,{px:"6",py:"10",mx:4,borderRadius:m.default.medium,bg:"secondary.900",mb:12,mt:16},E[q].drawerComponent),(null!==q||!A)&&l.default.createElement(s.Flex,{mx:H,mb:8},l.default.createElement(s.Button,{onClick:null!==q?function(){return _(null)}:function(){return I()},width:M},l.default.createElement(s.HStack,{p:16,borderRadius:m.default.small,justify:"center",bg:"secondary.800"},l.default.createElement(s.Text,{ml:-4,color:"danger.500"},"Back",null===q&&' to Meeting')))))};e.default=C},719,[1,720,165,2,514,713,508,512,676,724,575,475,714]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=C(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(o,f,c):o[f]=t[f]}o.default=t,l&&l.set(t,o);return o})(r(d[2])),o=r(d[3]),u=r(d[4]),f=t(r(d[5])),c=r(d[6]),s=r(d[7]),m=t(r(d[8])),p=t(r(d[9])),x=r(d[10]),b=r(d[11]),y=r(d[12]),E=r(d[13]);function C(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(C=function(t){return t?l:n})(t)}var h=function(t){var C=t.options,h=t.unReadChatMessages,w=t.unSeenPolls,v=t.webinarUnseenRequest,k=(0,l.useRef)(null),P=(0,l.useContext)(c.ConfigServiceContext),S=(P.meeting,P.sessionConfig),j=(0,l.useContext)(u.ThemeContext).colors,B=(0,o.useWindowDimensions)(),O=(0,E.useScale)(S.theme.dimensions||B),M=O.height,R=O.width,z=l.default.useContext(y.DrawerContext),D=z.drawerExpanded,T=z.setDrawerExpander,_=z.openedTab,I=z.setopenedTab,W=function(){I(null),T(!1)};(0,l.useEffect)(function(){var t;D&&k&&(null==(t=k.current)||t.setModalVisible())},[D]);var A=function(){return I(null),T(!1),!0},F='LANDSCAPE'===l.default.useContext(x.OrientationContext).orientation,q=C.findIndex(function(t){return t.id===_}),H=q>-1?q:null;if(D&&H&&C[H].mainComponent)return l.default.createElement(o.Modal,{visible:!0,onRequestClose:A},l.default.createElement(s.Flex,{width:R,height:M,bg:"secondary.1000",direction:"row",flexWrap:"wrap",justify:"space-between"},l.default.createElement(p.default,{heading:C[H].label,onBackButtonClick:A}),l.default.createElement(s.Box,{width:R},C[H].mainComponent)));var V=F?24:8;return l.default.createElement(n.default,{containerStyle:{backgroundColor:j.secondary[900],justifyContent:'space-between'},overlayColor:"#000",ref:k,extraScroll:1,onClose:W,gestureEnabled:!0},null===H?l.default.createElement(s.VStack,{px:"6",py:"10",mx:V,borderRadius:m.default.medium,bg:"secondary.800",mb:12},C.map(function(t,n){var o=t.label,u=t.icon,c=t.disabled,p=t.id;return l.default.createElement(s.Button,{key:(0,b.nanoid)(),onClick:void 0!==C[n].onClick?C[n].onClick:function(){return I(p)},disabled:c},l.default.createElement(s.HStack,{p:12,px:16,borderRadius:m.default.small,align:"center",justify:"space-between"},l.default.createElement(s.Text,{fontSize:"xs",marginTop:"5px",textAlign:"center",color:c?'textPrimary.400':'textPrimary.200'},o),l.default.createElement(s.Box,{fontSize:"xl"},h&&h.length>0&&'Chat'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:h.length})),w&&w.length>0&&'Polls'===o&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:w.length})),'Participants'===o&&v&&v.length>0&&l.default.createElement(s.Box,{position:"absolute",top:-8,zIndex:25,left:-4},l.default.createElement(f.default,{number:v.length})),'string'==typeof u?l.default.createElement(s.Icon,{name:u,boxSize:"26",fill:c?'textPrimary.400':'textPrimary.200'}):u)))})):l.default.createElement(s.Flex,{px:"6",py:"10",mx:4,borderRadius:m.default.medium,bg:"secondary.900",mb:12,mt:16},C[H].drawerComponent),(null!==H||!F)&&l.default.createElement(s.Flex,{mx:V,mb:8},l.default.createElement(s.Button,{onClick:null!==H?function(){return I(null)}:function(){return W()},width:R},l.default.createElement(s.HStack,{p:16,borderRadius:m.default.small,justify:"center",bg:"secondary.800"},l.default.createElement(s.Text,{ml:-4,color:"danger.500"},"Back",null===H&&' to Meeting')))))};e.default=h},719,[1,720,165,2,514,713,508,512,676,724,575,475,714,493]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1])).default;e.default=u},720,[1,721]); __d(function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),o=e(r(d[2])),n=e(r(d[3])),l=e(r(d[4])),s=e(r(d[5])),c=e(r(d[6])),u=e(r(d[7])),f=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=y(t);if(o&&o.has(e))return o.get(e);var n={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=l?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(n,s,c):n[s]=e[s]}n.default=e,o&&o.set(e,n);return n})(r(d[8])),p=r(d[9]),h=r(d[10]),v=r(d[11]);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(y=function(e){return e?o:t})(e)}function S(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var b=0,w=["dummy"],T="android"===p.Platform.OS&&p.StatusBar.currentHeight||0,k=p.Dimensions.get("window").height,_=(function(e){(0,s.default)(P,e);var y,_,O=(y=P,_=S(),function(){var e,t=(0,u.default)(y);if(_){var o=(0,u.default)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return(0,c.default)(this,e)});function P(e){var l,s;return(0,n.default)(this,P),(s=O.call(this,e)).actionSheetHeight=0,s.prevScroll=0,s.timeout=null,s.offsetY=0,s.currentOffsetFromBottom=0,s.scrollAnimationEndValue=0,s.hasBounced=!1,s.layoutHasCalled=!1,s.isClosing=!1,s.isRecoiling=!1,s.isReachedTop=!1,s.deviceLayoutCalled=!1,s.transformValue=new p.Animated.Value(0),s.opacityValue=new p.Animated.Value(0),s.borderRadius=new p.Animated.Value(10),s.underlayTranslateY=new p.Animated.Value(100),s.underlayScale=new p.Animated.Value(1),s.initialScrolling=!1,s.keyboardShowSubscription=null,s.KeyboardHideSubscription=null,s.snapToOffset=function(e){var t=.15*s.state.deviceHeight,o=s.props.extraScroll||0,n=(s.props.gestureEnabled,e+t+o);s.currentOffsetFromBottom=n/s.actionSheetHeight,s.currentOffsetFromBottom=s.currentOffsetFromBottom-.15,setTimeout(function(){s._scrollTo(n),s.updateActionSheetPosition(n)},500)},s.show=function(){s.setModalVisible(!0)},s.hide=function(){s.setModalVisible(!1)},s.setModalVisible=function(e){var t=s.state.modalVisible;if(s.initialScrolling=!1,void 0!==e){if(t===e)return;t=!e}t?s._hideModal():s.setState({modalVisible:!0,scrollable:s.props.gestureEnabled||!1})},s._hideModal=function(){s.isClosing||(s.isClosing=!0,s._hideAnimation())},s.measure=function(){return t.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){setTimeout(function(){var t;s.safeAreaViewRef.current?null==(t=s.safeAreaViewRef.current)||t.measure(function(t,o,n,l){T=0===l?25:l,T=!s.props.drawUnderStatusBar&&T>30?T-12:T,e(T)}):e(T=25)},50)}));case 1:case"end":return e.stop()}},null,null,null,Promise)},s._showModal=function(e){var o,n,l,c,u,f;return t.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(o=s.props,n=o.gestureEnabled,l=o.delayActionSheetDraw,c=o.delayActionSheetDrawTime,null!=e&&e.nativeEvent){h.next=3;break}return h.abrupt("return");case 3:if(u=e.nativeEvent.layout.height,!s.layoutHasCalled){h.next=10;break}return s.actionSheetHeight=u,s._returnToPrevScrollPosition(u),h.abrupt("return");case 10:if(s.initialScrolling=!0,s.layoutHasCalled=!0,s.actionSheetHeight=u,f=s.getInitialScrollPosition(),s.isRecoiling=!1,"ios"!==p.Platform.OS){h.next=20;break}return h.next=18,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 18:h.next=23;break;case 20:if(!l){h.next=23;break}return h.next=23,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 23:if(s._scrollTo(f,!1),s.prevScroll=f,"ios"!==p.Platform.OS){h.next=30;break}return h.next=28,t.default.awrap((0,v.waitAsync)(null!=c?c:0));case 28:h.next=33;break;case 30:if(!l){h.next=33;break}return h.next=33,t.default.awrap((0,v.waitAsync)((null!=c?c:0)/2));case 33:s._openAnimation(f),s.underlayScale.setValue(1),s.underlayTranslateY.setValue(100),n||s.props.onPositionChanged&&s.props.onPositionChanged(!0),s.updateActionSheetPosition(f);case 38:case"end":return h.stop()}},null,null,null,Promise)},s._openAnimation=function(e){var t=s.props,o=t.bounciness,n=t.bounceOnOpen,l=t.animated,c=t.openAnimationSpeed;l?(s.transformValue.setValue(e),p.Animated.parallel([p.Animated.spring(s.transformValue,{toValue:0,bounciness:n?o:1,speed:c,useNativeDriver:!0}),p.Animated.timing(s.opacityValue,{toValue:1,duration:150,useNativeDriver:!0})]).start()):s.opacityValue.setValue(1)},s._onScrollBegin=function(e){return t.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},null,null,null,Promise)},s._onScrollBeginDrag=function(e){var o;return t.default.async(function(t){for(;;)switch(t.prev=t.next){case 0:o=e.nativeEvent.contentOffset.y,s.prevScroll=o;case 2:case"end":return t.stop()}},null,null,null,Promise)},s._onScrollEnd=function(e){var o,n,l,c,u,f,p,h;return t.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:if(o=s.props,n=o.springOffset,l=o.extraScroll,c=e.nativeEvent.contentOffset.y,u=.15*s.state.deviceHeight,!s.isRecoiling){y.next=5;break}return y.abrupt("return");case 5:if(!(s.prevScroll.75*(null!=n?n:100)||s.initialScrolling)){y.next=19;break}return s.isRecoiling=!0,s._applyHeightLimiter(),s.currentOffsetFromBottom=s.currentOffsetFromBottom<(null!=(f=s.props.initialOffsetFromBottom)?f:1)&&null!=(p=s.props.initialOffsetFromBottom)?p:1,h=s.actionSheetHeight*s.currentOffsetFromBottom+u+(null!=l?l:100),s.initialScrolling&&(s.initialScrolling=!1,h=s.prevScroll),s._scrollTo(h),y.next=15,t.default.awrap((0,v.waitAsync)(300));case 15:s.isRecoiling=!1,s.props.onPositionChanged&&s.props.onPositionChanged(!0),y.next=20;break;case 19:s._returnToPrevScrollPosition(s.actionSheetHeight);case 20:y.next=33;break;case 22:if(!(s.prevScroll-c>(null!=n?n:100))){y.next=26;break}s._hideModal(),y.next=33;break;case 26:if(!s.isRecoiling){y.next=28;break}return y.abrupt("return");case 28:return s.isRecoiling=!0,s._returnToPrevScrollPosition(s.actionSheetHeight),y.next=32,t.default.awrap((0,v.waitAsync)(300));case 32:s.isRecoiling=!1;case 33:case"end":return y.stop()}},null,null,null,Promise)},s._scrollTo=function(e){var t,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s.scrollAnimationEndValue=e,s.prevScroll=e,null==(t=s.scrollViewRef.current)||t._listRef._scrollRef.scrollTo({x:0,y:s.scrollAnimationEndValue,animated:o}),s.initialScrolling&&setTimeout(function(){s.initialScrolling=!1},500)},s._onTouchMove=function(){s.props.closeOnTouchBackdrop&&s._hideModal(),s.setState({scrollable:!1})},s._onTouchStart=function(){s.props.closeOnTouchBackdrop&&s._hideModal(),s.setState({scrollable:!1})},s._onTouchEnd=function(){s._returnToPrevScrollPosition(s.actionSheetHeight),s.props.gestureEnabled&&s.setState({scrollable:!0})},s._onScroll=function(e){s.offsetY=e.nativeEvent.contentOffset.y;var t=.15*s.state.deviceHeight,o=s.actionSheetHeight+t-s.offsetY;if(s.actionSheetHeight=s.state.deviceHeight-1)if(os.prevScroll)){t.next=2;break}return t.abrupt("return");case 2:s.prevScroll-(null!=(e=s.props.springOffset)?e:100)>s.offsetY?(o=s.getInitialScrollPosition(),s.offsetY>o-100?(s.isRecoiling=!0,s._scrollTo(o),s.currentOffsetFromBottom=null!=(n=s.props.initialOffsetFromBottom)?n:1,s.prevScroll=o,setTimeout(function(){s.isRecoiling=!1},500)):s._hideModal()):(s.isRecoiling=!0,s._scrollTo(s.prevScroll,!0),setTimeout(function(){s.isRecoiling=!1},500));case 3:case"end":return t.stop()}},null,null,null,Promise)},s._onDeviceLayout=function(e){var n;return t.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:n=(0,o.default)({},e),s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(function(){var e,o,l,c,u,f;return t.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=0,"ios"!==p.Platform.OS){h.next=7;break}return h.next=4,t.default.awrap(s.measure());case 4:h.t0=h.sent,h.next=8;break;case 7:h.t0=p.StatusBar.currentHeight;case 8:if(c=h.t0,s.props.drawUnderStatusBar){h.next=16;break}if("android"!==p.Platform.OS||s.props.statusBarTranslucent){h.next=12;break}return h.abrupt("return");case 12:l=null!=c?c:0,c&&s.indicatorTranslateY.setValue(-c),h.next=17;break;case 16:s.updateActionSheetPosition(s.offsetY);case 17:if(u=n.nativeEvent.layout.height-l,f=p.Dimensions.get("window").width,(null==u?void 0:u.toFixed(0))!==(null==(e=k)?void 0:e.toFixed(0))||(null==f?void 0:f.toFixed(0))!==(null==(o=s.state.deviceWidth)?void 0:o.toFixed(0))||!s.deviceLayoutCalled){h.next=21;break}return h.abrupt("return");case 21:s.deviceLayoutCalled=!0,k=u,s.setState({deviceHeight:u,deviceWidth:f,portrait:u>f,paddingTop:null!=c?c:0});case 24:case"end":return h.stop()}},null,null,null,Promise)},1);case 3:case"end":return l.stop()}},null,null,null,Promise)},s._keyExtractor=function(e){return e},s.state={modalVisible:!1,scrollable:!1,layoutHasCalled:!1,keyboard:!1,deviceHeight:k||(0,v.getDeviceHeight)(s.props.statusBarTranslucent),deviceWidth:p.Dimensions.get("window").width,portrait:!0,safeAreaInnerHeight:b,paddingTop:T,keyboardPadding:0},s.scrollViewRef=(0,f.createRef)(),s.safeAreaViewRef=(0,f.createRef)(),s.currentOffsetFromBottom=null!=(l=s.props.initialOffsetFromBottom)?l:1,s.indicatorTranslateY=new p.Animated.Value(0|-s.state.paddingTop),s}return(0,l.default)(P,[{key:"_hideAnimation",value:function(){var e=this,t=this.props,o=t.animated,n=t.closeAnimationDuration,l=t.bottomOffset,s=t.initialOffsetFromBottom,c=t.extraScroll,u=t.closable;p.Animated.parallel([p.Animated.timing(this.opacityValue,{toValue:u?0:1,duration:o?n:1,useNativeDriver:!0}),p.Animated.timing(this.transformValue,{toValue:u?2*this.actionSheetHeight:0,duration:o?n:1,useNativeDriver:!0})]).start(),(0,v.waitAsync)((null!=n?n:300)/1.5).then(function(){u?(e._scrollTo(0,!1),e.currentOffsetFromBottom=null!=s?s:1,e.setState({modalVisible:!u},function(){e.isClosing=!1,e.isReachedTop=!1,e.props.onPositionChanged&&e.props.onPositionChanged(!1),e.indicatorTranslateY.setValue(-e.state.paddingTop),e.layoutHasCalled=!1,e.deviceLayoutCalled=!1,e.props.onClose&&e.props.onClose()})):(l&&l>0?e.snapToOffset(l):(e._scrollTo(e.actionSheetHeight*(null!=s?s:1)+.1*e.state.deviceHeight+(null!=c?c:0),!0),e.currentOffsetFromBottom=null!=s?s:1),e.isClosing=!1)})}},{key:"_applyHeightLimiter",value:function(){this.actionSheetHeight>this.state.deviceHeight&&(this.actionSheetHeight=1*(this.actionSheetHeight-(this.actionSheetHeight-this.state.deviceHeight)))}},{key:"updateActionSheetPosition",value:function(e){if(this.actionSheetHeight>=this.state.deviceHeight-1){var t=.15*this.state.deviceHeight;if(this.actionSheetHeight+t-e0&&B((0,M.markMessagesRead)((t={},(0,l.default)(t,v.MessageTypes.text,!0),(0,l.default)(t,v.MessageTypes.file,!0),(0,l.default)(t,v.MessageTypes.image,!0),(0,l.default)(t,v.MessageTypes.poll,!0),t)))},[se]);var me=function(){if(''!==$){var t={message:$,userId:D.userId,displayName:D.displayName,type:v.MessageTypes.text,time:(new Date).getTime()};Y.sendMessage(t),q('')}},pe=function(t,n,l){var o={displayName:D.displayName,type:v.MessageTypes.file,link:t,userId:D.id,name:n,size:l};Y.sendMessage(o)},ge=function(t){var l,o;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,n.default.awrap(fetch(t));case 2:return l=u.sent,u.next=5,n.default.awrap(l.blob());case 5:return o=u.sent,u.abrupt("return",o);case 7:case"end":return u.stop()}},null,null,null,Promise)};function ye(t,l,o){var u;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.default.awrap(ge(o));case 2:return u=s.sent,s.next=5,n.default.awrap(fetch(l,{method:'PUT',headers:{'Content-Type':t.type},body:u}));case 5:case"end":return s.stop()}},null,null,null,Promise)}function xe(t){var l,o,u,s,c;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return l=O.default.apiBase+"/v1/meetings/genPreSignedUploadUrl",f.next=3,n.default.awrap(fetch(l,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({roomName:ue,filename:t.name})}));case 3:return o=f.sent,f.next=6,n.default.awrap(o.json());case 6:return u=f.sent.data,s=u.getLocation,c=u.putLocation,f.abrupt("return",{getURL:s,putURL:c});case 10:case"end":return f.stop()}},null,null,null,Promise)}var he=function(t){f.Alert.alert('Error',"Error: "+(t||'Problem uploading image'),[{text:'OK'}]),ae(!1)},be=function(){try{te||(ae(!0),X(!1),(0,P.launchImageLibrary)({mediaType:'photo'},function(t){var l,o,u,s,c,m,p,y,x;return n.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=t.uri,o=t.didCancel,u=t.errorCode,s=t.errorMessage,c=t.fileName,m=t.type,p=t.fileSize,!o){h.next=5;break}ae(!1),h.next=19;break;case 5:if(!u){h.next=10;break}console.log('Error Uploading Image:',u,s),he(s),h.next=19;break;case 10:return y={name:c,type:m,uri:l},p>5e6&&f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),h.next=14,n.default.awrap(xe(y));case 14:return x=h.sent,h.next=17,n.default.awrap(ye(y,x.putURL,y.uri));case 17:b=x.getURL,w={displayName:D.displayName,type:v.MessageTypes.image,link:b,userId:D.id},Y.sendMessage(w),ae(!1);case 19:case"end":return h.stop()}var b,w},null,null,null,Promise)}))}catch(t){console.log('Error Uploading Image:',t),he()}},ve=function(){var t,l,o,u,s,c;return n.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:if(te){m.next=24;break}return ae(!0),X(!1),m.prev=3,m.next=6,n.default.awrap(C.default.pick({type:[C.default.types.allFiles]}));case 6:if(t=m.sent,l=t.uri,o=t.name,u=t.size,s={displayName:D.displayName,type:v.MessageTypes.file,link:l,userId:D.id,name:o,size:u},!(u>5e6)){m.next=12;break}return f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),m.abrupt("return");case 12:return m.next=14,n.default.awrap(xe(s));case 14:return c=m.sent,m.next=17,n.default.awrap(ye(s,c.putURL,s.link));case 17:pe(c.getURL,o,u),ae(!1),m.next=24;break;case 21:m.prev=21,m.t0=m.catch(3),C.default.isCancel(m.t0)?ae(!1):he();case 24:case"end":return m.stop()}},null,null,[[3,21]],Promise)};return c.default.createElement(m.Flex,{height:V-50,align:"center",width:H},c.default.createElement(k.default,null,c.default.createElement(y.GiftedChat,{messagesContainerStyle:{paddingTop:60},messages:le,alwaysShowSend:!0,renderAvatarOnTop:!0,renderUsernameOnMessage:!0,isKeyboardInternallyHandled:!1,timeTextStyle:{left:{color:L.textPrimary[400]},right:{color:L.textPrimary[400]}},renderAvatar:function(t){return c.default.createElement(x.default,{name:t.currentMessage.user.name,bgColor:L.primary[700]})},renderBubble:function(t){var n=t.currentMessage;return n.type,n.link,n.text,c.default.createElement(y.Bubble,(0,o.default)({},t,{wrapperStyle:{left:{backgroundColor:L.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3},right:{backgroundColor:L.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3}},textStyle:{left:{color:L.textPrimary[100]},right:{color:L.textPrimary[100]}}}))},renderInputToolbar:function(t){return z&&c.default.createElement(m.Flex,{width:ce?H-60:H-20,direction:"row",justify:"space-between",align:"center",bg:"secondary.800",borderRadius:"50px",height:50},c.default.createElement(m.Box,null,c.default.createElement(m.Button,{onClick:function(){X(!Q)}},c.default.createElement(m.Box,(0,m.mergeStyles)(N.touchableIcons,{ml:8}),Q?c.default.createElement(m.Icon,{name:"close",fill:"textPrimary.100",boxSize:"sm"}):c.default.createElement(m.Icon,{name:"plus-thick",fill:"textPrimary.100",boxSize:"sm"}))),Q&&c.default.createElement(R,null,c.default.createElement(m.Button,{onClick:be},c.default.createElement(m.Box,N.attachementButtons,c.default.createElement(m.Icon,{name:"image",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:8}," Images"))),c.default.createElement(m.Button,{onClick:ve},c.default.createElement(m.Box,(0,m.mergeStyles)(N.attachementButtons,{width:'ios'===f.Platform.OS?150:120}),c.default.createElement(m.Icon,{name:"attach-file",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:'ios'===f.Platform.OS?8:0},' ',"Attachments"))))),c.default.createElement(f.TextInput,{style:{color:L.textPrimary[300],paddingHorizontal:5,height:40,width:ce?H-160:H-120},onChangeText:q,value:$}),c.default.createElement(m.Button,{onClick:me,height:40,width:40},c.default.createElement(m.Box,(0,m.mergeStyles)(N.touchableIcons,{backgroundColor:'primary.500',mr:8}),c.default.createElement(m.Icon,{name:"send",fill:"textPrimary.100",boxSize:"md"}))))},user:{_id:D.userId,name:D.displayName}})))};e.default=U},725,[1,67,261,22,49,41,165,2,512,508,726,682,514,432,718,674,585,790,791,465,480,792,676,575,504]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=p(n);if(o&&o.has(t))return o.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var c=u?Object.getOwnPropertyDescriptor(t,f):null;c&&(c.get||c.set)?Object.defineProperty(l,f,c):l[f]=t[f]}l.default=t,o&&o.set(t,l);return l})(r(d[1])),o=r(d[2]),l=t(r(d[3])),u=r(d[4]),f=r(d[5]),c=r(d[6]),s=r(d[7]);function p(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(p=function(t){return t?o:n})(t)}var b=function(t){var p=t.onBackButtonClick,b=t.heading,h=(0,n.useContext)(f.ConfigServiceContext).sessionConfig,x=(0,n.useContext)(u.ThemeContext).colors,v=(0,c.useWindowDimensions)(),w=useScale(h.theme.dimensions||v),y=(w.height,w.width),C='LANDSCAPE'===n.default.useContext(s.OrientationContext).orientation;return n.default.createElement(o.Box,{position:"absolute",zIndex:10,pt:'ios'!==c.Platform.OS||C?3:42,bg:"secondary.1000",width:y},n.default.createElement(o.HStack,null,n.default.createElement(o.Box,{width:y/3},n.default.createElement(o.Button,{onClick:p},n.default.createElement(o.HStack,{border:"1px solid "+x.danger[500],borderRadius:l.default.small,left:20,p:8,width:80},n.default.createElement(o.Icon,{name:"arrow-back",fill:"danger.500"}),n.default.createElement(o.Text,{ml:4,mr:4,color:"danger.500"},"Back")))),n.default.createElement(o.Flex,{width:y/3,align:"center",p:8},n.default.createElement(o.Text,{fontSize:16,fontWeight:"bold",mb:10},' ',b))))};e.default=b},724,[1,165,512,676,514,508,2,575]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),l=t(r(d[2])),o=t(r(d[3])),u=t(r(d[4])),s=t(r(d[5])),c=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var l=N(n);if(l&&l.has(t))return l.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var c=u?Object.getOwnPropertyDescriptor(t,s):null;c&&(c.get||c.set)?Object.defineProperty(o,s,c):o[s]=t[s]}o.default=t,l&&l.set(t,o);return o})(r(d[6])),f=r(d[7]),m=r(d[8]),p=r(d[9]),y=r(d[10]),x=t(r(d[11])),h=r(d[12]),b=r(d[13]),v=r(d[14]),w=r(d[15]),E=r(d[16]),P=r(d[17]),S=t(r(d[18])),C=r(d[19]),M=r(d[20]),k=t(r(d[21])),T=t(r(d[22])),I=r(d[23]),O=t(r(d[24])),B=r(d[25]);function N(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,l=new WeakMap;return(N=function(t){return t?l:n})(t)}var R={attachementButtons:{display:'flex',flexDirection:'row',backgroundColor:'secondary.700',marginTop:20,marginRight:5,width:100,height:35,alignItems:'center',justifyContent:'center',borderRadius:30},touchableIcons:{backgroundColor:'secondary.700',borderRadius:15,width:30,height:30,align:'center',justify:'center',mt:8,mb:8},attachemenetView:{position:'absolute',top:'ios'===f.Platform.OS?-130:-15,left:'ios'===f.Platform.OS?8:48,direction:'ios'===f.Platform.OS?'column':'row'}},U=function(t){var n=t.children;return'ios'===f.Platform.OS?c.default.createElement(m.Box,R.attachemenetView,n):c.default.createElement(m.Flex,R.attachemenetView,n)},j=function(t){var N=(0,b.useDispatch)(),j=(0,c.useContext)(p.ConfigServiceContext),z=(j.meeting,j.sessionConfig),L=z.permissions.chat.public.can_send,_=(0,c.useContext)(h.ThemeContext).colors,A=(0,f.useWindowDimensions)(),D=(0,b.useSelector)(function(t){return t.room.chatMessages}),F=(0,c.useContext)(w.PeersServiceContext).selfPeer,V=(0,B.useScale)(z.theme.dimensions||A),H=V.height,K=V.width,W=c.default.useState(''),$=(0,s.default)(W,2),q=$[0],G=$[1],J=c.default.useState(!1),Q=(0,s.default)(J,2),X=Q[0],Y=Q[1],Z=(0,c.useContext)(E.MediaRoomContext).mediaRoom,ee=c.default.useState(!1),te=(0,s.default)(ee,2),ae=te[0],re=te[1],ne=(0,c.useState)([]),le=(0,s.default)(ne,2),oe=le[0],ue=le[1],ie=(0,b.useSelector)(function(t){return t.room.roomName}),se=(0,b.useSelector)(function(t){return t.room.polls}),de=D.filter(function(t){return!0!==t.read}),ce=(0,C.useMutation)("\n mutation($file: Upload!, $roomName: String!) {\n uploadFile(file: $file, roomName: $roomName) {\n link\n }\n }\n"),fe=((0,s.default)(ce,1)[0],'LANDSCAPE'===c.default.useContext(I.OrientationContext).orientation);function me(t,n,l){Z.votePoll({index:l,pollId:t})}(0,c.useEffect)(function(){var t=(0,u.default)(D);ue(t.reverse().map(function(t){var n={type:t.type,createdAt:t.time,_id:Math.round(1e6*Math.random()),user:{_id:t.userId,name:t.displayName}};if(t.type===v.MessageTypes.text)return(0,o.default)({},n,{text:t.message});if(t.type===v.MessageTypes.image)return(0,o.default)({},n,{image:t.link});if(t.type===v.MessageTypes.file)return(0,o.default)({},n,{text:t.name,link:t.link});if(t.type===v.MessageTypes.poll){var l=t.pollId,u=se[l],s=u.options,c=u.question,f=F.userId;return(0,o.default)({},n,{text:c,polls:{pollId:l,options:s.map(function(t){return t.votes.find(function(t){return t.id===f})?(0,o.default)({},t,{selected:!0}):(0,o.default)({},t,{selected:!1})}),onOptionSelected:me}})}return{}}))},[D,se]),(0,c.useEffect)(function(){var t;de.length>0&&N((0,M.markMessagesRead)((t={},(0,l.default)(t,v.MessageTypes.text,!0),(0,l.default)(t,v.MessageTypes.file,!0),(0,l.default)(t,v.MessageTypes.image,!0),(0,l.default)(t,v.MessageTypes.poll,!0),t)))},[de]);var pe=function(){if(''!==q){var t={message:q,userId:F.userId,displayName:F.displayName,type:v.MessageTypes.text,time:(new Date).getTime()};Z.sendMessage(t),G('')}},ge=function(t,n,l){var o={displayName:F.displayName,type:v.MessageTypes.file,link:t,userId:F.id,name:n,size:l};Z.sendMessage(o)},ye=function(t){var l,o;return n.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,n.default.awrap(fetch(t));case 2:return l=u.sent,u.next=5,n.default.awrap(l.blob());case 5:return o=u.sent,u.abrupt("return",o);case 7:case"end":return u.stop()}},null,null,null,Promise)};function xe(t,l,o){var u;return n.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.default.awrap(ye(o));case 2:return u=s.sent,s.next=5,n.default.awrap(fetch(l,{method:'PUT',headers:{'Content-Type':t.type},body:u}));case 5:case"end":return s.stop()}},null,null,null,Promise)}function he(t){var l,o,u,s,c;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return l=O.default.apiBase+"/v1/meetings/genPreSignedUploadUrl",f.next=3,n.default.awrap(fetch(l,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({roomName:ie,filename:t.name})}));case 3:return o=f.sent,f.next=6,n.default.awrap(o.json());case 6:return u=f.sent.data,s=u.getLocation,c=u.putLocation,f.abrupt("return",{getURL:s,putURL:c});case 10:case"end":return f.stop()}},null,null,null,Promise)}var be=function(t){f.Alert.alert('Error',"Error: "+(t||'Problem uploading image'),[{text:'OK'}]),re(!1)},ve=function(){try{ae||(re(!0),Y(!1),(0,P.launchImageLibrary)({mediaType:'photo'},function(t){var l,o,u,s,c,m,p,y,x;return n.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:if(l=t.uri,o=t.didCancel,u=t.errorCode,s=t.errorMessage,c=t.fileName,m=t.type,p=t.fileSize,!o){h.next=5;break}re(!1),h.next=19;break;case 5:if(!u){h.next=10;break}console.log('Error Uploading Image:',u,s),be(s),h.next=19;break;case 10:return y={name:c,type:m,uri:l},p>5e6&&f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),h.next=14,n.default.awrap(he(y));case 14:return x=h.sent,h.next=17,n.default.awrap(xe(y,x.putURL,y.uri));case 17:b=x.getURL,w={displayName:F.displayName,type:v.MessageTypes.image,link:b,userId:F.id},Z.sendMessage(w),re(!1);case 19:case"end":return h.stop()}var b,w},null,null,null,Promise)}))}catch(t){console.log('Error Uploading Image:',t),be()}},we=function(){var t,l,o,u,s,c;return n.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:if(ae){m.next=24;break}return re(!0),Y(!1),m.prev=3,m.next=6,n.default.awrap(S.default.pick({type:[S.default.types.allFiles]}));case 6:if(t=m.sent,l=t.uri,o=t.name,u=t.size,s={displayName:F.displayName,type:v.MessageTypes.file,link:l,userId:F.id,name:o,size:u},!(u>5e6)){m.next=12;break}return f.Alert.alert('Error','Error: Cannot upload files greater than 5MB',[{text:'OK'}]),m.abrupt("return");case 12:return m.next=14,n.default.awrap(he(s));case 14:return c=m.sent,m.next=17,n.default.awrap(xe(s,c.putURL,s.link));case 17:ge(c.getURL,o,u),re(!1),m.next=24;break;case 21:m.prev=21,m.t0=m.catch(3),S.default.isCancel(m.t0)?re(!1):be();case 24:case"end":return m.stop()}},null,null,[[3,21]],Promise)};return c.default.createElement(m.Flex,{height:H-50,align:"center",width:K},c.default.createElement(k.default,null,c.default.createElement(y.GiftedChat,{messagesContainerStyle:{paddingTop:60},messages:oe,alwaysShowSend:!0,renderAvatarOnTop:!0,renderUsernameOnMessage:!0,isKeyboardInternallyHandled:!1,timeTextStyle:{left:{color:_.textPrimary[400]},right:{color:_.textPrimary[400]}},renderAvatar:function(t){return c.default.createElement(x.default,{name:t.currentMessage.user.name,bgColor:_.primary[700]})},renderBubble:function(t){var n=t.currentMessage;return n.type,n.link,n.text,c.default.createElement(y.Bubble,(0,o.default)({},t,{wrapperStyle:{left:{backgroundColor:_.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3},right:{backgroundColor:_.secondary[800],borderRadius:T.default.medium,paddingVertical:6,paddingHorizontal:3}},textStyle:{left:{color:_.textPrimary[100]},right:{color:_.textPrimary[100]}}}))},renderInputToolbar:function(t){return L&&c.default.createElement(m.Flex,{width:fe?K-60:K-20,direction:"row",justify:"space-between",align:"center",bg:"secondary.800",borderRadius:"50px",height:50},c.default.createElement(m.Box,null,c.default.createElement(m.Button,{onClick:function(){Y(!X)}},c.default.createElement(m.Box,(0,m.mergeStyles)(R.touchableIcons,{ml:8}),X?c.default.createElement(m.Icon,{name:"close",fill:"textPrimary.100",boxSize:"sm"}):c.default.createElement(m.Icon,{name:"plus-thick",fill:"textPrimary.100",boxSize:"sm"}))),X&&c.default.createElement(U,null,c.default.createElement(m.Button,{onClick:ve},c.default.createElement(m.Box,R.attachementButtons,c.default.createElement(m.Icon,{name:"image",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:8}," Images"))),c.default.createElement(m.Button,{onClick:we},c.default.createElement(m.Box,(0,m.mergeStyles)(R.attachementButtons,{width:'ios'===f.Platform.OS?150:120}),c.default.createElement(m.Icon,{name:"attach-file",fill:"textPrimary.100"}),c.default.createElement(m.Text,{ml:'ios'===f.Platform.OS?8:0},' ',"Attachments"))))),c.default.createElement(f.TextInput,{style:{color:_.textPrimary[300],paddingHorizontal:5,height:40,width:fe?K-160:K-120},onChangeText:G,value:q}),c.default.createElement(m.Button,{onClick:pe,height:40,width:40},c.default.createElement(m.Box,(0,m.mergeStyles)(R.touchableIcons,{backgroundColor:'primary.500',mr:8}),c.default.createElement(m.Icon,{name:"send",fill:"textPrimary.100",boxSize:"md"}))))},user:{_id:F.userId,name:F.displayName}})))};e.default=j},725,[1,67,261,22,49,41,165,2,512,508,726,682,514,432,718,674,585,790,791,465,480,792,676,575,504,493]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0});var n=r(d[0]);Object.keys(n).forEach(function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===n[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}}))})},726,[727]); __d(function(g,r,i,a,m,_e2,d){var e=r(d[0]);Object.defineProperty(_e2,"__esModule",{value:!0});var t={GiftedChat:!0,utils:!0,Actions:!0,Avatar:!0,Bubble:!0,SystemMessage:!0,MessageImage:!0,MessageText:!0,Composer:!0,Day:!0,InputToolbar:!0,LoadEarlier:!0,Message:!0,MessageContainer:!0,Send:!0,Time:!0,GiftedAvatar:!0};Object.defineProperty(_e2,"Actions",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(_e2,"Avatar",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(_e2,"Bubble",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(_e2,"Composer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(_e2,"Day",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(_e2,"GiftedAvatar",{enumerable:!0,get:function(){return E.default}}),_e2.GiftedChat=void 0,Object.defineProperty(_e2,"InputToolbar",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(_e2,"LoadEarlier",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(_e2,"Message",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(_e2,"MessageContainer",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(_e2,"MessageImage",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(_e2,"MessageText",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(_e2,"Send",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(_e2,"SystemMessage",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(_e2,"Time",{enumerable:!0,get:function(){return D.default}}),_e2.utils=void 0;var n=e(r(d[1])),o=e(r(d[2])),s=e(r(d[3])),u=e(r(d[4])),l=e(r(d[5])),f=e(r(d[6])),p=e(r(d[7])),h=e(r(d[8])),c=e(r(d[9])),y=r(d[10]),b=r(d[11]),v=e(r(d[12])),I=r(d[13]),x=e(r(d[14])),T=e(r(d[15])),H=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=V(t);if(n&&n.has(e))return n.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var l=s?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(o,u,l):o[u]=e[u]}o.default=e,n&&n.set(e,o);return o})(r(d[16]));_e2.utils=H;var C=e(r(d[17])),M=e(r(d[18])),S=e(r(d[19])),P=e(r(d[20])),O=e(r(d[21])),k=e(r(d[22])),L=e(r(d[23])),_=e(r(d[24])),A=e(r(d[25])),w=e(r(d[26])),F=e(r(d[27])),K=e(r(d[28])),j=e(r(d[29])),D=e(r(d[30])),E=e(r(d[31])),W=r(d[32]),R=r(d[33]);Object.keys(R).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(t,e)||e in _e2&&_e2[e]===R[e]||Object.defineProperty(_e2,e,{enumerable:!0,get:function(){return R[e]}}))});var B=["messagesContainerStyle"];function V(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(V=function(e){return e?n:t})(e)}function G(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}x.default.extend(T.default);var U=(function(e){(0,l.default)(x,e);var t,h,v=(t=x,h=G(),function(){var e,n=(0,p.default)(t);if(h){var o=(0,p.default)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return(0,f.default)(this,e)});function x(e){var t;return(0,s.default)(this,x),(t=v.call(this,e))._isMounted=!1,t._keyboardHeight=0,t._bottomOffset=0,t._maxHeight=void 0,t._isFirstLayout=!0,t._locale='en',t.invertibleScrollViewProps=void 0,t._actionSheetRef=void 0,t._messageContainerRef=c.default.createRef(),t._isTextInputWasFocused=!1,t.state={isInitialized:!1,composerHeight:t.props.minComposerHeight,messagesContainerHeight:void 0,typingDisabled:!1,text:void 0,messages:void 0},t.getLocale=function(){return t._locale},t.safeAreaSupport=function(e){return null!=e?e:(0,I.getBottomSpace)()},t.onKeyboardWillShow=function(e){if(t.handleTextInputFocusWhenKeyboardShow(),t.props.isKeyboardInternallyHandled){t.setIsTypingDisabled(!0),t.setKeyboardHeight(e.endCoordinates?e.endCoordinates.height:e.end.height),t.setBottomOffset(t.safeAreaSupport(t.props.bottomOffset));var n=t.getMessagesContainerHeightWithKeyboard();t.setState({messagesContainerHeight:n})}},t.onKeyboardWillHide=function(e){if(t.handleTextInputFocusWhenKeyboardHide(),t.props.isKeyboardInternallyHandled){t.setIsTypingDisabled(!0),t.setKeyboardHeight(0),t.setBottomOffset(0);var n=t.getBasicMessagesContainerHeight();t.setState({messagesContainerHeight:n})}},t.onKeyboardDidShow=function(e){'android'===y.Platform.OS&&t.onKeyboardWillShow(e),t.setIsTypingDisabled(!1)},t.onKeyboardDidHide=function(e){'android'===y.Platform.OS&&t.onKeyboardWillHide(e),t.setIsTypingDisabled(!1)},t.onSend=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Array.isArray(e)||(e=[e]);var s=e.map(function(e){return(0,o.default)({},e,{user:t.props.user,createdAt:new Date,_id:t.props.messageIdGenerator&&t.props.messageIdGenerator()})});!0===n&&(t.setIsTypingDisabled(!0),t.resetInputToolbar()),t.props.onSend&&t.props.onSend(s),!0===n&&setTimeout(function(){!0===t.getIsMounted()&&t.setIsTypingDisabled(!1)},100)},t.onInputSizeChanged=function(e){var n=Math.max(t.props.minComposerHeight,Math.min(t.props.maxComposerHeight,e.height)),o=t.getMessagesContainerHeightWithKeyboard(n);t.setState({composerHeight:n,messagesContainerHeight:o})},t.onInputTextChanged=function(e){t.getIsTypingDisabled()||(t.props.onInputTextChanged&&t.props.onInputTextChanged(e),void 0===t.props.text&&t.setState({text:e}))},t.onInitialLayoutViewLayout=function(e){var n=e.nativeEvent.layout;if(!(n.height<=0)){t.notifyInputTextReset(),t.setMaxHeight(n.height);var o=t.props.minComposerHeight,s=t.getMessagesContainerHeightWithKeyboard(o),u=t.props.initialText||'';t.setState({isInitialized:!0,text:t.getTextFromProp(u),composerHeight:o,messagesContainerHeight:s})}},t.onMainViewLayout=function(e){var n=e.nativeEvent.layout;t.getMaxHeight()===n.height&&!0!==t.getIsFirstLayout()||(t.setMaxHeight(n.height),t.setState({messagesContainerHeight:t._keyboardHeight>0?t.getMessagesContainerHeightWithKeyboard():t.getBasicMessagesContainerHeight()})),!0===t.getIsFirstLayout()&&t.setIsFirstLayout(!1)},t.invertibleScrollViewProps={inverted:t.props.inverted,keyboardShouldPersistTaps:t.props.keyboardShouldPersistTaps,onKeyboardWillShow:t.onKeyboardWillShow,onKeyboardWillHide:t.onKeyboardWillHide,onKeyboardDidShow:t.onKeyboardDidShow,onKeyboardDidHide:t.onKeyboardDidHide},t}return(0,u.default)(x,[{key:"getChildContext",value:function(){var e=this;return{actionSheet:this.props.actionSheet||function(){return e._actionSheetRef.getContext()},getLocale:this.getLocale}}},{key:"componentDidMount",value:function(){var e=this.props,t=e.messages,n=e.text;this.setIsMounted(!0),this.initLocale(),this.setMessages(t||[]),this.setTextFromProp(n)}},{key:"componentWillUnmount",value:function(){this.setIsMounted(!1)}},{key:"componentDidUpdate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,o=n.messages,s=n.text,u=n.inverted;this.props!==t&&this.setMessages(o||[]),!1===u&&o&&t.messages&&o.length!==t.messages.length&&setTimeout(function(){return e.scrollToBottom(!1)},200),s!==t.text&&this.setTextFromProp(s)}},{key:"initLocale",value:function(){null===this.props.locale?this.setLocale('en'):this.setLocale(this.props.locale||'en')}},{key:"setLocale",value:function(e){this._locale=e}},{key:"setTextFromProp",value:function(e){void 0!==e&&e!==this.state.text&&this.setState({text:e})}},{key:"getTextFromProp",value:function(e){return void 0===this.props.text?e:this.props.text}},{key:"setMessages",value:function(e){this.setState({messages:e})}},{key:"getMessages",value:function(){return this.state.messages}},{key:"setMaxHeight",value:function(e){this._maxHeight=e}},{key:"getMaxHeight",value:function(){return this._maxHeight}},{key:"setKeyboardHeight",value:function(e){this._keyboardHeight=e}},{key:"getKeyboardHeight",value:function(){return'android'!==y.Platform.OS||this.props.forceGetKeyboardHeight?this._keyboardHeight:0}},{key:"setBottomOffset",value:function(e){this._bottomOffset=e}},{key:"getBottomOffset",value:function(){return this._bottomOffset}},{key:"setIsFirstLayout",value:function(e){this._isFirstLayout=e}},{key:"getIsFirstLayout",value:function(){return this._isFirstLayout}},{key:"setIsTypingDisabled",value:function(e){this.setState({typingDisabled:e})}},{key:"getIsTypingDisabled",value:function(){return this.state.typingDisabled}},{key:"setIsMounted",value:function(e){this._isMounted=e}},{key:"getIsMounted",value:function(){return this._isMounted}},{key:"getMinInputToolbarHeight",value:function(){return this.props.renderAccessory?2*this.props.minInputToolbarHeight:this.props.minInputToolbarHeight}},{key:"calculateInputToolbarHeight",value:function(e){return e+(this.getMinInputToolbarHeight()-this.props.minComposerHeight)}},{key:"getBasicMessagesContainerHeight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.composerHeight;return this.getMaxHeight()-this.calculateInputToolbarHeight(e)}},{key:"getMessagesContainerHeightWithKeyboard",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.composerHeight;return this.getBasicMessagesContainerHeight(e)-this.getKeyboardHeight()+this.getBottomOffset()}},{key:"handleTextInputFocusWhenKeyboardHide",value:function(){var e;this._isTextInputWasFocused||(this._isTextInputWasFocused=(null==(e=this.textInput)?void 0:e.isFocused())||!1)}},{key:"handleTextInputFocusWhenKeyboardShow",value:function(){this.textInput&&this._isTextInputWasFocused&&!this.textInput.isFocused()&&this.textInput.focus(),this._isTextInputWasFocused=!1}},{key:"scrollToBottom",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._messageContainerRef&&this._messageContainerRef.current&&(this.props.inverted?this._messageContainerRef.current.scrollToOffset({offset:0,animated:e}):this._messageContainerRef.current.scrollToEnd({animated:e}))}},{key:"renderMessages",value:function(){var e=this.props,t=e.messagesContainerStyle,s=(0,n.default)(e,B),u=c.default.createElement(y.View,{style:[{height:this.state.messagesContainerHeight},t]},c.default.createElement(K.default,(0,o.default)({},s,{invertibleScrollViewProps:this.invertibleScrollViewProps,messages:this.getMessages(),forwardRef:this._messageContainerRef,isTyping:this.props.isTyping})),this.renderChatFooter());return this.props.isKeyboardInternallyHandled?c.default.createElement(y.KeyboardAvoidingView,{enabled:!0},u):u}},{key:"resetInputToolbar",value:function(){this.textInput&&this.textInput.clear(),this.notifyInputTextReset();var e=this.props.minComposerHeight,t=this.getMessagesContainerHeightWithKeyboard(e);this.setState({text:this.getTextFromProp(''),composerHeight:e,messagesContainerHeight:t})}},{key:"focusTextInput",value:function(){this.textInput&&this.textInput.focus()}},{key:"notifyInputTextReset",value:function(){this.props.onInputTextChanged&&this.props.onInputTextChanged('')}},{key:"renderInputToolbar",value:function(){var e=this,t=(0,o.default)({},this.props,{text:this.getTextFromProp(this.state.text),composerHeight:Math.max(this.props.minComposerHeight,this.state.composerHeight),onSend:this.onSend,onInputSizeChanged:this.onInputSizeChanged,onTextChanged:this.onInputTextChanged,textInputProps:(0,o.default)({},this.props.textInputProps,{ref:function(t){return e.textInput=t},maxLength:this.getIsTypingDisabled()?0:this.props.maxInputLength})});return this.props.renderInputToolbar?this.props.renderInputToolbar(t):c.default.createElement(A.default,t)}},{key:"renderChatFooter",value:function(){return this.props.renderChatFooter?this.props.renderChatFooter():null}},{key:"renderLoading",value:function(){return this.props.renderLoading?this.props.renderLoading():null}},{key:"render",value:function(){var e=this;if(!0===this.state.isInitialized){var t=this.props.wrapInSafeArea?y.SafeAreaView:y.View;return c.default.createElement(t,{style:z.safeArea},c.default.createElement(b.ActionSheetProvider,{ref:function(t){return e._actionSheetRef=t}},c.default.createElement(y.View,{style:z.container,onLayout:this.onMainViewLayout},this.renderMessages(),this.renderInputToolbar())))}return c.default.createElement(y.View,{style:z.container,onLayout:this.onInitialLayoutViewLayout},this.renderLoading())}}],[{key:"append",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Array.isArray(t)||(t=[t]),n?t.concat(e):e.concat(t)}},{key:"prepend",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Array.isArray(t)||(t=[t]),n?e.concat(t):t.concat(e)}}]),x})(c.default.Component);_e2.GiftedChat=U,U.childContextTypes={actionSheet:h.default.func,getLocale:h.default.func},U.defaultProps={messages:[],messagesContainerStyle:void 0,text:void 0,placeholder:W.DEFAULT_PLACEHOLDER,disableComposer:!1,messageIdGenerator:function(){return v.default.v4()},user:{},onSend:function(){},locale:null,timeFormat:W.TIME_FORMAT,dateFormat:W.DATE_FORMAT,loadEarlier:!1,onLoadEarlier:function(){},isLoadingEarlier:!1,renderLoading:null,renderLoadEarlier:null,renderAvatar:void 0,showUserAvatar:!1,actionSheet:null,onPressAvatar:null,onLongPressAvatar:null,renderUsernameOnMessage:!1,renderAvatarOnTop:!1,renderBubble:null,renderSystemMessage:null,onLongPress:null,renderMessage:null,renderMessageText:null,renderMessageImage:null,renderMessageVideo:null,renderMessageAudio:null,imageProps:{},videoProps:{},audioProps:{},lightboxProps:{},textInputProps:{},listViewProps:{},renderCustomView:null,isCustomViewBottom:!1,renderDay:null,renderTime:null,renderFooter:null,renderChatEmpty:null,renderChatFooter:null,renderInputToolbar:null,renderComposer:null,renderActions:null,renderSend:null,renderAccessory:null,isKeyboardInternallyHandled:!0,onPressActionButton:null,bottomOffset:null,minInputToolbarHeight:44,keyboardShouldPersistTaps:y.Platform.select({ios:'never',android:'always',default:'never'}),onInputTextChanged:null,maxInputLength:null,forceGetKeyboardHeight:!1,inverted:!0,extraData:null,minComposerHeight:W.MIN_COMPOSER_HEIGHT,maxComposerHeight:W.MAX_COMPOSER_HEIGHT,wrapInSafeArea:!0},U.propTypes={messages:h.default.arrayOf(h.default.object),messagesContainerStyle:H.StylePropType,text:h.default.string,initialText:h.default.string,placeholder:h.default.string,disableComposer:h.default.bool,messageIdGenerator:h.default.func,user:h.default.object,onSend:h.default.func,locale:h.default.string,timeFormat:h.default.string,dateFormat:h.default.string,isKeyboardInternallyHandled:h.default.bool,loadEarlier:h.default.bool,onLoadEarlier:h.default.func,isLoadingEarlier:h.default.bool,renderLoading:h.default.func,renderLoadEarlier:h.default.func,renderAvatar:h.default.func,showUserAvatar:h.default.bool,actionSheet:h.default.func,onPressAvatar:h.default.func,onLongPressAvatar:h.default.func,renderUsernameOnMessage:h.default.bool,renderAvatarOnTop:h.default.bool,isCustomViewBottom:h.default.bool,renderBubble:h.default.func,renderSystemMessage:h.default.func,onLongPress:h.default.func,renderMessage:h.default.func,renderMessageText:h.default.func,renderMessageImage:h.default.func,imageProps:h.default.object,videoProps:h.default.object,audioProps:h.default.object,lightboxProps:h.default.object,renderCustomView:h.default.func,renderDay:h.default.func,renderTime:h.default.func,renderFooter:h.default.func,renderChatEmpty:h.default.func,renderChatFooter:h.default.func,renderInputToolbar:h.default.func,renderComposer:h.default.func,renderActions:h.default.func,renderSend:h.default.func,renderAccessory:h.default.func,onPressActionButton:h.default.func,bottomOffset:h.default.number,minInputToolbarHeight:h.default.number,listViewProps:h.default.object,keyboardShouldPersistTaps:h.default.oneOf(['always','never','handled']),onInputTextChanged:h.default.func,maxInputLength:h.default.number,forceGetKeyboardHeight:h.default.bool,inverted:h.default.bool,textInputProps:h.default.object,extraData:h.default.object,minComposerHeight:h.default.number,maxComposerHeight:h.default.number,alignTop:h.default.bool,wrapInSafeArea:h.default.bool};var z=y.StyleSheet.create({container:{flex:1},safeArea:{flex:1}})},727,[1,96,22,9,10,12,14,17,204,165,2,728,734,749,750,751,752,753,755,757,774,766,759,775,776,777,779,780,781,778,772,756,773,789]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0});var n={ActionSheetProvider:!0,connectActionSheet:!0,useActionSheet:!0};Object.defineProperty(e,"ActionSheetProvider",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"connectActionSheet",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"useActionSheet",{enumerable:!0,get:function(){return u.useActionSheet}});var o=t(r(d[1])),c=t(r(d[2])),u=r(d[3]),f=r(d[4]);Object.keys(f).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(n,t)||t in e&&e[t]===f[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return f[t]}}))})},728,[1,729,732,731,733]); @@ -796,7 +796,7 @@ __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0})},78 __d(function(g,r,i,a,m,e,d){var o=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.launchCamera=function(o,u){if('function'!=typeof u)return void console.error('Send proper callback function, check API');c.NativeModules.DyteImagePickerManager.launchCamera((0,n.default)({},t,o),u)},e.launchImageLibrary=function(o,u){if('function'!=typeof u)return void console.error('Send proper callback function, check API');c.NativeModules.DyteImagePickerManager.launchImageLibrary((0,n.default)({},t,o),u)};var n=o(r(d[1])),c=r(d[2]),t={mediaType:'photo',videoQuality:'high',quality:1,maxWidth:0,maxHeight:0,includeBase64:!1,saveToPhotos:!1,durationLimit:0,cameraType:'back'}},790,[1,22,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=t(r(d[1])),p=t(r(d[2])),n=t(r(d[3])),s=r(d[4]),c=s.NativeModules.DyteRNDocumentPicker;function l(t){if('filetype'in t)throw new TypeError('A `filetype` option was passed to DocumentPicker.pick, the correct option is `type`');if('types'in t)throw new TypeError('A `types` option was passed to DocumentPicker.pick, the correct option is `type`');if('type'in t||(t.type=x.types.allFiles),t.type=Array.isArray(t.type)?t.type:[t.type],t.type.some(function(t){return void 0===t}))throw new TypeError('Unexpected undefined type option, did you try using a DocumentPicker.types.* that does not exist?');if(Array.isArray(t.type)&&t.type.length<1)throw new TypeError('`type` option should not be an empty array, at least one type must be passed if the `type` option is not omitted');if(t.type.forEach(function(t){if('string'!=typeof t)throw new TypeError("Invalid type option, expected a string not: "+t)}),t.type.length>1&&'android'===s.Platform.OS&&s.Platform.Version<19&&console.warn("RNDocumentPicker: Android API level "+s.Platform.Version+" does not support multiple types, falling back to */*"),Array.isArray(t.type)&&t.type.length>1&&t.type.includes('folder'))throw new TypeError('When type array is folder then other options are not supported');if('mode'in t&&!['import','open'].includes(t.mode))throw new TypeError("Invalid mode option: "+t.mode);if('copyTo'in t&&!['cachesDirectory','documentDirectory'].includes(t.copyTo))throw new TypeError("Invalid copyTo option: "+t.copyTo);return c.pick(t)}function u(t){if('ios'===s.Platform.OS){if(!Array.isArray(t))throw new TypeError('`uris` should be an array of strings');t.forEach(function(t){if('string'!=typeof t)throw new TypeError("Invalid uri parameter, expected a string not: "+t)}),c.releaseSecureAccess(t)}}var f={mimeTypes:{allFiles:'*/*',audio:'audio/*',csv:'text/csv',doc:'application/msword',docx:'application/vnd.openxmlformats-officedocument.wordprocessingml.document',images:'image/*',pdf:'application/pdf',plainText:'text/plain',ppt:'application/vnd.ms-powerpoint',pptx:'application/vnd.openxmlformats-officedocument.presentationml.presentation',video:'video/*',xls:'application/vnd.ms-excel',xlsx:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',zip:'application/zip'},utis:{allFiles:'public.item',audio:'public.audio',csv:'public.comma-separated-values-text',doc:'com.microsoft.word.doc',docx:'org.openxmlformats.wordprocessingml.document',images:'public.image',pdf:'com.adobe.pdf',plainText:'public.plain-text',ppt:'com.microsoft.powerpoint.ppt',pptx:'org.openxmlformats.presentationml.presentation',video:'public.movie',xls:'com.microsoft.excel.xls',xlsx:'org.openxmlformats.spreadsheetml.sheet',zip:'public.zip-archive'},extensions:{allFiles:'*',audio:'.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma',csv:'.csv',doc:'.doc',docx:'.docx',images:'.jpeg .jpg .png',pdf:'.pdf',plainText:'.txt',ppt:'.ppt',pptx:'.pptx',video:'.mp4',xls:'.xls',xlsx:'.xlsx',zip:'.zip .gz',folder:'folder'}},y={android:f.mimeTypes,ios:f.utis,windows:f.extensions},x=(function(){function t(){(0,p.default)(this,t)}return(0,n.default)(t,null,[{key:"pick",value:function(t){return l((0,o.default)({},t,{multiple:!1})).then(function(t){return t[0]})}},{key:"pickMultiple",value:function(t){return l((0,o.default)({},t,{multiple:!0}))}},{key:"isCancel",value:function(t){return t&&"DOCUMENT_PICKER_CANCELED"===t.code}},{key:"releaseSecureAccess",value:function(t){u(t)}}]),t})();e.default=x,x.types=y[s.Platform.OS]||f.mimeTypes},791,[1,22,9,10,2]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),o=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=l(n);if(o&&o.has(t))return o.get(t);var u={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var s=f?Object.getOwnPropertyDescriptor(t,c):null;s&&(s.get||s.set)?Object.defineProperty(u,c,s):u[c]=t[c]}u.default=t,o&&o.set(t,u);return u})(r(d[2])),u=r(d[3]);function l(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(l=function(t){return t?o:n})(t)}var f=function(t){var l=t.children,f=t.useNativeDriver,c=void 0!==f&&f,s=o.useState('android'===u.Platform.OS?0:new u.Animated.Value(0)),v=(0,n.default)(s,2),p=v[0],y=v[1],b=o.useRef(null),O=o.useRef(null),h=function(t){'android'===u.Platform.OS?y(t.endCoordinates?t.endCoordinates.height:t.end.height):u.Animated.parallel([u.Animated.timing(p,{duration:t.duration,toValue:t.endCoordinates.height,useNativeDriver:c})]).start()},P=function(t){'android'===u.Platform.OS?y(0):u.Animated.parallel([u.Animated.timing(p,{duration:t.duration,toValue:0,useNativeDriver:c})]).start()};return o.useEffect(function(){return b.current=u.Keyboard.addListener('android'===u.Platform.OS?'keyboardDidShow':'keyboardWillShow',h),O.current=u.Keyboard.addListener('android'===u.Platform.OS?'keyboardDidHide':'keyboardWillHide',P),function(){var t,n;null==(t=b.current)||t.remove(),null==(n=O.current)||n.remove(),b.current=null,O.current=null}},[]),'android'===u.Platform.OS?o.createElement(u.View,{style:{bottom:p?50:p}},l,o.createElement(u.KeyboardAvoidingView,{behavior:"padding",keyboardVerticalOffset:-p/2})):o.createElement(u.Animated.View,{style:{paddingBottom:p,flex:1}},l)};e.default=f},792,[1,41,165,2]); -__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,o.useContext)(h.ConfigServiceContext).sessionConfig,C=t.permissions.polls.can_create,w=(0,p.useDisclosure)(),P=w.isOpen,O=w.onClose,j=w.onOpen,M=(0,o.useContext)(f.MediaRoomContext).mediaRoom,B=(0,o.useContext)(s.PeersServiceContext).selfPeer,S=(0,u.useSelector)(function(t){return t.room.polls}),_=(0,n.useWindowDimensions)(),k=t.theme.dimensions||_,T=k.height,D=k.width,F=(Math.floor(2*T/3),function(){var t=P?O:j;t()}),R=(0,u.useSelector)(function(t){return t.room.chatMessages}).filter(function(t){return!0!==t.read&&t.type===x.MessageTypes.poll}),W=(0,u.useDispatch)();(0,o.useEffect)(function(){R.length>0&&W((0,m.markMessagesRead)((0,l.default)({},x.MessageTypes.poll,!0)))},[R]);var N=Object.values(S);return o.default.createElement(c.Flex,{height:T-30,width:D,direction:"column",justifyContent:"space-between",overflowY:"auto",px:10,pb:10,pt:50},o.default.createElement(c.Flex,null,o.default.createElement(c.Box,{overflowY:"auto",className:"dyte-client-noScrollbar"},P?o.default.createElement(c.Box,null,P&&o.default.createElement(b.default,{toggle:F})):o.default.createElement(o.default.Fragment,null,N.length>0?o.default.createElement(n.ScrollView,{style:{height:C?T-150:T},contentContainerStyle:{paddingBottom:C?0:120}},o.default.createElement(n.TouchableWithoutFeedback,null,o.default.createElement(c.Box,null,N.map(function(t,l){return o.default.createElement(c.Box,{my:10},o.default.createElement(c.Text,{ml:4},t.createdBy?"Poll by "+t.createdBy:''),o.default.createElement(c.Box,{mt:1,className:"dyte-client-bubble dyte-client-other dyte-client-type-3"},o.default.createElement(E.default,{mediaRoom:M,poll:t,selfPeer:B})))})))):o.default.createElement(c.Flex,{height:T-150,width:D,align:"center",justify:"center"},o.default.createElement(c.Text,{fontSize:"lg",color:v.colors.textPrimary[100]},"No Polls created yet."))))),C&&o.default.createElement(c.Button,{fontSize:"16",onClick:F},o.default.createElement(c.Box,{bg:P?'danger.500':'primary.500',p:8,justify:"center",borderRadius:y.default.small},o.default.createElement(c.Text,{textAlign:"center"},P?'Cancel Poll Creation':'Create New Poll'))))};var l=t(r(d[1])),n=r(d[2]),o=(function(t,l){if(!l&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(l);if(n&&n.has(t))return n.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,n&&n.set(t,o);return o})(r(d[3])),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),m=r(d[8]),p=r(d[9]),y=t(r(d[10])),h=r(d[11]),x=r(d[12]),b=t(r(d[13])),E=t(r(d[14])),v=r(d[15]);function C(t){if("function"!=typeof WeakMap)return null;var l=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:l})(t)}},793,[1,261,2,165,432,512,585,674,480,493,676,508,718,794,796,798]); +__d(function(g,r,i,a,_m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,o.useContext)(h.ConfigServiceContext).sessionConfig,C=t.permissions.polls.can_create,w=(0,p.useDisclosure)(),P=w.isOpen,O=w.onClose,j=w.onOpen,M=(0,o.useContext)(f.MediaRoomContext).mediaRoom,B=(0,o.useContext)(s.PeersServiceContext).selfPeer,S=(0,u.useSelector)(function(t){return t.room.polls}),_=(0,n.useWindowDimensions)(),k=(0,p.useScale)(t.theme.dimensions||_),T=k.height,D=k.width,F=(Math.floor(2*T/3),function(){var t=P?O:j;t()}),R=(0,u.useSelector)(function(t){return t.room.chatMessages}).filter(function(t){return!0!==t.read&&t.type===x.MessageTypes.poll}),W=(0,u.useDispatch)();(0,o.useEffect)(function(){R.length>0&&W((0,m.markMessagesRead)((0,l.default)({},x.MessageTypes.poll,!0)))},[R]);var N=Object.values(S);return o.default.createElement(c.Flex,{height:T-30,width:D,direction:"column",justifyContent:"space-between",overflowY:"auto",px:10,pb:10,pt:50},o.default.createElement(c.Flex,null,o.default.createElement(c.Box,{overflowY:"auto",className:"dyte-client-noScrollbar"},P?o.default.createElement(c.Box,null,P&&o.default.createElement(b.default,{toggle:F})):o.default.createElement(o.default.Fragment,null,N.length>0?o.default.createElement(n.ScrollView,{style:{height:C?T-150:T},contentContainerStyle:{paddingBottom:C?0:120}},o.default.createElement(n.TouchableWithoutFeedback,null,o.default.createElement(c.Box,null,N.map(function(t,l){return o.default.createElement(c.Box,{my:10},o.default.createElement(c.Text,{ml:4},t.createdBy?"Poll by "+t.createdBy:''),o.default.createElement(c.Box,{mt:1,className:"dyte-client-bubble dyte-client-other dyte-client-type-3"},o.default.createElement(E.default,{mediaRoom:M,poll:t,selfPeer:B})))})))):o.default.createElement(c.Flex,{height:T-150,width:D,align:"center",justify:"center"},o.default.createElement(c.Text,{fontSize:"lg",color:v.colors.textPrimary[100]},"No Polls created yet."))))),C&&o.default.createElement(c.Button,{fontSize:"16",onClick:F},o.default.createElement(c.Box,{bg:P?'danger.500':'primary.500',p:8,justify:"center",borderRadius:y.default.small},o.default.createElement(c.Text,{textAlign:"center"},P?'Cancel Poll Creation':'Create New Poll'))))};var l=t(r(d[1])),n=r(d[2]),o=(function(t,l){if(!l&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(l);if(n&&n.has(t))return n.get(t);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var f=u?Object.getOwnPropertyDescriptor(t,c):null;f&&(f.get||f.set)?Object.defineProperty(o,c,f):o[c]=t[c]}o.default=t,n&&n.set(t,o);return o})(r(d[3])),u=r(d[4]),c=r(d[5]),f=r(d[6]),s=r(d[7]),m=r(d[8]),p=r(d[9]),y=t(r(d[10])),h=r(d[11]),x=r(d[12]),b=t(r(d[13])),E=t(r(d[14])),v=r(d[15]);function C(t){if("function"!=typeof WeakMap)return null;var l=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:l})(t)}},793,[1,261,2,165,432,512,585,674,480,493,676,508,718,794,796,798]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var C=t.toggle,k=(0,u.useContext)(f.MediaRoomContext).mediaRoom,b=u.default.useState({question:'',options:Array(2).fill(''),anonymous:!1,hideVotes:!0}),v=(0,n.default)(b,2),T=v[0],E=v[1],w=(0,u.useContext)(c.ThemeContext).colors,P=function(t,n){var l=T.options;l[n]=t,E((0,o.default)({},T,{options:l}))},O=function(){var t=T.options;t.push(''),E((0,o.default)({},T,{options:t}))},j=(u.default.useContext(x.OrientationContext).orientation,(0,u.useContext)(p.ConfigServiceContext).sessionConfig),B=(0,l.useWindowDimensions)(),R=(j.theme.dimensions||B).height;return u.default.createElement(l.ScrollView,{style:{height:R-200}},u.default.createElement(s.Box,{py:20,px:10},u.default.createElement(s.VStack,{spacing:4},u.default.createElement(s.Text,{fontSize:"xl",textAlign:"center"},"Poll Question"),u.default.createElement(l.TextInput,{multiline:!0,autoFocus:!1,placeholder:"What is your poll for?",numberOfLines:4,value:T.question,placeholderTextColor:w.textPrimary[400],onChangeText:function(t){E((0,o.default)({},T,{question:t}))},style:[{backgroundColor:w.secondary[800],height:75,color:w.textPrimary[300]},y.default.createPollInputText]}),T.options.map(function(t,o){return u.default.createElement(l.TextInput,{autoFocus:!1,placeholder:"Enter an option",value:T.options[o],placeholderTextColor:w.textPrimary[400],onChangeText:function(t){return P(t,o)},style:[{backgroundColor:w.secondary[800],color:w.textPrimary[300]},y.default.createPollInputText]})}),u.default.createElement(s.Box,{bg:"secondary.700",mt:20,width:125,height:30,alignItems:"center",justifyContent:"center"},u.default.createElement(s.Button,{onClick:function(){return O()}},u.default.createElement(s.Text,null,"+ Add an Option"))),u.default.createElement(s.CheckBox,{rightText:"Anonymous",style:{marginTop:15,paddingRight:10,height:20,justifyContent:'center',borderRadius:h.default.small},rightTextStyle:{color:'white'},checkedCheckBoxColor:"white",uncheckedCheckBoxColor:"white",isChecked:T.anonymous,onClick:function(){var t=!T.anonymous;E((0,o.default)({},T,{anonymous:t}))}}),u.default.createElement(s.CheckBox,{rightText:"Hide Results before Voting",style:{marginTop:15,paddingRight:10,height:20,justifyContent:'center',borderRadius:h.default.small},rightTextStyle:{color:'white'},checkedCheckBoxColor:"white",uncheckedCheckBoxColor:"white",isChecked:T.hideVotes,onClick:function(){var t=!T.hideVotes;E((0,o.default)({},T,{hideVotes:t}))}}),u.default.createElement(s.Box,{mt:10,bg:"primary.500",p:8,mb:5,justify:"center",borderRadius:h.default.small},u.default.createElement(s.Button,{fontSize:"16",onClick:function(){var t=T.question,n=T.options;if(t)if(''===n[0]||''===n[1])l.Alert.alert('Error:','Please add minimum two options',[{text:'OK'}]);else{var u=(0,o.default)({},T);u.options=n.filter(function(t){return''!==t}),k.newPoll(u),C()}else l.Alert.alert('Error:','Question Can\'t be empty',[{text:'OK'}])}},u.default.createElement(s.Text,{textAlign:"center"},"Create Poll"))))))};var o=t(r(d[1])),n=t(r(d[2])),l=r(d[3]),u=(function(t,o){if(!o&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=C(o);if(n&&n.has(t))return n.get(t);var l={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var s=u?Object.getOwnPropertyDescriptor(t,c):null;s&&(s.get||s.set)?Object.defineProperty(l,c,s):l[c]=t[c]}l.default=t,n&&n.set(t,l);return l})(r(d[4])),c=r(d[5]),s=r(d[6]),f=r(d[7]),h=t(r(d[8])),p=r(d[9]),x=r(d[10]),y=t(r(d[11]));function C(t){if("function"!=typeof WeakMap)return null;var o=new WeakMap,n=new WeakMap;return(C=function(t){return t?n:o})(t)}},794,[1,22,41,2,165,514,512,585,676,508,575,795]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(d[1]),n=t(r(d[2])),u=o.StyleSheet.create({createPollInputText:{paddingLeft:15,paddingRight:5,marginTop:20,borderRadius:n.default.medium,paddingTop:10,paddingBottom:10}});e.default=u},795,[1,2,676]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var s=t.selfPeer,p=t.mediaRoom,v=t.poll,x=function(t){try{p.votePoll({index:t,pollId:v.id})}catch(t){l.Alert.alert('Error','Error: Problem casting your vote',[{text:'OK'}])}};if(console.log('Poll',v),v){v.id;var h=Math.max.apply(Math,(0,n.default)(v.options.map(function(t){return t.votes.length})).concat([0]));return o.default.createElement(u.VStack,{spacing:2,direction:"row",bg:"secondary.800",p:12,mt:8,borderRadius:c.default.medium},o.default.createElement(u.Text,{textAlign:"left"},v.question),o.default.createElement(u.Box,{mt:8},v.options.map(function(t,n){return o.default.createElement(u.Flex,{onClick:function(){return x(n)},mb:4},o.default.createElement(f.default,{active:t.votes.length===h&&t.votes.length>0,option:t,index:n,selfId:s.userId,onChange:function(){return x(n)}}))})))}return o.default.createElement(u.Text,{fontStyle:"italic"},"Poll wasn't found or has been deleted")};var n=t(r(d[1])),l=r(d[2]),o=t(r(d[3])),u=r(d[4]),c=t(r(d[5])),f=t(r(d[6]))},796,[1,49,2,165,512,676,797]); @@ -804,7 +804,7 @@ __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{ __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"colors",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"fontSize",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"fontWeight",{enumerable:!0,get:function(){return f.default}});var n=t(r(d[1])),u=t(r(d[2])),f=t(r(d[3]))},798,[1,576,799,800]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var x={xs:'12px',sm:'14px',md:'16px',lg:'18px',xl:'20px'};e.default=x},799,[]); __d(function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l={light:300,normal:400,medium:500,bold:600};e.default=l},800,[]); -__d(function(g,r,_i,_a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,c.useSelector)(function(t){return t.room.roomViewType}),i=(0,n.useContext)(p.PeersServiceContext),l=i.processedPeers,a=i.selfPeer,s=i.joinedProcessedPeers,y=(0,n.useContext)(x.MediaRoomContext).mediaRoom,T=(0,n.useContext)(b.ConfigServiceContext).sessionConfig,R=(0,o.useWindowDimensions)(),k=(T.theme.dimensions||R).width,C=(0,c.useSelector)(function(t){return t.room.requestToJoinPeersList}),_=C.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.present}),S=C.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.ask});l=[a].concat(l.sort(function(t,n){return t.id.localeCompare(n.id)})).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)});var P=[a].concat(s).filter(function(t){return null==t?void 0:t.webinarHiddenParticipant}).filter(function(t,n,i){return i.findIndex(function(n){return n.id===t.id})===n}),v=[a].concat(s).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)&&t.requestToJoinType===u.RequestToJoinType.ask});l=l.concat(v).filter((q=new Set,function(t){return!q.has(t.id)&&q.add(t.id)}));var q;var A=function(t,n){y.acceptAllRequestToJoinStage([{id:t,requestToJoinType:n,type:f.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT}])},M=function(t){y.rejectRequestToJoinStage(t)};return n.default.createElement(E.Flex,{mt:60,width:k},n.default.createElement(o.ScrollView,{style:{padding:20}},n.default.createElement(o.TouchableWithoutFeedback,null,n.default.createElement(E.Box,null,n.default.createElement(E.Box,{my:20},t===f.DyteViewTypes.webinar&&l.length>0&&n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mb:10},"Presenting (",l.length,")"),l.map(function(i){return n.default.createElement(w,{peer:i,key:i.id,mediaRoom:y,permissions:null==T?void 0:T.permissions,roomViewType:t})})),P.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Attending (",P.length,")"),P.map(function(i){return n.default.createElement(w,{key:i.id,peer:i,mediaRoom:y,permissions:null==T?void 0:T.permissions,roomViewType:t})})),S.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to ask Question (",S.length,")"),S.map(function(t){return n.default.createElement(h,{rejectRequest:M,acceptRequest:A,peer:t,key:t.id,type:"REQUEST_TO_ASK"})})),_.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to Present (",_.length,")"),_.map(function(t){return n.default.createElement(h,{rejectRequest:M,acceptRequest:A,peer:t,key:t.id,type:"REQUEST_TO_PRESENT"})})),n.default.createElement(E.Box,{height:200})))))};var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var i=T(n);if(i&&i.has(t))return i.get(t);var l={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(l,a,u):l[a]=t[a]}l.default=t,i&&i.set(t,l);return l})(r(d[1])),i=r(d[2]),l=t(r(d[3])),o=r(d[4]),a=t(r(d[5])),u=r(d[6]),c=r(d[7]),f=r(d[8]),s=t(r(d[9])),p=r(d[10]),E=r(d[11]),y=t(r(d[12])),x=r(d[13]),b=r(d[14]);function T(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,i=new WeakMap;return(T=function(t){return t?i:n})(t)}function h(t){var o=t.rejectRequest,a=t.acceptRequest,u=t.peer,c=t.type,f=(0,n.useContext)(i.ThemeContext).colors;return n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+u.name,bgColor:f.primary[500]}),n.default.createElement(E.Text,{ml:10,color:f.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:u.name>30?u.name.substring(0,20)+"...":""+u.name,charSize:30}),u.isMe?' (me)':null)),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:6},n.default.createElement(E.Button,{onClick:function(){return a(u.id,c)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"check",fill:f.success[500]}))),n.default.createElement(E.Box,{ml:6},n.default.createElement(E.Button,{onClick:function(){return o(u.id)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"clear",fill:f.danger[500]})))))}function w(t){var o=t.peer,c=t.mediaRoom,p=t.permissions,x=t.roomViewType,T=(0,n.useContext)(i.ThemeContext).colors,h=(0,n.useContext)(b.ConfigServiceContext).participantControls,w=(null==p?void 0:p.pin_participant)||(null==p?void 0:p.can_allow_participant_audio)||(null==p?void 0:p.can_allow_participant_video)||(null==p?void 0:p.kick_participant),R=p.accept_present_requests,k=[];return(w||h.length>0)&&(null!=p&&p.pin_participant&&(o.isPinned?k.push({title:'Unpin',onClick:function(){return c.pin(null)}}):k.push({title:'Pin',onClick:function(){return c.pin(o.id)}})),null!=p&&p.can_allow_participant_audio&&k.push({title:'Mute Audio',onClick:function(){return c.disableAudio(o.id)}}),null!=p&&p.can_allow_participant_video&&k.push({title:'Disable Video',onClick:function(){return c.disableVideo(o.id)}}),null!=p&&p.kick_participant&&!o.isMe&&k.push({title:'Kick',onClick:function(){return c.kick(o.id)}}),x!==f.DyteViewTypes.webinar||o.isMe||!R||o.webinarHiddenParticipant||k.push({title:'Force Stop Presenting',onClick:function(){return c.removePeerFromStage(o.id,f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR)}}),x===f.DyteViewTypes.webinar&&!o.isMe&&R&&k.push({title:'Grant Premission to Present',onClick:function(){return c.acceptAllRequestToJoinStage([{id:o.id,requestToJoinType:u.RequestToJoinType.present,type:f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR}])}}),h.forEach(function(t){o.isMe&&!1===t.showSelf||k.push({title:t.label,onClick:function(){return t.onClick(o.id)}})}),k.push({title:'Cancel',onClick:function(){}})),n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+o.displayName,bgColor:T.primary[500]}),n.default.createElement(E.HStack,{ml:10,color:T.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:o.displayName.length>30?o.displayName.substring(0,20)+"...":""+o.displayName,charSize:30}),(o.isMe||o.label)&&n.default.createElement(E.Text,{background:"primary.300",color:"textPrimary.100",pr:4,ml:4,borderRadius:3},o.isMe?'me':o.label))),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:8},o.producingAudio?n.default.createElement(E.Icon,{boxSize:"xl",name:"mic",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"mic-off",fill:T.danger[500]})),o.producingVideo?n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam-off",fill:T.danger[500]}),(w||h.length>0)&&n.default.createElement(a.default,{options:k.map(function(t){return t.title}),actions:k.map(function(t){return t.onClick})})))}},801,[1,165,514,682,2,802,487,432,497,676,674,512,692,585,508]); +__d(function(g,r,_i,_a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var t=(0,c.useSelector)(function(t){return t.room.roomViewType}),i=(0,n.useContext)(p.PeersServiceContext),l=i.processedPeers,a=i.selfPeer,s=i.joinedProcessedPeers,y=(0,n.useContext)(x.MediaRoomContext).mediaRoom,h=(0,n.useContext)(b.ConfigServiceContext).sessionConfig,k=(0,o.useWindowDimensions)(),C=(0,T.useScale)(h.theme.dimensions||k).width,S=(0,c.useSelector)(function(t){return t.room.requestToJoinPeersList}),_=S.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.present}),P=S.filter(function(t){return t.requestToJoinType===u.RequestToJoinType.ask});l=[a].concat(l.sort(function(t,n){return t.id.localeCompare(n.id)})).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)});var v=[a].concat(s).filter(function(t){return null==t?void 0:t.webinarHiddenParticipant}).filter(function(t,n,i){return i.findIndex(function(n){return n.id===t.id})===n}),q=[a].concat(s).filter(function(t){return!(null!=t&&t.webinarHiddenParticipant)&&t.requestToJoinType===u.RequestToJoinType.ask});l=l.concat(q).filter((A=new Set,function(t){return!A.has(t.id)&&A.add(t.id)}));var A;var M=function(t,n){y.acceptAllRequestToJoinStage([{id:t,requestToJoinType:n,type:f.WebinarAcceptRequestType.REQUESTED_BY_PARTICIPANT}])},W=function(t){y.rejectRequestToJoinStage(t)};return n.default.createElement(E.Flex,{mt:60,width:C},n.default.createElement(o.ScrollView,{style:{padding:20}},n.default.createElement(o.TouchableWithoutFeedback,null,n.default.createElement(E.Box,null,n.default.createElement(E.Box,{my:20},t===f.DyteViewTypes.webinar&&l.length>0&&n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mb:10},"Presenting (",l.length,")"),l.map(function(i){return n.default.createElement(R,{peer:i,key:i.id,mediaRoom:y,permissions:null==h?void 0:h.permissions,roomViewType:t})})),v.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Attending (",v.length,")"),v.map(function(i){return n.default.createElement(R,{key:i.id,peer:i,mediaRoom:y,permissions:null==h?void 0:h.permissions,roomViewType:t})})),P.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to ask Question (",P.length,")"),P.map(function(t){return n.default.createElement(w,{rejectRequest:W,acceptRequest:M,peer:t,key:t.id,type:"REQUEST_TO_ASK"})})),_.length>0&&n.default.createElement(E.Box,null,n.default.createElement(E.Text,{fontSize:16,fontWeight:"bold",mt:20,mb:10},' ',"Want to Present (",_.length,")"),_.map(function(t){return n.default.createElement(w,{rejectRequest:W,acceptRequest:M,peer:t,key:t.id,type:"REQUEST_TO_PRESENT"})})),n.default.createElement(E.Box,{height:200})))))};var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var i=h(n);if(i&&i.has(t))return i.get(t);var l={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(l,a,u):l[a]=t[a]}l.default=t,i&&i.set(t,l);return l})(r(d[1])),i=r(d[2]),l=t(r(d[3])),o=r(d[4]),a=t(r(d[5])),u=r(d[6]),c=r(d[7]),f=r(d[8]),s=t(r(d[9])),p=r(d[10]),E=r(d[11]),y=t(r(d[12])),x=r(d[13]),b=r(d[14]),T=r(d[15]);function h(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,i=new WeakMap;return(h=function(t){return t?i:n})(t)}function w(t){var o=t.rejectRequest,a=t.acceptRequest,u=t.peer,c=t.type,f=(0,n.useContext)(i.ThemeContext).colors;return n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+u.name,bgColor:f.primary[500]}),n.default.createElement(E.Text,{ml:10,color:f.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:u.name>30?u.name.substring(0,20)+"...":""+u.name,charSize:30}),u.isMe?' (me)':null)),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:6},n.default.createElement(E.Button,{onClick:function(){return a(u.id,c)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"check",fill:f.success[500]}))),n.default.createElement(E.Box,{ml:6},n.default.createElement(E.Button,{onClick:function(){return o(u.id)}},n.default.createElement(E.Icon,{boxSize:"xl",name:"clear",fill:f.danger[500]})))))}function R(t){var o=t.peer,c=t.mediaRoom,p=t.permissions,x=t.roomViewType,T=(0,n.useContext)(i.ThemeContext).colors,h=(0,n.useContext)(b.ConfigServiceContext).participantControls,w=(null==p?void 0:p.pin_participant)||(null==p?void 0:p.can_allow_participant_audio)||(null==p?void 0:p.can_allow_participant_video)||(null==p?void 0:p.kick_participant),R=p.accept_present_requests,k=[];return(w||h.length>0)&&(null!=p&&p.pin_participant&&(o.isPinned?k.push({title:'Unpin',onClick:function(){return c.pin(null)}}):k.push({title:'Pin',onClick:function(){return c.pin(o.id)}})),null!=p&&p.can_allow_participant_audio&&k.push({title:'Mute Audio',onClick:function(){return c.disableAudio(o.id)}}),null!=p&&p.can_allow_participant_video&&k.push({title:'Disable Video',onClick:function(){return c.disableVideo(o.id)}}),null!=p&&p.kick_participant&&!o.isMe&&k.push({title:'Kick',onClick:function(){return c.kick(o.id)}}),x!==f.DyteViewTypes.webinar||o.isMe||!R||o.webinarHiddenParticipant||k.push({title:'Force Stop Presenting',onClick:function(){return c.removePeerFromStage(o.id,f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR)}}),x===f.DyteViewTypes.webinar&&!o.isMe&&R&&k.push({title:'Grant Premission to Present',onClick:function(){return c.acceptAllRequestToJoinStage([{id:o.id,requestToJoinType:u.RequestToJoinType.present,type:f.WebinarAcceptRequestType.REQUESTED_BY_MODERATOR}])}}),h.forEach(function(t){o.isMe&&!1===t.showSelf||k.push({title:t.label,onClick:function(){return t.onClick(o.id)}})}),k.push({title:'Cancel',onClick:function(){}})),n.default.createElement(E.Flex,{direction:"row",align:"center",justify:"space-between",bg:"secondary.800",p:8,mt:8,borderRadius:s.default.medium},n.default.createElement(E.Flex,{direction:"row",align:"center"},n.default.createElement(l.default,{name:""+o.displayName,bgColor:T.primary[500]}),n.default.createElement(E.HStack,{ml:10,color:T.textPrimary[200],textAlign:"center",fontWeight:"bold"},n.default.createElement(y.default,{name:o.displayName.length>30?o.displayName.substring(0,20)+"...":""+o.displayName,charSize:30}),(o.isMe||o.label)&&n.default.createElement(E.Text,{background:"primary.300",color:"textPrimary.100",pr:4,ml:4,borderRadius:3},o.isMe?'me':o.label))),n.default.createElement(E.Flex,{ml:"auto",mr:2,direction:"row"},n.default.createElement(E.Box,{mr:8},o.producingAudio?n.default.createElement(E.Icon,{boxSize:"xl",name:"mic",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"mic-off",fill:T.danger[500]})),o.producingVideo?n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam",fill:T.textPrimary[400]}):n.default.createElement(E.Icon,{boxSize:"xl",name:"videocam-off",fill:T.danger[500]}),(w||h.length>0)&&n.default.createElement(a.default,{options:k.map(function(t){return t.title}),actions:k.map(function(t){return t.onClick})})))}},801,[1,165,514,682,2,802,487,432,497,676,674,512,692,585,508,493]); __d(function(g,r,_i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var o={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=l?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o})(r(d[2])),o=r(d[3]),l=r(d[4]),i=r(d[5]),u=e(r(d[6]));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}var f=function(e){var c=(0,n.useRef)(),f=(0,n.useState)(!1),s=(0,t.default)(f,2),p=s[0],h=s[1],w=(0,n.useContext)(l.ThemeContext).colors,v=function(t){for(var n=e.options,o=0;o=0&&(n=e.destructiveIndex),o.ActionSheetIOS.showActionSheetWithOptions({options:t,destructiveButtonIndex:n,cancelButtonIndex:t.length-1},function(e){v(e)})}else'android'===o.Platform.OS&&o.UIManager.showPopupMenu((0,o.findNodeHandle)(c.current),t,function(){return console.log('something went wrong with the popup menu')},function(e,t){v(t)})}},n.default.createElement(i.Icon,{boxSize:"xl",ml:5,name:"dots-vertical",fill:w.textPrimary[300]}))),b)};_e.default=f},802,[1,41,165,2,514,512,676]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.stopRecording=e.startRecording=e.getActiveRecording=void 0;var n=t(r(d[1])),o=t(r(d[2]));e.startRecording=function(t){var s,c,u,p;return n.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,l.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/recording",{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:if(201===(p=l.sent).status){l.next=6;break}throw new Error('Recording failed to start');case 6:return l.abrupt("return",p.json());case 7:case"end":return l.stop()}},null,null,null,Promise)};e.stopRecording=function(t){var s,c,u,p,l;return n.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,p=t.recordingId,f.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/recordings/"+p,{method:'PUT',body:JSON.stringify({recordingAction:'stop'}),headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:if(201===(l=f.sent).status){f.next=6;break}throw new Error('Recording failed to stop');case 6:return f.abrupt("return",l.json());case 7:case"end":return f.stop()}},null,null,null,Promise)};e.getActiveRecording=function(t){var s,c,u,p;return n.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return s=t.authToken,c=t.organizationId,u=t.roomName,l.next=3,n.default.awrap(fetch(o.default.apiBase+"/v1/organizations/"+c+"/rooms/"+u+"/active-recording",{method:'GET',headers:{Accept:'application/json','Content-Type':'application/json',Authorization:"Bearer "+s}}));case 3:return p=l.sent,l.abrupt("return",p.json());case 5:case"end":return l.stop()}},null,null,null,Promise)}},803,[1,67,504]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var o=b(n);if(o&&o.has(t))return o.get(t);var u={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var c=l?Object.getOwnPropertyDescriptor(t,s):null;c&&(c.get||c.set)?Object.defineProperty(u,s,c):u[s]=t[s]}u.default=t,o&&o.set(t,u);return u})(r(d[1])),o=r(d[2]),u=r(d[3]),l=r(d[4]),s=r(d[5]),c=r(d[6]),f=r(d[7]),p=r(d[8]),y=r(d[9]),T=t(r(d[10]));function b(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,o=new WeakMap;return(b=function(t){return t?o:n})(t)}var x=function(t){var b=t.isMobile,x=(0,u.useSelector)(function(t){return t.room.roomViewType}),S=(0,u.useSelector)(function(t){return t.participant.requestToJoinStageState}),q=(0,n.useContext)(p.ThemeContext).colors,v=(0,n.useContext)(o.MediaRoomContext).mediaRoom,E=(0,u.useDispatch)(),R=(0,n.useContext)(y.ConfigServiceContext).sessionConfig,w=(0,c.useWindowDimensions)(),C=R.theme.dimensions||w,h=(C.height,C.width),O=x===s.DyteViewTypes.webinar&&S===l.RequestToJoinStageState.INITIATED;return n.default.createElement(f.Modal,{isVisible:O,backdropOpacity:.8,backdropColor:q.secondary[800]},n.default.createElement(f.Flex,{width:.9*h,bg:"secondary.1000",color:"textPrimary.100",px:15,borderRadius:T.default.medium},n.default.createElement(f.Flex,{pt:15},n.default.createElement(f.Text,{fontSize:28,fontWeight:"bold"},"Request")),n.default.createElement(f.Flex,{display:"flex",pb:20},n.default.createElement(f.Flex,{direction:b?'column':'row',justifyContent:"space-between"},n.default.createElement(f.Button,{onClick:function(){return t=l.RequestToJoinType.present,E((0,l.requestToJoinType)(t)),E((0,l.requestedJoinToStageState)(l.RequestToJoinStageState.WAITING)),v.requestToJoinStage(t),void c.Alert.alert('Request Sent',"Request to "+(t===l.RequestToJoinType.present?'present':'ask')+" has been sent successfully to host",[{text:'OK',onPress:function(){}}]);var t}},n.default.createElement(f.Box,{bg:"primary.500",py:12,px:20,mt:20,borderRadius:T.default.small,align:"center"},n.default.createElement(f.Text,null,"Request to Present"))),n.default.createElement(f.Button,{onClick:function(){E((0,l.requestedJoinToStageState)(l.RequestToJoinStageState.NONE)),E((0,l.requestToJoinType)(void 0))}},n.default.createElement(f.Box,{bg:"danger.500",py:12,px:20,mt:20,borderRadius:T.default.small,align:"center"},n.default.createElement(f.Text,null,"Cancel")))))))};e.default=x},804,[1,165,585,432,487,497,2,512,514,508,676]); diff --git a/Frameworks/ios-simulator.xcarchive/Products/usr/local/lib/libDyteLib.a b/Frameworks/ios-simulator.xcarchive/Products/usr/local/lib/libDyteLib.a index 5450789..fe49193 100644 Binary files a/Frameworks/ios-simulator.xcarchive/Products/usr/local/lib/libDyteLib.a and b/Frameworks/ios-simulator.xcarchive/Products/usr/local/lib/libDyteLib.a differ diff --git a/Frameworks/ios-simulator.xcarchive/dSYMs/DyteSdk.framework.dSYM/Contents/Resources/DWARF/DyteSdk b/Frameworks/ios-simulator.xcarchive/dSYMs/DyteSdk.framework.dSYM/Contents/Resources/DWARF/DyteSdk index b81bae2..bade010 100644 Binary files a/Frameworks/ios-simulator.xcarchive/dSYMs/DyteSdk.framework.dSYM/Contents/Resources/DWARF/DyteSdk and b/Frameworks/ios-simulator.xcarchive/dSYMs/DyteSdk.framework.dSYM/Contents/Resources/DWARF/DyteSdk differ