import*as Root from"../../root/root.js";import*as ThemeSupport from"../../theme_support/theme_support.js";export function appendStyle(e,t,o={enableLegacyPatching:!1}){const n=Root.Runtime.cachedResources.get(t)||"";n||console.error(t+" not preloaded. Check module.json");let r=document.createElement("style");if(r.textContent=n,e.appendChild(r),o.enableLegacyPatching){const o=ThemeSupport.ThemeSupport.instance().themeStyleSheet(t,n);o&&(r=document.createElement("style"),r.textContent=o+"\n"+Root.Runtime.Runtime.resolveSourceURL(t+".theme"),e.appendChild(r))}}