/home/ivoiecob/email.hirewise-va.com/static/js/MailWebclient.app.dc58fd47f61cb4d6cede.min.js
(self.webpackChunkafterlogic_aurora_platform=self.webpackChunkafterlogic_aurora_platform||[]).push([[9381],{"2wN8":(e,t,s)=>{"use strict";var i=s("p09A"),o=s("yU9o"),n=s("KIwC"),r=s("Fj7m");function a(){this.defaultAccount=r.getDefault(),this.visible=i.observable(!!this.defaultAccount&&this.defaultAccount.oServer.bSetExternalAccessServers),this.externalAccessImapServer=i.observable(this.visible()?this.defaultAccount.oServer.sExternalAccessImapServer:""),this.externalAccessImapPort=i.observable(this.visible()?this.defaultAccount.oServer.iExternalAccessImapPort:143),this.externalAccessImapAlterPort=i.observable(this.visible()&&this.defaultAccount.oServer.iExternalAccessImapAlterPort>0?this.defaultAccount.oServer.iExternalAccessImapAlterPort:""),this.externalAccessImapUseSsl=i.observable(!!this.visible()&&this.defaultAccount.oServer.bExternalAccessImapUseSsl),this.externalAccessPop3Server=i.observable(this.visible()?this.defaultAccount.oServer.sExternalAccessPop3Server:""),this.externalAccessPop3Port=i.observable(this.visible()?this.defaultAccount.oServer.iExternalAccessPop3Port:110),this.externalAccessPop3AlterPort=i.observable(this.visible()&&this.defaultAccount.oServer.iExternalAccessPop3AlterPort>0?this.defaultAccount.oServer.iExternalAccessPop3AlterPort:""),this.externalAccessPop3UseSsl=i.observable(!!this.visible()&&this.defaultAccount.oServer.bExternalAccessImapUseSsl),this.externalAccessSmtpServer=i.observable(this.visible()?this.defaultAccount.oServer.sExternalAccessSmtpServer:""),this.externalAccessSmtpPort=i.observable(this.visible()?this.defaultAccount.oServer.iExternalAccessSmtpPort:25),this.externalAccessSmtpAlterPort=i.observable(this.visible()&&this.defaultAccount.oServer.iExternalAccessSmtpAlterPort>0?this.defaultAccount.oServer.iExternalAccessSmtpAlterPort:""),this.externalAccessSmtpUseSsl=i.observable(!!this.visible()&&this.defaultAccount.oServer.bExternalAccessSmtpUseSsl),this.credentialsHintText=o.mobileCredentialsHintText,this.bDemo=n.IsDemo}a.prototype.ViewTemplate="MailWebclient_DefaultAccountHostsSettingsView",e.exports=new a},"5RIG":(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("D2Gh"),n={checkIfFieldsEmpty:function(e,t){var s=i.find(e,function(e){return""===e()});return!s||(t&&o.showError(t),s.focused(!0),!1)},checkPassword:function(e,t){var i=s("LKDt"),n=s("KIwC"),r=!1;return t!==e?o.showError(i.i18n("COREWEBCLIENT/ERROR_PASSWORDS_DO_NOT_MATCH")):n.PasswordMinLength>0&&e.length<n.PasswordMinLength?o.showError(i.i18n("COREWEBCLIENT/ERROR_PASSWORD_TOO_SHORT").replace("%N%",n.PasswordMinLength)):!n.PasswordMustBeComplex||e.match(/([0-9])/)&&e.match(/([!,%,&,@,#,$,^,*,?,_,~])/)?r=!0:o.showError(i.i18n("COREWEBCLIENT/ERROR_PASSWORD_TOO_SIMPLE")),r}};e.exports=n},"5qUT":(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("p09A"),n=s("LKDt"),r=s("ERH9"),a=s("Z9uT"),l=s("5D2l"),c=s("D2Gh"),h=l.run("SettingsWebclient","getAbstractSettingsFormViewClass"),u=s("Fj7m"),d=s("P7bQ");function p(){h.call(this,"MailWebclient"),this.spamScore=o.observable(""),this.allowList=o.observable(""),this.blockList=o.observable("")}i.extendOwn(p.prototype,h.prototype),p.prototype.ViewTemplate="MailWebclient_Settings_AccountAllowBlockListsSettingsFormView",p.prototype.getCurrentValues=function(){return[this.spamScore(),this.allowList(),this.blockList()]},p.prototype.onShow=function(){this.populate()},p.prototype.getParametersForSave=function(){return{AccountID:u.editedId(),SpamScore:r.pInt(this.spamScore()),AllowList:""!==this.allowList()?this.allowList().split("\n"):[],BlockList:""!==this.blockList()?this.blockList().split("\n"):[]}},p.prototype.save=function(){this.isSaving(!0),this.updateSavedState(),d.send("SetAccountSpamSettings",this.getParametersForSave(),this.onResponse,this)},p.prototype.onResponse=function(e,t){this.isSaving(!1),!1===e.Result?a.showErrorByCode(e,n.i18n("COREWEBCLIENT/ERROR_SAVING_SETTINGS_FAILED")):c.showReport(n.i18n("COREWEBCLIENT/REPORT_SETTINGS_UPDATE_SUCCESS"))},p.prototype.populate=function(){var e=u.getEdited();e&&d.send("GetAccountSpamSettings",{AccountID:e.id()},this.onGetAllowBlockListsResponse,this),this.updateSavedState()},p.prototype.onGetAllowBlockListsResponse=function(e,t){var s=e&&e.Result;if(s){var i=r.pInt(s.SpamScore),o=r.pArray(s.AllowList),n=r.pArray(s.BlockList);this.spamScore(i),this.allowList(o.join("\n")),this.blockList(n.join("\n")),this.updateSavedState()}},e.exports=new p},"6jKE":(e,t,s)=>{"use strict";var i=s("M4cL"),o=s("a7T2"),n=s("p09A"),r=s("sdEb"),a=s("jFqX"),l=s("LKDt"),c=s("ERH9"),h=s("1+/O"),u=s("uQaC"),d=s("Z9uT"),p=s("5D2l"),m=s("D2Gh"),b=p.run("SettingsWebclient","getAbstractSettingsFormViewClass"),g=s("Fj7m"),v=s("P7bQ"),A=s("Ua3z"),E=s("KIwC"),S=s("MIfO");function f(){b.call(this,A.ServerModuleName),this.enable=n.observable(!1),this.subject=n.observable(""),this.message=n.observable(""),this.scheduled=n.observable(!1),this.dateFormatMoment=n.computed(function(){return u.getDateFormatForMoment(E.dateFormat())},this),this.startDateDom=n.observable(null),this.startTimestamp=n.observable(null),this.endDateDom=n.observable(null),this.endTimestamp=n.observable(null),this.startTimestamp.subscribe(function(e){var t=r.unix(e);this.startDateDom().datepicker("setDate",t.format(this.dateFormatMoment()));var s=this.endTimestamp()?r.unix(this.endTimestamp()):r();if(t.diff(s,"days")>=0&&this.endDateDom()){var i=t.add(6,"days");this.endTimestamp(i.unix())}},this),this.endTimestamp.subscribe(function(e){var t=r.unix(e);if(this.endDateDom().datepicker("setDate",t.format(this.dateFormatMoment())),(this.startTimestamp()?r.unix(this.startTimestamp()):r()).diff(t,"days")>=0&&this.startDateDom()){var s=t.subtract(6,"days");this.startTimestamp(s.unix())}},this),g.editedId.subscribe(function(){this.bShown&&this.populate()},this),this.startDateDom.subscribe(function(e){this.startTimestamp()||this.startTimestamp(r().unix()),this.createDatePickerObject(e,this.startTimestamp)},this),this.endDateDom.subscribe(function(e){this.endTimestamp()||this.endTimestamp(r().add(6,"days").unix()),this.createDatePickerObject(e,this.endTimestamp)},this),this.allowScheduledAutoresponder=A.AllowScheduledAutoresponder}s("okSt"),o.extendOwn(f.prototype,b.prototype),f.prototype.ViewTemplate="MailWebclient_Settings_AccountAutoresponderSettingsFormView",f.prototype.getCurrentValues=function(){return[this.enable(),this.subject(),this.message(),this.scheduled(),this.startTimestamp(),this.endTimestamp()]},f.prototype.onShow=function(){this.populate()},f.prototype.revert=function(){this.populate()},f.prototype.getParametersForSave=function(){var e={AccountID:g.editedId(),Enable:this.enable(),Subject:this.subject(),Message:this.message(),Scheduled:this.scheduled()};return this.scheduled()&&(e.Start=this.startTimestamp(),e.End=this.endTimestamp()),e},f.prototype.applySavedValues=function(e){var t=g.getEdited().autoresponder();t&&(t.enable=e.Enable,t.subject=e.Subject,t.message=e.Message,t.scheduled=e.Scheduled,t.start=e.Start,t.end=e.End)},f.prototype.save=function(){this.isSaving(!0),this.updateSavedState(),v.send("UpdateAutoresponder",this.getParametersForSave(),this.onResponse,this)},f.prototype.onResponse=function(e,t){if(this.isSaving(!1),!1===e.Result)d.showErrorByCode(e,l.i18n("COREWEBCLIENT/ERROR_SAVING_SETTINGS_FAILED"));else{var s=t.Parameters;this.applySavedValues(s),m.showReport(l.i18n("MAILWEBCLIENT/REPORT_AUTORESPONDER_UPDATE_SUCCESS"))}},f.prototype.populate=function(){var e=g.getEdited();if(e){var t=e.autoresponder();null!==t?(this.enable(t.enable),this.subject(t.subject),this.message(t.message),this.scheduled(t.scheduled),null!==t.start&&this.startTimestamp(t.start),null!==t.end&&this.endTimestamp(t.end)):v.send("GetAutoresponder",{AccountID:e.id()},this.onGetAutoresponderResponse,this)}this.updateSavedState()},f.prototype.onGetAutoresponderResponse=function(e,t){if(e&&e.Result){var s=t.Parameters,i=c.pInt(s.AccountID),o=g.getAccount(i),n=new S;o&&(n.parse(i,e.Result),o.autoresponder(n),i===g.editedId()&&this.populate())}},f.prototype.createDatePickerObject=function(e,t){var s=this;i(e).datepicker({showOtherMonths:!0,selectOtherMonths:!0,monthNames:a.getMonthNamesArray(),dayNamesMin:l.i18n("COREWEBCLIENT/LIST_DAY_NAMES_MIN").split(" "),nextText:"",prevText:"",firstDay:c.pInt(p.run("CalendarWebclient","getWeekStartsOn")),showOn:"focus",dateFormat:h.getDateFormatForDatePicker(E.dateFormat()),onClose:function(e){n.isObservable(t)&&t(r(e,s.dateFormatMoment()).unix())}}),i(e).datepicker("setDate",r.unix(t()).format(this.dateFormatMoment())),i(e).on("mousedown",function(){i("#ui-datepicker-div").toggle()})},e.exports=new f},"8xco":(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("p09A"),n=s("yU9o"),r=s("Z9uT"),a=s("5D2l"),l=s("69av"),c=s("D2Gh"),h=s("LKDt"),u=s("Fj7m"),d=s("Ua3z"),p=s("P7bQ"),m=s("8QQh");function b(){l.call(this),this.iAccountId=0,this.aliasName=o.observable(""),this.loading=o.observable(!1),this.selectedDomain=o.observable(null),this.domainList=o.observableArray([])}i.extendOwn(b.prototype,l.prototype),b.prototype.PopupTemplate="MailWebclient_Settings_CreateAliasPopup",b.prototype.onOpen=function(e){this.iAccountId=e,this.getDomainList()},b.prototype.onClose=function(){this.aliasName("")},b.prototype.save=function(){if(""===this.aliasName())c.showError(h.i18n("COREWEBCLIENT/ERROR_REQUIRED_FIELDS_EMPTY"));else{var e={AliasName:this.aliasName(),AliasDomain:this.selectedDomain()};this.loading(!0),m.send(d.AliasesServerModuleName,"AddNewAlias",e,this.onCreateAliasResponse,this)}},b.prototype.getDomainList=function(){var e=u.getCurrent().serverId(),t=i.isFunction(n.getTenantId)?n.getTenantId():0;p.send("GetServerDomains",{ServerId:e,TenantId:t},this.onGetDomainListResponse,this)},b.prototype.onGetDomainListResponse=function(e,t){e.Result&&this.domainList(e.Result)},b.prototype.onCreateAliasResponse=function(e,t){this.loading(!1),e.Result?(u.populateAliases(function(){var t=u.getCurrent().aliases(),s=i.find(t,function(t){return t.id()===e.Result});s&&a.run("SettingsWebclient","setAddHash",[["alias",s.hash()]])}),this.closePopup()):r.showErrorByCode(e,h.i18n("COREWEBCLIENT/ERROR_UNKNOWN"))},e.exports=new b},"9lZ8":(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("p09A"),n=s("LKDt"),r=s("yU9o"),a=s("5D2l"),l=s("ioSH"),c=s("D2Gh"),h=s("PMEU"),u=s("qpcR"),d=s("ZYTm"),p=s("AY4M"),m=s("8xco"),b=s("P7bQ"),g=s("Fj7m"),v=s("UVn1"),A=s("Ua3z"),E=s("6jKE"),S=s("5qUT"),f=s("r79L"),I=s("ELk6"),y=s("Dq0Z"),w=s("NMTm"),L=s("F9TS"),T=s("l21M"),C=s("jSiL"),R=s("SRQT"),F=s("wvqg"),P=s("bOgC");function M(){this.bAllowAddAccounts=A.AllowAddAccounts,this.bAllowMultiAccounts=A.AllowMultiAccounts,this.bAllowIdentities=!!A.AllowIdentities,this.bAllowFetchers=!!A.AllowFetchers,this.bAllowAliases=!!A.AllowAliases,this.accounts=g.collection,this.editedAccountId=g.editedId,this.editedFetcher=o.observable(null),this.editedFetcherId=o.computed(function(){return this.editedFetcher()?this.editedFetcher().id():null},this),this.editedIdentity=o.observable(null),this.editedIdentityHash=o.computed(function(){return this.editedIdentity()?this.editedIdentity().hash():null},this),this.editedAlias=o.observable(null),this.editedAliasId=o.computed(function(){return this.editedAlias()?this.editedAlias().id():null},this),this.allowFolders=o.observable(!1),this.allowForward=o.observable(!1),this.allowAutoresponder=o.observable(!1),this.allowFilters=o.observable(!1),this.allowSignature=o.observable(!1),this.visibleAllowBlockLists=o.observable(!1),this.aAccountTabs=[{name:"properties",title:n.i18n("MAILWEBCLIENT/LABEL_PROPERTIES_TAB"),view:w,visible:w.visibleTab},{name:"unified",title:n.i18n("MAILWEBCLIENT/LABEL_UNIFIED_MAILBOX_TAB"),view:L,visible:L.visibleTab},{name:"folders",title:n.i18n("MAILWEBCLIENT/LABEL_MANAGE_FOLDERS_TAB"),view:I,visible:this.allowFolders},{name:"forward",title:n.i18n("MAILWEBCLIENT/LABEL_FORWARD_TAB"),view:y,visible:this.allowForward},{name:"autoresponder",title:n.i18n("MAILWEBCLIENT/LABEL_AUTORESPONDER_TAB"),view:E,visible:this.allowAutoresponder},{name:"filters",title:n.i18n("MAILWEBCLIENT/LABEL_FILTERS_TAB"),view:f,visible:this.allowFilters},{name:"signature",title:n.i18n("MAILWEBCLIENT/LABEL_SIGNATURE_TAB"),view:P,visible:this.allowSignature},{name:"allow-block-lists",title:n.i18n("MAILWEBCLIENT/LABEL_ACCOUNT_SPAM_TAB"),view:S,visible:this.visibleAllowBlockLists}],this.aIdentityTabs=[{name:"properties",title:n.i18n("MAILWEBCLIENT/LABEL_PROPERTIES_TAB"),view:new T(this),visible:o.observable(!0)},{name:"signature",title:n.i18n("MAILWEBCLIENT/LABEL_SIGNATURE_TAB"),view:P,visible:o.observable(!0)}],this.aFetcherTabs=[{name:"incoming",title:n.i18n("MAILWEBCLIENT/LABEL_POP3_SETTINGS_TAB"),view:new C(this),visible:o.observable(!0)},{name:"outgoing",title:n.i18n("MAILWEBCLIENT/LABEL_SMTP_SETTINGS_TAB"),view:F,visible:o.observable(!0)},{name:"signature",title:n.i18n("MAILWEBCLIENT/LABEL_SIGNATURE_TAB"),view:P,visible:o.observable(!0)}],this.aAliasTabs=[{name:"properties",title:n.i18n("MAILWEBCLIENT/LABEL_PROPERTIES_TAB"),view:new R(this,this.bAllowAliases),visible:o.observable(!0)},{name:"signature",title:n.i18n("MAILWEBCLIENT/LABEL_SIGNATURE_TAB"),view:P,visible:o.observable(!0)}],this.currentTab=o.observable(null),this.tabs=o.computed(function(){return this.editedIdentity()?this.aIdentityTabs:this.editedFetcher()?this.aFetcherTabs:this.editedAlias()?this.aAliasTabs:this.aAccountTabs},this),g.editedId.subscribe(function(){this.populate()},this),r.broadcastEvent("MailWebclient::ConstructView::after",{Name:this.ViewConstructorName,View:this})}M.prototype.ViewTemplate="MailWebclient_Settings_AccountsSettingsPaneView",M.prototype.ViewConstructorName="CAccountsSettingsPaneView",M.prototype.hasUnsavedChanges=function(){var e=this.currentTab();return e&&e.view&&i.isFunction(e.view.hasUnsavedChanges)&&e.view.hasUnsavedChanges()},M.prototype.revert=function(){var e=this.currentTab();e&&e.view&&i.isFunction(e.view.revert)&&e.view.revert()},M.prototype.hide=function(e,t){this.currentTab()&&i.isFunction(this.currentTab().view.hide)?this.currentTab().view.hide(e,t):e()},M.prototype.showTab=function(e){var t=e.length>0?e[0]:"account",s=g.getEdited(),o=e.length>1?e[1]:s?s.hash():"",r=e.length>2?e[2]:"";this.editedIdentity("identity"===t&&g.getIdentityByHash(o)||null),this.editedFetcher("fetcher"===t&&g.getFetcherByHash(o)||null),this.editedAlias("alias"===t&&g.getAliasByHash(o)||null),"account"===t&&("create"!==e[1]||g.hasAccount()?""!==o&&(s&&s.hash()===o?this.populate():i.find(g.collection(),function(e){return e.hash()===o})?g.changeEditedAccountByHash(o):l.replaceHash(["settings","mail-accounts"])):(this.addAccount(),c.showError(n.i18n("MAILWEBCLIENT/INFO_SPECIFY_CREDENTIALS")),l.replaceHashDirectly(["settings","mail-accounts"]))),this.changeTab(r||this.getAutoselectedTab().name)},M.prototype.getAutoselectedTab=function(){var e=i.find(this.tabs(),function(e){return e.visible()});return e||(e=this.tabs()[0]),e},M.prototype.addAccount=function(){var e=i.isFunction(r.getTenantId)?r.getTenantId():null;null!==e?b.send("GetServers",{TenantId:e},function(e){var t=[];i.isArray(e&&e.Result&&e.Result.Items)&&(i.each(e.Result.Items,function(e){var s=new v(e);s.bOauthEnable&&t.push({Name:s.sOauthName,Type:s.sOauthType,IconUrl:s.sOauthIconUrl})}),t.length>0&&t.push({Name:"Other",Type:"",IconUrl:"static/styles/images/modules/MailWebclient/logo_other.png"})),this.openCreateAccountShortFormPopup(t)},this):this.openCreateAccountShortFormPopup([])},M.prototype.openCreateAccountShortFormPopup=function(e){h.showPopup(u,[e,i.bind(function(e){var t=g.getAccount(e);t&&this.editAccount(t.hash())},this)])},M.prototype.editAccount=function(e){a.run("SettingsWebclient","setAddHash",[["account",e]])},M.prototype.addIdentity=function(e,t){t.stopPropagation(),h.showPopup(d,[e])},M.prototype.editIdentity=function(e){a.run("SettingsWebclient","setAddHash",[["identity",e]])},M.prototype.addFetcher=function(e,t){t.stopPropagation(),h.showPopup(p,[e])},M.prototype.editFetcher=function(e){a.run("SettingsWebclient","setAddHash",[["fetcher",e]])},M.prototype.addAlias=function(e,t){t.stopPropagation(),h.showPopup(m,[e])},M.prototype.editAlias=function(e){a.run("SettingsWebclient","setAddHash",[["alias",e]])},M.prototype.changeRoute=function(e){var t=g.getEdited(),s=["account",t?t.hash():"",e];this.editedIdentity()?s=["identity",this.editedIdentity().hash(),e]:this.editedFetcher()?s=["fetcher",this.editedFetcher().hash(),e]:this.editedAlias()&&(s=["alias",this.editedAlias().hash(),e]),a.run("SettingsWebclient","setAddHash",[s])},M.prototype.changeTab=function(e){var t=this.currentTab(),s=i.find(this.tabs(),function(t){return t.visible()&&t.name===e}),o=function(){s&&(i.isFunction(s.view.showTab)&&s.view.showTab(this.editedIdentity()||this.editedFetcher()||this.editedAlias()),this.currentTab(s))}.bind(this),n=!0;s?t&&i.isFunction(t.view.hide)&&(t.view.hide(o,i.bind(function(){i.isFunction(l.stopListening)&&i.isFunction(l.startListening)&&l.stopListening(),this.changeRoute(t.name),i.isFunction(l.startListening)&&l.startListening()},this)),n=!1):t||(s=this.getAutoselectedTab()),t||i.delay(i.bind(function(){this.changeRoute(s.name)},this)),n&&o()},M.prototype.populate=function(){var e=g.getEdited();e&&(this.allowFolders(e.allowManageFolders()),this.allowForward(e.allowForward()),this.allowAutoresponder(e.allowAutoresponder()),this.allowFilters(e.allowFilters()),this.allowSignature(!A.AllowIdentities),this.visibleAllowBlockLists(e.enableAllowBlockLists()),this.currentTab()&&this.currentTab().visible()||this.currentTab(this.getAutoselectedTab()))},M.prototype.onRemoveIdentity=function(){this.editedIdentity(null),this.changeTab(this.currentTab()?this.currentTab().name:"")},M.prototype.onRemoveFetcher=function(){this.editedFetcher(null),this.changeRoute("")},M.prototype.onRemoveAlias=function(){this.editedAlias(null),this.changeRoute("")},e.exports=new M},AY4M:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("LKDt"),a=s("uQaC"),l=s("Z9uT"),c=s("D2Gh"),h=s("8QQh"),u=s("PMEU"),d=s("69av"),p=s("k0bD"),m=s("Fj7m"),b=s("eGl8"),g=s("Ua3z"),v=s("cVoG");function A(){d.call(this),this.iAccountId=0,this.loading=n.observable(!1),this.newFolderCreating=n.observable(!1),this.incomingLogin=n.observable(""),this.incomingPassword=n.observable(""),this.oIncoming=new v(110,995,"fectcher_add_incoming",r.i18n("MAILWEBCLIENT/LABEL_POP3_SERVER")),this.folder=n.observable(""),this.options=n.observableArray([]),b.folderList.subscribe(function(){this.populateOptions()},this),this.addNewFolderCommand=a.createCommand(this,this.onAddNewFolderClick),this.leaveMessagesOnServer=n.observable(!1),this.loginIsSelected=n.observable(!1),this.passwordIsSelected=n.observable(!1),this.defaultOptionsAfterRender=a.defaultOptionsAfterRender}i.extendOwn(A.prototype,d.prototype),A.prototype.PopupTemplate="MailWebclient_Settings_CreateFetcherPopup",A.prototype.onOpen=function(e){this.iAccountId=e,this.bShown=!0,this.populateOptions(),this.incomingLogin(""),this.incomingPassword(""),this.oIncoming.clear(),this.folder(""),this.leaveMessagesOnServer(!0)},A.prototype.populateOptions=function(){this.bShown&&this.options(b.folderList().getOptions("",!0,!1,!1))},A.prototype.onClose=function(){this.bShown=!1},A.prototype.save=function(){if(this.isEmptyRequiredFields())c.showError(r.i18n("COREWEBCLIENT/ERROR_REQUIRED_FIELDS_EMPTY"));else{var e={AccountId:this.iAccountId,Folder:this.folder(),IncomingServer:this.oIncoming.server(),IncomingPort:this.oIncoming.getIntPort(),IncomingUseSsl:this.oIncoming.ssl(),IncomingLogin:o.trim(this.incomingLogin()),IncomingPassword:o.trim(this.incomingPassword()),LeaveMessagesOnServer:this.leaveMessagesOnServer()};this.loading(!0),h.send(g.FetchersServerModuleName,"CreateFetcher",e,this.onCreateFetcherResponse,this)}},A.prototype.onCreateFetcherResponse=function(e,t){this.loading(!1),e.Result?(m.populateFetchers(),this.closePopup()):l.showErrorByCode(e,r.i18n("COREWEBCLIENT/ERROR_UNKNOWN"))},A.prototype.cancelPopup=function(){this.newFolderCreating()||this.closePopup()},A.prototype.isEmptyRequiredFields=function(){switch(""){case this.oIncoming.server():return this.oIncoming.server.focused(!0),!0;case o.trim(this.incomingLogin()):return this.loginIsSelected(!0),!0;case o.trim(this.incomingPassword()):return this.passwordIsSelected(!0),!0;default:return!1}},A.prototype.onAddNewFolderClick=function(){this.newFolderCreating(!0),u.showPopup(p,[i.bind(this.chooseFolderInList,this)])},A.prototype.chooseFolderInList=function(e,t){var s=b.folderList().sDelimiter,o=[];""!==e&&""!==t&&(this.options(b.folderList().getOptions("",!0,!1,!1)),i.each(this.options(),i.bind(function(i){e===i.name&&((o=i.fullName.split(s)).pop(),t===o.join(s)&&this.folder(i.fullName))},this))),this.newFolderCreating(!1)},e.exports=new A},Dq0Z:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("p09A"),n=s("rBrp"),r=s("LKDt"),a=s("ERH9"),l=s("Z9uT"),c=s("5D2l"),h=s("D2Gh"),u=c.run("SettingsWebclient","getAbstractSettingsFormViewClass"),d=s("PMEU"),p=s("Rjyw"),m=s("Fj7m"),b=s("P7bQ"),g=s("Ua3z"),v=s("p6Kc");function A(){u.call(this,g.ServerModuleName),this.enable=o.observable(!1),this.keepcopy=o.observable(!0),this.email=o.observable(""),this.email.focused=o.observable(!1),m.editedId.subscribe(function(){this.bShown&&this.populate()},this)}i.extendOwn(A.prototype,u.prototype),A.prototype.ViewTemplate="MailWebclient_Settings_AccountForwardSettingsFormView",A.prototype.getCurrentValues=function(){return[this.enable(),this.keepcopy(),this.email()]},A.prototype.revert=function(){this.populate()},A.prototype.getParametersForSave=function(){return{AccountID:m.getEdited().id(),Enable:this.enable(),Email:r.trim(this.email()),KeepMessageCopy:this.keepcopy()}},A.prototype.applySavedValues=function(e){var t=m.getEdited().forward();t&&(t.enable=e.Enable,t.email=e.Email,t.keepcopy=e.KeepMessageCopy)},A.prototype.save=function(){var e=function(){this.isSaving(!0),this.updateSavedState(),b.send("UpdateForward",this.getParametersForSave(),this.onResponse,this)}.bind(this),t=r.trim(this.email());this.enable()&&""===t?this.email.focused(!0):this.enable()&&""!==t?n.isCorrectEmail(t)?e():d.showPopup(p,[r.i18n("MAILWEBCLIENT/ERROR_INPUT_CORRECT_EMAILS")+" "+t]):e()},A.prototype.onResponse=function(e,t){if(this.isSaving(!1),!1===e.Result)l.showErrorByCode(e,r.i18n("COREWEBCLIENT/ERROR_SAVING_SETTINGS_FAILED"));else{var s=t.Parameters;this.applySavedValues(s),h.showReport(r.i18n("MAILWEBCLIENT/REPORT_FORWARD_UPDATE_SUCCESS"))}},A.prototype.populate=function(){var e=m.getEdited(),t=e.forward()?e.forward():null;null!==t?(this.enable(t.enable),this.keepcopy(t.keepcopy),this.email(t.email)):b.send("GetForward",{AccountID:e.id()},this.onGetForwardResponse,this),this.updateSavedState()},A.prototype.onGetForwardResponse=function(e,t){if(e&&e.Result){var s=t.Parameters,i=a.pInt(s.AccountID),o=m.getAccount(i),n=new v;o&&(n.parse(i,e.Result),o.forward(n),i===m.editedId()&&this.populate())}},e.exports=new A},ELk6:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("p09A"),n=s("LKDt"),r=s("uQaC"),a=s("Z9uT"),l=s("yU9o"),c=s("5D2l"),h=s("PMEU"),u=s("k0bD"),d=s("guPB"),p=c.run("ImportExportMailPlugin","getImportExportPopup"),m=s("Fj7m"),b=s("P7bQ"),g=s("eGl8"),v=s("Ua3z");function A(){this.bAllowTemplateFolders=v.AllowTemplateFolders,this.highlighted=o.observable(!1).extend({autoResetToFalse:500}),this.collection=o.observableArray(g.editedFolderList().collection()),this.oCollSubscription=g.editedFolderList().collection.subscribe(function(e){this.collection(e)},this),this.totalMessageCount=o.observable(0),this.enableButtons=o.computed(function(){return g.editedFolderList().initialized()},this),g.editedFolderList.subscribe(function(e){this.collection(e.collection()),this.setTotalMessageCount(),this.oCollSubscription.dispose(),this.oCollSubscription=e.collection.subscribe(function(e){this.collection(e)},this)},this),this.addNewFolderCommand=r.createCommand(this,this.addNewFolder,this.enableButtons),this.setSystemFoldersCommand=r.createCommand(this,this.setSystemFolders,this.enableButtons),this.showMovedWithMouseItem=o.computed(function(){return!l.isMobile()},this),this.allowImportExport=o.observable(c.isModuleEnabled("ImportExportMailPlugin")),l.subscribeEvent("MailWebclient::AttemptDeleteNonemptyFolder",i.bind(function(){this.highlighted(!0)},this)),this.manageFolderButtons=o.observableArray([]),l.broadcastEvent("MailWebclient::RegisterManageFolderButton",function(e){this.manageFolderButtons.push(i.extend({tooltip:function(e){return""},cssClasses:function(e){return""},handler:function(e){}},e))}.bind(this)),l.broadcastEvent("MailWebclient::ConstructView::after",{Name:this.ViewConstructorName,View:this}),this.afterMove=i.debounce(i.bind(this.folderListOrderUpdate,this),3e3)}s("YOkC"),A.prototype.ViewTemplate="MailWebclient_Settings_AccountFoldersPaneView",A.prototype.ViewConstructorName="CAccountFoldersPaneView",A.prototype.folderListOrderUpdate=function(){var e=g.editedFolderList().repopulateLinedCollection(),t={AccountID:m.editedId(),FolderList:i.compact(i.map(e,function(e){if(!e.bVirtual)return e.fullName()}))};b.send("UpdateFoldersOrder",t,function(e){e.Result||(a.showErrorByCode(e,n.i18n("MAILWEBCLIENT/ERROR_CHANGE_FOLDERS_ORDER")),g.getFolderList(m.editedId()))},this)},A.prototype.hide=function(e){var t=m.editedId();i.delay(function(){g.getFolderList(t)},3e3),i.isFunction(e)&&e()},A.prototype.show=function(){this.setTotalMessageCount()},A.prototype.setTotalMessageCount=function(){var e=g.editedFolderList();0===e.iAccountId?this.totalMessageCount(0):(this.totalMessageCount(e.getTotalMessageCount()),e.countsCompletelyFilled()||(e.countsCompletelyFilledSubscribtion&&(e.countsCompletelyFilledSubscribtion.dispose(),e.countsCompletelyFilledSubscribtion=null),e.countsCompletelyFilledSubscribtion=e.countsCompletelyFilled.subscribe(function(){e.countsCompletelyFilled()&&(this.totalMessageCount(e.getTotalMessageCount()),e.countsCompletelyFilledSubscribtion.dispose(),e.countsCompletelyFilledSubscribtion=null)},this)))},A.prototype.addNewFolder=function(){h.showPopup(u)},A.prototype.setSystemFolders=function(){h.showPopup(d)},A.prototype.importExport=function(){this.allowImportExport()&&h.showPopup(p,[{}])},e.exports=new A},EhEn:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("M4cL");s("p09A").bindingHandlers.highlighter={init:function(e,t,s,n,r){var a,l=o(e),c=t(),h=c.valueObserver?c.valueObserver:null,u=c.highlighterValueObserver?c.highlighterValueObserver:null,d=c.highlightTrigger?c.highlightTrigger:null,p=["from:","to:","subject:","text:","email:","has:","date:","text:","body:","folders:"],m=(a="",o.each(p,function(e,t){a=e?a+"|\\b"+t:a+"\\b"+t}),new RegExp("("+a+")","g")),b=function(e){return e.replace(/\xC2\xA0/g," ").replace(/\xA0/g," ").replace(/[\s]+/g," ")},g=-1,v=window.navigator.language||window.navigator.userLanguage,A=!i.include(["zh","zh-TW","zh-CN","zh-HK","zh-SG","zh-MO","ja","ja-JP","ko","ko-KR","vi","vi-VN","th","th-TH"],v);function E(t){if(A){var s=0,n=l.text().split(m),r=[];i.each(n,function(e){var t=e.split("");i.any(p,function(t){return t===e})?i.each(t,function(e){r.push(o(e.replace(/(.)/,'<span class="search_highlight">$&</span>')))}):i.each(t,function(e){" "===e?r.push(document.createTextNode(" ")):r.push(document.createTextNode(e))})}),l.is(":focus")?(s=function(e){var t=null,s={},i={},n=0;return window.getSelection&&document.createRange?(t=window.getSelection()).rangeCount>0&&((i=(s=t.getRangeAt(0)).cloneRange()).selectNodeContents(e),i.setEnd(s.startContainer,s.startOffset),n=i.toString().length,o(e).html().length<n&&(n=0)):document.selection&&document.body.createTextRange&&(s=document.selection.createRange(),(i=document.body.createTextRange()).moveToElementText(e),"function"==typeof i.setEndPoint&&i.setEndPoint("EndToStart",s),n=i.text.length),n}(e),l.empty().append(r),function(e,t){var s,i,o;if(!e)return!1;if(document.createRange)(s=document.createRange()).selectNodeContents(e),s.setStart(e,t),s.setEnd(e,t),(i=window.getSelection()).removeAllRanges(),i.addRange(s);else{if(e.createTextRange)return(o=e.createTextRange()).collapse(!0),o.moveEnd(t),o.moveStart(t),o.select(),!0;if(e.setSelectionRange)e.setSelectionRange(t,t)}}(e,s)):l.empty().append(r)}}o(e).on("keydown",function(e){return e.keyCode!==Enums.Key.Enter}).on("keyup",function(e){var t=[Enums.Key.Left,Enums.Key.Right,Enums.Key.Home,Enums.Key.End],s=-1!==o.inArray(e.keyCode,t);return e.keyCode===Enums.Key.Shift||e.keyCode===Enums.Key.Alt||e.keyCode===Enums.Key.Ctrl||e.keyCode===Enums.Key.Dash||e.keyCode===Enums.Key.Apostrophe||e.keyCode===Enums.Key.Six&&e.shiftKey||s||(e.ctrlKey||g===Enums.Key.Ctrl)&&e.keyCode===Enums.Key.a||(h(b(l.text())),E()),g=e.keyCode,!0}).on("paste",function(e){if(document.queryCommandSupported("insertText")){e.preventDefault();var t="";e.clipboardData||e.originalEvent.clipboardData?t=(e.originalEvent||e).clipboardData.getData("text/plain"):window.clipboardData&&(t=window.clipboardData.getData("Text")),document.execCommand("insertText",!1,t)}setTimeout(function(){h(b(l.text())),E()},0)}),setTimeout(function(){E()},0),d.notifySubscribers(),d.subscribe(function(e){setTimeout(function(){E()},0)},this),u.subscribe(function(){var e=l.text(),t=h();e.replace(" "," ")!==t.replace(" "," ")&&l.text(t)},this)}}},F9TS:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("LKDt"),a=s("ERH9"),l=s("Z9uT"),c=s("5D2l"),h=s("D2Gh"),u=c.run("SettingsWebclient","getAbstractSettingsFormViewClass"),d=s("Fj7m"),p=s("P7bQ"),m=s("Ua3z");function b(){u.call(this,m.ServerModuleName),this.visibleTab=n.computed(function(){return m.AllowUnifiedInbox&&(m.AllowMultiAccounts&&m.AllowAddAccounts||d.collection().length>1)},this),this.includeInUnifiedMailbox=n.observable(!1),this.showUnifiedMailboxLabel=n.observable(!1),this.showUnifiedMailboxLabel.subscribe(function(){if(this.showUnifiedMailboxLabel()){if(""===this.unifiedMailboxLabelText()){var e=d.getEdited();this.unifiedMailboxLabelText(e.email())}""===this.unifiedMailboxLabelColor()&&this.unifiedMailboxLabelColor("#f09650")}},this),this.unifiedMailboxLabelText=n.observable(""),this.unifiedMailboxLabelColor=n.observable(""),d.unifiedMailboxAccounts.subscribe(function(){var e=s("eGl8"),t=s("oq0M");e.oUnifiedInbox.hasChanges(!0),e.oUnifiedInbox.removeAllMessageListsFromCacheIfHasChanges(),d.unifiedMailboxAccounts().length>1?e.executeCheckMail():t.hash(t.baseHash())}),this.aColors=["#f09650","#f68987","#6fd0ce","#8fbce2","#b9a4f5","#f68dcf","#d88adc","#4afdb4","#9da1ff","#5cc9c9","#77ca71","#aec9c9"]}i.extendOwn(b.prototype,u.prototype),b.prototype.ViewTemplate="MailWebclient_Settings_AccountUnifiedMailboxFormView",b.prototype.getCurrentValues=function(){return[this.includeInUnifiedMailbox(),this.showUnifiedMailboxLabel(),this.unifiedMailboxLabelText(),this.unifiedMailboxLabelColor()]},b.prototype.getParametersForSave=function(){return{AccountID:d.editedId(),IncludeInUnifiedMailbox:this.includeInUnifiedMailbox(),ShowUnifiedMailboxLabel:this.showUnifiedMailboxLabel(),UnifiedMailboxLabelText:o.trim(this.unifiedMailboxLabelText()),UnifiedMailboxLabelColor:o.trim(this.unifiedMailboxLabelColor())}},b.prototype.revert=function(){this.populate()},b.prototype.populate=function(){var e=d.getEdited();e?(this.includeInUnifiedMailbox(e.includeInUnifiedMailbox()),this.showUnifiedMailboxLabel(e.showUnifiedMailboxLabel()),this.unifiedMailboxLabelText(e.unifiedMailboxLabelText()),this.unifiedMailboxLabelColor(e.unifiedMailboxLabelColor())):(this.includeInUnifiedMailbox(!1),this.showUnifiedMailboxLabel(!1),this.unifiedMailboxLabelText(""),this.unifiedMailboxLabelColor("")),this.updateSavedState()},b.prototype.save=function(){this.isSaving(!0),this.updateSavedState(),p.send("UpdateAccountUnifiedMailbox",this.getParametersForSave(),this.onResponse,this)},b.prototype.onResponse=function(e,t){if(this.isSaving(!1),e.Result){var s=t.Parameters,i=a.pInt(s.AccountID),o=d.getAccount(i);o&&(o.updateFromServer(e.Result),this.populate(),h.showReport(r.i18n("COREWEBCLIENT/REPORT_SETTINGS_UPDATE_SUCCESS")))}else l.showErrorByCode(e,r.i18n("COREWEBCLIENT/ERROR_SAVING_SETTINGS_FAILED"))},b.prototype.setColor=function(e){this.unifiedMailboxLabelColor(e)},e.exports=new b},MIfO:(e,t,s)=>{"use strict";var i=s("ERH9");function o(){this.iAccountId=0,this.enable=!1,this.subject="",this.message="",this.scheduled=!1,this.start=null,this.end=null}s("sdEb"),o.prototype.parse=function(e,t){this.iAccountId=e,this.enable=!!t.Enable,this.subject=i.pString(t.Subject),this.message=i.pString(t.Message),this.scheduled=!!t.Scheduled,t.Start&&(this.start=i.pInt(t.Start)),t.End&&(this.end=i.pInt(t.End))},e.exports=o},NH30:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("p09A"),n=s("LKDt"),r=s("ERH9"),a=(s("/Odb"),s("5D2l")),l=s("KIwC"),c=a.run("SettingsWebclient","getAbstractSettingsFormViewClass"),h=s("Panx"),u=s("Ua3z");function d(){c.call(this,u.ServerModuleName),this.bRtl=l.IsRTL,this.bAllowChangeStarredMessagesSource=u.AllowChangeStarredMessagesSource,this.bAllowMailto=u.AllowAppRegisterMailto&&h.isAvailableRegisterMailto(),this.bAllowShowMessagesCountInFolderList=u.AllowShowMessagesCountInFolderList,this.bAllowHorizontalLayout=u.AllowHorizontalLayout,this.mailsPerPageValues=o.observableArray(r.getAdaptedPerPageList(u.MailsPerPage)),this.starredMessagesSourceValues=[{text:n.i18n("MAILWEBCLIENT/LABEL_STARRED_MESSAGES_SOURCE_INBOX"),value:Enums.StarredMessagesSource.InboxOnly},{text:n.i18n("MAILWEBCLIENT/LABEL_STARRED_MESSAGES_SOURCE_ALL_FOLDERS"),value:Enums.StarredMessagesSource.AllFolders}],this.aLayoutValues=[{text:n.i18n("MAILWEBCLIENT/LABEL_VERT_SPLIT_LAYOUT"),value:!1},{text:n.i18n("MAILWEBCLIENT/LABEL_HORIZ_SPLIT_LAYOUT"),value:!0}],this.mailsPerPage=o.observable(u.MailsPerPage),this.starredMessagesSource=o.observable(u.StarredMessagesSource),this.allowAutosaveInDrafts=o.observable(u.AllowAutosaveInDrafts),this.allowChangeInputDirection=o.observable(u.AllowChangeInputDirection),this.showMessagesCountInFolderList=o.observable(u.showMessagesCountInFolderList()),this.horizontalLayout=o.observable(u.HorizontalLayout)}i.extendOwn(d.prototype,c.prototype),d.prototype.ViewTemplate="MailWebclient_Settings_MailSettingsFormView",d.prototype.registerMailto=function(){h.registerMailto()},d.prototype.getCurrentValues=function(){return[this.mailsPerPage(),this.allowAutosaveInDrafts(),this.allowChangeInputDirection(),this.showMessagesCountInFolderList(),this.horizontalLayout()]},d.prototype.revertGlobalValues=function(){this.mailsPerPage(u.MailsPerPage),this.starredMessagesSource(u.StarredMessagesSource),this.allowAutosaveInDrafts(u.AllowAutosaveInDrafts),this.allowChangeInputDirection(u.AllowChangeInputDirection),this.showMessagesCountInFolderList(u.showMessagesCountInFolderList()),this.horizontalLayout(u.HorizontalLayout)},d.prototype.getParametersForSave=function(){return{MailsPerPage:this.mailsPerPage(),StarredMessagesSource:this.starredMessagesSource(),AllowAutosaveInDrafts:this.allowAutosaveInDrafts(),AllowChangeInputDirection:this.allowChangeInputDirection(),ShowMessagesCountInFolderList:this.showMessagesCountInFolderList(),HorizontalLayout:this.horizontalLayout()}},d.prototype.applySavedValues=function(e){e.HorizontalLayout!==u.HorizontalLayout&&window.location.reload(),u.update(e)},d.prototype.setAccessLevel=function(e,t){this.visible(""===e)},e.exports=new d},NMTm:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("LKDt"),a=s("ERH9"),l=s("Z9uT"),c=s("5D2l"),h=s("D2Gh"),u=s("yU9o"),d=c.run("SettingsWebclient","getAbstractSettingsFormViewClass"),p=s("PMEU"),m=c.run("ChangePasswordWebclient","getChangePasswordPopup"),b=s("Fj7m"),g=s("P7bQ"),v=s("Ua3z"),A=s("qN2P");function E(){d.call(this,v.ServerModuleName),this.sFakePass="xxxxxxxx",this.bAllowIdentities=v.AllowIdentities,this.useToAuthorize=n.observable(!1),this.canBeUsedToAuthorize=n.observable(!1),this.isDefaultAccount=n.observable(!1),this.isServerOwner=n.observable(!1),this.friendlyName=n.observable(""),this.email=n.observable(""),this.incomingLogin=n.observable(""),this.incomingPassword=n.observable(""),this.allowSpecifyPassword=n.observable(!1),this.useThreading=n.observable(!1),this.saveRepliesToCurrFolder=n.observable(!1),this.oServerPairPropertiesView=new A("acc_edit"),this.enableThreading=this.oServerPairPropertiesView.enableThreading,this.enableThreading.subscribe(function(){this.enableThreading()||this.useThreading(!1)},this),this.allowChangePassword=n.observable(!1),this.incLoginFocused=n.observable(!1),this.incLoginFocused.subscribe(function(){this.incLoginFocused()&&""===this.incomingLogin()&&this.incomingLogin(this.email())},this),b.editedId.subscribe(function(){this.bShown&&this.populate()},this),this.updateSavedState(),this.oServerPairPropertiesView.currentValues.subscribe(function(){this.updateSavedState()},this),this.visibleTab=n.observable(!0),n.computed(function(){var e=b.getEdited();e?(this.allowChangePassword(c.run("ChangePasswordWebclient","isChangePasswordButtonAllowed",[b.collection().length,e])),this.isDefaultAccount(e.bDefault),this.isServerOwner(e.oServer.sOwnerType===Enums.ServerOwnerType.Account)):(this.allowChangePassword(!1),this.isDefaultAccount(!1))},this),this.isDisableAuthorize=n.observable(u.userAccountsCount()<=1),this.oDefaultAccountHostsSettingsView=s("2wN8")}i.extendOwn(E.prototype,d.prototype),E.prototype.ViewTemplate="MailWebclient_Settings_AccountSettingsFormView",E.prototype.onShow=function(){this.oServerPairPropertiesView.fullInit(),this.populate()},E.prototype.getCurrentValues=function(){var e=[this.useToAuthorize(),this.friendlyName(),this.email(),this.incomingLogin(),this.incomingPassword(),this.useThreading(),this.saveRepliesToCurrFolder()],t=this.oServerPairPropertiesView.currentValues();return e.concat(t)},E.prototype.getParametersForSave=function(){var e=b.getEdited(),t=o.trim(this.incomingPassword());return{AccountID:e.id(),UseToAuthorize:this.useToAuthorize(),FriendlyName:this.friendlyName(),Email:o.trim(this.email()),IncomingLogin:o.trim(this.incomingLogin()),IncomingPassword:t===this.sFakePass?"":t,Server:this.oServerPairPropertiesView.getParametersForSave(),UseThreading:this.useThreading(),SaveRepliesToCurrFolder:this.saveRepliesToCurrFolder()}},E.prototype.revert=function(){this.populate()},E.prototype.populate=function(){var e=b.getEdited();this.passwordMightBeIncorrectSubscribtion&&(this.passwordMightBeIncorrectSubscribtion.dispose(),this.passwordMightBeIncorrectSubscribtion=null),e?(this.friendlyName(e.friendlyName()),this.email(e.email()),this.incomingLogin(e.incomingLogin()),this.incomingPassword(this.sFakePass),this.allowSpecifyPassword(e.passwordMightBeIncorrect()),e.passwordMightBeIncorrect()||(this.passwordMightBeIncorrectSubscribtion=e.passwordMightBeIncorrect.subscribe(function(){this.allowSpecifyPassword(e.passwordMightBeIncorrect()),this.passwordMightBeIncorrectSubscribtion.dispose(),this.passwordMightBeIncorrectSubscribtion=null}.bind(this))),this.oServerPairPropertiesView.setServer(e.oServer),this.useToAuthorize(e.useToAuthorize()),this.canBeUsedToAuthorize(e.canBeUsedToAuthorize()),this.useThreading(e.useThreading()),this.saveRepliesToCurrFolder(e.bSaveRepliesToCurrFolder),this.isDisableAuthorize(!!this.useToAuthorize()&&u.userAccountsCount()<=1)):(this.friendlyName(""),this.email(""),this.incomingLogin(""),this.incomingPassword(""),this.allowSpecifyPassword(!1),this.oServerPairPropertiesView.clear(),this.useToAuthorize(!0),this.canBeUsedToAuthorize(!1),this.useThreading(!1),this.isDisableAuthorize(!0)),this.updateSavedState()},E.prototype.remove=function(){if(this.isDisableAuthorize())h.showError(r.i18n("COREWEBCLIENT/ERROR_ACCOUNT_DELETING_DISABLE"),!0);else{var e=b.getEdited();e&&e.remove()}},E.prototype.save=function(){this.isSaving(!0),this.updateSavedState(),g.send("UpdateAccount",this.getParametersForSave(),this.onResponse,this)},E.prototype.onResponse=function(e,t){if(this.isSaving(!1),e.Result){var s=t.Parameters,i=a.pInt(s.AccountID),o=b.getAccount(i);o&&(a.isNonEmptyString(s.IncomingPassword)&&s.IncomingPassword!==this.sFakePass&&o.passwordMightBeIncorrect(!1),o.updateFromServer(e.Result),this.populate(),h.showReport(r.i18n("COREWEBCLIENT/REPORT_SETTINGS_UPDATE_SUCCESS")))}else l.showErrorByCode(e,r.i18n("COREWEBCLIENT/ERROR_SAVING_SETTINGS_FAILED"))},E.prototype.changePassword=function(){this.allowChangePassword()&&p.showPopup(m,[{iAccountId:b.editedId(),sModule:v.ServerModuleName,bHasOldPassword:!0}])},e.exports=new E},OQrU:(e,t,s)=>{"use strict";function i(e){return i="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},i(e)}e.exports=function(e){s("TQgg");var t=s("a7T2"),o=s("p09A"),n=s("yU9o"),r=s("5D2l"),a=s("Ua3z"),l=null,c=null,h=null,u=null,d=function(){if(!u){var e=s("Qz84");u=new e}return u};if(a.init(e),!r.isModuleAvailable(a.ServerModuleName))return null;if(l=s("Fj7m"),n.isUserNormalOrTenant()){var p=s("eGl8");if(p.init(),n.isNewTab()){var m=function(){if(null===c){var e=s("Ssud");c=new e}return c};return{start:function(){s("dBPG")},getScreens:function(){var e={};return e[a.HashModuleName+"-view"]=function(){return s("nM5h")},e[a.HashModuleName+"-compose"]=function(){return m()},e},registerComposeToolbarController:function(e){m().registerToolbarController(e)},registerComposeMessageRowController:function(e){m().registerMessageRowController(e)},registerComposeUploadAttachmentsController:function(e){m().registerUploadAttachmentsController(e)},getComposeMessageWithData:function(){return s("sXLm").composeMessageWithData},getComposeMessageToAddresses:function(){return s("sXLm").composeMessageToAddresses},getComposeMessageWithAttachments:function(){return s("sXLm").composeMessageWithAttachments},getSearchMessagesInCurrentFolder:function(){var e=window.opener&&window.opener.MainTabMailMethods;return!!e&&t.bind(e.searchMessagesInCurrentFolder,e)},getCurrentMessage:function(){return p.currentMessage()},getCurrentFolderList:function(){return p.folderList()},syncFolders:function(){return p.getFolderList(p.currentAccountId())},removeMessageFromCurrentList:function(e,t,s){return p.removeMessageFromCurrentList(e,t,s)}}}var b={enableModule:o.observable(a.AllowAddAccounts||l.hasAccount()),getComposeMessageToAddresses:function(){return s("sXLm").composeMessageToAddresses},getComposeMessageWithData:function(){return s("sXLm").composeMessageWithData},getComposeMessageWithAttachments:function(){return s("sXLm").composeMessageWithAttachments},getPrefetcher:function(){return s("qG1F")},registerComposeToolbarController:function(e){s("v4rC").registerToolbarController(e)},registerComposeMessageRowController:function(e){s("v4rC").registerMessageRowController(e)},registerComposeUploadAttachmentsController:function(e){s("v4rC").registerUploadAttachmentsController(e)},getSearchMessagesInInbox:function(){return t.bind(p.searchMessagesInInbox,p)},getFolderHash:function(e){return p.getFolderHash(e)},getSearchMessagesInCurrentFolder:function(){return t.bind(p.searchMessagesInCurrentFolder,p)},getMessage:function(e,t,s){return p.getMessage(p.currentAccountId(),e,t,s,p)},getCurrentMessage:function(){return p.currentMessage()},getCurrentFolderList:function(){return p.folderList()},syncFolders:function(){return p.getFolderList(p.currentAccountId())},removeMessageFromCurrentList:function(e,t,s){return p.removeMessageFromCurrentList(e,t,s)},deleteMessages:function(e,t,s){var i=p.getFolderByFullName(e,t);p.deleteMessagesFromFolder(i,s)},getAllAccountsFullEmails:function(){return l.getAllFullEmails()},getAccountList:function(){return l},getMailCache:function(){return p},getSettings:function(){return a},setCustomRouting:function(e,t,i,o,n,r){var l=s("ioSH"),c=s("dpSB");l.setHash(c.getMailbox(e,t,i,o,n,a.MessagesSortBy.DefaultSortBy,a.MessagesSortBy.DefaultSortOrder,r))}};return n.isMobile()||(b=t.extend(b,{start:function(e){var i=s("LKDt"),r=s("/Odb"),c=s("Panx");if(s("dBPG"),s("EhEn"),a.AllowAppRegisterMailto&&c.registerMailto(r.firefox),a.AllowAddAccounts||l.hasAccount()){e.run("SettingsWebclient","registerSettingsTab",[function(){return s("NH30")},a.HashModuleName,i.i18n("MAILWEBCLIENT/LABEL_SETTINGS_TAB")]);var h=a.AllowMultiAccounts?i.i18n("MAILWEBCLIENT/LABEL_ACCOUNTS_SETTINGS_TAB"):i.i18n("MAILWEBCLIENT/LABEL_ACCOUNT_SETTINGS_TAB");e.run("SettingsWebclient","registerSettingsTab",[function(){return s("9lZ8")},a.HashModuleName+"-accounts",h])}o.computed(function(){var e=t.filter(l.collection(),function(e){return e.useToAuthorize()}),s=t.map(e,function(e){return e.email()});a.userMailAccountsCount(e.length),a.mailAccountsEmails(s)},this),n.broadcastEvent("RegisterNewItemElement",{title:i.i18n("MAILWEBCLIENT/ACTION_NEW_MESSAGE"),handler:function(){window.location.hash=a.HashModuleName,d().executeCompose()},className:"item_mail",order:1,column:1})},getScreens:function(){return e={},t=a.HashModuleName,s=d,(t=function(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var s=t.call(e,"string");if("object"!=i(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e;var e,t,s},getHeaderItem:function(){if(null===h&&a.AllowOtherModulesToReplaceTabsbarHeader){var e={};n.broadcastEvent("MailWebclient::GetHeaderItemView",e),h=e.HeaderItemView||null}return null===h&&(h=s("oq0M")),{item:h,name:a.HashModuleName}},getMobileSyncSettingsView:function(){return s("2wN8")}})),b}return null}},SRQT:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("p09A"),n=s("LKDt"),r=s("Z9uT"),a=s("5D2l"),l=s("D2Gh"),c=a.run("SettingsWebclient","getAbstractSettingsFormViewClass"),h=s("Fj7m"),u=s("8QQh"),d=s("Ua3z"),p=s("PMEU"),m=s("MYiO");function b(e,t){c.call(this,d.ServerModuleName),this.alias=o.observable(null),this.oParent=e,this.disableRemoveAlias=o.observable(!t),this.friendlyName=o.observable(""),this.friendlyNameHasFocus=o.observable(!1)}i.extendOwn(b.prototype,c.prototype),b.prototype.ViewTemplate="MailWebclient_Settings_AliasSettingsFormView",b.prototype.ViewConstructorName="CAliasSettingsFormView",b.prototype.onShow=function(e){this.alias(e&&e.ALIAS?e:null),this.populate()},b.prototype.getCurrentValues=function(){return[this.friendlyName()]},b.prototype.getParametersForSave=function(){return this.alias()?{AccountID:this.alias().accountId(),FriendlyName:this.friendlyName(),EntityId:this.alias().id()}:{}},b.prototype.save=function(){this.isSaving(!0),this.updateSavedState(),u.send(d.AliasesServerModuleName,"UpdateAlias",this.getParametersForSave(),this.onResponse,this)},b.prototype.onResponse=function(e,t){this.isSaving(!1),e.Result?(h.populateAliases(function(){var t=h.getCurrent().aliases(),s=i.find(t,function(t){return t.id()===e.Result});s&&a.run("SettingsWebclient","setAddHash",[["alias",s.hash()]])}),l.showReport(n.i18n("COREWEBCLIENT/REPORT_SETTINGS_UPDATE_SUCCESS"))):r.showErrorByCode(e,n.i18n("MAILWEBCLIENT/ERROR_ALIAS_ADDING"))},b.prototype.populate=function(){var e=this.alias();e&&(this.friendlyName(e.friendlyName()),setTimeout(function(){this.updateSavedState()}.bind(this),1))},b.prototype.remove=function(){this.alias()&&p.showPopup(m,[n.i18n("MAILWEBCLIENT/CONFIRM_DELETE_ALIAS"),i.bind(function(e){if(e){var t={AccountID:this.alias().accountId(),Aliases:[this.alias().email()]};u.send(d.AliasesServerModuleName,"DeleteAliases",t,this.onAccountAliasDeleteResponse,this),i.isFunction(this.oParent.onRemoveAlias)&&this.oParent.onRemoveAlias()}},this)])},b.prototype.onAccountAliasDeleteResponse=function(e,t){e.Result||r.showErrorByCode(e,n.i18n("MAILWEBCLIENT/ERROR_ALIAS_DELETING")),h.populateAliases()},b.prototype.cancel=function(){i.isFunction(this.oParent.cancelPopup)&&this.oParent.cancelPopup()},e.exports=b},YOkC:(e,t,s)=>{var i,o,n;o=[s("p09A"),s("M4cL"),s("Hg/X"),s("6gxe"),s("O/kJ")],void 0===(n="function"==typeof(i=function(e,t){var s="ko_sortItem",i="ko_sourceIndex",o="ko_sortList",n="ko_parentList",r=e.utils.unwrapObservable,a=e.utils.domData.get,l=e.utils.domData.set,c=t.ui&&t.ui.version,h=c&&c.indexOf("1.6.")&&c.indexOf("1.7.")&&(c.indexOf("1.8.")||"1.8.24"===c),u=function(t,i){e.utils.arrayForEach(t,function(e){1===e.nodeType&&(l(e,s,i),l(e,n,a(e.parentNode,o)))})},d=function(t,s){var i,o={},n={};return e.utils.peekObservable(t()).data?(n=r(t()||{}),o[s]=n.data,n.hasOwnProperty("template")&&(o.name=n.template)):o[s]=t(),e.utils.arrayForEach(["afterAdd","afterRender","as","beforeRemove","includeDestroyed","templateEngine","templateOptions","nodes"],function(t){n.hasOwnProperty(t)?o[t]=n[t]:e.bindingHandlers.sortable.hasOwnProperty(t)&&(o[t]=e.bindingHandlers.sortable[t])}),"foreach"===s&&(o.afterRender?(i=o.afterRender,o.afterRender=function(e,t){u.call(t,e,t),i.call(t,e,t)}):o.afterRender=u),o},p=function(e,t){var s=r(t);if(s)for(var i=0;i<=e;i++)s[i]&&r(s[i]._destroy)&&e++;return e};e.bindingHandlers.sortable={init:function(c,u,m,b,g){var v,A,E=t(c),S=r(u())||{},f=d(u,"foreach"),I={};(function(s,i){var o,n;i?(n=document.getElementById(i))&&(o=new e.templateSources.domElement(n)).text(t.trim(o.text())):t(s).contents().each(function(){this&&1!==this.nodeType&&s.removeChild(this)})})(c,f.name),t.extend(!0,I,e.bindingHandlers.sortable),S.options&&I.options&&(e.utils.extend(I.options,S.options),delete S.options),e.utils.extend(I,S),I.connectClass&&(e.isObservable(I.allowDrop)||"function"==typeof I.allowDrop)?e.computed({read:function(){var t=r(I.allowDrop),s="function"==typeof t?t.call(this,f.foreach):t;e.utils.toggleDomNodeCssClass(c,I.connectClass,s)},disposeWhenNodeIsRemoved:c},this):e.utils.toggleDomNodeCssClass(c,I.connectClass,I.allowDrop),e.bindingHandlers.template.init(c,function(){return f},m,b,g),v=I.options.start,A=I.options.update,I.options.helper||(I.options.helper=function(e,s){return s.is("tr")&&s.children().each(function(){t(this).width(t(this).width())}),s});var y=setTimeout(function(){var u,d=I.options.receive;E.sortable(e.utils.extend(I.options,{start:function(t,s){var o=s.item[0];l(o,i,e.utils.arrayIndexOf(s.item.parent().children(),o)),s.item.find("input:focus").change(),v&&v.apply(this,arguments)},receive:function(e,t){"function"==typeof d&&d.call(this,e,t),(u=a(t.item[0],"ko_dragItem"))&&(u.clone&&(u=u.clone()),I.dragged&&(u=I.dragged.call(this,u,e,t)||u))},update:function(c,d){var m,b,g,v,E,S=d.item[0],y=d.item.parent()[0],w=a(S,s)||u;if(w||t(S).remove(),u=null,w&&this===y||!h&&t.contains(this,y)){if(m=a(S,n),g=a(S,i),b=a(S.parentNode,o),v=e.utils.arrayIndexOf(d.item.parent().children(),S),f.includeDestroyed||(g=p(g,m),v=p(v,b)),(I.beforeMove||I.afterMove)&&(E={item:w,sourceParent:m,sourceParentNode:m&&d.sender||S.parentNode,sourceIndex:g,targetParent:b,targetIndex:v,cancelDrop:!1},I.beforeMove&&I.beforeMove.call(this,E,c,d)),m?t(m===b?this:d.sender||this).sortable("cancel"):t(S).remove(),E&&E.cancelDrop)return;if(I.hasOwnProperty("strategyMove")&&!1!==I.strategyMove){if(v>=0)if(m)if(m!==b)m.splice(g,1),b.splice(v,0,w),l(S,s,null),d.item.remove();else{var L=r(m);m.valueWillMutate&&m.valueWillMutate(),L.splice(g,1),L.splice(v,0,w),m.valueHasMutated&&m.valueHasMutated()}else b.splice(v,0,w),l(S,s,null),d.item.remove()}else v>=0&&(m&&(m.splice(g,1),e.processAllDeferredBindingUpdates&&e.processAllDeferredBindingUpdates(),e.options&&e.options.deferUpdates&&e.tasks.runEarly()),b.splice(v,0,w)),l(S,s,null);e.processAllDeferredBindingUpdates&&e.processAllDeferredBindingUpdates(),I.afterMove&&I.afterMove.call(this,E,c,d)}A&&A.apply(this,arguments)},connectWith:!!I.connectClass&&"."+I.connectClass})),void 0!==I.isEnabled&&e.computed({read:function(){E.sortable(r(I.isEnabled)?"enable":"disable")},disposeWhenNodeIsRemoved:c})},0);return e.utils.domNodeDisposal.addDisposeCallback(c,function(){(E.data("ui-sortable")||E.data("sortable"))&&E.sortable("destroy"),e.utils.toggleDomNodeCssClass(c,I.connectClass,!1),clearTimeout(y)}),{controlsDescendantBindings:!0}},update:function(t,s,i,n,r){var a=d(s,"foreach");l(t,o,a.foreach),e.bindingHandlers.template.update(t,function(){return a},i,n,r)},connectClass:"ko_container",allowDrop:!0,afterMove:null,beforeMove:null,options:{}}})?i.apply(t,o):i)||(e.exports=n)},ZYTm:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("69av"),n=s("Fj7m"),r=s("JI31"),a=s("l21M");function l(){o.call(this),this.oIdentitySettingsFormView=new a(this,!0)}i.extendOwn(l.prototype,o.prototype),l.prototype.PopupTemplate="MailWebclient_Settings_CreateIdentityPopup",l.prototype.onOpen=function(e){var t=n.getAccount(e),s=new r;s.accountId(e),s.email(t.email()),this.oIdentitySettingsFormView.onShow(s),this.oIdentitySettingsFormView.populate(),this.oIdentitySettingsFormView.friendlyNameHasFocus(!0)},e.exports=new l},bOgC:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("p09A"),n=s("LKDt"),r=s("uQaC"),a=s("Z9uT"),l=s("/Odb"),c=s("5D2l"),h=s("D2Gh"),u=s("8QQh"),d=c.run("SettingsWebclient","getAbstractSettingsFormViewClass"),p=s("PV2F"),m=s("Fj7m"),b=s("P7bQ"),g=s("Ua3z"),v=p.getCHtmlEditorView();function A(){d.call(this,g.ServerModuleName),this.fetcherOrIdentity=o.observable(null),this.useSignatureRadio=o.observable(Enums.UseSignature.Off),this.signature=o.observable(""),this.oHtmlEditor=new v(!0,!1),this.oHtmlEditor.textFocused.subscribe(function(){this.oHtmlEditor.textFocused()&&this.useSignatureRadio(Enums.UseSignature.On)},this),this.enableImageDragNDrop=o.observable(!1),this.allowEditSignature=o.observable(!0),o.computed(function(){this.oHtmlEditor.setInactive(!this.allowEditSignature()||this.useSignatureRadio()===Enums.UseSignature.Off)},this),this.saveCommand=r.createCommand(this,this.save,this.allowEditSignature)}i.extendOwn(A.prototype,d.prototype),A.prototype.ViewTemplate="MailWebclient_Settings_SignatureSettingsFormView",A.prototype.ViewConstructorName="CSignatureSettingsFormView",A.prototype.onShow=function(e){this.fetcherOrIdentity(e||null),this.populate(),i.defer(i.bind(this.init,this))},A.prototype.init=function(){this.oHtmlEditor.setDisableEdit(!1),this.oHtmlEditor.init(this.signature(),!1,"",n.i18n("MAILWEBCLIENT/LABEL_ENTER_SIGNATURE_HERE")),this.enableImageDragNDrop(this.oHtmlEditor.isDragAndDropSupported()&&!l.ie10AndAbove),this.oHtmlEditor.setDisableEdit(!this.allowEditSignature()),this.updateSavedState()},A.prototype.getCurrentValues=function(){return this.oHtmlEditor.isInitialized()&&this.signature(this.oHtmlEditor.getText()),[this.useSignatureRadio(),this.signature()]},A.prototype.revert=function(){this.populate()},A.prototype.getParametersForSave=function(){this.signature(this.oHtmlEditor.getText());var e=m.getEdited(),t={AccountID:this.fetcherOrIdentity()?this.fetcherOrIdentity().accountId():e?e.id():0,UseSignature:this.useSignatureRadio()===Enums.UseSignature.On,Signature:this.signature()};return this.fetcherOrIdentity()&&(this.fetcherOrIdentity().FETCHER?i.extendOwn(t,{FetcherId:this.fetcherOrIdentity().id()}):this.fetcherOrIdentity().ALIAS?i.extendOwn(t,{AliasId:this.fetcherOrIdentity().id()}):this.fetcherOrIdentity().bAccountPart||i.extendOwn(t,{IdentityId:this.fetcherOrIdentity().id()})),t},A.prototype.applySavedValues=function(e){e.FetcherId?m.populateFetchers():e.AliasId?m.populateAliases():e.IdentityId?m.populateIdentities():e.AccountID&&this.populateAccountSignature(e.AccountID)},A.prototype.populateAccountSignature=function(e){b.send("GetAccount",{AccountId:e},function(t){if(t.Result){var s=m.getAccount(e);s&&(s.useSignature(!!t.Result.UseSignature),s.signature(t.Result.Signature))}})},A.prototype.populate=function(){var e=this.fetcherOrIdentity()?this.fetcherOrIdentity().accountId():m.editedId(),t=!!this.fetcherOrIdentity()&&this.fetcherOrIdentity().bAccountPart,s=m.getAccount(e),i=this.fetcherOrIdentity()||s;i&&(this.useSignatureRadio(i.useSignature()?Enums.UseSignature.On:Enums.UseSignature.Off),this.signature(i.signature()),this.oHtmlEditor.setDisableEdit(!1),this.oHtmlEditor.setText(this.signature()),this.allowEditSignature(s&&s.bAllowEditSignature||!t),this.oHtmlEditor.setDisableEdit(!this.allowEditSignature())),this.updateSavedState()},A.prototype.save=function(){this.isSaving(!0),this.updateSavedState(),this.fetcherOrIdentity()&&this.fetcherOrIdentity().FETCHER?u.send(g.FetchersServerModuleName,"UpdateSignature",this.getParametersForSave(),this.onResponse,this):this.fetcherOrIdentity()&&this.fetcherOrIdentity().ALIAS?u.send(g.AliasesServerModuleName,"UpdateSignature",this.getParametersForSave(),this.onResponse,this):b.send("UpdateSignature",this.getParametersForSave(),this.onResponse,this)},A.prototype.onResponse=function(e,t){this.isSaving(!1),e.Result?(this.applySavedValues(t.Parameters),h.showReport(n.i18n("COREWEBCLIENT/REPORT_SETTINGS_UPDATE_SUCCESS"))):a.showErrorByCode(e,n.i18n("COREWEBCLIENT/ERROR_SAVING_SETTINGS_FAILED"))},e.exports=new A},cVoG:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("p09A"),n=s("ERH9");function r(e,t,s,r,a){this.server=o.observable(""),this.server.focused=o.observable(!1),this.label=r,this.defaultPort=o.observable(e),this.defaultSslPort=o.observable(t),this.port=o.observable(e),this.port.focused=o.observable(!1),this.ssl=o.observable(!1),this.isEnabled=o.observable(!0),this.id=s,i.isFunction(a)&&a.focused.subscribe(function(){a.focused()||""!==this.server()||this.server(a())},this),this.ssl.subscribe(function(){var e=n.pInt(this.port());this.ssl()?e===this.defaultPort()&&this.port(this.defaultSslPort()):e===this.defaultSslPort()&&this.port(this.defaultPort())},this)}r.prototype.set=function(e,t,s){this.server(e),this.ssl(s),this.port(t)},r.prototype.clear=function(){this.server(""),this.ssl(!1),this.port(this.defaultPort())},r.prototype.getIntPort=function(){return n.pInt(this.port())},r.prototype.parentSave=function(e,t){e.focused&&e.focused(!1);var s=i.find(t,function(e){return i.isFunction(e.save)});s&&s.save()},e.exports=r},guPB:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("p09A"),n=s("LKDt"),r=s("uQaC"),a=s("Z9uT"),l=s("69av"),c=s("Fj7m"),h=s("P7bQ"),u=s("eGl8"),d=s("Ua3z");function p(){l.call(this),this.folders=u.editedFolderList,this.sentFolderFullName=o.observable(""),this.draftsFolderFullName=o.observable(""),this.spamFolderFullName=o.observable(""),this.trashFolderFullName=o.observable(""),this.options=o.observableArray([]),this.defaultOptionsAfterRender=r.defaultOptionsAfterRender,this.bAllowSpamFolderEditing=d.AllowSpamFolder}i.extendOwn(p.prototype,l.prototype),p.prototype.PopupTemplate="MailWebclient_Settings_SetSystemFoldersPopup",p.prototype.onOpen=function(){var e=u.editedFolderList();this.options(e.getOptions(n.i18n("MAILWEBCLIENT/LABEL_NO_FOLDER_USAGE_ASSIGNED"),!1,!1,!1)),this.sentFolderFullName(e.sentFolderFullName()),this.draftsFolderFullName(e.draftsFolderFullName()),d.AllowSpamFolder&&this.spamFolderFullName(e.spamFolderFullName()),this.trashFolderFullName(e.trashFolderFullName())},p.prototype.onResponseFoldersSetupSystem=function(e,t){!1===e.Result&&(a.showErrorByCode(e,n.i18n("MAILWEBCLIENT/ERROR_SETUP_SPECIAL_FOLDERS")),u.getFolderList(c.editedId()))},p.prototype.apply=function(){var e=u.editedFolderList(),t=!1,s=null;this.sentFolderFullName()!==e.sentFolderFullName()&&(e.sentFolderFullName(this.sentFolderFullName()),t=!0),this.draftsFolderFullName()!==e.draftsFolderFullName()&&(e.draftsFolderFullName(this.draftsFolderFullName()),t=!0),d.AllowSpamFolder&&this.spamFolderFullName()!==e.spamFolderFullName()&&(e.spamFolderFullName(this.spamFolderFullName()),t=!0),this.trashFolderFullName()!==e.trashFolderFullName()&&(e.trashFolderFullName(this.trashFolderFullName()),t=!0),t&&(s={AccountID:c.editedId(),Sent:e.sentFolderFullName(),Drafts:e.draftsFolderFullName(),Trash:e.trashFolderFullName(),Spam:e.spamFolderFullName()},h.send("SetupSystemFolders",s,this.onResponseFoldersSetupSystem,this)),this.closePopup()},e.exports=new p},jSiL:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("LKDt"),a=s("uQaC"),l=s("Z9uT"),c=s("5D2l"),h=s("D2Gh"),u=s("8QQh"),d=s("PMEU"),p=s("MYiO"),m=c.run("SettingsWebclient","getAbstractSettingsFormViewClass"),b=s("Fj7m"),g=s("eGl8"),v=s("Ua3z"),A=s("cVoG");function E(e){m.call(this,v.ServerModuleName),this.oParent=e,this.bShown=!1,this.fetcher=n.observable(null),this.idFetcher=n.observable(null),this.isEnabled=n.observable(!0),this.incomingLogin=n.observable(""),this.sFakePass="******",this.incomingPassword=n.observable(this.sFakePass),this.oIncoming=new A(110,995,"fetcher_edit_incoming",r.i18n("MAILWEBCLIENT/LABEL_POP3_SERVER")),this.sFetcherFolder="",this.folder=n.observable(""),this.options=n.observableArray([]),g.folderList.subscribe(function(){this.populateOptions()},this),this.leaveMessagesOnServer=n.observable(!1),this.passwordIsSelected=n.observable(!1),this.defaultOptionsAfterRender=a.defaultOptionsAfterRender,this.fetcherIntervalHint=n.computed(function(){var e=this.fetcher()?this.fetcher().iCheckIntervalMinutes:0;return 0!==e?r.i18n("MAILWEBCLIENT/INFO_POP3_FETCHER_PLURAL",{INTERVAL:e},null,e):""},this)}i.extendOwn(E.prototype,m.prototype),E.prototype.ViewTemplate="MailWebclient_Settings_FetcherIncomingSettingsFormView",E.prototype.onShow=function(e){this.fetcher(e&&e.FETCHER?e:null),this.populateOptions(),this.populate()},E.prototype.hide=function(e){this.bShown=!1,e()},E.prototype.populateOptions=function(){this.bShown&&(this.options(g.folderList().getOptions("",!0,!1,!1)),this.sFetcherFolder!==this.folder()&&(this.folder(this.sFetcherFolder),this.updateSavedState()))},E.prototype.getCurrentValues=function(){return[this.isEnabled(),this.oIncoming.server(),this.oIncoming.port(),this.oIncoming.ssl(),this.incomingPassword(),this.folder(),this.leaveMessagesOnServer()]},E.prototype.getParametersForSave=function(){if(this.fetcher()){var e=o.trim(this.incomingPassword()),t={FetcherId:this.idFetcher(),IsEnabled:this.isEnabled(),Folder:this.folder(),IncomingServer:this.oIncoming.server(),IncomingPort:this.oIncoming.getIntPort(),IncomingUseSsl:this.oIncoming.ssl(),LeaveMessagesOnServer:this.leaveMessagesOnServer()};return""!==e&&e!==this.sFakePass&&(t.IncomingPassword=e),t}return{}},E.prototype.save=function(){this.isEmptyRequiredFields()?h.showError(r.i18n("COREWEBCLIENT/ERROR_REQUIRED_FIELDS_EMPTY")):(this.isSaving(!0),this.updateSavedState(),u.send(v.FetchersServerModuleName,"UpdateFetcher",this.getParametersForSave(),this.onResponse,this))},E.prototype.onResponse=function(e,t){this.isSaving(!1),e.Result?(b.populateFetchers(),h.showReport(r.i18n("MAILWEBCLIENT/REPORT_SUCCESSFULLY_SAVED"))):l.showErrorByCode(e,r.i18n("COREWEBCLIENT/ERROR_UNKNOWN"))},E.prototype.populate=function(){var e=this.fetcher();e&&(this.sFetcherFolder=e.folder(),this.idFetcher(e.id()),this.isEnabled(e.isEnabled()),this.folder(e.folder()),this.oIncoming.set(e.incomingServer(),e.incomingPort(),e.incomingUseSsl()),this.incomingLogin(e.incomingLogin()),this.incomingPassword(this.sFakePass),this.leaveMessagesOnServer(e.leaveMessagesOnServer()),this.updateSavedState())},E.prototype.isEmptyRequiredFields=function(){return""===this.oIncoming.server()?(this.oIncoming.server.focused(!0),!0):""===o.trim(this.incomingPassword())&&(this.passwordIsSelected(!0),!0)},E.prototype.remove=function(){var e=this.fetcher(),t=function(t){if(t){var s={FetcherId:e.id()};u.send(v.FetchersServerModuleName,"DeleteFetcher",s,this.onAccountDeleteFetcherResponse,this),this.oParent&&i.isFunction(this.oParent.onRemoveFetcher)&&this.oParent.onRemoveFetcher()}}.bind(this);e&&d.showPopup(p,[r.i18n("MAILWEBCLIENT/CONFIRM_REMOVE_FETCHER"),t,e.incomingLogin()])},E.prototype.onAccountDeleteFetcherResponse=function(e,t){e.Result||l.showErrorByCode(e,r.i18n("MAILWEBCLIENT/ERROR_FETCHER_DELETING")),b.populateFetchers()},e.exports=E},l21M:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("LKDt"),a=s("ERH9"),l=s("uQaC"),c=s("Z9uT"),h=s("5D2l"),u=s("D2Gh"),d=h.run("SettingsWebclient","getAbstractSettingsFormViewClass"),p=s("Fj7m"),m=s("P7bQ"),b=s("Ua3z");function g(e,t){d.call(this,b.ServerModuleName),this.identity=n.observable(null),this.oParent=e,this.bCreate=t,this.disableCheckbox=n.observable(!1),this.isDefault=n.observable(!1),this.email=n.observable(""),this.emailList=n.observableArray([]),this.selectedEmail=n.observable(""),this.disableEditEmail=n.observable(b.OnlyUserEmailsInIdentities),this.disableRemoveIdentity=n.observable(t),this.friendlyName=n.observable(""),this.friendlyNameHasFocus=n.observable(!1)}i.extendOwn(g.prototype,d.prototype),g.prototype.ViewTemplate="MailWebclient_Settings_IdentitySettingsFormView",g.prototype.ViewConstructorName="CIdentitySettingsFormView",g.prototype.onShow=function(e){this.identity(e&&!e.FETCHER?e:null),this.populate()},g.prototype.getCurrentValues=function(){return[this.friendlyName(),this.email()]},g.prototype.getParametersForSave=function(){if(this.identity()){var e={AccountID:this.identity().accountId(),Default:this.isDefault(),FriendlyName:this.friendlyName(),AccountPart:this.identity().bAccountPart};return this.identity().bAccountPart||(i.extendOwn(e,{Email:this.emailList().length>0?o.trim(this.selectedEmail()):o.trim(this.email())}),this.bCreate||(e.EntityId=this.identity().id())),e}return{}},g.prototype.save=function(){""===o.trim(this.email())?u.showError(l.i18n("MAILWEBCLIENT/ERROR_IDENTITY_FIELDS_BLANK")):(this.isSaving(!0),this.updateSavedState(),m.send(this.bCreate?"CreateIdentity":"UpdateIdentity",this.getParametersForSave(),this.onResponse,this))},g.prototype.onResponse=function(e,t){if(this.isSaving(!1),e.Result){var s=t.Parameters,o=a.pInt(s.AccountID),n=0<o?p.getAccount(o):null;p.populateIdentities(function(){var t=p.getCurrent().identities(),s=i.find(t,function(t){return t.id()===e.Result});s&&h.run("SettingsWebclient","setAddHash",[["identity",s.hash()]])}),this.bCreate&&i.isFunction(this.oParent.closePopup)&&this.oParent.closePopup(),s.AccountPart&&n&&n.updateFriendlyName(s.FriendlyName),this.disableCheckbox(this.isDefault()),u.showReport(r.i18n("COREWEBCLIENT/REPORT_SETTINGS_UPDATE_SUCCESS"))}else c.showErrorByCode(e,r.i18n("MAILWEBCLIENT/ERROR_IDENTITY_ADDING"))},g.prototype.populate=function(){var e=this.identity();if(e){if(this.isDefault(e.isDefault()),this.email(e.email()),this.disableEditEmail(b.OnlyUserEmailsInIdentities||e.bAccountPart),this.disableRemoveIdentity(this.bCreate||e.bAccountPart),this.emailList([]),b.OnlyUserEmailsInIdentities&&!e.bAccountPart){var t=[],s=p.getAccount(e.accountId());s&&(t=s.aExtend.Aliases),a.isNonEmptyArray(t)&&(this.emailList(i.clone(t)),this.emailList.unshift(e.email()),this.selectedEmail(e.email()))}this.friendlyName(e.friendlyName()),this.disableCheckbox(e.isDefault()),setTimeout(function(){this.updateSavedState()}.bind(this),1)}},g.prototype.remove=function(){if(this.identity()&&!this.identity().bAccountPart){var e={AccountID:this.identity().accountId(),EntityId:this.identity().id()};m.send("DeleteIdentity",e,this.onAccountIdentityDeleteResponse,this),!this.bCreate&&i.isFunction(this.oParent.onRemoveIdentity)&&this.oParent.onRemoveIdentity()}},g.prototype.onAccountIdentityDeleteResponse=function(e,t){e.Result||c.showErrorByCode(e,r.i18n("MAILWEBCLIENT/ERROR_IDENTITY_DELETING")),p.populateIdentities()},g.prototype.cancel=function(){i.isFunction(this.oParent.cancelPopup)&&this.oParent.cancelPopup()},e.exports=g},lsKY:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("LKDt"),a=s("ERH9"),l=s("5RIG"),c=s("Z9uT"),h=s("69av"),u=s("Fj7m"),d=s("P7bQ"),p=s("YmTJ"),m=s("qN2P");function b(){h.call(this),this.loading=n.observable(!1),this.friendlyName=n.observable(""),this.email=n.observable(""),this.email.focused=n.observable(!1),this.incomingLogin=n.observable(""),this.incomingLogin.focused=n.observable(!1),this.incomingPassword=n.observable(""),this.incomingPassword.focused=n.observable(!1),this.oServerPairPropertiesView=new m("acc_create"),this.email.focused.subscribe(function(){this.email.focused()||""!==o.trim(this.incomingLogin())||this.incomingLogin(this.email())},this),this.aRequiredFields=[this.email,this.incomingLogin,this.incomingPassword].concat(this.oServerPairPropertiesView.aRequiredFields)}i.extendOwn(b.prototype,h.prototype),b.prototype.PopupTemplate="MailWebclient_Settings_CreateAccountPopup",b.prototype.init=function(){this.friendlyName(""),this.email(""),this.incomingLogin(""),this.incomingLogin.focused(!1),this.incomingPassword(""),this.oServerPairPropertiesView.fullInit()},b.prototype.onOpen=function(e,t,s,i){this.fCallback=e,this.init(),this.friendlyName(t),this.email(s),this.incomingLogin(s),this.incomingPassword(i),this.focusFieldToEdit()},b.prototype.focusFieldToEdit=function(){var e=i.find(this.aRequiredFields,function(e){return""===e()});e?e.focused(!0):this.aRequiredFields.length>0&&this.aRequiredFields[0].focused(!0)},b.prototype.onClose=function(){this.init()},b.prototype.save=function(){if(l.checkIfFieldsEmpty(this.aRequiredFields,r.i18n("COREWEBCLIENT/ERROR_REQUIRED_FIELDS_EMPTY"))){var e={FriendlyName:this.friendlyName(),Email:o.trim(this.email()),IncomingLogin:o.trim(this.incomingLogin()),IncomingPassword:o.trim(this.incomingPassword()),Server:this.oServerPairPropertiesView.getParametersForSave()};this.loading(!0),d.send("CreateAccount",e,this.onAccountCreateResponse,this)}else this.loading(!1)},b.prototype.onAccountCreateResponse=function(e,t){if(this.loading(!1),e.Result){var s=a.pInt(e.Result.AccountID),i=new p(e.Result);u.addAccount(i),u.populateIdentities(),u.changeEditedAccount(s),1===u.collection().length&&u.changeCurrentAccount(s),this.fCallback&&this.fCallback(s),this.closePopup()}else c.showErrorByCode(e,r.i18n("MAILWEBCLIENT/ERROR_CREATE_ACCOUNT"))},e.exports=new b},oq0M:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("p09A"),n=s("LKDt"),r=s("Ua3z"),a=s("cR1d"),l=s("Fj7m"),c=s("eGl8");function h(){a.call(this,n.i18n("MAILWEBCLIENT/ACTION_SHOW_MAIL")),this.unseenCount=c.newMessagesCount,this.inactiveTitle=o.computed(function(){return n.i18n("MAILWEBCLIENT/HEADING_UNREAD_MESSAGES_BROWSER_TAB_PLURAL",{COUNT:this.unseenCount()},null,this.unseenCount())+" - "+l.getEmail()},this),this.accounts=o.computed(function(){return i.map(l.collection(),function(e){return{bCurrent:e.isCurrent(),sText:r.UserLoginPartInAccountDropdown?e.email().split("@")[0]:e.email(),changeAccount:e.changeAccount.bind(e)}})},this),r.ShowEmailAsTabName&&(this.linkText=o.computed(function(){var e=i.find(this.accounts(),function(e){return e.bCurrent});return e?e.sText:n.i18n("MAILWEBCLIENT/HEADING_BROWSER_TAB")},this)),this.mainHref=o.computed(function(){return this.isCurrent()?"javascript: void(0);":this.hash()},this)}i.extendOwn(h.prototype,a.prototype),h.prototype.ViewTemplate="MailWebclient_HeaderItemView";var u=new h;u.allowChangeTitle(!0),e.exports=u},p6Kc:(e,t,s)=>{"use strict";var i=s("ERH9");function o(){this.iAccountId=0,this.enable=!1,this.keepcopy=!1,this.email=""}o.prototype.parse=function(e,t){this.iAccountId=e,this.enable=!!t.Enable,this.keepcopy=!!t.KeepMessageCopy,this.email=i.pString(t.Email)},e.exports=o},qN2P:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("LKDt"),a=s("ERH9"),l=s("5RIG"),c=s("Z9uT"),h=s("yU9o"),u=s("P7bQ"),d=s("Ua3z"),p=s("UVn1"),m=s("cVoG");function b(e,t,s){var o={aOauthConnectorsData:[]};h.broadcastEvent("MailWebclient::GetOauthConnectorsData",o),this.bVisibleOauthSettings=t&&a.isNonEmptyArray(o.aOauthConnectorsData),this.aOauthConnectorsData=a.pArray(o.aOauthConnectorsData),this.oauthSelectedConnector=n.observable(""),this.iServersPerPage=a.pInt(s,0),this.totalServersCount=n.observable(0),this.servers=n.observableArray([]),this.serversRetrieved=n.observable(!1),this.serverOptions=n.observableArray([{Name:r.i18n("MAILWEBCLIENT/LABEL_CONFIGURE_SERVER_MANUALLY"),Id:0}]),this.selectedServerId=n.observable(0),this.oLastEditableServer=new p,this.iEditedServerId=0,this.selectedServerId.subscribe(function(){var e=this.selectedServerId(),t=i.find(this.servers(),function(t){return t.iId===e});t?(this.oIncoming.isEnabled()&&(this.oLastEditableServer=new p(this.getParametersForSave())),this.setExternalAccessServers(t.bSetExternalAccessServers),this.externalAccessImapServer(t.sExternalAccessImapServer),this.externalAccessImapPort(t.iExternalAccessImapPort),this.externalAccessImapAlterPort(t.iExternalAccessImapAlterPort>0?t.iExternalAccessImapAlterPort:""),this.externalAccessImapUseSsl(t.bExternalAccessImapUseSsl),this.externalAccessPop3Server(t.sExternalAccessPop3Server),this.externalAccessPop3Port(t.iExternalAccessPop3Port),this.externalAccessPop3AlterPort(t.iExternalAccessPop3AlterPort>0?t.iExternalAccessPop3AlterPort:""),this.externalAccessPop3UseSsl(t.bExternalAccessPop3UseSsl),this.externalAccessSmtpServer(t.sExternalAccessSmtpServer),this.externalAccessSmtpPort(t.iExternalAccessSmtpPort),this.externalAccessSmtpAlterPort(t.iExternalAccessSmtpAlterPort>0?t.iExternalAccessSmtpAlterPort:""),this.externalAccessSmtpUseSsl(t.bExternalAccessSmtpUseSsl),this.oauthSelectedConnector(t.bOauthEnable?t.sOauthType:""),this.tenantId(t.iTenantId),this.name(t.sName),this.oIncoming.set(t.sIncomingServer,t.iIncomingPort,t.bIncomingUseSsl),this.oIncoming.isEnabled(this.bAdminEdit),this.oOutgoing.set(t.sOutgoingServer,t.iOutgoingPort,t.bOutgoingUseSsl),this.oOutgoing.isEnabled(this.bAdminEdit),this.outgoingUseAuth(t.sSmtpAuthType===window.Enums.SmtpAuthType.UseUserCredentials),this.outgoingUseAuth.enable(this.bAdminEdit),this.domains(t.sDomains),this.smtpAuthType(t.sSmtpAuthType),this.smtpLogin(t.sSmtpLogin),this.smtpPassword(t.sSmtpPassword),this.enableSieve(t.bEnableSieve),this.sievePort(t.iSievePort),this.enableThreading(t.bEnableThreading),this.useFullEmailAddressAsLogin(t.bUseFullEmailAddressAsLogin)):(this.setExternalAccessServers(this.oLastEditableServer.bSetExternalAccessServers),this.externalAccessImapServer(this.oLastEditableServer.sExternalAccessImapServer),this.externalAccessImapPort(this.oLastEditableServer.iExternalAccessImapPort),this.externalAccessImapAlterPort(this.oLastEditableServer.iExternalAccessImapAlterPort>0?this.oLastEditableServer.iExternalAccessImapAlterPort:""),this.externalAccessImapUseSsl(this.oLastEditableServer.bExternalAccessImapUseSsl),this.externalAccessPop3Server(this.oLastEditableServer.sExternalAccessPop3Server),this.externalAccessPop3Port(this.oLastEditableServer.iExternalAccessPop3Port),this.externalAccessPop3AlterPort(this.oLastEditableServer.iExternalAccessPop3AlterPort>0?this.oLastEditableServer.iExternalAccessPop3AlterPort:""),this.externalAccessPop3UseSsl(this.oLastEditableServer.bExternalAccessPop3UseSsl),this.externalAccessSmtpServer(this.oLastEditableServer.sExternalAccessSmtpServer),this.externalAccessSmtpPort(this.oLastEditableServer.iExternalAccessSmtpPort),this.externalAccessSmtpAlterPort(this.oLastEditableServer.iExternalAccessSmtpAlterPort>0?this.oLastEditableServer.iExternalAccessSmtpAlterPort:""),this.externalAccessSmtpUseSsl(this.oLastEditableServer.bExternalAccessSmtpUseSsl),this.oauthSelectedConnector(this.oLastEditableServer.bOauthEnable?this.oLastEditableServer.sOauthType:""),this.tenantId(0),this.name(this.oLastEditableServer.sName),this.oIncoming.set(this.oLastEditableServer.sIncomingServer,this.oLastEditableServer.iIncomingPort,this.oLastEditableServer.bIncomingUseSsl),this.oIncoming.isEnabled(!0),this.oOutgoing.set(this.oLastEditableServer.sOutgoingServer,this.oLastEditableServer.iOutgoingPort,this.oLastEditableServer.bOutgoingUseSsl),this.oOutgoing.isEnabled(!0),this.outgoingUseAuth(this.oLastEditableServer.sSmtpAuthType===window.Enums.SmtpAuthType.UseUserCredentials),this.outgoingUseAuth.enable(!0),this.domains(""),this.smtpAuthType(window.Enums.SmtpAuthType.UseUserCredentials),this.smtpLogin(""),this.smtpPassword(""),this.enableSieve(!1),this.sievePort(4190),this.enableThreading(!0),this.useFullEmailAddressAsLogin(!0)),this.setCurrentValues()},this),this.tenantId=n.observable(0),this.name=n.observable(""),this.name.focused=n.observable(!1),this.bAdminEdit=t,this.oIncoming=new m(143,993,e+"_incoming",r.i18n("MAILWEBCLIENT/LABEL_IMAP_SERVER"),null),this.oOutgoing=new m(25,465,e+"_outgoing",r.i18n("MAILWEBCLIENT/LABEL_SMTP_SERVER"),this.oIncoming.server),this.outgoingUseAuth=n.observable(!0),this.outgoingUseAuth.enable=n.observable(!0),this.domains=n.observable(""),this.bAllowEditDomains=d.AllowEditDomainsInServer,this.smtpAuthType=n.observable(window.Enums.SmtpAuthType.UseUserCredentials),this.smtpLogin=n.observable(""),this.smtpPassword=n.observable(""),this.enableSieve=n.observable(!1),this.sievePort=n.observable(4190),this.enableThreading=n.observable(!0),this.useFullEmailAddressAsLogin=n.observable(!0),this.currentValues=n.observable(""),this.aRequiredFields=[this.oIncoming.server,this.oIncoming.port,this.oOutgoing.server,this.oOutgoing.port],t&&this.aRequiredFields.unshift(this.name),this.setExternalAccessServers=n.observable(!1),this.externalAccessImapServer=n.observable(this.oIncoming.server()),this.externalAccessImapPort=n.observable(this.oIncoming.port()),this.externalAccessImapAlterPort=n.observable(""),this.externalAccessImapUseSsl=n.observable(!1),this.externalAccessPop3Server=n.observable(""),this.externalAccessPop3Port=n.observable(110),this.externalAccessPop3AlterPort=n.observable(""),this.externalAccessPop3UseSsl=n.observable(!1),this.externalAccessSmtpServer=n.observable(this.oOutgoing.server()),this.externalAccessSmtpPort=n.observable(this.oOutgoing.port()),this.externalAccessSmtpAlterPort=n.observable(""),this.externalAccessSmtpUseSsl=n.observable(!1),n.computed(function(){this.setExternalAccessServers()||(this.externalAccessImapServer(this.oIncoming.server()),this.externalAccessImapPort(this.oIncoming.port()),this.externalAccessImapAlterPort(""),this.externalAccessImapUseSsl(this.oIncoming.ssl()),this.externalAccessPop3Server(""),this.externalAccessPop3Port(110),this.externalAccessPop3AlterPort(""),this.externalAccessPop3UseSsl(!1),this.externalAccessSmtpServer(this.oOutgoing.server()),this.externalAccessSmtpPort(this.oOutgoing.port()),this.externalAccessSmtpAlterPort(""),this.externalAccessSmtpUseSsl(this.oOutgoing.ssl()))},this)}b.prototype.ViewTemplate="MailWebclient_Settings_ServerPairPropertiesView",b.prototype.serverInit=function(e){this.setServer(e?new p:this.oLastEditableServer)},b.prototype.fullInit=function(){this.setServer(this.oLastEditableServer),this.serversRetrieved()||this.requestServers()},b.prototype.setServer=function(e){this.oLastEditableServer=e,this.setServerId(e.iId)},b.prototype.setServerId=function(e){if(this.serversRetrieved()||0===e){var t=0===this.selectedServerId();this.selectedServerId(0),this.selectedServerId(e),t&&0===e&&this.selectedServerId.valueHasMutated()}else this.iEditedServerId=e},b.prototype.requestServers=function(e,t){var s=i.isFunction(h.getTenantId)?h.getTenantId():0;this.serversRetrieved(!1),u.send("GetServers",{TenantId:s,Offset:a.pInt(e,0),Limit:this.iServersPerPage,Search:a.pString(t,"")},function(e){if(i.isArray(e&&e.Result&&e.Result.Items)){var t=[{Name:r.i18n("MAILWEBCLIENT/LABEL_CONFIGURE_SERVER_MANUALLY"),Id:0}];i.each(e.Result.Items,function(e){t.push({Name:e.Name,Id:a.pInt(e.EntityId)})}),this.servers(i.map(e.Result.Items,function(e){return new p(e)})),this.totalServersCount(e.Result.Count),this.serverOptions(t),this.serversRetrieved(!0),this.iEditedServerId&&(this.setServerId(this.iEditedServerId),this.iEditedServerId=0)}else c.showErrorByCode(e)},this)},b.prototype.clear=function(){this.oIncoming.clear(),this.oOutgoing.clear(),this.outgoingUseAuth(!0)},b.prototype.setCurrentValues=function(){var e=this.bAdminEdit?[this.selectedServerId(),this.name()]:[],t=[this.oIncoming.port(),this.oIncoming.server(),this.oIncoming.ssl(),this.oOutgoing.port(),this.oOutgoing.server(),this.oOutgoing.ssl(),this.outgoingUseAuth(),this.domains(),this.smtpAuthType(),this.smtpLogin(),this.smtpPassword(),this.enableSieve(),this.sievePort(),this.enableThreading(),this.useFullEmailAddressAsLogin(),this.setExternalAccessServers(),this.externalAccessImapServer(),this.externalAccessImapPort(),this.externalAccessImapAlterPort(),this.externalAccessImapUseSsl(),this.externalAccessPop3Server(),this.externalAccessPop3Port(),this.externalAccessPop3AlterPort(),this.externalAccessPop3UseSsl(),this.externalAccessSmtpServer(),this.externalAccessSmtpPort(),this.externalAccessSmtpAlterPort(),this.externalAccessSmtpUseSsl(),this.oauthSelectedConnector()];this.currentValues(e.concat(t).join(":"))},b.prototype.getCurrentValues=function(){return this.setCurrentValues(),[this.currentValues()]},b.prototype.getSmtpAuthType=function(){return this.bAdminEdit||this.smtpAuthType()===window.Enums.SmtpAuthType.UseSpecifiedCredentials?this.smtpAuthType():this.outgoingUseAuth()?window.Enums.SmtpAuthType.UseUserCredentials:window.Enums.SmtpAuthType.NoAuthentication},b.prototype.getParametersForSave=function(){var e=this.selectedServerId(),t=this.oLastEditableServer.iId,s=this.getSmtpAuthType(),n={};0!==e||i.find(this.servers(),function(e){return t===e.iId})||(e=t),n={ServerId:e,Name:this.bAdminEdit?this.name():this.oIncoming.server(),IncomingServer:this.oIncoming.server(),IncomingPort:this.oIncoming.getIntPort(),IncomingUseSsl:this.oIncoming.ssl(),OutgoingServer:this.oOutgoing.server(),OutgoingPort:this.oOutgoing.getIntPort(),OutgoingUseSsl:this.oOutgoing.ssl(),Domains:this.domains(),SmtpAuthType:s,SmtpLogin:s===window.Enums.SmtpAuthType.UseSpecifiedCredentials?o.trim(this.smtpLogin()):"",SmtpPassword:s===window.Enums.SmtpAuthType.UseSpecifiedCredentials?o.trim(this.smtpPassword()):"",EnableSieve:this.enableSieve(),SievePort:this.sievePort(),EnableThreading:this.enableThreading(),UseFullEmailAddressAsLogin:this.useFullEmailAddressAsLogin(),SetExternalAccessServers:this.setExternalAccessServers()},this.setExternalAccessServers()&&(n.ExternalAccessImapServer=this.externalAccessImapServer(),n.ExternalAccessImapPort=this.externalAccessImapPort(),n.ExternalAccessImapAlterPort=a.pInt(this.externalAccessImapAlterPort(),0),n.ExternalAccessImapUseSsl=this.externalAccessImapUseSsl(),n.ExternalAccessPop3Server=this.externalAccessPop3Server(),n.ExternalAccessPop3Port=this.externalAccessPop3Port(),n.ExternalAccessPop3AlterPort=a.pInt(this.externalAccessPop3AlterPort(),0),n.ExternalAccessPop3UseSsl=this.externalAccessPop3UseSsl(),n.ExternalAccessSmtpServer=this.externalAccessSmtpServer(),n.ExternalAccessSmtpPort=this.externalAccessSmtpPort(),n.ExternalAccessSmtpAlterPort=a.pInt(this.externalAccessSmtpAlterPort(),0),n.ExternalAccessSmtpUseSsl=this.externalAccessSmtpUseSsl());var r=i.find(this.aOauthConnectorsData,function(e){return e.Type===this.oauthSelectedConnector()},this);return n.OAuthEnable=!!r,r&&(n.OAuthName=r.Name,n.OAuthType=r.Type,n.OAuthIconUrl=r.IconUrl),n},b.prototype.validateBeforeSave=function(){return l.checkIfFieldsEmpty(this.aRequiredFields,r.i18n("COREWEBCLIENT/ERROR_REQUIRED_FIELDS_EMPTY"))},b.prototype.onDomainsClick=function(){this.bAllowEditDomains||(o(".tabsbar .item.admin.domain").removeClass("recivedAnim"),setTimeout(function(){o(".tabsbar .item.admin.domain").addClass("recivedAnim")}))},e.exports=b},qpcR:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("LKDt"),a=s("ERH9"),l=s("5RIG"),c=s("3cxN"),h=s("Z9uT"),u=s("69av"),d=s("8QQh"),p=s("PMEU"),m=s("lsKY"),b=s("5D2l"),g=s("zVyH"),v=s("Fj7m"),A=s("P7bQ"),E=s("YmTJ"),S=s("UVn1");function f(){u.call(this),this.oauthOptions=n.observableArray([]),this.oauthOptionsVisible=n.observable(!1),this.bOAuthCallbackExecuted=!1,this.loading=n.observable(!1),this.friendlyName=n.observable(""),this.email=n.observable(""),this.email.focused=n.observable(!1),this.password=n.observable(""),this.password.focused=n.observable(!1),this.aRequiredFields=[this.email,this.password]}i.extendOwn(f.prototype,u.prototype),f.prototype.PopupTemplate="MailWebclient_Settings_CreateAccountShortFormPopup",f.prototype.init=function(){this.friendlyName(""),this.email(""),this.password("")},f.prototype.onOpen=function(e,t){this.oauthOptions(e),this.oauthOptionsVisible(this.oauthOptions().length>0),this.fCallback=t,this.init(),this.focusFieldToEdit()},f.prototype.selectAuthOption=function(e){""===e?this.oauthOptionsVisible(!1):this.getOAuthData(e)},f.prototype.focusFieldToEdit=function(){var e=i.find(this.aRequiredFields,function(e){return""===e()});e?e.focused(!0):this.aRequiredFields.length>0&&this.aRequiredFields[0].focused(!0)},f.prototype.onClose=function(){this.init()},f.prototype.getOAuthData=function(e){o.cookie("oauth-scopes","mail"),o.cookie("oauth-redirect","connect"),this.bOAuthCallbackExecuted=!1,window.gmailConnectCallback=function(e,t,s){this.bOAuthCallbackExecuted=!0,e?d.send("OAuthIntegratorWebclient","CreateMailAccount",{OAuthAccountData:e},this.onAccountCreateResponse,this):h.showErrorByCode({ErrorCode:a.pInt(t),Module:s},"",!0)}.bind(this);var t=g.open(c.getAppPath()+"?oauth="+e+"-connect","OAuth"),s=setInterval(function(){t.closed&&(clearInterval(s),this.bOAuthCallbackExecuted||window.location.reload())}.bind(this),1e3)},f.prototype.save=function(){if(l.checkIfFieldsEmpty(this.aRequiredFields,r.i18n("COREWEBCLIENT/ERROR_REQUIRED_FIELDS_EMPTY"))){var e={Domain:o.trim(this.email()).split("@")[1],AllowWildcardDomain:!0};this.loading(!0),A.send("GetMailServerByDomain",e,this.onGetMailServerByDomain,this)}else this.loading(!1)},f.prototype.onGetMailServerByDomain=function(e,t){var s=null;if(e.Result&&void 0!==e.Result.Server&&void 0!==e.Result.FoundWithWildcard)if(e.Result.FoundWithWildcard){var n=o.trim(this.email()).split("@")[1],r=v.getDefault()?v.getDefault().email():"";n===o.trim(r).split("@")[1]&&(s=new S(e.Result.Server))}else s=new S(e.Result.Server);if(s){var a={FriendlyName:this.friendlyName(),Email:o.trim(this.email()),IncomingLogin:o.trim(this.email()),IncomingPassword:o.trim(this.password()),Server:{ServerId:s.iId}};A.send("CreateAccount",a,this.onAccountCreateResponse,this)}else this.loading(!1),p.showPopup(m,[i.bind(function(e){var t=v.getAccount(e);t&&this.editAccount(t.hash())},this),this.friendlyName(),o.trim(this.email()),o.trim(this.password())]),this.closePopup()},f.prototype.onAccountCreateResponse=function(e,t){if(this.loading(!1),e.Result){var s=a.pInt(e.Result.AccountID),i=new E(e.Result);v.addAccount(i),v.populateIdentities(),v.changeEditedAccount(s),1===v.collection().length&&v.changeCurrentAccount(s),this.fCallback&&this.fCallback(s),this.closePopup()}else h.showErrorByCode(e,r.i18n("MAILWEBCLIENT/ERROR_CREATE_ACCOUNT"))},f.prototype.editAccount=function(e){b.run("SettingsWebclient","setAddHash",[["account",e]])},e.exports=new f},r79L:(e,t,s)=>{"use strict";function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var s={}.toString.call(e).slice(8,-1);return"Object"===s&&e.constructor&&(s=e.constructor.name),"Map"===s||"Set"===s?Array.from(e):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,i=Array(t);s<t;s++)i[s]=e[s];return i}var n=s("a7T2"),r=s("p09A"),a=s("LKDt"),l=s("ERH9"),c=s("Z9uT"),h=s("D2Gh"),u=s("5D2l").run("SettingsWebclient","getAbstractSettingsFormViewClass"),d=s("Fj7m"),p=s("P7bQ"),m=s("eGl8"),b=s("Ua3z"),g=s("0HIo"),v=s("sHZb");function A(){u.call(this,b.ServerModuleName),this.bShown=!1,this.foldersOptions=r.observableArray([]),m.editedFolderList.subscribe(function(){this.bShown&&this.populate()},this),this.loading=r.observable(!0),this.collection=r.observableArray([]),this.fieldOptions=[{text:a.i18n("MAILWEBCLIENT/LABEL_FROM"),value:0},{text:a.i18n("MAILWEBCLIENT/LABEL_TO"),value:1},{text:a.i18n("MAILWEBCLIENT/LABEL_SUBJECT"),value:2}],this.conditionOptions=[{text:a.i18n("MAILWEBCLIENT/LABEL_CONTAINING"),value:0},{text:a.i18n("MAILWEBCLIENT/LABEL_EQUAL_TO"),value:1},{text:a.i18n("MAILWEBCLIENT/LABEL_NOT_CONTAINING"),value:2}],this.actionOptions=[{text:a.i18n("MAILWEBCLIENT/LABEL_MOVE_FILTER_ACTION"),value:3},{text:a.i18n("MAILWEBCLIENT/LABEL_REDIRECT_FILTER_ACTION"),value:7},{text:a.i18n("MAILWEBCLIENT/LABEL_DELETE_FILTER_ACTION"),value:1}],this.phaseArray=[""],n.each(a.i18n("MAILWEBCLIENT/INFO_FILTER").split(/,{0,1}\s/),function(e){var t=this.phaseArray.length-1;"%"===e.substr(0,1)||"%"===this.phaseArray[t].substr(-1,1)?this.phaseArray.push(e):this.phaseArray[t]+=" "+e},this),this.firstState=null}n.extendOwn(A.prototype,u.prototype),A.prototype.ViewTemplate="MailWebclient_Settings_AccountFiltersSettingsFormView",A.prototype.onShow=function(){this.populate()},A.prototype.onHide=function(){this.bShown=!1},A.prototype.populate=function(){var e=m.editedFolderList(),t=[];e.iAccountId===d.editedId()?(t=e.getOptions(a.i18n("MAILWEBCLIENT/LABEL_FOLDER_NOT_SELECTED"),!0,!0,!1,!0),this.foldersOptions(t),this.populateFilters()):(this.loading(!0),this.collection([]))},A.prototype.revert=function(){var e=d.getEdited();e&&null!==e.filters()?this.collection(i(e.filters().collection())):this.collection([]),this.updateSavedState()},A.prototype.commit=function(){n.each(this.collection(),function(e){e.commit()})},A.prototype.getCurrentValues=function(){return n.map(this.collection(),function(e){return e.toString()},this)},A.prototype.getParametersForSave=function(){var e=n.map(this.collection(),function(e){return{Enable:e.enable()?"1":"0",Field:e.field(),Filter:e.filter(),Condition:e.condition(),Action:e.action(),FolderFullName:e.folder(),Email:e.email()}});return{AccountID:d.editedId(),Filters:e}},A.prototype.save=function(){n.some(this.collection(),function(e){return""===e.filter()||"3"===l.pString(e.action())&&""===e.folder()})?h.showError(a.i18n("MAILWEBCLIENT/ERROR_FILTER_FIELDS_EMPTY")):(this.isSaving(!0),this.commit(),this.updateSavedState(),p.send("UpdateFilters",this.getParametersForSave(),this.onAccountSieveFiltersUpdateResponse,this))},A.prototype.populateFilters=function(){var e=d.getEdited();e&&(null!==e.filters()?(this.loading(!1),this.collection(i(e.filters().collection())),this.updateSavedState()):(this.loading(!0),this.collection([]),p.send("GetFilters",{AccountID:e.id()},this.onGetFiltersResponse,this)))},A.prototype.deleteFilter=function(e){this.collection.remove(e)},A.prototype.addFilter=function(){var e=new g(d.editedId());this.collection.push(e)},A.prototype.displayFilterPart=function(e,t){return t+("%FIELD%"===e?"Field":"%CONDITION%"===e?"Condition":"%STRING%"===e?"String":"%ACTION%"===e?"Action":"%FOLDER%"===e?"Folder":"%EMAIL%"===e?"Email":"%DEPENDED"===e.substr(0,9)?"DependedText":"Text")},A.prototype.getDependedText=function(e){return(e=l.pString(e))&&(e=e.replace(/%/g,"").split("=")[1]||""),e},A.prototype.getDependedField=function(e,t){return(e=l.pString(e))&&(e=(e=e.replace(/[=](.*)/g,"").split("-")[1]||"").toLowerCase()),!!t[e]&&t[e]()},A.prototype.onGetFiltersResponse=function(e,t){var s=t.Parameters,i=l.pInt(s.AccountID),o=d.getAccount(i),n=new v;this.loading(!1),e&&e.Result&&o?(n.parse(i,e.Result),o.filters(n),i===d.editedId()&&this.populateFilters()):h.showError(a.i18n("COREWEBCLIENT/ERROR_UNKNOWN"))},A.prototype.onAccountSieveFiltersUpdateResponse=function(e,t){this.isSaving(!1);var s=d.getEdited();e&&e.Result?(h.showReport(a.i18n("MAILWEBCLIENT/REPORT_FILTERS_UPDATE_SUCCESS")),s&&s.filters().collection(i(this.collection()))):c.showErrorByCode(e,a.i18n("COREWEBCLIENT/ERROR_SAVING_SETTINGS_FAILED"))},e.exports=new A},wvqg:(e,t,s)=>{"use strict";var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("LKDt"),a=s("Z9uT"),l=s("5D2l"),c=s("D2Gh"),h=s("8QQh"),u=l.run("SettingsWebclient","getAbstractSettingsFormViewClass"),d=s("Fj7m"),p=s("Ua3z"),m=s("cVoG");function b(){u.call(this,p.ServerModuleName),this.fetcher=n.observable(null),this.idFetcher=n.observable(null),this.isEnabled=n.observable(!0),this.email=n.observable(""),this.userName=n.observable(""),this.isOutgoingEnabled=n.observable(!1),this.focusEmail=n.observable(!1),this.oOutgoing=new m(25,465,"fetcher_edit_outgoing",r.i18n("MAILWEBCLIENT/LABEL_SMTP_SERVER")),this.outgoingUseAuth=n.observable(!1),this.isAllEnabled=n.computed(function(){return this.isEnabled()&&this.isOutgoingEnabled()},this),this.isAllEnabled.subscribe(function(){this.oOutgoing.isEnabled(this.isAllEnabled())},this),this.oOutgoing.isEnabled(this.isAllEnabled()),this.firstState=null}i.extendOwn(b.prototype,u.prototype),b.prototype.ViewTemplate="MailWebclient_Settings_FetcherOutgoingSettingsFormView",b.prototype.onShow=function(e){this.fetcher(e&&e.FETCHER?e:null),this.populate()},b.prototype.getCurrentValues=function(){return[this.isOutgoingEnabled(),this.oOutgoing.server(),this.oOutgoing.port(),this.oOutgoing.ssl(),this.outgoingUseAuth(),this.userName(),this.email()]},b.prototype.getParametersForSave=function(){return this.fetcher()?{FetcherId:this.idFetcher(),IsOutgoingEnabled:this.isOutgoingEnabled(),Email:o.trim(this.email()),Name:this.userName(),OutgoingServer:this.oOutgoing.server(),OutgoingPort:this.oOutgoing.getIntPort(),OutgoingUseSsl:this.oOutgoing.ssl(),OutgoingUseAuth:this.outgoingUseAuth()}:{}},b.prototype.save=function(){this.isEnabled()&&(this.isEmptyRequiredFields()?c.showError(r.i18n("COREWEBCLIENT/ERROR_REQUIRED_FIELDS_EMPTY")):(this.isSaving(!0),this.updateSavedState(),h.send(p.FetchersServerModuleName,"UpdateFetcherSmtpSettings",this.getParametersForSave(),this.onResponse,this)))},b.prototype.onResponse=function(e,t){this.isSaving(!1),e.Result?(d.populateFetchers(),c.showReport(r.i18n("MAILWEBCLIENT/REPORT_SUCCESSFULLY_SAVED"))):a.showErrorByCode(e,r.i18n("COREWEBCLIENT/ERROR_UNKNOWN"))},b.prototype.populate=function(){var e=this.fetcher();e&&(this.fetcher(e),this.idFetcher(e.id()),this.isEnabled(e.isEnabled()),this.email(e.email()),this.userName(e.userName()),this.isOutgoingEnabled(e.isOutgoingEnabled()),this.oOutgoing.set(e.outgoingServer(),e.outgoingPort(),e.outgoingUseSsl()),this.outgoingUseAuth(e.outgoingUseAuth()),this.updateSavedState())},b.prototype.isEmptyRequiredFields=function(){if(this.isOutgoingEnabled()){if(this.outgoingUseAuth()&&this.isOutgoingEnabled()&&""===this.oOutgoing.server())return this.oOutgoing.server.focused(!0),!0;if(this.outgoingUseAuth()&&""===o.trim(this.email()))return this.focusEmail(!0),!0}return!1},e.exports=new b}}]);