"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[6368],{660075:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(296540),l=a(629318);const i=(0,a(51946).w)(e=>(0,n.createElement)("svg",(0,l.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,n.createElement)("path",{d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",fill:"currentColor",className:e.twotonedclassname}),(0,n.createElement)("path",{d:"M10.017 2c.58 0 1.169.064 1.758.196 2.316.521 4.165 2 5.226 3.927v-1.62a.502.502 0 0 1 .499-.5.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1 0-1h1.823A6.95 6.95 0 0 0 10.02 3a7.04 7.04 0 0 0-6.845 5.467c-.859 3.765 1.502 7.516 5.262 8.361a7.015 7.015 0 0 0 1.533.171c1.57 0 3.07-.534 4.277-1.462a.503.503 0 0 1 .73.128.497.497 0 0 1-.111.659A8.02 8.02 0 0 1 9.973 18c-.58 0-1.168-.063-1.757-.196-4.304-.968-6.997-5.247-6.014-9.557A8.034 8.034 0 0 1 10.017 2ZM17 7.003v-.015l-.024.015H17Z",fill:"currentColor",className:e.baseclassname}),(0,n.createElement)("path",{d:"M10.02 2c.563 0 1.131.06 1.7.184a7.969 7.969 0 0 1 4.78 3.135V4.75a.75.75 0 0 1 1.5 0v3c0 .413-.337.75-.751.75h-3.002a.75.75 0 0 1 0-1.5h1.545a.778.778 0 0 1-.08-.119 6.491 6.491 0 0 0-5.7-3.383c-2.863 0-5.478 1.916-6.268 4.749-1.003 3.595 1.22 7.27 4.82 8.089a6.506 6.506 0 0 0 5.245-1.068.735.735 0 0 1 .43-.139.755.755 0 0 1 .754.75.76.76 0 0 1-.32.619 7.996 7.996 0 0 1-6.442 1.301c-4.372-.994-7.087-5.389-5.985-9.758C3.154 4.439 6.436 2 10.02 2Z",fill:"currentColor",className:e.fillclassname})))},917536:(e,t,a)=>{a.d(t,{E:()=>l,f:()=>n});const n=-1,l=0},133141:(e,t,a)=>{a.d(t,{d:()=>c});var n=a(801081),l=a(25553),i=a(87485),r=a(441652),E=a(721778);const o=(0,l.uh)((0,r.wI)()),s=(0,n.Mz)(o,i.kh),c=(0,n.Mz)(s,e=>e.filter(({type:e})=>e===E.K.PRIMARY||e===E.K.SECONDARY))},755825:(e,t,a)=>{a.d(t,{A:()=>c});var n=a(296540),l=a(758649),i=a(747280),r=a(71479),E=a(998837),o=a(566723);const s=(0,r.A)(l.A,{shouldForwardProp:e=>!["applyMarginRight","applyMarginLeft"].includes(e)})`
  font-size: 14px !important;
  ${({applyMarginRight:e})=>e&&`margin-right: ${o.Ln};`}
  ${({applyMarginLeft:e})=>e&&`margin-left: ${o.Ln};`}
`,c=({children:e,onClick:t,name:a="remove-button",applyMarginLeft:l=!1,applyMarginRight:r=!1,disabled:o=!1})=>{const{motifPalette:{red06:c}}=(0,E.u)();return n.createElement(s,{name:a,variant:"inline",type:"button",color:"danger",Icon:i.A,iconSize:"original",iconProps:{...!o&&{color:c},disabled:o},onClick:t,applyMarginLeft:l,applyMarginRight:r,disabled:o},e)}},344926:(e,t,a)=>{a.d(t,{P:()=>A,_:()=>m});var n=a(296540),l=a(469733),i=a(459449),r=a(602021),E=a(282556),o=a(498050),s=a(198494),c=a(137298);const _=({timestamp:e})=>n.createElement(n.Fragment,null,new Intl.DateTimeFormat((0,l.useSelector)(E.zi),{hourCycle:(0,l.useSelector)(s.BQ),timeZone:(0,l.useSelector)(r.hq),day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"numeric"}).format(e)),A=[{growthFactor:100,id:"datetime",label:n.createElement(i.sA,{id:"COMMON_CREATED"}),renderCell:({time:e})=>n.createElement(_,{timestamp:e}),minWidth:100},{growthFactor:50,id:"version",label:n.createElement(i.sA,{id:"COMMON_VERSION"}),renderCell:({version:e})=>e,minWidth:50},{growthFactor:50,id:"size",label:n.createElement(i.sA,{id:"COMMON_SIZE"}),renderCell:({size:e})=>(0,c.z3)(e),minWidth:50}],m=e=>{switch(e){case o.Us.Daily:return n.createElement(i.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_DAILY"});case o.Us.Weekly:return n.createElement(i.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_WEEKLY"});case o.Us.Monthly:return n.createElement(i.sA,{id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_MONTHLY"});default:return null}}},706368:(e,t,a)=>{a.r(t),a.d(t,{default:()=>z});var n=a(296540),l=a(469733),i=a(332918),r=a(421289),E=a(162420),o=a(660075),s=a(418562),c=a(71479),_=a(758649),A=a(217439),m=a(617147),T=a(963070),N=a(459449),S=a(441652),d=a(133141),u=a(917536);const M=u.E,O=(e,t)=>e.map(e=>({value:e,label:t({id:"COMMON_DATE_TIME_VALUE_LAST_DAYS"},{days:e})})),C=(e,t)=>[...t?[{value:u.E,label:e({id:"SETTINGS_COMMON_VALUE_SETTINGS_ONLY"})}]:[{value:u.E,label:e({id:"SETTINGS_COMMON_VALUE_SETTINGS_ONLY"})},...O([7,30,60,90,180,365],e),{value:u.f,label:e({id:"SETTINGS_CONTROLLER_MAINTENANCE_VALUES_NO_LIMIT"})}]];var I=a(509092),p=a(84575),L=a(344926),h=a(87485),g=a(126457),D=a(675359),f=a(86392);const R=e=>t=>t((0,f.E)({title:"SETTINGS_AUTO_BACKUP_REMOVE_MODAL_TITLE",titleValues:{count:e.length},message:"SETTINGS_AUTO_BACKUP_REMOVE_MODAL_MESSAGE",messageValues:{names:e.map(({filename:e})=>e).join(", "),count:e.length,strong:N.ko},onConfirm:()=>(async(e,t)=>{const{failureToast:a}=(0,h.rk)("SETTINGS_BACKUP_REMOVE_ERROR");try{for await(const a of e.map(e=>(0,S.TC)(e)))t(a);await t((0,S.wI)())}catch(e){t((0,D.ox)(a(void 0,e)))}t((0,g.AS)())})(e,t)}));var b=a(755825),U=a(525512),y=a(532419),v=a(362412),P=a(566723),k=a(734707),w=a(294303);const G=(0,c.A)(k.Ay)`
  margin-left: ${P.Ln};
  font-size: 14px !important;
`,Y=(0,c.A)(A.A)`
  margin-right: ${P.YC};
`,B=(0,c.A)(_.A)`
  margin-right: ${P.Ln};
`,F=(0,c.A)(o.A)`
  margin-bottom: 2px;
`,x=(0,c.A)(i.A)`
  margin-bottom: 2px;
`,z=()=>{const{formatMessage:e}=(0,N.tz)(),t=(0,l.useDispatch)(),[a,o]=(0,n.useState)([]),[c,u]=(0,n.useState)(M),O=(0,l.useSelector)(p.p),h=(0,l.useSelector)(d.d),f=(0,l.useSelector)(y.YS),k=(0,n.useCallback)(()=>{t((0,g.AS)())},[t]),z=(0,n.useCallback)(async()=>{o([]),t(R(a.map(e=>h.find(({filename:t})=>t===e))))},[a,h,t]),V=(0,n.useCallback)(e=>{e.returnValue=!1},[]),W=(0,n.useCallback)(()=>{const a="pendingBackupListenerId";window.addEventListener("beforeunload",V),(0,U.K6)(["EVT_AD_BackupCreated","EVT_AD_BackupFailed"],()=>{window.removeEventListener("beforeunload",V),(0,U.$N)(a)},!0,a);const n=(0,s.A)();t((0,I.Nz)(n)),t((0,D.ox)({id:n,downloads:[{filename:e({id:"SETTINGS_SYSTEM_MAINTENANCE_SUPPORT_INFORMATION_PREPARING"}),status:e({id:"SETTINGS_SYSTEM_MAINTENANCE_SUPPORT_INFORMATION_FETCHING"}),progress:0,onCancel:()=>{t((0,D.uU)(n)),t((0,I.ro)())},id:`file-${n}`}],duration:0,notificationType:"DownloadsToast"})),t((0,I.tf)(c)),k()},[t,e,k,c,V]),H=(0,n.useCallback)(async()=>{o([]);const n=a.map(a=>{const n=h.find(({filename:e})=>e===a);if(n){const a=(0,s.A)();return t((0,D.ox)({id:a,downloads:[{filename:e({id:"SETTINGS_SYSTEM_MAINTENANCE_SUPPORT_INFORMATION_PREPARING"}),status:e({id:"SETTINGS_SYSTEM_MAINTENANCE_SUPPORT_INFORMATION_FETCHING"}),progress:0,onCancel:()=>{t((0,D.uU)(a))},id:`file-${a}`}],duration:0,notificationType:"DownloadsToast"})),(0,S.Sq)(n,a)}}).filter(e=>e);k();for await(const e of n)t(e)},[a,h,e,t,k]),K=(0,n.useCallback)(()=>{const[e]=a;t((0,I.dH)(h.find(({filename:t})=>t===e)))},[h,a,t]),$=(0,n.useCallback)(({value:e})=>{u(e)},[]);return n.createElement(m.A,{isOpen:!0,size:"small",title:n.createElement(N.sA,{id:"SETTINGS_CONTROLLER_MAINTENANCE_LABEL_EXPORT_CONFIG"}),onRequestClose:k},n.createElement(w.A,{flexDirection:"column"},n.createElement(w.A,{flexDirection:"column",marginBottom:P.Er},n.createElement(w.A,{alignItems:"center",marginBottom:P.xO},n.createElement(Y,{color:"inherit",size:"medium"},n.createElement(N.sA,{id:"SETTINGS_CONTROLLER_MAINTENANCE_LABEL_CURRENT_BACKUP"})),n.createElement(r.A,{description:n.createElement(N.sA,{id:"SETTINGS_CONTROLLER_MAINTENANCE_LABEL_EXPORT_CONFIG_DESCRIPTION"})},n.createElement("span",null,n.createElement(E.A,{isActive:!0,size:"original"})))),n.createElement(w.A,{alignItems:"center"},n.createElement(v.A,{variant:"secondary",value:c,onChange:$,options:C(e,f),width:"100%"}),n.createElement(G,{name:"backupDownload",type:"button",variant:"inline",onClick:W,Icon:i.A,iconProps:{isActive:!O,size:"original",disabled:O},disabled:O},n.createElement(N.sA,{id:"COMMON_DOWNLOAD"})))),h.length>0?n.createElement(w.A,{width:"103%",flexDirection:"column",maxHeight:500,overflow:"scroll"},n.createElement(w.A,{alignItems:"center"},n.createElement(Y,{color:"inherit",size:"medium"},n.createElement(N.sA,{id:"SETTINGS_SYSTEM_AUTO_BACKUP_AVAILABLE_BACKUPS"})),n.createElement(r.A,{description:n.createElement(N.sA,{id:"SETTINGS_SYSTEM_AUTO_BACKUP_AVAILABLE_BACKUPS_DESC"})},n.createElement("span",null,n.createElement(E.A,{isActive:!0,size:"original"})))),n.createElement(T.A,{columns:L.P,items:h,truncateHeaderCells:!0,disableColumnFilters:!0,idField:"filename",multiSelectMode:!0,initialSelectedIds:a,selectedIds:a,onChangeSelection:o}),n.createElement(w.A,{width:"100%",marginTop:P.xO},n.createElement(b.A,{name:"removeBackups",onClick:z,applyMarginRight:!0,disabled:!a.length},n.createElement(N.sA,{id:"COMMON_ACTION_REMOVE"})),n.createElement(B,{name:"downloadBackups",type:"button",variant:"inline",onClick:H,Icon:x,iconProps:{variant:"twoTone",size:"original"},disabled:!a.length},n.createElement(A.A,{size:"medium",color:"inherit"},n.createElement(N.sA,{id:"COMMON_DOWNLOAD"}))),n.createElement(_.A,{name:"restoreBackup",type:"button",variant:"inline",Icon:F,iconProps:{isActive:!0,size:"original"},onClick:K,disabled:!a.length||a.length>1},n.createElement(A.A,{size:"medium",color:"inherit"},n.createElement(N.sA,{id:"COMMON_ACTION_RESTORE"}))))):null))}},498050:(e,t,a)=>{a.d(t,{Sj:()=>m,Us:()=>n,ZV:()=>T,hW:()=>o,tH:()=>c});var n,l=a(296540),i=a(459449),r=a(870443),E=a(682474);!function(e){e.Daily="daily",e.Weekly="weekly",e.Monthly="monthly"}(n||(n={}));const o=e=>[{value:n.Daily,label:e({id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_DAILY"})},{value:n.Weekly,label:e({id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_WEEKLY"})},{value:n.Monthly,label:e({id:"SETTINGS_SYSTEM_MAINTENANCE_UPDATE_FORM_SCHEDULED_LABEL_REPEAT_MONTHLY"})}],s={[n.Daily]:60,[n.Weekly]:25,[n.Monthly]:12,networkServer:100},c=e=>r.A.object().shape({super_mgmt:r.A.object().shape({autobackup_cron_expr:r.A.string().test("isOneDaySelected",l.createElement(i.sA,{id:"COMMON_VALIDATION_DAY"}),e=>"*"===e.slice(-1)||!Number.isNaN(parseInt(e.slice(-1),10))),autobackup_max_files:r.A.number().integer().test({name:"notExceedMaxFileLimit",test:(t,a)=>{const n=(0,E.sq)(a.parent.autobackup_cron_expr),r=e?s.networkServer:s[n];return!(t<1||t>r||!t)||a.createError({message:l.createElement(i.sA,{id:"COMMON_VALIDATION_ALLOWED_NUMBER_IS_MIN_TO_MAX",values:{min:1,max:r}})})}})})}),_={0:"SETTINGS_COMMON_VALUE_SETTINGS_ONLY",7:"SETTINGS_COMMON_X_DAYS",30:"SETTINGS_COMMON_X_DAYS",60:"SETTINGS_COMMON_X_DAYS",90:"SETTINGS_COMMON_X_DAYS",180:"SETTINGS_COMMON_X_DAYS",365:"SETTINGS_COMMON_X_DAYS","-1":"SETTINGS_SYSTEM_AUTO_BACKUP_NO_LIMIT"},A=Object.entries(_),m=(e,t)=>t?[{value:0,label:e({id:_[0]})}]:A.map(([t,a])=>({value:Number(t),label:e({id:a},{days:t})})),T=Array(31).fill(1).map((e,t)=>({value:t+1,label:t+1}))},682474:(e,t,a)=>{a.d(t,{Dh:()=>r,E$:()=>i,sq:()=>l});var n=a(498050);const l=e=>{let t=n.Us.Monthly;const a=e?.split(" ")||[],l=a?.[2],i=a?.[4];return t="*"!==l?n.Us.Monthly:"*"!==i?n.Us.Weekly:n.Us.Daily,t},i=e=>{let t=1,a=n.Us.Monthly,l=0,i=[];const[r,E,o,s,c]=e?.split(" ")||[];return r&&E&&(l=60*(Number(E)||0)+(Number(r)||0)),"*"!==o?(a=n.Us.Monthly,t=+o):"*"!==c?(a=n.Us.Weekly,i=c.split(",").map(Number)):a=n.Us.Daily,[l,a,t,i]},r=(e,t,a,l)=>{const i=Math.floor(e/60),r=e%60;let E,o;switch(t){case n.Us.Daily:break;case n.Us.Weekly:o=l.join(",");break;case n.Us.Monthly:E=a}return((...e)=>e.map(e=>e??"*").join(" "))(r,i,E,undefined,o)}}}]);