import"../root/root-legacy.js";import"../platform/platform.js";import"../common/common-legacy.js";import"../text_utils/text_utils-legacy.js";import{Runtime as t}from"../root/root.js";async function o(o){console.timeStamp("Root.Runtime.startApplication");const e={};for(let t=0;t<Root.allDescriptors.length;++t){const o=Root.allDescriptors[t];e[o.name]=o}const r=Root.applicationDescriptor.modules,s=[],i=[];for(let t=0;t<r.length;++t){const o=r[t],n=o.name;s.push(e[n]),"autostart"===o.type&&i.push(n)}for(let t=0;t<s.length;++t)s[t].name=r[t].name,s[t].condition=r[t].condition;const n=t.Runtime.instance({forceNew:!0,moduleDescriptors:s});self.runtime=n,i&&await n.loadAutoStartModules(i),t.appStartedPromiseCallback()}self.Runtime=self.Runtime||{},Runtime=Runtime||{},Root.allDescriptors=Root.allDescriptors||[],Root.applicationDescriptor=Root.applicationDescriptor||void 0;var e=Object.freeze({__proto__:null,startApplication:o,startWorker:async function(t){return o().then((function(){self.postMessage("workerReady")}))}});export{e as RuntimeInstantiator};
