(window.webpackJsonpunifiNetworkUi=window.webpackJsonpunifiNetworkUi||[]).push([[19],{2775:function(e,t,a){"use strict";a.r(t);var l=a(0),n=a.n(l),i=a(4),r=a(867),c=a(238),o=a(22),d=a(8),b=a(2912),u=a(3),s=a(1),m=a(2757),v=a(173),E=a(495),O=a(49),h=a(261),f=a(236),N=a(1195),C=a(5),I=a(2846),A=a(2871),_=a(2603),j=a(165);const R=e=>Object(j.a)(e,["wifiScanner","pageNumber"],1);var S=a(1586),g=a(47),p=a(55),w=a(66),y=a(2601),D=a(3119);const T=[{label:"0",value:0},{label:"-10",value:-10},{label:"-20",value:-20},{label:"-30",value:-30},{label:"-40",value:-40},{label:"-50",value:-50},{label:"-60",value:-60},{label:"-70",value:-70},{label:"-80",value:-80},{label:"-90",value:-90},{label:"-100",value:-100}],M=[{label:"0",value:2401},{label:"1",value:2412},{label:"2",value:2417},{label:"3",value:2422},{label:"4",value:2427},{label:"5",value:2432},{label:"6",value:2437},{label:"7",value:2442},{label:"8",value:2447},{label:"9",value:2452},{label:"10",value:2457},{label:"11",value:2462},{label:"12",value:2467},{label:"13",value:2472},{label:"14",value:2484},{label:"15",value:2495}],W=[{label:"30",value:5150},{label:"36",value:5180},{label:"42",value:5210},{label:"48",value:5240},{label:"54",value:5270},{label:"60",value:5300},{label:"66",value:5330},{label:"72",value:5360},{label:"78",value:5390},{label:"84",value:5420},{label:"90",value:5450},{label:"96",value:5480},{label:"112",value:5560},{label:"118",value:5590},{label:"124",value:5620},{label:"130",value:5650},{label:"136",value:5680},{label:"142",value:5710},{label:"148",value:5740},{label:"154",value:5770},{label:"160",value:5800},{label:"165",value:5825},{label:"171",value:5855}],F=Object(u.c)(C.a)`
  #x-labels {
    transform: translateY(-7px);
  }
  #y-labels {
    transform: translate(36px, 3px) !important;
  }
`,x=Object(u.c)(g.a)`
  align-self: flex-start;
  margin-left: 12px;
`,L=Object(u.c)(g.a)`
  position: absolute;
  top: 50%;
  transform: rotate(-90deg) translateX(50%);
`;var B=n.a.memo(({radio:e,data:t,clickedRowId:a,setClickedRowId:i})=>{const r=Object(l.useRef)(null),{width:c,height:d}=Object(o.l)(r),[b,u]=Object(l.useState)(!1),{motif:m}=Object(p.a)(),v=Object(l.useCallback)((e,t)=>(b&&(null==t?void 0:t.id)!==a&&i(null==t?void 0:t.id),null),[i,b,a]);return n.a.createElement(F,{flexDirection:"column",alignItems:"center",width:e===w.b.RADIO_NA?"67%":"33%",onMouseLeave:()=>{u(!1),i(void 0)},onMouseEnter:()=>{u(!0)}},n.a.createElement(x,{color:"primary",weight:"bold"},n.a.createElement(s.b,{id:e===w.b.RADIO_NA?"COMMON_RADIO_BAND_NA":"COMMON_RADIO_BAND_NG"})),n.a.createElement(C.a,{innerRef:r,height:"100%",width:"100%",position:"relative"},n.a.createElement(L,{color:"tertiary",size:"label"},n.a.createElement(s.b,{id:"COMMON_UNIT_DBM"})),n.a.createElement(y.a,{height:Math.round(d),width:Math.round(c),xAxis:e===w.b.RADIO_NG?M:W,yAxis:T,margin:e===w.b.RADIO_NG?[12,32,15,42]:[12,0,15,42]},(e,l,i,r,c)=>n.a.createElement(D.a,{data:t,getCoordinates:e,motif:m,width:c.width,height:c.height,yBaseValue:-100,focusedId:a,showTitle:!0,renderTooltip:v}))),n.a.createElement(g.a,{color:"tertiary",size:"label"},n.a.createElement(s.b,{id:"WIFI_SCANNER_CHART_CHANNELS"})))});const k=Object(u.c)(C.a)`
  border-radius: 8px;
  border: 1px solid ${({theme:e})=>e.motifPalette.neutral04};
`,P=Object(u.c)(C.a)`
  padding: 16px;
`,H=Object(u.c)(g.a)`
  border-bottom: 1px solid ${({theme:e})=>e.motifPalette.neutral04};
  padding: 8px 18px;
`;var U=n.a.memo(Object(s.e)(({offset:e,clickedRowId:t,setClickedRowId:a,intl:l})=>{const{motif:r}=Object(p.a)(),c=l.formatMessage({id:"WIFI_SCANNER_HIDDEN_NETWORK_NAME"}),o=Object(i.useSelector)(t=>Object(I.e)(t,{motif:r,offset:e,hiddenText:c}));return n.a.createElement(k,{width:"100%",height:"45%",flexDirection:"column"},n.a.createElement(H,{color:"primary",weight:"bold"},n.a.createElement(s.b,{id:"WIFI_SCANNER_CHART_HEADING"})),n.a.createElement(P,{width:"100%",height:"100%"},n.a.createElement(B,{radio:w.b.RADIO_NG,data:o.ng,clickedRowId:t,setClickedRowId:a}),n.a.createElement(B,{radio:w.b.RADIO_NA,data:o.na,clickedRowId:t,setClickedRowId:a})))})),z=a(1670),G=a(20),$=a(123),q=a(2897);const Y=Object(u.c)("div")`
  width: 100%;
`;var Z=n.a.memo(({offset:e,setClickedRowId:t})=>{const{sortBy:a,isAscending:r,initialColumns:c}=Object(i.useSelector)(Object(G.B)($.a.WIFI_SCANNER)),o=Object(i.useSelector)(I.a),d=Object(i.useDispatch)(),b=Object(l.useCallback)(e=>{t(e.child?e.parentId:e.id)},[t]);return n.a.createElement(Y,{onMouseLeave:()=>t(void 0)},n.a.createElement(z.a,{items:o,rowLimit:e.rowsPerPage,rowOffset:e.from,columns:q.b,onColumnFilterChanged:({visibleColumns:e})=>{d(Object(G.L)($.a.WIFI_SCANNER,{initialColumns:e.map(({id:e})=>e)}))},onSort:(e,t)=>{d(Object(G.L)($.a.WIFI_SCANNER,{sortBy:e.id,isAscending:t}))},initialSortBy:a,initiallySortAscending:r,rowHeight:32,hideHierarchyLines:!0,hideHierarchyCellBorder:({hierarchy:e})=>!!e,onRowClick:b,columnOverride:c,disableColumnFilters:!0,disableTextPointer:!1}))}),K=a(751),J=a(757);const V=Object(u.c)(C.a,{shouldForwardProp:e=>"rowIndex"!==e})`
  margin-top: 16px;
  tbody {
    tr:nth-child(${({rowIndex:e})=>e}) {
      background: ${({theme:e})=>e.motifPalette.hoverUi01} !important;
    }
  }
`,X=({offset:e,clickedRowId:t,setClickedRowId:a})=>{const l=Object(i.useSelector)(t=>Object(I.c)(t,{offset:e}));return n.a.createElement(n.a.Fragment,null,n.a.createElement(U,{offset:e,clickedRowId:t,setClickedRowId:a}),n.a.createElement(V,{overflow:"auto",height:"55%",rowIndex:(null==l?void 0:l.findIndex(e=>e.id===t))+1},n.a.createElement(Z,{setClickedRowId:a,offset:e})))},Q=()=>{const e=Object(i.useDispatch)(),t=Object(i.useSelector)(I.b),a=Object(i.useSelector)(Object(K.b)("scanner")),l=()=>{const t=document.querySelector("input[role=combobox]");t&&t.focus(),e(Object(J.g)("scanner"))};return t&&a.length?n.a.createElement(m.a,{icon:"noSearchResults",maxWidth:386,detailPadding:35,title:n.a.createElement(s.b,{id:"COMMON_NO_MATCH"}),details:t&&n.a.createElement(s.b,{id:"WIFI_SCANNER_TABLE_SEARCH_DETAILS"}),button:n.a.createElement(v.a,{variant:"primary"},n.a.createElement(s.b,{id:"COMMON_REMOVE_FILTERS"})),onClick:l}):n.a.createElement(m.a,{icon:"noSearchResults",maxWidth:386,detailPadding:35,title:n.a.createElement(s.b,{id:t?"COMMON_NO_MATCH":"WIFI_SCANNER_TABLE_EMPTY_HEADER"}),details:t&&n.a.createElement(s.b,{id:"WIFI_SCANNER_TABLE_FILTER_DETAILS"}),button:t&&n.a.createElement(v.a,{variant:"primary"},n.a.createElement(s.b,{id:"COMMON_BUTTON_RESET_DISPLAY_OPTION"})),onClick:()=>{const t=Object(E.a)(_.a);e(Object(A.b)(t)),e(Object(h.j)(f.a.WIFI_SCANNER,{filters:t}))}})};var ee=()=>{const e=Object(i.useDispatch)(),t=Object(i.useSelector)(I.a),a=Object(i.useSelector)(R),[r,c]=Object(l.useState)(void 0),{initialColumns:o}=Object(i.useSelector)(Object(O.v)(f.a.WIFI_SCANNER));return n.a.createElement(n.a.Fragment,null,t.length&&(null==o?void 0:o.length)?n.a.createElement(N.a,{section:"PAGINATION_SECTION",itemCount:t.length,tableType:f.a.WIFI_SCANNER,onPageChanged:t=>{e(Object(S.b)(t))},pageNumber:a,onRenderTable:e=>n.a.createElement(X,{offset:e,setClickedRowId:c,clickedRowId:r})}):n.a.createElement(Q,null))};var te=function({hours:e}){const t=Object(i.useDispatch)();return Object(l.useEffect)(()=>()=>{t(Object(d.c)(Object(b.fetchWiFiScannerListByTimeAction)(e)))},[]),Object(o.g)([Object(b.fetchWiFiScannerListByTimeAction)(e)],n.a.createElement(ee,null),{renderKey:e,pastDelay:0})};t.default=function(){const e=Object(i.useSelector)(_.b),t=Object(i.useDispatch)();return Object(l.useEffect)(()=>{e||t(Object(A.c)())},[t,e]),Object(o.g)([Object(c.fetchDevicesBasic)(void 0,{crudCacheStrategy:{type:d.a.CACHE}})],n.a.createElement(r.a,null,e&&n.a.createElement(te,{hours:e})))}},2846:function(e,t,a){"use strict";a.d(t,"d",(function(){return C})),a.d(t,"a",(function(){return I})),a.d(t,"c",(function(){return _})),a.d(t,"b",(function(){return j})),a.d(t,"e",(function(){return R})),a.d(t,"f",(function(){return S}));var l=a(9),n=a(1651),i=a(2794),r=a(48),c=a(72),o=a(81),d=a(8),b=a(2606),u=a(49),s=a(123),m=a(2603),v=a(2885),E=a(751);const O=e=>({id:Object(b.c)(e),essid:e.essid||e.bssid,date:new Date(1e3*e.last_seen),...e}),h=e=>Object.values(Object(n.a)(e,"essid")).map(e=>{const t=Object(i.a)(e,({last_seen:e})=>e);return 1===e.length?t:{...t,parent:!0,apCount:e.filter(e=>e!==t).length,children:e.filter(e=>e!==t).map(({essid:e,bssid:a,security:l,radio:n,signal:i,noise:r,...c})=>({...c,hierarchy:1,parentId:t.id}))}}),f=Object(l.a)(e=>{var t;return null===(t=e.models)||void 0===t?void 0:t.wifiScanner},m.b,(e,t)=>{var a;return(null===(a=Object(d.v)(Object(b.b)(t),e))||void 0===a?void 0:a.data)||[]}),N=Object(l.a)(f,e=>e.filter(e=>{var t;return!!(null===(t=null===o.Z||void 0===o.Z?void 0:o.Z[null==e?void 0:e.band])||void 0===t?void 0:t[(null==e?void 0:e.bw)>0?e.bw:null===o.d||void 0===o.d?void 0:o.d[null==e?void 0:e.band]])})),C=Object(l.a)(N,e=>h(e.map(e=>O(e)))),I=Object(l.a)(N,m.c,Object(E.a)("scanner"),(e,t,a)=>h(e.map(e=>O(e)).filter(e=>a?Object(v.b)(e,a):Object(v.a)(e,t)))),A=Object(u.v)(s.a.WIFI_SCANNER),_=Object(l.a)(I,m.c,A,(e,{offset:t})=>t,(e,t,a,{from:l,rowsPerPage:n})=>e.sort((e,t)=>a.isAscending?Object(c.d)(e[null==a?void 0:a.sortBy],t[null==a?void 0:a.sortBy]):-Object(c.d)(e[null==a?void 0:a.sortBy],t[null==a?void 0:a.sortBy])).slice(l,l+n)),j=Object(l.a)(N,e=>(null==e?void 0:e.length)>0),R=Object(l.a)(_,(e,{motif:t})=>t,(e,{hiddenText:t})=>t,(e,t,a)=>{const l=r.a.motifs[t],n=[l.navy06,l.uBlue06,l.aqua06,l.green06,l.lime06,l.yellow06,l.orange06,l.purple06],i={na:[],ng:[]};return Object.keys(i).forEach(t=>{let l=0;i[t]=e.filter(e=>e.band===t).sort((e,t)=>e.center_freq-t.center_freq).map(e=>{var i,r,c,d;n[l]||(l=0);const b=n[l];l+=1;const u=(null==e?void 0:e.bw)>0?null==e?void 0:e.bw:o.d[t];return{id:e.id,title:e.essid||a,xStart:null===(r=null===(i=Object.values(o.Z[t][u]))||void 0===i?void 0:i.find(t=>null==t?void 0:t.subChannels.includes(e.channel)))||void 0===r?void 0:r.lowerFrequency,xEnd:null===(d=null===(c=Object.values(o.Z[t][u]))||void 0===c?void 0:c.find(t=>null==t?void 0:t.subChannels.includes(e.channel)))||void 0===d?void 0:d.upperFrequency,height:e.signal,color:b}})}),i}),S=e=>Object(l.a)(C,t=>t.map(t=>({id:t.id,essid:t.essid,bssid:t.bssid,search_security:t.security||"",search_wifi_standard:t.radio?e.formatMessage({id:"WIFI_SCANNER_PROTOCOL_"+t.radio.toUpperCase()}):"",search_radio_band:t.band?e.formatMessage({id:"COMMON_RADIO_BAND_"+t.band.toUpperCase()}):"",search_vendor:(null==t?void 0:t.oui)||""})))},2854:function(e,t,a){"use strict";var l,n;a.d(t,"a",(function(){return r})),function(e){e[e.START=0]="START",e[e.CLOSE=60]="CLOSE",e[e.FAR=75]="FAR",e[e.END=100]="END"}(l||(l={})),function(e){e[e.START=1]="START",e[e.CLOSE=.9]="CLOSE",e[e.NEAR=.6]="NEAR",e[e.FAR=.3]="FAR",e[e.END=0]="END"}(n||(n={}));const i=(e,t,a,l,n)=>Number(((a-t)/(l-n)*(l-e)+t).toFixed(2)),r=e=>{const t=(e=>e<=l.CLOSE?i(e,n.CLOSE,n.START,l.CLOSE,l.START):e>=l.CLOSE&&e<=l.FAR?i(e,n.NEAR,n.CLOSE,l.FAR,l.CLOSE):i(e,n.END,n.FAR,l.END,l.FAR))(e),a=0,r=93,c=53;return`hsl(${(99-a)*t+a}, ${(100-r)*t+r}%, ${(41-c)*t+c}%)`}},2855:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));const l=[{id:"1D",label:"1D",value:24,isDefault:!0},{id:"1W",label:"1W",value:168},{id:"1M",label:"1M",value:720}]},2870:function(e,t){},2871:function(e,t,a){"use strict";a.d(t,"b",(function(){return c})),a.d(t,"a",(function(){return o})),a.d(t,"c",(function(){return d}));var l=a(398),n=a(194),i=a(2897);const r=i.a.find(({isDefault:e})=>!!e)||i.a[0],c=e=>Object(l.h)({name:n.a.WIFI_SCANNER,value:e}),o=e=>Object(l.e)({name:n.a.WIFI_SCANNER,value:e}),d=()=>o(r.value)},2885:function(e,t,a){"use strict";a.d(t,"b",(function(){return r})),a.d(t,"a",(function(){return c}));var l=a(865),n=a(165),i=a(135);const r=(e,t)=>t.has(e.id),c=(e,t)=>!Object(l.a)(t)&&Object.keys(t).every(a=>{var l,r;switch(a){case"radio":{const l=Object(n.a)(e,"radio");return l&&t[a].includes(l)}default:return Object(i.a)(t[a])?null===(r=null===(l=t[a])||void 0===l?void 0:l.includes)||void 0===r?void 0:r.call(l,e[a]):void 0===e[a]||e[a]===t[a]}})},2897:function(e,t,a){"use strict";a.d(t,"b",(function(){return C})),a.d(t,"a",(function(){return I.a}));var l=a(0),n=a.n(l),i=a(1),r=a(1154),c=a(47),o=a(1643),d=a(3),b=a(10),u=a(776),s=a(2622),m=a(953),v=a(2854),E=a(42),O=a(5);const h=Object(d.c)(r.a)`
  width: 24px;
  margin-left: 7px;
`,f=Object(d.c)(b.b)`
  color: ${({theme:e})=>e.motifPalette.warning};
  margin-right: 5px;
`,N=Object(d.c)(c.a)`
  white-space: nowrap; ;
`,C=[{id:m.b.AP_COUNT,label:n.a.createElement(i.b,{id:m.c[m.b.AP_COUNT]}),minWidth:100,maxWidth:100,sortable:!0,renderCell:({children:e,is_rogue:t,hierarchy:a})=>!a&&(null==e?void 0:e.length)?n.a.createElement(o.a,{type:t||e.find(e=>null==e?void 0:e.is_rogue)?"warning":"primary",value:e.length+1}):null,hideCellBorder:({hierarchy:e})=>!!e,compare:Object(E.b)(e=>{var t;return(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.length)||0})},{id:m.b.ESSID,sortable:!0,label:n.a.createElement(i.b,{id:m.c[m.b.ESSID]}),minWidth:150,omitHideCellOverflow:e=>(null==e?void 0:e.hierarchy)&&(null==e?void 0:e.is_rogue),renderCell:e=>n.a.createElement(c.a,{color:"inherit",size:"body"},(null==e?void 0:e.hierarchy)?(null==e?void 0:e.is_rogue)&&n.a.createElement(O.a,{alignItems:"center"},n.a.createElement(f,null),n.a.createElement(N,{weight:"bold",color:"primary"},n.a.createElement(i.b,{id:"WIFI_SCANNER_TABLE_ROGUE_AP"}))):e.essid||n.a.createElement(i.b,{id:"WIFI_SCANNER_HIDDEN_NETWORK_NAME"}))},{id:m.b.BSSID,sortable:!0,label:n.a.createElement(i.b,{id:m.c[m.b.BSSID]}),minWidth:150,renderCell:e=>n.a.createElement(c.a,{color:"inherit",size:"body"},(null==e?void 0:e.bssid)||null)},{id:m.b.SECURITY,sortable:!0,label:n.a.createElement(i.b,{id:m.c[m.b.SECURITY]}),renderCell:e=>n.a.createElement(c.a,{color:"inherit",size:"body"},(null==e?void 0:e.security)||null),minWidth:150},{id:m.b.WIFI_STANDARD,sortable:!0,label:n.a.createElement(i.b,{id:m.c[m.b.WIFI_STANDARD]}),renderCell:e=>n.a.createElement(c.a,{size:"body",color:"inherit"},(null==e?void 0:e.radio)?n.a.createElement(i.b,{id:"WIFI_SCANNER_PROTOCOL_"+e.radio.toUpperCase()}):null),minWidth:120},{id:m.b.SIGNAL,sortable:!0,label:n.a.createElement(i.b,{id:m.c[m.b.SIGNAL]}),renderCell:e=>n.a.createElement(c.a,{color:"inherit",size:"body"},(null==e?void 0:e.signal)?n.a.createElement(O.a,{alignItems:"center"},null==e?void 0:e.signal,"  ",n.a.createElement(i.b,{id:"COMMON_UNIT_DBM"}),n.a.createElement(h,{variant:"gradient",size:"medium",color:Object(v.a)(Math.abs(null==e?void 0:e.signal)),value:100-Math.abs(null==e?void 0:e.signal)})):n.a.createElement(i.b,{id:"COMMON_HYPHEN"})),minWidth:100},{id:m.b.CHANNEL,sortable:!0,label:n.a.createElement(i.b,{id:m.c[m.b.CHANNEL]}),renderCell:e=>n.a.createElement(c.a,{color:"inherit",size:"body"},(null==e?void 0:e.channel)||null),minWidth:90},{id:m.b.BAND,sortable:!0,label:n.a.createElement(i.b,{id:m.c[m.b.BAND]}),renderCell:e=>n.a.createElement(c.a,{size:"body",color:"inherit"},(null==e?void 0:e.band)?n.a.createElement(i.b,{id:"COMMON_RADIO_BAND_"+e.band.toUpperCase()}):null),minWidth:80},{id:m.b.BW,sortable:!0,label:n.a.createElement(i.b,{id:m.c[m.b.BW]}),renderCell:e=>n.a.createElement(c.a,{color:"inherit",size:"body"},(null==e?void 0:e.bw)?n.a.createElement(n.a.Fragment,null,null==e?void 0:e.bw," ",n.a.createElement(i.b,{id:"COMMON_UNIT_MHZ"})):null),minWidth:80},{id:m.b.OUI,sortable:!0,label:n.a.createElement(i.b,{id:m.c[m.b.OUI]}),renderCell:e=>n.a.createElement(c.a,{color:"inherit",size:"body"},(null==e?void 0:e.oui)||null),minWidth:120},{id:m.b.DATE,sortable:!0,label:n.a.createElement(i.b,{id:m.c[m.b.DATE]}),renderCell:e=>n.a.createElement(c.a,{color:"inherit",size:"body"},n.a.createElement(u.b,{date:e.date})),minWidth:90},{id:m.b.AP_MAC,sortable:!0,label:n.a.createElement(i.b,{id:m.c[m.b.AP_MAC]}),minWidth:120,renderCell:({ap_mac:e})=>n.a.createElement(s.a,{mac:e})}];var I=a(2855)},2912:function(e,t,a){"use strict";var l=a(2606);a.d(t,"fetchWiFiScannerListByTimeAction",(function(){return l.a}));var n=a(2846);a.d(t,"selectWifiScannerSearchData",(function(){return n.f}));a(2870)}}]);