/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as t}from"tslib";import has from"../../../../../../../core/has.js";import{uniform as a,UniformGroup as e}from"../../GraphShaderModule.js";import{Sampler2D as i,Float as r,texture2D as s,int as o,float as g,mod as u,Vec2 as l,ceil as n}from"../../graph/glsl.js";import{unpackDisplayIdTexel as D}from"./utils.js";class p extends e{getVisualVariableData(t){if(!this._vvData){const a=this.getAttributeDataCoords(t);this._vvData=s(this.visualVariableData,a).setDebugName("storage2")}return this._vvData}getAttributeDataCoords(t){if(!this._uv){const a=D(t),e=this.size,i=o(a.x),r=o(a.y).multiply(o(256)),s=o(a.z).multiply(o(256)).multiply(o(256)),n=g(i.add(r).add(s)),p=u(n,e),d=n.subtract(p).divide(e);this._uv=new l(p,d).add(.5).divide(e)}return this._uv}getFilterData(t){const a=this.getAttributeDataCoords(t);return s(this.filterFlags,a).setDebugName("storage0")}getAnimationData(t){const a=this.getAttributeDataCoords(t);return s(this.animation,a).setDebugName("storage1")}getVVData(t){return this.getVisualVariableData(t)}getDataDrivenData0(t){const a=this.getAttributeDataCoords(t);return s(this.dataDriven0,a).setDebugName("storage30")}getDataDrivenData1(t){const a=this.getAttributeDataCoords(t);return s(this.dataDriven1,a).setDebugName("storage31")}getDataDrivenData2(t){const a=this.getAttributeDataCoords(t);return s(this.dataDriven2,a).setDebugName("storage32")}getGPGPUData(t){const a=this.getAttributeDataCoords(t);return s(this.gpgpu,a).setDebugName("storage4")}getLocalTimeOrigin(t){const a=this.getAttributeDataCoords(t);return s(this.localTimeOrigin,a).x.setDebugName("storage5")}getFilterFlags(t){return has("webgl-ignores-sampler-precision")?n(this.getFilterData(t).x.multiply(g(255))):this.getFilterData(t).x.multiply(g(255))}getLabelVisibility(t){const a=this.getFilterData(t).y.multiply(255);return new r(1).subtract(a)}getAnimationValue(t){return this.getAnimationData(t).x}getSizeValue(t){return this.getVisualVariableData(t).x}getColorValue(t){return this.getVisualVariableData(t).y}getOpacityValue(t){return this.getVisualVariableData(t).z}getRotationValue(t){return this.getVisualVariableData(t).w}}t([a(i)],p.prototype,"filterFlags",void 0),t([a(i)],p.prototype,"animation",void 0),t([a(i)],p.prototype,"gpgpu",void 0),t([a(i)],p.prototype,"localTimeOrigin",void 0),t([a(i)],p.prototype,"visualVariableData",void 0),t([a(i)],p.prototype,"dataDriven0",void 0),t([a(i)],p.prototype,"dataDriven1",void 0),t([a(i)],p.prototype,"dataDriven2",void 0),t([a(r)],p.prototype,"size",void 0);export{p as EntityStorage};
