(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{DISMISS_ALERT:()=>A,NEW_REQUEST:()=>D,SNIPPET_EDITOR_FIND_CUSTOM_FIELDS:()=>M,wistiaEmbedPermission:()=>I});const s=window.wp.domReady;var i=e.n(s);const o=window.jQuery;var n=e.n(o);const a=window.lodash,r=window.wp.i18n;const c=window.wp.data,l=window.yoast.externals.redux,d=window.yoast.reduxJsToolkit,p="adminUrl",u=(0,d.createSlice)({name:p,initialState:"",reducers:{setAdminUrl:(e,{payload:t})=>t}}),h=(u.getInitialState,{selectAdminUrl:e=>(0,a.get)(e,p,"")});h.selectAdminLink=(0,d.createSelector)([h.selectAdminUrl,(e,t)=>t],(e,t="")=>{try{return new URL(t,e).href}catch(t){return e}}),u.actions,u.reducer;const g=window.wp.apiFetch;var w=e.n(g);const f="hasConsent",y=(0,d.createSlice)({name:f,initialState:{hasConsent:!1,endpoint:""},reducers:{giveAiGeneratorConsent:(e,{payload:t})=>{e.hasConsent=t},setAiGeneratorConsentEndpoint:(e,{payload:t})=>{e.endpoint=t}}}),m=(y.getInitialState,y.actions,y.reducer,window.wp.url),b="linkParams",_=(0,d.createSlice)({name:b,initialState:{},reducers:{setLinkParams:(e,{payload:t})=>t}}),S=(_.getInitialState,{selectLinkParam:(e,t,s={})=>(0,a.get)(e,`${b}.${t}`,s),selectLinkParams:e=>(0,a.get)(e,b,{})});S.selectLink=(0,d.createSelector)([S.selectLinkParams,(e,t)=>t,(e,t,s={})=>s],(e,t,s)=>(0,m.addQueryArgs)(t,{...e,...s})),_.actions,_.reducer;const v=(0,d.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:i,description:o})=>({payload:{id:e||(0,d.nanoid)(),variant:t,size:s,title:i||"",description:o}})},removeNotification:(e,{payload:t})=>(0,a.omit)(e,t)}}),k=(v.getInitialState,v.actions,v.reducer,"pluginUrl"),E=(0,d.createSlice)({name:k,initialState:"",reducers:{setPluginUrl:(e,{payload:t})=>t}}),x=(E.getInitialState,{selectPluginUrl:e=>(0,a.get)(e,k,"")});x.selectImageLink=(0,d.createSelector)([x.selectPluginUrl,(e,t,s="images")=>s,(e,t)=>t],(e,t,s)=>[(0,a.trimEnd)(e,"/"),(0,a.trim)(t,"/"),(0,a.trimStart)(s,"/")].join("/")),E.actions,E.reducer;const R="wistiaEmbedPermission",O=(0,d.createSlice)({name:R,initialState:{value:!1,status:"idle",error:{}},reducers:{setWistiaEmbedPermissionValue:(e,{payload:t})=>{e.value=Boolean(t)}},extraReducers:e=>{e.addCase(`${R}/request`,e=>{e.status="loading"}),e.addCase(`${R}/success`,(e,{payload:t})=>{e.status="success",e.value=Boolean(t&&t.value)}),e.addCase(`${R}/error`,(e,{payload:t})=>{e.status="error",e.value=Boolean(t&&t.value),e.error={code:(0,a.get)(t,"error.code",500),message:(0,a.get)(t,"error.message","Unknown")}})}}),T=(O.getInitialState,O.actions,{[R]:async({payload:e})=>w()({path:"/yoast/v1/wistia_embed_permission",method:"POST",data:{value:Boolean(e)}})});var P;O.reducer;const C=(0,d.createSlice)({name:"documentTitle",initialState:(0,a.defaultTo)(null===(P=document)||void 0===P?void 0:P.title,""),reducers:{setDocumentTitle:(e,{payload:t})=>t}});function A({alertKey:e}){return new Promise(t=>wpseoApi.post("alerts/dismiss",{key:e},()=>t()))}function M({query:e,postId:t}){return new Promise(s=>{wpseoApi.get("meta/search",{query:e,post_id:t},e=>{s(e.meta)})})}C.getInitialState,C.actions,C.reducer;const D=async({countryCode:e,keyphrase:t})=>(w()({path:"yoast/v1/semrush/country_code",method:"POST",data:{country_code:e}}),w()({path:(0,m.addQueryArgs)("/yoast/v1/semrush/related_keyphrases",{keyphrase:t,country_code:e})})),I=T[R];function F(){return window.wpseoScriptData&&"1"===window.wpseoScriptData.isBlockEditor}const B=window.yoast.analysis,U=window.wp.isShallowEqual,Y="yoastmark";function L(e,t){return e._properties.position.startOffset>t.length||e._properties.position.endOffset>t.length}function j(e,t,s){const i=e.dom;let o=e.getContent();if(o=B.markers.removeMarks(o),(0,a.isEmpty)(s))return void e.setContent(o);o=s[0].hasPosition()?function(e,t){if(!t)return"";for(let s=(e=(0,a.orderBy)(e,e=>e._properties.position.startOffset,["asc"])).length-1;s>=0;s--){const i=e[s];L(i,t)||(t=i.applyWithPosition(t))}return t}(s,o):function(e,t,s,i){const{fieldsToMark:o,selectedHTML:n}=B.languageProcessing.getFieldsToMark(s,i);return(0,a.forEach)(s,function(t){"acf_content"!==e.id&&(t._properties.marked=B.languageProcessing.normalizeHTML(t._properties.marked),t._properties.original=B.languageProcessing.normalizeHTML(t._properties.original)),o.length>0?n.forEach(e=>{const s=t.applyWithReplace(e);i=i.replace(e,s)}):i=t.applyWithReplace(i)}),i}(e,0,s,o),e.setContent(o),function(e){let t=e.getContent();t=t.replace(new RegExp("<yoastmark.+?>","g"),"").replace(new RegExp("</yoastmark>","g"),""),e.setContent(t)}(e);const n=i.select(Y);(0,a.forEach)(n,function(e){e.setAttribute("data-mce-bogus","1")})}function N(e){return window.test=e,j.bind(null,e)}const K="et_pb_main_editor_wrap",q=class{static isActive(){return!!document.getElementById(K)}static isTinyMCEHidden(){const e=document.getElementById(K);return!!e&&e.classList.contains("et_pb_hidden")}listen(e){this.classicEditorContainer=document.getElementById(K),this.classicEditorContainer&&new MutationObserver(t=>{(0,a.forEach)(t,t=>{"attributes"===t.type&&"class"===t.attributeName&&(t.target.classList.contains("et_pb_hidden")?e.classicEditorHidden():e.classicEditorShown())})}).observe(this.classicEditorContainer,{attributes:!0})}},Q=class{static isActive(){return!!window.VCV_I18N}},V={classicEditorHidden:a.noop,classicEditorShown:a.noop,pageBuilderLoaded:a.noop},W=class{constructor(){this.determineActivePageBuilders()}determineActivePageBuilders(){q.isActive()&&(this.diviActive=!0),Q.isActive()&&(this.vcActive=!0)}isPageBuilderActive(){return this.diviActive||this.vcActive}listen(e){this.callbacks=(0,a.defaults)(e,V),this.diviActive&&(new q).listen(e)}isClassicEditorHidden(){return!(!this.diviActive||!q.isTinyMCEHidden())}};let z;const H="content",$="description";function G(e){if("undefined"==typeof tinyMCE||void 0===tinyMCE.editors||0===tinyMCE.editors.length)return!1;const t=tinyMCE.get(e);return null!==t&&!t.isHidden()}function J(e,t,s){"undefined"!=typeof tinyMCE&&"function"==typeof tinyMCE.on&&tinyMCE.on("addEditor",function(i){const o=i.editor;o.id===e&&(0,a.forEach)(t,function(e){o.on(e,s)})})}function X(){(0,a.isUndefined)(z)||z.dispatch(l.actions.setMarkerStatus("disabled"))}function Z(){(0,a.isUndefined)(z)||z.dispatch(l.actions.setMarkerStatus("enabled"))}class ee{constructor(e){this.refresh=e,this.loaded=!1,this.preloadThreshold=3e3,this.plugins={},this.modifications={},this._registerPlugin=this._registerPlugin.bind(this),this._ready=this._ready.bind(this),this._reloaded=this._reloaded.bind(this),this._registerModification=this._registerModification.bind(this),this._registerAssessment=this._registerAssessment.bind(this),this._applyModifications=this._applyModifications.bind(this),setTimeout(this._pollLoadingPlugins.bind(this),1500)}_registerPlugin(e,t){return(0,a.isString)(e)?(0,a.isUndefined)(t)||(0,a.isObject)(t)?!1===this._validateUniqueness(e)?(console.error("Failed to register plugin. Plugin with name "+e+" already exists"),!1):(this.plugins[e]=t,!0):(console.error("Failed to register plugin "+e+". Expected parameters `options` to be a object."),!1):(console.error("Failed to register plugin. Expected parameter `pluginName` to be a string."),!1)}_ready(e){return(0,a.isString)(e)?(0,a.isUndefined)(this.plugins[e])?(console.error("Failed to modify status for plugin "+e+". The plugin was not properly registered."),!1):(this.plugins[e].status="ready",!0):(console.error("Failed to modify status for plugin "+e+". Expected parameter `pluginName` to be a string."),!1)}_reloaded(e){return(0,a.isString)(e)?(0,a.isUndefined)(this.plugins[e])?(console.error("Failed to reload Content Analysis for plugin "+e+". The plugin was not properly registered."),!1):(this.refresh(),!0):(console.error("Failed to reload Content Analysis for "+e+". Expected parameter `pluginName` to be a string."),!1)}_registerModification(e,t,s,i){if(!(0,a.isString)(e))return console.error("Failed to register modification for plugin "+s+". Expected parameter `modification` to be a string."),!1;if(!(0,a.isFunction)(t))return console.error("Failed to register modification for plugin "+s+". Expected parameter `callable` to be a function."),!1;if(!(0,a.isString)(s))return console.error("Failed to register modification for plugin "+s+". Expected parameter `pluginName` to be a string."),!1;if(!1===this._validateOrigin(s))return console.error("Failed to register modification for plugin "+s+". The integration has not finished loading yet."),!1;const o={callable:t,origin:s,priority:(0,a.isNumber)(i)?i:10};return(0,a.isUndefined)(this.modifications[e])&&(this.modifications[e]=[]),this.modifications[e].push(o),!0}_registerAssessment(e,t,s,i){return(0,a.isString)(t)?(0,a.isObject)(s)?(0,a.isString)(i)?(t=i+"-"+t,e.addAssessment(t,s),!0):(console.error("Failed to register assessment for plugin "+i+". Expected parameter `pluginName` to be a string."),!1):(console.error("Failed to register assessment for plugin "+i+". Expected parameter `assessment` to be a function."),!1):(console.error("Failed to register test for plugin "+i+". Expected parameter `name` to be a string."),!1)}_applyModifications(e,t,s){let i=this.modifications[e];return!(0,a.isArray)(i)||i.length<1||(i=this._stripIllegalModifications(i),i.sort((e,t)=>e.priority-t.priority),(0,a.forEach)(i,function(i){const o=i.callable(t,s);typeof o==typeof t?t=o:console.error("Modification with name "+e+" performed by plugin with name "+i.origin+" was ignored because the data that was returned by it was of a different type than the data we had passed it.")})),t}_pollLoadingPlugins(e){e=(0,a.isUndefined)(e)?0:e,!0===this._allReady()?(this.loaded=!0,this.refresh()):e>=this.preloadThreshold?(this._pollTimeExceeded(),this.loaded=!0,this.refresh()):(e+=50,setTimeout(this._pollLoadingPlugins.bind(this,e),50))}_allReady(){return(0,a.reduce)(this.plugins,function(e,t){return e&&"ready"===t.status},!0)}_pollTimeExceeded(){(0,a.forEach)(this.plugins,function(e,t){(0,a.isUndefined)(e.options)||"ready"===e.options.status||(console.error("Error: Plugin "+t+". did not finish loading in time."),delete this.plugins[t])})}_stripIllegalModifications(e){return(0,a.forEach)(e,(t,s)=>{!1===this._validateOrigin(t.origin)&&delete e[s]}),e}_validateOrigin(e){return"ready"===this.plugins[e].status}_validateUniqueness(e){return(0,a.isUndefined)(this.plugins[e])}}function te(e,t,s){e("morphology",new B.Paper("",{keyword:s})).then(e=>{const s=e.result.keyphraseForms;t.dispatch(l.actions.updateWordsToHighlight((0,a.uniq)((0,a.flatten)(s))))}).catch(()=>{t.dispatch(l.actions.updateWordsToHighlight([]))})}const se=window.wp.api;var ie={source:"wpseoScriptData.analysis.plugins.replaceVars",scope:[],aliases:[]},oe=function(e,t,s){this.placeholder=e,this.replacement=t,this.options=(0,a.defaults)(s,ie)};oe.prototype.getPlaceholder=function(e){return(e=e||!1)&&this.hasAlias()?this.placeholder+"|"+this.getAliases().join("|"):this.placeholder},oe.prototype.setSource=function(e){this.options.source=e},oe.prototype.hasScope=function(){return!(0,a.isEmpty)(this.options.scope)},oe.prototype.addScope=function(e){this.hasScope()||(this.options.scope=[]),this.options.scope.push(e)},oe.prototype.inScope=function(e){return!this.hasScope()||(0,a.indexOf)(this.options.scope,e)>-1},oe.prototype.hasAlias=function(){return!(0,a.isEmpty)(this.options.aliases)},oe.prototype.addAlias=function(e){this.hasAlias()||(this.options.aliases=[]),this.options.aliases.push(e)},oe.prototype.getAliases=function(){return this.options.aliases};const ne=oe,{removeReplacementVariable:ae,updateReplacementVariable:re,refreshSnippetEditor:ce}=l.actions;var le=["content","title","snippet_title","snippet_meta","primary_category","data_page_title","data_meta_desc","excerpt"],de={},pe={},ue=function(e,t){this._app=e,this._app.registerPlugin("replaceVariablePlugin",{status:"ready"}),this._store=t,this.replaceVariables=this.replaceVariables.bind(this),this.registerReplacements(),this.registerModifications(),this.registerEvents(),this.subscribeToGutenberg()};ue.prototype.registerReplacements=function(){this.addReplacement(new ne("%%author_first_name%%","author_first_name")),this.addReplacement(new ne("%%author_last_name%%","author_last_name")),this.addReplacement(new ne("%%category%%","category")),this.addReplacement(new ne("%%category_title%%","category_title")),this.addReplacement(new ne("%%currentdate%%","currentdate")),this.addReplacement(new ne("%%currentday%%","currentday")),this.addReplacement(new ne("%%currentmonth%%","currentmonth")),this.addReplacement(new ne("%%currenttime%%","currenttime")),this.addReplacement(new ne("%%currentyear%%","currentyear")),this.addReplacement(new ne("%%date%%","date")),this.addReplacement(new ne("%%id%%","id")),this.addReplacement(new ne("%%page%%","page")),this.addReplacement(new ne("%%permalink%%","permalink")),this.addReplacement(new ne("%%post_content%%","post_content")),this.addReplacement(new ne("%%post_month%%","post_month")),this.addReplacement(new ne("%%post_year%%","post_year")),this.addReplacement(new ne("%%searchphrase%%","searchphrase")),this.addReplacement(new ne("%%sitedesc%%","sitedesc")),this.addReplacement(new ne("%%sitename%%","sitename")),this.addReplacement(new ne("%%userid%%","userid")),this.addReplacement(new ne("%%focuskw%%","keyword",{source:"app",aliases:["%%keyword%%"]})),this.addReplacement(new ne("%%term_description%%","text",{source:"app",scope:["term","category","tag"],aliases:["%%tag_description%%","%%category_description%%"]})),this.addReplacement(new ne("%%term_title%%","term_title",{scope:["term"]})),this.addReplacement(new ne("%%term_hierarchy%%","term_hierarchy",{scope:["term"]})),this.addReplacement(new ne("%%title%%","title",{source:"app",scope:["post","term","page"]})),this.addReplacement(new ne("%%parent_title%%","title",{source:"app",scope:["page","category"]})),this.addReplacement(new ne("%%excerpt%%","excerpt",{source:"app",scope:["post"],aliases:["%%excerpt_only%%"]})),this.addReplacement(new ne("%%primary_category%%","primaryCategory",{source:"app",scope:["post"]})),this.addReplacement(new ne("%%sep%%(\\s*%%sep%%)*","sep"))},ue.prototype.registerEvents=function(){const e=wpseoScriptData.analysis.plugins.replaceVars.scope;"post"===e&&jQuery(".categorydiv").each(this.bindTaxonomyEvents.bind(this)),"post"!==e&&"page"!==e||jQuery("#postcustomstuff > #list-table").each(this.bindFieldEvents.bind(this))},ue.prototype.subscribeToGutenberg=function(){if(!F())return;const e={0:""};let t=null;const s=wp.data;s.subscribe(()=>{const i=s.select("core/editor").getEditedPostAttribute("parent");if(void 0!==i&&t!==i)return t=i,i<1?(this._currentParentPageTitle="",void this.declareReloaded()):(0,a.isUndefined)(e[i])?void se.loadPromise.done(()=>{new se.models.Page({id:i}).fetch().then(t=>{this._currentParentPageTitle=t.title.rendered,e[i]=this._currentParentPageTitle,this.declareReloaded()}).fail(()=>{this._currentParentPageTitle="",this.declareReloaded()})}):(this._currentParentPageTitle=e[i],void this.declareReloaded())})},ue.prototype.addReplacement=function(e){de[e.placeholder]=e},ue.prototype.removeReplacement=function(e){delete de[e.getPlaceholder()]},ue.prototype.registerModifications=function(){var e=this.replaceVariables.bind(this);(0,a.forEach)(le,function(t){this._app.registerModification(t,e,"replaceVariablePlugin",10)}.bind(this))},ue.prototype.replaceVariables=function(e){return(0,a.isUndefined)(e)||(e=this.parentReplace(e),e=this.replaceCustomTaxonomy(e),e=this.replaceByStore(e),e=this.replacePlaceholders(e)),e},ue.prototype.replaceByStore=function(e){const t=this._store.getState().snippetEditor.replacementVariables;return(0,a.forEach)(t,t=>{""!==t.value&&(e=e.replace("%%"+t.name+"%%",t.value))}),e},ue.prototype.getReplacementSource=function(e){return"app"===e.source?this._app.rawData:"direct"===e.source?"direct":wpseoScriptData.analysis.plugins.replaceVars.replace_vars},ue.prototype.getReplacement=function(e){var t=this.getReplacementSource(e.options);return!1===e.inScope(wpseoScriptData.analysis.plugins.replaceVars.scope)?"":"direct"===t?e.replacement:t[e.replacement]||""},ue.prototype.replacePlaceholders=function(e){return(0,a.forEach)(de,function(t){e=e.replace(new RegExp(t.getPlaceholder(!0),"g"),this.getReplacement(t))}.bind(this)),e},ue.prototype.declareReloaded=function(){this._app.pluginReloaded("replaceVariablePlugin"),this._store.dispatch(ce())},ue.prototype.getCategoryName=function(e){var t=e.parent("label").clone();return t.children().remove(),t.text().trim()},ue.prototype.parseTaxonomies=function(e,t){(0,a.isUndefined)(pe[t])&&(pe[t]={});const s=[];(0,a.forEach)(e,function(e){const i=(e=jQuery(e)).val(),o=this.getCategoryName(e),n=e.prop("checked");pe[t][i]={label:o,checked:n},n&&-1===s.indexOf(o)&&s.push(o)}.bind(this)),"category"!==t&&(t="ct_"+t),this._store.dispatch(re(t,s.join(", ")))},ue.prototype.getAvailableTaxonomies=function(e){var t=jQuery(e).find("input[type=checkbox]"),s=jQuery(e).attr("id").replace("taxonomy-","");t.length>0&&this.parseTaxonomies(t,s),this.declareReloaded()},ue.prototype.bindTaxonomyEvents=function(e,t){(t=jQuery(t)).on("wpListAddEnd",".categorychecklist",this.getAvailableTaxonomies.bind(this,t)),t.on("change","input[type=checkbox]",this.getAvailableTaxonomies.bind(this,t)),this.getAvailableTaxonomies(t)},ue.prototype.replaceCustomTaxonomy=function(e){return(0,a.forEach)(pe,function(t,s){var i="%%ct_"+s+"%%";"category"===s&&(i="%%"+s+"%%"),e=e.replace(i,this.getTaxonomyReplaceVar(s))}.bind(this)),e},ue.prototype.getTaxonomyReplaceVar=function(e){var t=[],s=pe[e];return!0===(0,a.isUndefined)(s)?"":((0,a.forEach)(s,function(e){!1!==e.checked&&t.push(e.label)}),jQuery.uniqueSort(t).join(", "))},ue.prototype.parseFields=function(e){jQuery(e).each(function(e,t){var s=jQuery("#"+t.id+"-key").val(),i=jQuery("#"+t.id+"-value").val();const o="cf_"+this.sanitizeCustomFieldNames(s),n=s+" (custom field)";this._store.dispatch(re(o,i,n)),this.addReplacement(new ne(`%%${o}%%`,i,{source:"direct"}))}.bind(this))},ue.prototype.removeFields=function(e){jQuery(e).each(function(e,t){var s=jQuery("#"+t.id+"-key").val();this.removeReplacement("%%cf_"+this.sanitizeCustomFieldNames(s)+"%%")}.bind(this))},ue.prototype.sanitizeCustomFieldNames=function(e){return e.replace(/\s/g,"_")},ue.prototype.getAvailableFields=function(e){this.removeCustomFields();var t=jQuery(e).find("#the-list > tr:visible[id]");t.length>0&&this.parseFields(t),this.declareReloaded()},ue.prototype.bindFieldEvents=function(e,t){var s=(t=jQuery(t)).find("#the-list");s.on("wpListDelEnd.wpseoCustomFields",this.getAvailableFields.bind(this,t)),s.on("wpListAddEnd.wpseoCustomFields",this.getAvailableFields.bind(this,t)),s.on("input.wpseoCustomFields",".textarea",this.getAvailableFields.bind(this,t)),s.on("click.wpseoCustomFields",".button + .updatemeta",this.getAvailableFields.bind(this,t)),this.getAvailableFields(t)},ue.prototype.removeCustomFields=function(){var e=(0,a.filter)(de,function(e,t){return t.indexOf("%%cf_")>-1});(0,a.forEach)(e,function(e){this._store.dispatch(ae((0,a.trim)(e.placeholder,"%%"))),this.removeReplacement(e)}.bind(this))},ue.prototype.parentReplace=function(e){const t=jQuery("#parent_id, #parent").eq(0);return this.hasParentTitle(t)&&(e=e.replace(/%%parent_title%%/,this.getParentTitleReplacement(t))),F()&&!(0,a.isUndefined)(this._currentParentPageTitle)&&(e=e.replace(/%%parent_title%%/,this._currentParentPageTitle)),e},ue.prototype.hasParentTitle=function(e){return!(0,a.isUndefined)(e)&&!(0,a.isUndefined)(e.prop("options"))},ue.prototype.getParentTitleReplacement=function(e){var t=e.find("option:selected").text();return t===(0,r.__)("(no parent)","wordpress-seo")?"":t},ue.ReplaceVar=ne;const he=ue,ge=window.wp.hooks,we="[^<>&/\\[\\]\0- =]+?",fe=new RegExp("\\["+we+"( [^\\]]+?)?\\]","g"),ye=new RegExp("\\[/"+we+"\\]","g");class me{constructor({registerPlugin:e,registerModification:t,pluginReady:s,pluginReloaded:i},o){this._registerModification=t,this._pluginReady=s,this._pluginReloaded=i,e("YoastShortcodePlugin",{status:"loading"}),this.bindElementEvents();const n="("+o.join("|")+")";this.shortcodesRegex=new RegExp(n,"g"),this.closingTagRegex=new RegExp("\\[\\/"+n+"\\]","g"),this.nonCaptureRegex=new RegExp("\\["+n+"[^\\]]*?\\]","g"),this.parsedShortcodes=[],this.loadShortcodes(this.declareReady.bind(this))}declareReady(){this._pluginReady("YoastShortcodePlugin"),this.registerModifications()}declareReloaded(){this._pluginReloaded("YoastShortcodePlugin")}registerModifications(){this._registerModification("content",this.replaceShortcodes.bind(this),"YoastShortcodePlugin")}removeUnknownShortCodes(e){return(e=e.replace(fe,"")).replace(ye,"")}replaceShortcodes(e){return"string"==typeof e&&this.parsedShortcodes.forEach(({shortcode:t,output:s})=>{e=e.replace(t,s)}),e=this.removeUnknownShortCodes(e)}loadShortcodes(e){const t=this.getUnparsedShortcodes(this.getShortcodes(this.getContentTinyMCE()));if(!(t.length>0))return e();this.parseShortcodes(t,e)}bindElementEvents(){const e=document.querySelector(".wp-editor-area"),t=(0,a.debounce)(this.loadShortcodes.bind(this,this.declareReloaded.bind(this)),500);e&&(e.addEventListener("keyup",t),e.addEventListener("change",t)),"undefined"!=typeof tinyMCE&&"function"==typeof tinyMCE.on&&tinyMCE.on("addEditor",function(e){e.editor.on("change",t),e.editor.on("keyup",t)})}getContentTinyMCE(){let e=document.querySelector(".wp-editor-area")?document.querySelector(".wp-editor-area").value:"";return"undefined"!=typeof tinyMCE&&void 0!==tinyMCE.editors&&0!==tinyMCE.editors.length&&(e=tinyMCE.get("content")?tinyMCE.get("content").getContent():""),e}getUnparsedShortcodes(e){return"object"!=typeof e?(console.error("Failed to get unparsed shortcodes. Expected parameter to be an array, instead received "+typeof e),!1):e.filter(e=>this.isUnparsedShortcode(e))}isUnparsedShortcode(e){return!this.parsedShortcodes.some(({shortcode:t})=>t===e)}getShortcodes(e){if("string"!=typeof e)return console.error("Failed to get shortcodes. Expected parameter to be a string, instead received"+typeof e),!1;const t=this.matchCapturingShortcodes(e);t.forEach(t=>{e=e.replace(t,"")});const s=this.matchNonCapturingShortcodes(e);return t.concat(s)}matchCapturingShortcodes(e){const t=(e.match(this.closingTagRegex)||[]).join(" ").match(this.shortcodesRegex)||[];return(0,a.flatten)(t.map(t=>{const s="\\["+t+"[^\\]]*?\\].*?\\[\\/"+t+"\\]";return e.match(new RegExp(s,"g"))||[]}))}matchNonCapturingShortcodes(e){return e.match(this.nonCaptureRegex)||[]}parseShortcodes(e,t){return"function"!=typeof t?(console.error("Failed to parse shortcodes. Expected parameter to be a function, instead received "+typeof t),!1):"object"==typeof e&&e.length>0?void jQuery.post(ajaxurl,{action:"wpseo_filter_shortcodes",_wpnonce:wpseoScriptData.analysis.plugins.shortcodes.wpseo_filter_shortcodes_nonce,data:e},function(e){this.saveParsedShortcodes(e,t)}.bind(this)):t()}saveParsedShortcodes(e,t){const s=JSON.parse(e);this.parsedShortcodes.push(...s),t()}}const be=me,{updateShortcodesForParsing:_e}=l.actions;function Se(e){var t=jQuery(".yst-traffic-light"),s=t.closest(".wpseo-meta-section-link"),i=jQuery("#wpseo-traffic-light-desc"),o=e.className||"na";t.attr("class","yst-traffic-light "+o),s.attr("aria-describedby","wpseo-traffic-light-desc"),i.length>0?i.text(e.screenReaderText):s.closest("li").append(""+e.screenReaderText+"")}function ve(e){jQuery("#wp-admin-bar-wpseo-menu .wpseo-score-icon").attr("title",e.screenReaderText).attr("class","wpseo-score-icon "+e.className).find(".wpseo-score-text").text(e.screenReaderText)}function ke(){return(0,a.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}function Ee(){const e=ke();return(0,a.get)(e,"contentLocale","en_US")}function xe(){const e=ke();return!0===(0,a.get)(e,"contentAnalysisActive",!1)}function Re(){const e=ke();return!0===(0,a.get)(e,"keywordAnalysisActive",!1)}function Oe(){const e=ke();return!0===(0,a.get)(e,"inclusiveLanguageAnalysisActive",!1)}const Te=window.yoast.featureFlag;function Pe(){}let Ce=!1;function Ae(e){return e.sort((e,t)=>e._identifier.localeCompare(t._identifier))}function Me(e,t,s,i,o){if(!Ce)return;const n=B.Paper.parse(t());e.analyze(n).then(a=>{const{result:{seo:r,readability:c,inclusiveLanguage:d}}=a;if(r){const e=r[""];e.results.forEach(e=>{e.getMarker=()=>()=>s(n,e.marks)}),e.results=Ae(e.results),i.dispatch(l.actions.setSeoResultsForKeyword(n.getKeyword(),e.results)),i.dispatch(l.actions.setOverallSeoScore(e.score,n.getKeyword())),i.dispatch(l.actions.refreshSnippetEditor()),o.saveScores(e.score,n.getKeyword())}c&&(c.results.forEach(e=>{e.getMarker=()=>()=>s(n,e.marks)}),c.results=Ae(c.results),i.dispatch(l.actions.setReadabilityResults(c.results)),i.dispatch(l.actions.setOverallReadabilityScore(c.score)),i.dispatch(l.actions.refreshSnippetEditor()),o.saveContentScore(c.score)),d&&(d.results.forEach(e=>{e.getMarker=()=>()=>s(n,e.marks)}),d.results=Ae(d.results),i.dispatch(l.actions.setInclusiveLanguageResults(d.results)),i.dispatch(l.actions.setOverallInclusiveLanguageScore(d.score)),i.dispatch(l.actions.refreshSnippetEditor()),o.saveInclusiveLanguageScore(d.score)),(0,ge.doAction)("yoast.analysis.refresh",a,{paper:n,worker:e,collectData:t,applyMarks:s,store:i,dataCollector:o})}).catch(Pe)}const De=window.wp.blocks,Ie="yoast-measurement-element";function Fe(e){let t=document.getElementById(Ie);return t||(t=function(){const e=document.createElement("div");return e.id=Ie,e.style.position="absolute",e.style.left="-9999em",e.style.top=0,e.style.height=0,e.style.overflow="hidden",e.style.fontFamily="arial, sans-serif",e.style.fontSize="20px",e.style.fontWeight="400",document.body.appendChild(e),e}()),t.innerText=e,t.offsetWidth}const Be=e=>(e=e.filter(e=>e.isValid)).map(e=>{const t=(0,De.serialize)([e],{isInnerBlocks:!1});return e.blockLength=t&&t.length,e.innerBlocks&&(e.innerBlocks=Be(e.innerBlocks)),e});function Ue(e){return(0,a.isNil)(e)||(e/=10),function(e){switch(e){case"feedback":return{className:"na",screenReaderText:(0,r.__)("Not available","wordpress-seo"),screenReaderReadabilityText:(0,r.__)("Not available","wordpress-seo"),screenReaderInclusiveLanguageText:(0,r.__)("Not available","wordpress-seo")};case"bad":return{className:"bad",screenReaderText:(0,r.__)("Needs improvement","wordpress-seo"),screenReaderReadabilityText:(0,r.__)("Needs improvement","wordpress-seo"),screenReaderInclusiveLanguageText:(0,r.__)("Needs improvement","wordpress-seo")};case"ok":return{className:"ok",screenReaderText:(0,r.__)("OK SEO score","wordpress-seo"),screenReaderReadabilityText:(0,r.__)("OK","wordpress-seo"),screenReaderInclusiveLanguageText:(0,r.__)("Potentially non-inclusive","wordpress-seo")};case"good":return{className:"good",screenReaderText:(0,r.__)("Good SEO score","wordpress-seo"),screenReaderReadabilityText:(0,r.__)("Good","wordpress-seo"),screenReaderInclusiveLanguageText:(0,r.__)("Good","wordpress-seo")};default:return{className:"loading",screenReaderText:"",screenReaderReadabilityText:"",screenReaderInclusiveLanguageText:""}}}(B.interpreters.scoreToRating(e))}const Ye=jQuery,Le=function(e){"object"==typeof CKEDITOR&&console.warn("YoastSEO currently doesn't support ckEditor. The content analysis currently only works with the HTML editor or TinyMCE."),this._store=e.store};Le.prototype.getData=function(){const e={title:this.getSnippetTitle(),keyword:Re()?this.getKeyword():"",text:this.getText(),permalink:this.getPermalink(),snippetCite:this.getSnippetCite(),snippetTitle:this.getSnippetTitle(),snippetMeta:this.getSnippetMeta(),name:this.getName(),baseUrl:this.getBaseUrl(),pageTitle:this.getSnippetTitle(),titleWidth:Fe(this.getSnippetTitle())},t=this._store.getState();return{...e,metaTitle:(0,a.get)(t,["analysisData","snippet","title"],this.getSnippetTitle()),url:(0,a.get)(t,["snippetEditor","data","slug"],this.getSlug()),meta:(0,a.get)(t,["analysisData","snippet","description"],this.getSnippetMeta())}},Le.prototype.getKeyword=function(){return document.getElementById("hidden_wpseo_focuskw").value},Le.prototype.getText=function(){return function(e){let t="";var s;return t=!1===G(e)||0==(s=e,null!==document.getElementById(s+"_ifr"))?function(e){return document.getElementById(e)&&document.getElementById(e).value||""}(e):tinyMCE.get(e).getContent(),t}($)},Le.prototype.getSlug=function(){return document.getElementById("slug").value},Le.prototype.getPermalink=function(){const e=this.getSlug();return this.getBaseUrl()+e+"/"},Le.prototype.getSnippetCite=function(){return this.getSlug()},Le.prototype.getSnippetTitle=function(){return document.getElementById("hidden_wpseo_title").value},Le.prototype.getSnippetMeta=function(){const e=document.getElementById("hidden_wpseo_desc");return e?e.value:""},Le.prototype.getName=function(){return document.getElementById("name").value},Le.prototype.getBaseUrl=function(){return wpseoScriptData.metabox.base_url},Le.prototype.setDataFromSnippet=function(e,t){switch(t){case"snippet_meta":document.getElementById("hidden_wpseo_desc").value=e;break;case"snippet_cite":document.getElementById("slug").value=e;break;case"snippet_title":document.getElementById("hidden_wpseo_title").value=e}},Le.prototype.saveSnippetData=function(e){this.setDataFromSnippet(e.title,"snippet_title"),this.setDataFromSnippet(e.urlPath,"snippet_cite"),this.setDataFromSnippet(e.metaDesc,"snippet_meta")},Le.prototype.bindElementEvents=function(e){this.inputElementEventBinder(e)},Le.prototype.inputElementEventBinder=function(e){const t=["name",$,"slug","wpseo_focuskw"];for(let s=0;s