var $jscomp={scope:{},findInternal:function(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(b.call(c,f,e,a))return{i:e,v:f}}return{i:-1,v:void 0}}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6-impl","es3");Ext.namespace("Zarafa.plugins.spreedwebrtc");
Zarafa.plugins.spreedwebrtc.SpreedPresence=Ext.extend(Zarafa.core.PresencePlugin,{url:"presence",cmd:"ping",headers:void 0,authenticationToken:void 0,lastAction:void 0,interval:6E4,getdelay:3E3,timeout:1E3,maxTimeout:3E5,presenceTask:void 0,presenceGetTask:void 0,currentTimeout:void 0,presencePending:!1,addressBookStore:null,presenceWatchingList:[],presenceWatchingListChanged:!1,presenceData:void 0,presenceEntryIdEmailAddressMap:{},presenceSmtpAddressEmailAddressMap:{},userids:{},webappPresenceUiSupport:void 0,
constructor:function(a){a=a||{};Ext.apply(a,{headers:{"Content-Type":"application/json; charset=utf-8;"}});Ext.apply(this,a);Zarafa.plugins.spreedwebrtc.SpreedPresence.superclass.constructor.call(this,a);container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/enable")&&(this.presenceTask=new Ext.util.DelayedTask(this.updatePresence,this),this.presenceGetTask=new Ext.util.DelayedTask(this.sendGetPresence,this),this.start())},initPlugin:function(){var a=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/enable");
this.webappPresenceUiSupport=Ext.isDefined(Zarafa.core.PresencePlugin)&&Ext.isDefined(Zarafa.core.data.UserIdObject);a&&!this.webappPresenceUiSupport&&(this.registerInsertionPoint("context.addressbook.gridpanel",this.createPresenceColumn,this),this.registerInsertionPoint("previewpanel.toolbar.recipientlinks",this.onRecipientLinksShow.createDelegate(this),this),this.registerInsertionPoint("context.mail.gridrow",this.createMailGridStatusIcon,this),Zarafa.core.data.ContentPanelMgr.on("createcontentpanel",
this.onNewContentPanel.createDelegate(this)));Zarafa.plugins.spreedwebrtc.SpreedPresence.superclass.initPlugin.apply(this,arguments)},createMailGridStatusIcon:function(a,b){b.get("sender_entryid");var c=b.get("sender_email_address"),c=this.getMailGridStatusIcon(c);return String.format('<td style="width: 24px;"><div class="grid_compact zarafa_mailgrid_presence_status {0}" style="height: 24px; width: 24px;">&nbsp;</div></td>',c)},createPresenceColumn:function(){this.refresh();return[{dataIndex:"status_spreed",
header:_("Spreed"),width:50,fixed:!0,renderer:this.presenceSpreedColumnRenderer}]},presenceSpreedColumnRenderer:function(a,b,c){b.css+="online"===a?"icon_spreed_status_online":"icon_spreed_status_offline"},presenceXmppColumnRenderer:function(a,b,c){b.css="online"===a?b.css+"icon_xmpp_status_available":"available"===a?b.css+"icon_xmpp_status_available":"away"===a?b.css+"icon_xmpp_status_away":"busy"===a?b.css+"icon_xmpp_status_busy":b.css+"icon_xmpp_status_unavailable"},start:function(){this.sendPresence()},
stop:function(){this.presenceTask.cancel()},update:function(){this.presenceTask.cancel();this.sendPresence()},refresh:function(){this.presenceGetTask.cancel();this.sendGetPresence()},refreshIfPresenceWatchingListChanged:function(){this.presenceWatchingListChanged&&(this.presenceWatchingListChanged=!1,this.refresh())},getNextTimeout:function(){this.currentTimeout=this.currentTimeout?2*this.currentTimeout:this.timeout;return this.currentTimeout=Math.min(this.maxTimeout,this.currentTimeout)},updatePresenceUI:function(a){if(null!==
container.mainPanel&&"undefined"!==typeof container.mainPanel&&!this.webappPresenceUiSupport&&(Ext.isObject(this.addressBookStore)&&this.updateGABContentPanel(),container.getMainPanel().findByType("zarafa.recipientlinks").forEach(function(a){a.isVisible()&&this.setStatusToRecipients(a)},this),a=container.getMainPanel().findByType("zarafa.mailgrid")[0],Ext.isObject(a))){var b=a.store.getRange(),c=a.view;b.forEach(function(a,b){var d=a.get("sender_entryid"),e=a.get("sender_email_address"),h=c.getRow(b).querySelector(".zarafa_mailgrid_presence_status");
this.updatePresenceWatchingList(e,d);Ext.isObject(h)&&this.setMailGridStatusIcon(h,e,d)},this)}},setMailGridStatusIcon:function(a,b,c){b=this.getMailGridStatusIcon(b,c);a.classList.remove("icon_spreed_status_online_");a.classList.remove("icon_spreed_status_offline");b&&a.classList.add(b)},getMailGridStatusIcon:function(a,b){if(this.isUserOnline(a,b,"spreed"))return"available"===this.getUserPresence(a,b,"spreed")?"icon_spreed_status_online":"icon_spreed_status_offline"},myselfIsOnlineInSpreed:function(){var a=
container.getPluginByName("spreedwebrtc");return Ext.isObject(a)?a.isOnlineInSpreed():!1},updatePresenceWatchingList:function(a,b,c,d){if(a&&0!==a.length&&!(-1<a.indexOf("@"))){var e=this.presenceWatchingList.indexOf(a);-1!==e||d?-1<e&&d&&this.presenceWatchingList.splice(e,1):(this.presenceWatchingList.push(a),this.presenceWatchingListChanged=!0);b&&0!==b.length&&(Ext.isObject(this.presenceEntryIdEmailAddressMap)&&(b in this.presenceEntryIdEmailAddressMap||(this.presenceEntryIdEmailAddressMap[b]=
a)),c&&0!==c.length&&Ext.isObject(this.presenceSmtpAddressEmailAddressMap)&&(c in this.presenceSmtpAddressEmailAddressMap||(this.presenceSmtpAddressEmailAddressMap[c]=a)))}},getUserPresence:function(a,b,c){return Ext.isObject(this.presenceData)&&((!a||!a.length||-1<a.indexOf("@"))&&Ext.isObject(this.presenceEntryIdEmailAddressMap)&&b in this.presenceEntryIdEmailAddressMap&&(a=this.presenceEntryIdEmailAddressMap[b]),a in this.presenceData&&c in this.presenceData[a])?this.presenceData[a][c].status:
"unknown"},getUserEmailAddressFromEntryId:function(a,b){Ext.isObject(this.presenceData)&&(!a||!a.length||-1<a.indexOf("@"))&&Ext.isObject(this.presenceEntryIdEmailAddressMap)&&b in this.presenceEntryIdEmailAddressMap&&(a=this.presenceEntryIdEmailAddressMap[b]);return a},isUserOnline:function(a,b,c){return Ext.isObject(this.presenceData)&&((!a||!a.length||-1<a.indexOf("@"))&&Ext.isObject(this.presenceEntryIdEmailAddressMap)&&b in this.presenceEntryIdEmailAddressMap&&(a=this.presenceEntryIdEmailAddressMap[b]),
a in this.presenceData&&c in this.presenceData[a])?"unavailable"!==this.presenceData[a][c].status:!1},onRecipientLinksShow:function(a,b){b.on("show",this.setStatusToRecipientsHandler,this)},setStatusToRecipientsHandler:function(a){this.setStatusToRecipients(a);this.refresh()},setStatusToRecipients:function(a){var b=a.el.query(".zarafa-recipient-link");Ext.isObject(a.store)&&a.store.getRange().forEach(function(a){var c=a.get("display_name"),e=a.get("email_address"),f=a.get("smtp_address"),g=a.get("entryid");
this.updatePresenceWatchingList(e,g,f);b.forEach(function(a){var b=a.innerHTML;-1<b.indexOf(c)&&-1<b.indexOf(f)&&this.setLinkStatusIcon(a,g,e)},this)},this);this.setStatustoSentLink()},setStatustoSentLink:function(){var a=container.getMainPanel().findByType("zarafa.sentinfolinks")[0];if(Ext.isDefined(a)){var b=a.record,c=b.get("sender_entryid"),b=b.get("sender_email_address");sentLinkElement=a.el.query(".zarafa-sentinfo-link")[0];this.setLinkStatusIcon(sentLinkElement,c,b)}},setLinkStatusIcon:function(a,
b,c){this.updatePresenceWatchingList(c,b);var d=this.isUserOnline(c,b,"spreed");a.classList.remove("icon_spreed_status_online_link");a.classList.remove("icon_spreed_status_offline_link");d&&(d=this.getUserPresence(c,b,"spreed"),this.getUserPresence(c,b,"xmpp"),"available"===d?a.classList.add("icon_spreed_status_online_link"):a.classList.add("icon_spreed_status_offline_link"))},updateGABContentPanel:function(){for(var a=this.addressBookStore.getRange(),b=0;b<a.length;b++){var c=a[b].get("entryid"),
d=a[b].get("email_address");a[b].get("smtp_address");this.updatePresenceWatchingList(d,c);d=this.isUserOnline(d,c,"spreed");this.updateGABUserStatus(c,d?"online":"offline")}},updateGABUserStatus:function(a,b){if(Ext.isObject(this.addressBookStore)){var c=this.addressBookStore.find("entryid",a);-1<c&&this.addressBookStore.getAt(c).set("status_spreed",b)}},onNewContentPanel:function(a){a=a.findByType("zarafa.addressbookcontentpanel")[0];Ext.isDefined(a)&&(this.addressBookStore=a.findByType("zarafa.addressbookgrid")[0].store,
a.mon(this.addressBookStore,"load",this.updateGABContentPanel.createDelegate(this)),a.on("destroy",this.onDestroyAddressBook.createDelegate(this)))},onDestroyAddressBook:function(){this.addressBookStore=null},getPresenceStatuses:function(a){for(var b=[],c,d=0;d<a.length;d++)"ZARAFA"===a[d].type?(this.updatePresenceWatchingList(a[d].username,a[d].entryid),c=this.getUserPresence(a[d].username,a[d].entryid,"spreed"),c="available"===c?Zarafa.core.data.PresenceStatus.ONLINE:"unavailable"===c?Zarafa.core.data.PresenceStatus.OFFLINE:
Zarafa.core.data.PresenceStatus.UNKNOWN,this.userids[a[d].username]=new Zarafa.core.data.UserIdObject({username:a[d].username,type:a[d].type,entryid:a[d].entryid,email_address:a[d].email_address})):c=Zarafa.core.data.PresenceStatus.UNKNOWN,b.push(c);return b},sendUpdates:function(){var a=[];this.presenceWatchingList.forEach(function(b){var c=null;this.userids[b]&&(c=this.userids[b].entryid);c=this.getUserPresence(b,c,"spreed");presenceStatus="available"===c?Zarafa.core.data.PresenceStatus.ONLINE:
"unavailable"===c?Zarafa.core.data.PresenceStatus.OFFLINE:Zarafa.core.data.PresenceStatus.UNKNOWN;this.userids[b]&&(b={user:new Zarafa.core.data.UserIdObject({username:this.userids[b].username,type:this.userids[b].type,entryid:this.userids[b].entryid,email_address:this.userids[b].email_address}),status:presenceStatus},a.push(b))},this);Zarafa.core.PresenceManager.updateStatuses(this.getName(),a)},requestAuthentication:function(){var a=new Zarafa.plugins.spreedwebrtc.data.PresenceResponseHandler;a.presence=
this;container.getRequest().singleRequest("pluginspreedwebrtcmodule","presenceauth",null,a)},prepareHttpRequest:function(a,b,c,d,e,f){f=new XMLHttpRequest;c||(c="http://192.168.112.130:1234/");f.open(d,c,!0);f.requestUrl=c;e=Ext.apply({},this.requestHeaders,e||this.defaultHeaders);for(var g in e)f.setRequestHeader(g,e[g]);f.requestHeaders=e;f.requestData=a;f.requestDataEncoded=b;return f},sendHttpRequest:function(a){var b=a.requestData;a.onreadystatechange=this.stateChange.createDelegate(this,[a]);
a.send(b)},updatePresence:function(){this.authenticationToken=void 0;this.sendPresence()},scheduleUpdatePresence:function(){this.authenticationToken=void 0;delete this.currentTimeout;this.getNextTimeout();this.presenceTask.delay(this.interval)},scheduleGetPresence:function(){delete this.currentTimeout;this.getNextTimeout();this.presenceGetTask.delay(this.getdelay)},sendPresence:function(){if(!this.presencePending)if(void 0===this.authenticationToken)this.requestAuthentication();else{var a;a=this.myselfIsOnlineInSpreed()?
"available":"unavailable";a={AuthenticationToken:this.authenticationToken,Type:"UserStatus",UserStatus:[{user_id:container.getUser().getUserName(),spreed:{status:a,message:""}}]};a=this.prepareHttpRequest(Ext.encode(a),!0,this.url,"PUT",this.headers);this.presencePending=!0;this.lastAction="sendPresence";this.sendHttpRequest(a)}},sendGetPresence:function(){if(!this.presencePending)if(void 0===this.authenticationToken)this.requestAuthentication();else{this.updatePresenceUI();var a=[];this.presenceWatchingListChanged=
!1;this.presenceWatchingList.forEach(function(b){a.push({user_id:b})},this);var b=this.prepareHttpRequest(Ext.encode({AuthenticationToken:this.authenticationToken,Type:"UserStatus",UserStatus:a}),!0,this.url,"POST",this.headers);this.presencePending=!0;this.lastAction="sendGetPresence";this.sendHttpRequest(b)}},stateChange:function(a){container.getResponseRouter();var b;if(4==a.readyState){this.presencePending=!1;switch(a.status){case 401:this.failure();return;case 500:this.failure();return;case 200:break;
default:this.failure();return}a.responseText&&(b=Ext.decode(a.responseText));Ext.isEmpty(b)||(void 0===this.presenceData&&(this.presenceData={}),this.myselfIsOnlineInSpreed()?(b.UserStatus.forEach(function(a){this.presenceData[a.user_id]=a},this),this.sendUpdates()):this.presenceData={});"sendPresence"===this.lastAction?this.scheduleGetPresence():"sendGetPresence"===this.lastAction&&(this.lastAction=void 0,this.updatePresenceUI(),this.scheduleUpdatePresence())}},failure:function(a){a=this.getNextTimeout();
this.presenceTask.delay(a)}});Zarafa.onReady(function(){container.registerPlugin(new Zarafa.core.PluginMetaData({name:"spreedpresence",displayName:_("SpreedPresence Plugin"),allowUserVisible:!1,allowUserDisable:!1,pluginConstructor:Zarafa.plugins.spreedwebrtc.SpreedPresence}))});Ext.namespace("Zarafa.plugins.spreedwebrtc");
Zarafa.plugins.spreedwebrtc.SpreedWebRTC=Ext.extend(Zarafa.core.Plugin,{whatsNew:{version:"3.0",features:[{title:"Web Meetings",description:"Kopano Web Meetings has been enabled. You can use it to have face-to-face video calls with anyone in- and outside your organization. You can access Web Meetings by clicking the green video icon.<BR>This icon also shows your online status when you log in.",image_url:"resources/img/introduction_c.jpg",icon_url:"resources/icons/webmeetings_icon.png"},{title:"Pop out to new browser window",
description:"Web Meetings can now be used in a separate browser window! Using this enables you to have your meeting window side-by-side with any other application and makes it easy to access your email or calendar, or work in any other application while in your web meeting!",image_url:"resources/img/pop_out_c.jpg",icon_url:"resources/icons/webmeetings_icon.png"},{title:"Control panel",description:"The Web Meetings button has been extended with sound control and direct meeting room access features.",
image_url:"resources/img/control_panel_c.jpg",icon_url:"resources/icons/webmeetings_icon.png"}]},spreedButton:null,spreedExternalWindow:null,spreedWebRTCWindowRoomMain:null,spreedWebRTCWindowRoomMeetingRequest:null,spreedWebRTCWindowRoomInstantMeeting:null,spreedWebRTCWindows:null,spreedVolumeButton:null,spreedDomain:"",persistentNotifiers:{},presenceList:[],notifyEl:void 0,isRunningInDeskapp:!1,popingOut:!1,goingOffline:!1,showSpreedWebRTC:!1,constructor:function(a){a=a||{};Zarafa.plugins.spreedwebrtc.SpreedWebRTC.superclass.constructor.call(this,
a)},initPlugin:function(){window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));var a=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/domain/");this.spreedDomain=a?a:window.location.origin;this.registerInsertionPoint("context.settings.categories",this.createSettingCategories,this);this.registerInsertionPoint("main.toolbar.actions.last",this.createToolBarButton,this);this.registerInsertionPoint("context.addressbook.contextmenu.actions",
this.createContextItemSpreedChat,this);this.registerInsertionPoint("context.addressbook.contextmenu.actions",this.createContextItemSpreedMessage,this);this.registerInsertionPoint("context.common.recipientfield.contextmenu.actions",this.createContextItemSpreedChat.createDelegate(this),this);this.registerInsertionPoint("context.common.recipientfield.contextmenu.actions",this.createContextItemSpreedMessage.createDelegate(this),this);this.registerInsertionPoint("context.mail.contextmenu.options",this.createContextItemSpreedChat,
this);this.registerInsertionPoint("context.mail.contextmenu.options",this.createContextItemSpreedMessage,this);this.registerInsertionPoint("context.calendar.appointmentcontentpanel.toolbar.actions",this.createNewSpreedWebRTCMeetingURLFromAppointmentButton,this);this.registerInsertionPoint("context.calendar.appointmentcontentpanel.toolbar.actions",this.createOpenSpreedWebRTCMeetingURLFromAppointmentButton,this);this.registerInsertionPoint("context.mail.mailcreatecontentpanel.toolbar.actions",this.createNewSpreedWebRTCMeetingURLFromMailcreateButton,
this);this.registerInsertionPoint("common.htmleditor.tinymceconfig",this.setTinymceConfig,this);Zarafa.core.data.SharedComponentType.addProperty("plugin.spreedwebrtc.dialog.spreedwindow");window.addEventListener("message",this.onPostMessage.bind(this));window.addEventListener("unload",this.onUnload.createDelegate(this));Zarafa.plugins.spreedwebrtc.SpreedWebRTC.superclass.initPlugin.apply(this,arguments)},createSettingCategories:function(){return{xtype:"spreedwebrtc.settingsmaincategory"}},initSpreed:function(a){this.spreedButton=
a;Ext.isDefined(window.deskappOpenWindow)&&(this.isRunningInDeskapp=!0);container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/autostart/")&&(a=a.menu.items,this.spreedWebRTCWindowRoomMain=new Zarafa.plugins.spreedwebrtc.SpreedWebRTCWindow,this.spreedWebRTCWindowRoomMain.setButton(a.get("spreed_main_room_menu_item")),this.spreedWebRTCWindowRoomMain.setSpreedDomain(this.spreedDomain),this.spreedWebRTCWindowRoomMeetingRequest=new Zarafa.plugins.spreedwebrtc.SpreedWebRTCWindow,this.spreedWebRTCWindowRoomMeetingRequest.setButton(a.get("spreed_meeting_request_room_menu_item")),
this.spreedWebRTCWindowRoomMeetingRequest.setSpreedDomain(this.spreedDomain),this.spreedWebRTCWindowRoomInstantMeeting=new Zarafa.plugins.spreedwebrtc.SpreedWebRTCWindow,this.spreedWebRTCWindowRoomInstantMeeting.setButton(a.get("spreed_instant_meeting_room_menu_item")),this.spreedWebRTCWindowRoomInstantMeeting.setSpreedDomain(this.spreedDomain),this.spreedWebRTCWindows=[this.spreedWebRTCWindowRoomMain,this.spreedWebRTCWindowRoomMeetingRequest,this.spreedWebRTCWindowRoomInstantMeeting],this.spreedVolumeButton=
a.get("spreed_webrtc_volume"),this.setSpreedWebRTCWindowsSoundSettings(),this.createOpenSpreedWebRTC(),this.spreedWebRTCWindowRoomMain.hideSpreedWebRTC())},reset:function(){this.spreedWebRTCWindowRoomMain.spreedWindow=null;this.spreedButton.setIconClass("icon_spreed_webrtc");this.presenceList=[];this.updatePresenceList()},updateInCallState:function(){var a=!1,b=!1;this.spreedWebRTCWindows.forEach(function(c){c.isInCall()&&(a=!0);c.isWindowOpen()&&(b=!0)},this);a?this.spreedButton.setIconClass("icon_spreed_webrtc_incall"):
b?this.spreedButton.setIconClass("icon_spreed_webrtc_active"):this.spreedButton.setIconClass("icon_spreed_webrtc")},createToolBarButton:function(){return[{newMenuIndex:10,xtype:"splitbutton",scale:"large",listeners:{afterrender:function(a){container.getPluginByName("spreedwebrtc").initSpreed(a)}},tooltip:_("Kopano Web Meetings"),iconCls:"icon_spreed_webrtc",handler:this.createOpenSpreedWebRTC,scope:this,menu:[{id:"spreed_main_room_menu_item",overflowText:_("Kopano Web Meetings"),iconCls:"icon_spreed_webrtc_menu_inactive",
text:_("Kopano Web Meetings"),handler:this.focusSpreedWebRTCMeetingRoomMain,disabled:!0,scope:this},{id:"spreed_meeting_request_room_menu_item",overflowText:_("Kopano Web Meetings meeting request room"),iconCls:"icon_spreed_webrtc_menu_inactive",text:_("Meeting request room"),handler:this.focusSpreedWebRTCMeetingRoomMeetingRequest,disabled:!0,scope:this},{id:"spreed_instant_meeting_room_menu_item",overflowText:_("Kopano Web Meetings instant meeting room"),iconCls:"icon_spreed_webrtc_menu_inactive",
text:_("Instant meetings room"),handler:this.focusSpreedWebRTCMeetingRoomInstantMeeting,disabled:!0,scope:this},{id:"spreed_webrtc_volume",overflowText:_("Sound control"),iconCls:"icon_spreed_webrtc_volume_high",text:_("Sound control"),scope:this,menu:[{id:"spreed_webrtc_volume_high",overflowText:_("All notifications"),iconCls:"icon_spreed_webrtc_volume_high",text:_("All sounds"),handler:this.onWebmeetingsSelectVolume,scope:this},{id:"spreed_webrtc_volume_low",overflowText:_("Only incoming sounds"),
iconCls:"icon_spreed_webrtc_volume_low",text:_("Only incoming sounds"),handler:this.onWebmeetingsSelectVolume,scope:this},{id:"spreed_webrtc_volume_mute",overflowText:_("No sounds"),iconCls:"icon_spreed_webrtc_volume_mute",text:_("No sounds"),handler:this.onWebmeetingsSelectVolume,scope:this}]}]}]},createContextItemSpreedChat:function(a){return{xtype:"zarafa.conditionalitem",text:_("Start video call"),overflowText:_("Start video call"),iconCls:"icon_spreed_videocall_context_menu_item",singleSelectOnly:!0,
handler:this.startSpreedMeeting,insertionName:a,beforeShow:this.setContextItemVisibility,scope:this}},createContextItemSpreedMessage:function(a){return{xtype:"zarafa.conditionalitem",text:_("Start chat"),overflowText:_("Start chat"),iconCls:"icon_spreed_textchat_context_menu_item",singleSelectOnly:!0,handler:this.sendSpreedMessage,insertionName:a,beforeShow:this.setContextItemVisibility,scope:this}},setContextItemVisibility:function(a,b){var c=b[0]||b,d=!1,e="context.mail.contextmenu.options"===a.insertionName?
c.get("sender_entryid"):c.get("entryid"),c="context.mail.contextmenu.options"===a.insertionName?c.get("sender_email_address"):c.get("email_address"),f=container.getUser().meta.entryid,g=container.getPluginByName("spreedpresence");Ext.isObject(g)&&(d=g.isUserOnline(c,e,"spreed"));a.setVisible(d&&e!==f)},createNewSpreedWebRTCMeetingURLFromAppointmentButton:function(){return{xtype:"button",text:_("Add web meeting"),iconCls:"icon_spreed_webmeeting_button",handler:this.createNewSpreedWebRTCMeetingURLFromAppointment,
scope:this,plugins:["zarafa.recordcomponentupdaterplugin"],update:function(a,b){this.record=a}}},isNewSpreedWebRTCMeetingURLFromAppointmentButtonVisible:function(a){return!0},createNewSpreedWebRTCMeetingURLFromAppointment:function(a){var b=a.record;a=a.ownerCt.ownerCt.appointmentTab.editorField;b.get("subject");var c=b.get("commonstart"),c=c?c.getTime():null,d=new Zarafa.plugins.spreedwebrtc.data.SpreedWebrtcResponseHandler;d.appointment=b;d.editorField=a;d.plugin=this;d.scope=this.spreedWebRTCWindowRoomMeetingRequest;
this.displayInfoMask();container.getRequest().singleRequest("pluginspreedwebrtcmodule","meetingurl",{start:c},d)},createOpenSpreedWebRTCMeetingURLFromAppointmentButton:function(){return{xtype:"button",ref:"openSpreedWebRTCMeetingBtn",text:_("Join web meeting"),iconCls:"icon_spreed_webmeeting_button",handler:this.openSpreedWebRTCMeetingURLFromAppointment,scope:this,plugins:["zarafa.recordcomponentupdaterplugin"],update:function(a,b){this.record=a;a.get("location")?this.setDisabled(!1):this.setDisabled(!0)}}},
setTinymceConfig:function(a,b){Ext.isEmpty(b.config.extended_valid_elements)&&(b.config.extended_valid_elements="");var c=b.config.extended_valid_elements.match(/(^|\s|,)(a\[(.*?)\])/);Ext.isEmpty(c)?(Ext.isEmpty(b.config.extended_valid_elements)||(b.config.extended_valid_elements+=","),b.config.extended_valid_elements+="a[class|name|href|target|title|onclick|style]"):c[3].match(/\bstyle\b/gi)||(b.config.extended_valid_elements=b.config.extended_valid_elements.replace(c[2],"a["+c[3]+"|style]"))},
isOpenSpreedWebRTCMeetingURLFromAppointmentButtonVisible:function(a){return a.get("location")?!0:!1},openSpreedWebRTCMeetingURLFromAppointment:function(a){var b=a.record;a=b.get("subject");b=b.get("location");a||(a=_("Untitled"));this.spreedWebRTCWindowRoomMeetingRequest.isWindowOpen()?Ext.MessageBox.show({title:_("Kopano Web Meetings"),msg:_("Your Web Meetings meeting request room is currently in use."),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.INFO}):this.spreedWebRTCWindowRoomMeetingRequest.createOpenSpreedWebRTC(a,
b)},displayInfoMask:function(){this.notifyEl||(this.notifyEl=container.getNotifier().notify("info.saving",_("Web meetings"),_("requesting web meetings URL, please be patient ..."),{persistent:!0}))},hideInfoMask:function(a){if(this.notifyEl&&(container.getNotifier().notify("info.saving",null,null,{destroy:!0,reference:this.notifyEl}),delete this.notifyEl,!1!==a)){var b=container.getNotifier().notify("info.saved",_("The URL for your web meeting is created."),_("The link is pasted into your mail and the \u2018Location\u2019 field. You can open the URL in a new window in case your browser is blocking pop-ups."),
{persistent:!0});setTimeout(function(){b&&(container.getNotifier().notify("info.saved",null,null,{destroy:!0,reference:b}),delete b)},1E4)}},createNewSpreedWebRTCMeetingURLFromMailcreateButton:function(){return{xtype:"button",text:_("Add web meeting"),iconCls:"icon_spreed_webmeeting_button",handler:this.createNewSpreedWebRTCMeetingURLFromMailcreate,scope:this,plugins:["zarafa.recordcomponentupdaterplugin"],update:function(a,b){this.record=a}}},isNewSpreedWebRTCMeetingURLFromMailcreateButtonVisible:function(a){return!0},
createNewSpreedWebRTCMeetingURLFromMailcreate:function(a){var b=a.ownerCt.ownerCt.editorField;a=a.record.data.subject;var c=(new Date).getTime(),d=new Zarafa.plugins.spreedwebrtc.data.SpreedWebrtcResponseHandler;a||(a=_("Untitled"));this.spreedWebRTCWindowRoomInstantMeeting.isWindowOpen()?Ext.MessageBox.show({title:_("Kopano Web Meetings"),msg:_("Your instant meeting room is currently in use."),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.INFO}):(this.spreedWebRTCWindowRoomInstantMeeting.createOpenSpreedWebRTC(a,
""),d.openSpreedWebRTCMeetingURLForMailcreate=this.spreedWebRTCWindowRoomInstantMeeting.setSpreedWebRTCUrlAndFocus,d.editorField=b,d.plugin=this,d.scope=this.spreedWebRTCWindowRoomInstantMeeting,this.displayInfoMaskMailcreate(),container.getRequest().singleRequest("pluginspreedwebrtcmodule","meetingurl",{start:c},d))},displayInfoMaskMailcreate:function(){this.notifyEl||(this.notifyEl=container.getNotifier().notify("info.saving",_("Web meetings"),_("requesting web meetings URL, please be patient ..."),
{persistent:!0}))},hideInfoMaskMailcreate:function(a){if(this.notifyEl&&(container.getNotifier().notify("info.saving",null,null,{destroy:!0,reference:this.notifyEl}),delete this.notifyEl,!1!==a)){var b=container.getNotifier().notify("info.saved",_("The URL for your web meeting is created."),_("The link is pasted into your mail. You can open the URL in a new window in case your browser is blocking pop-ups."),{persistent:!0});setTimeout(function(){b&&(container.getNotifier().notify("info.saved",null,
null,{destroy:!0,reference:b}),delete b)},1E4)}},displayInfoWebmeetingsIsOffline:function(){var a=container.getNotifier().notify("info.saved",_("Web meetings"),_("You are offline in Web Meetings"),{persistent:!0});setTimeout(function(){a&&(container.getNotifier().notify("info.saved",null,null,{destroy:!0,reference:a}),delete a)},1E4)},isOnlineInSpreed:function(a){return this.spreedWebRTCWindowRoomMain&&this.spreedWebRTCWindowRoomMain.isWindowOpen()?!0:!1},refreshPresenceList:function(a){var b=container.getPluginByName("spreedpresence");
Ext.isObject(b)&&(this.presenceList=a.slice(),this.spreedWebRTCWindowRoomMain.isWindowOpen()&&this.presenceList.push(container.getUser().meta.entryid),b.updatePresence(this.presenceList))},updatePresenceList:function(a,b){var c=container.getPluginByName("spreedpresence"),d=this.presenceList.indexOf(a);Ext.isObject(c)&&(-1===d&&"online"===b?this.presenceList.push(a):-1<d&&"offline"===b&&this.presenceList.splice(d,1),c.updatePresence(this.presenceList),c.update())},requestAuthentication:function(){var a=
new Zarafa.plugins.spreedwebrtc.data.SpreedWebrtcResponseHandler;a.spreedWebRTCWindow=this.spreedWebRTCWindowRoomMain;container.getRequest().singleRequest("pluginspreedwebrtcmodule","authenticate",null,a)},notify:function(a,b,c){if(Ext.isDefined(b))var d=b.displayName,e=a+"_"+b.id+"_"+c;switch(a){case "chatmessage":this.displayNotification(_("New chat message from ")+d,e,!0,!0,c);break;case "incomingpickuptimeout":this.displayNotification(_("Missed call from ")+d,e,!0,!0,c);this.destroyNotifier("incoming_"+
b.id,this.persistentNotifiers["incoming_"+b.id+"_"+c].element);break;case "incoming":this.displayNotification(_("Incoming call from ")+d,e,!0,!1,c);break;case "busy":this.displayNotification(d+_(" is busy"),e,!1,!1,c);break;case "reject":this.displayNotification(d+_(" rejected your call"),e,!1,!1,c);break;case "pickuptimeout":this.displayNotification(d+_(" does not pick up"),e,!1,!1,c);break;case "refusedoraccepted":this.destroyIncomingNotifiers()}},displayNotification:function(a,b,c,d,e){c?(Ext.isDefined(this.persistentNotifiers[b])||
(this.persistentNotifiers[b]={},this.persistentNotifiers[b].updateCount=1,this.persistentNotifiers[b].roomid=e),d&&(a+=" ("+this.persistentNotifiers[b].updateCount+")"),this.persistentNotifiers[b].updateCount+=1,this.persistentNotifiers[b].element=container.getNotifier().notify("info.spreednotifier",_("Web Meetings"),a,{persistent:!0,update:this.persistentNotifiers[b].element,reference:this.persistentNotifiers[b].element,listeners:{click:this.destroyNotifier.bind(this,b)}})):container.getNotifier().notify("info.spreednotifier",
_("Web Meetings"),a,{persistent:!1,listeners:{click:this.destroyNotifier.bind(this,b)}})},destroyNotifier:function(a,b){var c;this.persistentNotifiers[a]&&(c=this.persistentNotifiers[a].roomid,this.persistentNotifiers[a]=null,delete this.persistentNotifiers[a]);this.spreedWebRTCWindows.forEach(function(a){a.inRoomid(c)&&a.focusSpreedWebRTC(!0)},this);container.getNotifier().notify("info.spreednotifier",null,null,{reference:b,destroy:!0})},destroyIncomingNotifiers:function(){var a=this.persistentNotifiers;
for(id in a)0===id.indexOf("incoming")&&this.destroyNotifier(id,a[id].element)},createOpenSpreedWebRTC:function(a){var b=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe"),c=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window");if(!this.isRunningInDeskapp)b=!0,c=!1;else if(!b&&!c)if(a&&!this.spreedWebRTCWindowRoomMain.isInCallActivity()){if(this.showSpreedWebRTC=!0,!this.spreedWebRTCWindowRoomMain.isWindowVisible()){this.spreedWebRTCWindowRoomMain.isWindowOpen()?
this.spreedWebRTCWindowRoomMain.focusSpreedWebRTC():this.initSpreedInIFrame(!0);this.requestInitSpreedInExternalBrowserWindow();return}}else b=!0,c=!1;b?this.spreedWebRTCWindowRoomMain.isWindowOpen()?this.spreedWebRTCWindowRoomMain.focusSpreedWebRTC():this.initSpreedInIFrame(!0):this.spreedWebRTCWindowRoomMain.isWindowOpen()?this.spreedWebRTCWindowRoomMain.focusSpreedWebRTC():this.isRunningInDeskapp?this.initSpreedInExternalBrowserWindow(this.spreedButton):a?c||b?this.initSpreedInExternalBrowserWindow(this.spreedButton):
this.requestInitSpreedInExternalBrowserWindow():this.displayInfoWebmeetingsIsOffline()},checkRequestInitSpreedInExternalBrowserWindow:function(){var a=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe"),b=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window");!this.isRunningInDeskapp||a||b||this.spreedWebRTCWindowRoomMain.isInCallActivity()||(this.showSpreedWebRTC=this.spreedWebRTCWindowRoomMain.isWindowVisible(),this.requestInitSpreedInExternalBrowserWindow())},
requestInitSpreedInExternalBrowserWindow:function(){var a="",b=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe"),c=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window"),a=b?a+(_("You selected Web Meetings to be launched inside WebApp during the previous launch.")+"<br>"):c?a+(_("You selected Web Meetings to be launched in a new browser window during the previous launch.")+"<br>"):a+(_("The latest version of Kopano Web Meetings has a new feature.")+
"<br>");_("You can now choose where to open Web Meetings by default.");_("Open your webmeeting by default in a:");Zarafa.plugins.spreedwebrtc.dialogs.SettingsMessageBox.settingsMessageBox(_("Kopano Web Meetings"),_("The latest version of Kopano Web Meetings has a new feature."),_("You can now choose where to open Web Meetings by default:"),[{boxLabel:_("In Deskapp")+' <span class="k-spreed-transparency50">('+_("current behaviour")+")</span>",id:"iframe",name:"select",checked:!0},{boxLabel:_("In a new window"),
id:"popout",name:"select"}],null,_("You can always edit this configuration in : Settings -> Web Meetings"),[{text:_("Apply"),name:"apply"}],this.onRequestInitSpreedInExternalBrowserWindow,this)},onRequestInitSpreedInExternalBrowserWindow:function(a,b){"apply"===a?"popout"==b.radioGroup.getValue().id?(container.getSettingsModel().set("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe",!1),container.getSettingsModel().set("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window",!0),this.spreedWebRTCWindowRoomMain.isWindowOpen()?
this.spreedWebRTCWindowRoomMain.isIFrameWindow()?this.popoutSpreedInExternalBrowserWindow():this.showSpreedWebRTC&&!this.spreedWebRTCWindowRoomMain.isWindowVisible()&&this.spreedWebRTCWindowRoomMain.focusSpreedWebRTC():this.initSpreedInExternalBrowserWindow(this.spreedButton)):(container.getSettingsModel().set("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe",!0),container.getSettingsModel().set("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window",!1),this.spreedWebRTCWindowRoomMain.isWindowOpen()?
this.showSpreedWebRTC&&!this.spreedWebRTCWindowRoomMain.isWindowVisible()&&this.spreedWebRTCWindowRoomMain.focusSpreedWebRTC():this.initSpreedInIFrame(this.showSpreedWebRTC)):this.spreedWebRTCWindowRoomMain.isWindowOpen()?this.showSpreedWebRTC&&!this.spreedWebRTCWindowRoomMain.isWindowVisible()&&this.spreedWebRTCWindowRoomMain.focusSpreedWebRTC():this.initSpreedInIFrame(this.showSpreedWebRTC);this.showSpreedWebRTC=!1},requestToReopenSpreedWindow:function(){var a=_("You have closed Web Meetings and are now offline.")+
"<br>"+_(" Do you wish to reopen and choose where to open Web Meetings or do you wish to remain offline?");Zarafa.common.dialogs.MessageBox.addCustomButtons({title:_("Kopano Web Meetings"),msg:a,icon:Ext.MessageBox.QUESTION,fn:this.onRequestToReopenSpreedWindow,customButton:[{text:_("Choose where to reopen Web Meetings"),name:"reopen"},{text:_("Stay offline"),name:"offline"}],scope:this})},onRequestToReopenSpreedWindow:function(a){"reopen"===a&&this.requestInitSpreedInExternalBrowserWindow()},initSpreedInIFrame:function(a){var b=
container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/debug"),c=container.getSettingsModel().get("zarafa/v1/main/language").substr(0,2),b=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/url/")+"?lang="+(c||"en")+(b?"&debug":"");this.spreedWebRTCWindowRoomMain.useIFrame(!0);this.spreedWebRTCWindowRoomMain.isWindowOpen()||this.spreedButton.setIconClass("icon_spreed_webrtc");this.spreedWebRTCWindowRoomMain.createOpenSpreedWebRTC(null,b);a||this.spreedWebRTCWindowRoomMain.hideSpreedWebRTC()},
initSpreedInExternalBrowserWindow:function(a){a=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/debug");var b=container.getSettingsModel().get("zarafa/v1/main/language").substr(0,2);a=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/url/")+"?lang="+(b||"en")+(a?"&debug":"");this.spreedWebRTCWindowRoomMain.useIFrame(!1);this.spreedButton.setIconClass("icon_spreed_webrtc");this.spreedWebRTCWindowRoomMain.createOpenSpreedWebRTC(null,a)},requestPopoutSpreedInExternalBrowserWindow:function(a){this.spreedWebRTCWindowRoomMain.isInCallActivity()?
Ext.MessageBox.show({title:_("Kopano Web Meetings"),msg:_("Unable to pop-out during a video call."),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.INFO}):container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/popout_info_lost_data_do_not_show")?this.popoutSpreedInExternalBrowserWindow():Zarafa.plugins.spreedwebrtc.dialogs.MessageBox.checkboxMessageBox(_("Pop out Kopano Web Meetings"),_("Be aware that Web Meetings restarts and data will be lost (chat & video call) when opening this window into a new browser window."),
_("Do not show this message again"),this.onRequestPopoutSpreedInExternalBrowserWindow,[{text:_("Open in browser window"),name:"popout"},{text:_("Cancel"),name:"cancel"}],this,!1)},onRequestPopoutSpreedInExternalBrowserWindow:function(a,b){b.checkbox.checked&&container.getSettingsModel().set("zarafa/v1/plugins/spreedwebrtc/popout_info_lost_data_do_not_show",!0);"popout"===a&&this.popoutSpreedInExternalBrowserWindow()},popoutSpreedInExternalBrowserWindow:function(){this.popingOut=!0;this.spreedWebRTCWindowRoomMain.popoutWindow()},
goOffline:function(){this.goingOffline=!0;this.spreedWebRTCWindowRoomMain.closeWindow()},focusSpreedWebRTCMeetingRoomMain:function(a){this.spreedWebRTCWindowRoomMain.focusSpreedWebRTC()},focusSpreedWebRTCMeetingRoomMeetingRequest:function(a){this.spreedWebRTCWindowRoomMeetingRequest.focusSpreedWebRTC()},focusSpreedWebRTCMeetingRoomInstantMeeting:function(a){this.spreedWebRTCWindowRoomInstantMeeting.focusSpreedWebRTC()},onWebmeetingsSelectVolume:function(a){switch(a.id){case "spreed_webrtc_volume_high":container.getSettingsModel().set("zarafa/v1/plugins/spreedwebrtc/sound_settings",
"high");break;case "spreed_webrtc_volume_low":container.getSettingsModel().set("zarafa/v1/plugins/spreedwebrtc/sound_settings","low");break;case "spreed_webrtc_volume_mute":container.getSettingsModel().set("zarafa/v1/plugins/spreedwebrtc/sound_settings","mute")}this.setSpreedWebRTCWindowsSoundSettings()},getSpreedWebRTCWindowsSoundSettings:function(){return container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/sound_settings")},setSpreedWebRTCWindowsSoundSettings:function(){var a=this.getSpreedWebRTCWindowsSoundSettings();
switch(a){case "mute":this.spreedVolumeButton.setIconClass("icon_spreed_webrtc_volume_mute");break;case "high":this.spreedVolumeButton.setIconClass("icon_spreed_webrtc_volume_high");break;default:this.spreedVolumeButton.setIconClass("icon_spreed_webrtc_volume_low")}this.spreedWebRTCWindows.forEach(function(b){b.isWindowOpen()&&b.setSpreedWebRTCSoundSettings(a)},this)},onUnload:function(){this.closeExternalSpreedWebRTCWindows()},closeExternalSpreedWebRTCWindows:function(){this.spreedWebRTCWindows.forEach(function(a){a.isIFrameWindow()||
a.closeWindow()},this)},startSpreedMeeting:function(a){a=a.getRecords();a=a[0]||a;a=a.store instanceof Zarafa.mail.MailStore?a.get("sender_entryid"):a.get("entryid");a=container.getPluginByName("spreedpresence").getUserEmailAddressFromEntryId("",a);var b=Ext.WindowMgr.getActive();this.sendPostMessage({type:"startCall",userId:a});Ext.isObject(b)&&0<b.findByType("zarafa.addressbookcontentpanel").length&&b.close();this.spreedWebRTCWindowRoomMain.focusSpreedWebRTC(!0)},sendSpreedMessage:function(a){a=
a.getRecords();a=a[0]||a;a=a.store instanceof Zarafa.mail.MailStore?a.get("sender_entryid"):a.get("entryid");a=container.getPluginByName("spreedpresence").getUserEmailAddressFromEntryId("",a);var b=Ext.WindowMgr.getActive();this.sendPostMessage({type:"startChat",userId:a});Ext.isObject(b)&&0<b.findByType("zarafa.addressbookcontentpanel").length&&b.close();this.spreedWebRTCWindowRoomMain.focusSpreedWebRTC(!0)},sendPostMessage:function(a){this.spreedWebRTCWindowRoomMain.isWindowOpen()&&this.spreedWebRTCWindowRoomMain.sendPostMessage(a,
this.spreedDomain)},requestUsersStatusFromSpreed:function(){this.sendPostMessage({type:"requestBuddyList"})},bidSharedComponent:function(a,b){var c=-1;switch(a){case Zarafa.core.data.SharedComponentType["plugin.spreedwebrtc.dialog.spreedwindow"]:c=1}return c},getSharedComponent:function(a,b){var c;switch(a){case Zarafa.core.data.SharedComponentType["plugin.spreedwebrtc.dialog.spreedwindow"]:c=Zarafa.plugins.spreedwebrtc.dialogs.SpreedContentPanel}return c},onPostMessage:function(a){var b=a.data;if(a.origin==
this.spreedDomain)switch(b.type){case "requestAuthentication":this.requestAuthentication();this.updatePresenceList();break;case "chat":this.notify(b.chat,b.from,b.roomid);"incoming"==b.chat?this.spreedWebRTCWindows.forEach(function(a){if(a.inRoomid(b.roomid))a.onIncoming(b.userId,b.chat)},this):"refusedoraccepted"==b.chat&&this.spreedWebRTCWindows.forEach(function(a){a.inRoomid(b.roomid)&&a.callRefusedOrAccepted(b.userId,b.chat)},this);break;case "authentication":"success"==b.authentication&&(b.roomid||
(this.popingOut=!1,this.spreedButton.setIconClass("icon_spreed_webrtc_active"),this.spreedWebRTCWindowRoomMain.onReadySpreedWebRTC()),this.spreedWebRTCWindows.forEach(function(a){if(a.inRoomid(b.roomid)){a.onReadySpreedWebRTC();var c=this.getSpreedWebRTCWindowsSoundSettings();a.setSpreedWebRTCSoundSettings(c)}},this));break;case "userStatusChanged":this.updatePresenceList(b.userId,b.newStatus);this.spreedWebRTCWindows.forEach(function(a){if(a.inRoomid(b.roomid))a.onUserEnteredRoom(b.userId,b.newStatus)},
this);break;case "callEstablished":this.spreedWebRTCWindows.forEach(function(a){if(a.inRoomid(b.roomid))a.onCallEstablished(b.userId,b.callEstablished)},this);this.updateInCallState();break;case "calling":this.spreedWebRTCWindows.forEach(function(a){if(a.inRoomid(b.roomid))a.onCalling(b.userId,b.calling)},this);break;case "callDone":this.spreedWebRTCWindows.forEach(function(a){if(a.inRoomid(b.roomid))a.onCallDone(b.userId,b.callDone)},this);this.updateInCallState();b.roomid||this.checkRequestInitSpreedInExternalBrowserWindow();
break;case "sendBuddyList":this.refreshPresenceList(b.list);break;case "roomChanged":this.spreedWebRTCWindows.forEach(function(a){if(a.inRoomid(b.roomid))a.onReadySpreedWebRTC()},this);break;case "unload":container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe");a=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window");var c=this.spreedWebRTCWindowRoomMain.wasReady();this.spreedWebRTCWindows.forEach(function(a){a.inRoomid(b.roomid)&&
a.updateMenuOnUnload()},this);b.roomid||((this.spreedButton.setIconClass("icon_spreed_webrtc"),this.isRunningInDeskapp)?c&&(!this.popingOut&&a?this.displayInfoWebmeetingsIsOffline():this.popingOut||this.goingOffline||this.initSpreedInIFrame(),this.goingOffline&&(this.goingOffline=!1,this.displayInfoWebmeetingsIsOffline())):(this.popingOut||this.goingOffline||this.initSpreedInIFrame(),this.goingOffline&&(this.goingOffline=!1,this.displayInfoWebmeetingsIsOffline())))}}});
Zarafa.onReady(function(){container.registerPlugin(new Zarafa.core.PluginMetaData({name:"spreedwebrtc",displayName:_("Web Meetings Plugin"),pluginConstructor:Zarafa.plugins.spreedwebrtc.SpreedWebRTC}));container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/enable")||(container.getSettingsModel().set("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe",!1),container.getSettingsModel().set("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window",!1),container.getSettingsModel().set("zarafa/v1/plugins/spreedwebrtc/popout_info_lost_data_do_not_show",
!1))});Ext.namespace("Zarafa.plugins.spreedwebrtc");
Zarafa.plugins.spreedwebrtc.SpreedWebRTCWindow=Ext.extend(Object,{subject:void 0,spreedWebRTCWindow:null,button:null,base_text:null,url:null,roomid:null,isIFrame:!1,spreedDomain:null,spreedWindow:null,wasopen:!1,wasready:!1,incoming:!1,calling:!1,inCall:!1,runningInDeskApp:!1,userIds:[],init:function(){},setButton:function(a){this.button=a;this.base_text=a.text;return this},useIFrame:function(a){this.isIFrame=a},setSpreedDomain:function(a){this.spreedDomain=a},isIFrameWindow:function(){return this.isIFrame},
isWindowOpen:function(){return this.isIFrame?null!=this.spreedWindow:this.spreedWebRTCWindow&&!this.spreedWebRTCWindow.closed},isWindowVisible:function(){return this.isIFrame?null!=this.spreedWindow&&this.spreedWindow.ownerCt.isVisible():this.isWindowOpen()},inRoomid:function(a){return null!==this.roomid&&a==this.roomid||""==this.roomid&&null==a},isIncoming:function(){return this.incoming},isCalling:function(){return this.calling},isInCall:function(){return this.inCall},isInCallActivity:function(){return this.isIncoming()||
this.isCalling()||this.isInCall()},wasOpen:function(){return this.wasopen},wasReady:function(){return this.wasready},createOpenSpreedWebRTC:function(a,b){var c;this.subject=a;Ext.isDefined(window.deskappOpenWindow)&&(this.runningInDeskApp=!0,"/"==b.substr(0,1)&&(b=window.location.origin+b));if(b)if(this.url=b,c=document.createElement("a"),c.href=b,c.pathname){if(c=c.pathname.split("/"))this.roomid=c.slice(-1)[0]}else this.roomid="";if(this.isIFrame)null==this.spreedWindow?(Zarafa.core.data.UIFactory.openLayerComponent(Zarafa.core.data.SharedComponentType["plugin.spreedwebrtc.dialog.spreedwindow"],
null,{manager:Ext.WindowMgr}),this.enablePopout(),this.spreedWindow.enableTool("offline")):this.focusSpreedWebRTC();else if(this.isWindowOpen())this.spreedWebRTCWindow.location.href=b,this.runningInDeskApp?this.spreedWebRTCWindow.nw.Window.get().focus():this.spreedWebRTCWindow.focus();else{var d=this;this.runningInDeskApp?(this.button&&(this.subject?this.button.setText(this.subject):this.button.setText(this.base_text)),b&&(this.wasopen=!0,window.deskappOpenWindow(b,function(a){a&&(d.spreedWebRTCWindow=
a,d.wasopen=!0)},{height:768,width:1024,inject_js_start:"inject_start.js",inject_js_end:"inject_webmeetings_end.js"}))):this.spreedWebRTCWindow=window.open(b,"_blank","location=no,height=768,width=1024,scrollbars=yes,status=yes");this.button&&(this.subject?this.button.setText(this.subject):this.button.setText(this.base_text))}this.wasopen=!0},setSpreedWebRTCUrlAndFocus:function(a,b){this.spreedWebRTCWindow&&(this.runningInDeskApp?this.spreedWebRTCWindow.nw.Window.get().focus():this.spreedWebRTCWindow.focus());
if(a)if(this.url=a,this.roomid=b,this.spreedWebRTCWindow)this.spreedWebRTCWindow.location.href=a;else if(this.runningInDeskApp){var c=this;window.deskappOpenWindow(a,function(a){a&&(c.spreedWebRTCWindow=a)},{height:768,width:1024,inject_js_start:"inject_start.js",inject_js_end:"inject_webmeetings_end.js"})}},focusSpreedWebRTC:function(a){this.isIFrame?null==this.spreedWindow?this.createOpenSpreedWebRTC():this.spreedWindow.ownerCt.isVisible()&&!a?this.spreedWindow.ownerCt.hide():this.spreedWindow.ownerCt.show():
this.runningInDeskApp?this.spreedWebRTCWindow.nw.Window.get().focus():this.spreedWebRTCWindow.focus()},hideSpreedWebRTC:function(){this.isIFrame&&this.spreedWindow.ownerCt.hide()},disablePopout:function(){this.isIFrame&&(this.spreedWindow.disableTool("popout"),this.spreedWindow.setToolTipForTool("popout",_("Unable to pop-out during a video call")))},enablePopout:function(){this.isIFrame&&(this.spreedWindow.enableTool("popout"),this.spreedWindow.setToolTipForTool("popout",_("Pop out Kopano Web Meetings")))},
onReadySpreedWebRTC:function(){this.button.setDisabled(!1);this.wasready=this.wasopen=!0},onUserEnteredRoom:function(a,b){var c=this.subject;if(c){for(var d=this.userIds.length-1;0<=d;d--)this.userIds[d]===a&&this.userIds.splice(d,1);"online"==b&&this.userIds.push(a);0<this.userIds.length&&(c+=" - "+this.userIds[0]);2==this.userIds.length&&(c+=_(" and 1 other"));2<this.userIds.length&&(d=this.userIds.length-1,c+=String.format(_(" and {0} others"),d.toString()));this.button.setText(c)}},onIncoming:function(){this.incoming=
!0;this.disablePopout()},callRefusedOrAccepted:function(){this.incoming=!1;this.enablePopout()},onCalling:function(){this.calling=!0;this.disablePopout()},onCallEstablished:function(){this.button.setIconClass("icon_spreed_webrtc_menu_opened");this.inCall=!0;this.disablePopout()},onResetCallState:function(){this.inCall=this.calling=this.incoming=!1},onCallDone:function(){this.button.setIconClass("icon_spreed_webrtc_menu_inactive");this.onResetCallState();this.enablePopout()},updateMenuOnUnload:function(){this.wasopen&&
(this.button.setDisabled(!0),this.button.setText(this.base_text),this.wasready=this.wasopen=!1)},sendPostMessage:function(a,b){b||(b=this.spreedDomain);this.isIFrame?Ext.isObject(this.spreedWindow)&&this.spreedWindow.spreedIFrame.getEl().dom.contentWindow.postMessage(a,b):this.isWindowOpen()&&this.spreedWebRTCWindow.postMessage(a,b)},setSpreedWebRTCSoundSettings:function(a){if(this.isWindowOpen()){switch(a){case "mute":a={incomingMessages:!1,incomingCall:!1,roomJoinLeave:!1};break;case "high":a={incomingMessages:!0,
incomingCall:!0,roomJoinLeave:!0};break;default:a={incomingMessages:!0,incomingCall:!0,roomJoinLeave:!1}}this.sendPostMessage({type:"soundSettings",soundSettings:a})}},popoutWindow:function(){this.isIFrame&&this.isWindowOpen()&&!this.isInCallActivity()&&(spreedWindow=this.spreedWindow,this.spreedWindow=null,this.useIFrame(!1),this.createOpenSpreedWebRTC(this.subject,this.url),spreedWindow.close())},closeWindow:function(){this.isIFrame?this.isWindowOpen()&&(this.spreedWindow.close(),this.onResetCallState()):
this.isWindowOpen()&&(this.spreedWebRTCWindow.close(),this.onResetCallState())}});Ext.namespace("Zarafa.plugins.spreedwebrtc.data");Zarafa.plugins.spreedwebrtc.data.PresenceResponseHandler=Ext.extend(Zarafa.core.data.AbstractResponseHandler,{doInfo:function(a){a.presenceauth&&(a=a.presenceauth,this.presence.authenticationToken=a.timestamp+":"+a.emailaddress+":"+a.authtoken.toUpperCase(),this.presence.sendPresence())}});Ext.reg("spreedwebrtc.presenceresponsehandler",Zarafa.plugins.spreedwebrtc.data.PresenceResponseHandler);
Ext.namespace("Zarafa.plugins.spreedwebrtc.data");
Zarafa.plugins.spreedwebrtc.data.SpreedWebrtcResponseHandler=Ext.extend(Zarafa.core.data.AbstractResponseHandler,{doInfo:function(a){var b=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/domain");b||(b=window.location.origin);a.authentication?(a=a.authentication,this.spreedWebRTCWindow.sendPostMessage({type:"authentication",authentication:{userid:a.emailaddress,timestamp:a.timestamp,secret:a.secret,fullname:container.getUser().getFullName(),buddyPicture:a.buddyPicture||"",turn_ttl:a.turn_ttl,
turn_username:a.turn_username,turn_password:a.turn_password,turn_urls:a.turn_urls}},b)):a.meetingurl&&(b=document.createElement("a"),b.href=a.meetingurl.url,b=b.href,Ext.isEmpty(this.appointment)||this.appointment.set("location",b),this.editorField.isHtmlEditor()?this.addHtmlInvitation(b):this.addPlainTextInvitation(b),this.plugin.hideInfoMaskMailcreate(!0),this.openSpreedWebRTCMeetingURLForMailcreate.call(this.scope,b,a.meetingurl.roomid))},addHtmlInvitation:function(a){var b=this.editorField.getEditor(),
c=b.defaultFontFamily,b=b.defaultFontSize;a='<style>span.webmeetings-invitation a{text-decoration:none;}</style><p style="margin: 0px; padding: 0px; data-mce-style="margin: 0px; padding: 0px;"><span class="webmeetings-invitation" style="font-family:'+c+"; font-size:"+b+'; data-mce-style="font-family:'+c+"; font-size:"+b+";>"+_("I'd like to invite you to join my web meeting. You can join the meeting by clicking this button:")+'<br><br><a target="_blank" href="'+a+'"><span style="border-bottom:1px solid #d5d5d5; display:inline-block;"><span style="border-right:1px solid #d5d5d5; border-bottom:1px solid #a6a6a6; display:inline-block;"><span style="border-width:9px;border-style:solid;border-color:#e6e6e6;display:inline-block; height: 18px; font-family: tahoma,arial,helvetica,sans-serif; font-size:0; color: black; text-decoration:none; background: #e6e6e6;" data-mce-style="border-width:9px;border-style:solid;border-color:#e6e6e6;display:inline-block; height: 18px;font-family: tahoma,arial,helvetica,sans-serif; font-size:0; color: black; text-decoration:none; background: #e6e6e6;"><span style="padding:3px 6px 3px 0; height:12px; width:18px; display:inline-block;" data-mce-style="padding:2px 6px 0 0; height:12px; display:inline-block;"><span \tstyle="width: 12px;height: 12px;background: #23cb02;border-radius: 3px;display:inline-block;" data-mce-style="width: 12px;height: 12px;background: #23cb02;border-radius: 3px;display:inline-block;"></span><span \tstyle="width: 0px;height: 4px;border-top-width:4px;border-top-style:solid;border-top-color:transparent;border-bottom-width:4px;border-bottom-style:solid;border-bottom-color:transparent;border-right-width:6px;border-right-style:solid;border-right-color:#23cb02;display:inline-block;" data-mce-style="width: 0px;height: 4px;border-top-width:4px;border-top-style:solid;border-top-color:transparent;border-bottom-width:4px;border-bottom-style:solid;border-bottom-color:transparent;border-right-width:6px;border-right-style:solid;border-right-color:#23cb02;display:inline-block;"></span></span><span \tstyle="font-size: 10pt;line-height: 18px;display: inline-block;height: 18px;" data-mce-style="font-size: 10pt;line-height: 18px;display: inline-block;height: 18px;">'+
_("Join Web Meeting")+"</span></span></span></span></a><br><br>"+_("{{Kopano Web Meetings}} provides the best experience in Google Chrome, Firefox, Chromium or Iridium.").replace(/{{(.*)}}/,'<a target="_blank" href="https://kopano.com/products/webmeetings/" style="text-decoration:none;"><span style="color:#00b4f1; font-weight:bold; text-decoration:none;" data-mce-style="color:#00b4f1; font-weight:bold; text-decoration:none;">$1</span></a>')+"</span></p>";this.editorField.insertAtCursor(a)},addPlainTextInvitation:function(a){this.editorField.insertAtCursor("\n"+
_("\ufeffI'd like to invite you to join my web meeting. You can join the meeting by copying this link to your browsers address bar:")+"\n\n"+a+"\n\n"+_("Kopano Web Meetings provides the best experience in Google Chrome, Firefox, Chromium or Iridium.")+"\n\n"+_("https://kopano.com/products/webmeetings")+"\n")}});Ext.reg("spreedwebrtc.responsehandler",Zarafa.plugins.spreedwebrtc.data.SpreedWebrtcResponseHandler);Ext.namespace("Zarafa.plugins.spreedwebrtc.dialogs");
Zarafa.plugins.spreedwebrtc.dialogs.MessageBox=Ext.apply({},Ext.MessageBox,{customButton:void 0,initDialog:function(a){var b=Ext.MessageBox.getDialog();b.on("hide",function(a){a.removeAll()},b,{single:!0});b.on("destroy",function(a){a.removeAll()},b,{single:!0});b.on("beforeshow",function(b){b.add(a)},b,{single:!0})},checkboxMessageBox:function(a,b,c,d,e,f,g){b=Ext.create({xtype:"displayfield",autoHeight:!0,autoWidth:!0,value:b,hideLabel:!0,htmlEncode:!0});var h=Ext.create({xtype:"checkbox",name:"do_not_show_again",
boxLabel:c,value:g});this.initDialog([{xtype:"container",anchor:"100% 100%",items:[b,h]}]);var k=Ext.MessageBox.getDialog();this.customButton=k.getFooterToolbar().add(e);this.checkbox=h;Ext.MessageBox.show({title:a,fn:function(a){Ext.callback(d,f||window,[a,h.getValue()],1)},customButton:e,minWidth:480,scope:f,prompt:!1,value:g});Ext.isEmpty(this.customButton)||Ext.each(this.customButton,function(a){k.mon(a,"click",Ext.createDelegate(this.onButtonClick,this,[d,h.checked,f],!0),this)},this);k.on("hide",
this.onDestroy,this,{single:!0});k.on("destroy",this.onDestroy,this,{single:!0});return this},onButtonClick:function(a,b,c,d,e){a=a.name||"cancel";Ext.MessageBox.hide();c.call(e,a,this)},onDestroy:function(a){if(!Ext.isEmpty(this.customButton)){for(var b=0;b<this.customButton.length;b++)a.getFooterToolbar().remove(this.customButton[b]);this.customButton=[]}}});Ext.namespace("Zarafa.plugins.spreedwebrtc.dialogs");
Zarafa.plugins.spreedwebrtc.dialogs.SettingsMessageBox=Ext.apply({},Ext.MessageBox,{customButton:void 0,initDialog:function(a){var b=Ext.MessageBox.getDialog();b.on("hide",function(a){a.removeAll()},b,{single:!0});b.on("destroy",function(a){a.removeAll()},b,{single:!0});b.on("beforeshow",function(b){b.add(a)},b,{single:!0})},settingsMessageBox:function(a,b,c,d,e,f,g,h,k){b=Ext.create({xtype:"displayfield",cls:"k-spreed-label1",autoHeight:!0,autoWidth:!0,value:b,hideLabel:!0,htmlEncode:!0,renderer:function(a){return a.replace(/\n/g,
"<br>")}});c=Ext.create({xtype:"displayfield",cls:"k-spreed-label2",autoHeight:!0,autoWidth:!0,value:c,hideLabel:!0,htmlEncode:!0,renderer:function(a){return a.replace(/\n/g,"<br>")}});var m=Ext.create({xtype:"radiogroup",cls:"k-spreed-radiogroup",hideLabel:!0,columns:1,items:d,value:e});d=Ext.create({xtype:"displayfield",cls:"k-spreed-label3",autoHeight:!0,autoWidth:!0,value:f,hideLabel:!0,htmlEncode:!0,renderer:function(a){return a.replace(/\n/g,"<br>")}});this.initDialog([{xtype:"container",anchor:"100% 100%",
items:[b,c,m,d]}]);var l=Ext.MessageBox.getDialog();l.getEl().addClass("k-spreed-settings-messagebox");this.customButton=l.getFooterToolbar().add(g);this.radioGroup=m;Ext.MessageBox.show({title:a,fn:function(a){Ext.callback(h,k||window,[a,m.getValue()],1)},customButton:g,minWidth:480,scope:k,prompt:!1,value:e});Ext.isEmpty(this.customButton)||Ext.each(this.customButton,function(a){l.mon(a,"click",Ext.createDelegate(this.onButtonClick,this,[h,m.getValue(),k],!0),this)},this);l.on("hide",this.onDestroy,
this,{single:!0});l.on("destroy",this.onDestroy,this,{single:!0});return this},onButtonClick:function(a,b,c,d,e){a=a.name||"cancel";Ext.MessageBox.hide();c.call(e,a,this)},onDestroy:function(a){if(!Ext.isEmpty(this.customButton)){for(var b=0;b<this.customButton.length;b++)a.getFooterToolbar().remove(this.customButton[b]);this.customButton=[]}a.getEl().removeClass("k-spreed-settings-messagebox")}});Ext.namespace("Zarafa.plugins.spreedwebrtc.dialogs");
Zarafa.plugins.spreedwebrtc.dialogs.SpreedContentPanel=Ext.extend(Zarafa.core.ui.ContentPanel,{toolDisabledClass:"k-tool-disabled",constructor:function(a){var b=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/debug"),c=container.getSettingsModel().get("zarafa/v1/main/language").substr(0,2),b=container.getSettingsModel().get("zarafa/v1/plugins/spreedwebrtc/url/")+"?lang="+(c||"en")+(b?"&debug":"");a=a||{};Ext.applyIf(a,{layout:"fit",title:_("Kopano Web Meetings"),width:800,height:500,
listeners:{scope:this,beforerender:this.onBeforeRenderWindow,render:this.onRenderWindow,close:this.onCloseWindow},items:[{autoEl:{tag:"iframe",height:"100%",src:b,allowfullscreen:!0},ref:"spreedIFrame"}]});Zarafa.plugins.spreedwebrtc.dialogs.SpreedContentPanel.superclass.constructor.call(this,a)},initComponent:function(){Zarafa.plugins.spreedwebrtc.dialogs.SpreedContentPanel.superclass.initComponent.call(this);container.getPluginByName("spreedwebrtc").spreedWebRTCWindowRoomMain.spreedWindow=this},
onBeforeRenderWindow:function(a){a.tools=[{id:"offline",qtip:_("Go offline"),handler:this.onGoOfflineClick,scope:this},{id:"popout",handler:this.onPopoutClick,scope:this},{id:"close",handler:this.onCloseClick,scope:this}]},onRenderWindow:function(a){Ext.isDefined(a.tools)&&Ext.isDefined(a.tools.offline)&&(a.tools.offline.dom.innerText=_("Go offline"))},onCloseWindow:function(a){container.getPluginByName("spreedwebrtc").reset()},onGoOfflineClick:function(a,b){b.hasClass(this.toolDisabledClass)||(console.log("offline"),
container.getPluginByName("spreedwebrtc").goOffline())},onPopoutClick:function(a,b){b.hasClass(this.toolDisabledClass)||(console.log("popout"),container.getPluginByName("spreedwebrtc").requestPopoutSpreedInExternalBrowserWindow())},onCloseClick:function(a,b){b.hasClass(this.toolDisabledClass)||(console.log("close"),this.ownerCt.hide())},disableTool:function(a){this.ownerCt.tools[a].addClass(this.toolDisabledClass)},enableTool:function(a){this.ownerCt.tools[a].removeClass(this.toolDisabledClass)},
setToolTipForTool:function(a,b){this.ownerCt.tools[a].dom.qtip=b},removeToolTipForTool:function(a){this.ownerCt.tools[a].dom.qtip=void 0}});Ext.reg("spreedwebrtc.window",Zarafa.plugins.spreedwebrtc.dialogs.SpreedContentPanel);Ext.namespace("Zarafa.plugins.spreedwebrtc.settings");
Zarafa.plugins.spreedwebrtc.settings.SettingsMainCategory=Ext.extend(Zarafa.settings.ui.SettingsCategory,{constructor:function(a){a=a||{};Ext.applyIf(a,{title:dgettext("plugin_spreedwebrtc","Web Meetings"),categoryIndex:1,iconCls:"icon_webmeetings_settings_category",items:[{xtype:"spreedwebrtc.settingswebmeetingswidget"},container.populateInsertionPoint("context.settings.category.spreedwebrtc",this)]});Zarafa.plugins.spreedwebrtc.settings.SettingsMainCategory.superclass.constructor.call(this,a)}});
Ext.reg("spreedwebrtc.settingsmaincategory",Zarafa.plugins.spreedwebrtc.settings.SettingsMainCategory);Ext.namespace("Zarafa.plugins.spreedwebrtc.settings");
Zarafa.plugins.spreedwebrtc.settings.SettingsWebmeetingsWidget=Ext.extend(Zarafa.settings.ui.SettingsWidget,{constructor:function(a){a=a||{};Ext.applyIf(a,{title:_("Web Meetings settings"),layout:"form",items:[]});Ext.isDefined(window.deskappOpenWindow)?a.items.splice(0,0,{xtype:"displayfield",hideLabel:!0,value:_("You can now choose where to open Web Meetings by default in DeskApp")+":"},{xtype:"radiogroup",name:"location",ref:"openingWebmeetingsField",columns:1,hideLabel:!0,items:[{xtype:"radio",
name:"openingWebmeetings",inputValue:"iframe",boxLabel:_("In Deskapp")},{xtype:"radio",name:"openingWebmeetings",inputValue:"popout",boxLabel:_("In a new window")}],listeners:{change:this.onRadioChange,scope:this}}):a.items.splice(0,0,{xtype:"box",autoEl:{tag:"a",href:"https://www.spreed.me/extension/",target:"_blank",html:"Install Spreed.Me Extension"},ref:"screenshareExtensionDownload",fieldLabel:_("Download location of the screen sharing extension"),width:200});Zarafa.plugins.spreedwebrtc.settings.SettingsWebmeetingsWidget.superclass.constructor.call(this,
a)},update:function(a){this.model=a;var b=a.get("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe");a=a.get("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window");Ext.isDefined(window.deskappOpenWindow)&&(b&&this.openingWebmeetingsField.setValue("iframe"),a&&this.openingWebmeetingsField.setValue("popout"))},updateSettings:function(a){Ext.isDefined(window.deskappOpenWindow)&&("popout"==this.openingWebmeetingsField.getValue().inputValue?(a.set("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe",
!1),a.set("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window",!0)):(a.set("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe",!0),a.set("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window",!1)))},onPreviewSelect:function(a,b){if(this.model){var c=b.get(a.valueField);this.model.get(a.name)!==c&&this.model.set(a.name,c)}},onCheck:function(a,b){this.model&&this.model.get(a.name)!==b&&this.model.set(a.name,b)},onRadioChange:function(a,b){"popout"==b.inputValue?(this.model.set("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe",
!1),this.model.set("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window",!0)):(this.model.set("zarafa/v1/plugins/spreedwebrtc/last_start_in_iframe",!0),this.model.set("zarafa/v1/plugins/spreedwebrtc/last_start_in_external_window",!1))}});Ext.reg("spreedwebrtc.settingswebmeetingswidget",Zarafa.plugins.spreedwebrtc.settings.SettingsWebmeetingsWidget);//# sourceMappingURL=kopano-webapp-plugin-meetings-3.0.4.0.js.map
