@arcgis/core 4.25.0-next.20220708 → 4.25.0-next.20220711

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/40d9c753be00b81d9e79.js +1 -0
  3. package/assets/esri/core/workers/chunks/{8cdeccb6b67098d6a8d7.js → 54b01d2a4aba08d7e16b.js} +1 -1
  4. package/assets/esri/core/workers/chunks/5db5afec37f69c4acaaf.js +1 -0
  5. package/assets/esri/core/workers/chunks/63922dadaa642a959164.js +1 -0
  6. package/assets/esri/core/workers/chunks/{35d46e4eeb43c256a63b.js → 8d6fb50fff035f21878b.js} +1 -1
  7. package/assets/esri/core/workers/chunks/937eed1e51055f730270.js +1 -0
  8. package/assets/esri/core/workers/chunks/9b802fcf571c91347da4.js +1 -0
  9. package/assets/esri/core/workers/chunks/b02a43cf767d8ee13313.js +1 -0
  10. package/assets/esri/core/workers/chunks/ba6c6957830b3f0c4ec8.js +1 -0
  11. package/assets/esri/core/workers/chunks/fc6423ca92289c739e19.js +1 -0
  12. package/interfaces.d.ts +8395 -6016
  13. package/layers/BaseElevationLayer.js +1 -1
  14. package/layers/BaseTileLayer.js +1 -1
  15. package/layers/support/ElevationQuery.js +1 -1
  16. package/layers/support/ExportImageServiceParameters.js +1 -1
  17. package/layers/support/Sublayer.js +1 -1
  18. package/layers/support/TileInfo.js +1 -1
  19. package/layers/support/TileKey.js +5 -0
  20. package/layers/support/TilemapCache.js +1 -1
  21. package/package.json +1 -1
  22. package/renderers/DotDensityRenderer.js +1 -1
  23. package/support/revision.js +1 -1
  24. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  25. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  26. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  27. package/views/3d/terrain/TerrainSurface.js +1 -1
  28. package/views/DOMContainer.js +1 -1
  29. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  30. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  31. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  32. package/views/interactive/snapping/snappingUtils.js +1 -1
  33. package/widgets/AreaMeasurement3D.js +1 -1
  34. package/widgets/Daylight.js +1 -1
  35. package/widgets/DirectLineMeasurement3D.js +1 -1
  36. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  37. package/widgets/ElevationProfile.js +1 -1
  38. package/widgets/Measurement.js +1 -1
  39. package/widgets/Popup.js +1 -1
  40. package/widgets/ShadowCast.js +1 -1
  41. package/widgets/Spinner.js +1 -1
  42. package/widgets/Weather.js +1 -1
  43. package/widgets/Widget.js +1 -1
  44. package/assets/esri/core/workers/chunks/009386ed70740f87a014.js +0 -1
  45. package/assets/esri/core/workers/chunks/1970d7a65832b70f7f5c.js +0 -1
  46. package/assets/esri/core/workers/chunks/4a364bc073fdc7c1b563.js +0 -1
  47. package/assets/esri/core/workers/chunks/4ca6ada7a4ccde5b5a24.js +0 -1
  48. package/assets/esri/core/workers/chunks/95451d6405729a9f50c7.js +0 -1
  49. package/assets/esri/core/workers/chunks/a9a459639c82c35ada1f.js +0 -1
  50. package/assets/esri/core/workers/chunks/beead2b06c994b4e61af.js +0 -1
  51. package/assets/esri/core/workers/chunks/ecaf8f030026e41e1d1a.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1423],{88669:(e,t,i)=>{function s(){return[0,0,0,0]}function r(e,t,i,s){return[e,t,i,s]}function o(e,t){return new Float64Array(e,t,4)}function n(){return r(1,1,1,1)}function l(){return r(1,0,0,0)}function a(){return r(0,1,0,0)}function u(){return r(0,0,1,0)}function p(){return r(0,0,0,1)}i.d(t,{a:()=>o,c:()=>s,f:()=>r});const c=n(),d=l(),y=a(),h=u(),b=p();Object.freeze(Object.defineProperty({__proto__:null,create:s,clone:function(e){return[e[0],e[1],e[2],e[3]]},fromValues:r,fromArray:function(e){const t=[0,0,0,0],i=Math.min(4,e.length);for(let s=0;s<i;++s)t[s]=e[s];return t},createView:o,zeros:function(){return[0,0,0,0]},ones:n,unitX:l,unitY:a,unitZ:u,unitW:p,ZEROS:[0,0,0,0],ONES:c,UNIT_X:d,UNIT_Y:y,UNIT_Z:h,UNIT_W:b},Symbol.toStringTag,{value:"Module"}))},12501:(e,t,i)=>{i.d(t,{Z:()=>h});var s,r=i(43697),o=i(22974),n=i(5600),l=(i(75215),i(52011)),a=i(30556),u=i(35671),p=i(5499),c=i(12571),d=i(84475);let y=s=class extends((0,c.W)(p.Z)){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new d.DictionaryLoader(this.url,this.config,this.fieldMap)}writeData(e,t){e&&(t.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,t,i,s){s?.origin||super.writeVisualVariables(e,t,i,s)}clone(){return new s({config:(0,o.d9)(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:(0,o.d9)(this.fieldMap),url:(0,o.d9)(this.url),visualVariables:(0,o.d9)(this.visualVariables)})}async getSymbolAsync(e,t){return this._loader.getSymbolAsync(e,t)}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t),this.scaleExpression&&await(0,u.io)(e,t,this.scaleExpression);for(const i in this.fieldMap){const s=this.fieldMap[i];t.has(s)&&e.add(s)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce(((e,t)=>e+t.getAttributeHash()),"")}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};(0,r._)([(0,n.Cb)({type:d.DictionaryLoader})],y.prototype,"_loader",null),(0,r._)([(0,n.Cb)({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],y.prototype,"config",void 0),(0,r._)([(0,n.Cb)({type:Object,json:{write:!0}})],y.prototype,"fieldMap",void 0),(0,r._)([(0,n.Cb)({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],y.prototype,"scaleExpression",void 0),(0,r._)([(0,a.c)("scaleExpression")],y.prototype,"writeData",null),(0,r._)([(0,n.Cb)({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],y.prototype,"scaleExpressionTitle",void 0),(0,r._)([(0,n.Cb)({type:String,json:{write:!0}})],y.prototype,"url",void 0),(0,r._)([(0,a.c)("visualVariables")],y.prototype,"writeVisualVariables",null),y=s=(0,r._)([(0,l.j)("esri.renderers.DictionaryRenderer")],y);const h=y},28756:(e,t,i)=>{i.d(t,{Z:()=>v});var s,r=i(43697),o=i(22303),n=i(22974),l=i(5600),a=(i(75215),i(36030)),u=i(52011),p=i(35671),c=i(5499),d=i(12571),y=i(79887),h=i(96674);i(67676),i(80442);let b=s=class extends h.wq{constructor(){super(...arguments),this.unit=null}clone(){return new s({unit:this.unit})}};(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],b.prototype,"unit",void 0),b=s=(0,r._)([(0,u.j)("esri.renderers.support.DotDensityLegendOptions")],b);const m=b;var f,g=i(20256),w=i(4095);let _=f=class extends((0,d.W)(c.Z)){constructor(e){super(e),this.attributes=null,this.backgroundColor=new o.Z([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new w.Z,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(null==this.referenceScale)return this.dotValue;const t=e/this.referenceScale*this.dotValue;return t<1?1:t}getSymbol(){return new g.Z({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes&&this.attributes.reduce(((e,t)=>e+t.getAttributeHash()),"")}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new f({attributes:(0,n.d9)(this.attributes),backgroundColor:(0,n.d9)(this.backgroundColor),dotBlendingEnabled:(0,n.d9)(this.dotBlendingEnabled),dotShape:(0,n.d9)(this.dotShape),dotSize:(0,n.d9)(this.dotSize),dotValue:(0,n.d9)(this.dotValue),legendOptions:(0,n.d9)(this.legendOptions),outline:(0,n.d9)(this.outline),referenceScale:(0,n.d9)(this.referenceScale),visualVariables:(0,n.d9)(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){return`${this.attributes.map((e=>e.field||e.valueExpression||""))}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const i of this.attributes)i.valueExpression&&await(0,p.io)(e,t,i.valueExpression),i.field&&e.add(i.field)}};(0,r._)([(0,l.Cb)({type:[y.Z],json:{write:!0}})],_.prototype,"attributes",void 0),(0,r._)([(0,l.Cb)({type:o.Z,json:{write:!0}})],_.prototype,"backgroundColor",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"dotBlendingEnabled",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!1}})],_.prototype,"dotShape",void 0),(0,r._)([(0,l.Cb)({type:Number,json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1}}}})],_.prototype,"dotSize",void 0),(0,r._)([(0,l.Cb)({type:m,json:{write:!0}})],_.prototype,"legendOptions",void 0),(0,r._)([(0,l.Cb)({type:w.Z,json:{default:null,write:!0}})],_.prototype,"outline",void 0),(0,r._)([(0,l.Cb)({type:Number,json:{write:!0}})],_.prototype,"dotValue",void 0),(0,r._)([(0,l.Cb)({type:Number,json:{write:!0}})],_.prototype,"referenceScale",void 0),(0,r._)([(0,l.Cb)({type:Number,json:{write:!0}})],_.prototype,"seed",void 0),(0,r._)([(0,a.J)({dotDensity:"dot-density"})],_.prototype,"type",void 0),_=f=(0,r._)([(0,u.j)("esri.renderers.DotDensityRenderer")],_);const v=_},92271:(e,t,i)=>{i.d(t,{Z:()=>E});var s,r=i(43697),o=i(22303),n=(i(78223),i(60235)),l=i(22974),a=i(92604),u=i(1654),p=i(62357),c=i(5600),d=i(1153),y=i(75215),h=i(36030),b=i(52011),m=i(35671),f=i(5499),g=i(69237),w=i(96674);i(67676),i(80442);let _=s=class extends w.wq{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new s({color:this.color,ratio:this.ratio})}};(0,r._)([(0,c.Cb)({type:o.Z,json:{type:[y.z8],default:null,write:!0}})],_.prototype,"color",void 0),(0,r._)([(0,c.Cb)({type:Number,json:{write:!0}})],_.prototype,"ratio",void 0),_=s=(0,r._)([(0,b.j)("esri.renderers.support.HeatmapColorStop")],_);const v=_;var S=i(2368);let x=class extends((0,S.J)(w.wq)){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};(0,r._)([(0,c.Cb)({type:String,json:{write:!0}})],x.prototype,"minLabel",void 0),(0,r._)([(0,c.Cb)({type:String,json:{write:!0}})],x.prototype,"maxLabel",void 0),(0,r._)([(0,c.Cb)({type:String,json:{write:!0}})],x.prototype,"title",void 0),x=(0,r._)([(0,b.j)("esri.renderers.support.HeatmapLegendOptions")],x);var C,j=i(73572),Z=i(77987);const I="esri.renderers.HeatmapRenderer",P=a.Z.getLogger(I);function M(e){if(null!=e){const{maxDensity:t,minDensity:i,radius:s}=e;if(null!=t||null!=i||null!=s){const{blurRadius:t,maxPixelIntensity:i,minPixelIntensity:s,...r}=e;return r}}return e}let D=C=class extends f.Z{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new v({ratio:0,color:new o.Z("rgba(255, 140, 0, 0)")}),new v({ratio:.75,color:new o.Z("rgba(255, 140, 0, 1)")}),new v({ratio:.9,color:new o.Z("rgba(255, 0, 0, 1)")})],this.field=null,this.fieldOffset=0,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null,this._warnedProps={blurRadius:!1,maxPixelIntensity:!1,minPixelIntensity:!1}}normalizeCtorArgs(e){return M(e)}get blurRadius(){return(0,j.AJ)(this.radius)}set blurRadius(e){const t=this.maxPixelIntensity,i=this.minPixelIntensity;this._set("radius",(0,j.k0)(e)),this._warnAboutDeprecatedGaussianBlurProp("blurRadius","radius"),this._set("maxDensity",t*this._pixelIntensityToDensity),this._set("minDensity",i*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("maxPixelIntensity","maxDensity")}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("minPixelIntensity","minDensity")}get _pixelIntensityToDensity(){return 24/(j.nu**2*this.blurRadius**4)}_warnAboutDeprecatedGaussianBlurProp(e,t){this._warnedProps[e]||"user"===(0,d.vw)(this).getDefaultOrigin()&&(this._warnedProps[e]=!0,(0,u.Os)((()=>{(0,n.Mr)(P,e,{replacement:`${String(t)} (suggested value: ${this._get(t)})`,version:"4.24"})})))}read(e,t){e=M(e),super.read(e,t)}getSymbol(){const e=0!==this.referenceScale?5:1,t=Math.min(this.radius*e,(0,p.Wz)(256));return new Z.Z({size:t})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,t){const i=this.field,s=this.valueExpression;i&&"string"==typeof i&&await(0,m.AB)(e,t,i),s&&"string"==typeof s&&await(0,m.io)(e,t,s)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new C({colorStops:(0,l.d9)(this.colorStops),field:this.field,legendOptions:(0,l.d9)(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};(0,r._)([(0,c.Cb)({type:g.Z,json:{write:!1}})],D.prototype,"authoringInfo",void 0),(0,r._)([(0,c.Cb)({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],D.prototype,"blurRadius",null),(0,r._)([(0,c.Cb)({type:[v],json:{write:!0}})],D.prototype,"colorStops",void 0),(0,r._)([(0,c.Cb)({type:String,json:{write:!0}})],D.prototype,"field",void 0),(0,r._)([(0,c.Cb)({type:Number,json:{write:{overridePolicy:(e,t,i)=>({enabled:null==i})},origins:{"web-scene":{write:!1}}}})],D.prototype,"fieldOffset",void 0),(0,r._)([(0,c.Cb)({type:x,json:{write:!0}})],D.prototype,"legendOptions",void 0),(0,r._)([(0,c.Cb)({type:Number,json:{write:!0}})],D.prototype,"maxDensity",void 0),(0,r._)([(0,c.Cb)({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],D.prototype,"maxPixelIntensity",null),(0,r._)([(0,c.Cb)({type:Number,json:{write:!0}})],D.prototype,"minDensity",void 0),(0,r._)([(0,c.Cb)({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],D.prototype,"minPixelIntensity",null),(0,r._)([(0,c.Cb)({type:Number,cast:p.t_,json:{write:!0}})],D.prototype,"radius",void 0),(0,r._)([(0,c.Cb)({type:Number,range:{min:0},json:{default:0,write:!0}})],D.prototype,"referenceScale",void 0),(0,r._)([(0,h.J)({heatmap:"heatmap"})],D.prototype,"type",void 0),(0,r._)([(0,c.Cb)({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],D.prototype,"valueExpression",void 0),(0,r._)([(0,c.Cb)({type:String})],D.prototype,"valueExpressionTitle",void 0),(0,r._)([(0,c.Cb)({readOnly:!0})],D.prototype,"_pixelIntensityToDensity",null),D=C=(0,r._)([(0,b.j)(I)],D);const E=D},72529:(e,t,i)=>{i.d(t,{Z:()=>v});var s=i(43697),r=i(22303),o=(i(78223),i(2368)),n=i(62357),l=i(5600),a=(i(67676),i(80442),i(75215),i(36030)),u=i(52011),p=i(35671),c=i(5499),d=i(12571),y=i(79887),h=i(96674);let b=class extends((0,o.J)(h.wq)){constructor(){super(...arguments),this.color=new r.Z([0,0,0,0]),this.label=null,this.threshold=0}};(0,s._)([(0,l.Cb)({type:r.Z,json:{write:!0}})],b.prototype,"color",void 0),(0,s._)([(0,l.Cb)({type:String,json:{write:!0}})],b.prototype,"label",void 0),(0,s._)([(0,l.Cb)({type:Number,range:{min:0,max:1},json:{write:!0}})],b.prototype,"threshold",void 0),b=(0,s._)([(0,u.j)("esri.renderers.support.OthersCategory")],b);let m=class extends((0,o.J)(h.wq)){constructor(){super(...arguments),this.title=null}};(0,s._)([(0,l.Cb)({type:String,json:{write:!0}})],m.prototype,"title",void 0),m=(0,s._)([(0,u.j)("esri.renderers.support.PieChartLegendOptions")],m);var f=i(77987),g=i(20256),w=i(4095);let _=class extends((0,d.W)((0,o.J)(c.Z))){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new r.Z([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new b,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){return new f.Z({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce(((e,t)=>e+t.getAttributeHash()),"")}getMeshHash(){return this.getSymbols().reduce(((e,t)=>e+JSON.stringify(t)),"")}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const i of this.attributes)i.valueExpression&&await(0,p.io)(e,t,i.valueExpression),i.field&&e.add(i.field)}};(0,s._)([(0,l.Cb)({type:[y.Z],json:{write:!0}})],_.prototype,"attributes",void 0),(0,s._)([(0,l.Cb)({type:g.Z,json:{default:null,write:!0}})],_.prototype,"backgroundFillSymbol",void 0),(0,s._)([(0,l.Cb)({type:r.Z,json:{write:!0}})],_.prototype,"defaultColor",void 0),(0,s._)([(0,l.Cb)({type:String,json:{write:!0}})],_.prototype,"defaultLabel",void 0),(0,s._)([(0,l.Cb)({type:Number,range:{min:0,max:1},json:{write:!0}})],_.prototype,"holePercentage",void 0),(0,s._)([(0,l.Cb)({type:b,json:{write:!0}})],_.prototype,"othersCategory",void 0),(0,s._)([(0,l.Cb)({type:m,json:{write:!0}})],_.prototype,"legendOptions",void 0),(0,s._)([(0,l.Cb)({type:w.Z,json:{default:null,write:!0}})],_.prototype,"outline",void 0),(0,s._)([(0,l.Cb)({type:Number,cast:n.t_,json:{write:!0}})],_.prototype,"size",void 0),(0,s._)([(0,a.J)({pieChart:"pie-chart"})],_.prototype,"type",void 0),_=(0,s._)([(0,u.j)("esri.renderers.PieChartRenderer")],_);const v=_},84382:(e,t,i)=>{i.d(t,{Z:()=>y});var s,r=i(43697),o=i(22974),n=i(5600),l=(i(75215),i(36030)),a=i(52011),u=i(5499),p=i(12571),c=i(9833);let d=s=class extends((0,p.W)(u.Z)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.getSymbols().map((i=>i.collectRequiredFields(e,t))))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce(((e,t)=>e+t.getAttributeHash()),"")}getMeshHash(){return this.getSymbols().reduce(((e,t)=>e+JSON.stringify(t)),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new s({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:(0,o.d9)(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};(0,r._)([(0,n.Cb)({type:String,json:{write:!0}})],d.prototype,"description",void 0),(0,r._)([(0,n.Cb)({type:String,json:{write:!0}})],d.prototype,"label",void 0),(0,r._)([(0,n.Cb)(c.G)],d.prototype,"symbol",void 0),(0,r._)([(0,l.J)({simple:"simple"})],d.prototype,"type",void 0),d=s=(0,r._)([(0,a.j)("esri.renderers.SimpleRenderer")],d);const y=d},79887:(e,t,i)=>{i.d(t,{Z:()=>y});var s,r=i(43697),o=i(22303),n=i(96674),l=i(92604),a=i(5600),u=(i(67676),i(80442),i(90578)),p=i(52011),c=i(75215);let d=s=class extends n.wq{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return null==e?e:"function"==typeof e?(l.Z.getLogger(this.declaredClass).error(".field: field must be a string value"),null):(0,c.Zs)(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new s({color:this.color&&this.color.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};(0,r._)([(0,a.Cb)({type:o.Z,json:{type:[Number],write:!0}})],d.prototype,"color",void 0),(0,r._)([(0,a.Cb)({type:String,json:{write:!0}})],d.prototype,"field",void 0),(0,r._)([(0,u.p)("field")],d.prototype,"castField",null),(0,r._)([(0,a.Cb)({type:String,json:{write:!0}})],d.prototype,"label",void 0),(0,r._)([(0,a.Cb)({type:String,json:{write:!0}})],d.prototype,"valueExpression",void 0),(0,r._)([(0,a.Cb)({type:String,json:{write:!0}})],d.prototype,"valueExpressionTitle",void 0),d=s=(0,r._)([(0,p.j)("esri.renderers.support.AttributeColorInfo")],d);const y=d},84475:(e,t,i)=>{i.r(t),i.d(t,{DictionaryLoader:()=>b});var s=i(22303),r=i(3172),o=i(20102),n=i(92604),l=i(13867),a=i(70586),u=i(95330),p=i(19153),c=i(59266),d=i(17386);const y="esri.renderers.support.DictionaryLoader",h={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};class b{constructor(e,t,i){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new l.Z(100),this.url=e,this.config=t,this.fieldMap=i}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,t){let i;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(t));try{i=await this._dictionaryPromise}catch(e){if((0,u.D_)(e))return this._dictionaryPromise=null,null}const r={};if(this.fieldMap)for(const t of this._symbolFields){const i=this.fieldMap[t];if(i&&null!=e.attributes[i]){const s=""+e.attributes[i];r[t]=s}else r[t]=""}const o=i(r,t);if(!o||"string"!=typeof o)return null;const n=(0,p.hP)(o).toString(),l=this._symbolCache.get(n);if(l)return l.catch((()=>{this._symbolCache.pop(n)})),l;const c=o.split(";"),d=[],y=[];for(const e of c)if(e)if(e.includes("po:")){const t=e.substr(3).split("|");if(3===t.length){const e=t[0],i=t[1];let r=t[2];if("DashTemplate"===i)r=r.split(" ").map((e=>Number(e)));else if("Color"===i){const e=new s.Z(r).toRgba();r=[e[0],e[1],e[2],255*e[3]]}else r=Number(r);y.push({primitiveName:e,propertyName:i,value:r})}}else if(e.includes("|")){for(const t of e.split("|"))if(this._itemNames.has(t)){d.push(t);break}}else this._itemNames.has(e)&&d.push(e);const h=!(0,a.pC)(e.geometry)||!e.geometry.hasZ&&"point"===e.geometry.type,b=this._cimPartsToCIMSymbol(d,y,h,t);return this._symbolCache.put(n,b,1),b}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void n.Z.getLogger(y).error("no valid URL!");const t=(0,r.default)(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:(0,a.pC)(e)?e.signal:null}),[{data:i}]=await Promise.all([t,(0,c.LC)()]);if(!i)throw this._dictionaryPromise=null,new o.Z("esri.renderers.DictionaryRenderer","Bad dictionary data!");const s=i.expression,l=i.authoringInfo;this._refSymbolUrlTemplate=this.url+"/"+i.cimRefTemplateUrl,this._itemNames=new Set(i.itemsNames),this._symbolFields=l.symbol;const u={};if(this.config){const e=this.config;for(const t in e)u[t]=e[t]}if(l.configuration)for(const e of l.configuration)u.hasOwnProperty(e.name)||(u[e.name]=e.value);const p=[];if((0,a.pC)(e)&&e.fields&&this.fieldMap)for(const t of this._symbolFields){const i=this.fieldMap[t],s=e.fields.filter((e=>e.name===i));s.length>0&&p.push({...s[0],name:t})}return this._dictionaryPromise=(0,c.pp)(s,(0,a.pC)(e)?e.spatialReference:null,p,u).then((e=>{const t={scale:0};return(i,s)=>{const r=e.repurposeFeature({geometry:null,attributes:i});return t.scale=(0,a.pC)(s)?s.scale:void 0,e.evaluate({$feature:r,$view:t})}})).catch((e=>(n.Z.getLogger(y).error("Creating dictinoary expression failed:",e),null))),this._dictionaryPromise}async _cimPartsToCIMSymbol(e,t,i,s){const r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=this._getSymbolPart(e[t],s);const o=await Promise.all(r),n=this.fieldMap;for(const e of o)m(e,n);return new d.Z({data:this._combineSymbolParts(o,t,i)})}async _getSymbolPart(e,t){if(this._ongoingRequests.has(e))return this._ongoingRequests.get(e).then((e=>e.data));const i=this._refSymbolUrlTemplate.replace(/\{itemName\}/gi,e),s=(0,r.default)(i,{responseType:"json",query:{f:"json"},...t});this._ongoingRequests.set(e,s);try{return(await s).data}catch(t){throw this._ongoingRequests.delete(e),t}}_combineSymbolParts(e,t,i){if(!e||0===e.length)return null;const s={...e[0]};if(e.length>1){s.symbolLayers=[];for(const t of e){const e=t;s.symbolLayers.unshift(...e.symbolLayers)}}return i&&(s.callout=h),{type:"CIMSymbolReference",symbol:s,primitiveOverrides:t}}}function m(e,t){if(!e)return;const i=e.symbolLayers;if(!i)return;let s=i.length;for(;s--;){const e=i[s];e&&!1!==e.enable&&"CIMVectorMarker"===e.type&&f(e,t)}}function f(e,t){const i=e.markerGraphics;if(i)for(const e of i){if(!e)continue;const i=e.symbol;if(i)switch(i.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":m(i,t);break;case"CIMTextSymbol":i.fieldMap=t}}}},73572:(e,t,i)=>{i.d(t,{AJ:()=>n,If:()=>a,QM:()=>l,k0:()=>o,nu:()=>r,wx:()=>u}),i(22021);var s=i(62357);i(98766),i(88669);const r=2.4;function o(e){return(0,s.Wz)(e*r)}function n(e){return(0,s.F2)(e)/r}function l(e,t,i,r){const{radius:o,fieldOffset:n,field:l}=t,u=Math.round((0,s.F2)(o)),p=new Float64Array(i*r);let c,d=Number.NEGATIVE_INFINITY;const y=function(e,t){return null!=e?"string"==typeof t?t=>-1*+t.readAttribute(e):i=>+i.readAttribute(e)+t:e=>1}(l,n),h=new Set;for(const t of e){const e=t.getCursor();for(;e.next();){const t=e.getObjectId();if(h.has(t))continue;h.add(t);const s=e.readLegacyPointGeometry(),o=128;if(s.x<-o||s.x>=i+o||s.y<-o||s.y>r+o)continue;const n=+y(e),l=Math.max(0,Math.round(s.x)-u),b=Math.max(0,Math.round(s.y)-u),m=Math.min(r,Math.round(s.y)+u),f=Math.min(i,Math.round(s.x)+u);for(let e=b;e<m;e++)for(let t=l;t<f;t++){const r=e*i+t,o=a(s.x-t,s.y-e,u);c=p[r]+=o*n,c>d&&(d=c)}}}return{matrix:p.buffer,max:d}}function a(e,t,i){const s=Math.sqrt(e**2+t**2)/i;return s>1?0:3/(Math.PI*i**2)*(1-s**2)**2}function u(e,t){return"function"==typeof e?e:e?"string"==typeof t?t=>-1*+t[e]:i=>+i[e]+t:()=>1}},91423:(e,t,i)=>{i.d(t,{a:()=>l});var s=i(20941),r=i(63213),o=i(32400);const n=(0,r.d)({types:o.A});function l(e,t,i){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(i&&i.messages&&i.messages.push(new s.Z("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:i})),null):n(e,t,i):null}},32400:(e,t,i)=>{i.d(t,{A:()=>c,o:()=>d});var s=i(16050),r=i(12501),o=i(28756),n=i(92271),l=i(72529),a=i(5499),u=i(84382),p=i(30687);const c={key:"type",base:a.Z,typeMap:{heatmap:n.Z,simple:u.Z,"unique-value":p.Z,"class-breaks":s.Z,"dot-density":o.Z,dictionary:r.Z,"pie-chart":l.Z},errorContext:"renderer"},d={key:"type",base:a.Z,typeMap:{simple:u.Z,"unique-value":p.Z,"class-breaks":s.Z,heatmap:n.Z},errorContext:"renderer"}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6208],{84552:(e,t,i)=>{i.d(t,{Z:()=>d});var s,r=i(43697),n=i(96674),o=i(35463),a=i(5600),l=(i(67676),i(80442),i(75215),i(52011)),h=i(78981);let u=s=class extends n.wq{constructor(e){super(e),this.value=0,this.unit="milliseconds"}toMilliseconds(){return(0,o.rJ)(this.value,this.unit,"milliseconds")}clone(){return new s({value:this.value,unit:this.unit})}};(0,r._)([(0,a.Cb)({type:Number,json:{write:!0},nonNullable:!0})],u.prototype,"value",void 0),(0,r._)([(0,a.Cb)({type:h.v.apiValues,json:{type:h.v.jsonValues,read:h.v.read,write:h.v.write},nonNullable:!0})],u.prototype,"unit",void 0),u=s=(0,r._)([(0,l.j)("esri.TimeInterval")],u);const d=u},66643:(e,t,i)=>{i.d(t,{Ed:()=>h,UI:()=>u,mt:()=>_,q6:()=>p,vr:()=>f});var s=i(43697),r=i(15923),n=i(70586),o=i(95330),a=i(5600),l=(i(67676),i(80442),i(75215),i(52011));function h(e,t,i){return(0,o.as)(e.map(((e,s)=>t.apply(i,[e,s]))))}async function u(e,t,i){return(await(0,o.as)(e.map(((e,s)=>t.apply(i,[e,s]))))).map((e=>e.value))}function d(e){return{ok:!0,value:e}}function c(e){return{ok:!1,error:e}}async function p(e){if((0,n.Wi)(e))return{ok:!1,error:new Error("no promise provided")};try{return d(await e)}catch(e){return c(e)}}async function _(e){try{return d(await e)}catch(e){return(0,o.r9)(e),c(e)}}function f(e,t){return new m(e,t)}let m=class extends r.Z{constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,n.IM)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:i}=this._abortController;this.promise=e(i),this.promise.then((e=>{this._result=d(e),this._cleanup()}),(e=>{this._result=c(e),this._cleanup()})),this._abortHandle=(0,o.fu)(t,this.abort)}get value(){return e=this._result,(0,n.pC)(e)&&!0===e.ok?e.value:null;var e}get error(){return e=this._result,(0,n.pC)(e)&&!1===e.ok?e.error:null;var e}get finished(){return(0,n.pC)(this._result)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,n.hw)(this._abortHandle),this._abortController=null}};(0,s._)([(0,a.Cb)()],m.prototype,"value",null),(0,s._)([(0,a.Cb)()],m.prototype,"error",null),(0,s._)([(0,a.Cb)()],m.prototype,"finished",null),(0,s._)([(0,a.Cb)()],m.prototype,"promise",void 0),(0,s._)([(0,a.Cb)()],m.prototype,"_result",void 0),m=(0,s._)([(0,l.j)("esri.core.asyncUtils.ReactiveTask")],m)},43090:(e,t,i)=>{function s(e){return 32+e.length}function r(e){if(!e)return 0;let t=32;for(const i in e)if(e.hasOwnProperty(i)){const r=e[i];switch(typeof r){case"string":t+=s(r);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function n(e,t){return 32+e.length*t}var o;i.d(t,{Y8:()=>o,do:()=>n,f2:()=>r}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(o||(o={}))},24133:(e,t,i)=>{i.d(t,{Q:()=>a});var s=i(67676),r=i(70586),n=i(44553),o=i(88764);class a{constructor(e=9,t){this.compareMinX=d,this.compareMinY=c,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),b.prune(),C.prune(),T.prune(),w.prune()}all(e){this._all(this.data,e)}search(e,t){let i=this.data;const s=this._toBBox;if(g(e,i))for(b.clear();i;){for(let r=0,n=i.children.length;r<n;r++){const n=i.children[r],o=i.leaf?s(n):n;g(e,o)&&(i.leaf?t(n):y(e,o)?this._all(n,t):b.push(n))}i=b.pop()}}collides(e){let t=this.data;const i=this._toBBox;if(!g(e,t))return!1;for(b.clear();t;){for(let s=0,r=t.children.length;s<r;s++){const r=t.children[s],n=t.leaf?i(r):r;if(g(e,n)){if(t.leaf||y(e,n))return!0;b.push(r)}}t=b.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this.data.children.length)if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}else this.data=t;return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=new E([]),this}remove(e){if(!e)return this;let t,i=this.data,n=null,o=0,a=!1;const l=this._toBBox(e);for(T.clear(),w.clear();i||T.length>0;){if(i||(i=(0,r.j0)(T.pop()),n=T.data[T.length-1],o=w.pop()??0,a=!0),i.leaf&&(t=(0,s.cq)(i.children,e,i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),T.push(i),this._condense(T),this;a||i.leaf||!y(i,l)?n?(o++,i=n.children[o],a=!1):i=null:(T.push(i),w.push(o),o=0,n=i,i=i.children[0])}return this}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let i=e;for(C.clear();i;){if(!0===i.leaf)for(const e of i.children)t(e);else C.pushArray(i.children);i=C.pop()??null}}_build(e,t,i,s){const r=i-t+1;let n=this._maxEntries;if(r<=n){const s=new E(e.slice(t,i+1));return l(s,this._toBBox),s}s||(s=Math.ceil(Math.log(r)/Math.log(n)),n=Math.ceil(r/n**(s-1)));const o=new F([]);o.height=s;const a=Math.ceil(r/n),h=a*Math.ceil(Math.sqrt(n));v(e,t,i,h,this.compareMinX);for(let r=t;r<=i;r+=h){const t=Math.min(r+h-1,i);v(e,r,t,a,this.compareMinY);for(let i=r;i<=t;i+=a){const r=Math.min(i+a-1,t);o.children.push(this._build(e,i,r,s-1))}}return l(o,this._toBBox),o}_chooseSubtree(e,t,i,s){for(;s.push(t),!0!==t.leaf&&s.length-1!==i;){let i,s=1/0,r=1/0;for(let n=0,o=t.children.length;n<o;n++){const o=t.children[n],a=p(o),l=f(e,o)-a;l<r?(r=l,s=a<s?a:s,i=o):l===r&&a<s&&(s=a,i=o)}t=i||t.children[0]}return t}_insert(e,t,i){const s=this._toBBox,r=i?e:s(e);T.clear();const n=this._chooseSubtree(r,this.data,t,T);for(n.children.push(e),u(n,r);t>=0&&T.data[t].children.length>this._maxEntries;)this._split(T,t),t--;this._adjustParentBBoxes(r,T,t)}_split(e,t){const i=e.data[t],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);const n=this._chooseSplitIndex(i,r,s);if(!n)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=i.children.splice(n,i.children.length-n),a=i.leaf?new E(o):new F(o);a.height=i.height,l(i,this._toBBox),l(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this.data=new F([e,t]),this.data.height=e.height+1,l(this.data,this._toBBox)}_chooseSplitIndex(e,t,i){let s,r,n;s=r=1/0;for(let o=t;o<=i-t;o++){const t=h(e,0,o,this._toBBox),a=h(e,o,i,this._toBBox),l=m(t,a),u=p(t)+p(a);l<s?(s=l,n=o,r=u<r?u:r):l===s&&u<r&&(r=u,n=o)}return n}_chooseSplitAxis(e,t,i){const s=e.leaf?this.compareMinX:d,r=e.leaf?this.compareMinY:c;this._allDistMargin(e,t,i,s)<this._allDistMargin(e,t,i,r)&&e.children.sort(s)}_allDistMargin(e,t,i,s){e.children.sort(s);const r=this._toBBox,n=h(e,0,t,r),o=h(e,i-t,i,r);let a=_(n)+_(o);for(let s=t;s<i-t;s++){const t=e.children[s];u(n,e.leaf?r(t):t),a+=_(n)}for(let s=i-t-1;s>=t;s--){const t=e.children[s];u(o,e.leaf?r(t):t),a+=_(o)}return a}_adjustParentBBoxes(e,t,i){for(let s=i;s>=0;s--)u(t.data[s],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const i=e.data[t];if(0===i.children.length)if(t>0){const r=e.data[t-1],n=r.children;n.splice((0,s.cq)(n,i,n.length,r.indexHint),1)}else this.clear();else l(i,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){h(e,0,e.children.length,t,e)}function h(e,t,i,s,r){r||(r=new E([])),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let n,o=t;o<i;o++)n=e.children[o],u(r,e.leaf?s(n):n);return r}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function d(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function p(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function _(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function m(e,t){const i=Math.max(e.minX,t.minX),s=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),n=Math.min(e.maxY,t.maxY);return Math.max(0,r-i)*Math.max(0,n-s)}function y(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function g(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e,t,i,s,n){const a=[t,i];for(;a.length;){const t=(0,r.j0)(a.pop()),i=(0,r.j0)(a.pop());if(t-i<=s)continue;const l=i+Math.ceil((t-i)/s/2)*s;(0,o.q)(e,l,i,t,n),a.push(i,l,l,t)}}const b=new n.Z,C=new n.Z,T=new n.Z,w=new n.Z({deallocator:void 0});class x extends class{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}{constructor(){super(...arguments),this.height=1,this.indexHint=new s.SO}}class E extends x{constructor(e){super(),this.children=e,this.leaf=!0}}class F extends x{constructor(e){super(),this.children=e,this.leaf=!1}}},37549:(e,t,i)=>{i.d(t,{H:()=>a});var s=i(80442),r=i(24133),n=i(24470);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new r.Q(9,(0,s.Z)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((i,s)=>{e[t++]=s})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,n.cS)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,i){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,i)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},57191:(e,t,i)=>{i.d(t,{Z:()=>f});var s=i(20102),r=i(32448),n=i(92604),o=i(70586),a=i(60437),l=i(24470),h=i(98732),u=i(37549),d=i(29730),c=i(70272),p=i(5428);const _={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new c.u_(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>((0,o.Wi)(e.centroid)&&(e.centroid=(0,d.Y)(new p.Z,e.geometry,t.hasZ,t.hasM)),e.centroid)};class f{constructor(e){this.geometryInfo=e,this._boundsStore=new u.H,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.Z,this.featureAdapter=_}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{(0,o.pC)(t.geometry)&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t,i){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.JR)(i,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}toArray(){return Array.from(this._featuresById.values())}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,i)=>{this._markedIds.has(i)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void n.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new s.Z("featurestore:invalid-feature","feature id is missing",{feature:e}));const i=this._featuresById.get(t);let r;if(this._markedIds.add(t),i?(e.displayId=i.displayId,r=this._boundsStore.get(t),this._boundsStore.delete(t)):(0,o.pC)(this.onFeatureAdd)&&this.onFeatureAdd(e),(0,o.Wi)(e.geometry)||!e.geometry.coords||!e.geometry.coords.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);r=(0,h.$)((0,o.pC)(r)?r:(0,l.Ue)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),(0,o.pC)(r)&&this._boundsStore.set(t,r),this._featuresById.set(t,e)}_remove(e){return(0,o.pC)(this.onFeatureRemove)&&this.onFeatureRemove(e),this._markedIds.delete(e.objectId),this._boundsStore.delete(e.objectId),this._featuresById.delete(e.objectId),e}}},1231:(e,t,i)=>{i.d(t,{Z:()=>m});var s,r=i(43697),n=i(35454),o=i(96674),a=i(5600),l=(i(67676),i(80442),i(75215)),h=i(36030),u=i(71715),d=i(52011),c=i(72729),p=i(86719);const _=new n.X({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let f=s=class extends o.wq{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=-1,this.name=null,this.nullable=!0,this.type=null,this.valueType=null}readDescription(e,{description:t}){let i;try{i=JSON.parse(t)}catch(e){}return i?i.value:null}readValueType(e,{description:t}){let i;try{i=JSON.parse(t)}catch(e){}return i?_.fromJSON(i.fieldValueType):null}clone(){return new s({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType})}};(0,r._)([(0,a.Cb)({type:String,json:{write:!0}})],f.prototype,"alias",void 0),(0,r._)([(0,a.Cb)({type:[String,Number],json:{write:{allowNull:!0}}})],f.prototype,"defaultValue",void 0),(0,r._)([(0,a.Cb)()],f.prototype,"description",void 0),(0,r._)([(0,u.r)("description")],f.prototype,"readDescription",null),(0,r._)([(0,a.Cb)({types:c.V5,json:{read:{reader:c.im},write:!0}})],f.prototype,"domain",void 0),(0,r._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],f.prototype,"editable",void 0),(0,r._)([(0,a.Cb)({type:l.z8,json:{write:!0}})],f.prototype,"length",void 0),(0,r._)([(0,a.Cb)({type:String,json:{write:!0}})],f.prototype,"name",void 0),(0,r._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],f.prototype,"nullable",void 0),(0,r._)([(0,h.J)(p.v)],f.prototype,"type",void 0),(0,r._)([(0,a.Cb)()],f.prototype,"valueType",void 0),(0,r._)([(0,u.r)("valueType",["description"])],f.prototype,"readValueType",null),f=s=(0,r._)([(0,d.j)("esri.layers.support.Field")],f);const m=f},39450:(e,t,i)=>{i.d(t,{Z:()=>u});var s,r=i(43697),n=i(96674),o=i(5600),a=(i(67676),i(80442),i(75215)),l=i(52011);let h=s=class extends n.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,r._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"cols",void 0),(0,r._)([(0,o.Cb)({type:a.z8,json:{write:!0}})],h.prototype,"level",void 0),(0,r._)([(0,o.Cb)({type:String,json:{write:!0}})],h.prototype,"levelValue",void 0),(0,r._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"origin",void 0),(0,r._)([(0,o.Cb)({type:Number,json:{write:!0}})],h.prototype,"resolution",void 0),(0,r._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"rows",void 0),(0,r._)([(0,o.Cb)({type:Number,json:{write:!0}})],h.prototype,"scale",void 0),h=s=(0,r._)([(0,l.j)("esri.layers.support.LOD")],h);const u=h},11145:(e,t,i)=>{i.d(t,{Z:()=>E});var s,r=i(43697),n=i(35454),o=i(96674),a=i(70586),l=i(67900),h=i(5600),u=(i(67676),i(80442),i(75215)),d=i(71715),c=i(52011),p=i(30556),_=i(13473),f=i(82971),m=i(24470),y=i(8744),g=i(40488),v=i(39450),b=i(43077);const C=new n.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let T=s=class extends o.wq{constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.minScale=0,this.maxScale=0,this.size=null,this.spatialReference=null}static create(e={}){const{resolutionFactor:t=1,scales:i,size:r=256,spatialReference:n=f.Z.WebMercator,numLODs:o=24}=e;if(!(0,y.JY)(n)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push({level:t,scale:s,resolution:s})}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift({level:i,scale:t,resolution:t}),t*=2}return new s({dpi:96,lods:e,origin:new _.Z(0,0,n),size:[r,r],spatialReference:n})}const a=(0,y.C5)(n),h=e.origin?new _.Z({x:e.origin.x,y:e.origin.y,spatialReference:n}):new _.Z(a?{x:a.origin[0],y:a.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),u=1/(39.37*(0,l.c9)(n)*96),d=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;d.push({level:e,scale:t,resolution:s})}else{let e=(0,y.sT)(n)?512/r*591657527.5917094:256/r*591657527.591555;const i=Math.ceil(o/t);d.push({level:0,scale:e,resolution:e*u});for(let s=1;s<i;s++){const i=e/2**t,r=i*u;d.push({level:s,scale:i,resolution:r}),e=i}}return new s({dpi:96,lods:d,origin:h,size:[r,r],spatialReference:n})}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,y.C5)(e);return e.isWrappable&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return _.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[];this._levelToLOD={},e&&(t=-1/0,i=1/0,e.forEach((e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,this._levelToLOD[e.level]=e}))),this._set("scales",s),this._set("minScale",t),this._set("maxScale",i),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],r=t[s+1];if(i<=e)return s;if(r===e)return s+1;if(i>e&&r<e)return s+Math.log(i/e)/Math.log(i/r)}return s}snapScale(e,t=.95){const i=this.scaleToZoom(e);return i%Math.floor(i)>=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,s){const r=this.lodAt(e);if(!r)return null;let n,o;if("number"==typeof t)n=t,o=i;else if((0,y.fS)(t.spatialReference,this.spatialReference))n=t.x,o=t.y,s=i;else{const e=(0,g.iV)(t,this.spatialReference);if((0,a.Wi)(e))return null;n=e.x,o=e.y,s=i}const l=r.resolution*this.size[0],h=r.resolution*this.size[1];return s||(s=new b.f(null,0,0,0,(0,m.Ue)())),s.level=e,s.row=Math.floor((this.origin.y-o)/h+.001),s.col=Math.floor((n-this.origin.x)/l+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=s.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===s.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const r=e.level-i.level,n=i.resolution*this.size[0]/2**r,o=i.resolution*this.size[1]/2**r;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,m.Ue)()),e.extent[0]=this.origin.x+e.col*n,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+n,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const{resolution:i}=this.lodAt(t.level),s=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*s,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+s,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD&&this._levelToLOD[e]||null}clone(){return s.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const i=[],r=this.lods.length;for(let e=0;e<r;e++){const s=this.lods[e],r=s.resolution*t;i.push(new v.Z({level:s.level,scale:s.scale,resolution:r}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};var w,x;(0,r._)([(0,h.Cb)({type:Number,json:{write:!0}})],T.prototype,"compressionQuality",void 0),(0,r._)([(0,h.Cb)({type:Number,json:{write:!0}})],T.prototype,"dpi",void 0),(0,r._)([(0,h.Cb)({type:String,json:{read:C.read,write:C.write,origins:{"web-scene":{read:!1,write:!1}}}})],T.prototype,"format",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],T.prototype,"isWrappable",null),(0,r._)([(0,h.Cb)({type:_.Z,json:{write:!0}})],T.prototype,"origin",void 0),(0,r._)([(0,d.r)("origin")],T.prototype,"readOrigin",null),(0,r._)([(0,h.Cb)({type:[v.Z],value:null,json:{write:!0}})],T.prototype,"lods",null),(0,r._)([(0,h.Cb)({readOnly:!0})],T.prototype,"minScale",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],T.prototype,"maxScale",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],T.prototype,"scales",void 0),(0,r._)([(0,h.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],T.prototype,"size",void 0),(0,r._)([(0,d.r)("size",["rows","cols"])],T.prototype,"readSize",null),(0,r._)([(0,p.c)("size",{cols:{type:u.z8},rows:{type:u.z8}})],T.prototype,"writeSize",null),(0,r._)([(0,h.Cb)({type:f.Z,json:{write:!0}})],T.prototype,"spatialReference",void 0),T=s=(0,r._)([(0,c.j)("esri.layers.support.TileInfo")],T),(x=(w=T||(T={})).ExtrapolateOptions||(w.ExtrapolateOptions={}))[x.NONE=0]="NONE",x[x.POWER_OF_TWO=1]="POWER_OF_TWO";const E=T},43077:(e,t,i)=>{i.d(t,{f:()=>s});class s{constructor(e,t,i,s,r){this.id=e,this.level=t,this.row=i,this.col=s,this.extent=r}}},30547:(e,t,i)=>{i.d(t,{Z:()=>v});var s,r=i(43697),n=i(92835),o=i(84552),a=i(96674),l=i(22974),h=i(70586),u=i(5600),d=(i(75215),i(71715)),c=i(52011),p=i(30556);i(67676),i(80442);let _=s=class extends a.wq{constructor(e){super(e),this.respectsDaylightSaving=!1,this.timezone=null}readRespectsDaylightSaving(e,t){return void 0!==t.respectsDaylightSaving?t.respectsDaylightSaving:void 0!==t.respectDaylightSaving&&t.respectDaylightSaving}clone(){const{respectsDaylightSaving:e,timezone:t}=this;return new s({respectsDaylightSaving:e,timezone:t})}};(0,r._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"respectsDaylightSaving",void 0),(0,r._)([(0,d.r)("respectsDaylightSaving",["respectsDaylightSaving","respectDaylightSaving"])],_.prototype,"readRespectsDaylightSaving",null),(0,r._)([(0,u.Cb)({type:String,json:{read:{source:"timeZone"},write:{target:"timeZone"}}})],_.prototype,"timezone",void 0),_=s=(0,r._)([(0,c.j)("esri.layers.support.TimeReference")],_);const f=_;var m,y=i(78981);let g=m=class extends a.wq{constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeReference=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(e,t){if(!t.timeExtent||!Array.isArray(t.timeExtent)||2!==t.timeExtent.length)return null;const i=new Date(t.timeExtent[0]),s=new Date(t.timeExtent[1]);return new n.Z({start:i,end:s})}writeFullTimeExtent(e,t){e&&(0,h.pC)(e.start)&&(0,h.pC)(e.end)?t.timeExtent=[e.start.getTime(),e.end.getTime()]:t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?new o.Z({value:t.timeInterval,unit:y.v.fromJSON(t.timeIntervalUnits)}):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?new o.Z({value:t.defaultTimeInterval,unit:y.v.fromJSON(t.defaultTimeIntervalUnits)}):null}writeInterval(e,t){if(e){const i=e.toJSON();t.timeInterval=i.value,t.timeIntervalUnits=i.unit}else t.timeInterval=null,t.timeIntervalUnits=null}clone(){const{cumulative:e,endField:t,hasLiveData:i,interval:s,startField:r,timeReference:n,fullTimeExtent:o,trackIdField:a,useTime:h}=this;return new m({cumulative:e,endField:t,hasLiveData:i,interval:s,startField:r,timeReference:(0,l.d9)(n),fullTimeExtent:(0,l.d9)(o),trackIdField:a,useTime:h})}};(0,r._)([(0,u.Cb)({type:Boolean,json:{read:{source:"exportOptions.timeDataCumulative"},write:{target:"exportOptions.timeDataCumulative"}}})],g.prototype,"cumulative",void 0),(0,r._)([(0,u.Cb)({type:String,json:{read:{source:"endTimeField"},write:{target:"endTimeField",allowNull:!0}}})],g.prototype,"endField",void 0),(0,r._)([(0,u.Cb)({type:n.Z,json:{write:{enabled:!0,allowNull:!0}}})],g.prototype,"fullTimeExtent",void 0),(0,r._)([(0,d.r)("fullTimeExtent",["timeExtent"])],g.prototype,"readFullTimeExtent",null),(0,r._)([(0,p.c)("fullTimeExtent")],g.prototype,"writeFullTimeExtent",null),(0,r._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],g.prototype,"hasLiveData",void 0),(0,r._)([(0,u.Cb)({type:o.Z,json:{write:{enabled:!0,allowNull:!0}}})],g.prototype,"interval",void 0),(0,r._)([(0,d.r)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],g.prototype,"readInterval",null),(0,r._)([(0,p.c)("interval")],g.prototype,"writeInterval",null),(0,r._)([(0,u.Cb)({type:String,json:{read:{source:"startTimeField"},write:{target:"startTimeField",allowNull:!0}}})],g.prototype,"startField",void 0),(0,r._)([(0,u.Cb)({type:f,json:{write:{enabled:!0,allowNull:!0}}})],g.prototype,"timeReference",void 0),(0,r._)([(0,u.Cb)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],g.prototype,"trackIdField",void 0),(0,r._)([(0,u.Cb)({type:Boolean,json:{read:{source:"exportOptions.useTime"},write:{target:"exportOptions.useTime"}}})],g.prototype,"useTime",void 0),g=m=(0,r._)([(0,c.j)("esri.layers.support.TimeInfo")],g);const v=g},72729:(e,t,i)=>{i.d(t,{im:()=>x,V5:()=>w}),i(80442);var s,r=i(43697),n=i(22974),o=i(5600),a=(i(75215),i(36030)),l=i(52011),h=i(96674);i(67676);let u=s=class extends h.wq{constructor(e){super(e),this.name=null,this.code=null}clone(){return new s({name:this.name,code:this.code})}};(0,r._)([(0,o.Cb)({type:String,json:{write:!0}})],u.prototype,"name",void 0),(0,r._)([(0,o.Cb)({type:[String,Number],json:{write:!0}})],u.prototype,"code",void 0),u=s=(0,r._)([(0,l.j)("esri.layers.support.CodedValue")],u);const d=new(i(35454).X)({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends h.wq{constructor(e){super(e),this.name=null,this.type=null}};(0,r._)([(0,o.Cb)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,r._)([(0,a.J)(d)],c.prototype,"type",void 0),c=(0,r._)([(0,l.j)("esri.layers.support.Domain")],c);const p=c;var _;let f=_=class extends p{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const i=String(e);this.codedValues.some((e=>(String(e.code)===i&&(t=e.name),!!t)))}return t}clone(){return new _({codedValues:(0,n.d9)(this.codedValues),name:this.name})}};(0,r._)([(0,o.Cb)({type:[u],json:{write:!0}})],f.prototype,"codedValues",void 0),(0,r._)([(0,a.J)({codedValue:"coded-value"})],f.prototype,"type",void 0),f=_=(0,r._)([(0,l.j)("esri.layers.support.CodedValueDomain")],f);const m=f;var y;i(92604),i(20102);let g=y=class extends p{constructor(e){super(e),this.type="inherited"}clone(){return new y}};(0,r._)([(0,a.J)({inherited:"inherited"})],g.prototype,"type",void 0),g=y=(0,r._)([(0,l.j)("esri.layers.support.InheritedDomain")],g);const v=g;var b;let C=b=class extends p{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new b({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,r._)([(0,o.Cb)({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range&&t.range[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,i){t[i]=[this.minValue||0,e]}}}})],C.prototype,"maxValue",void 0),(0,r._)([(0,o.Cb)({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range&&t.range[0]},write:{target:"range",writer(e,t,i){t[i]=[e,this.maxValue||0]}}}})],C.prototype,"minValue",void 0),(0,r._)([(0,a.J)({range:"range"})],C.prototype,"type",void 0),C=b=(0,r._)([(0,l.j)("esri.layers.support.RangeDomain")],C);const T=C,w={key:"type",base:p,typeMap:{range:C,"coded-value":m,inherited:v}};function x(e){if(!e||!e.type)return null;switch(e.type){case"range":return T.fromJSON(e);case"codedValue":return m.fromJSON(e);case"inherited":return v.fromJSON(e)}return null}},86719:(e,t,i)=>{i.d(t,{v:()=>s});const s=new(i(35454).X)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml"})},78981:(e,t,i)=>{i.d(t,{v:()=>s});const s=(0,i(35454).w)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},2255:(e,t,i)=>{i.r(t),i.d(t,{default:()=>K});var s=i(43697),r=i(32448),n=i(61247),o=i(70586),a=i(95330),l=i(17445),h=i(5600),u=i(67676),d=(i(80442),i(75215),i(52011)),c=i(72762),p=i(82971),_=i(57191),f=i(41006),m=i(11145),y=i(30547),g=i(57444),v=i(15923);let b=class extends v.Z{constructor(){super(...arguments),this.updating=!1,this.pending=[]}push(e,t){this.pending.push({promise:e,callback:t}),1===this.pending.length&&this._process()}_process(){if(!this.pending.length)return void(this.updating=!1);this.updating=!0;const e=this.pending[0];e.promise.then((t=>e.callback(t))).catch((()=>{})).then((()=>{this.pending.shift(),this._process()}))}};(0,s._)([(0,h.Cb)()],b.prototype,"updating",void 0),b=(0,s._)([(0,d.j)("esri.core.AsyncSequence")],b);var C,T=i(66643),w=i(3920),x=i(50758),E=i(92604),F=i(6570),I=i(24470),S=i(98732),O=i(66677),B=i(78760),M=i(34599);class R{constructor(e,t){this.data=e,this.resolution=t,this.state={type:C.CREATED},this.alive=!0}process(e){switch(this.state.type){case C.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case C.FETCH_COUNT:break;case C.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case C.FETCH_FEATURES:break;case C.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case C.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case C.CREATED:case C.FETCH_COUNT:return 0;case C.FETCHED_COUNT:return this.state.featureCount;case C.FETCH_FEATURES:return this.state.previous.featureCount;case C.FETCHED_FEATURES:return this.state.features.length;case C.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case C.CREATED:return"created";case C.FETCH_COUNT:return"fetch-count";case C.FETCHED_COUNT:return"fetched-count";case C.FETCH_FEATURES:return"fetch-features";case C.FETCHED_FEATURES:return"fetched-features";case C.DONE:return"done"}}_gotoFetchCount(e,t){return{type:C.FETCH_COUNT,previous:e,task:(0,T.vr)((async e=>{const i=await(0,T.mt)(t.fetchCount(this,e));this.state.type===C.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,i.ok?i.value:1/0))}))}}_gotoFetchedCount(e,t){return{type:C.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:C.FETCH_FEATURES,previous:e,task:(0,T.vr)((async i=>{const s=await(0,T.mt)(t.fetchFeatures(this,e.featureCount,i));this.state.type===C.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,s.ok?s.value:[]))}))}}_gotoFetchedFeatures(e,t){return{type:C.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:C.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:C.CREATED},e.type){case C.CREATED:case C.FETCHED_COUNT:case C.FETCHED_FEATURES:case C.DONE:break;case C.FETCH_COUNT:case C.FETCH_FEATURES:e.task.abort()}}intersects(e){return!(!(0,o.Wi)(e)&&this.data.extent)||((0,I.oJ)(e,D),(0,I.kK)(this.data.extent,D))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(C||(C={}));const D=(0,I.Ue)();let A=class extends w.r{constructor(e){super(e),this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._pendingEdits=new b,this._pendingEditsAbortController=new AbortController}get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&((0,o.pC)(e)&&(0,o.pC)(t)&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingHandles.updating||this._pendingEdits.updating}initialize(){this._initializeFetchExtent(),this.updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this.updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{(0,u.fS)(e,t,(({id:e},{id:t})=>e===t))||this._process()}),l.Z_)}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this._pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,e]of this._pendingTiles)e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this.updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this._pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,O.M8)(this.url))return;const e=(0,T.vr)((async e=>{try{const t=await(0,M.executeQueryForExtent)(this.url,new g.Z({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:!!this.capabilities.query.supportsCacheHint||void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=F.Z.fromJSON(t.data?.extent)}catch(e){(0,a.r9)(e),E.Z.getLogger(this.declaredClass).warn("Failed to fetch data extent",e)}}));this.updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.handles.add((0,x.kB)((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){const e=this._collectMissingTilesInfo();if(this._setAvailability((0,o.Wi)(e)?1:e.coveredArea/e.fullArea),!(0,o.Wi)(e))for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const i=this.tilesOfInterest[t],s=this.store.process(i,((e,t)=>this._verifyTileComplexity(e,t)));(0,o.Wi)(e)?e=s:e.prepend(s)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this.updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<P}_verifyFeatureDensity(e,t){if((0,o.Wi)(this.tileInfo))return!1;const i=this.tileSize*t;return e*(z/(i*i))<H}_ensureFetchAllCounts(e){let t=!0;for(const[,i]of this._pendingTiles)i.state.type<C.FETCHED_COUNT&&this.updatingHandles.addPromise(i.process(e)),i.state.type<=C.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability((0,o.Wi)(e)?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new R(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:N,signal:t})}async _fetchFeatures(e,t,i){let s,r=0,n=0,a=t;for(;;){const l=this._createFeaturesQuery(e),h=this._setPagingParameters(l,r,a),{features:u,exceededTransferLimit:d}=await this._queryFeatures(l,i);if(h&&(r+=(0,o.Wg)(l.num)),n+=u.length,s=s?s.concat(u):u,a=t-n,!h||!d||a<=0)return s}}_filterProperties(e){return(0,o.Wi)(e)?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if((0,o.Wi)(t))throw new Error("Expected globalIdField to be defined");let s=null;if(this.store.featureStore.forEach((r=>{e===r.attributes[t]&&(s=r.objectId??r.attributes[i])})),(0,o.Wi)(s))throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery(null);return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await(0,M.executeQueryPBF)(this.url,e,new B.J({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:N,signal:t});return(0,S.lM)(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await(0,M.executeQuery)(this.url,e,i,{query:this._configuration.customParameters,timeout:N,signal:t});return(0,S.h_)(s,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e){const t=this._createBaseQuery(e);return t.outFields=this.globalIdField?[this.globalIdField,this.objectIdField]:[this.objectIdField],t.returnGeometry=!0,(0,o.pC)(e)&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new g.Z({returnZ:!1,returnM:!1,geometry:(0,o.pC)(this.tileInfo)&&(0,o.pC)(e)?(0,I.HH)(e.data.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return(0,o.pC)(i)&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=s?g.Z.MAX_MAX_RECORD_COUNT_FACTOR:1,h=l*((a||r)&&n?n:o||j);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/h)),e.num=Math.min(i,e.maxRecordCountFactor*h)):e.num=Math.min(i,h),!0}};(0,s._)([(0,h.Cb)({constructOnly:!0})],A.prototype,"url",void 0),(0,s._)([(0,h.Cb)({constructOnly:!0})],A.prototype,"objectIdField",void 0),(0,s._)([(0,h.Cb)({constructOnly:!0})],A.prototype,"globalIdField",void 0),(0,s._)([(0,h.Cb)({constructOnly:!0})],A.prototype,"capabilities",void 0),(0,s._)([(0,h.Cb)({constructOnly:!0})],A.prototype,"sourceSpatialReference",void 0),(0,s._)([(0,h.Cb)({constructOnly:!0})],A.prototype,"spatialReference",void 0),(0,s._)([(0,h.Cb)({constructOnly:!0})],A.prototype,"store",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],A.prototype,"_minimumVerticesPerFeature",null),(0,s._)([(0,h.Cb)()],A.prototype,"filter",null),(0,s._)([(0,h.Cb)()],A.prototype,"customParameters",null),(0,s._)([(0,h.Cb)({readOnly:!0})],A.prototype,"_configuration",null),(0,s._)([(0,h.Cb)()],A.prototype,"tileInfo",null),(0,s._)([(0,h.Cb)()],A.prototype,"tileSize",null),(0,s._)([(0,h.Cb)()],A.prototype,"tilesOfInterest",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],A.prototype,"updating",null),(0,s._)([(0,h.Cb)({readOnly:!0})],A.prototype,"availability",void 0),A=(0,s._)([(0,d.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],A);const j=2e3,N=6e5,P=1e6,z=25,H=1;var U=i(43090),Z=i(37549),k=i(43077);class Y{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(this._byteSize-=t.byteSize,!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[i,s]of this._store){if(this._byteSize<=e)break;this.delete(i),t(s)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}}let V=class extends v.Z{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*U.Y8.MEGABYTES,this._tileBounds=new Z.H,this._tiles=new Y,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,I.Ue)()}add(e,t){const i=[];for(const e of t)this._referenceFeature(e.objectId)===G.ADDED&&i.push(e);this._addTileStorage(e,new Set(t.map((({objectId:e})=>e))),function(e){return e.reduce(((e,t)=>e+function(e){return 32+function(e){if((0,o.Wi)(e))return 0;const t=(0,U.do)(e.lengths,4);return 32+(0,U.do)(e.coords,8)+t}(e.geometry)+(0,U.f2)(e.attributes)}(t)),0)}(t)),this.featureStore.addMany(i),this._tiles.applyByteSizeLimit(this.maximumByteSize,(e=>this._removeTileStorage(e)))}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,i){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,i)}_addTileStorage(e,t,i){this._tiles.set(e.id,new X(e,t,i)),this._tileBounds.set(e.id,e.extent),this._tileFeatureCounts.set(e.id,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)this._unreferenceFeature(i)===G.REMOVED&&t.push(i);this.featureStore.removeManyById(t);const i=e.data.id;this._tiles.delete(i),this._tileBounds.delete(i)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const i of e)t.objectIds.delete(i);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,i){const s=(await t(e,i)).features,{hasZ:r,hasM:n}=this.featureStore;for(const e of s){const t=(0,S.$)(this._tmpBoundingRect,e.geometry,r,n);(0,o.Wi)(t)||this._tileBounds.forEachInBounds(t,(t=>{const i=this._tiles.get(t);this.featureStore.add(e),i.objectIds.has(e.objectId)||(i.objectIds.add(e.objectId),this._referenceFeature(e.objectId),this._tileFeatureCounts.set(i.data.id,i.objectIds.size))}))}}process(e,t=(()=>!0)){if((0,o.Wi)(this.tileInfo)||!e.extent||(0,o.pC)(this.extent)&&!(0,I.kK)((0,I.oJ)(this.extent,this._tmpBoundingRect),e.extent))return new q(e);if(this._tiles.has(e.id))return new q(e);const i=this._createTileTree(e,this.tileInfo);return this._simplify(i,t,null,0,1),this._collectMissingTiles(e,i,this.tileInfo)}get debugInfo(){return Array.from(this._tiles.values()).map((({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,i,s){const r=this._tileFeatureCounts.get(e.id);if(null!=r)return r;const n=await(0,M.executeQueryForCount)(t,i,s);return this._tileFeatureCounts.set(e.id,n.data.count),n.data.count}_createTileTree(e,t){const i=new L(e.level,e.row,e.col);return t.updateTileInfo(i,m.Z.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,(s=>{const r=this._tiles.get(s).data;this._tilesAreRelated(e,r)&&this._populateChildren(i,r,t,this._tileFeatureCounts.get(r.id)||0)})),i}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const i=e.level<t.level,s=i?e:t,r=i?t:e,n=1<<r.level-s.level;return Math.floor(r.row/n)===s.row&&Math.floor(r.col/n)===s.col}_populateChildren(e,t,i,s){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const n=t.row>>r,a=t.col>>r,l=e.row<<1,h=a-(e.col<<1)+(n-l<<1),u=e.children[h];if((0,o.pC)(u))this._populateChildren(u,t,i,s);else{const r=new L(e.level+1,n,a);i.updateTileInfo(r,m.Z.ExtrapolateOptions.POWER_OF_TWO),e.children[h]=r,this._populateChildren(r,t,i,s)}}_simplify(e,t,i,s,r){const n=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),(0,o.pC)(i)&&(i.children[s]=null),n);const a=r/2,l=a*a;let h=0;for(let i=0;i<e.children.length;i++){const s=e.children[i];h+=(0,o.pC)(s)?this._simplify(s,t,e,i,a):l}return 0===h?this._mergeChildren(e):1-h/n<W&&(this._purge(e),(0,o.pC)(i)&&(i.children[s]=null),h=n),h}_mergeChildren(e){const t=new Set;let i=0;this._forEachLeaf(e,(e=>{const s=this._tiles.get(e.id);if(s){i+=s.byteSize;for(const e of s.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,i),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const i of e.children)(0,o.Wi)(i)||(i.isLeaf?t(i):this._forEachLeaf(i,t))}_purge(e){if(!(0,o.Wi)(e))if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const i=e.children[t];this._purge(i),e.children[t]=null}}_collectMissingTiles(e,t,i){const s=new J(i,e,this.extent);return this._collectMissingTilesRecurse(t,s,1),s.info}_collectMissingTilesRecurse(e,t,i){if(e.isLeaf)return;if(!e.hasChildren)return void t.addMissing(e.level,e.row,e.col,i);const s=i/2;for(let i=0;i<e.children.length;i++){const r=e.children[i];(0,o.Wi)(r)?t.addMissing(e.level+1,(e.row<<1)+((2&i)>>1),(e.col<<1)+(1&i),s):this._collectMissingTilesRecurse(r,t,s)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?G.ADDED:G.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),G.REMOVED):(t>0&&this._refCounts.set(e,t),G.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map((e=>`${e.data.id}:[${Array.from(e.objectIds)}]`)),featureReferences:Array.from(this._refCounts.keys()).map((e=>`${e}:${this._refCounts.get(e)}`))}}};(0,s._)([(0,h.Cb)({constructOnly:!0})],V.prototype,"featureStore",void 0),(0,s._)([(0,h.Cb)()],V.prototype,"tileInfo",void 0),(0,s._)([(0,h.Cb)()],V.prototype,"extent",void 0),(0,s._)([(0,h.Cb)()],V.prototype,"maximumByteSize",void 0),V=(0,s._)([(0,d.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],V);class X{constructor(e,t,i){this.data=e,this.objectIds=t,this.byteSize=i}}class L{constructor(e,t,i){this.level=e,this.row=t,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&((0,o.pC)(this.children[0])||(0,o.pC)(this.children[1])||(0,o.pC)(this.children[2])||(0,o.pC)(this.children[3]))}}class q{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,I.SO)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class J{constructor(e,t,i){this._tileInfo=e,this._extent=null,this.info=new q(t),(0,o.pC)(i)&&(this._extent=(0,I.oJ)(i))}addMissing(e,t,i,s){const r=new k.f(null,e,t,i);this._tileInfo.updateTileInfo(r,m.Z.ExtrapolateOptions.POWER_OF_TWO),(0,o.Wi)(r.extent)||(0,o.pC)(this._extent)&&!(0,I.kK)(this._extent,r.extent)||(this.info.missingTiles.push({data:r,resolution:s}),this.info.coveredArea-=(0,I.SO)(r.extent))}}const W=.18751;var G,Q;(Q=G||(G={}))[Q.ADDED=0]="ADDED",Q[Q.REMOVED=1]="REMOVED",Q[Q.UNCHANGED=2]="UNCHANGED";let $=class extends r.Z.EventedAccessor{constructor(){super(...arguments),this.isInitializing=!0,this.whenSetup=(0,a.dD)(),this.handles=new n.Z,this.updatingHandles=new c.t,this.pendingApplyEdits=new Map}get updating(){return this.featureFetcher.updating||this.isInitializing||this.updatingHandles.updating}destroy(){this.featureFetcher.destroy(),this.queryEngine.destroy(),this.featureStore.clear(),this.handles.destroy()}async setup(e){const{geometryType:t,objectIdField:i,timeInfo:s,fields:r}=e.serviceInfo;return this.featureStore=new _.Z({...e.serviceInfo,hasZ:!1,hasM:!1}),this.queryEngine=new f.q({spatialReference:e.spatialReference,featureStore:this.featureStore,geometryType:t,fields:r,hasZ:!1,hasM:!1,objectIdField:i,timeInfo:s?y.Z.fromJSON(s):null}),this.featureFetcher=new A({store:new V({featureStore:this.featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:p.Z.fromJSON(e.spatialReference),sourceSpatialReference:p.Z.fromJSON(e.serviceInfo.spatialReference)}),this.handles.add([(0,l.YP)((()=>this.featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),l.Z_),(0,l.YP)((()=>this.updating),(()=>this._notifyUpdating()))]),this.whenSetup.resolve(),this.isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this.updatingHandles.addPromise(this.whenSetup.promise),this._updateFeatureFetcherConfiguration(e),{result:{}}}async fetchCandidates(e,t){return await this.whenSetup.promise,(0,a.k_)(t),{result:await this.queryEngine.executeQueryForSnapping({point:e.point,distance:e.distance,types:e.types,query:(0,o.pC)(e.filter)?e.filter:{where:"1=1"}},(0,o.pC)(t)?t.signal:null)}}async updateTiles(e,t){return await this.updatingHandles.addPromise(this.whenSetup.promise),(0,a.k_)(t),this.featureFetcher.tileSize=e.tileSize,this.featureFetcher.tilesOfInterest=e.tiles,this.featureFetcher.tileInfo=(0,o.pC)(e.tileInfo)?m.Z.fromJSON(e.tileInfo):null,{result:{}}}async refresh(e,t){return await this.updatingHandles.addPromise(this.whenSetup.promise),(0,a.k_)(t),this.featureFetcher.refresh(),{result:{}}}async whenNotUpdating(e,t){return await this.updatingHandles.addPromise(this.whenSetup.promise),(0,a.k_)(t),await(0,l.N1)((()=>!this.updating),t),(0,a.k_)(t),{result:{}}}async getDebugInfo(e,t){return(0,a.k_)(t),{result:this.featureFetcher.debugInfo}}async beginApplyEdits(e,t){this.updatingHandles.addPromise(this.whenSetup.promise),(0,a.k_)(t);const i=(0,a.dD)();return this.pendingApplyEdits.set(e.id,i),this.featureFetcher.applyEdits(i.promise),this.updatingHandles.addPromise(i.promise),{result:{}}}async endApplyEdits(e,t){const i=this.pendingApplyEdits.get(e.id);return i&&i.resolve(e.edits),(0,a.k_)(t),{result:{}}}_updateFeatureFetcherConfiguration(e){this.featureFetcher.filter=(0,o.pC)(e.filter)?g.Z.fromJSON(e.filter):null,this.featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,s._)([(0,h.Cb)({readOnly:!0})],$.prototype,"updating",null),(0,s._)([(0,h.Cb)()],$.prototype,"isInitializing",void 0),$=(0,s._)([(0,d.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],$);const K=$}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1938],{43090:(e,t,i)=>{function l(e){return 32+e.length}function s(e){if(!e)return 0;let t=32;for(const i in e)if(e.hasOwnProperty(i)){const s=e[i];switch(typeof s){case"string":t+=l(s);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function r(e,t){return 32+e.length*t}var o;i.d(t,{Y8:()=>o,do:()=>r,f2:()=>s}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(o||(o={}))},16859:(e,t,i)=>{i.d(t,{I:()=>w});var l=i(43697),s=i(40330),r=i(3172),o=i(66643),a=i(20102),n=i(92604),h=i(70586),c=i(95330),p=i(17452),u=i(5600),d=(i(67676),i(80442),i(75215),i(71715)),f=i(52011),m=i(30556),v=i(65587),y=i(15235),g=i(86082);const w=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){this.portalItem?.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new y.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const l=await i.e(8062).then(i.bind(i,18062));return(0,c.k_)(t),await l.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,c.D_)(e)||n.Z.getLogger(this.declaredClass).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,c.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const i=b.credential===t?b.user:await this._fetchEditingUser(e);return b.credential=t,b.user=i,(0,h.Wi)(i)||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=s.id.findServerInfo(this.url);if(!i?.owningSystemUrl)return null;const l=`${i.owningSystemUrl}/sharing/rest`,a=v.Z.getDefault();if(a&&a.loaded&&(0,p.Fv)(a.restUrl)===(0,p.Fv)(l))return a.user;const n=`${l}/community/self`,c=(0,h.pC)(e)?e.signal:null,u=await(0,o.q6)((0,r.default)(n,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?g.default.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,l=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||v.Z.getDefault());return i&&l&&!(0,p.tm)(l.restUrl,i.restUrl)?(t.messages&&t.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,l._)([(0,u.Cb)({type:y.default})],t.prototype,"portalItem",null),(0,l._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,l._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,l._)([(0,u.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,l._)([(0,u.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,l._)([(0,f.j)("esri.layers.mixins.PortalLayer")],t),t},b={credential:null,user:null}},39450:(e,t,i)=>{i.d(t,{Z:()=>c});var l,s=i(43697),r=i(96674),o=i(5600),a=(i(67676),i(80442),i(75215)),n=i(52011);let h=l=class extends r.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new l({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,s._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"cols",void 0),(0,s._)([(0,o.Cb)({type:a.z8,json:{write:!0}})],h.prototype,"level",void 0),(0,s._)([(0,o.Cb)({type:String,json:{write:!0}})],h.prototype,"levelValue",void 0),(0,s._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"origin",void 0),(0,s._)([(0,o.Cb)({type:Number,json:{write:!0}})],h.prototype,"resolution",void 0),(0,s._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"rows",void 0),(0,s._)([(0,o.Cb)({type:Number,json:{write:!0}})],h.prototype,"scale",void 0),h=l=(0,s._)([(0,n.j)("esri.layers.support.LOD")],h);const c=h},11145:(e,t,i)=>{i.d(t,{Z:()=>z});var l,s=i(43697),r=i(35454),o=i(96674),a=i(70586),n=i(67900),h=i(5600),c=(i(67676),i(80442),i(75215)),p=i(71715),u=i(52011),d=i(30556),f=i(13473),m=i(82971),v=i(24470),y=i(8744),g=i(40488),w=i(39450),b=i(43077);const _=new r.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let S=l=class extends o.wq{constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.minScale=0,this.maxScale=0,this.size=null,this.spatialReference=null}static create(e={}){const{resolutionFactor:t=1,scales:i,size:s=256,spatialReference:r=m.Z.WebMercator,numLODs:o=24}=e;if(!(0,y.JY)(r)){const e=[];if(i)for(let t=0;t<i.length;t++){const l=i[t];e.push({level:t,scale:l,resolution:l})}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift({level:i,scale:t,resolution:t}),t*=2}return new l({dpi:96,lods:e,origin:new f.Z(0,0,r),size:[s,s],spatialReference:r})}const a=(0,y.C5)(r),h=e.origin?new f.Z({x:e.origin.x,y:e.origin.y,spatialReference:r}):new f.Z(a?{x:a.origin[0],y:a.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),c=1/(39.37*(0,n.c9)(r)*96),p=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],l=t*c;p.push({level:e,scale:t,resolution:l})}else{let e=(0,y.sT)(r)?512/s*591657527.5917094:256/s*591657527.591555;const i=Math.ceil(o/t);p.push({level:0,scale:e,resolution:e*c});for(let l=1;l<i;l++){const i=e/2**t,s=i*c;p.push({level:l,scale:i,resolution:s}),e=i}}return new l({dpi:96,lods:p,origin:h,size:[s,s],spatialReference:r})}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,y.C5)(e);return e.isWrappable&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return f.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const l=[];this._levelToLOD={},e&&(t=-1/0,i=1/0,e.forEach((e=>{l.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,this._levelToLOD[e.level]=e}))),this._set("scales",l),this._set("minScale",t),this._set("maxScale",i),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),l=i+1;return t[i]/(t[i]/t[l])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let l=0;for(;l<i;l++){const i=t[l],s=t[l+1];if(i<=e)return l;if(s===e)return l+1;if(i>e&&s<e)return l+Math.log(i/e)/Math.log(i/s)}return l}snapScale(e,t=.95){const i=this.scaleToZoom(e);return i%Math.floor(i)>=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,l){const s=this.lodAt(e);if(!s)return null;let r,o;if("number"==typeof t)r=t,o=i;else if((0,y.fS)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,l=i;else{const e=(0,g.iV)(t,this.spatialReference);if((0,a.Wi)(e))return null;r=e.x,o=e.y,l=i}const n=s.resolution*this.size[0],h=s.resolution*this.size[1];return l||(l=new b.f(null,0,0,0,(0,v.Ue)())),l.level=e,l.row=Math.floor((this.origin.y-o)/h+.001),l.col=Math.floor((r-this.origin.x)/n+.001),this.updateTileInfo(l),l}updateTileInfo(e,t=l.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===l.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const s=e.level-i.level,r=i.resolution*this.size[0]/2**s,o=i.resolution*this.size[1]/2**s;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,v.Ue)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const{resolution:i}=this.lodAt(t.level),l=i*this.size[0],s=i*this.size[1];return e[0]=this.origin.x+t.col*l,e[1]=this.origin.y-(t.row+1)*s,e[2]=e[0]+l,e[3]=e[1]+s,e}lodAt(e){return this._levelToLOD&&this._levelToLOD[e]||null}clone(){return l.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const i=[],s=this.lods.length;for(let e=0;e<s;e++){const l=this.lods[e],s=l.resolution*t;i.push(new w.Z({level:l.level,scale:l.scale,resolution:s}))}return new l({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const l=e[i];this._upsampleLevels[l.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/l.resolution:0},t=l}}};var O,T;(0,s._)([(0,h.Cb)({type:Number,json:{write:!0}})],S.prototype,"compressionQuality",void 0),(0,s._)([(0,h.Cb)({type:Number,json:{write:!0}})],S.prototype,"dpi",void 0),(0,s._)([(0,h.Cb)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],S.prototype,"format",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],S.prototype,"isWrappable",null),(0,s._)([(0,h.Cb)({type:f.Z,json:{write:!0}})],S.prototype,"origin",void 0),(0,s._)([(0,p.r)("origin")],S.prototype,"readOrigin",null),(0,s._)([(0,h.Cb)({type:[w.Z],value:null,json:{write:!0}})],S.prototype,"lods",null),(0,s._)([(0,h.Cb)({readOnly:!0})],S.prototype,"minScale",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],S.prototype,"maxScale",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],S.prototype,"scales",void 0),(0,s._)([(0,h.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],S.prototype,"size",void 0),(0,s._)([(0,p.r)("size",["rows","cols"])],S.prototype,"readSize",null),(0,s._)([(0,d.c)("size",{cols:{type:c.z8},rows:{type:c.z8}})],S.prototype,"writeSize",null),(0,s._)([(0,h.Cb)({type:m.Z,json:{write:!0}})],S.prototype,"spatialReference",void 0),S=l=(0,s._)([(0,u.j)("esri.layers.support.TileInfo")],S),(T=(O=S||(S={})).ExtrapolateOptions||(O.ExtrapolateOptions={}))[T.NONE=0]="NONE",T[T.POWER_OF_TWO=1]="POWER_OF_TWO";const z=S},43077:(e,t,i)=>{i.d(t,{f:()=>l});class l{constructor(e,t,i,l,s){this.id=e,this.level=t,this.row=i,this.col=l,this.extent=s}}},56608:(e,t,i)=>{i.d(t,{y:()=>z});var l,s=i(43697),r=i(3172),o=i(15923),a=i(43090),n=i(20102),h=i(3920),c=i(92604),p=i(13867),u=i(44553),d=i(95330),f=i(17445),m=i(1654),v=i(17452),y=i(5600),g=i(67676),w=(i(80442),i(90578)),b=i(52011),_=i(43077),S=i(22974);class O{constructor(){this.location={left:0,top:0,width:0,height:0},this._allAvailability="unknown",this.byteSize=40}getAvailability(e,t){if("unknown"!==this._allAvailability)return this._allAvailability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),l=i%8,s=i>>3,r=this._tileAvailabilityBitSet;return s<0||s>r.length?"unknown":r[s]&1<<l?"available":"unavailable"}_updateFromData(e){const t=this.location.width,i=this.location.height;let l=!0,s=!0;const r=Math.ceil(t*i/8),o=new Uint8Array(r);let a=0;for(let t=0;t<e.length;t++){const i=t%8;e[t]?(s=!1,o[a]|=1<<i):l=!1,7===i&&++a}s?this._allAvailability="unavailable":l?this._allAvailability="available":(this._allAvailability="unknown",this._tileAvailabilityBitSet=o,this.byteSize+=o.length)}static fromDefinition(e,t){const i=e.service.request||r.default,{row:l,col:s,width:o,height:a}=e,h={query:{f:"json"}};return t=t?{...h,...t}:h,i(function(e){let t;if("vector-tile"===e.service.type)t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;else{const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then((e=>e.data)).catch((e=>{if(e&&e.details&&422===e.details.httpStatus)return{location:{top:l,left:s,width:o,height:a},valid:!0,data:(0,g.a9)(o*a,0)};throw e})).then((e=>{if(e.location&&(e.location.top!==l||e.location.left!==s||e.location.width!==o||e.location.height!==a))throw new n.Z("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:l,left:s,width:o,height:a}});return O.fromJSON(e)}))}static fromJSON(e){O._validateJSON(e);const t=new O;return t.location=Object.freeze((0,S.d9)(e.location)),t._updateFromData(e.data),Object.freeze(t)}static _validateJSON(e){if(!e||!e.location)throw new n.Z("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new n.Z("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new n.Z("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new n.Z("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new n.Z("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function T(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}let z=l=class extends((0,h.p)(o.Z)){constructor(e){super(e),this._pendingTilemapRequests={},this._availableLevels={},this.levels=5,this.cacheByteSize=2*a.Y8.MEGABYTES,this.request=r.default,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new p.Z(this.cacheByteSize),this.addHandles([(0,f.YP)((()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]}),(()=>this._initializeTilemapDefinition())),(0,f.YP)((()=>this.layer?.tileInfo?.lods),(e=>this._initializeAvailableLevels(e)),f.tX)]),this._initializeTilemapDefinition()}castLevels(e){return e<=2?(c.Z.getLogger(this.declaredClass).error("Minimum levels for Tilemap is 3, but got ",e),3):e}get size(){return 1<<this.levels}fetchTilemap(e,t,i,l){if(!this._availableLevels[e])return Promise.reject(new n.Z("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const s=this._tmpTilemapDefinition,r=this._tilemapFromCache(e,t,i,s);if(r)return Promise.resolve(r);const o=l&&l.signal;return l={...l,signal:null},new Promise(((e,t)=>{(0,d.fu)(o,(()=>t((0,d.zE)())));const i=T(s);let r=this._pendingTilemapRequests[i];if(!r){r=O.fromDefinition(s,l).then((e=>(this._tilemapCache.put(i,e,e.byteSize),e)));const e=()=>delete this._pendingTilemapRequests[i];this._pendingTilemapRequests[i]=r,r.then(e,e)}r.then(e,t)}))}getAvailability(e,t,i){if(!this._availableLevels[e])return"unavailable";const l=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return l?l.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,l){return this._availableLevels[e]?this.fetchTilemap(e,t,i,l).catch((e=>e)).then((l=>{if(l instanceof O){const s=l.getAvailability(t,i);if("unavailable"===s)throw new n.Z("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return s}if((0,d.D_)(l))throw l;return"unknown"})):Promise.reject(new n.Z("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`))}fetchAvailabilityUpsample(e,t,i,l,s){l.level=e,l.row=t,l.col=i;const r=this.layer.tileInfo;r.updateTileInfo(l);const o=this.fetchAvailability(e,t,i,s).catch((e=>{if((0,d.D_)(e))throw e;if(r.upsampleTile(l))return this.fetchAvailabilityUpsample(l.level,l.row,l.col,l);throw e}));return this._fetchAvailabilityUpsamplePrefetch(l.id,e,t,i,s,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,i,s,r,o){if(!this._prefetchingEnabled)return;const a=`prefetch-${e}`;if(this.handles.has(a))return;const n=new AbortController;o.then((()=>n.abort()),(()=>n.abort()));let h=!1;const c={remove(){h||(h=!0,n.abort())}};if(this.handles.add(c,a),await(0,m.MU)(10,n.signal).catch((()=>{})),h||(h=!0,this.handles.remove(a)),(0,d.Hc)(n))return;const p=new _.f(e,t,i,s),u={...r,signal:n.signal},f=this.layer.tileInfo;for(let e=0;l._prefetches.length<l._maxPrefetch&&f.upsampleTile(p);++e){const e=this.fetchAvailability(p.level,p.row,p.col,u);l._prefetches.push(e);const t=()=>{l._prefetches.removeUnordered(e)};e.then(t,t)}}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,v.B7)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request,type:this.layer.type},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,l){l.level=e,l.row=t-t%this.size,l.col=i-i%this.size;const s=T(l);return this._tilemapCache.get(s)}_initializeAvailableLevels(e){this._availableLevels={},e&&e.forEach((e=>this._availableLevels[e.level]=!0))}get test(){const e=this;return{get prefetchingEnabled(){return e._prefetchingEnabled},set prefetchingEnabled(t){e._prefetchingEnabled=t},hasTilemap:(t,i,l)=>!!e._tilemapFromCache(t,i,l,e._tmpTilemapDefinition)}}};z._maxPrefetch=4,z._prefetches=new u.Z({initialSize:l._maxPrefetch}),(0,s._)([(0,y.Cb)({constructOnly:!0,type:Number})],z.prototype,"levels",void 0),(0,s._)([(0,w.p)("levels")],z.prototype,"castLevels",null),(0,s._)([(0,y.Cb)({readOnly:!0,type:Number})],z.prototype,"size",null),(0,s._)([(0,y.Cb)({constructOnly:!0,type:Number})],z.prototype,"cacheByteSize",void 0),(0,s._)([(0,y.Cb)({constructOnly:!0})],z.prototype,"layer",void 0),(0,s._)([(0,y.Cb)({constructOnly:!0})],z.prototype,"request",void 0),z=l=(0,s._)([(0,b.j)("esri.layers.support.TilemapCache")],z)},45322:(e,t,i)=>{i.d(t,{d:()=>r,h:()=>s});var l=i(11145);const s={type:l.Z,json:{origins:{service:{read:{source:["tileInfo","minScale","maxScale","minLOD","maxLOD"],reader:r}}}}};function r(e,t,i,s){if(!e)return null;const{minScale:r,maxScale:o,minLOD:a,maxLOD:n}=t;if(null!=a&&null!=n)return s&&s.ignoreMinMaxLOD?l.Z.fromJSON(e):l.Z.fromJSON({...e,lods:e.lods.filter((({level:e})=>null!=e&&e>=a&&e<=n))});if(0!==r&&0!==o){const t=e=>Math.round(1e4*e)/1e4,i=r?t(r):1/0,s=o?t(o):-1/0;return l.Z.fromJSON({...e,lods:e.lods.filter((e=>{const l=t(e.scale);return l<=i&&l>=s}))})}return l.Z.fromJSON(e)}}}]);