1!function(e){var o={};function n(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=o,n.d=function(e,o,t){n.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,o){if(1&o&&(e=n(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var r in e)n.d(t,r,function(o){return e[o]}.bind(null,r));return t},n.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(o,"a",o),o},n.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},n.p="/",n(n.s=17)}({17:function(e,o,n){e.exports=n("HO8k")},HO8k:function(e,o){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}$("#popUpVideoCall");$(function(e,o,t,r,s,l){"use strict";s((function(){console.log(currentUser.email);var a,i="callingSignal",c="endCallSignal",d="ringtoneSignal",u=!1,p="#income_call",m=".j-filter",g=".j-video_source",f=".j-audio_source",h=".j-bandwidth",v=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=s(".j-users");function n(e,o,n){n&&e.empty(),e.append(o).removeClass("wait")}return console.log("insertOccupants"),new Promise((function(r,s){o.addClass("wait"),console.log("wait insertOccupants"),t.helpers.renderUsers().then((function(t){n(o,t.usersHTML,e),r(t.users)}),(function(r){e?n(o,r.message,e):(o.removeClass("wait"),t.helpers.renderUsers.stop=!0),s("Not found users")}))}
1))},S=null,b={onstart:function(){s(".j-record").addClass("active"),a=setTimeout((function(){S&&S.stop()}),6e5)},onstop:function(e){s(".j-record").removeClass("active"),confirm("Do you want to download video?")&&S.download("QB_WEBrtc_sample"+Date.now(),e),S=null,clearTimeout(a)},onerror:function(e){console.error("Recorder error",e)}};if(console.log("Load page"),!e.navigator.onLine)return alert(r.MESSAGES.no_internet),!1;var C=0,y=l.Router.extend({routes:{join:"join",bombam:"bombam",dashboard:"dashboard","*query":"relocated"},container:s(".page"),relocated:function(){console.log("app.caller",t.caller),console.log("CONNECT");var n={username:currentUser.email,login:currentUser.email};localStorage.setItem("data",JSON.stringify(n)),console.log({data:n});try{t.helpers.join(n).then((function(n){t.caller=n,console.log("quickblix access ",t.caller.id,r.CREDENTIALS.appId),function(e){var o="/user/update-chatid";console.log({isAdmin:isAdmin}),isAdmin&&(o="/backoffice/admin/update-chatid");s.ajax({headers:{"X-CSRF-TOKEN":s('meta[name="csrf-token"]').attr("content")},type:"POST",url:urlPath+o,data:{admin_data:e},success:function(e){console.log(e)}})}
1(n),o.chat.connect({jid:o.chat.helpers.getUserJid(t.caller.id,r.CREDENTIALS.appId),password:"quickblox"},(function(o,n){if(o)console.log("err",o),_.isEmpty(t.currentSession)||(t.currentSession.stop({}),t.currentSession={}),t.helpers.changeFilter("#localVideo","no"),t.helpers.changeFilter("#main_video","no"),t.mainVideo=0,s(m).val("no"),t.calleesAnwered=[],t.calleesRejected=[],call.callTimer&&(s("#timer").addClass("invisible"),clearInterval(call.callTimer),call.callTimer=null,call.callTime=0,t.helpers.network={});else{localStorage.setItem("isAuth",!0),console.log("app.caller.full_name",t.caller.full_name),t.helpers.stateBoard=new t.helpers.StateBoard(".j-state_board",{title:"tpl_default",property:{name:t.caller.full_name}});var r=new URLSearchParams(e.location.search),l=r.get("id"),a=r.get("calling");console.log("userDataId",l,"userCalling",a),a&&l&&(console.log("YESSS"),s("#bodyPopup").find("#btnCall").trigger("click"),s("#bodyPopup").find("#btnCall").addClass("d-none"),s("#bodyPopup").find("#btnAccept").addClass("d-none"),s("#bodyPopup").removeClass("d-none"),s("#bodyPending").addClass("d-none")),s(".j-users_wrap").append(s("#users_tpl").html()),v().then((function(e){console.log("render user",e),t.users=e}),(function(e){console.warn(e)}));var i=_.template(s("#frames_tpl").html());s(".j-board").append(i({nameUser:t.caller.full_name})),QBMediaRecorder.isAvailable()||s(".j-record").hide(),A(),t.helpers.setFooterPosition()}}))}))}catch(e){console.log(e)}},bombam:function(){console.log("bombam");var e={username:currentUser.email,login:vcurrentUser.email};localStorage.setItem("data",JSON.stringify(e)),t.helpers.join(e).then((function(e){t.caller=e,console.log("Bombam CONNECTED",e),o.chat.connect({
1jid:o.chat.helpers.getUserJid(t.caller.id,r.CREDENTIALS.appId),password:"quickblox"},(function(e,o){if(e)_.isEmpty(t.currentSession)||(t.currentSession.stop({}),t.currentSession={}),t.helpers.changeFilter("#localVideo","no"),t.helpers.changeFilter("#main_video","no"),t.mainVideo=0,s(m).val("no"),t.calleesAnwered=[],t.calleesRejected=[],call.callTimer&&(s("#timer").addClass("invisible"),clearInterval(call.callTimer),call.callTimer=null,call.callTime=0,t.helpers.network={});else{localStorage.setItem("isAuth",!0),console.log("app.caller.full_name",t.caller.full_name),t.helpers.stateBoard=new t.helpers.StateBoard(".j-state_board",{title:"tpl_default",property:{name:t.caller.full_name}}),s(".j-users_wrap").append(s("#users_tpl").html()),v().then((function(e){console.log("render user",e),t.users=e}),(function(e){console.warn(e)}));var n=_.template(s("#frames_tpl").html());s(".j-board").append(n({nameUser:t.caller.full_name})),QBMediaRecorder.isAvailable()||s(".j-record").hide(),A(),t.helpers.setFooterPosition()}}))}))}});o.init(r.CREDENTIALS.appId,r.CREDENTIALS.authKey,r.CREDENTIALS.authSecret,r.CREDENTIALS.accountKey,r.APP_CONFIG),console.log(r.CREDENTIALS.appId,r.CREDENTIALS.authKey,r.CREDENTIALS.authSecret,r.CREDENTIALS.accountKey,r.APP_CONFIG),s(".j-version").text("v."+o.version+"."+o.buildNumber);var E="Uses: "+JSON.stringify(r.CREDENTIALS)+",";E+=" endpoints: "+(r.APP_CONFIG.endpoints?JSON.stringify(r.APP_CONFIG.endpoints):"test server"),s(".j-config").text(E);var w=_.invert(o.webrtc.PeerConnectionState);function I(){var e=document.getElementById("localVideo");if("object"==n(e)&&!e.srcObject||!t.currentSession)return!0;var o={audio:s(f).val()?s(f).val():void 0,video:s(g).val()?{exact:s(g).val()}:void 0};console.log("localVideo",e,o);t.currentSession.switchMediaTracks(o,(function(e,o){console.log("ERRRR",e),(e||!o.getAudioTracks().length&&!o.getVideoTracks().length)&&(t.currentSession.stop({}),t.helpers.stateBoard.update({title:"tpl_device_not_found",isError:"qb-error",property:{name:t.caller.full_name}}))}))}function j(e){return console.log("showMediaDevices"),new Promise((function(n,t){o.webrtc.getMediaDevices(e).then((function(o){console.log("get media");var t="videoinput"===e,r=s(t?g:f);if(r.empty(),o.length){for(var l=0;l!==o.length;++l){var a=o[l],i=document.createElement("option");i.value=a.deviceId,a.kind===e&&(i.text=a.label||(t?"Camera ":"Mic ")+(l+1),r.append(i))}s(".j-media_sources").removeClass("invisible")}else s(".j-media_sources").addClass("invisible");n(!0)})).catch((function(e){console.warn("getMediaDevices",e),t(!1)}))}))}function A(){return new Promise((function(e,o){navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then((function(o){j("videoinput").then((function(){return j("audioinput")})).then((function(){o.getTracks().forEach((function(e){e.stop()})),e()}))})).catch((function(o){console.warn("Video devices were shown without names (getUserMedia error)",o),j("videoinput").then((function(){return j("audioinput")})).then((function(){e()}))}))}))}t.router=new y,l.history.start(),console.log("start"),s(document).on("click",".j-users__refresh",(function(){var e=s(this);t.callees={},e.prop("disabled",!0),t.helpers.renderUsers.stop=!1,t.helpers.renderUsers.condition.page=1,v().then((function(o){t.users=o,e.prop("disabled",!1),t.helpers.setFooterPosition()}),(function(){e.prop("disabled",!1),t.helpers.setFooterPosition()}))})),s(document).on("click",".j-user",(function(){t.callees={};var e=s(this),o={id:+s.trim(e.data("id")),name:s.trim(e.data("name"))};e.hasClass("active")?(delete t.callees[o.id],e.removeClass("active")):(console.log("user.name",t.callees),t.callees[o.id]=o.name,console.log("user.name after",t.callees),e.addClass("active"))})),s(document).on("click",".j-actions",(function(){console.log("video",s(g).val()),t.callees={};var n=s(this),r=s(g),l=s(f),c=s(h),d=s.trim(s(h).val()),p="",m={audio:{deviceId:l.val()?l.val():void 0},video:{deviceId:r.val()?{exact:r.val()}:void 0},options:{muted:!0,mirror:!1},elemId:"localVideo"},v=s(this),b={id:+s.trim(v.data("id")),name:s.trim(v.data("name"))};
1if(console.log("user.name",t.callees),t.callees[b.id]=b.id,console.log("user.name after",t.callees),isAdmin&&"openpopup"==n.data("action"))e.open("/backoffice/calling/?calling=1&id="+b.id+"&name="+b.name,"popupWindow","width=600, height=400, scrollbars=yes");else if(isAdmin||"openpopup"!=n.data("action")){if(console.log("$btn.data('action')",n.data("action")),n.hasClass("hangup"))return console.log("HANG UP"),_.isEmpty(t.currentSession)?(console.log("no"),S&&a&&S.stop(),t.currentSession.stop({}),t.currentSession={},t.helpers.stateBoard.update({title:"tpl_default",property:{name:t.caller.full_name}}),t.helpers.setFooterPosition(),!1):(console.log("yes"),S&&a&&S.stop(),t.currentSession.stop({}),t.currentSession={},t.helpers.stateBoard.update({title:"tpl_default",property:{name:t.caller.full_name}}),t.helpers.setFooterPosition(),!1);if(!e.navigator.onLine)return t.helpers.stateBoard.update({title:"no_internet",isError:"qb-error"}),!1;if(console.log("user.name AA ",t.callees),_.isEmpty(t.callees))return s("#error_no_calles").modal("show").removeClass("fade"),!1;console.log("no2"),S&&a&&S.stop(),_.isEmpty(t.currentSession)||(t.currentSession.stop({}),t.currentSession={}),t.helpers.stateBoard.update({title:"tpl_default",property:{name:t.caller.full_name}}),t.helpers.setFooterPosition(),console.log("$btn.data('call')",n.data("call")),u="audio"===n.data("call"),t.currentSession=o.webrtc.createNewSession(Object.keys(t.callees),u?o.webrtc.CallType.AUDIO:o.webrtc.CallType.VIDEO,null,{bandwidth:d}),console.log("session ",t.currentSession),A(),u?(console.log("isAudio"),m={audio:!0,video:!1},document.querySelector('.j-actions[data-call="video"]').setAttribute("hidden",!0),s("#frameCalling").removeClass("d-none"),s("#frameVideo").addClass("d-none")):(console.log("!! isVideo !!"),s("#frameVideo").removeClass("d-none"),s("#frameCalling").addClass("d-none")),t.currentSession.getUserMedia(m,(function(r,l){if(console.log("ERRRR",r,l),r){console.log("STOP"),t.currentSession.stop({}),t.helpers.stateBoard.update({title:"tpl_device_not_found",isError:"qb-error",property:{name:t.caller.full_name}})}else{var a=[];t.currentSession.call({},(function(){if(e.navigator.onLine){console.log("online");var o=_.template(s("#callee_video").html());t.helpers.stateBoard.update({title:"calling"}),document.getElementById(i).play(),Object.keys(t.callees).forEach((function(e,n,r){p+=o({userID:e,name:t.callees[e],state:"connecting"}),a.push(e),console.log({pushRecipients:a})})),s(".j-callees").append(p),console.log("callees append"),c.attr("disabled",!0),n.addClass("hangup"),s("#btnHangup").addClass("hangup"),t.helpers.setFooterPosition()}else t.currentSession.stop({}),t.helpers.stateBoard.update({title:"connect_error",isError:"qb-error"})}));var d={notification_type:"push",user:{ids:a},environment:"production",message:o.pushnotifications.base64Encode(JSON.stringify({message:t.caller.full_name+" is calling you",ios_voip:"1",VOIPCall:"1"}))};console.log("param ",t.caller.full_name,d,a),o.pushnotifications.events.create(d,(function(e,o){console.log({response:o}),e?console.log({err:e}):console.log("Push Notification is sent.")}))}}))}else{console.log("if b");e.open("/calling/?calling=1&id="+b.id+"&name="+b.name,"popupWindow","width=600, height=400, scrollbars=yes")}})),s(document).on("click",".j-decline",(function(){_.isEmpty(t.currentSession)||(t.currentSession.reject({}),s(p).modal("hide"),document.getElementById(d).pause())})),s(document).on("click",".j-accept",(function(){console.log("main-accept"),u=t.currentSession.callType===o.webrtc.CallType.AUDIO;var n=s(this),r=s(g),l=s(f),a={audio:{deviceId:l.val()?l.val():void 0},video:{deviceId:r.val()?{exact:r.val()}:void 0},elemId:"localVideo",options:{muted:!0,mirror:!1}};if(isAdmin&&"openpopup"==n.data("action")){e.open("/backoffice/calling?calling=0","popupWindow","width=600, height=400, scrollbars=yes");s(p).modal("hide"),document.getElementById(d).pause()}else if(isAdmin||"openpopup"!=n.data("action")){console.log("main_video accept"),s("#frameVideo").removeClass("d-none"),s("#frameCalling").addClass("d-none");var i="";A(),t.currentSession.getUserMedia(a,(function(e,n){if(console.log("mediaParams , acc",e),e||!n.getAudioTracks().length||!u&&!n.getVideoTracks().length){t.currentSession.stop({}),t.helpers.stateBoard.update({title:"tpl_device_not_found",isError:"qb-error",property:{name:t.caller.full_name}})}else{var r=[t.currentSession.initiatorID],l=_.template(s("#callee_video").html());s(".j-actions").addClass("hangup"),s("#btnHangup").addClass("hangup"),s(h).attr("disabled",!0),console.log("VIDEOO"),t.currentSession.opponentsIDs.forEach((function(e,o,n){e!=t.currentSession.currentUserID&&r.push(e)})),r.forEach((function(e,n,r){var s=t.currentSession.connectionStateForUser(e),a=_.findWhere(t.users,{id:+e});null===document.getElementById("remote_video_"+e)&&(i+=l({userID:e,name:a?a.full_name:"userID "+e,state:t.helpers.getConStateName(s)}),s===o.webrtc.PeerConnectionState.CLOSED&&t.helpers.toggleRemoteVideoView(e,"clear"))})),s(".j-callees").append(i),t.helpers.stateBoard.update({title:"tpl_during_call",property:{name:t.caller.full_name}}),t.helpers.setFooterPosition(),t.currentSession.accept({})}}))}else{e.open("/calling?calling=0","popupWindow","width=600, height=400, scrollbars=yes");s(p).modal("hide"),document.getElementById(d).pause()}})),s(document).on("change",m,(function(){var e=s.trim(s(this).val());t.helpers.changeFilter("#localVideo",e),_.isEmpty(t.currentSession)||t.currentSession.update({filter:e})})),s(document).on("click",".j-confirm_media",(function(){I()})),s(".j-video_source,.j-video_source,.j-bandwidth,.j-filter").change((function(){I()})),s(document).on("click",".j-callees__callee__video",(function(){console.log("11111111111111111 callees__callee__video");var e=s(this),o=+s(this).data("user"),n=[];if(t.currentSession.peerConnections[o].stream&&!e.srcObject){if(e.hasClass("active"))return console.log("AAAAAAAAAAAAAAAA"),!1;console.log("BBBB"),S&&S.stop(),s(".j-callees__callee__video").removeClass("active"),e.addClass("active"),t.helpers.changeFilter("#main_video","no"),(n=_.intersection(e.attr("class").split(/\s+/),t.filter.names.split(/\s+/))).length&&t.helpers.changeFilter("#main_video",n[0]),t.currentSession.attachMediaStream("main_video",t.currentSession.peerConnections[o].stream),t.mainVideo=o}else console.log("CCC")})),s(document).on("click",'.j-caller__ctrl[data-target="screen"]',(function(){if(_.isEmpty(t.currentSession))return!1;var e=s(this),o=e.hasClass("active"),n=function(){navigator.mediaDevices.getUserMedia({video:!0}).then((function(o){r(o.getVideoTracks()[0]),e.removeClass("active"),e.html("Share Screen")}))},r=function(e){t.currentSession.localStream.getVideoTracks()[0].stop();var o=t.currentSession.localStream.clone();return o.removeTrack(o.getVideoTracks()[0]),o.addTrack(e),t.currentSession.localStream.getAudioTracks()[0].stop(),t.currentSession._replaceTracks(o),t.currentSession.localStream=o,!0};o?n():navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(o){var t=o.getVideoTracks()[0];t.onended=n,r(t),e.addClass("active"),e.html("Stop sharing")}))})),s(document).on("click",".j-caller__ctrl",(function(){console.log("mute");var e=s(this),o=e.hasClass("active");if(_.isEmpty(t.currentSession)||"screen"==e.data("target"))return!1;o?(console.log("not action 2"),e.removeClass("active"),t.currentSession.unmute(e.data("target"))):(console.log("not action 1"),e.addClass("active"),t.currentSession.mute(e.data("target")))})),s(document).on("click",".j-record",(function(){var e=s(this).hasClass("active");if(_.isEmpty(t.currentSession))return!1;if(QBMediaRecorder.isAvailable())if(e)S.stop();else{if(!t.currentSession.peerConnections[t.mainVideo])return!1;S=new QBMediaRecorder(b);var o=document.getElementById("main_video");"object"===n(o.srcObject)&&S.start(o.srcObject)}})),s(e).on("unload",(function(e){localStorage.removeItem("isAuth")})),o.chat.onDisconnectedListener=function(){console.log("onDisconnectedListener.")},o.webrtc.onCallStatsReport=function(e,o,n,t){console.group("onCallStatsReport"),console.log("userId: ",o),console.log("session: ",e),console.log("stats: ",n
1),console.groupEnd(),n.remote.video.bitrate?s("#bitrate_"+o).text("video bitrate: "+n.remote.video.bitrate):n.remote.audio.bitrate&&s("#bitrate_"+o).text("audio bitrate: "+n.remote.audio.bitrate)},o.webrtc.onSessionCloseListener=function(o){console.log("onSessionCloseListener: ",o),s(p).modal("hide"),document.getElementById(d).pause(),document.getElementById(i).pause(),document.getElementById(c).play(),s(".j-actions").removeClass("hangup"),s(".j-caller__ctrl").removeClass("active"),s(h).attr("disabled",!1),e.close(),s(".j-callees").empty(),s(".frames_callee__bitrate").hide(),t.currentSession.detachMediaStream("main_video"),t.currentSession.detachMediaStream("localVideo"),C=0,o.opponentsIDs.length>1?t.helpers.stateBoard.update({title:"tpl_call_stop",property:{name:t.caller.full_name}}):t.helpers.stateBoard.update({title:"tpl_default",property:{name:t.caller.full_name}}),document.querySelector(".j-actions[hidden]")&&document.querySelector(".j-actions[hidden]").removeAttribute("hidden"),document.querySelector(".j-caller__ctrl")&&document.querySelector(".j-caller__ctrl").removeAttribute("hidden")},o.webrtc.onUserNotAnswerListener=function(e,o){console.group("onUserNotAnswerListener."),console.log("UserId: ",o),console.log("Session: ",e),console.groupEnd();var n=_.findWhere(t.users,{id:+o});1===e.opponentsIDs.length?t.helpers.stateBoard.update({title:"p2p_call_stop",property:{name:n.full_name,currentName:t.caller.full_name,reason:"not answered"}}):s(".j-callee_status_"+o).text("No Answer")},o.webrtc.onCallListener=function(n,r){console.group("onCallListener."),console.log("Session: ",n),console.log("Extension: ",r),console.groupEnd(),t.currentSession=n,o.users.get(Number(n.initiatorID),(function(r,l){r?console.log(r):(console.log("app.users",l),t.users=[],t.users=l,s(p).modal("hide"),s.ajax({headers:{"X-CSRF-TOKEN":s('meta[name="csrf-token"]').attr("content")},type:"GET",url:urlPath+"/admin/"+l.full_name,success:function(e){if(e.status){var o=e.result;s(".j-ic_initiator").text(o.name)}}}),console.log("coming",l.full_name,t.users),console.log("currentSession",n,t.currentSession.state,n.currentUserID),t.currentSession.state!==o.webrtc.SessionConnectionState.CLOSED&&n.currentUserID!=t.users.id&&(console.log("yessss"),0!=new URLSearchParams(e.location.search).get("calling")?(s(p).modal("show").removeClass("fade"),document.getElementById(d).play()):(console.log("in else"),s("#bodyPopup").removeClass("d-none"),s("#bodyPending").addClass("d-none"),s("#bodyPopup").find("#btnAccept").trigger("click"),s("#bodyPopup").find("#btnCall").addClass("d-none"),s("#bodyPopup").find("#btnAccept").addClass("d-none"))))}))},o.webrtc.onRejectCallListener=function(e,o,n){if(t.currentSession.ID===e){console.group("onRejectCallListener."),console.log("UserId: "+o),console.log("Session: "+e),console.log("Extension: "+JSON.stringify(n)),console.groupEnd();var r=_.findWhere(t.users,{id:+o}),l=_.findWhere(t.users,{id:+e.currentUserID});if(1===e.opponentsIDs.length)t.helpers.stateBoard.update({title:"p2p_call_stop",property:{name:r.full_name,currentName:l.full_name,reason:"rejected the call"}});else{var a=_.findWhere(t.users,{id:+o});t.calleesRejected.push(a),s(".j-callee_status_"+o).text("Rejected")}}},o.webrtc.onStopCallListener=function(e,o,n){console.group("onStopCallListener."),console.log("UserId: ",o),console.log("Session: ",e),console.log("Extension: ",n),console.groupEnd(),t.helpers.notifyIfUserLeaveCall(e,o,"hung up the call","Hung Up"),S&&S.stop()},o.webrtc.onAcceptCallListener=function(e,o,n){console.group("onAcceptCallListener."),console.log("UserId: ",o),console.log("Session: ",e),console.log("Extension: ",n),console.log("main_video accept2"),console.groupEnd();var r=_.findWhere(t.users,{id:+o}),l=s.trim(s(m).val());document.getElementById(i).pause(),t.currentSession.update({filter:l}),t.calleesAnwered.push(r),t.currentSession.currentUserID===t.currentSession.initiatorID&&t.helpers.stateBoard.update({title:"tpl_call_status",property:{users:t.helpers.getUsersStatus()}})},o.webrtc.onRemoteStreamListener=function(e,n,r){console.group("onRemoteStreamListener."),console.log("userId: ",n
1),console.log("Session: ",e),console.log("Stream: ",r),console.groupEnd();var l=t.currentSession.connectionStateForUser(n),a=o.webrtc.PeerConnectionState;if(l===a.DISCONNECTED||l===a.FAILED||l===a.CLOSED)return!1;t.currentSession.peerConnections[n].stream=r,console.info("onRemoteStreamListener add video to the video element",n,r),t.currentSession.attachMediaStream("main_video",t.currentSession.peerConnections[n].stream),0===C&&(s("#remote_video_"+n).click(),t.mainVideo=n,++C),call.callTimer||(call.callTimer=setInterval((function(){call.updTimer.call(call)}),1e3)),s(".frames_callee__bitrate").show()},o.webrtc.onUpdateCallListener=function(e,o,n){console.group("onUpdateCallListener."),console.log("UserId: "+o),console.log("Session: "+e),console.log("Extension: "+JSON.stringify(n)),console.groupEnd(),t.helpers.changeFilter("#remote_video_"+o,n.filter),+t.mainVideo===o&&t.helpers.changeFilter("#main_video",n.filter)},o.webrtc.onSessionConnectionStateChangedListener=function(e,n,r){console.group("onSessionConnectionStateChangedListener."),console.log("UserID:",n),console.log("Session:",e),console.log("Сonnection state:",r,w[r]),console.groupEnd();var l=_.invert(o.webrtc.SessionConnectionState)[r],a=s(".j-callee_status_"+n),i=!1;if(r===o.webrtc.SessionConnectionState.CONNECTING&&a.text(l),r===o.webrtc.SessionConnectionState.CONNECTED&&(t.helpers.toggleRemoteVideoView(n,"show"),a.text(l)),r===o.webrtc.SessionConnectionState.COMPLETED&&(t.helpers.toggleRemoteVideoView(n,"show"),a.text("connected")),r===o.webrtc.SessionConnectionState.DISCONNECTED&&(t.helpers.toggleRemoteVideoView(n,"hide"),a.text("disconnected")),r===o.webrtc.SessionConnectionState.CLOSED){if(t.helpers.toggleRemoteVideoView(n,"clear"),t.mainVideo===n)for(var c in s("#remote_video_"+n).removeClass("active"),t.helpers.changeFilter("#main_video","no"),t.mainVideo=0,t.currentSession.peerConnections)if(c!=n&&void 0!==t.currentSession.peerConnections[c].stream&&t.currentSession.peerConnections[c].stream.active){t.currentSession.attachMediaStream("main_video",t.currentSession.peerConnections[c].stream),t.mainVideo=c;break}if(_.isEmpty(t.currentSession)||1!==Object.keys(t.currentSession.peerConnections).length&&n!==t.currentSession.initiatorID||(s(p).modal("hide"),document.getElementById(d).pause()),(i=_.every(t.currentSession.peerConnections,(function(e){return"closed"===e.iceConnectionState})))&&(t.helpers.changeFilter("#localVideo","no"),t.helpers.changeFilter("#main_video","no"),s(m).val("no"),t.calleesAnwered=[],t.calleesRejected=[],t.network[n]=null,console.log("YESS IT ME")),t.currentSession.currentUserID===t.currentSession.initiatorID&&!i){console.log("NOOO IT NOT");var u=_.findWhere(t.users,{id:+n});t.calleesAnwered=_.reject(t.calleesAnwered,(function(e){return e.id===+n})),t.calleesRejected.push(u),t.helpers.stateBoard.update({title:"tpl_call_status",property:{users:t.helpers.getUsersStatus()}})}(_.isEmpty(t.currentSession)||i)&&call.callTimer&&(s("#timer").addClass("invisible"),clearInterval(call.callTimer),call.callTimer=null,call.callTime=0,t.helpers.network={},console.log("NOOO IT NOT AAA"))}},o.webrtc.onDevicesChangeListener=function(){A().then(I)}}))}(window,window.QB,window.app,window.CONFIG,jQuery,Backbone))}});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.