define(["exports","./buildModuleUrl-8cce5713","./Cartesian4-b0ddc4ba","./Check-7b2a090c","./when-b60132fc","./Math-31e539c2"],(function(t,o,a,n,e,r){"use strict";var c=1/256,i={octEncodeInRange:function(t,o,a){if(a.x=t.x/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),a.y=t.y/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),t.z<0){var n=a.x,e=a.y;a.x=(1-Math.abs(e))*r.Math3D.signNotZero(n),a.y=(1-Math.abs(n))*r.Math3D.signNotZero(e)}return a.x=r.Math3D.toSNorm(a.x,o),a.y=r.Math3D.toSNorm(a.y,o),a},octEncode:function(t,o){return i.octEncodeInRange(t,255,o)}},u=new o.Cartesian2,s=new Uint8Array(1);function h(t){return s[0]=t,s[0]}i.octEncodeToCartesian4=function(t,o){return i.octEncodeInRange(t,65535,u),o.x=h(u.x*c),o.y=h(u.x),o.z=h(u.y*c),o.w=h(u.y),o},i.octDecodeInRange=function(t,o,n,e){if(e.x=r.Math3D.fromSNorm(t,n),e.y=r.Math3D.fromSNorm(o,n),e.z=1-(Math.abs(e.x)+Math.abs(e.y)),e.z<0){var c=e.x;e.x=(1-Math.abs(e.y))*r.Math3D.signNotZero(c),e.y=(1-Math.abs(c))*r.Math3D.signNotZero(e.y)}return a.Cartesian3.normalize(e,e)},i.octDecode=function(t,o,a){return i.octDecodeInRange(t,o,255,a)},i.octDecodeFromCartesian4=function(t,o){var a=256*t.x+t.y,n=256*t.z+t.w;return i.octDecodeInRange(a,n,65535,o)},i.octPackFloat=function(t){return 256*t.x+t.y};var d=new o.Cartesian2;function f(t){return t>>1^-(1&t)}i.octEncodeFloat=function(t){return i.octEncode(t,d),i.octPackFloat(d)},i.octDecodeFloat=function(t,o){var a=t/256,n=Math.floor(a),e=256*(a-n);return i.octDecode(n,e,o)},i.octPack=function(t,o,a,n){var e=i.octEncodeFloat(t),r=i.octEncodeFloat(o),c=i.octEncode(a,d);return n.x=65536*c.x+e,n.y=65536*c.y+r,n},i.octUnpack=function(t,o,a,n){var e=t.x/65536,r=Math.floor(e),c=65536*(e-r);e=t.y/65536;var u=Math.floor(e),s=65536*(e-u);i.octDecodeFloat(c,o),i.octDecodeFloat(s,a),i.octDecode(r,u,n)},i.compressTextureCoordinates=function(t){return 4096*(4095*t.x|0)+(4095*t.y|0)},i.decompressTextureCoordinates=function(t,o){var a=t/4096,n=Math.floor(a);return o.x=n/4095,o.y=(t-4096*n)/4095,o},i.zigZagDeltaDecode=function(t,o,a){for(var n=t.length,r=0,c=0,i=0,u=0;u<n;++u)r+=f(t[u]),c+=f(o[u]),t[u]=r,o[u]=c,e.defined(a)&&(i+=f(a[u]),a[u]=i)},i.octShortToFloat=function(t){return r.Math3D.clamp(3051850947599719e-20*t,-1,1)},i.octShortDecode=function(t,o,e){if(n.Check.defined("result",e),e.x=i.octShortToFloat(t),e.y=i.octShortToFloat(o),e.z=1-(Math.abs(e.x)+Math.abs(e.y)),e.z<0){var c=e.x;e.x=(1-Math.abs(e.y))*r.Math3D.signNotZero(c),e.y=(1-Math.abs(c))*r.Math3D.signNotZero(e.y)}return a.Cartesian3.normalize(e,e)},t.AttributeCompression=i}));
