import{getTemplatePath as g}from"./get-template-path.js";import{normalizeRouteSlug as m}from"../../../shared/utils.js";import{isTruthy as u}from"../../../shared/jsUtils.js";const o="catalog-custom-fields";async function f(){return{id:"CatalogClassic",requiredEntitlements:["catalogClassic"],async processContent(e,{getConfig:l}){const r=e.createTemplate("catalogClassic","@redocly/theme/components/CatalogClassic/CatalogClassic");e.registerServerPropsGetter(o,g("./get-server-props.js"));const s=await l(),c=!!s.rules?.["custom-fields-schema"],i=s.catalogClassic??{};for(const[n,t]of Object.entries(i)){const a=m(t.slug);e.addRoute({duplicateInAllLocales:!0,slug:a,fsPath:a,templateId:r,excludeFromSidebar:!0,serverPropsGetterIds:c?[o]:[],getNavText:()=>Promise.resolve(t.title||"API Catalog"),getStaticData:async()=>({props:{catalogId:n,catalogConfig:{...t,filters:t.filters?.filter(u),items:void 0},seo:{title:t.title||"API Catalog"}}})})}}}}export{o as CUSTOM_FIELDS_SERVER_PROPS_GETTER_ID,f as catalogClassicPlugin};
