(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[89965,99421],{38671:(e,t,a)=>{"use strict";function n(e){return"object"==typeof e&&!!e&&"apiMsg"in e&&"status"in e}a.d(t,{F:()=>n})},55983:(e,t,a)=>{"use strict";a.d(t,{Ai:()=>E,Ar:()=>s,Qv:()=>l,ZP:()=>o,aY:()=>i,p6:()=>r});var n=a(448547);const r="alarm-manager",i="control-plane",E=`${i}/integrations`,s=`${i}/backups`,l="admins",o=Object.values(n.Kr)},137625:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(296540),r=a(353899),i=a(132196),E=a(372737),s=a(566723),l=a(699784);const o=({children:e=null,title:t,titleValues:a,message:o,messageValues:_,handleConfirm:A=()=>null,handleClose:c=()=>null,handleCancel:d,isOpen:T,buttonVariant:m="primary",cancelButtonVariant:S="tertiary",cancelButtonMessage:u="COMMON_ACTION_CANCEL",buttonMessage:N="COMMON_ACTION_CONFIRM",buttonDisabled:h=!1,position:O="top",showHeaderClose:p=!1,contentClassName:C="",body:I,titleBody:D,className:R,rootClose:M=!1,footerActions:L})=>{const b=(0,n.useCallback)(e=>{T&&(e.stopPropagation(),e.key===E.U.ENTER?A():e.key===E.U.ESCAPE&&c(!1))},[T,A,c]);(0,n.useEffect)(()=>(window.addEventListener("keydown",b,!0),()=>{window.removeEventListener("keydown",b,!0)}),[b]);const g=(0,n.useCallback)(()=>{c(!1),d?.()},[c,d]),v=(0,n.useCallback)(()=>{c(!1),A()},[c,A]),P=(0,n.useMemo)(()=>[{text:n.createElement(l.sA,{id:u}),variant:S,onClick:g},{text:n.createElement(l.sA,{id:N}),disabled:h,variant:m,onClick:v}],[N,m,u,S,g,v,h]),w=(0,n.useCallback)(()=>{c(!1)},[c]),H=i.AH`
    ${t?"":`margin-top: ${s.xO}`}
  `;return n.createElement(r.A,{title:t?n.createElement(l.sA,{id:t,values:a}):D||null,...o?{body:n.createElement(n.Fragment,null,n.createElement(l.sA,{id:o,values:_}),I)}:{body:I},position:O,portal:!0,actions:L||P,showHeaderClose:p,contentClassName:i.AH`
        ${H}
        ${C}
      `,onRequestClose:w,isOpen:T,allowOverflow:!0,rootClose:M,className:R},e)}},199582:(e,t,a)=>{"use strict";a.d(t,{L:()=>n});const n="data-testid"},248543:(e,t,a)=>{"use strict";a.d(t,{J:()=>n,g:()=>r});const n=()=>document.getElementById("modal-container"),r=()=>document.getElementById("modal-settings-container")},263130:(e,t,a)=>{"use strict";a.d(t,{A:()=>_});var n=a(296540),r=a(927099),i=a(71479),E=a(998837),s=a(566723),l=a(294303);const o=(0,i.A)(r.A)`
  line-height: 20px;
`,_=({icon:e,description:t,action:a,footer:r,background:i,..._})=>{const A=(0,E.u)().motifPalette.neutral01;return n.createElement(l.A,{flexGrow:1,borderRadius:s.YC,padding:s.kc,background:i||A,gap:s.kc,flexDirection:"column",..._},n.createElement(l.A,{flexGrow:1,gap:s.kc},e,t?n.createElement(o,{size:"body"},t):null,a?n.createElement(l.A,{marginLeft:"auto"},n.createElement(o,{size:"body"},a)):null),r)}},266659:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n=[{fullLabel:"COMMON_DAY_MONDAY",shortLabel:"COMMON_DAY_SHORT_MONDAY",abbreviationLabel:"COMMON_DAY_SHORTER_MONDAY",value:1},{fullLabel:"COMMON_DAY_TUESDAY",shortLabel:"COMMON_DAY_SHORT_TUESDAY",abbreviationLabel:"COMMON_DAY_SHORTER_TUESDAY",value:2},{fullLabel:"COMMON_DAY_WEDNESDAY",shortLabel:"COMMON_DAY_SHORT_WEDNESDAY",abbreviationLabel:"COMMON_DAY_SHORTER_WEDNESDAY",value:3},{fullLabel:"COMMON_DAY_THURSDAY",shortLabel:"COMMON_DAY_SHORT_THURSDAY",abbreviationLabel:"COMMON_DAY_SHORTER_THURSDAY",value:4},{fullLabel:"COMMON_DAY_FRIDAY",shortLabel:"COMMON_DAY_SHORT_FRIDAY",abbreviationLabel:"COMMON_DAY_SHORTER_FRIDAY",value:5},{fullLabel:"COMMON_DAY_SATURDAY",shortLabel:"COMMON_DAY_SHORT_SATURDAY",abbreviationLabel:"COMMON_DAY_SHORTER_SATURDAY",value:6},{fullLabel:"COMMON_DAY_SUNDAY",shortLabel:"COMMON_DAY_SHORT_SUNDAY",abbreviationLabel:"COMMON_DAY_SHORTER_SUNDAY",value:0}]},321296:()=>{},333422:(e,t,a)=>{"use strict";a.d(t,{AC:()=>d,D7:()=>T,Ie:()=>C,JL:()=>N,JX:()=>p,KY:()=>m,O2:()=>c,Op:()=>A,Rm:()=>S,e$:()=>h,t7:()=>u,yr:()=>O});var n=a(927099),r=a(822336),i=a(71479),E=a(132196),s=a(311785),l=a(596441),o=a(566723),_=a(294303);const A=(0,i.A)(_.A,(0,s.A)("inline","wrap"))`
  position: relative;
  flex: ${({inline:e})=>e?"1 1 0":"0 0 100%"};
  align-items: flex-start;
  flex-flow: ${({wrap:e})=>"row "+(e?"wrap":"nowrap")};
  gap: ${o.kc};
`,c=(0,i.A)(_.A,{shouldForwardProp:e=>"editMaxHeight"!==e})`
  flex-direction: column;
  max-height: ${({editMaxHeight:e})=>`${e||300}px`};
  overflow-y: auto;
  overflow-x: hidden;
  gap: ${o.YC};
`,d=(0,i.A)("div",{shouldForwardProp:e=>!["isWindowsTable","rows","tableMaxHeight","marginTop"].includes(e)})`
  width: 100%;
  // windows table inherits height from parent container
  height: ${({rows:e,isWindowsTable:t})=>t&&`${l.I.ROW_HEIGHT*e+l.I.HEADER_HEIGHT}`}px;
  max-height: ${({tableMaxHeight:e})=>`${e}px`||"auto"};
  margin-top: ${({marginTop:e})=>e||o.Ln};

  table {
    td {
      max-width: 170px;

      span {
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
`,T=(0,i.A)(n.A)`
  margin-right: ${o.YC};
`,m=E.AH`
  :first-of-type {
    padding: 0 ${o.fS} 0 0px;
  }
`,S="drag-and-drop-table-row-placeholder",u=(0,i.A)(_.A)`
  flex-direction: column;

  /* Adjust weird padding on the right side for the ID column when right aligned (drag & drop table) */
  table > thead > tr > th:last-of-type {
    padding-right: ${o.kc};
  }

  /* Add missing border between drag and drop groups (tbody elements) */
  table > tbody {
    border-bottom: ${({theme:{themeName:e}})=>r.Ay[`desktop-border-divider-${e}`]};
  }
  /* Last cell in table is hover content which is not used in this table */
  table > tbody[data-rbd-droppable-context-id] td:not(:last-of-type),
  table > thead > tr > th {
    /* Align drag & drop table cell padding to regular table padding */
    padding-right: ${o.kc} !important;
  }
  /* Align drop zone placeholder row when a row is dragged to matched the CSS overrides for drag and drop table we use */
  table .${S} {
    display: flex;
  }
`,N=E.AH`
  /* This is default for the table rows, so we need it for the header. */
  display: flex;
  width: 100%;

  > th:first-child {
    /* Since we flex the header, we must specify this to align with the table rows. */
    width: 24px;
  }
  > th:not(:first-child) {
    /* Something inside UIC sets the padding to 8px for table header and 5px for table rows. This aligns it to make flex work. */
    padding-right: ${o.kc} !important;
  }
`,h=E.AH`
  /* Override the padding-right of the first column to align with manage + drop modes. */
  > th:first-child {
    padding-right: ${o.kc} !important;
  }
  > th:first-child:has(> label) {
    padding-right: 1px !important;
    width: 36px;
  }
`,O=E.AH`
  /* UIC already does this for some table states, like drag and drop and when in manage mode. If we just use this ALWAYS, we're avoiding many issues related to using different alignment techniques in different places. */
  display: flex;
`,p=E.AH`
  tbody {
    display: flex;
    flex-direction: column;
  }
`;function C(e,t){return E.AH`
    width: ${t.width?`${t.width}px`:"auto"};
    min-width: ${t.minWidth?`${t.minWidth}px`:"0px"};
    flex: ${t.growthFactor||0} !important;
    padding-left: ${o.kc} !important;
    padding-right: ${o.kc} !important;
  `}},335928:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(951272),r=a(465543);const i=()=>{const{dirty:e}=(0,n.j7)();return(0,r.w)(e),null}},372737:(e,t,a)=>{"use strict";var n;a.d(t,{U:()=>n}),function(e){e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape"}(n||(n={}))},383725:(e,t,a)=>{"use strict";var n;a.d(t,{b:()=>n}),function(e){e.DASHBOARD_WAN_GRAPH="dashboard-wan-graph",e.DASHBOARD_WIFI_GRAPH="dashboard-wifi-graph",e.DASHBOARD_FLOWS_GRAPH="dashboard-flows-graph",e.DASHBOARD_PANEL_LIVE_ACTIVITY="dashboard-panel-live-activity",e.DASHBOARD_PANEL_SPEED_TEST_ACTIVITY="dashboard-panel-speed-test-activity",e.INTERNET_HEALTH="internet-health",e.ISP_UPTIME="isp-uptime",e.SYSTEM_UPTIME="system-uptime",e.NETWORK_DASHBOARD="network-dashboard",e.DASHBOARD_LOADER="dashboard-loader",e.DASHBOARD_UNIFI_OS_VERSION="dashboard-unifi-os-version",e.DASHBOARD_NETWORK_VERSION="dashboard-network-version",e.HOTSPOT_PORTAL_MINIMIZER="hotspot-portal-minimizer",e.HOTSPOT_PORTAL_SETTINGS_RESTORE_DEFAULT="hotspot-portal-settings-restore-default",e.HOTSPOT_PORTAL_PREVIEW_BACKGROUND="hotspot-portal-preview-background",e.HOTSPOT_PORTAL_PREVIEW_CONTAINER="hotspot-portal-preview-container",e.HOTSPOT_PORTAL_PREVIEW_LOGO="hotspot-portal-preview-logo",e.HOTSPOT_PORTAL_PREVIEW_LANGUAGE="hotspot-portal-preview-language",e.HOTSPOT_PORTAL_PREVIEW_TITLE="hotspot-portal-preview-title",e.HOTSPOT_PORTAL_PREVIEW_WELCOME_TEXT="hotspot-portal-preview-welcome-text",e.HOTSPOT_PORTAL_PREVIEW_AUTHENTICATION_TEXT="hotspot-portal-preview-authentication-text",e.HOTSPOT_PORTAL_PREVIEW_BUTTON_TEXT="hotspot-portal-preview-button-text",e.HOTSPOT_PORTAL_PREVIEW_HOTSPOT_PACKAGES="hotspot-portal-preview-hotspot-packages",e.HOTSPOT_PORTAL_PREVIEW_FACEBOOK="hotspot-portal-preview-facebook",e.HOTSPOT_PORTAL_PREVIEW_VOUCHER="hotspot-portal-preview-voucher",e.HOTSPOT_PORTAL_PREVIEW_PASSWORD="hotspot-portal-preview-password",e.HOTSPOT_PORTAL_PREVIEW_RADIUS="hotspot-portal-preview-radius",e.HOTSPOT_PORTAL_BRANDING_INFORMATION="hotspot-portal-branding-information",e.HOTSPOT_PORTAL_BRANDING_SUCCESS="hotspot-portal-branding-success",e.HOTSPOT_PORTAL_BRANDING_LOGO="hotspot-portal-branding-logo",e.WATCHLIST_TABLE="watchlist-table",e.PROBLEMATIC_CLIENTS_TABLE="problematic-clients-table",e.NETWORK_VERSION="network-version",e.PLAY_PAUSE_BUTTON="play-pause-button",e.CONTROL_PANEL_HEADER="control-panel-header",e.CONTROL_PANEL_HEADER_FILTER_BUTTON="control-panel-header-filter-button",e.HEADER_SIGNOUT_BUTTON="header-signout-button",e.HEADER_USERICON="header_usericon",e.RESTORE_COLUMNS_BUTTON="restore-columns-button",e.WIFI_SECURITY_PROTOCOLS="wifi-security-protocols",e.WIFI_BANDWIDTH_PROFILE="wifi-bandwidth-profile",e.WIFI_PMF_MODE="wifi-pmf-mode",e.WIFI_VLAN_BANDS="wifi-vlan-bands",e.NETWORKCONF_ID="networkconf-id",e.APS_TABLE="aps-table",e.AP_GROUPS_TABLE="ap-groups-table",e.IP_ADDRESS_DROPDOWN="ip-address-dropdown",e.TUNNEL_SUBNET="tunnel-subnet",e.COPY_WIREGUARD_PUBLIC_KEY="copy-wireguard-public-key",e.IPSEC_ESP_LIFETIME_CONTAINER="ipsec-esp-lifetime-container",e.IPSEC_ESP_DH_GROUP_CONTAINER="ipsec-esp-dh-group-container",e.IPSEC_ESP_HASH_CONTAINER="ipsec-esp-hash-container",e.IPSEC_ESP_ENCRYPTION_CONTAINER="ipsec-esp-encryption-container",e.IPSEC_IKE_LIFETIME_CONTAINER="ipsec-ike-lifetime-container",e.IPSEC_IKE_HASH_CONTAINER="ipsec-ike-hash-container",e.IPSEC_IKE_ENCRYPTION_CONTAINER="ipsec-ike-encryption-container",e.EXTRAS_CONTAINER="extras-container",e.TELEPORT_LINK_EXPIRY="teleport-link-expiry",e.TELEPORT_TOKEN_TABLE="teleport-token-table",e.NETWORK_SUBNET_DROPDOWN="network-subnet-dropdown",e.NETWORKS_TABLE="networks-table",e.WS_USERS_TABLE="ws-users-table",e.TOGGLE_DHCP_MANAGEMENT="toggle-dhcp-management",e.DHCP_MODE_DROPDOWN="dhcp-mode-dropdown",e.ADD_NEW_DHCP_OPTION="add-new-dhcp-option",e.TOPOLOGY_FILTER_CONTROL="topology-filter-control",e.TOPOLOGY_ROTATION="topology-rotation",e.SETTINGS_DEVICE_UPDATE_CACHE="settings-device-update-cache",e.SETTINGS_DEVICE_UPDATE_SCHEDULE="settings-device-update-schedule",e.SETTINGS_DEVICE_FIRMWARE="settings-device-firmware",e.SETTINGS_DEVICE_FIRMWARE_RELEASE_CHANNEL="settings-device-firmware-release-channel",e.SETTINGS_EARLY_ACCESS_RELEASE_CHANNELS="settings-early-access-release-channels",e.SETTINGS_NETWORKS_NEW_VIRTUAL_NETWORK="settings-networks-new-virtual-network",e.LOGS_CATEGORY_PICKER="logs-category-picker",e.LOGS_SUBCATEGORY_PICKER="logs-subcategory-picker",e.LOGS_EVENT_PICKER="logs-event-picker",e.LOGS_SETTINGS="logs-settings",e.LOGS_RELOAD="logs-reload",e.PUSH_NOTIFICATIONS_PICKER="push-notifications-picker",e.VIEWER_NETWORK="viewer-network",e.VIEWER_INTERNET="viewer-internet",e.VIEWER_VPN_SERVER="viewer-vpn-server",e.VIEWER_VPN_CLIENT="viewer-vpn-client",e.VIEWER_POLICY_BASED_ROUTING="viewer-policy-based-routing",e.VIEWER_FIREWALL_RULES="viewer-firewall-rules",e.VIEWER_NAT="viewer-nat",e.VIEWER_SITE_TO_SITE_VPN="viewer-site-to-site-vpn",e.VIEWER_WIFI="viewer-wifi",e.CREATE_FIREWALL_ZONE_BUTTON="create-firewall-zone-button",e.CREATE_FIREWALL_POLICY_BUTTON="create-firewall-policy-button",e.FIREWALL_POLICY_ORDER_BUTTON="firewall-policy-order-button",e.POLICY_BASED_ROUTES_DOMAIN="editable-grid-table-wrapper-domains",e.ACL_POLICY_FORM_TYPE="acl-policy-form-type",e.ACL_POLICY_FORM_SOURCE="acl-policy-form-source",e.ACL_POLICY_FORM_ACTION="acl-policy-form-action",e.ACL_POLICY_FORM_DESTINATION="acl-policy-form-destination",e.VIEWER_CONTENT_FILTER="viewer-content-filter",e.CLIENTS_FILTER_FOOTER="clients-filter-footer",e.CLIENTS_FILTER_CONTENT="clients-filter-content",e.VIEWER_ETHERNET_PORTS_PROFILE="viewer-ethernet-ports-profile",e.VIEWER_WAN_SLA="viewer-wan-sla",e.VIEWER_NETWORK_LISTS="viewer-network-lists",e.VIEWER_WIFI_SPEED_LIMIT_PROFILE="viewer-wifi-speed-limit-profile",e.VIEWER_RADIUS_PROFILE="viewer-radius-profile"}(n||(n={}))},465543:(e,t,a)=>{"use strict";a.d(t,{w:()=>E});var n=a(469733),r=a(296540),i=a(845030);const E=e=>{const t=(0,n.useDispatch)();(0,r.useEffect)(()=>{t((0,i.SQ)(e))},[t,e])}},476703:(e,t,a)=>{"use strict";a.d(t,{vM:()=>E,K4:()=>l,Pt:()=>s});var n=a(691189);const r="scheduledUpgrades",i="/api/s/{site}/rest/scheduletask",E=e=>(0,n.t9)(r,`${i}?action=upgrade`,void 0,{crudCacheStrategy:e,idField:"_id"}),s=e=>t=>{const{_id:a}=e;return t(a?(0,n.vL)(r,a,`${i}/${a}`,{action:"upgrade",...e}):(0,n.eC)(r,i,{action:"upgrade",...e}))},l=e=>(0,n.LK)(r,e,`${i}/${e}`)},534637:(e,t,a)=>{"use strict";a.d(t,{H:()=>_});var n=a(469733),r=a(296540),i=a(282556),E=a(294303),s=a(699784),l=a(602021),o=a(198494);const _=({lastQuery:e=0,height:t})=>{const a=(0,n.useSelector)(o.BQ),_=(0,n.useSelector)(i.zi),A=(0,n.useSelector)(l.hq);return r.createElement(E.A,{alignItems:"center",height:t},r.createElement(s.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_CHECK_QUERY_STATUS_LABEL"})," ",e>0?r.createElement("span",null,new Intl.DateTimeFormat(_,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hourCycle:a,timeZone:A}).format(new Date(1e3*e))):r.createElement(s.sA,{id:"COMMON_STATUS_NEVER"}))}},535240:(e,t,a)=>{"use strict";a.d(t,{I:()=>r,R:()=>i});var n=a(823881);const r={[n.wN.RELEASE]:"SETTINGS_CONTROLLER_ADVANCED_UPDATES_SELECT_CHANNEL_OFFICIAL",[n.wN.RELEASE_CANDIDATE]:"SETTINGS_CONTROLLER_ADVANCED_UPDATES_SELECT_CHANNEL_RELEASE_CANDIDATE",[n.wN.BETA]:"SETTINGS_EARLY_ACCESS",[n.wN.ALPHA]:"SETTINGS_CONTROLLER_ADVANCED_UPDATES_SELECT_CHANNEL_ALPHA",[n.wN.INTERNAL]:"COMMON_INTERNAL"},i=[n.wN.RELEASE,n.wN.RELEASE_CANDIDATE,n.wN.BETA,n.wN.ALPHA,n.wN.INTERNAL]},556456:(e,t,a)=>{"use strict";a.d(t,{XU:()=>d,YQ:()=>T,aB:()=>c,g0:()=>h,jO:()=>m,tx:()=>A,yB:()=>_,yE:()=>u,zn:()=>N});var n=a(801081),r=a(874807),i=a(187483),E=a(448547),s=a(524332),l=a(55983);const o=(0,n.Mz)(i.kb,e=>e[E.C2.SWAI_ROUTES]||[]),_=(0,n.Mz)(o,e=>e.filter(e=>l.ZP.every(t=>!e[s.rR.PATH].startsWith(t)))),A=(0,n.Mz)(_,e=>e.filter(e=>!e[s.rR.IS_HIDDEN])),c=(0,n.Mz)(o,e=>e.filter(e=>e[s.rR.PATH].startsWith(E.Kr.SETTINGS))),d=(0,n.Mz)(c,e=>e.filter(e=>!e[s.rR.IS_HIDDEN])),T=(0,n.Mz)(o,e=>e.filter(e=>e[s.rR.PATH].startsWith(E.Kr.SYSLOG))),m=(0,n.Mz)(T,e=>e.filter(e=>!e[s.rR.IS_HIDDEN])),S=e=>(0,n.Mz)(o,t=>t.some(t=>t[s.rR.PATH].includes(e)&&!t[s.rR.IS_HIDDEN])),u=(0,n.Mz)(S(l.aY),e=>e),N=(0,n.Mz)(S(l.p6),e=>e),h=(0,n.Mz)(i.nx,e=>e[E.Y7.ROUTES_ADAPTER]||{[s.bh.ROUTES]:[],[s.bh.ADD_ROUTES_LISTENER]:r.P1,[s.bh.REMOVE_ROUTES_LISTENER]:r.P1,[s.bh.ON_ROUTE_CONTAINER_ADDED]:r.P1,[s.bh.ON_ROUTE_CONTAINER_REMOVED]:r.P1})},586371:(e,t,a)=>{"use strict";var n;a.d(t,{EE:()=>i,Uh:()=>n,Vf:()=>r}),function(e){e.SINGLE="single",e.PLURAL="plural"}(n||(n={}));const r="editActive",i=20},596441:(e,t,a)=>{"use strict";a.d(t,{I:()=>n});const n={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(e,t,a,n){return Math.min((n||this.ROW_HEIGHT)*e+(a??this.HEADER_HEIGHT),(n||this.ROW_HEIGHT)*t+(a??this.HEADER_HEIGHT))},getEditContainerHeight(e,t,a){return Math.min((a||this.EDIT_FIELD_HEIGHT)*e,(a||this.EDIT_FIELD_HEIGHT)*t)}}},659240:(e,t,a)=>{"use strict";a.d(t,{hr:()=>l,nu:()=>o,jx:()=>_});var n=a(691189),r=a(457311),i=a(294201),E=a(8046);const s="/api/s/{site}/cmd/productinfo",l=()=>(0,n.Xj)(i.A.CHECK_FIRMWARE_UPDATE,s,{}),o=({username:e,password:t,token:a,poll_login:l})=>async(o,_)=>{const A=await o((0,n.Xj)(i.A.REFRESH_SSO,`${s}/${i.A.REFRESH_SSO}`,{sso_username:l?void 0:e,sso_password:l?void 0:t,sso_2fa_token:l?void 0:a,poll_login:l||void 0,mfa_cookie:l?(0,E.md)(_()):void 0}));return await o((0,r.Uc)()),Promise.resolve(A)},_=({id:e,type:t})=>(a,r)=>{const s=(0,E.md)(r());return a((0,n.Xj)(i.A.RESEND_MFA_CODE,`/v2/api/mfa/${t}/${e}/send`,s?{mfa_cookie:s}:{},{fetchConfig:{getAllPostResponse:!0}},!0))}},669186:(e,t,a)=>{var n={"./en-au":753872,"./en-au.js":753872,"./en-ca":928298,"./en-ca.js":928298,"./en-gb":956195,"./en-gb.js":956195,"./en-ie":866584,"./en-ie.js":866584,"./en-il":65543,"./en-il.js":65543,"./en-in":9033,"./en-in.js":9033,"./en-nz":479402,"./en-nz.js":479402,"./en-sg":343004,"./en-sg.js":343004};function r(e){var t=i(e);return a(t)}function i(e){if(!a.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=i,e.exports=r,r.id=669186},689965:(e,t,a)=>{"use strict";a.d(t,{A:()=>d,I:()=>n});var n,r=a(296540),i=a(822336),E=a(427853),s=a(71479),l=a(825032),o=a(566723),_=a(294303);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(n||(n={}));const A=(0,s.A)(_.A,{shouldForwardProp:e=>!["marginBottom","isButtonList","margin","flex","width","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:a}})=>e||i.Ay[a===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:a})=>a||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({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}})=>i.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,c=(0,s.A)(E.A,{shouldForwardProp:e=>!["marginBottom","margin","flex","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:a}})=>e||i.Ay[a===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-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||i.Ay[t===l.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${o.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0 ${o.Ln} ${o.Ln};
      > div {
        padding: 0;
      }
    }
  }
`,d=({type:e,marginBottom:t,margin:a,padding:i,flex:E,width:s,nested:l,...o})=>"items"in o?r.createElement(c,{marginBottom:t,margin:a,padding:i,flex:E,nested:l,...o}):r.createElement(A,{nested:l,width:s,marginBottom:t,margin:a,padding:i,flex:E,isButtonList:e===n.BUTTON_LIST,...o},o.children)},705426:(e,t,a)=>{"use strict";a.d(t,{A:()=>E});var n=a(296540),r=a(617147),i=a(248543);const E=({children:e=null,hideModal:t,onRequestClose:a,portalSelector:E=i.J,forwardedRef:s=null,...l})=>n.createElement(r.A,{isOpen:!0,shouldCloseOnEsc:!0,onRequestClose:a||t,parentSelector:E,ref:s,...l},e)},821580:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(296540),r=a(454195),i=a(566723),E=a(294303);const s=e=>n.createElement(E.A,{paddingTop:i.YC,paddingBottom:i.YC,gap:i.Ln,rowGap:i.YC,flexWrap:"wrap",minHeight:r.b,alignItems:"center",...e})},823084:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(296540),r=a(162420),i=a(998837),E=a(263130);const s=({children:e,icon:t,background:a,...s})=>{const{motifPalette:{uBlue06:l}}=(0,i.u)();return n.createElement(E.A,{icon:t||n.createElement(r.A,{variant:"fill",size:"original",color:l}),description:e,background:a,...s})}},834042:(e,t,a)=>{"use strict";a.d(t,{EJ:()=>o,gy:()=>s,oP:()=>E,pi:()=>i,q8:()=>l,t:()=>r});var n=a(621690);const r=60,i=24,E=({minuteOfDay:e,use24HourFormat:t,formatMessage:a})=>{const n=Math.floor(e/60);return`${String(t?n:n%12||12).padStart(2,"0")}:${String(e%r).padStart(2,"0")}${t?"":` ${a({id:n>=12?"COMMON_PM":"COMMON_AM"})}`}`},s=(e,t,a)=>{const i=Math.max(1,Math.min(60,Math.floor(60/t))),s=Math.floor(60/i);return(0,n.A)(0,24).map(t=>(0,n.A)(i).map(n=>{const i=n*s;return{label:E({use24HourFormat:e,formatMessage:a,minuteOfDay:t*r+i}),value:60*t+ +i}})).flat()},l=e=>6e4*Math.round(e/6e4),o=(e,t)=>{const a=+(e/1e3).toFixed(1),n=+(a/1e3).toFixed(1),r=+(a/6e4).toFixed(1);return a<1e3?`${a} ${t({id:"COMMON_UNIT_MS"})}`:n<60?`${n} ${t({id:"COMMON_UNIT_S"})}`:`${r} ${t({id:"COMMON_UNIT_MIN"})}`}},834316:(e,t,a)=>{"use strict";a.d(t,{$H:()=>r,SK:()=>n,ec:()=>i});const n=e=>e.replace("network","ADMINS"),r=e=>e.replace("network","applications"),i=e=>e.replace("network","console-settings")},909611:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(296540),r=a(56016),i=a(71479),E=a(596441);const s=(0,i.A)("div",{shouldForwardProp:e=>!["height","maxWidth","headerHeight"].includes(e)})`
  height: ${({height:e})=>e}px;
  ${({maxWidth:e})=>e?`max-width: ${e}px;`:""}
`;const l=function({maxRows:e=6,minRows:t=0,headerHeight:a,maxWidth:i,forwardedRef:l,rowHeight:o,items:_,...A}){const c=(0,n.useMemo)(()=>E.I.getHeight(Math.max(_.length,t),e,a,o)+1,[a,_.length,e,t,o]);return n.createElement(s,{height:c,maxWidth:i,headerHeight:a},n.createElement(r.A,{ref:l,rowHeight:o,items:_,headerHeight:a,...A}))}},944940:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>na});var n=a(296540),r=a(956347),i=a(469733),E=a(951272),s=a(429252),l=a.n(s),o=a(758649),_=a(998837),A=a(742920),c=a(38671),d=a(335928),T=a(834316),m=a(928085),S=a(566723),u=a(823084),N=a(242366),h=a(317672),O=a(349665),p=a(294303),C=a(689965),I=a(675359),D=a(699784),R=a(187483),M=a(556456),L=a(55983),b=a(302167),g=a(881314),v=a(457311),P=a(215454),w=a(602021),H=a(198494),f=a(582724),y=a(834959),U=a(413357),Y=a(476703),k=a(691189),F=a(887831),G=a(294201);const x="/api/s/{site}/cmd/firmware",V=({device:e,version:t})=>`${e}_${t}`,W=(e={},t={})=>(0,k.t9)("availableFirmware",x,{data:{cmd:G.A.LIST_AVAILABLE},...e},{method:F.A.POST,idField:V,...t}),B=(e={},t={})=>(0,k.t9)("cachedFirmware",x,{data:{cmd:G.A.LIST_CACHED},...e},{method:F.A.POST,idField:V,...t}),$=(e,t)=>async a=>{await a(((e,t)=>(0,k.Xj)(G.A.DOWNLOAD,x,{device:e,version:t}))(e,t)),await a(B()),await a(W())},K=(e,t)=>async a=>{await a(((e,t)=>(0,k.Xj)(G.A.REMOVE,x,{device:e,version:t}))(e,t)),await a(W()),await a(B())};var z=a(592510),j=a(329109),q=a(149133),X=a(870443),Q=a(546391);const Z=/[A-Z]/,J=/[a-z]/,ee=/[0-9]/,te=/[^0-9a-zA-Z]/,ae=e=>({device_ssh_authentication_enabled:X.A.boolean(),device_ssh_authentication_username:X.A.string().when("device_ssh_authentication_enabled",{is:!0,then:X.A.string().label("COMMON_LABEL_USERNAME").matches(Q.S1,{message:n.createElement(D.sA,{id:"COMMON_VALIDATION_SSH_AUTH_USERNAME",values:{name:n.createElement(D.sA,{id:"COMMON_LABEL_USERNAME"})}})}).required()}),device_ssh_authentication_password:X.A.string().when("device_ssh_authentication_enabled",{is:!0,then:X.A.string().label("COMMON_PASSWORD").required().when("device_ssh_authentication_password",{is:t=>t!==e,then:X.A.string().label("COMMON_PASSWORD").required().min(12).test("containsUppercase",n.createElement(D.sA,{id:"SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_PASSWORD_DESCRIPTION_VALIDATION_UPPERCASE"}),e=>Z.test(e)).test("containsLowercase",n.createElement(D.sA,{id:"SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_PASSWORD_DESCRIPTION_VALIDATION_LOWERCASE"}),e=>J.test(e)).test("containsNumber",n.createElement(D.sA,{id:"SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_PASSWORD_DESCRIPTION_VALIDATION_NUMBER"}),e=>ee.test(e)).test("containsSymbol",n.createElement(D.sA,{id:"SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_PASSWORD_DESCRIPTION_VALIDATION_SYMBOL"}),e=>te.test(e))})}),device_ssh_authentication_keys:X.A.array()}),ne=(e,t)=>{const a=!t&&e.inform_host_override_enabled;return{...e.super_mgmt,override_inform_host:a,override_inform_host_location:a?e.inform_host_override_host:e.super_mgmt?.override_inform_host_location}};var re=a(137625),ie=a(143811),Ee=a(821580);const se=()=>{const{values:e,setFieldValue:t}=(0,E.j7)(),[a,r]=(0,n.useState)(!1);return n.createElement(n.Fragment,null,n.createElement(Ee.A,null,n.createElement(re.A,{title:"COMMON_OVERRIDE_INFORM_HOST",message:"SETTINGS_SYSTEM_CTRL_MODAL_OVERRIDE_INFORM_HOST_MESSAGE",handleClose:r,handleConfirm:()=>t("inform_host_override_enabled",!0),isOpen:a},n.createElement(ie.A,{name:"inform_host_override_enabled",type:"realCheckbox",onChange:()=>{e.inform_host_override_enabled?t("inform_host_override_enabled",!1):r(!0)}},n.createElement(D.sA,{id:"COMMON_DEVICE_INFORM_HOST_OVERRIDE"})))),e.inform_host_override_enabled?n.createElement(ie.A,{full:!0,name:"inform_host_override_host",variant:"secondary",placeholder:"COMMON_LABEL_HOSTNAME_IP",autoComplete:"off",onPaste:e=>{try{t("inform_host_override_host",new URL(e.clipboardData.getData("text")).hostname),e.preventDefault()}catch{}}}):null)};var le=a(776309),oe=a(126457),_e=a(86392),Ae=a(823881),ce=a(659240),de=a(765268),Te=a(953141);const me=()=>{const e=(0,i.useDispatch)(),{setFieldValue:t,resetForm:a}=(0,E.j7)(),r=(0,i.useSelector)(b.rk),s=(0,n.useCallback)(t=>e((0,ce.nu)(t)),[e]),l=(0,n.useCallback)(()=>{const a=()=>{t("sso_enabled",!1),e((0,oe.AS)())},n=n=>{a(),e((0,I.ox)({icon:A.C.danger,message:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_ENABLE_SSO_TOAST_ERROR",errorMessage:Te.r[n],errorValues:n})),t("super_fwupdate.sso_enabled",!1)},r=()=>{t("sso_enabled",!0),e((0,oe.AS)())};var i;e((i={registerAction:s,onCancel:a,onError:n,onSuccess:r,on2FARequired:t=>{var i;e((0,oe.AS)()),e((i={initialValues:t,registerAction:s,onCancel:a,onError:n,onSuccess:r},(0,oe.to)({modalType:le.A.SSO_LOGIN_2FA,modalProps:{title:"SETTINGS_CONTROLLER_ADVANCED_UPDATES_TITLE_MODAL_ENABLE_SSO",submitButtonText:"COMMON_ACTION_SIGN_IN",...i}})))}},(0,oe.to)({modalType:le.A.SSO_LOGIN,modalProps:{title:"SETTINGS_CONTROLLER_ADVANCED_UPDATES_TITLE_MODAL_ENABLE_SSO",submitButtonText:"COMMON_ACTION_SIGN_IN",...i}})))},[e,s,t]),o=(0,n.useCallback)(()=>{e((0,_e.E)({title:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_DISABLE_SSO_MODAL_TITLE",message:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_DISABLE_SSO_MODAL_DESCR",onConfirm:async()=>{e((0,oe.AS)()),await e((0,v.q6)({...r,sso_enabled:!1,controller_channel:Ae.wN.RELEASE,firmware_channel:Ae.wN.RELEASE})),await e((0,v.Uc)(void 0,{resolveWithExisting:!1})),await e((0,de.O)()),a()},onCancel:()=>{e((0,oe.AS)())}}))},[e,r,a]),_=(0,n.useCallback)(({currentTarget:{checked:e}})=>{e&&!r.sso_enabled?l():!e&&r.sso_enabled&&o()},[l,o,r.sso_enabled]);return n.createElement(Ee.A,null,n.createElement(ie.A,{type:"realCheckbox",name:"sso_enabled",onChange:_,tooltipMessage:n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_EARLY_ACCESS_CHANNELS_DESCRIPTION"})},n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_EARLY_ACCESS_CHANNELS_LABEL"})))};var Se=a(532419),ue=a(963070),Ne=a(596441),he=a(454195),Oe=a(573531),pe=a(734707),Ce=a(801081),Ie=a(25553),De=a(87485);const Re=(0,Ie.uh)((0,Y.vM)()),Me=(0,Ce.Mz)(Re,De.kh);var Le,be,ge,ve,Pe=a(621690);!function(e){e.NEVER="Never",e.DAILY="Daily",e.WEEKLY="Weekly",e.MONTHLY="Monthly",e.ADVANCED="Advanced"}(Le||(Le={})),function(e){e.DAY="Day",e.WEEK="Week",e.MONTH="Month",e.YEAR="Year"}(be||(be={})),function(e){e.Hour="Hourly",e.Day="Daily",e.Week="Weekly",e.Month="Monthly",e.Year="Yearly"}(ge||(ge={})),function(e){e[e.GENERAL=0]="GENERAL",e[e.DEVICES=1]="DEVICES"}(ve||(ve={}));const we={dayInMonth:1,repeat:Le.NEVER,repeatEveryCount:1,repeatEveryPeriod:be.DAY,startTime:0,weekDays:[]},He=(e,t)=>{let{dayInMonth:a,repeat:n,repeatEveryCount:r,repeatEveryPeriod:i,startTime:E,weekDays:s}=we;const[l,o,_,A,c]=e?.split(" ")||[];if(l&&o&&(E=60*(Number(o)||0)+(Number(l)||0)),!t)if(1===+_&&1===+A)n=Le.ADVANCED,i=be.YEAR;else if("*"!==_)if("*"!==c)n=Le.ADVANCED,r=2,i=be.WEEK,s=c.split(",").map(Number);else if("*"!==A){n=Le.ADVANCED,i=be.MONTH;const e=A.split(",");r=+e[1]-+e[0]||1}else{const e=_.split(",");e.length>1?(n=Le.ADVANCED,i=be.DAY,r=+e[1]-+e[0]||1):(n=Le.MONTHLY,a=+_)}else"*"!==c?("*"!==_?(n=Le.ADVANCED,r=2,i=be.WEEK):n=Le.WEEKLY,s=c.split(",").map(Number)):n=Le.DAILY;return{dayInMonth:a,repeat:n,repeatEveryCount:r,repeatEveryPeriod:i,startTime:E,weekDays:s}},fe=({dayInMonth:e,repeat:t,repeatEveryCount:a,repeatEveryPeriod:n,startTime:r,weekDays:i})=>{const E=Math.floor(r/60),s=r%60;let l,o,_;switch(t){case Le.NEVER:case Le.DAILY:break;case Le.WEEKLY:_=i.join(",");break;case Le.MONTHLY:l=e;break;case Le.ADVANCED:switch(n){case be.DAY:1!==+a&&(l=(0,Pe.A)(1,32,a).join(","));break;case be.WEEK:2===+a&&(l="1-7,15-21"),_=i.join(",");break;case be.MONTH:l=e,1!==+a&&(o=(0,Pe.A)(1,12,a).join(","));break;case be.YEAR:l=1,o=1}}return((...e)=>e.map(e=>e??"*").join(" "))(s,E,l,o,_)};var ye,Ue,Ye=a(217439),ke=a(705145),Fe=a(49992);!function(e){e.STREAM="stream",e.BACKUP="backup",e.UPGRADE="upgrade",e.RADIOAI="radio-ai",e.ANALYTICS="analytics"}(ye||(ye={})),function(e){e.MEDIA="media",e.SAMPLE="sample"}(Ue||(Ue={}));const Ge=X.A.object().shape({name:X.A.string().label("COMMON_NAME").required(),startTime:X.A.number().label("COMMON_START_TIME").required(),repeat:X.A.string().label("SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEATS").oneOf(Object.values(Le)).required(),repeatEveryPeriod:X.A.string().when("repeat",{is:e=>e===Le.ADVANCED,then:X.A.string().oneOf(Object.values(be)).required()}),repeatEveryCount:X.A.number().when(["repeat","repeatEveryPeriod"],(e,t)=>{if(e===Le.ADVANCED)switch(t){case be.DAY:return X.A.number().label("SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_EVERY").min(1).max(31).required();case be.WEEK:return X.A.number().label("SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_EVERY").min(1).max(2).required();case be.MONTH:return X.A.number().label("SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_EVERY").min(1).max(12).required()}return X.A.number()}),dayInMonth:X.A.number().when(["repeat","repeatEveryPeriod"],{is:(e,t)=>e===Le.MONTHLY||e===Le.ADVANCED&&t===be.MONTH,then:X.A.number().label("SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_ON_DAY_OF_MONTH").min(1).max(31).required()}),weekDays:X.A.array().of(X.A.number()).when(["repeat","repeatEveryPeriod"],{is:(e,t)=>e===Le.WEEKLY||e===Le.ADVANCED&&t===be.WEEK,then:X.A.array().of(X.A.number()).min(1,n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_VALIDATION_WEEK_DAYS_MIN"})).required()})}),xe=X.A.object().shape({upgrade_targets:X.A.array().of(X.A.string()).label(n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_TARGET_DEVICES"})).min(1,n.createElement(D.sA,{id:"SETTINGS_COMMON_DEVICE_REQUIRED"})).required(n.createElement(D.sA,{id:"SETTINGS_COMMON_DEVICE_REQUIRED"}))});var Ve=a(834042);const We=({disabled:e})=>{const{formatMessage:t}=(0,D.tz)(),a=(0,i.useSelector)(H.jc),r=(0,n.useMemo)(()=>(0,Ve.gy)(a,15,t),[a,t]);return n.createElement(ie.A,{full:!0,name:"startTime",type:"dropdown",variant:"secondary",label:"COMMON_START_TIME",options:r,translateLabel:!0,disabled:e})};var Be=a(86838),$e=a(71479),Ke=a(79760),ze=a(266659);const je=(0,$e.A)(o.A,{shouldForwardProp:e=>"isActive"!==e})`
  width: 28px !important;
  height: 28px !important;
  margin-top: ${({theme:{spacing:e}})=>e["spacing-xs"]} !important;
  padding: 0 !important;
  ${({isActive:e,theme:{motifPalette:{ui12:t}}})=>!e&&`background: ${t} !important;`}
  ${({isActive:e,theme:{motifPalette:{white:t}}})=>e&&`color: ${t} !important;`}
`,qe=({disabled:e})=>{const{formatMessage:t}=(0,D.tz)(),{setFieldValue:a,values:r,errors:i,touched:s,submitCount:l}=(0,E.j7)(),o=(0,Ke.t$)("weekDays",i,s,l),_=(0,n.useCallback)(e=>{a("weekDays",r.weekDays.includes(e)?r.weekDays.filter(t=>t!==e):[...r.weekDays,e])},[r.weekDays,a]);return n.createElement(O.A,null,n.createElement(h.A,{htmlFor:"weekDays"},n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_ON_EVERY"})),n.createElement(p.A,{gap:S.YC},ze.A.map(({abbreviationLabel:a,value:i})=>{const E=r.weekDays?.includes(i);return n.createElement(je,{type:"button",isActive:E,variant:E?"primary":"default",onClick:()=>_(i),key:a,disabled:e},n.createElement(Ye.A,{size:"small",color:"inherit"},t({id:a})))})),o?n.createElement(Be.A,{isInvalid:!0,label:o}):null)},Xe=({disabled:e})=>n.createElement(O.A,null,n.createElement(h.A,{htmlFor:"dayInMonth"},n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_ON_DAY_OF_MONTH"})),n.createElement(ie.A,{full:!0,max:"31",min:"1",name:"dayInMonth",variant:"secondary",type:"number",disabled:e})),Qe=[{label:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_DAY",value:be.DAY},{label:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_WEEK",value:be.WEEK},{label:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_MONTH",value:be.MONTH},{label:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_YEAR",value:be.YEAR}],Ze=({disabled:e})=>{const{values:t,errors:a,touched:r,submitCount:i}=(0,E.j7)(),{formatMessage:s}=(0,D.tz)(),l=(0,Ke.t$)("repeatEveryPeriod",a,r,i);return n.createElement(n.Fragment,null,n.createElement(O.A,null,n.createElement(h.A,{htmlFor:"repeatEveryPeriod"},n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_EVERY"})),n.createElement(p.A,{alignItems:"flex-start",width:200,gap:S.kc},be.YEAR!==t.repeatEveryPeriod?n.createElement(p.A,{width:64,flexDirection:"column"},n.createElement(ie.A,{full:!0,min:"1",name:"repeatEveryCount",variant:"secondary",type:"number",disabled:e})):null,n.createElement(p.A,{flex:1},n.createElement(ie.A,{full:!0,name:"repeatEveryPeriod",variant:"secondary",options:Qe.map(({label:e,value:a})=>({label:s({id:e},{count:t.repeatEveryCount}),value:a})),type:"dropdown",disabled:e}))),l?n.createElement(Be.A,{isInvalid:!0,label:l}):null),t.repeatEveryPeriod===be.WEEK?n.createElement(qe,{disabled:e}):null,t.repeatEveryPeriod===be.MONTH?n.createElement(Xe,{disabled:e}):null)},Je=({disabled:e})=>{const{values:t}=(0,E.j7)();switch(t.repeat){case Le.WEEKLY:return n.createElement(qe,{disabled:e});case Le.MONTHLY:return n.createElement(Xe,{disabled:e});case Le.ADVANCED:return n.createElement(Ze,{disabled:e});default:return null}},et=[{value:Le.NEVER,label:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_NEVER"},{value:Le.DAILY,label:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_DAILY"},{value:Le.WEEKLY,label:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_WEEKLY"},{value:Le.MONTHLY,label:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_MONTHLY"},{value:Le.ADVANCED,label:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_ADVANCED"}],tt=({disabled:e})=>n.createElement(ie.A,{full:!0,name:"repeat",type:"dropdown",variant:"secondary",label:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEATS",options:et,translateLabel:!0,translateOptions:!0,disabled:e});var at=a(687602),nt=a(396660),rt=a(6510),it=a(115829),Et=a(909611),st=a(6176);const lt=[{compare:(0,nt.l0)(e=>(0,rt.Q)(e)),id:"name",growthFactor:1,label:n.createElement(D.sA,{id:"COMMON_DEVICE"}),renderCell:({name:e,model:t,mac:a})=>n.createElement(p.A,{flexDirection:"row",gap:S.YC,alignItems:"center",maxWidth:"100%"},n.createElement(st.A,{model:t,width:24,height:24}),n.createElement(it.A,{key:a},(0,rt.Q)({name:e,model:t,mac:a}))),sortable:!0},{compare:(0,nt.l0)(e=>(0,rt.Lm)(e.model)),id:"model",growthFactor:1,label:n.createElement(D.sA,{id:"COMMON_MODEL"}),renderCell:({model:e})=>n.createElement(it.A,{key:e},(0,rt.Lm)(e)),sortable:!0}],ot=({disabled:e})=>{const{formatMessage:t}=(0,D.tz)(),a=(0,i.useSelector)(Se.GF),{setFieldValue:r,values:s,errors:l,touched:o,submitCount:_}=(0,E.j7)(),[A,c]=(0,n.useState)(""),d=(0,n.useMemo)(()=>{const e=A.toLowerCase();return a.filter(({name:t,model:a,mac:n})=>[t,a,n,(0,rt.Lm)(a)].filter(Boolean).some(t=>t.toLowerCase().includes(e)))},[a,A]),T=(0,Ke.t$)("upgrade_targets",l,o,_);return n.createElement(p.A,{flexDirection:"column",gap:S.kc,width:"100%"},n.createElement(at.A,{"aria-label":t({id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_TARGET_DEVICES_PLACEHOLDER"}),onChange:e=>{c(e)},onClear:()=>{c("")},placeholder:t({id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_TARGET_DEVICES_PLACEHOLDER"}),value:A}),n.createElement(Et.A,{columns:lt,items:d,maxRows:10,minRows:a.length,idField:"mac",disableColumnFilters:!0,multiSelectMode:!0,disableSelection:e,initialSelectedIds:s.upgrade_targets,onChangeSelection:e=>{r("upgrade_targets",e)}}),T?n.createElement(Be.A,{isInvalid:!0,label:T}):null)},_t=({onDismiss:e,existingRecord:t,disabled:a})=>{const r=(0,i.useDispatch)(),[E,s]=(0,n.useState)(ve.GENERAL),l=(0,n.useCallback)((a,{setSubmitting:n})=>{r((0,Y.Pt)({...t,name:a.name,upgrade_targets:a.upgrade_targets.map(e=>({mac:e})),cron_expr:fe(a),execute_only_once:a.repeat===Le.NEVER,action:ye.UPGRADE})).then(()=>e()).catch(e=>{const t=(0,c.F)(e)?e:void 0;r((0,I.ox)({errorMessage:t?.msg,errorValues:t,icon:A.C.danger,message:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_SCHEDULED_UPGRADES_SAVE_ERROR"})),n(!1)})},[r,t,e]),_=(0,n.useCallback)((...e)=>{E===ve.GENERAL?s(ve.DEVICES):l(...e)},[l,E]),d=t?n.createElement(ke.A,{variant:"inherit",isTruncated:!0},n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_UPGRADE_EDIT_HEADER",values:{name:t.name}})):n.createElement(D.sA,{id:"SETTINGS_ADD_NEW_SCHEDULE"}),T=(0,n.useMemo)(()=>({weekDays:[],dayInMonth:1,repeat:Le.NEVER,repeatEveryCount:1,repeatEveryPeriod:be.DAY,startTime:0}),[]),m=(0,n.useMemo)(()=>({...T,name:t?.name||"",execute_only_once:Boolean(t?.execute_only_once),...He(t?.cron_expr||fe({dayInMonth:1,repeat:Le.DAILY,repeatEveryCount:1,repeatEveryPeriod:be.DAY,startTime:0,weekDays:[]}),!!t?.execute_only_once),upgrade_targets:(t?.upgrade_targets||[]).map(({mac:e})=>e)}),[T,t]),S=(0,n.useMemo)(()=>(e=>e===ve.GENERAL?Ge:xe)(E),[E]);return n.createElement(Fe.Ay,{initialValues:m,validationSchema:S,onSubmit:_,size:"small",allowOverflow:!0,title:d,secondaryActions:E===ve.DEVICES?n.createElement(o.A,{type:"button",onClick:()=>s(ve.GENERAL)},n.createElement(D.sA,{id:"COMMON_ACTION_BACK"})):t&&!a?n.createElement(o.A,{type:"button",onClick:()=>{r((0,Y.K4)(t._id)).then(()=>{e()}).catch(e=>{r((0,I.ox)((0,De.rk)("SETTINGS_SYSTEM_MAINTENANCE_UPDATE_SCHEDULED_UPGRADES_REMOVE_ERROR",{upgrade:t.name||""}).failureToast(void 0,e)))})}},n.createElement(Ye.A,{size:"medium",color:"destructive"},n.createElement(D.sA,{id:"COMMON_ACTION_REMOVE"}))):null,onDismiss:e,submitAction:E===ve.DEVICES?n.createElement(o.A,{variant:"primary",type:"submit",disabled:a},n.createElement(D.sA,{id:"COMMON_ACTION_SAVE"})):n.createElement(o.A,{variant:"primary",type:"submit"},n.createElement(D.sA,{id:"COMMON_ACTION_NEXT"}))},E===ve.GENERAL?n.createElement(N.A,null,n.createElement(ie.A,{full:!0,name:"name",variant:"secondary",label:"COMMON_NAME",disabled:a}),n.createElement(We,{disabled:a}),n.createElement(tt,{disabled:a}),n.createElement(Je,{disabled:a})):n.createElement(ot,{disabled:a}))};var At=a(359160),ct=a.n(At);var dt=a(282556);const Tt=e=>{switch(e){case Le.MONTHLY:return{month:"short",day:"numeric"};case Le.WEEKLY:return{weekday:"long"};case ge.Year:return{month:"short",day:"numeric",year:"numeric"};case Le.DAILY:case Le.NEVER:default:return{}}},mt=({cronExpr:e,executeOnlyOnce:t})=>{const a=(0,i.useSelector)(H.BQ),r=(0,i.useSelector)(dt.zi),{repeat:E,repeatEveryPeriod:s}=He(e,t);let l=E===Le.ADVANCED?ge[s]:E;return l===Le.NEVER&&(l=ge.Hour),n.createElement(n.Fragment,null,new Intl.DateTimeFormat(r,{hour:"numeric",minute:"2-digit",hourCycle:a,...Tt(l)}).format((e=>{if(!e||e.split(" ").length<5)return null;try{const t=ct().parseExpression(e),a=t?.next()?.getTime();return a?new Date(a):null}catch(e){return null}})(e)))},St=[{id:"name",label:n.createElement(D.sA,{id:"COMMON_NAME"}),minWidth:110},{id:"cron_expr",label:n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_SCHEDULED_UPGRADES_HEADER_REPEATS"}),minWidth:80,renderCell:({cron_expr:e,execute_only_once:t})=>{const{repeat:a,repeatEveryPeriod:r}=He(e,t),i=a===Le.ADVANCED?ge[r]:a;return t?Oe.L:n.createElement(D.sA,{id:`COMMON_INTERVAL_${i.toUpperCase()}`})}},{id:"execute_only_once",label:n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_SCHEDULED_UPGRADES_HEADER_NEXT_UPDATE"}),minWidth:150,renderCell:({cron_expr:e,execute_only_once:t})=>n.createElement(mt,{cronExpr:e,executeOnlyOnce:t})}],ut=({disabled:e})=>{const[t,a]=(0,n.useState)(!1),[r,E]=(0,n.useState)(null),s=(0,i.useSelector)(Me),l=s.find(({_id:e})=>e===r);return n.createElement(n.Fragment,null,n.createElement(p.A,{flexDirection:"column",width:"100%"},s.length>0?n.createElement(ue.A,{columns:St,disableColumnFilters:!0,truncateHeaderCells:!0,disableSelection:!0,disableTextPointer:!0,items:s,idField:"_id",onRowClick:({_id:e})=>E(e),rowHeight:Ne.I.ROW_HEIGHT,width:"100%"}):null,n.createElement(p.A,{minHeight:he.b,alignContent:"center"},n.createElement(pe.Ay,{name:"check-controller-package-update",type:"button",size:"medium",variant:"inline",onClick:()=>a(!0),iconSize:"original"},n.createElement(D.sA,{id:"SETTINGS_ADD_NEW_SCHEDULE"})))),t?n.createElement(_t,{disabled:e,onDismiss:()=>a(!1)}):null,l?n.createElement(_t,{disabled:e,onDismiss:()=>E(null),existingRecord:l}):null)},Nt=({disabled:e})=>{const t=(0,i.useSelector)(Se.BS),a=(0,i.useSelector)(Se.GF);return n.createElement(O.A,null,n.createElement(h.A,{htmlFor:"advanced_schedule"},n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_SCHEDULED_UPGRADE_LABEL"})),t?a.length?n.createElement(ut,{disabled:e}):n.createElement(u.A,null,n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_SCHEDULED_UPGRADES_NO_DEVICES"})):n.createElement(u.A,null,n.createElement(D.sA,{id:"COMMON_NO_UNIFI_DEVICES"})))};var ht=a(930679),Ot=a(54227),pt=a(297454),Ct=a(137298),It=a(553432),Dt=a(905582);const Rt=(0,Ie.uh)(W()),Mt=(0,Ce.Mz)(Rt,De.kh),Lt=(0,Ie.uh)(B()),bt=(0,Ce.Mz)(Lt,De.kh),gt=(0,Ce.Mz)(Mt,bt,(e,t)=>(0,Dt.A)([...e.map(e=>({...e,id:`${e.device}_${e.version}`})),...t.map(e=>({...e,id:`${e.device}_${e.version}`}))],"id")),vt=(0,Ce.Mz)(gt,e=>e.filter(({siteDevice:e})=>e)),Pt=(0,Ce.Mz)(bt,e=>e.filter(({siteDevice:e})=>e));var wt=a(332918);const Ht=a(17437).i7`
    from {
      opacity: 0;
    }
    50% {
      opacity: 1;
    }
    to {
      opacity: 0;
    }
`,ft=(0,$e.A)(wt.A)`
  opacity: 0;
  animation: ${Ht} 2s ease-in-out 0s infinite;
`;var yt;!function(e){e.ALL="all",e.CACHED="cached"}(yt||(yt={}));const Ut=[{compare:(0,nt.l0)(({device:e})=>(0,rt.Lm)(e)),id:"device",minWidth:100,label:n.createElement(D.sA,{id:"COMMON_DEVICE"}),renderCell:({device:e})=>n.createElement(ke.A,{variant:"inherit",isTruncated:!0},(0,rt.Lm)(e)),sortable:!0},{id:"version",minWidth:80,label:n.createElement(D.sA,{id:"COMMON_VERSION"}),renderCell:({version:e})=>n.createElement(ke.A,{variant:"inherit",isTruncated:!0},e),sortable:!0},{id:"size",minWidth:60,label:n.createElement(D.sA,{id:"COMMON_SIZE"}),renderCell:({size:e})=>n.createElement("span",null,e?(0,Ct.z3)(e):n.createElement(D.sA,{id:"COMMON_FALLBACK"}))},{id:"cached",width:52,label:n.createElement(D.sA,{id:"SETTINGS_FIRMWARE_CACHE_HEADER_CACHED"}),renderCell:({isDownloading:e,cached:t})=>e?n.createElement(ft,{size:"original"}):t?n.createElement(pt.A,{size:"original"}):n.createElement(p.A,{width:20,justifyContent:"center"},n.createElement(Ye.A,null,n.createElement(D.sA,{id:"COMMON_FALLBACK"})))}],Yt=({disabled:e})=>{const[t,a]=(0,n.useState)({}),[r,E]=(0,n.useState)(yt.ALL),s=(0,i.useSelector)(w.EL),l=(0,i.useDispatch)(),_=(0,i.useSelector)(vt),A=(0,i.useSelector)(Pt),c=(0,n.useCallback)(({base_model:e,device:t,version:n})=>{a({base_model:e,version:n}),l($(t,n)).then(()=>{a({})})},[l]),d=(0,n.useCallback)(e=>{l((({device:e,version:t})=>a=>{a((0,_e.E)({title:"SETTINGS_FIRMWARE_DELETE_MODAL_TITLE",message:"SETTINGS_FIRMWARE_DELETE_MODAL_MESSAGE",messageValues:{deviceModel:(0,rt.Lm)(e)},onConfirm:()=>{a(K(e,t)),a((0,oe.AS)())}}))})({device:e.device,version:e.version||""}))},[l]),T=(0,n.useMemo)(()=>(0,ht.A)(r===yt.ALL?_.map(e=>({...e,id:e.device,cached:e.cached,size:e.size,version:e.version||"",isDownloading:t.base_model===e.base_model&&t.version===e.version,isCacheDisabled:!!t.base_model})):A.map(e=>({...e,id:e.device,device:e.device,version:e.version,size:e.size,cached:e.cached,isDownloading:!1,isCacheDisabled:!1})),"device"),[r,_,t,A]);return n.createElement(p.A,{flexDirection:"column",width:"100%",gap:S.kc},n.createElement(It.A,null,n.createElement(Ot.A,{id:yt.ALL,onChange:()=>{E(yt.ALL)},checked:r===yt.ALL,disabled:e},n.createElement(D.sA,{id:"SETTINGS_FIRMWARE_FILTER_AVAILABLE_FIRMWARE"})),n.createElement(Ot.A,{id:yt.CACHED,onChange:()=>{E(yt.CACHED)},checked:r===yt.CACHED,disabled:e},n.createElement(D.sA,{id:"SETTINGS_FIRMWARE_FILTER_CACHED_FIRMWARE"}))),T.length?n.createElement(Et.A,{columns:Ut,disableColumnFilters:!0,disableSelection:!0,disableTextPointer:!0,idField:"device",items:T,renderHoverContent:s?void 0:e=>n.createElement(p.A,{paddingRight:S.kc},e.cached?n.createElement(o.A,{disabled:e.isDownloading,onClick:()=>{d(e)},type:"button",variant:"inline",name:"delete-cache"},n.createElement(D.sA,{id:"SETTINGS_FIRMWARE_CACHE_ACTION_DELETE"})):n.createElement(o.A,{disabled:e.isCacheDisabled,onClick:()=>{c(e)},type:"button",variant:"inline",name:"cache"},n.createElement(D.sA,{id:"SETTINGS_FIRMWARE_CACHE_ACTION_CACHE"}))),maxRows:6}):n.createElement(u.A,null,n.createElement(D.sA,{id:r===yt.ALL?"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_HEADER_FIRMWARE_ALL_EMPTY":"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_HEADER_FIRMWARE_CACHE_EMPTY"})))};var kt=a(369596);const Ft=X.A.string().label("COMMON_NAME").required(),Gt=X.A.string().label("SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_SSH_KEY_LABEL").matches(/^((ssh-rsa|ssh-ed25519) )AAAA[0-9A-Za-z+/]+[=]{0,3}[ ]?(.)*$/i,{message:n.createElement(D.sA,{id:"SETTINGS_SSH_SIDE_PANEL_KEY_INVALID"})}).required(),xt=X.A.string().label("SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_SSH_KEY_LABEL").matches(/^AAAA[0-9A-Za-z+/]+[=]{0,3}[ ]?(.)*$/i,{message:n.createElement(D.sA,{id:"SETTINGS_SSH_SIDE_PANEL_KEY_INVALID"})}).required(),Vt=X.A.object().shape({tableItems:X.A.array().of(X.A.object().shape({name:Ft,key:xt})),newSshKey:X.A.string().when("editActive",{is:!1,then:Gt}),newSshKeyName:X.A.string().when("editActive",{is:!1,then:Ft})}),Wt=[{label:n.createElement(D.sA,{id:"COMMON_NAME"}),id:"name",sortable:!0,maxWidth:140,minWidth:30},{label:n.createElement(D.sA,{id:"SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_SSH_KEY_TABLE_HEADER"}),id:"key",sortable:!0,growthFactor:1,renderCell:({key:e,type:t})=>n.createElement(ke.A,{size:"inherit",color:"inherit",isTruncated:!0},`${t} ${e}`)}],Bt={name:"COMMON_NAME",key:"SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_SSH_KEYS_LABEL_KEY"},$t=[{name:"newSshKeyName",placeholder:"COMMON_NAME",containerFlexProps:{maxWidth:303}},{name:"newSshKey",placeholder:"SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_SSH_KEYS_PLACEHOLDER_KEY"}],Kt=e=>{const[t,a,n]=e.key.split(" "),r=n||e.name;return{name:e.name,type:t,key:a,comment:r}},zt=()=>{const{values:e,setFieldValue:t}=(0,E.j7)(),a=(0,n.useMemo)(()=>e.device_ssh_authentication_keys.map((e,t)=>({...e,idx:t})),[e.device_ssh_authentication_keys]),r=(0,n.useMemo)(()=>({tableItems:a,newSshKeyName:"",newSshKey:"",editActive:!1}),[a]),i=(0,n.useCallback)(a=>{t("device_ssh_authentication_keys",e.device_ssh_authentication_keys.filter((e,t)=>t!==a.idx))},[e.device_ssh_authentication_keys,t]),s=(0,n.useCallback)(a=>{t("device_ssh_authentication_keys",[...e.device_ssh_authentication_keys,Kt({name:a.newSshKeyName,key:a.newSshKey})])},[e.device_ssh_authentication_keys,t]),l=(0,n.useCallback)(e=>{t("device_ssh_authentication_keys",e.map(({idx:e,...t})=>t))},[t]);return n.createElement(kt.A,{fieldName:"tableItems",idField:"idx",items:a,columns:Wt,fieldLabels:Bt,newFields:$t,onAddItem:s,onRemoveItem:i,onEditSubmit:l,initialValues:r,validationSchema:Vt,isWindowTable:!0})},jt=()=>{const{values:e}=(0,E.j7)();return n.createElement(n.Fragment,null,n.createElement(Ee.A,null,n.createElement(ie.A,{name:"device_ssh_authentication_enabled",type:"realCheckbox",tooltipProps:{portal:!0}},n.createElement(D.sA,{id:"COMMON_DEVICE_SSH_AUTH"}))),e.device_ssh_authentication_enabled?n.createElement(n.Fragment,null,n.createElement(O.A,{maxWidth:"settingsGridContent"},n.createElement(h.A,{htmlFor:"device_ssh_authentication_username",tooltip:n.createElement(D.sA,{id:"SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_USERNAME_DESCRIPTION"})},n.createElement(D.sA,{id:"COMMON_LABEL_USERNAME"})),n.createElement(ie.A,{name:"device_ssh_authentication_username",variant:"secondary",full:!0})),n.createElement(O.A,{maxWidth:"settingsGridContent"},n.createElement(h.A,{htmlFor:"device_ssh_authentication_password",tooltip:n.createElement(D.sA,{id:"SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_PASSWORD_DESCRIPTION"})},n.createElement(D.sA,{id:"COMMON_PASSWORD"})),n.createElement(ie.A,{name:"device_ssh_authentication_password",autoComplete:"new-password",type:"password",variant:"secondary",passwordToggle:!0,full:!0})),n.createElement(O.A,null,n.createElement(h.A,{htmlFor:"newSshKeyName",tooltip:n.createElement(D.sA,{id:"SETTINGS_SYSTEM_CTRL_DEVICE_SSH_AUTH_SSH_KEYS_DESCRIPTION"})},n.createElement(D.sA,{id:"COMMON_SSH_KEYS"})),n.createElement(zt,null))):null)};var qt=a(535240);const Xt=()=>{const e=(0,i.useSelector)(b.DT),t=(0,n.useMemo)(()=>e.map(e=>({value:e,label:qt.I[e]})),[e]);return n.createElement(ie.A,{full:!0,label:n.createElement(D.sA,{id:"COMMON_DEVICE_FIRMWARE_RELEASE_CHANNEL"}),type:"dropdown",variant:"secondary",name:"firmware_channel",options:t,translateOptions:!0})};var Qt=a(30569),Zt=a(534637),Jt=a(231226);const ea=()=>{const e=(0,i.useDispatch)(),t=(0,i.useSelector)(Jt.tV),a=(0,i.useSelector)(Se.BS),[r,E]=(0,n.useState)(!1),s=(0,n.useCallback)(async()=>{try{E(!0),await e((0,ce.hr)());const t=await e((0,de.O)());t.data?.has_upgradable_devices?(await e(W()),e((0,I.ox)({icon:A.C.info,message:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_CHECK_FIRMWARE_UPDATES_UPDATES_AVAILABLE"}))):e((0,I.ox)({icon:A.C.info,message:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_CHECK_FIRMWARE_UPDATES_ALL_DEVICES_UP_TO_DATE"})),E(!1)}catch(e){E(!1)}},[e]);return n.createElement(O.A,null,a?n.createElement(p.A,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",width:"100%",minHeight:he.b},n.createElement(o.A,{name:"check-firmware-update",type:"button",variant:"inline",size:"medium",onClick:s,Icon:Qt.A,iconProps:{isActive:!r,disabled:r,size:"original"},disabled:r},n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_CHECK_FIRMWARE_UPDATES_BUTTON"})),n.createElement(ke.A,{isTruncated:!0,size:"small"},n.createElement(Zt.H,{lastQuery:t,height:24}))):n.createElement(u.A,null,n.createElement(D.sA,{id:"COMMON_NO_UNIFI_DEVICES"})))};var ta=a(199709);const aa=()=>{const e=(0,i.useSelector)(H.jc),{values:t}=(0,E.j7)();return n.createElement(p.A,{flexDirection:"column",gap:S.YC},n.createElement(Ee.A,null,n.createElement(ie.A,{name:"auto_upgrade_enabled",type:"realCheckbox",tooltipMessage:n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_AUTO_UPGRADE_DESCRIPTION"}),tooltipProps:{portal:!0}},n.createElement(D.sA,{id:"SETTINGS_DEVICE_AUTO_UPDATE"}))),t.auto_upgrade_enabled?n.createElement(p.A,{alignItems:"center",gap:S.kc},n.createElement(ke.A,null,n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_AUTO_UPGRADE_CHECK_DAILY_AT"})),n.createElement(p.A,{width:108,alignItems:"center"},n.createElement(ie.A,{name:"auto_upgrade_hour",type:"dropdown",variant:"secondary",options:e?ta.Fw:ta.s9,full:!0}))):null)},na=()=>{const e=(0,r.W6)(),{motifPalette:{neutral02:t}}=(0,_.u)(),a=(0,i.useDispatch)(),s=(0,m.A)(L.aY),k=(0,i.useSelector)(M.yE),F=(0,i.useSelector)(b.rk),G=(0,i.useSelector)(H.fR),x=(0,i.useSelector)(w.EL),V=(0,i.useSelector)(b.$5),$=(0,i.useSelector)(R.TP),K=(0,i.useSelector)(b.Ey),Z=(0,i.useSelector)(b.xt),J=(0,i.useSelector)(R.W1),ee=(0,i.useSelector)(P.C7),te=(0,i.useSelector)(b.Xy),re=(0,n.useMemo)(()=>({sso_enabled:F.sso_enabled,firmware_channel:F.firmware_channel||g.SUPER_FWUPDATE_DEFAULTS.firmware_channel,auto_upgrade_enabled:V.auto_upgrade,auto_upgrade_hour:Number(V.auto_upgrade_hour)||0,super_identity:{...g.SUPER_IDENTITY_DEFAULTS,...Z},super_mgmt:{...te,...g.SUPER_MGMT_DEFAULTS,...K},device_ssh_authentication_enabled:!!V.x_ssh_enabled,device_ssh_authentication_username:V.x_ssh_username||"",device_ssh_authentication_password:V.x_ssh_password||"",device_ssh_authentication_keys:V.x_ssh_keys||[],inform_host_override_enabled:!!K.override_inform_host,inform_host_override_host:K.override_inform_host_location||(J?Z.hostname:void 0)||g.SUPER_MGMT_DEFAULTS.override_inform_host_location||""}),[F.sso_enabled,F.firmware_channel,V.auto_upgrade,V.auto_upgrade_hour,V.x_ssh_enabled,V.x_ssh_username,V.x_ssh_password,V.x_ssh_keys,J,Z,te,K]),ie=(0,n.useCallback)(async(e,{resetForm:t,setSubmitting:n})=>{const r=[];r.push(a((0,v.q6)({...F,sso_enabled:e.sso_enabled,firmware_channel:e.firmware_channel})));const i={x_ssh_enabled:e.device_ssh_authentication_enabled,x_ssh_username:e.device_ssh_authentication_username,x_ssh_password:e.device_ssh_authentication_password,x_ssh_keys:e.device_ssh_authentication_keys};r.push(a((0,v.G2)({auto_upgrade:e.auto_upgrade_enabled,auto_upgrade_hour:e.auto_upgrade_hour,...i})));const E=ne(e,ee);if(!l()(ne(re,ee),E)){r.push(a((0,v.dn)(E)));const t=!ee&&e.inform_host_override_enabled,n={...e.super_identity,hostname:J&&t?e.inform_host_override_host:e.super_identity.hostname};r.push(a((0,v.AH)(n)))}Promise.all(r).then(()=>t()).then(()=>{e.firmware_channel!==re.firmware_channel&&a(W())}).catch(e=>{const t=(0,c.F)(e)?e:void 0;n(!1),a((0,I.ox)({errorMessage:t?.msg,errorValues:{...t,name:t?.portForwardName||""},icon:A.C.danger,message:"COMMON_SETTINGS_CHANGED_TOAST_SAVE_ERROR"}))})},[a,re,J,F,ee]),Ee=(0,n.useCallback)(()=>{k?e.push(s):window.location.href=(0,T.$H)($)},[e,k,s,$]),le=(0,n.useMemo)(()=>((e,t,a,r)=>X.A.object().shape({inform_host_override_host:X.A.string().when("inform_host_override_enabled",{is:e=>e&&!a&&!r,then:X.A.string().when("inform_host_override_host",{is:e=>!e||e!==t,then:X.A.string().test("isValidHost",n.createElement(D.sA,{id:"COMMON_VALIDATION_HOSTNAME_OR_IPV4"}),e=>e&&((0,q.mr)(e)||Q.yA.test(e)||Q.V2.test(e))).label("SETTINGS_SYSTEM_CTRL_OVERRIDE_INFORM_HOST_OVERRIDE_LABEL").required()})}),...ae(e)}))(re.device_ssh_authentication_password,re.inform_host_override_host,J,ee),[re.device_ssh_authentication_password,re.inform_host_override_host,J,ee]);return(0,f.A)([(0,U.Zi)(y.B.SETTINGS),(0,v.Uc)(void 0,{crudCacheStrategy:{type:z.e.CACHE}}),(0,Y.vM)({type:z.e.CACHE}),B(void 0,{crudCacheStrategy:{type:z.e.CACHE}}),W(void 0,{crudCacheStrategy:{type:z.e.CACHE}})],n.createElement(E.l1,{initialValues:re,onSubmit:ie,enableReinitialize:!0,validationSchema:le},({values:e,resetForm:a,dirty:r,submitForm:i})=>n.createElement(n.Fragment,null,n.createElement(d.A,null),n.createElement(p.A,{gap:S.Ln,flexDirection:"column"},n.createElement(u.A,{background:t,borderRadius:S.YC},n.createElement(D.sA,{id:"SETTINGS_FIRMWARE_INFO_MESSAGE_CONTROL_PLANE",values:{link:n.createElement(o.A,{type:"button",variant:"inline",onClick:Ee},n.createElement(D.sA,{id:"COMMON_CONTROL_PLANE"}))}})),n.createElement(C.A,{marginBottom:"0"},n.createElement(N.A,null,n.createElement(me,null),e.sso_enabled?n.createElement(Xt,null):null,n.createElement(aa,null),G?n.createElement(ea,null):null)),n.createElement(C.A,{type:C.I.ACCORDION,items:[{id:"advanced",openByDefault:!0,label:n.createElement(D.sA,{id:"COMMON_ADVANCED"}),renderContent:()=>n.createElement(N.A,null,n.createElement(Nt,{disabled:x}),n.createElement(O.A,null,n.createElement(h.A,{htmlFor:"device_update_cache"},n.createElement(D.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_SCHEDULED_UPGRADES_HEADER_NEXT_UPDATE"})),n.createElement(Yt,{disabled:x})))}]})),n.createElement(C.A,{type:C.I.ACCORDION,items:[{openByDefault:!1,id:"deviceSettings",label:n.createElement(D.sA,{id:"COMMON_DEVICE_SSH_SETTINGS"}),renderContent:()=>n.createElement(N.A,null,ee?null:n.createElement(se,null),n.createElement(jt,null))}]}),n.createElement(j.A,{onFormCancel:a,isDirty:r,onFormSubmit:i}))))}},968906:(e,t,a)=>{"use strict";a.d(t,{A:()=>E});var n=a(383725),r=a(199582);class i{static addDataTestId(e){return{[r.L]:e}}}i.TestId=n.b;const E=i}}]);