!function(){var e={4184:function(e,t){var n;!function(){"use strict";var a={}.hasOwnProperty;function r(){for(var e=[],t=0;t0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=rankMath.links[e]||"";if(!n)return"#";if(!t)return n;var a={utm_source:"Plugin",utm_medium:encodeURIComponent(t),utm_campaign:"WP"};return n+"?"+Object.keys(a).map((function(e){return"".concat(e,"=").concat(a[e])})).join("&")}var h=lodash,y=n(4184),v=n.n(y),w=wp.htmlEntities,E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e=-1===e.toString().indexOf(".")?e:e.toFixed(t)).toString().replace(".00","")},b=function(e){e=parseFloat(e);var t=0,n=["K","M","B","T","Q"],a=Math.abs(e);if((e=E(a))<1e3)return e;for(;e>=1e3&&++t0||o&&i,down:!o&&i||o&&!i&&r>0});return wp.element.createElement("div",{className:"rank-math-item-numbers"},wp.element.createElement("strong",{className:"text-large",title:(0,h.round)(n,2)},b(n)),wp.element.createElement("span",{className:s,title:(0,h.round)(r,2)},b(r)))},k=wp.components;(0,k.withFilters)("rankMath.analytics.keywordAddRemoveButton")((function(e){var t=e.sequence;return wp.element.createElement(p.Fragment,null,t,wp.element.createElement(k.Button,{className:"button button-secondary button-small add-keyword",href:f("pro","Add KW Button"),target:"_blank"},wp.element.createElement("div",{className:"rank-math-tooltip"},wp.element.createElement("i",{className:"rm-icon rm-icon-plus"}),wp.element.createElement("span",null,(0,d.__)("Pro Feature","rank-math")))))})),(0,k.withFilters)("rankMath.analytics.keywordTitle")((function(e){var t=e.query;return wp.element.createElement("h4",null,(0,w.decodeEntities)(t))})),(0,k.withFilters)("rankMath.analytics.keywordDelete")((function(e){var t=e.sequence,n=e.query;return wp.element.createElement(p.Fragment,null,t,wp.element.createElement(k.Button,{className:"button button-secondary button-small add-keyword delete",title:(0,d.__)("Delete from Keyword Manager","rank-math"),onClick:function(){return(0,u.doAction)("rank_math_remove_keyword",n)}},wp.element.createElement("i",{className:"rm-icon rm-icon-trash"})))})),(0,k.withFilters)("rankMath.analytics.IndexingDataFooter")((function(){return wp.element.createElement("div",{className:"row-footer"},wp.element.createElement("table",null,wp.element.createElement("tbody",null,wp.element.createElement("tr",null,wp.element.createElement("td",{colSpan:"8"},wp.element.createElement("div",{className:"last-crawl-data"},wp.element.createElement("div",null,wp.element.createElement("strong",null,(0,d.__)("Google: ","rank-math")),wp.element.createElement("span",{className:"blurred"},(0,d.__)("Available in the PRO version","rank-math"))),wp.element.createElement("div",null,wp.element.createElement("strong",null,(0,d.__)("Last Crawl: ","rank-math")),wp.element.createElement("span",{className:"blurred"},(0,d.__)("PRO Feature","rank-math")))))))))}));function _(e){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}function S(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"";return t=t||(0,d.sprintf)((0,d.__)("No data to display. Check back later or try to update data manually from %s","rank-math"),''+(0,d.__)("Rank Math > General Settings > Analytics > Click 'Update data manually' button.","rank-math")+""),wp.element.createElement("div",{id:"rank-math-pro-cta",className:"rank-math-analytics-notice"},wp.element.createElement("div",{className:"rank-math-cta-table woocommerce-table rank-math-table"},wp.element.createElement("div",{className:"rank-math-cta-header"},wp.element.createElement("h2",null,e)),wp.element.createElement("div",{className:"rank-math-cta-body",dangerouslySetInnerHTML:{__html:t}})))},elementObserver:function(e,t){var n=P(t,2),a=n[0],r=n[1];return(0,p.useEffect)((function(){var t=e.current;if(t){new IntersectionObserver((function(e){P(e,1)[0].isIntersecting&&!1===a&&r(!0)})).observe(t)}}),[a]),a}};var D=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(l,e);var t,n,a,r=U(l);function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=r.apply(this,arguments)).data=e.props.data,e}return t=l,(n=[{key:"render",value:function(){return wp.element.createElement(React.Fragment,null,this.getContentAiScore(),this.getSeoScore(),I()&&wp.element.createElement("div",{id:"rank-math-analytics-site-traffic",className:"rank-math-item"}),this.getSiteImpression(),this.getAveragePosition(),this.getIndexVerdict(),!I()&&this.getPageSpeed(),I()&&wp.element.createElement("div",{id:"rank-math-analytics-stats-pagespeed",className:"rank-math-single-tab rank-math-item"}))}},{key:"getContentAiScore",value:function(){return!(0,h.isUndefined)(this.data.contentAiScore)&&wp.element.createElement("div",{className:"rank-math-item content-ai-score"},wp.element.createElement("h3",null,(0,d.__)("Content AI score","rank-math"),wp.element.createElement("span",{className:"rank-math-tooltip"},wp.element.createElement("em",{className:"dashicons-before dashicons-editor-help"}),wp.element.createElement("span",null,(0,d.__)("Content AI Score.","rank-math")))),wp.element.createElement("div",{className:"score"},wp.element.createElement("strong",null,this.data.contentAiScore," / 100"),wp.element.createElement("div",{className:"score-wrapper"},wp.element.createElement("span",{className:"score-dot",style:{left:this.data.contentAiScore<13?13:this.data.contentAiScore+"%"}}))))}},{key:"getSeoScore",value:function(){var e=this.data.seo_score,t="rank-math-item seo-score "+this.getScoreClass(e);return wp.element.createElement("div",{className:t},wp.element.createElement("h3",null,(0,d.__)("SEO Score","rank-math"),wp.element.createElement("span",{className:"rank-math-tooltip"},wp.element.createElement("em",{className:"dashicons-before dashicons-editor-help"}),wp.element.createElement("span",null,(0,d.__)("Rank Math's SEO Score","rank-math")))),wp.element.createElement("div",{className:"score"},wp.element.createElement("strong",null,wp.element.createElement("span",null,e))))}},{key:"getSiteImpression",value:function(){if((0,h.isUndefined)(this.data.impressions)&&!rankMath.isAnalyticsConnected)return!1;var e=(0,h.get)(this.data,"impressions",0);return wp.element.createElement("div",{className:"rank-math-item"},wp.element.createElement("h3",null,(0,d.__)("Search Impressions","rank-math"),wp.element.createElement("span",{className:"rank-math-tooltip"},wp.element.createElement("em",{className:"dashicons-before dashicons-editor-help"}),wp.element.createElement("span",null,(0,d.__)("This is how many times your site showed up in the search results.","rank-math")))),wp.element.createElement("div",{className:"score"},wp.element.createElement(g,e)))}},{key:"getAveragePosition",value:function(){return!(0,h.isUndefined)(this.data.position)&&!rankMath.isAnalyticsConnected&&wp.element.createElement("div",{className:"rank-math-item"},wp.element.createElement("h3",null,(0,d.__)("Average Position","rank-math"),wp.element.createElement("span",{className:"rank-math-tooltip"},wp.element.createElement("em",{className:"dashicons-before dashicons-editor-help"}),wp.element.createElement("span",null,(0,d.__)("This is the average position of your site in the search results.","rank-math")))),wp.element.createElement("div",{className:"score"},wp.element.createElement(g,A({},this.data.position,{revert:!0}))))}},{key:"getIndexVerdict",value:function(){return(0,u.applyFilters)("rank-math-analytics-stats-index-verdict",wp.element.createElement("div",{className:"rank-math-item blur index-status"},wp.element.createElement("h3",null,(0,d.__)("Index Status","rank-math"),wp.element.createElement("span",{className:"rank-math-tooltip"},wp.element.createElement("em",{className:"dashicons-before dashicons-editor-help"}),wp.element.createElement("span",null,(0,d.__)("URL Inspection Status","rank-math")))),wp.element.createElement("div",{className:"verdict"},wp.element.createElement("i",{className:"indexing_state verdict indexing allowed undefined"}),wp.element.createElement("span",null,"undefined"))),this.data)}},{key:"getPageSpeed",value:function(){return wp.element.createElement(React.Fragment,null,wp.element.createElement("div",{id:"rank-math-analytics-stats-pagespeed",className:"rank-math-single-tab rank-math-item blur"},wp.element.createElement("div",{className:"rank-math-box rank-math-pagespeed-box"},wp.element.createElement("div",{className:"rank-math-pagespeed-header"},wp.element.createElement("h3",null,(0,d.__)("PageSpeed","rank-math"),wp.element.createElement("span",{className:"rank-math-tooltip"},wp.element.createElement("em",{className:"dashicons-before dashicons-editor-help"}))),wp.element.createElement("span",null,"April 2, 2022")),wp.element.createElement("div",{className:"grid"},wp.element.createElement("div",{className:"col pagespeed-desktop"},wp.element.createElement("i",{className:"rm-icon rm-icon-desktop"}),wp.element.createElement("strong",{className:"pagespeed interactive-good"},"0 s"),wp.element.createElement("small",{className:"pagescore score-bad"},"0")),wp.element.createElement("div",{className:"col pagespeed-mobile"},wp.element.createElement("i",{className:"rm-icon rm-icon-mobile"}),wp.element.createElement("strong",{className:"pagespeed interactive-good"},"0 s"),wp.element.createElement("small",{className:"pagescore score-bad"},"0"))))))}},{key:"getScoreClass",value:function(e){return e>80?"great":e>50&&e<81?"good":"bad"}}])&&T(t.prototype,n),a&&T(t,a),Object.defineProperty(t,"prototype",{writable:!1}),l}(p.Component),B=D;function L(e){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(e)}function G(e,t){for(var n=0;n\n\t\t\t\t
\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t').concat((0,d.__)("Show Analytics Stats","rank-math"),'\n\t\t\t\t\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t').concat(this.proContent(),"\n\t\t\t\t
\n\t\t\t")}},{key:"addContentLoader",value:function(){for(var e=[],t=0;t<4;t++)e.push(wp.element.createElement(s,{animate:!0,backgroundColor:"#f0f2f4",foregroundColor:"#f0f2f4",style:{width:"23%",height:"83px",padding:"1rem"}},wp.element.createElement("rect",{x:"0",y:"0",rx:"0",ry:"0",width:"100%",height:"100%"})));(0,p.render)((0,p.createElement)((function(){return wp.element.createElement("div",{className:"rank-math-analytics-wrapper"},e)})),document.getElementById("rank-math-analytics-stats"))}},{key:"proContent",value:function(){return I()?"":'\n\t\t")}},{key:"events",value:function(){var e=t()("#rank-math-analytics-stats-wrapper");t()(".rank-math-analytics-close-stats").on("click",(function(t){return t.preventDefault(),e.toggleClass("hide-stats"),m()({method:"POST",path:"rankmath/v1/an/removeFrontendStats/",data:{toggleBar:!0,hide:e.hasClass("hide-stats")}}),!1})),t()(".rank-math-analytics-disable-stats").on("click",(function(t){return t.preventDefault(),confirm((0,d.__)("Are you sure you want to do this? This action will close the Stats bar permanently. Instead, you can use the toggle icon to minimize it.","rank-math"))&&(e.remove(),m()({method:"POST",path:"rankmath/v1/an/removeFrontendStats/"})),!1}))}}])&&G(n.prototype,a),r&&G(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();t()((function(){new V}))}()}();