chunk-8ec9c532.js
6.02 KB
(window["aioseopjsonp"]=window["aioseopjsonp"]||[]).push([["chunk-8ec9c532"],{"039e":function(t,n,s){"use strict";var e=s("5530"),i=(s("d81d"),s("a9e3"),s("caad"),s("2532"),s("d3b7"),s("2f62"));n["a"]={computed:Object(e["a"])(Object(e["a"])({},Object(i["e"])(["linkAssistant"])),{},{isPrioritizedPost:function(){var t=this.linkAssistant.linksReport.prioritizedPosts;return Array.isArray(t)&&(t=t.map(Number)),t.includes(parseInt(this.post.ID))}}),methods:Object(e["a"])(Object(e["a"])({},Object(i["b"])("linkAssistant",["linksRefresh"])),{},{doRefresh:function(){var t=this;this.refreshLoading=!0,this.$bus.$emit("updatingLinks",!0),this.linksRefresh({postIndex:this.postIndex,postId:this.post.ID,linksReport:!0}).finally((function(){t.refreshLoading=!1,t.$bus.$emit("updatingLinks",!1)}))}})}},"1b6a":function(t,n,s){"use strict";s("159b"),s("498a"),s("4d63"),s("ac1f"),s("25f0"),s("841c");var e=s("ab86"),i=s("5f74");n["a"]={methods:{filteredSuggestionsOutbound:function(t){var n=this,s=t.links.suggestionsOutbound.rows,e=[];return s.forEach((function(t){n.editorIsSuggestionAlreadyAdded(t)||e.push(t)})),e},editorIsSuggestionAlreadyAdded:function(t){return Object(i["a"])()?this.blockEditorIsSuggestionAlreadyAdded(t):!!Object(i["b"])()&&this.classicEditorIsSuggestionAlreadyAdded(t)},blockEditorIsSuggestionAlreadyAdded:function(t){var n=window.wp.data.select("core/block-editor").getBlocks();return!!n&&this.doesBlockHaveLink(n,t)},doesBlockHaveLink:function(t,n){var s=this,i=!1;return t.forEach((function(t){!i&&t.attributes&&n.suggestions.forEach((function(o){var a=Object(e["a"])(o.context.permalink.trim()),r=new RegExp('(<a href="'.concat(a,'"[^<>]*>)(.*)(</a[^<>]*>)'),"i");if(t.attributes.content&&-1!==t.attributes.content.search(r))i=!0;else if(t.innerBlocks){var u=s.doesBlockHaveLink(t.innerBlocks,n);u&&(i=!0)}}))})),i},classicEditorIsSuggestionAlreadyAdded:function(t){var n="",s=null,i=null;if(document.querySelector("#wp-content-wrap.tmce-active")?(s=window.tinyMCE.get("content"),n=s.getContent({format:"raw"})):(i=document.querySelector("textarea#content"),n=i?i.value:""),!n)return!1;var o=!1;return t.suggestions.forEach((function(t){var s=Object(e["a"])(t.context.permalink.trim()),i=new RegExp('(<a href="'.concat(s,'"[^<>]*>)(.*)(</a[^<>]*>)'),"i");-1!==n.search(i)&&(o=!0)})),o}}}},"95e5":function(t,n,s){"use strict";s("9c5a")},"9c5a":function(t,n,s){},e811:function(t,n,s){"use strict";s.r(n);var e=function(){var t=this,n=t.$createElement,s=t._self._c||n;return s("div",{staticClass:"links-report-inner"},[s("core-main-tabs",{key:t.tabsKey,staticClass:"link-tabs",attrs:{internal:"",tabs:t.tabs,active:t.activeTab},on:{changed:function(n){return t.processChangeTab(n)}},scopedSlots:t._u([{key:"button",fn:function(){return[s("base-button",{staticClass:"button-refresh",attrs:{type:"gray",size:"medium",icon:"svg-refresh",loading:t.refreshLoading,disabled:t.isPrioritizedPost},on:{click:t.doRefresh}},[t._v(" "+t._s(t.strings.refresh)+" ")])]},proxy:!0}])}),"outbound-internal"===t.activeTab?s("link-assistant-outbound-internal",{attrs:{post:t.post,postIndex:t.postIndex,postId:t.postId,linksReport:""},on:{openSuggestions:function(n){return t.processChangeTab("link-suggestions","suggestions-outbound")},linksUpdated:function(n){t.tabsKey++}}}):t._e(),"inbound-internal"===t.activeTab?s("link-assistant-inbound-internal",{attrs:{post:t.post,postIndex:t.postIndex,postId:t.postId,linksReport:""},on:{openSuggestions:function(n){return t.processChangeTab("link-suggestions","suggestions-inbound")},linksUpdated:function(n){t.tabsKey++}}}):t._e(),"affiliate"===t.activeTab?s("link-assistant-affiliate",{attrs:{post:t.post,postIndex:t.postIndex,postId:t.postId,linksReport:""},on:{linksUpdated:function(n){t.tabsKey++}}}):t._e(),"external"===t.activeTab?s("link-assistant-external",{attrs:{post:t.post,postIndex:t.postIndex,postId:t.postId,linksReport:""},on:{linksUpdated:function(n){t.tabsKey++}}}):t._e(),"link-suggestions"===t.activeTab?s("link-assistant-suggestions",{attrs:{post:t.post,postIndex:t.postIndex,postId:t.postId,filteredSuggestionsOutbound:t.filteredSuggestionsOutbound(t.post),initialTab:t.activeSuggestionTab,linksReport:""},on:{showStandalone:function(n){t.showStandalone=!0},suggestionsTabChanged:function(n){return t.activeSuggestionTab=n},linksUpdated:function(n){t.tabsKey++}}}):t._e()],1)},i=[],o=s("5530"),a=(s("a9e3"),s("1b6a")),r=s("039e"),u=s("2f62"),d={mixins:[a["a"],r["a"]],props:{post:{type:Object,required:!0},postIndex:{type:Number,required:!0},postId:{type:Number,required:!0},initialActiveTab:String},data:function(){return{tabsKey:0,activeTab:"inbound-internal",activeSuggestionTab:"suggestions-inbound",refreshLoading:!1,strings:{refresh:this.$t.__("Refresh",this.$t.tdPro)}}},computed:Object(o["a"])(Object(o["a"])({},Object(u["c"])("linkAssistant",["getLinksReportCounts"])),{},{tabs:function(){return[{slug:"inbound-internal",icon:"svg-link-internal-inbound",name:this.$t.sprintf("%1$s %2$s",this.getLinksReportCounts[this.postIndex].inboundInternal,this.$t.__("Inbound Internal",this.$tdPro))},{slug:"outbound-internal",icon:"svg-link-internal-outbound",name:this.$t.sprintf("%1$s %2$s",this.getLinksReportCounts[this.postIndex].outboundInternal,this.$t.__("Outbound Internal",this.$tdPro))},{slug:"affiliate",icon:"svg-link-affiliate",name:this.$t.sprintf("%1$s %2$s",this.getLinksReportCounts[this.postIndex].affiliate,this.$t.__("Affiliate",this.$tdPro))},{slug:"external",icon:"svg-link-external",name:this.$t.sprintf("%1$s %2$s",this.getLinksReportCounts[this.postIndex].external,this.$t.__("External",this.$tdPro))},{slug:"link-suggestions",icon:"svg-link-suggestion",name:this.$t.sprintf("%1$s %2$s",this.getLinksReportCounts[this.postIndex].suggestionsOutbound+this.getLinksReportCounts[this.postIndex].suggestionsInbound,this.$t.__("Link Suggestions",this.$tdPro))}]}}),methods:{processChangeTab:function(t,n){this.activeTab=t,n&&(this.activeSuggestionTab=n)}},mounted:function(){var t=this;this.initialActiveTab&&this.$nextTick((function(){t.processChangeTab(t.initialActiveTab)}))}},c=d,l=(s("95e5"),s("2877")),p=Object(l["a"])(c,e,i,!1,null,null,null);n["default"]=p.exports}}]);