var w=Object.create;var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var _=(t,e)=>{for(var s in e)a(t,s,{get:e[s],enumerable:!0})},f=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of y(e))!C.call(t,i)&&i!==s&&a(t,i,{get:()=>e[i],enumerable:!(n=b(e,i))||n.enumerable});return t};var c=(t,e,s)=>(s=t!=null?w(T(t)):{},f(e||!t||!t.__esModule?a(s,"default",{value:t,enumerable:!0}):s,t)),L=t=>f(a({},"__esModule",{value:!0}),t);var j={};_(j,{default:()=>O});module.exports=L(j);var o=require("path"),l=require("fs"),u=require("electron/main"),g=require("../global"),h=require("events"),r=require("./electron"),N=c(require("../../../translations/en/client.json")),S=c(require("../../../translations/en/web.json")),x=c(require("../../../translations/en/settings.json"));const d={client:N,web:S,settings:x},E=new h.EventEmitter;E.once("show-error",t=>{(0,r.showMessageBox)({title:"Error loading translations for locale: '"+(0,r.getLocale)().toLocaleUpperCase()+"'!",type:"error",message:"An error occured while loading 'strings' from file: '"+t+`'. Please make sure that the file syntax is correct!

This will lead to `+(0,r.getName)()+" use English strings instead."})});const m={};class F{#e(e){const s=e.includes("_")?"_":e.includes("-")?"-":null;return s===null?[e,e.toLowerCase()+"_"+e.toUpperCase(),e.toLowerCase()+"-"+e.toUpperCase(),e===e.toLowerCase()?e.toUpperCase():e.toLowerCase()]:[e,s==="-"?e.replace("-","_"):e.replace("_","-"),...e.split(s).filter(n=>n!==""),e.toUpperCase(),e.toLowerCase()]}locales=Object.freeze(this.#e((0,r.getLocale)()));searchPaths=Object.freeze([...this.locales.map(e=>(0,o.resolve)((0,r.getAppPath)(),"sources/translations",e)),...this.locales.map(e=>(0,o.resolve)((0,o.dirname)((0,r.getAppPath)()),"translations",e))]);loadFile(e){const s=m[e];if(s!==void 0)return s;let n=d[e];const i=this.searchPaths.map(p=>(0,o.resolve)(p,e+".json")).find(p=>(0,l.existsSync)(p));return process.type==="browser"&&process.platform==="win32"&&!u.app.isReady()&&console.warn(["[WARN] Electron may fail loading localized strings,","       because the app hasn't still emitted the 'ready' event!","[WARN] In this case, English strings will be used as a fallback."].join(`
`)),i!==void 0&&(console.debug("[L10N] Computing strings for locale list: "+this.locales.join(", ")),n=(0,g.typeMerge)(d[e],{},JSON.parse((0,l.readFileSync)(i).toString()))),m[e]=n}client;web;settings;constructor(){this.client=this.loadFile("client"),this.web=this.loadFile("web"),this.settings=this.loadFile("settings")}}var O=F;
