//{"name":"antiRansomware","version":"1.3.1697","created":"2025-06-19T07:29:11.867Z"}
import*as e from"./svelteInternal.js";import{createEventDispatcher as t,onDestroy as a,onMount as s}from"./svelteInternal.js";import{serviceRequest as i,napiTracker as n,eventer as l,windowApi as o}from"./napi.js";import{IconButton as r,Illustration as d,Modal as c,UberPage as p,UberPageActions as m,Installer as u,Crumbs as f,featureManager as _,BlockedAllowedListLink as g,DetectionDialog as v,Container as h,Radio as b}from"./svelteComponents.js";import{nls as w}from"./i18n.js";import{productModel as x,features as k}from"./napiExtensions.js";import{writableStore as y,settingsProps as $}from"./plugins.js";import{debounce as T}from"./libs.js";const P={title:"antiransomware",settingsDesc:"antiransomware.settings.desc",modeLabel:"antiransomware.settings.mode.label",fileProtectionModeLabel:"antiransomware.settings.fileProtectionMode.label",fileProtectionModeAll:"antiransomware.settings.fileProtectionMode.all",fileProtectionModeManual:"antiransomware.settings.fileProtectionMode.manual",fileProtectionModeManualDesc:"antiransomware.settings.fileProtectionMode.manual.desc",smartMode:"antiransomware.settings.mode.smart.label",smartModeDesc:"antiransomware.settings.mode.smart.desc",strictMode:"antiransomware.settings.mode.strict.label",strictModeDesc:"antiransomware.settings.mode.strict.desc",trustedAppsTitle:"antiransomware.trustedApps.title",trustedAppsDesc:"antiransomware.trustedApps.desc",protectedFileTypesTitle:"antiransomware.settings.protectedFileTypes.title",fileTypesTitle:"antiransomware.settings.fileTypes",fileTypes:{music:"antiransomware.fileTypes.music",archive:"antiransomware.fileTypes.archive",database:"antiransomware.fileTypes.database",disc:"antiransomware.fileTypes.disc",document:"antiransomware.fileTypes.document",photo:"antiransomware.fileTypes.photo",video:"antiransomware.fileTypes.video"},customExtensions:"antiransomware.settings.customExtensions",customExtensionsPlaceholder:"antiransomware.settings.customExtensions.placeholder",customExtensionsDuplicates:"antiransomware.settings.customExtensions.duplicates",viewProtectedFolders:"antiransomware.settings.viewProtectedFolders"};var F=e.template('<span class="settings__info"><kin-tooltip><span slot="tooltip-activator"><kin-icon></kin-icon></span> <span slot="tooltip"><h4 class="h4"> </h4> <span class="p -small"> </span></span></kin-tooltip></span>',2);const q="AntiRansomwareShield",D={mode:{id:"antiransomware_settings_mode",icon:"icon-m-ransomware",label:P.modeLabel,options:[{label:P.smartMode,desc:P.smartModeDesc,descCompo:function(t,a){e.push(a,!1),e.init();var s=F(),i=e.child(s),n=e.child(i),l=e.child(n);e.set_custom_element_data(l,"name","icon-m-action-info"),e.set_custom_element_data(l,"size","18"),e.reset(n);var o=e.sibling(n,2),r=e.child(o),d=e.child(r,!0);e.reset(r);var c=e.sibling(r,2),p=e.child(c,!0);e.reset(c),e.reset(o),e.reset(i),e.reset(s),e.template_effect(((t,a)=>{e.set_text(d,t),e.set_text(p,a)}),[()=>w(P.trustedAppsTitle),()=>w(P.trustedAppsDesc)],e.derived_safe_equal),e.append(t,s),e.pop()},hint:P.trustedAppsDesc,hintTitle:P.trustedAppsTitle,value:1},{label:P.strictMode,desc:P.strictModeDesc,value:2}],load:function(){return i("app.antiransomware.GetProtectionMode").then((e=>({locked:!1,value:e})))},change:function(e){return i("app.antiransomware.SetProtectionMode",e)}},fileProtectionMode:{label:P.fileProtectionModeLabel,path:"avcfg://IDP/Setting/fileprotection.protect_all_files",options:[{label:P.fileProtectionModeAll,value:"1"},{label:P.fileProtectionModeManual,desc:P.fileProtectionModeManualDesc,value:"0"}]}};function E(){return{title:w("antiransomware.stopOptions.title"),desc:w("antiransomware.stopOptions.desc")}}const I=globalThis.process?.env?.NODE_ENV,A=I&&!I.toLowerCase().startsWith("prod"),C=()=>{};let M=!1;if(A){function Ft(e){if(!(e in globalThis)){let t;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(void 0!==t)return t;!function(e){if(A){const t=new Error(`rune_outside_svelte\nThe \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files\nhttps://svelte.dev/e/rune_outside_svelte`);throw t.name="Svelte error",t}throw new Error("https://svelte.dev/e/rune_outside_svelte")}(e)},set:e=>{t=e}})}}Ft("$state"),Ft("$effect"),Ft("$derived"),Ft("$inspect"),Ft("$props"),Ft("$bindable")}function S(e,t,a){if(null==e)return t(void 0),a&&a(void 0),C;const s=function(e){var t=M;try{return M=!0,e()}finally{M=t}}((()=>e.subscribe(t,a)));return s.unsubscribe?()=>s.unsubscribe():s}const N=[];function j(e,t){return{subscribe:z(e,t).subscribe}}function z(e,t=C){let a=null;const s=new Set;function i(t){if(n=t,((i=e)!=i?n==n:i!==n||null!==i&&"object"==typeof i||"function"==typeof i)&&(e=t,a)){const t=!N.length;for(const a of s)a[1](),N.push(a,e);if(t){for(let e=0;e<N.length;e+=2)N[e][0](N[e+1]);N.length=0}}var i,n}function n(t){i(t(e))}return{set:i,update:n,subscribe:function(l,o=C){const r=[l,o];return s.add(r),1===s.size&&(a=t(i,n)||C),l(e),()=>{s.delete(r),0===s.size&&a&&(a(),a=null)}}}}function R(e,t,a){const s=!Array.isArray(e),i=s?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const n=t.length<2;return j(a,((e,a)=>{let l=!1;const o=[];let r=0,d=C;const c=()=>{if(r)return;d();const i=t(s?o[0]:o,e,a);n?e(i):d="function"==typeof i?i:C},p=i.map(((e,t)=>S(e,(e=>{o[t]=e,r&=~(1<<t),l&&c()}),(()=>{r|=1<<t}))));return l=!0,c(),function(){!function(e){for(var t=0;t<e.length;t++)e[t]()}(p),d(),l=!1}}))}function L(e){let t;return S(e,(e=>t=e))(),t}const B={music:{ext:["m3u","m4a","mp3","wma","ogg","wav"]},archive:{ext:["7z","rar","zip"]},database:{ext:["sqlite","sqlite3"]},disc:{ext:["iso","img","nrg","tc"]},document:{ext:["doc","docx","odt","rtf","wpd","wps","csv","key","pdf","pps","ppt","pptm","pptx","ps","psd","vcf","xlr","xls","xlsx","xlsm","ods","odp","indd","dxf","kml","kmz","gpx","txt","cad","dwg","wmf"]},photo:{ext:["3fr","ari","arw","bay","bmp","cr2","crw","cxi","dcr","dng","eip","erf","fff","gif","iiq","j6i","k25","kdc","mef","mfw","mos","mrw","nef","nrw","orf","pef","png","raf","raw","rw2","rwl","rwz","sr2","srf","srw","x3f","jpg","jpeg","tga","tiff","tif","ai"]},video:{ext:["3g2","3gp","asf","avi","flv","m4v","mkv","mov","mp4","mpg","rm","swf","vob","wmv"]}},O=/[,|.|;| ]+/,G="rswcat_",V="_noExtensions",H=G+"custom",U="antiransomware.disabledCustomExtensions";let W,J=[];const K=T(qe,1e3),Z=z([],(function(){Y.set(!0),ke(!0).then((()=>{Y.set(!1)}))})),Q=z([]),X=z({modalDialog:void 0,folderToRemove:void 0,lastFolderName:"",foldersCount:void 0}),Y=z(!0),ee=y([],(function(){Y.set(!0),i("app.antiransomware.GetExtensions").then((e=>{Array.isArray(e)||(e=[]),e=e.filter((e=>!e.includes(G)&&e!==V));let t=B;i("app.antiransomware.GetDefaultExtensions").then((a=>{if(a.length>0&&a[0].includes(G)){t={};let e="";a.forEach((a=>{a.includes(G)?e=a.replace(G,""):(void 0===t[e]&&(t[e]={ext:[]}),t[e].ext.push(a))})),void 0!==t[H]&&delete t[H]}Te(t,e)})).catch((()=>{console.log("Get default extensions failed, used hardcoded one"),Te(t,e)}))}))})),te=z(""),ae=z(!1),se=z(!0),ie=R(Z,(e=>e)),ne=R(X,(e=>e)),le=R(Y,(e=>e)),oe=R(ee,(e=>e)),re=R(te,(e=>e)),de=R(ae,(e=>e)),ce=R(se,(e=>e)),pe=R(Q,(e=>e)),me=R(Q,(e=>e.length)),ue=j(x.isEnabled(q),(e=>(e(x.isEnabled(q)),l.on(`product.change.feature.${q}.enabled`,e))));function fe(){return ke().then((e=>{const t=e.map((e=>e.path));return i("app.antiransomware.SetPaths",t).catch((e=>{console.error("error while setting protected folders. err:"+e)}))}))}function _e(e){const t=e.split(/[/|\\]/);let a="";return t.length>0&&(a=t.pop()),a}function ge(e){return e.slice(0,30)+(e.length>30?"...":"")}function ve(){ke().then((e=>{Q.update((t=>0===t.length?t=e.map((e=>e.path)):[]))}))}function he({modalDialog:e,folderToRemove:t,lastFolderName:a,foldersCount:s}){X.set({modalDialog:e,folderToRemove:t,lastFolderName:a,foldersCount:s})}function be(e){Z.update((t=>{const a=t.filter((t=>!e.includes(t.path)));return W=Promise.resolve(a),a})),Q.update((t=>((e.length>1||t[0]===e[0])&&(t=[]),t))),fe()}function we(e){return ke().then((t=>{if(1===e.length){const a=e[0],s=t.find((e=>a===e.path)).folderName;X.set({folderToRemove:a,lastFolderName:ge(s),modalDialog:"removeFolder",foldersCount:void 0})}else X.set({modalDialog:"removeSelectedFolders"})}))}function xe(){return ke().then((e=>i("app.utils.SelectFolders",{hideNetwork:!0,alsoFiles:!1}).then((t=>{const a="ok"===t.dialogReturnCode?t.paths:null;if(!a)return;const s=a.replace(/"/g,"").split(";");let n=0,l=0,o=!1,r=!1,d="";return Promise.all(s.map((t=>{const a={path:t,folderName:_e(t)};return(t=>{const a=e.some((e=>e.path===t));return a?Promise.reject("alreadyProtected"):Promise.resolve(a)})(a.path).then((()=>(e=>i("app.antiransomware.CheckPath",e).catch((e=>(console.error("error while checking new path, err:"+e),!1))).then((e=>{if(!e)return Promise.reject("cannotAdd")})))(a.path))).then((()=>{e.push(a),n+=1})).catch((e=>{l+=1,o||="alreadyProtected"===e,r||="cannotAdd"===e,d=ge(a.folderName)}))}))).then((()=>{if(n)return Z.set(e),fe()})).then((()=>{if(l){return{foldersCount:l,lastFolderName:d,modalDialog:r?"cannotAdd":o?"alreadyProtected":void 0}}return{}}))})).catch((()=>{}))))}function ke(e){return W&&!e||(W=i("app.antiransomware.GetPaths").then((e=>{e&&"function"==typeof e.push||(e=[]);const t=e.map((e=>({path:e,folderName:_e(e)})));return Z.set(t),t})).catch((e=>{console.error("error while reading protected folders. err:"+e)}))),W}function ye(){Q.set([])}function $e(){he({modalDialog:void 0})}function Te(e,t){for(const n in e){e[n].selected=!1,e[n].strExtList=e[n].ext.join(", ");let a=t.length;for(;a--;)if(-1!==e[n].ext.indexOf(t[a])){e[n].selected=!0;break}}ee.set(e),J=function(){let t=[];for(const a in e)t=t.concat(e[a].ext);return t}();const a=t.filter((e=>!J.includes(e))),s=Boolean(localStorage.getItem(U)),i=s?localStorage.getItem(U).split(",").map((e=>e.trim())):[];if(s)if(a.length&&i.length){const e=new Set([...a,...i]);te.set([...e].join(", ")),se.set(!0),K()}else te.set(i.join(", ")),se.set(!1);else te.set(a.join(", ")),se.set(!0);ae.set(!1),Y.set(!1)}function Pe(e){te.set(e.target.value),Fe()}const Fe=T((function(){const e=L(te).split(O).filter((e=>J.includes(e)));return ae.set(e.length>0),e.length<1||ee.update((t=>{for(const a in t){if(!0===t[a].selected)continue;let s=e.length;for(;s--;)if(-1!==t[a].ext.indexOf(e[s])){t[a].selected=!0;break}}return t})),!1}),300);function qe(){let e=[];const t=ee.get(),a=L(se),s=L(te);for(const i in t)t[i].selected&&e.push.apply(e,t[i].ext);a||!s?localStorage.removeItem(U):localStorage.setItem(U,s);let n=a?s:"";n.length&&(n=n.split(O),e=e.concat(n.filter((e=>!J.includes(e))))),e.length||e.push(V),i("app.antiransomware.SetExtensions",e).catch((e=>{console.error("Unable to set extensions",e)}))}function De(){n.feature.click({feature:q,label:"Protect new folder"}),xe().then((e=>{he({modalDialog:e?.modalDialog,lastFolderName:e?.lastFolderName,foldersCount:e?.foldersCount})}))}function Ee(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===a&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}Ee(".arw_table__header.svelte-1t92ib4 {\n  grid-template-columns: 4rem 32% auto 30%;\n}\n.arw_table__header.-noSelection.svelte-1t92ib4 {\n  grid-template-columns: 32% auto 30%;\n}\n.arw_table__row.svelte-1t92ib4 {\n  grid-template-columns: calc(4rem + 32%) auto 5%;\n}\n.arw_table__row.-noSelection.svelte-1t92ib4 {\n  grid-template-columns: 32% auto 5%;\n}\n");var Ie=e.template("<kin-loading></kin-loading>",2),Ae=e.template('<h4 class="h4"> </h4> <kin-button> </kin-button>',3),Ce=e.template('<div class="kin_table__checkbox" role="columnheader"><input type="checkbox"></div>'),Me=e.template('<div class="kin_table__checkbox"><input type="checkbox" class="checkbox"></div>'),Se=e.template('<div class="kin_table__icon"><kin-icon></kin-icon></div>',2),Ne=e.template('<div role="row"><label><!> <!> <div class="kin_table__name g-ltr"><kin-tooltip><div slot="tooltip-activator"> </div> <div slot="tooltip"> </div></kin-tooltip></div></label> <div dir="ltr"><kin-tooltip><div slot="tooltip-activator"> </div> <div slot="tooltip"> </div></kin-tooltip></div> <div class="kin_table__actions"><!></div></div>',2),je=e.template("<kin-icon></kin-icon>",2),ze=e.template('<h3 class="h3"> </h3> <p class="p"> </p> <kin-button> </kin-button>',3),Re=e.template('<h3 class="h3 g-margin-top--2x"> </h3> <p class="text -small"> </p> <kin-button> </kin-button>',3),Le=e.template('<kin-table><div slot="table-ribbon"><!></div> <div slot="table-header" role="row"><!> <div role="columnheader"> </div> <div role="columnheader"> </div> <div></div></div> <div slot="table-body"></div> <div slot="table-empty-icon"><!></div> <div slot="table-empty"><!></div></kin-table>',2);function Be(s,i){e.push(i,!1);const[n,l]=e.setup_stores(),o=()=>e.store_get(ie,"$protectedFolders",n),c=()=>e.store_get(pe,"$selectedFolders",n),p=()=>e.store_get(ue,"$componentEnabled",n);let m=e.prop(i,"hasTableRibbon",8,!1),u=e.prop(i,"disableSelection",8,!1);const f=t();let _=e.mutable_source(),g=e.mutable_source(),v=e.mutable_source(),h=e.mutable_source();window.addEventListener("kin-deselectAll",ye),a((()=>{window.removeEventListener("kin-deselectAll",ye)})),e.legacy_pre_effect((()=>(o(),c())),(()=>{e.set(_,o().length===c().length&&c().length>0)})),e.legacy_pre_effect((()=>(o(),c())),(()=>{e.set(g,o().length!==c().length&&c().length>0)})),e.legacy_pre_effect((()=>(e.deep_read_state(m()),p())),(()=>{e.set(v,m()&&!p())})),e.legacy_pre_effect((()=>(e.get(v),o())),(()=>{e.set(h,e.get(v)&&!o().length?null:o().length)})),e.legacy_pre_effect_reset(),e.init();var b=e.comment(),x=e.first_child(b),k=t=>{var a=Ie();e.set_custom_element_data(a,"fullscreen","true"),e.append(t,a)},y=t=>{var a=Le();e.template_effect((()=>e.set_custom_element_data(a,"datalength",e.get(h)))),e.template_effect((()=>e.set_custom_element_data(a,"selecteditems",c().length))),e.template_effect((()=>e.set_custom_element_data(a,"inactive",e.get(v))));var s=e.child(a),i=e.child(s),n=t=>{var a=Ae(),s=e.first_child(a),i=e.child(s,!0);e.reset(s);var n=e.sibling(s,2);e.set_custom_element_data(n,"size","tiny"),e.set_custom_element_data(n,"type","secondary"),e.set_custom_element_data(n,"lefticon","icon-m-plus"),e.set_custom_element_data(n,"data-test","kin_table-add_item");var l=e.child(n,!0);e.reset(n),e.template_effect(((t,a)=>{e.set_text(i,t),e.set_text(l,a)}),[()=>w("antiransomware.manageFolders"),()=>w("antiransomware.addFolder")],e.derived_safe_equal),e.event("click",n,(()=>f("addFolder"))),e.append(t,a)};e.if(i,(e=>{m()&&e(n)})),e.reset(s);var l=e.sibling(s,2);let p;var b=e.child(l),x=t=>{var a=Ce(),s=e.child(a);let i;e.remove_input_defaults(s),e.reset(a),e.template_effect(((t,a)=>{i=e.set_class(s,1,"checkbox",null,i,t),e.set_attribute(s,"aria-checked",e.get(g)?"mixed":""),e.set_attribute(s,"aria-label",a),s.disabled=0===o().length,e.set_checked(s,c().length>0)}),[()=>({"-checked":e.get(_)}),()=>`${w("global.selectAllItems")} - ${w("antiransomware.protectedFolders.title")}`],e.derived_safe_equal),e.event("click",s,(function(...e){ve?.apply(this,e)})),e.append(t,a)};e.if(b,(e=>{u()||e(x)}));var k=e.sibling(b,2),y=e.child(k,!0);e.reset(k);var $=e.sibling(k,2),T=e.child($,!0);e.reset($),e.next(2),e.reset(l);var P=e.sibling(l,2);e.each(P,5,o,e.index,((t,a,s)=>{var i=Ne();let n;e.set_attribute(i,"aria-rowindex",s),e.set_attribute(i,"data-test",`table-row-${s}`);var l=e.child(i);e.set_attribute(l,"for",`folderName-${s}`);var o=e.child(l),d=t=>{var i=Me(),n=e.child(i);e.remove_input_defaults(n),e.set_attribute(n,"id",`folderName-${s}`),e.reset(i),e.template_effect(((t,s)=>{e.set_checked(n,t),e.set_attribute(n,"aria-label",`${s??""} ${e.get(a).folderName??""}`)}),[()=>c().includes(e.get(a).path),()=>w("global.selectItem")],e.derived_safe_equal),e.event("click",n,(()=>function(e){Q.update((t=>t.includes(e.path)?(t.splice(t.indexOf(e.path),1),t):(t.push(e.path),t)))}(e.get(a)))),e.append(t,i)};e.if(o,(e=>{u()||e(d)}));var p=e.sibling(o,2),f=t=>{var a=Se(),s=e.child(a);e.set_custom_element_data(s,"name","icon-m-scan-folder"),e.set_custom_element_data(s,"size","24"),e.reset(a),e.append(t,a)};e.if(p,(e=>{m()||e(f)}));var _=e.sibling(p,2),g=e.child(_);e.set_custom_element_data(g,"ellipsis","true");var v=e.child(g),h=e.child(v,!0);e.reset(v);var b=e.sibling(v,2),x=e.child(b,!0);e.reset(b),e.reset(g),e.reset(_),e.reset(l);var k=e.sibling(l,2),y=e.child(k);e.set_custom_element_data(y,"ellipsis","true"),e.set_custom_element_data(y,"data-test","kin_table-item-description");var $=e.child(y),T=e.child($,!0);e.reset($);var P=e.sibling($,2),F=e.child(P,!0);e.reset(P),e.reset(y),e.reset(k);var q=e.sibling(k,2),D=e.child(q);const E=e.derived_safe_equal((()=>w("global.stopProtecting"))),I=e.derived_safe_equal((()=>w("global.stopProtecting"))),A=e.derived_safe_equal((()=>e.get(a).folderName));r(D,{name:"icon-m-close",get tooltip(){return e.get(E)},dataTest:"requestDeleteConfirm",get ariaLabel(){return`${e.get(I)??""} - ${e.get(A)??""}`},$$events:{click:()=>function(e){we([e.path])}(e.get(a))}}),e.reset(q),e.reset(i),e.template_effect((t=>{n=e.set_class(i,1,"arw_table__row kin_table__row svelte-1t92ib4",null,n,t),e.set_text(h,e.get(a).folderName),e.set_text(x,e.get(a).folderName),e.set_text(T,e.get(a).path),e.set_text(F,e.get(a).path),k.dir=k.dir}),[()=>({"-selected":c().includes(e.get(a).path),"-noSelection":u()})],e.derived_safe_equal),e.append(t,i)})),e.reset(P);var F=e.sibling(P,2),q=e.child(F),D=t=>{var a=je();e.set_custom_element_data(a,"name","i-l-022"),e.set_custom_element_data(a,"illustration","true"),e.set_custom_element_data(a,"size","240"),e.set_custom_element_data(a,"width","608"),e.append(t,a)},E=e=>{d(e,{name:"empty-table",nameSpaghetti:"i-s-059",size:"144",width:"264",cssCls:"g-margin-top--3x"})};e.if(q,(e=>{m()?e(D):e(E,!1)})),e.reset(F);var I=e.sibling(F,2),A=e.child(I),C=t=>{var a=ze(),s=e.first_child(a),i=e.child(s,!0);e.reset(s);var n=e.sibling(s,2),l=e.child(n,!0);e.reset(n);var o=e.sibling(n,2);e.set_custom_element_data(o,"size","large"),e.set_class(o,1,"g-margin-top--3x");var r=e.child(o,!0);e.reset(o),e.template_effect(((t,a,s)=>{e.set_text(i,t),e.set_text(l,a),e.set_text(r,s)}),[()=>w("antiransomware.empty.desc.1"),()=>w("antiransomware.empty.desc.2"),()=>w("antiransomware.addFolder")],e.derived_safe_equal),e.event("click",o,(()=>f("addFolder"))),e.append(t,a)},M=t=>{var a=Re(),s=e.first_child(a),i=e.child(s,!0);e.reset(s);var n=e.sibling(s,2),l=e.child(n,!0);e.reset(n);var o=e.sibling(n,2);e.set_class(o,1,"g-margin-top--3x");var r=e.child(o,!0);e.reset(o),e.template_effect(((t,a,s)=>{e.set_text(i,t),e.set_text(l,a),e.set_text(r,s)}),[()=>w("antiransomware.empty.desc.1"),()=>w("antiransomware.empty.desc.2"),()=>w("antiransomware.protectNewFolder")],e.derived_safe_equal),e.event("click",o,(function(...e){De?.apply(this,e)})),e.append(t,a)};e.if(A,(e=>{m()?e(C):e(M,!1)})),e.reset(I),e.reset(a),e.template_effect(((t,a,s)=>{p=e.set_class(l,1,"arw_table__header svelte-1t92ib4",null,p,t),e.set_text(y,a),e.set_text(T,s)}),[()=>({"-noSelection":u()}),()=>w("antiransomware.protectedFolders.title"),()=>w("global.location")],e.derived_safe_equal),e.append(t,a)};e.if(x,(t=>{e.store_get(le,"$loading",n)?t(k):t(y,!1)})),e.append(s,b),e.pop(),l()}Ee(".arw_duplicates.svelte-1s6t7nq {\n  padding-inline-start: 1.2rem;\n}\n");var Oe=e.template('<div slot="modal-content"><form class="form -simple"><kin-input></kin-input> <div class="arw_duplicates p -tiny -secondary g-align--start svelte-1s6t7nq"> </div></form></div>',2),Ge=e.template('<div slot="modal-footer"><div class="modal__actions"><kin-button> </kin-button> <kin-button> </kin-button></div></div>',2);function Ve(t,a){e.push(a,!1);const[s,i]=e.setup_stores(),n=()=>e.store_get(re,"$customExtensions",s);let l=e.mutable_source("");function o(e){const t=String.fromCharCode(e.charCode||e.which);if(new RegExp(/[\\|\/|:|\*|\?|"|<|>|\|]/).test(t))return e.preventDefault(),!1}function r(){Pe({target:{value:n().length?`${n()}, ${e.get(l)}`:e.get(l)}}),e.store_get(ce,"$customExtensionsEnabled",s)?qe():(se.update((e=>!e)),K()),$e()}e.init();const d=e.derived_safe_equal((()=>w("antiransomware.addProtectedFileType"))),p=e.derived_safe_equal((()=>w("antiransomware.addProtectedFileType.desc")));c(t,{get title(){return e.get(d)},get subtitle(){return e.get(p)},$$events:{close(...e){$e?.apply(this,e)}},$$slots:{"modal-content":(t,a)=>{var s=Oe(),i=e.child(s),n=e.child(i);e.template_effect((()=>e.set_custom_element_data(n,"label",w("antiransomware.fileExtensionS")))),e.template_effect((()=>e.set_custom_element_data(n,"placeholder",w(P.customExtensionsPlaceholder)))),e.set_class(n,1,"g-margin-bottom--1x"),e.template_effect((()=>e.set_custom_element_data(n,"value",e.get(l)))),e.set_custom_element_data(n,"maxlength","400");var d=e.sibling(n,2),c=e.child(d,!0);e.reset(d),e.reset(i),e.reset(s),e.template_effect((t=>e.set_text(c,t)),[()=>w(P.customExtensionsDuplicates)],e.derived_safe_equal),e.event("keypress",n,o),e.event("input",n,(t=>e.set(l,t.target.value))),e.event("submit",i,r),e.append(t,s)},"modal-footer":(t,a)=>{var s=Ge(),i=e.child(s),n=e.child(i);e.set_custom_element_data(n,"data-test","modal_confirm");var l=e.child(n,!0);e.reset(n);var o=e.sibling(n,2);e.set_custom_element_data(o,"type","secondary");var d=e.child(o,!0);e.reset(o),e.reset(i),e.reset(s),e.template_effect(((t,a)=>{e.set_text(l,t),e.set_text(d,a)}),[()=>w("global.add"),()=>w("global.cancel")],e.derived_safe_equal),e.event("click",n,r),e.event("click",o,(function(...e){$e?.apply(this,e)})),e.append(t,s)}}}),e.pop(),i()}var He=e.template('<div slot="modal-footer"><div class="modal__actions"><kin-button> </kin-button></div></div>',2),Ue=e.template('<div slot="modal-footer"><div class="modal__actions"><kin-button> </kin-button></div></div>',2),We=e.template('<div slot="modal-footer"><div class="modal__actions"><kin-button> </kin-button> <kin-button> </kin-button></div></div>',2),Je=e.template('<div slot="modal-footer"><div class="modal__actions"><kin-button> </kin-button> <kin-button> </kin-button></div></div>',2),Ke=e.template('<div slot="modal-footer"><div class="modal__actions"><kin-button> </kin-button> <kin-button> </kin-button></div></div>',2);function Ze(t,a){e.push(a,!1);const[s,i]=e.setup_stores(),n=()=>e.store_get(ne,"$modalData",s),l=()=>e.store_get(me,"$selectedFoldersCount",s);function o(e){be(e),$e()}function r(){be(L(Z).map((e=>e.path))),x.disableFeature(q),$e()}e.init();var d=e.comment(),p=e.first_child(d),m=t=>{var a=e.comment(),i=e.first_child(a),d=t=>{const a=e.derived_safe_equal((()=>w("antiransomware.alreadyProtected.title",n().foldersCount,n().lastFolderName))),s=e.derived_safe_equal((()=>w("antiransomware.alreadyProtected.desc",n().foldersCount)));c(t,{get title(){return e.get(a)},get subtitle(){return e.get(s)},$$events:{close(...e){$e?.apply(this,e)}},$$slots:{"modal-footer":(t,a)=>{var s=He(),i=e.child(s),n=e.child(i),l=e.child(n,!0);e.reset(n),e.reset(i),e.reset(s),e.template_effect((t=>e.set_text(l,t)),[()=>w("global.gotIt")],e.derived_safe_equal),e.event("click",n,(function(...e){$e?.apply(this,e)})),e.append(t,s)}}})},p=(t,a)=>{var i=t=>{const a=e.derived_safe_equal((()=>w("antiransomware.cannotAdd.title",n().foldersCount))),s=e.derived_safe_equal((()=>w("antiransomware.cannotAdd.desc")));c(t,{get title(){return e.get(a)},get subtitle(){return e.get(s)},$$events:{close(...e){$e?.apply(this,e)}},$$slots:{"modal-footer":(t,a)=>{var s=Ue(),i=e.child(s),n=e.child(i);e.set_custom_element_data(n,"type","secondary");var l=e.child(n,!0);e.reset(n),e.reset(i),e.reset(s),e.template_effect((t=>e.set_text(l,t)),[()=>w("global.close")],e.derived_safe_equal),e.event("click",n,(function(...e){$e?.apply(this,e)})),e.append(t,s)}}})},d=(t,a)=>{var i=t=>{const a=e.derived_safe_equal((()=>w("antiransomware.stopProtectingFolderName.title",n().lastFolderName))),s=e.derived_safe_equal((()=>w("antiransomware.stopProtectingFolder.desc"))),i=e.derived_safe_equal((()=>({name:"circle-critical",size:54})));c(t,{get title(){return e.get(a)},get subtitle(){return e.get(s)},get icon(){return e.get(i)},$$events:{close(...e){$e?.apply(this,e)}},$$slots:{"modal-footer":(t,a)=>{var s=We(),i=e.child(s),l=e.child(i),r=e.derived((()=>o([n().folderToRemove])));e.set_custom_element_data(l,"data-test","modal_confirm");var d=e.child(l,!0);e.reset(l);var c=e.sibling(l,2);e.set_custom_element_data(c,"type","secondary");var p=e.child(c,!0);e.reset(c),e.reset(i),e.reset(s),e.template_effect(((t,a)=>{e.set_text(d,t),e.set_text(p,a)}),[()=>w("antiransomware.stopProtecting.btnCaption"),()=>w("global.cancel")],e.derived_safe_equal),e.event("click",l,(function(...t){e.get(r)?.apply(this,t)})),e.event("click",c,(function(...e){$e?.apply(this,e)})),e.append(t,s)}}})},d=(t,a)=>{var i=t=>{const a=e.derived_safe_equal((()=>w("antiransomware.stopProtectingFolders.title",l()))),i=e.derived_safe_equal((()=>w("antiransomware.stopProtectingFolders.desc",l()))),n=e.derived_safe_equal((()=>({name:"circle-critical",size:54})));c(t,{get title(){return e.get(a)},get subtitle(){return e.get(i)},get icon(){return e.get(n)},$$events:{close(...e){$e?.apply(this,e)}},$$slots:{"modal-footer":(t,a)=>{var i=Je(),n=e.child(i),l=e.child(n),r=e.derived((()=>o(e.store_get(pe,"$selectedFolders",s))));e.set_custom_element_data(l,"data-test","modal_confirm");var d=e.child(l,!0);e.reset(l);var c=e.sibling(l,2);e.set_custom_element_data(c,"type","secondary");var p=e.child(c,!0);e.reset(c),e.reset(n),e.reset(i),e.template_effect(((t,a)=>{e.set_text(d,t),e.set_text(p,a)}),[()=>w("antiransomware.stopProtecting.btnCaption"),()=>w("global.cancel")],e.derived_safe_equal),e.event("click",l,(function(...t){e.get(r)?.apply(this,t)})),e.event("click",c,(function(...e){$e?.apply(this,e)})),e.append(t,i)}}})},d=(t,a)=>{var s=t=>{const a=e.derived_safe_equal((()=>w("antiransomware.uselessShield"))),s=e.derived_safe_equal((()=>w("antiransomware.uselessShield.desc"))),i=e.derived_safe_equal((()=>({name:"circle-critical",size:54})));c(t,{get title(){return e.get(a)},get subtitle(){return e.get(s)},get icon(){return e.get(i)},$$events:{close(...e){$e?.apply(this,e)}},$$slots:{"modal-footer":(t,a)=>{var s=Ke(),i=e.child(s),n=e.child(i);e.set_custom_element_data(n,"data-test","modal_confirm");var l=e.child(n,!0);e.reset(n);var o=e.sibling(n,2);e.set_custom_element_data(o,"type","secondary");var d=e.child(o,!0);e.reset(o),e.reset(i),e.reset(s),e.template_effect(((t,a)=>{e.set_text(l,t),e.set_text(d,a)}),[()=>w("antiransomware.switchOffRansomwareShield"),()=>w("global.cancel")],e.derived_safe_equal),e.event("click",n,r),e.event("click",o,(function(...e){$e?.apply(this,e)})),e.append(t,s)}}})},i=(t,a)=>{var s=e=>{Ve(e,{})};e.if(t,(e=>{"addCustomFileType"===n().modalDialog&&e(s)}),a)};e.if(t,(e=>{"removeAllFolders"===n().modalDialog?e(s):e(i,!1)}),a)};e.if(t,(e=>{"removeSelectedFolders"===n().modalDialog?e(i):e(d,!1)}),a)};e.if(t,(e=>{"removeFolder"===n().modalDialog?e(i):e(d,!1)}),a)};e.if(t,(e=>{"cannotAdd"===n().modalDialog?e(i):e(d,!1)}),a)};e.if(i,(e=>{"alreadyProtected"===n().modalDialog?e(d):e(p,!1)})),e.append(t,a)};e.if(p,(e=>{n().modalDialog&&e(m)})),e.append(t,d),e.pop(),i()}const Qe={learnMore:null,breadcrumbs:{section:"security",moduleId:"antiRansomware",moduleTranslationId:"antiransomware",subsections:null}};var Xe=e.template('<div slot="page-breadcrumbs"><!></div>'),Ye=e.template('<div slot="page-controls"><kin-switch></kin-switch></div>',2),et=e.template('<div slot="page-installer"><!></div>'),tt=e.template("<kin-button> </kin-button> <!>",3),at=e.template('<div slot="page-cta"><!></div>'),st=e.template('<div slot="page-content"><!></div>'),it=e.template('<div slot="page-actions-desc"><p> </p> <p><!></p></div>'),nt=e.template('<div slot="page-actions-cta"><kin-button> </kin-button></div>',2),lt=e.template('<div slot="page-actions"><!></div>'),ot=e.template('<div slot="page-modals"><!></div>');function rt(t,i){e.push(i,!1);const[o,r]=e.setup_stores(),d=E(),c=x.isInstalled(q),v=[];let h=e.mutable_source(x.isEnabled(q)),b=e.mutable_source(!1);function k(e){n.feature.click({feature:q,label:e})}function y(){_.toggle(q,{stopOptions:d,track:({enabled:e,time:t})=>n.feature.toggle({enabled:e,time:t,feature:q})})}function $(){we(e.store_get(pe,"$selectedFolders",o))}s((()=>{v.push(l.on(`product.change.feature.${q}`,(t=>{!function(t){e.set(b,!1),e.set(h,t.enabled)}(t)})))})),a((()=>{ye(),v.forEach((e=>e()))})),e.init();const T=e.derived_safe_equal((()=>w("antiransomware"))),P=e.derived_safe_equal((()=>w("antiransomware.desc"))),F=e.derived_safe_equal((()=>!e.get(h))),D=e.derived_safe_equal((()=>w("antiransomware.inactive.tooltip")));p(t,{get title(){return e.get(T)},get desc(){return e.get(P)},cssCls:"arw",settingsHash:"#settings/antiRansomware",get disabled(){return e.get(F)},get disabledMsg(){return e.get(D)},disabledAreas:["!desc"],backHash:"#security",installer:!c,get learnMore(){return Qe.learnMore},$$slots:{"page-breadcrumbs":(t,a)=>{var s=Xe(),i=e.child(s);f(i,{get section(){return Qe.breadcrumbs.section},get moduleId(){return Qe.breadcrumbs.moduleId},get subsections(){return Qe.breadcrumbs.subsections},get moduleTranslationId(){return Qe.breadcrumbs.moduleTranslationId}}),e.reset(s),e.append(t,s)},"page-controls":(t,a)=>{var s=Ye(),i=e.child(s);e.set_custom_element_data(i,"data-test","antiransomware-switch"),e.template_effect((()=>e.set_custom_element_data(i,"kin-checked",e.get(h)))),e.template_effect((()=>e.set_custom_element_data(i,"processing",e.get(b)))),e.template_effect((()=>e.set_custom_element_data(i,"aria-label",w("antiransomware")))),e.set_custom_element_data(i,"size","small"),e.reset(s),e.event("click",i,y),e.append(t,s)},"page-installer":(t,a)=>{var s=et(),i=e.child(s);const n=e.derived_safe_equal((()=>w("antiransomware.desc")));u(i,{get desc(){return e.get(n)},featureId:q,get learnMore(){return Qe.learnMore}}),e.reset(s),e.append(t,s)},"page-cta":(t,a)=>{var s=at(),i=e.child(s),n=t=>{var a=tt(),s=e.first_child(a);e.set_class(s,1,"g-margin-right--2x"),e.set_custom_element_data(s,"size","small");var i=e.child(s,!0);e.reset(s);var n=e.sibling(s,2);g(n,{type:"secondaryButton",track:k}),e.template_effect((t=>e.set_text(i,t)),[()=>w("antiransomware.protectNewFolder")],e.derived_safe_equal),e.event("click",s,(function(...e){De?.apply(this,e)})),e.append(t,a)};e.if(i,(t=>{e.store_get(ie,"$protectedFolders",o).length&&t(n)})),e.reset(s),e.append(t,s)},"page-content":(t,a)=>{var s=st(),i=e.child(s),n=e=>{Be(e,{})};e.if(i,(e=>{c&&e(n)})),e.reset(s),e.append(t,s)},"page-actions":(t,a)=>{var s=lt(),i=e.child(s);m(i,{$$slots:{"page-actions-desc":(t,a)=>{var s=it(),i=e.child(s),n=e.child(i,!0);e.reset(i);var l=e.sibling(i,2),r=e.child(l);e.html(r,(()=>w("global.escToDeselect"))),e.reset(l),e.reset(s),e.template_effect((t=>e.set_text(n,t)),[()=>w("antiransomware.foldersSelected",e.store_get(me,"$selectedFoldersCount",o))],e.derived_safe_equal),e.append(t,s)},"page-actions-cta":(t,a)=>{var s=nt(),i=e.child(s),n=e.child(i,!0);e.reset(i),e.reset(s),e.template_effect((t=>e.set_text(n,t)),[()=>w("global.stopProtecting")],e.derived_safe_equal),e.event("click",i,$),e.append(t,s)}}}),e.reset(s),e.append(t,s)},"page-modals":(t,a)=>{var s=ot();Ze(e.child(s),{}),e.reset(s),e.append(t,s)}}}),e.pop(),r()}var dt=e.template("<span><!></span>"),ct=e.template("<span> </span>"),pt=e.template('<p class="sve_toaster__text p -small -secondary g-margin-top--1x"><!> <kin-tooltip><span slot="tooltip-activator"><kin-icon></kin-icon></span> <span slot="tooltip"><span class="p -small"> </span></span></kin-tooltip></p>',2);function mt(t,s){e.push(s,!1);const n=!0,l=/[/|\\]/g,r=500,d=o.getUrlParams(),c=d.id,p=d.alertId,m=new Date,u=x.isAfbManaged(),f=k.fileInsight,_="ignore",g="allow",h="block";let b=e.mutable_source(null),y=e.mutable_source({}),$=null,T=e.mutable_source(0);function P(){F(_)}function F(e){i("app.av.detections.UserChoice",{id:c,userChoice:e}).catch((e=>{console.error("failed to store user choice",e)}))}function q(t){e.mutate(y,e.get(y).timeout=null),$?.();const a=t===g?{color:"green",icon:{name:"icon-m-tools-ransomware",color:"ok"},title:w(u?"antiransomware.allowed.once.title":"antiransomware.appAllowed.title"),text:w("antiransomware.appAllowed.desc",e.get(y).actorName,e.get(y).protectedFolderName),textSanitized:!0,actionText:w(u?"antiransomware.allowed.once.actionText":"antiransomware.weAlwaysAllow"),actions:[{label:w("global.gotIt"),labelTest:"dd_primary_btn_got-it",labelTracking:"gotIt"}],details:E(),status:{text:w("antiransomware.allowed"),actionText:null,actionTextGA:null,action:null},detectionInfo:{id:e.get(y).alertId,timestamp:m,index:0,total:0,showCloseAllBtn:!1}}:{color:"green",icon:{name:"icon-m-tools-ransomware",color:"ok"},title:w(u?"antiransomware.blocked.once.title":"antiransomware.appBlocked.title"),text:w("antiransomware.appBlocked.desc",e.get(y).actorName,e.get(y).protectedFolderName),textSanitized:!0,actionText:w(u?"antiransomware.blocked.once.actionText":"antiransomware.weAlwaysBlock"),actions:[{label:w("global.gotIt"),labelTest:"dd_primary_btn_got-it",labelTracking:"gotIt"}],details:E(),status:{text:w("antiransomware.blocked"),actionText:null,actionTextGA:null,action:null},detectionInfo:{id:e.get(y).alertId,timestamp:m,index:0,total:0,showCloseAllBtn:!1}};return f.emitActionPerformed(e.get(y).detectionId,a,t),F(t),u?D().then((()=>a)):i("app.antiransomware.GetExcludedFiles").then((s=>{const n=e.get(y).actorPath+"<block="+(t===g?"0":"1")+">";return s&&"function"==typeof s.push||(s=[]),s.push(n),i("app.antiransomware.SetExcludedFiles",s).then((()=>(o.broadcastEvent("settings.blockedAndAllowedApps.changed"),D().then((()=>a))))).catch((e=>{console.error("setting excluded files failed",e)}))})).catch((e=>{console.error("getting excluded files failed",e)}))}function D(){return i("app.antiransomware.GetPaths").then((t=>{const a=e.get(y).filePath.toLowerCase();let s="";if(t.forEach((e=>{-1!==a.indexOf(e.toLowerCase())&&e.length>s.length&&(s=e)})),s)return s})).catch((e=>{console.error("getting paths failed",e),o.close()})).then((t=>{e.mutate(y,e.get(y).protectedFolderPath=t),e.mutate(y,e.get(y).protectedFolderName=function(e){const t=e&&e.split(l);let a="";if(t)for(;a.length<1&&t.length>0;)a=t.pop();return a}(t))}))}function E(){return[{title:w("global.appName"),value:e.get(y).actorPath,testValue:"threatName"},{title:w("antiransomware.actedVia"),value:e.get(y).actedViaPath},{title:w("global.protectedFolder"),value:e.get(y).protectedFolderPath},{title:w(e.get(y).targetIsDir?"global.folderPath":"global.filePath"),value:e.get(y).filePath,testValue:e.get(y).targetIsDir?"folder":"file"},{title:w("global.detectedBy"),value:w("antiransomware"),testValue:"detectedBy_RansomwareShield"}]}a((()=>{$?.()})),i("app.av.detections.GetStatus",{id:c}).then((t=>(e.set(y,{filePath:t.file,fileName:t.file.split(l).pop(),actorPath:t.actor,actorName:t.actor.split(l).pop(),actedViaPath:t.actedVia,alertId:t.alertId||p,targetIsDir:t.targetIsDir,timeout:t.timeout,detectionId:t.id}),D()))).catch((e=>{console.error("getting status failed",e),o.close()})).then((async()=>{e.set(b,function(){const t={color:"red",icon:{name:"icon-m-tools-ransomware",color:"critical"},title:w("antiransomware.weJustProtect.title"+(e.get(y).targetIsDir?".dir":"")),text:w("antiransomware.weJustProtect.desc"+(e.get(y).targetIsDir?".dir":""),e.get(y).actorName,e.get(y).fileName,e.get(y).protectedFolderName),textSanitized:!0,actionText:w("antiransomware.whatToDo"),actions:[],details:E(),status:{text:"-"},detectionInfo:{id:e.get(y).alertId,timestamp:m,index:0,total:0,showCloseAllBtn:!1}};return t.actions.push({label:w(u?"antiransomware.block.once.button":"antiransomware.blockDetectedApp"),labelTest:"dd_primary_btn_block",labelTracking:"block",action:q.bind(this,h),status:{text:w("antiransomware.blocking")},minDuration:r}),t.actions.push({label:w(u?"antiransomware.allow.once.button":"antiransomware.allowDetectedApp"),labelTest:"dd_secondary_btn_allow",labelTracking:"allow",action:q.bind(this,g),status:{text:w("antiransomware.allowing")},minDuration:r}),t}()),await o.init({width:600,height:420,wait:!0}),function(){if($?.(),e.get(y).timeout){e.set(T,e.get(y).timeout);const t=window.setInterval((function(){e.get(T)?e.update(T,-1):(window.clearInterval(t),2==e.get(b)?.actions?.length&&(e.mutate(b,e.get(b).actions[0].label=w("detection.action.keepBlocking")),e.set(b,e.get(b))))}),1e3);$=function(){window.clearInterval(t),e.set(T,0),$=null}}}()})),e.init();var I=e.comment(),A=e.first_child(I),C=t=>{v(t,{get config(){return e.get(b)},$$events:{ignore:P},$$slots:{"custom-action":(t,a)=>{var s=e.comment(),i=e.first_child(s),n=t=>{var a=pt(),s=e.child(a),i=t=>{var a=dt(),s=e.child(a);e.html(s,(()=>w("detection.pauseCountdown",e.get(T)))),e.reset(a),e.append(t,a)},n=t=>{var a=ct(),s=e.child(a,!0);e.reset(a),e.template_effect((t=>e.set_text(s,t)),[()=>w("detection.pauseCountdownEnd")],e.derived_safe_equal),e.append(t,a)};e.if(s,(t=>{0!==e.get(T)?t(i):t(n,!1)}));var l=e.sibling(s,2),o=e.child(l),r=e.child(o);e.set_custom_element_data(r,"name","icon-m-action-info"),e.set_custom_element_data(r,"size","16"),e.reset(o);var d=e.sibling(o,2),c=e.child(d),p=e.child(c,!0);e.reset(c),e.reset(d),e.reset(l),e.reset(a),e.template_effect((t=>e.set_text(p,t)),[()=>w("detection.pauseCountdown.tooltip")],e.derived_safe_equal),e.append(t,a)};e.if(i,(t=>{e.get(y).timeout&&t(n)})),e.append(t,s)}}})};return e.if(A,(t=>{e.get(b)&&t(C)})),e.append(t,I),e.bind_prop(s,"handlesWindowInit",n),e.pop({handlesWindowInit:n})}Ee(".arw_extensions__label.svelte-18igbjf {\n  width: 100%;\n  display: block;\n  width: -webkit-fill-available;\n}\n");var ut=e.template('<p class="p -small -secondary -margins g-margin-top--2x"> </p>'),ft=e.template('<thead><tr><th colspan="2"> </th></tr></thead>'),_t=e.template('<tr class="-hoverable"><td><input type="checkbox" class="checkbox"></td><td><label class="checkbox__label -clickable arw_extensions__label svelte-18igbjf"><kin-tooltip><span slot="tooltip-activator"><kin-icon></kin-icon> </span> <div slot="tooltip"> </div></kin-tooltip></label></td></tr>',2),gt=e.template('<!> <table class="table -compact g-margin-top--2x"><colgroup><col width="30"><col></colgroup><!><tbody></tbody></table> <h5 class="h5 -margins g-margin-top--2x"> </h5> <input id="custom-extensions" class="input -full -field" type="text" spellcheck="false" maxlength="400"> <p class="p -small color-ok -text g-margin-top--2x"> </p>',1),vt=e.template("<div><!></div>");function ht(t,s){e.push(s,!1);const[i,n]=e.setup_stores();let l=e.prop(s,"hideLabel",8,!1),o=e.prop(s,"hideTableHeader",8,!1),r=e.prop(s,"disabled",8,!1);function d(e){const t=String.fromCharCode(e.charCode||e.which);if(new RegExp(/[\\|\/|:|\*|\?|"|<|>|\|]/).test(t))return e.preventDefault(),!1}a((()=>{qe()})),e.init();var c=vt(),p=e.child(c),m=t=>{var a=gt(),s=e.first_child(a),n=t=>{var a=ut(),s=e.child(a,!0);e.reset(a),e.template_effect((t=>e.set_text(s,t)),[()=>w(P.protectedFileTypesTitle)],e.derived_safe_equal),e.append(t,a)};e.if(s,(e=>{l()||e(n)}));var c=e.sibling(s,2),p=e.sibling(e.child(c)),m=t=>{var a=ft(),s=e.child(a),i=e.child(s),n=e.child(i,!0);e.reset(i),e.reset(s),e.reset(a),e.template_effect((t=>e.set_text(n,t)),[()=>w(P.fileTypesTitle)],e.derived_safe_equal),e.append(t,a)};e.if(p,(e=>{o()||e(m)}));var u=e.sibling(p);e.each(u,5,(()=>Object.entries(e.store_get(oe,"$fileTypes",i))),e.index,((t,a)=>{let s=()=>e.get(a)[0];var i=e.comment(),n=e.first_child(i),l=t=>{var i=_t(),n=e.child(i),l=e.child(n);e.remove_input_defaults(l),e.reset(n);var o=e.sibling(n),d=e.child(o),c=e.child(d),p=e.child(c),m=e.child(p);e.template_effect((()=>e.set_custom_element_data(m,"name",`icon-m-file-${s()??""}`))),e.set_custom_element_data(m,"size","24"),e.set_class(m,1,"g-margin-right--1x");var u=e.sibling(m);e.reset(p);var f=e.sibling(p,2),_=e.child(f,!0);e.reset(f),e.reset(c),e.reset(d),e.reset(o),e.reset(i),e.template_effect((t=>{l.disabled=r(),e.set_checked(l,e.get(a)[1].selected),e.set_attribute(l,"id",`arw_${s()??""}`),e.set_attribute(l,"data-test",`arw_${s()??""}`),e.set_attribute(d,"for",`arw_${s()??""}`),e.set_attribute(d,"data-test",`arw_${s()??""}-label`),e.set_text(u,` ${t??""}`),e.set_text(_,e.get(a)[1].strExtList)}),[()=>w(P.fileTypes[s()])],e.derived_safe_equal),e.event("change",l,(()=>function(e){ee.update((t=>{const a=t[e];if(a.selected){t[e].selected=!1;const s=a.strExtList.split(O),i=Array.from(new Set(L(te).split(O))),n=s.filter((e=>i.includes(e))),l=i.filter((e=>!n.includes(e)));te.set(l.join(", ")),Fe()}else t[e].selected=!0;return t})),K()}(s()))),e.append(t,i)};e.if(n,(e=>{"hidden"!==s()&&e(l)})),e.append(t,i)})),e.reset(u),e.reset(c);var f=e.sibling(c,2),_=e.child(f,!0);e.reset(f);var g=e.sibling(f,2);e.remove_input_defaults(g);var v=e.sibling(g,2),h=e.child(v,!0);e.reset(v),e.template_effect(((t,a,s)=>{e.set_text(_,t),e.set_attribute(g,"placeholder",a),e.set_value(g,e.store_get(re,"$customExtensions",i)),g.disabled=r(),e.set_style(v,e.store_get(de,"$duplicateExtensions",i)?"":"visibility: hidden"),e.set_text(h,s)}),[()=>w(P.customExtensions),()=>w(P.customExtensionsPlaceholder),()=>w(P.customExtensionsDuplicates)],e.derived_safe_equal),e.event("keypress",g,d),e.event("input",g,(function(...e){Pe?.apply(this,e)})),e.append(t,a)};e.if(p,(t=>{e.store_get(le,"$loading",i)||t(m)})),e.reset(c),e.append(t,c),e.pop(),n()}const bt="antiransomware_settings_viewProtectedFolders",wt="antiransomware_settings_protectedFileTypes",xt={title:P.title,desc:P.settingsDesc,items:[...$.props2searchItems(D),{title:P.viewProtectedFolders,elemId:bt},{title:P.protectedFileTypesTitle,secondaries:[P.fileTypes.music,P.fileTypes.archive,P.fileTypes.database,P.fileTypes.disc,P.fileTypes.document,P.fileTypes.photo,P.fileTypes.video,P.customExtensions],elemId:wt}]};var kt=e.template('<div class="g-margin-top--1x"><!></div>'),yt=e.template('<!> <!> <!> <a class="a -small" href="#antiRansomware"> </a> <div><!></div>',1);function $t(t,a){e.push(a,!1);const s=E(),{mode:i,fileProtectionMode:n}=D,l=null!=n;let o=e.mutable_source();e.init();const r=e.derived_safe_equal((()=>w(P.title))),d=e.derived_safe_equal((()=>w(P.settingsDesc)));h(t,{component:q,get title(){return e.get(r)},get desc(){return e.get(d)},stopOptions:s,children:(t,a)=>{var s=yt(),r=e.first_child(s);b(r,{prop:i});var d=e.sibling(r,2);g(d,{});var c=e.sibling(d,2),p=t=>{var a=kt(),s=e.child(a);b(s,{prop:n,$$events:{value:t=>e.set(o,t.detail)}}),e.reset(a),e.append(t,a)};e.if(c,(e=>{l&&e(p)}));var m=e.sibling(c,2);e.set_attribute(m,"id",bt);var u=e.child(m,!0);e.reset(m);var f=e.sibling(m,2);e.set_attribute(f,"id",wt);var _=e.child(f);const v=e.derived_safe_equal((()=>"1"==e.get(o)));ht(_,{hideLabel:l,get disabled(){return e.get(v)}}),e.reset(f),e.template_effect((t=>e.set_text(u,t)),[()=>w(P.viewProtectedFolders)],e.derived_safe_equal),e.append(t,s)},$$slots:{default:!0}}),e.pop()}var Tt;Tt={learnMore:{badge:"antiransomware",title:"antiransomware.learnMore",desc:"antiransomware.learnMore.desc",overview:"antiransomware.learnMore.overview",illustration:{name:"m073",nameSpaghetti:"i-169"},benefits:[{desc:"antiransomware.learnMore.benefits.1.desc"},{desc:"antiransomware.learnMore.benefits.2.desc"},{desc:"antiransomware.learnMore.benefits.3.desc"}],introKey:"antiRansomware"}},Object.assign(Qe,Tt);export{rt as default,mt as detection,$t as settings,xt as settingsSearchStrings};const Pt={name:"antiRansomware",version:"1.3.1697",created:"2025-06-19T07:29:11.867Z"};export{Pt as metadata};
