9 lines
222 KiB
JavaScript
9 lines
222 KiB
JavaScript
import{m as cv,B as fv,G as lv,P as Hu,W as dv,R as pv,C as hv,n as gv}from"./index-17a5ec1d.js";import{g as qu,c as Kn}from"./overlayscrollbars-44d87bcf.js";import{a4 as Uo,a5 as fi,a6 as li,a7 as er}from"./echarts-ff51454d.js";import{l as mv,m as vv,q as yv}from"./vuetify-4c65b4c3.js";function _v(i,s){for(var n=0;n<s.length;n++){const o=s[n];if(typeof o!="string"&&!Array.isArray(o)){for(const a in o)if(a!=="default"&&!(a in i)){const u=Object.getOwnPropertyDescriptor(o,a);u&&Object.defineProperty(i,a,u.get?u:{enumerable:!0,get:()=>o[a]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}f.sessions=new Map;f.isExtensionEnabled=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;if(window.navigator.userAgent.match("Chrome")){let i=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),s=33;return window.navigator.userAgent.match("Linux")&&(s=35),i>=26&&i<=s?!0:f.extension.isInstalled()}else return!0};var Ju={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return document.querySelector("#janus-extension-installed")!==null},getScreen:function(i){let s=window.setTimeout(function(){let n=new Error("NavigatorUserMediaError");return n.name='The required Chrome extension is not installed: click <a href="#">here</a> to install it. (NOTE: this will need you to refresh the page)',i(n)},1e3);this.cache[s]=i,window.postMessage({type:"janusGetScreen",id:s},"*")},init:function(){let i={};this.cache=i,window.addEventListener("message",function(s){if(s.origin==window.location.origin)if(s.data.type=="janusGotScreen"&&i[s.data.id]){let n=i[s.data.id];if(delete i[s.data.id],s.data.sourceId===""){let o=new Error("NavigatorUserMediaError");o.name="You cancelled the request for permission, giving up...",n(o)}else n(null,s.data.sourceId)}else s.data.type=="janusGetScreenPending"&&window.clearTimeout(s.data.id)})}};f.useDefaultDependencies=function(i){let s=i&&i.fetch||fetch,n=i&&i.Promise||Promise,o=i&&i.WebSocket||WebSocket;return{newWebSocket:function(a,u){return new o(a,u)},extension:i&&i.extension||Ju,isArray:function(a){return Array.isArray(a)},webRTCAdapter:i&&i.adapter||adapter,httpAPICall:function(a,u){let p={method:u.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};u.verb==="POST"&&(p.headers["Content-Type"]="application/json"),typeof u.withCredentials<"u"&&(p.credentials=u.withCredentials===!0?"include":u.withCredentials?u.withCredentials:"omit"),u.body&&(p.body=JSON.stringify(u.body));let g=s(a,p).catch(function(T){return n.reject({message:"Probably a network error, is the server down?",error:T})});if(u.timeout){let T=new n(function(l,_){let D=setTimeout(function(){return clearTimeout(D),_({message:"Request timed out",timeout:u.timeout})},u.timeout)});g=n.race([g,T])}return g.then(function(T){if(T.ok){if(typeof u.success==typeof f.noop)return T.json().then(function(l){try{u.success(l)}catch(_){f.error("Unhandled httpAPICall success callback error",_)}},function(l){return n.reject({message:"Failed to parse response body",error:l,response:T})})}else return n.reject({message:"API call failed",response:T})}).catch(function(T){typeof u.error==typeof f.noop&&u.error(T.message||"<< internal error >>",T)}),g}}};f.useOldDependencies=function(i){let s=i&&i.jQuery||jQuery,n=i&&i.WebSocket||WebSocket;return{newWebSocket:function(o,a){return new n(o,a)},isArray:function(o){return s.isArray(o)},extension:i&&i.extension||Ju,webRTCAdapter:i&&i.adapter||adapter,httpAPICall:function(o,a){let u=typeof a.body<"u"?{contentType:"application/json",data:JSON.stringify(a.body)}:{},p=typeof a.withCredentials<"u"?{xhrFields:{withCredentials:a.withCredentials}}:{};return s.ajax(s.extend(u,p,{url:o,type:a.verb,cache:!1,dataType:"json",async:a.async,timeout:a.timeout,success:function(g){typeof a.success==typeof f.noop&&a.success(g)},error:function(g,T,l){typeof a.error==typeof f.noop&&a.error(T,l)}}))}}};f.mediaToTracks=function(i){let s=[];if(!i)s.push({type:"audio",capture:!0,recv:!0}),s.push({type:"video",capture:!0,recv:!0});else{if(!i.keepAudio&&i.audio!==!1&&(typeof i.audio>"u"||i.audio||i.audioSend||i.audioRecv||i.addAudio||i.replaceAudio||i.removeAudio)){let n={type:"audio"};i.removeAudio?n.remove=!0:(i.addAudio?n.add=!0:i.replaceAudio&&(n.replace=!0),i.audioSend!==!1&&(n.capture=i.audio||!0),i.audioRecv!==!1&&(n.recv=!0)),(n.remove||n.capture||n.recv)&&s.push(n)}if(!i.keepVideo&&i.video!==!1&&(typeof i.video>"u"||i.video||i.videoSend||i.videoRecv||i.addVideo||i.replaceVideo||i.removeVideo)){let n={type:"video"};i.removeVideo?n.remove=!0:(i.addVideo?n.add=!0:i.replaceVideo&&(n.replace=!0),i.videoSend!==!1&&(n.capture=i.video||!0,["screen","window","desktop"].includes(n.capture)&&(n.type="screen",n.capture={video:{}},i.screenshareFrameRate&&(n.capture.frameRate=i.screenshareFrameRate),i.screenshareHeight&&(n.capture.height=i.screenshareHeight),i.screenshareWidth&&(n.capture.width=i.screenshareWidth))),i.videoRecv!==!1&&(n.recv=!0)),(n.remove||n.capture||n.recv)&&s.push(n)}i.data&&s.push({type:"data"})}return s};f.trackConstraints=function(i){let s={};if(!i||!i.capture)return s;if(i.type==="audio")s.audio=i.capture;else if(i.type==="video")if((i.simulcast||i.svc)&&i.capture===!0&&(i.capture="hires"),i.capture===!0||typeof i.capture=="object")s.video=i.capture;else{let n=0,o=0;i.capture==="lowres"?(n=320,o=240):i.capture==="lowres-16:9"?(n=320,o=180):i.capture==="hires"||i.capture==="hires-16:9"||i.capture==="hdres"?(n=1280,o=720):i.capture==="fhdres"?(n=1920,o=1080):i.capture==="4kres"?(n=3840,o=2160):i.capture==="stdres"?(n=640,o=480):i.capture==="stdres-16:9"?(n=640,o=360):(f.log("Default video setting is stdres 4:3"),n=640,o=480),s.video={width:{ideal:n},height:{ideal:o}}}else i.type==="screen"&&(s.video=i.capture);return s};f.noop=function(){};f.dataChanDefaultLabel="JanusDataChannel";f.endOfCandidates=null;f.stopAllTracks=function(i){try{let s=i.getTracks();for(let n of s)f.log(n),n&&n.dontStop!==!0&&n.stop()}catch{}};f.init=function(i){if(i=i||{},i.callback=typeof i.callback=="function"?i.callback:f.noop,f.initDone)i.callback();else{if(typeof console.log>"u"&&(console.log=function(){}),f.trace=f.noop,f.debug=f.noop,f.vdebug=f.noop,f.log=f.noop,f.warn=f.noop,f.error=f.noop,i.debug===!0||i.debug==="all")f.trace=console.trace.bind(console),f.debug=console.debug.bind(console),f.vdebug=console.debug.bind(console),f.log=console.log.bind(console),f.warn=console.warn.bind(console),f.error=console.error.bind(console);else if(Array.isArray(i.debug))for(let u of i.debug)switch(u){case"trace":f.trace=console.trace.bind(console);break;case"debug":f.debug=console.debug.bind(console);break;case"vdebug":f.vdebug=console.debug.bind(console);break;case"log":f.log=console.log.bind(console);break;case"warn":f.warn=console.warn.bind(console);break;case"error":f.error=console.error.bind(console);break}f.log("Initializing library");let s=i.dependencies||f.useDefaultDependencies();f.isArray=s.isArray,f.webRTCAdapter=s.webRTCAdapter,f.httpAPICall=s.httpAPICall,f.newWebSocket=s.newWebSocket,f.extension=s.extension,f.extension.init(),f.listDevices=function(u,p){u=typeof u=="function"?u:f.noop,p||(p={audio:!0,video:!0}),f.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(p).then(function(g){navigator.mediaDevices.enumerateDevices().then(function(T){f.debug(T),u(T),f.stopAllTracks(g)})}).catch(function(g){f.error(g),u([])}):(f.warn("navigator.mediaDevices unavailable"),u([]))},f.attachMediaStream=function(u,p){try{u.srcObject=p}catch{try{u.src=URL.createObjectURL(p)}catch(T){f.error("Error attaching stream to element",T)}}},f.reattachMediaStream=function(u,p){try{u.srcObject=p.srcObject}catch{try{u.src=p.src}catch(T){f.error("Error reattaching stream to element",T)}}};let o=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",a=window["on"+o];if(window.addEventListener(o,function(){f.log("Closing window");for(const[u,p]of f.sessions)p&&p.destroyOnUnload&&(f.log("Destroying session "+u),p.destroy({unload:!0,notifyDestroyed:!1}));a&&typeof a=="function"&&a()}),f.safariVp8=!1,f.safariVp9=!1,f.webRTCAdapter.browserDetails.browser==="safari"&&f.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(let u of RTCRtpSender.getCapabilities("video").codecs)u&&u.mimeType&&u.mimeType.toLowerCase()==="video/vp8"?f.safariVp8=!0:u&&u.mimeType&&u.mimeType.toLowerCase()==="video/vp9"&&(f.safariVp9=!0);f.safariVp8?f.log("This version of Safari supports VP8"):f.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu")}else{let u=new RTCPeerConnection({});u.createOffer({offerToReceiveVideo:!0}).then(function(p){f.safariVp8=p.sdp.indexOf("VP8")!==-1,f.safariVp9=p.sdp.indexOf("VP9")!==-1,f.safariVp8?f.log("This version of Safari supports VP8"):f.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu"),u.close(),u=null})}f.initDone=!0,i.callback()}};f.isWebrtcSupported=function(){return!!window.RTCPeerConnection};f.isGetUserMediaAvailable=function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia};f.randomString=function(i){let s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="";for(let o=0;o<i;o++){let a=Math.floor(Math.random()*s.length);n+=s.charAt(a)}return n};function f(i){if(i=i||{},i.success=typeof i.success=="function"?i.success:f.noop,i.error=typeof i.error=="function"?i.error:f.noop,i.destroyed=typeof i.destroyed=="function"?i.destroyed:f.noop,!f.initDone)return i.error("Library not initialized"),{};if(!f.isWebrtcSupported())return i.error("WebRTC not supported by this browser"),{};if(f.log("Library initialized: "+f.initDone),!i.server)return i.error("Invalid server url"),{};let s=!1,n=null,o={},a=null,u=null,p=0,g=i.server;f.isArray(g)?(f.log("Multiple servers provided ("+g.length+"), will use the first that works"),g=null,u=i.server,f.debug(u)):g.indexOf("ws")===0?(s=!0,f.log("Using WebSockets to contact Janus: "+g)):(s=!1,f.log("Using REST API to contact Janus: "+g));let T=i.iceServers||[{urls:"stun:stun.l.google.com:19302"}],l=i.iceTransportPolicy,_=i.bundlePolicy,D=!1;typeof i.withCredentials<"u"&&i.withCredentials!==null&&(D=i.withCredentials===!0);let H=10;typeof i.max_poll_events<"u"&&i.max_poll_events!==null&&(H=i.max_poll_events),H<1&&(H=1);let z=null;typeof i.token<"u"&&i.token!==null&&(z=i.token);let j=null;typeof i.apisecret<"u"&&i.apisecret!==null&&(j=i.apisecret),this.destroyOnUnload=!0,typeof i.destroyOnUnload<"u"&&i.destroyOnUnload!==null&&(this.destroyOnUnload=i.destroyOnUnload===!0);let ee=25e3;typeof i.keepAlivePeriod<"u"&&i.keepAlivePeriod!==null&&(ee=i.keepAlivePeriod),isNaN(ee)&&(ee=25e3);let xe=6e4;typeof i.longPollTimeout<"u"&&i.longPollTimeout!==null&&(xe=i.longPollTimeout),isNaN(xe)&&(xe=6e4);function Ye(v){let C={high:9e5,medium:3e5,low:1e5};return typeof v<"u"&&v!==null&&(v.high&&(C.high=v.high),v.medium&&(C.medium=v.medium),v.low&&(C.low=v.low)),C}let _e=!1,$=null,X=new Map,Oe=this,Ze=0,me=new Map;dn(i),this.getServer=function(){return g},this.isConnected=function(){return _e},this.reconnect=function(v){v=v||{},v.success=typeof v.success=="function"?v.success:f.noop,v.error=typeof v.error=="function"?v.error:f.noop,v.reconnect=!0,dn(v)},this.getSessionId=function(){return $},this.getInfo=function(v){gi(v)},this.destroy=function(v){mi(v)},this.attach=function(v){rr(v)};function mt(){if($==null)return;if(f.debug("Long poll..."),!_e){f.warn("Is the server down? (connected=false)");return}let v=g+"/"+$+"?rid="+new Date().getTime();H&&(v=v+"&maxev="+H),z&&(v=v+"&token="+encodeURIComponent(z)),j&&(v=v+"&apisecret="+encodeURIComponent(j)),f.httpAPICall(v,{verb:"GET",withCredentials:D,success:Zt,timeout:xe,error:function(C,b){if(f.error(C+":",b),Ze++,Ze>3){_e=!1,i.error("Lost connection to the server (is it down?)");return}mt()}})}function Zt(v,C){if(Ze=0,!s&&typeof $<"u"&&$!==null&&C!==!0&&mt(),!s&&f.isArray(v)){for(let b=0;b<v.length;b++)Zt(v[b],!0);return}if(v.janus==="keepalive"){f.vdebug("Got a keepalive on session "+$);return}else if(v.janus==="server_info"){f.debug("Got info on the Janus instance"),f.debug(v);const b=v.transaction;if(b){const y=me.get(b);y&&y(v),me.delete(b)}return}else if(v.janus==="ack"){f.debug("Got an ack on session "+$),f.debug(v);const b=v.transaction;if(b){const y=me.get(b);y&&y(v),me.delete(b)}return}else if(v.janus==="success"){f.debug("Got a success on session "+$),f.debug(v);const b=v.transaction;if(b){const y=me.get(b);y&&y(v),me.delete(b)}return}else if(v.janus==="trickle"){const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y){f.debug("This handle is not attached to this session");return}let O=v.candidate;f.debug("Got a trickled candidate on session "+$),f.debug(O);let I=y.webrtcStuff;I.pc&&I.remoteSdp?(f.debug("Adding remote candidate:",O),!O||O.completed===!0?I.pc.addIceCandidate(f.endOfCandidates):I.pc.addIceCandidate(O)):(f.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),I.candidates||(I.candidates=[]),I.candidates.push(O),f.debug(I.candidates))}else if(v.janus==="webrtcup"){f.debug("Got a webrtcup event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y){f.debug("This handle is not attached to this session");return}y.webrtcState(!0);return}else if(v.janus==="hangup"){f.debug("Got a hangup event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y){f.debug("This handle is not attached to this session");return}y.webrtcState(!1,v.reason),y.hangup()}else if(v.janus==="detached"){f.debug("Got a detached event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y)return;y.ondetached(),y.detach()}else if(v.janus==="media"){f.debug("Got a media event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y){f.debug("This handle is not attached to this session");return}y.mediaState(v.type,v.receiving,v.mid)}else if(v.janus==="slowlink"){f.debug("Got a slowlink event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}const y=X.get(b);if(!y){f.debug("This handle is not attached to this session");return}y.slowLink(v.uplink,v.lost,v.mid)}else if(v.janus==="error"){f.error("Ooops: "+v.error.code+" "+v.error.reason),f.debug(v);let b=v.transaction;if(b){let y=me.get(b);y&&y(v),me.delete(b)}return}else if(v.janus==="event"){f.debug("Got a plugin event on session "+$),f.debug(v);const b=v.sender;if(!b){f.warn("Missing sender...");return}let y=v.plugindata;if(!y){f.warn("Missing plugindata...");return}f.debug(" -- Event is coming from "+b+" ("+y.plugin+")");let O=y.data;f.debug(O);const I=X.get(b);if(!I){f.warn("This handle is not attached to this session");return}let w=v.jsep;w&&(f.debug("Handling SDP as well..."),f.debug(w));let W=I.onmessage;W?(f.debug("Notifying application..."),W(O,w)):f.debug("No provided notification callback")}else if(v.janus==="timeout"){f.error("Timeout on session "+$),f.debug(v),s&&n.close(3504,"Gateway timeout");return}else f.warn("Unknown message/event '"+v.janus+"' on session "+$),f.debug(v)}function nr(){if(!g||!s||!_e)return;a=setTimeout(nr,ee);let v={janus:"keepalive",session_id:$,transaction:f.randomString(12)};z&&(v.token=z),j&&(v.apisecret=j),n.send(JSON.stringify(v))}function dn(v){let C=f.randomString(12),b={janus:"create",transaction:C};if(v.reconnect&&(_e=!1,b.janus="claim",b.session_id=$,n&&(n.onopen=null,n.onerror=null,n.onclose=null,a&&(clearTimeout(a),a=null))),z&&(b.token=z),j&&(b.apisecret=j),!g&&f.isArray(u)&&(g=u[p],g.indexOf("ws")===0?(s=!0,f.log("Server #"+(p+1)+": trying WebSockets to contact Janus ("+g+")")):(s=!1,f.log("Server #"+(p+1)+": trying REST API to contact Janus ("+g+")"))),s){n=f.newWebSocket(g,"janus-protocol"),o={error:function(){if(f.error("Error connecting to the Janus WebSockets server... "+g),f.isArray(u)&&!v.reconnect){if(p++,p===u.length){v.error("Error connecting to any of the provided Janus servers: Is the server down?");return}g=null,setTimeout(function(){dn(v)},200);return}v.error("Error connecting to the Janus WebSockets server: Is the server down?")},open:function(){me.set(C,function(y){if(f.debug(y),y.janus!=="success"){f.error("Ooops: "+y.error.code+" "+y.error.reason),v.error(y.error.reason);return}a=setTimeout(nr,ee),_e=!0,$=y.session_id?y.session_id:y.data.id,v.reconnect?f.log("Claimed session: "+$):f.log("Created session: "+$),f.sessions.set($,Oe),v.success()}),n.send(JSON.stringify(b))},message:function(y){Zt(JSON.parse(y.data))},close:function(){!g||!_e||(_e=!1,i.error("Lost connection to the server (is it down?)"))}};for(let y in o)n.addEventListener(y,o[y]);return}f.httpAPICall(g,{verb:"POST",withCredentials:D,body:b,success:function(y){if(f.debug(y),y.janus!=="success"){f.error("Ooops: "+y.error.code+" "+y.error.reason),v.error(y.error.reason);return}_e=!0,$=y.session_id?y.session_id:y.data.id,v.reconnect?f.log("Claimed session: "+$):f.log("Created session: "+$),f.sessions.set($,Oe),mt(),v.success()},error:function(y,O){if(f.error(y+":",O),f.isArray(u)&&!v.reconnect){if(p++,p===u.length){v.error("Error connecting to any of the provided Janus servers: Is the server down?");return}g=null,setTimeout(function(){dn(v)},200);return}O===""?v.error(y+": Is the server down?"):O&&O.error?v.error(y+": "+O.error.message):v.error(y+": "+O)}})}function gi(v){if(v=v||{},v.success=typeof v.success=="function"?v.success:f.noop,v.error=typeof v.error=="function"?v.error:f.noop,f.log("Getting info on Janus instance"),!_e){f.warn("Is the server down? (connected=false)"),v.error("Is the server down? (connected=false)");return}let C=f.randomString(12),b={janus:"info",transaction:C};if(z&&(b.token=z),j&&(b.apisecret=j),s){me.set(C,function(y){f.log("Server info:"),f.debug(y),y.janus!=="server_info"&&f.error("Ooops: "+y.error.code+" "+y.error.reason),v.success(y)}),n.send(JSON.stringify(b));return}f.httpAPICall(g,{verb:"POST",withCredentials:D,body:b,success:function(y){f.log("Server info:"),f.debug(y),y.janus!=="server_info"&&f.error("Ooops: "+y.error.code+" "+y.error.reason),v.success(y)},error:function(y,O){f.error(y+":",O),O===""?v.error(y+": Is the server down?"):v.error(y+": "+O)}})}function mi(v){v=v||{},v.success=typeof v.success=="function"?v.success:f.noop,v.error=typeof v.error=="function"?v.error:f.noop;let C=v.unload===!0,b=!0;typeof v.notifyDestroyed<"u"&&v.notifyDestroyed!==null&&(b=v.notifyDestroyed===!0);let y=v.cleanupHandles===!0;if(f.log("Destroying session "+$+" (unload="+C+")"),!$){f.warn("No session to destroy"),v.success(),b&&i.destroyed();return}if(y)for(const I of X.keys())Lt(I,{noRequest:!0});if(!_e){f.warn("Is the server down? (connected=false)"),$=null,v.success();return}let O={janus:"destroy",transaction:f.randomString(12)};if(z&&(O.token=z),j&&(O.apisecret=j),C){s?(n.onclose=null,n.close(),n=null):navigator.sendBeacon(g+"/"+$,JSON.stringify(O)),f.log("Destroyed session:"),$=null,_e=!1,v.success(),b&&i.destroyed();return}if(s){O.session_id=$;let I=function(){for(let F in o)n.removeEventListener(F,o[F]);n.removeEventListener("message",w),n.removeEventListener("error",W),a&&clearTimeout(a),n.close()},w=function(F){let x=JSON.parse(F.data);x.session_id==O.session_id&&x.transaction==O.transaction&&(I(),v.success(),b&&i.destroyed())},W=function(){I(),v.error("Failed to destroy the server: Is the server down?"),b&&i.destroyed()};n.addEventListener("message",w),n.addEventListener("error",W),n.readyState===1?n.send(JSON.stringify(O)):W();return}f.httpAPICall(g+"/"+$,{verb:"POST",withCredentials:D,body:O,success:function(I){f.log("Destroyed session:"),f.debug(I),$=null,_e=!1,I.janus!=="success"&&f.error("Ooops: "+I.error.code+" "+I.error.reason),v.success(),b&&i.destroyed()},error:function(I,w){f.error(I+":",w),$=null,_e=!1,v.success(),b&&i.destroyed()}})}function rr(v){if(v=v||{},v.success=typeof v.success=="function"?v.success:f.noop,v.error=typeof v.error=="function"?v.error:f.noop,v.dataChannelOptions=v.dataChannelOptions||{ordered:!0},v.consentDialog=typeof v.consentDialog=="function"?v.consentDialog:f.noop,v.iceState=typeof v.iceState=="function"?v.iceState:f.noop,v.mediaState=typeof v.mediaState=="function"?v.mediaState:f.noop,v.webrtcState=typeof v.webrtcState=="function"?v.webrtcState:f.noop,v.slowLink=typeof v.slowLink=="function"?v.slowLink:f.noop,v.onmessage=typeof v.onmessage=="function"?v.onmessage:f.noop,v.onlocaltrack=typeof v.onlocaltrack=="function"?v.onlocaltrack:f.noop,v.onremotetrack=typeof v.onremotetrack=="function"?v.onremotetrack:f.noop,v.ondata=typeof v.ondata=="function"?v.ondata:f.noop,v.ondataopen=typeof v.ondataopen=="function"?v.ondataopen:f.noop,v.oncleanup=typeof v.oncleanup=="function"?v.oncleanup:f.noop,v.ondetached=typeof v.ondetached=="function"?v.ondetached:f.noop,!_e){f.warn("Is the server down? (connected=false)"),v.error("Is the server down? (connected=false)");return}let C=v.plugin;if(!C){f.error("Invalid plugin"),v.error("Invalid plugin");return}let b=v.opaqueId,y=v.loopIndex,O=v.token?v.token:z,I=f.randomString(12),w={janus:"attach",plugin:C,opaque_id:b,loop_index:y,transaction:I};if(O&&(w.token=O),j&&(w.apisecret=j),s){me.set(I,function(W){if(f.debug(W),W.janus!=="success"){f.error("Ooops: "+W.error.code+" "+W.error.reason),v.error("Ooops: "+W.error.code+" "+W.error.reason);return}let F=W.data.id;f.log("Created handle: "+F);let x={session:Oe,plugin:C,id:F,token:O,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,mySdp:null,mediaConstraints:null,pc:null,dataChannelOptions:v.dataChannelOptions,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,bitrate:{}},getId:function(){return F},getPlugin:function(){return C},getVolume:function(A,B){return ct(F,A,!0,B)},getRemoteVolume:function(A,B){return ct(F,A,!0,B)},getLocalVolume:function(A,B){return ct(F,A,!1,B)},isAudioMuted:function(A){return Tt(F,A,!1)},muteAudio:function(A){return ft(F,A,!1,!0)},unmuteAudio:function(A){return ft(F,A,!1,!1)},isVideoMuted:function(A){return Tt(F,A,!0)},muteVideo:function(A){return ft(F,A,!0,!0)},unmuteVideo:function(A){return ft(F,A,!0,!1)},getBitrate:function(A){return Ne(F,A)},setMaxBitrate:function(A,B){return Ft(F,A,B)},send:function(A){ir(F,A)},data:function(A){ut(F,A)},dtmf:function(A){sr(F,A)},consentDialog:v.consentDialog,iceState:v.iceState,mediaState:v.mediaState,webrtcState:v.webrtcState,slowLink:v.slowLink,onmessage:v.onmessage,createOffer:function(A){pn(F,!0,A)},createAnswer:function(A){pn(F,!1,A)},handleRemoteJsep:function(A){ar(F,A)},replaceTracks:function(A){ur(F,A)},getLocalTracks:function(){return Ut(F)},getRemoteTracks:function(){return cr(F)},onlocaltrack:v.onlocaltrack,onremotetrack:v.onremotetrack,ondata:v.ondata,ondataopen:v.ondataopen,oncleanup:v.oncleanup,ondetached:v.ondetached,hangup:function(A){qe(F,A===!0)},detach:function(A){Lt(F,A)}};X.set(F,x),v.success(x)}),w.session_id=$,n.send(JSON.stringify(w));return}f.httpAPICall(g+"/"+$,{verb:"POST",withCredentials:D,body:w,success:function(W){if(f.debug(W),W.janus!=="success"){f.error("Ooops: "+W.error.code+" "+W.error.reason),v.error("Ooops: "+W.error.code+" "+W.error.reason);return}let F=W.data.id;f.log("Created handle: "+F);let x={session:Oe,plugin:C,id:F,token:O,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,mySdp:null,mediaConstraints:null,pc:null,dataChannelOptions:v.dataChannelOptions,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,bitrate:{}},getId:function(){return F},getPlugin:function(){return C},getVolume:function(A,B){return ct(F,A,!0,B)},getRemoteVolume:function(A,B){return ct(F,A,!0,B)},getLocalVolume:function(A,B){return ct(F,A,!1,B)},isAudioMuted:function(A){return Tt(F,A,!1)},muteAudio:function(A){return ft(F,A,!1,!0)},unmuteAudio:function(A){return ft(F,A,!1,!1)},isVideoMuted:function(A){return Tt(F,A,!0)},muteVideo:function(A){return ft(F,A,!0,!0)},unmuteVideo:function(A){return ft(F,A,!0,!1)},getBitrate:function(A){return Ne(F,A)},setMaxBitrate:function(A,B){return Ft(F,A,B)},send:function(A){ir(F,A)},data:function(A){ut(F,A)},dtmf:function(A){sr(F,A)},consentDialog:v.consentDialog,iceState:v.iceState,mediaState:v.mediaState,webrtcState:v.webrtcState,slowLink:v.slowLink,onmessage:v.onmessage,createOffer:function(A){pn(F,!0,A)},createAnswer:function(A){pn(F,!1,A)},handleRemoteJsep:function(A){ar(F,A)},replaceTracks:function(A){ur(F,A)},getLocalTracks:function(){return Ut(F)},getRemoteTracks:function(){return cr(F)},onlocaltrack:v.onlocaltrack,onremotetrack:v.onremotetrack,ondata:v.ondata,ondataopen:v.ondataopen,oncleanup:v.oncleanup,ondetached:v.ondetached,hangup:function(A){qe(F,A===!0)},detach:function(A){Lt(F,A)}};X.set(F,x),v.success(x)},error:function(W,F){f.error(W+":",F),F===""?v.error(W+": Is the server down?"):v.error(W+": "+F)}})}function ir(v,C){if(C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop,!_e){f.warn("Is the server down? (connected=false)"),C.error("Is the server down? (connected=false)");return}let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let y=C.message,O=C.jsep,I=f.randomString(12),w={janus:"message",body:y,transaction:I};if(b.token&&(w.token=b.token),j&&(w.apisecret=j),O){w.jsep={type:O.type,sdp:O.sdp},O.e2ee&&(w.jsep.e2ee=!0),(O.rid_order==="hml"||O.rid_order==="lmh")&&(w.jsep.rid_order=O.rid_order),O.force_relay&&(w.jsep.force_relay=!0);let W=null,F=b.webrtcStuff;if(F.pc){let x=F.pc.getTransceivers();if(x&&x.length>0)for(let A in x){let B=x[A];if(B&&B.sender&&B.sender.track&&B.sender.track.kind==="video"){let re=B.sender.getParameters();re&&re.encodings&&re.encodings[0]&&re.encodings[0].scalabilityMode&&(W||(W=[]),W.push({mindex:parseInt(A),mid:B.mid,svc:re.encodings[0].scalabilityMode}))}}}W&&(w.jsep.svc=W)}if(f.debug("Sending message to plugin (handle="+v+"):"),f.debug(w),s){w.session_id=$,w.handle_id=v,me.set(I,function(W){if(f.debug("Message sent!"),f.debug(W),W.janus==="success"){let F=W.plugindata;if(!F){f.warn("Request succeeded, but missing plugindata..."),C.success();return}f.log("Synchronous transaction successful ("+F.plugin+")");let x=F.data;f.debug(x),C.success(x);return}else if(W.janus!=="ack"){W.error?(f.error("Ooops: "+W.error.code+" "+W.error.reason),C.error(W.error.code+" "+W.error.reason)):(f.error("Unknown error"),C.error("Unknown error"));return}C.success()}),n.send(JSON.stringify(w));return}f.httpAPICall(g+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:w,success:function(W){if(f.debug("Message sent!"),f.debug(W),W.janus==="success"){let F=W.plugindata;if(!F){f.warn("Request succeeded, but missing plugindata..."),C.success();return}f.log("Synchronous transaction successful ("+F.plugin+")");let x=F.data;f.debug(x),C.success(x);return}else if(W.janus!=="ack"){W.error?(f.error("Ooops: "+W.error.code+" "+W.error.reason),C.error(W.error.code+" "+W.error.reason)):(f.error("Unknown error"),C.error("Unknown error"));return}C.success()},error:function(W,F){f.error(W+":",F),C.error(W+": "+F)}})}function or(v,C){if(!_e){f.warn("Is the server down? (connected=false)");return}let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle");return}let y={janus:"trickle",candidate:C,transaction:f.randomString(12)};if(b.token&&(y.token=b.token),j&&(y.apisecret=j),f.vdebug("Sending trickle candidate (handle="+v+"):"),f.vdebug(y),s){y.session_id=$,y.handle_id=v,n.send(JSON.stringify(y));return}f.httpAPICall(g+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:y,success:function(O){if(f.vdebug("Candidate sent!"),f.vdebug(O),O.janus!=="ack"){f.error("Ooops: "+O.error.code+" "+O.error.reason);return}},error:function(O,I){f.error(O+":",I)}})}function at(v,C,b,y,O){let I=X.get(v);if(!I||!I.webrtcStuff){f.warn("Invalid handle");return}let w=I.webrtcStuff;if(!w.pc){f.warn("Invalid PeerConnection");return}let W=function(A){f.log("Received message on data channel:",A);let B=A.target.label;I.ondata(A.data,B)},F=function(A){f.log("Received state change on data channel:",A);let B=A.target.label,re=A.target.protocol,fe=w.dataChannel[B]?w.dataChannel[B].readyState:"null";if(f.log("State change on <"+B+"> data channel: "+fe),fe==="open"){if(w.dataChannel[B].pending&&w.dataChannel[B].pending.length>0){f.log("Sending pending messages on <"+B+">:",w.dataChannel[B].pending.length);for(let lt of w.dataChannel[B].pending)f.log("Sending data on data channel <"+B+">"),f.debug(lt),w.dataChannel[B].send(lt);w.dataChannel[B].pending=[]}I.ondataopen(B,re)}},x=function(A){f.error("Got error on data channel:",A)};if(y)w.dataChannel[C]=y;else{let A=w.dataChannelOptions;b&&(A.protocol=b),w.dataChannel[C]=w.pc.createDataChannel(C,A)}w.dataChannel[C].onmessage=W,w.dataChannel[C].onopen=F,w.dataChannel[C].onclose=F,w.dataChannel[C].onerror=x,w.dataChannel[C].pending=[],O&&w.dataChannel[C].pending.push(O)}function ut(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let y=b.webrtcStuff,O=C.text||C.data;if(!O){f.warn("Invalid data"),C.error("Invalid data");return}let I=C.label?C.label:f.dataChanDefaultLabel;if(!y.dataChannel[I]){at(v,I,C.protocol,!1,O,C.protocol),C.success();return}if(y.dataChannel[I].readyState!=="open"){y.dataChannel[I].pending.push(O),C.success();return}f.log("Sending data on data channel <"+I+">"),f.debug(O),y.dataChannel[I].send(O),C.success()}function sr(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let y=b.webrtcStuff;if(!y.dtmfSender){if(y.pc){let x=y.pc.getSenders().find(function(A){return A.track&&A.track.kind==="audio"});if(!x){f.warn("Invalid DTMF configuration (no audio track)"),C.error("Invalid DTMF configuration (no audio track)");return}y.dtmfSender=x.dtmf,y.dtmfSender&&(f.log("Created DTMF Sender"),y.dtmfSender.ontonechange=function(A){f.debug("Sent DTMF tone: "+A.tone)})}if(!y.dtmfSender){f.warn("Invalid DTMF configuration"),C.error("Invalid DTMF configuration");return}}let O=C.dtmf;if(!O){f.warn("Invalid DTMF parameters"),C.error("Invalid DTMF parameters");return}let I=O.tones;if(!I){f.warn("Invalid DTMF string"),C.error("Invalid DTMF string");return}let w=typeof O.duration=="number"?O.duration:500,W=typeof O.gap=="number"?O.gap:50;f.debug("Sending DTMF string "+I+" (duration "+w+"ms, gap "+W+"ms)"),y.dtmfSender.insertDTMF(I,w,W),C.success()}function Lt(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=C.noRequest===!0;f.log("Destroying handle "+v+" (only-locally="+b+")"),qe(v);let y=X.get(v);if(!y||y.detached){X.delete(v),C.success();return}if(y.detached=!0,b){X.delete(v),C.success();return}if(!_e){f.warn("Is the server down? (connected=false)"),C.error("Is the server down? (connected=false)");return}let O={janus:"detach",transaction:f.randomString(12)};if(y.token&&(O.token=y.token),j&&(O.apisecret=j),s){O.session_id=$,O.handle_id=v,n.send(JSON.stringify(O)),X.delete(v),C.success();return}f.httpAPICall(g+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:O,success:function(I){f.log("Destroyed handle:"),f.debug(I),I.janus!=="success"&&f.error("Ooops: "+I.error.code+" "+I.error.reason),X.delete(v),C.success()},error:function(I,w){f.error(I+":",w),X.delete(v),C.success()}})}function Xe(v,C){let b=X.get(v);if(!b||!b.webrtcStuff)throw f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;if(y.pc)return;let O={iceServers:T,iceTransportPolicy:l,bundlePolicy:_};O.sdpSemantics="unified-plan";let I=!1;if(C.tracks){for(let w of C.tracks)if(w.transforms&&(w.transforms.sender||w.transforms.receiver)){I=!0;break}}RTCRtpSender&&(RTCRtpSender.prototype.createEncodedStreams||RTCRtpSender.prototype.createEncodedAudioStreams&&RTCRtpSender.prototype.createEncodedVideoStreams)&&I&&(y.insertableStreams=!0,O.forceEncodedAudioInsertableStreams=!0,O.forceEncodedVideoInsertableStreams=!0,O.encodedInsertableStreams=!0),f.log("Creating PeerConnection"),y.pc=new RTCPeerConnection(O),f.debug(y.pc),y.pc.getStats&&(y.volume={},y.bitrate.value="0 kbits/sec"),f.log("Preparing local SDP and gathering candidates (trickle="+y.trickle+")"),y.pc.oniceconnectionstatechange=function(){y.pc&&b.iceState(y.pc.iceConnectionState)},y.pc.onicecandidate=function(w){if(!w.candidate||w.candidate.candidate&&w.candidate.candidate.indexOf("endOfCandidates")>0)f.log("End of candidates."),y.iceDone=!0,y.trickle===!0?or(v,{completed:!0}):hn(v,C);else{let W={candidate:w.candidate.candidate,sdpMid:w.candidate.sdpMid,sdpMLineIndex:w.candidate.sdpMLineIndex};y.trickle===!0&&or(v,W)}},y.pc.ontrack=function(w){if(f.log("Handling Remote Track",w),!w.streams||!w.track)return;let W=w.transceiver?w.transceiver.mid:w.track.id;try{b.onremotetrack(w.track,W,!0,{reason:"created"})}catch(x){f.error("Error calling onremotetrack",x)}if(w.track.onended)return;let F=null;f.log("Adding onended callback to track:",w.track),w.track.onended=function(x){f.log("Remote track removed:",x),clearTimeout(F);let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;try{b.onremotetrack(x.target,re,!1,{reason:"ended"})}catch(fe){f.error("Error calling onremotetrack on removal",fe)}},w.track.onmute=function(x){f.log("Remote track muted:",x),F||(F=setTimeout(function(){f.log("Removing remote track");let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;try{b.onremotetrack(x.target,re,!1,{reason:"mute"})}catch(fe){f.error("Error calling onremotetrack on mute",fe)}F=null},3*840))},w.track.onunmute=function(x){if(f.log("Remote track flowing again:",x),F!=null)clearTimeout(F),F=null;else try{let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;b.onremotetrack(x.target,re,!0,{reason:"unmute"})}catch(A){f.error("Error calling onremotetrack on unmute",A)}}}}async function pn(v,C,b){b=b||{},b.success=typeof b.success=="function"?b.success:f.noop,b.error=typeof b.error=="function"?b.error:fr;let y=b.jsep;if(C&&y){f.error("Provided a JSEP to a createOffer"),b.error("Provided a JSEP to a createOffer");return}else if(!C&&(!y||!y.type||!y.sdp)){f.error("A valid JSEP is required for createAnswer"),b.error("A valid JSEP is required for createAnswer");return}if(b.media&&!b.tracks){if(b.tracks=f.mediaToTracks(b.media),b.simulcast===!0||b.simulcast2===!0||b.svc){for(let w of b.tracks)if(w.type==="video"){b.simulcast===!0||b.simulcast2===!0?w.simulcast=!0:b.svc&&(w.svc=b.svc);break}}f.warn("Deprecated media object passed, use tracks instead. Automatically translated to:",b.tracks)}if(b.tracks&&!Array.isArray(b.tracks)){f.error("Tracks must be an array"),b.error("Tracks must be an array");return}let O=X.get(v);if(!O||!O.webrtcStuff){f.warn("Invalid handle"),b.error("Invalid handle");return}let I=O.webrtcStuff;I.trickle=lr(b.trickle);try{if(Xe(v,b),C&&await bt(v,b),y){if(await I.pc.setRemoteDescription(y),f.log("Remote description accepted!"),I.remoteSdp=y.sdp,I.candidates&&I.candidates.length>0){for(let W=0;W<I.candidates.length;W++){let F=I.candidates[W];f.debug("Adding remote candidate:",F),!F||F.completed===!0?I.pc.addIceCandidate(f.endOfCandidates):I.pc.addIceCandidate(F)}I.candidates=[]}await bt(v,b);let w=await kt(v,b);b.success(w)}else{let w=await vi(v,b);b.success(w)}}catch(w){f.error(w),b.error(w)}}function ar(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:fr,C.customizeSdp=typeof C.customizeSdp=="function"?C.customizeSdp:f.noop;let b=C.jsep,y=X.get(v);if(!y||!y.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let O=y.webrtcStuff;if(b){if(!O.pc){f.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep"),C.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");return}C.customizeSdp(b),O.pc.setRemoteDescription(b).then(function(){if(f.log("Remote description accepted!"),O.remoteSdp=b.sdp,O.candidates&&O.candidates.length>0){for(let I=0;I<O.candidates.length;I++){let w=O.candidates[I];f.debug("Adding remote candidate:",w),!w||w.completed===!0?O.pc.addIceCandidate(f.endOfCandidates):O.pc.addIceCandidate(w)}O.candidates=[]}C.success()},C.error)}else C.error("Invalid JSEP")}async function vi(v,C){C=C||{},C.customizeSdp=typeof C.customizeSdp=="function"?C.customizeSdp:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff)throw f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;f.log("Creating offer (iceDone="+y.iceDone+")");let O={};C.iceRestart===!0&&(O.iceRestart=!0),f.debug(O);let w=await y.pc.createOffer(O);f.debug(w);let W={type:"offer",sdp:w.sdp};return C.customizeSdp(W),w.sdp=W.sdp,f.log("Setting local description"),y.mySdp={type:"offer",sdp:w.sdp},await y.pc.setLocalDescription(w),y.mediaConstraints=O,!y.iceDone&&!y.trickle?(f.log("Waiting for all candidates..."),null):(y.insertableStreams&&(w.e2ee=!0),w)}async function kt(v,C){C=C||{},C.customizeSdp=typeof C.customizeSdp=="function"?C.customizeSdp:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff)throw f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;f.log("Creating answer (iceDone="+y.iceDone+")");let O=await y.pc.createAnswer();f.debug(O);let I={type:"answer",sdp:O.sdp};return C.customizeSdp(I),O.sdp=I.sdp,f.log("Setting local description"),y.mySdp={type:"answer",sdp:O.sdp},await y.pc.setLocalDescription(O),!y.iceDone&&!y.trickle?(f.log("Waiting for all candidates..."),null):(y.insertableStreams&&(O.e2ee=!0),O)}function hn(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle, not sending anything");return}let y=b.webrtcStuff;if(f.log("Sending offer/answer SDP..."),!y.mySdp){f.warn("Local SDP instance is invalid, not sending anything...");return}y.mySdp={type:y.pc.localDescription.type,sdp:y.pc.localDescription.sdp},y.trickle===!1&&(y.mySdp.trickle=!1),f.debug(C),y.sdpSent=!0,C.success(y.mySdp)}async function ur(v,C){if(C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop,C.tracks&&!Array.isArray(C.tracks)){f.error("Tracks must be an array"),C.error("Tracks must be an array");return}for(let b of C.tracks)(b.add||!b.replace&&!b.remove)&&(b.replace=!0);try{await bt(v,C),C.success()}catch(b){f.error(b),C.error(b)}}async function bt(v,C){let b=X.get(v);if(!b||!b.webrtcStuff)throw f.warn("Invalid handle, not sending anything"),"Invalid handle";let y=b.webrtcStuff;if(!y.pc)throw f.warn("Invalid PeerConnection"),"Invalid PeerConnection";let O=C.tracks;if(!O||!Array.isArray(O)||O.length===0)return;let I=!1,w={};for(let x of O){if(delete x.gumGroup,!x.type||!["audio","video"].includes(x.type)||!x.capture||x.capture instanceof MediaStreamTrack)continue;let A=x.group?x.group:"default";w[A]||(w[A]={}),!w[A][x.type]&&(x.gumGroup=A,w[A][x.type]=x)}let W=Object.keys(w);for(let x of W){let A=w[x];(!A.audio||!A.video)&&(A.audio&&delete A.audio.gumGroup,A.video&&delete A.video.gumGroup,delete w[x])}let F=!!C.jsep;for(let x of O){if(!x.type){f.warn("Missing track type:",x);continue}if(x.type==="data"){if(y.pc.ondatachannel){f.warn("Data channel exists already, not creating another one");continue}f.log("Creating default data channel"),at(v,f.dataChanDefaultLabel,null,!1),y.pc.ondatachannel=function(N){f.log("Data channel created by Janus:",N),at(v,N.channel.label,N.channel.protocol,N.channel)};continue}if((typeof x.add>"u"||x.add===null)&&(typeof x.remove>"u"||x.remove===null)&&(typeof x.replace>"u"||x.replace===null)&&(x.add=!0),x.add&&x.remove||x.add&&x.remove&&x.replace){f.warn("Conflicting actions for track, ignoring:",x);continue}x.add&&x.replace?(f.warn("Both add and replace provided, falling back to replace:",x),delete x.add):x.remove&&x.replace&&(f.warn("Both remove and replace provided, falling back to remove:",x),delete x.replace);let A=x.type;x.type==="screen"&&(A="video");let B=null,re=null;if(x.mid?B=y.pc.getTransceivers().find(N=>N.mid===x.mid&&N.receiver.track.kind===A):B=y.pc.getTransceivers().find(N=>N.receiver.track.kind===A),x.replace||x.remove){if(!B){f.warn("Couldn't find a transceiver for track:",x);continue}if(!B.sender){f.warn("No sender in the transceiver for track:",x);continue}re=B.sender}if(F&&!B&&(B=y.pc.getTransceivers().find(N=>N.receiver.track.kind===A),!B)){f.warn("Couldn't find a transceiver for track:",x);continue}let fe=null,lt=null;if((x.remove||x.replace)&&(f.log("Removing track from PeerConnection",x),lt=re.track?re.track.id:null,await re.replaceTrack(null),lt&&y.myStream)){let N=null;if(A==="audio"&&y.myStream.getAudioTracks()&&y.myStream.getAudioTracks().length)for(let ne of y.myStream.getAudioTracks())ne.id===lt&&(N=ne,f.log("Removing audio track:",N));else if(A==="video"&&y.myStream.getVideoTracks()&&y.myStream.getVideoTracks().length)for(let ne of y.myStream.getVideoTracks())ne.id===lt&&(N=ne,f.log("Removing video track:",N));if(N){try{y.myStream.removeTrack(N),b.onlocaltrack(N,!1)}catch(ne){f.error("Error calling onlocaltrack on removal for renegotiation",ne)}if(N.dontStop!==!0)try{N.stop()}catch{}}}if(x.capture){if(x.gumGroup&&w[x.gumGroup]&&w[x.gumGroup].stream){let N=w[x.gumGroup].stream;fe=x.type==="audio"?N.getAudioTracks()[0]:N.getVideoTracks()[0],delete w[x.gumGroup].stream,delete w[x.gumGroup],delete x.gumGroup}else if(x.capture instanceof MediaStreamTrack)fe=x.capture;else{I||(I=!0,b.consentDialog(!0));let N=f.trackConstraints(x),ne=null;if(x.type==="audio"||x.type==="video"){if(x.gumGroup){let be=x.type==="audio"?"video":"audio";if(w[x.gumGroup]&&w[x.gumGroup][be]){let vt=w[x.gumGroup][be],yi=f.trackConstraints(vt);N[be]=yi[be]}}ne=await navigator.mediaDevices.getUserMedia(N),x.gumGroup&&N.audio&&N.video&&(w[x.gumGroup].stream=ne,delete x.gumGroup)}else ne=await navigator.mediaDevices.getDisplayMedia(N);fe=x.type==="audio"?ne.getAudioTracks()[0]:ne.getVideoTracks()[0]}if(x.replace){await re.replaceTrack(fe);let N="sendrecv";(x.recv===!1||B.direction==="inactive"||B.direction==="sendonly")&&(N="sendonly"),B.setDirection?B.setDirection(N):B.direction=N}else{if(y.myStream||(y.myStream=new MediaStream),A==="audio"||!x.simulcast&&!x.svc)re=y.pc.addTrack(fe,y.myStream),B=y.pc.getTransceivers().find(N=>N.sender===re);else if(x.simulcast){if(f.webRTCAdapter.browserDetails.browser!=="firefox"){f.log("Enabling rid-based simulcasting:",fe);let N=Ye(x.simulcastMaxBitrates);B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream],sendEncodings:x.sendEncodings||[{rid:"h",active:!0,scalabilityMode:"L1T2",maxBitrate:N.high},{rid:"m",active:!0,scalabilityMode:"L1T2",maxBitrate:N.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,scalabilityMode:"L1T2",maxBitrate:N.low,scaleResolutionDownBy:4}]})}else if(f.log("Enabling Simulcasting for Firefox (RID)"),B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream]}),re=B?B.sender:null,re){let N=re.getParameters();N||(N={});let ne=Ye(x.simulcastMaxBitrates);N.encodings=x.sendEncodings||[{rid:"h",active:!0,maxBitrate:ne.high},{rid:"m",active:!0,maxBitrate:ne.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:ne.low,scaleResolutionDownBy:4}],re.setParameters(N)}}else f.log("Enabling SVC ("+x.svc+"):",fe),B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream],sendEncodings:[{scalabilityMode:x.svc}]});if(re||(re=B?B.sender:null),x.codec)if(f.webRTCAdapter.browserDetails.browser==="firefox")f.warn("setCodecPreferences not supported in Firefox, ignoring codec for track:",x);else if(typeof x.codec!="string")f.warn("Invalid codec value, ignoring for track:",x);else{let N=A+"/"+x.codec.toLowerCase(),ne=RTCRtpReceiver.getCapabilities(A).codecs.filter(function(be){return be.mimeType.toLowerCase()===N});if(!ne||ne.length===0)f.warn("Codec not supported in this browser for this track, ignoring:",x);else if(B)try{B.setCodecPreferences(ne)}catch(be){f.warn("Failed enforcing codec for this "+A+" track:",be)}}if(x.bitrate){if(x.simulcast||x.svc)f.warn("Ignoring bitrate for simulcast/SVC track, use sendEncodings for that");else if(isNaN(x.bitrate)||x.bitrate<0)f.warn("Ignoring invalid bitrate for track:",x);else if(re){let N=re.getParameters();!N||!N.encodings||N.encodings.length===0?f.warn("No encodings in the sender parameters, ignoring bitrate for track:",x):(N.encodings[0].maxBitrate=x.bitrate,await re.setParameters(N))}}if(A==="video"&&x.framerate){if(x.simulcast||x.svc)f.warn("Ignoring framerate for simulcast/SVC track, use sendEncodings for that");else if(isNaN(x.framerate)||x.framerate<0)f.warn("Ignoring invalid framerate for track:",x);else if(re){let N=re.getParameters();!N||!N.encodings||N.encodings.length===0?f.warn("No encodings in the sender parameters, ignoring framerate for track:",x):(N.encodings[0].maxFramerate=x.framerate,await re.setParameters(N))}}if(x.transforms){if(re&&x.transforms.sender){let N=null;RTCRtpSender.prototype.createEncodedStreams?N=re.createEncodedStreams():(RTCRtpSender.prototype.createAudioEncodedStreams||RTCRtpSender.prototype.createEncodedVideoStreams)&&(A==="audio"?N=re.createEncodedAudioStreams():A==="video"&&(N=re.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.sender).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.sender).pipeTo(N.writable))}if(B&&B.receiver&&x.transforms.receiver){let N=null;RTCRtpReceiver.prototype.createEncodedStreams?N=B.receiver.createEncodedStreams():(RTCRtpReceiver.prototype.createAudioEncodedStreams||RTCRtpReceiver.prototype.createEncodedVideoStreams)&&(A==="audio"?N=B.receiver.createEncodedAudioStreams():A==="video"&&(N=B.receiver.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.receiver).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.receiver).pipeTo(N.writable))}}}fe&&x.dontStop===!0&&(fe.dontStop=!0)}else if(x.recv&&(B||(B=y.pc.addTransceiver(A)),B)){if(x.codec)if(f.webRTCAdapter.browserDetails.browser==="firefox")f.warn("setCodecPreferences not supported in Firefox, ignoring codec for track:",x);else if(typeof x.codec!="string")f.warn("Invalid codec value, ignoring for track:",x);else{let N=A+"/"+x.codec.toLowerCase(),ne=RTCRtpReceiver.getCapabilities(A).codecs.filter(function(be){return be.mimeType.toLowerCase()===N});if(!ne||ne.length===0)f.warn("Codec not supported in this browser for this track, ignoring:",x);else try{B.setCodecPreferences(ne)}catch(be){f.warn("Failed enforcing codec for this "+A+" track:",be)}}if(B.receiver&&x.transforms&&x.transforms.receiver){let N=null;RTCRtpReceiver.prototype.createEncodedStreams?N=B.receiver.createEncodedStreams():(RTCRtpReceiver.prototype.createAudioEncodedStreams||RTCRtpReceiver.prototype.createEncodedVideoStreams)&&(A==="audio"?N=B.receiver.createEncodedAudioStreams():A==="video"&&(N=B.receiver.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.receiver).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.receiver).pipeTo(N.writable))}}if(fe){y.myStream.addTrack(fe),fe.onended=function(N){f.log("Local track removed:",N);try{b.onlocaltrack(N.target,!1)}catch(ne){f.error("Error calling onlocaltrack following end",ne)}};try{b.onlocaltrack(fe,!0)}catch(N){f.error("Error calling onlocaltrack for track add",N)}}if(B){let N=B.direction,ne=null,be=fe&&B.sender.track,vt=x.recv!==!1&&B.receiver.track;be&&vt?ne="sendrecv":be&&!vt?ne="sendonly":!be&&vt?ne="recvonly":!be&&!vt&&(ne="inactive"),ne&&ne!==N&&(f.warn("Changing direction of transceiver to "+ne+" (was "+N+")",x),B.setDirection?B.setDirection(ne):B.direction=ne)}}I&&b.consentDialog(!1)}function Ut(v){let C=X.get(v);if(!C||!C.webrtcStuff)return f.warn("Invalid handle"),null;let b=C.webrtcStuff;if(!b.pc)return f.warn("Invalid PeerConnection"),null;let y=[],O=b.pc.getTransceivers();for(let I of O){let w=null;I.sender&&I.sender.track&&(w={mid:I.mid},w.type=I.sender.track.kind,w.id=I.sender.track.id,w.label=I.sender.track.label),w&&y.push(w)}return y}function cr(v){let C=X.get(v);if(!C||!C.webrtcStuff)return f.warn("Invalid handle"),null;let b=C.webrtcStuff;if(!b.pc)return f.warn("Invalid PeerConnection"),null;let y=[],O=b.pc.getTransceivers();for(let I of O){let w=null;I.receiver&&I.receiver.track&&(w={mid:I.mid},w.type=I.receiver.track.kind,w.id=I.receiver.track.id,w.label=I.receiver.track.label),w&&y.push(w)}return y}function ct(v,C,b,y){y=typeof y=="function"?y:f.noop;let O=X.get(v);if(!O||!O.webrtcStuff){f.warn("Invalid handle"),y(0);return}let I=b?"remote":"local",w=O.webrtcStuff;if(w.volume[I]||(w.volume[I]={value:0}),w.pc&&w.pc.getStats&&(f.webRTCAdapter.browserDetails.browser==="chrome"||f.webRTCAdapter.browserDetails.browser==="safari")){let W=w.pc;if(C){let F=w.pc.getTransceivers().find(x=>x.mid===C&&x.receiver.track.kind==="audio");if(!F){f.warn("No audio transceiver with mid "+C),y(0);return}if(b&&!F.receiver){f.warn("Remote transceiver track unavailable"),y(0);return}else if(!b&&!F.sender){f.warn("Local transceiver track unavailable"),y(0);return}W=b?F.receiver:F.sender}return W.getStats().then(function(F){F.forEach(function(x){!x||x.kind!=="audio"||b&&!x.remoteSource||!b&&x.type!=="media-source"||y(x.audioLevel?x.audioLevel:0)})}),w.volume[I].value}else{f.warn("Getting the "+I+" volume unsupported by browser"),y(0);return}}function Tt(v,C,b){let y=X.get(v);if(!y||!y.webrtcStuff)return f.warn("Invalid handle"),!0;let O=y.webrtcStuff;if(!O.pc)return f.warn("Invalid PeerConnection"),!0;if(!O.myStream)return f.warn("Invalid local MediaStream"),!0;if(b){if(!O.myStream.getVideoTracks()||O.myStream.getVideoTracks().length===0)return f.warn("No video track"),!0;if(C){let I=O.pc.getTransceivers().find(w=>w.mid===C&&w.receiver.track.kind==="video");return I?!I.sender||!I.sender.track?(f.warn("No video sender with mid "+C),!0):!I.sender.track.enabled:(f.warn("No video transceiver with mid "+C),!0)}else return!O.myStream.getVideoTracks()[0].enabled}else{if(!O.myStream.getAudioTracks()||O.myStream.getAudioTracks().length===0)return f.warn("No audio track"),!0;if(C){let I=O.pc.getTransceivers().find(w=>w.mid===C&&w.receiver.track.kind==="audio");return I?!I.sender||!I.sender.track?(f.warn("No audio sender with mid "+C),!0):!I.sender.track.enabled:(f.warn("No audio transceiver with mid "+C),!0)}else return!O.myStream.getAudioTracks()[0].enabled}}function ft(v,C,b,y){let O=X.get(v);if(!O||!O.webrtcStuff)return f.warn("Invalid handle"),!1;let I=O.webrtcStuff;if(!I.pc)return f.warn("Invalid PeerConnection"),!1;if(!I.myStream)return f.warn("Invalid local MediaStream"),!1;if(b){if(!I.myStream.getVideoTracks()||I.myStream.getVideoTracks().length===0)return f.warn("No video track"),!1;if(C){let w=I.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="video");if(!w)return f.warn("No video transceiver with mid "+C),!1;if(!w.sender||!w.sender.track)return f.warn("No video sender with mid "+C),!1;w.sender.track.enabled=!y}else for(const w of I.myStream.getVideoTracks())w.enabled=!y}else{if(!I.myStream.getAudioTracks()||I.myStream.getAudioTracks().length===0)return f.warn("No audio track"),!1;if(C){let w=I.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="audio");if(!w)return f.warn("No audio transceiver with mid "+C),!1;if(!w.sender||!w.sender.track)return f.warn("No audio sender with mid "+C),!1;w.sender.track.enabled=!y}else for(const w of I.myStream.getAudioTracks())w.enabled=!y}return!0}function Ne(v,C){let b=X.get(v);if(!b||!b.webrtcStuff)return f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;if(!y.pc)return"Invalid PeerConnection";if(y.pc.getStats){let O=y.pc,I=C||"default";if(C){let w=y.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="video");if(!w)return f.warn("No video transceiver with mid "+C),"No video transceiver with mid "+C;if(!w.receiver)return f.warn("No video receiver with mid "+C),"No video receiver with mid "+C;O=w.receiver}return y.bitrate[I]||(y.bitrate[I]={timer:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,value:"0 kbits/sec"}),y.bitrate[I].timer?y.bitrate[I].value:(f.log("Starting bitrate timer"+(C?" for mid "+C:"")+" (via getStats)"),y.bitrate[I].timer=setInterval(function(){O.getStats().then(function(w){w.forEach(function(W){if(!W)return;let F=!1;if(((W.mediaType==="video"||W.id.toLowerCase().indexOf("video")>-1)&&W.type==="inbound-rtp"&&W.id.indexOf("rtcp")<0||W.type=="ssrc"&&W.bytesReceived&&(W.googCodecName==="VP8"||W.googCodecName===""))&&(F=!0),F)if(y.bitrate[I].bsnow=W.bytesReceived,y.bitrate[I].tsnow=W.timestamp,y.bitrate[I].bsbefore===null||y.bitrate[I].tsbefore===null)y.bitrate[I].bsbefore=y.bitrate[I].bsnow,y.bitrate[I].tsbefore=y.bitrate[I].tsnow;else{let x=y.bitrate[I].tsnow-y.bitrate[I].tsbefore;f.webRTCAdapter.browserDetails.browser==="safari"&&(x=x/1e3);let A=Math.round((y.bitrate[I].bsnow-y.bitrate[I].bsbefore)*8/x);f.webRTCAdapter.browserDetails.browser==="safari"&&(A=parseInt(A/1e3)),y.bitrate[I].value=A+" kbits/sec",y.bitrate[I].bsbefore=y.bitrate[I].bsnow,y.bitrate[I].tsbefore=y.bitrate[I].tsnow}})})},1e3),"0 kbits/sec")}else return f.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser"}function Ft(v,C,b){let y=X.get(v);if(!y||!y.webrtcStuff){f.warn("Invalid handle");return}let O=y.webrtcStuff;if(!O.pc){f.warn("Invalid PeerConnection");return}let I=O.pc.getTransceivers().find(W=>W.mid===C);if(!I){f.warn("No transceiver with mid",C);return}if(!I.sender){f.warn("No sender for transceiver with mid",C);return}let w=I.sender.getParameters();!w||!w.encodings||w.encodings.length===0?f.warn("No parameters encodings"):w.encodings.length>1?f.warn("Ignoring bitrate for simulcast track, use sendEncodings for that"):isNaN(b)||b<0?f.warn("Invalid bitrate (must be a positive integer)"):(w.encodings[0].maxBitrate=b,I.sender.setParameters(w))}function fr(v){f.error("WebRTC error:",v)}function qe(v,C){f.log("Cleaning WebRTC stuff");let b=X.get(v);if(!b)return;let y=b.webrtcStuff;if(y){if(C===!0){let O={janus:"hangup",transaction:f.randomString(12)};b.token&&(O.token=b.token),j&&(O.apisecret=j),f.debug("Sending hangup request (handle="+v+"):"),f.debug(O),s?(O.session_id=$,O.handle_id=v,n.send(JSON.stringify(O))):f.httpAPICall(g+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:O})}y.volume&&(y.volume.local&&y.volume.local.timer&&clearInterval(y.volume.local.timer),y.volume.remote&&y.volume.remote.timer&&clearInterval(y.volume.remote.timer));for(let O in y.bitrate)y.bitrate[O].timer&&clearInterval(y.bitrate[O].timer);y.bitrate={},!y.streamExternal&&y.myStream&&(f.log("Stopping local stream tracks"),f.stopAllTracks(y.myStream)),y.streamExternal=!1,y.myStream=null;try{y.pc.close()}catch{}y.pc=null,y.candidates=null,y.mySdp=null,y.remoteSdp=null,y.iceDone=!1,y.dataChannel={},y.dtmfSender=null,y.insertableStreams=!1}b.oncleanup()}function lr(v){return f.debug("isTrickleEnabled:",v),v!==!1}}let zu=!0,Vu=!0;function ri(i,s,n){const o=i.match(s);return o&&o.length>=n&&parseInt(o[n],10)}function In(i,s,n){if(!i.RTCPeerConnection)return;const o=i.RTCPeerConnection.prototype,a=o.addEventListener;o.addEventListener=function(p,g){if(p!==s)return a.apply(this,arguments);const T=l=>{const _=n(l);_&&(g.handleEvent?g.handleEvent(_):g(_))};return this._eventMap=this._eventMap||{},this._eventMap[s]||(this._eventMap[s]=new Map),this._eventMap[s].set(g,T),a.apply(this,[p,T])};const u=o.removeEventListener;o.removeEventListener=function(p,g){if(p!==s||!this._eventMap||!this._eventMap[s])return u.apply(this,arguments);if(!this._eventMap[s].has(g))return u.apply(this,arguments);const T=this._eventMap[s].get(g);return this._eventMap[s].delete(g),this._eventMap[s].size===0&&delete this._eventMap[s],Object.keys(this._eventMap).length===0&&delete this._eventMap,u.apply(this,[p,T])},Object.defineProperty(o,"on"+s,{get(){return this["_on"+s]},set(p){this["_on"+s]&&(this.removeEventListener(s,this["_on"+s]),delete this["_on"+s]),p&&this.addEventListener(s,this["_on"+s]=p)},enumerable:!0,configurable:!0})}function Sv(i){return typeof i!="boolean"?new Error("Argument type: "+typeof i+". Please use a boolean."):(zu=i,i?"adapter.js logging disabled":"adapter.js logging enabled")}function Cv(i){return typeof i!="boolean"?new Error("Argument type: "+typeof i+". Please use a boolean."):(Vu=!i,"adapter.js deprecation warnings "+(i?"disabled":"enabled"))}function $u(){if(typeof window=="object"){if(zu)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Vo(i,s){Vu&&console.warn(i+" is deprecated, please use "+s+" instead.")}function bv(i){const s={browser:null,version:null};if(typeof i>"u"||!i.navigator)return s.browser="Not a browser.",s;const{navigator:n}=i;if(n.mozGetUserMedia)s.browser="firefox",s.version=ri(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||i.isSecureContext===!1&&i.webkitRTCPeerConnection&&!i.RTCIceGatherer)s.browser="chrome",s.version=ri(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(i.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))s.browser="safari",s.version=ri(n.userAgent,/AppleWebKit\/(\d+)\./,1),s.supportsUnifiedPlan=i.RTCRtpTransceiver&&"currentDirection"in i.RTCRtpTransceiver.prototype;else return s.browser="Not a supported browser.",s;return s}function bu(i){return Object.prototype.toString.call(i)==="[object Object]"}function ju(i){return bu(i)?Object.keys(i).reduce(function(s,n){const o=bu(i[n]),a=o?ju(i[n]):i[n],u=o&&!Object.keys(a).length;return a===void 0||u?s:Object.assign(s,{[n]:a})},{}):i}function Fo(i,s,n){!s||n.has(s.id)||(n.set(s.id,s),Object.keys(s).forEach(o=>{o.endsWith("Id")?Fo(i,i.get(s[o]),n):o.endsWith("Ids")&&s[o].forEach(a=>{Fo(i,i.get(a),n)})}))}function Tu(i,s,n){const o=n?"outbound-rtp":"inbound-rtp",a=new Map;if(s===null)return a;const u=[];return i.forEach(p=>{p.type==="track"&&p.trackIdentifier===s.id&&u.push(p)}),u.forEach(p=>{i.forEach(g=>{g.type===o&&g.trackId===p.id&&Fo(i,g,a)})}),a}const Ru=$u;function Ku(i,s){const n=i&&i.navigator;if(!n.mediaDevices)return;const o=function(g){if(typeof g!="object"||g.mandatory||g.optional)return g;const T={};return Object.keys(g).forEach(l=>{if(l==="require"||l==="advanced"||l==="mediaSource")return;const _=typeof g[l]=="object"?g[l]:{ideal:g[l]};_.exact!==void 0&&typeof _.exact=="number"&&(_.min=_.max=_.exact);const D=function(H,z){return H?H+z.charAt(0).toUpperCase()+z.slice(1):z==="deviceId"?"sourceId":z};if(_.ideal!==void 0){T.optional=T.optional||[];let H={};typeof _.ideal=="number"?(H[D("min",l)]=_.ideal,T.optional.push(H),H={},H[D("max",l)]=_.ideal,T.optional.push(H)):(H[D("",l)]=_.ideal,T.optional.push(H))}_.exact!==void 0&&typeof _.exact!="number"?(T.mandatory=T.mandatory||{},T.mandatory[D("",l)]=_.exact):["min","max"].forEach(H=>{_[H]!==void 0&&(T.mandatory=T.mandatory||{},T.mandatory[D(H,l)]=_[H])})}),g.advanced&&(T.optional=(T.optional||[]).concat(g.advanced)),T},a=function(g,T){if(s.version>=61)return T(g);if(g=JSON.parse(JSON.stringify(g)),g&&typeof g.audio=="object"){const l=function(_,D,H){D in _&&!(H in _)&&(_[H]=_[D],delete _[D])};g=JSON.parse(JSON.stringify(g)),l(g.audio,"autoGainControl","googAutoGainControl"),l(g.audio,"noiseSuppression","googNoiseSuppression"),g.audio=o(g.audio)}if(g&&typeof g.video=="object"){let l=g.video.facingMode;l=l&&(typeof l=="object"?l:{ideal:l});const _=s.version<66;if(l&&(l.exact==="user"||l.exact==="environment"||l.ideal==="user"||l.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!_)){delete g.video.facingMode;let D;if(l.exact==="environment"||l.ideal==="environment"?D=["back","rear"]:(l.exact==="user"||l.ideal==="user")&&(D=["front"]),D)return n.mediaDevices.enumerateDevices().then(H=>{H=H.filter(j=>j.kind==="videoinput");let z=H.find(j=>D.some(ee=>j.label.toLowerCase().includes(ee)));return!z&&H.length&&D.includes("back")&&(z=H[H.length-1]),z&&(g.video.deviceId=l.exact?{exact:z.deviceId}:{ideal:z.deviceId}),g.video=o(g.video),Ru("chrome: "+JSON.stringify(g)),T(g)})}g.video=o(g.video)}return Ru("chrome: "+JSON.stringify(g)),T(g)},u=function(g){return s.version>=64?g:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[g.name]||g.name,message:g.message,constraint:g.constraint||g.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},p=function(g,T,l){a(g,_=>{n.webkitGetUserMedia(_,T,D=>{l&&l(u(D))})})};if(n.getUserMedia=p.bind(n),n.mediaDevices.getUserMedia){const g=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(T){return a(T,l=>g(l).then(_=>{if(l.audio&&!_.getAudioTracks().length||l.video&&!_.getVideoTracks().length)throw _.getTracks().forEach(D=>{D.stop()}),new DOMException("","NotFoundError");return _},_=>Promise.reject(u(_))))}}}function Tv(i,s){if(!(i.navigator.mediaDevices&&"getDisplayMedia"in i.navigator.mediaDevices)&&i.navigator.mediaDevices){if(typeof s!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}i.navigator.mediaDevices.getDisplayMedia=function(o){return s(o).then(a=>{const u=o.video&&o.video.width,p=o.video&&o.video.height,g=o.video&&o.video.frameRate;return o.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:a,maxFrameRate:g||3}},u&&(o.video.mandatory.maxWidth=u),p&&(o.video.mandatory.maxHeight=p),i.navigator.mediaDevices.getUserMedia(o)})}}}function Yu(i){i.MediaStream=i.MediaStream||i.webkitMediaStream}function Zu(i){if(typeof i=="object"&&i.RTCPeerConnection&&!("ontrack"in i.RTCPeerConnection.prototype)){Object.defineProperty(i.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(n){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=n)},enumerable:!0,configurable:!0});const s=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=o=>{o.stream.addEventListener("addtrack",a=>{let u;i.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(g=>g.track&&g.track.id===a.track.id):u={track:a.track};const p=new Event("track");p.track=a.track,p.receiver=u,p.transceiver={receiver:u},p.streams=[o.stream],this.dispatchEvent(p)}),o.stream.getTracks().forEach(a=>{let u;i.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(g=>g.track&&g.track.id===a.id):u={track:a};const p=new Event("track");p.track=a,p.receiver=u,p.transceiver={receiver:u},p.streams=[o.stream],this.dispatchEvent(p)})},this.addEventListener("addstream",this._ontrackpoly)),s.apply(this,arguments)}}else In(i,"track",s=>(s.transceiver||Object.defineProperty(s,"transceiver",{value:{receiver:s.receiver}}),s))}function Xu(i){if(typeof i=="object"&&i.RTCPeerConnection&&!("getSenders"in i.RTCPeerConnection.prototype)&&"createDTMFSender"in i.RTCPeerConnection.prototype){const s=function(a,u){return{track:u,get dtmf(){return this._dtmf===void 0&&(u.kind==="audio"?this._dtmf=a.createDTMFSender(u):this._dtmf=null),this._dtmf},_pc:a}};if(!i.RTCPeerConnection.prototype.getSenders){i.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const a=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(g,T){let l=a.apply(this,arguments);return l||(l=s(this,g),this._senders.push(l)),l};const u=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(g){u.apply(this,arguments);const T=this._senders.indexOf(g);T!==-1&&this._senders.splice(T,1)}}const n=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(u){this._senders=this._senders||[],n.apply(this,[u]),u.getTracks().forEach(p=>{this._senders.push(s(this,p))})};const o=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(u){this._senders=this._senders||[],o.apply(this,[u]),u.getTracks().forEach(p=>{const g=this._senders.find(T=>T.track===p);g&&this._senders.splice(this._senders.indexOf(g),1)})}}else if(typeof i=="object"&&i.RTCPeerConnection&&"getSenders"in i.RTCPeerConnection.prototype&&"createDTMFSender"in i.RTCPeerConnection.prototype&&i.RTCRtpSender&&!("dtmf"in i.RTCRtpSender.prototype)){const s=i.RTCPeerConnection.prototype.getSenders;i.RTCPeerConnection.prototype.getSenders=function(){const o=s.apply(this,[]);return o.forEach(a=>a._pc=this),o},Object.defineProperty(i.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Qu(i){if(!i.RTCPeerConnection)return;const s=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){const[o,a,u]=arguments;if(arguments.length>0&&typeof o=="function")return s.apply(this,arguments);if(s.length===0&&(arguments.length===0||typeof o!="function"))return s.apply(this,[]);const p=function(T){const l={};return T.result().forEach(D=>{const H={id:D.id,timestamp:D.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[D.type]||D.type};D.names().forEach(z=>{H[z]=D.stat(z)}),l[H.id]=H}),l},g=function(T){return new Map(Object.keys(T).map(l=>[l,T[l]]))};if(arguments.length>=2){const T=function(l){a(g(p(l)))};return s.apply(this,[T,o])}return new Promise((T,l)=>{s.apply(this,[function(_){T(g(p(_)))},l])}).then(a,u)}}function ec(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender&&i.RTCRtpReceiver))return;if(!("getStats"in i.RTCRtpSender.prototype)){const n=i.RTCPeerConnection.prototype.getSenders;n&&(i.RTCPeerConnection.prototype.getSenders=function(){const u=n.apply(this,[]);return u.forEach(p=>p._pc=this),u});const o=i.RTCPeerConnection.prototype.addTrack;o&&(i.RTCPeerConnection.prototype.addTrack=function(){const u=o.apply(this,arguments);return u._pc=this,u}),i.RTCRtpSender.prototype.getStats=function(){const u=this;return this._pc.getStats().then(p=>Tu(p,u.track,!0))}}if(!("getStats"in i.RTCRtpReceiver.prototype)){const n=i.RTCPeerConnection.prototype.getReceivers;n&&(i.RTCPeerConnection.prototype.getReceivers=function(){const a=n.apply(this,[]);return a.forEach(u=>u._pc=this),a}),In(i,"track",o=>(o.receiver._pc=o.srcElement,o)),i.RTCRtpReceiver.prototype.getStats=function(){const a=this;return this._pc.getStats().then(u=>Tu(u,a.track,!1))}}if(!("getStats"in i.RTCRtpSender.prototype&&"getStats"in i.RTCRtpReceiver.prototype))return;const s=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof i.MediaStreamTrack){const o=arguments[0];let a,u,p;return this.getSenders().forEach(g=>{g.track===o&&(a?p=!0:a=g)}),this.getReceivers().forEach(g=>(g.track===o&&(u?p=!0:u=g),g.track===o)),p||a&&u?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):a?a.getStats():u?u.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return s.apply(this,arguments)}}function tc(i){i.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(p=>this._shimmedLocalStreams[p][0])};const s=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(p,g){if(!g)return s.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const T=s.apply(this,arguments);return this._shimmedLocalStreams[g.id]?this._shimmedLocalStreams[g.id].indexOf(T)===-1&&this._shimmedLocalStreams[g.id].push(T):this._shimmedLocalStreams[g.id]=[g,T],T};const n=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(p){this._shimmedLocalStreams=this._shimmedLocalStreams||{},p.getTracks().forEach(l=>{if(this.getSenders().find(D=>D.track===l))throw new DOMException("Track already exists.","InvalidAccessError")});const g=this.getSenders();n.apply(this,arguments);const T=this.getSenders().filter(l=>g.indexOf(l)===-1);this._shimmedLocalStreams[p.id]=[p].concat(T)};const o=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(p){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[p.id],o.apply(this,arguments)};const a=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(p){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},p&&Object.keys(this._shimmedLocalStreams).forEach(g=>{const T=this._shimmedLocalStreams[g].indexOf(p);T!==-1&&this._shimmedLocalStreams[g].splice(T,1),this._shimmedLocalStreams[g].length===1&&delete this._shimmedLocalStreams[g]}),a.apply(this,arguments)}}function nc(i,s){if(!i.RTCPeerConnection)return;if(i.RTCPeerConnection.prototype.addTrack&&s.version>=65)return tc(i);const n=i.RTCPeerConnection.prototype.getLocalStreams;i.RTCPeerConnection.prototype.getLocalStreams=function(){const _=n.apply(this);return this._reverseStreams=this._reverseStreams||{},_.map(D=>this._reverseStreams[D.id])};const o=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(_){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},_.getTracks().forEach(D=>{if(this.getSenders().find(z=>z.track===D))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[_.id]){const D=new i.MediaStream(_.getTracks());this._streams[_.id]=D,this._reverseStreams[D.id]=_,_=D}o.apply(this,[_])};const a=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(_){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},a.apply(this,[this._streams[_.id]||_]),delete this._reverseStreams[this._streams[_.id]?this._streams[_.id].id:_.id],delete this._streams[_.id]},i.RTCPeerConnection.prototype.addTrack=function(_,D){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const H=[].slice.call(arguments,1);if(H.length!==1||!H[0].getTracks().find(ee=>ee===_))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(ee=>ee.track===_))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const j=this._streams[D.id];if(j)j.addTrack(_),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const ee=new i.MediaStream([_]);this._streams[D.id]=ee,this._reverseStreams[ee.id]=D,this.addStream(ee)}return this.getSenders().find(ee=>ee.track===_)};function u(l,_){let D=_.sdp;return Object.keys(l._reverseStreams||[]).forEach(H=>{const z=l._reverseStreams[H],j=l._streams[z.id];D=D.replace(new RegExp(j.id,"g"),z.id)}),new RTCSessionDescription({type:_.type,sdp:D})}function p(l,_){let D=_.sdp;return Object.keys(l._reverseStreams||[]).forEach(H=>{const z=l._reverseStreams[H],j=l._streams[z.id];D=D.replace(new RegExp(z.id,"g"),j.id)}),new RTCSessionDescription({type:_.type,sdp:D})}["createOffer","createAnswer"].forEach(function(l){const _=i.RTCPeerConnection.prototype[l],D={[l](){const H=arguments;return arguments.length&&typeof arguments[0]=="function"?_.apply(this,[j=>{const ee=u(this,j);H[0].apply(null,[ee])},j=>{H[1]&&H[1].apply(null,j)},arguments[2]]):_.apply(this,arguments).then(j=>u(this,j))}};i.RTCPeerConnection.prototype[l]=D[l]});const g=i.RTCPeerConnection.prototype.setLocalDescription;i.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?g.apply(this,arguments):(arguments[0]=p(this,arguments[0]),g.apply(this,arguments))};const T=Object.getOwnPropertyDescriptor(i.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(i.RTCPeerConnection.prototype,"localDescription",{get(){const l=T.get.apply(this);return l.type===""?l:u(this,l)}}),i.RTCPeerConnection.prototype.removeTrack=function(_){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!_._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(_._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let H;Object.keys(this._streams).forEach(z=>{this._streams[z].getTracks().find(ee=>_.track===ee)&&(H=this._streams[z])}),H&&(H.getTracks().length===1?this.removeStream(this._reverseStreams[H.id]):H.removeTrack(_.track),this.dispatchEvent(new Event("negotiationneeded")))}}function No(i,s){!i.RTCPeerConnection&&i.webkitRTCPeerConnection&&(i.RTCPeerConnection=i.webkitRTCPeerConnection),i.RTCPeerConnection&&s.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const o=i.RTCPeerConnection.prototype[n],a={[n](){return arguments[0]=new(n==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),o.apply(this,arguments)}};i.RTCPeerConnection.prototype[n]=a[n]})}function rc(i,s){In(i,"negotiationneeded",n=>{const o=n.target;if(!((s.version<72||o.getConfiguration&&o.getConfiguration().sdpSemantics==="plan-b")&&o.signalingState!=="stable"))return n})}const xu=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:rc,shimAddTrackRemoveTrack:nc,shimAddTrackRemoveTrackWithNative:tc,shimGetDisplayMedia:Tv,shimGetSendersWithDtmf:Xu,shimGetStats:Qu,shimGetUserMedia:Ku,shimMediaStream:Yu,shimOnTrack:Zu,shimPeerConnection:No,shimSenderReceiverGetStats:ec},Symbol.toStringTag,{value:"Module"}));function ic(i,s){const n=i&&i.navigator,o=i&&i.MediaStreamTrack;if(n.getUserMedia=function(a,u,p){Vo("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(a).then(u,p)},!(s.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const a=function(p,g,T){g in p&&!(T in p)&&(p[T]=p[g],delete p[g])},u=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(p){return typeof p=="object"&&typeof p.audio=="object"&&(p=JSON.parse(JSON.stringify(p)),a(p.audio,"autoGainControl","mozAutoGainControl"),a(p.audio,"noiseSuppression","mozNoiseSuppression")),u(p)},o&&o.prototype.getSettings){const p=o.prototype.getSettings;o.prototype.getSettings=function(){const g=p.apply(this,arguments);return a(g,"mozAutoGainControl","autoGainControl"),a(g,"mozNoiseSuppression","noiseSuppression"),g}}if(o&&o.prototype.applyConstraints){const p=o.prototype.applyConstraints;o.prototype.applyConstraints=function(g){return this.kind==="audio"&&typeof g=="object"&&(g=JSON.parse(JSON.stringify(g)),a(g,"autoGainControl","mozAutoGainControl"),a(g,"noiseSuppression","mozNoiseSuppression")),p.apply(this,[g])}}}}function Rv(i,s){i.navigator.mediaDevices&&"getDisplayMedia"in i.navigator.mediaDevices||i.navigator.mediaDevices&&(i.navigator.mediaDevices.getDisplayMedia=function(o){if(!(o&&o.video)){const a=new DOMException("getDisplayMedia without video constraints is undefined");return a.name="NotFoundError",a.code=8,Promise.reject(a)}return o.video===!0?o.video={mediaSource:s}:o.video.mediaSource=s,i.navigator.mediaDevices.getUserMedia(o)})}function oc(i){typeof i=="object"&&i.RTCTrackEvent&&"receiver"in i.RTCTrackEvent.prototype&&!("transceiver"in i.RTCTrackEvent.prototype)&&Object.defineProperty(i.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Go(i,s){if(typeof i!="object"||!(i.RTCPeerConnection||i.mozRTCPeerConnection))return;!i.RTCPeerConnection&&i.mozRTCPeerConnection&&(i.RTCPeerConnection=i.mozRTCPeerConnection),s.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(a){const u=i.RTCPeerConnection.prototype[a],p={[a](){return arguments[0]=new(a==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),u.apply(this,arguments)}};i.RTCPeerConnection.prototype[a]=p[a]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},o=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){const[u,p,g]=arguments;return o.apply(this,[u||null]).then(T=>{if(s.version<53&&!p)try{T.forEach(l=>{l.type=n[l.type]||l.type})}catch(l){if(l.name!=="TypeError")throw l;T.forEach((_,D)=>{T.set(D,Object.assign({},_,{type:n[_.type]||_.type}))})}return T}).then(p,g)}}function sc(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender)||i.RTCRtpSender&&"getStats"in i.RTCRtpSender.prototype)return;const s=i.RTCPeerConnection.prototype.getSenders;s&&(i.RTCPeerConnection.prototype.getSenders=function(){const a=s.apply(this,[]);return a.forEach(u=>u._pc=this),a});const n=i.RTCPeerConnection.prototype.addTrack;n&&(i.RTCPeerConnection.prototype.addTrack=function(){const a=n.apply(this,arguments);return a._pc=this,a}),i.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function ac(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender)||i.RTCRtpSender&&"getStats"in i.RTCRtpReceiver.prototype)return;const s=i.RTCPeerConnection.prototype.getReceivers;s&&(i.RTCPeerConnection.prototype.getReceivers=function(){const o=s.apply(this,[]);return o.forEach(a=>a._pc=this),o}),In(i,"track",n=>(n.receiver._pc=n.srcElement,n)),i.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function uc(i){!i.RTCPeerConnection||"removeStream"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.removeStream=function(n){Vo("removeStream","removeTrack"),this.getSenders().forEach(o=>{o.track&&n.getTracks().includes(o.track)&&this.removeTrack(o)})})}function cc(i){i.DataChannel&&!i.RTCDataChannel&&(i.RTCDataChannel=i.DataChannel)}function fc(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.addTransceiver;s&&(i.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const o=arguments[1],a=o&&"sendEncodings"in o;a&&o.sendEncodings.forEach(p=>{if("rid"in p&&!/^[a-z0-9]{0,16}$/i.test(p.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in p&&!(parseFloat(p.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in p&&!(parseFloat(p.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const u=s.apply(this,arguments);if(a){const{sender:p}=u,g=p.getParameters();(!("encodings"in g)||g.encodings.length===1&&Object.keys(g.encodings[0]).length===0)&&(g.encodings=o.sendEncodings,p.sendEncodings=o.sendEncodings,this.setParametersPromises.push(p.setParameters(g).then(()=>{delete p.sendEncodings}).catch(()=>{delete p.sendEncodings})))}return u})}function lc(i){if(!(typeof i=="object"&&i.RTCRtpSender))return;const s=i.RTCRtpSender.prototype.getParameters;s&&(i.RTCRtpSender.prototype.getParameters=function(){const o=s.apply(this,arguments);return"encodings"in o||(o.encodings=[].concat(this.sendEncodings||[{}])),o})}function dc(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.createOffer;i.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>s.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):s.apply(this,arguments)}}function pc(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.createAnswer;i.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>s.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):s.apply(this,arguments)}}const Pu=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:fc,shimCreateAnswer:pc,shimCreateOffer:dc,shimGetDisplayMedia:Rv,shimGetParameters:lc,shimGetUserMedia:ic,shimOnTrack:oc,shimPeerConnection:Go,shimRTCDataChannel:cc,shimReceiverGetStats:ac,shimRemoveStream:uc,shimSenderGetStats:sc},Symbol.toStringTag,{value:"Module"}));function hc(i){if(!(typeof i!="object"||!i.RTCPeerConnection)){if("getLocalStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in i.RTCPeerConnection.prototype)){const s=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addStream=function(o){this._localStreams||(this._localStreams=[]),this._localStreams.includes(o)||this._localStreams.push(o),o.getAudioTracks().forEach(a=>s.call(this,a,o)),o.getVideoTracks().forEach(a=>s.call(this,a,o))},i.RTCPeerConnection.prototype.addTrack=function(o,...a){return a&&a.forEach(u=>{this._localStreams?this._localStreams.includes(u)||this._localStreams.push(u):this._localStreams=[u]}),s.apply(this,arguments)}}"removeStream"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.removeStream=function(n){this._localStreams||(this._localStreams=[]);const o=this._localStreams.indexOf(n);if(o===-1)return;this._localStreams.splice(o,1);const a=n.getTracks();this.getSenders().forEach(u=>{a.includes(u.track)&&this.removeTrack(u)})})}}function gc(i){if(!(typeof i!="object"||!i.RTCPeerConnection)&&("getRemoteStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in i.RTCPeerConnection.prototype))){Object.defineProperty(i.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=o=>{o.streams.forEach(a=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(a))return;this._remoteStreams.push(a);const u=new Event("addstream");u.stream=a,this.dispatchEvent(u)})})}});const s=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){const o=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(a){a.streams.forEach(u=>{if(o._remoteStreams||(o._remoteStreams=[]),o._remoteStreams.indexOf(u)>=0)return;o._remoteStreams.push(u);const p=new Event("addstream");p.stream=u,o.dispatchEvent(p)})}),s.apply(o,arguments)}}}function mc(i){if(typeof i!="object"||!i.RTCPeerConnection)return;const s=i.RTCPeerConnection.prototype,n=s.createOffer,o=s.createAnswer,a=s.setLocalDescription,u=s.setRemoteDescription,p=s.addIceCandidate;s.createOffer=function(l,_){const D=arguments.length>=2?arguments[2]:arguments[0],H=n.apply(this,[D]);return _?(H.then(l,_),Promise.resolve()):H},s.createAnswer=function(l,_){const D=arguments.length>=2?arguments[2]:arguments[0],H=o.apply(this,[D]);return _?(H.then(l,_),Promise.resolve()):H};let g=function(T,l,_){const D=a.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D};s.setLocalDescription=g,g=function(T,l,_){const D=u.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D},s.setRemoteDescription=g,g=function(T,l,_){const D=p.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D},s.addIceCandidate=g}function vc(i){const s=i&&i.navigator;if(s.mediaDevices&&s.mediaDevices.getUserMedia){const n=s.mediaDevices,o=n.getUserMedia.bind(n);s.mediaDevices.getUserMedia=a=>o(yc(a))}!s.getUserMedia&&s.mediaDevices&&s.mediaDevices.getUserMedia&&(s.getUserMedia=(function(o,a,u){s.mediaDevices.getUserMedia(o).then(a,u)}).bind(s))}function yc(i){return i&&i.video!==void 0?Object.assign({},i,{video:ju(i.video)}):i}function _c(i){if(!i.RTCPeerConnection)return;const s=i.RTCPeerConnection;i.RTCPeerConnection=function(o,a){if(o&&o.iceServers){const u=[];for(let p=0;p<o.iceServers.length;p++){let g=o.iceServers[p];!g.hasOwnProperty("urls")&&g.hasOwnProperty("url")?(Vo("RTCIceServer.url","RTCIceServer.urls"),g=JSON.parse(JSON.stringify(g)),g.urls=g.url,delete g.url,u.push(g)):u.push(o.iceServers[p])}o.iceServers=u}return new s(o,a)},i.RTCPeerConnection.prototype=s.prototype,"generateCertificate"in s&&Object.defineProperty(i.RTCPeerConnection,"generateCertificate",{get(){return s.generateCertificate}})}function Sc(i){typeof i=="object"&&i.RTCTrackEvent&&"receiver"in i.RTCTrackEvent.prototype&&!("transceiver"in i.RTCTrackEvent.prototype)&&Object.defineProperty(i.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Cc(i){const s=i.RTCPeerConnection.prototype.createOffer;i.RTCPeerConnection.prototype.createOffer=function(o){if(o){typeof o.offerToReceiveAudio<"u"&&(o.offerToReceiveAudio=!!o.offerToReceiveAudio);const a=this.getTransceivers().find(p=>p.receiver.track.kind==="audio");o.offerToReceiveAudio===!1&&a?a.direction==="sendrecv"?a.setDirection?a.setDirection("sendonly"):a.direction="sendonly":a.direction==="recvonly"&&(a.setDirection?a.setDirection("inactive"):a.direction="inactive"):o.offerToReceiveAudio===!0&&!a&&this.addTransceiver("audio",{direction:"recvonly"}),typeof o.offerToReceiveVideo<"u"&&(o.offerToReceiveVideo=!!o.offerToReceiveVideo);const u=this.getTransceivers().find(p=>p.receiver.track.kind==="video");o.offerToReceiveVideo===!1&&u?u.direction==="sendrecv"?u.setDirection?u.setDirection("sendonly"):u.direction="sendonly":u.direction==="recvonly"&&(u.setDirection?u.setDirection("inactive"):u.direction="inactive"):o.offerToReceiveVideo===!0&&!u&&this.addTransceiver("video",{direction:"recvonly"})}return s.apply(this,arguments)}}function bc(i){typeof i!="object"||i.AudioContext||(i.AudioContext=i.webkitAudioContext)}const wu=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:bc,shimCallbacksAPI:mc,shimConstraints:yc,shimCreateOfferLegacy:Cc,shimGetUserMedia:vc,shimLocalStreamsAPI:hc,shimRTCIceServerUrls:_c,shimRemoteStreamsAPI:gc,shimTrackEventTransceiver:Sc},Symbol.toStringTag,{value:"Module"}));var Tc={exports:{}};(function(i){const s={};s.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},s.localCName=s.generateIdentifier(),s.splitLines=function(n){return n.trim().split("\n").map(o=>o.trim())},s.splitSections=function(n){return n.split("\nm=").map((a,u)=>(u>0?"m="+a:a).trim()+"\r\n")},s.getDescription=function(n){const o=s.splitSections(n);return o&&o[0]},s.getMediaSections=function(n){const o=s.splitSections(n);return o.shift(),o},s.matchPrefix=function(n,o){return s.splitLines(n).filter(a=>a.indexOf(o)===0)},s.parseCandidate=function(n){let o;n.indexOf("a=candidate:")===0?o=n.substring(12).split(" "):o=n.substring(10).split(" ");const a={foundation:o[0],component:{1:"rtp",2:"rtcp"}[o[1]]||o[1],protocol:o[2].toLowerCase(),priority:parseInt(o[3],10),ip:o[4],address:o[4],port:parseInt(o[5],10),type:o[7]};for(let u=8;u<o.length;u+=2)switch(o[u]){case"raddr":a.relatedAddress=o[u+1];break;case"rport":a.relatedPort=parseInt(o[u+1],10);break;case"tcptype":a.tcpType=o[u+1];break;case"ufrag":a.ufrag=o[u+1],a.usernameFragment=o[u+1];break;default:a[o[u]]===void 0&&(a[o[u]]=o[u+1]);break}return a},s.writeCandidate=function(n){const o=[];o.push(n.foundation);const a=n.component;a==="rtp"?o.push(1):a==="rtcp"?o.push(2):o.push(a),o.push(n.protocol.toUpperCase()),o.push(n.priority),o.push(n.address||n.ip),o.push(n.port);const u=n.type;return o.push("typ"),o.push(u),u!=="host"&&n.relatedAddress&&n.relatedPort&&(o.push("raddr"),o.push(n.relatedAddress),o.push("rport"),o.push(n.relatedPort)),n.tcpType&&n.protocol.toLowerCase()==="tcp"&&(o.push("tcptype"),o.push(n.tcpType)),(n.usernameFragment||n.ufrag)&&(o.push("ufrag"),o.push(n.usernameFragment||n.ufrag)),"candidate:"+o.join(" ")},s.parseIceOptions=function(n){return n.substring(14).split(" ")},s.parseRtpMap=function(n){let o=n.substring(9).split(" ");const a={payloadType:parseInt(o.shift(),10)};return o=o[0].split("/"),a.name=o[0],a.clockRate=parseInt(o[1],10),a.channels=o.length===3?parseInt(o[2],10):1,a.numChannels=a.channels,a},s.writeRtpMap=function(n){let o=n.payloadType;n.preferredPayloadType!==void 0&&(o=n.preferredPayloadType);const a=n.channels||n.numChannels||1;return"a=rtpmap:"+o+" "+n.name+"/"+n.clockRate+(a!==1?"/"+a:"")+"\r\n"},s.parseExtmap=function(n){const o=n.substring(9).split(" ");return{id:parseInt(o[0],10),direction:o[0].indexOf("/")>0?o[0].split("/")[1]:"sendrecv",uri:o[1],attributes:o.slice(2).join(" ")}},s.writeExtmap=function(n){return"a=extmap:"+(n.id||n.preferredId)+(n.direction&&n.direction!=="sendrecv"?"/"+n.direction:"")+" "+n.uri+(n.attributes?" "+n.attributes:"")+"\r\n"},s.parseFmtp=function(n){const o={};let a;const u=n.substring(n.indexOf(" ")+1).split(";");for(let p=0;p<u.length;p++)a=u[p].trim().split("="),o[a[0].trim()]=a[1];return o},s.writeFmtp=function(n){let o="",a=n.payloadType;if(n.preferredPayloadType!==void 0&&(a=n.preferredPayloadType),n.parameters&&Object.keys(n.parameters).length){const u=[];Object.keys(n.parameters).forEach(p=>{n.parameters[p]!==void 0?u.push(p+"="+n.parameters[p]):u.push(p)}),o+="a=fmtp:"+a+" "+u.join(";")+"\r\n"}return o},s.parseRtcpFb=function(n){const o=n.substring(n.indexOf(" ")+1).split(" ");return{type:o.shift(),parameter:o.join(" ")}},s.writeRtcpFb=function(n){let o="",a=n.payloadType;return n.preferredPayloadType!==void 0&&(a=n.preferredPayloadType),n.rtcpFeedback&&n.rtcpFeedback.length&&n.rtcpFeedback.forEach(u=>{o+="a=rtcp-fb:"+a+" "+u.type+(u.parameter&&u.parameter.length?" "+u.parameter:"")+"\r\n"}),o},s.parseSsrcMedia=function(n){const o=n.indexOf(" "),a={ssrc:parseInt(n.substring(7,o),10)},u=n.indexOf(":",o);return u>-1?(a.attribute=n.substring(o+1,u),a.value=n.substring(u+1)):a.attribute=n.substring(o+1),a},s.parseSsrcGroup=function(n){const o=n.substring(13).split(" ");return{semantics:o.shift(),ssrcs:o.map(a=>parseInt(a,10))}},s.getMid=function(n){const o=s.matchPrefix(n,"a=mid:")[0];if(o)return o.substring(6)},s.parseFingerprint=function(n){const o=n.substring(14).split(" ");return{algorithm:o[0].toLowerCase(),value:o[1].toUpperCase()}},s.getDtlsParameters=function(n,o){return{role:"auto",fingerprints:s.matchPrefix(n+o,"a=fingerprint:").map(s.parseFingerprint)}},s.writeDtlsParameters=function(n,o){let a="a=setup:"+o+"\r\n";return n.fingerprints.forEach(u=>{a+="a=fingerprint:"+u.algorithm+" "+u.value+"\r\n"}),a},s.parseCryptoLine=function(n){const o=n.substring(9).split(" ");return{tag:parseInt(o[0],10),cryptoSuite:o[1],keyParams:o[2],sessionParams:o.slice(3)}},s.writeCryptoLine=function(n){return"a=crypto:"+n.tag+" "+n.cryptoSuite+" "+(typeof n.keyParams=="object"?s.writeCryptoKeyParams(n.keyParams):n.keyParams)+(n.sessionParams?" "+n.sessionParams.join(" "):"")+"\r\n"},s.parseCryptoKeyParams=function(n){if(n.indexOf("inline:")!==0)return null;const o=n.substring(7).split("|");return{keyMethod:"inline",keySalt:o[0],lifeTime:o[1],mkiValue:o[2]?o[2].split(":")[0]:void 0,mkiLength:o[2]?o[2].split(":")[1]:void 0}},s.writeCryptoKeyParams=function(n){return n.keyMethod+":"+n.keySalt+(n.lifeTime?"|"+n.lifeTime:"")+(n.mkiValue&&n.mkiLength?"|"+n.mkiValue+":"+n.mkiLength:"")},s.getCryptoParameters=function(n,o){return s.matchPrefix(n+o,"a=crypto:").map(s.parseCryptoLine)},s.getIceParameters=function(n,o){const a=s.matchPrefix(n+o,"a=ice-ufrag:")[0],u=s.matchPrefix(n+o,"a=ice-pwd:")[0];return a&&u?{usernameFragment:a.substring(12),password:u.substring(10)}:null},s.writeIceParameters=function(n){let o="a=ice-ufrag:"+n.usernameFragment+"\r\na=ice-pwd:"+n.password+"\r\n";return n.iceLite&&(o+="a=ice-lite\r\n"),o},s.parseRtpParameters=function(n){const o={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},u=s.splitLines(n)[0].split(" ");o.profile=u[2];for(let g=3;g<u.length;g++){const T=u[g],l=s.matchPrefix(n,"a=rtpmap:"+T+" ")[0];if(l){const _=s.parseRtpMap(l),D=s.matchPrefix(n,"a=fmtp:"+T+" ");switch(_.parameters=D.length?s.parseFmtp(D[0]):{},_.rtcpFeedback=s.matchPrefix(n,"a=rtcp-fb:"+T+" ").map(s.parseRtcpFb),o.codecs.push(_),_.name.toUpperCase()){case"RED":case"ULPFEC":o.fecMechanisms.push(_.name.toUpperCase());break}}}s.matchPrefix(n,"a=extmap:").forEach(g=>{o.headerExtensions.push(s.parseExtmap(g))});const p=s.matchPrefix(n,"a=rtcp-fb:* ").map(s.parseRtcpFb);return o.codecs.forEach(g=>{p.forEach(T=>{g.rtcpFeedback.find(_=>_.type===T.type&&_.parameter===T.parameter)||g.rtcpFeedback.push(T)})}),o},s.writeRtpDescription=function(n,o){let a="";a+="m="+n+" ",a+=o.codecs.length>0?"9":"0",a+=" "+(o.profile||"UDP/TLS/RTP/SAVPF")+" ",a+=o.codecs.map(p=>p.preferredPayloadType!==void 0?p.preferredPayloadType:p.payloadType).join(" ")+"\r\n",a+="c=IN IP4 0.0.0.0\r\n",a+="a=rtcp:9 IN IP4 0.0.0.0\r\n",o.codecs.forEach(p=>{a+=s.writeRtpMap(p),a+=s.writeFmtp(p),a+=s.writeRtcpFb(p)});let u=0;return o.codecs.forEach(p=>{p.maxptime>u&&(u=p.maxptime)}),u>0&&(a+="a=maxptime:"+u+"\r\n"),o.headerExtensions&&o.headerExtensions.forEach(p=>{a+=s.writeExtmap(p)}),a},s.parseRtpEncodingParameters=function(n){const o=[],a=s.parseRtpParameters(n),u=a.fecMechanisms.indexOf("RED")!==-1,p=a.fecMechanisms.indexOf("ULPFEC")!==-1,g=s.matchPrefix(n,"a=ssrc:").map(H=>s.parseSsrcMedia(H)).filter(H=>H.attribute==="cname"),T=g.length>0&&g[0].ssrc;let l;const _=s.matchPrefix(n,"a=ssrc-group:FID").map(H=>H.substring(17).split(" ").map(j=>parseInt(j,10)));_.length>0&&_[0].length>1&&_[0][0]===T&&(l=_[0][1]),a.codecs.forEach(H=>{if(H.name.toUpperCase()==="RTX"&&H.parameters.apt){let z={ssrc:T,codecPayloadType:parseInt(H.parameters.apt,10)};T&&l&&(z.rtx={ssrc:l}),o.push(z),u&&(z=JSON.parse(JSON.stringify(z)),z.fec={ssrc:T,mechanism:p?"red+ulpfec":"red"},o.push(z))}}),o.length===0&&T&&o.push({ssrc:T});let D=s.matchPrefix(n,"b=");return D.length&&(D[0].indexOf("b=TIAS:")===0?D=parseInt(D[0].substring(7),10):D[0].indexOf("b=AS:")===0?D=parseInt(D[0].substring(5),10)*1e3*.95-50*40*8:D=void 0,o.forEach(H=>{H.maxBitrate=D})),o},s.parseRtcpParameters=function(n){const o={},a=s.matchPrefix(n,"a=ssrc:").map(g=>s.parseSsrcMedia(g)).filter(g=>g.attribute==="cname")[0];a&&(o.cname=a.value,o.ssrc=a.ssrc);const u=s.matchPrefix(n,"a=rtcp-rsize");o.reducedSize=u.length>0,o.compound=u.length===0;const p=s.matchPrefix(n,"a=rtcp-mux");return o.mux=p.length>0,o},s.writeRtcpParameters=function(n){let o="";return n.reducedSize&&(o+="a=rtcp-rsize\r\n"),n.mux&&(o+="a=rtcp-mux\r\n"),n.ssrc!==void 0&&n.cname&&(o+="a=ssrc:"+n.ssrc+" cname:"+n.cname+"\r\n"),o},s.parseMsid=function(n){let o;const a=s.matchPrefix(n,"a=msid:");if(a.length===1)return o=a[0].substring(7).split(" "),{stream:o[0],track:o[1]};const u=s.matchPrefix(n,"a=ssrc:").map(p=>s.parseSsrcMedia(p)).filter(p=>p.attribute==="msid");if(u.length>0)return o=u[0].value.split(" "),{stream:o[0],track:o[1]}},s.parseSctpDescription=function(n){const o=s.parseMLine(n),a=s.matchPrefix(n,"a=max-message-size:");let u;a.length>0&&(u=parseInt(a[0].substring(19),10)),isNaN(u)&&(u=65536);const p=s.matchPrefix(n,"a=sctp-port:");if(p.length>0)return{port:parseInt(p[0].substring(12),10),protocol:o.fmt,maxMessageSize:u};const g=s.matchPrefix(n,"a=sctpmap:");if(g.length>0){const T=g[0].substring(10).split(" ");return{port:parseInt(T[0],10),protocol:T[1],maxMessageSize:u}}},s.writeSctpDescription=function(n,o){let a=[];return n.protocol!=="DTLS/SCTP"?a=["m="+n.kind+" 9 "+n.protocol+" "+o.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+o.port+"\r\n"]:a=["m="+n.kind+" 9 "+n.protocol+" "+o.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+o.port+" "+o.protocol+" 65535\r\n"],o.maxMessageSize!==void 0&&a.push("a=max-message-size:"+o.maxMessageSize+"\r\n"),a.join("")},s.generateSessionId=function(){return Math.random().toString().substr(2,22)},s.writeSessionBoilerplate=function(n,o,a){let u;const p=o!==void 0?o:2;return n?u=n:u=s.generateSessionId(),"v=0\r\no="+(a||"thisisadapterortc")+" "+u+" "+p+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},s.getDirection=function(n,o){const a=s.splitLines(n);for(let u=0;u<a.length;u++)switch(a[u]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return a[u].substring(2)}return o?s.getDirection(o):"sendrecv"},s.getKind=function(n){return s.splitLines(n)[0].split(" ")[0].substring(2)},s.isRejected=function(n){return n.split(" ",2)[1]==="0"},s.parseMLine=function(n){const a=s.splitLines(n)[0].substring(2).split(" ");return{kind:a[0],port:parseInt(a[1],10),protocol:a[2],fmt:a.slice(3).join(" ")}},s.parseOLine=function(n){const a=s.matchPrefix(n,"o=")[0].substring(2).split(" ");return{username:a[0],sessionId:a[1],sessionVersion:parseInt(a[2],10),netType:a[3],addressType:a[4],address:a[5]}},s.isValidSDP=function(n){if(typeof n!="string"||n.length===0)return!1;const o=s.splitLines(n);for(let a=0;a<o.length;a++)if(o[a].length<2||o[a].charAt(1)!=="=")return!1;return!0},i.exports=s})(Tc);var Rc=Tc.exports;const Xn=qu(Rc),xv=_v({__proto__:null,default:Xn},[Rc]);function ii(i){if(!i.RTCIceCandidate||i.RTCIceCandidate&&"foundation"in i.RTCIceCandidate.prototype)return;const s=i.RTCIceCandidate;i.RTCIceCandidate=function(o){if(typeof o=="object"&&o.candidate&&o.candidate.indexOf("a=")===0&&(o=JSON.parse(JSON.stringify(o)),o.candidate=o.candidate.substr(2)),o.candidate&&o.candidate.length){const a=new s(o),u=Xn.parseCandidate(o.candidate),p=Object.assign(a,u);return p.toJSON=function(){return{candidate:p.candidate,sdpMid:p.sdpMid,sdpMLineIndex:p.sdpMLineIndex,usernameFragment:p.usernameFragment}},p}return new s(o)},i.RTCIceCandidate.prototype=s.prototype,In(i,"icecandidate",n=>(n.candidate&&Object.defineProperty(n,"candidate",{value:new i.RTCIceCandidate(n.candidate),writable:"false"}),n))}function oi(i,s){if(!i.RTCPeerConnection)return;"sctp"in i.RTCPeerConnection.prototype||Object.defineProperty(i.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const n=function(g){if(!g||!g.sdp)return!1;const T=Xn.splitSections(g.sdp);return T.shift(),T.some(l=>{const _=Xn.parseMLine(l);return _&&_.kind==="application"&&_.protocol.indexOf("SCTP")!==-1})},o=function(g){const T=g.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(T===null||T.length<2)return-1;const l=parseInt(T[1],10);return l!==l?-1:l},a=function(g){let T=65536;return s.browser==="firefox"&&(s.version<57?g===-1?T=16384:T=2147483637:s.version<60?T=s.version===57?65535:65536:T=2147483637),T},u=function(g,T){let l=65536;s.browser==="firefox"&&s.version===57&&(l=65535);const _=Xn.matchPrefix(g.sdp,"a=max-message-size:");return _.length>0?l=parseInt(_[0].substr(19),10):s.browser==="firefox"&&T!==-1&&(l=2147483637),l},p=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,s.browser==="chrome"&&s.version>=76){const{sdpSemantics:T}=this.getConfiguration();T==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const T=o(arguments[0]),l=a(T),_=u(arguments[0],T);let D;l===0&&_===0?D=Number.POSITIVE_INFINITY:l===0||_===0?D=Math.max(l,_):D=Math.min(l,_);const H={};Object.defineProperty(H,"maxMessageSize",{get(){return D}}),this._sctp=H}return p.apply(this,arguments)}}function si(i){if(!(i.RTCPeerConnection&&"createDataChannel"in i.RTCPeerConnection.prototype))return;function s(o,a){const u=o.send;o.send=function(){const g=arguments[0],T=g.length||g.size||g.byteLength;if(o.readyState==="open"&&a.sctp&&T>a.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+a.sctp.maxMessageSize+" bytes)");return u.apply(o,arguments)}}const n=i.RTCPeerConnection.prototype.createDataChannel;i.RTCPeerConnection.prototype.createDataChannel=function(){const a=n.apply(this,arguments);return s(a,this),a},In(i,"datachannel",o=>(s(o.channel,o.target),o))}function Wo(i){if(!i.RTCPeerConnection||"connectionState"in i.RTCPeerConnection.prototype)return;const s=i.RTCPeerConnection.prototype;Object.defineProperty(s,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(s,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(n=>{const o=s[n];s[n]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=a=>{const u=a.target;if(u._lastConnectionState!==u.connectionState){u._lastConnectionState=u.connectionState;const p=new Event("connectionstatechange",a);u.dispatchEvent(p)}return a},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),o.apply(this,arguments)}})}function Bo(i,s){if(!i.RTCPeerConnection||s.browser==="chrome"&&s.version>=71||s.browser==="safari"&&s.version>=605)return;const n=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(a){if(a&&a.sdp&&a.sdp.indexOf("\na=extmap-allow-mixed")!==-1){const u=a.sdp.split("\n").filter(p=>p.trim()!=="a=extmap-allow-mixed").join("\n");i.RTCSessionDescription&&a instanceof i.RTCSessionDescription?arguments[0]=new i.RTCSessionDescription({type:a.type,sdp:u}):a.sdp=u}return n.apply(this,arguments)}}function ai(i,s){if(!(i.RTCPeerConnection&&i.RTCPeerConnection.prototype))return;const n=i.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(i.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(s.browser==="chrome"&&s.version<78||s.browser==="firefox"&&s.version<68||s.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ui(i,s){if(!(i.RTCPeerConnection&&i.RTCPeerConnection.prototype))return;const n=i.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(i.RTCPeerConnection.prototype.setLocalDescription=function(){let a=arguments[0]||{};if(typeof a!="object"||a.type&&a.sdp)return n.apply(this,arguments);if(a={type:a.type,sdp:a.sdp},!a.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":a.type="offer";break;default:a.type="answer";break}return a.sdp||a.type!=="offer"&&a.type!=="answer"?n.apply(this,[a]):(a.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(p=>n.apply(this,[p]))})}const Pv=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Bo,shimAddIceCandidateNullOrEmpty:ai,shimConnectionState:Wo,shimMaxMessageSize:oi,shimParameterlessSetLocalDescription:ui,shimRTCIceCandidate:ii,shimSendThrowTypeError:si},Symbol.toStringTag,{value:"Module"}));function wv({window:i}={},s={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=$u,o=bv(i),a={browserDetails:o,commonShim:Pv,extractVersion:ri,disableLog:Sv,disableWarnings:Cv,sdp:xv};switch(o.browser){case"chrome":if(!xu||!No||!s.shimChrome)return n("Chrome shim is not included in this adapter release."),a;if(o.version===null)return n("Chrome shim can not determine version, not shimming."),a;n("adapter.js shimming chrome."),a.browserShim=xu,ai(i,o),ui(i),Ku(i,o),Yu(i),No(i,o),Zu(i),nc(i,o),Xu(i),Qu(i),ec(i),rc(i,o),ii(i),Wo(i),oi(i,o),si(i),Bo(i,o);break;case"firefox":if(!Pu||!Go||!s.shimFirefox)return n("Firefox shim is not included in this adapter release."),a;n("adapter.js shimming firefox."),a.browserShim=Pu,ai(i,o),ui(i),ic(i,o),Go(i,o),oc(i),uc(i),sc(i),ac(i),cc(i),fc(i),lc(i),dc(i),pc(i),ii(i),Wo(i),oi(i,o),si(i);break;case"safari":if(!wu||!s.shimSafari)return n("Safari shim is not included in this adapter release."),a;n("adapter.js shimming safari."),a.browserShim=wu,ai(i,o),ui(i),_c(i),Cc(i),mc(i),hc(i),gc(i),Sc(i),vc(i),bc(i),ii(i),oi(i,o),si(i),Bo(i,o);break;default:n("Unsupported browser!");break}return a}const Eu=wv({window:typeof window>"u"?void 0:window});function Mt(i){return typeof i=="function"}function xc(i){var s=function(o){Error.call(o),o.stack=new Error().stack},n=i(s);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Do=xc(function(i){return function(n){i(this),this.message=n?n.length+" errors occurred during unsubscription:\n"+n.map(function(o,a){return a+1+") "+o.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=n}});function Ho(i,s){if(i){var n=i.indexOf(s);0<=n&&i.splice(n,1)}}var hi=function(){function i(s){this.initialTeardown=s,this.closed=!1,this._parentage=null,this._finalizers=null}return i.prototype.unsubscribe=function(){var s,n,o,a,u;if(!this.closed){this.closed=!0;var p=this._parentage;if(p)if(this._parentage=null,Array.isArray(p))try{for(var g=Uo(p),T=g.next();!T.done;T=g.next()){var l=T.value;l.remove(this)}}catch(ee){s={error:ee}}finally{try{T&&!T.done&&(n=g.return)&&n.call(g)}finally{if(s)throw s.error}}else p.remove(this);var _=this.initialTeardown;if(Mt(_))try{_()}catch(ee){u=ee instanceof Do?ee.errors:[ee]}var D=this._finalizers;if(D){this._finalizers=null;try{for(var H=Uo(D),z=H.next();!z.done;z=H.next()){var j=z.value;try{Ou(j)}catch(ee){u=u!=null?u:[],ee instanceof Do?u=fi(fi([],li(u)),li(ee.errors)):u.push(ee)}}}catch(ee){o={error:ee}}finally{try{z&&!z.done&&(a=H.return)&&a.call(H)}finally{if(o)throw o.error}}}if(u)throw new Do(u)}},i.prototype.add=function(s){var n;if(s&&s!==this)if(this.closed)Ou(s);else{if(s instanceof i){if(s.closed||s._hasParent(this))return;s._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(s)}},i.prototype._hasParent=function(s){var n=this._parentage;return n===s||Array.isArray(n)&&n.includes(s)},i.prototype._addParent=function(s){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(s),n):n?[n,s]:s},i.prototype._removeParent=function(s){var n=this._parentage;n===s?this._parentage=null:Array.isArray(n)&&Ho(n,s)},i.prototype.remove=function(s){var n=this._finalizers;n&&Ho(n,s),s instanceof i&&s._removeParent(this)},i.EMPTY=function(){var s=new i;return s.closed=!0,s}(),i}(),Pc=hi.EMPTY;function wc(i){return i instanceof hi||i&&"closed"in i&&Mt(i.remove)&&Mt(i.add)&&Mt(i.unsubscribe)}function Ou(i){Mt(i)?i():i.unsubscribe()}var Ec={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},qo={setTimeout:function(i,s){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var a=qo.delegate;return a!=null&&a.setTimeout?a.setTimeout.apply(a,fi([i,s],li(n))):setTimeout.apply(void 0,fi([i,s],li(n)))},clearTimeout:function(i){var s=qo.delegate;return((s==null?void 0:s.clearTimeout)||clearTimeout)(i)},delegate:void 0};function Ev(i){qo.setTimeout(function(){throw i})}function Au(){}function ci(i){i()}var Oc=function(i){er(s,i);function s(n){var o=i.call(this)||this;return o.isStopped=!1,n?(o.destination=n,wc(n)&&n.add(o)):o.destination=Dv,o}return s.create=function(n,o,a){return new Jo(n,o,a)},s.prototype.next=function(n){this.isStopped||this._next(n)},s.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},s.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},s.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,i.prototype.unsubscribe.call(this),this.destination=null)},s.prototype._next=function(n){this.destination.next(n)},s.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},s.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},s}(hi),Ov=Function.prototype.bind;function Mo(i,s){return Ov.call(i,s)}var Av=function(){function i(s){this.partialObserver=s}return i.prototype.next=function(s){var n=this.partialObserver;if(n.next)try{n.next(s)}catch(o){ei(o)}},i.prototype.error=function(s){var n=this.partialObserver;if(n.error)try{n.error(s)}catch(o){ei(o)}else ei(s)},i.prototype.complete=function(){var s=this.partialObserver;if(s.complete)try{s.complete()}catch(n){ei(n)}},i}(),Jo=function(i){er(s,i);function s(n,o,a){var u=i.call(this)||this,p;if(Mt(n)||!n)p={next:n!=null?n:void 0,error:o!=null?o:void 0,complete:a!=null?a:void 0};else{var g;u&&Ec.useDeprecatedNextContext?(g=Object.create(n),g.unsubscribe=function(){return u.unsubscribe()},p={next:n.next&&Mo(n.next,g),error:n.error&&Mo(n.error,g),complete:n.complete&&Mo(n.complete,g)}):p=n}return u.destination=new Av(p),u}return s}(Oc);function ei(i){Ev(i)}function Iv(i){throw i}var Dv={closed:!0,next:Au,error:Iv,complete:Au},Mv=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Lv(i){return i}function kv(i){return i.length===0?Lv:i.length===1?i[0]:function(n){return i.reduce(function(o,a){return a(o)},n)}}var Iu=function(){function i(s){s&&(this._subscribe=s)}return i.prototype.lift=function(s){var n=new i;return n.source=this,n.operator=s,n},i.prototype.subscribe=function(s,n,o){var a=this,u=Fv(s)?s:new Jo(s,n,o);return ci(function(){var p=a,g=p.operator,T=p.source;u.add(g?g.call(u,T):T?a._subscribe(u):a._trySubscribe(u))}),u},i.prototype._trySubscribe=function(s){try{return this._subscribe(s)}catch(n){s.error(n)}},i.prototype.forEach=function(s,n){var o=this;return n=Du(n),new n(function(a,u){var p=new Jo({next:function(g){try{s(g)}catch(T){u(T),p.unsubscribe()}},error:u,complete:a});o.subscribe(p)})},i.prototype._subscribe=function(s){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(s)},i.prototype[Mv]=function(){return this},i.prototype.pipe=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];return kv(s)(this)},i.prototype.toPromise=function(s){var n=this;return s=Du(s),new s(function(o,a){var u;n.subscribe(function(p){return u=p},function(p){return a(p)},function(){return o(u)})})},i.create=function(s){return new i(s)},i}();function Du(i){var s;return(s=i!=null?i:Ec.Promise)!==null&&s!==void 0?s:Promise}function Uv(i){return i&&Mt(i.next)&&Mt(i.error)&&Mt(i.complete)}function Fv(i){return i&&i instanceof Oc||Uv(i)&&wc(i)}var Nv=xc(function(i){return function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),cn=function(i){er(s,i);function s(){var n=i.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return s.prototype.lift=function(n){var o=new Mu(this,this);return o.operator=n,o},s.prototype._throwIfClosed=function(){if(this.closed)throw new Nv},s.prototype.next=function(n){var o=this;ci(function(){var a,u;if(o._throwIfClosed(),!o.isStopped){o.currentObservers||(o.currentObservers=Array.from(o.observers));try{for(var p=Uo(o.currentObservers),g=p.next();!g.done;g=p.next()){var T=g.value;T.next(n)}}catch(l){a={error:l}}finally{try{g&&!g.done&&(u=p.return)&&u.call(p)}finally{if(a)throw a.error}}}})},s.prototype.error=function(n){var o=this;ci(function(){if(o._throwIfClosed(),!o.isStopped){o.hasError=o.isStopped=!0,o.thrownError=n;for(var a=o.observers;a.length;)a.shift().error(n)}})},s.prototype.complete=function(){var n=this;ci(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var o=n.observers;o.length;)o.shift().complete()}})},s.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(s.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),s.prototype._trySubscribe=function(n){return this._throwIfClosed(),i.prototype._trySubscribe.call(this,n)},s.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},s.prototype._innerSubscribe=function(n){var o=this,a=this,u=a.hasError,p=a.isStopped,g=a.observers;return u||p?Pc:(this.currentObservers=null,g.push(n),new hi(function(){o.currentObservers=null,Ho(g,n)}))},s.prototype._checkFinalizedStatuses=function(n){var o=this,a=o.hasError,u=o.thrownError,p=o.isStopped;a?n.error(u):p&&n.complete()},s.prototype.asObservable=function(){var n=new Iu;return n.source=this,n},s.create=function(n,o){return new Mu(n,o)},s}(Iu),Mu=function(i){er(s,i);function s(n,o){var a=i.call(this)||this;return a.destination=n,a.source=o,a}return s.prototype.next=function(n){var o,a;(a=(o=this.destination)===null||o===void 0?void 0:o.next)===null||a===void 0||a.call(o,n)},s.prototype.error=function(n){var o,a;(a=(o=this.destination)===null||o===void 0?void 0:o.error)===null||a===void 0||a.call(o,n)},s.prototype.complete=function(){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||o===void 0||o.call(n)},s.prototype._subscribe=function(n){var o,a;return(a=(o=this.source)===null||o===void 0?void 0:o.subscribe(n))!==null&&a!==void 0?a:Pc},s}(cn),Ct=function(i){er(s,i);function s(n){var o=i.call(this)||this;return o._value=n,o}return Object.defineProperty(s.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),s.prototype._subscribe=function(n){var o=i.prototype._subscribe.call(this,n);return!o.closed&&n.next(this._value),o},s.prototype.getValue=function(){var n=this,o=n.hasError,a=n.thrownError,u=n._value;if(o)throw a;return this._throwIfClosed(),u},s.prototype.next=function(n){i.prototype.next.call(this,this._value=n)},s}(cn),di={exports:{}};/**
|
||
* @license
|
||
* Lodash <https://lodash.com/>
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/di.exports;(function(i,s){(function(){var n,o="4.17.21",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",p="Expected a function",g="Invalid `variable` option passed into `_.template`",T="__lodash_hash_undefined__",l=500,_="__lodash_placeholder__",D=1,H=2,z=4,j=1,ee=2,xe=1,Ye=2,_e=4,$=8,X=16,Oe=32,Ze=64,me=128,mt=256,Zt=512,nr=30,dn="...",gi=800,mi=16,rr=1,ir=2,or=3,at=1/0,ut=9007199254740991,sr=17976931348623157e292,Lt=0/0,Xe=4294967295,pn=Xe-1,ar=Xe>>>1,vi=[["ary",me],["bind",xe],["bindKey",Ye],["curry",$],["curryRight",X],["flip",Zt],["partial",Oe],["partialRight",Ze],["rearg",mt]],kt="[object Arguments]",hn="[object Array]",ur="[object AsyncFunction]",bt="[object Boolean]",Ut="[object Date]",cr="[object DOMException]",ct="[object Error]",Tt="[object Function]",ft="[object GeneratorFunction]",Ne="[object Map]",Ft="[object Number]",fr="[object Null]",qe="[object Object]",lr="[object Promise]",v="[object Proxy]",C="[object RegExp]",b="[object Set]",y="[object String]",O="[object Symbol]",I="[object Undefined]",w="[object WeakMap]",W="[object WeakSet]",F="[object ArrayBuffer]",x="[object DataView]",A="[object Float32Array]",B="[object Float64Array]",re="[object Int8Array]",fe="[object Int16Array]",lt="[object Int32Array]",N="[object Uint8Array]",ne="[object Uint8ClampedArray]",be="[object Uint16Array]",vt="[object Uint32Array]",yi=/\b__p \+= '';/g,Ac=/\b(__p \+=) '' \+/g,Ic=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$o=/&(?:amp|lt|gt|quot|#39);/g,jo=/[&<>"']/g,Dc=RegExp($o.source),Mc=RegExp(jo.source),Lc=/<%-([\s\S]+?)%>/g,kc=/<%([\s\S]+?)%>/g,Ko=/<%=([\s\S]+?)%>/g,Uc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fc=/^\w*$/,Nc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_i=/[\\^$.*+?()[\]{}|]/g,Gc=RegExp(_i.source),Si=/^\s+/,Wc=/\s/,Bc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Hc=/\{\n\/\* \[wrapped with (.+)\] \*/,qc=/,? & /,Jc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zc=/[()=,{}\[\]\/\s]/,Vc=/\\(\\)?/g,$c=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yo=/\w*$/,jc=/^[-+]0x[0-9a-f]+$/i,Kc=/^0b[01]+$/i,Yc=/^\[object .+?Constructor\]$/,Zc=/^0o[0-7]+$/i,Xc=/^(?:0|[1-9]\d*)$/,Qc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dr=/($^)/,ef=/['\n\r\u2028\u2029\\]/g,pr="\\ud800-\\udfff",tf="\\u0300-\\u036f",nf="\\ufe20-\\ufe2f",rf="\\u20d0-\\u20ff",Zo=tf+nf+rf,Xo="\\u2700-\\u27bf",Qo="a-z\\xdf-\\xf6\\xf8-\\xff",of="\\xac\\xb1\\xd7\\xf7",sf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",af="\\u2000-\\u206f",uf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",es="A-Z\\xc0-\\xd6\\xd8-\\xde",ts="\\ufe0e\\ufe0f",ns=of+sf+af+uf,Ci="['’]",cf="["+pr+"]",rs="["+ns+"]",hr="["+Zo+"]",is="\\d+",ff="["+Xo+"]",os="["+Qo+"]",ss="[^"+pr+ns+is+Xo+Qo+es+"]",bi="\\ud83c[\\udffb-\\udfff]",lf="(?:"+hr+"|"+bi+")",as="[^"+pr+"]",Ti="(?:\\ud83c[\\udde6-\\uddff]){2}",Ri="[\\ud800-\\udbff][\\udc00-\\udfff]",gn="["+es+"]",us="\\u200d",cs="(?:"+os+"|"+ss+")",df="(?:"+gn+"|"+ss+")",fs="(?:"+Ci+"(?:d|ll|m|re|s|t|ve))?",ls="(?:"+Ci+"(?:D|LL|M|RE|S|T|VE))?",ds=lf+"?",ps="["+ts+"]?",pf="(?:"+us+"(?:"+[as,Ti,Ri].join("|")+")"+ps+ds+")*",hf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",hs=ps+ds+pf,mf="(?:"+[ff,Ti,Ri].join("|")+")"+hs,vf="(?:"+[as+hr+"?",hr,Ti,Ri,cf].join("|")+")",yf=RegExp(Ci,"g"),_f=RegExp(hr,"g"),xi=RegExp(bi+"(?="+bi+")|"+vf+hs,"g"),Sf=RegExp([gn+"?"+os+"+"+fs+"(?="+[rs,gn,"$"].join("|")+")",df+"+"+ls+"(?="+[rs,gn+cs,"$"].join("|")+")",gn+"?"+cs+"+"+fs,gn+"+"+ls,gf,hf,is,mf].join("|"),"g"),Cf=RegExp("["+us+pr+Zo+ts+"]"),bf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Tf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rf=-1,ve={};ve[A]=ve[B]=ve[re]=ve[fe]=ve[lt]=ve[N]=ve[ne]=ve[be]=ve[vt]=!0,ve[kt]=ve[hn]=ve[F]=ve[bt]=ve[x]=ve[Ut]=ve[ct]=ve[Tt]=ve[Ne]=ve[Ft]=ve[qe]=ve[C]=ve[b]=ve[y]=ve[w]=!1;var ge={};ge[kt]=ge[hn]=ge[F]=ge[x]=ge[bt]=ge[Ut]=ge[A]=ge[B]=ge[re]=ge[fe]=ge[lt]=ge[Ne]=ge[Ft]=ge[qe]=ge[C]=ge[b]=ge[y]=ge[O]=ge[N]=ge[ne]=ge[be]=ge[vt]=!0,ge[ct]=ge[Tt]=ge[w]=!1;var xf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Pf={"&":"&","<":"<",">":">",'"':""","'":"'"},wf={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ef={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Of=parseFloat,Af=parseInt,gs=typeof Kn=="object"&&Kn&&Kn.Object===Object&&Kn,If=typeof self=="object"&&self&&self.Object===Object&&self,Ae=gs||If||Function("return this")(),Pi=s&&!s.nodeType&&s,Xt=Pi&&!0&&i&&!i.nodeType&&i,ms=Xt&&Xt.exports===Pi,wi=ms&&gs.process,Qe=function(){try{var P=Xt&&Xt.require&&Xt.require("util").types;return P||wi&&wi.binding&&wi.binding("util")}catch{}}(),vs=Qe&&Qe.isArrayBuffer,ys=Qe&&Qe.isDate,_s=Qe&&Qe.isMap,Ss=Qe&&Qe.isRegExp,Cs=Qe&&Qe.isSet,bs=Qe&&Qe.isTypedArray;function Je(P,L,M){switch(M.length){case 0:return P.call(L);case 1:return P.call(L,M[0]);case 2:return P.call(L,M[0],M[1]);case 3:return P.call(L,M[0],M[1],M[2])}return P.apply(L,M)}function Df(P,L,M,J){for(var Q=-1,le=P==null?0:P.length;++Q<le;){var Pe=P[Q];L(J,Pe,M(Pe),P)}return J}function et(P,L){for(var M=-1,J=P==null?0:P.length;++M<J&&L(P[M],M,P)!==!1;);return P}function Mf(P,L){for(var M=P==null?0:P.length;M--&&L(P[M],M,P)!==!1;);return P}function Ts(P,L){for(var M=-1,J=P==null?0:P.length;++M<J;)if(!L(P[M],M,P))return!1;return!0}function Nt(P,L){for(var M=-1,J=P==null?0:P.length,Q=0,le=[];++M<J;){var Pe=P[M];L(Pe,M,P)&&(le[Q++]=Pe)}return le}function gr(P,L){var M=P==null?0:P.length;return!!M&&mn(P,L,0)>-1}function Ei(P,L,M){for(var J=-1,Q=P==null?0:P.length;++J<Q;)if(M(L,P[J]))return!0;return!1}function ye(P,L){for(var M=-1,J=P==null?0:P.length,Q=Array(J);++M<J;)Q[M]=L(P[M],M,P);return Q}function Gt(P,L){for(var M=-1,J=L.length,Q=P.length;++M<J;)P[Q+M]=L[M];return P}function Oi(P,L,M,J){var Q=-1,le=P==null?0:P.length;for(J&&le&&(M=P[++Q]);++Q<le;)M=L(M,P[Q],Q,P);return M}function Lf(P,L,M,J){var Q=P==null?0:P.length;for(J&&Q&&(M=P[--Q]);Q--;)M=L(M,P[Q],Q,P);return M}function Ai(P,L){for(var M=-1,J=P==null?0:P.length;++M<J;)if(L(P[M],M,P))return!0;return!1}var kf=Ii("length");function Uf(P){return P.split("")}function Ff(P){return P.match(Jc)||[]}function Rs(P,L,M){var J;return M(P,function(Q,le,Pe){if(L(Q,le,Pe))return J=le,!1}),J}function mr(P,L,M,J){for(var Q=P.length,le=M+(J?1:-1);J?le--:++le<Q;)if(L(P[le],le,P))return le;return-1}function mn(P,L,M){return L===L?Kf(P,L,M):mr(P,xs,M)}function Nf(P,L,M,J){for(var Q=M-1,le=P.length;++Q<le;)if(J(P[Q],L))return Q;return-1}function xs(P){return P!==P}function Ps(P,L){var M=P==null?0:P.length;return M?Mi(P,L)/M:Lt}function Ii(P){return function(L){return L==null?n:L[P]}}function Di(P){return function(L){return P==null?n:P[L]}}function ws(P,L,M,J,Q){return Q(P,function(le,Pe,he){M=J?(J=!1,le):L(M,le,Pe,he)}),M}function Gf(P,L){var M=P.length;for(P.sort(L);M--;)P[M]=P[M].value;return P}function Mi(P,L){for(var M,J=-1,Q=P.length;++J<Q;){var le=L(P[J]);le!==n&&(M=M===n?le:M+le)}return M}function Li(P,L){for(var M=-1,J=Array(P);++M<P;)J[M]=L(M);return J}function Wf(P,L){return ye(L,function(M){return[M,P[M]]})}function Es(P){return P&&P.slice(0,Ds(P)+1).replace(Si,"")}function ze(P){return function(L){return P(L)}}function ki(P,L){return ye(L,function(M){return P[M]})}function Ln(P,L){return P.has(L)}function Os(P,L){for(var M=-1,J=P.length;++M<J&&mn(L,P[M],0)>-1;);return M}function As(P,L){for(var M=P.length;M--&&mn(L,P[M],0)>-1;);return M}function Bf(P,L){for(var M=P.length,J=0;M--;)P[M]===L&&++J;return J}var Hf=Di(xf),qf=Di(Pf);function Jf(P){return"\\"+Ef[P]}function zf(P,L){return P==null?n:P[L]}function vn(P){return Cf.test(P)}function Vf(P){return bf.test(P)}function $f(P){for(var L,M=[];!(L=P.next()).done;)M.push(L.value);return M}function Ui(P){var L=-1,M=Array(P.size);return P.forEach(function(J,Q){M[++L]=[Q,J]}),M}function Is(P,L){return function(M){return P(L(M))}}function Wt(P,L){for(var M=-1,J=P.length,Q=0,le=[];++M<J;){var Pe=P[M];(Pe===L||Pe===_)&&(P[M]=_,le[Q++]=M)}return le}function vr(P){var L=-1,M=Array(P.size);return P.forEach(function(J){M[++L]=J}),M}function jf(P){var L=-1,M=Array(P.size);return P.forEach(function(J){M[++L]=[J,J]}),M}function Kf(P,L,M){for(var J=M-1,Q=P.length;++J<Q;)if(P[J]===L)return J;return-1}function Yf(P,L,M){for(var J=M+1;J--;)if(P[J]===L)return J;return J}function yn(P){return vn(P)?Xf(P):kf(P)}function dt(P){return vn(P)?Qf(P):Uf(P)}function Ds(P){for(var L=P.length;L--&&Wc.test(P.charAt(L)););return L}var Zf=Di(wf);function Xf(P){for(var L=xi.lastIndex=0;xi.test(P);)++L;return L}function Qf(P){return P.match(xi)||[]}function el(P){return P.match(Sf)||[]}var tl=function P(L){L=L==null?Ae:_n.defaults(Ae.Object(),L,_n.pick(Ae,Tf));var M=L.Array,J=L.Date,Q=L.Error,le=L.Function,Pe=L.Math,he=L.Object,Fi=L.RegExp,nl=L.String,tt=L.TypeError,yr=M.prototype,rl=le.prototype,Sn=he.prototype,_r=L["__core-js_shared__"],Sr=rl.toString,pe=Sn.hasOwnProperty,il=0,Ms=function(){var e=/[^.]+$/.exec(_r&&_r.keys&&_r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Cr=Sn.toString,ol=Sr.call(he),sl=Ae._,al=Fi("^"+Sr.call(pe).replace(_i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),br=ms?L.Buffer:n,Bt=L.Symbol,Tr=L.Uint8Array,Ls=br?br.allocUnsafe:n,Rr=Is(he.getPrototypeOf,he),ks=he.create,Us=Sn.propertyIsEnumerable,xr=yr.splice,Fs=Bt?Bt.isConcatSpreadable:n,kn=Bt?Bt.iterator:n,Qt=Bt?Bt.toStringTag:n,Pr=function(){try{var e=on(he,"defineProperty");return e({},"",{}),e}catch{}}(),ul=L.clearTimeout!==Ae.clearTimeout&&L.clearTimeout,cl=J&&J.now!==Ae.Date.now&&J.now,fl=L.setTimeout!==Ae.setTimeout&&L.setTimeout,wr=Pe.ceil,Er=Pe.floor,Ni=he.getOwnPropertySymbols,ll=br?br.isBuffer:n,Ns=L.isFinite,dl=yr.join,pl=Is(he.keys,he),we=Pe.max,De=Pe.min,hl=J.now,gl=L.parseInt,Gs=Pe.random,ml=yr.reverse,Gi=on(L,"DataView"),Un=on(L,"Map"),Wi=on(L,"Promise"),Cn=on(L,"Set"),Fn=on(L,"WeakMap"),Nn=on(he,"create"),Or=Fn&&new Fn,bn={},vl=sn(Gi),yl=sn(Un),_l=sn(Wi),Sl=sn(Cn),Cl=sn(Fn),Ar=Bt?Bt.prototype:n,Gn=Ar?Ar.valueOf:n,Ws=Ar?Ar.toString:n;function h(e){if(Ce(e)&&!te(e)&&!(e instanceof ue)){if(e instanceof nt)return e;if(pe.call(e,"__wrapped__"))return Ba(e)}return new nt(e)}var Tn=function(){function e(){}return function(t){if(!Se(t))return{};if(ks)return ks(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Ir(){}function nt(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}h.templateSettings={escape:Lc,evaluate:kc,interpolate:Ko,variable:"",imports:{_:h}},h.prototype=Ir.prototype,h.prototype.constructor=h,nt.prototype=Tn(Ir.prototype),nt.prototype.constructor=nt;function ue(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Xe,this.__views__=[]}function bl(){var e=new ue(this.__wrapped__);return e.__actions__=Ge(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ge(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ge(this.__views__),e}function Tl(){if(this.__filtered__){var e=new ue(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Rl(){var e=this.__wrapped__.value(),t=this.__dir__,r=te(e),c=t<0,d=r?e.length:0,m=Ud(0,d,this.__views__),S=m.start,R=m.end,E=R-S,k=c?R:S-1,U=this.__iteratees__,G=U.length,q=0,V=De(E,this.__takeCount__);if(!r||!c&&d==E&&V==E)return fa(e,this.__actions__);var Y=[];e:for(;E--&&q<V;){k+=t;for(var oe=-1,Z=e[k];++oe<G;){var ae=U[oe],ce=ae.iteratee,je=ae.type,Ue=ce(Z);if(je==ir)Z=Ue;else if(!Ue){if(je==rr)continue e;break e}}Y[q++]=Z}return Y}ue.prototype=Tn(Ir.prototype),ue.prototype.constructor=ue;function en(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var c=e[t];this.set(c[0],c[1])}}function xl(){this.__data__=Nn?Nn(null):{},this.size=0}function Pl(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function wl(e){var t=this.__data__;if(Nn){var r=t[e];return r===T?n:r}return pe.call(t,e)?t[e]:n}function El(e){var t=this.__data__;return Nn?t[e]!==n:pe.call(t,e)}function Ol(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Nn&&t===n?T:t,this}en.prototype.clear=xl,en.prototype.delete=Pl,en.prototype.get=wl,en.prototype.has=El,en.prototype.set=Ol;function Rt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var c=e[t];this.set(c[0],c[1])}}function Al(){this.__data__=[],this.size=0}function Il(e){var t=this.__data__,r=Dr(t,e);if(r<0)return!1;var c=t.length-1;return r==c?t.pop():xr.call(t,r,1),--this.size,!0}function Dl(e){var t=this.__data__,r=Dr(t,e);return r<0?n:t[r][1]}function Ml(e){return Dr(this.__data__,e)>-1}function Ll(e,t){var r=this.__data__,c=Dr(r,e);return c<0?(++this.size,r.push([e,t])):r[c][1]=t,this}Rt.prototype.clear=Al,Rt.prototype.delete=Il,Rt.prototype.get=Dl,Rt.prototype.has=Ml,Rt.prototype.set=Ll;function xt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var c=e[t];this.set(c[0],c[1])}}function kl(){this.size=0,this.__data__={hash:new en,map:new(Un||Rt),string:new en}}function Ul(e){var t=Jr(this,e).delete(e);return this.size-=t?1:0,t}function Fl(e){return Jr(this,e).get(e)}function Nl(e){return Jr(this,e).has(e)}function Gl(e,t){var r=Jr(this,e),c=r.size;return r.set(e,t),this.size+=r.size==c?0:1,this}xt.prototype.clear=kl,xt.prototype.delete=Ul,xt.prototype.get=Fl,xt.prototype.has=Nl,xt.prototype.set=Gl;function tn(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new xt;++t<r;)this.add(e[t])}function Wl(e){return this.__data__.set(e,T),this}function Bl(e){return this.__data__.has(e)}tn.prototype.add=tn.prototype.push=Wl,tn.prototype.has=Bl;function pt(e){var t=this.__data__=new Rt(e);this.size=t.size}function Hl(){this.__data__=new Rt,this.size=0}function ql(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Jl(e){return this.__data__.get(e)}function zl(e){return this.__data__.has(e)}function Vl(e,t){var r=this.__data__;if(r instanceof Rt){var c=r.__data__;if(!Un||c.length<a-1)return c.push([e,t]),this.size=++r.size,this;r=this.__data__=new xt(c)}return r.set(e,t),this.size=r.size,this}pt.prototype.clear=Hl,pt.prototype.delete=ql,pt.prototype.get=Jl,pt.prototype.has=zl,pt.prototype.set=Vl;function Bs(e,t){var r=te(e),c=!r&&an(e),d=!r&&!c&&Vt(e),m=!r&&!c&&!d&&wn(e),S=r||c||d||m,R=S?Li(e.length,nl):[],E=R.length;for(var k in e)(t||pe.call(e,k))&&!(S&&(k=="length"||d&&(k=="offset"||k=="parent")||m&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||Ot(k,E)))&&R.push(k);return R}function Hs(e){var t=e.length;return t?e[Zi(0,t-1)]:n}function $l(e,t){return zr(Ge(e),nn(t,0,e.length))}function jl(e){return zr(Ge(e))}function Bi(e,t,r){(r!==n&&!ht(e[t],r)||r===n&&!(t in e))&&Pt(e,t,r)}function Wn(e,t,r){var c=e[t];(!(pe.call(e,t)&&ht(c,r))||r===n&&!(t in e))&&Pt(e,t,r)}function Dr(e,t){for(var r=e.length;r--;)if(ht(e[r][0],t))return r;return-1}function Kl(e,t,r,c){return Ht(e,function(d,m,S){t(c,d,r(d),S)}),c}function qs(e,t){return e&&_t(t,Ee(t),e)}function Yl(e,t){return e&&_t(t,Be(t),e)}function Pt(e,t,r){t=="__proto__"&&Pr?Pr(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Hi(e,t){for(var r=-1,c=t.length,d=M(c),m=e==null;++r<c;)d[r]=m?n:To(e,t[r]);return d}function nn(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function rt(e,t,r,c,d,m){var S,R=t&D,E=t&H,k=t&z;if(r&&(S=d?r(e,c,d,m):r(e)),S!==n)return S;if(!Se(e))return e;var U=te(e);if(U){if(S=Nd(e),!R)return Ge(e,S)}else{var G=Me(e),q=G==Tt||G==ft;if(Vt(e))return pa(e,R);if(G==qe||G==kt||q&&!d){if(S=E||q?{}:Da(e),!R)return E?wd(e,Yl(S,e)):Pd(e,qs(S,e))}else{if(!ge[G])return d?e:{};S=Gd(e,G,R)}}m||(m=new pt);var V=m.get(e);if(V)return V;m.set(e,S),au(e)?e.forEach(function(Z){S.add(rt(Z,t,r,Z,e,m))}):ou(e)&&e.forEach(function(Z,ae){S.set(ae,rt(Z,t,r,ae,e,m))});var Y=k?E?uo:ao:E?Be:Ee,oe=U?n:Y(e);return et(oe||e,function(Z,ae){oe&&(ae=Z,Z=e[ae]),Wn(S,ae,rt(Z,t,r,ae,e,m))}),S}function Zl(e){var t=Ee(e);return function(r){return Js(r,e,t)}}function Js(e,t,r){var c=r.length;if(e==null)return!c;for(e=he(e);c--;){var d=r[c],m=t[d],S=e[d];if(S===n&&!(d in e)||!m(S))return!1}return!0}function zs(e,t,r){if(typeof e!="function")throw new tt(p);return $n(function(){e.apply(n,r)},t)}function Bn(e,t,r,c){var d=-1,m=gr,S=!0,R=e.length,E=[],k=t.length;if(!R)return E;r&&(t=ye(t,ze(r))),c?(m=Ei,S=!1):t.length>=a&&(m=Ln,S=!1,t=new tn(t));e:for(;++d<R;){var U=e[d],G=r==null?U:r(U);if(U=c||U!==0?U:0,S&&G===G){for(var q=k;q--;)if(t[q]===G)continue e;E.push(U)}else m(t,G,c)||E.push(U)}return E}var Ht=ya(yt),Vs=ya(Ji,!0);function Xl(e,t){var r=!0;return Ht(e,function(c,d,m){return r=!!t(c,d,m),r}),r}function Mr(e,t,r){for(var c=-1,d=e.length;++c<d;){var m=e[c],S=t(m);if(S!=null&&(R===n?S===S&&!$e(S):r(S,R)))var R=S,E=m}return E}function Ql(e,t,r,c){var d=e.length;for(r=ie(r),r<0&&(r=-r>d?0:d+r),c=c===n||c>d?d:ie(c),c<0&&(c+=d),c=r>c?0:cu(c);r<c;)e[r++]=t;return e}function $s(e,t){var r=[];return Ht(e,function(c,d,m){t(c,d,m)&&r.push(c)}),r}function Ie(e,t,r,c,d){var m=-1,S=e.length;for(r||(r=Bd),d||(d=[]);++m<S;){var R=e[m];t>0&&r(R)?t>1?Ie(R,t-1,r,c,d):Gt(d,R):c||(d[d.length]=R)}return d}var qi=_a(),js=_a(!0);function yt(e,t){return e&&qi(e,t,Ee)}function Ji(e,t){return e&&js(e,t,Ee)}function Lr(e,t){return Nt(t,function(r){return At(e[r])})}function rn(e,t){t=Jt(t,e);for(var r=0,c=t.length;e!=null&&r<c;)e=e[St(t[r++])];return r&&r==c?e:n}function Ks(e,t,r){var c=t(e);return te(e)?c:Gt(c,r(e))}function Le(e){return e==null?e===n?I:fr:Qt&&Qt in he(e)?kd(e):jd(e)}function zi(e,t){return e>t}function ed(e,t){return e!=null&&pe.call(e,t)}function td(e,t){return e!=null&&t in he(e)}function nd(e,t,r){return e>=De(t,r)&&e<we(t,r)}function Vi(e,t,r){for(var c=r?Ei:gr,d=e[0].length,m=e.length,S=m,R=M(m),E=1/0,k=[];S--;){var U=e[S];S&&t&&(U=ye(U,ze(t))),E=De(U.length,E),R[S]=!r&&(t||d>=120&&U.length>=120)?new tn(S&&U):n}U=e[0];var G=-1,q=R[0];e:for(;++G<d&&k.length<E;){var V=U[G],Y=t?t(V):V;if(V=r||V!==0?V:0,!(q?Ln(q,Y):c(k,Y,r))){for(S=m;--S;){var oe=R[S];if(!(oe?Ln(oe,Y):c(e[S],Y,r)))continue e}q&&q.push(Y),k.push(V)}}return k}function rd(e,t,r,c){return yt(e,function(d,m,S){t(c,r(d),m,S)}),c}function Hn(e,t,r){t=Jt(t,e),e=Ua(e,t);var c=e==null?e:e[St(ot(t))];return c==null?n:Je(c,e,r)}function Ys(e){return Ce(e)&&Le(e)==kt}function id(e){return Ce(e)&&Le(e)==F}function od(e){return Ce(e)&&Le(e)==Ut}function qn(e,t,r,c,d){return e===t?!0:e==null||t==null||!Ce(e)&&!Ce(t)?e!==e&&t!==t:sd(e,t,r,c,qn,d)}function sd(e,t,r,c,d,m){var S=te(e),R=te(t),E=S?hn:Me(e),k=R?hn:Me(t);E=E==kt?qe:E,k=k==kt?qe:k;var U=E==qe,G=k==qe,q=E==k;if(q&&Vt(e)){if(!Vt(t))return!1;S=!0,U=!1}if(q&&!U)return m||(m=new pt),S||wn(e)?Oa(e,t,r,c,d,m):Md(e,t,E,r,c,d,m);if(!(r&j)){var V=U&&pe.call(e,"__wrapped__"),Y=G&&pe.call(t,"__wrapped__");if(V||Y){var oe=V?e.value():e,Z=Y?t.value():t;return m||(m=new pt),d(oe,Z,r,c,m)}}return q?(m||(m=new pt),Ld(e,t,r,c,d,m)):!1}function ad(e){return Ce(e)&&Me(e)==Ne}function $i(e,t,r,c){var d=r.length,m=d,S=!c;if(e==null)return!m;for(e=he(e);d--;){var R=r[d];if(S&&R[2]?R[1]!==e[R[0]]:!(R[0]in e))return!1}for(;++d<m;){R=r[d];var E=R[0],k=e[E],U=R[1];if(S&&R[2]){if(k===n&&!(E in e))return!1}else{var G=new pt;if(c)var q=c(k,U,E,e,t,G);if(!(q===n?qn(U,k,j|ee,c,G):q))return!1}}return!0}function Zs(e){if(!Se(e)||qd(e))return!1;var t=At(e)?al:Yc;return t.test(sn(e))}function ud(e){return Ce(e)&&Le(e)==C}function cd(e){return Ce(e)&&Me(e)==b}function fd(e){return Ce(e)&&Zr(e.length)&&!!ve[Le(e)]}function Xs(e){return typeof e=="function"?e:e==null?He:typeof e=="object"?te(e)?ta(e[0],e[1]):ea(e):Su(e)}function ji(e){if(!Vn(e))return pl(e);var t=[];for(var r in he(e))pe.call(e,r)&&r!="constructor"&&t.push(r);return t}function ld(e){if(!Se(e))return $d(e);var t=Vn(e),r=[];for(var c in e)c=="constructor"&&(t||!pe.call(e,c))||r.push(c);return r}function Ki(e,t){return e<t}function Qs(e,t){var r=-1,c=We(e)?M(e.length):[];return Ht(e,function(d,m,S){c[++r]=t(d,m,S)}),c}function ea(e){var t=fo(e);return t.length==1&&t[0][2]?La(t[0][0],t[0][1]):function(r){return r===e||$i(r,e,t)}}function ta(e,t){return po(e)&&Ma(t)?La(St(e),t):function(r){var c=To(r,e);return c===n&&c===t?Ro(r,e):qn(t,c,j|ee)}}function kr(e,t,r,c,d){e!==t&&qi(t,function(m,S){if(d||(d=new pt),Se(m))dd(e,t,S,r,kr,c,d);else{var R=c?c(go(e,S),m,S+"",e,t,d):n;R===n&&(R=m),Bi(e,S,R)}},Be)}function dd(e,t,r,c,d,m,S){var R=go(e,r),E=go(t,r),k=S.get(E);if(k){Bi(e,r,k);return}var U=m?m(R,E,r+"",e,t,S):n,G=U===n;if(G){var q=te(E),V=!q&&Vt(E),Y=!q&&!V&&wn(E);U=E,q||V||Y?te(R)?U=R:Te(R)?U=Ge(R):V?(G=!1,U=pa(E,!0)):Y?(G=!1,U=ha(E,!0)):U=[]:jn(E)||an(E)?(U=R,an(R)?U=fu(R):(!Se(R)||At(R))&&(U=Da(E))):G=!1}G&&(S.set(E,U),d(U,E,c,m,S),S.delete(E)),Bi(e,r,U)}function na(e,t){var r=e.length;if(r)return t+=t<0?r:0,Ot(t,r)?e[t]:n}function ra(e,t,r){t.length?t=ye(t,function(m){return te(m)?function(S){return rn(S,m.length===1?m[0]:m)}:m}):t=[He];var c=-1;t=ye(t,ze(K()));var d=Qs(e,function(m,S,R){var E=ye(t,function(k){return k(m)});return{criteria:E,index:++c,value:m}});return Gf(d,function(m,S){return xd(m,S,r)})}function pd(e,t){return ia(e,t,function(r,c){return Ro(e,c)})}function ia(e,t,r){for(var c=-1,d=t.length,m={};++c<d;){var S=t[c],R=rn(e,S);r(R,S)&&Jn(m,Jt(S,e),R)}return m}function hd(e){return function(t){return rn(t,e)}}function Yi(e,t,r,c){var d=c?Nf:mn,m=-1,S=t.length,R=e;for(e===t&&(t=Ge(t)),r&&(R=ye(e,ze(r)));++m<S;)for(var E=0,k=t[m],U=r?r(k):k;(E=d(R,U,E,c))>-1;)R!==e&&xr.call(R,E,1),xr.call(e,E,1);return e}function oa(e,t){for(var r=e?t.length:0,c=r-1;r--;){var d=t[r];if(r==c||d!==m){var m=d;Ot(d)?xr.call(e,d,1):eo(e,d)}}return e}function Zi(e,t){return e+Er(Gs()*(t-e+1))}function gd(e,t,r,c){for(var d=-1,m=we(wr((t-e)/(r||1)),0),S=M(m);m--;)S[c?m:++d]=e,e+=r;return S}function Xi(e,t){var r="";if(!e||t<1||t>ut)return r;do t%2&&(r+=e),t=Er(t/2),t&&(e+=e);while(t);return r}function se(e,t){return mo(ka(e,t,He),e+"")}function md(e){return Hs(En(e))}function vd(e,t){var r=En(e);return zr(r,nn(t,0,r.length))}function Jn(e,t,r,c){if(!Se(e))return e;t=Jt(t,e);for(var d=-1,m=t.length,S=m-1,R=e;R!=null&&++d<m;){var E=St(t[d]),k=r;if(E==="__proto__"||E==="constructor"||E==="prototype")return e;if(d!=S){var U=R[E];k=c?c(U,E,R):n,k===n&&(k=Se(U)?U:Ot(t[d+1])?[]:{})}Wn(R,E,k),R=R[E]}return e}var sa=Or?function(e,t){return Or.set(e,t),e}:He,yd=Pr?function(e,t){return Pr(e,"toString",{configurable:!0,enumerable:!1,value:Po(t),writable:!0})}:He;function _d(e){return zr(En(e))}function it(e,t,r){var c=-1,d=e.length;t<0&&(t=-t>d?0:d+t),r=r>d?d:r,r<0&&(r+=d),d=t>r?0:r-t>>>0,t>>>=0;for(var m=M(d);++c<d;)m[c]=e[c+t];return m}function Sd(e,t){var r;return Ht(e,function(c,d,m){return r=t(c,d,m),!r}),!!r}function Ur(e,t,r){var c=0,d=e==null?c:e.length;if(typeof t=="number"&&t===t&&d<=ar){for(;c<d;){var m=c+d>>>1,S=e[m];S!==null&&!$e(S)&&(r?S<=t:S<t)?c=m+1:d=m}return d}return Qi(e,t,He,r)}function Qi(e,t,r,c){var d=0,m=e==null?0:e.length;if(m===0)return 0;t=r(t);for(var S=t!==t,R=t===null,E=$e(t),k=t===n;d<m;){var U=Er((d+m)/2),G=r(e[U]),q=G!==n,V=G===null,Y=G===G,oe=$e(G);if(S)var Z=c||Y;else k?Z=Y&&(c||q):R?Z=Y&&q&&(c||!V):E?Z=Y&&q&&!V&&(c||!oe):V||oe?Z=!1:Z=c?G<=t:G<t;Z?d=U+1:m=U}return De(m,pn)}function aa(e,t){for(var r=-1,c=e.length,d=0,m=[];++r<c;){var S=e[r],R=t?t(S):S;if(!r||!ht(R,E)){var E=R;m[d++]=S===0?0:S}}return m}function ua(e){return typeof e=="number"?e:$e(e)?Lt:+e}function Ve(e){if(typeof e=="string")return e;if(te(e))return ye(e,Ve)+"";if($e(e))return Ws?Ws.call(e):"";var t=e+"";return t=="0"&&1/e==-at?"-0":t}function qt(e,t,r){var c=-1,d=gr,m=e.length,S=!0,R=[],E=R;if(r)S=!1,d=Ei;else if(m>=a){var k=t?null:Id(e);if(k)return vr(k);S=!1,d=Ln,E=new tn}else E=t?[]:R;e:for(;++c<m;){var U=e[c],G=t?t(U):U;if(U=r||U!==0?U:0,S&&G===G){for(var q=E.length;q--;)if(E[q]===G)continue e;t&&E.push(G),R.push(U)}else d(E,G,r)||(E!==R&&E.push(G),R.push(U))}return R}function eo(e,t){return t=Jt(t,e),e=Ua(e,t),e==null||delete e[St(ot(t))]}function ca(e,t,r,c){return Jn(e,t,r(rn(e,t)),c)}function Fr(e,t,r,c){for(var d=e.length,m=c?d:-1;(c?m--:++m<d)&&t(e[m],m,e););return r?it(e,c?0:m,c?m+1:d):it(e,c?m+1:0,c?d:m)}function fa(e,t){var r=e;return r instanceof ue&&(r=r.value()),Oi(t,function(c,d){return d.func.apply(d.thisArg,Gt([c],d.args))},r)}function to(e,t,r){var c=e.length;if(c<2)return c?qt(e[0]):[];for(var d=-1,m=M(c);++d<c;)for(var S=e[d],R=-1;++R<c;)R!=d&&(m[d]=Bn(m[d]||S,e[R],t,r));return qt(Ie(m,1),t,r)}function la(e,t,r){for(var c=-1,d=e.length,m=t.length,S={};++c<d;){var R=c<m?t[c]:n;r(S,e[c],R)}return S}function no(e){return Te(e)?e:[]}function ro(e){return typeof e=="function"?e:He}function Jt(e,t){return te(e)?e:po(e,t)?[e]:Wa(de(e))}var Cd=se;function zt(e,t,r){var c=e.length;return r=r===n?c:r,!t&&r>=c?e:it(e,t,r)}var da=ul||function(e){return Ae.clearTimeout(e)};function pa(e,t){if(t)return e.slice();var r=e.length,c=Ls?Ls(r):new e.constructor(r);return e.copy(c),c}function io(e){var t=new e.constructor(e.byteLength);return new Tr(t).set(new Tr(e)),t}function bd(e,t){var r=t?io(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Td(e){var t=new e.constructor(e.source,Yo.exec(e));return t.lastIndex=e.lastIndex,t}function Rd(e){return Gn?he(Gn.call(e)):{}}function ha(e,t){var r=t?io(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ga(e,t){if(e!==t){var r=e!==n,c=e===null,d=e===e,m=$e(e),S=t!==n,R=t===null,E=t===t,k=$e(t);if(!R&&!k&&!m&&e>t||m&&S&&E&&!R&&!k||c&&S&&E||!r&&E||!d)return 1;if(!c&&!m&&!k&&e<t||k&&r&&d&&!c&&!m||R&&r&&d||!S&&d||!E)return-1}return 0}function xd(e,t,r){for(var c=-1,d=e.criteria,m=t.criteria,S=d.length,R=r.length;++c<S;){var E=ga(d[c],m[c]);if(E){if(c>=R)return E;var k=r[c];return E*(k=="desc"?-1:1)}}return e.index-t.index}function ma(e,t,r,c){for(var d=-1,m=e.length,S=r.length,R=-1,E=t.length,k=we(m-S,0),U=M(E+k),G=!c;++R<E;)U[R]=t[R];for(;++d<S;)(G||d<m)&&(U[r[d]]=e[d]);for(;k--;)U[R++]=e[d++];return U}function va(e,t,r,c){for(var d=-1,m=e.length,S=-1,R=r.length,E=-1,k=t.length,U=we(m-R,0),G=M(U+k),q=!c;++d<U;)G[d]=e[d];for(var V=d;++E<k;)G[V+E]=t[E];for(;++S<R;)(q||d<m)&&(G[V+r[S]]=e[d++]);return G}function Ge(e,t){var r=-1,c=e.length;for(t||(t=M(c));++r<c;)t[r]=e[r];return t}function _t(e,t,r,c){var d=!r;r||(r={});for(var m=-1,S=t.length;++m<S;){var R=t[m],E=c?c(r[R],e[R],R,r,e):n;E===n&&(E=e[R]),d?Pt(r,R,E):Wn(r,R,E)}return r}function Pd(e,t){return _t(e,lo(e),t)}function wd(e,t){return _t(e,Aa(e),t)}function Nr(e,t){return function(r,c){var d=te(r)?Df:Kl,m=t?t():{};return d(r,e,K(c,2),m)}}function Rn(e){return se(function(t,r){var c=-1,d=r.length,m=d>1?r[d-1]:n,S=d>2?r[2]:n;for(m=e.length>3&&typeof m=="function"?(d--,m):n,S&&ke(r[0],r[1],S)&&(m=d<3?n:m,d=1),t=he(t);++c<d;){var R=r[c];R&&e(t,R,c,m)}return t})}function ya(e,t){return function(r,c){if(r==null)return r;if(!We(r))return e(r,c);for(var d=r.length,m=t?d:-1,S=he(r);(t?m--:++m<d)&&c(S[m],m,S)!==!1;);return r}}function _a(e){return function(t,r,c){for(var d=-1,m=he(t),S=c(t),R=S.length;R--;){var E=S[e?R:++d];if(r(m[E],E,m)===!1)break}return t}}function Ed(e,t,r){var c=t&xe,d=zn(e);function m(){var S=this&&this!==Ae&&this instanceof m?d:e;return S.apply(c?r:this,arguments)}return m}function Sa(e){return function(t){t=de(t);var r=vn(t)?dt(t):n,c=r?r[0]:t.charAt(0),d=r?zt(r,1).join(""):t.slice(1);return c[e]()+d}}function xn(e){return function(t){return Oi(yu(vu(t).replace(yf,"")),e,"")}}function zn(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Tn(e.prototype),c=e.apply(r,t);return Se(c)?c:r}}function Od(e,t,r){var c=zn(e);function d(){for(var m=arguments.length,S=M(m),R=m,E=Pn(d);R--;)S[R]=arguments[R];var k=m<3&&S[0]!==E&&S[m-1]!==E?[]:Wt(S,E);if(m-=k.length,m<r)return xa(e,t,Gr,d.placeholder,n,S,k,n,n,r-m);var U=this&&this!==Ae&&this instanceof d?c:e;return Je(U,this,S)}return d}function Ca(e){return function(t,r,c){var d=he(t);if(!We(t)){var m=K(r,3);t=Ee(t),r=function(R){return m(d[R],R,d)}}var S=e(t,r,c);return S>-1?d[m?t[S]:S]:n}}function ba(e){return Et(function(t){var r=t.length,c=r,d=nt.prototype.thru;for(e&&t.reverse();c--;){var m=t[c];if(typeof m!="function")throw new tt(p);if(d&&!S&&qr(m)=="wrapper")var S=new nt([],!0)}for(c=S?c:r;++c<r;){m=t[c];var R=qr(m),E=R=="wrapper"?co(m):n;E&&ho(E[0])&&E[1]==(me|$|Oe|mt)&&!E[4].length&&E[9]==1?S=S[qr(E[0])].apply(S,E[3]):S=m.length==1&&ho(m)?S[R]():S.thru(m)}return function(){var k=arguments,U=k[0];if(S&&k.length==1&&te(U))return S.plant(U).value();for(var G=0,q=r?t[G].apply(this,k):U;++G<r;)q=t[G].call(this,q);return q}})}function Gr(e,t,r,c,d,m,S,R,E,k){var U=t&me,G=t&xe,q=t&Ye,V=t&($|X),Y=t&Zt,oe=q?n:zn(e);function Z(){for(var ae=arguments.length,ce=M(ae),je=ae;je--;)ce[je]=arguments[je];if(V)var Ue=Pn(Z),Ke=Bf(ce,Ue);if(c&&(ce=ma(ce,c,d,V)),m&&(ce=va(ce,m,S,V)),ae-=Ke,V&&ae<k){var Re=Wt(ce,Ue);return xa(e,t,Gr,Z.placeholder,r,ce,Re,R,E,k-ae)}var gt=G?r:this,Dt=q?gt[e]:e;return ae=ce.length,R?ce=Kd(ce,R):Y&&ae>1&&ce.reverse(),U&&E<ae&&(ce.length=E),this&&this!==Ae&&this instanceof Z&&(Dt=oe||zn(Dt)),Dt.apply(gt,ce)}return Z}function Ta(e,t){return function(r,c){return rd(r,e,t(c),{})}}function Wr(e,t){return function(r,c){var d;if(r===n&&c===n)return t;if(r!==n&&(d=r),c!==n){if(d===n)return c;typeof r=="string"||typeof c=="string"?(r=Ve(r),c=Ve(c)):(r=ua(r),c=ua(c)),d=e(r,c)}return d}}function oo(e){return Et(function(t){return t=ye(t,ze(K())),se(function(r){var c=this;return e(t,function(d){return Je(d,c,r)})})})}function Br(e,t){t=t===n?" ":Ve(t);var r=t.length;if(r<2)return r?Xi(t,e):t;var c=Xi(t,wr(e/yn(t)));return vn(t)?zt(dt(c),0,e).join(""):c.slice(0,e)}function Ad(e,t,r,c){var d=t&xe,m=zn(e);function S(){for(var R=-1,E=arguments.length,k=-1,U=c.length,G=M(U+E),q=this&&this!==Ae&&this instanceof S?m:e;++k<U;)G[k]=c[k];for(;E--;)G[k++]=arguments[++R];return Je(q,d?r:this,G)}return S}function Ra(e){return function(t,r,c){return c&&typeof c!="number"&&ke(t,r,c)&&(r=c=n),t=It(t),r===n?(r=t,t=0):r=It(r),c=c===n?t<r?1:-1:It(c),gd(t,r,c,e)}}function Hr(e){return function(t,r){return typeof t=="string"&&typeof r=="string"||(t=st(t),r=st(r)),e(t,r)}}function xa(e,t,r,c,d,m,S,R,E,k){var U=t&$,G=U?S:n,q=U?n:S,V=U?m:n,Y=U?n:m;t|=U?Oe:Ze,t&=~(U?Ze:Oe),t&_e||(t&=~(xe|Ye));var oe=[e,t,d,V,G,Y,q,R,E,k],Z=r.apply(n,oe);return ho(e)&&Fa(Z,oe),Z.placeholder=c,Na(Z,e,t)}function so(e){var t=Pe[e];return function(r,c){if(r=st(r),c=c==null?0:De(ie(c),292),c&&Ns(r)){var d=(de(r)+"e").split("e"),m=t(d[0]+"e"+(+d[1]+c));return d=(de(m)+"e").split("e"),+(d[0]+"e"+(+d[1]-c))}return t(r)}}var Id=Cn&&1/vr(new Cn([,-0]))[1]==at?function(e){return new Cn(e)}:Oo;function Pa(e){return function(t){var r=Me(t);return r==Ne?Ui(t):r==b?jf(t):Wf(t,e(t))}}function wt(e,t,r,c,d,m,S,R){var E=t&Ye;if(!E&&typeof e!="function")throw new tt(p);var k=c?c.length:0;if(k||(t&=~(Oe|Ze),c=d=n),S=S===n?S:we(ie(S),0),R=R===n?R:ie(R),k-=d?d.length:0,t&Ze){var U=c,G=d;c=d=n}var q=E?n:co(e),V=[e,t,r,c,d,U,G,m,S,R];if(q&&Vd(V,q),e=V[0],t=V[1],r=V[2],c=V[3],d=V[4],R=V[9]=V[9]===n?E?0:e.length:we(V[9]-k,0),!R&&t&($|X)&&(t&=~($|X)),!t||t==xe)var Y=Ed(e,t,r);else t==$||t==X?Y=Od(e,t,R):(t==Oe||t==(xe|Oe))&&!d.length?Y=Ad(e,t,r,c):Y=Gr.apply(n,V);var oe=q?sa:Fa;return Na(oe(Y,V),e,t)}function wa(e,t,r,c){return e===n||ht(e,Sn[r])&&!pe.call(c,r)?t:e}function Ea(e,t,r,c,d,m){return Se(e)&&Se(t)&&(m.set(t,e),kr(e,t,n,Ea,m),m.delete(t)),e}function Dd(e){return jn(e)?n:e}function Oa(e,t,r,c,d,m){var S=r&j,R=e.length,E=t.length;if(R!=E&&!(S&&E>R))return!1;var k=m.get(e),U=m.get(t);if(k&&U)return k==t&&U==e;var G=-1,q=!0,V=r&ee?new tn:n;for(m.set(e,t),m.set(t,e);++G<R;){var Y=e[G],oe=t[G];if(c)var Z=S?c(oe,Y,G,t,e,m):c(Y,oe,G,e,t,m);if(Z!==n){if(Z)continue;q=!1;break}if(V){if(!Ai(t,function(ae,ce){if(!Ln(V,ce)&&(Y===ae||d(Y,ae,r,c,m)))return V.push(ce)})){q=!1;break}}else if(!(Y===oe||d(Y,oe,r,c,m))){q=!1;break}}return m.delete(e),m.delete(t),q}function Md(e,t,r,c,d,m,S){switch(r){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case F:return!(e.byteLength!=t.byteLength||!m(new Tr(e),new Tr(t)));case bt:case Ut:case Ft:return ht(+e,+t);case ct:return e.name==t.name&&e.message==t.message;case C:case y:return e==t+"";case Ne:var R=Ui;case b:var E=c&j;if(R||(R=vr),e.size!=t.size&&!E)return!1;var k=S.get(e);if(k)return k==t;c|=ee,S.set(e,t);var U=Oa(R(e),R(t),c,d,m,S);return S.delete(e),U;case O:if(Gn)return Gn.call(e)==Gn.call(t)}return!1}function Ld(e,t,r,c,d,m){var S=r&j,R=ao(e),E=R.length,k=ao(t),U=k.length;if(E!=U&&!S)return!1;for(var G=E;G--;){var q=R[G];if(!(S?q in t:pe.call(t,q)))return!1}var V=m.get(e),Y=m.get(t);if(V&&Y)return V==t&&Y==e;var oe=!0;m.set(e,t),m.set(t,e);for(var Z=S;++G<E;){q=R[G];var ae=e[q],ce=t[q];if(c)var je=S?c(ce,ae,q,t,e,m):c(ae,ce,q,e,t,m);if(!(je===n?ae===ce||d(ae,ce,r,c,m):je)){oe=!1;break}Z||(Z=q=="constructor")}if(oe&&!Z){var Ue=e.constructor,Ke=t.constructor;Ue!=Ke&&"constructor"in e&&"constructor"in t&&!(typeof Ue=="function"&&Ue instanceof Ue&&typeof Ke=="function"&&Ke instanceof Ke)&&(oe=!1)}return m.delete(e),m.delete(t),oe}function Et(e){return mo(ka(e,n,Ja),e+"")}function ao(e){return Ks(e,Ee,lo)}function uo(e){return Ks(e,Be,Aa)}var co=Or?function(e){return Or.get(e)}:Oo;function qr(e){for(var t=e.name+"",r=bn[t],c=pe.call(bn,t)?r.length:0;c--;){var d=r[c],m=d.func;if(m==null||m==e)return d.name}return t}function Pn(e){var t=pe.call(h,"placeholder")?h:e;return t.placeholder}function K(){var e=h.iteratee||wo;return e=e===wo?Xs:e,arguments.length?e(arguments[0],arguments[1]):e}function Jr(e,t){var r=e.__data__;return Hd(t)?r[typeof t=="string"?"string":"hash"]:r.map}function fo(e){for(var t=Ee(e),r=t.length;r--;){var c=t[r],d=e[c];t[r]=[c,d,Ma(d)]}return t}function on(e,t){var r=zf(e,t);return Zs(r)?r:n}function kd(e){var t=pe.call(e,Qt),r=e[Qt];try{e[Qt]=n;var c=!0}catch{}var d=Cr.call(e);return c&&(t?e[Qt]=r:delete e[Qt]),d}var lo=Ni?function(e){return e==null?[]:(e=he(e),Nt(Ni(e),function(t){return Us.call(e,t)}))}:Ao,Aa=Ni?function(e){for(var t=[];e;)Gt(t,lo(e)),e=Rr(e);return t}:Ao,Me=Le;(Gi&&Me(new Gi(new ArrayBuffer(1)))!=x||Un&&Me(new Un)!=Ne||Wi&&Me(Wi.resolve())!=lr||Cn&&Me(new Cn)!=b||Fn&&Me(new Fn)!=w)&&(Me=function(e){var t=Le(e),r=t==qe?e.constructor:n,c=r?sn(r):"";if(c)switch(c){case vl:return x;case yl:return Ne;case _l:return lr;case Sl:return b;case Cl:return w}return t});function Ud(e,t,r){for(var c=-1,d=r.length;++c<d;){var m=r[c],S=m.size;switch(m.type){case"drop":e+=S;break;case"dropRight":t-=S;break;case"take":t=De(t,e+S);break;case"takeRight":e=we(e,t-S);break}}return{start:e,end:t}}function Fd(e){var t=e.match(Hc);return t?t[1].split(qc):[]}function Ia(e,t,r){t=Jt(t,e);for(var c=-1,d=t.length,m=!1;++c<d;){var S=St(t[c]);if(!(m=e!=null&&r(e,S)))break;e=e[S]}return m||++c!=d?m:(d=e==null?0:e.length,!!d&&Zr(d)&&Ot(S,d)&&(te(e)||an(e)))}function Nd(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&pe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Da(e){return typeof e.constructor=="function"&&!Vn(e)?Tn(Rr(e)):{}}function Gd(e,t,r){var c=e.constructor;switch(t){case F:return io(e);case bt:case Ut:return new c(+e);case x:return bd(e,r);case A:case B:case re:case fe:case lt:case N:case ne:case be:case vt:return ha(e,r);case Ne:return new c;case Ft:case y:return new c(e);case C:return Td(e);case b:return new c;case O:return Rd(e)}}function Wd(e,t){var r=t.length;if(!r)return e;var c=r-1;return t[c]=(r>1?"& ":"")+t[c],t=t.join(r>2?", ":" "),e.replace(Bc,"{\n/* [wrapped with "+t+"] */\n")}function Bd(e){return te(e)||an(e)||!!(Fs&&e&&e[Fs])}function Ot(e,t){var r=typeof e;return t=t==null?ut:t,!!t&&(r=="number"||r!="symbol"&&Xc.test(e))&&e>-1&&e%1==0&&e<t}function ke(e,t,r){if(!Se(r))return!1;var c=typeof t;return(c=="number"?We(r)&&Ot(t,r.length):c=="string"&&t in r)?ht(r[t],e):!1}function po(e,t){if(te(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||$e(e)?!0:Fc.test(e)||!Uc.test(e)||t!=null&&e in he(t)}function Hd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ho(e){var t=qr(e),r=h[t];if(typeof r!="function"||!(t in ue.prototype))return!1;if(e===r)return!0;var c=co(r);return!!c&&e===c[0]}function qd(e){return!!Ms&&Ms in e}var Jd=_r?At:Io;function Vn(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Sn;return e===r}function Ma(e){return e===e&&!Se(e)}function La(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==n||e in he(r))}}function zd(e){var t=Kr(e,function(c){return r.size===l&&r.clear(),c}),r=t.cache;return t}function Vd(e,t){var r=e[1],c=t[1],d=r|c,m=d<(xe|Ye|me),S=c==me&&r==$||c==me&&r==mt&&e[7].length<=t[8]||c==(me|mt)&&t[7].length<=t[8]&&r==$;if(!(m||S))return e;c&xe&&(e[2]=t[2],d|=r&xe?0:_e);var R=t[3];if(R){var E=e[3];e[3]=E?ma(E,R,t[4]):R,e[4]=E?Wt(e[3],_):t[4]}return R=t[5],R&&(E=e[5],e[5]=E?va(E,R,t[6]):R,e[6]=E?Wt(e[5],_):t[6]),R=t[7],R&&(e[7]=R),c&me&&(e[8]=e[8]==null?t[8]:De(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=d,e}function $d(e){var t=[];if(e!=null)for(var r in he(e))t.push(r);return t}function jd(e){return Cr.call(e)}function ka(e,t,r){return t=we(t===n?e.length-1:t,0),function(){for(var c=arguments,d=-1,m=we(c.length-t,0),S=M(m);++d<m;)S[d]=c[t+d];d=-1;for(var R=M(t+1);++d<t;)R[d]=c[d];return R[t]=r(S),Je(e,this,R)}}function Ua(e,t){return t.length<2?e:rn(e,it(t,0,-1))}function Kd(e,t){for(var r=e.length,c=De(t.length,r),d=Ge(e);c--;){var m=t[c];e[c]=Ot(m,r)?d[m]:n}return e}function go(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Fa=Ga(sa),$n=fl||function(e,t){return Ae.setTimeout(e,t)},mo=Ga(yd);function Na(e,t,r){var c=t+"";return mo(e,Wd(c,Yd(Fd(c),r)))}function Ga(e){var t=0,r=0;return function(){var c=hl(),d=mi-(c-r);if(r=c,d>0){if(++t>=gi)return arguments[0]}else t=0;return e.apply(n,arguments)}}function zr(e,t){var r=-1,c=e.length,d=c-1;for(t=t===n?c:t;++r<t;){var m=Zi(r,d),S=e[m];e[m]=e[r],e[r]=S}return e.length=t,e}var Wa=zd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Nc,function(r,c,d,m){t.push(d?m.replace(Vc,"$1"):c||r)}),t});function St(e){if(typeof e=="string"||$e(e))return e;var t=e+"";return t=="0"&&1/e==-at?"-0":t}function sn(e){if(e!=null){try{return Sr.call(e)}catch{}try{return e+""}catch{}}return""}function Yd(e,t){return et(vi,function(r){var c="_."+r[0];t&r[1]&&!gr(e,c)&&e.push(c)}),e.sort()}function Ba(e){if(e instanceof ue)return e.clone();var t=new nt(e.__wrapped__,e.__chain__);return t.__actions__=Ge(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Zd(e,t,r){(r?ke(e,t,r):t===n)?t=1:t=we(ie(t),0);var c=e==null?0:e.length;if(!c||t<1)return[];for(var d=0,m=0,S=M(wr(c/t));d<c;)S[m++]=it(e,d,d+=t);return S}function Xd(e){for(var t=-1,r=e==null?0:e.length,c=0,d=[];++t<r;){var m=e[t];m&&(d[c++]=m)}return d}function Qd(){var e=arguments.length;if(!e)return[];for(var t=M(e-1),r=arguments[0],c=e;c--;)t[c-1]=arguments[c];return Gt(te(r)?Ge(r):[r],Ie(t,1))}var ep=se(function(e,t){return Te(e)?Bn(e,Ie(t,1,Te,!0)):[]}),tp=se(function(e,t){var r=ot(t);return Te(r)&&(r=n),Te(e)?Bn(e,Ie(t,1,Te,!0),K(r,2)):[]}),np=se(function(e,t){var r=ot(t);return Te(r)&&(r=n),Te(e)?Bn(e,Ie(t,1,Te,!0),n,r):[]});function rp(e,t,r){var c=e==null?0:e.length;return c?(t=r||t===n?1:ie(t),it(e,t<0?0:t,c)):[]}function ip(e,t,r){var c=e==null?0:e.length;return c?(t=r||t===n?1:ie(t),t=c-t,it(e,0,t<0?0:t)):[]}function op(e,t){return e&&e.length?Fr(e,K(t,3),!0,!0):[]}function sp(e,t){return e&&e.length?Fr(e,K(t,3),!0):[]}function ap(e,t,r,c){var d=e==null?0:e.length;return d?(r&&typeof r!="number"&&ke(e,t,r)&&(r=0,c=d),Ql(e,t,r,c)):[]}function Ha(e,t,r){var c=e==null?0:e.length;if(!c)return-1;var d=r==null?0:ie(r);return d<0&&(d=we(c+d,0)),mr(e,K(t,3),d)}function qa(e,t,r){var c=e==null?0:e.length;if(!c)return-1;var d=c-1;return r!==n&&(d=ie(r),d=r<0?we(c+d,0):De(d,c-1)),mr(e,K(t,3),d,!0)}function Ja(e){var t=e==null?0:e.length;return t?Ie(e,1):[]}function up(e){var t=e==null?0:e.length;return t?Ie(e,at):[]}function cp(e,t){var r=e==null?0:e.length;return r?(t=t===n?1:ie(t),Ie(e,t)):[]}function fp(e){for(var t=-1,r=e==null?0:e.length,c={};++t<r;){var d=e[t];c[d[0]]=d[1]}return c}function za(e){return e&&e.length?e[0]:n}function lp(e,t,r){var c=e==null?0:e.length;if(!c)return-1;var d=r==null?0:ie(r);return d<0&&(d=we(c+d,0)),mn(e,t,d)}function dp(e){var t=e==null?0:e.length;return t?it(e,0,-1):[]}var pp=se(function(e){var t=ye(e,no);return t.length&&t[0]===e[0]?Vi(t):[]}),hp=se(function(e){var t=ot(e),r=ye(e,no);return t===ot(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Vi(r,K(t,2)):[]}),gp=se(function(e){var t=ot(e),r=ye(e,no);return t=typeof t=="function"?t:n,t&&r.pop(),r.length&&r[0]===e[0]?Vi(r,n,t):[]});function mp(e,t){return e==null?"":dl.call(e,t)}function ot(e){var t=e==null?0:e.length;return t?e[t-1]:n}function vp(e,t,r){var c=e==null?0:e.length;if(!c)return-1;var d=c;return r!==n&&(d=ie(r),d=d<0?we(c+d,0):De(d,c-1)),t===t?Yf(e,t,d):mr(e,xs,d,!0)}function yp(e,t){return e&&e.length?na(e,ie(t)):n}var _p=se(Va);function Va(e,t){return e&&e.length&&t&&t.length?Yi(e,t):e}function Sp(e,t,r){return e&&e.length&&t&&t.length?Yi(e,t,K(r,2)):e}function Cp(e,t,r){return e&&e.length&&t&&t.length?Yi(e,t,n,r):e}var bp=Et(function(e,t){var r=e==null?0:e.length,c=Hi(e,t);return oa(e,ye(t,function(d){return Ot(d,r)?+d:d}).sort(ga)),c});function Tp(e,t){var r=[];if(!(e&&e.length))return r;var c=-1,d=[],m=e.length;for(t=K(t,3);++c<m;){var S=e[c];t(S,c,e)&&(r.push(S),d.push(c))}return oa(e,d),r}function vo(e){return e==null?e:ml.call(e)}function Rp(e,t,r){var c=e==null?0:e.length;return c?(r&&typeof r!="number"&&ke(e,t,r)?(t=0,r=c):(t=t==null?0:ie(t),r=r===n?c:ie(r)),it(e,t,r)):[]}function xp(e,t){return Ur(e,t)}function Pp(e,t,r){return Qi(e,t,K(r,2))}function wp(e,t){var r=e==null?0:e.length;if(r){var c=Ur(e,t);if(c<r&&ht(e[c],t))return c}return-1}function Ep(e,t){return Ur(e,t,!0)}function Op(e,t,r){return Qi(e,t,K(r,2),!0)}function Ap(e,t){var r=e==null?0:e.length;if(r){var c=Ur(e,t,!0)-1;if(ht(e[c],t))return c}return-1}function Ip(e){return e&&e.length?aa(e):[]}function Dp(e,t){return e&&e.length?aa(e,K(t,2)):[]}function Mp(e){var t=e==null?0:e.length;return t?it(e,1,t):[]}function Lp(e,t,r){return e&&e.length?(t=r||t===n?1:ie(t),it(e,0,t<0?0:t)):[]}function kp(e,t,r){var c=e==null?0:e.length;return c?(t=r||t===n?1:ie(t),t=c-t,it(e,t<0?0:t,c)):[]}function Up(e,t){return e&&e.length?Fr(e,K(t,3),!1,!0):[]}function Fp(e,t){return e&&e.length?Fr(e,K(t,3)):[]}var Np=se(function(e){return qt(Ie(e,1,Te,!0))}),Gp=se(function(e){var t=ot(e);return Te(t)&&(t=n),qt(Ie(e,1,Te,!0),K(t,2))}),Wp=se(function(e){var t=ot(e);return t=typeof t=="function"?t:n,qt(Ie(e,1,Te,!0),n,t)});function Bp(e){return e&&e.length?qt(e):[]}function Hp(e,t){return e&&e.length?qt(e,K(t,2)):[]}function qp(e,t){return t=typeof t=="function"?t:n,e&&e.length?qt(e,n,t):[]}function yo(e){if(!(e&&e.length))return[];var t=0;return e=Nt(e,function(r){if(Te(r))return t=we(r.length,t),!0}),Li(t,function(r){return ye(e,Ii(r))})}function $a(e,t){if(!(e&&e.length))return[];var r=yo(e);return t==null?r:ye(r,function(c){return Je(t,n,c)})}var Jp=se(function(e,t){return Te(e)?Bn(e,t):[]}),zp=se(function(e){return to(Nt(e,Te))}),Vp=se(function(e){var t=ot(e);return Te(t)&&(t=n),to(Nt(e,Te),K(t,2))}),$p=se(function(e){var t=ot(e);return t=typeof t=="function"?t:n,to(Nt(e,Te),n,t)}),jp=se(yo);function Kp(e,t){return la(e||[],t||[],Wn)}function Yp(e,t){return la(e||[],t||[],Jn)}var Zp=se(function(e){var t=e.length,r=t>1?e[t-1]:n;return r=typeof r=="function"?(e.pop(),r):n,$a(e,r)});function ja(e){var t=h(e);return t.__chain__=!0,t}function Xp(e,t){return t(e),e}function Vr(e,t){return t(e)}var Qp=Et(function(e){var t=e.length,r=t?e[0]:0,c=this.__wrapped__,d=function(m){return Hi(m,e)};return t>1||this.__actions__.length||!(c instanceof ue)||!Ot(r)?this.thru(d):(c=c.slice(r,+r+(t?1:0)),c.__actions__.push({func:Vr,args:[d],thisArg:n}),new nt(c,this.__chain__).thru(function(m){return t&&!m.length&&m.push(n),m}))});function eh(){return ja(this)}function th(){return new nt(this.value(),this.__chain__)}function nh(){this.__values__===n&&(this.__values__=uu(this.value()));var e=this.__index__>=this.__values__.length,t=e?n:this.__values__[this.__index__++];return{done:e,value:t}}function rh(){return this}function ih(e){for(var t,r=this;r instanceof Ir;){var c=Ba(r);c.__index__=0,c.__values__=n,t?d.__wrapped__=c:t=c;var d=c;r=r.__wrapped__}return d.__wrapped__=e,t}function oh(){var e=this.__wrapped__;if(e instanceof ue){var t=e;return this.__actions__.length&&(t=new ue(this)),t=t.reverse(),t.__actions__.push({func:Vr,args:[vo],thisArg:n}),new nt(t,this.__chain__)}return this.thru(vo)}function sh(){return fa(this.__wrapped__,this.__actions__)}var ah=Nr(function(e,t,r){pe.call(e,r)?++e[r]:Pt(e,r,1)});function uh(e,t,r){var c=te(e)?Ts:Xl;return r&&ke(e,t,r)&&(t=n),c(e,K(t,3))}function ch(e,t){var r=te(e)?Nt:$s;return r(e,K(t,3))}var fh=Ca(Ha),lh=Ca(qa);function dh(e,t){return Ie($r(e,t),1)}function ph(e,t){return Ie($r(e,t),at)}function hh(e,t,r){return r=r===n?1:ie(r),Ie($r(e,t),r)}function Ka(e,t){var r=te(e)?et:Ht;return r(e,K(t,3))}function Ya(e,t){var r=te(e)?Mf:Vs;return r(e,K(t,3))}var gh=Nr(function(e,t,r){pe.call(e,r)?e[r].push(t):Pt(e,r,[t])});function mh(e,t,r,c){e=We(e)?e:En(e),r=r&&!c?ie(r):0;var d=e.length;return r<0&&(r=we(d+r,0)),Xr(e)?r<=d&&e.indexOf(t,r)>-1:!!d&&mn(e,t,r)>-1}var vh=se(function(e,t,r){var c=-1,d=typeof t=="function",m=We(e)?M(e.length):[];return Ht(e,function(S){m[++c]=d?Je(t,S,r):Hn(S,t,r)}),m}),yh=Nr(function(e,t,r){Pt(e,r,t)});function $r(e,t){var r=te(e)?ye:Qs;return r(e,K(t,3))}function _h(e,t,r,c){return e==null?[]:(te(t)||(t=t==null?[]:[t]),r=c?n:r,te(r)||(r=r==null?[]:[r]),ra(e,t,r))}var Sh=Nr(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]});function Ch(e,t,r){var c=te(e)?Oi:ws,d=arguments.length<3;return c(e,K(t,4),r,d,Ht)}function bh(e,t,r){var c=te(e)?Lf:ws,d=arguments.length<3;return c(e,K(t,4),r,d,Vs)}function Th(e,t){var r=te(e)?Nt:$s;return r(e,Yr(K(t,3)))}function Rh(e){var t=te(e)?Hs:md;return t(e)}function xh(e,t,r){(r?ke(e,t,r):t===n)?t=1:t=ie(t);var c=te(e)?$l:vd;return c(e,t)}function Ph(e){var t=te(e)?jl:_d;return t(e)}function wh(e){if(e==null)return 0;if(We(e))return Xr(e)?yn(e):e.length;var t=Me(e);return t==Ne||t==b?e.size:ji(e).length}function Eh(e,t,r){var c=te(e)?Ai:Sd;return r&&ke(e,t,r)&&(t=n),c(e,K(t,3))}var Oh=se(function(e,t){if(e==null)return[];var r=t.length;return r>1&&ke(e,t[0],t[1])?t=[]:r>2&&ke(t[0],t[1],t[2])&&(t=[t[0]]),ra(e,Ie(t,1),[])}),jr=cl||function(){return Ae.Date.now()};function Ah(e,t){if(typeof t!="function")throw new tt(p);return e=ie(e),function(){if(--e<1)return t.apply(this,arguments)}}function Za(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,wt(e,me,n,n,n,n,t)}function Xa(e,t){var r;if(typeof t!="function")throw new tt(p);return e=ie(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var _o=se(function(e,t,r){var c=xe;if(r.length){var d=Wt(r,Pn(_o));c|=Oe}return wt(e,c,t,r,d)}),Qa=se(function(e,t,r){var c=xe|Ye;if(r.length){var d=Wt(r,Pn(Qa));c|=Oe}return wt(t,c,e,r,d)});function eu(e,t,r){t=r?n:t;var c=wt(e,$,n,n,n,n,n,t);return c.placeholder=eu.placeholder,c}function tu(e,t,r){t=r?n:t;var c=wt(e,X,n,n,n,n,n,t);return c.placeholder=tu.placeholder,c}function nu(e,t,r){var c,d,m,S,R,E,k=0,U=!1,G=!1,q=!0;if(typeof e!="function")throw new tt(p);t=st(t)||0,Se(r)&&(U=!!r.leading,G="maxWait"in r,m=G?we(st(r.maxWait)||0,t):m,q="trailing"in r?!!r.trailing:q);function V(Re){var gt=c,Dt=d;return c=d=n,k=Re,S=e.apply(Dt,gt),S}function Y(Re){return k=Re,R=$n(ae,t),U?V(Re):S}function oe(Re){var gt=Re-E,Dt=Re-k,Cu=t-gt;return G?De(Cu,m-Dt):Cu}function Z(Re){var gt=Re-E,Dt=Re-k;return E===n||gt>=t||gt<0||G&&Dt>=m}function ae(){var Re=jr();if(Z(Re))return ce(Re);R=$n(ae,oe(Re))}function ce(Re){return R=n,q&&c?V(Re):(c=d=n,S)}function je(){R!==n&&da(R),k=0,c=E=d=R=n}function Ue(){return R===n?S:ce(jr())}function Ke(){var Re=jr(),gt=Z(Re);if(c=arguments,d=this,E=Re,gt){if(R===n)return Y(E);if(G)return da(R),R=$n(ae,t),V(E)}return R===n&&(R=$n(ae,t)),S}return Ke.cancel=je,Ke.flush=Ue,Ke}var Ih=se(function(e,t){return zs(e,1,t)}),Dh=se(function(e,t,r){return zs(e,st(t)||0,r)});function Mh(e){return wt(e,Zt)}function Kr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new tt(p);var r=function(){var c=arguments,d=t?t.apply(this,c):c[0],m=r.cache;if(m.has(d))return m.get(d);var S=e.apply(this,c);return r.cache=m.set(d,S)||m,S};return r.cache=new(Kr.Cache||xt),r}Kr.Cache=xt;function Yr(e){if(typeof e!="function")throw new tt(p);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Lh(e){return Xa(2,e)}var kh=Cd(function(e,t){t=t.length==1&&te(t[0])?ye(t[0],ze(K())):ye(Ie(t,1),ze(K()));var r=t.length;return se(function(c){for(var d=-1,m=De(c.length,r);++d<m;)c[d]=t[d].call(this,c[d]);return Je(e,this,c)})}),So=se(function(e,t){var r=Wt(t,Pn(So));return wt(e,Oe,n,t,r)}),ru=se(function(e,t){var r=Wt(t,Pn(ru));return wt(e,Ze,n,t,r)}),Uh=Et(function(e,t){return wt(e,mt,n,n,n,t)});function Fh(e,t){if(typeof e!="function")throw new tt(p);return t=t===n?t:ie(t),se(e,t)}function Nh(e,t){if(typeof e!="function")throw new tt(p);return t=t==null?0:we(ie(t),0),se(function(r){var c=r[t],d=zt(r,0,t);return c&&Gt(d,c),Je(e,this,d)})}function Gh(e,t,r){var c=!0,d=!0;if(typeof e!="function")throw new tt(p);return Se(r)&&(c="leading"in r?!!r.leading:c,d="trailing"in r?!!r.trailing:d),nu(e,t,{leading:c,maxWait:t,trailing:d})}function Wh(e){return Za(e,1)}function Bh(e,t){return So(ro(t),e)}function Hh(){if(!arguments.length)return[];var e=arguments[0];return te(e)?e:[e]}function qh(e){return rt(e,z)}function Jh(e,t){return t=typeof t=="function"?t:n,rt(e,z,t)}function zh(e){return rt(e,D|z)}function Vh(e,t){return t=typeof t=="function"?t:n,rt(e,D|z,t)}function $h(e,t){return t==null||Js(e,t,Ee(t))}function ht(e,t){return e===t||e!==e&&t!==t}var jh=Hr(zi),Kh=Hr(function(e,t){return e>=t}),an=Ys(function(){return arguments}())?Ys:function(e){return Ce(e)&&pe.call(e,"callee")&&!Us.call(e,"callee")},te=M.isArray,Yh=vs?ze(vs):id;function We(e){return e!=null&&Zr(e.length)&&!At(e)}function Te(e){return Ce(e)&&We(e)}function Zh(e){return e===!0||e===!1||Ce(e)&&Le(e)==bt}var Vt=ll||Io,Xh=ys?ze(ys):od;function Qh(e){return Ce(e)&&e.nodeType===1&&!jn(e)}function eg(e){if(e==null)return!0;if(We(e)&&(te(e)||typeof e=="string"||typeof e.splice=="function"||Vt(e)||wn(e)||an(e)))return!e.length;var t=Me(e);if(t==Ne||t==b)return!e.size;if(Vn(e))return!ji(e).length;for(var r in e)if(pe.call(e,r))return!1;return!0}function tg(e,t){return qn(e,t)}function ng(e,t,r){r=typeof r=="function"?r:n;var c=r?r(e,t):n;return c===n?qn(e,t,n,r):!!c}function Co(e){if(!Ce(e))return!1;var t=Le(e);return t==ct||t==cr||typeof e.message=="string"&&typeof e.name=="string"&&!jn(e)}function rg(e){return typeof e=="number"&&Ns(e)}function At(e){if(!Se(e))return!1;var t=Le(e);return t==Tt||t==ft||t==ur||t==v}function iu(e){return typeof e=="number"&&e==ie(e)}function Zr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ut}function Se(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ce(e){return e!=null&&typeof e=="object"}var ou=_s?ze(_s):ad;function ig(e,t){return e===t||$i(e,t,fo(t))}function og(e,t,r){return r=typeof r=="function"?r:n,$i(e,t,fo(t),r)}function sg(e){return su(e)&&e!=+e}function ag(e){if(Jd(e))throw new Q(u);return Zs(e)}function ug(e){return e===null}function cg(e){return e==null}function su(e){return typeof e=="number"||Ce(e)&&Le(e)==Ft}function jn(e){if(!Ce(e)||Le(e)!=qe)return!1;var t=Rr(e);if(t===null)return!0;var r=pe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Sr.call(r)==ol}var bo=Ss?ze(Ss):ud;function fg(e){return iu(e)&&e>=-ut&&e<=ut}var au=Cs?ze(Cs):cd;function Xr(e){return typeof e=="string"||!te(e)&&Ce(e)&&Le(e)==y}function $e(e){return typeof e=="symbol"||Ce(e)&&Le(e)==O}var wn=bs?ze(bs):fd;function lg(e){return e===n}function dg(e){return Ce(e)&&Me(e)==w}function pg(e){return Ce(e)&&Le(e)==W}var hg=Hr(Ki),gg=Hr(function(e,t){return e<=t});function uu(e){if(!e)return[];if(We(e))return Xr(e)?dt(e):Ge(e);if(kn&&e[kn])return $f(e[kn]());var t=Me(e),r=t==Ne?Ui:t==b?vr:En;return r(e)}function It(e){if(!e)return e===0?e:0;if(e=st(e),e===at||e===-at){var t=e<0?-1:1;return t*sr}return e===e?e:0}function ie(e){var t=It(e),r=t%1;return t===t?r?t-r:t:0}function cu(e){return e?nn(ie(e),0,Xe):0}function st(e){if(typeof e=="number")return e;if($e(e))return Lt;if(Se(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Se(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Es(e);var r=Kc.test(e);return r||Zc.test(e)?Af(e.slice(2),r?2:8):jc.test(e)?Lt:+e}function fu(e){return _t(e,Be(e))}function mg(e){return e?nn(ie(e),-ut,ut):e===0?e:0}function de(e){return e==null?"":Ve(e)}var vg=Rn(function(e,t){if(Vn(t)||We(t)){_t(t,Ee(t),e);return}for(var r in t)pe.call(t,r)&&Wn(e,r,t[r])}),lu=Rn(function(e,t){_t(t,Be(t),e)}),Qr=Rn(function(e,t,r,c){_t(t,Be(t),e,c)}),yg=Rn(function(e,t,r,c){_t(t,Ee(t),e,c)}),_g=Et(Hi);function Sg(e,t){var r=Tn(e);return t==null?r:qs(r,t)}var Cg=se(function(e,t){e=he(e);var r=-1,c=t.length,d=c>2?t[2]:n;for(d&&ke(t[0],t[1],d)&&(c=1);++r<c;)for(var m=t[r],S=Be(m),R=-1,E=S.length;++R<E;){var k=S[R],U=e[k];(U===n||ht(U,Sn[k])&&!pe.call(e,k))&&(e[k]=m[k])}return e}),bg=se(function(e){return e.push(n,Ea),Je(du,n,e)});function Tg(e,t){return Rs(e,K(t,3),yt)}function Rg(e,t){return Rs(e,K(t,3),Ji)}function xg(e,t){return e==null?e:qi(e,K(t,3),Be)}function Pg(e,t){return e==null?e:js(e,K(t,3),Be)}function wg(e,t){return e&&yt(e,K(t,3))}function Eg(e,t){return e&&Ji(e,K(t,3))}function Og(e){return e==null?[]:Lr(e,Ee(e))}function Ag(e){return e==null?[]:Lr(e,Be(e))}function To(e,t,r){var c=e==null?n:rn(e,t);return c===n?r:c}function Ig(e,t){return e!=null&&Ia(e,t,ed)}function Ro(e,t){return e!=null&&Ia(e,t,td)}var Dg=Ta(function(e,t,r){t!=null&&typeof t.toString!="function"&&(t=Cr.call(t)),e[t]=r},Po(He)),Mg=Ta(function(e,t,r){t!=null&&typeof t.toString!="function"&&(t=Cr.call(t)),pe.call(e,t)?e[t].push(r):e[t]=[r]},K),Lg=se(Hn);function Ee(e){return We(e)?Bs(e):ji(e)}function Be(e){return We(e)?Bs(e,!0):ld(e)}function kg(e,t){var r={};return t=K(t,3),yt(e,function(c,d,m){Pt(r,t(c,d,m),c)}),r}function Ug(e,t){var r={};return t=K(t,3),yt(e,function(c,d,m){Pt(r,d,t(c,d,m))}),r}var Fg=Rn(function(e,t,r){kr(e,t,r)}),du=Rn(function(e,t,r,c){kr(e,t,r,c)}),Ng=Et(function(e,t){var r={};if(e==null)return r;var c=!1;t=ye(t,function(m){return m=Jt(m,e),c||(c=m.length>1),m}),_t(e,uo(e),r),c&&(r=rt(r,D|H|z,Dd));for(var d=t.length;d--;)eo(r,t[d]);return r});function Gg(e,t){return pu(e,Yr(K(t)))}var Wg=Et(function(e,t){return e==null?{}:pd(e,t)});function pu(e,t){if(e==null)return{};var r=ye(uo(e),function(c){return[c]});return t=K(t),ia(e,r,function(c,d){return t(c,d[0])})}function Bg(e,t,r){t=Jt(t,e);var c=-1,d=t.length;for(d||(d=1,e=n);++c<d;){var m=e==null?n:e[St(t[c])];m===n&&(c=d,m=r),e=At(m)?m.call(e):m}return e}function Hg(e,t,r){return e==null?e:Jn(e,t,r)}function qg(e,t,r,c){return c=typeof c=="function"?c:n,e==null?e:Jn(e,t,r,c)}var hu=Pa(Ee),gu=Pa(Be);function Jg(e,t,r){var c=te(e),d=c||Vt(e)||wn(e);if(t=K(t,4),r==null){var m=e&&e.constructor;d?r=c?new m:[]:Se(e)?r=At(m)?Tn(Rr(e)):{}:r={}}return(d?et:yt)(e,function(S,R,E){return t(r,S,R,E)}),r}function zg(e,t){return e==null?!0:eo(e,t)}function Vg(e,t,r){return e==null?e:ca(e,t,ro(r))}function $g(e,t,r,c){return c=typeof c=="function"?c:n,e==null?e:ca(e,t,ro(r),c)}function En(e){return e==null?[]:ki(e,Ee(e))}function jg(e){return e==null?[]:ki(e,Be(e))}function Kg(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=st(r),r=r===r?r:0),t!==n&&(t=st(t),t=t===t?t:0),nn(st(e),t,r)}function Yg(e,t,r){return t=It(t),r===n?(r=t,t=0):r=It(r),e=st(e),nd(e,t,r)}function Zg(e,t,r){if(r&&typeof r!="boolean"&&ke(e,t,r)&&(t=r=n),r===n&&(typeof t=="boolean"?(r=t,t=n):typeof e=="boolean"&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=It(e),t===n?(t=e,e=0):t=It(t)),e>t){var c=e;e=t,t=c}if(r||e%1||t%1){var d=Gs();return De(e+d*(t-e+Of("1e-"+((d+"").length-1))),t)}return Zi(e,t)}var Xg=xn(function(e,t,r){return t=t.toLowerCase(),e+(r?mu(t):t)});function mu(e){return xo(de(e).toLowerCase())}function vu(e){return e=de(e),e&&e.replace(Qc,Hf).replace(_f,"")}function Qg(e,t,r){e=de(e),t=Ve(t);var c=e.length;r=r===n?c:nn(ie(r),0,c);var d=r;return r-=t.length,r>=0&&e.slice(r,d)==t}function em(e){return e=de(e),e&&Mc.test(e)?e.replace(jo,qf):e}function tm(e){return e=de(e),e&&Gc.test(e)?e.replace(_i,"\\$&"):e}var nm=xn(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),rm=xn(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),im=Sa("toLowerCase");function om(e,t,r){e=de(e),t=ie(t);var c=t?yn(e):0;if(!t||c>=t)return e;var d=(t-c)/2;return Br(Er(d),r)+e+Br(wr(d),r)}function sm(e,t,r){e=de(e),t=ie(t);var c=t?yn(e):0;return t&&c<t?e+Br(t-c,r):e}function am(e,t,r){e=de(e),t=ie(t);var c=t?yn(e):0;return t&&c<t?Br(t-c,r)+e:e}function um(e,t,r){return r||t==null?t=0:t&&(t=+t),gl(de(e).replace(Si,""),t||0)}function cm(e,t,r){return(r?ke(e,t,r):t===n)?t=1:t=ie(t),Xi(de(e),t)}function fm(){var e=arguments,t=de(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var lm=xn(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()});function dm(e,t,r){return r&&typeof r!="number"&&ke(e,t,r)&&(t=r=n),r=r===n?Xe:r>>>0,r?(e=de(e),e&&(typeof t=="string"||t!=null&&!bo(t))&&(t=Ve(t),!t&&vn(e))?zt(dt(e),0,r):e.split(t,r)):[]}var pm=xn(function(e,t,r){return e+(r?" ":"")+xo(t)});function hm(e,t,r){return e=de(e),r=r==null?0:nn(ie(r),0,e.length),t=Ve(t),e.slice(r,r+t.length)==t}function gm(e,t,r){var c=h.templateSettings;r&&ke(e,t,r)&&(t=n),e=de(e),t=Qr({},t,c,wa);var d=Qr({},t.imports,c.imports,wa),m=Ee(d),S=ki(d,m),R,E,k=0,U=t.interpolate||dr,G="__p += '",q=Fi((t.escape||dr).source+"|"+U.source+"|"+(U===Ko?$c:dr).source+"|"+(t.evaluate||dr).source+"|$","g"),V="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rf+"]")+"\n";e.replace(q,function(Z,ae,ce,je,Ue,Ke){return ce||(ce=je),G+=e.slice(k,Ke).replace(ef,Jf),ae&&(R=!0,G+="' +\n__e("+ae+") +\n'"),Ue&&(E=!0,G+="';\n"+Ue+";\n__p += '"),ce&&(G+="' +\n((__t = ("+ce+")) == null ? '' : __t) +\n'"),k=Ke+Z.length,Z}),G+="';\n";var Y=pe.call(t,"variable")&&t.variable;if(!Y)G="with (obj) {\n"+G+"\n}\n";else if(zc.test(Y))throw new Q(g);G=(E?G.replace(yi,""):G).replace(Ac,"$1").replace(Ic,"$1;"),G="function("+(Y||"obj")+") {\n"+(Y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(R?", __e = _.escape":"")+(E?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+G+"return __p\n}";var oe=_u(function(){return le(m,V+"return "+G).apply(n,S)});if(oe.source=G,Co(oe))throw oe;return oe}function mm(e){return de(e).toLowerCase()}function vm(e){return de(e).toUpperCase()}function ym(e,t,r){if(e=de(e),e&&(r||t===n))return Es(e);if(!e||!(t=Ve(t)))return e;var c=dt(e),d=dt(t),m=Os(c,d),S=As(c,d)+1;return zt(c,m,S).join("")}function _m(e,t,r){if(e=de(e),e&&(r||t===n))return e.slice(0,Ds(e)+1);if(!e||!(t=Ve(t)))return e;var c=dt(e),d=As(c,dt(t))+1;return zt(c,0,d).join("")}function Sm(e,t,r){if(e=de(e),e&&(r||t===n))return e.replace(Si,"");if(!e||!(t=Ve(t)))return e;var c=dt(e),d=Os(c,dt(t));return zt(c,d).join("")}function Cm(e,t){var r=nr,c=dn;if(Se(t)){var d="separator"in t?t.separator:d;r="length"in t?ie(t.length):r,c="omission"in t?Ve(t.omission):c}e=de(e);var m=e.length;if(vn(e)){var S=dt(e);m=S.length}if(r>=m)return e;var R=r-yn(c);if(R<1)return c;var E=S?zt(S,0,R).join(""):e.slice(0,R);if(d===n)return E+c;if(S&&(R+=E.length-R),bo(d)){if(e.slice(R).search(d)){var k,U=E;for(d.global||(d=Fi(d.source,de(Yo.exec(d))+"g")),d.lastIndex=0;k=d.exec(U);)var G=k.index;E=E.slice(0,G===n?R:G)}}else if(e.indexOf(Ve(d),R)!=R){var q=E.lastIndexOf(d);q>-1&&(E=E.slice(0,q))}return E+c}function bm(e){return e=de(e),e&&Dc.test(e)?e.replace($o,Zf):e}var Tm=xn(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),xo=Sa("toUpperCase");function yu(e,t,r){return e=de(e),t=r?n:t,t===n?Vf(e)?el(e):Ff(e):e.match(t)||[]}var _u=se(function(e,t){try{return Je(e,n,t)}catch(r){return Co(r)?r:new Q(r)}}),Rm=Et(function(e,t){return et(t,function(r){r=St(r),Pt(e,r,_o(e[r],e))}),e});function xm(e){var t=e==null?0:e.length,r=K();return e=t?ye(e,function(c){if(typeof c[1]!="function")throw new tt(p);return[r(c[0]),c[1]]}):[],se(function(c){for(var d=-1;++d<t;){var m=e[d];if(Je(m[0],this,c))return Je(m[1],this,c)}})}function Pm(e){return Zl(rt(e,D))}function Po(e){return function(){return e}}function wm(e,t){return e==null||e!==e?t:e}var Em=ba(),Om=ba(!0);function He(e){return e}function wo(e){return Xs(typeof e=="function"?e:rt(e,D))}function Am(e){return ea(rt(e,D))}function Im(e,t){return ta(e,rt(t,D))}var Dm=se(function(e,t){return function(r){return Hn(r,e,t)}}),Mm=se(function(e,t){return function(r){return Hn(e,r,t)}});function Eo(e,t,r){var c=Ee(t),d=Lr(t,c);r==null&&!(Se(t)&&(d.length||!c.length))&&(r=t,t=e,e=this,d=Lr(t,Ee(t)));var m=!(Se(r)&&"chain"in r)||!!r.chain,S=At(e);return et(d,function(R){var E=t[R];e[R]=E,S&&(e.prototype[R]=function(){var k=this.__chain__;if(m||k){var U=e(this.__wrapped__),G=U.__actions__=Ge(this.__actions__);return G.push({func:E,args:arguments,thisArg:e}),U.__chain__=k,U}return E.apply(e,Gt([this.value()],arguments))})}),e}function Lm(){return Ae._===this&&(Ae._=sl),this}function Oo(){}function km(e){return e=ie(e),se(function(t){return na(t,e)})}var Um=oo(ye),Fm=oo(Ts),Nm=oo(Ai);function Su(e){return po(e)?Ii(St(e)):hd(e)}function Gm(e){return function(t){return e==null?n:rn(e,t)}}var Wm=Ra(),Bm=Ra(!0);function Ao(){return[]}function Io(){return!1}function Hm(){return{}}function qm(){return""}function Jm(){return!0}function zm(e,t){if(e=ie(e),e<1||e>ut)return[];var r=Xe,c=De(e,Xe);t=K(t),e-=Xe;for(var d=Li(c,t);++r<e;)t(r);return d}function Vm(e){return te(e)?ye(e,St):$e(e)?[e]:Ge(Wa(de(e)))}function $m(e){var t=++il;return de(e)+t}var jm=Wr(function(e,t){return e+t},0),Km=so("ceil"),Ym=Wr(function(e,t){return e/t},1),Zm=so("floor");function Xm(e){return e&&e.length?Mr(e,He,zi):n}function Qm(e,t){return e&&e.length?Mr(e,K(t,2),zi):n}function ev(e){return Ps(e,He)}function tv(e,t){return Ps(e,K(t,2))}function nv(e){return e&&e.length?Mr(e,He,Ki):n}function rv(e,t){return e&&e.length?Mr(e,K(t,2),Ki):n}var iv=Wr(function(e,t){return e*t},1),ov=so("round"),sv=Wr(function(e,t){return e-t},0);function av(e){return e&&e.length?Mi(e,He):0}function uv(e,t){return e&&e.length?Mi(e,K(t,2)):0}return h.after=Ah,h.ary=Za,h.assign=vg,h.assignIn=lu,h.assignInWith=Qr,h.assignWith=yg,h.at=_g,h.before=Xa,h.bind=_o,h.bindAll=Rm,h.bindKey=Qa,h.castArray=Hh,h.chain=ja,h.chunk=Zd,h.compact=Xd,h.concat=Qd,h.cond=xm,h.conforms=Pm,h.constant=Po,h.countBy=ah,h.create=Sg,h.curry=eu,h.curryRight=tu,h.debounce=nu,h.defaults=Cg,h.defaultsDeep=bg,h.defer=Ih,h.delay=Dh,h.difference=ep,h.differenceBy=tp,h.differenceWith=np,h.drop=rp,h.dropRight=ip,h.dropRightWhile=op,h.dropWhile=sp,h.fill=ap,h.filter=ch,h.flatMap=dh,h.flatMapDeep=ph,h.flatMapDepth=hh,h.flatten=Ja,h.flattenDeep=up,h.flattenDepth=cp,h.flip=Mh,h.flow=Em,h.flowRight=Om,h.fromPairs=fp,h.functions=Og,h.functionsIn=Ag,h.groupBy=gh,h.initial=dp,h.intersection=pp,h.intersectionBy=hp,h.intersectionWith=gp,h.invert=Dg,h.invertBy=Mg,h.invokeMap=vh,h.iteratee=wo,h.keyBy=yh,h.keys=Ee,h.keysIn=Be,h.map=$r,h.mapKeys=kg,h.mapValues=Ug,h.matches=Am,h.matchesProperty=Im,h.memoize=Kr,h.merge=Fg,h.mergeWith=du,h.method=Dm,h.methodOf=Mm,h.mixin=Eo,h.negate=Yr,h.nthArg=km,h.omit=Ng,h.omitBy=Gg,h.once=Lh,h.orderBy=_h,h.over=Um,h.overArgs=kh,h.overEvery=Fm,h.overSome=Nm,h.partial=So,h.partialRight=ru,h.partition=Sh,h.pick=Wg,h.pickBy=pu,h.property=Su,h.propertyOf=Gm,h.pull=_p,h.pullAll=Va,h.pullAllBy=Sp,h.pullAllWith=Cp,h.pullAt=bp,h.range=Wm,h.rangeRight=Bm,h.rearg=Uh,h.reject=Th,h.remove=Tp,h.rest=Fh,h.reverse=vo,h.sampleSize=xh,h.set=Hg,h.setWith=qg,h.shuffle=Ph,h.slice=Rp,h.sortBy=Oh,h.sortedUniq=Ip,h.sortedUniqBy=Dp,h.split=dm,h.spread=Nh,h.tail=Mp,h.take=Lp,h.takeRight=kp,h.takeRightWhile=Up,h.takeWhile=Fp,h.tap=Xp,h.throttle=Gh,h.thru=Vr,h.toArray=uu,h.toPairs=hu,h.toPairsIn=gu,h.toPath=Vm,h.toPlainObject=fu,h.transform=Jg,h.unary=Wh,h.union=Np,h.unionBy=Gp,h.unionWith=Wp,h.uniq=Bp,h.uniqBy=Hp,h.uniqWith=qp,h.unset=zg,h.unzip=yo,h.unzipWith=$a,h.update=Vg,h.updateWith=$g,h.values=En,h.valuesIn=jg,h.without=Jp,h.words=yu,h.wrap=Bh,h.xor=zp,h.xorBy=Vp,h.xorWith=$p,h.zip=jp,h.zipObject=Kp,h.zipObjectDeep=Yp,h.zipWith=Zp,h.entries=hu,h.entriesIn=gu,h.extend=lu,h.extendWith=Qr,Eo(h,h),h.add=jm,h.attempt=_u,h.camelCase=Xg,h.capitalize=mu,h.ceil=Km,h.clamp=Kg,h.clone=qh,h.cloneDeep=zh,h.cloneDeepWith=Vh,h.cloneWith=Jh,h.conformsTo=$h,h.deburr=vu,h.defaultTo=wm,h.divide=Ym,h.endsWith=Qg,h.eq=ht,h.escape=em,h.escapeRegExp=tm,h.every=uh,h.find=fh,h.findIndex=Ha,h.findKey=Tg,h.findLast=lh,h.findLastIndex=qa,h.findLastKey=Rg,h.floor=Zm,h.forEach=Ka,h.forEachRight=Ya,h.forIn=xg,h.forInRight=Pg,h.forOwn=wg,h.forOwnRight=Eg,h.get=To,h.gt=jh,h.gte=Kh,h.has=Ig,h.hasIn=Ro,h.head=za,h.identity=He,h.includes=mh,h.indexOf=lp,h.inRange=Yg,h.invoke=Lg,h.isArguments=an,h.isArray=te,h.isArrayBuffer=Yh,h.isArrayLike=We,h.isArrayLikeObject=Te,h.isBoolean=Zh,h.isBuffer=Vt,h.isDate=Xh,h.isElement=Qh,h.isEmpty=eg,h.isEqual=tg,h.isEqualWith=ng,h.isError=Co,h.isFinite=rg,h.isFunction=At,h.isInteger=iu,h.isLength=Zr,h.isMap=ou,h.isMatch=ig,h.isMatchWith=og,h.isNaN=sg,h.isNative=ag,h.isNil=cg,h.isNull=ug,h.isNumber=su,h.isObject=Se,h.isObjectLike=Ce,h.isPlainObject=jn,h.isRegExp=bo,h.isSafeInteger=fg,h.isSet=au,h.isString=Xr,h.isSymbol=$e,h.isTypedArray=wn,h.isUndefined=lg,h.isWeakMap=dg,h.isWeakSet=pg,h.join=mp,h.kebabCase=nm,h.last=ot,h.lastIndexOf=vp,h.lowerCase=rm,h.lowerFirst=im,h.lt=hg,h.lte=gg,h.max=Xm,h.maxBy=Qm,h.mean=ev,h.meanBy=tv,h.min=nv,h.minBy=rv,h.stubArray=Ao,h.stubFalse=Io,h.stubObject=Hm,h.stubString=qm,h.stubTrue=Jm,h.multiply=iv,h.nth=yp,h.noConflict=Lm,h.noop=Oo,h.now=jr,h.pad=om,h.padEnd=sm,h.padStart=am,h.parseInt=um,h.random=Zg,h.reduce=Ch,h.reduceRight=bh,h.repeat=cm,h.replace=fm,h.result=Bg,h.round=ov,h.runInContext=P,h.sample=Rh,h.size=wh,h.snakeCase=lm,h.some=Eh,h.sortedIndex=xp,h.sortedIndexBy=Pp,h.sortedIndexOf=wp,h.sortedLastIndex=Ep,h.sortedLastIndexBy=Op,h.sortedLastIndexOf=Ap,h.startCase=pm,h.startsWith=hm,h.subtract=sv,h.sum=av,h.sumBy=uv,h.template=gm,h.times=zm,h.toFinite=It,h.toInteger=ie,h.toLength=cu,h.toLower=mm,h.toNumber=st,h.toSafeInteger=mg,h.toString=de,h.toUpper=vm,h.trim=ym,h.trimEnd=_m,h.trimStart=Sm,h.truncate=Cm,h.unescape=bm,h.uniqueId=$m,h.upperCase=Tm,h.upperFirst=xo,h.each=Ka,h.eachRight=Ya,h.first=za,Eo(h,function(){var e={};return yt(h,function(t,r){pe.call(h.prototype,r)||(e[r]=t)}),e}(),{chain:!1}),h.VERSION=o,et(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){h[e].placeholder=h}),et(["drop","take"],function(e,t){ue.prototype[e]=function(r){r=r===n?1:we(ie(r),0);var c=this.__filtered__&&!t?new ue(this):this.clone();return c.__filtered__?c.__takeCount__=De(r,c.__takeCount__):c.__views__.push({size:De(r,Xe),type:e+(c.__dir__<0?"Right":"")}),c},ue.prototype[e+"Right"]=function(r){return this.reverse()[e](r).reverse()}}),et(["filter","map","takeWhile"],function(e,t){var r=t+1,c=r==rr||r==or;ue.prototype[e]=function(d){var m=this.clone();return m.__iteratees__.push({iteratee:K(d,3),type:r}),m.__filtered__=m.__filtered__||c,m}}),et(["head","last"],function(e,t){var r="take"+(t?"Right":"");ue.prototype[e]=function(){return this[r](1).value()[0]}}),et(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");ue.prototype[e]=function(){return this.__filtered__?new ue(this):this[r](1)}}),ue.prototype.compact=function(){return this.filter(He)},ue.prototype.find=function(e){return this.filter(e).head()},ue.prototype.findLast=function(e){return this.reverse().find(e)},ue.prototype.invokeMap=se(function(e,t){return typeof e=="function"?new ue(this):this.map(function(r){return Hn(r,e,t)})}),ue.prototype.reject=function(e){return this.filter(Yr(K(e)))},ue.prototype.slice=function(e,t){e=ie(e);var r=this;return r.__filtered__&&(e>0||t<0)?new ue(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(t=ie(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},ue.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ue.prototype.toArray=function(){return this.take(Xe)},yt(ue.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),c=/^(?:head|last)$/.test(t),d=h[c?"take"+(t=="last"?"Right":""):t],m=c||/^find/.test(t);d&&(h.prototype[t]=function(){var S=this.__wrapped__,R=c?[1]:arguments,E=S instanceof ue,k=R[0],U=E||te(S),G=function(ae){var ce=d.apply(h,Gt([ae],R));return c&&q?ce[0]:ce};U&&r&&typeof k=="function"&&k.length!=1&&(E=U=!1);var q=this.__chain__,V=!!this.__actions__.length,Y=m&&!q,oe=E&&!V;if(!m&&U){S=oe?S:new ue(this);var Z=e.apply(S,R);return Z.__actions__.push({func:Vr,args:[G],thisArg:n}),new nt(Z,q)}return Y&&oe?e.apply(this,R):(Z=this.thru(G),Y?c?Z.value()[0]:Z.value():Z)})}),et(["pop","push","shift","sort","splice","unshift"],function(e){var t=yr[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",c=/^(?:pop|shift)$/.test(e);h.prototype[e]=function(){var d=arguments;if(c&&!this.__chain__){var m=this.value();return t.apply(te(m)?m:[],d)}return this[r](function(S){return t.apply(te(S)?S:[],d)})}}),yt(ue.prototype,function(e,t){var r=h[t];if(r){var c=r.name+"";pe.call(bn,c)||(bn[c]=[]),bn[c].push({name:t,func:r})}}),bn[Gr(n,Ye).name]=[{name:"wrapper",func:n}],ue.prototype.clone=bl,ue.prototype.reverse=Tl,ue.prototype.value=Rl,h.prototype.at=Qp,h.prototype.chain=eh,h.prototype.commit=th,h.prototype.next=nh,h.prototype.plant=ih,h.prototype.reverse=oh,h.prototype.toJSON=h.prototype.valueOf=h.prototype.value=sh,h.prototype.first=h.prototype.head,kn&&(h.prototype[kn]=rh),h},_n=tl();Xt?((Xt.exports=_n)._=_n,Pi._=_n):Ae._=_n}).call(Kn)})(di,di.exports);var Gv=di.exports;const fn=qu(Gv);var un=globalThis&&globalThis.__assign||function(){return un=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},un.apply(this,arguments)},Lo=globalThis&&globalThis.__awaiter||function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function g(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(g,T)}l((o=o.apply(i,s||[])).next())})},ko=globalThis&&globalThis.__generator||function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function g(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Wv=function(){function i(s){this.instance=s}return i.prototype.getServer=function(){return this.instance.getServer()},i.prototype.isConnected=function(){return this.instance.isConnected()},i.prototype.getSessionId=function(){return this.instance.getSessionId()},i.prototype.getObservableControllers=function(s){var n=un({},s),o={onRecordingDataController:new cn,onStatReportsController:new cn,onMessageController:new cn,onLocalTrackController:new Ct(null),onRemoteTrackController:new cn,onDataController:new Ct(null),onErrorController:new Ct(null),onMediaStateController:new Ct(null),onIceStateController:new Ct(null),onSlowLinkController:new Ct(null),onWebRTCStateController:new Ct(null),onCleanupController:new Ct(null),onDataOpenController:new Ct(null),onDetachedController:new Ct(null)};return n.onmessage=function(a,u){o.onMessageController.next({message:a,jsep:u})},n.onlocaltrack=function(a,u){o.onLocalTrackController.next({on:u,track:a})},n.onremotetrack=function(a,u,p){o.onRemoteTrackController.next({on:p,track:a,mid:u})},n.ondata=function(a){o.onDataController.next(a)},n.error=function(a){o.onErrorController.next(a)},n.mediaState=function(a,u,p){o.onMediaStateController.next({medium:a,recieving:u,mid:p})},n.slowLink=function(a,u,p){o.onSlowLinkController.next({uplink:a,lost:u,mid:p})},n.webrtcState=function(a){o.onWebRTCStateController.next(a)},n.iceState=function(a){o.onIceStateController.next(a)},n.ondataopen=function(){o.onDataOpenController.next()},n.ondetached=function(){o.onDetachedController.next()},n.oncleanup=function(){o.onCleanupController.next()},{finalOptions:n,controllers:o}},i.prototype.cast=function(s){return s},i.prototype.attach=function(s,n){var o=this,a=un(un({},n),{plugin:s.identifier}),u=this.getObservableControllers(a),p=u.controllers,g=u.finalOptions;return new Promise(function(T,l){g.success=function(_){var D=new s(o.instance,o,_,p);fn.assign(D,fn.omit(_,["data","send","createAnswer","createOffer"])),T(D)},g.error=function(_){l(_)},o.instance.attach(g)})},i.prototype.reconnect=function(){return Lo(this,void 0,void 0,function(){var s=this;return ko(this,function(n){return[2,new Promise(function(o,a){s.instance.reconnect({success:function(){o(!0)},error:function(u){a(u)}})})]})})},i.prototype.getInfo=function(){return Lo(this,void 0,void 0,function(){var s=this;return ko(this,function(n){return[2,new Promise(function(o,a){s.instance.getInfo({success:function(u){o(u)},error:function(u){a(u)}})})]})})},i.prototype.destroy=function(s){return Lo(this,void 0,void 0,function(){var n=this;return ko(this,function(o){return[2,new Promise(function(a,u){n.instance.destroy(un(un({},s),{success:function(){a()},error:function(p){u(p)}}))})]})})},i}(),Qn=globalThis&&globalThis.__assign||function(){return Qn=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},Qn.apply(this,arguments)},Lu=globalThis&&globalThis.__awaiter||function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function g(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(g,T)}l((o=o.apply(i,s||[])).next())})},ku=globalThis&&globalThis.__generator||function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function g(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},zo=function(){function i(s){this.statsQueryInterval=0,console.log("JanusJs loaded"),this.options=s}return i.isWebrtcSupported=function(){return f.isWebrtcSupported()},i.debug=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];f.debug(s)},i.log=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];f.log(s)},i.warn=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];f.warn(s)},i.error=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];f.error(s)},i.randomString=function(s){return f.randomString(s)},i.attachMediaStream=function(s,n){f.attachMediaStream(s,n)},i.reattachMediaStream=function(s,n){f.reattachMediaStream(s,n)},i.stopAllTracks=function(s){f.stopAllTracks(s)},i.prototype.init=function(s){return s===void 0&&(s={debug:"all",dependencies:f.useDefaultDependencies({adapter:Eu})}),Lu(this,void 0,void 0,function(){return ku(this,function(n){switch(n.label){case 0:return s.dependencies||(s.dependencies=f.useDefaultDependencies({adapter:Eu})),[4,new Promise(function(o,a){f.init(Qn(Qn({},s),{callback:function(){o()}}))})];case 1:return n.sent(),[2]}})})},i.mix=function(s,n){var o=s.createMediaStreamDestination();return n.forEach(function(a){o.context.createMediaStreamSource(a).connect(o)}),o.stream.getTracks()[0]},i.playMediaStream=function(s){window.AudioContext=window.AudioContext||window.webkitAudioContext;try{var n=new window.AudioContext,o=new Audio;o.srcObject=s;var a=n.createMediaStreamSource(o.srcObject);return a.connect(n.destination),n}catch(u){throw i.error("failed to play media stream",u),u}},i.createRecording=function(s){var n=[];if(fn.each(s.mediaStreams,function(l){l!=null&&l.getTracks&&fn.each(l.getTracks(),function(_){n.push(new MediaStream([_]))})}),n.length!=0){var o=new AudioContext,a=this.mix(o,n),u=new MediaStream([a]),p=new MediaRecorder(u),g=new cn,T=0;return p.ondataavailable=function(l){T++,g.next({blob:l.data,chunkNumber:T})},p.onstop=function(l){g.next({blob:null,chunkNumber:T})},p.start(s.timeSlice),{mediaRecorder:p,controller:g}}},i.prototype.createSession=function(){return Lu(this,void 0,void 0,function(){var s=this;return ku(this,function(n){switch(n.label){case 0:return this.options.destroyed=function(){s.onDestroyed&&s.onDestroyed()},this.options.error=function(o){s.onError&&s.onError(o)},[4,new Promise(function(o,a){s.options.success=function(){o()},s.options.error=function(u){a(u)},s.instance=new f(Qn({},s.options))})];case 1:return n.sent(),[2,new Wv(this.instance)]}})})},i}(),Fe=globalThis&&globalThis.__assign||function(){return Fe=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},Fe.apply(this,arguments)},Yn=globalThis&&globalThis.__awaiter||function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function g(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(g,T)}l((o=o.apply(i,s||[])).next())})},Zn=globalThis&&globalThis.__generator||function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function g(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Uu=globalThis&&globalThis.__spreadArray||function(i,s,n){if(n||arguments.length===2)for(var o=0,a=s.length,u;o<a;o++)(u||!(o in s))&&(u||(u=Array.prototype.slice.call(s,0,o)),u[o]=s[o]);return i.concat(u||Array.prototype.slice.call(s))},Dn=function(){function i(s,n,o,a){this.recording=!1,this.statsQueryInterval=0,this.instance=s,this.session=n,this.controllers=a,this.handle=o,this.statsReportHookTimer=this.handleStatsHook(this.handle,a,null),this.recording&&(console.info("recording enabled"),this.handleRecordingSetup(a))}return i.prototype.promisify=function(s){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return Yn(this,void 0,void 0,function(){var a;return Zn(this,function(u){return a=fn.first(n),fn.isPlainObject(a)?[2,new Promise(function(p,g){s(Fe(Fe({},fn.omit(a,["success","error"])),{success:function(T){p(T)},error:function(T){g(T)}}))})]:[2,new Promise(function(p,g){s.apply(void 0,Uu(Uu([],n,!1),[function(T){p(T)}],!1))})]})})},i.prototype.replaceTracks=function(s){return Yn(this,void 0,void 0,function(){return Zn(this,function(n){return[2,this.promisify(this.handle.replaceTracks,Fe({},s))]})})},i.prototype.getVolume=function(s){return this.promisify(this.handle.getVolume,s)},i.prototype.getRemoteVolume=function(s){return this.promisify(this.handle.getRemoteVolume,s)},i.prototype.getLocalVolume=function(s){return this.promisify(this.handle.getLocalVolume,s)},i.prototype.isAudioMuted=function(){throw new Error("Method not implemented.")},i.prototype.muteAudio=function(){throw new Error("Method not implemented.")},i.prototype.unmuteAudio=function(){throw new Error("Method not implemented.")},i.prototype.isVideoMuted=function(){throw new Error("Method not implemented.")},i.prototype.muteVideo=function(){throw new Error("Method not implemented.")},i.prototype.unmuteVideo=function(){throw new Error("Method not implemented.")},i.prototype.getBitrate=function(){throw new Error("Method not implemented.")},i.prototype.setMaxBitrate=function(s){throw new Error("Method not implemented.")},i.prototype.getLocalTracks=function(){throw new Error("Method not implemented.")},i.prototype.getRemoteTracks=function(){throw new Error("Method not implemented.")},i.prototype.handleRecordingSetup=function(s){var n=this,o;this.onMessage.subscribe(function(a){var u,p,g=a.message,T=g==null?void 0:g.result;if((T==null?void 0:T.event)==="accepted"||(T==null?void 0:T.event)==="progress"){if(!o){if(!n.webrtcStuff.remoteStream||!n.webrtcStuff.myStream)return;console.info("recording initiated"),o=zo.createRecording({mediaStreams:[n.webrtcStuff.myStream,n.webrtcStuff.remoteStream],timeSlice:n.recordingTimeSlice})}o&&(n.mediaRecorder=o.mediaRecorder,o.controller.subscribe(function(l){s.onRecordingDataController.next(l)}))}(T==null?void 0:T.event)==="hangup"&&((u=n.mediaRecorder)===null||u===void 0?void 0:u.state)!=="inactive"&&((p=n.mediaRecorder)===null||p===void 0||p.stop())})},i.prototype.sendTrickle=function(){return Yn(this,void 0,void 0,function(){return Zn(this,function(s){return[2]})})},i.prototype.handleStatsHook=function(s,n,o){var a=this;return setInterval(function(){return Yn(a,void 0,void 0,function(){var u,p;return Zn(this,function(g){switch(g.label){case 0:return s.webrtcStuff.pc?(u=[],[4,s.webrtcStuff.pc.getStats()]):[2];case 1:return p=g.sent(),p.forEach(function(T){u.push.apply(u,T)}),n.onStatReportsController.next(u),[2]}})})},this.statsQueryInterval)},Object.defineProperty(i.prototype,"recorder",{get:function(){return this.mediaRecorder},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onRecordingData",{get:function(){return this.controllers.onRecordingDataController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onStatReports",{get:function(){return this.controllers.onStatReportsController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onMessage",{get:function(){return this.controllers.onMessageController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onLocalTrack",{get:function(){return this.controllers.onLocalTrackController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onData",{get:function(){return this.controllers.onDataController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onError",{get:function(){return this.controllers.onErrorController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onRemoteTrack",{get:function(){return this.controllers.onRemoteTrackController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onMediaState",{get:function(){return this.controllers.onMediaStateController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onSlowLink",{get:function(){return this.controllers.onSlowLinkController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onWebRTCState",{get:function(){return this.controllers.onWebRTCStateController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onIceState",{get:function(){return this.controllers.onIceStateController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDataOpen",{get:function(){return this.controllers.onDataOpenController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDetached",{get:function(){return this.controllers.onDetachedController.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onCleanup",{get:function(){return this.controllers.onCleanupController.asObservable()},enumerable:!1,configurable:!0}),i.prototype.getId=function(){throw new Error("Method not implemented.")},i.prototype.getPlugin=function(){throw new Error("Method not implemented.")},i.prototype.send=function(s){return Yn(this,void 0,void 0,function(){var n=this;return Zn(this,function(o){return[2,new Promise(function(a,u){n.handle.send(Fe(Fe({},s),{success:function(p){a(p)},error:function(p){u(p)}}))})]})})},i.prototype.createOffer=function(s){var n=this;return new Promise(function(o,a){n.handle.createOffer(Fe(Fe({},s),{success:function(u){o(u)},error:function(u){a(u)}}))})},i.prototype.createAnswer=function(s){var n=this;return new Promise(function(o,a){n.handle.createAnswer(Fe(Fe({},s),{success:function(u){o(u)},error:function(u){a(u)}}))})},i.prototype.data=function(s){var n=this;return new Promise(function(o,a){n.handle.data(Fe(Fe({},s),{success:function(){o()},error:function(u){a(u)}}))})},i.prototype.handleRemoteJsep=function(s){throw new Error("Method not implemented.")},i.prototype.dtmf=function(s){throw new Error("Method not implemented.")},i.prototype.hangup=function(s){throw new Error("Method not implemented.")},i.prototype.detach=function(s){var n=this;return new Promise(function(o,a){n.handle.detach(Fe(Fe({},s),{success:function(){o()},error:function(u){a(u)}}))})},i.prototype.stopCollectingStats=function(){clearInterval(this.statsReportHookTimer)},i.identifier=null,i}(),Mn=function(){function i(){}return i.VIDEO_ROOM="janus.plugin.videoroom",i.VIDEO_CALL="janus.plugin.videocall",i.AUDIO_BRIDGE="janus.plugin.audiobridge",i.SIP="janus.plugin.sip",i.STREAMING="janus.plugin.streaming",i.ECHO_TEST="janus.plugin.echotest",i}(),Bv=globalThis&&globalThis.__extends||function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),On=globalThis&&globalThis.__assign||function(){return On=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},On.apply(this,arguments)},$t=globalThis&&globalThis.__awaiter||function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function g(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(g,T)}l((o=o.apply(i,s||[])).next())})},jt=globalThis&&globalThis.__generator||function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function g(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};(function(i){Bv(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.createRoom=function(n){return n===void 0&&(n={}),$t(this,void 0,void 0,function(){var o;return jt(this,function(a){return o=On({request:"create"},n),[2,this.send({message:o})]})})},s.prototype.joinRoomAsPublisher=function(n,o){var a=On({request:"join",room:n,ptype:"publisher"},o);return this.send({message:a})},s.prototype.listParticipants=function(n){return $t(this,void 0,void 0,function(){var o;return jt(this,function(a){return o={request:"listparticipants",room:n},[2,this.send({message:o})]})})},s.prototype.joinRoomAsSubscriber=function(n,o){return $t(this,void 0,void 0,function(){var a;return jt(this,function(u){return a=On({request:"join",ptype:"subscriber",room:n},o),[2,this.send({message:a})]})})},s.prototype.startAsSubscriber=function(n){return $t(this,void 0,void 0,function(){var o;return jt(this,function(a){return o={request:"start"},[2,this.send({message:o,jsep:n.toJSON()})]})})},s.prototype.publishAsPublisher=function(n,o){return $t(this,void 0,void 0,function(){var a;return jt(this,function(u){return a=On({request:"publish"},o),[2,this.send({message:a,jsep:n.toJSON()})]})})},s.prototype.unpublishAsPublisher=function(){return $t(this,void 0,void 0,function(){var n;return jt(this,function(o){return n={request:"unpublish"},[2,this.send({message:n})]})})},s.prototype.updateAsSubscriber=function(n){var o=n.subscribe,a=n.unsubscribe;return $t(this,void 0,void 0,function(){var u;return jt(this,function(p){return u={request:"update",subscribe:o,unsubscribe:a},[2,this.send({message:u})]})})},s.prototype.leave=function(){return $t(this,void 0,void 0,function(){var n;return jt(this,function(o){return n={request:"leave"},[2,this.send({message:n})]})})},s.identifier=Mn.VIDEO_ROOM,s})(Dn);var Hv=globalThis&&globalThis.__extends||function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),Fu=globalThis&&globalThis.__awaiter||function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function g(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(g,T)}l((o=o.apply(i,s||[])).next())})},Nu=globalThis&&globalThis.__generator||function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function g(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};(function(i){Hv(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.register=function(n){return Fu(this,void 0,void 0,function(){return Nu(this,function(o){switch(o.label){case 0:return[4,this.send({message:{request:"register",username:n}})];case 1:return o.sent(),[2]}})})},s.prototype.call=function(n,o){return o===void 0&&(o=null),Fu(this,void 0,void 0,function(){return Nu(this,function(a){switch(a.label){case 0:return o!==null?[3,2]:[4,this.createOffer({media:{videoSend:!0,videoRecv:!0,audioSend:!0,audioRecv:!0}})];case 1:o=a.sent(),a.label=2;case 2:return[4,this.send({message:{request:"call",username:n},jsep:o.toJSON()})];case 3:return a.sent(),[2]}})})},s.identifier=Mn.VIDEO_CALL,s})(Dn);var qv=globalThis&&globalThis.__extends||function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),Gu=globalThis&&globalThis.__awaiter||function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function g(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(g,T)}l((o=o.apply(i,s||[])).next())})},Wu=globalThis&&globalThis.__generator||function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function g(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Jv=function(i){qv(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.list=function(){return Gu(this,void 0,void 0,function(){return Wu(this,function(n){return[2,this.send({message:{request:"list"}})]})})},s.prototype.info=function(n,o){return o===void 0&&(o=void 0),Gu(this,void 0,void 0,function(){return Wu(this,function(a){return[2,this.send({message:{request:"info",id:n,secret:o}})]})})},s.identifier=Mn.STREAMING,s}(Dn),zv=globalThis&&globalThis.__extends||function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),An=globalThis&&globalThis.__assign||function(){return An=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},An.apply(this,arguments)},Kt=globalThis&&globalThis.__awaiter||function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function g(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(g,T)}l((o=o.apply(i,s||[])).next())})},Yt=globalThis&&globalThis.__generator||function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function g(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};(function(i){zv(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.register=function(n,o,a){return Kt(this,void 0,void 0,function(){var u;return Yt(this,function(p){switch(p.label){case 0:return u=An({request:"register",username:"sip:".concat(n,"@").concat(o)},a),u.proxy="sip:".concat(o),[4,this.send({message:u})];case 1:return p.sent(),[2]}})})},s.prototype.call=function(n,o,a){return Kt(this,void 0,void 0,function(){var u;return Yt(this,function(p){switch(p.label){case 0:return a?[3,2]:[4,this.createOffer({media:{audioRecv:!0,audioSend:!0,videoRecv:!1,videoSend:!1}})];case 1:a=p.sent(),p.label=2;case 2:return u=An({request:"call",uri:n},o),[4,this.send({message:u,jsep:a})];case 3:return p.sent(),[2]}})})},s.prototype.update=function(n){return Kt(this,void 0,void 0,function(){var o;return Yt(this,function(a){switch(a.label){case 0:return n?[3,2]:[4,this.createOffer({media:{audioRecv:!0,audioSend:!0,videoRecv:!1,videoSend:!1}})];case 1:n=a.sent(),a.label=2;case 2:return o={request:"update"},[4,this.send({message:o,jsep:n.toJSON()})];case 3:return a.sent(),[2]}})})},s.prototype.decline=function(n,o){return Kt(this,void 0,void 0,function(){var a;return Yt(this,function(u){switch(u.label){case 0:return a={request:"decline",code:n,headers:o},[4,this.send({message:a})];case 1:return u.sent(),[2]}})})},s.prototype.accept=function(n){return Kt(this,void 0,void 0,function(){var o;return Yt(this,function(a){switch(a.label){case 0:return o=An({request:"accept"},n),[4,this.send({message:o})];case 1:return a.sent(),[2]}})})},s.prototype.hold=function(n){return Kt(this,void 0,void 0,function(){var o;return Yt(this,function(a){switch(a.label){case 0:return o={request:"hold",direction:n},[4,this.send({message:o})];case 1:return a.sent(),[2]}})})},s.prototype.unhold=function(){return Kt(this,void 0,void 0,function(){var n;return Yt(this,function(o){switch(o.label){case 0:return n={request:"unhold"},[4,this.send({message:n})];case 1:return o.sent(),[2]}})})},s.prototype.record=function(n,o){return o===void 0&&(o={peer_audio:!0,peer_video:!1,audio:!0,video:!1,filename:"recording_"+new Date().toDateString()}),Kt(this,void 0,void 0,function(){var a;return Yt(this,function(u){switch(u.label){case 0:return a=An({request:"recording",action:n},o),[4,this.send({message:a})];case 1:return u.sent(),[2]}})})},s.identifier=Mn.SIP,s})(Dn);var Vv=globalThis&&globalThis.__extends||function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),pi=globalThis&&globalThis.__assign||function(){return pi=Object.assign||function(i){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(i[a]=s[a])}return i},pi.apply(this,arguments)},ti=globalThis&&globalThis.__awaiter||function(i,s,n,o){function a(u){return u instanceof n?u:new n(function(p){p(u)})}return new(n||(n=Promise))(function(u,p){function g(_){try{l(o.next(_))}catch(D){p(D)}}function T(_){try{l(o.throw(_))}catch(D){p(D)}}function l(_){_.done?u(_.value):a(_.value).then(g,T)}l((o=o.apply(i,s||[])).next())})},ni=globalThis&&globalThis.__generator||function(i,s){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,p;return p={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function g(l){return function(_){return T([l,_])}}function T(l){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=l[0]&2?a.return:l[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,l[1])).done)return u;switch(a=0,u&&(l=[l[0]&2,u.value]),l[0]){case 0:case 1:u=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,a=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]<u[3])){n.label=l[1];break}if(l[0]===6&&n.label<u[1]){n.label=u[1],u=l;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(l);break}u[2]&&n.ops.pop(),n.trys.pop();continue}l=s.call(i,n)}catch(_){l=[6,_],a=0}finally{o=u=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};(function(i){Vv(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.createRoom=function(n,o){return ti(this,void 0,void 0,function(){var a;return ni(this,function(u){return a=pi({request:"create",room:n},o),[2,this.send({message:a})]})})},s.prototype.editRoom=function(n,o){return ti(this,void 0,void 0,function(){var a;return ni(this,function(u){return a=pi({request:"edit",room:n},o),[2,this.send({message:a})]})})},s.prototype.joinRoom=function(n,o){var a=o===void 0?{}:o,u=a.id,p=a.group,g=a.pin,T=a.display,l=a.token,_=a.muted,D=a.codec,H=a.preBuffer,z=a.bitrate,j=a.quality,ee=a.expectedLoss,xe=a.volume,Ye=a.spatialPosition,_e=a.secret,$=a.audioLevelAverage,X=a.audioActivePackets,Oe=a.record,Ze=a.filename;return ti(this,void 0,void 0,function(){var me;return ni(this,function(mt){return me={request:"join",room:n,id:u,group:p,pin:g,display:T,token:l,muted:_,codec:D,prebuffer:H,bitrate:z,quality:j,expected_loss:ee,volume:xe,spatial_position:Ye,secret:_e,audio_level_average:$,audio_active_packets:X,record:Oe,filename:Ze},[2,this.send({message:me})]})})},s.prototype.configure=function(n){var o=n.muted,a=n.offer,u=n.display,p=n.preBuffer,g=n.bitrate,T=n.quality,l=n.expectedLoss,_=n.volume,D=n.spatialPosition,H=n.record,z=n.filename,j=n.group;return ti(this,void 0,void 0,function(){var ee;return ni(this,function(xe){return ee={request:"configure",muted:o,display:u,prebuffer:p,bitrate:g,quality:T,expected_loss:l,volume:_,spatial_position:D,record:H,filename:z,group:j},[2,this.send({message:ee,jsep:a})]})})},s.identifier=Mn.AUDIO_BRIDGE,s})(Dn);var $v=globalThis&&globalThis.__extends||function(){var i=function(s,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},i(s,n)};return function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");i(s,n);function o(){this.constructor=s}s.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}();(function(i){$v(s,i);function s(n,o,a,u){return i.call(this,n,o,a,u)||this}return s.prototype.boomCall=function(){},s.identifier=Mn.ECHO_TEST,s})(Dn);var jv=Object.defineProperty,Kv=Object.getOwnPropertyDescriptor,tr=(i,s,n,o)=>{for(var a=o>1?void 0:o?Kv(s,n):s,u=i.length-1,p;u>=0;u--)(p=i[u])&&(a=(o?p(s,n,a):p(a))||a);return o&&a&&jv(s,n,a),a};let ln=class extends cv(fv,lv){constructor(){super(...arguments),this.janusClient=null,this.session=null,this.handle=null,this.useStun=!1,this.aspectRatio=null,this.status="connecting"}get url(){var o;const s=this.camSettings.stream_url;let n=new URL(s,this.printerUrl===null?this.hostUrl.toString():this.printerUrl);if(n.port="8188",n.protocol=(o=this.printerUrl)!=null&&o.startsWith("https")?"wss":"ws",s.startsWith("ws")||s.startsWith("http")){n=new URL(s);const a=n.pathname.split("/");n.pathname=a.slice(0,a.length-1).join("/")}return n}get streamId(){const s=new URL(this.camSettings.stream_url).pathname.split("/");return s[s.length-1]}get webcamStyle(){var n,o,a;const s={transform:this.generateTransform((n=this.camSettings.flip_horizontal)!=null?n:!1,(o=this.camSettings.flip_vertical)!=null?o:!1,(a=this.camSettings.rotation)!=null?a:0),aspectRatio:1.7777777777777777};return this.aspectRatio&&(s.aspectRatio=this.aspectRatio),s}get streamConfig(){let s={server:this.url.toString()};return this.useStun&&(s.iceServers=[{urls:["stun:stun.l.google.com:19302"]}]),s}async startStream(){var n,o;this.janusClient=new zo(this.streamConfig),await this.janusClient.init({debug:!1}),this.session=await this.janusClient.createSession(),this.handle=await this.session.attach(Jv,{}),(n=this.handle)==null||n.onMessage.subscribe(async({message:a,jsep:u})=>{var p,g,T;if((p=a==null?void 0:a.result)!=null&&p.status&&(this.status=a.result.status),u){const l=await((g=this.handle)==null?void 0:g.createAnswer({jsep:u}));(T=this.handle)==null||T.send({message:{request:"start"},jsep:l})}});const s=new MediaStream;zo.attachMediaStream(this.stream,s),(o=this.handle)==null||o.onRemoteTrack.subscribe(({on:a,track:u})=>{a?s.addTrack(u):s.removeTrack(u)}),this.handle.onIceState.subscribe(a=>{console.log("ICE state changed to ".concat(a))}),this.handle.onError.subscribe(a=>{this.status="errored: ".concat(JSON.stringify(a))}),await this.handle.send({message:{request:"watch",id:parseInt(this.streamId)}})}mounted(){this.startStream()}updateAspectRatio(){this.aspectRatio=this.stream.videoWidth/this.stream.videoHeight}beforeDestroy(){var s;(s=this.session)==null||s.destroy({})}async changedUrl(){var s;await((s=this.session)==null?void 0:s.destroy({})),await this.startStream()}};tr([Hu({required:!0})],ln.prototype,"camSettings",2);tr([Hu({default:null})],ln.prototype,"printerUrl",2);tr([pv()],ln.prototype,"stream",2);tr([dv("url")],ln.prototype,"changedUrl",1);ln=tr([hv],ln);var Yv=function(){var i=this,s=i.$createElement,n=i._self._c||s;return n("div",[n("video",{directives:[{name:"show",rawName:"v-show",value:i.status==="started",expression:"status === 'started'"}],ref:"stream",staticClass:"webcamStream",style:i.webcamStyle,attrs:{autoplay:"",muted:"",playsinline:""},domProps:{muted:!0},on:{playing:i.updateAspectRatio}}),i.status!=="started"?n(mv,[n(vv,{staticClass:"_webcam_webrtc_output text-center d-flex flex-column justify-center align-center"},[i.status==="connecting"?n(yv,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):i._e(),n("span",{staticClass:"mt-3"},[i._v(i._s(i.status))])],1)],1):i._e()],1)},Zv=[];const Bu={};var Xv=gv(ln,Yv,Zv,!1,Qv,"5fed87a3",null,null);function Qv(i){for(let s in Bu)this[s]=Bu[s]}const oy=function(){return Xv.exports}();export{oy as default};
|