"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[29533],{346100(e,t,n){n.d(t,{A:()=>i});const i={POWER_CYCLE_ON_AC_RECOVERY:2,POWER_BUZZER:4,SAFE_SHUTDOWN_AND_POWER_CYCLE_TIME:8}},897015(e,t,n){n.d(t,{VG:()=>i,Vm:()=>s,z7:()=>r});const i=80,r="22:00",s="08:00"},595778(e,t,n){n.d(t,{I:()=>r,U:()=>s});var i=n(241365);const r=(0,n(419284).Wj)(i.Ay["blue-0"]),s=100},446863(e,t,n){n.d(t,{H5:()=>a,Lq:()=>l,n0:()=>o});var i=n(909924),r=n(573534),s=n(172205);const o=e=>e[s.U.SHARED][r.N.PROPERTY_PANEL]?.[i.Io.TAB_GET_DATA_FUNCTION]||{},l=e=>e[s.U.SHARED][r.N.PROPERTY_PANEL]?.[i.Io.TAB_SUBMIT_FUNCTION]||{},a=e=>e[s.U.SHARED][r.N.PROPERTY_PANEL]?.[i.Io.TAB_RESET_FUNCTION]||{}},535322(e,t,n){n.d(t,{A:()=>A,I:()=>i});var i,r=n(274934),s=n(814557),o=n(158885),l=n(247816),a=n(565527),d=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(i||(i={}));const _=(0,l.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===a.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${a.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${a.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${d.Ln}`:d.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||d.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>s.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,l.A)(o.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===a.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${a.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${a.S.LIGHT}`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||s.Ay[t===a.S.DARK?`desktop-color-neutral-01-${a.S.DARK}`:`desktop-color-neutral-00-${a.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,A=({type:e,marginBottom:t,margin:n,padding:s,flex:o,width:l,nested:a,...d})=>"items"in d?(0,r.jsx)(u,{marginBottom:t,margin:n,padding:s,flex:o,nested:a,...d}):(0,r.jsx)(_,{nested:a,width:l,marginBottom:t,margin:n,padding:s,flex:o,isButtonList:e===i.BUTTON_LIST,...d,children:d.children})},250266(e,t,n){n.d(t,{A:()=>c});var i=n(274934),r=n(602086),s=n(696264),o=n(409844),l=n(521376),a=n(309130),d=n(470070);const c=({children:e=null,title:t,titleValues:n,message:c,messageValues:m,handleConfirm:_=()=>null,handleClose:u=()=>null,handleCancel:A,isOpen:h,buttonVariant:g="primary",cancelButtonVariant:b="tertiary",cancelButtonMessage:E="COMMON_ACTION_CANCEL",buttonMessage:v="COMMON_ACTION_CONFIRM",buttonDisabled:x=!1,position:p="top",offset:O,showHeaderClose:I=!1,contentClassName:C="",body:j,titleBody:N,className:f,rootClose:R=!1,footerActions:T})=>{const S=(0,r.useCallback)(e=>{h&&(e.stopPropagation(),e.key===l.U.ENTER?_():e.key===l.U.ESCAPE&&u(!1))},[h,_,u]);(0,r.useEffect)(()=>(window.addEventListener("keydown",S,!0),()=>{window.removeEventListener("keydown",S,!0)}),[S]);const y=(0,r.useCallback)(()=>{u(!1),A?.()},[u,A]),M=(0,r.useCallback)(()=>{u(!1),_()},[u,_]),w=(0,r.useMemo)(()=>[{text:(0,i.jsx)(d.sA,{id:E}),variant:b,onClick:y},{text:(0,i.jsx)(d.sA,{id:v}),disabled:x,variant:g,onClick:M}],[v,g,E,b,y,M,x]),D=(0,r.useCallback)(()=>{u(!1)},[u]),k=o.AH`
    ${t?"":`margin-top: ${a.xO}`}
  `;return(0,i.jsx)(s.A,{title:t?(0,i.jsx)(d.sA,{id:t,values:n}):N||null,...c?{body:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.sA,{id:c,values:m}),j]})}:{body:j},position:p,portal:!0,offset:O,actions:T||w,showHeaderClose:I,contentClassName:o.AH`
        ${k}
        ${C}
      `,onRequestClose:D,isOpen:h,allowOverflow:!0,rootClose:R,className:f,children:e})}},859513(e,t,n){n.d(t,{A:()=>c});var i=n(274934),r=n(814557),s=n(247816),o=n(409844),l=n(470070),a=n(291508);const d=(0,s.A)("div",(0,a.A)("align"))`
  ${({align:e})=>e&&`text-align: ${e}`};
  color: ${({theme:{themeName:e}})=>r.Ay[`desktop-color-red-06-${e}`]};
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
  line-height: 20px;
`,c=({align:e="left",children:t=null,className:n=null,translation:r=null,visible:s=!1})=>s?(0,i.jsxs)(d,{align:e,className:(0,o.cx)(n),children:[r?(0,i.jsx)(l.sA,{id:r}):null,t]}):null},377764(e,t,n){n.d(t,{A:()=>C,R:()=>p});var i=n(274934),r=n(418398),s=n(977872),o=n(602086),l=n(843871),a=n(938984),d=n(925845),c=n(762705),m=n(60927),_=n(419284),u=n(586566),A=n(309130),h=n(100978),g=n(205521),b=n(470070),E=n(291935),v=n(857780),x=n(595778);const p="led",O=(0,l.bk)({enableReinitialize:!0,mapPropsToValues:({activeItem:{led_override:e,led_override_color:t=x.I,led_override_color_brightness:n=x.U}={},mgmtSettings:i})=>({led_override:e||(!1===i.led_enabled?v.c_.OFF:v.c_.ON),led_override_color:t,led_override_color_brightness:n}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),I=e=>(0,i.jsxs)("span",{children:[e,"%"]}),C=(0,r.Zz)((0,s.Ng)(e=>({mgmtSettings:(0,E.$5)(e)})))(O(({activeItem:e,setFormDirty:t,setFormInvalid:n,dirty:r,isValid:l,values:E,resetForm:O,setFieldValue:C,formName:j=p,mgmtSettings:{led_enabled:N}})=>{const f=(0,s.wA)(),R=(0,u.lp)(e),T=(N&&e.led_override!==v.c_.OFF||e.led_override===v.c_.ON)&&R;(0,o.useEffect)(()=>(f((0,g.uo)({[j]:()=>E})),f((0,g.Oo)({[j]:()=>O({values:E})})),f((0,g.rW)({[j]:O})),()=>{f((0,g.uo)({[j]:null})),f((0,g.Oo)({[j]:null})),f((0,g.rW)({[j]:null}))}),[f,O,E,j]),(0,o.useEffect)(()=>{t(j,r),n(j,!l)},[t,n,r,l,j]);const S=(0,o.useCallback)(e=>{C("led_override_color",(0,_.E6)(e.toString())||x.I)},[C]);return(0,i.jsxs)(h.A,{gap:A.Ln,flexDirection:"column",children:[(0,i.jsx)(h.A,{width:"100%",justifyContent:"space-between",children:(0,i.jsx)(c.A,{id:"led_override",checked:v.c_.ON===E.led_override,onChange:()=>{C("led_override",E.led_override===v.c_.ON?v.c_.OFF:v.c_.ON)},children:(0,i.jsx)(a.A,{size:"medium",color:"text-2",children:(0,i.jsx)(b.sA,{id:"COMMON_LED"})})})}),T?(0,i.jsxs)(h.A,{flexDirection:"column",gap:12,children:[(0,i.jsx)(a.A,{size:"medium",children:(0,i.jsx)(b.sA,{id:"COMMON_BRIGHTNESS"})}),(0,i.jsx)(d.A,{size:"large",value:+E.led_override_color_brightness||100,withValueIndicator:!0,valueIndicatorPosition:"right",formatValueIndicatorContent:I,onChange:({target:{value:e}})=>{C("led_override_color_brightness",e)}}),(0,i.jsx)(a.A,{size:"medium",color:"text-1",weight:"bold",children:(0,i.jsx)(b.sA,{id:"COMMON_COLOR"})}),(0,i.jsx)(m.A,{value:E?.led_override_color||x.I,onChange:S,sliders:[{id:"hue",channel:"hue"}],colorSpace:"hex",children:(0,i.jsx)("span",{children:(0,i.jsx)(b.sA,{id:"DEVICE_PROPERTIES_LABEL_HEX"})})})]}):null]})}))},148561(e,t,n){n.d(t,{A:()=>N,g:()=>C});var i=n(274934),r=n(418398),s=n(977872),o=n(602086),l=n(843871),a=n(938984),d=n(950804),c=n(309130),m=n(589650),_=n(977663),u=n(120197),A=n(100978),h=n(205521),g=n(470070),b=n(291935),E=n(197571),v=n(956978),x=n(34118),p=n(550521),O=n(21265),I=n(336128);const C="network",j=(0,l.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:{config_network:e,model:t,ip:n,switch_vlan_enabled:i,mgmt_network_id:r,connection_network_id:s},nativeNetworks:o})=>{const l=(0,v.U$e)(o,s);return{config_network:{type:e?.type||m.NL.DHCP,ip:e?.ip||n||"",netmask:e?.netmask||l?.netmask||"",gateway:e?.gateway||l?.ip||"",dns1:e?.dns1||l?.dns1||"",dns2:e?.dns2||l?.dns2||"",dnssuffix:e?.dnssuffix||"",bonding_enabled:e?.bonding_enabled||!1},mgmt_network_id:(0,v.ewD)(o,r),switch_vlan_enabled:i||!1,...((0,v.C6C)({model:t}),{})}},handleSubmit:(e,{resetForm:t})=>{t({values:e})},validationSchema:({honeypotNetworksIps:e,clients:t})=>d.A.object().shape({config_network:(0,_.d)(e,t),mgmt_network_id:d.A.string(),lte_limit_enabled:d.A.boolean().label("COMMON_LTE_DATA_LIMIT"),lte_limit:d.A.number().integer().label("COMMON_DATA_LIMIT").when("lte_limit_enabled",{is:!0,then:d.A.number().min(1).required().label("COMMON_DATA_LIMIT")})})}),N=(0,r.Zz)((0,s.Ng)(e=>({nativeNetworks:(0,E.Tn)(e),honeypotNetworksIps:(0,b.Yk)(e),clients:(0,x.A8)(e)})),j)(({setFormDirty:e,setFormInvalid:t,dirty:n,values:r,resetForm:l,isValid:d,initialValues:_,activeItem:b,nativeNetworks:E,hideNetworkOverride:x,formName:j=C})=>{const N=(0,s.wA)(),f=(0,v.iQS)(b.model),R=(0,v.C6C)(b);(0,o.useEffect)(()=>{e(C,n),t(C,!d)},[e,t,n,d]);const T=(0,v.moU)(b);(0,o.useEffect)(()=>(N((0,h.uo)({[j]:()=>{const e={config_network:r.config_network?.type===m.NL.STATIC?r.config_network:{type:m.NL.DHCP,bonding_enabled:r.config_network?.bonding_enabled},mgmt_network_id:r.mgmt_network_id};return f&&(e.switch_vlan_enabled=r.switch_vlan_enabled,_.switch_vlan_enabled&&!r.switch_vlan_enabled&&b.port_overrides?.length&&(e.port_overrides=(b.port_overrides||[]).map(({portconf_id:e,...t})=>t))),e}})),N((0,h.Oo)({[j]:()=>l({values:r})})),N((0,h.rW)({[j]:l})),()=>{N((0,h.uo)({[j]:null})),N((0,h.Oo)({[j]:null})),N((0,h.rW)({[j]:null}))}),[N,l,r,j,b.port_overrides,_.switch_vlan_enabled,f,R]);const S=!x&&!T&&E.length>1&&!(0,v.q82)({model:b.model})&&!(0,v.xQi)({model:b.model});return(0,i.jsxs)(A.A,{flexDirection:"column",gap:c.S2,children:[S?(0,i.jsx)(p.A,{nativeNetworks:E,activeItemMac:b.mac}):null,(0,i.jsx)(I.A,{}),r.config_network?.type===m.NL.STATIC?(0,i.jsx)(O.A,{}):null,(0,v.xyH)(b)||(0,v.Eyk)(b)||(0,v._iI)(b)||(0,v.W46)(b)?(0,i.jsx)(A.A,{children:(0,i.jsx)(u.A,{name:"config_network.bonding_enabled",type:"realCheckbox",children:(0,i.jsx)(g.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_AGGREGATION"})})}):null,f?(0,i.jsxs)(A.A,{flexDirection:"column",gap:c.kc,children:[(0,i.jsx)(a.A,{weight:"bold",size:"medium",children:(0,i.jsx)(g.sA,{id:"COMMON_VLAN"})}),(0,i.jsxs)(A.A,{justifyContent:"space-between",children:[(0,i.jsx)(a.A,{size:"medium",children:(0,i.jsx)(g.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_VLAN"})}),(0,i.jsx)(u.A,{type:"checkbox",name:"switch_vlan_enabled"})]})]}):null,null]})})},505342(e,t,n){n.d(t,{A:()=>v});var i=n(274934),r=n(977872),s=n(602086),o=n(843871),l=n(938984),a=n(247816),d=n(641645),c=n(309130),m=n(120197),_=n(470070),u=n(570801),A=n(304151),h=n(100978);const g=(0,a.A)(h.A)`
  margin-bottom: 24px;
`,b=e=>{const[t,n]=e.split(":");return 60*Number(t)+Number(n)},E=e=>`${Math.floor(e/d.t).toString().padStart(2,"0")}:${(e%d.t).toString().padStart(2,"0")}`,v=(0,s.memo)(()=>{const{values:{lcm_night_mode_begins:e,lcm_night_mode_ends:t},setFieldValue:n}=(0,o.j7)(),{formatMessage:a}=(0,_.tz)(),v=(0,r.d4)(u.jc),x=(0,s.useMemo)(()=>(0,d.gy)(v,15,a),[v,a]),p=(0,s.useMemo)(()=>"string"==typeof e?b(e):e,[e]),O=(0,s.useMemo)(()=>"string"==typeof t?b(t):t,[t]),I=(0,s.useCallback)(({value:e})=>{n("lcm_night_mode_begins",E(+e))},[n]),C=(0,s.useCallback)(({value:e})=>{n("lcm_night_mode_ends",E(+e))},[n]);return!p&&0!==p||!O&&0!==O?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(h.A,{justifyContent:"flex-start",marginBottom:c.kc,alignItems:"center",gap:c.YC,children:[(0,i.jsx)(l.A,{color:"text-1",size:"medium",children:(0,i.jsx)(_.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE"})}),(0,i.jsx)(A.A,{description:(0,i.jsx)(_.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE_DESCRIPTION"})})]}),(0,i.jsx)(g,{justifyContent:"space-between",flexDirection:"column",children:(0,i.jsxs)(h.A,{gap:c.Ln,children:[(0,i.jsx)(m.A,{type:"dropdown",variant:"secondary",label:"COMMON_START_TIME",translateLabel:!0,name:"lcm_night_mode_begins",placeholder:x.some(({value:e})=>e===p)?void 0:(0,d.oP)({formatMessage:a,minuteOfDay:p,use24HourFormat:v}),translatePlaceholder:!1,options:x,value:p,onChange:I,full:!0}),(0,i.jsx)(m.A,{type:"dropdown",variant:"secondary",label:"COMMON_END_TIME",translateLabel:!0,name:"lcm_night_mode_ends",placeholder:x.some(({value:e})=>e===O)?void 0:(0,d.oP)({formatMessage:a,minuteOfDay:O,use24HourFormat:v}),translatePlaceholder:!1,options:x,value:O,onChange:C,full:!0})]})})]})})},336128(e,t,n){n.d(t,{A:()=>_});var i=n(274934),r=n(602086),s=n(938984),o=n(833466),l=n(309130),a=n(589650),d=n(120197),c=n(100978),m=n(470070);const _=(0,r.memo)(()=>(0,i.jsxs)(c.A,{flexDirection:"column",children:[(0,i.jsx)(s.A,{color:"text-3",size:"small",children:(0,i.jsx)(m.sA,{id:"COMMON_IP_CONFIGURATION"})}),(0,i.jsxs)(c.A,{height:o.b,alignItems:"center",gap:l.Ln,children:[(0,i.jsx)(d.A,{name:"config_network.type",type:"radio",value:a.NL.DHCP,children:(0,i.jsx)(m.sA,{id:"COMMON_DHCP"})}),(0,i.jsx)(d.A,{name:"config_network.type",type:"radio",value:a.NL.STATIC,children:(0,i.jsx)(m.sA,{id:"COMMON_STATIC"})})]})]}))},451700(e,t,n){n.d(t,{W:()=>w,A:()=>P});var i=n(274934),r=n(418398),s=n(977872),o=n(602086),l=n(843871),a=n(396489),d=n.n(a),c=n(925845),m=n(938984),_=n(247816),u=n(950804),A=n(309130),h=n(304151),g=n(505342),b=n(814557),E=n(115354),v=n(291508),x=n(100978),p=n(470070);const O=[0,90,180,270],I=(0,_.A)(x.A,(0,v.A)("isActive"))`
  border: 1px solid
    ${({theme:{themeName:e},isActive:t})=>t?b.Ay[`desktop-color-ublue-06-${e}`]:b.Ay[`desktop-color-neutral-03-${e}`]};
  border-radius: ${b.Ay["desktop-radius-base"]};
  cursor: pointer;
`,C=(0,_.A)(E.A,(0,v.A)("degree"))`
  transform: rotate(${({degree:e})=>e}deg);
`,j=({degree:e,isActive:t,onClick:n})=>(0,i.jsxs)(I,{padding:`${A.YC} ${A.kc}`,flex:1,gap:A.YC,alignItems:"center",isActive:t,onClick:n,children:[(0,i.jsx)(C,{isActive:t,degree:e}),(0,i.jsx)(m.A,{color:"text-2",children:e?`${e}°`:(0,i.jsx)(p.sA,{id:"COMMON_NONE"})})]}),N=()=>{const{values:{lcm_orientation_override:e},setFieldValue:t}=(0,l.j7)();return(0,i.jsxs)("div",{children:[(0,i.jsx)(m.A,{color:"text-3",size:"small",children:(0,i.jsx)(p.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_DISPLAY_ROTATION"})}),(0,i.jsx)(x.A,{gap:A.kc,marginTop:A.YC,marginBottom:A.Ln,children:O.map(n=>(0,i.jsx)(j,{degree:n,isActive:n===e,onClick:()=>{t("lcm_orientation_override",n)}},n))})]})};var f=n(120197),R=n(205521),T=n(291935),S=n(598990),y=n(897166),M=n(897015);const w="lcmScreen",D=(0,_.A)(x.A)`
  &:not(:last-child) {
    margin-bottom: ${A.S2};
  }
`,k=(0,l.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({lcmSettings:e,activeItem:t,activeItem:{lcm_brightness:n=M.VG,lcm_brightness_override:i=!1,lcm_night_mode_enabled:r=!1,lcm_night_mode_begins:s=M.z7,lcm_night_mode_ends:o=M.Vm,lcm_orientation_override:l}})=>({lcm:e,lcm_brightness:n,lcm_brightness_override:i,lcm_night_mode_enabled:r,lcm_night_mode_begins:s,lcm_night_mode_ends:o,..."lcm_orientation_override"in t?{lcm_orientation_override:l}:{}}),validationSchema:u.A.object().shape({lcm:u.A.object().shape({sync:u.A.boolean()}),lcm_brightness_override:u.A.boolean(),lcm_brightness:u.A.number().label("COMMON_BRIGHTNESS").min(1).max(100).required(),lcm_night_mode_enabled:u.A.boolean(),lcm_night_mode_begins:u.A.string(),lcm_night_mode_ends:u.A.string(),lcm_orientation_override:u.A.number()}),handleSubmit:()=>null}),L=e=>(0,i.jsx)(m.A,{size:"medium",children:e}),P=(0,r.Zz)((0,s.Ng)(e=>({lcmSettings:(0,T.ml)(e)}),{}),k)(({values:e,setFieldValue:t,resetForm:n,setFormDirty:r,setFormInvalid:l,dirty:a,isValid:_,initialValues:u,activeItem:b,hideRackMultiScreenSync:E=!1})=>{const v=(0,s.wA)(),O=(0,s.d4)(y.EL);return(0,o.useEffect)(()=>{r(w,a),l(w,!_)},[r,l,_,a]),(0,o.useEffect)(()=>(v((0,R.uo)({[w]:()=>({...e,lcm_brightness_override:e.lcm_brightness!==M.VG,lcm_night_mode_begins:e.lcm_night_mode_begins,lcm_night_mode_ends:e.lcm_night_mode_ends,..."lcm_orientation_override"in e?{lcm_orientation_override:e.lcm_orientation_override}:{}})})),v((0,R.Oo)({[w]:()=>{d()(u.lcm,e.lcm)||v((0,S.vd)(e.lcm)),n({values:e})}})),v((0,R.rW)({[w]:n})),()=>{v((0,R.uo)({[w]:null})),v((0,R.Oo)({[w]:null})),v((0,R.rW)({[w]:null}))}),[v,n,e,u.lcm]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(D,{justifyContent:"space-between",children:[(0,i.jsx)(m.A,{color:"text-1",size:"medium",children:(0,i.jsx)(p.sA,{id:"COMMON_BRIGHTNESS"})}),(0,i.jsx)(c.A,{width:"50%",value:e.lcm_brightness||M.VG,withValueIndicator:!0,min:1,valueIndicatorPosition:"right",formatValueIndicatorContent:L,onChange:e=>{t("lcm_brightness",+e.target.value)},disabled:O})]}),"lcm_orientation_override"in b?(0,i.jsx)(N,{}):null,(0,i.jsx)(g.A,{}),E?null:(0,i.jsx)(D,{justifyContent:"space-between",alignItems:"center",children:(0,i.jsxs)(x.A,{alignItems:"center",gap:A.kc,children:[(0,i.jsxs)(x.A,{alignItems:"center",children:[(0,i.jsx)(f.A,{type:"realCheckbox",name:"lcm.sync",checked:e.lcm.sync}),(0,i.jsx)(m.A,{color:"text-1",size:"medium",children:(0,i.jsx)(p.sA,{id:"COMMON_RACK_MULTI_SCREEN_SYNC"})})]}),(0,i.jsx)(h.A,{description:(0,i.jsx)(p.sA,{id:"DEVICE_PROPERTIES_LABEL_RACK_MULTI_SCREEN_SYNCHRONIZATION_TOOLTIP"})})]})})]})})},144118(e,t,n){n.r(t),n.d(t,{default:()=>G});var i=n(274934),r=n(418398),s=n(977872),o=n(602086),l=n(142757),a=n(347625),d=n(478961),c=n(630849),m=n(376892),_=n(470070),u=n(446863),A=n(795206),h=n(434521),g=n(45978),b=n(89469),E=n(586566),v=n(115114),x=n(612935),p=n(148561),O=n(532635),I=n(377764),C=n(795928),j=n(535322),N=n(843871),f=n(938984),R=n(950804),T=n(309130),S=n(721398),y=n(120197),M=n(100978),w=n(408402),D=n(205521);const k="nut_server",L=(0,N.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({nut_server:e={port:3493}})=>({nut_server:e}),validationSchema:R.A.object().shape({nut_server:R.A.object().shape({enabled:R.A.boolean(),id:R.A.string().label("DEVICE_PROPERTIES_LABEL_NUT_SERVER_ID").when("enabled",{is:!0,then:R.A.string().required()}),port:R.A.number().label("DEVICE_PROPERTIES_LABEL_NUT_SERVER_PORT").when("enabled",{is:!0,then:R.A.number().required()}),credential_required:R.A.boolean(),username:R.A.string().label("COMMON_LABEL_USERNAME").when("credential_required",{is:!0,then:R.A.string().required()}),password:R.A.string().label("COMMON_PASSWORD").when("credential_required",{is:!0,then:R.A.string().required()})})}),handleSubmit:()=>null}),P=(0,r.Zz)(L)(({values:e,resetForm:t,setFormDirty:n,setFormInvalid:r,dirty:l,isValid:a,initialValues:d,deviceName:c})=>{const m=(0,s.wA)();return(0,o.useEffect)(()=>{n(k,l),r(k,!a)},[n,r,a,l]),(0,o.useEffect)(()=>(m((0,D.uo)({[k]:()=>({nut_server:{enabled:e.nut_server?.enabled||!1,id:e.nut_server?.id||"",port:e.nut_server?.port||3493,credential_required:e.nut_server?.credential_required||!1,username:e.nut_server?.username||"",password:e.nut_server?.password||""}})})),m((0,D.Oo)({[k]:()=>t({values:e})})),m((0,D.rW)({[k]:t})),()=>{m((0,D.uo)({[k]:null})),m((0,D.Oo)({[k]:null})),m((0,D.rW)({[k]:null}))}),[m,t,e,d.nut_server]),(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(M.A,{flexDirection:"column",gap:T.kc,children:[(0,i.jsxs)(M.A,{flexDirection:"row",alignItems:"center",gap:T.kc,children:[(0,i.jsx)(y.A,{type:"realCheckbox",name:"nut_server.enabled",children:(0,i.jsx)(f.A,{variant:"body-primary",children:(0,i.jsx)(_.sA,{id:"DEVICE_PROPERTIES_LABEL_NUT_SERVER"})})}),(0,i.jsx)(S.A,{variant:"outline",messageId:"DEVICE_PROPERTIES_LABEL_NUT_SERVER_DESCRIPTION"})]}),(0,i.jsxs)(w.A,{condition:!e?.nut_server?.enabled,children:[(0,i.jsxs)(M.A,{flexDirection:"row",alignItems:"flex-start",gap:T.kc,children:[(0,i.jsx)(y.A,{variant:"secondary",name:"nut_server.id",label:"DEVICE_PROPERTIES_LABEL_NUT_SERVER_ID",full:!0}),(0,i.jsx)(y.A,{variant:"secondary",name:"nut_server.port",type:"number",label:"DEVICE_PROPERTIES_LABEL_NUT_SERVER_PORT",width:160})]}),(0,i.jsxs)(M.A,{flexDirection:"row",alignItems:"center",gap:T.kc,children:[(0,i.jsx)(y.A,{type:"realCheckbox",name:"nut_server.credential_required",children:(0,i.jsx)(f.A,{variant:"body-primary",children:(0,i.jsx)(_.sA,{id:"DEVICE_PROPERTIES_LABEL_NUT_SERVER_CREDENTIAL_REQUIRED"})})}),(0,i.jsx)(S.A,{variant:"outline",messageId:"DEVICE_PROPERTIES_LABEL_NUT_SERVER_CREDENTIAL_REQUIRED_DESCRIPTION",values:{deviceName:c}})]}),(0,i.jsxs)(w.A,{condition:!e?.nut_server?.credential_required,children:[(0,i.jsx)(M.A,{flexDirection:"row",children:(0,i.jsx)(y.A,{autoComplete:"off",variant:"secondary",name:"nut_server.username",label:"COMMON_LABEL_USERNAME",full:!0})}),(0,i.jsx)(M.A,{flexDirection:"row",children:(0,i.jsx)(y.A,{name:"nut_server.password",type:"password",label:"COMMON_PASSWORD",autoComplete:"new-password",variant:"secondary",isNewInput:!0,passwordToggle:!0,full:!0})})]})]})]})})});var F=n(796091),V=n(346100);const $="beep",B=(0,N.bk)({enableReinitialize:!0,mapPropsToValues:({activeItem:{beep_enabled:e}={}})=>({beep_enabled:e||!1}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),U=({setFormDirty:e,setFormInvalid:t,dirty:n,isValid:r,values:l,resetForm:a,formName:d=$})=>{const c=(0,s.wA)();return(0,o.useEffect)(()=>(c((0,D.uo)({[d]:()=>l})),c((0,D.Oo)({[d]:()=>a({values:l})})),c((0,D.rW)({[d]:a})),()=>{c((0,D.uo)({[d]:null})),c((0,D.Oo)({[d]:null})),c((0,D.rW)({[d]:null}))}),[c,a,l,d]),(0,o.useEffect)(()=>{e(d,n),t(d,!r)},[e,t,n,r,d]),(0,i.jsx)(F.A,{children:(0,i.jsx)(y.A,{type:"realCheckbox",name:"beep_enabled",tooltipMessage:(0,i.jsx)(_.sA,{id:"DEVICE_POWER_OFF_BUZZER_TOOLTIP"}),children:(0,i.jsx)(_.sA,{id:"DEVICE_POWER_OFF_BUZZER"})})})},W=B(e=>{const{activeItem:{smart_power_caps:t=0}}=e;return(0,o.useMemo)(()=>(0,E.TM)({smart_power_caps:t},V.A.POWER_BUZZER),[t])?(0,i.jsx)(U,{...e}):null});var H=n(451700);const z=["disableManualFwUpdateWithReason","disableDowngradeWithReason","disableLocateWithReason","disableRestartWithReason","disableRemotePowerOffWithReason","disableCopyConfigWithReason"].reduce((e,t)=>(e[t]=(0,i.jsx)(_.sA,{id:"DEVICE_WARNING_UPS_DEVICE_OVERLOAD"}),e),{}),G=(0,r.Zz)((0,d.A)([C.UH,$,H.W,p.g,x.q,O.f,k]))(({activeItem:e,setFormDirty:t,setFormInvalid:n,isDirty:r,isInvalid:d})=>{const _=(0,s.d4)(u.n0),x=(0,s.d4)(u.Lq),N=(0,s.d4)(u.H5),{_id:f,mac:R}=e,T=(0,s.wA)(),S=(0,c.I)(),y=e.outlet_enabled,M=(0,l.Md)(e.vbms_table?.bms_run_anomaly||0),w=(0,h.S9)(e)!==g.g.CONNECTED,D=(0,o.useMemo)(()=>(0,a.Q)({model:e.model,name:e.name,mac:e.mac}),[e.model,e.name,e.mac]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(C.Ay,{activeItem:e,setFormDirty:t,setFormInvalid:n}),(0,i.jsx)(j.A,{type:j.I.ACCORDION,items:[{id:p.g,openByDefault:!0,label:(0,i.jsx)(m.A,{id:"COMMON_IP_SETTINGS"}),renderContent:()=>(0,i.jsx)(p.A,{activeItem:e,setFormDirty:t,setFormInvalid:n,hideNetworkOverride:!0})}]}),(0,i.jsx)(j.A,{children:(0,i.jsx)(P,{setFormDirty:t,setFormInvalid:n,nut_server:e?.nut_server,deviceName:D})}),(0,i.jsx)(j.A,{type:j.I.ACCORDION,items:[{id:O.f,openByDefault:!0,label:(0,i.jsx)(m.A,{id:"COMMON_ACTION_MANAGE"}),renderContent:()=>(0,i.jsxs)(b.A,{children:[(0,i.jsx)(W,{activeItem:e,setFormDirty:t,setFormInvalid:n}),(0,E.j0)(e)?(0,i.jsx)(H.A,{activeItem:e,setFormDirty:t,setFormInvalid:n,hideRackMultiScreenSync:!0}):(0,i.jsx)(I.A,{activeItem:e,setFormDirty:t,setFormInvalid:n}),(0,i.jsx)(O.A,{activeItem:e,hideManualFwUpdate:e.vbms_table?.is_battery_mode||!y||w,hideDowngrade:e.vbms_table?.is_battery_mode||!y||w,hideLocate:!y,hideRestart:!y,hideReplacementDevice:!y,...M?z:{}})]})}]}),(0,i.jsx)(v.A,{isDirty:r,isInvalid:d,onFormSubmit:()=>{const e=Object.entries(_).reduce((e,[t,n])=>{if("function"==typeof n){const t=n();if("object"==typeof t&&t&&Object.keys(t).length)return{...e,...t}}return e},{}),{lcm:t,...n}=e;T((0,A.ex)(n,f,R,{extend:!0})).then(()=>{Object.values(x).forEach(e=>{"function"==typeof e&&e()})}).catch(S)},onFormCancel:()=>{Object.values(N).forEach(e=>{"function"==typeof e&&e()})}})]})})},521376(e,t,n){var i;n.d(t,{U:()=>i}),function(e){e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape",e.BACKSPACE="Backspace",e.DELETE="Delete",e.TAB="Tab"}(i||(i={}))},478961(e,t,n){n.d(t,{A:()=>s});var i=n(274934),r=n(602086);const s=function(e){return t=>n=>{const[s,o]=(0,r.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[l,a]=(0,r.useState)(Object.fromEntries(e.map(e=>[e,!1]))),d=(0,r.useCallback)((e,t)=>{o(n=>({...n,[e]:t}))},[]),c=(0,r.useCallback)((e,t)=>{a(n=>({...n,[e]:t}))},[]),m=!!Object.values(s).find(e=>e),_=!!Object.values(l).find(e=>e);return(0,i.jsx)(t,{isDirty:m,isInvalid:_,formStates:s,setFormDirty:d,setFormInvalid:c,...n})}}},641645(e,t,n){n.d(t,{EJ:()=>d,gy:()=>l,oP:()=>o,pi:()=>s,q8:()=>a,t:()=>r});var i=n(477909);const r=60,s=24,o=({minuteOfDay:e,use24HourFormat:t,formatMessage:n})=>{const i=Math.floor(e/60);return`${String(t?i:i%12||12).padStart(2,"0")}:${String(e%r).padStart(2,"0")}${t?"":` ${n({id:i>=12?"COMMON_PM":"COMMON_AM"})}`}`},l=(e,t,n)=>{const s=Math.max(1,Math.min(60,Math.floor(60/t))),l=Math.floor(60/s);return(0,i.A)(0,24).flatMap(t=>(0,i.A)(s).map(i=>{const s=i*l;return{label:o({use24HourFormat:e,formatMessage:n,minuteOfDay:t*r+s}),value:60*t+ +s}}))},a=e=>6e4*Math.round(e/6e4),d=(e,t)=>{const n=+(e/1e3).toFixed(1),i=+(n/1e3).toFixed(1),r=+(n/6e4).toFixed(1);return n<1e3?`${n} ${t({id:"COMMON_UNIT_MS"})}`:i<60?`${i} ${t({id:"COMMON_UNIT_S"})}`:`${r} ${t({id:"COMMON_UNIT_MIN"})}`}}}]);