📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: LiteSpeed
2026-06-28 21:19:29
📂
/ (Root)
/
home
/
apkbfjox
/
7lgbet.pro
/
wp-content
/
plugins
/
wordpress-seo
/
js
/
dist
📍 /home/apkbfjox/7lgbet.pro/wp-content/plugins/wordpress-seo/js/dist
🔄 Refresh
✏️
Editing: editor-modules.js
Writable
(()=>{var e={465(e,s,t){const r=t(1609),i=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.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.exports=i},818(e,s,t){const r=t(1609),i=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=i},1609(e){"use strict";e.exports=window.React},2485(e,s){var t;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],s=0;s<arguments.length;s++){var t=arguments[s];if(t){var o=typeof t;if("string"===o||"number"===o)e.push(t);else if(Array.isArray(t)){if(t.length){var n=i.apply(null,t);n&&e.push(n)}}else if("object"===o){if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]")){e.push(t.toString());continue}for(var a in t)r.call(t,a)&&t[a]&&e.push(a)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(t=function(){return i}.apply(s,[]))||(e.exports=t)}()},2514(e,s,t){const r=t(1609),i=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"}))});e.exports=i},2863(e,s,t){const r=t(1609),i=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}))});e.exports=i},3473(e,s,t){const r=t(1609),i=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"}))});e.exports=i},5074(e,s,t){const r=t(1609),i=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});e.exports=i},5687(e,s,t){const r=t(1609),i=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{fillRule:"evenodd",d:"M10.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L12.586 11H5a1 1 0 110-2h7.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=i},6702(e,s,t){const r=t(1609),i=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});e.exports=i},7219(e,s,t){const r=t(1609),i=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))});e.exports=i},7656(e,s,t){const r=t(1609),i=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}))});e.exports=i},8738(e,s,t){const r=t(1609),i=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))});e.exports=i}},s={};function t(r){var i=s[r];if(void 0!==i)return i.exports;var o=s[r]={exports:{}};return e[r](o,o.exports,t),o.exports}t.n=e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},t.d=(e,s)=>{for(var r in s)t.o(s,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:s[r]})},t.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};t.r(e),t.d(e,{refreshDelay:()=>a});var s={};t.r(s),t.d(s,{default:()=>x,initializationDone:()=>f,sortResultsByIdentifier:()=>y});var r={};t.r(r),t.d(r,{default:()=>K,getIconForScore:()=>z});var i={};t.r(i),t.d(i,{doAjaxRequest:()=>Qe});var o={};t.r(o),t.d(o,{applyReplaceUsingPlugin:()=>gs,createLabelFromName:()=>as,excerptFromContent:()=>ms,fillReplacementVariables:()=>os,handlePrefixes:()=>ns,mapCustomFields:()=>hs,mapCustomTaxonomies:()=>ps,nonReplaceVars:()=>is,prepareCustomFieldForDispatch:()=>ds,prepareCustomTaxonomyForDispatch:()=>us,pushNewReplaceVar:()=>ls,replaceSpaces:()=>cs});const n=window.yoast.externals.contexts,a=500,l=window.lodash;function c(){return(0,l.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}const d=window.wp.i18n,u=window.yoast.analysis,p=window.wp.hooks,h=window.yoast.externals.redux;function m(){}let g=!1;function y(e){return e.sort((e,s)=>e._identifier.localeCompare(s._identifier))}function x(e,s,t,r,i){if(!g)return;const o=u.Paper.parse(s());e.analyze(o).then(n=>{const{result:{seo:a,readability:l,inclusiveLanguage:c}}=n;if(a){const e=a[""];e.results.forEach(e=>{e.getMarker=()=>()=>t(o,e.marks)}),e.results=y(e.results),r.dispatch(h.actions.setSeoResultsForKeyword(o.getKeyword(),e.results)),r.dispatch(h.actions.setOverallSeoScore(e.score,o.getKeyword())),r.dispatch(h.actions.refreshSnippetEditor()),i.saveScores(e.score,o.getKeyword())}l&&(l.results.forEach(e=>{e.getMarker=()=>()=>t(o,e.marks)}),l.results=y(l.results),r.dispatch(h.actions.setReadabilityResults(l.results)),r.dispatch(h.actions.setOverallReadabilityScore(l.score)),r.dispatch(h.actions.refreshSnippetEditor()),i.saveContentScore(l.score)),c&&(c.results.forEach(e=>{e.getMarker=()=>()=>t(o,e.marks)}),c.results=y(c.results),r.dispatch(h.actions.setInclusiveLanguageResults(c.results)),r.dispatch(h.actions.setOverallInclusiveLanguageScore(c.score)),r.dispatch(h.actions.refreshSnippetEditor()),i.saveInclusiveLanguageScore(c.score)),(0,p.doAction)("yoast.analysis.refresh",n,{paper:o,worker:e,collectData:s,applyMarks:t,store:r,dataCollector:i})}).catch(m)}function f(){g=!0}const w=window.wp.element,b=window.yoast.styledComponents;var v=t.n(b);const k=window.yoast.propTypes;var S=t.n(k);const j=window.yoast.componentsNew,_=window.yoast.helpers,R=window.yoast.styleGuide,C=window.ReactJSXRuntime,I=R.colors.$color_bad,E=R.colors.$palette_error_background,L=R.colors.$color_grey_text_light,N=R.colors.$palette_error_text,M=v().div` display: flex; flex-direction: column; `,T=v().label` font-size: var(--yoast-font-size-default); font-weight: var(--yoast-font-weight-bold); ${(0,_.getDirectionalStyle)("margin-right: 4px","margin-left: 4px")}; `,P=v().span` margin-bottom: 0.5em; `,A=v()(j.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: ${I} !important; background-color: ${E} !important; &:focus { box-shadow: 0 0 2px ${I} !important; } } `,F=v().ul` color: ${N}; list-style-type: disc; list-style-position: outside; margin: 0; margin-left: 1.2em; `,q=v().li` color: ${N}; margin: 0 0 0.5em 0; `,O=(0,j.addFocusStyle)(v().button` border: 1px solid transparent; box-shadow: none; background: none; flex: 0 0 32px; height: 32px; max-width: 32px; padding: 0; cursor: pointer; `);O.propTypes={type:S().string,focusColor:S().string,focusBackgroundColor:S().string,focusBorderColor:S().string},O.defaultProps={type:"button",focusColor:R.colors.$color_button_text_hover,focusBackgroundColor:"transparent",focusBorderColor:R.colors.$color_blue};const $=v()(j.SvgIcon)` margin-top: 4px; `,B=v().div` display: flex; flex-direction: row; align-items: center; &.has-remove-keyword-button { ${A} { ${(0,_.getDirectionalStyle)("padding-right: 40px","padding-left: 40px")}; } ${O} { ${(0,_.getDirectionalStyle)("margin-left: -32px","margin-right: -32px")}; } } `;class U extends w.Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){this.props.onChange(e.target.value)}renderLabel(){const{id:e,label:s,helpLink:t}=this.props;return(0,C.jsxs)(P,{children:[(0,C.jsx)(T,{htmlFor:e,children:s}),t]})}renderErrorMessages(){const e=[...this.props.errorMessages];return!(0,l.isEmpty)(e)&&(0,C.jsx)(F,{children:e.map((e,s)=>(0,C.jsx)(q,{children:(0,C.jsx)("span",{role:"alert",children:e})},s))})}render(){const{id:e,showLabel:s,keyword:t,onRemoveKeyword:r,onBlurKeyword:i,onFocusKeyword:o,hasError:n}=this.props,a=!s,c=r!==l.noop;return(0,C.jsxs)(M,{children:[s&&this.renderLabel(),n&&this.renderErrorMessages(),(0,C.jsxs)(B,{className:c?"has-remove-keyword-button":null,children:[(0,C.jsx)(A,{"aria-label":a?this.props.label:null,type:"text",id:e,className:n?"has-error":null,onChange:this.handleChange,onFocus:o,onBlur:i,value:t,autoComplete:"off"}),c&&(0,C.jsx)(O,{onClick:r,focusBoxShadowColor:"#084A67",children:(0,C.jsx)($,{size:"18px",icon:"times-circle",color:L})})]})]})}}U.propTypes={id:S().string.isRequired,showLabel:S().bool,keyword:S().string,onChange:S().func.isRequired,onRemoveKeyword:S().func,onBlurKeyword:S().func,onFocusKeyword:S().func,label:S().string.isRequired,helpLink:S().node,hasError:S().bool,errorMessages:S().arrayOf(S().string)},U.defaultProps={showLabel:!0,keyword:"",onRemoveKeyword:l.noop,onBlurKeyword:l.noop,onFocusKeyword:l.noop,helpLink:null,hasError:!1,errorMessages:[]};const H=U;function D(e,s=""){const t=e.getIdentifier(),r={score:e.score,rating:u.interpreters.scoreToRating(e.score),hasMarks:e.hasMarks(),marker:e.getMarker(),id:t,text:e.text,markerId:s.length>0?`${s}:${t}`:t,hasBetaBadge:e.hasBetaBadge(),hasJumps:e.hasJumps(),hasAIFixes:e.hasAIFixes(),editFieldName:e.editFieldName,editFieldAriaLabel:e.editFieldAriaLabel};return"ok"===r.rating&&(r.rating="OK"),r}function W(e,s){switch(e.rating){case"error":s.errorsResults.push(e);break;case"feedback":s.considerationsResults.push(e);break;case"bad":s.problemsResults.push(e);break;case"OK":s.improvementsResults.push(e);break;case"good":s.goodResults.push(e)}return s}function z(e){switch(e){case"loading":return{icon:"loading-spinner",color:R.colors.$color_green_medium_light};case"not-set":return{icon:"seo-score-none",color:R.colors.$color_score_icon};case"noindex":return{icon:"seo-score-none",color:R.colors.$color_noindex};case"good":return{icon:"seo-score-good",color:R.colors.$color_green_medium};case"ok":return{icon:"seo-score-ok",color:R.colors.$color_ok};default:return{icon:"seo-score-bad",color:R.colors.$color_red}}}function K(e,s=""){let t={errorsResults:[],problemsResults:[],improvementsResults:[],goodResults:[],considerationsResults:[]};if(!e)return t;for(let r=0;r<e.length;r++){const i=e[r];i.text&&(t=W(D(i,s),t))}return t}const G=window.yoast.uiLibrary,V=({id:e,label:s,description:t="",onChange:r,...i})=>(0,C.jsx)(G.Root,{children:(0,C.jsx)(G.TextField,{id:e,label:s,onChange:r,autoComplete:"off",description:t,...i})});V.propTypes={id:S().string.isRequired,label:S().string.isRequired,onChange:S().func.isRequired,description:S().node};const Y=V,Z=(0,_.makeOutboundLink)(v().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: ${R.colors.$color_help_text}; &:hover, &:focus { color: ${R.colors.$color_snippet_focus}; } // Overwrite the default blue active color for links. &:active { color: ${R.colors.$color_help_text}; } &::before { position: absolute; top: 0; left: 0; padding: 2px; content: "\f223"; } `),Q=v()(j.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); } `,J=window.wp.components,X=({title:e="Yoast SEO",className:s="yoast yoast-gutenberg-modal",showYoastIcon:t=!0,children:r=null,additionalClassName:i="",...o})=>{const n=t?(0,C.jsx)("span",{className:"yoast-icon"}):null;return(0,C.jsx)(J.Modal,{title:e,className:`${s} ${i}`,icon:n,...o,children:r})};X.propTypes={title:S().string,className:S().string,showYoastIcon:S().bool,children:S().oneOfType([S().node,S().arrayOf(S().node)]),additionalClassName:S().string};const ee=X,se=window.yoast.socialMetadataForms,te=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 re=({hiddenField:e,hiddenFieldImageId:s="",hiddenFieldFallbackImageId:t="",hasImageValidation:r=!1,...i})=>{const[o,n]=(0,w.useState)(null!==document.getElementById(t)),a=(0,w.useMemo)(()=>document.getElementById(e)),l=(0,w.useMemo)(()=>document.getElementById(s));let c=null;c=t&&document.getElementById(t)?(0,w.useMemo)(()=>document.getElementById(t)):l;const[d,u]=(0,w.useState)({url:a?a.value:"",id:c?parseInt(c.value,10):"",alt:""}),[p,h]=(0,w.useState)([]),m=(0,w.useCallback)(e=>{a&&(a.value=e.url),c&&(c.value=e.id)}),g=(0,w.useCallback)(()=>{(function(e){const s=window.wp.media();return s.on("select",()=>{const t=s.state().get("selection").first();e(te(t.attributes))}),s})(e=>{c=l,u(e),m(e),r&&h((0,_.validateFacebookImage)(e)),n(!1)}).open()},[r,m]),y=(0,w.useCallback)(()=>{c=l;const e={url:"",id:"",alt:""};u(e),m(e),h([]),n(!0)},[m]);return(0,w.useEffect)(()=>{var e;d.id&&!d.alt&&(e=d.id,new Promise((s,t)=>{window.wp.media.attachment||t(),window.wp.media.attachment(e).fetch().then(e=>{s(te(e))}).catch(()=>t())})).then(e=>u(e))},[d]),(0,C.jsx)(j.ImageSelect,{...i,usingFallback:o,imageUrl:d.url,imageId:d.id,imageAltText:d.alt,onClick:g,onRemoveImageClick:y,warnings:p})};re.propTypes={hiddenField:S().string.isRequired,hiddenFieldImageId:S().string,hiddenFieldFallbackImageId:S().string,hasImageValidation:S().bool};const ie=re;function oe({target:e,children:s}){let t=e;return"string"==typeof e&&(t=document.getElementById(e)),t?(0,w.createPortal)(s,t):null}function ne({target:e,label:s,hasPreview:t,hiddenField:r,hiddenFieldImageId:i="",hiddenFieldFallbackImageId:o="",selectImageButtonId:n="",replaceImageButtonId:a="",removeImageButtonId:l="",hasNewBadge:c=!1,isDisabled:d=!1,hasPremiumBadge:u=!1,hasImageValidation:p=!1}){return(0,C.jsx)(oe,{target:e,children:(0,C.jsx)(ie,{label:s,hasPreview:t,hiddenField:r,hiddenFieldImageId:i,hiddenFieldFallbackImageId:o,selectImageButtonId:n,replaceImageButtonId:a,removeImageButtonId:l,hasNewBadge:c,isDisabled:d,hasPremiumBadge:u,hasImageValidation:p})})}oe.propTypes={target:S().oneOfType([S().string,S().object]).isRequired,children:S().node.isRequired},ne.propTypes={target:S().string.isRequired,label:S().string.isRequired,hasPreview:S().bool.isRequired,hiddenField:S().string.isRequired,hiddenFieldImageId:S().string,hiddenFieldFallbackImageId:S().string,selectImageButtonId:S().string,replaceImageButtonId:S().string,removeImageButtonId:S().string,hasNewBadge:S().bool,isDisabled:S().bool,hasPremiumBadge:S().bool,hasImageValidation:S().bool};const ae=({target:e,scoreIndicator:s})=>(0,C.jsx)(oe,{target:e,children:(0,C.jsx)(j.SvgIcon,{...z(s)})});ae.propTypes={target:S().string.isRequired,scoreIndicator:S().string.isRequired};const le=ae,ce=({title:e,children:s,id:t=null,prefixIcon:r=null,subTitle:i="",hasBetaBadgeLabel:o=!1,hasNewBadgeLabel:n=!1,buttonId:a=null,renderNewBadgeLabel:l=()=>{},initialIsOpen:c=!1})=>{const[d,u]=(0,w.useState)(c),p=(0,w.useRef)(null);(0,w.useEffect)(()=>{c&&p.current&&p.current.focus()},[]);const h=(0,w.useCallback)(()=>{u(e=>!e)},[u]);return(0,C.jsxs)("div",{id:t,className:"yoast components-panel__body "+(d?"is-opened":""),children:[(0,C.jsx)("h2",{className:"components-panel__body-title",children:(0,C.jsxs)("button",{ref:p,onClick:h,className:"components-button components-panel__body-toggle",type:"button",id:a,children:[(0,C.jsx)("span",{className:"yoast-icon-span",style:{fill:`${r&&r.color||""}`},children:r&&(0,C.jsx)(j.SvgIcon,{icon:r.icon,color:r.color,size:r.size})}),!n&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("span",{className:"yoast-title-container",children:[(0,C.jsx)("div",{className:"yoast-title",children:e}),i&&(0,C.jsx)("div",{className:"yoast-subtitle",children:i})]}),o&&(0,C.jsx)(j.BetaBadge,{})]}),n&&(0,C.jsxs)("div",{className:"yst-flex-grow yst-flex yst-items-center yst-gap-2",children:[(0,C.jsxs)("span",{className:"yst-overflow-x-hidden yst-leading-normal",children:[(0,C.jsx)("div",{className:"yoast-title",children:e}),i&&(0,C.jsx)("div",{className:"yoast-subtitle",children:i})]}),l()]}),(0,C.jsx)("span",{className:"yoast-chevron","aria-hidden":"true"})]})}),d&&s]})},de=ce;ce.propTypes={title:S().string.isRequired,children:S().oneOfType([S().node,S().arrayOf(S().node)]).isRequired,id:S().string,prefixIcon:S().object,subTitle:S().string,hasBetaBadgeLabel:S().bool,hasNewBadgeLabel:S().bool,buttonId:S().string,renderNewBadgeLabel:S().func,initialIsOpen:S().bool};const ue=({children:e})=>(0,C.jsx)("div",{children:e});ue.propTypes={renderPriority:S().number.isRequired,children:S().node.isRequired};const pe=ue,he=({theme:e,location:s,children:t})=>(0,C.jsx)(n.LocationProvider,{value:s,children:(0,C.jsx)(b.ThemeProvider,{theme:e,children:t})});he.propTypes={theme:S().object.isRequired,location:S().oneOf(["sidebar","metabox","modal"]).isRequired,children:S().node.isRequired};const me=he,ge=window.wp.compose,ye=window.wp.data,xe=({onClick:e,title:s,id:t="",subTitle:r="",suffixIcon:i=null,SuffixHeroIcon:o=null,prefixIcon:n=null,children:a=null})=>(0,C.jsx)("div",{className:"yoast components-panel__body",children:(0,C.jsx)("h2",{className:"components-panel__body-title",children:(0,C.jsxs)("button",{id:t,onClick:e,className:"components-button components-panel__body-toggle",type:"button",children:[n&&(0,C.jsx)("span",{className:"yoast-icon-span",style:{fill:`${n&&n.color||""}`},children:(0,C.jsx)(j.SvgIcon,{size:n.size,icon:n.icon})}),(0,C.jsxs)("span",{className:"yoast-title-container",children:[(0,C.jsx)("div",{className:"yoast-title",children:s}),(0,C.jsx)("div",{className:"yoast-subtitle",children:r})]}),a,i&&(0,C.jsx)(j.SvgIcon,{size:i.size,icon:i.icon}),o]})})}),fe=xe;xe.propTypes={onClick:S().func.isRequired,title:S().string.isRequired,id:S().string,subTitle:S().string,suffixIcon:S().object,SuffixHeroIcon:S().element,prefixIcon:S().object,children:S().node};const we=({id:e,postTypeName:s,children:t,title:r,isOpen:i,open:o,close:a,shouldCloseOnClickOutside:l=!0,showChangesWarning:c=!0,SuffixHeroIcon:u=null})=>(0,C.jsxs)(w.Fragment,{children:[i&&(0,C.jsx)(n.LocationProvider,{value:"modal",children:(0,C.jsxs)(ee,{title:r,onRequestClose:a,additionalClassName:"yoast-collapsible-modal yoast-post-settings-modal",id:"id",shouldCloseOnClickOutside:l,children:[(0,C.jsx)("div",{className:"yoast-content-container",children:(0,C.jsx)("div",{className:"yoast-modal-content",children:t})}),(0,C.jsxs)("div",{className:"yoast-notice-container",children:[(0,C.jsx)("hr",{}),(0,C.jsxs)("div",{className:"yoast-button-container",children:[c&&(0,C.jsx)("p",{children:/* Translators: %s translates to the Post Label in singular form */ /* Translators: %s translates to the Post Label in singular form */ (0,d.sprintf)((0,d.__)("Make sure to save your %s for changes to take effect","wordpress-seo"),s)}),(0,C.jsx)("button",{className:"yoast-button yoast-button--primary yoast-button--post-settings-modal",type:"button",onClick:a,children:/* Translators: %s translates to the Post Label in singular form */ /* Translators: %s translates to the Post Label in singular form */ (0,d.sprintf)((0,d.__)("Return to your %s","wordpress-seo"),s)})]})]})]})}),(0,C.jsx)(fe,{id:e+"-open-button",title:r,SuffixHeroIcon:u,suffixIcon:u?null:{size:"20px",icon:"pencil-square"},onClick:o})]});we.propTypes={id:S().string.isRequired,postTypeName:S().string.isRequired,children:S().oneOfType([S().node,S().arrayOf(S().node)]).isRequired,title:S().string.isRequired,isOpen:S().bool.isRequired,open:S().func.isRequired,close:S().func.isRequired,shouldCloseOnClickOutside:S().bool,showChangesWarning:S().bool,SuffixHeroIcon:S().element};const be=we,ve=(0,ge.compose)([(0,ye.withSelect)((e,s)=>{const{getPostOrPageString:t,getIsModalOpen:r}=e("yoast-seo/editor");return{postTypeName:t(),isOpen:r(s.id)}}),(0,ye.withDispatch)((e,s)=>{const{openEditorModal:t,closeEditorModal:r}=e("yoast-seo/editor");return{open:()=>t(s.id),close:r}})])(be),ke=(0,ge.compose)([(0,ye.withSelect)((e,s)=>{const{isAlertDismissed:t}=e(s.store||"yoast-seo/editor");return{isAlertDismissed:t(s.alertKey)}}),(0,ye.withDispatch)((e,s)=>{const{dismissAlert:t}=e(s.store||"yoast-seo/editor");return{onDismissed:()=>t(s.alertKey)}})])(j.Alert),Se=window.yoast.analysisReport;var je=t(465),_e=t.n(je);const Re=window.wp.url,Ce=(e,s)=>{try{return(0,w.createInterpolateElement)(e,s)}catch(s){return console.error("Error in translation for:",e,s),e}};var Ie,Ee,Le=t(1609),Ne=t.n(Le);function Me(){return Me=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Me.apply(null,arguments)}const Te=e=>Le.createElement("svg",Me({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 425 456.27"},e),Ie||(Ie=Le.createElement("path",{d:"M73 405.26a66.79 66.79 0 0 1-6.54-1.7 64.75 64.75 0 0 1-6.28-2.31c-1-.42-2-.89-3-1.37-1.49-.72-3-1.56-4.77-2.56-1.5-.88-2.71-1.64-3.83-2.39-.9-.61-1.8-1.26-2.68-1.92a70.154 70.154 0 0 1-5.08-4.19 69.21 69.21 0 0 1-8.4-9.17c-.92-1.2-1.68-2.25-2.35-3.24a70.747 70.747 0 0 1-3.44-5.64 68.29 68.29 0 0 1-8.29-32.55V142.13a68.26 68.26 0 0 1 8.29-32.55c1-1.92 2.21-3.82 3.44-5.64s2.55-3.58 4-5.27a69.26 69.26 0 0 1 14.49-13.25C50.37 84.19 52.27 83 54.2 82A67.59 67.59 0 0 1 73 75.09a68.75 68.75 0 0 1 13.75-1.39h169.66L263 55.39H86.75A86.84 86.84 0 0 0 0 142.13v196.09A86.84 86.84 0 0 0 86.75 425h11.32v-18.35H86.75A68.75 68.75 0 0 1 73 405.26zM368.55 60.85l-1.41-.53-6.41 17.18 1.41.53a68.06 68.06 0 0 1 8.66 4c1.93 1 3.82 2.2 5.65 3.43A69.19 69.19 0 0 1 391 98.67c1.4 1.68 2.72 3.46 3.95 5.27s2.39 3.72 3.44 5.64a68.29 68.29 0 0 1 8.29 32.55v264.52H233.55l-.44.76c-3.07 5.37-6.26 10.48-9.49 15.19L222 425h203V142.13a87.2 87.2 0 0 0-56.45-81.28z"})),Ee||(Ee=Le.createElement("path",{stroke:"#000",strokeMiterlimit:10,strokeWidth:3.81,d:"M119.8 408.28v46c28.49-1.12 50.73-10.6 69.61-29.58 19.45-19.55 36.17-50 52.61-96L363.94 1.9H305l-98.25 272.89-48.86-153h-54l71.7 184.18a75.67 75.67 0 0 1 0 55.12c-7.3 18.68-20.25 40.66-55.79 47.19z"})));var Pe=t(2514),Ae=t.n(Pe),Fe=t(8738),qe=t.n(Fe),Oe=t(7656),$e=t.n(Oe),Be=t(2485),Ue=t.n(Be);const He=({isOpen:e,onClose:s,id:t,upsellLink:r,title:i="",description:o="",benefits:n=[],note:a="",ctbId:l="",modalTitle:c})=>{const{isBlackFriday:u,isWooCommerceActive:p,isProductEntity:h,isWooSEOActive:m}=(0,ye.useSelect)(e=>{const s=e("yoast-seo/editor");return{isProductEntity:s.getIsProductEntity(),isWooCommerceActive:s.getIsWooCommerceActive(),isBlackFriday:s.isPromotionActive("black-friday-promotion"),isWooSEOActive:s.getIsWooSeoActive()}},[]),g=(0,w.useMemo)(()=>p&&h,[p,h]),y=(0,w.useRef)(null);return(0,C.jsx)(G.Modal,{isOpen:e,onClose:s,id:t,initialFocus:y,children:(0,C.jsx)(G.Modal.Panel,{className:"yst-max-w-md yst-p-0",hasCloseButton:!1,children:(0,C.jsxs)(G.Modal.Container,{children:[(0,C.jsxs)(G.Modal.Container.Header,{className:"yst-p-6 yst-border-b-slate-200 yst-border-b yst-flex yst-justify-start yst-gap-3 yst-items-center",children:[g?(0,C.jsx)($e(),{className:"yst-text-woo-light yst-w-6 yst-h-6 yst-scale-x-[-1]"}):(0,C.jsx)(Te,{className:"yst-fill-primary-500 yst-w-5 yst-h-5"}),(0,C.jsx)(G.Modal.Title,{as:"h3",className:Ue()(g?"yst-text-woo-light":"yst-text-primary-500","yst-text-base yst-font-normal"),children:c}),(0,C.jsx)(G.Modal.CloseButton,{className:"yst-top-2",onClick:s,screenReaderText:(0,d.__)("Close modal","wordpress-seo")})]}),(0,C.jsxs)(G.Modal.Container.Content,{className:"yst-p-0",children:[u&&(0,C.jsx)("div",{className:"yst-flex yst-font-semibold 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",children:(0,C.jsx)("div",{className:"yst-mx-auto",children:(0,d.__)("BLACK FRIDAY | 30% OFF","wordpress-seo")})}),(0,C.jsxs)("div",{className:"yst-py-6 yst-px-12",children:[(0,C.jsx)(G.Title,{as:"h3",className:"yst-mb-1 yst-leading-5 yst-text-sm yst-font-medium yst-text-slate-800",children:i}),(0,C.jsx)("p",{className:"yst-mb-2",children:o}),Array.isArray(n)&&n.length>0&&(0,C.jsx)("ul",{className:"yst-my-2",children:n.map((e,s)=>(0,C.jsxs)("li",{className:"yst-flex yst-gap-1 yst-mb-2",children:[(0,C.jsx)(qe(),{className:"yst-mr-1 yst-text-green-500 yst-w-[19.5px] yst-h-[19.5px] yst-flex-shrink-0"}),(0,C.jsx)("p",{className:"yst-text-slate-600",children:e})]},`${t}-upsell-benefit-${s}`))}),"function"==typeof n&&n(),(0,C.jsxs)("div",{className:"yst-text-center",children:[(0,C.jsxs)(G.Button,{as:"a",variant:"upsell",className:"yst-my-2 yst-gap-1.5 yst-w-full",href:r,target:"_blank","data-action":"load-nfd-ctb","data-ctb-id":l,ref:y,children:[(0,C.jsx)(Ae(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-shrink-0"}),(0,d.sprintf)(/* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */ /* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */ (0,d.__)("Explore %s","wordpress-seo"),g&&!m?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,C.jsx)("span",{className:"yst-sr-only",children:(0,d.__)("Opens in a new tab","wordpress-seo")})]}),(0,C.jsx)("div",{className:"yst-italic yst-text-slate-500 yst-mt-1",children:a})]})]})]})]})})})},De=({isOpen:e,closeModal:s,id:t,upsellLink:r})=>{const{locationContext:i}=(0,n.useRootContext)(),o=(0,Re.addQueryArgs)(wpseoAdminL10n[r],{context:i}),a=[Ce((0,d.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */ (0,d.__)("%1$sKeyphrase distribution:%2$s See if your keywords are spread evenly so search engines understand your topic","wordpress-seo"),"<span>","</span>"),{span:(0,C.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),Ce((0,d.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */ (0,d.__)("%1$sTitle check:%2$s Instantly spot missing titles and fix them for better click-through rates","wordpress-seo"),"<span>","</span>"),{span:(0,C.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),Ce((0,d.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */ (0,d.__)("%1$sSynonyms:%2$s Include synonyms of your keyphrase for a more natural flow and smarter suggestions","wordpress-seo"),"<span>","</span>"),{span:(0,C.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})})];return(0,C.jsx)(He,{isOpen:e,onClose:s,id:t,modalTitle:(0,d.__)("Get deeper SEO insights with Premium","wordpress-seo"),title:(0,d.__)("Find new ways to grow your rankings.","wordpress-seo"),description:(0,d.__)("Premium gives you advanced content checks that reveal new ranking opportunities and help you reach more readers.","wordpress-seo"),upsellLink:o,benefits:a,note:(0,d.__)("Upgrade to optimize with precision","wordpress-seo"),ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})};De.propTypes={isOpen:S().bool.isRequired,closeModal:S().func.isRequired,id:S().string.isRequired,upsellLink:S().string.isRequired};class We extends w.Component{constructor(e){super(e);const s=this.props.results;this.state={mappedResults:{}},null!==s&&(this.state={mappedResults:K(s,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:K(this.props.results,this.props.keywordKey)})}createMarkButton({ariaLabel:e,id:s,className:t,status:r,onClick:i,isPressed:o}){return(0,C.jsxs)(w.Fragment,{children:[(0,C.jsx)(j.IconButtonToggle,{marksButtonStatus:r,className:t,onClick:i,id:s,icon:"eye",pressed:o,ariaLabel:e}),this.props.shouldUpsellHighlighting&&(0,C.jsx)("div",{className:"yst-root",children:(0,C.jsx)(G.Badge,{className:"yst-absolute yst-px-[3px] yst-py-[3px] yst--end-[6.5px] yst--top-[6.5px]",size:"small",variant:"upsell",children:(0,C.jsx)(_e(),{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,s){this.props.setActiveMarker(e),s()}handleMarkButtonClick(e,s){const t=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;this.props.activeAIFixesButton&&this.props.setActiveAIFixesButton(null),t===this.props.activeMarker?this.deactivateMarker():this.activateMarker(t,s)}handleResultsChange(e,s,t){const r=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;r===this.props.activeMarker&&(t?(0,l.isUndefined)(s)||this.activateMarker(r,s):this.deactivateMarker())}focusOnKeyphraseField(e){const s=this.props.keywordKey,t=""===s?"focus-keyword-input-"+e:"yoast-keyword-input-"+s+"-"+e,r=document.getElementById(t);r.focus(),r.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}focusOnGooglePreviewField(e,s){const t=document.getElementById("yoast-google-preview-"+e+"-"+s);t.focus(),t.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}handleEditButtonClick(e,s){var t;null==s||null===(t=s.currentTarget)||void 0===t||t.blur();const r=this.props.location;"keyphrase"!==e?(["description","title","slug"].includes(e)&&this.handleGooglePreviewFocus(r,e),(0,p.doAction)("yoast.focus.input",e)):this.focusOnKeyphraseField(r)}handleGooglePreviewFocus(e,s){if("sidebar"===e)document.getElementById("yoast-search-appearance-modal-open-button").click(),setTimeout(()=>this.focusOnGooglePreviewField(s,"modal"),500);else{const t=document.getElementById("yoast-snippet-editor-metabox");t&&"false"===t.getAttribute("aria-expanded")?(t.click(),setTimeout(()=>this.focusOnGooglePreviewField(s,e),100)):this.focusOnGooglePreviewField(s,e)}}removeMarkers(){window.YoastSEO.analysis.applyMarks(new u.Paper("",{}),[])}renderHighlightingUpsell(e,s){const t=(0,d.__)("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(0,C.jsx)(De,{isOpen:e,closeModal:s,id:"yoast-premium-seo-analysis-highlighting-modal",upsellLink:this.props.highlightingUpsellLink,description:t})}render(){const{mappedResults:e}=this.state,{errorsResults:s,improvementsResults:t,goodResults:r,considerationsResults:i,problemsResults:o}=e,{upsellResults:n,resultCategoryLabels:a}=this.props,l={errors:(0,d.__)("Errors","wordpress-seo"),problems:(0,d.__)("Problems","wordpress-seo"),improvements:(0,d.__)("Improvements","wordpress-seo"),considerations:(0,d.__)("Considerations","wordpress-seo"),goodResults:(0,d.__)("Good results","wordpress-seo")},c=Object.assign(l,a);let u=this.props.marksButtonStatus;return"enabled"===u&&this.props.shortcodesForParsing.length>0&&(u="disabled"),(0,C.jsx)(w.Fragment,{children:(0,C.jsx)(Se.ContentAnalysis,{errorsResults:s,problemsResults:o,upsellResults:n,improvementsResults:t,considerationsResults:i,goodResults:r,activeMarker:this.props.activeMarker,onMarkButtonClick:this.handleMarkButtonClick,onEditButtonClick:this.handleEditButtonClick,marksButtonClassName:this.props.marksButtonClassName,editButtonClassName:this.props.editButtonClassName,marksButtonStatus:u,headingLevel:3,keywordKey:this.props.keywordKey,id:this.props.id,isPremium:this.props.isPremium,resultCategoryLabels:c,onResultChange:this.handleResultsChange,shouldUpsellHighlighting:this.props.shouldUpsellHighlighting,renderAIOptimizeButton:this.props.renderAIOptimizeButton,renderHighlightingUpsell:this.renderHighlightingUpsell,markButtonFactory:this.createMarkButton})})}}We.propTypes={results:S().array,upsellResults:S().array,marksButtonClassName:S().string,editButtonClassName:S().string,marksButtonStatus:S().oneOf(["enabled","disabled","hidden"]),setActiveMarker:S().func.isRequired,setMarkerPauseStatus:S().func.isRequired,setActiveAIFixesButton:S().func.isRequired,activeMarker:S().string,activeAIFixesButton:S().string,keywordKey:S().string,location:S().string,id:S().string,isPremium:S().bool,resultCategoryLabels:S().shape({errors:S().string,problems:S().string,improvements:S().string,considerations:S().string,goodResults:S().string}),shortcodesForParsing:S().array,shouldUpsellHighlighting:S().bool,highlightingUpsellLink:S().string,renderAIOptimizeButton:S().func},We.defaultProps={results:null,upsellResults:[],marksButtonStatus:"enabled",marksButtonClassName:"",editButtonClassName:"",activeMarker:null,activeAIFixesButton:null,keywordKey:"",location:"",id:"",isPremium:!1,resultCategoryLabels:{},shortcodesForParsing:[],shouldUpsellHighlighting:!1,highlightingUpsellLink:"",renderAIOptimizeButton:()=>{}};const ze=We,Ke=(0,ge.compose)([(0,ye.withSelect)(e=>{const{getActiveMarker:s,getIsPremium:t,getShortcodesForParsing:r,getActiveAIFixesButton:i}=e("yoast-seo/editor");return{activeMarker:s(),isPremium:t(),shortcodesForParsing:r(),activeAIFixesButton:i()}}),(0,ye.withDispatch)(e=>{const{setActiveMarker:s,setMarkerPauseStatus:t,setActiveAIFixesButton:r}=e("yoast-seo/editor");return{setActiveMarker:s,setMarkerPauseStatus:t,setActiveAIFixesButton:r}})])(ze),Ge=window.yoast.relatedKeyphraseSuggestions;function Ve({requestLimitReached:e,isSuccess:s,response:t,requestHasData:r,relatedKeyphrases:i}){return e?"requestLimitReached":!s&&function(e){return"invalid_json"===(null==e?void 0:e.code)||"fetch_error"===(null==e?void 0:e.code)||!(0,l.isEmpty)(e)&&"error"in e}(t)?"requestFailed":r?function(e){return e&&e.length>=4}(i)?"maxRelatedKeyphrases":null:"requestEmpty"}function Ye({keyphrase:e="",relatedKeyphrases:s=[],renderAction:t=null,requestLimitReached:r=!1,countryCode:i,setCountry:o,newRequest:n,response:a={},isRtl:l=!1,userLocale:c="en_US",isPending:d=!1,isSuccess:u=!1,requestHasData:p=!0,isPremium:h=!1,semrushUpsellLink:m="",premiumUpsellLink:g=""}){var y,x;const[f,b]=(0,w.useState)(i),v=(0,w.useCallback)(async()=>{n(i,e),b(i)},[i,e,n]);return(0,C.jsxs)(G.Root,{context:{isRtl:l},children:[!r&&!h&&(0,C.jsx)(Ge.PremiumUpsell,{url:g,className:"yst-mb-4"}),!r&&(0,C.jsx)(Ge.CountrySelector,{countryCode:i,activeCountryCode:f,onChange:o,onClick:v,className:"yst-mb-4",userLocale:c.split("_")[0]}),!d&&(0,C.jsx)(Ge.UserMessage,{variant:Ve({requestLimitReached:r,isSuccess:u,response:a,requestHasData:p,relatedKeyphrases:s}),upsellLink:m}),(0,C.jsx)(Ge.KeyphrasesTable,{relatedKeyphrases:s,columnNames:null==a||null===(y=a.results)||void 0===y?void 0:y.columnNames,data:null==a||null===(x=a.results)||void 0===x?void 0:x.rows,isPending:d,renderButton:t,className:"yst-mt-4"})]})}Ye.propTypes={keyphrase:S().string,relatedKeyphrases:S().array,renderAction:S().func,requestLimitReached:S().bool,countryCode:S().string.isRequired,setCountry:S().func.isRequired,newRequest:S().func.isRequired,response:S().object,isRtl:S().bool,userLocale:S().string,isPending:S().bool,isSuccess:S().bool,requestHasData:S().bool,isPremium:S().bool,semrushUpsellLink:S().string,premiumUpsellLink:S().string};const Ze=(0,ge.compose)([(0,ye.withSelect)(e=>{const{getFocusKeyphrase:s,getSEMrushSelectedCountry:t,getSEMrushRequestLimitReached:r,getSEMrushRequestResponse:i,getSEMrushRequestIsSuccess:o,getSEMrushIsRequestPending:n,getSEMrushRequestHasData:a,getPreference:l,getIsPremium:c,selectLinkParams:d}=e("yoast-seo/editor");return{keyphrase:s(),countryCode:t(),requestLimitReached:r(),response:i(),isSuccess:o(),isPending:n(),requestHasData:a(),isRtl:l("isRtl",!1),userLocale:l("userLocale","en_US"),isPremium:c(),semrushUpsellLink:(0,Re.addQueryArgs)("https://yoa.st/semrush-prices",d()),premiumUpsellLink:(0,Re.addQueryArgs)("https://yoa.st/413",d())}}),(0,ye.withDispatch)(e=>{const{setSEMrushChangeCountry:s,setSEMrushNewRequest:t}=e("yoast-seo/editor");return{setCountry:e=>{s(e)},newRequest:(e,s)=>{t(e,s)}}})])(Ye);function Qe(e,s,t,r){return new Promise((i,o)=>{jQuery.ajax({type:e,url:s,beforeSend:t?e=>{e.setRequestHeader("X-WP-Nonce",t)}:null,data:r,dataType:"json",success:i,error:o})})}const Je=window.wp.sanitize,Xe="SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLE",es="SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLES_BATCH";function ss(e,s,t="",r=!1){const i="string"==typeof s?(0,_.decodeHTML)(s):s;return{type:Xe,name:e,value:i,label:t,hidden:r}}function ts(e){return e.charAt(0).toUpperCase()+e.slice(1)}const{stripHTMLTags:rs}=_.strings,is=["slug","content","contentImage","snippetPreviewImageURL"];function os(e,s){(0,l.forEach)(e,(e,t)=>{is.includes(t)||s.dispatch(ss(t,e))})}function ns(e){if(!["ct_","cf_","pt_"].includes(e.substring(0,3)))return e.replace(/_/g," ");const s=e.slice(0,3);switch(-1!==(e=e.slice(3)).indexOf("desc_")&&(e=e.slice(5)+" description"),s){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 as(e){return ts(e=ns(e))}function ls(e,s){return e.push({name:s.name,label:s.label||as(s.name),value:s.value}),e}function cs(e,s="_"){return e.replace(/\s/g,s)}function ds(e){return{name:"cf_"+cs(e),label:ts(e+" (custom field)")}}function us(e){const s=cs(e);return{name:"ct_"+s,label:ts(e+" (custom taxonomy)"),descriptionName:"ct_desc_"+s,descriptionLabel:ts(e+" description (custom taxonomy)")}}function ps(e,s){if(!e.custom_taxonomies)return e;const t={};return(0,l.forEach)(e.custom_taxonomies,(e,s)=>{const{name:r,label:i,descriptionName:o,descriptionLabel:n}=us(s),a="string"==typeof e.name?(0,_.decodeHTML)(e.name):e.name,l="string"==typeof e.description?(0,_.decodeHTML)(e.description):e.description;t[r]={value:a,label:i},t[o]={value:l,label:n}}),s.dispatch(function(e){return{type:es,updatedVariables:e}}(t)),(0,l.omit)({...e},"custom_taxonomies")}function hs(e,s){return e.custom_fields?((0,l.forEach)(e.custom_fields,(e,t)=>{const{name:r,label:i}=ds(t);s.dispatch(ss(r,e,i))}),(0,l.omit)({...e},"custom_fields")):e}function ms(e,s=156){return(e=(e=(0,Je.stripTags)(e)).trim()).length<=s||(e=e.substring(0,s),/\s/.test(e)&&(e=e.substring(0,e.lastIndexOf(" ")))),e}const gs=function(e){const s=(0,l.get)(window,["YoastSEO","app","pluggable"],!1);if(!s||!(0,l.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){const s=(0,l.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],l.identity);return{url:e.url,title:rs(s(e.title)),description:rs(s(e.description)),filteredSEOTitle:e.filteredSEOTitle?rs(s(e.filteredSEOTitle)):""}}(e);const t=s._applyModifications.bind(s);return{url:e.url,title:rs(t("data_page_title",e.title)),description:rs(t("data_meta_desc",e.description)),filteredSEOTitle:e.filteredSEOTitle?rs(t("data_page_title",e.filteredSEOTitle)):""}};var ys="score-text",xs="image yoast-logo svg",fs=jQuery;function ws(e,s,t=null){var r,i,o,n,a;if(null!==t)return(0,l.get)(t,s,"");const c=(0,ye.select)("yoast-seo/editor").getIsPremium(),u={na:(0,d.__)("Not available","wordpress-seo"),bad:(0,d.__)("Needs improvement","wordpress-seo"),ok:(0,d.__)("OK","wordpress-seo"),good:(0,d.__)("Good","wordpress-seo")},p={keyword:{label:c?(0,d.__)("Premium SEO analysis:","wordpress-seo"):(0,d.__)("SEO analysis:","wordpress-seo"),anchor:"yoast-seo-analysis-collapsible-metabox",status:u},content:{label:(0,d.__)("Readability analysis:","wordpress-seo"),anchor:"yoast-readability-analysis-collapsible-metabox",status:u},"inclusive-language":{label:(0,d.__)("Inclusive language:","wordpress-seo"),anchor:"yoast-inclusive-language-analysis-collapsible-metabox",status:{...u,ok:(0,d.__)("Potentially non-inclusive","wordpress-seo")}}};return null!=p&&null!==(r=p[e])&&void 0!==r&&null!==(i=r.status)&&void 0!==i&&i[s]?`<a href="#${null===(o=p[e])||void 0===o?void 0:o.anchor}">${null===(n=p[e])||void 0===n?void 0:n.label}</a> <strong>${null===(a=p[e])||void 0===a?void 0:a.status[s]}</strong>`:""}t(6702);S().string.isRequired;var bs=t(818),vs=t.n(bs);S().string.isRequired,S().string.isRequired,S().shape({src:S().string.isRequired,width:S().string,height:S().string}).isRequired,S().shape({value:S().bool.isRequired,status:S().string.isRequired,set:S().func.isRequired}).isRequired,S().string,S().string,S().string;const ks=({handleRefreshClick:e,supportLink:s})=>(0,C.jsxs)("div",{className:"yst-flex yst-gap-2",children:[(0,C.jsx)(G.Button,{onClick:e,children:(0,d.__)("Refresh this page","wordpress-seo")}),(0,C.jsx)(G.Button,{variant:"secondary",as:"a",href:s,target:"_blank",rel:"noopener",children:(0,d.__)("Contact support","wordpress-seo")})]});ks.propTypes={handleRefreshClick:S().func.isRequired,supportLink:S().string.isRequired};const Ss=({handleRefreshClick:e,supportLink:s})=>(0,C.jsxs)("div",{className:"yst-grid yst-grid-cols-1 yst-gap-y-2",children:[(0,C.jsx)(G.Button,{className:"yst-order-last",onClick:e,children:(0,d.__)("Refresh this page","wordpress-seo")}),(0,C.jsx)(G.Button,{variant:"secondary",as:"a",href:s,target:"_blank",rel:"noopener",children:(0,d.__)("Contact support","wordpress-seo")})]});Ss.propTypes={handleRefreshClick:S().func.isRequired,supportLink:S().string.isRequired};const js=({error:e,children:s=null})=>(0,C.jsxs)("div",{role:"alert",className:"yst-max-w-screen-sm yst-p-8 yst-space-y-4",children:[(0,C.jsx)(G.Title,{children:(0,d.__)("Something went wrong. An unexpected error occurred.","wordpress-seo")}),(0,C.jsx)("p",{children:(0,d.__)("We're very sorry, but it seems like the following error has interrupted our application:","wordpress-seo")}),(0,C.jsx)(G.Alert,{variant:"error",children:(null==e?void 0:e.message)||(0,d.__)("Undefined error message.","wordpress-seo")}),(0,C.jsx)("p",{children:(0,d.__)("Unfortunately, this means that any unsaved changes in this section will be lost. You can try and refresh this page to resolve the problem. If this error still occurs, please get in touch with our support team, and we'll get you all the help you need!","wordpress-seo")}),s]});js.propTypes={error:S().object.isRequired,children:S().node},js.VerticalButtons=Ss,js.HorizontalButtons=ks;const _s={variant:{lg:{grid:"yst-grid lg:yst-grid-cols-3 lg:yst-gap-12",col1:"yst-col-span-1",col2:"lg:yst-mt-0 lg:yst-col-span-2"},xl:{grid:"yst-grid xl:yst-grid-cols-3 xl:yst-gap-12",col1:"yst-col-span-1",col2:"xl:yst-mt-0 xl:yst-col-span-2"},"2xl":{grid:"yst-grid 2xl:yst-grid-cols-3 2xl:yst-gap-12",col1:"yst-col-span-1",col2:"2xl:yst-mt-0 2xl:yst-col-span-2"}}},Rs=({id:e,children:s,title:t,description:r=null,variant:i="2xl"})=>(0,C.jsxs)("section",{id:e,className:_s.variant[i].grid,children:[(0,C.jsx)("div",{className:_s.variant[i].col1,children:(0,C.jsxs)("div",{className:"yst-max-w-screen-sm",children:[(0,C.jsx)(G.Title,{as:"h2",size:"4",children:t}),r&&(0,C.jsx)("p",{className:"yst-mt-2",children:r})]})}),(0,C.jsxs)("fieldset",{className:`yst-min-w-0 yst-mt-8 ${_s.variant[i].col2}`,children:[(0,C.jsx)("legend",{className:"yst-sr-only",children:t}),(0,C.jsx)("div",{className:"yst-space-y-8",children:s})]})]});Rs.propTypes={id:S().string,children:S().node.isRequired,title:S().node.isRequired,description:S().node,variant:S().oneOf(Object.keys(_s.variant))};const Cs=window.ReactDOM;var Is,Es,Ls;(Es=Is||(Is={})).Pop="POP",Es.Push="PUSH",Es.Replace="REPLACE",function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(Ls||(Ls={})),new Set(["lazy","caseSensitive","path","id","index","children"]),Error;const Ns=["post","put","patch","delete"],Ms=(new Set(Ns),["get",...Ns]);new Set(Ms),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred"),Le.Component,Le.startTransition,new Promise(()=>{}),Le.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}var Ts,Ps,As,Fs;new Map,Le.startTransition,Cs.flushSync,Le.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,(Fs=Ts||(Ts={})).UseScrollRestoration="useScrollRestoration",Fs.UseSubmit="useSubmit",Fs.UseSubmitFetcher="useSubmitFetcher",Fs.UseFetcher="useFetcher",Fs.useViewTransitionState="useViewTransitionState",(As=Ps||(Ps={})).UseFetcher="useFetcher",As.UseFetchers="useFetchers",As.UseScrollRestoration="useScrollRestoration",S().string.isRequired,S().string;const qs=({href:e,children:s=null,...t})=>(0,C.jsxs)(G.Link,{target:"_blank",rel:"noopener noreferrer",...t,href:e,children:[s,(0,C.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */ (0,d.__)("(Opens in a new browser tab)","wordpress-seo")})]});qs.propTypes={href:S().string.isRequired,children:S().node};(0,d.__)("Create optimized SEO titles & meta descriptions in seconds","wordpress-seo"),(0,d.__)("Apply AI suggestions to improve content in 1 click","wordpress-seo"),(0,d.__)("Manage redirects with ease and without extra plugins","wordpress-seo"),(0,d.__)("Optimize pages for multiple keywords with guidance","wordpress-seo"),(0,d.__)("Add product details to help your listings stand out","wordpress-seo"),(0,d.__)("Make sure search engines show the right version of your product page","wordpress-seo"),(0,d.__)("Create optimized SEO titles & meta descriptions with AI","wordpress-seo"),(0,d.__)("Receive clear SEO and readability guidance to optimize your products","wordpress-seo"),(0,d.__)("Generate SEO optimized metadata in seconds with AI","wordpress-seo"),(0,d.__)("Make your articles visible, be seen in Google News","wordpress-seo"),(0,d.__)("Built to get found by search, AI, and real users","wordpress-seo"),(0,d.__)("Easy Local SEO. Show up in Google Maps results","wordpress-seo"),(0,d.__)("Internal links and redirect management, easy","wordpress-seo"),(0,d.__)("Access to friendly help when you need it, day or night","wordpress-seo");S().string.isRequired,S().object.isRequired,S().func.isRequired,S().bool.isRequired,t(3473),S().string.isRequired,S().object,S().func.isRequired,S().bool.isRequired,S().string.isRequired,S().object.isRequired,S().string.isRequired,S().func.isRequired,S().bool.isRequired;var Os=t(5074),$s=t.n(Os);const Bs=({isOpen:e,onClose:s=l.noop,onDiscard:t=l.noop,title:r,description:i,dismissLabel:o,discardLabel:n})=>{const a=(0,G.useSvgAria)();return(0,C.jsx)(G.Modal,{isOpen:e,onClose:s,children:(0,C.jsxs)(G.Modal.Panel,{closeButtonScreenReaderText:(0,d.__)("Close","wordpress-seo"),children:[(0,C.jsxs)("div",{className:"sm:yst-flex sm:yst-items-start",children:[(0,C.jsx)("div",{className:"yst-mx-auto yst-flex-shrink-0 yst-flex yst-items-center yst-justify-center yst-h-12 yst-w-12 yst-rounded-full yst-bg-red-100 sm:yst-mx-0 sm:yst-h-10 sm:yst-w-10",children:(0,C.jsx)($s(),{className:"yst-h-6 yst-w-6 yst-text-red-600",...a})}),(0,C.jsxs)("div",{className:"yst-mt-3 yst-text-center sm:yst-mt-0 sm:yst-ms-4 sm:yst-text-start",children:[(0,C.jsx)(G.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900 yst-mb-3",children:r}),(0,C.jsx)(G.Modal.Description,{className:"yst-text-sm yst-text-slate-500",children:i})]})]}),(0,C.jsxs)("div",{className:"yst-flex yst-flex-col sm:yst-flex-row-reverse yst-gap-3 yst-mt-6",children:[(0,C.jsx)(G.Button,{type:"button",variant:"error",onClick:t,className:"yst-block",children:n}),(0,C.jsx)(G.Button,{type:"button",variant:"secondary",onClick:s,className:"yst-block",children:o})]})]})})};Bs.propTypes={isOpen:S().bool.isRequired,onClose:S().func,onDiscard:S().func,title:S().string.isRequired,description:S().string.isRequired,dismissLabel:S().string.isRequired,discardLabel:S().string.isRequired};const Us=window.yoast.reactHelmet,Hs="error",Ds="loading",Ws="showPlay",zs="askPermission",Ks="isPlaying",Gs=({videoId:e,thumbnail:s,wistiaEmbedPermission:t,className:r=""})=>{const[i,o]=(0,w.useState)(t.value?Ks:Ws),n=(0,w.useCallback)(()=>o(Ks),[o]),a=(0,w.useCallback)(()=>{t.value?n():o(zs)},[t.value,n,o]),l=(0,w.useCallback)(()=>o(Ws),[o]),c=(0,w.useCallback)(()=>{t.set(!0),n()},[t.set,n]);return(0,C.jsxs)(C.Fragment,{children:[t.value&&(0,C.jsx)(Us.Helmet,{children:(0,C.jsx)("script",{src:"https://fast.wistia.com/assets/external/E-v1.js",async:!0})}),(0,C.jsxs)("div",{className:Ue()("yst-relative yst-w-full yst-h-0 yst-pt-[47.25%] yst-overflow-hidden yst-rounded-md yst-drop-shadow-md yst-bg-white",r),children:[i===Ws&&(0,C.jsx)("button",{type:"button",className:"yst-absolute yst-inset-0 yst-button yst-p-0 yst-border-none yst-bg-white yst-transition-opacity yst-duration-1000 yst-opacity-100",onClick:a,children:(0,C.jsx)("img",{className:"yst-w-full yst-h-auto yst-object-contain",alt:"",loading:"lazy",decoding:"async",...s})}),i===zs&&(0,C.jsxs)("div",{className:"yst-absolute yst-inset-0 yst-flex yst-flex-col yst-items-center yst-justify-center yst-bg-white",children:[(0,C.jsxs)("p",{className:"yst-max-w-xs yst-mx-auto yst-text-center",children:[t.status===Ds&&(0,C.jsx)(G.Spinner,{}),t.status!==Ds&&(0,d.sprintf)(/* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */ /* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */ (0,d.__)("To see this video, you need to allow %1$s to load embedded videos from %2$s.","wordpress-seo"),"Yoast SEO","Wistia")]}),(0,C.jsxs)("div",{className:"yst-flex yst-mt-6 yst-gap-x-4",children:[(0,C.jsx)(G.Button,{type:"button",variant:"secondary",onClick:l,disabled:t.status===Ds,children:(0,d.__)("Deny","wordpress-seo")}),(0,C.jsx)(G.Button,{type:"button",variant:"primary",onClick:c,disabled:t.status===Ds,children:(0,d.__)("Allow","wordpress-seo")})]})]}),t.value&&i===Ks&&(0,C.jsxs)("div",{className:"yst-absolute yst-w-full yst-h-full yst-top-0 yst-right-0",children:[null===e&&(0,C.jsx)(G.Spinner,{className:"yst-h-full yst-mx-auto"}),null!==e&&(0,C.jsx)("div",{className:`wistia_embed wistia_async_${e} videoFoam=true`})]})]})]})};var Vs,Ys;function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Zs.apply(null,arguments)}Gs.propTypes={videoId:S().string.isRequired,thumbnail:S().shape({src:S().string.isRequired,width:S().string,height:S().string}).isRequired,wistiaEmbedPermission:S().shape({value:S().bool.isRequired,status:S().string.isRequired,set:S().func.isRequired}).isRequired,hasPadding:S().bool},t(5687),S().bool.isRequired,S().func.isRequired,S().func,S().string;const Qs=({onGiveConsent:e,learnMoreLink:s,privacyPolicyLink:t,termsOfServiceLink:r,imageLink:i})=>{const{onClose:o,initialFocus:n}=(0,G.useModalContext)(),[a,l]=(0,G.useToggleState)(!1),c=(0,w.useMemo)(()=>({src:i,width:"432",height:"244"}),[i]),u=Ce((0,d.sprintf)(/* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */ /* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */ (0,d.__)("I approve the %1$sTerms of Service%2$s & %3$sPrivacy Policy%4$s of the Yoast AI service. This includes consenting to the collection and use of data to improve user experience.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,C.jsx)(qs,{href:r}),a2:(0,C.jsx)(qs,{href:t})}),[p,h]=(0,G.useToggleState)(!1),m=(0,w.useCallback)(async()=>{h(),await e(),h()},[e]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:(0,C.jsx)("div",{className:"yst-relative yst-w-full",children:(0,C.jsx)("img",{className:"yst-w-full yst-h-auto yst-rounded-md yst-drop-shadow-md",alt:"",loading:"lazy",decoding:"async",...c})})}),(0,C.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,C.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,C.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:(0,d.sprintf)(/* translators: %s expands to Yoast AI. */ /* translators: %s expands to Yoast AI. */ (0,d.__)("Grant consent for %s","wordpress-seo"),"Yoast AI")}),(0,C.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:Ce((0,d.sprintf)(/* translators: %1$s is a break tag; %2$s and %3$s are anchor tag; %4$s is the arrow icon. */ /* translators: %1$s is a break tag; %2$s and %3$s are anchor tag; %4$s is the arrow icon. */ (0,d.__)("Enable AI-powered SEO! Use all Yoast AI features to boost your efficiency. Just give us the green light. %1$s%2$sLearn more%3$s%4$s","wordpress-seo"),"<br/>","<a>","<ArrowNarrowRightIcon />","</a>"),{a:(0,C.jsx)(qs,{href:s,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,C.jsx)(vs(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,C.jsx)("br",{})})})]}),(0,C.jsx)("div",{className:"yst-flex yst-w-full yst-mt-6",children:(0,C.jsx)("hr",{className:"yst-w-full yst-text-gray-200"})}),(0,C.jsxs)("div",{className:"yst-flex yst-items-start yst-mt-4",children:[(0,C.jsx)("input",{type:"checkbox",id:"yst-ai-consent-checkbox",name:"yst-ai-consent-checkbox",checked:a,value:a?"true":"false",onChange:l,className:"yst-checkbox__input",ref:n}),(0,C.jsx)("label",{htmlFor:"yst-ai-consent-checkbox",className:"yst-label yst-checkbox__label yst-text-xs yst-font-normal yst-text-slate-500",children:u})]}),(0,C.jsx)("div",{className:"yst-w-full yst-flex yst-mt-4",children:(0,C.jsxs)(G.Button,{as:"button",className:"yst-grow",size:"large",disabled:!a,onClick:m,children:[p&&(0,C.jsx)(G.Spinner,{className:"yst-me-2"}),(0,d.__)("Grant consent","wordpress-seo")]})}),(0,C.jsx)(G.Button,{as:"button",className:"yst-mt-4",variant:"tertiary",onClick:o,children:(0,d.__)("Close","wordpress-seo")})]})]})};Qs.propTypes={onGiveConsent:S().func.isRequired,learnMoreLink:S().string.isRequired,privacyPolicyLink:S().string.isRequired,termsOfServiceLink:S().string.isRequired,imageLink:S().string.isRequired};const Js={termsOfService:"https://yoa.st/ai-generator-terms-of-service",privacyPolicy:"https://yoa.st/ai-generator-privacy-policy",learnMore:"https://yoa.st/ai-generator-learn-more"},Xs=({storeName:e,onConsentGranted:s,linkStoreName:t,links:r={}})=>{const i=(0,w.useMemo)(()=>({...Js,...r}),[r]),{termsOfServiceLink:o,privacyPolicyLink:n,learnMoreLink:a,imageLink:l,endpoint:c}=(0,ye.useSelect)(s=>{const r=s(t),o=s(e);return{termsOfServiceLink:r.selectLink(i.termsOfService),privacyPolicyLink:r.selectLink(i.privacyPolicy),learnMoreLink:r.selectLink(i.learnMore),imageLink:r.selectImageLink("ai-consent.jpg"),endpoint:o.selectAiGeneratorConsentEndpoint()}},[t,e,i]),{storeAiGeneratorConsent:d}=(0,ye.useDispatch)(e),u=(0,w.useCallback)(async()=>{await d(!0,c),s()},[d,s,c]);return(0,C.jsx)(Qs,{termsOfServiceLink:o,privacyPolicyLink:n,learnMoreLink:a,imageLink:l,onGiveConsent:u})};Xs.propTypes={storeName:S().string.isRequired,onConsentGranted:S().func.isRequired,linkStoreName:S().string.isRequired,links:S().shape({termsOfService:S().string,privacyPolicy:S().string,learnMore:S().string})};t(2863);window.yoast.aiFrontend;const et="yoast-seo/ai-generator",st="yoast-seo/editor",tt="google",rt="social",it="twitter",ot="title",nt="description",at="post",lt="term",ct={post:"title",term:"term_title"},dt=(0,l.mapValues)(ct,e=>`%%${e}%%`),ut={idle:"idle",loading:"loading",success:"success",error:"error"},pt="success",ht="error",mt="abort",gt=window.wp.apiFetch;var yt=t.n(gt);const xt=["_formal","_informal","_ao90"],ft=e=>{for(const s of xt)if(e.endsWith(s))return e.slice(0,-s.length);return e};let wt,bt=!1;const vt=async({endpoint:e,data:s})=>{let t;const r=1e3*(0,l.get)(window,"wpseoAiGenerator.requestTimeout",30);try{wt&&wt.abort(),wt=new AbortController,bt=!1,t=setTimeout(()=>{bt=!0,wt.abort()},r);const i=await yt()({path:e,method:"POST",data:s,parse:!1,signal:wt.signal}),o=await i.json();return{status:pt,payload:o}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return bt?{status:ht,payload:{message:"timeout",code:408}}:{status:mt};const{message:s,missingLicenses:t,errorIdentifier:r}=await(async e=>{try{const s=e.body.getReader(),{value:t}=await s.read(),r=new TextDecoder("utf-8").decode(t);return console.error(r),JSON.parse(r)}catch(e){return{message:"Unknown"}}})(e);return{status:ht,payload:{message:s,code:e.status||500,missingLicenses:t,errorIdentifier:r}}}finally{clearTimeout(t)}},kt="\\–\\-\\(\\)_\\[\\]’‘“”〝〞〟‟„\"'.?!:;,¿¡«»‹›—×+&۔؟،؛。。!‼?⁇⁉⁈‥…・ー、〃〄〆〇〈〉《》「」『』【】〒〓〔〕〖〗〘〙〚〛〜〝〞〟〠〶〼〽{}|~⦅⦆「」、[]・¥$%@&'()*/:;<>\\\<>";kt.split(""),new RegExp("^["+kt+"]+"),new RegExp("["+kt+"]+$");new RegExp("["+kt+"#$%&*+/=@^`{|}~ -¿–-⁊ -₠-⃀]","g");const St=e=>{const s={...e};return""!==e.value||["title","excerpt","excerpt_only"].includes(e.name)||(s.value="%%"+e.name+"%%"),s.badge=`<badge>${e.label}</badge>`,s},jt={editType:ot,previewType:tt,postType:"post",contentType:at},_t=(0,w.createContext)(jt),Rt=(_t.Provider,()=>(0,w.useContext)(_t)),Ct=()=>(0,w.useContext)(n.LocationContext),It=e=>{const s=(0,w.useRef)(null);return(0,w.useCallback)(t=>{(0,l.attempt)(()=>s.current&&s.current.disconnect()),null!==t&&(s.current=new ResizeObserver(s=>{(0,l.forEach)(s,s=>e(s))}),s.current.observe(t))},[e])},Et=window.yoast.reduxJsToolkit,Lt=(0,Et.createSlice)({name:"suggestions",initialState:{status:ut.loading,error:{code:200,message:""},entities:[],selected:""},reducers:{setLoading:e=>{e.status=ut.loading},setSuccess:(e,{payload:s})=>{e.status=ut.success,e.selected=s[0],e.entities.push(...s)},setError:(e,{payload:s})=>{e.status=ut.error,e.error=s},setSelected:(e,{payload:s})=>{e.selected=s}}}),Nt=e=>{switch(e){case rt:return"Facebook";case it:return"Twitter";default:return"Google"}},Mt=window.yoast.searchMetadataPreviews,Tt="usageCount",Pt="fetchUsageCount",At=`${Pt}/success`,Ft={errorCode:null,errorIdentifier:null,errorMessage:null},qt=(0,Et.createSlice)({name:Tt,initialState:{status:"idle",count:0,limit:10,endpoint:"",error:Ft},reducers:{addUsageCount:(e,{payload:s=1})=>{e.count+=s},setUsageCount:(e,{payload:s})=>{e.count=s},setUsageCountEndpoint:(e,{payload:s})=>{e.endpoint=s},setUsageCountLimit:(e,{payload:s})=>{e.limit=s}},extraReducers:e=>{e.addCase(`${Pt}/request`,e=>{e.status=Ds,e.error=Ft}),e.addCase(At,(e,{payload:s})=>{e.status="success",e.count=s.count,e.limit=s.limit,e.error=Ft}),e.addCase(`${Pt}/${Hs}`,(e,{payload:s})=>{e.status="error",e.error={errorCode:502,...s}})}}),Ot=(qt.getInitialState,{selectUsageCountStatus:e=>(0,l.get)(e,[Tt,"status"],qt.getInitialState()),selectUsageCount:e=>(0,l.get)(e,[Tt,"count"],qt.getInitialState().count),selectUsageCountLimit:e=>(0,l.get)(e,[Tt,"limit"],qt.getInitialState().limit),selectUsageCountEndpoint:e=>(0,l.get)(e,[Tt,"endpoint"],qt.getInitialState().endpoint),selectUsageCountError:e=>(0,l.get)(e,[Tt,"error"],qt.getInitialState().error)});Ot.selectUsageCountRemaining=(0,Et.createSelector)([Ot.selectUsageCount,Ot.selectUsageCountLimit],(e,s)=>Math.max(s-e,0)),Ot.isUsageCountLimitReached=(0,Et.createSelector)([Ot.selectUsageCount,Ot.selectUsageCountLimit,Ot.selectUsageCountError],(e,s,t)=>429===t.errorCode||e>=s),qt.actions,qt.reducer;const $t=()=>{const e=(0,ye.useSelect)(e=>e(st).selectLink("https://yoa.st/ai-common-errors"),[]),s=(0,ye.useSelect)(e=>e(st).selectAdminLink("?page=wpseo_page_support"),[]);return(0,C.jsxs)(G.Alert,{variant:"error",children:[(0,C.jsx)("span",{className:"yst-block yst-font-medium",children:(0,d.__)("Something went wrong","wordpress-seo")}),(0,C.jsx)("p",{className:"yst-mt-2",children:Ce((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ (0,d.__)("Please try again later. If this issue persists, you can learn more about possible reasons for this error on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,C.jsx)(qs,{variant:"error",href:e}),a2:(0,C.jsx)(qs,{variant:"error",href:s})})})]})},Bt=()=>{const e=(0,ye.useSelect)(e=>e(st).selectLink("https://yoa.st/ai-common-errors"),[]),s=(0,ye.useSelect)(e=>e(st).selectAdminLink("?page=wpseo_page_support"),[]);return(0,C.jsxs)(G.Alert,{variant:"error",children:[(0,C.jsx)("span",{className:"yst-block yst-font-medium",children:(0,d.__)("Not enough content","wordpress-seo")}),(0,C.jsx)("p",{className:"yst-mt-2",children:Ce((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ (0,d.__)("Please add more content to ensure a valuable AI suggestion. Learn more on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,C.jsx)(qs,{variant:"error",href:e}),a2:(0,C.jsx)(qs,{variant:"error",href:s})})})]})},Ut=()=>{const e=(0,ye.useSelect)(e=>e(st).selectAdminLink("?page=wpseo_page_settings#/site-features#card-wpseo-keyword_analysis_active"),[]),s=(0,w.useCallback)(()=>{window.location.reload()},[]),{onClose:t}=(0,G.useModalContext)();return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(G.Alert,{variant:"error",children:[(0,C.jsx)("span",{className:"yst-block yst-font-medium",children:(0,d.__)("SEO analysis required","wordpress-seo")}),(0,C.jsx)("p",{className:"yst-mt-2",children:Ce((0,d.sprintf)( /** * translators: * %1$s expands to Yoast SEO. * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page. * %4$s expands to Yoast AI. */ /** * translators: * %1$s expands to Yoast SEO. * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page. * %4$s expands to Yoast AI. */ (0,d.__)("%4$s requires the SEO analysis to be enabled. To enable it, please navigate to %2$sSite features%3$s in %1$s, turn on the SEO analysis, and click 'Save changes'. If it's disabled in your WordPress user profile, access your profile and enable it there. Please contact your administrator if you don't have access to these settings.","wordpress-seo"),"Yoast SEO","<a>","</a>","Yoast AI"),{a:(0,C.jsx)(qs,{variant:"error",href:e})})})]}),(0,C.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,C.jsx)(G.Button,{variant:"secondary",onClick:t,children:(0,d.__)("Close","wordpress-seo")}),(0,C.jsx)(G.Button,{className:"yst-revoke-button",variant:"primary",onClick:s,children:(0,d.__)("Refresh page","wordpress-seo")})]})]})},Ht=()=>{const e=(0,ye.useSelect)(e=>e(st).selectLink("https://yoa.st/ai-generator-rate-limit-help"),[]);return(0,C.jsxs)(G.Alert,{variant:"error",children:[(0,C.jsx)("span",{className:"yst-block yst-font-medium",children:(0,d.__)("You've reached the Yoast AI rate limit","wordpress-seo")}),(0,C.jsx)("p",{className:"yst-mt-2",children:Ce((0,d.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ (0,d.__)("You might have reached your Yoast AI rate limit for a specific time frame or your sparks limit for this month. If you have reached your rate limit, please reduce the frequency of your requests to continue using Yoast AI features. Our %1$shelp article%2$s provides guidance on effectively planning and pacing your requests for an optimized workflow.","wordpress-seo"),"<a>","</a>"),{a:(0,C.jsx)(qs,{variant:"error",href:e})})})]})},Dt=({invalidSubscriptions:e=[]})=>{const{newYoastWooLink:s,activateYoastWooLink:t,newPremiumLink:r,activatePremiumLink:i,bustSubscriptionCacheEndpoint:o}=(0,ye.useSelect)(e=>{const s=e(st);return{newYoastWooLink:s.selectLink("https://yoa.st/ai-generator-new-yoast-woocommerce"),activateYoastWooLink:s.selectLink("https://yoa.st/ai-generator-activate-yoast-woocommerce"),newPremiumLink:s.selectLink("https://yoa.st/ai-generator-new-premium"),activatePremiumLink:s.selectLink("https://yoa.st/ai-generator-activate-premium"),bustSubscriptionCacheEndpoint:e(et).selectBustSubscriptionCacheEndpoint()}},[]),{onClose:n}=(0,G.useModalContext)(),a=(0,w.useCallback)(async()=>{try{await yt()({path:o,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[]);let l,c,u;return e.includes("Yoast WooCommerce SEO")?(l="Yoast WooCommerce SEO",c=t,u=s):e.includes("Yoast SEO Premium")&&(l="Yoast SEO Premium",c=i,u=r),(0,C.jsxs)(w.Fragment,{children:[(0,C.jsxs)(G.Alert,{variant:"error",children:[(0,C.jsx)("span",{className:"yst-block yst-font-medium",children:(0,d.__)("Subscription required","wordpress-seo")}),(0,C.jsx)("p",{className:"yst-mt-2",children:Ce((0,d.sprintf)( /** * translators: * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. * %2$s expands to MyYoast. * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription. * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription. **/ /** * translators: * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. * %2$s expands to MyYoast. * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription. * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription. **/ (0,d.__)("To access this feature, you need an active %1$s subscription. Please %3$sactivate your subscription in %2$s%4$s or %5$sget a new %1$s subscription%6$s. Afterward, refresh this page. It may take up to 30 seconds for the feature to function correctly.","wordpress-seo"),l,"MyYoast","<Activate>","</Activate>","<New>","</New>"),{Activate:(0,C.jsx)(qs,{variant:"error",href:c}),New:(0,C.jsx)(qs,{variant:"error",href:u})})})]}),(0,C.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,C.jsx)(G.Button,{variant:"secondary",onClick:n,children:(0,d.__)("Close","wordpress-seo")}),(0,C.jsx)(G.Button,{variant:"primary",onClick:a,children:(0,d.__)("Refresh page","wordpress-seo")})]})]})};Dt.propTypes={invalidSubscriptions:S().arrayOf(S().string)};const Wt=()=>{const e=(0,ye.useSelect)(e=>e(st).selectLink("https://yoa.st/ai-common-errors"),[]),s=(0,ye.useSelect)(e=>e(st).selectAdminLink("?page=wpseo_page_support"),[]);return(0,C.jsxs)(G.Alert,{variant:"error",children:[(0,C.jsx)("span",{className:"yst-block yst-font-medium",children:(0,d.__)("Connection timeout","wordpress-seo")}),(0,C.jsx)("p",{className:"yst-mt-2",children:Ce((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ (0,d.__)("It seems that a connection timeout has occurred. Please check your internet connection and try again later. Learn more on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,C.jsx)(qs,{variant:"error",href:e}),a2:(0,C.jsx)(qs,{variant:"error",href:s})})})]})},zt=()=>{const e=(0,ye.useSelect)(e=>e(st).selectAdminLink("?page=wpseo_page_support"),[]);return(0,C.jsxs)(G.Alert,{variant:"error",children:[(0,C.jsx)("span",{className:"yst-block yst-font-medium",children:(0,d.__)("Usage policy violation","wordpress-seo")}),(0,C.jsx)("p",{className:"yst-mt-2",children:Ce((0,d.sprintf)( /* translators: %1$s, %2$s, %3$s, %4$s are anchor tags. * %5$s expands to OpenAI. */ /* translators: %1$s, %2$s, %3$s, %4$s are anchor tags. * %5$s expands to OpenAI. */ (0,d.__)("Due to %5$s's strict ethical guidelines and %1$susage policies%2$s, we cannot generate suggestions for the content on this page. If you intend to use AI, kindly avoid the use of explicit, violent, copyrighted, or sexually explicit content. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>","OpenAI"),{a1:(0,C.jsx)(qs,{variant:"error",href:"https://openai.com/policies/usage-policies"}),a2:(0,C.jsx)(qs,{variant:"error",href:e})})})]})},Kt=({errorMessage:e=""})=>{const s=(0,ye.useSelect)(e=>e(st).selectAdminLink("?page=wpseo_page_support"),[]);return(0,C.jsxs)(G.Alert,{variant:"error",children:[(0,C.jsx)("span",{className:"yst-block yst-font-medium",children:(0,d.__)("Something went wrong","wordpress-seo")}),(0,C.jsx)("p",{className:"yst-mt-2",children:(0,d.sprintf)(/* translators: %s is the error response of the request. */ /* translators: %s is the error response of the request. */ (0,d.__)("The request came back with the following error: '%s'.","wordpress-seo"),e)}),(0,C.jsx)("p",{className:"yst-mt-2",children:Ce((0,d.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ (0,d.__)("Please try again later. If the issue persists, please %1$scontact our support team%2$s.","wordpress-seo"),"<a>","</a>"),{a:(0,C.jsx)(qs,{variant:"error",href:s})})})]})};Kt.propTypes={errorMessage:S().string};const Gt=()=>{const e=(0,ye.useSelect)(e=>e(st).selectAdminLink("plugins.php"),[]);return(0,C.jsxs)(G.Alert,{variant:"error",children:[(0,C.jsx)("span",{className:"yst-block yst-font-medium",children:(0,d.__)("Something went wrong","wordpress-seo")}),(0,C.jsx)("p",{className:"yst-mt-2",children:Ce((0,d.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. %2$s expands to an opening link tag. %3$s expands to a closing link tag. */ /* translators: %1$s expands to Yoast SEO Premium. %2$s expands to an opening link tag. %3$s expands to a closing link tag. */ (0,d.__)("The version of %1$s is outdated. Please upgrade %1$s %2$shere%3$s!","wordpress-seo"),"Yoast SEO Premium","<a>","</a>"),{a:(0,C.jsx)(qs,{variant:"error",href:e})})})]})},Vt=()=>{const e=(0,ye.useSelect)(e=>e(st).selectLink("https://yoa.st/ai-common-errors"),[]),s=(0,ye.useSelect)(e=>e(st).selectAdminLink("?page=wpseo_page_support"),[]);return(0,C.jsxs)(G.Alert,{variant:"error",children:[(0,C.jsx)("span",{className:"yst-block yst-font-medium",children:(0,d.__)("Yoast AI cannot reach your site","wordpress-seo")}),(0,C.jsx)("p",{className:"yst-mt-2",children:Ce((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ (0,d.__)("To use this feature, your site must be publicly accessible. This applies to both test sites and instances where your REST API is password-protected. Please ensure your site is accessible to the public and try again. Learn more on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,C.jsx)(qs,{variant:"error",href:e}),a2:(0,C.jsx)(qs,{variant:"error",href:s})})})]})},Yt=({errorCode:e,errorIdentifier:s="",errorMessage:t=""})=>{switch(e){case 400:switch(s){case"SITE_UNREACHABLE":return(0,C.jsx)(Vt,{});case"WP_HTTP_REQUEST_ERROR":return(0,C.jsx)(Kt,{errorMessage:t});default:return(0,C.jsx)($t,{})}case 429:return(0,C.jsx)(Ht,{});default:return(0,C.jsx)($t,{})}};Yt.propTypes={errorCode:S().number.isRequired,errorIdentifier:S().string,errorMessage:S().string};const Zt=({currentSubscriptions:e,isSeoAnalysisActive:s=!0})=>{const{isPremium:t,usageCountStatus:r,usageCountError:i,isWooProductEntity:o,isWooSeoActive:n}=(0,ye.useSelect)(e=>{const s=e(st);return{isPremium:s.getIsPremium(),usageCountStatus:e(et).selectUsageCountStatus(),usageCountError:e(et).selectUsageCountError(),isWooProductEntity:s.getIsWooProductEntity(),isWooSeoActive:s.getIsWooSeoActive()}},[]),a=(0,w.useMemo)(()=>!e.wooCommerceSubscription&&o,[e.wooCommerceSubscription]),l=(0,w.useMemo)(()=>{const s=[];return!t&&!o||e.premiumSubscription||s.push("Yoast SEO Premium"),a&&n&&s.push("Yoast WooCommerce SEO"),s},[t,e.premiumSubscription,a,n,o]);return l.length>0?(0,C.jsx)(Dt,{invalidSubscriptions:l}):s?r===ut.error?(0,C.jsx)(Yt,{...i}):void 0:(0,C.jsx)(Ut,{})};Zt.propTypes={currentSubscriptions:S().object.isRequired,isSeoAnalysisActive:S().bool};const Qt=({onStartGenerating:e})=>(0,C.jsx)(Xs,{storeName:et,linkStoreName:st,onConsentGranted:e});Qt.propTypes={onStartGenerating:S().func.isRequired};var Jt=t(7219),Xt=t.n(Jt);const er=e=>{var s,t;const r=null===(s=(0,ye.useDispatch)("core/edit-post"))||void 0===s?void 0:s.openGeneralSidebar,i=null===(t=(0,ye.useDispatch)("core/editor"))||void 0===t?void 0:t.closePublishSidebar,{openEditorModal:o}=(0,ye.useDispatch)("yoast-seo/editor");return(0,w.useCallback)(()=>{i(),r("yoast-seo/seo-sidebar"),e&&o("yoast-search-appearance-modal")},[i,r,o])},sr=/(?<start><\/badge>|^(?!<badge>))(?<wrap>[\s\S]+?)(?<end><badge>|$)/g,tr=({total:e,current:s,onNavigate:t,disabled:r=!1,...i})=>(0,C.jsxs)("div",{className:"yst-flex yst-justify-between yst-gap-x-2 yst-items-start",children:[(0,C.jsx)("p",{className:"yst-text-slate-500 yst-text-xxs yst-mt-1",children:(0,d.__)("Text generated by AI may be offensive or inaccurate.","wordpress-seo")}),e>1&&(0,C.jsx)(G.Pagination,{className:"yst-shrink-0",current:s,total:e,onNavigate:t,disabled:r,variant:"text" /* translators: Hidden accessibility text. */,screenReaderTextPrevious:(0,d.__)("Previous","wordpress-seo") /* translators: Hidden accessibility text. */,screenReaderTextNext:(0,d.__)("Next","wordpress-seo"),...i})]}),rr=({height:e})=>{const[s,t]=(0,w.useState)(""),{onClose:r}=(0,G.useModalContext)(),{editType:i,previewType:o,contentType:n}=Rt(),a=(()=>{const{editType:e,previewType:s}=Rt();let t="SEO";switch(s){case rt:t="social";break;case it:t="X"}switch(e){case ot:return(0,d.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */ (0,d.__)("Generated %s titles","wordpress-seo"),t);case nt:return s===tt&&(t="meta"),(0,d.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */ (0,d.__)("Generated %s descriptions","wordpress-seo"),t)}})(),c=(()=>{const{editType:e,previewType:s}=Rt();let t="SEO";switch(s){case rt:t="social";break;case it:t="X"}switch(e){case ot:return(0,d.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */ (0,d.__)("Apply %s title","wordpress-seo"),t);case nt:return s===tt&&(t="meta"),(0,d.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */ (0,d.__)("Apply %s description","wordpress-seo"),t)}})(),p=Ct(),{suggestions:h,fetchSuggestions:m,setSelectedSuggestion:g}=(()=>{const[e,s]=(0,w.useReducer)(Lt.reducer,Lt.getInitialState()),{editType:t,previewType:r,postType:i,contentType:o}=Rt(),n=(0,ye.useSelect)(e=>e(et).selectPromptContent(),[]),a=(0,ye.useSelect)(e=>e(et).selectGetSuggestionsEndpoint(),[]),{contentLocale:l,focusKeyphrase:c,isWooCommerceActive:d,isGutenberg:p,isElementor:h}=(0,ye.useSelect)(e=>({contentLocale:e(st).getContentLocale(),focusKeyphrase:e(st).getFocusKeyphrase(),isWooCommerceActive:e(st).getIsWooCommerceActive(),isGutenberg:e(st).getIsBlockEditor(),isElementor:e(st).getIsElementorEditor()}),[]);let m,g=u.languageProcessing.helpers.processExactMatchRequest(c).keyphrase;g.length>191&&(g=g.slice(0,191)),m=h?"elementor":p?"gutenberg":"classic";const y=((e,s,t,r)=>{const i=e===nt?"meta-description":"seo-title";let o=((e,s)=>{if(e)switch(s){case"product":return"product-";case"product_cat":case"product_tag":return"product-taxonomy-"}return""})(s,t);return o&&s||r!==lt||(o="taxonomy-"),`${o}${i}`})(t,d,i,o);return{suggestions:e,fetchSuggestions:(0,w.useCallback)(async(e=!0)=>{s(Lt.actions.setLoading());const{status:t,payload:i}=await vt({endpoint:a,canAbort:e,data:{type:y,prompt_content:n,focus_keyphrase:g,platform:Nt(r),language:ft(l).replace("_","-"),editor:m}});switch(t){case mt:break;case ht:s(Lt.actions.setError(i));break;case pt:s(Lt.actions.setSuccess(i))}return t},[s]),setSelectedSuggestion:(0,w.useCallback)(e=>s(Lt.actions.setSelected(e)),[s])}})(),y=(()=>{const{previewType:e}=Rt();switch(e){case rt:return cr;case it:return pi;default:return ir}})(),{addAppliedSuggestion:x,addUsageCount:f}=(0,ye.useDispatch)(et),{isUsageCountLimitReached:b,isWooProductEntity:v,hasValidPremiumSubscription:k,hasValidWooSubscription:S}=(0,ye.useSelect)(e=>{const s=e(et),t=e(st);return{isUsageCountLimitReached:s.isUsageCountLimitReached(),isPremium:t.getIsPremium(),isWooProductEntity:t.getIsWooProductEntity(),isWooSeoActive:t.getIsWooSeoActive(),hasValidPremiumSubscription:s.selectPremiumSubscription(),hasValidWooSubscription:s.selectWooCommerceSubscription()}},[]),j=(0,w.useMemo)(()=>h.status===ut.loading||!(S||!b||!v)||!(k||!b),[k,b,h.status,v,S]),_=(0,G.usePrevious)(e),R=h.status===ut.success?e:_,{bottom:I}={bottom:`calc( (${R+"px"} - 100vh) / 2 + 32px )`},[E,L]=(0,w.useState)(!1),N=(0,w.useCallback)(e=>{L(e.target.offsetHeight!==e.target.scrollHeight)},[L]),M=It(N),T=(()=>{const{editType:e,previewType:s,contentType:t}=Rt(),r=(()=>{const{previewType:e}=Rt();return(0,w.useMemo)(()=>{switch(e){case tt:return()=>(0,ye.select)(st).getSnippetEditorData().title;case rt:return(0,ye.select)(st).getFacebookTitleOrFallback;case it:return(0,ye.select)(st).getTwitterTitleOrFallback;default:return(0,l.constant)("")}},[e])})(),i=(0,ye.useSelect)(t=>t(et).selectAppliedSuggestionFor({editType:e,previewType:s}),[e,s]);return(0,w.useMemo)(()=>{let s=r();return e===nt?s:(i&&(s=s.replace(i,dt[t])),((e,s)=>e.includes(dt[s])?e:dt[s])(s,t))},[e,r])})(),P=(()=>{const e=(()=>{const{previewType:e}=Rt();return(0,w.useMemo)(()=>{switch(e){case tt:return()=>(0,ye.select)(st).getSnippetEditorData().description;case rt:return(0,ye.select)(st).getFacebookDescriptionOrFallback;case it:return(0,ye.select)(st).getTwitterDescriptionOrFallback;default:return(0,l.constant)("")}},[e])})();return(0,w.useMemo)(e,[e])})(),A=(()=>{const e=(0,ye.useSelect)(e=>e(st).getReplaceVars(),[]),s=(0,w.useMemo)(()=>e.map(St),[e]);return(0,w.useCallback)((e,{key:t="value",overrides:r={},applyPluggable:i=!0,editType:o=ot,contentType:n=at}={})=>{for(const i of s)e=e.replace(new RegExp("%%"+(0,l.escapeRegExp)(i.name)+"%%","g"),(0,l.get)(r,i.name,i[t]));return n===lt&&(e=e.replace(" Archives","")),i?((e,s=ot)=>{const t=gs({title:"",description:"",[s]:u.languageProcessing.stripSpaces(e)});return(0,l.get)(t,s,e)})(e,o):e},[s])})(),F=(0,w.useMemo)(()=>i===ot?{[ct[n]]:h.selected}:{},[i,n,h.selected]),q=(0,w.useMemo)(()=>A(T,{overrides:F,contentType:n}),[A,T,i,n,h.selected]),O=(0,w.useMemo)(()=>A(T,{overrides:{...F,sep:"",sitename:""},contentType:n}),[A,T,i,n,h.selected]),$=(0,w.useMemo)(()=>i===nt?h.selected:A(P,{editType:nt}),[A,P,i,h.selected]),B=(0,w.useCallback)(e=>A(T,{overrides:{[ct[n]]:e},key:"badge",applyPluggable:!1,contentType:n}),[A,T,n]),{currentPage:U,setCurrentPage:H,isOnLastPage:D,totalPages:W,getItemsOnCurrentPage:z}=(({totalItems:e=0,perPage:s=5})=>{const[t,r]=(0,w.useState)(1),i=(0,w.useMemo)(()=>Math.ceil(e/s),[e,s]),o=(0,w.useMemo)(()=>t*s,[t,s]),n=(0,w.useMemo)(()=>o-s,[o,s]),a=(0,w.useMemo)(()=>1===t,[t]),c=(0,w.useMemo)(()=>t===i,[t,i]),d=(0,w.useCallback)(()=>{t>1&&r(t-1)},[t,r]),u=(0,w.useCallback)(()=>{t<i&&r(t+1)},[t,r,i]),p=(0,w.useCallback)(e=>(0,l.slice)(e,n,o),[n,o]);return{currentPage:t,setCurrentPage:r,totalPages:i,isOnFirstPage:a,isOnLastPage:c,previousPage:d,nextPage:u,firstOnPage:n,lastOnPage:o,getItemsOnCurrentPage:p}})({totalItems:h.status===ut.loading||h.status===ut.error?h.entities.length+5:h.entities.length,perPage:5}),K=(0,w.useMemo)(()=>(0,l.map)(z(h.entities),e=>{let s=e;return i===ot&&(s=B(e),s=s.replace(sr,(e,s,t,r,i,o,{start:n,wrap:a,end:l})=>{const c=a.trim();return 0===c.length?`${n}${a}${l}`:`${n}<span>${c}</span>${l}`}),s=Ce(s,{badge:(0,C.jsx)(G.Badge,{className:"yst-me-2 last:yst-me-0",variant:"plain",children:" "}),span:(0,C.jsx)("span",{className:"yst-flex yst-items-center yst-me-2 last:yst-me-0"})})),{value:e,label:s}}),[h.entities,z,i,B]),V=(0,w.useMemo)(()=>h.status!==ut.error||h.status===ut.error&&!D,[h.status,D]),Y=(0,w.useMemo)(()=>h.status===ut.loading&&D,[h.status,D]),Z=(0,w.useMemo)(()=>h.status===ut.error&&D,[h.status,D]),Q=(0,w.useCallback)(()=>{j||(H(h.status===ut.error?W:W+1),m().then(e=>{e===pt&&f()}))},[m,h.status,W,H,g,b]),J=(0,w.useCallback)(()=>t(""),[t]),X=(()=>{const{editType:e}=Rt();switch(e){case ot:return(()=>{const{previewType:e}=Rt(),{updateData:s,setFacebookPreviewTitle:t,setTwitterPreviewTitle:r}=(0,ye.useDispatch)(st);return(0,w.useMemo)(()=>{switch(e){case tt:return e=>s({title:e});case rt:return t;case it:return r;default:return l.noop}},[e,s,t,r])})();case nt:return(()=>{const{previewType:e}=Rt(),{updateData:s,setFacebookPreviewDescription:t,setTwitterPreviewDescription:r}=(0,ye.useDispatch)(st);return(0,w.useMemo)(()=>{switch(e){case tt:return e=>s({description:e});case rt:return t;case it:return r;default:return l.noop}},[e,s,t,r])})();default:return l.noop}})(),ee=er(!0),se=(0,w.useCallback)(()=>{const e=i===ot?T.replace(new RegExp(dt[n]+"( Archives)?"),h.selected):h.selected;X(e),x({editType:i,previewType:o,suggestion:h.selected}),r(),"pre-publish"===p&&ee()},[X,i,o,h.selected,T,r,x,ee,p]);return((e,s=[])=>{const t=(0,w.useRef)(!1);(0,w.useEffect)(()=>{t.current||(t.current=!0,e().finally(()=>{t.current=!1}))},[e,s])})(()=>""===s?m().then(e=>{t(e),e===pt&&f()}):Promise.resolve(),[s,f,m]),s===ht||h.status===ut.error&&402===h.error.code?(0,C.jsx)("div",{className:"yst-flex yst-flex-col yst-space-y-6 yst-mt-6",children:(0,C.jsx)(ii,{errorCode:h.error.code,errorIdentifier:h.error.errorIdentifier,invalidSubscriptions:h.error.missingLicenses,showActions:!0,onRetry:J,errorMessage:h.error.message})}):(0,C.jsxs)(w.Fragment,{children:[(0,C.jsxs)(G.Modal.Container.Content,{ref:M,className:"yst-flex yst-flex-col yst-py-6 yst-space-y-2",children:[(0,C.jsx)(y,{title:q,description:$,status:h.status,titleForLength:O,showPreviewSkeleton:""===s,showLengthProgress:!Y}),V&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{className:"yst-flex yst-space-y-4",children:[(0,C.jsx)(G.Label,{as:"span",className:"yst-flex-grow yst-cursor-default yst-mt-auto",children:a}),(0,C.jsx)(G.Button,{variant:"ai-secondary",size:"small",onClick:h.status===ut.loading?l.noop:Q,isLoading:h.status===ut.loading,disabled:j,children:(0,d.__)("Generate 5 more","wordpress-seo")})]}),Y?(0,C.jsx)(ci,{idSuffix:p,suggestionClassNames:i===ot?[["yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-8/12"]]:void 0}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(ai,{idSuffix:p,suggestions:K,selected:h.selected,onChange:g}),(0,C.jsx)(tr,{current:U,total:W,onNavigate:H,disabled:h.status===ut.loading||Z})]})]}),h.status===ut.error&&D&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"yst-mt-8"}),(0,C.jsx)(ii,{errorCode:h.error.code,errorIdentifier:h.error.errorIdentifier,invalidSubscriptions:h.error.missingLicenses,errorMessage:h.error.message}),(0,C.jsx)(tr,{current:U,total:W,onNavigate:H,disabled:h.status===ut.loading})]})]}),(0,C.jsxs)(G.Modal.Container.Footer,{children:[E&&(0,C.jsx)("div",{className:"yst-absolute yst-inset-x-0 yst--mt-10 yst-me-[calc(2.5rem-1px)] yst-h-10 yst-pointer-events-none yst-bg-gradient-to-t yst-from-slate-50"}),(0,C.jsx)("hr",{className:"yst-mb-6 yst--mx-6"}),(0,C.jsxs)("div",{className:"sm:yst-flex sm:yst-justify-end sm:yst-space-x-2 sm:rtl:yst-space-x-reverse",children:[(0,C.jsx)("div",{className:"yst-hidden sm:yst-inline",children:(0,C.jsx)(G.Button,{variant:"secondary",onClick:r,children:(0,d.__)("Close","wordpress-seo")})}),(0,C.jsx)("div",{className:"yst-block sm:yst-inline",children:(0,C.jsxs)(G.Button,{className:"yst-w-full sm:yst-w-auto",variant:"primary",onClick:se,disabled:""===h.selected||h.status===ut.loading||Z,children:[(0,C.jsx)(Xt(),{className:"yst--ms-1 yst-me-1 yst-h-4 yst-w-4 yst-text-white"}),c]})}),(0,C.jsx)("div",{className:"yst-mt-3 sm:yst-hidden",children:(0,C.jsx)(G.Button,{variant:"secondary",onClick:r,className:"yst-w-full sm:yst-w-auto",children:(0,d.__)("Close","wordpress-seo")})})]})]}),(0,C.jsxs)(G.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{bottom:I},position:"bottom-left",children:[h.status!==ut.loading&&(0,C.jsx)(wi,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all"}),(h.status===ut.success||h.status===ut.loading)&&(0,C.jsx)(ui,{})]})]})};rr.propTypes={height:S().number.isRequired};S().func.isRequired;const ir=({title:e,description:s,status:t,titleForLength:r,showPreviewSkeleton:i,showLengthProgress:o})=>{const n=(0,ye.useSelect)(e=>e(st).getSnippetEditorMode(),[]),[a,l]=(0,w.useState)(n),{editType:c}=Rt(),u=Ct(),p=(({editType:e,title:s,description:t})=>{const r=(0,ye.useSelect)(e=>e(st).getDateFromSettings(),[]),i=(0,ye.useSelect)(e=>e(st).getContentLocale(),[]),o=(0,ye.useSelect)(e=>e(st).isCornerstoneContent(),[]),n=(0,ye.useSelect)(e=>e(st).getIsTerm(),[]);return(0,w.useMemo)(()=>e===nt?(0,Mt.getDescriptionProgress)(t,r,o,n,i):(0,Mt.getTitleProgress)(s),[e,s,t,r,o,n,i])})({editType:c,title:r,description:s});return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Mt.ModeSwitcher,{onChange:l,active:a,id:`yst-ai-google-preview-mode-switcher-${u}`,disabled:t===ut.loading}),i?(0,C.jsx)(ar,{}):(0,C.jsx)(nr,{mode:a,title:e,description:s}),(0,C.jsxs)("div",{className:"yst-pt-4",children:[(0,C.jsx)(G.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:c===ot?(0,d.__)("SEO title width","wordpress-seo"):(0,d.__)("Meta description length","wordpress-seo")}),(0,C.jsx)(lr,{className:"yst-mt-2",progress:o?p.actual:0,min:0,max:p.max,score:p.score})]})]})};ir.propTypes={title:S().string.isRequired,description:S().string.isRequired,status:S().oneOf(Object.keys(ut)).isRequired,titleForLength:S().string.isRequired,showPreviewSkeleton:S().bool.isRequired,showLengthProgress:S().bool.isRequired};const or=/mobi/i,nr=({mode:e,title:s,description:t})=>{var r,i;const o=(0,ye.useSelect)(e=>e(st).getBaseUrlFromSettings(),[]),n=(0,ye.useSelect)(e=>e(st).getSnippetEditorData().slug||"",[]),a=(0,ye.useSelect)(e=>e(st).getDateFromSettings(),[]),c=(0,ye.useSelect)(e=>e(st).getFocusKeyphrase(),[]),d=(0,ye.useSelect)(e=>e(st).getSnippetEditorPreviewImageUrl(),[]),u=(0,ye.useSelect)(e=>e(st).getSiteIconUrlFromSettings(),[]),p=(0,ye.useSelect)(e=>e(st).getShoppingData(),[]),h=(0,ye.useSelect)(e=>e(st).getSnippetEditorWordsToHighlight(),[]),m=(0,ye.useSelect)(e=>e(st).getSiteName(),[]),g=(0,ye.useSelect)(e=>e(st).getContentLocale(),[]),y=(0,w.useMemo)(()=>o+n,[o,n]),x=(0,w.useMemo)(()=>{var e,s;return or.test(null===(e=window)||void 0===e||null===(s=e.navigator)||void 0===s?void 0:s.userAgent)},[null===(r=window)||void 0===r||null===(i=r.navigator)||void 0===i?void 0:i.userAgent]);return(0,C.jsx)("div",{className:`yst-ai-generator-preview-section ${e}${x?" yst-user-agent__mobile":""}`,children:(0,C.jsx)(Mt.SnippetPreview,{title:s,description:t,mode:e,url:y,keyword:c,date:a,faviconSrc:u,mobileImageSrc:d,wordsToHighlight:h,siteName:m,locale:g,shoppingData:p,onMouseUp:l.noop})})};nr.propTypes={mode:S().oneOf(Object.keys({mobile:"mobile",desktop:"desktop"})).isRequired,title:S().string.isRequired,description:S().string.isRequired};const ar=()=>(0,C.jsxs)("div",{className:"yst-max-w-[400px] yst-py-4 yst-px-3 yst-border yst-rounded-lg yst-w-full yst-mx-auto",children:[(0,C.jsxs)("div",{className:"yst-flex yst-gap-x-3",children:[(0,C.jsx)(G.SkeletonLoader,{className:"yst-flex-shrink-0 yst-h-7 yst-w-7 yst-rounded-full"}),(0,C.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-full yst-gap-y-1",children:[(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-2.5 yst-w-10/12"})]})]}),(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-4 yst-w-full yst-mt-6 yst-mb-4"}),(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-3 yst-w-full"}),(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-3 yst-w-10/12 yst-mt-2.5"})]}),lr=({className:e="",progress:s,max:t,score:r})=>{const i=(0,w.useMemo)(()=>(e=>e>=7?"yst-score-good":e>=5?"yst-score-ok":"yst-score-bad")(r),[r]);return(0,C.jsx)(G.ProgressBar,{className:Ue()("yst-length-progress-bar",i,e),progress:s,min:0,max:t})};lr.propTypes={className:S().string,progress:S().number.isRequired,max:S().number.isRequired,score:S().number.isRequired};const cr=({title:e,description:s,showPreviewSkeleton:t})=>(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,C.jsx)(G.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,d.__)("Social preview","wordpress-seo")})}),t?(0,C.jsx)(ti,{}):(0,C.jsx)(si,{title:e,description:s})]});cr.propTypes={title:S().string.isRequired,description:S().string.isRequired,showPreviewSkeleton:S().bool.isRequired};const dr=v().p` color: #606770; flex-shrink: 0; font-size: 12px; line-height: 16px; overflow: hidden; padding: 0; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; margin: 0; position: ${e=>"landscape"===e.mode?"relative":"static"}; `,ur=e=>{const{siteUrl:s}=e;return(0,C.jsxs)(Le.Fragment,{children:[(0,C.jsx)("span",{className:"screen-reader-text",children:s}),(0,C.jsx)(dr,{"aria-hidden":"true",children:(0,C.jsx)("span",{children:s})})]})};ur.propTypes={siteUrl:S().string.isRequired};const pr=ur,hr=v().img` && { max-width: ${e=>e.width}px; height: ${e=>e.height}px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: none; } `,mr=v().img` && { height: 100%; position: absolute; width: 100%; object-fit: cover; } `,gr=v().div` padding-bottom: ${e=>e.aspectRatio}%; `,yr=({imageProps:e,width:s,height:t,imageMode:r="landscape"})=>"landscape"===r?(0,C.jsx)(gr,{aspectRatio:e.aspectRatio,children:(0,C.jsx)(mr,{src:e.src,alt:e.alt})}):(0,C.jsx)(hr,{src:e.src,alt:e.alt,width:s,height:t,imageProperties:e});function xr(e,s,t){return"landscape"===t?{widthRatio:s.width/e.landscapeWidth,heightRatio:s.height/e.landscapeHeight}:"portrait"===t?{widthRatio:s.width/e.portraitWidth,heightRatio:s.height/e.portraitHeight}:{widthRatio:s.width/e.squareWidth,heightRatio:s.height/e.squareHeight}}function fr(e,s){return s.widthRatio<=s.heightRatio?{width:Math.round(e.width/s.widthRatio),height:Math.round(e.height/s.widthRatio)}:{width:Math.round(e.width/s.heightRatio),height:Math.round(e.height/s.heightRatio)}}async function wr(e,s,t=!1){const r=await function(e){return new Promise((s,t)=>{const r=new Image;r.onload=()=>{s({width:r.width,height:r.height})},r.onerror=t,r.src=e})}(e);let i=t?"landscape":"square";"Facebook"===s&&(i=(0,se.determineFacebookImageMode)(r));const o=function(e){return"Twitter"===e?se.TWITTER_IMAGE_SIZES:se.FACEBOOK_IMAGE_SIZES}(s),n=function(e,s,t){return"square"===t&&s.width===s.height?{width:e.squareWidth,height:e.squareHeight}:fr(s,xr(e,s,t))}(o,r,i);return{mode:i,height:n.height,width:n.width}}async function br(e,s,t=!1){try{return{imageProperties:await wr(e,s,t),status:"loaded"}}catch(e){return{imageProperties:null,status:"errored"}}}yr.propTypes={imageProps:S().shape({src:S().string.isRequired,alt:S().string.isRequired,aspectRatio:S().number.isRequired}).isRequired,width:S().number.isRequired,height:S().number.isRequired,imageMode:S().string};const vr=v().div` position: relative; ${e=>"landscape"===e.mode?`max-width: ${e.dimensions.width}`:`min-width: ${e.dimensions.width}; height: ${e.dimensions.height}`}; overflow: hidden; background-color: ${R.colors.$color_white}; `,kr=v().div` box-sizing: border-box; max-width: ${se.FACEBOOK_IMAGE_SIZES.landscapeWidth}px; height: ${se.FACEBOOK_IMAGE_SIZES.landscapeHeight}px; background-color: ${R.colors.$color_grey}; border-style: dashed; border-width: 1px; // We're not using standard colors to increase contrast for accessibility. color: #006DAC; // We're not using standard colors to increase contrast for accessibility. background-color: #f1f1f1; display: flex; justify-content: center; align-items: center; text-decoration: underline; font-size: 14px; cursor: pointer; `;class Sr extends Le.Component{constructor(e){super(e),this.state={imageProperties:null,status:"loading"},this.socialMedium="Facebook",this.handleFacebookImage=this.handleFacebookImage.bind(this),this.setState=this.setState.bind(this)}async handleFacebookImage(){try{const e=await br(this.props.src,this.socialMedium);this.setState(e),this.props.onImageLoaded(e.imageProperties.mode||"landscape")}catch(e){this.setState(e),this.props.onImageLoaded("landscape")}}componentDidUpdate(e){e.src!==this.props.src&&this.handleFacebookImage()}componentDidMount(){this.handleFacebookImage()}retrieveContainerDimensions(e){switch(e){case"square":return{height:se.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:se.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:se.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:se.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:se.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:se.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){const{imageProperties:e,status:s}=this.state;if("loading"===s||""===this.props.src||"errored"===s)return(0,C.jsx)(kr,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,d.__)("Select image","wordpress-seo")});const t=this.retrieveContainerDimensions(e.mode);return(0,C.jsx)(vr,{mode:e.mode,dimensions:t,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick,children:(0,C.jsx)(yr,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:se.FACEBOOK_IMAGE_SIZES.aspectRatio},width:e.width,height:e.height,imageMode:e.mode})})}}Sr.propTypes={src:S().string,alt:S().string,onImageLoaded:S().func,onImageClick:S().func,onMouseEnter:S().func,onMouseLeave:S().func},Sr.defaultProps={src:"",alt:"",onImageLoaded:l.noop,onImageClick:l.noop,onMouseEnter:l.noop,onMouseLeave:l.noop};const jr=Sr,_r=v().span` line-height: ${20}px; min-height : ${20}px; color: #1d2129; font-weight: 600; overflow: hidden; font-size: 16px; margin: 3px 0 0; letter-spacing: normal; white-space: normal; flex-shrink: 0; cursor: pointer; display: -webkit-box; -webkit-line-clamp: ${e=>e.lineCount}; -webkit-box-orient: vertical; overflow: hidden; `,Rr=v().p` line-height: ${16}px; min-height : ${16}px; color: #606770; font-size: 14px; padding: 0; text-overflow: ellipsis; margin: 3px 0 0 0; display: -webkit-box; cursor: pointer; -webkit-line-clamp: ${e=>e.lineCount}; -webkit-box-orient: vertical; overflow: hidden; @media all and ( max-width: ${e=>e.maxWidth} ) { display: none; } `,Cr=e=>{switch(e){case"landscape":return"527px";case"square":case"portrait":return"369px";default:return"476px"}},Ir=v().div` box-sizing: border-box; display: flex; flex-direction: ${e=>"landscape"===e.mode?"column":"row"}; background-color: #f2f3f5; max-width: 527px; `,Er=v().div` box-sizing: border-box; background-color: #f2f3f5; margin: 0; padding: 10px 12px; position: relative; border-bottom: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; border-top: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; border-right: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; border: ${e=>"landscape"===e.mode?"1px solid #dddfe2":""}; display: flex; flex-direction: column; flex-grow: 1; justify-content: ${e=>"landscape"===e.mode?"flex-start":"center"}; font-size: 12px; overflow: hidden; `;class Lr extends Le.Component{constructor(e){super(e),this.state={imageMode:null,maxLineCount:0,descriptionLineCount:0},this.facebookTitleRef=Ne().createRef(),this.onImageLoaded=this.onImageLoaded.bind(this),this.onImageEnter=this.props.onMouseHover.bind(this,"image"),this.onTitleEnter=this.props.onMouseHover.bind(this,"title"),this.onDescriptionEnter=this.props.onMouseHover.bind(this,"description"),this.onLeave=this.props.onMouseHover.bind(this,""),this.onSelectTitle=this.props.onSelect.bind(this,"title"),this.onSelectDescription=this.props.onSelect.bind(this,"description")}onImageLoaded(e){this.setState({imageMode:e})}getTitleLineCount(){return this.facebookTitleRef.current.offsetHeight/20}maybeSetMaxLineCount(){const{imageMode:e,maxLineCount:s}=this.state,t="landscape"===e?2:5;t!==s&&this.setState({maxLineCount:t})}maybeSetDescriptionLineCount(){const{descriptionLineCount:e,maxLineCount:s,imageMode:t}=this.state,r=this.getTitleLineCount();let i=s-r;"portrait"===t&&(i=5===r?0:4),i!==e&&this.setState({descriptionLineCount:i})}componentDidUpdate(){this.maybeSetMaxLineCount(),this.maybeSetDescriptionLineCount()}render(){const{imageMode:e,maxLineCount:s,descriptionLineCount:t}=this.state;return(0,C.jsxs)(Ir,{id:"facebookPreview",mode:e,children:[(0,C.jsx)(jr,{src:this.props.imageUrl||this.props.imageFallbackUrl,alt:this.props.alt,onImageLoaded:this.onImageLoaded,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,C.jsxs)(Er,{mode:e,children:[(0,C.jsx)(pr,{siteUrl:this.props.siteUrl,mode:e}),(0,C.jsx)(_r,{ref:this.facebookTitleRef,onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,lineCount:s,children:this.props.title}),t>0&&(0,C.jsx)(Rr,{maxWidth:Cr(e),onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,lineCount:t,children:this.props.description})]})]})}}Lr.propTypes={siteUrl:S().string.isRequired,title:S().string.isRequired,description:S().string,imageUrl:S().string,imageFallbackUrl:S().string,alt:S().string,onSelect:S().func,onImageClick:S().func,onMouseHover:S().func},Lr.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{}};const Nr=Lr,Mr=v().div` text-transform: lowercase; color: rgb(83, 100, 113); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; fill: currentcolor; display: flex; flex-direction: row; align-items: flex-end; `,Tr=e=>(0,C.jsx)(Mr,{children:(0,C.jsx)("span",{children:e.siteUrl})});Tr.propTypes={siteUrl:S().string.isRequired};const Pr=Tr,Ar=(e,s=!0)=>e?`\n\t\t\tmax-width: ${se.TWITTER_IMAGE_SIZES.landscapeWidth}px;\n\t\t\t${s?"border-bottom: 1px solid #E1E8ED;":""}\n\t\t\tborder-radius: 14px 14px 0 0;\n\t\t\t`:`\n\t\twidth: ${se.TWITTER_IMAGE_SIZES.squareWidth}px;\n\t\t${s?"border-right: 1px solid #E1E8ED;":""}\n\t\tborder-radius: 14px 0 0 14px;\n\t\t`,Fr=v().div` position: relative; box-sizing: content-box; overflow: hidden; background-color: #e1e8ed; flex-shrink: 0; ${e=>Ar(e.isLarge)} `,qr=v().div` display: flex; justify-content: center; align-items: center; box-sizing: border-box; max-width: 100%; margin: 0; padding: 1em; text-align: center; font-size: 1rem; ${e=>Ar(e.isLarge,!1)} `,Or=v()(qr)` ${e=>e.isLarge&&`height: ${se.TWITTER_IMAGE_SIZES.landscapeHeight}px;`} border-top-left-radius: 14px; ${e=>e.isLarge?"border-top-right-radius":"border-bottom-left-radius"}: 14px; border-style: dashed; border-width: 1px; // We're not using standard colors to increase contrast for accessibility. color: #006DAC; // We're not using standard colors to increase contrast for accessibility. background-color: #f1f1f1; text-decoration: underline; font-size: 14px; cursor: pointer; `;class $r extends Ne().Component{constructor(e){super(e),this.state={status:"loading"},this.socialMedium="Twitter",this.handleTwitterImage=this.handleTwitterImage.bind(this),this.setState=this.setState.bind(this)}async handleTwitterImage(){if(null===this.props.src)return;const e=await br(this.props.src,this.socialMedium,this.props.isLarge);this.setState(e)}componentDidUpdate(e){e.src!==this.props.src&&this.handleTwitterImage()}componentDidMount(){this.handleTwitterImage()}render(){const{status:e,imageProperties:s}=this.state;return"loading"===e||""===this.props.src||"errored"===e?(0,C.jsx)(Or,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,d.__)("Select image","wordpress-seo")}):(0,C.jsx)(Fr,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,C.jsx)(yr,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:se.TWITTER_IMAGE_SIZES.aspectRatio},width:s.width,height:s.height,imageMode:s.mode})})}}$r.propTypes={isLarge:S().bool.isRequired,src:S().string,alt:S().string,onImageClick:S().func,onMouseEnter:S().func,onMouseLeave:S().func},$r.defaultProps={src:"",alt:"",onMouseEnter:l.noop,onImageClick:l.noop,onMouseLeave:l.noop};const Br=v().div` display: flex; flex-direction: column; padding: 12px; justify-content: center; margin: 0; box-sizing: border-box; flex: auto; min-width: 0px; gap:2px; > * { line-height:20px; min-height:20px; font-size:15px; } `,Ur=e=>(0,C.jsx)(Br,{children:e.children});Ur.propTypes={children:S().array.isRequired};const Hr=Ur,Dr=v().p` white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; color: rgb(15, 20, 25); cursor: pointer; `,Wr=v().p` max-height: 55px; overflow: hidden; text-overflow: ellipsis; margin: 0; color: rgb(83, 100, 113); display: -webkit-box; cursor: pointer; -webkit-line-clamp: 2; -webkit-box-orient: vertical; @media all and ( max-width: ${se.TWITTER_IMAGE_SIZES.landscapeWidth}px ) { display: none; } `,zr=v().div` font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif; font-size: 15px; font-weight: 400; line-height: 20px; max-width: 507px; border: 1px solid #E1E8ED; box-sizing: border-box; border-radius: 14px; color: #292F33; background: #FFFFFF; text-overflow: ellipsis; display: flex; &:hover { background: #f5f8fa; border: 1px solid rgba(136,153,166,.5); } `,Kr=v()(zr)` flex-direction: column; max-height: 370px; `,Gr=v()(zr)` flex-direction: row; height: 125px; `;class Vr extends Le.Component{constructor(e){super(e),this.onImageEnter=this.props.onMouseHover.bind(this,"image"),this.onTitleEnter=this.props.onMouseHover.bind(this,"title"),this.onDescriptionEnter=this.props.onMouseHover.bind(this,"description"),this.onLeave=this.props.onMouseHover.bind(this,""),this.onSelectTitle=this.props.onSelect.bind(this,"title"),this.onSelectDescription=this.props.onSelect.bind(this,"description")}render(){const{isLarge:e,imageUrl:s,imageFallbackUrl:t,alt:r,title:i,description:o,siteUrl:n}=this.props,a=e?Kr:Gr;return(0,C.jsxs)(a,{id:"twitterPreview",children:[(0,C.jsx)($r,{src:s||t,alt:r,isLarge:e,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,C.jsxs)(Hr,{children:[(0,C.jsx)(Pr,{siteUrl:n}),(0,C.jsx)(Dr,{onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,children:i}),(0,C.jsx)(Wr,{onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,children:o})]})]})}}Vr.propTypes={siteUrl:S().string.isRequired,title:S().string.isRequired,description:S().string,isLarge:S().bool,imageUrl:S().string,imageFallbackUrl:S().string,alt:S().string,onSelect:S().func,onImageClick:S().func,onMouseHover:S().func},Vr.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{},isLarge:!0};const Yr=Vr,Zr=window.yoast.replacementVariableEditor;class Qr extends Le.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},this.SocialPreview="Social"===e.socialMediumName?Nr:Yr,this.setHoveredField=this.setHoveredField.bind(this),this.setActiveField=this.setActiveField.bind(this),this.setEditorRef=this.setEditorRef.bind(this),this.setEditorFocus=this.setEditorFocus.bind(this)}setHoveredField(e){e!==this.state.hoveredField&&this.setState({hoveredField:e})}setActiveField(e){e!==this.state.activeField&&this.setState({activeField:e},()=>this.setEditorFocus(e))}setEditorFocus(e){switch(e){case"title":this.titleEditorRef.focus();break;case"description":this.descriptionEditorRef.focus()}}setEditorRef(e,s){switch(e){case"title":this.titleEditorRef=s;break;case"description":this.descriptionEditorRef=s}}render(){const{onDescriptionChange:e,onTitleChange:s,onSelectImageClick:t,onRemoveImageClick:r,socialMediumName:i,imageWarnings:o,siteUrl:n,description:a,descriptionInputPlaceholder:l,descriptionPreviewFallback:c,imageUrl:d,imageFallbackUrl:u,alt:p,title:h,titleInputPlaceholder:m,titlePreviewFallback:g,replacementVariables:y,recommendedReplacementVariables:x,applyReplacementVariables:f,onReplacementVariableSearchChange:w,isPremium:b,isLarge:v,socialPreviewLabel:k,idSuffix:S,activeMetaTabId:_}=this.props,R=f({title:h||g,description:a||c});return(0,C.jsxs)(Ne().Fragment,{children:[k&&(0,C.jsx)(j.SimulatedLabel,{children:k}),(0,C.jsx)(this.SocialPreview,{onMouseHover:this.setHoveredField,onSelect:this.setActiveField,onImageClick:t,siteUrl:n,title:R.title,description:R.description,imageUrl:d,imageFallbackUrl:u,alt:p,isLarge:v,activeMetaTabId:_}),(0,C.jsx)(se.SocialMetadataPreviewForm,{onDescriptionChange:e,socialMediumName:i,title:h,titleInputPlaceholder:m,onRemoveImageClick:r,imageSelected:!!d,imageUrl:d,imageFallbackUrl:u,onTitleChange:s,onSelectImageClick:t,description:a,descriptionInputPlaceholder:l,imageWarnings:o,replacementVariables:y,recommendedReplacementVariables:x,onReplacementVariableSearchChange:w,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:b,setEditorRef:this.setEditorRef,idSuffix:S})]})}}Qr.propTypes={title:S().string.isRequired,onTitleChange:S().func.isRequired,description:S().string.isRequired,onDescriptionChange:S().func.isRequired,imageUrl:S().string.isRequired,imageFallbackUrl:S().string.isRequired,onSelectImageClick:S().func.isRequired,onRemoveImageClick:S().func.isRequired,socialMediumName:S().string.isRequired,alt:S().string,isPremium:S().bool,imageWarnings:S().array,isLarge:S().bool,siteUrl:S().string,descriptionInputPlaceholder:S().string,titleInputPlaceholder:S().string,descriptionPreviewFallback:S().string,titlePreviewFallback:S().string,replacementVariables:Zr.replacementVariablesShape,recommendedReplacementVariables:Zr.recommendedReplacementVariablesShape,applyReplacementVariables:S().func,onReplacementVariableSearchChange:S().func,socialPreviewLabel:S().string,idSuffix:S().string,activeMetaTabId:S().string},Qr.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",titleInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",alt:"",applyReplacementVariables:e=>e,onReplacementVariableSearchChange:null,socialPreviewLabel:"",idSuffix:"",activeMetaTabId:""};const Jr={},Xr=(e,s,{log:t=console.warn}={})=>{Jr[e]||(Jr[e]=!0,t(s))},ei=(e,s=l.noop)=>{const t={};for(const r in e)Object.hasOwn(e,r)&&Object.defineProperty(t,r,{set:t=>{e[r]=t,s("set",r,t)},get:()=>(s("get",r),e[r])});return t};ei({squareWidth:125,squareHeight:125,landscapeWidth:506,landscapeHeight:265,aspectRatio:50.2},(e,s)=>Xr(`@yoast/social-metadata-previews/TWITTER_IMAGE_SIZES/${e}/${s}`,`[@yoast/social-metadata-previews] "TWITTER_IMAGE_SIZES.${s}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`)),ei({squareWidth:158,squareHeight:158,landscapeWidth:527,landscapeHeight:273,portraitWidth:158,portraitHeight:237,aspectRatio:52.2,largeThreshold:{width:446,height:233}},(e,s)=>Xr(`@yoast/social-metadata-previews/FACEBOOK_IMAGE_SIZES/${e}/${s}`,`[@yoast/social-metadata-previews] "FACEBOOK_IMAGE_SIZES.${s}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`));const si=({title:e,description:s})=>{const t=(0,ye.useSelect)(e=>e(st).getSiteUrl(),[]),r=(0,ye.useSelect)(e=>e(st).getFacebookImageUrl(),[]),i=(0,ye.useSelect)(e=>e(st).getEditorDataImageFallback(),[]),o=(0,ye.useSelect)(e=>e(st).getFacebookAltText(),[]);return(0,C.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,C.jsx)(Nr,{title:e,description:s,siteUrl:t,imageUrl:r,imageFallbackUrl:i,alt:o,onSelect:l.noop,onImageClick:l.noop,onMouseHover:l.noop})})};si.propTypes={title:S().string.isRequired,description:S().string.isRequired};const ti=()=>(0,C.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-[527px] yst-border yst-mx-auto",children:[(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-[273px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,C.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),ri=({children:e,onRetry:s})=>{const{onClose:t}=(0,G.useModalContext)();return(0,C.jsxs)(w.Fragment,{children:[e,(0,C.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,C.jsx)(G.Button,{variant:"secondary",onClick:t,children:(0,d.__)("Close","wordpress-seo")}),(0,C.jsx)(G.Button,{variant:"primary",onClick:s,children:(0,d.__)("Try again","wordpress-seo")})]})]})};ri.propTypes={children:S().node.isRequired,onRetry:S().func.isRequired};const ii=({errorCode:e,errorIdentifier:s,invalidSubscriptions:t=[],showActions:r=!1,onRetry:i=l.noop,errorMessage:o=""})=>{switch(e){case 400:switch(s){case"AI_CONTENT_FILTER":return(0,C.jsx)(zt,{});case"NOT_ENOUGH_CONTENT":return(0,C.jsx)(Bt,{});case"SITE_UNREACHABLE":return(0,C.jsx)(Vt,{});case"WP_HTTP_REQUEST_ERROR":return r?(0,C.jsx)(ri,{onRetry:i,children:(0,C.jsx)(Kt,{errorMessage:o})}):(0,C.jsx)(Kt,{errorMessage:o});default:return r?(0,C.jsx)(ri,{onRetry:i,children:(0,C.jsx)($t,{})}):(0,C.jsx)($t,{})}case 402:return(0,C.jsx)(Dt,{invalidSubscriptions:t});case 408:return r?(0,C.jsx)(ri,{onRetry:i,children:(0,C.jsx)(Wt,{})}):(0,C.jsx)(Wt,{});case 429:return"USAGE_LIMIT_REACHED"===s?(0,C.jsx)(Dt,{invalidSubscriptions:t}):(0,C.jsx)(Ht,{});case 410:return(0,C.jsx)(Gt,{});default:return r?(0,C.jsx)(ri,{onRetry:i,children:(0,C.jsx)($t,{})}):(0,C.jsx)($t,{})}};ii.propTypes={errorCode:S().number.isRequired,errorIdentifier:S().string.isRequired,invalidSubscriptions:S().array,showActions:S().bool,onRetry:S().func,errorMessage:S().string};const oi=S().shape({value:S().string.isRequired,label:S().node.isRequired}),ni=({id:e,name:s,suggestion:t,isChecked:r,onChange:i})=>{const o=(0,w.useCallback)(()=>i(t.value),[t,i]);return(0,C.jsxs)("label",{htmlFor:e,className:Ue()("yst-flex yst-p-4 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",r&&"yst-z-10 yst-border-primary-500"),children:[(0,C.jsx)("input",{type:"radio",id:e,name:s,className:"yst-radio__input",value:t.value,checked:r,onChange:o}),(0,C.jsx)("div",{className:Ue()("yst-label yst-radio__label yst-flex yst-flex-wrap yst-items-center",!r&&"yst-text-slate-600"),children:t.label})]})};ni.propTypes={id:S().string.isRequired,name:S().string.isRequired,suggestion:oi.isRequired,isChecked:S().bool.isRequired,onChange:S().func.isRequired};const ai=({idSuffix:e,suggestions:s,selected:t,onChange:r})=>(0,C.jsx)("div",{children:(0,C.jsx)(G.RadioGroup,{className:"yst-suggestions-radio-group yst-flex yst-flex-col",id:`yst-ai-suggestions-radio-group__${e}`,children:s.map((s,i)=>(0,C.jsx)(ni,{id:`yst-ai-suggestions-radio-${e}__${i}`,name:`ai-suggestion__${e}`,isChecked:s.value===t,onChange:r,suggestion:s},`yst-ai-suggestions-radio-${e}__${i}`))})});ai.propTypes={idSuffix:S().string.isRequired,suggestions:S().arrayOf(oi).isRequired,selected:S().string.isRequired,onChange:S().func.isRequired};const li=[["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-8/12"]],ci=({suggestionClassNames:e=li})=>(0,C.jsx)("div",{className:"yst-flex yst-flex-col yst--space-y-[1px]",children:e.map((e,s)=>(0,C.jsxs)("div",{className:"yst-flex yst-p-4 yst-gap-x-3 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",children:[(0,C.jsx)("input",{type:"radio",disabled:!0,className:"yst-my-0.5"}),(0,C.jsx)("div",{className:"yst-flex yst-flex-col yst-w-full",children:e.map((e,t)=>(0,C.jsx)(G.SkeletonLoader,{className:e},`yst-ai-suggestion-radio-skeleton-${s}__${t}`))})]},`yst-ai-suggestion-radio-skeleton__${s}`))});ci.propTypes={suggestionClassNames:S().arrayOf(S().arrayOf(S().string))};const di="ai_generator_tip_notification",ui=()=>{const e=(0,ye.useSelect)(e=>e(st).isAlertDismissed(di),[]),s=(0,ye.useSelect)(e=>e(st).getEditorDataContent(),[]),t=(0,ye.useSelect)(e=>e(st).getIsWooProductEntity(),[]),[r,,,i]=(0,G.useToggleState)(!1),{editType:o,contentType:n}=Rt(),{dismissAlert:a}=(0,ye.useDispatch)(st),l=(0,w.useCallback)(()=>{a(di)},[a]),c=(0,w.useMemo)(()=>o===nt?(0,d.__)("%1$sTip%2$s: Improve the accuracy of your generated AI descriptions by writing more content in your page.","wordpress-seo"):(0,d.__)("%1$sTip%2$s: Improve the accuracy of your generated AI titles by writing more content in your page.","wordpress-seo") /* translators: %1$s and %2$s expand to opening and closing of a span in order to emphasise the word. */,[o]),u=(0,w.useMemo)(()=>((e,s)=>e||s===lt?150:300)(t,n),[n,t]);return e||r||s.length>u?null:(0,C.jsxs)(G.Notifications.Notification,{id:"ai-generator-content-tip",variant:"info",dismissScreenReaderLabel:(0,d.__)("Dismiss","wordpress-seo"),children:[Ce((0,d.sprintf)(c,"<span>","</span>"),{span:(0,C.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),(0,C.jsxs)("div",{className:"yst-flex yst-mt-3 yst--ms-3 yst-gap-1",children:[(0,C.jsx)(G.Button,{type:"button",variant:"tertiary",onClick:l,children:(0,d.__)("Don’t show again","wordpress-seo")}),(0,C.jsx)(G.Button,{type:"button",variant:"tertiary",className:"yst-text-slate-800",onClick:i,children:(0,d.__)("Dismiss","wordpress-seo")})]})]})},pi=({title:e,description:s,showPreviewSkeleton:t})=>(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,C.jsx)(G.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,d.__)("X preview","wordpress-seo")})}),t?(0,C.jsx)(mi,{}):(0,C.jsx)(hi,{title:e,description:s})]});pi.propTypes={title:S().string.isRequired,description:S().string.isRequired,showPreviewSkeleton:S().bool.isRequired};const hi=({title:e,description:s})=>{const t=(0,ye.useSelect)(e=>e(st).getSiteUrl(),[]),r=(0,ye.useSelect)(e=>e(st).getTwitterImageUrl(),[]),i=(0,ye.useSelect)(e=>e(st).getFacebookImageUrl(),[]),o=(0,ye.useSelect)(e=>e(st).getEditorDataImageFallback(),[]),n=(0,ye.useSelect)(e=>e(st).getTwitterImageType(),[]),a=(0,ye.useSelect)(e=>e(st).getTwitterAltText(),[]);return(0,C.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,C.jsx)(Yr,{title:e,description:s,siteUrl:t,imageUrl:r,imageFallbackUrl:i||o,isLarge:"summary"!==n,alt:a,onSelect:l.noop,onImageClick:l.noop,onMouseHover:l.noop})})};hi.propTypes={title:S().string.isRequired,description:S().string.isRequired};const mi=()=>(0,C.jsxs)("div",{className:"yst-flex yst-flex-col yst-max-h-[370px] yst-w-[507px] yst-border yst-rounded-t-[14px] yst-overflow-hidden yst-mx-auto",children:[(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-[265px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,C.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,C.jsx)(G.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),gi="yst-mt-1 yst-mb-3",yi="yst-flex yst-justify-end yst--me-8 yst-gap-3 yst--ms-2",xi=({onClose:e})=>(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("p",{className:gi,children:(0,d.__)("As long as this is a beta feature, you get unlimited sparks.","wordpress-seo")}),(0,C.jsx)("div",{className:yi,children:(0,C.jsx)(G.Button,{type:"button",variant:"primary",size:"small",onClick:e,children:(0,d.__)("Got it!","wordpress-seo")})})]}),fi=({onClose:e,upsellLink:s,isWooProductEntity:t=!1,ctbId:r="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const i=(0,G.useSvgAria)();return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("p",{className:gi,children:(0,d.sprintf)(/* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ (0,d.__)("Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),t?"Yoast WooCommerce SEO":"Yoast SEO Premium")}),(0,C.jsxs)("div",{className:yi,children:[(0,C.jsx)(G.Button,{type:"button",variant:"tertiary",size:"small",onClick:e,children:(0,d.__)("Close","wordpress-seo")}),(0,C.jsxs)(G.Button,{as:"a",size:"small",variant:"upsell",href:s,target:"_blank",rel:"noopener noreferrer","data-action":"load-nfd-ctb","data-ctb-id":r,children:[(0,C.jsx)(Ae(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-me-2 yst-shrink-0",...i}),(0,d.sprintf)(/* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ (0,d.__)("Unlock with %1$s","wordpress-seo"),t?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,C.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */ (0,d.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]})},wi=({className:e=""})=>{const{isUsageCountLimitReached:s,usageCount:t,usageCountLimit:r,premiumUpsellLink:i,wooUpsellLink:o,isWooProductEntity:n,hasValidPremiumSubscription:a,hasValidWooSubscription:l}=(0,ye.useSelect)(e=>{const s=e(et),t=e(st);return{isUsageCountLimitReached:s.isUsageCountLimitReached(),usageCount:s.selectUsageCount(),usageCountLimit:s.selectUsageCountLimit(),premiumUpsellLink:t.selectLink("https://yoa.st/ai-toast-out-of-free-sparks"),wooUpsellLink:t.selectLink("https://yoa.st/ai-toast-out-of-free-sparks-woo"),isWooProductEntity:t.getIsWooProductEntity(),hasValidPremiumSubscription:s.selectPremiumSubscription(),hasValidWooSubscription:s.selectWooCommerceSubscription()}},[]),c=(0,w.useMemo)(()=>a&&!n||n&&l&&a,[a,n,l]),[u,,p,,h]=(0,G.useToggleState)(t===r),m=Math.max(0,r-t);(0,w.useEffect)(()=>{p(c&&t===r||!c&&m<=5)},[t,r,c,s]);const g=(0,w.useMemo)(()=>n?o:i,[n,o,i]),y=(0,w.useMemo)(()=>n&&!l,[n,l]);return u&&(0,C.jsx)(G.Notifications.Notification,{id:"ai-sparks-limit",className:e,variant:"info",dismissScreenReaderLabel:(0,d.__)("Close","wordpress-seo"),title:c?(0,d.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */ (0,d._n)("You've used %s spark this month.","You've used %s sparks this month.",t,"wordpress-seo"),t):m<=5&&!s?(0,d.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */ (0,d._n)("%s free spark left!","%s free sparks left!",m,"wordpress-seo"),m):(0,d.__)("You're out of free sparks!","wordpress-seo"),size:c?"default":"large",children:c?(0,C.jsx)(xi,{onClose:h}):(0,C.jsx)(fi,{onClose:h,upsellLink:g,isWooUpsell:y})})},bi=({id:e,label:s,description:t="",onChange:r,...i})=>(0,C.jsx)(G.Root,{children:(0,C.jsx)(G.TextField,{id:e,label:s,onChange:r,autoComplete:"off",description:t,...i})});bi.propTypes={id:S().string.isRequired,label:S().string.isRequired,onChange:S().func.isRequired,description:S().oneOfType([S().string,S().element])};const vi=bi;window.yoast=window.yoast||{},window.yoast.editorModules={analysis:{getL10nObject:c,getContentLocale:function(){const e=c();return(0,l.get)(e,"contentLocale","en_US")},getIndicatorForScore:function(e){return(0,l.isNil)(e)||(e/=10),function(e){switch(e){case"feedback":return{className:"na",screenReaderText:(0,d.__)("Not available","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("Not available","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Not available","wordpress-seo")};case"bad":return{className:"bad",screenReaderText:(0,d.__)("Needs improvement","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("Needs improvement","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Needs improvement","wordpress-seo")};case"ok":return{className:"ok",screenReaderText:(0,d.__)("OK SEO score","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("OK","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Potentially non-inclusive","wordpress-seo")};case"good":return{className:"good",screenReaderText:(0,d.__)("Good SEO score","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("Good","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Good","wordpress-seo")};default:return{className:"loading",screenReaderText:"",screenReaderReadabilityText:"",screenReaderInclusiveLanguageText:""}}}(u.interpreters.scoreToRating(e))},constants:e,refreshAnalysis:s},aiGenerator:{components:{Introduction:Qt,SuggestionError:ii,SparksLimitNotification:wi,FeatureError:Zt},helpers:{removesLocaleVariantSuffixes:ft,fetchSuggestions:vt}},components:{HelpLink:Z,TopLevelProviders:me,higherorder:{withYoastSidebarPriority:e=>{const s=({renderPriority:s,...t})=>(0,C.jsx)(e,{...t});return s.propTypes={renderPriority:S().number},s}},contentAnalysis:{KeywordInput:H,RelatedKeyphraseInputField:Y,SynonymsInputField:vi,mapResults:r},contexts:{location:{LocationContext:n.LocationContext,LocationProvider:n.LocationProvider,LocationConsumer:n.LocationConsumer}},SidebarItem:pe,SidebarCollapsible:de,MetaboxCollapsible:({initialIsOpen:e,id:s,...t})=>(0,C.jsx)(Q,{hasPadding:!0,hasSeparator:!0,initialIsOpen:e,id:s,...t}),Modal:ee,portals:{Portal:oe,ImageSelectPortal:ne,ScoreIconPortal:le},FieldsetLayout:Rs,UnsavedChangesModal:Bs,YoastLogo:e=>Le.createElement("svg",Zs({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"yoast-logo_svg__w-40",viewBox:"0 0 842 224"},e),Vs||(Vs=Le.createElement("path",{fill:"#a61e69",d:"M166.55 54.09c-38.69 0-54.17 25.97-54.17 54.88s15.25 56.02 54.17 56.02 54.07-27.19 54-54.26c-.09-32.97-16.77-56.65-54-56.65Zm-23.44 56.52c.94-38.69 30.66-38.65 40.59-24.79 9.05 12.63 10.9 55.81-17.14 55.5-12.92-.14-23.06-8.87-23.44-30.71Zm337.25 27.55V82.11h20.04V57.78h-20.04V28.39h-30.95v29.39h-15.7v24.33h15.7v52.87c0 30.05 20.95 47.91 43.06 51.61l9.24-24.88c-12.89-1.63-21.23-11.27-21.35-23.54Zm-156.15-8.87V87.16c0-1.54-.1-2.98-.25-4.39-2.68-34.04-51.02-33.97-88.46-20.9l10.82 21.78c24.38-11.58 38.97-8.59 44.07-2.89.13.15.26.29.38.45.01.02.03.04.04.06 2.6 3.51 1.98 9.05 1.98 13.41-31.86 0-65.77 4.23-65.77 39.17 0 26.56 33.28 43.65 68.06 18.33l5.16 12.45h29.81c-2.66-14.62-5.85-27.14-5.85-35.34Zm-31.18-.23c-24.51 27.43-46.96 1.61-23.97-9.65 6.77-2.31 15.95-2.41 23.97-2.41v12.06Zm78.75-44.17c0-10.38 16.61-15.23 42.82-3.27l9.06-22.01c-35.27-10.66-83.44-11.62-83.75 25.28-.15 17.68 11.19 27.19 27.52 33.26 11.31 4.2 27.64 6.38 27.59 15.39-.06 11.77-25.38 13.57-48.42-2.26l-9.31 23.87c31.43 15.64 89.87 16.08 89.56-23.12-.31-38.76-55.08-32.11-55.08-47.14ZM99.3 1 54.44 125.61 32.95 58.32H1l35.78 91.89a33.49 33.49 0 0 1 0 24.33c-4 10.25-10.65 19.03-26.87 21.21v27.24c31.58 0 48.65-19.41 63.88-61.96L133.48 1H99.3ZM598.64 139.05c0 8.17-2.96 14.58-8.87 19.23-5.91 4.65-14.07 6.98-24.47 6.98s-18.92-1.61-25.54-4.84v-14.2c4.19 1.97 8.65 3.52 13.37 4.65 4.72 1.13 9.11 1.7 13.18 1.7 5.95 0 10.35-1.13 13.18-3.39 2.83-2.26 4.25-5.3 4.25-9.11 0-3.43-1.3-6.35-3.9-8.74-2.6-2.39-7.97-5.22-16.1-8.48-8.39-3.39-14.3-7.27-17.74-11.63-3.44-4.36-5.16-9.59-5.16-15.71 0-7.67 2.72-13.7 8.18-18.1 5.45-4.4 12.77-6.6 21.95-6.6s17.57 1.93 26.29 5.78l-4.78 12.26c-8.18-3.43-15.47-5.15-21.89-5.15-4.87 0-8.55 1.06-11.07 3.17-2.52 2.12-3.77 4.91-3.77 8.39 0 2.39.5 4.43 1.51 6.13s2.66 3.3 4.97 4.81c2.3 1.51 6.46 3.5 12.45 5.97 6.75 2.81 11.7 5.43 14.85 7.86 3.15 2.43 5.45 5.18 6.92 8.23 1.46 3.06 2.2 6.66 2.2 10.81Zm68.53 24.96h-52.02V72.12h52.02v12.7h-36.99v25.01h34.66v12.57h-34.66v28.85h36.99v12.76Zm100.24-46.07c0 14.96-3.74 26.59-11.23 34.88-7.49 8.3-18.08 12.44-31.8 12.44s-24.54-4.12-31.99-12.35c-7.44-8.23-11.17-19.93-11.17-35.1s3.74-26.82 11.23-34.95c7.49-8.13 18.17-12.19 32.05-12.19s24.24 4.13 31.7 12.38c7.47 8.26 11.2 19.88 11.2 34.88Zm-70.2 0c0 11.31 2.29 19.89 6.86 25.74 4.57 5.85 11.35 8.77 20.32 8.77s15.67-2.89 20.22-8.67c4.55-5.78 6.82-14.39 6.82-25.83s-2.25-19.82-6.76-25.64-11.23-8.74-20.16-8.74-15.82 2.91-20.41 8.74c-4.59 5.82-6.89 14.37-6.89 25.64Z"})),Ys||(Ys=Le.createElement("path",{fill:"#77b227",d:"m790.45 165.35 36.05-94.96H840l-36.02 94.96h-13.53z"}))),SidebarLayout:({contentClassName:e="",children:s})=>(0,C.jsx)("div",{className:"yst-flex yst-gap-6 xl:yst-flex-row yst-flex-col relative",children:(0,C.jsx)("div",{className:Ue()("yst-@container yst-flex yst-flex-grow yst-flex-col",e),children:s})}),ErrorFallback:js},containers:{EditorModal:ve,PersistentDismissableAlert:ke,Results:Ke,SEMrushRelatedKeyphrases:Ze},helpers:{ajaxHelper:i,createInterpolateElement:Ce,createWatcher:(e,s)=>{let t=e();return()=>{const r=e();(0,l.isEqual)(r,t)||(t=r,s((0,l.clone)(r)))}},isBlockEditor:function(){return window.wpseoScriptData&&"1"===window.wpseoScriptData.isBlockEditor},i18n:{setTextdomainL10n:function(e,s="wpseoYoastJSL10n"){const t=(0,l.get)(window,[s,e,"locale_data",e],!1);"yoast-components"===e&&(e="wordpress-seo"),!1===t?(0,d.setLocaleData)({"":{}},e):(0,d.setLocaleData)(t,e)}},replacementVariableHelpers:o,publishBox:{updateScore:function(e,s,t=null){var r=fs("#"+e+"-score"),i=xs+" "+s;r.children(".image").attr("class",i);var o=ws(e,s,t);r.children("."+ys).html(o)},createScoresInPublishBox:function(e,s,t=null){const r=fs("<div />",{class:"misc-pub-section yoast yoast-seo-score "+e+"-score",id:e+"-score"}),i=fs("<span />",{class:ys,html:ws(e,s,t)}),o=fs("<span>").attr("class",xs+" na");r.append(o).append(i),fs("#yoast-seo-publishbox-section").append(r)},scrollToCollapsible:function(e){const s=fs("#wpadminbar"),t=fs(e);if(!s||!t)return;const r="fixed"===s.css("position")?s.height():0;fs([document.documentElement,document.body]).animate({scrollTop:t.offset().top-r},1e3),t.trigger("focus"),0===t.parent().siblings().length&&t.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 s=jQuery(".yst-traffic-light"),t=s.closest(".wpseo-meta-section-link"),r=jQuery("#wpseo-traffic-light-desc"),i=e.className||"na";s.attr("class","yst-traffic-light "+i),t.attr("aria-describedby","wpseo-traffic-light-desc"),r.length>0?r.text(e.screenReaderText):t.closest("li").append("<span id='wpseo-traffic-light-desc' class='screen-reader-text'>"+e.screenReaderText+"</span>")}}}})()})();
💾 Save Changes
❌ Cancel