!function(){var e={184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var C=function(e){var t=e.tabId,n=e.onClick,r=e.children,a=e.selected,o=S(e,d);return wp.element.createElement(c.Button,E({role:"tab",tabIndex:a?null:-1,"aria-selected":a,id:t,onClick:n},o),r)},O=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&&k(e,t)}(l,e);var t,n,r,i=w(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),g(b(e=i.apply(this,arguments)),"handleClick",(function(t){var n=e.props.onSelect,r=void 0===n?o.noop:n;e.setState({selected:t}),r(t)})),g(b(e),"onNavigate",(function(e,t){t.click()}));var t=e.props,n=t.tabs,r=t.initialTabName;return e.state={selected:r||(n.length>0?n[0].name:null)},e}return t=l,(n=[{key:"render",value:function(){var e=this,t=this.state.selected,n=this.props,r=n.activeClass,i=void 0===r?"is-active":r,l=n.className,s=n.instanceId,u=n.orientation,m=void 0===u?"horizontal":u,p=n.tabs,h=(0,o.find)(p,{name:t}),f=s+"-"+h.name,d=p.slice(4);return wp.element.createElement("div",{className:l},wp.element.createElement(c.NavigableMenu,{role:"tablist",orientation:m,onNavigate:this.onNavigate,className:"components-tab-panel__tabs "+t},p.slice(0,4).map((function(n){return wp.element.createElement(C,{className:a()("components-tab-panel__tabs-item",n.className,g({},i,n.name===t)),tabId:s+"-"+n.name,"aria-controls":s+"-"+n.name+"-view",selected:n.name===t,key:n.name,onClick:(0,o.partial)(e.handleClick,n.name)},n.title)})),d.map((function(n){return wp.element.createElement(C,{className:a()("components-tab-panel__tabs-item",n.className,g({},i,n.name===t)),tabId:s+"-"+n.name,"aria-controls":s+"-"+n.name+"-view",selected:n.name===t,key:n.name,onClick:(0,o.partial)(e.handleClick,n.name)},n.title)}))),h&&wp.element.createElement("div",{"aria-labelledby":f,role:"tabpanel",id:f+"-view",className:"components-tab-panel__tab-content"},this.props.children(h)))}}])&&y(t.prototype,n),r&&y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(s.Component),P=(0,h.withInstanceId)(O),j=wp.apiFetch,N=n.n(j);function A(e){return A="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},A(e)}function R(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],r=[];return(0,o.forEach)(e,(function(e,l){if("total"!==l){var c=(0,o.isUndefined)(e.total)?e:e.total,s=t.getPostStats(l),u=a()(l,{"has-children":!(0,o.isUndefined)(e.total),show:l===t.state.activeTab}),m=t.getScore(l,s,c,n),p=(0,o.ceil)(150*c/100);r.push(wp.element.createElement("div",{key:l,className:u+" "+F(m),onClick:function(){return t.setState({activeTab:t.state.activeTab!==l?l:""})},role:"presentation"},wp.element.createElement("h4",null,n?l:(0,o.startCase)(l)),n&&wp.element.createElement("span",null,s," / ",c),!n&&wp.element.createElement(React.Fragment,null,wp.element.createElement("strong",null,s),wp.element.createElement("span",{className:"desc"},(0,i.__)("Use","rank-math")," ",c," ",(0,i.__)("to","rank-math")," ",p)),(0,o.isObject)(e)&&t.getRecommendations(e,!0)))}})),n?wp.element.createElement("div",{className:"submenu"},r):r}},{key:"getPostStats",value:function(e){return(0,o.has)(this.props.postStats,e)?this.props.postStats[e]:0}},{key:"getScore",value:function(e,t,n,r){var a=t===n?100:t/n*100;if(0===n&&t<=2&&(a=100),r)return a>100&&a<=125?100:a;var o=a>80?100:t/n*80;return a>125&&"wordCount"!==e&&(o=0),this.props.updateAiScore(e,o),a>100&&"wordCount"===e||a>100&&a<=125?100:a}}],n&&L(t.prototype,n),r&&L(t,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(s.Component),H=(0,h.compose)((0,m.withSelect)((function(e,t){var n=1518,r=12,a=2,i=5,l=3,c=0,s=0,u=0,m=8,p=19;if(t.hasCredits){var h=t.researcher.getResearch("wordCount"),f=rankMathEditor.assessor.analyzer.defaultAnalyses.contentHasAssets;n=h(t.content),r=(0,o.isUndefined)(f)||(0,o.isUndefined)(t.researcher.paper)?0:f.getImages(t.researcher.paper,t.content),a=(0,o.isUndefined)(f)?0:f.getVideos(t.content),i=(t.content.match(/]*>(.*?)<\/h2>/g)||[]).length,l=(t.content.match(/]*>(.*?)<\/h3>/g)||[]).length,c=(t.content.match(/]*>(.*?)<\/h4>/g)||[]).length,s=(t.content.match(/]*>(.*?)<\/h5>/g)||[]).length,u=(t.content.match(/]*>(.*?)<\/h6>/g)||[]).length;var d=t.researcher.getResearch("getLinkStats")(t.content);m=d.internalTotal,p=d.externalTotal}return{postStats:{wordCount:n,images:r,videos:a,mediaCount:r+a,h2:i,h3:l,h4:c,h5:s,h6:u,headingCount:i+l+c+s+u,internal:m,external:p,linkCount:m+p}}})))(z),J=rankMathAnalyzer;function Q(){var e=arguments.length>0&&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 r={utm_source:"Plugin",utm_medium:encodeURIComponent(t),utm_campaign:"WP"};return n+"?"+Object.keys(r).map((function(e){return"".concat(e,"=").concat(r[e])})).join("&")}function Y(e){return Y="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},Y(e)}function G(e,t){for(var n=0;n100?0:a>80?100:a,a}},{key:"getTooltipContent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.props.hasCredits)return this.state.selected===e.keyword?wp.element.createElement("span",{className:"rank-math-tooltip-data"},(0,i.__)("Copied","rank-math")):e.competition||e.cpc||e.search_volume?wp.element.createElement("span",{className:"rank-math-tooltip-data"},wp.element.createElement("span",null,(0,i.__)("Ad Competition:","rank-math")," ",(0,o.round)(100*e.competition)),wp.element.createElement("span",null,(0,i.__)("CPC:","rank-math")," $",(0,o.round)(e.cpc,2)),wp.element.createElement("span",null,(0,i.__)("Volume:","rank-math")," ",(0,o.round)(e.search_volume))):wp.element.createElement("span",{className:"rank-math-tooltip-data"},t?(0,i.__)("Click to copy keyword","rank-math"):(0,i.__)("No data available","rank-math"))}},{key:"getCount",value:function(e,t){var n=this.props.caData.content;if(e=(0,o.isString)(e)?J.Helpers.removeDiacritics(e).toLowerCase():e,"heading"===t){e=e.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&");var r=new RegExp("]*>.*?"+e+".*?","g"),a=n.match(r);return(0,o.isNull)(a)?0:a.length}return"title"===t&&(n=this.props.caData.title),"description"===t&&(n=this.props.caData.description),J.Helpers.cleanTagsOnly(n).split(e).length-1}}],n&&G(t.prototype,n),r&&G(t,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(s.Component),ne=(0,h.compose)((0,m.withDispatch)((function(e){return{toggleEditor:function(){e("rank-math").toggleSnippetEditor(!0)}}})))(te),re=function(){return!((0,o.isNil)(window.wp)||(0,o.isNil)(wp.data)||(0,o.isNil)(wp.data.select("core/editor"))||!window.document.body.classList.contains("block-editor-page")||!(0,o.isFunction)(wp.data.select("core/editor").getEditedPostAttribute))};function ae(e){return ae="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},ae(e)}function oe(e,t){for(var n=0;n\x3c!-- /wp:rank-math/faq-block --\x3e'}}).on("success",(function(){setTimeout((function(){e({iconClass:"rm-icon-copy"})}),3e3)}))}},{key:"render",value:function(){var e=this,t=[];return(0,o.isEmpty)(this.props.caData.data.related_questions)?wp.element.createElement("h3",{className:"no-data"},(0,i.__)("There are no recommended Questions for this researched keyword.","rank-math")):((0,o.forEach)(this.props.caData.data.related_questions,(function(n,r){t.push(wp.element.createElement("div",{className:"rank-math-questions-item",key:r},wp.element.createElement("h3",{className:"rank-math-tooltip","data-key":n,onClick:function(){return e.setState({selected:n})},role:"presentation"},n,e.getTooltipContent(n))))})),wp.element.createElement(s.Fragment,null,wp.element.createElement(c.PanelBody,{initialOpen:!0},wp.element.createElement("div",{className:"rank-math-section-heading"},wp.element.createElement("h2",null,(0,i.__)("Related Questions","rank-math"),wp.element.createElement("a",{href:Q("content-ai-settings","Sidebar Questions KB Icon"),rel:"noreferrer",target:"_blank",id:"rank-math-help-icon",title:(0,i.__)("Know more about Questions.","rank-math")},"﹖")),wp.element.createElement(c.Button,{onClick:function(){e.setState({iconClass:"rm-icon-tick"})},className:"rank-math-copy-questions button-secondary rank-math-tooltip left"},wp.element.createElement("i",{className:"rm-icon "+this.state.iconClass}),wp.element.createElement("span",null,(0,i.__)("Copy this data as a FAQ Block.","rank-math")))),wp.element.createElement("span",{className:"components-form-token-field__help"},(0,i.__)("Click on any question to copy it.","rank-math")),wp.element.createElement("div",{id:"rank-math-ca-questions-data"},t))))}},{key:"getTooltipContent",value:function(e){return this.state.selected===e&&wp.element.createElement("span",{className:"rank-math-tooltip-data"},(0,i.__)("Copied","rank-math"))}}])&&oe(t.prototype,n),r&&oe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(s.Component),me=ue,pe=function(e){var t=[];return(0,o.isEmpty)(e.caData.data.links)?wp.element.createElement("h3",{className:"no-data"},(0,i.__)("There are no recommended Links for this researched keyword.","rank-math")):((0,o.forEach)(e.caData.data.links,(function(e,n){return t.push(wp.element.createElement("li",{key:n},wp.element.createElement("a",{href:e,rel:"noreferrer",target:"_blank"},e)))})),wp.element.createElement(s.Fragment,null,wp.element.createElement(c.PanelBody,{initialOpen:!0},wp.element.createElement("div",{className:"rank-math-section-heading"},wp.element.createElement("h2",null,(0,i.__)("Related External Links","rank-math"),wp.element.createElement(c.Button,{className:"is-link",href:Q("content-ai-links","Sidebar Links KB Icon"),rel:"noreferrer",target:"_blank",id:"rank-math-help-icon",label:(0,i.__)("Know more about Links.","rank-math"),showTooltip:!0},"﹖")),wp.element.createElement("p",null,(0,i.__)("Use some of these external links in the content area. It is recommended to add","rank-math")," ",wp.element.createElement("a",{href:Q("about-and-mentions-schema","Use Some External Links"),rel:"noreferrer",target:"_blank"},(0,i.__)("about or mention Schema.","rank-math")))),wp.element.createElement("ul",null,t))))},he=function(e){"social"===e&&(0,m.dispatch)("rank-math").toggleSnippetEditor(!0)},fe=function(e){return wp.element.createElement(P,{className:"rank-math-contentai-tabs",activeClass:"is-active",tabs:[{name:"keywords",title:wp.element.createElement(s.Fragment,null,wp.element.createElement("span",null,(0,i.__)("Keywords","rank-math"))),view:ne,className:"rank-math-keywords-tab"},{name:"questions",title:wp.element.createElement(s.Fragment,null,wp.element.createElement("span",null,(0,i.__)("Questions","rank-math"))),view:me,className:"rank-math-questions-tab"},{name:"links",title:wp.element.createElement(s.Fragment,null,wp.element.createElement("span",null,(0,i.__)("Links","rank-math"))),view:pe,className:"rank-math-recommended-links-tab"}],onSelect:he,data:e},(function(t,n){return wp.element.createElement("div",{className:"rank-math-contentai-tab-content-"+t.name,key:n},(0,s.createElement)(t.view,e))}))},de=React;function ye(e){return e.startsWith("{{/")?{type:"componentClose",value:e.replace(/\W/g,"")}:e.endsWith("/}}")?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.startsWith("{{")?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}function ke(e,t){let n,r,a=[];for(let o=0;o0,d=rankMath.contentAiMigrating;if(f&&u&&!h&&rankMath.contentAICredits<500&&(f=!1),m&&p&&f&&!d&&!h)return null;var y,k="width-"+n;return!m||!p||f&&h?wp.element.createElement("div",{id:"rank-math-pro-cta",className:"center rank-math-content-ai-warning-wrapper"},wp.element.createElement("div",{className:"rank-math-cta-box blue-ticks top-20 less-padding "+k},wp.element.createElement("h3",null,(0,i.__)("🚀 Supercharge Your Content With AI","rank-math")),wp.element.createElement("p",null,!m&&!l&&(0,i.__)("Start using Content AI by connecting your RankMath.com Account","rank-math"),m&&!p&&!l&&!h&&(0,i.__)("To access this Content AI feature, you need to have an active subscription plan.","rank-math"),m&&!l&&h&&(0,i.__)("To access this Content AI feature, you have to purchase a Content AI Subscription.","rank-math"),l&&(0,i.__)("You are one step away from unlocking this premium feature along with many more.","rank-math")),function(e,t,n){return t?wp.element.createElement("ul",null,wp.element.createElement("li",null,(0,i.__)("Bulk Update Your SEO Meta using AI","rank-math")),wp.element.createElement("li",null,(0,i.__)("Get Access to 40+ AI SEO Tools","rank-math")),wp.element.createElement("li",null,(0,i.__)("125+ Expert-Written Prompts","rank-math")),wp.element.createElement("li",null,(0,i.__)("1-Click Competitor Content Research","rank-math")),wp.element.createElement("li",null,(0,i.__)("1-Click WooCommerce Product Descriptions","rank-math"))):n?wp.element.createElement("ul",null,wp.element.createElement("li",null,(0,i.__)("1-Click Competitor Research","rank-math")),wp.element.createElement("li",null,(0,i.__)("On-Page SEO Suggestions","rank-math")),wp.element.createElement("li",null,(0,i.__)("1-Click Bulk SEO Meta","rank-math")),wp.element.createElement("li",null,(0,i.__)("125+ Pre-Built Prompts","rank-math")),wp.element.createElement("li",null,(0,i.__)("Multiple RankBot Sessions","rank-math"))):40===e?wp.element.createElement("ul",null,wp.element.createElement("li",null,(0,i.__)("1-Click SEO Content","rank-math")),wp.element.createElement("li",null,(0,i.__)("1-Click SEO Meta","rank-math")),wp.element.createElement("li",null,(0,i.__)("40+ Specialized AI Tools","rank-math")),wp.element.createElement("li",null,(0,i.__)("1-Click Competitor Research","rank-math")),wp.element.createElement("li",null,(0,i.__)("125+ Pre-Built Prompts","rank-math"))):wp.element.createElement("ul",null,wp.element.createElement("li",null,(0,i.__)("Gain access to 40+ advanced AI tools, empowering your content strategy.","rank-math")),wp.element.createElement("li",null,(0,i.__)("Experience the revolutionary AI-powered Content Editor for unparalleled efficiency.","rank-math")),wp.element.createElement("li",null,(0,i.__)("Engage with RankBot, your personal AI Chat Assistant, for real-time assistance.","rank-math")))}(n,l,h),!m&&wp.element.createElement(c.Button,{href:rankMath.connectSiteUrl,className:"button button-primary is-green"},(0,i.__)("Connect Now","rank-math")),m&&(!p||h)&&wp.element.createElement(c.Button,{href:ve(rankMath.links["content-ai"]+"?play-video=ioPeVIntJWw","Buy+Plan+Button"),className:"button button-primary is-green",target:"_blank"},(0,i.__)("Learn More","rank-math")))):d?wp.element.createElement("div",{id:"rank-math-pro-cta",className:"center rank-math-content-ai-warning-wrapper"},wp.element.createElement("div",{style:{textAlign:"center"},className:"rank-math-cta-box less-padding top-20 "+k},wp.element.createElement("h3",null,(0,i.__)("Server Maintenance Underway","rank-math")),wp.element.createElement("p",null,(0,i.__)("We are working on improving your Content AI experience. Please wait for 5 minutes and then refresh to start using the optimized Content AI. If you see this for more than 5 minutes, please ","rank-math"),wp.element.createElement("a",{href:rankMath.links.support,target:"_blank",rel:"noreferrer"},(0,i.__)("reach out to the support team.","rank-math")),(0,i.__)(" We are sorry for the inconvenience.","rank-math")))):wp.element.createElement("div",{id:"rank-math-pro-cta",className:"center rank-math-content-ai-warning-wrapper"},wp.element.createElement("div",{className:"rank-math-cta-box less-padding top-20 "+k},wp.element.createElement("h3",null,(0,i.__)("⛔️ Content AI Credit Alert!","rank-math")),wp.element.createElement("p",null,(y=rankMath.contentAIRefreshDate?rankMath.contentAIRefreshDate:"")?wp.element.createElement(be,{components:{strong:wp.element.createElement("strong",null)}},(0,i.sprintf)((0,i.__)("Your monthly Content AI credits have been fully utilized. You can wait till %s for your credits to refresh or upgrade to continue enjoying seamless content creation","rank-math"),"{{strong}}"+y+"{{/strong}}")):(0,i.__)("Your monthly Content AI credits have been fully utilized. To continue enjoying seamless content creation, simply click the button below to upgrade your plan and access more credits.","rank-math")),wp.element.createElement(c.Button,{href:ve(rankMath.links["content-ai"]+"?play-video=ioPeVIntJWw","Buy+Credits+Button"),className:"button button-primary is-green",target:"_blank"},(0,i.__)("Learn More","rank-math")),wp.element.createElement(c.Button,{variant:"link",href:ve(rankMath.links["content-ai-restore-credits"],"Buy+Credits+Button"),className:"button button-secondary",target:"_blank"},(0,i.__)("Missing Credits?","rank-math"))))};function _e(e){return _e="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(e)}function Ee(e,t){for(var n=0;n=500}},{key:"getDummyData",value:function(){return{keywords:{content:{"rank math":{keyword:"rank math",average:17,count:12},"rank math vs yoast seo":{keyword:"rank math vs yoast seo",average:1,count:1},"what is rank math":{keyword:"what is rank math",average:1,count:1},"rank math schema":{keyword:"rank math schema",average:1,count:1},"rank math configuration":{keyword:"rank math configuration",average:1,count:1},"rank math pro version":{keyword:"rank math pro version",average:1,count:2},"rank math comparison":{keyword:"rank math comparison",average:1,count:1},"rank math for seo":{keyword:"rank math for seo",average:1,count:1},"seo by rank math":{keyword:"seo by rank math",average:1,count:0}}},related_keywords:["rank math plugin","rank math pricing","rank math vs yoast","rank math review","rank math premium","how to use rank math","rank math training","rank math woocommerce","wordpress seo plugin"],recommendations:{wordCount:1829,linkCount:{total:16},headingCount:{total:9},mediaCount:{total:18}}}}},{key:"getHeader",value:function(){var e=this;return wp.element.createElement("div",{className:"rank-math-ca-top-section"},(0,o.includes)(["elementor","divi"],rankMath.currentEditor)&&wp.element.createElement(c.Button,{onClick:function(){return t()(".rank-math-general-tab").trigger("click")}},wp.element.createElement("i",{className:"dashicons dashicons-arrow-left-alt"}),(0,i.__)("Back","rank-math")),wp.element.createElement(c.SelectControl,{value:this.state.country,onChange:function(t){return e.setState({country:t,showResearch:!0})},options:rankMath.countries}))}},{key:"keywordField",value:function(){var e=this;return wp.element.createElement("div",{className:"rank-math-ca-keywords-wrapper"},wp.element.createElement("div",{className:"rank-math-ca-credits-wrapper"},wp.element.createElement(c.TextControl,{label:(0,i.__)("Focus Keyword","rank-math"),value:this.state.keyword,onChange:function(t){return e.setState({keyword:t,showResearch:!0})},onKeyDown:function(e){"Enter"===e.key&&e.preventDefault()},help:(0,l.applyFilters)("rank_math_content_ai_help_text",wp.element.createElement(React.Fragment,null,(0,i.__)("Upgrade to buy more credits from ","rank-math"),wp.element.createElement("a",{href:Q("content-ai-pricing-tables","Sidebar Upgrade Text"),rel:"noreferrer",target:"_blank",title:(0,i.__)("Content AI Pricing.","rank-math")},(0,i.__)("here.","rank-math")))),placeholder:(0,i.__)("Suggested length 2-3 Words","rank-math")}),wp.element.createElement("div",{className:"help-text"},(0,i.__)("To learn how to use it","rank-math")," ",wp.element.createElement("a",{href:Q("content-ai-settings","Content AI Sidebar KB Link"),target:"_blank",rel:"noreferrer"},(0,i.__)("Click here","rank-math"))),!this.state.showResearch&&!this.state.loading&&!(0,o.isEmpty)(this.props.data)&&rankMath.ca_credits>=500&&wp.element.createElement(c.Button,{className:"rank-math-ca-force-update",onClick:function(){return e.props.researchKeyword(e.state,e.setState,!0)},label:(0,i.__)("Refresh will use 500 Credit.","rank-math"),showTooltip:!0},wp.element.createElement("i",{className:"dashicons dashicons-image-rotate"}))),this.state.showResearch&&wp.element.createElement(c.Button,{className:"is-primary",onClick:function(){return e.props.researchKeyword(e.state,e.setState)},label:(0,i.__)("500 credits will be used.","rank-math"),disabled:!this.state.keyword,showTooltip:!0},(0,i.__)("Research","rank-math")))}}])&&Ee(n.prototype,r),u&&Ee(n,u),Object.defineProperty(n,"prototype",{writable:!1}),p}(s.Component),Ne=(0,h.compose)((0,m.withSelect)((function(e){var t=rankMathEditor.assessor.analyzer.researcher,n=t.paper;return{data:e("rank-math").getKeywordsData(),keyword:(0,o.get)(rankMath.ca_keyword,"keyword",e("rank-math").getKeywords().split(",")[0]),country:(0,o.get)(rankMath.ca_keyword,"country",rankMath.contentAiCountry),researcher:t,content:(0,o.isUndefined)(n)?"":n.getTextLower(),title:(0,o.isUndefined)(n)?"":n.getTitle().toLowerCase(),description:(0,o.isUndefined)(n)?"":n.getDescription().toLowerCase(),hasThumbnail:(0,o.isUndefined)(n)?"":n.hasThumbnail(),score:e("rank-math").getContentAIScore()}})),(0,m.withDispatch)((function(e,t){return{researchKeyword:function(n,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n.force_update=a,n.objectID=rankMath.objectID,n.objectType=rankMath.objectType,r({showResearch:!1,loading:!0}),N()({method:"POST",path:"/rankmath/v1/ca/researchKeyword",data:n}).catch((function(e){r({loading:!1,showResearch:!0}),alert(e.message)})).then((function(n){r({loading:!1}),e("rank-math").updateKeywordsData(n.data),(0,o.isNull)(n.credits)||(0,o.isUndefined)(n.credits)||(r({credits:n.credits}),t.setCredits((0,o.isNumber)(n.credits)?n.credits:0)),(0,l.doAction)("rank_math_content_ai_changed",n.keyword)}))},updateAiScore:function(n,r){var a=t.score;a[n]=(0,o.round)(r,2),e("rank-math").updateAIScore(a)}}})))(je);function Ae(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,l=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw a}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Re(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n999?Math.sign(e)*(Math.abs(e)/1e3).toFixed(1)+"k":Math.sign(e)*Math.abs(e))),wp.element.createElement("a",{href:Q("content-ai-credits-usage","Sidebar Credits Tooltip Icon"),rel:"noreferrer",target:"_blank",id:"rank-math-help-icon",title:(0,i.__)("Know more about credits.","rank-math")},"﹖")),wp.element.createElement(P,{className:"rank-math-tabs",activeClass:"is-active",tabs:(0,l.applyFilters)("rank_math_content_ai_tabs",[{name:"content-ai",title:wp.element.createElement(s.Fragment,null,wp.element.createElement("i",{className:"rm-icon rm-icon-analyzer",title:(0,i.__)("Research","rank-math")}),wp.element.createElement("span",null,(0,i.__)("Research","rank-math"))),view:Ne,className:"rank-math-general-tab"}])},(function(e){return wp.element.createElement(React.Fragment,null,wp.element.createElement("div",{className:"rank-math-tab-content-"+e.name},(0,s.createElement)(e.view,{setCredits:m,hasContentAiError:!rankMath.isUserRegistered||!rankMath.contentAIPlan||!rankMath.contentAICredits||rankMath.contentAiMigrating})))})))}function Me(e){return Me="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},Me(e)}function Ie(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Me(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Me(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Me(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Be=(0,m.withSelect)((function(e){var t=e("rank-math"),n=Object.values(t.getContentAIScore());return n=(0,o.isEmpty)(n)||!rankMath.isUserRegistered?rankMath.contentAiScore:(0,o.round)((0,o.sum)(n)/n.length),{isLoaded:t.isLoaded(),score:(0,o.isUndefined)(n)?0:n}}))((function(e){var t=e.isLoaded,n=e.score,r="free"===rankMath.contentAIPlan,o=a()("rank-math-toolbar-score content-ai-score",Ie(Ie(Ie({},F(n),!0),"loading",!t),"is-free",r));return wp.element.createElement("div",{className:o},r&&wp.element.createElement("span",{className:"rank-math-free-badge"},(0,i.__)("Free","rank-math")),wp.element.createElement("i",{className:"rm-icon rm-icon-content-ai"}),wp.element.createElement("span",{className:"content-ai-score"},n," / 100"))}));function xe(e){return xe="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},xe(e)}function De(e,t){for(var n=0;n'+t+" - "+n+(0,i.__)(" words","rank-math")+"")}}},{key:"contentLengthBoundary",value:function(e){if(this.ca_keyword!==this.keyword)return e;var t=this.data.recommendations.wordCount,n=(0,o.ceil)(150*t/100);return{recommended:{boundary:n,score:8},belowRecommended:{boundary:(0,o.ceil)(n/2),score:5},low:{boundary:t,score:2}}}},{key:"keywordDensity",value:function(e,t){if((0,o.isEmpty)(this.data.keywords.content)||(0,o.isEmpty)(this.data.keywords.content[this.keyword]))return e;var n=t/this.data.keywords.content[this.keyword].average*100;return n>80?1.1:100