@doegis/core
Version:
DOE GIS API
1 lines • 286 kB
JavaScript
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9717],{22303:(t,e,i)=>{i.d(e,{Z:()=>f});var s,r,n=i(35270),o=i(22021),a=i(70586),h=i(75215);function l(t){return(0,o.uZ)((0,h.vU)(t),0,255)}function c(t,e,i){return t=Number(t),isNaN(t)?i:t<e?e:t>i?i:t}class u{static blendColors(t,e,i,s=new u){return s.r=Math.round(t.r+(e.r-t.r)*i),s.g=Math.round(t.g+(e.g-t.g)*i),s.b=Math.round(t.b+(e.b-t.b)*i),s.a=t.a+(e.a-t.a)*i,s._sanitize()}static fromRgb(t,e){const i=t.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(i){const t=i[2].split(/\s*,\s*/),s=i[1];if("rgb"===s&&3===t.length||"rgba"===s&&4===t.length){const i=t[0];if("%"===i.charAt(i.length-1)){const i=t.map((t=>2.56*parseFloat(t)));return 4===t.length&&(i[3]=parseFloat(t[3])),u.fromArray(i,e)}return u.fromArray(t.map((t=>parseFloat(t))),e)}if("hsl"===s&&3===t.length||"hsla"===s&&4===t.length)return u.fromArray((0,n.B7)(parseFloat(t[0]),parseFloat(t[1])/100,parseFloat(t[2])/100,parseFloat(t[3])),e)}return null}static fromHex(t,e=new u){if(4!==t.length&&7!==t.length||"#"!==t[0])return null;const i=4===t.length?4:8,s=(1<<i)-1;let r=Number("0x"+t.substr(1));return isNaN(r)?null:(["b","g","r"].forEach((t=>{const n=r&s;r>>=i,e[t]=4===i?17*n:n})),e.a=1,e)}static fromArray(t,e=new u){return e._set(Number(t[0]),Number(t[1]),Number(t[2]),Number(t[3])),isNaN(e.a)&&(e.a=1),e._sanitize()}static fromString(t,e){const i=(0,n.St)(t)?(0,n.h$)(t):null;return i&&u.fromArray(i,e)||u.fromRgb(t,e)||u.fromHex(t,e)}static fromJSON(t){return t&&new u([t[0],t[1],t[2],t[3]/255])}static toUnitRGB(t){return(0,a.pC)(t)?[t.r/255,t.g/255,t.b/255]:null}static toUnitRGBA(t){return(0,a.pC)(t)?[t.r/255,t.g/255,t.b/255,null!=t.a?t.a:1]:null}constructor(t){this.r=255,this.g=255,this.b=255,this.a=1,t&&this.setColor(t)}get isBright(){return.299*this.r+.587*this.g+.114*this.b>=127}setColor(t){return"string"==typeof t?u.fromString(t,this):Array.isArray(t)?u.fromArray(t,this):(this._set(t.r??0,t.g??0,t.b??0,t.a??1),t instanceof u||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(){const t=this.r.toString(16),e=this.g.toString(16),i=this.b.toString(16);return`#${t.length<2?"0"+t:t}${e.length<2?"0"+e:e}${i.length<2?"0"+i:i}`}toCss(t=!1){const e=this.r+", "+this.g+", "+this.b;return t?`rgba(${e}, ${this.a})`:`rgb(${e})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(t=u.AlphaMode.ALWAYS){const e=l(this.r),i=l(this.g),s=l(this.b);return t===u.AlphaMode.ALWAYS||1!==this.a?[e,i,s,l(255*this.a)]:[e,i,s]}clone(){return new u(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(t){return(0,a.pC)(t)&&t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}_sanitize(){return this.r=Math.round(c(this.r,0,255)),this.g=Math.round(c(this.g,0,255)),this.b=Math.round(c(this.b,0,255)),this.a=c(this.a,0,1),this}_set(t,e,i,s){this.r=t,this.g=e,this.b=i,this.a=s}}u.prototype.declaredClass="esri.Color",s=u||(u={}),(r=s.AlphaMode||(s.AlphaMode={}))[r.ALWAYS=0]="ALWAYS",r[r.UNLESS_OPAQUE=1]="UNLESS_OPAQUE";const f=u},4307:(t,e,i)=>{i.d(e,{d:()=>h,l:()=>f,r:()=>m,s:()=>r,t:()=>_});var s=i(46851);function r(t,e,i){return t[0]=e,t[1]=i,t}function n(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function o(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t}function a(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t}function h(t,e){const i=e[0]-t[0],s=e[1]-t[1];return Math.sqrt(i*i+s*s)}function l(t,e){const i=e[0]-t[0],s=e[1]-t[1];return i*i+s*s}function c(t){const e=t[0],i=t[1];return Math.sqrt(e*e+i*i)}function u(t){const e=t[0],i=t[1];return e*e+i*i}function f(t,e,i,s){const r=e[0],n=e[1];return t[0]=r+s*(i[0]-r),t[1]=n+s*(i[1]-n),t}function _(t,e,i){const s=e[0],r=e[1];return t[0]=i[0]*s+i[2]*r+i[4],t[1]=i[1]*s+i[3]*r+i[5],t}function m(t,e,i,s){const r=e[0]-i[0],n=e[1]-i[1],o=Math.sin(s),a=Math.cos(s);return t[0]=r*a-n*o+i[0],t[1]=r*o+n*a+i[1],t}const d=c,p=n,g=o,y=a,x=h,b=l,M=u;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},angle:function(t,e){const i=t[0],s=t[1],r=e[0],n=e[1];let o=i*i+s*s;o>0&&(o=1/Math.sqrt(o));let a=r*r+n*n;a>0&&(a=1/Math.sqrt(a));const h=(i*r+s*n)*o*a;return h>1?0:h<-1?Math.PI:Math.acos(h)},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},cross:function(t,e,i){const s=e[0]*i[1]-e[1]*i[0];return t[0]=t[1]=0,t[2]=s,t},dist:x,distance:h,div:y,divide:a,dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},equals:function(t,e){const i=t[0],r=t[1],n=e[0],o=e[1],a=(0,s.g)();return Math.abs(i-n)<=a*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-o)<=a*Math.max(1,Math.abs(r),Math.abs(o))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},len:d,length:c,lerp:f,max:function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t},min:function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t},mul:g,multiply:o,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},normalize:function(t,e){const i=e[0],s=e[1];let r=i*i+s*s;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},projectAndScale:function(t,e,i,s,r){let n=e[0]-i[0],o=e[1]-i[1];const a=(s[0]*n+s[1]*o)*(r-1);return n=s[0]*a,o=s[1]*a,t[0]=e[0]+n,t[1]=e[1]+o,t},random:function(t,e){e=e||1;const i=2*(0,s.R)()*Math.PI;return t[0]=Math.cos(i)*e,t[1]=Math.sin(i)*e,t},rotate:m,round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},scale:function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},scaleAndAdd:function(t,e,i,s){return t[0]=e[0]+i[0]*s,t[1]=e[1]+i[1]*s,t},set:r,sqrDist:b,sqrLen:M,squaredDistance:l,squaredLength:u,str:function(t){return"vec2("+t[0]+", "+t[1]+")"},sub:p,subtract:n,transformMat2:function(t,e,i){const s=e[0],r=e[1];return t[0]=i[0]*s+i[2]*r,t[1]=i[1]*s+i[3]*r,t},transformMat2d:_,transformMat3:function(t,e,i){const s=e[0],r=e[1];return t[0]=i[0]*s+i[3]*r+i[6],t[1]=i[1]*s+i[4]*r+i[7],t},transformMat4:function(t,e,i){const s=e[0],r=e[1];return t[0]=i[0]*s+i[4]*r+i[12],t[1]=i[1]*s+i[5]*r+i[13],t}},Symbol.toStringTag,{value:"Module"}))},1265:(t,e,i)=>{function s(){return new Float32Array(2)}function r(t,e){const i=new Float32Array(2);return i[0]=t,i[1]=e,i}function n(){return s()}function o(){return r(1,1)}function a(){return r(1,0)}function h(){return r(0,1)}i.d(e,{O:()=>c,Z:()=>l,c:()=>s,f:()=>r});const l=n(),c=o(),u=a(),f=h();Object.freeze(Object.defineProperty({__proto__:null,ONES:c,UNIT_X:u,UNIT_Y:f,ZEROS:l,clone:function(t){const e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e},create:s,createView:function(t,e){return new Float32Array(t,e,2)},fromValues:r,ones:o,unitX:a,unitY:h,zeros:n},Symbol.toStringTag,{value:"Module"}))},13867:(t,e,i)=>{i.d(e,{Z:()=>r});var s=i(69801);class r{constructor(t,e){this._storage=new s.WJ,this._storage.maxSize=t,e&&this._storage.registerRemoveFunc("",e)}put(t,e,i){this._storage.put(t,e,i,1)}pop(t){return this._storage.pop(t)}get(t){return this._storage.get(t)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}get maxSize(){return this._storage.maxSize}set maxSize(t){this._storage.maxSize=t}}},32243:(t,e,i)=>{function s(t){return t=t||globalThis.location.hostname,l.some((e=>null!=t?.match(e)))}function r(t,e){return t&&(e=e||globalThis.location.hostname)?null!=e.match(n)||null!=e.match(a)?t.replace("static.arcgis.com","staticdev.arcgis.com"):null!=e.match(o)||null!=e.match(h)?t.replace("static.arcgis.com","staticqa.arcgis.com"):t:t}i.d(e,{XO:()=>s,pJ:()=>r});const n=/^devext.arcgis.com$/,o=/^qaext.arcgis.com$/,a=/^[\w-]*\.mapsdevext.arcgis.com$/,h=/^[\w-]*\.mapsqa.arcgis.com$/,l=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,o,/^jsapps.esri.com$/,a,h]},62357:(t,e,i)=>{i.d(e,{F2:()=>r,Wz:()=>n,t_:()=>o,vW:()=>a});const s=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i;function r(t){return t?t/72*96:0}function n(t){return t?72*t/96:0}function o(t){if("string"==typeof t){const e=t.match(s);if(e){const i=Number(e[1]),s=e[3]&&e[3].toLowerCase(),r="-"===t.charAt(0),o="px"===s?n(i):i;return r?-o:o}return console.warn("screenUtils.toPt: input not recognized!"),null}return t}function a(t=0,e=0){return{x:t,y:e}}},59255:(t,e,i)=>{var s,r,n;i.d(e,{E9:()=>o,I6:()=>l,Vl:()=>s,bN:()=>h}),(n=s||(s={}))[n.Unknown=0]="Unknown",n[n.Point=1]="Point",n[n.LineString=2]="LineString",n[n.Polygon=3]="Polygon";class o{constructor(t,e){this.x=t,this.y=e}clone(){return new o(this.x,this.y)}equals(t,e){return t===this.x&&e===this.y}isEqual(t){return t.x===this.x&&t.y===this.y}setCoords(t,e){this.x=t,this.y=e}normalize(){const t=this.x,e=this.y,i=Math.sqrt(t*t+e*e);this.x/=i,this.y/=i}rightPerpendicular(){const t=this.x;this.x=this.y,this.y=-t}move(t,e){this.x+=t,this.y+=e}assign(t){this.x=t.x,this.y=t.y}assignAdd(t,e){this.x=t.x+e.x,this.y=t.y+e.y}assignSub(t,e){this.x=t.x-e.x,this.y=t.y-e.y}rotate(t,e){const i=this.x,s=this.y;this.x=i*t-s*e,this.y=i*e+s*t}scale(t){this.x*=t,this.y*=t}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}static distance(t,e){const i=e.x-t.x,s=e.y-t.y;return Math.sqrt(i*i+s*s)}static add(t,e){return new o(t.x+e.x,t.y+e.y)}static sub(t,e){return new o(t.x-e.x,t.y-e.y)}}class a{constructor(t,e,i){this.ratio=t,this.x=e,this.y=i}}class h{constructor(t,e,i,s=8,r=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=s,this._pixelMargin=r,this._tileSize=512*s,this._dz=t,this._yPos=e,this._xPos=i}setPixelMargin(t){t!==this._pixelMargin&&(this._pixelMargin=t,this.setExtent(this._extent))}setExtent(t){this._extent=t,this._finalRatio=this._tileSize/t*(1<<this._dz);let e=this._pixelRatio*this._pixelMargin;e/=this._finalRatio;const i=t>>this._dz;e>i&&(e=i),this._margin=e,this._xmin=i*this._xPos-e,this._ymin=i*this._yPos-e,this._xmax=this._xmin+i+2*e,this._ymax=this._ymin+i+2*e}reset(t){this._type=t,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,e){this._pushLine(),this._prevIsIn=this._isIn(t,e),this._moveTo(t,e,this._prevIsIn),this._prevPt=new o(t,e),this._firstPt=new o(t,e),this._dist=0}lineTo(t,e){const i=this._isIn(t,e),s=new o(t,e),r=o.distance(this._prevPt,s);let n,h,l,c,u,f,_,m;if(i)this._prevIsIn?this._lineTo(t,e,!0):(n=this._prevPt,h=s,l=this._intersect(h,n),this._start=this._dist+r*(1-this._r),this._lineTo(l.x,l.y,!0),this._lineTo(h.x,h.y,!0));else if(this._prevIsIn)h=this._prevPt,n=s,l=this._intersect(h,n),this._lineTo(l.x,l.y,!0),this._lineTo(n.x,n.y,!1);else{const t=this._prevPt,e=s;if(t.x<=this._xmin&&e.x<=this._xmin||t.x>=this._xmax&&e.x>=this._xmax||t.y<=this._ymin&&e.y<=this._ymin||t.y>=this._ymax&&e.y>=this._ymax)this._lineTo(e.x,e.y,!1);else{const i=[];if((t.x<this._xmin&&e.x>this._xmin||t.x>this._xmin&&e.x<this._xmin)&&(c=(this._xmin-t.x)/(e.x-t.x),m=t.y+c*(e.y-t.y),m<=this._ymin?f=!1:m>=this._ymax?f=!0:i.push(new a(c,this._xmin,m))),(t.x<this._xmax&&e.x>this._xmax||t.x>this._xmax&&e.x<this._xmax)&&(c=(this._xmax-t.x)/(e.x-t.x),m=t.y+c*(e.y-t.y),m<=this._ymin?f=!1:m>=this._ymax?f=!0:i.push(new a(c,this._xmax,m))),(t.y<this._ymin&&e.y>this._ymin||t.y>this._ymin&&e.y<this._ymin)&&(c=(this._ymin-t.y)/(e.y-t.y),_=t.x+c*(e.x-t.x),_<=this._xmin?u=!1:_>=this._xmax?u=!0:i.push(new a(c,_,this._ymin))),(t.y<this._ymax&&e.y>this._ymax||t.y>this._ymax&&e.y<this._ymax)&&(c=(this._ymax-t.y)/(e.y-t.y),_=t.x+c*(e.x-t.x),_<=this._xmin?u=!1:_>=this._xmax?u=!0:i.push(new a(c,_,this._ymax))),0===i.length)u?f?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):f?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(i.length>1&&i[0].ratio>i[1].ratio)this._start=this._dist+r*i[1].ratio,this._lineTo(i[1].x,i[1].y,!0),this._lineTo(i[0].x,i[0].y,!0);else{this._start=this._dist+r*i[0].ratio;for(let t=0;t<i.length;t++)this._lineTo(i[t].x,i[t].y,!0)}this._lineTo(e.x,e.y,!1)}}this._dist+=r,this._prevIsIn=i,this._prevPt=s}close(){if(this._line.length>2){const t=this._firstPt,e=this._prevPt;t.x===e.x&&t.y===e.y||this.lineTo(t.x,t.y);const i=this._line;let s=i.length;for(;s>=4&&(i[0].x===i[1].x&&i[0].x===i[s-2].x||i[0].y===i[1].y&&i[0].y===i[s-2].y);)i.pop(),i[0].x=i[s-2].x,i[0].y=i[s-2].y,--s}}result(t=!0){return this._pushLine(),0===this._lines.length?null:(this._type===s.Polygon&&t&&c.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==s.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,e=t.length;if(0===e)return null;const i=[];for(let s=0;s<e;s++)i.push({line:t[s],start:this._starts[s]||0});return i}_isIn(t,e){return t>=this._xmin&&t<=this._xmax&&e>=this._ymin&&e<=this._ymax}_intersect(t,e){let i,s,r;if(e.x>=this._xmin&&e.x<=this._xmax)s=e.y<=this._ymin?this._ymin:this._ymax,r=(s-t.y)/(e.y-t.y),i=t.x+r*(e.x-t.x);else if(e.y>=this._ymin&&e.y<=this._ymax)i=e.x<=this._xmin?this._xmin:this._xmax,r=(i-t.x)/(e.x-t.x),s=t.y+r*(e.y-t.y);else{s=e.y<=this._ymin?this._ymin:this._ymax,i=e.x<=this._xmin?this._xmin:this._xmax;const n=(i-t.x)/(e.x-t.x),o=(s-t.y)/(e.y-t.y);n<o?(r=n,s=t.y+n*(e.y-t.y)):(r=o,i=t.x+o*(e.x-t.x))}return this._r=r,new o(i,s)}_pushLine(){this._line&&(this._type===s.Point?this._line.length>0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===s.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===s.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,e,i){this._type!==s.Polygon?i&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),e=Math.round((e-(this._ymin+this._margin))*this._finalRatio),this._line.push(new o(t,e))):(i||(t<this._xmin&&(t=this._xmin),t>this._xmax&&(t=this._xmax),e<this._ymin&&(e=this._ymin),e>this._ymax&&(e=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),e=Math.round((e-(this._ymin+this._margin))*this._finalRatio),this._line.push(new o(t,e)),this._isH=!1,this._isV=!1)}_lineTo(t,e,i){let r,n;if(this._type!==s.Polygon)if(i){if(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),e=Math.round((e-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(r=this._line[this._line.length-1],r.equals(t,e)))return;this._line.push(new o(t,e))}else this._line&&this._line.length>0&&this._pushLine();else if(i||(t<this._xmin&&(t=this._xmin),t>this._xmax&&(t=this._xmax),e<this._ymin&&(e=this._ymin),e>this._ymax&&(e=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),e=Math.round((e-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){r=this._line[this._line.length-1];const i=r.x===t,s=r.y===e;if(i&&s)return;this._isH&&i||this._isV&&s?(r.x=t,r.y=e,n=this._line[this._line.length-2],n.x===t&&n.y===e?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(n=this._line[this._line.length-2],this._isH=n.x===t,this._isV=n.y===e)):(this._isH=n.x===t,this._isV=n.y===e)):(this._line.push(new o(t,e)),this._isH=i,this._isV=s)}else this._line.push(new o(t,e))}}class l{setExtent(t){this._ratio=4096===t?1:4096/t}get validateTessellation(){return this._ratio<1}reset(t){this._lines=[],this._line=null}moveTo(t,e){this._line&&this._lines.push(this._line),this._line=[];const i=this._ratio;this._line.push(new o(t*i,e*i))}lineTo(t,e){const i=this._ratio;this._line.push(new o(t*i,e*i))}close(){const t=this._line;t&&!t[0].isEqual(t[t.length-1])&&t.push(t[0])}result(){return this._line&&this._lines.push(this._line),0===this._lines.length?null:this._lines}}!function(t){t[t.sideLeft=0]="sideLeft",t[t.sideRight=1]="sideRight",t[t.sideTop=2]="sideTop",t[t.sideBottom=3]="sideBottom"}(r||(r={}));class c{static simplify(t,e,i){if(!i)return;const s=-e,n=t+e,o=-e,a=t+e,h=[],l=[],u=i.length;for(let t=0;t<u;++t){const e=i[t];if(!e||e.length<2)continue;let c,u=e[0];const f=e.length;for(let i=1;i<f;++i)c=e[i],u.x===c.x&&(u.x<=s&&(u.y>c.y?(h.push(t),h.push(i),h.push(r.sideLeft),h.push(-1)):(l.push(t),l.push(i),l.push(r.sideLeft),l.push(-1))),u.x>=n&&(u.y<c.y?(h.push(t),h.push(i),h.push(r.sideRight),h.push(-1)):(l.push(t),l.push(i),l.push(r.sideRight),l.push(-1)))),u.y===c.y&&(u.y<=o&&(u.x<c.x?(h.push(t),h.push(i),h.push(r.sideTop),h.push(-1)):(l.push(t),l.push(i),l.push(r.sideTop),l.push(-1))),u.y>=a&&(u.x>c.x?(h.push(t),h.push(i),h.push(r.sideBottom),h.push(-1)):(l.push(t),l.push(i),l.push(r.sideBottom),l.push(-1)))),u=c}if(0===h.length||0===l.length)return;c.fillParent(i,l,h),c.fillParent(i,h,l);const f=[];c.calcDeltas(f,l,h),c.calcDeltas(f,h,l),c.addDeltas(f,i)}static fillParent(t,e,i){const s=i.length,n=e.length;for(let o=0;o<n;o+=4){const n=e[o],a=e[o+1],h=e[o+2],l=t[n][a-1],c=t[n][a];let f=8092,_=-1;for(let e=0;e<s;e+=4){if(i[e+2]!==h)continue;const s=i[e],n=i[e+1],o=t[s][n-1],a=t[s][n];switch(h){case r.sideLeft:case r.sideRight:if(u(l.y,o.y,a.y)&&u(c.y,o.y,a.y)){const t=Math.abs(a.y-o.y);t<f&&(f=t,_=e)}break;case r.sideTop:case r.sideBottom:if(u(l.x,o.x,a.x)&&u(c.x,o.x,a.x)){const t=Math.abs(a.x-o.x);t<f&&(f=t,_=e)}}}e[o+3]=_}}static calcDeltas(t,e,i){const s=e.length;for(let r=0;r<s;r+=4){const s=[],n=c.calcDelta(r,e,i,s);t.push(e[r]),t.push(e[r+1]),t.push(e[r+2]),t.push(n)}}static calcDelta(t,e,i,s){const r=e[t+3];if(-1===r)return 0;const n=s.length;return n>1&&s[n-2]===r?0:(s.push(r),c.calcDelta(r,i,e,s)+1)}static addDeltas(t,e){const i=t.length;let s=0;for(let e=0;e<i;e+=4){const i=t[e+3];i>s&&(s=i)}for(let n=0;n<i;n+=4){const i=e[t[n]],o=t[n+1],a=s-t[n+3];switch(t[n+2]){case r.sideLeft:i[o-1].x-=a,i[o].x-=a,1===o&&(i[i.length-1].x-=a),o===i.length-1&&(i[0].x-=a);break;case r.sideRight:i[o-1].x+=a,i[o].x+=a,1===o&&(i[i.length-1].x+=a),o===i.length-1&&(i[0].x+=a);break;case r.sideTop:i[o-1].y-=a,i[o].y-=a,1===o&&(i[i.length-1].y-=a),o===i.length-1&&(i[0].y-=a);break;case r.sideBottom:i[o-1].y+=a,i[o].y+=a,1===o&&(i[i.length-1].y+=a),o===i.length-1&&(i[0].y+=a)}}}}const u=(t,e,i)=>t>=e&&t<=i||t>=i&&t<=e},72245:(t,e,i)=>{i.d(e,{K3:()=>r,Rx:()=>n});var s=i(80442);const r=()=>!!(0,s.Z)("enable-feature:force-wosr"),n=()=>!!(0,s.Z)("enable-feature:SceneLayer-editing")},27883:(t,e,i)=>{i.d(e,{EJ:()=>d,KV:()=>_,n2:()=>f,v9:()=>m,wm:()=>y});var s=i(3172),r=i(20102),n=i(70586),o=i(95330),a=i(17452),h=i(65587),l=i(41253),c=i(72245);let u={};function f(t,e,i){return t&&(0,n.pC)(t.styleUrl)?async function(t,e){try{return{data:(await d(t,e)).data,baseUrl:(0,a.Yd)(t),styleUrl:t}}catch(t){return(0,o.r9)(t),null}}(t.styleUrl,i):t&&(0,n.pC)(t.styleName)?function(t,e,i){const s=(0,n.pC)(e.portal)?e.portal:h.Z.getDefault();let o;const a=`${s.url} - ${s.user&&s.user.username} - ${t}`;return u[a]||(u[a]=function(t,e,i){return e.load(i).then((()=>{const s=new l.Z({disableExtraQuery:!0,query:`owner:${p} AND type:${g} AND typekeywords:"${t}"`});return e.queryItems(s,i)})).then((({results:e})=>{let s=null;const n=t.toLowerCase();if(e&&Array.isArray(e))for(const t of e){const e=t.typeKeywords?.some((t=>t.toLowerCase()===n));if(e&&t.type===g&&t.owner===p){s=t;break}}if(!s)throw new r.Z("symbolstyleutils:style-not-found",`The style '${t}' could not be found`,{styleName:t});return s.load(i)}))}(t,s,i).then((t=>(o=t,t.fetchData()))).then((e=>({data:e,baseUrl:o.itemUrl??"",styleName:t})))),u[a]}(t.styleName,e,i):Promise.reject(new r.Z("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function _(t){return null===t||"CIMSymbolReference"===t.type?t:{type:"CIMSymbolReference",symbol:t}}function m(t,e){if("cimRef"===e)return t.cimRef;if(t.formatInfos&&!(0,c.K3)())for(const e of t.formatInfos)if("gltf"===e.type)return e.href;return t.webRef}function d(t,e){const i={responseType:"json",query:{f:"json"},...e};return(0,s.default)((0,a.Fv)(t),i)}const p="esri_en",g="Style",y="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json"},31363:(t,e,i)=>{i.d(e,{B1:()=>s,DQ:()=>l,DT:()=>a,JJ:()=>r,Or:()=>c,_U:()=>n,k3:()=>u,sX:()=>f});const s=Number.POSITIVE_INFINITY,r=Math.PI,n=2*r,o=128/r,a=r/180,h=1/Math.LN2;function l(t,e){return(t%=e)>=0?t:t+e}function c(t){return l(t*o,256)}function u(t){return Math.log(t)*h}function f(t,e,i){return t*(1-i)+e*i}},30729:(t,e,i)=>{var s,r;function n(t){switch(t){case"left":return s.Left;case"right":return s.Right;case"center":return s.Center}}function o(t){switch(t){case"top":return r.Top;case"middle":return r.Center;case"baseline":return r.Baseline;case"bottom":return r.Bottom}}function a(t){switch(t){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[s.Right,r.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return[s.Center,r.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[s.Left,r.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[s.Right,r.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[s.Center,r.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[s.Left,r.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[s.Right,r.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[s.Center,r.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[s.Left,r.Top];default:return console.debug(`Found invalid placement type ${t}`),[s.Center,r.Center]}}function h(t){switch(t){case s.Right:return-1;case s.Center:return 0;case s.Left:return 1;default:return console.debug(`Found invalid horizontal alignment ${t}`),0}}function l(t){switch(t){case r.Top:return 1;case r.Center:return 0;case r.Bottom:case r.Baseline:return-1;default:return console.debug(`Found invalid vertical alignment ${t}`),0}}function c(t){switch(t){case"left":return s.Left;case"right":return s.Right;case"center":return s.Center}}function u(t){switch(t){case"above-along":case"below-along":case"center-along":case"esriServerLinePlacementAboveAlong":case"esriServerLinePlacementBelowAlong":case"esriServerLinePlacementCenterAlong":return!0;default:return!1}}i.d(e,{Hd:()=>c,NS:()=>u,TR:()=>r,b7:()=>o,g:()=>h,kH:()=>n,qv:()=>a,tf:()=>l}),function(t){t[t.Left=-1]="Left",t[t.Center=0]="Center",t[t.Right=1]="Right"}(s||(s={})),function(t){t[t.Top=1]="Top",t[t.Center=0]="Center",t[t.Bottom=-1]="Bottom",t[t.Baseline=2]="Baseline"}(r||(r={}))},63523:(t,e,i)=>{i.d(e,{CA:()=>l,Gq:()=>M,Xp:()=>h,a:()=>x,dk:()=>g,hF:()=>u,jj:()=>c,jy:()=>a,m2:()=>f,mE:()=>y,qr:()=>b});var s=i(20102),r=i(30729),n=i(66039);const o=Object.keys(n.mD).filter((t=>"number"==typeof n.mD[t])).reduce(((t,e)=>({...t,[e]:n.mD[e]})),{});function a(t){return t===n.mD.OUTLINE_FILL||t===n.mD.OUTLINE_FILL_SIMPLE}function h(t){return function(t){return t===n.mD.SIMPLE||t===n.mD.OUTLINE_FILL_SIMPLE}(t.symbologyType)}function l(t){return a(t.symbologyType)}function c(t,e){switch(t){case n.LW.FILL:return g.from(e);case n.LW.LINE:return x.from(e);case n.LW.MARKER:return y.from(e);case n.LW.TEXT:return b.from(e);case n.LW.LABEL:return M.from(e);default:throw new Error(`Unable to createMaterialKey for unknown geometryType ${t}`)}}function u(t){switch(f.load(t).geometryType){case n.LW.MARKER:return new y(t);case n.LW.FILL:return new g(t);case n.LW.LINE:return new x(t);case n.LW.TEXT:return new b(t);case n.LW.LABEL:return new M(t)}}class f{static load(t){const e=this.shared;return e.data=t,e}constructor(t){this._data=0,this._data=t}set data(t){this._data=t??0}get data(){return this._data}get geometryType(){return this.bits(8,11)}set geometryType(t){this.setBits(t,8,11)}get mapAligned(){return!!this.bit(20)}set mapAligned(t){this.setBit(20,t)}get sdf(){return!!this.bit(11)}set sdf(t){this.setBit(11,t??!1)}get pattern(){return!!this.bit(12)}set pattern(t){this.setBit(12,t)}get textureBinding(){return this.bits(0,8)}set textureBinding(t){this.setBits(t,0,8)}get symbologyType(){return this.bits(21,26)}set symbologyType(t){this.setBits(t,21,26)}get geometryTypeString(){switch(this.geometryType){case n.LW.FILL:return"fill";case n.LW.MARKER:return"marker";case n.LW.LINE:return"line";case n.LW.TEXT:return"text";case n.LW.LABEL:return"label";default:throw new s.Z(`Unable to handle unknown geometryType: ${this.geometryType}`)}}setBit(t,e){const i=1<<t;e?this._data|=i:this._data&=~i}bit(t){return(this._data&1<<t)>>t}setBits(t,e,i){for(let s=e,r=0;s<i;s++,r++)this.setBit(s,0!=(t&1<<r))}bits(t,e){let i=0;for(let s=t,r=0;s<e;s++,r++)i|=this.bit(s)<<r;return i}hasVV(){return!1}setVV(t,e){}getVariation(){return{mapAligned:this.mapAligned,pattern:this.pattern,sdf:this.sdf,symbologyType:{value:n.mD[this.symbologyType],options:o,namespace:"SYMBOLOGY_TYPE"}}}getVariationHash(){return this._data&~(7&this.textureBinding)}}f.shared=new f(0);const _=t=>class extends t{get vvSizeMinMaxValue(){return 0!==this.bit(16)}set vvSizeMinMaxValue(t){this.setBit(16,t)}get vvSizeScaleStops(){return 0!==this.bit(17)}set vvSizeScaleStops(t){this.setBit(17,t)}get vvSizeFieldStops(){return 0!==this.bit(18)}set vvSizeFieldStops(t){this.setBit(18,t)}get vvSizeUnitValue(){return 0!==this.bit(19)}set vvSizeUnitValue(t){this.setBit(19,t)}hasVV(){return super.hasVV()||this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}setVV(t,e){super.setVV(t,e);const i=function(t,e,i){const s=n.X.SIZE_FIELD_STOPS|n.X.SIZE_MINMAX_VALUE|n.X.SIZE_SCALE_STOPS|n.X.SIZE_UNIT_VALUE,r=(e&(n.mf.FIELD_TARGETS_OUTLINE|n.mf.MINMAX_TARGETS_OUTLINE|n.mf.SCALE_TARGETS_OUTLINE|n.mf.UNIT_TARGETS_OUTLINE))>>>4;return t===n.LW.LINE&&i.isOutline||t===n.LW.FILL&&a(i.symbologyType)?s&r:s&~r}(this.geometryType,t,e)&t;this.vvSizeMinMaxValue=!!(i&n.X.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(i&n.X.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(i&n.X.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(i&n.X.SIZE_SCALE_STOPS)}},m=t=>class extends t{get vvRotation(){return 0!==this.bit(15)}set vvRotation(t){this.setBit(15,t)}hasVV(){return super.hasVV()||this.vvRotation}setVV(t,e){super.setVV(t,e),this.vvRotation=!e.isOutline&&!!(t&n.X.ROTATION)}},d=t=>class extends t{get vvColor(){return 0!==this.bit(13)}set vvColor(t){this.setBit(13,t)}hasVV(){return super.hasVV()||this.vvColor}setVV(t,e){super.setVV(t,e),this.vvColor=!e.isOutline&&!!(t&n.X.COLOR)}},p=t=>class extends t{get vvOpacity(){return 0!==this.bit(14)}set vvOpacity(t){this.setBit(14,t)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(t,e){super.setVV(t,e),this.vvOpacity=!e.isOutline&&!!(t&n.X.OPACITY)}};class g extends(d(p(_(f)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const{symbologyType:e,vvFlags:i}=t,s=this.load(0);return s.geometryType=n.LW.FILL,s.symbologyType=e,e!==n.mD.DOT_DENSITY&&s.setVV(i,t),s.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}g.shared=new g(0);class y extends(d(p(m(_(f))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const{symbologyType:e,vvFlags:i}=t,s=this.load(0);return s.geometryType=n.LW.MARKER,s.symbologyType=e,e!==n.mD.HEATMAP&&s.setVV(i,t),s.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}y.shared=new y(0);class x extends(d(p(_(f)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n.LW.LINE,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}x.shared=new x(0);class b extends(d(p(m(_(f))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n.LW.TEXT,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}b.shared=new b(0);class M extends(_(f)){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n.LW.LABEL,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.mapAligned=(0,r.NS)(t.placement),e.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}M.shared=new M(0)},47988:(t,e,i)=>{i.d(e,{Z:()=>h});var s=i(43697),r=i(3920),n=i(5600),o=(i(75215),i(67676),i(52011));let a=class extends r.r{initialize(){}destroy(){}get supportsTileUpdates(){return!1}get spatialReference(){const t=this.get("tileStore.tileScheme.spatialReference");return t&&t.toJSON()||null}};(0,s._)([(0,n.Cb)({readOnly:!0})],a.prototype,"supportsTileUpdates",null),(0,s._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"remoteClient",void 0),(0,s._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"service",void 0),(0,s._)([(0,n.Cb)()],a.prototype,"spatialReference",null),(0,s._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"tileInfo",void 0),(0,s._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"tileStore",void 0),a=(0,s._)([(0,o.j)("esri.views.2d.layers.features.processors.BaseProcessor")],a);const h=a},19717:(t,e,i)=>{i.r(e),i.d(e,{default:()=>yo});var s=i(43697);const r=new(i(79087).Z);function n(t){if(null==t)return["",!1];if(!r.hasBidiChar(t))return[t,!1];let e;return e="rtl"===r.checkContextual(t)?"IDNNN":"ICNNN",[r.bidiTransform(t,e,"VLYSN"),!0]}var o=i(20102),a=i(80442),h=i(92604),l=i(70586),c=i(95330),u=(i(75215),i(67676),i(52011)),f=i(22862),_=i(82971),m=i(61027),d=i(66039),p=i(15923),g=i(5600),y=i(4307),x=i(49733);const b=new Set,M=[],v=new Map,S=[0,0];let w=class extends p.Z{constructor(t){super(t),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:t,process:e}=this;this._queue=new x.e({concurrency:t,process:(t,i)=>{const s=this._keyToItem.get(t);return e(s,{signal:i})},peeker:t=>t.values().next().value})}destroy(){this.clear(),this._queue=(0,l.SC)(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(t){const e="string"==typeof t?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(t){return"string"==typeof t?this._keyToItem.has(t):this._keyToItem.has(t.id)}isOngoing(t){const e="string"==typeof t?t:t.id;return this.has(e)&&this._queue.isOngoing(e)}pause(){this._queue.pause()}push(t,e){const i=t.key.id+"-"+e;if(this.has(i))return this.get(i);const s=this._queue.push(i),r=()=>{this._keyToItem.delete(i),this.notifyChange("updating")};return this._keyToItem.set(i,t),s.then(r,r),this.notifyChange("updating"),s}reset(){this._queue.reset(),this.notifyChange("updating")}resume(){this._queue.resume()}_peekByScaleFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView;let i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;t.forEach((t=>{const e=this._keyToItem.get(t),r=this.tileInfoView.getTileScale(e.key);v.has(r)||(v.set(r,[]),i=Math.max(r,i),s=Math.min(r,s)),v.get(r).push(e.key),b.add(r)}));let r=this.state.scale;v.has(r)||(function(t,e){t.length=0,e.forEach((e=>t.push(e)))}(M,b),M.sort(((t,e)=>t-e)),r=M.reduce(((t,e)=>Math.abs(e-r)<Math.abs(t-r)?e:t),M[0])),r=Math.min(r,i),r=Math.max(r,s);const n=v.get(r),o=e.getClosestInfoForScale(r),a=o.getColumnForX(this.state.center[0]),h=o.getRowForY(this.state.center[1]);return n.sort(((t,e)=>{const i=o.denormalizeCol(t.col,t.world),s=o.denormalizeCol(e.col,e.world);return Math.sqrt((a-i)*(a-i)+(h-t.row)*(h-t.row))-Math.sqrt((a-s)*(a-s)+(h-e.row)*(h-e.row))})),b.clear(),v.clear(),n[0].id}_peekByCenterFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView,i=this.state.center;let s,r=Number.POSITIVE_INFINITY;return t.forEach((t=>{const n=this._keyToItem.get(t);e.getTileCoords(S,n.key);const o=(0,y.d)(S,i);o<r&&(r=o,s=n.key)})),s.id}};(0,s._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"concurrency",void 0),(0,s._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"process",void 0),(0,s._)([(0,g.Cb)()],w.prototype,"state",void 0),(0,s._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"strategy",void 0),(0,s._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"tileInfoView",void 0),(0,s._)([(0,g.Cb)({readOnly:!0})],w.prototype,"updating",null),w=(0,s._)([(0,u.j)("esri.views.2d.tiling.PagedTileQueue")],w),i(83068);var P=i(55415);const C=new Set,L=[],I=new Map,k=[0,0];let T=class extends p.Z{constructor(t){super(t),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:t,process:e,strategy:i}=this;this._queue=new x.e({concurrency:t,process:(t,i)=>{const s=this._keyToItem.get(t);return e(s,{signal:i})},peeker:"scale-first"===i?t=>this._peekByScaleFirst(t):t=>this._peekByCenterFirst(t)})}destroy(){this.clear(),this._queue=(0,l.SC)(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(t){const e="string"==typeof t?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(t){return"string"==typeof t?this._keyToItem.has(t):this._keyToItem.has(t.id)}isOngoing(t){const e="string"==typeof t?t:t.id;return this.has(e)&&this._queue.isOngoing(e)}pause(){this._queue.pause()}push(t){const e=t.key.id;if(this._queue.has(e))return this._queue.get(e);const i=this._queue.push(e),s=()=>{this._keyToItem.delete(e),this.notifyChange("updating")};return this._keyToItem.set(e,t),i.then(s,s),this.notifyChange("updating"),i}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView;let i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;t.forEach((t=>{const e=this._keyToItem.get(t),r=this.tileInfoView.getTileScale(e.key);I.has(r)||(I.set(r,[]),i=Math.max(r,i),s=Math.min(r,s)),I.get(r).push(e.key),C.add(r)}));let r=this.state.scale;I.has(r)||(function(t,e){t.length=0,e.forEach((e=>t.push(e)))}(L,C),L.sort(((t,e)=>t-e)),r=L.reduce(((t,e)=>Math.abs(e-r)<Math.abs(t-r)?e:t),L[0])),r=Math.min(r,i),r=Math.max(r,s);const n=I.get(r),o=e.getClosestInfoForScale(r),a=o.getColumnForX(this.state.center[0]),h=o.getRowForY(this.state.center[1]);return n.sort(((t,e)=>{const i=o.denormalizeCol(t.col,t.world),s=o.denormalizeCol(e.col,e.world);return Math.sqrt((a-i)*(a-i)+(h-t.row)*(h-t.row))-Math.sqrt((a-s)*(a-s)+(h-e.row)*(h-e.row))})),C.clear(),I.clear(),n[0].id}_peekByCenterFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView,i=this.state.center;let s,r=Number.POSITIVE_INFINITY;return t.forEach((t=>{const n=this._keyToItem.get(t);e.getTileCoords(k,n.key);const o=(0,y.d)(k,i);o<r&&(r=o,s=n.key)})),s.id}};(0,s._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"concurrency",void 0),(0,s._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"process",void 0),(0,s._)([(0,g.Cb)()],T.prototype,"state",void 0),(0,s._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"strategy",void 0),(0,s._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"tileInfoView",void 0),(0,s._)([(0,g.Cb)({readOnly:!0})],T.prototype,"updating",null),T=(0,s._)([(0,u.j)("esri.views.2d.tiling.TileQueue")],T);var z=i(24470);i(67524),new P.Z(0,0,0,0),new Map;var A=i(16534),E=i(26899);const F=new Map;F.set(d.LW.MARKER,{multiplier:1,indicesPerRecord:6,verticesPerRecord:4}),F.set(d.LW.LINE,{multiplier:1,indicesPerRecord:24,verticesPerRecord:8}),F.set(d.LW.FILL,{multiplier:1,indicesPerRecord:10,verticesPerRecord:10}),F.set(d.LW.TEXT,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4}),F.set(d.LW.LABEL,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4});class R{get length(){return this._pos}constructor(t,e){this._pos=0;const i=e?this._roundToNearest(e,t.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(i),this._buffer=new t(this._array),this._ctor=t,this._i16View=new Int16Array(this._array)}_roundToNearest(t,e){const i=Math.round(t);return i+(e-i%e)}_ensureSize(t){if(this._pos+t>=this._buffer.length){const e=this._roundToNearest(1.25*(this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT),this._buffer.BYTES_PER_ELEMENT),i=new ArrayBuffer(e),s=new this._ctor(i);s.set(this._buffer,0),this._array=i,this._buffer=s,this._i16View=new Int16Array(this._array)}}ensureSize(t){this._ensureSize(t)}writeF32(t){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=t,this._pos++,e}push(t){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=t,e}writeFixed(t){this._buffer[this._pos++]=t}setValue(t,e){this._buffer[t]=e}i1616Add(t,e,i){this._i16View[2*t]+=e,this._i16View[2*t+1]+=i}getValue(t){return this._buffer[t]}incr(t){if(this._buffer.length<t)throw new Error("Increment index overflows the target buffer");this._buffer[t]++}decr(t){this._buffer[t]--}writeRegion(t){this._ensureSize(t.length);const e=this._pos;return this._buffer.set(t,this._pos),this._pos+=t.length,e}writeManyFrom(t,e,i){this._ensureSize(i-e);for(let s=e;s!==i;s++)this.writeFixed(t._buffer[s])}buffer(){const t=this._array.slice(0,4*this._pos);return this.destroy(),t}toArray(){const t=this._array,e=[];for(let i=0;i<t.byteLength/4;i++)e.push(t[i]);return e}seek(t){this._pos=t}destroy(){this._array=null,this._buffer=null}}class N{constructor(t,e,i){this._start={index:0,vertex:0};const s=function(t,e,i){const{indicesPerRecord:s,multiplier:r,verticesPerRecord:n}=F.get(t);return{recordBytes:i*A.XJ*Uint32Array.BYTES_PER_ELEMENT,indexBytes:r*s*i*Uint32Array.BYTES_PER_ELEMENT,vertexBytes:r*n*i*e}}(t,e,i),r=e/4;this.geometryType=t,this._records=new R(Int32Array,s.recordBytes),this._indices=new R(Uint32Array,s.indexBytes),this._vertices=new R(Uint32Array,s.vertexBytes),this._metrics=new R(Float32Array,0),this._strideInt=r}serialize(t){const e=this._records.buffer(),i=this._indices.buffer(),s=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null,n=4*this._strideInt;return t.push(e,i,s),{stride:n,records:e,indices:i,vertices:s,metrics:r}}get strideInt(){return this._strideInt}get recordCount(){return this._records.length/A.XJ}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(t){this._vertices.ensureSize(t)}indexEnsureSize(t){this._indices.ensureSize(t)}recordStart(){this._start.index=this._indices.length,this._start.vertex=this._vertices.length}recordEnd(t,e,i,s,r,n,o,a){this._records.push(t),this._records.push(e??0),this._records.push(i),this._records.push(s),this._records.push(r),this._records.push(n),this._records.push(o),this._records.writeF32(a)}writeIndex(t){this._indices.push(t)}writeVertex(t){this._vertices.push(t)}writeVertexF32(t){this._vertices.writeF32(t)}copyLastFrom(t,e,i){const s=t._records.length-A.XJ,r=t._records.getValue(s),n=t._records.getValue(s+1),o=t._records.getValue(s+2),a=t._records.getValue(s+4),h=t._records.getValue(s+6),l=t._records.getValue(s+7),c=this._vertices.length,u=(t._start.vertex-this._vertices.length)/this._strideInt,f=this._indices.length,_=this.vertexCount;for(let e=t._start.index;e!==t._indices.length;e++){const i=t._indices.getValue(e);this._indices.push(i-u)}for(let e=t._start.vertex;e!==t._vertices.length;e++){const i=t._vertices.getValue(e);this._vertices.push(i)}for(let t=c;t<=this._vertices.length;t+=this._strideInt)this._vertices.i1616Add(t,e,i);this._records.push(r),this._records.push(n),this._records.push(o),this._records.push(f),this._records.push(a),this._records.push(_),this._records.push(h),this._records.push(l)}}var O=i(14867);function W(t){switch(t){case 1:case 8:case 32:return-1;case 2:case 64:return 0;case 4:case 16:case 128:return 1}}function V(t){switch(t){case 1:case 2:case 4:return-1;case 8:case 16:return 0;case 32:case 64:case 128:return 1}}class D{constructor(t,e,i,s,r,n=0){this._hasAggregate=!1,this.hasRecords=!1,this._data={self:new Map,neighbors:new Array},this._version=0,this._current={geometryType:0,writer:null,overlaps:0,start:0,insertAfter:0,sortKey:0,id:0,materialKey:0,indexStart:0,vertStart:0,isDotDensity:!1,bufferingEnabled:!1,metricBoxLenPointer:0},this.hint=e,this.tileKey=t,this._hasAggregate=s,this._pixelBufferEnabled=r,this._version=n,this._symbologyType=i}get hasAggregates(){return this._hasAggregate}get hasPixelBufferEnabled(){return this._pixelBufferEnabled}serialize(t){const e=[];return e.push(this._serializeTileVertexData(this.tileKey,this.tileKey,this._data.self)),this._data.neighbors.forEach(((i,s)=>{const r=1<<s,n=W(r),o=V(r),a=(0,O.M)(new P.Z(this.tileKey),n,o,t),h=this._serializeTileVertexData(this.tileKey,a.id,i.vertexData);h.message.bufferIds=i.displayIds,e.push(h)})),e}_serializeTileVertexData(t,e,i){const s=new Array;return{message:{tileKeyOrigin:t,tileKey:e,data:{[d.LW.MARKER]:i.get(d.LW.MARKER)?.serialize(s),[d.LW.FILL]:i.get(d.LW.FILL)?.serialize(s),[d.LW.LINE]:i.get(d.LW.LINE)?.serialize(s),[d.LW.TEXT]:i.get(d.LW.TEXT)?.serialize(s),[d.LW.LABEL]:i.get(d.LW.LABEL)?.serialize(s)},version:this._version},transferList:s}}featureStart(t,e){this._current.insertAfter=t,this._current.sortKey=e}featureEnd(){}recordStart(t,e,i,s){this._current.writer=this._getVertexWriter(i),this._current.overlaps=0,this._current.indexStart=this._current.writer.indexCount,this._current.vertStart=this._current.writer.vertexCount,this._current.bufferingEnabled=s,this._current.id=t,this._current.materialKey=e,this._current.geometryType=i,this._current.isDotDensity=!1,this._current.writer.recordStart()}recordCount(){return this._current.writer.recordCount}vertexCount(){return this._current.writer.vertexCount}indexCount(){return this._current.writer.indexCount}vertexEnsureSize(t){this._current.writer.vertexEnsureSize(t)}indexEnsureSize(t){this._current.writer.indexEnsureSize(t)}vertexBounds(t,e,i,s){this._current.bufferingEnabled&&this._addOverlap(t,e,i,s)}vertexWrite(t){this._current.writer.writeVertex(t)}vertexWriteF32(t){this._current.writer.writeVertexF32(t)}vertexEnd(){}vertexWriter(){return this._current.writer.vertexWriter}indexWrite(t){this._current.writer.writeIndex(t)}indexWriter(){return this._current.writer.indexWriter}metricWriter(){return this._current.writer.metricWriter}metricStart(t,e,i,s,r,n,o,a){this._current.writer=this._getVertexWriter(d.LW.LABEL);const h=this._current.writer.metricWriter;h.push((0,m.jL)(t)),h.push(e),h.push(i),h.push(s),h.push(r),h.push(n),h.push(o),h.push(a),h.push(255),this._current.metricBoxLenPointer=h.push(0)}metricEnd(){const t=this._current.writer.metricWriter;0===t.getValue(this._current.metricBoxLenPointer)&&t.seek(t.length-10)}metricBoxWrite(t,e,i,s){const r=this._current.writer.metricWriter;r.incr(this._current.metricBoxLenPointer),r.push(0),r.push(0),r.push(t),r.push(e),r.push(i),r.push(s)}recordEnd(){const t=this._current.vertStart,e=this._current.writer.vertexCount-t;if(!e)return!1;this.hasRecords=!0;const i=this._current.indexStart,s=this._current.writer.indexCount-i;if(this._current.writer.recordEnd(this._current.id,this._current.materialKey,this._current.insertAfter,i,s,t,e,this._current.sortKey),!this._pixelBufferEnabled||this._hasAggregate||0===this._current.overlaps||this._current.geometryType===d.LW.LABEL)return!0;const r=this._current.writer;for(let t=0;t<8;t++){const e=1<<t;if(this._current.overlaps&e){this._data.neighbors[t]||(this._data.neighbors[t]={vertexData:new Map,displayIds:new Set});const i=this._data.neighbors[t],s=this._current.geometryType;if(!i.vertexData.has(s)){const t=(0,E.$_)(s,this._symbologyType).geometry,e=new N(s,t,A.Ip);i.vertexData.set(s,e)}const n=i.vertexData.get(this._current.geometryType),o=8,a=512*-W(e)*o,h=512*-V(e)*o;n?.copyLastFrom(r,a,h),i.displayIds.add(this._current.id)}}return!0}_addOverlap(t,e,i,s){const r=255^((t<0+i?148:t>=A.I_-i?41:189)|(e<0+s?224:e>=A.I_-s?7:231));this._current.overlaps|=r}_getVertexWriter(t){if(!this._data.self.has(t)){const e=this._data.self,i=(0,E.$_)(t,this._symbologyType).geometry;e.set(t,new N(t,i,this.hint.records))}return this._data.self.get(t)}}var B=i(65390),U=i(22021),G=i(62357),X=i(46851);function H(t,e,i){const s=e[0],r=e[1],n=e[2],o=e[3],a=e[4],h=e[5],l=i[0],c=i[1],u=i[2],f=i[3],_=i[4],m=i[5];return t[0]=s*l+n*c,t[1]=r*l+o*c,t[2]=s*u+n*f,t[3]=r*u+o*f,t[4]=s*_+n*m+a,t[5]=r*_+o*m+h,t}function Y(t,e,i){const s=e[0],r=e[1],n=e[2],o=e[3],a=e[4],h=e[5],l=Math.sin(i),c=Math.cos(i);return t[0]=s*c+n*l,t[1]=r*c+o*l,t[2]=s*-l+n*c,t[3]=r*-l+o*c,t[4]=a,t[5]=h,t}function J(t,e,i){const s=e[0],r=e[1],n=e[2],o=e[3],a=e[4],h=e[5],l=i[0],c=i[1];return t[0]=s,t[1]=r,t[2]=n,t[3]=o,t[4]=s*l+n*c+a,t[5]=r*l+o*c+h,t}function Z(t,e){const i=Math.sin(e),s=Math.cos(e);return t[0]=s,t[1]=i,t[2]=-i,t[3]=s,t[4]=0,t[5]=0,t}function q(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function K(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t}const $=H,j=K;function Q(){const t=new Float32Array(6);return t[0]=1,t[3]=1,t}function tt(t,e,i,s){const r=e[s],n=e[s+1];t[s]=i[0]*r+i[2]*n+i[4],t[s+1]=i[1]*r+i[3]*n+i[5]}function et(t,e,i,s=0,r=0,n=2){const o=r||e.length/n;for(let r=s;r<o;r++)tt(t,e,i,r*n)}Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},determinant:function(t){return t[0]*t[3]-t[1]*t[2]},equals:function(t,e){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],a=t[5],h=e[0],l=e[1],c=e[2],u=e[3],f=e[4],_=e[5],m=(0,X.g)();return Math.abs(i-h)<=m*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-l)<=m*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(r-c)<=m*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-u)<=m*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(o-f)<=m*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-_)<=m*Math.max(1,Math.abs(a),Math.abs(_))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+1)},fromRotation:Z,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},fromTranslation:q,identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},invert:function(t,e){const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],a=e[5];let h=i*n-s*r;return h?(h=1/h,t[0]=n*h,t[1]=-s*h,t[2]=-r*h,t[3]=i*h,t[4]=(r*a-n*o)*h,t[5]=(s*o-i*a)*h,t):null},mul:$,multiply:H,multiplyScalar:function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t},multiplyScalarAndAdd:function(t,e,i,s){return t[0]=e[0]+i[0]*s,t[1]=e[1]+i[1]*s,t[2]=e[2]+i[2]*s,t[3]=e[3]+i[3]*s,t[4]=e[4]+i[4]*s,t[5]=e[5]+i[5]*s,t},rotate:Y,scale:function(t,e,i){const s=e[0],r=e[1],n=e[2],o=e[3],a=e[4],h=e[5],l=i[0],c=i[1];return t[0]=s*l,t[1]=r*l,t[2]=n*c,t[3]=o*c,t[4]=a,t[5]=h,t},set:function(t,e,i,s,r,n,o){return t[0]=e,t[1]=i,t[2]=s,t[3]=r,t[4]=n,t[5]=o,t},str:function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},sub:j,subtract:K,translate:J},Symbol.toStringTag,{value:"Module"})),Object.freeze(Object.defineProperty({__proto__:null,clone:function(t){const e=new Float32Array(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},create:Q,createView:function(t,e){return new Float32Array(t,e,6)},fromValues:function(t,e,i,s,r,n){const o=new Float32Array(6);return o[0]=t,o[1]=e,o[2]=i,o[3]=s,o[4]=r,o[5]=n,o},transform:tt,transformMany:et},Symbol.toStringTag,{value:"Module"}));var it=i(95648),st=i(30729),rt=i(37720),nt=i(12142),ot=i(63523);const at=100;function ht(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function lt(t,e){return Math.sqrt(t*t+e*e)}function ct(t){const e=lt(t[0],t[1]);t[0]/=e,t[1]/=e}function ut(t,e){return lt(t[0]-e[0],t[1]-e[1])}function ft(t){return"function"==typeof t}function _t(t=2){return 1/Math.max(t,1)}function mt(t,e){return[!!t?.minScale&&e.scaleToZoom(t.minScale)||0,!!t?.maxScale&&e.scaleToZoom(t.maxScale)||at]}function dt(t){return t.length-1}function pt(t,e,i=1){const[s,r]=function(t,e){return t[e+1]}(t,e);return Math.sqrt(s*s+r*r)*i}class gt{constructor(t,e,i,s,r){this._segments=t,this._index=e,this._distance=i,this._xStart=s,this._yStart=r,this._done=!1}static create(t){return new gt(t,0,0,t[0][0],t[0][1])}clone(){return new gt(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(t){return this._index===t._index||t._index===this._index-1&&(0===this._distance||1===t._distance)||t._index===this._index+1&&(1===this._distance||0===t._distance)}leq(t){return this._index<t._index||this._index===t._index&&this._distance<=t._distance}geq(t){return this._index>t._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this