!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2fd05c48-5705-5b07-a2a1-5fa24c1b5bbb")}catch(e){}}(); import{r as g}from"./index-DwaoyV61.js";import{I as k,R as A,g as F,a as M}from"./context-BQU-MMMX.js";function O(){if(console&&console.warn){for(var n=arguments.length,e=new Array(n),t=0;t()=>{if(n.isInitialized)e();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),e()};n.on("initialized",t)}},R=(n,e,t)=>{n.loadNamespaces(e,z(n,t))},v=(n,e,t,a)=>{m(t)&&(t=[t]),t.forEach(i=>{n.options.ns.indexOf(i)<0&&n.options.ns.push(i)}),n.loadLanguages(e,z(n,a))},P=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=e.languages[0],i=e.options?e.options.fallbackLng:!1,s=e.languages[e.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const u=(C,h)=>{const o=e.services.backendConnector.state[`${C}|${h}`];return o===-1||o===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!u(e.isLanguageChangingTo,n)?!1:!!(e.hasResourceBundle(a,n)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||u(a,n)&&(!i||u(s,n)))},j=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(I("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(n,{lng:t.lng,precheck:(i,s)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,n))return!1}}):P(n,e,t)},m=n=>typeof n=="string",B=n=>typeof n=="object"&&n!==null,J=(n,e)=>{const t=g.useRef();return g.useEffect(()=>{t.current=n},[n,e]),t.current},E=(n,e,t,a)=>n.getFixedT(e,t,a),U=(n,e,t,a)=>g.useCallback(E(n,e,t,a),[n,e,t,a]),W=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:t}=e,{i18n:a,defaultNS:i}=g.useContext(k)||{},s=t||a||M();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new A),!s){I("You will need to pass in an i18next instance by using initReactI18next");const r=(f,l)=>m(l)?l:B(l)&&m(l.defaultValue)?l.defaultValue:Array.isArray(f)?f[f.length-1]:f,c=[r,{},!1];return c.t=r,c.i18n={},c.ready=!1,c}s.options.react&&s.options.react.wait!==void 0&&I("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const u={...F(),...s.options.react,...e},{useSuspense:C,keyPrefix:h}=u;let o=n||i||s.options&&s.options.defaultNS;o=m(o)?[o]:o||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(o);const d=(s.isInitialized||s.initializedStoreOnce)&&o.every(r=>j(r,s,u)),$=U(s,e.lng||null,u.nsMode==="fallback"?o:o[0],h),L=()=>$,x=()=>E(s,e.lng||null,u.nsMode==="fallback"?o:o[0],h),[S,N]=g.useState(L);let b=o.join();e.lng&&(b=`${e.lng}${b}`);const T=J(b),p=g.useRef(!0);g.useEffect(()=>{const{bindI18n:r,bindI18nStore:c}=u;p.current=!0,!d&&!C&&(e.lng?v(s,e.lng,o,()=>{p.current&&N(x)}):R(s,o,()=>{p.current&&N(x)})),d&&T&&T!==b&&p.current&&N(x);const f=()=>{p.current&&N(x)};return r&&s&&s.on(r,f),c&&s&&s.store.on(c,f),()=>{p.current=!1,r&&s&&r.split(" ").forEach(l=>s.off(l,f)),c&&s&&c.split(" ").forEach(l=>s.store.off(l,f))}},[s,b]),g.useEffect(()=>{p.current&&d&&N(L)},[s,h,d]);const w=[S,s,d];if(w.t=S,w.i18n=s,w.ready=d,d||!d&&!C)return w;throw new Promise(r=>{e.lng?v(s,e.lng,o,()=>r()):R(s,o,()=>r())})};export{W as u}; //# sourceMappingURL=useTranslation-CqXWvxCZ.js.map //# debugId=2fd05c48-5705-5b07-a2a1-5fa24c1b5bbb