import{f as i,i as m,j as c,an as _,Q as u,M as r,R as a,a0 as d,ae as p,U as o,T as g,B as st,P as B,ap as M,h as z}from"./js/vendor-vue-ui.c21c50b5.js";import{l as it}from"./js/index.e1395627.js";import{l as ot}from"./js/index.695373d0.js";import{l as nt}from"./js/index.0d80c2c2.js";import{N as U,aR as lt,a6 as E,c as x,y as I,C as rt,aw as O,p as at,b as H,z as Z,v as ct,ak as dt,l as j}from"./js/app-core.52885c02.js";import{u as q}from"./js/TruSeoScore.b22aaf37.js";import{C as G,_ as F}from"./js/Button.7e4e5aaa.js";import{C as Q}from"./js/HtmlTagsEditor.c204f20d.js";import{_ as pt}from"./js/ScoreButton.14ec8613.js";import{C as X}from"./js/Tooltip.9761aafe.js";import{_ as ut}from"./js/IndexStatus.a64eb689.js";import{S as mt}from"./js/LogoGear.89d887a9.js";import{_ as D}from"./js/_plugin-vue_export-helper.eefbdd86.js";import{b as J}from"./js/Pencil.886eeda5.js";import{m as K}from"./js/vendor-lodash.b9aaf385.js";import{_ as y}from"./js/vendor-other.ec82d685.js";/* empty css */import"./js/Input.d5d0cc38.js";import"./js/Index.df48fa2a.js";import"./js/Close.4a8424fd.js";import"./js/Trash.e939fb36.js";import"./js/Select.f9b41564.js";import"./js/Caret.911868b5.js";import"./js/Toggle.9189cb4d.js";import"./js/Editor.20c7229e.js";import"./js/vendor-quill.bb92695d.js";import"./js/UnfilteredHtml.b8ac16ed.js";import"./js/vendor-emoji.92c96208.js";import"./js/CheckSolid.08d5a264.js";const gt={},ht={viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-headline-analyzer"};function _t(e,s){return i(),m("svg",ht,[...s[0]||(s[0]=[c("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.5448 1.76771H14.6665V1.79272L10.5448 4.61008V1.76771ZM5.46515 8.08232V1.76779H1.34351V4.8899L1.34378 4.71192L5.42731 8.10819L5.46515 8.08232ZM1.34351 11.4568L5.46515 14.2652V15.0999H1.34351V11.4568ZM10.5448 10.8851L14.6665 8.14027V15.0982H10.5448V10.8851Z",fill:"currentColor"},null,-1),c("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.46515 8.05739L5.42731 8.08325L1.34378 4.68698L1.34351 4.86412V1.76779H5.46515V8.05739ZM5.46515 14.2083L1.34351 11.3998V15.0999H5.46515V14.2083ZM10.5448 10.8281L14.6665 8.08332V15.0982H10.5448V10.8281ZM14.6665 1.76778L10.5448 4.58515V1.76771H14.6665V1.76778Z",fill:"currentColor"},null,-1),c("path",{d:"M5.42725 9.45857L14.6665 3.14303V6.76487L5.46703 12.8912L1.33325 10.0745L1.34372 6.06231L5.42725 9.45857Z",fill:"currentColor"},null,-1)])])}const ft=D(gt,[["render",_t]]),k="all-in-one-seo-pack",wt={setup(){const{runAnalysis:e,strings:s}=q();return{aiStore:ct(),composableStrings:s,optionsStore:Z(),rootStore:H(),runAnalysis:e,searchStatisticsStore:at(),getTagText:O.getTagText}},components:{BaseButton:F,CoreHtmlTagsEditor:Q,CoreLoader:G,CoreScoreButton:pt,CoreTooltip:X,IndexStatus:ut,SvgAioseoLogoGear:mt,SvgHeadlineAnalyzer:ft,SvgPencil:J},props:{post:Object},data(){return{allowed:I,postId:null,columnName:null,title:null,titleParsed:null,postDescription:null,descriptionParsed:null,imageTitle:null,imageAltTag:null,showEditTitle:!1,showEditDescription:!1,showEditImageTitle:!1,showEditImageAltTag:!1,showTruSeo:!1,isSpecialPage:!1,inspectionResult:{},inspectionResultLoading:!0,postLoading:!1,generatingAlt:!1,strings:K(this.composableStrings,{title:y("Title",k),description:y("Description",k),imageTitle:y("Image Title",k),imageAltTag:y("Image Alt Tag",k),saveChanges:y("Save Changes",k),discardChanges:y("Discard Changes",k),truSeoScore:y("TruSEO Score",k),headlineScore:y("Headline Score",k)})}},computed:{showIndexStatus(){if(!this.rootStore.isPro||!rt.hasCoreFeature("search-statistics","index-status"))return!1;const e=!this.searchStatisticsStore.unverifiedSite,s=!!this.searchStatisticsStore.isConnected,l=this.allowed("aioseo_search_statistics_settings");return e&&s&&l},showHeadlineAnalyzer(){return this.rootStore.aioseo.data.isClassicEditorActive||this.post.postType==="product"||this.post.postType==="web-story"?!1:this.optionsStore.options.advanced.headlineAnalyzer}},methods:{save(){I("aioseo_page_general_settings")&&(this.showEditTitle=!1,this.showEditDescription=!1,this.post.title=this.title,this.post.description=this.postDescription,this.postLoading=!0,E.post(x.restUrl("posts-list/update-details-column")).send({postId:this.post.id,title:this.post.title,description:this.post.description}).then(e=>{this.titleParsed=e.body.title,this.descriptionParsed=e.body.description,this.post.titleParsed=e.body.title,this.post.descriptionParsed=e.body.description,this.$root.$data.screen.base!=="upload"&&this.runAnalysis(this.post.id)}).catch(e=>{console.error(`Unable to update post with ID ${this.post.id}: ${e}`)}).finally(()=>{this.postLoading=!1}))},saveColumn(){I("aioseo_page_general_settings")&&(this.showEditImageTitle=!1,this.showEditImageAltTag=!1,this.post.title=this.title,this.post.description=this.postDescription,this.post.imageTitle=this.imageTitle,this.post.imageAltTag=this.imageAltTag,E.post(x.restUrl("posts-list/update-details-column")).send({postId:this.post.id,isMedia:!0,title:this.post.title,description:this.post.description,imageTitle:this.post.imageTitle,imageAltTag:this.post.imageAltTag}).then(()=>{this.updatePostTitle(this.post.id,this.post.imageTitle)}).catch(e=>{console.error(`Unable to update attachment with ID ${this.post.id}: ${e}`)}))},cancel(){this.showEditTitle=!1,this.showEditDescription=!1,this.showEditImageTitle=!1,this.showEditImageAltTag=!1},editTitle(){this.showEditTitle=!0},editDescription(){this.showEditDescription=!0},editImageTitle(){this.showEditImageTitle=!0},editImageAlt(){this.showEditImageAltTag=!0},truncate:U,updatePostTitle(e,s){const l=document.getElementById(`post-${e}`);if(!l)return;const h=l.getElementsByClassName("title")[0].getElementsByTagName("a")[0];if(!h)return;const t=h.getElementsByTagName("span")[0];h.innerText=s,h.prepend(t)},getRowActionLink(){const e=document.getElementById(`post-${this.postId}`);return e?e.querySelector(".aioseo_generate_alt a"):null},setRowActionGenerating(e){const s=this.getRowActionLink();s&&(e?(s.dataset.originalText=s.textContent,s.textContent=s.dataset.originalText+"…",s.style.cursor="wait",s.style.opacity="0.5"):(s.textContent=s.dataset.originalText||s.textContent,s.style.cursor="",s.style.opacity=""))},async generateAltInline(){if(!(this.generatingAlt||this.showEditImageAltTag)){this.generatingAlt=!0,this.setRowActionGenerating(!0);try{const s=(await this.aiStore.generateImageAlt({attachmentId:this.postId})).body.altTexts[0],l=()=>E.post(x.restUrl("posts-list/update-details-column")).send({postId:this.postId,isMedia:!0,imageAltTag:s,imageTitle:this.imageTitle||""});await l().catch(()=>l()),this.imageAltTag=s,this.post.imageAltTag=s}catch(e){console.error("Failed to generate alt text:",e)}finally{this.generatingAlt=!1,this.setRowActionGenerating(!1)}}},updateInspectionResult(e){const{inspectionResult:s,inspectionResultLoading:l}=e;this.inspectionResult=s,this.inspectionResultLoading=l},async refreshInspectionResult(){this.inspectionResultLoading=!0;try{const e=await this.searchStatisticsStore.getInspectionResult({paths:this.post.page,force:!0});this.inspectionResult=e?.[this.post.page]}catch(e){console.error(e)}finally{this.inspectionResultLoading=!1}}},mounted(){this.postId=this.post.id,this.columnName=this.post.columnName,this.imageTitle=this.post.imageTitle,this.imageAltTag=this.post.imageAltTag,this.isSpecialPage=this.post.isSpecialPage,this.title=this.post.title||this.post.defaultTitle,this.titleParsed=this.post.titleParsed,this.postDescription=this.post.description||this.post.defaultDescription,this.descriptionParsed=this.post.descriptionParsed,this.inspectionResult=this.post.inspectionResult,this.inspectionResultLoading=this.post.inspectionResultLoading,this.post.reload&&this.save(),window.aioseoBus.$on("updateInspectionResult"+this.postId,this.updateInspectionResult),window.aioseoBus.$on("generateAltInline"+this.postId,this.generateAltInline)},beforeUnmount(){window.aioseoBus.$off("updateInspectionResult"+this.postId,this.updateInspectionResult),window.aioseoBus.$off("generateAltInline"+this.postId,this.generateAltInline)},created(){this.showTruSeo=lt()}},Tt={key:0,class:"edit-row scores"},yt={class:"edit-row edit-title"},vt={key:2},Ct={key:1,class:"edit-row"},kt={class:"edit-row edit-description"},It=["id"],bt={key:2,class:"edit-row"},St={class:"edit-row edit-image-title"},At=["id"],Et={key:3,class:"edit-row"},xt={class:"edit-row edit-image-alt"},Dt=["id"],Pt={key:4,class:"edit-row"};function Lt(e,s,l,h,t,n){const f=_("index-status"),w=_("svg-headline-analyzer"),T=_("core-score-button"),v=_("core-tooltip"),A=_("svg-aioseo-logo-gear"),b=_("core-loader"),P=_("svg-pencil"),L=_("core-html-tags-editor"),C=_("base-button");return i(),m("div",{class:B(["aioseo-details-column",{editing:t.showEditTitle||t.showEditDescription||t.showEditImageTitle||t.showEditImageAltTag}])},[c("div",null,[e.$root.$data.screen.base==="edit"&&!t.isSpecialPage?(i(),m("div",Tt,[n.showIndexStatus?(i(),u(f,{key:0,result:t.inspectionResult,loading:t.inspectionResultLoading,viewable:l.post.isPostVisible,"tooltip-offset":"-150px,0",refreshable:"",onRefresh:n.refreshInspectionResult},null,8,["result","loading","viewable","onRefresh"])):r("",!0),n.showHeadlineAnalyzer?(i(),u(v,{key:1,type:"action"},{tooltip:a(()=>[p(o(t.strings.headlineScore),1)]),default:a(()=>[d(T,{score:l.post.headlineScore,postId:t.postId},{icon:a(()=>[d(w)]),_:1},8,["score","postId"])]),_:1})):r("",!0),t.showTruSeo&&t.allowed("aioseo_page_analysis")?(i(),u(v,{key:2,type:"action"},{tooltip:a(()=>[p(o(t.strings.truSeoScore),1)]),default:a(()=>[d(T,{score:l.post.value,postId:t.postId},{icon:a(()=>[d(A)]),_:1},8,["score","postId"])]),_:1})):r("",!0)])):r("",!0),c("div",null,[t.allowed("aioseo_page_general_settings")&&l.post.showTitle?(i(),u(v,{key:0,class:"aioseo-details-column__tooltip",disabled:t.showEditTitle},{tooltip:a(()=>[c("strong",null,o(t.strings.title)+":",1),p(" "+o(t.titleParsed),1)]),default:a(()=>[c("div",yt,[c("strong",null,o(t.strings.title)+":",1),t.postLoading?(i(),u(b,{key:0,dark:""})):r("",!0),t.showEditTitle?r("",!0):(i(),u(P,{key:1,onClick:g(n.editTitle,["prevent"])},null,8,["onClick"])),t.showEditTitle?r("",!0):(i(),m("span",vt,o(n.truncate(t.titleParsed,100)),1))])]),_:1},8,["disabled"])):r("",!0)]),t.showEditTitle?(i(),m("div",Ct,[d(L,{modelValue:t.title,"onUpdate:modelValue":s[0]||(s[0]=S=>t.title=S),"line-numbers":!1,single:"","tags-context":h.getTagText("post",l.post?.postType,"Title"),defaultMenuOrientation:"bottom",tagsDescription:"","default-tags":["post_title"]},null,8,["modelValue","tags-context"]),d(C,{type:"gray",size:"small",onClick:g(n.cancel,["prevent"])},{default:a(()=>[p(o(t.strings.discardChanges),1)]),_:1},8,["onClick"]),d(C,{type:"blue",size:"small",onClick:g(n.save,["prevent"])},{default:a(()=>[p(o(t.strings.saveChanges),1)]),_:1},8,["onClick"])])):r("",!0),c("div",null,[t.allowed("aioseo_page_general_settings")&&l.post.showDescription?(i(),u(v,{key:0,class:"aioseo-details-column__tooltip",disabled:t.showEditDescription},{tooltip:a(()=>[c("strong",null,o(t.strings.description)+":",1),p(" "+o(n.truncate(t.descriptionParsed)),1)]),default:a(()=>[c("div",kt,[c("strong",null,o(t.strings.description)+":",1),t.postLoading?(i(),u(b,{key:0,dark:""})):r("",!0),t.showEditDescription?r("",!0):(i(),u(P,{key:1,onClick:g(n.editDescription,["prevent"])},null,8,["onClick"])),t.showEditDescription?r("",!0):(i(),m("span",{key:2,id:`aioseo-${t.columnName}-${t.postId}-value`},o(n.truncate(t.descriptionParsed)),9,It))])]),_:1},8,["disabled"])):r("",!0)]),t.showEditDescription?(i(),m("div",bt,[d(L,{modelValue:t.postDescription,"onUpdate:modelValue":s[1]||(s[1]=S=>t.postDescription=S),"line-numbers":!1,"tags-context":h.getTagText("post",l.post?.postType,"Description"),defaultMenuOrientation:"bottom",tagsDescription:"","default-tags":["post_excerpt"]},null,8,["modelValue","tags-context"]),d(C,{type:"gray",size:"small",onClick:g(n.cancel,["prevent"])},{default:a(()=>[p(o(t.strings.discardChanges),1)]),_:1},8,["onClick"]),d(C,{type:"blue",size:"small",onClick:g(n.save,["prevent"])},{default:a(()=>[p(o(t.strings.saveChanges),1)]),_:1},8,["onClick"])])):r("",!0),st(e.$slots,"default"),c("div",null,[e.$root.$data.screen.base==="upload"&&l.post.showMedia?(i(),u(v,{key:0,class:"aioseo-details-column__tooltip",disabled:t.showEditImageTitle},{tooltip:a(()=>[c("strong",null,o(t.strings.imageTitle)+":",1),p(" "+o(t.imageTitle),1)]),default:a(()=>[c("div",St,[c("strong",null,o(t.strings.imageTitle)+":",1),t.showEditImageTitle?r("",!0):(i(),u(P,{key:0,onClick:g(n.editImageTitle,["prevent"])},null,8,["onClick"])),t.showEditImageTitle?r("",!0):(i(),m("span",{key:1,id:`aioseo-${t.columnName}-${t.postId}-value`},o(t.imageTitle),9,At))])]),_:1},8,["disabled"])):r("",!0)]),t.showEditImageTitle?(i(),m("div",Et,[d(L,{modelValue:t.imageTitle,"onUpdate:modelValue":s[2]||(s[2]=S=>t.imageTitle=S),"line-numbers":!1,single:"","tags-context":"imageSeoTitleColumn",defaultMenuOrientation:"bottom",tagsDescription:"","default-tags":[]},null,8,["modelValue"]),d(C,{type:"gray",size:"small",onClick:g(n.cancel,["prevent"])},{default:a(()=>[p(o(t.strings.discardChanges),1)]),_:1},8,["onClick"]),d(C,{type:"blue",size:"small",onClick:g(n.saveColumn,["prevent"])},{default:a(()=>[p(o(t.strings.saveChanges),1)]),_:1},8,["onClick"])])):r("",!0),c("div",null,[e.$root.$data.screen.base==="upload"&&l.post.showMedia?(i(),u(v,{key:0,class:"aioseo-details-column__tooltip",disabled:t.showEditImageAltTag},{tooltip:a(()=>[c("strong",null,o(t.strings.imageAltTag)+":",1),p(" "+o(t.imageAltTag),1)]),default:a(()=>[c("div",xt,[c("strong",null,o(t.strings.imageAltTag)+":",1),t.generatingAlt?(i(),u(b,{key:0,dark:""})):r("",!0),!t.showEditImageAltTag&&!t.generatingAlt?(i(),u(P,{key:1,onClick:g(n.editImageAlt,["prevent"])},null,8,["onClick"])):r("",!0),!t.showEditImageAltTag&&!t.generatingAlt?(i(),m("span",{key:2,id:`aioseo-${t.columnName}-${t.postId}-value`},o(t.imageAltTag),9,Dt)):r("",!0)])]),_:1},8,["disabled"])):r("",!0)]),t.showEditImageAltTag?(i(),m("div",Pt,[d(L,{modelValue:t.imageAltTag,"onUpdate:modelValue":s[3]||(s[3]=S=>t.imageAltTag=S),"line-numbers":!1,single:"","tags-context":"imageSeoAltColumn",defaultMenuOrientation:"bottom",tagsDescription:"","default-tags":[]},null,8,["modelValue"]),d(C,{type:"gray",size:"small",onClick:g(n.cancel,["prevent"])},{default:a(()=>[p(o(t.strings.discardChanges),1)]),_:1},8,["onClick"]),d(C,{type:"blue",size:"small",onClick:g(n.saveColumn,["prevent"])},{default:a(()=>[p(o(t.strings.saveChanges),1)]),_:1},8,["onClick"])])):r("",!0)])],2)}const Vt=D(wt,[["render",Lt]]),Rt={components:{CorePostColumn:Vt},props:{post:Object}};function Nt(e,s,l,h,t,n){const f=_("core-post-column");return i(),u(f,{post:l.post},null,8,["post"])}const N=D(Rt,[["render",Nt]]),Bt={setup(){return{rootStore:H()}},components:{PostColumn:N,PostColumnLite:N},props:{post:Object}},Mt={class:"aioseo-app"};function zt(e,s,l,h,t,n){const f=_("PostColumn"),w=_("PostColumnLite");return i(),m("div",Mt,[h.rootStore.isPro?(i(),u(f,{key:0,post:l.post},null,8,["post"])):r("",!0),h.rootStore.isPro?r("",!0):(i(),u(w,{key:1,post:l.post},null,8,["post"]))])}const Ut=D(Bt,[["render",zt]]),V="all-in-one-seo-pack",Ot={setup(){const{strings:e}=q();return{composableStrings:e,getTagText:O.getTagText}},components:{BaseButton:F,CoreHtmlTagsEditor:Q,CoreLoader:G,CoreTooltip:X,SvgPencil:J},props:{term:Object,terms:Array,index:Number},data(){return{termId:null,columnName:null,title:null,titleParsed:null,termDescription:null,descriptionParsed:null,showEditTitle:!1,showEditDescription:!1,showTruSeo:!1,termLoading:!1,showTitle:!0,showDescription:!0,strings:K(this.composableStrings,{title:y("Title",V),description:y("Description",V),saveChanges:y("Save Changes",V),discardChanges:y("Discard Changes",V)})}},methods:{save(){I("aioseo_page_general_settings")&&(this.showEditTitle=!1,this.showEditDescription=!1,this.term.title=this.title,this.term.description=this.termDescription,this.termLoading=!0,E.post(x.restUrl("terms-list/update-details-column")).send({termId:this.term.id,title:this.term.title,description:this.term.description}).then(e=>{this.titleParsed=e.body.title,this.descriptionParsed=e.body.description,this.term.titleParsed=e.body.title,this.term.descriptionParsed=e.body.description,this.showTitle=e.body.showTitle,this.showDescription=e.body.showDescription}).catch(e=>{console.error(`Unable to update term with ID ${this.term.id}: ${e}`)}).finally(()=>{this.termLoading=!1}))},cancel(){this.showEditTitle=!1,this.showEditDescription=!1},editTitle(){this.showEditTitle=!0},editDescription(){this.showEditDescription=!0},truncate:U},mounted(){this.termId=this.term.id,this.columnName=this.term.columnName,this.title=this.term.title,this.titleParsed=this.term.titleParsed,this.termDescription=this.term.description,this.descriptionParsed=this.term.descriptionParsed,this.showTitle=this.term.showTitle,this.showDescription=this.term.showDescription,this.term.reload&&this.save()},async created(){this.showTruSeo=dt()}},Ht={class:"aioseo-app"},Zt={key:0},jt={class:"edit-row edit-title"},qt={key:0},Gt={key:1,class:"edit-row"},Ft={key:2},Qt={class:"edit-row edit-description"},Xt={key:0},Jt={key:3,class:"edit-row"};function Kt(e,s,l,h,t,n){const f=_("core-loader"),w=_("svg-pencil"),T=_("core-tooltip"),v=_("core-html-tags-editor"),A=_("base-button");return i(),m("div",Ht,[c("div",{class:B(["aioseo-details-column",{editing:t.showEditTitle||t.showEditDescription}])},[c("div",null,[t.showTitle?(i(),m("div",Zt,[d(T,{class:"aioseo-details-column__tooltip"},{tooltip:a(()=>[c("strong",null,o(t.strings.title)+":",1),p(" "+o(t.titleParsed),1)]),default:a(()=>[c("div",jt,[c("strong",null,o(t.strings.title),1),t.showEditTitle?r("",!0):(i(),m("span",qt,[s[2]||(s[2]=c("strong",null,":",-1)),p(" "+o(n.truncate(t.titleParsed,100)),1)])),t.termLoading?(i(),u(f,{key:1,dark:""})):r("",!0),t.showEditTitle?r("",!0):(i(),u(w,{key:2,class:"pencil-icon",onClick:g(n.editTitle,["prevent"])},null,8,["onClick"]))])]),_:1})])):r("",!0),t.showEditTitle?(i(),m("div",Gt,[d(v,{modelValue:t.title,"onUpdate:modelValue":s[0]||(s[0]=b=>t.title=b),"line-numbers":!1,single:"","tags-context":h.getTagText("taxonomy",l.term?.taxonomy,"Title"),defaultMenuOrientation:"bottom",tagsDescription:"","default-tags":["taxonomy_title"]},null,8,["modelValue","tags-context"]),d(A,{type:"gray",size:"small",onClick:g(n.cancel,["prevent"])},{default:a(()=>[p(o(t.strings.discardChanges),1)]),_:1},8,["onClick"]),d(A,{type:"blue",size:"small",onClick:g(n.save,["prevent"])},{default:a(()=>[p(o(t.strings.saveChanges),1)]),_:1},8,["onClick"])])):r("",!0),t.showDescription?(i(),m("div",Ft,[d(T,{class:"aioseo-details-column__tooltip"},{tooltip:a(()=>[c("strong",null,o(t.strings.description)+":",1),p(" "+o(t.descriptionParsed),1)]),default:a(()=>[c("div",Qt,[c("strong",null,o(t.strings.description),1),t.showEditDescription?r("",!0):(i(),m("span",Xt,[s[3]||(s[3]=c("strong",null,":",-1)),p(" "+o(n.truncate(t.descriptionParsed)),1)])),t.termLoading?(i(),u(f,{key:1,dark:""})):r("",!0),t.showEditDescription?r("",!0):(i(),u(w,{key:2,class:"pencil-icon",onClick:g(n.editDescription,["prevent"])},null,8,["onClick"]))])]),_:1})])):r("",!0),t.showEditDescription?(i(),m("div",Jt,[d(v,{modelValue:t.termDescription,"onUpdate:modelValue":s[1]||(s[1]=b=>t.termDescription=b),"line-numbers":!1,"tags-context":h.getTagText("taxonomy",l.term?.taxonomy,"Description"),defaultMenuOrientation:"bottom",tagsDescription:"","default-tags":["taxonomy_description"]},null,8,["modelValue","tags-context"]),d(A,{type:"gray",size:"small",onClick:g(n.cancel,["prevent"])},{default:a(()=>[p(o(t.strings.discardChanges),1)]),_:1},8,["onClick"]),d(A,{type:"blue",size:"small",onClick:g(n.save,["prevent"])},{default:a(()=>[p(o(t.strings.saveChanges),1)]),_:1},8,["onClick"])])):r("",!0)])],2)])}const Wt=D(Ot,[["render",Kt]]);j();const W=e=>(e=it(e),e=ot(e),e=nt(e),j(e),e),Y=e=>{const s=document.getElementById(e);s?.__vue_app__&&s.__vue_app__.unmount()},$=(e,s)=>{if(!document.getElementById(`${e.columnName}-${e.id}`)){const t=document.querySelector(`tr#${s}-${e.id}`)?.querySelector(".column-aioseo-details");if(t){const n=document.createElement("div");n.id=`aioseo-details-${e.id}`,t.appendChild(n)}}},tt=e=>{Y(`${e.columnName}-${e.id}`),$(e,"post"),W(M({name:"Standalone/PostsTable/"+e.id,data(){return{screen:window.aioseo.screen}},render:()=>z(Ut)},{post:e})).mount(`#${e.columnName}-${e.id}`)},et=e=>{if(!e)return;const s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("name","aioseo-has-details-column"),s.setAttribute("value",!0),e.append(s)};window.aioseo.posts&&0e.id)}).then(e=>{window.aioseo.posts=window.aioseo.posts.map(s=>({...s,...e.body.posts.find(l=>l.id===s.id)})),window.aioseo.posts.forEach(s=>{tt(s)})});const R=e=>{Y(`${e.columnName}-${e.id}`),$(e,"tag"),W(M({name:"Standalone/TermsTable/"+e.id,data(){return{screen:window.aioseo.screen}},render:()=>z(Wt)},{term:e})).mount(`#${e.columnName}-${e.id}`)};window.aioseo.terms&&0e.id)}).then(e=>{window.aioseo.terms=window.aioseo.terms.map(s=>({...s,...e.body.terms.find(l=>l.id===s.id)})),window.aioseo.terms.forEach(s=>{R(s)})});et(document.querySelector("#inline-edit div"));et(document.getElementById("addtag"));(function(e){e(document).on("ajaxComplete",(s,l,h)=>{const t=new URLSearchParams(h.data),n=t?.get("action");if(!(!t||!n)){if(n==="inline-save"){const{post_ID:f}=Object.fromEntries(t.entries()),w=window.aioseo.posts.find(T=>T.id===parseInt(f));tt({...w,reload:!0})}if(n==="inline-save-tax"){const{tax_ID:f}=Object.fromEntries(t.entries()),w=window.aioseo.terms.find(T=>T.id===parseInt(f));R({...w,reload:!0})}if(n==="add-tag"){const f=e(l.responseXML).find("term_id").text(),w=e(l.responseXML).find("term taxonomy").text(),T=Z();R({id:parseInt(f),columnName:"aioseo-details",title:T.dynamicOptions.searchAppearance.taxonomies[w]?.title,description:T.dynamicOptions.searchAppearance.taxonomies[w]?.metaDescription,reload:!0})}}})})(window.jQuery);