Sid Gifari File Manager
🏠 Root
/
home
/
caldereriajp
/
www
/
wp-content
/
plugins
/
all-in-one-seo-pack
/
dist
/
Lite
/
assets
/
js
/
Editing: postContent.314c716d.js
var pt=Object.defineProperty;var mt=(t,e,n)=>e in t?pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var y=(t,e,n)=>(mt(t,typeof e!="symbol"?e+"":e,n),n);import{t as E,v as P,s as f,k as p,d as m,w as _,x as q,J as I,u as j,c as U}from"./links.96235554.js";import{S as W}from"./vue.runtime.esm-bundler.a49acf4f.js";import{d as Z}from"./Caret.7f04b0aa.js";import{c as M}from"./cleanForSlug.77e4c771.js";import{c as z,d as G}from"./html.671743b1.js";import{g as S}from"./get.80957652.js";import{d as gt,A as ft}from"./isArrayLikeObject.3ade28da.js";const wt=()=>{const t=window.elementor.documents.getCurrent(),e=[];return t.$element?(t.$element.find(".elementor-widget-container").each((n,o)=>{let r=o.innerHTML.trim();r=r.replaceAll(/<p.*>(<img.*>)<\/p>/g,"$1"),!(z(r)===""&&G(r).length===0)&&e.push(r)}),e.join(" ")):""},L=()=>{var t;return{content:wt(),title:window.elementor.settings.page.model.get("post_title"),excerpt:window.elementor.settings.page.model.get("post_excerpt")||"",slug:M(window.elementor.settings.page.model.get("post_title")),permalink:window.elementor.config.document.urls.permalink||"",featuredImage:((t=window.elementor.settings.page.model.get("post_featured_image"))==null?void 0:t.url)||""}},yt=()=>{const t=S(ET_Builder,"Frames.app.frameElement",document.querySelector("iframe#et-fb-app-frame"));if(!t)return document.createElement("div");let e=t.contentWindow.document.querySelectorAll("#et-fb-app");return 1<e.length&&(e=[...e].filter(n=>n.classList.contains("et-fb-root-ancestor"))),e[0]||document.createElement("div")},St=()=>{const t=[],e=yt().querySelectorAll(".et_pb_section"),n=new RegExp(["<style.*?</style>","\\[object Object\\]"].join("|"),"gi");for(let o=0;o<e.length;o++){let r=e[o].innerHTML;r=e[o].innerHTML.replace(n,""),r=r.replaceAll(/<p.*>(<img.*>)<\/p>/g,"$1"),!(z(r)===""&&G(r).length===0)&&t.push(r)}return t.join(" ")},Et=()=>{const t=new URL(S(ETBuilderBackendDynamic,"currentPage.permalink",""));return t.searchParams.delete("PageSpeed"),t.href},$=()=>({content:St(),title:S(ETBuilderBackendDynamic,"postTitle",""),excerpt:S(ETBuilderBackendDynamic,"postMeta.post_excerpt",""),slug:S(ETBuilderBackendDynamic,"postMeta.post_name",""),permalink:Et(),featuredImage:S(ETBuilderBackendDynamic,"currentPage.thumbnailUrl","")}),ht=t=>{let e;switch(t.type){case"header":e=document.createElement(t.settings.tag),e.innerHTML=t.settings.headerTxt.trim();break;case"image":const n=document.createElement("img");t.settings.altTxt&&n.setAttribute("alt",t.settings.altTxt),t.settings.src&&n.setAttribute("src",t.settings.src),t.settings.noFollow&&n.setAttribute("rel","nofollow"),e=n,t.settings.link&&(e=document.createElement("a"),e.setAttribute("href",t.settings.link),e.innerHTML=n.outerHTML,t.settings.noFollow&&e.setAttribute("rel","nofollow"),t.settings.openNewWindow&&e.setAttribute("target","_blank"));break;case"video":t.settings.type==="youtube"?(e=document.createElement("iframe"),e.setAttribute("src",t.settings.youtubeUrl)):(e=document.createElement("div"),e.innerHTML=t.settings.code);break;case"text":e=document.createElement("div"),e.innerHTML=t.settings.txt.trim();break;case"button":e=document.createElement("a"),e.appendChild(document.createTextNode(t.settings.btnTxt+" "+t.settings.btnSubTxt)),t.settings.link&&e.setAttribute("href",t.settings.link),t.settings.altTxt&&e.setAttribute("alt",t.settings.altTxt),t.settings.src&&e.setAttribute("src",t.settings.src),t.settings.noFollow&&e.setAttribute("rel","nofollow"),t.settings.openNewWindow&&e.setAttribute("target","_blank");break;case"bullet-list":e=document.createElement("ul"),t.settings.items.forEach(o=>{const r=document.createElement("li");r.innerHTML=o.txt,e.appendChild(r)});break;case"custom-html":e=document.createElement("div"),e.innerHTML=t.settings.code;break}return e},Pt=()=>{const t=[];return JSON.parse(JSON.stringify(S(seedprod_data,"settings.document.sections",[]))).forEach(n=>{n.rows.forEach(o=>{o.cols.forEach(r=>{r.blocks.forEach(a=>{const s=ht(a);s&&(z(s)===""&&G(s).length===0||t.push(s.outerHTML))})})})}),t.join(" ")},Tt=()=>{const t=S(seedprod_data,"home_url",""),e=S(seedprod_data,"settings.post_name","");return`${t}/${e}/`},B=()=>({content:Pt(),title:S(seedprod_data,"settings.post_title",""),excerpt:"",slug:S(seedprod_data,"settings.post_name",""),permalink:Tt()}),F=()=>{let t="";return _()&&(t=L().permalink),q()&&(t=$().permalink),I()&&(t=B().permalink),t},xt=()=>{const t=m();if(t.liveTags.permalink)return t.liveTags.permalink;let e;if(E()||P){const n=document.querySelector("#edit-slug-box a");n&&n.href&&(e=n.href)}return f()&&(e=window.wp.data.select("core/editor").getPermalink()),e||(e=F()),e&&t.updatePermalink(e),e},A=()=>{let t;if(E()||P){const e=document.querySelector("#edit-slug-box a");e&&e.href&&(t=e.href)}return f()&&(t=window.wp.data.select("core/editor").getPermalink()),t||(t=F()),t},vt=async(t=!0)=>{let e=xt();const n=A();if(e!==n&&(e=n,e)){const o=p();if(m().updatePermalink(e),!t)return;new T().runAnalysis({postId:o.currentPost.id,postData:{...o.currentPost},content:v(),slug:A()})}},X=()=>{let t="";return _()&&(t=L().title),q()&&(t=$().title),I()&&(t=B().title),t},At=()=>{const t=m();if(t.liveTags.post_title)return t.liveTags.post_title;let e;if(E()||P()){const n=document.querySelector("#post input#title");e=n?n.value:""}return f()&&(e=window.wp.data.select("core/editor").getCurrentPost().title),e||(e=X()),e&&t.updatePostTitle(e),e},Q=()=>{let t;if(E()||P()){const e=document.querySelector("#post input#title");t=e?e.value:""}return f()&&(t=window.wp.data.select("core/editor").getEditedPostAttribute("title")),t||(t=X()),t},Ct=async(t=!0)=>{let e=At();const n=Q();if(e!==n){e=n;const o=p();if(m().updatePostTitle(e),!t)return;new T().runAnalysis({postId:o.currentPost.id,postData:{...o.currentPost},content:v(),slug:A()})}},Y=t=>{if(!t)return"";const e=[/\[.*?\]/g,/<\/?[a-z][^>]*?>/gi,/<!--[\s\S]*?-->/g,/(\r\n|\n|\r)/g];return t=t.replaceAll(/\n\n/g," "),e.forEach(n=>{t=t.replace(n,"")}),t.trim()},K=()=>{let t="";return _()&&(t=L().excerpt),q()&&(t=$().excerpt),I()&&(t=B().excerpt),t},kt=()=>{const t=m();if(t.liveTags.post_excerpt)return t.liveTags.post_excerpt;let e;return(E()||P())&&(e=tt()),f()&&(e=window.wp.data.select("core/editor").getCurrentPost().excerpt),e||(e=K()),e||(e=Y(lt())),e&&t.updatePostExcerpt(e),e},bt=()=>{let t;return(E()||P())&&(t=tt()),f()&&(t=window.wp.data.select("core/editor").getEditedPostAttribute("excerpt")),t||(t=K()),t||(t=Y(v())),t},_t=async(t=!0)=>{let e=kt();const n=bt();if(e!==n){e=n;const o=p();if(m().updatePostExcerpt(e),!t)return;new T().runAnalysis({postId:o.currentPost.id,postData:{...o.currentPost},content:v(),slug:A()})}},tt=()=>{let t="";const e=document.querySelector("#postexcerpt textarea#excerpt");if(t=e?e.value:"",document.querySelector("#wp-excerpt-wrap.tmce-active")){const n=window.tinyMCE?window.tinyMCE.get("excerpt"):"";n&&(t=n.getContent({format:"raw"}))}return t},et=()=>{let t="";return _()&&(t=L().slug),q()&&(t=$().slug),I()&&(t=B().slug),t},Mt=()=>{const t=m();if(t.permalinkSlug)return t.permalinkSlug;let e="";if(E()||P()){const n=document.querySelector("#post_name");n&&(e=M(n.value))}return f()&&(e=window.wp.data.select("core/editor").getCurrentPost().slug),e||(e=et()),e&&t.updatePermalinkSlug(e),e},qt=()=>{let t="";if(E()||P()){const e=document.querySelector("#post_name");e&&(t=M(e.value))}if(f()&&(t=window.wp.data.select("core/editor").getEditedPostAttribute("slug")),_()){const e=window.elementor.settings.page.model.get("post_title");e&&(t=M(e))}return t||(t=et()),t},It=async(t=!0)=>{let e=Mt();const n=qt();if(e!==n){e=n;const o=p();if(m().updatePermalinkSlug(e),!t)return;new T().runAnalysis({postId:o.currentPost.id,postData:{...o.currentPost},content:v(),slug:A()})}};let g="",x="";const Lt=(t=!0)=>{var o;const e=m();if(E()||P()){const r=document.querySelectorAll('#post input[name="post_category[]"]:checked');r.length?(g!==r[0].parentNode.innerText&&(g=r[0].parentNode.innerText,e.updateTaxonomyTitle(g)),x=Array.from(r).map(a=>a.parentNode.innerText).join(", "),e.updateCategories(x)):g!==""&&(g=x="",e.updateTaxonomyTitle(g),e.updateCategories(x))}if(f()){let r=[],a=[];if((o=j().aioseo.user.data.allcaps)!=null&&o.manageCategories&&(r=window.wp.data.select("core").getEntityRecords("taxonomy","category"),a=window.wp.data.select("core/editor").getEditedPostAttribute("categories")),a&&a.length&&r){const c=r.find(i=>i.id===a[0]);c&&g!==c.name&&(g=c.name,e.updateTaxonomyTitle(g)),x=r.filter(i=>a.includes(i.id)).map(i=>i.name).join(", "),e.updateCategories(x)}else g!==""&&(g=x="",e.updateTaxonomyTitle(g),e.updateCategories(x))}const n=p();t&&new T().runAnalysis({postId:n.currentPost.id})},$t=(t=!1)=>{const e=p();if(e.currentPost.context!=="term")return;const n=m(),o=document.querySelector("#edittag input#name");o&&(n.updateTaxonomyTitle(o.value),o.addEventListener("input",()=>{n.updateTaxonomyTitle(o.value)}));const r=document.querySelector("#edittag textarea#description");r&&(n.updateTaxonomyDescription(r.value),r.addEventListener("input",()=>{n.updateTaxonomyDescription(r.value)}));const a=document.querySelector("#edittag input#slug");if(a){const s=M(a.value);n.updatePermalinkSlug(s),n.updatePermalink(e.currentPost.permalink.replace(`/${n.permalinkSlug}`,`/${s.replace(/ /gi,"-").replace(/[^a-z0-9-]/gi,"").toLowerCase()}`)),a.addEventListener("input",()=>{n.updatePermalinkSlug(s),n.updatePermalink(e.currentPost.permalink.replace(`/${n.permalinkSlug}`,`/${s.replace(/ /gi,"-").replace(/[^a-z0-9-]/gi,"").toLowerCase()}`))})}e.savePostState(),t&&T.runAnalysis({postId:e.currentPost.id})},Bt=(t=!1)=>{const e=p();if(e.currentPost.postType!=="attachment")return;const n=m(),o=document.querySelector("textarea#attachment_caption");o&&(n.updateAttachmentCaption(o.value),o.addEventListener("input",i=>{n.updateAttachmentCaption(i.target.value)}));const r=document.querySelector("textarea#attachment-details-caption");r&&(n.updateAttachmentCaption(r.value),r.addEventListener("input",i=>{n.updateAttachmentCaption(i.target.value)}));const a=document.querySelector("textarea#attachment_content");a&&(n.updateAttachmentDescription(a.value),a.addEventListener("input",i=>{n.updateAttachmentDescription(i.target.value)}));const s=document.querySelector("input#attachment_alt");s&&(n.updateAltTag(s.value),s.addEventListener("input",i=>{n.updateAltTag(i.target.value)}));const c=document.querySelector("input#attachment-details-alt-text");c&&(n.updateAltTag(s.value),c.addEventListener("input",i=>{n.updateAltTag(i.target.value)})),t&&new T().runAnalysis({postId:e.currentPost.id})},Nt=()=>{var n,o;const t=p();return(n=t.currentPost)!=null&&n.id?((o=U().options.advanced)==null?void 0:o.truSeo)&&!t.currentPost.isSpecialPage&&t.currentPost.postType!=="attachment"&&nt():!1},Vt=()=>{var n,o;const t=j();return(n=t.aioseo.screen)!=null&&n.postType?!!((o=U().options.advanced)!=null&&o.truSeo&&nt(t.aioseo.screen.postType)):!1},nt=(t=null)=>{var a,s,c,i,h,l,u;if(t)return!!((s=(a=window.aioseo.dynamicOptions.searchAppearance.postTypes[t])==null?void 0:a.advanced)!=null&&s.showMetaBox);if(!((c=window.aioseo.currentPost)!=null&&c.id))return!1;const e=window.aioseo.currentPost.postType,n=window.aioseo.currentPost.termType,o=!!(e&&window.aioseo.currentPost.context==="post"&&window.aioseo.dynamicOptions.searchAppearance.postTypes[e]&&((h=(i=window.aioseo.dynamicOptions.searchAppearance.postTypes[e])==null?void 0:i.advanced)!=null&&h.showMetaBox)),r=!!(n&&window.aioseo.currentPost.context==="term"&&window.aioseo.dynamicOptions.searchAppearance.taxonomies[n]&&((u=(l=window.aioseo.dynamicOptions.searchAppearance.taxonomies[n])==null?void 0:l.advanced)!=null&&u.showMetaBox));return o||r},b=async(t=900,e=!0)=>{Z(async()=>{await Ct(!1),await Ht(!1),await _t(!1),await It(!1),await vt(!1),Lt(!1),$t(!1),Bt(!1);const n=p();e&&new T().runAnalysis({postId:n.currentPost.id})},t)};function Dt(){return new Worker(""+window.__aioseoDynamicImportPreload__("main-782c01fc.js"))}class T{constructor(){y(this,"postId",null);y(this,"postTitle",null);y(this,"postParsedTitle",null);y(this,"postParsedDescription",null);y(this,"postDescription",null);y(this,"keyphrases",null);y(this,"postContent",null);y(this,"postSlug",null);y(this,"isAnalyzing",!1);y(this,"worker",null)}async runAnalysis({postId:e,postData:n,content:o=v(),slug:r=A()}){var N;const a=p(),s=U();if(n=n||{...a.currentPost},!((N=s.options.advanced)!=null&&N.truSeo)||!a.currentPost.page_analysis||this.isAnalyzing)return;this.worker&&this.worker.terminate();const c={separator:gt(s.options.searchAppearance.global.separator)},i=j(),h=m(),l={...W(i.aioseo),tags:W(h.tags),currentPost:W(a.currentPost)},u=JSON.parse(JSON.stringify({postId:e,postData:n,content:o,aioseo:l,slug:r,postEditedTitle:Q(),aioseoGlobals:c}));let C=[];this.worker=new Dt,this.worker.addEventListener("message",d=>{d.data.event==="tru-seo-analysis-complete"&&(C=d.data.analysis,this.dispatchActions(C,u),this.worker.terminate())}),this.worker.postMessage({event:"tru-seo-analysis",analysisData:u})}setSidebarButtonScore(e){const n=document.getElementById("aioseo-post-settings-sidebar-button"),o=document.getElementById("aioseo-post-score");!n||!o||(n.className=80<e?"score-green":50<e?"score-orange":"score-red",f()||(n.classList.add("aioseo-score-button","classic-editor"),e=`${e}/100`),o.textContent=e)}dispatchActions(e,n){const o=p();e.forEach(r=>{r.action==="updateState"&&o.currentPost.postType!=="attachment"&&n.postEditedTitle&&this.setSidebarButtonScore(r.data.seo_score),o[r.action](r.data)})}}const ot=()=>{const e=p().currentPost.postType;if(!e)return"";const o=U().dynamicOptions.searchAppearance.postTypes[e].customFields;if(!o||!Nt)return"";const r=()=>{b(500)},a=o.replace(/\n/g,",").split(","),s=[],c=["INPUT","TEXTAREA","IMG"],i=l=>{try{document.createDocumentFragment().querySelector(l)}catch{return!1}return!0};a.forEach(l=>{l=l.trim();const u=i(`#${l}`)?document.querySelector(`#${l}`):!1,C=document.querySelectorAll("#the-list > tr"),N=document.querySelectorAll(".acf-field");c.includes(u==null?void 0:u.tagName)&&!(u!=null&&u.closest(".acf-field"))?s.push(u):C.forEach(d=>{const w=d.querySelector(`#${d.id}-key`),k=d.querySelector(`#${d.id}-value`);c.includes(k==null?void 0:k.tagName)&&a.includes(w==null?void 0:w.value)&&s.push(k)}),N.forEach(d=>{if(l!==d.dataset.name)return"";let w=d.querySelector(`[id^="acf"][name$="[${d.dataset.key}]"]`);if(d.dataset.type==="image"&&(w=d.querySelector(".has-value img")),d.dataset.type==="gallery"&&(w=d.querySelector(".acf-gallery-attachment img")),!w||w.type&&w.type==="hidden")return"";if(d.dataset.type==="wysiwyg"){const k=window.setInterval(()=>{var D,H;(H=(D=window.tinyMCE)==null?void 0:D.activeEditor)!=null&&H.acf&&(window.clearInterval(k),window.tinyMCE.activeEditor.on("keyup",function(){b(500)}),window.tinyMCE.activeEditor.on("PostProcess",function(){Z(()=>{b(500)},10)}))},50),ut=function(D){D.forEach(H=>{var V;if(H.attributeName==="class"&&d.querySelector(".wp-editor-wrap.tmce-active")&&((V=window.tinyMCE)!=null&&V.activeEditor)){window.tinyMCE.activeEditor.on("keyup",function(){b(500)});const R=d.querySelector(`[name="acf[${d.dataset.key}]"]`);R&&(R.addEventListener("keyup",()=>{b(500)}),R.addEventListener("paste",()=>{b(500)}))}})},dt=new MutationObserver(ut),J=d.querySelector(".wp-editor-wrap");J&&dt.observe(J,{attributes:!0})}c.includes(w.tagName)&&s.push(w)})});let h="";return s.forEach(l=>{let u="";if(c.includes(l.tagName)&&l.addEventListener("keyup",r),l.value&&(u=l.value),l.tagName==="IMG"&&l.src){const C=l.alt?`alt="${l.alt}"`:"";u=`<img src="${l.src}" ${C}>`}l.value&&l.type&&l.type==="url"&&(u=`<a href="${u}">${u}</a>`),u&&(h+=`${u} `)}),h},Zt=(t,e=["INPUT","TEXTAREA","IMG"])=>{if(!t)return"";const n=document.querySelector(`#${t}`),o=document.querySelectorAll("#the-list > tr"),r=document.querySelectorAll(".acf-field");let a="";return n&&e.indexOf(n.tagName)!==-1&&(n.closest(".acf-field")||(a=n.tagName==="IMG"?n.getAttribute("src"):n.value)),o.length&&o.forEach(s=>{const c=s.querySelector(`#${s.id}-key`),i=s.querySelector(`#${s.id}-value`);i&&e.indexOf(i.tagName)!==-1&&c.value===t&&(a=i.tagName==="IMG"?i.getAttribute("src"):i.value)}),r.length&&r.forEach(s=>{if(t!==s.dataset.name)return;let c;e.forEach(i=>{const h=i.toLowerCase();c=s.querySelector(`[data-key="${s.dataset.key}"] ${h}`)||c}),c&&(a=c.tagName==="IMG"?c.getAttribute("src"):c.value)}),a},rt=/base64,(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)/g,st=["acf","aioseo"],at=()=>{let t="";return _()&&(t=L().content),q()&&(t=$().content),I()&&(t=B().content),t},it=t=>{var o;if(!t.includes('<!-- wp:block {"ref":'))return t;const e=(o=window.wp.blocks)==null?void 0:o.rawHandler({HTML:t});return ft(e).forEach(r=>{var a,s,c;if(r.name==="core/block"){const i=window.wp.data.select("core").getEntityRecord("postType","wp_block",(a=r.attributes)==null?void 0:a.ref);(s=i==null?void 0:i.content)!=null&&s.raw&&(t=t.replace(`<!-- wp:block {"ref":${(c=r.attributes)==null?void 0:c.ref}} /-->`,i.content.raw))}}),t},ct=(t,e)=>(window.wp.data.select("core/block-editor").getBlocks().forEach(o=>{if(e.includes(o.name.split("/")[0])){const r=document.getElementById("block-"+o.clientId);if(r&&r.innerHTML){const a=`<!-- wp:${o.name}.*?-->`;t=t.replace(new RegExp(a),r.innerHTML)}}}),t),lt=()=>{const t=m();if(t.liveTags.post_content)return t.liveTags.post_content;let e="";if(E())if(window.tinyMCE||document.querySelector("#wp-content-wrap.html-active"))e=O();else{const o=window.setInterval(()=>{window.tinyMCE&&(window.clearInterval(o),e=O())},50)}return f()&&(e=window.wp.data.select("core/editor").getCurrentPost().content,e=it(e),e=ct(e,st)),e||(e=at()),p().currentPost.descriptionIncludeCustomFields&&(e=e+ot()),e=e.replace(rt,""),e&&t.updatePostContent(e),e},v=()=>{let t="";if(E())if(window.tinyMCE||document.querySelector("#wp-content-wrap.html-active"))t=O();else{const n=window.setInterval(()=>{window.tinyMCE&&(window.clearInterval(n),t=O())},50)}return f()&&(t=window.wp.data.select("core/editor").getEditedPostContent(),t=it(t),t=ct(t,st)),t||(t=at()),p().currentPost.descriptionIncludeCustomFields&&(t=t+ot()),t=t.replace(rt,""),t},Ht=async(t=!0)=>{let e=lt();const n=v();if(e!==n){e=n;const o=p();if(m().updatePostContent(e),!t)return;new T().runAnalysis({postId:o.currentPost.id,postData:{...o.currentPost},content:v(),slug:A()})}},O=()=>{let t="";const e=window.tinyMCE?window.tinyMCE.get("content"):"";if(document.querySelector("#wp-content-wrap.tmce-active")&&e)t=e.getContent({format:"raw"});else{const n=document.querySelector("textarea#content");t=n?n.value:""}return t};export{T,$ as a,v as b,Zt as c,Lt as d,$t as e,Bt as f,L as g,Vt as h,qt as i,b as m,nt as s,Nt as t};
Save
Cancel