PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-beta
Jetpack – WP Security, Backup, Speed, & Growth v16.3-beta
16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 All 507 releases
← All changes | _inc/build/widget-visibility/editor/index.js +1 -1 12.9.5 → 16.3-beta View file →
@@ -1 +1 @@
1 -(()=>{var e={171:e=>{var t=1e3,n=60*t,i=60*n,s=24*i,o=7*s,r=365.25*s;function c(e,t,n,i){var s=t>=1.5*n;return Math.round(e/n)+" "+i+(s?"s":"")}e.exports=function(e,a){a=a||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!c)return;var a=parseFloat(c[1]);switch((c[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*r;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*s;case"hours":case"hour":case"hrs":case"hr":case"h":return a*i;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===l&&isFinite(e))return a.long?function(e){var o=Math.abs(e);if(o>=s)return c(e,o,s,"day");if(o>=i)return c(e,o,i,"hour");if(o>=n)return c(e,o,n,"minute");if(o>=t)return c(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=s)return Math.round(e/s)+"d";if(o>=i)return Math.round(e/i)+"h";if(o>=n)return Math.round(e/n)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},975:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(128);const s=n.n(i)()("dops:analytics");let o,r;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const c={initialize:function(e,t,n){c.setUser(e,t),c.setSuperProps(n),c.identifyUser()},setGoogleAnalyticsEnabled:function(e,t=null){this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){r={ID:e,username:t}},setSuperProps:function(e){o=e},assignSuperProps:function(e){o=Object.assign(o||{},e)},mc:{bumpStat:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);s("Bumping stats %o",e)}else n="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),s('Bumping stat "%s" in group "%s"',t,e);return n}(e,t);c.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+n+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);s("Built stats %o",e)}else n="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),s('Built stat "%s" in group "%s"',t,e);return n}(e,t);c.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+n+"&t="+Math.random())}},pageView:{record:function(e,t){c.tracks.recordPageView(e),c.ga.recordPageView(e,t)}},purchase:{record:function(e,t,n,i,s,o,r){c.ga.recordPurchase(e,t,n,i,s,o,r)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(o&&(s("- Super Props: %o",o),t=Object.assign(t,o)),s('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):s('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};c.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){c.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){s("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};c.ga.initialized||(r&&(e={userId:"u-"+r.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),c.ga.initialized=!0)},recordPageView:function(e,t){c.ga.initialize(),s("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),this.googleAnalyticsEnabled&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,n,i){c.ga.initialize();let o="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==n&&(o+=" [Option Label: "+n+"]"),void 0!==i&&(o+=" [Option Value: "+i+"]"),s(o),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,n,i)},recordPurchase:function(e,t,n,i,s,o,r){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:i,currency:r}),window.ga("ecommerce:addItem",{id:e,name:t,sku:n,price:s,quantity:o}),window.ga("ecommerce:send")}},identifyUser:function(){r&&window._tkq.push(["identifyUser",r.ID,r.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}},a=c},743:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>u});var i=n(132),s=n(483);function o(e){class t extends Error{constructor(...t){super(...t),this.name=e}}return t}const r=o("JsonParseError"),c=o("JsonParseAfterRedirectError"),a=o("Api404Error"),l=o("Api404AfterRedirectError"),d=o("FetchNetworkError");const u=new function(e,t){let n=e,o=e,r={"X-WP-Nonce":t},c={credentials:"same-origin",headers:r},a={method:"post",credentials:"same-origin",headers:Object.assign({},r,{"Content-type":"application/json"})},l=function(e){const t=e.split("?"),n=t.length>1?t[1]:"",i=n.length?n.split("&"):[];return i.push("_cacheBuster="+(new Date).getTime()),t[0]+"?"+i.join("&")};const d={setApiRoot(e){n=e},setWpcomOriginApiUrl(e){o=e},setApiNonce(e){r={"X-WP-Nonce":e},c={credentials:"same-origin",headers:r},a={method:"post",credentials:"same-origin",headers:Object.assign({},r,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{l=e},registerSite:(e,t)=>{const s={registration_nonce:e,no_iframe:!0};return(0,i.jetpackConfigHas)("consumer_slug")&&(s.plugin_slug=(0,i.jetpackConfigGet)("consumer_slug")),null!==t&&(s.redirect_uri=t),h(`${n}jetpack/v4/connection/register`,a,{body:JSON.stringify(s)}).then(p).then(g)},fetchAuthorizationUrl:e=>u((0,s.addQueryArgs)(`${n}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),c).then(p).then(g),fetchSiteConnectionData:()=>u(`${n}jetpack/v4/connection/data`,c).then(g),fetchSiteConnectionStatus:()=>u(`${n}jetpack/v4/connection`,c).then(g),fetchSiteConnectionTest:()=>u(`${n}jetpack/v4/connection/test`,c).then(p).then(g),fetchUserConnectionData:()=>u(`${n}jetpack/v4/connection/data`,c).then(g),fetchUserTrackingSettings:()=>u(`${n}jetpack/v4/tracking/settings`,c).then(p).then(g),updateUserTrackingSettings:e=>h(`${n}jetpack/v4/tracking/settings`,a,{body:JSON.stringify(e)}).then(p).then(g),disconnectSite:()=>h(`${n}jetpack/v4/connection`,a,{body:JSON.stringify({isActive:!1})}).then(p).then(g),fetchConnectUrl:()=>u(`${n}jetpack/v4/connection/url`,c).then(p).then(g),unlinkUser:()=>h(`${n}jetpack/v4/connection/user`,a,{body:JSON.stringify({linked:!1})}).then(p).then(g),reconnect:()=>h(`${n}jetpack/v4/connection/reconnect`,a).then(p).then(g),fetchConnectedPlugins:()=>u(`${n}jetpack/v4/connection/plugins`,c).then(p).then(g),setHasSeenWCConnectionModal:()=>h(`${n}jetpack/v4/seen-wc-connection-modal`,a).then(p).then(g),fetchModules:()=>u(`${n}jetpack/v4/module/all`,c).then(p).then(g),fetchModule:e=>u(`${n}jetpack/v4/module/${e}`,c).then(p).then(g),activateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,a,{body:JSON.stringify({active:!0})}).then(p).then(g),deactivateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,a,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>h(`${n}jetpack/v4/module/${e}`,a,{body:JSON.stringify(t)}).then(p).then(g),updateSettings:e=>h(`${n}jetpack/v4/settings`,a,{body:JSON.stringify(e)}).then(p).then(g),getProtectCount:()=>u(`${n}jetpack/v4/module/protect/data`,c).then(p).then(g),resetOptions:e=>h(`${n}jetpack/v4/options/${e}`,a,{body:JSON.stringify({reset:!0})}).then(p).then(g),activateVaultPress:()=>h(`${n}jetpack/v4/plugins`,a,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(p).then(g),getVaultPressData:()=>u(`${n}jetpack/v4/module/vaultpress/data`,c).then(p).then(g),installPlugin:(e,t)=>{const i={slug:e,status:"active"};return t&&(i.source=t),h(`${n}jetpack/v4/plugins`,a,{body:JSON.stringify(i)}).then(p).then(g)},activateAkismet:()=>h(`${n}jetpack/v4/plugins`,a,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(p).then(g),getAkismetData:()=>u(`${n}jetpack/v4/module/akismet/data`,c).then(p).then(g),checkAkismetKey:()=>u(`${n}jetpack/v4/module/akismet/key/check`,c).then(p).then(g),checkAkismetKeyTyped:e=>h(`${n}jetpack/v4/module/akismet/key/check`,a,{body:JSON.stringify({api_key:e})}).then(p).then(g),fetchStatsData:e=>u(function(e){let t=`${n}jetpack/v4/module/stats/data`;-1!==t.indexOf("?")?t+=`&range=${encodeURIComponent(e)}`:t+=`?range=${encodeURIComponent(e)}`;return t}(e),c).then(p).then(g).then(m),getPluginUpdates:()=>u(`${n}jetpack/v4/updates/plugins`,c).then(p).then(g),getPlans:()=>u(`${n}jetpack/v4/plans`,c).then(p).then(g),fetchSettings:()=>u(`${n}jetpack/v4/settings`,c).then(p).then(g),updateSetting:e=>h(`${n}jetpack/v4/settings`,a,{body:JSON.stringify(e)}).then(p).then(g),fetchSiteData:()=>u(`${n}jetpack/v4/site`,c).then(p).then(g).then((e=>JSON.parse(e.data))),fetchSiteFeatures:()=>u(`${n}jetpack/v4/site/features`,c).then(p).then(g).then((e=>JSON.parse(e.data))),fetchSiteProducts:()=>u(`${n}jetpack/v4/site/products`,c).then(p).then(g),fetchSitePurchases:()=>u(`${n}jetpack/v4/site/purchases`,c).then(p).then(g).then((e=>JSON.parse(e.data))),fetchSiteBenefits:()=>u(`${n}jetpack/v4/site/benefits`,c).then(p).then(g).then((e=>JSON.parse(e.data))),fetchSiteDiscount:()=>u(`${n}jetpack/v4/site/discount`,c).then(p).then(g).then((e=>e.data)),fetchSetupQuestionnaire:()=>u(`${n}jetpack/v4/setup/questionnaire`,c).then(p).then(g),fetchRecommendationsData:()=>u(`${n}jetpack/v4/recommendations/data`,c).then(p).then(g),fetchRecommendationsProductSuggestions:()=>u(`${n}jetpack/v4/recommendations/product-suggestions`,c).then(p).then(g),fetchRecommendationsUpsell:()=>u(`${n}jetpack/v4/recommendations/upsell`,c).then(p).then(g),fetchRecommendationsConditional:()=>u(`${n}jetpack/v4/recommendations/conditional`,c).then(p).then(g),saveRecommendationsData:e=>h(`${n}jetpack/v4/recommendations/data`,a,{body:JSON.stringify({data:e})}).then(p),fetchProducts:()=>u(`${n}jetpack/v4/products`,c).then(p).then(g),fetchRewindStatus:()=>u(`${n}jetpack/v4/rewind`,c).then(p).then(g).then((e=>JSON.parse(e.data))),fetchScanStatus:()=>u(`${n}jetpack/v4/scan`,c).then(p).then(g).then((e=>JSON.parse(e.data))),dismissJetpackNotice:e=>h(`${n}jetpack/v4/notice/${e}`,a,{body:JSON.stringify({dismissed:!0})}).then(p).then(g),fetchPluginsData:()=>u(`${n}jetpack/v4/plugins`,c).then(p).then(g),fetchIntroOffers:()=>u(`${n}jetpack/v4/intro-offers`,c).then(p).then(g),fetchVerifySiteGoogleStatus:e=>u(null!==e?`${n}jetpack/v4/verify-site/google/${e}`:`${n}jetpack/v4/verify-site/google`,c).then(p).then(g),verifySiteGoogle:e=>h(`${n}jetpack/v4/verify-site/google`,a,{body:JSON.stringify({keyring_id:e})}).then(p).then(g),submitSurvey:e=>h(`${n}jetpack/v4/marketing/survey`,a,{body:JSON.stringify(e)}).then(p).then(g),saveSetupQuestionnaire:e=>h(`${n}jetpack/v4/setup/questionnaire`,a,{body:JSON.stringify(e)}).then(p).then(g),updateLicensingError:e=>h(`${n}jetpack/v4/licensing/error`,a,{body:JSON.stringify(e)}).then(p).then(g),updateLicenseKey:e=>h(`${n}jetpack/v4/licensing/set-license`,a,{body:JSON.stringify({license:e})}).then(p).then(g),getUserLicensesCounts:()=>u(`${n}jetpack/v4/licensing/user/counts`,c).then(p).then(g),getUserLicenses:()=>u(`${n}jetpack/v4/licensing/user/licenses`,c).then(p).then(g),updateLicensingActivationNoticeDismiss:e=>h(`${n}jetpack/v4/licensing/user/activation-notice-dismiss`,a,{body:JSON.stringify({last_detached_count:e})}).then(p).then(g),updateRecommendationsStep:e=>h(`${n}jetpack/v4/recommendations/step`,a,{body:JSON.stringify({step:e})}).then(p),confirmIDCSafeMode:()=>h(`${n}jetpack/v4/identity-crisis/confirm-safe-mode`,a).then(p),startIDCFresh:e=>h(`${n}jetpack/v4/identity-crisis/start-fresh`,a,{body:JSON.stringify({redirect_uri:e})}).then(p).then(g),migrateIDC:()=>h(`${n}jetpack/v4/identity-crisis/migrate`,a).then(p),attachLicenses:e=>h(`${n}jetpack/v4/licensing/attach-licenses`,a,{body:JSON.stringify({licenses:e})}).then(p).then(g),fetchSearchPlanInfo:()=>u(`${o}jetpack/v4/search/plan`,c).then(p).then(g),fetchSearchSettings:()=>u(`${o}jetpack/v4/search/settings`,c).then(p).then(g),updateSearchSettings:e=>h(`${o}jetpack/v4/search/settings`,a,{body:JSON.stringify(e)}).then(p).then(g),fetchSearchStats:()=>u(`${o}jetpack/v4/search/stats`,c).then(p).then(g),fetchWafSettings:()=>u(`${n}jetpack/v4/waf`,c).then(p).then(g),updateWafSettings:e=>h(`${n}jetpack/v4/waf`,a,{body:JSON.stringify(e)}).then(p).then(g),fetchWordAdsSettings:()=>u(`${n}jetpack/v4/wordads/settings`,c).then(p).then(g),updateWordAdsSettings:e=>h(`${n}jetpack/v4/wordads/settings`,a,{body:JSON.stringify(e)}),fetchSearchPricing:()=>u(`${o}jetpack/v4/search/pricing`,c).then(p).then(g),fetchMigrationStatus:()=>u(`${n}jetpack/v4/migration/status`,c).then(p).then(g),fetchBackupUndoEvent:()=>u(`${n}jetpack/v4/site/backup/undo-event`,c).then(p).then(g)};function u(e,t){return fetch(l(e),t)}function h(e,t,n){return fetch(e,Object.assign({},t,n)).catch(f)}function m(e){return e.general&&void 0===e.general.response||e.week&&void 0===e.week.response||e.month&&void 0===e.month.response?e:{}}Object.assign(this,d)};function p(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise((()=>{throw e.redirected?new l(e.redirected):new a})):e.json().catch((e=>h(e))).then((t=>{const n=new Error(`${t.message} (Status ${e.status})`);throw n.response=t,n.name="ApiError",n}))}function g(e){return e.json().catch((t=>h(t,e.redirected,e.url)))}function h(e,t,n){throw t?new c(n):new r}function f(){throw new d}},132:(e,t,n)=>{let i={};try{i=n(787)}catch{console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),i={missingConfig:!0}}const s=e=>i.hasOwnProperty(e);e.exports={jetpackConfigHas:s,jetpackConfigGet:e=>{if(!s(e))throw'This app requires the "'+e+'" Jetpack Config to be defined in your webpack configuration file. See details in @automattic/jetpack-config package docs.';return i[e]}}},294:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(743),s=n(818),o=n(196),r=n(428);const c=window?.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{},a=({registrationNonce:e=c.registrationNonce,apiRoot:t=c.apiRoot,apiNonce:n=c.apiNonce,redirectUri:a,autoTrigger:l,from:d,skipUserConnection:u}={})=>{const{registerSite:p,connectUser:g,refreshConnectedPlugins:h}=(0,s.useDispatch)(r.t),f=(0,s.useSelect)((e=>e(r.t).getRegistrationError())),{siteIsRegistering:m,userIsConnecting:C,userConnectionData:v,connectedPlugins:y,connectionErrors:w,isRegistered:k,isUserConnected:_,hasConnectedOwner:S,isOfflineMode:j}=(0,s.useSelect)((e=>({siteIsRegistering:e(r.t).getSiteIsRegistering(),userIsConnecting:e(r.t).getUserIsConnecting(),userConnectionData:e(r.t).getUserConnectionData(),connectedPlugins:e(r.t).getConnectedPlugins(),connectionErrors:e(r.t).getConnectionErrors(),isOfflineMode:e(r.t).getIsOfflineMode(),...e(r.t).getConnectionStatus()}))),b=()=>u?a?(window.location=a,Promise.resolve(a)):Promise.resolve():g({from:d,redirectUri:a}),E=t=>(t&&t.preventDefault(),k?b():p({registrationNonce:e,redirectUri:a}).then((()=>b())));return(0,o.useEffect)((()=>{i.ZP.setApiRoot(t),i.ZP.setApiNonce(n)}),[t,n]),(0,o.useEffect)((()=>{!l||m||C||E()}),[]),{handleRegisterSite:E,handleConnectUser:b,refreshConnectedPlugins:h,isRegistered:k,isUserConnected:_,siteIsRegistering:m,userIsConnecting:C,registrationError:f,userConnectionData:v,hasConnectedOwner:S,connectedPlugins:y,connectionErrors:w,isOfflineMode:j}}},523:(e,t,n)=>{"use strict";n.d(t,{LI:()=>o,N4:()=>c,Qo:()=>u,T1:()=>l,TS:()=>d,ZP:()=>_,b5:()=>g,i6:()=>s,qJ:()=>h,qV:()=>a,r7:()=>r,wQ:()=>p});var i=n(743);const s="SET_CONNECTION_STATUS",o="SET_CONNECTION_STATUS_IS_FETCHING",r="SET_SITE_IS_REGISTERING",c="SET_USER_IS_CONNECTING",a="SET_REGISTRATION_ERROR",l="CLEAR_REGISTRATION_ERROR",d="SET_AUTHORIZATION_URL",u="DISCONNECT_USER_SUCCESS",p="SET_CONNECTED_PLUGINS",g="SET_CONNECTION_ERRORS",h="SET_IS_OFFLINE_MODE",f=e=>({type:s,connectionStatus:e}),m=e=>({type:r,isRegistering:e}),C=e=>({type:c,isConnecting:e}),v=e=>({type:a,registrationError:e}),y=()=>({type:l}),w=e=>({type:d,authorizationUrl:e}),k=e=>({type:p,connectedPlugins:e});const _={setConnectionStatus:f,setConnectionStatusIsFetching:e=>({type:o,isFetching:e}),fetchConnectionStatus:()=>({type:"FETCH_CONNECTION_STATUS"}),fetchAuthorizationUrl:e=>({type:"FETCH_AUTHORIZATION_URL",redirectUri:e}),setSiteIsRegistering:m,setUserIsConnecting:C,setRegistrationError:v,clearRegistrationError:y,setAuthorizationUrl:w,registerSite:function*({registrationNonce:e,redirectUri:t}){yield y(),yield m(!0);try{const n=yield{type:"REGISTER_SITE",registrationNonce:e,redirectUri:t};return yield f({isRegistered:!0}),yield w(n.authorizeUrl),yield m(!1),Promise.resolve(n)}catch(e){return yield v(e),yield m(!1),Promise.reject(e)}},connectUser:function*({from:e,redirectFunc:t,redirectUri:n}={}){yield C(!0),yield{type:"CONNECT_USER",from:e,redirectFunc:t,redirectUri:n}},disconnectUserSuccess:()=>({type:u}),setConnectedPlugins:k,refreshConnectedPlugins:()=>async({dispatch:e})=>await new Promise((t=>i.ZP.fetchConnectedPlugins().then((n=>{e(k(n)),t(n)})))),setConnectionErrors:e=>({type:g,connectionErrors:e}),setIsOfflineMode:e=>({type:h,isOfflineMode:e})}},432:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(743),s=n(818),o=n(57);const r={FETCH_AUTHORIZATION_URL:({redirectUri:e})=>i.ZP.fetchAuthorizationUrl(e),REGISTER_SITE:({registrationNonce:e,redirectUri:t})=>i.ZP.registerSite(e,t),CONNECT_USER:(0,s.createRegistryControl)((({resolveSelect:e})=>({from:t,redirectFunc:n,redirectUri:i}={})=>new Promise(((s,r)=>{e(o.Z).getAuthorizationUrl(i).then((e=>{const i=n||(e=>window.location.assign(e)),o=new URL(e);t&&o.searchParams.set("from",encodeURIComponent(t));const r=o.toString();i(r),s(r)})).catch((e=>{r(e)}))}))))}},479:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(818),s=n(523);const o=(0,i.combineReducers)({connectionStatus:(e={},t)=>{switch(t.type){case s.i6:return{...e,...t.connectionStatus};case s.Qo:return{...e,isUserConnected:!1}}return e},connectionStatusIsFetching:(e=!1,t)=>t.type===s.LI?t.isFetching:e,siteIsRegistering:(e=!1,t)=>t.type===s.r7?t.isRegistering:e,userIsConnecting:(e=!1,t)=>t.type===s.N4?t.isConnecting:e,registrationError:(e,t)=>{switch(t.type){case s.T1:return!1;case s.qV:return t.registrationError;default:return e}},authorizationUrl:(e,t)=>t.type===s.TS?t.authorizationUrl:e,userConnectionData:(e,t)=>(t.type,e),connectedPlugins:(e={},t)=>t.type===s.wQ?t.connectedPlugins:e,connectionErrors:(e={},t)=>t.type===s.b5?t.connectionErrors:e,isOfflineMode:(e=!1,t)=>t.type===s.qJ?t.isConnecting:e})},728:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(818),s=n(523),o=n(57);const r={...{getAuthorizationUrl:{isFulfilled:(e,...t)=>{const n=Boolean(e.authorizationUrl),s=(0,i.select)(o.Z).hasFinishedResolution("getAuthorizationUrl",t);return n&&!s&&(0,i.dispatch)(o.Z).finishResolution("getAuthorizationUrl",t),n},*fulfill(e){const t=yield s.ZP.fetchAuthorizationUrl(e);yield s.ZP.setAuthorizationUrl(t.authorizeUrl)}}}}},725:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i={...{getConnectionStatus:e=>e.connectionStatus||{},getConnectionStatusIsFetching:()=>!1,getSiteIsRegistering:e=>e.siteIsRegistering||!1,getUserIsConnecting:e=>e.userIsConnecting||!1,getRegistrationError:e=>e.registrationError||!1,getAuthorizationUrl:e=>e.authorizationUrl||!1,getUserConnectionData:e=>e.userConnectionData||!1,getConnectedPlugins:e=>e.connectedPlugins||[],getConnectionErrors:e=>e.connectionErrors||[],getIsOfflineMode:e=>e.isOfflineMode||!1,getWpcomUser:e=>e?.userConnectionData?.currentUser?.wpcomUser,getBlogId:e=>e?.userConnectionData?.currentUser?.blogId}}},535:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(818);class s{static store=null;static mayBeInit(e,t){null===s.store&&(s.store=(0,i.createReduxStore)(e,t),(0,i.register)(s.store))}}const o=s},57:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="jetpack-connection"},428:(e,t,n)=>{"use strict";n.d(t,{t:()=>l.Z});var i=n(523),s=n(432),o=n(479),r=n(728),c=n(725),a=n(535),l=n(57);const d=window.JP_CONNECTION_INITIAL_STATE;d||console.error("Jetpack Connection package: Initial state is missing. Check documentation to see how to use the Connection composer package to set up the initial state."),a.Z.mayBeInit(l.Z,{__experimentalUseThunks:!0,reducer:o.Z,actions:i.ZP,selectors:c.Z,resolvers:r.Z,controls:s.Z,initialState:d||{}})},419:(e,t,n)=>{"use strict";n.d(t,{Wp:()=>i.Wp,z$:()=>s.Z});var i=n(505),s=(n(714),n(354),n(404),n(53));n(380),n(342),n(959),n(58)},342:(e,t,n)=>{"use strict";n(196)},959:(e,t,n)=>{"use strict";n(307)},53:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(975),s=n(294),o=n(307);const{tracks:r}=i.Z,{recordEvent:c}=r,a=({pageViewEventName:e=null,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:a={}}={})=>{const[l,d]=(0,o.useState)(!1),{isUserConnected:u,isRegistered:p,userConnectionData:g={}}=(0,s.Z)(),{wpcomUser:{login:h,ID:f}={},blogId:m}=g.currentUser||{},C=(0,o.useCallback)((async(e,t={})=>{u&&f&&h&&c(e,t)}),[u,f,h]);return(0,o.useEffect)((()=>{u&&f&&h&&m&&i.Z.initialize(f,h,{blog_id:m})}),[m,f,h,u]),(0,o.useEffect)((()=>{const i=e?`${t}_${e}_${n}`:null;p&&i&&(l||(C(i,a),d(!0)))}),[l,t,e,n,p,a,C]),{recordEvent:C,tracks:r}}},380:(e,t,n)=>{"use strict";n(989),n(307)},166:(e,t,n)=>{"use strict";n.d(t,{Z$:()=>a,ZP:()=>p,rW:()=>u});var i=n(818),s=n(505),o=n(162),r=n(58);const c="SET_JETPACK_MODULES";function*a(){if((0,s.Wp)())return!0;try{yield l(!0);const e=yield(0,o.Bs)();return yield u({data:e}),!0}catch(e){const t=(0,i.select)(r.p).getJetpackModules();return yield u(t),!1}finally{yield l(!1)}}function l(e){return u({isLoading:e})}function d(e){return u({isUpdating:e})}function u(e){return{type:c,options:e}}const p={updateJetpackModuleStatus:function*(e){try{const t=(0,i.select)(r.p).getJetpackModules();yield d(!0),t.data?.[e.name]?.activated!==e.active&&(yield u(t)),yield(0,o.zL)(e);const n=yield(0,o.Bs)();return yield u({data:n}),!0}catch(e){const t=(0,i.select)(r.p).getJetpackModules();return yield u(t),!1}finally{yield d(!1)}},setJetpackModules:u,fetchModules:a}},162:(e,t,n)=>{"use strict";n.d(t,{Bs:()=>c,ZP:()=>l,zL:()=>a});var i=n(989),s=n.n(i);const o="FETCH_JETPACK_MODULES",r="UPDATE_JETPACK_MODULE_STATUS",c=()=>({type:o}),a=e=>({type:r,settings:e}),l={[o]:function(){return s()({path:"/jetpack/v4/module/all",method:"GET"})},[r]:function({settings:e}){return s()({path:`/jetpack/v4/module/${e.name}/active`,method:"POST",data:{active:e.active}})}}},58:(e,t,n)=>{"use strict";n.d(t,{p:()=>l});var i=n(818),s=n(166),o=n(162),r=n(469),c=n(133),a=n(524);const l="jetpack-modules",d=(0,i.createReduxStore)(l,{reducer:r.Z,actions:s.ZP,controls:o.ZP,resolvers:c.ZP,selectors:a.Z});(0,i.register)(d)},469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});const i={isLoading:!1,isUpdating:!1,data:{}},s=(e=i,t)=>"SET_JETPACK_MODULES"===t.type?{...e,...t.options}:e},133:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>o});var i=n(166),s=n(162);const o={getJetpackModules:function*(){try{const e=yield(0,s.Bs)();if(e)return(0,i.rW)({data:e})}catch(e){console.error(e)}},isModuleActive:function(){return(0,i.Z$)()}}},524:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(505);const s={getJetpackModules:e=>e.data,isModuleActive:(e,t)=>(0,i.Wp)()||(e?.data?.[t]?.activated??!1),areModulesLoading:e=>e.isLoading??!1,areModulesUpdating:e=>e.isUpdating??!1}},404:(e,t,n)=>{"use strict";var i=n(736);n(483),n(819);const __=i.__;__("Upgrade your plan to use video covers","jetpack"),__("Upgrade your plan to upload audio","jetpack")},714:(e,t,n)=>{"use strict";n(817)},505:(e,t,n)=>{"use strict";function i(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function s(){return"simple"===i()}n.d(t,{Wp:()=>s})},354:(e,t,n)=>{"use strict";n(674),n(333)},128:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let i=0,s=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(i++,"%c"===e&&(s=i))})),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(942)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},942:(e,t,n)=>{e.exports=function(e){function t(e){let n,s,o,r=null;function c(...e){if(!c.enabled)return;const i=c,s=Number(new Date),o=s-(n||s);i.diff=o,i.prev=n,i.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,s)=>{if("%%"===n)return"%";r++;const o=t.formatters[s];if("function"==typeof o){const t=e[r];n=o.call(i,t),e.splice(r,1),r--}return n})),t.formatArgs.call(i,e);(i.log||t.log).apply(i,e)}return c.namespace=e,c.useColors=t.useColors(),c.color=t.selectColor(e),c.extend=i,c.destroy=t.destroy,Object.defineProperty(c,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{r=e}}),"function"==typeof t.init&&t.init(c),c}function i(e,n){const i=t(this.namespace+(void 0===n?":":n)+e);return i.log=this.log,i}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(s),...t.skips.map(s).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),s=i.length;for(n=0;n<s;n++)i[n]&&("-"===(e=i[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(171),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},787:e=>{"use strict";if(void 0==={consumer_slug:"jetpack"}){var t=new Error('Cannot find module \'{"consumer_slug":"jetpack"}\'');throw t.code="MODULE_NOT_FOUND",t}e.exports={consumer_slug:"jetpack"}},196:e=>{"use strict";e.exports=window.React},819:e=>{"use strict";e.exports=window.lodash},989:e=>{"use strict";e.exports=window.wp.apiFetch},175:e=>{"use strict";e.exports=window.wp.blockEditor},609:e=>{"use strict";e.exports=window.wp.components},333:e=>{"use strict";e.exports=window.wp.compose},818:e=>{"use strict";e.exports=window.wp.data},307:e=>{"use strict";e.exports=window.wp.element},736:e=>{"use strict";e.exports=window.wp.i18n},817:e=>{"use strict";e.exports=window.wp.plugins},483:e=>{"use strict";e.exports=window.wp.url},674:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);(()=>{"use strict";var e=n(419),t=n(175),i=n(609),s=n(333),o=n(818),r=n(307),c=n(736);const __=c.__,_x=c._x,a={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&nbsp;":" "},l=/&(?:amp|lt|gt|quot|#39|nbsp);/g,d=e=>{if("string"!=typeof e)return e;return e.replace(l,(e=>a[e]))},u=e=>!new Set(["core/legacy-widget","core/widget-area"]).has(e);wp.hooks.addFilter("blocks.registerBlockType","widget/visibility",(function(e,t){return u(t)&&void 0!==e.attributes&&(e.attributes=Object.assign(e.attributes,{conditions:{type:"object",default:{}}})),e}));const p=(e,t=0)=>e.reduce(((e,n)=>{const[i,s]=n,o=" ".repeat(3*t);if(Array.isArray(s)){const n={label:d(o+i),value:i,disabled:!0},r=p(s,t+1);return e.concat([n]).concat(r)}const r={label:d(o+s),value:i};return e.concat([r])}),[]),g=t=>{const{rule:n,onDelete:s,setMajor:o,setMinor:r}=t,c=[{label:__("User","jetpack"),value:"loggedin"},{label:__("Role","jetpack"),value:"role"}],a=widget_conditions_data.taxonomy&&widget_conditions_data.taxonomy.length>1||"taxonomy"===n.major,l=[{label:__("Taxonomy","jetpack"),value:"taxonomy"}],d=[{label:__("-- Select --","jetpack"),value:""},{label:__("Category","jetpack"),value:"category"},{label:__("Author","jetpack"),value:"author"}].concat((0,e.Wp)()?[]:c).concat([{label:__("Tag","jetpack"),value:"tag"},{label:__("Date","jetpack"),value:"date"},{label:__("Page","jetpack"),value:"page"}]).concat(a?l:[]);let u=[];return n.major in widget_conditions_data&&(u=p(widget_conditions_data[n.major])),React.createElement("div",{className:"widget-vis__rule"},React.createElement("div",{className:"widget-vis__rule-major"},React.createElement("span",{className:"widget-vis__if"},_x("If","Widget Visibility: If {Rule Major [Page]} is {Rule Minor [Search results]}","jetpack")),React.createElement("div",{className:"widget-vis__select"},React.createElement(i.SelectControl,{label:__("Major Rule","jetpack"),hideLabelFromVision:!0,value:n.major,options:d,onChange:o}))),n.major&&React.createElement("div",{className:"widget-vis__rule-minor"},React.createElement("span",{className:"widget-vis__is"},_x("is","Widget Visibility: {Rule Major [Page]} is {Rule Minor [Search results]}","jetpack")),React.createElement("div",{className:"widget-vis__select"},React.createElement(i.SelectControl,{className:"widget-vis__select-multi-level",label:__("Minor Rule","jetpack"),hideLabelFromVision:!0,value:n.minor,options:u,onChange:r}))),React.createElement("div",{className:"widget-vis__delete-rule"},React.createElement(i.Button,{onClick:s,isSmall:!0,variant:"secondary"},_x("Remove","Delete this visibility rule","jetpack"))))},h=e=>({action:"show",rules:[],match_all:0,...e}),f=(0,s.createHigherOrderComponent)((n=>s=>{const{clientId:c,attributes:a,setAttributes:l,isSelected:d}=s,p=(0,r.useMemo)((()=>a.conditions||{}),[a]),f=(0,r.useMemo)((()=>p.rules||[]),[p]),{tracks:m}=(0,e.z$)(),C=(0,o.useSelect)((e=>{const{getBlockParents:t,getBlock:n}=e("core/block-editor"),i=t(c,!0),s=i?n(i[0]):void 0;return!s||s&&"core/widget-area"===s.name}),[c]),v=(0,r.useCallback)((()=>{m.recordEvent("jetpack_widget_visibility_toggle_match_all_click"),l({conditions:{...h(p),match_all:"0"===p.match_all?"1":"0"}})}),[m,l,p]),y=(0,r.useCallback)((e=>l({conditions:{...h(p),action:e}})),[l,p]),w=(0,r.useCallback)((()=>{const e=[...f,{major:"",minor:""}];m.recordEvent("jetpack_widget_visibility_add_new_rule_click"),l({conditions:{...h(p),rules:e}})}),[f,m,l,p]),k=(0,r.useCallback)((e=>{const t=[...f.slice(0,e),...f.slice(e+1)];m.recordEvent("jetpack_widget_visibility_delete_rule_click"),l({conditions:{...h(p),rules:t}})}),[f,m,l,p]),_=(0,r.useCallback)(((e,t)=>{m.recordEvent("jetpack_widget_visibility_set_major_rule_click");let n="";t in widget_conditions_data&&Array.isArray(widget_conditions_data[t])&&widget_conditions_data[t].length>0&&(n=widget_conditions_data[t][0][0]);const i=[...f.slice(0,e),{...f[e],major:t,minor:n},...f.slice(e+1)];l({conditions:{...h(p),rules:i}})}),[m,f,l,p]),S=(0,r.useCallback)(((e,t)=>{if(m.recordEvent("jetpack_widget_visibility_set_minor_rule_click"),t&&t.includes("__HEADER__"))return;const n=[...f.slice(0,e),{...f[e],minor:t},...f.slice(e+1)];l({conditions:{...h(p),rules:n}})}),[m,f,l,p]);let j=null;return j=0===f.length?React.createElement(i.BaseControl,{id:"widget-vis__wrapper",className:"widget-vis__wrapper",label:__("Visibility","jetpack"),help:__("No visibility rules yet. Add at least one rule to use this feature.","jetpack")},React.createElement(i.Button,{variant:"secondary",onClick:w,className:"widget-vis__add-new-rule"},__("Add new rule","jetpack"))):React.createElement(i.BaseControl,{className:"widget-vis__wrapper",id:"widget-vis__wrapper",label:__("Visibility","jetpack")},React.createElement(i.SelectControl,{className:"widget-vis__show-hide",label:__("Action","jetpack"),hideLabelFromVision:!0,value:a.conditions.action,options:[{label:__("Show this block","jetpack"),value:"show"},{label:__("Hide this block","jetpack"),value:"hide"}],onChange:y}),f.map(((e,t)=>React.createElement(g,{key:t,rule:e,i:t,onDelete:()=>k(t),setMajor:e=>_(t,e),setMinor:e=>S(t,e)}))),f.length>1&&React.createElement(i.ToggleControl,{className:"widget-vis__match-all",label:__("Match all rules","jetpack"),checked:"1"===p.match_all,onChange:v}),React.createElement(i.Button,{variant:"secondary",onClick:w},__("Add new rule","jetpack"))),React.createElement(r.Fragment,null,React.createElement(n,s),d&&C&&u(s.name)&&React.createElement(t.InspectorAdvancedControls,null,j),d&&!C&&u(s.name)&&React.createElement(t.InspectorAdvancedControls,null,React.createElement(i.BaseControl,{id:"widget-vis__wrapper",className:"widget-vis__wrapper",label:__("Visibility","jetpack"),help:__("Please select the top level block of this widget to apply visibility rules.","jetpack")})))}),"visibilityAdvancedControls");wp.hooks.addFilter("editor.BlockEdit","widget/visibility",f)})(),window.WidgetVisibility={}.WidgetVisibility})();
1 +(()=>{var e={745(){},997(e){var t=1e3,n=60*t,i=60*n,s=24*i,o=7*s,r=365.25*s;function c(e,t,n,i){var s=t>=1.5*n;return Math.round(e/n)+" "+i+(s?"s":"")}e.exports=function(e,a){a=a||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!c)return;var a=parseFloat(c[1]);switch((c[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*r;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*s;case"hours":case"hour":case"hrs":case"hr":case"h":return a*i;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===l&&isFinite(e))return a.long?function(e){var o=Math.abs(e);if(o>=s)return c(e,o,s,"day");if(o>=i)return c(e,o,i,"hour");if(o>=n)return c(e,o,n,"minute");if(o>=t)return c(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=s)return Math.round(e/s)+"d";if(o>=i)return Math.round(e/i)+"h";if(o>=n)return Math.round(e/n)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},372(e,t,n){"use strict";var i=n(67);const s=n.n(i)()("dops:analytics");let o,r;window._tkq=window._tkq||[],window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;const c={initialize:function(e,t,n){c.setUser(e,t),c.setSuperProps(n),c.identifyUser()},setGoogleAnalyticsEnabled:function(e,t=null){this.googleAnalyticsEnabled=e,this.googleAnalyticsKey=t},setMcAnalyticsEnabled:function(e){this.mcAnalyticsEnabled=e},setUser:function(e,t){r={ID:e,username:t}},setSuperProps:function(e){o=e},assignSuperProps:function(e){o=Object.assign(o||{},e)},mc:{bumpStat:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&x_"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);s("Bumping stats %o",e)}else n="&x_"+encodeURIComponent(e)+"="+encodeURIComponent(t),s('Bumping stat "%s" in group "%s"',t,e);return n}(e,t);c.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom-no-pv"+n+"&t="+Math.random())},bumpStatWithPageView:function(e,t){const n=function(e,t){let n="";if("object"==typeof e){for(const t in e)n+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);s("Built stats %o",e)}else n="&"+encodeURIComponent(e)+"="+encodeURIComponent(t),s('Built stat "%s" in group "%s"',t,e);return n}(e,t);c.mcAnalyticsEnabled&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?v=wpcom"+n+"&t="+Math.random())}},pageView:{record:function(e,t){c.tracks.recordPageView(e),c.ga.recordPageView(e,t)}},purchase:{record:function(e,t,n,i,s,o,r){c.ga.recordPurchase(e,t,n,i,s,o,r)}},tracks:{recordEvent:function(e,t){t=t||{},0===e.indexOf("akismet_")||0===e.indexOf("jetpack_")?(!t.blog_id&&"object"==typeof window.jpTracksContext&&window.jpTracksContext.blog_id&&(t.blog_id=window.jpTracksContext.blog_id),o&&(s("- Super Props: %o",o),t=Object.assign(t,o)),s('Record event "%s" called with props %s',e,JSON.stringify(t)),window._tkq.push(["recordEvent",e,t])):s('- Event name must be prefixed by "akismet_" or "jetpack_"')},recordJetpackClick:function(e){const t="object"==typeof e?e:{target:e};c.tracks.recordEvent("jetpack_wpa_click",t)},recordPageView:function(e){c.tracks.recordEvent("akismet_page_view",{path:e})},setOptOut:function(e){s("Pushing setOptOut: %o",e),window._tkq.push(["setOptOut",e])}},ga:{initialized:!1,initialize:function(){let e={};c.ga.initialized||(r&&(e={userId:"u-"+r.ID}),window.ga("create",this.googleAnalyticsKey,"auto",e),c.ga.initialized=!0)},recordPageView:function(e,t){c.ga.initialize(),s("Recording Page View ~ [URL: "+e+"] [Title: "+t+"]"),this.googleAnalyticsEnabled&&(window.ga("set","page",e),window.ga("send",{hitType:"pageview",page:e,title:t}))},recordEvent:function(e,t,n,i){c.ga.initialize();let o="Recording Event ~ [Category: "+e+"] [Action: "+t+"]";void 0!==n&&(o+=" [Option Label: "+n+"]"),void 0!==i&&(o+=" [Option Value: "+i+"]"),s(o),this.googleAnalyticsEnabled&&window.ga("send","event",e,t,n,i)},recordPurchase:function(e,t,n,i,s,o,r){window.ga("require","ecommerce"),window.ga("ecommerce:addTransaction",{id:e,revenue:i,currency:r}),window.ga("ecommerce:addItem",{id:e,name:t,sku:n,price:s,quantity:o}),window.ga("ecommerce:send")}},identifyUser:function(){r&&window._tkq.push(["identifyUser",r.ID,r.username])},setProperties:function(e){window._tkq.push(["setProperties",e])},clearedIdentity:function(){window._tkq.push(["clearIdentity"])}},a=c;n.d(t,["A",0,a])},932(e,t,n){"use strict";var i=n(439),s=n(832);function o(e){class t extends Error{constructor(...t){super(...t),this.name=e}}return t}const r=o("JsonParseError"),c=o("JsonParseAfterRedirectError"),a=o("Api404Error"),l=o("Api404AfterRedirectError"),u=o("FetchNetworkError");const d=new function(e,t){let n=e,o=e,r={"X-WP-Nonce":t},c={credentials:"same-origin",headers:r},a={method:"post",credentials:"same-origin",headers:Object.assign({},r,{"Content-type":"application/json"})},l=function(e){const t=e.split("?"),n=t.length>1?t[1]:"",i=n.length?n.split("&"):[];return i.push("_cacheBuster="+(new Date).getTime()),t[0]+"?"+i.join("&")};const u={setApiRoot(e){n=e},setWpcomOriginApiUrl(e){o=e},setApiNonce(e){r={"X-WP-Nonce":e},c={credentials:"same-origin",headers:r},a={method:"post",credentials:"same-origin",headers:Object.assign({},r,{"Content-type":"application/json"})}},setCacheBusterCallback:e=>{l=e},registerSite:(e,t,s)=>{const o={};return(0,i.R)("consumer_slug")&&(o.plugin_slug=(0,i.B)("consumer_slug")),null!==t&&(o.redirect_uri=t),s&&(o.from=s),h(`${n}jetpack/v4/connection/register`,a,{body:JSON.stringify(o)}).then(g).then(p)},fetchAuthorizationUrl:e=>d((0,s.addQueryArgs)(`${n}jetpack/v4/connection/authorize_url`,{no_iframe:"1",redirect_uri:e}),c).then(g).then(p),fetchSiteConnectionData:()=>d(`${n}jetpack/v4/connection/data`,c).then(p),fetchSiteConnectionStatus:()=>d(`${n}jetpack/v4/connection`,c).then(p),fetchSiteConnectionTest:()=>d(`${n}jetpack/v4/connection/test`,c).then(g).then(p),fetchUserConnectionData:()=>d(`${n}jetpack/v4/connection/data`,c).then(p),fetchUserTrackingSettings:()=>d(`${n}jetpack/v4/tracking/settings`,c).then(g).then(p),updateUserTrackingSettings:e=>h(`${n}jetpack/v4/tracking/settings`,a,{body:JSON.stringify(e)}).then(g).then(p),disconnectSite:()=>h(`${n}jetpack/v4/connection`,a,{body:JSON.stringify({isActive:!1})}).then(g).then(p),fetchConnectUrl:()=>d(`${n}jetpack/v4/connection/url`,c).then(g).then(p),unlinkUser:(e=!1,t={})=>{const i={linked:!1,force:!!e};return t.disconnectAllUsers&&(i["disconnect-all-users"]=!0),h(`${n}jetpack/v4/connection/user`,a,{body:JSON.stringify(i)}).then(g).then(p)},reconnect:()=>h(`${n}jetpack/v4/connection/reconnect`,a).then(g).then(p),fetchConnectedPlugins:()=>d(`${n}jetpack/v4/connection/plugins`,c).then(g).then(p),fetchModules:()=>d(`${n}jetpack/v4/module/all`,c).then(g).then(p),fetchModule:e=>d(`${n}jetpack/v4/module/${e}`,c).then(g).then(p),activateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,a,{body:JSON.stringify({active:!0})}).then(g).then(p),deactivateModule:e=>h(`${n}jetpack/v4/module/${e}/active`,a,{body:JSON.stringify({active:!1})}),updateModuleOptions:(e,t)=>h(`${n}jetpack/v4/module/${e}`,a,{body:JSON.stringify(t)}).then(g).then(p),updateSettings:e=>h(`${n}jetpack/v4/settings`,a,{body:JSON.stringify(e)}).then(g).then(p),getProtectCount:()=>d(`${n}jetpack/v4/module/protect/data`,c).then(g).then(p),resetOptions:e=>h(`${n}jetpack/v4/options/${e}`,a,{body:JSON.stringify({reset:!0})}).then(g).then(p),activateVaultPress:()=>h(`${n}jetpack/v4/plugins`,a,{body:JSON.stringify({slug:"vaultpress",status:"active"})}).then(g).then(p),getVaultPressData:()=>d(`${n}jetpack/v4/module/vaultpress/data`,c).then(g).then(p),installPlugin:(e,t)=>{const i={slug:e,status:"active"};return t&&(i.source=t),h(`${n}jetpack/v4/plugins`,a,{body:JSON.stringify(i)}).then(g).then(p)},activateAkismet:()=>h(`${n}jetpack/v4/plugins`,a,{body:JSON.stringify({slug:"akismet",status:"active"})}).then(g).then(p),getAkismetData:()=>d(`${n}jetpack/v4/module/akismet/data`,c).then(g).then(p),checkAkismetKey:()=>d(`${n}jetpack/v4/module/akismet/key/check`,c).then(g).then(p),checkAkismetKeyTyped:e=>h(`${n}jetpack/v4/module/akismet/key/check`,a,{body:JSON.stringify({api_key:e})}).then(g).then(p),getFeatureTypeStatus:e=>d(`${n}jetpack/v4/feature/${e}`,c).then(g).then(p),fetchStatsData:e=>d(function(e){let t=`${n}jetpack/v4/module/stats/data`;-1!==t.indexOf("?")?t+=`&range=${encodeURIComponent(e)}`:t+=`?range=${encodeURIComponent(e)}`;return t}(e),c).then(g).then(p).then(m),getPluginUpdates:()=>d(`${n}jetpack/v4/updates/plugins`,c).then(g).then(p),getPlans:()=>d(`${n}jetpack/v4/plans`,c).then(g).then(p),fetchSettings:()=>d(`${n}jetpack/v4/settings`,c).then(g).then(p),updateSetting:e=>h(`${n}jetpack/v4/settings`,a,{body:JSON.stringify(e)}).then(g).then(p),fetchSiteData:()=>d(`${n}jetpack/v4/site`,c).then(g).then(p).then(e=>JSON.parse(e.data)),fetchSiteFeatures:()=>d(`${n}jetpack/v4/site/features`,c).then(g).then(p).then(e=>JSON.parse(e.data)),fetchSitePurchases:()=>d(`${n}jetpack/v4/site/purchases`,c).then(g).then(p).then(e=>JSON.parse(e.data)),fetchSiteBenefits:()=>d(`${n}jetpack/v4/site/benefits`,c).then(g).then(p).then(e=>JSON.parse(e.data)),fetchSetupQuestionnaire:()=>d(`${n}jetpack/v4/setup/questionnaire`,c).then(g).then(p),fetchRewindStatus:()=>d(`${n}jetpack/v4/rewind`,c).then(g).then(p).then(e=>JSON.parse(e.data)),fetchScanStatus:()=>d(`${n}jetpack/v4/scan`,c).then(g).then(p).then(e=>JSON.parse(e.data)),dismissJetpackNotice:e=>h(`${n}jetpack/v4/notice/${e}`,a,{body:JSON.stringify({dismissed:!0})}).then(g).then(p),fetchPluginsData:()=>d(`${n}jetpack/v4/plugins`,c).then(g).then(p),fetchVerifySiteGoogleStatus:e=>d(null!==e?`${n}jetpack/v4/verify-site/google/${e}`:`${n}jetpack/v4/verify-site/google`,c).then(g).then(p),verifySiteGoogle:e=>h(`${n}jetpack/v4/verify-site/google`,a,{body:JSON.stringify({keyring_id:e})}).then(g).then(p),submitSurvey:e=>h(`${n}jetpack/v4/marketing/survey`,a,{body:JSON.stringify(e)}).then(g).then(p),saveSetupQuestionnaire:e=>h(`${n}jetpack/v4/setup/questionnaire`,a,{body:JSON.stringify(e)}).then(g).then(p),updateLicensingError:e=>h(`${n}jetpack/v4/licensing/error`,a,{body:JSON.stringify(e)}).then(g).then(p),updateLicenseKey:e=>h(`${n}jetpack/v4/licensing/set-license`,a,{body:JSON.stringify({license:e})}).then(g).then(p),getUserLicensesCounts:()=>d(`${n}jetpack/v4/licensing/user/counts`,c).then(g).then(p),getUserLicenses:()=>d(`${n}jetpack/v4/licensing/user/licenses`,c).then(g).then(p),updateLicensingActivationNoticeDismiss:e=>h(`${n}jetpack/v4/licensing/user/activation-notice-dismiss`,a,{body:JSON.stringify({last_detached_count:e})}).then(g).then(p),confirmIDCSafeMode:()=>h(`${n}jetpack/v4/identity-crisis/confirm-safe-mode`,a).then(g),startIDCFresh:e=>h(`${n}jetpack/v4/identity-crisis/start-fresh`,a,{body:JSON.stringify({redirect_uri:e})}).then(g).then(p),migrateIDC:()=>h(`${n}jetpack/v4/identity-crisis/migrate`,a).then(g),attachLicenses:e=>h(`${n}jetpack/v4/licensing/attach-licenses`,a,{body:JSON.stringify({licenses:e})}).then(g).then(p),fetchSearchPlanInfo:()=>d(`${o}jetpack/v4/search/plan`,c).then(g).then(p),activateSearchFreeProduct:e=>h(`${o}jetpack/v4/search/plan/activate-free`,a,{body:JSON.stringify(e?{source:e}:{})}).then(g).then(p),fetchSearchSettings:()=>d(`${o}jetpack/v4/search/settings`,c).then(g).then(p),updateSearchSettings:e=>h(`${o}jetpack/v4/search/settings`,a,{body:JSON.stringify(e)}).then(g).then(p),fetchSearchStats:()=>d(`${o}jetpack/v4/search/stats`,c).then(g).then(p),fetchWafSettings:()=>d(`${n}jetpack/v4/waf`,c).then(g).then(p),updateWafSettings:e=>h(`${n}jetpack/v4/waf`,a,{body:JSON.stringify(e)}).then(g).then(p),fetchWordAdsSettings:()=>d(`${n}jetpack/v4/wordads/settings`,c).then(g).then(p),updateWordAdsSettings:e=>h(`${n}jetpack/v4/wordads/settings`,a,{body:JSON.stringify(e)}),fetchSearchPricing:()=>d(`${o}jetpack/v4/search/pricing`,c).then(g).then(p),fetchMigrationStatus:()=>d(`${n}jetpack/v4/migration/status`,c).then(g).then(p),fetchBackupUndoEvent:()=>d(`${n}jetpack/v4/site/backup/undo-event`,c).then(g).then(p),fetchBackupPreflightStatus:()=>d(`${n}jetpack/v4/site/backup/preflight`,c).then(g).then(p)};function d(e,t){return fetch(l(e),t)}function h(e,t,n){return fetch(e,Object.assign({},t,n)).catch(f)}function m(e){return e.general&&void 0===e.general.response||e.week&&void 0===e.week.response||e.month&&void 0===e.month.response?e:{}}Object.assign(this,u)};function g(e){return e.status>=200&&e.status<300?e:404===e.status?new Promise(()=>{throw e.redirected?new l(e.redirected):new a}):e.json().catch(e=>h(e)).then(t=>{const n=new Error(`${t.message} (Status ${e.status})`);throw n.response=t,n.name="ApiError",n})}function p(e){return e.json().catch(t=>h(t,e.redirected,e.url))}function h(e,t,n){throw t?new c(n):new r}function f(){throw new u}n.d(t,["Ay",0,d])},439(e,t,n){let i={};try{i=n(277)}catch{globalThis.jetpackConfig?i=globalThis.jetpackConfig:(console.error("jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"),i={missingConfig:!0})}const s=e=>Object.hasOwn(i,e);e.exports={R:s,B:e=>{if(!s(e))throw'This app requires the "'+e+'" Jetpack Config to be defined in your webpack configuration file. See details in @automattic/jetpack-config package docs.';return i[e]}}},882(e,t,n){"use strict";n.d(t,{A:()=>u});var i=n(932),s=n(999),o=n(143),r=n(609),c=n(293);const a={},l=window?.JP_CONNECTION_INITIAL_STATE||(0,s.getScriptData)()?.connection||{};function u({registrationNonce:e=l.registrationNonce,apiRoot:t=l.apiRoot,apiNonce:n=l.apiNonce,redirectUri:s,autoTrigger:u,from:d,skipUserConnection:g,skipPricingPage:p}={}){const{registerSite:h,connectUser:f,refreshConnectedPlugins:m}=(0,o.useDispatch)(c.a),C=(0,o.useSelect)(e=>e(c.a).getRegistrationError(),[]),{siteIsRegistering:w,userIsConnecting:y,userConnectionData:v,connectedPlugins:k,connectionOwner:_,connectionErrors:j,isRegistered:b,isUserConnected:S,hasConnectedOwner:O,isOfflineMode:A}=(0,o.useSelect)(e=>{const t=e(c.a).getConnectionStatus(),n=e(c.a).getConnectionOwner?.();return{siteIsRegistering:e(c.a).getSiteIsRegistering(),userIsConnecting:e(c.a).getUserIsConnecting(),userConnectionData:e(c.a).getUserConnectionData()||a,connectedPlugins:e(c.a).getConnectedPlugins(),connectionOwner:(i=n,i&&"object"==typeof i&&"id"in i&&"number"==typeof i.id&&"displayName"in i&&"string"==typeof i.displayName?n:null),connectionErrors:e(c.a).getConnectionErrors(),isOfflineMode:e(c.a).getIsOfflineMode(),isRegistered:t.isRegistered??!1,isUserConnected:t.isUserConnected??!1,hasConnectedOwner:t.hasConnectedOwner??!1};var i},[]),N=()=>g?s?(window.location.href=s,Promise.resolve(s)):Promise.resolve():f({from:d,redirectUri:s,skipPricingPage:p}),E=t=>(t&&t.preventDefault(),b?N():h({registrationNonce:e,redirectUri:s,from:d}).then(()=>N()));return(0,r.useEffect)(()=>{i.Ay.setApiRoot(t),i.Ay.setApiNonce(n)},[t,n]),(0,r.useEffect)(()=>{!u||w||y||E()},[]),{handleRegisterSite:E,handleConnectUser:N,refreshConnectedPlugins:m,isRegistered:b,isUserConnected:S,siteIsRegistering:w,userIsConnecting:y,registrationError:C,userConnectionData:v,connectionOwner:_,hasConnectedOwner:O,connectedPlugins:k,connectionErrors:j,isOfflineMode:A}}},935(e,t,n){"use strict";var i=n(932);const s="SET_CONNECTION_STATUS",o="SET_CONNECTION_STATUS_IS_FETCHING",r="SET_SITE_IS_REGISTERING",c="SET_USER_IS_CONNECTING",a="SET_REGISTRATION_ERROR",l="CLEAR_REGISTRATION_ERROR",u="SET_AUTHORIZATION_URL",d="DISCONNECT_USER_SUCCESS",g="SET_CONNECTED_PLUGINS",p="SET_CONNECTION_ERRORS",h="SET_IS_OFFLINE_MODE",f=e=>({type:s,connectionStatus:e}),m=e=>({type:r,isRegistering:e}),C=e=>({type:c,isConnecting:e}),w=e=>({type:a,registrationError:e}),y=()=>({type:l}),v=e=>({type:u,authorizationUrl:e}),k=e=>({type:g,connectedPlugins:e});const _={setConnectionStatus:f,setConnectionStatusIsFetching:e=>({type:o,isFetching:e}),fetchConnectionStatus:()=>({type:"FETCH_CONNECTION_STATUS"}),fetchAuthorizationUrl:e=>({type:"FETCH_AUTHORIZATION_URL",redirectUri:e}),setSiteIsRegistering:m,setUserIsConnecting:C,setRegistrationError:w,clearRegistrationError:y,setAuthorizationUrl:v,registerSite:function*({registrationNonce:e,redirectUri:t,from:n=""}){yield y(),yield m(!0);try{const i=yield{type:"REGISTER_SITE",registrationNonce:e,redirectUri:t,from:n};return yield f({isRegistered:!0}),yield v(i.authorizeUrl),yield m(!1),Promise.resolve(i)}catch(e){return yield w(e),yield m(!1),Promise.reject(e)}},connectUser:function*({from:e,redirectFunc:t,redirectUri:n,skipPricingPage:i}={}){yield C(!0),yield{type:"CONNECT_USER",from:e,redirectFunc:t,redirectUri:n,skipPricingPage:i}},disconnectUserSuccess:()=>({type:d}),setConnectedPlugins:k,refreshConnectedPlugins:()=>async({dispatch:e})=>await new Promise(t=>i.Ay.fetchConnectedPlugins().then(n=>{e(k(n)),t(n)})),setConnectionErrors:e=>({type:p,connectionErrors:e}),runConnectionHealthCheck:()=>async()=>({}),setIsOfflineMode:e=>({type:h,isOfflineMode:e})};n.d(t,["A1",0,a,"Ay",0,_,"DO",0,c,"Ij",0,r,"Kl",0,p,"LW",0,l,"MU",0,h,"XY",0,u,"ZO",0,o,"dz",0,d,"gH",0,g,"v_",0,s])},938(e,t,n){"use strict";function i(e){return window.location.assign(e)}n.d(t,{d:()=>i})},494(e,t,n){"use strict";var i=n(932),s=n(143),o=n(938),r=n(660);const c={FETCH_AUTHORIZATION_URL:({redirectUri:e})=>i.Ay.fetchAuthorizationUrl(e),REGISTER_SITE:({redirectUri:e,from:t})=>i.Ay.registerSite(null,e,t),CONNECT_USER:(0,s.createRegistryControl)(({resolveSelect:e})=>({from:t,redirectFunc:n,redirectUri:i,skipPricingPage:s}={})=>new Promise((c,a)=>{e(r.A).getAuthorizationUrl(i).then(e=>{const i=n||(e=>(0,o.d)(e)),r=new URL(e);s&&r.searchParams.set("skip_pricing","true"),t&&r.searchParams.set("from",encodeURIComponent(t));const a=r.toString();i(a),c(a)}).catch(e=>{a(e)})}))};n.d(t,["A",0,c])},51(e,t,n){"use strict";var i=n(143),s=n(935);const o=(0,i.combineReducers)({connectionStatus:(e={},t)=>{switch(t.type){case s.v_:return{...e,...t.connectionStatus};case s.dz:return{...e,isUserConnected:!1}}return e},connectionStatusIsFetching:(e=!1,t)=>t.type===s.ZO?t.isFetching:e,siteIsRegistering:(e=!1,t)=>t.type===s.Ij?t.isRegistering:e,userIsConnecting:(e=!1,t)=>t.type===s.DO?t.isConnecting:e,registrationError:(e,t)=>{switch(t.type){case s.LW:return!1;case s.A1:return t.registrationError;default:return e}},authorizationUrl:(e,t)=>t.type===s.XY?t.authorizationUrl:e,userConnectionData:(e,t)=>(t.type,e),connectedPlugins:(e={},t)=>t.type===s.gH?t.connectedPlugins:e,connectionOwner:(e=null,t)=>(t.type,e),hasProtectedOwner:(e=null)=>e,requiresProtectedOwner:(e=null)=>e,useDefaultProtectedOwnerUi:(e=null)=>e,connectionErrors:(e={},t)=>t.type===s.Kl?t.connectionErrors:e,isOfflineMode:(e=!1,t)=>t.type===s.MU?t.isConnecting:e});n.d(t,["A",0,o])},19(e,t,n){"use strict";var i=n(143),s=n(935),o=n(660);const r={...{getAuthorizationUrl:{isFulfilled:(e,...t)=>{const n=Boolean(e.authorizationUrl),s=(0,i.select)(o.A).hasFinishedResolution("getAuthorizationUrl",t);return n&&!s&&(0,i.dispatch)(o.A).finishResolution("getAuthorizationUrl",t),n},*fulfill(e){const t=yield s.Ay.fetchAuthorizationUrl(e);yield s.Ay.setAuthorizationUrl(t.authorizeUrl)}}}};n.d(t,["A",0,r])},676(e,t,n){"use strict";const i={...{getConnectionStatus:e=>e.connectionStatus||{},getConnectionStatusIsFetching:()=>!1,getSiteIsRegistering:e=>e.siteIsRegistering||!1,getUserIsConnecting:e=>e.userIsConnecting||!1,getRegistrationError:e=>e.registrationError||!1,getAuthorizationUrl:e=>e.authorizationUrl||!1,getUserConnectionData:e=>e.userConnectionData||!1,getConnectedPlugins:e=>e.connectedPlugins||[],getConnectionOwner:e=>e.connectionOwner||null,getConnectionErrors:e=>e.connectionErrors||[],getIsOfflineMode:e=>e.isOfflineMode||!1,getHasProtectedOwner:e=>e.hasProtectedOwner??null,getRequiresProtectedOwner:e=>e.requiresProtectedOwner??null,getUseDefaultProtectedOwnerUi:e=>e.useDefaultProtectedOwnerUi??null,getWpcomUser:e=>e?.userConnectionData?.currentUser?.wpcomUser,getBlogId:e=>e?.userConnectionData?.currentUser?.blogId}};n.d(t,["A",0,i])},734(e,t,n){"use strict";var i=n(143);class s{static store=null;static mayBeInit(e,t){if(null===s.store){if((0,i.select)(e))return console.error(function(e){return[`Jetpack Connection: the "${e}" store was already registered by another script on this page, so this copy was skipped.`,"","Nothing is broken — the first registration is used — but two scripts on this page have each bundled their own copy of @automattic/jetpack-connection, so the package ships to visitors more than once.","","The usual cause is a subpath import. The webpack externals map matches the package root only, so:"," import { useConnection } from '@automattic/jetpack-connection'; // shared, loaded once"," import useConnection from '@automattic/jetpack-connection/use-connection'; // bundled into this script","","To fix: import from the package root, then rebuild. If the symbol is not exported there, add it to the package index rather than reaching for the subpath.","See defaultRequestMap in js-packages/webpack-config/src/webpack.js for the mapping."].join("\n")}(e)),void(s.store=(0,i.createReduxStore)(e,t));s.store=(0,i.createReduxStore)(e,t),(0,i.register)(s.store)}}}const o=s;n.d(t,["A",0,o])},660(e,t,n){"use strict";n.d(t,["A",0,"jetpack-connection"])},293(e,t,n){"use strict";n.d(t,{a:()=>u.A});var i=n(999),s=n(935),o=n(494),r=n(51),c=n(19),a=n(676),l=n(734),u=n(660);const d=window.JP_CONNECTION_INITIAL_STATE||(0,i.getScriptData)()?.connection;d||console.error("Jetpack Connection package: Initial state is missing. Check documentation to see how to use the Connection composer package to set up the initial state."),l.A.mayBeInit(u.A,{__experimentalUseThunks:!0,reducer:r.A,actions:s.Ay,selectors:a.A,resolvers:c.A,controls:o.A,initialState:d||{}})},985(e,t,n){"use strict";n.d(t,{st:()=>i.A});n(815),n(409),n(34),n(595),n(265);var i=n(489);n(581),n(406),n(923),n(335),n(687),n(61),n(929),n(765)},765(e,t,n){"use strict";n(490)},335(e,t,n){"use strict";n(87)},815(e,t,n){"use strict";n(999)},489(e,t,n){"use strict";var i=n(372),s=n(882),o=n(87);const{tracks:r}=i.A,{recordEvent:c}=r,a=({pageViewEventName:e=null,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:a={}}={})=>{const[l,u]=(0,o.useState)(!1),{isUserConnected:d,isRegistered:g,userConnectionData:p={}}=(0,s.A)(),{wpcomUser:{login:h,ID:f}={},blogId:m}=p.currentUser||{},C=(0,o.useCallback)(async(e,t={})=>{d&&f&&h&&c(e,t)},[d,f,h]);return(0,o.useEffect)(()=>{d&&f&&h&&m&&i.A.initialize(f,h,{blog_id:m})},[m,f,h,d]),(0,o.useEffect)(()=>{const i=e?`${t}_${e}_${n}`:null;g&&i&&(l||(C(i,a),u(!0)))},[l,t,e,n,g,a,C]),{recordEvent:C,tracks:r}};n.d(t,["A",0,a])},581(e,t,n){"use strict";n(143),n(87)},923(e,t,n){"use strict";n(687),n(143),n(87)},406(e,t,n){"use strict";n(87)},929(e,t,n){"use strict";n(143),n(619),n(265),n(581)},520(e,t,n){"use strict";n(999);var i=n(67),s=n.n(i);window,s()("shared-extension-utils:connection")},61(e,t,n){"use strict";n(520)},265(e,t,n){"use strict";n(999);var i=n(723);n(832),n(815);const __=i.__;__("Upgrade your plan to use video covers","jetpack"),__("Upgrade your plan to upload audio","jetpack")},34(e,t,n){"use strict";n(279)},409(e,t,n){"use strict";n(999)},595(e,t,n){"use strict";n(491),n(745),n(790)},67(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let i=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(i++,"%c"===e&&(s=i))}),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(926)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},926(e,t,n){e.exports=function(e){function t(e){let n,s,o,r=null;function c(...e){if(!c.enabled)return;const i=c,s=Number(new Date),o=s-(n||s);i.diff=o,i.prev=n,i.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,s)=>{if("%%"===n)return"%";r++;const o=t.formatters[s];if("function"==typeof o){const t=e[r];n=o.call(i,t),e.splice(r,1),r--}return n}),t.formatArgs.call(i,e);(i.log||t.log).apply(i,e)}return c.namespace=e,c.useColors=t.useColors(),c.color=t.selectColor(e),c.extend=i,c.destroy=t.destroy,Object.defineProperty(c,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{r=e}}),"function"==typeof t.init&&t.init(c),c}function i(e,n){const i=t(this.namespace+(void 0===n?":":n)+e);return i.log=this.log,i}function s(e,t){let n=0,i=0,s=-1,o=0;for(;n<e.length;)if(i<t.length&&(t[i]===e[n]||"*"===t[i]))"*"===t[i]?(s=i,o=n,i++):(n++,i++);else{if(-1===s)return!1;i=s+1,o++,n=o}for(;i<t.length&&"*"===t[i];)i++;return i===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(s(e,n))return!1;for(const n of t.names)if(s(e,n))return!0;return!1},t.humanize=n(997),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},277(e){"use strict";e.exports={consumer_slug:"jetpack"}},999(e){"use strict";e.exports=window.JetpackScriptDataModule},687(e){"use strict";e.exports=window.JetpackSharedStores},609(e){"use strict";e.exports=window.React},790(e){"use strict";e.exports=window.ReactJSXRuntime},715(e){"use strict";e.exports=window.wp.blockEditor},427(e){"use strict";e.exports=window.wp.components},491(e){"use strict";e.exports=window.wp.compose},143(e){"use strict";e.exports=window.wp.data},490(e){"use strict";e.exports=window.wp.domReady},87(e){"use strict";e.exports=window.wp.element},619(e){"use strict";e.exports=window.wp.hooks},723(e){"use strict";e.exports=window.wp.i18n},279(e){"use strict";e.exports=window.wp.plugins},832(e){"use strict";e.exports=window.wp.url}};const t={};function n(i){const s=t[i];if(void 0!==s)return s.exports;const o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var s=t[i++],o=t[i++],r=0===o?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:o};n.o(e,s)||Object.defineProperty(e,s,r)}else for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.hasOwn(e,t);(()=>{"use strict";var e=n(999),t=n(985),i=n(715),s=n(427),o=n(491),r=n(143),c=n(87),a=n(619),l=n(723),u=n(790);const __=l.__,_x=l._x,d={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&nbsp;":" "},g=/&(?:amp|lt|gt|quot|#39|nbsp);/g,p=e=>{if("string"!=typeof e)return e;return e.replace(g,e=>d[e])},h=e=>!new Set(["core/legacy-widget","core/widget-area"]).has(e);(0,a.addFilter)("blocks.registerBlockType","widget/visibility",function(e,t){return h(t)&&void 0!==e.attributes&&(e.attributes=Object.assign(e.attributes,{conditions:{type:"object",default:{}}})),e});const f=(e,t=0)=>e.reduce((e,n)=>{const[i,s]=n,o=" ".repeat(3*t);if(Array.isArray(s)){const n={label:p(o+i),value:i,disabled:!0},r=f(s,t+1);return e.concat([n]).concat(r)}const r={label:p(o+s),value:i};return e.concat([r])},[]),m=t=>{const{rule:n,onDelete:i,setMajor:o,setMinor:r}=t,c=[{label:__("User","jetpack"),value:"loggedin"},{label:__("Role","jetpack"),value:"role"}],a=widget_conditions_data.taxonomy&&widget_conditions_data.taxonomy.length>1||"taxonomy"===n.major,l=[{label:__("Taxonomy","jetpack"),value:"taxonomy"}],d=[{label:__("-- Select --","jetpack"),value:""},{label:__("Category","jetpack"),value:"category"},{label:__("Author","jetpack"),value:"author"}].concat((0,e.isSimpleSite)()?[]:c).concat([{label:__("Tag","jetpack"),value:"tag"},{label:__("Date","jetpack"),value:"date"},{label:__("Page","jetpack"),value:"page"}]).concat(a?l:[]);let g=[];return n.major in widget_conditions_data&&(g=f(widget_conditions_data[n.major])),(0,u.jsxs)("div",{className:"widget-vis__rule",children:[(0,u.jsxs)("div",{className:"widget-vis__rule-major",children:[(0,u.jsx)("span",{className:"widget-vis__if",children:_x("If","Widget Visibility: If {Rule Major [Page]} is {Rule Minor [Search results]}","jetpack")}),(0,u.jsx)("div",{className:"widget-vis__select",children:(0,u.jsx)(s.SelectControl,{label:__("Major Rule","jetpack"),hideLabelFromVision:!0,value:n.major,options:d,onChange:o,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})})]}),n.major&&(0,u.jsxs)("div",{className:"widget-vis__rule-minor",children:[(0,u.jsx)("span",{className:"widget-vis__is",children:_x("is","Widget Visibility: {Rule Major [Page]} is {Rule Minor [Search results]}","jetpack")}),(0,u.jsx)("div",{className:"widget-vis__select",children:(0,u.jsx)(s.SelectControl,{className:"widget-vis__select-multi-level",label:__("Minor Rule","jetpack"),hideLabelFromVision:!0,value:n.minor,options:g,onChange:r,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})})]}),(0,u.jsx)("div",{className:"widget-vis__delete-rule",children:(0,u.jsx)(s.Button,{onClick:i,isSmall:!0,variant:"secondary",children:_x("Remove","Delete this visibility rule","jetpack")})})]})},C=e=>({action:"show",rules:[],match_all:0,...e}),w=(0,o.createHigherOrderComponent)(e=>n=>{const{clientId:o,attributes:a,setAttributes:l,isSelected:d}=n,g=(0,c.useMemo)(()=>a.conditions||{},[a]),p=(0,c.useMemo)(()=>g.rules||[],[g]),{tracks:f}=(0,t.st)(),w=(0,r.useSelect)(e=>{const{getBlockParents:t,getBlock:n}=e("core/block-editor"),i=t(o,!0),s=i?n(i[0]):void 0;return!s||s&&"core/widget-area"===s.name},[o]),y=(0,c.useCallback)(()=>{f.recordEvent("jetpack_widget_visibility_toggle_match_all_click"),l({conditions:{...C(g),match_all:"0"===g.match_all?"1":"0"}})},[f,l,g]),v=(0,c.useCallback)(e=>l({conditions:{...C(g),action:e}}),[l,g]),k=(0,c.useCallback)(()=>{const e=[...p,{major:"",minor:""}];f.recordEvent("jetpack_widget_visibility_add_new_rule_click"),l({conditions:{...C(g),rules:e}})},[p,f,l,g]),_=(0,c.useCallback)(e=>{const t=[...p.slice(0,e),...p.slice(e+1)];f.recordEvent("jetpack_widget_visibility_delete_rule_click"),l({conditions:{...C(g),rules:t}})},[p,f,l,g]),j=(0,c.useCallback)((e,t)=>{f.recordEvent("jetpack_widget_visibility_set_major_rule_click");let n="";t in widget_conditions_data&&Array.isArray(widget_conditions_data[t])&&widget_conditions_data[t].length>0&&(n=widget_conditions_data[t][0][0]);const i=[...p.slice(0,e),{...p[e],major:t,minor:n},...p.slice(e+1)];l({conditions:{...C(g),rules:i}})},[f,p,l,g]),b=(0,c.useCallback)((e,t)=>{if(f.recordEvent("jetpack_widget_visibility_set_minor_rule_click"),t&&t.includes("__HEADER__"))return;const n=[...p.slice(0,e),{...p[e],minor:t},...p.slice(e+1)];l({conditions:{...C(g),rules:n}})},[f,p,l,g]);let S;return S=0===p.length?(0,u.jsx)(s.BaseControl,{id:"widget-vis__wrapper",className:"widget-vis__wrapper",label:__("Visibility","jetpack"),help:__("No visibility rules yet. Add at least one rule to use this feature.","jetpack"),__nextHasNoMarginBottom:!0,children:(0,u.jsx)(s.Button,{variant:"secondary",onClick:k,className:"widget-vis__add-new-rule",children:__("Add new rule","jetpack")})}):(0,u.jsxs)(s.BaseControl,{className:"widget-vis__wrapper",id:"widget-vis__wrapper",label:__("Visibility","jetpack"),__nextHasNoMarginBottom:!0,children:[(0,u.jsx)(s.SelectControl,{className:"widget-vis__show-hide",label:__("Action","jetpack"),hideLabelFromVision:!0,value:a.conditions.action,options:[{label:__("Show this block","jetpack"),value:"show"},{label:__("Hide this block","jetpack"),value:"hide"}],onChange:v,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),p.map((e,t)=>(0,u.jsx)(m,{rule:e,i:t,onDelete:()=>_(t),setMajor:e=>j(t,e),setMinor:e=>b(t,e)},t)),p.length>1&&(0,u.jsx)(s.ToggleControl,{className:"widget-vis__match-all",label:__("Match all rules","jetpack"),checked:"1"===g.match_all,onChange:y,__nextHasNoMarginBottom:!0}),(0,u.jsx)(s.Button,{variant:"secondary",onClick:k,children:__("Add new rule","jetpack")})]}),(0,u.jsxs)(c.Fragment,{children:[(0,u.jsx)(e,{...n}),d&&w&&h(n.name)&&(0,u.jsx)(i.InspectorAdvancedControls,{children:S}),d&&!w&&h(n.name)&&(0,u.jsx)(i.InspectorAdvancedControls,{children:(0,u.jsx)(s.BaseControl,{id:"widget-vis__wrapper",className:"widget-vis__wrapper",label:__("Visibility","jetpack"),help:__("Please select the top level block of this widget to apply visibility rules.","jetpack"),__nextHasNoMarginBottom:!0})})]})},"visibilityAdvancedControls");(0,a.addFilter)("editor.BlockEdit","widget/visibility",w)})(),window.WidgetVisibility={}.WidgetVisibility})();