"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[94770],{100188:(e,t,a)=>{a.d(t,{A:()=>h});var l=a(296540),n=a(766412),r=a(939703),i=a(294303),o=a(595235),c=a(71479);const s=(0,c.A)(i.A)`
  cursor: pointer;
`,m=(0,c.A)("div",{shouldForwardProp:e=>"color"!==e})`
  background-color: ${({color:e})=>e};
  border-radius: 3px;
  width: 34px;
  height: 20px;
`,d=({color:e})=>l.createElement(s,{width:"55px",height:"24px",padding:"2px 0",alignItems:"center",justifyContent:"space-between",flexShrink:0},l.createElement(m,{color:e}),l.createElement(o.A,null));var _=a(363441);const u=[{id:"hue",channel:"hue"}],h=({value:e,onChange:t})=>{const a=(0,l.useCallback)(e=>{t((0,r.E6)(e.toString())||_.I)},[t]),o=e||_.I;return l.createElement(i.A,{flexDirection:"column"},l.createElement(n.A,{value:o,onChange:a,sliders:u,colorSpace:"hex"},l.createElement("span",null,l.createElement(d,{color:o}))))}},129712:(e,t,a)=>{a.d(t,{A:()=>O,H:()=>b});var l=a(868238),n=a(469733),r=a(296540),i=a(951272),o=a(870443),c=a(566723),s=a(855019),m=a(62227),d=a(294303),_=a(845030),u=a(302167),h=a(366188),p=a(780811),v=a(239417),A=a(785146),g=a(31208),E=a(726317);const b="network",C=(0,i.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:{config_network:e,ip:t,switch_vlan_enabled:a,mgmt_network_id:l,connection_network_id:n},nativeNetworks:r})=>{const i=(0,p.U$e)(r,n);return{config_network:{type:e?.type||s.NL.DHCP,ip:e?.ip||t||"",netmask:e?.netmask||i?.netmask||"",gateway:e?.gateway||i?.ip||"",dns1:e?.dns1||i?.dns1||"",dns2:e?.dns2||i?.dns2||"",dnssuffix:e?.dnssuffix||"",bonding_enabled:e?.bonding_enabled||!1},mgmt_network_id:(0,p.ewD)(r,l),switch_vlan_enabled:a||!1}},handleSubmit:(e,{resetForm:t})=>{t({values:e})},validationSchema:({honeypotNetworksIps:e,combinedClients:t})=>o.A.object().shape({config_network:(0,m.d)(e,t),mgmt_network_id:o.A.string(),lte_limit_enabled:o.A.boolean().label("COMMON_LTE_DATA_LIMIT"),lte_limit:o.A.number().integer().label("COMMON_DATA_LIMIT").when("lte_limit_enabled",{is:!0,then:o.A.number().min(1).required().label("COMMON_DATA_LIMIT")})})}),O=(0,l.Zz)((0,n.connect)(e=>({nativeNetworks:(0,h.Tn)(e),honeypotNetworksIps:(0,u.Yk)(e),combinedClients:(0,v.GB)(e)})),C)(({setFormDirty:e,setFormInvalid:t,dirty:a,values:l,resetForm:i,isValid:o,initialValues:m,nativeNetworks:u=[],activeItem:h})=>{const p=(0,n.useDispatch)();return(0,r.useEffect)(()=>{e(b,a),t(b,!o)},[e,t,a,o]),(0,r.useEffect)(()=>(p((0,_.uo)({[b]:()=>({config_network:l.config_network.type===s.NL.STATIC?l.config_network:{type:s.NL.DHCP,bonding_enabled:l.config_network.bonding_enabled},mgmt_network_id:l.mgmt_network_id})})),p((0,_.Oo)({[b]:()=>i({values:l})})),p((0,_.rW)({[b]:i})),()=>{p((0,_.uo)({[b]:null})),p((0,_.Oo)({[b]:null})),p((0,_.rW)({[b]:null}))}),[p,i,l,h.port_overrides,m.switch_vlan_enabled]),r.createElement(d.A,{gap:c.S2,flexDirection:"column"},u.length>1?r.createElement(A.A,{nativeNetworks:u,activeItemMac:h.mac}):null,r.createElement(E.A,null),l.config_network.type===s.NL.STATIC?r.createElement(g.A,null):null)})},279675:(e,t,a)=>{a.d(t,{W:()=>T,A:()=>R});var l=a(868238),n=a(469733),r=a(296540),i=a(951272),o=a(429252),c=a.n(o),s=a(802),m=a(217439),d=a(71479),_=a(870443),u=a(566723),h=a(766624),p=a(389651),v=a(822336),A=a(870829),g=a(311785),E=a(294303),b=a(699784);const C=[0,90,180,270],O=(0,d.A)(E.A,(0,g.A)("isActive"))`
  border: 1px solid
    ${({theme:{motifPalette:{uBlue06:e,neutral03:t}},isActive:a})=>a?e:t};
  border-radius: ${v.Ay["desktop-radius-base"]};
  cursor: pointer;
`,f=(0,d.A)(A.A,(0,g.A)("degree"))`
  transform: rotate(${({degree:e})=>e}deg);
`,I=({degree:e,isActive:t,onClick:a})=>r.createElement(O,{padding:`${u.YC} ${u.kc}`,flex:1,gap:u.YC,alignItems:"center",isActive:t,onClick:a},r.createElement(f,{isActive:t,degree:e}),r.createElement(m.A,{color:"text-2"},e?`${e}°`:r.createElement(b.sA,{id:"COMMON_NONE"}))),M=()=>{const{values:{lcm_orientation_override:e},setFieldValue:t}=(0,i.j7)();return r.createElement("div",null,r.createElement(m.A,{color:"text-3",size:"small"},r.createElement(b.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_DISPLAY_ROTATION"})),r.createElement(E.A,{gap:u.kc,marginTop:u.YC,marginBottom:u.Ln},C.map(a=>r.createElement(I,{key:a,degree:a,isActive:a===e,onClick:()=>{t("lcm_orientation_override",a)}}))))};var w=a(143811),y=a(845030),N=a(302167),D=a(457311),x=a(602021),k=a(639188);const T="lcmScreen",P=(0,d.A)(E.A)`
  &:not(:last-child) {
    margin-bottom: ${u.S2};
  }
`,S=(0,i.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({lcmSettings:e,activeItem:t,activeItem:{lcm_brightness:a=k.VG,lcm_brightness_override:l=!1,lcm_night_mode_enabled:n=!1,lcm_night_mode_begins:r=k.z7,lcm_night_mode_ends:i=k.Vm,lcm_orientation_override:o}})=>({lcm:e,lcm_brightness:a,lcm_brightness_override:l,lcm_night_mode_enabled:n,lcm_night_mode_begins:r,lcm_night_mode_ends:i,..."lcm_orientation_override"in t?{lcm_orientation_override:o}:{}}),validationSchema:_.A.object().shape({lcm:_.A.object().shape({sync:_.A.boolean()}),lcm_brightness_override:_.A.boolean(),lcm_brightness:_.A.number().label("COMMON_BRIGHTNESS").min(1).max(100).required(),lcm_night_mode_enabled:_.A.boolean(),lcm_night_mode_begins:_.A.string(),lcm_night_mode_ends:_.A.string(),lcm_orientation_override:_.A.number()}),handleSubmit:()=>null}),F=e=>r.createElement(m.A,{size:"medium"},e),R=(0,l.Zz)((0,n.connect)(e=>({lcmSettings:(0,N.ml)(e)}),{}),S)(({values:e,setFieldValue:t,resetForm:a,setFormDirty:l,setFormInvalid:i,dirty:o,isValid:d,initialValues:_,activeItem:v,hideRackMultiScreenSync:A=!1})=>{const g=(0,n.useDispatch)(),C=(0,n.useSelector)(x.EL);return(0,r.useEffect)(()=>{l(T,o),i(T,!d)},[l,i,d,o]),(0,r.useEffect)(()=>(g((0,y.uo)({[T]:()=>({...e,lcm_brightness_override:e.lcm_brightness!==k.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}:{}})})),g((0,y.Oo)({[T]:()=>{c()(_.lcm,e.lcm)||g((0,D.vd)(e.lcm)),a({values:e})}})),g((0,y.rW)({[T]:a})),()=>{g((0,y.uo)({[T]:null})),g((0,y.Oo)({[T]:null})),g((0,y.rW)({[T]:null}))}),[g,a,e,_.lcm]),r.createElement(r.Fragment,null,r.createElement(P,{justifyContent:"space-between"},r.createElement(m.A,{color:"text-1",size:"medium"},r.createElement(b.sA,{id:"COMMON_BRIGHTNESS"})),r.createElement(s.A,{width:"50%",value:e.lcm_brightness||k.VG,withValueIndicator:!0,min:1,valueIndicatorPosition:"right",formatValueIndicatorContent:F,onChange:e=>{t("lcm_brightness",+e.target.value)},disabled:C})),"lcm_orientation_override"in v?r.createElement(M,null):null,r.createElement(p.A,null),A?null:r.createElement(P,{justifyContent:"space-between",alignItems:"center"},r.createElement(E.A,{alignItems:"center",gap:u.kc},r.createElement(E.A,{alignItems:"center"},r.createElement(w.A,{type:"realCheckbox",name:"lcm.sync",checked:e.lcm.sync}),r.createElement(m.A,{color:"text-1",size:"medium"},r.createElement(b.sA,{id:"COMMON_RACK_MULTI_SCREEN_SYNC"}))),r.createElement(h.A,{description:r.createElement(b.sA,{id:"DEVICE_PROPERTIES_LABEL_RACK_MULTI_SCREEN_SYNCHRONIZATION_TOOLTIP"})}))))})},363441:(e,t,a)=>{a.d(t,{I:()=>n,U:()=>r});var l=a(888170);const n=(0,a(939703).Wj)(l.Ay["blue-0"]),r=100},400270:(e,t,a)=>{a.d(t,{A:()=>r});var l=a(296540),n=a(629318);const r=(0,a(51946).w)(e=>(0,l.createElement)("svg",(0,n.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H4Zm8 8a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-4Z",fill:"currentColor",className:e.twotonedclassname}),(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 4h4v4H4V4ZM3 4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4Zm9 8h4v4h-4v-4Zm-1 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-4Zm1.854-4.854L11.707 6H16v3.5a.5.5 0 0 0 1 0v-4a.5.5 0 0 0-.5-.5h-4.793l1.147-1.146a.5.5 0 0 0-.708-.708l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708ZM8.293 15H3.5a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 1 0V14h4.293l-1.147-1.146a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L8.293 15Z",fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H4Zm7 9a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-4Zm1.854-4.854L11.707 6H16v3.5a.5.5 0 0 0 1 0v-4a.5.5 0 0 0-.5-.5h-4.793l1.147-1.146a.5.5 0 0 0-.708-.708l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708ZM8.293 15H3.5a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 1 0V14h4.293l-1.147-1.146a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L8.293 15Z",fill:"currentColor",className:e.fillclassname})))},469628:(e,t,a)=>{a.d(t,{A:()=>r});var l=a(296540),n=a(629318);const r=(0,a(51946).w)(e=>(0,l.createElement)("svg",(0,n.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,l.createElement)("rect",{x:9,y:7,width:1,height:6,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:7,y:8,width:1,height:4,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:11,y:8,width:1,height:4,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:5,y:7,width:1,height:6,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:13,y:7,width:1,height:6,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:3,y:8,width:1,height:4,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:1,y:9,width:1,height:2,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:15,y:8,width:1,height:4,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:17,y:9,width:1,height:2,rx:.5,fill:"currentColor",className:e.baseclassname})))},470591:(e,t,a)=>{a.d(t,{A:()=>l});const l=(0,a(296540).createContext)({isStandalone:!0,header:[null,()=>{}],footer:[null,()=>{}]})},491877:(e,t,a)=>{a.d(t,{A:()=>r});var l=a(296540),n=a(629318);const r=(0,a(51946).w)(e=>(0,l.createElement)("svg",(0,n.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,l.createElement)("rect",{x:9.5,y:5,width:1,height:10,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:7,y:6,width:1,height:8,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:12,y:6,width:1,height:8,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:4.5,y:7,width:1,height:6,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:14.5,y:7,width:1,height:6,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:2,y:8,width:1,height:4,rx:.5,fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("rect",{x:17,y:8,width:1,height:4,rx:.5,fill:"currentColor",className:e.baseclassname})))},661065:(e,t,a)=>{a.d(t,{A:()=>m});var l=a(296540),n=a(1758),r=a(217439),i=a(699784),o=a(294303),c=a(363441),s=a(178233);const m=({value:e=c.U,onChange:t})=>l.createElement(l.Fragment,null,l.createElement(o.A,{flexDirection:"column",width:"100%"},l.createElement(o.A,{flexDirection:"row",alignItems:"center"},l.createElement(r.A,{variant:"caption"},l.createElement(i.sA,{id:"COMMON_BRIGHTNESS"}))),l.createElement(n.A,{value:e,minValue:1,onChange:t})),l.createElement(o.A,{flexDirection:"column"},l.createElement(r.A,{variant:"body-primary"},(0,s.A)(e))))},691441:(e,t,a)=>{a.d(t,{A:()=>r});var l=a(296540),n=a(470591);function r(e){const{children:t}=e,{isStandalone:a,footer:[,r]}=(0,l.useContext)(n.A);return(0,l.useLayoutEffect)(()=>{if(!a)return r(t),()=>r(null)},[a,t]),l.createElement(l.Fragment,null,a&&t)}},726317:(e,t,a)=>{a.d(t,{A:()=>d});var l=a(296540),n=a(927099),r=a(454195),i=a(566723),o=a(855019),c=a(143811),s=a(294303),m=a(699784);const d=(0,l.memo)(()=>l.createElement(s.A,{flexDirection:"column"},l.createElement(n.A,{color:"tertiary",size:"caption"},l.createElement(m.sA,{id:"COMMON_IP_CONFIGURATION"})),l.createElement(s.A,{height:r.b,alignItems:"center",gap:i.Ln},l.createElement(c.A,{name:"config_network.type",type:"radio",value:o.NL.DHCP},l.createElement(m.sA,{id:"COMMON_DHCP"})),l.createElement(c.A,{name:"config_network.type",type:"radio",value:o.NL.STATIC},l.createElement(m.sA,{id:"COMMON_STATIC"})))))},758353:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ae});var l=a(868238),n=a(469733),r=a(296540),i=a(592510),o=a(742920),c=a(582724),s=a(449688),m=a(96512),d=a(86571),_=a(689965),u=a(675359),h=a(302167),p=a(457311),v=a(889764),A=a(347524),g=a(780811),E=a(171073),b=a(129712),C=a(329109),O=a(94017),f=a(89124),I=a(951272),M=a(883840),w=a(874807),y=a(845030),N=a(768195),D=a(430126),x=a(703634),k=a(870443),T=a(699784),P=a(564985),S=a(885358);const F=e=>{const t=e.active_sta_table?.[0]?.mac||"",a=e.peer_to_peer_mode===N.tO.STATION,l=a&&e.station_mode===N.tM.PTMP,n=a&&e.station_mode===N.tM.PTP,i=a&&e.station_mode===N.tM.UAP_COMPATIBLE,o=(0,g.IOl)(e),c=o&&a,s=(0,r.useMemo)(()=>(0,g.vyh)({model:e.model}),[e.model]),m=(0,r.useMemo)(()=>c?e.ubb_pairing_state?.paired_mac:i?e.mesh_uplink_1||t:void 0,[c,i,e.mesh_uplink_1,e.ubb_pairing_state?.paired_mac,t]),d=(0,r.useMemo)(()=>o?a?N.tO.STATION:N.tO.AP:e.peer_to_peer_mode,[o,e.peer_to_peer_mode,a]),_=(0,r.useMemo)(()=>o?a?N.tM.UAP_COMPATIBLE:void 0:e.station_mode,[o,e.station_mode,a]),{initialValues:{radios:u},getSubmitData:h}=(0,S.J)(e);return{initialValues:(0,r.useMemo)(()=>({peer_to_peer_mode:d,station_mode:_,ptp_ap_mac:n?e.ptp_ap_mac:void 0,ptmp_ap_mac:l?e.ptmp_ap_mac:void 0,uplinkPriority1:m,radios:u||[]}),[e.ptp_ap_mac,e.ptmp_ap_mac,d,_,n,l,m,u]),getSubmitData:(0,r.useCallback)(t=>{const{radio_table:a}=h(t),l=(0,g.CdX)({model:e.model}),n=(a||[]).find(e=>e?.radio===P.sx.RADIO_AD),r=n?{ht:n.ht,channel:n.channel}:{},i=t.peer_to_peer_mode===N.tO.STATION&&!c;return{...{peer_to_peer_mode:t.peer_to_peer_mode,...t.peer_to_peer_mode===N.tO.AP?{radio_table:a?.map(({name:e,radio:t,ht:a,channel:n})=>l&&t===P.sx.RADIO_AD?{name:e,radio:t,...r}:{name:e,radio:t,ht:a,channel:n})}:{},...i?{station_mode:t.station_mode,...t.station_mode===N.tM.PTP?{ptp_ap_mac:t.ptp_ap_mac}:{},...t.station_mode===N.tM.PTMP?{ptmp_ap_mac:t.ptmp_ap_mac}:{},...(0,x.E)(t)?{mesh_uplink_1:t.uplinkPriority1}:{}}:{},...c?{ubb_pairing_state:{paired_mac:t.uplinkPriority1}}:{}}}},[h,e.model,c]),validationSchema:(0,r.useMemo)(()=>(e=>k.A.object().shape({peer_to_peer_mode:k.A.string().oneOf(Object.values(N.tO)).required(),station_mode:k.A.string().when("peer_to_peer_mode",{is:N.tO.STATION,then:k.A.string().oneOf(Object.values(N.tM)).when([],{is:()=>e,then:k.A.string().required(),otherwise:k.A.string()})}),ptp_ap_mac:k.A.string().when(["peer_to_peer_mode","station_mode"],{is:(e,t)=>e===N.tO.STATION&&t===N.tM.PTP,then:k.A.string().required()}),ptmp_ap_mac:k.A.string().when(["peer_to_peer_mode","station_mode"],{is:(e,t)=>e===N.tO.STATION&&t===N.tM.PTMP,then:k.A.string().required()}),uplinkPriority1:k.A.string().when(["peer_to_peer_mode","station_mode"],{is:(e,t)=>e===N.tO.STATION&&t===N.tM.UAP_COMPATIBLE,then:k.A.string().required()}),radios:k.A.array().of(k.A.object().shape({channel:k.A.string().required(r.createElement(T.sA,{id:"COMMON_VALIDATION_REQUIRED",values:{name:r.createElement(T.sA,{id:"COMMON_CHANNEL"})}}))}))}))(s),[s])}};var R=a(6510),L=a(566723),V=a(294303),H=a(444232),B=a(532419),Z=a(227902),U=a(130056);const z=({activeItem:e})=>{const{values:{ptmp_ap_mac:t,ptp_ap_mac:a,uplinkPriority1:l,station_mode:i},setFieldValue:o}=(0,I.j7)(),c=(0,g.Fh5)(e),s=!c,m=(0,g.Ewg)(e),u=(0,n.useSelector)(h.Zc),p=(0,n.useSelector)((0,r.useMemo)(()=>(0,B.sL)(e.uplink_table,u?void 0:{excludeDeviceType:N.bq.UAP}),[e.uplink_table,u])),v=i===N.tM.PTMP?t:i===N.tM.PTP?a:l,A=(0,n.useSelector)((0,r.useMemo)(()=>(0,H.Hh)(v||""),[v])),E=!p.some(({mac:e})=>e===v),b=e=>(0,g.Xuz)({model:e.model||""})?N.tM.PTMP:(0,g.CB0)({type:e.type||""})?N.tM.PTP:N.tM.UAP_COMPATIBLE,C=(0,r.useMemo)(()=>[...p,...A&&E?[A]:[]].map(e=>({label:(0,R.Q)(e),value:e.mac,signal:"signal"in e?e.signal:void 0,channel:"channel"in e?e.channel:void 0,stationMode:b(e)})).sort(x.l),[A,E,p]),f=(0,r.useCallback)(({value:t,stationMode:a})=>{i===a||(0,g.IOl)(e)||o("station_mode",a),a===N.tM.PTP?o("ptp_ap_mac",t):a===N.tM.PTMP?o("ptmp_ap_mac",t):a===N.tM.UAP_COMPATIBLE&&o("uplinkPriority1",t)},[e,o,i]);if(e.radio_table?.length){const t=[];if(c){const a=(e.radio_table||[]).find(e=>e.radio===P.sx.RADIO_NA),l=(e.radio_table||[]).find(e=>e.radio===P.sx.RADIO_AD);(a||l)&&t.push({id:O.eD,label:r.createElement(d.A,{id:"COMMON_RADIOS"}),openByDefault:!0,renderContent:()=>r.createElement(V.A,{flexDirection:"column",gap:L.Ln},a?r.createElement(Z.qk,{device:e,radio:a,isLastNa:!0,mode:Z.Hm.DEVICE_AND_RADIO,ignoreMeshingWarnings:c}):null,((0,g.vyh)(e)||(0,g.CdX)(e)||(0,g.IOl)(e))&&l?r.createElement(Z.qk,{device:e,radio:l,isLastNa:!0,mode:Z.Hm.DEVICE_AND_RADIO,ignoreMeshingWarnings:c}):null)})}return s&&!m&&t.push({id:O.eD,label:r.createElement(d.A,{id:"COMMON_MESH_PARENT"}),openByDefault:!0,renderContent:()=>r.createElement(V.A,{flexDirection:"column",gap:L.Ln},r.createElement(U.A,{options:C,value:v,onChange:f}))}),r.createElement(r.Fragment,null,t.length?t.map(e=>r.createElement(_.A,{key:e.id,type:_.I.ACCORDION,items:[e]})):null)}return null},G={meshingEnabled:!0,meshingMode:M.C.MANUAL,uplinkPriority2:""},j={meshingEnabled:!0},W=({activeItem:e,getSubmitData:t,setFormDirty:a,setFormInvalid:l,values:i,initialValues:o,resetForm:c,dirty:s,isValid:m})=>{const d=(0,n.useDispatch)(),_=e.peer_to_peer_mode===N.tO.STATION,u=(0,g.IOl)(e)&&_;return(0,r.useEffect)(()=>{a(O.eD,s)},[s,a]),(0,r.useEffect)(()=>{l(O.eD,!m)},[m,l]),(0,r.useEffect)(()=>(d((0,y.uo)({[O.eD]:()=>t(i)})),d((0,y.Oo)({[O.eD]:t=>{c({values:{...i,...t}}),(0,x.E)(i)&&(0,D.W)({...u?j:G,uplinkPriority1:i.uplinkPriority1},{...u?j:G,uplinkPriority1:o.uplinkPriority1},{mac:e.mac,name:e.name,type:e.type,model:e.model},d)}})),d((0,y.rW)({[O.eD]:c})),()=>{d((0,y.uo)({[O.eD]:null})),d((0,y.Oo)({[O.eD]:null})),d((0,y.rW)({[O.eD]:null}))}),[d,c,i,o,t,u,e.mac,e.name,e.type,e.model]),null},$=({activeItem:e,setFormDirty:t,setFormInvalid:a})=>{const{initialValues:l,validationSchema:n,getSubmitData:i}=F(e);return r.createElement(I.l1,{initialValues:l,onSubmit:w.P1,enableReinitialize:!0,validationSchema:n},l=>r.createElement(r.Fragment,null,t&&a&&r.createElement(W,{...l,activeItem:e,setFormDirty:t,setFormInvalid:a,getSubmitData:i}),r.createElement(z,{activeItem:e})))};var q=a(54227),X=a(454195),Y=a(147606),K=a(768941);const Q="poePassthrough",J=(0,I.bk)({enableReinitialize:!0,mapPropsToValues:({activeItem:{poe_mode:e,model:t}})=>{const a=(0,g.Xuz)({model:t}),l=(0,g.vyh)({model:t}),n=(0,g.CdX)({model:t});return{poe_mode:a||l||n?void 0:e}},handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),ee=(0,l.Zz)(J)(({setFormDirty:e,setFieldValue:t,dirty:a,values:l,resetForm:i,activeItem:o})=>{const c=(0,n.useDispatch)(),s=(0,r.useMemo)(()=>(0,g.Xuz)({model:o.model}),[o.model]),m=(0,r.useMemo)(()=>(0,g.CdX)({model:o.model}),[o.model]),d=(0,r.useMemo)(()=>(0,g.vyh)({model:o.model}),[o.model]),_=(0,r.useMemo)(()=>(0,g.cXB)({type:o.type,ubb_pairing_state:o.ubb_pairing_state}),[o.type,o.ubb_pairing_state]),u=(0,r.useMemo)(()=>!(s||d||_||m),[s,d,_,m]),h=(0,r.useCallback)(()=>{t("poe_mode",K.Gu.PASSTHROUGH)},[t]),p=(0,r.useCallback)(()=>{t("poe_mode",K.Gu.OFF)},[t]);return(0,r.useEffect)(()=>{e(Q,a)},[e,a]),(0,r.useEffect)(()=>(c((0,y.uo)({[Q]:()=>({...l,poe_mode:u?l.poe_mode||K.Gu.OFF:void 0})})),c((0,y.Oo)({[Q]:()=>i({values:l})})),c((0,y.rW)({[Q]:i})),()=>{c((0,y.uo)({[Q]:null})),c((0,y.Oo)({[Q]:null})),c((0,y.rW)({[Q]:null}))}),[a,c,u,i,l]),r.createElement(V.A,null,r.createElement(V.A,{height:X.b,gap:L.Ln,alignItems:"center"},r.createElement(V.A,{gap:L.Ln},r.createElement(q.A,{id:"poe_mode_off",checked:l.poe_mode===K.Gu.OFF,onChange:()=>t("poe_mode",K.Gu.OFF)},r.createElement(T.sA,{id:"COMMON_OFF"})),r.createElement(Y.A,{title:r.createElement(T.sA,{id:"DEVICE_POE_UPDATE_TITLE"}),message:r.createElement(T.sA,{id:"DEVICE_POE_PASSTHROUGH_CONFIRM_DESC"}),onConfirm:h,onClose:p,trigger:r.createElement(q.A,{id:"poe_mode_passthrough",checked:l.poe_mode===K.Gu.PASSTHROUGH,onChange:()=>{}},r.createElement(T.sA,{id:"COMMON_ON"})),confirmButtonLabel:r.createElement(T.sA,{id:"COMMON_ACTION_PROCEED"}),confirmButtonVariant:"destructive"}))))});var te=a(47026);const ae=(0,l.Zz)((0,s.A)([f.UH,O.eD,Q,b.H,te.$]))(({activeItem:e,setFormDirty:t,setFormInvalid:a,isDirty:l,isInvalid:s})=>{const O=(0,n.useDispatch)(),I=(0,n.useSelector)(v.n0),M=(0,n.useSelector)(v.Lq),w=(0,n.useSelector)(v.H5),y=(0,n.useSelector)(h.zu),[N,D]=(0,r.useState)(!y.switch_exclusions?.includes(e.mac)),x=l||N!==!y.switch_exclusions?.includes(e.mac),k=(0,m.I)(),T=(0,r.useMemo)(()=>(0,g.Xuz)({model:e.model}),[e.model]),P=(0,r.useMemo)(()=>(0,g.CdX)({model:e.model}),[e.model]),S=(0,r.useMemo)(()=>(0,g.vyh)({model:e.model}),[e.model]),F=(0,g.cXB)(e),R=(0,r.useMemo)(()=>!(T||S||F||P),[T,S,F,P]),L=(0,r.useCallback)(()=>{Object.values(w).forEach(e=>{e?.()})},[w]),V=(0,r.useCallback)(()=>{Object.values(M).forEach(e=>{e?.()})},[M]),H=(0,r.useCallback)(async()=>{if(s)return;if(N!==!y.switch_exclusions?.includes(e.mac)){const t=y.switch_exclusions.filter(t=>t!==e.mac);N||t.push(e.mac);try{await O((0,p.OD)({...y,switch_exclusions:t}))}catch(e){O((0,u.ox)({icon:o.C.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}))}}const t=Object.entries(I).reduce((e,[t,a])=>{if("function"==typeof a){const t=a();if("object"==typeof t&&t&&Object.keys(t).length)return{...e,...t}}return e},{});O((0,E.ex)(t,e._id,e.mac,{extend:!0})).then(()=>{V()}).catch(k)},[e._id,e.mac,O,I,y,N,s,V,k]);return(0,c.A)([(0,p.Uc)(),(0,A.u)(void 0,{crudCacheStrategy:{type:i.e.CACHE}})],r.createElement(r.Fragment,null,r.createElement(f.Ay,{activeItem:e,setFormDirty:t,setFormInvalid:a}),r.createElement($,{activeItem:e,setFormDirty:t,setFormInvalid:a}),R?r.createElement(_.A,{type:_.I.ACCORDION,items:[{id:Q,openByDefault:!0,label:r.createElement(d.A,{id:"COMMON_POE_PASSTHROUGH"}),renderContent:()=>r.createElement(ee,{activeItem:e,setFormDirty:t})}]}):null,r.createElement(_.A,{type:_.I.ACCORDION,items:[{id:b.H,openByDefault:!0,label:r.createElement(d.A,{id:"COMMON_IP_SETTINGS"}),renderContent:()=>r.createElement(b.A,{activeItem:e,setFormDirty:t,setFormInvalid:a})}]}),r.createElement(_.A,{type:_.I.ACCORDION,items:[{id:te.$,openByDefault:!0,label:r.createElement(d.A,{id:"COMMON_ACTION_MANAGE"}),renderContent:()=>r.createElement(te.A,{activeItem:e,setFormDirty:t,setFormInvalid:a})}]}),r.createElement(C.A,{isDirty:x,isInvalid:s,onFormSubmit:H,onFormCancel:L})))})},835908:(e,t,a)=>{a.d(t,{A:()=>r});var l=a(296540),n=a(629318);const r=(0,a(51946).w)(e=>(0,l.createElement)("svg",(0,n.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 2.5a.5.5 0 0 1 1 0v15a.5.5 0 0 1-1 0v-15Zm-4 3a.5.5 0 0 1 1 0v9a.5.5 0 0 1-1 0v-9ZM14 5a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 1 0v-9A.5.5 0 0 0 14 5ZM1.5 7.5a.5.5 0 0 1 1 0v5a.5.5 0 0 1-1 0v-5ZM18 7a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 1 0v-5A.5.5 0 0 0 18 7Z",fill:"currentColor",className:e.baseclassname})))},870829:(e,t,a)=>{a.d(t,{A:()=>r});var l=a(296540),n=a(629318);const r=(0,a(51946).w)(e=>(0,l.createElement)("svg",(0,n.d)({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,l.createElement)("rect",{x:3,y:3,width:18,height:18,rx:2,fill:"currentColor",className:e.twotonedclassname}),(0,l.createElement)("path",{d:"M5.781 5C5.35 5 5 5.336 5 5.75v3.5c0 .414.35.75.781.75H9.22c.431 0 .781-.336.781-.75v-3.5c0-.414-.35-.75-.781-.75H5.78Z",fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6Zm4-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3Z",fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 4.714A2.728 2.728 0 0 1 4.635 2h14.732a2.728 2.728 0 0 1 2.635 2.726v14.547A2.728 2.728 0 0 1 19.274 22H4.727A2.728 2.728 0 0 1 2 19.285V4.714Zm3 .91C5 5.28 5.291 5 5.651 5h3.698c.36 0 .651.28.651.625v3.75a.638.638 0 0 1-.651.625H5.65A.638.638 0 0 1 5 9.375v-3.75Z",fill:"currentColor",className:e.fillclassname})))},941555:(e,t,a)=>{a.d(t,{Ay:()=>C,Cg:()=>E});var l=a(868238),n=a(469733),r=a(296540),i=a(165126),o=a(951272),c=a(870443),s=a(860631),m=a(566723),d=a(143811),_=a(294303),u=a(845030),h=a(699784),p=a(768195),v=a(363441),A=a(661065),g=a(100188);const E="screen",b=(0,o.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:e,formName:t=E})=>({[t]:{led_override:e.led_override||p.c_.ON,led_override_color_brightness:e.led_override_color_brightness||v.U,led_override_color:e.led_override_color||v.I}}),validationSchema:c.A.object().shape({led_override:c.A.string(),led_override_color_brightness:c.A.number(),led_override_color:c.A.string()}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),C=(0,l.Zz)(b)(({activeItem:e,setFormDirty:t,values:a,dirty:l,resetForm:o,setFieldValue:c,formName:b=E,disableLedOverrideColor:C,disableLedBrightnessField:O})=>{const f=(0,n.useDispatch)(),I=(0,s.lp)(e);(0,r.useEffect)(()=>{t(b,l)},[t,l,b]),(0,r.useEffect)(()=>(f((0,u.uo)({[b]:()=>{const e=(0,i.A)(a,b);return{...a[b],...e}}})),f((0,u.Oo)({[b]:()=>{o({values:a})}})),f((0,u.rW)({[b]:o})),()=>{f((0,u.uo)({[b]:null})),f((0,u.Oo)({[b]:null})),f((0,u.rW)({[b]:null}))}),[f,b,o,a]);const M=(0,r.useCallback)(e=>{c(`${b}.led_override_color`,e)},[c,b]);return r.createElement(_.A,{alignItems:"center",marginBottom:m.Ln,gap:m.Ln},r.createElement(_.A,null,r.createElement(d.A,{name:"led_override",type:"realCheckbox",checked:a[b].led_override===p.c_.ON,onChange:({target:{checked:e}})=>{c(`${b}.led_override`,e?p.c_.ON:p.c_.OFF)}},r.createElement(h.sA,{id:"COMMON_LED"}))),I&&!C?r.createElement(g.A,{value:a[b].led_override_color||v.I,onChange:M}):null,!O&&I?r.createElement(A.A,{value:a[b].led_override_color_brightness??v.U,onChange:e=>{c(`${b}.led_override_color_brightness`,e)}}):null)})}}]);