var f=Object.defineProperty;var h=(a,t,o)=>t in a?f(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o;var d=(a,t,o)=>h(a,typeof t!="symbol"?t+"":t,o);import{c as p}from"./runtime-dom.esm-bundler.dc49ee3e.js";import{c as y,a as b}from"./vue-router.41e9d860.js";import{l as x}from"./index.317ad629.js";import{l as g}from"./index.20093c86.js";import{l as B}from"./index.3030e086.js";import{i as C}from"./helpers.9595460e.js";import{h as D}from"./runtime-core.esm-bundler.ce5add0b.js";let c=null,l=null,m=null;class A{constructor(t){d(this,"mountComponent",({name:t,component:o,rootContainer:s,data:i={},props:e={},useRouter:r=!1})=>{let n=p({name:t,data(){return i},render:()=>D(o,{...e})});if(n=g(n),n=B(n),r){const u=y({history:b(),routes:[{path:"/:pathMatch(.*)*",component:o}]});n.use(u),u.app=n}return x(n),n.mount(s),n});this.scoreBtn=t==null?void 0:t.scoreBtn,this.limitModifiedDate=t==null?void 0:t.limitModifiedDate,this.metabox=t==null?void 0:t.metabox,this.injectStyles=t==null?void 0:t.injectStyles,this.mount=async()=>{var s;const o=(i,e)=>{const r=document.createElement(i);for(const n in e)r.setAttribute(n,e[n]);return r};if(this.scoreBtn&&(this.scoreBtn.node.$wrapper.querySelector(`#${this.scoreBtn.node.attributes.id}`)||this.scoreBtn.node.$wrapper.insertAdjacentElement("beforeend",o(this.scoreBtn.node.tag,this.scoreBtn.node.attributes)),c==null||c.unmount(),c=this.mountComponent({name:this.scoreBtn.appName,component:this.scoreBtn.component,rootContainer:this.scoreBtn.node.$wrapper.querySelector(`#${this.scoreBtn.node.attributes.id}`),props:{onClick(){document.dispatchEvent(new Event("aioseo-pagebuilder-toggle-modal"))}}})),this.limitModifiedDate){const i=e=>{var r;e&&(e.querySelector(`#${this.limitModifiedDate.node.attributes.id}`)||e.insertAdjacentElement("beforeend",o(this.limitModifiedDate.node.tag,{...this.limitModifiedDate.node.attributes,class:(r=e.querySelector('[role="menuitem"]'))==null?void 0:r.classList.value})),l==null||l.unmount(),l=this.mountComponent({name:this.limitModifiedDate.appName,component:this.limitModifiedDate.component,rootContainer:e.querySelector(`#${this.limitModifiedDate.node.attributes.id}`)}))};(s=this.limitModifiedDate.node)!=null&&s.mountLater?this.limitModifiedDate.node.mountLater(i):i(this.limitModifiedDate.node.$wrapper)}this.metabox&&(m==null||m.unmount(),m=this.mountComponent({name:this.metabox.appName,component:this.metabox.component,rootContainer:"#aioseo-modal-portal",data:{tableContext:window.aioseo.currentPost.context,screenContext:"metabox"},useRouter:!0})),this.injectStyles&&document.querySelectorAll('link[href*="all-in-one-seo-pack"]').forEach(e=>{C(e.href,e.id)})}}}export{A as P};
