import{e as u,a}from"./index.4b887428.js";import{u as p}from"./upperFirst.5dc701f8.js";const f=(e,n=null)=>{try{e=JSON.parse(e)}catch{e=n}return e},c={individual:0,business:1,agency:2,basic:3,plus:4,pro:5,elite:6},l=(e="")=>{var s,i;const n=u(),o=a().aioseo.data.isNetworkLicensed&&!n.options.general.licenseKey?((s=n.internalNetworkOptions.internal.license)==null?void 0:s.features)||[]:((i=n.internalOptions.internal.license)==null?void 0:i.features)||[];let r=f(o,[]);return e&&(r=r[e]||[]),r},d=(e,n=null)=>{const t=l("core");for(const o in t)if(e===o&&!n||e===o&&t[o].find(r=>r===n||-1<r.indexOf(n)))return!0;return!1},_=(e,n)=>{const t=l("addons");for(const o in t)if(e===o&&t[o].includes(n))return!0;return!1},m=e=>{var r,s;const n=u(),o=a().aioseo.data.isNetworkLicensed&&!n.options.general.licenseKey?(r=n.internalNetworkOptions.internal.license)==null?void 0:r.level:(s=n.internalOptions.internal.license)==null?void 0:s.level;return o?c[o]>=c[e]:!1},S=(e,n="")=>{const t=[];a().aioseo.features.forEach(s=>{s.section===e&&(n&&s.feature!==n||t.push(p(s.license_level)))});const r=["Basic","Plus","Pro","Elite"];return t.sort((s,i)=>r.indexOf(s)-r.indexOf(i)),[...new Set(t)]},y={getFeatures:l,getPlansForFeature:S,hasAddonFeature:_,hasCoreFeature:d,hasMinimumLevel:m};export{y as l};
