Server : Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6
System : Windows NT USER-PC 6.1 build 7601 (Windows 7 Professional Edition Service Pack 1) AMD64
User : User ( 0)
PHP Version : 7.4.6
Disable Function : NONE
Directory :  C:/Program Files/Avast Software/Avast/gui_resources/1.0.663/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : C:/Program Files/Avast Software/Avast/gui_resources/1.0.663/Antispam.js
//{"name":"Antispam","version":"1.2.457","created":"2021-09-06T10:52:30.834Z"}
import t from"./ractive.js";import{eventer as s,napiTracker as e,serviceRequest as i}from"./napi.js";import{productModel as a,ipmService as n}from"./napiExtensions.js";import{logger as l}from"./libs.js";import{modals as o}from"./ractiveComponents.js";import{nls as r}from"./i18n.js";const c=t.extend({template:{v:3,t:[{t:7,e:"Page",a:{heading:[{t:3,x:{r:["nls"],s:'_0("antispam")'}}],cssCls:"ats",settingsUrl:[{t:2,x:{r:["licensed"],s:'_0?"#Settings/Antispam":""'}}],upsell:[{t:2,x:{r:["licensed"],s:"!_0"}}],inactive:[{t:2,x:{r:["shieldActive"],s:"!_0"}}],inactiveMsg:[{t:3,x:{r:["nls"],s:'_0("antispam.inactive.tooltip")'}}],backHash:"#privacy"},f:[{t:7,e:"div",a:{slot:"breadcrumbs"},f:[{t:7,e:"Crumbs",a:{customBreadcrumbs:["[{title: ",{t:3,x:{r:["nls"],s:'_0("privacy")'}},", url : '#privacy', section: true}, {title: ",{t:3,x:{r:["nls"],s:'_0("antispam")'}},", url: '#SecurityAntispam'}]"]}}]}," ",{t:7,e:"div",a:{slot:"controls"},f:[{t:7,e:"kin-switch",a:{"data-test":"ats_switch","kin-checked":[{t:2,r:"shieldActive"}],processing:[{t:2,x:{r:["shieldControllable"],s:"!_0"}}],title:[{t:2,x:{r:["nls"],s:'_0("antispam")'}}]},v:{click:"toggleStatus"}}]}," ",{t:4,f:[{t:7,e:"div",a:{slot:"upsell"},f:[{t:7,e:"Upsell",f:[{t:4,f:[{t:3,x:{r:["nls","product"],s:'_0("global.featureUnavailable.variables",_0("antispam"),_0("global.product."+_1))'}}],n:50,r:"product"},{t:4,n:51,f:[{t:3,x:{r:["nls"],s:'_0("global.featureUnavailable.generic")'}}],r:"product"}]}]}],n:50,x:{r:["licensed"],s:"!_0"}}," ",{t:7,e:"div",a:{slot:"page-content"},f:[{t:7,e:"View",f:[{t:7,e:"div",a:{slot:"description"},f:[{t:7,e:"p",a:{class:"kin_description__text"},f:[{t:3,x:{r:["nls"],s:'_0("antispam.desc")'}}]}]}," ",{t:7,e:"div",a:{slot:"view-content"},f:[{t:7,e:"kin-icon",a:{name:"antispam",size:"200",class:["kin_view__icon ",{t:2,x:{r:["shieldActive"],s:'!_0?"color-disabled -text":""'}}]}}]}]}]}]}]},data:{shieldActive:!1,shieldControllable:!1,product:a.getProduct(),licensed:a.isLicensed("antispam")},oninit(){this.log=l.createLogger("antispam"),this.log.info("oninit"),this.listeners=[],this.listeners.push(s.on("product.change.state.product",(t=>{this.log.debug("product changed; product: "+t),this.set("product",t)}))),this.listeners.push(s.on("product.change.feature.antispam.licensed",(t=>{this.set("licensed",t)}))),this.listeners.push(s.on("product.change.feature.antispam.enabled",(t=>{this._setShieldStatus(t,!0)}))),this.observe("licensed",((t,s)=>{this.log.info('licensed changed from "'+s+'" to "'+t+'"'),t&&this.initialize()})),this.on("Upsell.init",(()=>{e.event("Upsell","View")})),this.on("Upsell.buy",(()=>{n.openWindow(132)})),this.on("toggleStatus",this._onToggleStatus.bind(this)),this.initialize()},onteardown(){this.log.info("onteardown"),this.listeners.forEach((t=>{t()}))},initialize(){this.get("licensed")?a.update().then((()=>{const t=a.getFeature("ais_shl_spm");this._setShieldStatus(t.enabled,!0)})):this.log.info("not licensed.. not initializing")},_onToggleStatus(t){t.original.preventDefault();const s=this.get("shieldActive"),e=t=>{this.log.info("turning the antispam shield "+(s?"off":"on"));const e=s?"app.features.Stop":"app.features.Start",a={featureId:"ais_shl_spm"};null!=t&&(a.time=t),this._setShieldStatus(null,!1),i(e,a).then((()=>{this.log.info(e+" successfully executed"),this._setShieldStatus(!s,!0)})).catch((t=>{this.log.error("an error occured while executing `"+e+"` request",t),this._setShieldStatus(s,!0)}))};s?(this.log.info("opening the stop option dialog"),o.stopOptions({title:r("antispam.stopOptions.title"),desc:r("antispam.stopOptions.desc")}).then((t=>{this.log.info("stop option selected; params: "+JSON.stringify(t)),e(t.time)})).catch((()=>{this.log.info("no stop option selected.. doing nothing")}))):e()},_setShieldStatus(t=null,s=null){const e={};null!==t&&(e.shieldActive=t),null!==s&&(e.shieldControllable=s),this.set(e)}});const d=l.createLogger("antispam.settings.list"),p=t.extend({template:{v:3,t:[{t:4,f:[{t:4,f:[{t:7,e:"div",a:{class:"row -details -compact -hoverable"},f:[" ",{t:7,e:"input",a:{type:"text",value:[{t:2,r:"."}],class:"input -blank -small ats_list-input row__title",placeholder:[{t:3,x:{r:["nls"],s:'_0("antispam.settings.enterEmailOrDomain")'}}],lazy:"500"},v:{keyup:"inputKeyup",blur:"saveList"}}," ",{t:7,e:"div",f:[{t:7,e:"kin-button",a:{type:"blank",size:"small",icononly:0,class:"row__show-on-hover",title:[{t:3,x:{r:["nls"],s:'_0("global.remove")'}}]},v:{click:"removeFromList"},f:[{t:7,e:"kin-icon",a:{name:"icon-s-controls-bin",size:"16"}}]}]}]}],n:52,i:"index",r:"list"}],n:50,r:"list.length"},{t:4,n:51,f:[{t:7,e:"p",a:{class:"p -small -secondary"},v:{click:"addToList"},f:[{t:3,x:{r:["nls"],s:'_0("antispam.settings.emptyList")'}}]}],r:"list.length"}]},data:function(){return{listId:null,path:null,list:[]}},oninit(){this.loadList(),this.on("inputKeyup",(t=>{13===t.original.keyCode&&t.node.blur()})),this.on("saveList",(t=>{s.emit("Settings.gaTrack","Save "+this.get("listId"));const e=this.get("list");t.context.length||e.splice(t.index.index,1),this.updateList(e)})),this.on("addToList",(()=>{this.addToList()})),this.on("removeFromList",(t=>{s.emit("Settings.gaTrack","Remove from "+this.get("listId"));const e=this.get("list");e.splice(t.index.index,1),this.updateList(e)}))},addToList(){const t=this.get("list");(0===t.length||t[0].length>0)&&t.unshift(""),this.find("input.ats_list-input").focus()},loadList(){i("app.settings.Get",{name:this.get("path")}).then((t=>{this.set("list",this.parseList(t.value))})).catch((t=>{d.error("loading list failed",t)}))},updateList(t){this.set("list",t),i("app.settings.Set",{name:this.get("path"),value:this.stringifyList(t)})},parseList:t=>t?t.split("\n").slice(0,-1):[],stringifyList:t=>t&&t.length?t.join("\n")+"\n":""}),h={allowedList:"antispam.settings.allowedList",blockedList:"antispam.settings.blockedList",addEmailOrDomain:"antispam.settings.addEmailOrDomain"},m={whitelist:{id:"AntispamSettingsWhitelist",type:"tab",title:r(h.allowedList),compo:p,compoParams:{path:"antispam://Antispam/Common/WhiteList",listId:"Whitelist"},testAttr:"Whitelist",search:h.allowedList},blacklist:{id:"AntispamSettingsBlacklist",type:"tab",title:r(h.blockedList),compo:p,compoParams:{path:"antispam://Antispam/Common/Blacklist",listId:"Blacklist"},testAttr:"Blacklist",search:h.blockedList},addEmailOrDomain:{id:"antispam_settings_addEmailOrDomain",label:r(h.addEmailOrDomain),search:h.addEmailOrDomain}},u=t.extend({template:{v:3,t:[{t:7,e:"kin-button",a:{size:"small",type:"secondary",class:"g-float--right g-margin-bottom--5",id:[{t:2,r:"addEmailOrDomain.id"}],"data-test":"addEmailOrDomain"},v:{click:"addToList"},f:["+ ",{t:3,r:"addEmailOrDomain.label"}]}," ",{t:7,e:"hr",a:{class:"g-clear"}}," ",{t:7,e:"SettingsTabs",a:{tabs:[{t:2,r:"lists"}],watchedTabsHeightContainer:".settings__section"}}]},data:()=>({STRINGS:h,selectedTabId:null,lists:[m.whitelist,m.blacklist],addEmailOrDomain:m.addEmailOrDomain}),oninit(){this.on("addToList",(()=>{const t=this.get("selectedTabId");s.emit("Settings.gaTrack","Add to "+t),this.findComponent(t).addToList()})),this.on("SettingsTabs.selectedTabChanged",(t=>{s.emit("Settings.gaTrack","Show "+t),this.set("selectedTabId",t)})),s.on("settings.selectTabId",(t=>{this.set("selectedTabId",t)}))}}),g={title:"antispam",desc:"antispam.settings.desc",sensitivity:"antispam.sensitivity",sensitivityLow:"antispam.sensitivityLow",sensitivityMedium:"antispam.sensitivityMedium",sensitivityHigh:"antispam.sensitivityHigh",markSubject:"antispam.settings.markSubject",markSubjectPhish:"antispam.settings.markSubjectPhish",addRecipientsAutomatically:"antispam.settings.addRecipientsAutomatically",addRecipientsAutomaticallyDesc:"antispam.settings.addRecipientsAutomatically.desc",addAddressBookToWhitelist:"antispam.settings.addAddressBookToWhitelist"},b={sensitivity:{path:"avcfg://AntiSpamShield/AntiSpam/Threshold",desc:r(g.sensitivity),options:[{value:"1",label:r(g.sensitivityLow)},{value:"2",label:r(g.sensitivityMedium)},{value:"3",label:r(g.sensitivityHigh)}],track:{subject:"Sensitivity",valueMap:{1:"Low",2:"Medium",3:"High"}},search:g.sensitivity},markSubject:{path:"avcfg://AntiSpamShield/AntiSpam/MarkSubject",label:r(g.markSubject),track:{subject:"Mark spam message subject"},search:g.markSubject},subjectForSpamMsg:{path:"avcfg://AntiSpamShield/AntiSpam/SubjectForSpamMsg",track:{subject:"Spam message subject mark"}},markSubjectPhish:{path:"avcfg://AntiSpamShield/AntiSpam/MarkSubjectPhish",label:r(g.markSubjectPhish),track:{subject:"Mark phishing message subject"},search:g.markSubjectPhish},subjectForPhishMsg:{path:"avcfg://AntiSpamShield/AntiSpam/SubjectForPhishMsg",track:{subject:"Phishing message subject mark"}},addRecipientsAutomatically:{path:"avcfg://AntiSpamShield/AntiSpam/AddRecipientsAutomatically",label:r(g.addRecipientsAutomatically),desc:r(g.addRecipientsAutomaticallyDesc),track:{subject:"Add recipients to whitelist automatically"},search:{title:g.addRecipientsAutomatically,desc:g.addRecipientsAutomaticallyDesc}},addAddressBookToWhitelist:{path:"avcfg://AntiSpamShield/AntiSpam/AddAddressBookToWhitelist",label:r(g.addAddressBookToWhitelist),track:{subject:"Add address book to whitelist automatically"},search:g.addAddressBookToWhitelist}},S={title:g.title,desc:g.desc,items:Object.assign({},b,m)},v=t.extend({template:{v:3,t:[{t:7,e:"SettingsContainer",a:{component:[{t:2,r:"component"}],ipmBuyElm:[{t:2,r:"ipmBuyElm"}],title:[{t:3,x:{r:["nls","STRINGS.title"],s:"_0(_1)"}}],desc:[{t:3,x:{r:["nls","STRINGS.desc"],s:"_0(_1)"}}],stopOptions:[{t:2,r:"stopOptions"}]},f:[{t:7,e:"SettingsRange",a:{property:[{t:2,r:"properties.sensitivity"}],cssCls:"g-margin-bottom--10"}}," ",{t:7,e:"SettingsCheckbox",a:{property:[{t:2,r:"properties.markSubject"}]},f:[{t:7,e:"SettingsTextInput",a:{property:[{t:2,r:"properties.subjectForSpamMsg"}],cssCls:"settings__indent"}}]}," ",{t:7,e:"SettingsCheckbox",a:{property:[{t:2,r:"properties.markSubjectPhish"}]},f:[{t:7,e:"SettingsTextInput",a:{property:[{t:2,r:"properties.subjectForPhishMsg"}],cssCls:"settings__indent"}}]}," ",{t:7,e:"div",a:{class:"settings__row"},f:[{t:7,e:"Lists"}]}," ",{t:7,e:"SettingsCheckbox",a:{property:[{t:2,r:"properties.addRecipientsAutomatically"}]}}," ",{t:7,e:"SettingsCheckbox",a:{property:[{t:2,r:"properties.addAddressBookToWhitelist"}]}}]}]},css:".ats_list-input {\n  width: 100%;\n}\n",components:{Lists:u},data:function(){return{STRINGS:g,component:"antispam",stopOptions:{title:r("antispam.stopOptions.title"),desc:r("antispam.stopOptions.desc")},ipmBuyElm:132,properties:b}},oninit(){this.observers=[],this.observers.push(this.observe("properties.markSubject.value",(t=>{this.set("properties.subjectForSpamMsg.disabled",!t)}))),this.observers.push(this.observe("properties.markSubjectPhish.value",(t=>{this.set("properties.subjectForPhishMsg.disabled",!t)})))},onteardown(){for(;this.observers.length;)this.observers.pop().cancel()}}),f=[{path:"avcfg://AntiSpamShield/AntiSpam/RuleUpdate",label:"Retrieve new rules?",type:"checkbox"},{path:"avcfg://AntiSpamShield/AntiSpam/RuleUpdatePeriod",label:"How often should AV retrieve new antispam rules?",type:"number",unit:"seconds",minValue:1,maxValue:2e9,required:!0}];export default c;export{v as settings,f as settingsGeek,S as settingsSearchStrings};const k={name:"Antispam",version:"1.2.457",created:"2021-09-06T10:52:30.834Z"};export{k as metadata};