//{"name":"ras","version":"1.3.1358","created":"2024-11-19T11:02:56.930Z"}
import{SvelteComponent as e,init as t,safe_not_equal as n,append_styles as l,ensure_array_like as o,space as s,element as c,create_component as a,attr as i,set_custom_element_data as r,insert as d,append as p,mount_component as m,listen as u,action_destroyer as g,transition_in as b,group_outros as f,transition_out as h,check_outros as $,detach as v,destroy_component as S,destroy_each as A,run_all as w,component_subscribe as k,noop as _,text as x,set_data as E,empty as I}from"./svelteInternal.js";import{onMount as j,onDestroy as R}from"./svelteInternal.js";import{eventer as y,serviceRequest as L,napiTracker as C,windowApi as M}from"./napi.js";import{productModel as P,settingsService as T}from"./napiExtensions.js";import{nls as z,format as D}from"./i18n.js";import{Illustration as B,LinkGroup as N,featureManager as O,UberPage as F,Crumbs as H,Upsell as V,Installer as G,Container as U,Checkbox as W,Modal as q,IconButton as Z,DetectionDialog as J}from"./svelteComponents.js";import{TableSmartScroll as K,settingsProps as Q}from"./plugins.js";import{debounce as X,ipValidator as Y,stringUtils as ee}from"./libs.js";"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");const te="RemoteAccessShield",ne="remoteAccessShield",le="remoteAccessShield.settings.desc",oe="remoteAccessShield.settings.bruteForceEnabled.desc",se="remoteAccessShield.settings.blacklistEnabled.desc",ce="remoteAccessShield.settings.exploitEnabled.desc",ae={notificationEnabled:{label:"remoteAccessShield.settings.notificationEnabled.label",desc:"remoteAccessShield.settings.notificationEnabled.desc",icon:"icon-m-notification",path:"avcfg://RemoteAccessShield/Detection/NotificationEnabled",hint:"remoteAccessShield.notification.hint",track:{subject:"Notification enabled"}},bruteForceEnabled:{label:"remoteAccessShield.settings.bruteForceEnabled.label",desc:oe,path:"avcfg://RemoteAccessShield/Detection/BruteForceEnabled",hint:oe,track:{subject:"Brute force enabled"}},blacklistEnabled:{label:"remoteAccessShield.settings.blacklistEnabled.label",desc:se,path:"avcfg://RemoteAccessShield/Detection/BlacklistEnabled",hint:se,track:{subject:"Blacklist enabled"}},exploitEnabled:{label:"remoteAccessShield.settings.exploitEnabled.label",desc:ce,path:"avcfg://RemoteAccessShield/Detection/ExploitEnabled",hint:ce,track:{subject:"Exploit enabled"}},allowedIpEnabled:{label:"remoteAccessShield.settings.allowedIpEnabled.label",desc:"remoteAccessShield.settings.allowedIpEnabled.desc",path:"avcfg://RemoteAccessShield/RdpAccess/AllowedIpEnabled",change:null,updateOnEvent:{event:"settings.change.ras.allowedIpList.empty",getValue:()=>0},track:{subject:"Allowed IP enabled"}},enableRdpProtection:{label:"remoteAccessShield.settings.enableRdpProtection.label",path:"avcfg://RemoteAccessShield/Detection/RdpEnabled",track:{subject:"Enable RDP protection"}},enableSambaProtection:{label:"remoteAccessShield.settings.enableSambaProtection.label",path:"avcfg://RemoteAccessShield/Detection/SmbEnabled",track:{subject:"Enable Samba protection"}}},ie={title:z("remoteAccessShield.stopOptions.title"),desc:z("remoteAccessShield.stopOptions.desc")};function re(e){l(e,"svelte-j86nub","[slot='table-header'].svelte-j86nub.svelte-j86nub,.ras_table__row.svelte-j86nub.svelte-j86nub{grid-template-columns:47% 26% 22% 5%}.ras_newItems.svelte-j86nub.svelte-j86nub{position:sticky;top:100px;text-align:center;z-index:10;height:0}.ras_newItems.svelte-j86nub button.svelte-j86nub{background:var(--c-on-background-secondary);color:var(--c-background);padding:10px 20px;border-radius:10px;font-weight:bold;cursor:pointer}")}function de(e,t,n){const l=e.slice();l[25]=t[n],l[29]=n;const o=l[25].action;l[26]=o;const s="failed"===l[26]?null:"blocked"===l[26]?"badge-critical":"badge-ok";return l[27]=s,l}function pe(e){let t,n,l,o;return{c(){t=c("div"),n=c("button"),n.textContent=`↑ ${z("remoteAccessShield.log.newItems")}`,i(n,"class","svelte-j86nub"),i(t,"class","ras_newItems svelte-j86nub")},m(s,c){d(s,t,c),p(t,n),l||(o=u(n,"click",e[14]),l=!0)},p:_,d(e){e&&v(t),l=!1,o()}}}function me(e){let t,n;return t=new N({props:{links:e[6],changeCallback:e[12],activeLinkId:e[0]}}),{c(){a(t.$$.fragment)},m(e,l){m(t,e,l),n=!0},p(e,n){const l={};64&n&&(l.links=e[6]),1&n&&(l.activeLinkId=e[0]),t.$set(l)},i(e){n||(b(t.$$.fragment,e),n=!0)},o(e){h(t.$$.fragment,e),n=!1},d(e){S(t,e)}}}function ue(e){let t,n,l,o,a,m,u,g,b,f,h,$,S,A,w,k,_,I,j,R,y,L,C,M,P,T,B,N=e[25].ip+"",O=D.dateTimeShortSeconds(e[25].time)+"",F=z("remoteAccessShield.log."+e[25].action)+"",H=z("remoteAccessShield.log.info.title."+e[25].action+"."+e[25].protocol)+"",V=z("remoteAccessShield.log.info.desc."+e[25].action+(e[25].actionReason?"."+e[25].actionReason:""),e[25].ip)+"";return{c(){t=c("div"),n=c("div"),l=c("kin-icon"),a=s(),m=c("span"),u=x(N),g=s(),b=c("div"),f=x(O),h=s(),$=c("div"),S=x(F),A=s(),w=c("div"),k=c("kin-tooltip"),_=c("span"),_.innerHTML='<kin-icon name="icon-m-action-info" size="16" class="kin_table__show-on-hover"></kin-icon>',I=s(),j=c("div"),R=c("p"),y=c("strong"),L=x(H),C=s(),M=c("p"),P=x(V),T=s(),r(l,"name","icon-m-remote-desktop-control"),r(l,"size","24"),r(l,"badge",o=e[27]),r(l,"class","g-margin-right--1x"),i(m,"class","g-ltr"),i($,"class","kin_table__name"),i(_,"slot","tooltip-activator"),i(j,"slot","tooltip"),i(w,"class","kin_table__actions"),i(t,"role","row"),i(t,"class","kin_table__row ras_table__row svelte-j86nub"),i(t,"aria-rowindex",e[29]),i(t,"data-test",B="ras_connection-row-"+e[25].action)},m(e,o){d(e,t,o),p(t,n),p(n,l),p(n,a),p(n,m),p(m,u),p(t,g),p(t,b),p(b,f),p(t,h),p(t,$),p($,S),p(t,A),p(t,w),p(w,k),p(k,_),p(k,I),p(k,j),p(j,R),p(R,y),p(y,L),p(j,C),p(j,M),p(M,P),p(t,T)},p(e,n){128&n&&o!==(o=e[27])&&r(l,"badge",o),128&n&&N!==(N=e[25].ip+"")&&E(u,N),128&n&&O!==(O=D.dateTimeShortSeconds(e[25].time)+"")&&E(f,O),128&n&&F!==(F=z("remoteAccessShield.log."+e[25].action)+"")&&E(S,F),128&n&&H!==(H=z("remoteAccessShield.log.info.title."+e[25].action+"."+e[25].protocol)+"")&&E(L,H),128&n&&V!==(V=z("remoteAccessShield.log.info.desc."+e[25].action+(e[25].actionReason?"."+e[25].actionReason:""),e[25].ip)+"")&&E(P,V),128&n&&B!==(B="ras_connection-row-"+e[25].action)&&i(t,"data-test",B)},d(e){e&&v(t)}}}function ge(e){let t,n,l,k,_,x,E,I,j,R,y,L,C,M,P,T,D,N,O,F,H,V,G,U,W,q,Z,J=e[5]&&e[4]&&pe(e),K=function(){let e;return{c(){e=c("h4"),e.textContent=`${z("remoteAccessShield.log.title")}`,i(e,"class","h4")},m(t,n){d(t,e,n)},d(t){t&&v(e)}}}(),Q=e[7].length&&me(e);E=new B({props:{name:"empty-table",nameSpaghetti:"i-l-075"}});let X=o(e[7]),Y=[];for(let o=0;o<X.length;o+=1)Y[o]=ue(de(e,X,o));return{c(){J&&J.c(),t=s(),n=c("kin-table"),l=c("div"),K&&K.c(),k=s(),Q&&Q.c(),_=s(),x=c("div"),a(E.$$.fragment),I=s(),j=c("div"),R=c("h3"),R.textContent=`${z("remoteAccessShield.log.empty")}`,y=s(),L=c("p"),L.textContent=`${z("remoteAccessShield.log.empty2")}`,C=s(),M=c("div"),P=c("div"),P.textContent=`${z("global.ipAddress")}`,T=s(),D=c("div"),D.textContent=`${z("global.time")}`,N=s(),O=c("div"),O.textContent=`${z("remoteAccessShield.log.action")}`,F=s(),H=c("div"),H.innerHTML="",V=s(),G=c("div");for(let e=0;e<Y.length;e+=1)Y[e].c();i(l,"slot","table-ribbon"),i(x,"slot","table-empty-icon"),i(R,"class","h3"),i(L,"class","text -small"),i(j,"slot","table-empty"),i(P,"row","columnheader"),i(D,"row","columnheader"),i(O,"row","columnheader"),i(H,"class","kin_table__actions"),i(M,"role","row"),i(M,"slot","table-header"),i(M,"class","svelte-j86nub"),i(G,"slot","table-body"),r(n,"loading",e[1]),r(n,"datalength",U=e[2].length),r(n,"dataname","rasLogs"),r(n,"scrollrootselector",be.scrollRootSelector),r(n,"watchscrollpos",!0),r(n,"bottomloading",e[3]),r(n,"data-test","ras_connection-table")},m(o,s){J&&J.m(o,s),d(o,t,s),d(o,n,s),p(n,l),K&&K.m(l,null),p(l,k),Q&&Q.m(l,null),p(n,_),p(n,x),m(E,x,null),p(n,I),p(n,j),p(j,R),p(j,y),p(j,L),p(n,C),p(n,M),p(M,P),p(M,T),p(M,D),p(M,N),p(M,O),p(M,F),p(M,H),p(n,V),p(n,G);for(let e=0;e<Y.length;e+=1)Y[e]&&Y[e].m(G,null);W=!0,q||(Z=[u(n,"scrollPos",e[11]),g(e[10].call(null,n))],q=!0)},p(e,[s]){if(e[5]&&e[4]?J?J.p(e,s):(J=pe(e),J.c(),J.m(t.parentNode,t)):J&&(J.d(1),J=null),e[7].length?Q?(Q.p(e,s),128&s&&b(Q,1)):(Q=me(e),Q.c(),b(Q,1),Q.m(l,null)):Q&&(f(),h(Q,1,1,(()=>{Q=null})),$()),128&s){let t;for(X=o(e[7]),t=0;t<X.length;t+=1){const n=de(e,X,t);Y[t]?Y[t].p(n,s):(Y[t]=ue(n),Y[t].c(),Y[t].m(G,null))}for(;t<Y.length;t+=1)Y[t].d(1);Y.length=X.length}(!W||2&s)&&r(n,"loading",e[1]),(!W||4&s&&U!==(U=e[2].length))&&r(n,"datalength",U),(!W||8&s)&&r(n,"bottomloading",e[3])},i(e){W||(b(Q),b(E.$$.fragment,e),W=!0)},o(e){h(Q),h(E.$$.fragment,e),W=!1},d(e){e&&(v(t),v(n)),J&&J.d(e),K&&K.d(),Q&&Q.d(),S(E),A(Y,e),q=!1,w(Z)}}}const be={hasRibbonTitle:!0,scrollRootSelector:".sve_page__scroll"};function fe(e,t,n){let l,o;const s={0:"rdp",1:"samba"},c={0:{action:"allowed"},1:{action:"allowed",reason:"ipInAllowedList"},100:{action:"failed"},200:{action:"blocked",reason:"bruteForce"},201:{action:"blocked",reason:"ipInBlackList"},202:{action:"blocked",reason:"exploit"},203:{action:"blocked"}},a={all:[],allowed:[0,99],failed:[100,199],blocked:[200,299]},i=["all","blocked"],r={all:0,blocked:0};let d=!0,p=[];const m=new K(p),u=m.getItems();k(e,u,(e=>n(7,o=e)));let g=i[0],b=!1,f=!1,h=null,$=null,v=!1,S=null;function A(){return n(2,p=[]),n(1,d=!0),S=0,n(4,f=!1),n(5,v=!1),h=null,$&&$(0),Promise.all([L("app.ras.GetLogStats").then((e=>{n(13,r.all=e.connections_all,r),n(13,r.blocked=e.connections_blocked,r)})),w()]).finally((()=>n(1,d=!1)))}function w(e={}){const t=a[g]||[],l={row_limit:30,row_offset:p.length||void 0,max_id:S,min_action:t[0],max_action:t[1]};return e.concat&&n(3,b=!0),L("app.ras.GetLog",l).then((t=>{let l=[];t.data&&(l=t.data.map((e=>({time:e.time,ip:e.ip,action:c[e.action].action,actionReason:c[e.action].reason,protocol:s[e.protocol]})))),e.concat?n(2,p=p.concat(l)):n(2,p=l),m.update(p),n(3,b=!1),null!=t.max_id&&(S=Math.max(S,t.max_id))}))}j((()=>{y.on("ui.ras.logevent",(()=>{f?n(5,v=!0):A()}))}));return e.$$.update=()=>{1&e.$$.dirty&&g&&A(),8192&e.$$.dirty&&n(6,l=i.map((e=>({id:e,title:z("remoteAccessShield.log.filter."+e),dataTest:"ras_tab-"+e,disabled:!r[e],badge:{number:r[e]}}))))},[g,d,p,b,f,v,l,o,u,A,function(e){m.init(e)},function(e){n(4,f=e.detail.current>110),$=e.detail.scrollTo,!f&&v&&A(),e.detail.current>=e.detail.max&&e.detail.max>h&&(h=e.detail.current,w({concat:!0}))},function(e){n(0,g=e)},r,()=>A()]}class he extends e{constructor(e){super(),t(this,e,fe,ge,n,{},re)}}function $e(){}const ve=[];function Se(e,t=$e){let n;const l=new Set;function o(t){if(s=t,((o=e)!=o?s==s:o!==s||o&&"object"==typeof o||"function"==typeof o)&&(e=t,n)){const t=!ve.length;for(const n of l)n[1](),ve.push(n,e);if(t){for(let e=0;e<ve.length;e+=2)ve[e][0](ve[e+1]);ve.length=0}}var o,s}function s(t){o(t(e))}return{set:o,update:s,subscribe:function(c,a=$e){const i=[c,a];return l.add(i),1===l.size&&(n=t(o,s)||$e),c(e),()=>{l.delete(i),0===l.size&&n&&(n(),n=null)}}}}const Ae=Se(!1),we={subscribe:Se(P.isEnabled(te),(e=>(e(P.isEnabled(te)),y.on(`product.change.feature.${te}.enabled`,(function(t){e(t),ke(!1)}))))).subscribe};function ke(e){Ae.set(e)}function _e(e){let t,n,l;return{c(){t=c("kin-switch"),r(t,"checked",e[1]),r(t,"processing",e[2]),r(t,"aria-label",z("remoteAccessShield")),r(t,"size",e[0])},m(o,s){d(o,t,s),n||(l=u(t,"click",e[3]),n=!0)},p(e,[n]){2&n&&r(t,"checked",e[1]),4&n&&r(t,"processing",e[2]),1&n&&r(t,"size",e[0])},i:_,o:_,d(e){e&&v(t),n=!1,l()}}}function xe(e,t,n){let l,o;k(e,we,(e=>n(1,l=e))),k(e,Ae,(e=>n(2,o=e)));let{size:s=""}=t;return e.$$set=e=>{"size"in e&&n(0,s=e.size)},[s,l,o,function(){ke(!0),O.toggle(te,{stopOptions:ie,track:({enabled:e,time:t})=>C.feature.toggle({enabled:e,time:t,feature:te})}).finally((()=>ke(!1)))}]}class Ee extends e{constructor(e){super(),t(this,e,xe,_e,n,{size:0})}}function Ie(e){let t,n,l;return n=new H({props:{section:Me.breadcrumbs.section,moduleId:Me.breadcrumbs.moduleId,subsections:Me.breadcrumbs.subsections,moduleTranslationId:Me.breadcrumbs.moduleTranslationId}}),{c(){t=c("div"),a(n.$$.fragment),i(t,"slot","page-breadcrumbs")},m(e,o){d(e,t,o),m(n,t,null),l=!0},p:_,i(e){l||(b(n.$$.fragment,e),l=!0)},o(e){h(n.$$.fragment,e),l=!1},d(e){e&&v(t),S(n)}}}function je(e){let t,n,l;return n=new Ee({}),{c(){t=c("div"),a(n.$$.fragment),i(t,"slot","page-controls")},m(e,o){d(e,t,o),m(n,t,null),l=!0},p:_,i(e){l||(b(n.$$.fragment,e),l=!0)},o(e){h(n.$$.fragment,e),l=!1},d(e){e&&v(t),S(n)}}}function Re(e){let t,n,l;return n=new V({props:{title:z("upsell.title.remoteAccessShield"),desc:z("upsell.desc.remoteAccessShield"),icon:"l087",iconSpaghetti:"i-l-081",buyParams:{p_scr:"remoteaccessshield"}}}),{c(){t=c("div"),a(n.$$.fragment),i(t,"slot","page-upsell")},m(e,o){d(e,t,o),m(n,t,null),l=!0},p:_,i(e){l||(b(n.$$.fragment,e),l=!0)},o(e){h(n.$$.fragment,e),l=!1},d(e){e&&v(t),S(n)}}}function ye(e){let t,n,l;return n=new G({props:{desc:z("remoteAccessShield.desc"),featureId:te,learnMore:Me.learnMore}}),{c(){t=c("div"),a(n.$$.fragment),i(t,"slot","page-installer")},m(e,o){d(e,t,o),m(n,t,null),l=!0},p:_,i(e){l||(b(n.$$.fragment,e),l=!0)},o(e){h(n.$$.fragment,e),l=!1},d(e){e&&v(t),S(n)}}}function Le(e){let t,n,l;return n=new he({}),{c(){t=c("div"),a(n.$$.fragment),i(t,"slot","page-content")},m(e,o){d(e,t,o),m(n,t,null),l=!0},p:_,i(e){l||(b(n.$$.fragment,e),l=!0)},o(e){h(n.$$.fragment,e),l=!1},d(e){e&&v(t),S(n)}}}function Ce(e){let t,n;return t=new F({props:{title:z("remoteAccessShield"),desc:z("remoteAccessShield.desc"),cssCls:"ras",settingsHash:e[1]?"#settings/ras":"",upsell:!e[1],installer:!e[2],disabled:!e[0],disabledMsg:z("remoteAccessShield.tooltip.inactive"),disabledAreas:["!desc"],backHash:Me.breadcrumbs.section,learnMore:Me.learnMore,$$slots:{"page-content":[Le],"page-installer":[ye],"page-upsell":[Re],"page-controls":[je],"page-breadcrumbs":[Ie]},$$scope:{ctx:e}}}),{c(){a(t.$$.fragment)},m(e,l){m(t,e,l),n=!0},p(e,[n]){const l={};1&n&&(l.disabled=!e[0]),32&n&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){n||(b(t.$$.fragment,e),n=!0)},o(e){h(t.$$.fragment,e),n=!1},d(e){S(t,e)}}}const Me={learnMore:null,breadcrumbs:{section:"security",moduleId:"ras",moduleTranslationId:"remoteAccessShield",subsections:null}};function Pe(e,t,n){const l=P.isLicensed(te),o=P.isInstalled(te);let s,c=P.isEnabled(te);function a(e){null!=e.enabled&&n(0,c=e.enabled)}return j((()=>{s=y.on("product.change.feature."+te,a)})),R((()=>{s&&s()})),[c,l,o]}class Te extends e{constructor(e){super(),t(this,e,Pe,Ce,n,{})}}function ze(e){l(e,"svelte-dl093v",".ras_ip_input input.kin_input::placeholder{font-size:1.4rem}")}function De(e,t,n){const l=e.slice();return l[27]=t[n].ip,l[28]=t[n].error,l[30]=n,l}function Be(e){let t,n,l,o,a;return{c(){t=c("h3"),t.textContent=`${z("remoteAccessShield.settings.allowedIpList")}`,n=s(),l=c("kin-button"),l.textContent=`${z("global.add")}`,i(t,"class","h3 g-margin-top--5x"),r(l,"type","secondary"),r(l,"size","small"),r(l,"lefticon","icon-s-add"),r(l,"class","g-margin-top--2x g-margin-bottom--2x"),r(l,"data-test","ras_add-ip")},m(s,c){d(s,t,c),d(s,n,c),d(s,l,c),o||(a=u(l,"click",e[17]),o=!0)},p:_,d(e){e&&(v(t),v(n),v(l)),o=!1,a()}}}function Ne(e){let t,n,l,a,r,m=o(e[1]),u=[];for(let o=0;o<m.length;o+=1)u[o]=He(De(e,m,o));const g=e=>h(u[e],1,1,(()=>{u[e]=null}));return{c(){t=c("table"),n=c("tr"),l=c("th"),l.textContent=`${z("global.ipAddress")}`,a=s();for(let e=0;e<u.length;e+=1)u[e].c();i(l,"colspan","2"),i(t,"class","table -small"),i(t,"data-test","ras_table")},m(e,o){d(e,t,o),p(t,n),p(n,l),p(t,a);for(let n=0;n<u.length;n+=1)u[n]&&u[n].m(t,null);r=!0},p(e,n){if(36870&n[0]){let l;for(m=o(e[1]),l=0;l<m.length;l+=1){const o=De(e,m,l);u[l]?(u[l].p(o,n),b(u[l],1)):(u[l]=He(o),u[l].c(),b(u[l],1),u[l].m(t,null))}for(f(),l=m.length;l<u.length;l+=1)g(l);$()}},i(e){if(!r){for(let e=0;e<m.length;e+=1)b(u[e]);r=!0}},o(e){u=u.filter(Boolean);for(let t=0;t<u.length;t+=1)h(u[t]);r=!1},d(e){e&&v(t),A(u,e)}}}function Oe(e){let t,n,l,o;return t=new Z({props:{name:"icon-m-action-pen",tooltip:z("global.edit"),ariaLabel:z("global.edit")+" "+e[27],cssCls:"g-margin-right--1x",dataTest:"ras_edit-ip"}}),t.$on("click",(function(){return e[19](e[30])})),l=new Z({props:{name:"icon-m-close",tooltip:z("global.remove"),ariaLabel:z("global.remove")+" "+e[27],cssCls:"g-margin-right--1x",dataTest:"ras_remove-ip"}}),l.$on("click",(function(){return e[20](e[30])})),{c(){a(t.$$.fragment),n=s(),a(l.$$.fragment)},m(e,s){m(t,e,s),d(e,n,s),m(l,e,s),o=!0},p(n,o){e=n;const s={};2&o[0]&&(s.ariaLabel=z("global.edit")+" "+e[27]),t.$set(s);const c={};2&o[0]&&(c.ariaLabel=z("global.remove")+" "+e[27]),l.$set(c)},i(e){o||(b(t.$$.fragment,e),b(l.$$.fragment,e),o=!0)},o(e){h(t.$$.fragment,e),h(l.$$.fragment,e),o=!1},d(e){e&&v(n),S(t,e),S(l,e)}}}function Fe(e){let t,n,l,o,a=e[28]+"";return{c(){t=c("tr"),n=c("td"),l=x(a),o=s(),i(n,"colspan","2")},m(e,s){d(e,t,s),p(t,n),p(n,l),p(t,o)},p(e,t){2&t[0]&&a!==(a=e[28]+"")&&E(l,a)},d(e){e&&v(t)}}}function He(e){let t,n,l,o,a,r,m,g,S,A,w=e[27]+"";function k(){return e[18](e[30])}let _=!e[2]&&Oe(e),j=e[28]&&Fe(e);return{c(){t=c("tr"),n=c("td"),l=x(w),o=s(),a=c("td"),_&&_.c(),r=s(),j&&j.c(),m=I(),i(n,"data-test","ras_ip-number"),i(a,"class","table__delete"),i(t,"class","-hoverable"),i(t,"data-test","ras_row")},m(e,s){d(e,t,s),p(t,n),p(n,l),p(t,o),p(t,a),_&&_.m(a,null),d(e,r,s),j&&j.m(e,s),d(e,m,s),g=!0,S||(A=u(n,"click",k),S=!0)},p(t,n){e=t,(!g||2&n[0])&&w!==(w=e[27]+"")&&E(l,w),e[2]?_&&(f(),h(_,1,1,(()=>{_=null})),$()):_?(_.p(e,n),4&n[0]&&b(_,1)):(_=Oe(e),_.c(),b(_,1),_.m(a,null)),e[28]?j?j.p(e,n):(j=Fe(e),j.c(),j.m(m.parentNode,m)):j&&(j.d(1),j=null)},i(e){g||(b(_),g=!0)},o(e){h(_),g=!1},d(e){e&&(v(t),v(r),v(m)),_&&_.d(),j&&j.d(e),S=!1,A()}}}function Ve(e){let t,n,l,o,c,i,r,p,u,g,A,w,k,_,x,E,j;t=new W({props:{prop:e[8]}}),l=new W({props:{prop:e[9]}}),c=new W({props:{prop:e[4]}}),r=new W({props:{prop:e[5]}}),u=new W({props:{prop:e[6]}}),A=new W({props:{prop:e[7]}}),k=new W({props:{prop:e[0]}});let R=!e[2]&&Be(e),y=e[1]&&e[1].length&&Ne(e);return{c(){a(t.$$.fragment),n=s(),a(l.$$.fragment),o=s(),a(c.$$.fragment),i=s(),a(r.$$.fragment),p=s(),a(u.$$.fragment),g=s(),a(A.$$.fragment),w=s(),a(k.$$.fragment),_=s(),R&&R.c(),x=s(),y&&y.c(),E=I()},m(e,s){m(t,e,s),d(e,n,s),m(l,e,s),d(e,o,s),m(c,e,s),d(e,i,s),m(r,e,s),d(e,p,s),m(u,e,s),d(e,g,s),m(A,e,s),d(e,w,s),m(k,e,s),d(e,_,s),R&&R.m(e,s),d(e,x,s),y&&y.m(e,s),d(e,E,s),j=!0},p(e,t){const n={};1&t[0]&&(n.prop=e[0]),k.$set(n),e[2]?R&&(R.d(1),R=null):R?R.p(e,t):(R=Be(e),R.c(),R.m(x.parentNode,x)),e[1]&&e[1].length?y?(y.p(e,t),2&t[0]&&b(y,1)):(y=Ne(e),y.c(),b(y,1),y.m(E.parentNode,E)):y&&(f(),h(y,1,1,(()=>{y=null})),$())},i(e){j||(b(t.$$.fragment,e),b(l.$$.fragment,e),b(c.$$.fragment,e),b(r.$$.fragment,e),b(u.$$.fragment,e),b(A.$$.fragment,e),b(k.$$.fragment,e),b(y),j=!0)},o(e){h(t.$$.fragment,e),h(l.$$.fragment,e),h(c.$$.fragment,e),h(r.$$.fragment,e),h(u.$$.fragment,e),h(A.$$.fragment,e),h(k.$$.fragment,e),h(y),j=!1},d(e){e&&(v(n),v(o),v(i),v(p),v(g),v(w),v(_),v(x),v(E)),S(t,e),S(l,e),S(c,e),S(r,e),S(u,e),S(A,e),S(k,e),R&&R.d(e),y&&y.d(e)}}}function Ge(e){let t,n;return t=new q({props:{title:z("remoteAccessShield.settings.editAllowedIp.title"),subtitle:z("remoteAccessShield.settings.editAllowedIp.desc"),$$slots:{"modal-footer":[We],"modal-content":[Ue]},$$scope:{ctx:e}}}),t.$on("close",e[21]),{c(){a(t.$$.fragment)},m(e,l){m(t,e,l),n=!0},p(e,n){const l={};8&n[0]|1&n[1]&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){n||(b(t.$$.fragment,e),n=!0)},o(e){h(t.$$.fragment,e),n=!1},d(e){S(t,e)}}}function Ue(e){let t,n,l,o,s,a,m;return{c(){t=c("div"),n=c("form"),l=c("kin-input"),r(l,"value",o=e[3].ip),r(l,"size","large"),r(l,"data-test","ras_input-ip"),r(l,"formrow","true"),r(l,"placeholder",z("remoteAccessShield.settings.ipExample")),r(l,"error",s=e[3].error),r(l,"class","ras_ip_input"),i(t,"slot","modal-content")},m(o,s){d(o,t,s),p(t,n),p(n,l),a||(m=[u(l,"input",e[16]),g(Je.call(null,l)),u(n,"submit",Ke)],a=!0)},p(e,t){8&t[0]&&o!==(o=e[3].ip)&&r(l,"value",o),8&t[0]&&s!==(s=e[3].error)&&r(l,"error",s)},d(e){e&&v(t),a=!1,w(m)}}}function We(e){let t,n,l,o,a,m,g,b,f=z("global.allow")+"";return{c(){t=c("div"),n=c("kin-button"),l=x(f),a=s(),m=c("kin-button"),m.textContent=`${z("global.cancel")}`,r(n,"kin-disabled",o=e[3].error||!e[3].ip),r(n,"data-test","ras_save-ip"),r(m,"type","secondary"),r(m,"data-test","ras_cancel-ip"),i(t,"slot","modal-footer")},m(o,s){d(o,t,s),p(t,n),p(n,l),p(t,a),p(t,m),g||(b=[u(n,"click",e[13]),u(m,"click",e[14])],g=!0)},p(e,t){8&t[0]&&o!==(o=e[3].error||!e[3].ip)&&r(n,"kin-disabled",o)},d(e){e&&v(t),g=!1,w(b)}}}function qe(e){let t,n,l,o;t=new U({props:{component:te,title:z(ne),desc:z(le),stopOptions:e[10],$$slots:{default:[Ve]},$$scope:{ctx:e}}});let c=e[3]&&Ge(e);return{c(){a(t.$$.fragment),n=s(),c&&c.c(),l=I()},m(e,s){m(t,e,s),d(e,n,s),c&&c.m(e,s),d(e,l,s),o=!0},p(e,n){const o={};7&n[0]|1&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o),e[3]?c?(c.p(e,n),8&n[0]&&b(c,1)):(c=Ge(e),c.c(),b(c,1),c.m(l.parentNode,l)):c&&(f(),h(c,1,1,(()=>{c=null})),$())},i(e){o||(b(t.$$.fragment,e),b(c),o=!0)},o(e){h(t.$$.fragment,e),h(c),o=!1},d(e){e&&(v(n),v(l)),S(t,e),c&&c.d(e)}}}const Ze={title:ne,desc:le,items:Q.props2searchItems([ae.notificationEnabled,ae.bruteForceEnabled,ae.blacklistEnabled,ae.exploitEnabled,ae.allowedIpEnabled,ae.enableRdpProtection,ae.enableSambaProtection])};function Je(e){e.focus()}const Ke=e=>e.preventDefault();function Qe(e,t,n){const{notificationEnabled:l,bruteForceEnabled:o,blacklistEnabled:s,exploitEnabled:c,allowedIpEnabled:a,enableRdpProtection:i,enableSambaProtection:r}=ae,d={title:z("remoteAccessShield.stopOptions.title"),desc:z("remoteAccessShield.stopOptions.desc")},p=X(v,1e3);let m=[],u=!1,g=null;function b(e){if(n(3,g={ip:""}),e)return new Promise(((e,t)=>{n(3,g.resolve=e,g),n(3,g.reject=t,g)}))}function f(e){n(3,g=Object.assign({index:e},m[e]))}function h(){g.reject&&g.reject(),p.cancel(),n(3,g=null)}function $(e){m.splice(e,1),n(1,m),S()}function v(){const e=Y(g.ip,{range:!0}),t=!m.some((e=>e.ip===g.ip));return n(3,g.error=e?t?void 0:z("remoteAccessShield.settings.existingIp"):z("remoteAccessShield.settings.invalidIp"),g),e&&t}function S(){const e=m.map((e=>e.ip)).join(";");T.set("avcfg://RemoteAccessShield/RdpAccess/AllowedIpList",e),m.length||y.emit("settings.change.ras.allowedIpList.empty")}a.change=function(e){return 1!=e||m.length?T.set(a.path,e):b(!0).then((()=>T.set(a.path,e)))},j((()=>{T.get("avcfg://RemoteAccessShield/RdpAccess/AllowedIpList").then((e=>{n(2,u=e.locked),e.value&&n(1,m=e.value.split(";").map((e=>({ip:e,error:null}))))}))}));return[a,m,u,g,l,o,s,c,i,r,d,b,f,function(e){e.preventDefault(),v()&&(null==g.index?(m.push({ip:g.ip}),n(1,m)):n(1,m[g.index].ip=g.ip,m),S(),g.resolve&&g.resolve(),n(3,g=null),p.cancel())},h,$,function(e){n(3,g.ip=e.target.value.replace(/\u2013|\u2014/g,"-"),g),p()},()=>b(),e=>f(e),e=>f(e),e=>$(e),()=>h()]}class Xe extends e{constructor(e){super(),t(this,e,Qe,qe,n,{},ze,[-1,-1])}}function Ye(e){let t,n;return t=new J({props:{config:e[0]}}),{c(){a(t.$$.fragment)},m(e,l){m(t,e,l),n=!0},p(e,n){const l={};1&n&&(l.config=e[0]),t.$set(l)},i(e){n||(b(t.$$.fragment,e),n=!0)},o(e){h(t.$$.fragment,e),n=!1},d(e){S(t,e)}}}function et(e){let t,n,l=e[0]&&Ye(e);return{c(){l&&l.c(),t=I()},m(e,o){l&&l.m(e,o),d(e,t,o),n=!0},p(e,[n]){e[0]?l?(l.p(e,n),1&n&&b(l,1)):(l=Ye(e),l.c(),b(l,1),l.m(t.parentNode,t)):l&&(f(),h(l,1,1,(()=>{l=null})),$())},i(e){n||(b(l),n=!0)},o(e){h(l),n=!1},d(e){e&&v(t),l&&l.d(e)}}}function tt(e,t,n){let l=null,o="RDP",s="";return j((()=>{(function(){const e=M.getUrlParams().id;return L("app.av.detections.GetStatus",{id:e}).then((e=>{const t=/^(\w+):\/\/([\d.]{7,})?/,n=/(?![^\w:])(([0-9a-f]{1,4}:){1,7}:|:(:[0-9a-f]{1,4}){1,7}|([0-9a-f]{1,4}:){1,7}[0-9a-f]{0,4}(:[0-9a-f]{1,4}){1,7})(?![\w:])/;let l=e.url?.match(t);o=l&&(l[1]||"").toUpperCase(),s=l&&l[2],s||(l=e.url?.match(n),l&&(s=l[0]));const c=[{title:z("global.threatName"),value:ee.escapeHtml(e.threat),testValue:"threat"}];return s?c.push({title:z("global.attackerIP"),value:s,testValue:"ip"}):c.push({title:z("global.attackerURL"),value:ee.escapeHtml(e.url),testValue:"url"}),c.push.apply(c,[{title:z("global.process"),value:ee.escapeHtml(e.process),testValue:"process"},{title:z("global.detectedBy"),value:z("remoteAccessShield"),testValue:"detectedBy_ras"},{title:z("global.status"),value:z("remoteAccessShield.detection.connectionBlocked"),testValue:"status"}]),c}))})().then((e=>{n(0,l={color:"green",icon:{name:"icon-m-remote-desktop-control",color:"ok"},title:z("remoteAccessShield.detection.title"),text:z("SMB"===o?"remoteAccessShield.detection.desc.sharing":"remoteAccessShield.detection.desc"),actions:[{label:z("global.gotIt"),action:M.close,labelTracking:"gotIt",labelTest:"btn_gotIt"}],dontShowAgain:{label:z("remoteAccessShield.detection.dontShowAgain"),action:e=>{T.set("avcfg://RemoteAccessShield/Detection/NotificationEnabled",e?"0":"1")}},details:e})})).then((()=>M.init()))})),[l,!0]}class nt extends e{constructor(e){super(),t(this,e,tt,et,n,{handlesWindowInit:1})}get handlesWindowInit(){return this.$$.ctx[1]}}var lt;lt={learnMore:{badge:"remoteAccessShield",title:"remoteAccessShield.learnMore",desc:"remoteAccessShield.learnMore.desc",overview:"remoteAccessShield.learnMore.overview",illustration:"m260",benefits:[{desc:"remoteAccessShield.learnMore.benefits.1.desc"},{desc:"remoteAccessShield.learnMore.benefits.2.desc"},{desc:"remoteAccessShield.learnMore.benefits.3.desc"}]}},Object.assign(Me,lt);export{Te as default,nt as detection,Xe as settings,Ze as settingsSearchStrings};const ot={name:"ras",version:"1.3.1358",created:"2024-11-19T11:02:56.930Z"};export{ot as metadata};
