????JFIF??x?x????'
Server IP : 104.21.112.1 / Your IP : 216.73.216.127 Web Server : LiteSpeed System : Linux premium151.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : tempvsty ( 647) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/././cwd/wp-content/plugins/wordpress-seo/js/dist/ |
Upload File : |
(()=>{var e={4530:(e,t)=>{var s;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var o=typeof s;if("string"===o||"number"===o)e.push(s);else if(Array.isArray(s)){if(s.length){var n=a.apply(null,s);n&&e.push(n)}}else if("object"===o){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){e.push(s.toString());continue}for(var i in s)r.call(s,i)&&s[i]&&e.push(i)}}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(s=function(){return a}.apply(t,[]))||(e.exports=s)}()}},t={};function s(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React;var t=s.n(e);const r=window.wp.components,a=window.wp.data,o=window.wp.hooks,n=window.yoast.uiLibrary,i=window.lodash,l=window.yoast.reduxJsToolkit,c="adminUrl",d=(0,l.createSlice)({name:c,initialState:"",reducers:{setAdminUrl:(e,{payload:t})=>t}}),u=(d.getInitialState,{selectAdminUrl:e=>(0,i.get)(e,c,"")});u.selectAdminLink=(0,l.createSelector)([u.selectAdminUrl,(e,t)=>t],((e,t="")=>{try{return new URL(t,e).href}catch(t){return e}})),d.actions,d.reducer;const m=window.wp.apiFetch;var p=s.n(m);const y="hasConsent",g=`${y}/storeConsent`,h=(0,l.createSlice)({name:y,initialState:{hasConsent:!1,endpoint:"yoast/v1/ai_generator/consent"},reducers:{giveAiGeneratorConsent:(e,{payload:t})=>{e.hasConsent=t},setAiGeneratorConsentEndpoint:(e,{payload:t})=>{e.endpoint=t}}}),f=h.getInitialState,w={selectHasAiGeneratorConsent:e=>(0,i.get)(e,[y,"hasConsent"],h.getInitialState().hasConsent),selectAiGeneratorConsentEndpoint:e=>(0,i.get)(e,[y,"endpoint"],h.getInitialState().endpoint)},E={...h.actions,storeAiGeneratorConsent:function*(e,t){try{yield{type:g,payload:{consent:e,endpoint:t}}}catch(e){return!1}return yield{type:`${y}/giveAiGeneratorConsent`,payload:e},!0}},b={[g]:async({payload:e})=>await p()({path:e.endpoint,method:"POST",data:{consent:e.consent},parse:!1})},v=h.reducer,S=window.wp.url,x="linkParams",k=(0,l.createSlice)({name:x,initialState:{},reducers:{setLinkParams:(e,{payload:t})=>t}}),_=(k.getInitialState,{selectLinkParam:(e,t,s={})=>(0,i.get)(e,`${x}.${t}`,s),selectLinkParams:e=>(0,i.get)(e,x,{})});_.selectLink=(0,l.createSelector)([_.selectLinkParams,(e,t)=>t,(e,t,s={})=>s],((e,t,s)=>(0,S.addQueryArgs)(t,{...e,...s}))),k.actions,k.reducer;const C=(0,l.createSlice)({name:"notifications",initialState:{},reducers:{addNotification:{reducer:(e,{payload:t})=>{e[t.id]={id:t.id,variant:t.variant,size:t.size,title:t.title,description:t.description}},prepare:({id:e,variant:t="info",size:s="default",title:r,description:a})=>({payload:{id:e||(0,l.nanoid)(),variant:t,size:s,title:r||"",description:a}})},removeNotification:(e,{payload:t})=>(0,i.omit)(e,t)}}),R=(C.getInitialState,C.actions,C.reducer,"pluginUrl"),L=(0,l.createSlice)({name:R,initialState:"",reducers:{setPluginUrl:(e,{payload:t})=>t}}),I=(L.getInitialState,{selectPluginUrl:e=>(0,i.get)(e,R,"")});I.selectImageLink=(0,l.createSelector)([I.selectPluginUrl,(e,t,s="images")=>s,(e,t)=>t],((e,t,s)=>[(0,i.trimEnd)(e,"/"),(0,i.trim)(t,"/"),(0,i.trimStart)(s,"/")].join("/"))),L.actions,L.reducer;const N="request",P="success",T="error",A="idle",M="loading",$="success",O="error",F="showPlay",U="askPermission",q="isPlaying",W="wistiaEmbedPermission",B=(0,l.createSlice)({name:W,initialState:{value:!1,status:A,error:{}},reducers:{setWistiaEmbedPermissionValue:(e,{payload:t})=>{e.value=Boolean(t)}},extraReducers:e=>{e.addCase(`${W}/${N}`,(e=>{e.status=M})),e.addCase(`${W}/${P}`,((e,{payload:t})=>{e.status=$,e.value=Boolean(t&&t.value)})),e.addCase(`${W}/${T}`,((e,{payload:t})=>{e.status=O,e.value=Boolean(t&&t.value),e.error={code:(0,i.get)(t,"error.code",500),message:(0,i.get)(t,"error.message","Unknown")}}))}});B.getInitialState,B.actions,B.reducer;const z=e.forwardRef((function(t,s){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},t),e.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"}))})),H=window.wp.element,D=window.wp.i18n,G=window.yoast.aiFrontend,j=window.yoast.propTypes;var V=s.n(j);const Y="yoast-seo/ai-generator",K="yoast-seo/editor",Z="google",X="social",Q="twitter",J="title",ee="description",te="post",se="term",re={post:"title",term:"term_title"},ae=(0,i.mapValues)(re,(e=>`%%${e}%%`)),oe={mobile:"mobile",desktop:"desktop"},ne={idle:"idle",loading:"loading",success:"success",error:"error"},ie="success",le="error",ce="abort",de=window.yoast.analysis,ue=(window.wp.sanitize,window.yoast.helpers),me=(e,t)=>{try{return(0,H.createInterpolateElement)(e,t)}catch(t){return console.error("Error in translation for:",e,t),e}},{stripHTMLTags:pe}=ue.strings;let ye,ge=!1;const he=["_formal","_informal","_ao90"],fe=e=>{for(const t of he)if(e.endsWith(t))return e.slice(0,-t.length);return e},we="\\–\\-\\(\\)_\\[\\]’‘“”〝〞〟‟„\"'.?!:;,¿¡«»‹›—×+&۔؟،؛。。!‼?⁇⁉⁈‥…・ー、〃〄〆〇〈〉《》「」『』【】〒〓〔〕〖〗〘〙〚〛〜〝〞〟〠〶〼〽{}|~⦅⦆「」、[]・¥$%@&'()*/:;<>\\\<>";we.split(""),new RegExp("^["+we+"]+"),new RegExp("["+we+"]+$");const Ee=new RegExp("["+we+"#$%&*+/=@^`{|}~ -¿–-⁊ -₠-⃀]","g"),be=e=>0===e.replace(Ee,"").trim().length,ve=e=>{const t={...e};return""!==e.value||["title","excerpt","excerpt_only"].includes(e.name)||(t.value="%%"+e.name+"%%"),t.badge=`<badge>${e.label}</badge>`,t},Se=()=>{const e=(0,a.useSelect)((e=>e(K).getReplaceVars()),[]),t=(0,H.useMemo)((()=>e.map(ve)),[e]);return(0,H.useCallback)(((e,{key:s="value",overrides:r={},applyPluggable:a=!0,editType:o=J,contentType:n=te}={})=>{for(const a of t)e=e.replace(new RegExp("%%"+(0,i.escapeRegExp)(a.name)+"%%","g"),(0,i.get)(r,a.name,a[s]));return n===se&&(e=e.replace(" Archives","")),a?((e,t=J)=>{const s=function(e){const t=(0,i.get)(window,["YoastSEO","app","pluggable"],!1);if(!t||!(0,i.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){const t=(0,i.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],i.identity);return{url:e.url,title:pe(t(e.title)),description:pe(t(e.description)),filteredSEOTitle:e.filteredSEOTitle?pe(t(e.filteredSEOTitle)):""}}(e);const s=t._applyModifications.bind(t);return{url:e.url,title:pe(s("data_page_title",e.title)),description:pe(s("data_meta_desc",e.description)),filteredSEOTitle:e.filteredSEOTitle?pe(s("data_page_title",e.filteredSEOTitle)):""}}({title:"",description:"",[t]:de.languageProcessing.stripSpaces(e)});return(0,i.get)(s,t,e)})(e,o):e}),[t])},xe={editType:J,previewType:Z,postType:"post",contentType:te},ke=(0,H.createContext)(xe),_e=ke.Provider,Ce=()=>(0,H.useContext)(ke),Re=window.yoast.externals.contexts,Le=()=>(0,H.useContext)(Re.LocationContext),Ie=e=>{const t=(0,H.useRef)(null);return(0,H.useCallback)((s=>{(0,i.attempt)((()=>t.current&&t.current.disconnect())),null!==s&&(t.current=new ResizeObserver((t=>{(0,i.forEach)(t,(t=>e(t)))})),t.current.observe(s))}),[e])},Ne=(0,l.createSlice)({name:"suggestions",initialState:{status:ne.loading,error:{code:200,message:""},entities:[],selected:""},reducers:{setLoading:e=>{e.status=ne.loading},setSuccess:(e,{payload:t})=>{e.status=ne.success,e.selected=t[0],e.entities.push(...t)},setError:(e,{payload:t})=>{e.status=ne.error,e.error=t},setSelected:(e,{payload:t})=>{e.selected=t}}}),Pe=e=>{switch(e){case X:return"Facebook";case Q:return"Twitter";default:return"Google"}},Te=window.yoast.searchMetadataPreviews,Ae="usageCount",Me="fetchUsageCount",$e=`${Me}/${P}`,Oe=`${Me}/${T}`,Fe={errorCode:null,errorIdentifier:null,errorMessage:null},Ue=(0,l.createSlice)({name:Ae,initialState:{status:A,count:0,limit:10,endpoint:"yoast/v1/ai_generator/get_usage",error:Fe},reducers:{addUsageCount:(e,{payload:t=1})=>{e.count+=t},setUsageCount:(e,{payload:t})=>{e.count=t},setUsageCountEndpoint:(e,{payload:t})=>{e.endpoint=t},setUsageCountLimit:(e,{payload:t})=>{e.limit=t}},extraReducers:e=>{e.addCase(`${Me}/${N}`,(e=>{e.status=M,e.error=Fe})),e.addCase($e,((e,{payload:t})=>{e.status=$,e.count=t.count,e.limit=t.limit,e.error=Fe})),e.addCase(`${Me}/${T}`,((e,{payload:t})=>{e.status=O,e.error={errorCode:502,...t}}))}}),qe=Ue.getInitialState,We={selectUsageCountStatus:e=>(0,i.get)(e,[Ae,"status"],Ue.getInitialState()),selectUsageCount:e=>(0,i.get)(e,[Ae,"count"],Ue.getInitialState().count),selectUsageCountLimit:e=>(0,i.get)(e,[Ae,"limit"],Ue.getInitialState().limit),selectUsageCountEndpoint:e=>(0,i.get)(e,[Ae,"endpoint"],Ue.getInitialState().endpoint),selectUsageCountError:e=>(0,i.get)(e,[Ae,"error"],Ue.getInitialState().error)};We.selectUsageCountRemaining=(0,l.createSelector)([We.selectUsageCount,We.selectUsageCountLimit],((e,t)=>Math.max(t-e,0))),We.isUsageCountLimitReached=(0,l.createSelector)([We.selectUsageCount,We.selectUsageCountLimit,We.selectUsageCountError],((e,t,s)=>429===s.errorCode||e>=t));const Be={...Ue.actions,fetchUsageCount:function*({endpoint:e,isWooProductEntity:t}){yield{type:`${Me}/${N}`};try{const s=(e=>{const t=(0,i.get)(e,"totalUsed.license",null),s=(0,i.get)(e,"totalUsed.limit",null);if(!(0,i.isNumber)(t)||t<0)throw new Error("Invalid usage count: must be a number of zero or higher.");if(!(0,i.isNumber)(s)||s<-1||0===s)throw new Error("Invalid usage count limit: must be a number of -1 or higher than 1");return{count:t,limit:s}})(yield{type:Me,payload:{endpoint:e,isWooProductEntity:t}});return{type:`${Me}/${P}`,payload:s}}catch(e){return{type:`${Me}/${T}`,payload:e}}}},ze={[Me]:async({payload:e})=>p()({method:"POST",path:e.endpoint,data:{is_woo_product_entity:e.isWooProductEntity}})},He=Ue.reducer;V().string.isRequired;const De=e.forwardRef((function(t,s){return e.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},t),e.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"}))})),Ge=e.forwardRef((function(t,s){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},t),e.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"}))})),je=({learnMoreLink:t,thumbnail:s,wistiaEmbedPermission:r,upsellLink:a,upsellLabel:o,newToText:i,ctbId:l})=>{const{onClose:c,initialFocus:d}=(0,n.useModalContext)(),u={a:(0,e.createElement)(ct,{href:t,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,e.createElement)(Ge,{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,e.createElement)("br",null)};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center"},(0,e.createElement)("div",{className:"yst-relative yst-w-full"},(0,e.createElement)(Tt,{videoId:"vun9z1dpfh",thumbnail:s,wistiaEmbedPermission:r}),(0,e.createElement)(n.Badge,{className:"yst-absolute yst-end-4 yst-text-center yst-justify-center",variant:"info",style:{top:"-8px"}},(0,D.__)("Beta","wordpress-seo"))),(0,e.createElement)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center"},(0,e.createElement)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center"},(0,e.createElement)("span",{className:"yst-logo-icon"}),i))),(0,e.createElement)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center"},(0,e.createElement)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center"},(0,e.createElement)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium"},(0,D.sprintf)(/* translators: %s: Expands to "Yoast AI" */ (0,D.__)("Optimize your SEO content with %s","wordpress-seo"),"Yoast AI")),(0,e.createElement)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm"},me((0,D.sprintf)(/* translators: %1$s is a break tag; %2$s and %3$s are anchor tags; %4$s is the arrow icon. */ (0,D.__)("Make content editing a breeze! Optimize your SEO content with quick, actionable suggestions at the click of a button.%1$s%2$sLearn more%3$s%4$s","wordpress-seo"),"<br/>","<a>","<ArrowNarrowRightIcon />","</a>"),u))),(0,e.createElement)("div",{className:"yst-w-full yst-flex yst-mt-6"},(0,e.createElement)(n.Button,{as:"a",className:"yst-grow",size:"extra-large",variant:"upsell",href:a,target:"_blank",ref:d,"data-action":"load-nfd-ctb","data-ctb-id":l},(0,e.createElement)(De,{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5"}),o,(0,e.createElement)("span",{className:"yst-sr-only"},/* translators: Hidden accessibility text. */ (0,D.__)("(Opens in a new browser tab)","wordpress-seo")))),(0,e.createElement)(n.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:c},(0,D.__)("Close","wordpress-seo"))))};je.propTypes={learnMoreLink:V().string.isRequired,upsellLink:V().string.isRequired,thumbnail:V().shape({src:V().string.isRequired,width:V().string,height:V().string}).isRequired,wistiaEmbedPermission:V().shape({value:V().bool.isRequired,status:V().string.isRequired,set:V().func.isRequired}).isRequired,upsellLabel:V().string,newToText:V().string,ctbId:V().string},je.defaultProps={upsellLabel:(0,D.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ (0,D.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),newToText:"Yoast SEO Premium",ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"};const Ve=({handleRefreshClick:t,supportLink:s})=>(0,e.createElement)("div",{className:"yst-flex yst-gap-2"},(0,e.createElement)(n.Button,{onClick:t},(0,D.__)("Refresh this page","wordpress-seo")),(0,e.createElement)(n.Button,{variant:"secondary",as:"a",href:s,target:"_blank",rel:"noopener"},(0,D.__)("Contact support","wordpress-seo")));Ve.propTypes={handleRefreshClick:V().func.isRequired,supportLink:V().string.isRequired};const Ye=({handleRefreshClick:t,supportLink:s})=>(0,e.createElement)("div",{className:"yst-grid yst-grid-cols-1 yst-gap-y-2"},(0,e.createElement)(n.Button,{className:"yst-order-last",onClick:t},(0,D.__)("Refresh this page","wordpress-seo")),(0,e.createElement)(n.Button,{variant:"secondary",as:"a",href:s,target:"_blank",rel:"noopener"},(0,D.__)("Contact support","wordpress-seo")));Ye.propTypes={handleRefreshClick:V().func.isRequired,supportLink:V().string.isRequired};const Ke=({error:t,children:s})=>(0,e.createElement)("div",{role:"alert",className:"yst-max-w-screen-sm yst-p-8 yst-space-y-4"},(0,e.createElement)(n.Title,null,(0,D.__)("Something went wrong. An unexpected error occurred.","wordpress-seo")),(0,e.createElement)("p",null,(0,D.__)("We're very sorry, but it seems like the following error has interrupted our application:","wordpress-seo")),(0,e.createElement)(n.Alert,{variant:"error"},(null==t?void 0:t.message)||(0,D.__)("Undefined error message.","wordpress-seo")),(0,e.createElement)("p",null,(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);Ke.propTypes={error:V().object.isRequired,children:V().node},Ke.VerticalButtons=Ye,Ke.HorizontalButtons=Ve;var Ze;function Xe(){return Xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Xe.apply(this,arguments)}V().string,V().node.isRequired,V().node.isRequired,V().node,V().oneOf(Object.keys({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"}}));const Qe=t=>e.createElement("svg",Xe({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 1000 1000"},t),Ze||(Ze=e.createElement("path",{fill:"#fff",d:"M500 0C223.9 0 0 223.9 0 500s223.9 500 500 500 500-223.9 500-500S776.1 0 500 0Zm87.2 412.4c0-21.9 4.3-40.2 13.1-54.4s24-27.1 45.9-38.2l10.1-4.9c17.8-9 22.4-16.7 22.4-26 0-11.1-9.5-19.1-25-19.1-18.3 0-32.2 9.5-41.8 28.9l-24.7-24.8c5.4-11.6 14.1-20.9 25.8-28.1a70.8 70.8 0 0 1 38.9-11.1c17.8 0 33.3 4.6 45.9 14.2s19.4 22.7 19.4 39.4c0 26.6-15 42.9-43.1 57.3l-15.7 8c-16.8 8.5-25.1 16-27.4 29.4h85.4v35.4H587.2Zm-82.1 373.3c-157.8 0-285.7-127.9-285.7-285.7s127.9-285.7 285.7-285.7a286.4 286.4 0 0 1 55.9 5.5l-55.9 116.9c-90 0-163.3 73.3-163.3 163.3s73.3 163.3 163.3 163.3a162.8 162.8 0 0 0 106.4-39.6l61.8 107.2a283.9 283.9 0 0 1-168.2 54.8ZM705 704.1l-70.7-122.5H492.9l70.7-122.4H705l70.7 122.4Z"}))),Je=window.ReactDOM;var et,tt,st;(tt=et||(et={})).Pop="POP",tt.Push="PUSH",tt.Replace="REPLACE",function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(st||(st={})),new Set(["lazy","caseSensitive","path","id","index","children"]),Error;const rt=["post","put","patch","delete"],at=(new Set(rt),["get",...rt]);new Set(at),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred"),e.Component,e.startTransition,new Promise((()=>{})),e.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}var ot,nt,it,lt;new Map,e.startTransition,Je.flushSync,e.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,(lt=ot||(ot={})).UseScrollRestoration="useScrollRestoration",lt.UseSubmit="useSubmit",lt.UseSubmitFetcher="useSubmitFetcher",lt.UseFetcher="useFetcher",lt.useViewTransitionState="useViewTransitionState",(it=nt||(nt={})).UseFetcher="useFetcher",it.UseFetchers="useFetchers",it.UseScrollRestoration="useScrollRestoration",V().string.isRequired,V().string;const ct=({href:t,children:s,...r})=>(0,e.createElement)(n.Link,{target:"_blank",rel:"noopener noreferrer",...r,href:t},s,(0,e.createElement)("span",{className:"yst-sr-only"},/* translators: Hidden accessibility text. */ (0,D.__)("(Opens in a new browser tab)","wordpress-seo")));ct.propTypes={href:V().string.isRequired,children:V().node},ct.defaultProps={children:null};const dt=e.forwardRef((function(t,s){return e.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},t),e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"}))}));var ut,mt,pt;function yt(){return yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},yt.apply(this,arguments)}const gt=t=>e.createElement("svg",yt({xmlns:"http://www.w3.org/2000/svg",id:"star-rating-half_svg__Layer_1","data-name":"Layer 1",viewBox:"0 0 500 475.53"},t),ut||(ut=e.createElement("defs",null,e.createElement("style",null,".star-rating-half_svg__cls-1{fill:#fbbf24}"))),mt||(mt=e.createElement("path",{d:"M250 392.04 98.15 471.87l29-169.09L4.3 183.03l169.77-24.67L250 4.52l75.93 153.84 169.77 24.67-122.85 119.75 29 169.09L250 392.04z",className:"star-rating-half_svg__cls-1"})),pt||(pt=e.createElement("path",{d:"m250 9.04 73.67 149.27.93 1.88 2.08.3 164.72 23.94-119.19 116.19-1.51 1.47.36 2.07 28.14 164.06-147.34-77.46-1.86-1-1.86 1-147.34 77.46 28.14-164.06.36-2.07-1.51-1.47L8.6 184.43l164.72-23.9 2.08-.3.93-1.88L250 9.04m0-9-77.25 156.49L0 181.64l125 121.89-29.51 172L250 394.3l154.51 81.23-29.51-172 125-121.89-172.75-25.11L250 0Z",className:"star-rating-half_svg__cls-1"})),e.createElement("path",{d:"m500 181.64-172.75-25.11L250 0v394.3l154.51 81.23L375 303.48l125-121.84z",style:{fill:"#f3f4f6"}}));function ht(){return ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},ht.apply(this,arguments)}const ft=t=>e.createElement("svg",ht({xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",viewBox:"0 0 500 475.53"},t),e.createElement("path",{d:"m250 0 77.25 156.53L500 181.64 375 303.48l29.51 172.05L250 394.3 95.49 475.53 125 303.48 0 181.64l172.75-25.11L250 0z",style:{fill:"#fbbf24"}}));var wt,Et,bt,vt,St,xt,kt,_t,Ct;function Rt(){return Rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Rt.apply(this,arguments)}const Lt=t=>e.createElement("svg",Rt({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 500 500"},t),wt||(wt=e.createElement("path",{fill:"#a4286a",d:"M80 0h340a80 80 0 0 1 80 80v420H80a80 80 0 0 1-80-80V80A80 80 0 0 1 80 0z"})),Et||(Et=e.createElement("path",{fill:"#6c2548",d:"M437.61 2 155.89 500H500V80a80 80 0 0 0-62.39-78z"})),bt||(bt=e.createElement("path",{fill:"#fff",d:"M74.4 337.3v34.9c21.6-.9 38.5-8 52.8-22.5s27.4-38 39.9-72.9l92.6-248h-44.8L140.3 236l-37-116.2h-41l54.4 139.8a57.54 57.54 0 0 1 0 41.8c-5.5 14.2-15.4 30.9-42.3 35.9z"})),vt||(vt=e.createElement("circle",{cx:368.33,cy:124.68,r:97.34,fill:"#9fda4f",transform:"rotate(-45 368.335 124.68)"})),St||(St=e.createElement("path",{fill:"#77b227",d:"m416.2 39.93-95.74 169.51A97.34 97.34 0 1 0 416.2 39.93z"})),xt||(xt=e.createElement("path",{fill:"#fec228",d:"m294.78 254.75-.15-.08-.13-.07a63.6 63.6 0 0 0-62.56 110.76h.13a63.6 63.6 0 0 0 62.71-110.67z"})),kt||(kt=e.createElement("path",{fill:"#f49a00",d:"m294.5 254.59-62.56 110.76a63.6 63.6 0 1 0 62.56-110.76z"})),_t||(_t=e.createElement("path",{fill:"#ff4e47",d:"M222.31 450.07A38.16 38.16 0 0 0 203 416.83a38.18 38.18 0 1 0 19.41 33.27z"})),Ct||(Ct=e.createElement("path",{fill:"#ed261f",d:"m202.9 416.8-37.54 66.48a38.17 38.17 0 0 0 37.54-66.48z"}))),It=({link:t,linkProps:s,isPromotionActive:r})=>{let a=(0,H.useMemo)((()=>(0,D.__)("Use AI to generate titles and meta descriptions, automatically redirect deleted pages, get 24/7 support, and much, much more!","wordpress-seo")),[]),o=me((0,D.sprintf)(/* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */ (0,D.__)("%1$sGet%2$s %3$s","wordpress-seo"),"<nowrap>","</nowrap>","Yoast SEO Premium"),{nowrap:(0,e.createElement)("span",{className:"yst-whitespace-nowrap"})});const i=r("black-friday-2024-promotion");return i&&(a=(0,H.useMemo)((()=>(0,D.__)("If you were thinking about upgrading, now's the time! 30% OFF ends 3rd Dec 11am (CET)","wordpress-seo")),[]),o=me((0,D.sprintf)(/* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */ (0,D.__)("%1$sBuy%2$s %3$s","wordpress-seo"),"<nowrap>","</nowrap>","Yoast SEO Premium"),{nowrap:(0,e.createElement)("span",{className:"yst-whitespace-nowrap"})})),(0,e.createElement)("div",{className:"yst-p-6 yst-rounded-lg yst-text-white yst-bg-primary-500 yst-shadow"},(0,e.createElement)("figure",{className:"yst-logo-square yst-w-16 yst-h-16 yst-mx-auto yst-overflow-hidden yst-border yst-border-white yst-rounded-xl yst-rounded-br-none yst-relative yst-z-10 yst-mt-[-2.6rem]"},(0,e.createElement)(Lt,null)),i&&(0,e.createElement)("div",{className:"sidebar__sale_banner_container"},(0,e.createElement)("div",{className:"sidebar__sale_banner"},(0,e.createElement)("span",{className:"banner_text"},(0,D.__)("30% OFF - BLACK FRIDAY","wordpress-seo")))),(0,e.createElement)(n.Title,{as:"h2",className:"yst-mt-6 yst-text-base yst-font-extrabold yst-text-white"},o),(0,e.createElement)("p",{className:"yst-mt-2"},a),(0,e.createElement)(n.Button,{as:"a",variant:"upsell",href:t,target:"_blank",rel:"noopener",className:"yst-flex yst-justify-center yst-gap-2 yst-mt-4 focus:yst-ring-offset-primary-500",...s},(0,e.createElement)("span",null,i?(0,D.__)("Buy now","wordpress-seo"):o),(0,e.createElement)(dt,{className:"yst-w-4 yst-h-4 yst-icon-rtl"})),(0,e.createElement)("p",{className:"yst-text-center yst-text-xs yst-mx-2 yst-font-light yst-leading-5 yst-mt-2"},(0,D.__)("30-day money back guarantee.","wordpress-seo")),(0,e.createElement)("hr",{className:"yst-border-t yst-border-primary-300 yst-my-4"}),(0,e.createElement)("a",{className:"yst-block yst-mt-4 yst-no-underline",href:"https://www.g2.com/products/yoast-yoast/reviews",target:"_blank",rel:"noopener noreferrer"},(0,e.createElement)("span",{className:"yst-font-medium yst-text-white hover:yst-underline"},(0,D.__)("Read reviews from real users","wordpress-seo")),(0,e.createElement)("span",{className:"yst-flex yst-gap-2 yst-mt-2 yst-items-center"},(0,e.createElement)(Qe,{className:"yst-w-5 yst-h-5"}),(0,e.createElement)("span",{className:"yst-flex yst-gap-1"},(0,e.createElement)(ft,{className:"yst-w-5 yst-h-5"}),(0,e.createElement)(ft,{className:"yst-w-5 yst-h-5"}),(0,e.createElement)(ft,{className:"yst-w-5 yst-h-5"}),(0,e.createElement)(ft,{className:"yst-w-5 yst-h-5"}),(0,e.createElement)(gt,{className:"yst-w-5 yst-h-5"})),(0,e.createElement)("span",{className:"yst-text-sm yst-font-semibold yst-text-white"},"4.6 / 5"))))};It.propTypes={link:V().string.isRequired,linkProps:V().object,isPromotionActive:V().func},It.defaultProps={linkProps:{},isPromotionActive:i.noop};const Nt=({premiumLink:t,premiumUpsellConfig:s,isPromotionActive:r})=>{const a=r("black-friday-2024-promotion");return(0,e.createElement)(n.Paper,{as:"div",className:"xl:yst-max-w-3xl"},a&&(0,e.createElement)("div",{className:"yst-rounded-t-lg yst-h-9 yst-flex yst-justify-between yst-items-center yst-bg-black yst-text-amber-300 yst-px-4 yst-text-lg yst-border-b yst-border-amber-300 yst-border-solid yst-font-semibold"},(0,e.createElement)("div",null,(0,D.__)("30% OFF","wordpress-seo")),(0,e.createElement)("div",null,(0,D.__)("BLACK FRIDAY","wordpress-seo"))),(0,e.createElement)("div",{className:"yst-p-6 yst-flex yst-flex-col"},(0,e.createElement)(n.Title,{as:"h2",size:"4",className:"yst-text-xl yst-text-primary-500"},(0,D.sprintf)(/* translators: %s expands to "Yoast SEO" Premium */ (0,D.__)("Upgrade to %s","wordpress-seo"),"Yoast SEO Premium")),(0,e.createElement)("ul",{className:"yst-grid yst-grid-cols-1 sm:yst-grid-cols-2 yst-gap-x-6 yst-list-disc yst-ps-[1em] yst-list-outside yst-text-slate-800 yst-mt-6"},[(0,D.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,D.__)("%1$sAI%2$s: Better SEO titles and meta descriptions, faster.","wordpress-seo"),"<strong>","</strong>"),(0,D.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,D.__)("%1$sMultiple keywords%2$s: Rank higher for more searches.","wordpress-seo"),"<strong>","</strong>"),(0,D.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,D.__)("%1$sSuper fast%2$s internal linking suggestions.","wordpress-seo"),"<strong>","</strong>"),(0,D.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,D.__)("%1$sNo more broken links%2$s: Automatic redirect manager.","wordpress-seo"),"<strong>","</strong>"),(0,D.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,D.__)("%1$sAppealing social previews%2$s people actually want to click on.","wordpress-seo"),"<strong>","</strong>"),(0,D.sprintf)(/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */ (0,D.__)("%1$s24/7 support%2$s: Also on evenings and weekends.","wordpress-seo"),"<strong>","</strong>")].map(((t,s)=>(0,e.createElement)("li",{key:`upsell-benefit-${s}`},me(t,{strong:(0,e.createElement)("span",{className:"yst-font-semibold"})}))))),(0,e.createElement)(n.Button,{as:"a",variant:"upsell",size:"extra-large",href:t,className:"yst-gap-2 yst-mt-4",target:"_blank",rel:"noopener",...s},a?(0,D.__)("Claim your 30% off now!","wordpress-seo"):(0,D.sprintf)(/* translators: %s expands to "Yoast SEO" Premium */ (0,D.__)("Explore %s now!","wordpress-seo"),"Yoast SEO Premium"),(0,e.createElement)(dt,{className:"yst-w-4 yst-h-4 yst-icon-rtl"}))))};Nt.propTypes={premiumLink:V().string.isRequired,premiumUpsellConfig:V().object,isPromotionActive:V().func},Nt.defaultProps={premiumUpsellConfig:{},isPromotionActive:i.noop},V().string.isRequired,V().object.isRequired,V().string.isRequired,V().func.isRequired,e.forwardRef((function(t,s){return e.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},t),e.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"}))})),V().bool.isRequired,V().func,V().func,V().string.isRequired,V().string.isRequired,V().string.isRequired,V().string.isRequired;const Pt=window.yoast.reactHelmet,Tt=({videoId:t,thumbnail:s,wistiaEmbedPermission:r})=>{const[a,o]=(0,H.useState)(r.value?q:F),i=(0,H.useCallback)((()=>o(q)),[o]),l=(0,H.useCallback)((()=>{r.value?i():o(U)}),[r.value,i,o]),c=(0,H.useCallback)((()=>o(F)),[o]),d=(0,H.useCallback)((()=>{r.set(!0),i()}),[r.set,i]);return(0,e.createElement)(e.Fragment,null,r.value&&(0,e.createElement)(Pt.Helmet,null,(0,e.createElement)("script",{src:"https://fast.wistia.com/assets/external/E-v1.js",async:!0})),(0,e.createElement)("div",{className:"yst-relative yst-w-full yst-h-0 yst-pt-[56.25%] yst-overflow-hidden yst-rounded-md yst-drop-shadow-md yst-bg-white"},a===F&&(0,e.createElement)("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:l},(0,e.createElement)("img",{className:"yst-w-full yst-h-auto",alt:"",loading:"lazy",decoding:"async",...s})),a===U&&(0,e.createElement)("div",{className:"yst-absolute yst-inset-0 yst-flex yst-flex-col yst-items-center yst-justify-center yst-bg-white"},(0,e.createElement)("p",{className:"yst-max-w-xs yst-mx-auto yst-text-center"},r.status===M&&(0,e.createElement)(n.Spinner,null),r.status!==M&&(0,D.sprintf)(/* 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,e.createElement)("div",{className:"yst-flex yst-mt-6 yst-gap-x-4"},(0,e.createElement)(n.Button,{type:"button",variant:"secondary",onClick:c,disabled:r.status===M},(0,D.__)("Deny","wordpress-seo")),(0,e.createElement)(n.Button,{type:"button",variant:"primary",onClick:d,disabled:r.status===M},(0,D.__)("Allow","wordpress-seo")))),r.value&&a===q&&(0,e.createElement)("div",{className:"yst-absolute yst-w-full yst-h-full yst-top-0 yst-right-0"},null===t&&(0,e.createElement)(n.Spinner,{className:"yst-h-full yst-mx-auto"}),null!==t&&(0,e.createElement)("div",{className:`wistia_embed wistia_async_${t} videoFoam=true`}))))};Tt.propTypes={videoId:V().string.isRequired,thumbnail:V().shape({src:V().string.isRequired,width:V().string,height:V().string}).isRequired,wistiaEmbedPermission:V().shape({value:V().bool.isRequired,status:V().string.isRequired,set:V().func.isRequired}).isRequired},e.forwardRef((function(t,s){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},t),e.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"}))})),V().bool.isRequired,V().func.isRequired,V().func,V().string;const At=({onGiveConsent:t,learnMoreLink:s,privacyPolicyLink:r,termsOfServiceLink:a,imageLink:o})=>{const{onClose:i,initialFocus:l}=(0,n.useModalContext)(),[c,d]=(0,n.useToggleState)(!1),u=(0,H.useMemo)((()=>({src:o,width:"432",height:"244"})),[o]),m=me((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. */ (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,e.createElement)(ct,{href:a}),a2:(0,e.createElement)(ct,{href:r})}),[p,y]=(0,n.useToggleState)(!1),g=(0,H.useCallback)((async()=>{y(),await t(),y()}),[t]);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center"},(0,e.createElement)("div",{className:"yst-relative yst-w-full"},(0,e.createElement)("img",{className:"yst-w-full yst-h-auto yst-rounded-md yst-drop-shadow-md",alt:"",loading:"lazy",decoding:"async",...u}))),(0,e.createElement)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center"},(0,e.createElement)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center"},(0,e.createElement)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium"},(0,D.sprintf)(/* translators: %s expands to Yoast AI. */ (0,D.__)("Grant consent for %s","wordpress-seo"),"Yoast AI")),(0,e.createElement)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm"},me((0,D.sprintf)(/* 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 AI Generate and Optimize 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,e.createElement)(ct,{href:s,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,e.createElement)(Ge,{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,e.createElement)("br",null)}))),(0,e.createElement)("div",{className:"yst-flex yst-w-full yst-mt-6"},(0,e.createElement)("hr",{className:"yst-w-full yst-text-gray-200"})),(0,e.createElement)("div",{className:"yst-flex yst-items-start yst-mt-4"},(0,e.createElement)("input",{type:"checkbox",id:"yst-ai-consent-checkbox",name:"yst-ai-consent-checkbox",checked:c,value:c?"true":"false",onChange:d,className:"yst-checkbox__input",ref:l}),(0,e.createElement)("label",{htmlFor:"yst-ai-consent-checkbox",className:"yst-label yst-checkbox__label yst-text-xs yst-font-normal yst-text-slate-500"},m)),(0,e.createElement)("div",{className:"yst-w-full yst-flex yst-mt-4"},(0,e.createElement)(n.Button,{as:"button",className:"yst-grow",size:"large",disabled:!c,onClick:g},p&&(0,e.createElement)(n.Spinner,{className:"yst-me-2"}),(0,D.__)("Grant consent","wordpress-seo"))),(0,e.createElement)(n.Button,{as:"button",className:"yst-mt-4",variant:"tertiary",onClick:i},(0,D.__)("Close","wordpress-seo"))))};At.propTypes={onGiveConsent:V().func.isRequired,learnMoreLink:V().string.isRequired,privacyPolicyLink:V().string.isRequired,termsOfServiceLink:V().string.isRequired,imageLink:V().string.isRequired};const Mt=()=>{const t=(0,a.useSelect)((e=>e(K).selectLink("https://yoa.st/ai-common-errors")),[]),s=(0,a.useSelect)((e=>e(K).selectAdminLink("?page=wpseo_page_support")),[]);return(0,e.createElement)(n.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,D.__)("Something went wrong","wordpress-seo")),(0,e.createElement)("p",{className:"yst-mt-2"},me((0,D.sprintf)(/* 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,e.createElement)(ct,{variant:"error",href:t}),a2:(0,e.createElement)(ct,{variant:"error",href:s})})))},$t=()=>{const t=(0,a.useSelect)((e=>e(K).selectLink("https://yoa.st/ai-common-errors")),[]),s=(0,a.useSelect)((e=>e(K).selectAdminLink("?page=wpseo_page_support")),[]);return(0,e.createElement)(n.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,D.__)("Not enough content","wordpress-seo")),(0,e.createElement)("p",{className:"yst-mt-2"},me((0,D.sprintf)(/* 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,e.createElement)(ct,{variant:"error",href:t}),a2:(0,e.createElement)(ct,{variant:"error",href:s})})))},Ot=()=>{const t=(0,a.useSelect)((e=>e(K).selectAdminLink("?page=wpseo_page_settings#/site-features#card-wpseo-keyword_analysis_active")),[]),s=(0,H.useCallback)((()=>{window.location.reload()}),[]),{onClose:r}=(0,n.useModalContext)();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,D.__)("SEO analysis required","wordpress-seo")),(0,e.createElement)("p",{className:"yst-mt-2"},me((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. */ (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,e.createElement)(ct,{variant:"error",href:t})}))),(0,e.createElement)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end"},(0,e.createElement)(n.Button,{variant:"secondary",onClick:r},(0,D.__)("Close","wordpress-seo")),(0,e.createElement)(n.Button,{className:"yst-revoke-button",variant:"primary",onClick:s},(0,D.__)("Refresh page","wordpress-seo"))))},Ft=()=>{const t=(0,a.useSelect)((e=>e(K).selectLink("https://yoa.st/ai-generator-rate-limit-help")),[]);return(0,e.createElement)(n.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,D.__)("You've reached the Yoast AI rate limit","wordpress-seo")),(0,e.createElement)("p",{className:"yst-mt-2"},me((0,D.sprintf)(/* 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,e.createElement)(ct,{variant:"error",href:t})})))},Ut=({invalidSubscriptions:t=[]})=>{const s=(0,a.useSelect)((e=>e(K).selectLink("https://yoa.st/ai-generator-activate-premium")),[]),r=(0,a.useSelect)((e=>e(K).selectLink("https://yoa.st/ai-generator-new-premium")),[]),o=(0,a.useSelect)((e=>e(K).selectLink("https://yoa.st/ai-generator-activate-yoast-woocommerce")),[]),i=(0,a.useSelect)((e=>e(K).selectLink("https://yoa.st/ai-generator-new-yoast-woocommerce")),[]),l=(0,a.useSelect)((e=>e(K).selectLink("https://yoa.st/ai-generator-activate-woocommerce-premium-bundle")),[]),c=(0,a.useSelect)((e=>e(K).selectLink("https://yoa.st/ai-generator-new-woocommerce-premium-bundle")),[]),{onClose:d}=(0,n.useModalContext)(),u=(0,H.useCallback)((async()=>{try{await p()({path:"yoast/v1/ai_generator/bust_subscription_cache",method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()}),[]);let m,y,g;1===t.length&&(m=t[0],y="Yoast SEO Premium"===m?s:o,g="Yoast SEO Premium"===m?r:i);const h=me((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. **/ (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"),m,"MyYoast","<Activate>","</Activate>","<New>","</New>"),{Activate:(0,e.createElement)(ct,{variant:"error",href:y}),New:(0,e.createElement)(ct,{variant:"error",href:g})}),f=me((0,D.sprintf)( /** * translators: * %1$s expands to MyYoast. * %2$s expands to Yoast SEO Premium. * %3$s expands to Yoast WooCommerce SEO. * %4$s expands to Yoast WooCommerce SEO Premium bundle. * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to activate your subscription. * %7$s and %8$s expand to an opening and closing anchor tag, respectively, to get a new subscription. **/ (0,D.__)("To access this feature, you need active %2$s and %3$s subscriptions. Please %5$sactivate your subscriptions in %1$s%6$s or %7$sget a new %4$s%8$s. Afterward, refresh this page. It may take up to 30 seconds for the feature to function correctly.","wordpress-seo"),"MyYoast","Yoast SEO Premium","Yoast WooCommerce SEO","Yoast WooCommerce SEO Premium bundle","<Activate>","</Activate>","<New>","</New>"),{Activate:(0,e.createElement)(ct,{variant:"error",href:l}),New:(0,e.createElement)(ct,{variant:"error",href:c})});return(0,e.createElement)(H.Fragment,null,(0,e.createElement)(n.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,D.__)("Subscription required","wordpress-seo")),(0,e.createElement)("p",{className:"yst-mt-2"},1===t.length&&h,t.length>1&&f)),(0,e.createElement)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end"},(0,e.createElement)(n.Button,{variant:"secondary",onClick:d},(0,D.__)("Close","wordpress-seo")),(0,e.createElement)(n.Button,{variant:"primary",onClick:u},(0,D.__)("Refresh page","wordpress-seo"))))};Ut.propTypes={invalidSubscriptions:V().array};const qt=()=>{const t=(0,a.useSelect)((e=>e(K).selectLink("https://yoa.st/ai-common-errors")),[]),s=(0,a.useSelect)((e=>e(K).selectAdminLink("?page=wpseo_page_support")),[]);return(0,e.createElement)(n.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,D.__)("Connection timeout","wordpress-seo")),(0,e.createElement)("p",{className:"yst-mt-2"},me((0,D.sprintf)(/* 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,e.createElement)(ct,{variant:"error",href:t}),a2:(0,e.createElement)(ct,{variant:"error",href:s})})))},Wt=()=>{const t=(0,a.useSelect)((e=>e(K).selectAdminLink("?page=wpseo_page_support")),[]);return(0,e.createElement)(n.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,D.__)("Usage policy violation","wordpress-seo")),(0,e.createElement)("p",{className:"yst-mt-2"},me((0,D.sprintf)( /* 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,e.createElement)(ct,{variant:"error",href:"https://openai.com/policies/usage-policies"}),a2:(0,e.createElement)(ct,{variant:"error",href:t})})))},Bt=({errorMessage:t=""})=>{const s=(0,a.useSelect)((e=>e(K).selectAdminLink("?page=wpseo_page_support")),[]);return(0,e.createElement)(n.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,D.__)("Something went wrong","wordpress-seo")),(0,e.createElement)("p",{className:"yst-mt-2"},(0,D.sprintf)(/* translators: %s is the error response of the request. */ (0,D.__)("The request came back with the following error: '%s'.","wordpress-seo"),t)),(0,e.createElement)("p",{className:"yst-mt-2"},me((0,D.sprintf)(/* 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,e.createElement)(ct,{variant:"error",href:s})})))};Bt.propTypes={errorMessage:V().string};const zt=()=>{const t=(0,a.useSelect)((e=>e(K).selectAdminLink("plugins.php")),[]);return(0,e.createElement)(n.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,D.__)("Something went wrong","wordpress-seo")),(0,e.createElement)("p",{className:"yst-mt-2"},me((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. */ (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,e.createElement)(ct,{variant:"error",href:t})})))},Ht=()=>{const t=(0,a.useSelect)((e=>e(K).selectLink("https://yoa.st/ai-common-errors")),[]),s=(0,a.useSelect)((e=>e(K).selectAdminLink("?page=wpseo_page_support")),[]);return(0,e.createElement)(n.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,D.__)("Yoast AI cannot reach your site","wordpress-seo")),(0,e.createElement)("p",{className:"yst-mt-2"},me((0,D.sprintf)(/* 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,e.createElement)(ct,{variant:"error",href:t}),a2:(0,e.createElement)(ct,{variant:"error",href:s})})))},Dt=({errorCode:t,errorIdentifier:s="",errorMessage:r=""})=>{switch(t){case 400:switch(s){case"SITE_UNREACHABLE":return(0,e.createElement)(Ht,null);case"WP_HTTP_REQUEST_ERROR":return(0,e.createElement)(Bt,{errorMessage:r});default:return(0,e.createElement)(Mt,null)}case 429:return(0,e.createElement)(Ft,null);default:return(0,e.createElement)(Mt,null)}};Dt.propTypes={errorCode:V().number.isRequired,errorIdentifier:V().string,errorMessage:V().string};const Gt=({currentSubscriptions:t,isSeoAnalysisActive:s=!0})=>{const{isPremium:r,usageCountStatus:o,usageCountError:n,isWooProductEntity:i,isWooSeoActive:l}=(0,a.useSelect)((e=>{const t=e(K);return{isPremium:t.getIsPremium(),usageCountStatus:e(Y).selectUsageCountStatus(),usageCountError:e(Y).selectUsageCountError(),isWooProductEntity:t.getIsWooProductEntity(),isWooSeoActive:t.getIsWooSeoActive()}}),[]),c=(0,H.useMemo)((()=>!t.wooCommerceSubscription&&i),[t.wooCommerceSubscription]),d=(0,H.useMemo)((()=>{const e=[];return!r&&!i||t.premiumSubscription||e.push("Yoast SEO Premium"),c&&l&&e.push("Yoast WooCommerce SEO"),e}),[r,t.premiumSubscription,c,l,i]);return d.length>0?(0,e.createElement)(Ut,{invalidSubscriptions:d}):s?o===ne.error?(0,e.createElement)(Dt,{...n}):void 0:(0,e.createElement)(Ot,null)};Gt.propTypes={currentSubscriptions:V().object.isRequired,isSeoAnalysisActive:V().bool};const jt=({onStartGenerating:t})=>{const{termsOfServiceLink:s,privacyPolicyLink:r,learnMoreLink:o,imageLink:n,consentEndpoint:i}=(0,a.useSelect)((e=>({termsOfServiceLink:e(K).selectLink("https://yoa.st/ai-generator-terms-of-service"),privacyPolicyLink:e(K).selectLink("https://yoa.st/ai-generator-privacy-policy"),learnMoreLink:e(K).selectLink("https://yoa.st/ai-generator-learn-more"),imageLink:e(K).selectImageLink("ai-consent.png"),consentEndpoint:e(Y).selectAiGeneratorConsentEndpoint()})),[]),{storeAiGeneratorConsent:l}=(0,a.useDispatch)(Y),c=(0,H.useCallback)((async()=>{await l(!0,i),t()}),[l,t,i]);return(0,e.createElement)(At,{termsOfServiceLink:s,privacyPolicyLink:r,learnMoreLink:o,imageLink:n,onGiveConsent:c})};jt.propTypes={onStartGenerating:V().func.isRequired};const Vt=e.forwardRef((function(t,s){return e.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},t),e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))})),Yt=e.forwardRef((function(t,s){return e.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},t),e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))})),Kt=/(?<start><\/badge>|^(?!<badge>))(?<wrap>[\s\S]+?)(?<end><badge>|$)/g,Zt=({total:t,current:s,onNavigate:r,disabled:a=!1,...o})=>(0,e.createElement)("div",{className:"yst-flex yst-justify-between yst-gap-x-2 yst-items-start"},(0,e.createElement)("p",{className:"yst-text-slate-500 yst-text-xxs yst-mt-1"},(0,D.__)("Text generated by AI may be offensive or inaccurate.","wordpress-seo")),t>1&&(0,e.createElement)(n.Pagination,{className:"yst-shrink-0",current:s,total:t,onNavigate:r,disabled:a,variant:"text" /* translators: Hidden accessibility text. */,screenReaderTextPrevious:(0,D.__)("Previous","wordpress-seo") /* translators: Hidden accessibility text. */,screenReaderTextNext:(0,D.__)("Next","wordpress-seo"),...o})),Xt=({height:t})=>{const[s,r]=(0,H.useState)(""),{onClose:o}=(0,n.useModalContext)(),{editType:l,previewType:c,contentType:d}=Ce(),u=(()=>{const{editType:e,previewType:t}=Ce();let s="SEO";switch(t){case X:s="social";break;case Q:s="X"}switch(e){case J:return(0,D.sprintf)(/* translators: %s is the type of title. */ (0,D.__)("Generated %s titles","wordpress-seo"),s);case ee:return t===Z&&(s="meta"),(0,D.sprintf)(/* translators: %s is the type of description. */ (0,D.__)("Generated %s descriptions","wordpress-seo"),s)}})(),m=(()=>{const{editType:e,previewType:t}=Ce();let s="SEO";switch(t){case X:s="social";break;case Q:s="X"}switch(e){case J:return(0,D.sprintf)(/* translators: %s is the type of title. */ (0,D.__)("Apply %s title","wordpress-seo"),s);case ee:return t===Z&&(s="meta"),(0,D.sprintf)(/* translators: %s is the type of description. */ (0,D.__)("Apply %s description","wordpress-seo"),s)}})(),y=Le(),{suggestions:g,fetchSuggestions:h,setSelectedSuggestion:f}=(()=>{const[e,t]=(0,H.useReducer)(Ne.reducer,Ne.getInitialState()),{editType:s,previewType:r,postType:o,contentType:n}=Ce(),l=(0,a.useSelect)((e=>e(Y).selectPromptContent()),[]),{contentLocale:c,focusKeyphrase:d,isWooCommerceActive:u,isGutenberg:m,isElementor:y}=(0,a.useSelect)((e=>({contentLocale:e(K).getContentLocale(),focusKeyphrase:e(K).getFocusKeyphrase(),isWooCommerceActive:e(K).getIsWooCommerceActive(),isGutenberg:e(K).getIsBlockEditor(),isElementor:e(K).getIsElementorEditor()})),[]);let g,h=de.languageProcessing.helpers.processExactMatchRequest(d).keyphrase;h.length>191&&(h=h.slice(0,191)),g=y?"elementor":m?"gutenberg":"classic";const f=((e,t,s,r)=>{const a=e===ee?"meta-description":"seo-title";let o=((e,t)=>{if(e)switch(t){case"product":return"product-";case"product_cat":case"product_tag":return"product-taxonomy-"}return""})(t,s);return o&&t||r!==se||(o="taxonomy-"),`${o}${a}`})(s,u,o,n);return{suggestions:e,fetchSuggestions:(0,H.useCallback)((async(e=!0)=>{t(Ne.actions.setLoading());const{status:s,payload:a}=await(async({endpoint:e,data:t})=>{let s;const r=1e3*(0,i.get)(window,"wpseoAiGenerator.requestTimeout",30);try{ye&&ye.abort(),ye=new AbortController,ge=!1,s=setTimeout((()=>{ge=!0,ye.abort()}),r);const a=await p()({path:e,method:"POST",data:t,parse:!1,signal:ye.signal}),o=await a.json();return{status:ie,payload:o}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return ge?{status:le,payload:{message:"timeout",code:408}}:{status:ce};const{message:t,missingLicenses:s,errorIdentifier:r}=await(async e=>{try{const t=e.body.getReader(),{value:s}=await t.read(),r=new TextDecoder("utf-8").decode(s);return console.error(r),JSON.parse(r)}catch(e){return{message:"Unknown"}}})(e);return{status:le,payload:{message:t,code:e.status||500,missingLicenses:s,errorIdentifier:r}}}finally{clearTimeout(s)}})({endpoint:"yoast/v1/ai_generator/get_suggestions/",canAbort:e,data:{type:f,prompt_content:l,focus_keyphrase:h,platform:Pe(r),language:fe(c).replace("_","-"),editor:g}});switch(s){case ce:break;case le:t(Ne.actions.setError(a));break;case ie:t(Ne.actions.setSuccess(a))}return s}),[t]),setSelectedSuggestion:(0,H.useCallback)((e=>t(Ne.actions.setSelected(e))),[t])}})(),w=(()=>{const{previewType:e}=Ce();switch(e){case X:return us;case Q:return Er;default:return os}})(),{addAppliedSuggestion:E,addUsageCount:b}=(0,a.useDispatch)(Y),{isUsageCountLimitReached:v,isWooProductEntity:S,hasValidPremiumSubscription:x,hasValidWooSubscription:k}=(0,a.useSelect)((e=>{const t=e(Y),s=e(K);return{isUsageCountLimitReached:t.isUsageCountLimitReached(),isPremium:s.getIsPremium(),isWooProductEntity:s.getIsWooProductEntity(),isWooSeoActive:s.getIsWooSeoActive(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription()}}),[]),_=(0,H.useMemo)((()=>g.status===ne.loading||!(k||!v||!S)||!(x||!v)),[x,v,g.status,S,k]),C=(0,n.usePrevious)(t),R=g.status===ne.success?t:C,L=`calc(${0===R?"50%":R/2+"px"} - 40vh)`,[I,N]=(0,H.useState)(!1),P=(0,H.useCallback)((e=>{N(e.target.offsetHeight!==e.target.scrollHeight)}),[N]),T=Ie(P),A=(()=>{const{editType:e,previewType:t,contentType:s}=Ce(),r=(()=>{const{previewType:e}=Ce();return(0,H.useMemo)((()=>{switch(e){case Z:return()=>(0,a.select)(K).getSnippetEditorData().title;case X:return(0,a.select)(K).getFacebookTitleOrFallback;case Q:return(0,a.select)(K).getTwitterTitleOrFallback;default:return(0,i.constant)("")}}),[e])})(),o=(0,a.useSelect)((s=>s(Y).selectAppliedSuggestionFor({editType:e,previewType:t})),[e,t]);return(0,H.useMemo)((()=>{let t=r();return e===ee?t:(o&&(t=t.replace(o,ae[s])),((e,t)=>e.includes(ae[t])?e:ae[t])(t,s))}),[e,r])})(),M=(()=>{const e=(()=>{const{previewType:e}=Ce();return(0,H.useMemo)((()=>{switch(e){case Z:return()=>(0,a.select)(K).getSnippetEditorData().description;case X:return(0,a.select)(K).getFacebookDescriptionOrFallback;case Q:return(0,a.select)(K).getTwitterDescriptionOrFallback;default:return(0,i.constant)("")}}),[e])})();return(0,H.useMemo)(e,[e])})(),$=Se(),O=(0,H.useMemo)((()=>l===J?{[re[d]]:g.selected}:{}),[l,d,g.selected]),F=(0,H.useMemo)((()=>$(A,{overrides:O,contentType:d})),[$,A,l,d,g.selected]),U=(0,H.useMemo)((()=>$(A,{overrides:{...O,sep:"",sitename:""},contentType:d})),[$,A,l,d,g.selected]),q=(0,H.useMemo)((()=>l===ee?g.selected:$(M,{editType:ee})),[$,M,l,g.selected]),W=(0,H.useCallback)((e=>$(A,{overrides:{[re[d]]:e},key:"badge",applyPluggable:!1,contentType:d})),[$,A,d]),{currentPage:B,setCurrentPage:z,isOnLastPage:G,totalPages:j,getItemsOnCurrentPage:V}=(({totalItems:e=0,perPage:t=5})=>{const[s,r]=(0,H.useState)(1),a=(0,H.useMemo)((()=>Math.ceil(e/t)),[e,t]),o=(0,H.useMemo)((()=>s*t),[s,t]),n=(0,H.useMemo)((()=>o-t),[o,t]),l=(0,H.useMemo)((()=>1===s),[s]),c=(0,H.useMemo)((()=>s===a),[s,a]),d=(0,H.useCallback)((()=>{s>1&&r(s-1)}),[s,r]),u=(0,H.useCallback)((()=>{s<a&&r(s+1)}),[s,r,a]),m=(0,H.useCallback)((e=>(0,i.slice)(e,n,o)),[n,o]);return{currentPage:s,setCurrentPage:r,totalPages:a,isOnFirstPage:l,isOnLastPage:c,previousPage:d,nextPage:u,firstOnPage:n,lastOnPage:o,getItemsOnCurrentPage:m}})({totalItems:g.status===ne.loading||g.status===ne.error?g.entities.length+5:g.entities.length,perPage:5}),te=(0,H.useMemo)((()=>(0,i.map)(V(g.entities),(t=>{let s=t;return l===J&&(s=W(t),s=s.replace(Kt,((e,t,s,r,a,o,{start:n,wrap:i,end:l})=>{const c=i.trim();return 0===c.length?`${n}${i}${l}`:`${n}<span>${c}</span>${l}`})),s=me(s,{badge:(0,e.createElement)(n.Badge,{className:"yst-me-2 last:yst-me-0",variant:"plain"}," "),span:(0,e.createElement)("span",{className:"yst-flex yst-items-center yst-me-2 last:yst-me-0"})})),{value:t,label:s}}))),[g.entities,V,l,W]),oe=(0,H.useMemo)((()=>g.status!==ne.error||g.status===ne.error&&!G),[g.status,G]),ue=(0,H.useMemo)((()=>g.status===ne.loading&&G),[g.status,G]),pe=(0,H.useMemo)((()=>g.status===ne.error&&G),[g.status,G]),he=(0,H.useCallback)((()=>{_||(z(g.status===ne.error?j:j+1),h().then((e=>{e===ie&&b()})))}),[h,g.status,j,z,f,v]),we=(0,H.useCallback)((()=>r("")),[r]),Ee=(()=>{const{editType:e}=Ce();switch(e){case J:return(()=>{const{previewType:e}=Ce(),{updateData:t,setFacebookPreviewTitle:s,setTwitterPreviewTitle:r}=(0,a.useDispatch)(K);return(0,H.useMemo)((()=>{switch(e){case Z:return e=>t({title:e});case X:return s;case Q:return r;default:return i.noop}}),[e,t,s,r])})();case ee:return(()=>{const{previewType:e}=Ce(),{updateData:t,setFacebookPreviewDescription:s,setTwitterPreviewDescription:r}=(0,a.useDispatch)(K);return(0,H.useMemo)((()=>{switch(e){case Z:return e=>t({description:e});case X:return s;case Q:return r;default:return i.noop}}),[e,t,s,r])})();default:return i.noop}})(),be=(0,H.useCallback)((()=>{const e=l===J?A.replace(new RegExp(ae[d]+"( Archives)?"),g.selected):g.selected;Ee(e),E({editType:l,previewType:c,suggestion:g.selected}),o()}),[Ee,l,c,g.selected,A,o,E]);return((e,t=[])=>{const s=(0,H.useRef)(!1);(0,H.useEffect)((()=>{s.current||(s.current=!0,e().finally((()=>{s.current=!1})))}),[e,t])})((()=>""===s?h().then((e=>{r(e),e===ie&&b()})):Promise.resolve()),[s,b,h]),s===le||g.status===ne.error&&402===g.error.code?(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst-space-y-6 yst-mt-6"},(0,e.createElement)(ur,{errorCode:g.error.code,errorIdentifier:g.error.errorIdentifier,invalidSubscriptions:g.error.missingLicenses,showActions:!0,onRetry:we,errorMessage:g.error.message})):(0,e.createElement)(H.Fragment,null,(0,e.createElement)(n.Modal.Container.Content,{ref:T,className:"yst-flex yst-flex-col yst-py-6 yst-space-y-2"},(0,e.createElement)(w,{title:F,description:q,status:g.status,titleForLength:U,showPreviewSkeleton:""===s,showLengthProgress:!ue}),oe&&(ue?(0,e.createElement)(hr,{idSuffix:y,suggestionClassNames:l===J?[["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,e.createElement)(H.Fragment,null,(0,e.createElement)("div",{className:"yst-flex yst-space-y-4"},(0,e.createElement)(n.Label,{as:"span",className:"yst-flex-grow yst-cursor-default yst-mt-auto"},u),(0,e.createElement)(n.Button,{variant:"secondary",size:"small",onClick:g.status===ne.loading?i.noop:he,isLoading:g.status===ne.loading,disabled:_},g.status!==ne.loading&&(0,e.createElement)(Vt,{className:"yst--ms-1 yst-me-2 yst-h-4 yst-w-4 yst-text-gray-400"}),(0,D.__)("Generate 5 more","wordpress-seo"))),(0,e.createElement)(yr,{idSuffix:y,suggestions:te,selected:g.selected,onChange:f}),(0,e.createElement)(Zt,{current:B,total:j,onNavigate:z,disabled:g.status===ne.loading||pe}))),g.status===ne.error&&G&&(0,e.createElement)(H.Fragment,null,(0,e.createElement)("div",{className:"yst-mt-8"}),(0,e.createElement)(ur,{errorCode:g.error.code,errorIdentifier:g.error.errorIdentifier,invalidSubscriptions:g.error.missingLicenses,errorMessage:g.error.message}),(0,e.createElement)(Zt,{current:B,total:j,onNavigate:z,disabled:g.status===ne.loading}))),(0,e.createElement)(n.Modal.Container.Footer,null,I&&(0,e.createElement)("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,e.createElement)("hr",{className:"yst-mb-6 yst--mx-6"}),(0,e.createElement)("div",{className:"sm:yst-flex sm:yst-justify-end sm:yst-space-x-2 sm:rtl:yst-space-x-reverse"},(0,e.createElement)("div",{className:"yst-hidden sm:yst-inline"},(0,e.createElement)(n.Button,{variant:"secondary",onClick:o},(0,D.__)("Close","wordpress-seo"))),(0,e.createElement)("div",{className:"yst-block sm:yst-inline"},(0,e.createElement)(n.Button,{className:"yst-w-full sm:yst-w-auto",variant:"primary",onClick:be,disabled:""===g.selected||g.status===ne.loading||pe},(0,e.createElement)(Yt,{className:"yst--ms-1 yst-me-1 yst-h-4 yst-w-4 yst-text-white"}),m)),(0,e.createElement)("div",{className:"yst-mt-3 sm:yst-hidden"},(0,e.createElement)(n.Button,{variant:"secondary",onClick:o,className:"yst-w-full sm:yst-w-auto"},(0,D.__)("Close","wordpress-seo"))))),(0,e.createElement)(n.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{marginTop:L},position:"bottom-left"},g.status!==ne.loading&&(0,e.createElement)(Cr,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all"}),(g.status===ne.success||g.status===ne.loading)&&(0,e.createElement)(wr,null)))};Xt.propTypes={height:V().number.isRequired};var Qt=s(4530),Jt=s.n(Qt);const es=({onActivateFreeSparks:t})=>{const{premiumUpsellLink:s,wooUpsellLink:r,isWooCommerceActive:o,isProductPost:i,learnMoreLink:l,imageLink:c,wistiaEmbedPermissionValue:d,wistiaEmbedPermissionStatus:u,isUsageCountLimitReached:m,activateFreeSparksEndpoint:p}=(0,a.useSelect)((e=>{const t=e(Y),s=e(K);return{premiumUpsellLink:s.selectLink("https://yoa.st/ai-generator-upsell"),wooUpsellLink:s.selectLink("https://yoa.st/ai-generator-upsell-woo-seo"),isWooCommerceActive:s.getIsWooCommerceActive(),isProductPost:s.getIsProduct(),learnMoreLink:s.selectLink("https://yoa.st/ai-generator-learn-more"),imageLink:s.selectImageLink("ai-generator-preview.png"),wistiaEmbedPermissionValue:s.selectWistiaEmbedPermissionValue(),wistiaEmbedPermissionStatus:s.selectWistiaEmbedPermissionStatus(),isUsageCountLimitReached:t.isUsageCountLimitReached(),activateFreeSparksEndpoint:t.selectFreeSparksActiveEndpoint()}}),[]),{onClose:y,initialFocus:g}=(0,n.useModalContext)(),{title:h,upsellLabel:f,upsellLink:w,ctbId:E,newToText:b}=(e=>{const{isWooProductEntity:t,isProductPost:s,hasValidWooSubscription:r}=(0,a.useSelect)((e=>{const t=e(K),s=e(Y);return{isWooProductEntity:t.getIsWooProductEntity(),isProductPost:t.getIsProduct(),hasValidWooSubscription:s.selectWooCommerceSubscription()}}),[]);return(0,H.useMemo)((()=>{const a={upsellLink:e.premium,upsellLabel:(0,D.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ (0,D.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),newToText:"Yoast SEO Premium",ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",title:(0,D.__)("Use AI to generate your titles & descriptions!","wordpress-seo")};return t&&(s&&(a.title=(0,D.__)("Generate product titles & descriptions with AI!","wordpress-seo")),r||(a.newToText="Yoast WooCommerce SEO",a.upsellLabel=(0,D.sprintf)(/* translators: %1$s expands to Yoast WooCommerce SEO. */ (0,D.__)("Unlock with %1$s","wordpress-seo"),"Yoast WooCommerce SEO"),a.upsellLink=e.woo,a.ctbId="5b32250e-e6f0-44ae-ad74-3cefc8e427f9")),a}),[t,s,e.premium,e.woo])})({premium:s,woo:r}),v=(0,H.useMemo)((()=>o&&i),[o,i]),S=(0,H.useMemo)((()=>({src:c,width:"432",height:"244"})),[c]),{setWistiaEmbedPermission:x}=(0,a.useDispatch)(K),{activateFreeSparks:k}=(0,a.useDispatch)(Y),_=(0,H.useMemo)((()=>({value:d,status:u,set:x})),[d,u,x]),C=(0,H.useCallback)((()=>{k({endpoint:p}),t()}),[k,p,y,t]),R={a:(0,e.createElement)(ct,{href:l,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,e.createElement)(Ge,{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"})};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center"},(0,e.createElement)("div",{className:"yst-relative yst-w-full"},(0,e.createElement)(Tt,{videoId:"vmrahpfjxp",thumbnail:S,wistiaEmbedPermission:_}),(0,e.createElement)(n.Badge,{className:"yst-absolute yst--top-2 yst-end-4",variant:"info"},"Beta")),(0,e.createElement)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center"},(0,e.createElement)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center"},(0,e.createElement)("span",{className:"yst-logo-icon"}),b))),(0,e.createElement)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center"},(0,e.createElement)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center"},(0,e.createElement)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium"},h),(0,e.createElement)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm"},me(v?(0,D.sprintf)(/* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ (0,D.__)("Let AI do some of the thinking for you and help you save time. Get high-quality suggestions for product titles and meta descriptions to make your content rank high and look good on social media. %1$sLearn more%2$s%3$s","wordpress-seo"),"<a>","<ArrowNarrowRightIcon />","</a>"):(0,D.sprintf)(/* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ (0,D.__)("Let AI do some of the thinking for you and help you save time. Get high-quality suggestions for titles and meta descriptions to make your content rank high and look good on social media. %1$sLearn more%2$s%3$s","wordpress-seo"),"<a>","<ArrowNarrowRightIcon />","</a>"),R))),m&&(0,e.createElement)(n.Alert,{className:"yst-my-4"},(0,D.sprintf)(/* translators: %s is for Yoast SEO Premium. */ (0,D.__)("Oh no! Its seems like you're out of free Sparks. Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),"Yoast SEO Premium")),(0,e.createElement)("div",{className:Jt()("yst-w-full yst-flex yst-flex-col",m?"yst-mt-0":"yst-mt-6")},(0,e.createElement)(n.Button,{as:"a",className:"yst-grow",size:"extra-large",variant:"upsell",href:w,target:"_blank",ref:g,"data-action":"load-nfd-ctb","data-ctb-id":E},(0,e.createElement)(De,{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5"}),f,(0,e.createElement)("span",{className:"yst-sr-only"},/* translators: Hidden accessibility text. */ (0,D.__)("(Opens in a new browser tab)","wordpress-seo"))),!m&&(0,e.createElement)(G.GradientButton,{onClick:C,className:"yst-mt-2 yst-w-full yst-text-base yst-text-slate-800 yst-font-medium yst-h-11 hover:yst-bg-gradient-to-l hover:yst-from-indigo-100 hover:yst-to-primary-100"},(0,D.__)("Try for free","wordpress-seo"))),(0,e.createElement)(n.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:y},(0,D.__)("Close","wordpress-seo"))))},ts=({isOpen:t,onClose:s,closeButtonScreenReaderText:r,panelRef:a,title:o,aiModalHelperLink:i,children:l})=>{const c=(0,n.useSvgAria)();return(0,e.createElement)(n.Modal,{className:"yst-ai-modal",isOpen:t,onClose:s},(0,e.createElement)(n.Modal.Panel,{ref:a,className:"yst-max-w-3xl yst-relative",closeButtonScreenReaderText:r},(0,e.createElement)(n.Modal.Container,null,(0,e.createElement)(n.Modal.Container.Header,null,(0,e.createElement)("div",{className:"yst-flex yst-items-center"},(0,e.createElement)("span",{className:"yst-logo-icon yst-h-5 yst-w-5"}),(0,e.createElement)(n.Modal.Title,{className:"yst-ms-3 yst-me-1.5",as:"h1",size:"2"},o),(0,e.createElement)(n.Link,{id:"ai-modal-learn-more",href:i,variant:"primary",className:"yst-no-underline yst-me-2",target:"_blank",rel:"noopener" /* translators: Hidden accessibility text. */,"aria-label":(0,D.__)("Learn more about AI (Opens in a new browser tab)","wordpress-seo")},(0,e.createElement)(z,{...c,className:"yst-w-4 yst-h-4 yst-text-slate-500 yst-shrink-0"})),(0,e.createElement)(n.Badge,{variant:"info"},(0,D.__)("Beta","wordpress-seo"))),(0,e.createElement)("hr",{className:"yst-mt-6 yst--mx-6"})),l)))},ss=({isOpen:t,onClose:s,closeButtonScreenReaderText:r,children:a})=>(0,e.createElement)(n.Modal,{className:"yst-introduction-modal",isOpen:t,onClose:s},(0,e.createElement)(n.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-rounded-3xl",closeButtonScreenReaderText:r},a)),rs={inactive:"inactive",askConsent:"askConsent",upsell:"upsell",error:"error",generate:"generate"},as=({onUseAi:t})=>{const[s,r]=(0,H.useState)(rs.inactive),{editType:o}=Ce(),i=Le(),l=(()=>{const{editType:e,previewType:t}=Ce();switch(t){case X:return e===ee?(0,D.__)("AI social description generator","wordpress-seo"):(0,D.__)("AI social title generator","wordpress-seo");case Q:return e===ee?(0,D.__)("AI X description generator","wordpress-seo"):(0,D.__)("AI X title generator","wordpress-seo");default:return e===ee?(0,D.__)("AI description generator","wordpress-seo"):(0,D.__)("AI title generator","wordpress-seo")}})(),{hasConsent:c,promptContentInitialized:d,currentSubscriptions:u,usageCountStatus:m,usageCount:p,usageCountLimit:y,usageCountEndpoint:g,hasValidPremiumSubscription:h,hasValidWooSubscription:f,focusKeyphrase:w,isPremium:E,isSeoAnalysisActive:b,aiModalHelperLink:v,isWooProductEntity:S,isFreeSparksActive:x,isWooSeoActive:k}=(0,a.useSelect)((e=>{const t=e(Y),s=e(K);return{hasConsent:t.selectHasAiGeneratorConsent(),promptContentInitialized:t.selectPromptContentInitialized(),currentSubscriptions:t.selectProductSubscriptions(),usageCountStatus:t.selectUsageCountStatus(),usageCount:t.selectUsageCount(),usageCountLimit:t.selectUsageCountLimit(),usageCountEndpoint:t.selectUsageCountEndpoint(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription(),focusKeyphrase:s.getFocusKeyphrase(),isPremium:s.getIsPremium(),isWooSeoActive:s.getIsWooSeoActive(),isSeoAnalysisActive:s.getPreference("isKeywordAnalysisActive",!0),aiModalHelperLink:s.selectLink("https://yoa.st/ai-generator-help-button-modal"),isWooProductEntity:s.getIsWooProductEntity(),isFreeSparksActive:e(Y).selectIsFreeSparksActive()}}),[]),{fetchUsageCount:_}=(0,a.useDispatch)(Y),{closeEditorModal:C}=(0,a.useDispatch)(K),R=(0,D.__)("Close modal","wordpress-seo"),[L,I]=(0,H.useState)(!1),[N,P]=(0,H.useState)(0),T=(0,H.useCallback)((e=>P(e.borderBoxSize[0].blockSize)),[P]),A=Ie(T),$={onClose:(0,H.useCallback)((()=>{r(rs.inactive)}),[]),closeButtonScreenReaderText:R},O=(0,H.useCallback)((()=>!be(w)),[w]),F=(0,H.useCallback)((()=>{C(),setTimeout((()=>(e=>{const t=`focus-keyword-input-${"modal"===e?"sidebar":e}`;if("metabox"===e){const e=document.getElementById("wpseo-meta-tab-content");e&&e.click()}const s=document.getElementById(t);s&&s.focus()})(i)),0)}),[C,i]),U=(0,H.useCallback)((()=>S?f&&h:h),[h,f,S]),q=(0,H.useCallback)((async()=>{if(t(),!b)return void r(rs.error);if(!O())return r(rs.inactive),void F();const e=U();if(!e&&E&&k&&S)return void r(rs.error);if(!e&&E&&!S)return void r(rs.error);if(!c&&(x||e))return void r(rs.askConsent);I(!0);const{type:s,payload:a}=await _({endpoint:g,isWooProductEntity:S}),o=429===(null==a?void 0:a.errorCode)||a.count>=a.limit;I(!1),403!==(null==a?void 0:a.errorCode)||!x&&!e?s!==Oe||429===(null==a?void 0:a.errorCode)||403===(null==a?void 0:a.errorCode)?s===Oe&&429===(null==a?void 0:a.errorCode)&&e?r(rs.error):!e&&!x||!e&&o?r(rs.upsell):(e&&c&&r(rs.generate),!e&&x&&!o&&c&&r(rs.generate)):r(rs.error):r(rs.askConsent)}),[t,E,x,c,b,O,F,g,_,k,S,L]),W=(0,H.useCallback)((async()=>{const{type:e,payload:t}=await _({endpoint:g,isWooProductEntity:S}),s=429===(null==t?void 0:t.errorCode)||t.count>=t.limit,a=U();r(!s||a?e!==Oe?rs.generate:rs.error:rs.upsell)}),[r,g,_,U,S]),B=(0,H.useCallback)((()=>{r(c?rs.generate:rs.askConsent)}),[r,c]);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{type:"button",id:`yst-replacevar__use-ai-button__${o}__${i}`,className:"yst-replacevar__use-ai-button",onClick:q,disabled:m===M||!d},L&&m===M&&(0,e.createElement)(n.Spinner,{className:"yst-me-2"}),(0,D.__)("Use AI","wordpress-seo")),(0,e.createElement)(ss,{...$,isOpen:[rs.askConsent,rs.upsell].includes(s)},s===rs.askConsent&&(0,e.createElement)(jt,{onStartGenerating:W}),s===rs.upsell&&(0,e.createElement)(es,{onActivateFreeSparks:B})),(0,e.createElement)(ts,{...$,isOpen:[rs.error,rs.generate].includes(s),aiModalHelperLink:v,panelRef:A,title:l},s===rs.error&&(0,e.createElement)(n.Modal.Container.Content,{className:"yst-pt-6"},(0,e.createElement)(Gt,{currentSubscriptions:u,isSeoAnalysisActive:b})),s===rs.generate&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(G.UsageCounter,{limit:y,requests:p,isSkeleton:!1,className:"yst-absolute yst-top-[-11px] yst-end-12 sm:yst-end-16",mentionBetaInTooltip:E}),(0,e.createElement)(Xt,{height:N}))))};as.propTypes={onUseAi:V().func.isRequired};const os=({title:t,description:s,status:r,titleForLength:o,showPreviewSkeleton:i,showLengthProgress:l})=>{const c=(0,a.useSelect)((e=>e(K).getSnippetEditorMode()),[]),[d,u]=(0,H.useState)(c),{editType:m}=Ce(),p=Le(),y=(({editType:e,title:t,description:s})=>{const r=(0,a.useSelect)((e=>e(K).getDateFromSettings()),[]),o=(0,a.useSelect)((e=>e(K).getContentLocale()),[]),n=(0,a.useSelect)((e=>e(K).isCornerstoneContent()),[]),i=(0,a.useSelect)((e=>e(K).getIsTerm()),[]);return(0,H.useMemo)((()=>e===ee?(0,Te.getDescriptionProgress)(s,r,n,i,o):(0,Te.getTitleProgress)(t)),[e,t,s,r,n,i,o])})({editType:m,title:o,description:s});return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"yst-mb-2 lg:yst-flex"},(0,e.createElement)(n.Label,{as:"span",className:"yst-flex-grow yst-cursor-default"},(0,D.__)("Google preview","wordpress-seo")),(0,e.createElement)(ds,{mode:d,idSuffix:p,onChange:u,disabled:r===ne.loading})),i?(0,e.createElement)(ls,null):(0,e.createElement)(is,{mode:d,title:t,description:s}),(0,e.createElement)("div",{className:"yst-pt-4"},(0,e.createElement)(n.Label,{as:"span",className:"yst-flex-grow yst-cursor-default"},m===J?(0,D.__)("SEO title width","wordpress-seo"):(0,D.__)("Meta description length","wordpress-seo")),(0,e.createElement)(cs,{className:"yst-mt-2",progress:l?y.actual:0,min:0,max:y.max,score:y.score})))};os.propTypes={title:V().string.isRequired,description:V().string.isRequired,status:V().oneOf(Object.keys(ne)).isRequired,titleForLength:V().string.isRequired,showPreviewSkeleton:V().bool.isRequired,showLengthProgress:V().bool.isRequired};const ns=/mobi/i,is=({mode:t,title:s,description:r})=>{var o,n;const l=(0,a.useSelect)((e=>e(K).getBaseUrlFromSettings()),[]),c=(0,a.useSelect)((e=>e(K).getSnippetEditorData().slug||""),[]),d=(0,a.useSelect)((e=>e(K).getDateFromSettings()),[]),u=(0,a.useSelect)((e=>e(K).getFocusKeyphrase()),[]),m=(0,a.useSelect)((e=>e(K).getSnippetEditorPreviewImageUrl()),[]),p=(0,a.useSelect)((e=>e(K).getSiteIconUrlFromSettings()),[]),y=(0,a.useSelect)((e=>e(K).getShoppingData()),[]),g=(0,a.useSelect)((e=>e(K).getSnippetEditorWordsToHighlight()),[]),h=(0,a.useSelect)((e=>e(K).getSiteName()),[]),f=(0,a.useSelect)((e=>e(K).getContentLocale()),[]),w=(0,H.useMemo)((()=>l+c),[l,c]),E=(0,H.useMemo)((()=>{var e,t;return ns.test(null===(e=window)||void 0===e||null===(t=e.navigator)||void 0===t?void 0:t.userAgent)}),[null===(o=window)||void 0===o||null===(n=o.navigator)||void 0===n?void 0:n.userAgent]);return(0,e.createElement)("div",{className:`yst-bg-slate-200 yst--mx-6 ${t}${E?" yst-user-agent__mobile":""}`},(0,e.createElement)(Te.SnippetPreview,{title:s,description:r,mode:t,url:w,keyword:u,date:d,faviconSrc:p,mobileImageSrc:m,wordsToHighlight:g,siteName:h,locale:f,shoppingData:y,onMouseUp:i.noop}))};is.propTypes={mode:V().oneOf(Object.keys(oe)).isRequired,title:V().string.isRequired,description:V().string.isRequired};const ls=()=>(0,e.createElement)("div",{className:"yst-max-w-[400px] yst-py-4 yst-px-3 yst-border yst-rounded-lg yst-w-full yst-mx-auto"},(0,e.createElement)("div",{className:"yst-flex yst-gap-x-3"},(0,e.createElement)(n.SkeletonLoader,{className:"yst-flex-shrink-0 yst-h-7 yst-w-7 yst-rounded-full"}),(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst-w-full yst-gap-y-1"},(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-2.5 yst-w-10/12"}))),(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-4 yst-w-full yst-mt-6 yst-mb-4"}),(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-3 yst-w-full"}),(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-3 yst-w-10/12 yst-mt-2.5"})),cs=({className:t="",progress:s,max:r,score:a})=>{const o=(0,H.useMemo)((()=>(e=>e>=7?"yst-score-good":e>=5?"yst-score-ok":"yst-score-bad")(a)),[a]);return(0,e.createElement)(n.ProgressBar,{className:Jt()("yst-length-progress-bar",o,t),progress:s,min:0,max:r})};cs.propTypes={className:V().string,progress:V().number.isRequired,max:V().number.isRequired,score:V().number.isRequired};const ds=({idSuffix:t,mode:s,onChange:r,disabled:a})=>{const o=(0,H.useCallback)((({target:e})=>e.checked&&r(e.value)),[r]);return(0,e.createElement)(n.RadioGroup,{id:`yst-ai-mode__${t}`,className:"yst-ai-mode yst-pt-2 lg:yst-pt-0",disabled:a},(0,e.createElement)(n.RadioGroup.Radio,{id:`yst-ai-mode__mobile__${t}`,name:`yst-ai-mode__${t}`,label:(0,D.__)("Mobile result","wordpress-seo"),value:oe.mobile,checked:s===oe.mobile,onChange:o,disabled:a}),(0,e.createElement)(n.RadioGroup.Radio,{id:`yst-ai-mode__desktop__${t}`,name:`yst-ai-mode__${t}`,label:(0,D.__)("Desktop result","wordpress-seo"),value:oe.desktop,checked:s===oe.desktop,onChange:o,disabled:a}))};ds.propTypes={idSuffix:V().string.isRequired,mode:V().oneOf(Object.keys(oe)).isRequired,onChange:V().func.isRequired,disabled:V().bool.isRequired};const us=({title:t,description:s,showPreviewSkeleton:r})=>(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"yst-flex yst-mb-6"},(0,e.createElement)(n.Label,{as:"span",className:"yst-flex-grow yst-cursor-default"},(0,D.__)("Social preview","wordpress-seo"))),r?(0,e.createElement)(cr,null):(0,e.createElement)(lr,{title:t,description:s}));us.propTypes={title:V().string.isRequired,description:V().string.isRequired,showPreviewSkeleton:V().bool.isRequired};const ms=window.yoast.styledComponents;var ps=s.n(ms);const ys=ps().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"}; `,gs=t=>{const{siteUrl:s}=t;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"screen-reader-text"},s),(0,e.createElement)(ys,{"aria-hidden":"true"},(0,e.createElement)("span",null,s)))};gs.propTypes={siteUrl:V().string.isRequired};const hs=gs,fs=window.yoast.socialMetadataForms,ws=window.yoast.styleGuide,Es=ps().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; } `,bs=ps().img` && { height: 100%; position: absolute; width: 100%; object-fit: cover; } `,vs=ps().div` padding-bottom: ${e=>e.aspectRatio}%; `,Ss=({imageProps:t,width:s,height:r,imageMode:a="landscape"})=>"landscape"===a?(0,e.createElement)(vs,{aspectRatio:t.aspectRatio},(0,e.createElement)(bs,{src:t.src,alt:t.alt})):(0,e.createElement)(Es,{src:t.src,alt:t.alt,width:s,height:r,imageProperties:t});function xs(e,t,s){return"landscape"===s?{widthRatio:t.width/e.landscapeWidth,heightRatio:t.height/e.landscapeHeight}:"portrait"===s?{widthRatio:t.width/e.portraitWidth,heightRatio:t.height/e.portraitHeight}:{widthRatio:t.width/e.squareWidth,heightRatio:t.height/e.squareHeight}}function ks(e,t){return t.widthRatio<=t.heightRatio?{width:Math.round(e.width/t.widthRatio),height:Math.round(e.height/t.widthRatio)}:{width:Math.round(e.width/t.heightRatio),height:Math.round(e.height/t.heightRatio)}}async function _s(e,t,s=!1){const r=await function(e){return new Promise(((t,s)=>{const r=new Image;r.onload=()=>{t({width:r.width,height:r.height})},r.onerror=s,r.src=e}))}(e);let a=s?"landscape":"square";"Facebook"===t&&(a=(0,fs.determineFacebookImageMode)(r));const o=function(e){return"Twitter"===e?fs.TWITTER_IMAGE_SIZES:fs.FACEBOOK_IMAGE_SIZES}(t),n=function(e,t,s){return"square"===s&&t.width===t.height?{width:e.squareWidth,height:e.squareHeight}:ks(t,xs(e,t,s))}(o,r,a);return{mode:a,height:n.height,width:n.width}}async function Cs(e,t,s=!1){try{return{imageProperties:await _s(e,t,s),status:"loaded"}}catch(e){return{imageProperties:null,status:"errored"}}}Ss.propTypes={imageProps:V().shape({src:V().string.isRequired,alt:V().string.isRequired,aspectRatio:V().number.isRequired}).isRequired,width:V().number.isRequired,height:V().number.isRequired,imageMode:V().string};const Rs=ps().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: ${ws.colors.$color_white}; `,Ls=ps().div` box-sizing: border-box; max-width: ${fs.FACEBOOK_IMAGE_SIZES.landscapeWidth}px; height: ${fs.FACEBOOK_IMAGE_SIZES.landscapeHeight}px; background-color: ${ws.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 Is extends e.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 Cs(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:fs.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:fs.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:fs.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:fs.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:fs.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:fs.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){const{imageProperties:t,status:s}=this.state;if("loading"===s||""===this.props.src||"errored"===s)return(0,e.createElement)(Ls,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},(0,D.__)("Select image","wordpress-seo"));const r=this.retrieveContainerDimensions(t.mode);return(0,e.createElement)(Rs,{mode:t.mode,dimensions:r,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick},(0,e.createElement)(Ss,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:fs.FACEBOOK_IMAGE_SIZES.aspectRatio},width:t.width,height:t.height,imageMode:t.mode}))}}Is.propTypes={src:V().string,alt:V().string,onImageLoaded:V().func,onImageClick:V().func,onMouseEnter:V().func,onMouseLeave:V().func},Is.defaultProps={src:"",alt:"",onImageLoaded:i.noop,onImageClick:i.noop,onMouseEnter:i.noop,onMouseLeave:i.noop};const Ns=Is,Ps=ps().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; `,Ts=ps().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; } `,As=e=>{switch(e){case"landscape":return"527px";case"square":case"portrait":return"369px";default:return"476px"}},Ms=ps().div` box-sizing: border-box; display: flex; flex-direction: ${e=>"landscape"===e.mode?"column":"row"}; background-color: #f2f3f5; max-width: 527px; `,$s=ps().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 Os extends e.Component{constructor(e){super(e),this.state={imageMode:null,maxLineCount:0,descriptionLineCount:0},this.facebookTitleRef=t().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:t}=this.state,s="landscape"===e?2:5;s!==t&&this.setState({maxLineCount:s})}maybeSetDescriptionLineCount(){const{descriptionLineCount:e,maxLineCount:t,imageMode:s}=this.state,r=this.getTitleLineCount();let a=t-r;"portrait"===s&&(a=5===r?0:4),a!==e&&this.setState({descriptionLineCount:a})}componentDidUpdate(){this.maybeSetMaxLineCount(),this.maybeSetDescriptionLineCount()}render(){const{imageMode:t,maxLineCount:s,descriptionLineCount:r}=this.state;return(0,e.createElement)(Ms,{id:"facebookPreview",mode:t},(0,e.createElement)(Ns,{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,e.createElement)($s,{mode:t},(0,e.createElement)(hs,{siteUrl:this.props.siteUrl,mode:t}),(0,e.createElement)(Ps,{ref:this.facebookTitleRef,onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,lineCount:s},this.props.title),r>0&&(0,e.createElement)(Ts,{maxWidth:As(t),onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,lineCount:r},this.props.description)))}}Os.propTypes={siteUrl:V().string.isRequired,title:V().string.isRequired,description:V().string,imageUrl:V().string,imageFallbackUrl:V().string,alt:V().string,onSelect:V().func,onImageClick:V().func,onMouseHover:V().func},Os.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{}};const Fs=Os,Us=ps().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; `,qs=t=>(0,e.createElement)(Us,null,(0,e.createElement)("span",null,t.siteUrl));qs.propTypes={siteUrl:V().string.isRequired};const Ws=qs,Bs=(e,t=!0)=>e?`\n\t\t\tmax-width: ${fs.TWITTER_IMAGE_SIZES.landscapeWidth}px;\n\t\t\t${t?"border-bottom: 1px solid #E1E8ED;":""}\n\t\t\tborder-radius: 14px 14px 0 0;\n\t\t\t`:`\n\t\twidth: ${fs.TWITTER_IMAGE_SIZES.squareWidth}px;\n\t\t${t?"border-right: 1px solid #E1E8ED;":""}\n\t\tborder-radius: 14px 0 0 14px;\n\t\t`,zs=ps().div` position: relative; box-sizing: content-box; overflow: hidden; background-color: #e1e8ed; flex-shrink: 0; ${e=>Bs(e.isLarge)} `,Hs=ps().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=>Bs(e.isLarge,!1)} `,Ds=ps()(Hs)` ${e=>e.isLarge&&`height: ${fs.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 Gs extends t().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 Cs(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:t,imageProperties:s}=this.state;return"loading"===t||""===this.props.src||"errored"===t?(0,e.createElement)(Ds,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},(0,D.__)("Select image","wordpress-seo")):(0,e.createElement)(zs,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},(0,e.createElement)(Ss,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:fs.TWITTER_IMAGE_SIZES.aspectRatio},width:s.width,height:s.height,imageMode:s.mode}))}}Gs.propTypes={isLarge:V().bool.isRequired,src:V().string,alt:V().string,onImageClick:V().func,onMouseEnter:V().func,onMouseLeave:V().func},Gs.defaultProps={src:"",alt:"",onMouseEnter:i.noop,onImageClick:i.noop,onMouseLeave:i.noop};const js=ps().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; } `,Vs=t=>(0,e.createElement)(js,null,t.children);Vs.propTypes={children:V().array.isRequired};const Ys=Vs,Ks=ps().p` white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; color: rgb(15, 20, 25); cursor: pointer; `,Zs=ps().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: ${fs.TWITTER_IMAGE_SIZES.landscapeWidth}px ) { display: none; } `,Xs=ps().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); } `,Qs=ps()(Xs)` flex-direction: column; max-height: 370px; `,Js=ps()(Xs)` flex-direction: row; height: 125px; `;class er extends e.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:t,imageUrl:s,imageFallbackUrl:r,alt:a,title:o,description:n,siteUrl:i}=this.props,l=t?Qs:Js;return(0,e.createElement)(l,{id:"twitterPreview"},(0,e.createElement)(Gs,{src:s||r,alt:a,isLarge:t,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,e.createElement)(Ys,null,(0,e.createElement)(Ws,{siteUrl:i}),(0,e.createElement)(Ks,{onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle},o),(0,e.createElement)(Zs,{onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription},n)))}}er.propTypes={siteUrl:V().string.isRequired,title:V().string.isRequired,description:V().string,isLarge:V().bool,imageUrl:V().string,imageFallbackUrl:V().string,alt:V().string,onSelect:V().func,onImageClick:V().func,onMouseHover:V().func},er.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{},isLarge:!0};const tr=er,sr=window.yoast.componentsNew,rr=window.yoast.replacementVariableEditor;class ar extends e.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},this.SocialPreview="Social"===e.socialMediumName?Fs:tr,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,t){switch(e){case"title":this.titleEditorRef=t;break;case"description":this.descriptionEditorRef=t}}render(){const{onDescriptionChange:s,onTitleChange:r,onSelectImageClick:a,onRemoveImageClick:o,socialMediumName:n,imageWarnings:i,siteUrl:l,description:c,descriptionInputPlaceholder:d,descriptionPreviewFallback:u,imageUrl:m,imageFallbackUrl:p,alt:y,title:g,titleInputPlaceholder:h,titlePreviewFallback:f,replacementVariables:w,recommendedReplacementVariables:E,applyReplacementVariables:b,onReplacementVariableSearchChange:v,isPremium:S,isLarge:x,socialPreviewLabel:k,idSuffix:_,activeMetaTabId:C}=this.props,R=b({title:g||f,description:c||u});return(0,e.createElement)(t().Fragment,null,k&&(0,e.createElement)(sr.SimulatedLabel,null,k),(0,e.createElement)(this.SocialPreview,{onMouseHover:this.setHoveredField,onSelect:this.setActiveField,onImageClick:a,siteUrl:l,title:R.title,description:R.description,imageUrl:m,imageFallbackUrl:p,alt:y,isLarge:x,activeMetaTabId:C}),(0,e.createElement)(fs.SocialMetadataPreviewForm,{onDescriptionChange:s,socialMediumName:n,title:g,titleInputPlaceholder:h,onRemoveImageClick:o,imageSelected:!!m,imageUrl:m,imageFallbackUrl:p,onTitleChange:r,onSelectImageClick:a,description:c,descriptionInputPlaceholder:d,imageWarnings:i,replacementVariables:w,recommendedReplacementVariables:E,onReplacementVariableSearchChange:v,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:S,setEditorRef:this.setEditorRef,idSuffix:_}))}}ar.propTypes={title:V().string.isRequired,onTitleChange:V().func.isRequired,description:V().string.isRequired,onDescriptionChange:V().func.isRequired,imageUrl:V().string.isRequired,imageFallbackUrl:V().string.isRequired,onSelectImageClick:V().func.isRequired,onRemoveImageClick:V().func.isRequired,socialMediumName:V().string.isRequired,alt:V().string,isPremium:V().bool,imageWarnings:V().array,isLarge:V().bool,siteUrl:V().string,descriptionInputPlaceholder:V().string,titleInputPlaceholder:V().string,descriptionPreviewFallback:V().string,titlePreviewFallback:V().string,replacementVariables:rr.replacementVariablesShape,recommendedReplacementVariables:rr.recommendedReplacementVariablesShape,applyReplacementVariables:V().func,onReplacementVariableSearchChange:V().func,socialPreviewLabel:V().string,idSuffix:V().string,activeMetaTabId:V().string},ar.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",titleInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",alt:"",applyReplacementVariables:e=>e,onReplacementVariableSearchChange:null,socialPreviewLabel:"",idSuffix:"",activeMetaTabId:""};const or={},nr=(e,t,{log:s=console.warn}={})=>{or[e]||(or[e]=!0,s(t))},ir=(e,t=i.noop)=>{const s={};for(const r in e)Object.hasOwn(e,r)&&Object.defineProperty(s,r,{set:s=>{e[r]=s,t("set",r,s)},get:()=>(t("get",r),e[r])});return s};ir({squareWidth:125,squareHeight:125,landscapeWidth:506,landscapeHeight:265,aspectRatio:50.2},((e,t)=>nr(`@yoast/social-metadata-previews/TWITTER_IMAGE_SIZES/${e}/${t}`,`[@yoast/social-metadata-previews] "TWITTER_IMAGE_SIZES.${t}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`))),ir({squareWidth:158,squareHeight:158,landscapeWidth:527,landscapeHeight:273,portraitWidth:158,portraitHeight:237,aspectRatio:52.2,largeThreshold:{width:446,height:233}},((e,t)=>nr(`@yoast/social-metadata-previews/FACEBOOK_IMAGE_SIZES/${e}/${t}`,`[@yoast/social-metadata-previews] "FACEBOOK_IMAGE_SIZES.${t}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`)));const lr=({title:t,description:s})=>{const r=(0,a.useSelect)((e=>e(K).getSiteUrl()),[]),o=(0,a.useSelect)((e=>e(K).getFacebookImageUrl()),[]),n=(0,a.useSelect)((e=>e(K).getEditorDataImageFallback()),[]),l=(0,a.useSelect)((e=>e(K).getFacebookAltText()),[]);return(0,e.createElement)("div",{className:"yst-bg-slate-200 yst-p-2 yst--mx-6 yst-mx-auto"},(0,e.createElement)(Fs,{title:t,description:s,siteUrl:r,imageUrl:o,imageFallbackUrl:n,alt:l,onSelect:i.noop,onImageClick:i.noop,onMouseHover:i.noop}))};lr.propTypes={title:V().string.isRequired,description:V().string.isRequired};const cr=()=>(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst-w-[527px] yst-border yst-mx-auto"},(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-[273px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,e.createElement)("div",{className:"yst-w-full yst-p-4 yst-space-y-1"},(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-3 yst-w-full"}))),dr=({children:t,onRetry:s})=>{const{onClose:r}=(0,n.useModalContext)();return(0,e.createElement)(H.Fragment,null,t,(0,e.createElement)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end"},(0,e.createElement)(n.Button,{variant:"secondary",onClick:r},(0,D.__)("Close","wordpress-seo")),(0,e.createElement)(n.Button,{variant:"primary",onClick:s},(0,D.__)("Try again","wordpress-seo"))))};dr.propTypes={children:V().node.isRequired,onRetry:V().func.isRequired};const ur=({errorCode:t,errorIdentifier:s,invalidSubscriptions:r=[],showActions:a=!1,onRetry:o=i.noop,errorMessage:n=""})=>{switch(t){case 400:switch(s){case"AI_CONTENT_FILTER":return(0,e.createElement)(Wt,null);case"NOT_ENOUGH_CONTENT":return(0,e.createElement)($t,null);case"SITE_UNREACHABLE":return(0,e.createElement)(Ht,null);case"WP_HTTP_REQUEST_ERROR":return a?(0,e.createElement)(dr,{onRetry:o},(0,e.createElement)(Bt,{errorMessage:n})):(0,e.createElement)(Bt,{errorMessage:n});default:return a?(0,e.createElement)(dr,{onRetry:o},(0,e.createElement)(Mt,null)):(0,e.createElement)(Mt,null)}case 402:return(0,e.createElement)(Ut,{invalidSubscriptions:r});case 408:return a?(0,e.createElement)(dr,{onRetry:o},(0,e.createElement)(qt,null)):(0,e.createElement)(qt,null);case 429:return(0,e.createElement)(Ft,null);case 410:return(0,e.createElement)(zt,null);default:return a?(0,e.createElement)(dr,{onRetry:o},(0,e.createElement)(Mt,null)):(0,e.createElement)(Mt,null)}};ur.propTypes={errorCode:V().number.isRequired,errorIdentifier:V().string.isRequired,invalidSubscriptions:V().array,showActions:V().bool,onRetry:V().func,errorMessage:V().string};const mr=V().shape({value:V().string.isRequired,label:V().node.isRequired}),pr=({id:t,name:s,suggestion:r,isChecked:a,onChange:o})=>{const n=(0,H.useCallback)((()=>o(r.value)),[r,o]);return(0,e.createElement)("label",{htmlFor:t,className:Jt()("yst-flex yst-p-4 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",a&&"yst-z-10 yst-border-primary-500")},(0,e.createElement)("input",{type:"radio",id:t,name:s,className:"yst-radio__input",value:r.value,checked:a,onChange:n}),(0,e.createElement)("div",{className:Jt()("yst-label yst-radio__label yst-flex yst-flex-wrap yst-items-center",!a&&"yst-text-slate-600")},r.label))};pr.propTypes={id:V().string.isRequired,name:V().string.isRequired,suggestion:mr.isRequired,isChecked:V().bool.isRequired,onChange:V().func.isRequired};const yr=({idSuffix:t,suggestions:s,selected:r,onChange:a})=>(0,e.createElement)("div",null,(0,e.createElement)(n.RadioGroup,{className:"yst-suggestions-radio-group yst-flex yst-flex-col",id:`yst-ai-suggestions-radio-group__${t}`},s.map(((s,o)=>(0,e.createElement)(pr,{key:`yst-ai-suggestions-radio-${t}__${o}`,id:`yst-ai-suggestions-radio-${t}__${o}`,name:`ai-suggestion__${t}`,isChecked:s.value===r,onChange:a,suggestion:s})))));yr.propTypes={idSuffix:V().string.isRequired,suggestions:V().arrayOf(mr).isRequired,selected:V().string.isRequired,onChange:V().func.isRequired};const gr=[["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"]],hr=({suggestionClassNames:t=gr})=>(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst--space-y-[1px]"},t.map(((t,s)=>(0,e.createElement)("div",{key:`yst-ai-suggestion-radio-skeleton__${s}`,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"},(0,e.createElement)("input",{type:"radio",disabled:!0,className:"yst-my-0.5"}),(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst-w-full"},t.map(((t,r)=>(0,e.createElement)(n.SkeletonLoader,{key:`yst-ai-suggestion-radio-skeleton-${s}__${r}`,className:t}))))))));hr.propTypes={suggestionClassNames:V().arrayOf(V().arrayOf(V().string))};const fr="ai_generator_tip_notification",wr=()=>{const t=(0,a.useSelect)((e=>e(K).isAlertDismissed(fr)),[]),s=(0,a.useSelect)((e=>e(K).getEditorDataContent()),[]),r=(0,a.useSelect)((e=>e(K).getIsWooProductEntity()),[]),[o,,,i]=(0,n.useToggleState)(!1),{editType:l,contentType:c}=Ce(),{dismissAlert:d}=(0,a.useDispatch)(K),u=(0,H.useCallback)((()=>{d(fr)}),[d]),m=(0,H.useMemo)((()=>l===ee?(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. */),[l]),p=(0,H.useMemo)((()=>((e,t)=>e||t===se?150:300)(r,c)),[c,r]);return t||o||s.length>p?null:(0,e.createElement)(n.Notifications.Notification,{id:"ai-generator-content-tip",variant:"info",dismissScreenReaderLabel:(0,D.__)("Dismiss","wordpress-seo")},me((0,D.sprintf)(m,"<span>","</span>"),{span:(0,e.createElement)("span",{className:"yst-font-medium yst-text-slate-800"})}),(0,e.createElement)("div",{className:"yst-flex yst-mt-3 yst--ms-3 yst-gap-1"},(0,e.createElement)(n.Button,{type:"button",variant:"tertiary",onClick:u},(0,D.__)("Don’t show again","wordpress-seo")),(0,e.createElement)(n.Button,{type:"button",variant:"tertiary",className:"yst-text-slate-800",onClick:i},(0,D.__)("Dismiss","wordpress-seo"))))},Er=({title:t,description:s,showPreviewSkeleton:r})=>(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"yst-flex yst-mb-6"},(0,e.createElement)(n.Label,{as:"span",className:"yst-flex-grow yst-cursor-default"},(0,D.__)("X preview","wordpress-seo"))),r?(0,e.createElement)(vr,null):(0,e.createElement)(br,{title:t,description:s}));Er.propTypes={title:V().string.isRequired,description:V().string.isRequired,showPreviewSkeleton:V().bool.isRequired};const br=({title:t,description:s})=>{const r=(0,a.useSelect)((e=>e(K).getSiteUrl()),[]),o=(0,a.useSelect)((e=>e(K).getTwitterImageUrl()),[]),n=(0,a.useSelect)((e=>e(K).getFacebookImageUrl()),[]),l=(0,a.useSelect)((e=>e(K).getEditorDataImageFallback()),[]),c=(0,a.useSelect)((e=>e(K).getTwitterImageType()),[]),d=(0,a.useSelect)((e=>e(K).getTwitterAltText()),[]);return(0,e.createElement)("div",{className:"yst-bg-slate-200 yst-p-2 yst--mx-6"},(0,e.createElement)(tr,{title:t,description:s,siteUrl:r,imageUrl:o,imageFallbackUrl:n||l,isLarge:"summary"!==c,alt:d,onSelect:i.noop,onImageClick:i.noop,onMouseHover:i.noop}))};br.propTypes={title:V().string.isRequired,description:V().string.isRequired};const vr=()=>(0,e.createElement)("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"},(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-[265px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,e.createElement)("div",{className:"yst-w-full yst-p-4 yst-space-y-1"},(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,e.createElement)(n.SkeletonLoader,{className:"yst-h-3 yst-w-full"}))),Sr="yst-mt-1 yst-mb-3",xr="yst-flex yst-justify-end yst--me-8 yst-gap-3 yst--ms-2",kr=({onClose:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",{className:Sr},(0,D.__)("As long as this is a beta feature, you get unlimited sparks.","wordpress-seo")),(0,e.createElement)("div",{className:xr},(0,e.createElement)(n.Button,{type:"button",variant:"primary",size:"small",onClick:t},(0,D.__)("Got it!","wordpress-seo")))),_r=({onClose:t,upsellLink:s,isWooProductEntity:r=!1,ctbId:a="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const o=(0,n.useSvgAria)();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",{className:Sr},(0,D.sprintf)(/* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ (0,D.__)("Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),r?"Yoast WooCommerce SEO":"Yoast SEO Premium")),(0,e.createElement)("div",{className:xr},(0,e.createElement)(n.Button,{type:"button",variant:"tertiary",size:"small",onClick:t},(0,D.__)("Close","wordpress-seo")),(0,e.createElement)(n.Button,{as:"a",size:"small",variant:"upsell",href:s,target:"_blank",rel:"noopener noreferrer","data-action":"load-nfd-ctb","data-ctb-id":a},(0,e.createElement)(De,{className:"yst-w-4 yst-h-4 yst--ms-1 yst-me-2 yst-shrink-0",...o}),(0,D.sprintf)(/* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ (0,D.__)("Unlock with %1$s","wordpress-seo"),r?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,e.createElement)("span",{className:"yst-sr-only"},/* translators: Hidden accessibility text. */ (0,D.__)("(Opens in a new browser tab)","wordpress-seo")))))},Cr=({className:t=""})=>{const{isUsageCountLimitReached:s,usageCount:r,usageCountLimit:o,premiumUpsellLink:i,wooUpsellLink:l,isWooProductEntity:c,hasValidPremiumSubscription:d,hasValidWooSubscription:u}=(0,a.useSelect)((e=>{const t=e(Y),s=e(K);return{isUsageCountLimitReached:t.isUsageCountLimitReached(),usageCount:t.selectUsageCount(),usageCountLimit:t.selectUsageCountLimit(),premiumUpsellLink:s.selectLink("https://yoa.st/ai-toast-out-of-free-sparks"),wooUpsellLink:s.selectLink("https://yoa.st/ai-toast-out-of-free-sparks-woo"),isWooProductEntity:s.getIsWooProductEntity(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription()}}),[]),m=(0,H.useMemo)((()=>d&&!c||c&&u&&d),[d,c,u]),[p,,y,,g]=(0,n.useToggleState)(r===o);(0,H.useEffect)((()=>{y(m&&r===o||!m&&s)}),[r,o,m,s]);const h=(0,H.useMemo)((()=>c?l:i),[c,l,i]),f=(0,H.useMemo)((()=>c&&!u),[c,u]);return p&&(0,e.createElement)(n.Notifications.Notification,{id:"ai-sparks-limit",className:t,variant:"info",dismissScreenReaderLabel:(0,D.__)("Close","wordpress-seo"),title:m?(0,D.sprintf)(/* 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.",o,"wordpress-seo"),o):(0,D.__)("You're out of free sparks!","wordpress-seo"),size:m?"default":"large"},m?(0,e.createElement)(kr,{onClose:g}):(0,e.createElement)(_r,{onClose:g,upsellLink:h,isWooUpsell:f}))},Rr=()=>{const{setPromptContent:e}=(0,a.dispatch)(Y);return()=>{(e=>{const t=(0,a.select)(K).getIsProduct(),s=(0,a.select)(K).getIsTerm(),r=(0,a.select)(K).getIsWooCommerceActive(),o=t&&r||s?150:300,n=(0,i.get)(window,"YoastSEO.analysis.worker.runResearch",i.noop),l=(0,i.get)(window,"YoastSEO.analysis.collectData",!1);n("getParagraphs",l?de.Paper.parse(l()):null).then((t=>{let s="";if(t.result){const e=t.result;if(e){let t=0;e.forEach((e=>{e.sentences.forEach((e=>{if(t+=e.tokens.length,t>o)return s;s+=e.text.replace(/[\n\r]+/g," ")})),s+=" ",t+=1}))}}e(s.trimEnd()||".")}))})(e)}},Lr=()=>{Rr(),(0,a.subscribe)((0,i.debounce)((()=>{const{getEditorDataContent:e}=(0,a.select)(K),t=Rr();return setTimeout(t,1500),((e,t)=>{let s=e();return()=>{const r=e();(0,i.isEqual)(r,s)||(s=r,t((0,i.clone)(r)))}})(e,t)})(),1500,{maxWait:3e3}))};let Ir=!1;const Nr=()=>{Ir||(Ir=!0)},Pr=(e,t)=>Ir?(be(t)&&e.push((0,D.__)("Please enter a valid focus keyphrase.","wordpress-seo")),e):e,Tr="appliedSuggestions",Ar=(0,l.createSlice)({name:Tr,initialState:{},reducers:{addAppliedSuggestion:(e,{payload:{editType:t,previewType:s,suggestion:r}})=>{e[s]={...e[s],[t]:r}}}}),Mr=Ar.getInitialState,$r={selectAppliedSuggestions:e=>(0,i.get)(e,Tr,{})};$r.selectAppliedSuggestionFor=(0,l.createSelector)([$r.selectAppliedSuggestions,(e,t)=>t],((e,{editType:t,previewType:s})=>(0,i.get)(e,[s,t],"")));const Or=Ar.actions,Fr=Ar.reducer,Ur="productSubscriptions",qr=(0,l.createSlice)({name:Ur,initialState:{premiumSubscription:!1,wooCommerceSubscription:!1},reducers:{}}),Wr=qr.getInitialState,Br={selectProductSubscriptions:e=>(0,i.get)(e,Ur,Wr()),selectPremiumSubscription:e=>(0,i.get)(e,`${Ur}.premiumSubscription`),selectWooCommerceSubscription:e=>(0,i.get)(e,`${Ur}.wooCommerceSubscription`)},zr=qr.actions,Hr=qr.reducer,Dr="promptContent",Gr=(0,l.createSlice)({name:Dr,initialState:{content:"",initialized:!1},reducers:{setPromptContent:(e,{payload:t})=>({content:t,initialized:!0})}}),jr=Gr.getInitialState,Vr={selectPromptContent:e=>(0,i.get)(e,`${Dr}.content`,""),selectPromptContentInitialized:e=>(0,i.get)(e,`${Dr}.initialized`,!1)},Yr=Gr.actions,Kr=Gr.reducer,Zr="freeSparks",Xr="activateFreeSparks",Qr=(0,l.createSlice)({name:Zr,initialState:{isFreeSparksActive:!1,endpoint:"yoast/v1/ai/free_sparks"},extraReducers:e=>{e.addCase(`${Xr}/${P}`,(e=>{e.isFreeSparksActive=!0}))}}),Jr=Qr.getInitialState,ea={selectFreeSparksActiveEndpoint:e=>(0,i.get)(e,[Zr,"endpoint"],Qr.getInitialState().endpoint),selectIsFreeSparksActive:e=>(0,i.get)(e,[Zr,"isFreeSparksActive"],Qr.getInitialState().isFreeSparksActive)},ta={...Qr.actions,activateFreeSparks:function*({endpoint:e}){try{yield{type:Xr,payload:e}}catch(e){console.error("Error starting free sparks:",e)}return{type:`${Xr}/${P}`}}},sa={[Xr]:async({payload:e})=>p()({method:"POST",path:e})},ra=Qr.reducer,aa=window.wp.domReady,oa=(t,{fieldId:s,type:o})=>{const i=(0,a.select)(K).getPostType(),l=function(e){return e.startsWith("yoast-google-preview")?Z:e.startsWith("social")?X:e.startsWith("x-")?Q:void 0}(s);if(!l)return t;const c={isRtl:(0,a.select)(K).getPreference("isRtl")},d={editType:o,previewType:l,postType:i,contentType:(0,a.select)(K).getIsTerm()?"term":"post"};return t.push((0,e.createElement)(r.Fill,{name:`yoast.replacementVariableEditor.additionalButtons.${s}`},(0,e.createElement)(n.Root,{context:c},(0,e.createElement)(_e,{value:d},(0,e.createElement)(as,{onUseAi:Nr}))))),t};s.n(aa)()((()=>{window.wpseoScriptData.postType&&(((e={})=>{(0,a.register)((e=>(0,a.createReduxStore)(Y,{actions:{...E,...Or,...zr,...Yr,...Be,...ta},selectors:{...w,...$r,...Br,...Vr,...We,...ea},initialState:(0,i.merge)({},{[y]:f(),[Tr]:Mr(),[Ur]:Wr(),[Dr]:jr(),[Ae]:qe(),[Zr]:Jr()},e),reducer:(0,a.combineReducers)({[y]:v,[Tr]:Fr,[Ur]:Hr,[Dr]:Kr,[Ae]:He,[Zr]:ra}),controls:{...b,...ze,...sa}}))(e))})({[y]:{hasConsent:"1"===(0,i.get)(window,"wpseoAiGenerator.hasConsent",!1),endpoint:"yoast/v1/ai_generator/consent"},[Ae]:{endpoint:"yoast/v1/ai_generator/get_usage"},[Ur]:(0,i.get)(window,"wpseoAiGenerator.productSubscriptions",{}),[Zr]:{isFreeSparksActive:"1"===(0,i.get)(window,"wpseoAiGenerator.isFreeSparks",!1),endpoint:"yoast/v1/ai/free_sparks"}}),window.jQuery(window).on("YoastSEO:ready",(()=>{Lr()})),(0,o.addFilter)("yoast.replacementVariableEditor.additionalButtons","yoast/yoast-seo/AiGenerator",oa),(0,o.addFilter)("yoast.focusKeyphrase.errors","yoast/yoast-seo/AiGenerator",Pr),(0,o.addAction)("yoast.elementor.loaded","yoast/yoast-seo/AiGenerator",Lr))}))})()})();