File: /var/www/linde/wp-content/plugins/better-wp-security/dist/backup/dashboard.js
/*! For license information please see dashboard.js.LICENSE.txt */
(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[9772],{3075:e=>{e.exports=function(){return this.wp.i18n}()},8601:e=>{e.exports=function(){return this.wp.element}()},10424:e=>{e.exports=function(){return this.itsec.dashboard.dashboard}()},31987:e=>{e.exports=function(){return this.wp.data}()},38125:e=>{e.exports=function(){return this.wp.plugins}()},39959:e=>{e.exports=function(){return this.wp.components}()},46627:e=>{e.exports=function(){return this.itsec.packages.data}()},51609:e=>{"use strict";e.exports=window.React},53948:(e,t,n)=>{"use strict";var r=n(51609),s=n(3075),o=n(38125),i=n(31987),c=n(98883),a=n(81923),u=n(66087),l=n(89959),d=n(88356),p=n(10424),h=n(62932);const m=(0,a.A)(d.ui,{target:"e1jcup595"})({name:"1byzgs2",styles:"display:flex;flex-direction:column;justify-content:space-between;height:100%;overflow:hidden"}),f=(0,a.A)(d.EY,{target:"e1jcup594"})({name:"1dvcxr3",styles:"padding:1rem"}),w=(0,a.A)("div",{target:"e1jcup593"})("flex-grow:1;display:flex;align-items:center;justify-content:center;padding:",(({theme:{getSize:e}})=>e(.5)),";"),E=(0,a.A)(d.ui,{target:"e1jcup592"})({name:"1dkakdy",styles:"display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;justify-content:center;align-items:center;border-radius:50%;height:120px;width:120px"}),y=(0,a.A)(d.EY,{target:"e1jcup591"})({name:"15xxqxm",styles:"& sup{position:absolute;font-size:.5em;line-height:1;}"}),b=(0,a.A)("section",{target:"e1jcup590"})({name:"tsr3y4",styles:"flex-shrink:1;overflow-y:auto;position:relative"}),v={render:(0,i.withDispatch)((e=>({addNotice(t,n){e("core/notices").createSuccessNotice(t,{id:n,context:"ithemes-security"}),setTimeout((()=>e("core/notices").removeNotice(n,"ithemes-security")),1e4)}})))((function({card:e,config:t,addNotice:n}){const o=(0,s._n)("Backup","Backups",e.data.total,"better-wp-security");return(0,r.createElement)(m,null,(0,r.createElement)(p.CardHeader,null,(0,r.createElement)(p.CardHeaderTitle,{card:e,config:t})),(0,u.isEmpty)(e.data)?(0,r.createElement)(f,{as:"p",text:(0,s.__)("Enable database logging or file backups to see a history of completed backups","better-wp-security")}):(0,r.createElement)(React.Fragment,null,(0,r.createElement)(w,null,(0,r.createElement)(E,{as:"section",variant:"secondary"},(0,r.createElement)(y,{size:d.$C.GIGANTIC,variant:d.J3.DARK},(0,h.z6)(e.data.total),e.data.total>99&&(0,r.createElement)("sup",null,"+")),(0,r.createElement)(d.EY,{size:d.$C.LARGE,variant:d.J3.DARK,weight:600,text:o}))),e.data.backups.length>0&&(0,r.createElement)(b,{"aria-label":(0,s.__)("Recent Backups","better-wp-security")},(0,r.createElement)("table",{className:"itsec-card-database-backup__recent-backups"},(0,r.createElement)("thead",null,(0,r.createElement)("tr",null,(0,r.createElement)("th",{scope:"column"},(0,s.__)("Date","better-wp-security")),(0,r.createElement)("th",{scope:"column"},(0,s.__)("Size","better-wp-security")),"files"===e.data.source&&(0,r.createElement)("th",{scope:"column"},(0,r.createElement)("span",{className:"screen-reader-text"},(0,s.__)("Download","better-wp-security"))))),(0,r.createElement)("tbody",null,(0,u.take)(e.data.backups,50).map((t=>(0,r.createElement)("tr",{key:t.url||t.time},(0,r.createElement)("th",{scope:"row"},(0,r.createElement)(d.EY,{weight:600,text:(0,l.dateI18n)("M d, Y g:i A",t.time)})),(0,r.createElement)("td",null,(0,r.createElement)(d.EY,{weight:600,text:t.size_format})),"files"===e.data.source&&(0,r.createElement)("td",null,t.url&&(0,r.createElement)("a",{href:t.url,download:!0},(0,s.__)("Download","better-wp-security")))))))))),(0,r.createElement)(p.CardFooterSchemaActions,{card:e,onComplete:(e,t)=>{e.endsWith("/backup")&&n(t.message,"backup-complete")}}))}))};function g(){const{registerCard:e}=(0,i.useDispatch)("ithemes-security/dashboard");return(0,c.ee)(g,(()=>e("database-backup",v))),null}n.p=window.itsecWebpackPublicPath,(0,s.setLocaleData)({"":{}},"ithemes-security-pro"),(0,o.registerPlugin)("itsec-backup-dashboard",{render:()=>(0,r.createElement)(g,null)})},55933:e=>{e.exports=function(){return this.wp.primitives}()},66087:e=>{"use strict";e.exports=window.lodash},77172:e=>{e.exports=function(){return this.wp.url}()},79860:e=>{e.exports=function(){return this.wp.keycodes}()},89897:e=>{e.exports=function(){return this.wp.compose}()},89959:e=>{e.exports=function(){return this.wp.date}()},98883:(e,t,n)=>{"use strict";n.d(t,{Yb:()=>w,ML:()=>E,$I:()=>b,Mj:()=>v,SV:()=>g,ee:()=>f,sy:()=>u,qY:()=>l,kk:()=>h,wl:()=>p,pq:()=>c});var r=n(58168),s=n(51609),o=n(8601),i=n(89897);function c(e){return(0,i.createHigherOrderComponent)((t=>class extends o.Component{render(){return(0,s.createElement)(t,(0,r.A)({},this.props,e))}}),"withProps")}var a=n(66087);function u(e,t,n={}){return(0,i.createHigherOrderComponent)((r=>class extends o.Component{constructor(){super(...arguments),this.debouncedPropInvoke=(0,a.debounce)(((...t)=>this.props[e](...t)),"function"==typeof t?t(this.props):t,n),this.handler=(e,...t)=>(e&&"function"==typeof e.persist&&e.persist(),this.debouncedPropInvoke(e,...t))}componentWillUnmount(){this.debouncedPropInvoke.cancel()}render(){const t={...this.props,[e]:this.handler};return(0,s.createElement)(r,t)}}),"withDebounceHandler")}function l(e,t){let n;return n=(0,a.isFunction)(t)?[{delay:e,cb:t}]:e,(0,i.createHigherOrderComponent)((e=>class extends o.Component{constructor(){super(...arguments),this.intervalIds=[]}componentDidMount(){for(const e of n)(t=>{this.intervalIds.push(setInterval((()=>t(this.props)),e.delay))})(e.cb)}componentWillUnmount(){this.intervalIds.forEach(clearInterval)}render(){return(0,s.createElement)(e,this.props)}}),"withInterval")}var d=n(64467);(0,i.createHigherOrderComponent)((e=>{var t;return t=class extends o.Component{constructor(...e){super(...e),(0,d.A)(this,"state",{width:1280}),(0,d.A)(this,"mounted",!1),(0,d.A)(this,"ref",null),(0,d.A)(this,"onWindowResize",(()=>{if(!this.mounted)return;const e=(0,o.findDOMNode)(this);if(e instanceof window.HTMLElement){const t=e.offsetWidth;this.setState({width:t})}}))}componentDidMount(){this.mounted=!0,window.addEventListener("resize",this.onWindowResize),document.getElementById("collapse-button").addEventListener("click",this.onWindowResize),this.onWindowResize()}componentWillUnmount(){this.mounted=!1,window.removeEventListener("resize",this.onWindowResize),document.getElementById("collapse-button").removeEventListener("click",this.onWindowResize)}render(){const{measureBeforeMount:t,...n}=this.props;return t&&!this.mounted?(0,s.createElement)("div",{className:this.props.className,style:this.props.style}):(0,s.createElement)(e,(0,r.A)({},n,{width:this.state.width+20}))}},(0,d.A)(t,"defaultProps",{measureBeforeMount:!1}),t}),"withWidth");const p=(0,i.createHigherOrderComponent)((e=>class extends o.Component{constructor(){super(...arguments),(0,d.A)(this,"state",{pressed:{shift:!1,ctrl:!1,meta:!1,alt:!1}}),(0,d.A)(this,"mounted",!1),this.listener=this.listener.bind(this),this.onBlur=this.onBlur.bind(this)}componentDidMount(){this.mounted=!0,window.addEventListener("keydown",this.listener),window.addEventListener("keyup",this.listener),window.addEventListener("click",this.listener),window.addEventListener("blur",this.onBlur)}componentWillUnmount(){this.mounted=!1,window.removeEventListener("keydown",this.listener),window.removeEventListener("keyup",this.listener),window.removeEventListener("click",this.listener),window.removeEventListener("blur",this.onBlur)}listener(e){this.mounted&&this.setState({pressed:{shift:e.shiftKey,ctrl:e.ctrlKey,meta:e.metaKey,alt:e.altKey}})}onBlur(){this.setState({pressed:{shift:!1,ctrl:!1,meta:!1,alt:!1}})}render(){return(0,s.createElement)(e,(0,r.A)({pressedModifierKeys:this.state.pressed},this.props))}}),"withPressedModifierKeys"),h=(0,i.createHigherOrderComponent)((e=>function({navigate:t,...n}){return(0,s.createElement)(e,(0,r.A)({},n,{onClick:e=>{try{n.onClick&&n.onClick(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||n.target&&"_self"!==n.target||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),t())}}))}),"withNavigate"),m=new WeakMap;function f(e,t){(0,o.useLayoutEffect)((()=>{m.has(e)||(t(),m.set(e,!0))}),[])}function w(e,t=!0){const[n,r]=(0,o.useState)("idle"),[s,i]=(0,o.useState)(null),[c,a]=(0,o.useState)(null),u=(0,o.useCallback)(((...t)=>(r("pending"),a(null),e(...t).then((e=>{i(e),r("success")})).catch((e=>{a(e),i(null),r("error")})))),[e]);return(0,o.useEffect)((()=>{t&&u()}),[u,t]),{execute:u,status:n,value:s,error:c}}function E(e,t,n=window){const r=(0,o.useRef)();(0,o.useEffect)((()=>{r.current=t}),[t]),(0,o.useEffect)((()=>{if(!n||!n.addEventListener)return;const t=e=>r.current(e);return n.addEventListener(e,t),()=>n.removeEventListener(e,t)}),[e,n])}const y=["button","submit"];function b(e){const t=(0,o.useRef)(e);(0,o.useEffect)((()=>{t.current=e}),[e]);const n=(0,o.useRef)(!1),r=(0,o.useRef)(),s=(0,o.useCallback)((()=>{clearTimeout(r.current)}),[]);(0,o.useEffect)((()=>()=>s()),[]),(0,o.useEffect)((()=>{e||s()}),[e,s]);const i=(0,o.useCallback)((e=>{const{type:t,target:r}=e;(0,a.includes)(["mouseup","touchend"],t)?n.current=!1:function(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return(0,a.includes)(y,e.type)}return!1}(r)&&(n.current=!0)}),[]),c=(0,o.useCallback)((e=>{e.persist(),n.current||(r.current=setTimeout((()=>{document.hasFocus()?"function"==typeof t.current&&t.current(e):e.preventDefault()}),0))}),[]);return{onFocus:s,onMouseDown:i,onMouseUp:i,onTouchStart:i,onTouchEnd:i,onBlur:c}}function v(e,t){const[n,r]=(0,o.useState)((()=>{try{const n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return console.error(e),t}}));return[n,t=>{try{const s=t instanceof Function?t(n):t;r(s),window.localStorage.setItem(e,JSON.stringify(s))}catch(e){console.error(e)}}]}function g(e){const t=(0,o.useRef)(null),n=(0,o.useRef)(!1),r=(0,o.useRef)(e),s=(0,o.useRef)(e);return s.current=e,(0,o.useLayoutEffect)((()=>{e.forEach(((e,s)=>{const o=r.current[s];"function"==typeof e&&e!==o&&!1===n.current&&(o(null),e(t.current))})),r.current=e}),e),(0,o.useLayoutEffect)((()=>{n.current=!1})),(0,o.useCallback)((e=>{t.current=e,n.current=!0,(e?s.current:r.current).forEach((t=>{"function"==typeof t?t(e):t&&t.hasOwnProperty("current")&&(t.current=e)}))}),[])}n(31987),n(46627)}},e=>{e.O(0,[8356,222,2932],(()=>e(e.s=53948)));var t=e.O();((window.itsec=window.itsec||{}).backup=window.itsec.backup||{}).dashboard=t}]);