laipower/wp-content/plugins/jetpack-protect/build/index.js

31 lines
207 KiB
JavaScript
Raw Normal View History

/*! For license information please see index.js.LICENSE.txt */
!function(){var e={9487:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});const a={AED:{symbol:"د.إ.",grouping:",",decimal:".",precision:2},AFN:{symbol:"؋",grouping:",",decimal:".",precision:2},ALL:{symbol:"Lek",grouping:".",decimal:",",precision:2},AMD:{symbol:"֏",grouping:",",decimal:".",precision:2},ANG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AOA:{symbol:"Kz",grouping:",",decimal:".",precision:2},ARS:{symbol:"$",grouping:".",decimal:",",precision:2},AUD:{symbol:"A$",grouping:",",decimal:".",precision:2},AWG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AZN:{symbol:"₼",grouping:" ",decimal:",",precision:2},BAM:{symbol:"КМ",grouping:".",decimal:",",precision:2},BBD:{symbol:"Bds$",grouping:",",decimal:".",precision:2},BDT:{symbol:"৳",grouping:",",decimal:".",precision:0},BGN:{symbol:"лв.",grouping:" ",decimal:",",precision:2},BHD:{symbol:"د.ب.",grouping:",",decimal:".",precision:3},BIF:{symbol:"FBu",grouping:",",decimal:".",precision:0},BMD:{symbol:"$",grouping:",",decimal:".",precision:2},BND:{symbol:"$",grouping:".",decimal:",",precision:0},BOB:{symbol:"Bs",grouping:".",decimal:",",precision:2},BRL:{symbol:"R$",grouping:".",decimal:",",precision:2},BSD:{symbol:"$",grouping:",",decimal:".",precision:2},BTC:{symbol:"Ƀ",grouping:",",decimal:".",precision:2},BTN:{symbol:"Nu.",grouping:",",decimal:".",precision:1},BWP:{symbol:"P",grouping:",",decimal:".",precision:2},BYR:{symbol:"р.",grouping:" ",decimal:",",precision:2},BZD:{symbol:"BZ$",grouping:",",decimal:".",precision:2},CAD:{symbol:"C$",grouping:",",decimal:".",precision:2},CDF:{symbol:"FC",grouping:",",decimal:".",precision:2},CHF:{symbol:"CHF",grouping:"'",decimal:".",precision:2},CLP:{symbol:"$",grouping:".",decimal:",",precision:2},CNY:{symbol:"¥",grouping:",",decimal:".",precision:2},COP:{symbol:"$",grouping:".",decimal:",",precision:2},CRC:{symbol:"₡",grouping:".",decimal:",",precision:2},CUC:{symbol:"CUC",grouping:",",decimal:".",precision:2},CUP:{symbol:"$MN",grouping:",",decimal:".",precision:2},CVE:{symbol:"$",grouping:",",decimal:".",precision:2},CZK:{symbol:"Kč",grouping:" ",decimal:",",precision:2},DJF:{symbol:"Fdj",grouping:",",decimal:".",precision:0},DKK:{symbol:"kr.",grouping:"",decimal:",",precision:2},DOP:{symbol:"RD$",grouping:",",decimal:".",precision:2},DZD:{symbol:"د.ج.",grouping:",",decimal:".",precision:2},EGP:{symbol:"ج.م.",grouping:",",decimal:".",precision:2},ERN:{symbol:"Nfk",grouping:",",decimal:".",precision:2},ETB:{symbol:"ETB",grouping:",",decimal:".",precision:2},EUR:{symbol:"€",grouping:".",decimal:",",precision:2},FJD:{symbol:"FJ$",grouping:",",decimal:".",precision:2},FKP:{symbol:"£",grouping:",",decimal:".",precision:2},GBP:{symbol:"£",grouping:",",decimal:".",precision:2},GEL:{symbol:"Lari",grouping:" ",decimal:",",precision:2},GHS:{symbol:"₵",grouping:",",decimal:".",precision:2},GIP:{symbol:"£",grouping:",",decimal:".",precision:2},GMD:{symbol:"D",grouping:",",decimal:".",precision:2},GNF:{symbol:"FG",grouping:",",decimal:".",precision:0},GTQ:{symbol:"Q",grouping:",",decimal:".",precision:2},GYD:{symbol:"G$",grouping:",",decimal:".",precision:2},HKD:{symbol:"HK$",grouping:",",decimal:".",precision:2},HNL:{symbol:"L.",grouping:",",decimal:".",precision:2},HRK:{symbol:"kn",grouping:".",decimal:",",precision:2},HTG:{symbol:"G",grouping:",",decimal:".",precision:2},HUF:{symbol:"Ft",grouping:".",decimal:",",precision:0},IDR:{symbol:"Rp",grouping:".",decimal:",",precision:0},ILS:{symbol:"₪",grouping:",",decimal:".",precision:2},INR:{symbol:"₹",grouping:",",decimal:".",precision:2},IQD:{symbol:"د.ع.",grouping:",",decimal:".",precision:2},IRR:{symbol:"﷼",grouping:",",decimal:"/",precision:2},ISK:{symbol:"kr.",grouping:".",decimal:",",precision:0},JMD:{symbol:"J$",grouping:",",decimal:".",precision:2},JOD:{symbol:"د.ا.",grouping:",",decimal:".",precision:3},JPY:{symbol:"¥",grouping:",",decimal:".",precision:0},KES:{symbol:"S",grouping:",",decimal:".",precision:2},KGS:{symbol:"сом",grouping:" ",decimal:"-",precision:2},KHR:{symbol:"៛",grouping:",
__("There was an error reconnecting Jetpack. Error: %s","jetpack-protect"),s))):null;return u().createElement(u().Fragment,null,h,u().createElement(c.Notice,{status:"error",isDismissible:!1,className:p},u().createElement("div",{className:m.Z.message},d,t),o&&u().createElement("a",{onClick:o,onKeyDown:o,className:m.Z.button,href:"#"},__("Restore Connection","jetpack-protect"))))};p.propTypes={message:s().string.isRequired,restoreConnectionCallback:s().func,isRestoringConnection:s().bool,restoreConnectionError:s().string},t.Z=p},1294:function(e,t,n){"use strict";var a=n(4743),r=n(9818),c=n(9196),i=n(428);const o=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};t.Z=function(){let{registrationNonce:e=o.registrationNonce,apiRoot:t=o.apiRoot,apiNonce:n=o.apiNonce,redirectUri:s,autoTrigger:l,from:u,skipUserConnection:m}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{registerSite:p,connectUser:d,refreshConnectedPlugins:h}=(0,r.useDispatch)(i.t),g=(0,r.useSelect)((e=>e(i.t).getRegistrationError())),{siteIsRegistering:f,userIsConnecting:v,userConnectionData:E,connectedPlugins:y,connectionErrors:b,isRegistered:k,isUserConnected:Z,hasConnectedOwner:C}=(0,r.useSelect)((e=>({siteIsRegistering:e(i.t).getSiteIsRegistering(),userIsConnecting:e(i.t).getUserIsConnecting(),userConnectionData:e(i.t).getUserConnectionData(),connectedPlugins:e(i.t).getConnectedPlugins(),connectionErrors:e(i.t).getConnectionErrors(),...e(i.t).getConnectionStatus()}))),w=()=>m?s?(window.location=s,Promise.resolve(s)):Promise.resolve():d({from:u,redirectUri:s}),_=t=>(t&&t.preventDefault(),k?w():p({registrationNonce:e,redirectUri:s}).then((()=>w())));return(0,c.useEffect)((()=>{a.ZP.setApiRoot(t),a.ZP.setApiNonce(n)}),[t,n]),(0,c.useEffect)((()=>{!l||f||v||_()}),[]),{handleRegisterSite:_,handleConnectUser:w,refreshConnectedPlugins:h,isRegistered:k,isUserConnected:Z,siteIsRegistering:f,userIsConnecting:v,registrationError:g,userConnectionData:E,hasConnectedOwner:C,connectedPlugins:y,connectionErrors:b}}},3329:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},h:function(){return o}});var a=n(6186),r=n(1294),c=n(1045);function i(){const{connectionErrors:e}=(0,r.Z)({}),t=Object.values(e).shift(),n=t&&Object.values(t).length&&Object.values(t).shift().error_message;return{hasConnectionError:Boolean(n),connectionErrorMessage:n}}const o=()=>{const{hasConnectionError:e,connectionErrorMessage:t}=i(),{restoreConnection:n,isRestoringConnection:r,restoreConnectionError:o}=(0,c.Z)();return e?React.createElement(a.Z,{isRestoringConnection:r,restoreConnectionError:o,restoreConnectionCallback:n,message:t}):null}},8258:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var a=n(4743),r=n(4153),c=n(9818),i=n(9196),o=n(1294),s=n(428);const{registrationNonce:l,apiRoot:u,apiNonce:m,siteSuffix:p}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function d(){let{productSlug:e,redirectUrl:t,siteSuffix:n=p,siteProductAvailabilityHandler:d=null,from:h}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[g,f]=(0,i.useState)(!1),{registerSite:v}=(0,c.useDispatch)(s.t),{isUserConnected:E,isRegistered:y,handleConnectUser:b}=(0,o.Z)({redirectUri:t,from:h}),k=(0,r.Z)(e,n,t,E),Z=()=>Promise.resolve(d&&d()).then((e=>{if(e)return b();window.location.href=k})),C=e=>{if(e&&e.preventDefault(),f(!0),y)return Z();v({registrationNonce:l,redirectUri:t}).then(Z)};return(0,i.useEffect)((()=>{a.ZP.setApiRoot(u),a.ZP.setApiNonce(m)}),[]),{run:C,isRegistered:y,hasCheckoutStarted:g}}},1045:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var a=n(4743),r=n(9818),c=n(9196),i=n(428);const{apiRoot:o,apiNonce:s}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function l(){const[e,t]=(0,c.useState)(!1),[n,l]=(0,c.useState)(null),{disconnectUserSuccess:u}=(0,r.useDispatch)(i.t),m="/wp-admin/admin.php?page=my-jetpack#/connection";return(0,c.useEffect)((()=>{a.ZP.setApiRoot(o),a.ZP.setApiNonce(s)}),[]),{restoreConnection:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||argu
__("Show %s more","jetpack-protect"),f):(0,r.sprintf)(/* translators: %s: Number of hide items */
__("Hide %s items","jetpack-protect"),f)))))}},5338:function(e,t,n){"use strict";n.d(t,{Dx:function(){return h.Z},KB:function(){return d.Z}});var a=n(5106),r=n(5609),c=n(5736),i=n(1074),o=n(7489),s=n(2229),l=n(5235),u=n.n(l),m=n(9196),p=n.n(m),d=n(2328),h=n(6119),g=n(513),f=n(246);const __=c.__,v=e=>{let{children:t}=e;return p().createElement("ul",{className:g.Z.navigation,role:"menu"},t)},E=e=>{let{children:t,data:n}=e;const c=(0,m.useRef)(),[l,d]=(0,m.useState)(!1),h=n?.items?.find((e=>e?.id===n?.selectedItem))??{label:__("See all results","jetpack-protect")},{label:f,icon:v}=h,E=(0,m.useCallback)((()=>{d((e=>!e))}),[]);return p().createElement("button",{className:g.Z["navigation-dropdown-button"],onClick:E,ref:c},p().createElement("div",{className:g.Z["navigation-dropdown-label"]},v&&p().createElement(i.Z,{icon:v,className:g.Z["navigation-dropdown-icon"]}),p().createElement(a.ZP,null,f)),p().createElement(i.Z,{icon:l?o.Z:s.Z,size:32}),p().createElement(r.Popover,{position:"bottom center",anchorRef:c?.current,className:u()({[g.Z["navigation-dropdown-open"]]:l,[g.Z["navigation-dropdown-closed"]]:!l})},p().createElement("div",{style:{width:c?.current?.getBoundingClientRect?.()?.width}},t)))};t.ZP=e=>{let{children:t,selected:n,onSelect:a,mode:r="list"}=e;const c=(0,f.Z)({selected:n,onSelect:a}),i=(e=>{switch(e){case"list":default:return v;case"dropdown":return E}})(r);return p().createElement(f.k.Provider,{value:{...c,mode:r}},p().createElement(i,{data:c},t))}},6119:function(e,t,n){"use strict";var a=n(5235),r=n.n(a),c=n(9196),i=n.n(c),o=n(5167),s=n(2389),l=n(513),u=n(246);t.Z=e=>{let{id:t,label:n,icon:a,badge:m,disabled:p,onClick:d,onKeyDown:h,onFocus:g,checked:f}=e;const v=(0,c.useContext)(u.k),E=v?.selectedItem===t,y=v?.registerItem,b=v?.registerRef,k=v?.handleClickItem,Z=v?.handleKeyDownItem,C=v?.handleFocusItem,w=r()(l.Z["navigation-item"],{[l.Z.clickable]:!p,[l.Z.selected]:E}),_=(0,c.useCallback)((e=>{d?.(e),k?.(t)}),[k,t,d]),R=(0,c.useCallback)((e=>{h?.(e),Z?.(e)}),[Z,h]),S=(0,c.useCallback)((e=>{b(e,t)}),[b,t]),j=(0,c.useCallback)((e=>{g?.(e),C?.(t)}),[C,t,g]);return(0,c.useEffect)((()=>{y({id:t,disabled:p,label:n,icon:a})}),[]),i().createElement("li",{className:w,onClick:p?null:_,onKeyDown:R,onFocus:p?null:j,role:"menuitem",tabIndex:p?-1:0,ref:S},i().createElement(s.Z,{icon:a},n),i().createElement(o.Z,{count:m,checked:f}))}},2389:function(e,t,n){"use strict";var a=n(5106),r=n(1074),c=n(5235),i=n.n(c),o=n(5162),s=n.n(o),l=n(9196),u=n.n(l),m=n(513);const p=e=>{let{icon:t,children:n,className:c}=e;return u().createElement(a.ZP,{className:i()(m.Z["navigation-item-label"],c)},t&&u().createElement(r.Z,{icon:t,className:m.Z["navigation-item-icon"],size:28}),u().createElement("span",{className:m.Z["navigation-item-label-content"]},n))};p.propTypes={icon:s().node,children:s().node.isRequired},t.Z=p},246:function(e,t,n){"use strict";n.d(t,{k:function(){return r}});var a=n(9196);const r=n.n(a)().createContext();t.Z=e=>{let{selected:t,onSelect:n}=e;const[r,c]=(0,a.useState)([]),[i,o]=(0,a.useState)([]),[s,l]=(0,a.useState)(),u=(e,t)=>{const n=e-1,a=n<0?t:n,c=r[a];return c?.disabled?u(a,t):c},m=(e,t)=>{const n=e+1,a=n>t?0:n,c=r[a];return c?.disabled?m(a,t):c};return{selectedItem:t,handleClickItem:e=>{n(e)},handleKeyDownItem:e=>{const a=e?.code,c=r.findIndex((e=>e?.id===t)),o=r.length-1;let l;if("ArrowUp"===a){l=u(c,o)?.id}else if("ArrowDown"===a){l=m(c,o)?.id}else"Enter"!==a&&"Space"!==a||!s||(l=s);if(l){i[l]?.focus(),n(l)}},handleFocusItem:e=>{l(e)},registerRef:(e,t)=>{o((n=>!n[t]&&e?{...n,[t]:e}:n))},registerItem:e=>{c((t=>{const n=[...t],a=e?.id,r=n.findIndex((e=>e?.id===a));return r>=0?n[r]=e:n.push(e),n}))},items:r}}},291:function(e,t,n){"use strict";var a=n(9818),r=n(5736),c=n(9201),i=n(797),o=n(496),s=n(1074),l=n(9517),u=n(9196),m=n(4633),p=n(8212);const __=r.__;t.Z=e=>{let{dismissable:t=!1,duration:n=null,floating:r=!1,message:d,type:h="success"}=e;const{clearNotice:g}=(0,a.useDispatch)(m.t);let f;switch(h){case"success":f=c.Z;break;case"error":f=i.Z;break;default:f=o.Z}const v=(0,u.useCallback)((()=>{g()}),[g]);retu
__("Latest results as of %s","jetpack-protect"),(0,l.dateI18n)("F jS",t))),e>0&&p().createElement(i.ZP,{variant:"headline-small",component:"h1"},(0,u.sprintf)(/* translators: %s: Total number of threats */
__("%1$s %2$s found","jetpack-protect"),e,1===e?"threat":"threats"))),p().createElement("div",{className:f.Z.summary__notice},m&&m.message&&p().createElement(g.Z,m)),n&&0===e&&p().createElement(o.Z,{variant:"secondary",className:f.Z["summary__scan-button"],isLoading:v,onClick:e=>{e.preventDefault(),E()}},__("Scan now","jetpack-protect")))))}},3324:function(e,t,n){"use strict";n.d(t,{O:function(){return c}});var a=n(554),r=n(5714);const c=e=>{let{label:t,link:n}=e;return React.createElement(a.OL,{to:n,className:e=>{let{isActive:t}=e;return t?`${r.Z.tab} ${r.Z["tab--active"]}`:r.Z.tab}},t)};t.Z=e=>{let{children:t,className:n=""}=e;return React.createElement("nav",{className:`${r.Z.tabs} ${n}`},t)}},9265:function(e,t,n){"use strict";var a=n(8063);t.Z=e=>{let{disabled:t=!1,id:n,label:r="",placeholder:c="",rows:i=3,value:o="",onChange:s=(()=>{})}=e;return React.createElement("div",null,Boolean(r)&&React.createElement("label",{className:a.Z.label,htmlFor:n},r),React.createElement("textarea",{className:a.Z.textarea,disabled:t,placeholder:c,rows:i,id:n,name:n,onChange:s,value:o||""}))}},8891:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(5106),r=n(5736),c=n(1074),i=n(9196),o=n.n(i),s=n(2251),l=n(9971);const __=r.__;function u(e){let{threat:t,fixAllDialog:n,onCheckFix:u}=e;const[m,p]=(0,i.useState)(!0),d=(0,i.useCallback)((e=>{p(e.target.checked),u(e.target.checked,t)}),[u,t]);return o().createElement(o().Fragment,null,o().createElement("div",{className:l.Z.threat},o().createElement(c.Z,{icon:t.icon,className:l.Z.threat__icon}),o().createElement("div",{className:l.Z.threat__summary},o().createElement(a.ZP,{className:l.Z.threat__summary__label,mb:1},t.label),o().createElement(a.ZP,{className:l.Z.threat__summary__title},(e=>{switch(e.fixer){case"replace":return __("Jetpack Scan will replace the affected file or directory.","jetpack-protect");case"delete":return __("Jetpack Scan will delete the affected file or directory.","jetpack-protect");case"update":return e.target?(0,r.sprintf)(/* translators: %s: Version that the plugin will be upgraded to */
__("Jetpack Scan will update to a newer version %s.","jetpack-protect"),e.target):__("Jetpack Scan will update to a newer version.","jetpack-protect");case"edit":return __("Jetpack Scan will edit the affected file or directory.","jetpack-protect");case"rollback":return e.target?(0,r.sprintf)(/* translators: %s: Version that the plugin will be upgraded to */
__("Jetpack Scan will rollback the affected file to the version from %s.","jetpack-protect"),e.target):__("Jetpack Scan will rollback the affected file to an older (clean) version.","jetpack-protect");default:return __("Jetpack Scan will resolve the threat.","jetpack-protect")}})(t.fixable))),o().createElement("div",{className:l.Z.threat__severity},o().createElement(s.Z,{severity:t.severity})),n&&o().createElement("div",{className:l.Z.threat__checkbox},o().createElement("input",{type:"checkbox",checked:m,onChange:d,value:t.id}))))}},5658:function(e,t,n){"use strict";var a=n(5106),r=n(9307),c=n(5736),i=n(9196),o=n(5773),s=n(9709);const __=c.__,_n=c._n,l=()=>React.createElement("svg",{width:"80",height:"96",viewBox:"0 0 80 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40 0.00634766L80 17.7891V44.2985C80 66.8965 65.1605 88.2927 44.2352 95.0425C41.4856 95.9295 38.5144 95.9295 35.7648 95.0425C14.8395 88.2927 0 66.8965 0 44.2985V17.7891L40 0.00634766Z",fill:"#069E08"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.9 33.6909L35.375 67.9124L19.2047 55.9263L22.7848 51.1264L34.1403 59.5436L56.0851 30.122L60.9 33.6909Z",fill:"white"}));t.Z=()=>{const{lastChecked:e}=(0,o.Z)(),t=(0,i.useMemo)((()=>e?(e=>{const t=new Date,n=6e4*t.getTimezoneOffset(),a=Math.floor((new Date(t.getTime()+n).getTime()-e)/1e3);let r=a/31536e3;return r>1?(0,c.sprintf)(
// translators: placeholder is a number amount of years i.e. "5 years ago".
_n("%s year ago","%s years ago",Math.floor(r),"jetpack-protect"),Math.floor(r)):(r=a/2592e3,r>1?(0,c.sprintf)(
// translators: placeholder is a number amount of months i.e. "5 months ago".
_n("%s month ago","%s months ago",Math.floor(r),"jetpack-protect"),Math.floor(r)):(r=a/86400,r>1?(0,c.sprintf)(
// translators: placeholder is a number amount of days i.e. "5 days ago".
_n("%s day ago","%s days ago",Math.floor(r),"jetpack-protect"),Math.floor(r)):(r=a/3600,r>1?(0,c.sprintf)(
// translators: placeholder is a number amount of hours i.e. "5 hours ago".
_n("%s hour ago","%s hours ago",Math.floor(r),"jetpack-protect"),Math.floor(r)):(r=a/60,r>1?(0,c.sprintf)(
// translators: placeholder is a number amount of minutes i.e. "5 minutes ago".
_n("%s minute ago","%s minutes ago",Math.floor(r),"jetpack-protect"),Math.floor(r)):__("a few seconds ago","jetpack-protect")))))})(Date.parse(e)):null),[e]);return React.createElement("div",{className:s.Z.empty},React.createElement(l,null),React.createElement(a.H3,{weight:"bold",mt:8},__("Don't worry about a thing","jetpack-protect")),React.createElement(a.ZP,null,(0,r.createInterpolateElement)((0,c.sprintf)(
// translators: placeholder is the amount of time since the last scan, i.e. "5 minutes ago".
__("The last Protect scan ran <strong>%s</strong> and everything looked great.","jetpack-protect"),t),{strong:React.createElement("strong",null)})))}},2831:function(e,t,n){"use strict";var a=n(526),r=n(5106),c=n(857),i=n(8258),o=n(5736),s=n(9196),l=n.n(s),u=n(6477),m=n(7267),p=n(3584),d=n(9709);const __=o.__,h=e=>{let{description:t,filename:n,fixedIn:h,icon:g,id:f,name:v,source:E,table:y,title:b,type:k,version:Z}=e;const{adminUrl:C}=window.jetpackProtectInitialState||{},{run:w}=(0,i.Z)({productSlug:m.Q,redirectUrl:C}),{recordEventHandler:_}=(0,u.Z)(),R=_("jetpack_protect_threat_list_get_scan_link_click",w),S=E?l().createElement(a.Z,{variant:"link",isExternalLink:!0,weight:"regular",href:E},__("See more technical details of this threat","jetpack-protect")):null,j=(0,s.useCallback)((()=>v&&Z?`${v} (${Z})`:n?n.split("/").pop():y||void 0),[n,v,y,Z]);return l().createElement(p.U,{id:f,label:j(),title:b,icon:g,onOpen:(0,s.useCallback)((()=>{["core","plugin","theme"].includes(k)&&_(`jetpack_protect_${k}_threat_open`)}),[_,k])},t&&l().createElement("div",{className:d.Z["threat-section"]},l().createElement(r.ZP,{variant:"title-small",mb:2},__("What is the problem?","jetpack-protect")),l().createElement(r.ZP,{mb:2},t),S),h&&l().createElement("div",{className:d.Z["threat-section"]},l().createElement(r.ZP,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),l().createElement(r.ZP,{mb:2},/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */
(0,o.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),v,h)),l().createElement(c.Z,{description:__("Looking for advanced scan results and one-click fixes?","jetpack-protect"),cta:__("Upgrade Jetpack Protect now","jetpack-protect"),onClick:R,className:d.Z["threat-item-cta"]})),!t&&l().createElement("div",{className:d.Z["threat-section"]},S))};t.Z=e=>{let{list:t}=e;return l().createElement(p.Z,null,t.map((e=>{let{description:t,fixedIn:n,icon:a,id:r,name:c,source:i,table:o,title:s,type:u,version:m}=e;return l().createElement(h,{description:t,fixedIn:n,icon:a,id:r,key:r,name:c,source:i,table:o,title:s,type:u,version:m})})))}},5207:function(e,t,n){"use strict";var a=n(3363),r=n(3846),c=n(5106),i=n(526),o=n(9818),s=n(5736),l=n(9196),u=n.n(l),m=n(5773),p=n(4633),d=n(5658),h=n(2831),g=n(4289),f=n(1400),v=n(9709),E=n(7930);const __=s.__;t.Z=()=>{const{hasRequiredPlan:e}=(0,m.Z)(),{item:t,list:n,selected:y,setSelected:b}=(0,E.Z)(),k=n.filter((e=>e.fixable)),{setModal:Z}=(0,o.useDispatch)(p.t),{scan:C}=(0,o.useDispatch)(p.t),w=(0,o.useSelect)((e=>e(p.t).getScanIsEnqueuing())),_=(0,l.useCallback)((()=>{switch(y){case"all":return(0,s.sprintf)(/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */
__("All %s threats","jetpack-protect"),n.length);case"files":return(0,s.sprintf)(/* translators: placeholder is the amount of file threats found on the site. */
__("%1$s file %2$s","jetpack-protect"),n.length,1===n.length?"threat":"threats");case"database":return(0,s.sprintf)(/* translators: placeholder is the amount of database threats found on the site. */
__("%1$s database %2$s","jetpack-protect"),n.length,1===n.length?"threat":"threats");default:return(0,s.sprintf)(/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */
__("%1$s %2$s in your %3$s %4$s","jetpack-protect"),n.length,1===n.length?"threat":"threats",t?.name,t?.version)}}),[y,n,t]);return u().createElement(a.Z,{fluid:!0,horizontalSpacing:0,horizontalGap:3},u().createElement(r.Z,{lg:4},u().createElement(g.Z,{selected:y,onSelect:b})),u().createElement(r.Z,{lg:8},n?.length>0?u().createElement(u().Fragment,null,u().createElement("div",{className:v.Z["list-header"]},u().createElement(c.Dx,{className:v.Z["list-title"]},_()),e&&u().createElement(u().Fragment,null,k.length>0&&u().createElement(i.Z,{variant:"primary",className:v.Z["list-header-button"],onClick:(R=k,e=>{e.preventDefault(),Z({type:"FIX_ALL_THREATS",props:{threatList:R}})})},/* translators: Translates to Auto fix all. $s: Number of fixable threats. */
(0,s.sprintf)(__("Auto fix all (%s)","jetpack-protect"),k.length)),u().createElement(i.Z,{variant:"secondary",className:v.Z["list-header-button"],isLoading:w,onClick:e=>{e.preventDefault(),C()}},__("Scan now","jetpack-protect")))),e?u().createElement(f.Z,{list:n}):u().createElement(h.Z,{list:n})):u().createElement(d.Z,null)));var R}},4289:function(e,t,n){"use strict";var a=n(2054),r=n(5736),c=n(797),i=n(2817),o=n(7663),s=n(8960),l=n(4160),u=n(6376),m=n(9196),p=n(6477),d=n(5773),h=n(5338);const __=r.__;t.Z=e=>{let{selected:t,onSelect:n}=e;const{plugins:r,themes:g,numThreats:f,numCoreThreats:v,numFilesThreats:E,numDatabaseThreats:y,hasRequiredPlan:b}=(0,d.Z)(),{recordEvent:k}=(0,p.Z)(),[Z]=(0,a.Z)("lg","<"),C=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_all_click")}),[k]),w=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_core_click")}),[k]),_=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_plugin_click")}),[k]),R=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_theme_click")}),[k]),S=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_file_click")}),[k]),j=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_database_click")}),[k]);return React.createElement(h.ZP,{selected:t,onSelect:n,mode:Z?"dropdown":"list"},React.createElement(h.Dx,{initial:!0,id:"all",label:__("All threats","jetpack-protect"),icon:c.Z,badge:f,disabled:f<=0,onClick:C,checked:!0}),React.createElement(h.Dx,{id:"wordpress",label:__("WordPress","jetpack-protect"),icon:i.Z,badge:v,disabled:v<=0,onClick:w,checked:!0}),React.createElement(h.KB,{label:__("Plugins","jetpack-protect"),icon:o.Z},r.map((e=>{let{name:t,threats:n,checked:a}=e;return React.createElement(h.Dx,{key:t,id:t,label:t,checked:a,badge:n?.length,disabled:n?.length<=0,onClick:_})}))),React.createElement(h.KB,{label:__("Themes","jetpack-protect"),icon:s.Z},g.map((e=>{let{name:t,threats:n,checked:a}=e;return React.createElement(h.Dx,{key:t,id:t,label:t,checked:a,badge:n?.length,disabled:n?.length<=0,onClick:R})}))),b&&React.createElement(React.Fragment,null,React.createElement(h.Dx,{id:"files",label:__("Files","jetpack-protect"),icon:l.Z,badge:E,disabled:E<=0,onClick:S,checked:!0}),React.createElement(h.Dx,{id:"database",label:__("Database","jetpack-protect"),icon:u.Z,badge:y,disabled:y<=0,onClick:j,checked:!0})))}},1400:function(e,t,n){"use strict";var a=n(526),r=n(5106),c=n(2054),i=n(9818),o=n(9307),s=n(5736),l=n(9196),u=n.n(l),m=n(6477),p=n(4633),d=n(7127),h=n(4257),g=n(289),f=n(9709);const __=s.__,v=e=>{let{context:t,description:n,diff:c,filename:o,fixedIn:v,icon:E,fixable:y,id:b,label:k,name:Z,source:C,title:w,type:_,severity:R}=e;const{setModal:S}=(0,i.useDispatch)(p.t),{recordEvent:j}=(0,m.Z)(),N=C?u().createElement(a.Z,{variant:"link",isExternalLink:!0,weight:"regular",href:C},__("See more technical details of this threat","jetpack-protect")):null;return u().createElement(g.c,{id:b,label:k,title:w,icon:E,fixable:y,severity:R,onOpen:(0,l.useCallback)((()=>{["core","plugin","theme","file","database"].includes(_)&&j(`jetpack_protect_${_}_threat_open`)}),[j,_])},n&&u().createElement("div",{className:f.Z["threat-section"]},u().createElement(r.ZP,{variant:"title-small",mb:2},__("What is the problem?","jetpack-protect")),u().createElement(r.ZP,{mb:2},n),N),(o||t||c)&&u().createElement(r.ZP,{variant:"title-small",mb:2},__("The technical details","jetpack-protect")),o&&u().createElement(u().Fragment,null,u().createElement(r.ZP,{mb:2},/* translators: filename follows in separate line; e.g. "PHP.Injection.5 in: `post.php`" */
__("Threat found in file:","jetpack-protect")),u().createElement("pre",{className:f.Z["threat-filename"]},o)),t&&u().createElement(h.Z,{context:t}),c&&u().createElement(d.C,{diff:c}),v&&u().createElement("div",{className:f.Z["threat-section"]},u().createElement(r.ZP,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),u().createElement(r.ZP,{mb:2},/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */
(0,s.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),Z,v))),!n&&u().createElement("div",{className:f.Z["threat-section"]},N),u().createElement("div",{className:f.Z["threat-footer"]},u().createElement(a.Z,{isDestructive:!0,variant:"secondary",onClick:e=>{e.preventDefault(),S({type:"IGNORE_THREAT",props:{id:b,label:k,title:w,icon:E,severity:R}})}},__("Ignore threat","jetpack-protect")),y&&u().createElement(a.Z,{onClick:e=>{e.preventDefault(),S({type:"FIX_THREAT",props:{id:b,label:k,title:w,icon:E,severity:R,fixable:y}})}},__("Fix threat","jetpack-protect"))))};t.Z=e=>{let{list:t}=e;const{scan:n}=(0,i.useDispatch)(p.t),s=(0,o.createInterpolateElement)(__("If you have manually fixed any of the threats listed above, <manualScanLink>you can run a manual scan now</manualScanLink> or wait for Jetpack to scan your site later today.","jetpack-protect"),{manualScanLink:u().createElement(a.Z,{variant:"link",onClick:e=>{e.preventDefault(),n()}})}),[l]=(0,c.Z)(["sm","lg"],[null,"<"]),m=e=>e.name&&e.version?`${e.name} (${e.version})`:e.filename?e.filename.split("/").pop():e.table?e.table:void 0;return t=t.map((e=>({label:m(e),...e}))),u().createElement(u().Fragment,null,!l&&u().createElement("div",{className:f.Z["accordion-heading"]},u().createElement("span",null,__("Details","jetpack-protect")),u().createElement("span",null,__("Severity","jetpack-protect")),u().createElement("span",null,__("Auto-fix","jetpack-protect")),u().createElement("span",null)),u().createElement(g.Z,null,t.map((e=>{let{context:t,description:n,diff:a,filename:r,fixedIn:c,icon:i,fixable:o,id:s,label:l,name:m,severity:p,source:d,table:h,title:g,type:f,version:E}=e;return u().createElement(v,{context:t,description:n,diff:a,filename:r,fixedIn:c,icon:i,fixable:o,id:s,key:s,label:l,name:m,severity:p,source:d,table:h,title:g,type:f,version:E})}))),u().createElement(r.ZP,{className:f.Z["manual-scan"],variant:"body-small"},s))}},7930:function(e,t,n){"use strict";var a=n(2817),r=n(7663),c=n(8960),i=n(4160),o=n(6376),s=n(9196),l=n(5773);const u=(e,t)=>Array.isArray(e)?e.map((e=>u(e,t))).flat():e?.threats?.map((n=>({...n,...e,icon:t}))),m=e=>{let{core:t,plugins:n,themes:s,files:l,database:m}=e;return[...u(t,a.Z),...u(n,r.Z),...u(s,c.Z),...u(l,i.Z),...u(m,o.Z)]};t.Z=()=>{const{plugins:e,themes:t,core:n,files:p,database:d}=(0,l.Z)();let h=m({core:n,plugins:e,themes:t,files:p,database:d}),g={};const[f,v]=(0,s.useState)(h.length?"all":null);switch(f){case"all":h=m({core:n,plugins:e,themes:t,files:p,database:d});break;case"wordpress":h=u(n,a.Z),g=n;break;case"files":h=u(p,i.Z),g=p;break;case"database":h=u(d,o.Z),g=d}const E=e.find((e=>e?.name===f));E&&(h=u(E,r.Z),g=E);const y=t.find((e=>e?.name===f));return y&&(h=u(y,c.Z),g=y),{item:g,list:h,selected:f,setSelected:v}}},2854:function(e,t,n){"use strict";var a=n(1294),r=n(8227);t.Z=e=>{let{children:t}=e;const{isUserConnected:n,hasConnectedOwner:c}=(0,a.Z)();return n&&c?t:React.createElement(r.Z,null)}},8227:function(e,t,n){"use strict";var a=n(5106),r=n(526),c=n(1294),i=n(9818),o=n(5736),s=n(4633),l=n(291),u=n(541);const __=o.__;t.Z=()=>{const{setModal:e}=(0,i.useDispatch)(s.t),{userIsConnecting:t,handleConnectUser:n}=(0,c.Z)({redirectUri:"admin.php?page=jetpack-protect"});return React.createElement(React.Fragment,null,React.createElement(a.ZP,{variant:"title-medium",mb:2},__("User connection needed","jetpack-protect")),React.createElement(l.Z,{type:"info",message:__("Before Jetpack Protect can ignore and auto-fix threats on your site, a user connection is needed.","jetpack-protect")}),React.createElement(a.ZP,{mb:3},__("A user connection provides Jetpack Protect the access necessary to perform these tasks.","jetpack-protect")),React.createElement(a.ZP,{mb:3},__("Once youve secured a user connection, all Jetpack Protect features will be available for use.","jetpack-protect")),React.createElement("div",{className:u.Z.footer},React.createElement(r.Z,{variant:"secondary",onClick:t=>{t.preventDefault(),e({type:null})}},__("Not now","jetpack-protect")),React.createElement(r.Z,{isExternalLink:!0,weight:"regular",isLoading:t,onC
// translators: placeholder is the number amount of fixed threats.
_n("%s threat was fixed successfully","%s threats were fixed successfully",e.length,"jetpack-protect"),e.length)}))})).catch((()=>{n(U({type:"error",message:__("Not all threats could be fixed. Please contact our support.","jetpack-protect")}))})).finally((()=>{n(D([]))}))},U=e=>({type:C,payload:e}),B=e=>({type:_,hasRequiredPlan:e}),J={checkCredentials:()=>async e=>{let{dispatch:t}=e;return await new Promise(((e,n)=>(t(L(!0)),r()({path:"jetpack-protect/v1/check-credentials",method:"POST"}).then((n=>{t(z(n)),e(n)})).catch((e=>{n(e)})).finally((()=>{t(L(!1))})))))},setCredentials:z,setCredentialsIsFetching:L,setStatus:P,setStatusProgress:e=>({type:m,currentProgress:e}),startScanOptimistically:x,refreshStatus:M,setStatusIsFetching:A,setScanIsEnqueuing:F,setInstalledPlugins:e=>({type:f,plugins:e}),setInstalledThemes:e=>({type:v,themes:e}),setwpVersion:e=>({type:E,version:e}),setJetpackScan:e=>({type:y,scan:e}),ignoreThreat:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return async n=>{let{dispatch:a}=n;return a(O(e,!0)),await new Promise((()=>r()({path:`jetpack-protect/v1/ignore-threat?threat_id=${e}`,method:"POST"}).then((()=>a(M()))).then((()=>a(U({type:"success",message:__("Threat ignored","jetpack-protect")})))).catch((()=>a(U({type:"error",message:__("An error ocurred ignoring the threat.","jetpack-protect")})))).finally((()=>{a(O(e,!1)),t()}))))}},setModal:e=>({type:Z,payload:e}),setNotice:U,clearNotice:()=>({type:w}),fixThreats:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return async n=>{let{dispatch:a}=n;return e.forEach((e=>{a(O(e,!0))})),await new Promise((()=>r()({path:`jetpack-protect/v1/fix-threats?threat_ids=${e}`,method:"POST",data:{threatIds:e}}).then((()=>a(U({type:"success",message:__("We're hard at work fixing this threat in the background. Please check back shortly.","jetpack-protect")})))).then((()=>{setTimeout((()=>a(H(e))),1e3)})).catch((()=>a(U({type:"error",message:__("Error fixing threats. Please contact support.","jetpack-protect")})))).finally((()=>{e.forEach((e=>{a(O(e,!1))})),t()}))))}},scan:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};return async t=>{let{dispatch:n}=t;return n(F(!0)),await new Promise((()=>r()({path:"jetpack-protect/v1/scan",method:"POST"}).then((()=>{n(x()),setTimeout((()=>n(M(!0))),5e3)})).catch((()=>n(U({type:"error",message:__("An error ocurred enqueuing the scan","jetpack-protect")})))).finally((()=>{n(F(!1)),e()}))))}},setThreatsAreFixing:D,refreshPlan:()=>e=>{let{dispatch:t}=e;r()({path:"jetpack-protect/v1/check-plan",method:"GET"}).then((e=>t(B(e))))},setHasRequiredPlan:B,setScanIsUnavailable:V,setWafIsEnabled:e=>({type:S,isEnabled:e}),setWafIsSeen:e=>({type:R,isSeen:e}),setWafIsLoading:e=>({type:j,isLoading:e}),setWafConfig:e=>({type:N,config:e})}},3638:function(e,t,n){"use strict";var a=n(9818),r=n(5230);const c={isSupported:null,isSeen:!1,isEnabled:!1,isLoading:!1,config:void 0},i=(0,a.combineReducers)({credentials:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===r.jA?t.credentials:e},credentialsIsFetching:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===r._N?t.isFetching:e},status:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case r.d0:return t.status;case r.o9:return{...e,currentProgress:t.currentProgress};case r.Y2:return{...e,currentProgress:0,status:"optimistically_scanning"}}return e},statusIsFetching:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===r.Gk?t.status:e},scanIsUnavailable:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===r.eG?t.status:e},scanIsEnqueuing:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.lengt