(()=>{var E=(e,n)=>{n.innerHTML=e.innerHTML;for(let r of e.attributes)n.setAttribute(r.name,r.value);e.parentElement?.insertBefore(n,e);let t=window.getComputedStyle(e),o=window.getComputedStyle(n);for(let r in t){if(!Object.getOwnPropertyDescriptor(n.style,r)?.writable)return;let m=t[r],C=t.getPropertyValue(m);o.setProperty(m,C)}},l=E;var M=(e,n)=>e.evaluate(n,e,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue,a=M;var L=(e,{xpath:n})=>{let t=a(e,n);if(!t)return;let o=e.createElement("h2");l(t,o),t.remove()},s=L;var H=(e,{xpath:n})=>{let t=a(e,n);if(!t)return;let o=e.createElement("h1");l(t,o),t.remove()},d=H;var w=(e,{xpath:n,data:t})=>{let{alt:o}=t,r=a(e,n);!r||r.alt||(r.alt=o)},p=w;var x=(e,{xpath:n})=>{let t=a(e,n);!t||t.target||(t.target="_blank")},c=x;var D=(e,{xpath:n,data:t})=>{let{title:o}=t,r=a(e,n);!r||r.title||(r.title=o)},h=D;var I=(e,{xpath:n,data:t})=>{let{content:o}=t,r=a(e,n);if(r){r.content=o;return}let i=e.createElement("meta");i.name="description",i.content=o,e.head.appendChild(i)},f=I;var A=(e,{xpath:n,data:t})=>{let{content:o,property:r}=t,i=a(e,n);if(i){i.content=o;return}let m=e.createElement("meta");m.setAttribute("property",r),m.content=o,e.head.appendChild(m)},g=A;var y=(e,{xpath:n,data:t})=>{let{textContent:o}=t,r=a(e,n);if(r){r.textContent=o;return}let i=e.createElement("title");i.textContent=o,e.head.appendChild(i)},T=y;var O="https://seonaapi.usestyle.ai/api/v3/plugin-code-changes",_=async e=>{let n=e.location.href;try{let t=await fetch(`${O}?url=${encodeURIComponent(n)}`),{success:o,data:r,error:i}=await t.json();if(!o)throw new Error(i);return r.codeChanges.map(m=>({...m,data:JSON.parse(m.data)}))}catch(t){console.error(t);return}},u=_;var P={H1_DEMOTION:s,H1_PROMOTION:d,ADD_ALT_TAG:p,ADD_LINK_TARGET:c,ADD_LINK_TITLE:h,OPTIMIZE_DESCRIPTION:f,ADD_OG_SITE_TAG:g,OPTIMIZE_TITLE:T},R=async()=>{let e=document,n=window;if(window.self!==window.top)try{e=window.parent.document,n=window.parent}catch(o){console.error(o);return}let t=await u(n);if(t)for(let o of t)P[o.type](e,o)};document.addEventListener("DOMContentLoaded",R);})();
