import{eH as f,eI as h,aW as b,eJ as S,eK as V,aj as z}from"./index-b5c8f851.js";import{j as _}from"./AttributeStoreView-b12ba31a.js";import{i as y}from"./TileContainer-1c596b67.js";import{z as p,$ as m}from"./color-0916c686.js";import{t as R,b as I}from"./WGLContainer-21aabd6b.js";function d(v,e){const t=e.length;if(v{let s=1/0,i=0;for(const a in t.levels){const l=parseFloat(a),u=Math.abs(e-l);uthis.onAttributeStoreUpdate())}destroy(){this.children.forEach(e=>e.destroy()),this.removeAllChildren(),this.attributeView.destroy(),this._materialItemsRequestQueue.clear()}setRendererInfo(e,t,s){this._rendererInfo.setInfo(e,t,s),this.requestRender()}async getMaterialItems(e,t){if(!e||e.length===0)return[];const s=z();return this._materialItemsRequestQueue.push({items:e,abortOptions:t,resolver:s}),this.requestRender(),s.promise}doRender(e){if(e.context.capabilities.enable("textureFloat"),e.context.capabilities.enable("vao"),this._materialItemsRequestQueue.length>0){let t=this._materialItemsRequestQueue.pop();for(;t;)this._processMaterialItemRequest(e,t),t=this._materialItemsRequestQueue.pop()}super.doRender(e)}renderChildren(e){for(const t of this.children)t.commit(e);this._rendererInfo.update(e.state),super.renderChildren(e)}createRenderParams(e){const t=super.createRenderParams(e);return t.rendererInfo=this._rendererInfo,t.attributeView=this.attributeView,t}onAttributeStoreUpdate(){}_processMaterialItemRequest(e,{items:t,abortOptions:s,resolver:i}){const{painter:r,pixelRatio:o}=e,n=t.map(a=>r.textureManager.rasterizeItem(a.symbol,o,a.glyphIds,s));Promise.all(n).then(a=>{if(!this.stage)return void i.reject();const l=a.map((u,c)=>({id:t[c].id,mosaicItem:u}));i.resolve(l)},i.reject)}}export{M as o};