(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-534c2194"],{"040f":function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var s=i("a4ee"),r=i("a5d8"),n=i("59b2"),a=(i("b50f"),i("c120"),i("cea0"),i("d386"));const o=t=>{let e=class extends(Object(r["b"])(t)){constructor(){super(...arguments),this.graphics=null,this.renderer=null}};return Object(s["a"])([Object(n["b"])()],e.prototype,"graphics",void 0),Object(s["a"])([Object(n["b"])()],e.prototype,"renderer",void 0),Object(s["a"])([Object(n["b"])()],e.prototype,"updating",void 0),Object(s["a"])([Object(n["b"])()],e.prototype,"view",void 0),e=Object(s["a"])([Object(a["a"])("esri.views.layers.GraphicsView")],e),e}},"0c53":function(t,e,i){"use strict";i.d(e,"a",(function(){return h})),i.d(e,"b",(function(){return c}));var s=i("b2cd"),r=i("c120");const n=128e3;let a=null,o=null;async function h(){return a||(a=l()),a}async function l(){const t=Object(r["a"])("esri-csp-restrictions")?await i.e("chunk-038b6711").then(i.bind(null,"a546")).then(t=>t.l):await i.e("chunk-47c1d7bd").then(i.bind(null,"cfdc")).then(t=>t.l);o=await t.load({locateFile:()=>Object(s["b"])("esri/core/libs/libtess/libtess.wasm")})}function c(t,e){const i=Math.max(t.length,n);return o.triangulate(t,e,i)}},"0f0f2":function(t,e,i){"use strict";i.d(e,"a",(function(){return he})),i.d(e,"b",(function(){return ae}));var s=i("ce50"),r=i("e92d"),n=i("f4cc"),a=i("8246"),o=i("c84e"),h=i("18c6"),l=i("b2b2"),c=i("a915"),u=i("a9a2"),d=i("8c81"),f=i("1d01"),_=i("d114"),m=i("6a2c"),p=i("6655"),g=(i("9812"),i("0c53")),b=i("8152"),y=i("3976"),x=i("2da5");function v(t,e,i,s,r,n,a){Q=0;const o=(s-i)*n,h=r&&r.length,l=h?(r[0]-i)*n:o;let c,u,d,f,_,m=w(e,i,s,0,l,n,!0);if(m&&m.next!==m.prev){if(h&&(m=C(e,i,s,r,m,n)),o>80*n){c=d=e[0+i*n],u=f=e[1+i*n];for(let t=n;t0)for(let h=s;h=s;h-=n)o=S(h+e*n,t[h+e*n],t[h+1+e*n],o);return o&&G(o,o.next)&&(R(o),o=o.next),o}function O(t,e=t){if(!t)return t;let i,s=t;do{if(i=!1,s.steiner||!G(s,s.next)&&0!==P(s.prev,s,s.next))s=s.next;else{if(R(s),s=e=s.prev,s===s.next)break;i=!0}}while(i||s!==e);return e}function T(t,e,i,s,r,n,a,o){if(!t)return;!o&&n&&(t=B(t,s,r,n));let h=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(n?j(t,s,r,n):M(t))e.push(l.index/i+a),e.push(t.index/i+a),e.push(c.index/i+a),R(t),t=c.next,h=c.next;else if((t=c)===h){o?1===o?T(t=W(t,e,i,a),e,i,s,r,n,a,2):2===o&&q(t,e,i,s,r,n,a):T(O(t),e,i,s,r,n,a,1);break}}}function M(t){const e=t.prev,i=t,s=t.next;if(P(e,i,s)>=0)return!1;let r=t.next.next;const n=r;let a=0;for(;r!==t.prev&&(0===a||r!==n);){if(a++,k(e.x,e.y,i.x,i.y,s.x,s.y,r.x,r.y)&&P(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function j(t,e,i,s){const r=t.prev,n=t,a=t.next;if(P(r,n,a)>=0)return!1;const o=r.xn.x?r.x>a.x?r.x:a.x:n.x>a.x?n.x:a.x,c=r.y>n.y?r.y>a.y?r.y:a.y:n.y>a.y?n.y:a.y,u=U(o,h,e,i,s),d=U(l,c,e,i,s);let f=t.prevZ,_=t.nextZ;for(;f&&f.z>=u&&_&&_.z<=d;){if(f!==t.prev&&f!==t.next&&k(r.x,r.y,n.x,n.y,a.x,a.y,f.x,f.y)&&P(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,_!==t.prev&&_!==t.next&&k(r.x,r.y,n.x,n.y,a.x,a.y,_.x,_.y)&&P(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;f&&f.z>=u;){if(f!==t.prev&&f!==t.next&&k(r.x,r.y,n.x,n.y,a.x,a.y,f.x,f.y)&&P(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;_&&_.z<=d;){if(_!==t.prev&&_!==t.next&&k(r.x,r.y,n.x,n.y,a.x,a.y,_.x,_.y)&&P(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function S(t,e,i,s){const r=Y.create(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function R(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function E(t){let e=t,i=t;do{(e.x=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>a){if(a=t,t===s){if(r===i.y)return i;if(r===i.next.y)return i.next}n=i.x=i.x&&i.x>=h&&s!==i.x&&k(rn.x)&&N(i,t)&&(n=i,u=c)),i=i.next;return n}function B(t,e,i,s){for(let r;r!==t;r=r.next){if(r=r||t,null===r.z&&(r.z=U(r.x,r.y,e,i,s)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,B(t,e,i,s);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,z(t)}function z(t){let e,i=1;for(;;){let s,r=t;t=null,e=null;let n=0;for(;r;){n++,s=r;let a=0;for(;a0||o>0&&s;){let i;0===a?(i=s,s=s.nextZ,o--):0!==o&&s?r.z<=s.z?(i=r,r=r.nextZ,a--):(i=s,s=s.nextZ,o--):(i=r,r=r.nextZ,a--),e?e.nextZ=i:t=i,i.prevZ=e,e=i}r=s}if(e.nextZ=null,i*=2,n<2)return t}}function P(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function D(t,e,i,s){return!!(G(t,e)&&G(i,s)||G(t,s)&&G(i,e))||P(t,e,i)>0!=P(t,e,s)>0&&P(i,s,t)>0!=P(i,s,e)>0}function A(t,e){let i=t;do{if(i.index!==t.index&&i.next.index!==t.index&&i.index!==e.index&&i.next.index!==e.index&&D(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function L(t,e,i,s,r,n){let a=0;for(let o=s,h=r-n;o=0&&(t-a)*(s-o)-(i-a)*(e-o)>=0&&(i-a)*(n-o)-(r-a)*(s-o)>=0}function N(t,e){return P(t.prev,t,t.next)<0?P(t,e,t.next)>=0&&P(t,t.prev,e)>=0:P(t,e,t.prev)<0||P(t,t.next,e)<0}function U(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function G(t,e){return t.x===e.x&&t.y===e.y}function V(t,e){return t.x-e.x}function W(t,e,i,s){let r=t;do{const n=r.prev,a=r.next.next;!G(n,a)&&D(n,r,r.next,a)&&N(n,a)&&N(a,n)&&(e.push(n.index/i+s),e.push(r.index/i+s),e.push(a.index/i+s),R(r),R(r.next),r=t=a),r=r.next}while(r!==t);return r}function q(t,e,i,s,r,n,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.index!==t.index&&H(o,t)){let h=K(o,t);return o=O(o,o.next),h=O(h,h.next),T(o,e,i,s,r,n,a,0),void T(h,e,i,s,r,n,a,0)}t=t.next}o=o.next}while(o!==t)}function H(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!A(t,e)&&N(t,e)&&N(e,t)&&Z(t,e)}function Z(t,e){let i=t,s=!1;const r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}function K(t,e){const i=Y.create(t.index,t.x,t.y),s=Y.create(e.index,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}class Y{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,i){const s=Q0))break;r+=a,l.push(o+e),e+=n}const c=a.length;v(a,i,o,o+e,l,2,n);const u=st(a,i,c,a.length,n),d=Math.abs(r);if(Math.abs((u-d)/Math.max(1e-7,d))>J)return a.length=0,!1;h=t,o+=e}return!0}function nt(t){const{coords:e,lengths:i}=t,{buffer:s}=Object(g["b"])(e,i);return s}function at(t,e,i){let s=0;for(let r=0;ri||ai)return!0}s+=n}return!1}function ot(t,e){if(Object(l["j"])(t))return null;if(!at(t,-128,d["P"]+128))return t;tt.setPixelMargin(e),tt.reset(y["a"].Polygon);let i=0;for(let a=0;ar||cr){a=!0;continue}e.push({x:l,y:c})}let u=!1;const d=h.length;for(let t=1;tr||cr){u=!0;break}e.push({x:l,y:c})}if(u)a=!0;else{if(a){const t=i.resultWithStarts();if(t)for(const e of t)n.push(e)}else n.push({line:e,start:0});o++,a=!1}}return n=n.filter(t=>t.line.length>1),0===n.length?null:n}tt.setExtent(d["P"]),et.setExtent(d["P"]);var lt=i("ab39"),ct=i("c8dd"),ut=i("2629");const dt=8,ft=16,_t=65535,mt=t=>class extends t{constructor(...t){super(...t),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=o["d"].LINE}writeGeometry(t,e,i,s){this._writeGeometry(t,e,i,s)}_initializeTessellator(t){const e=h["c"].load(this._materialKey),i=h["a"].load(this._materialKey),s=this._tessellationOptions,r=e.vvSizeFieldStops||e.vvSizeMinMaxValue||e.vvSizeScaleStops||e.vvSizeUnitValue,n=this.tessellationProperties._halfWidth(s,r,n,a,o,h,l,c,u,d,f)=>{const m=Object(_["a"])(f,Math.ceil(ft*t._halfWidth)),p=Object(_["b"])(Math.round(ft*l),Math.round(ft*c),Math.round(ft*u),Math.round(ft*d)),g=Object(_["b"])(ft*o,ft*h,0,t._bitset),b=t.out;return b.vertexBounds(s,r,e,i),b.vertexWrite(Object(_["a"])(dt*s,dt*r)),b.vertexWrite(t.id),b.vertexWrite(t._fillColor),b.vertexWrite(p),b.vertexWrite(m),b.vertexWrite(t._tl),b.vertexWrite(t._br),b.vertexWrite(g),b.vertexWrite(Object(_["a"])(Math.ceil(ft*t._halfReferenceWidth),0)),b.vertexWrite(t.minMaxZoom),b.vertexEnd(),t.offset+t.vertexCount++},gt=(t,e,i)=>(s,r,n,a,o,h,l,c,u,d,f)=>{const m=Object(_["b"])(0,0,ft*t._halfWidth,ft*t._halfReferenceWidth),p=Object(_["b"])(ft*l+128,ft*c+128,ft*u+128,ft*d+128),g=t.out,b=t._bitset<<24|t.id;return g.vertexBounds(s,r,e,i),g.vertexWrite(Object(_["a"])(dt*s,dt*r)),g.vertexWrite(b),g.vertexWrite(t._fillColor),t.key.simple||(g.vertexWrite(0),g.vertexWrite(0)),g.vertexWrite(m),g.vertexWrite(p),t.key.simple||g.vertexWrite(t.minMaxZoom),g.vertexEnd(),t.offset+t.vertexCount++},bt=t=>(e,i,s)=>{const r=t.out;r.indexWrite(e),r.indexWrite(i),r.indexWrite(s),t.indexCount+=3};var yt=i("f75e");const xt=r["a"].getLogger("esri.views.2d.engine.webgl.WGLLineTemplate");class vt extends(mt(yt["a"])){constructor(t,e,i,s,r,n,a,o,l,c,u,f,p,g,b,y,x,v,w){super();const O=h["c"].load(t);e&&(O.sdf=e.sdf,O.pattern=!0,O.textureBinding=e.textureBinding),this._capType=s,this._joinType=r,this._miterLimitCosine=Object(m["d"])(n),this.tessellationProperties._fillColor=a,this.tessellationProperties._tl=o,this.tessellationProperties._br=l,this._hasPattern=c,this._isDashed=u,this._zOrder=y,this._effects=x,this._minMaxZoom=Object(_["a"])(Math.round(v*d["w"]),Math.round(w*d["w"])),this._materialKey=O.data;const T=(p?d["g"]:0)|(g?d["m"]:0)|(f?d["h"]:0);this.tessellationProperties._bitset=T,this.tessellationProperties._halfWidth=.5*i,this.tessellationProperties._halfReferenceWidth=.5*b,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(t,e,i){const s=t.color,r=t.scaleFactor||1,n=!!t.dashTemplate;let a=t.cap;n&&a===lt["d"].ROUND&&(a=lt["d"].SQUARE);const o=t.join,h=Object(c["g"])(t.width)*r,l=Object(c["g"])(t.referenceWidth),f=Object(c["g"])(t.miterLimit),p=s&&Object(u["c"])(s)||0,[g,b]=Object(m["e"])(t.scaleInfo,i),y=!1;if(!e)return new vt(t.materialKey,e,h,a,o,f,p,0,0,!1,n,t.scaleDash,t.colorLocked,y,l,t.zOrder,t.effects,g,b);const{rect:x,width:v,height:w}=e,O=x.x+d["A"],T=x.y+d["A"],M=O+v,j=T+w,S=Object(_["a"])(O,T),R=Object(_["a"])(M,j),E=!1;return new vt(t.materialKey,e,h,a,o,f,p,S,R,!0,n,t.scaleDash,t.colorLocked,E,l,t.zOrder,t.effects,g,b)}static fromFillOutline(t){var e;return t.isOutlinedFill&&t.outline&&"esriSLSSolid"===(null==(e=t.outline)?void 0:e.style)?vt.fromSimpleLine({hash:"",materialKey:t.materialKey,...t.outline},null,!0):null}static fromSimpleLine(t,e,i=!1){const{color:s}=t,r="esriSLSSolid"!==t.style&&"esriSLSNull"!==t.style,n=Object(ct["i"])(t.cap||"round"),a=Object(ct["j"])(t.join||"round");let o=s&&"esriSLSNull"!==t.style&&Object(u["d"])(s)||0;"esriSLSNull"===t.style&&(o=0);const h=Object(c["g"])(t.width),l=t.miterLimit;if(!e)return new vt(t.materialKey,e,h,n,a,l,o,0,0,!1,r,!0,!1,i,h,0,null,m["b"],m["a"]);const{rect:f,width:p,height:g}=e,b=f.x+d["A"],y=f.y+d["A"],x=b+p,v=y+g,w=Object(_["a"])(b,y),O=Object(_["a"])(x,v);return new vt(t.materialKey,e,h,n,a,l,o,w,O,!0,r,!0,!1,i,h,0,null,m["b"],m["a"])}static fromPictureLineSymbol(t,e,i,s){return xt.error("PictureLineSymbol support does not exist!"),null}}const wt=100,Ot=1,Tt=t=>class extends t{constructor(...t){super(...t),this.forceLibtess=!1,this._bitset=0,this._lineTemplate=null,this.geometryType=o["d"].FILL}_maybeAddLineTemplate(t){this._lineTemplate=vt.fromFillOutline(t)}_write(t,e,i,s){const r="esriGeometryPoint"===e.geometryType,n=h["a"].load(this._materialKey);t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,r),this._writeGeometry(t,e,n,s,r),n.outlinedFill&&Object(l["k"])(this._lineTemplate)&&this._lineTemplate.writeGeometry(t,e,s,r),t.recordEnd()}_writeGeometry(t,e,i,s,r){const n=this._getGeometry(e,s,r);if(Object(l["j"])(n))return;const a=[];if(!(n.maxLength>wt)&&!this.forceLibtess&&rt(a,n))return void(a.length&&this._writeVertices(t,e,n.coords,n.lengths,i,a));const o=nt(n);this._writeVertices(t,e,o,[o.length/2],i)}_writeVertex(t,e,i,s,r,n){const a=Object(_["a"])(Ot*s,Ot*r);t.vertexBounds(s,r,0,0),t.vertexWrite(a),t.vertexWrite(e),i.dotDensity?t.vertexWriteF32(1/Math.abs(n.readGeometryArea())):(t.vertexWrite(this.fillColor),i.simple||(t.vertexWrite(this.tl),t.vertexWrite(this.br)),t.vertexWrite(this.aux2),t.vertexWrite(this.aux3),i.simple||t.vertexWrite(this._minMaxZoom))}_writeVertices(t,e,i,s,r,n){const a=e.getDisplayId(),o=this._bitset<<24|a,h=s.reduce((t,e)=>t+e),l=r.dotDensity?4:10,c=t.vertexCount();t.vertexEnsureSize(l*h);let u=0;if(n)for(const d of n){const s=i[2*d],n=i[2*d+1];this._writeVertex(t,o,r,s,n,e),u++}else for(let d=0;d0,a=e.readLegacyFeature(),o=this._materialCache,h=this._cimLayer.materialHash;if(!h)return St.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const l="function"==typeof h?h(a,i,s):h;if(o.has(l)){const t=o.get(l);return Promise.resolve(t)}const c=this._ongoingMaterialRequestMap.get(l);if(c)return c;const u=this._cimLayer,d=Object(Mt["a"])(u.cim,this._cimLayer.materialOverrides);d.mosaicHash=l;const{type:f,url:_}=u,m={cim:d,type:f,mosaicHash:l,url:_,size:null,dashTemplate:null,text:null,fontName:null};switch(f){case"marker":m.size=Object(jt["d"])(u.size,a,i,s);break;case"line":m.dashTemplate=u.dashTemplate;break;case"text":m.text=Object(jt["d"])(u.text,a,i,s),m.fontName=Object(jt["d"])(u.fontName,a,i,s)}const p=t.getMosaicItem(m,r).then(t=>(n||(this._ongoingMaterialRequestMap.delete(l),o.set(l,t)),t)).catch(t=>(this._ongoingMaterialRequestMap.delete(l),St.error(".analyze()",t.message),null));return n||this._ongoingMaterialRequestMap.set(l,p),p}}var Et=i("1aa6");const Ct=128;class It extends(Tt(Rt)){constructor(t,e,i){var s;if(super(t),this._minMaxZoom=Object(_["a"])(Math.round(e*d["w"]),Math.round(i*d["w"])),Object(m["f"])(t.color)){const e=(e,i,s)=>{const r=t.color(e,i,s);return r&&Object(u["c"])(r)||0};this._dynamicPropertyMap.set("fillColor",e)}else{const e=t.color;this.fillColor=e&&Object(u["c"])(e)||0}const r="CIMMarkerPlacementInsidePolygon"===(null==(s=t.cim.placement)?void 0:s.type)&&t.cim.placement.shiftOddRows?2:1,n=t.height;if(Object(m["f"])(n)){const t=(t,e,i)=>n(t,e,i)*r;this._dynamicPropertyMap.set("_height",t)}else this._height=(n||0)*r;const a=t.offsetX;if(Object(m["f"])(a)){const t=(t,e,i)=>{let s=Object(c["g"])(a(t,e,i))+Ct;return s>255?s=255:s<0&&(s=0),s};this._dynamicPropertyMap.set("_offsetX",t)}else{let t=Object(c["g"])(a||0)+Ct;t>255?t=255:t<0&&(t=0),this._offsetX=t}const o=t.offsetY;if(Object(m["f"])(o)){const t=(t,e,i)=>{let s=Object(c["g"])(-o(t,e,i))+Ct;return s>255?s=255:s<0&&(s=0),s};this._dynamicPropertyMap.set("_offsetY",t)}else{let t=Object(c["g"])(-o||0)+Ct;t>255?t=255:t<0&&(t=0),this._offsetY=t}const p=t.scaleX;Object(m["f"])(p)?this._dynamicPropertyMap.set("_scaleX",p):this._scaleX=p||1;const g=t.angle;if(Object(m["f"])(g)){const t=(t,e,i)=>Object(f["d"])(g(t,e,i));this._dynamicPropertyMap.set("_angle",t)}else this._angle=Object(f["d"])(g)||0;if(Object(l["k"])(t.effects)){const e=t.effects;Object(m["f"])(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}this._cimFillLayer=t,this._fillMaterialKey=h["a"].load(t.materialKey)}static fromCIMFill(t,e){const[i,s]=Object(m["e"])(t.scaleInfo,e);return new It(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)});const r=this._fillMaterialKey,n=this._materialCache,a=(0,this._cimFillLayer.materialHash)(s,e,i),o=n.get(a);let h=null;if(o&&Object(Et["a"])(o.spriteMosaicItem)&&(h=o.spriteMosaicItem),h){const{rect:t,width:e,height:i}=h,s=t.x+d["A"],n=t.y+d["A"],a=s+e,o=n+i;let l=Math.round(Object(c["g"])(this._height));l>255?l=255:l<=0&&(l=o-n);let u=Math.round(Object(c["g"])(this._height/i*e||0));u>255?u=255:u<=0&&(u=a-s);const f=this._scaleX,m=1;this.tl=Object(_["a"])(s,n),this.br=Object(_["a"])(a,o),this.aux2=Object(_["b"])(u,l,this._offsetX,this._offsetY),this.aux3=Object(_["b"])(f,m,this._angle,0),r.sdf=h.sdf,r.pattern=!0,r.textureBinding=h.textureBinding}else this.tl=0,this.br=0,this.aux2=0,this.aux3=0,r.sdf=!1,r.pattern=!1,r.textureBinding=0;this._materialKey=r.data}}class Ft extends(mt(Rt)){constructor(t,e,i){super(t),this._minMaxZoom=Object(_["a"])(Math.round(e*d["w"]),Math.round(i*d["w"])),this._cimLineLayer=t;let s=0;Object(m["f"])(t.width)||(s=.5*Object(c["g"])(t.width));const r=(e,i,r)=>Object(m["f"])(t.width)?.5*Object(c["g"])(t.width(e,i,r)):s;this._dynamicPropertyMap.set("_halfWidth",r),Object(m["f"])(t.cap)?this._dynamicPropertyMap.set("_capType",t.cap):this._capType=t.cap,Object(m["f"])(t.join)?this._dynamicPropertyMap.set("_joinType",t.join):this._joinType=t.join;const n=t.color;if(Object(m["f"])(n)){const t=(t,e,i)=>Object(u["c"])(n(t,e,i));this._dynamicPropertyMap.set("_fillColor",t)}else this._fillColor=n&&Object(u["c"])(n)||0;const a=t.miterLimit;if(Object(m["f"])(a)){const t=(t,e,i)=>Object(m["d"])(a(t,e,i));this._dynamicPropertyMap.set("_miterLimitCosine",t)}else this._miterLimitCosine=Object(m["d"])(a);if(Object(l["k"])(t.effects)){const e=t.effects;Object(m["f"])(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}this._scaleFactor=t.scaleFactor||1,this._isDashed=null!=t.dashTemplate,this.tessellationProperties._bitset=(t.colorLocked?1:0)|(t.scaleDash?1:0)<<1,this._materialKey=t.materialKey,this._initializeTessellator(!0)}static fromCIMLine(t,e){const[i,s]=Object(m["e"])(t.scaleInfo,e);return new Ft(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)}),this._halfWidth*=this._scaleFactor;const r=this._materialCache,n=(0,this._cimLineLayer.materialHash)(s,e,i),a=r.get(n);let o=null;if(a&&Object(Et["a"])(a.spriteMosaicItem)&&(o=a.spriteMosaicItem),o){this._hasPattern=!0;const{rect:t,width:e,height:i}=o,s=t.x+d["A"],r=t.y+d["A"],n=s+e,a=r+i;this.tessellationProperties._tl=Object(_["a"])(s,r),this.tessellationProperties._br=Object(_["a"])(n,a)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const l=h["c"].load(this._materialKey);o&&(l.sdf=o.sdf,l.pattern=!0,l.textureBinding=o.textureBinding),this._materialKey=l.data}}var Bt=i("2c63"),zt=i("738e"),Pt=i("f93c");const Dt=Object(zt["a"])(),At=Object(Bt["a"])(),Lt=r["a"].getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate");class kt extends(Object(Pt["a"])(Rt)){constructor(t,e,i){super(t),this._cimMarkerLayer=t,this._minMaxZoom=Object(_["a"])(Math.round(e*d["w"]),Math.round(i*d["w"]));const s=t.color;if(Object(m["f"])(s)){const t=(t,e,i)=>Object(u["c"])(s(t,e,i));this._dynamicPropertyMap.set("_fillColor",t)}else this._fillColor=Object(u["c"])(s);const r=t.outlineColor;if(Object(m["f"])(r)){const t=(t,e,i)=>Object(u["c"])(r(t,e,i));this._dynamicPropertyMap.set("_outlineColor",t)}else this._outlineColor=Object(u["c"])(r);const n=t.size;if(Object(m["f"])(n)){const t=(t,e,i)=>Object(c["g"])(n(t,e,i));this._dynamicPropertyMap.set("_size",t)}else this._size=Object(c["g"])(n)||0;const a=t.scaleX;Object(m["f"])(a)?this._dynamicPropertyMap.set("_scaleX",a):this._scaleX=a||1;const o=t.offsetX;if(Object(m["f"])(o)){const t=(t,e,i)=>Object(c["g"])(o(t,e,i));this._dynamicPropertyMap.set("xOffset",t)}else this.xOffset=Object(c["g"])(o)||0;const h=t.offsetY;if(Object(m["f"])(h)){const t=(t,e,i)=>Object(c["g"])(h(t,e,i));this._dynamicPropertyMap.set("yOffset",t)}else this.yOffset=Object(c["g"])(h)||0;const f=t.outlineWidth;if(Object(m["f"])(f)){const t=(t,e,i)=>Object(c["g"])(f(t,e,i));this._dynamicPropertyMap.set("_outlineWidth",t)}else this._outlineWidth=Object(c["g"])(f)||0;const p=t.rotation;if(Object(m["f"])(p)?this._dynamicPropertyMap.set("_angle",p):this._angle=p||0,Object(l["k"])(t.effects)){const e=t.effects;Object(m["f"])(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}if(Object(l["k"])(t.markerPlacement)){const e=t.markerPlacement;Object(m["f"])(e)?this._dynamicPropertyMap.set("_markerPlacement",e):this._markerPlacement=e}this._scaleFactor=Object(l["u"])(t.scaleFactor,1),this._bitSet=(t.alignment===lt["a"].MAP?1:0)|(t.colorLocked?1:0)<<1|(t.scaleSymbolsProportionally?1:0)<<3,this._materialKey=t.materialKey}static fromCIMMarker(t,e){const[i,s]=Object(m["e"])(t.scaleInfo,e);return new kt(t,i,s)}bindFeature(t,e,i){const r=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,s)=>{this[s]=t(r,e,i)});const n=this._cimMarkerLayer.materialHash,a="function"==typeof n?n(r,e,i):n,o=this._materialCache.get(a);if(!o||!Object(Et["a"])(o.spriteMosaicItem)||!o.spriteMosaicItem)return void Lt.error(new s["a"]("mapview-cim","Encountered an error when binding feature"));const l=o.spriteMosaicItem,u=this._cimMarkerLayer.sizeRatio,f=l.width/l.height*this._scaleX,m=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let p=this._size,g=p*f;const b=this.xOffset,y=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const x=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/Object(c["g"])(this._cimMarkerLayer.frameHeight):1,v=this._outlineWidth*x,w=Object(c["g"])(this._cimMarkerLayer.referenceSize);let O=0,T=0;const M=this._cimMarkerLayer.anchorPoint;M&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(O=-M.x/(this._size*f),T=M.y/this._size):(O=M.x,T=M.y)),this._sizeOutlineWidth=Object(_["b"])(Math.round(Math.min(Math.sqrt(128*g),255)),Math.round(Math.min(Math.sqrt(128*p),255)),Math.round(Math.min(Math.sqrt(128*v),255)),Math.round(Math.min(Math.sqrt(128*w),255))),this.angle=m;const j=Math.round(64*u);this._bitestAndDistRatio=Object(_["a"])(this._bitSet,j);const S=l.rect.x+d["A"],R=l.rect.y+d["A"],E=S+l.width,C=R+l.height;this._texUpperLeft=Object(_["a"])(S,R),this._texUpperRight=Object(_["a"])(E,R),this._texBottomLeft=Object(_["a"])(S,C),this._texBottomRight=Object(_["a"])(E,C);const I=h["d"].load(this._materialKey);I.sdf=l.sdf,I.pattern=!0,I.textureBinding=l.textureBinding,this._materialKey=I.data,this._anchorX=.5-(.5+O)*l.width/l.width,this._anchorY=.5-(.5+T)*l.height/l.height,g*=u,p*=u,g*=this._scaleFactor,p*=this._scaleFactor,g*=l.rect.width/l.width,p*=l.rect.height/l.height,this._computedWidth=g,this._computedHeight=p,this._applyTransformation(At,Dt),this.xOffset=b,this.yOffset=y}}var Nt=i("32dd"),Ut=i("44d1"),Gt=i("32b6");const Vt=5;function Wt(t,e,i,s){return"string"==typeof t.text?t.text:"function"==typeof t.text?t.text(e,i,s):""}class qt extends(Object(Ut["a"])(Rt)){constructor(t,e,i){super(t),this._horizontalAlignment="center",this._verticalAlignment="middle",this._textToGlyphs=new Map,this._minMaxZoom=Object(_["a"])(Math.round(e*d["w"]),Math.round(i*d["w"]));const s=t.scaleFactor||1;this._cimTextLayer=t;const r=t.color;if(Object(m["f"])(r)){const t=(t,e,i)=>Object(u["c"])(r(t,e,i));this._dynamicPropertyMap.set("_color",t)}else this._color=Object(u["c"])(r);const n=t.outlineColor;if(Object(m["f"])(n)){const t=(t,e,i)=>Object(u["c"])(n(t,e,i));this._dynamicPropertyMap.set("_haloColor",t)}else this._haloColor=Object(u["c"])(n);let a;Object(m["f"])(t.size)||(a=Math.min(Math.round(Object(c["g"])(t.size*t.sizeRatio)),127));const o=(e,i,s)=>Object(m["f"])(t.size)?Math.min(Math.round(Object(c["g"])(t.size(e,i,s)*t.sizeRatio)),127):a;if(this._dynamicPropertyMap.set("_size",o),Object(m["f"])(t.outlineSize)){const e=(e,i,s)=>Math.min(Math.floor(Vt*Object(c["g"])(t.outlineSize(e,i,s)*t.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",e)}else this._haloSize=Math.min(Math.floor(Vt*Object(c["g"])(t.outlineSize*t.sizeRatio)),127);let f;Object(m["f"])(t.offsetX)||(f=Math.round(Object(c["g"])(t.offsetX*t.sizeRatio)));const p=(e,i,s)=>Object(m["f"])(t.offsetX)?Math.round(Object(c["g"])(t.offsetX(e,i,s)*t.sizeRatio)):f;let g;this._dynamicPropertyMap.set("_xOffset",p),Object(m["f"])(t.offsetY)||(g=Math.round(Object(c["g"])(t.offsetY*t.sizeRatio)));const b=(e,i,s)=>Object(m["f"])(t.offsetY)?Math.round(Object(c["g"])(t.offsetY(e,i,s)*t.sizeRatio)):g;if(this._dynamicPropertyMap.set("_yOffset",b),Object(m["f"])(t.angle)?this._dynamicPropertyMap.set("_angle",t.angle):this._angle=t.angle,Object(m["f"])(t.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",t.horizontalAlignment):this._horizontalAlignment=t.horizontalAlignment,Object(m["f"])(t.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",t.verticalAlignment):this._verticalAlignment=t.verticalAlignment,Object(l["k"])(t.effects)){const e=t.effects;Object(m["f"])(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}if(Object(l["k"])(t.markerPlacement)){const e=t.markerPlacement;Object(m["f"])(e)?this._dynamicPropertyMap.set("_markerPlacement",e):this._textPlacement=e}Object(m["f"])(t.text)?this._dynamicPropertyMap.set("_text",t.text):this._text=t.text,this._scaleFactor=s;const y=Math.min(Math.round(Object(c["g"])(t.referenceSize*t.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*y)),this._materialKey=t.materialKey;const x=h["f"].load(this._materialKey);x.sdf=!0,this._bitset=(t.alignment===lt["a"].MAP?1:0)|(t.colorLocked?1:0)<<1,this._materialKey=x.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(t,e){const[i,s]=Object(m["e"])(t.scaleInfo,e);return new qt(t,i,s)}async analyze(t,e,i,s){const r=e.readLegacyFeature(),n=Wt(this._cimTextLayer,r,i,s),a=await super.analyze(t,e,i,s,Object(Gt["a"])(n));return a&&a.glyphMosaicItems&&this._textToGlyphs.set(n,a.glyphMosaicItems),a}bindFeature(t,e,i){const s=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)}),!this._text||0===this._text.length)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/d["r"],this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=Object(Nt["e"])(this._horizontalAlignment||"center"),this._yAlignD=Object(Nt["g"])(this._verticalAlignment||"baseline");const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}const Ht=128;class Zt extends(Tt(yt["a"])){constructor(t,e,i,s,r,n,a,o,l,c,u,f,m,p,g,b){super(),this._effects=p;const y=h["a"].load(t);e&&(y.sdf=e.sdf,y.pattern=!0,y.textureBinding=e.textureBinding),this.fillColor=i,this.tl=s,this.br=r,this.aux2=Object(_["b"])(n,a,o,l),this.aux3=Object(_["b"])(c,u,f,0),this._bitset=m,this._minMaxZoom=Object(_["a"])(Math.round(g*d["w"]),Math.round(b*d["w"])),this._materialKey=y.data}static fromCIMFill(t,e,i){const s=t.color,r=s&&Object(u["c"])(s)||0,n=t.materialKey,[a,o]=Object(m["e"])(t.scaleInfo,i);if(!e)return new Zt(n,null,r,0,0,0,0,0,0,0,0,0,t.colorLocked?d["g"]:0,t.effects,a,o);const{rect:h,width:l,height:p}=e,g=t.scaleX||1,b=h.x+d["A"],y=h.y+d["A"],x=b+l,v=y+p,w=t.height,O=g*w;let T=Math.round(w);T>255?T=255:T<=0&&(T=v-y);let M=Math.round(O);M>255?M=255:M<=0&&(M=x-b);let j=Object(c["g"])(t.offsetX||0)+Ht;j>255&&(j=255);let S=Object(c["g"])(-t.offsetY||0)+Ht;S>255&&(S=255);const R=Object(_["a"])(b,y),E=Object(_["a"])(x,v);return new Zt(n,e,r,R,E,M,T,j,S,Ht,Ht,Object(f["b"])(t.angle),t.colorLocked?d["g"]:0,t.effects,a,o)}static fromSimpleFill(t,e,i=!1){const{color:s}=t,r=s&&"esriSFSNull"!==t.style&&Object(u["d"])(s)||0,n=i?d["g"]:0,a=t.materialKey;let o;if(e){const{rect:t,width:i,height:s}=e,h=t.x+d["A"],l=t.y+d["A"],c=h+i,u=l+s,f=Object(_["a"])(h,l),p=Object(_["a"])(c,u);o=new Zt(a,e,r,f,p,i,s,0,0,Ht,Ht,0,n,null,m["b"],m["a"])}else o=new Zt(a,null,r,0,0,0,0,0,0,0,0,0,n,null,m["b"],m["a"]);return o._maybeAddLineTemplate(t),o}static fromPictureFill(t,e,i=!1){const s=d["z"],{rect:r,width:n,height:a}=e,o=r.x+d["A"],h=r.y+d["A"],l=o+n,u=h+a,f=Object(_["a"])(o,h),p=Object(_["a"])(l,u);let g=Math.round(Object(c["g"])(t.width));g>255&&(g=255);let b=Math.round(Object(c["g"])(t.height));b>255&&(b=255);let y=Object(c["g"])(t.xoffset)+Ht;y>255&&(y=255);let x=Object(c["g"])(-t.yoffset)+Ht;x>255&&(x=255);const v=t.materialKey,w=i?d["g"]:0,O=new Zt(v,e,s,f,p,g,b,y,x,Ht*t.xscale,Ht*t.yscale,0,w,null,m["b"],m["a"]);return O._maybeAddLineTemplate(t),O}}var Kt=i("a8b5"),Yt=i("89e8");class Xt{constructor(){this._resolver=null}isHeld(){return!!this._resolver}async acquire(){if(!this._resolver)return this._resolver=Object(n["g"])(),Promise.resolve();await this._resolver.promise,await this.acquire()}release(){const t=this._resolver;this._resolver=null,t.resolve()}}async function $t(t,e,i){try{await t.acquire(),await e(i),t.release()}catch(s){throw t.release(),s}}var Qt=i("f47d");const Jt=r["a"].getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),te=new Array,ee={isOutline:!1,isOutlinedFill:!1,placement:null,stride:{fill:"default"},vvFlags:0},ie={...a["g"],hash:JSON.stringify(a["g"]),materialKey:Object(h["g"])(o["d"].MARKER,ee)},se={...a["i"],hash:JSON.stringify(a["i"]),materialKey:Object(h["g"])(o["d"].LINE,ee)},re={...a["h"],hash:JSON.stringify(a["h"]),materialKey:Object(h["g"])(o["d"].FILL,ee)};function ne(t,e){const i=t.length;return t.push(null),e.then(e=>t[i]=e),t}function ae(t){return!!(1&t)}function oe(t){return"worker:port-closed"===t.name}class he{constructor(t,e){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new Xt,this._fetchResource=t,this._tileInfo=e}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(t,e){this._initErrorTemplates();const i=t.hash;if(this._symbolToTemplate.has(i))return this._symbolToTemplate.get(i);const s=new Array;e&&this._createMeshTemplates(s,e,!0),this._createMeshTemplates(s,t,!1);const r=this._createGroupId("expanded-cim"===t.type&&le(t));return this._idToTemplateGroup.set(r,s),this._symbolToTemplate.set(i,r),r}getTemplateGroup(t){return this._idToTemplateGroup.has(t)?this._idToTemplateGroup.get(t):te}getDynamicTemplateGroup(t){return this._idToTemplateGroup.has(t)?(ae(t)||Jt.error("mapview-template-store",`Id ${t} does not refer to a dynamic template`),this._idToTemplateGroup.get(t)):te}getMosaicItem(t,e){const i=this._createTemplateId(),s=new Promise(t=>this._idToResolver.set(i,t));return this._fetchQueue.push({symbol:t,id:i,glyphIds:e}),s}finalize(t){return this._fetchQueue.length||this._lock.isHeld()?$t(this._lock,this._fetchAllQueuedResources.bind(this),t):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],re,!1),marker:this._createMeshTemplates([],ie,!1),line:this._createMeshTemplates([],se,!1)})}_fetchAllQueuedResources(t){if(!this._fetchQueue.length)return Promise.resolve();const e=this._fetchQueue,i=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(i).then(()=>this._fetchResource(e,t).then(t=>{for(const{id:e,mosaicItem:i}of t)this._idToResolver.get(e)(i),this._idToResolver.delete(e)})).catch(t=>{Object(n["m"])(t)?this._fetchQueue=this._fetchQueue.concat(e):oe(t)||Jt.error(new s["a"]("mapview-template-store","Unable to fetch requested texture resources",t))})}_createGroupId(t){return this._idCounter++<<1|(t?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(Et["a"])(e,Jt)?Kt["a"].fromSimpleMarker(t,e):this._markerError}async _createPMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(Et["a"])(e,Jt)?Kt["a"].fromPictureMarker(t,e):this._markerError}async _createSFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(Et["a"])(i,Jt)?Zt.fromSimpleFill(t,i,e):this._fillError}async _createPFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(Et["a"])(i,Jt)?Zt.fromPictureFill(t,i,e):this._fillError}async _createSLS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(Et["a"])(i,Jt)?vt.fromSimpleLine(t,i):this._lineError}async _createLMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(Et["a"])(e,Jt)?Kt["a"].fromLineSymbolMarker(t,e):this._markerError}async _createTS(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t);return Yt["a"].fromText(t,e)}async _createCIMText(t){const{glyphMosaicItems:e}=await this.getMosaicItem(Object(Qt["a"])(t),Object(Gt["a"])(t.text));return Object(Et["a"])(e,Jt)?Yt["a"].fromCIMText(t,e,this._tileInfo):this._textError}async _createCIMFill(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Object(Qt["a"])(t));return Object(Et["a"])(e,Jt)?Zt.fromCIMFill(t,e,this._tileInfo):this._fillError}async _createCIMLine(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Object(Qt["a"])(t));return Object(Et["a"])(e,Jt)?vt.fromCIMLine(t,e,this._tileInfo):this._lineError}async _createCIMMarker(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Object(Qt["a"])(t));return Object(Et["a"])(e,Jt)?Kt["a"].fromCIMMarker(t,e,this._tileInfo):this._markerError}async _createCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let i;switch(t.type){case"marker":i=await this._createCIMMarker(t);break;case"line":i=await this._createCIMLine(t);break;case"fill":i=await this._createCIMFill(t);break;case"text":i=await this._createCIMText(t)}return this._cimTemplateCache.set(e,i),i}async _createDynamicCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let i;switch(t.type){case"marker":i=kt.fromCIMMarker(t,this._tileInfo);break;case"line":i=Ft.fromCIMLine(t,this._tileInfo);break;case"fill":i=It.fromCIMFill(t,this._tileInfo);break;case"text":i=qt.fromCIMText(t,this._tileInfo)}return this._cimTemplateCache.set(e,i),i}_createPrimitiveMeshTemplates(t,e,i){switch(e.type){case"esriSMS":return ne(t,this._createSMS(e));case"esriPMS":return ne(t,this._createPMS(e));case"esriSFS":return ne(t,this._createSFS(e,i));case"line-marker":return ne(t,this._createLMS(e));case"esriPFS":return ne(t,this._createPFS(e,i));case"esriSLS":return ne(t,this._createSLS(e,!1));case"esriTS":return ne(t,this._createTS(e));default:return Jt.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),t}}_createMeshTemplates(t,e,i){if(-1!==e.type.indexOf("3d"))return Jt.error("3D symbols are not supported with MapView"),t;if("expanded-cim"===e.type){for(const i of e.layers)"function"==typeof i.materialHash?ne(t,this._createDynamicCIM(i)):ne(t,this._createCIM(i));return t}if("composite-symbol"===e.type){for(const s of e.layers)this._createPrimitiveMeshTemplates(t,s,i);return t}return"cim"===e.type||"label"===e.type||"web-style"===e.type?t:this._createPrimitiveMeshTemplates(t,e,i)}}const le=t=>{if(!t.layers)return!1;for(const e of t.layers)if("function"==typeof e.materialHash)return!0;return!1}},"175e":function(t,e,i){"use strict";i.d(e,"a",(function(){return s})),i.d(e,"b",(function(){return h})),i.d(e,"c",(function(){return o})),i.d(e,"d",(function(){return f})),i.d(e,"e",(function(){return u})),i.d(e,"f",(function(){return c})),i.d(e,"g",(function(){return l})),i.d(e,"h",(function(){return d}));const s=8388607,r=8388608,n=254,a=255,o=0,h=1,l=t=>(t&r)>>>23,c=t=>t&s,u=t=>l(t)===h?n:a;function d(t){return l(t)===h}function f(t,e){return((e?r:0)|t)>>>0}},"1aa6":function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var s=i("ce50");function r(t,e){if(t&&"name"in t){const i=t;return e&&e.error(new s["a"](i.name,i.message,i.details)),!1}return!0}},"1ec3":function(t,e,i){"use strict";i.d(e,"a",(function(){return d})),i.d(e,"b",(function(){return m})),i.d(e,"c",(function(){return b}));var s=i("b2b2"),r=i("8188"),n=i("d641"),a=i("7f83"),o=i("9786");const h=[0,0];function l(t,e){if(!e)return null;if("x"in e){const i={x:0,y:0};return[i.x,i.y]=t(e.x,e.y,h),null!=e.z&&(i.z=e.z),null!=e.m&&(i.m=e.m),i}if("xmin"in e){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=t(e.xmin,e.ymin,h),[i.xmax,i.ymax]=t(e.xmax,e.ymax,h),e.hasZ&&(i.zmin=e.zmin,i.zmax=e.zmax,i.hasZ=!0),e.hasM&&(i.mmin=e.mmin,i.mmax=e.mmax,i.hasM=!0),i}return"rings"in e?{rings:c(e.rings,t),hasM:e.hasM,hasZ:e.hasZ}:"paths"in e?{paths:c(e.paths,t),hasM:e.hasM,hasZ:e.hasZ}:"points"in e?{points:u(e.points,t),hasM:e.hasM,hasZ:e.hasZ}:void 0}function c(t,e){const i=[];for(const s of t)i.push(u(s,e));return i}function u(t,e){const i=[];for(const s of t){const t=e(s[0],s[1],[0,0]);i.push(t),s.length>2&&t.push(s[2]),s.length>3&&t.push(s[3])}return i}async function d(t,e){if(!e)return;const i=Array.isArray(t)?t.map(t=>Object(s["k"])(t.geometry)&&t.geometry.spatialReference):[t];await Object(r["g"])(i.map(t=>({source:t,dest:e})))}const f=l.bind(null,o["c"]),_=l.bind(null,o["g"]);function m(t,e,i){if(!t)return t;if(i||(i=e,e=t.spatialReference),!Object(a["l"])(e)||!Object(a["l"])(i)||Object(a["d"])(e,i))return t;if(Object(o["a"])(e,i)){const e=Object(a["p"])(i)?f(t):_(t);return e.spatialReference=i,e}return Object(r["r"])(n["a"],[t],e,i,null)[0]}class p{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(t,e,i){if(!t||!t.length||!e||!i||Object(a["d"])(e,i))return t;const s={geometries:t,inSpatialReference:e,outSpatialReference:i,resolve:null};return this._jobs.push(s),new Promise(t=>{s.resolve=t,null===this._timer&&(this._timer=setTimeout(this._process,10))})}_process(){this._timer=null;const t=this._jobs.shift();if(!t)return;const{geometries:e,inSpatialReference:i,outSpatialReference:s,resolve:h}=t;Object(o["a"])(i,s)?Object(a["p"])(s)?h(e.map(f)):h(e.map(_)):h(Object(r["r"])(n["a"],e,i,s,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const g=new p;function b(t,e,i){return g.push(t,e,i)}},2629:function(t,e,i){"use strict";i.d(e,"a",(function(){return m}));var s=i("ab39"),r=i("8c81");function n(t,e){return t.x===e.x&&t.y===e.y}function a(t){if(!t)return;const e=t.length;if(e<=1)return;let i=0;for(let s=1;si){r=!0;const t=(i-s)/u;u=i-s,e=(1-t)*n+t*e,o=(1-t)*a+t*o,--h}const d=this.writeVertex(n,a,0,0,l,c,c,-l,0,-1,s),f=this.writeVertex(n,a,0,0,l,c,-c,l,0,1,s);s+=u;const _=this.writeVertex(e,o,0,0,l,c,c,-l,0,-1,s),m=this.writeVertex(e,o,0,0,l,c,-c,l,0,1,s);this.writeTriangle(d,f,_),this.writeTriangle(f,_,m),n=e,a=o}}_tessellate(t,e){const i=t[0],r=t[t.length-1],a=n(i,r),m=a?3:2;if(t.length=0&&L>=0&&a>=0&&G(A,L,a),A=L,L=a,a};a&&(M=t[t.length-2],R.x=r.x-M.x,R.y=r.y-M.y,C=u(R),R.x/=C,R.y/=C);let W=!1;for(let n=0;nk&&(W=!0)),W){const e=(k-N)/E;E=k-N,M={x:(1-e)*M.x+e*t[n].x,y:(1-e)*M.y+e*t[n].y},--n}else M=t[n];O=M.x,T=M.y;const e=n<=0&&!W,i=n===t.length-1;if(e||(N+=E),j=i?a?t[1]:null:t[n+1],j?(R.x=j.x-O,R.y=j.y-T,C=u(R),R.x/=C,R.y/=C):(R.x=void 0,R.y=void 0),!a){if(e){h(I,R),F=I.x,B=I.y,g===s["d"].SQUARE&&(V(-R.y-R.x,R.x-R.y,R.x,R.y,0,-1),V(R.y-R.x,-R.x-R.y,R.x,R.y,0,1)),g===s["d"].ROUND&&(V(-R.y-R.x,R.x-R.y,R.x,R.y,-1,-1),V(R.y-R.x,-R.x-R.y,R.x,R.y,-1,1)),g!==s["d"].ROUND&&g!==s["d"].BUTT||(V(-R.y,R.x,R.x,R.y,0,-1),V(R.y,-R.x,R.x,R.y,0,1));continue}if(i){o(I,S),F=I.x,B=I.y,g!==s["d"].ROUND&&g!==s["d"].BUTT||(V(S.y,-S.x,-S.x,-S.y,0,-1),V(-S.y,S.x,-S.x,-S.y,0,1)),g===s["d"].SQUARE&&(V(S.y-S.x,-S.x-S.y,-S.x,-S.y,0,-1),V(-S.y-S.x,S.x-S.y,-S.x,-S.y,0,1)),g===s["d"].ROUND&&(V(S.y-S.x,-S.x-S.y,-S.x,-S.y,1,-1),V(-S.y-S.x,S.x-S.y,-S.x,-S.y,1,1));continue}}let r,m,U=-d(S,R);if(Math.abs(U)<.01)f(S,R)>0?(I.x=S.x,I.y=S.y,U=1,r=Number.MAX_VALUE,m=!0):(h(I,R),U=1,r=1,m=!1);else{I.x=(S.x+R.x)/U,I.y=(S.y+R.y)/U,r=u(I);const t=(r-1)*v*p;m=r>4||t>E&&t>C}F=I.x,B=I.y;let G=b;switch(b){case s["o"].BEVEL:r<1.05&&(G=s["o"].MITER);break;case s["o"].ROUND:ry&&(G=s["o"].BEVEL)}switch(G){case s["o"].MITER:if(V(I.x,I.y,-S.x,-S.y,0,-1),V(-I.x,-I.y,-S.x,-S.y,0,1),i)break;if(w){const t=W?0:N;A=this.writeVertex(O,T,F,B,R.x,R.y,I.x,I.y,0,-1,t),L=this.writeVertex(O,T,F,B,R.x,R.y,-I.x,-I.y,0,1,t)}break;case s["o"].BEVEL:{const t=U<0;let e,s,r,n;if(t){const t=A;A=L,L=t,e=z,s=P}else e=P,s=z;if(m)r=t?h(this.innerPrev,S):o(this.innerPrev,S),n=t?o(this.innerNext,R):h(this.innerNext,R);else{const e=t?c(this.inner,I):l(this.inner,I);r=e,n=e}const a=t?o(this.bevelStart,S):h(this.bevelStart,S);V(r.x,r.y,-S.x,-S.y,e.x,e.y);const u=V(a.x,a.y,-S.x,-S.y,s.x,s.y);if(i)break;const d=t?h(this.bevelEnd,R):o(this.bevelEnd,R);if(m){const t=this.writeVertex(O,T,F,B,-S.x,-S.y,0,0,0,0,N);A=this.writeVertex(O,T,F,B,R.x,R.y,n.x,n.y,e.x,e.y,N),L=this.writeVertex(O,T,F,B,R.x,R.y,d.x,d.y,s.x,s.y,N),this.writeTriangle(u,t,L)}else{if(w){const t=this.bevelMiddle;t.x=(a.x+d.x)/2,t.y=(a.y+d.y)/2,_(D,t,-S.x,-S.y),V(t.x,t.y,-S.x,-S.y,D.x,D.y),_(D,t,R.x,R.y),A=this.writeVertex(O,T,F,B,R.x,R.y,t.x,t.y,D.x,D.y,N),L=this.writeVertex(O,T,F,B,R.x,R.y,n.x,n.y,e.x,e.y,N)}else{const t=A;A=L,L=t}V(d.x,d.y,R.x,R.y,s.x,s.y)}if(t){const t=A;A=L,L=t}break}case s["o"].ROUND:{const t=U<0;let e,s;if(t){const t=A;A=L,L=t,e=z,s=P}else e=P,s=z;const n=t?c(this.inner,I):l(this.inner,I);let a,u;m?(a=t?h(this.innerPrev,S):o(this.innerPrev,S),u=t?o(this.innerNext,R):h(this.innerNext,R)):(a=n,u=n);const d=t?o(this.roundStart,S):h(this.roundStart,S),p=t?h(this.roundEnd,R):o(this.roundEnd,R),g=V(a.x,a.y,-S.x,-S.y,e.x,e.y),b=V(d.x,d.y,-S.x,-S.y,s.x,s.y);if(i)break;const y=this.writeVertex(O,T,F,B,-S.x,-S.y,0,0,0,0,N);m||this.writeTriangle(A,L,y);const x=c(this.outer,n),v=this.writeVertex(O,T,F,B,R.x,R.y,p.x,p.y,s.x,s.y,N);let M,j;const E=r>2;if(E){let e;r!==Number.MAX_VALUE?(x.x/=r,x.y/=r,e=f(S,x),e=(r*(e*e-1)+1)/e):e=-1,M=t?o(this.startBreak,S):h(this.startBreak,S),M.x+=S.x*e,M.y+=S.y*e,j=t?h(this.endBreak,R):o(this.endBreak,R),j.x+=R.x*e,j.y+=R.y*e}_(D,x,-S.x,-S.y);const C=this.writeVertex(O,T,F,B,-S.x,-S.y,x.x,x.y,D.x,D.y,N);_(D,x,R.x,R.y);const k=w?this.writeVertex(O,T,F,B,R.x,R.y,x.x,x.y,D.x,D.y,N):C,G=y,W=w?this.writeVertex(O,T,F,B,R.x,R.y,0,0,0,0,N):y;let q=-1,H=-1;if(E&&(_(D,M,-S.x,-S.y),q=this.writeVertex(O,T,F,B,-S.x,-S.y,M.x,M.y,D.x,D.y,N),_(D,j,R.x,R.y),H=this.writeVertex(O,T,F,B,R.x,R.y,j.x,j.y,D.x,D.y,N)),w?E?(this.writeTriangle(G,b,q),this.writeTriangle(G,q,C),this.writeTriangle(W,k,H),this.writeTriangle(W,H,v)):(this.writeTriangle(G,b,C),this.writeTriangle(W,k,v)):E?(this.writeTriangle(y,b,q),this.writeTriangle(y,q,H),this.writeTriangle(y,H,v)):(this.writeTriangle(y,b,C),this.writeTriangle(y,k,v)),m?(A=this.writeVertex(O,T,F,B,R.x,R.y,u.x,u.y,e.x,e.y,N),L=v):(A=w?this.writeVertex(O,T,F,B,R.x,R.y,u.x,u.y,e.x,e.y,N):g,this.writeTriangle(A,W,v),L=v),t){const t=A;A=L,L=t}break}}}}}},2779:function(t,e,i){"use strict";i.d(e,"a",(function(){return V}));i("c120");var s=i("b2b2"),r=i("f4cc"),n=i("0c53"),a=i("175e"),o=i("ce50"),h=i("e92d"),l=i("38a4"),c=i("a915"),u=i("ab39"),d=i("32dd"),f=i("a9a2"),_=i("8c81"),m=i("c84e"),p=i("d114"),g=i("18c6"),b=i("6a2c");function y(t,e){return t[e+1]}function x(t){return t.length-1}function v(t){let e=0;for(let i=0;it._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let i=Math.acos(e);return t>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1t)return this._seekBackwards(t-s);s+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>t)return this.seek(t-i,e);i+=this.length}return this._distance=1,e?this:null}}function T(t,e,i,s=!0){const r=v(t),n=O.create(t),a=r/2;if(!s)return n.seek(a),void i(n.clone(),0,a+0*e,r);const o=Math.max((r-e)/2,0),h=Math.floor(o/e),l=a-h*e;n.seek(l);for(let c=-h;c<=h;c++)n.x<512&&n.x>=0&&n.y<512&&n.y>=0&&i(n.clone(),c,a+c*e,r),n.seek(e)}function M(t,e){const i=e;for(let s=0;s=0&&!(r[s+1]r[u]+c);a++){const s=c-r[a-1]+r[u],l=r[a]-r[a-1],d=r[a]-r[u]R.error(new o["a"](e,t)),C=1,I=0,F=4;function B(t,e){const i=!!t.minScale&&e.scaleToZoom(t.minScale)||0;return Object(l["f"])(i,0,25.5)}function z(t,e){const i=!!t.maxScale&&e.scaleToZoom(t.maxScale)||255;return Object(l["f"])(i,0,25.5)}function P(t){const e=new Map;return i=>(e.has(i)||e.set(i,t(i)),e.get(i))}const D=P(t=>{let e=0;if(0===t)return 1/0;for(;!(t%2);)e++,t/=2;return e}),A=t=>Math.floor(127*t+127),L=t=>Math.floor(10*t),k=t=>Math.round(t*(254/360));class N extends S["a"]{constructor(t,e,i,s){var r,n,a;super(t,i.font.size,i.haloSize||0,i.font.size,i.color&&Object(f["d"])(i.color)||0,i.haloColor&&Object(f["d"])(i.haloColor)||0,i.horizontalAlignment,i.verticalAlignment,Object(d["i"])(e.labelPlacement)?u["a"].MAP:u["a"].SCREEN,i.font.decoration,!1,i.angle||0,i.xoffset,i.yoffset,i.lineWidth,i.lineHeight,null,null,null,null,null),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=m["d"].LABEL,this._allowOverrun=null!=(r=e.allowOverrun)&&r,this._repeatLabel=null==(n=e.repeatLabel)||n,this._labelPosition=null!=(a=e.labelPosition)?a:"curved";const o=B(e,s),h=z(e,s),l=e.labelPlacement,[p,b]=Object(d["c"])(l);this._xAlignD=p,this._yAlignD=b,this._minZoom=o,this._maxZoom=h,this._refPlacementPadding=Object(c["g"])(i.haloSize)+_["N"],this._repeatLabelDistance=e.repeatLabelDistance?Object(c["g"])(e.repeatLabelDistance):128;const y=g["b"].load(t);y.sdf=!0,this._materialKey=y.data}static fromLabelClass(t,e){if("esriServerLinePlacementCenterAlong"===t.labelPlacement){const e=t.symbol;e.xoffset=0,e.yoffset=0,e.angle=0,e.font.decoration="none"}return new N(t.materialKey,t,t.symbol,e)}get _shapedBox(){return Object(s["t"])(this._shapingInfo).bounds}setZoomLevel(t){this._zoomLevel=t}bindReferenceTemplate(t){let e=Object(d["f"])(this._xAlignD),i=Object(d["h"])(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,Object(s["j"])(t))return void(this._refSymbolAndPlacementOffset=Object(p["b"])(0,0,A(e),A(i)));if("circle"===t.boundsType&&(e||i)){const t=Math.sqrt(e*e+i*i);e/=t,i/=t}const r=Math.max(t.height,t.width),n=this._refPlacementPadding*F;this._refSymbolAndPlacementOffset=Object(p["b"])(n,r,A(e),A(i)),this._referenceSize=r,this._refPlacementDirX=e,this._refPlacementDirY=i,this._refOffsetX=t.xOffset,this._refOffsetY=t.yOffset}_write(t,e){if(Object(s["j"])(this._shapingInfo))return;const i=this._shapingInfo,r=e.getDisplayId(),n="esriGeometryPolygon"===e.geometryType?e.readLegacyCentroid():e.readLegacyGeometry();if(n)switch(this.current={out:t,inId:r,inShaping:i,zoomLevel:this._zoomLevel},e.geometryType){case"esriGeometryPolyline":this._placeLineLabels(n);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(n);break;default:E("mapview-labeling",`Geometry of type ${e.geometryType} is not supported`)}}_isVisible(t,e){const i=L(this.current.zoomLevel);return L(t)<=i&&i<=L(e)}_placePointLabels(t){const{out:e,inId:i,inShaping:s}=this.current;this._writeGlyphs(e,i,t,s)}_placeLineLabels(t){const e=M(t.paths,this.current.inShaping.bounds.width),i=this._placeSubdivGlyphs.bind(this),s=(this._shapedBox.width+this._repeatLabelDistance)/(1<=s);)this._placeOnSegment(n,e,a,i,-1,r),a+=n.length+I}_placeForward(t,e,i,s,r){const n=t.clone();let a=t.remainingLength+I;for(;n.next()&&!(a>=s);)this._placeOnSegment(n,e,a,i,1,r),a+=n.length+I}_placeFirst(t,e,i,s=!1){const r=t,n=this.current.inShaping,a=n.glyphs,o=this.current.zoomLevel,{out:h,inId:l}=this.current;for(const c of a){const a=c.x>n.bounds.x?i:1-i,u=a*t.remainingLength+(1-a)*t.backwardLength,d=Math.abs(c.x+c.width/2-n.bounds.x),f=Math.max(0,o+Math.log2(d/(u+I))),_=Math.max(e,s?0:f);if(c.maxZoom=25,c.angle=t.angle+(1-i)*Math.PI,c.minZoom=_,this._writeGlyph(h,l,r.x,r.y,c),i&&this._isVisible(c.minZoom,c.maxZoom)){const t=c.bounds;h.metricBoxWrite(t.center[0],t.center[1],t.width,t.height)}}}_placeOnSegment(t,e,i,s,r,n){const a=this.current.inShaping.glyphs,{out:o,inId:h}=this.current,l=this.current.inShaping,c=this.current.zoomLevel,u=t.dx/t.length,d=t.dy/t.length,f={x:t.x+i*-r*u,y:t.y+i*-r*d};for(const _ of a){const a=_.x>l.bounds.x?n:1-n;if(!(a&&1===r||!a&&-1===r))continue;const u=Math.abs(_.x+_.width/2-l.bounds.x),d=Math.max(0,c+Math.log2(u/i)-.1),m=Math.max(s,c+Math.log2(u/(i+t.length+I)));if(0!==d&&(_.angle=t.angle+(1-n)*Math.PI,_.minZoom=m,_.maxZoom=d,this._writeGlyph(o,h,f.x,f.y,_),n&&this._isVisible(_.minZoom,_.maxZoom))){const i=_.bounds,s=t.x-e.x,r=t.y-e.y;o.metricBoxWrite(i.center[0]+s,i.center[1]+r,i.width,i.height)}}}_writeGlyphs(t,e,i,s,r=this._minZoom){if(i.x<0||i.x>=512||i.y<0||i.y>=512)return;const n=i.x+this._refOffsetX,a=i.y-this._refOffsetY;for(const c of s.glyphs)c.minZoom=r,c.maxZoom=this._maxZoom,this._writeGlyph(t,e,n,a,c);const o=this._refPlacementDirX,h=this._refPlacementDirY,l=s.boundsT;t.metricStart(e,r,n,a,o,h,this._referenceSize,this._materialKey),t.metricBoxWrite(l.center[0],l.center[1],l.width,l.height),t.metricEnd()}_writeVertexCommon(t,e,i,s){const r=this._color,n=this._haloColor,a=Object(p["b"])(0,0,this._size,this._haloSize),o=Math.max(s.minZoom,this._minZoom),h=Math.min(s.maxZoom,this._maxZoom),l=Object(p["b"])(L(o),L(h),this._outLineLabelAngle,0);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(a),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(l)}}var U=i("a8b5"),G=i("0f0f2");class V{constructor(t,e,i){this._loadPromise=Object(n["a"])(),this._geometryType=t,this._idField=e,this._templateStore=i}update(t,e){Object(s["k"])(t.mesh.labels)&&(this._labelTemplates=this._createLabelTemplates(t.mesh.labels,e)),this._schema=t}_createLabelTemplates(t,e){const i=new Map;if("simple"===t.type){for(const s of t.classes){const t=N.fromLabelClass(s,e);i.set(s.index,t)}return i}for(const s in t.classes){const r=t.classes[s];for(const t of r){const s=N.fromLabelClass(t,e);i.set(t.index,s)}}return i}get templates(){return this._templateStore}async analyze(t,e,i,n,o,h,l){if(Object(r["n"])(l))return;let c;"dictionary"===i.type&&(c=await i.analyze(this._idField,t.copy(),e,o,h,l));let u=0;for(;t.next();){let e;if(e=c?c[u++]:Object(s["k"])(n)&&Object(a["h"])(t.getDisplayId())&&1!==t.readAttribute("cluster_count")?n.match(this._idField,t,this._geometryType,o,h):i.match(this._idField,t,this._geometryType,o,h),t.setGroupId(e),Object(G["b"])(e)){const i=this._templateStore.getDynamicTemplateGroup(e);for(const e of i)e&&e.analyze&&e.analyze(this._templateStore,t,o,h)}}return await this._loadPromise,this._templateStore.finalize(l)}async analyzeGraphics(t,e,i,s,n,a){if(Object(r["n"])(a))return;const o=t.getCursor();for(i&&await i.analyze(this._idField,o.copy(),e,s,n,a);o.next();){let t=o.getGroupId();if(null!=t&&-1!==t||(t=i.match(this._idField,o,o.geometryType,s,n),o.setGroupId(t)),Object(G["b"])(t)){const e=this._templateStore.getDynamicTemplateGroup(t);for(const t of e)t&&t.analyze&&t.analyze(this._templateStore,o,s,n)}o.setGroupId(t)}return await this._loadPromise,this._templateStore.finalize(a)}writeGraphic(t,e,i,s){const r=e.getGroupId(),n=e.getDisplayId(),a=this._templateStore.getTemplateGroup(r);if(t.featureStart(e.insertAfter,0),null!=n){if(Object(G["b"])(r))for(const t of a)t&&t.bindFeature(e,null,null);if(a){for(const r of a)r&&r.write(t,e,i,s);t.featureEnd()}}}writeCursor(t,e,i,r,n,a,o){const h=e.getGroupId(),l=e.getDisplayId(),c=this._templateStore.getTemplateGroup(h),u=this._schema.mesh.sortKey;let d=0;if(Object(s["k"])(u)&&(d=null!=u.fieldIndex?e.getComputedNumericAtIndex(u.fieldIndex):null!=u.field?e.readAttribute(u.field):e.readAttribute(this._idField),d*="asc"===u.order?1:-1),t.featureStart(0,null==d||isNaN(d)?0:d),null!=l&&c){if(Object(G["b"])(h))for(const t of c)t.bindFeature(e,i,r);for(const i of c)i.write(t,e,n,o);if(Object(s["k"])(a)&&t.hasRecords){const i=a&&this._findLabelRef(c);this._writeLabels(t,e,a,i,n,o)}t.featureEnd()}}_findLabelRef(t){for(const e of t)if(e instanceof U["a"])return e;return null}_writeLabels(t,e,i,r,n,a){for(const o of i)if(Object(s["k"])(o)&&o){const{glyphs:i,rtl:s,index:h}=o,l=this._labelTemplates.get(h);l.setZoomLevel(n),l.bindReferenceTemplate(r),l.bindTextInfo(i,s),l.write(t,e,null,a)}}}},2855:function(t,e,i){"use strict";i.d(e,"a",(function(){return u}));var s=i("a29a"),r=i("1c92"),n=i("8c71"),a=i("3349"),o=i("738e"),h=i("8c81"),l=i("e4b1");class c{acquire(t){return{refCount:1,version:-1,labelMat2d:Object(n["b"])(),tileMat3:Object(n["b"])(),dvs:Object(n["b"])()}}release(t){}}class u extends l["a"]{constructor(t,e,i){super(t,e,i,h["P"],h["P"])}destroy(){super.destroy(),this._transforms&&u.TransformCache.release(this.key.hash)}setTransform(t,e){const i=e/(t.resolution*t.pixelRatio),n=this.transforms.tileMat3,[h,l]=t.toScreenNoRotation([0,0],[this.x,this.y]),c=this.width/this.rangeX*i,u=this.height/this.rangeY*i;Object(r["o"])(n,c,0,0,0,u,0,h,l,1),Object(r["l"])(this.transforms.dvs,t.displayViewMat3,n);const d=this.transforms.labelMat2d,f=t.getScreenTransform(d,e),_=Object(o["a"])();Object(a["t"])(_,[this.x,this.y],f),Object(s["a"])(d,_),Object(s["f"])(d,t.viewMat2d,d)}_createTransforms(){return u.TransformCache.acquire(this.key.hash)}}u.TransformCache=new c},"2da5":function(t,e,i){"use strict";i.d(e,"a",(function(){return l})),i.d(e,"b",(function(){return h}));var s,r=i("8c81"),n=i("3976"),a=i("1d01");class o{constructor(t,e,i){this.ratio=t,this.x=e,this.y=i}}class h{constructor(t,e,i,s=8,n=8){this.lines=[],this.starts=[],this.validateTessellation=!0,this.pixelRatio=s,this.pixelMargin=n,this.tileSize=r["P"]*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;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 n["b"](t,e),this._firstPt=new n["b"](t,e),this._dist=0}lineTo(t,e){const i=this._isIn(t,e),s=new n["b"](t,e),r=n["b"].distance(this._prevPt,s);let a,h,l,c,u,d,f,_;if(i)this._prevIsIn?this._lineTo(t,e,!0):(a=this._prevPt,h=s,l=this._intersect(h,a),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,a=s,l=this._intersect(h,a),this._lineTo(l.x,l.y,!0),this._lineTo(a.x,a.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.xthis.xmin||t.x>this.xmin&&e.x=this.ymax?d=!0:i.push(new o(c,this.xmin,_))),(t.xthis.xmax||t.x>this.xmax&&e.x=this.ymax?d=!0:i.push(new o(c,this.xmax,_))),(t.ythis.ymin||t.y>this.ymin&&e.y=this.xmax?u=!0:i.push(new o(c,f,this.ymin))),(t.ythis.ymax||t.y>this.ymax&&e.y=this.xmax?u=!0:i.push(new o(c,f,this.ymax))),0===i.length)u?d?this._lineTo(this.xmax,this.ymax,!0):this._lineTo(this.xmax,this.ymin,!0):d?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;t2){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===n["a"].Polygon&&t&&c.simplify(this.tileSize,this.margin*this.finalRatio,this.lines),this.lines)}resultWithStarts(){if(this.type!==n["a"].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=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),a=(s-t.y)/(e.y-t.y);n0&&(this.lines.push(this.line),this.starts.push(this.start)):this.type===n["a"].LineString?this.line.length>1&&(this.lines.push(this.line),this.starts.push(this.start)):this.type===n["a"].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!==n["a"].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 n["b"](t,e))):(i||(tthis.xmax&&(t=this.xmax),ethis.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 n["b"](t,e)),this._is_h=!1,this._is_v=!1)}_lineTo(t,e,i){let s,r;if(this.type!==n["a"].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&&(s=this.line[this.line.length-1],s.equals(t,e)))return;this.line.push(new n["b"](t,e))}else this.line&&this.line.length>0&&this._pushLine();else if(i||(tthis.xmax&&(t=this.xmax),ethis.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){s=this.line[this.line.length-1];const i=s.x===t,a=s.y===e;if(i&&a)return;this._is_h&&i||this._is_v&&a?(s.x=t,s.y=e,r=this.line[this.line.length-2],r.x===t&&r.y===e?(this.line.pop(),this.line.length<=1?(this._is_h=!1,this._is_v=!1):(r=this.line[this.line.length-2],this._is_h=r.x===t,this._is_v=r.y===e)):(this._is_h=r.x===t,this._is_v=r.y===e)):(this.line.push(new n["b"](t,e)),this._is_h=i,this._is_v=a)}else this.line.push(new n["b"](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 n["b"](t*i,e*i))}lineTo(t,e){const i=this._ratio;this.line.push(new n["b"](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"}(s||(s={}));class c{static simplify(t,e,i){if(!i)return;const r=-e,n=t+e,a=-e,o=t+e,h=[],l=[],u=i.length;for(let c=0;ce.y?(h.push(c),h.push(i),h.push(s.sideLeft),h.push(-1)):(l.push(c),l.push(i),l.push(s.sideLeft),l.push(-1))),u.x>=n&&(u.y=o&&(u.x>e.x?(h.push(c),h.push(i),h.push(s.sideBottom),h.push(-1)):(l.push(c),l.push(i),l.push(s.sideBottom),l.push(-1)))),u=e}if(0===h.length||0===l.length)return;c.fillParent(i,l,h),c.fillParent(i,h,l);const d=[];c.calcDeltas(d,l,h),c.calcDeltas(d,h,l),c.addDeltas(d,i)}static fillParent(t,e,i){const r=i.length,n=e.length;for(let o=0;o1&&s[n-2]===r?0:(s.push(r),c.calcDelta(r,i,e,s)+1)}static addDeltas(t,e){const i=t.length;let r=0;for(let s=0;sr&&(r=e)}for(let n=0;n\nuniform mediump vec2 u_mosaicSize;\nuniform mediump float u_patternFactor;\nvarying mediump vec2 v_tileTextureCoord;\nvarying mediump vec4 v_tlbr;\n#endif\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nvarying lowp vec4 v_color;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\n#ifdef PATTERN\nfloat patternWidth = nextPOT(tlbr.z - tlbr.x);\nfloat patternHeight = nextPOT(tlbr.w - tlbr.y);\nfloat scaleX = 1.0 / (patternWidth * u_patternFactor);\nfloat scaleY = 1.0 / (patternHeight * u_patternFactor);\nmat3 patterMat = mat3(scaleX, 0.0, 0.0,\n0.0, -scaleY, 0.0,\n0.0, 0.0, 1.0);\nv_tileTextureCoord = (patterMat * vec3(a_pos, 1.0)).xy;\nv_tlbr = tlbr / u_mosaicSize.xyxy;\n#endif\nvec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(u_fillTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n}"},icon:{"icon.frag":"precision mediump float;\nuniform lowp sampler2D u_texture;\n#ifdef SDF\nuniform lowp vec4 u_color;\nuniform lowp vec4 u_outlineColor;\n#endif\nvarying mediump vec2 v_tex;\nvarying lowp float v_opacity;\nvarying mediump vec2 v_size;\nvarying lowp vec4 v_color;\n#ifdef SDF\nvarying mediump flaot v_halo_width;\n#endif\n#ifdef ID\nvarying mediump vec4 v_id;\n#endif\n#include \nvec4 mixColors(vec4 color1, vec4 color2) {\nfloat compositeAlpha = color2.a + color1.a * (1.0 - color2.a);\nvec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a);\nreturn vec4(compositeColor, compositeAlpha);\n}\nvoid main()\n{\n#ifdef SDF\nlowp vec4 fillPixelColor = v_color;\nfloat d = rgba2float(texture2D(u_texture, v_tex)) - 0.5;\nconst float softEdgeRatio = 0.248062016;\nfloat size = max(v_size.x, v_size.y);\nfloat dist = d * softEdgeRatio * size;\nfillPixelColor *= clamp(0.5 - dist, 0.0, 1.0);\nif (v_halo_width > 0.25) {\nlowp vec4 outlinePixelColor = u_outlineColor;\nconst float outlineLimitRatio = (16.0 / 86.0);\nfloat clampedOutlineSize = softEdgeRatio * min(v_halo_width, outlineLimitRatio * max(v_size.x, v_size.y));\noutlinePixelColor *= clamp(0.5 - (abs(dist) - clampedOutlineSize), 0.0, 1.0);\ngl_FragColor = v_opacity * mixColors(fillPixelColor, outlinePixelColor);\n}\nelse {\ngl_FragColor = v_opacity * fillPixelColor;\n}\n#else\nlowp vec4 texColor = texture2D(u_texture, v_tex);\ngl_FragColor = v_opacity * texColor;\n#endif\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = v_id;\n#endif\n}","icon.vert":"attribute vec2 a_pos;\nattribute vec2 a_vertexOffset;\nattribute vec4 a_texAngleRange;\nattribute vec4 a_levelInfo;\nattribute float a_opacityInfo;\n#pragma header\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nvarying lowp vec4 v_color;\n#ifdef SDF\nvarying mediump float v_halo_width;\n#endif\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump vec2 u_iconTranslation;\nuniform vec2 u_mosaicSize;\nuniform mediump float u_depth;\nuniform mediump float u_mapRotation;\nuniform mediump float u_level;\nuniform lowp float u_keepUpright;\nuniform mediump float u_fadeDuration;\nvarying mediump vec2 v_tex;\nvarying lowp float v_opacity;\nvarying mediump vec2 v_size;\nconst float C_OFFSET_PRECISION = 1.0 / 8.0;\nconst float C_256_TO_RAD = 3.14159265359 / 128.0;\nconst float C_DEG_TO_RAD = 3.14159265359 / 180.0;\nconst float tileCoordRatio = 1.0 / 8.0;\nuniform highp float u_time;\nvoid main()\n{\n#pragma main\nv_color = color;\nv_opacity = opacity;\n#ifdef SDF\nv_halo_width = halo_width;\n#endif\nfloat modded = mod(a_opacityInfo, 128.0);\nfloat targetOpacity = (a_opacityInfo - modded) / 128.0;\nfloat startOpacity = modded / 127.0;\nfloat interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0);\nv_opacity *= interpolatedOpacity;\nmediump float a_angle = a_levelInfo[1];\nmediump float a_minLevel = a_levelInfo[2];\nmediump float a_maxLevel = a_levelInfo[3];\nmediump vec2 a_tex = a_texAngleRange.xy;\nmediump float delta_z = 0.0;\nmediump float rotated = mod(a_angle + u_mapRotation, 256.0);\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * step(64.0, rotated) * (1.0 - step(192.0, rotated));\ndelta_z += 1.0 - step(a_minLevel, u_level);\ndelta_z += step(a_maxLevel, u_level);\ndelta_z += step(v_opacity, 0.0);\nvec2 offset = C_OFFSET_PRECISION * a_vertexOffset;\nv_size = abs(offset);\n#ifdef SDF\noffset = (120.0 / 86.0) * offset;\n#endif\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayViewMat3 * vec3(size * offset, 0.0) + u_displayMat3 * vec3(u_iconTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth + delta_z, 1.0);\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\nv_tex = a_tex.xy / u_mosaicSize;\n}"},line:{"line.frag":"precision lowp float;\nvarying mediump vec2 v_normal;\nvarying highp float v_accumulatedDistance;\nvarying mediump float v_lineHalfWidth;\nvarying lowp vec4 v_color;\nvarying mediump float v_blur;\n#if defined (PATTERN) || defined(SDF)\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\nvarying mediump float v_widthRatio;\nuniform sampler2D u_texture;\nuniform mediump float u_antialiasing;\n#endif\n#ifdef SDF\n#include \n#endif\n#ifdef ID\nvarying mediump vec4 v_id;\n#endif\nvoid main()\n{\nmediump float fragDist = length(v_normal) * v_lineHalfWidth;\nlowp float alpha = clamp((v_lineHalfWidth - fragDist) / v_blur, 0.0, 1.0);\n#ifdef PATTERN\nmediump float relativeTexX = fract(v_accumulatedDistance / (v_patternSize.x * v_widthRatio));\nmediump float relativeTexY = 0.5 + v_normal.y * v_lineHalfWidth / (v_patternSize.y * v_widthRatio);\nmediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\nlowp vec4 color = texture2D(u_texture, texCoord);\ngl_FragColor = alpha * v_color[3] * color;\n#elif defined(SDF)\nmediump float relativeTexX = fract((v_accumulatedDistance * 0.5) / (v_patternSize.x * v_widthRatio));\nmediump float relativeTexY = 0.5 + 0.25 * v_normal.y;\nmediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\nmediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5;\nfloat dist = d * (v_lineHalfWidth + u_antialiasing / 2.0);\ngl_FragColor = alpha * clamp(0.5 - dist, 0.0, 1.0) * v_color;\n#else\ngl_FragColor = alpha * v_color;\n#endif\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = v_id;\n#endif\n}","line.vert":"precision mediump float;\nattribute vec2 a_pos;\nattribute vec4 a_extrude_offset;\nattribute vec4 a_dir_normal;\nattribute vec2 a_accumulatedDistance;\n#pragma header\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump float u_zoomFactor;\nuniform mediump vec2 u_lineTranslation;\nuniform mediump float u_antialiasing;\nuniform mediump float u_depth;\nvarying mediump vec2 v_normal;\nvarying highp float v_accumulatedDistance;\nconst float scale = 1.0 / 31.0;\nconst mediump float tileCoordRatio = 8.0;\n#if defined (SDF)\nconst mediump float sdfPatternHalfWidth = 15.5;\n#endif\n#if defined (PATTERN) || defined(SDF)\nuniform mediump vec2 u_mosaicSize;\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\nvarying mediump float v_widthRatio;\n#endif\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nvarying lowp vec4 v_color;\nvarying mediump float v_lineHalfWidth;\nvarying mediump float v_blur;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\nv_blur = blur + u_antialiasing;\nv_normal = a_dir_normal.zw * scale;\n#if defined (PATTERN) || defined(SDF)\nv_tlbr = tlbr / u_mosaicSize.xyxy;\nv_patternSize = vec2(tlbr.z - tlbr.x, tlbr.y - tlbr.w);\n#if defined (PATTERN)\nv_widthRatio = width / v_patternSize.y;\n#else\nv_widthRatio = width / sdfPatternHalfWidth / 2.0;\n#endif\n#endif\nv_lineHalfWidth = (width + u_antialiasing) * 0.5;\nmediump vec2 dir = a_dir_normal.xy * scale;\nmediump vec2 offset_ = a_extrude_offset.zw * scale * offset;\nmediump vec2 dist = v_lineHalfWidth * scale * a_extrude_offset.xy;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos + offset_ * tileCoordRatio / u_zoomFactor, 1.0) + u_displayViewMat3 * vec3(dist, 0.0) + u_displayMat3 * vec3(u_lineTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n#if defined (PATTERN) || defined(SDF)\nv_accumulatedDistance = a_accumulatedDistance.x * u_zoomFactor / tileCoordRatio + dot(dir, dist + offset_);\n#endif\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\n}"},outline:{"outline.frag":"varying lowp vec4 v_color;\nvarying mediump vec2 v_normal;\n#ifdef ID\nvarying mediump vec4 v_id;\n#endif\nvoid main()\n{\nlowp float dist = abs(v_normal.y);\nlowp float alpha = smoothstep(1.0, 0.0, dist);\ngl_FragColor = alpha * v_color;\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = v_id;\n#endif\n}","outline.vert":"attribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_xnormal;\n#pragma header\nvarying lowp vec4 v_color;\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump vec2 u_fillTranslation;\nuniform mediump float u_depth;\nuniform mediump float u_outline_width;\nvarying lowp vec2 v_normal;\nconst float scale = 1.0 / 15.0;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\nv_normal = a_xnormal;\nmediump vec2 dist = u_outline_width * scale * a_offset;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(dist + u_fillTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n}"},text:{"text.frag":"uniform lowp sampler2D u_texture;\nvarying lowp vec2 v_tex;\nvarying lowp vec4 v_color;\nvarying mediump float v_edgeWidth;\nvarying mediump float v_edgeDistance;\n#ifdef ID\nvarying mediump vec4 v_id;\n#endif\nvoid main()\n{\nlowp float dist = texture2D(u_texture, v_tex).a;\nmediump float alpha = smoothstep(v_edgeDistance - v_edgeWidth, v_edgeDistance + v_edgeWidth, dist);\ngl_FragColor = alpha * v_color;\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = v_id;\n#endif\n}","text.vert":"attribute vec2 a_pos;\nattribute vec2 a_vertexOffset;\nattribute vec4 a_texAngleRange;\nattribute vec4 a_levelInfo;\nattribute float a_opacityInfo;\n#pragma header\nvarying lowp vec4 v_color;\n#ifdef ID\nuniform mediump vec4 u_id;\nvarying mediump vec4 v_id;\n#endif\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump vec2 u_textTranslation;\nuniform vec2 u_mosaicSize;\nuniform mediump float u_depth;\nuniform mediump float u_mapRotation;\nuniform mediump float u_level;\nuniform lowp float u_keepUpright;\nuniform mediump float u_fadeDuration;\nvarying lowp vec2 v_tex;\nconst float offsetPrecision = 1.0 / 8.0;\nconst mediump float edgePos = 0.75;\nuniform mediump float u_antialiasingWidth;\nvarying mediump float v_edgeDistance;\nvarying mediump float v_edgeWidth;\nuniform lowp float u_halo;\nconst float sdfFontScale = 1.0 / 24.0;\nconst float sdfPixel = 3.0;\nuniform highp float u_time;\nvoid main()\n{\n#pragma main\nif (u_halo > 0.5)\n{\nv_color = halo_color * opacity;\nhalo_width *= sdfPixel;\nhalo_blur *= sdfPixel;\n}\nelse\n{\nv_color = color * opacity;\nhalo_width = 0.0;\nhalo_blur = 0.0;\n}\nfloat modded = mod(a_opacityInfo, 128.0);\nfloat targetOpacity = (a_opacityInfo - modded) / 128.0;\nfloat startOpacity = modded / 127.0;\nfloat interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0);\nv_color *= interpolatedOpacity;\nmediump float a_angle = a_levelInfo[1];\nmediump float a_minLevel = a_levelInfo[2];\nmediump float a_maxLevel = a_levelInfo[3];\nmediump vec2 a_tex = a_texAngleRange.xy;\nmediump float a_visMinAngle = a_texAngleRange.z;\nmediump float a_visMaxAngle = a_texAngleRange.w;\nmediump float delta_z = 0.0;\nmediump float angle = mod(a_angle + u_mapRotation, 256.0);\nif (a_visMinAngle < a_visMaxAngle)\n{\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) + (1.0 - step(a_visMinAngle, angle)));\n}\nelse\n{\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) * (1.0 - step(a_visMinAngle, angle)));\n}\ndelta_z += 1.0 - step(a_minLevel, u_level);\ndelta_z += step(a_maxLevel, u_level);\ndelta_z += step(v_color[3], 0.0);\nv_tex = a_tex.xy / u_mosaicSize;\n#ifdef ID\nv_id = u_id / 255.0;\n#endif\nv_edgeDistance = edgePos - halo_width / size;\nv_edgeWidth = (u_antialiasingWidth + halo_blur) / size;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + sdfFontScale * u_displayViewMat3 * vec3(offsetPrecision * size * a_vertexOffset, 0.0) + u_displayMat3 * vec3(u_textTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth + delta_z, 1.0);\n}"},util:{"encoding.glsl":"const vec4 rgba2float_factors = vec4(\n255.0 / (256.0),\n255.0 / (256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n);\nfloat rgba2float(vec4 rgba) {\nreturn dot(rgba, rgba2float_factors);\n}","util.glsl":"float nextPOT(in float x) {\nreturn pow(2.0, ceil(log2(abs(x))));\n}"}};var n=i("49f0");function a(t){let e=r;return t.split("/").forEach(t=>{e&&(e=e[t])}),e}const o=new n["a"](a);function h(t){return o.resolveIncludes(t)}var l=i("d45f");const c=t=>Object(l["a"])({ID:t.id,PATTERN:t.pattern}),u={shaders:t=>({vertexShader:c(t)+h("background/background.vert"),fragmentShader:c(t)+h("background/background.frag")})},d=t=>Object(l["a"])({ID:t.id}),f={shaders:t=>({vertexShader:d(t)+h("circle/circle.vert"),fragmentShader:d(t)+h("circle/circle.frag")})},_=t=>Object(l["a"])({ID:t.id,PATTERN:t.pattern}),m={shaders:t=>({vertexShader:_(t)+h("fill/fill.vert"),fragmentShader:_(t)+h("fill/fill.frag")})},p=t=>Object(l["a"])({ID:t.id}),g={shaders:t=>({vertexShader:p(t)+h("outline/outline.vert"),fragmentShader:p(t)+h("outline/outline.frag")})},b=t=>Object(l["a"])({ID:t.id,SDF:t.sdf}),y={shaders:t=>({vertexShader:b(t)+h("icon/icon.vert"),fragmentShader:b(t)+h("icon/icon.frag")})},x=t=>Object(l["a"])({ID:t.id,PATTERN:t.pattern,SDF:t.sdf}),v={shaders:t=>({vertexShader:x(t)+h("line/line.vert"),fragmentShader:x(t)+h("line/line.frag")})},w=t=>Object(l["a"])({ID:t.id}),O={shaders:t=>({vertexShader:w(t)+h("text/text.vert"),fragmentShader:w(t)+h("text/text.frag")})};class T{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(t=>t.dispose()),this._programByKey.clear()}getMaterialProgram(t,e,i){const s=e.key<<3|this._getMaterialOptionsValue(e.type,i);if(this._programByKey.has(s))return this._programByKey.get(s);const r=this._getProgramTemplate(e.type),{shaders:n}=r,{vertexShader:a,fragmentShader:o}=n(i),h=e.getShaderHeader(),l=e.getShaderMain(),c=a.replace("#pragma header",h).replace("#pragma main",l),u=t.programCache.acquire(c,o,e.getAttributeLocations());return this._programByKey.set(s,u),u}_getMaterialOptionsValue(t,e){switch(t){case s["b"].BACKGROUND:{const t=e;return(t.pattern?1:0)<<1|(t.id?1:0)}case s["b"].FILL:{const t=e;return(t.pattern?1:0)<<1|(t.id?1:0)}case s["b"].OUTLINE:return e.id?1:0;case s["b"].LINE:{const t=e;return(t.sdf?1:0)<<2|(t.pattern?1:0)<<1|(t.id?1:0)}case s["b"].ICON:{const t=e;return(t.sdf?1:0)<<1|(t.id?1:0)}case s["b"].CIRCLE:return e.id?1:0;case s["b"].TEXT:return e.id?1:0;default:return 0}}_getProgramTemplate(t){switch(t){case s["b"].BACKGROUND:return u;case s["b"].CIRCLE:return f;case s["b"].FILL:return m;case s["b"].ICON:return y;case s["b"].LINE:return v;case s["b"].OUTLINE:return g;case s["b"].TEXT:return O;default:return null}}}},3976:function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return s}));class s{constructor(t,e){this.x=t,this.y=e}clone(){return new s(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 s(t.x+e.x,t.y+e.y)}static sub(t,e){return new s(t.x-e.x,t.y-e.y)}}var r;!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon"}(r||(r={}))},"3de4":function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));const s=1.25;class r{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)}get length(){return this._pos}_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((this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT)*s,this._buffer.BYTES_PER_ELEMENT),i=new ArrayBuffer(e),r=new this._ctor(i);r.set(this._buffer,0),this._array=i,this._buffer=r,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!e.has(t.objectId))}append(t){for(const e of t)this._features.push(e)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let t="";for(const e in this._current.attributes)t+=this._current.attributes[e];return t}getIndex(){return this._featureIndex}setIndex(t){this._featureIndex=t}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(t){this._current.displayId=t}getGroupId(){return this._current.groupId}setGroupId(t){this._current.groupId=t}copy(){const t=new h(this.instance,this._features,this.fullSchema());return this.copyInto(t),t}next(){for(;++this._featureIndext.toLowerCase()).includes(t.toLowerCase())}getFieldNames(){return Object.keys(this._current.attributes)}_readAttribute(t,e){const i=this._current.attributes[t];if(void 0!==i)return null!=i&&e&&this._dateFields.has(t)?new Date(i):i;const s=this.readAttributes(),r=t.toLocaleLowerCase().trim();for(const n in s)if(n.toLocaleLowerCase().trim()===r){const t=this._current.attributes[n];return null!=t&&e&&this._dateFields.has(n)?new Date(t):t}}copyInto(t){super.copyInto(t),t._featureIndex=this._featureIndex,t._transform=this._transform,t._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}}},"44d1":function(t,e,i){"use strict";i.d(e,"a",(function(){return f}));var s=i("b2b2"),r=i("a915"),n=i("6655"),a=i("e416"),o=i("8c81"),h=i("c84e"),l=i("d114"),c=i("18c6"),u=i("1b4a");const d=8,f=t=>class extends t{constructor(...t){super(...t),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=h["d"].TEXT,this._aux=Object(l["b"])(0,0,this._referenceSize,this._bitset)}bindTextInfo(t,e){t&&t.length?this._shapingInfo=Object(s["b"])(t,t=>Object(u["a"])(t,e,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:o["u"]*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM})):this._shapingInfo=null}_write(t,e,i,s){const r=e.getDisplayId();this._writeGeometry(t,e,r,i,s)}_writeGeometry(t,e,i,r,a){const o=this._shapingInfo;if(Object(s["j"])(o))return;if(Object(s["k"])(this._textPlacement)){const s=null!=a?a:e.readLegacyGeometryForDisplay();return this._writePlacedText(t,i,s,o,r)}const h=a?Object(n["q"])(Object(n["d"])(a),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!Object(s["j"])(h)){if(h.isPoint){const[e,s]=h.coords;if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(e<0||e>=512||s<0||s>=512))return;return this._writeGlyphs(t,i,{x:e,y:s},o)}h.forEachVertex((e,s)=>this._writeGlyphs(t,i,{x:e,y:s},o))}}_writePlacedText(t,e,i,n,o){const h=Object(s["t"])(this._textPlacement),l=a["a"].getPlacement(i,h,Object(r["g"])(1),o.geometryEngine);if(!l)return;let c=l.next();for(;null!=c;){const i=-c.getAngle();n.setRotation(i);const s=c.tx,r=-c.ty;s<0||s>=512||r<0||r>=512||(this._writeGlyphs(t,e,{x:s,y:r},n),n.setRotation(-i)),c=l.next()}}_writeGlyphs(t,e,i,s){const r=c["e"].load(this._materialKey),n=Object(l["a"])(Math.round(d*i.x),Math.round(d*i.y)),a=this._vertexBoundsScale,o=s.bounds,h=2*Math.max(o.width,o.height);for(const l of s.glyphs)r.textureBinding=l.textureBinding,t.recordStart(e,r.data,this.geometryType,!0),t.vertexBounds(i.x+o.x+this._xOffset,i.y+o.y-this._yOffset,h*a,h*a),this._writeVertices(t,e,n,l),t.recordEnd()}_writeGlyph(t,e,i,s,r){const n=c["e"].load(this._materialKey),a=Object(l["a"])(Math.round(d*i),Math.round(d*s));n.textureBinding=r.textureBinding,t.recordStart(e,n.data,this.geometryType,!0);const o=r.bounds,h=this._vertexBoundsScale;t.vertexBounds(i+o.x*h,s+o.y*h,o.width*h,o.height*h),this._writeVertices(t,e,a,r),t.recordEnd()}_writeVertices(t,e,i,s){const r=t.vertexCount();this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperLeft),t.vertexWrite(s.texcoords.upperLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperRight),t.vertexWrite(s.texcoords.upperRight),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerLeft),t.vertexWrite(s.texcoords.lowerLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerRight),t.vertexWrite(s.texcoords.lowerRight),t.vertexEnd(),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}_writeVertexCommon(t,e,i,s){const r=this._color,n=this._haloColor,a=Object(l["b"])(0,0,this._referenceSize,this._bitset),o=Object(l["b"])(0,0,this._size,this._haloSize);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(o),t.vertexWrite(a),t.vertexWrite(this._minMaxZoom)}}},"4b0b":function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var s=i("175e");class r{constructor(){this._freeIds=[],this._idCounter=1}createId(t=!1){return Object(s["d"])(this._getFreeId(),t)}releaseId(t){this._freeIds.push(t)}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}var n=i("7de1");function a(t,e,i){if(!(t.length>e))for(;t.length<=e;)t.push(i)}class o{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new r,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const t=this._bitsets.length;return this._bitsets.push(n["a"].create(this._allocatedSize,s["a"])),t+1}getBitset(t){return this._bitsets[t-1]}_expand(){this._allocatedSize<<=1;for(const t of this._bitsets)t.resize(this._allocatedSize)}_ensureNumeric(t,e){this._numerics[t]||(this._numerics[t]=[]),a(this._numerics[t],e,0)}_ensureInstanceId(t){a(this._instanceIds,t,0)}_ensureString(t,e){this._strings[t]||(this._strings[t]=[]),a(this._strings[t],e,null)}createDisplayId(t=!1){const e=this._idGenerator.createId();return e>this._allocatedSize&&this._expand(),Object(s["d"])(e,t)}releaseDisplayId(t){for(const e of this._bitsets)e.unset(t);return this._idGenerator.releaseId(t&s["a"])}getComputedNumeric(t,e){return this.getComputedNumericAtIndex(t&s["a"],0)}setComputedNumeric(t,e,i){return this.setComputedNumericAtIndex(t&s["a"],i,0)}getComputedString(t,e){return this.getComputedStringAtIndex(t&s["a"],0)}setComputedString(t,e,i){return this.setComputedStringAtIndex(t&s["a"],0,i)}getComputedNumericAtIndex(t,e){const i=t&s["a"];return this._ensureNumeric(e,i),this._numerics[e][i]}setComputedNumericAtIndex(t,e,i){const r=t&s["a"];this._ensureNumeric(e,r),this._numerics[e][r]=i}getInstanceId(t){const e=t&s["a"];return this._ensureInstanceId(e),this._instanceIds[e]}setInstanceId(t,e){const i=t&s["a"];this._ensureInstanceId(i),this._instanceIds[i]=e}getComputedStringAtIndex(t,e){const i=t&s["a"];return this._ensureString(e,i),this._strings[e][i]}setComputedStringAtIndex(t,e,i){const r=t&s["a"];this._ensureString(e,r),this._strings[e][r]=i}getXMin(t){return this._bounds[4*(t&s["a"])]}getYMin(t){return this._bounds[4*(t&s["a"])+1]}getXMax(t){return this._bounds[4*(t&s["a"])+2]}getYMax(t){return this._bounds[4*(t&s["a"])+3]}setBounds(t,e){const i=e.readHydratedGeometry();if(!i||!i.coords.length)return!1;let r=1/0,n=1/0,o=-1/0,h=-1/0;i.forEachVertex((t,e)=>{r=Math.min(r,t),n=Math.min(n,e),o=Math.max(o,t),h=Math.max(h,e)});const l=t&s["a"];return a(this._bounds,4*l+4,0),this._bounds[4*l]=r,this._bounds[4*l+1]=n,this._bounds[4*l+2]=o,this._bounds[4*l+3]=h,!0}}},"561f":function(t,e,i){"use strict";i.d(e,"a",(function(){return ce}));var s=i("a4ee"),r=i("fc29"),n=i("f57e"),a=i("9096"),o=i("c120"),h=i("b2b2"),l=i("f4cc"),c=i("59b2"),u=(i("b50f"),i("cea0"),i("d386")),d=i("5996"),f=i("9180"),_=i("32ed"),m=i("a9ab"),p=i("28b1"),g=i("f547"),b=i("f70f"),y=i("7f83");function x(t){if(!t)return null;let e=null;const i=t.spatialReference,s=Object(y["e"])(i);if(!s)return"toJSON"in t?t.toJSON():t;const r=Object(y["p"])(i)?102100:4326,n=b["a"][r].maxX,a=b["a"][r].minX,o=b["a"][r].plus180Line,h=b["a"][r].minus180Line;let l;const c="toJSON"in t?t.toJSON():t;if(Object(m["f"])(c))l=O(c,n,a);else if(Object(m["e"])(c))c.points=c.points.map(t=>O(t,n,a)),l=c;else if(Object(m["d"])(c))l=w(c,s);else if(Object(m["g"])(c)||Object(m["h"])(c)){const t=E;Object(p["a"])(t,c);const i={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},s=Object(b["d"])(i.xmin,a)*(2*n),r=0===s?c:v(c,s);i.xmin+=s,i.xmax+=s,Object(g["b"])(i,o)&&i.xmax!==n||Object(g["b"])(i,h)&&i.xmin!==a?e=r:l=r}else l=c;return null!==e?(new R).cut(e,n):l}function v(t,e){const i=Object(b["b"])(t);for(const s of i)for(const t of s)t[0]+=e;return t}function w(t,e){if(!e)return t;const i=T(t,e).map(t=>t.extent);return i.length<2?i[0]||t:i.length>2?(t.xmin=e.valid[0],t.xmax=e.valid[1],t):{rings:i.map(t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]])}}function O(t,e,i){if(Array.isArray(t)){const s=t[0];if(s>e){const i=Object(b["d"])(s,e);t[0]=s+i*(-2*e)}else if(se){const i=Object(b["d"])(s,e);t.x+=i*(-2*e)}else if(s0;if(n>2*c){const t={xmin:af||m?i.push({extent:{xmin:u,ymin:s,xmax:c,ymax:r},frameIds:[d]},{extent:{xmin:l,ymin:s,xmax:f,ymax:r},frameIds:[_]}):i.push({extent:{xmin:u,ymin:s,xmax:f,ymax:r},frameIds:[d]});return i}function M(t,e){const[i,s]=e.valid,r=2*s;let n,a=0;return t>s?(n=Math.ceil(Math.abs(t-s)/r),t-=n*r,a=n):t=t.xmin&&e<=t.xmax&&i>=t.ymin&&i<=t.ymax}class R{cut(t,e){let i;if(t.rings)this.closed=!0,i=t.rings,this.minPts=4;else{if(!t.paths)return null;this.closed=!1,i=t.paths,this.minPts=2}const s=i.length,r=-2*e;for(let n=0;n=this.minPts){const e=[];for(const i of t)e.push([i[0]+r,i[1]]);i.push(e)}}return this.closed?t.rings=i:t.paths=i,t}}const E=Object(f["l"])();var C=i("1ec3"),I=i("793f"),F=i("a6c1"),B=i("8c81");const z=-1;class P{constructor(){this._dirties=[{vertexFrom:z,vertexCount:z,indexFrom:z,indexCount:z,allDirty:!1},{vertexFrom:z,vertexCount:z,indexFrom:z,indexCount:z,allDirty:!1},{vertexFrom:z,vertexCount:z,indexFrom:z,indexCount:z,allDirty:!1},{vertexFrom:z,vertexCount:z,indexFrom:z,indexCount:z,allDirty:!1},{vertexFrom:z,vertexCount:z,indexFrom:z,indexCount:z,allDirty:!1}]}hasDirty(){return this._dirties.some(t=>t.indexCount!==z||t.allDirty)}markAllClean(){for(const t of this._dirties)t.indexFrom=z,t.indexCount=z,t.vertexFrom=z,t.vertexCount=z,t.allDirty=!1}markAllDirty(){for(const t of this._dirties)t.allDirty=!0}forEach(t){for(let e=0;e0)&&(o.geometry={count:r,from:n,allDirty:a},l=!0),(a||s!==z&&i>0)&&(h={count:i,from:s,allDirty:a},l=!0),l&&t({indices:h,vertices:o},e)}}markDirtyIndices(t,e,i){const s=this._dirties[t],r=e,n=i;if(!s.allDirty)if(s.indexCount!==z){const t=Math.min(s.indexFrom,r),e=Math.max(s.indexFrom+s.indexCount,r+n)-t;s.indexFrom=t,s.indexCount=e}else s.indexFrom=r,s.indexCount=n}markDirtyVertices(t,e,i,s){const r=this._dirties[t],n=i,a=s;if(!r.allDirty)if(r.vertexCount!==z){const t=Math.min(r.vertexFrom,n),e=Math.max(r.vertexFrom+r.vertexCount,n+a)-t;r.vertexFrom=t,r.vertexCount=e}else r.vertexFrom=n,r.vertexCount=a}}class D{constructor(t){this._largestRange=null,this._parent=t,this._updateLargestRange()}get largestRange(){return this._largestRange}rangeCreated(t){(!this._largestRange||t.count>this._largestRange.count)&&(this._largestRange=t)}rangeResized(t,e){t===this._largestRange?t.countthis._largestRange.count)&&(this._largestRange=t)}findBestRange(t){let e=this._parent._freeHead,i=null;for(;null!==e;)e.count>=t&&(!i||e.count-t=a&&t+e<=o?(i=!1,s=!0):null!==n?(r=n,n=n.next):i=!1}return[r,n]}_updateLargestRange(){let t=null,e=this._parent._freeHead;for(;null!==e;)(!t||e.count>t.count)&&(t=e),e=e.next;this._largestRange=t}}class A{constructor(t,e){this._allocated=0,this._size=t,this._freeHead=t>0?{from:0,count:t,prev:null,next:null}:null,this._bookKeeper=e||new D(this),this._freeHead&&this._bookKeeper.rangeCreated(this._freeHead)}allocate(t){const e=this._bookKeeper.findBestRange(t);if(null===e)return-1;const i=e.from,s=e.count;if(e.from+=t,e.count-=t,this._bookKeeper.rangeResized(e,i,s),this._allocated+=t,0===e.count){const t=null!==e.prev?this._freeHead:e.next;A._removeRange(e),this._freeHead=t}return i}free(t,e){const[i,s]=this._bookKeeper.findAdjacentRanges(t,e),r={from:t,count:e,prev:i,next:s};if(null!==i&&(i.next=r),null!==s&&(s.prev=r),this._bookKeeper.rangeCreated(r),this._allocated-=e,null!==s&&r.from+r.count===s.from){const t=r.from,e=r.count;A._fuse(r,s),A._removeRange(s),this._bookKeeper.rangeResized(r,t,e),this._bookKeeper.rangeResized(s,void 0,0)}if(null!==i&&i.from+i.count===r.from){const t=i.from,e=i.count;A._fuse(i,r),A._removeRange(r),this._bookKeeper.rangeResized(i,t,e),this._bookKeeper.rangeResized(r,void 0,0)}this._freeHead=null!==r.prev?this._freeHead:r}get fragmentation(){const t=this._size-this._allocated;return 0===t?0:1-this._bookKeeper.largestRange.count/t}static _removeRange(t){null!==t.prev?null!==t.next?(t.prev.next=t.next,t.next.prev=t.prev):t.prev.next=null:null!==t.next&&(t.next.prev=null)}static _fuse(t,e){t.count+=e.count,t.next=e.next,e.from+=e.count,e.count=0,null!==e.next&&(e.next.prev=t)}}var L=i("c8dd");const k=["FILL","LINE","MARKER","TEXT","LABEL"];function N(t){const e=t.getStrides(),i={};for(let s=0;st.vertexCount?(this._freeVertices(n,t.vertexFrom,t.vertexCount),o=e.vertexCount,a=this._allocateVertices(n,o)):e.vertexCount===t.vertexCount?(a=t.vertexFrom,o=t.vertexCount):(this._freeVertices(n,t.vertexFrom+e.vertexCount,t.vertexCount-e.vertexCount),a=t.vertexFrom,o=e.vertexCount);let h,l,c,u=!0;if(void 0===t.indexFrom?(h=r,c=e.indexCount,l=this._allocateIndices(n,c)):e.indexCount>t.indexCount?(h=this._displayList.removeFromList(t),this._freeIndices(n,t.indexFrom,t.indexCount),c=e.indexCount,l=this._allocateIndices(n,c)):e.indexCount===t.indexCount?(u=!1,l=t.indexFrom,c=t.indexCount):(h=this._displayList.removeFromList(t),this._freeIndices(n,t.indexFrom+e.indexCount,t.indexCount-e.indexCount),l=t.indexFrom,c=e.indexCount),-1!==a&&-1!==l){const r=this._storageFor(n);if(Object(L["e"])(a,l,r.vertexBuffers,r.indexBuffer,e,i,s),t.vertexFrom=a,t.indexFrom=l,t.vertexCount=e.vertexCount,t.indexCount=e.indexCount,this._dirtyMap){this._dirtyMap.markDirtyIndices(t.geometryType,t.indexFrom,t.indexCount);for(const e in i)this._dirtyMap.markDirtyVertices(t.geometryType,e,t.vertexFrom,t.vertexCount)}return u&&this._displayList.addToList(t,h),!0}return-1!==a&&this._freeVertices(n,a,o),-1!==l&&this._freeIndices(n,l,c),t.setMeshDataFromBuffers(e,i,s),t.vertexFrom=void 0,t.vertexCount=0,t.indexFrom=void 0,t.indexCount=0,!1}tryAddMeshData(t,e){const i=e.vertexBuffer,s=e.indexBuffer,r=k[t.geometryType],n=this._allocateVertices(r,t.vertexCount);if(-1===n)return this._freeVertices(r,n,t.vertexCount),!1;const a=this._allocateIndices(r,t.indexCount);if(-1===a)return this._freeVertices(r,n,t.vertexCount),this._freeIndices(r,a,t.indexCount),!1;const o=this._storageFor(r);if(Object(L["e"])(n,a,o.vertexBuffers,o.indexBuffer,t,i,s),t.vertexFrom=n,t.indexFrom=a,this._dirtyMap){this._dirtyMap.markDirtyIndices(t.geometryType,t.indexFrom,t.indexCount);for(const e in i)this._dirtyMap.markDirtyVertices(t.geometryType,e,n,t.vertexCount)}return this._displayList.addToList(t),!0}_allocateVertices(t,e){const i=this._storageFor(t),s=i.vtxFreeList.allocate(e);return-1===s||i.vtxFreeList.fragmentation>U?-1:s}_freeVertices(t,e,i){this._storageFor(t).vtxFreeList.free(e,i)}_freeIndices(t,e,i){this._storageFor(t).idxFreeList.free(e,i)}_allocateIndices(t,e){const i=this._storageFor(t),s=i.idxFreeList.allocate(e);return-1===s||i.idxFreeList.fragmentation>U?-1:s}_storageFor(t){return this._freeListsAndStorage[t]}_stridesFor(t,e){return this._strides[t][e]}}var V=i("7ce4"),W=i("d17d"),q=i("0fa6");class H{constructor(t){this.geometryMap=Object(L["f"])(()=>({indexBuffer:V["a"].createIndex(t,W["D"].STATIC_DRAW),vao:null}),(e,i)=>({vertexBuffer:V["a"].createVertex(t,L["a"][i])}))}dispose(){for(let t=0;t<5;t++){const e=this.geometryMap[t];if(e){e.data.vao&&e.data.vao.dispose(!1),e.data.indexBuffer&&e.data.indexBuffer.dispose();for(const t in e.buffers)e.buffers[t]&&e.buffers[t].data.vertexBuffer.dispose()}}}get(t){const e=this.geometryMap[t];return{getVAO(t,i,s){if(!e.data.vao){const r={};for(const t in e.buffers)r[t]=e.buffers[t].data.vertexBuffer;e.data.vao=new q["a"](t,s,i,r,e.data.indexBuffer)}return e.data.vao}}}has(t){return null!=this.geometryMap[t]}upload(t,e){e.forEach((e,i)=>{this._upload(e,i,t)})}_upload(t,e,i){if(t.indices&&(t.indices.allDirty?this._uploadIndices(i,e):null!=t.indices.from&&null!=t.indices.count&&this._uploadIndices(i,e,t.indices.from,t.indices.count)),t.vertices){const s=t.vertices;for(const t in s){const r=s[t];r.allDirty?this._uploadVertices(i,e,t):null!=r.from&&null!=r.count&&this._uploadVertices(i,e,t,r.from,r.count)}}}_uploadVertices(t,e,i,s,r){const n=this.geometryMap[e];if(!n)return;const a=t.geometries[e].vertexBuffer[i];if(!a)return;const o=a.stride,h=a.data.buffer;n.buffers[i]&&h.byteLength>0&&(null!=s&&null!=r?n.buffers[i].data.vertexBuffer.setSubData(h,s*o,s*o,(s+r)*o):n.buffers[i].data.vertexBuffer.setData(h))}_uploadIndices(t,e,i,s){const r=this.geometryMap[e];if(!r)return;const n=4,a=t.geometries[e].indexBuffer.buffer;r.data.indexBuffer&&a.byteLength>0&&(null!=i&&null!=s?r.data.indexBuffer.setSubData(a,i*n,i*n,(i+s)*n):r.data.indexBuffer.setData(a))}}var Z=i("2855");class K extends Z["a"]{constructor(){super(...arguments),this._data=null,this._displayList=null,this._lastCommitTime=0,this._hasData=!1,this._invalidated=!1,this._wglBuffers=null,this._dirtyMap=new P}destroy(){super.destroy(),this.clear()}get hasData(){return!!this._hasData}get displayObjects(){var t;return null!=(t=this._displayObjects)?t:[]}getGeometry(t){return this._wglBuffers&&this._wglBuffers.has(t)?this._wglBuffers.get(t):null}getDisplayList(){return this._displayList}patch(t){if(!0===t.clear)return this.clear(),void(this._hasData=!1);const e=t.addOrUpdate,i=t.remove;!this._data&&e&&e.tileDisplayData.displayObjects.length?(e.tileDisplayData.computeDisplayList(),this._dirtyMap=new P,this._dispRecStore=G.fromTileData(e,this._dirtyMap),this._data=e,this._dirtyMap.markAllDirty(),this._hasData=!0,t.end&&this.ready()):this._data&&(e&&e.tileDisplayData.displayObjects.length||i.length)?this._doPatchData(t):t.end&&this.ready(),t.end&&!this._data&&this.clear(),this.requestRender(),this.emit("change")}commit(t){t.time&&t.time===this._lastCommitTime||(this._lastCommitTime=t.time,this.visible&&this._data&&(this._wglBuffers||(this._wglBuffers=new H(t.context)),(this._dirtyMap.hasDirty()||this._invalidated)&&(this._invalidated=!1,this._wglBuffers.upload(this._data.tileBufferData,this._dirtyMap),this._displayList=this._data.tileDisplayData.displayList.clone(),this._displayObjects=this._data.tileDisplayData.displayObjects.slice(),this._dirtyMap.markAllClean())))}clear(){this._data=null,this._displayList=null,this._dispRecStore=null,this._wglBuffers&&(this._wglBuffers.dispose(),this._wglBuffers=null)}_doPatchData(t){this._invalidated=!0,this._patchData(t)||(this._dirtyMap.markAllDirty(),this._data.reshuffle(),this._dispRecStore=G.fromTileData(this._data,this._dirtyMap)),this.requestRender()}_patchData(t){let e=!0;const i=t.addOrUpdate&&t.addOrUpdate.tileDisplayData&&t.addOrUpdate.tileDisplayData.displayObjects||[],s=(t.remove||[]).slice();for(const r of i)null!=r.insertAfter&&s.push(r.id);for(const r of s){const t=this._data.tileDisplayData.displayObjectRegistry.get(r);if(t){this._data.tileDisplayData.displayList.removeFromList(t.displayRecords);for(const i of t.displayRecords)this._dispRecStore.delete(i);this._data.tileDisplayData.displayObjectRegistry.delete(r);const e=this._data.tileDisplayData.displayObjects.indexOf(t);this._data.tileDisplayData.displayObjects.splice(e,1)}}for(const r of i){let i,s=this._data.tileDisplayData.displayObjectRegistry.get(r.id);if(s){const t=s.displayRecords;s.set(r),s.displayRecords=t;const e=s.displayRecords.length;for(let i=0;i=r.displayRecords.length||t.geometryType!==e.geometryType||t.symbolLevel!==e.symbolLevel||t.zOrder!==e.zOrder||t.materialKey!==e.materialKey)&&(this._dispRecStore.delete(s.displayRecords[i]),i=0){const i=this._data.tileDisplayData.displayObjectRegistry.get(s.insertAfter);i?(t=e.indexOf(i)+1,t0?1:0;let n=0;for(let r=t-1;r>=0&&n=0&&ni.indexFrom&&s<=i.indexFrom+i.indexCount){if(s=0&&ne.indexFrom&&t.indexFromt.clone()),t.line=this.line&&this.line.map(t=>t.clone()),t.marker=this.marker&&this.marker.map(t=>t.clone()),t.text=this.text&&this.text.map(t=>t.clone()),t.label=this.label&&this.label.map(t=>t.clone()),t.unified=this.unified&&this.unified.map(t=>t.clone()),t}}class rt{constructor(){this.geometryDPInfo=new st}clone(){const t=new rt;return t.zLevel=this.zLevel,t.geometryDPInfo=this.geometryDPInfo.clone(),t}}class nt{constructor(){this.zLevels=[]}clone(){const t=new nt;t.symbolLevel=this.symbolLevel;for(const e of this.zLevels)t.zLevels.push(e.clone());return t}}class at{constructor(){this.vertexData=new Map,this.vertexCount=0,this.indexData=[]}clear(){this.vertexData.clear(),this.vertexCount=0,this.indexData=[]}update(t,e,i){for(const s in t)this.vertexData.set(s,t[s]);for(const s in this.vertexData)null===t[s]&&this.vertexData.delete(s);this.vertexCount=e,this.indexData=i}}class ot{constructor(t,e,i,s=0,r=0){this.id=t,this.geometryType=e,this.materialKey=i,this.minZoom=s,this.maxZoom=r,this.meshData=null,this.symbolLevel=0,this.zOrder=0,this.vertexFrom=0,this.vertexCount=0,this.indexFrom=0,this.indexCount=0}get sortKey(){return void 0===this._sortKey&&this._computeSortKey(),this._sortKey}clone(){return this.copy()}copy(){const t=new ot(this.id,this.geometryType,this.materialKey);return t.vertexFrom=this.vertexFrom,t.vertexCount=this.vertexCount,t.indexFrom=this.indexFrom,t.indexCount=this.indexCount,t.zOrder=this.zOrder,t.symbolLevel=this.symbolLevel,t.meshData=this.meshData,t.minZoom=this.minZoom,t.maxZoom=this.maxZoom,t}setMeshDataFromBuffers(t,e,i){const s=new at;for(const r in e){const i=e[r].stride,n=e[r].data,a=[],o=Object(L["A"])(i);for(let e=0;et.clone()),t.insertAfter=this.insertAfter,t}set(t){this.id=t.id,this.displayRecords=t.displayRecords,this.insertAfter=t.insertAfter}serialize(t){return t.push(this.id),ht(t,this.displayRecords),t}static deserialize(t){const e=t.readInt32(),i=new ct(e),s={id:e};return i.displayRecords=lt(t,ot,s),i}}function ut(t){const e=[[],[],[],[],[]],i=t;for(const s of i)for(const t of s.displayRecords)e[t.geometryType].push(t);return e}class dt{constructor(){}get displayObjectRegistry(){if(!this._displayObjectRegistry){this._displayObjectRegistry=new Map;for(const t of this.displayObjects)this._displayObjectRegistry.set(t.id,t)}return this._displayObjectRegistry}get displayList(){return this._displayList}computeDisplayList(){this._displayList=new et;for(const t of this.displayObjects)for(const e of t.displayRecords)this._displayList.addToList(e)}clone(){const t=new dt;return this.displayObjects&&(t.displayObjects=this.displayObjects.map(t=>t.clone())),t}serialize(t){return ht(t,this.displayObjects),t}_deserializeObjects(t){const e=t.readInt32(),i=new Array(e),s=new Map;for(let r=0;r{const r=t.data[e];if(Object(h["k"])(r)){const t=ft["a"].from(r.records).getCursor();for(;t.next();){const i=t.id,r=t.materialKey,n=t.indexFrom,a=t.indexCount,o=t.vertexFrom,h=t.vertexCount,l=s.get(i),c=new ot(i,e,r);c.indexFrom=n,c.indexCount=a,c.vertexFrom=o,c.vertexCount=h,l.displayRecords.push(c)}i[e]=mt.fromVertexData(r,e)}else i[e]=new bt(e,0,{fill:"default"}).intoBuffers()}),Mt.fromMeshData({displayObjects:e,vertexBuffersMap:i})}static fromMeshData(t){const e=new Mt,i=new dt,s=new $;i.displayObjects=t.displayObjects;for(const r in t.vertexBuffersMap){const e=t.vertexBuffersMap[r];s.geometries[r].indexBuffer=e.indexBuffer,s.geometries[r].vertexBuffer=e.namedBuffers}return e.tileDisplayData=i,e.tileBufferData=s,e}static bind(t,e){const i=new Mt;return i.tileDisplayData=t,i.tileBufferData=e,i}static create(t,e){const i=new Mt;i.tileDisplayData=new dt,i.tileDisplayData.displayObjects=t;const s=[0,0,0,0,0],r=[0,0,0,0,0],n=[[],[],[],[],[]];for(const h of t)for(const t of h.displayRecords)n[t.geometryType].push(t),s[t.geometryType]+=t.meshData.vertexCount,r[t.geometryType]+=t.meshData.indexData.length;const a=new $,o=Tt(e);for(let h=0;h!!t.geometry);for(const r of s){const t=Object(m["c"])(r.geometry);Object(Bt["e"])(i,[r],t,!1,!1,"uid")}return new Dt(e,i)}get geometryType(){const t=this._current;return t?t.geometryType:null}get insertAfter(){return this._current.insertAfter}readGraphic(){return this._current}getCursor(){return this.copy()}copy(){const t=new Dt(this.instance,this._features);return this.copyInto(t),t}}var At=i("a915"),Lt=i("901f"),kt=i("a8d5"),Nt=i("5ee9"),Ut=i("57e5"),Gt=i("008c"),Vt=i("8152"),Wt=i("334f");const qt=new Vt["a"],Ht=new Vt["a"],Zt="esriGeometryPolyline";function Kt(t){t.coords.length=0,t.lengths.length=0}class Yt{constructor(){this.bounds=Object(f["l"])(),this.graphic=null}static acquire(t=null,e,i,s,r){let n;return 0===Yt._pool.length?n=new Yt:(n=Yt._pool.pop(),this._set.delete(n)),n.acquire(t,e,i,s,r),n}static release(t){t&&!this._set.has(t)&&(t.release(),this._pool.push(t),this._set.add(t))}static getCentroidQuantized(t,e){if(Object(m["g"])(t.geometry)){const i=t.symbol;if(Object(h["j"])(i))return null;if(Object(Wt["f"])(i.type)||Object(Wt["g"])(i.type)){const i=Object(Ut["b"])(t.geometry);return Object(Gt["b"])(e,{},{x:i[0],y:i[1]},!1,!1)}}return null}acquire(t=null,e,i,s,r){t&&this.set(t,e,i,s,r)}release(){this.graphic=null,this.symbolResource=null,this.geometry=null}get symbol(){return this.symbolResource.symbol}set(t,e,i,s,r){this.graphic=t,this.geometry=i,this.symbolResource=e,this.bounds=s,r&&(this.size=r)}getGeometryQuantized(t,e,i,s){const r=this.geometry;if(Object(m["g"])(r)){const e=r.rings;if(1===e.length&&2===e[0].length)return Object(Gt["a"])(t,{paths:[[e[0][0],e[0][1]]]})}else{if(Object(m["h"])(r))return Kt(qt),Kt(Ht),Object(Bt["i"])(qt,r),Object(Bt["r"])(Ht,qt,r.hasZ,r.hasM,Zt,t.scale[0]),Object(Bt["v"])(qt,Ht,r.hasZ,r.hasM,Zt,t),Object(Bt["p"])(qt,r.hasZ,r.hasM);if(Object(m["e"])(r)){const n=.5*s*Math.max(Math.abs(this.size[0])+this.size[2]-this.size[0],Math.abs(this.size[1])+this.size[3]-this.size[1]),[a,o]=Object(b["c"])(i),h=o-a,l=r.points.filter(t=>{if(t[0]+n>o||t[0]-no?i[0]-=h:i[0]+=h,Object(f["j"])(e,t,n)||Object(f["j"])(e,i,n)}return Object(f["j"])(e,t,n)});return 0===l.length?{points:l}:Object(Gt["a"])(t,{points:l})}}return Object(Gt["a"])(t,this.geometry)}}Yt._pool=[],Yt._set=new Set;const Xt={minX:0,minY:0,maxX:0,maxY:0},$t=Object(f["l"])(),Qt=1e-5;function Jt(t,e,i,s,r){return Xt.minX=e,Xt.minY=i,Xt.maxX=s,Xt.maxY=r,t.search(Xt)}function te(t){return{minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]}}class ee{constructor(t,e,i,s,r,n,a){this._graphics=s,this._onAdd=r,this._onRemove=n,this._hashToCIM=a,this._index=Object(Lt["a"])(9,te),this._itemByGraphic=new Map,this._inflatedSizeHelper=new I["a"],this._tileInfoView=t,this._uidFieldName=i;const o=t.getClosestInfoForScale(e);o&&(this._resolution=this._tileInfoView.getTileResolution(o.level))}setResourceManager(t){this._cimResourceManager=t,this._hittestDrawHelper=new Nt["c"](t)}hitTest(t,e,i,s,r){t=Object(kt["b"])(t,this._tileInfoView.spatialReference);const n=.5*s*window.devicePixelRatio*i;$t[0]=t-n,$t[1]=e-n,$t[2]=t+n,$t[3]=e+n;const a=.5*s*(i+Wt["a"]),o=Jt(this._index,t-a,e-a,t+a,e+a);if(!o||0===o.length)return[];const h=[],l=Object(f["l"])(),c=Object(f["l"])();for(const _ of o){const{geometry:t,symbolResource:e}=_;this._getSymbolBounds(l,e,t,c,r),c[3]=c[2]=c[1]=c[0]=0,Object(f["w"])(l,$t)&&_.graphic.visible&&h.push(_)}if(0===h.length)return[];const u=this._hittestDrawHelper,d=[];for(const f of h){const{geometry:t,symbolResource:e}=f,{hash:i,textInfo:n}=e,a=this._hashToCIM.get(i);a&&u.hitTest($t,a.symbol,t,n,r,s)&&d.push(f)}return d.sort(ie),d.map(t=>t.graphic)}getGraphicsData(t,e,i){const s=this._searchForItems(e);if(0===s.length||0===i.length)return[];s.sort((t,e)=>t.zorder-e.zorder),s[0].insertAfter=-1;for(let c=1;ct.graphic.uid-e.graphic.uid),i.sort((t,e)=>t.uid-e.uid);let r,n=0,a=0;const o=e.resolution,h=[],l={originPosition:"upperLeft",scale:[o,o],translate:[e.bounds[0],e.bounds[3]]};for(const c of i){for(a=-2;nt.zorder-e.zorder),h}queryTileData(t,e){if(0===this._graphics.length)return[];const{bounds:i,resolution:s}=e,r=this._searchForItems(e),n=[];return 0===r.length||this._createTileGraphics(n,t,r,{originPosition:"upperLeft",scale:[s,s],translate:[i[0],i[3]]},e),n}has(t){return this._itemByGraphic.has(t)}getBounds(t){const e=this._itemByGraphic.get(t);return e?e.bounds:null}getAllBounds(){return Array.from(this._itemByGraphic.values()).filter(t=>t.graphic.visible).map(t=>t.bounds)}addOrModify(t,e,i){if(!t||Object(h["j"])(e))return;this.has(t)&&this.remove(t),this._onAdd(t);const s=[0,0,0,0],r=this._getSymbolBounds(null,e,i,s,0),n=Yt.acquire(t,e,i,Object(h["k"])(r)?r:null,s);return this._itemByGraphic.set(t,n),i&&this._index.insert(n),n.bounds}remove(t){if(!this._itemByGraphic.has(t))return;this._onRemove(t);const e=this._itemByGraphic.get(t);e.bounds&&this._index.remove(e),this._itemByGraphic.delete(t)}updateZ(){const t=this._graphics.items;let e,i;for(let s=0;st.zorder-e.zorder);for(let f=0;f{const i=Object(Wt["d"])(t.graphic),s=Object(Wt["d"])(e.graphic);return i===s?e.zorder-t.zorder:i-s};var se=i("f47d"),re=i("040f"),ne=i("b2af"),ae=i("ec58");const oe=Object(o["a"])("esri-2d-graphic-debug");function he(t,e,i){if(i.has(t))return i.get(t);const s={tile:e,addedOrModified:[],removed:[]};return i.set(t,s),s}let le=class extends(Object(re["a"])(Object(a["b"])(r["a"]))){constructor(t){super(t),this._storage=new Ft["a"],this._displayIds=new Map,this._controller=new AbortController,this._tiles=new Map,this._graphicStoreUpdate=!1,this._graphicsSet=new Set,this._matcher=Promise.resolve(null),this._tileUpdateSet=new Set,this._tilesToUpdate=new Map,this._graphicIdToAbortController=new Map,this._attached=!1,this._updatingGraphicsTimer=null,this._hashToExpandedSymbol=new Map,this._hashToExpandedSymbolPromise=new Map,this._hashToCIMSymbolPromise=new Map,this._hashToCIM=new Map,this._processing=!1,this._needsProcessing=!1,this._pendingUpdate={added:new Set,updated:new Set,removed:new Set},this.lastUpdateId=-1,this.updateRequested=!1,this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this._updatingGraphicsTimer&&(clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=null,this.notifyChange("updating")),this._controller.abort(),this.container.destroy(),this._set("graphics",null),this._graphicStore.clear(),this._attributeStore=null,this._hashToExpandedSymbol.clear(),this.view=null,this.renderer=null,this._hashToCIM.clear(),this._hashToCIMSymbolPromise.clear(),this._hashToExpandedSymbolPromise.clear()}_createMatcher(t,e,i){if(t){const s=Object(Ct["a"])({indexCount:0,fields:{}},"feature",t);this._matcher=Object(Et["a"])(s,e,null,i)}}_createDisplayId(t){return this._displayIds.has(t)||this._displayIds.set(t,this._storage.createDisplayId()),this._displayIds.get(t)}initialize(){this._attributeStore=new It["a"]({type:"local",initialize:t=>Promise.resolve(this.container.attributeView.initialize(t)),update:t=>this.container.attributeView.requestUpdate(t),render:()=>this.container.requestRender()},Object(ne["a"])()),this.container.hasHighlight=()=>this._attributeStore.hasHighlight;const t=t=>{this._createDisplayId(t.uid),this._setFilterState(t.uid,t.visible)},e=t=>{const e=this._displayIds.get(t.uid);this._displayIds.delete(t.uid),this._storage.releaseDisplayId(e)},i=new Rt["a"](this.container.getMaterialItems.bind(this.container),this.view.featuresTilingScheme.tileInfo);this._graphicStore=new ee(this.view.featuresTilingScheme,this.view.state.scale,this.uid,this.graphics,t,e,this._hashToCIM),this._meshFactory=new St["a"](null,this.uid,i),this._templateStore=i,this.handles.add([this.watch("renderer",t=>{this._createMatcher(t,i,this.container.stage.resourceManager);for(const e of this.graphics)this._pendingUpdate.updated.add(e);this.requestUpdate()}),this.view.graphicsTileStore.on("update",t=>this._onTileUpdate(t)),this.container.on("attach",()=>{oe&&this.container.enableRenderingBounds(()=>this._graphicStore.getAllBounds()),this.graphics.items.length>0&&this._graphicsChangeHandler({target:this.graphics,added:this.graphics.items,removed:[],moved:[]}),this.handles.add(this.graphics.on("change",t=>this._graphicsChangeHandler(t)),"graphics");const t=this.container.stage.resourceManager;this._createMatcher(this.renderer,i,t),this._graphicStore.setResourceManager(t),this._attached=!0,this.notifyChange("updating")})]);const s=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:s,removed:[]})}get updating(){return!this._attached||null!==this._updatingGraphicsTimer||this._tileUpdateSet.size>0||this._tilesToUpdate.size>0}hitTest(t){if(!this.view||!this.view.position)return null;const{resolution:e,rotation:i}=this.view.state;return this._graphicStore.hitTest(t.x,t.y,2,e,i)}update(t){Object(l["v"])(this._controller.signal);const e=t.state,{resolution:i}=e;if(this._graphicStore.updateLevel(i),this._graphicStoreUpdate=!0,this.updateRequested=!1,this._pendingUpdate.updated.size>0){if(!this._processing)return void this._updateGraphics();this._needsProcessing=!0}}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback())}processUpdate(t){this.updateRequested&&(this.updateRequested=!1,this.update(t))}graphicUpdateHandler(t){const{graphic:e,property:i,newValue:s}=t;switch(i){case"attributes":case"geometry":case"symbol":this._pendingUpdate.updated.add(e),this.requestUpdate();break;case"visible":this._setFilterState(e.uid,s),this._attributeStore.sendUpdates()}}setHighlight(t){const e=t.map(t=>this._displayIds.get(t));this._attributeStore.setHighlight(t,e)}_getIntersectingTiles(t){const e=this._graphicStore.getBounds(t);if(!e||0===Object(f["C"])(e)||0===Object(f["u"])(e))return[];const i=Object(Wt["e"])(e,this.view.spatialReference);return Object(h["k"])(i)?[...new Set([...this.view.graphicsTileStore.boundsIntersections(i[0]),...this.view.graphicsTileStore.boundsIntersections(i[1])])]:this.view.graphicsTileStore.boundsIntersections(e)}async _updateTile(t){Object(l["v"])(this._controller.signal);const e=t.tile,i=this._getGraphicsData(this._templateStore,e,t.addedOrModified),s=await this._processGraphics(e,i);return Object(l["v"])(this._controller.signal),this._patchTile(e.key,{type:"update",addOrUpdate:s,remove:t.removed,end:!0,clear:!1,sort:!1}),s}_patchTile(t,e){if(!this._tiles.has(t))return;const i=this._tiles.get(t);this.container.onTileData(i,e),this.container.requestRender()}_graphicsChangeHandler(t){const e=this._pendingUpdate;for(const i of t.added)e.added.add(i);for(const i of t.moved)e.updated.add(i);for(const i of t.removed)this._pendingUpdate.added.has(i)?e.added.delete(i):e.removed.add(i);this._processing?this._needsProcessing=!0:this._updateGraphics()}_getGraphicsToUpdate(){const t={added:[],removed:[],updated:[]};if(!this.graphics)return t;const e=this._pendingUpdate;for(const i of this.graphics.items)e.added.has(i)?t.added.push(i):e.updated.has(i)&&t.updated.push(i);for(const i of e.removed)this._graphicStore.has(i)&&t.removed.push(i);return e.added.clear(),e.removed.clear(),e.updated.clear(),t}async _updateGraphics(){this._processing=!0;const{added:t,removed:e,updated:i}=this._getGraphicsToUpdate(),s=this._tilesToUpdate;let r;try{if(!this._graphicStoreUpdate){const t=this.view.state,{resolution:e}=t;this._graphicStore.updateLevel(e)}const n=[],a=new Array(t.length+e.length);for(let t=0;t({name:e,alias:e,type:"string"==typeof t.attributes[e]?"esriFieldTypeString":"esriFieldTypeDouble"}));return Object(h["j"])(t.geometry)?null:{geometryType:Object(m["c"])(t.geometry),spatialReference:d["a"].fromJSON(t.geometry.spatialReference),fields:e}}_getSymbolForGraphic(t,e){return Object(l["v"])(this._controller.signal),Object(h["k"])(t.symbol)?Promise.resolve(t.symbol):Object(h["k"])(this.renderer)?this.renderer.getSymbolAsync(t,{scale:this.view.scale,abortOptions:e}):Promise.resolve(this._getNullSymbol(t))}_getCIMSymbol(t,e,i){let s=this._hashToCIM.get(e);if(s)return Promise.resolve(s);const r=Object(I["f"])(t);if(Object(h["k"])(r)){if("CIMSymbolReference"===r.type)return s=r,this._hashToCIM.set(e,s),Promise.resolve(s);let t=this._hashToCIMSymbolPromise.get(e);return t||(t=r.fetchCIMSymbol(i).then(t=>(this._hashToCIM.set(e,t.data),this._hashToCIMSymbolPromise.delete(e),t)).catch(t=>(this._hashToCIMSymbolPromise.delete(e),Object(l["u"])(t),null)),this._hashToCIMSymbolPromise.set(e,t),t)}return Promise.resolve(null)}_expandCIMSymbol(t,e,i,s){const r=this._hashToExpandedSymbol.get(i);if(r)return Promise.resolve(r);let n=this._hashToExpandedSymbolPromise.get(i);if(n)return n;const a=this.container.stage,o=this._getArcadeInfo(e),h=Object(Ct["c"])(null),l=Object(ae["createSymbolSchema"])(t,h);return n=Object(se["b"])(l,o,a.resourceManager,s),this._hashToExpandedSymbolPromise.set(i,n),n.then(t=>(this._hashToExpandedSymbol.set(i,t),this._hashToExpandedSymbolPromise.delete(i),t)),n}async _getSymbolResources(t,e){return Object(l["v"])(this._controller.signal),this.container.stage?this._getSymbolForGraphic(t,e).then(i=>{const s=i.hash();return this._getCIMSymbol(i,s,e).then(i=>Object(h["j"])(i)?null:this._expandCIMSymbol(i,t,s,e).then(t=>{const e=t.layers.filter(t=>"text"===t.type&&"string"==typeof t.text);if(e&&e.length>0){const i=new Array(e.length);for(let t=0;t{for(let t=0;t(Object(l["u"])(t),null)):null}async _projectAndNormalizeGeometry(t,e){if(Object(l["v"])(this._controller.signal),Object(h["j"])(t.geometry)||"mesh"===t.geometry.type)return null;let i=t.geometry;if(Object(m["g"])(i)){const t=i.rings;i.rings=t}else if(Object(m["h"])(i)){const t=i.paths;i.paths=t}else if(Object(m["d"])(i)){const s=await this._getSymbolForGraphic(t,e);Object(l["v"])(this._controller.signal),i=Object(Wt["f"])(s.type)||Object(Wt["g"])(s.type)?i.center:Object(Wt["h"])(i)}await Object(C["a"])(i.spatialReference,this.view.spatialReference);const s=x(i),r=Object(C["b"])(s,i.spatialReference,this.view.spatialReference);return Object(_["a"])(r),r}_onTileUpdate(t){const e=Object(y["e"])(this.view.spatialReference);if(t.added&&t.added.length>0)for(const i of t.added)this._addNewTile(i,e);if(t.removed&&t.removed.length>0)for(const i of t.removed)this._removeTile(i.key)}async _addGraphic(t){this._abortProcessingGraphic(t.uid),Object(l["v"])(this._controller.signal);const e=new AbortController;this._graphicIdToAbortController.set(t.uid,e);const i={signal:e.signal};try{await this._addOrUpdateGraphic(t,i),Object(l["v"])(this._controller.signal),this._graphicIdToAbortController.delete(t.uid)}catch(s){if(this._graphicIdToAbortController.delete(t.uid),!Object(l["m"])(s))throw s}}_updateGraphic(t,e){Object(l["v"])(this._controller.signal);const i=this._projectAndNormalizeGeometry(t,e),s=this._getSymbolResources(t,e);return Promise.all([i,s]).then(([e,i])=>{Object(l["v"])(this._controller.signal),this._graphicStore.addOrModify(t,i,e)})}_addOrUpdateGraphic(t,e){Object(l["v"])(this._controller.signal);const i=this._projectAndNormalizeGeometry(t,e),s=this._getSymbolResources(t,e);return Promise.all([i,s]).then(([e,i])=>{Object(l["v"])(this._controller.signal),this._graphicsSet.has(t)&&this._graphicStore.addOrModify(t,i,e)})}_addTile(t){const e=this.view.featuresTilingScheme.getTileBounds(Object(f["l"])(),t),i=new K(t,e[0],e[3]);return this._tiles.set(t,i),this.container.addChild(i),i}async _addNewTile(t,e){const i=this._addTile(t.key),s=this._graphicStore.queryTileData(this._templateStore,t);if(0===s.length)return;if(e){const i=Math.round((e.valid[1]-e.valid[0])/t.resolution);for(const t of s)t.geometry&&(Object(m["f"])(t.geometry)||Object(m["e"])(t.geometry))&&this._wrapPoints(t,i)}const r=t.key;this._tileUpdateSet.add(t.key),this.notifyChange("updating");try{const e={type:"update",clear:!1,addOrUpdate:await this._processGraphics(t,s),remove:[],end:!0,sort:!1};i.patch(e),this._tileUpdateSet.delete(r),this.notifyChange("updating")}catch(n){if(this._tileUpdateSet.delete(r),this.notifyChange("updating"),!Object(l["m"])(n))throw n}}_removeTile(t){if(!this._tiles.has(t))return;const e=this._tiles.get(t);this.container.removeChild(e),e.destroy(),this._tiles.delete(t)}_setFilterState(t,e){const i=this._displayIds.get(t),s=this._attributeStore.getHighlightFlag(t);this._attributeStore.setData(i,0,0,s|(e?B["q"]:0))}_getGraphicsData(t,e,i){const s=this.view,r=Object(y["e"])(s.spatialReference),n=this._graphicStore.getGraphicsData(t,e,i);if(r){const t=Math.round((r.valid[1]-r.valid[0])/e.resolution);for(const e of n)e.geometry&&(Object(m["f"])(e.geometry)||Object(m["e"])(e.geometry))&&this._wrapPoints(e,t)}return n}_wrapPoints(t,e){const i=t.geometry;Object(m["e"])(i)?this._wrapMultipoint(i,e):this._wrapPoint(t,e)}_wrapMultipoint(t,e){const i=t.points,s=[];let r=0,n=0;for(const[a,o]of i){if(s.push([a+r,o]),r=0,e===Wt["b"]){const t=5*Wt["a"];a+nWt["b"]-t&&(s.push([-e,0]),r=e)}else a+n<-Wt["a"]?(s.push([e,0]),r=-e):a+n>Wt["b"]+Wt["a"]&&(s.push([-e,0]),r=e);n+=a}t.points=s}_wrapPoint(t,e){const i=t.geometry;if(e===Wt["b"]){const s=5*Wt["a"];i.xWt["b"]-s&&(t.geometry={points:[[i.x,i.y],[-e,0]]})}else i.x<-Wt["a"]?t.geometry={points:[[i.x,i.y],[e,0]]}:i.x>Wt["b"]+Wt["a"]&&(t.geometry={points:[[i.x,i.y],[-e,0]]})}_processGraphics(t,e,i){if(!e||!e.length||!this._meshFactory)return null;const s=Dt.from(e),r=this._meshFactory;return this._matcher.then(e=>r.analyzeGraphics(s,this.container.stage.resourceManager,e,null,null,i).then(()=>(this._attributeStore.sendUpdates(),this._processAnalyzedGraphics(t,s))))}_processAnalyzedGraphics(t,e){const i=this._meshFactory,s=e.getSize(),r=e.getCursor(),n={features:s,records:s,metrics:0},a=new jt["a"](t.key.id,n,{fill:"default"},!1,!1),o=[];for(;r.next();){const e=r.readGraphic();e.insertAfter=-1===e.insertAfter?-1:this._displayIds.get(e.insertAfter),e.displayId=this._displayIds.get(e.attributes[this.uid]);const s=new ct(e.displayId);s.insertAfter=e.insertAfter,o.push(s),i.writeGraphic(a,r,t.level,this.container.stage.resourceManager)}const h=t.tileInfoView.tileInfo.isWrappable,l=a.serialize(h);if(1!==l.length)return new Mt;const c=l[0].message;return Mt.fromVertexData(c,o)}_abortProcessingGraphic(t){this._graphicIdToAbortController.has(t)&&this._graphicIdToAbortController.get(t).abort()}_getNullSymbol(t){const e=t.geometry;return Object(m["h"])(e)?F["g"]:Object(m["g"])(e)||Object(m["d"])(e)?F["f"]:F["e"]}_flipUpdatingGraphics(){this._updatingGraphicsTimer&&clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=setTimeout(()=>{this._updatingGraphicsTimer=null,this.notifyChange("updating")},160),this.notifyChange("updating")}};Object(s["a"])([Object(c["b"])({constructOnly:!0})],le.prototype,"requestUpdateCallback",void 0),Object(s["a"])([Object(c["b"])()],le.prototype,"container",void 0),Object(s["a"])([Object(c["b"])({constructOnly:!0})],le.prototype,"graphics",void 0),Object(s["a"])([Object(c["b"])()],le.prototype,"updating",null),Object(s["a"])([Object(c["b"])()],le.prototype,"view",void 0),Object(s["a"])([Object(c["b"])()],le.prototype,"updateRequested",void 0),le=Object(s["a"])([Object(u["a"])("esri.views.2d.layers.support.GraphicsView2D")],le);const ce=le},"601e":function(t,e,i){"use strict";i.d(e,"a",(function(){return c}));var s=i("ce50"),r=i("e92d"),n=i("c24e"),a=i("82fa"),o=i("89cb"),h=i("f47d");const l=r["a"].getLogger("esri/views/2d/engine/webgl/util/Matcher");async function c(t,e,i,s){switch(t.type){case"simple":return u.fromBasicRenderer(t,e,i,s);case"map":return _.fromUVRenderer(t,e,i,s);case"interval":return f.fromCBRenderer(t,e,i,s);case"dictionary":return b.fromDictionaryRenderer(t,e,i,s);case"subtype":return d.fromSubtypes(t,e,i,s)}}class u{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(t,e,i,s){const r=new u;if(t.symbol){const n=await Object(h["b"])(t.symbol,i,s),a=e.createTemplateGroup(n,null);r.setDefault(a)}return r}size(){return 1}getDefault(){return this._defaultResult}setDefault(t){this._defaultResult=t}match(t,e,i,s,r){return this.getDefault()}async analyze(t,e,i,s,r,n){return null}}class d extends u{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e,i,s){const r=new Map,n=[];for(const a in t.renderers){const o=parseInt(a,10),h=c(t.renderers[a],e,i,s).then(t=>r.set(o,t));n.push(h)}return await Promise.all(n),new d(r,t.subtypeField)}match(t,e,i,s,r){const n=e.readAttribute(this._subtypeField),a=this._subMatchers.get(n);return a?a.match(t,e,i,s,r):null}}class f extends u{constructor(t,e,i,s){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=e,this._fieldIndex=s,this._field=t,this._normalizationInfo=i}static async fromCBRenderer(t,e,i,s){const{isMaxInclusive:r,normalizationField:n,normalizationTotal:a,normalizationType:o}=t,l=t.field,c=new f(l,r,{normalizationField:n,normalizationTotal:a,normalizationType:o},t.fieldIndex),u=await Object(h["b"])(t.backgroundFillSymbol,i,s);await Promise.all(t.intervals.map(async t=>{const r=await Object(h["b"])(t.symbol,i,s),n=await e.createTemplateGroup(r,u),a={min:t.min,max:t.max};c.add(a,n)}));const d=await Object(h["b"])(t.defaultSymbol,i,s);if(d){const t=await e.createTemplateGroup(d,u);c.setDefault(t)}return c}add(t,e){this._intervals.push({interval:t,result:e}),this._intervals.sort((t,e)=>t.interval.min-e.interval.min)}size(){return super.size()+this._intervals.length}match(t,e,i,s,r){if(null==this._fieldIndex&&!this._field)return this.getDefault();const n=null!=this._fieldIndex?e.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(e);if(!n&&(null==n||isNaN(n)))return this.getDefault();for(let a=0;a=t.min,s=this._isMaxInclusive?n<=t.max:n{const r=await Object(h["b"])(t.symbol,i,s),n=await e.createTemplateGroup(r,a);""===t.value?o.setNullResult(n):o.add(t.value,n)}));const l=await Object(h["b"])(t.defaultSymbol,i,s);if(l){const t=await e.createTemplateGroup(l,a);o.setDefault(t)}return o}setNullResult(t){this._nullResult=t}add(t,e){this._resultsMap.set(t.toString(),e)}size(){return super.size()+this._resultsMap.size}match(t,e,i,s,r){if(null==this._fieldsIndex&&!this._fields)return this.getDefault();const n=null!=this._fieldsIndex?e.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(e);if(null!==this._nullResult&&(null==n||""===n||""===n))return this._nullResult;if(!n&&null==n)return this.getDefault();const a=n.toString();return this._resultsMap.has(a)?this._resultsMap.get(a):this.getDefault()}_getValueFromFields(t){const e=[];for(const i of this._fields){const s=t.readAttribute(i);null==s||""===s?e.push(""):e.push(s)}return e.join(this._seperator)}}async function m(t,e){const i=t||1;if("number"==typeof i)return(t,e,s)=>i;const s=await Object(a["d"])(i,e.spatialReference,e.fields);return(t,i,r)=>Object(o["a"])(s,t,{$view:r},e.geometryType,i)||1}let p;async function g(){return p||(p=i.e("chunk-2d2304b7").then(i.bind(null,"ec58"))),p}class b extends u{constructor(t,e,i,s,r,a){super(),this.type="dictionary",this._groupIdCache=new n["a"](100),this._loader=t,this._fieldMap=t.fieldMap,this._symbolFields=t.getSymbolFields(),this._templates=e,this._info=i,this._scaleFn=s,this._schemaUtilsModule=r,this._symbolOptions=a}static async fromDictionaryRenderer(t,e,s,r){const[{DictionaryLoader:n},a]=await Promise.all([Promise.resolve().then(i.bind(null,"226a")),g()]),o=new n(t.url,t.config,t.fieldMap);await o.fetchResources({spatialReference:s.spatialReference,fields:s.fields});const h=await m(t.scaleExpression,s);return new b(o,e,s,h,a,t.symbolOptions)}async _analyzeFeature(t,e,i,r,n){const a=t.readLegacyFeature(),o=this._scaleFn(a,i,r),c=this._attributeHash(a)+"-"+o,u=this._groupIdCache.get(c);if(u)return u;const d={...r,spatialReference:this._info.spatialReference,abortOptions:n,fields:this._info.fields},f=await this._loader.getSymbolAsync(a,d),_=this._schemaUtilsModule.createSymbolSchema(f,this._symbolOptions),m=Object(h["b"])(_,this._info,e,n).then(t=>{if("expanded-cim"!==t.type)return l.error(new s["a"]("mapview-bad-type",`Found unexpected type ${t.type} in dictionary response`)),null;t.hash+="-"+o;for(const e of t.layers)e.scaleFactor=o,e.templateHash+="-"+o;return this._templates.createTemplateGroup(t,null)});return this._groupIdCache.put(c,m,1),m}async analyze(t,e,i,s,r,n){const a=e.getCursor(),o=[];for(;a.next();)o.push(this._analyzeFeature(a,i,s,r,n));return Promise.all(o)}match(t,e,i,s,r){return null}_attributeHash(t){let e="";for(const i of this._symbolFields){const s=this._fieldMap[i];s&&(e+=t.attributes[s]+"-")}return e}}},6722:function(t,e,i){"use strict";i.d(e,"a",(function(){return l}));var s=i("c120"),r=i("c84e"),n=i("9a02"),a=i("6f75"),o=i("ec5e");const h=(t,e)=>t.key.level-e.key.level!=0?t.key.level-e.key.level:t.key.row-e.key.row!=0?t.key.row-e.key.row:t.key.col-e.key.col;class l extends n["a"]{constructor(t){super(),this._tileInfoView=t}get requiresDedicatedFBO(){return!1}renderChildren(t){this.sortChildren(h),this.setStencilReference(t),super.renderChildren(t)}createRenderParams(t){const{state:e}=t,i=super.createRenderParams(t);return i.requiredLevel=this._tileInfoView.getClosestInfoForScale(e.scale).level,i.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(e.scale),i}prepareRenderPasses(t){const e=super.prepareRenderPasses(t);return e.push(t.registerRenderPass({name:"stencil",brushes:[o["a"]],drawPhase:r["c"].DEBUG|r["c"].MAP|r["c"].HIGHLIGHT,target:()=>this.getStencilTarget()})),Object(s["a"])("esri-tiles-debug")&&e.push(t.registerRenderPass({name:"tileInfo",brushes:[a["a"]],drawPhase:r["c"].DEBUG,target:()=>this.children})),e}getStencilTarget(){return this.children}updateTransforms(t){for(const e of this.children){const i=this._tileInfoView.getTileResolution(e.key);e.setTransform(t,i)}}setStencilReference(t){let e=1;for(const i of this.children)i.stencilRef=e++}}},"69c3":function(t,e,i){"use strict";i.d(e,"a",(function(){return S}));i("3e7b"),i("018d");var s=i("ae54"),r=(i("07cd"),i("d302"),i("8c81")),n=i("175e"),a=i("c84e"),o=i("c8dd");const h=new Map;function l(t,e,i){const{indicesPerRecord:s,multiplier:n,verticesPerRecord:a}=h.get(t);return{recordBytes:i*r["n"]*Uint32Array.BYTES_PER_ELEMENT,indexBytes:n*s*i*Uint32Array.BYTES_PER_ELEMENT,vertexBytes:n*a*i*e}}h.set(a["d"].MARKER,{multiplier:1,indicesPerRecord:6,verticesPerRecord:4}),h.set(a["d"].LINE,{multiplier:1,indicesPerRecord:24,verticesPerRecord:8}),h.set(a["d"].FILL,{multiplier:1,indicesPerRecord:10,verticesPerRecord:10}),h.set(a["d"].TEXT,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4}),h.set(a["d"].LABEL,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4});var c=i("3de4");class u{constructor(t,e,i){this._start={index:0,vertex:0};const s=l(t,e,i),r=e/4;this.geometryType=t,this._records=new c["a"](Int32Array,s.recordBytes),this._indices=new c["a"](Uint32Array,s.indexBytes),this._vertices=new c["a"](Uint32Array,s.vertexBytes),this._metrics=new c["a"](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/r["n"]}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,a,o){this._records.push(t),this._records.push(e),this._records.push(i),this._records.push(s),this._records.push(r),this._records.push(n),this._records.push(a),this._records.writeF32(o)}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-r["n"],n=t._records.getValue(s),a=t._records.getValue(s+1),o=t._records.getValue(s+2),h=t._records.getValue(s+4),l=t._records.getValue(s+6),c=t._records.getValue(s+7),u=this._vertices.length,d=(t._start.vertex-this._vertices.length)/this._strideInt,f=this._indices.length,_=this.vertexCount;for(let r=t._start.index;r!==t._indices.length;r++){const e=t._indices.getValue(r);this._indices.push(e-d)}for(let r=t._start.vertex;r!==t._vertices.length;r++){const e=t._vertices.getValue(r);this._vertices.push(e)}for(let r=u;r<=this._vertices.length;r+=this._strideInt)this._vertices.i1616Add(r,e,i);this._records.push(n),this._records.push(a),this._records.push(o),this._records.push(f),this._records.push(h),this._records.push(_),this._records.push(l),this._records.push(c)}}var d=i("a015");const f=1,_=2,m=4,p=8,g=16,b=32,y=64,x=128;function v(t){switch(t){case f:case p:case b:return-1;case _:case y:return 0;case m:case g:case x:return 1}}function w(t){switch(t){case f:case _:case m:return-1;case p:case g:return 0;case b:case y:case x:return 1}}const O=f|p|b,T=m|g|x,M=f|_|m,j=b|y|x;class S{constructor(t,e,i,s,r){this._hasAggregate=!1,this.hasRecords=!1,this._data={self:new Map,neighbors:new Array},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._strideOptions=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,r)=>{const n=1<=r["P"]-i?O:T|O)|(e<0+s?j:e>=r["P"]-s?M:j|M));this._current.overlaps|=n}_getVertexWriter(t){if(!this._data.self.has(t)){const e=this._data.self,i=Object(o["n"])(t,this._strideOptions).geometry;e.set(t,new u(t,i,this.hint.records))}return this._data.self.get(t)}}},"6a2c":function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return h})),i.d(e,"d",(function(){return c})),i.d(e,"e",(function(){return u})),i.d(e,"f",(function(){return l})),i.d(e,"g",(function(){return o})),i.d(e,"h",(function(){return n}));const s=0,r=100;function n(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function a(t,e){return Math.sqrt(t*t+e*e)}function o(t){const e=a(t[0],t[1]);t[0]/=e,t[1]/=e}function h(t,e){return a(t[0]-e[0],t[1]-e[1])}function l(t){return"function"==typeof t}function c(t=2){return 1/Math.max(t,1)}function u(t,e){return[!!t.minScale&&e.scaleToZoom(t.minScale)||s,!!t.maxScale&&e.scaleToZoom(t.maxScale)||r]}},"6f2d":function(t,e,i){"use strict";i.d(e,"a",(function(){return E}));var s=i("f4cc"),r=i("8ca7"),n=i("ce50"),a=i("c120"),o=i("e92d"),h=i("b2b2"),l=i("8c81"),c=i("175e"),u=i("c8dd"),d=i("97cb"),f=i("d17d"),_=i("d267"),m=i("a1ff");const p=o["a"].getLogger("esri.views.2d.engine.webgl.AttributeStoreView"),g=Object(d["b"])(d["a"],p);class b{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:n}=t,a=Object(u["l"])(r);this.shared=i,this.pixelType=r,this.size=e,this.textureOnly=n,n||(this.data=new a(Object(h["t"])(s))),this._resetRange()}destroy(){Object(h["b"])(this._texture,t=>t.dispose());for(const t in this._fbos)Object(h["b"])(this._fbos[t],e=>{"0"===t&&e.detachColorTexture(),e.dispose()}),this._fbos[t]=null;this._texture=null}get _textureDesc(){return{target:f["A"].TEXTURE_2D,wrapMode:f["B"].CLAMP_TO_EDGE,pixelFormat:f["p"].RGBA,dataType:this.pixelType,samplingMode:f["z"].NEAREST,width:this.size,height:this.size}}setData(t,e,i){const s=Object(c["f"])(t),r=Object(h["t"])(this.data),n=s*this.texelSize+e;!r||n>=r.length||(r[n]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(Object(h["j"])(this.data))return null;const i=Object(c["f"])(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return Object(h["u"])(this._texture,()=>this._initTexture(t))}getFBO(t,e=0){if(Object(h["j"])(this._fbos[e])){const i={colorTarget:f["y"].TEXTURE,depthStencilTarget:f["m"].NONE},s=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new _["a"](t,i,s)}return this._fbos[e]}get locked(){return!(this.pixelType!==f["q"].UNSIGNED_BYTE||!this.shared||this.textureOnly||!Object(a["a"])("esri-atomics")||!this.data)&&1===Atomics.load(this.data,0)}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){if(!this.locked){try{const e=this.dirtyStart,i=this.dirtyEnd;if(!this.hasDirty)return;this._resetRange();const s=Object(h["t"])(this.data).buffer,r=this.getTexture(t),a=4,o=(e-e%this.size)/this.size,l=(i-i%this.size)/this.size,c=o,d=this.size,f=l,_=o*this.size*a,m=(d+f*this.size)*a-_,g=Object(u["l"])(this.pixelType),b=new g(s,_*g.BYTES_PER_ELEMENT,m),y=this.size,x=f-c+1;if(x>this.size)return void p.error(new n["a"]("mapview-webgl","Out-of-bounds index when updating AttributeData"));r.updateData(0,0,c,y,x,b)}catch(i){}e()}}update(t){const{data:e,start:i,end:s}=t;if(Object(h["k"])(e)){const s=this.data,r=i*this.texelSize;for(let i=0;inew b(t,s,i));else for(let r=0;rObject(h["m"])(t,t=>t.destroy())),Object(h["b"])(this._defaultTexture,t=>t.dispose())}isEmpty(){const t=this._data;return Object(h["j"])(t)}isUpdating(){const t=Object(h["k"])(this._pendingAttributeUpdate),e=t;return Object(a["a"])("esri-2d-log-updating")&&console.log(`Updating AttributeStoreView ${e}\n -> hasPendingUpdate ${t}`),e}getBlock(t){return Object(h["j"])(this._data)?null:this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVVSize(t){return this.getData(t,l["e"],0,0)}getData(t,e,i,s){if(!this._data)return 0;const r=Object(h["t"])(this._data)[e];if(Object(h["j"])(r))return 0;const n=r.getData(t,i);return Object(h["k"])(n)?n:s}setData(t,e,i,s){const r=Object(h["t"])(this._data)[e];Object(h["t"])(r).setData(t,i,s)}lockTextureUpload(){this._locked=!0}unlockTextureUpload(){this._locked=!1}forceTextureUpload(){this._forceNextUpload=!0}async requestUpdate(t){if(this._pendingAttributeUpdate)return void p.error(new n["a"]("mapview-webgl","Tried to update attribute data with a pending update"));const e=Object(s["g"])();return g("AttributeStoreView Update Requested",t),this._pendingAttributeUpdate={data:t,resolver:e},e.promise}update(){if(this._initialized&&Object(h["k"])(this._pendingAttributeUpdate)){const{data:t,resolver:e}=this._pendingAttributeUpdate,i=Object(h["t"])(this._data);for(let s=0;sObject(h["b"])(e,e=>{g("Updating block "+s,e),t.update(e)}))}this._pendingAttributeUpdate=null,e(),this._onUpdate()}}bindTextures(t,e=!0){this.update();const i=this._getDefaultTexture(t);if(!this._initialized)return t.bindTexture(i,l["B"]),void(e&&(t.bindTexture(i,l["C"]),t.bindTexture(i,l["D"]),t.bindTexture(i,l["E"]),t.bindTexture(i,l["H"])));const s=Object(h["t"])(this._data);this._locked&&!this._forceNextUpload||(Object(h["h"])(s,e=>e.updateTexture(t,()=>this._onUpdate())),this._forceNextUpload=!1),t.bindTexture(Object(h["n"])(s[l["c"]],i,e=>e.getTexture(t)),l["B"]),e&&(t.bindTexture(Object(h["n"])(s[l["d"]],i,e=>e.getTexture(t)),l["H"]),t.bindTexture(Object(h["n"])(s[l["a"]],i,e=>e.getTexture(t)),l["C"]),t.bindTexture(Object(h["n"])(s[l["e"]],i,e=>e.getTexture(t)),l["D"]),t.bindTexture(Object(h["n"])(s[l["b"]],i,e=>e.getTexture(t)),l["E"]))}_getDefaultTexture(t){if(Object(h["j"])(this._defaultTexture)){const e={wrapMode:f["B"].CLAMP_TO_EDGE,pixelFormat:f["p"].RGBA,dataType:f["q"].UNSIGNED_BYTE,samplingMode:f["z"].NEAREST,width:1,height:1};this._defaultTexture=new m["a"](t,e,new Uint8Array(4))}return this._defaultTexture}}var x=i("6722"),v=i("9ef0"),w=i("a915"),O=i("8048"),T=i("9b40"),M=i("b2af");function j(t,e){const i=e.length;if(t{let i=1/0,s=0;for(const o in e.levels){const e=parseFloat(o),r=Math.abs(t-e);r=e.length?new v["a"]([0,0,0,0]):e[i].color;S(this.ddColors,t,4*i)}for(let i=0;i<8;i++)this.ddActiveDots[i]=ithis.onAttributeStoreUpdate())}destroy(){this.removeAllChildren(),this.children.forEach(t=>t.destroy()),this.attributeView.destroy(),this._materialItemsRequestQueue.clear()}setRendererInfo(t,e,i){this._rendererInfo.setInfo(t,e,i),this.requestRender()}async getMaterialItems(t,e){if(!t||0===t.length)return null;const i=Object(s["g"])();return this._materialItemsRequestQueue.push({items:t,abortOptions:e,resolver:i}),this.requestRender(),i.promise}doRender(t){if(t.context.capabilities.enable("textureFloat"),t.context.capabilities.enable("vao"),this._materialItemsRequestQueue.length>0){let e=this._materialItemsRequestQueue.pop();for(;e;)this._processMaterialItemRequest(t,e),e=this._materialItemsRequestQueue.pop()}super.doRender(t)}renderChildren(t){for(const e of this.children)e.commit(t);this._rendererInfo.update(t.state),super.renderChildren(t)}createRenderParams(t){const e=super.createRenderParams(t);return e.rendererInfo=this._rendererInfo,e.attributeView=this.attributeView,e}onAttributeStoreUpdate(){}_processMaterialItemRequest(t,{items:e,abortOptions:i,resolver:s}){const{painter:r,pixelRatio:n}=t,a=e.map(t=>r.textureManager.rasterizeItem(t.symbol,n,t.glyphIds,i));Promise.all(a).then(t=>{if(!this.stage)return void s.reject();const i=t.map((t,i)=>({id:e[i].id,mosaicItem:t}));s.resolve(i)},s.reject)}}},"7b82":function(t,e,i){"use strict";i.d(e,"a",(function(){return h}));var s=i("793f"),r=i("0eee"),n=i("405c"),a=i("36b8");const o=512;class h{constructor(t){this._resourceManager=t}dispose(){this._rasterizationCanvas=null}rasterizeJSONResource(t,e,i){if(this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas")),"simple-fill"===t.type||"esriSFS"===t.type){const[i,r,n]=s["d"].rasterizeSimpleFill(this._rasterizationCanvas,t.style,e);return{size:[r,n],image:new Uint32Array(i.buffer),sdf:!1,simplePattern:!0,anchorX:0,anchorY:0}}if("simple-line"===t.type||"esriSLS"===t.type||"line"===t.type&&t.dashTemplate){let e,i;if("simple-line"===t.type||"esriSLS"===t.type)switch(e=Object(s["e"])(t.style,t.cap),t.cap){case"butt":i="Butt";break;case"square":i="Square";break;default:i="Round"}else e=t.dashTemplate,i=t.cim.capStyle;const[r,n,a]=s["d"].rasterizeSimpleLine(e,i);return{size:[n,a],image:new Uint32Array(r.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0}}let a,o,h;if("simple-marker"===t.type||"esriSMS"===t.type||"line-marker"===t.type?(a=s["b"].fromSimpleMarker(t),h=Object(n["c"])(a)):t.cim&&"CIMHatchFill"===t.cim.type?(a=s["b"].fromCIMHatchFill(t.cim),o=new r["a"](a.frame.xmin,-a.frame.ymax,a.frame.xmax-a.frame.xmin,a.frame.ymax-a.frame.ymin)):t.cim.markerPlacement&&"CIMMarkerPlacementInsidePolygon"===t.cim.markerPlacement.type?(a=s["b"].fromCIMInsidePolygon(t.cim),o=new r["a"](a.frame.xmin,-a.frame.ymax,a.frame.xmax-a.frame.xmin,a.frame.ymax-a.frame.ymin)):(a=t.cim,h=Object(n["c"])(a)),h&&!i){const[t,e,i]=Object(n["a"])(h);return t?{size:[e,i],image:new Uint32Array(t.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0}:null}const[l,c,u,d,f]=s["b"].rasterize(this._rasterizationCanvas,a,o,this._resourceManager,!i);return l?{size:[c,u],image:new Uint32Array(l.buffer),sdf:!1,simplePattern:!1,anchorX:d,anchorY:f}:null}rasterizeImageResource(t,e,i,s){this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas")),this._rasterizationCanvas.width=t,this._rasterizationCanvas.height=e;const r=this._rasterizationCanvas.getContext("2d");i instanceof ImageData?r.putImageData(i,0,0):(i.setAttribute("width",t+"px"),i.setAttribute("height",e+"px"),r.drawImage(i,0,0,t,e));const n=r.getImageData(0,0,t,e),h=new Uint8Array(n.data);if(s)for(const a of s)if(a&&a.oldColor&&4===a.oldColor.length&&a.newColor&&4===a.newColor.length){const[t,e,i,s]=a.oldColor,[r,n,o,l]=a.newColor;if(t===r&&e===n&&i===o&&s===l)continue;for(let a=0;a=f||d>=f){const i=u/d;i>1?(u=f,d=Math.round(f/i)):(d=f,u=Math.round(f*i)),c=new Uint8Array(4*u*d);const s=new Uint8ClampedArray(c.buffer);Object(a["m"])(h,t,e,s,u,d,!1)}return{size:[u,d],image:new Uint32Array(c.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}}},"7de1":function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));class s{constructor(t,e){this._mask=0,this._buf=t,this._mask=e}static fromBuffer(t,e){return new s(t,e)}static create(t,e=4294967295){const i=new Uint32Array(Math.ceil(t/32));return new s(i,e)}_getIndex(t){return Math.floor(t/32)}has(t){const e=this._mask&t;return!!(this._buf[this._getIndex(e)]&1<>>=1,s++}}countSet(){let t=0;return this.forEachSet(e=>{t++}),t}}},8332:function(t,e,i){"use strict";i.d(e,"a",(function(){return _})),i.d(e,"b",(function(){return l}));var s=i("b2b2"),r=i("a915"),n=i("a9a2"),a=i("8c81"),o=i("c84e"),h=i("3484");function l(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}function c(t){return{value:t.value,size:Object(r["j"])(t.size)}}function u(t){return t.map(t=>c(t))}function d(t){if("string"==typeof t||"number"==typeof t)return Object(r["j"])(t);const e=t;return{type:"size",expression:e.expression,stops:u(e.stops)}}const f=t=>{const e=[],i=[],s=u(t),n=s.length;for(let o=0;o<6;o++){const t=s[Math.min(o,n-1)];e.push(t.value),i.push(null==t.size?a["x"]:Object(r["g"])(t.size))}return{values:new Float32Array(e),sizes:new Float32Array(i)}};function _(t){const e=t&&t.length>0?{}:null,i=e?{}:null;if(!e)return{vvFields:e,vvRanges:i};for(const s of t)if(s.field&&(e[s.type]=s.field),"size"===s.type){i.size||(i.size={});const t=s;switch(Object(h["a"])(t)){case o["e"].SIZE_MINMAX_VALUE:i.size.minMaxValue={minDataValue:t.minDataValue,maxDataValue:t.maxDataValue,minSize:d(t.minSize),maxSize:d(t.maxSize)};break;case o["e"].SIZE_SCALE_STOPS:i.size.scaleStops={stops:u(t.stops)};break;case o["e"].SIZE_FIELD_STOPS:if(t.levels){const e={};for(const i in t.levels)e[i]=f(t.levels[i]);i.size.fieldStops={type:"level-dependent",levels:e}}else i.size.fieldStops={type:"static",...f(t.stops)};break;case o["e"].SIZE_UNIT_VALUE:i.size.unitValue={unit:t.valueUnit,valueRepresentation:t.valueRepresentation}}}else if("color"===s.type)i.color=g(s);else if("opacity"===s.type)i.opacity=m(s);else if("rotation"===s.type){const t=s;i.rotation={type:t.rotationType}}return{vvFields:e,vvRanges:i}}function m(t){const e={values:[0,0,0,0,0,0,0,0],opacities:[0,0,0,0,0,0,0,0]};if("string"==typeof t.field){if(!t.stops)return null;{if(t.stops.length>8)return null;const i=t.stops;for(let t=0;t<8;++t){const s=i[Math.min(t,i.length-1)];e.values[t]=s.value,e.opacities[t]=s.opacity}}}else{if(!(t.stops&&t.stops.length>=0))return null;{const i=t.stops&&t.stops.length>=0&&t.stops[0].opacity;for(let t=0;t<8;t++)e.values[t]=1/0,e.opacities[t]=i}}return e}function p(t,e,i){t[4*e+0]=i.r/255,t[4*e+1]=i.g/255,t[4*e+2]=i.b/255,t[4*e+3]=i.a}function g(t){if(Object(s["j"])(t))return null;if(t.normalizationField)return null;const e={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};if("string"==typeof t.field){if(!t.stops)return null;{if(t.stops.length>8)return null;e.field=t.field;const i=t.stops;for(let t=0;t<8;++t){const s=i[Math.min(t,i.length-1)];e.values[t]=s.value,p(e.colors,t,s.color)}}}else{if(!(t.stops&&t.stops.length>=0))return null;{const i=t.stops&&t.stops.length>=0&&t.stops[0].color;for(let t=0;t<8;t++)e.values[t]=1/0,p(e.colors,t,i)}}for(let i=0;i<32;i+=4)Object(n["b"])(e.colors,i,!0);return e}},"89e8":function(t,e,i){"use strict";i.d(e,"a",(function(){return m}));var s=i("f57e"),r=i("a915"),n=i("ab39"),a=i("32dd"),o=i("a9a2"),h=i("8c81"),l=i("d114"),c=i("18c6"),u=i("6a2c"),d=i("44d1"),f=i("f75e");const _=5;class m extends(Object(d["a"])(f["a"])){constructor(t,e,i,s,o,u,d,f,m,p,g,b,y,x,v,w,O,T,M=!1,j,S){super(),this._xOffset=Object(r["g"])(y),this._yOffset=Object(r["g"])(x),this._decoration=p||"none",this._color=o,this._haloColor=u,this._haloSize=Math.min(Math.floor(_*Object(r["g"])(Object(r["j"])(i))),127),this._size=Math.min(Math.round(Object(r["g"])(e)),127);const R=Math.min(Math.round(Object(r["g"])(s||e)),127);this._referenceSize=Math.round(Math.sqrt(256*R)),this._scale=this._size/h["r"],this._angle=b,this._justify=Object(a["d"])(d||"center"),this._xAlignD=Object(a["e"])(d||"center"),this._yAlignD=Object(a["g"])(f||"baseline"),this._baseline="baseline"===(f||"baseline"),this._bitset=(m===n["a"].MAP?1:0)|(g?1:0)<<1;const E=c["e"].load(t);E.sdf=!0,this._materialKey=E.data,this._lineWidth=Object(r["g"])(v)||512,this._lineHeight=w||1,this._textPlacement=O,this._effects=T,this._isCIM=M,this._minMaxZoom=Object(l["a"])(Math.round(j*h["w"]),Math.round(S*h["w"]))}static fromText(t,e){const i=new m(t.materialKey,t.font.size,t.haloSize||0,t.font.size,t.color&&Object(o["d"])(t.color)||0,t.haloColor&&Object(o["d"])(t.haloColor)||0,t.horizontalAlignment,t.verticalAlignment,n["a"].SCREEN,t.font.decoration,!1,t.angle||0,t.xoffset,t.yoffset,t.lineWidth,t.lineHeight,null,null,!1,u["b"],u["a"]),[,r]=Object(s["a"])(t.text);return i.bindTextInfo(e,r),i._vertexBoundsScale=t.maxVVSize?t.maxVVSize/t.font.size:1,i}static fromCIMText(t,e,i){const r=t.scaleFactor||1,n=t.size*t.sizeRatio*r,[a,h]=Object(u["e"])(t.scaleInfo,i),l=new m(t.materialKey,n,t.outlineSize*t.sizeRatio,t.referenceSize,Object(o["c"])(t.color),Object(o["c"])(t.outlineColor),t.horizontalAlignment,t.verticalAlignment,t.alignment,t.decoration,t.colorLocked,t.angle,t.offsetX*t.sizeRatio*r,t.offsetY*t.sizeRatio*r,512,1,t.markerPlacement,t.effects,!0,a,h),[,c]=Object(s["a"])(t.text);return l.bindTextInfo(e,c),l._vertexBoundsScale=t.maxVVSize?t.maxVVSize/n:1,l}}},"92f2":function(t,e,i){"use strict";i.d(e,"a",(function(){return b}));var s=i("6f2d"),r=i("1c92"),n=i("8c71"),a=i("738e"),o=i("47f8"),h=i("a8d5"),l=i("7c4b"),c=i("c8dd"),u=i("7ce4"),d=i("d17d"),f=i("0fa6");const _=Math.PI/180,m=4;class p extends l["a"]{constructor(t){super(),this._dvsMat3=Object(n["b"])(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(!0),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program&&(this._program.dispose(),this._program=null)}doRender(t){const{context:e}=t,i=this._getBounds();if(i.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,i),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(d["b"].ONE,d["b"].ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0);const s=this._program;e.bindVAO(this._vao),e.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(d["r"].LINES,8*i.length,d["k"].UNSIGNED_INT,0),e.bindVAO()}_createTransforms(){return{dvs:Object(n["b"])()}}_createShaderProgram(t){if(this._program)return;const e="precision highp float;\n uniform mat3 u_dvsMat3;\n\n attribute vec2 a_position;\n\n void main() {\n mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0);\n gl_Position = vec4(pos.xy, 0.0, 1.0);\n }",i="precision mediump float;\n void main() {\n gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75);\n }";this._program=t.programCache.acquire(e,i,g().attributes)}_updateMatricesAndLocalOrigin(t){const{state:e}=t,{displayMat3:i,size:s,resolution:n,pixelRatio:l,rotation:c,viewpoint:u}=e,d=_*c,{x:f,y:m}=u.targetGeometry,p=Object(h["b"])(f,e.spatialReference);this._localOrigin.x=p,this._localOrigin.y=m;const g=l*s[0],b=l*s[1],y=n*g,x=n*b,v=Object(r["b"])(this._dvsMat3);Object(r["l"])(v,v,i),Object(r["c"])(v,v,Object(a["b"])(g/2,b/2)),Object(r["d"])(v,v,Object(o["d"])(s[0]/y,-b/x,1)),Object(r["n"])(v,v,-d)}_updateBufferData(t,e){const{x:i,y:s}=this._localOrigin,r=2*m*e.length,n=new Float32Array(r),a=new Uint32Array(8*e.length);let o=0,h=0;for(const l of e)l&&(n[2*o+0]=l[0]-i,n[2*o+1]=l[1]-s,n[2*o+2]=l[0]-i,n[2*o+3]=l[3]-s,n[2*o+4]=l[2]-i,n[2*o+5]=l[3]-s,n[2*o+6]=l[2]-i,n[2*o+7]=l[1]-s,a[h+0]=o+0,a[h+1]=o+3,a[h+2]=o+3,a[h+3]=o+2,a[h+4]=o+2,a[h+5]=o+1,a[h+6]=o+1,a[h+7]=o+0,o+=4,h+=8);if(this._vertexBuffer?this._vertexBuffer.setData(n.buffer):this._vertexBuffer=u["a"].createVertex(t,d["D"].DYNAMIC_DRAW,n.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=u["a"].createIndex(t,d["D"].DYNAMIC_DRAW,a),!this._vao){const e=g();this._vao=new f["a"](t,e.attributes,e.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer)}}}const g=()=>Object(c["g"])("bounds",{geometry:[{location:0,name:"a_position",count:2,type:d["k"].FLOAT}]});class b extends s["a"]{constructor(t){super(t),this.hasHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer&&(this._boundsRenderer.destroy(),this._boundsRenderer=null)}enableRenderingBounds(t){this._boundsRenderer=new p(t),this.requestRender()}get hasLabels(){return!1}onTileData(t,e){t.patch(e),this.contains(t)||this.addChild(t),this.requestRender()}onTileError(t){t.clear(),this.contains(t)||this.addChild(t)}_renderChildren(t,e){for(const i of this.children)i.isReady&&i.hasData&&(i.commit(t),t.context.setStencilFunction(d["h"].EQUAL,i.stencilRef,255),i._displayList.replay(t,i,e))}}},"971e":function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var s=i("b2b2");class r{constructor(t){this.size=0,this._start=0,this.maxSize=t,this._buffer=new Array(t)}get entries(){return this._buffer}enqueue(t){if(this.size===this.maxSize){const e=this._buffer[this._start];return this._buffer[this._start]=t,this._start=(this._start+1)%this.maxSize,e}return this._buffer[(this._start+this.size++)%this.maxSize]=t,null}dequeue(){if(0===this.size)return null;const t=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,t}peek(){return 0===this.size?null:this._buffer[this._start]}find(t){if(0===this.size)return null;for(const e of this._buffer)if(Object(s["k"])(e)&&t(e))return e;return null}clear(t){let e=this.dequeue();for(;Object(s["k"])(e);)t&&t(e),e=this.dequeue()}}},"97cb":function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return s}));const s=(t,e)=>t&&((...t)=>e.warn("DEBUG:",...t))||(()=>null),r=!1},"9a02":function(t,e,i){"use strict";i.d(e,"a",(function(){return R}));i("c120");var s=i("b2b2"),r=i("8c71"),n=i("3b1a"),a=i("00c0"),o=i("ce50"),h=i("e92d"),l=i("7c4b"),c=i("9812"),u=i("3349"),d=i("02f1"),f=i("6655"),_=i("8152"),m=i("d114"),p=i("7ce4"),g=i("d17d");const b=h["a"].getLogger("esri.views.2d.engine.webgl.Mesh2D"),y=t=>{switch(t.BYTES_PER_ELEMENT){case 1:return g["k"].UNSIGNED_BYTE;case 2:return g["k"].UNSIGNED_SHORT;case 4:return g["k"].UNSIGNED_INT;default:throw new o["a"]("Cannot get DataType of array")}},x=(t,e,i,s)=>{let r=0;for(let n=1;n0:r<0},v=({coords:t,lengths:e},i)=>{const s=[];for(let r=0,n=0;r({...i,[s]:p["a"].createVertex(t,e,this.vertices[s])}),{})),this._cache.vertexBuffers}}var O=i("0fa6");const T=h["a"].getLogger("esri.views.2d.engine.webgl.ClippingInfo"),M=t=>parseFloat(t)/100;class j extends l["a"]{constructor(t,e){super(),this._clip=e,this._cache={},this.stage=t,this._handle=e.watch("version",()=>this._invalidate()),this.ready()}static fromClipArea(t,e){return new j(t,e)}_destroyGL(){Object(s["k"])(this._cache.mesh)&&(this._cache.mesh.destroy(),this._cache.mesh=null),Object(s["k"])(this._cache.vao)&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(t,e,i,r){const[n,a]=e.size;if("geometry"!==this._clip.type&&this._lastWidth===n&&this._lastHeight===a||(this._lastWidth=n,this._lastHeight=a,this._destroyGL()),Object(s["j"])(this._cache.vao)){const s=this._createMesh(e,this._clip),n=s.getIndexBuffer(t),a=s.getVertexBuffers(t);this._cache.mesh=s,this._cache.vao=new O["a"](t,i,r,a,n)}return this._cache.vao}_createTransforms(){return{dvs:Object(r["b"])()}}_invalidate(){this._destroyGL(),this.requestRender()}_createScreenRect(t,e){const[i,s]=t.size,r="string"==typeof e.left?M(e.left)*i:e.left,n="string"==typeof e.right?M(e.right)*i:e.right,a="string"==typeof e.top?M(e.top)*s:e.top,o="string"==typeof e.bottom?M(e.bottom)*s:e.bottom,h=r,l=a;return{x:h,y:l,width:Math.max(i-n-h,0),height:Math.max(s-o-l,0)}}_createMesh(t,e){switch(e.type){case"rect":return w.fromRect(this._createScreenRect(t,e));case"path":return w.fromPath(e);case"geometry":return w.fromGeometry(t,e);default:return T.error(new o["a"]("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),w.fromRect({x:0,y:0,width:1,height:1})}}}var S=i("c84e");class R extends a["a"]{constructor(){super(...arguments),this.name=this.constructor.name}set clips(t){this._clips=t,this.children.forEach(e=>e.clips=t),this._updateClippingInfo()}_createTransforms(){return{dvs:Object(r["b"])()}}doRender(t){const e=this.createRenderParams(t),{painter:i,globalOpacity:s,profiler:r,drawPhase:n}=e,a=n===S["c"].LABEL||n===S["c"].HIGHLIGHT?1:s*this.computedOpacity;r.recordContainerStart(this.name),i.beforeRenderLayer(e,this._clippingInfos?255:0,a),this.updateTransforms(t.state),this.renderChildren(e),i.compositeLayer(e,a),r.recordContainerEnd()}renderChildren(t){Object(s["j"])(this._renderPasses)&&(this._renderPasses=this.prepareRenderPasses(t.painter));for(const i of this.children)i.beforeRender(t);for(const i of this._renderPasses)try{i.render(t)}catch(e){}for(const i of this.children)i.afterRender(t)}createRenderParams(t){return t.requireFBO=this.requiresDedicatedFBO,t}prepareRenderPasses(t){return[t.registerRenderPass({name:"clip",brushes:[n["a"].clip],target:()=>this._clippingInfos,drawPhase:S["c"].MAP|S["c"].LABEL|S["c"].LABEL_ALPHA|S["c"].DEBUG|S["c"].HIGHLIGHT})]}updateTransforms(t){for(const e of this.children)e.setTransform(t)}onAttach(){super.onAttach(),this._updateClippingInfo()}onDetach(){super.onDetach(),this._updateClippingInfo()}_updateClippingInfo(){if(Object(s["k"])(this._clippingInfos)&&(this._clippingInfos.forEach(t=>t.destroy()),this._clippingInfos=null),!this.stage)return;const t=this._clips;Object(s["k"])(t)&&t.length&&(this._clippingInfos=t.items.map(t=>j.fromClipArea(this.stage,t))),this.requestRender()}}},"9f6d":function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i("b2b2"),r=i("8c81");const n=2147483647;class a{constructor(t){this._head=t,this._cursor=t}static from(t,e=0,i=t.byteLength/o.BYTES_PER_RECORD-e){const s=new o(new Int32Array(t,e*o.BYTES_PER_RECORD,i*o.ELEMENTS_PER_RECORD));return new a(s)}size(){let t=this._cursor,e=0;for(;t;)e+=t.size(),t=t._link;return e}get id(){return this._cursor.id}set id(t){this._cursor.id=t}get materialKey(){return this._cursor.materialKey}set materialKey(t){this._cursor.materialKey=t}get insertAfter(){return this._cursor.insertAfter}get indexFrom(){return this._cursor.indexFrom}set indexFrom(t){this._cursor.indexFrom=t}get indexCount(){return this._cursor.indexCount}set indexCount(t){this._cursor.indexCount=t}get vertexFrom(){return this._cursor.vertexFrom}set vertexFrom(t){this._cursor.vertexFrom=t}get vertexCount(){return this._cursor.vertexCount}set vertexCount(t){this._cursor.vertexCount=t}get sortKey(){return this._cursor.sortKey}set sortKey(t){this._cursor.sortKey=t}get index(){return this._cursor._indexStart+this._cursor._index}seekIndex(t){let e=t;for(this._cursor=this._head;this._cursor;){const t=this._cursor.size();if(e=this._packedRecords.length?0:this._packedRecords[t]}getCursor(){return this.copy()}copy(){const t=new o(this._packedRecords);return t._indexStart=this._indexStart,t._link=this._link,t._index=this._index,t._offsets=this._offsets,t._deletedCount=this._deletedCount,t}}o.ELEMENTS_PER_RECORD=r["n"],o.BYTES_PER_RECORD=o.ELEMENTS_PER_RECORD*Int32Array.BYTES_PER_ELEMENT},a015:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));i("ee0e");function s(t,e,i,s){const r=t.clone(),n=1<=n?(r.col=a-n,r.world+=1):r.col=a,r.row=o,r}},a8b5:function(t,e,i){"use strict";i.d(e,"a",(function(){return m}));var s=i("b2b2"),r=i("a915"),n=i("2c63"),a=i("738e"),o=i("ab39"),h=i("a9a2"),l=i("8c81"),c=i("d114"),u=i("18c6"),d=i("6a2c"),f=i("f93c"),_=i("f75e");class m extends(Object(f["a"])(_["a"])){constructor(t,e,i,s,r,h,d,f,_,m,p,g,b,y,x,v,w,O,T,M,j,S,R){super(),this.angle=s,this.height=d,this.width=h,this.xOffset=e*T,this.yOffset=i*T,this._markerPlacement=M,this._effects=j,this._anchorX=.5-(.5+v)*x.width/x.width,this._anchorY=.5-(.5+w)*x.height/x.height,this._minMaxZoom=Object(c["a"])(Math.round(S*l["w"]),Math.round(R*l["w"]));const E=(y===o["a"].MAP?l["i"]:l["j"])|(p?l["g"]:0)|(b?l["k"]:0)|(g?l["l"]:0),C=x&&x.sdf,I=u["d"].load(t);I.sdf=C,I.pattern=!0,I.textureBinding=x.textureBinding,this._materialKey=I.data,this._fillColor=r,this._outlineColor=_,this._sizeOutlineWidth=Object(c["b"])(Math.round(Math.min(Math.sqrt(128*h),255)),Math.round(Math.min(Math.sqrt(128*d),255)),Math.round(Math.min(Math.sqrt(128*m),255)),Math.round(Math.min(Math.sqrt(128*f),255)));const F=x.rect.x+l["A"],B=x.rect.y+l["A"],z=F+x.width,P=B+x.height;this._offsets.xUpperLeft=F,this._offsets.yUpperLeft=B,this._offsets.xUpperRight=z,this._offsets.yUpperRight=B,this._offsets.xBottomLeft=F,this._offsets.yBottomLeft=P,this._offsets.xBottomRight=z,this._offsets.yBottomRight=P,this._texUpperLeft=Object(c["a"])(F,B),this._texUpperRight=Object(c["a"])(z,B),this._texBottomLeft=Object(c["a"])(F,P),this._texBottomRight=Object(c["a"])(z,P),h*=O,d*=O,h*=T,d*=T;const D=Math.round(64*O);this._bitestAndDistRatio=Object(c["a"])(E,D),this._computedWidth=h,this._computedHeight=d;const A=Object(a["a"])(),L=Object(n["a"])();this._applyTransformation(L,A)}static fromCIMMarker(t,e,i){const n=e&&e.width||1,a=e&&e.height||1,l=t.size,c=n/a*t.scaleX,u=t.scaleSymbolsProportionally&&t.frameHeight?l/t.frameHeight:1;let f=Object(h["c"])(t.color);const _=Object(h["c"])(t.outlineColor),p=Object(r["g"])(l),g=p*c,b=Object(r["g"])(t.offsetX||0),y=Object(r["g"])(t.offsetY||0),x=Object(r["g"])(t.outlineWidth||0)*u,v=t.alignment||o["a"].SCREEN,w=Object(r["g"])(t.referenceSize),[O,T]=Object(d["e"])(t.scaleInfo,i);e.sdf||0!==f||(f=-1);let M=t.rotation||0;t.rotateClockwise||(M=-M);let j=0,S=0;const R=t.anchorPoint;R&&(t.isAbsoluteAnchorPoint?l&&(j=-R.x/(l*c),S=R.y/l):(j=R.x,S=R.y));const E=new m(t.materialKey,b,y,M,f,g,p,w,_,x,t.colorLocked,t.scaleSymbolsProportionally,!1,v,e,j,S,t.sizeRatio,Object(s["u"])(t.scaleFactor,1),t.markerPlacement,t.effects,O,T);return E._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/g:1,E._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/p:1,E}static fromPictureMarker(t,e){const i=Math.round(Object(r["g"])(t.width)),s=Math.round(Object(r["g"])(t.height)),n=l["z"],a=Math.round(Object(r["g"])(t.xoffset||0)),h=Math.round(Object(r["g"])(t.yoffset||0)),c=new m(t.materialKey,a,h,t.angle,n,i,s,s,0,0,!1,!1,!1,o["a"].SCREEN,e,0,0,1,1,null,null,d["b"],d["a"]);return c._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.width:1,c._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.height:1,c}static fromSimpleMarker(t,e){const i=Object(h["d"])(t.color),s=Math.round(Object(r["g"])(t.size)),n=s,a=Math.round(Object(r["g"])(t.xoffset||0)),l=Math.round(Object(r["g"])(t.yoffset||0)),c=t.style,u=t.outline,f=0|(u&&u.color&&Object(h["d"])(u.color)),_=0|(u&&u.width&&Math.round(Object(r["g"])(u.width))),p=new m(t.materialKey,a,l,t.angle,i,s,n,n,f,_,!1,!1,"esriSMSCross"===c||"esriSMSX"===c,o["a"].SCREEN,e,0,0,126/64,1,null,null,d["b"],d["a"]);return p.boundsType="esriSMSCircle"===c?"circle":"square",p._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.size:1,p._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.size:1,p}static fromLineSymbolMarker(t,e){const i=Object(h["d"])(t.color),s=6,n=Math.round(Object(r["g"])(s*t.lineWidth)),a=n,l="cross"===t.style||"x"===t.style;let c;switch(t.placement){case"begin-end":c=o["e"].Both;break;case"begin":c=o["e"].JustBegin;break;case"end":c=o["e"].JustEnd;break;default:c=o["e"].None}const u={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:c,offsetAlongLine:0},f=new m(t.materialKey,0,0,0,i,n,a,a/s,i,l?Math.round(Object(r["g"])(t.lineWidth)):0,!1,!1,l,o["a"].MAP,e,0,0,126/64,1,u,null,d["b"],d["a"]);return f.boundsType="circle"===t.style?"circle":"square",f}}},ab4d:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("c84e"),r=i("92f2");class n extends r["a"]{renderChildren(t){this.attributeView.bindTextures(t.context,!1),this.children.some(t=>t.hasData)&&(super.renderChildren(t),t.drawPhase===s["c"].MAP&&this._renderChildren(t),this.hasHighlight()&&t.drawPhase===s["c"].HIGHLIGHT&&this._renderHighlight(t),this._boundsRenderer&&this._boundsRenderer.doRender(t))}_renderHighlight(t){const{painter:e}=t,i=e.effects.highlight;i.bind(t),this._renderChildren(t,i.defines),i.draw(t),i.unbind()}}},b460:function(t,e,i){"use strict";i.r(e),i.d(e,"Stage",(function(){return ri})),i.d(e,"LabelManager",(function(){return Wi})),i.d(e,"GraphicsView2D",(function(){return qi["a"]})),i.d(e,"GraphicContainer",(function(){return Hi["a"]})),i.d(e,"MapViewNavigation",(function(){return vs})),i.d(e,"MagnifierView2D",(function(){return Rs}));var s=i("ce50"),r=i("9d83"),n=i("c120"),a=i("b2b2"),o=i("5815"),h=i("3795"),l=i("4212"),c=i("a29a"),u=i("f7eb"),d=i("8c71"),f=i("3349"),_=i("02f1"),m=i("27a2"),p=i("00c0"),g=i("c84e"),b=i("3b1a"),y=i("361b"),x=i("2e5c"),v=i("be90");const w={shaders:{vertexShader:Object(v["a"])("bitBlit/bitBlit.vert"),fragmentShader:Object(v["a"])("bitBlit/bitBlit.frag")},attributes:new Map([["a_pos",0],["a_tex",1]])};var O=i("7ce4"),T=i("d17d"),M=i("681f"),j=i("0fa6");class S{constructor(){this._initialized=!1}dispose(){this._program=Object(a["e"])(this._program),this._vertexArrayObject=Object(a["e"])(this._vertexArrayObject)}render(t,e,i,s){t&&(this._initialized||this._initialize(t),t.setBlendFunctionSeparate(T["b"].ONE,T["b"].ONE_MINUS_SRC_ALPHA,T["b"].ONE,T["b"].ONE_MINUS_SRC_ALPHA),t.bindVAO(this._vertexArrayObject),t.useProgram(this._program),e.setSamplingMode(i),t.bindTexture(e,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",s),t.drawArrays(T["r"].TRIANGLE_STRIP,0,4),t.bindTexture(null,0),t.bindVAO())}_initialize(t){if(this._initialized)return!0;const e=Object(M["a"])(t,w);if(!e)return!1;const i=new Int8Array(16);i[0]=-1,i[1]=-1,i[2]=0,i[3]=0,i[4]=1,i[5]=-1,i[6]=1,i[7]=0,i[8]=-1,i[9]=1,i[10]=0,i[11]=1,i[12]=1,i[13]=1,i[14]=1,i[15]=1;const s=w.attributes,r=new j["a"](t,s,x["c"],{geometry:O["a"].createVertex(t,T["D"].STATIC_DRAW,i)});return this._program=e,this._vertexArrayObject=r,this._initialized=!0,!0}}var R=i("d45f");const E=t=>{let e="";e+=t[0].toUpperCase();for(let i=1;i{const e={};for(const i in t)e[E(i)]=t[i];return Object(R["a"])(e)},I=(t,e,i,s)=>{const r=t+t.substring(t.lastIndexOf("/")),n=e+e.substring(e.lastIndexOf("/"));return{attributes:i,shaders:{vertexShader:C(s)+Object(v["a"])(r+".vert"),fragmentShader:C(s)+Object(v["a"])(n+".frag")}}},F=t=>t===g["c"].HITTEST||t===g["c"].LABEL_ALPHA,B=t=>(F(t)?1:0)|(t===g["c"].HIGHLIGHT?2:0),z=({rendererInfo:t,drawPhase:e},i,s,r)=>`${i.getVariationHash()}-${r.join(".")}-${B(e)}-${t.getVariationHash()}-${Object(a["k"])(s)&&s.join(".")}`,P=(t,e,i,s)=>{const r=s.reduce((e,i)=>({...e,[i]:t.context.driverTest[i]}),{}),n={...e.getVariation(),...t.rendererInfo.getVariation(),highlight:t.drawPhase===g["c"].HIGHLIGHT,id:F(t.drawPhase),...r};if(Object(a["k"])(i))for(const a of i)n[a]=!0;return n};class D{constructor(t){this._rctx=t,this._programByKey=new Map}dispose(){this._programByKey.forEach(t=>t.dispose()),this._programByKey.clear()}getProgram(t,e,i=[],s=[]){const r=e.vsPath+"."+e.fsPath+JSON.stringify(i)+s.join(".");if(this._programByKey.has(r))return this._programByKey.get(r);const n=s.reduce((e,i)=>({...e,[i]:t.context.driverTest[i]}),{}),a={...i.map(t=>"string"==typeof t?{name:t,value:!0}:t).reduce((t,e)=>({...t,[e.name]:e.value}),{}),...n},{vsPath:o,fsPath:h,attributes:l}=e,c=I(o,h,l,a),u=this._rctx.programCache.acquire(c.shaders.vertexShader,c.shaders.fragmentShader,c.attributes);if(!u)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(r,u),u}getMaterialProgram(t,e,i,s,r,n=["ignoresSamplerPrecision"]){const a=z(t,e,r,n);if(this._programByKey.has(a))return this._programByKey.get(a);const o=P(t,e,r,n),h=I(i,i,s,o),l=this._rctx.programCache.acquire(h.shaders.vertexShader,h.shaders.fragmentShader,h.attributes);if(!l)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(a,l),l}}var A=i("1325"),L=i("2eab"),k=i("f57e"),N=i("e92d"),U=i("f4cc"),G=i("a915"),V=i("738e"),W=i("7b82"),q=i("8c81"),H=i("e513"),Z=i("a9c0");class K{constructor(t,e){this._width=0,this._height=0,this._free=[],this._width=t,this._height=e,this._free.push(new Z["a"](0,0,t,e))}get width(){return this._width}get height(){return this._height}allocate(t,e){if(t>this._width||e>this._height)return new Z["a"];let i=null,s=-1;for(let r=0;rt&&this._free.push(new Z["a"](i.x+t,i.y,i.width-t,e)),i.height>e&&this._free.push(new Z["a"](i.x,i.y+e,i.width,i.height-e))):(i.width>t&&this._free.push(new Z["a"](i.x+t,i.y,i.width-t,i.height)),i.height>e&&this._free.push(new Z["a"](i.x,i.y+e,t,i.height-e))),new Z["a"](i.x,i.y,t,e))}release(t){for(let e=0;eMath.floor(t/256);function Q(t){const e=new Set;for(const i of t)e.add($(i));return e}function J(t,e,i){return t.has(e)||t.set(e,i().then(()=>{t.delete(e)}).catch(i=>{t.delete(e),Object(U["w"])(i)})),t.get(e)}const tt=t=>({rect:new Z["a"](0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:t,sdf:!0});class et{constructor(t,e,i){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this.width=t,this.height=e,this._glyphSource=i,this._binPack=new K(t-4,e-4),this._glyphData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyph()}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyph(){const t=[117,149,181,207,207,181,149,117],e=[];for(let s=0;sthis._getMosaicItem(s,t,e))}bind(t,e,i,s){const r=this._getTexture(t,i);r.setSamplingMode(e),this._dirties[i]&&(r.setData(this._glyphData[i]),this._dirties[i]=!1),t.bindTexture(r,s)}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_getTexture(t,e){return this._textures[e]||(this._textures[e]=new Y["a"](t,{pixelFormat:T["p"].ALPHA,dataType:T["q"].UNSIGNED_BYTE,width:this.width,height:this.height},new Uint8Array(this.width*this.height))),this._textures[e]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,i){const s=Q(e),r=[];s.forEach(e=>{r.push(this._fetchRange(t,e,i))}),await Promise.all(r)}async _fetchRange(t,e,i){if(e>X)return null;const s=t+e;return J(this._rangePromises,s,()=>this._glyphSource.getRange(t,e,i))}_getMosaicItem(t,e,i){if(!t[i]){const s=this._glyphSource.getGlyph(e,i);if(!s||!s.metrics)return tt(i);const r=this._recordGlyph(s),n=this._currentPage,a=s.metrics;t[i]={rect:r,page:n,metrics:a,code:i,sdf:!0},this._invalidate()}return t[i]}_recordGlyph(t){const e=t.metrics;let i;if(0===e.width)i=new Z["a"](0,0,0,0);else{const s=3,r=e.width+2*s,a=e.height+2*s;i=this._binPack.allocate(r,a),i.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyph(),this._binPack=new K(this.width-4,this.height-4),i=this._binPack.allocate(r,a));const o=this._glyphData[this._currentPage],h=t.bitmap;let l,c;if(h)for(let t=0;t{s.addRange(e,new st(new it["a"](new Uint8Array(t.data),new DataView(t.data))))})}getGlyph(t,e){const i=this._getFontStack(t);if(!i)return;const s=Math.floor(e/256);if(s>256)return;const r=i.getRange(s);return r?{metrics:r.getMetrics(e),bitmap:r.getBitmap(e)}:void 0}_getFontStack(t){let e=this._glyphInfo[t];return e||(e=this._glyphInfo[t]=new rt),e}}var at=i("661c");const ot=1e20;class ht{constructor(t){this.size=t;const e=document.createElement("canvas");e.width=e.height=t,this._context=e.getContext("2d"),this._gridOuter=new Float64Array(t*t),this._gridInner=new Float64Array(t*t),this._f=new Float64Array(t),this._d=new Float64Array(t),this._z=new Float64Array(t+1),this._v=new Int16Array(t)}dispose(){this._context=this._gridOuter=this._gridInner=this._f=this._d=this._z=this._v=null,this._svg&&(document.body.removeChild(this._svg),this._svg=null)}draw(t,e,i=31){this._initSVG();const s=this.createSVGString(t);return new Promise((t,r)=>{const n=new Image;n.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(s),n.onload=()=>{n.onload=null,this._context.clearRect(0,0,this.size,this.size),this._context.drawImage(n,0,0,this.size,this.size);const e=this._context.getImageData(0,0,this.size,this.size),s=new Uint8Array(this.size*this.size*4);for(let t=0;tr(Object(U["e"])()))})}_initSVG(){if(!this._svg){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("style","position: absolute;"),t.setAttribute("width","0"),t.setAttribute("height","0"),t.setAttribute("aria-hidden","true"),t.setAttribute("role","presentation"),document.body.appendChild(t),this._svg=t}}createSVGString(t){this._initSVG();const e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",t),this._svg.appendChild(e);const i=e.getBBox(),s=i.width/i.height,r=this.size/2;let n,a,o,h;if(s>1){a=n=r/i.width;const t=r*(1/s);o=this.size/4,h=r-t/2}else n=a=r/i.height,o=r-r*s/2,h=this.size/4;const l=-i.x*n+o,c=-i.y*a+h;e.setAttribute("style",`transform: matrix(${n}, 0, 0, ${a}, ${l}, ${c})`);const u=`${this._svg.innerHTML}`;return this._svg.removeChild(e),u}_edt(t,e,i){const s=this._f,r=this._d,n=this._v,a=this._z;for(let o=0;o0&&(this._maxItemSize=s),this.pixelRatio=window.devicePixelRatio||1,this._binPack=new K(this._pageWidth,this._pageHeight);const r=Math.floor(this._pageWidth),n=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(r*n)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getWidth(t){return t>=this._mosaicPages.length?-1:this._mosaicPages[t].size[0]}getHeight(t){return t>=this._mosaicPages.length?-1:this._mosaicPages[t].size[1]}getPageTexture(t){return t0&&this._requestRender.requestRender(),e.bindFrame(t,o,s)}r.dirty=!1}static _copyBits(t,e,i,s,r,n,a,o,h,l,c){let u=s*e+i,d=o*n+a;if(c){d-=n;for(let a=-1;a<=l;a++,u=((a+l)%l+s)*e+i,d+=n)for(let e=-1;e<=h;e++)r[d+e]=t[u+(e+h)%h]}else for(let f=0;f=this._mosaicPages.length)return;const e=this._mosaicPages[t.page],i=e.mosaicsData;if(!ct(e.mosaicsData))throw new s["a"]("mapview-invalid-resource","unsuitable data type!");const r=t.spriteData,n=i.data;n&&r||console.error("Source or target images are uninitialized!"),ut._copyBits(r,t.spriteSize[0],0,0,n,t.pageSize[0],t.rect.x+q["A"],t.rect.y+q["A"],t.spriteSize[0],t.spriteSize[1],t.repeat),e.dirty=!0}_allocateImage(t,e){t+=2*q["A"],e+=2*q["A"];const i=Math.max(t,e);if(this._maxItemSize&&this._maxItemSize>>1:t>>>1;_t[Es]=t}function mt(t,e=0,i=t.length-e){let s=-1;for(let r=e,n=e+i;r>>8^_t[255&(s^t[r])];return-1^s}const pt=new s["a"]("Not a PNG"),gt=new s["a"]("Not an animated PNG"),bt=new Uint8Array([137,80,78,71,13,10,26,10]);function yt(t){const e=t.constructor===Uint8Array?t:new Uint8Array(t);return!bt.some((t,i)=>t!==e[i])}function xt(t){const e=new Uint8Array(t);if(!yt(e))return!1;let i=!1;return Mt(e,t=>!(i="acTL"===t)),i}class vt{constructor(){this.width=0,this.height=0,this.numPlays=0,this.playTime=0,this.frames=[],this.paused=!1,this.playing=!1,this.playSpeed=1,this.currentFrameNumber=0,this._lastUsedFrame=-1}static async create(t,e){const i=new vt;try{await i._load(t,e)}catch(r){if(!Object(U["m"])(r))return new s["a"]("invalid-resource","Could not load PNG: "+r.message)}return i}play(){this.playing||(this.paused=!1,this.playing=!0,this._play())}pause(){this.paused=!0,this.playing=!1,clearTimeout(this.timerID)}togglePlay(){this.paused||!this.playing?this.play():this.pause()}bindFrame(t,e,i){t.bindTexture(e,i);const s=this.frameChanged();if(!s)return!1;const r=this.currentFrame,n=r.frameData,a=e.descriptor;return(r.left||r.top||r.width!==a.width||r.height!==a.height)&&e.setData(null),e.updateData(0,r.left,r.top,r.width,r.height,n),this.updateUsedFrame(),s}frameChanged(){return this._lastUsedFrame!==this.currentFrameNumber}updateUsedFrame(){this._lastUsedFrame=this.currentFrameNumber}async _load(t,e){try{const e=Tt(this,t);if(e!==this)return e;this._resizeCanvas=document.createElement("canvas"),this._resizeCanvas.width=this.width,this._resizeCanvas.height=this.height,await Promise.all(this.frames.map(t=>t.createImage(this._resizeCanvas)))}catch(i){if(!Object(U["m"])(i))return new s["a"]("invalid-resource","Could not parse PNG")}this.play()}_play(){let t,e;if(0===this.playSpeed)return void this.pause();this.playSpeed<0?(this.currentFrameNumber-=1,this.currentFrameNumber<0&&(this.currentFrameNumber=this.frames.length-1),e=this.currentFrameNumber,e-=1,e<0&&(e=this.frames.length-1),t=1*-this.frames[e].delay/this.playSpeed):(this.currentFrameNumber+=1,this.currentFrameNumber%=this.frames.length,t=1*this.frames[this.currentFrameNumber].delay/this.playSpeed);const i=this.frames[this.currentFrameNumber];this.currentFrame={frameData:i.imageData,top:i.top,left:i.left,width:i.width,height:i.height},this.timerID=window.setTimeout(()=>this._play(),t)}}class wt{constructor(){this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.data=null,this.imageData=null}async createImage(t){if(null===this.imageData)return new Promise((e,i)=>{const s=URL.createObjectURL(this.data),r=document.createElement("img");r.onload=()=>{URL.revokeObjectURL(s),this.imageData=Ot(r,t),e()},r.onerror=()=>{URL.revokeObjectURL(s),this.imageData=null,i(new Error("Image creation error"))},r.src=s})}}function Ot(t,e){e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const s=i.getImageData(0,0,t.width,t.height),r=new Uint8Array(s.data);let n;for(let a=0;at!==i[e]))return pt;let s=!1;if(Mt(i,t=>!(s="acTL"===t)),!s)return gt;const r=[],n=[];let a=null,o=null,h=0;if(Mt(i,(e,i,s,l)=>{const c=new DataView(i.buffer);switch(e){case"IHDR":a=i.subarray(s+8,s+8+l),t.width=c.getUint32(s+8),t.height=c.getUint32(s+12);break;case"acTL":t.numPlays=c.getUint32(s+8+4);break;case"fcTL":{o&&(t.frames.push(o),h++),o=new wt,o.width=c.getUint32(s+8+4),o.height=c.getUint32(s+8+8),o.left=c.getUint32(s+8+12),o.top=c.getUint32(s+8+16);const e=c.getUint16(s+8+20);let i=c.getUint16(s+8+22);0===i&&(i=100),o.delay=1e3*e/i,o.delay<=10&&(o.delay=100),t.playTime+=o.delay,o.disposeOp=c.getUint8(s+8+24),o.blendOp=c.getUint8(s+8+25),o.dataParts=[],0===h&&2===o.disposeOp&&(o.disposeOp=1);break}case"fdAT":o&&o.dataParts.push(i.subarray(s+8+4,s+8+l));break;case"IDAT":o&&o.dataParts.push(i.subarray(s+8,s+8+l));break;case"IEND":n.push(Rt(i,s,12+l));break;default:r.push(Rt(i,s,12+l))}}),0===t.frames.length)return gt;t.frameCount=t.frames.length;const l=new Blob(r),c=new Blob(n);return t.frames.forEach(t=>{let e=[];e.push(bt),a.set(Ct(t.width),0),a.set(Ct(t.height),4),e.push(Et("IHDR",a)),e.push(l),t.dataParts.forEach(t=>e.push(Et("IDAT",t))),e.push(c),t.data=new Blob(e,{type:"image/png"}),delete t.dataParts,e=null}),t}function Mt(t,e){const i=new DataView(t.buffer);let s,r,n,a=8;do{r=i.getUint32(a),s=jt(t,a+4,4),n=e(s,t,a,r),a+=12+r}while(!1!==n&&"IEND"!==s&&a>>24&255,t>>>16&255,t>>>8&255,255&t])}const It={GCExt:249,COMMENT:254,APPExt:255,UNKNOWN:1,IMAGE:44,EOF:59,EXT:33};function Ft(t){if(!t||0===t.byteLength)return!1;const e=t.constructor===Uint8Array?t:new Uint8Array(t);return 71===e[0]&&73===e[1]&&70===e[2]&&56===e[3]}function Bt(t){if(!t||0===t.byteLength)return!1;const e=new Uint8Array(t);if(!Ft(e))return!1;let i=0;for(let s=0,r=e.length-9;s1))return!0;return!1}class zt{constructor(){this.paused=!1,this.playing=!1,this.waitTillDone=!0,this.loading=!1,this.firstFrameOnly=!1,this.frames=[],this.comment="",this.length=0,this.currentFrameNumber=0,this.frameCount=0,this.playSpeed=1,this.lastFrame=null,this.playOnLoad=!0,this.complete=!1,this.interlaceOffsets=[0,4,2,1],this.interlaceSteps=[8,8,4,2],this._lastUsedFrame=-1}static async create(t,e){const i=new zt;try{await i._load(t,e)}catch(r){if(!Object(U["m"])(r))return new s["a"]("invalid-resource","Could not load PNG: "+r.message)}return i}play(){this.playing||(this.paused=!1,this.playing=!0,this._play())}pause(){this.paused=!0,this.playing=!1,clearTimeout(this.timerID)}togglePlay(){this.paused||!this.playing?this.play():this.pause()}bindFrame(t,e,i){t.bindTexture(e,i);const s=this.frameChanged();if(s){const t=this.currentFrame,i=t.frameData;e.updateData(0,0,0,t.width,t.height,i),this.updateUsedFrame()}return s}seekFrame(t){clearTimeout(this.timerID),this.currentFrameNumber=t%this.frames.length,this.playing?this._play():this._setCurrentFrame(this.currentFrameNumber)}seek(t){clearTimeout(this.timerID),t<0&&(t=0),t*=1e3,t%=this.length;let e=0;for(;t>this.frames[e].time+this.frames[e].delay&&e{setTimeout(()=>this._parseBlock(i,t,s,e),0)})}async _parseBlock(t,e,i,s){if(s&&s.signal&&Object(U["n"])(s.signal))return void i(Object(U["e"])());const r=t.data[t.pos++];if(r===It.IMAGE){if(this._parseImg(t),this.firstFrameOnly)return this._finishedLoading(),void e()}else{if(r===It.EOF)return this._finishedLoading(),void e();this._parseExt(t)}"function"==typeof this.onprogress&&this.onprogress({bytesRead:t.pos,totalBytes:t.data.length,frame:this.frames.length}),setTimeout(()=>this._parseBlock(t,e,i,s),0)}_parseColourTable(t,e){const i=[];for(let s=0;s{const e=this.pixelBufSize/t;this.interlacedBufSize!==this.pixelBufSize&&(this.deinterlaceBuf=new Uint8Array(this.pixelBufSize),this.interlacedBufSize=this.pixelBufSize);let i=0;for(let s=0;s<4;s++)for(let r=this.interlaceOffsets[s];r>3]&1<<(7&r)&&(a|=1<=u.length?u.push(u[o].concat(u[o][0])):o!==d&&u.push(u[o].concat(u[a][0])),h=u[a],l=h.length,i=0;i>2,this.transparencyGiven=!!(1&e),this.delayTime=t.data[t.pos++]+(t.data[t.pos++]<<8),this.transparencyIndex=t.data[t.pos++],t.pos++}_finishedLoading(){this.loading=!1,this.frameCount=this.frames.length,this.lastFrame=null,this.complete=!0,this.disposalMethod=void 0,this.transparencyGiven=void 0,this.delayTime=void 0,this.transparencyIndex=void 0,this.waitTillDone=void 0,this.pixelBuf=void 0,this.deinterlaceBuf=void 0,this.pixelBufSize=void 0,this.deinterlaceBuf=void 0,this.currentFrameNumber=0,this.frames.length>0&&this._setCurrentFrame(0),this.playOnLoad&&this.play()}_play(){let t,e;0!==this.playSpeed?(this.playSpeed<0?(this.currentFrameNumber-=1,this.currentFrameNumber<0&&(this.currentFrameNumber=this.frames.length-1),e=this.currentFrameNumber,e-=1,e<0&&(e=this.frames.length-1),t=1*-this.frames[e].delay/this.playSpeed):(this.currentFrameNumber+=1,this.currentFrameNumber%=this.frames.length,t=1*this.frames[this.currentFrameNumber].delay/this.playSpeed),this._setCurrentFrame(this.currentFrameNumber),this.timerID=window.setTimeout(()=>this._play(),t)):this.pause()}_setCurrentFrame(t){const e=this.frames[t];this.currentFrame={frameData:e.image,top:0,left:0,width:this.width,height:this.height}}}class Pt{constructor(t){this.pos=0,this.data=new Uint8ClampedArray(t),this.len=this.data.length}getString(t){let e="";for(;t--;)e+=String.fromCharCode(this.data[this.pos++]);return e}readSubBlocks(){let t,e,i="";do{for(e=t=this.data[this.pos++];e--;)i+=String.fromCharCode(this.data[this.pos++])}while(0!==t&&this.pos=128?2:4;return Math.min(t,i*s)}const qt=(t,e,i)=>Gt.error(new s["a"](t,e,i));class Ht{constructor(t,e,i){this.mosaicType=t,this.page=e,this.sdf=i}static fromMosaic(t,e){return new Ht(t,e.page,e.sdf)}}class Zt{constructor(t,e){this.resourceManager=e,this._invalidFontsMap=new Map,this._sdfConverter=new ht(Ut),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new Lt["a"]({concurrency:10,process:async(t,i)=>{Object(U["v"])(i);try{return await Object(L["default"])(t,{responseType:"image",signal:i})}catch(e){if(!Object(U["m"])(e))throw new s["a"]("mapview-invalid-resource","Could not fetch requested resource at "+t,e);throw e}}}),this._spriteMosaic=new ut(t,2048,2048,500),this._glyphSource=new nt(A["a"].fontsUrl+"/{fontstack}/{range}.pbf"),this._glyphMosaic=new et(1024,1024,this._glyphSource),this._rasterizer=new W["a"](e)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}async rasterizeItem(t,e,i,s){if(Object(a["j"])(t))return qt("mapview-null-resource","Unable to rasterize null resource"),null;switch(t.type){case"text":case"esriTS":{const e=await this._rasterizeText(t,i,s);return e.forEach(t=>this._setTextureBinding(g["a"].GLYPH,t)),{glyphMosaicItems:e}}default:{if(Object(ft["q"])(t))return qt("mapview-invalid-type","MapView does not support symbol type: "+t.type,t),null;const i=await this._rasterizeSpriteSymbol(t,e,s);return Object(Dt["a"])(i)&&i&&this._setTextureBinding(g["a"].SPRITE,i),{spriteMosaicItem:i}}}}bindTextures(t,e,i,s=!1){if(0===i.textureBinding)return;const r=this._bindingInfos[i.textureBinding-1],n=r.page,a=s?T["z"].LINEAR_MIPMAP_LINEAR:T["z"].LINEAR;switch(r.mosaicType){case g["a"].SPRITE:{const i=this.sprites.getWidth(n),s=this.sprites.getHeight(n),r=Object(f["s"])(kt,i,s);return this._spriteMosaic.bind(t,a,n,q["M"]),e.setUniform1i("u_texture",q["M"]),void e.setUniform2fv("u_mosaicSize",r)}case g["a"].GLYPH:{const i=this.glyphs.width,s=this.glyphs.height,r=Object(f["s"])(kt,i,s);return this._glyphMosaic.bind(t,a,n,q["G"]),e.setUniform1i("u_texture",q["G"]),void e.setUniform2fv("u_mosaicSize",r)}default:Gt.error("mapview-texture-manager","Cannot handle unknown type "+r.mosaicType)}}_hashMosaic(t,e){return 1|t<<1|(e.sdf?1:0)<<2|e.page<<3}_setTextureBinding(t,e){const i=this._hashMosaic(t,e);if(!this._hashToBindingIndex.has(i)){const s=Ht.fromMosaic(t,e),r=this._bindingInfos.length+1;this._hashToBindingIndex.set(i,r),this._bindingInfos.push(s)}e.textureBinding=this._hashToBindingIndex.get(i)}async _rasterizeText(t,e,i){let s,r;if("cim"in t){const e=t;s=e.fontName,r=e.text}else{const e=t;s=Object(H["b"])(e.font),r=e.text}const n=this._invalidFontsMap.has(s),a=e||Object(ft["d"])(Object(k["a"])(r)[0]);try{return await this._glyphMosaic.getGlyphItems(n?Nt:s,a,i)}catch(o){return qt("mapview-invalid-resource",`Couldn't find font ${s}. Falling back to Arial Unicode MS Regular`),this._invalidFontsMap.set(s,!0),this._glyphMosaic.getGlyphItems(Nt,a,i)}}async _rasterizeSpriteSymbol(t,e,i){if(Object(ft["y"])(t))return null;const r=At(t);if(this._spriteMosaic.has(r))return this._spriteMosaic.getSpriteItem(r);if(Object(ft["x"])(t)||Object(ft["t"])(t))return this._handleAsyncResource(r,t,i);const n=1,a=this._rasterizer.rasterizeJSONResource(t,n);if(a){const{size:e,image:i,sdf:s,simplePattern:n}=a;return this._addItemToMosaic(r,e,{type:"static",data:i},Object(ft["z"])(t),s,n)}return new s["a"]("TextureManager","unrecognized or null rasterized image")}async _handleAsyncResource(t,e,i){if(this._ongoingRasterizations.has(t))return this._ongoingRasterizations.get(t);let s;s=Object(ft["x"])(e)?this._handleSVG(e,t,i):this._handleImage(e,t,i),this._ongoingRasterizations.set(t,s);try{await s,this._ongoingRasterizations.delete(t)}catch{this._ongoingRasterizations.delete(t)}return s}async _handleSVG(t,e,i){const s=[Ut,Ut],r=await this._sdfConverter.draw(t.path,i);return this._addItemToMosaic(e,s,{type:"static",data:new Uint32Array(r.buffer)},!1,!0,!0)}async _handleGIFOrPNG(t,e,i){const r=await Vt(t,i);if(Object(Dt["a"])(r)){const a=Ft(r),o=yt(r);if(!a&&!o)return new s["a"]("mapview-invalid-resource","Image data is neither GIF nor PNG!");let h;try{a&&Bt(r)?h=await zt.create(r,i):o&&xt(r)&&(h=await vt.create(r,i))}catch(n){if(!Object(U["m"])(n))return new s["a"]("mapview-invalid-resource","Could not fetch requested resource!")}if(h&&Object(Dt["a"])(h))return this._addItemToMosaic(e,[h.width,h.height],{type:"animated",data:h},Object(ft["z"])(t),!1,!1);const l=new Blob([r],{type:a?"image/gif":"image/png"}),c=await this._imageFromBlob(l);if(c&&c instanceof HTMLImageElement){let i=c.width,s=c.height;"esriPMS"===t.type&&(i=Math.round(Wt(c.width,Object(ft["k"])(t))),s=Math.round(c.height*(i/c.width)));const r="cim"in t?t.cim.colorSubstitutions:void 0,{size:n,sdf:a,image:o}=this._rasterizer.rasterizeImageResource(i,s,c,r);return this._addItemToMosaic(e,n,{type:"static",data:o},Object(ft["z"])(t),a,!1)}}return new s["a"]("mapview-invalid-resource","Could not handle resource!")}async _handleImage(t,e,i){if(Object(ft["s"])(t)||Object(ft["v"])(t))return this._handleGIFOrPNG(t,e,i);const r=Object(ft["o"])(t);try{let s;const o=this.resourceManager.getResource(r);if(Object(a["k"])(o))s=o;else{const{data:t}=await this._imageRequestQueue.push(r,{...i});s=t}if(Object(ft["w"])(r))if("width"in t&&"height"in t)s.width=Object(G["g"])(t.width),s.height=Object(G["g"])(t.height);else if("cim"in t){var n;const e=t.cim;s.width=Object(G["g"])(null!=(n=e.width)?n:e.scaleX*e.size),s.height=Object(G["g"])(e.size)}if(!s.width||!s.height)return null;let h=s.width,l=s.height;"esriPMS"===t.type&&(h=Math.round(Wt(s.width,Object(ft["k"])(t))),l=Math.round(s.height*(h/s.width)));const c="cim"in t?t.cim.colorSubstitutions:void 0,{size:u,sdf:d,image:f}=this._rasterizer.rasterizeImageResource(h,l,s,c);return this._addItemToMosaic(e,u,{type:"static",data:f},Object(ft["z"])(t),d,!1)}catch(o){if(!Object(U["m"])(o))return new s["a"]("mapview-invalid-resource",`Could not fetch requested resource at ${r}. ${o.message}`)}}async _imageFromBlob(t){const e=window.URL.createObjectURL(t);try{const{data:t}=await this._imageRequestQueue.push(e);return window.URL.revokeObjectURL(e),t}catch(i){if(window.URL.revokeObjectURL(e),!Object(U["m"])(i))return new s["a"]("mapview-invalid-resource","Could not fetch requested resource at "+e);throw i}}_addItemToMosaic(t,e,i,s,r,n){return this._spriteMosaic.addSpriteItem(t,e,i,s,r,n)}}var Kt=i("823a");class Yt{constructor(){this.name=this.constructor.name}createOptions(t,e){return null}}class Xt extends Yt{constructor(){super(...arguments),this.defines=[],this._desc={vsPath:"fx/integrate",fsPath:"fx/integrate",attributes:new Map([["a_position",0]])}}dispose(){this._quad&&this._quad.dispose()}bind(){}unbind(){}draw(t,e){if(!e.size)return;const{context:i,renderingOptions:s}=t;this._quad||(this._quad=new Kt["a"](i,[0,0,1,0,0,1,1,1]));const r=i.getBoundFramebufferObject(),{x:n,y:o,width:h,height:l}=i.getViewport();e.bindTextures(i);const c=e.getBlock(q["a"]);if(Object(a["j"])(c))return;const u=c.getFBO(i),d=c.getFBO(i,1);i.setViewport(0,0,e.size,e.size),this._computeDelta(t,d,s.labelsAnimationTime),this._updateAnimationState(t,d,u),i.bindFramebuffer(r),i.setViewport(n,o,h,l)}_computeDelta(t,e,i){const{context:s,painter:r,displayLevel:n}=t,a=r.materialManager.getProgram(t,this._desc,["delta"]);s.bindFramebuffer(e),s.setClearColor(0,0,0,0),s.clear(s.gl.COLOR_BUFFER_BIT),s.useProgram(a),a.setUniform1i("u_maskTexture",q["B"]),a.setUniform1i("u_sourceTexture",q["C"]),a.setUniform1f("u_timeDelta",t.deltaTime),a.setUniform1f("u_animationTime",i),a.setUniform1f("u_zoomLevel",Math.round(10*n)),this._quad.draw()}_updateAnimationState(t,e,i){const{context:s,painter:r}=t,n=r.materialManager.getProgram(t,this._desc,["update"]);s.bindTexture(e.colorTexture,1),s.useProgram(n),n.setUniform1i("u_sourceTexture",1),s.bindFramebuffer(i),s.setClearColor(0,0,0,0),s.clear(s.gl.COLOR_BUFFER_BIT),this._quad.draw()}}const $t=t=>t.replace("-","_").toUpperCase(),Qt=t=>`#define ${$t(t)}\n`;function Jt(t){return{attributes:new Map([["a_pos",0],["a_tex",1]]),shaders:{vertexShader:Qt(t)+Object(v["a"])("blend/blend.vert"),fragmentShader:Qt(t)+Object(v["a"])("blend/blend.frag")}}}const te=N["a"].getLogger("esri.views.2d.engine.webgl.effects.blendEffects.BlendEffect");class ee{constructor(){this._size=[0,0]}dispose(t){this._backBufferTexture=Object(a["e"])(this._backBufferTexture),this._quad=Object(a["e"])(this._quad)}draw(t,e,i,r,n){const{context:a,drawPhase:o}=t;if(this._setupShader(a),r&&"normal"!==r&&o!==g["c"].LABEL)return void this._drawBlended(t,e,i,r,n);const h=Jt("normal"),l=a.programCache.acquire(h.shaders.vertexShader,h.shaders.fragmentShader,h.attributes);if(!l)return void te.error(new s["a"]("mapview-BlendEffect",'Error creating shader program for blend mode "normal"'));a.useProgram(l),e.setSamplingMode(i),a.bindTexture(e,0),l.setUniform1i("u_layerTexture",0),l.setUniform1f("u_opacity",n),a.setBlendingEnabled(!0),a.setBlendFunction(T["b"].ONE,T["b"].ONE_MINUS_SRC_ALPHA);const c=this._quad;c.draw(),c.unbind(),l.dispose()}_drawBlended(t,e,i,r,n){const{context:o,state:h,pixelRatio:l,inFadeTransition:c}=t,{size:u}=h,d=o.getBoundFramebufferObject();let f,_;if(Object(a["k"])(d)){const t=d.descriptor;f=t.width,_=t.height}else f=Math.round(l*u[0]),_=Math.round(l*u[1]);this._createOrResizeTexture(t,f,_);const m=this._backBufferTexture;d.copyToTexture(0,0,f,_,0,0,m),o.setStencilTestEnabled(!1),o.setStencilWriteMask(0),o.setBlendingEnabled(!0),o.setDepthTestEnabled(!1),o.setDepthWriteEnabled(!1);const p=Jt(r),g=o.programCache.acquire(p.shaders.vertexShader,p.shaders.fragmentShader,p.attributes);if(!g)return void te.error(new s["a"]("mapview-BlendEffect","Error creating shader program for blend mode "+r));o.useProgram(g),m.setSamplingMode(i),o.bindTexture(m,0),g.setUniform1i("u_backbufferTexture",0),e.setSamplingMode(i),o.bindTexture(e,1),g.setUniform1i("u_layerTexture",1),g.setUniform1f("u_opacity",n),g.setUniform1f("u_inFadeOpacity",c?1:0),o.setBlendFunction(T["b"].ONE,T["b"].ZERO);const b=this._quad;b.draw(),b.unbind(),g.dispose(),o.setBlendFunction(T["b"].ONE,T["b"].ONE_MINUS_SRC_ALPHA)}_setupShader(t){this._quad||(this._quad=new Kt["a"](t,[-1,-1,1,-1,-1,1,1,1]))}_createOrResizeTexture(t,e,i){const{context:s}=t;null!==this._backBufferTexture&&e===this._size[0]&&i===this._size[1]||(this._backBufferTexture?this._backBufferTexture.resize(e,i):this._backBufferTexture=new Y["a"](s,{target:T["A"].TEXTURE_2D,pixelFormat:T["p"].RGBA,internalFormat:T["p"].RGBA,dataType:T["q"].UNSIGNED_BYTE,wrapMode:T["B"].CLAMP_TO_EDGE,samplingMode:T["z"].LINEAR,flipped:!1,width:e,height:i}),this._size[0]=e,this._size[1]=i)}}class ie extends Yt{constructor(t){super(),this.name=this.constructor.name,this.defines=[t]}dispose(){}bind({context:t,painter:e}){this._prev=t.getBoundFramebufferObject();const{width:i,height:s}=t.getViewport(),r=e.getFbos(i,s).effect0;t.bindFramebuffer(r),t.setColorMask(!0,!0,!0,!0),t.setClearColor(0,0,0,0),t.clear(t.gl.COLOR_BUFFER_BIT)}unbind(){}draw(t,e){const{context:i,painter:s}=t,r=s.getPostProcessingEffects(e),n=i.getBoundFramebufferObject();for(const{postProcessingEffect:a,effect:o}of r)a.draw(t,n,o);i.bindFramebuffer(this._prev),i.setStencilTestEnabled(!1),s.blitTexture(i,n.colorTexture,T["z"].NEAREST),i.setStencilTestEnabled(!0)}}const se=1,re=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],ne=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ae=256,oe={outlineWidth:.7,outerHaloWidth:.7,innerHaloWidth:.7,outlinePosition:0},he=N["a"].getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function le(t,e){e.fillColor[0]=t.color.r/255,e.fillColor[1]=t.color.g/255,e.fillColor[2]=t.color.b/255,e.fillColor[3]=t.color.a,t.haloColor?(e.outlineColor[0]=t.haloColor.r/255,e.outlineColor[1]=t.haloColor.g/255,e.outlineColor[2]=t.haloColor.b/255,e.outlineColor[3]=t.haloColor.a):(e.outlineColor[0]=e.fillColor[0],e.outlineColor[1]=e.fillColor[1],e.outlineColor[2]=e.fillColor[2],e.outlineColor[3]=e.fillColor[3]),e.fillColor[3]*=t.fillOpacity,e.outlineColor[3]*=t.haloOpacity,e.fillColor[0]*=e.fillColor[3],e.fillColor[1]*=e.fillColor[3],e.fillColor[2]*=e.fillColor[3],e.outlineColor[0]*=e.outlineColor[3],e.outlineColor[1]*=e.outlineColor[3],e.outlineColor[2]*=e.outlineColor[3],e.outlineWidth=oe.outlineWidth,e.outerHaloWidth=oe.outerHaloWidth,e.innerHaloWidth=oe.innerHaloWidth,e.outlinePosition=oe.outlinePosition}const ce=[0,0,0,0];class ue{constructor(){this._convertedHighlightOptions={fillColor:[.2*.75,.6*.75,.675,.75],outlineColor:[.2*.9,.54,.81,.9],outlinePosition:oe.outlinePosition,outlineWidth:oe.outlineWidth,innerHaloWidth:oe.innerHaloWidth,outerHaloWidth:oe.outerHaloWidth},this.shadeTexChanged=!0,this.texelData=new Uint8Array(4*ae),this.minMaxDistance=[0,0]}setHighlightOptions(t){const e=this._convertedHighlightOptions;le(t,e);const i=e.outlinePosition-e.outlineWidth/2-e.outerHaloWidth,s=e.outlinePosition-e.outlineWidth/2,r=e.outlinePosition+e.outlineWidth/2,n=e.outlinePosition+e.outlineWidth/2+e.innerHaloWidth,a=Math.sqrt(Math.PI/2)*se,o=Math.abs(i)>a?Math.round(10*(Math.abs(i)-a))/10:0,h=Math.abs(n)>a?Math.round(10*(Math.abs(n)-a))/10:0;let l;o&&!h?he.error("The outer rim of the highlight is "+o+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!o&&h?he.error("The inner rim of the highlight is "+h+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):o&&h&&he.error("The highlight is "+Math.max(o,h)+"px away from the edge of the feature; consider reducing some width values.");const c=[void 0,void 0,void 0,void 0];function u(t,e,i){c[0]=(1-i)*t[0]+i*e[0],c[1]=(1-i)*t[1]+i*e[1],c[2]=(1-i)*t[2]+i*e[2],c[3]=(1-i)*t[3]+i*e[3]}const{texelData:d}=this;for(let f=0;f{const r=new Map,c=Math.floor(e.x*i-o/2),u=Math.floor(a-e.y*i-o/2);n.readPixels(c,u,o,o,T["p"].RGBA,T["q"].UNSIGNED_BYTE,this._buf);for(let i=0;it[1]-e[1]).map(t=>t[0]);t.resolve(d),s.delete(e)})}_ensureBuffer(t){this._lastSize!==t&&(this._lastSize=t,this._buf=new Uint8Array(4*t*t),this._buf32=new Uint32Array(this._buf.buffer))}}const Te=5,Me=[1,0],je=[0,1],Se=[1,.8,.6,.4,.2],Re=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];class Ee{constructor(){this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(Te),this._nMips=Te,this._kernelSizeArray=[3,5,7,9,11],this._size=[0,0],this._programDesc={luminosityHighPass:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/luminosityHighPass",attributes:new Map([["a_position",0]])},gaussianBlur:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/composite",attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){if(this._quad&&(this._quad.dispose(),this._quad=null),this._intensityFBO&&(this._intensityFBO.dispose(),this._intensityFBO=null),this._compositeFBO&&(this._compositeFBO.dispose(),this._compositeFBO=null),this._mipsFBOs){for(let t=0;tnew Be,blur:()=>new Fe,bloom:()=>new Ee,opacity:()=>new Ae,"drop-shadow":()=>new De};class Ne{constructor(t){this._requestRender=t,this._effectMap=new Map}dispose(){this._requestRender&&(this._requestRender=null),this._effectMap.forEach(t=>t.dispose()),this._effectMap.clear()}getPostProcessingEffects(t){if(!t||0===t.length)return[];const e=[];for(const i of t){const t=Le(i.type);let s=this._effectMap.get(t);s||(s=ke[t](),this._effectMap.set(t,s)),e.push({postProcessingEffect:s,effect:i})}return e}}var Ue=i("b50f");class Ge{constructor(t,e){var i;this.brushes=t,this.name=e.name,this.drawPhase=e.drawPhase||g["c"].MAP,this._targetFn=e.target,this.effects=e.effects||[],this.enableDefaultDraw=null!=(i=e.enableDefaultDraw)?i:()=>!0}render(t){const{context:e,profiler:i}=t,s=this._targetFn(),r=this.drawPhase&t.drawPhase;if(i.recordPassStart(this.name),r){this.enableDefaultDraw()&&this._doRender(t,s),i.recordPassEnd();for(const r of this.effects){if(!r.enable())continue;const n=r.apply;i.recordPassStart(this.name+"."+n.name),i.recordBrushStart(n.name);const a=r.args&&r.args(),{x:o,y:h,width:l,height:c}=e.getViewport(),u=e.getBoundFramebufferObject();n.bind(t,a);const d=n.createOptions(t,a),f=t.passOptions;t.passOptions=d,this._doRender(t,s,n.defines),t.passOptions=f,n.draw(t,a),n.unbind(t,a),e.bindFramebuffer(u),e.setViewport(o,h,l,c),i.recordBrushEnd(),i.recordPassEnd()}}}_doRender(t,e,i){if(!Object(a["j"])(e))if(Object(Ue["h"])(e)){for(const s of e)if(s.visible)for(const e of this.brushes)t.profiler.recordBrushStart(e.name),e.prepareState(t,s,i),e.draw(t,s,i),t.profiler.recordBrushEnd()}else for(const s of this.brushes)t.profiler.recordBrushStart(s.name),s.prepareState(t,e,i),s.draw(t,e,i),t.profiler.recordBrushEnd()}}var Ve=i("91b0");const We={[g["d"].FILL]:b["a"].fill,[g["d"].LINE]:b["a"].line,[g["d"].MARKER]:b["a"].marker,[g["d"].TEXT]:b["a"].text};class qe{constructor(t,e,i){this.context=t,this._blitRenderer=new S,this._brushCache=new Map,this._vtlMaterialManager=new y["a"],this._blendEffect=new ee,this._fboPool=[],this.effects={highlight:new ve,hittest:new we,hittestVTL:new Oe,integrate:new Xt,insideEffect:new ie("inside"),outsideEffect:new ie("outside")},this.materialManager=new D(t),this.textureManager=new Zt(e,i),this._effectsManager=new Ne(e)}get vectorTilesMaterialManager(){return this._vtlMaterialManager}getRenderTarget(){return this._renderTarget}setRenderTarget(t){this._renderTarget=t}getFbos(t,e){if(t!==this._lastWidth||e!==this._lastHeight){if(this._lastWidth=t,this._lastHeight=e,this._fbos){for(const i in this._fbos)this._fbos[i].resize(t,e);return this._fbos}const i={target:T["A"].TEXTURE_2D,pixelFormat:T["p"].RGBA,dataType:T["q"].UNSIGNED_BYTE,samplingMode:T["z"].NEAREST,wrapMode:T["B"].CLAMP_TO_EDGE,width:t,height:e},s={colorTarget:T["y"].TEXTURE,depthStencilTarget:T["m"].DEPTH_STENCIL_RENDER_BUFFER},r=new Ve["a"](this.context,{width:t,height:e,internalFormat:T["s"].DEPTH_STENCIL});this._stencilBuf=r,this._fbos={output:new pe["a"](this.context,s,i,r),blend:new pe["a"](this.context,s,i,r),effect0:new pe["a"](this.context,s,i,r)}}return this._fbos}acquireFbo(t,e){let i;i=this._fboPool.length>0?this._fboPool.pop():new pe["a"](this.context,{colorTarget:T["y"].TEXTURE,depthStencilTarget:T["m"].DEPTH_STENCIL_RENDER_BUFFER},{target:T["A"].TEXTURE_2D,pixelFormat:T["p"].RGBA,dataType:T["q"].UNSIGNED_BYTE,samplingMode:T["z"].NEAREST,wrapMode:T["B"].CLAMP_TO_EDGE,width:t,height:e},this._stencilBuf);const s=i.descriptor;return s.width===t&&s.height===e||i.resize(t,e),i}releaseFbo(t){this._fboPool.push(t)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderLayers(t,e=null){const{width:i,height:s}=t.getViewport();this._prevFBO=t.getBoundFramebufferObject();const r=this.getFbos(i,s);if(t.bindFramebuffer(r.output),t.setColorMask(!0,!0,!0,!0),t.setDepthWriteEnabled(!0),Object(a["k"])(e)){const{r:i,g:s,b:r,a:n}=e.color;t.setClearColor(n*i/255,n*s/255,n*r/255,n)}else t.setClearColor(0,0,0,0);t.setClearDepth(1),t.clear(t.gl.COLOR_BUFFER_BIT|t.gl.DEPTH_BUFFER_BIT),t.setDepthWriteEnabled(!1)}beforeRenderLayer(t,e,i){const{context:s,blendMode:r,effects:n,requireFBO:a,drawPhase:o}=t;if(a||He(o,r,n,i))s.bindFramebuffer(this._fbos.blend),s.setColorMask(!0,!0,!0,!0),s.setClearColor(0,0,0,0),s.setDepthWriteEnabled(!0),s.setClearDepth(1),s.clear(s.gl.COLOR_BUFFER_BIT|s.gl.DEPTH_BUFFER_BIT),s.setDepthWriteEnabled(!1);else{const t=this._getOutputFBO();s.bindFramebuffer(t)}s.setDepthWriteEnabled(!1),s.setDepthTestEnabled(!1),s.setStencilTestEnabled(!0),s.setClearStencil(e),s.setStencilWriteMask(255),s.clear(s.gl.STENCIL_BUFFER_BIT)}compositeLayer(t,e){const{context:i,blendMode:s,effects:r,requireFBO:n,drawPhase:o}=t;if(n||He(o,s,r,e)){Object(a["k"])(r)&&r.length>0&&o===g["c"].MAP&&this._applyEffects(t,r);const n=this._getOutputFBO();i.bindFramebuffer(n),i.setStencilTestEnabled(!1),i.setStencilWriteMask(0),i.setBlendingEnabled(!0),i.setBlendFunctionSeparate(T["b"].ONE,T["b"].ONE_MINUS_SRC_ALPHA,T["b"].ONE,T["b"].ONE_MINUS_SRC_ALPHA),i.setColorMask(!0,!0,!0,!0);const h=Object(a["j"])(s)||o===g["c"].HIGHLIGHT?"normal":s;this._blendEffect.draw(t,this._fbos.blend.colorTexture,T["z"].NEAREST,h,e)}}renderLayers(t){if(t.bindFramebuffer(this._prevFBO),!this._fbos)return;const e=this._getOutputFBO();t.setStencilTestEnabled(!1),t.setStencilWriteMask(0),this.blitTexture(t,e.colorTexture,T["z"].NEAREST)}dispose(){if(this.materialManager.dispose(),this.textureManager.dispose(),this._blitRenderer&&(this._blitRenderer.dispose(),this._blitRenderer=null),this._brushCache&&(this._brushCache.forEach(t=>t.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos)for(const t in this._fbos)this._fbos[t]&&this._fbos[t].dispose();for(const t of this._fboPool)t.dispose();if(this._fboPool.length=0,this.effects)for(const t in this.effects)this.effects[t]&&this.effects[t].dispose();this._effectsManager.dispose(),this._vtlMaterialManager&&(this._vtlMaterialManager.dispose(),this._vtlMaterialManager=null),this._prevFBO=null}getGeometryBrush(t){const e=We[t];let i=this._brushCache.get(e);return void 0===i&&(i=new e,this._brushCache.set(e,i)),this._brushCache.get(e)}renderObject(t,e,i,s){const r=b["a"][i];if(!r)return null;let n=this._brushCache.get(r);void 0===n&&(n=new r,this._brushCache.set(r,n)),n.prepareState(t,e,s),n.draw(t,e,s)}renderObjects(t,e,i,s){const r=b["a"][i];if(!r)return null;let n=this._brushCache.get(r);void 0===n&&(n=new r,this._brushCache.set(r,n)),n.drawMany(t,e,s)}registerRenderPass(t){const e=t.brushes.map(t=>(this._brushCache.has(t)||this._brushCache.set(t,new t),this._brushCache.get(t)));return new Ge(e,t)}setHighlightOptions(t){this.effects.highlight.setHighlightOptions(t)}blitTexture(t,e,i,s=1){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(T["b"].ONE,T["b"].ONE_MINUS_SRC_ALPHA,T["b"].ONE,T["b"].ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(t,e,i,s)}getPostProcessingEffects(t){return this._effectsManager.getPostProcessingEffects(t)}_getOutputFBO(){return null!=this._renderTarget?this._renderTarget:this._fbos.output}_applyEffects(t,e){const{context:i}=t,s=this._effectsManager.getPostProcessingEffects(e);for(const{postProcessingEffect:r,effect:n}of s)i.bindFramebuffer(this._fbos.blend),r.draw(t,this._fbos.blend,n)}}function He(t,e,i,s){return t!==g["c"].HIGHLIGHT&&(1!==s||Object(a["k"])(e)&&"normal"!==e||Object(a["k"])(i)&&i.length>0)}var Ze=i("971e"),Ke=i("ce6d"),Ye=i("1a9a");const Xe=Object(n["a"])("esri-2d-profiler");class $e{constructor(t,e){if(this._events=new Ke["a"],this._entries=new Map,this._timings=new Ze["a"](10),!Xe)return;this._ext=Object(Ye["a"])(t.gl,{}),this._debugOutput=e;const i=t.gl;if(this.enableCommandLogging)for(const s in i)if("function"==typeof i[s]){const t=i[s],e=-1!==s.indexOf("draw");i[s]=(...r)=>(this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:s,args:r,isDrawCommand:e}),this._currentSummary&&(this._currentSummary.commands++,e&&this._currentSummary.drawCommands++),t.apply(i,r))}}get enableCommandLogging(){return!("object"==typeof Xe&&Xe.disableCommands)}recordContainerStart(t){Xe&&(this._currentContainer=t)}recordContainerEnd(){Xe&&(this._currentContainer=null)}recordPassStart(t){Xe&&(this._currentPass=t,this._initSummary())}recordPassEnd(){Xe&&(this._currentPass=null,this._emitSummary())}recordBrushStart(t){Xe&&(this._currentBrush=t)}recordBrushEnd(){Xe&&(this._currentBrush=null)}recordStart(t){if(Xe&&Object(a["k"])(this._ext)){if(this._entries.has(t)){const e=this._entries.get(t),i=this._ext.resultAvailable(e.query),s=this._ext.disjoint();if(i&&!s){const i=this._ext.getResult(e.query)/1e6;let s=0;if(Object(a["k"])(this._timings.enqueue(i))){const t=this._timings.entries,e=t.length;let i=0;for(const s of t)i+=s;s=i/e}const r=i.toFixed(2),n=s?s.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${t}, ${r} ms (${n} last 10 avg)\n${e.commandsLen} Commands (${e.drawCommands} draw)`),console.log("RenderPass breakdown: "),console.table(e.summaries),console.log("Commands: ",e.commands),console.groupEnd()):console.log(`Frame report for ${t}, ${r} ms (${n} last 10 avg)`),this._debugOutput.innerHTML=`${r} (${n})`}for(const t of e.handles)t.remove();this._entries.delete(t)}const e={name:t,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(e.handles.push(this._events.on("command",t=>{e.commandsLen++,e.commands.push(t),t.isDrawCommand&&e.drawCommands++})),e.handles.push(this._events.on("summary",t=>{e.summaries.push(t)}))),this._ext.beginTimeElapsed(e.query),this._entries.set(t,e)}}recordEnd(t){Xe&&Object(a["k"])(this._ext)&&this._entries.has(t)&&this._ext.endTimeElapsed()}_initSummary(){this.enableCommandLogging&&(this._currentSummary={container:this._currentContainer,pass:this._currentPass,drawCommands:0,commands:0})}_emitSummary(){this.enableCommandLogging&&this._events.emit("summary",this._currentSummary)}}const Qe={shaders:{vertexShader:Object(v["a"])("stencil/stencil.vert"),fragmentShader:Object(v["a"])("stencil/stencil.frag")},attributes:new Map([["a_pos",0]])};var Je=i("4a7a"),ti=i("4dc1"),ei=i("cc15"),ii=i("6df2");const si=2e3;class ri extends p["a"]{constructor(t,e){super(),this._trash=new Set,this._clipData=new Float32Array(8),this._upperLeft=Object(_["b"])(),this._upperRight=Object(_["b"])(),this._lowerLeft=Object(_["b"])(),this._lowerRight=Object(_["b"])(),this._mat2=Object(u["a"])(),this._clipRendererInitialized=!1,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this.renderRequested=!1,this.stage=this,this._stationary=!0;const{canvas:i=document.createElement("canvas"),alpha:h=!0,stencil:l=!0,contextOptions:c={}}=e;this._canvas=i;const d=Object(ei["c"])("2d",i,{alpha:h,antialias:!1,depth:!0,stencil:l});this.context=new ii["a"](Object(a["k"])(d)?d:null,c),this.resourceManager=new m["a"],this.painter=new qe(this.context,this,this.resourceManager),Object(n["a"])("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),t.appendChild(this._debugOutput)),this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:e.timeline||new Je["a"],renderingOptions:e.renderingOptions,requireFBO:!1,profiler:new $e(this.context,this._debugOutput),dataUploadCounter:0},this._taskHandle=Object(o["a"])({render:t=>this.renderFrame(t)}),this._taskHandle.pause(),this._lostWebGLContextHandle=Object(r["c"])(i,"webglcontextlost",()=>{this.emit("webgl-error",{error:new s["a"]("webgl-context-lost")})}),i.setAttribute("style","width: 100%; height:100%; display:block;"),t.appendChild(i)}destroy(){this.removeAllChildren(),this._emptyTrash(),this._taskHandle.remove(),this._taskHandle=null,this._boundFBO=null,this._clipFBO&&(this._clipFBO.dispose(),this._clipFBO=null),this._clipVAO&&(this._clipVAO.dispose(),this._clipVAO=null,this._clipVBO=null),this._clipStencilProgram&&(this._clipStencilProgram.dispose(),this._clipStencilProgram=null),this._lostWebGLContextHandle&&(this._lostWebGLContextHandle.remove(),this._lostWebGLContextHandle=null),this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas),this._debugOutput&&this._debugOutput.parentNode&&this._debugOutput.parentNode.removeChild(this._debugOutput),this.highlightOptions=null,this.resourceManager.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get background(){return this._background}set background(t){this._background=t,this.requestRender()}get highlightOptions(){return this._highlightOptions}set highlightOptions(t){this._highlightOptionsHandle&&(this._highlightOptionsHandle.remove(),this._highlightOptionsHandle=null),this._highlightOptions=t,this._highlightOptions&&(this._highlightOptionsHandle=Object(h["a"])(this._highlightOptions,"version",()=>{this.painter.setHighlightOptions(t),this.requestRender()}))}get renderingOptions(){return this._renderingOptions}set renderingOptions(t){this._renderingOptions=t,this.requestRender()}get state(){return this._state}set state(t){this._state=t,this.requestRender()}get stationary(){return this._stationary}set stationary(t){this._stationary!==t&&(this._stationary=t,this.requestRender())}trashDisplayObject(t){this._trash.add(t),this.requestRender()}untrashDisplayObject(t){return this._trash.delete(t)}requestRender(){this._renderRemainingTime=si,this.renderRequested||(this.renderRequested=!0,this.emit("will-render"),this._taskHandle.resume())}renderFrame(t){const e=this._lastFrameRenderTime?t.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=e,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=t.time,this.renderRequested=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=t.time,this._renderParameters.deltaTime=t.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash(),this.emit("post-render")}_createTransforms(){return{dvs:Object(d["b"])()}}renderChildren(t){for(const e of this.children)e.beforeRender(t);this._renderChildren(this.children,t);for(const e of this.children)e.afterRender(t)}_renderChildren(t,e){const i=this.context;e.profiler.recordStart("drawLayers"),e.dataUploadCounter=0,this._beforeRenderChildren(e),e.drawPhase=g["c"].MAP,this.painter.beforeRenderLayers(i,this.background);for(const s of t)s.processRender(e);this.painter.renderLayers(i),e.drawPhase=g["c"].HIGHLIGHT,this.painter.beforeRenderLayers(i);for(const s of t)s.processRender(e);if(this.painter.renderLayers(i),this._isLabelDrawPhaseRequired(t)){e.drawPhase=g["c"].LABEL,this.painter.beforeRenderLayers(i);for(const i of t)i.processRender(e);this.painter.renderLayers(i)}if(Object(n["a"])("esri-tiles-debug")){e.drawPhase=g["c"].DEBUG,this.painter.beforeRenderLayers(i);for(const i of t)i.processRender(e);this.painter.renderLayers(i)}e.profiler.recordEnd("drawLayers"),this._afterRenderChildren()}_beforeRenderChildren(t){const{context:e}=this,{state:i,pixelRatio:s}=t;e.setClearDepth(1),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT);const{size:r,rotation:n}=i,a=Math.round(r[0]*s),o=Math.round(r[1]*s);if(this._boundFBO=e.getBoundFramebufferObject(),!i.spatialReference.isWrappable)return void(this._clipFrame=!1);const h=Object(l["c"])(n),u=Math.abs(Math.cos(h)),d=Math.abs(Math.sin(h)),_=Math.round(a*u+o*d),m=Math.round(i.worldScreenWidth);if(_<=m)return void(this._clipFrame=!1);this._clipFBO&&this._clipFBO.width===a&&this._clipFBO.height===o||(this._clipFBO=new pe["a"](e,{colorTarget:T["y"].TEXTURE,depthStencilTarget:T["m"].DEPTH_STENCIL_RENDER_BUFFER,width:a,height:o}));const p=(this.state.padding.left-this.state.padding.right)/2,g=(this.state.padding.bottom-this.state.padding.top)/2,b=.5*a,y=.5*o,x=1/a,v=1/o,w=m*s*.5,O=.5*(a*d+o*u),M=this._upperLeft,j=this._upperRight,S=this._lowerLeft,R=this._lowerRight;Object(f["s"])(M,-w,-O),Object(f["s"])(j,w,-O),Object(f["s"])(S,-w,O),Object(f["s"])(R,w,O),Object(c["a"])(this._mat2,[b+p,y-g]),0!==n&&Object(c["g"])(this._mat2,this._mat2,h),Object(f["t"])(M,M,this._mat2),Object(f["t"])(j,j,this._mat2),Object(f["t"])(S,S,this._mat2),Object(f["t"])(R,R,this._mat2);const E=this._clipData;E.set([2*S[0]*x-1,2*(o-S[1])*v-1,2*R[0]*x-1,2*(o-R[1])*v-1,2*M[0]*x-1,2*(o-M[1])*v-1,2*j[0]*x-1,2*(o-j[1])*v-1]),this._clipRendererInitialized||this._initializeClipRenderer(e),this._clipVBO.setData(E),this._boundFBO=e.getBoundFramebufferObject(),e.bindFramebuffer(this._clipFBO),e.setDepthWriteEnabled(!0),e.setStencilWriteMask(255),e.setClearColor(0,0,0,0),e.setClearDepth(1),e.setClearStencil(0),e.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT|e.gl.STENCIL_BUFFER_BIT),e.setDepthWriteEnabled(!1),this._clipFrame=!0}_afterRenderChildren(){const t=this.context;if(t.logIno(),this._clipFrame&&this._clipRendererInitialized){if(t.bindFramebuffer(this._boundFBO),this._boundFBO=null,t.bindVAO(this._clipVAO),t.useProgram(this._clipStencilProgram),t.setDepthWriteEnabled(!1),t.setDepthTestEnabled(!1),t.setStencilTestEnabled(!0),t.setBlendingEnabled(!1),t.setColorMask(!1,!1,!1,!1),t.setStencilOp(T["w"].KEEP,T["w"].KEEP,T["w"].REPLACE),t.setStencilWriteMask(255),t.setStencilFunction(T["h"].ALWAYS,1,255),t.drawElements(T["r"].TRIANGLES,6,T["k"].UNSIGNED_SHORT,0),t.bindVAO(),t.setColorMask(!0,!0,!0,!0),null!=this.background){const{r:e,g:i,b:s,a:r}=this.background.color;t.setClearColor(r*e/255,r*i/255,r*s/255,r)}else t.setClearColor(0,0,0,0);t.clear(t.gl.COLOR_BUFFER_BIT),t.setBlendingEnabled(!0),t.setStencilFunction(T["h"].EQUAL,1,255),this.painter.blitTexture(t,this._clipFBO.colorTexture,T["z"].NEAREST,1),t.setStencilTestEnabled(!1)}}doRender(t){const e=this.context,{state:i,pixelRatio:s}=t;this._resizeCanvas(t),e.setViewport(0,0,s*i.size[0],s*i.size[1]),e.setDepthWriteEnabled(!0),e.setStencilWriteMask(255),super.doRender(t)}async takeScreenshot(t){const{framebufferWidth:e,framebufferHeight:i}={framebufferWidth:Math.round(this._renderParameters.state.size[0]*t.resolutionScale),framebufferHeight:Math.round(this._renderParameters.state.size[1]*t.resolutionScale)},s=1,r=this.context,n=this._state.clone();if(null!=t.rotation){const e=n.viewpoint;n.viewpoint.rotation=t.rotation,n.viewpoint=e}const a={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:n,pixelRatio:s,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1},o=new pe["a"](r,{colorTarget:T["y"].TEXTURE,depthStencilTarget:T["m"].DEPTH_STENCIL_RENDER_BUFFER,width:e,height:i}),h=r.getBoundFramebufferObject(),l=r.getViewport();r.bindFramebuffer(o),r.setViewport(0,0,e,i),this._renderChildren(t.children,a);const c=this._readbackScreenshot(o,{...t.cropArea,y:i-(t.cropArea.y+t.cropArea.height)});r.bindFramebuffer(h),r.setViewport(l.x,l.y,l.width,l.height),this.requestRender();const u=await c;let d;return 1===t.outputScale?d=u:(d=new ImageData(Math.round(u.width*t.outputScale),Math.round(u.height*t.outputScale)),Object(ti["e"])(u,d,!0)),Object(ti["b"])(d,{format:t.format,quality:t.quality,rotation:0,disableDecorations:!1},document.createElement("canvas"),{flipY:!0,premultipliedAlpha:!0})}async _readbackScreenshot(t,e){const i=Object(ti["a"])(e.width,e.height,document.createElement("canvas"));return await t.readPixelsAsync(e.x,e.y,e.width,e.height,T["p"].RGBA,T["q"].UNSIGNED_BYTE,new Uint8Array(i.data.buffer)),i}_resizeCanvas(t){const e=this._canvas,i=e.style,{state:{size:s},pixelRatio:r}=t,n=s[0],a=s[1],o=Math.round(n*r),h=Math.round(a*r);e.width===o&&e.height===h||(e.width=o,e.height=h),i.width=n+"px",i.height=a+"px"}_initializeClipRenderer(t){if(this._clipRendererInitialized)return!0;const e=Object(M["a"])(t,Qe);if(!e)return!1;const i=O["a"].createVertex(t,T["D"].STREAM_DRAW,this._clipData),s=new Uint16Array([0,1,2,2,1,3]),r=O["a"].createIndex(t,T["D"].STATIC_DRAW,s),n=Qe.attributes,a={geometry:[new _e["a"]("a_pos",2,T["k"].FLOAT,0,8)]},o=new j["a"](t,n,a,{geometry:i},r);return this._clipStencilProgram=e,this._clipVBO=i,this._clipVAO=o,this._clipRendererInitialized=!0,!0}_emptyTrash(){for(;this._trash.size>0;){const t=Array.from(this._trash);this._trash.clear();for(const e of t)e.processDetach()}}_isLabelDrawPhaseRequired(t){let e=!1;for(const i of t){if(!(i instanceof p["a"])){e=e||!1;break}if(i.hasLabels)return!0;e=e||this._isLabelDrawPhaseRequired(i.children)}return e}}var ni=i("a4ee"),ai=i("fc29"),oi=i("9096"),hi=i("e42f"),li=i("59b2"),ci=(i("cea0"),i("d386")),ui=i("38a4"),di=i("7de1");const fi=2,_i=1,mi=0,pi=1,gi=2;class bi{constructor(t,e){this.width=t,this.height=e;const i=Math.ceil(t/_i),s=Math.ceil(e/_i);this._cols=i,this._rows=s,this._cells=di["a"].create(i*s)}insertMetrics(t){const e=this._hasCollision(t);return e===mi&&this._markMetrics(t),e}getCellId(t,e){return t+e*this._cols}has(t){return this._cells.has(t)}hasRange(t,e){return this._cells.hasRange(t,e)}set(t){this._cells.set(t)}setRange(t,e){this._cells.setRange(t,e)}_hasCollision(t){const e=t.id;let i=0,s=0;t.save();do{const e=t.boundsCount;i+=e;for(let i=0;ithis.width||n>this.height)return pi;const h=Object(ui["f"])(Math.floor(r/_i),0,this._cols),l=Object(ui["f"])(Math.floor(n/_i),0,this._rows),c=Object(ui["f"])(Math.ceil(a/_i),0,this._cols),u=Object(ui["f"])(Math.ceil(o/_i),0,this._rows);for(let d=l;d<=u;d++)for(let t=h;t<=c;t++){const e=this.getCellId(t,d);if(this.has(e))return gi}return mi}_mark(t,e,i,s){const r=t-i/2,n=e-s/2,a=r+i,o=n+s,h=Object(ui["f"])(Math.floor(r/_i),0,this._cols),l=Object(ui["f"])(Math.floor(n/_i),0,this._rows),c=Object(ui["f"])(Math.ceil(a/_i),0,this._cols),u=Object(ui["f"])(Math.ceil(o/_i),0,this._rows);for(let d=l;d<=u;d++)for(let t=h;t<=c;t++){const e=this.getCellId(t,d);this.set(e)}return!1}_markMetrics(t){const e=t.id;do{const e=t.boundsCount;for(let i=0;i=e.maxDataValue?r:s+i*(r-s)}function Si(t,e){const i=t/e.minDataValue,s=Oi(e.minSize,t),r=Oi(e.maxSize,t);let n=null;return n=i*s,Object(ui["f"])(n,s,r)}function Ri(t,e){const[i,s,r]=Ci(t,e.cache.ipData);if(i===s)return Oi(e.stops[i].size,t);{const n=Oi(e.stops[i].size,t);return n+(Oi(e.stops[s].size,t)-n)*r}}function Ei(t,e){const i=yi["a"][e.valueUnit],s=Oi(e.minSize,t),r=Oi(e.maxSize,t),{valueRepresentation:n}=e;let a=null;return a="area"===n?2*Math.sqrt(t/vi)/i:"radius"===n||"distance"===n?2*t/i:t/i,Object(ui["f"])(a,s,r)}function Ci(t,e){if(!e)return;let i=0,s=e.length-1;return e.some((e,r)=>ti.push(t)),i.sort((t,e)=>t.instanceId-e.instanceId),i.forEach(t=>{Object(a["k"])(t.labelMetrics)&&t.isReady&&e(t,t.labelMetrics.getCursor())})}function Pi(t){return"feature"===t.layer.type||"csv"===t.layer.type||"geojson"===t.layer.type||"ogc-feature"===t.layer.type||"stream"===t.layer.type||"subtype-group"===t.layer.type||"wfs"===t.layer.type}function Di(t){return e=>Object(G["g"])(wi(e,t))}function Ai(t){const e="visualVariables"in t&&t.visualVariables;if(!e)return null;for(const i of e)if("size"===i.type)return Di(i);return null}function Li(t){for(const i of t){var e;const t="featureReduction"in i&&"cluster"===(null==(e=i.featureReduction)?void 0:e.type)&&i.featureReduction,s=[...i.labelingInfo||[],...t.labelingInfo||[]];if(i.labelsVisible&&s.length&&s.some(t=>"none"===t.deconflictionStrategy))return!0}return!1}function ki(t,e){if(!Pi(e))return;const i="subtype-group"===e.layer.type?e.layer.sublayers.items:[e.layer],s=e.layer.geometryType,r=!Li(i),n={};if("subtype-group"!==e.layer.type){if("heatmap"===e.layer.renderer.type)return;const t=Ai(e.layer.renderer);n[0]=t}const o=e.tileRenderer;if(Object(a["j"])(o))return;const h=e.layer.visible&&!e.suspended;t.push({tileRenderer:o,vvEvaluators:n,deconflictionEnabled:r,geometryType:s,visible:h})}class Ni{run(t,e,i){const s=[];for(let r=t.length-1;r>=0;r--)ki(s,t[r]);this._transformMetrics(s,e),this._runCollision(s,e,i)}_runCollision(t,e,i){const[s,r]=e.state.size,n=new bi(s*e.pixelRatio,r*e.pixelRatio);for(const{tileRenderer:a,deconflictionEnabled:o,visible:h}of t){const t=a.featuresView.attributeView;o?h?(this._prepare(a),this._collideVisible(n,a,i),this._collideInvisible(n,a)):zi(a,(e,i)=>{for(;i.nextId();)t.setLabelMinZoom(i.id,Fi)}):zi(a,(e,i)=>{for(;i.nextId();)t.setLabelMinZoom(i.id,Bi)})}}_isFiltered(t,e,i){const s=e.getFilterFlags(t),r=!i.hasFilter||!!(s&q["q"]),n=!Object(a["k"])(i.featureEffect)||i.featureEffect.excludedLabelsVisible||!!(s&q["p"]);return!(r&&n)}_prepare(t){const e=t.featuresView.attributeView,i=new Set;zi(t,(s,r)=>{for(;r.nextId();)i.has(r.id)||(i.add(r.id),this._isFiltered(r.id,e,t.layerView)?e.setLabelMinZoom(r.id,Ii):e.getLabelMinZoom(r.id)!==Bi?e.setLabelMinZoom(r.id,Fi):e.setLabelMinZoom(r.id,Bi))})}_collideVisible(t,e,i){const s=e.featuresView.attributeView,r=new Set;zi(e,(e,n)=>{for(;n.nextId();)if(!r.has(n.id))if(e.key.level===i){if(0===s.getLabelMinZoom(n.id))switch(t.insertMetrics(n)){case pi:break;case gi:s.setLabelMinZoom(n.id,Ii),r.add(n.id);break;case mi:s.setLabelMinZoom(n.id,Bi),r.add(n.id)}}else s.setLabelMinZoom(n.id,Ii)})}_collideInvisible(t,e){const i=e.featuresView.attributeView,s=new Set;zi(e,(e,r)=>{for(;r.nextId();)if(!s.has(r.id)&&i.getLabelMinZoom(r.id)===Fi)switch(t.insertMetrics(r)){case pi:break;case gi:i.setLabelMinZoom(r.id,Fi),s.add(r.id);break;case mi:i.setLabelMinZoom(r.id,Bi),s.add(r.id)}})}_transformMetrics(t,e){for(const{tileRenderer:i,geometryType:s,vvEvaluators:r}of t)zi(i,(t,n)=>{const o=i.featuresView.attributeView,h=t.transforms.labelMat2d;h[4]=Math.round(h[4]),h[5]=Math.round(h[5]);const l=h[4],c=h[5],u="polyline"===s;for(;n.next();){const t=n.boundsCount,i=n.anchorX,s=n.anchorY;let d=n.size;const f=r[0];if(Object(a["k"])(f)){const t=f(o.getVVSize(n.id));d=isNaN(t)||null==t||t===1/0?d:t}const _=n.directionX*(d/2),m=n.directionY*(d/2);for(let r=0;r{t.remove()}),this._handles=null,this._destroyOverlay(),this._set("view",t),t&&(t.on("drag",[Qi.zoom],t=>this._handleDrag(t,1),Xi["b"].INTERNAL),t.on("drag",[Qi.zoom,Qi.counter],t=>this._handleDrag(t,-1),Xi["b"].INTERNAL))}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(t,e,i,s){this._box.x=t,this._box.y=e,this._box.width=i,this._box.height=s,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(t,e,i,s,r){const n=this.view,a=n.toMap(Object(G["e"])(t+.5*i,e+.5*s));let o=Math.max(i/n.width,s/n.height);-1===r&&(o=1/o),this._destroyOverlay(),this.navigation.end(),n.goTo({center:a,scale:n.scale*o})}_updateBox(t,e,i,s){const r=this._boxShape;r.setAttributeNS(null,"x",""+t),r.setAttributeNS(null,"y",""+e),r.setAttributeNS(null,"width",""+i),r.setAttributeNS(null,"height",""+s),r.setAttributeNS(null,"class",$i.box)}_updateBackground(t,e,i,s){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(t,e,i,s,this.view.width,this.view.height))}_createContainer(){const t=document.createElement("div");t.className=$i.container,this.view.root.appendChild(t),this._container=t}_createOverlay(){const t=this.view.width,e=this.view.height,i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M 0 0 L "+t+" 0 L "+t+" "+e+" L 0 "+e+" Z"),i.setAttributeNS(null,"class",$i.background);const s=document.createElementNS("http://www.w3.org/2000/svg","rect"),r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),r.setAttributeNS(null,"class",$i.overlay),r.appendChild(i),r.appendChild(s),this._container.appendChild(r),this._backgroundShape=i,this._boxShape=s,this._overlay=r}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(t,e,i,s,r,n){const a=t+i,o=e+s;return"M 0 0 L "+r+" 0 L "+r+" "+n+" L 0 "+n+" ZM "+t+" "+e+" L "+t+" "+o+" L "+a+" "+o+" L "+a+" "+e+" Z"}_handleDrag(t,e){const i=t.x,s=t.y,r=t.origin.x,n=t.origin.y;let a,o,h,l;switch(i>r?(a=r,h=i-r):(a=i,h=r-i),s>n?(o=n,l=s-n):(o=s,l=n-s),t.action){case"start":this._start();break;case"update":this._update(a,o,h,l);break;case"end":this._end(a,o,h,l,e)}t.stopPropagation()}_redraw(){if(!this._rafId)return;if(this._rafId=null,!this._overlay)return;const{x:t,y:e,width:i,height:s}=this._box;this._updateBox(t,e,i,s),this._updateBackground(t,e,i,s),this._rafId=requestAnimationFrame(this._redraw)}};Object(ni["a"])([Object(li["b"])()],Ji.prototype,"navigation",void 0),Object(ni["a"])([Object(li["b"])()],Ji.prototype,"view",null),Ji=Object(ni["a"])([Object(ci["a"])("esri.views.2d.navigation.ZoomBox")],Ji);const ts=Ji;i("e06a");var es=i("477c"),is=i("e431"),ss=i("0b2d"),rs=i("4e47");let ns=class extends ai["a"]{constructor(t){super(t),this.animationTime=0,this.momentumEstimator=new rs["a"](500,6,.92),this.momentum=null,this.tmpMomentum=Object(ss["f"])(),this.momentumFinished=!1,this.viewpoint=new Zi["a"]({targetGeometry:new Ki["a"],scale:0,rotation:0}),Object(es["f"])(()=>this.momentumFinished,()=>this.navigation.stop())}begin(t,e){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(e),this.previousDrag=e}update(t,e){this.addToEstimator(e);let i=e.center.x,s=e.center.y;const r=this.previousDrag;i=r?r.center.x-i:-i,s=r?s-r.center.y:s,t.viewpoint=Object(Yi["w"])(this.viewpoint,t.viewpoint,[i||0,s||0]),this.previousDrag=e}end(t,e){this.addToEstimator(e);const i=t.navigation.momentumEnabled;this.momentum=i?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(t),this.previousDrag=null,this.navigation.end()}addToEstimator(t){const e=t.center.x,i=t.center.y,s=Object(G["f"])(-e,i),r=Object(ss["h"])(-e,i,0);this.momentumEstimator.add(s,r,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager.animateContinous(t.viewpoint,(e,i)=>{this.momentumFinished=!this.momentum||this.momentum.isFinished(this.animationTime);const s=.001*i;if(!this.momentumFinished){const i=this.momentum.valueDelta(this.animationTime,s);Object(is["g"])(this.tmpMomentum,this.momentum.direction,i),Object(Yi["w"])(e,e,this.tmpMomentum),t.constraints.constrainByGeometry(e)}this.animationTime+=s})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};Object(ni["a"])([Object(li["b"])()],ns.prototype,"momentumFinished",void 0),Object(ni["a"])([Object(li["b"])()],ns.prototype,"viewpoint",void 0),Object(ni["a"])([Object(li["b"])()],ns.prototype,"navigation",void 0),ns=Object(ni["a"])([Object(ci["a"])("esri.views.2d.navigation.actions.Pan")],ns);const as=ns;var os=i("11d8"),hs=i("8e6f");let ls=class extends ai["a"]{constructor(t){super(t),this._animationTime=0,this._momentumFinished=!1,this._rotationMomentumEstimator=new os["a"](.6,.15,.95),this._rotationDirection=1,this._zoomDirection=1,this._zoomMomentumEstimator=new hs["a"],this._zoomOnly=null,this.zoomMomentum=null,this.rotateMomentum=null,this.viewpoint=new Zi["a"]({targetGeometry:new Ki["a"],scale:0,rotation:0}),this.watch("_momentumFinished",t=>{t&&this.navigation.stop()})}begin(t,e){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=e.angle,this._previousRadius=this._startRadius=e.radius,this._previousCenter=e.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,e.timestamp),this.addToZoomEstimator(e,1)}update(t,e){null===this._updateTimestamp&&(this._updateTimestamp=e.timestamp);const i=e.angle,s=e.radius,r=e.center,n=Math.abs(180*(i-this._startAngle)/Math.PI),a=Math.abs(s-this._startRadius),o=this._startRadius/s;if(this._previousRadius){const h=s/this._previousRadius;let l=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=l>=0?1:-1,this._zoomDirection=h>=1?1:-1,t.constraints.rotationEnabled?(null===this._zoomOnly&&e.timestamp-this._updateTimestamp>200&&(this._zoomOnly=a-n>0),null===this._zoomOnly||this._zoomOnly?l=0:this.addToRotateEstimator(i-this._startAngle,e.timestamp)):l=0,this.addToZoomEstimator(e,o),this.navigation.setViewpoint([r.x,r.y],1/h,l,[this._previousCenter.x-r.x,r.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=r}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,e){this._rotationMomentumEstimator.add(t,.001*e)}addToZoomEstimator(t,e){this._zoomMomentumEstimator.add(e,.001*t.timestamp)}canZoomIn(t){const e=t.scale,i=t.constraints.effectiveMaxScale;return 0===i||e>i}canZoomOut(t){const e=t.scale,i=t.constraints.effectiveMinScale;return 0===i||e{const s=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,r=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),n=s||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),a=.001*i;if(this._momentumFinished=r&&n,!this._momentumFinished){const i=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,a))*this._rotationDirection*180/Math.PI:0;let s=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,a)):1;const r=Object(_["b"])(),n=Object(_["b"])();if(this._previousCenter){Object(f["s"])(r,this._previousCenter.x,this._previousCenter.y),Object(Yi["j"])(n,t.size,t.padding),Object(f["m"])(r,r,n);const{constraints:a,scale:o}=t,h=o*s;s<1&&!a.canZoomInTo(h)?(s=o/a.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):s>1&&!a.canZoomOutTo(h)&&(s=o/a.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),Object(Yi["t"])(e,t.viewpoint,s,i,r,t.size),t.constraints.constrainByGeometry(e)}}this._animationTime+=a})}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};Object(ni["a"])([Object(li["b"])()],ls.prototype,"_momentumFinished",void 0),Object(ni["a"])([Object(li["b"])()],ls.prototype,"viewpoint",void 0),Object(ni["a"])([Object(li["b"])()],ls.prototype,"navigation",void 0),ls=Object(ni["a"])([Object(ci["a"])("esri.views.2d.navigation.actions.Pinch")],ls);const cs=ls,us=Object(_["b"])(),ds=Object(_["b"])();let fs=class extends ai["a"]{constructor(t){super(t),this._previousCenter=Object(_["b"])(),this.viewpoint=new Zi["a"]({targetGeometry:new Ki["a"],scale:0,rotation:0})}begin(t,e){this.navigation.begin(),Object(f["s"])(this._previousCenter,e.center.x,e.center.y)}update(t,e){const{state:{size:i,padding:s}}=t;Object(f["s"])(us,e.center.x,e.center.y),Object(Yi["g"])(ds,i,s),t.viewpoint=Object(Yi["r"])(this.viewpoint,t.state.paddedViewState.viewpoint,Object(Yi["b"])(ds,this._previousCenter,us)),Object(f["c"])(this._previousCenter,us)}end(){this.navigation.end()}};Object(ni["a"])([Object(li["b"])()],fs.prototype,"viewpoint",void 0),Object(ni["a"])([Object(li["b"])()],fs.prototype,"navigation",void 0),fs=Object(ni["a"])([Object(ci["a"])("esri.views.2d.actions.Rotate")],fs);const _s=fs,ms=10,ps=1,gs=new Zi["a"]({targetGeometry:new Ki["a"]}),bs=[0,0],ys=250;let xs=class extends ai["a"]{constructor(t){super(t),this._endTimer=null,this.animationManager=null}initialize(){this.pan=new as({navigation:this}),this.rotate=new _s({navigation:this}),this.pinch=new cs({navigation:this}),this.zoomBox=new ts({view:this.view,navigation:this})}destroy(){this.pan.destroy(),this.rotate.destroy(),this.pinch.destroy(),this.zoomBox.destroy(),this.pan=this.rotate=this.pinch=this.zoomBox=this.animationManager=null}begin(){this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(ys)}async zoom(t,e=this._getDefaultAnchor()){if(this.stop(),this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return t<1?this.zoomIn(e):this.zoomOut(e);this.setViewpoint(e,t,0,[0,0])}async zoomIn(t){const e=this.view,i=e.constraints.snapToNextScale(e.scale);return this._zoomToScale(i,t)}async zoomOut(t){const e=this.view,i=e.constraints.snapToPreviousScale(e.scale);return this._zoomToScale(i,t)}setViewpoint(t,e,i,s){this.begin(),this.view.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,t,e,i,s),this.end()}setViewpointImmediate(t,e=0,i=[0,0],s=this._getDefaultAnchor()){this.view.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,s,t,e,i)}continousRotateClockwise(){const t=this.get("view.viewpoint");this.animationManager.animateContinous(t,t=>{Object(Yi["r"])(t,t,-ps)})}continousRotateCounterclockwise(){const t=this.get("view.viewpoint");this.animationManager.animateContinous(t,t=>{Object(Yi["r"])(t,t,ps)})}resetRotation(){this.view.rotation=0}continousPanLeft(){this._continuousPan([-ms,0])}continousPanRight(){this._continuousPan([ms,0])}continousPanUp(){this._continuousPan([0,ms])}continousPanDown(){this._continuousPan([0,-ms])}stop(){this.pan.stopMomentumNavigation(),this.animationManager.stop(),this.end(),null!==this._endTimer&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(t){const e=this.view.viewpoint;this.animationManager.animateContinous(e,e=>{Object(Yi["w"])(e,e,t),this.view.constraints.constrainByGeometry(e)})}_startTimer(t){return null!==this._endTimer||(this._endTimer=setTimeout(()=>{this._endTimer=null;const t=performance.now()-this._lastEventTimestamp;tr&&!l))return Object(Yi["p"])(gs,n,t/r,0,e,a,o),s.constrainByGeometry(gs),i.goTo(gs,{animate:!0})}_scaleRotateTranslateViewpoint(t,e,i,s,r){const{view:n}=this,{size:a,padding:o,constraints:h,scale:l,viewpoint:c}=n,u=l*i,d=h.canZoomInTo(u),f=h.canZoomOutTo(u);return(i<1&&!d||i>1&&!f)&&(i=1),Object(Yi["w"])(c,c,r),Object(Yi["p"])(t,c,i,s,e,a,o),h.constrainByGeometry(t)}};Object(ni["a"])([Object(li["b"])()],xs.prototype,"animationManager",void 0),Object(ni["a"])([Object(li["b"])({type:Boolean,readOnly:!0})],xs.prototype,"interacting",void 0),Object(ni["a"])([Object(li["b"])()],xs.prototype,"pan",void 0),Object(ni["a"])([Object(li["b"])()],xs.prototype,"pinch",void 0),Object(ni["a"])([Object(li["b"])()],xs.prototype,"rotate",void 0),Object(ni["a"])([Object(li["b"])()],xs.prototype,"view",void 0),Object(ni["a"])([Object(li["b"])()],xs.prototype,"zoomBox",void 0),xs=Object(ni["a"])([Object(ci["a"])("esri.views.2d.navigation.MapViewNavigation")],xs);const vs=xs;var ws=i("af40"),Os=i("e041"),Ts=i("7c4b");const Ms={shaders:{vertexShader:Object(v["a"])("magnifier/magnifier.vert"),fragmentShader:Object(v["a"])("magnifier/magnifier.frag")},attributes:new Map([["a_pos",0]])};function js(t){return Object(M["a"])(t,Ms)}var Ss=i("5015");class Rs extends Ts["a"]{constructor(){super(),this._handles=new ws["a"],this._resourcePixelRatio=1,this.visible=!1}destroy(){this._handles.destroy(),this._handles=null,this._disposeRenderResources(),this._resourcesTask&&(this._resourcesTask.abort(),this._resourcesTask=null)}get background(){return this._background}set background(t){this._background=t,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(t){this._magnifier=t,this._handles.removeAll(),this._handles.add([Object(h["a"])(t,"version",()=>{this.visible=t.visible&&Object(a["k"])(t.position)&&t.size>0,this.requestRender()}),t.watch(["mask","overlay"],()=>this._reloadResources()),t.watch("size",()=>{this._disposeRenderResources(),this.requestRender()})])}_createTransforms(){return{dvs:Object(d["b"])()}}doRender(t){var e;const i=t.context;if(!this._resourcesTask)return void this._reloadResources();if(t.drawPhase!==g["c"].MAP||!this._canRender())return;this._updateResources(t);const s=this._magnifier;if(Object(a["j"])(s.position))return;const r=t.pixelRatio,n=s.size*r,o=1/s.factor,h=Math.ceil(o*n);this._readbackTexture.resize(h,h);const{size:l}=t.state,c=r*l[0],u=r*l[1],d=.5*h,f=.5*h,_=Object(ui["f"])(r*s.position.x,d,c-d-1),m=Object(ui["f"])(u-r*s.position.y,f,u-f-1);i.setBlendingEnabled(!0);const p=_-d,b=m-f,y=this._readbackTexture;i.bindTexture(y,0),i.gl.copyTexImage2D(y.descriptor.target,0,y.descriptor.pixelFormat,p,b,h,h,0);const x=null==(e=this.background)?void 0:e.color,v=x?[x.a*x.r/255,x.a*x.g/255,x.a*x.b/255,x.a]:[1,1,1,1],w=(_+s.offset.x*r)/c*2-1,O=(m-s.offset.y*r)/u*2-1,M=n/c*2,j=n/u*2,S=this._program;i.bindVAO(this._vertexArrayObject),i.bindTexture(this._overlayTexture,6),i.bindTexture(this._maskTexture,7),i.useProgram(S),S.setUniform4fv("u_background",v),S.setUniform1i("u_readbackTexture",0),S.setUniform1i("u_overlayTexture",6),S.setUniform1i("u_maskTexture",7),S.setUniform4f("u_drawPos",w,O,M,j),S.setUniform1i("u_maskEnabled",s.maskEnabled?1:0),S.setUniform1i("u_overlayEnabled",s.overlayEnabled?1:0),i.setStencilTestEnabled(!1),i.setColorMask(!0,!0,!0,!0),i.drawArrays(T["r"].TRIANGLE_STRIP,0,4),i.bindVAO()}_canRender(){return this.mask&&this.overlay&&null!=this._magnifier}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const t=Object(a["k"])(this._magnifier)?this._magnifier.maskUrl:null,e=Object(a["k"])(this._magnifier)?this._magnifier.overlayUrl:null;this._resourcesTask=Object(U["h"])(async i=>{const s=Object(a["j"])(t)||Object(a["j"])(e)?Object(Ss["a"])(i):null,r=Object(a["k"])(t)?Object(L["default"])(t,{responseType:"image",signal:i}).then(t=>t.data):s.then(t=>t.mask),n=Object(a["k"])(e)?Object(L["default"])(e,{responseType:"image",signal:i}).then(t=>t.data):s.then(t=>t.overlay),[o,h]=await Promise.all([r,n]);this.mask=o,this.overlay=h,this._disposeRenderResources(),this.requestRender()})}_disposeRenderResources(){this._readbackTexture=Object(a["e"])(this._readbackTexture),this._overlayTexture=Object(a["e"])(this._overlayTexture),this._maskTexture=Object(a["e"])(this._maskTexture),this._vertexArrayObject=Object(a["e"])(this._vertexArrayObject),this._program=Object(a["e"])(this._program)}_updateResources(t){if(t.pixelRatio!==this._resourcePixelRatio&&this._disposeRenderResources(),this._readbackTexture)return;const e=t.context;this._resourcePixelRatio=t.pixelRatio;const i=Math.ceil(this._magnifier.size*t.pixelRatio);this._program=js(e);const s=new Uint16Array([0,1,0,0,1,1,1,0]),r=Ms.attributes;this._vertexArrayObject=new j["a"](e,r,x["b"],{geometry:O["a"].createVertex(e,T["D"].STATIC_DRAW,s)}),this.overlay.width=i,this.overlay.height=i,this._overlayTexture=new Y["a"](e,{target:T["A"].TEXTURE_2D,pixelFormat:T["p"].RGBA,internalFormat:T["p"].RGBA,dataType:T["q"].UNSIGNED_BYTE,wrapMode:T["B"].CLAMP_TO_EDGE,samplingMode:T["z"].NEAREST,flipped:!0,preMultiplyAlpha:!Object(Os["z"])(this.overlay.src)||!t.context.driverTest.svgAlwaysPremultipliesAlpha},this.overlay),this.mask.width=i,this.mask.height=i,this._maskTexture=new Y["a"](e,{target:T["A"].TEXTURE_2D,pixelFormat:T["p"].ALPHA,internalFormat:T["p"].ALPHA,dataType:T["q"].UNSIGNED_BYTE,wrapMode:T["B"].CLAMP_TO_EDGE,samplingMode:T["z"].NEAREST,flipped:!0},this.mask);const n=1/this._magnifier.factor;this._readbackTexture=new Y["a"](e,{target:T["A"].TEXTURE_2D,pixelFormat:T["p"].RGBA,internalFormat:T["p"].RGBA,dataType:T["q"].UNSIGNED_BYTE,wrapMode:T["B"].CLAMP_TO_EDGE,samplingMode:T["z"].LINEAR,flipped:!1,width:Math.ceil(n*i),height:Math.ceil(n*i)})}}},d45f:function(t,e,i){"use strict";function s(t){let e="";for(const i in t){const s=t[i];if("boolean"==typeof s)s&&(e+=`#define ${i}\n`);else if("number"==typeof s)e+=`#define ${i} ${s.toFixed()}\n`;else if("object"==typeof s){const t=s.options;let r=0;for(const i in t)e+=`#define ${t[i]} ${(r++).toFixed()}\n`;e+=`#define ${i} ${t[s.value]}\n`}}return e}i.d(e,"a",(function(){return s}))},d641:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));const s={convertToGEGeometry:r,exportPoint:a,exportPolygon:h,exportPolyline:c,exportMultipoint:d,exportExtent:_};function r(t,e){return null==e?null:t.convertJSONToGeometry(e)}class n{constructor(t,e,i){this.x=t,this.y=e,this.spatialReference=i,this.z=void 0,this.m=void 0}}function a(t,e,i){const s=new n(t.getPointX(e),t.getPointY(e),i),r=t.hasZ(e),a=t.hasM(e);return r&&(s.z=t.getPointZ(e)),a&&(s.m=t.getPointM(e)),s}class o{constructor(t,e,i,s){this.rings=t,this.spatialReference=e,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}function h(t,e,i){return new o(t.exportPaths(e),i,t.hasZ(e),t.hasM(e))}class l{constructor(t,e,i,s){this.paths=t,this.spatialReference=e,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}function c(t,e,i){return new l(t.exportPaths(e),i,t.hasZ(e),t.hasM(e))}class u{constructor(t,e,i,s){this.points=t,this.spatialReference=e,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}function d(t,e,i){return new u(t.exportPoints(e),i,t.hasZ(e),t.hasM(e))}class f{constructor(t,e,i,s,r){this.xmin=t,this.ymin=e,this.xmax=i,this.ymax=s,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}function _(t,e,i){const s=t.hasZ(e),r=t.hasM(e),n=new f(t.getXMin(e),t.getYMin(e),t.getXMax(e),t.getYMax(e),i);if(s){const i=t.getZExtent(e);n.zmin=i.vmin,n.zmax=i.vmax}if(r){const i=t.getMExtent(e);n.mmin=i.vmin,n.mmax=i.vmax}return n}},d806:function(t,e,i){"use strict";i.d(e,"a",(function(){return w}));var s=i("ce50"),r=i("c120"),n=i("e92d"),a=i("38a4"),o=i("b2b2"),h=i("f4cc"),l=i("0f1c"),c=i("80b7"),u=i("8c81"),d=i("175e"),f=i("c8dd"),_=i("97cb"),m=i("8332"),p=i("d17d");const g=n["a"].getLogger("esri.views.layers.2d.features.support.AttributeStore"),b=Object(_["b"])(_["a"],g),y={sharedArrayBuffer:Object(r["a"])("esri-shared-array-buffer"),atomics:Object(r["a"])("esri-atomics")};function x(t,e){return i=>e(t(i))}class v{constructor(t,e,i,s){this.size=0,this.texelSize=4;const{pixelType:r,layout:n,textureOnly:a}=s;this.textureOnly=a||!1,this.pixelType=r,this._ctype=e,this.layout=n,this._resetRange(),this._shared=t,this.size=i,a||(this.data=this._initData(r,i,t,e))}get buffer(){return Object(o["b"])(this.data,t=>t.buffer)}unsetComponentAllTexels(t,e){const i=Object(o["t"])(this.data);for(let s=0;se)return null;this._resetRange();const s=!(this._shared||"local"===this._ctype),r=this.pixelType,n=this.layout,a=Object(o["t"])(this.data);return{start:t,end:e,data:s&&a.slice(t*i,(e+1)*i)||null,pixelType:r,layout:n}}_initData(t,e,i,s){const r=i&&"local"!==s?SharedArrayBuffer:ArrayBuffer,n=Object(f["l"])(t),a=new n(new r(e*e*4*n.BYTES_PER_ELEMENT));for(let o=0;onull)}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}update(t,e){this.config=e;const i=e.schema.processors[0].storage,s=Object(l["a"])(this._schema,i);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),s&&(Object(r["a"])("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",s),t.storage.data=!0,this._schema=i,this._attributeComputeMap.clear(),!Object(o["j"])(i))){switch(i.target){case"feature":this._targetType=d["c"];break;case"aggregate":this._targetType=d["b"]}if("subtype"===i.type)for(const t in i.mapping){const e=i.mapping[t];if(Object(o["k"])(e))for(const t of e.mapping)this._bindAttribute(t)}else for(const t of i.mapping)this._bindAttribute(t)}}onTileData(t,e){if(Object(o["j"])(e.addOrUpdate))return;const i=e.addOrUpdate.getCursor();for(;i.next();){const t=i.getDisplayId();this.setAttributeData(t,i)}}invalidateResources(){this._createResourcesPromise=null,this._abortController.abort(),this._abortController=new AbortController}async setHighlight(t,e){const i=1,s=this._getBlock(0),r=e.map(t=>Object(d["f"])(t));s.lock(),s.unsetComponentAllTexels(0,i),s.setComponent(0,i,r),s.unlock(),this._idsToHighlight.clear();for(const n of t)this._idsToHighlight.add(n);await this.sendUpdates()}async updateFilters(t,e){const{config:i,service:s,spatialReference:n}=e,{filters:a}=i,o=a.map((t,e)=>this._updateFilter(t,e,s,n));(await Promise.all(o)).some(t=>t)&&(t.storage.filters=!0,Object(r["a"])("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,i,s){const r=Object(d["f"])(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlag(t){return this._idsToHighlight.has(t)?u["s"]:0}unsetAttributeData(t){const e=Object(d["f"])(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const i=Object(d["f"])(t);if(this._ensureSizeForTexel(i),this._getBlock(0).setData(i,0,this.getFilterFlags(e)),this._targetType!==Object(d["g"])(t))return;const s=this._attributeComputeMap,r=this.config.supportsTextureFloat?1:2,n=4;s.size&&s.forEach((t,s)=>{const o=s*r%n,h=Math.floor(s*r/n),l=this._getBlock(h+u["e"]),c=t(e);if(this.config.supportsTextureFloat)l.setData(i,o,c);else if(c===u["x"])l.setData(i,o,255),l.setData(i,o+1,255);else{const t=Object(a["f"])(Math.round(c),-32767,32766)+32768,e=255&t,s=(65280&t)>>8;l.setData(i,o,e),l.setData(i,o+1,s)}})}sendUpdates(){if(this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=Object(h["g"])(),this._nextUpdate.promise;const t={blocks:this._blocks.map(t=>Object(o["k"])(t)?t.toMessage():null)};return this._currUpdate=this._createResources().then(()=>{const e=()=>{if(this._currUpdate=null,this._nextUpdate){const t=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then(()=>t.resolve())}},i=this._client.update(t,this._signal).then(e).catch(e);return this._client.render(this._signal),i}).catch(t=>Object(h["m"])(t)?(this._createResourcesPromise=null,this._createResources()):(g.error(new s["a"]("mapview-attribute-store","Encountered an error during client update",t)),Promise.resolve())),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t){function e(){return t.normalizationField?e=>{const i=e.readAttribute(t.normalizationField);return i?e.readAttribute(t.field)/i:null}:e=>e.readAttribute(t.field)}function i(){return t.normalizationField&&g.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),e=>e.getComputedNumericAtIndex(t.fieldIndex)}let s;if(null!=t.fieldIndex)s=i();else{if(!t.field)return;s=e()}t.valueRepresentation&&(s=x(s,e=>Object(m["b"])(e,t.valueRepresentation)));const r=t=>null===t||isNaN(t)||t===1/0?u["x"]:t;this._attributeComputeMap.set(t.binding,x(s,r))}_createResources(){if(Object(o["k"])(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(u["a"]),this._getBlock(u["d"]),b("Initializing AttributeStore");const t={shared:y.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:Object(o["m"])(this._blocks,t=>({textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}))},e=this._client.initialize(t,this._signal).catch(t=>{Object(h["m"])(t)?this._createResourcesPromise=null:g.error(new s["a"]("mapview-attribute-store","Encountered an error during client initialization",t))});return this._createResourcesPromise=e,e.then(()=>Object(o["j"])(this._createResourcesPromise)?this._createResources():void 0),e}_getBlock(t){const e=this._blocks[t];if(Object(o["k"])(e))return e;b("Initializing AttributeBlock at index "+t);const i=y.sharedArrayBuffer,s=this._client.type,r=new v(i,s,this._size,this._blockDescriptors[t]);return this._blocks[t]=r,this._createResourcesPromise=null,r}_expand(){if(this._sizee.expand(t)),this._createResourcesPromise=null,this._size=t,0}return g.error(new s["a"]("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,i,s){const r=this._filters[e],n=Object(o["k"])(r)&&r.hash;if(!r&&!t)return!1;if(n===JSON.stringify(t))return!1;if(Object(o["j"])(t)){if(!r)return!1;const t=1<{let s=l*t[2]-l*e[2];return 0===s&&i&&(s=t[4]-e[4]),s}),u.length){let t=6*u[0][2];c[0]=u[0][0]/t,c[1]=u[0][1]/t,i&&(t=6*u[0][4],c[2]=0!==t?u[0][3]/t:0),(c[0]d[1]||c[1]d[3]||i&&(c[2]d[5]))&&(c.length=0)}if(!c.length){const t=e.lengths[0]?o(_,0,f[0],i,n):null;if(!t)return null;c[0]=t[0],c[1]=t[1],i&&t.length>2&&(c[2]=t[2])}return t}function a(t,e,i,s,n,a,o=1){const h=r(n,a);let l=i,c=i+h,u=0,d=0,f=0,_=0,m=0;for(let r=0,g=s-1;rt[1]&&(t[1]=i),st[3]&&(t[3]=s),n&&(rt[5]&&(t[5]=r))}if(_*o>0&&(_*=-1),m*o>0&&(m*=-1),!_)return null;const p=[u,d,.5*_];return n&&(p[3]=f,p[4]=.5*m),p}function o(t,e,i,s,n){const a=r(s,n);let o=e,d=e+a,f=0,_=0,m=0,p=0;for(let r=0,g=i-1;r0?s?[_/f,m/f,p/f]:[_/f,m/f]:i>0?s?[t[e],t[e+1],t[e+2]]:[t[e],t[e+1]]:null}function h(t,e,i,s){const r=i-t,n=s-e;return Math.sqrt(r*r+n*n)}function l(t,e,i,s,r,n){const a=s-t,o=r-e,h=n-i;return Math.sqrt(a*a+o*o+h*h)}function c(t,e,i,s){return[t+.5*(i-t),e+.5*(s-e)]}function u(t,e,i,s,r,n){return[t+.5*(s-t),e+.5*(r-e),i+.5*(n-i)]}},e416:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("b6a7"),r=i("9344");class n{static getPlacement(t,e,i,n){const a=Object(r["b"])(e);if(!a)return null;const o=Object(s["c"])(t);return a.execute(o,e,i,n)}}},f0d0:function(t,e,i){"use strict";i.d(e,"a",(function(){return M}));i("e06a");var s,r,n,a=i("c120"),o=i("b2b2"),h=i("d97e"),l=i("6655"),c=i("8152"),u=i("7de1"),d=i("a9ab");let f=0;const _=null!=(s=Object(a["a"])("featurelayer-simplify-thresholds"))?s:[.5,.5,.5,.5],m=_[0],p=_[1],g=_[2],b=_[3],y=null!=(r=Object(a["a"])("featurelayer-simplify-payload-size-factors"))?r:[1,2,4],x=y[0],v=y[1],w=y[2],O=null!=(n=Object(a["a"])("featurelayer-simplify-mobile-factor"))?n:2,T=Object(a["a"])("esri-mobile");class M{constructor(t,e){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._level=0,this.instance=t,this._layerSchema=e}static createInstance(){return f++,f=f>65535?0:f,f}get isEmpty(){return Object(o["k"])(this._deleted)&&this._deleted.countSet()===this.getSize()}set level(t){this._level=t}getAreaSimplificationThreshold(t,e){let i=1;const s=T?O:1;e>4e6?i=w*s:e>1e6?i=v*s:e>5e5?i=x*s:e>1e5&&(i=s);let r=0;t>4e3?r=b*i:t>2e3?r=g*i:t>100?r=p:t>15&&(r=m);let n=8;return this._level<4?n=1:this._level<5?n=2:this._level<6&&(n=4),r*n}setArcadeSpatialReference(t){this._arcadeSpatialReference=t}attachStorage(t){this._storage=t}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(t){return this.getComputedNumericAtIndex(0)}setComputedNumeric(t,e){return this.setComputedNumericAtIndex(e,0)}getComputedString(t){return this.getComputedStringAtIndex(0)}setComputedString(t,e){return this.setComputedStringAtIndex(0,e)}getComputedNumericAtIndex(t){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),t)}setComputedNumericAtIndex(t,e){this._storage.setComputedNumericAtIndex(this.getDisplayId(),t,e)}getComputedStringAtIndex(t){return this._storage.getComputedStringAtIndex(this.getDisplayId(),t)}setComputedStringAtIndex(t,e){return this._storage.setComputedStringAtIndex(this.getDisplayId(),t,e)}transform(t,e,i,s){const r=this.copy();return r._tx+=t,r._ty+=e,r._sx*=i,r._sy*=s,r}readAttribute(t,e=!1){const i=this._readAttribute(t,e);if(void 0!==i)return i;for(const s of this._joined){s.setIndex(this.getIndex());const i=s._readAttribute(t,e);if(void 0!==i)return i}}readAttributes(){const t=this._readAttributes();for(const e of this._joined){e.setIndex(this.getIndex());const i=e._readAttributes();for(const e of Object.keys(i))t[e]=i[e]}return t}joinAttributes(t){this._joined.push(t)}readArcadeFeature(){return this}geometry(){const t=this.readHydratedGeometry(),e=Object(l["l"])(t,this.geometryType,this.hasZ,this.hasM),i=Object(d["a"])(e);return i&&(i.spatialReference=this._arcadeSpatialReference),i}field(t){if(this.hasField(t))return this.readAttribute(t,!0);for(const e of this._joined)if(e.setIndex(this.getIndex()),e.hasField(t))return e._readAttribute(t,!0);throw new Error(`Field ${t} does not exist`)}setField(t,e){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.getFieldNames()}castToText(){return JSON.stringify(this.readLegacyFeature())}gdbVersion(){return null}fullSchema(){return this._layerSchema}castAsJson(t=null){return{attributes:this._readAttributes(),geometry:!0===(null==t?void 0:t.keepGeometryType)?this.geometry():this.geometry().toJSON()}}castAsJsonAsync(t=null,e=null){return Promise.resolve(this.castAsJson(e))}removeIds(t){if(Object(o["j"])(this._objectIdToIndex)){const t=new Map,e=this.getCursor();for(;e.next();)t.set(e.getObjectId(),e.getIndex());this._objectIdToIndex=t}const e=this._objectIdToIndex;for(const i of t)e.has(i)&&this.removeAtIndex(e.get(i))}removeAtIndex(t){Object(o["j"])(this._deleted)&&(this._deleted=u["a"].create(this.getSize())),this._deleted.set(t)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const t=this.getCursor();for(;t.next();)yield t.readOptimizedFeature()}_getExists(){return Object(o["j"])(this._deleted)||!this._deleted.has(this.getIndex())}_computeCentroid(){if("esriGeometryPolygon"!==this.geometryType)return null;const t=this.readUnquantizedGeometry();if(!t||t.hasIndeterminateRingOrder)return null;const e=Object(o["u"])(this.getQuantizationTransform(),null);return Object(h["a"])(new c["a"],t,this.hasM,this.hasZ,e)}copyInto(t){t.seen=this.seen,t._storage=this._storage,t._arcadeSpatialReference=this._arcadeSpatialReference,t._joined=this._joined,t._tx=this._tx,t._ty=this._ty,t._sx=this._sx,t._sy=this._sy,t._deleted=this._deleted,t._objectIdToIndex=this._objectIdToIndex}}},f75e:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("b2b2"),r=i("5dbb");class n{bindFeature(t,e,i){}write(t,e,i,n){var a;if(Object(s["j"])(this._effects)||0===(null==(a=this._effects)?void 0:a.length))return this._write(t,e,n);const o=r["a"].executeEffects(this._effects,e.readLegacyGeometryForDisplay(),n.geometryEngine);let h=r["a"].next(o);for(;h;)this._write(t,e,n,h),h=r["a"].next(o)}_write(t,e,i,s){}}},f93c:function(t,e,i){"use strict";i.d(e,"a",(function(){return m}));var s=i("b2b2"),r=i("a915"),n=i("a29a"),a=i("2c63"),o=i("3349"),h=i("738e"),l=i("6655"),c=i("e416"),u=i("c84e"),d=i("d114");const f=3.14159265359/180,_=8,m=t=>class extends t{constructor(...t){super(...t),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this._offsets={xUpperLeft:0,yUpperLeft:0,xUpperRight:0,yUpperRight:0,xBottomLeft:0,yBottomLeft:0,xBottomRight:0,yBottomRight:0},this.geometryType=u["d"].MARKER}_write(t,e,i,s){const r=e.getDisplayId();t.recordStart(r,this._materialKey,this.geometryType,!0),this._writeGeometry(t,e,r,i,s),t.recordEnd()}_writeGeometry(t,e,i,r,n){if(Object(s["k"])(this._markerPlacement))return this._writePlacedMarkers(t,e,r,n);if(!n&&"esriGeometryPoint"===e.geometryType){const s=e.getX(),r=e.getY();if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(s<0||s>=513||r<0||r>=513))return;return this._writeVertices(t,i,this._getPos(s,r),s,r)}const a=n?Object(l["q"])(Object(l["d"])(n),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!Object(s["j"])(a)){if(a.isPoint){const[e,s]=a.coords;if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(e<0||e>=512||s<0||s>=512))return;return this._writeVertices(t,i,this._getPos(e,s),e,s)}a.forEachVertex((e,s)=>this._writeVertices(t,i,this._getPos(e,s),e,s))}}_writePlacedMarkers(t,e,i,n){const o=null!=n?n:e.readLegacyGeometryForDisplay(),l=c["a"].getPlacement(o,Object(s["t"])(this._markerPlacement),Object(r["g"])(1),i.geometryEngine);if(!l)return;const u=e.getDisplayId(),d=Object(h["a"])(),_=Object(a["a"])(),m=-128,p=640;let g=l.next();for(;null!=g;){const e=g.tx,i=-g.ty;e>=m&&e<=p&&i>=m&&i<=p&&(this._applyTransformation(_,d,-g.getAngle()/f),this._writeVertices(t,u,this._getPos(e,i),e,i)),g=l.next()}}_writeVertices(t,e,i,s,r){const n=t.vertexCount();if(this.angle){const e=Math.max(this._computedWidth*this._vertexBoundsScaleX,this._computedHeight*this._vertexBoundsScaleY);t.vertexBounds(s+this.xOffset,r-this.yOffset,e,e)}else t.vertexBounds(s+this.xOffset,r-this.yOffset,this._computedWidth*this._vertexBoundsScaleX,this._computedHeight*this._vertexBoundsScaleY);t.vertexWrite(i),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(this._texUpperLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(this._texUpperRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(this._texBottomLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(this._texBottomRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.indexWrite(n+0),t.indexWrite(n+1),t.indexWrite(n+2),t.indexWrite(n+1),t.indexWrite(n+3),t.indexWrite(n+2)}_applyTransformation(t,e,i=0){Object(n["a"])(t,Object(h["b"])(this.xOffset,-this.yOffset)),this.angle+i!==0&&Object(n["g"])(t,t,f*(this.angle+i));const s=this._computedWidth,r=this._computedHeight,a=(this._anchorX-.5)*s,l=(this._anchorY-.5)*r;Object(o["s"])(e,a,l),Object(o["t"])(e,e,t),this._offsetUpperLeft=Object(d["a"])(16*e[0],16*e[1]),this._offsets.xUpperLeft=e[0],this._offsets.yUpperLeft=e[1],Object(o["s"])(e,a+s,l),Object(o["t"])(e,e,t),this._offsetUpperRight=Object(d["a"])(16*e[0],16*e[1]),this._offsets.xUpperRight=e[0],this._offsets.yUpperRight=e[1],Object(o["s"])(e,a,l+r),Object(o["t"])(e,e,t),this._offsetBottomLeft=Object(d["a"])(16*e[0],16*e[1]),this._offsets.xBottomLeft=e[0],this._offsets.yBottomLeft=e[1],Object(o["s"])(e,a+s,l+r),Object(o["t"])(e,e,t),this._offsetBottomRight=Object(d["a"])(16*e[0],16*e[1]),this._offsets.xBottomRight=e[0],this._offsets.yBottomRight=e[1]}_getPos(t,e){return Object(d["a"])(Math.round(_*t),Math.round(_*e))}}}}]); //# sourceMappingURL=chunk-534c2194.98f6b761.js.map