43 lines
228 KiB
JavaScript
43 lines
228 KiB
JavaScript
|
/*! 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 c}});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:",
|
|||
|
// translators: Name of the current feature
|
|||
|
default:(0,a.sprintf)(__("%s coming soon","jetpack-protect"),n)}:{lg:t?f:v,default:t?n:(0,a.sprintf)(/* translators: Name of the current feature */
|
|||
|
__("%s not included","jetpack-protect"),n)})(n,t,R),x=C?P.lg:P.default;return u().createElement("div",{className:l()(g.Z.item,g.Z.value)},u().createElement(c.Z,{className:l()(g.Z.icon,w?g.Z["icon-check"]:g.Z["icon-cross"]),size:32,icon:w?r.Z:i.Z}),u().createElement(h.ZP,{variant:"body-small"},d||x),S&&u().createElement(p.Z,{title:y||N,iconClassName:g.Z["popover-icon"],className:l()(g.Z.popover,Z),placement:"bottom-end",iconSize:14,offset:4},u().createElement(h.ZP,{variant:"body-small"},k||j)))},y=e=>{let{children:t}=e;return u().createElement("div",{className:g.Z.header},t)},Z=e=>{let{primary:t=!1,children:n}=e,a=0;return u().createElement("div",{className:l()(g.Z.card,{[g.Z["is-primary"]]:t})},s.Children.map(n,(e=>{const t=e;return t.type===k?(a++,(0,s.cloneElement)(t,{index:a-1})):t})))};t.ZP=e=>{let{title:t,items:n,children:a,showIntroOfferDisclaimer:c=!1}=e;const[r]=(0,m.Z)("lg");return u().createElement(b.Provider,{value:n},u().createElement("div",{className:l()(g.Z.container,{[g.Z["is-viewport-large"]]:r}),style:{"--rows":n.length+1,"--columns":s.Children.toArray(a).length+1}},u().createElement("div",{className:g.Z.table},u().createElement(h.ZP,{variant:"headline-small"},t),r&&n.map(((e,t)=>u().createElement("div",{className:l()(g.Z.item,{[g.Z["last-feature"]]:t===n.length-1}),key:t},u().createElement(h.ZP,{variant:"body-small"},u().createElement("strong",null,e.name)),e.tooltipInfo&&u().createElement(p.Z,{title:e.tooltipTitle,iconClassName:g.Z["popover-icon"],className:g.Z.popover,placement:"bottom-end",iconSize:14,offset:4},u().createElement(h.ZP,{variant:"body-small"},e.tooltipInfo))))),a)),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,n){"use strict";var a=n(5736),c=n(5235),r=n.n(c),i=n(5106),o=n(3789),l=n(9184);const __=a.__;t.Z=e=>{let{price:t,offPrice:n,currency:a="",showNotOffPrice:c=!0,hideDiscountLabel:s=!0,promoLabel:u="",legend:p=__("/month, paid yearly","jetpack-protect"),isNotConvenientPrice:m=!1,hidePriceFraction:d=!1,children:h}=e;if(null==t&&null==n||!a)return null;c=c&&null!=n;const g="number"==typeof t&&"number"==typeof n?Math.floor((t-n)/t*100):0,f=!s&&g&&g>0?g+__("% off","jetpack-protect"):null;return React.createElement(React.Fragment,null,React.createElement("div",{className:l.Z.container},React.createElement("div",{className:r()(l.Z["price-container"],"product-price_container")},React.createElement(o.t,{value:n??t,currency:a,isOff:!m,hidePriceFraction:d}),c&&React.createElement(o.t,{value:t,currency:a,isOff:!1,hidePriceFraction:d}))),React.createElement("div",{className:l.Z.footer},h||React.createElement(i.ZP,{className:r()(l.Z.legend,"product-price_legend")},p),u&&React.createElement(i.ZP,{className:r()(l.Z["promo-label"],"product-price_promo_label")},u),f&&React.createElement(i.ZP,{className:r()(l.Z["promo-label"],"product-price_promo_label")},f)))}},3789:function(e,t,n){"use strict";n.d(t,{t:function(){return l}});var a=n(8899),c=n(5235),r=n.n(c),i=n(5106),o=n(9184);const l=e=>{let{value:t,currency:n,isOff:c,hidePriceFraction:l}=e;const s=r()(o.Z.price,"product-price_price",{[o.Z["is-not-off-price"]]:!c}),{symbol:u,integer:p,fraction:m}=(0,a.LR)(t,n),d=!l||!m.endsWith("00");return React.createElement(i.ZP,{className:s,variant:"headline-medium",component:"p"},React.createElement(i.ZP,{className:o.Z.symbol,component:"sup",variant:"title-medium"},u),p,d&&React.createElement(i.ZP,{component:"sup",variant:"body-small","data-testid":"PriceFraction"},React.createElement("strong",null,m)))}},5033:function(e,t,n){"use strict";var a=n(5162),c=n.n(a),r=n(9196),i=n.n(r);n(1683);const o=e=>{const t=e.className+" jp-components-spinner",n={width:e.size,height:e.size,fontSize:e.size,borderTopColor:e.color},a={borderTopColor:e.color,borderRightColor:e.color};return i().createElement("div",{className:t},i().createElement("div",{cla
|
|||
|
__("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(p,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(p,{slug:"jetpack-support-what-data-does-jetpack-sync"})})},p=e=>{let{slug:t,children:n}=e;return React.createElement("a",{className:"terms-of-service__link",href:(0,o.Z)(t),rel:"noopener noreferrer",target:"_blank"},n)};t.Z=e=>{let{className:t,multipleButtons:n,agreeButtonLabel:a}=e;return React.createElement(l.ZP,{className:i()(t,"terms-of-service")},n?React.createElement(s,null):React.createElement(u,{agreeButtonLabel:a}))}},6017:function(e,t,n){"use strict";n.d(t,{h:function(){return a},s:function(){return c}});const a={"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,n){"use strict";n.d(t,{Dx:function(){return d},H3:function(){return m}});var a=n(2674),c=n.n(a),r=n(5235),i=n.n(r),o=n(9196),l=n.n(o),s=n(6017),u=n(3280);const p=(0,o.forwardRef)(((e,t)=>{let{variant:n="body",children:a,component:r,className:p,...m}=e;const d=r||s.h[n]||"span",h=(0,o.useMemo)((()=>s.s.reduce(((e,t)=>(void 0!==m[t]&&(e+=u.Z[`${t}-${m[t]}`]+" ",delete m[t]),e)),"")),[m]);return m.ref=t,l().createElement(d,c()({className:i()(u.Z.reset,u.Z[n],p,h)},m),a)}));t.ZP=p;const m=e=>{let{children:t,weight:n="bold",...a}=e;const r="headline-small"+("bold"===n?"":`-${n}`);return l().createElement(p,c()({variant:r,mb:3},a),t)},d=e=>{let{children:t,size:n="medium",...a}=e;return l().createElement(p,c()({variant:`title-${n}`,mb:1},a),t)}},8275:function(e,t,n){"use strict";var a=n(9196),c=n.n(a),r=n(3591);const i={"--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)"},o={"--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 )"},l={"--jp-border-radius":"4px","--jp-menu-border-height":"1px","--jp-underline-thickness":"2px"},s={"--spacing-base":"8px"},u={},p=(e,t,n)=>{const a={...i,...o,...l,...s};for(const t in a)e.style.setProperty(t,a[t]);n&&e.classList.add(r.Z.global),t&&(u[t]={provided:!0,root:e})};t.ZP=e=>{let{children:t=null,targetDom:n,id:r,withGlobalStyles:i=!0}=e;const o=(0,a.useRef)(),l=u?.[r]?.provided;return(0,a.useLayoutEffect)((()=>{if(!l)return n?p(n,r,i):void(o?.current&&p(o.current,r,i))}),[n,o,l,r,i]),n?t:c().createElement("div",{ref:o},t)}},41
|
|||
|
__("There was an error reconnecting Jetpack. Error: %s","jetpack-protect"),l))):null;return u().createElement(u().Fragment,null,h,u().createElement(r.Notice,{status:"error",isDismissible:!1,className:m},u().createElement("div",{className:p.Z.message},d,t),o&&u().createElement("a",{onClick:o,onKeyDown:o,className:p.Z.button,href:"#"},__("Restore Connection","jetpack-protect"))))};m.propTypes={message:l().string.isRequired,restoreConnectionCallback:l().func,isRestoringConnection:l().bool,restoreConnectionError:l().string},t.Z=m},1294:function(e,t,n){"use strict";var a=n(4743),c=n(9818),r=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:l,autoTrigger:s,from:u,skipUserConnection:p}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{registerSite:m,connectUser:d,refreshConnectedPlugins:h}=(0,c.useDispatch)(i.t),g=(0,c.useSelect)((e=>e(i.t).getRegistrationError())),{siteIsRegistering:f,userIsConnecting:v,userConnectionData:E,connectedPlugins:b,connectionErrors:k,isRegistered:y,isUserConnected:Z,hasConnectedOwner:C}=(0,c.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()}))),_=()=>p?l?(window.location=l,Promise.resolve(l)):Promise.resolve():d({from:u,redirectUri:l}),w=t=>(t&&t.preventDefault(),y?_():m({registrationNonce:e,redirectUri:l}).then((()=>_())));return(0,r.useEffect)((()=>{a.ZP.setApiRoot(t),a.ZP.setApiNonce(n)}),[t,n]),(0,r.useEffect)((()=>{!s||f||v||w()}),[]),{handleRegisterSite:w,handleConnectUser:_,refreshConnectedPlugins:h,isRegistered:y,isUserConnected:Z,siteIsRegistering:f,userIsConnecting:v,registrationError:g,userConnectionData:E,hasConnectedOwner:C,connectedPlugins:b,connectionErrors:k}}},3329:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},h:function(){return o}});var a=n(6186),c=n(1294),r=n(1045);function i(){const{connectionErrors:e}=(0,c.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:c,restoreConnectionError:o}=(0,r.Z)();return e?React.createElement(a.Z,{isRestoringConnection:c,restoreConnectionError:o,restoreConnectionCallback:n,message:t}):null}},8258:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var a=n(4743),c=n(4153),r=n(9818),i=n(951),o=n.n(i),l=n(9196),s=n(1294),u=n(428);const p=o()("jetpack:connection:useProductCheckoutWorkflow"),{registrationNonce:m,apiRoot:d,apiNonce:h,siteSuffix:g}=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function f(){let{productSlug:e,redirectUrl:t,siteSuffix:n=g,siteProductAvailabilityHandler:i=null,from:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p("productSlug is %s",e),p("redirectUrl is %s",t),p("siteSuffix is %s",n),p("from is %s",o);const[f,v]=(0,l.useState)(!1),{registerSite:E}=(0,r.useDispatch)(u.t),{isUserConnected:b,isRegistered:k,handleConnectUser:y}=(0,s.Z)({redirectUri:t,from:o}),Z=(0,c.Z)(e,n,t,b);p("checkoutProductUrl is %s",Z),p("isUserConnected is %s",b);const C=()=>Promise.resolve(i&&i()).then((e=>{if(e)return p("handleAfterRegistration: Site has a product associated"),y();p("handleAfterRegistration: Site does not have a product associated. Redirecting to checkout %s",Z),window.location.href=Z}));return(0,l.useEffect)((()=>{a.ZP.setApiRoot(d),a.ZP.setApiNonce(h)}),[]),{run:e=>{if(e&&e.preventDefault(),v(!0),k)return C();E({registrationNonce:m,redirectUri:t}).then(C)},isRegistered:k,hasCheckoutStarted:f}}},1045:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var a=n(4743),c=n(9818),r=n(9196),i=n(428);const{apiRoot:o,apiNonce:l}=window?.JP_CONN
|
|||
|
// translators: placeholder is the latest rules version i.e. "v2.0".
|
|||
|
__("Automatic security rules v%s installed.","jetpack-protect"),re)),ie&&React.createElement(o.ZP,{className:z.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"),y().unix(ie).format("MMMM D, YYYY")))),me&&React.createElement(React.Fragment,null,React.createElement(o.ZP,{className:z.Z["automatic-rules-stats__failed-install"],variant:"body-small",mt:2},__("Failed to update automatic rules.","jetpack-protect")," ",ke(me)),React.createElement(l.Z,{variant:"link",href:w.K},React.createElement(o.ZP,{variant:"body-small"},__("Contact support","jetpack-protect"))))))),!oe&&React.createElement("div",{className:z.Z["upgrade-trigger-section"]},React.createElement(s.Z,{className:z.Z["upgrade-trigger"],description:pe?__("Your site is not receiving the latest updates to automatic rules","jetpack-protect",0):__("Setup automatic rules with one click","jetpack-protect"),cta:pe?__("Upgrade to keep your site secure with up-to-date firewall rules","jetpack-protect",0):__("Upgrade to enable automatic rules","jetpack-protect"),onClick:Ze})),React.createElement("div",{className:z.Z["toggle-section"]},React.createElement("div",{className:z.Z["toggle-section__control"]},React.createElement(M.Z,{id:"brute_force_protection",checked:he.brute_force_protection,onChange:Re,disabled:fe})),React.createElement("div",{className:z.Z["toggle-section__content"]},React.createElement(o.ZP,{variant:"title-medium",mb:2},__("Enable brute force protection","jetpack-protect")),React.createElement(o.ZP,null,__("Prevent bots and hackers from attempting to log in to your website with common username and password combinations.","jetpack-protect")))),React.createElement("div",{className:`${z.Z["toggle-section"]} ${W?"":z.Z["toggle-section--disabled"]}`},React.createElement("div",{className:z.Z["toggle-section__control"]},React.createElement(M.Z,{id:"jetpack_waf_ip_list",checked:W&&he.jetpack_waf_ip_list,onChange:je,disabled:fe||!W})),React.createElement("div",{className:z.Z["toggle-section__content"]},React.createElement(o.ZP,{variant:"title-medium",mb:2},__("Enable manual rules","jetpack-protect")),React.createElement(o.ZP,null,__("Allows you to add manual rules to block or allow traffic from specific IPs.","jetpack-protect")),O&&React.createElement("div",{className:z.Z["toggle-section__details"]},React.createElement("div",{className:z.Z["manual-rules-stats"]},0===ae&&0===ce&&React.createElement(o.ZP,{className:z.Z["manual-rules-stats__no-rules"],variant:"body-small",mt:2},__("No manual rules are being applied.","jetpack-protect")),ce>0&&React.createElement(o.ZP,{className:z.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. ",ce,"jetpack-protect"),1===ce?"One":ce)),ae>0&&React.createElement(o.ZP,{className:z.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.",ae,"jetpack-protect"),1===ae?"One":ae))),React.createElement(l.Z,{variant:"link",disabled:!W},React.createElement(o.ZP,{variant:"body-small",onClick:Ne},__("Edit manual rules","jetpack-protect"))))))),Ie=React.createElement("div",null,React.createElement(l.Z,{className:z.Z["go-back-button"],variant:"icon",icon:b.Z,onClick:Ne},React.createElement(o.ZP,null,__("Go back","jetpack-protect"))),React.createElement(o.ZP,{variant:"title-medium",mt:4,mb:2},__("Manual rules","jetpack-protect")),React.createElement(o.ZP,{mb:4},__("Add manual rules for what IP traffic the Jetpack Firewall and brute force protection should block or allow.","jetpack-protect")),React.createElement("div",{className:z.Z["manual-rules-section"]},React.createElement(L.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:_e,disabled:fe})),React.createElement("div",{className:z.Z["manual-rules-section"]},React.createElement(L.Z,{id:"jetpack_waf_ip_allow_list",label:__("Always allowed IP addresses","jetpack-protect"),placeholder:__("Example:","jetpack-protect")+"\n12.12.12.1\n12.12.12.2",rows:3,value:he.jetpack_waf_ip_allow_list,onChange:_e,disabled:fe})),React.createElement(l.Z,{onClick:Ce,isLoading:fe,disabled:fe},__("Save changes","jetpack-protect")));return q?React.createElement(P.Z,null,t.message&&React.createElement(T.Z,c()({floating:!0,dismissable:!0},t)),React.createElement(I.Z,null),React.createElement(u.Z,{className:z.Z.container,horizontalSpacing:8,horizontalGap:4},!W&&React.createElement(p.Z,null,Pe," "),React.createElement(p.Z,null,Ee?Ie:xe)),React.createElement(x.Z,null)):React.createElement(C.Fg,{replace:!0,to:"/"})}},8840:function(e,t,n){"use strict";var a=n(5106),c=n(526),r=n(9818),i=n(5736),o=n(9196),l=n(4633),s=n(9974),u=n(8891),p=n(2854),m=n(5823);const __=i.__;t.Z=e=>{let{threatList:t=[]}=e;const{setModal:n,fixThreats:i}=(0,r.useDispatch)(l.t),{threatsUpdating:d}=(0,r.useSelect)((e=>e(l.t).getThreatsUpdating())),[h,g]=(0,o.useState)(t.map((e=>{let{id:t}=e;return t}))),f=(0,o.useCallback)(((e,t)=>{g(e?h.push(t.id):h.filter((e=>e!==t.id)))}),[h]);return React.createElement(p.Z,null,React.createElement(s.Z,null,React.createElement(a.ZP,{variant:"title-medium",mb:2},__("Fix all threats","jetpack-protect")),React.createElement(a.ZP,{mb:3},__("Jetpack will be fixing the selected threats:","jetpack-protect")),React.createElement("div",{className:m.Z.list},t.map((e=>React.createElement(u.Z,{key:e.id,threat:e,fixAllDialog:!0,onCheckFix:f})))),React.createElement("div",{className:m.Z.footer},React.createElement(c.Z,{variant:"secondary",onClick:e=>{e.preventDefault(),n({type:null})}},__("Cancel","jetpack-protect")),React.createElement(c.Z,{isLoading:Boolean(d)&&d[h[0]],onClick:async e=>{e.preventDefault(),i(h,(()=>{n({type:null})}))}},__("Fix all threats","jetpack-protect")))))}},1593:function(e,t,n){"use strict";var a=n(5106),c=n(526),r=n(9818),i=n(5736),o=n(4633),l=n(9974),s=n(8891),u=n(2854),p=n(7279);const __=i.__;t.Z=e=>{let{id:t,fixable:n,label:i,icon:m,severity:d}=e;const{setModal:h,fixThreats:g}=(0,r.useDispatch)(o.t),f=(0,r.useSelect)((e=>e(o.t).getThreatsUpdating()));return React.createElement(u.Z,null,React.createElement(l.Z,null,React.createElement(a.ZP,{variant:"title-medium",mb:2},__("Fix Threat","jetpack-protect")),React.createElement(a.ZP,{mb:3},__("Jetpack will be fixing the selected threat:","jetpack-protect")),React.createElement("div",{className:p.Z.list},React.createElement(s.Z,{threat:{id:t,fixable:n,label:i,icon:m,severity:d},fixAllDialog:!1})),React.createElement("div",{className:p.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,n){"use strict";var a=n(91
|
|||
|
__("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,n){"use strict";n.d(t,{Dx:function(){return h.Z},KB:function(){return d.Z}});var a=n(5106),c=n(5609),r=n(5736),i=n(1074),o=n(7489),l=n(2229),s=n(5235),u=n.n(s),p=n(9196),m=n.n(p),d=n(2328),h=n(6119),g=n(513),f=n(246);const __=r.__,v=e=>{let{children:t}=e;return m().createElement("ul",{className:g.Z.navigation,role:"menu"},t)},E=e=>{let{children:t,data:n}=e;const r=(0,p.useRef)(),[s,d]=(0,p.useState)(!1),h=n?.items?.find((e=>e?.id===n?.selectedItem))??{label:__("See all results","jetpack-protect")},{label:f,icon:v}=h,E=(0,p.useCallback)((()=>{d((e=>!e))}),[]);return m().createElement("button",{className:g.Z["navigation-dropdown-button"],onClick:E,ref:r},m().createElement("div",{className:g.Z["navigation-dropdown-label"]},v&&m().createElement(i.Z,{icon:v,className:g.Z["navigation-dropdown-icon"]}),m().createElement(a.ZP,null,f)),m().createElement(i.Z,{icon:s?o.Z:l.Z,size:32}),m().createElement(c.Popover,{position:"bottom center",anchorRef:r?.current,className:u()({[g.Z["navigation-dropdown-open"]]:s,[g.Z["navigation-dropdown-closed"]]:!s})},m().createElement("div",{style:{width:r?.current?.getBoundingClientRect?.()?.width}},t)))};t.ZP=e=>{let{children:t,selected:n,onSelect:a,mode:c="list"}=e;const r=(0,f.Z)({selected:n,onSelect:a}),i=(e=>{switch(e){case"list":default:return v;case"dropdown":return E}})(c);return m().createElement(f.k.Provider,{value:{...r,mode:c}},m().createElement(i,{data:r},t))}},6119:function(e,t,n){"use strict";var a=n(5235),c=n.n(a),r=n(9196),i=n.n(r),o=n(5167),l=n(2389),s=n(513),u=n(246);t.Z=e=>{let{id:t,label:n,icon:a,badge:p,disabled:m,onClick:d,onKeyDown:h,onFocus:g,checked:f}=e;const v=(0,r.useContext)(u.k),E=v?.selectedItem===t,b=v?.registerItem,k=v?.registerRef,y=v?.handleClickItem,Z=v?.handleKeyDownItem,C=v?.handleFocusItem,_=c()(s.Z["navigation-item"],{[s.Z.clickable]:!m,[s.Z.selected]:E}),w=(0,r.useCallback)((e=>{d?.(e),y?.(t)}),[y,t,d]),R=(0,r.useCallback)((e=>{h?.(e),Z?.(e)}),[Z,h]),j=(0,r.useCallback)((e=>{k(e,t)}),[k,t]),N=(0,r.useCallback)((e=>{g?.(e),C?.(t)}),[C,t,g]);return(0,r.useEffect)((()=>{b({id:t,disabled:m,label:n,icon:a})}),[]),i().createElement("li",{className:_,onClick:m?null:w,onKeyDown:R,onFocus:m?null:N,role:"menuitem",tabIndex:m?-1:0,ref:j},i().createElement(l.Z,{icon:a},n),i().createElement(o.Z,{count:p,checked:f}))}},2389:function(e,t,n){"use strict";var a=n(5106),c=n(1074),r=n(5235),i=n.n(r),o=n(5162),l=n.n(o),s=n(9196),u=n.n(s),p=n(513);const m=e=>{let{icon:t,children:n,className:r}=e;return u().createElement(a.ZP,{className:i()(p.Z["navigation-item-label"],r)},t&&u().createElement(c.Z,{icon:t,className:p.Z["navigation-item-icon"],size:28}),u().createElement("span",{className:p.Z["navigation-item-label-content"]},n))};m.propTypes={icon:l().node,children:l().node.isRequired},t.Z=m},246:function(e,t,n){"use strict";n.d(t,{k:function(){return c}});var a=n(9196);const c=n.n(a)().createContext();t.Z=e=>{let{selected:t,onSelect:n}=e;const[c,r]=(0,a.useState)([]),[i,o]=(0,a.useState)([]),[l,s]=(0,a.useState)(),u=(e,t)=>{const n=e-1,a=n<0?t:n,r=c[a];return r?.disabled?u(a,t):r},p=(e,t)=>{const n=e+1,a=n>t?0:n,r=c[a];return r?.disabled?p(a,t):r};return{selectedItem:t,handleClickItem:e=>{n(e)},handleKeyDownItem:e=>{const a=e?.code,r=c.findIndex((e=>e?.id===t)),o=c.length-1;let s;if("ArrowUp"===a){s=u(r,o)?.id}else if("ArrowDown"===a){s=p(r,o)?.id}else"Enter"!==a&&"Space"!==a||!l||(s=l);if(s){i[s]?.focus(),n(s)}},handleFocusItem:e=>{s(e)},registerRef:(e,t)=>{o((n=>!n[t]&&e?{...n,[t]:e}:n))},registerItem:e=>{r((t=>{const n=[...t],a=e?.id,c=n.findIndex((e=>e?.id===a));return c>=0?n[c]=e:n.push(e),n}))},items:c}}},291:function(e,t,n){"use strict";var a=n(9818),c=n(5736),r=n(9201),i=n(797),o=n(496),l=n(1074),s=n(9517),u=n(9196),p=n(4633),m=n(8212);const __=c.__;t.Z=e=>{let{dismissable:t=!1,duration:n=null,floating:c=!1,message:d,type:h="success"}=e;const{clearNotice:g}=(0,a.useDispatch)(p.t);let f;switch(h){case"success":f=r.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,s.dateI18n)("F jS",t))),e>0&&m().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"))),m().createElement("div",{className:f.Z.summary__notice},p&&p.message&&m().createElement(g.Z,p)),n&&0===e&&m().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 r}});var a=n(554),c=n(5714);const r=e=>{let{label:t,link:n}=e;return React.createElement(a.OL,{to:n,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:n=""}=e;return React.createElement("nav",{className:`${c.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:c="",placeholder:r="",rows:i=3,value:o="",onChange:l=(()=>{})}=e;return React.createElement("div",null,Boolean(c)&&React.createElement("label",{className:a.Z.label,htmlFor:n},c),React.createElement("textarea",{className:a.Z.textarea,disabled:t,placeholder:r,rows:i,id:n,name:n,onChange:l,value:o||""}))}},8891:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var a=n(5106),c=n(5736),r=n(1074),i=n(9196),o=n.n(i),l=n(2251),s=n(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 p(e){let{threat:t,fixAllDialog:n,onCheckFix:c}=e;const[p,m]=(0,i.useState)(!0),d=(0,i.useCallback)((e=>{m(e.target.checked),c(e.target.checked,t)}),[c,t]);return o().createElement(o().Fragment,null,o().createElement("div",{className:s.Z.threat},o().createElement(r.Z,{icon:t.icon,className:s.Z.threat__icon}),o().createElement("div",{className:s.Z.threat__summary},o().createElement(a.ZP,{className:s.Z.threat__summary__label,mb:1},t.label),o().createElement(a.ZP,{className:s.Z.threat__summary__title},u(t.fixable))),o().createElement("div",{className:s.Z.threat__severity},o().createElement(l.Z,{severity:t.severity})),n&&o().createElement("div",{className:s.Z.threat__checkbox},o().createElement("input",{type:"checkbox",checked:p,onChange:d,value:t.id}))))}},5658:function(e,t,n){"use strict";var a=n(5106),c=n(9307),r=n(5736),i=n(9196),o=n(5773),l=n(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,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 c=a/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=a/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=a/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=a/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=a/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:l.Z.empty},React.createElement(s,null),React.createElement(a.H3,{weight:"bold",mt:8},__("Don't worry about a thing","jetpack-protect")),React.createElement(a.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,n){"use strict";var a=n(526),c=n(5106),r=n(857),i=n(8258),o=n(5736),l=n(9196),s=n.n(l),u=n(3898),p=n(6477),m=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:b,title:k,type:y,version:Z}=e;const{adminUrl:C}=window.jetpackProtectInitialState||{},{run:_}=(0,i.Z)({productSlug:u.o,redirectUrl:C}),{recordEventHandler:w}=(0,p.Z)(),R=w("jetpack_protect_threat_list_get_scan_link_click",_),j=E?s().createElement(a.Z,{variant:"link",isExternalLink:!0,weight:"regular",href:E},__("See more technical details of this threat","jetpack-protect")):null,N=(0,l.useCallback)((()=>v&&Z?`${v} (${Z})`:n?n.split("/").pop():b||void 0),[n,v,b,Z]);return s().createElement(m.U,{id:f,label:N(),title:k,icon:g,onOpen:(0,l.useCallback)((()=>{["core","plugin","theme"].includes(y)&&w(`jetpack_protect_${y}_threat_open`)}),[w,y])},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,o.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(m.Z,null,t.map((e=>{let{description:t,fixedIn:n,icon:a,id:c,name:r,source:i,table:o,title:l,type:u,version:p}=e;return s().createElement(h,{description:t,fixedIn:n,icon:a,id:c,key:c,name:r,source:i,table:o,title:l,type:u,version:p})})))}},5207:function(e,t,n){"use strict";var a=n(3363),c=n(3846),r=n(5106),i=n(526),o=n(9818),l=n(5736),s=n(9196),u=n.n(s),p=n(5773),m=n(4633),d=n(5658),h=n(2831),g=n(4289),f=n(1400),v=n(9709),E=n(7930);const __=l.__;t.Z=()=>{const{hasRequiredPlan:e}=(0,p.Z)(),{item:t,list:n,selected:b,setSelected:k}=(0,E.Z)(),y=n.filter((e=>e.fixable)),{setModal:Z}=(0,o.useDispatch)(m.t),{scan:C}=(0,o.useDispatch)(m.t),_=(0,o.useSelect)((e=>e(m.t).getScanIsEnqueuing())),w=(0,s.useCallback)((()=>{switch(b){case"all":return 1===n.length?__("All threats","jetpack-protect"):(0,l.sprintf)(/* translators: placeholder is the amount of threats found on the site. */
|
|||
|
__("All %s threats","jetpack-protect"),n.length);case"files":return(0,l.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,l.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,l.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)}}),[b,n,t]);return u().createElement(a.Z,{fluid:!0,horizontalSpacing:0,horizontalGap:3},u().createElement(c.Z,{lg:4},u().createElement(g.Z,{selected:b,onSelect:k})),u().createElement(c.Z,{lg:8},n?.length>0?u().createElement(u().Fragment,null,u().createElement("div",{className:v.Z["list-header"]},u().createElement(r.Dx,{className:v.Z["list-title"]},w()),e&&u().createElement(u().Fragment,null,y.length>0&&u().createElement(i.Z,{variant:"primary",className:v.Z["list-header-button"],onClick:(R=y,e=>{e.preventDefault(),Z({type:"FIX_ALL_THREATS",props:{threatList:R}})})},/* translators: Translates to Auto fix all. $s: Number of fixable threats. */
|
|||
|
(0,l.sprintf)(__("Auto fix all (%s)","jetpack-protect"),y.length)),u().createElement(i.Z,{variant:"secondary",className:v.Z["list-header-button"],isLoading:_,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),c=n(5736),r=n(797),i=n(2817),o=n(7663),l=n(8960),s=n(4160),u=n(6376),p=n(9196),m=n(6477),d=n(5773),h=n(5338);const __=c.__;t.Z=e=>{let{selected:t,onSelect:n}=e;const{plugins:c,themes:g,numThreats:f,numCoreThreats:v,numFilesThreats:E,numDatabaseThreats:b,hasRequiredPlan:k}=(0,d.Z)(),{recordEvent:y}=(0,m.Z)(),[Z]=(0,a.Z)("lg","<"),C=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_all_click")}),[y]),_=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_core_click")}),[y]),w=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_plugin_click")}),[y]),R=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_theme_click")}),[y]),j=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_file_click")}),[y]),N=(0,p.useCallback)((()=>{y("jetpack_protect_navigation_database_click")}),[y]);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:r.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:_,checked:!0}),React.createElement(h.KB,{label:__("Plugins","jetpack-protect"),icon:o.Z},c.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:w})}))),React.createElement(h.KB,{label:__("Themes","jetpack-protect"),icon:l.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})}))),k&&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:b,disabled:b<=0,onClick:N,checked:!0})))}},1400:function(e,t,n){"use strict";var a=n(526),c=n(5106),r=n(2054),i=n(9818),o=n(9307),l=n(5736),s=n(9196),u=n.n(s),p=n(6477),m=n(4633),d=n(7127),h=n(4257),g=n(289),f=n(9709);const __=l.__,v=e=>{let{context:t,description:n,diff:r,filename:o,fixedIn:v,icon:E,fixable:b,id:k,label:y,name:Z,source:C,title:_,type:w,severity:R}=e;const{setModal:j}=(0,i.useDispatch)(m.t),{recordEvent:N}=(0,p.Z)(),S=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:k,label:y,title:_,icon:E,fixable:b,severity:R,onOpen:(0,s.useCallback)((()=>{["core","plugin","theme","file","database"].includes(w)&&N(`jetpack_protect_${w}_threat_open`)}),[N,w])},n&&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},n),S),(o||t||r)&&u().createElement(c.ZP,{variant:"title-small",mb:2},__("The technical details","jetpack-protect")),o&&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"]},o)),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,l.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),Z,v))),!n&&u().createElement("div",{className:f.Z["threat-section"]},S),u().createElement("div",{className:f.Z["threat-footer"]},u().createElement(a.Z,{isDestructive:!0,variant:"secondary",onClick:e=>{e.preventDefault(),j({type:"IGNORE_THREAT",props:{id:k,label:y,title:_,icon:E,severity:R}})}},__("Ignore threat","jetpack-protect")),b&&u().createElement(a.Z,{onClick:e=>{e.preventDefault(),j({type:"FIX_THREAT",props:{id:k,label:y,title:_,icon:E,severity:R,fixable:b}})}},__("Fix threat","jetpack-protect"))))};t.Z=e=>{let{list:t}=e;const{scan:n}=(0,i.useDispatch)(m.t),l=(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()}})}),[s]=(0,r.Z)(["sm","lg"],[null,"<"]),p=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:p(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:n,diff:a,filename:c,fixedIn:r,icon:i,fixable:o,id:l,label:s,name:p,severity:m,source:d,table:h,title:g,type:f,version:E}=e;return u().createElement(v,{context:t,description:n,diff:a,filename:c,fixedIn:r,icon:i,fixable:o,id:l,key:l,label:s,name:p,severity:m,source:d,table:h,title:g,type:f,version:E})}))),u().createElement(c.ZP,{className:f.Z["manual-scan"],variant:"body-small"},l))}},7930:function(e,t,n){"use strict";var a=n(2817),c=n(7663),r=n(8960),i=n(4160),o=n(6376),l=n(9196),s=n(5773);const u=(e,t)=>Array.isArray(e)?e.map((e=>u(e,t))).flat():e?.threats?.map((n=>({...n,...e,icon:t}))),p=e=>{let{core:t,plugins:n,themes:l,files:s,database:p}=e;return[...u(t,a.Z),...u(n,c.Z),...u(l,r.Z),...u(s,i.Z),...u(p,o.Z)]};t.Z=()=>{const{plugins:e,themes:t,core:n,files:m,database:d}=(0,s.Z)();let h=p({core:n,plugins:e,themes:t,files:m,database:d}),g={};const[f,v]=(0,l.useState)(h.length?"all":null);switch(f){case"all":h=p({core:n,plugins:e,themes:t,files:m,database:d});break;case"wordpress":h=u(n,a.Z),g=n;break;case"files":h=u(m,i.Z),g=m;break;case"database":h=u(d,o.Z),g=d}const E=e.find((e=>e?.name===f));E&&(h=u(E,c.Z),g=E);const b=t.find((e=>e?.name===f));return b&&(h=u(b,r.Z),g=b),{item:g,list:h,selected:f,setSelected:v}}},2854:function(e,t,n){"use strict";var a=n(1294),c=n(8227);t.Z=e=>{let{children:t}=e;const{isUserConnected:n,hasConnectedOwner:r}=(0,a.Z)();return n&&r?t:React.createElement(c.Z,null)}},8227:function(e,t,n){"use strict";var a=n(5106),c=n(526),r=n(1294),i=n(9818),o=n(5736),l=n(4633),s=n(291),u=n(541);const __=o.__;t.Z=()=>{const{setModal:e}=(0,i.useDispatch)(l.t),{userIsConnecting:t,handleConnectUser:n}=(0,r.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(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(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 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({type:null})}},__("Not now","jetpack-protect")),React.createElement(c.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(J({type:"error",message:__("Not all threats could be fixed. Please contact our support.","jetpack-protect")}))})).finally((()=>{n(B([]))}))},J=e=>({type:C,payload:e}),G=e=>({type:w,hasRequiredPlan:e}),$={checkCredentials:()=>async e=>{let{dispatch:t}=e;return await new Promise(((e,n)=>(t(F(!0)),c()({path:"jetpack-protect/v1/check-credentials",method:"POST"}).then((n=>{t(V(n)),e(n)})).catch((e=>{n(e)})).finally((()=>{t(F(!1))})))))},setCredentials:V,setCredentialsIsFetching:F,setStatus:M,setStatusProgress:e=>({type:p,currentProgress:e}),startScanOptimistically:T,refreshStatus:z,setStatusIsFetching:O,setScanIsEnqueuing:H,setInstalledPlugins:e=>({type:f,plugins:e}),setInstalledThemes:e=>({type:v,themes:e}),setwpVersion:e=>({type:E,version:e}),setJetpackScan:e=>({type:b,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(U(e,!0)),await new Promise((()=>c()({path:`jetpack-protect/v1/ignore-threat?threat_id=${e}`,method:"POST"}).then((()=>a(z()))).then((()=>a(J({type:"success",message:__("Threat ignored","jetpack-protect")})))).catch((()=>a(J({type:"error",message:__("An error ocurred ignoring the threat.","jetpack-protect")})))).finally((()=>{a(U(e,!1)),t()}))))}},setModal:e=>({type:Z,payload:e}),setNotice:J,clearNotice:()=>({type:_}),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(U(e,!0))})),await new Promise((()=>c()({path:`jetpack-protect/v1/fix-threats?threat_ids=${e}`,method:"POST",data:{threatIds:e}}).then((()=>a(J({type:"success",message:__("We're hard at work fixing this threat in the background. Please check back shortly.","jetpack-protect")})))).then((()=>{setTimeout((()=>a(W(e))),1e3)})).catch((()=>a(J({type:"error",message:__("Error fixing threats. Please contact support.","jetpack-protect")})))).finally((()=>{e.forEach((e=>{a(U(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(H(!0)),await new Promise((()=>c()({path:"jetpack-protect/v1/scan",method:"POST"}).then((()=>{n(T()),setTimeout((()=>n(z(!0))),5e3)})).catch((()=>n(J({type:"error",message:__("An error ocurred enqueuing the scan","jetpack-protect")})))).finally((()=>{n(H(!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:D,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:I,stats:e})}},3638:function(e,t,n){"use strict";var a=n(9818),c=n(5230);const r={isSupported:null,isSeen:!1,upgradeIsSeen:!1,isEnabled:!1,isUpdating:!1,isToggling:!1,config:void 0,stats: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===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!==arguments[0]&&arguments[0],t=arg
|