File Editor
Directories:
.. (Back)
externals
languages
Files:
academy.js
addon-installation.js
admin-global.js
admin-modules.js
analysis-worker.js
api-client.js
block-editor.js
bulk-editor.js
classic-editor.js
crawl-settings.js
dashboard-widget.js
dynamic-blocks.js
edit-page.js
editor-modules.js
elementor.js
externals-components.js
externals-contexts.js
externals-redux.js
faq-block.js
filter-explanation.js
frontend-inspector-resources.js
general-page.js
help-scout-beacon.js
how-to-block.js
import.js
indexation.js
installation-success.js
integrations-page.js
introductions.js
network-admin.js
new-settings.js
post-edit.js
quick-edit-handler.js
react-select.js
redirect-old-features-tab.js
reindex-links.js
settings.js
support.js
term-edit.js
used-keywords-assessment.js
wincher-dashboard-widget.js
workouts.js
Create New File
Create
Edit File: editor-modules.js
(()=>{"use strict";var e={6746:(e,t,s)=>{var r="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},n=i(s(9196)),o=i(s(9156)),a=i(s(6743));function i(e){return e&&e.__esModule?e:{default:e}}var l=void 0;function c(e,t){var s,a,i,d,u,p,h,m,g=[],y={};for(p=0;p<e.length;p++)if("string"!==(u=e[p]).type){if(!t.hasOwnProperty(u.value)||void 0===t[u.value])throw new Error("Invalid interpolation, missing component node: `"+u.value+"`");if("object"!==r(t[u.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+u.value+"`","\n> "+l);if("componentClose"===u.type)throw new Error("Missing opening component token: `"+u.value+"`");if("componentOpen"===u.type){s=t[u.value],i=p;break}g.push(t[u.value])}else g.push(u.value);return s&&(d=function(e,t){var s,r,n=t[e],o=0;for(r=e+1;r<t.length;r++)if((s=t[r]).value===n.value){if("componentOpen"===s.type){o++;continue}if("componentClose"===s.type){if(0===o)return r;o--}}throw new Error("Missing closing component token `"+n.value+"`")}(i,e),h=c(e.slice(i+1,d),t),a=n.default.cloneElement(s,{},h),g.push(a),d<e.length-1&&(m=c(e.slice(d+1),t),g=g.concat(m))),1===g.length?g[0]:(g.forEach((function(e,t){e&&(y["interpolation-child-"+t]=e)})),(0,o.default)(y))}t.Z=function(e){var t=e.mixedString,s=e.components,n=e.throwErrors;if(l=t,!s)return t;if("object"!==(void 0===s?"undefined":r(s))){if(n)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var o=(0,a.default)(t);try{return c(o,s)}catch(e){if(n)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},6743:e=>{function t(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(t)}},9156:(e,t,s)=>{var r=s(9196),n="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=s(7942),a=s(9179),i=s(397),l=".",c=":",d="function"==typeof Symbol&&Symbol.iterator,u="@@iterator";function p(e,t){return e&&"object"==typeof e&&null!=e.key?(s=e.key,r={"=":"=0",":":"=2"},"$"+(""+s).replace(/[=:]/g,(function(e){return r[e]}))):t.toString(36);var s,r}function h(e,t,s,r){var o,i=typeof e;if("undefined"!==i&&"boolean"!==i||(e=null),null===e||"string"===i||"number"===i||"object"===i&&e.$$typeof===n)return s(r,e,""===t?l+p(e,0):t),1;var m=0,g=""===t?l:t+c;if(Array.isArray(e))for(var y=0;y<e.length;y++)m+=h(o=e[y],g+p(o,y),s,r);else{var f=function(e){var t=e&&(d&&e[d]||e[u]);if("function"==typeof t)return t}(e);if(f)for(var b,w=f.call(e),k=0;!(b=w.next()).done;)m+=h(o=b.value,g+p(o,k++),s,r);else if("object"===i){var v=""+e;a(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===v?"object with keys {"+Object.keys(e).join(", ")+"}":v,"")}}return m}var m=/\/+/g;function g(e){return(""+e).replace(m,"$&/")}var y,f,b=w,w=function(e){var t=this;if(t.instancePool.length){var s=t.instancePool.pop();return t.call(s,e),s}return new t(e)};function k(e,t,s,r){this.result=e,this.keyPrefix=t,this.func=s,this.context=r,this.count=0}function v(e,t,s){var n,a,i=e.result,l=e.keyPrefix,c=e.func,d=e.context,u=c.call(d,t,e.count++);Array.isArray(u)?E(u,i,s,o.thatReturnsArgument):null!=u&&(r.isValidElement(u)&&(n=u,a=l+(!u.key||t&&t.key===u.key?"":g(u.key)+"/")+s,u=r.cloneElement(n,{key:a},void 0!==n.props?n.props.children:void 0)),i.push(u))}function E(e,t,s,r,n){var o="";null!=s&&(o=g(s)+"/");var a=k.getPooled(t,o,r,n);!function(e,t,s){null==e||h(e,"",t,s)}(e,v,a),k.release(a)}k.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},y=function(e,t,s,r){var n=this;if(n.instancePool.length){var o=n.instancePool.pop();return n.call(o,e,t,s,r),o}return new n(e,t,s,r)},(f=k).instancePool=[],f.getPooled=y||b,f.poolSize||(f.poolSize=10),f.release=function(e){var t=this;a(e instanceof t,"Trying to release an instance into a pool of a different type."),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return i(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(r.isValidElement(e))return i(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;a(1!==e.nodeType,"React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.");var t=[];for(var s in e)E(e[s],t,s,o.thatReturnsArgument);return t}},7942:e=>{function t(e){return function(){return e}}var s=function(){};s.thatReturns=t,s.thatReturnsFalse=t(!1),s.thatReturnsTrue=t(!0),s.thatReturnsNull=t(null),s.thatReturnsThis=function(){return this},s.thatReturnsArgument=function(e){return e},e.exports=s},9179:e=>{e.exports=function(e,t,s,r,n,o,a,i){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[s,r,n,o,a,i],d=0;(l=new Error(t.replace(/%s/g,(function(){return c[d++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},397:(e,t,s)=>{var r=s(7942);e.exports=r},9196:e=>{e.exports=window.React}},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={};s.r(e),s.d(e,{refreshDelay:()=>l});var t={};s.r(t),s.d(t,{default:()=>b,initializationDone:()=>w,sortResultsByIdentifier:()=>f});var r={};s.r(r),s.d(r,{default:()=>z,getIconForScore:()=>Y});var n={};s.r(n),s.d(n,{doAjaxRequest:()=>Ps});var o={};s.r(o),s.d(o,{setTextdomainL10n:()=>$s});var a={};s.r(a),s.d(a,{applyReplaceUsingPlugin:()=>or,createLabelFromName:()=>Xs,excerptFromContent:()=>nr,fillReplacementVariables:()=>Gs,handlePrefixes:()=>Qs,mapCustomFields:()=>rr,mapCustomTaxonomies:()=>sr,nonReplaceVars:()=>Vs,prepareCustomFieldForDispatch:()=>er,prepareCustomTaxonomyForDispatch:()=>tr,pushNewReplaceVar:()=>Zs,replaceSpaces:()=>Js});const i=window.yoast.externals.contexts,l=500,c=window.lodash;function d(){return(0,c.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}const u=window.wp.i18n,p=window.yoast.analysis,h=window.wp.hooks,m=window.yoast.externals.redux;function g(){}let y=!1;function f(e){return e.sort(((e,t)=>e._identifier.localeCompare(t._identifier)))}function b(e,t,s,r,n){if(!y)return;const o=p.Paper.parse(t());e.analyze(o).then((a=>{const{result:{seo:i,readability:l,inclusiveLanguage:c}}=a;if(i){const e=i[""];e.results.forEach((e=>{e.getMarker=()=>()=>s(o,e.marks)})),e.results=f(e.results),r.dispatch(m.actions.setSeoResultsForKeyword(o.getKeyword(),e.results)),r.dispatch(m.actions.setOverallSeoScore(e.score,o.getKeyword())),r.dispatch(m.actions.refreshSnippetEditor()),n.saveScores(e.score,o.getKeyword())}l&&(l.results.forEach((e=>{e.getMarker=()=>()=>s(o,e.marks)})),l.results=f(l.results),r.dispatch(m.actions.setReadabilityResults(l.results)),r.dispatch(m.actions.setOverallReadabilityScore(l.score)),r.dispatch(m.actions.refreshSnippetEditor()),n.saveContentScore(l.score)),c&&(c.results.forEach((e=>{e.getMarker=()=>()=>s(o,e.marks)})),c.results=f(c.results),r.dispatch(m.actions.setInclusiveLanguageResults(c.results)),r.dispatch(m.actions.setOverallInclusiveLanguageScore(c.score)),r.dispatch(m.actions.refreshSnippetEditor()),n.saveInclusiveLanguageScore(c.score)),(0,h.doAction)("yoast.analysis.refresh",a,{paper:o,worker:e,collectData:t,applyMarks:s,store:r,dataCollector:n})})).catch(g)}function w(){y=!0}var k=s(9196);const v=window.wp.element,E=window.yoast.styledComponents;var x=s.n(E);const _=window.yoast.propTypes;var R=s.n(_);const I=window.yoast.componentsNew,T=window.yoast.helpers,S=window.yoast.styleGuide,C=S.colors.$color_bad,L=S.colors.$palette_error_background,P=S.colors.$color_grey_text_light,A=S.colors.$palette_error_text,O=x().div` display: flex; flex-direction: column; `,B=x().label` font-size: var(--yoast-font-size-default); font-weight: var(--yoast-font-weight-bold); ${(0,T.getDirectionalStyle)("margin-right: 4px","margin-left: 4px")}; `,N=x().span` margin-bottom: 0.5em; `,q=x()(I.InputField)` flex: 1 !important; box-sizing: border-box; max-width: 100%; margin: 0; // Reset margins inherited from WordPress. // Hide native X in Edge and IE11. &::-ms-clear { display: none; } &.has-error { border-color: ${C} !important; background-color: ${L} !important; &:focus { box-shadow: 0 0 2px ${C} !important; } } `,M=x().ul` color: ${A}; list-style-type: disc; list-style-position: outside; margin: 0; margin-left: 1.2em; `,F=x().li` color: ${A}; margin: 0 0 0.5em 0; `,K=(0,I.addFocusStyle)(x().button` border: 1px solid transparent; box-shadow: none; background: none; flex: 0 0 32px; height: 32px; max-width: 32px; padding: 0; cursor: pointer; `);K.propTypes={type:R().string,focusColor:R().string,focusBackgroundColor:R().string,focusBorderColor:R().string},K.defaultProps={type:"button",focusColor:S.colors.$color_button_text_hover,focusBackgroundColor:"transparent",focusBorderColor:S.colors.$color_blue};const D=x()(I.SvgIcon)` margin-top: 4px; `,$=x().div` display: flex; flex-direction: row; align-items: center; &.has-remove-keyword-button { ${q} { ${(0,T.getDirectionalStyle)("padding-right: 40px","padding-left: 40px")}; } ${K} { ${(0,T.getDirectionalStyle)("margin-left: -32px","margin-right: -32px")}; } } `;class W extends v.Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){this.props.onChange(e.target.value)}renderLabel(){const{id:e,label:t,helpLink:s}=this.props;return(0,k.createElement)(N,null,(0,k.createElement)(B,{htmlFor:e},t),s)}renderErrorMessages(){const e=[...this.props.errorMessages];return!(0,c.isEmpty)(e)&&(0,k.createElement)(M,null,e.map(((e,t)=>(0,k.createElement)(F,{key:t},(0,k.createElement)("span",{role:"alert"},e)))))}render(){const{id:e,showLabel:t,keyword:s,onRemoveKeyword:r,onBlurKeyword:n,onFocusKeyword:o,hasError:a}=this.props,i=!t,l=r!==c.noop;return(0,k.createElement)(O,null,t&&this.renderLabel(),a&&this.renderErrorMessages(),(0,k.createElement)($,{className:l?"has-remove-keyword-button":null},(0,k.createElement)(q,{"aria-label":i?this.props.label:null,type:"text",id:e,className:a?"has-error":null,onChange:this.handleChange,onFocus:o,onBlur:n,value:s,autoComplete:"off"}),l&&(0,k.createElement)(K,{onClick:r,focusBoxShadowColor:"#084A67"},(0,k.createElement)(D,{size:"18px",icon:"times-circle",color:P}))))}}W.propTypes={id:R().string.isRequired,showLabel:R().bool,keyword:R().string,onChange:R().func.isRequired,onRemoveKeyword:R().func,onBlurKeyword:R().func,onFocusKeyword:R().func,label:R().string.isRequired,helpLink:R().node,hasError:R().bool,errorMessages:R().arrayOf(R().string)},W.defaultProps={showLabel:!0,keyword:"",onRemoveKeyword:c.noop,onBlurKeyword:c.noop,onFocusKeyword:c.noop,helpLink:null,hasError:!1,errorMessages:[]};const j=W;function H(e,t=""){const s=e.getIdentifier(),r={score:e.score,rating:p.interpreters.scoreToRating(e.score),hasMarks:e.hasMarks(),marker:e.getMarker(),id:s,text:e.text,markerId:t.length>0?`${t}:${s}`:s,hasBetaBadge:e.hasBetaBadge(),hasJumps:e.hasJumps(),hasAIFixes:e.hasAIFixes(),editFieldName:e.editFieldName};return"ok"===r.rating&&(r.rating="OK"),r}function U(e,t){switch(e.rating){case"error":t.errorsResults.push(e);break;case"feedback":t.considerationsResults.push(e);break;case"bad":t.problemsResults.push(e);break;case"OK":t.improvementsResults.push(e);break;case"good":t.goodResults.push(e)}return t}function Y(e){switch(e){case"loading":return{icon:"loading-spinner",color:S.colors.$color_green_medium_light};case"not-set":return{icon:"seo-score-none",color:S.colors.$color_score_icon};case"noindex":return{icon:"seo-score-none",color:S.colors.$color_noindex};case"good":return{icon:"seo-score-good",color:S.colors.$color_green_medium};case"ok":return{icon:"seo-score-ok",color:S.colors.$color_ok};default:return{icon:"seo-score-bad",color:S.colors.$color_red}}}function z(e,t=""){let s={errorsResults:[],problemsResults:[],improvementsResults:[],goodResults:[],considerationsResults:[]};if(!e)return s;for(let r=0;r<e.length;r++){const n=e[r];n.text&&(s=U(H(n,t),s))}return s}const V=(0,T.makeOutboundLink)(x().a` display: inline-block; position: relative; outline: none; text-decoration: none; border-radius: 100%; width: 24px; height: 24px; margin: -4px 0; vertical-align: middle; color: ${S.colors.$color_help_text}; &:hover, &:focus { color: ${S.colors.$color_snippet_focus}; } // Overwrite the default blue active color for links. &:active { color: ${S.colors.$color_help_text}; } &::before { position: absolute; top: 0; left: 0; padding: 2px; content: "\f223"; } `),G=x()(I.Collapsible)` h2 > button { padding-left: 24px; padding-top: 16px; &:hover { background-color: #f0f0f0; } } div[class^="collapsible_content"] { padding: 24px 0; margin: 0 24px; border-top: 1px solid rgba(0,0,0,0.2); } `,Q=window.wp.components,X="yoast yoast-gutenberg-modal",Z=e=>{const{title:t,className:s,showYoastIcon:r,additionalClassName:n,...o}=e,a=r?(0,k.createElement)("span",{className:"yoast-icon"}):null;return(0,k.createElement)(Q.Modal,{title:t,className:`${s} ${n}`,icon:a,...o},e.children)};Z.propTypes={title:R().string,className:R().string,showYoastIcon:R().bool,children:R().oneOfType([R().node,R().arrayOf(R().node)]),additionalClassName:R().string},Z.defaultProps={title:"Yoast SEO",className:X,showYoastIcon:!0,children:null,additionalClassName:""};const J=Z,ee=(window.yoast.socialMetadataForms,e=>({type:e.subtype,width:e.width,height:e.height,url:e.url,id:e.id,sizes:e.sizes,alt:e.alt||e.title||e.name}));const te=({hiddenField:e,hiddenFieldImageId:t,hiddenFieldFallbackImageId:s,hasImageValidation:r,...n})=>{const[o,a]=(0,v.useState)(null!==document.getElementById(s)),i=(0,v.useMemo)((()=>document.getElementById(e))),l=(0,v.useMemo)((()=>document.getElementById(t)));let c=null;c=s&&document.getElementById(s)?(0,v.useMemo)((()=>document.getElementById(s))):l;const[d,u]=(0,v.useState)({url:i?i.value:"",id:c?parseInt(c.value,10):"",alt:""}),[p,h]=(0,v.useState)([]),m=(0,v.useCallback)((e=>{i&&(i.value=e.url),c&&(c.value=e.id)})),g=(0,v.useCallback)((()=>{(function(e){const t=window.wp.media();return t.on("select",(()=>{const s=t.state().get("selection").first();e(ee(s.attributes))})),t})((e=>{c=l,u(e),m(e),r&&h((0,T.validateFacebookImage)(e)),a(!1)})).open()}),[r,m]),y=(0,v.useCallback)((()=>{c=l;const e={url:"",id:"",alt:""};u(e),m(e),h([]),a(!0)}),[m]);return(0,v.useEffect)((()=>{var e;d.id&&!d.alt&&(e=d.id,new Promise(((t,s)=>{window.wp.media.attachment||s(),window.wp.media.attachment(e).fetch().then((e=>{t(ee(e))})).catch((()=>s()))}))).then((e=>u(e)))}),[d]),(0,k.createElement)(I.ImageSelect,{...n,usingFallback:o,imageUrl:d.url,imageId:d.id,imageAltText:d.alt,onClick:g,onRemoveImageClick:y,warnings:p})};te.propTypes={hiddenField:R().string.isRequired,hiddenFieldImageId:R().string,hiddenFieldFallbackImageId:R().string,hasImageValidation:R().bool},te.defaultProps={hiddenFieldImageId:"",hiddenFieldFallbackImageId:"",hasImageValidation:!1};const se=te;function re({target:e,children:t}){let s=e;return"string"==typeof e&&(s=document.getElementById(e)),s?(0,v.createPortal)(t,s):null}function ne({target:e,label:t,hasPreview:s,hiddenField:r,hiddenFieldImageId:n,hiddenFieldFallbackImageId:o,selectImageButtonId:a,replaceImageButtonId:i,removeImageButtonId:l,hasNewBadge:c,isDisabled:d,hasPremiumBadge:u,hasImageValidation:p}){return(0,k.createElement)(re,{target:e},(0,k.createElement)(se,{label:t,hasPreview:s,hiddenField:r,hiddenFieldImageId:n,hiddenFieldFallbackImageId:o,selectImageButtonId:a,replaceImageButtonId:i,removeImageButtonId:l,hasNewBadge:c,isDisabled:d,hasPremiumBadge:u,hasImageValidation:p}))}re.propTypes={target:R().oneOfType([R().string,R().object]).isRequired,children:R().node.isRequired},ne.propTypes={target:R().string.isRequired,label:R().string.isRequired,hasPreview:R().bool.isRequired,hiddenField:R().string.isRequired,hiddenFieldImageId:R().string,hiddenFieldFallbackImageId:R().string,selectImageButtonId:R().string,replaceImageButtonId:R().string,removeImageButtonId:R().string,hasNewBadge:R().bool,isDisabled:R().bool,hasPremiumBadge:R().bool,hasImageValidation:R().bool},ne.defaultProps={hiddenFieldImageId:"",hiddenFieldFallbackImageId:"",selectImageButtonId:"",replaceImageButtonId:"",removeImageButtonId:"",hasNewBadge:!1,isDisabled:!1,hasPremiumBadge:!1,hasImageValidation:!1};const oe=({target:e,scoreIndicator:t})=>(0,k.createElement)(re,{target:e},(0,k.createElement)(I.SvgIcon,{...Y(t)}));oe.propTypes={target:R().string.isRequired,scoreIndicator:R().string.isRequired};const ae=oe,ie=e=>{const[t,s]=(0,v.useState)(!1),{prefixIcon:r}=e;return(0,k.createElement)("div",{className:"yoast components-panel__body "+(t?"is-opened":"")},(0,k.createElement)("h2",{className:"components-panel__body-title"},(0,k.createElement)("button",{onClick:function(){s(!t)},className:"components-button components-panel__body-toggle",type:"button",id:e.buttonId},(0,k.createElement)("span",{className:"yoast-icon-span",style:{fill:`${r&&r.color||""}`}},r&&(0,k.createElement)(I.SvgIcon,{icon:r.icon,color:r.color,size:r.size})),(0,k.createElement)("span",{className:"yoast-title-container"},(0,k.createElement)("div",{className:"yoast-title"},e.title),(0,k.createElement)("div",{className:"yoast-subtitle"},e.subTitle)),e.hasBetaBadgeLabel&&(0,k.createElement)(I.BetaBadge,null),(0,k.createElement)("span",{className:"yoast-chevron","aria-hidden":"true"}))),t&&e.children)},le=ie;ie.propTypes={title:R().string.isRequired,children:R().oneOfType([R().node,R().arrayOf(R().node)]).isRequired,prefixIcon:R().object,subTitle:R().string,hasBetaBadgeLabel:R().bool,buttonId:R().string},ie.defaultProps={prefixIcon:null,subTitle:"",hasBetaBadgeLabel:!1,buttonId:null};const ce=({children:e})=>(0,k.createElement)("div",null,e);ce.propTypes={renderPriority:R().number.isRequired,children:R().node.isRequired};const de=ce,ue=({theme:e,location:t,children:s})=>(0,k.createElement)(i.LocationProvider,{value:t},(0,k.createElement)(E.ThemeProvider,{theme:e},s));ue.propTypes={theme:R().object.isRequired,location:R().oneOf(["sidebar","metabox","modal"]).isRequired,children:R().element.isRequired};const pe=ue,he=window.wp.compose,me=window.wp.data,ge=e=>(0,k.createElement)("div",{className:"yoast components-panel__body"},(0,k.createElement)("h2",{className:"components-panel__body-title"},(0,k.createElement)("button",{id:e.id,onClick:e.onClick,className:"components-button components-panel__body-toggle",type:"button"},e.prefixIcon&&(0,k.createElement)("span",{className:"yoast-icon-span",style:{fill:`${e.prefixIcon&&e.prefixIcon.color||""}`}},(0,k.createElement)(I.SvgIcon,{size:e.prefixIcon.size,icon:e.prefixIcon.icon})),(0,k.createElement)("span",{className:"yoast-title-container"},(0,k.createElement)("div",{className:"yoast-title"},e.title),(0,k.createElement)("div",{className:"yoast-subtitle"},e.subTitle)),e.children,e.suffixIcon&&(0,k.createElement)(I.SvgIcon,{size:e.suffixIcon.size,icon:e.suffixIcon.icon}),e.SuffixHeroIcon))),ye=ge;ge.propTypes={onClick:R().func.isRequired,title:R().string.isRequired,id:R().string,subTitle:R().string,suffixIcon:R().object,SuffixHeroIcon:R().object,prefixIcon:R().object,children:R().node},ge.defaultProps={id:"",suffixIcon:null,SuffixHeroIcon:null,prefixIcon:null,subTitle:"",children:null};const fe=({id:e,postTypeName:t,children:s,title:r,isOpen:n,close:o,open:a,shouldCloseOnClickOutside:l,showChangesWarning:c,SuffixHeroIcon:d})=>(0,k.createElement)(v.Fragment,null,n&&(0,k.createElement)(i.LocationProvider,{value:"modal"},(0,k.createElement)(J,{title:r,onRequestClose:o,additionalClassName:"yoast-collapsible-modal yoast-post-settings-modal",id:"id",shouldCloseOnClickOutside:l},(0,k.createElement)("div",{className:"yoast-content-container"},(0,k.createElement)("div",{className:"yoast-modal-content"},s)),(0,k.createElement)("div",{className:"yoast-notice-container"},(0,k.createElement)("hr",null),(0,k.createElement)("div",{className:"yoast-button-container"},c&&(0,k.createElement)("p",null,/* Translators: %s translates to the Post Label in singular form */ (0,u.sprintf)((0,u.__)("Make sure to save your %s for changes to take effect","wordpress-seo"),t)),(0,k.createElement)("button",{className:"yoast-button yoast-button--primary yoast-button--post-settings-modal",type:"button",onClick:o},/* Translators: %s translates to the Post Label in singular form */ (0,u.sprintf)((0,u.__)("Return to your %s","wordpress-seo"),t)))))),(0,k.createElement)(ye,{id:e+"-open-button",title:r,SuffixHeroIcon:d,suffixIcon:d?null:{size:"20px",icon:"pencil-square"},onClick:a}));fe.propTypes={id:R().string.isRequired,postTypeName:R().string.isRequired,children:R().oneOfType([R().node,R().arrayOf(R().node)]).isRequired,title:R().string.isRequired,isOpen:R().bool.isRequired,open:R().func.isRequired,close:R().func.isRequired,shouldCloseOnClickOutside:R().bool,showChangesWarning:R().bool,SuffixHeroIcon:R().object},fe.defaultProps={shouldCloseOnClickOutside:!0,showChangesWarning:!0};const be=fe,we=(0,he.compose)([(0,me.withSelect)(((e,t)=>{const{getPostOrPageString:s,getIsModalOpen:r}=e("yoast-seo/editor");return{postTypeName:s(),isOpen:r(t.id)}})),(0,me.withDispatch)(((e,t)=>{const{openEditorModal:s,closeEditorModal:r}=e("yoast-seo/editor");return{open:()=>s(t.id),close:r}}))])(be),ke=(0,he.compose)([(0,me.withSelect)(((e,t)=>{const{isAlertDismissed:s}=e(t.store||"yoast-seo/editor");return{isAlertDismissed:s(t.alertKey)}})),(0,me.withDispatch)(((e,t)=>{const{dismissAlert:s}=e(t.store||"yoast-seo/editor");return{onDismissed:()=>s(t.alertKey)}}))])(I.Alert),ve=window.yoast.analysisReport,Ee=window.yoast.uiLibrary,xe=k.forwardRef((function(e,t){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),k.createElement("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"}))})),_e=(x().div` min-width: 600px; @media screen and ( max-width: 680px ) { min-width: 0; width: 86vw; } `,x().div` @media screen and ( min-width: 600px ) { max-width: 420px; } `),Re=(x()(I.Icon)` float: ${(0,T.getDirectionalStyle)("right","left")}; margin: ${(0,T.getDirectionalStyle)("0 0 16px 16px","0 16px 16px 0")}; && { width: 150px; height: 150px; @media screen and ( max-width: 680px ) { width: 80px; height: 80px; } } `,window.wp.url),Ie=x().div` padding: 25px 32px 32px; color: #303030; `,Te=x().ul` margin: 0; padding: 0; li { list-style-image: var(--yoast-svg-icon-check); margin: 0.5rem 0 0 1.5rem; line-height: 1.4em; &::marker { font-size: 1.5rem; } } `,Se=x().span` display: block; margin-top: 4px; `,Ce=x().h2` margin-top: 0; margin-bottom: 0.25rem; color: #303030; font-size: 0.8125rem; font-weight: 600; `,Le=x().p` display: block; margin: 0.25rem 0 1rem 0 !important; max-width: 420px; `,Pe=x().hr` margin-top: 1.5rem; margin-bottom: 1rem; border-top: 0; border-bottom: 1px solid #E2E8F0; `,Ae=x().div` text-align: center; `,Oe=x().a` width: 100%; `,Be=(0,T.makeOutboundLink)(Oe);class Ne extends v.Component{constructor(e){super(e),this.state={defaultPrice:"99"}}createBenefitsList(e){return e.length>0&&(0,k.createElement)(Te,{role:"list"},e.map(((e,t)=>(0,k.createElement)("li",{key:`upsell-benefit-${t}`},(0,v.createInterpolateElement)(e,{strong:(0,k.createElement)("strong",null)})))))}render(){const e=(0,me.select)("yoast-seo/editor").isPromotionActive("black-friday-2024-promotion"),{defaultPrice:t}=this.state,s=e?"69.30":null,r=s||t;return(0,k.createElement)(v.Fragment,null,e&&(0,k.createElement)("div",{className:"yst-flex yst-items-center yst-text-lg yst-content-between yst-bg-black yst-text-amber-300 yst-h-9 yst-border-amber-300 yst-border-y yst-border-x-0 yst-border-solid yst-px-6"},(0,k.createElement)("div",{className:"yst-mx-auto"},(0,u.__)("30% OFF - BLACK FRIDAY","wordpress-seo"))),(0,k.createElement)(Ie,null,(0,k.createElement)(Ce,null,this.props.title),(0,k.createElement)(Le,null,this.props.description),(0,k.createElement)(Ae,null,(0,k.createElement)(Be,{...this.props.upsellButton},this.props.upsellButtonText,this.props.upsellButtonHasCaret&&(0,k.createElement)("span",{"aria-hidden":"true",className:"yoast-button-upsell__caret"})),(0,k.createElement)("div",{className:"yst-text-slate-600 yst-my-4"},s&&(0,k.createElement)(v.Fragment,null,(0,k.createElement)("span",{className:"yst-text-slate-500 yst-line-through"},t)," "),(0,k.createElement)("span",{className:"yst-text-slate-900 yst-text-2xl yst-font-bold"},r)," ",(0,u.__)("$ USD / € EUR / £ GBP per year (ex. VAT)","wordpress-seo")),(0,k.createElement)(Se,{id:this.props.upsellButton["aria-describedby"]},this.props.upsellButtonLabel)),(0,k.createElement)(Pe,null),(0,k.createElement)(Ce,null,this.props.benefitsTitle),this.createBenefitsList(this.props.benefits)))}}Ne.propTypes={title:R().node,benefits:R().array,benefitsTitle:R().node,description:R().node,upsellButton:R().object,upsellButtonText:R().string.isRequired,upsellButtonLabel:R().string,upsellButtonHasCaret:R().bool},Ne.defaultProps={title:null,description:null,benefits:[],benefitsTitle:null,upsellButton:{href:"",className:"button button-primary"},upsellButtonLabel:"",upsellButtonHasCaret:!0};const qe=Ne,Me=(0,u.__)("Check your text on even more SEO criteria and get an enhanced keyphrase analysis, making it easier to optimize your content.","wordpress-seo"),Fe=e=>{const{locationContext:t}=(0,i.useRootContext)(),s=(0,Re.addQueryArgs)(wpseoAdminL10n[e.buyLink],{context:t});return(0,k.createElement)(qe,{title:(0,u.__)("Get more help with writing content that ranks","wordpress-seo"),description:e.description,benefitsTitle:(0,u.sprintf)(/* translators: %s expands to 'Yoast SEO Premium'. */ (0,u.__)("%s also gives you:","wordpress-seo"),"Yoast SEO Premium"),benefits:[(0,u.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,u.__)("%1$sAI%2$s: Better SEO titles and meta descriptions, faster.","wordpress-seo"),"<strong>","</strong>"),(0,u.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,u.__)("%1$sMultiple keywords%2$s: Rank higher for more searches.","wordpress-seo"),"<strong>","</strong>"),(0,u.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,u.__)("%1$sSuper fast%2$s internal linking suggestions.","wordpress-seo"),"<strong>","</strong>"),(0,u.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,u.__)("%1$sNo more broken links%2$s: Automatic redirect manager.","wordpress-seo"),"<strong>","</strong>"),(0,u.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,u.__)("%1$sAppealing social previews%2$s people actually want to click on.","wordpress-seo"),"<strong>","</strong>"),(0,u.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,u.__)("%1$s24/7 support%2$s: Also on evenings and weekends.","wordpress-seo"),"<strong>","</strong>")],upsellButtonText:(0,u.sprintf)(/* translators: %s expands to 'Yoast SEO Premium'. */ (0,u.__)("Unlock with %s","wordpress-seo"),"Yoast SEO Premium"),upsellButton:{href:s,className:"yoast-button-upsell",rel:null,"data-ctb-id":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2","data-action":"load-nfd-ctb"},upsellButtonLabel:(0,u.__)("1 year of premium support and updates included!","wordpress-seo")})};Fe.propTypes={buyLink:R().string.isRequired,description:R().string},Fe.defaultProps={description:Me};const Ke=Fe;class De extends v.Component{constructor(e){super(e);const t=this.props.results;this.state={mappedResults:{}},null!==t&&(this.state={mappedResults:z(t,this.props.keywordKey)}),this.handleMarkButtonClick=this.handleMarkButtonClick.bind(this),this.handleEditButtonClick=this.handleEditButtonClick.bind(this),this.handleResultsChange=this.handleResultsChange.bind(this),this.renderHighlightingUpsell=this.renderHighlightingUpsell.bind(this),this.createMarkButton=this.createMarkButton.bind(this)}componentDidUpdate(e){null!==this.props.results&&this.props.results!==e.results&&this.setState({mappedResults:z(this.props.results,this.props.keywordKey)})}createMarkButton({ariaLabel:e,id:t,className:s,status:r,onClick:n,isPressed:o}){return(0,k.createElement)(v.Fragment,null,(0,k.createElement)(I.IconButtonToggle,{marksButtonStatus:r,className:s,onClick:n,id:t,icon:"eye",pressed:o,ariaLabel:e}),this.props.shouldUpsellHighlighting&&(0,k.createElement)("div",{className:"yst-root"},(0,k.createElement)(Ee.Badge,{className:"yst-absolute yst-px-[3px] yst-py-[3px] yst--end-[6.5px] yst--top-[6.5px]",size:"small",variant:"upsell"},(0,k.createElement)(xe,{className:"yst-w-2.5 yst-h-2.5 yst-shrink-0",role:"img","aria-hidden":!0,focusable:!1}))))}deactivateMarker(){this.props.setActiveMarker(null),this.props.setMarkerPauseStatus(!1),this.removeMarkers()}activateMarker(e,t){this.props.setActiveMarker(e),t()}handleMarkButtonClick(e,t){const s=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;this.props.activeAIFixesButton&&this.props.setActiveAIFixesButton(null),s===this.props.activeMarker?this.deactivateMarker():this.activateMarker(s,t)}handleResultsChange(e,t,s){const r=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;r===this.props.activeMarker&&(s?(0,c.isUndefined)(t)||this.activateMarker(r,t):this.deactivateMarker())}focusOnKeyphraseField(e){const t=this.props.keywordKey,s=""===t?"focus-keyword-input-"+e:"yoast-keyword-input-"+t+"-"+e,r=document.getElementById(s);r.focus(),r.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}focusOnGooglePreviewField(e,t){let s;s="metaDescriptionKeyword"===e||"metaDescriptionLength"===e?"description":"titleWidth"===e||"keyphraseInSEOTitle"===e?"title":"slug";const r=document.getElementById("yoast-google-preview-"+s+"-"+t);r.focus(),r.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}handleEditButtonClick(e){const t=this.props.location;"functionWordsInKeyphrase"!==e&&"keyphraseLength"!==e?(["metaDescriptionKeyword","metaDescriptionLength","titleWidth","keyphraseInSEOTitle","slugKeyword"].includes(e)&&this.handleGooglePreviewFocus(t,e),(0,h.doAction)("yoast.focus.input",e)):this.focusOnKeyphraseField(t)}handleGooglePreviewFocus(e,t){if("sidebar"===e)document.getElementById("yoast-search-appearance-modal-open-button").click(),setTimeout((()=>this.focusOnGooglePreviewField(t,"modal")),500);else{const s=document.getElementById("yoast-snippet-editor-metabox");s&&"false"===s.getAttribute("aria-expanded")?(s.click(),setTimeout((()=>this.focusOnGooglePreviewField(t,e)),100)):this.focusOnGooglePreviewField(t,e)}}removeMarkers(){window.YoastSEO.analysis.applyMarks(new p.Paper("",{}),[])}renderHighlightingUpsell(e,t){const s=(0,u.__)("Highlight areas of improvement in your text, no more searching for a needle in a haystack, straight to optimizing! Now also in Elementor!","wordpress-seo");return e&&(0,k.createElement)(J,{title:(0,u.__)("Unlock Premium SEO analysis","wordpress-seo"),onRequestClose:t,additionalClassName:"",className:`${X} yoast-gutenberg-modal__box yoast-gutenberg-modal__no-padding`,id:"yoast-premium-seo-analysis-highlighting-modal",shouldCloseOnClickOutside:!0},(0,k.createElement)(_e,null,(0,k.createElement)(Ke,{buyLink:this.props.highlightingUpsellLink,description:s})))}render(){const{mappedResults:e}=this.state,{errorsResults:t,improvementsResults:s,goodResults:r,considerationsResults:n,problemsResults:o}=e,{upsellResults:a,resultCategoryLabels:i}=this.props,l={errors:(0,u.__)("Errors","wordpress-seo"),problems:(0,u.__)("Problems","wordpress-seo"),improvements:(0,u.__)("Improvements","wordpress-seo"),considerations:(0,u.__)("Considerations","wordpress-seo"),goodResults:(0,u.__)("Good results","wordpress-seo")},c=Object.assign(l,i);let d=this.props.marksButtonStatus;return"enabled"===d&&this.props.shortcodesForParsing.length>0&&(d="disabled"),(0,k.createElement)(v.Fragment,null,(0,k.createElement)(ve.ContentAnalysis,{errorsResults:t,problemsResults:o,upsellResults:a,improvementsResults:s,considerationsResults:n,goodResults:r,activeMarker:this.props.activeMarker,onMarkButtonClick:this.handleMarkButtonClick,onEditButtonClick:this.handleEditButtonClick,marksButtonClassName:this.props.marksButtonClassName,editButtonClassName:this.props.editButtonClassName,marksButtonStatus:d,headingLevel:3,keywordKey:this.props.keywordKey,isPremium:this.props.isPremium,resultCategoryLabels:c,onResultChange:this.handleResultsChange,shouldUpsellHighlighting:this.props.shouldUpsellHighlighting,renderAIFixesButton:this.props.renderAIFixesButton,renderHighlightingUpsell:this.renderHighlightingUpsell,markButtonFactory:this.createMarkButton}))}}De.propTypes={results:R().array,upsellResults:R().array,marksButtonClassName:R().string,editButtonClassName:R().string,marksButtonStatus:R().oneOf(["enabled","disabled","hidden"]),setActiveMarker:R().func.isRequired,setMarkerPauseStatus:R().func.isRequired,setActiveAIFixesButton:R().func.isRequired,activeMarker:R().string,activeAIFixesButton:R().string,keywordKey:R().string,location:R().string,isPremium:R().bool,resultCategoryLabels:R().shape({errors:R().string,problems:R().string,improvements:R().string,considerations:R().string,goodResults:R().string}),shortcodesForParsing:R().array,shouldUpsellHighlighting:R().bool,highlightingUpsellLink:R().string,renderAIFixesButton:R().func},De.defaultProps={results:null,upsellResults:[],marksButtonStatus:"enabled",marksButtonClassName:"",editButtonClassName:"",activeMarker:null,activeAIFixesButton:null,keywordKey:"",location:"",isPremium:!1,resultCategoryLabels:{},shortcodesForParsing:[],shouldUpsellHighlighting:!1,highlightingUpsellLink:"",renderAIFixesButton:()=>{}};const $e=De,We=(0,he.compose)([(0,me.withSelect)((e=>{const{getActiveMarker:t,getIsPremium:s,getShortcodesForParsing:r,getActiveAIFixesButton:n}=e("yoast-seo/editor");return{activeMarker:t(),isPremium:s(),shortcodesForParsing:r(),activeAIFixesButton:n()}})),(0,me.withDispatch)((e=>{const{setActiveMarker:t,setMarkerPauseStatus:s,setActiveAIFixesButton:r}=e("yoast-seo/editor");return{setActiveMarker:t,setMarkerPauseStatus:s,setActiveAIFixesButton:r}}))])($e),je=window.yoast.relatedKeyphraseSuggestions;function He(e){const{requestLimitReached:t,isSuccess:s,response:r,requestHasData:n,relatedKeyphrases:o}=e;return t?"requestLimitReached":!s&&function(e){return"invalid_json"===(null==e?void 0:e.code)||"fetch_error"===(null==e?void 0:e.code)||!(0,c.isEmpty)(e)&&"error"in e}(r)?"requestFailed":n?function(e){return e&&e.length>=4}(o)?"maxRelatedKeyphrases":void 0:"requestEmpty"}function Ue(e){var t,s;const{keyphrase:r="",relatedKeyphrases:n=[],renderAction:o=null,requestLimitReached:a=!1,countryCode:i="us",setCountry:l,newRequest:c,response:d={},isRtl:u=!1,userLocale:p="en_US",isPending:h=!1,isPremium:m=!1,semrushUpsellLink:g="",premiumUpsellLink:y=""}=e,[f,b]=(0,v.useState)(i),w=(0,v.useCallback)((async()=>{c(i,r),b(i)}),[i,r,c]);return(0,k.createElement)(Ee.Root,{context:{isRtl:u}},!a&&!m&&(0,k.createElement)(je.PremiumUpsell,{url:y,className:"yst-mb-4"}),!a&&(0,k.createElement)(je.CountrySelector,{countryCode:i,activeCountryCode:f,onChange:l,onClick:w,className:"yst-mb-4",userLocale:p.split("_")[0]}),!h&&(0,k.createElement)(je.UserMessage,{variant:He(e),upsellLink:g}),(0,k.createElement)(je.KeyphrasesTable,{relatedKeyphrases:n,columnNames:null==d||null===(t=d.results)||void 0===t?void 0:t.columnNames,data:null==d||null===(s=d.results)||void 0===s?void 0:s.rows,isPending:h,renderButton:o,className:"yst-mt-4"}))}Ue.propTypes={keyphrase:R().string,relatedKeyphrases:R().array,renderAction:R().func,requestLimitReached:R().bool,countryCode:R().string.isRequired,setCountry:R().func.isRequired,newRequest:R().func.isRequired,response:R().object,isRtl:R().bool,userLocale:R().string,isPending:R().bool,isPremium:R().bool,semrushUpsellLink:R().string,premiumUpsellLink:R().string};const Ye=(0,he.compose)([(0,me.withSelect)((e=>{const{getFocusKeyphrase:t,getSEMrushSelectedCountry:s,getSEMrushRequestLimitReached:r,getSEMrushRequestResponse:n,getSEMrushRequestIsSuccess:o,getSEMrushIsRequestPending:a,getSEMrushRequestHasData:i,getSEMrushRequestKeyphrase:l,getPreference:c,getIsPremium:d,selectLinkParams:u}=e("yoast-seo/editor");return{keyphrase:t(),countryCode:s(),requestLimitReached:r(),response:n(),isSuccess:o(),isPending:a(),requestHasData:i(),lastRequestKeyphrase:l(),isRtl:c("isRtl",!1),userLocale:c("userLocale","en_US"),isPremium:d(),semrushUpsellLink:(0,Re.addQueryArgs)("https://yoa.st/semrush-prices",u()),premiumUpsellLink:(0,Re.addQueryArgs)("https://yoa.st/413",u())}})),(0,me.withDispatch)((e=>{const{setSEMrushChangeCountry:t,setSEMrushNewRequest:s}=e("yoast-seo/editor");return{setCountry:e=>{t(e)},newRequest:(e,t)=>{s(e,t)}}}))])(Ue),ze=window.moment;var Ve=s.n(ze),Ge=s(6746);const Qe=(0,T.makeOutboundLink)(),Xe=e=>{const t=(0,u.sprintf)(/* translators: %d expands to the amount of allowed keyphrases on a free account, %s expands to a link to Wincher plans. */ (0,u.__)("You've reached the maximum amount of %d keyphrases you can add to your Wincher account. If you wish to add more keyphrases, please %s.","wordpress-seo"),e.limit,"{{updateWincherPlanLink/}}");return(0,k.createElement)(I.Alert,{type:"error"},(0,Ge.Z)({mixedString:t,components:{updateWincherPlanLink:(0,k.createElement)(Qe,{href:wpseoAdminGlobalL10n["links.wincher.pricing"]},(0,u.sprintf)(/* translators: %s : Expands to "Wincher". */ (0,u.__)("upgrade your %s plan","wordpress-seo"),"Wincher"))}}))};Xe.propTypes={limit:R().number},Xe.defaultProps={limit:10};const Ze=Xe,Je=()=>(0,k.createElement)(I.Alert,{type:"error"},(0,u.__)("Something went wrong while tracking the ranking position(s) of your page. Please try again later.","wordpress-seo")),et=window.wp.apiFetch;var tt=s.n(et);async function st(e,t,s,r=200){try{const n=await e();return!!n&&(n.status===r?t(n):s(n))}catch(e){console.error(e.message)}}async function rt(e){try{return await tt()(e)}catch(e){return e.error&&e.status?e:e instanceof Response&&await e.json()}}async function nt(e){return(0,c.isArray)(e)||(e=[e]),await rt({path:"yoast/v1/wincher/keyphrases/track",method:"POST",data:{keyphrases:e}})}const ot=x().p` color: ${S.colors.$color_pink_dark}; font-size: 14px; font-weight: 700; margin: 13px 0 10px; `,at=x()(I.SvgIcon)` margin-right: 5px; vertical-align: middle; `,it=x().button` position: absolute; top: 9px; right: 9px; border: none; background: none; cursor: pointer; `,lt=x().p` font-size: 13px; font-weight: 500; margin: 10px 0 13px; `,ct=x().div` position: relative; background: ${e=>e.isTitleShortened?"#F5F7F7":"transparent"}; border: 1px solid #C7C7C7; border-left: 4px solid${S.colors.$color_pink_dark}; padding: 0 16px; margin-bottom: 1.5em; `,dt=e=>{const[t,s]=(0,v.useState)(null);return(0,v.useEffect)((()=>{e&&!t&&async function(){return await rt({path:"yoast/v1/wincher/account/limit",method:"GET"})}().then((e=>s(e)))}),[t]),t};dt.propTypes={limit:R().bool.isRequired};const ut=({limit:e,usage:t,isTitleShortened:s,isFreeAccount:r})=>{const n=(0,u.sprintf)( /* Translators: %1$s expands to the number of used keywords. * %2$s expands to the account keywords limit. */ (0,u.__)("Your are tracking %1$s out of %2$s keyphrases included in your free account.","wordpress-seo"),t,e),o=(0,u.sprintf)( /* Translators: %1$s expands to the number of used keywords. * %2$s expands to the account keywords limit. */ (0,u.__)("Your are tracking %1$s out of %2$s keyphrases included in your account.","wordpress-seo"),t,e),a=r?n:o,i=(0,u.sprintf)( /* Translators: %1$s expands to the number of used keywords. * %2$s expands to the account keywords limit. */ (0,u.__)("Keyphrases tracked: %1$s/%2$s","wordpress-seo"),t,e),l=s?i:a;return(0,k.createElement)(ot,null,s&&(0,k.createElement)(at,{icon:"exclamation-triangle",color:S.colors.$color_pink_dark,size:"14px"}),l)};ut.propTypes={limit:R().number.isRequired,usage:R().number.isRequired,isTitleShortened:R().bool,isFreeAccount:R().bool};const pt=(0,T.makeOutboundLink)(),ht=({discount:e,months:t})=>{const s=(0,k.createElement)(pt,{href:wpseoAdminGlobalL10n["links.wincher.upgrade"],style:{fontWeight:600}},(0,u.sprintf)(/* Translators: %s : Expands to "Wincher". */ (0,u.__)("Click here to upgrade your %s plan","wordpress-seo"),"Wincher"));if(!e||!t)return(0,k.createElement)(lt,null,s);const r=100*e,n=(0,u.sprintf)( /* Translators: %1$s expands to upgrade account link. * %2$s expands to the upgrade discount value. * %3$s expands to the upgrade discount duration e.g. 2 months. */ (0,u.__)("%1$s and get an exclusive %2$s discount for %3$s month(s).","wordpress-seo"),"{{wincherAccountUpgradeLink/}}",r+"%",t);return(0,k.createElement)(lt,null,(0,Ge.Z)({mixedString:n,components:{wincherAccountUpgradeLink:s}}))};ht.propTypes={discount:R().number,months:R().number};const mt=({onClose:e,isTitleShortened:t,trackingInfo:s})=>{const r=(()=>{const[e,t]=(0,v.useState)(null);return(0,v.useEffect)((()=>{e||async function(){return await rt({path:"yoast/v1/wincher/account/upgrade-campaign",method:"GET"})}().then((e=>t(e)))}),[e]),e})();if(null===s)return null;const{limit:n,usage:o}=s;if(!(n&&o/n>=.8))return null;const a=Boolean(null==r?void 0:r.discount);return(0,k.createElement)(ct,{isTitleShortened:t},e&&(0,k.createElement)(it,{type:"button","aria-label":(0,u.__)("Close the upgrade callout","wordpress-seo"),onClick:e},(0,k.createElement)(I.SvgIcon,{icon:"times-circle",color:S.colors.$color_pink_dark,size:"14px"})),(0,k.createElement)(ut,{...s,isTitleShortened:t,isFreeAccount:a}),(0,k.createElement)(ht,{discount:null==r?void 0:r.discount,months:null==r?void 0:r.months}))};mt.propTypes={onClose:R().func,isTitleShortened:R().bool,trackingInfo:R().object};const gt=mt,yt=()=>(0,k.createElement)(I.Alert,{type:"success"},(0,u.sprintf)(/* translators: %s: Expands to "Wincher". */ (0,u.__)("You have successfully connected to %s! You can now track the SEO performance for the keyphrase(s) of this page.","wordpress-seo"),"Wincher")),ft=()=>(0,k.createElement)(I.Alert,{type:"info"},(0,u.sprintf)(/* translators: %s: Expands to "Wincher". */ (0,u.__)("%s is currently tracking the ranking position(s) of your page. This may take a few minutes. Please wait or check back later.","wordpress-seo"),"Wincher")),bt=({data:e,mapChartDataToTableData:t,dataTableCaption:s,dataTableHeaderLabels:r,isDataTableVisuallyHidden:n})=>e.length!==r.length?(0,k.createElement)("p",null,(0,u.__)("The number of headers and header labels don't match.","wordpress-seo")):(0,k.createElement)("div",{className:n?"screen-reader-text":null},(0,k.createElement)("table",null,(0,k.createElement)("caption",null,s),(0,k.createElement)("thead",null,(0,k.createElement)("tr",null,r.map(((e,t)=>(0,k.createElement)("th",{key:t},e))))),(0,k.createElement)("tbody",null,(0,k.createElement)("tr",null,e.map(((e,s)=>(0,k.createElement)("td",{key:s},t(e.y))))))));bt.propTypes={data:R().arrayOf(R().shape({x:R().number,y:R().number})).isRequired,mapChartDataToTableData:R().func,dataTableCaption:R().string.isRequired,dataTableHeaderLabels:R().array.isRequired,isDataTableVisuallyHidden:R().bool},bt.defaultProps={mapChartDataToTableData:null,isDataTableVisuallyHidden:!0};const wt=bt,kt=({data:e,width:t,height:s,fillColor:r,strokeColor:n,strokeWidth:o,className:a,mapChartDataToTableData:i,dataTableCaption:l,dataTableHeaderLabels:c,isDataTableVisuallyHidden:d})=>{const u=Math.max(1,Math.max(...e.map((e=>e.x)))),p=Math.max(1,Math.max(...e.map((e=>e.y)))),h=s-o,m=e.map((e=>`${e.x/u*t},${h-e.y/p*h+o}`)).join(" "),g=`0,${h+o} `+m+` ${t},${h+o}`;return(0,k.createElement)(v.Fragment,null,(0,k.createElement)("svg",{width:t,height:s,viewBox:`0 0 ${t} ${s}`,className:a,role:"img","aria-hidden":"true",focusable:"false"},(0,k.createElement)("polygon",{fill:r,points:g}),(0,k.createElement)("polyline",{fill:"none",stroke:n,strokeWidth:o,strokeLinejoin:"round",strokeLinecap:"round",points:m})),i&&(0,k.createElement)(wt,{data:e,mapChartDataToTableData:i,dataTableCaption:l,dataTableHeaderLabels:c,isDataTableVisuallyHidden:d}))};kt.propTypes={data:R().arrayOf(R().shape({x:R().number,y:R().number})).isRequired,width:R().number.isRequired,height:R().number.isRequired,fillColor:R().string,strokeColor:R().string,strokeWidth:R().number,className:R().string,mapChartDataToTableData:R().func,dataTableCaption:R().string.isRequired,dataTableHeaderLabels:R().array.isRequired,isDataTableVisuallyHidden:R().bool},kt.defaultProps={fillColor:null,strokeColor:"#000000",strokeWidth:1,className:"",mapChartDataToTableData:null,isDataTableVisuallyHidden:!0};const vt=kt,Et=()=>(0,k.createElement)("p",{className:"yoast-wincher-seo-performance-modal__loading-message"},(0,u.__)("Tracking the ranking position...","wordpress-seo")," ",(0,k.createElement)(I.SvgIcon,{icon:"loading-spinner"})),xt=x()(I.SvgIcon)` margin-left: 2px; flex-shrink: 0; rotate: ${e=>e.isImproving?"-90deg":"90deg"}; `,_t=x().span` color: ${e=>e.isImproving?"#69AB56":"#DC3332"}; font-size: 13px; font-weight: 600; line-height: 20px; margin-right: 2px; margin-left: 12px; `,Rt=x().td` padding-right: 0 !important; & > div { margin: 0px; } `,It=x().td` padding-left: 2px !important; `,Tt=x().td.attrs({className:"yoast-table--nopadding"})` & > div { justify-content: center; } `,St=x().div` display: flex; align-items: center; & > a { box-sizing: border-box; } `,Ct=x().button` background: none; color: inherit; border: none; padding: 0; font: inherit; cursor: pointer; outline: inherit; display: flex; align-items: center; `,Lt=x().tr` background-color: ${e=>e.isEnabled?"#FFFFFF":"#F9F9F9"} !important; `;function Pt(e){return Math.round(100*e)}function At({chartData:e}){if((0,c.isEmpty)(e)||(0,c.isEmpty)(e.position))return"?";const t=function(e){return Array.from({length:e.position.history.length},((e,t)=>t+1)).map((e=>(0,u.sprintf)((0,u._n)("%d day","%d days",e,"wordpress-seo"),e)))}(e),s=e.position.history.map(((e,t)=>({x:t,y:101-e.value})));return(0,k.createElement)(vt,{width:66,height:24,data:s,strokeWidth:1.8,strokeColor:"#498afc",fillColor:"#ade3fc",mapChartDataToTableData:Pt,dataTableCaption:(0,u.__)("Keyphrase position in the last 90 days on a scale from 0 to 100.","wordpress-seo"),dataTableHeaderLabels:t})}At.propTypes={chartData:R().object},At.defaultProps={chartData:{}};const Ot=({rowData:e})=>{var t;if(null==e||null===(t=e.position)||void 0===t||!t.change)return(0,k.createElement)(At,{chartData:e});const s=e.position.change<0;return(0,k.createElement)(v.Fragment,null,(0,k.createElement)(At,{chartData:e}),(0,k.createElement)(_t,{isImproving:s},Math.abs(e.position.change)),(0,k.createElement)(xt,{icon:"caret-right",color:s?"#69AB56":"#DC3332",size:"14px",isImproving:s}))};function Bt(e){var t;const{keyphrase:s,rowData:r,onTrackKeyphrase:n,onUntrackKeyphrase:o,isFocusKeyphrase:a,isDisabled:i,isLoading:l,isSelected:d,onSelectKeyphrases:p}=e,h=!(0,c.isEmpty)(r),m=!(0,c.isEmpty)(null==r||null===(t=r.position)||void 0===t?void 0:t.history),g=(0,v.useCallback)((()=>{i||(h?o(s,r.id):n(s))}),[s,n,o,h,r,i]),y=(0,v.useCallback)((()=>{p((e=>d?e.filter((e=>e!==s)):e.concat(s)))}),[p,d,s]);return(0,k.createElement)(Lt,{isEnabled:h},(0,k.createElement)(Rt,null,m&&(0,k.createElement)(I.Checkbox,{id:"select-"+s,onChange:y,checked:d,label:""})),(0,k.createElement)(It,null,s,a&&(0,k.createElement)("span",null,"*")),function(e){const{rowData:t,websiteId:s,keyphrase:r,onSelectKeyphrases:n}=e,o=(0,v.useCallback)((()=>{n([r])}),[n,r]),a=!(0,c.isEmpty)(t),i=t&&t.updated_at&&Ve()(t.updated_at)>=Ve()().subtract(7,"days"),l=t?(0,u.sprintf)("https://app.wincher.com/websites/%s/keywords?serp=%s&utm_medium=plugin&utm_source=yoast&referer=yoast&partner=yoast",s,t.id):null;return a?i?(0,k.createElement)(v.Fragment,null,(0,k.createElement)("td",null,(0,k.createElement)(St,null,function(e){return!e||!e.position||e.position.value>100?"> 100":e.position.value}(t),(0,k.createElement)(I.ButtonStyledLink,{variant:"secondary",href:l,style:{height:28,marginLeft:12},rel:"noopener",target:"_blank"},(0,u.__)("View","wordpress-seo")))),(0,k.createElement)("td",{className:"yoast-table--nopadding"},(0,k.createElement)(Ct,{type:"button",onClick:o},(0,k.createElement)(Ot,{rowData:t}))),(0,k.createElement)("td",null,(d=t.updated_at,Ve()(d).fromNow()))):(0,k.createElement)("td",{className:"yoast-table--nopadding",colSpan:"3"},(0,k.createElement)(Et,null)):(0,k.createElement)("td",{className:"yoast-table--nopadding",colSpan:"3"},(0,k.createElement)("i",null,(0,u.__)("Activate tracking to show the ranking position","wordpress-seo")));var d}(e),(0,k.createElement)(Tt,null,function({keyphrase:e,isEnabled:t,toggleAction:s,isLoading:r}){return r?(0,k.createElement)(I.SvgIcon,{icon:"loading-spinner"}):(0,k.createElement)(I.Toggle,{id:`toggle-keyphrase-tracking-${e}`,className:"wincher-toggle",isEnabled:t,onSetToggleState:s,showToggleStateLabel:!1})}({keyphrase:s,isEnabled:h,toggleAction:g,isLoading:l})))}Ot.propTypes={rowData:R().object},Bt.propTypes={rowData:R().object,keyphrase:R().string.isRequired,onTrackKeyphrase:R().func,onUntrackKeyphrase:R().func,isFocusKeyphrase:R().bool,isDisabled:R().bool,isLoading:R().bool,websiteId:R().string,isSelected:R().bool.isRequired,onSelectKeyphrases:R().func.isRequired},Bt.defaultProps={rowData:{},onTrackKeyphrase:()=>{},onUntrackKeyphrase:()=>{},isFocusKeyphrase:!1,isDisabled:!1,isLoading:!1,websiteId:""};const Nt=(0,T.makeOutboundLink)(),qt=x().span` display: block; font-style: italic; @media (min-width: 782px) { display: inline; position: absolute; ${(0,T.getDirectionalStyle)("right","left")}: 8px; } `,Mt=x().div` width: 100%; overflow-y: auto; `,Ft=x().th` pointer-events: ${e=>e.isDisabled?"none":"initial"}; padding-right: 0 !important; & > div { margin: 0px; } `,Kt=x().th` padding-left: 2px !important; `,Dt=e=>{const t=(0,v.useRef)();return(0,v.useEffect)((()=>{t.current=e})),t.current},$t=(0,c.debounce)((async function(e=null,t=null,s=null,r){return await rt({path:"yoast/v1/wincher/keyphrases",method:"POST",data:{keyphrases:e,permalink:s,startAt:t},signal:r})}),500,{leading:!0}),Wt=e=>{const{addTrackedKeyphrase:t,isLoggedIn:s,keyphrases:r,permalink:n,removeTrackedKeyphrase:o,setKeyphraseLimitReached:a,setRequestFailed:i,setRequestSucceeded:l,setTrackedKeyphrases:d,setHasTrackedAll:p,trackAll:h,trackedKeyphrases:m,isNewlyAuthenticated:g,websiteId:y,focusKeyphrase:f,newRequest:b,startAt:w,selectedKeyphrases:E,onSelectKeyphrases:x}=e,_=(0,v.useRef)(),R=(0,v.useRef)(),T=(0,v.useRef)(!1),[S,C]=(0,v.useState)([]),L=(0,v.useCallback)((e=>{const t=e.toLowerCase();return m&&!(0,c.isEmpty)(m)&&m.hasOwnProperty(t)?m[t]:null}),[m]),P=(0,v.useMemo)((()=>async()=>{await st((()=>(R.current&&R.current.abort(),R.current="undefined"==typeof AbortController?null:new AbortController,$t(r,w,n,R.current.signal))),(e=>{l(e),d(e.results)}),(e=>{i(e)}))}),[l,i,d,r,n,w]),A=(0,v.useCallback)((async e=>{const s=(Array.isArray(e)?e:[e]).map((e=>e.toLowerCase()));C((e=>[...e,...s])),await st((()=>nt(s)),(e=>{l(e),t(e.results),P()}),(e=>{400===e.status&&e.limit&&a(e.limit),i(e)}),201),C((e=>(0,c.without)(e,...s)))}),[l,i,a,t,P]),O=(0,v.useCallback)((async(e,t)=>{e=e.toLowerCase(),C((t=>[...t,e])),await st((()=>async function(e){return await rt({path:"yoast/v1/wincher/keyphrases/untrack",method:"DELETE",data:{keyphraseID:e}})}(t)),(t=>{l(t),o(e)}),(e=>{i(e)})),C((t=>(0,c.without)(t,e)))}),[l,o,i]),B=(0,v.useCallback)((async e=>{b(),await A(e)}),[b,A]),N=Dt(n),q=Dt(r),M=Dt(w),F=n&&w;(0,v.useEffect)((()=>{s&&F&&(n!==N||(0,c.difference)(r,q).length||w!==M)&&P()}),[s,n,N,r,q,P,F,w,M]),(0,v.useEffect)((()=>{if(s&&h&&null!==m){const e=r.filter((e=>!L(e)));e.length&&A(e),p()}}),[s,h,m,A,p,L,r]),(0,v.useEffect)((()=>{g&&!T.current&&(P(),T.current=!0)}),[g,P]),(0,v.useEffect)((()=>{if(s&&!(0,c.isEmpty)(m))return(0,c.filter)(m,(e=>(0,c.isEmpty)(e.updated_at))).length>0&&(_.current=setInterval((()=>{P()}),1e4)),()=>{clearInterval(_.current)}}),[s,m,P]);const K=s&&null===m,D=(0,v.useMemo)((()=>(0,c.isEmpty)(m)?[]:Object.values(m).filter((e=>{var t;return!(0,c.isEmpty)(null==e||null===(t=e.position)||void 0===t?void 0:t.history)})).map((e=>e.keyword))),[m]),$=(0,v.useMemo)((()=>E.length>0&&D.length>0&&D.every((e=>E.includes(e)))),[E,D]),W=(0,v.useCallback)((()=>{x($?[]:D)}),[x,$,D]),j=(0,v.useMemo)((()=>(0,c.orderBy)(r,[e=>Object.values(m||{}).map((e=>e.keyword)).includes(e)],["desc"])),[r,m]);return r&&!(0,c.isEmpty)(r)&&(0,k.createElement)(v.Fragment,null,(0,k.createElement)(Mt,null,(0,k.createElement)("table",{className:"yoast yoast-table"},(0,k.createElement)("thead",null,(0,k.createElement)("tr",null,(0,k.createElement)(Ft,{isDisabled:0===D.length},(0,k.createElement)(I.Checkbox,{id:"select-all",onChange:W,checked:$,label:""})),(0,k.createElement)(Kt,{scope:"col",abbr:(0,u.__)("Keyphrase","wordpress-seo")},(0,u.__)("Keyphrase","wordpress-seo")),(0,k.createElement)("th",{scope:"col",abbr:(0,u.__)("Position","wordpress-seo")},(0,u.__)("Position","wordpress-seo")),(0,k.createElement)("th",{scope:"col",abbr:(0,u.__)("Position over time","wordpress-seo")},(0,u.__)("Position over time","wordpress-seo")),(0,k.createElement)("th",{scope:"col",abbr:(0,u.__)("Last updated","wordpress-seo")},(0,u.__)("Last updated","wordpress-seo")),(0,k.createElement)("th",{scope:"col",abbr:(0,u.__)("Tracking","wordpress-seo")},(0,u.__)("Tracking","wordpress-seo")))),(0,k.createElement)("tbody",null,j.map(((e,t)=>(0,k.createElement)(Bt,{key:`trackable-keyphrase-${t}`,keyphrase:e,onTrackKeyphrase:B,onUntrackKeyphrase:O,rowData:L(e),isFocusKeyphrase:e===f.trim().toLowerCase(),websiteId:y,isDisabled:!s,isLoading:K||S.indexOf(e.toLowerCase())>=0,isSelected:E.includes(e),onSelectKeyphrases:x})))))),(0,k.createElement)("p",{style:{marginBottom:0,position:"relative"}},(0,k.createElement)(Nt,{href:wpseoAdminGlobalL10n["links.wincher.login"]},(0,u.sprintf)(/* translators: %s expands to Wincher */ (0,u.__)("Get more insights over at %s","wordpress-seo"),"Wincher")),(0,k.createElement)(qt,null,(0,u.__)("* focus keyphrase","wordpress-seo"))))};Wt.propTypes={addTrackedKeyphrase:R().func.isRequired,isLoggedIn:R().bool,isNewlyAuthenticated:R().bool,keyphrases:R().array,newRequest:R().func.isRequired,removeTrackedKeyphrase:R().func.isRequired,setRequestFailed:R().func.isRequired,setKeyphraseLimitReached:R().func.isRequired,setRequestSucceeded:R().func.isRequired,setTrackedKeyphrases:R().func.isRequired,setHasTrackedAll:R().func.isRequired,trackAll:R().bool,trackedKeyphrases:R().object,websiteId:R().string,permalink:R().string.isRequired,focusKeyphrase:R().string,startAt:R().string,selectedKeyphrases:R().arrayOf(R().string).isRequired,onSelectKeyphrases:R().func.isRequired},Wt.defaultProps={isLoggedIn:!1,isNewlyAuthenticated:!1,keyphrases:[],trackAll:!1,websiteId:"",focusKeyphrase:""};const jt=Wt,Ht=(0,he.compose)([(0,me.withSelect)((e=>{const{getWincherWebsiteId:t,getWincherTrackableKeyphrases:s,getWincherLoginStatus:r,getWincherPermalink:n,getFocusKeyphrase:o,isWincherNewlyAuthenticated:a,shouldWincherTrackAll:i}=e("yoast-seo/editor");return{focusKeyphrase:o(),keyphrases:s(),isLoggedIn:r(),trackAll:i(),websiteId:t(),isNewlyAuthenticated:a(),permalink:n()}})),(0,me.withDispatch)((e=>{const{setWincherNewRequest:t,setWincherRequestSucceeded:s,setWincherRequestFailed:r,setWincherSetKeyphraseLimitReached:n,setWincherTrackedKeyphrases:o,setWincherTrackingForKeyphrase:a,setWincherTrackAllKeyphrases:i,unsetWincherTrackingForKeyphrase:l}=e("yoast-seo/editor");return{newRequest:()=>{t()},setRequestSucceeded:e=>{s(e)},setRequestFailed:e=>{r(e)},setKeyphraseLimitReached:e=>{n(e)},addTrackedKeyphrase:e=>{a(e)},removeTrackedKeyphrase:e=>{l(e)},setTrackedKeyphrases:e=>{o(e)},setHasTrackedAll:()=>{i(!1)}}}))])(jt),Ut=(0,T.makeOutboundLink)(),Yt=(0,T.makeOutboundLink)(),zt=()=>{const e=(0,u.sprintf)((0,u.__)(/* translators: %1$s expands to a link to Wincher, %2$s expands to a link to the keyphrase tracking article on Yoast.com */ "With %1$s you can track the ranking position of your page in the search results based on your keyphrase(s). %2$s","wordpress-seo"),"{{wincherLink/}}","{{wincherReadMoreLink/}}");return(0,k.createElement)("p",null,(0,Ge.Z)({mixedString:e,components:{wincherLink:(0,k.createElement)(Ut,{href:wpseoAdminGlobalL10n["links.wincher.website"]},"Wincher"),wincherReadMoreLink:(0,k.createElement)(Yt,{href:wpseoAdminL10n["shortlinks.wincher.seo_performance"]},(0,u.__)("Read more about keyphrase tracking with Wincher","wordpress-seo"))}}))},Vt=()=>(0,k.createElement)(I.Alert,{type:"error"},(0,u.__)("No keyphrase has been set. Please set a keyphrase first.","wordpress-seo")),Gt=()=>(0,k.createElement)(I.Alert,{type:"info"},(0,u.sprintf)(/* translators: %s: Expands to "Wincher". */ (0,u.__)("Automatic tracking of keyphrases is enabled. Your keyphrase(s) will automatically be tracked by %s when you publish your post.","wordpress-seo"),"Wincher"));class Qt{constructor(e,t={},s={}){this.url=e,this.origin=new URL(e).origin,this.eventHandlers=Object.assign({success:{type:"",callback:()=>{}},error:{type:"",callback:()=>{}}},t),this.options=Object.assign({height:570,width:340,title:""},s),this.popup=null,this.createPopup=this.createPopup.bind(this),this.messageHandler=this.messageHandler.bind(this),this.getPopup=this.getPopup.bind(this)}createPopup(){const{height:e,width:t,title:s}=this.options,r=["top="+(window.top.outerHeight/2+window.top.screenY-e/2),"left="+(window.top.outerWidth/2+window.top.screenX-t/2),"width="+t,"height="+e,"resizable=1","scrollbars=1","status=0"];this.popup&&!this.popup.closed||(this.popup=window.open(this.url,s,r.join(","))),this.popup&&this.popup.focus(),window.addEventListener("message",this.messageHandler,!1)}async messageHandler(e){const{data:t,source:s,origin:r}=e;r===this.origin&&this.popup===s&&(t.type===this.eventHandlers.success.type&&(this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),await this.eventHandlers.success.callback(t)),t.type===this.eventHandlers.error.type&&(this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),await this.eventHandlers.error.callback(t)))}getPopup(){return this.popup}isClosed(){return!this.popup||this.popup.closed}focus(){this.isClosed()||this.popup.focus()}}const Xt=e=>{const t=(0,u.sprintf)(/* translators: %s expands to a link to open the Wincher login popup. */ (0,u.__)("It seems like something went wrong when retrieving your website's data. Please %s and try again.","wordpress-seo"),"{{reconnectToWincher/}}","Wincher");return(0,k.createElement)(I.Alert,{type:"error",className:e.className},(0,Ge.Z)({mixedString:t,components:{reconnectToWincher:(0,k.createElement)("a",{href:"#",onClick:t=>{t.preventDefault(),e.onReconnect()}},(0,u.sprintf)(/* translators: %s : Expands to "Wincher". */ (0,u.__)("reconnect to %s","wordpress-seo"),"Wincher"))}}))};Xt.propTypes={onReconnect:R().func.isRequired,className:R().string},Xt.defaultProps={className:""};const Zt=Xt,Jt=()=>(0,k.createElement)(I.Alert,{type:"error"},(0,u.__)("Before you can track your SEO performance make sure to set either the post’s title and save it as a draft or manually set the post’s slug.","wordpress-seo")),es=window.yoast["chart.js"],ts="label";function ss(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function rs(e,t){e.labels=t}function ns(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ts;const r=[];e.datasets=t.map((t=>{const n=e.datasets.find((e=>e[s]===t[s]));return n&&t.data&&!r.includes(n)?(r.push(n),Object.assign(n,t),n):{...t}}))}function os(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ts;const s={labels:[],datasets:[]};return rs(s,e.labels),ns(s,e.datasets,t),s}function as(e,t){const{height:s=150,width:r=300,redraw:n=!1,datasetIdKey:o,type:a,data:i,options:l,plugins:c=[],fallbackContent:d,updateMode:u,...p}=e,h=(0,k.useRef)(null),m=(0,k.useRef)(),g=()=>{h.current&&(m.current=new es.Chart(h.current,{type:a,data:os(i,o),options:l&&{...l},plugins:c}),ss(t,m.current))},y=()=>{ss(t,null),m.current&&(m.current.destroy(),m.current=null)};return(0,k.useEffect)((()=>{!n&&m.current&&l&&function(e,t){const s=e.options;s&&t&&Object.assign(s,t)}(m.current,l)}),[n,l]),(0,k.useEffect)((()=>{!n&&m.current&&rs(m.current.config.data,i.labels)}),[n,i.labels]),(0,k.useEffect)((()=>{!n&&m.current&&i.datasets&&ns(m.current.config.data,i.datasets,o)}),[n,i.datasets]),(0,k.useEffect)((()=>{m.current&&(n?(y(),setTimeout(g)):m.current.update(u))}),[n,l,i.labels,i.datasets,u]),(0,k.useEffect)((()=>{m.current&&(y(),setTimeout(g))}),[a]),(0,k.useEffect)((()=>(g(),()=>y())),[]),k.createElement("canvas",Object.assign({ref:h,role:"img",height:s,width:r},p),d)}const is=(0,k.forwardRef)(as);function ls(e,t){return es.Chart.register(t),(0,k.forwardRef)(((t,s)=>k.createElement(is,Object.assign({},t,{ref:s,type:e}))))}const cs=ls("line",es.LineController),ds={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};es._adapters._date.override("function"==typeof Ve()?{_id:"moment",formats:function(){return ds},parse:function(e,t){return"string"==typeof e&&"string"==typeof t?e=Ve()(e,t):e instanceof Ve()||(e=Ve()(e)),e.isValid()?e.valueOf():null},format:function(e,t){return Ve()(e).format(t)},add:function(e,t,s){return Ve()(e).add(t,s).valueOf()},diff:function(e,t,s){return Ve()(e).diff(Ve()(t),s)},startOf:function(e,t,s){return e=Ve()(e),"isoWeek"===t?(s=Math.trunc(Math.min(Math.max(0,s),6)),e.isoWeekday(s).startOf("day").valueOf()):e.startOf(t).valueOf()},endOf:function(e,t){return Ve()(e).endOf(t).valueOf()}}:{}),Math.PI,Number.POSITIVE_INFINITY,Math.log10,Math.sign,"undefined"==typeof window||window.requestAnimationFrame,new Map,Object.create(null),Object.create(null),Number.EPSILON;const us=["top","right","bottom","left"];function ps(e,t,s){const r={};s=s?"-"+s:"";for(let n=0;n<4;n++){const o=us[n];r[o]=parseFloat(e[t+"-"+o+s])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}!function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}}(),es.Chart.register(es.CategoryScale,es.LineController,es.LineElement,es.PointElement,es.LinearScale,es.TimeScale,es.Legend,es.Tooltip);const hs=["#ff983b","#ffa3f7","#3798ff","#ff3b3b","#acce81","#b51751","#3949ab","#26c6da","#ccb800","#de66ff","#4db6ac","#ffab91","#45f5f1","#77f210","#90a4ae","#ffd54f","#006b5e","#8ec7d2","#b1887c","#cc9300"];function ms({datasets:e,isChartShown:t,keyphrases:s}){if(!t)return null;const r=(0,v.useMemo)((()=>Object.fromEntries([...s].sort().map(((e,t)=>[e,hs[t%hs.length]])))),[s]),n=e.map((e=>{const t=r[e.label];return{...e,data:e.data.map((({datetime:e,value:t})=>({x:e,y:t}))),lineTension:0,pointRadius:1,pointHoverRadius:4,borderWidth:2,pointHitRadius:6,backgroundColor:t,borderColor:t}})).filter((e=>!1!==e.selected));return(0,k.createElement)(cs,{height:100,data:{datasets:n},options:{plugins:{legend:{display:!0,position:"bottom",labels:{color:"black",usePointStyle:!0,boxHeight:7,boxWidth:7},onClick:c.noop},tooltip:{enabled:!0,callbacks:{title:e=>Ve()(e[0].raw.x).utc().format("YYYY-MM-DD")},titleAlign:"center",mode:"xPoint",position:"nearest",usePointStyle:!0,boxHeight:7,boxWidth:7,boxPadding:2}},scales:{x:{bounds:"ticks",type:"time",time:{unit:"day",minUnit:"day"},grid:{display:!1},ticks:{autoSkipPadding:50,maxRotation:0,color:"black"}},y:{bounds:"ticks",offset:!0,reverse:!0,ticks:{precision:0,color:"black"},max:101}}}})}es.Interaction.modes.xPoint=(e,t,s,r)=>{const n=function(e,t){if("native"in e)return e;const{canvas:s,currentDevicePixelRatio:r}=t,n=(h=s).ownerDocument.defaultView.getComputedStyle(h,null),o="border-box"===n.boxSizing,a=ps(n,"padding"),i=ps(n,"border","width"),{x:l,y:c,box:d}=function(e,t){const s=e.touches,r=s&&s.length?s[0]:e,{offsetX:n,offsetY:o}=r;let a,i,l=!1;if(((e,t,s)=>(e>0||t>0)&&(!s||!s.shadowRoot))(n,o,e.target))a=n,i=o;else{const e=t.getBoundingClientRect();a=r.clientX-e.left,i=r.clientY-e.top,l=!0}return{x:a,y:i,box:l}}(e,s),u=a.left+(d&&i.left),p=a.top+(d&&i.top);var h;let{width:m,height:g}=t;return o&&(m-=a.width+i.width,g-=a.height+i.height),{x:Math.round((l-u)/m*s.width/r),y:Math.round((c-p)/g*s.height/r)}}(t,e);let o=[];if(es.Interaction.evaluateInteractionItems(e,"x",n,((e,t,s)=>{e.inXRange(n.x,r)&&o.push({element:e,datasetIndex:t,index:s})})),0===o.length)return o;const a=o.reduce(((e,t)=>Math.abs(n.x-e.element.x)<Math.abs(n.x-t.element.x)?e:t)).element.x;return o=o.filter((e=>e.element.x===a)),o.some((e=>Math.abs(e.element.y-n.y)<10))?o:[]},ms.propTypes={datasets:R().arrayOf(R().shape({label:R().string.isRequired,data:R().arrayOf(R().shape({datetime:R().string.isRequired,value:R().number.isRequired})).isRequired,selected:R().bool})).isRequired,isChartShown:R().bool.isRequired,keyphrases:R().array.isRequired};const gs=({response:e,onLogin:t})=>[401,403,404].includes(e.status)?(0,k.createElement)(Zt,{onReconnect:t}):(0,k.createElement)(Je,null);gs.propTypes={response:R().object.isRequired,onLogin:R().func.isRequired};const ys=({isSuccess:e,response:t,allKeyphrasesMissRanking:s,onLogin:r,keyphraseLimitReached:n,limit:o})=>n?(0,k.createElement)(Ze,{limit:o}):(0,c.isEmpty)(t)||e?s?(0,k.createElement)(ft,null):null:(0,k.createElement)(gs,{response:t,onLogin:r});ys.propTypes={isSuccess:R().bool.isRequired,allKeyphrasesMissRanking:R().bool.isRequired,response:R().object,onLogin:R().func.isRequired,keyphraseLimitReached:R().bool.isRequired,limit:R().number.isRequired},ys.defaultProps={response:{}};let fs=null;const bs=async e=>{if(fs&&!fs.isClosed())return void fs.focus();const{url:t}=await async function(){return await rt({path:"yoast/v1/wincher/authorization-url",method:"GET"})}();fs=new Qt(t,{success:{type:"wincher:oauth:success",callback:t=>(async(e,t)=>{const{onAuthentication:s,setRequestSucceeded:r,setRequestFailed:n,keyphrases:o,addTrackedKeyphrase:a,setKeyphraseLimitReached:i}=e;await st((()=>async function(e){const{code:t,websiteId:s}=e;return await rt({path:"yoast/v1/wincher/authenticate",method:"POST",data:{code:t,websiteId:s}})}(t)),(async e=>{s(!0,!0,t.websiteId.toString()),r(e);const l=(Array.isArray(o)?o:[o]).map((e=>e.toLowerCase()));await st((()=>nt(l)),(e=>{r(e),a(e.results)}),(e=>{400===e.status&&e.limit&&i(e.limit),n(e)}),201);const c=fs.getPopup();c&&c.close()}),(async e=>n(e)))})(e,t)},error:{type:"wincher:oauth:error",callback:()=>e.onAuthentication(!1,!1)}},{title:"Wincher_login",width:500,height:700}),fs.createPopup()},ws=e=>e.isLoggedIn?null:(0,k.createElement)("p",null,(0,k.createElement)(I.NewButton,{onClick:e.onLogin,variant:"primary"},(0,u.sprintf)(/* translators: %s expands to Wincher */ (0,u.__)("Connect with %s","wordpress-seo"),"Wincher")));ws.propTypes={isLoggedIn:R().bool.isRequired,onLogin:R().func.isRequired};const ks=x().div` p { margin: 1em 0; } `,vs=x().div` ${e=>e.isDisabled&&"\n\t\topacity: .5;\n\t\tpointer-events: none;\n\t"}; `,Es=x().div` font-weight: var(--yoast-font-weight-bold); color: var(--yoast-color-label); font-size: var(--yoast-font-size-default); `,xs=x().div.attrs({className:"yoast-field-group"})` display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; `,_s=x().div` margin: 8px 0; `,Rs=Ve().utc().startOf("day"),Is=[{name:(0,u.__)("Last day","wordpress-seo"),value:Ve()(Rs).subtract(1,"days").format(),defaultIndex:1},{name:(0,u.__)("Last week","wordpress-seo"),value:Ve()(Rs).subtract(1,"week").format(),defaultIndex:2},{name:(0,u.__)("Last month","wordpress-seo"),value:Ve()(Rs).subtract(1,"month").format(),defaultIndex:3},{name:(0,u.__)("Last year","wordpress-seo"),value:Ve()(Rs).subtract(1,"year").format(),defaultIndex:0}],Ts=e=>{const{onSelect:t,selected:s,options:r,isLoggedIn:n}=e;return n?r.length<1?null:(0,k.createElement)("select",{className:"components-select-control__input",id:"wincher-period-picker",value:(null==s?void 0:s.value)||r[0].value,onChange:t},r.map((e=>(0,k.createElement)("option",{key:e.name,value:e.value},e.name)))):null};Ts.propTypes={onSelect:R().func.isRequired,selected:R().object,options:R().array.isRequired,isLoggedIn:R().bool.isRequired};const Ss=e=>{const{trackedKeyphrases:t,isLoggedIn:s,keyphrases:r,shouldTrackAll:n,permalink:o,historyDaysLimit:a}=e;if(!o&&s)return(0,k.createElement)(Jt,null);if(0===r.length)return(0,k.createElement)(Vt,null);const i=Ve()(Rs).subtract(a,"days"),l=Is.filter((e=>Ve()(e.value).isSameOrAfter(i))),d=(0,c.orderBy)(l,(e=>e.defaultIndex),"desc")[0],[p,h]=(0,v.useState)(d),[m,g]=(0,v.useState)([]),y=m.length>0,f=(0,he.usePrevious)(t);(0,v.useEffect)((()=>{if(!(0,c.isEmpty)(t)&&(0,c.difference)(Object.keys(t),Object.keys(f||[])).length){const e=Object.values(t).map((e=>e.keyword));g(e)}}),[t,f]),(0,v.useEffect)((()=>{h(d)}),[null==d?void 0:d.name]);const b=(0,v.useCallback)((e=>{const t=Is.find((t=>t.value===e.target.value));t&&h(t)}),[h]),w=(0,v.useMemo)((()=>(0,c.isEmpty)(m)||(0,c.isEmpty)(t)?[]:Object.values(t).filter((e=>{var t;return!(null==e||null===(t=e.position)||void 0===t||!t.history)})).map((e=>{var t;return{label:e.keyword,data:e.position.history,selected:m.includes(e.keyword)&&!(0,c.isEmpty)(null===(t=e.position)||void 0===t?void 0:t.history)}}))),[m,t]);return(0,k.createElement)(vs,{isDisabled:!s},(0,k.createElement)("p",null,(0,u.__)("You can enable / disable tracking the SEO performance for each keyphrase below.","wordpress-seo")),s&&n&&(0,k.createElement)(Gt,null),(0,k.createElement)(xs,null,(0,k.createElement)(Ts,{selected:p,onSelect:b,options:l,isLoggedIn:s})),(0,k.createElement)(_s,null,(0,k.createElement)(ms,{isChartShown:y,datasets:w,keyphrases:r})),(0,k.createElement)(Ht,{startAt:null==p?void 0:p.value,selectedKeyphrases:m,onSelectKeyphrases:g,trackedKeyphrases:t}))};function Cs(e){const{isNewlyAuthenticated:t,isLoggedIn:s}=e,r=(0,v.useCallback)((()=>{bs(e)}),[bs,e]),n=dt(s);return(0,k.createElement)(ks,null,t&&(0,k.createElement)(yt,null),s&&(0,k.createElement)(gt,{trackingInfo:n}),(0,k.createElement)(Es,null,(0,u.__)("SEO performance","wordpress-seo"),(0,k.createElement)(I.HelpIcon,{linkTo:wpseoAdminL10n["shortlinks.wincher.seo_performance"] /* translators: Hidden accessibility text. */,linkText:(0,u.__)("Learn more about the SEO performance feature.","wordpress-seo")})),(0,k.createElement)(zt,null),(0,k.createElement)(ws,{isLoggedIn:s,onLogin:r}),(0,k.createElement)(ys,{...e,onLogin:r}),(0,k.createElement)(Ss,{...e,historyDaysLimit:(null==n?void 0:n.historyDays)||31}))}Ss.propTypes={trackedKeyphrases:R().object,keyphrases:R().array.isRequired,isLoggedIn:R().bool.isRequired,shouldTrackAll:R().bool.isRequired,permalink:R().string.isRequired,historyDaysLimit:R().number},Cs.propTypes={trackedKeyphrases:R().object,addTrackedKeyphrase:R().func.isRequired,isLoggedIn:R().bool,isNewlyAuthenticated:R().bool,keyphrases:R().array,response:R().object,shouldTrackAll:R().bool,permalink:R().string,historyDaysLimit:R().number},Cs.defaultProps={trackedKeyphrases:null,isLoggedIn:!1,isNewlyAuthenticated:!1,keyphrases:[],response:{},shouldTrackAll:!1,permalink:"",historyDaysLimit:0};const Ls=(0,he.compose)([(0,me.withSelect)((e=>{const{isWincherNewlyAuthenticated:t,getWincherKeyphraseLimitReached:s,getWincherLimit:r,getWincherHistoryDaysLimit:n,getWincherLoginStatus:o,getWincherRequestIsSuccess:a,getWincherRequestResponse:i,getWincherTrackableKeyphrases:l,getWincherTrackedKeyphrases:c,getWincherAllKeyphrasesMissRanking:d,getWincherPermalink:u,shouldWincherAutomaticallyTrackAll:p}=e("yoast-seo/editor");return{keyphrases:l(),trackedKeyphrases:c(),allKeyphrasesMissRanking:d(),isLoggedIn:o(),isNewlyAuthenticated:t(),isSuccess:a(),keyphraseLimitReached:s(),limit:r(),response:i(),shouldTrackAll:p(),permalink:u(),historyDaysLimit:n()}})),(0,me.withDispatch)((e=>{const{setWincherWebsiteId:t,setWincherRequestSucceeded:s,setWincherRequestFailed:r,setWincherTrackingForKeyphrase:n,setWincherSetKeyphraseLimitReached:o,setWincherLoginStatus:a}=e("yoast-seo/editor");return{setRequestSucceeded:e=>{s(e)},setRequestFailed:e=>{r(e)},addTrackedKeyphrase:e=>{n(e)},setKeyphraseLimitReached:e=>{o(e)},onAuthentication:(e,s,r)=>{t(r),a(e,s)}}}))])(Cs);function Ps(e,t,s,r){return new Promise(((n,o)=>{jQuery.ajax({type:e,url:t,beforeSend:s?e=>{e.setRequestHeader("X-WP-Nonce",s)}:null,data:r,dataType:"json",success:n,error:o})}))}let As,Os,Bs,Ns;const qs=/<(\/)?(\w+)\s*(\/)?>/g;function Ms(e,t,s,r,n){return{element:e,tokenStart:t,tokenLength:s,prevOffset:r,leadingTextStart:n,children:[]}}function Fs(){const e=As.length-Os;0!==e&&Bs.push(As.substring(Os,Os+e))}function Ks(e){const{element:t,tokenStart:s,tokenLength:r,prevOffset:n,children:o}=e,a=Ns[Ns.length-1],i=As.substring(a.prevOffset,s);i&&a.children.push(i),a.children.push((0,v.cloneElement)(t,null,...o)),a.prevOffset=n||s+r}function Ds(e){const t=function(){const e=qs.exec(As);if(null===e)return["no-more-tokens"];const t=e.index,[s,r,n,o]=e,a=s.length;return o?["self-closed",n,t,a]:r?["closer",n,t,a]:["opener",n,t,a]}(),[s,r,n,o]=t,a=Ns.length,i=n>Os?Os:null;if(!e[r])return Fs(),!1;switch(s){case"no-more-tokens":if(0!==a){const{leadingTextStart:e,tokenStart:t}=Ns.pop();Bs.push(As.substring(e,e+t))}return Fs(),!1;case"self-closed":return 0===a?(null!==i&&Bs.push(As.substring(i,n)),Bs.push(e[r]),Os=n+o,!0):(Ks(Ms(e[r],n,o)),Os=n+o,!0);case"opener":return Ns.push(Ms(e[r],n,o,n+o,i)),Os=n+o,!0;case"closer":if(1===a)return function(e){const{element:t,leadingTextStart:s,prevOffset:r,tokenStart:n,children:o}=Ns.pop(),a=e?As.substring(r,e):As.substring(r);a&&o.push(a),null!==s&&Bs.push(As.substring(s,n)),Bs.push((0,v.cloneElement)(t,null,...o))}(n),Os=n+o,!0;const t=Ns.pop(),s=As.substring(t.prevOffset,n);t.children.push(s),t.prevOffset=n+o;const l=Ms(t.element,t.tokenStart,t.tokenLength,n+o);return l.children=t.children,Ks(l),Os=n+o,!0;default:return Fs(),!1}}function $s(e,t="wpseoYoastJSL10n"){const s=(0,c.get)(window,[t,e,"locale_data",e],!1);"yoast-components"===e&&(e="wordpress-seo"),!1===s?(0,u.setLocaleData)({"":{}},e):(0,u.setLocaleData)(s,e)}const Ws=window.wp.sanitize,js="SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLE",Hs="SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLES_BATCH";function Us(e,t,s="",r=!1){const n="string"==typeof t?(0,T.decodeHTML)(t):t;return{type:js,name:e,value:n,label:s,hidden:r}}function Ys(e){return e.charAt(0).toUpperCase()+e.slice(1)}const{stripHTMLTags:zs}=T.strings,Vs=["slug","content","contentImage","snippetPreviewImageURL"];function Gs(e,t){(0,c.forEach)(e,((e,s)=>{Vs.includes(s)||t.dispatch(Us(s,e))}))}function Qs(e){if(!["ct_","cf_","pt_"].includes(e.substring(0,3)))return e.replace(/_/g," ");const t=e.slice(0,3);switch(-1!==(e=e.slice(3)).indexOf("desc_")&&(e=e.slice(5)+" description"),t){case"ct_":e+=" (custom taxonomy)";break;case"cf_":e+=" (custom field)";break;case"pt_":e="Post type ("+(e=e.replace("single","singular"))+")"}return e}function Xs(e){return Ys(e=Qs(e))}function Zs(e,t){return e.push({name:t.name,label:t.label||Xs(t.name),value:t.value}),e}function Js(e,t="_"){return e.replace(/\s/g,t)}function er(e){return{name:"cf_"+Js(e),label:Ys(e+" (custom field)")}}function tr(e){const t=Js(e);return{name:"ct_"+t,label:Ys(e+" (custom taxonomy)"),descriptionName:"ct_desc_"+t,descriptionLabel:Ys(e+" description (custom taxonomy)")}}function sr(e,t){if(!e.custom_taxonomies)return e;const s={};return(0,c.forEach)(e.custom_taxonomies,((e,t)=>{const{name:r,label:n,descriptionName:o,descriptionLabel:a}=tr(t),i="string"==typeof e.name?(0,T.decodeHTML)(e.name):e.name,l="string"==typeof e.description?(0,T.decodeHTML)(e.description):e.description;s[r]={value:i,label:n},s[o]={value:l,label:a}})),t.dispatch(function(e){return{type:Hs,updatedVariables:e}}(s)),(0,c.omit)({...e},"custom_taxonomies")}function rr(e,t){return e.custom_fields?((0,c.forEach)(e.custom_fields,((e,s)=>{const{name:r,label:n}=er(s);t.dispatch(Us(r,e,n))})),(0,c.omit)({...e},"custom_fields")):e}function nr(e,t=156){return(e=(e=(0,Ws.stripTags)(e)).trim()).length<=t||(e=e.substring(0,t),/\s/.test(e)&&(e=e.substring(0,e.lastIndexOf(" ")))),e}const or=function(e){const t=(0,c.get)(window,["YoastSEO","app","pluggable"],!1);if(!t||!(0,c.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){const t=(0,c.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],c.identity);return{url:e.url,title:zs(t(e.title)),description:zs(t(e.description)),filteredSEOTitle:e.filteredSEOTitle?zs(t(e.filteredSEOTitle)):""}}(e);const s=t._applyModifications.bind(t);return{url:e.url,title:zs(s("data_page_title",e.title)),description:zs(s("data_meta_desc",e.description)),filteredSEOTitle:e.filteredSEOTitle?zs(s("data_page_title",e.filteredSEOTitle)):""}};var ar="score-text",ir="image yoast-logo svg",lr=jQuery;function cr(e,t,s=null){var r,n,o,a,i;if(null!==s)return(0,c.get)(s,t,"");const l=(0,me.select)("yoast-seo/editor").getIsPremium(),d={na:(0,u.__)("Not available","wordpress-seo"),bad:(0,u.__)("Needs improvement","wordpress-seo"),ok:(0,u.__)("OK","wordpress-seo"),good:(0,u.__)("Good","wordpress-seo")},p={keyword:{label:l?(0,u.__)("Premium SEO analysis:","wordpress-seo"):(0,u.__)("SEO analysis:","wordpress-seo"),anchor:"yoast-seo-analysis-collapsible-metabox",status:d},content:{label:(0,u.__)("Readability analysis:","wordpress-seo"),anchor:"yoast-readability-analysis-collapsible-metabox",status:d},"inclusive-language":{label:(0,u.__)("Inclusive language:","wordpress-seo"),anchor:"yoast-inclusive-language-analysis-collapsible-metabox",status:{...d,ok:(0,u.__)("Potentially non-inclusive","wordpress-seo")}}};return null!=p&&null!==(r=p[e])&&void 0!==r&&null!==(n=r.status)&&void 0!==n&&n[t]?`<a href="#${null===(o=p[e])||void 0===o?void 0:o.anchor}">${null===(a=p[e])||void 0===a?void 0:a.label}</a> <strong>${null===(i=p[e])||void 0===i?void 0:i.status[t]}</strong>`:""}window.yoast=window.yoast||{},window.yoast.editorModules={analysis:{getL10nObject:d,getContentLocale:function(){const e=d();return(0,c.get)(e,"contentLocale","en_US")},getIndicatorForScore:function(e){return(0,c.isNil)(e)||(e/=10),function(e){switch(e){case"feedback":return{className:"na",screenReaderText:(0,u.__)("Not available","wordpress-seo"),screenReaderReadabilityText:(0,u.__)("Not available","wordpress-seo"),screenReaderInclusiveLanguageText:(0,u.__)("Not available","wordpress-seo")};case"bad":return{className:"bad",screenReaderText:(0,u.__)("Needs improvement","wordpress-seo"),screenReaderReadabilityText:(0,u.__)("Needs improvement","wordpress-seo"),screenReaderInclusiveLanguageText:(0,u.__)("Needs improvement","wordpress-seo")};case"ok":return{className:"ok",screenReaderText:(0,u.__)("OK SEO score","wordpress-seo"),screenReaderReadabilityText:(0,u.__)("OK","wordpress-seo"),screenReaderInclusiveLanguageText:(0,u.__)("Potentially non-inclusive","wordpress-seo")};case"good":return{className:"good",screenReaderText:(0,u.__)("Good SEO score","wordpress-seo"),screenReaderReadabilityText:(0,u.__)("Good","wordpress-seo"),screenReaderInclusiveLanguageText:(0,u.__)("Good","wordpress-seo")};default:return{className:"loading",screenReaderText:"",screenReaderReadabilityText:"",screenReaderInclusiveLanguageText:""}}}(p.interpreters.scoreToRating(e))},constants:e,refreshAnalysis:t},components:{HelpLink:V,TopLevelProviders:pe,higherorder:{withYoastSidebarPriority:e=>{const t=t=>{const{renderPriority:s,...r}=t;return(0,k.createElement)(e,{...r})};return t.propTypes={renderPriority:R().number},t}},contentAnalysis:{KeywordInput:j,mapResults:r},contexts:{location:{LocationContext:i.LocationContext,LocationProvider:i.LocationProvider,LocationConsumer:i.LocationConsumer}},SidebarItem:de,SidebarCollapsible:le,MetaboxCollapsible:e=>(0,k.createElement)(G,{hasPadding:!0,hasSeparator:!0,...e}),Modal:J,portals:{Portal:re,ImageSelectPortal:ne,ScoreIconPortal:ae}},containers:{EditorModal:we,PersistentDismissableAlert:ke,Results:We,SEMrushRelatedKeyphrases:Ye,WincherSEOPerformance:Ls},helpers:{ajaxHelper:n,createInterpolateElement:(e,t)=>{if(As=e,Os=0,Bs=[],Ns=[],qs.lastIndex=0,!(e=>{const t="object"==typeof e,s=t&&Object.values(e);return t&&s.length&&s.every((e=>(0,v.isValidElement)(e)))})(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are WPElements");do{}while(Ds(t));return(0,v.createElement)(v.Fragment,null,...Bs)},createWatcher:(e,t)=>{let s=e();return()=>{const r=e();(0,c.isEqual)(r,s)||(s=r,t((0,c.clone)(r)))}},isBlockEditor:function(){return window.wpseoScriptData&&"1"===window.wpseoScriptData.isBlockEditor},i18n:o,replacementVariableHelpers:a,publishBox:{updateScore:function(e,t,s=null){var r=lr("#"+e+"-score"),n=ir+" "+t;r.children(".image").attr("class",n);var o=cr(e,t,s);r.children("."+ar).html(o)},createScoresInPublishBox:function(e,t,s=null){const r=lr("<div />",{class:"misc-pub-section yoast yoast-seo-score "+e+"-score",id:e+"-score"}),n=lr("<span />",{class:ar,html:cr(e,t,s)}),o=lr("<span>").attr("class",ir+" na");r.append(o).append(n),lr("#yoast-seo-publishbox-section").append(r)},scrollToCollapsible:function(e){const t=lr("#wpadminbar"),s=lr(e);if(!t||!s)return;const r="fixed"===t.css("position")?t.height():0;lr([document.documentElement,document.body]).animate({scrollTop:s.offset().top-r},1e3),s.trigger("focus"),0===s.parent().siblings().length&&s.trigger("click")}},updateAdminBar:function(e){jQuery("#wp-admin-bar-wpseo-menu .wpseo-score-icon").attr("title",e.screenReaderText).attr("class","wpseo-score-icon "+e.className).find(".wpseo-score-text").text(e.screenReaderText)},updateTrafficLight:function(e){var t=jQuery(".yst-traffic-light"),s=t.closest(".wpseo-meta-section-link"),r=jQuery("#wpseo-traffic-light-desc"),n=e.className||"na";t.attr("class","yst-traffic-light "+n),s.attr("aria-describedby","wpseo-traffic-light-desc"),r.length>0?r.text(e.screenReaderText):s.closest("li").append("<span id='wpseo-traffic-light-desc' class='screen-reader-text'>"+e.screenReaderText+"</span>")}}}})()})();
Save Changes
Rename File
Rename