(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5e7af38d"],{"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}},"046b":function(t,e,i){"use strict";i.d(e,"a",(function(){return O})),i.d(e,"b",(function(){return m})),i.d(e,"c",(function(){return v})),i.d(e,"d",(function(){return _})),i.d(e,"e",(function(){return y}));var s=i("1325"),r=i("f7be"),n=i("4856"),a=i("2eab"),o=i("7ffa"),h=i("e041"),c=i("5996"),l=i("4261"),u=i("28b1"),d=i("f976"),f=i("2edc");const p={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function _(t){const e=t.folders||[],i=e.slice(),s=new Map,r=new Map,n=new Map,a=new Map,h=new Map,c={esriGeometryPoint:r,esriGeometryPolyline:n,esriGeometryPolygon:a};(t.featureCollection&&t.featureCollection.layers||[]).forEach(t=>{const e=Object(o["a"])(t);e.featureSet.features=[];const i=t.featureSet.geometryType;s.set(i,e);const h=t.layerDefinition.objectIdField;"esriGeometryPoint"===i?x(r,h,t.featureSet.features):"esriGeometryPolyline"===i?x(n,h,t.featureSet.features):"esriGeometryPolygon"===i&&x(a,h,t.featureSet.features)}),t.groundOverlays&&t.groundOverlays.forEach(t=>{h.set(t.id,t)}),e.forEach(e=>{e.networkLinkIds.forEach(s=>{const r=b(s,e.id,t.networkLinks);r&&i.push(r)})}),i.forEach(t=>{if(t.featureInfos){t.points=Object(o["a"])(s.get("esriGeometryPoint")),t.polylines=Object(o["a"])(s.get("esriGeometryPolyline")),t.polygons=Object(o["a"])(s.get("esriGeometryPolygon")),t.mapImages=[];for(const e of t.featureInfos)switch(e.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const i=c[e.type].get(e.id);i&&t[p[e.type]].featureSet.features.push(i);break}case"GroundOverlay":{const i=h.get(e.id);i&&t.mapImages.push(i);break}}t.fullExtent=O([t])}});const l=O(i);return{folders:e,sublayers:i,extent:l}}function m(t,e,i,n){const o=r["b"]&&r["b"].findCredential(t);t=Object(h["e"])(t,{token:o&&o.token});const c=s["a"].kmlServiceUrl;return Object(a["default"])(c,{query:{url:t,model:"simple",folders:"",refresh:0!==i||void 0,outSR:JSON.stringify(e)},responseType:"json",signal:n})}function y(t,e,i=null,s=[]){const r=[],n={},a=e.sublayers,o=e.folders.map(t=>t.id);return a.forEach(e=>{const a=new t;if(i?a.read(e,i):a.read(e),s.length&&o.indexOf(a.id)>-1&&(a.visible=-1!==s.indexOf(a.id)),n[e.id]=a,null!=e.parentFolderId&&-1!==e.parentFolderId){const t=n[e.parentFolderId];t.sublayers||(t.sublayers=[]),t.sublayers.unshift(a)}else r.unshift(a)}),r}function x(t,e,i){i.forEach(i=>{t.set(i.attributes[e],i)})}function g(t,e){let i;return e.some(e=>e.id===t&&(i=e,!0)),i}function b(t,e,i){const s=g(t,i);return s&&(s.parentFolderId=e,s.networkLink=s),s}async function v(t){const e=f["default"].fromJSON(t.featureSet).features,i=t.layerDefinition,s=Object(d["a"])(i.drawingInfo.renderer),r=n["a"].fromJSON(t.popupInfo),a=[];for(const n of e){const t=await s.getSymbolAsync(n);n.symbol=t,n.popupTemplate=r,n.visible=!0,a.push(n)}return a}function O(t){const e=Object(l["h"])(l["a"]),i=Object(l["h"])(l["a"]);for(const s of t){if(s.polygons&&s.polygons.featureSet&&s.polygons.featureSet.features)for(const t of s.polygons.featureSet.features)Object(u["b"])(e,t.geometry),Object(l["m"])(i,e);if(s.polylines&&s.polylines.featureSet&&s.polylines.featureSet.features)for(const t of s.polylines.featureSet.features)Object(u["b"])(e,t.geometry),Object(l["m"])(i,e);if(s.points&&s.points.featureSet&&s.points.featureSet.features)for(const t of s.points.featureSet.features)Object(u["b"])(e,t.geometry),Object(l["m"])(i,e);if(s.mapImages)for(const t of s.mapImages)Object(u["b"])(e,t.extent),Object(l["m"])(i,e)}return Object(l["l"])(i,l["a"])?null:{xmin:i[0],ymin:i[1],zmin:i[2],xmax:i[3],ymax:i[4],zmax:i[5],spatialReference:c["a"].WGS84}}},"0c53":function(t,e,i){"use strict";i.d(e,"a",(function(){return h})),i.d(e,"b",(function(){return l}));var s=i("b2cd"),r=i("c120");const n=128e3;let a=null,o=null;async function h(){return a||(a=c()),a}async function c(){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 l(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"),c=i("b2b2"),l=i("a915"),u=i("a9a2"),d=i("8c81"),f=i("1d01"),p=i("d114"),_=i("6a2c"),m=i("6655"),y=(i("9812"),i("0c53")),x=i("8152"),g=i("3976"),b=i("2da5");function v(t,e,i,s,r,n,a){J=0;const o=(s-i)*n,h=r&&r.length,c=h?(r[0]-i)*n:o;let l,u,d,f,p,_=O(e,i,s,0,c,n,!0);if(_&&_.next!==_.prev){if(h&&(_=C(e,i,s,r,_,n)),o>80*n){l=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=T(h+e*n,t[h+e*n],t[h+1+e*n],o);return o&&N(o,o.next)&&(I(o),o=o.next),o}function j(t,e=t){if(!t)return t;let i,s=t;do{if(i=!1,s.steiner||!N(s,s.next)&&0!==z(s.prev,s,s.next))s=s.next;else{if(I(s),s=e=s.prev,s===s.next)break;i=!0}}while(i||s!==e);return e}function w(t,e,i,s,r,n,a,o){if(!t)return;!o&&n&&(t=L(t,s,r,n));let h=t;for(;t.prev!==t.next;){const c=t.prev,l=t.next;if(n?S(t,s,r,n):M(t))e.push(c.index/i+a),e.push(t.index/i+a),e.push(l.index/i+a),I(t),t=l.next,h=l.next;else if((t=l)===h){o?1===o?w(t=W(t,e,i,a),e,i,s,r,n,a,2):2===o&&q(t,e,i,s,r,n,a):w(j(t),e,i,s,r,n,a,1);break}}}function M(t){const e=t.prev,i=t,s=t.next;if(z(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)&&z(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function S(t,e,i,s){const r=t.prev,n=t,a=t.next;if(z(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,l=r.y>n.y?r.y>a.y?r.y:a.y:n.y>a.y?n.y:a.y,u=G(o,h,e,i,s),d=G(c,l,e,i,s);let f=t.prevZ,p=t.nextZ;for(;f&&f.z>=u&&p&&p.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)&&z(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==t.prev&&p!==t.next&&k(r.x,r.y,n.x,n.y,a.x,a.y,p.x,p.y)&&z(p.prev,p,p.next)>=0)return!1;p=p.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)&&z(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&k(r.x,r.y,n.x,n.y,a.x,a.y,p.x,p.y)&&z(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function T(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 I(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 R(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)&&V(i,t)&&(n=i,u=l)),i=i.next;return n}function L(t,e,i,s){for(let r;r!==t;r=r.next){if(r=r||t,null===r.z&&(r.z=G(r.x,r.y,e,i,s)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,L(t,e,i,s);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,P(t)}function P(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 z(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function A(t,e,i,s){return!!(N(t,e)&&N(i,s)||N(t,s)&&N(i,e))||z(t,e,i)>0!=z(t,e,s)>0&&z(i,s,t)>0!=z(i,s,e)>0}function B(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&&A(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function F(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 V(t,e){return z(t.prev,t,t.next)<0?z(t,e,t.next)>=0&&z(t,t.prev,e)>=0:z(t,e,t.prev)<0||z(t,t.next,e)<0}function G(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 N(t,e){return t.x===e.x&&t.y===e.y}function U(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;!N(n,a)&&A(n,r,r.next,a)&&V(n,a)&&V(a,n)&&(e.push(n.index/i+s),e.push(r.index/i+s),e.push(a.index/i+s),I(r),I(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&&K(o,t)){let h=H(o,t);return o=j(o,o.next),h=j(h,h.next),w(o,e,i,s,r,n,a,0),void w(h,e,i,s,r,n,a,0)}t=t.next}o=o.next}while(o!==t)}function K(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!B(t,e)&&V(t,e)&&V(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 H(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=J0))break;r+=a,c.push(o+e),e+=n}const l=a.length;v(a,i,o,o+e,c,2,n);const u=st(a,i,l,a.length,n),d=Math.abs(r);if(Math.abs((u-d)/Math.max(1e-7,d))>$)return a.length=0,!1;h=t,o+=e}return!0}function nt(t){const{coords:e,lengths:i}=t,{buffer:s}=Object(y["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(c["j"])(t))return null;if(!at(t,-128,d["P"]+128))return t;tt.setPixelMargin(e),tt.reset(g["a"].Polygon);let i=0;for(let a=0;ar||lr){a=!0;continue}e.push({x:c,y:l})}let u=!1;const d=h.length;for(let t=1;tr||lr){u=!0;break}e.push({x:c,y:l})}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 ct=i("ab39"),lt=i("c8dd"),ut=i("2629");const dt=8,ft=16,pt=65535,_t=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,c,l,u,d,f)=>{const _=Object(p["a"])(f,Math.ceil(ft*t._halfWidth)),m=Object(p["b"])(Math.round(ft*c),Math.round(ft*l),Math.round(ft*u),Math.round(ft*d)),y=Object(p["b"])(ft*o,ft*h,0,t._bitset),x=t.out;return x.vertexBounds(s,r,e,i),x.vertexWrite(Object(p["a"])(dt*s,dt*r)),x.vertexWrite(t.id),x.vertexWrite(t._fillColor),x.vertexWrite(m),x.vertexWrite(_),x.vertexWrite(t._tl),x.vertexWrite(t._br),x.vertexWrite(y),x.vertexWrite(Object(p["a"])(Math.ceil(ft*t._halfReferenceWidth),0)),x.vertexWrite(t.minMaxZoom),x.vertexEnd(),t.offset+t.vertexCount++},yt=(t,e,i)=>(s,r,n,a,o,h,c,l,u,d,f)=>{const _=Object(p["b"])(0,0,ft*t._halfWidth,ft*t._halfReferenceWidth),m=Object(p["b"])(ft*c+128,ft*l+128,ft*u+128,ft*d+128),y=t.out,x=t._bitset<<24|t.id;return y.vertexBounds(s,r,e,i),y.vertexWrite(Object(p["a"])(dt*s,dt*r)),y.vertexWrite(x),y.vertexWrite(t._fillColor),t.key.simple||(y.vertexWrite(0),y.vertexWrite(0)),y.vertexWrite(_),y.vertexWrite(m),t.key.simple||y.vertexWrite(t.minMaxZoom),y.vertexEnd(),t.offset+t.vertexCount++},xt=t=>(e,i,s)=>{const r=t.out;r.indexWrite(e),r.indexWrite(i),r.indexWrite(s),t.indexCount+=3};var gt=i("f75e");const bt=r["a"].getLogger("esri.views.2d.engine.webgl.WGLLineTemplate");class vt extends(_t(gt["a"])){constructor(t,e,i,s,r,n,a,o,c,l,u,f,m,y,x,g,b,v,O){super();const j=h["c"].load(t);e&&(j.sdf=e.sdf,j.pattern=!0,j.textureBinding=e.textureBinding),this._capType=s,this._joinType=r,this._miterLimitCosine=Object(_["d"])(n),this.tessellationProperties._fillColor=a,this.tessellationProperties._tl=o,this.tessellationProperties._br=c,this._hasPattern=l,this._isDashed=u,this._zOrder=g,this._effects=b,this._minMaxZoom=Object(p["a"])(Math.round(v*d["w"]),Math.round(O*d["w"])),this._materialKey=j.data;const w=(m?d["g"]:0)|(y?d["m"]:0)|(f?d["h"]:0);this.tessellationProperties._bitset=w,this.tessellationProperties._halfWidth=.5*i,this.tessellationProperties._halfReferenceWidth=.5*x,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===ct["d"].ROUND&&(a=ct["d"].SQUARE);const o=t.join,h=Object(l["g"])(t.width)*r,c=Object(l["g"])(t.referenceWidth),f=Object(l["g"])(t.miterLimit),m=s&&Object(u["c"])(s)||0,[y,x]=Object(_["e"])(t.scaleInfo,i),g=!1;if(!e)return new vt(t.materialKey,e,h,a,o,f,m,0,0,!1,n,t.scaleDash,t.colorLocked,g,c,t.zOrder,t.effects,y,x);const{rect:b,width:v,height:O}=e,j=b.x+d["A"],w=b.y+d["A"],M=j+v,S=w+O,T=Object(p["a"])(j,w),I=Object(p["a"])(M,S),R=!1;return new vt(t.materialKey,e,h,a,o,f,m,T,I,!0,n,t.scaleDash,t.colorLocked,R,c,t.zOrder,t.effects,y,x)}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(lt["i"])(t.cap||"round"),a=Object(lt["j"])(t.join||"round");let o=s&&"esriSLSNull"!==t.style&&Object(u["d"])(s)||0;"esriSLSNull"===t.style&&(o=0);const h=Object(l["g"])(t.width),c=t.miterLimit;if(!e)return new vt(t.materialKey,e,h,n,a,c,o,0,0,!1,r,!0,!1,i,h,0,null,_["b"],_["a"]);const{rect:f,width:m,height:y}=e,x=f.x+d["A"],g=f.y+d["A"],b=x+m,v=g+y,O=Object(p["a"])(x,g),j=Object(p["a"])(b,v);return new vt(t.materialKey,e,h,n,a,c,o,O,j,!0,r,!0,!1,i,h,0,null,_["b"],_["a"])}static fromPictureLineSymbol(t,e,i,s){return bt.error("PictureLineSymbol support does not exist!"),null}}const Ot=100,jt=1,wt=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(c["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(c["j"])(n))return;const a=[];if(!(n.maxLength>Ot)&&!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(p["a"])(jt*s,jt*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),c=r.dotDensity?4:10,l=t.vertexCount();t.vertexEnsureSize(c*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 Tt.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const c="function"==typeof h?h(a,i,s):h;if(o.has(c)){const t=o.get(c);return Promise.resolve(t)}const l=this._ongoingMaterialRequestMap.get(c);if(l)return l;const u=this._cimLayer,d=Object(Mt["a"])(u.cim,this._cimLayer.materialOverrides);d.mosaicHash=c;const{type:f,url:p}=u,_={cim:d,type:f,mosaicHash:c,url:p,size:null,dashTemplate:null,text:null,fontName:null};switch(f){case"marker":_.size=Object(St["d"])(u.size,a,i,s);break;case"line":_.dashTemplate=u.dashTemplate;break;case"text":_.text=Object(St["d"])(u.text,a,i,s),_.fontName=Object(St["d"])(u.fontName,a,i,s)}const m=t.getMosaicItem(_,r).then(t=>(n||(this._ongoingMaterialRequestMap.delete(c),o.set(c,t)),t)).catch(t=>(this._ongoingMaterialRequestMap.delete(c),Tt.error(".analyze()",t.message),null));return n||this._ongoingMaterialRequestMap.set(c,m),m}}var Rt=i("1aa6");const Ct=128;class Dt extends(wt(It)){constructor(t,e,i){var s;if(super(t),this._minMaxZoom=Object(p["a"])(Math.round(e*d["w"]),Math.round(i*d["w"])),Object(_["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(_["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(_["f"])(a)){const t=(t,e,i)=>{let s=Object(l["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(l["g"])(a||0)+Ct;t>255?t=255:t<0&&(t=0),this._offsetX=t}const o=t.offsetY;if(Object(_["f"])(o)){const t=(t,e,i)=>{let s=Object(l["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(l["g"])(-o||0)+Ct;t>255?t=255:t<0&&(t=0),this._offsetY=t}const m=t.scaleX;Object(_["f"])(m)?this._dynamicPropertyMap.set("_scaleX",m):this._scaleX=m||1;const y=t.angle;if(Object(_["f"])(y)){const t=(t,e,i)=>Object(f["d"])(y(t,e,i));this._dynamicPropertyMap.set("_angle",t)}else this._angle=Object(f["d"])(y)||0;if(Object(c["k"])(t.effects)){const e=t.effects;Object(_["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(_["e"])(t.scaleInfo,e);return new Dt(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(Rt["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 c=Math.round(Object(l["g"])(this._height));c>255?c=255:c<=0&&(c=o-n);let u=Math.round(Object(l["g"])(this._height/i*e||0));u>255?u=255:u<=0&&(u=a-s);const f=this._scaleX,_=1;this.tl=Object(p["a"])(s,n),this.br=Object(p["a"])(a,o),this.aux2=Object(p["b"])(u,c,this._offsetX,this._offsetY),this.aux3=Object(p["b"])(f,_,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 Et extends(_t(It)){constructor(t,e,i){super(t),this._minMaxZoom=Object(p["a"])(Math.round(e*d["w"]),Math.round(i*d["w"])),this._cimLineLayer=t;let s=0;Object(_["f"])(t.width)||(s=.5*Object(l["g"])(t.width));const r=(e,i,r)=>Object(_["f"])(t.width)?.5*Object(l["g"])(t.width(e,i,r)):s;this._dynamicPropertyMap.set("_halfWidth",r),Object(_["f"])(t.cap)?this._dynamicPropertyMap.set("_capType",t.cap):this._capType=t.cap,Object(_["f"])(t.join)?this._dynamicPropertyMap.set("_joinType",t.join):this._joinType=t.join;const n=t.color;if(Object(_["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(_["f"])(a)){const t=(t,e,i)=>Object(_["d"])(a(t,e,i));this._dynamicPropertyMap.set("_miterLimitCosine",t)}else this._miterLimitCosine=Object(_["d"])(a);if(Object(c["k"])(t.effects)){const e=t.effects;Object(_["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(_["e"])(t.scaleInfo,e);return new Et(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(Rt["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(p["a"])(s,r),this.tessellationProperties._br=Object(p["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 c=h["c"].load(this._materialKey);o&&(c.sdf=o.sdf,c.pattern=!0,c.textureBinding=o.textureBinding),this._materialKey=c.data}}var Lt=i("2c63"),Pt=i("738e"),zt=i("f93c");const At=Object(Pt["a"])(),Bt=Object(Lt["a"])(),Ft=r["a"].getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate");class kt extends(Object(zt["a"])(It)){constructor(t,e,i){super(t),this._cimMarkerLayer=t,this._minMaxZoom=Object(p["a"])(Math.round(e*d["w"]),Math.round(i*d["w"]));const s=t.color;if(Object(_["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(_["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(_["f"])(n)){const t=(t,e,i)=>Object(l["g"])(n(t,e,i));this._dynamicPropertyMap.set("_size",t)}else this._size=Object(l["g"])(n)||0;const a=t.scaleX;Object(_["f"])(a)?this._dynamicPropertyMap.set("_scaleX",a):this._scaleX=a||1;const o=t.offsetX;if(Object(_["f"])(o)){const t=(t,e,i)=>Object(l["g"])(o(t,e,i));this._dynamicPropertyMap.set("xOffset",t)}else this.xOffset=Object(l["g"])(o)||0;const h=t.offsetY;if(Object(_["f"])(h)){const t=(t,e,i)=>Object(l["g"])(h(t,e,i));this._dynamicPropertyMap.set("yOffset",t)}else this.yOffset=Object(l["g"])(h)||0;const f=t.outlineWidth;if(Object(_["f"])(f)){const t=(t,e,i)=>Object(l["g"])(f(t,e,i));this._dynamicPropertyMap.set("_outlineWidth",t)}else this._outlineWidth=Object(l["g"])(f)||0;const m=t.rotation;if(Object(_["f"])(m)?this._dynamicPropertyMap.set("_angle",m):this._angle=m||0,Object(c["k"])(t.effects)){const e=t.effects;Object(_["f"])(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}if(Object(c["k"])(t.markerPlacement)){const e=t.markerPlacement;Object(_["f"])(e)?this._dynamicPropertyMap.set("_markerPlacement",e):this._markerPlacement=e}this._scaleFactor=Object(c["u"])(t.scaleFactor,1),this._bitSet=(t.alignment===ct["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(_["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(Rt["a"])(o.spriteMosaicItem)||!o.spriteMosaicItem)return void Ft.error(new s["a"]("mapview-cim","Encountered an error when binding feature"));const c=o.spriteMosaicItem,u=this._cimMarkerLayer.sizeRatio,f=c.width/c.height*this._scaleX,_=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let m=this._size,y=m*f;const x=this.xOffset,g=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const b=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/Object(l["g"])(this._cimMarkerLayer.frameHeight):1,v=this._outlineWidth*b,O=Object(l["g"])(this._cimMarkerLayer.referenceSize);let j=0,w=0;const M=this._cimMarkerLayer.anchorPoint;M&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(j=-M.x/(this._size*f),w=M.y/this._size):(j=M.x,w=M.y)),this._sizeOutlineWidth=Object(p["b"])(Math.round(Math.min(Math.sqrt(128*y),255)),Math.round(Math.min(Math.sqrt(128*m),255)),Math.round(Math.min(Math.sqrt(128*v),255)),Math.round(Math.min(Math.sqrt(128*O),255))),this.angle=_;const S=Math.round(64*u);this._bitestAndDistRatio=Object(p["a"])(this._bitSet,S);const T=c.rect.x+d["A"],I=c.rect.y+d["A"],R=T+c.width,C=I+c.height;this._texUpperLeft=Object(p["a"])(T,I),this._texUpperRight=Object(p["a"])(R,I),this._texBottomLeft=Object(p["a"])(T,C),this._texBottomRight=Object(p["a"])(R,C);const D=h["d"].load(this._materialKey);D.sdf=c.sdf,D.pattern=!0,D.textureBinding=c.textureBinding,this._materialKey=D.data,this._anchorX=.5-(.5+j)*c.width/c.width,this._anchorY=.5-(.5+w)*c.height/c.height,y*=u,m*=u,y*=this._scaleFactor,m*=this._scaleFactor,y*=c.rect.width/c.width,m*=c.rect.height/c.height,this._computedWidth=y,this._computedHeight=m,this._applyTransformation(Bt,At),this.xOffset=x,this.yOffset=g}}var Vt=i("32dd"),Gt=i("44d1"),Nt=i("32b6");const Ut=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(Gt["a"])(It)){constructor(t,e,i){super(t),this._horizontalAlignment="center",this._verticalAlignment="middle",this._textToGlyphs=new Map,this._minMaxZoom=Object(p["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(_["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(_["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(_["f"])(t.size)||(a=Math.min(Math.round(Object(l["g"])(t.size*t.sizeRatio)),127));const o=(e,i,s)=>Object(_["f"])(t.size)?Math.min(Math.round(Object(l["g"])(t.size(e,i,s)*t.sizeRatio)),127):a;if(this._dynamicPropertyMap.set("_size",o),Object(_["f"])(t.outlineSize)){const e=(e,i,s)=>Math.min(Math.floor(Ut*Object(l["g"])(t.outlineSize(e,i,s)*t.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",e)}else this._haloSize=Math.min(Math.floor(Ut*Object(l["g"])(t.outlineSize*t.sizeRatio)),127);let f;Object(_["f"])(t.offsetX)||(f=Math.round(Object(l["g"])(t.offsetX*t.sizeRatio)));const m=(e,i,s)=>Object(_["f"])(t.offsetX)?Math.round(Object(l["g"])(t.offsetX(e,i,s)*t.sizeRatio)):f;let y;this._dynamicPropertyMap.set("_xOffset",m),Object(_["f"])(t.offsetY)||(y=Math.round(Object(l["g"])(t.offsetY*t.sizeRatio)));const x=(e,i,s)=>Object(_["f"])(t.offsetY)?Math.round(Object(l["g"])(t.offsetY(e,i,s)*t.sizeRatio)):y;if(this._dynamicPropertyMap.set("_yOffset",x),Object(_["f"])(t.angle)?this._dynamicPropertyMap.set("_angle",t.angle):this._angle=t.angle,Object(_["f"])(t.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",t.horizontalAlignment):this._horizontalAlignment=t.horizontalAlignment,Object(_["f"])(t.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",t.verticalAlignment):this._verticalAlignment=t.verticalAlignment,Object(c["k"])(t.effects)){const e=t.effects;Object(_["f"])(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}if(Object(c["k"])(t.markerPlacement)){const e=t.markerPlacement;Object(_["f"])(e)?this._dynamicPropertyMap.set("_markerPlacement",e):this._textPlacement=e}Object(_["f"])(t.text)?this._dynamicPropertyMap.set("_text",t.text):this._text=t.text,this._scaleFactor=s;const g=Math.min(Math.round(Object(l["g"])(t.referenceSize*t.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*g)),this._materialKey=t.materialKey;const b=h["f"].load(this._materialKey);b.sdf=!0,this._bitset=(t.alignment===ct["a"].MAP?1:0)|(t.colorLocked?1:0)<<1,this._materialKey=b.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(t,e){const[i,s]=Object(_["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(Nt["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(Vt["e"])(this._horizontalAlignment||"center"),this._yAlignD=Object(Vt["g"])(this._verticalAlignment||"baseline");const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}const Kt=128;class Zt extends(wt(gt["a"])){constructor(t,e,i,s,r,n,a,o,c,l,u,f,_,m,y,x){super(),this._effects=m;const g=h["a"].load(t);e&&(g.sdf=e.sdf,g.pattern=!0,g.textureBinding=e.textureBinding),this.fillColor=i,this.tl=s,this.br=r,this.aux2=Object(p["b"])(n,a,o,c),this.aux3=Object(p["b"])(l,u,f,0),this._bitset=_,this._minMaxZoom=Object(p["a"])(Math.round(y*d["w"]),Math.round(x*d["w"])),this._materialKey=g.data}static fromCIMFill(t,e,i){const s=t.color,r=s&&Object(u["c"])(s)||0,n=t.materialKey,[a,o]=Object(_["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:c,height:m}=e,y=t.scaleX||1,x=h.x+d["A"],g=h.y+d["A"],b=x+c,v=g+m,O=t.height,j=y*O;let w=Math.round(O);w>255?w=255:w<=0&&(w=v-g);let M=Math.round(j);M>255?M=255:M<=0&&(M=b-x);let S=Object(l["g"])(t.offsetX||0)+Kt;S>255&&(S=255);let T=Object(l["g"])(-t.offsetY||0)+Kt;T>255&&(T=255);const I=Object(p["a"])(x,g),R=Object(p["a"])(b,v);return new Zt(n,e,r,I,R,M,w,S,T,Kt,Kt,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"],c=t.y+d["A"],l=h+i,u=c+s,f=Object(p["a"])(h,c),m=Object(p["a"])(l,u);o=new Zt(a,e,r,f,m,i,s,0,0,Kt,Kt,0,n,null,_["b"],_["a"])}else o=new Zt(a,null,r,0,0,0,0,0,0,0,0,0,n,null,_["b"],_["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"],c=o+n,u=h+a,f=Object(p["a"])(o,h),m=Object(p["a"])(c,u);let y=Math.round(Object(l["g"])(t.width));y>255&&(y=255);let x=Math.round(Object(l["g"])(t.height));x>255&&(x=255);let g=Object(l["g"])(t.xoffset)+Kt;g>255&&(g=255);let b=Object(l["g"])(-t.yoffset)+Kt;b>255&&(b=255);const v=t.materialKey,O=i?d["g"]:0,j=new Zt(v,e,s,f,m,y,x,g,b,Kt*t.xscale,Kt*t.yscale,0,O,null,_["b"],_["a"]);return j._maybeAddLineTemplate(t),j}}var Ht=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 Qt(t,e,i){try{await t.acquire(),await e(i),t.release()}catch(s){throw t.release(),s}}var Jt=i("f47d");const $t=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&&ce(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)||$t.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()?Qt(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)||$t.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(Rt["a"])(e,$t)?Ht["a"].fromSimpleMarker(t,e):this._markerError}async _createPMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(Rt["a"])(e,$t)?Ht["a"].fromPictureMarker(t,e):this._markerError}async _createSFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(Rt["a"])(i,$t)?Zt.fromSimpleFill(t,i,e):this._fillError}async _createPFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(Rt["a"])(i,$t)?Zt.fromPictureFill(t,i,e):this._fillError}async _createSLS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(Rt["a"])(i,$t)?vt.fromSimpleLine(t,i):this._lineError}async _createLMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(Rt["a"])(e,$t)?Ht["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(Jt["a"])(t),Object(Nt["a"])(t.text));return Object(Rt["a"])(e,$t)?Yt["a"].fromCIMText(t,e,this._tileInfo):this._textError}async _createCIMFill(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Object(Jt["a"])(t));return Object(Rt["a"])(e,$t)?Zt.fromCIMFill(t,e,this._tileInfo):this._fillError}async _createCIMLine(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Object(Jt["a"])(t));return Object(Rt["a"])(e,$t)?vt.fromCIMLine(t,e,this._tileInfo):this._lineError}async _createCIMMarker(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Object(Jt["a"])(t));return Object(Rt["a"])(e,$t)?Ht["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=Et.fromCIMLine(t,this._tileInfo);break;case"fill":i=Dt.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 $t.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),t}}_createMeshTemplates(t,e,i){if(-1!==e.type.indexOf("3d"))return $t.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 ce=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 l})),i.d(e,"g",(function(){return c})),i.d(e,"h",(function(){return d}));const s=8388607,r=8388608,n=254,a=255,o=0,h=1,c=t=>(t&r)>>>23,l=t=>t&s,u=t=>c(t)===h?n:a;function d(t){return c(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 _})),i.d(e,"c",(function(){return x}));var s=i("b2b2"),r=i("8188"),n=i("d641"),a=i("7f83"),o=i("9786");const h=[0,0];function c(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:l(e.rings,t),hasM:e.hasM,hasZ:e.hasZ}:"paths"in e?{paths:l(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 l(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=c.bind(null,o["c"]),p=c.bind(null,o["g"]);function _(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):p(t);return e.spatialReference=i,e}return Object(r["r"])(n["a"],[t],e,i,null)[0]}class m{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(p)):h(Object(r["r"])(n["a"],e,i,s,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const y=new m;function x(t,e,i){return y.push(t,e,i)}},2629:function(t,e,i){"use strict";i.d(e,"a",(function(){return _}));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,c,l,l,-c,0,-1,s),f=this.writeVertex(n,a,0,0,c,l,-l,c,0,1,s);s+=u;const p=this.writeVertex(e,o,0,0,c,l,l,-c,0,-1,s),_=this.writeVertex(e,o,0,0,c,l,-l,c,0,1,s);this.writeTriangle(d,f,p),this.writeTriangle(f,p,_),n=e,a=o}}_tessellate(t,e){const i=t[0],r=t[t.length-1],a=n(i,r),_=a?3:2;if(t.length<_)return;const m=e.pixelCoordRatio,y=null!=e.capType?e.capType:s["d"].BUTT,x=null!=e.joinType?e.joinType:s["o"].MITER,g=null!=e.miterLimit?Math.min(e.miterLimit,4):2,b=null!=e.roundLimit?Math.min(e.roundLimit,1.05):1.05,v=null!=e.halfWidth?e.halfWidth:2,O=!!e.textured;let j,w,M=null,S=null;const T=this.prevNormal,I=this.nextNormal;let R=-1,C=-1;const D=this.joinNormal;let E,L;const P=this.textureNormalLeft,z=this.textureNormalRight,A=this.textureNormal;let B=-1,F=-1;const k=e.wrapDistance||65535;let V=e.initialDistance||0;const G=this.writeVertex,N=this.writeTriangle,U=function(t,e,i,s,r,n){const a=G(j,w,E,L,i,s,t,e,r,n,V);return B>=0&&F>=0&&a>=0&&N(B,F,a),B=F,F=a,a};a&&(M=t[t.length-2],I.x=r.x-M.x,I.y=r.y-M.y,C=u(I),I.x/=C,I.y/=C);let W=!1;for(let n=0;nk&&(W=!0)),W){const e=(k-V)/R;R=k-V,M={x:(1-e)*M.x+e*t[n].x,y:(1-e)*M.y+e*t[n].y},--n}else M=t[n];j=M.x,w=M.y;const e=n<=0&&!W,i=n===t.length-1;if(e||(V+=R),S=i?a?t[1]:null:t[n+1],S?(I.x=S.x-j,I.y=S.y-w,C=u(I),I.x/=C,I.y/=C):(I.x=void 0,I.y=void 0),!a){if(e){h(D,I),E=D.x,L=D.y,y===s["d"].SQUARE&&(U(-I.y-I.x,I.x-I.y,I.x,I.y,0,-1),U(I.y-I.x,-I.x-I.y,I.x,I.y,0,1)),y===s["d"].ROUND&&(U(-I.y-I.x,I.x-I.y,I.x,I.y,-1,-1),U(I.y-I.x,-I.x-I.y,I.x,I.y,-1,1)),y!==s["d"].ROUND&&y!==s["d"].BUTT||(U(-I.y,I.x,I.x,I.y,0,-1),U(I.y,-I.x,I.x,I.y,0,1));continue}if(i){o(D,T),E=D.x,L=D.y,y!==s["d"].ROUND&&y!==s["d"].BUTT||(U(T.y,-T.x,-T.x,-T.y,0,-1),U(-T.y,T.x,-T.x,-T.y,0,1)),y===s["d"].SQUARE&&(U(T.y-T.x,-T.x-T.y,-T.x,-T.y,0,-1),U(-T.y-T.x,T.x-T.y,-T.x,-T.y,0,1)),y===s["d"].ROUND&&(U(T.y-T.x,-T.x-T.y,-T.x,-T.y,1,-1),U(-T.y-T.x,T.x-T.y,-T.x,-T.y,1,1));continue}}let r,_,G=-d(T,I);if(Math.abs(G)<.01)f(T,I)>0?(D.x=T.x,D.y=T.y,G=1,r=Number.MAX_VALUE,_=!0):(h(D,I),G=1,r=1,_=!1);else{D.x=(T.x+I.x)/G,D.y=(T.y+I.y)/G,r=u(D);const t=(r-1)*v*m;_=r>4||t>R&&t>C}E=D.x,L=D.y;let N=x;switch(x){case s["o"].BEVEL:r<1.05&&(N=s["o"].MITER);break;case s["o"].ROUND:rg&&(N=s["o"].BEVEL)}switch(N){case s["o"].MITER:if(U(D.x,D.y,-T.x,-T.y,0,-1),U(-D.x,-D.y,-T.x,-T.y,0,1),i)break;if(O){const t=W?0:V;B=this.writeVertex(j,w,E,L,I.x,I.y,D.x,D.y,0,-1,t),F=this.writeVertex(j,w,E,L,I.x,I.y,-D.x,-D.y,0,1,t)}break;case s["o"].BEVEL:{const t=G<0;let e,s,r,n;if(t){const t=B;B=F,F=t,e=P,s=z}else e=z,s=P;if(_)r=t?h(this.innerPrev,T):o(this.innerPrev,T),n=t?o(this.innerNext,I):h(this.innerNext,I);else{const e=t?l(this.inner,D):c(this.inner,D);r=e,n=e}const a=t?o(this.bevelStart,T):h(this.bevelStart,T);U(r.x,r.y,-T.x,-T.y,e.x,e.y);const u=U(a.x,a.y,-T.x,-T.y,s.x,s.y);if(i)break;const d=t?h(this.bevelEnd,I):o(this.bevelEnd,I);if(_){const t=this.writeVertex(j,w,E,L,-T.x,-T.y,0,0,0,0,V);B=this.writeVertex(j,w,E,L,I.x,I.y,n.x,n.y,e.x,e.y,V),F=this.writeVertex(j,w,E,L,I.x,I.y,d.x,d.y,s.x,s.y,V),this.writeTriangle(u,t,F)}else{if(O){const t=this.bevelMiddle;t.x=(a.x+d.x)/2,t.y=(a.y+d.y)/2,p(A,t,-T.x,-T.y),U(t.x,t.y,-T.x,-T.y,A.x,A.y),p(A,t,I.x,I.y),B=this.writeVertex(j,w,E,L,I.x,I.y,t.x,t.y,A.x,A.y,V),F=this.writeVertex(j,w,E,L,I.x,I.y,n.x,n.y,e.x,e.y,V)}else{const t=B;B=F,F=t}U(d.x,d.y,I.x,I.y,s.x,s.y)}if(t){const t=B;B=F,F=t}break}case s["o"].ROUND:{const t=G<0;let e,s;if(t){const t=B;B=F,F=t,e=P,s=z}else e=z,s=P;const n=t?l(this.inner,D):c(this.inner,D);let a,u;_?(a=t?h(this.innerPrev,T):o(this.innerPrev,T),u=t?o(this.innerNext,I):h(this.innerNext,I)):(a=n,u=n);const d=t?o(this.roundStart,T):h(this.roundStart,T),m=t?h(this.roundEnd,I):o(this.roundEnd,I),y=U(a.x,a.y,-T.x,-T.y,e.x,e.y),x=U(d.x,d.y,-T.x,-T.y,s.x,s.y);if(i)break;const g=this.writeVertex(j,w,E,L,-T.x,-T.y,0,0,0,0,V);_||this.writeTriangle(B,F,g);const b=l(this.outer,n),v=this.writeVertex(j,w,E,L,I.x,I.y,m.x,m.y,s.x,s.y,V);let M,S;const R=r>2;if(R){let e;r!==Number.MAX_VALUE?(b.x/=r,b.y/=r,e=f(T,b),e=(r*(e*e-1)+1)/e):e=-1,M=t?o(this.startBreak,T):h(this.startBreak,T),M.x+=T.x*e,M.y+=T.y*e,S=t?h(this.endBreak,I):o(this.endBreak,I),S.x+=I.x*e,S.y+=I.y*e}p(A,b,-T.x,-T.y);const C=this.writeVertex(j,w,E,L,-T.x,-T.y,b.x,b.y,A.x,A.y,V);p(A,b,I.x,I.y);const k=O?this.writeVertex(j,w,E,L,I.x,I.y,b.x,b.y,A.x,A.y,V):C,N=g,W=O?this.writeVertex(j,w,E,L,I.x,I.y,0,0,0,0,V):g;let q=-1,K=-1;if(R&&(p(A,M,-T.x,-T.y),q=this.writeVertex(j,w,E,L,-T.x,-T.y,M.x,M.y,A.x,A.y,V),p(A,S,I.x,I.y),K=this.writeVertex(j,w,E,L,I.x,I.y,S.x,S.y,A.x,A.y,V)),O?R?(this.writeTriangle(N,x,q),this.writeTriangle(N,q,C),this.writeTriangle(W,k,K),this.writeTriangle(W,K,v)):(this.writeTriangle(N,x,C),this.writeTriangle(W,k,v)):R?(this.writeTriangle(g,x,q),this.writeTriangle(g,q,K),this.writeTriangle(g,K,v)):(this.writeTriangle(g,x,C),this.writeTriangle(g,k,v)),_?(B=this.writeVertex(j,w,E,L,I.x,I.y,u.x,u.y,e.x,e.y,V),F=v):(B=O?this.writeVertex(j,w,E,L,I.x,I.y,u.x,u.y,e.x,e.y,V):y,this.writeTriangle(B,W,v),F=v),t){const t=B;B=F,F=t}break}}}}}},2779:function(t,e,i){"use strict";i.d(e,"a",(function(){return U}));i("c120");var s=i("b2b2"),r=i("f4cc"),n=i("0c53"),a=i("175e"),o=i("ce50"),h=i("e92d"),c=i("38a4"),l=i("a915"),u=i("ab39"),d=i("32dd"),f=i("a9a2"),p=i("8c81"),_=i("c84e"),m=i("d114"),y=i("18c6"),x=i("6a2c");function g(t,e){return t[e+1]}function b(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 w(t,e,i,s=!0){const r=v(t),n=j.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),c=a-h*e;n.seek(c);for(let l=-h;l<=h;l++)n.x<512&&n.x>=0&&n.y<512&&n.y>=0&&i(n.clone(),l,a+l*e,r),n.seek(e)}function M(t,e){const i=e;for(let s=0;s=0&&!(r[s+1]r[u]+l);a++){const s=l-r[a-1]+r[u],c=r[a]-r[a-1],d=r[a]-r[u]I.error(new o["a"](e,t)),C=1,D=0,E=4;function L(t,e){const i=!!t.minScale&&e.scaleToZoom(t.minScale)||0;return Object(c["f"])(i,0,25.5)}function P(t,e){const i=!!t.maxScale&&e.scaleToZoom(t.maxScale)||255;return Object(c["f"])(i,0,25.5)}function z(t){const e=new Map;return i=>(e.has(i)||e.set(i,t(i)),e.get(i))}const A=z(t=>{let e=0;if(0===t)return 1/0;for(;!(t%2);)e++,t/=2;return e}),B=t=>Math.floor(127*t+127),F=t=>Math.floor(10*t),k=t=>Math.round(t*(254/360));class V extends T["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=_["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=L(e,s),h=P(e,s),c=e.labelPlacement,[m,x]=Object(d["c"])(c);this._xAlignD=m,this._yAlignD=x,this._minZoom=o,this._maxZoom=h,this._refPlacementPadding=Object(l["g"])(i.haloSize)+p["N"],this._repeatLabelDistance=e.repeatLabelDistance?Object(l["g"])(e.repeatLabelDistance):128;const g=y["b"].load(t);g.sdf=!0,this._materialKey=g.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 V(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(m["b"])(0,0,B(e),B(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*E;this._refSymbolAndPlacementOffset=Object(m["b"])(n,r,B(e),B(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:R("mapview-labeling",`Geometry of type ${e.geometryType} is not supported`)}}_isVisible(t,e){const i=F(this.current.zoomLevel);return F(t)<=i&&i<=F(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+D}_placeForward(t,e,i,s,r){const n=t.clone();let a=t.remainingLength+D;for(;n.next()&&!(a>=s);)this._placeOnSegment(n,e,a,i,1,r),a+=n.length+D}_placeFirst(t,e,i,s=!1){const r=t,n=this.current.inShaping,a=n.glyphs,o=this.current.zoomLevel,{out:h,inId:c}=this.current;for(const l of a){const a=l.x>n.bounds.x?i:1-i,u=a*t.remainingLength+(1-a)*t.backwardLength,d=Math.abs(l.x+l.width/2-n.bounds.x),f=Math.max(0,o+Math.log2(d/(u+D))),p=Math.max(e,s?0:f);if(l.maxZoom=25,l.angle=t.angle+(1-i)*Math.PI,l.minZoom=p,this._writeGlyph(h,c,r.x,r.y,l),i&&this._isVisible(l.minZoom,l.maxZoom)){const t=l.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,c=this.current.inShaping,l=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 p of a){const a=p.x>c.bounds.x?n:1-n;if(!(a&&1===r||!a&&-1===r))continue;const u=Math.abs(p.x+p.width/2-c.bounds.x),d=Math.max(0,l+Math.log2(u/i)-.1),_=Math.max(s,l+Math.log2(u/(i+t.length+D)));if(0!==d&&(p.angle=t.angle+(1-n)*Math.PI,p.minZoom=_,p.maxZoom=d,this._writeGlyph(o,h,f.x,f.y,p),n&&this._isVisible(p.minZoom,p.maxZoom))){const i=p.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 l of s.glyphs)l.minZoom=r,l.maxZoom=this._maxZoom,this._writeGlyph(t,e,n,a,l);const o=this._refPlacementDirX,h=this._refPlacementDirY,c=s.boundsT;t.metricStart(e,r,n,a,o,h,this._referenceSize,this._materialKey),t.metricBoxWrite(c.center[0],c.center[1],c.width,c.height),t.metricEnd()}_writeVertexCommon(t,e,i,s){const r=this._color,n=this._haloColor,a=Object(m["b"])(0,0,this._size,this._haloSize),o=Math.max(s.minZoom,this._minZoom),h=Math.min(s.maxZoom,this._maxZoom),c=Object(m["b"])(F(o),F(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(c)}}var G=i("a8b5"),N=i("0f0f2");class U{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=V.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=V.fromLabelClass(t,e);i.set(t.index,s)}}return i}get templates(){return this._templateStore}async analyze(t,e,i,n,o,h,c){if(Object(r["n"])(c))return;let l;"dictionary"===i.type&&(l=await i.analyze(this._idField,t.copy(),e,o,h,c));let u=0;for(;t.next();){let e;if(e=l?l[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(N["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(c)}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(N["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(N["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(),c=e.getDisplayId(),l=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!=c&&l){if(Object(N["b"])(h))for(const t of l)t.bindFeature(e,i,r);for(const i of l)i.write(t,e,n,o);if(Object(s["k"])(a)&&t.hasRecords){const i=a&&this._findLabelRef(l);this._writeLabels(t,e,a,i,n,o)}t.featureEnd()}}_findLabelRef(t){for(const e of t)if(e instanceof G["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,c=this._labelTemplates.get(h);c.setZoomLevel(n),c.bindReferenceTemplate(r),c.bindTextInfo(i,s),c.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"),c=i("e4b1");class l{acquire(t){return{refCount:1,version:-1,labelMat2d:Object(n["b"])(),tileMat3:Object(n["b"])(),dvs:Object(n["b"])()}}release(t){}}class u extends c["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,c]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.width/this.rangeX*i,u=this.height/this.rangeY*i;Object(r["o"])(n,l,0,0,0,u,0,h,c,1),Object(r["l"])(this.transforms.dvs,t.displayViewMat3,n);const d=this.transforms.labelMat2d,f=t.getScreenTransform(d,e),p=Object(o["a"])();Object(a["t"])(p,[this.x,this.y],f),Object(s["a"])(d,p),Object(s["f"])(d,t.viewMat2d,d)}_createTransforms(){return u.TransformCache.acquire(this.key.hash)}}u.TransformCache=new l},"2d39":function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i("3b1a"),r=i("c84e"),n=i("9a02");class a extends n["a"]{get requiresDedicatedFBO(){return this.children.some(t=>"additive"===t.blendFunction)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"bitmap",brushes:[s["a"].bitmap],target:()=>this.children,drawPhase:r["c"].MAP});return[...super.prepareRenderPasses(t),e]}}},"2da5":function(t,e,i){"use strict";i.d(e,"a",(function(){return c})),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,c,l,u,d,f,p;if(i)this._prevIsIn?this._lineTo(t,e,!0):(a=this._prevPt,h=s,c=this._intersect(h,a),this.start=this._dist+r*(1-this._r),this._lineTo(c.x,c.y,!0),this._lineTo(h.x,h.y,!0));else if(this._prevIsIn)h=this._prevPt,a=s,c=this._intersect(h,a),this._lineTo(c.x,c.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(l,this.xmin,p))),(t.xthis.xmax||t.x>this.xmax&&e.x=this.ymax?d=!0:i.push(new o(l,this.xmax,p))),(t.ythis.ymin||t.y>this.ymin&&e.y=this.xmax?u=!0:i.push(new o(l,f,this.ymin))),(t.ythis.ymax||t.y>this.ymax&&e.y=this.xmax?u=!0:i.push(new o(l,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&&l.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 c{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 l{static simplify(t,e,i){if(!i)return;const r=-e,n=t+e,a=-e,o=t+e,h=[],c=[],u=i.length;for(let l=0;le.y?(h.push(l),h.push(i),h.push(s.sideLeft),h.push(-1)):(c.push(l),c.push(i),c.push(s.sideLeft),c.push(-1))),u.x>=n&&(u.y=o&&(u.x>e.x?(h.push(l),h.push(i),h.push(s.sideBottom),h.push(-1)):(c.push(l),c.push(i),c.push(s.sideBottom),c.push(-1)))),u=e}if(0===h.length||0===c.length)return;l.fillParent(i,c,h),l.fillParent(i,h,c);const d=[];l.calcDeltas(d,c,h),l.calcDeltas(d,h,c),l.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),l.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=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"),c=i("d114"),l=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(c["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),c=a["a"].getPlacement(i,h,Object(r["g"])(1),o.geometryEngine);if(!c)return;let l=c.next();for(;null!=l;){const i=-l.getAngle();n.setRotation(i);const s=l.tx,r=-l.ty;s<0||s>=512||r<0||r>=512||(this._writeGlyphs(t,e,{x:s,y:r},n),n.setRotation(-i)),l=c.next()}}_writeGlyphs(t,e,i,s){const r=l["e"].load(this._materialKey),n=Object(c["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 c of s.glyphs)r.textureBinding=c.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,c),t.recordEnd()}_writeGlyph(t,e,i,s,r){const n=l["e"].load(this._materialKey),a=Object(c["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(c["b"])(0,0,this._referenceSize,this._bitset),o=Object(c["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 c=t&s["a"];return a(this._bounds,4*c+4,0),this._bounds[4*c]=r,this._bounds[4*c+1]=n,this._bounds[4*c+2]=o,this._bounds[4*c+3]=h,!0}}},"561f":function(t,e,i){"use strict";i.d(e,"a",(function(){return le}));var s=i("a4ee"),r=i("fc29"),n=i("f57e"),a=i("9096"),o=i("c120"),h=i("b2b2"),c=i("f4cc"),l=i("59b2"),u=(i("b50f"),i("cea0"),i("d386")),d=i("5996"),f=i("9180"),p=i("32ed"),_=i("a9ab"),m=i("28b1"),y=i("f547"),x=i("f70f"),g=i("7f83");function b(t){if(!t)return null;let e=null;const i=t.spatialReference,s=Object(g["e"])(i);if(!s)return"toJSON"in t?t.toJSON():t;const r=Object(g["p"])(i)?102100:4326,n=x["a"][r].maxX,a=x["a"][r].minX,o=x["a"][r].plus180Line,h=x["a"][r].minus180Line;let c;const l="toJSON"in t?t.toJSON():t;if(Object(_["f"])(l))c=j(l,n,a);else if(Object(_["e"])(l))l.points=l.points.map(t=>j(t,n,a)),c=l;else if(Object(_["d"])(l))c=O(l,s);else if(Object(_["g"])(l)||Object(_["h"])(l)){const t=R;Object(m["a"])(t,l);const i={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},s=Object(x["d"])(i.xmin,a)*(2*n),r=0===s?l:v(l,s);i.xmin+=s,i.xmax+=s,Object(y["b"])(i,o)&&i.xmax!==n||Object(y["b"])(i,h)&&i.xmin!==a?e=r:c=r}else c=l;return null!==e?(new I).cut(e,n):c}function v(t,e){const i=Object(x["b"])(t);for(const s of i)for(const t of s)t[0]+=e;return t}function O(t,e){if(!e)return t;const i=w(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 j(t,e,i){if(Array.isArray(t)){const s=t[0];if(s>e){const i=Object(x["d"])(s,e);t[0]=s+i*(-2*e)}else if(se){const i=Object(x["d"])(s,e);t.x+=i*(-2*e)}else if(s0;if(n>2*l){const t={xmin:af||_?i.push({extent:{xmin:u,ymin:s,xmax:l,ymax:r},frameIds:[d]},{extent:{xmin:c,ymin:s,xmax:f,ymax:r},frameIds:[p]}):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 I{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 R=Object(f["l"])();var C=i("1ec3"),D=i("793f"),E=i("a6c1"),L=i("8c81");const P=-1;class z{constructor(){this._dirties=[{vertexFrom:P,vertexCount:P,indexFrom:P,indexCount:P,allDirty:!1},{vertexFrom:P,vertexCount:P,indexFrom:P,indexCount:P,allDirty:!1},{vertexFrom:P,vertexCount:P,indexFrom:P,indexCount:P,allDirty:!1},{vertexFrom:P,vertexCount:P,indexFrom:P,indexCount:P,allDirty:!1},{vertexFrom:P,vertexCount:P,indexFrom:P,indexCount:P,allDirty:!1}]}hasDirty(){return this._dirties.some(t=>t.indexCount!==P||t.allDirty)}markAllClean(){for(const t of this._dirties)t.indexFrom=P,t.indexCount=P,t.vertexFrom=P,t.vertexCount=P,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},c=!0),(a||s!==P&&i>0)&&(h={count:i,from:s,allDirty:a},c=!0),c&&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!==P){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!==P){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 A{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 B{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 A(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;B._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;B._fuse(r,s),B._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;B._fuse(i,r),B._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 F=i("c8dd");const k=["FILL","LINE","MARKER","TEXT","LABEL"];function V(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,c,l,u=!0;if(void 0===t.indexFrom?(h=r,l=e.indexCount,c=this._allocateIndices(n,l)):e.indexCount>t.indexCount?(h=this._displayList.removeFromList(t),this._freeIndices(n,t.indexFrom,t.indexCount),l=e.indexCount,c=this._allocateIndices(n,l)):e.indexCount===t.indexCount?(u=!1,c=t.indexFrom,l=t.indexCount):(h=this._displayList.removeFromList(t),this._freeIndices(n,t.indexFrom+e.indexCount,t.indexCount-e.indexCount),c=t.indexFrom,l=e.indexCount),-1!==a&&-1!==c){const r=this._storageFor(n);if(Object(F["e"])(a,c,r.vertexBuffers,r.indexBuffer,e,i,s),t.vertexFrom=a,t.indexFrom=c,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!==c&&this._freeIndices(n,c,l),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(F["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>G?-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>G?-1:s}_storageFor(t){return this._freeListsAndStorage[t]}_stridesFor(t,e){return this._strides[t][e]}}var U=i("7ce4"),W=i("d17d"),q=i("0fa6");class K{constructor(t){this.geometryMap=Object(F["f"])(()=>({indexBuffer:U["a"].createIndex(t,W["D"].STATIC_DRAW),vao:null}),(e,i)=>({vertexBuffer:U["a"].createVertex(t,F["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 H 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 z}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 z,this._dispRecStore=N.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 K(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=N.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(F["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 lt(e),s={id:e};return i.displayRecords=ct(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,c=s.get(i),l=new ot(i,e,r);l.indexFrom=n,l.indexCount=a,l.vertexFrom=o,l.vertexCount=h,c.displayRecords.push(l)}i[e]=_t.fromVertexData(r,e)}else i[e]=new xt(e,0,{fill:"default"}).intoBuffers()}),Mt.fromMeshData({displayObjects:e,vertexBuffersMap:i})}static fromMeshData(t){const e=new Mt,i=new dt,s=new Q;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 Q,o=wt(e);for(let h=0;h!!t.geometry);for(const r of s){const t=Object(_["c"])(r.geometry);Object(Lt["e"])(i,[r],t,!1,!1,"uid")}return new At(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 At(this.instance,this._features);return this.copyInto(t),t}}var Bt=i("a915"),Ft=i("901f"),kt=i("a8d5"),Vt=i("5ee9"),Gt=i("57e5"),Nt=i("008c"),Ut=i("8152"),Wt=i("334f");const qt=new Ut["a"],Kt=new Ut["a"],Zt="esriGeometryPolyline";function Ht(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(_["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(Gt["b"])(t.geometry);return Object(Nt["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(_["g"])(r)){const e=r.rings;if(1===e.length&&2===e[0].length)return Object(Nt["a"])(t,{paths:[[e[0][0],e[0][1]]]})}else{if(Object(_["h"])(r))return Ht(qt),Ht(Kt),Object(Lt["i"])(qt,r),Object(Lt["r"])(Kt,qt,r.hasZ,r.hasM,Zt,t.scale[0]),Object(Lt["v"])(qt,Kt,r.hasZ,r.hasM,Zt,t),Object(Lt["p"])(qt,r.hasZ,r.hasM);if(Object(_["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(x["c"])(i),h=o-a,c=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===c.length?{points:c}:Object(Nt["a"])(t,{points:c})}}return Object(Nt["a"])(t,this.geometry)}}Yt._pool=[],Yt._set=new Set;const Xt={minX:0,minY:0,maxX:0,maxY:0},Qt=Object(f["l"])(),Jt=1e-5;function $t(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(Ft["a"])(9,te),this._itemByGraphic=new Map,this._inflatedSizeHelper=new D["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 Vt["c"](t)}hitTest(t,e,i,s,r){t=Object(kt["b"])(t,this._tileInfoView.spatialReference);const n=.5*s*window.devicePixelRatio*i;Qt[0]=t-n,Qt[1]=e-n,Qt[2]=t+n,Qt[3]=e+n;const a=.5*s*(i+Wt["a"]),o=$t(this._index,t-a,e-a,t+a,e+a);if(!o||0===o.length)return[];const h=[],c=Object(f["l"])(),l=Object(f["l"])();for(const p of o){const{geometry:t,symbolResource:e}=p;this._getSymbolBounds(c,e,t,l,r),l[3]=l[2]=l[1]=l[0]=0,Object(f["w"])(c,Qt)&&p.graphic.visible&&h.push(p)}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(Qt,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 l=1;lt.graphic.uid-e.graphic.uid),i.sort((t,e)=>t.uid-e.uid);let r,n=0,a=0;const o=e.resolution,h=[],c={originPosition:"upperLeft",scale:[o,o],translate:[e.bounds[0],e.bounds[3]]};for(const l 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 ce=class extends(Object(re["a"])(Object(a["b"])(r["a"]))){constructor(t){super(t),this._storage=new Et["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(Rt["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 Dt["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 It["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 Tt["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(c["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(c["v"])(this._controller.signal);const e=t.tile,i=this._getGraphicsData(this._templateStore,e,t.addedOrModified),s=await this._processGraphics(e,i);return Object(c["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(_["c"])(t.geometry),spatialReference:d["a"].fromJSON(t.geometry.spatialReference),fields:e}}_getSymbolForGraphic(t,e){return Object(c["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(D["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(c["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),c=Object(ae["createSymbolSchema"])(t,h);return n=Object(se["b"])(c,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(c["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(c["u"])(t),null)):null}async _projectAndNormalizeGeometry(t,e){if(Object(c["v"])(this._controller.signal),Object(h["j"])(t.geometry)||"mesh"===t.geometry.type)return null;let i=t.geometry;if(Object(_["g"])(i)){const t=i.rings;i.rings=t}else if(Object(_["h"])(i)){const t=i.paths;i.paths=t}else if(Object(_["d"])(i)){const s=await this._getSymbolForGraphic(t,e);Object(c["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=b(i),r=Object(C["b"])(s,i.spatialReference,this.view.spatialReference);return Object(p["a"])(r),r}_onTileUpdate(t){const e=Object(g["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(c["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(c["v"])(this._controller.signal),this._graphicIdToAbortController.delete(t.uid)}catch(s){if(this._graphicIdToAbortController.delete(t.uid),!Object(c["m"])(s))throw s}}_updateGraphic(t,e){Object(c["v"])(this._controller.signal);const i=this._projectAndNormalizeGeometry(t,e),s=this._getSymbolResources(t,e);return Promise.all([i,s]).then(([e,i])=>{Object(c["v"])(this._controller.signal),this._graphicStore.addOrModify(t,i,e)})}_addOrUpdateGraphic(t,e){Object(c["v"])(this._controller.signal);const i=this._projectAndNormalizeGeometry(t,e),s=this._getSymbolResources(t,e);return Promise.all([i,s]).then(([e,i])=>{Object(c["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 H(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(_["f"])(t.geometry)||Object(_["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(c["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?L["q"]:0))}_getGraphicsData(t,e,i){const s=this.view,r=Object(g["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(_["f"])(e.geometry)||Object(_["e"])(e.geometry))&&this._wrapPoints(e,t)}return n}_wrapPoints(t,e){const i=t.geometry;Object(_["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=At.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 St["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 lt(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,c=a.serialize(h);if(1!==c.length)return new Mt;const l=c[0].message;return Mt.fromVertexData(l,o)}_abortProcessingGraphic(t){this._graphicIdToAbortController.has(t)&&this._graphicIdToAbortController.get(t).abort()}_getNullSymbol(t){const e=t.geometry;return Object(_["h"])(e)?E["g"]:Object(_["g"])(e)||Object(_["d"])(e)?E["f"]:E["e"]}_flipUpdatingGraphics(){this._updatingGraphicsTimer&&clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=setTimeout(()=>{this._updatingGraphicsTimer=null,this.notifyChange("updating")},160),this.notifyChange("updating")}};Object(s["a"])([Object(l["b"])({constructOnly:!0})],ce.prototype,"requestUpdateCallback",void 0),Object(s["a"])([Object(l["b"])()],ce.prototype,"container",void 0),Object(s["a"])([Object(l["b"])({constructOnly:!0})],ce.prototype,"graphics",void 0),Object(s["a"])([Object(l["b"])()],ce.prototype,"updating",null),Object(s["a"])([Object(l["b"])()],ce.prototype,"view",void 0),Object(s["a"])([Object(l["b"])()],ce.prototype,"updateRequested",void 0),ce=Object(s["a"])([Object(u["a"])("esri.views.2d.layers.support.GraphicsView2D")],ce);const le=ce},"566d":function(t,e,i){"use strict";i.d(e,"a",(function(){return I}));var s=i("a4ee"),r=i("2c4f"),n=i("7d7d"),a=i("ce50"),o=i("477c"),h=i("59b2"),c=(i("b50f"),i("c120"),i("cea0"),i("d386")),l=i("00c0"),u=i("6a0ed");i("e92d"),i("2dd4");let d=class extends u["a"]{};d=Object(s["a"])([Object(c["a"])("esri.views.layers.support.ClipArea")],d);const f=d;var p;let _=p=class extends f{constructor(){super(...arguments),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new p({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}get version(){return(this._get("version")||0)+1}};Object(s["a"])([Object(h["b"])({type:[Number,String],json:{write:!0}})],_.prototype,"left",void 0),Object(s["a"])([Object(h["b"])({type:[Number,String],json:{write:!0}})],_.prototype,"right",void 0),Object(s["a"])([Object(h["b"])({type:[Number,String],json:{write:!0}})],_.prototype,"top",void 0),Object(s["a"])([Object(h["b"])({type:[Number,String],json:{write:!0}})],_.prototype,"bottom",void 0),Object(s["a"])([Object(h["b"])({readOnly:!0})],_.prototype,"version",null),_=p=Object(s["a"])([Object(c["a"])("esri.views.layers.support.ClipRect")],_);const m=_;i("e06a");var y,x=i("3760"),g=i("a9ab"),b=i("3af1"),v=i("1219");const O={base:x["a"],key:"type",typeMap:{extent:b["a"],polygon:v["a"]}};let j=y=class extends f{constructor(){super(...arguments),this.type="geometry",this.geometry=null}get version(){return(this._get("version")||0)+1}clone(){return new y({geometry:this.geometry.clone()})}};Object(s["a"])([Object(h["b"])({types:O,json:{read:g["a"],write:!0}})],j.prototype,"geometry",void 0),Object(s["a"])([Object(h["b"])({readOnly:!0})],j.prototype,"version",null),j=y=Object(s["a"])([Object(c["a"])("esri.views.layers.support.Geometry")],j);const w=j;let M=class extends f{constructor(){super(...arguments),this.type="path",this.path=[]}get version(){return(this._get("version")||0)+1}};Object(s["a"])([Object(h["b"])({type:[[[Number]]],json:{write:!0}})],M.prototype,"path",void 0),Object(s["a"])([Object(h["b"])({readOnly:!0})],M.prototype,"version",null),M=Object(s["a"])([Object(c["a"])("esri.views.layers.support.Path")],M);const S=M,T=r["a"].ofType({key:"type",base:f,typeMap:{rect:m,path:S,geometry:w}}),I=t=>{let e=class extends t{constructor(){super(...arguments),this.attached=!1,this.clips=new T,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1}initialize(){var t,e,i,s;const r=null==(t=null==(e=this.view)?void 0:e.spatialReferenceLocked)||t;(null==(i=this.view)?void 0:i.spatialReference)&&r&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new a["a"]("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new l["a"]),this.container.fadeTransitionEnabled=!0,this.container.opacity=0,this.container.clips=this.clips,this.handles.add([Object(o["e"])(()=>this.suspended,t=>{this.container&&(this.container.visible=!t),this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},o["d"]),Object(o["e"])(()=>{var t,e;return null!=(t=null==(e=this.layer)?void 0:e.opacity)?t:1},t=>{this.container&&(this.container.opacity=t)},o["d"]),Object(o["e"])(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",t=>{this.container&&(this.container.blendMode=t)},o["d"]),Object(o["e"])(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,t=>{this.container&&(this.container.effect=t)},o["d"]),Object(o["b"])(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)})]),null!=(s=this.view)&&s.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get spatialReferenceSupported(){var t;const e=null==(t=this.view)?void 0:t.spatialReference;return null==e||this.supportsSpatialReference(e)}get updating(){var t;return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!(null==(t=this.updatingHandles)||!t.updating))}get visibleAtCurrentScale(){return this.isVisibleAtScale(this.view.scale)}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.detach(),this.updateRequested=!1)}isVisibleAtScale(t){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!e)return!0;const{minScale:i,maxScale:s}=e;return(0===i||t<=i)&&(0===s||t>=s)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}processUpdate(t){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",t),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(t))):this.updateRequested=!1}hitTest(t,e){return Promise.resolve(null)}supportsSpatialReference(t){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const t=super.getSuspendInfo(),e=!this.spatialReferenceSupported,i=this.visibleAtCurrentScale;return e&&(t.spatialReferenceNotSupported=e),i&&(t.outsideScaleRange=i),t}};return Object(s["a"])([Object(h["b"])()],e.prototype,"attached",void 0),Object(s["a"])([Object(h["b"])({type:T,set(t){const e=Object(n["b"])(t,this._get("clips"),T);this._set("clips",e)}})],e.prototype,"clips",void 0),Object(s["a"])([Object(h["b"])()],e.prototype,"container",void 0),Object(s["a"])([Object(h["b"])()],e.prototype,"moving",void 0),Object(s["a"])([Object(h["b"])({readOnly:!0})],e.prototype,"spatialReferenceSupported",null),Object(s["a"])([Object(h["b"])({readOnly:!0})],e.prototype,"updateParameters",void 0),Object(s["a"])([Object(h["b"])()],e.prototype,"updateRequested",void 0),Object(s["a"])([Object(h["b"])()],e.prototype,"updating",null),Object(s["a"])([Object(h["b"])()],e.prototype,"view",void 0),Object(s["a"])([Object(h["b"])({readOnly:!0})],e.prototype,"visibleAtCurrentScale",null),e=Object(s["a"])([Object(c["a"])("esri.views.2d.layers.LayerView2D")],e),e}},"601e":function(t,e,i){"use strict";i.d(e,"a",(function(){return l}));var s=i("ce50"),r=i("e92d"),n=i("c24e"),a=i("82fa"),o=i("89cb"),h=i("f47d");const c=r["a"].getLogger("esri/views/2d/engine/webgl/util/Matcher");async function l(t,e,i,s){switch(t.type){case"simple":return u.fromBasicRenderer(t,e,i,s);case"map":return p.fromUVRenderer(t,e,i,s);case"interval":return f.fromCBRenderer(t,e,i,s);case"dictionary":return x.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=l(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,c=t.field,l=new f(c,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};l.add(a,n)}));const d=await Object(h["b"])(t.defaultSymbol,i,s);if(d){const t=await e.createTemplateGroup(d,u);l.setDefault(t)}return l}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 c=await Object(h["b"])(t.defaultSymbol,i,s);if(c){const t=await e.createTemplateGroup(c,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 _(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 m;async function y(){return m||(m=i.e("chunk-2d2304b7").then(i.bind(null,"ec58"))),m}class x 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")),y()]),o=new n(t.url,t.config,t.fieldMap);await o.fetchResources({spatialReference:s.spatialReference,fields:s.fields});const h=await _(t.scaleExpression,s);return new x(o,e,s,h,a,t.symbolOptions)}async _analyzeFeature(t,e,i,r,n){const a=t.readLegacyFeature(),o=this._scaleFn(a,i,r),l=this._attributeHash(a)+"-"+o,u=this._groupIdCache.get(l);if(u)return u;const d={...r,spatialReference:this._info.spatialReference,abortOptions:n,fields:this._info.fields},f=await this._loader.getSymbolAsync(a,d),p=this._schemaUtilsModule.createSymbolSchema(f,this._symbolOptions),_=Object(h["b"])(p,this._info,e,n).then(t=>{if("expanded-cim"!==t.type)return c.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(l,_,1),_}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 c}));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 c 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 T}));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 c(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 l=i("3de4");class u{constructor(t,e,i){this._start={index:0,vertex:0};const s=c(t,e,i),r=e/4;this.geometryType=t,this._records=new l["a"](Int32Array,s.recordBytes),this._indices=new l["a"](Uint32Array,s.indexBytes),this._vertices=new l["a"](Uint32Array,s.vertexBytes),this._metrics=new l["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),c=t._records.getValue(s+6),l=t._records.getValue(s+7),u=this._vertices.length,d=(t._start.vertex-this._vertices.length)/this._strideInt,f=this._indices.length,p=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(p),this._records.push(c),this._records.push(l)}}var d=i("a015");const f=1,p=2,_=4,m=8,y=16,x=32,g=64,b=128;function v(t){switch(t){case f:case m:case x:return-1;case p:case g:return 0;case _:case y:case b:return 1}}function O(t){switch(t){case f:case p:case _:return-1;case m:case y:return 0;case x:case g:case b:return 1}}const j=f|m|x,w=_|y|b,M=f|p|_,S=x|g|b;class T{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?j:w|j)|(e<0+s?S:e>=r["P"]-s?M:S|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 l})),i.d(e,"e",(function(){return u})),i.d(e,"f",(function(){return c})),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 c(t){return"function"==typeof t}function l(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 R}));var s=i("f4cc"),r=i("8ca7"),n=i("ce50"),a=i("c120"),o=i("e92d"),h=i("b2b2"),c=i("8c81"),l=i("175e"),u=i("c8dd"),d=i("97cb"),f=i("d17d"),p=i("d267"),_=i("a1ff");const m=o["a"].getLogger("esri.views.2d.engine.webgl.AttributeStoreView"),y=Object(d["b"])(d["a"],m);class x{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(l["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(l["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 p["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,c=(i-i%this.size)/this.size,l=o,d=this.size,f=c,p=o*this.size*a,_=(d+f*this.size)*a-p,y=Object(u["l"])(this.pixelType),x=new y(s,p*y.BYTES_PER_ELEMENT,_),g=this.size,b=f-l+1;if(b>this.size)return void m.error(new n["a"]("mapview-webgl","Out-of-bounds index when updating AttributeData"));r.updateData(0,0,l,g,b,x)}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 x(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,c["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 m.error(new n["a"]("mapview-webgl","Tried to update attribute data with a pending update"));const e=Object(s["g"])();return y("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=>{y("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,c["B"]),void(e&&(t.bindTexture(i,c["C"]),t.bindTexture(i,c["D"]),t.bindTexture(i,c["E"]),t.bindTexture(i,c["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[c["c"]],i,e=>e.getTexture(t)),c["B"]),e&&(t.bindTexture(Object(h["n"])(s[c["d"]],i,e=>e.getTexture(t)),c["H"]),t.bindTexture(Object(h["n"])(s[c["a"]],i,e=>e.getTexture(t)),c["C"]),t.bindTexture(Object(h["n"])(s[c["e"]],i,e=>e.getTexture(t)),c["D"]),t.bindTexture(Object(h["n"])(s[c["b"]],i,e=>e.getTexture(t)),c["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 _["a"](t,e,new Uint8Array(4))}return this._defaultTexture}}var b=i("6722"),v=i("9ef0"),O=i("a915"),j=i("8048"),w=i("9b40"),M=i("b2af");function S(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;T(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)}}},"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 p})),i.d(e,"b",(function(){return c}));var s=i("b2b2"),r=i("a915"),n=i("a9a2"),a=i("8c81"),o=i("c84e"),h=i("3484");function c(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 l(t){return{value:t.value,size:Object(r["j"])(t.size)}}function u(t){return t.map(t=>l(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 p(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=y(s);else if("opacity"===s.type)i.opacity=_(s);else if("rotation"===s.type){const t=s;i.rotation={type:t.rotationType}}return{vvFields:e,vvRanges:i}}function _(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 m(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 y(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,m(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,m(e.colors,t,i)}}for(let i=0;i<32;i+=4)Object(n["b"])(e.colors,i,!0);return e}},"894c":function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var s=i("b2b2");class r{constructor(t,e,i){this.pixelBlock=t,this.extent=e,this.originalPixelBlock=i}get width(){return Object(s["k"])(this.pixelBlock)?this.pixelBlock.width:0}get height(){return Object(s["k"])(this.pixelBlock)?this.pixelBlock.height:0}render(t){const e=this.pixelBlock;if(Object(s["j"])(e))return;const i=this.filter({pixelBlock:e});if(Object(s["j"])(i.pixelBlock))return;const r=i.pixelBlock.getAsRGBA(),n=t.createImageData(i.pixelBlock.width,i.pixelBlock.height);n.data.set(r),t.putImageData(n,0,0)}getRenderedRasterPixels(){const t=this.filter({pixelBlock:this.pixelBlock});return Object(s["j"])(t.pixelBlock)?null:{width:t.pixelBlock.width,height:t.pixelBlock.height,renderedRasterPixels:new Uint8Array(t.pixelBlock.getAsRGBA().buffer)}}}},"89e8":function(t,e,i){"use strict";i.d(e,"a",(function(){return _}));var s=i("f57e"),r=i("a915"),n=i("ab39"),a=i("32dd"),o=i("a9a2"),h=i("8c81"),c=i("d114"),l=i("18c6"),u=i("6a2c"),d=i("44d1"),f=i("f75e");const p=5;class _ extends(Object(d["a"])(f["a"])){constructor(t,e,i,s,o,u,d,f,_,m,y,x,g,b,v,O,j,w,M=!1,S,T){super(),this._xOffset=Object(r["g"])(g),this._yOffset=Object(r["g"])(b),this._decoration=m||"none",this._color=o,this._haloColor=u,this._haloSize=Math.min(Math.floor(p*Object(r["g"])(Object(r["j"])(i))),127),this._size=Math.min(Math.round(Object(r["g"])(e)),127);const I=Math.min(Math.round(Object(r["g"])(s||e)),127);this._referenceSize=Math.round(Math.sqrt(256*I)),this._scale=this._size/h["r"],this._angle=x,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=(_===n["a"].MAP?1:0)|(y?1:0)<<1;const R=l["e"].load(t);R.sdf=!0,this._materialKey=R.data,this._lineWidth=Object(r["g"])(v)||512,this._lineHeight=O||1,this._textPlacement=j,this._effects=w,this._isCIM=M,this._minMaxZoom=Object(c["a"])(Math.round(S*h["w"]),Math.round(T*h["w"]))}static fromText(t,e){const i=new _(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),c=new _(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),[,l]=Object(s["a"])(t.text);return c.bindTextInfo(e,l),c._vertexBoundsScale=t.maxVVSize?t.maxVVSize/n:1,c}}},"92f2":function(t,e,i){"use strict";i.d(e,"a",(function(){return x}));var s=i("6f2d"),r=i("1c92"),n=i("8c71"),a=i("738e"),o=i("47f8"),h=i("a8d5"),c=i("7c4b"),l=i("c8dd"),u=i("7ce4"),d=i("d17d"),f=i("0fa6");const p=Math.PI/180,_=4;class m extends c["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,y().attributes)}_updateMatricesAndLocalOrigin(t){const{state:e}=t,{displayMat3:i,size:s,resolution:n,pixelRatio:c,rotation:l,viewpoint:u}=e,d=p*l,{x:f,y:_}=u.targetGeometry,m=Object(h["b"])(f,e.spatialReference);this._localOrigin.x=m,this._localOrigin.y=_;const y=c*s[0],x=c*s[1],g=n*y,b=n*x,v=Object(r["b"])(this._dvsMat3);Object(r["l"])(v,v,i),Object(r["c"])(v,v,Object(a["b"])(y/2,x/2)),Object(r["d"])(v,v,Object(o["d"])(s[0]/g,-x/b,1)),Object(r["n"])(v,v,-d)}_updateBufferData(t,e){const{x:i,y:s}=this._localOrigin,r=2*_*e.length,n=new Float32Array(r),a=new Uint32Array(8*e.length);let o=0,h=0;for(const c of e)c&&(n[2*o+0]=c[0]-i,n[2*o+1]=c[1]-s,n[2*o+2]=c[0]-i,n[2*o+3]=c[3]-s,n[2*o+4]=c[2]-i,n[2*o+5]=c[3]-s,n[2*o+6]=c[2]-i,n[2*o+7]=c[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=y();this._vao=new f["a"](t,e.attributes,e.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer)}}}const y=()=>Object(l["g"])("bounds",{geometry:[{location:0,name:"a_position",count:2,type:d["k"].FLOAT}]});class x 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 m(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))}}},"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 I}));i("c120");var s=i("b2b2"),r=i("8c71"),n=i("3b1a"),a=i("00c0"),o=i("ce50"),h=i("e92d"),c=i("7c4b"),l=i("9812"),u=i("3349"),d=i("02f1"),f=i("6655"),p=i("8152"),_=i("d114"),m=i("7ce4"),y=i("d17d");const x=h["a"].getLogger("esri.views.2d.engine.webgl.Mesh2D"),g=t=>{switch(t.BYTES_PER_ELEMENT){case 1:return y["k"].UNSIGNED_BYTE;case 2:return y["k"].UNSIGNED_SHORT;case 4:return y["k"].UNSIGNED_INT;default:throw new o["a"]("Cannot get DataType of array")}},b=(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]:m["a"].createVertex(t,e,this.vertices[s])}),{})),this._cache.vertexBuffers}}var j=i("0fa6");const w=h["a"].getLogger("esri.views.2d.engine.webgl.ClippingInfo"),M=t=>parseFloat(t)/100;class S extends c["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 S(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 j["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,c=a;return{x:h,y:c,width:Math.max(i-n-h,0),height:Math.max(s-o-c,0)}}_createMesh(t,e){switch(e.type){case"rect":return O.fromRect(this._createScreenRect(t,e));case"path":return O.fromPath(e);case"geometry":return O.fromGeometry(t,e);default:return w.error(new o["a"]("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),O.fromRect({x:0,y:0,width:1,height:1})}}}var T=i("c84e");class I 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===T["c"].LABEL||n===T["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:T["c"].MAP|T["c"].LABEL|T["c"].LABEL_ALPHA|T["c"].DEBUG|T["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=>S.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}},a0ce:function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return I}));var s=i("a4ee"),r=i("f7be"),n=i("2eab"),a=i("2c4f"),o=i("af40"),h=i("b2b2"),c=i("477c"),l=i("e041"),u=i("59b2"),d=(i("b50f"),i("c120"),i("cea0"),i("d386")),f=i("3af1"),p=i("8188"),_=i("5996"),m=i("9786"),y=i("046b"),x=i("bb72"),g=i("f626"),b=i("c73a"),v=i("2d39"),O=i("566d"),j=i("ab4d"),w=i("561f"),M=i("365a");class S{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let T=class extends(Object(O["a"])(M["a"])){constructor(){super(...arguments),this._handles=new o["a"],this._bitmapIndex=new Map,this._mapImageContainer=new v["a"],this._kmlVisualData=new S,this.allVisiblePoints=new g["a"],this.allVisiblePolylines=new g["a"],this.allVisiblePolygons=new g["a"],this.allVisibleMapImages=new a["a"]}async hitTest(t,e){var i,s,r;return(await Promise.all([null==(i=this._pointsView)?void 0:i.hitTest(t),null==(s=this._polylinesView)?void 0:s.hitTest(t),null==(r=this._polygonsView)?void 0:r.hitTest(t)])).flat().filter(t=>!!t&&(t.layer=this.layer,t.sourceLayer=this.layer,!0))}update(t){this._polygonsView&&this._polygonsView.processUpdate(t),this._polylinesView&&this._polylinesView.processUpdate(t),this._pointsView&&this._pointsView.processUpdate(t)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new w["a"]({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new j["a"](this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new w["a"]({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new j["a"](this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new w["a"]({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new j["a"](this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.handles.add([this.allVisibleMapImages.on("change",t=>{t.added.forEach(t=>this._addMapImage(t)),t.removed.forEach(t=>this._removeMapImage(t))}),Object(c["e"])(()=>this.layer.visibleSublayers,t=>{for(const[e,i]of this._kmlVisualData.allSublayers)i.visibility=0;for(const e of t){const t=this._kmlVisualData.allSublayers.get(e.id);t&&(t.visibility=1)}this._refreshCollections()})]),this.updatingHandles.addPromise(this._fetchService(this._fetchController.signal))}detach(){this._fetchController.abort(),this._fetchController=null,this._handles.removeAll(),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView&&(this._polygonsView.destroy(),this._polygonsView=null),this._polylinesView&&(this._polylinesView.destroy(),this._polylinesView=null),this._pointsView&&(this._pointsView.destroy(),this._pointsView=null)}moveStart(){}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(t){(this.view.spatialReference.isWGS84||this.view.spatialReference.isWebMercator)&&Object(n["default"])(t.href,{responseType:"image"}).then(({data:e})=>{let i=f["a"].fromJSON(t.extent);Object(m["a"])(i,this.view.spatialReference)&&(i=Object(m["d"])(i,this.view.spatialReference));const s=new b["a"](e,"standard");s.x=i.xmin,s.y=i.ymax,s.resolution=i.width/e.naturalWidth,s.rotation=t.rotation,this._mapImageContainer.addChild(s),this._bitmapIndex.set(t,s)})}async _getViewDependentUrl(t,e){const{viewFormat:i,viewBoundScale:s,httpQuery:n}=t;if(Object(h["k"])(i)){if(Object(h["j"])(e))throw new Error("Loading this network link requires a view state.");let a;if(await Object(p["i"])(),Object(h["k"])(s)&&1!==s){const t=new f["a"](e.extent);t.expand(s),a=t}else a=e.extent;a=Object(p["m"])(a,_["a"].WGS84);const o=Object(p["m"])(a,_["a"].WebMercator),c=a.xmin,u=a.xmax,d=a.ymin,m=a.ymax,y=e.size[0]*e.pixelRatio,g=e.size[1]*e.pixelRatio,b=Math.max(o.width,o.height),v={"[bboxWest]":c.toString(),"[bboxEast]":u.toString(),"[bboxSouth]":d.toString(),"[bboxNorth]":m.toString(),"[lookatLon]":a.center.x.toString(),"[lookatLat]":a.center.y.toString(),"[lookatRange]":b.toString(),"[lookatTilt]":"0","[lookatHeading]":e.rotation.toString(),"[lookatTerrainLon]":a.center.x.toString(),"[lookatTerrainLat]":a.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":a.center.x.toString(),"[cameraLat]":a.center.y.toString(),"[cameraAlt]":b.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":y.toString(),"[vertPixels]":g.toString(),"[terrainEnabled]":"0","[clientVersion]":r["d"],"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},O=t=>{for(const e in t)for(const i in v)t[e]=t[e].replace(i,v[i])},j=Object(l["H"])(i);O(j);let w={};Object(h["k"])(n)&&(w=Object(l["H"])(n),O(w));const M=Object(x["c"])(t.href);return M.query={...M.query,...j,...w},`${M.path}?${Object(l["G"])(j)}`}return t.href}async _fetchService(t){const e=new S;await this._loadVisualData(this.layer.url,e,t),this._kmlVisualData=e,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(t=>this._isSublayerVisible(t.sublayerId)).map(({item:t})=>t)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(t=>this._isSublayerVisible(t.sublayerId)).map(({item:t})=>t)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(t=>this._isSublayerVisible(t.sublayerId)).map(({item:t})=>t)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(t=>this._isSublayerVisible(t.sublayerId)).map(({item:t})=>t))}_isSublayerVisible(t){const e=this._kmlVisualData.allSublayers.get(t);return!!e.visibility&&(-1===e.parentFolderId||this._isSublayerVisible(e.parentFolderId))}_loadVisualData(t,e,i){return this._fetchParsedKML(t,i).then(async t=>{for(const s of t.sublayers){e.allSublayers.set(s.id,s);const t=s.points?await Object(y["c"])(s.points):[],r=s.polylines?await Object(y["c"])(s.polylines):[],n=s.polygons?await Object(y["c"])(s.polygons):[],a=s.mapImages||[];if(e.allPoints.push(...t.map(t=>({item:t,sublayerId:s.id}))),e.allPolylines.push(...r.map(t=>({item:t,sublayerId:s.id}))),e.allPolygons.push(...n.map(t=>({item:t,sublayerId:s.id}))),e.allMapImages.push(...a.map(t=>({item:t,sublayerId:s.id}))),s.networkLink){const t=await this._getViewDependentUrl(s.networkLink,this.view.state);await this._loadVisualData(t,e,i)}}})}_fetchParsedKML(t,e){return Object(y["b"])(t,this.view.spatialReference,this.layer.refreshInterval,e).then(t=>Object(y["d"])(t.data))}_removeMapImage(t){const e=this._bitmapIndex.get(t);e&&(this._mapImageContainer.removeChild(e),this._bitmapIndex.delete(t))}};Object(s["a"])([Object(u["b"])()],T.prototype,"_pointsView",void 0),Object(s["a"])([Object(u["b"])()],T.prototype,"_polylinesView",void 0),Object(s["a"])([Object(u["b"])()],T.prototype,"_polygonsView",void 0),Object(s["a"])([Object(u["b"])()],T.prototype,"updating",void 0),T=Object(s["a"])([Object(d["a"])("esri.views.2d.layers.KMLLayerView2D")],T);const I=T},a8b5:function(t,e,i){"use strict";i.d(e,"a",(function(){return _}));var s=i("b2b2"),r=i("a915"),n=i("2c63"),a=i("738e"),o=i("ab39"),h=i("a9a2"),c=i("8c81"),l=i("d114"),u=i("18c6"),d=i("6a2c"),f=i("f93c"),p=i("f75e");class _ extends(Object(f["a"])(p["a"])){constructor(t,e,i,s,r,h,d,f,p,_,m,y,x,g,b,v,O,j,w,M,S,T,I){super(),this.angle=s,this.height=d,this.width=h,this.xOffset=e*w,this.yOffset=i*w,this._markerPlacement=M,this._effects=S,this._anchorX=.5-(.5+v)*b.width/b.width,this._anchorY=.5-(.5+O)*b.height/b.height,this._minMaxZoom=Object(l["a"])(Math.round(T*c["w"]),Math.round(I*c["w"]));const R=(g===o["a"].MAP?c["i"]:c["j"])|(m?c["g"]:0)|(x?c["k"]:0)|(y?c["l"]:0),C=b&&b.sdf,D=u["d"].load(t);D.sdf=C,D.pattern=!0,D.textureBinding=b.textureBinding,this._materialKey=D.data,this._fillColor=r,this._outlineColor=p,this._sizeOutlineWidth=Object(l["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*_),255)),Math.round(Math.min(Math.sqrt(128*f),255)));const E=b.rect.x+c["A"],L=b.rect.y+c["A"],P=E+b.width,z=L+b.height;this._offsets.xUpperLeft=E,this._offsets.yUpperLeft=L,this._offsets.xUpperRight=P,this._offsets.yUpperRight=L,this._offsets.xBottomLeft=E,this._offsets.yBottomLeft=z,this._offsets.xBottomRight=P,this._offsets.yBottomRight=z,this._texUpperLeft=Object(l["a"])(E,L),this._texUpperRight=Object(l["a"])(P,L),this._texBottomLeft=Object(l["a"])(E,z),this._texBottomRight=Object(l["a"])(P,z),h*=j,d*=j,h*=w,d*=w;const A=Math.round(64*j);this._bitestAndDistRatio=Object(l["a"])(R,A),this._computedWidth=h,this._computedHeight=d;const B=Object(a["a"])(),F=Object(n["a"])();this._applyTransformation(F,B)}static fromCIMMarker(t,e,i){const n=e&&e.width||1,a=e&&e.height||1,c=t.size,l=n/a*t.scaleX,u=t.scaleSymbolsProportionally&&t.frameHeight?c/t.frameHeight:1;let f=Object(h["c"])(t.color);const p=Object(h["c"])(t.outlineColor),m=Object(r["g"])(c),y=m*l,x=Object(r["g"])(t.offsetX||0),g=Object(r["g"])(t.offsetY||0),b=Object(r["g"])(t.outlineWidth||0)*u,v=t.alignment||o["a"].SCREEN,O=Object(r["g"])(t.referenceSize),[j,w]=Object(d["e"])(t.scaleInfo,i);e.sdf||0!==f||(f=-1);let M=t.rotation||0;t.rotateClockwise||(M=-M);let S=0,T=0;const I=t.anchorPoint;I&&(t.isAbsoluteAnchorPoint?c&&(S=-I.x/(c*l),T=I.y/c):(S=I.x,T=I.y));const R=new _(t.materialKey,x,g,M,f,y,m,O,p,b,t.colorLocked,t.scaleSymbolsProportionally,!1,v,e,S,T,t.sizeRatio,Object(s["u"])(t.scaleFactor,1),t.markerPlacement,t.effects,j,w);return R._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/y:1,R._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/m:1,R}static fromPictureMarker(t,e){const i=Math.round(Object(r["g"])(t.width)),s=Math.round(Object(r["g"])(t.height)),n=c["z"],a=Math.round(Object(r["g"])(t.xoffset||0)),h=Math.round(Object(r["g"])(t.yoffset||0)),l=new _(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 l._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.width:1,l._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.height:1,l}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)),c=Math.round(Object(r["g"])(t.yoffset||0)),l=t.style,u=t.outline,f=0|(u&&u.color&&Object(h["d"])(u.color)),p=0|(u&&u.width&&Math.round(Object(r["g"])(u.width))),m=new _(t.materialKey,a,c,t.angle,i,s,n,n,f,p,!1,!1,"esriSMSCross"===l||"esriSMSX"===l,o["a"].SCREEN,e,0,0,126/64,1,null,null,d["b"],d["a"]);return m.boundsType="esriSMSCircle"===l?"circle":"square",m._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.size:1,m._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.size:1,m}static fromLineSymbolMarker(t,e){const i=Object(h["d"])(t.color),s=6,n=Math.round(Object(r["g"])(s*t.lineWidth)),a=n,c="cross"===t.style||"x"===t.style;let l;switch(t.placement){case"begin-end":l=o["e"].Both;break;case"begin":l=o["e"].JustBegin;break;case"end":l=o["e"].JustEnd;break;default:l=o["e"].None}const u={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:l,offsetAlongLine:0},f=new _(t.materialKey,0,0,0,i,n,a,a/s,i,c?Math.round(Object(r["g"])(t.lineWidth)):0,!1,!1,c,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()}}},c73a:function(t,e,i){"use strict";i.d(e,"a",(function(){return _}));var s=i("b2b2"),r=i("1c92"),n=i("8c71"),a=i("738e"),o=i("7c4b"),h=i("894c"),c=i("d17d"),l=i("a1ff");function u(t){return t&&"render"in t}function d(t){return t&&!("render"in t)}function f(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,t.render(e.getContext("2d")),e}function p(t,e,i){const s={target:c["A"].TEXTURE_2D,pixelFormat:c["p"].RGBA,internalFormat:c["p"].RGBA,dataType:c["q"].UNSIGNED_BYTE,wrapMode:c["B"].CLAMP_TO_EDGE};return e&&i&&(s.width=e,s.height=i),new l["a"](t,s)}class _ extends o["a"]{constructor(t=null,e,i=!0){super(),this.requestRenderOnSourceChangedEnabled=i,this._textureInvalidated=!0,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.blendFunction=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null)}get isSourceScaled(){return this.width!==this.sourceWidth||this.height!==this.sourceHeight}get height(){return void 0!==this._height?this._height:this.sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){this._source=t,this.invalidateTexture()}get sourceHeight(){return this._source instanceof HTMLImageElement?this._source.naturalHeight:this._source.height}get sourceWidth(){return this._source instanceof HTMLImageElement?this._source.naturalWidth:this._source.width}get width(){return void 0!==this._width?this._width:this.sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t.context)}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRenderOnSourceChangedEnabled&&this.requestRender())}_createTransforms(){return{dvs:Object(n["b"])()}}setTransform(t){const e=Object(r["b"])(this.transforms.dvs),[i,s]=t.toScreenNoRotation([0,0],[this.x,this.y]),n=this.resolution/this.pixelRatio/t.resolution,o=n*this.width,h=n*this.height,c=Math.PI*this.rotation/180;Object(r["c"])(e,e,Object(a["b"])(i,s)),Object(r["c"])(e,e,Object(a["b"])(o/2,h/2)),Object(r["n"])(e,e,-c),Object(r["c"])(e,e,Object(a["b"])(-o/2,-h/2)),Object(r["j"])(e,e,Object(a["b"])(o,h)),Object(r["l"])(this.transforms.dvs,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}updateTexture(t){var e;if(!this.stage)return null==(e=this._texture)||e.dispose(),void(this._texture=null);if(!this._textureInvalidated)return;this._textureInvalidated=!1,this._texture||(this.source?this._texture=p(t,this.sourceWidth,this.sourceHeight):this._texture=p(t));const i=this.source;if(i){if(this._texture.resize(this.sourceWidth,this.sourceHeight),u(i))if(i instanceof h["a"]){const t=i.getRenderedRasterPixels();this._texture.setData(Object(s["k"])(t)?t.renderedRasterPixels:null)}else this._texture.setData(f(i));else d(i)&&this._texture.setData(i);this.ready()}else this._texture.setData(null)}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}}},d641:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));const s={convertToGEGeometry:r,exportPoint:a,exportPolygon:h,exportPolyline:l,exportMultipoint:d,exportExtent:p};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 c{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 l(t,e,i){return new c(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 p(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 O}));var s=i("ce50"),r=i("c120"),n=i("e92d"),a=i("38a4"),o=i("b2b2"),h=i("f4cc"),c=i("0f1c"),l=i("80b7"),u=i("8c81"),d=i("175e"),f=i("c8dd"),p=i("97cb"),_=i("8332"),m=i("d17d");const y=n["a"].getLogger("esri.views.layers.2d.features.support.AttributeStore"),x=Object(p["b"])(p["a"],y),g={sharedArrayBuffer:Object(r["a"])("esri-shared-array-buffer"),atomics:Object(r["a"])("esri-atomics")};function b(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(c["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),c=this._getBlock(h+u["e"]),l=t(e);if(this.config.supportsTextureFloat)c.setData(i,o,l);else if(l===u["x"])c.setData(i,o,255),c.setData(i,o+1,255);else{const t=Object(a["f"])(Math.round(l),-32767,32766)+32768,e=255&t,s=(65280&t)>>8;c.setData(i,o,e),c.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()):(y.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&&y.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=b(s,e=>Object(_["b"])(e,t.valueRepresentation)));const r=t=>null===t||isNaN(t)||t===1/0?u["x"]:t;this._attributeComputeMap.set(t.binding,b(s,r))}_createResources(){if(Object(o["k"])(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(u["a"]),this._getBlock(u["d"]),x("Initializing AttributeStore");const t={shared:g.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:y.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;x("Initializing AttributeBlock at index "+t);const i=g.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 y.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=c*t[2]-c*e[2];return 0===s&&i&&(s=t[4]-e[4]),s}),u.length){let t=6*u[0][2];l[0]=u[0][0]/t,l[1]=u[0][1]/t,i&&(t=6*u[0][4],l[2]=0!==t?u[0][3]/t:0),(l[0]d[1]||l[1]d[3]||i&&(l[2]d[5]))&&(l.length=0)}if(!l.length){const t=e.lengths[0]?o(p,0,f[0],i,n):null;if(!t)return null;l[0]=t[0],l[1]=t[1],i&&t.length>2&&(l[2]=t[2])}return t}function a(t,e,i,s,n,a,o=1){const h=r(n,a);let c=i,l=i+h,u=0,d=0,f=0,p=0,_=0;for(let r=0,y=s-1;rt[1]&&(t[1]=i),st[3]&&(t[3]=s),n&&(rt[5]&&(t[5]=r))}if(p*o>0&&(p*=-1),_*o>0&&(_*=-1),!p)return null;const m=[u,d,.5*p];return n&&(m[3]=f,m[4]=.5*_),m}function o(t,e,i,s,n){const a=r(s,n);let o=e,d=e+a,f=0,p=0,_=0,m=0;for(let r=0,y=i-1;r0?s?[p/f,_/f,m/f]:[p/f,_/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 c(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 l(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"),c=i("6655"),l=i("8152"),u=i("7de1"),d=i("a9ab");let f=0;const p=null!=(s=Object(a["a"])("featurelayer-simplify-thresholds"))?s:[.5,.5,.5,.5],_=p[0],m=p[1],y=p[2],x=p[3],g=null!=(r=Object(a["a"])("featurelayer-simplify-payload-size-factors"))?r:[1,2,4],b=g[0],v=g[1],O=g[2],j=null!=(n=Object(a["a"])("featurelayer-simplify-mobile-factor"))?n:2,w=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=w?j:1;e>4e6?i=O*s:e>1e6?i=v*s:e>5e5?i=b*s:e>1e5&&(i=s);let r=0;t>4e3?r=x*i:t>2e3?r=y*i:t>100?r=m:t>15&&(r=_);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(c["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 l["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 _}));var s=i("b2b2"),r=i("a915"),n=i("a29a"),a=i("2c63"),o=i("3349"),h=i("738e"),c=i("6655"),l=i("e416"),u=i("c84e"),d=i("d114");const f=3.14159265359/180,p=8,_=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(c["q"])(Object(c["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(),c=l["a"].getPlacement(o,Object(s["t"])(this._markerPlacement),Object(r["g"])(1),i.geometryEngine);if(!c)return;const u=e.getDisplayId(),d=Object(h["a"])(),p=Object(a["a"])(),_=-128,m=640;let y=c.next();for(;null!=y;){const e=y.tx,i=-y.ty;e>=_&&e<=m&&i>=_&&i<=m&&(this._applyTransformation(p,d,-y.getAngle()/f),this._writeVertices(t,u,this._getPos(e,i),e,i)),y=c.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,c=(this._anchorY-.5)*r;Object(o["s"])(e,a,c),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,c),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,c+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,c+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(p*t),Math.round(p*e))}}}}]); //# sourceMappingURL=chunk-5e7af38d.2fb20b0d.js.map