import{b as _,u as v,_ as d,d as k}from"./index.ZNJz487u.js";import{u as L}from"./LicenseStore.DAzcp1Mc.js";import{z as P}from"./runtime-dom.esm-bundler.DYN7TRGp.js";const U=r=>(r||document.location.search).replace(/(^\?)/,"").split("&").map((function(e){return e=e.split("="),this[e[0]]=e[1],this}).bind({}))[0];let l=!1,n=null,y;const w=r=>{y(r,n,w)},W=(r,e,o,s,i,a,t,f,c)=>{let u=50,p=50;{const m=window.outerHeight;u=(window.innerWidth-o)/2,p=(m-50-s)/2}let h=`location=0,status=0,width=${o},height=${s},left=${u},top=${p}`;(e==="_blank"||e==="_self")&&(h=""),(!n||n.closed)&&(n=window.open(r,e,h)),n&&n.focus(),l=window.setInterval(()=>I(a,t,f,c),500)},I=(r,e,o,s=!1)=>{if(s){if(!n){window.removeEventListener("message",w,!1),window.clearInterval(l),o();return}n.closed&&(n=null,window.removeEventListener("message",w,!1),window.clearInterval(l),o());return}let i={};try{i=U(n.location.search)}catch{}const a=[];if(r.forEach(t=>{if(i[t]!==void 0&&i[t]){a.push(!0);return}a.push(!1)}),a.every(t=>t))return window.clearInterval(l),e(i).then(()=>{n.close(),n=null,o(!0)});if(!n){window.clearInterval(l),o();return}n.closed&&(n=null,window.clearInterval(l),o())},g="broken-link-checker-seo",T=()=>{const r=L(),e=_(),o=v(),s={toUnlock:d("To unlock a higher quota, consider",g),upgradingToPro:d("upgrading to Pro",g),upgradingToHigherPlan:d("upgrading to a higher plan",g)},i=c=>{if(r.showUpgradePopup=!1,c.success)return r.activateLicense(e.internalOptions.internal.license.licenseKey)},a=()=>{r.showUpgradePopup=!1},t=(c="broken-links-report",u="external-link")=>{if(r.showUpgradePopup.licenseUpgrade)return;r.showUpgradePopup=!0;const p=k.utmUrl(c,u,"blc-pricing-upgrade?license="+e.internalOptions.internal.license.licenseKey)+"&url="+btoa(o.aioseoBrokenLinkChecker.urls.connect);W(p,d("Upgrade Your Broken Link Checker License",g),650,800,!0,["success"],i,a)},f=P(()=>e.internalOptions.internal.license.level&&e.internalOptions.internal.license.level.toLowerCase()==="free"?s.upgradingToPro:s.upgradingToHigherPlan);return{openLicenseUpgradePopup:t,strings:s,upgradeAnchor:f,completedLicenseUpgrade:i,closedLicenseUpgrade:a}};export{W as p,T as u};
