var h=Object.create;var w=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var W=(o,e)=>{for(var s in e)w(o,s,{get:e[s],enumerable:!0})},a=(o,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of g(e))!B.call(o,n)&&n!==s&&w(o,n,{get:()=>e[n],enumerable:!(r=C(e,n))||r.enumerable});return o};var v=(o,e,s)=>(s=o!=null?h(y(o)):{},a(e||!o||!o.__esModule?w(s,"default",{value:o,enumerable:!0}):s,o)),E=o=>a(w({},"__esModule",{value:!0}),o);var k={};W(k,{initWindow:()=>P});module.exports=E(k);var i=require("electron/main"),f=v(require("../../common/modules/l10n")),l=require("../../common/modules/client"),d=require("path"),p=require("deepmerge-ts"),c=require("./extensions"),m=require("./error"),u=require("../../common/global");function P(o,e,s){const r=o=="invite";if(!i.app.isReady())throw new Error("Tried to initialize a new parent window when app is not ready!");const n=r?i.session.defaultSession:i.session.fromPartition("temp:"+o);for(const b of e.getChildWindows())if(b.webContents.session===n)return;e.isVisible()||e.show();const t=new i.BrowserWindow((0,p.deepmerge)({title:i.app.getName()+" \u2013 "+new f.default().client.windows[o],show:!1,parent:e,backgroundColor:l.appInfo.backgroundColor,webPreferences:{session:n,nodeIntegration:!1,contextIsolation:!0,sandbox:!1,enableWebSQL:!1,webgl:!1,autoplayPolicy:"user-gesture-required",defaultFontFamily:u.fonts,...r?{}:{preload:(0,d.resolve)(i.app.getAppPath(),"app/code/renderer/preload/"+o+".js")}},...process.platform!=="win32"?{icon:l.appInfo.icons.app}:{}},s??{}));if(t.webContents.session===e.webContents.session&&!r)throw new Error("Child took session from parent!");return r&&(t.removeMenu(),t.webContents.on("did-navigate",()=>{c.styles.load(t.webContents).catch(m.commonCatches.throw)})),t.once("closed",()=>t.removeAllListeners()),t.setAutoHideMenuBar(!0),t.setMenuBarVisibility(!1),(0,l.getBuildInfo)().type==="release"&&t.removeMenu(),r||t.loadFile((0,d.resolve)(i.app.getAppPath(),"sources/assets/web/html/"+o+".html")),setTimeout(()=>{!t.isDestroyed()&&!t.isVisible()&&t.show()},1e4),t}0&&(module.exports={initWindow});
