"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[74582],{547120(t,e,n){n.d(e,{T:()=>i,g:()=>o});const i="",o={name:"",internet_access_enabled:!0,network_isolation_enabled:!1,client_mac_list:[],device_mac_list:[]}},612389(t,e,n){n.d(e,{A:()=>m});var i=n(274934),o=n(814557),r=n(938984),a=n(247816),s=n(263705),l=n(309130),d=n(100978);const c=(0,a.A)(r.A)`
  line-height: 20px;
`,m=({icon:t,description:e,action:n,footer:r,background:a,...m})=>{const{themeName:u}=(0,s.u)();return(0,i.jsxs)(d.A,{flexGrow:1,borderRadius:l.YC,padding:l.kc,background:a||o.Ay[`desktop-color-neutral-01-${u}`],gap:l.kc,flexDirection:"column",...m,children:[(0,i.jsxs)(d.A,{flexGrow:1,gap:l.kc,children:[t,e?(0,i.jsx)(c,{size:"medium",children:e}):null,n?(0,i.jsx)(d.A,{marginLeft:"auto",children:(0,i.jsx)(c,{size:"medium",children:n})}):null]}),r]})}},291950(t,e,n){n.d(e,{a:()=>o});var i=n(853777);const o=(0,n(247816).A)(i.A)`
  margin-bottom: 3px;
`},535322(t,e,n){n.d(e,{A:()=>_,I:()=>i});var i,o=n(274934),r=n(814557),a=n(158885),s=n(247816),l=n(565527),d=n(309130),c=n(100978),m=n(291508);!function(t){t.ACCORDION="accordion",t.BUTTON_LIST="buttonList"}(i||(i={}));const u=(0,s.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:t,nested:e,theme:{themeName:n}})=>t||r.Ay[n===l.S.DARK?`desktop-color-neutral-${e?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${e?"01":"00"}-${l.S.LIGHT}`]};
  padding: ${({isButtonList:t,padding:e})=>e||(t?`0 ${d.Ln}`:d.Ln)};
  margin-bottom: ${({marginBottom:t})=>t||d.Ln};
  ${({margin:t})=>t?`margin: ${t};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:t="100%"})=>t};
  flex: ${({flex:t=0})=>t};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:t})=>t?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:t}})=>r.Ay[`desktop-border-divider-${t}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,p=(0,s.A)(a.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:t,nested:e,theme:{themeName:n}})=>t||r.Ay[n===l.S.DARK?`desktop-color-neutral-${e?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${e?"01":"00"}-${l.S.LIGHT}`]};
  margin-bottom: ${({theme:t,marginBottom:e})=>e||t.spacing["spacing-l"]};
  ${({margin:t})=>t?`margin: ${t};`:""}
  ${({padding:t})=>t?`padding: ${t};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:t=0})=>t};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:t,theme:{themeName:e}})=>t||r.Ay[e===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};
      }
    }
  }
`,_=({type:t,marginBottom:e,margin:n,padding:r,flex:a,width:s,nested:l,...d})=>"items"in d?(0,o.jsx)(p,{marginBottom:e,margin:n,padding:r,flex:a,nested:l,...d}):(0,o.jsx)(u,{nested:l,width:s,marginBottom:e,margin:n,padding:r,flex:a,isButtonList:t===i.BUTTON_LIST,...d,children:d.children})},555612(t,e,n){n.d(e,{A:()=>m});var i=n(274934),o=n(602086),r=n(244762),a=n(600191),s=n(247816),l=n(470070),d=n(669439);const c=(0,s.A)(a.A)`
  color: #ffffff;
`,m=(0,o.memo)(({isDisabled:t,showLoader:e,showWarning:n,showWarningIcon:o,warning:a,label:s="COMMON_ACTION_APPLY_CHANGES",onSubmit:m,form:u})=>(0,i.jsx)(d.A,{description:n?a??(0,i.jsx)(l.sA,{id:"COMMON_FORM_CHANGES_TRIGGER_PROVISION"}):null,children:(0,i.jsx)(r.A,{disabled:t,type:"submit",onClick:m,variant:"primary",Icon:n||o?(0,i.jsx)(c,{variant:"fill"}):null,loader:e?"loading":void 0,form:u,children:(0,i.jsx)(l.sA,{id:s})})}))},250266(t,e,n){n.d(e,{A:()=>c});var i=n(274934),o=n(602086),r=n(696264),a=n(409844),s=n(521376),l=n(309130),d=n(470070);const c=({children:t=null,title:e,titleValues:n,message:c,messageValues:m,handleConfirm:u=()=>null,handleClose:p=()=>null,handleCancel:_,isOpen:g,buttonVariant:h="primary",cancelButtonVariant:A="tertiary",cancelButtonMessage:f="COMMON_ACTION_CANCEL",buttonMessage:k="COMMON_ACTION_CONFIRM",buttonDisabled:b=!1,position:x="top",offset:C,showHeaderClose:N=!1,contentClassName:w="",body:v,titleBody:E,className:$,rootClose:I=!1,footerActions:O})=>{const T=(0,o.useCallback)(t=>{g&&(t.stopPropagation(),t.key===s.U.ENTER?u():t.key===s.U.ESCAPE&&p(!1))},[g,u,p]);(0,o.useEffect)(()=>(window.addEventListener("keydown",T,!0),()=>{window.removeEventListener("keydown",T,!0)}),[T]);const R=(0,o.useCallback)(()=>{p(!1),_?.()},[p,_]),y=(0,o.useCallback)(()=>{p(!1),u()},[p,u]),H=(0,o.useMemo)(()=>[{text:(0,i.jsx)(d.sA,{id:f}),variant:A,onClick:R},{text:(0,i.jsx)(d.sA,{id:k}),disabled:b,variant:h,onClick:y}],[k,h,f,A,R,y,b]),L=(0,o.useCallback)(()=>{p(!1)},[p]),M=a.AH`
    ${e?"":`margin-top: ${l.xO}`}
  `;return(0,i.jsx)(r.A,{title:e?(0,i.jsx)(d.sA,{id:e,values:n}):E||null,...c?{body:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.sA,{id:c,values:m}),v]})}:{body:v},position:x,portal:!0,offset:C,actions:O||H,showHeaderClose:N,contentClassName:a.AH`
        ${M}
        ${w}
      `,onRequestClose:L,isOpen:g,allowOverflow:!0,rootClose:I,className:$,children:t})}},309675(t,e,n){n.d(e,{A:()=>s});var i=n(274934),o=n(814557),r=n(600191),a=n(263705);const s=t=>{const{themeName:e}=(0,a.u)();return(0,i.jsx)(r.A,{size:"original",variant:"fill",color:o.Ay[`desktop-color-orange-06-${e}`],...t})}},594492(t,e,n){n.d(e,{A:()=>m});var i=n(274934),o=n(602086),r=n(599110),a=n(247816),s=n(309130),l=n(470070),d=n(291508);const c=(0,a.A)("footer",(0,d.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:t})=>t?"space-between":"flex-end"};
  padding: ${s.S2} ${s.fS};
  gap: ${s.kc};
`,m=({allowCancel:t,isDirty:e,isInvalid:n,isSubmitting:a,onFormSubmit:s,onFormReset:d,onFormCancel:m,className:u,submitButtonText:p,customButton:_,applyButton:g,applyButtonFirst:h,hideCancelButton:A,form:f})=>{const k=(0,o.useMemo)(()=>g||(0,i.jsx)(r.A,{name:"submit",variant:"primary",type:"submit",onClick:s,disabled:!e||n||a,form:f,children:(0,i.jsx)(l.sA,{id:p||"COMMON_ACTION_APPLY_CHANGES"})}),[g,f,e,n,a,s,p]);return(0,i.jsxs)(c,{className:u,hasFormResetButton:!!d,children:[h?k:_,A?null:(0,i.jsx)(r.A,{name:"cancel",variant:"default",type:"button",onClick:m,disabled:!t&&!e,children:(0,i.jsx)(l.sA,{id:"COMMON_ACTION_CANCEL"})}),d?(0,i.jsx)(r.A,{name:"reset",variant:"default",type:"button",onClick:d,disabled:!e,children:(0,i.jsx)(l.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})}):null,h?_:k]})}},115114(t,e,n){n.d(e,{A:()=>c});var i=n(274934),o=n(232932),r=n(247816),a=n(409844),s=n(594492);const l=(0,r.A)("div")`
  height: 66px;
`,d=a.AH`
  padding: 0px !important;
`,c=({isDirty:t,onFormSubmit:e,onFormCancel:n,isInvalid:r,...a})=>t?(0,i.jsx)(o.A,{children:(0,i.jsx)(s.A,{isDirty:t,onFormCancel:n,onFormSubmit:e,isInvalid:r,className:d,...a})}):(0,i.jsx)(l,{})},521376(t,e,n){var i;n.d(e,{U:()=>i}),function(t){t.ARROW_LEFT="ArrowLeft",t.ARROW_RIGHT="ArrowRight",t.ARROW_DOWN="ArrowDown",t.ARROW_UP="ArrowUp",t.ENTER="Enter",t.ESCAPE="Escape",t.BACKSPACE="Backspace",t.DELETE="Delete",t.TAB="Tab"}(i||(i={}))},61322(t,e,n){n.d(e,{I:()=>i});const i={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(t,e,n,i){return Math.min((i||this.ROW_HEIGHT)*t+(n??this.HEADER_HEIGHT),(i||this.ROW_HEIGHT)*e+(n??this.HEADER_HEIGHT))},getEditContainerHeight(t,e,n){return Math.min((n||this.EDIT_FIELD_HEIGHT)*t,(n||this.EDIT_FIELD_HEIGHT)*e)}}},969819(t,e,n){n.d(e,{GJ:()=>g,Sn:()=>C,US:()=>i,Xs:()=>x,bO:()=>A,gJ:()=>f,ki:()=>b,uj:()=>k});var i,o=n(602086),r=n(977872),a=n(539140),s=n(826022),l=n(994177),d=n(904614),c=n(423564),m=n(754924),u=n(197571),p=n(347625);!function(t){t.WIFI="wifi",t.MGMT="mgmt",t.VNO="vno"}(i||(i={}));const _=(t,e)=>{if(t?.port_table&&null!=e)return t.port_table.find(t=>t.port_idx===e)},g=(t,e)=>!(!t||!e||(0,s.cd)(e,t.tagged_vlan_mgmt,t.native_networkconf_id,t.excluded_networkconf_ids)),h=(t,e)=>{const n=e.find(e=>e._id===t);return n?(0,c.gm)(n):t},A=t=>t.find(t=>t.attr_no_delete&&"LAN"===t.attr_hidden_id)?._id,f=({mac:t,devicesMap:e,wlanConfigs:n,apGroups:o,networks:r,clients:s,defaultNetworkId:c,isVlanCarried:m,seen:u,base:_})=>{const g=[],A=e.get(t);if(A&&(t=>(0,l.j)(t.model)?.deviceCapabilities?.includes(a.t.ACCESS_POINT)??!1)(A)){const e=((t,e,n)=>e.filter(e=>{if(!e.enabled)return!1;if(e.ap_group_mode===d.qq.ALL)return!0;const i=new Set(e.ap_group_ids??[]);return n.some(e=>i.has(e._id)&&e.device_macs?.includes(t))}))(t,n,o);for(const n of e){const e=n.networkconf_id;if(!e||e===c)continue;const o=`${t}:${e}`;u.has(o)||(u.add(o),m(e)||g.push({networkName:h(e,r),entityName:(0,p.Q)(A),reason:i.WIFI,..._}))}}if(A?.mgmt_network_id){const e=A.mgmt_network_id;if(e!==c){const n=`${t}:mgmt:${e}`;u.has(n)||(u.add(n),m(e)||g.push({networkName:h(e,r),entityName:(0,p.Q)(A),reason:i.MGMT,..._}))}}if(!A){const e=s.find(e=>"mac"in e&&e.mac===t);if(e&&"virtual_network_override_enabled"in e&&e.virtual_network_override_enabled){const n=e.virtual_network_override_id;if(n&&n!==c){const o=`${t}:vno:${n}`;u.has(o)||(u.add(o),m(n)||g.push({networkName:h(n,r),entityName:e.display_name||e.name||t,reason:i.VNO,..._}))}}}return g},k=(t,e)=>{const n=t.uplink?.uplink_mac??t.last_uplink?.uplink_mac,i=t.uplink?.uplink_remote_port??t.last_uplink?.uplink_remote_port,o=t.uplink?.port_idx??t.last_uplink?.port_idx,r=n?e.get(n):void 0;return{localPort:_(t,o),remotePort:_(r,i)}},b=(t,e)=>{const n=(0,r.d4)(m.Kh);return(0,o.useMemo)(()=>{if(!t||!e)return{hasConflict:!1,localPortMissing:!1,remotePortMissing:!1};const{localPort:i,remotePort:o}=k(t,n),r=g(o,e),a=g(i,e);return{hasConflict:r||a,localPortMissing:a,remotePortMissing:r}},[t,e,n])},x=(t,e,n,i,o)=>{if(!t)return;if(null!=e){const r=i.get(t),a=_(r,e);if(!a||!g(a,n))return;return{networkName:h(n,o),switchName:(0,p.Q)(r??{mac:t}),port:e}}const r=i.get(t),a=r?.uplink?.uplink_mac??r?.last_uplink?.uplink_mac,s=r?.uplink?.uplink_remote_port??r?.last_uplink?.uplink_remote_port;if(!a||null==s)return;const l=i.get(a),d=_(l,s);return d&&g(d,n)?{networkName:h(n,o),switchName:(0,p.Q)(l??{mac:a}),port:s,apName:(0,p.Q)(r??{mac:t})}:void 0},C=(t,e,n,i)=>{const a=(0,r.d4)(m.Kh),s=(0,r.d4)(u.Tn);return(0,o.useMemo)(()=>{if(i&&n)return x(t,e,n,a,s)},[i,t,e,n,a,s])}}}]);