text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See http://js.arcgis.com/3.24/esri/copyright.txt for details.
  //>>built
  define("esri/layers/vectorTiles/views/2d/tiling/LODInfo",["require","exports","../../../geometry/support/spatialReferenceUtils","./TileKey"],function(r,t,p,q){function l(c,a,d){c[0]=a;c[1]=d;return c}var b=new q("0/0/0/0");return function(){function c(a,d,c,e,b,f,h,k,m,n,l,p){this.level=a;this.resolution=d;this.scale=c;this.origin=e;this.first=b;this.last=f;this.size=h;this.norm=k;this.worldStart=m;this.worldEnd=n;this.worldSize=l;this.wrap=p}c.create=function(a,d,b){var e=p.getInfo(a.spatialReference),
  g=[a.origin.x,a.origin.y],f=[a.size[0]*d.resolution,a.size[1]*d.resolution],h=[-Infinity,-Infinity],k=[Infinity,Infinity],m=[Infinity,Infinity];b&&(l(h,Math.max(0,Math.floor((b.xmin-g[0])/f[0])),Math.max(0,Math.floor((g[1]-b.ymax)/f[1]))),l(k,Math.max(0,Math.floor((b.xmax-g[0])/f[0])),Math.max(0,Math.floor((g[1]-b.ymin)/f[1]))),l(m,k[0]-h[0]+1,k[1]-h[1]+1));var n;a.isWrappable?(a=[Math.ceil(Math.round(2*e.origin[1]/d.resolution)/a.size[0]),m[1]],e=[Math.floor((e.origin[0]-g[0])/f[0]),h[1]],b=[a[0]+
  e[0]-1,k[1]],n=!0):(e=h,b=k,a=m,n=!1);return new c(d.level,d.resolution,d.scale,g,h,k,m,f,e,b,a,n)};c.prototype.normalizeCol=function(a){if(!this.wrap)return a;var b=this.worldSize[0];return 0>a?b-1-Math.abs((a+1)%b):a%b};c.prototype.denormalizeCol=function(a,b){return this.wrap?this.worldSize[0]*b+a:a};c.prototype.getWorldForColumn=function(a){return this.wrap?Math.floor(a/this.worldSize[0]):0};c.prototype.getFirstColumnForWorld=function(a){return a*this.worldSize[0]+this.first[0]};c.prototype.getLastColumnForWorld=
  function(a){return a*this.worldSize[0]+this.first[0]+this.size[0]-1};c.prototype.getColumnForX=function(a){return(a-this.origin[0])/this.norm[0]};c.prototype.getXForColumn=function(a){return this.origin[0]+a*this.norm[0]};c.prototype.getRowForY=function(a){return(this.origin[1]-a)/this.norm[1]};c.prototype.getYForRow=function(a){return this.origin[1]-a*this.norm[1]};c.prototype.getTileBounds=function(a,c){b.set(c);var d=this.denormalizeCol(b.col,b.world),e=b.row,g=this.getXForColumn(d),f=this.getYForRow(e+
  1),d=this.getXForColumn(d+1),e=this.getYForRow(e);a[0]=g;a[1]=f;a[2]=d;a[3]=e;return a};c.prototype.getTileCoords=function(a,c){b.set(c);Array.isArray(a)?l(a,this.getXForColumn(this.denormalizeCol(b.col,b.world)),this.getYForRow(b.row)):(a.x=this.getXForColumn(this.denormalizeCol(b.col,b.world)),a.y=this.getYForRow(b.row));return a};return c}()});