(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[94172],{46405:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(296540),a=n(951272);const s=(e,t)=>{const{errors:n,dirty:s}=(0,a.j7)();let o=t;t||(o=n);const i=(0,r.useRef)(!1),_=(0,r.useCallback)(e=>{i.current=!0},[]),c=(0,r.useMemo)(()=>{const e=[];return function t(n,r){const a=r?`${r}.`:"";Object.entries(n).forEach(([n,r])=>{var s;(s=r,s?.$$typeof||"object"!=typeof s)?r&&e.push(`${a}${n}`):t(r,`${a}${n}`)})}(o,""),e},[o]);(0,r.useEffect)(()=>{i.current&&(i.current=!1,async function(){const t=e.current.closest("form");let n;for(const e of c){const r=e.split(".").pop(),a=t.querySelectorAll(`label[for="${e}"],[name="${e}"],label[for="${r}"],[name="${r}"]`)?.[0];if(a?.scrollIntoView){n=a;break}}n&&(await async function e(t,n){return new Promise(async r=>{if(n>5)r(!0);else{if(t&&!t.offsetParent){const a=t.closest("li");if(!a)return;await e(a.parentElement,n+1);const[s,o]=[...a.children];return o.addEventListener("transitionend",function e(){o.removeEventListener("transitionend",e),r(!0)}),void s.click()}r(!0)}})}(n,0),n.scrollIntoView({block:"center"}))}())},[e,i.current,c]),(0,r.useEffect)(()=>{const t=function(e){try{return e.current?[...e.current.closest("form").querySelectorAll('button[type="submit"]')].pop():null}catch(e){}return null}(e);return t?.addEventListener("click",_),()=>{t?.removeEventListener("click",_)}},[e,c,s])}},210484:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(71479),a=n(566723);const s=(0,r.A)("div")`
  div {
    flex-wrap: wrap;
  }

  svg {
    max-width: 20px;
    flex: 1;
  }
  span {
    flex: 1;
  }

  span + div:last-child {
    flex-basis: 100%;
    margin-left: ${a.ED};
  }
`},267691:(e,t,n)=>{"use strict";n.d(t,{u:()=>i});var r=n(469733),a=n(296540),s=n(528644),o=n(674319);function i(e){const t=(0,r.useSelector)(s.C);return(0,a.useMemo)(()=>(0,o.TM)(e,t),[e,t])}},284388:(e,t,n)=>{"use strict";n.d(t,{A:()=>_});var r=n(296540),a=n(450514),s=n(463107),o=n(74750),i=n(699784);const _=({onCancel:e,onConfirm:t,cssProperties:n})=>r.createElement(s.aF.Root,{isOpen:!0},r.createElement(a.A,{actionButtons:r.createElement(r.Fragment,null,r.createElement(o.A,{type:"button",variant:"neutral",onPress:e},r.createElement(i.sA,{id:"COMMON_UNSAVED_CHANGES_STAY"})),r.createElement(o.A,{type:"button",variant:"destructive",onPress:t},r.createElement(i.sA,{id:"COMMON_UNSAVED_CHANGES_LEAVE"}))),title:(0,i.tz)().formatMessage({id:"COMMON_UNSAVED_CHANGES_TITLE"}),width:"small",isDismissable:!1,onClose:e,style:n},r.createElement(i.sA,{id:"COMMON_UNSAVED_CHANGES_CONTENT"})))},294172:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>ce});var r=n(469733),a=n(296540),s=n(951272),o=n(606081),i=n(675291),_=n(169568),c=n(398300),l=n(566723),E=n(711157),d=n(104436),T=n(720903),u=n(883840),O=n(768941),S=n(936621),m=n(356927),p=n(112707),N=n(768195),v=n(204751),A=n(949330),C=n(153643);const f={name:"",newMacAddress:"",op_mode:O.RC.SWITCH,poe_mode:O.Gu.AUTO,poeMode:!0,port_security_enabled:!1,port_security_mac_address:[],portSecurity:E.r.ACTIVE,native_networkconf_id:S.F,tagged_vlan_mgmt:N.sg.AUTO,taggedVlans:[],multicastRouterEnabled:!1,multicast_router_networkconf_ids:[],portSpeed:O.n5.PORTSPEED_AUTO_NEG,speed:m.A.PORTSPEED_AUTO_NEG.speed,full_duplex:m.A.PORTSPEED_AUTO_NEG.full_duplex,setting_preference:u.C.AUTO,dot1x_idle_timeout:p.S.DEFAULT,voiceNetworkConfEnabled:!1,voice_networkconf_id:"",stormControlEnabled:!1,stormctrl_bcast_enabled:!1,stormctrl_bcast_rate:C.A.DEFAULT,stormctrl_mcast_enabled:!1,stormctrl_mcast_rate:C.A.DEFAULT,stormctrl_ucast_enabled:!1,stormctrl_ucast_rate:C.A.DEFAULT,stp_port_mode:!0,lldpmed_enabled:!0,fec_mode:N._t.DISABLED,qosEnabled:!1,qos_profile:(0,T.A)(A.a$),avManufacturer:v.CC.UNIFI};var I=n(48925),R=n(294303),h=n(845030),L=n(699784),G=n(210484),b=n(31065),P=n(106287),D=n(854726),M=n(920377),U=n(366188),F=n(602021),y=n(645732);const w=e=>(["name","taggedVlans","tagged_vlan_mgmt","native_networkconf_id","newMacAddress","portSecurity","port_security_enabled","port_security_mac_address","poeMode","poe_mode","setting_preference"].forEach(t=>{e.advancedConfigSwap&&delete e.advancedConfigSwap[t]}),e);var W=n(412952),g=n(46405),k=n(329109),K=n(605452),x=n(699736),H=n(174897),Y=n(883554),B=n(649705),j=n(232832),V=n(173068),$=n(125234),X=n(679783),z=n(143811);const Q=({disabled:e})=>a.createElement(R.A,{flexDirection:"column"},a.createElement(X.A,{label:a.createElement(L.sA,{id:"COMMON_DEVICE_POE_MODE_POE"})}),a.createElement(z.A,{name:"poeMode",id:"poeMode",type:"realCheckbox",disabled:e},a.createElement(L.sA,{id:"COMMON_VALUE_AUTO"})));var q=n(961863),Z=n(898257),J=n(609519),ee=n(872352),te=n(461983),ne=n(114470),re=n(185414),ae=n(439247),se=n(242366),oe=n(391855),ie=n(689965);const _e=({isReadOnly:e})=>{const t=(0,a.useRef)(null),{errors:n,values:r,handleSubmit:o,resetForm:i,isSubmitting:_,dirty:c}=(0,s.j7)();(0,g.A)(t,n);const d=r.portSecurity===E.r.DISABLED||e,T=r.setting_preference===u.C.AUTO;return a.createElement(a.Fragment,null,a.createElement(ie.A,null,a.createElement(se.A,{gap:l.kc},a.createElement(Z.A,{disabled:e}),a.createElement($.A,{disabled:e,isPortMacFilteringSupported:!0,showQos:!0}),a.createElement(q.A,{disabled:d}),a.createElement(x.A,{disabled:d,isVlanTaggingSupported:!0}),a.createElement(Q,{disabled:d}),a.createElement(J.A,{disabled:d}),a.createElement(B.A,{disabled:d}),a.createElement(V.A,{disabled:T||d,showFec:!0}),a.createElement(ae.A,{disabled:T||d}),a.createElement(ne.A,{disabled:T||d}),a.createElement(Y.A,{disabled:T||d,showQos:!0,showPercentage:!1}),a.createElement(H.A,{disabled:T||d,showBpduGuard:!1,showAutoEdge:!1}),a.createElement(te.A,{disabled:T||d}),a.createElement(re.A,{disabled:T||d}),a.createElement(ee.A,{disabled:T||d}),a.createElement(K.A,{disabled:T||d}),a.createElement(j.A,{disabled:T||d}))),a.createElement(k.A,{isDirty:c,onFormCancel:i,applyButton:a.createElement(oe.A,{label:"COMMON_ACTION_APPLY_CHANGES",showLoader:_,onSubmit:()=>{o()}})}),e||!c||_?null:a.createElement(W.A,null))},ce=({activeItem:e,onDismiss:t})=>{const n=(0,r.useDispatch)(),T=(0,r.useSelector)(D.wD).find(({_id:t})=>t===e._id),u=(0,r.useSelector)(D.KL),m=(0,r.useSelector)(U.nT),p=(0,r.useSelector)(U.Tn),N=(0,r.useSelector)(F.EL),v=!!T?.attr_no_edit,A=(0,o.S)(_.v.SETTINGS_ETHERNET_PORTS),C=((e,t,n)=>{if(!n?._id){const{stable_port_enabled:t,stp_edge_state:n,stp_bpdu_guard_enabled:r,stormctrl_type:a,stormctrl_bcast_level:s,stormctrl_mcast_level:o,stormctrl_ucast_level:i,..._}=e,c={..._};return c.advancedConfigSwap={..._},w(c),c}const r=(0,y.s)(n,t,!1),a=n.poe_mode===O.Gu.AUTO,{stable_port_enabled:s,stp_edge_state:o,stp_bpdu_guard_enabled:i,stormctrl_type:_,stormctrl_bcast_level:c,stormctrl_mcast_level:l,stormctrl_ucast_level:E,...d}=n,{stable_port_enabled:T,stp_edge_state:u,stp_bpdu_guard_enabled:S,stormctrl_type:m,stormctrl_bcast_level:p,stormctrl_mcast_level:N,stormctrl_ucast_level:v,...A}=e,C={...A,...d,...r,poeMode:a};return C.advancedConfigSwap=A,w(C),C})((0,a.useMemo)(()=>({...f,...u,native_networkconf_id:m?._id||S.F,multicast_router_networkconf_ids:[]}),[u,m?._id]),p,T),W=(0,a.useCallback)(async(t,{resetForm:r})=>{const{advancedConfigSwap:a,egress_rate_limit_kbps:s,forward:o,poeMode:i,portSpeed:_,taggedVlans:l,multicastRouterEnabled:d,voiceNetworkConfEnabled:T,stormControlEnabled:u,portSecurity:S,stormctrl_bcast_rate:m,stormctrl_mcast_rate:N,stormctrl_ucast_rate:v,qosEnabled:A,newMacAddress:C,avManufacturer:f,...I}=t,R=(0,P._$)(l,t.tagged_vlan_mgmt,t.native_networkconf_id,p),L=t.portSecurity===E.r.DISABLED||t.portSecurity===E.r.RESTRICTED,G={...I,multicast_router_networkconf_ids:d?I.multicast_router_networkconf_ids:[],port_security_enabled:L,poe_mode:i?O.Gu.AUTO:O.Gu.OFF,...t.egress_rate_limit_kbps_enabled?{egress_rate_limit_kbps:1e3*(s||0)}:void 0,...t.stormctrl_bcast_enabled?{stormctrl_bcast_rate:m}:void 0,...t.stormctrl_mcast_enabled?{stormctrl_mcast_rate:N}:void 0,...t.stormctrl_ucast_enabled?{stormctrl_ucast_rate:v}:void 0,excluded_networkconf_ids:R,fec_mode:(0,b.K4)(t)};n((0,M.dw)(G)).then(t=>{n((0,h.XP)({type:c.H.ETHERNET_PORT_PROFILE,id:t._id||e._id}))}),r({values:t})},[p,n]),g=N||v||A;return a.createElement(s.l1,{initialValues:C,onSubmit:W,header:T?.name?T.name:a.createElement(L.sA,{id:"SETTINGS_CREATE_NEW_ETHERNET_PROFILE"}),onDismiss:t,validationSchema:d.Ay},a.createElement(R.A,{gap:l.Ln,flexDirection:"column"},a.createElement(i.A,{feature:_.v.SETTINGS_ETHERNET_PORTS,renderWarning:({children:e})=>a.createElement(G.A,null,a.createElement(I.A,null,e))}),a.createElement(_e,{isReadOnly:g,initialValues:C})))}},412952:(e,t,n)=>{"use strict";n.d(t,{A:()=>_});var r=n(846885),a=n.n(r),s=n(296540);const o=e=>(t,n)=>{if(null==e||!t||!n)return!0;return![].concat(e).some(e=>"string"==typeof e?n.pathname===e&&t.pathname===e:e instanceof RegExp&&(e.test(n.pathname)||e.test(t.pathname)))};var i=n(284388);const _=({ignoredPaths:e,onLeave:t,beforeOnLeave:n,zIndex:r})=>{const _=o(e),c=(0,s.useMemo)(()=>(e,t)=>_(e,t)&&((e,t)=>t?.pathname!==e.pathname)(e,t),[_]),l=(0,s.useCallback)(e=>{n?.(),e()},[n]);return s.createElement(a(),{when:c,afterConfirm:t,beforeConfirm:l},({onCancel:e,onConfirm:t})=>s.createElement(i.A,{onCancel:e,onConfirm:t,cssProperties:{zIndex:r}}))}},450514:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(296540),a=n(136080),s=n(956924),o=n(583389),i=n(448898),_=n(2259),c=n(11647),l=n(881288),E=n(238502);const d=r.forwardRef((e,t)=>{const{width:n="medium",UNSTABLE_portalContainer:d,isClosable:T=!0,isDismissable:u,isEntering:O,isExiting:S,isKeyboardDismissDisabled:m,isCentered:p=!1,isOpen:N,title:v,onOpenChange:A,symbol:C,avatar:f,children:I,actionButtons:R,onClose:h,motif:L,...G}=e;return r.createElement(i.A,{isDismissable:u,isEntering:O,isExiting:S,isKeyboardDismissDisabled:m,UNSTABLE_portalContainer:d,isOpen:N,onOpenChange:A,motif:L},r.createElement(_.A,{motif:L,isOpen:N,onOpenChange:A},e=>r.createElement(s.A,{ref:t,width:n,motif:L,...G},T&&r.createElement(E.A,{onClose:h}),r.createElement(o.A,{motif:L,symbol:C,avatar:f},v),r.createElement(a.A,{motif:L,isCentered:p,topDivider:!0,bottomDivider:!0},"function"==typeof I?I(e):I),r.createElement(c.A,{motif:L},R&&r.createElement(l.A,{motif:L},"function"==typeof R?R(e):R)))))});d.displayName="Modal_Default"},528644:(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var r=n(801081),a=n(198494),s=n(792072),o=n(532419);const i=(0,r.Mz)(o.$8,o.m9,o.N4,o.at,o.Tp,s.et,a.UP,o.IP,o.C$,(e,t,n,r,a,s,o,i,_)=>({devicesHaveLastFetchTime:e,hasSiteGateway:t,hasApAdopted:n,hasSwitchAdopted:r,hasL3SwitchAdopted:a,features:s,selfPreconfigureApprovals:o,siteGatewayInterfaces:i,isUsg:_}))},606081:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(469733),a=n(296540),s=n(528644),o=n(674319);function i(e){const t=(0,r.useSelector)(s.C);return(0,a.useMemo)(()=>!(0,o.TM)(e,t)&&!(0,o.A)(e,t),[e,t])}},674319:(e,t,n)=>{"use strict";n.d(t,{A:()=>i,TM:()=>l,f9:()=>c});var r=n(598796),a=n(780811),s=n(169568);const o={[s.v.SETTINGS_WIFI]:e=>!e.devicesHaveLastFetchTime||e.hasApAdopted,[s.v.SETTINGS_WIFI_SPEED_LIMIT_PROFILES]:e=>!e.devicesHaveLastFetchTime||e.hasApAdopted,[s.v.SETTINGS_NETWORKS]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasSwitchAdopted||e.hasApAdopted,[s.v.SETTINGS_INTERNET]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway,[s.v.SETTINGS_TELEPORT]:e=>e.features.has(r.Xj.TELEPORT),[s.v.SETTINGS_UID_VPN]:()=>!1,[s.v.SETTING_ROUTING]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasL3SwitchAdopted,[s.v.SETTINGS_SECURITY]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasL3SwitchAdopted,[s.v.SETTINGS_RADIUS]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway,[s.v.NETWORK_OBJECTS]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway,[s.v.SETTINGS_ETHERNET_PORTS]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasSwitchAdopted,[s.v.SETTINGS_PROFILES]:e=>!e.devicesHaveLastFetchTime||e.hasApAdopted||e.hasSiteGateway||e.hasSwitchAdopted,[s.v.SETTINGS_VPN]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway,[s.v.SETTINGS_VPN_CLIENT]:e=>e.hasSiteGateway&&!(0,a.oWO)({type:e.siteGatewayInterfaces.type})&&!(0,a.ziy)({model:e.siteGatewayInterfaces.model}),[s.v.SETTINGS_POLICY]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasL3SwitchAdopted||e.features.has(r.Xj.SWITCH_CUSTOM_ACL_RULES)||e.features.has(r.Xj.ZONE_BASED_FIREWALL)||e.features.has(r.Xj.USER_DEFINED_NAT_RULES)||e.features.has(r.Xj.STATIC_DNS),[s.v.SETTINGS_POLICY_ACL]:e=>!e.devicesHaveLastFetchTime||e.features.has(r.Xj.SWITCH_CUSTOM_ACL_RULES),[s.v.SETTINGS_POLICY_QOS]:e=>!e.devicesHaveLastFetchTime||e.features.has(r.Xj.ZONE_BASED_FIREWALL),[s.v.SETTINGS_POLICY_NAT]:e=>!e.devicesHaveLastFetchTime||e.features.has(r.Xj.USER_DEFINED_NAT_RULES),[s.v.SETTINGS_POLICY_DNS]:e=>!e.devicesHaveLastFetchTime||e.features.has(r.Xj.STATIC_DNS),[s.v.SETTINGS_POLICY_PORT_FORWARDING]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway,[s.v.SETTINGS_POLICY_FIREWALL]:e=>!e.devicesHaveLastFetchTime||e.features.has(r.Xj.ZONE_BASED_FIREWALL),[s.v.SETTINGS_POLICY_ROUTE]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasL3SwitchAdopted,[s.v.SETTINGS_CONTENT_FILTER]:e=>!e.devicesHaveLastFetchTime||e.features.has(r.Xj.CLOUDFLARE_CONTENT_FILTERING)},i=(e,t)=>!!o[e]?.(t),_={[s.v.SETTINGS_WIFI]:()=>!0,[s.v.SETTINGS_WIFI_SPEED_LIMIT_PROFILES]:()=>!0,[s.v.SETTINGS_NETWORKS]:()=>!0,[s.v.SETTINGS_INTERNET]:()=>!0,[s.v.SETTINGS_TELEPORT]:()=>!0,[s.v.SETTINGS_UID_VPN]:()=>!0,[s.v.SETTING_ROUTING]:()=>!0,[s.v.SETTINGS_SECURITY]:()=>!0,[s.v.SETTINGS_RADIUS]:()=>!0,[s.v.NETWORK_OBJECTS]:()=>!0,[s.v.SETTINGS_ETHERNET_PORTS]:()=>!0,[s.v.SETTINGS_PROFILES]:()=>!0,[s.v.SETTINGS_VPN]:()=>!0,[s.v.SETTINGS_VPN_CLIENT]:()=>!0,[s.v.SETTINGS_POLICY]:()=>!0,[s.v.SETTINGS_POLICY_ACL]:()=>!1,[s.v.SETTINGS_POLICY_QOS]:()=>!1,[s.v.SETTINGS_POLICY_NAT]:()=>!1,[s.v.SETTINGS_POLICY_DNS]:()=>!1,[s.v.SETTINGS_POLICY_PORT_FORWARDING]:()=>!0,[s.v.SETTINGS_POLICY_FIREWALL]:()=>!1,[s.v.SETTINGS_POLICY_ROUTE]:()=>!0,[s.v.SETTINGS_CONTENT_FILTER]:()=>!1},c=(e,t)=>_[e]?.(t),l=(e,t)=>!!t.selfPreconfigureApprovals?.includes(e)&&c(e,t)},675291:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(469733),a=n(296540),s=n(847883),o=n(758649),i=n(162420),_=n(687370),c=n(958372),l=n(267691),E=n(675344),d=n(566723),T=n(294303),u=n(263130),O=n(699784),S=n(789768);const m={maxWidth:E.By,margin:`${d.Ln} 0 0 0`,style:{flex:0}},p=({feature:e,children:t,rowProps:n,skipApproval:E=!1,renderWarning:p})=>{const N=(0,r.useDispatch)(),v=(0,l.u)(e),A=(0,_.r)(e),C=(0,a.useCallback)(()=>N((0,S.ct)(e)),[N,e]),f=A?null:a.createElement(u.A,{icon:a.createElement(i.A,{variant:"fill",size:"original",isActive:!0}),description:a.createElement(O.sA,{id:c.b[e]?.(v||E)||"COMMON_LOCKED_FEATURE"}),action:v||E?null:a.createElement(o.A,{type:"button",onClick:C,variant:"inline"},a.createElement(O.sA,{id:"COMMON_LOCKED_PRECONFIGURE"}))});return a.createElement(a.Fragment,null,f?a.createElement(a.Fragment,null,p?p({children:f}):a.createElement(s.A,{unlimitedWidth:!0,...m,...n},f)):null,t?a.createElement(s.A,{unlimitedWidth:!0,disabled:!A&&!v&&!E,marginBottom:0},a.createElement(T.A,{width:"100%",flexDirection:"column",gap:d.Ln},t)):null)}},675344:(e,t,n)=>{"use strict";n.d(t,{By:()=>r,Ko:()=>o,Qb:()=>s,uE:()=>a,xh:()=>i});const r="800px",a="832px",s="1362px",o="664px",i="100px"},679783:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(296540),a=n(271856),s=n(217439),o=n(709690),i=n(566723),_=n(294303);const c=({label:e,tooltip:t,tooltipProps:n,style:c})=>r.createElement(_.A,{alignItems:"center",gap:i.YC,style:c},r.createElement(s.A,{size:"small",color:"text-3"},e),t?r.createElement(a.A,{description:t,portal:!0,style:{display:"flex",alignItems:"center"},...n},r.createElement(o.A,{size:"original",isActive:!0})):null)},687370:(e,t,n)=>{"use strict";n.d(t,{r:()=>i});var r=n(469733),a=n(296540),s=n(528644),o=n(674319);function i(e){const t=(0,r.useSelector)(s.C);return(0,a.useMemo)(()=>(0,o.A)(e,t),[e,t])}},846885:(e,t,n)=>{e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),i=(r=o)&&r.__esModule?r:{default:r},_=n(2);var c={action:null,isActive:!1,nextLocation:null},l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._prevUserAction="",n._isMounted=!0,n.block=n.block.bind(n),n.onBeforeUnload=n.onBeforeUnload.bind(n),n.onCancel=n.onCancel.bind(n),n.onConfirm=n.onConfirm.bind(n),n.when=n.when.bind(n),n.state=a({},c,{unblock:function(){}}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),s(t,[{key:"componentDidMount",value:function(){this.props.disableNative||window.addEventListener("beforeunload",this.onBeforeUnload),this.setState({unblock:this.props.history.block(this.block)})}},{key:"componentDidUpdate",value:function(e,t){"CANCEL"===this._prevUserAction&&"function"==typeof this.props.afterCancel?this.props.afterCancel():"CONFIRM"===this._prevUserAction&&"function"==typeof this.props.afterConfirm&&this.props.afterConfirm(),this._prevUserAction=""}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,"CONFIRM"===this._prevUserAction&&"function"==typeof this.props.afterConfirm&&(this._prevUserAction="",this.props.afterConfirm()),this.state.unblock(),this.props.disableNative||window.removeEventListener("beforeunload",this.onBeforeUnload)}},{key:"block",value:function(e,t){var n=this.when(e,t);return n&&this.setState({action:t,nextLocation:e,isActive:!0}),!n}},{key:"navigateToNextLocation",value:function(e){var t=this,n=this.state,r=n.action,s=n.nextLocation;r={POP:this.props.allowGoBack?"goBack":"push",PUSH:"push",REPLACE:"replace"}[r||"PUSH"],s||(s={pathname:"/"});var o=this.props.history;if(this.state.unblock(),this._prevUserAction="CONFIRM","goBack"===r){var i=o.listen(function(){i(),t._isMounted&&t.setState(a({},c,{unblock:o.block(t.block)}))});o.goBack()}else o[r](s),this._isMounted&&this.setState(a({},c,{unblock:this.props.history.block(this.block)}))}},{key:"onCancel",value:function(){var e=this;(this.props.beforeCancel||function(e){e()})(function(){e._prevUserAction="CANCEL",e.setState(a({},c))})}},{key:"onConfirm",value:function(){var e=this;(this.props.beforeConfirm||function(e){e()})(function(){e.navigateToNextLocation(e.props.afterConfirm)})}},{key:"onBeforeUnload",value:function(e){if(this.when()){var t="Do you want to leave this site?\n\nChanges you made may not be saved.";return e.returnValue=t,t}}},{key:"when",value:function(e,t){return"function"==typeof this.props.when?this.props.when(this.props.location,e,t):this.props.when}},{key:"render",value:function(){return this.state.isActive||this.props.renderIfNotActive?i.default.createElement("div",null,this.props.children({isActive:this.state.isActive,onConfirm:this.onConfirm,onCancel:this.onCancel})):null}}]),t}(i.default.Component);t.default=(0,_.withRouter)(l)},function(e,t){e.exports=n(296540)},function(e,t){e.exports=n(354625)}])},847883:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(296540),a=n(222588),s=n(722860),o=n(394756),i=n(772776);const _=(0,s.c)(a.A),c=r.forwardRef((e,t)=>{const{className:n,disabled:a=!1,motif:s,unlimitedWidth:c=!1,style:l,children:E,inline:d=!1,...T}=(0,o.b)(e),u=(0,i.p)(e);return r.createElement("div",{...T,className:_.concat(n)("settingsGridRow",!c&&"settingsGridRow-limitedWidth",d&&"settingsGridRow-inline",a&&"disabled"),ref:t,style:{...l,...u}},E)})},958372:(e,t,n)=>{"use strict";n.d(t,{D:()=>l,b:()=>E});var r=n(296540),a=n(169568),s=n(699784),o=n(196010),i=n(928085),_=n(959341);const c=()=>{const e=(0,i.A)(_.tz);return r.createElement(o.A,{to:e},r.createElement(s.sA,{id:"COMMON_ACTION_MANAGE"}))},l={[a.v.SETTINGS_POLICY_ACL]:r.createElement(s.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"}),[a.v.SETTINGS_POLICY_QOS]:r.createElement(s.sA,{id:"SETTINGS_ZONE_BASED_FIREWALL_REQUIRED",values:{link:r.createElement(c,null)}}),[a.v.SETTINGS_POLICY_FIREWALL]:r.createElement(s.sA,{id:"SETTINGS_ZONE_BASED_FIREWALL_REQUIRED",values:{link:r.createElement(c,null)}}),[a.v.SETTINGS_POLICY_NAT]:r.createElement(s.sA,{id:"SETTINGS_NAT_NOT_SUPPORTED"}),[a.v.SETTINGS_POLICY_DNS]:r.createElement(s.sA,{id:"SETTINGS_DNS_NOT_SUPPORTED"}),[a.v.SETTINGS_POLICY_PORT_FORWARDING]:r.createElement(s.sA,{id:"SETTINGS_PORT_FORWARDING_NOT_SUPPORTED"}),[a.v.SETTINGS_POLICY_ROUTE]:r.createElement(s.sA,{id:"SETTINGS_ROUTING_NOT_SUPPORTED"})},E={[a.v.SETTINGS_WIFI]:e=>e?"COMMON_LOCKED_FEATURE_AP_PRECONFIGURED":"COMMON_LOCKED_FEATURE_AP",[a.v.SETTINGS_NETWORKS]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW_OR_AP",[a.v.SETTINGS_INTERNET]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[a.v.SETTINGS_TELEPORT]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[a.v.SETTINGS_UID_VPN]:()=>"SETTINGS_VPN_UID_DESC",[a.v.SETTING_ROUTING]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[a.v.SETTINGS_SECURITY]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[a.v.SETTINGS_ETHERNET_PORTS]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[a.v.SETTINGS_WIFI_SPEED_LIMIT_PROFILES]:e=>e?"COMMON_LOCKED_FEATURE_AP_PRECONFIGURED":"COMMON_LOCKED_FEATURE_AP",[a.v.NETWORK_OBJECTS]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[a.v.SETTINGS_VPN]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[a.v.SETTINGS_POLICY]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[a.v.SETTINGS_POLICY_ACL]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[a.v.SETTINGS_POLICY_QOS]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[a.v.SETTINGS_POLICY_NAT]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[a.v.SETTINGS_POLICY_DNS]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[a.v.SETTINGS_POLICY_PORT_FORWARDING]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[a.v.SETTINGS_POLICY_FIREWALL]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[a.v.SETTINGS_POLICY_ROUTE]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW"}}}]);