@arcgis/core 4.25.0-next.20221021 → 4.25.0-next.20221022
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.
- package/WebMap.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0b0f3e93f658a012d5f0.js → 00df1053d3a8761fc0a3.js} +1 -1
- package/assets/esri/core/workers/chunks/0de7eca7acf74947cf2e.js +1 -0
- package/assets/esri/core/workers/chunks/{2474f0e8b8abc1387106.js → 2600954826b42f2b70c4.js} +1 -1
- package/assets/esri/core/workers/chunks/{af3f30f968363bb3930c.js → 353c4a51be72c4a77e1f.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d8201f0f33ba66bb96b.js → 5f46751fa500a9dfacf9.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9e93d9ea80361716f1d.js → 64190294f3dc9237b420.js} +1 -1
- package/assets/esri/core/workers/chunks/{883cfe319b15ebabf71e.js → 73ad8f3d3feff5882988.js} +1 -1
- package/assets/esri/core/workers/chunks/{177c8d5e2531c6f64581.js → 796504f93100aea7c6f5.js} +1 -1
- package/assets/esri/core/workers/chunks/8435ae4fe5a5332b1076.js +1 -0
- package/assets/esri/core/workers/chunks/{c8c0f091aab41e4effa5.js → 85690fabbfe60681f5e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{942da417257f8fd8e4cf.js → 858970a88406562a26cc.js} +1 -1
- package/assets/esri/core/workers/chunks/a17d20ffaa47d430d98c.js +1 -0
- package/assets/esri/core/workers/chunks/ac2903c5f1587dec2f80.js +1 -0
- package/assets/esri/core/workers/chunks/{7ba0cfe4d1c214f44fc7.js → b6d9750b16bbf8ce5307.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f40f4ac6e2af4b333f5.js → c4e5b929b152f8d36cc3.js} +1 -1
- package/assets/esri/core/workers/chunks/c7de993c0a85594a1969.js +1 -0
- package/assets/esri/core/workers/chunks/ca92022f53080fda75fe.js +1 -0
- package/assets/esri/core/workers/chunks/d7668e81467833a5a53d.js +1 -0
- package/assets/esri/core/workers/chunks/de83b062359c0459585f.js +1 -0
- package/assets/esri/core/workers/chunks/f57c3343f93d87423856.js +1 -0
- package/assets/esri/core/workers/chunks/f704ed07c514a0f436ec.js +1 -0
- package/assets/esri/themes/base/_color.scss +1 -0
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +58 -14
- package/assets/esri/themes/base/widgets/_LayerList.scss +57 -13
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/geometry/support/normalizeUtils.js +1 -1
- package/interfaces.d.ts +109 -6
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/Rasterizer.js +1 -1
- package/symbols/cim/rasterizingUtils.js +5 -0
- package/views/2d/engine/brushes.js +1 -1
- package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
- package/views/2d/engine/vtlBrushes.js +5 -0
- package/views/2d/engine/webgl/mesh/bufcut.js +1 -1
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/FeatureForm/FormExpressionArcadeExecutor.js +1 -1
- package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/LayerList/ListItem.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/assets/esri/core/workers/chunks/0cfb97b9f38c31b3b33a.js +0 -1
- package/assets/esri/core/workers/chunks/2a63949c3aad9ace1b44.js +0 -1
- package/assets/esri/core/workers/chunks/3b5be512567d9c1c6fe6.js +0 -1
- package/assets/esri/core/workers/chunks/4450f17444947fe2f27f.js +0 -1
- package/assets/esri/core/workers/chunks/5abda500f5d5607155ab.js +0 -1
- package/assets/esri/core/workers/chunks/81139c01e8016cbbe324.js +0 -1
- package/assets/esri/core/workers/chunks/94027976cfca4ad5789b.js +0 -1
- package/assets/esri/core/workers/chunks/9d410721f42259efe666.js +0 -1
- package/assets/esri/core/workers/chunks/b17ff3dfdc638f9f5705.js +0 -1
- package/assets/esri/core/workers/chunks/d6eb078d94171fb9d3d4.js +0 -1
- package/rest/geometry/cut.js +0 -5
- package/rest/geometry/simplify.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9777,3172,9880],{99880:(e,t,s)=>{s.d(t,{V:()=>l});var i=s(68773),r=(s(3172),s(20102)),n=s(92604),a=s(17452);const o=n.Z.getLogger("esri.assets");function l(e){if(!i.Z.assetsPath)throw o.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new r.Z("assets:path-not-set","config.assetsPath is not set");return(0,a.v_)(i.Z.assetsPath,e)}},74669:(e,t,s)=>{s.d(t,{Z:()=>r});var i=s(69801);class r{constructor(e,t){this._storage=new i.WJ,this._storage.maxSize=e,t&&this._storage.registerRemoveFunc("",t)}put(e,t){this._storage.put(e,t,1,1)}pop(e){return this._storage.pop(e)}get(e){return this._storage.get(e)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}}},37455:(e,t,s)=>{s.d(t,{N:()=>i});const i={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,s){const i=new r(e.getPointX(t),e.getPointY(t),s),n=e.hasZ(t),a=e.hasM(t);return n&&(i.z=e.getPointZ(t)),a&&(i.m=e.getPointM(t)),i},exportPolygon:function(e,t,s){return new n(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,s){return new a(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,s){return new o(e.exportPoints(t),s,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,s){const i=e.hasZ(t),r=e.hasM(t),n=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),s);if(i){const s=e.getZExtent(t);n.zmin=s.vmin,n.zmax=s.vmax}if(r){const s=e.getMExtent(t);n.mmin=s.vmin,n.mmax=s.vmax}return n}};class r{constructor(e,t,s){this.x=e,this.y=t,this.spatialReference=s,this.z=void 0,this.m=void 0}}class n{constructor(e,t,s,i){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class a{constructor(e,t,s,i){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class o{constructor(e,t,s,i){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class l{constructor(e,t,s,i,r){this.xmin=e,this.ymin=t,this.xmax=s,this.ymax=i,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},24470:(e,t,s)=>{s.d(t,{Gv:()=>x,HH:()=>u,SO:()=>h,Ue:()=>n,al:()=>o,cS:()=>p,fS:()=>y,jE:()=>d,jn:()=>c,kK:()=>f,oJ:()=>l,r3:()=>m}),s(80442),s(22021);var i=s(70586),r=s(6570);function n(e=w){return[e[0],e[1],e[2],e[3]]}function a(e,t){return e!==t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e}function o(e,t,s,i,r=n()){return r[0]=e,r[1]=t,r[2]=s,r[3]=i,r}function l(e,t=n()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function u(e,t){return new r.Z({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:t})}function c(e,t,s){if((0,i.Wi)(t))a(s,e);else if("length"in t)g(t)?(s[0]=Math.min(e[0],t[0]),s[1]=Math.min(e[1],t[1]),s[2]=Math.max(e[2],t[2]),s[3]=Math.max(e[3],t[3])):2!==t.length&&3!==t.length||(s[0]=Math.min(e[0],t[0]),s[1]=Math.min(e[1],t[1]),s[2]=Math.max(e[2],t[0]),s[3]=Math.max(e[3],t[1]));else switch(t.type){case"extent":s[0]=Math.min(e[0],t.xmin),s[1]=Math.min(e[1],t.ymin),s[2]=Math.max(e[2],t.xmax),s[3]=Math.max(e[3],t.ymax);break;case"point":s[0]=Math.min(e[0],t.x),s[1]=Math.min(e[1],t.y),s[2]=Math.max(e[2],t.x),s[3]=Math.max(e[3],t.y)}}function h(e){return function(e){return(0,i.Wi)(e)||e[0]>=e[2]?0:e[2]-e[0]}(e)*function(e){return e[1]>=e[3]?0:e[3]-e[1]}(e)}function d(e,t,s){return t>=e[0]&&s>=e[1]&&t<=e[2]&&s<=e[3]}function f(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function m(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function p(e){return e?a(e,x):n(x)}function g(e){return null!=e&&4===e.length}function y(e,t){return g(e)&&g(t)?e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]:e===t}const x=[1/0,1/0,-1/0,-1/0],w=[0,0,0,0]},69285:(e,t,s)=>{s.d(t,{k:()=>a});var i=s(70586),r=s(67900),n=s(8744);function a(e,t,s){if((0,i.Wi)(t)||(0,i.Wi)(s)||s.vcsWkid||(0,n.fS)(t,s))return null;const a=(0,r._R)(t)/(0,r._R)(s);if(1===a)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){e&&null!=e.z&&(e.z*=t)}(e,a);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const s of e.paths)for(const e of s)e.length>2&&(e[2]*=t)}(e,a);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const s of e.rings)for(const e of s)e.length>2&&(e[2]*=t)}(e,a);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const s of e.points)s.length>2&&(s[2]*=t)}(e,a);case"extent":case"esriGeometryExtent":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,a);default:return null}}},26993:(e,t,s)=>{s.d(t,{y:()=>w,r:()=>m});var i=s(70586),r=s(35308),n=s(49600),a=s(82397),o=s(8744),l=s(62432),u=s(24452);class c{constructor(e,t,s){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=s,this.featureAdapter=t;const i=e.outFields;if(i&&!i.includes("*")){this.outFields=i;let e=0;for(const t of i){const i=(0,l.hr)(t),r=this.fieldsIndex.get(i),n=r?null:(0,l.Jc)(i,s),a=r?r.name:(0,l.nu)(t)||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:n})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach((e=>this.getAttributes(e))),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,s){const i=s?s.name:t;let r=null;return this._fieldDataCache.has(i)?r=this._fieldDataCache.get(i).clause:s||(r=(0,l.Jc)(t,this.fieldsIndex),this._fieldDataCache.set(i,{alias:i,clause:r})),s?this.featureAdapter.getAttribute(e,i):r.calculateValue(e,this.featureAdapter)}getDataValue(e,t){const s=t.normalizationType,i=t.normalizationTotal;let r=this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2&&(r=`${(0,u.wk)(r)}${t.fieldDelimiter}${(0,u.wk)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(r=`${r}${t.fieldDelimiter}${(0,u.wk)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)),s&&Number.isFinite(r)){const n=this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField));r=(0,u.fk)(r,s,n,i)}return r}getExpressionValue(e,t,s,i){const r={attributes:this.featureAdapter.getAttributes(e),layer:{fields:this.fieldsIndex.fields}},n=i.createExecContext(r,s);return i.executeFunction(t,n)}getExpressionValues(e,t,s,i){const r={fields:this.fieldsIndex.fields};return e.map((e=>{const n={attributes:this.featureAdapter.getAttributes(e),layer:r},a=i.createExecContext(n,s);return i.executeFunction(t,a)}))}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,l.Jc)(t,this.fieldsIndex)}),this._fieldDataCache.get(t).clause.testFeature(e,this.featureAdapter)}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,l.Jc)(t,this.fieldsIndex)}),this._fieldDataCache.get(t).clause.testSet(e,this.featureAdapter)}_processAttributesForOutFields(e){const t=this.outFields;if(!t||!t.length)return this.featureAdapter.getAttributes(e);const s={};for(const i of t){const{alias:t,clause:r}=this._fieldDataCache.get(i);s[t]=r?r.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return s}_processAttributesForDistinctValues(e){if((0,i.Wi)(e)||!this.returnDistinctValues)return e;const t=this.outFields,s=[];if(t)for(const i of t){const{alias:t}=this._fieldDataCache.get(i);s.push(e[t])}else for(const t in e)s.push(e[t]);const r=`${(t||["*"]).join(",")}=${s.join(",")}`;let n=this._returnDistinctMap.get(r)||0;return this._returnDistinctMap.set(r,++n),n>1?null:e}}var h=s(37427);function d(e,t,s){return{objectId:e,target:t,distance:s,type:"vertex"}}function f(e,t,s,i,r,n=!1){return{objectId:e,target:t,distance:s,type:"edge",start:i,end:r,draped:n}}var m,p,g=s(11490),y=s(35671),x=s(59266);class w{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new c(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,r=t?.length;if(!r)return 1;const n=new Map,a=new Map,o=new Set;for(const r of i){const{statisticType:i}=r,l="exceedslimit"!==i?r.onStatisticField:void 0;if(!a.has(l)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,n);s.push(t)}a.set(l,this._calculateUniqueValues(s,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:i,items:r}=u[t],n=i.join(",");s&&!e.validateItems(r,s)||o.add(n)}}return o.size}async createQueryResponse(){let e;return e=this.query.outStatistics?this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry&&((0,o.JY)(this.query.outSR)&&!(0,o.fS)(this.query.geometry.spatialReference,this.query.outSR)?e.queryGeometry=(0,g.S2)({spatialReference:this.query.outSR,...(0,h.iV)(this.query.geometry,this.query.geometry.spatialReference,this.query.outSR)}):e.queryGeometry=(0,g.S2)({spatialReference:this.query.outSR,...this.query.geometry})),e}createSnappingResponse(e,t){const s=this.featureAdapter,r=function(e,t){return e?t?4:3:t?3:2}(this.hasZ,this.hasM),{point:n}=e,a="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c=null!=n.z,h=null!=n.m,p=this._getPointCreator(n,c,h,this.spatialReference,t),g=new b(null,0),y=new b(null,0),x={x:0,y:0,z:0};for(const t of this.items){const c=s.getGeometry(t);if((0,i.Wi)(c))continue;const{coords:h,lengths:w}=c;if(g.coords=h,y.coords=h,e.types&m.EDGE){let e=0;for(let i=0;i<w.length;i++){const u=w[i];for(let i=0;i<u;i++,e+=r){const c=g;if(c.coordsIndex=e,i!==u-1){const i=y;i.coordsIndex=e+r;const u=x;v(x,n,c,i);const h=(n.x-u.x)/a,d=(n.y-u.y)/o,m=h*h+d*d;m<=1&&l.candidates.push(f(s.getObjectId(t),p(u),Math.sqrt(m),p(c),p(i)))}}}}if(e.types&m.VERTEX){const e=u?h.length-r:h.length;for(let i=0;i<e;i+=r){const e=g;e.coordsIndex=i;const r=(n.x-e.x)/a,u=(n.y-e.y)/o,c=r*r+u*u;c<=1&&l.candidates.push(d(s.getObjectId(t),p(e),Math.sqrt(c)))}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,s,r,n){const a=(0,i.pC)(n)&&!(0,o.fS)(r,n)?e=>(0,h.iV)(e,r,n):e=>e,{hasZ:l}=this,u=e.m;return t&&s?l?({x:e,y:t,z:s})=>a({x:e,y:t,z:s,m:u}):({x:e,y:t})=>a({x:e,y:t,z:0,m:u}):t?l?({x:e,y:t,z:s})=>a({x:e,y:t,z:s}):({x:e,y:t})=>a({x:e,y:t,z:0}):s?({x:e,y:t})=>a({x:e,y:t,m:u}):({x:e,y:t})=>a({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,minValue:a,maxValue:o,scale:l}=e,c=this.fieldsIndex.isDateField(t),h=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:l}),d=(0,u.S5)({normalizationType:r,normalizationField:i,minValue:a,maxValue:o}),f=this.fieldsIndex.get(t),m={value:.5,fieldType:f?.type},p=(0,y.qN)(f)?(0,u.H0)({values:h,supportsNullCount:d,percentileParams:m}):(0,u.i5)({values:h,minValue:a,maxValue:o,useSampleStdDev:!r,supportsNullCount:d,percentileParams:m});return(0,u.F_)(p,c)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:r,scale:n}=e,a=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:n}),o=(0,u.eT)(a);return(0,u.Qm)(o,i,r,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:c,numClasses:h,scale:d}=e,f=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:d}),m=(0,u.G2)(f,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:c,numClasses:h});return(0,u.DL)(m,a)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:c,numBins:h,scale:d}=e,f=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:d});return(0,u.oF)(f,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:c,numBins:h})}_sortFeatures(e,t,s){if(e.length>1&&t&&t.length)for(const i of t.reverse()){const t=i.split(" "),r=t[0],n=this.fieldsIndex.get(r),a=t[1]&&"desc"===t[1].toLowerCase(),o=(0,u.Lq)(n?.type,a);e.sort(((e,t)=>{const i=s(e,r,n),a=s(t,r,n);return o(i,a)}))}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:r,objectIdField:n,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:h,resultOffset:d,returnZ:f,returnM:m}=e,p=null!=h&&t.length>(d||0)+h,y=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:p,features:this._createFeatures(e,t),fields:y,geometryType:s,hasM:i&&m,hasZ:r&&f,objectIdFieldName:n,spatialReference:(0,g.S2)(u||o),transform:c&&(0,a.vY)(c)||null}}_createFeatures(e,t){const s=new c(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:r}=this,{orderByFields:n,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:h,resultOffset:d,resultRecordCount:f,returnZ:m=!1,returnM:p=!1}=e,y=r&&m,x=i&&p;let w=[],v=0;const b=[...t];if(this._sortFeatures(b,n,((e,t,i)=>s.getFieldValue(e,t,i))),l||u){const e=(0,a.vY)(o);if(l&&!u)for(const t of b)w[v++]={attributes:s.getAttributes(t),geometry:(0,g.Op)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),h,e,y,x)};else if(!l&&u)for(const t of b)w[v++]={attributes:s.getAttributes(t),centroid:(0,g.EG)(this,this.featureAdapter.getCentroid(t,this),e)};else for(const t of b)w[v++]={attributes:s.getAttributes(t),centroid:(0,g.EG)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,g.Op)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),h,e,y,x)}}else for(const e of b){const t=s.getAttributes(e);t&&(w[v++]={attributes:t})}const S=d||0;if(null!=f){const e=S+f;w=w.slice(S,Math.min(w.length,e))}return w}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;for(const t of e.outStatistics)if("exceedslimit"===t.statisticType){s=null!=t.maxPointCount?t.maxPointCount:Number.POSITIVE_INFINITY,r=null!=t.maxRecordCount?t.maxRecordCount:Number.POSITIVE_INFINITY,n=null!=t.maxVertexCount?t.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)t=this.items.length>s;else if(this.items.length>r)t=!0;else{const e=this.hasZ?this.hasM?4:3:this.hasM?3:2,s=this.featureAdapter;t=this.items.reduce(((e,t)=>{const r=s.getGeometry(t);return e+((0,i.pC)(r)&&r.coords.length||0)}),0)/e>n}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,r=new Map,n=new Map,a=new Map,o=new c(e,this.featureAdapter,this.fieldsIndex),l=e.outStatistics,{groupByFieldsForStatistics:u,having:h,orderByFields:d}=e,f=u&&u.length,m=!!f,p=m&&u[0],g=m&&!this.fieldsIndex.get(p);for(const e of l){const{outStatisticFieldName:l,statisticType:c}=e,d=e,y="exceedslimit"!==c?e.onStatisticField:void 0,x="percentile_disc"===c||"percentile_cont"===c,w="EnvelopeAggregate"===c||"CentroidAggregate"===c||"ConvexHullAggregate"===c,v=m&&1===f&&(y===p||g)&&"count"===c;if(m){if(!n.has(y)){const e=[];for(const t of u){const s=this._getAttributeValues(o,t,i);e.push(s)}n.set(y,this._calculateUniqueValues(e,o.returnDistinctValues))}const e=n.get(y);for(const t in e){const{count:s,data:r,items:n,itemPositions:c}=e[t],f=r.join(",");if(!h||o.validateItems(n,h)){const e=a.get(f)||{attributes:{}};if(w){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:s}=await this._getAggregateGeometry(d,n);e.aggregateGeometries[s]=t}else{let t=null;if(v)t=s;else{const e=this._getAttributeValues(o,y,i),s=c.map((t=>e[t]));t=x&&"statisticParameters"in d?this._getPercentileValue(d,s):this._getStatisticValue(d,s,null,o.returnDistinctValues)}e.attributes[l]=t}u.forEach(((t,s)=>e.attributes[this.fieldsIndex.get(t)?t:`EXPR_${s+1}`]=r[s])),a.set(f,e)}}}else if(w){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(d,this.items);t.aggregateGeometries[s]=e}else{const e=this._getAttributeValues(o,y,i);t.attributes[l]=x&&"statisticParameters"in d?this._getPercentileValue(d,e):this._getStatisticValue(d,e,r,o.returnDistinctValues)}s.push({name:l,alias:l,type:"esriFieldTypeDouble"})}const y=m?Array.from(a.values()):[t];return this._sortFeatures(y,d,((e,t)=>e.attributes[t])),{fields:s,features:y}}async _getAggregateGeometry(e,t){const i=await Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247)),{statisticType:a,outStatisticFieldName:o}=e,{featureAdapter:l,spatialReference:u,geometryType:c,hasZ:h,hasM:d}=this,f=t.map((e=>(0,g.Op)(c,h,d,l.getGeometry(e)))),m=i.convexHull(u,f,!0)[0],p={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===a){const e=m?(0,n._w)(m):(0,n.aO)(i.union(u,f));p.aggregateGeometries={...e,spatialReference:u},p.outStatisticFieldName=o||"extent"}else if("CentroidAggregate"===a){const e=m?(0,r.tO)(m):(0,r.$G)((0,n.aO)(i.union(u,f)));p.aggregateGeometries={x:e[0],y:e[1],spatialReference:u},p.outStatisticFieldName=o||"centroid"}else"ConvexHullAggregate"===a&&(p.aggregateGeometries=m,p.outStatisticFieldName=o||"convexHull");return p}_getStatisticValue(e,t,s,i){const{onStatisticField:r,statisticType:n}=e;let a=null;return a=s?.has(r)?s.get(r):(0,y.qN)(this.fieldsIndex.get(r))?(0,u.H0)({values:t,returnDistinct:i}):(0,u.i5)({values:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(r,a),a["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:r}=e,{value:n,orderBy:a}=i,o=this.fieldsIndex.get(s);return(0,u.XL)(t,{value:n,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===r})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),r=this.items.map((s=>e.getFieldValue(s,t,i)));return s.set(t,r),r}_getAttributeDataValues(e,t){return this.items.map((s=>e.getDataValue(s,{field:t.field,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,normalizationField:t.normalizationField,normalizationType:t.normalizationType,normalizationTotal:t.normalizationTotal})))}async _getAttributeExpressionValues(e,t,s){const{arcadeUtils:i}=await(0,x.LC)(),r=i.createFunction(t),n=s&&i.getViewInfo(s);return e.getExpressionValues(this.items,r,n,i)}_calculateUniqueValues(e,t){const s={},i=this.items,r=i.length;for(let n=0;n<r;n++){const r=i[n],a=[];for(const t of e)a.push(t[n]);const o=a.join(",");t?null==s[o]&&(s[o]={count:1,data:a,items:[r],itemPositions:[n]}):null==s[o]?s[o]={count:1,data:a,items:[r],itemPositions:[n]}:(s[o].count++,s[o].items.push(r),s[o].itemPositions.push(n))}return s}async _getDataValues(e){const t=new c(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:s,field:i,normalizationField:r,normalizationType:n,normalizationTotal:a,scale:o}=e,l=s?{viewingMode:"map",scale:o,spatialReference:this.query.outSR||this.spatialReference}:null;return s?this._getAttributeExpressionValues(t,s,l):this._getAttributeDataValues(t,{field:i,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,normalizationField:r,normalizationType:n,normalizationTotal:a})}}function v(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,a=r*r+n*n,o=(t.x-s.x)*r+(t.y-s.y)*n,l=Math.min(1,Math.max(0,o/a));e.x=s.x+r*l,e.y=s.y+n*l}(p=m||(m={}))[p.NONE=0]="NONE",p[p.EDGE=1]="EDGE",p[p.VERTEX=2]="VERTEX";class b{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}},62432:(e,t,s)=>{s.d(t,{nu:()=>p,hr:()=>m,Jc:()=>d,G3:()=>g,Of:()=>f,z4:()=>h,hO:()=>c});var i=s(20102),r=s(74669),n=s(41534);const a=new class{constructor(e,t){this._cache=new r.Z(e),this._invalidCache=new r.Z(t)}get(e,t){const s=`${t.uid}:${e}`,i=this._cache.get(s);if(i)return i;if(void 0!==this._invalidCache.get(s))return null;try{const i=n.WhereClause.create(e,t);return this._cache.put(s,i),i}catch{return this._invalidCache.put(s,null),null}}}(50,500),o="feature-store:unsupported-query",l=" as ",u=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeDate"]);function c(e,t){if(!t)return!0;const s=a.get(t,e);if(!s)throw new i.Z(o,"invalid SQL expression",{where:t});if(!s.isStandardized)throw new i.Z(o,"where clause is not standard",{where:t});return f(e,s.fieldNames,"where clause contains missing fields"),!0}function h(e,t,s){if(!t)return!0;const r=a.get(t,e);if(!r)throw new i.Z(o,"invalid SQL expression",{having:t});if(!r.isAggregate)throw new i.Z(o,"having does not contain a valid aggregate function",{having:t});const n=r.fieldNames;if(f(e,n,"having contains missing fields"),!r.getExpressions().every((t=>{const{aggregateType:i,field:r}=t,n=e.has(r)&&e.get(r).name;return s.some((t=>{const{onStatisticField:s,statisticType:r}=t;return(e.has(s)&&e.get(s).name)===n&&r.toLowerCase().trim()===i}))})))throw new i.Z(o,"expressions in having should also exist in outStatistics",{having:t});return!0}function d(e,t){return e?a.get(e,t):null}function f(e,t,s,r=!0){const n=[];for(const s of t)if("*"!==s&&!e.has(s))if(r){const t=m(s);try{const s=d(t,e);if(!s)throw new i.Z(o,"invalid SQL expression",{where:t});if(!s.isStandardized)throw new i.Z(o,"expression is not standard",{clause:s});f(e,s.fieldNames,"expression contains missing fields")}catch(e){const t=e&&e.details;if(t&&(t.clause||t.where))throw e;t&&t.missingFields?n.push(...t.missingFields):n.push(s)}}else n.push(s);if(n.length)throw new i.Z(o,s,{missingFields:n})}function m(e){return e.split(l)[0]}function p(e){return e.split(l)[1]}function g(e,t){const s=t.get(e);return!!s&&!u.has(s.type)}},37427:(e,t,s)=>{s.d(t,{_W:()=>d,iV:()=>p,oj:()=>y});var i=s(70586),r=s(44547),n=s(37455),a=s(8744),o=s(40488);const l=[0,0];function u(e,t){if(!t)return null;if("x"in t){const s={x:0,y:0};return[s.x,s.y]=e(t.x,t.y,l),null!=t.z&&(s.z=t.z),null!=t.m&&(s.m=t.m),s}if("xmin"in t){const s={xmin:0,ymin:0,xmax:0,ymax:0};return[s.xmin,s.ymin]=e(t.xmin,t.ymin,l),[s.xmax,s.ymax]=e(t.xmax,t.ymax,l),t.hasZ&&(s.zmin=t.zmin,s.zmax=t.zmax,s.hasZ=!0),t.hasM&&(s.mmin=t.mmin,s.mmax=t.mmax,s.hasM=!0),s}return"rings"in t?{rings:c(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:c(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:h(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function c(e,t){const s=[];for(const i of e)s.push(h(i,t));return s}function h(e,t){const s=[];for(const i of e){const e=t(i[0],i[1],[0,0]);s.push(e),i.length>2&&e.push(i[2]),i.length>3&&e.push(i[3])}return s}async function d(e,t){if(!e||!t)return;const s=Array.isArray(e)?e.map((e=>(0,i.pC)(e.geometry)?e.geometry.spatialReference:null)).filter(i.pC):[e];await(0,r.iQ)(s.map((e=>({source:e,dest:t}))))}const f=u.bind(null,o.hG),m=u.bind(null,o.R6);function p(e,t,s,i){if(!e)return e;if(s||(s=t,t=e.spatialReference),!(0,a.JY)(t)||!(0,a.JY)(s)||(0,a.fS)(t,s))return e;if((0,o.Q8)(t,s)){const t=(0,a.sS)(s)?f(e):m(e);return t.spatialReference=s,t}return(0,r.oj)(n.N,[e],t,s,null,i)[0]}const g=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,s){if(!e||!e.length||!t||!s||(0,a.fS)(t,s))return e;const i={geometries:e,inSpatialReference:t,outSpatialReference:s,resolve:null};return this._jobs.push(i),new Promise((e=>{i.resolve=e,null===this._timer&&(this._timer=setTimeout(this._process,10))}))}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:s,outSpatialReference:i,resolve:l}=e;(0,o.Q8)(s,i)?(0,a.sS)(i)?l(t.map(f)):l(t.map(m)):l((0,r.oj)(n.N,t,s,i,null,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function y(e,t,s){return g.push(e,t,s)}},11490:(e,t,s)=>{s.d(t,{EG:()=>v,Op:()=>b,S2:()=>F,Up:()=>S,j6:()=>T,vF:()=>p});var i=s(35454),r=s(70586),n=s(67900),a=s(44547),o=s(49600),l=s(33955),u=s(82526),c=s(8744),h=s(98732),d=s(5428),f=s(37427);const m=new i.X({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),p=Object.freeze({}),g=new d.Z,y=new d.Z,x=new d.Z,w={esriGeometryPoint:h.fQ,esriGeometryPolyline:h.J6,esriGeometryPolygon:h.eG,esriGeometryMultipoint:h.Iv};function v(e,t,s,i=e.hasZ,n=e.hasM){if((0,r.Wi)(t))return null;const a=e.hasZ&&i,o=e.hasM&&n;if(s){const r=(0,h.Nh)(x,t,e.hasZ,e.hasM,"esriGeometryPoint",s,i,n);return(0,h.fQ)(r,a,o)}return(0,h.fQ)(t,a,o)}function b(e,t,s,i,n,a,o=t,l=s){const u=t&&o,c=s&&l,d=(0,r.pC)(i)?"coords"in i?i:i.geometry:null;if((0,r.Wi)(d))return null;if(n){let i=(0,h.zj)(y,d,t,s,e,n,o,l);return a&&(i=(0,h.Nh)(x,i,u,c,e,a)),w[e]?.(i,u,c)??null}if(a){const i=(0,h.Nh)(x,d,t,s,e,a,o,l);return w[e]?.(i,u,c)??null}return(0,h.hY)(g,d,t,s,o,l),w[e]?.(g,u,c)??null}async function S(e,t,s){const{outFields:i,orderByFields:r,groupByFieldsForStatistics:n,outStatistics:a}=e;if(i)for(let e=0;e<i.length;e++)i[e]=i[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),T(e,t,s)}async function T(e,t,i){if(!e)return null;let{where:a}=e;if(e.where=a=a&&a.trim(),(!a||/^1 *= *1$/.test(a)||t&&t===a)&&(e.where=null),!e.geometry)return e;let h=await async function(e){const{distance:t,units:i}=e,r=e.geometry;if(null==t||"vertexAttributes"in r)return r;const a=r.spatialReference,o=i?m.fromJSON(i):(0,n.qE)(a),l=a&&((0,c.sT)(a)||(0,c.sS)(a))?r:await(0,f._W)(a,c.Zn).then((()=>(0,f.iV)(r,c.Zn)));return(await async function(){return(await Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247))).geodesicBuffer}())(l.spatialReference,l,t,o)}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;h=(0,o.aO)(h),h.spatialReference=t}if(h){await(0,f._W)(h.spatialReference,i),h=function(e,t){const s=e.spatialReference;return _(e,t)&&(0,l.YX)(e)?{spatialReference:s,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(h,i);const t=(await(0,u.aX)((0,l.im)(h)))[0];if((0,r.Wi)(t))throw p;const s="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,n=s&&_(h,i)?{densificationStep:8*s}:void 0,a=t.toJSON(),o=await(0,f.iV)(a,a.spatialReference,i,n);if(!o)throw p;o.spatialReference=i,e.geometry=o}return e}function _(e,t){if(!e)return!1;const s=e.spatialReference;return((0,l.YX)(e)||(0,l.oU)(e)||(0,l.l9)(e))&&!(0,c.fS)(s,t)&&!(0,a.Up)(s,t)}function F(e){return e&&I in e?JSON.parse(JSON.stringify(e,M)):e}const I="_geVersion",M=(e,t)=>e!==I?t:void 0},3172:(e,t,s)=>{s.r(t),s.d(t,{default:()=>f});var i=s(68773),r=s(40330),n=s(20102),a=s(80442),o=s(22974),l=s(70586),u=s(95330),c=s(17452),h=s(71058),d=s(85958);async function f(e,t){const o=(0,c.HK)(e),y=(0,c.jc)(e);y||o||(e=(0,c.Fv)(e));const x={url:e,requestOptions:{...(0,l.Wg)(t)}};let w=(0,c.oh)(e);if(w){const e=await async function(e,t){if(null!=e.responseData)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let s,i;try{i=await e.before(t)}catch(e){s=T("request:interceptor",e,t)}if((i instanceof Error||i instanceof n.Z)&&(s=T("request:interceptor",i,t)),s)throw e.error&&e.error(s),s;return i}}(w,x);if(null!=e)return{data:e,getHeader:v,requestOptions:x.requestOptions,url:x.url};w.after||w.error||(w=null)}if(e=x.url,"image"===(t=x.requestOptions).responseType){if((0,a.Z)("host-webworker")||(0,a.Z)("host-node"))throw T("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),x)}else if(o)throw T("request:invalid-parameters",new Error("Data URLs are not supported for responseType = "+t.responseType),x);if("head"===t.method){if(t.body)throw T("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),x);if(o||y)throw T("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),x)}if(await async function(){(0,a.Z)("host-webworker")?m||(m=await s.e(9884).then(s.bind(s,29884))):f._abortableFetch||(f._abortableFetch=globalThis.fetch.bind(globalThis))}(),m)return m.execute(e,t);const b=new AbortController;(0,u.fu)(t,(()=>b.abort()));const S={controller:b,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:w,params:x,redoRequest:!1,useIdentity:p.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},M=await async function(e){let t,s;await async function(e){const t=e.params.url,s=e.params.requestOptions,n=e.controller.signal,a=s.body;let o=null,l=null;if(g&&"HTMLFormElement"in globalThis&&(a instanceof FormData?o=a:a instanceof HTMLFormElement&&(o=new FormData(a))),"string"==typeof a&&(l=a),e.fetchOptions={cache:s.cacheBust&&!f._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:s.headers||{},method:"head"===s.method?"HEAD":"GET",mode:"cors",priority:p.priority,redirect:"follow",signal:n},(o||l)&&(e.fetchOptions.body=o||l),"anonymous"===s.authMode&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(t)||s.query?.token||o?.get("token")),!e.hasToken&&i.Z.apiKey&&(0,h.r)(t)&&(s.query||(s.query={}),s.query.token=i.Z.apiKey,e.hasToken=!0),e.useIdentity&&!e.hasToken&&!e.credentialToken&&!F(t)&&!(0,u.Hc)(n)){let i;"immediate"===s.authMode?(await _(),i=await r.id.getCredential(t,{signal:n}),e.credential=i):"no-prompt"===s.authMode?(await _(),i=await r.id.getCredential(t,{prompt:!1,signal:n}).catch((()=>{})),e.credential=i):r.id&&(i=r.id.findCredential(t)),i&&(e.credentialToken=i.token,e.useSSL=!!i.ssl)}}(e);try{do{[t,s]=await I(e)}while(!await C(e,t,s))}catch(s){const i=T("request:server",s,e.params,t);throw i.details.ssl=e.useSSL,e.interceptor&&e.interceptor.error&&e.interceptor.error(i),i}const n=e.params.url;if(s&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(n)){if(!e.hasToken&&!e.credentialToken&&s.user?.username&&!(0,c.kl)(n)){const e=(0,c.P$)(n,!0);e&&p.trustedServers.push(e)}Array.isArray(s.authorizedCrossOriginNoCorsDomains)&&(0,d.Hu)(s.authorizedCrossOriginNoCorsDomains)}const a=e.credential;if(a&&r.id){const e=r.id.findServerInfo(a.server);let t=e&&e.owningSystemUrl;if(t){t=t.replace(/\/?$/,"/sharing");const e=r.id.findCredential(t,a.userId);e&&-1===r.id._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t)}}return{data:s,getHeader:t?e=>t?.headers.get(e):v,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}(S);return w?.after?.(M),M}let m;const p=i.Z.request,g="FormData"in globalThis,y=[499,498,403,401],x=["COM_0056","COM_0057","SB_0008"],w=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],v=()=>null,b=Symbol();function S(e){const t=(0,c.P$)(e);return!t||t.endsWith(".arcgis.com")||f._corsServers.includes(t)||(0,c.kl)(t)}function T(e,t,s,i){let r="Error";const a={url:s.url,requestOptions:s.requestOptions,getHeader:v,ssl:!1};if(t instanceof n.Z)return t.details?(t.details=(0,o.d9)(t.details),t.details.url=s.url,t.details.requestOptions=s.requestOptions):t.details=a,t;if(t){const e=i&&(e=>i.headers.get(e)),s=i&&i.status,n=t.message;n&&(r=n),e&&(a.getHeader=e),a.httpStatus=(null!=t.httpCode?t.httpCode:t.code)||s||0,a.subCode=t.subcode,a.messageCode=t.messageCode,"string"==typeof t.details?a.messages=[t.details]:a.messages=t.details,a.raw=b in t?t[b]:t}return(0,u.D_)(t)?(0,u.zE)():new n.Z(e,r,a)}async function _(){r.id||await Promise.all([s.e(6261),s.e(1400),s.e(1761)]).then(s.bind(s,55142))}function F(e){return w.some((t=>t.test(e)))}async function I(e){let t=e.params.url;const s=e.params.requestOptions,i=e.fetchOptions??{},n=(0,c.jc)(t)||(0,c.HK)(t),o=s.responseType||"json",l=n?0:null!=s.timeout?s.timeout:p.timeout;let h=!1;if(!n){e.useSSL&&(t=(0,c.hO)(t)),s.cacheBust&&"default"===i.cache&&(t=(0,c.ZN)(t,"request.preventCache",Date.now()));let n={...s.query};e.credentialToken&&(n.token=e.credentialToken);let o=(0,c.B7)(n);(0,a.Z)("esri-url-encodes-apostrophe")&&(o=o.replace(/'/g,"%27"));const l=t.length+1+o.length;let u;h="delete"===s.method||"post"===s.method||"put"===s.method||!!s.body||l>p.maxUrlLength;const f=s.useProxy||!!(0,c.ed)(t);if(f){const e=(0,c.b7)(t);u=e.path,!h&&u.length+1+l>p.maxUrlLength&&(h=!0),e.query&&(n={...e.query,...n})}if("HEAD"===i.method&&(h||f)){if(h){if(l>p.maxUrlLength)throw T("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params);throw T("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params)}if(f)throw T("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(h?(i.method="delete"===s.method?"DELETE":"put"===s.method?"PUT":"POST",s.body?t=(0,c.fl)(t,n):(i.body=(0,c.B7)(n),i.headers||(i.headers={}),i.headers["Content-Type"]="application/x-www-form-urlencoded")):t=(0,c.fl)(t,n),f&&(e.useProxy=!0,t=`${u}?${t}`),n.token&&g&&i.body instanceof FormData&&!/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(t)&&i.body.set("token",n.token),s.hasOwnProperty("withCredentials"))e.withCredentials=s.withCredentials;else if(!(0,c.D6)(t,(0,c.TI)()))if((0,c.kl)(t))e.withCredentials=!0;else if(r.id){const s=r.id.findServerInfo(t);s&&s.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(i.credentials="include",(0,d.jH)(t)&&await(0,d.jz)(h?(0,c.fl)(t,n):t))}let m,y,x=0,w=!1;l>0&&(x=setTimeout((()=>{w=!0,e.controller.abort()}),l));try{if("native-request-init"===s.responseType)y=i,y.url=t;else if("image"!==s.responseType||"default"!==i.cache||"GET"!==i.method||h||function(e){if(e)for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0;return!1}(s.headers)||!n&&!e.useProxy&&p.proxyUrl&&!S(t)){if(m=await f._abortableFetch(t,i),e.useProxy||function(e){const t=(0,c.P$)(e);t&&!f._corsServers.includes(t)&&f._corsServers.push(t)}(t),"native"===s.responseType)y=m;else if("HEAD"!==i.method)if(m.ok){switch(o){case"array-buffer":y=await m.arrayBuffer();break;case"blob":case"image":y=await m.blob();break;default:y=await m.text()}if(x&&(clearTimeout(x),x=0),"json"===o||"xml"===o||"document"===o)if(y)switch(o){case"json":y=JSON.parse(y);break;case"xml":y=M(y,"application/xml");break;case"document":y=M(y,"text/html")}else y=null;if(y){if("array-buffer"===o||"blob"===o){const e=m.headers.get("Content-Type");if(e&&/application\/json|text\/plain/i.test(e)&&y["blob"===o?"size":"byteLength"]<=750)try{const e=await new Response(y).json();e.error&&(y=e)}catch{}}"image"===o&&y instanceof Blob&&(y=await q(URL.createObjectURL(y),e,!0))}}else y=await m.text()}else y=await q(t,e)}catch(i){if("AbortError"===i.name){if(w)throw new Error("Timeout exceeded");throw(0,u.zE)("Request canceled")}if(!(!m&&i instanceof TypeError&&p.proxyUrl)||s.body||"delete"===s.method||"head"===s.method||"post"===s.method||"put"===s.method||e.useProxy||S(t))throw i;e.redoRequest=!0,(0,c.tD)({proxyUrl:p.proxyUrl,urlPrefix:(0,c.P$)(t)??""})}finally{x&&clearTimeout(x)}return[m,y]}function M(e,t){let s;try{s=(new DOMParser).parseFromString(e,t)}catch{}if(!s||s.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return s}async function C(e,t,s){if(e.redoRequest)return e.redoRequest=!1,!1;const i=e.params.requestOptions;if(!t||"native"===i.responseType||"native-request-init"===i.responseType)return!0;let n,a;if(!t.ok)throw n=new Error(`Unable to load ${t.url} status: ${t.status}`),n[b]=s,n;s&&(s.error?n=s.error:"error"===s.status&&Array.isArray(s.messages)&&(n={...s},n[b]=s,n.details=s.messages));let o,l=null;n&&(a=Number(n.code),l=n.hasOwnProperty("subcode")?Number(n.subcode):null,o=n.messageCode,o=o&&o.toUpperCase());const u=i.authMode;if(403===a&&(4===l||n.message&&n.message.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===a)&&void 0!==a&&y.includes(a)&&!F(e.params.url)&&(403!==a||o&&!x.includes(o)&&(null==l||2===l&&e.credentialToken))){await _();try{const t=await r.id.getCredential(e.params.url,{error:T("request:server",n,e.params),prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=t,e.credentialToken=t.token,e.useSSL=e.useSSL||t.ssl,!1}catch(t){if("no-prompt"===u)return e.credential=void 0,e.credentialToken=void 0,!1;n=t}}if(n)throw n;return!0}function q(e,t,s=!1){const i=t.controller.signal,r=new Image;return t.withCredentials?r.crossOrigin="use-credentials":r.crossOrigin="anonymous",r.alt="",r.fetchPriority=p.priority,r.src=e,(0,d.fY)(r,e,s,i)}f._abortableFetch=null,f._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"]},71058:(e,t,s)=>{s.d(t,{r:()=>n});var i=s(17452);const r=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function n(e){const t=(0,i.P$)(e,!0);return!!t&&t.endsWith(".arcgis.com")&&!r.includes(t)&&!e.endsWith("/sharing/rest/generateToken")}},85958:(e,t,s)=>{s.d(t,{Hu:()=>c,fY:()=>l,jH:()=>h,jz:()=>d});var i=s(68773),r=s(80442),n=s(70586),a=s(95330),o=s(17452);function l(e,t,s=!1,i){return new Promise(((o,l)=>{if((0,a.Hc)(i))return void l(u());let c=()=>{f(),l(new Error(`Unable to load ${t}`))},h=()=>{const t=e;f(),o(t)},d=()=>{if(!e)return;const t=e;f(),t.src="",l(u())};const f=()=>{(0,r.Z)("esri-image-decode")||(e.removeEventListener("error",c),e.removeEventListener("load",h)),c=null,h=null,e=null,(0,n.pC)(i)&&i.removeEventListener("abort",d),d=null,s&&URL.revokeObjectURL(t)};(0,n.pC)(i)&&i.addEventListener("abort",d),(0,r.Z)("esri-image-decode")?e.decode().then(h,c):(e.addEventListener("error",c),e.addEventListener("load",h))}))}function u(){try{return new DOMException("Aborted","AbortError")}catch{const e=new Error;return e.name="AbortError",e}}function c(e){i.Z.request.crossOriginNoCorsDomains||(i.Z.request.crossOriginNoCorsDomains={});const t=i.Z.request.crossOriginNoCorsDomains;for(let s of e)s=s.toLowerCase(),/^https?:\/\//.test(s)?t[(0,o.P$)(s)??""]=0:(t[(0,o.P$)("http://"+s)??""]=0,t[(0,o.P$)("https://"+s)??""]=0)}function h(e){const t=i.Z.request.crossOriginNoCorsDomains;if(t){let s=(0,o.P$)(e);if(s)return s=s.toLowerCase(),!(0,o.D6)(s,(0,o.TI)())&&t[s]<Date.now()-36e5}return!1}async function d(e){const t=i.Z.request.crossOriginNoCorsDomains,s=(0,o.P$)(e);t&&s&&(t[s.toLowerCase()]=Date.now());const r=(0,o.mN)(e);e=r.path,"json"===r.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9777,3172,9880],{99880:(e,t,s)=>{s.d(t,{V:()=>l});var i=s(68773),r=(s(3172),s(20102)),n=s(92604),a=s(17452);const o=n.Z.getLogger("esri.assets");function l(e){if(!i.Z.assetsPath)throw o.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new r.Z("assets:path-not-set","config.assetsPath is not set");return(0,a.v_)(i.Z.assetsPath,e)}},74669:(e,t,s)=>{s.d(t,{Z:()=>r});var i=s(69801);class r{constructor(e,t){this._storage=new i.WJ,this._storage.maxSize=e,t&&this._storage.registerRemoveFunc("",t)}put(e,t){this._storage.put(e,t,1,1)}pop(e){return this._storage.pop(e)}get(e){return this._storage.get(e)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}}},37455:(e,t,s)=>{s.d(t,{N:()=>i});const i={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,s){const i=new r(e.getPointX(t),e.getPointY(t),s),n=e.hasZ(t),a=e.hasM(t);return n&&(i.z=e.getPointZ(t)),a&&(i.m=e.getPointM(t)),i},exportPolygon:function(e,t,s){return new n(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,s){return new a(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,s){return new o(e.exportPoints(t),s,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,s){const i=e.hasZ(t),r=e.hasM(t),n=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),s);if(i){const s=e.getZExtent(t);n.zmin=s.vmin,n.zmax=s.vmax}if(r){const s=e.getMExtent(t);n.mmin=s.vmin,n.mmax=s.vmax}return n}};class r{constructor(e,t,s){this.x=e,this.y=t,this.spatialReference=s,this.z=void 0,this.m=void 0}}class n{constructor(e,t,s,i){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class a{constructor(e,t,s,i){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class o{constructor(e,t,s,i){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class l{constructor(e,t,s,i,r){this.xmin=e,this.ymin=t,this.xmax=s,this.ymax=i,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},24470:(e,t,s)=>{s.d(t,{Gv:()=>x,HH:()=>u,SO:()=>h,Ue:()=>n,al:()=>o,cS:()=>p,fS:()=>y,jE:()=>d,jn:()=>c,kK:()=>f,oJ:()=>l,r3:()=>m}),s(80442),s(22021);var i=s(70586),r=s(6570);function n(e=w){return[e[0],e[1],e[2],e[3]]}function a(e,t){return e!==t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e}function o(e,t,s,i,r=n()){return r[0]=e,r[1]=t,r[2]=s,r[3]=i,r}function l(e,t=n()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function u(e,t){return new r.Z({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:t})}function c(e,t,s){if((0,i.Wi)(t))a(s,e);else if("length"in t)g(t)?(s[0]=Math.min(e[0],t[0]),s[1]=Math.min(e[1],t[1]),s[2]=Math.max(e[2],t[2]),s[3]=Math.max(e[3],t[3])):2!==t.length&&3!==t.length||(s[0]=Math.min(e[0],t[0]),s[1]=Math.min(e[1],t[1]),s[2]=Math.max(e[2],t[0]),s[3]=Math.max(e[3],t[1]));else switch(t.type){case"extent":s[0]=Math.min(e[0],t.xmin),s[1]=Math.min(e[1],t.ymin),s[2]=Math.max(e[2],t.xmax),s[3]=Math.max(e[3],t.ymax);break;case"point":s[0]=Math.min(e[0],t.x),s[1]=Math.min(e[1],t.y),s[2]=Math.max(e[2],t.x),s[3]=Math.max(e[3],t.y)}}function h(e){return function(e){return(0,i.Wi)(e)||e[0]>=e[2]?0:e[2]-e[0]}(e)*function(e){return e[1]>=e[3]?0:e[3]-e[1]}(e)}function d(e,t,s){return t>=e[0]&&s>=e[1]&&t<=e[2]&&s<=e[3]}function f(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function m(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function p(e){return e?a(e,x):n(x)}function g(e){return null!=e&&4===e.length}function y(e,t){return g(e)&&g(t)?e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]:e===t}const x=[1/0,1/0,-1/0,-1/0],w=[0,0,0,0]},69285:(e,t,s)=>{s.d(t,{k:()=>a});var i=s(70586),r=s(67900),n=s(8744);function a(e,t,s){if((0,i.Wi)(t)||(0,i.Wi)(s)||s.vcsWkid||(0,n.fS)(t,s))return null;const a=(0,r._R)(t)/(0,r._R)(s);if(1===a)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){e&&null!=e.z&&(e.z*=t)}(e,a);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const s of e.paths)for(const e of s)e.length>2&&(e[2]*=t)}(e,a);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const s of e.rings)for(const e of s)e.length>2&&(e[2]*=t)}(e,a);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const s of e.points)s.length>2&&(s[2]*=t)}(e,a);case"extent":case"esriGeometryExtent":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,a);default:return null}}},26993:(e,t,s)=>{s.d(t,{y:()=>w,r:()=>m});var i=s(70586),r=s(35308),n=s(49600),a=s(82397),o=s(8744),l=s(62432),u=s(24452);class c{constructor(e,t,s){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=s,this.featureAdapter=t;const i=e.outFields;if(i&&!i.includes("*")){this.outFields=i;let e=0;for(const t of i){const i=(0,l.hr)(t),r=this.fieldsIndex.get(i),n=r?null:(0,l.Jc)(i,s),a=r?r.name:(0,l.nu)(t)||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:n})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach((e=>this.getAttributes(e))),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,s){const i=s?s.name:t;let r=null;return this._fieldDataCache.has(i)?r=this._fieldDataCache.get(i).clause:s||(r=(0,l.Jc)(t,this.fieldsIndex),this._fieldDataCache.set(i,{alias:i,clause:r})),s?this.featureAdapter.getAttribute(e,i):r.calculateValue(e,this.featureAdapter)}getDataValue(e,t){const s=t.normalizationType,i=t.normalizationTotal;let r=this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2&&(r=`${(0,u.wk)(r)}${t.fieldDelimiter}${(0,u.wk)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(r=`${r}${t.fieldDelimiter}${(0,u.wk)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)),s&&Number.isFinite(r)){const n=this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField));r=(0,u.fk)(r,s,n,i)}return r}getExpressionValue(e,t,s,i){const r={attributes:this.featureAdapter.getAttributes(e),layer:{fields:this.fieldsIndex.fields}},n=i.createExecContext(r,s);return i.executeFunction(t,n)}getExpressionValues(e,t,s,i){const r={fields:this.fieldsIndex.fields};return e.map((e=>{const n={attributes:this.featureAdapter.getAttributes(e),layer:r},a=i.createExecContext(n,s);return i.executeFunction(t,a)}))}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,l.Jc)(t,this.fieldsIndex)}),this._fieldDataCache.get(t).clause.testFeature(e,this.featureAdapter)}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,l.Jc)(t,this.fieldsIndex)}),this._fieldDataCache.get(t).clause.testSet(e,this.featureAdapter)}_processAttributesForOutFields(e){const t=this.outFields;if(!t||!t.length)return this.featureAdapter.getAttributes(e);const s={};for(const i of t){const{alias:t,clause:r}=this._fieldDataCache.get(i);s[t]=r?r.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return s}_processAttributesForDistinctValues(e){if((0,i.Wi)(e)||!this.returnDistinctValues)return e;const t=this.outFields,s=[];if(t)for(const i of t){const{alias:t}=this._fieldDataCache.get(i);s.push(e[t])}else for(const t in e)s.push(e[t]);const r=`${(t||["*"]).join(",")}=${s.join(",")}`;let n=this._returnDistinctMap.get(r)||0;return this._returnDistinctMap.set(r,++n),n>1?null:e}}var h=s(37427);function d(e,t,s){return{objectId:e,target:t,distance:s,type:"vertex"}}function f(e,t,s,i,r,n=!1){return{objectId:e,target:t,distance:s,type:"edge",start:i,end:r,draped:n}}var m,p,g=s(11490),y=s(35671),x=s(59266);class w{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new c(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,r=t?.length;if(!r)return 1;const n=new Map,a=new Map,o=new Set;for(const r of i){const{statisticType:i}=r,l="exceedslimit"!==i?r.onStatisticField:void 0;if(!a.has(l)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,n);s.push(t)}a.set(l,this._calculateUniqueValues(s,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:i,items:r}=u[t],n=i.join(",");s&&!e.validateItems(r,s)||o.add(n)}}return o.size}async createQueryResponse(){let e;return e=this.query.outStatistics?this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry&&((0,o.JY)(this.query.outSR)&&!(0,o.fS)(this.query.geometry.spatialReference,this.query.outSR)?e.queryGeometry=(0,g.S2)({spatialReference:this.query.outSR,...(0,h.iV)(this.query.geometry,this.query.geometry.spatialReference,this.query.outSR)}):e.queryGeometry=(0,g.S2)({spatialReference:this.query.outSR,...this.query.geometry})),e}createSnappingResponse(e,t){const s=this.featureAdapter,r=function(e,t){return e?t?4:3:t?3:2}(this.hasZ,this.hasM),{point:n}=e,a="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c=null!=n.z,h=null!=n.m,p=this._getPointCreator(n,c,h,this.spatialReference,t),g=new b(null,0),y=new b(null,0),x={x:0,y:0,z:0};for(const t of this.items){const c=s.getGeometry(t);if((0,i.Wi)(c))continue;const{coords:h,lengths:w}=c;if(g.coords=h,y.coords=h,e.types&m.EDGE){let e=0;for(let i=0;i<w.length;i++){const u=w[i];for(let i=0;i<u;i++,e+=r){const c=g;if(c.coordsIndex=e,i!==u-1){const i=y;i.coordsIndex=e+r;const u=x;v(x,n,c,i);const h=(n.x-u.x)/a,d=(n.y-u.y)/o,m=h*h+d*d;m<=1&&l.candidates.push(f(s.getObjectId(t),p(u),Math.sqrt(m),p(c),p(i)))}}}}if(e.types&m.VERTEX){const e=u?h.length-r:h.length;for(let i=0;i<e;i+=r){const e=g;e.coordsIndex=i;const r=(n.x-e.x)/a,u=(n.y-e.y)/o,c=r*r+u*u;c<=1&&l.candidates.push(d(s.getObjectId(t),p(e),Math.sqrt(c)))}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,s,r,n){const a=(0,i.pC)(n)&&!(0,o.fS)(r,n)?e=>(0,h.iV)(e,r,n):e=>e,{hasZ:l}=this,u=e.m;return t&&s?l?({x:e,y:t,z:s})=>a({x:e,y:t,z:s,m:u}):({x:e,y:t})=>a({x:e,y:t,z:0,m:u}):t?l?({x:e,y:t,z:s})=>a({x:e,y:t,z:s}):({x:e,y:t})=>a({x:e,y:t,z:0}):s?({x:e,y:t})=>a({x:e,y:t,m:u}):({x:e,y:t})=>a({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,minValue:a,maxValue:o,scale:l}=e,c=this.fieldsIndex.isDateField(t),h=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:l}),d=(0,u.S5)({normalizationType:r,normalizationField:i,minValue:a,maxValue:o}),f=this.fieldsIndex.get(t),m={value:.5,fieldType:f?.type},p=(0,y.qN)(f)?(0,u.H0)({values:h,supportsNullCount:d,percentileParams:m}):(0,u.i5)({values:h,minValue:a,maxValue:o,useSampleStdDev:!r,supportsNullCount:d,percentileParams:m});return(0,u.F_)(p,c)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:r,scale:n}=e,a=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:n}),o=(0,u.eT)(a);return(0,u.Qm)(o,i,r,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:c,numClasses:h,scale:d}=e,f=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:d}),m=(0,u.G2)(f,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:c,numClasses:h});return(0,u.DL)(m,a)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:c,numBins:h,scale:d}=e,f=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:d});return(0,u.oF)(f,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:c,numBins:h})}_sortFeatures(e,t,s){if(e.length>1&&t&&t.length)for(const i of t.reverse()){const t=i.split(" "),r=t[0],n=this.fieldsIndex.get(r),a=t[1]&&"desc"===t[1].toLowerCase(),o=(0,u.Lq)(n?.type,a);e.sort(((e,t)=>{const i=s(e,r,n),a=s(t,r,n);return o(i,a)}))}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:r,objectIdField:n,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:h,resultOffset:d,returnZ:f,returnM:m}=e,p=null!=h&&t.length>(d||0)+h,y=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:p,features:this._createFeatures(e,t),fields:y,geometryType:s,hasM:i&&m,hasZ:r&&f,objectIdFieldName:n,spatialReference:(0,g.S2)(u||o),transform:c&&(0,a.vY)(c)||null}}_createFeatures(e,t){const s=new c(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:r}=this,{orderByFields:n,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:h,resultOffset:d,resultRecordCount:f,returnZ:m=!1,returnM:p=!1}=e,y=r&&m,x=i&&p;let w=[],v=0;const b=[...t];if(this._sortFeatures(b,n,((e,t,i)=>s.getFieldValue(e,t,i))),l||u){const e=(0,a.vY)(o);if(l&&!u)for(const t of b)w[v++]={attributes:s.getAttributes(t),geometry:(0,g.Op)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),h,e,y,x)};else if(!l&&u)for(const t of b)w[v++]={attributes:s.getAttributes(t),centroid:(0,g.EG)(this,this.featureAdapter.getCentroid(t,this),e)};else for(const t of b)w[v++]={attributes:s.getAttributes(t),centroid:(0,g.EG)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,g.Op)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),h,e,y,x)}}else for(const e of b){const t=s.getAttributes(e);t&&(w[v++]={attributes:t})}const S=d||0;if(null!=f){const e=S+f;w=w.slice(S,Math.min(w.length,e))}return w}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;for(const t of e.outStatistics)if("exceedslimit"===t.statisticType){s=null!=t.maxPointCount?t.maxPointCount:Number.POSITIVE_INFINITY,r=null!=t.maxRecordCount?t.maxRecordCount:Number.POSITIVE_INFINITY,n=null!=t.maxVertexCount?t.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)t=this.items.length>s;else if(this.items.length>r)t=!0;else{const e=this.hasZ?this.hasM?4:3:this.hasM?3:2,s=this.featureAdapter;t=this.items.reduce(((e,t)=>{const r=s.getGeometry(t);return e+((0,i.pC)(r)&&r.coords.length||0)}),0)/e>n}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,r=new Map,n=new Map,a=new Map,o=new c(e,this.featureAdapter,this.fieldsIndex),l=e.outStatistics,{groupByFieldsForStatistics:u,having:h,orderByFields:d}=e,f=u&&u.length,m=!!f,p=m&&u[0],g=m&&!this.fieldsIndex.get(p);for(const e of l){const{outStatisticFieldName:l,statisticType:c}=e,d=e,y="exceedslimit"!==c?e.onStatisticField:void 0,x="percentile_disc"===c||"percentile_cont"===c,w="EnvelopeAggregate"===c||"CentroidAggregate"===c||"ConvexHullAggregate"===c,v=m&&1===f&&(y===p||g)&&"count"===c;if(m){if(!n.has(y)){const e=[];for(const t of u){const s=this._getAttributeValues(o,t,i);e.push(s)}n.set(y,this._calculateUniqueValues(e,o.returnDistinctValues))}const e=n.get(y);for(const t in e){const{count:s,data:r,items:n,itemPositions:c}=e[t],f=r.join(",");if(!h||o.validateItems(n,h)){const e=a.get(f)||{attributes:{}};if(w){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:s}=await this._getAggregateGeometry(d,n);e.aggregateGeometries[s]=t}else{let t=null;if(v)t=s;else{const e=this._getAttributeValues(o,y,i),s=c.map((t=>e[t]));t=x&&"statisticParameters"in d?this._getPercentileValue(d,s):this._getStatisticValue(d,s,null,o.returnDistinctValues)}e.attributes[l]=t}u.forEach(((t,s)=>e.attributes[this.fieldsIndex.get(t)?t:`EXPR_${s+1}`]=r[s])),a.set(f,e)}}}else if(w){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(d,this.items);t.aggregateGeometries[s]=e}else{const e=this._getAttributeValues(o,y,i);t.attributes[l]=x&&"statisticParameters"in d?this._getPercentileValue(d,e):this._getStatisticValue(d,e,r,o.returnDistinctValues)}s.push({name:l,alias:l,type:"esriFieldTypeDouble"})}const y=m?Array.from(a.values()):[t];return this._sortFeatures(y,d,((e,t)=>e.attributes[t])),{fields:s,features:y}}async _getAggregateGeometry(e,t){const i=await Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247)),{statisticType:a,outStatisticFieldName:o}=e,{featureAdapter:l,spatialReference:u,geometryType:c,hasZ:h,hasM:d}=this,f=t.map((e=>(0,g.Op)(c,h,d,l.getGeometry(e)))),m=i.convexHull(u,f,!0)[0],p={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===a){const e=m?(0,n._w)(m):(0,n.aO)(i.union(u,f));p.aggregateGeometries={...e,spatialReference:u},p.outStatisticFieldName=o||"extent"}else if("CentroidAggregate"===a){const e=m?(0,r.tO)(m):(0,r.$G)((0,n.aO)(i.union(u,f)));p.aggregateGeometries={x:e[0],y:e[1],spatialReference:u},p.outStatisticFieldName=o||"centroid"}else"ConvexHullAggregate"===a&&(p.aggregateGeometries=m,p.outStatisticFieldName=o||"convexHull");return p}_getStatisticValue(e,t,s,i){const{onStatisticField:r,statisticType:n}=e;let a=null;return a=s?.has(r)?s.get(r):(0,y.qN)(this.fieldsIndex.get(r))?(0,u.H0)({values:t,returnDistinct:i}):(0,u.i5)({values:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(r,a),a["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:r}=e,{value:n,orderBy:a}=i,o=this.fieldsIndex.get(s);return(0,u.XL)(t,{value:n,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===r})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),r=this.items.map((s=>e.getFieldValue(s,t,i)));return s.set(t,r),r}_getAttributeDataValues(e,t){return this.items.map((s=>e.getDataValue(s,{field:t.field,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,normalizationField:t.normalizationField,normalizationType:t.normalizationType,normalizationTotal:t.normalizationTotal})))}async _getAttributeExpressionValues(e,t,s){const{arcadeUtils:i}=await(0,x.LC)(),r=i.createFunction(t),n=s&&i.getViewInfo(s);return e.getExpressionValues(this.items,r,n,i)}_calculateUniqueValues(e,t){const s={},i=this.items,r=i.length;for(let n=0;n<r;n++){const r=i[n],a=[];for(const t of e)a.push(t[n]);const o=a.join(",");t?null==s[o]&&(s[o]={count:1,data:a,items:[r],itemPositions:[n]}):null==s[o]?s[o]={count:1,data:a,items:[r],itemPositions:[n]}:(s[o].count++,s[o].items.push(r),s[o].itemPositions.push(n))}return s}async _getDataValues(e){const t=new c(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:s,field:i,normalizationField:r,normalizationType:n,normalizationTotal:a,scale:o}=e,l=s?{viewingMode:"map",scale:o,spatialReference:this.query.outSR||this.spatialReference}:null;return s?this._getAttributeExpressionValues(t,s,l):this._getAttributeDataValues(t,{field:i,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,normalizationField:r,normalizationType:n,normalizationTotal:a})}}function v(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,a=r*r+n*n,o=(t.x-s.x)*r+(t.y-s.y)*n,l=Math.min(1,Math.max(0,o/a));e.x=s.x+r*l,e.y=s.y+n*l}(p=m||(m={}))[p.NONE=0]="NONE",p[p.EDGE=1]="EDGE",p[p.VERTEX=2]="VERTEX";class b{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}},62432:(e,t,s)=>{s.d(t,{nu:()=>p,hr:()=>m,Jc:()=>d,G3:()=>g,Of:()=>f,z4:()=>h,hO:()=>c});var i=s(20102),r=s(74669),n=s(41534);const a=new class{constructor(e,t){this._cache=new r.Z(e),this._invalidCache=new r.Z(t)}get(e,t){const s=`${t.uid}:${e}`,i=this._cache.get(s);if(i)return i;if(void 0!==this._invalidCache.get(s))return null;try{const i=n.WhereClause.create(e,t);return this._cache.put(s,i),i}catch{return this._invalidCache.put(s,null),null}}}(50,500),o="feature-store:unsupported-query",l=" as ",u=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeDate"]);function c(e,t){if(!t)return!0;const s=a.get(t,e);if(!s)throw new i.Z(o,"invalid SQL expression",{where:t});if(!s.isStandardized)throw new i.Z(o,"where clause is not standard",{where:t});return f(e,s.fieldNames,"where clause contains missing fields"),!0}function h(e,t,s){if(!t)return!0;const r=a.get(t,e);if(!r)throw new i.Z(o,"invalid SQL expression",{having:t});if(!r.isAggregate)throw new i.Z(o,"having does not contain a valid aggregate function",{having:t});const n=r.fieldNames;if(f(e,n,"having contains missing fields"),!r.getExpressions().every((t=>{const{aggregateType:i,field:r}=t,n=e.has(r)&&e.get(r).name;return s.some((t=>{const{onStatisticField:s,statisticType:r}=t;return(e.has(s)&&e.get(s).name)===n&&r.toLowerCase().trim()===i}))})))throw new i.Z(o,"expressions in having should also exist in outStatistics",{having:t});return!0}function d(e,t){return e?a.get(e,t):null}function f(e,t,s,r=!0){const n=[];for(const s of t)if("*"!==s&&!e.has(s))if(r){const t=m(s);try{const s=d(t,e);if(!s)throw new i.Z(o,"invalid SQL expression",{where:t});if(!s.isStandardized)throw new i.Z(o,"expression is not standard",{clause:s});f(e,s.fieldNames,"expression contains missing fields")}catch(e){const t=e&&e.details;if(t&&(t.clause||t.where))throw e;t&&t.missingFields?n.push(...t.missingFields):n.push(s)}}else n.push(s);if(n.length)throw new i.Z(o,s,{missingFields:n})}function m(e){return e.split(l)[0]}function p(e){return e.split(l)[1]}function g(e,t){const s=t.get(e);return!!s&&!u.has(s.type)}},37427:(e,t,s)=>{s.d(t,{_W:()=>d,iV:()=>p,oj:()=>y});var i=s(70586),r=s(44547),n=s(37455),a=s(8744),o=s(40488);const l=[0,0];function u(e,t){if(!t)return null;if("x"in t){const s={x:0,y:0};return[s.x,s.y]=e(t.x,t.y,l),null!=t.z&&(s.z=t.z),null!=t.m&&(s.m=t.m),s}if("xmin"in t){const s={xmin:0,ymin:0,xmax:0,ymax:0};return[s.xmin,s.ymin]=e(t.xmin,t.ymin,l),[s.xmax,s.ymax]=e(t.xmax,t.ymax,l),t.hasZ&&(s.zmin=t.zmin,s.zmax=t.zmax,s.hasZ=!0),t.hasM&&(s.mmin=t.mmin,s.mmax=t.mmax,s.hasM=!0),s}return"rings"in t?{rings:c(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:c(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:h(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function c(e,t){const s=[];for(const i of e)s.push(h(i,t));return s}function h(e,t){const s=[];for(const i of e){const e=t(i[0],i[1],[0,0]);s.push(e),i.length>2&&e.push(i[2]),i.length>3&&e.push(i[3])}return s}async function d(e,t){if(!e||!t)return;const s=Array.isArray(e)?e.map((e=>(0,i.pC)(e.geometry)?e.geometry.spatialReference:null)).filter(i.pC):[e];await(0,r.iQ)(s.map((e=>({source:e,dest:t}))))}const f=u.bind(null,o.hG),m=u.bind(null,o.R6);function p(e,t,s,i){if(!e)return e;if(s||(s=t,t=e.spatialReference),!(0,a.JY)(t)||!(0,a.JY)(s)||(0,a.fS)(t,s))return e;if((0,o.Q8)(t,s)){const t=(0,a.sS)(s)?f(e):m(e);return t.spatialReference=s,t}return(0,r.oj)(n.N,[e],t,s,null,i)[0]}const g=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,s){if(!e||!e.length||!t||!s||(0,a.fS)(t,s))return e;const i={geometries:e,inSpatialReference:t,outSpatialReference:s,resolve:null};return this._jobs.push(i),new Promise((e=>{i.resolve=e,null===this._timer&&(this._timer=setTimeout(this._process,10))}))}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:s,outSpatialReference:i,resolve:l}=e;(0,o.Q8)(s,i)?(0,a.sS)(i)?l(t.map(f)):l(t.map(m)):l((0,r.oj)(n.N,t,s,i,null,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function y(e,t,s){return g.push(e,t,s)}},11490:(e,t,s)=>{s.d(t,{EG:()=>v,Op:()=>b,S2:()=>F,Up:()=>S,j6:()=>T,vF:()=>p});var i=s(35454),r=s(70586),n=s(67900),a=s(44547),o=s(49600),l=s(33955),u=s(51806),c=s(8744),h=s(98732),d=s(5428),f=s(37427);const m=new i.X({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),p=Object.freeze({}),g=new d.Z,y=new d.Z,x=new d.Z,w={esriGeometryPoint:h.fQ,esriGeometryPolyline:h.J6,esriGeometryPolygon:h.eG,esriGeometryMultipoint:h.Iv};function v(e,t,s,i=e.hasZ,n=e.hasM){if((0,r.Wi)(t))return null;const a=e.hasZ&&i,o=e.hasM&&n;if(s){const r=(0,h.Nh)(x,t,e.hasZ,e.hasM,"esriGeometryPoint",s,i,n);return(0,h.fQ)(r,a,o)}return(0,h.fQ)(t,a,o)}function b(e,t,s,i,n,a,o=t,l=s){const u=t&&o,c=s&&l,d=(0,r.pC)(i)?"coords"in i?i:i.geometry:null;if((0,r.Wi)(d))return null;if(n){let i=(0,h.zj)(y,d,t,s,e,n,o,l);return a&&(i=(0,h.Nh)(x,i,u,c,e,a)),w[e]?.(i,u,c)??null}if(a){const i=(0,h.Nh)(x,d,t,s,e,a,o,l);return w[e]?.(i,u,c)??null}return(0,h.hY)(g,d,t,s,o,l),w[e]?.(g,u,c)??null}async function S(e,t,s){const{outFields:i,orderByFields:r,groupByFieldsForStatistics:n,outStatistics:a}=e;if(i)for(let e=0;e<i.length;e++)i[e]=i[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),T(e,t,s)}async function T(e,t,i){if(!e)return null;let{where:a}=e;if(e.where=a=a&&a.trim(),(!a||/^1 *= *1$/.test(a)||t&&t===a)&&(e.where=null),!e.geometry)return e;let h=await async function(e){const{distance:t,units:i}=e,r=e.geometry;if(null==t||"vertexAttributes"in r)return r;const a=r.spatialReference,o=i?m.fromJSON(i):(0,n.qE)(a),l=a&&((0,c.sT)(a)||(0,c.sS)(a))?r:await(0,f._W)(a,c.Zn).then((()=>(0,f.iV)(r,c.Zn)));return(await async function(){return(await Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247))).geodesicBuffer}())(l.spatialReference,l,t,o)}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;h=(0,o.aO)(h),h.spatialReference=t}if(h){await(0,f._W)(h.spatialReference,i),h=function(e,t){const s=e.spatialReference;return _(e,t)&&(0,l.YX)(e)?{spatialReference:s,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(h,i);const t=(await(0,u.aX)((0,l.im)(h)))[0];if((0,r.Wi)(t))throw p;const s="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,n=s&&_(h,i)?{densificationStep:8*s}:void 0,a=t.toJSON(),o=await(0,f.iV)(a,a.spatialReference,i,n);if(!o)throw p;o.spatialReference=i,e.geometry=o}return e}function _(e,t){if(!e)return!1;const s=e.spatialReference;return((0,l.YX)(e)||(0,l.oU)(e)||(0,l.l9)(e))&&!(0,c.fS)(s,t)&&!(0,a.Up)(s,t)}function F(e){return e&&I in e?JSON.parse(JSON.stringify(e,M)):e}const I="_geVersion",M=(e,t)=>e!==I?t:void 0},3172:(e,t,s)=>{s.r(t),s.d(t,{default:()=>f});var i=s(68773),r=s(40330),n=s(20102),a=s(80442),o=s(22974),l=s(70586),u=s(95330),c=s(17452),h=s(71058),d=s(85958);async function f(e,t){const o=(0,c.HK)(e),y=(0,c.jc)(e);y||o||(e=(0,c.Fv)(e));const x={url:e,requestOptions:{...(0,l.Wg)(t)}};let w=(0,c.oh)(e);if(w){const e=await async function(e,t){if(null!=e.responseData)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let s,i;try{i=await e.before(t)}catch(e){s=T("request:interceptor",e,t)}if((i instanceof Error||i instanceof n.Z)&&(s=T("request:interceptor",i,t)),s)throw e.error&&e.error(s),s;return i}}(w,x);if(null!=e)return{data:e,getHeader:v,requestOptions:x.requestOptions,url:x.url};w.after||w.error||(w=null)}if(e=x.url,"image"===(t=x.requestOptions).responseType){if((0,a.Z)("host-webworker")||(0,a.Z)("host-node"))throw T("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),x)}else if(o)throw T("request:invalid-parameters",new Error("Data URLs are not supported for responseType = "+t.responseType),x);if("head"===t.method){if(t.body)throw T("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),x);if(o||y)throw T("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),x)}if(await async function(){(0,a.Z)("host-webworker")?m||(m=await s.e(9884).then(s.bind(s,29884))):f._abortableFetch||(f._abortableFetch=globalThis.fetch.bind(globalThis))}(),m)return m.execute(e,t);const b=new AbortController;(0,u.fu)(t,(()=>b.abort()));const S={controller:b,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:w,params:x,redoRequest:!1,useIdentity:p.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},M=await async function(e){let t,s;await async function(e){const t=e.params.url,s=e.params.requestOptions,n=e.controller.signal,a=s.body;let o=null,l=null;if(g&&"HTMLFormElement"in globalThis&&(a instanceof FormData?o=a:a instanceof HTMLFormElement&&(o=new FormData(a))),"string"==typeof a&&(l=a),e.fetchOptions={cache:s.cacheBust&&!f._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:s.headers||{},method:"head"===s.method?"HEAD":"GET",mode:"cors",priority:p.priority,redirect:"follow",signal:n},(o||l)&&(e.fetchOptions.body=o||l),"anonymous"===s.authMode&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(t)||s.query?.token||o?.get("token")),!e.hasToken&&i.Z.apiKey&&(0,h.r)(t)&&(s.query||(s.query={}),s.query.token=i.Z.apiKey,e.hasToken=!0),e.useIdentity&&!e.hasToken&&!e.credentialToken&&!F(t)&&!(0,u.Hc)(n)){let i;"immediate"===s.authMode?(await _(),i=await r.id.getCredential(t,{signal:n}),e.credential=i):"no-prompt"===s.authMode?(await _(),i=await r.id.getCredential(t,{prompt:!1,signal:n}).catch((()=>{})),e.credential=i):r.id&&(i=r.id.findCredential(t)),i&&(e.credentialToken=i.token,e.useSSL=!!i.ssl)}}(e);try{do{[t,s]=await I(e)}while(!await C(e,t,s))}catch(s){const i=T("request:server",s,e.params,t);throw i.details.ssl=e.useSSL,e.interceptor&&e.interceptor.error&&e.interceptor.error(i),i}const n=e.params.url;if(s&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(n)){if(!e.hasToken&&!e.credentialToken&&s.user?.username&&!(0,c.kl)(n)){const e=(0,c.P$)(n,!0);e&&p.trustedServers.push(e)}Array.isArray(s.authorizedCrossOriginNoCorsDomains)&&(0,d.Hu)(s.authorizedCrossOriginNoCorsDomains)}const a=e.credential;if(a&&r.id){const e=r.id.findServerInfo(a.server);let t=e&&e.owningSystemUrl;if(t){t=t.replace(/\/?$/,"/sharing");const e=r.id.findCredential(t,a.userId);e&&-1===r.id._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t)}}return{data:s,getHeader:t?e=>t?.headers.get(e):v,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}(S);return w?.after?.(M),M}let m;const p=i.Z.request,g="FormData"in globalThis,y=[499,498,403,401],x=["COM_0056","COM_0057","SB_0008"],w=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],v=()=>null,b=Symbol();function S(e){const t=(0,c.P$)(e);return!t||t.endsWith(".arcgis.com")||f._corsServers.includes(t)||(0,c.kl)(t)}function T(e,t,s,i){let r="Error";const a={url:s.url,requestOptions:s.requestOptions,getHeader:v,ssl:!1};if(t instanceof n.Z)return t.details?(t.details=(0,o.d9)(t.details),t.details.url=s.url,t.details.requestOptions=s.requestOptions):t.details=a,t;if(t){const e=i&&(e=>i.headers.get(e)),s=i&&i.status,n=t.message;n&&(r=n),e&&(a.getHeader=e),a.httpStatus=(null!=t.httpCode?t.httpCode:t.code)||s||0,a.subCode=t.subcode,a.messageCode=t.messageCode,"string"==typeof t.details?a.messages=[t.details]:a.messages=t.details,a.raw=b in t?t[b]:t}return(0,u.D_)(t)?(0,u.zE)():new n.Z(e,r,a)}async function _(){r.id||await Promise.all([s.e(6261),s.e(1400),s.e(1761)]).then(s.bind(s,55142))}function F(e){return w.some((t=>t.test(e)))}async function I(e){let t=e.params.url;const s=e.params.requestOptions,i=e.fetchOptions??{},n=(0,c.jc)(t)||(0,c.HK)(t),o=s.responseType||"json",l=n?0:null!=s.timeout?s.timeout:p.timeout;let h=!1;if(!n){e.useSSL&&(t=(0,c.hO)(t)),s.cacheBust&&"default"===i.cache&&(t=(0,c.ZN)(t,"request.preventCache",Date.now()));let n={...s.query};e.credentialToken&&(n.token=e.credentialToken);let o=(0,c.B7)(n);(0,a.Z)("esri-url-encodes-apostrophe")&&(o=o.replace(/'/g,"%27"));const l=t.length+1+o.length;let u;h="delete"===s.method||"post"===s.method||"put"===s.method||!!s.body||l>p.maxUrlLength;const f=s.useProxy||!!(0,c.ed)(t);if(f){const e=(0,c.b7)(t);u=e.path,!h&&u.length+1+l>p.maxUrlLength&&(h=!0),e.query&&(n={...e.query,...n})}if("HEAD"===i.method&&(h||f)){if(h){if(l>p.maxUrlLength)throw T("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params);throw T("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params)}if(f)throw T("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(h?(i.method="delete"===s.method?"DELETE":"put"===s.method?"PUT":"POST",s.body?t=(0,c.fl)(t,n):(i.body=(0,c.B7)(n),i.headers||(i.headers={}),i.headers["Content-Type"]="application/x-www-form-urlencoded")):t=(0,c.fl)(t,n),f&&(e.useProxy=!0,t=`${u}?${t}`),n.token&&g&&i.body instanceof FormData&&!/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(t)&&i.body.set("token",n.token),s.hasOwnProperty("withCredentials"))e.withCredentials=s.withCredentials;else if(!(0,c.D6)(t,(0,c.TI)()))if((0,c.kl)(t))e.withCredentials=!0;else if(r.id){const s=r.id.findServerInfo(t);s&&s.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(i.credentials="include",(0,d.jH)(t)&&await(0,d.jz)(h?(0,c.fl)(t,n):t))}let m,y,x=0,w=!1;l>0&&(x=setTimeout((()=>{w=!0,e.controller.abort()}),l));try{if("native-request-init"===s.responseType)y=i,y.url=t;else if("image"!==s.responseType||"default"!==i.cache||"GET"!==i.method||h||function(e){if(e)for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0;return!1}(s.headers)||!n&&!e.useProxy&&p.proxyUrl&&!S(t)){if(m=await f._abortableFetch(t,i),e.useProxy||function(e){const t=(0,c.P$)(e);t&&!f._corsServers.includes(t)&&f._corsServers.push(t)}(t),"native"===s.responseType)y=m;else if("HEAD"!==i.method)if(m.ok){switch(o){case"array-buffer":y=await m.arrayBuffer();break;case"blob":case"image":y=await m.blob();break;default:y=await m.text()}if(x&&(clearTimeout(x),x=0),"json"===o||"xml"===o||"document"===o)if(y)switch(o){case"json":y=JSON.parse(y);break;case"xml":y=M(y,"application/xml");break;case"document":y=M(y,"text/html")}else y=null;if(y){if("array-buffer"===o||"blob"===o){const e=m.headers.get("Content-Type");if(e&&/application\/json|text\/plain/i.test(e)&&y["blob"===o?"size":"byteLength"]<=750)try{const e=await new Response(y).json();e.error&&(y=e)}catch{}}"image"===o&&y instanceof Blob&&(y=await q(URL.createObjectURL(y),e,!0))}}else y=await m.text()}else y=await q(t,e)}catch(i){if("AbortError"===i.name){if(w)throw new Error("Timeout exceeded");throw(0,u.zE)("Request canceled")}if(!(!m&&i instanceof TypeError&&p.proxyUrl)||s.body||"delete"===s.method||"head"===s.method||"post"===s.method||"put"===s.method||e.useProxy||S(t))throw i;e.redoRequest=!0,(0,c.tD)({proxyUrl:p.proxyUrl,urlPrefix:(0,c.P$)(t)??""})}finally{x&&clearTimeout(x)}return[m,y]}function M(e,t){let s;try{s=(new DOMParser).parseFromString(e,t)}catch{}if(!s||s.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return s}async function C(e,t,s){if(e.redoRequest)return e.redoRequest=!1,!1;const i=e.params.requestOptions;if(!t||"native"===i.responseType||"native-request-init"===i.responseType)return!0;let n,a;if(!t.ok)throw n=new Error(`Unable to load ${t.url} status: ${t.status}`),n[b]=s,n;s&&(s.error?n=s.error:"error"===s.status&&Array.isArray(s.messages)&&(n={...s},n[b]=s,n.details=s.messages));let o,l=null;n&&(a=Number(n.code),l=n.hasOwnProperty("subcode")?Number(n.subcode):null,o=n.messageCode,o=o&&o.toUpperCase());const u=i.authMode;if(403===a&&(4===l||n.message&&n.message.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===a)&&void 0!==a&&y.includes(a)&&!F(e.params.url)&&(403!==a||o&&!x.includes(o)&&(null==l||2===l&&e.credentialToken))){await _();try{const t=await r.id.getCredential(e.params.url,{error:T("request:server",n,e.params),prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=t,e.credentialToken=t.token,e.useSSL=e.useSSL||t.ssl,!1}catch(t){if("no-prompt"===u)return e.credential=void 0,e.credentialToken=void 0,!1;n=t}}if(n)throw n;return!0}function q(e,t,s=!1){const i=t.controller.signal,r=new Image;return t.withCredentials?r.crossOrigin="use-credentials":r.crossOrigin="anonymous",r.alt="",r.fetchPriority=p.priority,r.src=e,(0,d.fY)(r,e,s,i)}f._abortableFetch=null,f._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"]},71058:(e,t,s)=>{s.d(t,{r:()=>n});var i=s(17452);const r=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function n(e){const t=(0,i.P$)(e,!0);return!!t&&t.endsWith(".arcgis.com")&&!r.includes(t)&&!e.endsWith("/sharing/rest/generateToken")}},85958:(e,t,s)=>{s.d(t,{Hu:()=>c,fY:()=>l,jH:()=>h,jz:()=>d});var i=s(68773),r=s(80442),n=s(70586),a=s(95330),o=s(17452);function l(e,t,s=!1,i){return new Promise(((o,l)=>{if((0,a.Hc)(i))return void l(u());let c=()=>{f(),l(new Error(`Unable to load ${t}`))},h=()=>{const t=e;f(),o(t)},d=()=>{if(!e)return;const t=e;f(),t.src="",l(u())};const f=()=>{(0,r.Z)("esri-image-decode")||(e.removeEventListener("error",c),e.removeEventListener("load",h)),c=null,h=null,e=null,(0,n.pC)(i)&&i.removeEventListener("abort",d),d=null,s&&URL.revokeObjectURL(t)};(0,n.pC)(i)&&i.addEventListener("abort",d),(0,r.Z)("esri-image-decode")?e.decode().then(h,c):(e.addEventListener("error",c),e.addEventListener("load",h))}))}function u(){try{return new DOMException("Aborted","AbortError")}catch{const e=new Error;return e.name="AbortError",e}}function c(e){i.Z.request.crossOriginNoCorsDomains||(i.Z.request.crossOriginNoCorsDomains={});const t=i.Z.request.crossOriginNoCorsDomains;for(let s of e)s=s.toLowerCase(),/^https?:\/\//.test(s)?t[(0,o.P$)(s)??""]=0:(t[(0,o.P$)("http://"+s)??""]=0,t[(0,o.P$)("https://"+s)??""]=0)}function h(e){const t=i.Z.request.crossOriginNoCorsDomains;if(t){let s=(0,o.P$)(e);if(s)return s=s.toLowerCase(),!(0,o.D6)(s,(0,o.TI)())&&t[s]<Date.now()-36e5}return!1}async function d(e){const t=i.Z.request.crossOriginNoCorsDomains,s=(0,o.P$)(e);t&&s&&(t[s.toLowerCase()]=Date.now());const r=(0,o.mN)(e);e=r.path,"json"===r.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3529],{63529:(e,a,r)=>{r.r(a),r.d(a,{fromUrl:()=>o});var t=r(20102),n=r(70586),l=r(17452),s=r(66677),i=r(52104),y=r(87344);async function o(e){const a=e.properties?.customParameters,l=await async function(e,a){let r=(0,s.Qc)(e);if((0,n.Wi)(r)&&(r=await c(e,a)),(0,n.Wi)(r))throw new t.Z("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:e});const{serverType:l,sublayer:o}=r;let u;const d={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"};switch(l){case"MapServer":u=null!=o?"FeatureLayer":async function(e,a){return(await(0,i.C)(e,{customParameters:a})).tileInfo}(e,a).then((e=>e?"TileLayer":"MapImageLayer"));break;case"ImageServer":u=(0,i.C)(e,{customParameters:a}).then((e=>{const a=e.tileInfo&&e.tileInfo.format;return e.tileInfo?"LERC"!==a?.toUpperCase()||e.cacheType&&"elevation"!==e.cacheType.toLowerCase()?"ImageryTileLayer":"ElevationLayer":"ImageryLayer"}));break;case"SceneServer":u=(0,i.C)(r.url.path,{customParameters:a}).then((e=>{if(e){if("Voxel"===e?.layerType)return"VoxelLayer";if(e?.layers&&Array.isArray(e.layers)&&e.layers.length>0){const a={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"},r=e.layers[0]?.layerType;if(null!=a[r])return a[r]}}return"SceneLayer"}));break;default:u=d[l]}const f="FeatureServer"===l,m={parsedUrl:r,Constructor:null,layerOrTableId:f?o:null,sublayerIds:null,tableIds:null},b=await u;if({FeatureLayer:!0,SceneLayer:!0}[b]&&null==o){const r=await async function(e,a,r){let t,n=!1;if("FeatureServer"===a){const a=await(0,i.V)(e,{customParameters:r});n=!!a.layersJSON,t=a.layersJSON||a.serviceJSON}else t=await(0,i.C)(e,{customParameters:r});const l=t?.layers,s=t?.tables;return{layerIds:l?.map((e=>e.id)).reverse()||[],tableIds:s?.map((e=>e.id)).reverse()||[],layerInfos:n?l:[],tableInfos:n?s:[]}}(e,l,a);f&&(m.sublayerInfos=r.layerInfos,m.tableInfos=r.tableInfos),1!==r.layerIds.length+r.tableIds.length?(m.sublayerIds=r.layerIds,m.tableIds=r.tableIds):f&&(m.layerOrTableId=r.layerIds[0]??r.tableIds[0],m.sourceJSON=r.layerInfos[0]??r.tableInfos[0])}return m.Constructor=await async function(e){return(0,y.T[e])()}(b),m}(e.url,a),o={...e.properties,url:e.url};if(!l.sublayerIds)return null!=l.layerOrTableId&&(o.layerId=l.layerOrTableId,o.sourceJSON=l.sourceJSON),new l.Constructor(o);const d=new(0,(await Promise.all([r.e(2710),r.e(1612),r.e(9)]).then(r.bind(r,89348))).default)({title:l.parsedUrl.title});return function(e,a,r){function t(e,t){const l={...r,layerId:e,sublayerTitleMode:"service-name"};return(0,n.pC)(t)&&(l.sourceJSON=t),new a.Constructor(l)}a.sublayerIds.forEach((r=>{const n=t(r,u(a.sublayerInfos,r));e.add(n)})),a.tableIds.forEach((r=>{const n=t(r,u(a.tableInfos,r));e.tables.add(n)}))}(d,l,o),d}function u(e,a){return e?e.find((e=>e.id===a)):null}async function c(e,a){const r=await(0,i.C)(e,{customParameters:a});let t=null,y=null;const o=r.type;if("Feature Layer"===o||"Table"===o?(t="FeatureServer",y=r.id):"indexedVector"===o?t="VectorTileServer":r.hasOwnProperty("mapName")?t="MapServer":r.hasOwnProperty("bandCount")&&r.hasOwnProperty("pixelSizeX")?t="ImageServer":r.hasOwnProperty("maxRecordCount")&&r.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":r.hasOwnProperty("streamUrls")?t="StreamServer":d(r)?(t="SceneServer",y=r.id):r.hasOwnProperty("layers")&&d(r.layers?.[0])&&(t="SceneServer"),!t)return null;const u=null!=y?(0,s.DR)(e):null;return{title:(0,n.pC)(u)&&r.name||(0,l.vt)(e),serverType:t,sublayer:y,url:{path:(0,n.pC)(u)?u.serviceUrl:(0,l.mN)(e).path}}}function d(e){return e?.hasOwnProperty("store")&&e.hasOwnProperty("id")&&"number"==typeof e.id}},52104:(e,a,r)=>{r.d(a,{C:()=>s,V:()=>n});var t=r(3172);async function n(e,a){let r=await s(e,a);r=r||{},r.layers=r.layers?.filter(l)||[];const t={serviceJSON:r};if((r.currentVersion??0)<10.5)return t;const n=await s(e+"/layers",a);return t.layersJSON={layers:n?.layers?.filter(l)||[],tables:n?.tables||[]},t}function l(e){return!e.type||"Feature Layer"===e.type}async function s(e,a){return(await(0,t.default)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}})).data}},87344:(e,a,r)=>{r.d(a,{T:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9513)]).then(r.bind(r,2723))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(4547),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(6015),r.e(9238),r.e(719),r.e(9268),r.e(7698),r.e(223)]).then(r.bind(r,30223))).default,CSVLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(6015),r.e(9238),r.e(7827)]).then(r.bind(r,45425))).default,DimensionLayer:async()=>(await Promise.all([r.e(4547),r.e(958),r.e(81)]).then(r.bind(r,40081))).default,ElevationLayer:async()=>(await Promise.all([r.e(8794),r.e(5207)]).then(r.bind(r,49932))).default,FeatureLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(6015),r.e(9238),r.e(4202)]).then(r.bind(r,19238))).default,GroupLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9)]).then(r.bind(r,89348))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(7062)]).then(r.bind(r,3723))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(7202)]).then(r.bind(r,23477))).default,ImageryLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(4588),r.e(4599),r.e(8363),r.e(4242),r.e(4028)]).then(r.bind(r,66210))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(4547),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(8794),r.e(8363),r.e(4242),r.e(3645),r.e(
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3529],{63529:(e,a,r)=>{r.r(a),r.d(a,{fromUrl:()=>o});var t=r(20102),n=r(70586),l=r(17452),s=r(66677),i=r(52104),y=r(87344);async function o(e){const a=e.properties?.customParameters,l=await async function(e,a){let r=(0,s.Qc)(e);if((0,n.Wi)(r)&&(r=await c(e,a)),(0,n.Wi)(r))throw new t.Z("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:e});const{serverType:l,sublayer:o}=r;let u;const d={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"};switch(l){case"MapServer":u=null!=o?"FeatureLayer":async function(e,a){return(await(0,i.C)(e,{customParameters:a})).tileInfo}(e,a).then((e=>e?"TileLayer":"MapImageLayer"));break;case"ImageServer":u=(0,i.C)(e,{customParameters:a}).then((e=>{const a=e.tileInfo&&e.tileInfo.format;return e.tileInfo?"LERC"!==a?.toUpperCase()||e.cacheType&&"elevation"!==e.cacheType.toLowerCase()?"ImageryTileLayer":"ElevationLayer":"ImageryLayer"}));break;case"SceneServer":u=(0,i.C)(r.url.path,{customParameters:a}).then((e=>{if(e){if("Voxel"===e?.layerType)return"VoxelLayer";if(e?.layers&&Array.isArray(e.layers)&&e.layers.length>0){const a={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"},r=e.layers[0]?.layerType;if(null!=a[r])return a[r]}}return"SceneLayer"}));break;default:u=d[l]}const f="FeatureServer"===l,m={parsedUrl:r,Constructor:null,layerOrTableId:f?o:null,sublayerIds:null,tableIds:null},b=await u;if({FeatureLayer:!0,SceneLayer:!0}[b]&&null==o){const r=await async function(e,a,r){let t,n=!1;if("FeatureServer"===a){const a=await(0,i.V)(e,{customParameters:r});n=!!a.layersJSON,t=a.layersJSON||a.serviceJSON}else t=await(0,i.C)(e,{customParameters:r});const l=t?.layers,s=t?.tables;return{layerIds:l?.map((e=>e.id)).reverse()||[],tableIds:s?.map((e=>e.id)).reverse()||[],layerInfos:n?l:[],tableInfos:n?s:[]}}(e,l,a);f&&(m.sublayerInfos=r.layerInfos,m.tableInfos=r.tableInfos),1!==r.layerIds.length+r.tableIds.length?(m.sublayerIds=r.layerIds,m.tableIds=r.tableIds):f&&(m.layerOrTableId=r.layerIds[0]??r.tableIds[0],m.sourceJSON=r.layerInfos[0]??r.tableInfos[0])}return m.Constructor=await async function(e){return(0,y.T[e])()}(b),m}(e.url,a),o={...e.properties,url:e.url};if(!l.sublayerIds)return null!=l.layerOrTableId&&(o.layerId=l.layerOrTableId,o.sourceJSON=l.sourceJSON),new l.Constructor(o);const d=new(0,(await Promise.all([r.e(2710),r.e(1612),r.e(9)]).then(r.bind(r,89348))).default)({title:l.parsedUrl.title});return function(e,a,r){function t(e,t){const l={...r,layerId:e,sublayerTitleMode:"service-name"};return(0,n.pC)(t)&&(l.sourceJSON=t),new a.Constructor(l)}a.sublayerIds.forEach((r=>{const n=t(r,u(a.sublayerInfos,r));e.add(n)})),a.tableIds.forEach((r=>{const n=t(r,u(a.tableInfos,r));e.tables.add(n)}))}(d,l,o),d}function u(e,a){return e?e.find((e=>e.id===a)):null}async function c(e,a){const r=await(0,i.C)(e,{customParameters:a});let t=null,y=null;const o=r.type;if("Feature Layer"===o||"Table"===o?(t="FeatureServer",y=r.id):"indexedVector"===o?t="VectorTileServer":r.hasOwnProperty("mapName")?t="MapServer":r.hasOwnProperty("bandCount")&&r.hasOwnProperty("pixelSizeX")?t="ImageServer":r.hasOwnProperty("maxRecordCount")&&r.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":r.hasOwnProperty("streamUrls")?t="StreamServer":d(r)?(t="SceneServer",y=r.id):r.hasOwnProperty("layers")&&d(r.layers?.[0])&&(t="SceneServer"),!t)return null;const u=null!=y?(0,s.DR)(e):null;return{title:(0,n.pC)(u)&&r.name||(0,l.vt)(e),serverType:t,sublayer:y,url:{path:(0,n.pC)(u)?u.serviceUrl:(0,l.mN)(e).path}}}function d(e){return e?.hasOwnProperty("store")&&e.hasOwnProperty("id")&&"number"==typeof e.id}},52104:(e,a,r)=>{r.d(a,{C:()=>s,V:()=>n});var t=r(3172);async function n(e,a){let r=await s(e,a);r=r||{},r.layers=r.layers?.filter(l)||[];const t={serviceJSON:r};if((r.currentVersion??0)<10.5)return t;const n=await s(e+"/layers",a);return t.layersJSON={layers:n?.layers?.filter(l)||[],tables:n?.tables||[]},t}function l(e){return!e.type||"Feature Layer"===e.type}async function s(e,a){return(await(0,t.default)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}})).data}},87344:(e,a,r)=>{r.d(a,{T:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9513)]).then(r.bind(r,2723))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(4547),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(6015),r.e(9238),r.e(719),r.e(9268),r.e(7698),r.e(223)]).then(r.bind(r,30223))).default,CSVLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(6015),r.e(9238),r.e(7827)]).then(r.bind(r,45425))).default,DimensionLayer:async()=>(await Promise.all([r.e(4547),r.e(958),r.e(81)]).then(r.bind(r,40081))).default,ElevationLayer:async()=>(await Promise.all([r.e(8794),r.e(5207)]).then(r.bind(r,49932))).default,FeatureLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(6015),r.e(9238),r.e(4202)]).then(r.bind(r,19238))).default,GroupLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9)]).then(r.bind(r,89348))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(7062)]).then(r.bind(r,3723))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(7202)]).then(r.bind(r,23477))).default,ImageryLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(4588),r.e(4599),r.e(8363),r.e(4242),r.e(4028)]).then(r.bind(r,66210))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(4547),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(8794),r.e(8363),r.e(4242),r.e(3645),r.e(2592)]).then(r.bind(r,92045))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(2710),r.e(4547),r.e(719),r.e(4046)]).then(r.bind(r,9310))).default,KMLLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(739)]).then(r.bind(r,42756))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(4547),r.e(9790),r.e(1773),r.e(958),r.e(7160)]).then(r.bind(r,67160))).default,MapImageLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(4436),r.e(7374)]).then(r.bind(r,27374))).default,MapNotesLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(4547),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(6015),r.e(9238),r.e(9956)]).then(r.bind(r,62128))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(2855)]).then(r.bind(r,88068))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9903),r.e(6237)]).then(r.bind(r,66237))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(6015),r.e(9238),r.e(9356)]).then(r.bind(r,76604))).default,PointCloudLayer:async()=>(await Promise.all([r.e(2710),r.e(1773),r.e(5468)]).then(r.bind(r,10608))).default,RouteLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(4547),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(6925)]).then(r.bind(r,40153))).default,SceneLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(4547),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(6015),r.e(9238),r.e(719),r.e(9268),r.e(7698),r.e(7476)]).then(r.bind(r,57476))).default,StreamLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(5004)]).then(r.bind(r,88387))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(6015),r.e(2374)]).then(r.bind(r,30359))).default,TileLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(8794),r.e(4436),r.e(8636)]).then(r.bind(r,98636))).default,UnknownLayer:async()=>(await r.e(4166).then(r.bind(r,44166))).default,UnsupportedLayer:async()=>(await r.e(9296).then(r.bind(r,39296))).default,VectorTileLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(8794),r.e(4325),r.e(1785),r.e(7272)]).then(r.bind(r,24109))).default,VoxelLayer:async()=>(await Promise.all([r.e(2710),r.e(6794)]).then(r.bind(r,28865))).default,WebTileLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9903)]).then(r.bind(r,16199))).default,WFSLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(4547),r.e(9790),r.e(1773),r.e(4992),r.e(8476),r.e(1423),r.e(4588),r.e(911),r.e(5546),r.e(3810)]).then(r.bind(r,12653))).default,WMSLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9790),r.e(1773),r.e(8383)]).then(r.bind(r,25906))).default,WMTSLayer:async()=>(await Promise.all([r.e(2710),r.e(1612),r.e(9903),r.e(5853)]).then(r.bind(r,55853))).default}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2592],{13867:(e,t,i)=>{i.d(t,{Z:()=>s});var r=i(69801);class s{constructor(e,t){this._storage=new r.WJ,this._storage.maxSize=e,t&&this._storage.registerRemoveFunc("",t)}put(e,t,i){this._storage.put(e,t,i,1)}pop(e){return this._storage.pop(e)}get(e){return this._storage.get(e)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}}},51806:(e,t,i)=>{i.d(t,{aX:()=>R});var r=i(68773),s=i(20102),n=i(92604),a=i(70586),o=i(38913),l=i(58901),c=i(82971),u=i(33955);const f={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new l.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:c.Z.WebMercator}),minus180Line:new l.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:c.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new l.Z({paths:[[[180,-180],[180,180]]],spatialReference:c.Z.WGS84}),minus180Line:new l.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:c.Z.WGS84})}};function h(e,t){return Math.ceil((e-t)/(2*t))}function d(e,t){const i=p(e);for(const e of i)for(const i of e)i[0]+=t;return e}function p(e){return(0,u.oU)(e)?e.rings:e.paths}var m=i(8744),y=i(40488),g=(i(66577),i(3172)),x=i(11282),I=i(17452);const b=n.Z.getLogger("esri.geometry.support.normalizeUtils");function w(e){return"polygon"===e[0].type}function _(e){return"polyline"===e[0].type}function S(e,t,i){if(t){const t=function(e,t){if(!(e instanceof l.Z||e instanceof o.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw b.error(e),new s.Z(e)}const i=p(e),r=[];for(const e of i){const i=[];r.push(i),i.push([e[0][0],e[0][1]]);for(let r=0;r<e.length-1;r++){const s=e[r][0],n=e[r][1],a=e[r+1][0],o=e[r+1][1],l=Math.sqrt((a-s)*(a-s)+(o-n)*(o-n)),c=(o-n)/l,u=(a-s)/l,f=l/t;if(f>1){for(let e=1;e<=f-1;e++){const r=e*t,a=u*r+s,o=c*r+n;i.push([a,o])}const e=(l+Math.floor(f-1)*t)/2,r=u*e+s,a=c*e+n;i.push([r,a])}i.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new o.Z({rings:r,spatialReference:e.spatialReference}):new l.Z({paths:r,spatialReference:e.spatialReference})}(e,1e6);e=(0,y.Sx)(t,!0)}return i&&(e=d(e,i)),e}function v(e,t,i){if(Array.isArray(e)){const r=e[0];if(r>t){const i=h(r,t);e[0]=r+i*(-2*t)}else if(r<i){const t=h(r,i);e[0]=r+t*(-2*i)}}else{const r=e.x;if(r>t){const i=h(r,t);e=e.clone().offset(i*(-2*t),0)}else if(r<i){const t=h(r,i);e=e.clone().offset(t*(-2*i),0)}}return e}function C(e,t){let i=-1;for(let r=0;r<t.cutIndexes.length;r++){const s=t.cutIndexes[r],n=t.geometries[r],a=p(n);for(let e=0;e<a.length;e++){const t=a[e];t.some((i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const r=t[e][0];i=r>i?r:i}i=Number(i.toFixed(9));const r=-360*h(i,180);for(let i=0;i<t.length;i++){const t=n.getPoint(e,i);n.setPoint(e,i,t.clone().offset(r,0))}return!0}}))}if(s===i){if(w(e))for(const t of p(n))e[s]=e[s].addRing(t);else if(_(e))for(const t of p(n))e[s]=e[s].addPath(t)}else i=s,e[s]=n}return e}async function R(e,t,i){if(!Array.isArray(e))return R([e],t);t&&"string"!=typeof t&&b.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const s="string"==typeof t?t:t?.url??r.Z.geometryServiceUrl;let n,c,p,w,_,T,k,F,P=0;const M=[],O=[];for(const t of e)if((0,a.Wi)(t))O.push(t);else if(n||(n=t.spatialReference,c=(0,m.C5)(n),p=n.isWebMercator,T=p?102100:4326,w=f[T].maxX,_=f[T].minX,k=f[T].plus180Line,F=f[T].minus180Line),c)if("mesh"===t.type)O.push(t);else if("point"===t.type)O.push(v(t.clone(),w,_));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>v(e,w,_))),O.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,c);O.push(e.rings?new o.Z(e):e)}else if(t.extent){const e=t.extent,i=h(e.xmin,_)*(2*w);let r=0===i?t.clone():d(t.clone(),i);e.offset(i,0),e.intersects(k)&&e.xmax!==w?(P=e.xmax>P?e.xmax:P,r=S(r,p),M.push(r),O.push("cut")):e.intersects(F)&&e.xmin!==_?(P=e.xmax*(2*w)>P?e.xmax*(2*w):P,r=S(r,p,360),M.push(r),O.push("cut")):O.push(r)}else O.push(t.clone());else O.push(t);let B=h(P,w),D=-90;const z=B,J=new l.Z;for(;B>0;){const e=360*B-180;J.addPath([[e,D],[e,-1*D]]),D*=-1,B--}if(M.length>0&&z>0){const t=C(M,await async function(e,t,i,r){const s=(0,x.en)(e),n=t[0].spatialReference,a={...r,query:{...s.query,f:"json",sr:JSON.stringify(n),target:JSON.stringify({geometryType:(0,u.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await(0,g.default)(s.path+"/cut",a),{cutIndexes:l,geometries:c=[]}=o.data;return{cutIndexes:l,geometries:c.map((e=>{const t=(0,u.im)(e);return t.spatialReference=n,t}))}}(s,M,J,i)),r=[],n=[];for(let i=0;i<O.length;i++){const s=O[i];if("cut"!==s)n.push(s);else{const s=t.shift(),o=e[i];(0,a.pC)(o)&&"polygon"===o.type&&o.rings&&o.rings.length>1&&s.rings.length>=o.rings.length?(r.push(s),n.push("simplify")):n.push(p?(0,y.$)(s):s)}}if(!r.length)return n;const o=await async function(e,t,i){const r="string"==typeof e?(0,I.mN)(e):e,s=t[0].spatialReference,n=(0,u.Ji)(t[0]),a={...i,query:{...r.query,f:"json",sr:s.wkid?s.wkid:JSON.stringify(s),geometries:JSON.stringify((l=t,{geometryType:(0,u.Ji)(l[0]),geometries:l.map((e=>e.toJSON()))}))}},{data:o}=await(0,g.default)(r.path+"/simplify",a);var l;return function(e,t,i){const r=(0,u.q9)(t);return e.map((e=>{const t=r.fromJSON(e);return t.spatialReference=i,t}))}(o.geometries,n,s)}(s,r,i),l=[];for(let e=0;e<n.length;e++){const t=n[e];"simplify"!==t?l.push(t):l.push(p?(0,y.$)(o.shift()):o.shift())}return l}const N=[];for(let e=0;e<O.length;e++){const t=O[e];if("cut"!==t)N.push(t);else{const e=M.shift();N.push(!0===p?(0,y.$)(e):e)}}return N}},92045:(e,t,i)=>{i.r(t),i.d(t,{default:()=>nt});var r=i(43697),s=i(51773),n=i(30030),a=i(20102),o=i(70586),l=i(16453),c=i(95330),u=i(17445),f=i(5600),h=(i(67676),i(75215)),d=i(36030),p=i(71715),m=i(52011),y=i(87085),g=i(71612),x=i(17017),I=(i(66577),i(3172)),b=i(92604),w=i(8744),_=i(66677),S=i(21506),v=i(35956),C=i(29876),R=i(40297),T=i(88281),k=i(11145),F=i(96674),P=i(609),M=i(36679),O=i(99815),B=i(73506),D=i(94139);const z=new Map,J=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,r=this._cachedBlocks;if(r.has(i)){const e=r.get(i);return e.refCount--,e.refCount<=0&&(r.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,r=this._cachedBlocks;if(r.has(i)){const e=r.get(i);return e.ts=Date.now(),e.refCount++,r.delete(i),r.set(i,e),e.block}return null}putBlock(e,t,i,r){const s=this._cachedBlocks,n=e+"/"+t;if(s.has(n)){const e=s.get(n);e.ts=Date.now(),e.refCount++}else s.set(n,{block:i,ts:Date.now(),refCount:1,controller:r});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,r=e+"/"+t;i.has(r)&&i.delete(r)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),i=Date.now();for(let r=0;r<t.length&&t[r][1].ts<=i-this._duration;r++)e.delete(t[r][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function N(e,t){return null==t?e:`${e}?sliceId=${t}`}function W(e,t,i){const r=z.get(e);if(!r)return null==t?J.decreaseRefCount(e,i):0;if(null==t||null==r[t])return J.decreaseRefCount(e,i);const s=r[t]?.cache,n=s?.get(i);if(s&&n){if(n.refCount--,0===n.refCount){s.delete(i);for(let e=0;e<r.length;e++)r[e]?.cache.delete(i);n.controller&&n.controller.abort()}return n.refCount}return 0}function E(e,t,i){const r=z.get(e);if(!r)return null==t?J.getBlock(e,i):null;if(null==t||null==r[t]){for(let e=0;e<r.length;e++){const t=r[e]?.cache.get(i);if(t)return t.refCount++,t.block}return J.getBlock(e,i)}const s=r[t]?.cache.get(i);if(s)return s.refCount++,s.block;for(let e=0;e<r.length;e++){if(e===t||!r[e])continue;const s=r[e]?.cache,n=s?.get(i);if(s&&n)return n.refCount++,s.set(i,n),n.block}return null}function H(e,t,i,r,s=null){const n=z.get(e);if(!n)return void(null==t&&J.putBlock(e,i,r,s));if(null==t||null==n[t])return void J.putBlock(e,i,r,s);const a={refCount:1,block:r,isResolved:!1,isRejected:!1,controller:s};r.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),n[t]?.cache.set(i,a)}function Z(e,t,i){const r=z.get(e);r?null!=t&&null!=r[t]?r[t]?.cache.delete(i):J.deleteBlock(e,i):null==t&&J.deleteBlock(e,i)}var A=i(75993),L=i(55914),j=i(80676),q=i(6570);let G=class extends((0,P.v)(F.wq)){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,B.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:k.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,B.ut)(e.spatialReference);return(0,o.pC)(t)&&e.extent.width>=t/2}set url(e){this._set("url",(0,_.Nm)(e,b.Z.getLogger(this.declaredClass)))}async open(e){throw new a.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,i,r={}){const s=r.tileInfo||this.rasterInfo.storageInfo.tileInfo,n=this.getTileExtentFromTileInfo(e,t,i,s);return this.fetchPixels(n,s.size[0],s.size[1],r)}async identify(e,t={}){e=(0,h.TJ)(D.Z,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:r}=t,{hasMultidimensionalTranspose:s,multidimensionalInfo:n}=this.rasterInfo;let{transposedVariableName:a}=t;const l=(0,o.pC)(n)&&s&&(null!=r||(0,O.WU)(i));l&&!a&&(a=(0,o.pC)(i)&&i.length>0?i[0].variableName??void 0:n.variables[0].name,t={...t,transposedVariableName:a}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=this.rasterInfo,{datumTransformation:f}=t;let d=(0,B.nF)(e,c,f);if(!u.intersects(d))return{location:d,value:null};if((0,o.pC)(this.rasterInfo.transform)){const e=this.rasterInfo.transform.inverseTransform(d);if(!this.rasterInfo.nativeExtent.intersects(e))return{location:e,value:null};d=e}let p=0;const m=(0,o.pC)(a)&&(0,o.pC)(n)&&this.rasterInfo.hasMultidimensionalTranspose;if(!m)if(t.srcResolution)p=(0,B.kr)(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel;else if(p=await this.computeBestPyramidLevelForLocation(e,t),null==p)return{location:d,value:null};const y=this.identifyPixelLocation(d,p,null,m);if(null===y)return{location:d,value:null};const{row:g,col:x,rowOffset:I,colOffset:b,blockWidth:w}=y,_=a??(0,o.Wg)(t.sliceId),S=N(this.url,_),v=`${p}/${g}/${x}`;let C=E(S,null,v);(0,o.Wi)(C)&&(C=this.fetchRawTile(p,g,x,t),H(S,null,v,C));const R=await C;if((0,o.Wi)(R)||!R.pixels?.length)return{location:d,value:null};const T=I*w+b;return this._processIdentifyResult(R,{srcLocation:d,position:T,pyramidLevel:p,useTransposedTile:!!m,requestSomeSlices:l,identifyOptions:t})}async fetchPixels(e,t,i,r={}){if(e=(0,B.kZ)(e),(r=this._getRequestOptionsWithSliceId(r)).requestRawData)return this._fetchPixels(e,t,i,r);const s=(0,B.ut)(e.spatialReference),n=(0,B.Hq)(e);if((0,o.Wi)(s)||0===n||1===n&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,i,r);if(n>=3)return{extent:e,pixelBlock:null};const a=[],{xmin:l,xmax:c}=e,u=Math.round(s/(c-l)*t),f=u-Math.round((s/2-l)/(c-l)*t);let h=0;const d=[];for(let o=0;o<=n;o++){const p=new q.Z({xmin:0===o?l:-s/2,xmax:o===n?c-s*o:s/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),m=0===o?u-f:o===n?t-h:u;h+=m,d.push(m);const y=r.disableWrapAround&&o>0?null:this._fetchPixels(p,m,i,r);a.push(y)}const p=(await Promise.all(a)).map((e=>e?.pixelBlock));let m=null;const y={width:t,height:i};return m=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:d},r)).pixelBlock:(0,L.us)(p,y,{blockWidths:d}),{extent:e,srcExtent:(0,B.tB)(e,this.rasterInfo.spatialReference,r.datumTransformation),pixelBlock:m}}async fetchRawPixels(e,t,i,r={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const s=await this._fetchRawTiles(e,t,i,r),{nativeExtent:n,nativePixelSize:a,storageInfo:l}=this.rasterInfo,c=2**e,u=a.x*c,f=a.y*c,h=new q.Z({xmin:n.xmin+u*t.x,xmax:n.xmin+u*(t.x+i.width-1),ymin:n.ymax-f*(t.y+i.height-1),ymax:n.ymax-f*t.y,spatialReference:n.spatialReference});if(!s)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:d,mosaicSize:p}=s;if(1===d.length&&(0,o.pC)(d[0])&&d[0].width===i.width&&d[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:s.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,y=e>0?l.pyramidBlockHeight:l.blockHeight,g={x:t.x%m,y:t.y%y};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:p,destDimension:i,clipOffset:g,clipSize:i,coefs:null,sampleSpacing:null,interpolation:r.interpolation,alignmentInfo:null,blockWidths:null},r)).pixelBlock:(0,L.us)(d,p,{clipOffset:g,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:x}}fetchRawTile(e,t,i,r){throw new a.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,B.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,A.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:r}=this.ioConfig,{range:s,query:n,headers:a}=t;i=i??t.retryCount??this.ioConfig.retryCount;const o=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await(0,I.default)(e,{...t,query:{...n,...r},headers:{...a,...o}})}catch(r){if(i>0)return i--,this.request(e,t,i);throw r}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return(0,o.Wi)(t)||(0,o.Wi)(e)||0===e.length?null:(0,O.gk)(e,t)}getTileExtentFromTileInfo(e,t,i,r){const s=(0,o.s3)(r.lodAt(e));return this.getTileExtent({x:s.resolution,y:s.resolution},t,i,r.origin,r.spatialReference,r.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:r}=this.rasterInfo;if(!e.tileInfo){const s=[],n=e.maximumPyramidLevel||0;let a=Math.max(r.x,r.y),o=1/.0254*96*a;for(let e=0;e<=n;e++)s.push({level:n-e,resolution:a,scale:o}),a*=2,o*=2;const l=new D.Z({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new k.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:s}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,r){const{width:s,height:n,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new D.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==r&&(r=Math.max(0,Math.round(Math.log(Math.max(s,n))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],r);e.storageInfo=new M.Z({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:r,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,r,s,n=0,a=2){if(1===s.length&&n>0){s=[...s];let{x:e,y:t}=s[0];for(let i=0;i<n;i++)e*=a,t*=a,s.push({x:e,y:t})}const o=[],{x:l,y:c}=r;for(let r=0;r<s.length;r++){const{x:n,y:a}=s[r];o.push({minCol:Math.floor((e.xmin-l+.1*n)/t/n),maxCol:Math.floor((e.xmax-l-.1*n)/t/n),minRow:Math.floor((c-e.ymax+.1*a)/i/a),maxRow:Math.floor((c-e.ymin-.1*a)/i/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:r}=this.rasterInfo.storageInfo;if(0===e)return t;if((0,o.pC)(i)&&i.length)return i[e-1];const s=r**e;return{x:t.x*s,y:t.y*s}}identifyPixelLocation(e,t,i,r){const{spatialReference:s,nativeExtent:n,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:l,origin:c,transposeInfo:u}=a,f=r&&(0,o.pC)(u)?u.tileSize[0]:a.blockWidth,h=r&&(0,o.pC)(u)?u.tileSize[1]:a.blockHeight,d=(0,B.nF)(e,s,i);if(!n.intersects(d))return null;if(t<0||t>l)return null;const p=this.getPyramidPixelSize(t),{x:m,y}=p,g=(c.y-d.y)/y/h,x=(d.x-c.x)/m/f,I=Math.min(h-1,Math.floor((g-Math.floor(g))*h)),b=Math.min(f-1,Math.floor((x-Math.floor(x))*f));return{pyramidLevel:t,row:Math.floor(g),col:Math.floor(x),rowOffset:I,colOffset:b,blockWidth:f,srcLocation:d}}getTileExtent(e,t,i,r,s,n){const[a,o]=n,l=r.x+i*a*e.x,c=l+a*e.x,u=r.y-t*o*e.y,f=u-o*e.y;return new q.Z({xmin:l,xmax:c,ymin:f,ymax:u,spatialReference:s})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const r=this.rasterInfo.storageInfo.blockBoundary[e];return!r||r.maxRow<t||r.maxCol<i||r.minRow>t||r.minCol>i}async _fetchPixels(e,t,i,r={}){let s=(0,B.Hq)(e);if(s>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,i,r),{pyramidLevel:a,pyramidResolution:l,srcResolution:c,srcExtent:u,srcWidth:f,srcHeight:h}=n;if(0===f||0===h)return{extent:e,srcExtent:u,pixelBlock:null};const d=(0,o.Wg)(this.rasterInfo.transform),p="gcs-shift"===d?.type,m=(0,o.pC)((0,B.ut)(e.spatialReference));!p&&m||(s=(0,B.Hq)(n.srcExtent,p));const y=this.rasterInfo.storageInfo,g={x:Math.floor((u.xmin-y.origin.x)/l.x+.1),y:Math.floor((y.origin.y-u.ymax)/l.y+.1)},x=await this._fetchRawTiles(a,g,{width:f,height:h,wrapCount:s},r);if(!x)return{extent:e,srcExtent:u,pixelBlock:null};const I=a>0?y.pyramidBlockWidth:y.blockWidth,b=a>0?y.pyramidBlockHeight:y.blockHeight,w=I===f&&b===h&&g.x%I==0&&g.y%b==0,_=new D.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),S=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:v}=r;if(!S&&w&&1===x.pixelBlocks.length&&I===t&&b===i&&c.x===_.x&&c.y===_.y)return{extent:e,srcExtent:u,pixelBlock:x.pixelBlocks[0]};const C=m&&(0,o.pC)((0,B.ut)(u.spatialReference)),R=r.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");R&&!this.rasterJobHandler&&await(0,B.zD)();const T=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:_.toJSON(),datumTransformation:v,rasterTransform:d,hasWrapAround:s>0||C,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:R},r):(0,B.Qp)({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:_,datumTransformation:v,rasterTransform:d,hasWrapAround:s>0||C,isAdaptive:!1,includeGCSGrid:R});let k;const F=!r.requestRawData,P={rows:T.spacing[0],cols:T.spacing[1]},M=(0,o.Wg)(this._getRasterTileAlignmentInfo(a,x.extent.xmin)),{pixelBlocks:O,mosaicSize:z,isPartiallyFilled:J}=x;let N=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:O,srcMosaicSize:z,destDimension:F?{width:t,height:i}:null,coefs:F?T.coefficients:null,sampleSpacing:F?P:null,projectDirections:R,gcsGrid:R?T.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:r.interpolation,alignmentInfo:M,blockWidths:null},r);({pixelBlock:k,localNorthDirections:N}=e)}else{const e=(0,L.us)(O,z,{alignmentInfo:M});k=F?(0,L.Uk)(e,{width:t,height:i},T.coefficients,P,r.interpolation):e,R&&T.gcsGrid&&(N=(0,L.Qh)({width:t,height:i},T.gcsGrid),k=(0,j.xQ)(k,this.rasterInfo.dataType,N))}return r.requestRawData||R?{srcExtent:u,pixelBlock:k,transformGrid:T,localNorthDirections:N,extent:e,isPartiallyFilled:J}:{srcExtent:u,extent:e,pixelBlock:k}}async _fetchRawTiles(e,t,i,r){const{origin:s,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:l}=this.getBlockWidthHeight(e);let{x:c,y:u}=t,{width:f,height:h,wrapCount:d}=i;const p=this._getRasterTileAlignmentInfo(e,0);r.buffer&&(c-=r.buffer.cols,u-=r.buffer.rows,f+=2*r.buffer.cols,h+=2*r.buffer.rows);let m=0,y=0,g=0;d&&(0,o.pC)(p)&&(({worldColumnCountFromOrigin:y,originColumnOffset:g,rightPadding:m}=p),y*p.blockWidth-m>=c+f&&(m=0));const x=Math.floor(c/a),I=Math.floor(u/l),b=Math.floor((c+f+m-1)/a),w=Math.floor((u+h+m-1)/l),_=n[e];if(!_)return null;const{minRow:S,minCol:v,maxCol:C,maxRow:R}=_;if(0===d&&(w<S||b<v||I>R||x>C))return null;const T=new Array;let k=!1;const F=null==this.ioConfig.allowPartialFill?r.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=I;t<=w;t++)for(let i=x;i<=b;i++){let s=i;if(!r.disableWrapAround&&d&&(0,o.pC)(p)&&y<=i&&(s=i-y-g),t>=S&&s>=v&&R>=t&&C>=s){const i=this._fetchRawTile(e,t,s,r);F?T.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{k=!0,e(null)}))}))):T.push(i)}else T.push(Promise.resolve(null))}if(0===T.length)return null;const P=await Promise.all(T),M={height:(w-I+1)*l,width:(b-x+1)*a},{spatialReference:O}=this.rasterInfo,B=this.getPyramidPixelSize(e),{x:D,y:z}=B;return{extent:new q.Z({xmin:s.x+x*a*D,xmax:s.x+(b+1)*a*D,ymin:s.y-(w+1)*l*z,ymax:s.y-I*l*z,spatialReference:O}),pixelBlocks:P,mosaicSize:M,isPartiallyFilled:k}}_fetchRawTile(e,t,i,r){const s=this.rasterInfo.storageInfo.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:n,minCol:a,maxCol:l,maxRow:u}=s;if(t<n||i<a||t>u||i>l)return Promise.resolve(null);const f=N(this.url,r.sliceId),h=`${e}/${t}/${i}`;let d=E(f,r.registryId,h);if((0,o.Wi)(d)){const s=new AbortController;d=this.fetchRawTile(e,t,i,{...r,signal:s.signal}),H(f,r.registryId,h,d,s),d.catch((()=>Z(f,r.registryId,h)))}return r.signal&&(0,c.fu)(r,(()=>{W(f,r.registryId,h)})),d}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const r=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[s,n]=e,a=[],o=[];for(let e=0;e<r;e++){const[t,i]=(0,j.Tg)([s[e],n[e]]);a.push(t),o.push(i)}return[a,o]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,B.P_)(this.rasterInfo)),(0,o.Wi)(this._rasterTileAlighmentInfo.pyramidsInfo)?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,r={}){const s={datumTransformation:r.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0};r.srcResolution&&(s.srcResolution=r.srcResolution,this._updateSourceDataInfo(e,s));const n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=s,c=a/t,u=o/i,f=l<n&&c*u>=16;if(f||l===n&&(c>8||u>8)||0===a||0===o){const a=new D.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let o=(0,B.VO)(a,this.rasterInfo.spatialReference,e,s.datumTransformation);const h=!o||r.srcResolution&&o.x+o.y<r.srcResolution.x+r.srcResolution.y;if(f&&r.srcResolution&&h){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(n-l+3>=e){const t=2**e;o={x:r.srcResolution.x*t,y:r.srcResolution.y*t}}}o&&(s.srcResolution=o,this._updateSourceDataInfo(e,s))}return(s.srcWidth/t>8||s.srcHeight/i>8)&&(s.srcWidth=0,s.srcHeight=0),s}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const i=this.rasterInfo.spatialReference,{srcResolution:r,datumTransformation:s}=t,{pyramidLevel:n,pyramidResolution:a,excessiveReading:l}=(0,B.kr)(r,this.rasterInfo,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,B.tB)(e,i,s);if(null==c)return;const u=(0,o.Wg)(this.rasterInfo.transform);u&&(c=u.inverseTransform(c)),t.srcExtent=c;const f=Math.ceil((c.xmax-c.xmin)/a.x-.1),h=Math.ceil((c.ymax-c.ymin)/a.y-.1);t.pyramidLevel=n,t.pyramidResolution=a,t.srcWidth=f,t.srcHeight=h}_getRequestOptionsWithSliceId(e){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:r,pyramidLevel:s,useTransposedTile:n}=t,a=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[r])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if((0,o.Wi)(l)||!n){const t=e.pixels.map((e=>e[r])),n={location:i,value:t,pyramidLevel:s},a=this._computeMagDirValues(t.map((e=>[e])));return a?.length&&(n.magdirValue=a.map((e=>e[0]))),n}let c=e.pixels.map((e=>Array.prototype.slice.call(e,r*a,r*a+a))),u=this._computeMagDirValues(c);const{requestSomeSlices:f,identifyOptions:h}=t;let d=(0,O.MO)(l,h.transposedVariableName);if(f){const e=(0,O.Ur)(d,(0,o.Wg)(h.multidimensionalDefinition),(0,o.Wg)(h.timeExtent));c=c.map((t=>e.map((e=>t[e])))),u=u?.map((t=>e.map((e=>t[e])))),d=e.map((e=>d[e]))}return{location:i,value:null,dataSeries:d.map(((e,t)=>{const i={value:c.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new v.Z({...e,isSlice:!0})))};return u?.length&&(i.magdirValue=[u[0][t],u[1][t]]),i})),pyramidLevel:s}}};(0,r._)([(0,f.Cb)()],G.prototype,"_rasterTileAlighmentInfo",void 0),(0,r._)([(0,f.Cb)({readOnly:!0})],G.prototype,"_isGlobalWrappableSource",null),(0,r._)([(0,f.Cb)(S.HQ)],G.prototype,"url",null),(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],G.prototype,"datasetName",void 0),(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],G.prototype,"datasetFormat",void 0),(0,r._)([(0,f.Cb)()],G.prototype,"rasterInfo",void 0),(0,r._)([(0,f.Cb)()],G.prototype,"ioConfig",void 0),(0,r._)([(0,f.Cb)()],G.prototype,"sourceJSON",void 0),G=(0,r._)([(0,m.j)("esri.layers.support.rasterDatasets.BaseRaster")],G);const U=G;let $=class extends U{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._primaryRasters=null}async open(e){await this.init();const{rasterFunction:t}=this,{rasters:i,rasterIds:r}=t.getPrimaryRasters(),s=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(s);const n=i.map((({rasterInfo:e})=>e)),o=t.bind({rasterInfos:n,rasterIds:r});if(!o.success)throw new a.Z("raster-function:open",`cannot bind the function: ${o.error??""}`);await this.syncJobHandler(),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo)}async syncJobHandler(){const{rasterFunction:e}=this;if(this._primaryRasters=e.getPrimaryRasters(),this.rasterJobHandler)return this.rasterJobHandler.updateRasterFunction(e)}async fetchPixels(e,t,i,r={}){const{rasters:s,rasterIds:n}=this._primaryRasters,a=s.map((s=>s.fetchPixels(e,t,i,r))),l=await Promise.all(a),c=l.map((e=>e.pixelBlock));if(c.every((e=>(0,o.Wi)(e))))return l[0];const u=l.find((e=>(0,o.pC)(e.pixelBlock)))?.extent??e,f=this.rasterJobHandler?await this.rasterJobHandler.process({extent:u,primaryPixelBlocks:c,primaryRasterIds:n}):this.rasterFunction.process({extent:u,primaryPixelBlocks:c,primaryRasterIds:n});return{...l[0],pixelBlock:f}}};(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],$.prototype,"datasetFormat",void 0),(0,r._)([(0,f.Cb)()],$.prototype,"tileType",void 0),(0,r._)([(0,f.Cb)()],$.prototype,"rasterFunction",void 0),$=(0,r._)([(0,m.j)("esri.layers.support.rasterDatasets.FunctionRaster")],$);const V=$;var X=i(55444),Y=i(67058),K=i(72758),Q=i(23808),ee=i(82971);const te=b.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),ie=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalDefinition=null,this.multidimensionalSubset=null,this.raster=null,this.rasterFunction=null,this.sourceJSON=null,this.symbolizer=null}get fullExtent(){return this.rasterInfo?.extent}get rasterInfo(){return this.raster?.rasterInfo}get spatialReference(){return this.rasterInfo?.spatialReference??ee.Z.WGS84}get tileInfo(){return this.rasterInfo?.storageInfo.tileInfo}set url(e){this._set("url",(0,_.Nm)(e,te))}set renderer(e){this._set("renderer",e),this.updateRenderer()}async convertVectorFieldData(e,t){if((0,o.Wi)(e)||!this.rasterInfo)return null;const i=this._rasterJobHandler.instance,r=this.rasterInfo.dataType;return i?i.convertVectorFieldData({pixelBlock:e,dataType:r},t):(0,j.KC)(e,r)}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,Q.GE)(e.meshType,e.simulationSettings,e.flowData,(0,o.pC)(t.signal)?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo??{};if((0,o.Wi)(t))return e;let i=e.multidimensionalDefinition||this.multidimensionalDefinition;!(0,o.Wi)(i)&&i.length||(i=(0,O.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const r=e.timeExtent||this.timeExtent;if((0,o.pC)(i)&&(0,o.pC)(r)&&((0,o.pC)(r.start)||(0,o.pC)(r.end))){i=i.map((e=>e.clone()));const s=t.variables.find((({name:e})=>e===i[0].variableName))?.dimensions?.find((({name:e})=>"StdTime"===e)),n=i.find((({dimensionName:e})=>"StdTime"===e));if(!s||!n)return{...e,multidimensionalDefinition:null};const{start:a,end:l}=r,c=(0,o.Wi)(a)?null:a.getTime(),u=(0,o.Wi)(l)?null:l.getTime(),f=c??u,h=u??c;if((0,o.pC)(s.values)){const e=s.values.filter((e=>{if(Array.isArray(e)){if(f===h)return e[0]<=f&&e[1]>=f;const t=e[0]<=f&&e[1]>f||e[0]<h&&e[1]>=h,i=e[0]>=f&&e[1]<=h||e[0]<f&&e[1]>h;return t||i}return f===h?e===f:e>=f&&e<=h}));if(e.length){const t=e.sort(((e,t)=>f===h?(e[0]??e)-(t[0]??t):Math.abs((e[1]??e)-h)-Math.abs((t[1]??t)-h)))[0];n.values=[t]}else i=null}else if(s.hasRegularIntervals&&s.extent){const[e,t]=s.extent;f>t||h<e?i=null:n.values=f===h?[f]:[Math.max(e,f),Math.min(t,h)]}}return(0,o.pC)(i)&&(0,O.nb)(i,this.multidimensionalSubset)?{...e,multidimensionalDefinition:null}:{...e,multidimensionalDefinition:i}}async updateRenderer(){const{loaded:e,symbolizer:t}=this;if(!e||!t)return;if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(this.renderer))return;const i=this._rasterJobHandler.instance;i&&(t.rendererJSON=(0,Y.ol)(this.renderer.toJSON()),t.bind(),await i.updateSymbolizer(t),this._cachedRendererJson=this.renderer.toJSON())}async applyRenderer(e,t){const i=e&&e.pixelBlock;if(!((0,o.pC)(i)&&i.pixels&&i.pixels.length>0))return null;let r;await this.updateRenderer();const s=this._rasterJobHandler.instance,n=this.bandIds??[];return r=s?await s.symbolize({...e,simpleStretchParams:t,bandIds:n}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:n}),r}getTileUrl(e,t,i){return"RasterTileServer"===this.raster?.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||(0,o.Wi)(t))return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const r=(0,w.C5)(e);return k.Z.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,r,s={}){if(i(this),s.requestAsImageElement){const i=this.getTileUrl(e,t,r);return(0,I.default)(i,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}if((0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(s=this.normalizeRasterFetchOptions(s),(0,o.Wi)(s.multidimensionalDefinition))){const i=s.tileInfo||this.rasterInfo.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,r,i),pixelBlock:null}}return await this._initJobHandler(),await this._updateRasterFunction(),"raster-shaded-relief"===this.renderer.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,r,s)}async fetchPixels(e,t,i,r={}){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(r=this.normalizeRasterFetchOptions(r),(0,o.Wi)(r.multidimensionalDefinition))?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this._updateRasterFunction(),this.raster.fetchPixels(e,t,i,r))}async identify(e,t={}){return i(this),!(0,o.pC)(this.rasterInfo.multidimensionalInfo)||this.rasterInfo.hasMultidimensionalTranspose&&((0,O.WU)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||(t=this.normalizeRasterFetchOptions(t),!(0,o.Wi)(t.multidimensionalDefinition))?this.raster.identify(e,t):{location:e,value:null}}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.rasterInfo?.multidimensionalInfo;if((0,o.Wi)(e)||"standard-time"!==this.rasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(e){const t=e??this.rasterInfo.multidimensionalInfo;return(0,O.jj)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,O.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new T.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{i(this),this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,this.renderer&&this.updateRenderer(),"Function"===this.raster.datasetFormat&&this.raster.syncJobHandler()})).catch((()=>{})),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(null==this.interpolation){i(this);const e=(0,Y.In)(this.rasterInfo,this.raster.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",e)}}_configDefaultRenderer(){i(this);const e=this.raster.rasterInfo;if(this.bandIds||(this.bandIds=(0,Y.YD)(e)),!this.renderer){const t=(0,Y.Ob)(e,{bandIds:this.bandIds,variableName:(0,o.pC)(this.multidimensionalDefinition)?this.multidimensionalDefinition[0]?.variableName:null});"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===t.type&&((e.statistics?.[0].max??0)>1e24||(e.statistics?.[0].min??0)<-1e24)&&(t.dynamicRangeAdjustment=!0,t.statistics=null,"none"===t.stretchType&&(t.stretchType="min-max")),this.renderer=t}this.symbolizer?(this.symbolizer.rendererJSON=(0,Y.ol)(this.renderer.toJSON()),this.symbolizer.rasterInfo=e):this.symbolizer=new K.Z({rendererJSON:this.renderer.toJSON(),rasterInfo:e});const t=this.symbolizer.bind();t.success||te.warn("imagery-tile-mixin",t.error||"The given renderer is not supported by the layer.")}async _updateRasterFunction(){if("imagery-tile"!==this.type||JSON.stringify(this.rasterFunction)===JSON.stringify(this._cachedRasterFunctionJson))return;let e=this.raster;if("Function"===e?.datasetFormat){const t=e.rasterFunction.getPrimaryRasters();e=t.rasters[0]}const{rasterFunction:t}=this;if(t){const i=(0,X.Ue)(t.toJSON(),{raster:e}),r=new V({rasterFunction:i});r.rasterJobHandler=this._rasterJobHandler.instance,await r.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=r}else this.raster=e}};function i(e){if(!e.raster||!e.rasterInfo)throw new a.Z("imagery-tile","no raster")}return(0,r._)([(0,f.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,r._)([(0,f.Cb)()],t.prototype,"_cachedRasterFunctionJson",void 0),(0,r._)([(0,f.Cb)()],t.prototype,"_compatibleFullExtent",void 0),(0,r._)([(0,f.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,r._)([(0,f.Cb)()],t.prototype,"bandIds",void 0),(0,r._)([(0,f.Cb)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,r._)([(0,f.Cb)()],t.prototype,"interpolation",void 0),(0,r._)([(0,f.Cb)()],t.prototype,"ioConfig",void 0),(0,r._)([(0,f.Cb)({type:[v.Z]})],t.prototype,"multidimensionalDefinition",void 0),(0,r._)([(0,f.Cb)({type:C.Z,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,r._)([(0,f.Cb)()],t.prototype,"raster",void 0),(0,r._)([(0,f.Cb)({type:R.Z})],t.prototype,"rasterFunction",void 0),(0,r._)([(0,f.Cb)()],t.prototype,"rasterInfo",null),(0,r._)([(0,f.Cb)()],t.prototype,"sourceJSON",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],t.prototype,"spatialReference",null),(0,r._)([(0,f.Cb)({json:{read:!1}})],t.prototype,"tileInfo",null),(0,r._)([(0,f.Cb)(S.HQ)],t.prototype,"url",null),(0,r._)([(0,f.Cb)({types:n.dr})],t.prototype,"renderer",null),(0,r._)([(0,f.Cb)()],t.prototype,"symbolizer",void 0),t=(0,r._)([(0,m.j)("esri.layers.ImageryTileMixin")],t),t};var re=i(38009),se=i(16859),ne=i(34760),ae=i(72965),oe=i(28294),le=i(1231),ce=i(69608),ue=i(48526),fe=i(20095);function he(e){const t=e.fields,i=e.records,r=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",s=[{name:r,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),n=s.map((e=>e.name)),a=[];let o=0,l=0;return i.forEach((e=>{const t={};for(t[r]=o++,l=1;l<n.length;l++)t[n[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:s,features:a}}class de{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const r=t.getUint32(4,!0),s=t.getUint16(8,!0),n=t.getUint16(10,!0),a={version:i,recordCount:r,headerByteCount:s,recordByteCount:n};let o=32;const l=[],c=[];let u;if(3===i){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,fe.f)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<r&&e.byteLength-o>n;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)i.push((0,fe.f)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const r=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(r.substring(0,4),10),parseInt(r.substring(4,6),10)-1,parseInt(r.substring(6,8),10)))}o+=t.length})),c.push(i)):o+=n}}return{header:a,fields:l,records:c,recordSet:he({fields:l,records:c})}}}var pe=i(87521),me=i(74889);const ye=new Map;ye.set("int16","esriFieldTypeSmallInteger"),ye.set("int32","esriFieldTypeInteger"),ye.set("int64","esriFieldTypeInteger"),ye.set("float32","esriFieldTypeSingle"),ye.set("float64","esriFieldTypeDouble"),ye.set("text","esriFieldTypeString");let ge=class extends U{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:e?.signal});if(!this._validateHeader(t))throw new a.Z("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:i,rasterInfo:r}=this._parseHeader(t);if("thematic"===r.dataType){const e=await this._fetchAuxiliaryInformation();r.attributeTable=e}this._set("storageInfo",i),this._set("rasterInfo",r),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,i,r={}){const{transposeInfo:s}=this.rasterInfo.storageInfo,{transposedVariableName:n}=r,a=!(!s||!n),o=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(o<0)return null;const l=this._buildCacheFilePath(o,t,i,r.multidimensionalDefinition,n),c=this._getIndexRecordFromBundle(t,i,a),u=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:r.signal});if(!u)return null;const f=new Uint8Array(u.data),h=this._getTileEndAndContentType(f,c);if(0===h.recordSize)return null;const d=await this.request(l,{range:{from:h.position,to:h.position+h.recordSize},responseType:"array-buffer",signal:r.signal});if(!d)return null;const[p,m]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:p,height:m,planes:null,pixelType:null,returnInterleaved:a})}_validateHeader(e){return e&&"RasterInfo"===e.type&&!["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"].some((t=>!e[t]))}_parseHeader(e){const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:i,histograms:r,colormap:s,blockWidth:n,blockHeight:a,firstPyramidLevel:o,maximumPyramidLevel:l}=e,c=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),u=e.extent.spatialReference,f=e.geodataXform?.spatialReference,h=new ee.Z(u?.wkid||u?.wkt?u:f);let d=new q.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:h});const p=new D.Z({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:h}),m=Math.round((d.xmax-d.xmin)/p.x),y=Math.round((d.ymax-d.ymin)/p.y),g=this._parseTransform(e.geodataXform),x=g?d:null;g&&(d=g.forwardTransform(d),p.x=(d.xmax-d.xmin)/m,p.y=(d.ymax-d.ymin)/y);const I=e.properties??{},b=e.format.toLowerCase().replace("cache/",""),w=new D.Z(e.origin.x,e.origin.y,h);let _,S,v,C;if(s&&s.colors)for(_=[],S=0;S<s.colors.length;S++)v=s.colors[S],C=s.values?s.values[S]:S,_.push([C,255&v,v<<16>>>24,v<<8>>>24,v>>>24]);const R=e.LODInfos,T=[];for(S=0;S<R.levels.length;S++)T.push({level:R.levels[S],resolution:R.resolutions[S],scale:96/.0254*R.resolutions[S]});const F=new k.Z({dpi:96,lods:T,format:b,origin:w,size:[n,a],spatialReference:h}),P={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},O=[{maxCol:Math.ceil(m/n)-1,maxRow:Math.ceil(y/a)-1,minCol:0,minRow:0}];let B=2;if(l>0)for(S=0;S<l;S++)O.push({maxCol:Math.ceil(m/B/n)-1,maxRow:Math.ceil(y/B/a)-1,minCol:0,minRow:0}),B*=2;const z=e.mdInfo;let J=null;if(z&&I._yxs){const e=I._yxs;J={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:P,rasterInfo:new ue.Z({width:m,height:y,pixelType:t,bandCount:i,extent:d,nativeExtent:x,transform:g,spatialReference:h,pixelSize:p,keyProperties:I,statistics:c,histograms:r,multidimensionalInfo:z,colormap:_,storageInfo:new M.Z({blockWidth:n,blockHeight:a,pyramidBlockWidth:n,pyramidBlockHeight:a,origin:w,tileInfo:F,transposeInfo:J,firstPyramidLevel:o,maximumPyramidLevel:l,blockBoundary:O})})}}_parseTransform(e){if(!(0,pe.j)(e))throw new a.Z("cloudraster:open","the data contains unsupported geodata transform types");const t=(0,pe.c)(e);if("identity"===t.type)return null;if("polynomial"!==t.type||!t.forwardCoefficients?.length||!t.inverseCoefficients?.length)throw new a.Z("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return t}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),i=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),r=await Promise.all([t,i]);let s;if(r[0]){let e=r[0].fields;const t=r[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":ye.get(e.type),name:e.name,alias:e.alias||e.name})));const i=t.map((e=>({attributes:e})));e&&t&&(s={fields:e,features:i})}}return!s&&r[1]&&(s=de.parse(r[1]).recordSet),me.default.fromJSON(s)}_buildCacheFilePath(e,t,i,r,s){const n=this._getPackageSize(!!s),a=Math.floor(t/n)*n,l=Math.floor(i/n)*n,c="R"+this._toHexString4(a)+"C"+this._toHexString4(l);let u="L";u+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:f}=this.rasterInfo,h=r?.[0];if((0,o.Wi)(f)||!h)return`${this.url}/_alllayers/${u}/${c}.bundle`;let d="_yxs";if(!s){d=f.variables.find((e=>e.name===h.variableName)).dimensions[0].values.indexOf(h.values[0]).toString(16);const e=4-d.length;for(let t=0;t<e;t++)d="0"+d;d="S"+d}const p=this._getVariableFolderName(s||h.variableName);return`${this.url}/_alllayers/${p}/${d}/${u}/${c}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&(0,o.pC)(t)?t.packetSize??0:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:i}=t;return e&&(0,o.pC)(i)?i.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replace(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,i=!1){const r=this._getPackageSize(i),s=r*(e%r)+t%r;if(s<0)throw"Invalid level / row / col";return 20+s*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const i=e.subarray(t,t+8);let r,s=0;for(r=0;r<5;r++)s|=(255&i[r])<<8*r;const n=0xffffffffff&s;for(s=0,r=5;r<8;r++)s|=(255&i[r])<<8*(r-5);return{position:n,recordSize:0xffffffffff&s}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};(0,r._)([(0,f.Cb)({readOnly:!0})],ge.prototype,"storageInfo",void 0),(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],ge.prototype,"datasetFormat",void 0),ge=(0,r._)([(0,m.j)("esri.layers.support.rasterDatasets.CloudRaster")],ge);const xe=ge;var Ie=i(80442),be=i(15612);let we=class extends U{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.data=null}async open(e){await this.init();const t=this.data,{pixelBlock:i,statistics:r,histograms:s,name:n,keyProperties:a,nativeExtent:o,transform:l}=this.data,{width:c,height:u,pixelType:f}=i,h=t.extent??new q.Z({xmin:-.5,ymin:.5,xmax:c-.5,ymax:u-.5,spatialReference:new ee.Z({wkid:3857})}),d=t.isPseudoSpatialReference??!t.extent,p={x:h.width/c,y:h.height/u},m=new ue.Z({width:c,height:u,pixelType:f,extent:h,nativeExtent:o,transform:l,pixelSize:p,spatialReference:h.spatialReference,bandCount:3,keyProperties:a||{},statistics:r,isPseudoSpatialReference:d,histograms:s});this.createRemoteDatasetStorageInfo(m,512,512),this._set("rasterInfo",m),this.updateTileInfo(),await this._buildInMemoryRaster(i,{width:512,height:512},e),this.datasetName=n,this.url="/InMemory/"+n}fetchRawTile(e,t,i,r={}){const s=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(s)}async _buildInMemoryRaster(e,t,i){const r=this.rasterInfo.storageInfo.maximumPyramidLevel,s=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:r},i):Promise.resolve((0,L.Vl)(e,t,r)),n=(0,o.pC)(this.rasterInfo.statistics),l=(0,o.pC)(this.rasterInfo.histograms),u=n?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,be.Hv)(e)),f=await(0,c.as)([s,u]);if(!f[0].value&&f[1].value)throw new a.Z("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=f[0].value,n||(this.rasterInfo.statistics=f[1].value?.statistics),l||(this.rasterInfo.histograms=f[1].value?.histograms)}};(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],we.prototype,"datasetFormat",void 0),(0,r._)([(0,f.Cb)()],we.prototype,"data",void 0),we=(0,r._)([(0,m.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],we);const _e=we;function Se(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const r=[];if(t){const s=Se(e,i);for(let e=0;e<s.length;e++)Se(s[e],t).forEach((e=>r.push(e)));return r}const s=e.getElementsByTagNameNS("*",i);if(!s||0===s.length)return[];for(let e=0;e<s.length;e++)r.push(s[e]||s.item[e]);return r}function ve(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const r=Se(e,i);return r.length>0?t?ve(r[0],t):r[0]:null}function Ce(e,t=null){const i=t?ve(e,t):e;let r;return i?(r=i.textContent||i.nodeValue,r?r.trim():null):null}function Re(e,t){return function(e,t){const i=Se(e,t),r=[];let s;for(let e=0;e<i.length;e++)s=i[e].textContent||i[e].nodeValue,s&&(s=s.trim(),""!==s&&r.push(s));return r}(e,t).map((e=>Number(e)))}function Te(e,t){const i=Ce(e,t);return Number(i)}function ke(e,t){const i=e?.nodeName?.toLowerCase(),r=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===r}var Fe=i(87390);function Pe(e,t){if(!e||!t)return null;const i=[];for(let r=0;r<e.length;r++)i.push(e[r]),i.push(t[r]);return i}function Me(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new ee.Z({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const i=e.indexOf("VERTCS"),r=e.indexOf("PROJCS"),s=r>-1?r:e.indexOf("GEOGCS");if(-1===s)return null;const n=e.slice(s,e.lastIndexOf("]",i)+1).trim(),a=e.slice(i,e.lastIndexOf("]")).trim();t=Oe(n);const o=new ee.Z(t?{wkid:t}:{wkt:n}),l=Oe(a);return l&&(o.vcsWkid=l),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=Oe(e),new ee.Z(0!==t?{wkid:t}:{wkt:e})):null}function Oe(e){const t=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map((e=>e.trim())).filter((e=>""!==e)),i=t[t.length-1].split(","),r=i[0]?.toLowerCase();if(("epsg"===r||"esri"===r)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Be(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(ke(e,"SRS")){if(!t.spatialReference){const i=Ce(e);t.spatialReference=Me(i)}}else if(ke(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:r}=function(e){const t=ve(e,"GeodataXform"),i=Me(Te(t,"SpatialReference/WKID")||Ce(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const r=Te(t,"PolynomialOrder")??1,s=Re(t,"CoeffX/Double"),n=Re(t,"CoeffY/Double"),a=Re(t,"InverseCoeffX/Double"),o=Re(t,"InverseCoeffY/Double"),l=Pe(s,n),c=Pe(a,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new Fe.Z({spatialReference:i,polynomialOrder:r,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=r,t.spatialReference||(t.spatialReference=i)}else Se(e,"MDI").forEach((e=>t.metadata[e.getAttribute("key")]=Ce(e)));else if(ke(e,"PAMRasterBand")){const i=function(e){const t=Te(e,"NoDataValue"),i=ve(e,"Histograms/HistItem"),r=Te(i,"HistMin"),s=Te(i,"HistMax"),n=Te(i,"BucketCount"),a=Ce(i,"HistCounts")?.split("|").map((e=>Number(e)));let o,l,c,u;Se(e,"Metadata/MDI").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}}));const f=Te(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=r&&null!=s?{min:r,max:s,size:n||a.length,counts:a}:null,sourceBandIndex:f,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}}));const i=t.rasterBands;if(i.length){const e=!!i[0].statistics;t.statistics=e?i.map((e=>e.statistics)).filter(o.pC):null;const r=!!i[0].histogram;t.histograms=r?i.map((e=>e.histogram)).filter(o.pC):null}return t}let De=class extends U{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:i,statistics:r,histograms:s,transform:n}=await this._fetchAuxiliaryData(e);const a=!i;a&&(i=new ee.Z({wkid:3857})),s?.length&&null==r&&(r=(0,be.Oh)(s));const{width:o,height:l}=t;let c=new q.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=n?n.forwardTransform(c):c;let f=!0;if(n){const e=n.forwardCoefficients;f=e&&0===e[1]&&0===e[2],f&&(n=null,c=u)}const h=new _e({data:{extent:u,nativeExtent:c,transform:n,pixelBlock:t,statistics:r,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await h.open(),h.data=null,this._set("rasterInfo",h.rasterInfo),this._inMemoryRaster=h}fetchRawTile(e,t,i,r={}){return this._inMemoryRaster.fetchRawTile(e,t,i,r)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,A.y)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new a.Z("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);const r=i.toLowerCase(),s="gif"===r||"bmp"===r||!(0,Ie.Z)("ios");return await this.decodePixelBlock(t,{format:r,useCanvas:s,hasNoZlibMask:!0})}async _fetchAuxiliaryData(e){const t=(0,o.Wg)(e?.signal),i=this.ioConfig.skipExtensions??[],r=i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),s=this.datasetFormat,n="JPG"===s?"jgw":"PNG"===s?"pgw":"BMP"===s?"bpw":null,a=n&&i.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),l=await(0,c.as)([r,a]);if(t?.aborted)throw(0,c.zE)();const u=Be(l[0].value?.data);if(!u.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;u.transform=6===e?.length?new Fe.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return u}};(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],De.prototype,"datasetFormat",void 0),De=(0,r._)([(0,m.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],De);const ze=De;var Je=i(17452),Ne=i(45322),We=i(56608),Ee=i(29680),He=i(26059);let Ze=class extends U{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(e){await this.init();const t=e&&e.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const r=i.data;if(this.sourceJSON=r,!r)throw new a.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!r.tileInfo)throw new a.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=r.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(r.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===r.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=r.name?.slice(r.name.indexOf("/")+1)??"";const s=await this._fetchRasterInfo({signal:t});if((0,o.Wi)(s))throw new a.Z("image-server-raster:open","cannot initialize image service");const n="Map"===this.tileType?(0,Ne.d)(r.tileInfo,r):k.Z.fromJSON(r.tileInfo);(0,o.O3)(n);const[l,c]=this._computeMinMaxLOD(s,n),{extent:u,pixelSize:f}=s,h=.5/s.width*f.x,d=Math.max(f.x,f.y),{lods:p}=n;("Map"!==this.tileType&&0!==r.maxScale||Math.abs(f.x-f.y)>h||!p.some((e=>Math.abs(e.resolution-d)<h)))&&(f.x=f.y=l.resolution,s.width=Math.ceil((u.xmax-u.xmin)/f.x-.1),s.height=Math.ceil((u.ymax-u.ymin)/f.y-.1));const m=l.level-c.level,[y,g]=n.size,x=[];p.forEach((e=>{e.level>=c.level&&e.level<=l.level&&x.push({x:e.resolution,y:e.resolution})})),x.sort(((e,t)=>e.x-t.x));const I=this.computeBlockBoundary(u,y,g,n.origin,x,m),b=x.length>1?x.slice(1):null;let w;if(r.transposeInfo&&(w={tileSize:[r.transposeInfo.rows,r.transposeInfo.cols],packetSize:s.keyProperties?._yxs.PacketSize??0}),s.storageInfo=new M.Z({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:b,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:m,tileInfo:n,transposeInfo:w,blockBoundary:I}),this._fixGCSShift(s),this._set("rasterInfo",s),r.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:s.storageInfo.tileInfo,parsedUrl:(0,Je.mN)(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new We.y({layer:e})}}async fetchRawTile(e,t,i,r={}){const{storageInfo:s,extent:n}=this.rasterInfo,{transposeInfo:a}=s,l=(0,o.pC)(a)&&!!r.transposedVariableName;if(this._slices&&!l&&null==r.sliceId)return null;const c=l?0:s.maximumPyramidLevel-e+this._levelOffset,u=`${this.url}/tile/${c}/${t}/${i}`,f=this._slices?l?{variable:r.transposedVariableName}:{sliceId:r.sliceId||0}:null,{data:h}=await this.request(u,{query:f,responseType:"array-buffer",signal:r.signal});if(!h)return null;const d=l?a.tileSize:s.tileInfo.size,p=await this.decodePixelBlock(h,{width:d[0],height:d[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:l}),m=s.blockBoundary[e];if("jpg"!==s.compression||i>m.minCol&&i<m.maxCol&&t>m.minRow&&t<m.maxRow)return p;const{origin:y,blockWidth:g,blockHeight:x}=s,{x:I,y:b}=this.getPyramidPixelSize(e),w=Math.round((n.xmin-y.x)/I)%g,_=Math.round((n.xmax-y.x)/I)%g||g,S=Math.round((y.y-n.ymax)/b)%x,v=Math.round((y.y-n.ymin)/b)%x||x,C=i===m.minCol?w:0,R=t===m.minRow?S:0,T=i===m.maxCol?_:g,k=t===m.maxRow?v:x;return(0,L.pW)(p,{x:C,y:R},{width:T-C,height:k-R}),p}getSliceIndex(e){if(!this._slices||(0,o.Wi)(e)||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some((e=>{const i=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),r=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),s=await Promise.all([i,r]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,(0,o.Wg)(t.datumTransformation));if(null===i)return null;let r=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let n=s-r+this._levelOffset;const a=i.srcLocation;for(;n>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(n,i.row,i.col,t))break}catch{}if(n--,r++,i=this.identifyPixelLocation(a,r,(0,o.Wg)(t.datumTransformation)),null===i)return null}return-1===n||null==i?null:r}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),r=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),s=ee.Z.fromJSON(t.spatialReference||e.spatialReference),n=new D.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:s});return new ue.Z({width:i,height:r,bandCount:3,extent:q.Z.fromJSON(e),spatialReference:s,pixelSize:n,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,r=(0,He.g)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),s=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then((e=>e.data&&e.data.slices)).catch((()=>null)):null,n=await Promise.all([r,s]);return this._slices=n[1],n[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Ee.Z,e.extent=e.transform.forwardTransform(t))}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,r=.5/e.width*i.x,{lods:s}=t,n=t.lodAt(Math.max.apply(null,s.map((e=>e.level)))),a=t.lodAt(Math.min.apply(null,s.map((e=>e.level)))),{tileType:o}=this;if("Map"===o)return this._levelOffset=s[0].level,[n,a];if("Raster"===o)return[s.find((e=>e.resolution===i.x))??n,a];const{minScale:l,maxScale:c}=this.sourceJSON;let u=n;c>0&&(u=s.find((e=>Math.abs(e.scale-c)<r)),u||(u=s.filter((e=>e.scale>c)).sort(((e,t)=>e.scale>t.scale?1:-1))[0]??n));let f=a;return l>0&&(f=s.find((e=>Math.abs(e.scale-l)<r))??a,this._levelOffset=f.level-a.level),[u,f]}};(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],Ze.prototype,"datasetFormat",void 0),(0,r._)([(0,f.Cb)()],Ze.prototype,"tileType",void 0),Ze=(0,r._)([(0,m.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],Ze);const Ae=Ze;var Le=i(5847),je=i(48279);const qe=new Map;qe.set("Int8","s8"),qe.set("UInt8","u8"),qe.set("Int16","s16"),qe.set("UInt16","u16"),qe.set("Int32","s32"),qe.set("UInt32","u32"),qe.set("Float32","f32"),qe.set("Float64","f32"),qe.set("Double64","f32");const Ge=new Map;Ge.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Ge.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Ge.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Ge.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let Ue=class extends U{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(e){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?(0,o.Wg)(e.signal):null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:r,files:s}=this._parseHeader(i.data);if(-1===this.ioConfig.skipExtensions?.indexOf("aux.xml")){const t=await this._fetchAuxiliaryData(e);null!=t&&(r.statistics=t.statistics??r.statistics,r.histograms=t.histograms,t.histograms&&(0,o.Wi)(r.statistics)&&(r.statistics=(0,be.Oh)(t.histograms)))}this._set("rasterInfo",r),this._files=s;const n=await this.request(s.index,{responseType:"array-buffer",signal:t});this._storageIndex=this._parseIndex(n.data);const{blockWidth:a,blockHeight:l}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:u,height:f}=this.rasterInfo,h=[],d=this._getBandSegmentCount();let p=0,m=-1;for(;p<this._storageIndex.length;){m++;const e=Math.ceil(u/a/c**m)-1,t=Math.ceil(f/l/c**m)-1;p+=(e+1)*(t+1)*d*4,h.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=h,m>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=m),this.updateTileInfo()}async fetchRawTile(e,t,i,r={}){const{blockWidth:s,blockHeight:n,blockBoundary:a}=this.rasterInfo.storageInfo,l=a[e];if(!l||l.maxRow<t||l.maxCol<i||l.minRow>t||l.minCol>i)return null;const{bandCount:c,pixelType:u}=this.rasterInfo,{ranges:f,actualTileWidth:h,actualTileHeight:d}=this._getTileLocation(e,t,i);if(!f||0===f.length)return null;if(0===f[0].from&&0===f[0].to){const e=new Uint8Array(s*n);return new Le.Z({width:s,height:n,pixels:null,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,m=this._getBandSegmentCount(),y=[];let g=0;for(g=0;g<m;g++)(!p||p.indexOf[g]>-1)&&y.push(this.request(this._files.data,{range:{from:f[g].from,to:f[g].to},responseType:"array-buffer",signal:r.signal}));const x=await Promise.all(y),I=x.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),b=new Uint8Array(I);let w=0;for(g=0;g<m;g++)b.set(new Uint8Array(x[g].data),w),w+=x[g].data.byteLength;const _=Ge.get(this.rasterInfo.storageInfo.compression).decoderFormat,S=await this.decodePixelBlock(b.buffer,{width:s,height:n,format:_,planes:p?.length||c,pixelType:u});if((0,o.pC)(this.rasterInfo.noDataValue)&&"lerc"!==_&&!S.mask){const e=this.rasterInfo.noDataValue[0];if(null!=e){const t=S.width*S.height,i=new Uint8Array(t);if(Math.abs(e)>1e24)for(g=0;g<t;g++)Math.abs((S.pixels[0][g]-e)/e)>1e-6&&(i[g]=1);else for(g=0;g<t;g++)S.pixels[0][g]!==e&&(i[g]=1);S.mask=i}}let v=0,C=0;if(h!==s||d!==n){let e=S.mask;if(e)for(g=0;g<n;g++)if(C=g*s,g<d)for(v=h;v<s;v++)e[C+v]=0;else for(v=0;v<s;v++)e[C+v]=0;else for(e=new Uint8Array(s*n),S.mask=e,g=0;g<d;g++)for(C=g*s,v=0;v<h;v++)e[C+v]=1}return S}_parseIndex(e){if(e.byteLength%16>0)throw"invalid array buffer must be multiples of 16";let t,i,r,s,n,a;if(je.f){for(i=new Uint8Array(e),s=new ArrayBuffer(e.byteLength),r=new Uint8Array(s),n=0;n<e.byteLength/4;n++)for(a=0;a<4;a++)r[4*n+a]=i[4*n+3-a];t=new Uint32Array(s)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Ge.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:r,blockHeight:s,pyramidScalingFactor:n}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,f,h=0,d=0;for(f=0;f<e;f++)d=n**f,c=Math.ceil(a/r/d),u=Math.ceil(o/s/d),h+=c*u;d=n**e,c=Math.ceil(a/r/d),u=Math.ceil(o/s/d),h+=t*c+i,h*=4*l;const p=this._storageIndex.subarray(h,h+4*l);let m=0,y=0;const g=[];for(let e=0;e<l;e++)m=p[4*e+0]*2**32+p[4*e+1],y=m+p[4*e+2]*2**32+p[4*e+3],g.push({from:m,to:y});return{ranges:g,actualTileWidth:i<c-1?r:Math.ceil(a/d)-r*(c-1),actualTileHeight:t<u-1?s:Math.ceil(o/d)-s*(u-1)}}_parseHeader(e){const t=ve(e,"MRF_META/Raster");if(!t)throw new a.Z("mrf:open","not a valid MRF format");const i=ve(t,"Size"),r=parseInt(i.getAttribute("x"),10),s=parseInt(i.getAttribute("y"),10),n=parseInt(i.getAttribute("c"),10),o=(Ce(t,"Compression")||"none").toLowerCase();if(!Ge.has(o))throw new a.Z("mrf:open","currently does not support compression "+o);const l=Ce(t,"DataType")||"UInt8",c=qe.get(l);if(null==c)throw new a.Z("mrf:open","currently does not support pixel type "+l);const u=ve(t,"PageSize"),f=parseInt(u.getAttribute("x"),10),h=parseInt(u.getAttribute("y"),10),d=ve(t,"DataValues");let p,m;if(d&&(m=d.getAttribute("NoData"),null!=m&&(p=m.trim().split(" ").map((e=>parseFloat(e))))),ve(e,"MRF_META/CachedSource"))throw new a.Z("mrf:open","currently does not support MRF referencing other data files");const y=ve(e,"MRF_META/GeoTags"),g=ve(y,"BoundingBox");let x,I=!1;if(null!=g){const e=parseFloat(g.getAttribute("minx")),t=parseFloat(g.getAttribute("miny")),i=parseFloat(g.getAttribute("maxx")),r=parseFloat(g.getAttribute("maxy")),s=Ce(y,"Projection")||"";let n=ee.Z.WGS84;if("LOCAL_CS[]"!==s)if(s.toLowerCase().startsWith("epsg:")){const e=Number(s.slice(5));isNaN(e)||0===e||(n=new ee.Z({wkid:e}))}else n=Me(s)??ee.Z.WGS84;else I=!0,n=new ee.Z({wkid:3857});x=new q.Z(e,t,i,r),x.spatialReference=n}else I=!0,x=new q.Z({xmin:-.5,ymin:.5-s,xmax:r-.5,ymax:.5,spatialReference:new ee.Z({wkid:3857})});const b=ve(e,"MRF_META/Rsets"),w=parseInt(b&&b.getAttribute("scale")||"2",10),_=x.spatialReference,S=new M.Z({origin:new D.Z({x:x.xmin,y:x.ymax,spatialReference:_}),blockWidth:f,blockHeight:h,pyramidBlockWidth:f,pyramidBlockHeight:h,compression:o,pyramidScalingFactor:w}),v=new D.Z({x:x.width/r,y:x.height/s,spatialReference:_}),C=new ue.Z({width:r,height:s,extent:x,isPseudoSpatialReference:I,spatialReference:_,bandCount:n,pixelType:c,pixelSize:v,noDataValue:p,storageInfo:S}),R=Ce(e,"datafile"),T=Ce(e,"IndexFile");return{rasterInfo:C,files:{mrf:this.url,index:T||this.url.replace(".mrf",".idx"),data:R||this.url.replace(".mrf",Ge.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Be(t)}catch{return null}}};(0,r._)([(0,f.Cb)()],Ue.prototype,"_files",void 0),(0,r._)([(0,f.Cb)()],Ue.prototype,"_storageIndex",void 0),(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],Ue.prototype,"datasetFormat",void 0),Ue=(0,r._)([(0,m.j)("esri.layers.support.rasterIO.MRFRaster")],Ue);const $e=Ue;var Ve=i(94793),Xe=i(9832);const Ye=(e,t)=>e.get(t)?.values,Ke=(e,t)=>e.get(t)?.values?.[0];let Qe=class extends U{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const t=e?(0,o.Wg)(e.signal):null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new a.Z("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{littleEndian:r,firstIFDPos:s,isBigTiff:n}=(0,Ve.cK)(i),l=[];await this._readIFDs(l,i,r,s,0,n?8:4,t);const{imageInfo:c,rasterInfo:u}=this._parseIFDs(l);if(this._headerInfo={littleEndian:r,isBigTiff:n,ifds:l,...c},this._set("rasterInfo",u),!c.isSupported)throw new a.Z("tiffraster:open","this tiff is not supported: "+c.message);if(!c.tileWidth)throw new a.Z("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");const{skipExtensions:f=[]}=this.ioConfig;if(!f.includes("aux.xml")){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&this._processPAMInfo(t,u)}f.includes("vat.dbf")||1!==u.bandCount||"u8"!==u.pixelType||(u.attributeTable=await this._fetchAuxiliaryTable(e),(0,o.pC)(u.attributeTable)&&(u.keyProperties.DataType="thematic")),this.updateTileInfo()}async fetchRawTile(e,t,i,r={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const s=this._getTileLocation(e,t,i);if(!s)return null;const{ranges:n,actualTileWidth:a,actualTileHeight:o,ifd:l}=s,c=n.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:r.signal}))),u=await Promise.all(c),f=u.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),h=1===u.length?u[0].data:new ArrayBuffer(f),d=[0],p=[0];if(u.length>1){const e=new Uint8Array(h);for(let t=0,i=0;t<u.length;t++){const r=u[t].data;e.set(new Uint8Array(r),i),d[t]=i,i+=r.byteLength,p[t]=r.byteLength}}const{blockWidth:m,blockHeight:y}=this.getBlockWidthHeight(e),g=await this.decodePixelBlock(h,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:d,sizes:p},width:m,height:y,planes:null,pixelType:null});let x,I,b;if(a!==m||o!==y){let e=g.mask;if(e)for(x=0;x<y;x++)if(b=x*m,x<o)for(I=a;I<m;I++)e[b+I]=0;else for(I=0;I<m;I++)e[b+I]=0;else for(e=new Uint8Array(m*y),g.mask=e,x=0;x<o;x++)for(b=x*m,I=0;I<a;I++)e[b+I]=1}return g}_parseIFDs(e){const t=(0,Ve.FI)(e),{width:i,height:r,tileWidth:s,tileHeight:n,planes:a,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:f,pyramidBlockHeight:h,tileBoundary:d,affine:p,metadata:m}=t;let y=Me(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),g=!1;null==y&&(g=!0,y=new ee.Z({wkid:3857}));const x=new q.Z({...t.extent,spatialReference:y}),I=new D.Z(x?{x:x.xmin,y:x.ymax,spatialReference:y}:{x:0,y:0}),b=new M.Z({blockWidth:s,blockHeight:n,pyramidBlockWidth:f,pyramidBlockHeight:h,compression:l,origin:I,firstPyramidLevel:c,maximumPyramidLevel:u,blockBoundary:d}),w=new D.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/r,spatialReference:y}),_=m?{BandProperties:m.bandProperties,DataType:m.dataType}:{};let S=null;const v=Ke(e[0],"PHOTOMETRICINTERPRETATION"),C=Ye(e[0],"COLORMAP");if(3===v&&C?.length>3&&C.length%3==0){S=[];const e=C.length/3;for(let t=0;t<e;t++)S.push([t,C[t]>>>8,C[t+e]>>>8,C[t+2*e]>>>8])}const R=new ue.Z({width:i,height:r,bandCount:a,pixelType:o,pixelSize:w,storageInfo:b,spatialReference:y,isPseudoSpatialReference:g,keyProperties:_,extent:x,colormap:S,statistics:m?m.statistics:null});return p?.length&&(R.nativeExtent=new q.Z({xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:y}),R.transform=new Fe.Z({polynomialOrder:1,forwardCoefficients:[p[2]+p[0]/2,p[5]-p[3]/2,p[0],p[3],-p[1],-p[4]]}),R.extent=R.transform.forwardTransform(R.nativeExtent),R.pixelSize=new D.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/r,spatialReference:y}),b.origin.x=-.5,b.origin.y=.5),{imageInfo:t,rasterInfo:R}}_processPAMInfo(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&(0,o.Wi)(t.statistics)&&(t.statistics=(0,be.Oh)(e.histograms)),e.transform&&(0,o.Wi)(t.transform)){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new D.Z({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.spatialReference||(t.spatialReference=e.spatialReference)}async _readIFDs(e,t,i,r,s,n=4,a){if(!r)return null;(r>=t.byteLength||r<0)&&(t=(await this.request(this.url,{range:{from:r+s,to:r+s+this._bufferSize},responseType:"array-buffer",signal:a})).data,s=r+s,r=0);const o=await this._readIFD(t,i,r,s,Xe.Z.TIFF_TAGS,n,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,i,o.nextIFD-s,s,n,a)}async _readIFD(e,t,i,r,s=Xe.Z.TIFF_TAGS,n=4,a){if(!e)return null;const l=(0,Ve.vr)(e,t,i,r,s,n);if(l.success){const i=[];if(l.ifd?.forEach((e=>{e.values||i.push(e)})),i.length>0){const s=i.map((e=>e.offlineOffsetSize)).filter(o.pC),n=Math.min.apply(null,s.map((e=>e[0])));if(Math.min.apply(null,s.map((e=>e[0]+e[1])))-n<=this._bufferSize){const{data:s}=await this.request(this.url,{range:{from:n,to:n+this._bufferSize},responseType:"array-buffer",signal:a});e=s,r=n,i.forEach((i=>(0,Ve.Dq)(e,t,i,r)))}}if(l.ifd?.has("GEOKEYDIRECTORY")){const i=l.ifd.get("GEOKEYDIRECTORY"),s=i?.values;if(s&&s.length>4){const n=s[0]+"."+s[1]+"."+s[2],o=await this._readIFD(e,t,i.valueOffset+6-r,r,Xe.Z.GEO_KEYS,2,a);i.data=o.ifd,i.data&&i.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}return l}if(l.requiredBufferSize&&l.requiredBufferSize!==e.byteLength){const i=await this.request(this.url,{range:{from:r,to:r+l.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=i.data).byteLength<l.requiredBufferSize?null:this._readIFD(e,t,0,r,Xe.Z.TIFF_TAGS,4,a)}}_getTileLocation(e,t,i){const{firstPyramidLevel:r,blockBoundary:s}=this.rasterInfo.storageInfo,n=0===e?0:e-(r-1),a=this._headerInfo?.ifds[n];if(!a)return null;const o=(0,Ve.If)(a,this._headerInfo),l=Ye(a,"TILEOFFSETS");if(void 0===l)return null;const c=Ye(a,"TILEBYTECOUNTS"),{minRow:u,minCol:f,maxRow:h,maxCol:d}=s[n];if(t>h||i>d||t<u||i<f)return null;const p=Ke(a,"IMAGEWIDTH"),m=Ke(a,"IMAGELENGTH"),y=Ke(a,"TILEWIDTH"),g=Ke(a,"TILELENGTH"),x=o?this.rasterInfo.bandCount:1,I=x*t*(d+1)+i,b=[{from:l[I],to:l[I+x-1]+c[I+x-1]-1}];if(o){let e=!0;for(let t=0;t<x;t++)if(l[I+t]+c[I+t]!==l[I+t+1]){e=!1;break}if(!e)for(let e=0;e<x;e++)b[e]={from:l[I+e],to:l[I+e]+c[I+e]-1}}const w=l[I],_=c[I];return null==w||null==_?null:{ranges:b,ifd:a,actualTileWidth:i===d&&p%y||y,actualTileHeight:t===h&&m%g||g}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Be(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=de.parse(t);return i?.recordSet?me.default.fromJSON(i.recordSet):null}catch{return null}}};(0,r._)([(0,f.Cb)()],Qe.prototype,"_files",void 0),(0,r._)([(0,f.Cb)()],Qe.prototype,"_headerInfo",void 0),(0,r._)([(0,f.Cb)()],Qe.prototype,"_bufferSize",void 0),(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],Qe.prototype,"datasetFormat",void 0),Qe=(0,r._)([(0,m.j)("esri.layers.support.rasterDatasets.TIFFRaster")],Qe);const et=Qe,tt=new Map;tt.set("CRF",{desc:"Cloud Raster Format",constructor:xe}),tt.set("MRF",{desc:"Meta Raster Format",constructor:$e}),tt.set("TIFF",{desc:"GeoTIFF",constructor:et}),tt.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Ae}),tt.set("JPG",{desc:"JPG Raster Format",constructor:ze}),tt.set("PNG",{desc:"PNG Raster Format",constructor:ze}),tt.set("GIF",{desc:"GIF Raster Format",constructor:ze}),tt.set("BMP",{desc:"BMP Raster Format",constructor:ze});class it{static get supportedFormats(){const e=new Set;return tt.forEach(((t,i)=>e.add(i))),e}static async open(e){const{url:t,ioConfig:i,sourceJSON:r}=e;let s=e.datasetFormat;null==s&&t.lastIndexOf(".")&&(s=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===s||"TIF"===s?s="TIFF":"JPG"!==s&&"JPEG"!==s&&"JFIF"!==s||(s="JPG"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(s="RasterTileServer");const n={url:t,sourceJSON:r,datasetFormat:s,ioConfig:i??{bandIds:null,sampling:null}};let o,l;if(s&&this.supportedFormats.has(s)){if("CRF"===s&&!i?.enableCRF)throw new a.Z("rasterfactory:open",`cannot open raster: ${t}`);return o=tt.get(s).constructor,l=new o(n),await l.open({signal:e.signal}),l}if(s)throw new a.Z("rasterfactory:open","not a supported format "+s);const c=Array.from(tt.keys());let u=0;const f=()=>(s=c[u++],s&&("CRF"!==s||i?.enableCRF)?(o=tt.get(s).constructor,l=new o(n),l.open({signal:e.signal}).then((()=>l)).catch((()=>f()))):null);return f()}static register(e,t,i){tt.has(e.toUpperCase())||tt.set(e.toUpperCase(),{desc:t,constructor:i})}}var rt=i(32163);let st=class extends((0,g.h)((0,ae.M)((0,re.q)((0,se.I)((0,x.N)(ie((0,oe.n)((0,ne.Q)((0,l.R)(y.Z)))))))))){constructor(...e){super(...e),this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.title=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,o.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.r9).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[new le.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"})];const{rasterInfo:t}=this,{attributeTable:i}=t,r=(0,o.pC)(i)?i.fields:null;if(r){const t=r.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));e=e.concat(t)}const{dataType:s,multidimensionalInfo:n}=t;if(("vector-magdir"===s||"vector-uv"===s)&&(0,o.pC)(n)){const t=n.variables[0].unit?.trim(),i="Magnitude"+(t?` (${t})`:"");e.push(new le.Z({name:"Raster.Magnitude",alias:i,domain:null,editable:!1,type:"double"})),e.push(new le.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return e}set renderer(e){this._set("renderer",e),this.updateRenderer()}readRenderer(e,t,i){const r=t&&t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.renderer,s=(0,n.ij)(r,i)||void 0;if(null!=s)return s}createPopupTemplate(e){return(0,rt.eZ)({fields:this.rasterFields,title:this.title},e)}write(e,t){const{raster:i}=this;if(this.loaded?"RasterTileServer"===i.datasetFormat&&("Raster"===i.tileType||"Map"===i.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.Z("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){if(this.raster)this.raster.rasterInfo||await this.raster.open(),this.url=this.raster.url;else{const t=await it.open({url:this.url,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(this.rasterFunction){const e=(0,X.Ue)(this.rasterFunction.toJSON(),{raster:t}),i=new V({rasterFunction:e});await i.open(),this.raster=i}else this.raster=t}const{rasterInfo:t}=this.raster;if(!t)throw new a.Z("imagery-tile-layer:load","cannot load resources on "+this.url);if(this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}null==this.title&&(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,u.YP)((()=>this.customParameters),(e=>{this.raster.ioConfig.customFetchParameters=e})))}};(0,r._)([(0,f.Cb)({type:[h.z8],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],st.prototype,"bandIds",void 0),(0,r._)([(0,f.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,d.J)(ce.c)],st.prototype,"interpolation",void 0),(0,r._)([(0,f.Cb)({json:{write:!0}})],st.prototype,"multidimensionalDefinition",void 0),(0,r._)([(0,f.Cb)(S.rn)],st.prototype,"legendEnabled",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],st.prototype,"isReference",void 0),(0,r._)([(0,f.Cb)({type:["show","hide"]})],st.prototype,"listMode",void 0),(0,r._)([(0,f.Cb)({json:{read:!0,write:!0}})],st.prototype,"blendMode",void 0),(0,r._)([(0,f.Cb)()],st.prototype,"sourceJSON",void 0),(0,r._)([(0,f.Cb)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],st.prototype,"version",void 0),(0,r._)([(0,f.Cb)()],st.prototype,"title",void 0),(0,r._)([(0,f.Cb)({readOnly:!0,json:{read:!1}})],st.prototype,"type",void 0),(0,r._)([(0,f.Cb)({type:["ArcGISTiledImageServiceLayer"]})],st.prototype,"operationalLayerType",void 0),(0,r._)([(0,f.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],st.prototype,"popupEnabled",void 0),(0,r._)([(0,f.Cb)({type:s.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],st.prototype,"popupTemplate",void 0),(0,r._)([(0,f.Cb)({readOnly:!0})],st.prototype,"defaultPopupTemplate",null),(0,r._)([(0,f.Cb)({readOnly:!0,type:[le.Z]})],st.prototype,"fields",void 0),(0,r._)([(0,f.Cb)({readOnly:!0,type:[le.Z]})],st.prototype,"rasterFields",null),(0,r._)([(0,f.Cb)({types:n.dr,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:n.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],st.prototype,"renderer",null),(0,r._)([(0,p.r)("renderer")],st.prototype,"readRenderer",null),st=(0,r._)([(0,m.j)("esri.layers.ImageryTileLayer")],st);const nt=st},11282:(e,t,i)=>{i.d(t,{cv:()=>o,en:()=>a,lA:()=>n});var r=i(22974),s=i(17452);function n(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function a(e){return"string"==typeof e?(0,s.mN)(e):(0,r.d9)(e)}function o(e,t,i){const r={};for(const s in e){if("declaredClass"===s)continue;const n=e[s];if(null!=n&&"function"!=typeof n)if(Array.isArray(n)){r[s]=[];for(let e=0;e<n.length;e++)r[s][e]=o(n[e])}else if("object"==typeof n)if(n.toJSON){const e=n.toJSON(i&&i[s]);r[s]=t?e:JSON.stringify(e)}else r[s]=t?n:JSON.stringify(n);else r[s]=n}return r}}}]);
|