/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{isForeverZero as e,getEndValue as t}from"./animatedValues.js";import s from"../webgl/WGLContainer.js";import{Techniques as r}from"../webgl/shaderGraph/techniques/TechniqueRegistry.js";class i extends s{constructor(){super(...arguments),this.flowStyle=null}renderChildren(e){if(super.renderChildren(e),this.visible&&1===e.drawPhase)for(const t of this.children)this._renderDisplayObject(e,t)}_renderDisplayObject(s,i){const{requestRender:a}=s,n=[];for(const o of i.items){o.attached||(o.resources.attach({context:s.context}),o.attached=!0);const c=s.time/1e3;(s.animationsEnabled?e(o.displayOpacity,c)||c>o.endTime+o.style.slideoutDuration:0===t(o.displayOpacity))?o.attached&&(o.resources.detach(),o.attached=!1):(n.push(o),i.updateMatrix(s.state,o.resources.query),r.flow.render(s,{item:o,dvsMat3:i.transforms.displayViewScreenMat3}),o.style.animated&&null!=a&&s.animationsEnabled&&a())}i.items.splice(0,i.items.length,...n)}getFlowResources(e,t=!1){const s=this.children.filter(e=>e.visible).flatMap(e=>e.items.map(e=>e.resources)).find(t=>t.query.extent.contains(e));return s&&t&&"stack"===s.kind?s.resources.find(e=>"imagery"!==e.kind&&"stack"!==e.kind):s}}export{i as default};
