import{u as e,aU as c}from"./rpcWorker-CVTx5FIM.js";async function s(t){const{rpcSessionId:r}=e.getContainingTrack(t),{rpcManager:o}=e.getSession(t),n=e.getContainingView(t);if(!n.initialized||t.error||!t.statsReadyAndRegionNotTooLarge)return;t.setLoading(!0);const a=await o.call(r,"PileupGetReducedFeatures",{sessionId:r,regions:n.staticBlocks.contentBlocks,filterBy:t.filterBy,adapterConfig:t.adapterConfig});t.setChainData(a),t.setLoading(!1)}function d(t,r){c(t,async()=>{await s(t)},{delay:1e3});function o(n){const a=t.ref;if(!a)return;const i=a.getContext("2d");i&&t.chainData&&(i.clearRect(0,0,a.width,t.height*2),i.resetTransform(),i.scale(2,2),r(t,i,a.width,t.height),t.setLastDrawnOffsetPx(n.offsetPx),t.setLastDrawnBpPerPx(n.bpPerPx))}c(t,async()=>{const n=e.getContainingView(t);n.bpPerPx!==t.lastDrawnBpPerPx&&o(n)}),c(t,async()=>{const n=e.getContainingView(t);o(n)},{delay:1e3})}export{d as doAfterAttach};
