// @bun
import{yb as n}from"./chunk-8ty8fefr.js";class l extends n{service;static _name="I18nServiceContainer";translations={};isEnabled=!1;constructor(r){super();this.service=r;let e={};for(let[o,c]of Object.entries(this.service.prefetch))for(let t of this.service.supportedLocales){if(!e[t])e[t]={};e[t][o]={};for(let s of c){e[t][o][s.name]={};for(let[i,a]of Object.entries(s.dictionary))this.isEnabled=!0,e[t][o][s.name][i]=a[t]}}this.translations=e}detectLocale(r){let e=this.service.defaultLocale??this.service.supportedLocales[0]??"en-US",o=this.service.detectLocale(r);if(this.service.supportedLocales.includes(o))return o;let t=r.cookies.get("i18n-locale")??(r.headers.get("accept-language")||e),[s]=t.split(",");if(this.service.supportedLocales.includes(s))return s;if(s.length===2){for(let i of this.service.supportedLocales)if(i.startsWith(s))return i}return e}getPageTranslations(r,e){if(this.translations[r][e])return this.translations[r][e];return{}}}
export{l as X};

//# debugId=02A628E4FF31D58564756E2164756E21
