import{SEARCH_GROUP_FACET_FIELD as i}from"../../../constants/index.js";import{EntitlementsProvider as o}from"../../entitlements/entitlements-provider.js";import{DEFAULT_AI_SEARCH_ENABLED as n}from"./constants.js";import{isDevelopMode as s}from"../../utils/is-develop-mode.js";import{isPrimitive as a}from"../../../shared/utils.js";function E(e){return s()?process.env.SEARCH_DEV_DEBUG==="true":o.instance().canAccessFeature("aiSearchLimit")?typeof e.search?.ai?.hide=="boolean"?!e.search?.ai?.hide:n:!1}function A(e){let t;return e&&Object.keys(e).forEach(r=>{r===i&&(t=e[r])}),t}function h(e){return e&&e.replace(/\s+/g,"_").toLowerCase()}function S(e){return Object.entries(e||{}).map(([t,r])=>`  - ${t}: ${a(r)?r:JSON.stringify(r)}`).join(`
`)}export{S as formatDocumentMetadata,A as getSearchDocumentGroup,E as isAiSearchEnabled,h as normalizeFacetValue};
