@arcgis/core 5.2.0-next.148 → 5.2.0-next.149
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/09b9a886363bc1197785.js +1 -0
- package/assets/esri/core/workers/chunks/0ad0484ffcbe4ad21bd3.js +1 -0
- package/assets/esri/core/workers/chunks/{52c25809edf7ac008a52.js → 12a7997a40c77f5c9160.js} +1 -1
- package/assets/esri/core/workers/chunks/18787aa685524b958561.js +1 -0
- package/assets/esri/core/workers/chunks/{776ae25a34352d3468bc.js → 19743dedaa40446259ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{27a425d87c57b91489b3.js → 21f45a47708e6e43147f.js} +1 -1
- package/assets/esri/core/workers/chunks/2c626f525f3483c03477.js +1 -0
- package/assets/esri/core/workers/chunks/{7a05b18f655c1167ce0a.js → 2ef5237e4c876d6a4ee0.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a078721c7e0e24027f0.js → 320e5942a098dd104366.js} +1 -1
- package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +1 -0
- package/assets/esri/core/workers/chunks/45367aa8e5c5d574de94.js +1 -0
- package/assets/esri/core/workers/chunks/47d074136a7f8e551a9a.js +1 -0
- package/assets/esri/core/workers/chunks/{24cc7b6b5e307a89cdd5.js → 50036a323c2e7f155311.js} +1 -1
- package/assets/esri/core/workers/chunks/5116b569a8dbda4910c8.js +1 -0
- package/assets/esri/core/workers/chunks/{b2737120c5999b2f3909.js → 55dcbf296d8d0092e473.js} +1 -1
- package/assets/esri/core/workers/chunks/6299be5e7e26bf3c6859.js +1 -0
- package/assets/esri/core/workers/chunks/6b04285726b803b82564.js +1 -0
- package/assets/esri/core/workers/chunks/6c9acd9e4e201dc380e9.js +1 -0
- package/assets/esri/core/workers/chunks/7449568eb2305bf2d650.js +1 -0
- package/assets/esri/core/workers/chunks/7572c2bc5062e66f6330.js +1 -0
- package/assets/esri/core/workers/chunks/7d212c415f2709037408.js +1 -0
- package/assets/esri/core/workers/chunks/7f0f9dddc44b1f1600f0.js +1 -0
- package/assets/esri/core/workers/chunks/8414ffd937c1099e0bbc.js +1 -0
- package/assets/esri/core/workers/chunks/9401cc22373566e1171e.js +1 -0
- package/assets/esri/core/workers/chunks/97d6ef9e34a43ad2e556.js +1 -0
- package/assets/esri/core/workers/chunks/{c76c42c74eedd43263d3.js → 9dd1fc56eb1ea6eb705e.js} +1 -1
- package/assets/esri/core/workers/chunks/a07cb6a2f5b66d4e9f15.js +1 -0
- package/assets/esri/core/workers/chunks/a40b6d8b5c73e06e14d4.js +1 -0
- package/assets/esri/core/workers/chunks/a7f3576208f295b670d6.js +1 -0
- package/assets/esri/core/workers/chunks/a80e49acc827dbf3b524.js +1 -0
- package/assets/esri/core/workers/chunks/aeaaff7a4b1a99540f52.js +1 -0
- package/assets/esri/core/workers/chunks/b19b6102ed2d6f67b43b.js +1 -0
- package/assets/esri/core/workers/chunks/b1b4066e8d1c0c9656e5.js +1 -0
- package/assets/esri/core/workers/chunks/b4334713bacdfe40ce3d.js +1 -0
- package/assets/esri/core/workers/chunks/bbec9d2e3b75a5c59681.js +1 -0
- package/assets/esri/core/workers/chunks/c337fc0e6dc69c233e6d.js +1 -0
- package/assets/esri/core/workers/chunks/c8d178a0c82fffd7fed5.js +1 -0
- package/assets/esri/core/workers/chunks/c8d6bb5cca49926a0214.js +1 -0
- package/assets/esri/core/workers/chunks/cde4b044e013b9e41591.js +1 -0
- package/assets/esri/core/workers/chunks/{7a4f1484b119ebafc2e7.js → d2347d6aa1c57fd57029.js} +1 -1
- package/assets/esri/core/workers/chunks/dca35dbe427605ef6fcc.js +1 -0
- package/assets/esri/core/workers/chunks/f1df76f098a3cc924832.js +1 -0
- package/assets/esri/core/workers/chunks/f4f9d08b2df856e3b694.js +1 -0
- package/assets/esri/core/workers/chunks/f8a83d447b7aef051876.js +1 -0
- package/assets/esri/core/workers/chunks/fc44227c1756f65b95df.js +1 -0
- package/config.js +1 -1
- package/core/Loadable.js +1 -1
- package/geometry/HeightModelInfo.js +1 -1
- package/kernel.js +1 -1
- package/layers/BaseDynamicLayer.d.ts +1 -0
- package/layers/BaseElevationLayer.d.ts +2 -0
- package/layers/BaseTileLayer.d.ts +12 -9
- package/layers/CSVLayer.d.ts +0 -15
- package/layers/FeatureLayer.d.ts +2 -15
- package/layers/GeoJSONLayer.d.ts +0 -52
- package/layers/GeoRSSLayer.d.ts +0 -44
- package/layers/ParquetLayer.d.ts +81 -3
- package/layers/ParquetLayer.js +1 -1
- package/layers/VectorTileLayer.d.ts +2 -12
- package/layers/mixins/RefreshableLayer.d.ts +1 -3
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/support/layersLoader.js +1 -1
- package/package.json +2 -2
- package/popup/FeaturesModel.d.ts +1 -1
- package/popup/FeaturesModel.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/renderers/VectorFieldRenderer.d.ts +4 -4
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/dotDensity.js +1 -1
- package/smartMapping/renderers/heatmap.js +1 -1
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/renderers/type.js +1 -1
- package/smartMapping/statistics/heatmapStatistics.js +1 -1
- package/smartMapping/statistics/histogram.js +1 -1
- package/smartMapping/statistics/summaryStatistics.js +1 -1
- package/smartMapping/statistics/summaryStatisticsForAttributes.js +1 -1
- package/smartMapping/statistics/uniqueValues.js +1 -1
- package/smartMapping/support/adapters/support/layerUtils.js +1 -1
- package/smartMapping/types.d.ts +3 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/DOMContainer.d.ts +27 -9
- package/views/DOMContainer.js +1 -1
- package/views/PopupView.d.ts +6 -0
- package/views/VideoView.d.ts +27 -9
- package/views/View.d.ts +16 -7
- package/views/View.js +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/interactive/snapping/SnappingManagerPool.js +1 -1
- package/views/interactive/tooltip/components/ElevationModeSelect.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +1 -2
- package/views/layers/ParquetLayerView.d.ts +15 -0
- package/assets/esri/core/workers/chunks/05963f57cbe5a5249496.js +0 -1
- package/assets/esri/core/workers/chunks/131e89663014bc76c4ee.js +0 -1
- package/assets/esri/core/workers/chunks/14a3808427deaaa85bf2.js +0 -1
- package/assets/esri/core/workers/chunks/16053ce50642c5ffbfa9.js +0 -1
- package/assets/esri/core/workers/chunks/19689c66776b39cec234.js +0 -1
- package/assets/esri/core/workers/chunks/1a6027f08893aba9e677.js +0 -1
- package/assets/esri/core/workers/chunks/1b3f59fcad6e14c4d0e0.js +0 -1
- package/assets/esri/core/workers/chunks/20458fffda7692c78135.js +0 -1
- package/assets/esri/core/workers/chunks/2164fcaced72b0fda31f.js +0 -1
- package/assets/esri/core/workers/chunks/219d0935ce281902a49f.js +0 -1
- package/assets/esri/core/workers/chunks/2416518db4a0117541a8.js +0 -1
- package/assets/esri/core/workers/chunks/25b0885d3bc190b28c04.js +0 -1
- package/assets/esri/core/workers/chunks/2e75df54852d65e71330.js +0 -1
- package/assets/esri/core/workers/chunks/39d1d2fbe94afcd0a590.js +0 -1
- package/assets/esri/core/workers/chunks/3e9f056e4d1f0d067fc6.js +0 -1
- package/assets/esri/core/workers/chunks/43321f244effd3d67069.js +0 -1
- package/assets/esri/core/workers/chunks/47e6b5631a625298db5b.js +0 -1
- package/assets/esri/core/workers/chunks/561c48cb4d49b150765b.js +0 -1
- package/assets/esri/core/workers/chunks/5ea8809b6519c05ad9f6.js +0 -1
- package/assets/esri/core/workers/chunks/5f0c06f59121e09091f7.js +0 -1
- package/assets/esri/core/workers/chunks/62795a1573cbaa4b8e7a.js +0 -1
- package/assets/esri/core/workers/chunks/70ee81ba22badbbf045c.js +0 -1
- package/assets/esri/core/workers/chunks/794e5a67a88cb10c1a19.js +0 -1
- package/assets/esri/core/workers/chunks/841f67baf6a1634ada48.js +0 -1
- package/assets/esri/core/workers/chunks/8602b3587d4bdd9cc9f5.js +0 -1
- package/assets/esri/core/workers/chunks/898f43feeec74acde1ec.js +0 -1
- package/assets/esri/core/workers/chunks/8ef802ef8d108ae2e473.js +0 -1
- package/assets/esri/core/workers/chunks/94c5f3bc07fe516dafbe.js +0 -1
- package/assets/esri/core/workers/chunks/a101b89c18488f213d80.js +0 -1
- package/assets/esri/core/workers/chunks/a337ca943862b30b978d.js +0 -1
- package/assets/esri/core/workers/chunks/ac03976b8450331aa31e.js +0 -1
- package/assets/esri/core/workers/chunks/b0fd7cd5fc9526d30ddc.js +0 -1
- package/assets/esri/core/workers/chunks/b3e812c3a06b486f05d2.js +0 -1
- package/assets/esri/core/workers/chunks/ba48045a81acc4cda927.js +0 -1
- package/assets/esri/core/workers/chunks/c7699edd14497d174445.js +0 -1
- package/assets/esri/core/workers/chunks/dbcac8c1a76d4a9db13d.js +0 -1
- package/assets/esri/core/workers/chunks/de8d7f11f5a078c01b83.js +0 -1
- package/assets/esri/core/workers/chunks/f05de08e194a3f9b96f2.js +0 -1
- package/assets/esri/core/workers/chunks/f2b69bd704db62915a6b.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4708],{69052(e,t,n){n.d(t,{hr:()=>i});var r=n(34727);class i{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,n=!1){return s(this.range,this.min,this.max,e,t,n)}clamp(e,t=0){return(0,r.qE)(e-t,this.min,this.max)+t}monotonic(e,t,n){return e<t?t:t+o(this.range,e-t,n)}minimalMonotonic(e,t,n){return s(this.range,e,e+this.range,t,n)}center(e,t,n){return t=this.monotonic(e,t,n),this.normalize((e+t)/2,n)}diff(e,t,n){return this.monotonic(e,t,n)-e}shortestSignedDiff(e,t){e=this.normalize(e);let n=(t=this.normalize(t))-e,r=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(n)<Math.abs(r)?n:r}contains(e,t,n){return t=this.minimalMonotonic(e,t),(n=this.minimalMonotonic(e,n))>e&&n<t}}function s(e,t,n,r,i=0,s=!1){return(r-=i)<t?r+=o(e,t-r):r>n&&(r-=o(e,r-n)),s&&r===n&&(r=t),r+i}function o(e,t,n=0){return Math.ceil((t-n)/e)*e+n}const a=new i(0,2*Math.PI),l=(new i(-Math.PI,Math.PI),new i(0,360));n.d(t,["ie",0,l,"uC",0,a])},18370(e,t,n){n.d(t,{z:()=>i});class r{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return this._promise??=this._import().then(async e=>(this.module=e,e)),this._promise}}function i(e){return new r(e)}},52039(e,t,n){n.d(t,{O7:()=>f,el:()=>c});var r=n(69052),i=(n(49186),n(18370)),s=n(17676),o=(n(5443),n(39829)),a=(n(82799),n(16930)),l=(n(80754),n(21325));async function c(e,t,n){Array.isArray(e)||(e=[e]),"object"==typeof t&&t&&"authMode"in t&&(n=t);let r=null;for(let t of e)r??=t?.spatialReference;if(!r)return e;let i=(0,l.Vp)(r);if(!i)return e;if(1===e.length&&"extent"===e[0]?.type){let t=e[0].clone().normalizeAsSingleGeometry(i);return["xmin"in t?t:new o.A(t)]}let[a,c]=i.valid,f=!1;for(let t of e){if(!t)continue;if("point"===t.type){f||=t.x>=c,f||=t.x<=a;continue}let{extent:e}=t;if(null==e){f=!0;break}f||=e.xmin>=c,f||=e.xmin<=a,f||=e.xmax>=c,f||=e.xmax<=a}if(!f)return e;let[{foldInto360Range:d},g]=await(0,s.qr)(Promise.all([u.getImportPromise(),h.getImportPromise()]),n),m=g.fromSpatialReference(r);return e.map(e=>{if(null==e||"mesh"===e.type)return e;let t=g.fromGeometry(e),n=g.toGeometry(d(t,m),r);return"extent"===e.type&&1===n?.rings.length?n.extent:n})}const u=(0,i.z)(()=>n.e(4144).then(()=>n(4144)).then(e=>e.load().then(()=>e))),h=(0,i.z)(()=>Promise.all([n.e(9187),n.e(8885),n.e(9117),n.e(3299),n.e(1550)]).then(()=>n(78125)));function f(e,t,n){let r=(0,l.Vp)(n);if(null==r)return e;let[i,s]=r.valid,o=2*s,a=0,c=0;t>s?a=Math.ceil(Math.abs(t-s)/o):t<i&&(a=-Math.ceil(Math.abs(t-i)/o)),e>s?c=Math.ceil(Math.abs(e-s)/o):e<i&&(c=-Math.ceil(Math.abs(e-i)/o));let u=e+(a-c)*o,h=u-t;return h>s?u-=o:h<i&&(u+=o),u}function d(e){let t=(0,l.Vp)(e);if(null==t)return null;let[n,i]=t.valid;return new r.hr(n,i)}const g=d(a.A.WGS84);d(a.A.WebMercator),n.d(t,["Y_",0,g])},80754(e,t,n){n.d(t,{kS:()=>c,kd:()=>l});var r=n(82799),i=n(16930),s=n(60408),o=n(52006);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator}),minus180Line:new r.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.A({paths:[[[180,-180],[180,180]]],spatialReference:i.A.WGS84}),minus180Line:new r.A({paths:[[[-180,-180],[-180,180]]],spatialReference:i.A.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function c(e,t){if((0,o.Ed)(e))for(let n of function(e){return(0,s.Bi)(e)?e.curveRings:e.curvePaths}(e))for(let e of n){if((0,o.aO)(e)){let[n,r]=e.c;n[0]+=t,r[0]+=t;continue}if((0,o.FG)(e)){let[n,r]=e.a;n[0]+=t,r[0]+=t;continue}if((0,o.n1)(e)){let[n,r,i]=e.b;n[0]+=t,r[0]+=t,i[0]+=t;continue}e[0]+=t}for(let n of function(e){return(0,s.Bi)(e)?e.rings:e.paths}(e))for(let e of n)e[0]+=t;return e}n.d(t,["j7",0,a])},31464(e,t,n){n.d(t,{Cv:()=>d,Nk:()=>f,lK:()=>m});var r=n(4576),i=n(99917),s=n(60408),o=n(21325),a=n(28735);const l=[0,0];function c(e,t){let n=(0,o.K8)(e)?a.je:a.tD;if((0,s.fT)(t)){let e={x:0,y:0};return[e.x,e.y]=n(t.x,t.y,l),null!=t.z&&(e.z=t.z),null!=t.m&&(e.m=t.m),e}if((0,s.ZC)(t)){let e={xmin:0,ymin:0,xmax:0,ymax:0};return[e.xmin,e.ymin]=n(t.xmin,t.ymin,l),[e.xmax,e.ymax]=n(t.xmax,t.ymax,l),t.hasZ&&(e.zmin=t.zmin,e.zmax=t.zmax,e.hasZ=!0),t.hasM&&(e.mmin=t.mmin,e.mmax=t.mmax,e.hasM=!0),e}if((0,s.Bi)(t))return{rings:u(t.rings,n),hasM:t.hasM,hasZ:t.hasZ};if((0,s.Rg)(t))return{paths:u(t.paths,n),hasM:t.hasM,hasZ:t.hasZ};if((0,s.U9)(t))return{points:h(t.points,n),hasM:t.hasM,hasZ:t.hasZ};throw Error()}function u(e,t){let n=[];for(let r of e)n.push(h(r,t));return n}function h(e,t){let n=[];for(let r of e){let e=t(r[0],r[1],[0,0]);n.push(e),r.length>2&&e.push(r[2]),r.length>3&&e.push(r[3])}return n}async function f(e,t){if(!e||!t)return;let n=Array.isArray(e)?e.map(e=>null==e.geometry?null:e.geometry.spatialReference).filter(r.Ru):[e];await(0,i.initializeProjection)(n.map(e=>({source:e,dest:t})))}function d(e,t,n,r){if(!e)return null;if(n||(n=t,t=e.spatialReference),!(0,o.fn)(t)||!(0,o.fn)(n)||(0,o.aI)(t,n))return e;if((0,a.y7)(t,n)){let t=c(n,e);return t.spatialReference=n,t}return(0,i.projectMany)([e],t,n,r)[0]}const g=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,n,r){if(!e?.length||!t||!n||(0,o.aI)(t,n))return e;let i={geometries:e,inSpatialReference:t,outSpatialReference:n,options:r,resolve:Promise.withResolvers()};return this._jobs.push(i),this._timer??=setTimeout(this._process,10),i.resolve.promise}_process(){this._timer=null;let e=this._jobs.shift();if(!e)return;let t,{geometries:n,inSpatialReference:r,outSpatialReference:s,resolve:o,options:l}=e,u=n.filter(e=>null!=e);t=(0,a.y7)(r,s)&&null==l?.extendedParams?u.map(e=>c(s,e)):(0,i.projectMany)(u,r,s,l);let h=0,f=n.map(e=>null==e?null:t[h++]);o.resolve(f),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function m(e,t,n,r){return g.push(e,t,n,r)}},60986(e,t,n){n.r(t),n.d(t,{createConnection:()=>C});var r=n(56507),i=n(49186),s=n(31464),o=n(9916),a=n(32198),l=n(65529),c=n(91429);let u=class extends l.nJ{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new i.A("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};(0,a.Cg)([(0,c.MZ)({readOnly:!0})],u.prototype,"connectionError",null),u=(0,a.Cg)([(0,c.$K)("esri.layers.support.StreamConnection")],u);class h extends u{constructor(e,t){super(),this._config=e,this._outSpatialReference=t,this.connectionStatus="connected",this.errorString=null,this._isPolling=!1,this._lastIngestedAt=null,this._pollTimer=null,this._pollRecentData=async()=>{if(!this.destroyed&&!this._isPolling){this._isPolling=!0;try{let e=await this._queryChanges(this._lastIngestedAt);if(this.destroyed)return;this._handleResult(e)}catch(e){this.errorString=e instanceof Error?e.message:"Failed to fetch"}finally{this._isPolling=!1}}},this._initialize()}destroy(){super.destroy(),this._pollTimer&&=(clearInterval(this._pollTimer),null)}sendMessageToSocket(e){throw new i.A("kusto:unsupported","sendMessageToSocket not supported for Kusto connections")}sendMessageToClient(e){throw new i.A("kusto:unsupported","sendMessageToClient not supported for Kusto connections")}updateCustomParameters(e){throw new i.A("kusto:unsupported","updateCustomParameters not supported for Kusto connections")}async _initialize(){await(0,s.Nk)(this._config.sourceSpatialReference,this._outSpatialReference);try{let e=await this._queryInitial();this._handleResult(e),this._pollTimer=setInterval(this._pollRecentData,6e4*this._config.refreshInterval)}catch{throw new i.A("kusto:connection","Failed to query KQL database")}}async _queryInitial(){let{trackIdField:e}=this._config,t=f(await this._executeQuery(`${(0,o.xw)(this._config.table)} | extend IngestedAt = ingestion_time() | summarize arg_max(IngestedAt, *) by ${(0,o.xw)(e)}`));if(!t)throw new i.A("kusto:connection","Unable to find primaryTable");return{ingestedAt:d(t),table:t}}async _queryChanges(e=null){let t=e??"1970-01-01T00:00:00Z",n=f(await this._executeQuery(`${(0,o.xw)(this._config.table)} | extend IngestedAt = ingestion_time() | where IngestedAt > todatetime('${(0,o.iD)(t)}') | order by IngestedAt asc`));if(!n)throw new i.A("kusto:connection","Unable to find primaryTable");return{ingestedAt:d(n),table:n}}async _executeQuery(e){let t=this._config.database,n=t.properties.queryServiceUri,{data:i}=await(0,r.A)(`${n}/v2/rest/query`,{responseType:"json",method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({db:t.displayName,csl:e})});return i}_handleResult(e){this._lastIngestedAt=e.ingestedAt;let t=this._createFeatures(e.table);if(null!=t){this.onMessage(t);for(let e of t)this.onFeature(e)}}_createFeatures(e){if(null==e||0===e.Rows.length)return null;let{xField:t,yField:n}=this._config.geometryEncoding,r=e.Columns.findIndex(e=>e.ColumnName===t),i=e.Columns.findIndex(e=>e.ColumnName===n);return e.Rows.map(t=>this._createFeature(e.Columns,r,i,t))}_createFeature(e,t,n,r){let{xField:i,yField:o}=this._config.geometryEncoding,a={};for(let t=0;t<e.length;t++){let n=e[t],s=r[t]??null;n.ColumnName!==o&&n.ColumnName!==i&&(a[n.ColumnName]=s)}let l=null,c=r[t],u=r[n];return null!=u&&null!=c&&(l=(0,s.Cv)({x:c,y:u},this._config.sourceSpatialReference,this._outSpatialReference)),{attributes:a,geometry:l}}}function f(e){return e.find(e=>"DataTable"===e.FrameType&&"PrimaryResult"===e.TableKind)??null}function d(e){let t=e.Columns.findIndex(e=>"IngestedAt"===e.ColumnName);if(t<0)return null;let n=null;for(let r of e.Rows){let e=r[t];"string"==typeof e&&(null==n||e>n)&&(n=e)}return n}var g=n(53966),m=n(84952),p=n(16930),y=n(65864),_=n(17676),w=n(62815);function b(e,t){if(null==e&&null==t)return null;let n={};return null!=t&&(n.geometry=t),null!=e&&(n.where=e),n}let S=class extends u{constructor(e,t){super({}),this._outSpatialReference=t,this._outstandingMessages=[],this.errorString=null;let{geometryType:n,sourceSpatialReference:r}=e;this._config=e,this._featureZScaler=(0,w.N)(n,r,this._outSpatialReference),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case 0:case 1:return"connected";case 2:case 3:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.url.path,t=1e3,n=0){try{if(this.destroyed)return;let t=(0,m.a6)(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(r){let s=t/1e3;return this._config.maxReconnectionAttempts&&n>=this._config.maxReconnectionAttempts?(g.A.getLogger(this).error(new i.A("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(g.A.getLogger(this).error(new i.A("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,r)),await(0,_.Pl)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),n+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{let t=JSON.parse(e.data);this._onMessage(t)}catch(e){return void g.A.getLogger(this).error(new i.A("websocket-connection","Failed to parse message, invalid JSON",{error:e}))}}}_createWebSocket(e){return new Promise((t,n)=>{let r=new WebSocket(e);r.onopen=()=>{if(r.onopen=null,this.destroyed)return r.onclose=null,void r.close();r.onclose=e=>this._onClose(e),r.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(r),t(r)},r.onclose=e=>{r.onopen=r.onclose=null,n(e)}})}async _handshake(e=1e4){let t=this._websocket;if(null==t)return;let n=Promise.withResolvers(),r=t.onmessage,s=b(this._config.definitionExpression,this._config.geometryDefinition),{outFields:o}=this._config,a=setTimeout(()=>n.reject(),e),l=()=>{clearTimeout(a),n.reject()};return t.onmessage=e=>{let c=null;try{c=JSON.parse(e.data)}catch{}(!c||"object"!=typeof c)&&(g.A.getLogger(this).error(new i.A("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),l(),this.destroy()),c.spatialReference?.wkid!==this._outSpatialReference?.wkid&&(g.A.getLogger(this).error(new i.A("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${this._outSpatialReference.wkid}`,e.data)),l(),this.destroy()),"json"!==c.format&&(g.A.getLogger(this).error(new i.A("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),l(),this.destroy()),s&&c.filter!==s&&g.A.getLogger(this).error(new i.A("websocket-connection","Tried to set filter, but server doesn't support it")),o&&c.outFields!==o&&g.A.getLogger(this).error(new i.A("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=r;for(let e of this._outstandingMessages)t.send(JSON.stringify(e));this._outstandingMessages=[],clearTimeout(a),n.resolve()},t.send(JSON.stringify({filter:s,outFields:o,format:"json",spatialReference:{wkid:this._outSpatialReference.wkid}})),n.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(let t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){let t="Encountered an error over WebSocket connection";this._set("errorString",t),g.A.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&g.A.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,a.Cg)([(0,c.MZ)()],S.prototype,"connectionStatus",null),(0,a.Cg)([(0,c.MZ)()],S.prototype,"errorString",void 0),S=(0,a.Cg)([(0,c.$K)("esri.layers.graphics.sources.connections.WebSocketConnection")],S);var k=n(80893),A=n(97552);const x={maxQueryDepth:5,maxRecordCountFactor:3};let v=class extends S{constructor(e,t){super({...x,...e},t),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){let e=await this._fetchServiceDefinition(this._config.url);e.timeInfo.trackIdField||g.A.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");let t=this._fetchWebSocketUrl(e.streamUrls,this._outSpatialReference);this._buddyServicesQuery||=this._queryBuddyServices(),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);let n=b(this._config.definitionExpression,this._config.geometryDefinition),{outFields:r}=this._config;this.destroyed||this._setFilter(n,r)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(t.geometry)}catch(e){return void g.A.getLogger(this).error(new i.A("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){let t={f:"json",...this._config.customParameters},n=(await(0,r.A)(e.path,{query:t,responseType:"json"})).data;return this._serviceDefinition=n,n}_fetchWebSocketUrl(e,t){let{urls:n,token:r}=e[0],i=this._inferWebSocketBaseUrl(n);return(0,m.a6)(`${i}/subscribe`,{outSR:""+t.wkid,token:r})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(let t of e)if(t.includes("wss"))return t;return g.A.getLogger(this).error(new i.A("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){let n=this._websocket;if(null==n||null==e&&null==t)return;let r=JSON.stringify({filter:this._serializeFilter(e,t)}),s=!1,o=Promise.withResolvers();return n.onmessage=e=>{let t=JSON.parse(e.data);t.filter&&(t.error&&(g.A.getLogger(this).error(new i.A("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),o.reject(t.error)),this._setWebSocketJSONParseHandler(n),s=!0,o.resolve())},n.send(r),setTimeout(()=>{s||(!this.destroyed&&this._websocket===n&&g.A.getLogger(this).error(new i.A("geoevent-connection","Server timed out when setting filter")),o.reject())},1e4),o.promise}_serializeFilter(e,t){let n={};if(null==e&&null==t)return n;if(e?.geometry)try{let t=(0,y.rS)(e.geometry);if("extent"!==t.type)throw new i.A("geoevent-connection",`Expected extent but found type ${t.type}`);n.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){g.A.getLogger(this).error(new i.A("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(n.where=e.where),null!=t&&(n.outFields=t.join(",")),n}_enrich(e){if(!this._relatedFeatures)return e;let t=this._serviceDefinition.relatedFeatures.joinField,n=e.attributes[t],r=this._relatedFeatures.get(n);if(!r)return g.A.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;let{attributes:s,geometry:o}=r;for(let t in s)e.attributes[t]=s[t];return o&&(e.geometry=o),!e.geometry&&!e.centroid&&g.A.getLogger(this).error(new i.A("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{let{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,n=this._queryRelatedFeatures(e),r=this._queryArchive(t);await n;let i=await r;if(!i)return;for(let e of i.features)this.onFeature(this._enrich(e))}catch(e){g.A.getLogger(this).error(new i.A("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;let t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){let t=new((await Promise.all([n.e(6361),n.e(6914),n.e(7865),n.e(5732),n.e(2869),n.e(9953),n.e(3910),n.e(564),n.e(1214),n.e(7831),n.e(1017),n.e(9789),n.e(4674),n.e(7283),n.e(8589),n.e(812),n.e(5879),n.e(9279)]).then(()=>n(18589))).default)({url:e}),{capabilities:r}=await t.load(),i=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,o=r.query.supportsCentroid,a=this._config.maxRecordCountFactor,l=t.capabilities.query.maxRecordCount,c=i?l*a:l,u=new A.A;if(u.outFields=this._config.outFields??["*"],u.where=this._config.definitionExpression??"1=1",u.returnGeometry=!0,u.returnExceededLimitFeatures=!0,u.outSpatialReference=p.A.fromJSON(this._outSpatialReference),o&&(u.returnCentroid=!0),i&&(u.maxRecordCountFactor=a),s)return u.num=c,t.destroy(),this._queryPages(e,u);let h=await(0,k.eW)(e,u,this._config.sourceSpatialReference);return t.destroy(),h}async _queryPages(e,t,n=[],r=0){t.start=null==t.num?null:r*t.num;let i=await(0,k.eW)(e,t,this._config.sourceSpatialReference);return i.exceededTransferLimit&&r<(this._config.maxQueryDepth??0)?(i.features.forEach(e=>n.push(e)),this._queryPages(e,t,n,r+1)):(n.forEach(e=>i.features.push(e)),i)}_addRelatedFeatures(e){let t=new Map,n=e.features,r=this._serviceDefinition.relatedFeatures.joinField;for(let e of n){let n=e.attributes[r];t.set(n,e)}this._relatedFeatures=t}};v=(0,a.Cg)([(0,c.$K)("esri.layers.graphics.sources.connections.GeoEventConnection")],v);var R=n(64108);let M=class extends u{constructor(e,t){super({}),this.connectionStatus="connected",this.errorString=null;let{geometryType:n,sourceSpatialReference:r}=e;this._featureZScaler=(0,w.N)(n,r,t)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(let t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};function C(e,t){let n=t.toJSON();switch(e.type){case"client":return new M(e,n);case"custom":return new S(e,n);case"geoevent":return new v(e,n);case"kusto":return new h(e,n)}}(0,a.Cg)([(0,c.MZ)()],M.prototype,"connectionStatus",void 0),(0,a.Cg)([(0,c.MZ)()],M.prototype,"errorString",void 0),M=(0,a.Cg)([(0,R.$)("esri.layers.support.ClientSideConnection")],M)}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4708],{69052(e,t,n){n.d(t,{hr:()=>i});var r=n(34727);class i{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,n=!1){return s(this.range,this.min,this.max,e,t,n)}clamp(e,t=0){return(0,r.qE)(e-t,this.min,this.max)+t}monotonic(e,t,n){return e<t?t:t+o(this.range,e-t,n)}minimalMonotonic(e,t,n){return s(this.range,e,e+this.range,t,n)}center(e,t,n){return t=this.monotonic(e,t,n),this.normalize((e+t)/2,n)}diff(e,t,n){return this.monotonic(e,t,n)-e}shortestSignedDiff(e,t){e=this.normalize(e);let n=(t=this.normalize(t))-e,r=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(n)<Math.abs(r)?n:r}contains(e,t,n){return t=this.minimalMonotonic(e,t),(n=this.minimalMonotonic(e,n))>e&&n<t}}function s(e,t,n,r,i=0,s=!1){return(r-=i)<t?r+=o(e,t-r):r>n&&(r-=o(e,r-n)),s&&r===n&&(r=t),r+i}function o(e,t,n=0){return Math.ceil((t-n)/e)*e+n}const a=new i(0,2*Math.PI),l=(new i(-Math.PI,Math.PI),new i(0,360));n.d(t,["ie",0,l,"uC",0,a])},18370(e,t,n){n.d(t,{z:()=>i});class r{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return this._promise??=this._import().then(async e=>(this.module=e,e)),this._promise}}function i(e){return new r(e)}},52039(e,t,n){n.d(t,{O7:()=>f,el:()=>c});var r=n(69052),i=(n(49186),n(18370)),s=n(17676),o=(n(5443),n(39829)),a=(n(82799),n(16930)),l=(n(80754),n(21325));async function c(e,t,n){Array.isArray(e)||(e=[e]),"object"==typeof t&&t&&"authMode"in t&&(n=t);let r=null;for(let t of e)r??=t?.spatialReference;if(!r)return e;let i=(0,l.Vp)(r);if(!i)return e;if(1===e.length&&"extent"===e[0]?.type){let t=e[0].clone().normalizeAsSingleGeometry(i);return["xmin"in t?t:new o.A(t)]}let[a,c]=i.valid,f=!1;for(let t of e){if(!t)continue;if("point"===t.type){f||=t.x>=c,f||=t.x<=a;continue}let{extent:e}=t;if(null==e){f=!0;break}f||=e.xmin>=c,f||=e.xmin<=a,f||=e.xmax>=c,f||=e.xmax<=a}if(!f)return e;let[{foldInto360Range:d},g]=await(0,s.qr)(Promise.all([u.getImportPromise(),h.getImportPromise()]),n),m=g.fromSpatialReference(r);return e.map(e=>{if(null==e||"mesh"===e.type)return e;let t=g.fromGeometry(e),n=g.toGeometry(d(t,m),r);return"extent"===e.type&&1===n?.rings.length?n.extent:n})}const u=(0,i.z)(()=>n.e(4144).then(()=>n(4144)).then(e=>e.load().then(()=>e))),h=(0,i.z)(()=>Promise.all([n.e(9187),n.e(8885),n.e(9117),n.e(3299),n.e(1550)]).then(()=>n(78125)));function f(e,t,n){let r=(0,l.Vp)(n);if(null==r)return e;let[i,s]=r.valid,o=2*s,a=0,c=0;t>s?a=Math.ceil(Math.abs(t-s)/o):t<i&&(a=-Math.ceil(Math.abs(t-i)/o)),e>s?c=Math.ceil(Math.abs(e-s)/o):e<i&&(c=-Math.ceil(Math.abs(e-i)/o));let u=e+(a-c)*o,h=u-t;return h>s?u-=o:h<i&&(u+=o),u}function d(e){let t=(0,l.Vp)(e);if(null==t)return null;let[n,i]=t.valid;return new r.hr(n,i)}const g=d(a.A.WGS84);d(a.A.WebMercator),n.d(t,["Y_",0,g])},80754(e,t,n){n.d(t,{kS:()=>c,kd:()=>l});var r=n(82799),i=n(16930),s=n(60408),o=n(52006);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator}),minus180Line:new r.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.A({paths:[[[180,-180],[180,180]]],spatialReference:i.A.WGS84}),minus180Line:new r.A({paths:[[[-180,-180],[-180,180]]],spatialReference:i.A.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function c(e,t){if((0,o.Ed)(e))for(let n of function(e){return(0,s.Bi)(e)?e.curveRings:e.curvePaths}(e))for(let e of n){if((0,o.aO)(e)){let[n,r]=e.c;n[0]+=t,r[0]+=t;continue}if((0,o.FG)(e)){let[n,r]=e.a;n[0]+=t,r[0]+=t;continue}if((0,o.n1)(e)){let[n,r,i]=e.b;n[0]+=t,r[0]+=t,i[0]+=t;continue}e[0]+=t}for(let n of function(e){return(0,s.Bi)(e)?e.rings:e.paths}(e))for(let e of n)e[0]+=t;return e}n.d(t,["j7",0,a])},31464(e,t,n){n.d(t,{Cv:()=>d,Nk:()=>f,lK:()=>m});var r=n(4576),i=n(99917),s=n(60408),o=n(21325),a=n(28735);const l=[0,0];function c(e,t){let n=(0,o.K8)(e)?a.je:a.tD;if((0,s.fT)(t)){let e={x:0,y:0};return[e.x,e.y]=n(t.x,t.y,l),null!=t.z&&(e.z=t.z),null!=t.m&&(e.m=t.m),e}if((0,s.ZC)(t)){let e={xmin:0,ymin:0,xmax:0,ymax:0};return[e.xmin,e.ymin]=n(t.xmin,t.ymin,l),[e.xmax,e.ymax]=n(t.xmax,t.ymax,l),t.hasZ&&(e.zmin=t.zmin,e.zmax=t.zmax,e.hasZ=!0),t.hasM&&(e.mmin=t.mmin,e.mmax=t.mmax,e.hasM=!0),e}if((0,s.Bi)(t))return{rings:u(t.rings,n),hasM:t.hasM,hasZ:t.hasZ};if((0,s.Rg)(t))return{paths:u(t.paths,n),hasM:t.hasM,hasZ:t.hasZ};if((0,s.U9)(t))return{points:h(t.points,n),hasM:t.hasM,hasZ:t.hasZ};throw Error()}function u(e,t){let n=[];for(let r of e)n.push(h(r,t));return n}function h(e,t){let n=[];for(let r of e){let e=t(r[0],r[1],[0,0]);n.push(e),r.length>2&&e.push(r[2]),r.length>3&&e.push(r[3])}return n}async function f(e,t){if(!e||!t)return;let n=Array.isArray(e)?e.map(e=>null==e.geometry?null:e.geometry.spatialReference).filter(r.Ru):[e];await(0,i.initializeProjection)(n.map(e=>({source:e,dest:t})))}function d(e,t,n,r){if(!e)return null;if(n||(n=t,t=e.spatialReference),!(0,o.fn)(t)||!(0,o.fn)(n)||(0,o.aI)(t,n))return e;if((0,a.y7)(t,n)){let t=c(n,e);return t.spatialReference=n,t}return(0,i.projectMany)([e],t,n,r)[0]}const g=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,n,r){if(!e?.length||!t||!n||(0,o.aI)(t,n))return e;let i={geometries:e,inSpatialReference:t,outSpatialReference:n,options:r,resolve:Promise.withResolvers()};return this._jobs.push(i),this._timer??=setTimeout(this._process,10),i.resolve.promise}_process(){this._timer=null;let e=this._jobs.shift();if(!e)return;let t,{geometries:n,inSpatialReference:r,outSpatialReference:s,resolve:o,options:l}=e,u=n.filter(e=>null!=e);t=(0,a.y7)(r,s)&&null==l?.extendedParams?u.map(e=>c(s,e)):(0,i.projectMany)(u,r,s,l);let h=0,f=n.map(e=>null==e?null:t[h++]);o.resolve(f),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function m(e,t,n,r){return g.push(e,t,n,r)}},60986(e,t,n){n.r(t),n.d(t,{createConnection:()=>C});var r=n(56507),i=n(49186),s=n(31464),o=n(9916),a=n(32198),l=n(65529),c=n(91429);let u=class extends l.nJ{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new i.A("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};(0,a.Cg)([(0,c.MZ)({readOnly:!0})],u.prototype,"connectionError",null),u=(0,a.Cg)([(0,c.$K)("esri.layers.support.StreamConnection")],u);class h extends u{constructor(e,t){super(),this._config=e,this._outSpatialReference=t,this.connectionStatus="connected",this.errorString=null,this._isPolling=!1,this._lastIngestedAt=null,this._pollTimer=null,this._pollRecentData=async()=>{if(!this.destroyed&&!this._isPolling){this._isPolling=!0;try{let e=await this._queryChanges(this._lastIngestedAt);if(this.destroyed)return;this._handleResult(e)}catch(e){this.errorString=e instanceof Error?e.message:"Failed to fetch"}finally{this._isPolling=!1}}},this._initialize()}destroy(){super.destroy(),this._pollTimer&&=(clearInterval(this._pollTimer),null)}sendMessageToSocket(e){throw new i.A("kusto:unsupported","sendMessageToSocket not supported for Kusto connections")}sendMessageToClient(e){throw new i.A("kusto:unsupported","sendMessageToClient not supported for Kusto connections")}updateCustomParameters(e){throw new i.A("kusto:unsupported","updateCustomParameters not supported for Kusto connections")}async _initialize(){await(0,s.Nk)(this._config.sourceSpatialReference,this._outSpatialReference);try{let e=await this._queryInitial();this._handleResult(e),this._pollTimer=setInterval(this._pollRecentData,6e4*this._config.refreshInterval)}catch{throw new i.A("kusto:connection","Failed to query KQL database")}}async _queryInitial(){let{trackIdField:e}=this._config,t=f(await this._executeQuery(`${(0,o.xw)(this._config.table)} | extend IngestedAt = ingestion_time() | summarize arg_max(IngestedAt, *) by ${(0,o.xw)(e)}`));if(!t)throw new i.A("kusto:connection","Unable to find primaryTable");return{ingestedAt:d(t),table:t}}async _queryChanges(e=null){let t=e??"1970-01-01T00:00:00Z",n=f(await this._executeQuery(`${(0,o.xw)(this._config.table)} | extend IngestedAt = ingestion_time() | where IngestedAt > todatetime('${(0,o.iD)(t)}') | order by IngestedAt asc`));if(!n)throw new i.A("kusto:connection","Unable to find primaryTable");return{ingestedAt:d(n),table:n}}async _executeQuery(e){let t=this._config.database,n=t.properties.queryServiceUri,{data:i}=await(0,r.A)(`${n}/v2/rest/query`,{responseType:"json",method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({db:t.displayName,csl:e})});return i}_handleResult(e){this._lastIngestedAt=e.ingestedAt;let t=this._createFeatures(e.table);if(null!=t){this.onMessage(t);for(let e of t)this.onFeature(e)}}_createFeatures(e){if(null==e||0===e.Rows.length)return null;let{xField:t,yField:n}=this._config.geometryEncoding,r=e.Columns.findIndex(e=>e.ColumnName===t),i=e.Columns.findIndex(e=>e.ColumnName===n);return e.Rows.map(t=>this._createFeature(e.Columns,r,i,t))}_createFeature(e,t,n,r){let{xField:i,yField:o}=this._config.geometryEncoding,a={};for(let t=0;t<e.length;t++){let n=e[t],s=r[t]??null;n.ColumnName!==o&&n.ColumnName!==i&&(a[n.ColumnName]=s)}let l=null,c=r[t],u=r[n];return null!=u&&null!=c&&(l=(0,s.Cv)({x:c,y:u},this._config.sourceSpatialReference,this._outSpatialReference)),{attributes:a,geometry:l}}}function f(e){return e.find(e=>"DataTable"===e.FrameType&&"PrimaryResult"===e.TableKind)??null}function d(e){let t=e.Columns.findIndex(e=>"IngestedAt"===e.ColumnName);if(t<0)return null;let n=null;for(let r of e.Rows){let e=r[t];"string"==typeof e&&(null==n||e>n)&&(n=e)}return n}var g=n(53966),m=n(84952),p=n(16930),y=n(65864),_=n(17676),w=n(62815);function b(e,t){if(null==e&&null==t)return null;let n={};return null!=t&&(n.geometry=t),null!=e&&(n.where=e),n}let S=class extends u{constructor(e,t){super({}),this._outSpatialReference=t,this._outstandingMessages=[],this.errorString=null;let{geometryType:n,sourceSpatialReference:r}=e;this._config=e,this._featureZScaler=(0,w.N)(n,r,this._outSpatialReference),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case 0:case 1:return"connected";case 2:case 3:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.url.path,t=1e3,n=0){try{if(this.destroyed)return;let t=(0,m.a6)(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(r){let s=t/1e3;return this._config.maxReconnectionAttempts&&n>=this._config.maxReconnectionAttempts?(g.A.getLogger(this).error(new i.A("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(g.A.getLogger(this).error(new i.A("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,r)),await(0,_.Pl)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),n+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{let t=JSON.parse(e.data);this._onMessage(t)}catch(e){return void g.A.getLogger(this).error(new i.A("websocket-connection","Failed to parse message, invalid JSON",{error:e}))}}}_createWebSocket(e){return new Promise((t,n)=>{let r=new WebSocket(e);r.onopen=()=>{if(r.onopen=null,this.destroyed)return r.onclose=null,void r.close();r.onclose=e=>this._onClose(e),r.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(r),t(r)},r.onclose=e=>{r.onopen=r.onclose=null,n(e)}})}async _handshake(e=1e4){let t=this._websocket;if(null==t)return;let n=Promise.withResolvers(),r=t.onmessage,s=b(this._config.definitionExpression,this._config.geometryDefinition),{outFields:o}=this._config,a=setTimeout(()=>n.reject(),e),l=()=>{clearTimeout(a),n.reject()};return t.onmessage=e=>{let c=null;try{c=JSON.parse(e.data)}catch{}(!c||"object"!=typeof c)&&(g.A.getLogger(this).error(new i.A("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),l(),this.destroy()),c.spatialReference?.wkid!==this._outSpatialReference?.wkid&&(g.A.getLogger(this).error(new i.A("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${this._outSpatialReference.wkid}`,e.data)),l(),this.destroy()),"json"!==c.format&&(g.A.getLogger(this).error(new i.A("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),l(),this.destroy()),s&&c.filter!==s&&g.A.getLogger(this).error(new i.A("websocket-connection","Tried to set filter, but server doesn't support it")),o&&c.outFields!==o&&g.A.getLogger(this).error(new i.A("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=r;for(let e of this._outstandingMessages)t.send(JSON.stringify(e));this._outstandingMessages=[],clearTimeout(a),n.resolve()},t.send(JSON.stringify({filter:s,outFields:o,format:"json",spatialReference:{wkid:this._outSpatialReference.wkid}})),n.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(let t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){let t="Encountered an error over WebSocket connection";this._set("errorString",t),g.A.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&g.A.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,a.Cg)([(0,c.MZ)()],S.prototype,"connectionStatus",null),(0,a.Cg)([(0,c.MZ)()],S.prototype,"errorString",void 0),S=(0,a.Cg)([(0,c.$K)("esri.layers.graphics.sources.connections.WebSocketConnection")],S);var k=n(80893),A=n(97552);const x={maxQueryDepth:5,maxRecordCountFactor:3};let v=class extends S{constructor(e,t){super({...x,...e},t),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){let e=await this._fetchServiceDefinition(this._config.url);e.timeInfo.trackIdField||g.A.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");let t=this._fetchWebSocketUrl(e.streamUrls,this._outSpatialReference);this._buddyServicesQuery||=this._queryBuddyServices(),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);let n=b(this._config.definitionExpression,this._config.geometryDefinition),{outFields:r}=this._config;this.destroyed||this._setFilter(n,r)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(t.geometry)}catch(e){return void g.A.getLogger(this).error(new i.A("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){let t={f:"json",...this._config.customParameters},n=(await(0,r.A)(e.path,{query:t,responseType:"json"})).data;return this._serviceDefinition=n,n}_fetchWebSocketUrl(e,t){let{urls:n,token:r}=e[0],i=this._inferWebSocketBaseUrl(n);return(0,m.a6)(`${i}/subscribe`,{outSR:""+t.wkid,token:r})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(let t of e)if(t.includes("wss"))return t;return g.A.getLogger(this).error(new i.A("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){let n=this._websocket;if(null==n||null==e&&null==t)return;let r=JSON.stringify({filter:this._serializeFilter(e,t)}),s=!1,o=Promise.withResolvers();return n.onmessage=e=>{let t=JSON.parse(e.data);t.filter&&(t.error&&(g.A.getLogger(this).error(new i.A("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),o.reject(t.error)),this._setWebSocketJSONParseHandler(n),s=!0,o.resolve())},n.send(r),setTimeout(()=>{s||(!this.destroyed&&this._websocket===n&&g.A.getLogger(this).error(new i.A("geoevent-connection","Server timed out when setting filter")),o.reject())},1e4),o.promise}_serializeFilter(e,t){let n={};if(null==e&&null==t)return n;if(e?.geometry)try{let t=(0,y.rS)(e.geometry);if("extent"!==t.type)throw new i.A("geoevent-connection",`Expected extent but found type ${t.type}`);n.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){g.A.getLogger(this).error(new i.A("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(n.where=e.where),null!=t&&(n.outFields=t.join(",")),n}_enrich(e){if(!this._relatedFeatures)return e;let t=this._serviceDefinition.relatedFeatures.joinField,n=e.attributes[t],r=this._relatedFeatures.get(n);if(!r)return g.A.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;let{attributes:s,geometry:o}=r;for(let t in s)e.attributes[t]=s[t];return o&&(e.geometry=o),!e.geometry&&!e.centroid&&g.A.getLogger(this).error(new i.A("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{let{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,n=this._queryRelatedFeatures(e),r=this._queryArchive(t);await n;let i=await r;if(!i)return;for(let e of i.features)this.onFeature(this._enrich(e))}catch(e){g.A.getLogger(this).error(new i.A("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;let t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){let t=new((await Promise.all([n.e(6361),n.e(8278),n.e(7865),n.e(6554),n.e(2869),n.e(9953),n.e(3910),n.e(5566),n.e(1214),n.e(2889),n.e(1017),n.e(9789),n.e(4674),n.e(7283),n.e(8589),n.e(812),n.e(5879),n.e(9279)]).then(()=>n(18589))).default)({url:e}),{capabilities:r}=await t.load(),i=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,o=r.query.supportsCentroid,a=this._config.maxRecordCountFactor,l=t.capabilities.query.maxRecordCount,c=i?l*a:l,u=new A.A;if(u.outFields=this._config.outFields??["*"],u.where=this._config.definitionExpression??"1=1",u.returnGeometry=!0,u.returnExceededLimitFeatures=!0,u.outSpatialReference=p.A.fromJSON(this._outSpatialReference),o&&(u.returnCentroid=!0),i&&(u.maxRecordCountFactor=a),s)return u.num=c,t.destroy(),this._queryPages(e,u);let h=await(0,k.eW)(e,u,this._config.sourceSpatialReference);return t.destroy(),h}async _queryPages(e,t,n=[],r=0){t.start=null==t.num?null:r*t.num;let i=await(0,k.eW)(e,t,this._config.sourceSpatialReference);return i.exceededTransferLimit&&r<(this._config.maxQueryDepth??0)?(i.features.forEach(e=>n.push(e)),this._queryPages(e,t,n,r+1)):(n.forEach(e=>i.features.push(e)),i)}_addRelatedFeatures(e){let t=new Map,n=e.features,r=this._serviceDefinition.relatedFeatures.joinField;for(let e of n){let n=e.attributes[r];t.set(n,e)}this._relatedFeatures=t}};v=(0,a.Cg)([(0,c.$K)("esri.layers.graphics.sources.connections.GeoEventConnection")],v);var R=n(64108);let M=class extends u{constructor(e,t){super({}),this.connectionStatus="connected",this.errorString=null;let{geometryType:n,sourceSpatialReference:r}=e;this._featureZScaler=(0,w.N)(n,r,t)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(let t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};function C(e,t){let n=t.toJSON();switch(e.type){case"client":return new M(e,n);case"custom":return new S(e,n);case"geoevent":return new v(e,n);case"kusto":return new h(e,n)}}(0,a.Cg)([(0,c.MZ)()],M.prototype,"connectionStatus",void 0),(0,a.Cg)([(0,c.MZ)()],M.prototype,"errorString",void 0),M=(0,a.Cg)([(0,R.$)("esri.layers.support.ClientSideConnection")],M)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[926,5879],{92474(e,t,r){r.d(t,{Zm:()=>c});var s=r(32198),o=r(49186),i=r(97768),l=r(61893),a=r(17676),n=r(67076),u=r(10107),p=r(64108);const d="loaded",h=e=>{let t=e,r=class extends t{constructor(...e){super(...e),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(e=>{let t=this.load.bind(this);this.load=r=>{let s=new Promise((e,t)=>{let s=(0,a.NY)(r,t);this.destroyed&&t(new o.A("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this.when(e,t).finally(()=>{s&&s.remove()})});if("not-loaded"===this.loadStatus){this._set("loadStatus","loading");let e=this._loadController=new AbortController,r=t({signal:e.signal});(0,a.$X)(r)&&r.catch(()=>{})}return e(),s}})),this.when(()=>{this._set("loadStatus",d),this._loadController=null},e=>{this.destroyed||(this._set("loadStatus","failed"),this._set("loadError",e),this._loadController=null)})}destroy(){this._loadController&&(this._loadController=(0,i.DC)(this._loadController),this._promiseProps.abort()),this._set("loadError",null),this._set("loadWarnings",[])}get loaded(){return this.loadStatus===d}get loadWarnings(){return this._get("loadWarnings")}async load(e){return this}cancelLoad(){return this.isFulfilled()||(this._set("loadError",new o.A("load:cancelled","Cancelled")),this._loadController?.abort(),this._promiseProps.abort()),this}};return(0,s.Cg)([(0,u.MZ)({readOnly:!0})],r.prototype,"loaded",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],r.prototype,"loadError",void 0),(0,s.Cg)([(0,u.MZ)({clonable:!1})],r.prototype,"loadStatus",void 0),(0,s.Cg)([(0,u.MZ)({type:[n.A],readOnly:!0})],r.prototype,"loadWarnings",null),r=(0,s.Cg)([(0,p.$)("esri.core.Loadable")],r),r},y=h(l.Z);function c(e){return!(!e||!e.load)}r.d(t,["WV",0,h,"x_",0,y])},61893(e,t,r){var s=r(32198),o=r(69622),i=r(36563),l=r(17676),a=r(64108);class n{constructor(){this._resolver=Promise.withResolvers(),this._status=0,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=1,this._cleanUp()},()=>{this._status=2,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return 1===this._status}isRejected(){return 2===this._status}isFulfilled(){return 0!==this._status}abort(){this._resolver.reject((0,l.NK)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;let e=Promise.withResolvers(),t=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(t);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()},e=>{this.isFulfilled()||this._allPromise!==r||(0,l.zf)(e)||this._resolver.reject(e)}),e.resolve()}}const u=e=>{let t=e,r=class extends t{constructor(...e){super(...e),this._promiseProps=new n,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return this._promiseProps.promise.then(()=>this).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}addResolvingTask(e){e&&!this._promiseProps.isFulfilled()&&(this.addHandles((0,i.rE)(e)),this._promiseProps.addResolvingPromise(e.promise))}};return r=(0,s.Cg)([(0,a.$)("esri.core.Promise")],r),r},p=u(o.A);r.d(t,["Z",0,p,"g",0,u])},41910(e,t,r){r.d(t,{WH:()=>o});const s=Symbol("arcadeFeatureSource");function o(e){return null!=(t=e)&&s in t?e[s]:null;var t}r.d(t,["e7",0,s])},5757(e,t,r){r.d(t,{B:()=>o});const s=Symbol("PopupTemplateInstance");function o(e){return"object"==typeof e&&!!e&&s in e}r.d(t,["P",0,s])},20655(e,t,r){r.d(t,{A:()=>A});var s=r(32198),o=r(92602),i=r(70333),l=r(56507),a=r(49186),n=r(25482),u=r(92474),p=r(97768),d=r(17676),h=r(91429),y=r(78888),c=r(5443),m=r(73444);let g;var f=r(96360),C=r(16405),v=r(69622);let M=class extends v.A{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};(0,s.Cg)([(0,h.MZ)()],M.prototype,"nextQueryParams",void 0),(0,s.Cg)([(0,h.MZ)()],M.prototype,"queryParams",void 0),(0,s.Cg)([(0,h.MZ)()],M.prototype,"results",void 0),(0,s.Cg)([(0,h.MZ)()],M.prototype,"total",void 0),M=(0,s.Cg)([(0,h.$K)("esri.portal.PortalQueryResult")],M);var Z,S=r(41318),P=r(926),w=r(36005);let _;const O={PortalGroup:()=>Promise.resolve({default:f.A}),PortalItem:()=>r.e(812).then(()=>r(80812)),PortalUser:()=>Promise.resolve({default:S.A})};let A=class extends((0,n.T)(u.x_)){static{Z=this}static{this.AUTH_MODE_ANONYMOUS="anonymous"}static{this.AUTH_MODE_AUTO="auto"}static{this.AUTH_MODE_IMMEDIATE="immediate"}static{this.AUTH_MODE_NO_PROMPT="no-prompt"}constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.g3DTilesGalleryGroupQuery=null,this.g3dTilesEnabled=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.default3DBasemapQuery=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.hasClassificationSchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.recycleBinEnabled=!1,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=o.A.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useDefault3dBasemap=!1,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e}destroy(){b.unregister(this),this.defaultBasemap=(0,p.pR)(this.defaultBasemap),this.defaultDevBasemap=(0,p.pR)(this.defaultDevBasemap),this.defaultVectorBasemap=(0,p.pR)(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=(0,p.xt)(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(let t of e)o.A.request.trustedServers.includes(t)||o.A.request.trustedServers.push(t);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){let e=!this.user?.orgId||this.canSearchPublic;return this.id&&!e?`orgid:${this.id}`:null}get hasAPIKey(){return(0,P.Jn)(this.restUrl)}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get loaded(){return super.loaded}get restUrl(){let e=this.url;if(e){let t=e.indexOf("/sharing");e=t>0?e.slice(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){let e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e&&e.toLowerCase()}readUser(e){let t=null;return e&&(t=S.A.fromJSON(e),t.portal=this),t}load(e){let t=Promise.all([r.e(812),r.e(3281),r.e(3116)]).then(()=>r(83116)).then(({default:t})=>{(0,d.Te)(e),_=t}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,e)).then(e=>{if(!this.hasAPIKey&&i.id){let e=i.id;this.credential=e.findCredential(this.restUrl),!this.credential&&(this.authMode===Z.AUTH_MODE_AUTO||this.authMode===Z.AUTH_MODE_NO_PROMPT)&&(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=e.on("credential-create",function(e){let t=i.id;return()=>{let r=e.deref();r&&t.findCredential(r.restUrl)&&r.signIn().catch(()=>{})}}(new WeakRef(this))),b.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=e,this.read(e)});return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();let e=this._getHelperService("defaultElevationLayers"),t=(await Promise.all([r.e(9917),r.e(8278),r.e(9953),r.e(812),r.e(8732),r.e(5864)]).then(()=>r(38732))).default;return e?e.map(e=>new t({id:e.id,url:e.url})):[]}async fetchBasemaps(e,t){let r=await this._fetchBasemaps(e,t);if(!0===t?.include3d&&!1!==this.use3dBasemaps){if(this.g3dTilesEnabled&&this.g3DTilesGalleryGroupQuery){let e=await this._fetchBasemaps3D(this.g3DTilesGalleryGroupQuery,t);r.unshift(...e)}let s=await this._fetchBasemaps3D(e,t);r.unshift(...s)}return r}async fetchDefault3DBasemap(e){if(!this.useDefault3dBasemap||!this.default3DBasemapQuery||"none"===this.default3DBasemapQuery)return null;let t=new C.A;t.query=this.default3DBasemapQuery,t.disableExtraQuery=!0;let r=(await this.queryItems(t,e)).results.find(e=>"Web Scene"===e.type);return r?new _({portalItem:r}):null}fetchCategorySchema(e){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",e).then(e=>e.categorySchema):(0,d.G4)(e)?Promise.reject((0,d.NK)()):Promise.resolve([])}async fetchClassificationSchema(e){return this.hasClassificationSchema?this.request(this.restUrl+"/portals/self/classification/classificationSchema",e).then(e=>e.classificationSchema):null}fetchFeaturedGroups(e){let t=this.featuredGroups,r=new C.A({num:100,sortField:"title"});if(t?.length){let s=[];for(let e of t)s.push(`(title:"${e.title}" AND owner:${e.owner})`);return r.query=s.join(" OR "),this.queryGroups(r,e).then(e=>e.results)}return(0,d.G4)(e)?Promise.reject((0,d.NK)()):Promise.resolve([])}fetchRegions(e){let t=this.user?.culture||this.culture||(0,m.JK)();return this.request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){let t=this.user?.culture||this.culture||(0,m.JK)();return this.request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return(!g||g.destroyed)&&(g=new Z),g}queryGroups(e,t){return this.queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this.queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||="username",this.queryPortal("/community/users",e,"PortalUser",t)}fetchSelf(e=this.authMode,t=!1,r){let s=this.restUrl+"/portals/self",o={authMode:e,query:{culture:(0,m.JK)().toLowerCase()},withCredentials:!0,...r};return"auto"===o.authMode&&(o.authMode="no-prompt"),t&&(o.query.default=!0),this.request(s,o)}queryPortal(e,t,r,s){let o=(0,y.dp)(C.A,t),i=t=>this.request(this.restUrl+e,{...o.toRequestOptions(this),...s}).then(e=>{let r=o.clone();return r.start=e.nextStart,new M({nextQueryParams:r,queryParams:o,total:e.total,results:Z._resultsToTypedArray(t,{portal:this},e,s)})}).then(e=>Promise.all(e.results.map(t=>"function"==typeof t.when?t.when():e)).then(()=>e,t=>((0,d.QP)(t),e)));return r&&O[r]?O[r]().then(({default:e})=>((0,d.Te)(s),i(e))):i()}signIn(){if(this.hasAPIKey)return this.load().then(()=>{if(!this.user)throw new a.A("portal:not-authenticated","Unable to authenticate user. Portal.user is missing")});if(this.authMode===Z.AUTH_MODE_ANONYMOUS||this.authMode===Z.AUTH_MODE_NO_PROMPT&&!i.id)return Promise.reject(new a.A("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if("failed"===this.loadStatus)return Promise.reject(this.loadError);let e=e=>Promise.resolve().then(()=>"not-loaded"===this.loadStatus?(e||(this.authMode="immediate"),this.load().then(()=>null)):"loading"===this.loadStatus?this.load().then(()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate"))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate"))).then(e=>{e&&(this.sourceJSON=e,this.read(e))});return i.id?i.id.getCredential(this.restUrl,{prompt:this.authMode!==Z.AUTH_MODE_NO_PROMPT}).then(t=>e(t)):e(this.credential)}normalizeUrl(e){let t=this.credential?.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}requestToTypedArray(e,t,r){return this.request(e,t).then(e=>{let t=Z._resultsToTypedArray(r,{portal:this},e);return Promise.all(t.map(t=>"function"==typeof t.when?t.when():e)).then(()=>t,()=>t)})}request(e,t={}){let r={f:"json",...t.query},{authMode:s=(this.authMode===Z.AUTH_MODE_ANONYMOUS||this.authMode===Z.AUTH_MODE_NO_PROMPT?this.authMode:"auto"),body:o=null,cacheBust:i=!1,method:a="auto",responseType:n="json",signal:u}=t,p={authMode:s,body:o,cacheBust:i,method:a,query:r,responseType:n,timeout:0,signal:u};return t.withCredentials&&(p.withCredentials=!0),(0,l.A)(this._normalizeSSL(e),p).then(e=>e.data)}toJSON(){throw new a.A("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw Error("JSON object is already hydrated");return new Z({sourceJSON:e})}_getHelperService(e){let t=this.helperServices?.[e];if(!t)throw new a.A("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}async _fetchBasemaps(e,t){let r=new C.A;r.query=e||((0,P.Dd)()?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),r.disableExtraQuery=!0;let s=await this.queryGroups(r,t);if(!s.total)return[];let o=s.results[0];r.num=100,r.query='type:"Web Map" -type:"Web Application"',r.sortField=o.sortField||"name",r.sortOrder=o.sortOrder||"desc";let i=await o.queryItems(r,t);return i.total?i.results.filter(e=>"Web Map"===e.type).map(e=>new _({portalItem:e})):[]}async _fetchBasemaps3D(e,t){let r=e||this.basemapGalleryGroupQuery3D;if(!r||(0,P.Dd)())return[];let s=new C.A({query:r,disableExtraQuery:!0}),o=await this.queryGroups(s,t);if(!o.total)return[];let i=o.results[0];s.num=100,s.query='type:"Web Scene"',s.sortField=i.sortField||"name",s.sortOrder=i.sortOrder||"desc";let l=await i.queryItems(s,t);return l.total?l.results.filter(e=>"Web Scene"===e.type).map(e=>new _({portalItem:e})):[]}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(e){if(e){let t=_.fromJSON(e);return t.portalItem={portal:this},t}return null}static _resultsToTypedArray(e,t,r,s){let o;if(r){let i=null==s?null:s.signal;o=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(e||t)&&(o=o.map(r=>{let s=Object.assign(e?e.fromJSON(r):r,t);return"function"==typeof s.load&&s.load(i),s}))}else o=[];return o}};(0,s.Cg)([(0,h.MZ)()],A.prototype,"access",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"allSSL",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"authMode",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"authorizedCrossOriginDomains",void 0),(0,s.Cg)([(0,w.w)("authorizedCrossOriginDomains")],A.prototype,"readAuthorizedCrossOriginDomains",null),(0,s.Cg)([(0,h.MZ)()],A.prototype,"basemapGalleryGroupQuery",void 0),(0,s.Cg)([(0,h.MZ)({json:{name:"3DBasemapGalleryGroupQuery"}})],A.prototype,"basemapGalleryGroupQuery3D",void 0),(0,s.Cg)([(0,h.MZ)({json:{name:"g3DTilesGalleryGroupQuery"}})],A.prototype,"g3DTilesGalleryGroupQuery",void 0),(0,s.Cg)([(0,h.MZ)({json:{name:"g3dTilesEnabled"}})],A.prototype,"g3dTilesEnabled",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"bingKey",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"canListApps",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"canListData",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"canListPreProvisionedItems",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"canProvisionDirectPurchase",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"canSearchPublic",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"canShareBingPublic",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"canSharePublic",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"canSignInArcGIS",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"canSignInIDP",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"colorSetsGroupQuery",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"commentsEnabled",void 0),(0,s.Cg)([(0,h.MZ)({type:Date})],A.prototype,"created",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"credential",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"culture",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"currentVersion",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"customBaseUrl",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"default3DBasemapQuery",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"defaultBasemap",void 0),(0,s.Cg)([(0,w.w)("defaultBasemap")],A.prototype,"readDefaultBasemap",null),(0,s.Cg)([(0,h.MZ)()],A.prototype,"defaultDevBasemap",void 0),(0,s.Cg)([(0,w.w)("defaultDevBasemap")],A.prototype,"readDefaultDevBasemap",null),(0,s.Cg)([(0,h.MZ)({type:c.A})],A.prototype,"defaultExtent",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"defaultVectorBasemap",void 0),(0,s.Cg)([(0,w.w)("defaultVectorBasemap")],A.prototype,"readDefaultVectorBasemap",null),(0,s.Cg)([(0,h.MZ)()],A.prototype,"description",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"devBasemapGalleryGroupQuery",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"eueiEnabled",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],A.prototype,"extraQuery",null),(0,s.Cg)([(0,h.MZ)()],A.prototype,"featuredGroups",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"featuredItemsGroupQuery",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"galleryTemplatesGroupQuery",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"layoutGroupQuery",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"livingAtlasGroupQuery",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],A.prototype,"hasAPIKey",null),(0,s.Cg)([(0,h.MZ)()],A.prototype,"hasCategorySchema",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"hasClassificationSchema",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"helpBase",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"helperServices",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"helpMap",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"homePageFeaturedContent",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"homePageFeaturedContentCount",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"httpPort",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"httpsPort",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"id",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"ipCntryCode",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],A.prototype,"isOrganization",null),(0,s.Cg)([(0,h.MZ)()],A.prototype,"isPortal",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"isReadOnly",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],A.prototype,"itemPageUrl",null),(0,s.Cg)([(0,h.MZ)()],A.prototype,"layerTemplatesGroupQuery",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"maxTokenExpirationMinutes",void 0),(0,s.Cg)([(0,h.MZ)({type:Date})],A.prototype,"modified",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"name",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"portalHostname",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"portalMode",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"portalProperties",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"region",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"recycleBinEnabled",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],A.prototype,"restUrl",null),(0,s.Cg)([(0,h.MZ)()],A.prototype,"rotatorPanels",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"showHomePageDescription",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"staticImagesUrl",void 0),(0,s.Cg)([(0,h.MZ)({json:{name:"2DStylesGroupQuery"}})],A.prototype,"stylesGroupQuery2d",void 0),(0,s.Cg)([(0,h.MZ)({json:{name:"stylesGroupQuery"}})],A.prototype,"stylesGroupQuery3d",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"supportsHostedServices",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"symbolSetsGroupQuery",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"templatesGroupQuery",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"thumbnail",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],A.prototype,"thumbnailUrl",null),(0,s.Cg)([(0,h.MZ)()],A.prototype,"units",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"url",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"urlKey",void 0),(0,s.Cg)([(0,w.w)("urlKey")],A.prototype,"readUrlKey",null),(0,s.Cg)([(0,h.MZ)()],A.prototype,"user",void 0),(0,s.Cg)([(0,w.w)("user")],A.prototype,"readUser",null),(0,s.Cg)([(0,h.MZ)()],A.prototype,"use3dBasemaps",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"useDefault3dBasemap",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"useStandardizedQuery",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"useVectorBasemaps",void 0),(0,s.Cg)([(0,h.MZ)()],A.prototype,"vectorBasemapGalleryGroupQuery",void 0),A=Z=(0,s.Cg)([(0,h.$K)("esri.portal.Portal")],A);const b=new FinalizationRegistry(e=>{e.remove()})},96360(e,t,r){r.d(t,{A:()=>p});var s,o=r(32198),i=r(49186),l=r(25482),a=r(91429),n=r(78888),u=r(16405);let p=s=class extends l.o{constructor(e){super(e),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.sourceJSON=null,this.tags=null,this.title=null}get thumbnailUrl(){let e=this.url,t=this.thumbnail;return e&&t&&this.portal?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`):null}get url(){let e=this.portal?.restUrl;return e?e+"/community/groups/"+this.id:null}fetchCategorySchema(e){return this.portal.request(this.url+"/categorySchema",e).then(t=>{let r=t.categorySchema||[];return r.some(e=>"contentCategorySetsGroupQuery.LivingAtlas"===e.source)?this._fetchCategorySchemaSet("LivingAtlas",e):r})}fetchMembers(e){return this.portal.request(this.url+"/users",e)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}toJSON(){throw new i.A("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw Error("JSON object is already hydrated");let t=new s({sourceJSON:e});return t.read(e),t}queryItems(e,t){let r=(0,n.dp)(u.A,e),s=this.portal;return parseFloat(s.currentVersion)>5?(r||=new u.A,s.queryPortal(`/content/groups/${this.id}/search`,r,"PortalItem",t)):(r=r?r.clone():new u.A,r.query="group:"+this.id+(r.query?" "+r.query:""),s.queryItems(r,t))}_fetchCategorySchemaSet(e,t){let r=this.portal;return r.fetchSelf(r.authMode,!0,t).then(e=>{let s=e.contentCategorySetsGroupQuery;if(s){let e=new u.A({disableExtraQuery:!0,num:1,query:s});return r.queryGroups(e,t)}throw new i.A("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(r=>{if(r.total){let s=r.results[0],o=new u.A({num:1,query:`typekeywords:"${e}"`});return s.queryItems(o,t)}throw new i.A("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(e=>e.total?e.results[0].fetchData("json",t).then(e=>{let t=e?.categorySchema;return t?.length?t:[]}):[])}};(0,o.Cg)([(0,a.MZ)()],p.prototype,"access",void 0),(0,o.Cg)([(0,a.MZ)({type:Date})],p.prototype,"created",void 0),(0,o.Cg)([(0,a.MZ)()],p.prototype,"description",void 0),(0,o.Cg)([(0,a.MZ)()],p.prototype,"id",void 0),(0,o.Cg)([(0,a.MZ)()],p.prototype,"isInvitationOnly",void 0),(0,o.Cg)([(0,a.MZ)({type:Date})],p.prototype,"modified",void 0),(0,o.Cg)([(0,a.MZ)()],p.prototype,"owner",void 0),(0,o.Cg)([(0,a.MZ)()],p.prototype,"portal",void 0),(0,o.Cg)([(0,a.MZ)()],p.prototype,"snippet",void 0),(0,o.Cg)([(0,a.MZ)()],p.prototype,"sortField",void 0),(0,o.Cg)([(0,a.MZ)()],p.prototype,"sortOrder",void 0),(0,o.Cg)([(0,a.MZ)()],p.prototype,"sourceJSON",void 0),(0,o.Cg)([(0,a.MZ)()],p.prototype,"tags",void 0),(0,o.Cg)([(0,a.MZ)()],p.prototype,"thumbnail",void 0),(0,o.Cg)([(0,a.MZ)({readOnly:!0})],p.prototype,"thumbnailUrl",null),(0,o.Cg)([(0,a.MZ)()],p.prototype,"title",void 0),(0,o.Cg)([(0,a.MZ)({readOnly:!0})],p.prototype,"url",null),p=s=(0,o.Cg)([(0,a.$K)("esri.portal.PortalGroup")],p)},16405(e,t,r){r.d(t,{A:()=>y});var s,o=r(32198),i=r(69622),l=r(66552),a=r(4718),n=r(91429),u=r(5443),p=r(16930),d=r(28735);const h=new l.J({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let y=s=class extends i.A{constructor(e){super(e),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(e){("asc"===e||"desc"===e)&&this._set("sortOrder",e)}clone(){return new s({categories:this.categories?(0,a.o8)(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(e,t){let r=[];this.categories&&(r=this.categories.map(e=>Array.isArray(e)?JSON.stringify(e):e));let s="";if(this.extent){let e=(0,d.Cv)(this.extent,p.A.WGS84);null!=e&&(s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`)}let o=this.query,i=e.extraQuery;!this.disableExtraQuery&&i&&(o=o?"("+o+") AND "+i:i);let l={categories:r,bbox:s,q:o,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(l.sortField=this.sortField.split(",").map(e=>h.toJSON(e.trim())).join(","),l.sortOrder=this.sortOrder),{query:{...t,...l}}}};(0,o.Cg)([(0,n.MZ)()],y.prototype,"categories",void 0),(0,o.Cg)([(0,n.MZ)()],y.prototype,"disableExtraQuery",void 0),(0,o.Cg)([(0,n.MZ)({type:u.A})],y.prototype,"extent",void 0),(0,o.Cg)([(0,n.MZ)()],y.prototype,"filter",void 0),(0,o.Cg)([(0,n.MZ)()],y.prototype,"num",void 0),(0,o.Cg)([(0,n.MZ)()],y.prototype,"query",void 0),(0,o.Cg)([(0,n.MZ)()],y.prototype,"sortField",void 0),(0,o.Cg)([(0,n.MZ)()],y.prototype,"sortOrder",null),(0,o.Cg)([(0,n.MZ)()],y.prototype,"start",void 0),y=s=(0,o.Cg)([(0,n.$K)("esri.portal.PortalQueryParams")],y)},41318(e,t,r){r.d(t,{A:()=>p});var s=r(32198),o=r(49186),i=r(25482),l=r(91429);let a=class extends i.o{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){let e=this.portal?.restUrl;return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new o.A("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};(0,s.Cg)([(0,l.MZ)({type:Date})],a.prototype,"created",void 0),(0,s.Cg)([(0,l.MZ)()],a.prototype,"id",void 0),(0,s.Cg)([(0,l.MZ)()],a.prototype,"portal",void 0),(0,s.Cg)([(0,l.MZ)()],a.prototype,"title",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],a.prototype,"url",null),(0,s.Cg)([(0,l.MZ)()],a.prototype,"username",void 0),a=(0,s.Cg)([(0,l.$K)("esri.portal.PortalFolder")],a);var n,u=r(96360);let p=n=class extends i.o{constructor(e){super(e),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.id=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userLicenseTypeId=null,this.userType=null}get thumbnailUrl(){let e=this.url,t=this.thumbnail;return e&&t?this.portal.normalizeUrl(`${e}/info/${t}?f=json`):null}get userContentUrl(){let e=this.portal?.restUrl;return e?`${e}/content/users/${this.id}`:null}get url(){let e=this.portal?.restUrl;return e?`${e}/community/users/${this.id}`:null}addItem(e){let t=e&&e.item,r=e?.data,s=e?.folder,o={method:"post"};t&&(o.query=t.createPostQuery(),null!=r&&("string"==typeof r?o.query.text=r:"object"==typeof r&&(o.query.text=JSON.stringify(r))));let i=this.userContentUrl;return s&&(i+="/"+("string"==typeof s?s:s.id)),this.portal.request(i+"/addItem",o).then(e=>(t.id=e.id,t.portal=this.portal,t.loaded?t.reload():t.load()))}async deleteItem(e,t=!1){let r=this.userContentUrl;e.ownerFolder&&(r+="/"+e.ownerFolder);let s=t?{permanentDelete:!0}:{};await this.portal.request(r+`/items/${e.id}/delete`,{method:"post",query:s}),e.id=null,e.portal=null}async deleteItems(e,t=!1){e=e.slice();let r=this.userContentUrl+"/deleteItems",s=[],i=e.map(e=>e.id);if(i.length){let l={method:"post",query:{items:i.join(","),permanentDelete:t}},a=await this.portal.request(r,l);for(let t of a.results){let r=e.find(e=>t.itemId===e.id),i=t.success,l=null;i?(r.id=null,r.portal=null):t.error&&(l=new o.A("portal:delete-item-failed",t.error.message,t.error)),s.push({item:r,success:i,error:l})}}return s}fetchFolders(){return this.portal.request(this.userContentUrl??"",{query:{num:1}}).then(e=>{let t;return t=e&&e.folders?e.folders.map(e=>{let t=a.fromJSON(e);return t.portal=this.portal,t}):[],t})}fetchGroups(){return this.portal.request(this.url??"").then(e=>{let t;return t=e&&e.groups?e.groups.map(e=>{let t=u.A.fromJSON(e);return t.portal=this.portal,t}):[],t})}async fetchItems(e){e??={};let t=this.userContentUrl??"";e.folder&&(t+="/"+e.folder.id);let s,{default:o}=await r.e(812).then(()=>r(80812)),i={folders:!1,inRecycleBin:!!e.inRecycleBin||null,foldersContent:!(e.folder||!e.includeSubfolderItems)||null,num:e.num||10,start:e.start||1,sortField:e.sortField||"created",sortOrder:e.sortOrder||"asc"},l=await this.portal.request(t,{query:i});return l?.items?(s=l.items.map(e=>{let t=o.fromJSON(e);return t.portal=this.portal,t}),await Promise.all(s.map(e=>e.load())),{items:s,nextStart:l.nextStart,total:l.total}):{items:[],nextStart:-1,total:0}}fetchTags(){return this.portal.request(this.url+"/tags").then(e=>e.tags)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}queryFavorites(e){return this.favGroupId?(this._favGroup||=new u.A({id:this.favGroupId,portal:this.portal}),this._favGroup.queryItems(e)):Promise.reject(new o.A("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}async restoreItem(e,t){let r=this.userContentUrl,s=t?{folderID:"string"==typeof t?t:t.id}:null;await this.portal.request(r+`/items/${e.id}/restore`,{method:"post",query:s})}toJSON(){throw new o.A("internal:not-yet-implemented","PortalUser.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw Error("JSON object is already hydrated");let t=new n({sourceJSON:e});return t.read(e),t}};(0,s.Cg)([(0,l.MZ)()],p.prototype,"access",void 0),(0,s.Cg)([(0,l.MZ)({type:Date})],p.prototype,"created",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"culture",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"description",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"email",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"favGroupId",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"fullName",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"id",void 0),(0,s.Cg)([(0,l.MZ)({type:Date})],p.prototype,"modified",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"orgId",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"portal",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"preferredView",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"privileges",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"region",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"role",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"roleId",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"thumbnail",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],p.prototype,"thumbnailUrl",null),(0,s.Cg)([(0,l.MZ)()],p.prototype,"units",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],p.prototype,"userContentUrl",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],p.prototype,"url",null),(0,s.Cg)([(0,l.MZ)()],p.prototype,"username",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"userLicenseTypeId",void 0),(0,s.Cg)([(0,l.MZ)()],p.prototype,"userType",void 0),p=n=(0,s.Cg)([(0,l.$K)("esri.portal.PortalUser")],p)},98205(e,t,r){r.d(t,{KZ:()=>a,eh:()=>l,gf:()=>i,of:()=>o});const s=Symbol("SizeVariableInstance");function o(e){return"object"==typeof e&&!!e&&s in e}function i(e){return null!=e&&!isNaN(e)&&isFinite(e)}function l(e){return e.valueExpression?"expression":e.field&&"string"==typeof e.field?"field":"unknown"}function a(e,t){let r=t||l(e),s=e.valueUnit||"unknown";return"unknown"===r?"constant":e.stops?"stops":null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?"clamped-linear":"unknown"===s?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?"proportional":"additive":"identity":"real-world-size"}r.d(t,["uY",0,s])},926(e,t,r){r.d(t,{Dd:()=>h,Jn:()=>y,Qc:()=>c,getApiKey:()=>p,getSessionToken:()=>d});var s=r(92602),o=r(56507),i=r(84952);const l=/^https?:\/\/(i?basemaps|basemapstyles)-api\.arcgis\.com\//i,a=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]),n=new Map;let u=null;function p(e){if(!c(e))return null;let t=t=>t instanceof RegExp?t.test(e):"string"==typeof t&&e.startsWith(t),r=s.A.apiKeys;if(Array.isArray(r.scopes))for(let e of r.scopes)if(Array.isArray(e.urls)){if(e.urls.some(t))return e.token}else if(t(e.urls))return e.token;return r.basemapStyles&&l.test(e)?r.basemapStyles:s.A.apiKey&&/^https?:\/\/.+\.arcgis\.com(\/|$)/i.test(e)?s.A.apiKey:null}async function d(e){if(!s.A.sessions?.basemap?.enabled||!l.test(e))return null;let t=p(e);if(!t)return null;u&&await u;let r,{styleFamily:i="arcgis",autoRefresh:a,duration:d=43200}=s.A.sessions.basemap,h=`${t}:${i}`,y=n.get(h);if(y&&(!a||y.endTime>Date.now()))return y.sessionToken;u=(0,o.A)("https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/sessions/start",{cacheBust:!0,query:{durationSeconds:d,styleFamily:i,token:t}});try{r=(await u).data,r.endTime-=5e3,n.set(h,r)}finally{u=null}return r.sessionToken}function h(){return null!=s.A.apiKey||null!=s.A.apiKeys.basemapStyles}function y(e,t){return t?c(e):null!=p(e)}function c(e){let t=(0,i.$z)(e,!0);return!!t&&!a.has(t)&&!e.endsWith("/sharing/rest/generateToken")}},94128(e,t,r){r.d(t,{D:()=>o});const s=Symbol("GraphicInstance");function o(e){return"object"==typeof e&&!!e&&s in e}r.d(t,["Z",0,s])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4674,8768],{18768(e,t,r){var s=r(32198),i=r(53966),o=r(91429),a=r(60694);r.d(t,["b",0,e=>{let t=e,r=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){let e=(0,a.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,a.Jf)(e,i.A.getLogger(this)))}};return(0,s.Cg)([(0,o.MZ)()],r.prototype,"title",null),(0,s.Cg)([(0,o.MZ)({type:String})],r.prototype,"url",null),r=(0,s.Cg)([(0,o.$K)("esri.layers.mixins.ArcGISService")],r),r}])},69208(e,t,r){var s=r(32198),i=r(91429);r.d(t,["d",0,e=>{let t=e,r=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,s.Cg)([(0,i.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],r.prototype,"customParameters",void 0),r=(0,s.Cg)([(0,i.$K)("esri.layers.mixins.CustomParametersMixin")],r),r}])},8303(e,t,r){var s=r(32198),i=r(92602),o=r(70333),a=r(56507),u=r(60999),p=r(49186),n=r(36563),l=r(53966),d=r(97768),c=r(17676),y=r(84952),m=r(91429),f=r(77548),g=r(20655),h=r(80812),v=r(41318),C=r(10407),w=r(26121),A=r(36005),I=r(43937);const F={credential:null,user:null};r.d(t,["A",0,e=>{let t=e,P=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){super.destroy(),this.portalItem=(0,d.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new h.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{let{load:s}=await r.e(1204).then(()=>r(41204));return(0,c.Te)(t),await s({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,c.zf)(e)||l.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async reloadFromPortal(e,t){if(!this.loaded||!this.portalItem?.id)return!1;let s=t?.signal?null:new AbortController;try{let{reload:i}=await r.e(1204).then(()=>r(41204));return s&&this.addHandles((0,n.rE)(s),"reloadFromPortal"),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t?.signal?t:{signal:s.signal})}catch(e){throw(0,c.zf)(e)||l.A.getLogger(this).warn(`Failed to reload layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}finally{s&&this.removeHandles("reloadFromPortal")}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,c.QP)(e),!0)))}async setUserPrivileges(e,t){if(!i.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{let{features:{edit:r,fullEdit:s},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,c.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);let s,i,a=!o.id?.findCredential(this.url),u=e===r.id;if(u&&r.portal.user)return this._getUserPrivileges(r,a);if(u)s=r.portal.url;else try{s=await(0,f.wI)(this.url,t)}catch(e){(0,c.QP)(e)}if(!s||!(0,y.b8)(s,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{let e=null==t?null:t.signal;i=await(o.id?.getCredential(`${s}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.QP)(e)}if(!i)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(u?await r.reload():(r=new h.default({id:e,portal:{url:s}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,a)}catch(e){(0,c.QP)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}_getUserPrivileges(e,t){let r=(0,C.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){let t=this.url?o.id?.findCredential(this.url):null;if(!t)return!0;let r=F.credential===t?F.user:await this._fetchEditingUser(e);return F.credential=t,F.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){let t=this.portalItem?.portal?.user;if(t)return t;let r=o.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;let s=`${r.owningSystemUrl}/sharing/rest`,i=g.A.getDefault();if(i&&i.loaded&&(0,y.S8)(i.restUrl)===(0,y.S8)(s))return i.user;let p=`${s}/community/self`,n=null==e?null:e.signal,l=await(0,u.Ke)((0,a.A)(p,{authMode:"no-prompt",query:{f:"json"},signal:n}));return l.ok?v.A.fromJSON(l.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){return(0,w.wN)(this.portalItem,t)?(t?.messages?.push(new p.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s.Cg)([(0,m.MZ)({type:h.default})],P.prototype,"portalItem",null),(0,s.Cg)([(0,A.w)("web-document","portalItem",["itemId"])],P.prototype,"readPortalItem",null),(0,s.Cg)([(0,I.K)("web-document","portalItem",{itemId:{type:String}})],P.prototype,"writePortalItem",null),(0,s.Cg)([(0,m.MZ)({clonable:!1})],P.prototype,"resourceReferences",void 0),(0,s.Cg)([(0,m.MZ)({type:Boolean,readOnly:!0})],P.prototype,"userHasEditingPrivileges",void 0),(0,s.Cg)([(0,m.MZ)({type:Boolean,readOnly:!0})],P.prototype,"userHasFullEditingPrivileges",void 0),(0,s.Cg)([(0,m.MZ)({type:Boolean,readOnly:!0})],P.prototype,"userHasUpdateItemPrivileges",void 0),P=(0,s.Cg)([(0,m.$K)("esri.layers.mixins.PortalLayer")],P),P}])},20557(e,t,r){r.d(t,{Fm:()=>p,Hz:()=>g,JQ:()=>f,JZ:()=>S,ND:()=>v,R_:()=>a,U9:()=>m,_h:()=>w,be:()=>d,fE:()=>y,fu:()=>i,nr:()=>h,oF:()=>o,qv:()=>P,rP:()=>c,rq:()=>n,z$:()=>l});const s=[["binary","application/octet-stream","bin",""]];function i(e,t){return null!=A(t.name,e?.supportedFormats??[])}function o(e,t){if(!e)return!1;let r=n(t,e.supportedFormats??[]);return null!=r&&e.editFormats.includes(r)}function a(e,t){return I(function(e,t){let r=e.toLowerCase();return C(t).find(e=>F(e)===r)}(e,t))}function u(e,t){return I(A(e,t))}function p(e,t){return F(w(e,t))}function n(e,t){return u(e.name,t)??a(e.type,t)}function l(e,t,r){return a(e,r)??u(t,r)}function d(e,t){if(!e||!w(e,t))return;let r=/^3d_(.+)$/iu.exec(e)?.[1]?.toLowerCase();return r||void 0}function c(e,t){return(e??[]).map(e=>d(e,t)).filter(e=>!!e)}function y(e,t){return I(t.find(r=>d(I(r),t)===e))}function m({supportedFormats:e}){return l("model/gltf-binary","glb",e)}function f(e){let t=m(e);return null!=t&&e.editFormats.includes(t)}function g(e){if(!e)return null;let t=m(e),r=function({supportedFormats:e}){return l("model/gltf+json","gltf",e)}(e),s=null;for(let i of e.queryFormats){if(i===t)return i;i===r&&(s=i)}return s}function h({supportedFormats:e}){return l("application/esri3do-SR_world","wld",e)}function v({supportedFormats:e}){return l("application/esri3do-SR_prj","prj",e)}function C(e){return[...s,...e]}function w(e,t){return C(t).find(t=>I(t)===e)}function A(e,t){let r=e.toLowerCase();return C(t).find(e=>P(e).some(e=>r.endsWith(e)))}function I(e){return e?.[0]}function F(e){return e?.[1].toLowerCase()}function P(e){return e?.[2].split(",").map(e=>e.toLowerCase())??[]}function S(e){return e.tables?.find(e=>"assetMaps"===e.role)}},6666(e,t,r){r.d(t,{S$:()=>h,dw:()=>R});var s=r(4576),i=r(44208),o=r(50498),a=r(60694),u=r(20557);function p(e,t,r){return!!l(e,t,r)}function n(e,t,r){return l(e,t,r)}function l(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}r(39516),r(30524),new WeakMap;const d={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},c=["cubic-bezier","circular-arc","elliptic-arc"];function y(e){let t=e?.supportedSpatialAggregationStatistics?.map(e=>e.toLowerCase());return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}function m(e,t){return!!(e?.supportedOperationsWithCacheHint?.map(e=>e.toLowerCase()))?.includes(t.toLowerCase())}function f(e){let t=e?.supportedStatisticTypes?.map(e=>e.toLowerCase());return{count:!!t?.includes("count"),sum:!!t?.includes("sum"),min:!!t?.includes("min"),max:!!t?.includes("max"),avg:!!t?.includes("avg"),var:!!t?.includes("var"),stddev:!!t?.includes("stddev"),percentileContinuous:!!t?.includes("percentile_cont"),percentileDiscrete:!!t?.includes("percentile_disc"),envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}function g(e){let t=e?.supportedNormalizationTypes?.map(e=>e.toLowerCase());return{field:!!t?.includes("field"),log:!!t?.includes("log"),naturalLog:!!t?.includes("naturallog"),percentOfTotal:!!t?.includes("percentoftotal"),squareRoot:!!t?.includes("squareroot")}}function h(e,t){return{analytics:v(e),attachment:C(e),data:w(e),metadata:A(e),operations:I(e.capabilities,e,t),query:F(e,t),queryAttributeBins:b(e),queryRelated:P(e),queryTopFeatures:S(e),editing:Q(e)}}function v(e){return{supportsCacheHint:m(e.advancedQueryCapabilities,"queryAnalytics")}}function C(e){let t=e.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:m(e.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:p(e.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:p(e,"supportsAttachmentsResizing",!1),supportsTypeWildcard:p(e.advancedQueryCapabilities,"supportsQueryAttachmentWithTypeWildcard",!1),supportsCountOnly:p(e.advancedQueryCapabilities,"supportsQueryAttachmentsCountOnly",!1)};return t&&Array.isArray(t)&&t.forEach(e=>{let t=d[e.name];t&&(r[t]=!!e.isEnabled)}),r}function w(e){let t=p(e.advancedQueryCapabilities,"supportsTrueCurve",!1),r=e.infoFor3D,s=r?.supportedFormats??[];return{isVersioned:p(e,"isDataVersioned",!1),isBranchVersioned:p(e,"isDataBranchVersioned",!1),queryFormats:r?(0,u.rP)(r.queryFormats,s):void 0,sourceFormats:r?(0,u.rP)(r.editFormats,s):void 0,supportsAttachment:p(e,"hasAttachments",!1),supportsM:p(e,"hasM",!1),supportsTrueCurve:t,supportedCurveTypes:T(e,t),supportsZ:p(e,"hasZ",!1)}}function A(e){return{supportsAdvancedFieldProperties:p(e,"supportsFieldDescriptionProperty",!1)}}function I(e,t,r){let s=(0,a.Wo)(r),i=e?.toLowerCase().split(",").map(e=>e.trim())??[],o=r?(0,a.qg)(r):null,u=i.includes("MapServer"===o?.serverType?"data":"query"),n=i.includes("editing")&&!t.datesInUnknownTimezone&&(null==r||!0!==t.uniqueIdInfo?.OIDFieldContainsHashValue),l=n&&i.includes("create"),d=n&&i.includes("delete"),c=n&&i.includes("update"),y=i.includes("changetracking"),m=t.advancedQueryCapabilities,f=p(t,"supportsExceedsLimitStatistics",!1);return s||p(m,"supportsUseEstimateForExceedsLimit",!1)||(f=!1),n&&!(l||d||c)&&(l=d=c=!0),{supportsCalculate:p(t,"supportsCalculate",!1),supportsTruncate:p(t,"supportsTruncate",!1),supportsValidateSql:p(t,"supportsValidateSql",!1),supportsAdd:l,supportsDelete:d,supportsEditing:n,supportsChangeTracking:y,supportsQuery:u,supportsQueryAnalytics:p(m,"supportsQueryAnalytic",!1),supportsQueryAttachments:p(m,"supportsQueryAttachments",!1),supportsQueryBins:p(m,"supportsQueryBins",!1)||!!t.queryBinsCapabilities,supportsQueryPivot:p(m,"supportsQueryPivot",!1),supportsQueryTopFeatures:p(m,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:p(t,"supportsAttachmentsResizing",!1),supportsSync:i.includes("sync"),supportsUpdate:c,supportsExceedsLimitStatistics:f,supportsAsyncConvert3D:p(t,"supportsAsyncConvert3D",!1)}}function F(e,t){let r=e.advancedQueryCapabilities,s=e.ownershipBasedAccessControlForFeatures,o=e.archivingInfo,l=e.currentVersion,d=function(e,t){if(!e||!(0,i.A)("featurelayer-relative-time-queries-enabled"))return 0;let r=(0,a.uV)(e);return(0,a.Wo)(e)||r?(t??0)>0||r?(0,i.A)("featurelayer-relative-time-queries-bin-window-public")??1:(0,i.A)("featurelayer-relative-time-queries-bin-window-private")??60:0}(t,e.cacheMaxAge),c=!t?.includes("MapServer")||l>=(0,i.A)("mapserver-pbf-version-support"),f=(0,a.Wo)(t),g=new Set((e.supportedQueryFormats??"").split(",").map(e=>e.toLowerCase().trim())),h=c&&function(e){return!!(0,i.A)("featurelayer-pbf-true-curves")&&(e.supportedTrueCurvePbfFeatureEncodings??[]).includes("esriDefault")}(e);return{maxRecordCount:n(e,"maxRecordCount",void 0),maxRecordCountFactor:n(e,"maxRecordCountFactor",void 0),maxUniqueIDCount:n(e,"maxUniqueIDCount",void 0),relativeTimeBinWindow:d,standardMaxRecordCount:n(e,"standardMaxRecordCount",void 0),standardMaxRecordCountNoGeometry:n(e,"standardMaxRecordCountNoGeometry",void 0),supportedSpatialAggregationStatistics:y(r),supportsStatisticsAggregatedIds:p(e,"supportsAggIds",!1),supportsCacheHint:p(r,"supportsQueryWithCacheHint",!1)||m(r,"query"),supportsCentroid:p(r,"supportsReturningGeometryCentroid",!1),supportsCentroidOnDegeneratedQuantizedGeometry:f||null==t,supportsCompactGeometry:f,supportsCurrentUser:p(r,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:p(r,"supportsDefaultSR",!1),supportsDegeneratedQuantizedGeometry:p(r,"supportsDegeneratedQuantizedGeometry",!1),supportsDisjointSpatialRelationship:p(r,"supportsDisjointSpatialRel",!1),supportsDistance:p(r,"supportsQueryWithDistance",!1),supportsOutDistance:p(r,"supportsOutDistance",!1),supportsDistinct:p(r,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:p(r,"supportsReturningQueryExtent",!1),supportsFormatPBF:c&&g.has("pbf"),supportsFormatPBFWithCurves:h,supportsFullTextSearch:p(r,"supportsFullTextSearch",!1),supportsGeometryProperties:p(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:p(r,"supportsHavingClause",!1),supportsHistoricMoment:p(o,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:p(r,"supportsMaxRecordCountFactor",!1),supportsOrderBy:p(r,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:p(r,"supportsPagination",!1),supportsPaginationOnAggregatedQueries:p(r,"supportsPaginationOnAggregatedQueries",!1),supportsPercentileStatistics:p(r,"supportsPercentileStatistics",!1),supportsQuantization:p(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:p(e,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:p(s,"allowAnonymousToQuery",!0),supportsQueryByOthers:p(s,"allowOthersToQuery",!0),supportsQueryGeometry:p(e,"supportsReturningQueryGeometry",!1),supportsResultType:p(r,"supportsQueryWithResultType",!1),supportsReturnMesh:!!(0,u.Hz)(e.infoFor3D),supportsReturnExceededLimitGeometries:p(e,"supportsReturnExceededLimitGeometries",!1),supportsSpatialAggregationStatistics:p(r,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:p(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:p(e,"useStandardizedQueries",!1),supportsStatistics:p(r,"supportsStatistics",e.supportsStatistics),supportsTopFeaturesQuery:p(r,"supportsTopFeaturesQuery",!1),supportsTrueCurve:p(r,"supportsTrueCurve",!1),tileMaxRecordCount:n(e,"tileMaxRecordCount",void 0)}}function P(e){let t=e.advancedQueryCapabilities,r=p(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:p(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:m(t,"queryRelated")}}function S(e){return{supportsCacheHint:m(e.advancedQueryCapabilities,"queryTopFilter")}}function b(e){let t=e?e.queryBinsCapabilities:void 0;return{supportsDate:p(t,"supportsDateBin",!1),supportsFixedInterval:p(t,"supportsFixedIntervalBin",!1),supportsAutoInterval:p(t,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:p(t,"supportsFixedBoundariesBin",!1),supportsStackBy:p(t,"supportsStackBy",!1),supportsSplitBy:p(t,"supportsSplitBy",!1),supportsSnapToData:p(t,"supportsSnapToData",!1),supportsReturnFullIntervalBin:p(t,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:p(t,"supportsFirstDayOfWeek",!1),supportsNormalization:p(t,"supportsNormalization",!1),supportedStatistics:f(t),supportedNormalizationTypes:g(t)}}function Q(e){let t=e.ownershipBasedAccessControlForFeatures,r=e?e.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:p(e,"allowGeometryUpdates",!0),supportsGlobalId:p(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:p(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:p(e,"supportsRollbackOnFailureParameter",!1),supportsTrueCurveUpdate:p(e,"allowTrueCurvesUpdates",!0),supportsTrueCurveUpdateByTrueCurveClientsOnly:p(e,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0),supportsUpdateWithoutM:p(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:p(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:p(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:p(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:p(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:p(t,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:p(r,"supportsAsyncApplyEdits",!1),zDefault:n(e,"zDefault",void 0)}}function T(e,t){let r=e.supportedCurveTypes??e.advancedQueryCapabilities?.supportedCurveTypes;return Array.isArray(r)?r.map(e=>o.iI.fromJSON(e)).filter(s.Ru):t?c:[]}function R(e){return{operations:{supportsAppend:p(e,"supportsAppend",!1),supportsCoverageQuery:e?.playbackInfo?.klv["0601"]??!1,supportsExportClip:p(e,"supportsExportClip",!1),supportsExportFrameset:p(e,"supportsExportFrameset",!1),supportsMensuration:p(e,"supportsMensuration",!1),supportsPreviews:p(e,"supportsPreviews",!1),supportsUpdate:p(e,"supportsUpdate",!1)}}}},26121(e,t,r){r.d(t,{I6:()=>l,ci:()=>n,dL:()=>p,wN:()=>d});var s=r(49186),i=r(84952),o=r(77548),a=r(20655),u=r(59923);async function p(e){let t=[];for(let r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){let e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}function n(e,t,r){let i=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new s.A(e,t,r));if(e.blockedRelativeUrls&&(i=i.concat(e.blockedRelativeUrls.map(e=>(0,u.GL)("url",`Relative url '${e}' is not supported`)))),r){let{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:s}=r;e&&(i=i.filter(({name:e})=>!(u.MG.has(e)||t.includes(e)))),s&&(i=i.filter(e=>"web-document-write:property-required"!==e.name))}if(i.length>0)throw new s.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:i})}function l(e){return(0,o.qd)(e).some(e=>!!e.charts?.length)}function d(e,t){let r=t?.portal,s=e?.id&&(e.portal||a.A.getDefault());return!!r&&!!s&&!(0,i.ut)(s.restUrl,r.restUrl)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8768,9177],{60999(e,t,r){r.d(t,{DZ:()=>f,Ke:()=>p,QA:()=>g,Tj:()=>h,UT:()=>m,aD:()=>v,jJ:()=>u});var i=r(32198),n=r(69622),a=r(97768),s=r(17676),l=r(10107),o=r(64108);function u(e,t,r){return(0,s.Lx)(e.map((e,i)=>t.apply(r,[e,i])))}async function h(e,t,r){return(await(0,s.Lx)(e.map((e,i)=>t.apply(r,[e,i])))).map(e=>e.value)}function c(e){return{ok:!0,value:e}}function d(e){return{ok:!1,error:e}}async function p(e){if(null==e)return{ok:!1,error:Error("no promise provided")};try{return c(await e)}catch(e){return d(e)}}async function f(e){try{return c(await e)}catch(e){return(0,s.QP)(e),d(e)}}function g(e){if(!0===e.ok)return e.value;throw e.error}function m(e,t){return new y(e,t)}let y=class extends n.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,a.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;let{signal:r}=this._abortController;this.promise=e(r),this.promise.then(e=>{this._result=c(e),this._cleanup()},e=>{this._result=d(e),this._cleanup()}),this._abortHandle=(0,s.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,a.xt)(this._abortHandle),this._abortController=null}};(0,i.Cg)([(0,l.MZ)()],y.prototype,"value",null),(0,i.Cg)([(0,l.MZ)()],y.prototype,"error",null),(0,i.Cg)([(0,l.MZ)()],y.prototype,"finished",null),(0,i.Cg)([(0,l.MZ)()],y.prototype,"promise",void 0),(0,i.Cg)([(0,l.MZ)()],y.prototype,"_result",void 0),y=(0,i.Cg)([(0,o.$)("esri.core.asyncUtils.ReactiveTask")],y);class v{constructor(){this._sequence=Promise.resolve()}async acquire(){let e;this._sequence=new Promise(t=>{e=this._sequence.then(()=>t,()=>t)});let t=await e;return{[Symbol.dispose]:t}}async run(e){let t={stack:[],error:void 0,hasError:!1};try{return(0,i.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,i.hk)(t)}}}},35522(e,t,r){r.d(t,{$A:()=>R,Bw:()=>a,C:()=>s,Cc:()=>C,DI:()=>S,Io:()=>v,Ln:()=>y,Om:()=>_,Qr:()=>c,Re:()=>u,S8:()=>A,T9:()=>g,WQ:()=>o,Z0:()=>I,_S:()=>p,aI:()=>T,ei:()=>E,fw:()=>P,gL:()=>x,hG:()=>M,hZ:()=>l,hs:()=>m,jk:()=>f,lw:()=>h,m3:()=>w,oW:()=>j,t2:()=>k,tn:()=>d,ze:()=>b});var i=r(51850),n=r(34304);function a(e){let t=e[0],r=e[1],i=e[2];return Math.sqrt(t*t+r*r+i*i)}function s(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function l(e,t,r,i){return e[0]=t,e[1]=r,e[2]=i,e}function o(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function u(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function h(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function c(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function d(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}function p(e,t){return e[0]=Math.sign(t[0]),e[1]=Math.sign(t[1]),e[2]=Math.sign(t[2]),e}function f(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function g(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function m(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function y(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e}function v(e,t){let r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+i*i+n*n)}function M(e,t){let r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return r*r+i*i+n*n}function w(e){let t=e[0],r=e[1],i=e[2];return t*t+r*r+i*i}function b(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function S(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function A(e,t=e){let r=t[0],i=t[1],n=t[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e}function _(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function R(e,t,r){let i=t[0],n=t[1],a=t[2],s=r[0],l=r[1],o=r[2];return e[0]=n*o-a*l,e[1]=a*s-i*o,e[2]=i*l-n*s,e}function C(e,t,r,i){let n=t[0],a=t[1],s=t[2];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=s+i*(r[2]-s),e}function I(e,t,r){let i=t[0],n=t[1],a=t[2];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12],e[1]=r[1]*i+r[5]*n+r[9]*a+r[13],e[2]=r[2]*i+r[6]*n+r[10]*a+r[14],e}function E(e,t,r){let i=t[0],n=t[1],a=t[2];return e[0]=i*r[0]+n*r[3]+a*r[6],e[1]=i*r[1]+n*r[4]+a*r[7],e[2]=i*r[2]+n*r[5]+a*r[8],e}function x(e,t,r){return P(e,t,r[0],r[1],r[2],r[3])}function P(e,t,r,i,n,a){let s=t[0],l=t[1],o=t[2],u=i*o-n*l,h=n*s-r*o,c=r*l-i*s,d=i*c-n*h,p=n*u-r*c,f=r*h-i*u,g=2*a;return e[0]=s+u*g+2*d,e[1]=l+h*g+2*p,e[2]=o+c*g+2*f,e}const U=(0,i.vt)(),L=(0,i.vt)();function k(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function T(e,t){if(e===t)return!0;let r=e[0],i=e[1],a=e[2],s=t[0],l=t[1],o=t[2],u=(0,n.FD)();return Math.abs(r-s)<=u*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=u*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-o)<=u*Math.max(1,Math.abs(a),Math.abs(o))}function j(e,t,r){let i=r[0]-t[0],n=r[1]-t[1],a=r[2]-t[2],s=i*i+n*n+a*a;return s>0?(s=1/Math.sqrt(s),e[0]=i*s,e[1]=n*s,e[2]=a*s,e):(e[0]=0,e[1]=0,e[2]=0,e)}const H=u,O=h,W=c,Z=v,G=M,q=a,D=w;Object.freeze(Object.defineProperty({__proto__:null,abs:d,add:o,angle:function(e,t){A(U,e),A(L,t);let r=_(U,L);return r>1?0:r<-1?Math.PI:Math.acos(r)},bezier:function(e,t,r,i,n,a){let s=1-a,l=s*s,o=a*a,u=l*s,h=3*a*l,c=3*o*s,d=o*a;return e[0]=t[0]*u+r[0]*h+i[0]*c+n[0]*d,e[1]=t[1]*u+r[1]*h+i[1]*c+n[1]*d,e[2]=t[2]*u+r[2]*h+i[2]*c+n[2]*d,e},ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},clamp:function(e,t=0,r=1){return e[0]=Math.min(Math.max(e[0],t),r),e[1]=Math.min(Math.max(e[1],t),r),e[2]=Math.min(Math.max(e[2],t),r),e},copy:s,cross:R,crossAndNormalize:function(e,t,r){let i=t[0],n=t[1],a=t[2],s=r[0],l=r[1],o=r[2],u=n*o-a*l,h=a*s-i*o,c=i*l-n*s,d=Math.sqrt(u*u+h*h+c*c);return e[0]=u/d,e[1]=h/d,e[2]=c/d,e},direction:j,dist:Z,distance:v,div:W,divide:c,dot:_,equals:T,exactEquals:k,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},hermite:function(e,t,r,i,n,a){let s=a*a,l=s*(2*a-3)+1,o=s*(a-2)+a,u=s*(a-1),h=s*(3-2*a);return e[0]=t[0]*l+r[0]*o+i[0]*u+n[0]*h,e[1]=t[1]*l+r[1]*o+i[1]*u+n[1]*h,e[2]=t[2]*l+r[2]*o+i[2]*u+n[2]*h,e},inverse:S,len:q,length:a,lerp:C,max:g,min:f,mul:O,multiply:h,negate:b,normalize:A,random:function(e,t=1){let r=n.Ov,i=2*r()*Math.PI,a=2*r()-1,s=Math.sqrt(1-a*a)*t;return e[0]=Math.cos(i)*s,e[1]=Math.sin(i)*s,e[2]=a*t,e},rotateX:function(e,t,r,i){let n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},rotateY:function(e,t,r,i){let n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},rotateZ:function(e,t,r,i){let n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},round:function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},scale:m,scaleAndAdd:y,scaleTo:function(e,t){return m(e,e,t/q(e))},set:l,sign:p,sqrDist:G,sqrLen:D,squaredDistance:M,squaredLength:w,str:function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},sub:H,subtract:u,transformMat3:E,transformMat4:I,transformMat4Z:function(e,t){return t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]},transformQuat:x,transformQuatValues:P},Symbol.toStringTag,{value:"Module"})),r.d(t,["Il",0,q,"jb",0,H,"lo",0,G,"uE",0,D])},54239(e,t,r){r.d(t,{A:()=>y});var i,n=r(32198),a=r(4576),s=r(66552),l=r(25482),o=r(86211),u=r(67076),h=r(91429),c=r(97348),d=r(43937),p=r(36005);const f=(0,s.O)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),g=f.jsonValues.slice();(0,a.Xy)(g,"orthometric");const m=(0,s.O)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let y=i=class extends l.o{constructor(e){super(e),this.origin=0,this.associatedSpatialReference=null,this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}read(e,t){super.read(e,t),("service"===t?.origin||"web-scene"===t?.origin)&&(this.origin="service"===t.origin?2:1,this.associatedSpatialReference=null)}writeHeightModel(e,t,r){return f.write(e,t,r)}readHeightModel(e,t,r){return f.read(e)||(r?.messages&&r.messages.push(function(e,t){return new u.A("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:r})),null)}readHeightUnit(e,t,r){return m.read(e)||(r?.messages&&r.messages.push(v(e,{context:r})),null)}readHeightUnitService(e,t,r){return(0,o.LA)(e)||m.read(e)||(r?.messages&&r.messages.push(v(e,{context:r})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new i({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS,origin:this.origin,associatedSpatialReference:this.associatedSpatialReference})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static fromSpatialReference(e){let{latestVcsWkid:t,vcsWkid:r}=e;if(!r)return null;let n=(null==t?null:c.B.get(t))??c.B.get(r);return n?new i({heightModel:0===n.type?"gravity-related-height":"ellipsoidal",heightUnit:(0,o.LA)(n.unit.name),vertCRS:n.datum,origin:3,associatedSpatialReference:e}):null}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;let t=new i;return t.read(e,{origin:"web-scene"}),t}};function v(e,t){return new u.A("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,n.Cg)([(0,h.MZ)()],y.prototype,"origin",void 0),(0,n.Cg)([(0,h.MZ)()],y.prototype,"associatedSpatialReference",void 0),(0,n.Cg)([(0,h.MZ)({type:f.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:g,default:"ellipsoidal",write:{isRequired:!0,alwaysWriteDefaults:!0}}}}})],y.prototype,"heightModel",void 0),(0,n.Cg)([(0,d.K)("web-scene","heightModel")],y.prototype,"writeHeightModel",null),(0,n.Cg)([(0,p.w)(["web-scene","service"],"heightModel")],y.prototype,"readHeightModel",null),(0,n.Cg)([(0,h.MZ)({type:m.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:m.jsonValues,write:{writer:m.write,isRequired:!0}}}}})],y.prototype,"heightUnit",void 0),(0,n.Cg)([(0,p.w)("web-scene","heightUnit")],y.prototype,"readHeightUnit",null),(0,n.Cg)([(0,p.w)("service","heightUnit")],y.prototype,"readHeightUnitService",null),(0,n.Cg)([(0,h.MZ)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],y.prototype,"vertCRS",void 0),(0,n.Cg)([(0,p.w)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],y.prototype,"readVertCRS",null),y=i=(0,n.Cg)([(0,h.$K)("esri.geometry.HeightModelInfo")],y)},18768(e,t,r){var i=r(32198),n=r(53966),a=r(91429),s=r(60694);r.d(t,["b",0,e=>{let t=e,r=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){let e=(0,s.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,s.Jf)(e,n.A.getLogger(this)))}};return(0,i.Cg)([(0,a.MZ)()],r.prototype,"title",null),(0,i.Cg)([(0,a.MZ)({type:String})],r.prototype,"url",null),r=(0,i.Cg)([(0,a.$K)("esri.layers.mixins.ArcGISService")],r),r}])},69208(e,t,r){var i=r(32198),n=r(91429);r.d(t,["d",0,e=>{let t=e,r=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,i.Cg)([(0,n.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],r.prototype,"customParameters",void 0),r=(0,i.Cg)([(0,n.$K)("esri.layers.mixins.CustomParametersMixin")],r),r}])},8303(e,t,r){var i=r(32198),n=r(92602),a=r(70333),s=r(56507),l=r(60999),o=r(49186),u=r(36563),h=r(53966),c=r(97768),d=r(17676),p=r(84952),f=r(91429),g=r(77548),m=r(20655),y=r(80812),v=r(41318),M=r(10407),w=r(26121),b=r(36005),S=r(43937);const A={credential:null,user:null};r.d(t,["A",0,e=>{let t=e,_=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){super.destroy(),this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new y.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{let{load:i}=await r.e(1204).then(()=>r(41204));return(0,d.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,d.zf)(e)||h.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async reloadFromPortal(e,t){if(!this.loaded||!this.portalItem?.id)return!1;let i=t?.signal?null:new AbortController;try{let{reload:n}=await r.e(1204).then(()=>r(41204));return i&&this.addHandles((0,u.rE)(i),"reloadFromPortal"),await n({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t?.signal?t:{signal:i.signal})}catch(e){throw(0,d.zf)(e)||h.A.getLogger(this).warn(`Failed to reload layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}finally{i&&this.removeHandles("reloadFromPortal")}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,d.QP)(e),!0)))}async setUserPrivileges(e,t){if(!n.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{let{features:{edit:r,fullEdit:i},content:{updateItem:n}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",n)}catch(e){(0,d.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);let i,n,s=!a.id?.findCredential(this.url),l=e===r.id;if(l&&r.portal.user)return this._getUserPrivileges(r,s);if(l)i=r.portal.url;else try{i=await(0,g.wI)(this.url,t)}catch(e){(0,d.QP)(e)}if(!i||!(0,p.b8)(i,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{let e=null==t?null:t.signal;n=await(a.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,d.QP)(e)}if(!n)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(l?await r.reload():(r=new y.default({id:e,portal:{url:i}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,s)}catch(e){(0,d.QP)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}_getUserPrivileges(e,t){let r=(0,M.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,d.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){let t=this.url?a.id?.findCredential(this.url):null;if(!t)return!0;let r=A.credential===t?A.user:await this._fetchEditingUser(e);return A.credential=t,A.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){let t=this.portalItem?.portal?.user;if(t)return t;let r=a.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;let i=`${r.owningSystemUrl}/sharing/rest`,n=m.A.getDefault();if(n&&n.loaded&&(0,p.S8)(n.restUrl)===(0,p.S8)(i))return n.user;let o=`${i}/community/self`,u=null==e?null:e.signal,h=await(0,l.Ke)((0,s.A)(o,{authMode:"no-prompt",query:{f:"json"},signal:u}));return h.ok?v.A.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){return(0,w.wN)(this.portalItem,t)?(t?.messages?.push(new o.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i.Cg)([(0,f.MZ)({type:y.default})],_.prototype,"portalItem",null),(0,i.Cg)([(0,b.w)("web-document","portalItem",["itemId"])],_.prototype,"readPortalItem",null),(0,i.Cg)([(0,S.K)("web-document","portalItem",{itemId:{type:String}})],_.prototype,"writePortalItem",null),(0,i.Cg)([(0,f.MZ)({clonable:!1})],_.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasUpdateItemPrivileges",void 0),_=(0,i.Cg)([(0,f.$K)("esri.layers.mixins.PortalLayer")],_),_}])},25036(e,t,r){var i=r(32198),n=r(91429),a=r(83960);r.d(t,["j",0,e=>{let t=e,r=class extends t{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){let e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;void 0!==t?.effectiveScaleRange&&(0,a.RH)(e,t.effectiveScaleRange);let r=this._get("effectiveScaleRange");return r&&r.minScale===e.minScale&&r.maxScale===e.maxScale?r:e}};return(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],r.prototype,"minScale",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],r.prototype,"maxScale",void 0),(0,i.Cg)([(0,n.MZ)({readOnly:!0})],r.prototype,"effectiveScaleRange",null),r=(0,i.Cg)([(0,n.$K)("esri.layers.mixins.ScaleRangeLayer")],r),r}])},88546(e,t,r){r.d(t,{_8:()=>m,uB:()=>y});var i=r(34727),n=r(35522),a=r(51850),s=r(73941),l=r(5443),o=r(54239),u=r(16930),h=r(9762);const c=new u.A({wkid:4326,vcsWkid:115700}),d=new l.A(-180,-90,180,90,c);function p(e,t){if(!Array.isArray(e)||e.length<t)return!1;for(let t of e)if("number"!=typeof t)return!1;return!0}const f=7645211,g={xmin:-180,ymin:-90,zmin:-450,xmax:180,ymax:90,zmax:8850};function m(e){return!(!(e.extensions?.ESRI_crs?.wkid||e.extensions?.ESRI_crs?.latestWkid||e.extensions?.ESRI_crs?.wkt)||!e.root?.extensions?.ESRI_crs?.boundingVolume?.box&&!e.root?.extensions?.ESRI_crs?.boundingVolume?.sphere)}function y(e,t=!1){let r=new u.A({wkid:4326,vcsWkid:115700}),o=e.root?.boundingVolume,c=!1,d=e?.root?.transform;if(t&&(e.extensions?.ESRI_crs?.wkid||e.extensions?.ESRI_crs?.latestWkid||e.extensions?.ESRI_crs?.wkt)&&(e.root?.extensions?.ESRI_crs?.boundingVolume?.box||e.root?.extensions?.ESRI_crs?.boundingVolume?.sphere))r=new u.A(e.extensions?.ESRI_crs),o=e.root?.extensions?.ESRI_crs?.boundingVolume,d=e.root?.transform,c=!0;else if(!o)return new l.A(-180,-90,180,90,r);if(o.box){let e=o?.box;if(e[3]>f&&e[7]>f&&e[11]>f)return new l.A({...g,spatialReference:r})}let m=(0,a.vt)();if(!c&&o.region&&p(o.region,6)){let e=o.region,t=(0,i.KJ)(e[0]),n=(0,i.KJ)(e[1]),a=e[4],s=(0,i.KJ)(e[2]),u=(0,i.KJ)(e[3]),h=e[5];return new l.A({xmin:t,ymin:n,zmin:a,xmax:s,ymax:u,zmax:h,spatialReference:r})}if(o.sphere&&p(o.sphere,4)){let e=o.sphere,t=(0,a.fA)(e[0],e[1],e[2]),i=e[3]/Math.sqrt(3),f=(0,a.vt)();(0,n.Re)(f,t,(0,a.fA)(i,i,i));let g=(0,a.vt)();if((0,n.WQ)(g,t,(0,a.fA)(i,i,i)),d&&p(d,16)){let e=d;(0,n.Z0)(m,f,e),(0,n.C)(f,m),(0,n.Z0)(m,g,e),(0,n.C)(g,m)}c||((0,h.projectBuffer)(f,s.Ro,0,f,u.A.WGS84,0),(0,h.projectBuffer)(g,s.Ro,0,g,u.A.WGS84,0));let y=(0,a.vt)(),v=(0,a.vt)();return(0,n.jk)(y,f,g),(0,n.T9)(v,f,g),new l.A({xmin:y[0],ymin:y[1],zmin:y[2],xmax:v[0],ymax:v[1],zmax:v[2],spatialReference:r})}if(o.box&&p(o.box,12)){let e=o.box,t=(0,a.fA)(e[0],e[1],e[2]),i=(0,a.fA)(e[3],e[4],e[5]),f=(0,a.fA)(e[6],e[7],e[8]),g=(0,a.fA)(e[9],e[10],e[11]),m=[];for(let e=0;e<8;++e)m.push((0,a.vt)());if((0,n.WQ)(m[0],t,i),(0,n.WQ)(m[0],m[0],f),(0,n.WQ)(m[0],m[0],g),(0,n.jb)(m[1],t,i),(0,n.WQ)(m[1],m[1],f),(0,n.WQ)(m[1],m[1],g),(0,n.WQ)(m[2],t,i),(0,n.jb)(m[2],m[2],f),(0,n.WQ)(m[2],m[2],g),(0,n.jb)(m[3],t,i),(0,n.jb)(m[3],m[3],f),(0,n.WQ)(m[3],m[3],g),(0,n.WQ)(m[4],t,i),(0,n.WQ)(m[4],m[4],f),(0,n.jb)(m[4],m[4],g),(0,n.jb)(m[5],t,i),(0,n.WQ)(m[5],m[5],f),(0,n.jb)(m[5],m[5],g),(0,n.WQ)(m[6],t,i),(0,n.jb)(m[6],m[6],f),(0,n.jb)(m[6],m[6],g),(0,n.jb)(m[7],t,i),(0,n.jb)(m[7],m[7],f),(0,n.jb)(m[7],m[7],g),d&&p(d,16)){let e=d;for(let t=0;t<8;++t)(0,n.Z0)(m[t],m[t],e)}let y=(0,a.fA)(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),v=(0,a.fA)(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let e=0;e<8;++e)c||(0,h.projectBuffer)(m[e],s.Ro,0,m[e],u.A.WGS84,0),(0,n.jk)(v,v,m[e]),(0,n.T9)(y,y,m[e]);return new l.A({xmin:v[0],ymin:v[1],zmin:v[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:r})}return new l.A(-180,-90,180,90,r)}new Map([[5773,new o.A({heightModel:"gravity-related-height",heightUnit:"meters",vertCRS:"EGM96_Geoid"})],[3855,new o.A({heightModel:"gravity-related-height",heightUnit:"meters",vertCRS:"EGM2008_Geoid"})],[115700,new o.A({heightModel:"ellipsoidal",heightUnit:"meters",vertCRS:"WGS_1984"})],[115701,new o.A({heightModel:"ellipsoidal",heightUnit:"meters",vertCRS:"ETRS_1989"})],[6360,new o.A({heightModel:"gravity-related-height",heightUnit:"us-feet",vertCRS:"NAVD88_height_(ftUS)"})],[7837,new o.A({heightModel:"gravity-related-height",heightUnit:"meters",vertCRS:"DHHN2016_(height)"})],[5709,new o.A({heightModel:"gravity-related-height",heightUnit:"meters",vertCRS:"NAP"})]]),r.d(t,["Zx",0,c,"zq",0,d])},10407(e,t,r){r.d(t,{It:()=>p,LG:()=>s,OM:()=>u,Sm:()=>h,Y:()=>l,bK:()=>o,sQ:()=>c});var i=r(99917),n=r(16930),a=r(28735);function s(e,t){if(!l(e,t)){let r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function l(e,t){return!!e.typeKeywords?.includes(t)}function o(e){return l(e,d.HOSTED_SERVICE)}function u(e,t){let r=e.typeKeywords;if(r){let e=r.indexOf(t);e>-1&&r.splice(e,1)}}function h(e,t,r){r?s(e,t):u(e,t)}async function c(e){let t,r=e.clone().normalize();if(r.length>1)for(let e of r)t?e.width>t.width&&(t=e):t=e;else t=r[0];return async function(e){let t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,a.ci)(e);let r=n.A.WGS84;return await(0,i.initializeProjection)(t,r),(0,i.project)(e,r)}(t)}const d={CHARTS:"Charts",CATALOG_LAYER:"CatalogLayer",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",PARCEL_FABRIC:"ParcelFabric",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery",UTILITY_NETWORK:"UtilityNetwork"};function p(e){let{portal:t,isOrgItem:r,itemControl:i}=e,n=t.user?.privileges,a=!n||n.includes("features:user:edit"),s=!!r&&!!n?.includes("features:user:fullEdit"),l="update"===i||"admin"===i;return l?s=a=!0:s&&(a=!0),{features:{edit:a,fullEdit:s},content:{updateItem:l}}}r.d(t,["mm",0,d])},78553(e,t,r){r.d(t,{D:()=>a,p:()=>n});var i=r(78888);function n(e){let t=(0,i.Vr)(100*(1-e));return Math.max(0,Math.min(t,100))}function a(e){let t=1-e/100;return Math.max(0,Math.min(t,1))}},26121(e,t,r){r.d(t,{I6:()=>h,ci:()=>u,dL:()=>o,wN:()=>c});var i=r(49186),n=r(84952),a=r(77548),s=r(20655),l=r(59923);async function o(e){let t=[];for(let r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){let e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}function u(e,t,r){let n=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new i.A(e,t,r));if(e.blockedRelativeUrls&&(n=n.concat(e.blockedRelativeUrls.map(e=>(0,l.GL)("url",`Relative url '${e}' is not supported`)))),r){let{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:i}=r;e&&(n=n.filter(({name:e})=>!(l.MG.has(e)||t.includes(e)))),i&&(n=n.filter(e=>"web-document-write:property-required"!==e.name))}if(n.length>0)throw new i.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:n})}function h(e){return(0,a.qd)(e).some(e=>!!e.charts?.length)}function c(e,t){let r=t?.portal,i=e?.id&&(e.portal||s.A.getDefault());return!!r&&!!i&&!(0,n.ut)(i.restUrl,r.restUrl)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9859],{49859(e,t,i){i.d(t,{A:()=>L});var l=i(32198),r=i(56507),n=i(49186),o=i(25482),s=i(53966),a=i(17676),c=i(563),u=i(91429),h=i(78888),f=i(5443),m=i(86738),d=i(16930),p=i(7548),x=i(4366),g=i(37373);const y=new Map,I=new class{constructor(e=15e3,t=5e3,i=-1){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t),this._size=i}decreaseRefCount(e,t){let i=e+"/"+t,l=this._cachedBlocks;if(l.has(i)){let e=l.get(i);return e.refCount--,e.refCount<=0&&(l.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){let i=e+"/"+t,l=this._cachedBlocks;if(l.has(i)){let e=l.get(i);return e.ts=Date.now(),e.refCount++,l.delete(i),l.set(i,e),e.block}return null}putBlock(e,t,i,l){let r=this._cachedBlocks,n=e+"/"+t;if(r.has(n)){let e=r.get(n);e.ts=Date.now(),e.refCount++}else r.set(n,{block:i,ts:Date.now(),refCount:1,controller:l});this._trim(),this._updateTimer()}deleteBlock(e,t){let i=this._cachedBlocks,l=e+"/"+t;i.has(l)&&i.delete(l)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;let e=this._cachedBlocks;this._timer=setInterval(()=>{let t=Array.from(e),i=Date.now();for(let l=0;l<t.length&&t[l][1].ts<=i-this._duration;l++)e.delete(t[l][0]);0===e.size&&this._clearTimer()},this._interval)}_trim(){let e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;let t=Array.from(e).sort((e,t)=>e[1].refCount-t[1].refCount||e[1].ts-t[1].ts);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)}}(15e3,5e3,100);function w(e,t,i){let l=y.get(e);if(!l)return null==t?I.decreaseRefCount(e,i):0;if(null==t||null==l[t])return I.decreaseRefCount(e,i);let r=l[t]?.cache,n=r?.get(i);if(r&&n){if(n.refCount--,0===n.refCount){r.delete(i);for(let e=0;e<l.length;e++)l[e]?.cache.delete(i);n.controller&&n.controller.abort()}return n.refCount}return 0}function R(e,t,i){let l=y.get(e);if(!l)return null==t?I.getBlock(e,i):null;if(null==t||null==l[t]){for(let e=0;e<l.length;e++){let t=l[e]?.cache.get(i);if(t)return t.refCount++,t.block}return I.getBlock(e,i)}let r=l[t]?.cache.get(i);if(r)return r.refCount++,r.block;for(let e=0;e<l.length;e++){if(e===t||!l[e])continue;let r=l[e]?.cache,n=r?.get(i);if(r&&n)return n.refCount++,r.set(i,n),n.block}return null}function k(e,t,i,l,r=null){let n=y.get(e);if(!n)return void(t??I.putBlock(e,i,l,r));if(null==t||null==n[t])return void I.putBlock(e,i,l,r);let o={refCount:1,block:l,isResolved:!1,isRejected:!1,controller:r};l.then(()=>o.isResolved=!0).catch(()=>o.isRejected=!0),n[t]?.cache.set(i,o)}function _(e,t,i){let l=y.get(e);l?null!=t&&null!=l[t]?l[t]?.cache.delete(i):I.deleteBlock(e,i):t??I.deleteBlock(e,i)}var b=i(94778),S=i(96381),v=i(34930),T=i(47520),C=i(34251),B=i(60694),M=i(10873),P=i(45617),A=i(91806),z=i(20223),W=i(87045);let H=0,L=class extends o.o{constructor(){super(...arguments),this._tileFetchQueue=new c.QueueProcessor({concurrency:32,process:(e,t)=>this.fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"},this.rawBlockRegistryIds=[],this.refresh=(0,a.sg)(async e=>{await this._openPromise;let t=await this._refresh(e);return t.dataChanged&&function(e,t){let i=y.get(e);if(i){let e=t.map(e=>i[e]).filter(e=>null!=e);for(let t of e)t&&(Array.from(t.cache.values()).forEach(e=>{!e.isResolved&&!e.isRejected&&e.controller&&e.controller.abort()}),t.cache.clear())}}(this.rasterId,this.rawBlockRegistryIds),t})}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:W.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){let{rasterInfo:e}=this,t=(0,g.FT)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){let{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),(0,p.qg)(this)&&this.primaryRasters?.rasters?.forEach(t=>t.rasterJobHandler=e)}get rasterId(){return this.url||"rasterId-"+H++}set url(e){this._set("url",(0,B.Jf)(e,s.A.getLogger(this)))}async open(e){return this._openPromise??=(0,g.Hh)().then(()=>this._open(e)),this._openPromise}async fetchTile(e,t,i,l={}){let r=l.tileInfo||this.rasterInfo.storageInfo.tileInfo,o=this.getTileExtentFromTileInfo(e,t,i,r);if(!o)throw new n.A("imagery-tile:out-of-bounds","Level for fetch tile out of range");return l={noClip:!0,...l},this.fetchPixels(o,r.size[0],r.size[1],l)}async identify(e,t={}){e=(0,h.PZ)(m.A,e).clone().normalize();let{multidimensionalDefinition:i,timeExtent:l}=t,{rasterInfo:r}=this,{hasMultidimensionalTranspose:n,multidimensionalInfo:o}=r,{transposedVariableName:s}=t,a=null!=o&&n&&(null!=l||(0,x.DY)(i));a&&!s&&(s=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:s}),t=this._getRequestOptionsWithSliceId(t);let{spatialReference:c,extent:u}=r,{datumTransformation:d}=t,y=(0,g._I)(e,c,d);if(!u.intersects(y))return{location:y,value:null};if(null!=r.transform){let e=r.transform.inverseTransform(y);if(!r.nativeExtent.intersects(e))return{location:e,value:null};y=e}let I=null!=s&&null!=o&&r.hasMultidimensionalTranspose;if((0,p.qg)(this)){let e=this.primaryRasters.rasters[0];if(I)return e.identify(y,t);let{pixelSize:l}=r,n=3*l.x/2,o=3*l.y/2,s=new f.A({xmin:y.x-n,xmax:y.x+n,ymin:y.y-o,ymax:y.y+o,spatialReference:c}),a={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId,bandIds:t.bandIds},{pixelBlock:u}=await e.fetchPixels(s,3,3,a),{pixelBlock:h}=await this.fetchPixels(s,3,3,a);if(null==u)return{location:y,value:null};let m,d=!u.mask||u.mask[4]?u.pixels.map(e=>e[4]):null;return null!=h&&(m=!h.mask||h.mask[4]?h.pixels.map(e=>e[4]):void 0),{location:y,value:d,processedValue:m,pyramidLevel:0}}let w=0;if(!I){let{srcResolution:i}=t;if(i)i.spatialReference&&(i=(0,v.T5)(new m.A(i),c)),w=(0,g.t$)(i,r,this.ioConfig.sampling).pyramidLevel;else if(w=await this.computeBestPyramidLevelForLocation(e,t),null==w)return{location:y,value:null}}let R=this.identifyPixelLocation(y,w,null,I);if(null===R)return{location:y,value:null};let{row:k,col:_,rowOffset:b,colOffset:S,blockWidth:T}=R,C=await this._fetchRawTile(w,k,_,t);if(!C?.pixels?.length)return{location:y,value:null};let B=b*T+S;return this._processIdentifyResult(C,{srcLocation:y,position:B,pyramidLevel:w,useTransposedTile:!!I,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,l={}){e=(0,g.Ps)(e),l=this._getRequestOptionsWithSliceId(l);let{_hasNoneOrGCSShiftTransform:r}=this;if(l.requestRawData&&r)return this._fetchPixels(e,t,i,l);let n=(0,g.FT)(e.spatialReference),o=(0,g.OM)(e);if(null==n||0===o||1===o&&this._isGlobalWrappableSource&&r)return this._fetchPixels(e,t,i,l);if(o>=3)return{extent:e,pixelBlock:null};let s=[],{xmin:a,xmax:c}=e,u=Math.round(n/(c-a)*t),h=u-Math.round((n/2-a)/(c-a)*t),m=0,d=[];for(let r=0;r<=o;r++){let p=0===r?a:-n/2,x=r===o?c-n*r:n/2,g=new f.A({xmin:p,xmax:x,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),y=0===r?u-h:r===o?t-m:u;m+=y,d.push(y);let I=l.disableWrapAround&&r>0?null:this._fetchPixels(g,y,i,l);s.push(I)}let p=(await Promise.all(s)).map(e=>e?.pixelBlock),x=null,y={width:t,height:i};return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:d},l)).pixelBlock:(0,T.z7)(p,y,{blockWidths:d}),{extent:e,srcExtent:(0,g._l)(e,this.rasterInfo.spatialReference,l.datumTransformation),pixelBlock:x}}async fetchRawPixels(e,t,i,l={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};let r=await this._fetchRawTiles(e,t,i,l),{nativeExtent:n,nativePixelSize:o,storageInfo:s}=this.rasterInfo,a=2**e,c=o.x*a,u=o.y*a,h=new f.A({xmin:n.xmin+c*t.x,xmax:n.xmin+c*(t.x+i.width-1),ymin:n.ymax-u*(t.y+i.height-1),ymax:n.ymax-u*t.y,spatialReference:n.spatialReference});if(!r)return{extent:h,srcExtent:h,pixelBlock:null};let{pixelBlocks:m,mosaicSize:d}=r;if(1===m.length&&null!=m[0]&&m[0].width===i.width&&m[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:r.pixelBlocks[0]};let p,x=e>0?s.pyramidBlockWidth:s.blockWidth,g=e>0?s.pyramidBlockHeight:s.blockHeight,y={x:t.x%x,y:t.y%g};return p=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:d,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:l.interpolation,alignmentInfo:null,blockWidths:null},l)).pixelBlock:(0,T.z7)(m,d,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:p}}fetchRawTile(e,t,i,l){throw new n.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,g._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return this.rasterJobHandler?this.rasterJobHandler.decode({data:e,options:t}):(0,S.D)(e,t)}async request(e,t,i=0){let{customFetchParameters:l}=this.ioConfig,{range:n,query:o,headers:s}=t;i=i??t.retryCount??this.ioConfig.retryCount;let a=n?{Range:`bytes=${n.from}-${n.to}`}:null;try{return await(0,r.A)(e,{...t,query:{...o,...l},headers:{...s,...a}})}catch(l){if(i>0)return i--,this.request(e,t,i);throw l}}getSliceIndex(e){let{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,x.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,l){let r=l.lodAt(e);return r?this.getTileExtent({x:r.resolution,y:r.resolution},t,i,l.origin,l.spatialReference,l.size):null}updateTileInfo(){let{storageInfo:e,spatialReference:t,extent:i,pixelSize:l}=this.rasterInfo,{pyramidResolutions:r}=e;if(!e.tileInfo){let n=[],o=e.maximumPyramidLevel||0,s=(l.x+l.y)/2,a=1/.0254*96*s;for(let e=0;e<=o&&(n.unshift(new A.A({level:o-e,resolution:s,scale:a})),e!==o);e++)if(r){let t=(r[e].x+r[e].y)/2;a*=t/s,s=t}else s*=2,a*=2;let c=new m.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new W.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:n}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,l){let{width:r,height:n,nativeExtent:o,pixelSize:s,spatialReference:a}=e,c=new m.A({x:o.xmin,y:o.ymax,spatialReference:a});l??=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8));let u=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[s],l);e.storageInfo=new z.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:l,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,l,r,n=0,o=2){if(1===r.length&&n>0){r=[...r];let{x:e,y:t}=r[0];for(let i=0;i<n;i++)e*=o,t*=o,r.push({x:e,y:t})}let s=[],{x:a,y:c}=l;for(let l=0;l<r.length;l++){let{x:n,y:o}=r[l];s.push({minCol:Math.floor((e.xmin-a+.1*n)/t/n),maxCol:Math.floor((e.xmax-a-.1*n)/t/n),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return s}getPyramidPixelSize(e){let{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:l}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];let r=l**e;return{x:t.x*r,y:t.y*r}}identifyPixelLocation(e,t,i,l){let{spatialReference:r,nativeExtent:n,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:s,origin:a,transposeInfo:c}=o,u=l&&null!=c?c.tileSize[0]:o.blockWidth,h=l&&null!=c?c.tileSize[1]:o.blockHeight,f=(0,g._I)(e,r,i);if(!n.intersects(f)||t<0||t>s)return null;let{x:m,y:d}=this.getPyramidPixelSize(t),p=(a.y-f.y)/d/h,x=(f.x-a.x)/m/u,y=Math.min(h-1,Math.floor((p-Math.floor(p))*h)),I=Math.min(u-1,Math.floor((x-Math.floor(x))*u));return{pyramidLevel:t,row:Math.floor(p),col:Math.floor(x),rowOffset:y,colOffset:I,blockWidth:u,srcLocation:f}}getTileExtent(e,t,i,l,r,n){let[o,s]=n,a=l.x+i*o*e.x,c=a+o*e.x,u=l.y-t*s*e.y,h=u-s*e.y;return new f.A({xmin:a,xmax:c,ymin:h,ymax:u,spatialReference:r})}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){let l=this.rasterInfo.storageInfo.blockBoundary[e];return!l||l.maxRow<t||l.maxCol<i||l.minRow>t||l.minCol>i}updateImageSpaceRasterInfo(e){let{pixelSize:t}=e,{width:i,height:l}=e,r=d.A.WebMercator;e.spatialReference=r,e.extent=e.nativeExtent=new f.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-l,spatialReference:r}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new m.A({x:1,y:1,spatialReference:r});let{extent:n,storageInfo:o}=e;if(o){o.origin=new m.A({x:n.xmin,y:n.ymax,spatialReference:r});let{pyramidResolutions:i,tileInfo:l}=o;if(i&&i.forEach(e=>{e.x/=t.x,e.y/=t.y}),l){l.origin=o.origin;let t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;l.lods.forEach((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254})}}}async _refresh(e){return{dataChanged:!0}}async _fetchPixels(e,t,i,l={}){let r=(0,g.OM)(e);if(r>=2)return{extent:e,pixelBlock:null};let n=this._getSourceDataInfo(e,t,i,l),{pyramidLevel:o,srcResolution:s,srcWidth:a,srcHeight:c,ul:u}=n,{srcExtent:h}=n;if(0===a||0===c)return{extent:e,srcExtent:h,pixelBlock:null};let{rasterInfo:f}=this,d=f.transform,p="gcs-shift"===d?.type,x=null!=(0,g.FT)(e.spatialReference);(p||!x)&&(r=(0,g.OM)(h,p));let y=await this._fetchRawTiles(o,u,{width:a,height:c,wrapCount:r},l);if(!y)return{extent:e,srcExtent:h,pixelBlock:null};h=y.extent;let I=f.storageInfo,w=o>0?I.pyramidBlockWidth:I.blockWidth,R=o>0?I.pyramidBlockHeight:I.blockHeight,{x:k,y:_}=f.pixelSize;if(o>0){let{pyramidResolutions:e,pyramidScalingFactor:t}=I;if(null!=e&&e[o-1])({x:k,y:_}=e[o-1]);else{let e=t**o;k*=e,_*=e}}let b=f.spatialReference,S=new m.A({x:k,y:_,spatialReference:b}),v=w===a&&R===c&&u.x%w===0&&u.y%R===0,B=new m.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),M=!e.spatialReference.equals(b),P=b.isGeographic?1e-9:1e-4,{datumTransformation:A}=l;if(!M&&v&&1===y.pixelBlocks.length&&w===t&&R===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(s,B,P))return{extent:e,srcExtent:h,srcTilePixelSize:S,pixelBlock:y.pixelBlocks[0]};let z=x&&null!=(0,g.FT)(h.spatialReference)&&this._hasNoneOrGCSShiftTransform,W=l.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");W&&!this.rasterJobHandler&&await(0,g.Hh)();let H,L=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:h,pixelSize:B.toJSON(),datumTransformation:A,rasterTransform:d,hasWrapAround:r>0||z,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:W},l):(0,g.l0)({projectedExtent:e,srcBufferExtent:h,pixelSize:B,datumTransformation:A,rasterTransform:d,hasWrapAround:r>0||z,isAdaptive:!1,includeGCSGrid:W}),D=!l.requestRawData,E={rows:L.spacing[0],cols:L.spacing[1]},O=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,h.xmin):void 0,{pixelBlocks:F,mosaicSize:q,isPartiallyFilled:G}=y,J=null;if(this.rasterJobHandler){let e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:F,srcMosaicSize:q,destDimension:D?{width:t,height:i}:null,coefs:D?L.coefficients:null,sampleSpacing:D?E:null,projectDirections:W,gcsGrid:W?L.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:l.interpolation,alignmentInfo:O,blockWidths:null},l);({pixelBlock:H,localNorthDirections:J}=e)}else{let e=(0,T.z7)(F,q,{alignmentInfo:O});H=D?(0,T.$i)(e,{width:t,height:i},L.coefficients,E,l.interpolation):e,W&&L.gcsGrid&&(J=(0,T.QF)({width:t,height:i},L.gcsGrid),H=(0,C.Y2)(H,this.rasterInfo.dataType,J))}return l.requestRawData||W?{extent:e,srcExtent:h,srcTilePixelSize:S,pixelBlock:H,transformGrid:L,localNorthDirections:J,isPartiallyFilled:G}:{extent:e,srcExtent:e,srcTilePixelSize:S,pixelBlock:H}}async _fetchRawTiles(e,t,i,l){let{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:s}=this.getBlockWidthHeight(e),{x:a,y:c}=t,{width:u,height:h,wrapCount:m}=i,d=this._getRasterTileAlignmentInfo(e,0);l.buffer&&(a-=l.buffer.cols,c-=l.buffer.rows,u+=2*l.buffer.cols,h+=2*l.buffer.rows);let p=0,x=0,g=0;m&&null!=d&&(({worldColumnCountFromOrigin:x,originColumnOffset:g,rightPadding:p}=d),x*d.blockWidth-p>=a+u&&(p=0));let y=Math.floor(a/o),I=Math.floor(c/s),w=Math.floor((a+u+p-1)/o),R=Math.floor((c+h+p-1)/s),k=n[e];if(!k)return null;let{minRow:_,minCol:b,maxCol:S,maxRow:v}=k;if(0===m&&(R<_||w<b||I>v||y>S))return null;let T=[],C=!1,B=null==this.ioConfig.allowPartialFill?l.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=I;t<=R;t++)for(let i=y;i<=w;i++){let r=i;if(!l.disableWrapAround&&m&&null!=d&&x<=i&&(r=i-x-g),t>=_&&r>=b&&v>=t&&S>=r){let i=this._fetchRawTile(e,t,r,l);B?T.push(new Promise(e=>{i.then(t=>e(t)).catch(()=>{C=!0,e(null)})})):T.push(i)}else T.push(Promise.resolve(null))}if(0===T.length)return null;let M=await Promise.all(T),P={height:(R-I+1)*s,width:(w-y+1)*o},{spatialReference:A}=this.rasterInfo,{x:z,y:W}=this.getPyramidPixelSize(e);return{extent:new f.A({xmin:r.x+y*o*z,xmax:r.x+(w+1)*o*z,ymin:r.y-(R+1)*s*W,ymax:r.y-I*s*W,spatialReference:A}),pixelBlocks:M,mosaicSize:P,isPartiallyFilled:C}}_fetchRawTile(e,t,i,l){let{storageInfo:r}=this.rasterInfo,n=null!=r.transposeInfo&&!!l.transposedVariableName;if(!n){let l=r.blockBoundary[e];if(!l)return Promise.resolve(null);let{minRow:n,minCol:o,maxCol:s,maxRow:a}=l;if(t<n||i<o||t>a||i>s)return Promise.resolve(null)}let o=n?l.transposeVariableName:l.sliceId,s=r.isBsqTile?l.bandIds:null,c=function(e,t,i){let l=[];return null!=t&&l.push(`sliceId=${t}`),null!=i&&l.push(`bandIds=${i.join(",")}`),l.length?`${e}?${l.join("&")}`:e}(this.rasterId,o,s),u=`${e}/${t}/${i}`,h=R(c,l.registryId,u);if(null==h){let n=new AbortController,o=l.bandIds?.slice();if(o?.length&&r.isBsqTile){let r=new Set(o),s=[],a=Array.from(r);for(let r of a)s.push(this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:{...l,bandIds:[r]}},{signal:n.signal}));h=Promise.all(s).then(e=>{if(e.some(e=>null==e))return null;if(a.length!==o.length){let t=[];for(let i of o){let l=e[a.indexOf(i)];t.includes(l)&&(l=l.clone()),t.push(l)}e=t}return this.rasterJobHandler?this.rasterJobHandler.compositeBands({pixelBlocks:e},{signal:n.signal,transferPixelsToWorker:!0}):(0,T.Wy)(e)})}else h=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:l},{signal:n.signal});k(c,l.registryId,u,h,n),h.catch(()=>_(c,l.registryId,u))}return l.signal&&(0,a.u7)(l,()=>{w(c,l.registryId,u)}),h}_computeMagDirValues(e){let{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;let l=e[0].length;if("vector-magdir"===i){let t=e[1].map(e=>(e+360)%360);return[e[0],t]}let[r,n]=e,o=[],s=[];for(let e=0;e<l;e++){let[t,i]=(0,C.Lu)([r[e],n[e]]);o.push(t),s.push(i)}return[o,s]}_getRasterTileAlignmentInfo(e,t){return this._rasterTileAlignmentInfo??=(0,g.DO)(this.rasterInfo),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,l={}){let r={datumTransformation:l.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};l.srcResolution&&(r.srcResolution=l.srcResolution,this._updateSourceDataInfo(e,r));let n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:s,pyramidLevel:a}=r,c=o/t,u=s/i,h=a<n&&c*u>=16,f=a===n&&this._requireTooManySrcTiles(o,s,t,i);if(h||f||0===o||0===s){let o=new m.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),s=(0,g.Wo)(o,this.rasterInfo.spatialReference,e,r.datumTransformation),f=!s||l.srcResolution&&s.x+s.y<l.srcResolution.x+l.srcResolution.y;if(h&&l.srcResolution&&f){let e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(n-a+3>=e){let t=2**e;s={x:l.srcResolution.x*t,y:l.srcResolution.y*t}}}s&&(r.srcResolution=s,this._updateSourceDataInfo(e,r))}return this._requireTooManySrcTiles(r.srcWidth,r.srcHeight,t,i)&&(r.srcWidth=0,r.srcHeight=0),r}_requireTooManySrcTiles(e,t,i,l){let{tileInfo:r}=this.rasterInfo.storageInfo,n=e/i,o=t/l;return Math.ceil(e/r.size[0])*Math.ceil(t/r.size[1])>=256*Math.max(1,(i+l)/1024)||n>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;let{rasterInfo:i}=this,l=i.spatialReference,{srcResolution:r,datumTransformation:n}=t,{pyramidLevel:o,pyramidResolution:s,excessiveReading:a}=(0,g.t$)(r,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,g._l)(e,l,n);if(null==c)return;let u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;let{origin:h}=i.storageInfo,{width:f,height:m,ul:d}=(0,p.$g)(c,h,s,o);t.pyramidLevel=o,t.pyramidResolution=s,t.srcWidth=f,t.srcHeight=m,t.ul=d}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){let{srcLocation:i,position:l,pyramidLevel:r,useTransposedTile:n}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[l])return{location:i,value:null};let{multidimensionalInfo:s}=this.rasterInfo;if(null==s||!n){let t=e.pixels.map(e=>e[l]),n={location:i,value:t,pyramidLevel:r},o=this._computeMagDirValues(t.map(e=>[e]));return o?.length&&(n.magdirValue=o.map(e=>e[0])),n}let a=e.pixels.map(e=>e.slice(l*o,l*o+o)),c=this._computeMagDirValues(a),{requestSomeSlices:u,identifyOptions:h}=t,f=(0,x.QW)(s,h.transposedVariableName);if(u){let e=(0,x.xx)(f,h.multidimensionalDefinition,h.timeExtent);a=a.map(t=>e.map(e=>t[e])),c=c?.map(t=>e.map(e=>t[e])),f=e.map(e=>f[e])}let m,d=e.noDataValues||this.rasterInfo.noDataValue,p={pixels:a,pixelType:e.pixelType};return null!=d&&((0,b.Sp)(p,d),m=p.mask),{location:i,value:null,dataSeries:f.map((e,t)=>{let i={value:0===m?.[t]?null:a.map(e=>e[t]),multidimensionalDefinition:e.multidimensionalDefinition.map(e=>new P.A({...e,isSlice:!0}))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i}),pyramidLevel:r}}};(0,l.Cg)([(0,u.MZ)()],L.prototype,"_rasterTileAlignmentInfo",void 0),(0,l.Cg)([(0,u.MZ)()],L.prototype,"_tileFetchQueue",void 0),(0,l.Cg)([(0,u.MZ)({readOnly:!0})],L.prototype,"_isGlobalWrappableSource",null),(0,l.Cg)([(0,u.MZ)({readOnly:!0})],L.prototype,"_hasNoneOrGCSShiftTransform",null),(0,l.Cg)([(0,u.MZ)()],L.prototype,"_openPromise",void 0),(0,l.Cg)([(0,u.MZ)()],L.prototype,"rasterJobHandler",null),(0,l.Cg)([(0,u.MZ)({readOnly:!0})],L.prototype,"rasterId",null),(0,l.Cg)([(0,u.MZ)(M.OZ)],L.prototype,"url",null),(0,l.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],L.prototype,"datasetName",void 0),(0,l.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],L.prototype,"datasetFormat",void 0),(0,l.Cg)([(0,u.MZ)()],L.prototype,"hasUniqueSourceStorageInfo",void 0),(0,l.Cg)([(0,u.MZ)()],L.prototype,"rasterInfo",void 0),(0,l.Cg)([(0,u.MZ)()],L.prototype,"ioConfig",void 0),(0,l.Cg)([(0,u.MZ)()],L.prototype,"sourceJSON",void 0),(0,l.Cg)([(0,u.MZ)()],L.prototype,"rawBlockRegistryIds",void 0),L=(0,l.Cg)([(0,u.$K)("esri.layers.raster.datasets.BaseRaster")],L)}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3500],{49859(e,t,i){i.d(t,{A:()=>L});var l=i(32198),r=i(56507),n=i(49186),o=i(25482),s=i(53966),a=i(17676),u=i(563),c=i(91429),h=i(78888),f=i(5443),m=i(86738),d=i(16930),p=i(7548),x=i(4366),g=i(37373);const y=new Map,I=new class{constructor(e=15e3,t=5e3,i=-1){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t),this._size=i}decreaseRefCount(e,t){let i=e+"/"+t,l=this._cachedBlocks;if(l.has(i)){let e=l.get(i);return e.refCount--,e.refCount<=0&&(l.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){let i=e+"/"+t,l=this._cachedBlocks;if(l.has(i)){let e=l.get(i);return e.ts=Date.now(),e.refCount++,l.delete(i),l.set(i,e),e.block}return null}putBlock(e,t,i,l){let r=this._cachedBlocks,n=e+"/"+t;if(r.has(n)){let e=r.get(n);e.ts=Date.now(),e.refCount++}else r.set(n,{block:i,ts:Date.now(),refCount:1,controller:l});this._trim(),this._updateTimer()}deleteBlock(e,t){let i=this._cachedBlocks,l=e+"/"+t;i.has(l)&&i.delete(l)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;let e=this._cachedBlocks;this._timer=setInterval(()=>{let t=Array.from(e),i=Date.now();for(let l=0;l<t.length&&t[l][1].ts<=i-this._duration;l++)e.delete(t[l][0]);0===e.size&&this._clearTimer()},this._interval)}_trim(){let e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;let t=Array.from(e).sort((e,t)=>e[1].refCount-t[1].refCount||e[1].ts-t[1].ts);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)}}(15e3,5e3,100);function w(e,t,i){let l=y.get(e);if(!l)return null==t?I.decreaseRefCount(e,i):0;if(null==t||null==l[t])return I.decreaseRefCount(e,i);let r=l[t]?.cache,n=r?.get(i);if(r&&n){if(n.refCount--,0===n.refCount){r.delete(i);for(let e=0;e<l.length;e++)l[e]?.cache.delete(i);n.controller&&n.controller.abort()}return n.refCount}return 0}function R(e,t,i){let l=y.get(e);if(!l)return null==t?I.getBlock(e,i):null;if(null==t||null==l[t]){for(let e=0;e<l.length;e++){let t=l[e]?.cache.get(i);if(t)return t.refCount++,t.block}return I.getBlock(e,i)}let r=l[t]?.cache.get(i);if(r)return r.refCount++,r.block;for(let e=0;e<l.length;e++){if(e===t||!l[e])continue;let r=l[e]?.cache,n=r?.get(i);if(r&&n)return n.refCount++,r.set(i,n),n.block}return null}function k(e,t,i,l,r=null){let n=y.get(e);if(!n)return void(t??I.putBlock(e,i,l,r));if(null==t||null==n[t])return void I.putBlock(e,i,l,r);let o={refCount:1,block:l,isResolved:!1,isRejected:!1,controller:r};l.then(()=>o.isResolved=!0).catch(()=>o.isRejected=!0),n[t]?.cache.set(i,o)}function _(e,t,i){let l=y.get(e);l?null!=t&&null!=l[t]?l[t]?.cache.delete(i):I.deleteBlock(e,i):t??I.deleteBlock(e,i)}var b=i(94778),v=i(96381),S=i(34930),C=i(47520),T=i(34251),B=i(60694),M=i(10873),P=i(45617),A=i(91806),z=i(20223),W=i(87045);let H=0,L=class extends o.o{constructor(){super(...arguments),this._tileFetchQueue=new u.QueueProcessor({concurrency:32,process:(e,t)=>this.fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"},this.rawBlockRegistryIds=[],this.refresh=(0,a.sg)(async e=>{await this._openPromise;let t=await this._refresh(e);return t.dataChanged&&function(e,t){let i=y.get(e);if(i){let e=t.map(e=>i[e]).filter(e=>null!=e);for(let t of e)t&&(Array.from(t.cache.values()).forEach(e=>{!e.isResolved&&!e.isRejected&&e.controller&&e.controller.abort()}),t.cache.clear())}}(this.rasterId,this.rawBlockRegistryIds),t})}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:W.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){let{rasterInfo:e}=this,t=(0,g.FT)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){let{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),(0,p.qg)(this)&&this.primaryRasters?.rasters?.forEach(t=>t.rasterJobHandler=e)}get rasterId(){return this.url||"rasterId-"+H++}set url(e){this._set("url",(0,B.Jf)(e,s.A.getLogger(this)))}async open(e){return this._openPromise??=(0,g.Hh)().then(()=>this._open(e)),this._openPromise}async fetchTile(e,t,i,l={}){let r=l.tileInfo||this.rasterInfo.storageInfo.tileInfo,o=this.getTileExtentFromTileInfo(e,t,i,r);if(!o)throw new n.A("imagery-tile:out-of-bounds","Level for fetch tile out of range");return l={noClip:!0,...l},this.fetchPixels(o,r.size[0],r.size[1],l)}async identify(e,t={}){e=(0,h.PZ)(m.A,e).clone().normalize();let{multidimensionalDefinition:i,timeExtent:l}=t,{rasterInfo:r}=this,{hasMultidimensionalTranspose:n,multidimensionalInfo:o}=r,{transposedVariableName:s}=t,a=null!=o&&n&&(null!=l||(0,x.DY)(i));a&&!s&&(s=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:s}),t=this._getRequestOptionsWithSliceId(t);let{spatialReference:u,extent:c}=r,{datumTransformation:d}=t,y=(0,g._I)(e,u,d);if(!c.intersects(y))return{location:y,value:null};if(null!=r.transform){let e=r.transform.inverseTransform(y);if(!r.nativeExtent.intersects(e))return{location:e,value:null};y=e}let I=null!=s&&null!=o&&r.hasMultidimensionalTranspose;if((0,p.qg)(this)){let e=this.primaryRasters.rasters[0];if(I)return e.identify(y,t);let{pixelSize:l}=r,n=3*l.x/2,o=3*l.y/2,s=new f.A({xmin:y.x-n,xmax:y.x+n,ymin:y.y-o,ymax:y.y+o,spatialReference:u}),a={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId,bandIds:t.bandIds},{pixelBlock:c}=await e.fetchPixels(s,3,3,a),{pixelBlock:h}=await this.fetchPixels(s,3,3,a);if(null==c)return{location:y,value:null};let m,d=!c.mask||c.mask[4]?c.pixels.map(e=>e[4]):null;return null!=h&&(m=!h.mask||h.mask[4]?h.pixels.map(e=>e[4]):void 0),{location:y,value:d,processedValue:m,pyramidLevel:0}}let w=0;if(!I){let{srcResolution:i}=t;if(i)i.spatialReference&&(i=(0,S.T5)(new m.A(i),u)),w=(0,g.t$)(i,r,this.ioConfig.sampling).pyramidLevel;else if(w=await this.computeBestPyramidLevelForLocation(e,t),null==w)return{location:y,value:null}}let R=this.identifyPixelLocation(y,w,null,I);if(null===R)return{location:y,value:null};let{row:k,col:_,rowOffset:b,colOffset:v,blockWidth:C}=R,T=await this._fetchRawTile(w,k,_,t);if(!T?.pixels?.length)return{location:y,value:null};let B=b*C+v;return this._processIdentifyResult(T,{srcLocation:y,position:B,pyramidLevel:w,useTransposedTile:!!I,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,l={}){e=(0,g.Ps)(e),l=this._getRequestOptionsWithSliceId(l);let{_hasNoneOrGCSShiftTransform:r}=this;if(l.requestRawData&&r)return this._fetchPixels(e,t,i,l);let n=(0,g.FT)(e.spatialReference),o=(0,g.OM)(e);if(null==n||0===o||1===o&&this._isGlobalWrappableSource&&r)return this._fetchPixels(e,t,i,l);if(o>=3)return{extent:e,pixelBlock:null};let s=[],{xmin:a,xmax:u}=e,c=Math.round(n/(u-a)*t),h=c-Math.round((n/2-a)/(u-a)*t),m=0,d=[];for(let r=0;r<=o;r++){let p=0===r?a:-n/2,x=r===o?u-n*r:n/2,g=new f.A({xmin:p,xmax:x,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),y=0===r?c-h:r===o?t-m:c;m+=y,d.push(y);let I=l.disableWrapAround&&r>0?null:this._fetchPixels(g,y,i,l);s.push(I)}let p=(await Promise.all(s)).map(e=>e?.pixelBlock),x=null,y={width:t,height:i};return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:d},l)).pixelBlock:(0,C.z7)(p,y,{blockWidths:d}),{extent:e,srcExtent:(0,g._l)(e,this.rasterInfo.spatialReference,l.datumTransformation),pixelBlock:x}}async fetchRawPixels(e,t,i,l={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};let r=await this._fetchRawTiles(e,t,i,l),{nativeExtent:n,nativePixelSize:o,storageInfo:s}=this.rasterInfo,a=2**e,u=o.x*a,c=o.y*a,h=new f.A({xmin:n.xmin+u*t.x,xmax:n.xmin+u*(t.x+i.width-1),ymin:n.ymax-c*(t.y+i.height-1),ymax:n.ymax-c*t.y,spatialReference:n.spatialReference});if(!r)return{extent:h,srcExtent:h,pixelBlock:null};let{pixelBlocks:m,mosaicSize:d}=r;if(1===m.length&&null!=m[0]&&m[0].width===i.width&&m[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:r.pixelBlocks[0]};let p,x=e>0?s.pyramidBlockWidth:s.blockWidth,g=e>0?s.pyramidBlockHeight:s.blockHeight,y={x:t.x%x,y:t.y%g};return p=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:d,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:l.interpolation,alignmentInfo:null,blockWidths:null},l)).pixelBlock:(0,C.z7)(m,d,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:p}}fetchRawTile(e,t,i,l){throw new n.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,g._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return this.rasterJobHandler?this.rasterJobHandler.decode({data:e,options:t}):(0,v.D)(e,t)}async request(e,t,i=0){let{customFetchParameters:l}=this.ioConfig,{range:n,query:o,headers:s}=t;i=i??t.retryCount??this.ioConfig.retryCount;let a=n?{Range:`bytes=${n.from}-${n.to}`}:null;try{return await(0,r.A)(e,{...t,query:{...o,...l},headers:{...s,...a}})}catch(l){if(i>0)return i--,this.request(e,t,i);throw l}}getSliceIndex(e){let{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,x.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,l){let r=l.lodAt(e);return r?this.getTileExtent({x:r.resolution,y:r.resolution},t,i,l.origin,l.spatialReference,l.size):null}updateTileInfo(){let{storageInfo:e,spatialReference:t,extent:i,pixelSize:l}=this.rasterInfo,{pyramidResolutions:r}=e;if(!e.tileInfo){let n=[],o=e.maximumPyramidLevel||0,s=(l.x+l.y)/2,a=1/.0254*96*s;for(let e=0;e<=o&&(n.unshift(new A.A({level:o-e,resolution:s,scale:a})),e!==o);e++)if(r){let t=(r[e].x+r[e].y)/2;a*=t/s,s=t}else s*=2,a*=2;let u=new m.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new W.A({origin:u,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:n}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,l){let{width:r,height:n,nativeExtent:o,pixelSize:s,spatialReference:a}=e,u=new m.A({x:o.xmin,y:o.ymax,spatialReference:a});l??=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8));let c=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[s],l);e.storageInfo=new z.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:u,firstPyramidLevel:1,maximumPyramidLevel:l,blockBoundary:c})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,l,r,n=0,o=2){if(1===r.length&&n>0){r=[...r];let{x:e,y:t}=r[0];for(let i=0;i<n;i++)e*=o,t*=o,r.push({x:e,y:t})}let s=[],{x:a,y:u}=l;for(let l=0;l<r.length;l++){let{x:n,y:o}=r[l];s.push({minCol:Math.floor((e.xmin-a+.1*n)/t/n),maxCol:Math.floor((e.xmax-a-.1*n)/t/n),minRow:Math.floor((u-e.ymax+.1*o)/i/o),maxRow:Math.floor((u-e.ymin-.1*o)/i/o)})}return s}getPyramidPixelSize(e){let{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:l}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];let r=l**e;return{x:t.x*r,y:t.y*r}}identifyPixelLocation(e,t,i,l){let{spatialReference:r,nativeExtent:n,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:s,origin:a,transposeInfo:u}=o,c=l&&null!=u?u.tileSize[0]:o.blockWidth,h=l&&null!=u?u.tileSize[1]:o.blockHeight,f=(0,g._I)(e,r,i);if(!n.intersects(f)||t<0||t>s)return null;let{x:m,y:d}=this.getPyramidPixelSize(t),p=(a.y-f.y)/d/h,x=(f.x-a.x)/m/c,y=Math.min(h-1,Math.floor((p-Math.floor(p))*h)),I=Math.min(c-1,Math.floor((x-Math.floor(x))*c));return{pyramidLevel:t,row:Math.floor(p),col:Math.floor(x),rowOffset:y,colOffset:I,blockWidth:c,srcLocation:f}}getTileExtent(e,t,i,l,r,n){let[o,s]=n,a=l.x+i*o*e.x,u=a+o*e.x,c=l.y-t*s*e.y,h=c-s*e.y;return new f.A({xmin:a,xmax:u,ymin:h,ymax:c,spatialReference:r})}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){let l=this.rasterInfo.storageInfo.blockBoundary[e];return!l||l.maxRow<t||l.maxCol<i||l.minRow>t||l.minCol>i}updateImageSpaceRasterInfo(e){let{pixelSize:t}=e,{width:i,height:l}=e,r=d.A.WebMercator;e.spatialReference=r,e.extent=e.nativeExtent=new f.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-l,spatialReference:r}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new m.A({x:1,y:1,spatialReference:r});let{extent:n,storageInfo:o}=e;if(o){o.origin=new m.A({x:n.xmin,y:n.ymax,spatialReference:r});let{pyramidResolutions:i,tileInfo:l}=o;if(i&&i.forEach(e=>{e.x/=t.x,e.y/=t.y}),l){l.origin=o.origin;let t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;l.lods.forEach((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254})}}}async _refresh(e){return{dataChanged:!0}}async _fetchPixels(e,t,i,l={}){let r=(0,g.OM)(e);if(r>=2)return{extent:e,pixelBlock:null};let n=this._getSourceDataInfo(e,t,i,l),{pyramidLevel:o,srcResolution:s,srcWidth:a,srcHeight:u,ul:c}=n,{srcExtent:h}=n;if(0===a||0===u)return{extent:e,srcExtent:h,pixelBlock:null};let{rasterInfo:f}=this,d=f.transform,p="gcs-shift"===d?.type,x=null!=(0,g.FT)(e.spatialReference);(p||!x)&&(r=(0,g.OM)(h,p));let y=await this._fetchRawTiles(o,c,{width:a,height:u,wrapCount:r},l);if(!y)return{extent:e,srcExtent:h,pixelBlock:null};h=y.extent;let I=f.storageInfo,w=o>0?I.pyramidBlockWidth:I.blockWidth,R=o>0?I.pyramidBlockHeight:I.blockHeight,{x:k,y:_}=f.pixelSize;if(o>0){let{pyramidResolutions:e,pyramidScalingFactor:t}=I;if(null!=e&&e[o-1])({x:k,y:_}=e[o-1]);else{let e=t**o;k*=e,_*=e}}let b=f.spatialReference,v=new m.A({x:k,y:_,spatialReference:b}),S=w===a&&R===u&&c.x%w===0&&c.y%R===0,B=new m.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),M=!e.spatialReference.equals(b),P=b.isGeographic?1e-9:1e-4,{datumTransformation:A}=l;if(!M&&S&&1===y.pixelBlocks.length&&w===t&&R===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(s,B,P))return{extent:e,srcExtent:h,srcTilePixelSize:v,pixelBlock:y.pixelBlocks[0]};let z=x&&null!=(0,g.FT)(h.spatialReference)&&this._hasNoneOrGCSShiftTransform,W=l.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");W&&!this.rasterJobHandler&&await(0,g.Hh)();let H,L=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:h,pixelSize:B.toJSON(),datumTransformation:A,rasterTransform:d,hasWrapAround:r>0||z,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:W},l):(0,g.l0)({projectedExtent:e,srcBufferExtent:h,pixelSize:B,datumTransformation:A,rasterTransform:d,hasWrapAround:r>0||z,isAdaptive:!1,includeGCSGrid:W}),O=!l.requestRawData,D={rows:L.spacing[0],cols:L.spacing[1]},E=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,h.xmin):void 0,{pixelBlocks:N,mosaicSize:F,isPartiallyFilled:q}=y,G=null;if(this.rasterJobHandler){let e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:N,srcMosaicSize:F,destDimension:O?{width:t,height:i}:null,coefs:O?L.coefficients:null,sampleSpacing:O?D:null,projectDirections:W,gcsGrid:W?L.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:l.interpolation,alignmentInfo:E,blockWidths:null},l);({pixelBlock:H,localNorthDirections:G}=e)}else{let e=(0,C.z7)(N,F,{alignmentInfo:E});H=O?(0,C.$i)(e,{width:t,height:i},L.coefficients,D,l.interpolation):e,W&&L.gcsGrid&&(G=(0,C.QF)({width:t,height:i},L.gcsGrid),H=(0,T.Y2)(H,this.rasterInfo.dataType,G))}return l.requestRawData||W?{extent:e,srcExtent:h,srcTilePixelSize:v,pixelBlock:H,transformGrid:L,localNorthDirections:G,isPartiallyFilled:q}:{extent:e,srcExtent:e,srcTilePixelSize:v,pixelBlock:H}}async _fetchRawTiles(e,t,i,l){let{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:s}=this.getBlockWidthHeight(e),{x:a,y:u}=t,{width:c,height:h,wrapCount:m}=i,d=this._getRasterTileAlignmentInfo(e,0);l.buffer&&(a-=l.buffer.cols,u-=l.buffer.rows,c+=2*l.buffer.cols,h+=2*l.buffer.rows);let p=0,x=0,g=0;m&&null!=d&&(({worldColumnCountFromOrigin:x,originColumnOffset:g,rightPadding:p}=d),x*d.blockWidth-p>=a+c&&(p=0));let y=Math.floor(a/o),I=Math.floor(u/s),w=Math.floor((a+c+p-1)/o),R=Math.floor((u+h+p-1)/s),k=n[e];if(!k)return null;let{minRow:_,minCol:b,maxCol:v,maxRow:S}=k;if(0===m&&(R<_||w<b||I>S||y>v))return null;let C=[],T=!1,B=null==this.ioConfig.allowPartialFill?l.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=I;t<=R;t++)for(let i=y;i<=w;i++){let r=i;if(!l.disableWrapAround&&m&&null!=d&&x<=i&&(r=i-x-g),t>=_&&r>=b&&S>=t&&v>=r){let i=this._fetchRawTile(e,t,r,l);B?C.push(new Promise(e=>{i.then(t=>e(t)).catch(()=>{T=!0,e(null)})})):C.push(i)}else C.push(Promise.resolve(null))}if(0===C.length)return null;let M=await Promise.all(C),P={height:(R-I+1)*s,width:(w-y+1)*o},{spatialReference:A}=this.rasterInfo,{x:z,y:W}=this.getPyramidPixelSize(e);return{extent:new f.A({xmin:r.x+y*o*z,xmax:r.x+(w+1)*o*z,ymin:r.y-(R+1)*s*W,ymax:r.y-I*s*W,spatialReference:A}),pixelBlocks:M,mosaicSize:P,isPartiallyFilled:T}}_fetchRawTile(e,t,i,l){let{storageInfo:r}=this.rasterInfo,n=null!=r.transposeInfo&&!!l.transposedVariableName;if(!n){let l=r.blockBoundary[e];if(!l)return Promise.resolve(null);let{minRow:n,minCol:o,maxCol:s,maxRow:a}=l;if(t<n||i<o||t>a||i>s)return Promise.resolve(null)}let o=n?l.transposeVariableName:l.sliceId,s=r.isBsqTile?l.bandIds:null,u=function(e,t,i){let l=[];return null!=t&&l.push(`sliceId=${t}`),null!=i&&l.push(`bandIds=${i.join(",")}`),l.length?`${e}?${l.join("&")}`:e}(this.rasterId,o,s),c=`${e}/${t}/${i}`,h=R(u,l.registryId,c);if(null==h){let n=new AbortController,o=l.bandIds?.slice();if(o?.length&&r.isBsqTile){let r=new Set(o),s=[],a=Array.from(r);for(let r of a)s.push(this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:{...l,bandIds:[r]}},{signal:n.signal}));h=Promise.all(s).then(e=>{if(e.some(e=>null==e))return null;if(a.length!==o.length){let t=[];for(let i of o){let l=e[a.indexOf(i)];t.includes(l)&&(l=l.clone()),t.push(l)}e=t}return this.rasterJobHandler?this.rasterJobHandler.compositeBands({pixelBlocks:e},{signal:n.signal,transferPixelsToWorker:!0}):(0,C.Wy)(e)})}else h=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:l},{signal:n.signal});k(u,l.registryId,c,h,n),h.catch(()=>_(u,l.registryId,c))}return l.signal&&(0,a.u7)(l,()=>{w(u,l.registryId,c)}),h}_computeMagDirValues(e){let{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;let l=e[0].length;if("vector-magdir"===i){let t=e[1].map(e=>(e+360)%360);return[e[0],t]}let[r,n]=e,o=[],s=[];for(let e=0;e<l;e++){let[t,i]=(0,T.Lu)([r[e],n[e]]);o.push(t),s.push(i)}return[o,s]}_getRasterTileAlignmentInfo(e,t){return this._rasterTileAlignmentInfo??=(0,g.DO)(this.rasterInfo),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,l={}){let r={datumTransformation:l.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};l.srcResolution&&(r.srcResolution=l.srcResolution,this._updateSourceDataInfo(e,r));let n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:s,pyramidLevel:a}=r,u=o/t,c=s/i,h=a<n&&u*c>=16,f=a===n&&this._requireTooManySrcTiles(o,s,t,i);if(h||f||0===o||0===s){let o=new m.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),s=(0,g.Wo)(o,this.rasterInfo.spatialReference,e,r.datumTransformation),f=!s||l.srcResolution&&s.x+s.y<l.srcResolution.x+l.srcResolution.y;if(h&&l.srcResolution&&f){let e=Math.round(Math.log(Math.max(u,c))/Math.LN2)-1;if(n-a+3>=e){let t=2**e;s={x:l.srcResolution.x*t,y:l.srcResolution.y*t}}}s&&(r.srcResolution=s,this._updateSourceDataInfo(e,r))}return this._requireTooManySrcTiles(r.srcWidth,r.srcHeight,t,i)&&(r.srcWidth=0,r.srcHeight=0),r}_requireTooManySrcTiles(e,t,i,l){let{tileInfo:r}=this.rasterInfo.storageInfo,n=e/i,o=t/l;return Math.ceil(e/r.size[0])*Math.ceil(t/r.size[1])>=256*Math.max(1,(i+l)/1024)||n>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;let{rasterInfo:i}=this,l=i.spatialReference,{srcResolution:r,datumTransformation:n}=t,{pyramidLevel:o,pyramidResolution:s,excessiveReading:a}=(0,g.t$)(r,i,this.ioConfig.sampling);if(a)return;let u=t.srcExtent||(0,g._l)(e,l,n);if(null==u)return;let c=i.transform;c&&(u=c.inverseTransform(u)),t.srcExtent=u;let{origin:h}=i.storageInfo,{width:f,height:m,ul:d}=(0,p.$g)(u,h,s,o);t.pyramidLevel=o,t.pyramidResolution=s,t.srcWidth=f,t.srcHeight=m,t.ul=d}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){let{srcLocation:i,position:l,pyramidLevel:r,useTransposedTile:n}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[l])return{location:i,value:null};let{multidimensionalInfo:s}=this.rasterInfo;if(null==s||!n){let t=e.pixels.map(e=>e[l]),n={location:i,value:t,pyramidLevel:r},o=this._computeMagDirValues(t.map(e=>[e]));return o?.length&&(n.magdirValue=o.map(e=>e[0])),n}let a=e.pixels.map(e=>e.slice(l*o,l*o+o)),u=this._computeMagDirValues(a),{requestSomeSlices:c,identifyOptions:h}=t,f=(0,x.QW)(s,h.transposedVariableName);if(c){let e=(0,x.xx)(f,h.multidimensionalDefinition,h.timeExtent);a=a.map(t=>e.map(e=>t[e])),u=u?.map(t=>e.map(e=>t[e])),f=e.map(e=>f[e])}let m,d=e.noDataValues||this.rasterInfo.noDataValue,p={pixels:a,pixelType:e.pixelType};return null!=d&&((0,b.Sp)(p,d),m=p.mask),{location:i,value:null,dataSeries:f.map((e,t)=>{let i={value:0===m?.[t]?null:a.map(e=>e[t]),multidimensionalDefinition:e.multidimensionalDefinition.map(e=>new P.A({...e,isSlice:!0}))};return u?.length&&(i.magdirValue=[u[0][t],u[1][t]]),i}),pyramidLevel:r}}};(0,l.Cg)([(0,c.MZ)()],L.prototype,"_rasterTileAlignmentInfo",void 0),(0,l.Cg)([(0,c.MZ)()],L.prototype,"_tileFetchQueue",void 0),(0,l.Cg)([(0,c.MZ)({readOnly:!0})],L.prototype,"_isGlobalWrappableSource",null),(0,l.Cg)([(0,c.MZ)({readOnly:!0})],L.prototype,"_hasNoneOrGCSShiftTransform",null),(0,l.Cg)([(0,c.MZ)()],L.prototype,"_openPromise",void 0),(0,l.Cg)([(0,c.MZ)()],L.prototype,"rasterJobHandler",null),(0,l.Cg)([(0,c.MZ)({readOnly:!0})],L.prototype,"rasterId",null),(0,l.Cg)([(0,c.MZ)(M.OZ)],L.prototype,"url",null),(0,l.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],L.prototype,"datasetName",void 0),(0,l.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],L.prototype,"datasetFormat",void 0),(0,l.Cg)([(0,c.MZ)()],L.prototype,"hasUniqueSourceStorageInfo",void 0),(0,l.Cg)([(0,c.MZ)()],L.prototype,"rasterInfo",void 0),(0,l.Cg)([(0,c.MZ)()],L.prototype,"ioConfig",void 0),(0,l.Cg)([(0,c.MZ)()],L.prototype,"sourceJSON",void 0),(0,l.Cg)([(0,c.MZ)()],L.prototype,"rawBlockRegistryIds",void 0),L=(0,l.Cg)([(0,c.$K)("esri.layers.raster.datasets.BaseRaster")],L)},330(e,t,i){function l(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";let r=[];if(t){let n=l(e,i);for(let e=0;e<n.length;e++)l(n[e],t).forEach(e=>r.push(e));return r}let n=e.getElementsByTagNameNS("*",i);if(!n||0===n.length)return[];for(let e=0;e<n.length;e++)r.push(n[e]||n.item(e));return r}function r(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="";let n=l(e,i);return n.length>0?t?r(n[0],t):n[0]:null}function n(e,t=null){let i,l=t?r(e,t):e;return l?(i=l.textContent||l.nodeValue,i?i.trim():null):null}function o(e,t){let i,r=l(e,t),n=[];for(let e=0;e<r.length;e++)i=r[e].textContent||r[e].nodeValue,i&&(i=i.trim(),""!==i&&n.push(i));return n}function s(e,t=null){return n(e,t)?.split(" ").map(e=>Number(e))??[]}function a(e,t){return o(e,t).map(e=>Number(e))}function u(e,t){let i=n(e,t);return Number(i)}function c(e,t){let i=e?.nodeName?.toLowerCase(),l=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===l}function h(e){return e.nodeName.slice(e.nodeName.lastIndexOf(":")+1)}i.d(t,{Dy:()=>o,IC:()=>l,Ui:()=>a,V6:()=>r,g7:()=>c,mX:()=>n,pN:()=>s,v7:()=>u,vv:()=>h})}}]);
|