47 lines
278 KiB
JavaScript
47 lines
278 KiB
JavaScript
|
/*! For license information please see index.js.LICENSE.txt */
|
|||
|
!function(){var e={9487:function(e,t,a){"use strict";a.d(t,{X:function(){return c}});const n={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:",
|
|||
|
// translators: Name of the current feature
|
|||
|
default:(0,n.sprintf)(__("%s coming soon","jetpack-protect"),a)}:{lg:t?f:v,default:t?a:(0,n.sprintf)(/* translators: Name of the current feature */
|
|||
|
__("%s not included","jetpack-protect"),a)})(a,t,R),x=Z?P.lg:P.default;return u().createElement("div",{className:o()(g.Z.item,g.Z.value)},u().createElement(c.Z,{className:o()(g.Z.icon,_?g.Z["icon-check"]:g.Z["icon-cross"]),size:32,icon:_?r.Z:l.Z}),u().createElement(h.ZP,{variant:"body-small"},d||x),S&&u().createElement(m.Z,{title:b||N,iconClassName:g.Z["popover-icon"],className:o()(g.Z.popover,y),placement:"bottom-end",iconSize:14,offset:4,wide:Boolean(b&&w)},u().createElement(h.ZP,{variant:"body-small",component:"div"},w||j)))},b=e=>{let{children:t}=e;return u().createElement("div",{className:g.Z.header},t)},y=e=>{let{primary:t=!1,children:a}=e,n=0;return u().createElement("div",{className:o()(g.Z.card,{[g.Z["is-primary"]]:t})},s.Children.map(a,(e=>{const t=e;return t.type===w?(n++,(0,s.cloneElement)(t,{index:n-1})):t})))};t.ZP=e=>{let{title:t,items:a,children:n,showIntroOfferDisclaimer:c=!1}=e;const[r]=(0,p.Z)("lg");return u().createElement(k.Provider,{value:a},u().createElement("div",{className:o()(g.Z.container,{[g.Z["is-viewport-large"]]:r}),style:{"--rows":a.length+1,"--columns":s.Children.toArray(n).length+1}},u().createElement("div",{className:g.Z.table},u().createElement(h.ZP,{variant:"headline-small"},t),r&&a.map(((e,t)=>u().createElement("div",{className:o()(g.Z.item,{[g.Z["last-feature"]]:t===a.length-1}),key:t},u().createElement(h.ZP,{variant:"body-small"},u().createElement("strong",null,e.name)),e.tooltipInfo&&u().createElement(m.Z,{title:e.tooltipTitle,iconClassName:g.Z["popover-icon"],className:g.Z.popover,placement:e.tooltipPlacement?e.tooltipPlacement:"bottom-end",iconSize:14,offset:4,wide:Boolean(e.tooltipTitle&&e.tooltipInfo)},u().createElement(h.ZP,{variant:"body-small"},e.tooltipInfo))))),n)),u().createElement("div",{className:g.Z["tos-container"]},u().createElement("div",{className:g.Z.tos},c&&u().createElement(h.ZP,{variant:"body-small"},__("Reduced pricing is a limited offer for the first year and renews at regular price.","jetpack-protect")),u().createElement(d.Z,{multipleButtons:!0}))))}},5347:function(e,t,a){"use strict";var n=a(5736),c=a(5235),r=a.n(c),l=a(5106),i=a(3789),o=a(9184);const __=n.__;t.Z=e=>{let{price:t,offPrice:a,currency:n="",showNotOffPrice:c=!0,hideDiscountLabel:s=!0,promoLabel:u="",legend:m=__("/month, paid yearly","jetpack-protect"),isNotConvenientPrice:p=!1,hidePriceFraction:d=!1,children:h}=e;if(null==t&&null==a||!n)return null;c=c&&null!=a;const g="number"==typeof t&&"number"==typeof a?Math.floor((t-a)/t*100):0,f=!s&&g&&g>0?g+__("% off","jetpack-protect"):null;return React.createElement(React.Fragment,null,React.createElement("div",{className:o.Z.container},React.createElement("div",{className:r()(o.Z["price-container"],"product-price_container")},React.createElement(i.t,{value:a??t,currency:n,isOff:!p,hidePriceFraction:d}),c&&React.createElement(i.t,{value:t,currency:n,isOff:!1,hidePriceFraction:d}),f&&React.createElement(l.ZP,{className:r()(o.Z["promo-label"],"product-price_promo_label")},f))),React.createElement("div",{className:o.Z.footer},h||React.createElement(l.ZP,{className:r()(o.Z.legend,"product-price_legend")},m),u&&React.createElement(l.ZP,{className:r()(o.Z["promo-label"],"product-price_promo_label")},u)))}},3789:function(e,t,a){"use strict";a.d(t,{t:function(){return o}});var n=a(8899),c=a(5235),r=a.n(c),l=a(5106),i=a(9184);const o=e=>{let{value:t,currency:a,isOff:c,hidePriceFraction:o}=e;const s=r()(i.Z.price,"product-price_price",{[i.Z["is-not-off-price"]]:!c}),{symbol:u,integer:m,fraction:p}=(0,n.LR)(t,a),d=!o||!p.endsWith("00");return React.createElement(l.ZP,{className:s,variant:"headline-medium",component:"p"},React.createElement(l.ZP,{className:i.Z.symbol,component:"sup",variant:"title-medium"},u),m,d&&React.createElement(l.ZP,{component:"sup",variant:"body-small","data-testid":"PriceFraction"},React.createElement("strong",null,p)))}},5033:function(e,t,a){"use strict";var n=a(5162),c=a.n(n),r=a(9196),l=a.n(r);a(1683);const i=e=>{const t=e.className+" jp-components-spinner",a={width:e.size,height:e.size,fontSize:e.size,borderTopColor:e.color},n={borde
|
|||
|
__("By clicking the <strong>%s</strong> button, you agree to our <tosLink>Terms of Service</tosLink> and to <shareDetailsLink>share details</shareDetailsLink> with WordPress.com.","jetpack-protect"),t),{strong:React.createElement("strong",null),tosLink:React.createElement(m,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(m,{slug:"jetpack-support-what-data-does-jetpack-sync"})})},m=e=>{let{slug:t,children:a}=e;return React.createElement("a",{className:"terms-of-service__link",href:(0,i.Z)(t),rel:"noopener noreferrer",target:"_blank"},a)};t.Z=e=>{let{className:t,multipleButtons:a,agreeButtonLabel:n}=e;return React.createElement(o.ZP,{className:l()(t,"terms-of-service")},a?React.createElement(s,null):React.createElement(u,{agreeButtonLabel:n}))}},6017:function(e,t,a){"use strict";a.d(t,{h:function(){return n},s:function(){return c}});const n={"headline-medium":"h1","headline-small":"h2","headline-small-regular":"h2","title-medium":"h3","title-medium-semi-bold":"h3","title-small":"h4",body:"p","body-small":"p","body-extra-small":"p","body-extra-small-bold":"p",label:"p"},c=["mt","mr","mb","ml","mx","my","m","pt","pr","pb","pl","px","py","p"]},5106:function(e,t,a){"use strict";a.d(t,{Dx:function(){return d},H3:function(){return p}});var n=a(2674),c=a.n(n),r=a(5235),l=a.n(r),i=a(9196),o=a.n(i),s=a(6017),u=a(3280);const m=(0,i.forwardRef)(((e,t)=>{let{variant:a="body",children:n,component:r,className:m,...p}=e;const d=r||s.h[a]||"span",h=(0,i.useMemo)((()=>s.s.reduce(((e,t)=>(void 0!==p[t]&&(e+=u.Z[`${t}-${p[t]}`]+" ",delete p[t]),e)),"")),[p]);return p.ref=t,o().createElement(d,c()({className:l()(u.Z.reset,u.Z[a],m,h)},p),n)}));m.displayName="Text",t.ZP=m;const p=e=>{let{children:t,weight:a="bold",...n}=e;const r="headline-small"+("bold"===a?"":`-${a}`);return o().createElement(m,c()({variant:r,mb:3},n),t)},d=e=>{let{children:t,size:a="medium",...n}=e;return o().createElement(m,c()({variant:`title-${a}`,mb:1},n),t)}},8275:function(e,t,a){"use strict";var n=a(9196),c=a.n(n),r=a(3591);const l={"--font-headline-medium":"48px","--font-headline-small":"36px","--font-title-medium":"24px","--font-title-small":"20px","--font-body":"16px","--font-body-small":"14px","--font-body-extra-small":"12px","--font-title-large":"var(--font-headline-small)","--font-label":"var(--font-body-extra-small)"},i={"--jp-black":"#000000","--jp-black-80":"#2c3338","--jp-white":"#ffffff","--jp-white-off":"#f9f9f6","--jp-gray":"#dcdcde","--jp-gray-0":"#F6F7F7","--jp-gray-10":"#C3C4C7","--jp-gray-20":"#A7AAAD","--jp-gray-40":"#787C82","--jp-gray-50":"#646970","--jp-gray-60":"#50575E","--jp-gray-70":"#3C434A","--jp-gray-80":"#2C3338","--jp-gray-90":"#1d2327","--jp-gray-off":"#e2e2df","--jp-red-0":"#F7EBEC","--jp-red-5":"#FACFD2","--jp-red-40":"#E65054","--jp-red-50":"#D63638","--jp-red-60":"#B32D2E","--jp-red-70":"#8A2424","--jp-red-80":"#691C1C","--jp-red":"#d63639","--jp-yellow-5":"#F5E6B3","--jp-yellow-10":"#F2CF75","--jp-yellow-20":"#F0C930","--jp-yellow-30":"#DEB100","--jp-yellow-40":"#C08C00","--jp-yellow-50":"#9D6E00","--jp-yellow-60":"#7D5600","--jp-blue-20":"#68B3E8","--jp-blue-40":"#1689DB","--jp-pink":"#C9356E","--jp-green-0":"#f0f2eb","--jp-green-5":"#d0e6b8","--jp-green-10":"#9dd977","--jp-green-20":"#64ca43","--jp-green-30":"#2fb41f","--jp-green-40":"#069e08","--jp-green-50":"#008710","--jp-green-60":"#007117","--jp-green-70":"#005b18","--jp-green-80":"#004515","--jp-green-90":"#003010","--jp-green-100":"#001c09","--jp-green":"#069e08","--jp-green-primary":"var( --jp-green-40 )","--jp-green-secondary":"var( --jp-green-30 )"},o={"--jp-border-radius":"4px","--jp-menu-border-height":"1px","--jp-underline-thickness":"2px"},s={"--spacing-base":"8px"},u={},m=(e,t,a)=>{const n={...l,...i,...o,...s};for(const t in n)e.style.setProperty(t,n[t]);a&&e.classList.add(r.Z.global),t&&(u[t]={provided:!0,root:e})};t.ZP=e=>{let{children:t=null,targetDom:a,id:r,withGlobalStyles:l=!0}=e;const i=(0,n.useRef)(),o=u?.[r]?.provided;return(0,n.useLayoutEffect)((()=>{if(!o)return a?m(a,r,l):void(i?.current&&m(i.current,r,l))}),[a,i,o,r,l]),a?t:c().createElement(
|
|||
|
__("There was an error reconnecting Jetpack. Error: %s","jetpack-protect"),o))):null;return u().createElement(u().Fragment,null,h,u().createElement(r.Notice,{status:"error",isDismissible:!1,className:p},u().createElement("div",{className:m.Z.message},d,t),i&&u().createElement("a",{onClick:i,onKeyDown:i,className:m.Z.button,href:"#"},__("Restore Connection","jetpack-protect"))))};p.propTypes={message:o().string.isRequired,restoreConnectionCallback:o().func,isRestoringConnection:o().bool,restoreConnectionError:o().string},t.Z=p},1294:function(e,t,a){"use strict";var n=a(4743),c=a(9818),r=a(9196),l=a(428);const i=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};t.Z=function(){let{registrationNonce:e=i.registrationNonce,apiRoot:t=i.apiRoot,apiNonce:a=i.apiNonce,redirectUri:o,autoTrigger:s,from:u,skipUserConnection:m}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{registerSite:p,connectUser:d,refreshConnectedPlugins:h}=(0,c.useDispatch)(l.t),g=(0,c.useSelect)((e=>e(l.t).getRegistrationError())),{siteIsRegistering:f,userIsConnecting:v,userConnectionData:E,connectedPlugins:k,connectionErrors:w,isRegistered:b,isUserConnected:y,hasConnectedOwner:Z,isOfflineMode:C}=(0,c.useSelect)((e=>({siteIsRegistering:e(l.t).getSiteIsRegistering(),userIsConnecting:e(l.t).getUserIsConnecting(),userConnectionData:e(l.t).getUserConnectionData(),connectedPlugins:e(l.t).getConnectedPlugins(),connectionErrors:e(l.t).getConnectionErrors(),isOfflineMode:e(l.t).getIsOfflineMode(),...e(l.t).getConnectionStatus()}))),_=()=>m?o?(window.location=o,Promise.resolve(o)):Promise.resolve():d({from:u,redirectUri:o}),R=t=>(t&&t.preventDefault(),b?_():p({registrationNonce:e,redirectUri:o}).then((()=>_())));return(0,r.useEffect)((()=>{n.ZP.setApiRoot(t),n.ZP.setApiNonce(a)}),[t,a]),(0,r.useEffect)((()=>{!s||f||v||R()}),[]),{handleRegisterSite:R,handleConnectUser:_,refreshConnectedPlugins:h,isRegistered:b,isUserConnected:y,siteIsRegistering:f,userIsConnecting:v,registrationError:g,userConnectionData:E,hasConnectedOwner:Z,connectedPlugins:k,connectionErrors:w,isOfflineMode:C}}},3329:function(e,t,a){"use strict";a.d(t,{Z:function(){return l},h:function(){return i}});var n=a(6186),c=a(1294),r=a(1045);function l(){const{connectionErrors:e}=(0,c.Z)({}),t=Object.values(e).shift(),a=t&&Object.values(t).length&&Object.values(t).shift().error_message;return{hasConnectionError:Boolean(a),connectionErrorMessage:a}}const i=()=>{const{hasConnectionError:e,connectionErrorMessage:t}=l(),{restoreConnection:a,isRestoringConnection:c,restoreConnectionError:i}=(0,r.Z)();return e?React.createElement(n.Z,{isRestoringConnection:c,restoreConnectionError:i,restoreConnectionCallback:a,message:t}):null}},8258:function(e,t,a){"use strict";a.d(t,{Z:function(){return f}});var n=a(4743),c=a(4153),r=a(9818),l=a(951),i=a.n(l),o=a(9196),s=a(1294),u=a(428);const m=i()("jetpack:connection:useProductCheckoutWorkflow"),{registrationNonce:p,apiRoot:d,apiNonce:h,siteSuffix:g}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function f(){let{productSlug:e,redirectUrl:t,siteSuffix:a=g,siteProductAvailabilityHandler:l=null,from:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m("productSlug is %s",e),m("redirectUrl is %s",t),m("siteSuffix is %s",a),m("from is %s",i);const[f,v]=(0,o.useState)(!1),{registerSite:E}=(0,r.useDispatch)(u.t),{isUserConnected:k,isRegistered:w,handleConnectUser:b}=(0,s.Z)({redirectUri:t,from:i}),y=(0,c.Z)(e,a,t,k);m("checkoutProductUrl is %s",y),m("isUserConnected is %s",k);const Z=()=>Promise.resolve(l&&l()).then((e=>{if(e)return m("handleAfterRegistration: Site has a product associated"),b();m("handleAfterRegistration: Site does not have a product associated. Redirecting to checkout %s",y),window.location.href=y}));return(0,o.useEffect)((()=>{n.ZP.setApiRoot(d),n.ZP.setApiNonce(h)}),[]),{run:e=>{if(e&&e.preventDefault(),v(!0),w)return Z();E({registrationNonce:p,redirectUri:t}).then(Z)},isRegistered:w,hasCheckoutStarted:f}}},1045:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});var n=a(4743),
|
|||
|
// translators: placeholder is the latest rules version i.e. "v2.0".
|
|||
|
__("Automatic security rules v%s installed.","jetpack-protect"),ee)),te&&React.createElement(i.ZP,{className:T.Z["automatic-rules-stats__last-updated"],variant:"body-small"},(0,f.sprintf)(
|
|||
|
// translators: placeholder is the date latest rules were updated i.e. "September 23, 2022".
|
|||
|
__("Last updated on %s.","jetpack-protect"),b().unix(te).format("MMMM D, YYYY")))),pe&&React.createElement(React.Fragment,null,React.createElement(i.ZP,{className:T.Z["automatic-rules-stats__failed-install"],variant:"body-small",mt:2},__("Failed to update automatic firewall rules.","jetpack-protect")," ",we(pe)),React.createElement(o.Z,{variant:"link",href:C.K},React.createElement(i.ZP,{variant:"body-small"},__("Contact support","jetpack-protect"))))))),!ie&&React.createElement("div",{className:T.Z["upgrade-trigger-section"]},React.createElement(s.Z,{className:T.Z["upgrade-trigger"],description:me?__("Your site is not receiving the latest updates to automatic rules","jetpack-protect",0):__("Set up automatic rules with one click","jetpack-protect"),cta:me?__("Upgrade to keep your site secure with up-to-date firewall rules","jetpack-protect",0):__("Upgrade to enable automatic firewall protection","jetpack-protect"),onClick:ye}))),Le=React.createElement(React.Fragment,null,React.createElement("div",{className:T.Z["brute-force-rules-section"]},React.createElement(I.Z,{id:"jetpack_waf_ip_allow_list",label:__("Always allowed IP addresses","jetpack-protect"),description:React.createElement(React.Fragment,null,React.createElement(i.ZP,{mb:1},__("IP addresses added to this list will never be blocked by Jetpack's brute force protection.","jetpack-protect")),React.createElement("div",{className:T.Z["current-ip-text"]},React.createElement(i.ZP,{variant:"body-small",mb:1},(0,g.createInterpolateElement)((0,f.sprintf)(
|
|||
|
// translators: placeholder is the user's current IP address.
|
|||
|
__("Your current IP: <strong>%s</strong>","jetpack-protect"),W),{strong:React.createElement("strong",null)})),React.createElement(o.Z,{variant:"secondary",size:"small",onClick:xe,disabled:fe||Pe},__("+ Add to Allow List","jetpack-protect")))),placeholder:__("Example:","jetpack-protect")+"\n12.12.12.1\n12.12.12.2",rows:3,value:he.jetpack_waf_ip_allow_list,onChange:Ce,disabled:fe})),React.createElement(o.Z,{onClick:Ze,isLoading:fe,disabled:fe},__("Save changes","jetpack-protect"))),Ie=React.createElement(React.Fragment,null,React.createElement("div",{className:T.Z["toggle-section"]},React.createElement("div",{className:T.Z["toggle-section__control"]},React.createElement(z.Z,{id:"brute_force_protection",checked:he.brute_force_protection,onChange:Re,disabled:fe})),React.createElement("div",{className:T.Z["toggle-section__content"]},React.createElement(i.ZP,{variant:"title-medium",mb:2},__("Enable brute force protection","jetpack-protect")),React.createElement(i.ZP,null,__("Prevent bots and hackers from attempting to log in to your website with common username and password combinations.","jetpack-protect")))),!K&&he.brute_force_protection&&Le),Te=React.createElement("div",{className:T.Z["toggle-wrapper"]},K&&Me,Ie,K&&React.createElement("div",{className:`${T.Z["toggle-section"]} ${B||J?"":T.Z["toggle-section--disabled"]}`},React.createElement("div",{className:T.Z["toggle-section__control"]},React.createElement(z.Z,{id:"jetpack_waf_ip_list",checked:(J||B)&&he.jetpack_waf_ip_list,onChange:je,disabled:fe||!J&&!B})),React.createElement("div",{className:T.Z["toggle-section__content"]},React.createElement(i.ZP,{variant:"title-medium",mb:2},__("Enable manual block and allow lists","jetpack-protect")),React.createElement(i.ZP,null,__("Manually block or allow traffic from specific IP addresses.","jetpack-protect")),F&&React.createElement("div",{className:T.Z["toggle-section__details"]},React.createElement("div",{className:T.Z["manual-rules-stats"]},0===Q&&0===Y&&React.createElement(i.ZP,{className:T.Z["manual-rules-stats__no-rules"],variant:"body-small",mt:2},__("No manual rules are being applied.","jetpack-protect")),Y>0&&React.createElement(i.ZP,{className:T.Z["manual-rules-stats__block-list-count"],variant:"body-small",mt:2},(0,f.sprintf)(
|
|||
|
// translators: placeholder is a number of blocked IP addresses i.e. "5 IPs are being blocked".
|
|||
|
_n("%s IP is being blocked. ","%s IPs are being blocked. ",Y,"jetpack-protect"),1===Y?"One":Y)),Q>0&&React.createElement(i.ZP,{className:T.Z["manual-rules-stats__allow-list-count"],variant:"body-small",mt:2},(0,f.sprintf)(
|
|||
|
// translators: placeholder is a number of allowed IP addresses i.e. "5 IPs are being allowed".
|
|||
|
_n("%s IP is being allowed.","%s IPs are being allowed.",Q,"jetpack-protect"),1===Q?"One":Q))),React.createElement(o.Z,{variant:"link",disabled:!J&&!B},React.createElement(i.ZP,{variant:"body-small",onClick:Ne},__("Edit manual rules","jetpack-protect"))))))),Ae=React.createElement("div",null,React.createElement(o.Z,{className:T.Z["go-back-button"],variant:"icon",icon:k.Z,onClick:Ne},React.createElement(i.ZP,null,__("Go back","jetpack-protect"))),React.createElement(i.ZP,{variant:"title-medium",mt:4,mb:2},__("Manual rules","jetpack-protect")),React.createElement(i.ZP,{mb:4},__("Add manual rules for what IP traffic the Jetpack Firewall and brute force protection should block or allow.","jetpack-protect")),K&&React.createElement("div",{className:T.Z["manual-rules-section"]},React.createElement(I.Z,{id:"jetpack_waf_ip_block_list",label:__("Blocked IP addresses","jetpack-protect"),placeholder:__("Example:","jetpack-protect")+"\n12.12.12.1\n12.12.12.2",rows:3,value:he.jetpack_waf_ip_block_list,onChange:Ce,disabled:fe})),React.createElement("div",{className:T.Z["manual-rules-section"]},React.createElement(I.Z,{id:"jetpack_waf_ip_allow_list",label:__("Always allowed IP addresses","jetpack-protect"),description:React.createElement("div",{className:T.Z["current-ip-text"]},React.createElement(i.ZP,{variant:"body-small",mb:1},(0,g.createInterpolateElement)((0,f.sprintf)(
|
|||
|
// translators: placeholder is the user's current IP address.
|
|||
|
__("Your current IP: <strong>%s</strong>","jetpack-protect"),W),{strong:React.createElement("strong",null)})),React.createElement(o.Z,{variant:"secondary",size:"small",onClick:xe,disabled:fe||Pe},__("+ Add to Allow List","jetpack-protect"))),placeholder:__("Example:","jetpack-protect")+"\n12.12.12.1\n12.12.12.2",rows:3,value:he.jetpack_waf_ip_allow_list,onChange:Ce,disabled:fe})),React.createElement(o.Z,{onClick:Ze,isLoading:fe,disabled:fe},__("Save changes","jetpack-protect")));return React.createElement(S.Z,null,t.message&&React.createElement(M.Z,c()({floating:!0,dismissable:!0},t)),React.createElement(x.Z,null),React.createElement(u.Z,{className:T.Z.container,horizontalSpacing:8,horizontalGap:4},K&&!J&&React.createElement(m.Z,null,ze," "),React.createElement(m.Z,null,Ee?Ae:Te)),K?React.createElement(P.Z,null):React.createElement(L.Z,null))}},8840:function(e,t,a){"use strict";var n=a(5106),c=a(526),r=a(9818),l=a(5736),i=a(9196),o=a(4633),s=a(9974),u=a(8891),m=a(2854),p=a(5823);const __=l.__;t.Z=e=>{let{threatList:t=[]}=e;const{setModal:a,fixThreats:l}=(0,r.useDispatch)(o.t),{threatsUpdating:d}=(0,r.useSelect)((e=>e(o.t).getThreatsUpdating())),[h,g]=(0,i.useState)(t.map((e=>{let{id:t}=e;return t}))),f=(0,i.useCallback)(((e,t)=>{g(e?h.push(t.id):h.filter((e=>e!==t.id)))}),[h]);return React.createElement(m.Z,null,React.createElement(s.Z,null,React.createElement(n.ZP,{variant:"title-medium",mb:2},__("Fix all threats","jetpack-protect")),React.createElement(n.ZP,{mb:3},__("Jetpack will be fixing the selected threats:","jetpack-protect")),React.createElement("div",{className:p.Z.list},t.map((e=>React.createElement(u.Z,{key:e.id,threat:e,fixAllDialog:!0,onCheckFix:f})))),React.createElement("div",{className:p.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:e=>{e.preventDefault(),a({type:null})}},__("Cancel","jetpack-protect")),React.createElement(c.Z,{isLoading:Boolean(d)&&d[h[0]],onClick:async e=>{e.preventDefault(),l(h,(()=>{a({type:null})}))}},__("Fix all threats","jetpack-protect")))))}},1593:function(e,t,a){"use strict";var n=a(5106),c=a(526),r=a(9818),l=a(5736),i=a(4633),o=a(9974),s=a(8891),u=a(2854),m=a(7279);const __=l.__;t.Z=e=>{let{id:t,fixable:a,label:l,icon:p,severity:d}=e;const{setModal:h,fixThreats:g}=(0,r.useDispatch)(i.t),f=(0,r.useSelect)((e=>e(i.t).getThreatsUpdating()));return React.createElement(u.Z,null,React.createElement(o.Z,null,React.createElement(n.ZP,{variant:"title-medium",mb:2},__("Fix Threat","jetpack-protect")),React.createElement(n.ZP,{mb:3},__("Jetpack will be fixing the selected threat:","jetpack-protect")),React.createElement("div",{className:m.Z.list},React.createElement(s.Z,{threat:{id:t,fixable:a,label:l,icon:p,severity:d},fixAllDialog:!1})),React.createElement("div",{className:m.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:e=>{e.preventDefault(),h({type:null})}},__("Cancel","jetpack-protect")),React.createElement(c.Z,{isLoading:Boolean(f&&f[t]),onClick:async e=>{e.preventDefault(),g([t],(()=>{h({type:null})}))}},__("Fix threat","jetpack-protect")))))}},5678:function(e,t,a){"use strict";var n=a(9196),c=a(1234);t.Z=e=>{let{ariaLabel:t,checked:a=!1,className:r="",disabled:l=!1,id:i,onChange:o=(()=>{}),onKeyDown:s=(()=>{}),switchClassNames:u="",toggling:m}=e;const p=(0,n.useCallback)((e=>{l||o(e)}),[l,o]),d=(0,n.useCallback)((e=>{l||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o(e)),s(e))}),[l,o,s]);return React.createElement(React.Fragment,null,React.createElement("div",null,React.createElement("input",{className:`${c.Z["form-toggle"]} ${r} ${m?c.Z["is-toggling"]:""}`,type:"checkbox",checked:a,readOnly:!0,disabled:l}),React.createElement("span",{className:`${c.Z["form-toggle__switch"]} ${u}`,disabled:l,id:i,onClick:p,onKeyDown:d,role:"checkbox","aria-checked":a,"aria-label":t,tabIndex:l?-1:0})))}},3584:function(e,t,a){"use strict";a.d(t,{U:function(){return d}});var n=a(5106),c=a(1074),r=a(7489),l=a(2229),i=a(5235),o=a.n(i),s=a(9196),u=a.n(s),m=a(9122);const p=u().createContext(),d=e=>{let{id:t,title:a,label:i,icon:d,children:h,onOpen:g}=e;const f=(0,
|
|||
|
__("Show %s more","jetpack-protect"),f):(0,c.sprintf)(/* translators: %s: Number of hide items */
|
|||
|
__("Hide %s items","jetpack-protect"),f)))))}},5338:function(e,t,a){"use strict";a.d(t,{Dx:function(){return h.Z},KB:function(){return d.Z}});var n=a(5106),c=a(5609),r=a(5736),l=a(1074),i=a(7489),o=a(2229),s=a(5235),u=a.n(s),m=a(9196),p=a.n(m),d=a(2328),h=a(6119),g=a(513),f=a(246);const __=r.__,v=e=>{let{children:t}=e;return p().createElement("ul",{className:g.Z.navigation,role:"menu"},t)},E=e=>{let{children:t,data:a}=e;const r=(0,m.useRef)(),[s,d]=(0,m.useState)(!1),h=a?.items?.find((e=>e?.id===a?.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:r},p().createElement("div",{className:g.Z["navigation-dropdown-label"]},v&&p().createElement(l.Z,{icon:v,className:g.Z["navigation-dropdown-icon"]}),p().createElement(n.ZP,null,f)),p().createElement(l.Z,{icon:s?i.Z:o.Z,size:32}),p().createElement(c.Popover,{position:"bottom center",anchorRef:r?.current,className:u()({[g.Z["navigation-dropdown-open"]]:s,[g.Z["navigation-dropdown-closed"]]:!s})},p().createElement("div",{style:{width:r?.current?.getBoundingClientRect?.()?.width}},t)))};t.ZP=e=>{let{children:t,selected:a,onSelect:n,mode:c="list"}=e;const r=(0,f.Z)({selected:a,onSelect:n}),l=(e=>{switch(e){case"list":default:return v;case"dropdown":return E}})(c);return p().createElement(f.k.Provider,{value:{...r,mode:c}},p().createElement(l,{data:r},t))}},6119:function(e,t,a){"use strict";var n=a(5235),c=a.n(n),r=a(9196),l=a.n(r),i=a(5167),o=a(2389),s=a(513),u=a(246);t.Z=e=>{let{id:t,label:a,icon:n,badge:m,disabled:p,onClick:d,onKeyDown:h,onFocus:g,checked:f}=e;const v=(0,r.useContext)(u.k),E=v?.selectedItem===t,k=v?.registerItem,w=v?.registerRef,b=v?.handleClickItem,y=v?.handleKeyDownItem,Z=v?.handleFocusItem,C=c()(s.Z["navigation-item"],{[s.Z.clickable]:!p,[s.Z.selected]:E}),_=(0,r.useCallback)((e=>{d?.(e),b?.(t)}),[b,t,d]),R=(0,r.useCallback)((e=>{h?.(e),y?.(e)}),[y,h]),j=(0,r.useCallback)((e=>{w(e,t)}),[w,t]),N=(0,r.useCallback)((e=>{g?.(e),Z?.(t)}),[Z,t,g]);return(0,r.useEffect)((()=>{k({id:t,disabled:p,label:a,icon:n})}),[]),l().createElement("li",{className:C,onClick:p?null:_,onKeyDown:R,onFocus:p?null:N,role:"menuitem",tabIndex:p?-1:0,ref:j},l().createElement(o.Z,{icon:n},a),l().createElement(i.Z,{count:m,checked:f}))}},2389:function(e,t,a){"use strict";var n=a(5106),c=a(1074),r=a(5235),l=a.n(r),i=a(5162),o=a.n(i),s=a(9196),u=a.n(s),m=a(513);const p=e=>{let{icon:t,children:a,className:r}=e;return u().createElement(n.ZP,{className:l()(m.Z["navigation-item-label"],r)},t&&u().createElement(c.Z,{icon:t,className:m.Z["navigation-item-icon"],size:28}),u().createElement("span",{className:m.Z["navigation-item-label-content"]},a))};p.propTypes={icon:o().node,children:o().node.isRequired},t.Z=p},246:function(e,t,a){"use strict";a.d(t,{k:function(){return c}});var n=a(9196);const c=a.n(n)().createContext();t.Z=e=>{let{selected:t,onSelect:a}=e;const[c,r]=(0,n.useState)([]),[l,i]=(0,n.useState)([]),[o,s]=(0,n.useState)(),u=(e,t)=>{const a=e-1,n=a<0?t:a,r=c[n];return r?.disabled?u(n,t):r},m=(e,t)=>{const a=e+1,n=a>t?0:a,r=c[n];return r?.disabled?m(n,t):r};return{selectedItem:t,handleClickItem:e=>{a(e)},handleKeyDownItem:e=>{const n=e?.code,r=c.findIndex((e=>e?.id===t)),i=c.length-1;let s;if("ArrowUp"===n){const e=u(r,i);s=e?.id}else if("ArrowDown"===n){const e=m(r,i);s=e?.id}else"Enter"!==n&&"Space"!==n||!o||(s=o);if(s){const e=l[s];e?.focus(),a(s)}},handleFocusItem:e=>{s(e)},registerRef:(e,t)=>{i((a=>!a[t]&&e?{...a,[t]:e}:a))},registerItem:e=>{r((t=>{const a=[...t],n=e?.id,c=a.findIndex((e=>e?.id===n));return c>=0?a[c]=e:a.push(e),a}))},items:c}}},291:function(e,t,a){"use strict";var n=a(9818),c=a(5736),r=a(9201),l=a(797),i=a(496),o=a(1074),s=a(9517),u=a(9196),m=a(4633),p=a(8212);const __=c.__;t.Z=e=>{let{dismissable:t=!1,duration:a=null,floating:c=!1,message:d,type:h="success"}=e;const{clearNotice:g}=(0,n.useDispatch)(m.t);let f;switch(h){case"success":f=r.Z;break;case"error":f=l.Z;break;default:f=i.Z}const v=(0,u.useC
|
|||
|
__("Latest results as of %s","jetpack-protect"),(0,s.dateI18n)("F jS",t))),e>0&&p().createElement(l.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)),a&&0===e&&p().createElement(i.Z,{variant:"secondary",className:f.Z["summary__scan-button"],isLoading:v,onClick:e=>{e.preventDefault(),E()}},__("Scan now","jetpack-protect")))))}},3324:function(e,t,a){"use strict";a.d(t,{O:function(){return r}});var n=a(554),c=a(5714);const r=e=>{let{label:t,link:a}=e;return React.createElement(n.OL,{to:a,className:e=>{let{isActive:t}=e;return t?`${c.Z.tab} ${c.Z["tab--active"]}`:c.Z.tab}},t)};t.Z=e=>{let{children:t,className:a=""}=e;return React.createElement("nav",{className:`${c.Z.tabs} ${a}`},t)}},9265:function(e,t,a){"use strict";var n=a(8063);t.Z=e=>{let{disabled:t=!1,id:a,label:c="",description:r="",placeholder:l="",rows:i=3,value:o="",onChange:s=(()=>{})}=e;return React.createElement("div",null,Boolean(c)&&React.createElement("label",{className:n.Z.label,htmlFor:a},c),Boolean(r)&&r,React.createElement("textarea",{className:n.Z.textarea,disabled:t,placeholder:l,rows:i,id:a,name:a,onChange:s,value:o||""}))}},8891:function(e,t,a){"use strict";a.d(t,{Z:function(){return m}});var n=a(5106),c=a(5736),r=a(1074),l=a(9196),i=a.n(l),o=a(2251),s=a(9971);const __=c.__,u=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,c.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,c.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")}};function m(e){let{threat:t,fixAllDialog:a,onCheckFix:c}=e;const[m,p]=(0,l.useState)(!0),d=(0,l.useCallback)((e=>{p(e.target.checked),c(e.target.checked,t)}),[c,t]);return i().createElement(i().Fragment,null,i().createElement("div",{className:s.Z.threat},i().createElement(r.Z,{icon:t.icon,className:s.Z.threat__icon}),i().createElement("div",{className:s.Z.threat__summary},i().createElement(n.ZP,{className:s.Z.threat__summary__label,mb:1},t.label),i().createElement(n.ZP,{className:s.Z.threat__summary__title},u(t.fixable))),i().createElement("div",{className:s.Z.threat__severity},i().createElement(o.Z,{severity:t.severity})),a&&i().createElement("div",{className:s.Z.threat__checkbox},i().createElement("input",{type:"checkbox",checked:m,onChange:d,value:t.id}))))}},5658:function(e,t,a){"use strict";var n=a(5106),c=a(9307),r=a(5736),l=a(9196),i=a(5773),o=a(9709);const __=r.__,_n=r._n,s=()=>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,i.Z)(),t=(0,l.useMemo)((()=>e?(e=>{const t=new Date,a=6e4*t.getTimezoneOffset(),n=Math.floor((new Date(t.getTime()+a).getTime()-e)/1e3);let c=n/31536e3;return c>1?(0,r.sprintf)(
|
|||
|
// translators: placeholder is a number amount of years i.e. "5 years ago".
|
|||
|
_n("%s year ago","%s years ago",Math.floor(c),"jetpack-protect"),Math.floor(c)):(c=n/2592e3,c>1?(0,r.sprintf)(
|
|||
|
// translators: placeholder is a number amount of months i.e. "5 months ago".
|
|||
|
_n("%s month ago","%s months ago",Math.floor(c),"jetpack-protect"),Math.floor(c)):(c=n/86400,c>1?(0,r.sprintf)(
|
|||
|
// translators: placeholder is a number amount of days i.e. "5 days ago".
|
|||
|
_n("%s day ago","%s days ago",Math.floor(c),"jetpack-protect"),Math.floor(c)):(c=n/3600,c>1?(0,r.sprintf)(
|
|||
|
// translators: placeholder is a number amount of hours i.e. "5 hours ago".
|
|||
|
_n("%s hour ago","%s hours ago",Math.floor(c),"jetpack-protect"),Math.floor(c)):(c=n/60,c>1?(0,r.sprintf)(
|
|||
|
// translators: placeholder is a number amount of minutes i.e. "5 minutes ago".
|
|||
|
_n("%s minute ago","%s minutes ago",Math.floor(c),"jetpack-protect"),Math.floor(c)):__("a few seconds ago","jetpack-protect")))))})(Date.parse(e)):null),[e]);return React.createElement("div",{className:o.Z.empty},React.createElement(s,null),React.createElement(n.H3,{weight:"bold",mt:8},__("Don't worry about a thing","jetpack-protect")),React.createElement(n.ZP,null,(0,c.createInterpolateElement)((0,r.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,a){"use strict";var n=a(526),c=a(5106),r=a(857),l=a(8258),i=a(5736),o=a(9196),s=a.n(o),u=a(3898),m=a(6477),p=a(3584),d=a(9709);const __=i.__,h=e=>{let{description:t,filename:a,fixedIn:h,icon:g,id:f,name:v,source:E,table:k,title:w,type:b,version:y}=e;const{adminUrl:Z}=window.jetpackProtectInitialState||{},{run:C}=(0,l.Z)({productSlug:u.o,redirectUrl:Z}),{recordEventHandler:_}=(0,m.Z)(),R=_("jetpack_protect_threat_list_get_scan_link_click",C),j=E?s().createElement(n.Z,{variant:"link",isExternalLink:!0,weight:"regular",href:E},__("See more technical details of this threat","jetpack-protect")):null,N=(0,o.useCallback)((()=>v&&y?`${v} (${y})`:a?a.split("/").pop():k||void 0),[a,v,k,y]);return s().createElement(p.U,{id:f,label:N(),title:w,icon:g,onOpen:(0,o.useCallback)((()=>{["core","plugin","theme"].includes(b)&&_(`jetpack_protect_${b}_threat_open`)}),[_,b])},t&&s().createElement("div",{className:d.Z["threat-section"]},s().createElement(c.ZP,{variant:"title-small",mb:2},__("What is the problem?","jetpack-protect")),s().createElement(c.ZP,{mb:2},t),j),h&&s().createElement("div",{className:d.Z["threat-section"]},s().createElement(c.ZP,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),s().createElement(c.ZP,{mb:2},/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */
|
|||
|
(0,i.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),v,h)),s().createElement(r.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&&s().createElement("div",{className:d.Z["threat-section"]},j))};t.Z=e=>{let{list:t}=e;return s().createElement(p.Z,null,t.map((e=>{let{description:t,fixedIn:a,icon:n,id:c,name:r,source:l,table:i,title:o,type:u,version:m}=e;return s().createElement(h,{description:t,fixedIn:a,icon:n,id:c,key:c,name:r,source:l,table:i,title:o,type:u,version:m})})))}},5207:function(e,t,a){"use strict";var n=a(3363),c=a(3846),r=a(5106),l=a(526),i=a(9818),o=a(5736),s=a(9196),u=a.n(s),m=a(5773),p=a(4633),d=a(5658),h=a(2831),g=a(4289),f=a(1400),v=a(9709),E=a(7930);const __=o.__;t.Z=()=>{const{hasRequiredPlan:e}=(0,m.Z)(),{item:t,list:a,selected:k,setSelected:w}=(0,E.Z)(),b=a.filter((e=>e.fixable)),{setModal:y}=(0,i.useDispatch)(p.t),{scan:Z}=(0,i.useDispatch)(p.t),C=(0,i.useSelect)((e=>e(p.t).getScanIsEnqueuing())),_=(0,s.useCallback)((()=>{switch(k){case"all":return 1===a.length?__("All threats","jetpack-protect"):(0,o.sprintf)(/* translators: placeholder is the amount of threats found on the site. */
|
|||
|
__("All %s threats","jetpack-protect"),a.length);case"files":return(0,o.sprintf)(/* translators: placeholder is the amount of file threats found on the site. */
|
|||
|
__("%1$s file %2$s","jetpack-protect"),a.length,1===a.length?"threat":"threats");case"database":return(0,o.sprintf)(/* translators: placeholder is the amount of database threats found on the site. */
|
|||
|
__("%1$s database %2$s","jetpack-protect"),a.length,1===a.length?"threat":"threats");default:return(0,o.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"),a.length,1===a.length?"threat":"threats",t?.name,t?.version)}}),[k,a,t]);return u().createElement(n.Z,{fluid:!0,horizontalSpacing:0,horizontalGap:3},u().createElement(c.Z,{lg:4},u().createElement(g.Z,{selected:k,onSelect:w})),u().createElement(c.Z,{lg:8},a?.length>0?u().createElement(u().Fragment,null,u().createElement("div",{className:v.Z["list-header"]},u().createElement(r.Dx,{className:v.Z["list-title"]},_()),e&&u().createElement(u().Fragment,null,b.length>0&&u().createElement(l.Z,{variant:"primary",className:v.Z["list-header-button"],onClick:(R=b,e=>{e.preventDefault(),y({type:"FIX_ALL_THREATS",props:{threatList:R}})})},/* translators: Translates to Auto fix all. $s: Number of fixable threats. */
|
|||
|
(0,o.sprintf)(__("Auto fix all (%s)","jetpack-protect"),b.length)),u().createElement(l.Z,{variant:"secondary",className:v.Z["list-header-button"],isLoading:C,onClick:e=>{e.preventDefault(),Z()}},__("Scan now","jetpack-protect")))),e?u().createElement(f.Z,{list:a}):u().createElement(h.Z,{list:a})):u().createElement(d.Z,null)));var R}},4289:function(e,t,a){"use strict";var n=a(2054),c=a(5736),r=a(797),l=a(2817),i=a(7663),o=a(8960),s=a(4160),u=a(6376),m=a(9196),p=a(6477),d=a(5773),h=a(5338);const __=c.__;t.Z=e=>{let{selected:t,onSelect:a}=e;const{plugins:c,themes:g,numThreats:f,numCoreThreats:v,numFilesThreats:E,numDatabaseThreats:k,hasRequiredPlan:w}=(0,d.Z)(),{recordEvent:b}=(0,p.Z)(),[y]=(0,n.Z)("lg","<"),Z=(0,m.useCallback)((()=>{b("jetpack_protect_navigation_all_click")}),[b]),C=(0,m.useCallback)((()=>{b("jetpack_protect_navigation_core_click")}),[b]),_=(0,m.useCallback)((()=>{b("jetpack_protect_navigation_plugin_click")}),[b]),R=(0,m.useCallback)((()=>{b("jetpack_protect_navigation_theme_click")}),[b]),j=(0,m.useCallback)((()=>{b("jetpack_protect_navigation_file_click")}),[b]),N=(0,m.useCallback)((()=>{b("jetpack_protect_navigation_database_click")}),[b]);return React.createElement(h.ZP,{selected:t,onSelect:a,mode:y?"dropdown":"list"},React.createElement(h.Dx,{initial:!0,id:"all",label:__("All threats","jetpack-protect"),icon:r.Z,badge:f,disabled:f<=0,onClick:Z,checked:!0}),React.createElement(h.Dx,{id:"wordpress",label:__("WordPress","jetpack-protect"),icon:l.Z,badge:v,disabled:v<=0,onClick:C,checked:!0}),React.createElement(h.KB,{label:__("Plugins","jetpack-protect"),icon:i.Z},c.map((e=>{let{name:t,threats:a,checked:n}=e;return React.createElement(h.Dx,{key:t,id:t,label:t,checked:n,badge:a?.length,disabled:a?.length<=0,onClick:_})}))),React.createElement(h.KB,{label:__("Themes","jetpack-protect"),icon:o.Z},g.map((e=>{let{name:t,threats:a,checked:n}=e;return React.createElement(h.Dx,{key:t,id:t,label:t,checked:n,badge:a?.length,disabled:a?.length<=0,onClick:R})}))),w&&React.createElement(React.Fragment,null,React.createElement(h.Dx,{id:"files",label:__("Files","jetpack-protect"),icon:s.Z,badge:E,disabled:E<=0,onClick:j,checked:!0}),React.createElement(h.Dx,{id:"database",label:__("Database","jetpack-protect"),icon:u.Z,badge:k,disabled:k<=0,onClick:N,checked:!0})))}},1400:function(e,t,a){"use strict";var n=a(526),c=a(5106),r=a(2054),l=a(9818),i=a(9307),o=a(5736),s=a(9196),u=a.n(s),m=a(6477),p=a(4633),d=a(7127),h=a(4257),g=a(289),f=a(9709);const __=o.__,v=e=>{let{context:t,description:a,diff:r,filename:i,fixedIn:v,icon:E,fixable:k,id:w,label:b,name:y,source:Z,title:C,type:_,severity:R}=e;const{setModal:j}=(0,l.useDispatch)(p.t),{recordEvent:N}=(0,m.Z)(),S=Z?u().createElement(n.Z,{variant:"link",isExternalLink:!0,weight:"regular",href:Z},__("See more technical details of this threat","jetpack-protect")):null;return u().createElement(g.c,{id:w,label:b,title:C,icon:E,fixable:k,severity:R,onOpen:(0,s.useCallback)((()=>{["core","plugin","theme","file","database"].includes(_)&&N(`jetpack_protect_${_}_threat_open`)}),[N,_])},a&&u().createElement("div",{className:f.Z["threat-section"]},u().createElement(c.ZP,{variant:"title-small",mb:2},__("What is the problem?","jetpack-protect")),u().createElement(c.ZP,{mb:2},a),S),(i||t||r)&&u().createElement(c.ZP,{variant:"title-small",mb:2},__("The technical details","jetpack-protect")),i&&u().createElement(u().Fragment,null,u().createElement(c.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"]},i)),t&&u().createElement(h.Z,{context:t}),r&&u().createElement(d.C,{diff:r}),v&&u().createElement("div",{className:f.Z["threat-section"]},u().createElement(c.ZP,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),u().createElement(c.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"),y,v))),!a&&u().createElement("div",{className:f.Z["threat-section"]},S),u().createElement("div",{className:f.Z["threat-footer"]},u().createElement(n.Z,{isDestructive:!0,variant:"secondary",onClick:e=>{e.preventDefault(),j({type:"IGNORE_THREAT",props:{id:w,label:b,title:C,icon:E,severity:R}})}},__("Ignore threat","jetpack-protect")),k&&u().createElement(n.Z,{onClick:e=>{e.preventDefault(),j({type:"FIX_THREAT",props:{id:w,label:b,title:C,icon:E,severity:R,fixable:k}})}},__("Fix threat","jetpack-protect"))))};t.Z=e=>{let{list:t}=e;const{scan:a}=(0,l.useDispatch)(p.t),o=(0,i.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(n.Z,{variant:"link",onClick:e=>{e.preventDefault(),a()}})}),[s]=(0,r.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,!s&&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:a,diff:n,filename:c,fixedIn:r,icon:l,fixable:i,id:o,label:s,name:m,severity:p,source:d,table:h,title:g,type:f,version:E}=e;return u().createElement(v,{context:t,description:a,diff:n,filename:c,fixedIn:r,icon:l,fixable:i,id:o,key:o,label:s,name:m,severity:p,source:d,table:h,title:g,type:f,version:E})}))),u().createElement(c.ZP,{className:f.Z["manual-scan"],variant:"body-small"},o))}},7930:function(e,t,a){"use strict";var n=a(2817),c=a(4160),r=a(6376),l=a(7663),i=a(8960),o=a(9196),s=a(5773);const u=(e,t)=>t.severity-e.severity,m=(e,t)=>Array.isArray(e)?e.map((e=>m(e,t))).flat():e?.threats.map((a=>({...a,...e,...t})));t.Z=()=>{const{plugins:e,themes:t,core:a,files:p,database:d}=(0,s.Z)(),[h,g]=(0,o.useState)("all"),{unsortedList:f,item:v}=(0,o.useMemo)((()=>{if(h&&"all"!==h){switch(h){case"wordpress":return{unsortedList:m(a,{icon:n.Z}),item:a};case"files":return{unsortedList:m(p,{icon:c.Z}),item:p};case"database":return{unsortedList:m(d,{icon:r.Z}),item:d}}const o=e.find((e=>e?.name===h));if(o)return{unsortedList:m(o,{icon:l.Z}),item:o};const s=t.find((e=>e?.name===h));if(s)return{unsortedList:m(s,{icon:i.Z}),item:s}}return{unsortedList:[...m(a,{icon:n.Z}),...m(e,{icon:l.Z}),...m(t,{icon:i.Z}),...m(p,{icon:c.Z}),...m(d,{icon:r.Z})],item:null}}),[a,d,p,e,h,t]);return{item:v,list:(0,o.useMemo)((()=>f.sort(u)),[f]),selected:h,setSelected:g}}},2854:function(e,t,a){"use strict";var n=a(1294),c=a(8227);t.Z=e=>{let{children:t}=e;const{isUserConnected:a,hasConnectedOwner:r}=(0,n.Z)();return a&&r?t:React.createElement(c.Z,null)}},8227:function(e,t,a){"use strict";var n=a(5106),c=a(526),r=a(1294),l=a(9818),i=a(5736),o=a(4633),s=a(291),u=a(541);const __=i.__;t.Z=()=>{const{setModal:e}=(0,l.useDispatch)(o.t),{userIsConnecting:t,handleConnectUser:a}=(0,r.Z)({redirectUri:"admin.php?page=jetpack-protect"});return React.createElement(React.Fragment,null,React.createElement(n.ZP,{variant:"title-medium",mb:2},__("User connection needed","jetpack-protect")),React.createElement(s.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(n.ZP,{mb:3},__("A user connection provides Jetpack Protect the access necessary to perform these tasks.","jetpack-protect")),React.createElement(n.ZP,{mb:3},__("Once you’ve secured a user connection, all Jetpack Protect features will be available for use.","jetpack-protect")),React.createElement("div",{className:u.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:t=>{t.preventDefault(),e
|
|||
|
// 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((()=>{a(J({type:"error",message:__("Not all threats could be fixed. Please contact our support.","jetpack-protect")}))})).finally((()=>{a(B([]))}))},J=e=>({type:Z,payload:e}),G=e=>({type:_,hasRequiredPlan:e}),$={checkCredentials:()=>async e=>{let{dispatch:t}=e;return await new Promise(((e,a)=>(t(O(!0)),c()({path:"jetpack-protect/v1/check-credentials",method:"POST"}).then((a=>{t(V(a)),e(a)})).catch((e=>{a(e)})).finally((()=>{t(O(!1))})))))},setCredentials:V,setCredentialsIsFetching:O,setStatus:M,setStatusProgress:e=>({type:m,currentProgress:e}),startScanOptimistically:L,refreshStatus:T,setStatusIsFetching:F,setScanIsEnqueuing:D,setInstalledPlugins:e=>({type:f,plugins:e}),setInstalledThemes:e=>({type:v,themes:e}),setwpVersion:e=>({type:E,version:e}),setJetpackScan:e=>({type:k,scan:e}),ignoreThreat:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return async a=>{let{dispatch:n}=a;return n(U(e,!0)),await new Promise((()=>c()({path:`jetpack-protect/v1/ignore-threat?threat_id=${e}`,method:"POST"}).then((()=>n(T()))).then((()=>n(J({type:"success",message:__("Threat ignored","jetpack-protect")})))).catch((()=>n(J({type:"error",message:__("An error ocurred ignoring the threat.","jetpack-protect")})))).finally((()=>{n(U(e,!1)),t()}))))}},setModal:e=>({type:y,payload:e}),setNotice:J,clearNotice:()=>({type:C}),fixThreats:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return async a=>{let{dispatch:n}=a;return e.forEach((e=>{n(U(e,!0))})),await new Promise((()=>c()({path:`jetpack-protect/v1/fix-threats?threat_ids=${e}`,method:"POST",data:{threatIds:e}}).then((()=>n(J({type:"success",message:__("We're hard at work fixing this threat in the background. Please check back shortly.","jetpack-protect")})))).then((()=>{setTimeout((()=>n(W(e))),1e3)})).catch((()=>n(J({type:"error",message:__("Error fixing threats. Please contact support.","jetpack-protect")})))).finally((()=>{e.forEach((e=>{n(U(e,!1))})),t()}))))}},scan:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};return async t=>{let{dispatch:a}=t;return a(D(!0)),await new Promise((()=>c()({path:"jetpack-protect/v1/scan",method:"POST"}).then((()=>{a(L()),setTimeout((()=>a(T(!0))),5e3)})).catch((()=>a(J({type:"error",message:__("An error ocurred enqueuing the scan","jetpack-protect")})))).finally((()=>{a(D(!1)),e()}))))}},setThreatsAreFixing:B,refreshPlan:()=>e=>{let{dispatch:t}=e;c()({path:"jetpack-protect/v1/check-plan",method:"GET"}).then((e=>t(G(e))))},setHasRequiredPlan:G,setScanIsUnavailable:H,setWafIsEnabled:e=>({type:N,isEnabled:e}),setWafIsSeen:e=>({type:R,isSeen:e}),setWafUpgradeIsSeen:e=>({type:j,upgradeIsSeen:e}),setWafIsUpdating:e=>({type:S,isUpdating:e}),setWafIsToggling:e=>({type:P,isToggling:e}),setWafConfig:e=>({type:x,config:e}),setWafStats:e=>({type:z,stats:e})}},3638:function(e,t,a){"use strict";var n=a(9818),c=a(5230);const r={wafSupported:null,bruteForceSupported:null,isSeen:!1,upgradeIsSeen:!1,isEnabled:!1,isUpdating:!1,isToggling:!1,config:void 0,stats:void 0},l=(0,n.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===c.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===c._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 c.d0:return t.status;case c.o9:return{...e,currentProgress:t.currentProgress};case c.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===c.Gk?t.status:e},scanIsUnavailable:function(){let e=arguments.length>0&&void 0!==argume
|