| @@ -1,59 +1,596 @@ | ||
| 1 | -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=211)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.yoast.propTypes},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.yoast.componentsNew},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.yoast.helpers},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){e.exports=window.yoast.styledComponents},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}},function(e,t){function n(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(a,o){var i=e.apply(t,r);function s(e){n(i,a,o,s,c,"next",e)}function c(e){n(i,a,o,s,c,"throw",e)}s(void 0)}))}}},function(e,t){e.exports=window.yoast.externals.redux},function(e,t,n){var r=n(43);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(34),a=n(12);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?a(e):t}},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.components},,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3);function a(){return Object(r.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}},function(e,t,n){var r=n(66),a=n(67),o=n(68);e.exports=function(e){return r(e)||a(e)||o()}},function(e,t){e.exports=window.yoast.styleGuide},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t){e.exports=window.yoast.analysis},,function(e,t,n){var r=n(59),a=n(60),o=n(61);e.exports=function(e,t){return r(e)||a(e,t)||o()}},function(e,t){e.exports=window.yoast.externals.contexts},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=s(n(5)),o=s(n(89)),i=s(n(92));function s(e){return e&&e.__esModule?e:{default:e}}var c=void 0;t.default=function(e){var t=e.mixedString,n=e.components,s=e.throwErrors;if(c=t,!n)return t;if("object"!==(void 0===n?"undefined":r(n))){if(s)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var u=(0,i.default)(t);try{return function e(t,n){var i,s,u,l,p,d,m,h,f=[],b={};for(d=0;d<t.length;d++)if("string"!==(p=t[d]).type){if(!n.hasOwnProperty(p.value)||void 0===n[p.value])throw new Error("Invalid interpolation, missing component node: `"+p.value+"`");if("object"!==r(n[p.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+p.value+"`","\n> "+c);if("componentClose"===p.type)throw new Error("Missing opening component token: `"+p.value+"`");if("componentOpen"===p.type){i=n[p.value],u=d;break}f.push(n[p.value])}else f.push(p.value);return i&&(l=function(e,t){var n,r,a=t[e],o=0;for(r=e+1;r<t.length;r++)if((n=t[r]).value===a.value){if("componentOpen"===n.type){o++;continue}if("componentClose"===n.type){if(0===o)return r;o--}}throw new Error("Missing closing component token `"+a.value+"`")}(u,t),m=e(t.slice(u+1,l),n),s=a.default.cloneElement(i,{},m),f.push(s),l<t.length-1&&(h=e(t.slice(l+1),n),f=f.concat(h))),1===f.length?f[0]:(f.forEach((function(e,t){e&&(b["interpolation-child-"+t]=e)})),(0,o.default)(b))}(u,n)}catch(e){if(s)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},function(e,t,n){"use strict";n.d(t,"d",(function(){return d})),n.d(t,"b",(function(){return h})),n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return g})),n.d(t,"e",(function(){return O})),n.d(t,"f",(function(){return j}));var r=n(16),a=n.n(r),o=n(7),i=n.n(o),s=n(36),c=n.n(s),u=n(3);function l(_x){return p.apply(this,arguments)}function p(){return(p=a()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c()(t);case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),!e.t0.error||!e.t0.status){e.next=10;break}return e.abrupt("return",e.t0);case 10:if(!(e.t0 instanceof Response)){e.next=14;break}return e.next=13,e.t0.json();case 13:return e.abrupt("return",e.sent);case 14:return e.abrupt("return",!1);case 15:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function d(e,t,n){return m.apply(this,arguments)}function m(){return(m=a()(i.a.mark((function e(t,n,r){var a,o,s=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=s.length>3&&void 0!==s[3]?s[3]:200,e.prev=1,e.next=4,t();case 4:if(!(o=e.sent)){e.next=9;break}if(o.status!==a){e.next=8;break}return e.abrupt("return",n(o));case 8:return e.abrupt("return",r(o));case 9:return e.abrupt("return",!1);case 12:e.prev=12,e.t0=e.catch(1),console.error(e.t0.message);case 15:case"end":return e.stop()}}),e,null,[[1,12]])})))).apply(this,arguments)}function h(){return f.apply(this,arguments)}function f(){return(f=a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l({path:"yoast/v1/wincher/authorization-url",method:"GET"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e){return y.apply(this,arguments)}function y(){return(y=a()(i.a.mark((function e(t){var n,r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.code,r=t.websiteId,e.next=3,l({path:"yoast/v1/wincher/authenticate",method:"POST",data:{code:n,websiteId:r}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(){return v.apply(this,arguments)}function v(){return(v=a()(i.a.mark((function e(){var t,n,r,a=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:null,n=a.length>1&&void 0!==a[1]?a[1]:null,r=a.length>2?a[2]:void 0,e.next=5,l({path:"yoast/v1/wincher/keyphrases",method:"POST",data:{keyphrases:t,permalink:n},signal:r});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(e){return w.apply(this,arguments)}function w(){return(w=a()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Object(u.isArray)(t)||(t=[t]),e.next=3,l({path:"yoast/v1/wincher/keyphrases/track",method:"POST",data:{keyphrases:t}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(e){return E.apply(this,arguments)}function E(){return(E=a()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l({path:"yoast/v1/wincher/keyphrases/untrack",method:"DELETE",data:{keyphraseID:t}});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},function(e,t,n){"use strict";var r=n(0),a=n(1),o=n.n(a),i=function(e){var t=e.children;return Object(r.createElement)("div",null,t)};i.propTypes={renderPriority:o.a.number.isRequired,children:o.a.node.isRequired},t.a=i},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},,function(e,t){e.exports=window.wp.apiFetch},function(e,t,n){"use strict";n.r(t),n.d(t,"tmceId",(function(){return c})),n.d(t,"termsTmceId",(function(){return u})),n.d(t,"setStore",(function(){return l})),n.d(t,"isTinyMCELoaded",(function(){return p})),n.d(t,"isTinyMCEAvailable",(function(){return d})),n.d(t,"getContentTinyMce",(function(){return m})),n.d(t,"addEventHandler",(function(){return h})),n.d(t,"disableMarkerButtons",(function(){return f})),n.d(t,"enableMarkerButtons",(function(){return b})),n.d(t,"isTextViewActive",(function(){return y})),n.d(t,"wpTextViewOnInitCheck",(function(){return g})),n.d(t,"tinyMceEventBinder",(function(){return v}));var r,a=n(3),o=n(84),i=n(116),s=n(17),c="content",u="description";function l(e){r=e}function p(){return"undefined"!=typeof tinyMCE&&void 0!==tinyMCE.editors&&0!==tinyMCE.editors.length}function d(e){if(!p())return!1;var t=tinyMCE.get(e);return null!==t&&!t.isHidden()}function m(e){var t,n,r;return n=!1===d(e)||0==(t=e,null!==document.getElementById(t+"_ifr"))?function(e){return document.getElementById(e)&&document.getElementById(e).value||""}(e):tinyMCE.get(e).getContent(),r=new RegExp("&","g"),n.replace(r,"&")}function h(e,t,n){"undefined"!=typeof tinyMCE&&"function"==typeof tinyMCE.on&&tinyMCE.on("addEditor",(function(r){var o=r.editor;o.id===e&&Object(a.forEach)(t,(function(e){o.on(e,n)}))}))}function f(){Object(a.isUndefined)(r)||r.dispatch(s.actions.setMarkerStatus("disabled"))}function b(){Object(a.isUndefined)(r)||r.dispatch(s.actions.setMarkerStatus("enabled"))}function y(){var e=document.getElementById("wp-content-wrap");return!!e&&e.classList.contains("html-active")}function g(){y()&&(f(),p()&&tinyMCE.on("AddEditor",(function(){b()})))}function v(e,t){h(t,["input","change","cut","paste"],e),h(t,["hide"],f);var n=["show"];(new i.a).isPageBuilderActive()||n.push("init"),h(t,n,b),h("content",["focus"],(function(e){var t=e.target;Object(o.a)(t)&&(Object(o.b)(t),YoastSEO.app.disableMarkers())}))}},function(e,t,n){var r=n(79);e.exports=function(e,t){if(null==e)return{};var n,a,o=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},function(e,t){e.exports=window.wp.url},function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return o})),n.d(t,"g",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"h",(function(){return l})),n.d(t,"b",(function(){return p})),n.d(t,"l",(function(){return d})),n.d(t,"m",(function(){return m})),n.d(t,"n",(function(){return h})),n.d(t,"o",(function(){return f})),n.d(t,"k",(function(){return b})),n.d(t,"j",(function(){return y})),n.d(t,"i",(function(){return g}));var r=n(8),a="SNIPPET_EDITOR_SWITCH_MODE",o="SNIPPET_EDITOR_UPDATE_DATA",i="SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLE",s="SNIPPET_EDITOR_HIDE_REPLACEMENT_VARIABLES",c="SNIPPET_EDITOR_REMOVE_REPLACEMENT_VARIABLE",u="SNIPPET_EDITOR_REFRESH",l="SNIPPET_EDITOR_UPDATE_WORDS_TO_HIGHLIGHT",p="LOAD_SNIPPET_EDITOR_DATA";function d(e){return{type:a,mode:e}}function m(e){return{type:o,data:e}}function h(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o="string"==typeof t?Object(r.decodeHTML)(t):t;return{type:i,name:e,value:o,label:n,hidden:a}}function f(e){return{type:l,wordsToHighlight:e}}function b(e){return{type:c,name:e}}function y(){return{type:u,time:(new Date).getMilliseconds()}}function g(e){return{type:s,data:e}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=n(0);function a(e){return e.charAt(0).toUpperCase()+e.slice(1)}function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object(r.createInterpolateElement)(e,{a:Object(r.createElement)("a",{id:n,href:t,target:"_blank",rel:"noopener noreferrer"})})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),a=n(1),o=n.n(a);function i(e){var t=e.target,n=e.children,a=t;return"string"==typeof t&&(a=document.getElementById(t)),a?Object(r.createPortal)(n,a):null}i.propTypes={target:o.a.oneOfType([o.a.string,o.a.object]).isRequired,children:o.a.node.isRequired}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(14),a=n.n(r),o=n(20),i=n(0),s=n(30);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(){return Object(o.createHigherOrderComponent)((function(e){return Object(o.pure)((function(t){var n=Object(i.useContext)(s.LocationContext);return Object(i.createElement)(e,u(u({},t),{},{location:n}))}))}),"withLocation")}},,function(e,t){e.exports=window.yoast.replacementVariableEditor},,,function(e,t,n){"use strict";n.d(t,"b",(function(){return R}));var r=n(26),a=n.n(r),o=n(38),i=n.n(o),s=n(14),c=n.n(s),u=n(9),l=n.n(u),p=n(10),d=n.n(p),m=n(12),h=n.n(m),f=n(18),b=n.n(f),y=n(19),g=n.n(y),v=n(11),O=n.n(v),w=n(0),j=n(1),E=n.n(j);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=E.a.shape({value:E.a.string.isRequired,onChange:E.a.func.isRequired});t.a=function(e){return function(t){return function(n){b()(u,n);var r,o,s=(r=u,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O()(r);if(o){var n=O()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g()(this,e)});function u(t){var n;l()(this,u),(n=s.call(this,t)).elements={};var r={};return n.fields=e(t),n.fields.forEach((function(e){var t=e.name,a=e.fieldId,o=document.getElementById(a);o&&(n.elements[t]=o,r[t]={value:o.value,onChange:n.onChange.bind(h()(n),t)})})),n.state=r,n}return d()(u,[{key:"onChange",value:function(e,t){var n=this;this.setState(T(T({},this.state),{},c()({},e,T(T({},this.state[e]),{},{value:t}))),(function(){n.elements[e]&&(n.elements[e].value=t)}))}},{key:"render",value:function(){var e=this.props,n=e.children,r=i()(e,["children"]);return Object(w.createElement)(t,a()({},r,this.state),n)}}],[{key:"propTypes",get:function(){return{children:E.a.node}}}]),u}(w.Component)}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),a=n(23);function o(){var e=Object(a.a)();return Object(r.get)(e,"contentLocale","en_US")}},function(e,t,n){"use strict";var r,a=n(15),o=n.n(a),i=n(25),s=n(8),c=n(13),u=n.n(c),l=Object(s.makeOutboundLink)(u.a.a(r||(r=o()(["\n\tdisplay: inline-block;\n\tposition: relative;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 100%;\n\twidth: 24px;\n\theight: 24px;\n\tmargin: -4px 0;\n\tvertical-align: middle;\n\n\tcolor: ",";\n\t\n\t&:hover,\n\t&:focus {\n\t\tcolor: ",";\t\n\t}\n\t\n\t// Overwrite the default blue active color for links.\n\t&:active {\n\t\tcolor: ",';\t\n\t}\n\n\t&::before {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tpadding: 2px;\n\t\tcontent: "\f223";\n\t}\n'],["\n\tdisplay: inline-block;\n\tposition: relative;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 100%;\n\twidth: 24px;\n\theight: 24px;\n\tmargin: -4px 0;\n\tvertical-align: middle;\n\n\tcolor: ",";\n\t\n\t&:hover,\n\t&:focus {\n\t\tcolor: ",";\t\n\t}\n\t\n\t// Overwrite the default blue active color for links.\n\t&:active {\n\t\tcolor: ",';\t\n\t}\n\n\t&::before {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tpadding: 2px;\n\t\tcontent: "\\f223";\n\t}\n'])),i.colors.$color_help_text,i.colors.$color_snippet_focus,i.colors.$color_help_text));t.a=l},function(e,t,n){"use strict";var r,a=n(26),o=n.n(a),i=n(15),s=n.n(i),c=n(0),u=n(4),l=n(13),p=n.n(l)()(u.Collapsible)(r||(r=s()(['\n\th2 > button {\n\t\tpadding-left: 24px;\n\t\tpadding-top: 16px;\n\n\t\t&:hover {\n\t\t\tbackground-color: #f0f0f0;\n\t\t}\n\t}\n\n\tdiv[class^="collapsible_content"] {\n\t\tpadding: 24px 0;\n\t\tmargin: 0 24px;\n\t\tborder-top: 1px solid rgba(0,0,0,0.2);\n\t}\n\n'])));t.a=function(e){return Object(c.createElement)(p,o()({hasPadding:!0,hasSeparator:!0},e))}},function(e,t){e.exports=window.yoast.externals.components},,function(e,t,n){"use strict";n.r(t),n.d(t,"nonReplaceVars",(function(){return d})),n.d(t,"fillReplacementVariables",(function(){return m})),n.d(t,"handlePrefixes",(function(){return h})),n.d(t,"createLabelFromName",(function(){return f})),n.d(t,"pushNewReplaceVar",(function(){return b})),n.d(t,"replaceSpaces",(function(){return y})),n.d(t,"prepareCustomFieldForDispatch",(function(){return g})),n.d(t,"prepareCustomTaxonomyForDispatch",(function(){return v})),n.d(t,"mapCustomTaxonomies",(function(){return O})),n.d(t,"mapCustomFields",(function(){return w})),n.d(t,"excerptFromContent",(function(){return j})),n.d(t,"applyReplaceUsingPlugin",(function(){return E}));var r=n(14),a=n.n(r),o=n(3),i=n(106),s=n(40),c=n(41);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=n(8).strings.stripHTMLTags,d=["slug","content","contentImage","snippetPreviewImageURL"];function m(e,t){Object(o.forEach)(e,(function(e,n){d.includes(n)||t.dispatch(Object(s.n)(n,e))}))}function h(e){if(!["ct_","cf_","pt_"].includes(e.substr(0,3)))return e.replace(/_/g," ");var t=e.slice(0,3);switch(-1!==(e=e.slice(3)).indexOf("desc_")&&(e=e.slice(5)+" description"),t){case"ct_":e+=" (custom taxonomy)";break;case"cf_":e+=" (custom field)";break;case"pt_":e="Post type ("+(e=e.replace("single","singular"))+")"}return e}function f(e){return e=h(e),Object(c.b)(e)}function b(e,t){return e.push({name:t.name,label:t.label||f(t.name),value:t.value}),e}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_";return e.replace(/\s/g,t)}function g(e){return{name:"cf_"+y(e),label:Object(c.b)(e+" (custom field)")}}function v(e){var t=y(e);return{name:"ct_"+t,label:Object(c.b)(e+" (custom taxonomy)"),descriptionName:"ct_desc_"+t,descriptionLabel:Object(c.b)(e+" description (custom taxonomy)")}}function O(e,t){return e.custom_taxonomies?(Object(o.forEach)(e.custom_taxonomies,(function(e,n){var r=v(n),a=r.name,o=r.label,i=r.descriptionName,c=r.descriptionLabel;t.dispatch(Object(s.n)(a,e.name,o)),t.dispatch(Object(s.n)(i,e.description,c))})),Object(o.omit)(l({},e),"custom_taxonomies")):e}function w(e,t){return e.custom_fields?(Object(o.forEach)(e.custom_fields,(function(e,n){var r=g(n),a=r.name,o=r.label;t.dispatch(Object(s.n)(a,e,o))})),Object(o.omit)(l({},e),"custom_fields")):e}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:156;return(e=(e=Object(i.stripTags)(e)).trim()).length<=t||(e=e.substring(0,t),/\s/.test(e)&&(e=e.substring(0,e.lastIndexOf(" ")))),e}var E=function(e){var t=Object(o.get)(window,["YoastSEO","app","pluggable"],!1);if(!t||!Object(o.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){var t=Object(o.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],o.identity);return{url:e.url,title:p(t(e.title)),description:p(t(e.description))}}(e);var n=t._applyModifications.bind(t);return{url:e.url,title:p(n("data_page_title",e.title)),description:p(n("data_meta_desc",e.description))}}},function(e,t,n){"use strict";var r=n(24),a=n.n(r),o=n(0),i=n(1),s=n.n(i),c=n(2),u=function(e){var t=e.data,n=e.mapChartDataToTableData,r=e.dataTableCaption,a=e.dataTableHeaderLabels,i=e.isDataTableVisuallyHidden;return t.length!==a.length?Object(o.createElement)("p",null,Object(c.__)("The number of headers and header labels don't match.","wordpress-seo")):Object(o.createElement)("div",{className:i?"screen-reader-text":null},Object(o.createElement)("table",null,Object(o.createElement)("caption",null,r),Object(o.createElement)("thead",null,Object(o.createElement)("tr",null,a.map((function(e,t){return Object(o.createElement)("th",{key:t},e)})))),Object(o.createElement)("tbody",null,Object(o.createElement)("tr",null,t.map((function(e,t){return Object(o.createElement)("td",{key:t},n(e.y))}))))))};u.propTypes={data:s.a.arrayOf(s.a.shape({x:s.a.number,y:s.a.number})).isRequired,mapChartDataToTableData:s.a.func,dataTableCaption:s.a.string.isRequired,dataTableHeaderLabels:s.a.array.isRequired,isDataTableVisuallyHidden:s.a.bool},u.defaultProps={mapChartDataToTableData:null,isDataTableVisuallyHidden:!0};var l=u,p=function(e){var t=e.data,n=e.width,r=e.height,i=e.fillColor,s=e.strokeColor,c=e.strokeWidth,u=e.className,p=e.mapChartDataToTableData,d=e.dataTableCaption,m=e.dataTableHeaderLabels,h=e.isDataTableVisuallyHidden,f=Math.max(1,Math.max.apply(Math,a()(t.map((function(e){return e.x}))))),b=Math.max(1,Math.max.apply(Math,a()(t.map((function(e){return e.y}))))),y=r-c,g=t.map((function(e){var t=e.x/f*n,r=y-e.y/b*y+c;return"".concat(t,",").concat(r)})).join(" "),v="0,".concat(y+c," ")+g+" ".concat(n,",").concat(y+c);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("svg",{width:n,height:r,viewBox:"0 0 ".concat(n," ").concat(r),className:u,role:"img","aria-hidden":"true",focusable:"false"},Object(o.createElement)("polygon",{fill:i,points:v}),Object(o.createElement)("polyline",{fill:"none",stroke:s,strokeWidth:c,strokeLinejoin:"round",strokeLinecap:"round",points:g})),p&&Object(o.createElement)(l,{data:t,mapChartDataToTableData:p,dataTableCaption:d,dataTableHeaderLabels:m,isDataTableVisuallyHidden:h}))};p.propTypes={data:s.a.arrayOf(s.a.shape({x:s.a.number,y:s.a.number})).isRequired,width:s.a.number.isRequired,height:s.a.number.isRequired,fillColor:s.a.string,strokeColor:s.a.string,strokeWidth:s.a.number,className:s.a.string,mapChartDataToTableData:s.a.func,dataTableCaption:s.a.string.isRequired,dataTableHeaderLabels:s.a.array.isRequired,isDataTableVisuallyHidden:s.a.bool},p.defaultProps={fillColor:null,strokeColor:"#000000",strokeWidth:1,className:"",mapChartDataToTableData:null,isDataTableVisuallyHidden:!0},t.a=p},function(e,t,n){"use strict";function r(e){return function(e){var t=null;return(t=window.wp.media()).on("select",(function(){var n=t.state().get("selection").first(),r={type:n.attributes.subtype,width:n.attributes.width,height:n.attributes.height,url:n.attributes.url,id:n.attributes.id};e(r)})),t}(e).open()}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],_n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(_n=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){r=!0,a=e}finally{try{_n||null==i.return||i.return()}finally{if(r)throw a}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},,,function(e,t,n){"use strict";function r(e){return function(){return e}}var a=function(){};a.thatReturns=r,a.thatReturnsFalse=r(!1),a.thatReturnsTrue=r(!0),a.thatReturnsNull=r(null),a.thatReturnsThis=function(){return this},a.thatReturnsArgument=function(e){return e},e.exports=a},,function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t,n){"use strict";var r=n(0),a=n(1),o=n.n(a),i=n(13),s=n(30),c=function(e){var t=e.theme,n=e.location,a=e.children;return Object(r.createElement)(s.LocationProvider,{value:n},Object(r.createElement)(i.ThemeProvider,{theme:t},a))};c.propTypes={theme:o.a.object.isRequired,location:o.a.oneOf(["sidebar","metabox","modal"]).isRequired,children:o.a.element.isRequired},t.a=c},function(e,t){e.exports=window.moment},,,,function(e,t){e.exports=window.yoast.featureFlag},,function(e,t,n){"use strict";n.d(t,"b",(function(){return k}));var r=n(14),a=n.n(r),o=n(9),i=n.n(o),s=n(10),c=n.n(s),u=n(12),l=n.n(u),p=n(18),d=n.n(p),m=n(19),h=n.n(m),f=n(11),b=n.n(f),y=n(0),g=n(2),v=n(4),O=n(1),w=n.n(O),j=n(49);var E=function(e){d()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=b()(t);if(n){var a=b()(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return h()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this,e)).initialPageType=e.pageType.value,t.initialArticleType=e.articleType?e.articleType.value:"None",t.state={schema_page_type:t.initialPageType,schema_article_type:t.initialArticleType},t.handleOptionFocus=t.handleOptionFocus.bind(l()(t)),t}return c()(o,[{key:"shouldShowAlert",value:function(){return this.state.schema_page_type!==this.initialPageType||this.state.schema_article_type!==this.initialArticleType}},{key:"handleOptionFocus",value:function(e,t){this.setState(a()({},e,t))}},{key:"render",value:function(){return Object(y.createElement)(y.Fragment,null,Object(y.createElement)(v.FieldGroup,{label:Object(g.__)("Schema settings","wordpress-seo"),linkTo:"https://yoa.st/404",linkText:Object(g.__)("Learn more about the schema settings","wordpress-seo"),description:Object(g.sprintf)( | |
| 2 | -/* translators: %1$s expands to an indexable object's name, e.g. Posts or Pages. */ | |
| 3 | -Object(g.__)("Choose how your %1$s should be described by default in your site's schema.org markup. You can change these settings for individual %1$s.","wordpress-seo"),this.props.postTypeName)}),this.shouldShowAlert()&&Object(y.createElement)(v.Alert,{type:"warning"},Object(g.sprintf)( | |
| 4 | -/* translators: %1$s expands to an indexable object's name, e.g. Posts or Pages. */ | |
| 5 | -Object(g._n)("Upon saving, this setting will apply to all of your %1$s. %1$s that are manually configured will be left untouched.","Upon saving, these settings will apply to all of your %1$s. %1$s that are manually configured will be left untouched.",this.props.articleType?2:1,"wordpress-seo"),this.props.postTypeName)),Object(y.createElement)(v.Select,{id:"schema-page-type-".concat(this.props.postType),name:"schema_page_type",options:this.props.pageTypeOptions,label:Object(g.__)("Default Page type","wordpress-seo"),onChange:this.props.pageType.onChange,selected:this.props.pageType.value,onOptionFocus:this.handleOptionFocus}),this.props.articleType&&Object(y.createElement)(v.Select,{id:"schema-article-type-".concat(this.props.postType),name:"schema_article_type",options:this.props.articleTypeOptions,label:Object(g.__)("Default Article type","wordpress-seo"),onChange:this.props.articleType.onChange,onOptionFocus:this.handleOptionFocus,selected:this.props.articleType.value}))}}]),o}(y.Component),k=w.a.arrayOf(w.a.shape({name:w.a.string,value:w.a.string}));E.propTypes={postType:w.a.string.isRequired,postTypeName:w.a.string.isRequired,pageType:j.b.isRequired,articleType:j.b,pageTypeOptions:k.isRequired,articleTypeOptions:k.isRequired},E.defaultProps={articleType:null},t.a=Object(j.a)((function(e){return[{name:"pageType",fieldId:e.pageTypeFieldId},{name:"articleType",fieldId:e.articleTypeFieldId}]}))(E)},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(9),a=n.n(r),o=n(10),i=n.n(o),s=function(){function e(){a()(this,e)}return i()(e,null,[{key:"articleTypeInput",get:function(){return document.getElementById("yoast_wpseo_schema_article_type")}},{key:"defaultArticleType",get:function(){return e.articleTypeInput.getAttribute("data-default")}},{key:"articleType",get:function(){return e.articleTypeInput.value},set:function(t){e.articleTypeInput.value=t}},{key:"pageTypeInput",get:function(){return document.getElementById("yoast_wpseo_schema_page_type")}},{key:"defaultPageType",get:function(){return e.pageTypeInput.getAttribute("data-default")}},{key:"pageType",get:function(){return e.pageTypeInput.value},set:function(t){e.pageTypeInput.value=t}}]),e}()},,function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return y})),n.d(t,"b",(function(){return g}));var r=n(0),a=n(1),o=n.n(a),i=n(2),s=n(3),c=n(70),u=n.n(c),l=n(4),p=n(8),d=n(57),m=function(){return Object(r.createElement)("p",{className:"yoast-wincher-seo-performance-modal__loading-message"},Object(i.__)("Tracking the ranking position...","wordpress-seo")," ",Object(r.createElement)(l.SvgIcon,{icon:"loading-spinner"}))},h=Object(p.makeOutboundLink)();function f(e){return Math.round(100*e)}function b(e){var t=e.chartData;if(Object(s.isEmpty)(t)||Object(s.isEmpty)(t.position))return"?";var n=function(e){return Array.from({length:e.position.history.length},(function(e,t){return t+1})).map((function(e){ | |
| 6 | -/* translators: %d expands to the amount of days */ | |
| 7 | -return Object(i.sprintf)(Object(i._n)("%d day","%d days",e,"wordpress-seo"),e)}))}(t),a=t.position.history.map((function(e,t){return{x:t,y:101-e.value}}));return Object(r.createElement)(d.a,{width:66,height:24,data:a,strokeWidth:1.8,strokeColor:"#498afc",fillColor:"#ade3fc",className:"yoast-related-keyphrases-modal__chart",mapChartDataToTableData:f,dataTableCaption:Object(i.__)("Keyphrase position in the last 90 days on a scale from 0 to 100.","wordpress-seo"),dataTableHeaderLabels:n})}function y(e){return!e||!e.position||e.position.value>100?"> 100":e.position.value}function g(e){var t=e.keyphrase,n=e.rowData,a=e.onTrackKeyphrase,o=e.onUntrackKeyphrase,c=e.isFocusKeyphrase,p=e.isDisabled,d=e.isLoading,f=!Object(s.isEmpty)(n),g=Object(r.useCallback)((function(){p||(f?o(t,n.id):a(t))}),[t,a,o,f,n,p]);return Object(r.createElement)("tr",null,Object(r.createElement)("td",{className:"yoast-table--nopadding"},function(e){var t=e.keyphrase,n=e.isEnabled,a=e.toggleAction;return e.isLoading?Object(r.createElement)(l.SvgIcon,{icon:"loading-spinner"}):Object(r.createElement)(l.Toggle,{id:"toggle-keyphrase-tracking-".concat(t),className:"wincher-toggle",isEnabled:n,onSetToggleState:a,showToggleStateLabel:!1})}({keyphrase:t,isEnabled:f,toggleAction:g,isLoading:d})),Object(r.createElement)("td",null,t,c&&Object(r.createElement)("span",null,"*")),function(e){var t=e.rowData,n=e.websiteId,a=!Object(s.isEmpty)(t),o=t&&t.updated_at&&u()(t.updated_at)>=u()().subtract(7,"days"),c=t?Object(i.sprintf)("https://app.wincher.com/websites/%s/keywords?serp=%s&utm_medium=plugin&utm_source=yoast&referer=yoast&partner=yoast",n,t.id):null;return a?o?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("td",null,y(t)),Object(r.createElement)("td",{className:"yoast-table--nopadding"},Object(r.createElement)(b,{chartData:t})),Object(r.createElement)("td",{className:"yoast-table--nobreak"},Object(r.createElement)(h,{href:c},Object(i.__)("View","wordpress-seo")))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("td",{className:"yoast-table--nopadding",colSpan:"3"},Object(r.createElement)(m,null))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("td",null,"?"),Object(r.createElement)("td",{className:"yoast-table--nopadding"},"?"),Object(r.createElement)("td",{className:"yoast-table--nobreak"}))}(e))}b.propTypes={chartData:o.a.object},b.defaultProps={chartData:{}},g.propTypes={rowData:o.a.object,keyphrase:o.a.string.isRequired,onTrackKeyphrase:o.a.func,onUntrackKeyphrase:o.a.func,isFocusKeyphrase:o.a.bool,isDisabled:o.a.bool,isLoading:o.a.bool,websiteId:o.a.string},g.defaultProps={rowData:{},onTrackKeyphrase:function(){},onUntrackKeyphrase:function(){},isFocusKeyphrase:!1,isDisabled:!1,isLoading:!1,websiteId:""}},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return c}));var r=n(27),a=n(3);function o(e,t,n){var o=e.dom,i=e.getContent();i=r.markers.removeMarks(i),Object(a.forEach)(n,(function(e){i=e.applyWithReplace(i)})),e.setContent(i),function(e){var t=e.getContent();t=t.replace(new RegExp("<yoastmark.+?>","g"),"").replace(new RegExp("</yoastmark>","g"),""),e.setContent(t)}(e);var s=o.select("yoastmark");Object(a.forEach)(s,(function(e){e.setAttribute("data-mce-bogus","1")}))}function i(e){return window.test=e,o.bind(null,e)}function s(e){return-1!==e.getContent({format:"raw"}).indexOf("<yoastmark")}function c(e){i(e)(null,[])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(16),a=n.n(r),o=n(9),i=n.n(o),s=n(10),c=n.n(s),u=n(7),l=n.n(u),p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i()(this,e),this.url=t,this.origin=new URL(t).origin,this.eventHandlers=Object.assign({success:{type:"",callback:function(){}},error:{type:"",callback:function(){}}},n),this.options=Object.assign({height:570,width:340,title:""},r),this.popup=null,this.createPopup=this.createPopup.bind(this),this.messageHandler=this.messageHandler.bind(this),this.getPopup=this.getPopup.bind(this)}var t;return c()(e,[{key:"createPopup",value:function(){var e=this.options,t=e.height,n=e.width,r=e.title,a=["top="+(window.top.outerHeight/2+window.top.screenY-t/2),"left="+(window.top.outerWidth/2+window.top.screenX-n/2),"width="+n,"height="+t,"resizable=1","scrollbars=1","status=0"];this.popup&&!this.popup.closed||(this.popup=window.open(this.url,r,a.join(","))),this.popup&&this.popup.focus(),window.addEventListener("message",this.messageHandler,!1)}},{key:"messageHandler",value:(t=a()(l.a.mark((function e(t){var n,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.data,r=t.source,t.origin===this.origin&&this.popup===r){e.next=3;break}return e.abrupt("return");case 3:if(n.type!==this.eventHandlers.success.type){e.next=8;break}return this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),e.next=8,this.eventHandlers.success.callback(n);case 8:if(n.type!==this.eventHandlers.error.type){e.next=13;break}return this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),e.next=13,this.eventHandlers.error.callback(n);case 13:case"end":return e.stop()}}),e,this)}))),function(_x){return t.apply(this,arguments)})},{key:"getPopup",value:function(){return this.popup}},{key:"isClosed",value:function(){return!this.popup||this.popup.closed}},{key:"focus",value:function(){this.isClosed()||this.popup.focus()}}]),e}()},function(e,t,n){"use strict";var r=n(0),a=n(1),o=n.n(a),i=n(2),s=n(31),c=n.n(s),u=n(4),l=function(e){var t=Object(i.sprintf)( | |
| 8 | -/* translators: %s expands to a link to open the Wincher login popup. */ | |
| 9 | -Object(i.__)("It seems like something went wrong when retrieving your website's data. Please %s and try again.","wordpress-seo"),"{{reconnectToWincher/}}","Wincher");return Object(r.createElement)(u.Alert,{type:"error"},c()({mixedString:t,components:{reconnectToWincher:Object(r.createElement)("a",{href:"#",onClick:e.onReconnect},Object(i.sprintf)( | |
| 10 | -/* translators: %s : Expands to "Wincher". */ | |
| 11 | -Object(i.__)("reconnect to %s","wordpress-seo"),"Wincher"))}}))};l.propTypes={onReconnect:o.a.func.isRequired},t.a=l},,function(e,t,n){"use strict";var r,a=n(9),o=n.n(a),i=n(10),s=n.n(i),c=n(12),u=n.n(c),l=n(18),p=n.n(l),d=n(19),m=n.n(d),h=n(11),f=n.n(h),b=n(0),y=n(1),g=n.n(y),v=n(15),O=n.n(v),w=n(13),j=n.n(w),E=n(31),k=n.n(E),T=n(2),R=n(4),_=n(8),S=j()(R.Alert)(r||(r=O()(["\n\tp {\n\t\tmargin: 0;\n\t}\n"]))),x=Object(_.makeOutboundLink)(),C=function(e){var t=Object(T.sprintf)( | |
| 12 | -/* Translators: %s expands to the social medium name, which is either Twitter or Facebook. %s expands to Yoast SEO Premium */ | |
| 13 | -Object(T.__)("Want to see how your content will look when it’s shared on %s?","wordpress-seo"),e.socialMediumName),n=Object(T.sprintf)( | |
| 14 | -/* Translators: %s expands to Yoast SEO Premium */ | |
| 15 | -Object(T.__)("Get %s to unlock social previews!","wordpress-seo"),"Yoast SEO Premium");return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(S,{type:"info"},k()({mixedString:t,components:{strong:Object(b.createElement)("b",null)}}),Object(b.createElement)("br",null),Object(b.createElement)(x,{href:wpseoAdminL10n["shortlinks.upsell.social_previews"]},Object(b.createElement)("p",null,n))))};C.propTypes={socialMediumName:g.a.oneOf(["Twitter","Facebook"]).isRequired};var P=C,I=n(125),A=n(46);var q=function(e){p()(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=f()(t);if(n){var a=f()(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return m()(this,e)});function a(e){var t;return o()(this,a),(t=r.call(this,e)).state={activeField:"",hoveredField:""},t.setHoveredField=t.setHoveredField.bind(u()(t)),t.setActiveField=t.setActiveField.bind(u()(t)),t.setEditorRef=t.setEditorRef.bind(u()(t)),t.setEditorFocus=t.setEditorFocus.bind(u()(t)),t}return s()(a,[{key:"setHoveredField",value:function(e){e!==this.state.hoveredField&&this.setState({hoveredField:e})}},{key:"setActiveField",value:function(e){var t=this;e!==this.state.activeField&&this.setState({activeField:e},(function(){return t.setEditorFocus(e)}))}},{key:"setEditorFocus",value:function(e){switch(e){case"title":this.titleEditorRef.focus();break;case"description":this.descriptionEditorRef.focus()}}},{key:"setEditorRef",value:function(e,t){switch(e){case"title":this.titleEditorRef=t;break;case"description":this.descriptionEditorRef=t}}},{key:"render",value:function(){var e=this.props,t=e.onDescriptionChange,n=e.onTitleChange,r=e.onSelectImageClick,a=e.onRemoveImageClick,o=e.socialMediumName,i=e.imageWarnings,s=e.description,c=e.descriptionInputPlaceholder,u=e.imageUrl,l=e.title,p=e.titleInputPlaceholder,d=e.replacementVariables,m=e.recommendedReplacementVariables,h=e.isPremium,f=e.location;return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(P,{socialMediumName:o}),Object(b.createElement)(I.SocialMetadataPreviewForm,{onDescriptionChange:t,socialMediumName:o,title:l,titleInputPlaceholder:p,onRemoveImageClick:a,imageSelected:!!u,imageUrl:u,onTitleChange:n,onSelectImageClick:r,description:s,descriptionInputPlaceholder:c,imageWarnings:i,replacementVariables:d,recommendedReplacementVariables:m,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:h,setEditorRef:this.setEditorRef,idSuffix:f}))}}]),a}(b.Component);q.propTypes={title:g.a.string.isRequired,onTitleChange:g.a.func.isRequired,description:g.a.string.isRequired,onDescriptionChange:g.a.func.isRequired,imageUrl:g.a.string.isRequired,onSelectImageClick:g.a.func.isRequired,onRemoveImageClick:g.a.func.isRequired,socialMediumName:g.a.string.isRequired,isPremium:g.a.bool,imageWarnings:g.a.array,descriptionInputPlaceholder:g.a.string,titleInputPlaceholder:g.a.string,replacementVariables:A.replacementVariablesShape,recommendedReplacementVariables:A.recommendedReplacementVariablesShape,location:g.a.string},q.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,descriptionInputPlaceholder:"",titleInputPlaceholder:"",location:""},t.a=q},function(e,t,n){"use strict";var r=n(5),a="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=n(64),i=n(90),s=n(91),c="function"==typeof Symbol&&Symbol.iterator;function u(e,t){return e&&"object"==typeof e&&null!=e.key?(n=e.key,r={"=":"=0",":":"=2"},"$"+(""+n).replace(/[=:]/g,(function(e){return r[e]}))):t.toString(36);var n,r}var l=/\/+/g;function p(e){return(""+e).replace(l,"$&/")}var d,m,h=f,f=function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)};function b(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function y(e,t,n){var a,i,s=e.result,c=e.keyPrefix,u=e.func,l=e.context,d=u.call(l,t,e.count++);Array.isArray(d)?g(d,s,n,o.thatReturnsArgument):null!=d&&(r.isValidElement(d)&&(a=d,i=c+(!d.key||t&&t.key===d.key?"":p(d.key)+"/")+n,d=r.cloneElement(a,{key:i},void 0!==a.props?a.props.children:void 0)),s.push(d))}function g(e,t,n,r,o){var s="";null!=n&&(s=p(n)+"/");var l=b.getPooled(t,s,r,o);!function(e,t,n){null==e||function e(t,n,r,o){var s,l=typeof t;if("undefined"!==l&&"boolean"!==l||(t=null),null===t||"string"===l||"number"===l||"object"===l&&t.$$typeof===a)return r(o,t,""===n?"."+u(t,0):n),1;var p=0,d=""===n?".":n+":";if(Array.isArray(t))for(var m=0;m<t.length;m++)p+=e(s=t[m],d+u(s,m),r,o);else{var h=function(e){var t=e&&(c&&e[c]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(h)for(var f,b=h.call(t),y=0;!(f=b.next()).done;)p+=e(s=f.value,d+u(s,y++),r,o);else if("object"===l){var g=""+t;i(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===g?"object with keys {"+Object.keys(t).join(", ")+"}":g,"")}}return p}(e,"",t,n)}(e,y,l),b.release(l)}b.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},d=function(e,t,n,r){if(this.instancePool.length){var a=this.instancePool.pop();return this.call(a,e,t,n,r),a}return new this(e,t,n,r)},(m=b).instancePool=[],m.getPooled=d||h,m.poolSize||(m.poolSize=10),m.release=function(e){i(e instanceof this,"Trying to release an instance into a pool of a different type."),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)},e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return s(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(r.isValidElement(e))return s(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;i(1!==e.nodeType,"React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.");var t=[];for(var n in e)g(e[n],t,n,o.thatReturnsArgument);return t}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,a,o,i,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,a,o,i,s],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){"use strict";var r=n(64);e.exports=r},function(e,t,n){"use strict";function r(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(r)}},function(e,t,n){"use strict";var r=n(0),a=n(2),o=n(31),i=n.n(o),s=n(8),c=Object(s.makeOutboundLink)(),u=Object(s.makeOutboundLink)();t.a=function(){var e=Object(a.sprintf)(Object(a.__)( | |
| 16 | -/* translators: %1$s expands to a link to Wincher, %2$s expands to a link to the keyphrase tracking article on Yoast.com */ | |
| 17 | -"With %1$s you can track the ranking position of your page in the search results based on your keyphrase(s). %2$s","wordpress-seo"),"{{wincherLink/}}","{{wincherReadMoreLink/}}");return Object(r.createElement)("p",null,i()({mixedString:e,components:{wincherLink:Object(r.createElement)(c,{href:wpseoAdminGlobalL10n["links.wincher.website"]},"Wincher"),wincherReadMoreLink:Object(r.createElement)(u,{href:wpseoAdminL10n["shortlinks.wincher.seo_performance"]},Object(a.__)("Read more about keyphrase tracking with Wincher","wordpress-seo"))}}))}},function(e,t,n){"use strict";var r=n(6),a=n(20),o=n(26),i=n.n(o),s=n(15),c=n.n(s),u=n(16),l=n.n(u),p=n(0),d=n(7),m=n.n(d),h=n(2),f=n(1),b=n.n(f),y=n(3),g=n(13),v=n.n(g),O=n(4),w=n(8),j=n(31),E=n.n(j),k=Object(w.makeOutboundLink)(),T=function(e){var t=Object(h.sprintf)( | |
| 18 | -/* translators: %d expands to the amount of allowed keyphrases on a free account, %s expands to a link to Wincher plans. */ | |
| 19 | -Object(h.__)("You've reached the maximum amount of %d keyphrases you can add to your Wincher account. If you wish to add more keyphrases, please %s.","wordpress-seo"),e.limit,"{{updateWincherPlanLink/}}");return Object(p.createElement)(O.Alert,{type:"error"},E()({mixedString:t,components:{updateWincherPlanLink:Object(p.createElement)(k,{href:wpseoAdminGlobalL10n["links.wincher.pricing"]},Object(h.sprintf)( | |
| 20 | -/* translators: %s : Expands to "Wincher". */ | |
| 21 | -Object(h.__)("upgrade your %s plan","wordpress-seo"),"Wincher"))}}))};T.propTypes={limit:b.a.number},T.defaultProps={limit:10};var R,_,S,x=T,C=function(){return Object(p.createElement)(O.Alert,{type:"error"},Object(h.__)("Something went wrong while tracking the ranking position(s) of your page. Please try again later.","wordpress-seo"))},P=function(){return Object(p.createElement)(O.Alert,{type:"success"},Object(h.sprintf)( | |
| 22 | -/* translators: %s: Expands to "Wincher". */ | |
| 23 | -Object(h.__)("You have successfully connected to %s! You can now track the SEO performance for the keyphrase(s) of this page.","wordpress-seo"),"Wincher"))},I=function(){return Object(p.createElement)(O.Alert,{type:"info"},Object(h.sprintf)( | |
| 24 | -/* translators: %s: Expands to "Wincher". */ | |
| 25 | -Object(h.__)("%s is currently tracking the ranking position(s) of your page. This may take a few minutes. Please wait or check back later.","wordpress-seo"),"Wincher"))},A=n(24),q=n.n(A),L=n(29),D=n.n(L),F=n(83),N=n(32),M=Object(w.makeOutboundLink)(),B=v.a.span(R||(R=c()(["\n\tdisplay: block;\n\tfont-style: italic;\n\n\t@media (min-width: 782px) {\n\t\tdisplay: inline;\n\t\tposition: absolute;\n\t\t",": 8px;\n\t}\n"])),Object(w.getDirectionalStyle)("right","left")),K=v.a.th(_||(_=c()(["\n\tmin-width: 60px;\n"]))),H=v.a.div(S||(S=c()(["\n\twidth: 100%;\n\toverflow-y: auto;\n"]))),W=function(e){var t=Object(p.useRef)();return Object(p.useEffect)((function(){t.current=e})),t.current},U=Object(y.debounce)(N.c,500,{leading:!0}),V=function(e){var t=e.addTrackedKeyphrase,n=e.isLoggedIn,r=e.keyphrases,a=e.permalink,o=e.removeTrackedKeyphrase,i=e.setKeyphraseLimitReached,s=e.setRequestFailed,c=e.setRequestSucceeded,u=e.setTrackedKeyphrases,d=e.setHasTrackedAll,f=e.trackAll,b=e.trackedKeyphrases,g=e.isNewlyAuthenticated,v=e.websiteId,O=e.focusKeyphrase,w=e.newRequest,j=Object(p.useRef)(),E=Object(p.useRef)(),k=Object(p.useRef)(!1),T=Object(p.useState)([]),R=D()(T,2),_=R[0],S=R[1],x=Object(p.useCallback)((function(e){var t=e.toLowerCase();return b&&!Object(y.isEmpty)(b)&&b.hasOwnProperty(t)?b[t]:null}),[b]),C=Object(p.useMemo)((function(){return l()(m.a.mark((function e(){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(N.d)((function(){return E.current&&E.current.abort(),E.current="undefined"==typeof AbortController?null:new AbortController,U(r,a,E.current.signal)}),(function(e){c(e),u(e.results)}),(function(e){s(e)}));case 2:case"end":return e.stop()}}),e)})))}),[c,s,u,r,a]),P=Object(p.useCallback)(function(){var e=l()(m.a.mark((function e(n){var r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(Array.isArray(n)?n:[n]).map((function(e){return e.toLowerCase()})),S((function(e){return[].concat(q()(e),q()(r))})),e.next=4,Object(N.d)((function(){return Object(N.e)(r)}),(function(e){c(e),t(e.results),C()}),(function(e){400===e.status&&e.limit&&i(e.limit),s(e)}),201);case 4:S((function(e){return y.without.apply(void 0,[e].concat(q()(r)))}));case 5:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}(),[c,s,i,t,C]),I=Object(p.useCallback)(function(){var e=l()(m.a.mark((function e(t,n){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=t.toLowerCase(),S((function(e){return[].concat(q()(e),[t])})),e.next=4,Object(N.d)((function(){return Object(N.f)(n)}),(function(e){c(e),o(t)}),(function(e){s(e)}));case 4:S((function(e){return Object(y.without)(e,t)}));case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),[c,o,s]),A=Object(p.useCallback)(function(){var e=l()(m.a.mark((function e(t){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(),e.next=3,P(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[w,P]),L=W(a),V=W(r);Object(p.useEffect)((function(){n&&a&&(a!==L||Object(y.difference)(r,V).length)&&C()}),[n,a,L,r,V,C]),Object(p.useEffect)((function(){if(n&&f&&null!==b){var e=r.filter((function(e){return!x(e)}));e.length&&P(e),d()}}),[n,f,b,P,d,x,r]),Object(p.useEffect)((function(){g&&!k.current&&(C(),k.current=!0)}),[g,C]),Object(p.useEffect)((function(){if(n&&!Object(y.isEmpty)(b))return Object(y.filter)(b,(function(e){return Object(y.isEmpty)(e.updated_at)})).length>0&&(j.current=setInterval((function(){C()}),1e4)),function(){clearInterval(j.current)}}),[n,b,C]);var Y=n&&null===b;return r&&!Object(y.isEmpty)(r)&&Object(p.createElement)(p.Fragment,null,Object(p.createElement)(H,null,Object(p.createElement)("table",{className:"yoast yoast-table"},Object(p.createElement)("thead",null,Object(p.createElement)("tr",null,Object(p.createElement)("th",{scope:"col",abbr:Object(h.__)("Tracking","wordpress-seo")},Object(h.__)("Tracking","wordpress-seo")),Object(p.createElement)("th",{scope:"col",abbr:Object(h.__)("Keyphrase","wordpress-seo")},Object(h.__)("Keyphrase","wordpress-seo")),Object(p.createElement)("th",{scope:"col",abbr:Object(h.__)("Position","wordpress-seo")},Object(h.__)("Position","wordpress-seo")),Object(p.createElement)("th",{scope:"col",abbr:Object(h.__)("Position over time","wordpress-seo")},Object(h.__)("Position over time","wordpress-seo")),Object(p.createElement)(K,{className:"yoast-table--nobreak"}))),Object(p.createElement)("tbody",null,r.map((function(e,t){return Object(p.createElement)(F.b,{key:"trackable-keyphrase-".concat(t),keyphrase:e,onTrackKeyphrase:A,onUntrackKeyphrase:I,rowData:x(e),isFocusKeyphrase:e===O.trim(),websiteId:v,isDisabled:!n,isLoading:Y||_.indexOf(e.toLowerCase())>=0})}))))),Object(p.createElement)("p",{style:{marginBottom:0,position:"relative"}},Object(p.createElement)(M,{href:wpseoAdminGlobalL10n["links.wincher.login"]},Object(h.sprintf)( | |
| 26 | -/* translators: %s expands to Wincher */ | |
| 27 | -Object(h.__)("Get more insights over at %s","wordpress-seo"),"Wincher")),Object(p.createElement)(B,null,Object(h.__)("* focus keyphrase","wordpress-seo"))))};V.propTypes={addTrackedKeyphrase:b.a.func.isRequired,isLoggedIn:b.a.bool,isNewlyAuthenticated:b.a.bool,keyphrases:b.a.array,newRequest:b.a.func.isRequired,removeTrackedKeyphrase:b.a.func.isRequired,setRequestFailed:b.a.func.isRequired,setKeyphraseLimitReached:b.a.func.isRequired,setRequestSucceeded:b.a.func.isRequired,setTrackedKeyphrases:b.a.func.isRequired,setHasTrackedAll:b.a.func.isRequired,trackAll:b.a.bool,trackedKeyphrases:b.a.object,websiteId:b.a.string,permalink:b.a.string.isRequired,focusKeyphrase:b.a.string},V.defaultProps={isLoggedIn:!1,isNewlyAuthenticated:!1,keyphrases:[],trackAll:!1,trackedKeyphrases:null,websiteId:"",focusKeyphrase:""};var Y,G,z,$=V,Z=Object(a.compose)([Object(r.withSelect)((function(e){var t=e("yoast-seo/editor"),n=t.getWincherWebsiteId,r=t.getWincherTrackedKeyphrases,a=t.getWincherTrackableKeyphrases,o=t.getWincherLoginStatus,i=t.getWincherPermalink,s=t.getFocusKeyphrase,c=t.isWincherNewlyAuthenticated,u=t.shouldWincherTrackAll;return{focusKeyphrase:s(),keyphrases:a(),trackedKeyphrases:r(),isLoggedIn:o(),trackAll:u(),websiteId:n(),isNewlyAuthenticated:c(),permalink:i()}})),Object(r.withDispatch)((function(e){var t=e("yoast-seo/editor"),n=t.setWincherNewRequest,r=t.setWincherRequestSucceeded,a=t.setWincherRequestFailed,o=t.setWincherSetKeyphraseLimitReached,i=t.setWincherTrackedKeyphrases,s=t.setWincherTrackingForKeyphrase,c=t.setWincherTrackAllKeyphrases,u=t.unsetWincherTrackingForKeyphrase;return{newRequest:function(){n()},setRequestSucceeded:function(e){r(e)},setRequestFailed:function(e){a(e)},setKeyphraseLimitReached:function(e){o(e)},addTrackedKeyphrase:function(e){s(e)},removeTrackedKeyphrase:function(e){u(e)},setTrackedKeyphrases:function(e){i(e)},setHasTrackedAll:function(){c(!1)}}}))])($),J=n(93),X=function(){return Object(p.createElement)(O.Alert,{type:"error"},Object(h.__)("No keyphrase has been set. Please set a keyphrase first.","wordpress-seo"))},Q=function(){return Object(p.createElement)(O.Alert,{type:"info"},Object(h.sprintf)( | |
| 28 | -/* translators: %s: Expands to "Wincher". */ | |
| 29 | -Object(h.__)("Automatic tracking of keyphrases is enabled. Your keyphrase(s) will automatically be tracked by %s when you publish your post.","wordpress-seo"),"Wincher"))},ee=n(85),te=n(86),ne=function(){return Object(p.createElement)(O.Alert,{type:"error"},Object(h.__)("Before you can track your SEO performance make sure to set either the post’s title and save it as a draft or manually set the post’s slug.","wordpress-seo"))},re=function(e){var t=e.response,n=e.onLogin;return 403===t.status||404===t.status?Object(p.createElement)(te.a,{onReconnect:n}):Object(p.createElement)(C,null)};re.propTypes={response:b.a.object.isRequired,onLogin:b.a.func.isRequired};var ae=function(e){var t=e.isSuccess,n=e.response,r=e.allKeyphrasesMissRanking,a=e.onLogin,o=e.keyphraseLimitReached,i=e.limit;return o?Object(p.createElement)(x,{limit:i}):Object(y.isEmpty)(n)||t?r?Object(p.createElement)(I,null):null:Object(p.createElement)(re,{response:n,onLogin:a})};ae.propTypes={isSuccess:b.a.bool.isRequired,allKeyphrasesMissRanking:b.a.bool.isRequired,response:b.a.object,onLogin:b.a.func.isRequired,keyphraseLimitReached:b.a.bool.isRequired,limit:b.a.number.isRequired},ae.defaultProps={response:{}};var oe=null,ie=function(){var e=l()(m.a.mark((function e(t,n){var r,a,o;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.onAuthentication,a=t.setRequestSucceeded,o=t.setRequestFailed,e.next=3,Object(N.d)((function(){return Object(N.a)(n)}),function(){var e=l()(m.a.mark((function e(t){var o;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r(!0,!0,n.websiteId.toString()),a(t),(o=oe.getPopup())&&o.close();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),function(){var e=l()(m.a.mark((function e(t){return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 3:case"end":return e.stop()}}),e)})));return function(_x,t){return e.apply(this,arguments)}}(),se=function(){var e=l()(m.a.mark((function e(t){var n,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!oe||oe.isClosed()){e.next=3;break}return oe.focus(),e.abrupt("return");case 3:return e.next=5,Object(N.b)();case 5:n=e.sent,r=n.url,(oe=new ee.a(r,{success:{type:"wincher:oauth:success",callback:function(e){return ie(t,e)}},error:{type:"wincher:oauth:error",callback:function(){return t.onAuthentication(!1,!1)}}},{title:"Wincher_login",width:500,height:700})).createPopup();case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ce=function(e){return e.isLoggedIn?null:Object(p.createElement)("p",null,Object(p.createElement)(O.NewButton,{onClick:e.onLogin,variant:"primary"},Object(h.sprintf)( | |
| 30 | -/* translators: %s expands to Wincher */ | |
| 31 | -Object(h.__)("Connect with %s","wordpress-seo"),"Wincher")))};ce.propTypes={isLoggedIn:b.a.bool.isRequired,onLogin:b.a.func.isRequired};var ue=v.a.div(Y||(Y=c()(["\n\tp {\n\t\tmargin: 1em 0;\n\t}\n"]))),le=v.a.div(G||(G=c()(["\n\t",";\n"])),(function(e){return e.isDisabled&&"\n\t\topacity: .5;\n\t\tpointer-events: none;\n\t"})),pe=v.a.div(z||(z=c()(["\n\tfont-weight: var(--yoast-font-weight-bold);\n\tcolor: var(--yoast-color-label);\n\tfont-size: var(--yoast-font-size-default);\n"]))),de=function(e){var t=e.isLoggedIn,n=e.keyphrases,r=e.shouldTrackAll;return!e.permalink&&t?Object(p.createElement)(ne,null):0===n.length?Object(p.createElement)(X,null):Object(p.createElement)(le,{isDisabled:!t},Object(p.createElement)("p",null,Object(h.__)("You can enable / disable tracking the SEO performance for each keyphrase below.","wordpress-seo")),t&&r&&Object(p.createElement)(Q,null),Object(p.createElement)(Z,null))};function me(e){var t=e.isNewlyAuthenticated,n=e.isLoggedIn,r=Object(p.useCallback)((function(){se(e)}),[se,e]);return Object(p.createElement)(ue,null,t&&Object(p.createElement)(P,null),Object(p.createElement)(pe,null,Object(h.__)("SEO performance","wordpress-seo"),Object(p.createElement)(O.HelpIcon,{linkTo:wpseoAdminL10n["shortlinks.wincher.seo_performance"],linkText:Object(h.__)("Learn more about the SEO performance feature.","wordpress-seo")})),Object(p.createElement)(J.a,null),Object(p.createElement)(ce,{isLoggedIn:n,onLogin:r}),Object(p.createElement)(ae,i()({},e,{onLogin:r})),Object(p.createElement)(de,e))}de.propTypes={keyphrases:b.a.array.isRequired,isLoggedIn:b.a.bool.isRequired,shouldTrackAll:b.a.bool.isRequired,permalink:b.a.string.isRequired},me.propTypes={isLoggedIn:b.a.bool,isNewlyAuthenticated:b.a.bool,keyphrases:b.a.array,response:b.a.object,shouldTrackAll:b.a.bool,permalink:b.a.string},me.defaultProps={isLoggedIn:!1,isNewlyAuthenticated:!1,keyphrases:[],response:{},shouldTrackAll:!1,permalink:""},t.a=Object(a.compose)([Object(r.withSelect)((function(e){var t=e("yoast-seo/editor"),n=t.isWincherNewlyAuthenticated,r=t.getWincherKeyphraseLimitReached,a=t.getWincherLimit,o=t.getWincherLoginStatus,i=t.getWincherRequestIsSuccess,s=t.getWincherRequestResponse,c=t.getWincherTrackableKeyphrases,u=t.getWincherAllKeyphrasesMissRanking,l=t.getWincherPermalink,p=t.shouldWincherAutomaticallyTrackAll;return{keyphrases:c(),allKeyphrasesMissRanking:u(),isLoggedIn:o(),isNewlyAuthenticated:n(),isSuccess:i(),keyphraseLimitReached:r(),limit:a(),response:s(),shouldTrackAll:p(),permalink:l()}})),Object(r.withDispatch)((function(e){var t=e("yoast-seo/editor"),n=t.setWincherWebsiteId,r=t.setWincherRequestSucceeded,a=t.setWincherRequestFailed,o=t.setWincherLoginStatus;return{setRequestSucceeded:function(e){r(e)},setRequestFailed:function(e){a(e)},onAuthentication:function(e,t,r){n(r),o(e,t)}}}))])(me)},,,,,,,,,,,function(e,t,n){"use strict";var r,a=n(15),o=n.n(a),i=n(0),s=n(1),c=n.n(s),u=n(13),l=n.n(u),p=n(4),d=n(8),m=l()(p.StyledSection)(r||(r=o()(["\n\t&"," {\n\t\tpadding: 0;\n\n\t\t& "," {\n\t\t\t",": 20px;\n\t\t\tmargin-left: ",";\n\t\t}\n\t}\n"])),p.StyledSectionBase,p.StyledHeading,Object(d.getDirectionalStyle)("padding-left","padding-right"),Object(d.getDirectionalStyle)("0","20px")),h=function(e){var t=e.children,n=e.title,r=e.icon,a=e.hasPaperStyle,o=e.shoppingData;return Object(i.createElement)(m,{headingLevel:3,headingText:n,headingIcon:r,headingIconColor:"#555",hasPaperStyle:a,shoppingData:o},t)};h.propTypes={children:c.a.element,title:c.a.string,icon:c.a.string,hasPaperStyle:c.a.bool,shoppingData:c.a.object},h.defaultProps={hasPaperStyle:!0,shoppingData:null},t.a=h},function(e,t){e.exports=window.wp.sanitize},,function(e,t,n){"use strict";var r=n(6),a=n(20),o=n(0),i=n(2),s=n(1),c=n.n(s),u=n(3),l=n(4),p=function(){return Object(o.createElement)("p",{className:"yoast-related-keyphrases-modal__loading-message"},Object(i.sprintf)( | |
| 32 | -/* translators: %1$s expands to "Yoast SEO", %2$s expands to "Semrush". */ | |
| 33 | -Object(i.__)("Please wait while %1$s connects to %2$s to get related keyphrases...","wordpress-seo"),"Yoast SEO","Semrush")," ",Object(o.createElement)(l.SvgIcon,{icon:"loading-spinner"}))},d=n(8),m=Object(d.makeOutboundLink)(),h=function(){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("p",null,Object(i.sprintf)( | |
| 34 | -/* translators: %s : Expands to "Semrush". */ | |
| 35 | -Object(i.__)("You've reached your request limit for today. Check back tomorrow or upgrade your plan over at %s.","wordpress-seo"),"Semrush")),Object(o.createElement)(m,{href:window.wpseoAdminL10n["shortlinks.semrush.prices"],className:"yoast-button-upsell"},Object(i.sprintf)( | |
| 36 | -/* translators: %s : Expands to "Semrush". */ | |
| 37 | -Object(i.__)("Upgrade your %s plan","wordpress-seo"),"Semrush"),Object(o.createElement)("span",{"aria-hidden":"true",className:"yoast-button-upsell__caret"})))},f=n(16),b=n.n(f),y=n(9),g=n.n(y),v=n(10),O=n.n(v),w=n(12),j=n.n(w),E=n(18),k=n.n(E),T=n(19),R=n.n(T),_=n(11),S=n.n(_),x=n(7),C=n.n(x),P=n(36),I=n.n(P),A=n(39);var q="yoast-semrush-country-selector",L=[{value:"us",name:"United States - US"},{value:"uk",name:"United Kingdom - UK"},{value:"ca",name:"Canada - CA"},{value:"ru",name:"Russia - RU"},{value:"de",name:"Germany - DE"},{value:"fr",name:"France - FR"},{value:"es",name:"Spain - ES"},{value:"it",name:"Italy - IT"},{value:"br",name:"Brazil - BR"},{value:"au",name:"Australia - AU"},{value:"ar",name:"Argentina - AR"},{value:"be",name:"Belgium - BE"},{value:"ch",name:"Switzerland - CH"},{value:"dk",name:"Denmark - DK"},{value:"fi",name:"Finland - FI"},{value:"hk",name:"Hong Kong - HK"},{value:"ie",name:"Ireland - IE"},{value:"il",name:"Israel - IL"},{value:"mx",name:"Mexico - MX"},{value:"nl",name:"Netherlands - NL"},{value:"no",name:"Norway - NO"},{value:"pl",name:"Poland - PL"},{value:"se",name:"Sweden - SE"},{value:"sg",name:"Singapore - SG"},{value:"tr",name:"Turkey - TR"},{value:"jp",name:"Japan - JP"},{value:"in",name:"India - IN"},{value:"hu",name:"Hungary - HU"},{value:"af",name:"Afghanistan - AF"},{value:"al",name:"Albania - AL"},{value:"dz",name:"Algeria - DZ"},{value:"ao",name:"Angola - AO"},{value:"am",name:"Armenia - AM"},{value:"at",name:"Austria - AT"},{value:"az",name:"Azerbaijan - AZ"},{value:"bh",name:"Bahrain - BH"},{value:"bd",name:"Bangladesh - BD"},{value:"by",name:"Belarus - BY"},{value:"bz",name:"Belize - BZ"},{value:"bo",name:"Bolivia - BO"},{value:"ba",name:"Bosnia and Herzegovina - BA"},{value:"bw",name:"Botswana - BW"},{value:"bn",name:"Brunei - BN"},{value:"bg",name:"Bulgaria - BG"},{value:"cv",name:"Cabo Verde - CV"},{value:"kh",name:"Cambodia - KH"},{value:"cm",name:"Cameroon - CM"},{value:"cl",name:"Chile - CL"},{value:"co",name:"Colombia - CO"},{value:"cr",name:"Costa Rica - CR"},{value:"hr",name:"Croatia - HR"},{value:"cy",name:"Cyprus - CY"},{value:"cz",name:"Czech Republic - CZ"},{value:"cd",name:"Congo - CD"},{value:"do",name:"Dominican Republic - DO"},{value:"ec",name:"Ecuador - EC"},{value:"eg",name:"Egypt - EG"},{value:"sv",name:"El Salvador - SV"},{value:"ee",name:"Estonia - EE"},{value:"et",name:"Ethiopia - ET"},{value:"ge",name:"Georgia - GE"},{value:"gh",name:"Ghana - GH"},{value:"gr",name:"Greece - GR"},{value:"gt",name:"Guatemala - GT"},{value:"gy",name:"Guyana - GY"},{value:"ht",name:"Haiti - HT"},{value:"hn",name:"Honduras - HN"},{value:"is",name:"Iceland - IS"},{value:"id",name:"Indonesia - ID"},{value:"jm",name:"Jamaica - JM"},{value:"jo",name:"Jordan - JO"},{value:"kz",name:"Kazakhstan - KZ"},{value:"kw",name:"Kuwait - KW"},{value:"lv",name:"Latvia - LV"},{value:"lb",name:"Lebanon - LB"},{value:"lt",name:"Lithuania - LT"},{value:"lu",name:"Luxembourg - LU"},{value:"mg",name:"Madagascar - MG"},{value:"my",name:"Malaysia - MY"},{value:"mt",name:"Malta - MT"},{value:"mu",name:"Mauritius - MU"},{value:"md",name:"Moldova - MD"},{value:"mn",name:"Mongolia - MN"},{value:"me",name:"Montenegro - ME"},{value:"ma",name:"Morocco - MA"},{value:"mz",name:"Mozambique - MZ"},{value:"na",name:"Namibia - NA"},{value:"np",name:"Nepal - NP"},{value:"nz",name:"New Zealand - NZ"},{value:"ni",name:"Nicaragua - NI"},{value:"ng",name:"Nigeria - NG"},{value:"om",name:"Oman - OM"},{value:"py",name:"Paraguay - PY"},{value:"pe",name:"Peru - PE"},{value:"ph",name:"Philippines - PH"},{value:"pt",name:"Portugal - PT"},{value:"ro",name:"Romania - RO"},{value:"sa",name:"Saudi Arabia - SA"},{value:"sn",name:"Senegal - SN"},{value:"rs",name:"Serbia - RS"},{value:"sk",name:"Slovakia - SK"},{value:"si",name:"Slovenia - SI"},{value:"za",name:"South Africa - ZA"},{value:"kr",name:"South Korea - KR"},{value:"lk",name:"Sri Lanka - LK"},{value:"th",name:"Thailand - TH"},{value:"bs",name:"Bahamas - BS"},{value:"tt",name:"Trinidad and Tobago - TT"},{value:"tn",name:"Tunisia - TN"},{value:"ua",name:"Ukraine - UA"},{value:"ae",name:"United Arab Emirates - AE"},{value:"uy",name:"Uruguay - UY"},{value:"ve",name:"Venezuela - VE"},{value:"vn",name:"Vietnam - VN"},{value:"zm",name:"Zambia - ZM"},{value:"zw",name:"Zimbabwe - ZW"},{value:"ly",name:"Libya - LY"}],D=function(e){k()(c,e);var t,n,r,a,s=(r=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=S()(r);if(a){var n=S()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return R()(this,e)});function c(e){var t;return g()(this,c),(t=s.call(this,e)).relatedKeyphrasesRequest=t.relatedKeyphrasesRequest.bind(j()(t)),t.onChangeHandler=t.onChangeHandler.bind(j()(t)),t}return O()(c,[{key:"componentDidMount",value:function(){this.props.response&&this.props.keyphrase===this.props.lastRequestKeyphrase||this.relatedKeyphrasesRequest()}},{key:"storeCountryCode",value:function(e){I()({path:"yoast/v1/semrush/country_code",method:"POST",data:{country_code:e}})}},{key:"relatedKeyphrasesRequest",value:(n=b()(C.a.mark((function e(){var t,n,r,a;return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,n=t.keyphrase,r=t.countryCode,(0,t.newRequest)(r,n),this.storeCountryCode(r),e.next=5,this.doRequest(n,r);case 5:if(200!==(a=e.sent).status){e.next=9;break}return this.handleSuccessResponse(a),e.abrupt("return");case 9:this.handleFailedResponse(a);case 10:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"handleSuccessResponse",value:function(e){var t=this.props,n=t.setNoResultsFound,r=t.setRequestSucceeded;0!==e.results.rows.length?r(e):n()}},{key:"handleFailedResponse",value:function(e){var t=this.props,n=t.setRequestLimitReached,r=t.setRequestFailed;"error"in e&&(e.error.includes("TOTAL LIMIT EXCEEDED")?n():r(e))}},{key:"doRequest",value:(t=b()(C.a.mark((function e(t,n){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I()({path:Object(A.addQueryArgs)("/yoast/v1/semrush/related_keyphrases",{keyphrase:t,country_code:n})});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(_x,e){return t.apply(this,arguments)})},{key:"onChangeHandler",value:function(e){this.props.setCountry(e)}},{key:"render",value:function(){return Object(o.createElement)("div",{id:q},Object(o.createElement)(l.SingleSelect,{id:q+"-select",label:Object(i.__)("Show results for:","wordpress-seo"),name:"semrush-country-code",options:L,selected:this.props.countryCode,onChange:this.onChangeHandler,wrapperClassName:"yoast-field-group yoast-field-group--inline"}),Object(o.createElement)(l.NewButton,{id:q+"-button",variant:"secondary",onClick:this.relatedKeyphrasesRequest},Object(i.__)("Select country","wordpress-seo")))}}]),c}(o.Component);D.propTypes={keyphrase:c.a.string,countryCode:c.a.string,response:c.a.object,lastRequestKeyphrase:c.a.string,setCountry:c.a.func.isRequired,newRequest:c.a.func.isRequired,setNoResultsFound:c.a.func.isRequired,setRequestSucceeded:c.a.func.isRequired,setRequestLimitReached:c.a.func.isRequired,setRequestFailed:c.a.func.isRequired},D.defaultProps={keyphrase:"",countryCode:"us",response:{},lastRequestKeyphrase:""};var F=D,N=n(57),M=n(52);var B=Object(d.makeOutboundLink)(),K=function(e){k()(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=S()(t);if(n){var a=S()(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return R()(this,e)});function a(e){var t;return g()(this,a),(t=r.call(this,e)).transformTrendDataToChartPoints=t.transformTrendDataToChartPoints.bind(j()(t)),t.getAreaChartDataTableHeaderLabels=t.getAreaChartDataTableHeaderLabels.bind(j()(t)),t.mapAreaChartDataToTableData=t.mapAreaChartDataToTableData.bind(j()(t)),t}return O()(a,[{key:"transformTrendDataToChartPoints",value:function(e){return e.split(",").map((function(e,t){return{x:t,y:parseFloat(e)}}))}},{key:"getAreaChartDataTableHeaderLabels",value:function(){return[Object(i.__)("Twelve months ago","wordpress-seo"),Object(i.__)("Eleven months ago","wordpress-seo"),Object(i.__)("Ten months ago","wordpress-seo"),Object(i.__)("Nine months ago","wordpress-seo"),Object(i.__)("Eight months ago","wordpress-seo"),Object(i.__)("Seven months ago","wordpress-seo"),Object(i.__)("Six months ago","wordpress-seo"),Object(i.__)("Five months ago","wordpress-seo"),Object(i.__)("Four months ago","wordpress-seo"),Object(i.__)("Three months ago","wordpress-seo"),Object(i.__)("Two months ago","wordpress-seo"),Object(i.__)("Last month","wordpress-seo")]}},{key:"mapAreaChartDataToTableData",value:function(e){return Math.round(100*e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.keyphrase,r=t.relatedKeyphrases,a=t.countryCode,s=t.data,c=t.renderAction,l="https://www.semrush.com/analytics/keywordoverview/?q="+encodeURIComponent(n)+"&db="+encodeURIComponent(a);return s&&!Object(u.isEmpty)(s.results)&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)("table",{className:"yoast yoast-table"},Object(o.createElement)("thead",null,Object(o.createElement)("tr",null,Object(o.createElement)("th",{scope:"col",className:"yoast-table--primary"},Object(i.__)("Related keyphrase","wordpress-seo")),Object(o.createElement)("th",{scope:"col",abbr:Object(i.__)("Volume","wordpress-seo")},Object(i.__)("Volume","wordpress-seo"),Object(o.createElement)(M.a,{href:window.wpseoAdminL10n["shortlinks.semrush.volume_help"],className:"dashicons"},Object(o.createElement)("span",{className:"screen-reader-text"},Object(i.__)("Learn more about the related keyphrases volume","wordpress-seo")))),Object(o.createElement)("th",{scope:"col",abbr:Object(i.__)("Trend","wordpress-seo")},Object(i.__)("Trend","wordpress-seo"),Object(o.createElement)(M.a,{href:window.wpseoAdminL10n["shortlinks.semrush.trend_help"],className:"dashicons"},Object(o.createElement)("span",{className:"screen-reader-text"},Object(i.__)("Learn more about the related keyphrases trend","wordpress-seo")))),c&&Object(o.createElement)("td",{className:"yoast-table--nobreak"}))),Object(o.createElement)("tbody",null,s.results.rows.map((function(t,n){var a=t[0],s=e.transformTrendDataToChartPoints(t[2]),u=e.getAreaChartDataTableHeaderLabels();return Object(o.createElement)("tr",{key:n},Object(o.createElement)("td",null,a),Object(o.createElement)("td",null,t[1]),Object(o.createElement)("td",{className:"yoast-table--nopadding"},Object(o.createElement)(N.a,{width:66,height:24,data:s,strokeWidth:1.8,strokeColor:"#498afc",fillColor:"#ade3fc",className:"yoast-related-keyphrases-modal__chart",mapChartDataToTableData:e.mapAreaChartDataToTableData,dataTableCaption:Object(i.__)("Keyphrase volume in the last 12 months on a scale from 0 to 100.","wordpress-seo"),dataTableHeaderLabels:u})),c&&Object(o.createElement)("td",{className:"yoast-table--nobreak"},c(a,r)))})))),Object(o.createElement)("p",{style:{marginBottom:0}},Object(o.createElement)(B,{href:l},Object(i.sprintf)( | |
| 38 | -/* translators: %s expands to Semrush */ | |
| 39 | -Object(i.__)("Get more insights at %s","wordpress-seo"),"Semrush"))))}}]),a}(o.Component);K.propTypes={data:c.a.object,keyphrase:c.a.string,relatedKeyphrases:c.a.array,countryCode:c.a.string,renderAction:c.a.func},K.defaultProps={data:{},keyphrase:"",relatedKeyphrases:[],countryCode:"us",renderAction:null};var H=K,W=Object(d.makeOutboundLink)(),U=function(){return Object(o.createElement)(l.Alert,{type:"info"},Object(i.sprintf)( | |
| 40 | -/* translators: %s: Expands to "Yoast SEO". */ | |
| 41 | -Object(i.__)("Would you like to be able to add these related keyphrases to the %s analysis so you can optimize your content even further?","wordpress-seo"),"Yoast SEO")+" ",Object(o.createElement)(W,{href:window.wpseoAdminL10n["shortlinks.semrush.premium_landing_page"]},Object(i.sprintf)( | |
| 42 | -/* translators: %s: Expands to "Yoast SEO Premium". */ | |
| 43 | -Object(i.__)("Check out %s!","wordpress-seo"),"Yoast SEO Premium")))},V=function(){return Object(o.createElement)(l.Alert,{type:"error"},Object(i.__)("We've encountered a problem trying to get related keyphrases. Please try again later.","wordpress-seo"))},Y=function(){return Object(o.createElement)(l.Alert,{type:"warning"},Object(i.sprintf)( | |
| 44 | -/* translators: %s: Expands to "Yoast SEO". */ | |
| 45 | -Object(i.__)("You've reached the maximum amount of 4 related keyphrases. You can change or remove related keyphrases in the %s metabox or sidebar.","wordpress-seo"),"Yoast SEO"))},G=n(23);function z(e){var t=e.response,n=e.lastRequestKeyphrase,r=e.keyphrase,a=e.newRequest,s=e.setCountry,c=e.renderAction,l=e.countryCode,d=e.requestLimitReached,m=e.setRequestFailed,f=e.setNoResultsFound,b=e.relatedKeyphrases,y=e.setRequestSucceeded,g=e.setRequestLimitReached,v=Object(G.a)().isPremium;return Object(o.createElement)(o.Fragment,null,!d&&Object(o.createElement)(o.Fragment,null,!v&&Object(o.createElement)(U,null),v&&function(e){return e&&e.length>=4}(b)&&Object(o.createElement)(Y,null),Object(o.createElement)(F,{countryCode:l,setCountry:s,newRequest:a,keyphrase:r,setRequestFailed:m,setNoResultsFound:f,setRequestSucceeded:y,setRequestLimitReached:g,response:t,lastRequestKeyphrase:n})),function(e){var t=e.isPending,n=e.requestLimitReached,r=e.isSuccess,a=e.response,s=e.requestHasData;return t?Object(o.createElement)(p,null):n?Object(o.createElement)(h,null):!r&&function(e){return!Object(u.isEmpty)(e)&&"error"in e}(a)?Object(o.createElement)(V,null):s?void 0:Object(o.createElement)("p",null,Object(i.__)("Sorry, there's no data available for that keyphrase/country combination.","wordpress-seo"))}(e),Object(o.createElement)(H,{keyphrase:r,relatedKeyphrases:b,countryCode:l,renderAction:c,data:t}))}z.propTypes={keyphrase:c.a.string,relatedKeyphrases:c.a.array,renderAction:c.a.func,requestLimitReached:c.a.bool,countryCode:c.a.string.isRequired,setCountry:c.a.func.isRequired,newRequest:c.a.func.isRequired,setRequestSucceeded:c.a.func.isRequired,setRequestLimitReached:c.a.func.isRequired,setRequestFailed:c.a.func.isRequired,setNoResultsFound:c.a.func.isRequired,response:c.a.object,lastRequestKeyphrase:c.a.string},z.defaultProps={keyphrase:"",relatedKeyphrases:[],renderAction:null,requestLimitReached:!1,response:{},lastRequestKeyphrase:""},t.a=Object(a.compose)([Object(r.withSelect)((function(e){var t=e("yoast-seo/editor"),n=t.getFocusKeyphrase,r=t.getSEMrushSelectedCountry,a=t.getSEMrushRequestLimitReached,o=t.getSEMrushRequestResponse,i=t.getSEMrushRequestIsSuccess,s=t.getSEMrushIsRequestPending,c=t.getSEMrushRequestHasData,u=t.getSEMrushRequestKeyphrase;return{keyphrase:n(),countryCode:r(),requestLimitReached:a(),response:o(),isSuccess:i(),isPending:s(),requestHasData:c(),lastRequestKeyphrase:u()}})),Object(r.withDispatch)((function(e){var t=e("yoast-seo/editor"),n=t.setSEMrushChangeCountry,r=t.setSEMrushNewRequest,a=t.setSEMrushRequestSucceeded,o=t.setSEMrushRequestFailed,i=t.setSEMrushSetRequestLimitReached,s=t.setSEMrushNoResultsFound;return{setCountry:function(e){n(e)},newRequest:function(e,t){r(e,t)},setRequestSucceeded:function(e){a(e)},setRequestFailed:function(e){o(e)},setRequestLimitReached:function(){i()},setNoResultsFound:function(){s()}}}))])(z)},,,,,function(e,t,n){"use strict";var r=n(20),a=n(6),o=n(54),i=n(44);t.a=Object(r.compose)([Object(a.withSelect)((function(e){return{isCornerstone:(0,e("yoast-seo/editor").isCornerstoneContent)(),learnMoreUrl:wpseoAdminL10n["shortlinks.cornerstone_content_info"]}})),Object(a.withDispatch)((function(e){return{onChange:e("yoast-seo/editor").toggleCornerstoneContent}})),Object(i.a)()])(o.CollapsibleCornerstone)},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3);function a(e){return void 0===e.length?e:Object(r.flatten)(e).sort((function(e,t){return void 0===e.props.renderPriority?1:e.props.renderPriority-t.props.renderPriority}))}},,function(e,t,n){"use strict";var r=n(9),a=n.n(r),o=n(10),i=n.n(o),s=n(3),c=function(){function e(){a()(this,e)}return i()(e,[{key:"listen",value:function(e){this.classicEditorContainer=document.getElementById("et_pb_main_editor_wrap"),this.classicEditorContainer&&new MutationObserver((function(t){Object(s.forEach)(t,(function(t){"attributes"===t.type&&"class"===t.attributeName&&(t.target.classList.contains("et_pb_hidden")?e.classicEditorHidden():e.classicEditorShown())}))})).observe(this.classicEditorContainer,{attributes:!0})}}],[{key:"isActive",value:function(){return!!document.getElementById("et_pb_main_editor_wrap")}},{key:"isTinyMCEHidden",value:function(){var e=document.getElementById("et_pb_main_editor_wrap");return!!e&&e.classList.contains("et_pb_hidden")}}]),e}(),u=function(){function e(){a()(this,e)}return i()(e,null,[{key:"isActive",value:function(){return!!window.VCV_I18N}}]),e}(),l={classicEditorHidden:s.noop,classicEditorShown:s.noop,pageBuilderLoaded:s.noop},p=function(){function e(){a()(this,e),this.determineActivePageBuilders()}return i()(e,[{key:"determineActivePageBuilders",value:function(){c.isActive()&&(this.diviActive=!0),u.isActive()&&(this.vcActive=!0)}},{key:"isPageBuilderActive",value:function(){return this.diviActive||this.vcActive}},{key:"listen",value:function(e){this.callbacks=Object(s.defaults)(e,l),this.diviActive&&(new c).listen(e)}},{key:"isClassicEditorHidden",value:function(){return!(!this.diviActive||!c.isTinyMCEHidden())}}]),e}();t.a=p},function(e,t,n){"use strict";var r,a=n(14),o=n.n(a),i=n(0),s=n(20),c=n(6),u=n(2),l=n(1),p=n.n(l),d=n(24),m=n.n(d),h=n(15),f=n.n(h),b=n(4),y=n(21),g=n(8),v=n(31),O=n.n(v),w=n(13),j=n.n(w),E=n(76),k=n(74),T=j.a.div(r||(r=f()(["\n\tpadding: 16px;\n"]))),R=function(e,t,n){var r=e.find((function(e){return e.value===t}));return[{name:Object(u.sprintf)( | |
| 46 | -/* translators: %1$s expands to the plural name of the current post type, %2$s expands to the current site wide default. */ | |
| 47 | -Object(u.__)("Default for %1$s (%2$s)","wordpress-seo"),n,r?r.name:""),value:""}].concat(m()(e))},_=function(e){return Object(u.sprintf)( | |
| 48 | -/* translators: %1$s expands to the plural name of the current post type, %2$s and %3$s expand to a link to the Search Appearance Settings page */ | |
| 49 | -Object(u.__)("You can change the default type for %1$s in your %2$sSearch Appearance Settings%3$s.","wordpress-seo"),e,"{{link}}","{{/link}}")},S=function(e){return Object(i.createElement)(b.FieldGroup,{label:e.helpTextTitle,linkTo:e.helpTextLink,linkText:Object(u.__)("Learn more about structured data with Schema.org","wordpress-seo"),description:e.helpTextDescription})};S.propTypes={helpTextTitle:p.a.string.isRequired,helpTextLink:p.a.string.isRequired,helpTextDescription:p.a.string.isRequired};var x=function(e){return Object(i.createElement)("p",null,e.helpTextDescription+" ",Object(i.createElement)("a",{href:e.helpTextLink},Object(u.__)("Read more about Schema.","wordpress-seo")))};x.propTypes={helpTextDescription:p.a.string.isRequired,helpTextLink:p.a.string.isRequired};var C=function(e){var t,n=R(e.pageTypeOptions,e.defaultPageType,e.postTypeName),r=R(e.articleTypeOptions,e.defaultArticleType,e.postTypeName),a=Object(k.isFeatureEnabled)("SCHEMA_BLOCKS");return Object(i.createElement)(i.Fragment,null,a?Object(i.createElement)(x,e):Object(i.createElement)(S,e),a&&Object(i.createElement)(y.Slot,{name:Object(g.join)(["yoast-schema-blocks-analysis",e.location])}),Object(i.createElement)(b.FieldGroup,{label:Object(u.__)("What type of page or content is this?","wordpress-seo"),linkTo:e.additionalHelpTextLink,linkText:Object(u.__)("Learn more about page or content types","wordpress-seo")}),Object(i.createElement)(b.Select,{id:Object(g.join)(["yoast-schema-page-type",e.location]),options:n,label:Object(u.__)("Page type","wordpress-seo"),onChange:e.schemaPageTypeChange,selected:e.schemaPageTypeSelected}),e.showArticleTypeInput&&Object(i.createElement)(b.Select,{id:Object(g.join)(["yoast-schema-article-type",e.location]),options:r,label:Object(u.__)("Article type","wordpress-seo"),onChange:e.schemaArticleTypeChange,selected:e.schemaArticleTypeSelected}),e.displayFooter&&Object(i.createElement)("p",null,(t=e.postTypeName,O()({mixedString:_(t),components:{link:Object(i.createElement)("a",{href:"/wp-admin/admin.php?page=wpseo_titles#top#post-types",target:"_blank"})}}))))};C.propTypes={schemaPageTypeChange:p.a.func,schemaPageTypeSelected:p.a.string,pageTypeOptions:E.b.isRequired,schemaArticleTypeChange:p.a.func,schemaArticleTypeSelected:p.a.string,articleTypeOptions:E.b.isRequired,showArticleTypeInput:p.a.bool.isRequired,additionalHelpTextLink:p.a.string.isRequired,helpTextLink:p.a.string.isRequired,helpTextTitle:p.a.string.isRequired,helpTextDescription:p.a.string.isRequired,postTypeName:p.a.string.isRequired,displayFooter:p.a.bool,defaultPageType:p.a.string.isRequired,defaultArticleType:p.a.string.isRequired,location:p.a.string.isRequired},C.defaultProps={schemaPageTypeChange:function(){},schemaPageTypeSelected:null,schemaArticleTypeChange:function(){},schemaArticleTypeSelected:null,displayFooter:!1};var P=function(e){return e.isMetabox?Object(i.createPortal)(Object(i.createElement)(T,null,Object(i.createElement)(C,e)),document.getElementById("wpseo-meta-section-schema")):Object(i.createElement)(C,e)};P.propTypes={showArticleTypeInput:p.a.bool,articleTypeLabel:p.a.string,additionalHelpTextLink:p.a.string,pageTypeLabel:p.a.string.isRequired,helpTextLink:p.a.string.isRequired,helpTextTitle:p.a.string.isRequired,helpTextDescription:p.a.string.isRequired,isMetabox:p.a.bool.isRequired,postTypeName:p.a.string.isRequired,displayFooter:p.a.bool,loadSchemaArticleData:p.a.func.isRequired,loadSchemaPageData:p.a.func.isRequired,location:p.a.string.isRequired},P.defaultProps={showArticleTypeInput:!1,articleTypeLabel:"",additionalHelpTextLink:"",displayFooter:!1};var I=P,A=n(77),q=n(44);function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=function(e){var t=null!==A.a.articleTypeInput;Object(i.useEffect)((function(){e.loadSchemaPageData(),t&&e.loadSchemaArticleData()}),[]);var n=window.wpseoScriptData.metabox.schema,r=n.pageTypeOptions,a=n.articleTypeOptions,o={articleTypeLabel:Object(u.__)("Article type","wordpress-seo"),pageTypeLabel:Object(u.__)("Page type","wordpress-seo"),postTypeName:window.wpseoAdminL10n.postTypeNamePlural,helpTextTitle:Object(u.__)("Yoast SEO automatically describes your pages using schema.org","wordpress-seo"),helpTextDescription:Object(u.__)("This helps search engines understand your website and your content. You can change some of your settings for this page below.","wordpress-seo"),showArticleTypeInput:t,pageTypeOptions:r,articleTypeOptions:a},s=D(D(D({},e),o),"metabox"===e.location?{helpTextLink:wpseoAdminL10n["shortlinks.metabox.schema.explanation"],additionalHelpTextLink:wpseoAdminL10n["shortlinks.metabox.schema.page_type"],isMetabox:!0}:{helpTextLink:wpseoAdminL10n["shortlinks.sidebar.schema.explanation"],additionalHelpTextLink:wpseoAdminL10n["shortlinks.sidebar.schema.page_type"],isMetabox:!1});return Object(i.createElement)(I,s)};F.propTypes={displayFooter:p.a.bool.isRequired,schemaPageTypeSelected:p.a.string.isRequired,schemaArticleTypeSelected:p.a.string.isRequired,defaultArticleType:p.a.string.isRequired,defaultPageType:p.a.string.isRequired,loadSchemaPageData:p.a.func.isRequired,loadSchemaArticleData:p.a.func.isRequired,schemaPageTypeChange:p.a.func.isRequired,schemaArticleTypeChange:p.a.func.isRequired,location:p.a.string.isRequired},t.a=Object(s.compose)([Object(c.withSelect)((function(e){var t=e("yoast-seo/editor"),n=t.getPreferences,r=t.getPageType,a=t.getDefaultPageType,o=t.getArticleType,i=t.getDefaultArticleType;return{displayFooter:n().displaySchemaSettingsFooter,schemaPageTypeSelected:r(),schemaArticleTypeSelected:o(),defaultArticleType:i(),defaultPageType:a()}})),Object(c.withDispatch)((function(e){var t=e("yoast-seo/editor"),n=t.setPageType,r=t.setArticleType;return{loadSchemaPageData:t.getSchemaPageData,loadSchemaArticleData:t.getSchemaArticleData,schemaPageTypeChange:n,schemaArticleTypeChange:r}})),Object(q.a)()])(F)},function(e,t,n){"use strict";var r=n(20),a=n(6),o=n(0),i=n(2),s=n(4),c=n(8),u=n(1),l=n.n(u),p=n(30),d=function(e){var t=e.noIndex,n=e.onNoIndexChange,r=e.editorContext,a=e.isPrivateBlog,u=function(e){var t=Object(i.__)("No","wordpress-seo"),n=Object(i.__)("Yes","wordpress-seo"),r=e.noIndex?t:n;return window.wpseoScriptData.isPost?[{name:Object(i.sprintf)( | |
| 50 | -/* Translators: %s translates to "yes" or "no", %s translates to the Post Label in plural form */ | |
| 51 | -Object(i.__)("%s (current default for %s)","wordpress-seo"),r,e.postTypeNamePlural),value:"0"},{name:t,value:"1"},{name:n,value:"2"}]:[{name:Object(i.sprintf)( | |
| 52 | -/* Translators: %s translates to the "yes" or "no" ,%s translates to the Post Label in plural form */ | |
| 53 | -Object(i.__)("%s (current default for %s)","wordpress-seo"),r,e.postTypeNamePlural),value:"default"},{name:n,value:"index"},{name:t,value:"noindex"}]}(r);return Object(o.createElement)(p.LocationConsumer,null,(function(e){return Object(o.createElement)(o.Fragment,null,a&&Object(o.createElement)(s.Alert,{type:"warning"},Object(i.__)("Even though you can set the meta robots setting here, the entire site is set to noindex in the sitewide privacy settings, so these settings won't have an effect.","wordpress-seo")),Object(o.createElement)(s.Select,{label:Object(i.sprintf)( | |
| 54 | -/* Translators: %s translates to the Post Label in singular form */ | |
| 55 | -Object(i.__)("Allow search engines to show this %s in search results?","wordpress-seo"),r.postTypeNameSingular),onChange:n,id:Object(c.join)(["yoast-meta-robots-noindex",e]),options:u,selected:t,linkTo:wpseoAdminL10n["shortlinks.advanced.allow_search_engines"],linkText:Object(i.__)("Learn more about the no-index setting on our help page.","wordpress-seo")}))}))};d.propTypes={noIndex:l.a.string.isRequired,onNoIndexChange:l.a.func.isRequired,editorContext:l.a.object.isRequired,isPrivateBlog:l.a.bool},d.defaultProps={isPrivateBlog:!1};var m=function(e){var t=e.noFollow,n=e.onNoFollowChange,r=e.postTypeName;return Object(o.createElement)(p.LocationConsumer,null,(function(e){var a=Object(c.join)(["yoast-meta-robots-nofollow",e]);return Object(o.createElement)(s.RadioButtonGroup,{id:a,options:[{value:"0",label:"Yes"},{value:"1",label:"No"}],label:Object(i.sprintf)( | |
| 56 | -/* Translators: %s translates to the Post Label in singular form */ | |
| 57 | -Object(i.__)("Should search engines follow links on this %s","wordpress-seo"),r),groupName:a,onChange:n,selected:t,linkTo:wpseoAdminL10n["shortlinks.advanced.follow_links"],linkText:Object(i.__)("Learn more about the no-follow setting on our help page.","wordpress-seo")})}))};m.propTypes={noFollow:l.a.string.isRequired,onNoFollowChange:l.a.func.isRequired,postTypeName:l.a.string.isRequired};var h=function(e){var t=e.advanced,n=e.onAdvancedChange;return Object(o.createElement)(p.LocationConsumer,null,(function(e){var r=Object(c.join)(["yoast-meta-robots-advanced",e]),a="".concat(r,"-input");return Object(o.createElement)(s.MultiSelect,{label:Object(i.__)("Meta robots advanced","wordpress-seo"),onChange:n,id:r,inputId:a,options:[{name:Object(i.__)("No Image Index","wordpress-seo"),value:"noimageindex"},{name:Object(i.__)("No Archive","wordpress-seo"),value:"noarchive"},{name:Object(i.__)("No Snippet","wordpress-seo"),value:"nosnippet"}],selected:t,linkTo:wpseoAdminL10n["shortlinks.advanced.meta_robots"],linkText:Object(i.__)("Learn more about advanced meta robots settings on our help page.","wordpress-seo")})}))};h.propTypes={advanced:l.a.array.isRequired,onAdvancedChange:l.a.func.isRequired};var f=function(e){var t=e.breadcrumbsTitle,n=e.onBreadcrumbsTitleChange;return Object(o.createElement)(p.LocationConsumer,null,(function(e){return Object(o.createElement)(s.TextInput,{label:Object(i.__)("Breadcrumbs Title","wordpress-seo"),id:Object(c.join)(["yoast-breadcrumbs-title",e]),onChange:n,value:t,linkTo:wpseoAdminL10n["shortlinks.advanced.breadcrumbs_title"],linkText:Object(i.__)("Learn more about the breadcrumbs title setting on our help page.","wordpress-seo")})}))};f.propTypes={breadcrumbsTitle:l.a.string.isRequired,onBreadcrumbsTitleChange:l.a.func.isRequired};var b=function(e){var t=e.canonical,n=e.onCanonicalChange;return Object(o.createElement)(p.LocationConsumer,null,(function(e){return Object(o.createElement)(s.TextInput,{label:Object(i.__)("Canonical URL","wordpress-seo"),id:Object(c.join)(["yoast-canonical",e]),onChange:n,value:t,linkTo:"https://yoa.st/canonical-url",linkText:Object(i.__)("Learn more about canonical URLs on our help page.","wordpress-seo")})}))};b.propTypes={canonical:l.a.string.isRequired,onCanonicalChange:l.a.func.isRequired};var y=function(e){var t=e.noIndex,n=e.noFollow,r=e.advanced,a=e.breadcrumbsTitle,i=e.canonical,s=e.onNoIndexChange,c=e.onNoFollowChange,u=e.onAdvancedChange,l=e.onBreadcrumbsTitleChange,p=e.onCanonicalChange,y=e.onLoad,g=e.isLoading,v=e.editorContext,O=e.isBreadcrumbsDisabled,w=e.isPrivateBlog;Object(o.useEffect)((function(){setTimeout((function(){g&&y()}))}));var j={noIndex:t,onNoIndexChange:s,editorContext:v,isPrivateBlog:w},E={noFollow:n,onNoFollowChange:c,postTypeName:v.postTypeNameSingular},k={advanced:r,onAdvancedChange:u},T={breadcrumbsTitle:a,onBreadcrumbsTitleChange:l},R={canonical:i,onCanonicalChange:p};return g?null:Object(o.createElement)(o.Fragment,null,Object(o.createElement)(d,j),v.isPost&&Object(o.createElement)(m,E),v.isPost&&Object(o.createElement)(h,k),!O&&Object(o.createElement)(f,T),Object(o.createElement)(b,R))};y.propTypes={noIndex:l.a.string.isRequired,canonical:l.a.string.isRequired,onNoIndexChange:l.a.func.isRequired,onCanonicalChange:l.a.func.isRequired,onLoad:l.a.func.isRequired,isLoading:l.a.bool.isRequired,editorContext:l.a.object.isRequired,isBreadcrumbsDisabled:l.a.bool.isRequired,isPrivateBlog:l.a.bool,advanced:l.a.array,onAdvancedChange:l.a.func,noFollow:l.a.string,onNoFollowChange:l.a.func,breadcrumbsTitle:l.a.string,onBreadcrumbsTitleChange:l.a.func},y.defaultProps={advanced:[],onAdvancedChange:function(){},noFollow:"",onNoFollowChange:function(){},breadcrumbsTitle:"",onBreadcrumbsTitleChange:function(){},isPrivateBlog:!1};var g=y;t.a=Object(r.compose)([Object(a.withSelect)((function(e){var t=e("yoast-seo/editor"),n=t.getNoIndex,r=t.getNoFollow,a=t.getAdvanced,o=t.getBreadcrumbsTitle,i=t.getCanonical,s=t.getIsLoading,c=t.getEditorContext,u=(0,t.getPreferences)(),l=u.isBreadcrumbsDisabled,p=u.isPrivateBlog;return{noIndex:n(),noFollow:r(),advanced:a(),breadcrumbsTitle:o(),canonical:i(),isLoading:s(),editorContext:c(),isBreadcrumbsDisabled:l,isPrivateBlog:p}})),Object(a.withDispatch)((function(e){var t=e("yoast-seo/editor");return{onNoIndexChange:t.setNoIndex,onNoFollowChange:t.setNoFollow,onAdvancedChange:t.setAdvanced,onBreadcrumbsTitleChange:t.setBreadcrumbsTitle,onCanonicalChange:t.setCanonical,onLoad:t.loadAdvancedSettingsData}}))])(g)},,,,,function(e,t){e.exports=window.yoast.searchMetadataPreviews},function(e,t,n){"use strict";var r=n(0),a=n(21),o=n(1),i=n.n(o),s=n(88),c=function(e){return Object(r.useEffect)((function(){setTimeout(e.onLoad)}),[]),e.isPremium?Object(r.createElement)(a.Slot,{name:"YoastTwitterPremium".concat(e.location.charAt(0).toUpperCase()+e.location.slice(1)),fillProps:e}):Object(r.createElement)(s.a,e)};c.propTypes={isPremium:i.a.bool.isRequired,onLoad:i.a.func.isRequired,location:i.a.string.isRequired},t.a=c},function(e,t){e.exports=window.yoast.socialMetadataForms},function(e,t,n){"use strict";var r=n(14),a=n.n(r),o=n(29),i=n.n(o),s=n(0),c=n(21),u=n(1),l=n.n(u),p=n(88);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=function(e){var t=Object(s.useState)(""),n=i()(t,2),r=n[0],a=n[1],o=Object(s.useCallback)((function(e){a(e.detail.metaTabId)}),[a]);Object(s.useEffect)((function(){return setTimeout(e.onLoad),window.addEventListener("YoastSEO:metaTabChange",o),function(){window.removeEventListener("YoastSEO:metaTabChange",o)}}),[]);var u=Object(s.useMemo)((function(){return m(m({},e),{},{activeMetaTabId:r})}),[e,r]);return e.isPremium?Object(s.createElement)(c.Slot,{name:"YoastFacebookPremium".concat(e.location.charAt(0).toUpperCase()+e.location.slice(1)),fillProps:u}):Object(s.createElement)(p.a,u)};h.propTypes={isPremium:l.a.bool.isRequired,onLoad:l.a.func.isRequired,location:l.a.string.isRequired},t.a=h},,,,,,,,function(e,t,n){"use strict";var r=n(6),a=n(4);t.a=Object(r.withSelect)((function(e){return{message:(0,e("yoast-seo/editor").getWarningMessage)()}}))(a.Warning)},function(e,t,n){"use strict";var r=n(14),a=n.n(r),o=n(26),i=n.n(o),s=n(0),c=n(20),u=n(6),l=n(2),p=n(123),d=n(30),m=n(105),h=n(56),f=function(e,t){var n=0;return t.shortenedBaseUrl&&"string"==typeof t.shortenedBaseUrl&&(n=t.shortenedBaseUrl.length),e.url=e.url.replace(/\s+/g,"-"),"-"===e.url[e.url.length-1]&&(e.url=e.url.slice(0,-1)),"-"===e.url[n]&&(e.url=e.url.slice(0,n)+e.url.slice(n+1)),Object(h.applyReplaceUsingPlugin)(e)};t.a=Object(c.compose)([Object(u.withSelect)((function(e){var t=e("yoast-seo/editor"),n=t.getBaseUrlFromSettings,r=t.getDateFromSettings,a=t.getFocusKeyphrase,o=t.getRecommendedReplaceVars,i=t.getReplaceVars,s=t.getShoppingData,c=t.getSiteIconUrlFromSettings,u=t.getSnippetEditorData,l=t.getSnippetEditorMode,p=t.getSnippetEditorPreviewImageUrl,d=t.getSnippetEditorWordsToHighlight,m=t.isCornerstoneContent,h=t.getIsTerm,f=t.getContentLocale,b=i();return b.forEach((function(e){""!==e.value||["title","excerpt","excerpt_only"].includes(e.name)||(e.value="%%"+e.name+"%%")})),{baseUrl:n(),data:u(),date:r(),faviconSrc:c(),keyword:a(),mobileImageSrc:p(),mode:l(),recommendedReplacementVariables:o(),replacementVariables:b,shoppingData:s(),wordsToHighlight:d(),isCornerstone:m(),isTaxonomy:h(),locale:f()}})),Object(u.withDispatch)((function(e){var t=e("yoast-seo/editor"),n=t.updateData,r=t.switchMode,o=t.updateAnalysisData,i=e("core/editor");return{onChange:function(e,t){switch(e){case"mode":r(t);break;case"slug":n({slug:t}),i&&i.editPost({slug:t});break;default:n(a()({},e,t))}},onChangeAnalysisData:o}}))])((function(e){return Object(s.createElement)(d.LocationConsumer,null,(function(t){return Object(s.createElement)(m.a,{icon:"eye",hasPaperStyle:e.hasPaperStyle},Object(s.createElement)(p.SnippetEditor,i()({},e,{descriptionPlaceholder:Object(l.__)("Please provide a meta description by editing the snippet below.","wordpress-seo"),mapEditorDataToPreview:f,showCloseButton:!1,idSuffix:t})))}))}))},function(e,t,n){"use strict";var r=n(20),a=n(6),o=n(8),i=n(124),s=n(23),c=n(44),u=n(58),l=function(e){Object(a.dispatch)("yoast-seo/editor").setTwitterPreviewImage({url:e.url,id:e.id,warnings:Object(o.validateTwitterImage)(e)})},p=function(){Object(u.a)(l)};t.a=Object(r.compose)([Object(a.withSelect)((function(e){var t=e("yoast-seo/editor"),n=t.getTwitterDescription,r=t.getTwitterTitle,a=t.getTwitterImageUrl,o=t.getFacebookImageUrl,i=t.getFacebookTitle,c=t.getFacebookDescription,u=t.getDescription,l=t.getSeoTitle,p=t.getTwitterWarnings,d=t.getTwitterImageType,m=t.getImageFallback,h=t.getRecommendedReplaceVars,f=t.getReplaceVars,b=t.getSiteUrl,y=t.getSeoTitleTemplate,g=t.getSeoTitleTemplateNoFallback,v=t.getSocialTitleTemplate,O=t.getSeoDescriptionTemplate,w=t.getSocialDescriptionTemplate,j=t.getReplacedExcerpt;return{imageUrl:a(),imageFallbackUrl:o()||m(),recommendedReplacementVariables:h(),replacementVariables:f(),description:n(),descriptionPreviewFallback:w()||c()||u()||O()||j()||"",title:r(),titlePreviewFallback:v()||i()||l()||g()||y()||"",imageWarnings:p(),siteUrl:b(),isPremium:!!Object(s.a)().isPremium,isLarge:"summary"!==d(),titleInputPlaceholder:"",descriptionInputPlaceholder:"",socialMediumName:"Twitter"}})),Object(a.withDispatch)((function(e){var t=e("yoast-seo/editor"),n=t.setTwitterPreviewTitle,r=t.setTwitterPreviewDescription,a=t.clearTwitterPreviewImage,o=t.loadTwitterPreviewData;return{onSelectImageClick:p,onRemoveImageClick:a,onDescriptionChange:r,onTitleChange:n,onLoad:o}})),Object(c.a)()])(i.a)},function(e,t,n){"use strict";var r=n(20),a=n(6),o=n(8),i=n(126),s=n(23),c=n(44),u=n(58),l=function(e){Object(a.dispatch)("yoast-seo/editor").setFacebookPreviewImage({url:e.url,id:e.id,warnings:Object(o.validateFacebookImage)(e)})},p=function(){Object(u.a)(l)};t.a=Object(r.compose)([Object(a.withSelect)((function(e){var t=e("yoast-seo/editor"),n=t.getFacebookDescription,r=t.getDescription,a=t.getFacebookTitle,o=t.getSeoTitle,i=t.getFacebookImageUrl,c=t.getImageFallback,u=t.getFacebookWarnings,l=t.getRecommendedReplaceVars,p=t.getReplaceVars,d=t.getSiteUrl,m=t.getSeoTitleTemplate,h=t.getSeoTitleTemplateNoFallback,f=t.getSocialTitleTemplate,b=t.getSeoDescriptionTemplate,y=t.getSocialDescriptionTemplate,g=t.getReplacedExcerpt;return{imageUrl:i(),imageFallbackUrl:c(),recommendedReplacementVariables:l(),replacementVariables:p(),description:n(),descriptionPreviewFallback:y()||r()||b()||g()||"",title:a(),titlePreviewFallback:f()||o()||h()||m()||"",imageWarnings:u(),siteUrl:d(),isPremium:!!Object(s.a)().isPremium,titleInputPlaceholder:"",descriptionInputPlaceholder:"",socialMediumName:"Facebook"}})),Object(a.withDispatch)((function(e){var t=e("yoast-seo/editor"),n=t.setFacebookPreviewTitle,r=t.setFacebookPreviewDescription,a=t.clearFacebookPreviewImage,o=t.loadFacebookPreviewData;return{onSelectImageClick:p,onRemoveImageClick:a,onDescriptionChange:r,onTitleChange:n,onLoad:o}})),Object(c.a)()])(i.a)},,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return A}));var r=n(0),a=n(1),o=n.n(a),i=n(21),s=n(114),c=n(69);function u(e){var t=e.theme;return Object(r.createElement)(c.a,{theme:t,location:"metabox"},Object(r.createElement)(i.Slot,{name:"YoastMetabox"},(function(e){return Object(s.a)(e)})))}var l=n(6),p=n(20),d=n(2),m=n(113),h=n(135),f=n(134),b=n(54),y=n(53),g=n(33),v=n(118),O=n(137),w=n(136),j=function(e){var t=e.displayFacebook,n=e.displayTwitter;return Object(r.createElement)(r.Fragment,null,t&&Object(r.createElement)(y.a,{hasSeparator:!1 | |
| 58 | -/* Translators: %s expands to Facebook. */,title:Object(d.sprintf)(Object(d.__)("%s preview","wordpress-seo"),"Facebook"),initialIsOpen:!0},Object(r.createElement)(O.a,null)),n&&Object(r.createElement)(y.a | |
| 59 | -/* Translators: %s expands to Twitter. */,{title:Object(d.sprintf)(Object(d.__)("%s preview","wordpress-seo"),"Twitter"),hasSeparator:t,initialIsOpen:!0},Object(r.createElement)(w.a,null)))};j.propTypes={displayFacebook:o.a.bool.isRequired,displayTwitter:o.a.bool.isRequired};var E=j,k=Object(l.withSelect)((function(e){var t=(0,e("yoast-seo/editor").getPreferences)();return{displayFacebook:t.displayFacebook,displayTwitter:t.displayTwitter}}))(E),T=n(42);function R(e){var t=e.target;return Object(r.createElement)(T.a,{target:t},Object(r.createElement)(k,null))}R.propTypes={target:o.a.string.isRequired};var _=n(117),S=n(108),x=n(94),C=n(25);function P(e){var t=e.settings,n=e.wincherKeyphrases,a=e.setWincherNoKeyphrase,o=Object(r.useCallback)((function(){if(!n.length)return a(!0),document.querySelector("#focus-keyword-input-metabox").focus(),!1}),[n,a]);return Object(r.createElement)(i.Fill,{name:"YoastMetabox"},Object(r.createElement)(g.a,{key:"warning",renderPriority:1},Object(r.createElement)(f.a,null)),t.isKeywordAnalysisActive&&Object(r.createElement)(g.a,{key:"keyword-input",renderPriority:8},Object(r.createElement)(b.KeywordInput,{isSEMrushIntegrationActive:t.isSEMrushIntegrationActive}),!window.wpseoScriptData.metabox.isPremium&&Object(r.createElement)(i.Fill,{name:"YoastRelatedKeyphrases"},Object(r.createElement)(S.a,null))),Object(r.createElement)(g.a,{key:"google-preview",renderPriority:9},Object(r.createElement)(y.a,{id:"yoast-snippet-editor-metabox",title:Object(d.__)("Google preview","wordpress-seo"),initialIsOpen:!0},Object(r.createElement)(h.a,{hasPaperStyle:!1}))),t.isContentAnalysisActive&&Object(r.createElement)(g.a,{key:"readability-analysis",renderPriority:10},Object(r.createElement)(b.ReadabilityAnalysis,null)),t.isKeywordAnalysisActive&&Object(r.createElement)(g.a,{key:"seo-analysis",renderPriority:20},Object(r.createElement)(b.SeoAnalysis,{shouldUpsell:t.shouldUpsell,shouldUpsellWordFormRecognition:t.isWordFormRecognitionActive})),t.isKeywordAnalysisActive&&t.isWincherIntegrationActive&&Object(r.createElement)(g.a,{key:"wincher-seo-performance",renderPriority:25},Object(r.createElement)(y.a,{id:"yoast-wincher-seo-performance-metabox",title:Object(d.__)("Track SEO performance","wordpress-seo"),initialIsOpen:!1,prefixIcon:{icon:"chart-square-bar",color:C.colors.$color_grey_medium_dark},prefixIconCollapsed:{icon:"chart-square-bar",color:C.colors.$color_grey_medium_dark},onToggle:o},Object(r.createElement)(x.a,null))),t.isCornerstoneActive&&Object(r.createElement)(g.a,{key:"cornerstone",renderPriority:30},Object(r.createElement)(m.a,null)),t.displayAdvancedTab&&Object(r.createElement)(g.a,{key:"advanced",renderPriority:40},Object(r.createElement)(y.a,{id:"collapsible-advanced-settings",title:Object(d.__)("Advanced","wordpress-seo")},Object(r.createElement)(v.a,null))),t.displaySchemaSettings&&Object(r.createElement)(g.a,{key:"schema",renderPriority:50},Object(r.createElement)(_.a,null)),Object(r.createElement)(g.a,{key:"social",renderPriority:-1},Object(r.createElement)(R,{target:"wpseo-section-social"})))}P.propTypes={settings:o.a.object.isRequired,wincherKeyphrases:o.a.array.isRequired,setWincherNoKeyphrase:o.a.func.isRequired};var I=Object(p.compose)([Object(l.withSelect)((function(e,t){var n=e("yoast-seo/editor"),r=n.getPreferences,a=n.getWincherTrackableKeyphrases;return{settings:r(),store:t.store,wincherKeyphrases:a()}})),Object(l.withDispatch)((function(e){return{setWincherNoKeyphrase:e("yoast-seo/editor").setWincherNoKeyphrase}}))])(P);function A(e){var t=e.target,n=e.store,a=e.theme;return Object(r.createElement)(T.a,{target:t},Object(r.createElement)(u,{store:n,theme:a}),Object(r.createElement)(I,{store:n,theme:a}))}A.propTypes={target:o.a.string.isRequired,store:o.a.object,theme:o.a.object}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(24),a=n.n(r),o=n(9),i=n.n(o),s=n(10),c=n.n(s),u=n(18),l=n.n(u),p=n(19),d=n.n(p),m=n(11),h=n.n(m),f=n(0),b=n(21),y=n(158),g=n(23);var v=[],O=null,w=function(e){l()(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=h()(t);if(n){var a=h()(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return d()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this,e)).state={registeredComponents:[]},t}return c()(o,[{key:"registerComponent",value:function(e,t){this.setState({registeredComponents:[].concat(a()(this.state.registeredComponents),[{key:e,Component:t}])})}},{key:"render",value:function(){return this.state.registeredComponents.map((function(e){var t=e.Component,n=e.key;return Object(f.createElement)(t,{key:n})}))}}]),o}(f.Component);function j(e,t){null===O||null===O.current?v.push({key:e,Component:t}):O.current.registerComponent(e,t)}var E=n(14),k=n.n(E),T=n(17),R=n(3),_=n(27),S=n.n(_),x=n(56),C=n(37),P=n(51);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){k()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var q=S.a.markers.removeMarks,L=T.actions.updateReplacementVariable,D=T.actions.updateData,F=T.actions.hideReplacementVariables,N=T.actions.setContentImage,M=jQuery,B=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"content";i()(this,e),this._refresh=t,this._store=n,this._initialData={},this._previousData={},this._tinyMceId=r,this.updateReplacementData=this.updateReplacementData.bind(this),this.refreshYoastSEO=this.refreshYoastSEO.bind(this)}return c()(e,[{key:"initialize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this._initialData=this.getInitialData(e),Object(x.fillReplacementVariables)(this._initialData,this._store),this._store.dispatch(F(t)),this.subscribeToElements(),this.subscribeToStore(),this.subscribeToSnippetPreviewImage()}},{key:"subscribeToSnippetPreviewImage",value:function(){var e=this;if(!Object(R.isUndefined)(wp.media)&&!Object(R.isUndefined)(wp.media.featuredImage)){M("#postimagediv").on("click","#remove-post-thumbnail",(function(){e.featuredImageIsSet=!1,e.setImageInSnippetPreview(e.getContentImage())}));var t=wp.media.featuredImage.frame();t.on("select",(function(){var n=t.state().get("selection").first().attributes.url;n&&(e.featuredImageIsSet=!0,e.setImageInSnippetPreview(n))})),C.addEventHandler(this._tinyMceId,["init"],(function(){var t=e.getContentImage(),n=e.getFeaturedImage()||t||null;e._store.dispatch(N(t)),e.setImageInSnippetPreview(n)})),C.addEventHandler(this._tinyMceId,["change"],Object(R.debounce)((function(){if(!e.featuredImageIsSet){var t=e.getContentImage();e._store.dispatch(N(t)),e.setImageInSnippetPreview(t)}}),1e3))}}},{key:"getFeaturedImage",value:function(){var e=M("#set-post-thumbnail img").attr("src");return e?(this.featuredImageIsSet=!0,e):(this.featuredImageIsSet=!1,null)}},{key:"setImageInSnippetPreview",value:function(e){this._store.dispatch(D({snippetPreviewImageURL:e}))}},{key:"getContentImage",value:function(){if(this.featuredImageIsSet)return"";var e=this.getContent(),t=S.a.languageProcessing.imageInText(e),n="";if(0===t.length)return n;do{var r=t.shift(),a=(r=M(r)).prop("src");a&&(n=a)}while(""===n&&t.length>0);return n}},{key:"getTitle",value:function(){var e=document.getElementById("title");return e&&e.value||""}},{key:"getExcerpt",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=document.getElementById("excerpt"),n=t&&t.value||"",r="ja"===Object(P.a)()?80:156;return""!==n||!1===e?n:Object(x.excerptFromContent)(this.getContent(),r)}},{key:"getSlug",value:function(){var e="",t=document.getElementById("new-post-slug");return t?e=t.value:null!==document.getElementById("editable-post-name-full")&&(e=document.getElementById("editable-post-name-full").textContent),e}},{key:"getContent",value:function(){var e=this._tinyMceId;return q(C.getContentTinyMce(e))}},{key:"subscribeToElements",value:function(){this.subscribeToInputElement("title","title"),this.subscribeToInputElement("excerpt","excerpt"),this.subscribeToInputElement("excerpt","excerpt_only")}},{key:"subscribeToInputElement",value:function(e,t){var n=this,r=document.getElementById(e);r&&r.addEventListener("input",(function(e){n.updateReplacementData(e,t)}))}},{key:"updateReplacementData",value:function(e,t){var n=e.target.value;"excerpt"===t&&""===n&&(n=this.getExcerpt()),this._initialData[t]=n,this._store.dispatch(L(t,n))}},{key:"isShallowEqual",value:function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(e.hasOwnProperty(n)&&(!(n in t)||e[n]!==t[n]))return!1;return!0}},{key:"refreshYoastSEO",value:function(){var e=this.getData();!this.isShallowEqual(this._previousData,e)&&(this.handleEditorChange(e),this._previousData=e,window.YoastSEO&&window.YoastSEO.app&&window.YoastSEO.app.refresh())}},{key:"handleEditorChange",value:function(e){this._previousData.excerpt!==e.excerpt&&(this._store.dispatch(L("excerpt",e.excerpt)),this._store.dispatch(L("excerpt_only",e.excerpt_only))),this._previousData.snippetPreviewImageURL!==e.snippetPreviewImageURL&&this.setImageInSnippetPreview(e.snippetPreviewImageURL)}},{key:"subscribeToStore",value:function(){this.subscriber=Object(R.debounce)(this.refreshYoastSEO,500),this._store.subscribe(this.subscriber)}},{key:"getInitialData",value:function(e){return e=Object(x.mapCustomFields)(e,this._store),A(A({},e=Object(x.mapCustomTaxonomies)(e,this._store)),{},{title:this.getTitle(),excerpt:this.getExcerpt(),excerpt_only:this.getExcerpt(!1),slug:this.getSlug(),content:this.getContent()})}},{key:"getData",value:function(){return A(A({},this._store.getState().snippetEditor.data),{},{content:this.getContent(),excerpt:this.getExcerpt(),excerpt_only:this.getExcerpt(!1)})}}]),e}();window.yoast=window.yoast||{},window.yoast.initEditorIntegration=function(e){window.YoastSEO=window.YoastSEO||{},window.YoastSEO._registerReactComponent=j,function(e){var t=Object(g.a)();O=Object(f.createRef)();var n={isRtl:t.isRtl};Object(f.render)(Object(f.createElement)(b.SlotFillProvider,null,Object(f.createElement)(y.a,{target:"wpseo-metabox-root",store:e,theme:n}),Object(f.createElement)(w,{ref:O})),document.getElementById("wpseo-metabox-root")),v.forEach((function(e){O.current.registerComponent(e.key,e.Component)}))}(e)},window.yoast.EditorData=B}]); | |
| 1 | +(()=>{var e={465(e,t,s){const i=s(1609),o=i.forwardRef(function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),i.createElement("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"}))});e.exports=o},818(e,t,s){const i=s(1609),o=i.forwardRef(function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),i.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=o},998(e,t,s){const i=s(1609),o=i.forwardRef(function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),i.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=o},1609(e){"use strict";e.exports=window.React},2485(e,t){var s;!function(){"use strict";var i={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var r=typeof s;if("string"===r||"number"===r)e.push(s);else if(Array.isArray(s)){if(s.length){var n=o.apply(null,s);n&&e.push(n)}}else if("object"===r){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){e.push(s.toString());continue}for(var a in s)i.call(s,a)&&s[a]&&e.push(a)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(s=function(){return o}.apply(t,[]))||(e.exports=s)}()},2514(e,t,s){const i=s(1609),o=i.forwardRef(function(e,t){return i.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:t},e),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"}))});e.exports=o},3473(e,t,s){const i=s(1609),o=i.forwardRef(function(e,t){return i.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:t},e),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"}))});e.exports=o},5074(e,t,s){const i=s(1609),o=i.forwardRef(function(e,t){return i.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:t},e),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});e.exports=o},5547(e,t,s){const i=s(1609),o=i.forwardRef(function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),i.createElement("path",{d:"M2 11a1 1 0 011-1h2a1 1 0 011 1v5a1 1 0 01-1 1H3a1 1 0 01-1-1v-5zM8 7a1 1 0 011-1h2a1 1 0 011 1v9a1 1 0 01-1 1H9a1 1 0 01-1-1V7zM14 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1h-2a1 1 0 01-1-1V4z"}))});e.exports=o},5687(e,t,s){const i=s(1609),o=i.forwardRef(function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),i.createElement("path",{fillRule:"evenodd",d:"M10.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L12.586 11H5a1 1 0 110-2h7.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=o},6702(e,t,s){const i=s(1609),o=i.forwardRef(function(e,t){return i.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:t},e),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});e.exports=o},7656(e,t,s){const i=s(1609),o=i.forwardRef(function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),i.createElement("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}))});e.exports=o},8738(e,t,s){const i=s(1609),o=i.forwardRef(function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),i.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))});e.exports=o}},t={};function s(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,s),r.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 i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.element,t=window.wp.components,i=window.yoast.propTypes;var o=s.n(i);const r=window.yoast.uiLibrary,n=window.lodash,a=window.wp.data;s(6702);const l=window.wp.i18n,c=(t,s)=>{try{return(0,e.createInterpolateElement)(t,s)}catch(e){return console.error("Error in translation for:",t,e),t}},d=window.ReactJSXRuntime;o().string.isRequired;var p=s(2514),u=s.n(p),h=s(818),g=s.n(h);o().string.isRequired,o().string.isRequired,o().shape({src:o().string.isRequired,width:o().string,height:o().string}).isRequired,o().shape({value:o().bool.isRequired,status:o().string.isRequired,set:o().func.isRequired}).isRequired,o().string,o().string,o().string;const m=({handleRefreshClick:e,supportLink:t})=>(0,d.jsxs)("div",{className:"yst-flex yst-gap-2",children:[(0,d.jsx)(r.Button,{onClick:e,children:(0,l.__)("Refresh this page","wordpress-seo")}),(0,d.jsx)(r.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener",children:(0,l.__)("Contact support","wordpress-seo")})]});m.propTypes={handleRefreshClick:o().func.isRequired,supportLink:o().string.isRequired};const y=({handleRefreshClick:e,supportLink:t})=>(0,d.jsxs)("div",{className:"yst-grid yst-grid-cols-1 yst-gap-y-2",children:[(0,d.jsx)(r.Button,{className:"yst-order-last",onClick:e,children:(0,l.__)("Refresh this page","wordpress-seo")}),(0,d.jsx)(r.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener",children:(0,l.__)("Contact support","wordpress-seo")})]});y.propTypes={handleRefreshClick:o().func.isRequired,supportLink:o().string.isRequired};const w=({error:e,children:t=null})=>(0,d.jsxs)("div",{role:"alert",className:"yst-max-w-screen-sm yst-p-8 yst-space-y-4",children:[(0,d.jsx)(r.Title,{children:(0,l.__)("Something went wrong. An unexpected error occurred.","wordpress-seo")}),(0,d.jsx)("p",{children:(0,l.__)("We're very sorry, but it seems like the following error has interrupted our application:","wordpress-seo")}),(0,d.jsx)(r.Alert,{variant:"error",children:(null==e?void 0:e.message)||(0,l.__)("Undefined error message.","wordpress-seo")}),(0,d.jsx)("p",{children:(0,l.__)("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")}),t]});w.propTypes={error:o().object.isRequired,children:o().node},w.VerticalButtons=y,w.HorizontalButtons=m;o().string,o().node.isRequired,o().node.isRequired,o().node,o().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"}}));var f=s(1609),x=s.n(f);const b=window.ReactDOM;var v,k,_;(k=v||(v={})).Pop="POP",k.Push="PUSH",k.Replace="REPLACE",function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(_||(_={})),new Set(["lazy","caseSensitive","path","id","index","children"]),Error;const T=["post","put","patch","delete"],j=(new Set(T),["get",...T]);new Set(j),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred"),f.Component,f.startTransition,new Promise(()=>{}),f.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}var R,S,I,C;new Map,f.startTransition,b.flushSync,f.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,(C=R||(R={})).UseScrollRestoration="useScrollRestoration",C.UseSubmit="useSubmit",C.UseSubmitFetcher="useSubmitFetcher",C.UseFetcher="useFetcher",C.useViewTransitionState="useViewTransitionState",(I=S||(S={})).UseFetcher="useFetcher",I.UseFetchers="useFetchers",I.UseScrollRestoration="useScrollRestoration",o().string.isRequired,o().string;const E=({href:e,children:t=null,...s})=>(0,d.jsxs)(r.Link,{target:"_blank",rel:"noopener noreferrer",...s,href:e,children:[t,(0,d.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */ | |
| 2 | +(0,l.__)("(Opens in a new browser tab)","wordpress-seo")})]});E.propTypes={href:o().string.isRequired,children:o().node};var L=s(8738),A=s.n(L);(0,l.__)("Create optimized SEO titles & meta descriptions in seconds","wordpress-seo"),(0,l.__)("Apply AI suggestions to improve content in 1 click","wordpress-seo"),(0,l.__)("Manage redirects with ease and without extra plugins","wordpress-seo"),(0,l.__)("Optimize pages for multiple keywords with guidance","wordpress-seo"),(0,l.__)("Add product details to help your listings stand out","wordpress-seo"),(0,l.__)("Make sure search engines show the right version of your product page","wordpress-seo"),(0,l.__)("Create optimized SEO titles & meta descriptions with AI","wordpress-seo"),(0,l.__)("Receive clear SEO and readability guidance to optimize your products","wordpress-seo"),(0,l.__)("Generate SEO optimized metadata in seconds with AI","wordpress-seo"),(0,l.__)("Make your articles visible, be seen in Google News","wordpress-seo"),(0,l.__)("Built to get found by search, AI, and real users","wordpress-seo"),(0,l.__)("Easy Local SEO. Show up in Google Maps results","wordpress-seo"),(0,l.__)("Internal links and redirect management, easy","wordpress-seo"),(0,l.__)("Access to friendly help when you need it, day or night","wordpress-seo");var P=s(2485),q=s.n(P);var F;function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)({}).hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e},M.apply(null,arguments)}o().string.isRequired,o().object.isRequired,o().func.isRequired,o().bool.isRequired,s(3473);const D=e=>f.createElement("svg",M({xmlns:"http://www.w3.org/2000/svg",fill:"none","aria-hidden":"true",viewBox:"0 0 16 12"},e),F||(F=f.createElement("path",{fill:"#CD82AB",d:"M10.989 6.74 7.885.98v.002L7.882.98 4.778 6.74 0 3.32l1.126 7.702H14.64l1.126-7.703L10.99 6.74z"})));o().string.isRequired,o().object,o().func.isRequired,o().bool.isRequired,o().string.isRequired,o().object.isRequired,o().string.isRequired,o().func.isRequired,o().bool.isRequired,s(5074),o().bool.isRequired,o().func,o().func,o().string.isRequired,o().string.isRequired,o().string.isRequired,o().string.isRequired;window.yoast.reactHelmet;o().string.isRequired,o().shape({src:o().string.isRequired,width:o().string,height:o().string}).isRequired,o().shape({value:o().bool.isRequired,status:o().string.isRequired,set:o().func.isRequired}).isRequired,o().bool,s(5687),o().bool.isRequired,o().func.isRequired,o().func,o().string;const O="yoast-seo/editor",N=((0,n.mapValues)({post:"title",term:"term_title"},e=>`%%${e}%%`),({children:e})=>(0,d.jsx)("p",{className:"yst-mt-2",children:e}));N.propTypes={children:o().node.isRequired};const $=(0,l.__)("Something went wrong","wordpress-seo"),U=({linkStoreName:e=O})=>{const t=(0,a.useSelect)(t=>t(e).selectLink("https://yoa.st/ai-common-errors"),[e]),s=(0,a.useSelect)(t=>t(e).selectAdminLink("?page=wpseo_page_support"),[e]);return(0,d.jsx)(N,{children:c((0,l.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ | |
| 3 | +(0,l.__)("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,d.jsx)(E,{variant:"error",href:t}),a2:(0,d.jsx)(E,{variant:"error",href:s})})})};U.propTypes={linkStoreName:o().string};const W=({linkStoreName:e=O,className:t=""})=>(0,d.jsxs)(r.Alert,{variant:"error",className:t,children:[(0,d.jsx)("span",{className:"yst-block yst-font-medium",children:$}),(0,d.jsx)(U,{linkStoreName:e})]});W.propTypes={linkStoreName:o().string,className:o().string},(0,l.__)("Not enough content","wordpress-seo"),(0,l.__)("SEO analysis required","wordpress-seo"),(0,l.__)("You've reached the Yoast AI rate limit","wordpress-seo");const H=window.wp.apiFetch;var B=s.n(H);(0,l.__)("Subscription required","wordpress-seo");o().arrayOf(o().string),o().arrayOf(o().string),(0,l.__)("Connection timeout","wordpress-seo"),(0,l.__)("Usage policy violation","wordpress-seo"),(0,l.__)("Something went wrong","wordpress-seo");o().string,o().string,(0,l.__)("Something went wrong","wordpress-seo");o().bool,o().func.isRequired,o().func.isRequired,o().bool,o().bool,o().func,o().func,o().bool,o().bool,o().func,o().func,o().string,o().bool,o().bool,o().func,o().func,o().bool,o().func,o().bool,o().func,o().bool,o().func,o().bool,o().func,o().arrayOf(o().string),o().bool,o().func,o().bool,o().func,(0,l.__)("Yoast AI cannot reach your site","wordpress-seo");o().string,o().bool,o().func;o().func.isRequired,o().string.isRequired,o().string.isRequired,o().string.isRequired,o().string.isRequired,o().string.isRequired,o().string.isRequired,o().func.isRequired,o().string.isRequired,o().shape({termsOfService:o().string,privacyPolicy:o().string,learnMore:o().string});const K=window.yoast.componentsNew,Y=window.yoast.styleGuide,z=window.yoast.analysis;function V(e){switch(e){case"loading":return{icon:"loading-spinner",color:Y.colors.$color_green_medium_light};case"not-set":return{icon:"seo-score-none",color:Y.colors.$color_score_icon};case"noindex":return{icon:"seo-score-none",color:Y.colors.$color_noindex};case"good":return{icon:"seo-score-good",color:Y.colors.$color_green_medium};case"ok":return{icon:"seo-score-ok",color:Y.colors.$color_ok};default:return{icon:"seo-score-bad",color:Y.colors.$color_red}}}function G({target:t,children:s}){let i=t;return"string"==typeof t&&(i=document.getElementById(t)),i?(0,e.createPortal)(s,i):null}G.propTypes={target:o().oneOfType([o().string,o().object]).isRequired,children:o().node.isRequired};const Z=({target:e,scoreIndicator:t})=>(0,d.jsx)(G,{target:e,children:(0,d.jsx)(K.SvgIcon,{...V(t)})});Z.propTypes={target:o().string.isRequired,scoreIndicator:o().string.isRequired};const X=Z,Q=({error:t})=>{const s=(0,e.useCallback)(()=>{var e,t;return null===(e=window)||void 0===e||null===(t=e.location)||void 0===t?void 0:t.reload()},[]),i=(0,a.useSelect)(e=>e("yoast-seo/editor").selectLink("https://yoa.st/metabox-error-support"),[]),o=(0,a.useSelect)(e=>e("yoast-seo/editor").getPreference("isRtl",!1),[]);return(0,e.useEffect)(()=>{document.querySelectorAll('[id^="wpseo-meta-tab-"]').forEach(e=>{!function(e){const t=document.querySelector(`#${e}`);null!==t&&(t.style.opacity="0.5",t.style.pointerEvents="none",t.setAttribute("aria-disabled","true"),t.classList.contains("yoast-active-tab")&&t.classList.remove("yoast-active-tab"))}(e.id)})},[]),(0,d.jsx)(r.Root,{context:{isRtl:o},children:(0,d.jsxs)(w,{error:t,children:[(0,d.jsx)(w.HorizontalButtons,{supportLink:i,handleRefreshClick:s}),(0,d.jsx)(X,{target:"wpseo-seo-score-icon",scoreIndicator:"not-set"}),(0,d.jsx)(X,{target:"wpseo-readability-score-icon",scoreIndicator:"not-set"}),(0,d.jsx)(X,{target:"wpseo-inclusive-language-score-icon",scoreIndicator:"not-set"})]})})};Q.propTypes={error:o().object.isRequired};const J=window.yoast.externals.contexts,ee=window.yoast.styledComponents;var te=s.n(ee);const se=({theme:e,location:t,children:s})=>(0,d.jsx)(J.LocationProvider,{value:t,children:(0,d.jsx)(ee.ThemeProvider,{theme:e,children:s})});se.propTypes={theme:o().object.isRequired,location:o().oneOf(["sidebar","metabox","modal"]).isRequired,children:o().node.isRequired};const ie=se;function oe({theme:e}){return(0,d.jsx)(ie,{theme:e,location:"metabox",children:(0,d.jsx)(r.ErrorBoundary,{FallbackComponent:Q,children:(0,d.jsx)(t.Slot,{name:"YoastMetabox",children:e=>{return void 0===(t=e).length?t:(0,n.flatten)(t).sort((e,t)=>void 0===e.props.renderPriority?1:e.props.renderPriority-t.props.renderPriority);var t}})})})}const re=window.wp.compose;var ne=s(5547),ae=s.n(ne);const le=({className:e="",...t})=>(0,d.jsx)("span",{className:q()("yst-grow yst-overflow-hidden yst-overflow-ellipsis yst-whitespace-nowrap yst-font-wp","yst-text-[#555] yst-text-base yst-leading-[normal] yst-subpixel-antialiased yst-text-start",e),...t});le.displayName="MetaboxButton.Text",le.propTypes={className:o().string};const ce=({className:e="",...t})=>(0,d.jsx)("button",{type:"button",className:q()("yst-flex yst-items-center yst-w-full yst-pt-4 yst-pb-4 yst-pe-4 yst-ps-6 yst-space-x-2 rtl:yst-space-x-reverse","yst-border-t yst-border-t-[rgb(0,0,0,0.2)] yst-rounded-none yst-transition-all hover:yst-bg-[#f0f0f0]","focus:yst-outline focus:yst-outline-[1px] focus:yst-outline-[color:#0066cd] focus:-yst-outline-offset-1 focus:yst-shadow-[0_0_3px_rgba(8,74,103,0.8)]",e),...t});ce.propTypes={className:o().string},ce.Text=le;const de=window.yoast.helpers,pe=te().div` | |
| 4 | + min-width: 600px; | |
| 5 | + | |
| 6 | + @media screen and ( max-width: 680px ) { | |
| 7 | + min-width: 0; | |
| 8 | + width: 86vw; | |
| 9 | + } | |
| 10 | +`,ue=(te().div` | |
| 11 | + @media screen and ( min-width: 600px ) { | |
| 12 | + max-width: 420px; | |
| 13 | + } | |
| 14 | +`,te()(K.Icon)` | |
| 15 | + float: ${(0,de.getDirectionalStyle)("right","left")}; | |
| 16 | + margin: ${(0,de.getDirectionalStyle)("0 0 16px 16px","0 16px 16px 0")}; | |
| 17 | + | |
| 18 | + && { | |
| 19 | + width: 150px; | |
| 20 | + height: 150px; | |
| 21 | + | |
| 22 | + @media screen and ( max-width: 680px ) { | |
| 23 | + width: 80px; | |
| 24 | + height: 80px; | |
| 25 | + } | |
| 26 | + } | |
| 27 | +`,({title:e="Yoast SEO",className:s="yoast yoast-gutenberg-modal",showYoastIcon:i=!0,children:o=null,additionalClassName:r="",...n})=>{const a=i?(0,d.jsx)("span",{className:"yoast-icon"}):null;return(0,d.jsx)(t.Modal,{title:e,className:`${s} ${r}`,icon:a,...n,children:o})});ue.propTypes={title:o().node,className:o().string,showYoastIcon:o().bool,children:o().oneOfType([o().node,o().arrayOf(o().node)]),additionalClassName:o().string};const he=ue;var ge,me;function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)({}).hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e},ye.apply(null,arguments)}const we=e=>f.createElement("svg",ye({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 425 456.27"},e),ge||(ge=f.createElement("path",{d:"M73 405.26a66.79 66.79 0 0 1-6.54-1.7 64.75 64.75 0 0 1-6.28-2.31c-1-.42-2-.89-3-1.37-1.49-.72-3-1.56-4.77-2.56-1.5-.88-2.71-1.64-3.83-2.39-.9-.61-1.8-1.26-2.68-1.92a70.154 70.154 0 0 1-5.08-4.19 69.21 69.21 0 0 1-8.4-9.17c-.92-1.2-1.68-2.25-2.35-3.24a70.747 70.747 0 0 1-3.44-5.64 68.29 68.29 0 0 1-8.29-32.55V142.13a68.26 68.26 0 0 1 8.29-32.55c1-1.92 2.21-3.82 3.44-5.64s2.55-3.58 4-5.27a69.26 69.26 0 0 1 14.49-13.25C50.37 84.19 52.27 83 54.2 82A67.59 67.59 0 0 1 73 75.09a68.75 68.75 0 0 1 13.75-1.39h169.66L263 55.39H86.75A86.84 86.84 0 0 0 0 142.13v196.09A86.84 86.84 0 0 0 86.75 425h11.32v-18.35H86.75A68.75 68.75 0 0 1 73 405.26zM368.55 60.85l-1.41-.53-6.41 17.18 1.41.53a68.06 68.06 0 0 1 8.66 4c1.93 1 3.82 2.2 5.65 3.43A69.19 69.19 0 0 1 391 98.67c1.4 1.68 2.72 3.46 3.95 5.27s2.39 3.72 3.44 5.64a68.29 68.29 0 0 1 8.29 32.55v264.52H233.55l-.44.76c-3.07 5.37-6.26 10.48-9.49 15.19L222 425h203V142.13a87.2 87.2 0 0 0-56.45-81.28z"})),me||(me=f.createElement("path",{stroke:"#000",strokeMiterlimit:10,strokeWidth:3.81,d:"M119.8 408.28v46c28.49-1.12 50.73-10.6 69.61-29.58 19.45-19.55 36.17-50 52.61-96L363.94 1.9H305l-98.25 272.89-48.86-153h-54l71.7 184.18a75.67 75.67 0 0 1 0 55.12c-7.3 18.68-20.25 40.66-55.79 47.19z"}))),fe=({onClick:e,title:t,id:s="",subTitle:i="",suffixIcon:o=null,SuffixHeroIcon:r=null,prefixIcon:n=null,children:a=null})=>(0,d.jsx)("div",{className:"yoast components-panel__body",children:(0,d.jsx)("h2",{className:"components-panel__body-title",children:(0,d.jsxs)("button",{id:s,onClick:e,className:"components-button components-panel__body-toggle",type:"button",children:[n&&(0,d.jsx)("span",{className:"yoast-icon-span",style:{fill:`${n&&n.color||""}`},children:(0,d.jsx)(K.SvgIcon,{size:n.size,icon:n.icon})}),(0,d.jsxs)("span",{className:"yoast-title-container",children:[(0,d.jsx)("div",{className:"yoast-title",children:t}),(0,d.jsx)("div",{className:"yoast-subtitle",children:i})]}),a,o&&(0,d.jsx)(K.SvgIcon,{size:o.size,icon:o.icon}),r]})})}),xe=fe;fe.propTypes={onClick:o().func.isRequired,title:o().string.isRequired,id:o().string,subTitle:o().string,suffixIcon:o().object,SuffixHeroIcon:o().element,prefixIcon:o().object,children:o().node};const be=window.moment;var ve=s.n(be);async function ke(e,t,s,i=200){try{const o=await e();return!!o&&(o.status===i?t(o):s(o))}catch(e){console.error(e.message)}}async function _e(e){try{return await B()(e)}catch(e){return e.error&&e.status?e:e instanceof Response&&await e.json()}}async function Te(e){return(0,n.isArray)(e)||(e=[e]),await _e({path:"yoast/v1/wincher/keyphrases/track",method:"POST",data:{keyphrases:e}})}const je=({data:e,mapChartDataToTableData:t=null,dataTableCaption:s,dataTableHeaderLabels:i,isDataTableVisuallyHidden:o=!0})=>e.length!==i.length?(0,d.jsx)("p",{children:(0,l.__)("The number of headers and header labels don't match.","wordpress-seo")}):(0,d.jsx)("div",{className:o?"screen-reader-text":null,children:(0,d.jsxs)("table",{children:[(0,d.jsx)("caption",{children:s}),(0,d.jsx)("thead",{children:(0,d.jsx)("tr",{children:i.map((e,t)=>(0,d.jsx)("th",{children:e},t))})}),(0,d.jsx)("tbody",{children:(0,d.jsx)("tr",{children:e.map((e,s)=>(0,d.jsx)("td",{children:t(e.y)},s))})})]})});je.propTypes={data:o().arrayOf(o().shape({x:o().number,y:o().number})).isRequired,mapChartDataToTableData:o().func,dataTableCaption:o().string.isRequired,dataTableHeaderLabels:o().array.isRequired,isDataTableVisuallyHidden:o().bool};const Re=je,Se=({data:t,width:s,height:i,fillColor:o=null,strokeColor:r="#000000",strokeWidth:n=1,className:a="",mapChartDataToTableData:l=null,dataTableCaption:c,dataTableHeaderLabels:p,isDataTableVisuallyHidden:u=!0})=>{const h=Math.max(1,Math.max(...t.map(e=>e.x))),g=Math.max(1,Math.max(...t.map(e=>e.y))),m=i-n,y=t.map(e=>`${e.x/h*s},${m-e.y/g*m+n}`).join(" "),w=`0,${m+n} `+y+` ${s},${m+n}`;return(0,d.jsxs)(e.Fragment,{children:[(0,d.jsxs)("svg",{width:s,height:i,viewBox:`0 0 ${s} ${i}`,className:a,role:"img","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("polygon",{fill:o,points:w}),(0,d.jsx)("polyline",{fill:"none",stroke:r,strokeWidth:n,strokeLinejoin:"round",strokeLinecap:"round",points:y})]}),l&&(0,d.jsx)(Re,{data:t,mapChartDataToTableData:l,dataTableCaption:c,dataTableHeaderLabels:p,isDataTableVisuallyHidden:u})]})};Se.propTypes={data:o().arrayOf(o().shape({x:o().number,y:o().number})).isRequired,width:o().number.isRequired,height:o().number.isRequired,fillColor:o().string,strokeColor:o().string,strokeWidth:o().number,className:o().string,mapChartDataToTableData:o().func,dataTableCaption:o().string.isRequired,dataTableHeaderLabels:o().array.isRequired,isDataTableVisuallyHidden:o().bool};const Ie=Se,Ce=()=>(0,d.jsxs)("p",{className:"yoast-wincher-seo-performance-modal__loading-message",children:[(0,l.__)("Tracking the ranking position…","wordpress-seo")," ",(0,d.jsx)(K.SvgIcon,{icon:"loading-spinner"})]}),Ee=te()(K.SvgIcon)` | |
| 28 | + margin-left: 2px; | |
| 29 | + flex-shrink: 0; | |
| 30 | + rotate: ${e=>e.isImproving?"-90deg":"90deg"}; | |
| 31 | +`,Le=te().span` | |
| 32 | + color: ${e=>e.isImproving?"#69AB56":"#DC3332"}; | |
| 33 | + font-size: 13px; | |
| 34 | + font-weight: 600; | |
| 35 | + line-height: 20px; | |
| 36 | + margin-right: 2px; | |
| 37 | + margin-left: 12px; | |
| 38 | +`,Ae=te().td` | |
| 39 | + padding-right: 0 !important; | |
| 40 | + | |
| 41 | + & > div { | |
| 42 | + margin: 0px; | |
| 43 | + } | |
| 44 | +`,Pe=te().td` | |
| 45 | + padding-left: 2px !important; | |
| 46 | +`,qe=te().td.attrs({className:"yoast-table--nopadding"})` | |
| 47 | + & > div { | |
| 48 | + justify-content: center; | |
| 49 | + } | |
| 50 | +`,Fe=te().div` | |
| 51 | + display: flex; | |
| 52 | + align-items: center; | |
| 53 | + & > a { | |
| 54 | + box-sizing: border-box; | |
| 55 | + } | |
| 56 | +`,Me=te().button` | |
| 57 | + background: none; | |
| 58 | + color: inherit; | |
| 59 | + border: none; | |
| 60 | + padding: 0; | |
| 61 | + font: inherit; | |
| 62 | + cursor: pointer; | |
| 63 | + outline: inherit; | |
| 64 | + display: flex; | |
| 65 | + align-items: center; | |
| 66 | +`,De=te().tr` | |
| 67 | + background-color: ${e=>e.isEnabled?"#FFFFFF":"#F9F9F9"} !important; | |
| 68 | +`;function Oe(e){return Math.round(100*e)}function Ne({chartData:e={}}){if((0,n.isEmpty)(e)||(0,n.isEmpty)(e.position))return"?";const t=function(e){return Array.from({length:e.position.history.length},(e,t)=>t+1).map(e=>(0,l.sprintf)((0,l._n)("%d day","%d days",e,"wordpress-seo"),e))}(e),s=e.position.history.map((e,t)=>({x:t,y:31-e.value}));return(0,d.jsx)(Ie,{width:66,height:24,data:s,strokeWidth:1.8,strokeColor:"#498afc",fillColor:"#ade3fc",mapChartDataToTableData:Oe,dataTableCaption:(0,l.__)("Keyphrase position in the last 90 days on a scale from 0 to 30.","wordpress-seo"),dataTableHeaderLabels:t})}function $e({keyphrase:e,isEnabled:t,toggleAction:s,isLoading:i}){return i?(0,d.jsx)(K.SvgIcon,{icon:"loading-spinner"}):(0,d.jsx)(K.Toggle,{id:`toggle-keyphrase-tracking-${e}`,className:"wincher-toggle",isEnabled:t,onSetToggleState:s,showToggleStateLabel:!1})}function Ue(e){return!e||!e.position||e.position.value>30?"> 30":e.position.value}Ne.propTypes={chartData:o().object};const We=({rowData:t={}})=>{var s;if(null==t||null===(s=t.position)||void 0===s||!s.change)return(0,d.jsx)(Ne,{chartData:t});const i=t.position.change<0;return(0,d.jsxs)(e.Fragment,{children:[(0,d.jsx)(Ne,{chartData:t}),(0,d.jsx)(Le,{isImproving:i,children:Math.abs(t.position.change)}),(0,d.jsx)(Ee,{icon:"caret-right",color:i?"#69AB56":"#DC3332",size:"14px",isImproving:i})]})};function He({rowData:t,websiteId:s,keyphrase:i,onSelectKeyphrases:o}){const r=(0,e.useCallback)(()=>{o([i])},[o,i]),a=!(0,n.isEmpty)(t),c=t&&t.updated_at&&ve()(t.updated_at)>=ve()().subtract(7,"days"),p=t?`https://app.wincher.com/websites/${s}/keywords?serp=${t.id}&utm_medium=plugin&utm_source=yoast&referer=yoast&partner=yoast`:null;return a?c?(0,d.jsxs)(e.Fragment,{children:[(0,d.jsx)("td",{children:(0,d.jsxs)(Fe,{children:[Ue(t),(0,d.jsx)(K.ButtonStyledLink,{variant:"secondary",href:p,style:{height:28,marginLeft:12},rel:"noopener",target:"_blank",children:(0,l.__)("View","wordpress-seo")})]})}),(0,d.jsx)("td",{className:"yoast-table--nopadding",children:(0,d.jsx)(Me,{type:"button",onClick:r,children:(0,d.jsx)(We,{rowData:t})})}),(0,d.jsx)("td",{children:(u=t.updated_at,ve()(u).fromNow())})]}):(0,d.jsx)("td",{className:"yoast-table--nopadding",colSpan:"3",children:(0,d.jsx)(Ce,{})}):(0,d.jsx)("td",{className:"yoast-table--nopadding",colSpan:"3",children:(0,d.jsx)("i",{children:(0,l.__)("Activate tracking to show the ranking position","wordpress-seo")})});var u}function Be({keyphrase:t,rowData:s={},onTrackKeyphrase:i=n.noop,onUntrackKeyphrase:o=n.noop,isFocusKeyphrase:r=!1,isDisabled:a=!1,isLoading:l=!1,websiteId:c="",isSelected:p,onSelectKeyphrases:u}){var h;const g=!(0,n.isEmpty)(s),m=!(0,n.isEmpty)(null==s||null===(h=s.position)||void 0===h?void 0:h.history),y=(0,e.useCallback)(()=>{a||(g?o(t,s.id):i(t))},[t,i,o,g,s,a]),w=(0,e.useCallback)(()=>{u(e=>p?e.filter(e=>e!==t):e.concat(t))},[u,p,t]);return(0,d.jsxs)(De,{isEnabled:g,children:[(0,d.jsx)(Ae,{children:m&&(0,d.jsx)(K.Checkbox,{id:"select-"+t,onChange:w,checked:p,label:""})}),(0,d.jsxs)(Pe,{children:[t,r&&(0,d.jsx)("span",{children:"*"})]}),He({rowData:s,websiteId:c,keyphrase:t,onSelectKeyphrases:u}),(0,d.jsx)(qe,{children:$e({keyphrase:t,isEnabled:g,toggleAction:y,isLoading:l})})]})}We.propTypes={rowData:o().object},Be.propTypes={rowData:o().object,keyphrase:o().string.isRequired,onTrackKeyphrase:o().func,onUntrackKeyphrase:o().func,isFocusKeyphrase:o().bool,isDisabled:o().bool,isLoading:o().bool,websiteId:o().string,isSelected:o().bool.isRequired,onSelectKeyphrases:o().func.isRequired};const Ke=(0,de.makeOutboundLink)(),Ye=te().span` | |
| 69 | + display: block; | |
| 70 | + font-style: italic; | |
| 71 | + | |
| 72 | + @media (min-width: 782px) { | |
| 73 | + display: inline; | |
| 74 | + position: absolute; | |
| 75 | + ${(0,de.getDirectionalStyle)("right","left")}: 8px; | |
| 76 | + } | |
| 77 | +`,ze=te().div` | |
| 78 | + width: 100%; | |
| 79 | + overflow-y: auto; | |
| 80 | +`,Ve=te().th` | |
| 81 | + pointer-events: ${e=>e.isDisabled?"none":"initial"}; | |
| 82 | + padding-right: 0 !important; | |
| 83 | + | |
| 84 | + & > div { | |
| 85 | + margin: 0px; | |
| 86 | + } | |
| 87 | +`,Ge=te().th` | |
| 88 | + padding-left: 2px !important; | |
| 89 | +`,Ze=t=>{const s=(0,e.useRef)();return(0,e.useEffect)(()=>{s.current=t}),s.current},Xe=({addTrackedKeyphrase:t,isLoggedIn:s=!1,isNewlyAuthenticated:i=!1,keyphrases:o=[],newRequest:r,removeTrackedKeyphrase:a,setRequestFailed:c,setKeyphraseLimitReached:p,setRequestSucceeded:u,setTrackedKeyphrases:h,setHasTrackedAll:g,trackAll:m=!1,trackedKeyphrases:y=null,websiteId:w="",permalink:f,focusKeyphrase:x="",startAt:b=null,selectedKeyphrases:v,onSelectKeyphrases:k})=>{const _=(0,e.useRef)(),T=(0,e.useRef)(),j=(0,e.useRef)(!1),[R,S]=(0,e.useState)([]),I=(0,e.useCallback)(e=>{const t=e.toLowerCase();return y&&!(0,n.isEmpty)(y)&&Object.prototype.hasOwnProperty.call(y,t)?y[t]:null},[y]),C=(0,e.useMemo)(()=>async()=>{await ke(()=>{var e;return T.current&&T.current.abort(),T.current="undefined"==typeof AbortController?null:new AbortController,async function(e=null,t=null,s=null,i){return await _e({path:"yoast/v1/wincher/keyphrases",method:"POST",data:{keyphrases:e,permalink:s,startAt:t},signal:i})}(o,b,f,null===(e=T.current)||void 0===e?void 0:e.signal)},e=>{u(e),h(e.results)},e=>{c(e)})},[u,c,h,o,f,b]),E=(0,e.useCallback)(async e=>{const s=(Array.isArray(e)?e:[e]).map(e=>e.toLowerCase());S(e=>[...e,...s]),await ke(()=>Te(s),e=>{u(e),t(e.results),C()},e=>{400===e.status&&e.limit&&p(e.limit),c(e)},201),S(e=>(0,n.without)(e,...s))},[u,c,p,t,C]),L=(0,e.useCallback)(async(e,t)=>{e=e.toLowerCase(),S(t=>[...t,e]),await ke(()=>async function(e){return await _e({path:"yoast/v1/wincher/keyphrases/untrack",method:"DELETE",data:{keyphraseID:e}})}(t),t=>{u(t),a(e)},e=>{c(e)}),S(t=>(0,n.without)(t,e))},[u,a,c]),A=(0,e.useCallback)(async e=>{r(),await E(e)},[r,E]),P=Ze(f),q=Ze(o),F=Ze(b),M=f&&b;(0,e.useEffect)(()=>{s&&M&&(f!==P||(0,n.difference)(o,q).length||b!==F)&&C()},[s,f,P,o,q,C,M,b,F]),(0,e.useEffect)(()=>{if(s&&m&&null!==y){const e=o.filter(e=>!I(e));e.length&&E(e),g()}},[s,m,y,E,g,I,o]),(0,e.useEffect)(()=>{i&&!j.current&&(C(),j.current=!0)},[i,C]),(0,e.useEffect)(()=>{if(s&&!(0,n.isEmpty)(y))return(0,n.filter)(y,e=>(0,n.isEmpty)(e.updated_at)).length>0&&(_.current=setInterval(()=>{C()},1e4)),()=>{clearInterval(_.current)}},[s,y,C]);const D=s&&null===y,O=(0,e.useMemo)(()=>(0,n.isEmpty)(y)?[]:Object.values(y).filter(e=>{var t;return!(0,n.isEmpty)(null==e||null===(t=e.position)||void 0===t?void 0:t.history)}).map(e=>e.keyword),[y]),N=(0,e.useMemo)(()=>v.length>0&&O.length>0&&O.every(e=>v.includes(e)),[v,O]),$=(0,e.useCallback)(()=>{k(N?[]:O)},[k,N,O]),U=(0,e.useMemo)(()=>(0,n.orderBy)(o,[e=>Object.values(y||{}).map(e=>e.keyword).includes(e)],["desc"]),[o,y]);return o&&!(0,n.isEmpty)(o)&&(0,d.jsxs)(e.Fragment,{children:[(0,d.jsx)(ze,{children:(0,d.jsxs)("table",{className:"yoast yoast-table",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{children:[(0,d.jsx)(Ve,{isDisabled:0===O.length,children:(0,d.jsx)(K.Checkbox,{id:"select-all",onChange:$,checked:N,label:""})}),(0,d.jsx)(Ge,{scope:"col",abbr:(0,l.__)("Keyphrase","wordpress-seo"),children:(0,l.__)("Keyphrase","wordpress-seo")}),(0,d.jsx)("th",{scope:"col",abbr:(0,l.__)("Position","wordpress-seo"),children:(0,l.__)("Position","wordpress-seo")}),(0,d.jsx)("th",{scope:"col",abbr:(0,l.__)("Position over time","wordpress-seo"),children:(0,l.__)("Position over time","wordpress-seo")}),(0,d.jsx)("th",{scope:"col",abbr:(0,l.__)("Last updated","wordpress-seo"),children:(0,l.__)("Last updated","wordpress-seo")}),(0,d.jsx)("th",{scope:"col",abbr:(0,l.__)("Tracking","wordpress-seo"),children:(0,l.__)("Tracking","wordpress-seo")})]})}),(0,d.jsx)("tbody",{children:U.map((e,t)=>(0,d.jsx)(Be,{keyphrase:e,onTrackKeyphrase:A,onUntrackKeyphrase:L,rowData:I(e),isFocusKeyphrase:e===x.trim().toLowerCase(),websiteId:w,isDisabled:!s,isLoading:D||R.indexOf(e.toLowerCase())>=0,isSelected:v.includes(e),onSelectKeyphrases:k},`trackable-keyphrase-${t}`))})]})}),(0,d.jsxs)("p",{style:{marginBottom:0,position:"relative"},children:[(0,d.jsx)(Ke,{href:wpseoAdminGlobalL10n["links.wincher.login"],children:(0,l.sprintf)(/* translators: %s expands to Wincher */ /* translators: %s expands to Wincher */ | |
| 90 | +(0,l.__)("Get more insights over at %s","wordpress-seo"),"Wincher")}),(0,d.jsx)(Ye,{children:(0,l.__)("* focus keyphrase","wordpress-seo")})]})]})};Xe.propTypes={addTrackedKeyphrase:o().func.isRequired,isLoggedIn:o().bool,isNewlyAuthenticated:o().bool,keyphrases:o().array,newRequest:o().func.isRequired,removeTrackedKeyphrase:o().func.isRequired,setRequestFailed:o().func.isRequired,setKeyphraseLimitReached:o().func.isRequired,setRequestSucceeded:o().func.isRequired,setTrackedKeyphrases:o().func.isRequired,setHasTrackedAll:o().func.isRequired,trackAll:o().bool,trackedKeyphrases:o().object,websiteId:o().string,permalink:o().string.isRequired,focusKeyphrase:o().string,startAt:o().string,selectedKeyphrases:o().arrayOf(o().string).isRequired,onSelectKeyphrases:o().func.isRequired};const Qe=Xe,Je=(0,re.compose)([(0,a.withSelect)(e=>{const{getWincherWebsiteId:t,getWincherTrackableKeyphrases:s,getWincherLoginStatus:i,getWincherPermalink:o,getFocusKeyphrase:r,isWincherNewlyAuthenticated:n,shouldWincherTrackAll:a}=e("yoast-seo/editor");return{focusKeyphrase:r(),keyphrases:s(),isLoggedIn:i(),trackAll:a(),websiteId:t(),isNewlyAuthenticated:n(),permalink:o()}}),(0,a.withDispatch)(e=>{const{setWincherNewRequest:t,setWincherRequestSucceeded:s,setWincherRequestFailed:i,setWincherSetKeyphraseLimitReached:o,setWincherTrackedKeyphrases:r,setWincherTrackingForKeyphrase:n,setWincherTrackAllKeyphrases:a,unsetWincherTrackingForKeyphrase:l}=e("yoast-seo/editor");return{newRequest:()=>{t()},setRequestSucceeded:e=>{s(e)},setRequestFailed:e=>{i(e)},setKeyphraseLimitReached:e=>{o(e)},addTrackedKeyphrase:e=>{n(e)},removeTrackedKeyphrase:e=>{l(e)},setTrackedKeyphrases:e=>{r(e)},setHasTrackedAll:()=>{a(!1)}}})])(Qe);class et{constructor(e,t={},s={}){this.url=e,this.origin=new URL(e).origin,this.eventHandlers=Object.assign({success:{type:"",callback:()=>{}},error:{type:"",callback:()=>{}}},t),this.options=Object.assign({height:570,width:340,title:""},s),this.popup=null,this.createPopup=this.createPopup.bind(this),this.messageHandler=this.messageHandler.bind(this),this.getPopup=this.getPopup.bind(this)}createPopup(){const{height:e,width:t,title:s}=this.options,i=["top="+(window.top.outerHeight/2+window.top.screenY-e/2),"left="+(window.top.outerWidth/2+window.top.screenX-t/2),"width="+t,"height="+e,"resizable=1","scrollbars=1","status=0"];this.popup&&!this.popup.closed||(this.popup=window.open(this.url,s,i.join(","))),this.popup&&this.popup.focus(),window.addEventListener("message",this.messageHandler,!1)}async messageHandler(e){const{data:t,source:s,origin:i}=e;i===this.origin&&this.popup===s&&(t.type===this.eventHandlers.success.type&&(this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),await this.eventHandlers.success.callback(t)),t.type===this.eventHandlers.error.type&&(this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),await this.eventHandlers.error.callback(t)))}getPopup(){return this.popup}isClosed(){return!this.popup||this.popup.closed}focus(){this.isClosed()||this.popup.focus()}}const tt=()=>(0,d.jsx)(K.Alert,{type:"info",children:(0,l.sprintf)(/* translators: %s: Expands to "Wincher". */ /* translators: %s: Expands to "Wincher". */ | |
| 91 | +(0,l.__)("Automatic tracking of keyphrases is enabled. Your keyphrase(s) will automatically be tracked by %s when you publish your post.","wordpress-seo"),"Wincher")}),st=()=>(0,d.jsx)(K.Alert,{type:"success",children:(0,l.sprintf)(/* translators: %s: Expands to "Wincher". */ /* translators: %s: Expands to "Wincher". */ | |
| 92 | +(0,l.__)("You have successfully connected to %s! You can now track the SEO performance for the keyphrase(s) of this page.","wordpress-seo"),"Wincher")}),it=()=>(0,d.jsx)(K.Alert,{type:"info",children:(0,l.sprintf)(/* translators: %s: Expands to "Wincher". */ /* translators: %s: Expands to "Wincher". */ | |
| 93 | +(0,l.__)("%s is currently tracking the ranking position(s) of your page. This may take a few minutes. Please wait or check back later.","wordpress-seo"),"Wincher")}),ot=(0,de.makeOutboundLink)(),rt=(0,de.makeOutboundLink)(),nt=()=>{const e=(0,l.sprintf)(/* translators: %1$s expands to a link to Wincher, %2$s expands to a link to the keyphrase tracking article on Yoast.com */ /* translators: %1$s expands to a link to Wincher, %2$s expands to a link to the keyphrase tracking article on Yoast.com */ | |
| 94 | +(0,l.__)("With %1$s you can track the ranking position of your page in the search results based on your keyphrase(s). %2$s","wordpress-seo"),"<wincherLink/>","<wincherReadMoreLink/>");return(0,d.jsx)("p",{children:c(e,{wincherLink:(0,d.jsx)(ot,{href:wpseoAdminGlobalL10n["links.wincher.website"],children:"Wincher"}),wincherReadMoreLink:(0,d.jsx)(rt,{href:wpseoAdminL10n["shortlinks.wincher.seo_performance"],children:(0,l.__)("Read more about keyphrase tracking with Wincher","wordpress-seo")})})})},at=(0,de.makeOutboundLink)(),lt=({limit:e=10})=>{const t=(0,l.sprintf)(/* translators: %1$d expands to the amount of allowed keyphrases on a free account, %2$s expands to a link to Wincher plans. */ /* translators: %1$d expands to the amount of allowed keyphrases on a free account, %2$s expands to a link to Wincher plans. */ | |
| 95 | +(0,l.__)("You've reached the maximum amount of %1$d keyphrases you can add to your Wincher account. If you wish to add more keyphrases, please %2$s.","wordpress-seo"),e,"<UpdateWincherPlanLink/>");return(0,d.jsx)(K.Alert,{type:"error",children:c(t,{UpdateWincherPlanLink:(0,d.jsx)(at,{href:wpseoAdminGlobalL10n["links.wincher.pricing"],children:(0,l.sprintf)(/* translators: %s : Expands to "Wincher". */ /* translators: %s : Expands to "Wincher". */ | |
| 96 | +(0,l.__)("upgrade your %s plan","wordpress-seo"),"Wincher")})})})};lt.propTypes={limit:o().number};const ct=lt,dt=()=>(0,d.jsx)(K.Alert,{type:"error",children:(0,l.__)("No keyphrase has been set. Please set a keyphrase first.","wordpress-seo")}),pt=()=>(0,d.jsx)(K.Alert,{type:"error",children:(0,l.__)("Before you can track your SEO performance make sure to set either the post’s title and save it as a draft or manually set the post’s slug.","wordpress-seo")}),ut=({onReconnect:e,className:t=""})=>{const s=(0,l.sprintf)(/* translators: %s expands to a link to open the Wincher login popup. */ /* translators: %s expands to a link to open the Wincher login popup. */ | |
| 97 | +(0,l.__)("It seems like something went wrong when retrieving your website's data. Please %s and try again.","wordpress-seo"),"<reconnectToWincher/>","Wincher");return(0,d.jsx)(K.Alert,{type:"error",className:t,children:c(s,{reconnectToWincher:(0,d.jsx)("a",{href:"#",onClick:t=>{t.preventDefault(),e()},children:(0,l.sprintf)(/* translators: %s : Expands to "Wincher". */ /* translators: %s : Expands to "Wincher". */ | |
| 98 | +(0,l.__)("reconnect to %s","wordpress-seo"),"Wincher")})})})};ut.propTypes={onReconnect:o().func.isRequired,className:o().string};const ht=ut,gt=()=>(0,d.jsx)(K.Alert,{type:"error",children:(0,l.__)("Something went wrong while tracking the ranking position(s) of your page. Please try again later.","wordpress-seo")}),mt=te().p` | |
| 99 | + color: ${Y.colors.$color_pink_dark}; | |
| 100 | + font-size: 14px; | |
| 101 | + font-weight: 700; | |
| 102 | + margin: 13px 0 10px; | |
| 103 | +`,yt=te()(K.SvgIcon)` | |
| 104 | + margin-right: 5px; | |
| 105 | + vertical-align: middle; | |
| 106 | +`,wt=te().button` | |
| 107 | + position: absolute; | |
| 108 | + top: 9px; | |
| 109 | + right: 9px; | |
| 110 | + border: none; | |
| 111 | + background: none; | |
| 112 | + cursor: pointer; | |
| 113 | +`,ft=te().p` | |
| 114 | + font-size: 13px; | |
| 115 | + font-weight: 500; | |
| 116 | + margin: 10px 0 13px; | |
| 117 | +`,xt=te().div` | |
| 118 | + position: relative; | |
| 119 | + background: ${e=>e.isTitleShortened?"#f5f7f7":"transparent"}; | |
| 120 | + border: 1px solid #c7c7c7; | |
| 121 | + border-left: 4px solid${Y.colors.$color_pink_dark}; | |
| 122 | + padding: 0 16px; | |
| 123 | + margin-bottom: 1.5em; | |
| 124 | +`,bt=({limit:e,usage:t,isTitleShortened:s=!1,isFreeAccount:i=!1})=>{const o=(0,l.sprintf)( | |
| 125 | +/* Translators: %1$s expands to the number of used keywords. | |
| 126 | + * %2$s expands to the account keywords limit. | |
| 127 | + */ | |
| 128 | +/* Translators: %1$s expands to the number of used keywords. | |
| 129 | + * %2$s expands to the account keywords limit. | |
| 130 | + */ | |
| 131 | +(0,l.__)("Your are tracking %1$s out of %2$s keyphrases included in your free account.","wordpress-seo"),t,e),r=(0,l.sprintf)( | |
| 132 | +/* Translators: %1$s expands to the number of used keywords. | |
| 133 | + * %2$s expands to the account keywords limit. | |
| 134 | + */ | |
| 135 | +/* Translators: %1$s expands to the number of used keywords. | |
| 136 | + * %2$s expands to the account keywords limit. | |
| 137 | + */ | |
| 138 | +(0,l.__)("Your are tracking %1$s out of %2$s keyphrases included in your account.","wordpress-seo"),t,e),n=i?o:r,a=(0,l.sprintf)( | |
| 139 | +/* Translators: %1$s expands to the number of used keywords. | |
| 140 | + * %2$s expands to the account keywords limit. | |
| 141 | + */ | |
| 142 | +/* Translators: %1$s expands to the number of used keywords. | |
| 143 | + * %2$s expands to the account keywords limit. | |
| 144 | + */ | |
| 145 | +(0,l.__)("Keyphrases tracked: %1$s/%2$s","wordpress-seo"),t,e),c=s?a:n;return(0,d.jsxs)(mt,{children:[s&&(0,d.jsx)(yt,{icon:"exclamation-triangle",color:Y.colors.$color_pink_dark,size:"14px"}),c]})};bt.propTypes={limit:o().number.isRequired,usage:o().number.isRequired,isTitleShortened:o().bool,isFreeAccount:o().bool};const vt=(0,de.makeOutboundLink)(),kt=({discount:e,months:t})=>{const s=(0,d.jsx)(vt,{href:wpseoAdminGlobalL10n["links.wincher.upgrade"],style:{fontWeight:600},children:(0,l.sprintf)(/* Translators: %s : Expands to "Wincher". */ /* Translators: %s : Expands to "Wincher". */ | |
| 146 | +(0,l.__)("Click here to upgrade your %s plan","wordpress-seo"),"Wincher")});if(!e||!t)return(0,d.jsx)(ft,{children:s});const i=100*e,o=(0,l.sprintf)( | |
| 147 | +/* Translators: %1$s expands to upgrade account link. | |
| 148 | + * %2$s expands to the upgrade discount value. | |
| 149 | + * %3$s expands to the upgrade discount duration e.g. 2 months. | |
| 150 | + */ | |
| 151 | +/* Translators: %1$s expands to upgrade account link. | |
| 152 | + * %2$s expands to the upgrade discount value. | |
| 153 | + * %3$s expands to the upgrade discount duration e.g. 2 months. | |
| 154 | + */ | |
| 155 | +(0,l.__)("%1$s and get an exclusive %2$s discount for %3$s month(s).","wordpress-seo"),"<wincherAccountUpgradeLink/>",i+"%",t);return(0,d.jsx)(ft,{children:c(o,{wincherAccountUpgradeLink:s})})};kt.propTypes={discount:o().number,months:o().number};const _t=({onClose:t=null,isTitleShortened:s=!1,trackingInfo:i=null})=>{const o=(()=>{const[t,s]=(0,e.useState)(null);return(0,e.useEffect)(()=>{t||async function(){return await _e({path:"yoast/v1/wincher/account/upgrade-campaign",method:"GET"})}().then(e=>s(e))},[t]),t})();if(null===i)return null;const{limit:r,usage:n}=i;if(!(r&&n/r>=.8))return null;const a=Boolean(null==o?void 0:o.discount);return(0,d.jsxs)(xt,{isTitleShortened:s,children:[t&&(0,d.jsx)(wt,{type:"button","aria-label":(0,l.__)("Close the upgrade callout","wordpress-seo"),onClick:t,children:(0,d.jsx)(K.SvgIcon,{icon:"times-circle",color:Y.colors.$color_pink_dark,size:"14px"})}),(0,d.jsx)(bt,{...i,isTitleShortened:s,isFreeAccount:a}),(0,d.jsx)(kt,{discount:null==o?void 0:o.discount,months:null==o?void 0:o.months})]})};_t.propTypes={onClose:o().func,isTitleShortened:o().bool,trackingInfo:o().object};const Tt=_t,jt=window.yoast["chart.js"],Rt="label";function St(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function It(e,t){e.labels=t}function Ct(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Rt;const i=[];e.datasets=t.map(t=>{const o=e.datasets.find(e=>e[s]===t[s]);return o&&t.data&&!i.includes(o)?(i.push(o),Object.assign(o,t),o):{...t}})}function Et(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rt;const s={labels:[],datasets:[]};return It(s,e.labels),Ct(s,e.datasets,t),s}function Lt(e,t){const{height:s=150,width:i=300,redraw:o=!1,datasetIdKey:r,type:n,data:a,options:l,plugins:c=[],fallbackContent:d,updateMode:p,...u}=e,h=(0,f.useRef)(null),g=(0,f.useRef)(),m=()=>{h.current&&(g.current=new jt.Chart(h.current,{type:n,data:Et(a,r),options:l&&{...l},plugins:c}),St(t,g.current))},y=()=>{St(t,null),g.current&&(g.current.destroy(),g.current=null)};return(0,f.useEffect)(()=>{!o&&g.current&&l&&function(e,t){const s=e.options;s&&t&&Object.assign(s,t)}(g.current,l)},[o,l]),(0,f.useEffect)(()=>{!o&&g.current&&It(g.current.config.data,a.labels)},[o,a.labels]),(0,f.useEffect)(()=>{!o&&g.current&&a.datasets&&Ct(g.current.config.data,a.datasets,r)},[o,a.datasets]),(0,f.useEffect)(()=>{g.current&&(o?(y(),setTimeout(m)):g.current.update(p))},[o,l,a.labels,a.datasets,p]),(0,f.useEffect)(()=>{g.current&&(y(),setTimeout(m))},[n]),(0,f.useEffect)(()=>(m(),()=>y()),[]),f.createElement("canvas",Object.assign({ref:h,role:"img",height:s,width:i},u),d)}const At=(0,f.forwardRef)(Lt);function Pt(e,t){return jt.Chart.register(t),(0,f.forwardRef)((t,s)=>f.createElement(At,Object.assign({},t,{ref:s,type:e})))}const qt=Pt("line",jt.LineController),Ft={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};jt._adapters._date.override("function"==typeof ve()?{_id:"moment",formats:function(){return Ft},parse:function(e,t){return"string"==typeof e&&"string"==typeof t?e=ve()(e,t):e instanceof ve()||(e=ve()(e)),e.isValid()?e.valueOf():null},format:function(e,t){return ve()(e).format(t)},add:function(e,t,s){return ve()(e).add(t,s).valueOf()},diff:function(e,t,s){return ve()(e).diff(ve()(t),s)},startOf:function(e,t,s){return e=ve()(e),"isoWeek"===t?(s=Math.trunc(Math.min(Math.max(0,s),6)),e.isoWeekday(s).startOf("day").valueOf()):e.startOf(t).valueOf()},endOf:function(e,t){return ve()(e).endOf(t).valueOf()}}:{}),Math.PI,Number.POSITIVE_INFINITY,Math.log10,Math.sign,"undefined"==typeof window||window.requestAnimationFrame,new Map,Object.create(null),Object.create(null),Number.EPSILON;const Mt=["top","right","bottom","left"];function Dt(e,t,s){const i={};s=s?"-"+s:"";for(let o=0;o<4;o++){const r=Mt[o];i[r]=parseFloat(e[t+"-"+r+s])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}!function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}}(),jt.Chart.register(jt.CategoryScale,jt.LineController,jt.LineElement,jt.PointElement,jt.LinearScale,jt.TimeScale,jt.Legend,jt.Tooltip);const Ot=["#ff983b","#ffa3f7","#3798ff","#ff3b3b","#acce81","#b51751","#3949ab","#26c6da","#ccb800","#de66ff","#4db6ac","#ffab91","#45f5f1","#77f210","#90a4ae","#ffd54f","#006b5e","#8ec7d2","#b1887c","#cc9300"];function Nt({datasets:t,isChartShown:s,keyphrases:i}){if(!s)return null;const o=(0,e.useMemo)(()=>Object.fromEntries([...i].sort().map((e,t)=>[e,Ot[t%Ot.length]])),[i]),r=t.map(e=>{const t=o[e.label];return{...e,data:e.data.map(({datetime:e,value:t})=>({x:e,y:t})),lineTension:0,pointRadius:1,pointHoverRadius:4,borderWidth:2,pointHitRadius:6,backgroundColor:t,borderColor:t}}).filter(e=>!1!==e.selected);return(0,d.jsx)(qt,{height:100,data:{datasets:r},options:{plugins:{legend:{display:!0,position:"bottom",labels:{color:"black",usePointStyle:!0,boxHeight:7,boxWidth:7},onClick:n.noop},tooltip:{enabled:!0,callbacks:{title:e=>ve()(e[0].raw.x).utc().format("YYYY-MM-DD")},titleAlign:"center",mode:"xPoint",position:"nearest",usePointStyle:!0,boxHeight:7,boxWidth:7,boxPadding:2}},scales:{x:{bounds:"ticks",type:"time",time:{unit:"day",minUnit:"day"},grid:{display:!1},ticks:{autoSkipPadding:50,maxRotation:0,color:"black"}},y:{bounds:"ticks",offset:!0,reverse:!0,ticks:{precision:0,color:"black"},max:31}}}})}jt.Interaction.modes.xPoint=(e,t,s,i)=>{const o=function(e,t){if("native"in e)return e;const{canvas:s,currentDevicePixelRatio:i}=t,o=(h=s).ownerDocument.defaultView.getComputedStyle(h,null),r="border-box"===o.boxSizing,n=Dt(o,"padding"),a=Dt(o,"border","width"),{x:l,y:c,box:d}=function(e,t){const s=e.touches,i=s&&s.length?s[0]:e,{offsetX:o,offsetY:r}=i;let n,a,l=!1;if(((e,t,s)=>(e>0||t>0)&&(!s||!s.shadowRoot))(o,r,e.target))n=o,a=r;else{const e=t.getBoundingClientRect();n=i.clientX-e.left,a=i.clientY-e.top,l=!0}return{x:n,y:a,box:l}}(e,s),p=n.left+(d&&a.left),u=n.top+(d&&a.top);var h;let{width:g,height:m}=t;return r&&(g-=n.width+a.width,m-=n.height+a.height),{x:Math.round((l-p)/g*s.width/i),y:Math.round((c-u)/m*s.height/i)}}(t,e);let r=[];if(jt.Interaction.evaluateInteractionItems(e,"x",o,(e,t,s)=>{e.inXRange(o.x,i)&&r.push({element:e,datasetIndex:t,index:s})}),0===r.length)return r;const n=r.reduce((e,t)=>Math.abs(o.x-e.element.x)<Math.abs(o.x-t.element.x)?e:t).element.x;return r=r.filter(e=>e.element.x===n),r.some(e=>Math.abs(e.element.y-o.y)<10)?r:[]},Nt.propTypes={datasets:o().arrayOf(o().shape({label:o().string.isRequired,data:o().arrayOf(o().shape({datetime:o().string.isRequired,value:o().number.isRequired})).isRequired,selected:o().bool})).isRequired,isChartShown:o().bool.isRequired,keyphrases:o().array.isRequired};const $t=({response:e,onLogin:t})=>[401,403,404].includes(e.status)?(0,d.jsx)(ht,{onReconnect:t}):(0,d.jsx)(gt,{});$t.propTypes={response:o().object.isRequired,onLogin:o().func.isRequired};const Ut=({isSuccess:e,response:t={},allKeyphrasesMissRanking:s,onLogin:i,keyphraseLimitReached:o,limit:r})=>o?(0,d.jsx)(ct,{limit:r}):(0,n.isEmpty)(t)||e?s?(0,d.jsx)(it,{}):null:(0,d.jsx)($t,{response:t,onLogin:i});Ut.propTypes={isSuccess:o().bool.isRequired,allKeyphrasesMissRanking:o().bool.isRequired,response:o().object,onLogin:o().func.isRequired,keyphraseLimitReached:o().bool.isRequired,limit:o().number.isRequired};let Wt=null;const Ht=async({onAuthentication:e,setRequestSucceeded:t,setRequestFailed:s,keyphrases:i,addTrackedKeyphrase:o,setKeyphraseLimitReached:r})=>{if(Wt&&!Wt.isClosed())return void Wt.focus();const{url:n}=await async function(){return await _e({path:"yoast/v1/wincher/authorization-url",method:"GET"})}();Wt=new et(n,{success:{type:"wincher:oauth:success",callback:n=>(async({onAuthentication:e,setRequestSucceeded:t,setRequestFailed:s,keyphrases:i,addTrackedKeyphrase:o,setKeyphraseLimitReached:r},n)=>{await ke(()=>async function(e){const{code:t,websiteId:s}=e;return await _e({path:"yoast/v1/wincher/authenticate",method:"POST",data:{code:t,websiteId:s}})}(n),async a=>{e(!0,!0,n.websiteId.toString()),t(a);const l=(Array.isArray(i)?i:[i]).map(e=>e.toLowerCase());await ke(()=>Te(l),e=>{t(e),o(e.results)},e=>{400===e.status&&e.limit&&r(e.limit),s(e)},201);const c=Wt.getPopup();c&&c.close()},async e=>s(e))})({onAuthentication:e,setRequestSucceeded:t,setRequestFailed:s,keyphrases:i,addTrackedKeyphrase:o,setKeyphraseLimitReached:r},n)},error:{type:"wincher:oauth:error",callback:()=>e(!1,!1)}},{title:"Wincher_login",width:500,height:700}),Wt.createPopup()},Bt=e=>e.isLoggedIn?null:(0,d.jsx)("p",{children:(0,d.jsx)(K.NewButton,{onClick:e.onLogin,variant:"primary",children:(0,l.sprintf)(/* translators: %s expands to Wincher */ /* translators: %s expands to Wincher */ | |
| 156 | +(0,l.__)("Connect with %s","wordpress-seo"),"Wincher")})});Bt.propTypes={isLoggedIn:o().bool.isRequired,onLogin:o().func.isRequired};const Kt=te().div` | |
| 157 | + p { | |
| 158 | + margin: 1em 0; | |
| 159 | + } | |
| 160 | +`,Yt=te().div` | |
| 161 | + ${e=>e.isDisabled&&"\n\t\topacity: .5;\n\t\tpointer-events: none;\n\t"}; | |
| 162 | +`,zt=te().div` | |
| 163 | + font-weight: var(--yoast-font-weight-bold); | |
| 164 | + color: var(--yoast-color-label); | |
| 165 | + font-size: var(--yoast-font-size-default); | |
| 166 | +`,Vt=te().div.attrs({className:"yoast-field-group"})` | |
| 167 | + display: flex; | |
| 168 | + justify-content: space-between; | |
| 169 | + align-items: center; | |
| 170 | + margin-bottom: 14px; | |
| 171 | +`,Gt=te().div` | |
| 172 | + margin: 8px 0; | |
| 173 | +`,Zt=ve().utc().startOf("day"),Xt=[{name:(0,l.__)("Last day","wordpress-seo"),value:ve()(Zt).subtract(1,"days").format(),defaultIndex:1},{name:(0,l.__)("Last week","wordpress-seo"),value:ve()(Zt).subtract(1,"week").format(),defaultIndex:2},{name:(0,l.__)("Last month","wordpress-seo"),value:ve()(Zt).subtract(1,"month").format(),defaultIndex:3},{name:(0,l.__)("Last year","wordpress-seo"),value:ve()(Zt).subtract(1,"year").format(),defaultIndex:0}],Qt=({onSelect:e,selected:t=null,options:s,isLoggedIn:i})=>i?s.length<1?null:(0,d.jsx)("select",{className:"components-select-control__input",id:"wincher-period-picker",value:(null==t?void 0:t.value)||s[0].value,onChange:e,children:s.map(e=>(0,d.jsx)("option",{value:e.value,children:e.name},e.name))}):null;Qt.propTypes={onSelect:o().func.isRequired,selected:o().object,options:o().array.isRequired,isLoggedIn:o().bool.isRequired};const Jt=({trackedKeyphrases:t=null,isLoggedIn:s,keyphrases:i,shouldTrackAll:o,permalink:r,historyDaysLimit:a=0})=>{if(!r&&s)return(0,d.jsx)(pt,{});if(0===i.length)return(0,d.jsx)(dt,{});const c=ve()(Zt).subtract(a,"days"),p=Xt.filter(e=>ve()(e.value).isSameOrAfter(c)),u=(0,n.orderBy)(p,e=>e.defaultIndex,"desc")[0],[h,g]=(0,e.useState)(u),[m,y]=(0,e.useState)([]),w=m.length>0,f=(0,re.usePrevious)(t);(0,e.useEffect)(()=>{if(!(0,n.isEmpty)(t)&&(0,n.difference)(Object.keys(t),Object.keys(f||[])).length){const e=Object.values(t).map(e=>e.keyword);y(e)}},[t,f]),(0,e.useEffect)(()=>{g(u)},[null==u?void 0:u.name]);const x=(0,e.useCallback)(e=>{const t=Xt.find(t=>t.value===e.target.value);t&&g(t)},[g]),b=(0,e.useMemo)(()=>(0,n.isEmpty)(m)||(0,n.isEmpty)(t)?[]:Object.values(t).filter(e=>{var t;return!(null==e||null===(t=e.position)||void 0===t||!t.history)}).map(e=>{var t;return{label:e.keyword,data:e.position.history,selected:m.includes(e.keyword)&&!(0,n.isEmpty)(null===(t=e.position)||void 0===t?void 0:t.history)}}),[m,t]);return(0,d.jsxs)(Yt,{isDisabled:!s,children:[(0,d.jsx)("p",{children:(0,l.__)("You can enable / disable tracking the SEO performance for each keyphrase below.","wordpress-seo")}),s&&o&&(0,d.jsx)(tt,{}),(0,d.jsx)(Vt,{children:(0,d.jsx)(Qt,{selected:h,onSelect:x,options:p,isLoggedIn:s})}),(0,d.jsx)(Gt,{children:(0,d.jsx)(Nt,{isChartShown:w,datasets:b,keyphrases:i})}),(0,d.jsx)(Je,{startAt:null==h?void 0:h.value,selectedKeyphrases:m,onSelectKeyphrases:y,trackedKeyphrases:t})]})};function es({trackedKeyphrases:t=null,addTrackedKeyphrase:s,isLoggedIn:i=!1,isNewlyAuthenticated:o=!1,keyphrases:r=[],response:n={},shouldTrackAll:a=!1,permalink:c="",allKeyphrasesMissRanking:p,isSuccess:u,keyphraseLimitReached:h,limit:g,setRequestSucceeded:m,setRequestFailed:y,setKeyphraseLimitReached:w,onAuthentication:f}){const x=(0,e.useCallback)(()=>{Ht({onAuthentication:f,setRequestSucceeded:m,setRequestFailed:y,keyphrases:r,addTrackedKeyphrase:s,setKeyphraseLimitReached:w})},[Ht,f,m,y,r,s,w]),b=(t=>{const[s,i]=(0,e.useState)(null);return(0,e.useEffect)(()=>{t&&!s&&async function(){return await _e({path:"yoast/v1/wincher/account/limit",method:"GET"})}().then(e=>i(e))},[s]),s})(i);return(0,d.jsxs)(Kt,{children:[o&&(0,d.jsx)(st,{}),i&&(0,d.jsx)(Tt,{trackingInfo:b}),(0,d.jsxs)(zt,{children:[(0,l.__)("SEO performance","wordpress-seo"),(0,d.jsx)(K.HelpIcon,{linkTo:wpseoAdminL10n["shortlinks.wincher.seo_performance"] | |
| 174 | +/* translators: Hidden accessibility text. */,linkText:(0,l.__)("Learn more about the SEO performance feature.","wordpress-seo")})]}),(0,d.jsx)(nt,{}),(0,d.jsx)(Bt,{isLoggedIn:i,onLogin:x}),(0,d.jsx)(Ut,{isSuccess:u,response:n,allKeyphrasesMissRanking:p,keyphraseLimitReached:h,limit:g,onLogin:x}),(0,d.jsx)(Jt,{trackedKeyphrases:t,isLoggedIn:i,keyphrases:r,shouldTrackAll:a,permalink:c,historyDaysLimit:(null==b?void 0:b.historyDays)||31})]})}Jt.propTypes={trackedKeyphrases:o().object,keyphrases:o().array.isRequired,isLoggedIn:o().bool.isRequired,shouldTrackAll:o().bool.isRequired,permalink:o().string.isRequired,historyDaysLimit:o().number},es.propTypes={trackedKeyphrases:o().object,addTrackedKeyphrase:o().func.isRequired,isLoggedIn:o().bool,isNewlyAuthenticated:o().bool,keyphrases:o().array,response:o().object,shouldTrackAll:o().bool,permalink:o().string,allKeyphrasesMissRanking:o().bool.isRequired,isSuccess:o().bool.isRequired,keyphraseLimitReached:o().bool.isRequired,limit:o().number.isRequired,setRequestSucceeded:o().func.isRequired,setRequestFailed:o().func.isRequired,setKeyphraseLimitReached:o().func.isRequired,onAuthentication:o().func.isRequired};const ts=(0,re.compose)([(0,a.withSelect)(e=>{const{isWincherNewlyAuthenticated:t,getWincherKeyphraseLimitReached:s,getWincherLimit:i,getWincherLoginStatus:o,getWincherRequestIsSuccess:r,getWincherRequestResponse:n,getWincherTrackableKeyphrases:a,getWincherTrackedKeyphrases:l,getWincherAllKeyphrasesMissRanking:c,getWincherPermalink:d,shouldWincherAutomaticallyTrackAll:p}=e("yoast-seo/editor");return{keyphrases:a(),trackedKeyphrases:l(),allKeyphrasesMissRanking:c(),isLoggedIn:o(),isNewlyAuthenticated:t(),isSuccess:r(),keyphraseLimitReached:s(),limit:i(),response:n(),shouldTrackAll:p(),permalink:d()}}),(0,a.withDispatch)(e=>{const{setWincherWebsiteId:t,setWincherRequestSucceeded:s,setWincherRequestFailed:i,setWincherTrackingForKeyphrase:o,setWincherSetKeyphraseLimitReached:r,setWincherLoginStatus:n}=e("yoast-seo/editor");return{setRequestSucceeded:e=>{s(e)},setRequestFailed:e=>{i(e)},addTrackedKeyphrase:e=>{o(e)},setKeyphraseLimitReached:e=>{r(e)},onAuthentication:(e,s,i)=>{t(i),n(e,s)}}})])(es),ss=te()(ae())` | |
| 175 | + width: 18px; | |
| 176 | + height: 18px; | |
| 177 | + margin: 3px; | |
| 178 | +`;function is({keyphrases:e,onNoKeyphraseSet:t,onOpen:s,location:i}){if(!e.length){let e=document.querySelector("#focus-keyword-input-metabox");return e||(e=document.querySelector("#focus-keyword-input-sidebar")),e.focus(),void t()}s(i)}function os({location:t="",whichModalOpen:s="none",shouldCloseOnClickOutside:i=!0,keyphrases:o,onNoKeyphraseSet:r,onOpen:n,onClose:a}){const c=(0,e.useCallback)(()=>{is({keyphrases:o,onNoKeyphraseSet:r,onOpen:n,location:t})},[is,o,r,n,t]),p=(0,l.__)("Track SEO performance","wordpress-seo"),u=((e=null)=>(0,f.useMemo)(()=>{const t={role:"img","aria-hidden":"true"};return null!==e&&(t.focusable=e?"true":"false"),t},[e]))();return(0,d.jsxs)(e.Fragment,{children:[s===t&&(0,d.jsx)(he,{title:p,onRequestClose:a,icon:(0,d.jsx)(we,{}),additionalClassName:"yoast-wincher-seo-performance-modal yoast-gutenberg-modal__no-padding",shouldCloseOnClickOutside:i,children:(0,d.jsx)(pe,{className:"yoast-gutenberg-modal__content yoast-wincher-seo-performance-modal__content",children:(0,d.jsx)(ts,{})})}),"sidebar"===t&&(0,d.jsx)(xe,{id:`wincher-open-button-${t}`,title:p,SuffixHeroIcon:(0,d.jsx)(ss,{className:"yst-text-slate-500",...u}),onClick:c}),"metabox"===t&&(0,d.jsx)("div",{className:"yst-root",children:(0,d.jsxs)(ce,{id:`wincher-open-button-${t}`,onClick:c,children:[(0,d.jsx)(ce.Text,{children:p}),(0,d.jsx)(ae(),{className:"yst-h-5 yst-w-5 yst-text-slate-500",...u})]})})]})}os.propTypes={location:o().string,whichModalOpen:o().oneOf(["none","metabox","sidebar","postpublish"]),shouldCloseOnClickOutside:o().bool,keyphrases:o().array.isRequired,onNoKeyphraseSet:o().func.isRequired,onOpen:o().func.isRequired,onClose:o().func.isRequired};const rs=(0,re.compose)([(0,a.withSelect)(e=>{const{getWincherModalOpen:t,getWincherTrackableKeyphrases:s}=e("yoast-seo/editor");return{keyphrases:s(),whichModalOpen:t()}}),(0,a.withDispatch)(e=>{const{setWincherOpenModal:t,setWincherDismissModal:s,setWincherNoKeyphrase:i}=e("yoast-seo/editor");return{onOpen:e=>{t(e)},onClose:()=>{s()},onNoKeyphraseSet:()=>{i()}}})])(os),ns=window.yoast.externals.components;function as(){return(0,re.createHigherOrderComponent)(function(t){return(0,re.pure)(function(s){const i=(0,e.useContext)(J.LocationContext);return(0,e.createElement)(t,{...s,location:i})})},"withLocation")}const ls=(0,re.compose)([(0,a.withSelect)(e=>{const{isCornerstoneContent:t}=e("yoast-seo/editor");return{isCornerstone:t(),learnMoreUrl:wpseoAdminL10n["shortlinks.cornerstone_content_info"]}}),(0,a.withDispatch)(e=>{const{toggleCornerstoneContent:t}=e("yoast-seo/editor");return{onChange:t}}),as()])(ns.CollapsibleCornerstone),cs=window.yoast.searchMetadataPreviews,ds=te()(K.StyledSection)` | |
| 179 | + &${K.StyledSectionBase} { | |
| 180 | + padding: 0; | |
| 181 | + | |
| 182 | + & ${K.StyledHeading} { | |
| 183 | + ${(0,de.getDirectionalStyle)("padding-left","padding-right")}: 20px; | |
| 184 | + margin-left: ${(0,de.getDirectionalStyle)("0","20px")}; | |
| 185 | + } | |
| 186 | + } | |
| 187 | +`,ps=({children:e=null,title:t="",icon:s="",hasPaperStyle:i=!0,shoppingData:o=null})=>(0,d.jsx)(ds,{headingLevel:3,headingText:t,headingIcon:s,headingIconColor:"#555",hasPaperStyle:i,shoppingData:o,children:e});ps.propTypes={children:o().element,title:o().string,icon:o().string,hasPaperStyle:o().bool,shoppingData:o().object};const us=ps,hs=window.wp.sanitize;function gs(e,t,s="",i=!1){return{type:"SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLE",name:e,value:"string"==typeof t?(0,de.decodeHTML)(t):t,label:s,hidden:i}}function ms(e){return e.charAt(0).toUpperCase()+e.slice(1)}const{stripHTMLTags:ys}=de.strings,ws=["slug","content","contentImage","snippetPreviewImageURL"];function fs(e,t="_"){return e.replace(/\s/g,t)}const xs=(0,n.memoize)((e,t)=>0===e?n.noop:(0,n.debounce)(s=>t(s,e),500)),bs=({link:e,text:t})=>(0,d.jsxs)(r.Root,{children:[(0,d.jsx)("p",{children:t}),(0,d.jsxs)(r.Button,{href:e,as:"a",className:"yst-gap-2 yst-mb-5 yst-mt-2",variant:"upsell",target:"_blank",rel:"noopener",children:[(0,d.jsx)(u(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-shrink-0"}),(0,l.sprintf)(/* translators: %1$s expands to Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast WooCommerce SEO. */ | |
| 188 | +(0,l.__)("Unlock with %1$s","wordpress-seo"),"Yoast WooCommerce SEO")]})]});bs.propTypes={link:o().string.isRequired,text:o().string.isRequired};const vs=bs,ks=function(e,t){let s=0;return t.shortenedBaseUrl&&"string"==typeof t.shortenedBaseUrl&&(s=t.shortenedBaseUrl.length),e.url=e.url.replace(/\s+/g,"-"),"-"===e.url[e.url.length-1]&&(e.url=e.url.slice(0,-1)),"-"===e.url[s]&&(e.url=e.url.slice(0,s)+e.url.slice(s+1)),function(e){const t=(0,n.get)(window,["YoastSEO","app","pluggable"],!1);if(!t||!(0,n.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){const t=(0,n.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],n.identity);return{url:e.url,title:ys(t(e.title)),description:ys(t(e.description)),filteredSEOTitle:e.filteredSEOTitle?ys(t(e.filteredSEOTitle)):""}}(e);const s=t._applyModifications.bind(t);return{url:e.url,title:ys(s("data_page_title",e.title)),description:ys(s("data_meta_desc",e.description)),filteredSEOTitle:e.filteredSEOTitle?ys(s("data_page_title",e.filteredSEOTitle)):""}}(e)},_s=(0,re.compose)([(0,a.withSelect)(function(e){const{getBaseUrlFromSettings:t,getDateFromSettings:s,getFocusKeyphrase:i,getRecommendedReplaceVars:o,getReplaceVars:r,getShoppingData:n,getSiteIconUrlFromSettings:a,getSnippetEditorData:l,getSnippetEditorMode:c,getSnippetEditorPreviewImageUrl:d,getSnippetEditorWordsToHighlight:p,isCornerstoneContent:u,getIsTerm:h,getContentLocale:g,getSiteName:m}=e("yoast-seo/editor"),y=r();return y.forEach(e=>{""!==e.value||["title","excerpt","excerpt_only"].includes(e.name)||(e.value="%%"+e.name+"%%")}),{baseUrl:t(),data:l(),date:s(),faviconSrc:a(),keyword:i(),mobileImageSrc:d(),mode:c(),recommendedReplacementVariables:o(),replacementVariables:y,shoppingData:n(),wordsToHighlight:p(),isCornerstone:u(),isTaxonomy:h(),locale:g(),siteName:m()}}),(0,a.withDispatch)(function(e,t,{select:s}){const{updateData:i,switchMode:o,updateAnalysisData:r,findCustomFields:n}=e("yoast-seo/editor"),a=e("core/editor"),l=s("yoast-seo/editor").getPostId();return{onChange:(e,t)=>{switch(e){case"mode":o(t);break;case"slug":i({slug:t}),a&&a.editPost({slug:t});break;default:i({[e]:t})}},onChangeAnalysisData:r,onReplacementVariableSearchChange:xs(l,n)}})])(e=>{const t=(0,a.useSelect)(e=>e("yoast-seo/editor").selectLink("https://yoa.st/product-google-preview-metabox"),[]),s=(0,a.useSelect)(e=>e("yoast-seo/editor").getIsWooSeoUpsell(),[]),i=(0,l.__)("Want an enhanced Google preview of how your WooCommerce products look in the search results?","wordpress-seo");return(0,d.jsx)(J.LocationConsumer,{children:o=>(0,d.jsx)(us,{icon:"eye",hasPaperStyle:e.hasPaperStyle,children:(0,d.jsxs)(d.Fragment,{children:[s&&(0,d.jsx)(vs,{link:t,text:i}),(0,d.jsx)(cs.SnippetEditor,{...e,descriptionPlaceholder:(0,l.__)("Please provide a meta description by editing the snippet below.","wordpress-seo"),mapEditorDataToPreview:ks,showCloseButton:!1,idSuffix:o})]})})})}),Ts=(0,a.withSelect)(e=>{const{getWarningMessage:t}=e("yoast-seo/editor");return{message:t()}})(K.Warning),js=window.yoast.featureFlag,Rs=te()(K.Collapsible)` | |
| 189 | + h2 > button { | |
| 190 | + padding-left: 24px; | |
| 191 | + padding-top: 16px; | |
| 192 | + | |
| 193 | + &:hover { | |
| 194 | + background-color: #f0f0f0; | |
| 195 | + } | |
| 196 | + } | |
| 197 | + | |
| 198 | + div[class^="collapsible_content"] { | |
| 199 | + padding: 24px 0; | |
| 200 | + margin: 0 24px; | |
| 201 | + border-top: 1px solid rgba(0,0,0,0.2); | |
| 202 | + } | |
| 203 | + | |
| 204 | +`,Ss=(0,de.getDirectionalStyle)("right: 16px","left: 24px"),Is=te().h2` | |
| 205 | + // wrapInHeading's resets, as longhands so the icon's lane below can override one side. | |
| 206 | + margin: 0 !important; | |
| 207 | + padding-block: 0 !important; | |
| 208 | + padding-inline-start: 0 !important; | |
| 209 | + font-size: ${e=>e.headingProps.fontSize} !important; | |
| 210 | + font-weight: ${e=>e.headingProps.fontWeight} !important; | |
| 211 | + color: ${e=>e.headingProps.color} !important; | |
| 212 | + | |
| 213 | + ${K.StyledTitle} { | |
| 214 | + font-weight: ${e=>e.headingProps.fontWeight}; | |
| 215 | + color: ${e=>e.headingProps.color}; | |
| 216 | + } | |
| 217 | + | |
| 218 | + position: relative; | |
| 219 | + display: flex; | |
| 220 | + align-items: center; | |
| 221 | + // The suffix icon's lane, so the title and the link shrink before reaching it. | |
| 222 | + padding-inline-end: 48px !important; | |
| 223 | + | |
| 224 | + &:hover { | |
| 225 | + background-color: #f0f0f0; | |
| 226 | + } | |
| 227 | + | |
| 228 | + // The link's wrapper, above the button's overlay so the link stays clickable. | |
| 229 | + > span { | |
| 230 | + position: relative; | |
| 231 | + z-index: 1; | |
| 232 | + flex: 0 0 auto; | |
| 233 | + } | |
| 234 | + | |
| 235 | + ${K.StyledIconsButton} { | |
| 236 | + flex: 0 1 auto; | |
| 237 | + min-width: 0; | |
| 238 | + width: auto; | |
| 239 | + /* | |
| 240 | + * Restates the shared h2 > button padding instead of inheriting a selector this heading does not | |
| 241 | + * own. Physical on purpose: the collapsibles it has to line up with are padded physically too. | |
| 242 | + */ | |
| 243 | + padding-block-start: 16px; | |
| 244 | + ${(0,de.getDirectionalStyle)("padding-left: 24px","padding-right: 16px")}; | |
| 245 | + // The help link brings its own leading gap, so the button ends at its title. | |
| 246 | + padding-inline-end: 0; | |
| 247 | + // Only the heading paints the hover, so it covers the row in one even color. | |
| 248 | + background-color: transparent; | |
| 249 | + | |
| 250 | + &:hover { | |
| 251 | + background-color: transparent; | |
| 252 | + } | |
| 253 | + | |
| 254 | + &::after { | |
| 255 | + content: ""; | |
| 256 | + position: absolute; | |
| 257 | + inset: 0; | |
| 258 | + } | |
| 259 | + | |
| 260 | + /* | |
| 261 | + * The ring moves to the overlay, because on the button it would frame the title alone. It cannot | |
| 262 | + * be reused: elsewhere it is the browser's own, which no pseudo-element can draw. Colors from Button.js. | |
| 263 | + */ | |
| 264 | + &:focus { | |
| 265 | + outline: none; | |
| 266 | + box-shadow: none; | |
| 267 | + } | |
| 268 | + | |
| 269 | + &:focus::after { | |
| 270 | + outline: 1px solid ${Y.colors.$color_blue}; | |
| 271 | + outline-offset: -1px; | |
| 272 | + box-shadow: 0 0 3px ${(0,Y.rgba)(Y.colors.$color_blue_dark,.8)}; | |
| 273 | + } | |
| 274 | + | |
| 275 | + > svg:last-child { | |
| 276 | + position: absolute; | |
| 277 | + ${Ss}; | |
| 278 | + top: 50%; | |
| 279 | + transform: translateY(-50%); | |
| 280 | + margin: 0; | |
| 281 | + } | |
| 282 | + } | |
| 283 | +`,Cs=({initialIsOpen:t=!1,id:s=null,HeaderHelpLink:i=null,headingProps:o=K.Collapsible.defaultProps.headingProps,...r})=>{const n=(0,e.useRef)(i);n.current=i;const a=(0,e.useRef)(o);a.current=o;const l=Boolean(i),c=(0,e.useMemo)(()=>l?function(e){const t=n.current;return(0,d.jsxs)(Is,{headingProps:a.current,children:[(0,d.jsx)(K.StyledIconsButton,{...e}),(0,d.jsx)("span",{children:(0,d.jsx)(t,{})})]})}:null,[l]);return(0,d.jsx)(Rs,{hasPadding:!0,hasSeparator:!0,initialIsOpen:t,id:s,headingProps:o,...c?{Heading:c}:{},...r})};Cs.propTypes={initialIsOpen:o().bool,id:o().string,HeaderHelpLink:o().elementType,headingProps:o().shape({level:o().number,fontSize:o().string,fontWeight:o().string,color:o().string})};const Es=Cs,Ls=()=>{const t=(0,a.useSelect)(e=>e("yoast-seo/editor").getEstimatedReadingTime(),[]),s=(0,e.useMemo)(()=>(0,n.get)(window,"wpseoAdminL10n.shortlinks-insights-estimated_reading_time",""),[]);return(0,d.jsx)(K.InsightsCard,{amount:t,unit:(0,l._n)("minute","minutes",t,"wordpress-seo"),title:(0,l.__)("Reading time","wordpress-seo"),linkTo:s | |
| 284 | +/* translators: Hidden accessibility text. */,linkText:(0,l.__)("Learn more about reading time","wordpress-seo")})},As=(0,de.makeOutboundLink)();function Ps(e,t){return-1===e?(0,l.__)("Your text should be slightly longer to calculate your Flesch reading ease score.","wordpress-seo"):(0,l.sprintf)( | |
| 285 | +/* Translators: %1$s expands to the numeric Flesch reading ease score, | |
| 286 | + %2$s expands to the easiness of reading (e.g. 'easy' or 'very difficult') */ | |
| 287 | +/* Translators: %1$s expands to the numeric Flesch reading ease score, | |
| 288 | + %2$s expands to the easiness of reading (e.g. 'easy' or 'very difficult') */ | |
| 289 | +(0,l.__)("The copy scores %1$s in the test, which is considered %2$s to read.","wordpress-seo"),e,function(e){switch(e){case z.DIFFICULTY.NO_DATA:return(0,l.__)("no data","wordpress-seo");case z.DIFFICULTY.VERY_EASY:return(0,l.__)("very easy","wordpress-seo");case z.DIFFICULTY.EASY:return(0,l.__)("easy","wordpress-seo");case z.DIFFICULTY.FAIRLY_EASY:return(0,l.__)("fairly easy","wordpress-seo");case z.DIFFICULTY.OKAY:return(0,l.__)("okay","wordpress-seo");case z.DIFFICULTY.FAIRLY_DIFFICULT:return(0,l.__)("fairly difficult","wordpress-seo");case z.DIFFICULTY.DIFFICULT:return(0,l.__)("difficult","wordpress-seo");case z.DIFFICULTY.VERY_DIFFICULT:return(0,l.__)("very difficult","wordpress-seo")}}(t))}const qs=()=>{let t=(0,a.useSelect)(e=>e("yoast-seo/editor").getFleschReadingEaseScore(),[]);const s=(0,e.useMemo)(()=>(0,n.get)(window,"wpseoAdminL10n.shortlinks-insights-flesch_reading_ease",""),[]),i=(0,a.useSelect)(e=>e("yoast-seo/editor").getFleschReadingEaseDifficulty(),[t]),o=(0,e.useMemo)(()=>{const e=(0,n.get)(window,"wpseoAdminL10n.shortlinks-insights-flesch_reading_ease_article","");return function(e,t,s){const i=function(e){switch(e){case z.DIFFICULTY.FAIRLY_DIFFICULT:case z.DIFFICULTY.DIFFICULT:case z.DIFFICULTY.VERY_DIFFICULT:return(0,l.__)("Try to make shorter sentences, using less difficult words to improve readability","wordpress-seo");case z.DIFFICULTY.NO_DATA:return(0,l.__)("Continue writing to get insight into the readability of your text!","wordpress-seo");default:return(0,l.__)("Good job!","wordpress-seo")}}(t);return(0,d.jsxs)("span",{children:[Ps(e,t)," ",t>=z.DIFFICULTY.FAIRLY_DIFFICULT?(0,d.jsx)(As,{href:s,children:i+"."}):i]})}(t,i,e)},[t,i]);return-1===t&&(t="?"),(0,d.jsx)(K.InsightsCard,{amount:t,unit:(0,l.__)("out of 100","wordpress-seo"),title:(0,l.__)("Flesch reading ease","wordpress-seo"),linkTo:s | |
| 290 | +/* translators: Hidden accessibility text. */,linkText:(0,l.__)("Learn more about Flesch reading ease","wordpress-seo"),description:o})},Fs=({data:t=[],itemScreenReaderText:s="",className:i="",...o})=>{const r=(0,e.useMemo)(()=>{var e,s;return null!==(e=null===(s=(0,n.maxBy)(t,"number"))||void 0===s?void 0:s.number)&&void 0!==e?e:0},[t]);return(0,d.jsx)("ul",{className:q()("yoast-data-model",i),...o,children:t.map(({name:e,number:t})=>(0,d.jsxs)("li",{style:{"--yoast-width":t/r*100+"%"},children:[e,(0,d.jsx)("span",{children:t}),s&&(0,d.jsx)("span",{className:"screen-reader-text",children:(0,l.sprintf)(s,t)})]},`${e}_dataItem`))})};Fs.propTypes={data:o().arrayOf(o().shape({name:o().string.isRequired,number:o().number.isRequired})),itemScreenReaderText:o().string,className:o().string};const Ms=Fs,Ds=window.wp.url,Os=(0,de.makeOutboundLink)(),Ns=({location:t})=>{const s=(0,a.useSelect)(e=>{var t,s;return null===(t=null===(s=e("yoast-seo-premium/editor"))||void 0===s?void 0:s.getPreference("isProminentWordsAvailable",!1))||void 0===t||t},[]),i=(0,a.useSelect)(e=>e("yoast-seo/editor").getPreference("shouldUpsell",!1),[]),o=(0,e.useMemo)(()=>(0,n.get)(window,`wpseoAdminL10n.shortlinks-insights-upsell-${t}-prominent_words`,""),[t]),r=(0,e.useMemo)(()=>{const e=(0,n.get)(window,"wpseoAdminL10n.shortlinks-insights-keyword_research_link","");return c((0,l.sprintf)( | |
| 291 | +// translators: %1$s and %2$s are replaced by opening and closing <a> tags. | |
| 292 | +// translators: %1$s and %2$s are replaced by opening and closing <a> tags. | |
| 293 | +(0,l.__)("Read our %1$sultimate guide to keyword research%2$s to learn more about keyword research and keyword strategy.","wordpress-seo"),"<a>","</a>"),{a:(0,d.jsx)(Os,{href:e})})},[]),p=(0,e.useMemo)(()=>c((0,l.sprintf)( | |
| 294 | +// translators: %1$s expands to a starting `b` tag, %1$s expands to a closing `b` tag and %3$s expands to `Yoast SEO Premium`. | |
| 295 | +// translators: %1$s expands to a starting `b` tag, %1$s expands to a closing `b` tag and %3$s expands to `Yoast SEO Premium`. | |
| 296 | +(0,l.__)("With %1$s%3$s%2$s, this section will show you which words occur most often in your text. By checking these prominent words against your intended keyword(s), you'll know how to edit your text to be more focused.","wordpress-seo"),"<b>","</b>","Yoast SEO Premium"),{b:(0,d.jsx)("b",{})}),[]),u=(0,a.useSelect)(e=>{var t,s;return null!==(t=null===(s=e("yoast-seo-premium/editor"))||void 0===s?void 0:s.getProminentWords())&&void 0!==t?t:[]},[]),h=(0,e.useMemo)(()=>{const e=(0,l.sprintf)( | |
| 297 | +// translators: %1$s expands to Yoast SEO Premium. | |
| 298 | +// translators: %1$s expands to Yoast SEO Premium. | |
| 299 | +(0,l.__)("Get %s to enjoy the benefits of prominent words","wordpress-seo"),"Yoast SEO Premium").split(/\s+/);return e.map((t,s)=>({name:t,number:e.length-s}))},[]),g=(0,e.useMemo)(()=>i?h:u.map(({word:e,occurrence:t})=>({name:e,number:t})),[u,h]);if(!s)return null;const{locationContext:m}=(0,J.useRootContext)();return(0,d.jsxs)("div",{className:"yoast-prominent-words",children:[(0,d.jsx)("div",{className:"yoast-field-group__title",children:(0,d.jsx)("b",{children:(0,l.__)("Prominent words","wordpress-seo")})}),!i&&(0,d.jsx)("p",{children:0===g.length?(0,l.__)("Once you add a bit more copy, we'll give you a list of words that occur the most in the content. These give an indication of what your content focuses on.","wordpress-seo"):(0,l.__)("The following words occur the most in the content. These give an indication of what your content focuses on. If the words differ a lot from your topic, you might want to rewrite your content accordingly.","wordpress-seo")}),i&&(0,d.jsx)("p",{children:p}),i&&(0,d.jsxs)(Os,{href:(0,Ds.addQueryArgs)(o,{context:m}),"data-action":"load-nfd-ctb","data-ctb-id":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",className:"yoast-button yoast-button-upsell",children:[(0,l.sprintf)( | |
| 300 | +// translators: %s expands to `Premium` (part of add-on name). | |
| 301 | +// translators: %s expands to `Premium` (part of add-on name). | |
| 302 | +(0,l.__)("Unlock with %s","wordpress-seo"),"Premium"),(0,d.jsx)("span",{"aria-hidden":"true",className:"yoast-button-upsell__caret"})]}),(0,d.jsx)("p",{children:r}),(0,d.jsx)(Ms,{data:g,itemScreenReaderText:/* translators: Hidden accessibility text; %d expands to the number of occurrences. */ /* translators: Hidden accessibility text; %d expands to the number of occurrences. */ | |
| 303 | +(0,l.__)("%d occurrences","wordpress-seo"),"aria-label":(0,l.__)("Prominent words","wordpress-seo"),className:i?"yoast-data-model--upsell":null})]})};Ns.propTypes={location:o().string.isRequired};const $s=Ns,Us=()=>{const t=(0,a.useSelect)(e=>e("yoast-seo/editor").getTextLength(),[]),s=(0,e.useMemo)(()=>(0,n.get)(window,"wpseoAdminL10n.shortlinks-insights-word_count",""),[]);let i=(0,l._n)("word","words",t.count,"wordpress-seo"),o=(0,l.__)("Word count","wordpress-seo"),r=(0,l.__)("Learn more about word count","wordpress-seo");return"character"===t.unit&&(i=(0,l._n)("character","characters",t.count,"wordpress-seo"),o=(0,l.__)("Character count","wordpress-seo"), | |
| 304 | +/* translators: Hidden accessibility text. */ | |
| 305 | +r=(0,l.__)("Learn more about character count","wordpress-seo")),(0,d.jsx)(K.InsightsCard,{amount:t.count,unit:i,title:o,linkTo:s,linkText:r})},Ws=(0,de.makeOutboundLink)(),Hs=({location:t})=>{const s=(0,e.useMemo)(()=>(0,n.get)(window,`wpseoAdminL10n.shortlinks-insights-upsell-${t}-text_formality`,""),[t]),i=(0,e.useMemo)(()=>c((0,l.sprintf)( | |
| 306 | +// Translators: %1$s expands to a starting `b` tag, %2$s expands to a closing `b` tag and %3$s expands to `Yoast SEO Premium`. | |
| 307 | +// Translators: %1$s expands to a starting `b` tag, %2$s expands to a closing `b` tag and %3$s expands to `Yoast SEO Premium`. | |
| 308 | +(0,l.__)("%1$s%3$s%2$s will help you assess the formality level of your text.","wordpress-seo"),"<b>","</b>","Yoast SEO Premium"),{b:(0,d.jsx)("b",{})}),[]);return(0,d.jsx)(e.Fragment,{children:(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{children:i}),(0,d.jsxs)(Ws,{href:s,className:"yoast-button yoast-button-upsell",children:[(0,l.sprintf)( | |
| 309 | +// Translators: %s expands to `Premium` (part of add-on name). | |
| 310 | +// Translators: %s expands to `Premium` (part of add-on name). | |
| 311 | +(0,l.__)("Unlock with %s","wordpress-seo"),"Premium"),(0,d.jsx)("span",{"aria-hidden":"true",className:"yoast-button-upsell__caret"})]})]})})};Hs.propTypes={location:o().string.isRequired};const Bs=Hs;function Ks(){return(0,n.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}const Ys=({location:e,name:s})=>{const i=(0,a.useSelect)(e=>e("yoast-seo/editor").isFormalitySupported(),[]),o=Ks().isPremium,r=o?(0,n.get)(window,"wpseoAdminL10n.shortlinks-insights-text_formality_info_premium",""):(0,n.get)(window,"wpseoAdminL10n.shortlinks-insights-text_formality_info_free",""),c=(0,l.__)("Read more about text formality.","wordpress-seo");return i?(0,d.jsxs)("div",{className:"yoast-text-formality",children:[(0,d.jsxs)("div",{className:"yoast-field-group__title",children:[(0,d.jsx)("b",{children:(0,l.__)("Text formality","wordpress-seo")}),(0,d.jsx)(K.HelpIcon,{linkTo:r,linkText:c})]}),o?(0,d.jsx)(t.Slot,{name:s}):(0,d.jsx)(Bs,{location:e})]}):null};Ys.propTypes={location:o().string.isRequired,name:o().string.isRequired};const zs=Ys,Vs=({location:e="metabox"})=>{const t=(0,a.useSelect)(e=>e("yoast-seo/editor").isFleschReadingEaseAvailable(),[]);return(0,d.jsxs)(Es,{title:(0,l.__)("Insights","wordpress-seo"),id:`yoast-insights-collapsible-${e}`,className:"yoast-insights",children:[(0,d.jsx)($s,{location:e}),(0,d.jsxs)("div",{children:[t&&(0,d.jsx)("div",{className:"yoast-insights-row",children:(0,d.jsx)(qs,{})}),(0,d.jsxs)("div",{className:"yoast-insights-row yoast-insights-row--columns",children:[(0,d.jsx)(Ls,{}),(0,d.jsx)(Us,{})]}),(0,js.isFeatureEnabled)("TEXT_FORMALITY")&&(0,d.jsx)(zs,{location:e,name:"YoastTextFormalityMetabox"})]})]})};Vs.propTypes={location:o().string};const Gs=Vs;var Zs=s(465),Xs=s.n(Zs),Qs=s(7656),Js=s.n(Qs);const ei=({isOpen:t,onClose:s,id:i,upsellLink:o,title:n="",description:c="",benefits:p=[],note:h="",ctbId:g="",modalTitle:m})=>{const{isBlackFriday:y,isWooCommerceActive:w,isProductEntity:f,isWooSEOActive:x}=(0,a.useSelect)(e=>{const t=e("yoast-seo/editor");return{isProductEntity:t.getIsProductEntity(),isWooCommerceActive:t.getIsWooCommerceActive(),isBlackFriday:t.isPromotionActive("black-friday-promotion"),isWooSEOActive:t.getIsWooSeoActive()}},[]),b=(0,e.useMemo)(()=>w&&f,[w,f]),v=(0,e.useRef)(null);return(0,d.jsx)(r.Modal,{isOpen:t,onClose:s,id:i,initialFocus:v,children:(0,d.jsx)(r.Modal.Panel,{className:"yst-max-w-md yst-p-0",hasCloseButton:!1,children:(0,d.jsxs)(r.Modal.Container,{children:[(0,d.jsxs)(r.Modal.Container.Header,{className:"yst-p-6 yst-border-b-slate-200 yst-border-b yst-flex yst-justify-start yst-gap-3 yst-items-center",children:[b?(0,d.jsx)(Js(),{className:"yst-text-woo-light yst-w-6 yst-h-6 yst-scale-x-[-1]"}):(0,d.jsx)(we,{className:"yst-fill-primary-500 yst-w-5 yst-h-5"}),(0,d.jsx)(r.Modal.Title,{as:"h3",className:q()(b?"yst-text-woo-light":"yst-text-primary-500","yst-text-base yst-font-normal"),children:m}),(0,d.jsx)(r.Modal.CloseButton,{className:"yst-top-2",onClick:s,screenReaderText:(0,l.__)("Close modal","wordpress-seo")})]}),(0,d.jsxs)(r.Modal.Container.Content,{className:"yst-p-0",children:[y&&(0,d.jsx)("div",{className:"yst-flex yst-font-semibold yst-items-center yst-text-lg yst-content-between yst-bg-black yst-text-amber-300 yst-h-9 yst-border-amber-300 yst-border-y yst-border-x-0 yst-border-solid yst-px-6",children:(0,d.jsx)("div",{className:"yst-mx-auto",children:(0,l.__)("BLACK FRIDAY | 30% OFF","wordpress-seo")})}),(0,d.jsxs)("div",{className:"yst-py-6 yst-px-12",children:[(0,d.jsx)(r.Title,{as:"h3",className:"yst-mb-1 yst-leading-5 yst-text-sm yst-font-medium yst-text-slate-800",children:n}),(0,d.jsx)("p",{className:"yst-mb-2",children:c}),Array.isArray(p)&&p.length>0&&(0,d.jsx)("ul",{className:"yst-my-2",children:p.map((e,t)=>(0,d.jsxs)("li",{className:"yst-flex yst-gap-1 yst-mb-2",children:[(0,d.jsx)(A(),{className:"yst-mr-1 yst-text-green-500 yst-w-[19.5px] yst-h-[19.5px] yst-flex-shrink-0"}),(0,d.jsx)("p",{className:"yst-text-slate-600",children:e})]},`${i}-upsell-benefit-${t}`))}),"function"==typeof p&&p(),(0,d.jsxs)("div",{className:"yst-text-center",children:[(0,d.jsxs)(r.Button,{as:"a",variant:"upsell",className:"yst-my-2 yst-gap-1.5 yst-w-full",href:o,target:"_blank","data-action":"load-nfd-ctb","data-ctb-id":g,ref:v,children:[(0,d.jsx)(u(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-shrink-0"}),(0,l.sprintf)(/* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */ /* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */ | |
| 312 | +(0,l.__)("Explore %s","wordpress-seo"),b&&!x?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,d.jsx)("span",{className:"yst-sr-only",children:(0,l.__)("Opens in a new tab","wordpress-seo")})]}),(0,d.jsx)("div",{className:"yst-italic yst-text-slate-500 yst-mt-1",children:h})]})]})]})]})})})},ti=()=>{const[e,,,t,s]=(0,r.useToggleState)(!1),{locationContext:i}=(0,J.useRootContext)(),o=(0,r.useSvgAria)(),n=i.includes("sidebar"),a=i.includes("metabox"),p=n?"sidebar":"metabox",u=wpseoAdminL10n[n?"shortlinks.upsell.sidebar.internal_linking_suggestions":"shortlinks.upsell.metabox.internal_linking_suggestions"];return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ei,{isOpen:e,onClose:s,id:`yoast-internal-linking-suggestions-upsell-${p}`,upsellLink:(0,Ds.addQueryArgs)(u,{context:i}),modalTitle:(0,l.__)("Add smarter internal links with Premium","wordpress-seo"),title:(0,l.__)("Connect related content without the guesswork","wordpress-seo"),description:c((0,l.sprintf)(/* translators: %s expands to be tag. */ /* translators: %s expands to be tag. */ | |
| 313 | +(0,l.__)("Optimize for up to 5 keyphrases to shape your content around different themes, audiences, and angles. %sScans your content to:","wordpress-seo"),"<br />"),{br:(0,d.jsx)("br",{})}),benefits:[(0,l.__)("Suggest internal links based on your content’s main topics","wordpress-seo"),(0,l.__)("Build relevant internal links faster","wordpress-seo"),(0,l.__)("Strengthen your site’s structure","wordpress-seo"),(0,l.__)("Keep visitors exploring longer","wordpress-seo")],note:(0,l.__)("Upgrade to link your content with ease","wordpress-seo"),ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"}),n&&(0,d.jsx)(xe,{id:"yoast-internal-linking-suggestions-sidebar-modal-open-button",title:(0,l.__)("Internal linking suggestions","wordpress-seo"),onClick:t,children:(0,d.jsx)("div",{className:"yst-root",children:(0,d.jsx)(r.Badge,{size:"small",variant:"upsell",children:(0,d.jsx)(Xs(),{className:"yst-w-2.5 yst-h-2.5 yst-shrink-0",...o})})})}),a&&(0,d.jsx)("div",{className:"yst-root",children:(0,d.jsxs)(ce,{id:"yoast-internal-linking-suggestions-metabox-modal-open-button",onClick:t,children:[(0,d.jsx)(ce.Text,{children:(0,l.__)("Internal linking suggestions","wordpress-seo")}),(0,d.jsxs)(r.Badge,{size:"small",variant:"upsell",children:[(0,d.jsx)(Xs(),{className:"yst-w-2.5 yst-h-2.5 yst-me-1 yst-shrink-0",...o}),(0,d.jsx)("span",{children:"Premium"})]})]})})]})},si=({children:e})=>(0,d.jsx)("div",{children:e});si.propTypes={renderPriority:o().number.isRequired,children:o().node.isRequired};const ii=si,oi=({noIndex:t,onNoIndexChange:s,editorContext:i,isPrivateBlog:o=!1})=>{const r=(e=>{const t=(0,l.__)("No","wordpress-seo"),s=(0,l.__)("Yes","wordpress-seo"),i=e.noIndex?t:s;return window.wpseoScriptData.isPost?[{name:(0,l.sprintf)(/* translators: %1$s translates to "yes" or "no", %2$s translates to the content type label in plural form */ /* translators: %1$s translates to "yes" or "no", %2$s translates to the content type label in plural form */ | |
| 314 | +(0,l.__)("%1$s (current default for %2$s)","wordpress-seo"),i,e.postTypeNamePlural),value:"0"},{name:t,value:"1"},{name:s,value:"2"}]:[{name:(0,l.sprintf)(/* translators: %1$s translates to "yes" or "no", %2$s translates to the content type label in plural form */ /* translators: %1$s translates to "yes" or "no", %2$s translates to the content type label in plural form */ | |
| 315 | +(0,l.__)("%1$s (current default for %2$s)","wordpress-seo"),i,e.postTypeNamePlural),value:"default"},{name:s,value:"index"},{name:t,value:"noindex"}]})(i);return(0,d.jsx)(J.LocationConsumer,{children:i=>(0,d.jsxs)(e.Fragment,{children:[o&&(0,d.jsx)(K.Alert,{type:"warning",children:(0,l.__)("Even though you can set the meta robots setting here, the entire site is set to noindex in the sitewide privacy settings, so these settings won't have an effect.","wordpress-seo")}),(0,d.jsx)(K.Select,{label:(0,l.__)("Allow search engines to show this content in search results?","wordpress-seo"),onChange:s,id:(0,de.join)(["yoast-meta-robots-noindex",i]),options:r,selected:t,linkTo:wpseoAdminL10n["shortlinks.advanced.allow_search_engines"] | |
| 316 | +/* translators: Hidden accessibility text. */,linkText:(0,l.__)("Learn more about the no-index setting on our help page.","wordpress-seo")})]})})};oi.propTypes={noIndex:o().string.isRequired,onNoIndexChange:o().func.isRequired,editorContext:o().object.isRequired,isPrivateBlog:o().bool};const ri=({noFollow:e,onNoFollowChange:t})=>(0,d.jsx)(J.LocationConsumer,{children:s=>{const i=(0,de.join)(["yoast-meta-robots-nofollow",s]);return(0,d.jsx)(K.RadioButtonGroup,{id:i,options:[{value:"0",label:"Yes"},{value:"1",label:"No"}],label:(0,l.__)("Should search engines follow links on this content?","wordpress-seo"),groupName:i,onChange:t,selected:e,linkTo:wpseoAdminL10n["shortlinks.advanced.follow_links"] | |
| 317 | +/* translators: Hidden accessibility text. */,linkText:(0,l.__)("Learn more about the no-follow setting on our help page.","wordpress-seo")})}});ri.propTypes={noFollow:o().string.isRequired,onNoFollowChange:o().func.isRequired};const ni=({advanced:e,onAdvancedChange:t})=>(0,d.jsx)(J.LocationConsumer,{children:s=>{const i=(0,de.join)(["yoast-meta-robots-advanced",s]),o=`${i}-input`;return(0,d.jsx)(K.MultiSelect,{label:(0,l.__)("Meta robots advanced","wordpress-seo"),onChange:t,id:i,inputId:o,options:[{name:(0,l.__)("No Image Index","wordpress-seo"),value:"noimageindex"},{name:(0,l.__)("No Archive","wordpress-seo"),value:"noarchive"},{name:(0,l.__)("No Snippet","wordpress-seo"),value:"nosnippet"}],selected:e,linkTo:wpseoAdminL10n["shortlinks.advanced.meta_robots"] | |
| 318 | +/* translators: Hidden accessibility text. */,linkText:(0,l.__)("Learn more about advanced meta robots settings on our help page.","wordpress-seo")})}});ni.propTypes={advanced:o().array.isRequired,onAdvancedChange:o().func.isRequired};const ai=({breadcrumbsTitle:e,onBreadcrumbsTitleChange:t})=>(0,d.jsx)(J.LocationConsumer,{children:s=>(0,d.jsx)(K.TextInput,{label:(0,l.__)("Breadcrumbs Title","wordpress-seo"),id:(0,de.join)(["yoast-breadcrumbs-title",s]),onChange:t,value:e,linkTo:wpseoAdminL10n["shortlinks.advanced.breadcrumbs_title"] | |
| 319 | +/* translators: Hidden accessibility text. */,linkText:(0,l.__)("Learn more about the breadcrumbs title setting on our help page.","wordpress-seo")})});ai.propTypes={breadcrumbsTitle:o().string.isRequired,onBreadcrumbsTitleChange:o().func.isRequired};const li=({canonical:e,onCanonicalChange:t})=>(0,d.jsx)(J.LocationConsumer,{children:s=>(0,d.jsx)(K.TextInput,{label:(0,l.__)("Canonical URL","wordpress-seo"),id:(0,de.join)(["yoast-canonical",s]),onChange:t,value:e,linkTo:"https://yoa.st/canonical-url" | |
| 320 | +/* translators: Hidden accessibility text. */,linkText:(0,l.__)("Learn more about canonical URLs on our help page.","wordpress-seo")})});li.propTypes={canonical:o().string.isRequired,onCanonicalChange:o().func.isRequired};const ci=({noIndex:t,canonical:s,onNoIndexChange:i,onCanonicalChange:o,onLoad:r,isLoading:a,editorContext:l,isBreadcrumbsDisabled:c,advanced:p=[],onAdvancedChange:u=n.noop,noFollow:h="",onNoFollowChange:g=n.noop,breadcrumbsTitle:m="",onBreadcrumbsTitleChange:y=n.noop,isPrivateBlog:w=!1})=>{(0,e.useEffect)(()=>{setTimeout(()=>{a&&r()})});const f={noIndex:t,onNoIndexChange:i,editorContext:l,isPrivateBlog:w},x={noFollow:h,onNoFollowChange:g},b={advanced:p,onAdvancedChange:u},v={breadcrumbsTitle:m,onBreadcrumbsTitleChange:y},k={canonical:s,onCanonicalChange:o};return a?null:(0,d.jsxs)(e.Fragment,{children:[(0,d.jsx)(oi,{...f}),l.isPost&&(0,d.jsx)(ri,{...x}),l.isPost&&(0,d.jsx)(ni,{...b}),!c&&(0,d.jsx)(ai,{...v}),(0,d.jsx)(li,{...k})]})};ci.propTypes={noIndex:o().string.isRequired,canonical:o().string.isRequired,onNoIndexChange:o().func.isRequired,onCanonicalChange:o().func.isRequired,onLoad:o().func.isRequired,isLoading:o().bool.isRequired,editorContext:o().object.isRequired,isBreadcrumbsDisabled:o().bool.isRequired,isPrivateBlog:o().bool,advanced:o().array,onAdvancedChange:o().func,noFollow:o().string,onNoFollowChange:o().func,breadcrumbsTitle:o().string,onBreadcrumbsTitleChange:o().func};const di=ci,pi=(0,re.compose)([(0,a.withSelect)(e=>{const{getNoIndex:t,getNoFollow:s,getAdvanced:i,getBreadcrumbsTitle:o,getCanonical:r,getIsLoading:n,getEditorContext:a,getPreferences:l}=e("yoast-seo/editor"),{isBreadcrumbsDisabled:c,isPrivateBlog:d}=l();return{noIndex:t(),noFollow:s(),advanced:i(),breadcrumbsTitle:o(),canonical:r(),isLoading:n(),editorContext:a(),isBreadcrumbsDisabled:c,isPrivateBlog:d}}),(0,a.withDispatch)(e=>{const{setNoIndex:t,setNoFollow:s,setAdvanced:i,setBreadcrumbsTitle:o,setCanonical:r,loadAdvancedSettingsData:n}=e("yoast-seo/editor");return{onNoIndexChange:t,onNoFollowChange:s,onAdvancedChange:i,onBreadcrumbsTitleChange:o,onCanonicalChange:r,onLoad:n}})])(di),ui=te().p` | |
| 321 | + color: #606770; | |
| 322 | + flex-shrink: 0; | |
| 323 | + font-size: 12px; | |
| 324 | + line-height: 16px; | |
| 325 | + overflow: hidden; | |
| 326 | + padding: 0; | |
| 327 | + text-overflow: ellipsis; | |
| 328 | + text-transform: uppercase; | |
| 329 | + white-space: nowrap; | |
| 330 | + margin: 0; | |
| 331 | + position: ${e=>"landscape"===e.mode?"relative":"static"}; | |
| 332 | +`,hi=e=>{const{siteUrl:t}=e;return(0,d.jsxs)(f.Fragment,{children:[(0,d.jsx)("span",{className:"screen-reader-text",children:t}),(0,d.jsx)(ui,{"aria-hidden":"true",children:(0,d.jsx)("span",{children:t})})]})};hi.propTypes={siteUrl:o().string.isRequired};const gi=hi,mi=window.yoast.socialMetadataForms,yi=te().img` | |
| 333 | + && { | |
| 334 | + max-width: ${e=>e.width}px; | |
| 335 | + height: ${e=>e.height}px; | |
| 336 | + position: absolute; | |
| 337 | + top: 50%; | |
| 338 | + left: 50%; | |
| 339 | + transform: translate(-50%, -50%); | |
| 340 | + max-width: none; | |
| 341 | + } | |
| 342 | +`,wi=te().img` | |
| 343 | + && { | |
| 344 | + height: 100%; | |
| 345 | + position: absolute; | |
| 346 | + width: 100%; | |
| 347 | + object-fit: cover; | |
| 348 | + } | |
| 349 | +`,fi=te().div` | |
| 350 | + padding-bottom: ${e=>e.aspectRatio}%; | |
| 351 | +`,xi=({imageProps:e,width:t,height:s,imageMode:i="landscape"})=>"landscape"===i?(0,d.jsx)(fi,{aspectRatio:e.aspectRatio,children:(0,d.jsx)(wi,{src:e.src,alt:e.alt})}):(0,d.jsx)(yi,{src:e.src,alt:e.alt,width:t,height:s,imageProperties:e});function bi(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 vi(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 ki(e,t,s=!1){const i=await function(e){return new Promise((t,s)=>{const i=new Image;i.onload=()=>{t({width:i.width,height:i.height})},i.onerror=s,i.src=e})}(e);let o=s?"landscape":"square";"Facebook"===t&&(o=(0,mi.determineFacebookImageMode)(i));const r=function(e){return"Twitter"===e?mi.TWITTER_IMAGE_SIZES:mi.FACEBOOK_IMAGE_SIZES}(t),n=function(e,t,s){return"square"===s&&t.width===t.height?{width:e.squareWidth,height:e.squareHeight}:vi(t,bi(e,t,s))}(r,i,o);return{mode:o,height:n.height,width:n.width}}async function _i(e,t,s=!1){try{return{imageProperties:await ki(e,t,s),status:"loaded"}}catch(e){return{imageProperties:null,status:"errored"}}}xi.propTypes={imageProps:o().shape({src:o().string.isRequired,alt:o().string.isRequired,aspectRatio:o().number.isRequired}).isRequired,width:o().number.isRequired,height:o().number.isRequired,imageMode:o().string};const Ti=te().div` | |
| 352 | + position: relative; | |
| 353 | + ${e=>"landscape"===e.mode?`max-width: ${e.dimensions.width}`:`min-width: ${e.dimensions.width}; height: ${e.dimensions.height}`}; | |
| 354 | + overflow: hidden; | |
| 355 | + background-color: ${Y.colors.$color_white}; | |
| 356 | +`,ji=te().div` | |
| 357 | + box-sizing: border-box; | |
| 358 | + max-width: ${mi.FACEBOOK_IMAGE_SIZES.landscapeWidth}px; | |
| 359 | + height: ${mi.FACEBOOK_IMAGE_SIZES.landscapeHeight}px; | |
| 360 | + background-color: ${Y.colors.$color_grey}; | |
| 361 | + border-style: dashed; | |
| 362 | + border-width: 1px; | |
| 363 | + // We're not using standard colors to increase contrast for accessibility. | |
| 364 | + color: #006DAC; | |
| 365 | + // We're not using standard colors to increase contrast for accessibility. | |
| 366 | + background-color: #f1f1f1; | |
| 367 | + display: flex; | |
| 368 | + justify-content: center; | |
| 369 | + align-items: center; | |
| 370 | + text-decoration: underline; | |
| 371 | + font-size: 14px; | |
| 372 | + cursor: pointer; | |
| 373 | +`;class Ri extends f.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 _i(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:mi.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:mi.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:mi.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:mi.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:mi.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:mi.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){const{imageProperties:e,status:t}=this.state;if("loading"===t||""===this.props.src||"errored"===t)return(0,d.jsx)(ji,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,l.__)("Select image","wordpress-seo")});const s=this.retrieveContainerDimensions(e.mode);return(0,d.jsx)(Ti,{mode:e.mode,dimensions:s,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick,children:(0,d.jsx)(xi,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:mi.FACEBOOK_IMAGE_SIZES.aspectRatio},width:e.width,height:e.height,imageMode:e.mode})})}}Ri.propTypes={src:o().string,alt:o().string,onImageLoaded:o().func,onImageClick:o().func,onMouseEnter:o().func,onMouseLeave:o().func},Ri.defaultProps={src:"",alt:"",onImageLoaded:n.noop,onImageClick:n.noop,onMouseEnter:n.noop,onMouseLeave:n.noop};const Si=Ri,Ii=te().span` | |
| 374 | + line-height: ${20}px; | |
| 375 | + min-height : ${20}px; | |
| 376 | + color: #1d2129; | |
| 377 | + font-weight: 600; | |
| 378 | + overflow: hidden; | |
| 379 | + font-size: 16px; | |
| 380 | + margin: 3px 0 0; | |
| 381 | + letter-spacing: normal; | |
| 382 | + white-space: normal; | |
| 383 | + flex-shrink: 0; | |
| 384 | + cursor: pointer; | |
| 385 | + display: -webkit-box; | |
| 386 | + -webkit-line-clamp: ${e=>e.lineCount}; | |
| 387 | + -webkit-box-orient: vertical; | |
| 388 | + overflow: hidden; | |
| 389 | +`,Ci=te().p` | |
| 390 | + line-height: ${16}px; | |
| 391 | + min-height : ${16}px; | |
| 392 | + color: #606770; | |
| 393 | + font-size: 14px; | |
| 394 | + padding: 0; | |
| 395 | + text-overflow: ellipsis; | |
| 396 | + margin: 3px 0 0 0; | |
| 397 | + display: -webkit-box; | |
| 398 | + cursor: pointer; | |
| 399 | + -webkit-line-clamp: ${e=>e.lineCount}; | |
| 400 | + -webkit-box-orient: vertical; | |
| 401 | + overflow: hidden; | |
| 402 | + | |
| 403 | + @media all and ( max-width: ${e=>e.maxWidth} ) { | |
| 404 | + display: none; | |
| 405 | + } | |
| 406 | +`,Ei=e=>{switch(e){case"landscape":return"527px";case"square":case"portrait":return"369px";default:return"476px"}},Li=te().div` | |
| 407 | + box-sizing: border-box; | |
| 408 | + display: flex; | |
| 409 | + flex-direction: ${e=>"landscape"===e.mode?"column":"row"}; | |
| 410 | + background-color: #f2f3f5; | |
| 411 | + max-width: 527px; | |
| 412 | +`,Ai=te().div` | |
| 413 | + box-sizing: border-box; | |
| 414 | + background-color: #f2f3f5; | |
| 415 | + margin: 0; | |
| 416 | + padding: 10px 12px; | |
| 417 | + position: relative; | |
| 418 | + border-bottom: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; | |
| 419 | + border-top: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; | |
| 420 | + border-right: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; | |
| 421 | + border: ${e=>"landscape"===e.mode?"1px solid #dddfe2":""}; | |
| 422 | + display: flex; | |
| 423 | + flex-direction: column; | |
| 424 | + flex-grow: 1; | |
| 425 | + justify-content: ${e=>"landscape"===e.mode?"flex-start":"center"}; | |
| 426 | + font-size: 12px; | |
| 427 | + overflow: hidden; | |
| 428 | +`;class Pi extends f.Component{constructor(e){super(e),this.state={imageMode:null,maxLineCount:0,descriptionLineCount:0},this.facebookTitleRef=x().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,i=this.getTitleLineCount();let o=t-i;"portrait"===s&&(o=5===i?0:4),o!==e&&this.setState({descriptionLineCount:o})}componentDidUpdate(){this.maybeSetMaxLineCount(),this.maybeSetDescriptionLineCount()}render(){const{imageMode:e,maxLineCount:t,descriptionLineCount:s}=this.state;return(0,d.jsxs)(Li,{id:"facebookPreview",mode:e,children:[(0,d.jsx)(Si,{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,d.jsxs)(Ai,{mode:e,children:[(0,d.jsx)(gi,{siteUrl:this.props.siteUrl,mode:e}),(0,d.jsx)(Ii,{ref:this.facebookTitleRef,onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,lineCount:t,children:this.props.title}),s>0&&(0,d.jsx)(Ci,{maxWidth:Ei(e),onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,lineCount:s,children:this.props.description})]})]})}}Pi.propTypes={siteUrl:o().string.isRequired,title:o().string.isRequired,description:o().string,imageUrl:o().string,imageFallbackUrl:o().string,alt:o().string,onSelect:o().func,onImageClick:o().func,onMouseHover:o().func},Pi.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{}};const qi=Pi,Fi=te().div` | |
| 429 | + text-transform: lowercase; | |
| 430 | + color: rgb(83, 100, 113); | |
| 431 | + white-space: nowrap; | |
| 432 | + overflow: hidden; | |
| 433 | + text-overflow: ellipsis; | |
| 434 | + margin: 0; | |
| 435 | + fill: currentcolor; | |
| 436 | + display: flex; | |
| 437 | + flex-direction: row; | |
| 438 | + align-items: flex-end; | |
| 439 | +`,Mi=e=>(0,d.jsx)(Fi,{children:(0,d.jsx)("span",{children:e.siteUrl})});Mi.propTypes={siteUrl:o().string.isRequired};const Di=Mi,Oi=(e,t=!0)=>e?`\n\t\t\tmax-width: ${mi.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: ${mi.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`,Ni=te().div` | |
| 440 | + position: relative; | |
| 441 | + box-sizing: content-box; | |
| 442 | + overflow: hidden; | |
| 443 | + background-color: #e1e8ed; | |
| 444 | + flex-shrink: 0; | |
| 445 | + ${e=>Oi(e.isLarge)} | |
| 446 | +`,$i=te().div` | |
| 447 | + display: flex; | |
| 448 | + justify-content: center; | |
| 449 | + align-items: center; | |
| 450 | + box-sizing: border-box; | |
| 451 | + max-width: 100%; | |
| 452 | + margin: 0; | |
| 453 | + padding: 1em; | |
| 454 | + text-align: center; | |
| 455 | + font-size: 1rem; | |
| 456 | + ${e=>Oi(e.isLarge,!1)} | |
| 457 | +`,Ui=te()($i)` | |
| 458 | + ${e=>e.isLarge&&`height: ${mi.TWITTER_IMAGE_SIZES.landscapeHeight}px;`} | |
| 459 | + border-top-left-radius: 14px; | |
| 460 | + ${e=>e.isLarge?"border-top-right-radius":"border-bottom-left-radius"}: 14px; | |
| 461 | + border-style: dashed; | |
| 462 | + border-width: 1px; | |
| 463 | + // We're not using standard colors to increase contrast for accessibility. | |
| 464 | + color: #006DAC; | |
| 465 | + // We're not using standard colors to increase contrast for accessibility. | |
| 466 | + background-color: #f1f1f1; | |
| 467 | + text-decoration: underline; | |
| 468 | + font-size: 14px; | |
| 469 | + cursor: pointer; | |
| 470 | +`;class Wi extends x().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 _i(this.props.src,this.socialMedium,this.props.isLarge);this.setState(e)}componentDidUpdate(e){e.src!==this.props.src&&this.handleTwitterImage()}componentDidMount(){this.handleTwitterImage()}render(){const{status:e,imageProperties:t}=this.state;return"loading"===e||""===this.props.src||"errored"===e?(0,d.jsx)(Ui,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,l.__)("Select image","wordpress-seo")}):(0,d.jsx)(Ni,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,d.jsx)(xi,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:mi.TWITTER_IMAGE_SIZES.aspectRatio},width:t.width,height:t.height,imageMode:t.mode})})}}Wi.propTypes={isLarge:o().bool.isRequired,src:o().string,alt:o().string,onImageClick:o().func,onMouseEnter:o().func,onMouseLeave:o().func},Wi.defaultProps={src:"",alt:"",onMouseEnter:n.noop,onImageClick:n.noop,onMouseLeave:n.noop};const Hi=te().div` | |
| 471 | + display: flex; | |
| 472 | + flex-direction: column; | |
| 473 | + padding: 12px; | |
| 474 | + justify-content: center; | |
| 475 | + margin: 0; | |
| 476 | + box-sizing: border-box; | |
| 477 | + flex: auto; | |
| 478 | + min-width: 0px; | |
| 479 | + gap:2px; | |
| 480 | + > * { | |
| 481 | + line-height:20px; | |
| 482 | + min-height:20px; | |
| 483 | + font-size:15px; | |
| 484 | + } | |
| 485 | +`,Bi=e=>(0,d.jsx)(Hi,{children:e.children});Bi.propTypes={children:o().array.isRequired};const Ki=Bi,Yi=te().p` | |
| 486 | + white-space: nowrap; | |
| 487 | + overflow: hidden; | |
| 488 | + text-overflow: ellipsis; | |
| 489 | + margin: 0; | |
| 490 | + color: rgb(15, 20, 25); | |
| 491 | + cursor: pointer; | |
| 492 | +`,zi=te().p` | |
| 493 | + max-height: 55px; | |
| 494 | + overflow: hidden; | |
| 495 | + text-overflow: ellipsis; | |
| 496 | + margin: 0; | |
| 497 | + color: rgb(83, 100, 113); | |
| 498 | + display: -webkit-box; | |
| 499 | + cursor: pointer; | |
| 500 | + -webkit-line-clamp: 2; | |
| 501 | + -webkit-box-orient: vertical; | |
| 502 | + | |
| 503 | + @media all and ( max-width: ${mi.TWITTER_IMAGE_SIZES.landscapeWidth}px ) { | |
| 504 | + display: none; | |
| 505 | + } | |
| 506 | +`,Vi=te().div` | |
| 507 | + font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif; | |
| 508 | + font-size: 15px; | |
| 509 | + font-weight: 400; | |
| 510 | + line-height: 20px; | |
| 511 | + max-width: 507px; | |
| 512 | + border: 1px solid #E1E8ED; | |
| 513 | + box-sizing: border-box; | |
| 514 | + border-radius: 14px; | |
| 515 | + color: #292F33; | |
| 516 | + background: #FFFFFF; | |
| 517 | + text-overflow: ellipsis; | |
| 518 | + display: flex; | |
| 519 | + | |
| 520 | + &:hover { | |
| 521 | + background: #f5f8fa; | |
| 522 | + border: 1px solid rgba(136,153,166,.5); | |
| 523 | + } | |
| 524 | +`,Gi=te()(Vi)` | |
| 525 | + flex-direction: column; | |
| 526 | + max-height: 370px; | |
| 527 | +`,Zi=te()(Vi)` | |
| 528 | + flex-direction: row; | |
| 529 | + height: 125px; | |
| 530 | +`;class Xi extends f.Component{constructor(e){super(e),this.onImageEnter=this.props.onMouseHover.bind(this,"image"),this.onTitleEnter=this.props.onMouseHover.bind(this,"title"),this.onDescriptionEnter=this.props.onMouseHover.bind(this,"description"),this.onLeave=this.props.onMouseHover.bind(this,""),this.onSelectTitle=this.props.onSelect.bind(this,"title"),this.onSelectDescription=this.props.onSelect.bind(this,"description")}render(){const{isLarge:e,imageUrl:t,imageFallbackUrl:s,alt:i,title:o,description:r,siteUrl:n}=this.props,a=e?Gi:Zi;return(0,d.jsxs)(a,{id:"twitterPreview",children:[(0,d.jsx)(Wi,{src:t||s,alt:i,isLarge:e,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,d.jsxs)(Ki,{children:[(0,d.jsx)(Di,{siteUrl:n}),(0,d.jsx)(Yi,{onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,children:o}),(0,d.jsx)(zi,{onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,children:r})]})]})}}Xi.propTypes={siteUrl:o().string.isRequired,title:o().string.isRequired,description:o().string,isLarge:o().bool,imageUrl:o().string,imageFallbackUrl:o().string,alt:o().string,onSelect:o().func,onImageClick:o().func,onMouseHover:o().func},Xi.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{},isLarge:!0};const Qi=Xi,Ji=window.yoast.replacementVariableEditor;class eo extends f.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},this.SocialPreview="Social"===e.socialMediumName?qi:Qi,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:e,onTitleChange:t,onSelectImageClick:s,onRemoveImageClick:i,socialMediumName:o,imageWarnings:r,siteUrl:n,description:a,descriptionInputPlaceholder:l,descriptionPreviewFallback:c,imageUrl:p,imageFallbackUrl:u,alt:h,title:g,titleInputPlaceholder:m,titlePreviewFallback:y,replacementVariables:w,recommendedReplacementVariables:f,applyReplacementVariables:b,onReplacementVariableSearchChange:v,isPremium:k,isLarge:_,socialPreviewLabel:T,idSuffix:j,activeMetaTabId:R}=this.props,S=b({title:g||y,description:a||c});return(0,d.jsxs)(x().Fragment,{children:[T&&(0,d.jsx)(K.SimulatedLabel,{children:T}),(0,d.jsx)(this.SocialPreview,{onMouseHover:this.setHoveredField,onSelect:this.setActiveField,onImageClick:s,siteUrl:n,title:S.title,description:S.description,imageUrl:p,imageFallbackUrl:u,alt:h,isLarge:_,activeMetaTabId:R}),(0,d.jsx)(mi.SocialMetadataPreviewForm,{onDescriptionChange:e,socialMediumName:o,title:g,titleInputPlaceholder:m,onRemoveImageClick:i,imageSelected:!!p,imageUrl:p,imageFallbackUrl:u,onTitleChange:t,onSelectImageClick:s,description:a,descriptionInputPlaceholder:l,imageWarnings:r,replacementVariables:w,recommendedReplacementVariables:f,onReplacementVariableSearchChange:v,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:k,setEditorRef:this.setEditorRef,idSuffix:j})]})}}eo.propTypes={title:o().string.isRequired,onTitleChange:o().func.isRequired,description:o().string.isRequired,onDescriptionChange:o().func.isRequired,imageUrl:o().string.isRequired,imageFallbackUrl:o().string.isRequired,onSelectImageClick:o().func.isRequired,onRemoveImageClick:o().func.isRequired,socialMediumName:o().string.isRequired,alt:o().string,isPremium:o().bool,imageWarnings:o().array,isLarge:o().bool,siteUrl:o().string,descriptionInputPlaceholder:o().string,titleInputPlaceholder:o().string,descriptionPreviewFallback:o().string,titlePreviewFallback:o().string,replacementVariables:Ji.replacementVariablesShape,recommendedReplacementVariables:Ji.recommendedReplacementVariablesShape,applyReplacementVariables:o().func,onReplacementVariableSearchChange:o().func,socialPreviewLabel:o().string,idSuffix:o().string,activeMetaTabId:o().string},eo.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",titleInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",alt:"",applyReplacementVariables:e=>e,onReplacementVariableSearchChange:null,socialPreviewLabel:"",idSuffix:"",activeMetaTabId:""};const to={},so=(e,t,{log:s=console.warn}={})=>{to[e]||(to[e]=!0,s(t))},io=(e,t=n.noop)=>{const s={};for(const i in e)Object.hasOwn(e,i)&&Object.defineProperty(s,i,{set:s=>{e[i]=s,t("set",i,s)},get:()=>(t("get",i),e[i])});return s};io({squareWidth:125,squareHeight:125,landscapeWidth:506,landscapeHeight:265,aspectRatio:50.2},(e,t)=>so(`@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.`)),io({squareWidth:158,squareHeight:158,landscapeWidth:527,landscapeHeight:273,portraitWidth:158,portraitHeight:237,aspectRatio:52.2,largeThreshold:{width:446,height:233}},(e,t)=>so(`@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 oo=te().div` | |
| 531 | + max-width: calc(527px + 1.5rem); | |
| 532 | +`,ro=e=>{const t="X"===e.socialMediumName?(0,l.__)("X share preview","wordpress-seo"):(0,l.__)("Social share preview","wordpress-seo"),{locationContext:s}=(0,r.useRootContext)();return(0,d.jsx)(r.Root,{children:(0,d.jsx)(oo,{children:(0,d.jsx)(r.FeatureUpsell,{shouldUpsell:!0,variant:"card",cardLink:(0,Ds.addQueryArgs)(wpseoAdminL10n["shortlinks.upsell.social_preview."+e.socialMediumName.toLowerCase()],{context:s}),cardText:(0,l.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */ | |
| 533 | +(0,l.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),"data-action":"load-nfd-ctb","data-ctb-id":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",children:(0,d.jsxs)("div",{className:"yst-grayscale yst-opacity-50",children:[(0,d.jsx)(r.Label,{children:t}),(0,d.jsx)(qi,{title:"",description:"",siteUrl:"",imageUrl:"",imageFallbackUrl:"",alt:"",onSelect:n.noop,onImageClick:n.noop,onMouseHover:n.noop})]})})})})};ro.propTypes={socialMediumName:o().oneOf(["Social","Twitter","X"]).isRequired};const no=ro;class ao extends e.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},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:t,onTitleChange:s,onSelectImageClick:i,onRemoveImageClick:o,socialMediumName:r,imageWarnings:n,description:a,descriptionInputPlaceholder:l,imageUrl:c,imageFallbackUrl:p,alt:u,title:h,titleInputPlaceholder:g,replacementVariables:m,recommendedReplacementVariables:y,onReplacementVariableSearchChange:w,isPremium:f,location:x}=this.props;return(0,d.jsxs)(e.Fragment,{children:[(0,d.jsx)(no,{socialMediumName:r}),(0,d.jsx)(mi.SocialMetadataPreviewForm,{onDescriptionChange:t,socialMediumName:r,title:h,titleInputPlaceholder:g,onRemoveImageClick:o,imageSelected:!!c,imageUrl:c,imageFallbackUrl:p,imageAltText:u,onTitleChange:s,onSelectImageClick:i,description:a,descriptionInputPlaceholder:l,imageWarnings:n,replacementVariables:m,recommendedReplacementVariables:y,onReplacementVariableSearchChange:w,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:f,setEditorRef:this.setEditorRef,idSuffix:x})]})}}ao.propTypes={title:o().string.isRequired,onTitleChange:o().func.isRequired,description:o().string.isRequired,onDescriptionChange:o().func.isRequired,imageUrl:o().string.isRequired,imageFallbackUrl:o().string,onSelectImageClick:o().func.isRequired,onRemoveImageClick:o().func.isRequired,socialMediumName:o().string.isRequired,isPremium:o().bool,imageWarnings:o().array,descriptionInputPlaceholder:o().string,titleInputPlaceholder:o().string,replacementVariables:Ji.replacementVariablesShape,recommendedReplacementVariables:Ji.recommendedReplacementVariablesShape,onReplacementVariableSearchChange:o().func,location:o().string,alt:o().string},ao.defaultProps={imageWarnings:[],imageFallbackUrl:"",recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,descriptionInputPlaceholder:"",titleInputPlaceholder:"",onReplacementVariableSearchChange:null,location:"",alt:""};const lo=ao,co=(t,s,i)=>{const[o,r]=(0,e.useState)(!1),n=(0,l.sprintf)( | |
| 534 | +/* Translators: %1$s expands to the jpg format, %2$s expands to the png format, | |
| 535 | + %3$s expands to the webp format, %4$s expands to the gif format. */ | |
| 536 | +/* Translators: %1$s expands to the jpg format, %2$s expands to the png format, | |
| 537 | + %3$s expands to the webp format, %4$s expands to the gif format. */ | |
| 538 | +(0,l.__)("No image was found that we can automatically set as your social image. Please use %1$s, %2$s, %3$s or %4$s formats to ensure it displays correctly on social media.","wordpress-seo"),"JPG","PNG","WEBP","GIF");return(0,e.useEffect)(()=>{r(""===s&&t.toLowerCase().endsWith(".avif"))},[t,s]),o?[n]:i},po=({isPremium:s,onLoad:i,location:o,imageFallbackUrl:r="",imageUrl:n="",imageWarnings:a=[],...l})=>{const[c,p]=(0,e.useState)(""),u=co(r,n,a),h=(0,e.useCallback)(e=>{p(e.detail.metaTabId)},[p]);(0,e.useEffect)(()=>(setTimeout(i),window.addEventListener("YoastSEO:metaTabChange",h),()=>{window.removeEventListener("YoastSEO:metaTabChange",h)}),[]);const g={isPremium:s,onLoad:i,location:o,imageFallbackUrl:r,imageUrl:n,imageWarnings:u,activeMetaTabId:c,...l};return s?(0,d.jsx)(t.Slot,{name:`YoastFacebookPremium${o.charAt(0).toUpperCase()+o.slice(1)}`,fillProps:g}):(0,d.jsx)(lo,{...g})};po.propTypes={isPremium:o().bool.isRequired,onLoad:o().func.isRequired,location:o().string.isRequired,imageFallbackUrl:o().string,imageUrl:o().string,imageWarnings:o().array};const uo=po;function ho(e){(function(e){const t=window.wp.media();return t.on("select",()=>{const s=t.state().get("selection").first();var i;e({type:(i=s.attributes).subtype,width:i.width,height:i.height,url:i.url,id:i.id,sizes:i.sizes,alt:i.alt||i.title||i.name})}),t})(e).open()}const go=()=>{ho(e=>(0,a.dispatch)("yoast-seo/editor").setFacebookPreviewImage((e=>{const{width:t,height:s}=e,i=(0,mi.determineFacebookImageMode)({width:t,height:s}),o=mi.FACEBOOK_IMAGE_SIZES[i+"Width"],r=mi.FACEBOOK_IMAGE_SIZES[i+"Height"],n=Object.values(e.sizes).find(e=>e.width>=o&&e.height>=r);return{url:n?n.url:e.url,id:e.id,warnings:(0,de.validateFacebookImage)(e),alt:e.alt||""}})(e)))},mo=(0,re.compose)([(0,a.withSelect)(e=>{const{getFacebookDescription:t,getDescription:s,getFacebookTitle:i,getSeoTitle:o,getFacebookImageUrl:r,getImageFallback:n,getFacebookWarnings:a,getRecommendedReplaceVars:l,getReplaceVars:c,getSiteUrl:d,getSeoTitleTemplate:p,getSeoTitleTemplateNoFallback:u,getSocialTitleTemplate:h,getSeoDescriptionTemplate:g,getSocialDescriptionTemplate:m,getReplacedExcerpt:y,getFacebookAltText:w}=e("yoast-seo/editor");return{imageUrl:r(),imageFallbackUrl:n(),recommendedReplacementVariables:l(),replacementVariables:c(),description:t(),descriptionPreviewFallback:m()||s()||g()||y()||"",title:i(),titlePreviewFallback:h()||o()||u()||p()||"",imageWarnings:a(),siteUrl:d(),isPremium:!!Ks().isPremium,titleInputPlaceholder:"",descriptionInputPlaceholder:"",socialMediumName:"Social",alt:w()}}),(0,a.withDispatch)((e,t,{select:s})=>{const{setFacebookPreviewTitle:i,setFacebookPreviewDescription:o,clearFacebookPreviewImage:r,loadFacebookPreviewData:n,findCustomFields:a}=e("yoast-seo/editor"),l=s("yoast-seo/editor").getPostId();return{onSelectImageClick:go,onRemoveImageClick:r,onDescriptionChange:o,onTitleChange:i,onLoad:n,onReplacementVariableSearchChange:xs(l,a)}}),as()])(uo),yo=({isPremium:s,onLoad:i,location:o,imageFallbackUrl:r="",imageUrl:n="",imageWarnings:a=[],...l})=>{const c=co(r,n,a);(0,e.useEffect)(()=>{setTimeout(i)},[]);const p={isPremium:s,onLoad:i,location:o,imageFallbackUrl:r,imageUrl:n,imageWarnings:c,...l};return s?(0,d.jsx)(t.Slot,{name:`YoastTwitterPremium${o.charAt(0).toUpperCase()+o.slice(1)}`,fillProps:p}):(0,d.jsx)(lo,{...p})};yo.propTypes={isPremium:o().bool.isRequired,onLoad:o().func.isRequired,location:o().string.isRequired,imageFallbackUrl:o().string,imageUrl:o().string,imageWarnings:o().array};const wo=yo,fo=()=>{ho(e=>(0,a.dispatch)("yoast-seo/editor").setTwitterPreviewImage((e=>{const t="summary"!==(0,n.get)(window,"wpseoScriptData.metabox.twitterCardType")?"landscape":"square",s=mi.TWITTER_IMAGE_SIZES[t+"Width"],i=mi.TWITTER_IMAGE_SIZES[t+"Height"],o=Object.values(e.sizes).find(e=>e.width>=s&&e.height>=i);return{url:o?o.url:e.url,id:e.id,warnings:(0,de.validateTwitterImage)(e),alt:e.alt||""}})(e)))},xo=(0,re.compose)([(0,a.withSelect)(e=>{const{getTwitterDescription:t,getTwitterTitle:s,getTwitterImageUrl:i,getFacebookImageUrl:o,getFacebookTitle:r,getFacebookDescription:n,getDescription:a,getSeoTitle:l,getTwitterWarnings:c,getTwitterImageType:d,getImageFallback:p,getRecommendedReplaceVars:u,getReplaceVars:h,getSiteUrl:g,getSeoTitleTemplate:m,getSeoTitleTemplateNoFallback:y,getSocialTitleTemplate:w,getSeoDescriptionTemplate:f,getSocialDescriptionTemplate:x,getReplacedExcerpt:b,getTwitterAltText:v}=e("yoast-seo/editor");return{imageUrl:i(),imageFallbackUrl:o()||p(),recommendedReplacementVariables:u(),replacementVariables:h(),description:t(),descriptionPreviewFallback:x()||n()||a()||f()||b()||"",title:s(),titlePreviewFallback:w()||r()||l()||y()||m()||"",imageWarnings:c(),siteUrl:g(),isPremium:!!Ks().isPremium,isLarge:"summary"!==d(),titleInputPlaceholder:"",descriptionInputPlaceholder:"",socialMediumName:"X",alt:v()}}),(0,a.withDispatch)((e,t,{select:s})=>{const{setTwitterPreviewTitle:i,setTwitterPreviewDescription:o,clearTwitterPreviewImage:r,loadTwitterPreviewData:n,findCustomFields:a}=e("yoast-seo/editor"),l=s("yoast-seo/editor").getPostId();return{onSelectImageClick:fo,onRemoveImageClick:r,onDescriptionChange:o,onTitleChange:i,onLoad:n,onReplacementVariableSearchChange:xs(l,a)}}),as()])(wo),bo=te().legend` | |
| 539 | + margin: 16px 0; | |
| 540 | + padding: 0; | |
| 541 | + color: ${Y.colors.$color_headings}; | |
| 542 | + font-size: 12px; | |
| 543 | + font-weight: 300; | |
| 544 | +`,vo=te().legend` | |
| 545 | + margin: 0 0 16px; | |
| 546 | + padding: 0; | |
| 547 | + color: ${Y.colors.$color_headings}; | |
| 548 | + font-size: 12px; | |
| 549 | + font-weight: 300; | |
| 550 | +`,ko=(0,de.makeOutboundLink)(te().a` | |
| 551 | + display: inline-block; | |
| 552 | + position: relative; | |
| 553 | + outline: none; | |
| 554 | + text-decoration: none; | |
| 555 | + border-radius: 100%; | |
| 556 | + width: 24px; | |
| 557 | + height: 24px; | |
| 558 | + margin: -4px 0; | |
| 559 | + vertical-align: middle; | |
| 560 | + | |
| 561 | + color: ${Y.colors.$color_help_text}; | |
| 562 | + | |
| 563 | + &:hover, | |
| 564 | + &:focus { | |
| 565 | + color: ${Y.colors.$color_snippet_focus}; | |
| 566 | + } | |
| 567 | + | |
| 568 | + // Overwrite the default blue active color for links. | |
| 569 | + &:active { | |
| 570 | + color: ${Y.colors.$color_help_text}; | |
| 571 | + } | |
| 572 | + | |
| 573 | + &::before { | |
| 574 | + position: absolute; | |
| 575 | + top: 0; | |
| 576 | + left: 0; | |
| 577 | + padding: 2px; | |
| 578 | + content: "\f223"; | |
| 579 | + } | |
| 580 | +`),_o=te()(ko)` | |
| 581 | + margin-block: 0; | |
| 582 | + margin-inline: 8px 0; | |
| 583 | +`,To=()=>(0,d.jsx)(_o,{href:wpseoAdminL10n["shortlinks.social_previews_info"],className:"dashicons",children:(0,d.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */ | |
| 584 | +(0,l.__)("Learn more about social previews","wordpress-seo")})}),jo=te().div` | |
| 585 | + padding: 16px; | |
| 586 | +`,Ro=({useOpenGraphData:t,useTwitterData:s})=>(0,d.jsxs)(e.Fragment,{children:[s&&t&&(0,d.jsxs)(e.Fragment,{children:[(0,d.jsxs)(Es,{hasSeparator:!1 | |
| 587 | +/* translators: Social media appearance refers to a preview of how a page will be represented on social media. */,title:(0,l.__)("Social media appearance","wordpress-seo"),initialIsOpen:!0,HeaderHelpLink:To,children:[(0,d.jsx)(vo,{children:(0,l.__)("Determine how your post should look on social media like Facebook, X, Instagram, WhatsApp, Threads, LinkedIn, Slack, and more.","wordpress-seo")}),(0,d.jsx)(mo,{}),(0,d.jsx)(bo,{children:(0,l.__)("To customize the appearance of your post specifically for X, please fill out the 'X appearance' settings below. If you leave these settings untouched, the 'Social media appearance' settings mentioned above will also be applied for sharing on X.","wordpress-seo")})]}),(0,d.jsx)(Es,{title:(0,l.__)("X appearance","wordpress-seo"),hasSeparator:!0,initialIsOpen:!1,children:(0,d.jsx)(xo,{})})]}),t&&!s&&(0,d.jsxs)(jo,{children:[(0,d.jsxs)(vo,{children:[(0,l.__)("Determine how your post should look on social media like Facebook, X, Instagram, WhatsApp, Threads, LinkedIn, Slack, and more.","wordpress-seo"),(0,d.jsx)(To,{})]}),(0,d.jsx)(mo,{})]}),!t&&s&&(0,d.jsxs)(jo,{children:[(0,d.jsx)(vo,{children:(0,l.__)("To customize the appearance of your post specifically for X, please fill out the 'X appearance' settings below.","wordpress-seo")}),(0,d.jsx)(xo,{})]})]});Ro.propTypes={useOpenGraphData:o().bool.isRequired,useTwitterData:o().bool.isRequired};const So=Ro,Io=(0,a.withSelect)(e=>{const{getPreferences:t}=e("yoast-seo/editor"),{useOpenGraphData:s,useTwitterData:i}=t();return{useOpenGraphData:s,useTwitterData:i}})(So);function Co({target:e}){return(0,d.jsx)(G,{target:e,children:(0,d.jsx)(Io,{})})}Co.propTypes={target:o().string.isRequired};const Eo=(0,de.makeOutboundLink)(),Lo=te().div` | |
| 588 | + padding: 16px; | |
| 589 | +`,Ao="yoast-seo/editor";function Po({location:e,show:t}){return t?(0,d.jsxs)(K.Alert,{type:"info",children:[(0,l.sprintf)(/* translators: %s Expands to "Yoast News SEO" */ /* translators: %s Expands to "Yoast News SEO" */ | |
| 590 | +(0,l.__)("Are you working on a news article? %s helps you optimize your site for Google News.","wordpress-seo"),"Yoast News SEO")+" ",(0,d.jsx)(Eo,{href:window.wpseoAdminL10n[`shortlinks.upsell.${e}.news`],children:(0,l.sprintf)(/* translators: %s: Expands to "Yoast News SEO". */ /* translators: %s: Expands to "Yoast News SEO". */ | |
| 591 | +(0,l.__)("Buy %s now!","wordpress-seo"),"Yoast News SEO")})]}):null}Po.propTypes={show:o().bool.isRequired,location:o().string.isRequired};const qo=(e,t,s)=>{const i=(0,a.useSelect)(e=>e(Ao).getIsProduct(),[]),o=(0,a.useSelect)(e=>e(Ao).getIsWooSeoActive(),[]),r=i&&o?{name:(0,l.__)("Item Page","wordpress-seo"),value:"ItemPage"}:e.find(e=>e.value===t);return[{name:(0,l.sprintf)(/* translators: %1$s expands to the plural name of the current post type, %2$s expands to the current site wide default. */ /* translators: %1$s expands to the plural name of the current post type, %2$s expands to the current site wide default. */ | |
| 592 | +(0,l.__)("Default for %1$s (%2$s)","wordpress-seo"),s,r?r.name:""),value:""},...e]},Fo=(e,t)=>c((e=>(0,l.sprintf)(/* translators: %1$s expands to the plural name of the current post type, %2$s and %3$s expand to a link to the Settings page */ /* translators: %1$s expands to the plural name of the current post type, %2$s and %3$s expand to a link to the Settings page */ | |
| 593 | +(0,l.__)("You can change the default type for %1$s under Content types in the %2$sSettings%3$s.","wordpress-seo"),e,"<link>","</link>"))(e),{link:(0,d.jsx)("a",{href:t,target:"_blank",rel:"noreferrer"})}),Mo=({helpTextTitle:e,helpTextLink:t,helpTextDescription:s})=>(0,d.jsx)(K.FieldGroup,{label:e,linkTo:t | |
| 594 | +/* translators: Hidden accessibility text. */,linkText:(0,l.__)("Learn more about structured data with Schema.org","wordpress-seo"),description:s});Mo.propTypes={helpTextTitle:o().string.isRequired,helpTextLink:o().string.isRequired,helpTextDescription:o().string.isRequired};const Do=({schemaPageTypeChange:t=n.noop,schemaPageTypeSelected:s=null,pageTypeOptions:i,schemaArticleTypeChange:o=n.noop,schemaArticleTypeSelected:r=null,articleTypeOptions:c,showArticleTypeInput:p,additionalHelpTextLink:u,helpTextLink:h,helpTextTitle:g,helpTextDescription:m,postTypeName:y,displayFooter:w=!1,defaultPageType:f,defaultArticleType:x,location:b,isNewsEnabled:v=!1})=>{const k=qo(i,f,y),_=qo(c,x,y),T=(0,a.useSelect)(e=>e(Ao).selectLink("https://yoa.st/product-schema-metabox"),[]),j=(0,a.useSelect)(e=>e(Ao).getIsWooSeoUpsell(),[]),[R,S]=(0,e.useState)(r),I=(0,l.__)("Want your products stand out in search results with rich results like price, reviews and more?","wordpress-seo"),C=(0,a.useSelect)(e=>e(Ao).getIsProduct(),[]),E=(0,a.useSelect)(e=>e(Ao).getIsWooSeoActive(),[]),L=(0,a.useSelect)(e=>e(Ao).selectAdminLink("?page=wpseo_page_settings"),[]),A=C&&E,P=(0,e.useCallback)((e,t)=>{S(t)},[]);return(0,e.useEffect)(()=>{P(null,r)},[r]),(0,d.jsxs)(e.Fragment,{children:[(0,d.jsx)(Mo,{helpTextLink:h,helpTextTitle:g,helpTextDescription:m}),(0,d.jsx)(K.FieldGroup,{label:(0,l.__)("What type of page or content is this?","wordpress-seo"),linkTo:u | |
| 595 | +/* translators: Hidden accessibility text. */,linkText:(0,l.__)("Learn more about page or content types","wordpress-seo")}),j&&(0,d.jsx)(vs,{link:T,text:I}),(0,d.jsx)(K.Select,{id:(0,de.join)(["yoast-schema-page-type",b]),options:k,label:(0,l.__)("Page type","wordpress-seo"),onChange:t,selected:A?"ItemPage":s,disabled:A}),p&&(0,d.jsx)(K.Select,{id:(0,de.join)(["yoast-schema-article-type",b]),options:_,label:(0,l.__)("Article type","wordpress-seo"),onChange:o,selected:r,onOptionFocus:P}),(0,d.jsx)(Po,{location:b,show:!v&&(q=R,F=x,"NewsArticle"===q||""===q&&"NewsArticle"===F)}),w&&!A&&(0,d.jsx)("p",{children:Fo(y,L)}),A&&(0,d.jsx)("p",{children:(0,l.sprintf)(/* translators: %1$s expands to Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast WooCommerce SEO. */ | |
| 596 | +(0,l.__)("You have %1$s activated on your site, automatically setting the Page type for your products to 'Item Page'. As a result, the Page type selection is disabled.","wordpress-seo"),"Yoast WooCommerce SEO")})]});var q,F},Oo=o().arrayOf(o().shape({name:o().string,value:o().string}));Do.propTypes={schemaPageTypeChange:o().func,schemaPageTypeSelected:o().string,pageTypeOptions:Oo.isRequired,schemaArticleTypeChange:o().func,schemaArticleTypeSelected:o().string,articleTypeOptions:Oo.isRequired,showArticleTypeInput:o().bool.isRequired,additionalHelpTextLink:o().string.isRequired,helpTextLink:o().string.isRequired,helpTextTitle:o().string.isRequired,helpTextDescription:o().string.isRequired,postTypeName:o().string.isRequired,displayFooter:o().bool,defaultPageType:o().string.isRequired,defaultArticleType:o().string.isRequired,location:o().string.isRequired,isNewsEnabled:o().bool};const No=({isMetabox:t,showArticleTypeInput:s=!1,articleTypeLabel:i="",additionalHelpTextLink:o="",pageTypeLabel:r,helpTextLink:n,helpTextTitle:a,helpTextDescription:l,postTypeName:c,displayFooter:p=!1,loadSchemaArticleData:u,loadSchemaPageData:h,location:g,...m})=>{const y=(0,d.jsx)(Do,{showArticleTypeInput:s,articleTypeLabel:i,additionalHelpTextLink:o,pageTypeLabel:r,helpTextLink:n,helpTextTitle:a,helpTextDescription:l,postTypeName:c,displayFooter:p,loadSchemaArticleData:u,loadSchemaPageData:h,location:g,...m});return t?(0,e.createPortal)((0,d.jsx)(Lo,{children:y}),document.getElementById("wpseo-meta-section-schema")):y};No.propTypes={isMetabox:o().bool.isRequired,showArticleTypeInput:o().bool,articleTypeLabel:o().string,additionalHelpTextLink:o().string,pageTypeLabel:o().string.isRequired,helpTextLink:o().string.isRequired,helpTextTitle:o().string.isRequired,helpTextDescription:o().string.isRequired,postTypeName:o().string.isRequired,displayFooter:o().bool,loadSchemaArticleData:o().func.isRequired,loadSchemaPageData:o().func.isRequired,location:o().string.isRequired};const $o=No;class Uo{static get articleTypeInput(){return document.getElementById("yoast_wpseo_schema_article_type")}static get defaultArticleType(){return Uo.articleTypeInput.getAttribute("data-default")}static get articleType(){return Uo.articleTypeInput.value}static set articleType(e){Uo.articleTypeInput.value=e}static get pageTypeInput(){return document.getElementById("yoast_wpseo_schema_page_type")}static get defaultPageType(){return Uo.pageTypeInput.getAttribute("data-default")}static get pageType(){return Uo.pageTypeInput.value}static set pageType(e){Uo.pageTypeInput.value=e}}const Wo=t=>{const s=null!==Uo.articleTypeInput;(0,e.useEffect)(()=>{t.loadSchemaPageData(),s&&t.loadSchemaArticleData()},[]);const{pageTypeOptions:i,articleTypeOptions:o}=window.wpseoScriptData.metabox.schema,r={articleTypeLabel:(0,l.__)("Article type","wordpress-seo"),pageTypeLabel:(0,l.__)("Page type","wordpress-seo"),postTypeName:window.wpseoAdminL10n.postTypeNamePlural,helpTextTitle:(0,l.__)("Yoast SEO automatically describes your pages using schema.org","wordpress-seo"),helpTextDescription:(0,l.__)("This helps search engines understand your website and your content. You can change some of your settings for this page below.","wordpress-seo"),showArticleTypeInput:s,pageTypeOptions:i,articleTypeOptions:o},n={...t,...r,...(a=t.location,"metabox"===a?{helpTextLink:wpseoAdminL10n["shortlinks.metabox.schema.explanation"],additionalHelpTextLink:wpseoAdminL10n["shortlinks.metabox.schema.page_type"],isMetabox:!0}:{helpTextLink:wpseoAdminL10n["shortlinks.sidebar.schema.explanation"],additionalHelpTextLink:wpseoAdminL10n["shortlinks.sidebar.schema.page_type"],isMetabox:!1})};var a;return(0,d.jsx)($o,{...n})};Wo.propTypes={displayFooter:o().bool.isRequired,schemaPageTypeSelected:o().string.isRequired,schemaArticleTypeSelected:o().string.isRequired,defaultArticleType:o().string.isRequired,defaultPageType:o().string.isRequired,loadSchemaPageData:o().func.isRequired,loadSchemaArticleData:o().func.isRequired,schemaPageTypeChange:o().func.isRequired,schemaArticleTypeChange:o().func.isRequired,location:o().string.isRequired};const Ho=(0,re.compose)([(0,a.withSelect)(e=>{const{getPreferences:t,getPageType:s,getDefaultPageType:i,getArticleType:o,getDefaultArticleType:r}=e("yoast-seo/editor"),{displaySchemaSettingsFooter:n,isNewsEnabled:a}=t();return{displayFooter:n,isNewsEnabled:a,schemaPageTypeSelected:s(),schemaArticleTypeSelected:o(),defaultArticleType:r(),defaultPageType:i()}}),(0,a.withDispatch)(e=>{const{setPageType:t,setArticleType:s,getSchemaPageData:i,getSchemaArticleData:o}=e("yoast-seo/editor");return{loadSchemaPageData:i,loadSchemaArticleData:o,schemaPageTypeChange:t,schemaArticleTypeChange:s}}),as()])(Wo),Bo=window.yoast.relatedKeyphraseSuggestions;function Ko({requestLimitReached:e,isSuccess:t,response:s,requestHasData:i,relatedKeyphrases:o}){return e?"requestLimitReached":!t&&function(e){return"invalid_json"===(null==e?void 0:e.code)||"fetch_error"===(null==e?void 0:e.code)||!(0,n.isEmpty)(e)&&"error"in e}(s)?"requestFailed":i?function(e){return e&&e.length>=4}(o)?"maxRelatedKeyphrases":null:"requestEmpty"}function Yo({keyphrase:t="",relatedKeyphrases:s=[],renderAction:i=null,requestLimitReached:o=!1,countryCode:n,setCountry:a,newRequest:l,response:c={},isRtl:p=!1,userLocale:u="en_US",isPending:h=!1,isSuccess:g=!1,requestHasData:m=!0,isPremium:y=!1,semrushUpsellLink:w="",premiumUpsellLink:f=""}){var x,b;const[v,k]=(0,e.useState)(n),_=(0,e.useCallback)(async()=>{l(n,t),k(n)},[n,t,l]);return(0,d.jsxs)(r.Root,{context:{isRtl:p},children:[!o&&!y&&(0,d.jsx)(Bo.PremiumUpsell,{url:f,className:"yst-mb-4"}),!o&&(0,d.jsx)(Bo.CountrySelector,{countryCode:n,activeCountryCode:v,onChange:a,onClick:_,className:"yst-mb-4",userLocale:u.split("_")[0]}),!h&&(0,d.jsx)(Bo.UserMessage,{variant:Ko({requestLimitReached:o,isSuccess:g,response:c,requestHasData:m,relatedKeyphrases:s}),upsellLink:w}),(0,d.jsx)(Bo.KeyphrasesTable,{relatedKeyphrases:s,columnNames:null==c||null===(x=c.results)||void 0===x?void 0:x.columnNames,data:null==c||null===(b=c.results)||void 0===b?void 0:b.rows,isPending:h,renderButton:i,className:"yst-mt-4"})]})}Yo.propTypes={keyphrase:o().string,relatedKeyphrases:o().array,renderAction:o().func,requestLimitReached:o().bool,countryCode:o().string.isRequired,setCountry:o().func.isRequired,newRequest:o().func.isRequired,response:o().object,isRtl:o().bool,userLocale:o().string,isPending:o().bool,isSuccess:o().bool,requestHasData:o().bool,isPremium:o().bool,semrushUpsellLink:o().string,premiumUpsellLink:o().string};const zo=(0,re.compose)([(0,a.withSelect)(e=>{const{getFocusKeyphrase:t,getSEMrushSelectedCountry:s,getSEMrushRequestLimitReached:i,getSEMrushRequestResponse:o,getSEMrushRequestIsSuccess:r,getSEMrushIsRequestPending:n,getSEMrushRequestHasData:a,getPreference:l,getIsPremium:c,selectLinkParams:d}=e("yoast-seo/editor");return{keyphrase:t(),countryCode:s(),requestLimitReached:i(),response:o(),isSuccess:r(),isPending:n(),requestHasData:a(),isRtl:l("isRtl",!1),userLocale:l("userLocale","en_US"),isPremium:c(),semrushUpsellLink:(0,Ds.addQueryArgs)("https://yoa.st/semrush-prices",d()),premiumUpsellLink:(0,Ds.addQueryArgs)("https://yoa.st/413",d())}}),(0,a.withDispatch)(e=>{const{setSEMrushChangeCountry:t,setSEMrushNewRequest:s}=e("yoast-seo/editor");return{setCountry:e=>{t(e)},newRequest:(e,t)=>{s(e,t)}}})])(Yo),Vo=({isOpen:e,closeModal:t,id:s,upsellLink:i})=>(0,d.jsx)(ei,{isOpen:e,onClose:t,id:s,upsellLink:i,title:(0,l.__)("Cover more search intent with related keyphrases","wordpress-seo"),description:(0,l.__)("Optimize for up to 5 keyphrases to shape your content around different themes, audiences, and angles - helping it get discovered by a wider audience.","wordpress-seo"),note:(0,l.__)("Fine-tune your content for every audience","wordpress-seo"),modalTitle:(0,l.__)("Add more keyphrases with Premium","wordpress-seo"),ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"}),Go=()=>{const[t,,,s,i]=(0,r.useToggleState)(!1),o=(0,e.useContext)(J.LocationContext),{locationContext:n}=(0,J.useRootContext)(),a=(0,r.useSvgAria)(),c=wpseoAdminL10n["sidebar"===o.toLowerCase()?"shortlinks.upsell.sidebar.additional_button":"shortlinks.upsell.metabox.additional_button"];return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Vo,{isOpen:t,closeModal:i,upsellLink:(0,Ds.addQueryArgs)(c,{context:n}),id:`yoast-additional-keyphrases-modal-${o}`}),"sidebar"===o&&(0,d.jsx)(xe,{id:"yoast-additional-keyphrase-modal-open-button",title:(0,l.__)("Add related keyphrase","wordpress-seo"),prefixIcon:{icon:"plus",color:Y.colors.$color_grey_medium_dark},onClick:s,children:(0,d.jsx)("div",{className:"yst-root",children:(0,d.jsx)(r.Badge,{size:"small",variant:"upsell",children:(0,d.jsx)(Xs(),{className:"yst-w-2.5 yst-h-2.5 yst-shrink-0",...a})})})}),"metabox"===o&&(0,d.jsx)("div",{className:"yst-root",children:(0,d.jsxs)(ce,{id:"yoast-additional-keyphrase-metabox-modal-open-button",onClick:s,children:[(0,d.jsx)(K.SvgIcon,{icon:"plus",color:Y.colors.$color_grey_medium_dark}),(0,d.jsx)(ce.Text,{children:(0,l.__)("Add related keyphrase","wordpress-seo")}),(0,d.jsxs)(r.Badge,{size:"small",variant:"upsell",children:[(0,d.jsx)(Xs(),{className:"yst-w-2.5 yst-h-2.5 yst-me-1 yst-shrink-0",...a}),(0,d.jsx)("span",{children:"Premium"})]})]})})]})};var Zo=s(998),Xo=s.n(Zo);const Qo=({store:t="yoast-seo/editor",location:s="sidebar"})=>{const i="black-friday-promotion",o=(0,a.useSelect)(e=>e(t).getIsPremium(),[t]),n=(0,a.useSelect)(e=>e(t).selectLinkParams(),[t]),c=(0,a.useSelect)(e=>e(t).isPromotionActive(i),[t]),p=(0,a.useSelect)(e=>e(t).getIsWooCommerceActive(),[t]),u=(0,a.useSelect)(e=>e(t).isAlertDismissed(i),[t]),h=(0,e.useCallback)(()=>{(0,a.dispatch)(t).dismissAlert(i)},[t,i]),m=(0,Ds.addQueryArgs)("https://yoa.st/black-friday-sale",n),y=(0,r.useSvgAria)();return o||!c||u?null:(0,d.jsx)("div",{className:"yst-root",children:(0,d.jsxs)("div",{className:q()("yst-border yst-rounded-lg yst-p-4 yst-max-w-md yst-relative yst-shadow-sm yst-mt-2",p?"yst-border-woo-light":"yst-border-primary-200"),children:[(0,d.jsxs)(r.Badge,{size:"small",className:"yst-text-[10px] yst-bg-black yst-text-amber-300 yst-absolute yst--top-2",children:[(0,l.__)("BLACK FRIDAY","wordpress-seo")," "]}),(0,d.jsxs)("button",{className:"yst-absolute yst-top-4 yst-end-4",onClick:h,children:[(0,d.jsx)(Xo(),{className:"yst-w-4 yst-text-slate-400 yst-shrink-0 yst--mt-0.5"}),(0,d.jsx)("div",{className:"yst-sr-only",children:(0,l.__)("Dismiss","wordpress-seo")})]}),(0,d.jsxs)("div",{className:q()("sidebar"===s?"":"yst-flex yst-justify-between yst-gap-3"),children:[(0,d.jsxs)("div",{className:p?"yst-text-woo-light":"yst-text-primary-500",children:[(0,d.jsx)("div",{className:"yst-text-2xl yst-font-bold",children:(0,l.__)("30% OFF","wordpress-seo")}),(0,d.jsx)("div",{className:"yst-flex yst-gap-2 yst-font-semibold yst-text-tiny",children:p?(0,d.jsxs)(d.Fragment,{children:["Yoast WooCommerce SEO ",(0,d.jsx)(Js(),{className:"yst-w-4 yst-scale-x-[-1]",...y})]}):(0,d.jsxs)(d.Fragment,{children:[" Yoast SEO Premium ",(0,d.jsx)(D,{className:"yst-w-4",...y})]})})]}),(0,d.jsx)("div",{className:"yst-flex yst-items-end",children:(0,d.jsxs)(r.Button,{as:"a",className:q()("sidebar"===s?"yst-w-full":"yst-w-[140px]","yst-flex yst-gap-1 yst-w-[140px] yst-h-7 yst-mt-4"),variant:"upsell",href:m,target:"_blank",rel:"noreferrer",children:[(0,l.__)("Buy now!","wordpress-seo"),(0,d.jsx)(g(),{className:"yst-w-4 rtl:yst-rotate-180",...y})]})})]})]})})};Qo.propTypes={store:o().string,location:o().oneOf(["sidebar","metabox"]),inEditorIntro:o().bool};const Jo="yoast-seo/content-planner",er=(0,re.compose)([(0,a.withDispatch)(e=>{const{setFeatureModalStatus:t}=e(Jo);return{setFeatureModalStatus:t}})])(({location:t,setFeatureModalStatus:s})=>{const i=(0,e.useCallback)(()=>{s("idle")},[s]),o=(0,a.useSelect)(e=>e(Jo).selectIsMinPostsMet(),[]),n="yoast-content-planner-min-posts-notice-"+t;return(0,d.jsx)(r.Root,{children:(0,d.jsxs)("div",{className:q()("metabox"===t&&"yst-flex yst-items-center yst-gap-3"),children:[(0,d.jsx)(r.Button,{variant:"ai-secondary",onClick:i,disabled:!o,"aria-describedby":o?null:n,className:"sidebar"===t?"yst-w-full":"",children:(0,l.__)("Get content suggestions","wordpress-seo")}),!o&&(0,d.jsx)("span",{id:n,className:q()("yst-text-sm yst-text-slate-500 yst-italic","sidebar"===t&&"yst-flex yst-mt-1 yst-justify-center"),children:(0,l.__)("Available after 5 published posts","wordpress-seo")})]})})});var tr;function sr(){return sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)({}).hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e},sr.apply(null,arguments)}const ir=e=>f.createElement("svg",sr({xmlns:"http://www.w3.org/2000/svg",fill:"none","aria-hidden":"true",viewBox:"0 0 54 24"},e),tr||(tr=f.createElement("path",{fill:"currentColor",d:"M17.854 5.72c-4.173 0-5.842 2.798-5.842 5.913 0 3.116 1.645 6.036 5.842 6.036 4.196 0 5.831-2.93 5.824-5.846-.01-3.551-1.809-6.104-5.824-6.104v.001zm-2.528 6.09c.101-4.169 3.306-4.165 4.377-2.672.976 1.36 1.176 6.013-1.85 5.98-1.392-.016-2.486-.956-2.527-3.309zm36.371 2.968V8.74h2.161V6.117h-2.16V2.951H48.36v3.166h-1.694V8.74h1.694v5.696c0 3.239 2.26 5.162 4.643 5.56l.997-2.68c-1.39-.176-2.29-1.214-2.303-2.537zm-16.84-.957v-4.54c0-.165-.01-.32-.026-.472-.29-3.668-5.503-3.66-9.54-2.252l1.166 2.346c2.63-1.248 4.203-.926 4.753-.311.014.016.028.031.04.048l.005.007c.28.379.213.975.213 1.445-3.436 0-7.093.455-7.093 4.22 0 2.862 3.59 4.703 7.34 1.976l.556 1.341h3.215c-.286-1.575-.63-2.925-.63-3.808h.002zm-3.362-.025c-2.643 2.955-5.064.174-2.585-1.04.73-.248 1.72-.26 2.585-.26v1.3zm8.492-4.759c0-1.118 1.792-1.64 4.619-.351l.977-2.371c-3.804-1.15-8.998-1.252-9.033 2.722-.016 1.905 1.208 2.93 2.969 3.585 1.22.453 2.98.687 2.975 1.657-.006 1.268-2.736 1.463-5.221-.243l-1.004 2.572c3.39 1.686 9.692 1.733 9.66-2.49-.034-4.176-5.94-3.46-5.94-5.08h-.002zM10.638 0 5.783 13.471 3.46 6.196H0l3.872 9.935c.33.846.33 1.784 0 2.63-.433 1.11-1.153 2.057-2.908 2.294V24c3.418 0 5.265-2.1 6.913-6.699L14.337 0h-3.7z"}))),or=({children:e})=>(0,d.jsxs)("div",{className:"yst-p-4 yst-flex yst-flex-col yst-gap-3",children:[(0,d.jsx)(ir,{className:"yst-w-14 yst-text-primary-500"}),e]}),rr=({withPromptForContentSuggestions:e,className:t})=>(0,d.jsx)("p",{className:q()("yst-text-slate-600 yst-my-0",t),children:e?(0,l.__)("Optimize your content for discovery or get new content suggestions.","wordpress-seo"):(0,l.__)("Optimize your content for discovery.","wordpress-seo")}),nr=(ar=Qo,e=>!(()=>{var e,t;const s=(0,a.select)("yoast-seo/editor").getIsPremium(),i=(0,a.select)("yoast-seo/editor").getWarningMessage();return(s&&null!==(e=null===(t=(0,a.select)("yoast-seo-premium/editor"))||void 0===t?void 0:t.getMetaboxWarning())&&void 0!==e?e:[]).length>0||i.length>0})()&&(0,d.jsx)(ar,{...e}));var ar;function lr({settings:s}){const{isTerm:i,isPost:o,isAiFeatureActive:r}=(0,a.useSelect)(e=>({isTerm:e("yoast-seo/editor").getIsTerm(),isPost:"post"===e("yoast-seo/editor").getPostType(),isAiFeatureActive:e("yoast-seo/editor").getPreference("isAiFeatureActive")}),[]),n=window.wpseoScriptData&&"1"===window.wpseoScriptData.isBlockEditor;return n&&(()=>{const{editorMode:t,activeAIButtonId:s}=(0,a.useSelect)(e=>({editorMode:e("core/edit-post").getEditorMode(),activeAIButtonId:e("yoast-seo/editor").getActiveAIFixesButton()}),[]),{setMarkerStatus:i}=(0,a.useDispatch)("yoast-seo/editor");(0,e.useEffect)(()=>(i("visual"===t&&s||"text"===t?"disabled":"enabled"),()=>{i("disabled")}),[t,s])})(),(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(t.Fill,{name:"YoastMetabox",children:[(0,d.jsx)(ii,{renderPriority:0,children:(0,d.jsx)(Ts,{})},"warning"),(0,d.jsx)(ii,{renderPriority:1,children:(0,d.jsxs)(or,{children:[(0,d.jsx)(nr,{location:"metabox"}),(0,d.jsx)(rr,{withPromptForContentSuggestions:r&&n&&o}),o&&n&&r&&(0,d.jsx)(er,{location:"metabox"})]})},"editor-intro"),s.isKeywordAnalysisActive&&(0,d.jsxs)(ii,{renderPriority:8,children:[(0,d.jsx)(ns.TopicInputs,{isSEMrushIntegrationActive:s.isSEMrushIntegrationActive}),!window.wpseoScriptData.metabox.isPremium&&(0,d.jsx)(t.Fill,{name:"YoastRelatedKeyphrases",children:(0,d.jsx)(zo,{})})]},"keyword-input"),(0,d.jsx)(ii,{renderPriority:9,children:(0,d.jsx)(Es,{id:"yoast-snippet-editor-metabox",title:(0,l.__)("Search appearance","wordpress-seo"),initialIsOpen:!0,children:(0,d.jsx)(_s,{hasPaperStyle:!1})})},"search-appearance"),s.isContentAnalysisActive&&(0,d.jsx)(ii,{renderPriority:10,children:(0,d.jsx)(ns.ReadabilityAnalysis,{shouldUpsell:s.shouldUpsell})},"readability-analysis"),s.isKeywordAnalysisActive&&(0,d.jsx)(ii,{renderPriority:20,children:(0,d.jsx)(e.Fragment,{children:(0,d.jsx)(ns.SeoAnalysis,{shouldUpsell:s.shouldUpsell})})},"seo-analysis"),s.isInclusiveLanguageAnalysisActive&&(0,d.jsx)(ii,{renderPriority:21,children:(0,d.jsx)(ns.InclusiveLanguageAnalysis,{})},"inclusive-language-analysis"),s.isKeywordAnalysisActive&&(0,d.jsx)(ii,{renderPriority:22,children:s.shouldUpsell&&(0,d.jsx)(Go,{})},"additional-keywords-upsell"),s.isKeywordAnalysisActive&&s.isWincherIntegrationActive&&(0,d.jsx)(ii,{renderPriority:23,children:(0,d.jsx)(rs,{location:"metabox"})},"wincher-seo-performance"),s.shouldUpsell&&!i&&(0,d.jsx)(ii,{renderPriority:25,children:(0,d.jsx)(ti,{})},"internal-linking-suggestions-upsell"),s.isCornerstoneActive&&(0,d.jsx)(ii,{renderPriority:30,children:(0,d.jsx)(ls,{})},"cornerstone"),s.displayAdvancedTab&&(0,d.jsx)(ii,{renderPriority:40,children:(0,d.jsx)(Es,{id:"collapsible-advanced-settings",title:(0,l.__)("Advanced","wordpress-seo"),children:(0,d.jsx)(pi,{})})},"advanced"),s.displaySchemaSettings&&(0,d.jsx)(ii,{renderPriority:50,children:(0,d.jsx)(Ho,{})},"schema"),n&&(0,d.jsx)(ii,{renderPriority:24,children:(0,d.jsx)(ns.ContentBlocks,{})},"content-blocks"),(0,d.jsx)(ii,{renderPriority:-1,children:(0,d.jsx)(Co,{target:"wpseo-section-social"})},"social"),s.isInsightsEnabled&&(0,d.jsx)(ii,{renderPriority:52,children:(0,d.jsx)(Gs,{location:"metabox"})},"insights")]})})}lr.propTypes={settings:o().object.isRequired};const cr=(0,re.compose)([(0,a.withSelect)((e,t)=>{const{getPreferences:s}=e("yoast-seo/editor");return{settings:s(),store:t.store}})])(lr);function dr({target:e,store:t,theme:s}){return(0,d.jsxs)(G,{target:e,children:[(0,d.jsx)(oe,{store:t,theme:s}),(0,d.jsx)(cr,{store:t,theme:s})]})}dr.propTypes={target:o().string.isRequired,store:o().object.isRequired,theme:o().object.isRequired};const pr=[];let ur=null;class hr extends e.Component{constructor(e){super(e),this.state={registeredComponents:[...pr]}}registerComponent(e,t){this.setState(s=>({...s,registeredComponents:[...s.registeredComponents,{key:e,Component:t}]}))}render(){return this.state.registeredComponents.map(({Component:e,key:t})=>(0,d.jsx)(e,{},t))}}function gr(e,t){null===ur||null===ur.current?pr.push({key:e,Component:t}):ur.current.registerComponent(e,t)}const mr=window.yoast.externals.redux,yr=window.jQuery;var wr=s.n(yr);function fr(e){let t="";var s;return t=!1===function(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()}(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}n.noop,n.noop,n.noop;const{removeMarks:xr}=z.markers,{updateReplacementVariable:br,updateData:vr,hideReplacementVariables:kr,setContentImage:_r,setEditorDataContent:Tr,setEditorDataTitle:jr,setEditorDataExcerpt:Rr,setEditorDataImageUrl:Sr,setEditorDataSlug:Ir}=mr.actions;window.yoast=window.yoast||{},window.yoast.initEditorIntegration=function(s){window.YoastSEO=window.YoastSEO||{},window.YoastSEO._registerReactComponent=gr,function(s){const i=Ks();ur=(0,e.createRef)();const o={isRtl:i.isRtl};(0,e.createRoot)(document.getElementById("wpseo-metabox-root")).render((0,d.jsxs)(t.SlotFillProvider,{children:[(0,d.jsx)(J.Root,{context:{locationContext:"classic-metabox"},children:(0,d.jsx)(dr,{target:"wpseo-metabox-root",store:s,theme:o})}),(0,d.jsx)(hr,{ref:ur})]}))}(s)},window.yoast.EditorData=class{constructor(e,t,s="content"){this._refresh=e,this._store=t,this._tinyMceId=s,this._previousData={},this._previousEditorData={},this.updateReplacementData=this.updateReplacementData.bind(this),this.refreshYoastSEO=this.refreshYoastSEO.bind(this)}initialize(e,t=[]){const s=this.getInitialData(e);var i,o;i=s,o=this._store,(0,n.forEach)(i,(e,t)=>{ws.includes(t)||o.dispatch(gs(t,e))}),this._store.dispatch(kr(t)),this._previousEditorData.content=s.content,this._store.dispatch(Tr(s.content)),this._previousEditorData.contentImage=s.contentImage,this._store.dispatch(_r(s.contentImage)),this.setImageInSnippetPreview(s.snippetPreviewImageURL||s.contentImage),this._previousEditorData.slug=s.slug,this._store.dispatch(Ir(s.slug)),this.updateReplacementData({target:{value:s.title}},"title"),this.updateReplacementData({target:{value:s.excerpt}},"excerpt"),this.updateReplacementData({target:{value:s.excerpt_only}},"excerpt_only"),this.subscribeToElements(),this.subscribeToStore(),this.subscribeToSnippetPreviewImage(),this.subscribeToTinyMceEditor(),this.subscribeToSlug()}subscribeToTinyMceEditor(){const e=e=>{if((0,n.isString)(e)||(e=this.getContent()),this._previousEditorData.content===e)return;if(this._previousEditorData.content=e,this._store.dispatch(Tr(e)),this.featuredImageIsSet)return;const t=this.getContentImage(e);this._previousEditorData.contentImage!==t&&(this._previousEditorData.contentImage=t,this._store.dispatch(_r(t)),this.setImageInSnippetPreview(t))};wr()(document).on("tinymce-editor-init",(t,s)=>{s.id===this._tinyMceId&&(e(this.getContent()),["input","change","cut","paste"].forEach(t=>s.on(t,(0,n.debounce)(e,1e3))))});const t=document.getElementById("attachment_content");t&&(e(t.value),t.addEventListener("input",t=>e(t.target.value)))}subscribeToSlug(){const e=e=>{this._previousEditorData.slug!==e&&(this._previousEditorData.slug=e,this._store.dispatch(Ir(e)),this._store.dispatch(vr({slug:e})))},t=document.getElementById("slug");t&&t.addEventListener("input",t=>e(t.target.value));const s=document.getElementById("post_name");s&&s.addEventListener("input",t=>e(t.target.value));const i=document.getElementById("edit-slug-buttons");i&&new MutationObserver((t,s)=>t.forEach(t=>{t.addedNodes.forEach(t=>{var i,o;if(null==t||null===(i=t.classList)||void 0===i||!i.contains("edit-slug"))return;const r=null===(o=document.getElementById("editable-post-name-full"))||void 0===o?void 0:o.innerText;r&&(e(r),s.disconnect(),this.subscribeToSlug())})})).observe(i,{childList:!0})}subscribeToSnippetPreviewImage(){if((0,n.isUndefined)(wp.media)||(0,n.isUndefined)(wp.media.featuredImage))return;wr()("#postimagediv").on("click","#remove-post-thumbnail",()=>{this.featuredImageIsSet=!1,this.setImageInSnippetPreview(this.getContentImage(this.getContent()))});const e=wp.media.featuredImage.frame();var t,s,i;e.on("select",()=>{const t=e.state().get("selection").first().attributes.url;t&&(this.featuredImageIsSet=!0,this.setImageInSnippetPreview(t))}),t=this._tinyMceId,s=["init"],i=()=>{const e=this.getContentImage(this.getContent()),t=this.getFeaturedImage()||e||"";this._store.dispatch(_r(e)),this.setImageInSnippetPreview(t)},"undefined"!=typeof tinyMCE&&"function"==typeof tinyMCE.on&&tinyMCE.on("addEditor",function(e){const o=e.editor;o.id===t&&(0,n.forEach)(s,function(e){o.on(e,i)})})}getFeaturedImage(){const e=wr()("#set-post-thumbnail img").attr("src");return e?(this.featuredImageIsSet=!0,e):(this.featuredImageIsSet=!1,null)}setImageInSnippetPreview(e){this._store.dispatch(Sr(e)),this._store.dispatch(vr({snippetPreviewImageURL:e}))}getContentImage(e){if(this.featuredImageIsSet)return"";const t=z.languageProcessing.imageInText(e);if(0===t.length)return"";const s=wr().parseHTML(t.join(""));for(const e of s)if(e.src)return e.src;return""}getTitle(){const e=document.getElementById("title")||document.getElementById("name");return e&&e.value||""}getExcerpt(e=!0){const t=document.getElementById("excerpt"),s=t&&t.value||"",i="ja"===function(){const e=Ks();return(0,n.get)(e,"contentLocale","en_US")}()?80:156;return""!==s||!1===e?s:function(e,t=156){return(e=(e=(0,hs.stripTags)(e)).trim()).length<=t||(e=e.substring(0,t),/\s/.test(e)&&(e=e.substring(0,e.lastIndexOf(" ")))),e}(this.getContent(),i)}getSlug(){let e="";const t=document.getElementById("new-post-slug")||document.getElementById("slug");return t?e=t.value:null!==document.getElementById("editable-post-name-full")&&(e=document.getElementById("editable-post-name-full").textContent),e}getContent(){return xr(fr(this._tinyMceId))}subscribeToElements(){this.subscribeToInputElement("title","title"),this.subscribeToInputElement("excerpt","excerpt"),this.subscribeToInputElement("excerpt","excerpt_only")}subscribeToInputElement(e,t){const s=document.getElementById(e);s&&s.addEventListener("input",e=>{this.updateReplacementData(e,t)})}updateReplacementData(e,t){let s=e.target.value;if("excerpt"===t&&""===s&&(s=this.getExcerpt()),this._previousEditorData[t]!==s){switch(this._previousEditorData[t]=s,t){case"title":this._store.dispatch(jr(s));break;case"excerpt":this._store.dispatch(Rr(s))}this._store.dispatch(br(t,s))}}isShallowEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e.hasOwnProperty(s)&&(!(s in t)||e[s]!==t[s]))return!1;return!0}refreshYoastSEO(){const e=this.getData();!this.isShallowEqual(this._previousData,e)&&(this.handleEditorChange(e),this._previousData=e,window.YoastSEO&&window.YoastSEO.app&&window.YoastSEO.app.refresh())}handleEditorChange(e){this._previousData.excerpt!==e.excerpt&&(this._store.dispatch(br("excerpt",e.excerpt)),this._store.dispatch(br("excerpt_only",e.excerpt_only))),this._previousData.snippetPreviewImageURL!==e.snippetPreviewImageURL&&this.setImageInSnippetPreview(e.snippetPreviewImageURL),this._previousData.slug!==e.slug&&this._store.dispatch(Ir(e.slug)),this._previousData.title!==e.title&&this._store.dispatch(jr(e.title))}subscribeToStore(){this.subscriber=(0,n.debounce)(this.refreshYoastSEO,500),this._store.subscribe(this.subscriber)}getInitialData(e){e=function(e,t){if(!e.custom_taxonomies)return e;const s={};return(0,n.forEach)(e.custom_taxonomies,(e,t)=>{const{name:i,label:o,descriptionName:r,descriptionLabel:n}=function(e){const t=fs(e);return{name:"ct_"+t,label:ms(e+" (custom taxonomy)"),descriptionName:"ct_desc_"+t,descriptionLabel:ms(e+" description (custom taxonomy)")}}(t),a="string"==typeof e.name?(0,de.decodeHTML)(e.name):e.name,l="string"==typeof e.description?(0,de.decodeHTML)(e.description):e.description;s[i]={value:a,label:o},s[r]={value:l,label:n}}),t.dispatch(function(e){return{type:"SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLES_BATCH",updatedVariables:e}}(s)),(0,n.omit)({...e},"custom_taxonomies")}(e=function(e,t){return e.custom_fields?((0,n.forEach)(e.custom_fields,(e,s)=>{const{name:i,label:o}=function(e){return{name:"cf_"+fs(e),label:ms(e+" (custom field)")}}(s);t.dispatch(gs(i,e,o))}),(0,n.omit)({...e},"custom_fields")):e}(e,this._store),this._store);const t=this.getContent(),s=this.getFeaturedImage();return{...e,title:this.getTitle(),excerpt:this.getExcerpt(),excerpt_only:this.getExcerpt(!1),slug:this.getSlug(),content:t,snippetPreviewImageURL:s,contentImage:this.getContentImage(t)}}getData(){return{...this._store.getState().snippetEditor.data,title:this.getTitle(),content:this.getContent(),excerpt:this.getExcerpt(),excerpt_only:this.getExcerpt(!1)}}}})()})(); | |