var h=Object.defineProperty;var t=(e,r)=>{for(var o in r)h(e,o,{get:r[o],enumerable:!0})};var u={};t(u,{setup:()=>l});import*as i from"./../../legacy/theme_support/theme_support.js";async function l(){let e={get(){return"default"},addChangeListener:()=>{}};i.ThemeSupport.instance({forceNew:!0,setting:e})}var c={};t(c,{getRootNode:()=>m});function m(e){let r=e.getRootNode();if(!(r instanceof Document||r instanceof ShadowRoot))throw new Error(`Expected root of widget to be a document or shadowRoot, but was "${r.nodeName}"`);return r}var p={};t(p,{isScheduledRender:()=>R,scheduleRender:()=>w});import*as f from"./../render_coordinator/render_coordinator.js";var n=new Map,d=new Set;function w(e,r){let o=n.get(e);if(o!==void 0){if(o.callback!==r)throw new TypeError(`Incompatible callback arguments for scheduling rendering of ${e.nodeName.toLowerCase()}`);return o.promise}let a=f.write(async()=>{try{d.add(e),n.delete(e),await r.call(e)}catch(s){throw console.error(`ScheduledRender: rendering ${e.nodeName.toLowerCase()}:`),console.error(s),s}finally{d.delete(e)}});return n.set(e,{callback:r,promise:a}),a}function R(e){return d.has(e)}export{u as ComponentServerSetup,c as GetRootNode,p as ScheduledRender};
//# sourceMappingURL=helpers.js.map
