diff --git a/docs/conf.bundle.js b/docs/conf.bundle.js index 458ea64..d0ae18a 100644 --- a/docs/conf.bundle.js +++ b/docs/conf.bundle.js @@ -1,22 +1,22 @@ -!function(e){function t(t){for(var r,o,s=t[0],c=t[1],l=t[2],u=0,b=[];uObject(r.c)("i",{className:"material-icons",css:t?[c,l]:c},e),o=({name:e,version:t})=>{let n=null;switch(e){case"Chrome":case"Firefox":case"Safari":n=`./images/conf/icon-${e.toLowerCase()}.svg`;break;case"Microsoft Edge":n="./images/conf/icon-edge.svg"}const i=`${e} v${t}`;return null!==n?Object(r.c)("img",{css:d,src:n,alt:i,title:i}):Object(r.c)(a,{name:"info"})},s=({name:e,showEdge:t,title:n,disabled:i,onClick:o})=>Object(r.c)("button",{disabled:i,onClick:o,title:n,css:i?[u,b]:u},Object(r.c)(a,{name:e,showEdge:t})),c=Object(r.b)({fontSize:i.b},";label:iconStyle;"),l=Object(r.b)({textShadow:`0 0 1px ${i.c.black}`},";label:edgedStyle;"),d=Object(r.b)({height:i.b},";label:imgStyle;"),u=Object(r.b)({padding:"0 1px",height:i.b,appearance:"none",border:"none",background:"none",color:"inherit",cursor:"pointer"},";label:buttonStyle;"),b={name:"1bk4rpo-disabledStyle",styles:"opacity:0.6;cursor:not-allowed;;label:disabledStyle;"}},function(e,t,n){"use strict";n.d(t,"d",(function(){return r})),n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return o}));const r={base:10,modal:100,notification:1e3},i=window.innerWidth>767?600:300,a=250,o=32},,function(e,t,n){"use strict";var r=n(1),i=n(2);class a{constructor(){this.error=null,this.isSettingsOpen=!0,this.isChatOpen=!1,this.isReactionOpen=!1,this.isStatsOpen=!1,this.isReEntering=!1}showError(e){return this.error=e,e}}Object(i.h)(a,{error:i.m.ref,isSettingsOpen:i.m,isChatOpen:i.m,isReactionOpen:i.m,isStatsOpen:i.m,isReEntering:i.m,showError:i.d});var o=a,s=n(24);class c{constructor(){this.hasGetDisplayMedia=!1,this.hasUserVideoDevice=!1,this.isReady=!1,this.displayName="",this.parsedBrowser=null}get isDisplayNameValid(){return""!==this.displayName.trim()}get stat(){return{displayName:this.displayName,browser:this.browser}}get browser(){const{parsedBrowser:e}=this;return null===e?{name:"N/A",version:"0.0.0"}:{name:e.browser.name||"unknown",version:e.browser.version||"0.0.0"}}load({name:e,ua:t,hasGetDisplayMedia:n,hasUserVideoDevice:r}){this.hasGetDisplayMedia=n,this.hasUserVideoDevice=r,this.isReady=!0,this.displayName=e,this.parsedBrowser=Object(s.parse)(t)}}Object(i.h)(c,{hasGetDisplayMedia:i.m,hasUserVideoDevice:i.m,isReady:i.m,displayName:i.m,parsedBrowser:i.m.ref,isDisplayNameValid:i.e,stat:i.e,browser:i.e,load:i.d});var l=c;class d{constructor(){this.audioInDevices=[],this.videoInDevices=[],this.audioDeviceId=null,this.videoDeviceId=null,this.isVideoTrackMuted=!1,this.isAudioTrackMuted=!0,this.videoType=null,this.audioTrack=null,this.videoTrack=null}get isAudioEnabled(){return 0!==this.audioInDevices.length}get stream(){const e=new MediaStream;return this.audioTrack instanceof MediaStreamTrack&&(e.addTrack(this.audioTrack),this.audioTrack.enabled=!this.isAudioTrackMuted),this.videoTrack instanceof MediaStreamTrack&&(e.addTrack(this.videoTrack),this.videoTrack.enabled=!this.isVideoTrackMuted),e}get stat(){return{isVideoDisabled:null===this.videoType,isAudioMuted:this.isAudioTrackMuted,isVideoMuted:this.isVideoTrackMuted}}setAudioTrack(e,t){this.audioTrack=e,this.audioDeviceId=t}setVideoTrack(e,t,n){this.videoTrack=e,this.videoType=t,this.videoDeviceId=n}releaseAudioDevice(){this.audioTrack instanceof MediaStreamTrack&&this.audioTrack.stop()}releaseVideoDevice(){this.videoTrack instanceof MediaStreamTrack&&this.videoTrack.stop()}deleteVideoTrack(){this.videoTrack instanceof MediaStreamTrack&&this.videoTrack.stop(),this.videoTrack=null,this.videoType=null,this.videoDeviceId=null}setAudioDevices({audioInDevices:e}){null!==e&&this.audioInDevices.replace(e)}setVideoDevices({videoInDevices:e}){null!==e&&this.videoInDevices.replace(e)}toggleMuted(e){"video"===e&&(this.isVideoTrackMuted=!this.isVideoTrackMuted),"audio"===e&&(this.isAudioTrackMuted=!this.isAudioTrackMuted)}}Object(i.h)(d,{audioInDevices:i.m.shallow,videoInDevices:i.m.shallow,audioDeviceId:i.m,videoDeviceId:i.m,isAudioTrackMuted:i.m,isVideoTrackMuted:i.m,videoType:i.m,audioTrack:i.m.ref,videoTrack:i.m.ref,stat:i.e,isAudioEnabled:i.e,stream:i.e,setAudioTrack:i.d,setVideoTrack:i.d,releaseAudioDevice:i.d,releaseVideoDevice:i.d,deleteVideoTrack:i.d,setAudioDevices:i.d,setVideoDevices:i.d,toggleMuted:i.d});var u=d,b=n(16);class h{constructor(){this.peer=null,this.room=null,this.mode=null,this.id=null,this.useH264=!1,this.streams=new Map,this.stats=new Map,this.chats=[],this.myLastChat=null,this.myLastReaction=null,this.pinnedId=null,this.castRequestCount=0,this.rtcStats=null}get name(){return`${this.mode}/${this.id}`}get isJoined(){return null!==this.room}get pinnedStream(){return null===this.pinnedId?null:this.streams.get(this.pinnedId)||null}load({mode:e,id:t,useH264:n},r){this.mode=e,this.id=t,this.useH264=n,this.peer=r}addLocalChat(e,t){const n={id:Math.random(),time:Date.now(),isMine:!0,from:e,text:t};this.chats.push(n),this.myLastChat=n}addRemoteChat(e){e.isMine=!1,this.chats.push(e)}addReaction(e,t){this.myLastReaction={from:e,reaction:t}}removeStream(e){this.streams.delete(e),this.stats.delete(e),this.pinnedId===e&&(this.pinnedId=null)}getPeerConnection(){return"sfu"!==this.mode?null:null===this.room?null:Object(b.a)(this.room)}cleanUp(){if(null===this.room)throw new Error("Room is null!");[...this.streams.values()].forEach(e=>e.getTracks().forEach(e=>e.stop())),this.streams.clear(),this.stats.clear(),this.chats.length=0,this.myLastChat=null,this.room=null}}Object(i.h)(h,{peer:i.m.ref,room:i.m.ref,mode:i.m,id:i.m,streams:i.m.shallow,stats:i.m.shallow,chats:i.m.shallow,myLastChat:i.m.ref,myLastReaction:i.m.ref,pinnedId:i.m,castRequestCount:i.m,rtcStats:i.m.ref,name:i.e,isJoined:i.e,pinnedStream:i.e,load:i.d,addLocalChat:i.d,addRemoteChat:i.d,removeStream:i.d,getPeerConnection:i.d,cleanUp:i.d});var m=h;class p{constructor(){this.items=[]}showInfo(e){this.show("info",e,1e3)}showChat(e,t){this.show("chat",`${e}: ${t}`,6e3)}showReaction(e,t){this.show("insert_emoticon",`${e}: ${t}`,3e3)}showJoin(e){this.show("person",`${e} joined`,2e3)}showLeave(e){this.show("person",`${e} left`,2e3)}show(e,t,n){const r={id:Math.random(),type:e,text:t};this.items.push(r),setTimeout(()=>this.items.remove(r),n)}}Object(i.h)(p,{items:i.m.shallow,showInfo:i.d,showChat:i.d,showReaction:i.d,showJoin:i.d,showLeave:i.d,show:i.d});var f=p;var v=class{constructor(){this.ui=new o,this.client=new l,this.media=new u,this.room=new m,this.notification=new f}};n.d(t,"a",(function(){return y}));const g=new v;window.store=g;const y=Object(r.createContext)(g)},,function(e,t,n){"use strict";var r=n(10);t.a=function(){for(var e=arguments.length,t=new Array(e),n=0;n=4;)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++i;switch(n){case 3:r^=(255&e.charCodeAt(i+2))<<16;case 2:r^=(255&e.charCodeAt(i+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(i)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),((r^=r>>>15)>>>0).toString(36)},i={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var a=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}};n.d(t,"a",(function(){return p}));var o=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,c=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},d=a((function(e){return c(e)?e:e.replace(o,"-$&").toLowerCase()})),u=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(s,(function(e,t,n){return h={name:t,styles:n,next:h},t}))}return 1===i[e]||c(e)||"number"!=typeof t||0===t?t:t+"px"};function b(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return h={name:n.name,styles:n.styles,next:h},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)h={name:i.name,styles:i.styles,next:h},i=i.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i"sfu"===e||"mesh"===e,i=16,a="^[0-9a-z_-]{4,16}$",o=e=>new RegExp(a).test(e)},function(e){e.exports=JSON.parse('{"a":"skyway-conference-dev","b":"2.8.6"}')},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;tnew Promise((t,n)=>{const r=new i.a({key:"03ff6219-b58f-4310-9484-e9108e859cdd",debug:2,config:{iceTransportPolicy:e?"relay":"all"}});r.once("open",()=>{r.removeListener("error",n),t(r)}),r.once("error",n)}),o=e=>e._negotiator._pc},function(e,t,n){"use strict"; +`},s=Object(i.b)({html:{WebkitFontSmoothing:"antialiased"},body:{margin:0,fontSize:r,fontFamily:'"Open Sans", sans-serif',fontWeight:"lighter",lineHeight:1.5,height:"100vh",background:`linear-gradient(45deg, ${a.lightblue}, ${a.blue})`},"#app-root":{height:"100vh",overflow:"hidden"}},";label:globalStyle;")},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return s}));n(1);var i=n(0),r=n(3);const a=({name:e,showEdge:t})=>Object(i.c)("i",{className:"material-icons",css:t?[c,l]:c},e),o=({name:e,version:t})=>{let n=null;switch(e){case"Chrome":case"Firefox":case"Safari":n=`./images/conf/icon-${e.toLowerCase()}.svg`;break;case"Microsoft Edge":n="./images/conf/icon-edge.svg"}const r=`${e} v${t}`;return null!==n?Object(i.c)("img",{css:d,src:n,alt:r,title:r}):Object(i.c)(a,{name:"info"})},s=({name:e,showEdge:t,title:n,disabled:r,onClick:o})=>Object(i.c)("button",{disabled:r,onClick:o,title:n,css:r?[u,b]:u},Object(i.c)(a,{name:e,showEdge:t})),c=Object(i.b)({fontSize:r.b},";label:iconStyle;"),l=Object(i.b)({textShadow:`0 0 1px ${r.c.black}`},";label:edgedStyle;"),d=Object(i.b)({height:r.b},";label:imgStyle;"),u=Object(i.b)({padding:"0 1px",height:r.b,appearance:"none",border:"none",background:"none",color:"inherit",cursor:"pointer"},";label:buttonStyle;"),b={name:"1bk4rpo-disabledStyle",styles:"opacity:0.6;cursor:not-allowed;;label:disabledStyle;"}},function(e,t,n){"use strict";n.d(t,"d",(function(){return i})),n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return o}));const i={base:10,modal:100,notification:1e3},r=window.innerWidth>767?600:300,a=250,o=32},,function(e,t,n){"use strict";var i=n(1),r=n(2);class a{constructor(){this.error=null,this.isSettingsOpen=!0,this.isChatOpen=!1,this.isReactionOpen=!1,this.isStatsOpen=!1,this.isReEntering=!1}showError(e){return this.error=e,e}}Object(r.e)(a,{error:r.g.ref,isSettingsOpen:r.g,isChatOpen:r.g,isReactionOpen:r.g,isStatsOpen:r.g,isReEntering:r.g,showError:r.b});var o=a,s=n(24);class c{constructor(){this.hasGetDisplayMedia=!1,this.hasUserVideoDevice=!1,this.isReady=!1,this.displayName="",this.parsedBrowser=null}get isDisplayNameValid(){return""!==this.displayName.trim()}get stat(){return{displayName:this.displayName,browser:this.browser}}get browser(){const{parsedBrowser:e}=this;return null===e?{name:"N/A",version:"0.0.0"}:{name:e.browser.name||"unknown",version:e.browser.version||"0.0.0"}}load({name:e,ua:t,hasGetDisplayMedia:n,hasUserVideoDevice:i}){this.hasGetDisplayMedia=n,this.hasUserVideoDevice=i,this.isReady=!0,this.displayName=e,this.parsedBrowser=Object(s.parse)(t)}}Object(r.e)(c,{hasGetDisplayMedia:r.g,hasUserVideoDevice:r.g,isReady:r.g,displayName:r.g,parsedBrowser:r.g.ref,isDisplayNameValid:r.c,stat:r.c,browser:r.c,load:r.b});var l=c;class d{constructor(){this.audioInDevices=[],this.videoInDevices=[],this.audioDeviceId=null,this.videoDeviceId=null,this.isVideoTrackMuted=!1,this.isAudioTrackMuted=!0,this.videoType=null,this.audioTrack=null,this.videoTrack=null}get isAudioEnabled(){return 0!==this.audioInDevices.length}get stream(){const e=new MediaStream;return this.audioTrack instanceof MediaStreamTrack&&(e.addTrack(this.audioTrack),this.audioTrack.enabled=!this.isAudioTrackMuted),this.videoTrack instanceof MediaStreamTrack&&(e.addTrack(this.videoTrack),this.videoTrack.enabled=!this.isVideoTrackMuted),e}get stat(){return{isVideoDisabled:null===this.videoType,isAudioMuted:this.isAudioTrackMuted,isVideoMuted:this.isVideoTrackMuted}}setAudioTrack(e,t){this.audioTrack=e,this.audioDeviceId=t}setVideoTrack(e,t,n){this.videoTrack=e,this.videoType=t,this.videoDeviceId=n}releaseAudioDevice(){this.audioTrack instanceof MediaStreamTrack&&this.audioTrack.stop()}releaseVideoDevice(){this.videoTrack instanceof MediaStreamTrack&&this.videoTrack.stop()}deleteVideoTrack(){this.videoTrack instanceof MediaStreamTrack&&this.videoTrack.stop(),this.videoTrack=null,this.videoType=null,this.videoDeviceId=null}setAudioDevices({audioInDevices:e}){null!==e&&this.audioInDevices.replace(e)}setVideoDevices({videoInDevices:e}){null!==e&&this.videoInDevices.replace(e)}toggleMuted(e){"video"===e&&(this.isVideoTrackMuted=!this.isVideoTrackMuted),"audio"===e&&(this.isAudioTrackMuted=!this.isAudioTrackMuted)}}Object(r.e)(d,{audioInDevices:r.g.shallow,videoInDevices:r.g.shallow,audioDeviceId:r.g,videoDeviceId:r.g,isAudioTrackMuted:r.g,isVideoTrackMuted:r.g,videoType:r.g,audioTrack:r.g.ref,videoTrack:r.g.ref,stat:r.c,isAudioEnabled:r.c,stream:r.c,setAudioTrack:r.b,setVideoTrack:r.b,releaseAudioDevice:r.b,releaseVideoDevice:r.b,deleteVideoTrack:r.b,setAudioDevices:r.b,setVideoDevices:r.b,toggleMuted:r.b});var u=d,b=n(16);class h{constructor(){this.peer=null,this.room=null,this.mode=null,this.id=null,this.useH264=!1,this.streams=new Map,this.stats=new Map,this.chats=[],this.myLastChat=null,this.myLastReaction=null,this.pinnedId=null,this.castRequestCount=0,this.rtcStats=null}get name(){return`${this.mode}/${this.id}`}get isJoined(){return null!==this.room}get pinnedStream(){return null===this.pinnedId?null:this.streams.get(this.pinnedId)||null}load({mode:e,id:t,useH264:n},i){this.mode=e,this.id=t,this.useH264=n,this.peer=i}addLocalChat(e,t){const n={id:Math.random(),time:Date.now(),isMine:!0,from:e,text:t};this.chats.push(n),this.myLastChat=n}addRemoteChat(e){e.isMine=!1,this.chats.push(e)}addReaction(e,t){this.myLastReaction={from:e,reaction:t}}removeStream(e){this.streams.delete(e),this.stats.delete(e),this.pinnedId===e&&(this.pinnedId=null)}getPeerConnection(){return"sfu"!==this.mode||null===this.room?null:Object(b.a)(this.room)}cleanUp(){if(null===this.room)throw new Error("Room is null!");[...this.streams.values()].forEach(e=>e.getTracks().forEach(e=>e.stop())),this.streams.clear(),this.stats.clear(),this.chats.length=0,this.myLastChat=null,this.room=null}}Object(r.e)(h,{peer:r.g.ref,room:r.g.ref,mode:r.g,id:r.g,streams:r.g.shallow,stats:r.g.shallow,chats:r.g.shallow,myLastChat:r.g.ref,myLastReaction:r.g.ref,pinnedId:r.g,castRequestCount:r.g,rtcStats:r.g.ref,name:r.c,isJoined:r.c,pinnedStream:r.c,load:r.b,addLocalChat:r.b,addRemoteChat:r.b,removeStream:r.b,getPeerConnection:r.b,cleanUp:r.b});var p=h;class f{constructor(){this.items=[]}showInfo(e){this.show("info",e,1e3)}showChat(e,t){this.show("chat",`${e}: ${t}`,6e3)}showReaction(e,t){this.show("insert_emoticon",`${e}: ${t}`,3e3)}showJoin(e){this.show("person",`${e} joined`,2e3)}showLeave(e){this.show("person",`${e} left`,2e3)}show(e,t,n){const i={id:Math.random(),type:e,text:t};this.items.push(i),setTimeout(()=>this.items.remove(i),n)}}Object(r.e)(f,{items:r.g.shallow,showInfo:r.b,showChat:r.b,showReaction:r.b,showJoin:r.b,showLeave:r.b,show:r.b});var m=f;var v=class{constructor(){this.ui=new o,this.client=new l,this.media=new u,this.room=new p,this.notification=new m}};n.d(t,"a",(function(){return y}));const g=new v;window.store=g;const y=Object(i.createContext)(g)},function(e,t,n){"use strict";var i=n(9);t.a=function(){for(var e=arguments.length,t=new Array(e),n=0;n=4;)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+((1540483477*(t>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++r;switch(n){case 3:i^=(255&e.charCodeAt(r+2))<<16;case 2:i^=(255&e.charCodeAt(r+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(r)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),((i^=i>>>15)>>>0).toString(36)},r={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var a=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}};n.d(t,"a",(function(){return f}));var o=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,c=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},d=a((function(e){return c(e)?e:e.replace(o,"-$&").toLowerCase()})),u=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(s,(function(e,t,n){return h={name:t,styles:n,next:h},t}))}return 1===r[e]||c(e)||"number"!=typeof t||0===t?t:t+"px"};function b(e,t,n,i){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return h={name:n.name,styles:n.styles,next:h},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)h={name:r.name,styles:r.styles,next:h},r=r.next;return n.styles+";"}return function(e,t,n){var i="";if(Array.isArray(n))for(var r=0;r"sfu"===e||"mesh"===e,r=16,a="^[0-9a-z_-]{4,16}$",o=e=>new RegExp(a).test(e)},function(e){e.exports=JSON.parse('{"a":"skyway-conference-dev","b":"2.8.7"}')},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var i=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var i=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;tnew Promise((t,n)=>{const i=new r.a({key:"03ff6219-b58f-4310-9484-e9108e859cdd",debug:2,config:{iceTransportPolicy:e?"relay":"all"}});i.once("open",()=>{i.removeListener("error",n),t(i)}),i.once("error",n)}),o=e=>e._negotiator._pc},function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT -*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,c=o(e),l=1;l=O},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125I(o,n))void 0!==c&&0>I(c,o)?(e[r]=c,e[s]=n,r=s):(e[r]=o,e[a]=n,r=a);else{if(!(void 0!==c&&0>I(c,n)))break e;e[r]=c,e[s]=n,r=s}}}return t}return null}function I(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var D=[],A=[],E=1,M=null,R=3,$=!1,V=!1,_=!1;function N(e){for(var t=x(A);null!==t;){if(null===t.callback)T(A);else{if(!(t.startTime<=e))break;T(A),t.sortIndex=t.expirationTime,S(D,t)}t=x(A)}}function L(e){if(_=!1,N(e),!V)if(null!==x(D))V=!0,r(z);else{var t=x(A);null!==t&&i(L,t.startTime-e)}}function z(e,n){V=!1,_&&(_=!1,a()),$=!0;var r=R;try{for(N(n),M=x(D);null!==M&&(!(M.expirationTime>n)||e&&!o());){var s=M.callback;if(null!==s){M.callback=null,R=M.priorityLevel;var c=s(M.expirationTime<=n);n=t.unstable_now(),"function"==typeof c?M.callback=c:M===x(D)&&T(D),N(n)}else T(D);M=x(D)}if(null!==M)var l=!0;else{var d=x(A);null!==d&&i(L,d.startTime-n),l=!1}return l}finally{M=null,R=r,$=!1}}function P(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var F=s;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=R;R=e;try{return t()}finally{R=n}},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var n=R;R=t;try{return e()}finally{R=n}},t.unstable_scheduleCallback=function(e,n,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var c=o.delay;c="number"==typeof c&&0s?(e.sortIndex=c,S(A,e),null===x(D)&&e===x(A)&&(_?a():_=!0,i(L,c-s))):(e.sortIndex=o,S(D,e),V||$||(V=!0,r(z))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=R;return function(){var n=R;R=t;try{return e.apply(this,arguments)}finally{R=n}}},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_shouldYield=function(){var e=t.unstable_now();N(e);var n=x(D);return n!==M&&null!==M&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime1)for(var n=1;nr&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(p,"$1"+e.trim());case 58:return e.trim()+t.replace(p,"$1"+e.trim());default:if(0<1*n&&0c.charCodeAt(8))break;case 115:o=o.replace(c,"-webkit-"+c)+";"+o;break;case 207:case 102:o=o.replace(c,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0h)&&(z=(U=U.replace(" ",":")).length),0=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,t){t=t||{};var s=typeof e;if("string"===s&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var o=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*a;case"hours":case"hour":case"hrs":case"hr":case"h":return o*i;case"minutes":case"minute":case"mins":case"min":case"m":return o*r;case"seconds":case"second":case"secs":case"sec":case"s":return o*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===s&&!1===isNaN(e))return t.long?function(e){var t=Math.abs(e);if(t>=a)return o(e,t,a,"day");if(t>=i)return o(e,t,i,"hour");if(t>=r)return o(e,t,r,"minute");if(t>=n)return o(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=a)return Math.round(e/a)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=r)return Math.round(e/r)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},,,,,,,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},,function(e,t){function n(){}e.exports=n,n.mixin=function(e){var t=e.prototype||e;t.isWildEmitter=!0,t.on=function(e,t,n){this.callbacks=this.callbacks||{};var r=3===arguments.length,i=r?arguments[1]:void 0,a=r?arguments[2]:arguments[1];return a._groupName=i,(this.callbacks[e]=this.callbacks[e]||[]).push(a),this},t.once=function(e,t,n){var r=this,i=3===arguments.length,a=i?arguments[1]:void 0,o=i?arguments[2]:arguments[1];function s(){r.off(e,s),o.apply(this,arguments)}return this.on(e,a,s),this},t.releaseGroup=function(e){var t,n,r,i;for(t in this.callbacks=this.callbacks||{},this.callbacks)for(n=0,r=(i=this.callbacks[t]).length;n{const t=await navigator.mediaDevices.enumerateDevices()||[],n=[],r=[];for(const e of t)"videoinput"===e.kind&&n.push(e),"audioinput"===e.kind&&r.push(e);const i={videoInDevices:null,audioInDevices:null};return e.video&&(i.videoInDevices=n),e.audio&&(i.audioInDevices=r),i},p=async e=>{const t=""===e||{deviceId:{exact:e}};return navigator.mediaDevices.getUserMedia({audio:t}).then(e=>e.getAudioTracks()[0])},f=async e=>{const t=""===e||{deviceId:{exact:e}};return navigator.mediaDevices.getUserMedia({video:t}).then(e=>e.getVideoTracks()[0])};var v=n(16);const g=s()("effect:bootstrap");var y=({error:e})=>Object(a.c)("div",{css:w},Object(a.c)("h2",{css:k},e.message||e.name),Object(a.c)("pre",{css:O},e.stack||"Stack trace is not available."));const w=Object(a.b)({color:l.c.white,margin:16},";label:wrapperStyle;"),k={name:"3qj1jp-headStyle",styles:"font-weight:900;;label:headStyle;"},O={name:"2ay849-detailStyle",styles:"white-space:pre-wrap;;label:detailStyle;"};var j=()=>Object(a.c)("img",{css:C,src:"./images/conf/icon-loading.svg"});const C={name:"y4qk87-wrapperStyle",styles:"position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;width:160px;;label:wrapperStyle;"};var S=({children:e})=>{const t=Object(r.useContext)(u.a);Object(r.useEffect)((({ui:e,room:t})=>()=>{g("checkRoomSetting()");const[,n,r]=location.hash.split("/"),i=new URLSearchParams(location.search);if(!Object(h.b)(n))throw e.showError(new Error("Invalid room type! it should be `sfu` or `mesh`."));if(!Object(h.a)(r))throw e.showError(new Error(`Invalid room name! it should be match \`${h.d.toString()}\`.`));(async()=>{const a=await Object(v.b)(i.has("turn")).catch(t=>{throw e.showError(t)});a.on("error",console.error),t.load({mode:n,id:r,useH264:i.has("h264")},a),g(`room: ${n}/${r}`),g("peer instance created")})()})(t),[t]),Object(r.useEffect)((({ui:e,media:t})=>()=>{g("ensureAudioDevice()"),(async()=>{const{audioInDevices:n}=await m({audio:!0}).catch(t=>{throw e.showError(t)});if(null===n)throw e.showError(new Error("getUserDevices() returns null"));if(0===n.length)throw e.showError(new Error("At least one audio input device needed!"));const[{deviceId:r}]=n,i=await p(r).catch(t=>{throw e.showError(t)});t.setAudioTrack(i,r);const a=await m({audio:!0}).catch(t=>{throw e.showError(t)});t.setAudioDevices(a),g("audio devices",a.audioInDevices)})()})(t),[t]),Object(r.useEffect)((({client:e,media:t,room:n,notification:r})=>()=>{g("listenStoreChanges()");const i=[Object(b.o)(()=>n.isJoined,e=>e&&r.showInfo(`You joined the room ${n.name}`)),Object(b.o)(()=>t.isAudioTrackMuted,e=>r.showInfo(`Mic input was ${e?"muted":"unmuted"}`)),Object(b.o)(()=>t.isVideoTrackMuted,e=>r.showInfo(`Video was ${e?"muted":"unmuted"}`)),Object(b.n)(t,"audioDeviceId",e=>{null!==e.oldValue&&r.showInfo("Mic input was changed")}),Object(b.n)(t,"videoDeviceId",e=>{null!==e.oldValue?null!==e.newValue?r.showInfo("Video input was changed"):r.showInfo("Video input was disabled"):r.showInfo("Video input was enabled")}),Object(b.o)(()=>n.castRequestCount,()=>r.showInfo("Your video was casted to everyone")),Object(b.o)(()=>n.myLastReaction,e=>e&&r.showInfo(`You reacted with ${e.reaction}`)),Object(b.o)(()=>e.displayName,e=>{localStorage.setItem("SkyWayConf.dispName",e.trim()),r.showInfo("Display name saved")},{delay:2e3})];return()=>i.forEach(e=>e())})(t),[t]),Object(r.useEffect)((({media:e,ui:t})=>()=>{g("listenGlobalEvents()");const n=()=>location.reload(!0),r=async()=>{g("devicechange event fired");const{audioInDevices:n,videoInDevices:r}=await m({video:!0,audio:!0}).catch(e=>{throw t.showError(e)});if(null===n||null===r)throw t.showError(new Error("getUserDevices() returns null"));const i=e.audioInDevices,a=e.videoInDevices;i.length&&n.length!==i.length&&location.reload(!0),a.length&&r.length!==a.length&&location.reload(!0)};return window.addEventListener("hashchange",n,!1),navigator.mediaDevices.addEventListener("devicechange",r,!1),()=>{g("listener removed"),window.removeEventListener("hashchange",n),navigator.mediaDevices.removeEventListener("devicechange",r)}})(t),[t]),Object(r.useEffect)((({client:e,ui:t})=>()=>{g("loadClient()"),(async()=>{const{videoInDevices:n}=await m({video:!0}).catch(e=>{throw t.showError(e)});if(null===n)throw t.showError(new Error("getUserDevices() returns null"));e.load({ua:navigator.userAgent,hasUserVideoDevice:0!==n.length,hasGetDisplayMedia:"function"==typeof navigator.mediaDevices.getDisplayMedia,name:(localStorage.getItem("SkyWayConf.dispName")||"").trim()}),g("client loaded",Object(b.r)(e))})()})(t),[t]);const{ui:n,client:i,media:o}=t;return Object(a.c)(d.a,null,()=>null!==n.error?Object(a.c)(y,{error:n.error}):i.isReady&&o.isAudioEnabled?Object(a.c)(r.Fragment,null,e):Object(a.c)(j,null))},x=n(5);const T=Object(a.b)({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:x.d.modal,overflow:"auto",backgroundColor:"rgba(0, 0, 0, .8)",willChange:"opacity",animation:`${a.d`from { opacity: 0; } to { opacity: 1; }`} .4s ease`},";label:wrapperStyle;");var I=({children:e})=>Object(a.c)("div",{css:T},e);const D=s()("component:video");var A=Object(r.memo)(({stream:e,isReverse:t=!1,isVideoOnly:n=!1})=>{const i=0===e.getAudioTracks().length,o=0===e.getVideoTracks().length,s=Object(r.useRef)(null),c=Object(r.useRef)(null),l=D.extend(e.id);return Object(r.useEffect)(()=>{const t=s.current;o||null===t||(l("useEffect(): assign and play stream for video"),t.srcObject!==e&&(t.srcObject=e),t.paused&&t.play())},[o,s,l,e]),Object(r.useEffect)(()=>{const t=c.current;i||n||null===t||(l("useEffect(): assign and play stream for audio"),t.srcObject!==e&&(t.srcObject=e),t.paused&&t.play())},[i,n,c,l,e]),l("render()",[...e.getTracks()]),Object(a.c)(r.Fragment,null,o?null:Object(a.c)("video",{css:t?[M,R]:M,ref:s,playsInline:!0,muted:!0}),n||i?null:Object(a.c)("audio",{css:E,ref:c}))});const E={name:"irc9p9-audioStyle",styles:"display:none;;label:audioStyle;"},M={name:"11u56sq-videoStyle",styles:"width:100%;height:100%;max-width:100%;max-height:100%;pointer-events:none;;label:videoStyle;"},R={name:"wfqmvp-reverseVideoStyle",styles:"transform:scaleX(-1);;label:reverseVideoStyle;"};var $=n(4),V=n(9);const _=({label:e,children:t})=>Object(a.c)("div",{css:Object(V.a)([L,z],";label:SettingsItemDevice;")},Object(a.c)("div",{css:F},e),t),N=({label:e,children:t})=>Object(a.c)("div",{css:Object(V.a)([L,P],";label:SettingsItemName;")},Object(a.c)("div",{css:F},e),Object(a.c)("div",null,t)),L={name:"b74hfd-wrapperStyle",styles:"margin:8px auto;;label:wrapperStyle;"},z={name:"1thp49p-deviceStyle",styles:"display:grid;grid-template-columns:80px 72px 1fr;grid-gap:8px;align-items:center;;label:deviceStyle;"},P={name:"a15aci-nameStyle",styles:"display:grid;grid-template-columns:80px 1fr;grid-gap:8px;align-items:center;;label:nameStyle;"},F={name:"rb14u8-labelStyle",styles:"text-align:center;;label:labelStyle;"};var U=({defaultDispName:e,isInvalid:t,onChangeDispName:n})=>{const[i,o]=Object(r.useState)(e);return Object(a.c)("div",null,Object(a.c)("input",{type:"text",value:i,maxLength:10,placeholder:"Enter your name",onChange:e=>{if(e.target.value.length>10)return;const t=e.target.value;o(t),n(t)},css:t?[q,J]:q}))};const q=Object(a.b)({boxSizing:"border-box",width:"100%",padding:"4px 8px",appearance:"none",border:0,borderBottom:`1px solid ${l.c.gray}`,fontSize:"1.1rem","&:focus":{borderColor:l.c.blue}},";label:nameStyle;"),J=Object(a.b)({borderColor:l.c.red},";label:invalidStyle;");const G=({deviceId:e,inDevices:t,onChangeDeviceId:n})=>Object(a.c)("select",{value:e||"",onChange:e=>n(e.target.value),css:B},t.map(e=>Object(a.c)("option",{key:e.deviceId,value:e.deviceId},e.label))),W=({label:e,disabled:t,onClick:n})=>Object(a.c)("button",{css:B,disabled:!!t,onClick:n},e),B={name:"14nzfdt-formStyle",styles:"box-sizing:border-box;width:100%;height:100%;;label:formStyle;"};var H=({displayName:e,browser:t,controllers:n})=>Object(a.c)("div",{css:X},Object(a.c)("div",{css:Y},Object(a.c)($.a,t)," ",e),Object(a.c)("div",{css:Y},n));const X=Object(a.b)({display:"grid",gridTemplateColumns:"1fr auto",padding:4,color:l.c.white,backgroundColor:"rgba(0, 0, 0, .5)",fontSize:".8rem"},";label:wrapperStyle;"),Y={name:"1kxi40k-rowStyle",styles:"display:inline-flex;align-items:center;;label:rowStyle;"},K=n(31);var Z=Object(r.memo)(({stream:e})=>{const[t,n]=Object(r.useState)(-1/0);return Object(r.useEffect)(()=>{if(0===e.getAudioTracks().length)return;const t=K(e,{threshold:-75});return t.on("volume_change",e=>e!==-1/0&&n(e)),()=>t.stop()},[e]),Object(a.c)("div",{style:Q(t),css:ee})});const Q=e=>{if(e===-1/0)return{};const t=e+100;return{height:.1*t,opacity:.01*t}},ee=Object(a.b)({backgroundColor:l.c.blue,willChange:["height","opacity"]},";label:wrapperStyle;");var te=({stream:e,defaultDispName:t,browser:n,hasGetDisplayMedia:i,hasUserVideoDevice:o,videoType:s,isVideoTrackMuted:c,isAudioTrackMuted:l,videoDeviceId:d,audioDeviceId:u,videoInDevices:b,audioInDevices:h,isReEntering:m,isJoined:p,isDisplayNameValid:f,onChangeVideoDeviceId:v,onChangeAudioDeviceId:g,onClickToggleVideoMuted:y,onClickToggleAudioMuted:w,onClickEnableUserVideo:k,onClickDisableUserVideo:O,onClickEnableDisplayVideo:j,onClickDisableDisplayVideo:C,onChangeDispName:S,onClickCloseSettings:x,onClickJoinConference:T})=>Object(a.c)(I,null,Object(a.c)("div",{css:ne},Object(a.c)("div",{css:re},Object(a.c)(A,{stream:e,isReverse:"camera"===s,isVideoOnly:!0}),Object(a.c)("div",{css:ie},Object(a.c)(Z,{stream:e}),Object(a.c)(H,{displayName:`v${n.version}`,browser:n,controllers:Object(a.c)(r.Fragment,null,null===s?null:Object(a.c)($.c,{name:c?"videocam_off":"videocam",title:c?"Unmute video":"Mute video",onClick:y}),Object(a.c)($.c,{name:l?"mic_off":"mic",title:l?"Unmute audio":"Mute audio",onClick:w}))})),!p&&l?Object(a.c)("div",{css:ae},"Click here to unmute your mic.👇"):null),Object(a.c)("div",{css:oe},Object(a.c)(N,{label:"NAME"},Object(a.c)(U,{defaultDispName:t,isInvalid:!f,onChangeDispName:S})),Object(a.c)(_,{label:"MIC."},Object(a.c)(W,{label:"Disable",disabled:!0}),Object(a.c)(G,{deviceId:u||"",inDevices:h,onChangeDeviceId:g})),o?Object(a.c)(_,{label:"CAMERA"},"camera"===s?Object(a.c)(r.Fragment,null,Object(a.c)(W,{label:"Disable",onClick:O}),Object(a.c)(G,{deviceId:d||"",inDevices:b,onChangeDeviceId:v})):Object(a.c)(W,{label:"Enable",onClick:k})):null,i?Object(a.c)(_,{label:"DISPLAY"},"display"===s?Object(a.c)(r.Fragment,null,Object(a.c)(W,{label:"Disable",onClick:C}),Object(a.c)(W,{label:"Use another dispaly",onClick:j})):Object(a.c)(W,{label:"Enable",onClick:j})):null),Object(a.c)("div",{css:se},Object(a.c)("button",{css:ce,onClick:p?x:T,disabled:m||!f},m?"RE-ENTERING THE ROOM":Object(a.c)(r.Fragment,null,Object(a.c)($.b,{name:p?"done":"meeting_room"}),Object(a.c)("span",null,p?"CLOSE SETTINGS":"ENTER THIS ROOM"))))));const ne=Object(a.b)({width:x.a,margin:"32px auto 0",boxSizing:"border-box",backgroundColor:l.c.white},";label:wrapperStyle;"),re=Object(a.b)({position:"relative",width:"100%",height:x.a/4*3,backgroundColor:l.c.black},";label:videoStyle;"),ie={name:"1es7990-controllerStyle",styles:"position:absolute;left:0;right:0;bottom:0;z-index:1;;label:controllerStyle;"},ae=Object(a.b)({position:"absolute",right:0,bottom:24,zIndex:1,padding:4,color:l.c.white,willChange:"opacity",animation:`${l.a.blink} 1s linear infinite`,fontSize:".8rem"},";label:noteStyle;"),oe={name:"1g9pnwq-settingsStyle",styles:"margin:16px;;label:settingsStyle;"},se={name:"16ed3g4-buttonWrapStyle",styles:"padding:16px;text-align:center;;label:buttonWrapStyle;"},ce=Object(a.b)({display:"inline-flex",alignItems:"center",backgroundColor:l.c.blue,color:l.c.white,height:40,border:0,cursor:"pointer",padding:"0 24px",fontSize:"1.2rem",borderRadius:2,"&:disabled":{cursor:"not-allowed",backgroundColor:l.c.gray}},";label:doneButtonStyle;"),le=s()("effect:room"),de=e=>{le("joinRoom()");const{room:t,ui:n,media:r,client:i,notification:a}=e;if(null===t.name||null===t.mode)throw n.showError(new Error("Room name or mode is undefined!"));if(null===t.peer)throw n.showError(new Error("Peer is not created!"));const o={mode:t.mode,stream:r.stream,videoReceiveEnabled:!0};t.useH264&&Object.assign(o,{videoCodec:"H264"}),"mesh"===t.mode?t.room=t.peer.joinRoom(t.name,o):"sfu"===t.mode&&(t.room=t.peer.joinRoom(t.name,o));const s=t.room;if(null===s)throw n.showError(new Error("Room is null!"));le("joined room",s),le("w/ options:",o),n.isReEntering=!1;const c=[Object(b.o)(()=>({...r.stat,...i.stat}),e=>{le("reaction:send(stat)"),s.send({type:"stat",payload:e})}),Object(b.o)(()=>t.myLastChat,e=>{null!==e&&(le("reaction:send(chat)"),s.send({type:"chat",payload:e}))}),Object(b.o)(()=>t.myLastReaction,e=>{null!==e&&(le("reaction:send(reaction)"),s.send({type:"reaction",payload:e}))}),Object(b.o)(()=>t.castRequestCount,()=>{le("reaction:send(cast)"),s.send({type:"cast",payload:{from:i.displayName}})}),Object(b.n)(r,"videoDeviceId",e=>{if(le("observe(media.videoDeviceId)"),t.isJoined){if(null!==e.oldValue&&null!==e.newValue)return le("just change video by replaceStream(), no need to re-enter"),void s.replaceStream(r.stream);if(le("need to re-enter the room to add/remove video"),null===t.room)throw n.showError(new Error("Room is null!"));n.isReEntering=!0,t.room.close(),a.showInfo("Re-enter the room to add/remove video")}else le("do nothing before room join")})];s.on("stream",e=>{le("on('stream')",e),t.streams.set(e.peerId,e),s.send({type:"stat",payload:{...i.stat,...r.stat}})}),s.on("peerLeave",e=>{le("on('peerLeave')",e);const n=t.stats.get(e);n&&a.showLeave(n.displayName),t.removeStream(e)}),s.on("data",({src:e,data:r})=>{const{type:i,payload:o}=r;switch(i){case"stat":{const n=o;le("on('data/stat')",n),t.stats.get(e)||a.showJoin(n.displayName),t.stats.set(e,n);break}case"chat":{const e=o;le("on('data/chat')",e),n.isChatOpen||a.showChat(e.from,e.text),t.addRemoteChat(e);break}case"reaction":{const e=o;a.showReaction(e.from,e.reaction);break}case"cast":{const n=o;le("on('data/cast')",n),t.pinnedId=e,a.showInfo(`Video was casted by ${n.from}`);break}default:le("on('data/unknown') discard...")}}),s.once("close",()=>{le("on('close')"),a.showInfo("room closed! trying re-connect.."),c.forEach(e=>e());try{s.removeAllListeners(),t.cleanUp()}catch(e){throw n.showError(e)}setTimeout(()=>de(e),500)})},ue=s()("effect:settings"),be=e=>async()=>{ue("enableDisplayVideo()");const{media:t,ui:n,notification:r}=e,i=await(async()=>navigator.mediaDevices.getDisplayMedia({video:!0}).then(e=>e.getVideoTracks()[0]))().catch(e=>{if("NotAllowedError"!==e.name)throw n.showError(e)});if(!(i instanceof MediaStreamTrack))return r.showInfo("Display selection was cancelled"),r.showInfo("Or your device does not support display sharing"),void ue("selection was cancelled or not supported");i.addEventListener("ended",he(e),{once:!0}),t.releaseVideoDevice(),t.setVideoTrack(i,"display",i.label)},he=({media:e})=>()=>{ue("disableDisplayVideo()"),e.deleteVideoTrack()};var me=()=>{const e=Object(r.useContext)(u.a),t=Object(r.useCallback)((({client:e})=>t=>{ue("changeDispName()",`${e.displayName} => ${t}`),e.displayName=t})(e),[e]),n=Object(r.useCallback)((({media:e,ui:t})=>async()=>{ue("enableUserVideo()");const{videoInDevices:n}=await m({video:!0}).catch(e=>{throw t.showError(e)});if(null===n)throw t.showError(new Error("getUserDevices() returns null"));if(0===n.length)throw t.showError(new Error("At leaset one video input device needed!"));const[{deviceId:r}]=n,i=await f(r).catch(e=>{throw t.showError(e)});e.releaseVideoDevice(),e.setVideoTrack(i,"camera",r);const a=await m({video:!0}).catch(e=>{throw t.showError(e)});e.setVideoDevices(a),ue("video devices",a.videoInDevices)})(e),[e]),i=Object(r.useCallback)((({media:e})=>()=>{ue("disableUserVideo()"),e.deleteVideoTrack()})(e),[e]),o=Object(r.useCallback)(be(e),[e]),s=Object(r.useCallback)(he(e),[e]),c=Object(r.useCallback)((({media:e,ui:t})=>async n=>{ue("changeVideoDeviceId",n),e.releaseVideoDevice();const r=await f(n).catch(e=>{throw t.showError(e)});e.setVideoTrack(r,"camera",n)})(e),[e]),l=Object(r.useCallback)((({media:e,ui:t})=>async n=>{ue("changeAudioDeviceId",n),e.releaseAudioDevice();const r=await p(n).catch(e=>{throw t.showError(e)});e.setAudioTrack(r,n)})(e),[e]),b=Object(r.useCallback)((e=>()=>{ue("joinConference()");const{ui:t,room:n}=e;if(n.isJoined)throw t.showError(new Error("Already in the room!"));de(e),t.isSettingsOpen=!1})(e),[e]),h=Object(r.useCallback)((({ui:e})=>()=>{ue("closeSettings()"),e.isSettingsOpen=!1})(e),[e]),v=Object(r.useCallback)((({media:e})=>()=>{ue("toggleAudioMuted()"),e.toggleMuted("audio")})(e),[e]),g=Object(r.useCallback)((({media:e})=>()=>{ue("toggleVideoMuted()"),e.toggleMuted("video")})(e),[e]),{ui:y,media:w,room:k,client:O}=e;return Object(a.c)(d.a,null,()=>y.isSettingsOpen?Object(a.c)(te,{stream:w.stream,defaultDispName:O.displayName,browser:O.browser,hasGetDisplayMedia:O.hasGetDisplayMedia,hasUserVideoDevice:O.hasUserVideoDevice,onChangeDispName:t,videoType:w.videoType,onClickEnableUserVideo:n,onClickDisableUserVideo:i,onClickEnableDisplayVideo:o,onClickDisableDisplayVideo:s,videoDeviceId:w.videoDeviceId||"",audioDeviceId:w.audioDeviceId||"",videoInDevices:w.videoInDevices.slice(),audioInDevices:w.audioInDevices.slice(),onChangeVideoDeviceId:c,onChangeAudioDeviceId:l,isVideoTrackMuted:w.isVideoTrackMuted,isAudioTrackMuted:w.isAudioTrackMuted,onClickToggleVideoMuted:g,onClickToggleAudioMuted:v,isReEntering:y.isReEntering,isJoined:k.isJoined,isDisplayNameValid:O.isDisplayNameValid,onClickCloseSettings:h,onClickJoinConference:b}):Object(a.c)(r.Fragment,null))};const pe=Object(a.b)({position:"absolute",top:8,left:8,zIndex:x.d.notification},";label:wrapperStyle;");var fe=({children:e})=>Object(a.c)("div",{css:pe},e);var ve=({type:e,text:t})=>Object(a.c)("div",{css:ge},Object(a.c)($.b,{name:e}),Object(a.c)("span",{css:ye},t));const ge=Object(a.b)({display:"flex",alignItems:"center",padding:"4px 8px",marginBottom:4,fontSize:".8rem",borderRadius:2,backgroundColor:l.c.white,willChange:"transform",animation:`${a.d`from { transform: translateX(-200%); }`} .2s ease`},";label:wrapperStyle;"),ye={name:"1h4ubut-textStyle",styles:"text-indent:4px;width:200px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;;label:textStyle;"};function we(){return(we=Object.assign||function(e){for(var t=1;t{const e=Object(r.useContext)(u.a),{notification:t}=e;return Object(a.c)(d.a,null,()=>Object(a.c)(fe,null,t.items.slice().map(e=>Object(a.c)(ve,we({key:e.id},e)))))},Oe=n(26);var je=({chat:e})=>Object(a.c)("div",{css:e.isMine?[Ce,Se]:Ce},Object(a.c)("div",{css:xe},e.from," at ",new Date(e.time).toLocaleTimeString()),e.text);const Ce=Object(a.b)({boxSizing:"border-box",width:"85%",padding:"4px 8px",marginTop:8,marginBottom:8,wordBreak:"break-word",borderRadius:2,border:`1px solid ${l.c.gray}`},";label:wrapperStyle;"),Se=Object(a.b)({marginLeft:"15%",backgroundColor:l.c.gray},";label:mineStyle;"),xe={name:"lr7gfj-headStyle",styles:"font-size:.8rem;;label:headStyle;"};var Te=({chats:e,onClickCloser:t,onClickSend:n})=>{const[i,o]=Object(r.useState)(""),s=Object(r.useCallback)(()=>{n(i),o("")},[i,n]),c=Object(r.useRef)(null);return Object(r.useEffect)(()=>{if(null===c.current)return;const e=c.current;e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[e,c]),Object(a.c)(I,null,Object(a.c)("div",{css:Ie},Object(a.c)("div",{css:De},Object(a.c)($.c,{name:"close",onClick:t})),Object(a.c)("div",{css:Ae,ref:c},e.map(e=>Object(a.c)(je,{key:e.id,chat:e}))),Object(a.c)("div",{css:Ee},Object(a.c)("input",{type:"text",value:i,onChange:e=>o(e.target.value),css:Me}),Object(a.c)($.c,{name:"send",disabled:0===i.length,onClick:s}))))};const Ie=Object(a.b)({display:"grid",gridTemplateRows:"20px 1fr 20px",width:x.a,height:"80%",boxSizing:"border-box",margin:"32px auto 0",padding:8,backgroundColor:l.c.white},";label:wrapperStyle;"),De={name:"11prr2o-headStyle",styles:"text-align:right;;label:headStyle;"},Ae={name:"rxpk0m-scrollerStyle",styles:"overflow-y:scroll;overflow-scrolling:touch;;label:scrollerStyle;"},Ee={name:"d4s163-editorStyle",styles:"display:flex;align-items:center;;label:editorStyle;"},Me={name:"19w3c9f-inputStyle",styles:"flex:1 1 auto;margin-right:8px;;label:inputStyle;"},Re=s()("effect:chat"),$e=()=>{const e=Object(r.useContext)(u.a),t=Object(r.useCallback)((({ui:e})=>()=>{Re("openChat()"),e.isChatOpen=!0})(e),[e]);return Object(a.c)(d.a,null,()=>Object(a.c)($.c,{name:"chat",onClick:t}))},Ve=()=>{const e=Object(r.useContext)(u.a),t=Object(r.useCallback)((({ui:e})=>()=>{Re("closeChat()"),e.isChatOpen=!1})(e),[e]),n=Object(r.useCallback)((({room:e,client:t})=>n=>{Re("sendChat()",n),e.addLocalChat(t.displayName,n)})(e),[e]),{ui:i,room:o}=e;return Object(a.c)(d.a,null,()=>i.isChatOpen?Object(a.c)(Te,{chats:[...o.chats],onClickCloser:t,onClickSend:n}):Object(a.c)(r.Fragment,null))};var _e=({rtcStats:e})=>{const t=null===e?null:Ne(e);return Object(a.c)("div",{css:Le},Object(a.c)("pre",{css:ze},null===t?"Loading...":t))};const Ne=e=>{const t=(e=>[...e.values()].filter(e=>"candidate-pair"===e.type).filter(e=>"selected"in e?e.selected&&e.nominated:e.nominated).map(({localCandidateId:t,remoteCandidateId:n})=>{const r=e.get(t),i=e.get(n);return r||console.warn("localCandidate not found!"),i||console.warn("remoteCandidate not found!"),{localCandidate:r?{address:r.address||r.ip,port:r.port,protocol:r.protocol,type:r.candidateType}:{},remoteCandidate:i?{address:i.address||i.ip,port:i.port,protocol:i.protocol,type:i.candidateType}:{}}}))(e),{audioOutbounds:n,videoOutbounds:r}=(e=>{const t=[...e.values()].filter(e=>"outbound-rtp"===e.type);t.length>2&&console.warn("outbound-rtp reports are found more than 2!");const n={video:{bytesSent:0,packetsSent:0},audio:{bytesSent:0,packetsSent:0}};for(const e of t){const t=e.kind||e.mediaType;"audio"===t||"video"===t?(n[t].bytesSent+=e.bytesSent,n[t].packetsSent+=e.packetsSent):console.warn(`unknown outbound rtp kind: ${t} found!`)}return{audioOutbounds:n.audio,videoOutbounds:n.video}})(e),{audioInbounds:i,videoInbounds:a}=(e=>{const t=[...e.values()].filter(e=>"inbound-rtp"===e.type),n={size:0,bytesReceived:0,packetsReceived:0,packetsLost:0,nackCount:0,firCount:0,pliCount:0,items:[]},r={size:0,bytesReceived:0,packetsReceived:0,packetsLost:0,items:[]};for(const e of t){const t={bytesReceived:e.bytesReceived,packetsReceived:e.packetsReceived,packetsLost:e.packetsLost,ssrc:e.ssrc},i=e.kind||e.mediaType;"audio"===i||"video"===i?("video"===i&&(t.nackCount=e.nackCount||0,t.firCount=e.firCount||0,t.pliCount=e.pliCount||0,n.items.push(t)),"audio"===i&&r.items.push(t)):console.warn(`unknown outbound rtp kind: ${i} found!`)}for(const e of n.items)n.size+=1,n.bytesReceived+=e.bytesReceived,n.packetsReceived+=e.packetsReceived,n.packetsLost+=e.packetsLost,n.nackCount+=e.nackCount,n.firCount+=e.firCount,n.pliCount+=e.pliCount;for(const e of r.items)r.size+=1,r.bytesReceived+=e.bytesReceived,r.packetsReceived+=e.packetsReceived,r.packetsLost+=e.packetsLost;return{videoInbounds:n,audioInbounds:r}})(e);return`\n# Active ICE candidate pairs\n${t.map(({localCandidate:e,remoteCandidate:t},n)=>`\n## Pair ${n+1}\n- local: ${e.type} ${e.protocol}://${e.address}:${e.port}\n- remote: ${t.type} ${t.protocol}://${t.address}:${t.port}\n`.trim()).join("\n").trim()}\n\n# Outbounds(sent)\n- Audio: ${n.bytesSent} bytes(${n.packetsSent} packets)\n- Video: ${r.bytesSent} bytes(${r.packetsSent} packets)\n\n# Inbounds(received)\n## Total\n- ${i.size} audio(s)\n - ${i.bytesReceived} bytes(${i.packetsReceived} packets)\n - PacketsLost: ${i.packetsLost}\n- ${a.size} video(s)\n - ${a.bytesReceived} bytes(${a.packetsReceived} packets)\n - PacketsLost: ${a.packetsLost} / NACK: ${a.nackCount} / FIR: ${a.firCount} / PLI: ${a.pliCount}\n\n## Details\n${i.items.map((e,t)=>`\n- Audio ${t+1}: ${e.ssrc}\n - ${e.bytesReceived} bytes(${e.packetsReceived} packets)\n - PacketsLost: ${e.packetsLost}\n`.trim()).join("\n").trim()}\n${a.items.map((e,t)=>`\n- Video ${t+1}: ${e.ssrc}\n - ${e.bytesReceived} bytes(${e.packetsReceived} packets)\n - PacketsLost: ${e.packetsLost} / NACK: ${e.nackCount} / FIR: ${e.firCount} / PLI: ${e.pliCount}\n`.trim()).join("\n").trim()}\n `.trim()},Le={name:"1wf9sje-wrapperStyle",styles:"margin:0;padding:4px;font-size:.8rem;;label:wrapperStyle;"},ze={name:"1tmtdrc-statsStyle",styles:"margin:0;white-space:pre-wrap;word-break:break-all;;label:statsStyle;"};var Pe=({rtcStats:e})=>{const[t,n]=Object(r.useState)(""),i=null===e?null:Fe(e,t.trim());return Object(a.c)(r.Fragment,null,Object(a.c)("input",{type:"text",placeholder:"filter stat reports",value:t,onChange:e=>n(e.target.value),css:Ue}),Object(a.c)("pre",{css:qe},null===i?"Loading...":`${i.size} report(s) found.\n${JSON.stringify(i.reports,null,2)}`))};const Fe=(e,t)=>{if(0===e.size)return null;let n=0;const r={};for(const[i,a]of e){JSON.stringify(a).includes(t)&&(r[i]=a,n++)}return{reports:r,size:n}},Ue={name:"1yn50m4-inputStyle",styles:"box-sizing:border-box;width:100%;;label:inputStyle;"},qe={name:"1r75v0t-statsStyle",styles:"margin:0;padding:4px;font-size:.8rem;white-space:pre-wrap;word-break:break-all;;label:statsStyle;"};var Je=({isSfu:e,rtcStats:t,onClickCloser:n})=>Object(a.c)(I,null,Object(a.c)("div",{css:Ge},Object(a.c)("div",{css:We},Object(a.c)($.c,{name:"close",onClick:n})),e?Object(a.c)("div",{css:Be},Object(a.c)("details",{open:!0},Object(a.c)("summary",null,"Stats summary"),Object(a.c)(_e,{rtcStats:t})),Object(a.c)("details",null,Object(a.c)("summary",null,"Stats dump"),Object(a.c)(Pe,{rtcStats:t}))):Object(a.c)("div",{css:He},"Stats view is not available in mesh room type.")));const Ge=Object(a.b)({display:"grid",gridTemplateRows:"20px 1fr",width:x.a,height:"80%",boxSizing:"border-box",margin:"32px auto 0",padding:8,backgroundColor:l.c.white},";label:wrapperStyle;"),We={name:"11prr2o-headStyle",styles:"text-align:right;;label:headStyle;"},Be={name:"12hbg2b-scrollerStyle",styles:"box-sizing:border-box;overflow:hidden;overflow-y:scroll;overflow-scrolling:touch;;label:scrollerStyle;"},He={name:"l1ytd1-naStyle",styles:"text-align:center;;label:naStyle;"},Xe=s()("effect:stats"),Ye=()=>{const e=Object(r.useContext)(u.a),t=Object(r.useCallback)((({ui:e,room:t})=>()=>{Xe("openStats()"),e.isStatsOpen=!0;const n=setInterval(async()=>{const e=t.getPeerConnection();null!==e&&e.getStats().then(e=>t.rtcStats=e).catch(e=>Xe("getStats() error",e))},1e3);Object(b.u)(()=>!e.isStatsOpen,()=>{Xe("stop stats collector"),clearInterval(n),t.rtcStats=null})})(e),[e]);return Object(a.c)(d.a,null,()=>Object(a.c)($.c,{name:"assessment",onClick:t}))},Ke=()=>{const e=Object(r.useContext)(u.a),t=Object(r.useCallback)((({ui:e})=>()=>{Xe("closeStats()"),e.isStatsOpen=!1})(e),[e]),{ui:n,room:i}=e;return Object(a.c)(d.a,null,()=>n.isStatsOpen?Object(a.c)(Je,{isSfu:"sfu"===i.mode,rtcStats:i.rtcStats,onClickCloser:t}):Object(a.c)(r.Fragment,null))};var Ze=()=>{const e=Object(r.useContext)(u.a),{room:t}=e;return Object(a.c)(d.a,null,()=>null===t.pinnedStream?Object(a.c)(r.Fragment,null):Object(a.c)(A,{stream:t.pinnedStream,isVideoOnly:!0}))};var Qe=Object(r.memo)(({stream:e,browser:t})=>{const[n,i]=Object(r.useState)({});return Object(r.useEffect)(()=>{let n=0;const r=()=>{n=requestAnimationFrame(r);const[a]=e.getVideoTracks(),[o]=e.getAudioTracks(),s=a?a.getSettings():{};i({timestamp:Date.now(),browserName:t.name,browserVersion:`v${t.version}`,streamId:e.id,video:a?{trackId:a.id,width:s.width,height:s.height,frameRate:s.frameRate}:{},audio:o?{trackId:o.id}:{}})};return n=requestAnimationFrame(r),()=>cancelAnimationFrame(n)},[e,t,i]),Object(a.c)("pre",{css:et},JSON.stringify(n,null,2))});const et=Object(a.b)({margin:0,padding:4,width:"100%",height:"100%",boxSizing:"border-box",overflow:"auto",overflowScrolling:"touch",fontSize:".8rem",backgroundColor:l.c.black,color:l.c.white},";label:wrapperStyle;");var tt=({stream:e,displayName:t,browser:n,videoType:i,isVideoTrackMuted:o,isAudioTrackMuted:s,onClickToggleAudioMuted:c,onClickToggleVideoMuted:l,onClickCastVideo:d,onClickOpenSettings:u})=>{const[b,h]=Object(r.useState)(!1),[m,p]=Object(r.useState)(!1);return Object(a.c)("div",{css:b?[nt,rt]:nt},Object(a.c)("div",{css:it},Object(a.c)(A,{stream:e,isReverse:"camera"===i,isVideoOnly:!0}),Object(a.c)("div",{css:st},null===i?null:Object(a.c)($.c,{name:"cast",showEdge:!0,title:"Cast your video",onClick:d}),Object(a.c)($.c,{name:"info",showEdge:!0,title:"Toggle stream info",onClick:()=>p(!m)}),Object(a.c)($.c,{name:"settings",showEdge:!0,title:"Open settings",onClick:u}),b?Object(a.c)($.c,{name:"keyboard_arrow_right",showEdge:!0,title:"Maximize",onClick:()=>h(!1)}):Object(a.c)($.c,{name:"keyboard_arrow_left",showEdge:!0,title:"Minimize",onClick:()=>h(!0)})),m?Object(a.c)("div",{css:at},Object(a.c)(Qe,{stream:e,browser:n})):null,Object(a.c)("div",{css:ot},Object(a.c)(Z,{stream:e}),Object(a.c)(H,{displayName:t,browser:n,controllers:Object(a.c)(r.Fragment,null,null===i?null:Object(a.c)($.c,{name:o?"videocam_off":"videocam",title:o?"Unmute video":"Mute video",onClick:l}),Object(a.c)($.c,{name:s?"mic_off":"mic",title:s?"Unmute audio":"Mute audio",onClick:c}))}))))};const nt=Object(a.b)({outline:`1px solid ${l.c.gray}`,transition:"all .2s ease",willChange:"transform"},";label:wrapperStyle;"),rt={name:"u4pngj-minimizeStyle",styles:"transform:translateX(-85%);;label:minimizeStyle;"},it=Object(a.b)({position:"relative",width:240,height:180,backgroundColor:l.c.black},";label:videoStyle;"),at={name:"2ietqi-infoStyle",styles:"position:absolute;left:0;right:0;top:0;bottom:0;z-index:10;;label:infoStyle;"},ot={name:"1es7990-controllerStyle",styles:"position:absolute;left:0;right:0;bottom:0;z-index:1;;label:controllerStyle;"},st=Object(a.b)({position:"absolute",top:4,right:4,zIndex:100,display:"flex",alignItems:"center",color:l.c.white},";label:actionStyle;"),ct=s()("effect:local-stream");var lt=()=>{const e=Object(r.useContext)(u.a),t=Object(r.useCallback)((({room:e})=>()=>{ct("castVideo()"),e.castRequestCount=e.castRequestCount+1})(e),[e]),n=Object(r.useCallback)((({ui:e})=>()=>{ct("openSettings()"),e.isSettingsOpen=!0})(e),[e]),i=Object(r.useCallback)((({media:e})=>()=>{ct("toggleAudioMuted()"),e.toggleMuted("audio")})(e),[e]),o=Object(r.useCallback)((({media:e})=>()=>{ct("toggleVideoMuted()"),e.toggleMuted("video")})(e),[e]),{media:s,client:c,ui:l}=e;return Object(a.c)(d.a,null,()=>l.isSettingsOpen?Object(a.c)(r.Fragment,null):Object(a.c)(tt,{stream:s.stream,displayName:c.displayName,browser:c.browser,videoType:s.videoType,isVideoTrackMuted:s.isVideoTrackMuted,isAudioTrackMuted:s.isAudioTrackMuted,onClickToggleAudioMuted:i,onClickToggleVideoMuted:o,onClickCastVideo:t,onClickOpenSettings:n}))};const dt=s()("effect:remote-streams");var ut=({stream:e,stat:t,isPinned:n,onClickSetPinned:i})=>{const o=!(!t||!t.isVideoDisabled),[s,c]=Object(r.useState)(!1);return Object(a.c)(r.Fragment,null,Object(a.c)("div",{css:bt},Object(a.c)(A,{stream:e}),Object(a.c)("div",{css:pt},o?null:Object(a.c)($.c,{name:n?"cancel_presentation":"present_to_all",showEdge:!0,title:"Pin this video",onClick:i}),Object(a.c)($.c,{name:"info",showEdge:!0,title:"Toggle stream info",onClick:()=>c(!s)})),s&&null!==t?Object(a.c)("div",{css:ht},Object(a.c)(Qe,{stream:e,browser:t.browser})):null,Object(a.c)("div",{css:mt},null!==t?Object(a.c)(r.Fragment,null,Object(a.c)(Z,{stream:e}),Object(a.c)(H,{displayName:t.displayName,browser:t.browser,controllers:Object(a.c)(r.Fragment,null,t.isVideoDisabled?null:Object(a.c)($.b,{name:t.isVideoMuted?"videocam_off":"videocam"}),Object(a.c)($.b,{name:t.isAudioMuted?"mic_off":"mic"}))})):null)))};const bt=Object(a.b)({position:"relative",height:x.c/4*3,backgroundColor:l.c.black},";label:videoStyle;"),ht={name:"2ietqi-infoStyle",styles:"position:absolute;left:0;right:0;top:0;bottom:0;z-index:10;;label:infoStyle;"},mt={name:"1es7990-controllerStyle",styles:"position:absolute;left:0;right:0;bottom:0;z-index:1;;label:controllerStyle;"},pt=Object(a.b)({position:"absolute",top:4,right:4,zIndex:100,display:"flex",alignItems:"center",color:l.c.white},";label:actionStyle;");const ft=([,e],[,t])=>e.getVideoTracks().length>t.getVideoTracks().length?-1:1;var vt=({streams:e,stats:t,pinnedId:n,onClickSetPinned:r})=>Object(a.c)("div",{css:gt},Object(a.c)("div",{css:yt},Object(a.c)("span",{css:wt},e.length)," participant(s)"),e.sort(ft).map(([e,i])=>{const o=t.find(([t])=>t===e),s=o?o[1]:null,c=e===n;return Object(a.c)(ut,{key:e,stream:i,stat:s,isPinned:c,onClickSetPinned:()=>r(e)})}));const gt=Object(a.b)({width:x.c},";label:wrapperStyle;"),yt=Object(a.b)({height:x.b,padding:4,boxSizing:"border-box",fontSize:".8rem",textAlign:"center"},";label:headStyle;"),wt={name:"17kikuq-numberStyle",styles:"font-size:.9rem;font-weight:bold;;label:numberStyle;"};var kt=()=>{const e=Object(r.useContext)(u.a),t=Object(r.useCallback)((({room:e})=>t=>{const n=e.pinnedId===t?null:t;dt("setPinned()",n),e.pinnedId=n})(e),[e]),{room:n}=e;return Object(a.c)(d.a,null,()=>Object(a.c)(vt,{streams:[...n.streams.entries()],stats:[...n.stats.entries()],pinnedId:n.pinnedId||"",onClickSetPinned:t}))};var Ot=({children:e})=>Object(a.c)("div",{css:jt},e);const jt={name:"11v4elu-wrapperStyle",styles:"height:100vh;position:relative;;label:wrapperStyle;"};var Ct=({children:e})=>Object(a.c)("div",{css:St},e);const St={name:"1kg00pe-wrapperStyle",styles:"position:relative;width:100%;height:100%;background-image:url(./images/logo.svg);background-repeat:no-repeat;background-position:center center;;label:wrapperStyle;"};var xt=({children:e})=>Object(a.c)("div",{css:Tt},Object(a.c)("div",{css:It},e));const Tt=Object(a.b)({position:"absolute",top:0,left:0,bottom:0,zIndex:x.d.base},";label:wrapperStyle;"),It={name:"1uct5qs-bottomStyle",styles:"position:absolute;left:8px;bottom:8px;;label:bottomStyle;"};var Dt=({children:e,openers:t})=>{const[n,i]=Object(r.useState)(!0);return Object(a.c)("div",{css:Mt,className:n?At:""},Object(a.c)("div",{css:Rt},e),Object(a.c)("div",{css:Object(V.a)([$t,Vt],";label:RightMenu;")},Object(a.c)($.c,{name:n?"chevron_right":"chevron_left",onClick:()=>i(!n)})),t.map((e,t)=>Object(a.c)("div",{key:t,css:Object(V.a)([$t,Object(a.b)({top:x.b*(t+1)},";label:RightMenu;")],";label:RightMenu;")},e)))};const At="-visible",Et=x.c,Mt=Object(a.b)({position:"absolute",top:0,right:0,bottom:0,zIndex:x.d.base,width:Et,backgroundColor:l.c.gray,height:"100%",transition:".25s ease transform",transform:`translateX(${Et}px)`,willChange:"transform",[`&.${At}`]:{transform:"translateX(0)"}},";label:wrapperStyle;"),Rt={name:"7jmvd7-scrollerStyle",styles:"height:100%;overflow-y:scroll;overflow-scrolling:touch;;label:scrollerStyle;"},$t=Object(a.b)({boxSizing:"border-box",position:"absolute",left:-x.b,width:x.b,height:x.b,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"inherit",cursor:"pointer",borderBottom:`1px solid ${l.c.white}`},";label:knobStyle;"),Vt=Object(a.b)({top:0*x.b},";label:togglerStyle;");class _t extends r.Component{constructor(e,t){super(e,t),this.state={err:null}}render(){return null!==this.state.err?Object(a.c)(Ot,null,Object(a.c)(y,{error:this.state.err})):Object(a.c)(Ot,null,Object(a.c)(S,null,Object(a.c)(Ct,null,Object(a.c)(Ze,null)),Object(a.c)(xt,null,Object(a.c)(lt,null)),Object(a.c)(Dt,{openers:[Object(a.c)($e,{key:"chat"}),Object(a.c)(Oe.a,{key:"reaction"}),Object(a.c)(Ye,{key:"stats"})]},Object(a.c)(kt,null)),Object(a.c)(me,null),Object(a.c)(Ve,null),Object(a.c)(Ke,null),Object(a.c)(ke,null)))}componentDidCatch(e){this.setState({err:e})}}var Nt=_t;const Lt=s()("main");(async()=>{Lt(`${c.a} v${c.b}`),document.title+=` v${c.b}`,Object(i.render)(Object(a.c)(r.StrictMode,null,Object(a.c)(a.a,{styles:l.d}),Object(a.c)(Nt,null)),document.getElementById("app-root"))})().catch(e=>console.error(e))}]); \ No newline at end of file + */var i,r,a,o,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,l=null,d=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(e){throw setTimeout(d,0),e}},u=Date.now();t.unstable_now=function(){return Date.now()-u},i=function(e){null!==c?setTimeout(i,0,e):(c=e,setTimeout(d,0))},r=function(e,t){l=setTimeout(e,t)},a=function(){clearTimeout(l)},o=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var b=window.performance,h=window.Date,p=window.setTimeout,f=window.clearTimeout;if("undefined"!=typeof console){var m=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof b&&"function"==typeof b.now)t.unstable_now=function(){return b.now()};else{var v=h.now();t.unstable_now=function(){return h.now()-v}}var g=!1,y=null,w=-1,k=5,O=0;o=function(){return t.unstable_now()>=O},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,r=e[i];if(!(void 0!==r&&0I(o,n))void 0!==c&&0>I(c,o)?(e[i]=c,e[s]=n,i=s):(e[i]=o,e[a]=n,i=a);else{if(!(void 0!==c&&0>I(c,n)))break e;e[i]=c,e[s]=n,i=s}}}return t}return null}function I(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var D=[],A=[],E=1,M=null,R=3,$=!1,V=!1,N=!1;function _(e){for(var t=x(A);null!==t;){if(null===t.callback)T(A);else{if(!(t.startTime<=e))break;T(A),t.sortIndex=t.expirationTime,S(D,t)}t=x(A)}}function L(e){if(N=!1,_(e),!V)if(null!==x(D))V=!0,i(z);else{var t=x(A);null!==t&&r(L,t.startTime-e)}}function z(e,n){V=!1,N&&(N=!1,a()),$=!0;var i=R;try{for(_(n),M=x(D);null!==M&&(!(M.expirationTime>n)||e&&!o());){var s=M.callback;if(null!==s){M.callback=null,R=M.priorityLevel;var c=s(M.expirationTime<=n);n=t.unstable_now(),"function"==typeof c?M.callback=c:M===x(D)&&T(D),_(n)}else T(D);M=x(D)}if(null!==M)var l=!0;else{var d=x(A);null!==d&&r(L,d.startTime-n),l=!1}return l}finally{M=null,R=i,$=!1}}function P(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var F=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){V||$||(V=!0,i(z))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return x(D)},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var n=R;R=t;try{return e()}finally{R=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=R;R=e;try{return t()}finally{R=n}},t.unstable_scheduleCallback=function(e,n,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var c=o.delay;c="number"==typeof c&&0s?(e.sortIndex=c,S(A,e),null===x(D)&&e===x(A)&&(N?a():N=!0,r(L,c-s))):(e.sortIndex=o,S(D,e),V||$||(V=!0,i(z))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();_(e);var n=x(D);return n!==M&&null!==M&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime1)for(var n=1;ni&&(i=(t=t.trim()).charCodeAt(0)),i){case 38:return t.replace(f,"$1"+e.trim());case 58:return e.trim()+t.replace(f,"$1"+e.trim());default:if(0<1*n&&0c.charCodeAt(8))break;case 115:o=o.replace(c,"-webkit-"+c)+";"+o;break;case 207:case 102:o=o.replace(c,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0h)&&(z=(U=U.replace(" ",":")).length),0=1.5*n;return Math.round(e/n)+" "+i+(r?"s":"")}e.exports=function(e,t){t=t||{};var s=typeof e;if("string"===s&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var o=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*a;case"hours":case"hour":case"hrs":case"hr":case"h":return o*r;case"minutes":case"minute":case"mins":case"min":case"m":return o*i;case"seconds":case"second":case"secs":case"sec":case"s":return o*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===s&&!1===isNaN(e))return t.long?function(e){var t=Math.abs(e);if(t>=a)return o(e,t,a,"day");if(t>=r)return o(e,t,r,"hour");if(t>=i)return o(e,t,i,"minute");if(t>=n)return o(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=a)return Math.round(e/a)+"d";if(t>=r)return Math.round(e/r)+"h";if(t>=i)return Math.round(e/i)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},,,,,,,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},,function(e,t){function n(){}e.exports=n,n.mixin=function(e){var t=e.prototype||e;t.isWildEmitter=!0,t.on=function(e,t,n){this.callbacks=this.callbacks||{};var i=3===arguments.length,r=i?arguments[1]:void 0,a=i?arguments[2]:arguments[1];return a._groupName=r,(this.callbacks[e]=this.callbacks[e]||[]).push(a),this},t.once=function(e,t,n){var i=this,r=3===arguments.length,a=r?arguments[1]:void 0,o=r?arguments[2]:arguments[1];function s(){i.off(e,s),o.apply(this,arguments)}return this.on(e,a,s),this},t.releaseGroup=function(e){var t,n,i,r;for(t in this.callbacks=this.callbacks||{},this.callbacks)for(n=0,i=(r=this.callbacks[t]).length;n{const t=await navigator.mediaDevices.enumerateDevices()||[],n=[],i=[];for(const e of t)"videoinput"===e.kind&&n.push(e),"audioinput"===e.kind&&i.push(e);const r={videoInDevices:null,audioInDevices:null};return e.video&&(r.videoInDevices=n),e.audio&&(r.audioInDevices=i),r},f=async e=>{const t=""===e||{deviceId:{exact:e}};return navigator.mediaDevices.getUserMedia({audio:t}).then(e=>e.getAudioTracks()[0])},m=async e=>{const t=""===e||{deviceId:{exact:e}};return navigator.mediaDevices.getUserMedia({video:t}).then(e=>e.getVideoTracks()[0])};var v=n(16);const g=s()("effect:bootstrap");var y=({error:e})=>Object(a.c)("div",{css:w},Object(a.c)("h2",{css:k},e.message||e.name),Object(a.c)("pre",{css:O},e.stack||"Stack trace is not available."));const w=Object(a.b)({color:l.c.white,margin:16},";label:wrapperStyle;"),k={name:"3qj1jp-headStyle",styles:"font-weight:900;;label:headStyle;"},O={name:"2ay849-detailStyle",styles:"white-space:pre-wrap;;label:detailStyle;"};var j=()=>Object(a.c)("img",{css:C,src:"./images/conf/icon-loading.svg"});const C={name:"y4qk87-wrapperStyle",styles:"position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;width:160px;;label:wrapperStyle;"};var S=({children:e})=>{const t=Object(i.useContext)(u.a);Object(i.useEffect)((({ui:e,room:t})=>()=>{g("checkRoomSetting()");const[,n,i]=location.hash.split("/"),r=new URLSearchParams(location.search);if(!Object(h.b)(n))throw e.showError(new Error("Invalid room type! it should be `sfu` or `mesh`."));if(!Object(h.a)(i))throw e.showError(new Error(`Invalid room name! it should be match \`${h.d.toString()}\`.`));(async()=>{const a=await Object(v.b)(r.has("turn")).catch(t=>{throw e.showError(t)});a.on("error",console.error),t.load({mode:n,id:i,useH264:r.has("h264")},a),g(`room: ${n}/${i}`),g("peer instance created")})()})(t),[t]),Object(i.useEffect)((({ui:e,media:t})=>()=>{g("ensureAudioDevice()"),(async()=>{const{audioInDevices:n}=await p({audio:!0}).catch(t=>{throw e.showError(t)});if(null===n)throw e.showError(new Error("getUserDevices() returns null"));if(0===n.length)throw e.showError(new Error("At least one audio input device needed!"));const[{deviceId:i}]=n,r=await f(i).catch(t=>{throw e.showError(t)});t.setAudioTrack(r,i);const a=await p({audio:!0}).catch(t=>{throw e.showError(t)});t.setAudioDevices(a),g("audio devices",a.audioInDevices)})()})(t),[t]),Object(i.useEffect)((({client:e,media:t,room:n,notification:i})=>()=>{g("listenStoreChanges()");const r=[Object(b.i)(()=>n.isJoined,e=>e&&i.showInfo(`You joined the room ${n.name}`)),Object(b.i)(()=>t.isAudioTrackMuted,e=>i.showInfo(`Mic input was ${e?"muted":"unmuted"}`)),Object(b.i)(()=>t.isVideoTrackMuted,e=>i.showInfo(`Video was ${e?"muted":"unmuted"}`)),Object(b.h)(t,"audioDeviceId",e=>{null!==e.oldValue&&i.showInfo("Mic input was changed")}),Object(b.h)(t,"videoDeviceId",e=>{null!==e.oldValue?null!==e.newValue?i.showInfo("Video input was changed"):i.showInfo("Video input was disabled"):i.showInfo("Video input was enabled")}),Object(b.i)(()=>n.castRequestCount,()=>i.showInfo("Your video was casted to everyone")),Object(b.i)(()=>n.myLastReaction,e=>e&&i.showInfo(`You reacted with ${e.reaction}`)),Object(b.i)(()=>e.displayName,e=>{localStorage.setItem("SkyWayConf.dispName",e.trim()),i.showInfo("Display name saved")},{delay:2e3})];return()=>r.forEach(e=>e())})(t),[t]),Object(i.useEffect)((({media:e,ui:t})=>()=>{g("listenGlobalEvents()");const n=()=>location.reload(!0),i=async()=>{g("devicechange event fired");const{audioInDevices:n,videoInDevices:i}=await p({video:!0,audio:!0}).catch(e=>{throw t.showError(e)});if(null===n||null===i)throw t.showError(new Error("getUserDevices() returns null"));const r=e.audioInDevices,a=e.videoInDevices;r.length&&n.length!==r.length&&location.reload(!0),a.length&&i.length!==a.length&&location.reload(!0)};return window.addEventListener("hashchange",n,!1),navigator.mediaDevices.addEventListener("devicechange",i,!1),()=>{g("listener removed"),window.removeEventListener("hashchange",n),navigator.mediaDevices.removeEventListener("devicechange",i)}})(t),[t]),Object(i.useEffect)((({client:e,ui:t})=>()=>{g("loadClient()"),(async()=>{const{videoInDevices:n}=await p({video:!0}).catch(e=>{throw t.showError(e)});if(null===n)throw t.showError(new Error("getUserDevices() returns null"));e.load({ua:navigator.userAgent,hasUserVideoDevice:0!==n.length,hasGetDisplayMedia:"function"==typeof navigator.mediaDevices.getDisplayMedia,name:(localStorage.getItem("SkyWayConf.dispName")||"").trim()}),g("client loaded",Object(b.l)(e))})()})(t),[t]);const{ui:n,client:r,media:o}=t;return Object(a.c)(d.a,null,()=>null!==n.error?Object(a.c)(y,{error:n.error}):r.isReady&&o.isAudioEnabled?Object(a.c)(i.Fragment,null,e):Object(a.c)(j,null))},x=n(5);const T=Object(a.b)({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:x.d.modal,overflow:"auto",backgroundColor:"rgba(0, 0, 0, .8)",willChange:"opacity",animation:`${a.d`from { opacity: 0; } to { opacity: 1; }`} .4s ease`},";label:wrapperStyle;");var I=({children:e})=>Object(a.c)("div",{css:T},e);const D=s()("component:video");var A=Object(i.memo)(({stream:e,isReverse:t=!1,isVideoOnly:n=!1})=>{const r=0===e.getAudioTracks().length,o=0===e.getVideoTracks().length,s=Object(i.useRef)(null),c=Object(i.useRef)(null),l=D.extend(e.id);return Object(i.useEffect)(()=>{const t=s.current;o||null===t||(l("useEffect(): assign and play stream for video"),t.srcObject!==e&&(t.srcObject=e),t.paused&&t.play())},[o,s,l,e]),Object(i.useEffect)(()=>{const t=c.current;r||n||null===t||(l("useEffect(): assign and play stream for audio"),t.srcObject!==e&&(t.srcObject=e),t.paused&&t.play())},[r,n,c,l,e]),l("render()",[...e.getTracks()]),Object(a.c)(i.Fragment,null,o?null:Object(a.c)("video",{css:t?[M,R]:M,ref:s,playsInline:!0,muted:!0}),n||r?null:Object(a.c)("audio",{css:E,ref:c}))});const E={name:"irc9p9-audioStyle",styles:"display:none;;label:audioStyle;"},M={name:"11u56sq-videoStyle",styles:"width:100%;height:100%;max-width:100%;max-height:100%;pointer-events:none;;label:videoStyle;"},R={name:"wfqmvp-reverseVideoStyle",styles:"transform:scaleX(-1);;label:reverseVideoStyle;"};var $=n(4),V=n(8);const N=({label:e,children:t})=>Object(a.c)("div",{css:Object(V.a)([L,z],";label:SettingsItemDevice;")},Object(a.c)("div",{css:F},e),t),_=({label:e,children:t})=>Object(a.c)("div",{css:Object(V.a)([L,P],";label:SettingsItemName;")},Object(a.c)("div",{css:F},e),Object(a.c)("div",null,t)),L={name:"b74hfd-wrapperStyle",styles:"margin:8px auto;;label:wrapperStyle;"},z={name:"1thp49p-deviceStyle",styles:"display:grid;grid-template-columns:80px 72px 1fr;grid-gap:8px;align-items:center;;label:deviceStyle;"},P={name:"a15aci-nameStyle",styles:"display:grid;grid-template-columns:80px 1fr;grid-gap:8px;align-items:center;;label:nameStyle;"},F={name:"rb14u8-labelStyle",styles:"text-align:center;;label:labelStyle;"};var U=({defaultDispName:e,isInvalid:t,onChangeDispName:n})=>{const[r,o]=Object(i.useState)(e);return Object(a.c)("div",null,Object(a.c)("input",{type:"text",value:r,maxLength:10,placeholder:"Enter your name",onChange:e=>{if(e.target.value.length>10)return;const t=e.target.value;o(t),n(t)},css:t?[q,J]:q}))};const q=Object(a.b)({boxSizing:"border-box",width:"100%",padding:"4px 8px",appearance:"none",border:0,borderBottom:`1px solid ${l.c.gray}`,fontSize:"1.1rem","&:focus":{borderColor:l.c.blue}},";label:nameStyle;"),J=Object(a.b)({borderColor:l.c.red},";label:invalidStyle;");const G=({deviceId:e,inDevices:t,onChangeDeviceId:n})=>Object(a.c)("select",{value:e||"",onChange:e=>n(e.target.value),css:B},t.map(e=>Object(a.c)("option",{key:e.deviceId,value:e.deviceId},e.label))),W=({label:e,disabled:t,onClick:n})=>Object(a.c)("button",{css:B,disabled:!!t,onClick:n},e),B={name:"14nzfdt-formStyle",styles:"box-sizing:border-box;width:100%;height:100%;;label:formStyle;"};var H=({displayName:e,browser:t,controllers:n})=>Object(a.c)("div",{css:X},Object(a.c)("div",{css:Y},Object(a.c)($.a,t)," ",e),Object(a.c)("div",{css:Y},n));const X=Object(a.b)({display:"grid",gridTemplateColumns:"1fr auto",padding:4,color:l.c.white,backgroundColor:"rgba(0, 0, 0, .5)",fontSize:".8rem"},";label:wrapperStyle;"),Y={name:"1kxi40k-rowStyle",styles:"display:inline-flex;align-items:center;;label:rowStyle;"},K=n(31);var Z=Object(i.memo)(({stream:e})=>{const[t,n]=Object(i.useState)(-1/0);return Object(i.useEffect)(()=>{if(0===e.getAudioTracks().length)return;const t=K(e,{threshold:-75});return t.on("volume_change",e=>e!==-1/0&&n(e)),()=>t.stop()},[e]),Object(a.c)("div",{style:Q(t),css:ee})});const Q=e=>{if(e===-1/0)return{};const t=e+100;return{height:.1*t,opacity:.01*t}},ee=Object(a.b)({backgroundColor:l.c.blue,willChange:["height","opacity"]},";label:wrapperStyle;");var te=({stream:e,defaultDispName:t,browser:n,hasGetDisplayMedia:r,hasUserVideoDevice:o,videoType:s,isVideoTrackMuted:c,isAudioTrackMuted:l,videoDeviceId:d,audioDeviceId:u,videoInDevices:b,audioInDevices:h,isReEntering:p,isJoined:f,isDisplayNameValid:m,onChangeVideoDeviceId:v,onChangeAudioDeviceId:g,onClickToggleVideoMuted:y,onClickToggleAudioMuted:w,onClickEnableUserVideo:k,onClickDisableUserVideo:O,onClickEnableDisplayVideo:j,onClickDisableDisplayVideo:C,onChangeDispName:S,onClickCloseSettings:x,onClickJoinConference:T})=>Object(a.c)(I,null,Object(a.c)("div",{css:ne},Object(a.c)("div",{css:ie},Object(a.c)(A,{stream:e,isReverse:"camera"===s,isVideoOnly:!0}),Object(a.c)("div",{css:re},Object(a.c)(Z,{stream:e}),Object(a.c)(H,{displayName:`v${n.version}`,browser:n,controllers:Object(a.c)(i.Fragment,null,null===s?null:Object(a.c)($.c,{name:c?"videocam_off":"videocam",title:c?"Unmute video":"Mute video",onClick:y}),Object(a.c)($.c,{name:l?"mic_off":"mic",title:l?"Unmute audio":"Mute audio",onClick:w}))})),!f&&l?Object(a.c)("div",{css:ae},"Click here to unmute your mic.👇"):null),Object(a.c)("div",{css:oe},Object(a.c)(_,{label:"NAME"},Object(a.c)(U,{defaultDispName:t,isInvalid:!m,onChangeDispName:S})),Object(a.c)(N,{label:"MIC."},Object(a.c)(W,{label:"Disable",disabled:!0}),Object(a.c)(G,{deviceId:u||"",inDevices:h,onChangeDeviceId:g})),o?Object(a.c)(N,{label:"CAMERA"},"camera"===s?Object(a.c)(i.Fragment,null,Object(a.c)(W,{label:"Disable",onClick:O}),Object(a.c)(G,{deviceId:d||"",inDevices:b,onChangeDeviceId:v})):Object(a.c)(W,{label:"Enable",onClick:k})):null,r?Object(a.c)(N,{label:"DISPLAY"},"display"===s?Object(a.c)(i.Fragment,null,Object(a.c)(W,{label:"Disable",onClick:C}),Object(a.c)(W,{label:"Use another dispaly",onClick:j})):Object(a.c)(W,{label:"Enable",onClick:j})):null),Object(a.c)("div",{css:se},Object(a.c)("button",{css:ce,onClick:f?x:T,disabled:p||!m},p?"RE-ENTERING THE ROOM":Object(a.c)(i.Fragment,null,Object(a.c)($.b,{name:f?"done":"meeting_room"}),Object(a.c)("span",null,f?"CLOSE SETTINGS":"ENTER THIS ROOM"))))));const ne=Object(a.b)({width:x.a,margin:"32px auto 0",boxSizing:"border-box",backgroundColor:l.c.white},";label:wrapperStyle;"),ie=Object(a.b)({position:"relative",width:"100%",height:x.a/4*3,backgroundColor:l.c.black},";label:videoStyle;"),re={name:"1es7990-controllerStyle",styles:"position:absolute;left:0;right:0;bottom:0;z-index:1;;label:controllerStyle;"},ae=Object(a.b)({position:"absolute",right:0,bottom:24,zIndex:1,padding:4,color:l.c.white,willChange:"opacity",animation:`${l.a.blink} 1s linear infinite`,fontSize:".8rem"},";label:noteStyle;"),oe={name:"1g9pnwq-settingsStyle",styles:"margin:16px;;label:settingsStyle;"},se={name:"16ed3g4-buttonWrapStyle",styles:"padding:16px;text-align:center;;label:buttonWrapStyle;"},ce=Object(a.b)({display:"inline-flex",alignItems:"center",backgroundColor:l.c.blue,color:l.c.white,height:40,border:0,cursor:"pointer",padding:"0 24px",fontSize:"1.2rem",borderRadius:2,"&:disabled":{cursor:"not-allowed",backgroundColor:l.c.gray}},";label:doneButtonStyle;"),le=s()("effect:room"),de=e=>{le("joinRoom()");const{room:t,ui:n,media:i,client:r,notification:a}=e;if(null===t.name||null===t.mode)throw n.showError(new Error("Room name or mode is undefined!"));if(null===t.peer)throw n.showError(new Error("Peer is not created!"));const o={mode:t.mode,stream:i.stream,videoReceiveEnabled:!0};t.useH264&&Object.assign(o,{videoCodec:"H264"}),("mesh"===t.mode||"sfu"===t.mode)&&(t.room=t.peer.joinRoom(t.name,o));const s=t.room;if(null===s)throw n.showError(new Error("Room is null!"));le("joined room",s),le("w/ options:",o),n.isReEntering=!1;const c=[Object(b.i)(()=>({...i.stat,...r.stat}),e=>{le("reaction:send(stat)"),s.send({type:"stat",payload:e})}),Object(b.i)(()=>t.myLastChat,e=>{null!==e&&(le("reaction:send(chat)"),s.send({type:"chat",payload:e}))}),Object(b.i)(()=>t.myLastReaction,e=>{null!==e&&(le("reaction:send(reaction)"),s.send({type:"reaction",payload:e}))}),Object(b.i)(()=>t.castRequestCount,()=>{le("reaction:send(cast)"),s.send({type:"cast",payload:{from:r.displayName}})}),Object(b.h)(i,"videoDeviceId",e=>{if(le("observe(media.videoDeviceId)"),t.isJoined){if(null!==e.oldValue&&null!==e.newValue)return le("just change video by replaceStream(), no need to re-enter"),void s.replaceStream(i.stream);if(le("need to re-enter the room to add/remove video"),null===t.room)throw n.showError(new Error("Room is null!"));n.isReEntering=!0,t.room.close(),a.showInfo("Re-enter the room to add/remove video")}else le("do nothing before room join")})];s.on("stream",e=>{le("on('stream')",e),t.streams.set(e.peerId,e),s.send({type:"stat",payload:{...r.stat,...i.stat}})}),s.on("peerLeave",e=>{le("on('peerLeave')",e);const n=t.stats.get(e);n&&a.showLeave(n.displayName),t.removeStream(e)}),s.on("data",({src:e,data:i})=>{const{type:r,payload:o}=i;switch(r){case"stat":{const n=o;le("on('data/stat')",n),t.stats.get(e)||a.showJoin(n.displayName),t.stats.set(e,n);break}case"chat":{const e=o;le("on('data/chat')",e),n.isChatOpen||a.showChat(e.from,e.text),t.addRemoteChat(e);break}case"reaction":{const e=o;a.showReaction(e.from,e.reaction);break}case"cast":{const n=o;le("on('data/cast')",n),t.pinnedId=e,a.showInfo(`Video was casted by ${n.from}`);break}default:le("on('data/unknown') discard...")}}),s.once("close",()=>{le("on('close')"),a.showInfo("room closed! trying re-connect.."),c.forEach(e=>e());try{s.removeAllListeners(),t.cleanUp()}catch(e){throw n.showError(e)}setTimeout(()=>de(e),500)})},ue=s()("effect:settings"),be=e=>async()=>{ue("enableDisplayVideo()");const{media:t,ui:n,notification:i}=e,r=await(async()=>navigator.mediaDevices.getDisplayMedia({video:!0}).then(e=>e.getVideoTracks()[0]))().catch(e=>{if("NotAllowedError"!==e.name)throw n.showError(e)});if(!(r instanceof MediaStreamTrack))return i.showInfo("Display selection was cancelled"),i.showInfo("Or your device does not support display sharing"),void ue("selection was cancelled or not supported");r.addEventListener("ended",he(e),{once:!0}),t.releaseVideoDevice(),t.setVideoTrack(r,"display",r.label)},he=({media:e})=>()=>{ue("disableDisplayVideo()"),e.deleteVideoTrack()};var pe=()=>{const e=Object(i.useContext)(u.a),t=Object(i.useCallback)((({client:e})=>t=>{ue("changeDispName()",`${e.displayName} => ${t}`),e.displayName=t})(e),[e]),n=Object(i.useCallback)((({media:e,ui:t})=>async()=>{ue("enableUserVideo()");const{videoInDevices:n}=await p({video:!0}).catch(e=>{throw t.showError(e)});if(null===n)throw t.showError(new Error("getUserDevices() returns null"));if(0===n.length)throw t.showError(new Error("At leaset one video input device needed!"));const[{deviceId:i}]=n,r=await m(i).catch(e=>{throw t.showError(e)});e.releaseVideoDevice(),e.setVideoTrack(r,"camera",i);const a=await p({video:!0}).catch(e=>{throw t.showError(e)});e.setVideoDevices(a),ue("video devices",a.videoInDevices)})(e),[e]),r=Object(i.useCallback)((({media:e})=>()=>{ue("disableUserVideo()"),e.deleteVideoTrack()})(e),[e]),o=Object(i.useCallback)(be(e),[e]),s=Object(i.useCallback)(he(e),[e]),c=Object(i.useCallback)((({media:e,ui:t})=>async n=>{ue("changeVideoDeviceId",n),e.releaseVideoDevice();const i=await m(n).catch(e=>{throw t.showError(e)});e.setVideoTrack(i,"camera",n)})(e),[e]),l=Object(i.useCallback)((({media:e,ui:t})=>async n=>{ue("changeAudioDeviceId",n),e.releaseAudioDevice();const i=await f(n).catch(e=>{throw t.showError(e)});e.setAudioTrack(i,n)})(e),[e]),b=Object(i.useCallback)((e=>()=>{ue("joinConference()");const{ui:t,room:n}=e;if(n.isJoined)throw t.showError(new Error("Already in the room!"));de(e),t.isSettingsOpen=!1})(e),[e]),h=Object(i.useCallback)((({ui:e})=>()=>{ue("closeSettings()"),e.isSettingsOpen=!1})(e),[e]),v=Object(i.useCallback)((({media:e})=>()=>{ue("toggleAudioMuted()"),e.toggleMuted("audio")})(e),[e]),g=Object(i.useCallback)((({media:e})=>()=>{ue("toggleVideoMuted()"),e.toggleMuted("video")})(e),[e]),{ui:y,media:w,room:k,client:O}=e;return Object(a.c)(d.a,null,()=>y.isSettingsOpen?Object(a.c)(te,{stream:w.stream,defaultDispName:O.displayName,browser:O.browser,hasGetDisplayMedia:O.hasGetDisplayMedia,hasUserVideoDevice:O.hasUserVideoDevice,onChangeDispName:t,videoType:w.videoType,onClickEnableUserVideo:n,onClickDisableUserVideo:r,onClickEnableDisplayVideo:o,onClickDisableDisplayVideo:s,videoDeviceId:w.videoDeviceId||"",audioDeviceId:w.audioDeviceId||"",videoInDevices:w.videoInDevices.slice(),audioInDevices:w.audioInDevices.slice(),onChangeVideoDeviceId:c,onChangeAudioDeviceId:l,isVideoTrackMuted:w.isVideoTrackMuted,isAudioTrackMuted:w.isAudioTrackMuted,onClickToggleVideoMuted:g,onClickToggleAudioMuted:v,isReEntering:y.isReEntering,isJoined:k.isJoined,isDisplayNameValid:O.isDisplayNameValid,onClickCloseSettings:h,onClickJoinConference:b}):Object(a.c)(i.Fragment,null))};const fe=Object(a.b)({position:"absolute",top:8,left:8,zIndex:x.d.notification},";label:wrapperStyle;");var me=({children:e})=>Object(a.c)("div",{css:fe},e);var ve=({type:e,text:t})=>Object(a.c)("div",{css:ge},Object(a.c)($.b,{name:e}),Object(a.c)("span",{css:ye},t));const ge=Object(a.b)({display:"flex",alignItems:"center",padding:"4px 8px",marginBottom:4,fontSize:".8rem",borderRadius:2,backgroundColor:l.c.white,willChange:"transform",animation:`${a.d`from { transform: translateX(-200%); }`} .2s ease`},";label:wrapperStyle;"),ye={name:"1h4ubut-textStyle",styles:"text-indent:4px;width:200px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;;label:textStyle;"};function we(){return(we=Object.assign||function(e){for(var t=1;t{const e=Object(i.useContext)(u.a),{notification:t}=e;return Object(a.c)(d.a,null,()=>Object(a.c)(me,null,t.items.slice().map(e=>Object(a.c)(ve,we({key:e.id},e)))))},Oe=n(26);var je=({chat:e})=>Object(a.c)("div",{css:e.isMine?[Ce,Se]:Ce},Object(a.c)("div",{css:xe},e.from," at ",new Date(e.time).toLocaleTimeString()),e.text);const Ce=Object(a.b)({boxSizing:"border-box",width:"85%",padding:"4px 8px",marginTop:8,marginBottom:8,wordBreak:"break-word",borderRadius:2,border:`1px solid ${l.c.gray}`},";label:wrapperStyle;"),Se=Object(a.b)({marginLeft:"15%",backgroundColor:l.c.gray},";label:mineStyle;"),xe={name:"lr7gfj-headStyle",styles:"font-size:.8rem;;label:headStyle;"};var Te=({chats:e,onClickCloser:t,onClickSend:n})=>{const[r,o]=Object(i.useState)(""),s=Object(i.useCallback)(()=>{n(r),o("")},[r,n]),c=Object(i.useRef)(null);return Object(i.useEffect)(()=>{if(null===c.current)return;const e=c.current;e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[e,c]),Object(a.c)(I,null,Object(a.c)("div",{css:Ie},Object(a.c)("div",{css:De},Object(a.c)($.c,{name:"close",onClick:t})),Object(a.c)("div",{css:Ae,ref:c},e.map(e=>Object(a.c)(je,{key:e.id,chat:e}))),Object(a.c)("div",{css:Ee},Object(a.c)("input",{type:"text",value:r,onChange:e=>o(e.target.value),css:Me}),Object(a.c)($.c,{name:"send",disabled:0===r.length,onClick:s}))))};const Ie=Object(a.b)({display:"grid",gridTemplateRows:"20px 1fr 20px",width:x.a,height:"80%",boxSizing:"border-box",margin:"32px auto 0",padding:8,backgroundColor:l.c.white},";label:wrapperStyle;"),De={name:"11prr2o-headStyle",styles:"text-align:right;;label:headStyle;"},Ae={name:"rxpk0m-scrollerStyle",styles:"overflow-y:scroll;overflow-scrolling:touch;;label:scrollerStyle;"},Ee={name:"d4s163-editorStyle",styles:"display:flex;align-items:center;;label:editorStyle;"},Me={name:"19w3c9f-inputStyle",styles:"flex:1 1 auto;margin-right:8px;;label:inputStyle;"},Re=s()("effect:chat"),$e=()=>{const e=Object(i.useContext)(u.a),t=Object(i.useCallback)((({ui:e})=>()=>{Re("openChat()"),e.isChatOpen=!0})(e),[e]);return Object(a.c)(d.a,null,()=>Object(a.c)($.c,{name:"chat",onClick:t}))},Ve=()=>{const e=Object(i.useContext)(u.a),t=Object(i.useCallback)((({ui:e})=>()=>{Re("closeChat()"),e.isChatOpen=!1})(e),[e]),n=Object(i.useCallback)((({room:e,client:t})=>n=>{Re("sendChat()",n),e.addLocalChat(t.displayName,n)})(e),[e]),{ui:r,room:o}=e;return Object(a.c)(d.a,null,()=>r.isChatOpen?Object(a.c)(Te,{chats:[...o.chats],onClickCloser:t,onClickSend:n}):Object(a.c)(i.Fragment,null))};var Ne=({rtcStats:e})=>{const t=null===e?null:_e(e);return Object(a.c)("div",{css:Le},Object(a.c)("pre",{css:ze},null===t?"Loading...":t))};const _e=e=>{const t=(e=>[...e.values()].filter(e=>"candidate-pair"===e.type).filter(e=>"selected"in e?e.selected&&e.nominated:e.nominated).map(({localCandidateId:t,remoteCandidateId:n})=>{const i=e.get(t),r=e.get(n);return i||console.warn("localCandidate not found!"),r||console.warn("remoteCandidate not found!"),{localCandidate:i?{address:i.address||i.ip,port:i.port,protocol:i.protocol,type:i.candidateType}:{},remoteCandidate:r?{address:r.address||r.ip,port:r.port,protocol:r.protocol,type:r.candidateType}:{}}}))(e),{audioOutbounds:n,videoOutbounds:i}=(e=>{const t=[...e.values()].filter(e=>"outbound-rtp"===e.type);t.length>2&&console.warn("outbound-rtp reports are found more than 2!");const n={video:{bytesSent:0,packetsSent:0},audio:{bytesSent:0,packetsSent:0}};for(const e of t){const t=e.kind||e.mediaType;"audio"===t||"video"===t?(n[t].bytesSent+=e.bytesSent,n[t].packetsSent+=e.packetsSent):console.warn(`unknown outbound rtp kind: ${t} found!`)}return{audioOutbounds:n.audio,videoOutbounds:n.video}})(e),{audioInbounds:r,videoInbounds:a}=(e=>{const t=[...e.values()].filter(e=>"inbound-rtp"===e.type),n={size:0,bytesReceived:0,packetsReceived:0,packetsLost:0,nackCount:0,firCount:0,pliCount:0,items:[]},i={size:0,bytesReceived:0,packetsReceived:0,packetsLost:0,items:[]};for(const e of t){const t={bytesReceived:e.bytesReceived,packetsReceived:e.packetsReceived,packetsLost:e.packetsLost,ssrc:e.ssrc},r=e.kind||e.mediaType;"audio"===r||"video"===r?("video"===r&&(t.nackCount=e.nackCount||0,t.firCount=e.firCount||0,t.pliCount=e.pliCount||0,n.items.push(t)),"audio"===r&&i.items.push(t)):console.warn(`unknown outbound rtp kind: ${r} found!`)}for(const e of n.items)n.size+=1,n.bytesReceived+=e.bytesReceived,n.packetsReceived+=e.packetsReceived,n.packetsLost+=e.packetsLost,n.nackCount+=e.nackCount,n.firCount+=e.firCount,n.pliCount+=e.pliCount;for(const e of i.items)i.size+=1,i.bytesReceived+=e.bytesReceived,i.packetsReceived+=e.packetsReceived,i.packetsLost+=e.packetsLost;return{videoInbounds:n,audioInbounds:i}})(e);return`\n# Active ICE candidate pairs\n${t.map(({localCandidate:e,remoteCandidate:t},n)=>`\n## Pair ${n+1}\n- local: ${e.type} ${e.protocol}://${e.address}:${e.port}\n- remote: ${t.type} ${t.protocol}://${t.address}:${t.port}\n`.trim()).join("\n").trim()}\n\n# Outbounds(sent)\n- Audio: ${n.bytesSent} bytes(${n.packetsSent} packets)\n- Video: ${i.bytesSent} bytes(${i.packetsSent} packets)\n\n# Inbounds(received)\n## Total\n- ${r.size} audio(s)\n - ${r.bytesReceived} bytes(${r.packetsReceived} packets)\n - PacketsLost: ${r.packetsLost}\n- ${a.size} video(s)\n - ${a.bytesReceived} bytes(${a.packetsReceived} packets)\n - PacketsLost: ${a.packetsLost} / NACK: ${a.nackCount} / FIR: ${a.firCount} / PLI: ${a.pliCount}\n\n## Details\n${r.items.map((e,t)=>`\n- Audio ${t+1}: ${e.ssrc}\n - ${e.bytesReceived} bytes(${e.packetsReceived} packets)\n - PacketsLost: ${e.packetsLost}\n`.trim()).join("\n").trim()}\n${a.items.map((e,t)=>`\n- Video ${t+1}: ${e.ssrc}\n - ${e.bytesReceived} bytes(${e.packetsReceived} packets)\n - PacketsLost: ${e.packetsLost} / NACK: ${e.nackCount} / FIR: ${e.firCount} / PLI: ${e.pliCount}\n`.trim()).join("\n").trim()}\n `.trim()},Le={name:"1wf9sje-wrapperStyle",styles:"margin:0;padding:4px;font-size:.8rem;;label:wrapperStyle;"},ze={name:"1tmtdrc-statsStyle",styles:"margin:0;white-space:pre-wrap;word-break:break-all;;label:statsStyle;"};var Pe=({rtcStats:e})=>{const[t,n]=Object(i.useState)(""),r=null===e?null:Fe(e,t.trim());return Object(a.c)(i.Fragment,null,Object(a.c)("input",{type:"text",placeholder:"filter stat reports",value:t,onChange:e=>n(e.target.value),css:Ue}),Object(a.c)("pre",{css:qe},null===r?"Loading...":`${r.size} report(s) found.\n${JSON.stringify(r.reports,null,2)}`))};const Fe=(e,t)=>{if(0===e.size)return null;let n=0;const i={};for(const[r,a]of e){JSON.stringify(a).includes(t)&&(i[r]=a,n++)}return{reports:i,size:n}},Ue={name:"1yn50m4-inputStyle",styles:"box-sizing:border-box;width:100%;;label:inputStyle;"},qe={name:"1r75v0t-statsStyle",styles:"margin:0;padding:4px;font-size:.8rem;white-space:pre-wrap;word-break:break-all;;label:statsStyle;"};var Je=({isSfu:e,rtcStats:t,onClickCloser:n})=>Object(a.c)(I,null,Object(a.c)("div",{css:Ge},Object(a.c)("div",{css:We},Object(a.c)($.c,{name:"close",onClick:n})),e?Object(a.c)("div",{css:Be},Object(a.c)("details",{open:!0},Object(a.c)("summary",null,"Stats summary"),Object(a.c)(Ne,{rtcStats:t})),Object(a.c)("details",null,Object(a.c)("summary",null,"Stats dump"),Object(a.c)(Pe,{rtcStats:t}))):Object(a.c)("div",{css:He},"Stats view is not available in mesh room type.")));const Ge=Object(a.b)({display:"grid",gridTemplateRows:"20px 1fr",width:x.a,height:"80%",boxSizing:"border-box",margin:"32px auto 0",padding:8,backgroundColor:l.c.white},";label:wrapperStyle;"),We={name:"11prr2o-headStyle",styles:"text-align:right;;label:headStyle;"},Be={name:"12hbg2b-scrollerStyle",styles:"box-sizing:border-box;overflow:hidden;overflow-y:scroll;overflow-scrolling:touch;;label:scrollerStyle;"},He={name:"l1ytd1-naStyle",styles:"text-align:center;;label:naStyle;"},Xe=s()("effect:stats"),Ye=()=>{const e=Object(i.useContext)(u.a),t=Object(i.useCallback)((({ui:e,room:t})=>()=>{Xe("openStats()"),e.isStatsOpen=!0;const n=setInterval(async()=>{const e=t.getPeerConnection();null!==e&&e.getStats().then(e=>t.rtcStats=e).catch(e=>Xe("getStats() error",e))},1e3);Object(b.n)(()=>!e.isStatsOpen,()=>{Xe("stop stats collector"),clearInterval(n),t.rtcStats=null})})(e),[e]);return Object(a.c)(d.a,null,()=>Object(a.c)($.c,{name:"assessment",onClick:t}))},Ke=()=>{const e=Object(i.useContext)(u.a),t=Object(i.useCallback)((({ui:e})=>()=>{Xe("closeStats()"),e.isStatsOpen=!1})(e),[e]),{ui:n,room:r}=e;return Object(a.c)(d.a,null,()=>n.isStatsOpen?Object(a.c)(Je,{isSfu:"sfu"===r.mode,rtcStats:r.rtcStats,onClickCloser:t}):Object(a.c)(i.Fragment,null))};var Ze=()=>{const e=Object(i.useContext)(u.a),{room:t}=e;return Object(a.c)(d.a,null,()=>null===t.pinnedStream?Object(a.c)(i.Fragment,null):Object(a.c)(A,{stream:t.pinnedStream,isVideoOnly:!0}))};var Qe=Object(i.memo)(({stream:e,browser:t})=>{const[n,r]=Object(i.useState)({});return Object(i.useEffect)(()=>{let n=0;const i=()=>{n=requestAnimationFrame(i);const[a]=e.getVideoTracks(),[o]=e.getAudioTracks(),s=a?a.getSettings():{};r({timestamp:Date.now(),browserName:t.name,browserVersion:`v${t.version}`,streamId:e.id,video:a?{trackId:a.id,width:s.width,height:s.height,frameRate:s.frameRate}:{},audio:o?{trackId:o.id}:{}})};return n=requestAnimationFrame(i),()=>cancelAnimationFrame(n)},[e,t,r]),Object(a.c)("pre",{css:et},JSON.stringify(n,null,2))});const et=Object(a.b)({margin:0,padding:4,width:"100%",height:"100%",boxSizing:"border-box",overflow:"auto",overflowScrolling:"touch",fontSize:".8rem",backgroundColor:l.c.black,color:l.c.white},";label:wrapperStyle;");var tt=({stream:e,displayName:t,browser:n,videoType:r,isVideoTrackMuted:o,isAudioTrackMuted:s,onClickToggleAudioMuted:c,onClickToggleVideoMuted:l,onClickCastVideo:d,onClickOpenSettings:u})=>{const[b,h]=Object(i.useState)(!1),[p,f]=Object(i.useState)(!1);return Object(a.c)("div",{css:b?[nt,it]:nt},Object(a.c)("div",{css:rt},Object(a.c)(A,{stream:e,isReverse:"camera"===r,isVideoOnly:!0}),Object(a.c)("div",{css:st},null===r?null:Object(a.c)($.c,{name:"cast",showEdge:!0,title:"Cast your video",onClick:d}),Object(a.c)($.c,{name:"info",showEdge:!0,title:"Toggle stream info",onClick:()=>f(!p)}),Object(a.c)($.c,{name:"settings",showEdge:!0,title:"Open settings",onClick:u}),b?Object(a.c)($.c,{name:"keyboard_arrow_right",showEdge:!0,title:"Maximize",onClick:()=>h(!1)}):Object(a.c)($.c,{name:"keyboard_arrow_left",showEdge:!0,title:"Minimize",onClick:()=>h(!0)})),p?Object(a.c)("div",{css:at},Object(a.c)(Qe,{stream:e,browser:n})):null,Object(a.c)("div",{css:ot},Object(a.c)(Z,{stream:e}),Object(a.c)(H,{displayName:t,browser:n,controllers:Object(a.c)(i.Fragment,null,null===r?null:Object(a.c)($.c,{name:o?"videocam_off":"videocam",title:o?"Unmute video":"Mute video",onClick:l}),Object(a.c)($.c,{name:s?"mic_off":"mic",title:s?"Unmute audio":"Mute audio",onClick:c}))}))))};const nt=Object(a.b)({outline:`1px solid ${l.c.gray}`,transition:"all .2s ease",willChange:"transform"},";label:wrapperStyle;"),it={name:"u4pngj-minimizeStyle",styles:"transform:translateX(-85%);;label:minimizeStyle;"},rt=Object(a.b)({position:"relative",width:240,height:180,backgroundColor:l.c.black},";label:videoStyle;"),at={name:"2ietqi-infoStyle",styles:"position:absolute;left:0;right:0;top:0;bottom:0;z-index:10;;label:infoStyle;"},ot={name:"1es7990-controllerStyle",styles:"position:absolute;left:0;right:0;bottom:0;z-index:1;;label:controllerStyle;"},st=Object(a.b)({position:"absolute",top:4,right:4,zIndex:100,display:"flex",alignItems:"center",color:l.c.white},";label:actionStyle;"),ct=s()("effect:local-stream");var lt=()=>{const e=Object(i.useContext)(u.a),t=Object(i.useCallback)((({room:e})=>()=>{ct("castVideo()"),e.castRequestCount=e.castRequestCount+1})(e),[e]),n=Object(i.useCallback)((({ui:e})=>()=>{ct("openSettings()"),e.isSettingsOpen=!0})(e),[e]),r=Object(i.useCallback)((({media:e})=>()=>{ct("toggleAudioMuted()"),e.toggleMuted("audio")})(e),[e]),o=Object(i.useCallback)((({media:e})=>()=>{ct("toggleVideoMuted()"),e.toggleMuted("video")})(e),[e]),{media:s,client:c,ui:l}=e;return Object(a.c)(d.a,null,()=>l.isSettingsOpen?Object(a.c)(i.Fragment,null):Object(a.c)(tt,{stream:s.stream,displayName:c.displayName,browser:c.browser,videoType:s.videoType,isVideoTrackMuted:s.isVideoTrackMuted,isAudioTrackMuted:s.isAudioTrackMuted,onClickToggleAudioMuted:r,onClickToggleVideoMuted:o,onClickCastVideo:t,onClickOpenSettings:n}))};const dt=s()("effect:remote-streams");var ut=({stream:e,stat:t,isPinned:n,onClickSetPinned:r})=>{const o=!(!t||!t.isVideoDisabled),[s,c]=Object(i.useState)(!1);return Object(a.c)(i.Fragment,null,Object(a.c)("div",{css:bt},Object(a.c)(A,{stream:e}),Object(a.c)("div",{css:ft},o?null:Object(a.c)($.c,{name:n?"cancel_presentation":"present_to_all",showEdge:!0,title:"Pin this video",onClick:r}),Object(a.c)($.c,{name:"info",showEdge:!0,title:"Toggle stream info",onClick:()=>c(!s)})),s&&null!==t?Object(a.c)("div",{css:ht},Object(a.c)(Qe,{stream:e,browser:t.browser})):null,Object(a.c)("div",{css:pt},null!==t?Object(a.c)(i.Fragment,null,Object(a.c)(Z,{stream:e}),Object(a.c)(H,{displayName:t.displayName,browser:t.browser,controllers:Object(a.c)(i.Fragment,null,t.isVideoDisabled?null:Object(a.c)($.b,{name:t.isVideoMuted?"videocam_off":"videocam"}),Object(a.c)($.b,{name:t.isAudioMuted?"mic_off":"mic"}))})):null)))};const bt=Object(a.b)({position:"relative",height:x.c/4*3,backgroundColor:l.c.black},";label:videoStyle;"),ht={name:"2ietqi-infoStyle",styles:"position:absolute;left:0;right:0;top:0;bottom:0;z-index:10;;label:infoStyle;"},pt={name:"1es7990-controllerStyle",styles:"position:absolute;left:0;right:0;bottom:0;z-index:1;;label:controllerStyle;"},ft=Object(a.b)({position:"absolute",top:4,right:4,zIndex:100,display:"flex",alignItems:"center",color:l.c.white},";label:actionStyle;");const mt=([,e],[,t])=>e.getVideoTracks().length>t.getVideoTracks().length?-1:1;var vt=({streams:e,stats:t,pinnedId:n,onClickSetPinned:i})=>Object(a.c)("div",{css:gt},Object(a.c)("div",{css:yt},Object(a.c)("span",{css:wt},e.length)," participant(s)"),e.sort(mt).map(([e,r])=>{const o=t.find(([t])=>t===e),s=o?o[1]:null,c=e===n;return Object(a.c)(ut,{key:e,stream:r,stat:s,isPinned:c,onClickSetPinned:()=>i(e)})}));const gt=Object(a.b)({width:x.c},";label:wrapperStyle;"),yt=Object(a.b)({height:x.b,padding:4,boxSizing:"border-box",fontSize:".8rem",textAlign:"center"},";label:headStyle;"),wt={name:"17kikuq-numberStyle",styles:"font-size:.9rem;font-weight:bold;;label:numberStyle;"};var kt=()=>{const e=Object(i.useContext)(u.a),t=Object(i.useCallback)((({room:e})=>t=>{const n=e.pinnedId===t?null:t;dt("setPinned()",n),e.pinnedId=n})(e),[e]),{room:n}=e;return Object(a.c)(d.a,null,()=>Object(a.c)(vt,{streams:[...n.streams.entries()],stats:[...n.stats.entries()],pinnedId:n.pinnedId||"",onClickSetPinned:t}))};var Ot=({children:e})=>Object(a.c)("div",{css:jt},e);const jt={name:"11v4elu-wrapperStyle",styles:"height:100vh;position:relative;;label:wrapperStyle;"};var Ct=({children:e})=>Object(a.c)("div",{css:St},e);const St={name:"1kg00pe-wrapperStyle",styles:"position:relative;width:100%;height:100%;background-image:url(./images/logo.svg);background-repeat:no-repeat;background-position:center center;;label:wrapperStyle;"};var xt=({children:e})=>Object(a.c)("div",{css:Tt},Object(a.c)("div",{css:It},e));const Tt=Object(a.b)({position:"absolute",top:0,left:0,bottom:0,zIndex:x.d.base},";label:wrapperStyle;"),It={name:"1uct5qs-bottomStyle",styles:"position:absolute;left:8px;bottom:8px;;label:bottomStyle;"};var Dt=({children:e,openers:t})=>{const[n,r]=Object(i.useState)(!0);return Object(a.c)("div",{css:Mt,className:n?At:""},Object(a.c)("div",{css:Rt},e),Object(a.c)("div",{css:Object(V.a)([$t,Vt],";label:RightMenu;")},Object(a.c)($.c,{name:n?"chevron_right":"chevron_left",onClick:()=>r(!n)})),t.map((e,t)=>Object(a.c)("div",{key:t,css:Object(V.a)([$t,Object(a.b)({top:x.b*(t+1)},";label:RightMenu;")],";label:RightMenu;")},e)))};const At="-visible",Et=x.c,Mt=Object(a.b)({position:"absolute",top:0,right:0,bottom:0,zIndex:x.d.base,width:Et,backgroundColor:l.c.gray,height:"100%",transition:".25s ease transform",transform:`translateX(${Et}px)`,willChange:"transform",[`&.${At}`]:{transform:"translateX(0)"}},";label:wrapperStyle;"),Rt={name:"7jmvd7-scrollerStyle",styles:"height:100%;overflow-y:scroll;overflow-scrolling:touch;;label:scrollerStyle;"},$t=Object(a.b)({boxSizing:"border-box",position:"absolute",left:-x.b,width:x.b,height:x.b,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"inherit",cursor:"pointer",borderBottom:`1px solid ${l.c.white}`},";label:knobStyle;"),Vt=Object(a.b)({top:0*x.b},";label:togglerStyle;");class Nt extends i.Component{constructor(e,t){super(e,t),this.state={err:null}}render(){return null!==this.state.err?Object(a.c)(Ot,null,Object(a.c)(y,{error:this.state.err})):Object(a.c)(Ot,null,Object(a.c)(S,null,Object(a.c)(Ct,null,Object(a.c)(Ze,null)),Object(a.c)(xt,null,Object(a.c)(lt,null)),Object(a.c)(Dt,{openers:[Object(a.c)($e,{key:"chat"}),Object(a.c)(Oe.a,{key:"reaction"}),Object(a.c)(Ye,{key:"stats"})]},Object(a.c)(kt,null)),Object(a.c)(pe,null),Object(a.c)(Ve,null),Object(a.c)(Ke,null),Object(a.c)(ke,null)))}componentDidCatch(e){this.setState({err:e})}}var _t=Nt;const Lt=s()("main");(async()=>{Lt(`${c.a} v${c.b}`),document.title+=` v${c.b}`,Object(r.render)(Object(a.c)(i.StrictMode,null,Object(a.c)(a.a,{styles:l.d}),Object(a.c)(_t,null)),document.getElementById("app-root"))})().catch(e=>console.error(e))}]); \ No newline at end of file diff --git a/docs/index.bundle.js b/docs/index.bundle.js index d5576c7..fb060ef 100644 --- a/docs/index.bundle.js +++ b/docs/index.bundle.js @@ -6,17 +6,17 @@ `,moveBackground:n.d` 0% { background-position: top left; } 100% { background-position: top right; } -`},c=Object(n.b)({html:{WebkitFontSmoothing:"antialiased"},body:{margin:0,fontSize:a,fontFamily:'"Open Sans", sans-serif',fontWeight:"lighter",lineHeight:1.5,height:"100vh",background:`linear-gradient(45deg, ${i.lightblue}, ${i.blue})`},"#app-root":{height:"100vh",overflow:"hidden"}},";label:globalStyle;")},,,,,,function(e,t,r){"use strict";var n=r(10);t.a=function(){for(var e=arguments.length,t=new Array(e),r=0;r=4;)t=1540483477*(65535&(t=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(t>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),r-=4,++a;switch(r){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(a)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),((n^=n>>>15)>>>0).toString(36)},a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var i=function(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}};r.d(t,"a",(function(){return p}));var o=/[A-Z]|^ms/g,c=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},u=i((function(e){return s(e)?e:e.replace(o,"-$&").toLowerCase()})),f=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(c,(function(e,t,r){return b={name:t,styles:r,next:b},t}))}return 1===a[e]||s(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,r,n){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return b={name:r.name,styles:r.styles,next:b},r.name;if(void 0!==r.styles){var a=r.next;if(void 0!==a)for(;void 0!==a;)b={name:a.name,styles:a.styles,next:b},a=a.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a"sfu"===e||"mesh"===e,a=16,i="^[0-9a-z_-]{4,16}$",o=e=>new RegExp(i).test(e)},function(e){e.exports=JSON.parse('{"a":"skyway-conference-dev","b":"2.8.6"}')},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,r=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(r,t),this.tags.push(r)}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var a=function(e){if(e.sheet)return e.sheet;for(var t=0;t=4;)t=1540483477*(65535&(t=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(t>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),r-=4,++a;switch(r){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(a)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),((n^=n>>>15)>>>0).toString(36)},a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var i=function(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}};r.d(t,"a",(function(){return p}));var o=/[A-Z]|^ms/g,c=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},u=i((function(e){return s(e)?e:e.replace(o,"-$&").toLowerCase()})),f=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(c,(function(e,t,r){return b={name:t,styles:r,next:b},t}))}return 1===a[e]||s(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,r,n){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return b={name:r.name,styles:r.styles,next:b},r.name;if(void 0!==r.styles){var a=r.next;if(void 0!==a)for(;void 0!==a;)b={name:a.name,styles:a.styles,next:b},a=a.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a"sfu"===e||"mesh"===e,a=16,i="^[0-9a-z_-]{4,16}$",o=e=>new RegExp(i).test(e)},function(e){e.exports=JSON.parse('{"a":"skyway-conference-dev","b":"2.8.7"}')},,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,r=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(r,t),this.tags.push(r)}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var a=function(e){if(e.sheet)return e.sheet;for(var t=0;t=x},c=function(){},t.unstable_forceFrameRate=function(e){0>e||125_(o,r))void 0!==s&&0>_(s,o)?(e[n]=s,e[c]=r,n=c):(e[n]=o,e[i]=r,n=i);else{if(!(void 0!==s&&0>_(s,r)))break e;e[n]=s,e[c]=r,n=c}}}return t}return null}function _(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var T=[],M=[],$=1,E=null,P=3,z=!1,I=!1,R=!1;function N(e){for(var t=j(M);null!==t;){if(null===t.callback)S(M);else{if(!(t.startTime<=e))break;S(M),t.sortIndex=t.expirationTime,A(T,t)}t=j(M)}}function F(e){if(R=!1,N(e),!I)if(null!==j(T))I=!0,n(L);else{var t=j(M);null!==t&&a(F,t.startTime-e)}}function L(e,r){I=!1,R&&(R=!1,i()),z=!0;var n=P;try{for(N(r),E=j(T);null!==E&&(!(E.expirationTime>r)||e&&!o());){var c=E.callback;if(null!==c){E.callback=null,P=E.priorityLevel;var s=c(E.expirationTime<=r);r=t.unstable_now(),"function"==typeof s?E.callback=s:E===j(T)&&S(T),N(r)}else S(T);E=j(T)}if(null!==E)var l=!0;else{var u=j(M);null!==u&&a(F,u.startTime-r),l=!1}return l}finally{E=null,P=n,z=!1}}function W(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var q=c;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=P;P=e;try{return t()}finally{P=r}},t.unstable_next=function(e){switch(P){case 1:case 2:case 3:var t=3;break;default:t=P}var r=P;P=t;try{return e()}finally{P=r}},t.unstable_scheduleCallback=function(e,r,o){var c=t.unstable_now();if("object"==typeof o&&null!==o){var s=o.delay;s="number"==typeof s&&0c?(e.sortIndex=s,A(M,e),null===j(T)&&e===j(M)&&(R?i():R=!0,a(F,s-c))):(e.sortIndex=o,A(T,e),I||z||(I=!0,n(L))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=P;return function(){var r=P;P=t;try{return e.apply(this,arguments)}finally{P=r}}},t.unstable_getCurrentPriorityLevel=function(){return P},t.unstable_shouldYield=function(){var e=t.unstable_now();N(e);var r=j(T);return r!==E&&null!==E&&null!==r&&null!==r.callback&&r.startTime<=e&&r.expirationTime1)for(var r=1;rn&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(p,"$1"+e.trim());case 58:return e.trim()+t.replace(p,"$1"+e.trim());default:if(0<1*r&&0s.charCodeAt(8))break;case 115:o=o.replace(s,"-webkit-"+s)+";"+o;break;case 207:case 102:o=o.replace(s,"-webkit-"+(102c.charCodeAt(0)&&(c=c.trim()),c=[c],0b)&&(L=(B=B.replace(" ",":")).length),0=1.5*r;return Math.round(e/r)+" "+n+(a?"s":"")}e.exports=function(e,t){t=t||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var o=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*a;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===c&&!1===isNaN(e))return t.long?function(e){var t=Math.abs(e);if(t>=i)return o(e,t,i,"day");if(t>=a)return o(e,t,a,"hour");if(t>=n)return o(e,t,n,"minute");if(t>=r)return o(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=i)return Math.round(e/i)+"d";if(t>=a)return Math.round(e/a)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(1),a=r(14),i=r(0),o=r(6),c=r.n(o),s=r(12),l=r(3);var u=({children:e})=>Object(i.c)("div",{css:f},Object(i.c)("h1",{css:b},"SkyWay Conference"),Object(i.c)("p",{css:h},"Video conference on web browser"),Object(i.c)("div",{css:d},e),Object(i.c)("p",{css:h},"No registration or installs! Just create a room and share the link."),Object(i.c)("a",{css:p,href:"https://webrtc.ecl.ntt.com/",target:"_blank",rel:"noopener noreferrer"},Object(i.c)("img",{src:"./images/logo.svg",alt:"SkyWay"})));const f=Object(i.b)({backgroundImage:"url(./images/index/bg.jpg)",backgroundSize:"cover",animation:`${l.a.moveBackground} 30s linear infinite alternate`,height:"100vh",position:"relative",textAlign:"center",display:"flex",flexDirection:"column",justifyContent:"center"},";label:wrapperStyle;"),d={name:"1bt27t6-contentStyle",styles:"width:90%;max-width:400px;margin:0 auto;;label:contentStyle;"},b=Object(i.b)({margin:0,marginBottom:-8,color:l.c.lightblue,fontSize:"2.5rem"},";label:headStyle;"),h=Object(i.b)({margin:"16px auto",color:l.c.lightblue,fontSize:"1.2rem"},";label:pStyle;"),p={name:"192nr37-logoStyle",styles:"position:absolute;bottom:10px;right:10px;& > img{height:40px;};label:logoStyle;"};var m=r(11);var g=e=>{const[t,r]=Object(n.useState)(""),[a,o]=Object(n.useState)("sfu"),[c,s]=Object(n.useState)(!0);return Object(i.c)("form",{css:v,onSubmit:r=>{r.preventDefault(),e.onSubmit({mode:a,id:t})}},Object(i.c)("div",{css:y},Object(i.c)("div",null,"ROOM ID"),Object(i.c)("input",{type:"text",value:t,placeholder:"room-name",onChange:e=>r(e.target.value),onBlur:()=>s(Object(m.a)(t)),required:!0,maxLength:m.c,pattern:m.d,css:w})),Object(i.c)("span",{css:k},c?"":"half width, 4~16 characters are required!"),Object(i.c)("div",{css:y},Object(i.c)("div",null,"ROOM TYPE"),Object(i.c)("div",null,["sfu","mesh"].map(e=>Object(i.c)("label",{key:e,css:x},Object(i.c)("input",{type:"radio",onChange:()=>o(e),value:a,checked:a===e,name:"room-type"})," ",e)))),Object(i.c)("div",{css:O},Object(i.c)("button",{css:C,type:"submit",disabled:!Object(m.a)(t)},"CREATE ROOM")))};const v=Object(i.b)({backgroundColor:l.c.white,border:`1px solid ${l.c.gray}`,padding:16,borderRadius:2},";label:wrapperStyle;"),y={name:"gz04jy-itemStyle",styles:"display:grid;align-items:center;grid-template-columns:88px 1fr;height:40px;margin-bottom:4px;;label:itemStyle;"},w=Object(i.b)({width:"100%",boxSizing:"border-box",appearance:"none",border:0,borderBottom:`1px solid ${l.c.gray}`,fontSize:"1.2rem",padding:"4px 8px","&:focus":{borderColor:l.c.blue}},";label:roomIdStyle;"),k=Object(i.b)({color:l.c.red,fontSize:".8rem"},";label:tipStyle;"),x={name:"1cytv4i-roomTypeStyle",styles:"margin:0 8px;font-size:1.2rem;& > input{vertical-align:middle;};label:roomTypeStyle;"},O={name:"hqok2y-buttonWrapStyle",styles:"margin-top:24px;;label:buttonWrapStyle;"},C=Object(i.b)({backgroundColor:l.c.blue,color:l.c.white,height:40,border:0,cursor:"pointer",padding:"0 24px",fontSize:"1.2rem",borderRadius:2,"&:disabled":{backgroundColor:l.c.gray,cursor:"not-allowed"}},";label:createButtonStyle;");var A=()=>{const e={enterConference(e){location.href=`conf.html#!/${e.mode}/${e.id}`}};return Object(i.c)(u,null,Object(i.c)(g,{onSubmit:t=>e.enterConference(t)}))};const j=c()("main");(async()=>{j(`${s.a} v${s.b}`),document.title+=` v${s.b}`,Object(a.render)(Object(i.c)(n.StrictMode,null,Object(i.c)(i.a,{styles:l.d}),Object(i.c)(A,null)),document.getElementById("app-root"))})().catch(e=>console.error(e))}]); \ No newline at end of file + */var n,a,i,o,c;if("undefined"==typeof window||"function"!=typeof MessageChannel){var s=null,l=null,u=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(e){throw setTimeout(u,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},n=function(e){null!==s?setTimeout(n,0,e):(s=e,setTimeout(u,0))},a=function(e,t){l=setTimeout(e,t)},i=function(){clearTimeout(l)},o=function(){return!1},c=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,b=window.Date,h=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var m=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var g=b.now();t.unstable_now=function(){return b.now()-g}}var v=!1,y=null,w=-1,k=5,x=0;o=function(){return t.unstable_now()>=x},c=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,a=e[n];if(!(void 0!==a&&0<_(a,t)))break e;e[n]=t,e[r]=a,r=n}}function j(e){return void 0===(e=e[0])?null:e}function S(e){var t=e[0];if(void 0!==t){var r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,a=e.length;n_(o,r))void 0!==s&&0>_(s,o)?(e[n]=s,e[c]=r,n=c):(e[n]=o,e[i]=r,n=i);else{if(!(void 0!==s&&0>_(s,r)))break e;e[n]=s,e[c]=r,n=c}}}return t}return null}function _(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var T=[],$=[],M=1,E=null,P=3,z=!1,I=!1,R=!1;function N(e){for(var t=j($);null!==t;){if(null===t.callback)S($);else{if(!(t.startTime<=e))break;S($),t.sortIndex=t.expirationTime,A(T,t)}t=j($)}}function F(e){if(R=!1,N(e),!I)if(null!==j(T))I=!0,n(L);else{var t=j($);null!==t&&a(F,t.startTime-e)}}function L(e,r){I=!1,R&&(R=!1,i()),z=!0;var n=P;try{for(N(r),E=j(T);null!==E&&(!(E.expirationTime>r)||e&&!o());){var c=E.callback;if(null!==c){E.callback=null,P=E.priorityLevel;var s=c(E.expirationTime<=r);r=t.unstable_now(),"function"==typeof s?E.callback=s:E===j(T)&&S(T),N(r)}else S(T);E=j(T)}if(null!==E)var l=!0;else{var u=j($);null!==u&&a(F,u.startTime-r),l=!1}return l}finally{E=null,P=n,z=!1}}function W(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var q=c;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){I||z||(I=!0,n(L))},t.unstable_getCurrentPriorityLevel=function(){return P},t.unstable_getFirstCallbackNode=function(){return j(T)},t.unstable_next=function(e){switch(P){case 1:case 2:case 3:var t=3;break;default:t=P}var r=P;P=t;try{return e()}finally{P=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=q,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=P;P=e;try{return t()}finally{P=r}},t.unstable_scheduleCallback=function(e,r,o){var c=t.unstable_now();if("object"==typeof o&&null!==o){var s=o.delay;s="number"==typeof s&&0c?(e.sortIndex=s,A($,e),null===j(T)&&e===j($)&&(R?i():R=!0,a(F,s-c))):(e.sortIndex=o,A(T,e),I||z||(I=!0,n(L))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();N(e);var r=j(T);return r!==E&&null!==E&&null!==r&&null!==r.callback&&r.startTime<=e&&r.expirationTime1)for(var r=1;rn&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(p,"$1"+e.trim());case 58:return e.trim()+t.replace(p,"$1"+e.trim());default:if(0<1*r&&0s.charCodeAt(8))break;case 115:o=o.replace(s,"-webkit-"+s)+";"+o;break;case 207:case 102:o=o.replace(s,"-webkit-"+(102c.charCodeAt(0)&&(c=c.trim()),c=[c],0b)&&(L=(B=B.replace(" ",":")).length),0=1.5*r;return Math.round(e/r)+" "+n+(a?"s":"")}e.exports=function(e,t){t=t||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var o=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*a;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(e);if("number"===c&&!1===isNaN(e))return t.long?function(e){var t=Math.abs(e);if(t>=i)return o(e,t,i,"day");if(t>=a)return o(e,t,a,"hour");if(t>=n)return o(e,t,n,"minute");if(t>=r)return o(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=i)return Math.round(e/i)+"d";if(t>=a)return Math.round(e/a)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},,,,,,,,,,,function(e,t,r){"use strict";r.r(t);var n=r(1),a=r(15),i=r(0),o=r(6),c=r.n(o),s=r(11),l=r(3);var u=({children:e})=>Object(i.c)("div",{css:f},Object(i.c)("h1",{css:b},"SkyWay Conference"),Object(i.c)("p",{css:h},"Video conference on web browser"),Object(i.c)("div",{css:d},e),Object(i.c)("p",{css:h},"No registration or installs! Just create a room and share the link."),Object(i.c)("a",{css:p,href:"https://webrtc.ecl.ntt.com/",target:"_blank",rel:"noopener noreferrer"},Object(i.c)("img",{src:"./images/logo.svg",alt:"SkyWay"})));const f=Object(i.b)({backgroundImage:"url(./images/index/bg.jpg)",backgroundSize:"cover",animation:`${l.a.moveBackground} 30s linear infinite alternate`,height:"100vh",position:"relative",textAlign:"center",display:"flex",flexDirection:"column",justifyContent:"center"},";label:wrapperStyle;"),d={name:"1bt27t6-contentStyle",styles:"width:90%;max-width:400px;margin:0 auto;;label:contentStyle;"},b=Object(i.b)({margin:0,marginBottom:-8,color:l.c.lightblue,fontSize:"2.5rem"},";label:headStyle;"),h=Object(i.b)({margin:"16px auto",color:l.c.lightblue,fontSize:"1.2rem"},";label:pStyle;"),p={name:"192nr37-logoStyle",styles:"position:absolute;bottom:10px;right:10px;& > img{height:40px;};label:logoStyle;"};var m=r(10);var g=e=>{const[t,r]=Object(n.useState)(""),[a,o]=Object(n.useState)("sfu"),[c,s]=Object(n.useState)(!0);return Object(i.c)("form",{css:v,onSubmit:r=>{r.preventDefault(),e.onSubmit({mode:a,id:t})}},Object(i.c)("div",{css:y},Object(i.c)("div",null,"ROOM ID"),Object(i.c)("input",{type:"text",value:t,placeholder:"room-name",onChange:e=>r(e.target.value),onBlur:()=>s(Object(m.a)(t)),required:!0,maxLength:m.c,pattern:m.d,css:w})),Object(i.c)("span",{css:k},c?"":"half width, 4~16 characters are required!"),Object(i.c)("div",{css:y},Object(i.c)("div",null,"ROOM TYPE"),Object(i.c)("div",null,["sfu","mesh"].map(e=>Object(i.c)("label",{key:e,css:x},Object(i.c)("input",{type:"radio",onChange:()=>o(e),value:a,checked:a===e,name:"room-type"})," ",e)))),Object(i.c)("div",{css:O},Object(i.c)("button",{css:C,type:"submit",disabled:!Object(m.a)(t)},"CREATE ROOM")))};const v=Object(i.b)({backgroundColor:l.c.white,border:`1px solid ${l.c.gray}`,padding:16,borderRadius:2},";label:wrapperStyle;"),y={name:"gz04jy-itemStyle",styles:"display:grid;align-items:center;grid-template-columns:88px 1fr;height:40px;margin-bottom:4px;;label:itemStyle;"},w=Object(i.b)({width:"100%",boxSizing:"border-box",appearance:"none",border:0,borderBottom:`1px solid ${l.c.gray}`,fontSize:"1.2rem",padding:"4px 8px","&:focus":{borderColor:l.c.blue}},";label:roomIdStyle;"),k=Object(i.b)({color:l.c.red,fontSize:".8rem"},";label:tipStyle;"),x={name:"1cytv4i-roomTypeStyle",styles:"margin:0 8px;font-size:1.2rem;& > input{vertical-align:middle;};label:roomTypeStyle;"},O={name:"hqok2y-buttonWrapStyle",styles:"margin-top:24px;;label:buttonWrapStyle;"},C=Object(i.b)({backgroundColor:l.c.blue,color:l.c.white,height:40,border:0,cursor:"pointer",padding:"0 24px",fontSize:"1.2rem",borderRadius:2,"&:disabled":{backgroundColor:l.c.gray,cursor:"not-allowed"}},";label:createButtonStyle;");var A=()=>{const e={enterConference(e){location.href=`conf.html#!/${e.mode}/${e.id}`}};return Object(i.c)(u,null,Object(i.c)(g,{onSubmit:t=>e.enterConference(t)}))};const j=c()("main");(async()=>{j(`${s.a} v${s.b}`),document.title+=` v${s.b}`,Object(a.render)(Object(i.c)(n.StrictMode,null,Object(i.c)(i.a,{styles:l.d}),Object(i.c)(A,null)),document.getElementById("app-root"))})().catch(e=>console.error(e))}]); \ No newline at end of file diff --git a/docs/vendor.bundle.js b/docs/vendor.bundle.js index a6e7139..340d984 100644 --- a/docs/vendor.bundle.js +++ b/docs/vendor.bundle.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return v})),n.d(t,"d",(function(){return _}));var r=n(20),i=n.n(r),o=n(1),s=n(21),a=n(15),u=n(10),c=n(13),l=n(9);n.d(t,"b",(function(){return l.a}));var d=Object(o.createContext)("undefined"!=typeof HTMLElement?Object(s.a)():null),f=Object(o.createContext)({}),p=(d.Provider,function(e){return Object(o.forwardRef)((function(t,n){return Object(o.createElement)(d.Consumer,null,(function(r){return e(t,r,n)}))}))}),h="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",m=Object.prototype.hasOwnProperty,y=function(e,t,n,r){var i=null===n?t.css:t.css(n);"string"==typeof i&&void 0!==e.registered[i]&&(i=e.registered[i]);var s=t[h],c=[i],l="";"string"==typeof t.className?l=Object(a.a)(e.registered,c,t.className):null!=t.className&&(l=t.className+" ");var d=Object(u.a)(c);Object(a.b)(e,d,"string"==typeof s);l+=e.key+"-"+d.name;var f={};for(var p in t)m.call(t,p)&&"css"!==p&&p!==h&&(f[p]=t[p]);return f.ref=r,f.className=l,Object(o.createElement)(s,f)},g=p((function(e,t,n){return"function"==typeof e.css?Object(o.createElement)(f.Consumer,null,(function(r){return y(t,e,r,n)})):y(t,e,null,n)}));var v=function(e,t){var n=arguments;if(null==t||!m.call(t,"css"))return o.createElement.apply(void 0,n);var r=n.length,i=new Array(r);i[0]=g;var s={};for(var a in t)m.call(t,a)&&(s[a]=t[a]);s[h]=e,i[1]=s;for(var u=2;u=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function u(){for(var e=[],t=0;t2&&J("box");var n=z(t);return new Ee(e,$(n),n.name,!0,n.equals)},array:function(e,t){arguments.length>2&&J("array");var n=z(t);return Bt(e,$(n),n.name)},map:function(e,t){arguments.length>2&&J("map");var n=z(t);return new qt(e,$(n),n.name)},set:function(e,t){arguments.length>2&&J("set");var n=z(t);return new Ht(e,$(n),n.name)},object:function(e,t,n){"string"==typeof arguments[1]&&J("object");var r=z(n);if(!1===r.proxy)return st({},e,t,r);var i=at(r),o=st({},void 0,void 0,r),s=Tt(o);return ut(s,e,t,i),s},ref:G,shallow:W,deep:q,struct:H},K=function(e,t,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return q.apply(null,arguments);if(pt(e))return e;var r=g(e)?K.object(e,t,n):Array.isArray(e)?K.array(e,t):w(e)?K.map(e,t):_(e)?K.set(e,t):e;if(r!==e)return r;f(!1)};function J(e){f("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(Y).forEach((function(e){return K[e]=Y[e]}));var Q,X,Z=F(!1,(function(e,t,n,r,i){var s=n.get,a=n.set,u=i[0]||{};Kt(e).addComputedProp(e,t,o({get:s,set:a,context:e},u))})),ee=Z({equals:O.structural}),te=function(e,t,n){if("string"==typeof t)return Z.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return Z.apply(null,arguments);var r="object"==typeof t?t:{};return r.get=e,r.set="function"==typeof t?t:r.set,r.name=r.name||e.name||"",new ke(r)};te.struct=ee,function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(Q||(Q={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(X||(X={}));var ne=function(e){this.cause=e};function re(e){return e instanceof ne}function ie(e){switch(e.dependenciesState){case Q.UP_TO_DATE:return!1;case Q.NOT_TRACKING:case Q.STALE:return!0;case Q.POSSIBLY_STALE:for(var t=de(!0),n=ce(),r=e.observing,i=r.length,o=0;o0;Ne.computationDepth>0&&t&&f(!1),Ne.allowStateChanges||!t&&"strict"!==Ne.enforceActions||f(!1)}function se(e,t,n){var r=de(!0);pe(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Ne.runId;var i,o=Ne.trackingDerivation;if(Ne.trackingDerivation=e,!0===Ne.disableErrorBoundaries)i=t.call(n);else try{i=t.call(n)}catch(e){i=new ne(e)}return Ne.trackingDerivation=o,function(e){for(var t=e.observing,n=e.observing=e.newObserving,r=Q.UP_TO_DATE,i=0,o=e.unboundDepsCount,s=0;sr&&(r=a.dependenciesState)}n.length=i,e.newObserving=null,o=t.length;for(;o--;){0===(a=t[o]).diffValue&&Re(a,e),a.diffValue=0}for(;i--;){var a;1===(a=n[i]).diffValue&&(a.diffValue=0,Me(a,e))}r!==Q.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}(e),fe(r),i}function ae(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)Re(t[n],e);e.dependenciesState=Q.NOT_TRACKING}function ue(e){var t=ce();try{return e()}finally{le(t)}}function ce(){var e=Ne.trackingDerivation;return Ne.trackingDerivation=null,e}function le(e){Ne.trackingDerivation=e}function de(e){var t=Ne.allowStateReads;return Ne.allowStateReads=e,t}function fe(e){Ne.allowStateReads=e}function pe(e){if(e.dependenciesState!==Q.UP_TO_DATE){e.dependenciesState=Q.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=Q.UP_TO_DATE}}var he=0,me=1,ye=Object.getOwnPropertyDescriptor((function(){}),"name");ye&&ye.configurable;function ge(e,t,n){var r=function(){return ve(e,t,n||this,arguments)};return r.isMobxAction=!0,r}function ve(e,t,n,r){var i=function(e,t,n){var r=0;var i=ce();Be();var o=we(!0),s=de(!0),a={prevDerivation:i,prevAllowStateChanges:o,prevAllowStateReads:s,notifySpy:!1,startTime:r,actionId:me++,parentActionId:he};return he=a.actionId,a}();try{return t.apply(n,r)}catch(e){throw i.error=e,e}finally{!function(e){he!==e.actionId&&f("invalid action stack. did you forget to finish an action?");he=e.parentActionId,void 0!==e.error&&(Ne.suppressReactionErrors=!0);_e(e.prevAllowStateChanges),fe(e.prevAllowStateReads),Fe(),le(e.prevDerivation),e.notifySpy&&!1;Ne.suppressReactionErrors=!1}(i)}}function be(e,t){var n,r=we(e);try{n=t()}finally{_e(r)}return n}function we(e){var t=Ne.allowStateChanges;return Ne.allowStateChanges=e,t}function _e(e){Ne.allowStateChanges=e}var Ee=function(e){function t(t,n,r,i,o){void 0===r&&(r="ObservableValue@"+d()),void 0===i&&(i=!0),void 0===o&&(o=O.default);var s=e.call(this,r)||this;return s.enhancer=n,s.name=r,s.equals=o,s.hasUnreportedChange=!1,s.value=n(t,void 0,r),s}return function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){this.value;if((e=this.prepareNewValue(e))!==Ne.UNCHANGED){0,this.setNewValue(e)}},t.prototype.prepareNewValue=function(e){if(oe(this),At(this)){var t=Pt(this,{object:this,type:"update",newValue:e});if(!t)return Ne.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?Ne.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),Nt(this)&&Rt(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return Ot(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),Mt(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return k(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(x),Se=b("ObservableValue",Ee),ke=function(){function e(e){this.dependenciesState=Q.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Q.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+d(),this.value=new ne(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=X.NONE,p(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+d(),e.set&&(this.setter=ge(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?O.structural:O.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return e.prototype.onBecomeStale=function(){!function(e){if(e.lowestObserverState!==Q.UP_TO_DATE)return;e.lowestObserverState=Q.POSSIBLY_STALE,e.observers.forEach((function(t){t.dependenciesState===Q.UP_TO_DATE&&(t.dependenciesState=Q.POSSIBLY_STALE,t.isTracing!==X.NONE&&Le(t,e),t.onBecomeStale())}))}(this)},e.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(e){return e()}))},e.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(e){return e()}))},e.prototype.get=function(){this.isComputing&&f("Cycle detected in computation "+this.name+": "+this.derivation),0!==Ne.inBatch||0!==this.observers.size||this.keepAlive?(Ie(this),ie(this)&&this.trackAndCompute()&&function(e){if(e.lowestObserverState===Q.STALE)return;e.lowestObserverState=Q.STALE,e.observers.forEach((function(t){t.dependenciesState===Q.POSSIBLY_STALE?t.dependenciesState=Q.STALE:t.dependenciesState===Q.UP_TO_DATE&&(e.lowestObserverState=Q.UP_TO_DATE)}))}(this)):ie(this)&&(this.warnAboutUntrackedRead(),Be(),this.value=this.computeValue(!1),Fe());var e=this.value;if(re(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(re(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){p(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else p(!1,!1)},e.prototype.trackAndCompute=function(){var e=this.value,t=this.dependenciesState===Q.NOT_TRACKING,n=this.computeValue(!0),r=t||re(e)||re(n)||!this.equals(e,n);return r&&(this.value=n),r},e.prototype.computeValue=function(e){var t;if(this.isComputing=!0,Ne.computationDepth++,e)t=se(this,this.derivation,this.scope);else if(!0===Ne.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new ne(e)}return Ne.computationDepth--,this.isComputing=!1,t},e.prototype.suspend=function(){this.keepAlive||(ae(this),this.value=void 0)},e.prototype.observe=function(e,t){var n=this,r=!0,i=void 0;return Xe((function(){var o=n.get();if(!r||t){var s=ce();e({type:"update",object:n,newValue:o,oldValue:i}),le(s)}r=!1,i=o}))},e.prototype.warnAboutUntrackedRead=function(){},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return k(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(),Ce=b("ComputedValue",ke),xe=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},Te={};function Ae(){return"undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:Te}var Oe=!0,Pe=!1,Ne=function(){var e=Ae();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Oe=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new xe).version&&(Oe=!1),Oe?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new xe):(setTimeout((function(){Pe||f("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new xe)}();function Me(e,t){e.observers.add(t),e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Re(e,t){e.observers.delete(t),0===e.observers.size&&je(e)}function je(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ne.pendingUnobservations.push(e))}function Be(){Ne.inBatch++}function Fe(){if(0==--Ne.inBatch){Ve();for(var e=Ne.pendingUnobservations,t=0;t0&&je(e),!1)}function Le(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===X.BREAK){var n=[];!function e(t,n,r){if(n.length>=1e3)return void n.push("(and many more)");n.push(""+new Array(r).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,n,r+1)}))}(ct(e),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof ke?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}var De=function(){function e(e,t,n,r){void 0===e&&(e="Reaction@"+d()),void 0===r&&(r=!1),this.name=e,this.onInvalidate=t,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=Q.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+d(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=X.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ne.pendingReactions.push(this),Ve())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Be(),this._isScheduled=!1,ie(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(e){this.reportExceptionInDerivation(e)}}Fe()}},e.prototype.track=function(e){if(!this.isDisposed){Be();0,this._isRunning=!0;var t=se(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&ae(this),re(t)&&this.reportExceptionInDerivation(t.cause),Fe()}},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ne.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ne.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Ne.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Be(),ae(this),Fe()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[C]=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t0||Ne.isRunningReactions||Ue(ze)}function ze(){Ne.isRunningReactions=!0;for(var e=Ne.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r",e):2===arguments.length&&"function"==typeof t?ge(e,t):1===arguments.length&&"string"==typeof e?$e(e):!0!==r?$e(t).apply(null,arguments):void v(e,t,ge(e.name||t,n.value,this))};function Je(e,t){"string"==typeof e||e.name;return ve(0,"function"==typeof e?e:t,this,void 0)}function Qe(e,t,n){v(e,t,ge(t,n.bind(e)))}function Xe(e,t){void 0===t&&(t=l);var n,r=t&&t.name||e.name||"Autorun@"+d();if(!t.scheduler&&!t.delay)n=new De(r,(function(){this.track(s)}),t.onError,t.requiresObservable);else{var i=et(t),o=!1;n=new De(r,(function(){o||(o=!0,i((function(){o=!1,n.isDisposed||n.track(s)})))}),t.onError,t.requiresObservable)}function s(){e(n)}return n.schedule(),n.getDisposer()}Ke.bound=function(e,t,n,r){return!0===r?(Qe(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return Qe(this,t,n.value||n.initializer.call(this)),this[t]},set:He}:{enumerable:!1,configurable:!0,set:function(e){Qe(this,t,e)},get:function(){}}};var Ze=function(e){return e()};function et(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Ze}function tt(e,t,n){void 0===n&&(n=l);var r,i,o,s=n.name||"Reaction@"+d(),a=Ke(s,n.onError?(r=n.onError,i=t,function(){try{return i.apply(this,arguments)}catch(e){r.call(this,e)}}):t),u=!n.scheduler&&!n.delay,c=et(n),f=!0,p=!1,h=n.compareStructural?O.structural:n.equals||O.default,m=new De(s,(function(){f||u?y():p||(p=!0,c(y))}),n.onError,n.requiresObservable);function y(){if(p=!1,!m.isDisposed){var t=!1;m.track((function(){var n=e(m);t=f||!h(o,n),o=n})),f&&n.fireImmediately&&a(o,m),f||!0!==t||a(o,m),f&&(f=!1)}}return m.schedule(),m.getDisposer()}function nt(e,t,n){return rt("onBecomeUnobserved",e,t,n)}function rt(e,t,n,r){var i="function"==typeof r?tn(t,n):tn(t),o="function"==typeof r?r:n,s=e+"Listeners";return i[s]?i[s].add(o):i[s]=new Set([o]),"function"!=typeof i[e]?f(!1):function(){var e=i[s];e&&(e.delete(o),0===e.size&&delete i[s])}}function it(e){var t=e.enforceActions,n=e.computedRequiresReaction,r=e.computedConfigurable,i=e.disableErrorBoundaries,o=e.reactionScheduler,s=e.reactionRequiresObservable,a=e.observableRequiresReaction;if(!0===e.isolateGlobalState&&((Ne.pendingReactions.length||Ne.inBatch||Ne.isRunningReactions)&&f("isolateGlobalState should be called before MobX is running any reactions"),Pe=!0,Oe&&(0==--Ae().__mobxInstanceCount&&(Ae().__mobxGlobals=void 0),Ne=new xe)),void 0!==t){var u=void 0;switch(t){case!0:case"observed":u=!0;break;case!1:case"never":u=!1;break;case"strict":case"always":u="strict";break;default:f("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}Ne.enforceActions=u,Ne.allowStateChanges=!0!==u&&"strict"!==u}void 0!==n&&(Ne.computedRequiresReaction=!!n),void 0!==s&&(Ne.reactionRequiresObservable=!!s),void 0!==a&&(Ne.observableRequiresReaction=!!a,Ne.allowStateReads=!Ne.observableRequiresReaction),void 0!==r&&(Ne.computedConfigurable=!!r),void 0!==i&&(!0===i&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),Ne.disableErrorBoundaries=!!i),o&&We(o)}function ot(e,t){var n="function"==typeof e?e.prototype:e,r=function(e){var r=t[e];Array.isArray(r)||(r=[r]);var i=Object.getOwnPropertyDescriptor(n,e),o=r.reduce((function(t,r){return r(n,e,t)}),i);o&&Object.defineProperty(n,e,o)};for(var i in t)r(i);return e}function st(e,t,n,r){var i=at(r=z(r));return B(e),Kt(e,r.name,i.enhancer),t&&ut(e,t,n,i),e}function at(e){return e.defaultDecorator||(!1===e.deep?G:q)}function ut(e,t,n,r){var i,o;Be();try{var a=E(t);try{for(var u=s(a),c=u.next();!c.done;c=u.next()){var l=c.value,d=Object.getOwnPropertyDescriptor(t,l);0;var f=(n&&l in n?n[l]:d.get?Z:r)(e,l,d,!0);f&&Object.defineProperty(e,l,f)}}catch(e){i={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}finally{Fe()}}function ct(e,t){return lt(tn(e,t))}function lt(e){var t,n,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(t=e.observing,n=[],t.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),n).map(lt)),r}function dt(){this.message="FLOW_CANCELLED"}function ft(e,t){return null!=e&&(void 0!==t?!!en(e)&&e[C].values.has(t):en(e)||!!e[C]||T(e)||qe(e)||Ce(e))}function pt(e){return 1!==arguments.length&&f(!1),ft(e)}function ht(e){return en(e)?e[C].getKeys():Wt(e)?Array.from(e.keys()):$t(e)?Array.from(e.keys()):Ut(e)?e.map((function(e,t){return t})):f(!1)}function mt(e,t,n,r){return"function"==typeof n?function(e,t,n,r){return nn(e,t).observe(n,r)}(e,t,n,r):function(e,t,n){return nn(e).observe(t,n)}(e,t,n)}dt.prototype=Object.create(Error.prototype);var yt={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function gt(e,t,n,r){return r.detectCycles&&e.set(t,n),n}function vt(e,t){var n;return"boolean"==typeof t&&(t={detectCycles:t}),t||(t=yt),t.detectCycles=void 0===t.detectCycles?!0===t.recurseEverything:!0===t.detectCycles,t.detectCycles&&(n=new Map),function e(t,n,r){if(!n.recurseEverything&&!pt(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(Se(t))return e(t.get(),n,r);if(pt(t)&&ht(t),!0===n.detectCycles&&null!==t&&r.has(t))return r.get(t);if(Ut(t)||Array.isArray(t)){var i=gt(r,t,[],n),o=t.map((function(t){return e(t,n,r)}));i.length=o.length;for(var s=0,a=o.length;s=0,"Not a valid index: '"+n+"'"),Be(),n>=t.length&&(t.length=n+1),t[n]=r,Fe()}else{Be();var s=n;try{for(var a in s)e(t,a,s[a])}finally{Fe()}}}(e,t,n),!0)},deleteProperty:function(e,t){return!!Ct(t)&&(kt(e).remove(t),!0)},ownKeys:function(e){return kt(e).keysAtom.reportObserved(),Reflect.ownKeys(e)},preventExtensions:function(e){return f("Dynamic observable objects cannot be frozen"),!1}};function Tt(e){var t=new Proxy(e,xt);return e[C].proxy=t,t}function At(e){return void 0!==e.interceptors&&e.interceptors.length>0}function Ot(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),h((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function Pt(e,t){var n=ce();try{for(var r=u(e.interceptors||[]),i=0,o=r.length;i0}function Mt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),h((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function Rt(e,t){var n=ce(),r=e.changeListeners;if(r){for(var i=0,o=(r=r.slice()).length;i0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return Ot(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Mt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;ri?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=c),At(this)){var o=Pt(this,{object:this.proxy,type:"splice",index:e,removedCount:t,added:n});if(!o)return c;t=o.removedCount,n=o.added}n=0===n.length?n:n.map((function(e){return r.enhancer(e,void 0)}));var s=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,u([e,t],n));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),i},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&!1,i=Nt(this),o=i||r?{object:this.proxy,type:"update",index:e,newValue:t,oldValue:n}:null;this.atom.reportChanged(),i&&Rt(this,o)},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&!1,i=Nt(this),o=i||r?{object:this.proxy,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom.reportChanged(),i&&Rt(this,o)},e}(),It={intercept:function(e){return this[C].intercept(e)},observe:function(e,t){return void 0===t&&(t=!1),this[C].observe(e,t)},clear:function(){return this.splice(0)},replace:function(e){var t=this[C];return t.spliceWithArray(0,t.values.length,e)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(e,t){for(var n=[],r=2;r-1&&(this.splice(n,1),!0)},get:function(e){var t=this[C];if(t){if(e=0&&r++}t=sn(t),n=sn(n);var u="[object Array]"===a;if(!u){if("object"!=typeof t||"object"!=typeof n)return!1;var c=t.constructor,l=n.constructor;if(c!==l&&!("function"==typeof c&&c instanceof c&&"function"==typeof l&&l instanceof l)&&"constructor"in t&&"constructor"in n)return!1}if(0===r)return!1;r<0&&(r=-1);o=o||[];var d=(i=i||[]).length;for(;d--;)if(i[d]===t)return o[d]===n;if(i.push(t),o.push(n),u){if((d=t.length)!==n.length)return!1;for(;d--;)if(!e(t[d],n[d],r-1,i,o))return!1}else{var f=Object.keys(t),p=void 0;if(d=f.length,Object.keys(n).length!==d)return!1;for(;d--;)if(p=f[d],!an(n,p)||!e(t[p],n[p],r-1,i,o))return!1}return i.pop(),o.pop(),!0}(e,t,n)}function sn(e){return Ut(e)?e.slice():w(e)||Wt(e)?Array.from(e.entries()):_(e)||$t(e)?Array.from(e.entries()):e}function an(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function un(e){return e[Symbol.iterator]=cn,e}function cn(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Ge,extras:{getDebugName:function(e,t){return(void 0!==t?tn(e,t):en(e)||Wt(e)||$t(e)?nn(e):tn(e)).name}},$mobx:C})}).call(this,n(19),n(30))},,,,function(e,t,n){(function(r){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(29)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(19))},,function(e,t,n){"use strict";var r=n(14),i=n(2),o=n(1),s=n.n(o);if(!o.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!i.q)throw new Error("mobx-react-lite requires mobx at least version 4 to be available");var a=!1;function u(){return a} -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function l(e){return e.current?Object(i.i)(e.current):""}var d=[];function f(){var e=c(Object(o.useState)(0),2)[1];return Object(o.useCallback)((function(){e((function(e){return e+1}))}),[])}var p={};function h(e,t,n){if(void 0===t&&(t="observed"),void 0===n&&(n=p),u())return e();var r=(n.useForceUpdate||f)(),s=Object(o.useRef)(null);s.current||(s.current=new i.b("observer("+t+")",(function(){r()})));var a,c,h=function(){s.current&&!s.current.isDisposed&&(s.current.dispose(),s.current=null)};if(Object(o.useDebugValue)(s,l),function(e){Object(o.useEffect)((function(){return e}),d)}((function(){h()})),s.current.track((function(){try{a=e()}catch(e){c=e}})),c)throw h(),c;return a}function m(e){var t=e.children,n=e.render,r=t||n;return"function"!=typeof r?null:h(r)}function y(e,t,n,r,i){var o="children"===t?"render":"children",s="function"==typeof e[t],a="function"==typeof e[o];return s&&a?new Error("MobX Observer: Do not use children and render in the same time in`"+n):s||a?null:new Error("Invalid prop `"+i+"` of type `"+typeof e[t]+"` supplied to `"+n+"`, expected `function`.")}m.propTypes={children:y,render:y},m.displayName="Observer";n.d(t,"a",(function(){return m}));var g=0,v={};function b(e){return v[e]||(v[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react "+e+" ("+g+")";return g++,t}(e)),v[e]}b("patchMixins"),b("patchedDefinition");i.a,b("isUnmounted"),b("skipRender"),b("isForcingUpdate");var w="function"==typeof Symbol&&Symbol.for;w?Symbol.for("react.forward_ref"):"function"==typeof o.forwardRef&&Object(o.forwardRef)((function(){})).$$typeof,w?Symbol.for("react.memo"):"function"==typeof o.memo&&Object(o.memo)((function(){})).$$typeof;s.a.createContext({});b("disposeOnUnmountProto"),b("disposeOnUnmountInst");function _(e){function t(t,n,r,o,s,a){for(var u=[],c=arguments.length-6;c-- >0;)u[c]=arguments[c+6];return Object(i.t)((function(){return o=o||"<>",a=a||r,null==n[r]?t?new Error("The "+s+" `"+a+"` is marked as required in `"+o+"`, but its value is `"+(null===n[r]?"null":"undefined")+"`."):null:e.apply(void 0,[n,r,o,s,a].concat(u))}))}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function E(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}(t,e)?"symbol":t}function S(e,t){return _((function(n,r,o,s,a){return Object(i.t)((function(){if(e&&E(n[r])===t.toLowerCase())return null;var s;switch(t){case"Array":s=i.j;break;case"Object":s=i.l;break;case"Map":s=i.k;break;default:throw new Error("Unexpected mobxType: "+t)}var u=n[r];if(!s(u)){var c=function(e){var t=E(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}(u),l=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+a+"` of type `"+c+"` supplied to `"+o+"`, expected `mobx.Observable"+t+"`"+l+".")}return null}))}))}function k(e,t){return _((function(n,r,o,s,a){for(var u=[],c=arguments.length-5;c-- >0;)u[c]=arguments[c+5];return Object(i.t)((function(){if("function"!=typeof t)return new Error("Property `"+a+"` of component `"+o+"` has invalid PropType notation.");var i=S(e,"Array")(n,r,o);if(i instanceof Error)return i;for(var c=n[r],l=0;l0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),s=Math.max(i,o),a=0,u=e.map([t,n],(function(t){var n=s-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(u[0][s]>u[1][s])return 1;if(u[0][s]===u[1][s]){if(s===a)return 0;s-=1}else if(u[0][s]1?i-1:0),s=1;s0){var s=Object.keys(n),u=a.default.find(s,(function(e){return t.isOS(e)}));if(u){var c=this.satisfies(n[u]);if(void 0!==c)return c}var l=a.default.find(s,(function(e){return t.isPlatform(e)}));if(l){var d=this.satisfies(n[l]);if(void 0!==d)return d}}if(o>0){var f=Object.keys(i),p=a.default.find(f,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(a.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e){return this.isBrowser(e)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=c,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?) Version\//],describe:function(e){var t=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return{name:o.OS_MAP.iOS,version:t}}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:o.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:o.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:o.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?) Version\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=s,e.exports=t.default}})},function(e,t,n){ +var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function u(){for(var e=[],t=0;t2&&Q("box");var n=z(t);return new _e(e,$(n),n.name,!0,n.equals)},array:function(e,t){arguments.length>2&&Q("array");var n=z(t);return jt(e,$(n),n.name)},map:function(e,t){arguments.length>2&&Q("map");var n=z(t);return new zt(e,$(n),n.name)},set:function(e,t){arguments.length>2&&Q("set");var n=z(t);return new Gt(e,$(n),n.name)},object:function(e,t,n){"string"==typeof arguments[1]&&Q("object");var r=z(n);if(!1===r.proxy)return ot({},e,t,r);var i=st(r),o=ot({},void 0,void 0,r),s=xt(o);return at(s,e,t,i),s},ref:G,shallow:W,deep:q,struct:H},K=function(e,t,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return q.apply(null,arguments);if(ft(e))return e;var r=y(e)?K.object(e,t,n):Array.isArray(e)?K.array(e,t):w(e)?K.map(e,t):_(e)?K.set(e,t):e;if(r!==e)return r;f(!1)};function Q(e){f("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(Y).forEach((function(e){return K[e]=Y[e]}));var J,X,Z=F(!1,(function(e,t,n,r,i){var s=n.get,a=n.set,u=i[0]||{};Yt(e).addComputedProp(e,t,o({get:s,set:a,context:e},u))})),ee=Z({equals:O.structural}),te=function(e,t,n){if("string"==typeof t)return Z.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return Z.apply(null,arguments);var r="object"==typeof t?t:{};return r.get=e,r.set="function"==typeof t?t:r.set,r.name=r.name||e.name||"",new Se(r)};te.struct=ee,function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(J||(J={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(X||(X={}));var ne=function(e){this.cause=e};function re(e){return e instanceof ne}function ie(e){switch(e.dependenciesState){case J.UP_TO_DATE:return!1;case J.NOT_TRACKING:case J.STALE:return!0;case J.POSSIBLY_STALE:for(var t=de(!0),n=ce(),r=e.observing,i=r.length,o=0;o0;Pe.computationDepth>0&&t&&f(!1),Pe.allowStateChanges||!t&&"strict"!==Pe.enforceActions||f(!1)}function se(e,t,n){var r=de(!0);pe(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Pe.runId;var i,o=Pe.trackingDerivation;if(Pe.trackingDerivation=e,!0===Pe.disableErrorBoundaries)i=t.call(n);else try{i=t.call(n)}catch(e){i=new ne(e)}return Pe.trackingDerivation=o,function(e){for(var t=e.observing,n=e.observing=e.newObserving,r=J.UP_TO_DATE,i=0,o=e.unboundDepsCount,s=0;sr&&(r=a.dependenciesState)}n.length=i,e.newObserving=null,o=t.length;for(;o--;){0===(a=t[o]).diffValue&&Me(a,e),a.diffValue=0}for(;i--;){var a;1===(a=n[i]).diffValue&&(a.diffValue=0,Ne(a,e))}r!==J.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}(e),fe(r),i}function ae(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)Me(t[n],e);e.dependenciesState=J.NOT_TRACKING}function ue(e){var t=ce();try{return e()}finally{le(t)}}function ce(){var e=Pe.trackingDerivation;return Pe.trackingDerivation=null,e}function le(e){Pe.trackingDerivation=e}function de(e){var t=Pe.allowStateReads;return Pe.allowStateReads=e,t}function fe(e){Pe.allowStateReads=e}function pe(e){if(e.dependenciesState!==J.UP_TO_DATE){e.dependenciesState=J.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=J.UP_TO_DATE}}var he=0,me=1,ge=Object.getOwnPropertyDescriptor((function(){}),"name");ge&&ge.configurable;function ye(e,t,n){var r=function(){return ve(e,t,n||this,arguments)};return r.isMobxAction=!0,r}function ve(e,t,n,r){var i=function(e,t,n){var r=0;var i=ce();je();var o=be(!0),s=de(!0),a={prevDerivation:i,prevAllowStateChanges:o,prevAllowStateReads:s,notifySpy:!1,startTime:r,actionId:me++,parentActionId:he};return he=a.actionId,a}();try{return t.apply(n,r)}catch(e){throw i.error=e,e}finally{!function(e){he!==e.actionId&&f("invalid action stack. did you forget to finish an action?");he=e.parentActionId,void 0!==e.error&&(Pe.suppressReactionErrors=!0);we(e.prevAllowStateChanges),fe(e.prevAllowStateReads),Be(),le(e.prevDerivation),e.notifySpy&&!1;Pe.suppressReactionErrors=!1}(i)}}function be(e){var t=Pe.allowStateChanges;return Pe.allowStateChanges=e,t}function we(e){Pe.allowStateChanges=e}var _e=function(e){function t(t,n,r,i,o){void 0===r&&(r="ObservableValue@"+d()),void 0===i&&(i=!0),void 0===o&&(o=O.default);var s=e.call(this,r)||this;return s.enhancer=n,s.name=r,s.equals=o,s.hasUnreportedChange=!1,s.value=n(t,void 0,r),s}return function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){this.value;if((e=this.prepareNewValue(e))!==Pe.UNCHANGED){0,this.setNewValue(e)}},t.prototype.prepareNewValue=function(e){if(oe(this),Tt(this)){var t=Ot(this,{object:this,type:"update",newValue:e});if(!t)return Pe.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?Pe.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),Pt(this)&&Mt(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return At(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),Nt(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return k(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(x),Ee=b("ObservableValue",_e),Se=function(){function e(e){this.dependenciesState=J.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=J.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+d(),this.value=new ne(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=X.NONE,p(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+d(),e.set&&(this.setter=ye(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?O.structural:O.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return e.prototype.onBecomeStale=function(){!function(e){if(e.lowestObserverState!==J.UP_TO_DATE)return;e.lowestObserverState=J.POSSIBLY_STALE,e.observers.forEach((function(t){t.dependenciesState===J.UP_TO_DATE&&(t.dependenciesState=J.POSSIBLY_STALE,t.isTracing!==X.NONE&&Ie(t,e),t.onBecomeStale())}))}(this)},e.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(e){return e()}))},e.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(e){return e()}))},e.prototype.get=function(){this.isComputing&&f("Cycle detected in computation "+this.name+": "+this.derivation),0!==Pe.inBatch||0!==this.observers.size||this.keepAlive?(Fe(this),ie(this)&&this.trackAndCompute()&&function(e){if(e.lowestObserverState===J.STALE)return;e.lowestObserverState=J.STALE,e.observers.forEach((function(t){t.dependenciesState===J.POSSIBLY_STALE?t.dependenciesState=J.STALE:t.dependenciesState===J.UP_TO_DATE&&(e.lowestObserverState=J.UP_TO_DATE)}))}(this)):ie(this)&&(this.warnAboutUntrackedRead(),je(),this.value=this.computeValue(!1),Be());var e=this.value;if(re(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(re(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){p(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else p(!1,!1)},e.prototype.trackAndCompute=function(){var e=this.value,t=this.dependenciesState===J.NOT_TRACKING,n=this.computeValue(!0),r=t||re(e)||re(n)||!this.equals(e,n);return r&&(this.value=n),r},e.prototype.computeValue=function(e){var t;if(this.isComputing=!0,Pe.computationDepth++,e)t=se(this,this.derivation,this.scope);else if(!0===Pe.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new ne(e)}return Pe.computationDepth--,this.isComputing=!1,t},e.prototype.suspend=function(){this.keepAlive||(ae(this),this.value=void 0)},e.prototype.observe=function(e,t){var n=this,r=!0,i=void 0;return Je((function(){var o=n.get();if(!r||t){var s=ce();e({type:"update",object:n,newValue:o,oldValue:i}),le(s)}r=!1,i=o}))},e.prototype.warnAboutUntrackedRead=function(){},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return k(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(),ke=b("ComputedValue",Se),Ce=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},xe={};function Te(){return"undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:xe}var Ae=!0,Oe=!1,Pe=function(){var e=Te();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ae=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ce).version&&(Ae=!1),Ae?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ce):(setTimeout((function(){Oe||f("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Ce)}();function Ne(e,t){e.observers.add(t),e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Me(e,t){e.observers.delete(t),0===e.observers.size&&Re(e)}function Re(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Pe.pendingUnobservations.push(e))}function je(){Pe.inBatch++}function Be(){if(0==--Pe.inBatch){Ve();for(var e=Pe.pendingUnobservations,t=0;t0&&Re(e),!1)}function Ie(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===X.BREAK){var n=[];!function e(t,n,r){if(n.length>=1e3)return void n.push("(and many more)");n.push(""+new Array(r).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,n,r+1)}))}(ut(e),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Se?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}var Le=function(){function e(e,t,n,r){void 0===e&&(e="Reaction@"+d()),void 0===r&&(r=!1),this.name=e,this.onInvalidate=t,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=J.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+d(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=X.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Pe.pendingReactions.push(this),Ve())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(je(),this._isScheduled=!1,ie(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(e){this.reportExceptionInDerivation(e)}}Be()}},e.prototype.track=function(e){if(!this.isDisposed){je();0,this._isRunning=!0;var t=se(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&ae(this),re(t)&&this.reportExceptionInDerivation(t.cause),Be()}},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Pe.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Pe.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Pe.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(je(),ae(this),Be()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[C]=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t0||Pe.isRunningReactions||De(Ue)}function Ue(){Pe.isRunningReactions=!0;for(var e=Pe.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r",e):2===arguments.length&&"function"==typeof t?ye(e,t):1===arguments.length&&"string"==typeof e?He(e):!0!==r?He(t).apply(null,arguments):void v(e,t,ye(e.name||t,n.value,this))};function Ke(e,t){"string"==typeof e||e.name;return ve(0,"function"==typeof e?e:t,this,void 0)}function Qe(e,t,n){v(e,t,ye(t,n.bind(e)))}function Je(e,t){void 0===t&&(t=l);var n,r=t&&t.name||e.name||"Autorun@"+d();if(!t.scheduler&&!t.delay)n=new Le(r,(function(){this.track(s)}),t.onError,t.requiresObservable);else{var i=Ze(t),o=!1;n=new Le(r,(function(){o||(o=!0,i((function(){o=!1,n.isDisposed||n.track(s)})))}),t.onError,t.requiresObservable)}function s(){e(n)}return n.schedule(),n.getDisposer()}Ye.bound=function(e,t,n,r){return!0===r?(Qe(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return Qe(this,t,n.value||n.initializer.call(this)),this[t]},set:Ge}:{enumerable:!1,configurable:!0,set:function(e){Qe(this,t,e)},get:function(){}}};var Xe=function(e){return e()};function Ze(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Xe}function et(e,t,n){void 0===n&&(n=l);var r,i,o,s=n.name||"Reaction@"+d(),a=Ye(s,n.onError?(r=n.onError,i=t,function(){try{return i.apply(this,arguments)}catch(e){r.call(this,e)}}):t),u=!n.scheduler&&!n.delay,c=Ze(n),f=!0,p=!1,h=n.compareStructural?O.structural:n.equals||O.default,m=new Le(s,(function(){f||u?g():p||(p=!0,c(g))}),n.onError,n.requiresObservable);function g(){if(p=!1,!m.isDisposed){var t=!1;m.track((function(){var n=e(m);t=f||!h(o,n),o=n})),f&&n.fireImmediately&&a(o,m),f||!0!==t||a(o,m),f&&(f=!1)}}return m.schedule(),m.getDisposer()}function tt(e,t,n){return nt("onBecomeUnobserved",e,t,n)}function nt(e,t,n,r){var i="function"==typeof r?en(t,n):en(t),o="function"==typeof r?r:n,s=e+"Listeners";return i[s]?i[s].add(o):i[s]=new Set([o]),"function"!=typeof i[e]?f(!1):function(){var e=i[s];e&&(e.delete(o),0===e.size&&delete i[s])}}function rt(e){var t=e.enforceActions,n=e.computedRequiresReaction,r=e.computedConfigurable,i=e.disableErrorBoundaries,o=e.reactionScheduler,s=e.reactionRequiresObservable,a=e.observableRequiresReaction;if(!0===e.isolateGlobalState&&((Pe.pendingReactions.length||Pe.inBatch||Pe.isRunningReactions)&&f("isolateGlobalState should be called before MobX is running any reactions"),Oe=!0,Ae&&(0==--Te().__mobxInstanceCount&&(Te().__mobxGlobals=void 0),Pe=new Ce)),void 0!==t){var u=void 0;switch(t){case!0:case"observed":u=!0;break;case!1:case"never":u=!1;break;case"strict":case"always":u="strict";break;default:f("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}Pe.enforceActions=u,Pe.allowStateChanges=!0!==u&&"strict"!==u}void 0!==n&&(Pe.computedRequiresReaction=!!n),void 0!==s&&(Pe.reactionRequiresObservable=!!s),void 0!==a&&(Pe.observableRequiresReaction=!!a,Pe.allowStateReads=!Pe.observableRequiresReaction),void 0!==r&&(Pe.computedConfigurable=!!r),void 0!==i&&(!0===i&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),Pe.disableErrorBoundaries=!!i),o&&qe(o)}function it(e,t){var n="function"==typeof e?e.prototype:e,r=function(e){var r=t[e];Array.isArray(r)||(r=[r]);var i=Object.getOwnPropertyDescriptor(n,e),o=r.reduce((function(t,r){return r(n,e,t)}),i);o&&Object.defineProperty(n,e,o)};for(var i in t)r(i);return e}function ot(e,t,n,r){var i=st(r=z(r));return B(e),Yt(e,r.name,i.enhancer),t&&at(e,t,n,i),e}function st(e){return e.defaultDecorator||(!1===e.deep?G:q)}function at(e,t,n,r){var i,o;je();try{var a=E(t);try{for(var u=s(a),c=u.next();!c.done;c=u.next()){var l=c.value,d=Object.getOwnPropertyDescriptor(t,l);0;var f=(n&&l in n?n[l]:d.get?Z:r)(e,l,d,!0);f&&Object.defineProperty(e,l,f)}}catch(e){i={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}finally{Be()}}function ut(e,t){return ct(en(e,t))}function ct(e){var t,n,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(t=e.observing,n=[],t.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),n).map(ct)),r}function lt(){this.message="FLOW_CANCELLED"}function dt(e,t){return null!=e&&(void 0!==t?!!Zt(e)&&e[C].values.has(t):Zt(e)||!!e[C]||T(e)||ze(e)||ke(e))}function ft(e){return 1!==arguments.length&&f(!1),dt(e)}function pt(e){return Zt(e)?e[C].getKeys():qt(e)||Ht(e)?Array.from(e.keys()):Dt(e)?e.map((function(e,t){return t})):f(!1)}function ht(e,t,n,r){return"function"==typeof n?function(e,t,n,r){return tn(e,t).observe(n,r)}(e,t,n,r):function(e,t,n){return tn(e).observe(t,n)}(e,t,n)}lt.prototype=Object.create(Error.prototype);var mt={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function gt(e,t,n,r){return r.detectCycles&&e.set(t,n),n}function yt(e,t){var n;return"boolean"==typeof t&&(t={detectCycles:t}),t||(t=mt),t.detectCycles=void 0===t.detectCycles?!0===t.recurseEverything:!0===t.detectCycles,t.detectCycles&&(n=new Map),function e(t,n,r){if(!n.recurseEverything&&!ft(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(Ee(t))return e(t.get(),n,r);if(ft(t)&&pt(t),!0===n.detectCycles&&null!==t&&r.has(t))return r.get(t);if(Dt(t)||Array.isArray(t)){var i=gt(r,t,[],n),o=t.map((function(t){return e(t,n,r)}));i.length=o.length;for(var s=0,a=o.length;s=0,"Not a valid index: '"+n+"'"),je(),n>=t.length&&(t.length=n+1),t[n]=r,Be()}else{je();var s=n;try{for(var a in s)e(t,a,s[a])}finally{Be()}}}(e,t,n),!0)},deleteProperty:function(e,t){return!!kt(t)&&(St(e).remove(t),!0)},ownKeys:function(e){return St(e).keysAtom.reportObserved(),Reflect.ownKeys(e)},preventExtensions:function(e){return f("Dynamic observable objects cannot be frozen"),!1}};function xt(e){var t=new Proxy(e,Ct);return e[C].proxy=t,t}function Tt(e){return void 0!==e.interceptors&&e.interceptors.length>0}function At(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),h((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function Ot(e,t){var n=ce();try{for(var r=u(e.interceptors||[]),i=0,o=r.length;i0}function Nt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),h((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function Mt(e,t){var n=ce(),r=e.changeListeners;if(r){for(var i=0,o=(r=r.slice()).length;i0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return At(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Nt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;ri?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=c),Tt(this)){var o=Ot(this,{object:this.proxy,type:"splice",index:e,removedCount:t,added:n});if(!o)return c;t=o.removedCount,n=o.added}n=0===n.length?n:n.map((function(e){return r.enhancer(e,void 0)}));var s=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,u([e,t],n));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),i},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&!1,i=Pt(this),o=i||r?{object:this.proxy,type:"update",index:e,newValue:t,oldValue:n}:null;this.atom.reportChanged(),i&&Mt(this,o)},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&!1,i=Pt(this),o=i||r?{object:this.proxy,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom.reportChanged(),i&&Mt(this,o)},e}(),Ft={intercept:function(e){return this[C].intercept(e)},observe:function(e,t){return void 0===t&&(t=!1),this[C].observe(e,t)},clear:function(){return this.splice(0)},replace:function(e){var t=this[C];return t.spliceWithArray(0,t.values.length,e)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(e,t){for(var n=[],r=2;r-1&&(this.splice(n,1),!0)},get:function(e){var t=this[C];if(t){if(e=0&&r++}t=on(t),n=on(n);var u="[object Array]"===a;if(!u){if("object"!=typeof t||"object"!=typeof n)return!1;var c=t.constructor,l=n.constructor;if(c!==l&&!("function"==typeof c&&c instanceof c&&"function"==typeof l&&l instanceof l)&&"constructor"in t&&"constructor"in n)return!1}if(0===r)return!1;r<0&&(r=-1);o=o||[];var d=(i=i||[]).length;for(;d--;)if(i[d]===t)return o[d]===n;if(i.push(t),o.push(n),u){if((d=t.length)!==n.length)return!1;for(;d--;)if(!e(t[d],n[d],r-1,i,o))return!1}else{var f=Object.keys(t),p=void 0;if(d=f.length,Object.keys(n).length!==d)return!1;for(;d--;)if(p=f[d],!sn(n,p)||!e(t[p],n[p],r-1,i,o))return!1}return i.pop(),o.pop(),!0}(e,t,n)}function on(e){return Dt(e)?e.slice():w(e)||qt(e)||_(e)||Ht(e)?Array.from(e.entries()):e}function sn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function an(e){return e[Symbol.iterator]=un,e}function un(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:We,extras:{getDebugName:function(e,t){return(void 0!==t?en(e,t):Zt(e)||qt(e)||Ht(e)?tn(e):en(e)).name}},$mobx:C})}).call(this,n(19),n(30))},,,,function(e,t,n){(function(r){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(29)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(19))},,,,,,,,,function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(28)},,,,,,,,,function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),s=Math.max(i,o),a=0,u=e.map([t,n],(function(t){var n=s-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(u[0][s]>u[1][s])return 1;if(u[0][s]===u[1][s]){if(s===a)return 0;s-=1}else if(u[0][s]1?i-1:0),s=1;s0){var s=Object.keys(n),u=a.default.find(s,(function(e){return t.isOS(e)}));if(u){var c=this.satisfies(n[u]);if(void 0!==c)return c}var l=a.default.find(s,(function(e){return t.isPlatform(e)}));if(l){var d=this.satisfies(n[l]);if(void 0!==d)return d}}if(o>0){var f=Object.keys(i),p=a.default.find(f,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(a.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e){return this.isBrowser(e)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=c,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?) Version\//],describe:function(e){var t=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return{name:o.OS_MAP.iOS,version:t}}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:o.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:o.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:o.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?) Version\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=s,e.exports=t.default}})},function(e,t,n){ /*! * SkyWay Copyright(c) 2020 NTT Communications Corporation * peerjs Copyright(c) 2013 Michelle Bu @@ -147,7 +133,7 @@ var r;window,r=function(){return function(e){var t={};function n(r){if(t[r])retu !*** ./node_modules/engine.io-parser/lib/browser.js ***! \******************************************************/ /*! no static exports found */ -/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var r,i=n(/*! ./keys */"./node_modules/engine.io-parser/lib/keys.js"),o=n(/*! has-binary2 */"./node_modules/has-binary2/index.js"),s=n(/*! arraybuffer.slice */"./node_modules/arraybuffer.slice/index.js"),a=n(/*! after */"./node_modules/after/index.js"),u=n(/*! ./utf8 */"./node_modules/engine.io-parser/lib/utf8.js");"undefined"!=typeof ArrayBuffer&&(r=n(/*! base64-arraybuffer */"./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js"));var c="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),l="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),d=c||l;t.protocol=3;var f=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},p=i(f),h={type:"error",data:"parser error"},m=n(/*! blob */"./node_modules/blob/index.js");function y(e,t,n){for(var r=new Array(e.length),i=a(e.length,n),o=function(e,n,i){t(n,(function(t,n){r[e]=n,i(t,r)}))},s=0;s1?{type:p[i],data:e.substring(1)}:{type:p[i]}:h}i=new Uint8Array(e)[0];var o=s(e,1);return m&&"blob"===n&&(o=new m([o])),{type:p[i],data:o}},t.decodeBase64Packet=function(e,t){var n=p[e.charAt(0)];if(!r)return{type:n,data:{base64:!0,data:e.substr(1)}};var i=r.decode(e.substr(1));return"blob"===t&&m&&(i=new m([i])),{type:n,data:i}},t.encodePayload=function(e,n,r){"function"==typeof n&&(r=n,n=null);var i=o(e);return n&&i?m&&!d?t.encodePayloadAsBlob(e,r):t.encodePayloadAsArrayBuffer(e,r):e.length?void y(e,(function(e,r){t.encodePacket(e,!!i&&n,!1,(function(e){r(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return r(t.join(""))})):r("0:")},t.decodePayload=function(e,n,r){if("string"!=typeof e)return t.decodePayloadAsBinary(e,n,r);var i;if("function"==typeof n&&(r=n,n=null),""===e)return r(h,0,1);for(var o,s,a="",u=0,c=e.length;u0;){for(var a=new Uint8Array(i),u=0===a[0],c="",l=1;255!==a[l];l++){if(c.length>310)return r(h,0,1);c+=a[l]}i=s(i,2+c.length),c=parseInt(c);var d=s(i,0,c);if(u)try{d=String.fromCharCode.apply(null,new Uint8Array(d))}catch(e){var f=new Uint8Array(d);for(d="",l=0;l1?{type:p[i],data:e.substring(1)}:{type:p[i]}:h}i=new Uint8Array(e)[0];var o=s(e,1);return m&&"blob"===n&&(o=new m([o])),{type:p[i],data:o}},t.decodeBase64Packet=function(e,t){var n=p[e.charAt(0)];if(!r)return{type:n,data:{base64:!0,data:e.substr(1)}};var i=r.decode(e.substr(1));return"blob"===t&&m&&(i=new m([i])),{type:n,data:i}},t.encodePayload=function(e,n,r){"function"==typeof n&&(r=n,n=null);var i=o(e);return n&&i?m&&!d?t.encodePayloadAsBlob(e,r):t.encodePayloadAsArrayBuffer(e,r):e.length?void g(e,(function(e,r){t.encodePacket(e,!!i&&n,!1,(function(e){r(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return r(t.join(""))})):r("0:")},t.decodePayload=function(e,n,r){if("string"!=typeof e)return t.decodePayloadAsBinary(e,n,r);var i;if("function"==typeof n&&(r=n,n=null),""===e)return r(h,0,1);for(var o,s,a="",u=0,c=e.length;u0;){for(var a=new Uint8Array(i),u=0===a[0],c="",l=1;255!==a[l];l++){if(c.length>310)return r(h,0,1);c+=a[l]}i=s(i,2+c.length),c=parseInt(c);var d=s(i,0,c);if(u)try{d=String.fromCharCode.apply(null,new Uint8Array(d))}catch(e){var f=new Uint8Array(d);for(d="",l=0;l * @license MIT */ -var r=n(/*! base64-js */"./node_modules/base64-js/index.js"),i=n(/*! ieee754 */"./node_modules/ieee754/index.js"),o=n(/*! isarray */"./node_modules/node-libs-browser/node_modules/isarray/index.js");function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return D(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return x(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=n;oa&&(n=a-u),o=n;o>=0;o--){for(var d=!0,f=0;fi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function x(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;ri)&&(n=i);for(var o="",s=t;sn)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function j(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,o){return o||B(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function I(e,t,n,r,o){return o||B(e,0,n,8),i.write(e,t,n,r,52,8),n+8}t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return d(null,e)},u.allocUnsafeSlow=function(e){return d(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(r,i),l=e.slice(t,n),d=0;di)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return I(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return I(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(/*! ./../../../webpack/buildin/global.js */"./node_modules/webpack/buildin/global.js"))},"./node_modules/node-libs-browser/node_modules/isarray/index.js": +var r=n(/*! base64-js */"./node_modules/base64-js/index.js"),i=n(/*! ieee754 */"./node_modules/ieee754/index.js"),o=n(/*! isarray */"./node_modules/node-libs-browser/node_modules/isarray/index.js");function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(r)return D(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return x(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=n;oa&&(n=a-u),o=n;o>=0;o--){for(var d=!0,f=0;fi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function x(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;ri)&&(n=i);for(var o="",s=t;sn)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function j(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,o){return o||B(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function I(e,t,n,r,o){return o||B(e,0,n,8),i.write(e,t,n,r,52,8),n+8}t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return d(null,e)},u.allocUnsafeSlow=function(e){return d(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(r,i),l=e.slice(t,n),d=0;di)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return I(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return I(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function V(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(/*! ./../../../webpack/buildin/global.js */"./node_modules/webpack/buildin/global.js"))},"./node_modules/node-libs-browser/node_modules/isarray/index.js": /*!**********************************************************************!*\ !*** ./node_modules/node-libs-browser/node_modules/isarray/index.js ***! \**********************************************************************/ @@ -303,7 +289,7 @@ var r=n(/*! base64-js */"./node_modules/base64-js/index.js"),i=n(/*! ieee754 */" !*** ./node_modules/sdp-interop/lib/interop.js ***! \*************************************************/ /*! no static exports found */ -/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";var r=n(/*! ./transform */"./node_modules/sdp-interop/lib/transform.js"),i=n(/*! ./array-equals */"./node_modules/sdp-interop/lib/array-equals.js");function o(){this.cache={mlB2UMap:{},mlU2BMap:{}}}e.exports=o,o.prototype.candidateToUnifiedPlan=function(e){var t=new RTCIceCandidate(e);return t.sdpMLineIndex=this.cache.mlB2UMap[t.sdpMLineIndex],t},o.prototype.candidateToPlanB=function(e){var t=new RTCIceCandidate(e);if(0===t.sdpMid.indexOf("audio"))t.sdpMid="audio";else{if(0!==t.sdpMid.indexOf("video"))throw new Error("candidate with "+t.sdpMid+" not allowed");t.sdpMid="video"}return t.sdpMLineIndex=this.cache.mlU2BMap[t.sdpMLineIndex],t},o.prototype.getFirstSendingIndexFromAnswer=function(e){if(!this.cache.answer)return null;var t=r.parse(this.cache.answer);if(t&&t.media&&Array.isArray(t.media))for(var n=0;n3||!n.media.every((function(e){return-1!==["video","audio","data"].indexOf(e.mid)})))return console.warn("This description does not look like Plan B."),e;var o=[];n.media.forEach((function(e){o.push(e.mid)}));var s,a=!1;if(void 0!==n.groups&&Array.isArray(n.groups)&&(a=n.groups.every((function(e){return"BUNDLE"!==e.type||i.apply(e.mids.sort(),[o.sort()])}))),!a)throw new Error("Cannot convert to Unified Plan because m-lines that are not bundled were found.");void 0!==this.cache[e.type]&&(s=r.parse(this.cache[e.type]));var u={audio:{},video:{}},c={},l=0,d=0;if(n.media.forEach((function(n){if(("string"!=typeof n.rtcpMux||"rtcp-mux"!==n.rtcpMux)&&"inactive"!==n.direction)throw new Error("Cannot convert to Unified Plan because m-lines without the rtcp-mux attribute were found.");if("application"!==n.type){var r=n.sources,i=n.ssrcGroups,o=n.candidates,a=n.iceUfrag,f=n.icePwd,p=n.fingerprint,h=n.port;delete n.sources,delete n.ssrcGroups,delete n.candidates,delete n.iceUfrag,delete n.icePwd,delete n.fingerprint,delete n.port,delete n.mid;var m={};void 0!==i&&Array.isArray(i)&&i.forEach((function(e){"SIM"!==e.semantics&&void 0!==e.ssrcs&&Array.isArray(e.ssrcs)&&e.ssrcs.forEach((function(t){void 0===m[t]&&(m[t]=[]),m[t].push(e)}))}));var y={};"object"==typeof r&&Object.keys(r).forEach((function(i){var g;if("offer"!==e.type||r[i].msid)if(void 0!==m[i]&&Array.isArray(m[i])&&m[i].some((function(e){return e.ssrcs.some((function(e){if("object"==typeof y[e])return g=y[e],!0}))})),"object"==typeof g)g.sources[i]=r[i],delete r[i].msid;else{if(g=Object.create(n),y[i]=g,void 0!==r[i].msid&&(g.msid=r[i].msid,delete r[i].msid),g.sources={},g.sources[i]=r[i],g.ssrcGroups=m[i],void 0!==s&&void 0!==s.media&&Array.isArray(s.media)&&s.media.forEach((function(e){"object"==typeof e.sources&&Object.keys(e.sources).forEach((function(t){t===i&&(g.mid=e.mid)}))})),void 0===g.mid){if("answer"===e.type)throw new Error("An unmapped SSRC was found.");g.mid=[n.type,"-",i].join("")}g.candidates=o,g.iceUfrag=a,g.icePwd=f,g.fingerprint=p,g.port=h,c[g.mid]=g,t.cache.mlU2BMap[d]=l,void 0===t.cache.mlB2UMap[l]&&(t.cache.mlB2UMap[l]=d),d++}else u[n.type][i]=r[i]})),l++}else c[n.mid]=n})),n.media=[],o=[],"answer"===e.type)for(var f=0;f0&&null===(r=t.getFirstSendingIndexFromAnswer(e)))for(var i=0;ir){var o=n.media[r];Object.keys(u[e]).forEach((function(t){o.sources&&o.sources[t]&&console.warn("Replacing an existing SSRC."),o.sources||(o.sources={}),o.sources[t]=u[e][t]}))}}})),n.groups.some((function(e){if("BUNDLE"===e.type)return e.mids=o.join(" "),!0})),n.msidSemantic={semantic:"WMS",token:"*"};var h=r.write(n);return this.cache[e.type]=h,new RTCSessionDescription({type:e.type,sdp:h})};var s={inactive:0,recvonly:1,sendonly:2,sendrecv:3}},"./node_modules/sdp-interop/lib/transform.js": +/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";var r=n(/*! ./transform */"./node_modules/sdp-interop/lib/transform.js"),i=n(/*! ./array-equals */"./node_modules/sdp-interop/lib/array-equals.js");function o(){this.cache={mlB2UMap:{},mlU2BMap:{}}}e.exports=o,o.prototype.candidateToUnifiedPlan=function(e){var t=new RTCIceCandidate(e);return t.sdpMLineIndex=this.cache.mlB2UMap[t.sdpMLineIndex],t},o.prototype.candidateToPlanB=function(e){var t=new RTCIceCandidate(e);if(0===t.sdpMid.indexOf("audio"))t.sdpMid="audio";else{if(0!==t.sdpMid.indexOf("video"))throw new Error("candidate with "+t.sdpMid+" not allowed");t.sdpMid="video"}return t.sdpMLineIndex=this.cache.mlU2BMap[t.sdpMLineIndex],t},o.prototype.getFirstSendingIndexFromAnswer=function(e){if(!this.cache.answer)return null;var t=r.parse(this.cache.answer);if(t&&t.media&&Array.isArray(t.media))for(var n=0;n3||!n.media.every((function(e){return-1!==["video","audio","data"].indexOf(e.mid)})))return console.warn("This description does not look like Plan B."),e;var o=[];n.media.forEach((function(e){o.push(e.mid)}));var s,a=!1;if(void 0!==n.groups&&Array.isArray(n.groups)&&(a=n.groups.every((function(e){return"BUNDLE"!==e.type||i.apply(e.mids.sort(),[o.sort()])}))),!a)throw new Error("Cannot convert to Unified Plan because m-lines that are not bundled were found.");void 0!==this.cache[e.type]&&(s=r.parse(this.cache[e.type]));var u={audio:{},video:{}},c={},l=0,d=0;if(n.media.forEach((function(n){if(("string"!=typeof n.rtcpMux||"rtcp-mux"!==n.rtcpMux)&&"inactive"!==n.direction)throw new Error("Cannot convert to Unified Plan because m-lines without the rtcp-mux attribute were found.");if("application"!==n.type){var r=n.sources,i=n.ssrcGroups,o=n.candidates,a=n.iceUfrag,f=n.icePwd,p=n.fingerprint,h=n.port;delete n.sources,delete n.ssrcGroups,delete n.candidates,delete n.iceUfrag,delete n.icePwd,delete n.fingerprint,delete n.port,delete n.mid;var m={};void 0!==i&&Array.isArray(i)&&i.forEach((function(e){"SIM"!==e.semantics&&void 0!==e.ssrcs&&Array.isArray(e.ssrcs)&&e.ssrcs.forEach((function(t){void 0===m[t]&&(m[t]=[]),m[t].push(e)}))}));var g={};"object"==typeof r&&Object.keys(r).forEach((function(i){var y;if("offer"!==e.type||r[i].msid)if(void 0!==m[i]&&Array.isArray(m[i])&&m[i].some((function(e){return e.ssrcs.some((function(e){if("object"==typeof g[e])return y=g[e],!0}))})),"object"==typeof y)y.sources[i]=r[i],delete r[i].msid;else{if(y=Object.create(n),g[i]=y,void 0!==r[i].msid&&(y.msid=r[i].msid,delete r[i].msid),y.sources={},y.sources[i]=r[i],y.ssrcGroups=m[i],void 0!==s&&void 0!==s.media&&Array.isArray(s.media)&&s.media.forEach((function(e){"object"==typeof e.sources&&Object.keys(e.sources).forEach((function(t){t===i&&(y.mid=e.mid)}))})),void 0===y.mid){if("answer"===e.type)throw new Error("An unmapped SSRC was found.");y.mid=[n.type,"-",i].join("")}y.candidates=o,y.iceUfrag=a,y.icePwd=f,y.fingerprint=p,y.port=h,c[y.mid]=y,t.cache.mlU2BMap[d]=l,void 0===t.cache.mlB2UMap[l]&&(t.cache.mlB2UMap[l]=d),d++}else u[n.type][i]=r[i]})),l++}else c[n.mid]=n})),n.media=[],o=[],"answer"===e.type)for(var f=0;f0&&null===(r=t.getFirstSendingIndexFromAnswer(e)))for(var i=0;ir){var o=n.media[r];Object.keys(u[e]).forEach((function(t){o.sources&&o.sources[t]&&console.warn("Replacing an existing SSRC."),o.sources||(o.sources={}),o.sources[t]=u[e][t]}))}}})),n.groups.some((function(e){if("BUNDLE"===e.type)return e.mids=o.join(" "),!0})),n.msidSemantic={semantic:"WMS",token:"*"};var h=r.write(n);return this.cache[e.type]=h,new RTCSessionDescription({type:e.type,sdp:h})};var s={inactive:0,recvonly:1,sendonly:2,sendrecv:3}},"./node_modules/sdp-interop/lib/transform.js": /*!***************************************************!*\ !*** ./node_modules/sdp-interop/lib/transform.js ***! \***************************************************/ @@ -368,7 +354,7 @@ var r=n(/*! base64-js */"./node_modules/base64-js/index.js"),i=n(/*! ieee754 */" !*** ./node_modules/socket.io-client/lib/socket.js ***! \*****************************************************/ /*! no static exports found */ -/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var r=n(/*! socket.io-parser */"./node_modules/socket.io-parser/index.js"),i=n(/*! component-emitter */"./node_modules/component-emitter/index.js"),o=n(/*! to-array */"./node_modules/to-array/index.js"),s=n(/*! ./on */"./node_modules/socket.io-client/lib/on.js"),a=n(/*! component-bind */"./node_modules/component-bind/index.js"),u=n(/*! debug */"./node_modules/debug/src/browser.js")("socket.io-client:socket"),c=n(/*! parseqs */"./node_modules/parseqs/index.js"),l=n(/*! has-binary2 */"./node_modules/has-binary2/index.js");e.exports=p;var d={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},f=i.prototype.emit;function p(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}i(p.prototype),p.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[s(e,"open",a(this,"onopen")),s(e,"packet",a(this,"onpacket")),s(e,"close",a(this,"onclose"))]}},p.prototype.open=p.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},p.prototype.send=function(){var e=o(arguments);return e.unshift("message"),this.emit.apply(this,e),this},p.prototype.emit=function(e){if(d.hasOwnProperty(e))return f.apply(this,arguments),this;var t=o(arguments),n={type:(void 0!==this.flags.binary?this.flags.binary:l(t))?r.BINARY_EVENT:r.EVENT,data:t,options:{}};return n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(u("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this.flags={},this},p.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},p.prototype.onopen=function(){if(u("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?c.encode(this.query):this.query;u("sending connect packet with query %s",e),this.packet({type:r.CONNECT,query:e})}else this.packet({type:r.CONNECT})},p.prototype.onclose=function(e){u("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},p.prototype.onpacket=function(e){var t=e.nsp===this.nsp,n=e.type===r.ERROR&&"/"===e.nsp;if(t||n)switch(e.type){case r.CONNECT:this.onconnect();break;case r.EVENT:case r.BINARY_EVENT:this.onevent(e);break;case r.ACK:case r.BINARY_ACK:this.onack(e);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",e.data)}},p.prototype.onevent=function(e){var t=e.data||[];u("emitting event %j",t),null!=e.id&&(u("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?f.apply(this,t):this.receiveBuffer.push(t)},p.prototype.ack=function(e){var t=this,n=!1;return function(){if(!n){n=!0;var i=o(arguments);u("sending ack %j",i),t.packet({type:l(i)?r.BINARY_ACK:r.ACK,id:e,data:i})}}},p.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(u("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):u("bad ack %s",e.id)},p.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},p.prototype.emitBuffered=function(){var e;for(e=0;e=f.WARN.value&&console.warn("SkyWay: ",...e)}error(...e){this._logLevel>=f.ERROR.value&&console.error("SkyWay: ",...e)}log(...e){this._logLevel>=f.FULL.value&&console.log("SkyWay: ",...e)}},h=n("./package.json");class m extends i.a{constructor(e,t){if(super(),this._isOpen=!1,this._isPeerIdSet=!1,this._queue=[],this._io=null,this._key=e,this._reconnectAttempts=0,t.host&&t.port){const e=t.secure?"https://":"http://";this.signalingServerUrl=`${e}${t.host}:${t.port}`}else{const e=t.dispatcherHost||d.DISPATCHER_HOST,n=t.dispatcherPort||d.DISPATCHER_PORT,r=t.dispatcherSecure||d.DISPATCHER_SECURE?"https://":"http://";this._dispatcherUrl=`${r}${e}:${n}/signaling`}}get isOpen(){return Boolean(this._io&&this._io.connected&&this._isOpen)}async start(e,t,n){let r=`apiKey=${this._key}&token=${t}`+`&platform=javascript&sdk_version=${h.version}`;if(e&&(r+=`&peerId=${e}`,this._isPeerIdSet=!0),n&&(r+=`&credential=${encodeURIComponent(JSON.stringify(n))}`),this._dispatcherUrl){let e;try{e=await this._getSignalingServer()}catch(e){return void this.emit("error",e)}const t=e.secure?"https://":"http://";this.signalingServerUrl=`${t}${e.host}:${e.port}`}this._io=u()(this.signalingServerUrl,{"force new connection":!0,query:r,reconnectionAttempts:d.reconnectionAttempts}),this._io.on("reconnect_failed",()=>{this._stopPings(),this._connectToNewServer()}),this._io.on("error",e=>{p.error(e)}),this._setupMessageHandlers()}async _connectToNewServer(e=0){if(e>=10||this._reconnectAttempts>=d.numberServersToTry)return void this.emit("error","Could not connect to server.");let t;try{t=await this._getSignalingServer()}catch(e){return void this.emit("error",e)}if(-1===this.signalingServerUrl.indexOf(t.host)){const e=t.secure?"https://":"http://";this.signalingServerUrl=`${e}${t.host}:${t.port}`,this._io.io.uri=this.signalingServerUrl,this._io.connect(),this._reconnectAttempts++}else this._connectToNewServer(++e)}_getSignalingServer(){return new Promise((e,t)=>{const n=new XMLHttpRequest;n.timeout=d.DISPATCHER_TIMEOUT,n.open("GET",this._dispatcherUrl,!0),n.onerror=()=>{t(new Error("There was a problem with the request for the dispatcher. Check your peer options and network connections."))},n.onabort=()=>{t(new Error("The request for the dispatcher was aborted."))},n.ontimeout=()=>{t(new Error("The request for the dispatcher timed out. Check your firewall, network speed, SkyWay failure information"))},n.onload=()=>{if(200===n.status)try{const r=JSON.parse(n.responseText);if(r&&r.domain)return void e({host:r.domain,port:443,secure:!0});t(new Error("The dispatcher server returned an invalid JSON response. have no signaling server domain in JSON."))}catch(e){t(new Error("The dispatcher server returned an invalid JSON response."))}else t(new Error("Connection failed. Unexpected response: "+n.status))},n.send(null)})}send(e,t){e?this.isOpen?!0===this._io.connected&&this._io.emit(e,t):this._queue.push({type:e,message:t}):this._io.emit("error","Invalid message")}close(){this.isOpen&&(this._stopPings(),this._io.disconnect(),this._isOpen=!1)}reconnect(){this._io.connect()}updateCredential(e){const t=l.a.parse(this._io.io.opts.query);t.credential?t.credential=encodeURIComponent(JSON.stringify(e)):p.warn("Adding a credential when one wasn't specified before."),this._io.io.opts.query=l.a.stringify(t),this.send(d.MESSAGE_TYPES.CLIENT.UPDATE_CREDENTIAL.key,e)}_setupMessageHandlers(){d.MESSAGE_TYPES.SERVER.enums.forEach(e=>{e.key===d.MESSAGE_TYPES.SERVER.OPEN.key?this._io.on(e.key,t=>{t&&t.peerId&&(this._isPeerIdSet||(this._io.io.opts.query+=`&peerId=${t.peerId}`,this._isPeerIdSet=!0),this._reconnectAttempts=0,this._startPings(),this._sendQueuedMessages(),this._isOpen||(this._isOpen=!0,this.emit(e.key,t)))}):this._io.on(e.key,t=>{this.emit(e.key,t)})})}_sendQueuedMessages(){for(const e of this._queue)this.send(e.type,e.message);this._queue=[]}_startPings(){this._pingIntervalId||(this._pingIntervalId=setInterval(()=>{this.send(d.MESSAGE_TYPES.CLIENT.PING.key)},d.pingInterval))}_stopPings(){clearInterval(this._pingIntervalId),this._pingIntervalId=void 0}}var y=m,g=n("./node_modules/sdp-transform/lib/index.js"),v=n.n(g),b=n("./node_modules/sdp-interop/lib/index.js"),w=new class{unifiedToPlanB(e){const t=(new b.Interop).toPlanB(e).sdp,n=new Set,r=/a=ssrc:\d+ msid:(\w+)/g;let i;for(;i=r.exec(t);)n.add(i[1]);const o=t.replace("a=msid-semantic:WMS *",`a=msid-semantic:WMS ${Array.from(n).join(" ")}`);return new RTCSessionDescription({type:"offer",sdp:o})}addVideoBandwidth(e,t){return this._validateBandwidth(t),this._addBandwidth(e,t,"video")}addAudioBandwidth(e,t){return this._validateBandwidth(t),this._addBandwidth(e,t,"audio")}filterVideoCodec(e,t){return this._filterCodec(e,t,"video")}filterAudioCodec(e,t){return this._filterCodec(e,t,"audio")}ensureUnifiedPlan(e){return e.split("\r\n").map(e=>e.startsWith("a=msid-semantic")?"a=msid-semantic:WMS *":e).join("\r\n")}_filterCodec(e,t,n){if(void 0===t)throw new Error("codec is not passed");const r=v.a.parse(e);return r.media=r.media.map(e=>{if(e.type===n){e.rtp=e.rtp.filter(e=>e.codec===t);const n=e.rtp.reduce((e,t)=>[...e,t.payload],[]);if(0===e.rtp.length)throw new Error(`${t} does not exist`);e.fmtp&&(e.fmtp=e.fmtp.filter(e=>n.includes(e.payload))),e.rtcpFb&&(e.rtcpFb=e.rtcpFb.filter(e=>n.includes(e.payload))),e.payloads=n.join(" ")}return e}),v.a.write(r)}_addBandwidth(e,t,n){const r=v.a.parse(e);return r.media=r.media.map(e=>(e.type===n&&(e.bandwidth=[{type:"AS",limit:t.toString()},{type:"TIAS",limit:(1e3*t).toString()}]),e)),v.a.write(r)}_validateBandwidth(e){if(void 0===e)throw new Error("bandwidth is not passed");if(!/^\d+$/.test(e))throw new Error(`${e} is not a number`)}};const _=new s.a(["addStream","dcCreated","offerCreated","answerCreated","iceCandidate","iceConnectionFailed","negotiationNeeded","error"]);class E extends i.a{constructor(){super(),this._offerQueue=[],this._isExpectingAnswer=!1,this._replaceStreamCalled=!1,this._isNegotiationAllowed=!0,this.hasRemoteDescription=!1}async startConnection(e={}){if(this._pc=this._createPeerConnection(e.pcConfig),this._setupPCListeners(),this.originator=e.originator,this._audioBandwidth=e.audioBandwidth,this._videoBandwidth=e.videoBandwidth,this._audioCodec=e.audioCodec,this._videoCodec=e.videoCodec,this._type=e.type,"media"===this._type)if(e.stream){const t=e.stream.getVideoTracks(),n=e.stream.getAudioTracks(),r=this._getReceiveOnlyState(e);t.length>0?t.forEach(t=>this._pc.addTrack(t,e.stream)):r.video&&this._pc.addTransceiver("video",{direction:"recvonly"}),n.length>0?n.forEach(t=>this._pc.addTrack(t,e.stream)):r.audio&&this._pc.addTransceiver("audio",{direction:"recvonly"})}else this.originator&&(this._pc.addTransceiver("audio",{direction:"recvonly"}),this._pc.addTransceiver("video",{direction:"recvonly"}));if(this.originator){if("data"===this._type){const t=e.label||"",n=e.dcInit||{},r=this._pc.createDataChannel(t,n);this.emit(E.EVENTS.dcCreated.key,r)}}else await this.handleOffer(e.offer)}replaceStream(e){if(!this._pc)return;this._isNegotiationAllowed=!0;const t=this,n=e.getVideoTracks(),r=e.getAudioTracks(),i=this._pc.getSenders(),o=i.find(e=>e.track&&"video"===e.track.kind),s=i.find(e=>e.track&&"audio"===e.track.kind);function a(e,n,r){void 0===n&&void 0===e||(void 0!==n?void 0!==e?e.track.id!==n.id&&e.replaceTrack(n):t._pc.addTrack(n,r):t._pc.removeTrack(e))}a(o,n[0],e),a(s,r[0],e)}async handleOffer(e){if(this._lastOffer&&e&&this._lastOffer.sdp===e.sdp)return;if(this._isNegotiationAllowed=!0,e||(e=this._lastOffer),this._lastOffer=e,"have-remote-offer"===this._pc.signalingState)return void this._offerQueue.push(e);await this._setRemoteDescription(e);const t=await this._makeAnswerSdp().catch(e=>p.error(e));this.emit(E.EVENTS.answerCreated.key,t)}async handleAnswer(e){this._isNegotiationAllowed=!0,this._isExpectingAnswer?(await this._setRemoteDescription(e),this._isExpectingAnswer=!1):this._pc.onnegotiationneeded&&this._pc.onnegotiationneeded()}async handleCandidate(e){await this._pc.addIceCandidate(new RTCIceCandidate(e)).then(()=>p.log("Successfully added ICE candidate")).catch(e=>p.error("Failed to add ICE candidate",e))}cleanup(){p.log("Cleaning up PeerConnection"),!this._pc||"closed"===this._pc.readyState&&"closed"===this._pc.signalingState||this._pc.close(),this._pc=null}_createPeerConnection(e={}){return p.log("Creating RTCPeerConnection"),e.sdpSemantics="unified-plan",new RTCPeerConnection(e)}_setupPCListeners(){const e=this._pc;e.ontrack=e=>{p.log("Received remote media stream track"),e.streams.forEach(e=>{this.emit(E.EVENTS.addStream.key,e)})},e.ondatachannel=e=>{p.log("Received data channel");const t=e.channel;this.emit(E.EVENTS.dcCreated.key,t)},e.onicecandidate=e=>{e.candidate&&""!==e.candidate.candidate?(p.log("Generated ICE candidate for:",e.candidate),this.emit(E.EVENTS.iceCandidate.key,e.candidate)):p.log("ICE candidates gathering complete")},e.oniceconnectionstatechange=()=>{switch(e.iceConnectionState){case"completed":p.log("iceConnectionState is completed"),e.onicecandidate=()=>{};break;case"disconnected":p.log("iceConnectionState is disconnected, trying reconnect by browser");break;case"failed":p.log("iceConnectionState is failed, closing connection"),this.emit(E.EVENTS.iceConnectionFailed.key);break;default:p.log(`iceConnectionState is ${e.iceConnectionState}`)}},e.onconnectionstatechange=()=>{p.log(`connectionState is ${e.connectionState}`),"failed"===e.connectionState&&"disconnected"===e.iceConnectionState&&(p.log("connectionState is failed, closing connection"),this.emit(E.EVENTS.iceConnectionFailed.key))},e.onnegotiationneeded=async()=>{if(p.log("`negotiationneeded` triggered"),"stable"===e.signalingState&&this._isNegotiationAllowed){if(this._isNegotiationAllowed=!1,this.originator){const e=await this._makeOfferSdp();this._setLocalDescription(e),this.emit(E.EVENTS.negotiationNeeded.key)}else this._replaceStreamCalled&&this.handleOffer();this._replaceStreamCalled=!1}},e.onsignalingstatechange=()=>{if(p.log(`signalingState is ${e.signalingState}`),"stable"===e.signalingState){const e=this._offerQueue.shift();e&&this.handleOffer(e)}}}async _makeOfferSdp(){let e;try{e=await this._pc.createOffer()}catch(e){throw e.type="webrtc",p.error(e),this.emit(E.EVENTS.error.key,e),p.log("Failed to createOffer, ",e),e}return p.log("Created offer."),this._audioBandwidth&&(e.sdp=w.addAudioBandwidth(e.sdp,this._audioBandwidth)),this._videoBandwidth&&(e.sdp=w.addVideoBandwidth(e.sdp,this._videoBandwidth)),this._audioCodec&&(e.sdp=w.filterAudioCodec(e.sdp,this._audioCodec)),this._videoCodec&&(e.sdp=w.filterVideoCodec(e.sdp,this._videoCodec)),e}async _makeAnswerSdp(){let e;try{e=await this._pc.createAnswer()}catch(e){throw e.type="webrtc",p.error(e),this.emit(E.EVENTS.error.key,e),p.log("Failed to createAnswer, ",e),e}p.log("Created answer."),this._audioBandwidth&&(e.sdp=w.addAudioBandwidth(e.sdp,this._audioBandwidth)),this._videoBandwidth&&(e.sdp=w.addVideoBandwidth(e.sdp,this._videoBandwidth)),this._audioCodec&&(e.sdp=w.filterAudioCodec(e.sdp,this._audioCodec)),this._videoCodec&&(e.sdp=w.filterVideoCodec(e.sdp,this._videoCodec));try{await this._pc.setLocalDescription(e)}catch(e){throw e.type="webrtc",p.error(e),this.emit(E.EVENTS.error.key,e),p.log("Failed to setLocalDescription, ",e),e}return p.log("Set localDescription: answer"),p.log(`Setting local description ${JSON.stringify(e.sdp)}`),e}async _setLocalDescription(e){p.log(`Setting local description ${JSON.stringify(e.sdp)}`);try{await this._pc.setLocalDescription(e)}catch(e){throw e.type="webrtc",p.error(e),this.emit(E.EVENTS.error.key,e),p.log("Failed to setLocalDescription, ",e),e}p.log("Set localDescription: offer"),this._isExpectingAnswer=!0,this.emit(E.EVENTS.offerCreated.key,e)}async _setRemoteDescription(e){p.log(`Setting remote description ${JSON.stringify(e)}`);try{await this._pc.setRemoteDescription(new RTCSessionDescription(e)),this.hasRemoteDescription=!0}catch(e){throw e.type="webrtc",p.error(e),this.emit(E.EVENTS.error.key,e),p.log("Failed to setRemoteDescription: ",e),e}p.log("Set remoteDescription:",e.type)}_getReceiveOnlyState(e={}){const t={audio:!1,video:!1},n=e.stream instanceof MediaStream,r=!!n&&0!==e.stream.getAudioTracks().length,i=!!n&&0!==e.stream.getVideoTracks().length;return!1===n&&void 0===e.audioReceiveEnabled&&void 0===e.videoReceiveEnabled?(t.audio=!0,t.video=!0,t):(e.audioReceiveEnabled&&!1===r&&(t.audio=!0),e.videoReceiveEnabled&&!1===i&&(t.video=!0),!1===e.audioReceiveEnabled&&r&&p.warn("Option audioReceiveEnabled will be treated as true, because passed stream has MediaStreamTrack(kind = audio)"),!1===e.videoReceiveEnabled&&i&&p.warn("Option videoReceiveEnabled will be treated as true, because passed stream has MediaStreamTrack(kind = video)"),t)}static get EVENTS(){return _}}var S=E,k=n("./node_modules/detect-browser/index.js"),C={validateId:function(e){return!e||/^[A-Za-z0-9_-]+(?:[ _-][A-Za-z0-9]+)*$/.exec(e)},validateKey:function(e){return!e||/^[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}$/.exec(e)},randomId:function(){return(Math.random().toString(36)+"0000000000000000000").substr(2,16)},randomToken:function(){return Math.random().toString(36).substr(2)},joinArrayBuffers:function(e){const t=e.reduce((e,t)=>e+t.byteLength,0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(new Uint8Array(t),r),r+=t.byteLength;return n.buffer},blobToArrayBuffer:function(e,t){const n=new FileReader;n.onload=e=>{t(e.target.result)},n.readAsArrayBuffer(e)},isSecure:function(){return"https:"===location.protocol},detectBrowser:function(){const{name:e,version:t}=Object(k.detect)(),[n,r,i]=t.split(".").map(e=>parseInt(e));return{name:e,major:n,minor:r,patch:i}},isPlanBSafari:function(){const{name:e}=Object(k.detect)();return("safari"===e||"ios"===e)&&!RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")}};const x=new s.a(["candidate","offer","answer","close","forceClose"]);class T extends i.a{constructor(e,t){if(super(),t=t||{},this.constructor===T)throw new TypeError("Cannot construct Connection instances directly");this._options=t,this.open=!1,this.type=void 0,this.metadata=this._options.metadata,this.remoteId=e,this._negotiator=new S,this._idPrefix="c_",this._randomIdSuffix=C.randomToken(),this._setupNegotiatorMessageHandlers()}get id(){return this._options.connectionId||this._idPrefix+this._randomIdSuffix}async handleAnswer(e){this._pcAvailable?(await this._negotiator.handleAnswer(e.answer),this.open=!0,this._handleQueuedMessages()):(p.log(`Queuing ANSWER message in ${this.id} from ${this.remoteId}`),this._queuedMessages.push({type:d.MESSAGE_TYPES.SERVER.ANSWER.key,payload:e}))}handleCandidate(e){!this._negotiator.originator||this._negotiator.hasRemoteDescription?this._pcAvailable?this._negotiator.handleCandidate(e.candidate):(p.log(`Queuing CANDIDATE message in ${this.id} from ${this.remoteId}`),this._queuedMessages.push({type:d.MESSAGE_TYPES.SERVER.CANDIDATE.key,payload:e})):this._queuedMessages.push({type:d.MESSAGE_TYPES.SERVER.CANDIDATE.key,payload:e})}updateOffer(e){this.open?this._negotiator.handleOffer(e.offer):this._options.payload=e}getPeerConnection(){return this.open?this._negotiator._pc:null}_handleQueuedMessages(){for(const e of this._queuedMessages)switch(e.type){case d.MESSAGE_TYPES.SERVER.ANSWER.key:this.handleAnswer(e.payload);break;case d.MESSAGE_TYPES.SERVER.CANDIDATE.key:this.handleCandidate(e.payload);break;default:p.warn("Unrecognized message type:",e.type,"from peer:",this.remoteId)}this._queuedMessages=[]}close(e=!1){this.open&&(this.open=!1,this._negotiator.cleanup(),this.emit(T.EVENTS.close.key),e&&this.emit(T.EVENTS.forceClose.key))}_setupNegotiatorMessageHandlers(){this._negotiator.on(S.EVENTS.answerCreated.key,e=>{const t={answer:e,dst:this.remoteId,connectionId:this.id,connectionType:this.type};this.emit(T.EVENTS.answer.key,t)}),this._negotiator.on(S.EVENTS.offerCreated.key,e=>{const t={offer:e,dst:this.remoteId,connectionId:this.id,connectionType:this.type,metadata:this.metadata};this.serialization&&(t.serialization=this.serialization),this.label&&(t.label=this.label),this.dcInit&&(t.dcInit=this.dcInit),this.emit(T.EVENTS.offer.key,t)}),this._negotiator.on(S.EVENTS.iceCandidate.key,e=>{const t={candidate:e,dst:this.remoteId,connectionId:this.id,connectionType:this.type};this.emit(T.EVENTS.candidate.key,t)}),this._negotiator.on(S.EVENTS.iceConnectionFailed.key,()=>{this.close()})}get peer(){return p.warn(`${this.constructor.name}.peer is deprecated and may be removed from a future version.`+` Please use ${this.constructor.name}.remoteId instead.`),this.remoteId}static get EVENTS(){return x}}var A=T,O=n("./node_modules/js-binarypack/lib/binarypack.js"),P=n.n(O),N=n("./node_modules/object-sizeof/index.js"),M=n.n(N);const R=new s.a(["open","data","error"]);R.extend(A.EVENTS.enums);const j=new s.a(["binary","binary-utf8","json","none"]);class B extends A{constructor(e,t){if(super(e,t),this._idPrefix="dc_",this.type="data",this._isOnOpenCalled=!1,this.label=this._options.label||this.id,this.dcInit=this._options.dcInit||{},this.serialization=B.SERIALIZATIONS.binary.key,this._options.serialization){if(!B.SERIALIZATIONS.get(this._options.serialization))throw new Error("Invalid serialization");this.serialization=this._options.serialization,this._isUnreliableDCInit(this.dcInit)&&(p.warn("You can not specify serialization with unreliable mode enabled."),this.serialization=B.SERIALIZATIONS.binary.key)}this._sendBuffer=[],this._receivedData={},this._queuedMessages=this._options.queuedMessages||[],this._negotiator.on(S.EVENTS.dcCreated.key,e=>{this._dc=e,this._dc.binaryType="arraybuffer",this._setupMessageHandlers(),this._isOnOpenCalled||"open"!==this._dc.readyState||this._dc.onopen()}),this._options.payload&&(this._options.payload.pcConfig=this._options.pcConfig)}async startConnection(){await this._negotiator.startConnection(this._options.payload||{originator:!0,type:"data",label:this.label,dcInit:this.dcInit,pcConfig:this._options.pcConfig}),this._pcAvailable=!0,this._handleQueuedMessages()}_setupMessageHandlers(){this._dc.onopen=()=>{this._isOnOpenCalled||(p.log("Data channel connection success"),this.open=!0,this._isOnOpenCalled=!0,this.emit(B.EVENTS.open.key))},this._dc.onmessage=e=>{this._handleDataMessage(e)},this._dc.onclose=()=>{p.log("DataChannel closed for:",this.id),this.close()},this._dc.onerror=e=>{p.error(e)}}_handleDataMessage(e){if(this.serialization===B.SERIALIZATIONS.none.key)return void this.emit(B.EVENTS.data.key,e.data);if(this.serialization===B.SERIALIZATIONS.json.key)return void this.emit(B.EVENTS.data.key,JSON.parse(e.data));const t=P.a.unpack(e.data);let n=this._receivedData[t.id];if(n||(n=this._receivedData[t.id]={size:t.size,type:t.type,name:t.name,mimeType:t.mimeType,totalParts:t.totalParts,parts:new Array(t.totalParts),receivedParts:0}),n.receivedParts++,n.parts[t.index]=t.data,n.receivedParts===n.totalParts){delete this._receivedData[t.id];const e=C.joinArrayBuffers(n.parts),r=P.a.unpack(e);let i;switch(n.type){case"Blob":i=new Blob([new Uint8Array(r)],{type:n.mimeType});break;case"File":i=new File([new Uint8Array(r)],n.name,{type:n.mimeType});break;default:i=r}this.emit(B.EVENTS.data.key,i)}}send(e){if(!this.open)return void this.emit(B.EVENTS.error.key,new Error("Connection is not open. You should listen for the `open` event before sending messages."));if(null==e)return;if(this.serialization===B.SERIALIZATIONS.none.key)return this._sendBuffer.push(e),void this._startSendLoop();if(this.serialization===B.SERIALIZATIONS.json.key)return this._sendBuffer.push(JSON.stringify(e)),void this._startSendLoop();const t=P.a.pack(e),n=t.size,r=e.constructor.name,i={id:C.randomId(),type:r,size:n,totalParts:0};"File"===r&&(i.name=e.name),e instanceof Blob&&(i.mimeType=e.type);const o=d.maxChunkSize-M()(i),s=Math.ceil(n/o);i.totalParts=s;for(let e=0;e{this._sendBuffer.push(e),this._startSendLoop()})}}close(e){super.close(e),this._isOnOpenCalled=!1}_startSendLoop(){this.sendInterval||(this.sendInterval=setInterval(()=>{const e=this._sendBuffer.shift();try{this._dc.send(e)}catch(t){this._sendBuffer.push(e)}0===this._sendBuffer.length&&(clearInterval(this.sendInterval),this.sendInterval=void 0)},d.sendInterval))}_isUnreliableDCInit(e){return!!e&&("maxRetransmits"in e||"maxPacketLifeTime"in e)}static get SERIALIZATIONS(){return j}static get EVENTS(){return R}}var F=B;const I=new s.a(["stream"]);I.extend(A.EVENTS.enums);class L extends A{constructor(e,t){super(e,t),this._idPrefix="mc_",this.type="media",this.localStream=this._options.stream,this._queuedMessages=this._options.queuedMessages||[],this._pcAvailable=!1}async startConnection(){this._options.originator&&(await this._negotiator.startConnection({type:"media",stream:this.localStream,originator:this._options.originator,pcConfig:this._options.pcConfig,videoBandwidth:this._options.videoBandwidth,audioBandwidth:this._options.audioBandwidth,videoCodec:this._options.videoCodec,audioCodec:this._options.audioCodec,videoReceiveEnabled:this._options.videoReceiveEnabled,audioReceiveEnabled:this._options.audioReceiveEnabled}),this._pcAvailable=!0,this._handleQueuedMessages())}answer(e,t={}){this.localStream?p.warn("localStream already exists on this MediaConnection. Are you answering a call twice?"):(this._options.payload.stream=e,this.localStream=e,this._negotiator.startConnection({type:"media",stream:this.localStream,originator:!1,offer:this._options.payload.offer,pcConfig:this._options.pcConfig,audioBandwidth:t.audioBandwidth,videoBandwidth:t.videoBandwidth,videoCodec:t.videoCodec,audioCodec:t.audioCodec}),this._pcAvailable=!0,this._handleQueuedMessages(),this.open=!0)}replaceStream(e){this._negotiator.replaceStream(e),this.localStream=e}_setupNegotiatorMessageHandlers(){super._setupNegotiatorMessageHandlers(),this._negotiator.on(S.EVENTS.addStream.key,e=>{p.log("Receiving stream",e),this.remoteStream&&this.remoteStream.id===e.id||(this.remoteStream=e,this.emit(L.EVENTS.stream.key,e))})}static get EVENTS(){return I}}var D=L;const U=new s.a(["stream","open","close","peerJoin","peerLeave","error","data","log"]),V=new s.a(["offer","answer","candidate","leave","close","getLog","broadcast"]);class z extends i.a{constructor(e,t,n={}){if(super(),this.constructor===z)throw new TypeError("Cannot construct Room instances directly");this.name=e,this._options=n,this._peerId=t,this._localStream=this._options.stream,this._pcConfig=this._options.pcConfig}handleData(e){const t={data:e.data,src:e.src};this.emit(z.EVENTS.data.key,t)}handleLog(e){this.emit(z.EVENTS.log.key,e)}getLog(){const e={roomName:this.name};this.emit(z.MESSAGE_EVENTS.getLog.key,e)}static get EVENTS(){return U}static get MESSAGE_EVENTS(){return V}}var q=z;const W=new s.a([]);W.extend(q.EVENTS.enums);const G=new s.a(["offerRequest","candidate"]);G.extend(q.MESSAGE_EVENTS.enums);class H extends q{constructor(e,t,n){super(e,t,n),this.remoteStreams={},this.members=[],this._open=!1,this._msidMap={},this._unknownStreams={},this._negotiator=new S}call(e){e&&(this._localStream=e);const t={roomName:this.name};this.emit(H.MESSAGE_EVENTS.offerRequest.key,t)}handleOffer(e){let t=e.offer;C.isPlanBSafari()&&(t=w.unifiedToPlanB(t)),this._connectionStarted?this._negotiator.handleOffer(t):(this._negotiator.startConnection({type:"media",stream:this._localStream,pcConfig:this._options.pcConfig,offer:t}),this._setupNegotiatorMessageHandlers(),this._connectionStarted=!0)}_setupNegotiatorMessageHandlers(){this._negotiator.on(S.EVENTS.addStream.key,e=>{const t=e;if(this._msidMap[t.id]){if(t.peerId=this._msidMap[t.id],t.peerId===this._peerId)return;const e=this.remoteStreams[t.id];if(e&&e.id===t.id)return;this.remoteStreams[t.id]=t,this.emit(H.EVENTS.stream.key,t),p.log(`Received remote media stream for ${t.peerId} in ${this.name}`)}else this._unknownStreams[t.id]=t}),this._negotiator.on(S.EVENTS.negotiationNeeded.key,()=>{const e={roomName:this.name};this.emit(H.MESSAGE_EVENTS.offerRequest.key,e)}),this._negotiator.on(S.EVENTS.answerCreated.key,e=>{C.isPlanBSafari()||(e.sdp=w.ensureUnifiedPlan(e.sdp));const t={roomName:this.name,answer:e};this.emit(H.MESSAGE_EVENTS.answer.key,t)}),this._negotiator.on(S.EVENTS.iceConnectionFailed.key,()=>{this.close()}),this._negotiator.on(S.EVENTS.iceCandidate.key,e=>{const t={roomName:this.name,candidate:e};this.emit(H.MESSAGE_EVENTS.candidate.key,t)})}handleJoin(e){const{src:t,roomMembers:n}=e;if(t===this._peerId)return this._open=!0,this.members=n.filter(e=>e!==t),this.call(this._localStream),void this.emit(H.EVENTS.open.key);this.members.push(t),this.emit(H.EVENTS.peerJoin.key,t)}handleLeave(e){if(!this._open)return;const t=e.src,n=this.members.indexOf(t);n>=0&&this.members.splice(n,1);for(const e in this.remoteStreams)this.remoteStreams[e].peerId===t&&(delete this.remoteStreams[e],delete this._msidMap[e],delete this._unknownStreams[e]);this.emit(H.EVENTS.peerLeave.key,t)}send(e){if(!this._open)return;const t={roomName:this.name,data:e};this.emit(H.MESSAGE_EVENTS.broadcast.key,t)}close(){if(!this._open)return;this._negotiator&&this._negotiator.cleanup(),this._open=!1;const e={roomName:this.name};this.emit(H.MESSAGE_EVENTS.leave.key,e),this.emit(H.EVENTS.close.key)}replaceStream(e){this._localStream=e,this._negotiator.replaceStream(e)}updateMsidMap(e={}){this._msidMap=e;for(const e of Object.keys(this._unknownStreams))if(this._msidMap[e]){const t=this._unknownStreams[e];if(t.peerId=this._msidMap[t.id],delete this._unknownStreams[e],t.peerId===this._peerId)return;this.remoteStreams[t.id]=t,this.emit(H.EVENTS.stream.key,t)}}static get EVENTS(){return W}static get MESSAGE_EVENTS(){return G}}var $=H;const Y=new s.a([]);Y.extend(q.EVENTS.enums);const K=new s.a(["broadcastByDC","getPeers"]);K.extend(q.MESSAGE_EVENTS.enums);class J extends q{constructor(e,t,n){super(e,t,n),this.connections={},this._queuedMessages={}}call(e){e&&(this._localStream=e);const t={roomName:this.name,type:"media"};this.emit(J.MESSAGE_EVENTS.getPeers.key,t)}connect(){const e={roomName:this.name,type:"data"};this.emit(J.MESSAGE_EVENTS.getPeers.key,e)}makeMediaConnections(e){const t={stream:this._localStream,pcConfig:this._pcConfig,originator:!0,videoBandwidth:this._options.videoBandwidth,audioBandwidth:this._options.audioBandwidth,videoCodec:this._options.videoCodec,audioCodec:this._options.audioCodec,videoReceiveEnabled:this._options.videoReceiveEnabled,audioReceiveEnabled:this._options.audioReceiveEnabled};this._makeConnections(e,"media",t)}makeDataConnections(e){const t={pcConfig:this._pcConfig};this._makeConnections(e,"data",t)}handleJoin(e){const t=e.src;if(t===this._peerId)return this.call(this._localStream),void this.emit(J.EVENTS.open.key);this.emit(J.EVENTS.peerJoin.key,t)}handleLeave(e){const t=e.src;this._deleteConnections(t),this.emit(J.EVENTS.peerLeave.key,t)}handleOffer(e){const t=e.connectionId;let n=this._getConnection(e.src,t);n?n.updateOffer(e):"media"===e.connectionType?(n=new D(e.src,{connectionId:t,payload:e,metadata:e.metadata,queuedMessages:this._queuedMessages[t],pcConfig:this._pcConfig}),n.startConnection(),p.log("MediaConnection created in OFFER"),this._addConnection(e.src,n),this._setupMessageHandlers(n),n.answer(this._localStream,{videoBandwidth:this._options.videoBandwidth,audioBandwidth:this._options.audioBandwidth,videoCodec:this._options.videoCodec,audioCodec:this._options.audioCodec,videoReceiveEnabled:this._options.videoReceiveEnabled,audioReceiveEnabled:this._options.audioReceiveEnabled})):p.warn(`Received malformed connection type: ${e.connectionType}`)}handleAnswer(e){const t=this._getConnection(e.src,e.connectionId);t&&t.handleAnswer(e)}handleCandidate(e){const t=this._getConnection(e.src,e.connectionId);t?t.handleCandidate(e):(void 0===this._queuedMessages[e.connectionId]&&(this._queuedMessages[e.connectionId]=[]),this._queuedMessages[e.connectionId].push({type:d.MESSAGE_TYPES.SERVER.CANDIDATE.key,payload:e}))}send(e){const t={roomName:this.name,data:e};this.emit(J.MESSAGE_EVENTS.broadcast.key,t)}close(){for(const e in this.connections)this.connections.hasOwnProperty(e)&&this.connections[e].forEach(e=>{e.close()});const e={roomName:this.name};this.emit(J.MESSAGE_EVENTS.leave.key,e),this.emit(J.EVENTS.close.key)}replaceStream(e){this._localStream=e;for(const t in this.connections)this.connections.hasOwnProperty(t)&&this.connections[t].forEach(t=>{"media"===t.type&&t.replaceStream(e)})}_addConnection(e,t){this.connections[e]||(this.connections[e]=[]),this.connections[e].push(t)}_makeConnections(e,t,n){e.filter(e=>e!==this._peerId).forEach(e=>{let r;switch(t){case"data":r=new F(e,n);break;case"media":r=new D(e,n);break;default:return}r.startConnection(),this._addConnection(e,r),this._setupMessageHandlers(r),p.log(`${t} connection to ${e} created in ${this.name}`)})}_deleteConnections(e){this.connections[e]&&delete this.connections[e]}_getConnection(e,t){return this.connections&&this.connections[e]?this.connections[e].filter(e=>e.id===t)[0]:null}_setupMessageHandlers(e){e.on(A.EVENTS.offer.key,e=>{e.roomName=this.name,this.emit(J.MESSAGE_EVENTS.offer.key,e)}),e.on(A.EVENTS.answer.key,e=>{e.roomName=this.name,this.emit(J.MESSAGE_EVENTS.answer.key,e)}),e.on(A.EVENTS.candidate.key,e=>{e.roomName=this.name,this.emit(J.MESSAGE_EVENTS.candidate.key,e)}),"media"===e.type&&e.on(D.EVENTS.stream.key,t=>{t.peerId=e.remoteId,this.emit(J.EVENTS.stream.key,t)})}static get EVENTS(){return Y}static get MESSAGE_EVENTS(){return K}}var Q=J;const X=new s.a(["open","error","call","connection","expiresin","close","disconnected"]);class Z extends i.a{constructor(e,t){super(),this.connections={},this.rooms={},this._queuedMessages={},e&&e.constructor===Object?(t=e,e=void 0):e&&(e=e.toString());const n={debug:p.LOG_LEVELS.NONE,secure:!0,config:d.defaultConfig,turn:!0,dispatcherSecure:d.DISPATCHER_SECURE,dispatcherHost:d.DISPATCHER_HOST,dispatcherPort:d.DISPATCHER_PORT};this.options=Object.assign({},n,t),this.options.token=C.randomToken(),p.setLogLevel(this.options.debug),C.validateId(e)?C.validateKey(t.key)?("/"===this.options.host&&(this.options.host=window.location.hostname),void 0===t.secure&&443!==this.options.port&&(this.options.secure=void 0),this._initializeServerConnection(e)):this._abort("invalid-key",`API KEY "${this.options.key}" is invalid`):this._abort("invalid-id",`ID "${e}" is invalid`)}call(e,t,n={}){if(!this._checkOpenStatus())return;n.originator=!0,n.stream=t,n.pcConfig=this._pcConfig;const r=new D(e,n);return r.startConnection(),p.log("MediaConnection created in call method"),this._addConnection(e,r),r}connect(e,t={}){if(!this._checkOpenStatus())return;t.pcConfig=this._pcConfig;const n=new F(e,t);return n.startConnection(),p.log("DataConnection created in connect method"),this._addConnection(e,n),n}joinRoom(e,t={}){if(this._checkOpenStatus()){if(!e){const e=new Error("Room name must be defined.");return e.type="room-error",p.error(e),this.emit(Z.EVENTS.error.key,e),null}return t.pcConfig=this._pcConfig,t.peerId=this.id,"sfu"===t.mode?this._initializeSfuRoom(e,t):this._initializeFullMeshRoom(e,t)}}getConnection(e,t){if(this._checkOpenStatus()){if(this.connections[e])for(const n of this.connections[e])if(n.id===t)return n;return null}}get open(){return this.socket&&this.socket.isOpen}destroy(){this._cleanup(),this.disconnect()}disconnect(){this.open&&(this.socket.close(),this.emit(Z.EVENTS.disconnected.key,this.id))}reconnect(){this.open||this.socket.reconnect()}updateCredential(e){this.socket.updateCredential(e)}listAllPeers(e){if(!this._checkOpenStatus())return;e=e||function(){};const t=this,n=new XMLHttpRequest,r=`${this.socket.signalingServerUrl}/api/apikeys/${this.options.key}/clients/`;n.open("get",r,!0),n.onerror=function(){t._abort("server-error","Could not get peers from the server."),e([])},n.onreadystatechange=function(){if(4===n.readyState)if(401===n.status){e([]);const n=new Error("It doesn't look like you have permission to list peers IDs. Please enable the SkyWay REST API on dashboard");n.type="list-error",p.error(n),t.emit(Z.EVENTS.error.key,n)}else 200===n.status?e(JSON.parse(n.responseText)):e([])},n.send(null)}_checkOpenStatus(){return this.open||this._emitNotConnectedError(),this.open}_emitNotConnectedError(){p.warn("You cannot connect to a new Peer because you are not connecting to SkyWay server now.You can create a new Peer to reconnect, or call reconnect() on this peer if you believe its ID to still be available.");const e=new Error("Cannot connect to new Peer before connecting to SkyWay server or after disconnecting from the server.");e.type="disconnected",p.error(e),this.emit(Z.EVENTS.error.key,e)}_initializeServerConnection(e){this.socket=new y(this.options.key,{secure:this.options.secure,host:this.options.host,port:this.options.port,dispatcherSecure:this.options.dispatcherSecure,dispatcherHost:this.options.dispatcherHost,dispatcherPort:this.options.dispatcherPort}),this._setupMessageHandlers(),this.socket.on("error",e=>{this._abort("socket-error",e)}),this.socket.on("disconnect",()=>{this.disconnect();const e=new Error("Lost connection to server.");e.type="socket-error",p.error(e),this.emit(Z.EVENTS.error.key,e)}),this.socket.start(e,this.options.token,this.options.credential)}_initializeSfuRoom(e,t={}){if(this.rooms[e])return this.rooms[e];const n=new $(e,this.id,t);this.rooms[e]=n,this._setupSFURoomMessageHandlers(n);const r={roomName:e,roomType:"sfu"};return this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_JOIN.key,r),n}_initializeFullMeshRoom(e,t={}){if(this.rooms[e])return this.rooms[e];const n=new Q(e,this.id,t);this.rooms[e]=n,this._setupMeshRoomMessageHandlers(n);const r={roomName:e,roomType:"mesh"};return this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_JOIN.key,r),n}_setupMessageHandlers(){this.socket.on(d.MESSAGE_TYPES.SERVER.OPEN.key,e=>{this.id=e.peerId,this._pcConfig=Object.assign({},this.options.config);const t=this._pcConfig.iceServers;this._pcConfig.iceServers=t?t.slice():[];const n=e.turnCredential;let r,i;if("object"==typeof n?(r=n.username,i=n.credential):"string"==typeof n&&(r=`${this.options.key}$${this.id}`,i=n),!0===this.options.turn&&r&&i){const e=[{protocol:"turn",transport:"tcp"},{protocol:"turn",transport:"udp"}];"edge"!==C.detectBrowser().name&&e.push({protocol:"turns",transport:"tcp"});for(const t of e){const e=t.protocol,n=t.transport,o={urls:`${e}:${d.TURN_HOST}:${d.TURN_PORT}?transport=${n}`,url:`${e}:${d.TURN_HOST}:${d.TURN_PORT}?transport=${n}`,username:r,credential:i};this._pcConfig.iceServers.push(o)}p.log("SkyWay TURN Server is available")}else p.log("SkyWay TURN Server is unavailable");this.emit(Z.EVENTS.open.key,this.id)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ERROR.key,e=>{const t=new Error(e.message);t.type=e.type,p.error(t),this.emit(Z.EVENTS.error.key,t)}),this.socket.on(d.MESSAGE_TYPES.SERVER.LEAVE.key,e=>{p.log(`Received leave message from ${e}`),this._cleanupPeer(e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.FORCE_CLOSE.key,({src:e,connectionId:t})=>{const n=this.getConnection(e,t);n&&n.close(!1)}),this.socket.on(d.MESSAGE_TYPES.SERVER.AUTH_EXPIRES_IN.key,e=>{p.log(`Credential expires in ${e}`),this.emit(Z.EVENTS.expiresin.key,e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.OFFER.key,e=>{const t=e.roomName;if(t){const n=this.rooms[t];return void(n&&n.handleOffer(e))}const n=e.connectionId;let r=this.getConnection(e.src,n);r?r.updateOffer(e):("media"===e.connectionType?(r=new D(e.src,{connectionId:n,payload:e,metadata:e.metadata,originator:!1,queuedMessages:this._queuedMessages[n],pcConfig:this._pcConfig}),r.startConnection(),p.log("MediaConnection created in OFFER"),this._addConnection(e.src,r),this.emit(Z.EVENTS.call.key,r)):"data"===e.connectionType?(r=new F(e.src,{connectionId:n,payload:e,metadata:e.metadata,label:e.label,dcInit:e.dcInit,serialization:e.serialization,queuedMessages:this._queuedMessages[n],pcConfig:this._pcConfig}),r.startConnection(),p.log("DataConnection created in OFFER"),this._addConnection(e.src,r),this.emit(Z.EVENTS.connection.key,r)):p.warn("Received malformed connection type: ",e.connectionType),delete this._queuedMessages[n])}),this.socket.on(d.MESSAGE_TYPES.SERVER.ANSWER.key,e=>{const t=e.roomName;if(t){const n=this.rooms[t];return void(n&&n.handleAnswer(e))}const n=this.getConnection(e.src,e.connectionId);n?n.handleAnswer(e):this._storeMessage(d.MESSAGE_TYPES.SERVER.ANSWER.key,e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.CANDIDATE.key,e=>{const t=e.roomName;if(t){const n=this.rooms[t];return void(n&&n.handleCandidate(e))}const n=this.getConnection(e.src,e.connectionId);n?n.handleCandidate(e):this._storeMessage(d.MESSAGE_TYPES.SERVER.CANDIDATE.key,e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ROOM_USER_JOIN.key,e=>{const t=this.rooms[e.roomName];t&&t.handleJoin(e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ROOM_USER_LEAVE.key,e=>{const t=this.rooms[e.roomName];t&&t.handleLeave(e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ROOM_DATA.key,e=>{const t=this.rooms[e.roomName];t&&t.handleData(e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ROOM_LOGS.key,e=>{const t=this.rooms[e.roomName];t&&t.handleLog(e.log)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ROOM_USERS.key,e=>{const t=this.rooms[e.roomName];t&&("media"===e.type?t.makeMediaConnections(e.userList):t.makeDataConnections(e.userList))}),this.socket.on(d.MESSAGE_TYPES.SERVER.SFU_OFFER.key,e=>{const t=this.rooms[e.roomName];t&&(t.updateMsidMap(e.msids),t.handleOffer(e))})}_setupConnectionMessageHandlers(e){e.on(A.EVENTS.candidate.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_CANDIDATE.key,e)}),e.on(A.EVENTS.answer.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_ANSWER.key,e)}),e.on(A.EVENTS.offer.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_OFFER.key,e)}),e.on(A.EVENTS.forceClose.key,()=>{const t={dst:e.remoteId,connectionId:e.id};this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_FORCE_CLOSE.key,t)})}_setupRoomMessageHandlers(e){e.on($.MESSAGE_EVENTS.broadcast.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_SEND_DATA.key,e)}),e.on($.MESSAGE_EVENTS.getLog.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_GET_LOGS.key,e)}),e.on($.MESSAGE_EVENTS.leave.key,t=>{delete this.rooms[e.name],this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_LEAVE.key,t)})}_setupSFURoomMessageHandlers(e){this._setupRoomMessageHandlers(e),e.on($.MESSAGE_EVENTS.offerRequest.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SFU_GET_OFFER.key,e)}),e.on($.MESSAGE_EVENTS.answer.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SFU_ANSWER.key,e)}),e.on($.MESSAGE_EVENTS.candidate.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SFU_CANDIDATE.key,e)})}_setupMeshRoomMessageHandlers(e){this._setupRoomMessageHandlers(e),e.on(Q.MESSAGE_EVENTS.offer.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_OFFER.key,e)}),e.on(Q.MESSAGE_EVENTS.answer.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_ANSWER.key,e)}),e.on(Q.MESSAGE_EVENTS.candidate.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_CANDIDATE.key,e)}),e.on(Q.MESSAGE_EVENTS.getPeers.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_GET_USERS.key,e)})}_abort(e,t){p.error("Aborting!"),this.disconnect();const n=new Error(t);n.type=e,p.error(n),this.emit(Z.EVENTS.error.key,n)}_addConnection(e,t){this.connections[e]||(this.connections[e]=[]),this.connections[e].push(t),this._setupConnectionMessageHandlers(t)}_storeMessage(e,t){this._queuedMessages[t.connectionId]||(this._queuedMessages[t.connectionId]=[]),this._queuedMessages[t.connectionId].push({type:e,payload:t})}_cleanup(){if(this.connections)for(const e of Object.keys(this.connections))this._cleanupPeer(e);this.emit(Z.EVENTS.close.key)}_cleanupPeer(e){if(this.connections[e])for(const t of this.connections[e])t.close()}static get EVENTS(){return X}}t.default=Z},0: +/*! ModuleConcatenation bailout: Cannot concat with ./package.json (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/events/events.js"),i=n.n(r),o=n("./node_modules/enum/index.js"),s=n.n(o),a=n("./node_modules/socket.io-client/lib/index.js"),u=n.n(a),c=n("./node_modules/query-string/index.js"),l=n.n(c),d={DISPATCHER_HOST:"dispatcher.webrtc.ecl.ntt.com",DISPATCHER_PORT:443,DISPATCHER_SECURE:!0,DISPATCHER_TIMEOUT:1e4,TURN_HOST:"turn.webrtc.ecl.ntt.com",TURN_PORT:443,MESSAGE_TYPES:{CLIENT:new s.a(["SEND_OFFER","SEND_ANSWER","SEND_CANDIDATE","SEND_LEAVE","ROOM_JOIN","ROOM_LEAVE","ROOM_GET_LOGS","ROOM_GET_USERS","ROOM_SEND_DATA","SFU_GET_OFFER","SFU_ANSWER","SFU_CANDIDATE","PING","UPDATE_CREDENTIAL","SEND_FORCE_CLOSE"]),SERVER:new s.a(["OPEN","ERROR","OFFER","ANSWER","CANDIDATE","LEAVE","AUTH_EXPIRES_IN","ROOM_LOGS","ROOM_USERS","ROOM_DATA","ROOM_USER_JOIN","ROOM_USER_LEAVE","SFU_OFFER","FORCE_CLOSE"])},maxChunkSize:16300,reconnectionAttempts:2,numberServersToTry:3,sendInterval:1,pingInterval:25e3,defaultConfig:{iceServers:[{urls:"stun:stun.webrtc.ecl.ntt.com:3478",url:"stun:stun.webrtc.ecl.ntt.com:3478"}],iceTransportPolicy:"all"}};const f=new s.a({NONE:0,ERROR:1,WARN:2,FULL:3});var p=new class{constructor(){this._logLevel=f.NONE.value,this.LOG_LEVELS=f}setLogLevel(e){switch(e.value&&(e=e.value),parseInt(e,10)){case 0:this._logLevel=f.NONE.value;break;case 1:this._logLevel=f.ERROR.value;break;case 2:this._logLevel=f.WARN.value;break;case 3:this._logLevel=f.FULL.value;break;default:this._logLevel=f.NONE.value}}warn(...e){this._logLevel>=f.WARN.value&&console.warn("SkyWay: ",...e)}error(...e){this._logLevel>=f.ERROR.value&&console.error("SkyWay: ",...e)}log(...e){this._logLevel>=f.FULL.value&&console.log("SkyWay: ",...e)}},h=n("./package.json");class m extends i.a{constructor(e,t){if(super(),this._isOpen=!1,this._isPeerIdSet=!1,this._queue=[],this._io=null,this._key=e,this._reconnectAttempts=0,t.host&&t.port){const e=t.secure?"https://":"http://";this.signalingServerUrl=`${e}${t.host}:${t.port}`}else{const e=t.dispatcherHost||d.DISPATCHER_HOST,n=t.dispatcherPort||d.DISPATCHER_PORT,r=t.dispatcherSecure||d.DISPATCHER_SECURE?"https://":"http://";this._dispatcherUrl=`${r}${e}:${n}/signaling`}}get isOpen(){return Boolean(this._io&&this._io.connected&&this._isOpen)}async start(e,t,n){let r=`apiKey=${this._key}&token=${t}`+`&platform=javascript&sdk_version=${h.version}`;if(e&&(r+=`&peerId=${e}`,this._isPeerIdSet=!0),n&&(r+=`&credential=${encodeURIComponent(JSON.stringify(n))}`),this._dispatcherUrl){let e;try{e=await this._getSignalingServer()}catch(e){return void this.emit("error",e)}const t=e.secure?"https://":"http://";this.signalingServerUrl=`${t}${e.host}:${e.port}`}this._io=u()(this.signalingServerUrl,{"force new connection":!0,query:r,reconnectionAttempts:d.reconnectionAttempts}),this._io.on("reconnect_failed",()=>{this._stopPings(),this._connectToNewServer()}),this._io.on("error",e=>{p.error(e)}),this._setupMessageHandlers()}async _connectToNewServer(e=0){if(e>=10||this._reconnectAttempts>=d.numberServersToTry)return void this.emit("error","Could not connect to server.");let t;try{t=await this._getSignalingServer()}catch(e){return void this.emit("error",e)}if(-1===this.signalingServerUrl.indexOf(t.host)){const e=t.secure?"https://":"http://";this.signalingServerUrl=`${e}${t.host}:${t.port}`,this._io.io.uri=this.signalingServerUrl,this._io.connect(),this._reconnectAttempts++}else this._connectToNewServer(++e)}_getSignalingServer(){return new Promise((e,t)=>{const n=new XMLHttpRequest;n.timeout=d.DISPATCHER_TIMEOUT,n.open("GET",this._dispatcherUrl,!0),n.onerror=()=>{t(new Error("There was a problem with the request for the dispatcher. Check your peer options and network connections."))},n.onabort=()=>{t(new Error("The request for the dispatcher was aborted."))},n.ontimeout=()=>{t(new Error("The request for the dispatcher timed out. Check your firewall, network speed, SkyWay failure information"))},n.onload=()=>{if(200===n.status)try{const r=JSON.parse(n.responseText);if(r&&r.domain)return void e({host:r.domain,port:443,secure:!0});t(new Error("The dispatcher server returned an invalid JSON response. have no signaling server domain in JSON."))}catch(e){t(new Error("The dispatcher server returned an invalid JSON response."))}else t(new Error("Connection failed. Unexpected response: "+n.status))},n.send(null)})}send(e,t){e?this.isOpen?!0===this._io.connected&&this._io.emit(e,t):this._queue.push({type:e,message:t}):this._io.emit("error","Invalid message")}close(){this.isOpen&&(this._stopPings(),this._io.disconnect(),this._isOpen=!1)}reconnect(){this._io.connect()}updateCredential(e){const t=l.a.parse(this._io.io.opts.query);t.credential?t.credential=encodeURIComponent(JSON.stringify(e)):p.warn("Adding a credential when one wasn't specified before."),this._io.io.opts.query=l.a.stringify(t),this.send(d.MESSAGE_TYPES.CLIENT.UPDATE_CREDENTIAL.key,e)}_setupMessageHandlers(){d.MESSAGE_TYPES.SERVER.enums.forEach(e=>{e.key===d.MESSAGE_TYPES.SERVER.OPEN.key?this._io.on(e.key,t=>{t&&t.peerId&&(this._isPeerIdSet||(this._io.io.opts.query+=`&peerId=${t.peerId}`,this._isPeerIdSet=!0),this._reconnectAttempts=0,this._startPings(),this._sendQueuedMessages(),this._isOpen||(this._isOpen=!0,this.emit(e.key,t)))}):this._io.on(e.key,t=>{this.emit(e.key,t)})})}_sendQueuedMessages(){for(const e of this._queue)this.send(e.type,e.message);this._queue=[]}_startPings(){this._pingIntervalId||(this._pingIntervalId=setInterval(()=>{this.send(d.MESSAGE_TYPES.CLIENT.PING.key)},d.pingInterval))}_stopPings(){clearInterval(this._pingIntervalId),this._pingIntervalId=void 0}}var g=m,y=n("./node_modules/sdp-transform/lib/index.js"),v=n.n(y),b=n("./node_modules/sdp-interop/lib/index.js"),w=new class{unifiedToPlanB(e){const t=(new b.Interop).toPlanB(e).sdp,n=new Set,r=/a=ssrc:\d+ msid:(\w+)/g;let i;for(;i=r.exec(t);)n.add(i[1]);const o=t.replace("a=msid-semantic:WMS *",`a=msid-semantic:WMS ${Array.from(n).join(" ")}`);return new RTCSessionDescription({type:"offer",sdp:o})}addVideoBandwidth(e,t){return this._validateBandwidth(t),this._addBandwidth(e,t,"video")}addAudioBandwidth(e,t){return this._validateBandwidth(t),this._addBandwidth(e,t,"audio")}filterVideoCodec(e,t){return this._filterCodec(e,t,"video")}filterAudioCodec(e,t){return this._filterCodec(e,t,"audio")}ensureUnifiedPlan(e){return e.split("\r\n").map(e=>e.startsWith("a=msid-semantic")?"a=msid-semantic:WMS *":e).join("\r\n")}_filterCodec(e,t,n){if(void 0===t)throw new Error("codec is not passed");const r=v.a.parse(e);return r.media=r.media.map(e=>{if(e.type===n){e.rtp=e.rtp.filter(e=>e.codec===t);const n=e.rtp.reduce((e,t)=>[...e,t.payload],[]);if(0===e.rtp.length)throw new Error(`${t} does not exist`);e.fmtp&&(e.fmtp=e.fmtp.filter(e=>n.includes(e.payload))),e.rtcpFb&&(e.rtcpFb=e.rtcpFb.filter(e=>n.includes(e.payload))),e.payloads=n.join(" ")}return e}),v.a.write(r)}_addBandwidth(e,t,n){const r=v.a.parse(e);return r.media=r.media.map(e=>(e.type===n&&(e.bandwidth=[{type:"AS",limit:t.toString()},{type:"TIAS",limit:(1e3*t).toString()}]),e)),v.a.write(r)}_validateBandwidth(e){if(void 0===e)throw new Error("bandwidth is not passed");if(!/^\d+$/.test(e))throw new Error(`${e} is not a number`)}};const _=new s.a(["addStream","dcCreated","offerCreated","answerCreated","iceCandidate","iceConnectionFailed","negotiationNeeded","error"]);class E extends i.a{constructor(){super(),this._offerQueue=[],this._isExpectingAnswer=!1,this._replaceStreamCalled=!1,this._isNegotiationAllowed=!0,this.hasRemoteDescription=!1}async startConnection(e={}){if(this._pc=this._createPeerConnection(e.pcConfig),this._setupPCListeners(),this.originator=e.originator,this._audioBandwidth=e.audioBandwidth,this._videoBandwidth=e.videoBandwidth,this._audioCodec=e.audioCodec,this._videoCodec=e.videoCodec,this._type=e.type,"media"===this._type)if(e.stream){const t=e.stream.getVideoTracks(),n=e.stream.getAudioTracks(),r=this._getReceiveOnlyState(e);t.length>0?t.forEach(t=>this._pc.addTrack(t,e.stream)):r.video&&this._pc.addTransceiver("video",{direction:"recvonly"}),n.length>0?n.forEach(t=>this._pc.addTrack(t,e.stream)):r.audio&&this._pc.addTransceiver("audio",{direction:"recvonly"})}else this.originator&&(this._pc.addTransceiver("audio",{direction:"recvonly"}),this._pc.addTransceiver("video",{direction:"recvonly"}));if(this.originator){if("data"===this._type){const t=e.label||"",n=e.dcInit||{},r=this._pc.createDataChannel(t,n);this.emit(E.EVENTS.dcCreated.key,r)}}else await this.handleOffer(e.offer)}replaceStream(e){if(!this._pc)return;this._isNegotiationAllowed=!0;const t=this,n=e.getVideoTracks(),r=e.getAudioTracks(),i=this._pc.getSenders(),o=i.find(e=>e.track&&"video"===e.track.kind),s=i.find(e=>e.track&&"audio"===e.track.kind);function a(e,n,r){void 0===n&&void 0===e||(void 0!==n?void 0!==e?e.track.id!==n.id&&e.replaceTrack(n):t._pc.addTrack(n,r):t._pc.removeTrack(e))}a(o,n[0],e),a(s,r[0],e)}async handleOffer(e){if(this._lastOffer&&e&&this._lastOffer.sdp===e.sdp)return;if(this._isNegotiationAllowed=!0,e||(e=this._lastOffer),this._lastOffer=e,"have-remote-offer"===this._pc.signalingState)return void this._offerQueue.push(e);await this._setRemoteDescription(e);const t=await this._makeAnswerSdp().catch(e=>p.error(e));this.emit(E.EVENTS.answerCreated.key,t)}async handleAnswer(e){this._isNegotiationAllowed=!0,this._isExpectingAnswer?(await this._setRemoteDescription(e),this._isExpectingAnswer=!1):this._pc.onnegotiationneeded&&this._pc.onnegotiationneeded()}async handleCandidate(e){await this._pc.addIceCandidate(new RTCIceCandidate(e)).then(()=>p.log("Successfully added ICE candidate")).catch(e=>p.error("Failed to add ICE candidate",e))}cleanup(){p.log("Cleaning up PeerConnection"),!this._pc||"closed"===this._pc.readyState&&"closed"===this._pc.signalingState||this._pc.close(),this._pc=null}_createPeerConnection(e={}){return p.log("Creating RTCPeerConnection"),e.sdpSemantics="unified-plan",new RTCPeerConnection(e)}_setupPCListeners(){const e=this._pc;e.ontrack=e=>{p.log("Received remote media stream track"),e.streams.forEach(e=>{this.emit(E.EVENTS.addStream.key,e)})},e.ondatachannel=e=>{p.log("Received data channel");const t=e.channel;this.emit(E.EVENTS.dcCreated.key,t)},e.onicecandidate=e=>{e.candidate&&""!==e.candidate.candidate?(p.log("Generated ICE candidate for:",e.candidate),this.emit(E.EVENTS.iceCandidate.key,e.candidate)):p.log("ICE candidates gathering complete")},e.oniceconnectionstatechange=()=>{switch(e.iceConnectionState){case"completed":p.log("iceConnectionState is completed"),e.onicecandidate=()=>{};break;case"disconnected":p.log("iceConnectionState is disconnected, trying reconnect by browser");break;case"failed":p.log("iceConnectionState is failed, closing connection"),this.emit(E.EVENTS.iceConnectionFailed.key);break;default:p.log(`iceConnectionState is ${e.iceConnectionState}`)}},e.onconnectionstatechange=()=>{p.log(`connectionState is ${e.connectionState}`),"failed"===e.connectionState&&"disconnected"===e.iceConnectionState&&(p.log("connectionState is failed, closing connection"),this.emit(E.EVENTS.iceConnectionFailed.key))},e.onnegotiationneeded=async()=>{if(p.log("`negotiationneeded` triggered"),"stable"===e.signalingState&&this._isNegotiationAllowed){if(this._isNegotiationAllowed=!1,this.originator){const e=await this._makeOfferSdp();this._setLocalDescription(e),this.emit(E.EVENTS.negotiationNeeded.key)}else this._replaceStreamCalled&&this.handleOffer();this._replaceStreamCalled=!1}},e.onsignalingstatechange=()=>{if(p.log(`signalingState is ${e.signalingState}`),"stable"===e.signalingState){const e=this._offerQueue.shift();e&&this.handleOffer(e)}}}async _makeOfferSdp(){let e;try{e=await this._pc.createOffer()}catch(e){throw e.type="webrtc",p.error(e),this.emit(E.EVENTS.error.key,e),p.log("Failed to createOffer, ",e),e}return p.log("Created offer."),this._audioBandwidth&&(e.sdp=w.addAudioBandwidth(e.sdp,this._audioBandwidth)),this._videoBandwidth&&(e.sdp=w.addVideoBandwidth(e.sdp,this._videoBandwidth)),this._audioCodec&&(e.sdp=w.filterAudioCodec(e.sdp,this._audioCodec)),this._videoCodec&&(e.sdp=w.filterVideoCodec(e.sdp,this._videoCodec)),e}async _makeAnswerSdp(){let e;try{e=await this._pc.createAnswer()}catch(e){throw e.type="webrtc",p.error(e),this.emit(E.EVENTS.error.key,e),p.log("Failed to createAnswer, ",e),e}p.log("Created answer."),this._audioBandwidth&&(e.sdp=w.addAudioBandwidth(e.sdp,this._audioBandwidth)),this._videoBandwidth&&(e.sdp=w.addVideoBandwidth(e.sdp,this._videoBandwidth)),this._audioCodec&&(e.sdp=w.filterAudioCodec(e.sdp,this._audioCodec)),this._videoCodec&&(e.sdp=w.filterVideoCodec(e.sdp,this._videoCodec));try{await this._pc.setLocalDescription(e)}catch(e){throw e.type="webrtc",p.error(e),this.emit(E.EVENTS.error.key,e),p.log("Failed to setLocalDescription, ",e),e}return p.log("Set localDescription: answer"),p.log(`Setting local description ${JSON.stringify(e.sdp)}`),e}async _setLocalDescription(e){p.log(`Setting local description ${JSON.stringify(e.sdp)}`);try{await this._pc.setLocalDescription(e)}catch(e){throw e.type="webrtc",p.error(e),this.emit(E.EVENTS.error.key,e),p.log("Failed to setLocalDescription, ",e),e}p.log("Set localDescription: offer"),this._isExpectingAnswer=!0,this.emit(E.EVENTS.offerCreated.key,e)}async _setRemoteDescription(e){p.log(`Setting remote description ${JSON.stringify(e)}`);try{await this._pc.setRemoteDescription(new RTCSessionDescription(e)),this.hasRemoteDescription=!0}catch(e){throw e.type="webrtc",p.error(e),this.emit(E.EVENTS.error.key,e),p.log("Failed to setRemoteDescription: ",e),e}p.log("Set remoteDescription:",e.type)}_getReceiveOnlyState(e={}){const t={audio:!1,video:!1},n=e.stream instanceof MediaStream,r=!!n&&0!==e.stream.getAudioTracks().length,i=!!n&&0!==e.stream.getVideoTracks().length;return!1===n&&void 0===e.audioReceiveEnabled&&void 0===e.videoReceiveEnabled?(t.audio=!0,t.video=!0,t):(e.audioReceiveEnabled&&!1===r&&(t.audio=!0),e.videoReceiveEnabled&&!1===i&&(t.video=!0),!1===e.audioReceiveEnabled&&r&&p.warn("Option audioReceiveEnabled will be treated as true, because passed stream has MediaStreamTrack(kind = audio)"),!1===e.videoReceiveEnabled&&i&&p.warn("Option videoReceiveEnabled will be treated as true, because passed stream has MediaStreamTrack(kind = video)"),t)}static get EVENTS(){return _}}var S=E,k=n("./node_modules/detect-browser/index.js"),C={validateId:function(e){return!e||/^[A-Za-z0-9_-]+(?:[ _-][A-Za-z0-9]+)*$/.exec(e)},validateKey:function(e){return!e||/^[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}$/.exec(e)},randomId:function(){return(Math.random().toString(36)+"0000000000000000000").substr(2,16)},randomToken:function(){return Math.random().toString(36).substr(2)},joinArrayBuffers:function(e){const t=e.reduce((e,t)=>e+t.byteLength,0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(new Uint8Array(t),r),r+=t.byteLength;return n.buffer},blobToArrayBuffer:function(e,t){const n=new FileReader;n.onload=e=>{t(e.target.result)},n.readAsArrayBuffer(e)},isSecure:function(){return"https:"===location.protocol},detectBrowser:function(){const{name:e,version:t}=Object(k.detect)(),[n,r,i]=t.split(".").map(e=>parseInt(e));return{name:e,major:n,minor:r,patch:i}},isPlanBSafari:function(){const{name:e}=Object(k.detect)();return("safari"===e||"ios"===e)&&!RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")}};const x=new s.a(["candidate","offer","answer","close","forceClose"]);class T extends i.a{constructor(e,t){if(super(),t=t||{},this.constructor===T)throw new TypeError("Cannot construct Connection instances directly");this._options=t,this.open=!1,this.type=void 0,this.metadata=this._options.metadata,this.remoteId=e,this._negotiator=new S,this._idPrefix="c_",this._randomIdSuffix=C.randomToken(),this._setupNegotiatorMessageHandlers()}get id(){return this._options.connectionId||this._idPrefix+this._randomIdSuffix}async handleAnswer(e){this._pcAvailable?(await this._negotiator.handleAnswer(e.answer),this.open=!0,this._handleQueuedMessages()):(p.log(`Queuing ANSWER message in ${this.id} from ${this.remoteId}`),this._queuedMessages.push({type:d.MESSAGE_TYPES.SERVER.ANSWER.key,payload:e}))}handleCandidate(e){!this._negotiator.originator||this._negotiator.hasRemoteDescription?this._pcAvailable?this._negotiator.handleCandidate(e.candidate):(p.log(`Queuing CANDIDATE message in ${this.id} from ${this.remoteId}`),this._queuedMessages.push({type:d.MESSAGE_TYPES.SERVER.CANDIDATE.key,payload:e})):this._queuedMessages.push({type:d.MESSAGE_TYPES.SERVER.CANDIDATE.key,payload:e})}updateOffer(e){this.open?this._negotiator.handleOffer(e.offer):this._options.payload=e}getPeerConnection(){return this.open?this._negotiator._pc:null}_handleQueuedMessages(){for(const e of this._queuedMessages)switch(e.type){case d.MESSAGE_TYPES.SERVER.ANSWER.key:this.handleAnswer(e.payload);break;case d.MESSAGE_TYPES.SERVER.CANDIDATE.key:this.handleCandidate(e.payload);break;default:p.warn("Unrecognized message type:",e.type,"from peer:",this.remoteId)}this._queuedMessages=[]}close(e=!1){this.open&&(this.open=!1,this._negotiator.cleanup(),this.emit(T.EVENTS.close.key),e&&this.emit(T.EVENTS.forceClose.key))}_setupNegotiatorMessageHandlers(){this._negotiator.on(S.EVENTS.answerCreated.key,e=>{const t={answer:e,dst:this.remoteId,connectionId:this.id,connectionType:this.type};this.emit(T.EVENTS.answer.key,t)}),this._negotiator.on(S.EVENTS.offerCreated.key,e=>{const t={offer:e,dst:this.remoteId,connectionId:this.id,connectionType:this.type,metadata:this.metadata};this.serialization&&(t.serialization=this.serialization),this.label&&(t.label=this.label),this.dcInit&&(t.dcInit=this.dcInit),this.emit(T.EVENTS.offer.key,t)}),this._negotiator.on(S.EVENTS.iceCandidate.key,e=>{const t={candidate:e,dst:this.remoteId,connectionId:this.id,connectionType:this.type};this.emit(T.EVENTS.candidate.key,t)}),this._negotiator.on(S.EVENTS.iceConnectionFailed.key,()=>{this.close()})}get peer(){return p.warn(`${this.constructor.name}.peer is deprecated and may be removed from a future version.`+` Please use ${this.constructor.name}.remoteId instead.`),this.remoteId}static get EVENTS(){return x}}var A=T,O=n("./node_modules/js-binarypack/lib/binarypack.js"),P=n.n(O),N=n("./node_modules/object-sizeof/index.js"),M=n.n(N);const R=new s.a(["open","data","error"]);R.extend(A.EVENTS.enums);const j=new s.a(["binary","binary-utf8","json","none"]);class B extends A{constructor(e,t){if(super(e,t),this._idPrefix="dc_",this.type="data",this._isOnOpenCalled=!1,this.label=this._options.label||this.id,this.dcInit=this._options.dcInit||{},this.serialization=B.SERIALIZATIONS.binary.key,this._options.serialization){if(!B.SERIALIZATIONS.get(this._options.serialization))throw new Error("Invalid serialization");this.serialization=this._options.serialization,this._isUnreliableDCInit(this.dcInit)&&(p.warn("You can not specify serialization with unreliable mode enabled."),this.serialization=B.SERIALIZATIONS.binary.key)}this._sendBuffer=[],this._receivedData={},this._queuedMessages=this._options.queuedMessages||[],this._negotiator.on(S.EVENTS.dcCreated.key,e=>{this._dc=e,this._dc.binaryType="arraybuffer",this._setupMessageHandlers(),this._isOnOpenCalled||"open"!==this._dc.readyState||this._dc.onopen()}),this._options.payload&&(this._options.payload.pcConfig=this._options.pcConfig)}async startConnection(){await this._negotiator.startConnection(this._options.payload||{originator:!0,type:"data",label:this.label,dcInit:this.dcInit,pcConfig:this._options.pcConfig}),this._pcAvailable=!0,this._handleQueuedMessages()}_setupMessageHandlers(){this._dc.onopen=()=>{this._isOnOpenCalled||(p.log("Data channel connection success"),this.open=!0,this._isOnOpenCalled=!0,this.emit(B.EVENTS.open.key))},this._dc.onmessage=e=>{this._handleDataMessage(e)},this._dc.onclose=()=>{p.log("DataChannel closed for:",this.id),this.close()},this._dc.onerror=e=>{p.error(e)}}_handleDataMessage(e){if(this.serialization===B.SERIALIZATIONS.none.key)return void this.emit(B.EVENTS.data.key,e.data);if(this.serialization===B.SERIALIZATIONS.json.key)return void this.emit(B.EVENTS.data.key,JSON.parse(e.data));const t=P.a.unpack(e.data);let n=this._receivedData[t.id];if(n||(n=this._receivedData[t.id]={size:t.size,type:t.type,name:t.name,mimeType:t.mimeType,totalParts:t.totalParts,parts:new Array(t.totalParts),receivedParts:0}),n.receivedParts++,n.parts[t.index]=t.data,n.receivedParts===n.totalParts){delete this._receivedData[t.id];const e=C.joinArrayBuffers(n.parts),r=P.a.unpack(e);let i;switch(n.type){case"Blob":i=new Blob([new Uint8Array(r)],{type:n.mimeType});break;case"File":i=new File([new Uint8Array(r)],n.name,{type:n.mimeType});break;default:i=r}this.emit(B.EVENTS.data.key,i)}}send(e){if(!this.open)return void this.emit(B.EVENTS.error.key,new Error("Connection is not open. You should listen for the `open` event before sending messages."));if(null==e)return;if(this.serialization===B.SERIALIZATIONS.none.key)return this._sendBuffer.push(e),void this._startSendLoop();if(this.serialization===B.SERIALIZATIONS.json.key)return this._sendBuffer.push(JSON.stringify(e)),void this._startSendLoop();const t=P.a.pack(e),n=t.size,r=e.constructor.name,i={id:C.randomId(),type:r,size:n,totalParts:0};"File"===r&&(i.name=e.name),e instanceof Blob&&(i.mimeType=e.type);const o=d.maxChunkSize-M()(i),s=Math.ceil(n/o);i.totalParts=s;for(let e=0;e{this._sendBuffer.push(e),this._startSendLoop()})}}close(e){super.close(e),this._isOnOpenCalled=!1}_startSendLoop(){this.sendInterval||(this.sendInterval=setInterval(()=>{const e=this._sendBuffer.shift();try{this._dc.send(e)}catch(t){this._sendBuffer.push(e)}0===this._sendBuffer.length&&(clearInterval(this.sendInterval),this.sendInterval=void 0)},d.sendInterval))}_isUnreliableDCInit(e){return!!e&&("maxRetransmits"in e||"maxPacketLifeTime"in e)}static get SERIALIZATIONS(){return j}static get EVENTS(){return R}}var F=B;const I=new s.a(["stream"]);I.extend(A.EVENTS.enums);class L extends A{constructor(e,t){super(e,t),this._idPrefix="mc_",this.type="media",this.localStream=this._options.stream,this._queuedMessages=this._options.queuedMessages||[],this._pcAvailable=!1}async startConnection(){this._options.originator&&(await this._negotiator.startConnection({type:"media",stream:this.localStream,originator:this._options.originator,pcConfig:this._options.pcConfig,videoBandwidth:this._options.videoBandwidth,audioBandwidth:this._options.audioBandwidth,videoCodec:this._options.videoCodec,audioCodec:this._options.audioCodec,videoReceiveEnabled:this._options.videoReceiveEnabled,audioReceiveEnabled:this._options.audioReceiveEnabled}),this._pcAvailable=!0,this._handleQueuedMessages())}answer(e,t={}){this.localStream?p.warn("localStream already exists on this MediaConnection. Are you answering a call twice?"):(this._options.payload.stream=e,this.localStream=e,this._negotiator.startConnection({type:"media",stream:this.localStream,originator:!1,offer:this._options.payload.offer,pcConfig:this._options.pcConfig,audioBandwidth:t.audioBandwidth,videoBandwidth:t.videoBandwidth,videoCodec:t.videoCodec,audioCodec:t.audioCodec}),this._pcAvailable=!0,this._handleQueuedMessages(),this.open=!0)}replaceStream(e){this._negotiator.replaceStream(e),this.localStream=e}_setupNegotiatorMessageHandlers(){super._setupNegotiatorMessageHandlers(),this._negotiator.on(S.EVENTS.addStream.key,e=>{p.log("Receiving stream",e),this.remoteStream&&this.remoteStream.id===e.id||(this.remoteStream=e,this.emit(L.EVENTS.stream.key,e))})}static get EVENTS(){return I}}var D=L;const V=new s.a(["stream","open","close","peerJoin","peerLeave","error","data","log"]),U=new s.a(["offer","answer","candidate","leave","close","getLog","broadcast"]);class z extends i.a{constructor(e,t,n={}){if(super(),this.constructor===z)throw new TypeError("Cannot construct Room instances directly");this.name=e,this._options=n,this._peerId=t,this._localStream=this._options.stream,this._pcConfig=this._options.pcConfig}handleData(e){const t={data:e.data,src:e.src};this.emit(z.EVENTS.data.key,t)}handleLog(e){this.emit(z.EVENTS.log.key,e)}getLog(){const e={roomName:this.name};this.emit(z.MESSAGE_EVENTS.getLog.key,e)}static get EVENTS(){return V}static get MESSAGE_EVENTS(){return U}}var q=z;const W=new s.a([]);W.extend(q.EVENTS.enums);const G=new s.a(["offerRequest","candidate"]);G.extend(q.MESSAGE_EVENTS.enums);class H extends q{constructor(e,t,n){super(e,t,n),this.remoteStreams={},this.members=[],this._open=!1,this._msidMap={},this._unknownStreams={},this._negotiator=new S}call(e){e&&(this._localStream=e);const t={roomName:this.name};this.emit(H.MESSAGE_EVENTS.offerRequest.key,t)}handleOffer(e){let t=e.offer;C.isPlanBSafari()&&(t=w.unifiedToPlanB(t)),this._connectionStarted?this._negotiator.handleOffer(t):(this._negotiator.startConnection({type:"media",stream:this._localStream,pcConfig:this._options.pcConfig,offer:t}),this._setupNegotiatorMessageHandlers(),this._connectionStarted=!0)}_setupNegotiatorMessageHandlers(){this._negotiator.on(S.EVENTS.addStream.key,e=>{const t=e;if(this._msidMap[t.id]){if(t.peerId=this._msidMap[t.id],t.peerId===this._peerId)return;const e=this.remoteStreams[t.id];if(e&&e.id===t.id)return;this.remoteStreams[t.id]=t,this.emit(H.EVENTS.stream.key,t),p.log(`Received remote media stream for ${t.peerId} in ${this.name}`)}else this._unknownStreams[t.id]=t}),this._negotiator.on(S.EVENTS.negotiationNeeded.key,()=>{const e={roomName:this.name};this.emit(H.MESSAGE_EVENTS.offerRequest.key,e)}),this._negotiator.on(S.EVENTS.answerCreated.key,e=>{C.isPlanBSafari()||(e.sdp=w.ensureUnifiedPlan(e.sdp));const t={roomName:this.name,answer:e};this.emit(H.MESSAGE_EVENTS.answer.key,t)}),this._negotiator.on(S.EVENTS.iceConnectionFailed.key,()=>{this.close()}),this._negotiator.on(S.EVENTS.iceCandidate.key,e=>{const t={roomName:this.name,candidate:e};this.emit(H.MESSAGE_EVENTS.candidate.key,t)})}handleJoin(e){const{src:t,roomMembers:n}=e;if(t===this._peerId)return this._open=!0,this.members=n.filter(e=>e!==t),this.call(this._localStream),void this.emit(H.EVENTS.open.key);this.members.push(t),this.emit(H.EVENTS.peerJoin.key,t)}handleLeave(e){if(!this._open)return;const t=e.src,n=this.members.indexOf(t);n>=0&&this.members.splice(n,1);for(const e in this.remoteStreams)this.remoteStreams[e].peerId===t&&(delete this.remoteStreams[e],delete this._msidMap[e],delete this._unknownStreams[e]);this.emit(H.EVENTS.peerLeave.key,t)}send(e){if(!this._open)return;const t={roomName:this.name,data:e};this.emit(H.MESSAGE_EVENTS.broadcast.key,t)}close(){if(!this._open)return;this._negotiator&&this._negotiator.cleanup(),this._open=!1;const e={roomName:this.name};this.emit(H.MESSAGE_EVENTS.leave.key,e),this.emit(H.EVENTS.close.key)}replaceStream(e){this._localStream=e,this._negotiator.replaceStream(e)}updateMsidMap(e={}){this._msidMap=e;for(const e of Object.keys(this._unknownStreams))if(this._msidMap[e]){const t=this._unknownStreams[e];if(t.peerId=this._msidMap[t.id],delete this._unknownStreams[e],t.peerId===this._peerId)return;this.remoteStreams[t.id]=t,this.emit(H.EVENTS.stream.key,t)}}static get EVENTS(){return W}static get MESSAGE_EVENTS(){return G}}var $=H;const Y=new s.a([]);Y.extend(q.EVENTS.enums);const K=new s.a(["broadcastByDC","getPeers"]);K.extend(q.MESSAGE_EVENTS.enums);class Q extends q{constructor(e,t,n){super(e,t,n),this.connections={},this._queuedMessages={}}call(e){e&&(this._localStream=e);const t={roomName:this.name,type:"media"};this.emit(Q.MESSAGE_EVENTS.getPeers.key,t)}connect(){const e={roomName:this.name,type:"data"};this.emit(Q.MESSAGE_EVENTS.getPeers.key,e)}makeMediaConnections(e){const t={stream:this._localStream,pcConfig:this._pcConfig,originator:!0,videoBandwidth:this._options.videoBandwidth,audioBandwidth:this._options.audioBandwidth,videoCodec:this._options.videoCodec,audioCodec:this._options.audioCodec,videoReceiveEnabled:this._options.videoReceiveEnabled,audioReceiveEnabled:this._options.audioReceiveEnabled};this._makeConnections(e,"media",t)}makeDataConnections(e){const t={pcConfig:this._pcConfig};this._makeConnections(e,"data",t)}handleJoin(e){const t=e.src;if(t===this._peerId)return this.call(this._localStream),void this.emit(Q.EVENTS.open.key);this.emit(Q.EVENTS.peerJoin.key,t)}handleLeave(e){const t=e.src;this._deleteConnections(t),this.emit(Q.EVENTS.peerLeave.key,t)}handleOffer(e){const t=e.connectionId;let n=this._getConnection(e.src,t);n?n.updateOffer(e):"media"===e.connectionType?(n=new D(e.src,{connectionId:t,payload:e,metadata:e.metadata,queuedMessages:this._queuedMessages[t],pcConfig:this._pcConfig}),n.startConnection(),p.log("MediaConnection created in OFFER"),this._addConnection(e.src,n),this._setupMessageHandlers(n),n.answer(this._localStream,{videoBandwidth:this._options.videoBandwidth,audioBandwidth:this._options.audioBandwidth,videoCodec:this._options.videoCodec,audioCodec:this._options.audioCodec,videoReceiveEnabled:this._options.videoReceiveEnabled,audioReceiveEnabled:this._options.audioReceiveEnabled})):p.warn(`Received malformed connection type: ${e.connectionType}`)}handleAnswer(e){const t=this._getConnection(e.src,e.connectionId);t&&t.handleAnswer(e)}handleCandidate(e){const t=this._getConnection(e.src,e.connectionId);t?t.handleCandidate(e):(void 0===this._queuedMessages[e.connectionId]&&(this._queuedMessages[e.connectionId]=[]),this._queuedMessages[e.connectionId].push({type:d.MESSAGE_TYPES.SERVER.CANDIDATE.key,payload:e}))}send(e){const t={roomName:this.name,data:e};this.emit(Q.MESSAGE_EVENTS.broadcast.key,t)}close(){for(const e in this.connections)this.connections.hasOwnProperty(e)&&this.connections[e].forEach(e=>{e.close()});const e={roomName:this.name};this.emit(Q.MESSAGE_EVENTS.leave.key,e),this.emit(Q.EVENTS.close.key)}replaceStream(e){this._localStream=e;for(const t in this.connections)this.connections.hasOwnProperty(t)&&this.connections[t].forEach(t=>{"media"===t.type&&t.replaceStream(e)})}_addConnection(e,t){this.connections[e]||(this.connections[e]=[]),this.connections[e].push(t)}_makeConnections(e,t,n){e.filter(e=>e!==this._peerId).forEach(e=>{let r;switch(t){case"data":r=new F(e,n);break;case"media":r=new D(e,n);break;default:return}r.startConnection(),this._addConnection(e,r),this._setupMessageHandlers(r),p.log(`${t} connection to ${e} created in ${this.name}`)})}_deleteConnections(e){this.connections[e]&&delete this.connections[e]}_getConnection(e,t){return this.connections&&this.connections[e]?this.connections[e].filter(e=>e.id===t)[0]:null}_setupMessageHandlers(e){e.on(A.EVENTS.offer.key,e=>{e.roomName=this.name,this.emit(Q.MESSAGE_EVENTS.offer.key,e)}),e.on(A.EVENTS.answer.key,e=>{e.roomName=this.name,this.emit(Q.MESSAGE_EVENTS.answer.key,e)}),e.on(A.EVENTS.candidate.key,e=>{e.roomName=this.name,this.emit(Q.MESSAGE_EVENTS.candidate.key,e)}),"media"===e.type&&e.on(D.EVENTS.stream.key,t=>{t.peerId=e.remoteId,this.emit(Q.EVENTS.stream.key,t)})}static get EVENTS(){return Y}static get MESSAGE_EVENTS(){return K}}var J=Q;const X=new s.a(["open","error","call","connection","expiresin","close","disconnected"]);class Z extends i.a{constructor(e,t){super(),this.connections={},this.rooms={},this._queuedMessages={},e&&e.constructor===Object?(t=e,e=void 0):e&&(e=e.toString());const n={debug:p.LOG_LEVELS.NONE,secure:!0,config:d.defaultConfig,turn:!0,dispatcherSecure:d.DISPATCHER_SECURE,dispatcherHost:d.DISPATCHER_HOST,dispatcherPort:d.DISPATCHER_PORT};this.options=Object.assign({},n,t),this.options.token=C.randomToken(),p.setLogLevel(this.options.debug),C.validateId(e)?C.validateKey(t.key)?("/"===this.options.host&&(this.options.host=window.location.hostname),void 0===t.secure&&443!==this.options.port&&(this.options.secure=void 0),this._initializeServerConnection(e)):this._abort("invalid-key",`API KEY "${this.options.key}" is invalid`):this._abort("invalid-id",`ID "${e}" is invalid`)}call(e,t,n={}){if(!this._checkOpenStatus())return;n.originator=!0,n.stream=t,n.pcConfig=this._pcConfig;const r=new D(e,n);return r.startConnection(),p.log("MediaConnection created in call method"),this._addConnection(e,r),r}connect(e,t={}){if(!this._checkOpenStatus())return;t.pcConfig=this._pcConfig;const n=new F(e,t);return n.startConnection(),p.log("DataConnection created in connect method"),this._addConnection(e,n),n}joinRoom(e,t={}){if(this._checkOpenStatus()){if(!e){const e=new Error("Room name must be defined.");return e.type="room-error",p.error(e),this.emit(Z.EVENTS.error.key,e),null}return t.pcConfig=this._pcConfig,t.peerId=this.id,"sfu"===t.mode?this._initializeSfuRoom(e,t):this._initializeFullMeshRoom(e,t)}}getConnection(e,t){if(this._checkOpenStatus()){if(this.connections[e])for(const n of this.connections[e])if(n.id===t)return n;return null}}get open(){return this.socket&&this.socket.isOpen}destroy(){this._cleanup(),this.disconnect()}disconnect(){this.open&&(this.socket.close(),this.emit(Z.EVENTS.disconnected.key,this.id))}reconnect(){this.open||this.socket.reconnect()}updateCredential(e){this.socket.updateCredential(e)}listAllPeers(e){if(!this._checkOpenStatus())return;e=e||function(){};const t=this,n=new XMLHttpRequest,r=`${this.socket.signalingServerUrl}/api/apikeys/${this.options.key}/clients/`;n.open("get",r,!0),n.onerror=function(){t._abort("server-error","Could not get peers from the server."),e([])},n.onreadystatechange=function(){if(4===n.readyState)if(401===n.status){e([]);const n=new Error("It doesn't look like you have permission to list peers IDs. Please enable the SkyWay REST API on dashboard");n.type="list-error",p.error(n),t.emit(Z.EVENTS.error.key,n)}else 200===n.status?e(JSON.parse(n.responseText)):e([])},n.send(null)}_checkOpenStatus(){return this.open||this._emitNotConnectedError(),this.open}_emitNotConnectedError(){p.warn("You cannot connect to a new Peer because you are not connecting to SkyWay server now.You can create a new Peer to reconnect, or call reconnect() on this peer if you believe its ID to still be available.");const e=new Error("Cannot connect to new Peer before connecting to SkyWay server or after disconnecting from the server.");e.type="disconnected",p.error(e),this.emit(Z.EVENTS.error.key,e)}_initializeServerConnection(e){this.socket=new g(this.options.key,{secure:this.options.secure,host:this.options.host,port:this.options.port,dispatcherSecure:this.options.dispatcherSecure,dispatcherHost:this.options.dispatcherHost,dispatcherPort:this.options.dispatcherPort}),this._setupMessageHandlers(),this.socket.on("error",e=>{this._abort("socket-error",e)}),this.socket.on("disconnect",()=>{this.disconnect();const e=new Error("Lost connection to server.");e.type="socket-error",p.error(e),this.emit(Z.EVENTS.error.key,e)}),this.socket.start(e,this.options.token,this.options.credential)}_initializeSfuRoom(e,t={}){if(this.rooms[e])return this.rooms[e];const n=new $(e,this.id,t);this.rooms[e]=n,this._setupSFURoomMessageHandlers(n);const r={roomName:e,roomType:"sfu"};return this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_JOIN.key,r),n}_initializeFullMeshRoom(e,t={}){if(this.rooms[e])return this.rooms[e];const n=new J(e,this.id,t);this.rooms[e]=n,this._setupMeshRoomMessageHandlers(n);const r={roomName:e,roomType:"mesh"};return this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_JOIN.key,r),n}_setupMessageHandlers(){this.socket.on(d.MESSAGE_TYPES.SERVER.OPEN.key,e=>{this.id=e.peerId,this._pcConfig=Object.assign({},this.options.config);const t=this._pcConfig.iceServers;this._pcConfig.iceServers=t?t.slice():[];const n=e.turnCredential;let r,i;if("object"==typeof n?(r=n.username,i=n.credential):"string"==typeof n&&(r=`${this.options.key}$${this.id}`,i=n),!0===this.options.turn&&r&&i){const e=[{protocol:"turn",transport:"tcp"},{protocol:"turn",transport:"udp"}];"edge"!==C.detectBrowser().name&&e.push({protocol:"turns",transport:"tcp"});for(const t of e){const e=t.protocol,n=t.transport,o={urls:`${e}:${d.TURN_HOST}:${d.TURN_PORT}?transport=${n}`,url:`${e}:${d.TURN_HOST}:${d.TURN_PORT}?transport=${n}`,username:r,credential:i};this._pcConfig.iceServers.push(o)}p.log("SkyWay TURN Server is available")}else p.log("SkyWay TURN Server is unavailable");this.emit(Z.EVENTS.open.key,this.id)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ERROR.key,e=>{const t=new Error(e.message);t.type=e.type,p.error(t),this.emit(Z.EVENTS.error.key,t)}),this.socket.on(d.MESSAGE_TYPES.SERVER.LEAVE.key,e=>{p.log(`Received leave message from ${e}`),this._cleanupPeer(e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.FORCE_CLOSE.key,({src:e,connectionId:t})=>{const n=this.getConnection(e,t);n&&n.close(!1)}),this.socket.on(d.MESSAGE_TYPES.SERVER.AUTH_EXPIRES_IN.key,e=>{p.log(`Credential expires in ${e}`),this.emit(Z.EVENTS.expiresin.key,e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.OFFER.key,e=>{const t=e.roomName;if(t){const n=this.rooms[t];return void(n&&n.handleOffer(e))}const n=e.connectionId;let r=this.getConnection(e.src,n);r?r.updateOffer(e):("media"===e.connectionType?(r=new D(e.src,{connectionId:n,payload:e,metadata:e.metadata,originator:!1,queuedMessages:this._queuedMessages[n],pcConfig:this._pcConfig}),r.startConnection(),p.log("MediaConnection created in OFFER"),this._addConnection(e.src,r),this.emit(Z.EVENTS.call.key,r)):"data"===e.connectionType?(r=new F(e.src,{connectionId:n,payload:e,metadata:e.metadata,label:e.label,dcInit:e.dcInit,serialization:e.serialization,queuedMessages:this._queuedMessages[n],pcConfig:this._pcConfig}),r.startConnection(),p.log("DataConnection created in OFFER"),this._addConnection(e.src,r),this.emit(Z.EVENTS.connection.key,r)):p.warn("Received malformed connection type: ",e.connectionType),delete this._queuedMessages[n])}),this.socket.on(d.MESSAGE_TYPES.SERVER.ANSWER.key,e=>{const t=e.roomName;if(t){const n=this.rooms[t];return void(n&&n.handleAnswer(e))}const n=this.getConnection(e.src,e.connectionId);n?n.handleAnswer(e):this._storeMessage(d.MESSAGE_TYPES.SERVER.ANSWER.key,e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.CANDIDATE.key,e=>{const t=e.roomName;if(t){const n=this.rooms[t];return void(n&&n.handleCandidate(e))}const n=this.getConnection(e.src,e.connectionId);n?n.handleCandidate(e):this._storeMessage(d.MESSAGE_TYPES.SERVER.CANDIDATE.key,e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ROOM_USER_JOIN.key,e=>{const t=this.rooms[e.roomName];t&&t.handleJoin(e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ROOM_USER_LEAVE.key,e=>{const t=this.rooms[e.roomName];t&&t.handleLeave(e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ROOM_DATA.key,e=>{const t=this.rooms[e.roomName];t&&t.handleData(e)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ROOM_LOGS.key,e=>{const t=this.rooms[e.roomName];t&&t.handleLog(e.log)}),this.socket.on(d.MESSAGE_TYPES.SERVER.ROOM_USERS.key,e=>{const t=this.rooms[e.roomName];t&&("media"===e.type?t.makeMediaConnections(e.userList):t.makeDataConnections(e.userList))}),this.socket.on(d.MESSAGE_TYPES.SERVER.SFU_OFFER.key,e=>{const t=this.rooms[e.roomName];t&&(t.updateMsidMap(e.msids),t.handleOffer(e))})}_setupConnectionMessageHandlers(e){e.on(A.EVENTS.candidate.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_CANDIDATE.key,e)}),e.on(A.EVENTS.answer.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_ANSWER.key,e)}),e.on(A.EVENTS.offer.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_OFFER.key,e)}),e.on(A.EVENTS.forceClose.key,()=>{const t={dst:e.remoteId,connectionId:e.id};this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_FORCE_CLOSE.key,t)})}_setupRoomMessageHandlers(e){e.on($.MESSAGE_EVENTS.broadcast.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_SEND_DATA.key,e)}),e.on($.MESSAGE_EVENTS.getLog.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_GET_LOGS.key,e)}),e.on($.MESSAGE_EVENTS.leave.key,t=>{delete this.rooms[e.name],this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_LEAVE.key,t)})}_setupSFURoomMessageHandlers(e){this._setupRoomMessageHandlers(e),e.on($.MESSAGE_EVENTS.offerRequest.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SFU_GET_OFFER.key,e)}),e.on($.MESSAGE_EVENTS.answer.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SFU_ANSWER.key,e)}),e.on($.MESSAGE_EVENTS.candidate.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SFU_CANDIDATE.key,e)})}_setupMeshRoomMessageHandlers(e){this._setupRoomMessageHandlers(e),e.on(J.MESSAGE_EVENTS.offer.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_OFFER.key,e)}),e.on(J.MESSAGE_EVENTS.answer.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_ANSWER.key,e)}),e.on(J.MESSAGE_EVENTS.candidate.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.SEND_CANDIDATE.key,e)}),e.on(J.MESSAGE_EVENTS.getPeers.key,e=>{this.socket.send(d.MESSAGE_TYPES.CLIENT.ROOM_GET_USERS.key,e)})}_abort(e,t){p.error("Aborting!"),this.disconnect();const n=new Error(t);n.type=e,p.error(n),this.emit(Z.EVENTS.error.key,n)}_addConnection(e,t){this.connections[e]||(this.connections[e]=[]),this.connections[e].push(t),this._setupConnectionMessageHandlers(t)}_storeMessage(e,t){this._queuedMessages[t.connectionId]||(this._queuedMessages[t.connectionId]=[]),this._queuedMessages[t.connectionId].push({type:e,payload:t})}_cleanup(){if(this.connections)for(const e of Object.keys(this.connections))this._cleanupPeer(e);this.emit(Z.EVENTS.close.key)}_cleanupPeer(e){if(this.connections[e])for(const t of this.connections[e])t.close()}static get EVENTS(){return X}}t.default=Z},0: /*!********************!*\ !*** ws (ignored) ***! \********************/ /*! no static exports found */ -/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){}}).default},e.exports=r()},function(e,t,n){"use strict";var r=n(1),i=n(8),o=n(7),s=n(4),a=n(0),u=n(3),c=n(5);const l=["👍","👎","👏","✋","🆗","🆖","🆒","💯","💩","😭"];var d=({onClickSend:e})=>Object(a.c)("div",{css:f},l.map(t=>Object(a.c)("div",{key:t,css:p},Object(a.c)("button",{css:h,onClick:()=>e(t)},Object(a.c)("i",{css:m},t)))));const f=Object(a.b)({position:"absolute",top:0,right:c.b,zIndex:c.d.modal},";label:wrapperStyle;"),p=Object(a.b)({height:c.b,width:c.b,boxSizing:"border-box",backgroundColor:u.c.gray,borderBottom:`1px solid ${u.c.white}`},";label:boxStyle;"),h={name:"1vomiw9-reactionStyle",styles:"width:100%;height:100%;padding:0 1;appearance:none;border:none;background:none;color:inherit;cursor:pointer;;label:reactionStyle;"},m={name:"112esbq-emojiStyle",styles:"font-size:1.0rem;font-style:normal;;label:emojiStyle;"};var y=n(6);const g=n.n(y)()("effect:reaction");n.d(t,"a",(function(){return v}));const v=()=>{const e=Object(r.useContext)(o.a),t=Object(r.useCallback)((({ui:e})=>()=>{g(`toggleReaction() -> ${!e.isReactionOpen}`),e.isReactionOpen=!e.isReactionOpen})(e),[e]),n=Object(r.useCallback)((({room:e,client:t})=>n=>{g("sendReaction()",n),e.addReaction(t.displayName,n)})(e),[e]),{ui:u}=e;return Object(a.c)(i.a,null,()=>Object(a.c)(r.Fragment,null,Object(a.c)(s.c,{name:"insert_emoticon",onClick:t}),u.isReactionOpen?Object(a.c)(d,{onClickSend:n}):null))}},function(e,t,n){"use strict"; -/** @license React v16.12.0 +/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){}}).default},e.exports=r()},function(e,t,n){"use strict";var r=n(1),i=n(35),o=n(7),s=n(4),a=n(0),u=n(3),c=n(5);const l=["👍","👎","👏","✋","🆗","🆖","🆒","💯","💩","😭"];var d=({onClickSend:e})=>Object(a.c)("div",{css:f},l.map(t=>Object(a.c)("div",{key:t,css:p},Object(a.c)("button",{css:h,onClick:()=>e(t)},Object(a.c)("i",{css:m},t)))));const f=Object(a.b)({position:"absolute",top:0,right:c.b,zIndex:c.d.modal},";label:wrapperStyle;"),p=Object(a.b)({height:c.b,width:c.b,boxSizing:"border-box",backgroundColor:u.c.gray,borderBottom:`1px solid ${u.c.white}`},";label:boxStyle;"),h={name:"1vomiw9-reactionStyle",styles:"width:100%;height:100%;padding:0 1;appearance:none;border:none;background:none;color:inherit;cursor:pointer;;label:reactionStyle;"},m={name:"112esbq-emojiStyle",styles:"font-size:1.0rem;font-style:normal;;label:emojiStyle;"};var g=n(6);const y=n.n(g)()("effect:reaction");n.d(t,"a",(function(){return v}));const v=()=>{const e=Object(r.useContext)(o.a),t=Object(r.useCallback)((({ui:e})=>()=>{y(`toggleReaction() -> ${!e.isReactionOpen}`),e.isReactionOpen=!e.isReactionOpen})(e),[e]),n=Object(r.useCallback)((({room:e,client:t})=>n=>{y("sendReaction()",n),e.addReaction(t.displayName,n)})(e),[e]),{ui:u}=e;return Object(a.c)(i.a,null,()=>Object(a.c)(r.Fragment,null,Object(a.c)(s.c,{name:"insert_emoticon",onClick:t}),u.isReactionOpen?Object(a.c)(d,{onClickSend:n}):null))}},function(e,t,n){"use strict"; +/** @license React v16.13.0 * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r=n(17),i="function"==typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,s=i?Symbol.for("react.portal"):60106,a=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,c=i?Symbol.for("react.profiler"):60114,l=i?Symbol.for("react.provider"):60109,d=i?Symbol.for("react.context"):60110,f=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113;i&&Symbol.for("react.suspense_list");var h=i?Symbol.for("react.memo"):60115,m=i?Symbol.for("react.lazy"):60116;i&&Symbol.for("react.fundamental"),i&&Symbol.for("react.responder"),i&&Symbol.for("react.scope");var y="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nN.length&&N.push(e)}function j(e,t,n){return null==e?0:function e(t,n,r,i){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var u=!1;if(null===t)u=!0;else switch(a){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case o:case s:u=!0}}if(u)return r(i,t,""===n?"."+B(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;cP.length&&P.push(e)}function R(e,t,n){return null==e?0:function e(t,n,r,i){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var u=!1;if(null===t)u=!0;else switch(a){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case o:case s:u=!0}}if(u)return r(i,t,""===n?"."+j(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c