"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[42320],{897015(e,n,t){t.d(n,{VG:()=>a,Vm:()=>o,z7:()=>i});const a=80,i="22:00",o="08:00"},446863(e,n,t){t.d(n,{H5:()=>l,Lq:()=>s,n0:()=>r});var a=t(909924),i=t(573534),o=t(172205);const r=e=>e[o.U.SHARED][i.N.PROPERTY_PANEL]?.[a.Io.TAB_GET_DATA_FUNCTION]||{},s=e=>e[o.U.SHARED][i.N.PROPERTY_PANEL]?.[a.Io.TAB_SUBMIT_FUNCTION]||{},l=e=>e[o.U.SHARED][i.N.PROPERTY_PANEL]?.[a.Io.TAB_RESET_FUNCTION]||{}},535322(e,n,t){t.d(n,{A:()=>p,I:()=>a});var a,i=t(274934),o=t(814557),r=t(158885),s=t(247816),l=t(565527),d=t(309130),c=t(100978),m=t(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(a||(a={}));const _=(0,s.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:n,theme:{themeName:t}})=>e||o.Ay[t===l.S.DARK?`desktop-color-neutral-${n?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${n?"01":"00"}-${l.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:n})=>n||(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}})=>o.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,s.A)(r.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:n,theme:{themeName:t}})=>e||o.Ay[t===l.S.DARK?`desktop-color-neutral-${n?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${n?"01":"00"}-${l.S.LIGHT}`]};
  margin-bottom: ${({theme:e,marginBottom:n})=>n||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:n}})=>e||o.Ay[n===l.S.DARK?`desktop-color-neutral-01-${l.S.DARK}`:`desktop-color-neutral-00-${l.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,p=({type:e,marginBottom:n,margin:t,padding:o,flex:r,width:s,nested:l,...d})=>"items"in d?(0,i.jsx)(u,{marginBottom:n,margin:t,padding:o,flex:r,nested:l,...d}):(0,i.jsx)(_,{nested:l,width:s,marginBottom:n,margin:t,padding:o,flex:r,isButtonList:e===a.BUTTON_LIST,...d,children:d.children})},250266(e,n,t){t.d(n,{A:()=>c});var a=t(274934),i=t(602086),o=t(696264),r=t(409844),s=t(521376),l=t(309130),d=t(470070);const c=({children:e=null,title:n,titleValues:t,message:c,messageValues:m,handleConfirm:_=()=>null,handleClose:u=()=>null,handleCancel:p,isOpen:h,buttonVariant:A="primary",cancelButtonVariant:b="tertiary",cancelButtonMessage:g="COMMON_ACTION_CANCEL",buttonMessage:x="COMMON_ACTION_CONFIRM",buttonDisabled:f=!1,position:v="top",offset:E,showHeaderClose:O=!1,contentClassName:C="",body:M,titleBody:j,className:N,rootClose:w=!1,footerActions:S})=>{const I=(0,i.useCallback)(e=>{h&&(e.stopPropagation(),e.key===s.U.ENTER?_():e.key===s.U.ESCAPE&&u(!1))},[h,_,u]);(0,i.useEffect)(()=>(window.addEventListener("keydown",I,!0),()=>{window.removeEventListener("keydown",I,!0)}),[I]);const T=(0,i.useCallback)(()=>{u(!1),p?.()},[u,p]),k=(0,i.useCallback)(()=>{u(!1),_()},[u,_]),y=(0,i.useMemo)(()=>[{text:(0,a.jsx)(d.sA,{id:g}),variant:b,onClick:T},{text:(0,a.jsx)(d.sA,{id:x}),disabled:f,variant:A,onClick:k}],[x,A,g,b,T,k,f]),D=(0,i.useCallback)(()=>{u(!1)},[u]),$=r.AH`
    ${n?"":`margin-top: ${l.xO}`}
  `;return(0,a.jsx)(o.A,{title:n?(0,a.jsx)(d.sA,{id:n,values:t}):j||null,...c?{body:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.sA,{id:c,values:m}),M]})}:{body:M},position:v,portal:!0,offset:E,actions:S||y,showHeaderClose:O,contentClassName:r.AH`
        ${$}
        ${C}
      `,onRequestClose:D,isOpen:h,allowOverflow:!0,rootClose:w,className:N,children:e})}},637084(e,n,t){t.d(n,{A:()=>b});var a=t(274934),i=t(602086),o=t(843871),r=t(977872),s=t(418398),l=t(205521),d=t(232410),c=t(1469),m=t(260288),_=t(619619),u=t(876809),p=t(113454),h=t(621309);const A=(0,o.bk)({enableReinitialize:!0,mapPropsToValues:({powerSupervisor:e,device:n})=>({powerSupervisor:(0,_.f)(e,(0,p.lD)(n,e))}),handleSubmit:(e,{resetForm:n})=>n({values:e}),validationSchema:u.A}),b=(0,s.Zz)((0,r.Ng)((e,{device:{mac:n}})=>({powerSupervisor:(0,d.x0)(n)(e)})))(A(({powerSupervisor:e,device:n,setFormDirty:t,setFormInvalid:o,validateForm:s,values:d,resetForm:_,dirty:u,isValid:p,formName:A=m.r8})=>{const b=(0,r.wA)();return(0,i.useEffect)(()=>(b((0,l.uo)({[A]:()=>({})})),b((0,l.Oo)({[A]:()=>{s().then(n=>{Object.keys(n).length||b((0,h.A)(e?.id,d.powerSupervisor))})}})),b((0,l.rW)({[A]:_})),()=>{b((0,l.uo)({[A]:null})),b((0,l.Oo)({[A]:null})),b((0,l.rW)({[A]:null}))}),[b,_,d.powerSupervisor,A,s,e?.id]),(0,i.useEffect)(()=>{t?.(A,u),o?.(A,!p)},[t,u,o,p,A]),(0,a.jsx)(c.A,{device:n})}))},876809(e,n,t){t.d(n,{A:()=>o,q:()=>i});var a=t(950804);const i=a.A.object().shape({power_sources:a.A.array().transform(e=>e.filter(e=>e.power_source_mac)).of(a.A.object().shape({client_psu_index:a.A.number().required(),power_source_mac:a.A.string().label("COMMON_POWER_SOURCE").required(),power_source_index:a.A.string().label("COMMON_OUTLET").required()})).label("COMMON_POWER_SOURCE").min(1)}).optional(),o=a.A.object().shape({powerSupervisor:i})},609664(e,n,t){t.d(n,{A:()=>c});var a=t(274934),i=t(814557),o=t(938984),r=t(247816),s=t(309130),l=t(470070);const d=(0,r.A)("div")`
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0 ${s.YC};
  overflow: hidden;

  &:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: ${({theme:{themeName:e}})=>i.Ay[`desktop-color-ublue-06-${e}`]};
    opacity: 0.1;
    border-radius: 8px;
  }
`,c=()=>(0,a.jsx)(d,{children:(0,a.jsx)(o.A,{size:"small",color:"ublue-06",children:(0,a.jsx)(l.sA,{id:"COMMON_MLO"})})})},505342(e,n,t){t.d(n,{A:()=>x});var a=t(274934),i=t(977872),o=t(602086),r=t(843871),s=t(938984),l=t(247816),d=t(641645),c=t(309130),m=t(120197),_=t(470070),u=t(570801),p=t(304151),h=t(100978);const A=(0,l.A)(h.A)`
  margin-bottom: 24px;
`,b=e=>{const[n,t]=e.split(":");return 60*Number(n)+Number(t)},g=e=>`${Math.floor(e/d.t).toString().padStart(2,"0")}:${(e%d.t).toString().padStart(2,"0")}`,x=(0,o.memo)(()=>{const{values:{lcm_night_mode_begins:e,lcm_night_mode_ends:n},setFieldValue:t}=(0,r.j7)(),{formatMessage:l}=(0,_.tz)(),x=(0,i.d4)(u.jc),f=(0,o.useMemo)(()=>(0,d.gy)(x,15,l),[x,l]),v=(0,o.useMemo)(()=>"string"==typeof e?b(e):e,[e]),E=(0,o.useMemo)(()=>"string"==typeof n?b(n):n,[n]),O=(0,o.useCallback)(({value:e})=>{t("lcm_night_mode_begins",g(+e))},[t]),C=(0,o.useCallback)(({value:e})=>{t("lcm_night_mode_ends",g(+e))},[t]);return!v&&0!==v||!E&&0!==E?null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(h.A,{justifyContent:"flex-start",marginBottom:c.kc,alignItems:"center",gap:c.YC,children:[(0,a.jsx)(s.A,{color:"text-1",size:"medium",children:(0,a.jsx)(_.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE"})}),(0,a.jsx)(p.A,{description:(0,a.jsx)(_.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE_DESCRIPTION"})})]}),(0,a.jsx)(A,{justifyContent:"space-between",flexDirection:"column",children:(0,a.jsxs)(h.A,{gap:c.Ln,children:[(0,a.jsx)(m.A,{type:"dropdown",variant:"secondary",label:"COMMON_START_TIME",translateLabel:!0,name:"lcm_night_mode_begins",placeholder:f.some(({value:e})=>e===v)?void 0:(0,d.oP)({formatMessage:l,minuteOfDay:v,use24HourFormat:x}),translatePlaceholder:!1,options:f,value:v,onChange:O,full:!0}),(0,a.jsx)(m.A,{type:"dropdown",variant:"secondary",label:"COMMON_END_TIME",translateLabel:!0,name:"lcm_night_mode_ends",placeholder:f.some(({value:e})=>e===E)?void 0:(0,d.oP)({formatMessage:l,minuteOfDay:E,use24HourFormat:x}),translatePlaceholder:!1,options:f,value:E,onChange:C,full:!0})]})})]})})},753104(e,n,t){t.d(n,{A:()=>b});var a=t(274934),i=t(938984),o=t(184580),r=t(247816),s=t(120197),l=t(100978),d=t(331472),c=t(309130),m=t(470070),_=t(927316),u=t(293668),p=t(609664);const h=(0,r.A)("li")`
  padding: ${c.kc} ${c.YC};
  display: flex;
  align-items: flex-start;
  gap: ${c.YC};
`,A=({className:e,id:n,isSelected:t,onClick:r,option:{label:s,value:A,radioLinks:b=[],mloMeshSupported:g=!1}})=>(0,a.jsxs)(h,{id:n,onClick:r,className:e,"aria-selected":t,role:"option",children:[(0,a.jsx)(l.A,{flexDirection:"column",minWidth:c.Er,justifyContent:"flex-start",children:t?(0,a.jsx)(o.A,{size:"original"}):null}),(0,a.jsxs)(l.A,{flexDirection:"column",width:"100%",children:[(0,a.jsxs)(l.A,{flexDirection:"row",maxWidth:150,children:[(0,a.jsx)(i.A,{variant:"body-primary",isTruncated:!0,children:s}),g&&b.length>1?(0,a.jsx)(l.A,{position:"relative",marginLeft:c.YC,children:(0,a.jsx)(p.A,{})}):null]}),(0,a.jsx)(l.A,{flexDirection:"row",children:(0,a.jsx)(i.A,{variant:"caption",children:A})})]}),(0,a.jsx)(l.A,{flexDirection:"column",alignItems:"flex-end",children:b.sort((e,n)=>(0,_.xd)(e.radio,n.radio)).map(({radio:e,signal:n,channel:t},o)=>(0,a.jsxs)(l.A,{flexDirection:"row",gap:c.YC,alignItems:"center",children:[(0,a.jsx)(l.A,{flexDirection:"column",whiteSpace:"nowrap",children:void 0!==t?(0,a.jsxs)(i.A,{variant:"caption",children:[(0,a.jsx)(m.sA,{id:"COMMON_CHANNEL_RADIO_CHANNEL",values:{channel:t}})," (",(0,a.jsx)(m.sA,{id:(0,u.dI)(e)}),")"]}):null}),(0,a.jsx)(l.A,{flexDirection:"column",whiteSpace:"nowrap",children:void 0!==n?(0,a.jsxs)(i.A,{variant:"caption",color:(0,d.b5)(n),children:[n," ",(0,a.jsx)(m.sA,{id:"COMMON_UNIT_DBM"})]}):null})]},`${e}-${o}`))})]}),b=({options:e,value:n,onChange:t,...i})=>(0,a.jsx)(s.A,{full:!0,translateLabel:!0,name:"parentMac",type:"dropdown",variant:"secondary",options:e,value:n,onChange:t,searchable:!0,placeholder:"COMMON_PLACEHOLDER_SELECT_DEVICE",translatePlaceholder:!0,validated:!0,renderOption:A,...i})},835655(e,n,t){t.d(n,{J:()=>u,S:()=>_});var a=t(602086),i=t(345272),o=t(561614),r=t(927316),s=t(634268),l=t(432001),d=t(308833),c=t(250820),m=t(98334);const _=({antenna_id:e,antenna_gain:n,name:t,radio:a,ht:i,channel:r,tx_power_mode:l,tx_power:c,min_txpower:_,vwire_enabled:u,min_rssi_enabled:p,min_rssi:h,hard_noise_floor_enabled:A,sens_level_enabled:b,sens_level:g})=>({antenna_id:e,antenna_gain:n,name:t,type:a,ht:+i||s.L[a],channel:Number(r)||m.YQ,tx_power_mode:l||o.PB.AUTO,tx_power:c||_||0,vwire_enabled:u??!0,min_rssi_enabled:p||!1,min_rssi:+h||d.X.DEFAULT,hard_noise_floor_enabled:A||!1,sens_level_enabled:b,sens_level:g}),u=e=>{const n=(0,a.useMemo)(()=>({...(()=>{const n=(e.radio_table||[]).find(({radio:e})=>e===i.A.NA.type)?.vwire_enabled??!0,t=e.mesh_sta_vap_enabled??!0,a=n||t;return{radios:(e.support_wifi6e?e.radio_table:e.radio_table?.filter(({radio:e})=>e!==o.sx.RADIO_6E))?.map(_)?.sort(r.j3),atf_enabled:e.atf_enabled||!1,meshingEnabled:a,uplinkMeshEnabled:t,uplinkPriority1:e.mesh_uplink_1||"",uplinkPriority2:e.mesh_uplink_2||""}})()}),[e.radio_table,e.mesh_sta_vap_enabled,e.mesh_uplink_1,e.mesh_uplink_2,e.atf_enabled,e.support_wifi6e]),t=(0,a.useMemo)(()=>e.radio_table?.reduce((n,{radio:t})=>(n[t]=(0,l.k)({wifi_caps:e.wifi_caps,hide_ch_width:e.hide_ch_width},t),n),{}),[e.radio_table,e.wifi_caps,e.hide_ch_width]);return{initialValues:n,getSubmitData:(0,a.useCallback)(n=>{const{meshingEnabled:a,uplinkMeshEnabled:i,uplinkPriority1:o,uplinkPriority2:s,radios:l,...d}=n,c={...d};return o&&(c.mesh_uplink_1=o,s&&(c.mesh_uplink_2=s)),c.mesh_sta_vap_enabled=n.uplinkMeshEnabled,c.radio_table=l.map(n=>{const a=(e.radio_table||[]).find(({name:e})=>e===n.name),i=(0,r.kb)({model:e.model},a.antenna_id)?null:(0,r.Sb)(e.antenna_table||[],a.antenna_id);return(({isChannelWidthHidden:e,antenna:n,minRssiStrictModeSupported:t},a)=>{const{name:i,type:o,sens_level:s,sens_level_enabled:l,...d}=a,c={...d,sens_level_enabled:l,sens_level:s,radio:o,name:i};return"custom"!==d.tx_power_mode&&delete c.tx_power,c.antenna_id&&n?c.antenna_gain=(0,r.pK)(n,i):delete c.antenna_id,t||c.min_rssi_enabled||delete c.hard_noise_floor_enabled,c.min_rssi_enabled||delete c.min_rssi,c.sens_level_enabled||delete c.sens_level,e&&(delete c.channel,delete c.ht),c})({isChannelWidthHidden:t[n.type],antenna:i&&a&&(0,r.Jj)(i,a.name)?i:null,minRssiStrictModeSupported:a&&(0,r.Wg)(a)},n)}),c},[e.radio_table,e.model,e.antenna_table,t]),validationSchema:(0,c.m)(e.radio_table)}}},153275(e,n,t){t.d(n,{$:()=>O,A:()=>C});var a=t(274934),i=t(586566),o=t(663216),r=t(100978),s=t(451700),l=t(532635),d=t(977872),c=t(602086),m=t(415537),_=t(347625),u=t(309130),p=t(353704),h=t(946525);const A=({macTable:e})=>{const n=(0,d.d4)(h.Ib),t=e.map(({mac:e})=>{const t=n.get(e);return{mac:e,name:(0,_.Q)(t)}});return(0,a.jsx)(r.A,{width:"100%",flexDirection:"column",paddingTop:u.kc,paddingLeft:u.Ln,children:t.map(({mac:e,name:n})=>(0,a.jsx)("li",{children:(0,a.jsx)(p.A,{mac:e,children:(0,m.c)(n)})},e))})};var b=t(956731),g=t(54849),x=t(470070),f=t(956978),v=t(754924);const E=({activeItem:e})=>{const{active_sta_table:n=[]}=e,t=(0,d.d4)((0,v.Jp)(e.mac)),i=(0,f.Ewg)(e),o=i&&n.length>0,r=i&&t.length>0,s=(0,f.Fh5)(e),l=(0,c.useMemo)(()=>{if(o){const e=n.map(e=>({mac:e.mac}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.sA,{id:"DEVICE_DENY_REMOVE_PARENT_WITH_CHILD_TOOLTIP_MESSAGE"}),(0,a.jsx)(A,{macTable:e})]})}if(s&&r){const e=t.map(e=>({mac:e.mac}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.sA,{id:"DEVICE_DENY_REMOVE_PARENT_WITH_CHILD_TOOLTIP_MESSAGE"}),(0,a.jsx)(A,{macTable:e})]})}return!1},[n,r,o,t,s]);return(0,a.jsx)(b.R,{flexDirection:"column",disabledTooltip:l,tooltipId:"DEVICE_ACTIONS_REMOVE_INFO",children:(0,a.jsx)(g.A,{device:e,disabled:!!l})})},O="udbManage",C=({activeItem:e,setFormDirty:n,setFormInvalid:t})=>(0,a.jsxs)(r.A,{flexDirection:"column",children:[(0,i.j0)(e)?(0,a.jsx)(s.A,{activeItem:e,setFormDirty:n,setFormInvalid:t,hideRackMultiScreenSync:!0}):(0,a.jsx)(o.Ay,{activeItem:e,setFormDirty:n}),(0,a.jsx)(l.A,{activeItem:e,hideRemove:!0,hideSnmp:!0,additionalItems:(0,a.jsx)(E,{activeItem:e})})]})},521376(e,n,t){var a;t.d(n,{U:()=>a}),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"}(a||(a={}))},478961(e,n,t){t.d(n,{A:()=>o});var a=t(274934),i=t(602086);const o=function(e){return n=>t=>{const[o,r]=(0,i.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[s,l]=(0,i.useState)(Object.fromEntries(e.map(e=>[e,!1]))),d=(0,i.useCallback)((e,n)=>{r(t=>({...t,[e]:n}))},[]),c=(0,i.useCallback)((e,n)=>{l(t=>({...t,[e]:n}))},[]),m=!!Object.values(o).find(e=>e),_=!!Object.values(s).find(e=>e);return(0,a.jsx)(n,{isDirty:m,isInvalid:_,formStates:o,setFormDirty:d,setFormInvalid:c,...t})}}},641645(e,n,t){t.d(n,{EJ:()=>d,gy:()=>s,oP:()=>r,pi:()=>o,q8:()=>l,t:()=>i});var a=t(477909);const i=60,o=24,r=({minuteOfDay:e,use24HourFormat:n,formatMessage:t})=>{const a=Math.floor(e/60);return`${String(n?a:a%12||12).padStart(2,"0")}:${String(e%i).padStart(2,"0")}${n?"":` ${t({id:a>=12?"COMMON_PM":"COMMON_AM"})}`}`},s=(e,n,t)=>{const o=Math.max(1,Math.min(60,Math.floor(60/n))),s=Math.floor(60/o);return(0,a.A)(0,24).flatMap(n=>(0,a.A)(o).map(a=>{const o=a*s;return{label:r({use24HourFormat:e,formatMessage:t,minuteOfDay:n*i+o}),value:60*n+ +o}}))},l=e=>6e4*Math.round(e/6e4),d=(e,n)=>{const t=+(e/1e3).toFixed(1),a=+(t/1e3).toFixed(1),i=+(t/6e4).toFixed(1);return t<1e3?`${t} ${n({id:"COMMON_UNIT_MS"})}`:a<60?`${a} ${n({id:"COMMON_UNIT_S"})}`:`${i} ${n({id:"COMMON_UNIT_MIN"})}`}}}]);