PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | js/dist/indexation.js +1 -1 18.5 → trunk View file →
@@ -1 +1 @@
1 -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));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=197)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.yoast.propTypes},10: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},e.exports.__esModule=!0,e.exports.default=e.exports},107:function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var r=n(13),o=n.n(r),s=n(12),i=n.n(s),a=n(16),c=n.n(a),u=n(17),l=n.n(u),p=n(11),d=n.n(p),f=n(80);var x=function(e){c()(s,e);var t,n,r=(t=s,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=d()(t);if(n){var o=d()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return l()(this,e)});function s(e,t,n,o,a){var c;return i()(this,s),(c=r.call(this,e)).name="RequestError",c.url=t,c.method=n,c.statusCode=o,c.stackTrace=a,c}return o()(s)}(n.n(f)()(Error))},11:function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},12:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},13: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),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var r=n(13),o=n.n(r),s=n(12),i=n.n(s),a=n(16),c=n.n(a),u=n(17),l=n.n(u),p=n(11),d=n.n(p),f=n(80);var x=function(e){c()(s,e);var t,n,r=(t=s,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=d()(t);if(n){var o=d()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return l()(this,e)});function s(e,t){var n;return i()(this,s),(n=r.call(this,e)).name="ParseError",n.parseString=t,n}return o()(s)}(n.n(f)()(Error))},15:function(e,t){function n(e,t,n,r,o,s,i){try{var a=e[s](i),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,s){var i=e.apply(t,r);function a(e){n(i,o,s,a,c,"next",e)}function c(e){n(i,o,s,a,c,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},151:function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},152:function(e,t,n){var r=n(46),o=n(153);function s(t,n,i){return o()?(e.exports=s=Reflect.construct,e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=s=function(e,t,n){var o=[null];o.push.apply(o,t);var s=new(Function.bind.apply(e,o));return n&&r(s,n.prototype),s},e.exports.__esModule=!0,e.exports.default=e.exports),s.apply(null,arguments)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},153:function(e,t){e.exports=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}},e.exports.__esModule=!0,e.exports.default=e.exports},16:function(e,t,n){var r=n(46);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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},163:function(e,t,n){"use strict";var r,o,s=n(15),i=n.n(s),a=n(12),c=n.n(a),u=n(13),l=n.n(u),p=n(10),d=n.n(p),f=n(16),x=n.n(f),y=n(17),h=n.n(y),g=n(11),m=n.n(g),b=n(0),v=n(9),w=n.n(v),_=n(2),O=n(5),j=n(23),E=n(1),S=n.n(E),k=n(8),I=n.n(k),P=n(107),R=n(7),A=n.n(R),T=A.a.div(r||(r=I()(["\n\tmargin-top: 8px;\n"]))),M=A.a.pre(o||(o=I()(["\n\toverflow-x: scroll;\n\tmax-width: 500px;\n\tborder: 1px solid;\n\tpadding: 16px;\n"])));function B(e){var t=e.title,n=e.value;return n?Object(b.createElement)("p",null,Object(b.createElement)("strong",null,t),Object(b.createElement)("br",null),n):null}function C(e){var t=e.title,n=e.value;return n?Object(b.createElement)("details",null,Object(b.createElement)("summary",null,t),Object(b.createElement)(M,null,n)):null}function q(e){var t=e.message,n=e.error;return Object(b.createElement)(O.Alert,{type:"error"},Object(b.createElement)("div",{dangerouslySetInnerHTML:{__html:t}}),Object(b.createElement)("details",null,Object(b.createElement)("summary",null,Object(_.__)("Error details","wordpress-seo")),Object(b.createElement)(T,null,Object(b.createElement)(B,{title:Object(_.__)("Request URL","wordpress-seo"),value:n.url}),Object(b.createElement)(B,{title:Object(_.__)("Request method","wordpress-seo"),value:n.method}),Object(b.createElement)(B,{title:Object(_.__)("Status code","wordpress-seo"),value:n.statusCode}),Object(b.createElement)(B,{title:Object(_.__)("Error message","wordpress-seo"),value:n.message}),Object(b.createElement)(C,{title:Object(_.__)("Response","wordpress-seo"),value:n.parseString}),Object(b.createElement)(C,{title:Object(_.__)("Error stack trace","wordpress-seo"),value:n.stackTrace}))))}B.propTypes={title:S.a.string.isRequired,value:S.a.any},B.defaultProps={value:""},C.propTypes={title:S.a.string.isRequired,value:S.a.string},C.defaultProps={value:""},q.propTypes={message:S.a.string.isRequired,error:S.a.oneOfType([S.a.instanceOf(Error),S.a.instanceOf(P.a)]).isRequired};var D=n(134);var N=function(e){x()(y,e);var t,n,r,o,s,a,u,p,f=(u=y,p=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=m()(u);if(p){var n=m()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return h()(this,e)});function y(e){var t;return c()(this,y),(t=f.call(this,e)).settings=yoastIndexingData,t.state={state:"idle",processed:0,error:null,amount:parseInt(t.settings.amount,10),firstTime:"1"===t.settings.firstTime},t.startIndexing=t.startIndexing.bind(d()(t)),t.stopIndexing=t.stopIndexing.bind(d()(t)),t}return l()(y,[{key:"doIndexingRequest",value:(a=i()(w.a.mark((function e(t,n){var r,o,s,i;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{method:"POST",headers:{"X-WP-Nonce":n}});case 2:return r=e.sent,e.next=5,r.text();case 5:o=e.sent,e.prev=6,s=JSON.parse(o),e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(6),new D.a("Error parsing the response to JSON.",o);case 13:if(r.ok){e.next=16;break}throw i=s.data?s.data.stackTrace:"",new P.a(s.message,t,"POST",r.status,i);case 16:return e.abrupt("return",s);case 17:case"end":return e.stop()}}),e,null,[[6,10]])}))),function(_x,e){return a.apply(this,arguments)})},{key:"doPreIndexingAction",value:(s=i()(w.a.mark((function e(t){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof this.props.preIndexingActions[t]){e.next=3;break}return e.next=3,this.props.preIndexingActions[t](this.settings);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"doPostIndexingAction",value:(o=i()(w.a.mark((function e(t,n){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof this.props.indexingActions[t]){e.next=3;break}return e.next=3,this.props.indexingActions[t](n.objects,this.settings);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"doIndexing",value:(r=i()(w.a.mark((function e(t){var n,r=this;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this.settings.restApi.root+this.settings.restApi.indexing_endpoints[t];case 1:if(!this.isState("in_progress")||!1===n){e.next=11;break}return e.prev=2,e.delegateYield(w.a.mark((function e(){var o;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.doPreIndexingAction(t);case 2:return e.next=4,r.doIndexingRequest(n,r.settings.restApi.nonce);case 4:return o=e.sent,e.next=7,r.doPostIndexingAction(t,o);case 7:r.setState((function(e){return{processed:e.processed+o.objects.length,firstTime:!1}})),n=o.next_url;case 9:case"end":return e.stop()}}),e)}))(),"t0",4);case 4:e.next=9;break;case 6:e.prev=6,e.t1=e.catch(2),this.setState({state:"errored",error:e.t1,firstTime:!1});case 9:e.next=1;break;case 11:case"end":return e.stop()}}),e,this,[[2,6]])}))),function(e){return r.apply(this,arguments)})},{key:"index",value:(n=i()(w.a.mark((function e(){var t,n,r;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0,n=Object.keys(this.settings.restApi.indexing_endpoints);case 1:if(!(t<n.length)){e.next=8;break}return r=n[t],e.next=5,this.doIndexing(r);case 5:t++,e.next=1;break;case 8:this.isState("errored")||this.isState("idle")||this.completeIndexing();case 9:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"startIndexing",value:(t=i()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({processed:0,state:"in_progress"},this.index);case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"completeIndexing",value:function(){this.setState({state:"completed"})}},{key:"stopIndexing",value:function(){this.setState((function(e){return{state:"idle",processed:0,amount:e.amount-e.processed}}))}},{key:"componentDidMount",value:function(){var e,t;if(!this.settings.disabled&&(this.props.indexingStateCallback(0===this.state.amount?"completed":this.state.state),"true"===new URLSearchParams(window.location.search).get("start-indexation"))){var n=function(e,t){var n=new URL(e);return n.searchParams.delete("start-indexation"),n.href}(window.location.href);null,e=document.title,t=n,window.history.pushState(null,e,t),this.startIndexing()}}},{key:"componentDidUpdate",value:function(e,t){this.state.state!==t.state&&this.props.indexingStateCallback(this.state.state)}},{key:"isState",value:function(e){return this.state.state===e}},{key:"renderFirstIndexationNotice",value:function(){return Object(b.createElement)(O.Alert,{type:"info"},Object(_.__)("This feature includes and replaces the Text Link Counter and Internal Linking Analysis","wordpress-seo"))}},{key:"renderStartButton",value:function(){return Object(b.createElement)(O.NewButton,{variant:"primary",onClick:this.startIndexing},Object(_.__)("Start SEO data optimization","wordpress-seo"))}},{key:"renderStopButton",value:function(){return Object(b.createElement)(O.NewButton,{variant:"secondary",onClick:this.stopIndexing},Object(_.__)("Stop SEO data optimization","wordpress-seo"))}},{key:"renderDisabledTool",value:function(){return Object(b.createElement)(b.Fragment,null,Object(b.createElement)("p",null,Object(b.createElement)(O.NewButton,{variant:"secondary",disabled:!0},Object(_.__)("Start SEO data optimization","wordpress-seo"))),Object(b.createElement)(O.Alert,{type:"info"},Object(_.__)("SEO data optimization is disabled for non-production environments.","wordpress-seo")))}},{key:"renderProgressBar",value:function(){return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(O.ProgressBar,{style:{height:"16px",margin:"8px 0"},progressColor:j.colors.$color_pink_dark,max:parseInt(this.state.amount,10),value:this.state.processed}),Object(b.createElement)("p",{style:{color:j.colors.$palette_grey_text}},Object(_.__)("Optimizing SEO data... This may take a while.","wordpress-seo")))}},{key:"renderErrorAlert",value:function(){return Object(b.createElement)(q,{message:yoastIndexingData.errorMessage,error:this.state.error})}},{key:"renderTool",value:function(){return Object(b.createElement)(b.Fragment,null,this.isState("in_progress")&&this.renderProgressBar(),this.isState("errored")&&this.renderErrorAlert(),this.isState("idle")&&this.state.firstTime&&this.renderFirstIndexationNotice(),this.isState("in_progress")?this.renderStopButton():this.renderStartButton())}},{key:"render",value:function(){return this.settings.disabled?this.renderDisabledTool():this.isState("completed")||0===this.state.amount?Object(b.createElement)(O.Alert,{type:"success"},Object(_.__)("SEO data optimization complete","wordpress-seo")):this.renderTool()}}]),y}(b.Component);N.propTypes={indexingActions:S.a.object,preIndexingActions:S.a.object,indexingStateCallback:S.a.func},N.defaultProps={indexingActions:{},preIndexingActions:{},indexingStateCallback:function(){}},t.a=N},17:function(e,t,n){var r=n(34).default,o=n(10);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},197:function(e,t,n){"use strict";n.r(t);var r,o=n(0),s=n(22),i=n.n(s),a=n(163),c={},u={};function l(){r||(r=document.getElementById("yoast-seo-indexing-action")),r&&Object(o.render)(Object(o.createElement)(a.a,{preIndexingActions:c,indexingActions:u}),r)}window.yoast=window.yoast||{},window.yoast.indexing=window.yoast.indexing||{},window.yoast.indexing.registerPreIndexingAction=function(e,t){c[e]=t,l()},window.yoast.indexing.registerIndexingAction=function(e,t){u[e]=t,l()},window.yoast.indexation=window.yoast.indexing,window.yoast.indexation.registerPreIndexationAction=function(e,t){console.warn("Deprecated since 15.1. Use 'window.yoast.indexing.registerPreIndexingAction' instead."),window.yoast.indexing.registerPreIndexingAction(e,t)},window.yoast.indexation.registerIndexationAction=function(e,t){console.warn("Deprecated since 15.1. Use 'window.yoast.indexing.registerIndexingAction' instead."),window.yoast.indexing.registerIndexingAction(e,t)},i()((function(){l()}))},2:function(e,t){e.exports=window.wp.i18n},22:function(e,t){e.exports=window.jQuery},23:function(e,t){e.exports=window.yoast.styleGuide},34:function(e,t){function n(t){return e.exports=n="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},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},46:function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},5:function(e,t){e.exports=window.yoast.componentsNew},7:function(e,t){e.exports=window.yoast.styledComponents},8:function(e,t){e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))},e.exports.__esModule=!0,e.exports.default=e.exports},80:function(e,t,n){var r=n(11),o=n(46),s=n(151),i=n(152);function a(t){var n="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!s(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return i(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,a(t)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},9:function(e,t){e.exports=window.regeneratorRuntime}});
1 +(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,s=window.jQuery;var n=e.n(s);const i=window.wp.i18n,r=window.yoast.componentsNew,o=window.yoast.styleGuide,a=window.yoast.propTypes;var d=e.n(a);class c extends Error{constructor(e,t,s,n,i,r={}){var o,a;super(e),this.name="RequestError",this.url=t,this.method=s,this.statusCode=n,this.stackTrace=i,this.objectId=null!==(o=r.objectId)&&void 0!==o?o:null,this.objectType=null!==(a=r.objectType)&&void 0!==a?a:null}}class p extends Error{constructor(e,t){super(e),this.name="ParseError",this.parseString=t}}const l="idle",h="in_progress",u="errored",g="completed";class x extends t.Component{constructor(e){super(e),this.settings=yoastIndexingData,this.state={state:l,processed:0,error:null,amount:parseInt(this.settings.amount,10),firstTime:"1"===this.settings.firstTime},this.startIndexing=this.startIndexing.bind(this),this.stopIndexing=this.stopIndexing.bind(this)}getAlreadyIndexedStateName(){return"completed"}async doIndexingRequest(e,t){const s=await fetch(e,{method:"POST",headers:{"X-WP-Nonce":t}}),n=await s.text();let i;try{i=JSON.parse(n)}catch(e){throw new p("Error parsing the response to JSON.",n)}if(!s.ok){const t=i.data||{};throw new c(i.message,e,"POST",s.status,t.stackTrace,{objectId:t.object_id,objectType:t.object_type})}return i}async doPreIndexingAction(e){"function"==typeof this.props.preIndexingActions[e]&&await this.props.preIndexingActions[e](this.settings)}async doPostIndexingAction(e,t){"function"==typeof this.props.indexingActions[e]&&await this.props.indexingActions[e](t.objects,this.settings)}detectIndexingLoop(e,t,s,n){if(s.next_url!==t||0===s.objects.length)return null;const i=JSON.stringify(s.objects.map(e=>[e.id,e.object_type,e.object_sub_type,e.object_id]));if(i===n)throw new Error(`Optimization of the '${e}' data is not making progress: the same batch was returned twice. Stopped to prevent an endless loop. This can happen when a plugin conflict or a failing script prevents the returned objects from being processed.`);return i}async doIndexing(e){let s=this.settings.restApi.root+this.settings.restApi.indexing_endpoints[e],n=null;for(;this.isState(h)&&!1!==s;)try{await this.doPreIndexingAction(e);const i=await this.doIndexingRequest(s,this.settings.restApi.nonce);await this.doPostIndexingAction(e,i),n=this.detectIndexingLoop(e,s,i,n),(0,t.flushSync)(()=>{this.setState(e=>({processed:e.processed+i.objects.length,firstTime:!1}))}),s=i.next_url}catch(e){(0,t.flushSync)(()=>{this.setState({state:u,error:e,firstTime:!1})})}}async index(){for(const e of Object.keys(this.settings.restApi.indexing_endpoints))await this.doIndexing(e);this.isState(u)||this.isState(l)||this.completeIndexing()}async startIndexing(){this.setState({processed:0,state:h},this.index)}completeIndexing(){this.setState({state:g})}stopIndexing(){this.setState(e=>({state:l,processed:0,amount:e.amount-e.processed}))}componentDidMount(){var e,t;if(!this.settings.disabled&&(this.props.indexingStateCallback(0===this.state.amount?this.getAlreadyIndexedStateName():this.state.state),"true"===new URLSearchParams(window.location.search).get("start-indexation"))){const s=function(e){const t=new URL(e);return t.searchParams.delete("start-indexation"),t.href}(window.location.href);e=document.title,t=s,window.history.pushState(null,e,t),this.startIndexing()}}componentDidUpdate(e,t){this.state.state!==t.state&&this.props.indexingStateCallback(this.state.state)}isState(e){return this.state.state===e}}const w={indexingActions:d().object,preIndexingActions:d().object,indexingStateCallback:d().func},y={indexingActions:{},preIndexingActions:{},indexingStateCallback:()=>{}};x.propTypes=w,x.defaultProps=y;const m=x,j=window.yoast.helpers,f=window.ReactJSXRuntime,{stripTagsFromHtmlString:S}=j.strings,_=["a","p"];function I({title:e,value:t=""}){return t?(0,f.jsxs)("p",{children:[(0,f.jsx)("strong",{children:e}),(0,f.jsx)("br",{}),t]}):null}function b({title:e,value:t=""}){return t?(0,f.jsxs)("details",{children:[(0,f.jsx)("summary",{children:e}),(0,f.jsx)("pre",{style:{overflowX:"scroll",maxWidth:"500px",border:"1px solid",padding:"16px"},children:t})]}):null}function T({message:e,error:t}){let s="";return t.objectType&&(s=t.objectId?`${t.objectType} #${t.objectId}`:t.objectType),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{dangerouslySetInnerHTML:{__html:S(e,_)}}),(0,f.jsxs)("details",{children:[(0,f.jsx)("summary",{children:(0,i.__)("Error details","wordpress-seo")}),(0,f.jsxs)("div",{style:{marginTop:"8px"},children:[(0,f.jsx)(I,{title:(0,i.__)("Failing object","wordpress-seo"),value:s}),(0,f.jsx)(I,{title:(0,i.__)("Request URL","wordpress-seo"),value:t.url}),(0,f.jsx)(I,{title:(0,i.__)("Request method","wordpress-seo"),value:t.method}),(0,f.jsx)(I,{title:(0,i.__)("Status code","wordpress-seo"),value:t.statusCode}),(0,f.jsx)(I,{title:(0,i.__)("Error message","wordpress-seo"),value:t.message}),(0,f.jsx)(b,{title:(0,i.__)("Response","wordpress-seo"),value:t.parseString}),(0,f.jsx)(b,{title:(0,i.__)("Error stack trace","wordpress-seo"),value:t.stackTrace})]})]})]})}function A({message:e,error:t}){return(0,f.jsx)(r.Alert,{type:"error",children:(0,f.jsx)(T,{message:e,error:t})})}I.propTypes={title:d().string.isRequired,value:d().any},b.propTypes={title:d().string.isRequired,value:d().string},T.propTypes={message:d().string.isRequired,error:d().oneOfType([d().instanceOf(Error),d().instanceOf(c)]).isRequired},A.propTypes={message:d().string.isRequired,error:d().oneOfType([d().instanceOf(Error),d().instanceOf(c)]).isRequired};class v extends m{renderFirstIndexationNotice(){return(0,f.jsx)(r.Alert,{type:"info",children:(0,i.__)("This feature includes and replaces the Text Link Counter and Internal Linking Analysis","wordpress-seo")})}renderStartButton(){return(0,f.jsx)(r.NewButton,{variant:"primary",onClick:this.startIndexing,children:(0,i.__)("Start SEO data optimization","wordpress-seo")})}renderStopButton(){return(0,f.jsx)(r.NewButton,{variant:"secondary",onClick:this.stopIndexing,children:(0,i.__)("Stop SEO data optimization","wordpress-seo")})}renderDisabledTool(){return(0,f.jsxs)(t.Fragment,{children:[(0,f.jsx)("p",{children:(0,f.jsx)(r.NewButton,{variant:"secondary",disabled:!0,children:(0,i.__)("Start SEO data optimization","wordpress-seo")})}),(0,f.jsx)(r.Alert,{type:"info",children:(0,i.__)("SEO data optimization is disabled for non-production environments.","wordpress-seo")})]})}renderProgressBar(){return(0,f.jsxs)(t.Fragment,{children:[(0,f.jsx)(r.ProgressBar,{style:{height:"16px",margin:"8px 0"},progressColor:o.colors.$color_pink_dark,max:parseInt(this.state.amount,10),value:this.state.processed}),(0,f.jsx)("p",{style:{color:o.colors.$palette_grey_text},children:(0,i.__)("Optimizing SEO data… This may take a while.","wordpress-seo")})]})}renderErrorAlert(){return(0,f.jsx)(A,{message:yoastIndexingData.errorMessage,error:this.state.error})}renderTool(){return(0,f.jsxs)(t.Fragment,{children:[this.isState(h)&&this.renderProgressBar(),this.isState(u)&&this.renderErrorAlert(),this.isState(l)&&this.state.firstTime&&this.renderFirstIndexationNotice(),this.isState(h)?this.renderStopButton():this.renderStartButton()]})}render(){return this.settings.disabled?this.renderDisabledTool():this.isState(g)||0===this.state.amount?(0,f.jsx)(r.Alert,{type:"success",children:(0,i.__)("SEO data optimization complete","wordpress-seo")}):this.renderTool()}}v.propTypes=w,v.defaultProps=y;const O=v;let E;function P(){var e;null===(e=E)||void 0===e||e.render((0,f.jsx)(O,{preIndexingActions:window.yoast.indexing.preIndexingActions,indexingActions:window.yoast.indexing.indexingActions}))}window.yoast=window.yoast||{},window.yoast.indexing=window.yoast.indexing||{},window.yoast.indexing.preIndexingActions={},window.yoast.indexing.indexingActions={},window.yoast.indexing.helpers={doAjaxRequest:function(e,t,s,n){return new Promise((i,r)=>{jQuery.ajax({type:e,url:t,beforeSend:s?e=>{e.setRequestHeader("X-WP-Nonce",s)}:null,data:n,dataType:"json",success:i,error:r})})}},window.yoast.indexing.registerPreIndexingAction=(e,t)=>{window.yoast.indexing.preIndexingActions[e]=t,P()},window.yoast.indexing.registerIndexingAction=(e,t)=>{window.yoast.indexing.indexingActions[e]=t,P()},n()(function(){const e=document.getElementById("yoast-seo-indexing-action");e&&(E=(0,t.createRoot)(e)),P()})})();