@arcgis/core 4.26.0-next.20230213 → 4.26.0-next.20230214

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{4b41a08d603e846306da.js → 1faf0e2aeabe003e2f64.js} +1 -1
  3. package/assets/esri/core/workers/chunks/8111fc49f8e8f260981d.js +1 -0
  4. package/assets/esri/core/workers/chunks/979d5e22dbdcec90029f.js +1 -0
  5. package/assets/esri/core/workers/chunks/9f8aad19c5973e201604.js +1 -0
  6. package/assets/esri/core/workers/chunks/{21f1d91121d95ef21604.js → bb6e4affafef9855b8fd.js} +1 -1
  7. package/layers/graphics/sources/support/QueryTask.js +1 -1
  8. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  9. package/layers/support/rasterFunctions/LocalFunction.js +1 -1
  10. package/layers/support/rasterFunctions/LocalFunctionArguments.js +1 -1
  11. package/layers/support/rasterFunctions/localUtils.js +1 -1
  12. package/package.json +1 -1
  13. package/portal/PortalItem.js +1 -1
  14. package/rest/query/executeQuery.js +1 -1
  15. package/support/revision.js +1 -1
  16. package/views/2d/layers/MediaLayerView2D.js +1 -1
  17. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  18. package/views/3d/interactive/Manipulator3D.js +1 -1
  19. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  20. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  21. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  22. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  23. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  24. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  25. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  26. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  27. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  28. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  29. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  30. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  31. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  32. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  33. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  34. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  35. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  36. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  37. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  38. package/views/interactive/snapping/Settings.js +1 -1
  39. package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
  40. package/widgets/Editor/EditorViewModel.js +1 -1
  41. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  42. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  43. package/widgets/FeatureForm/InputField.js +1 -1
  44. package/assets/esri/core/workers/chunks/52e40e348c27a0e66f9a.js +0 -1
  45. package/assets/esri/core/workers/chunks/8be68f08c270c62e38bb.js +0 -1
  46. package/assets/esri/core/workers/chunks/978220022a8c9a3e9261.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6502],{3388:(e,t,s)=>{var r;s.d(t,{i:()=>r}),function(e){e[e.PROJECT_VERTICES=1]="PROJECT_VERTICES"}(r||(r={}))},61159:(e,t,s)=>{s.d(t,{g:()=>r});const r={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},6502:(e,t,s)=>{s.r(t),s.d(t,{default:()=>A});var r=s(43697),a=(s(66577),s(38171)),o=s(3172),n=s(92835),i=s(20102),u=s(80442),l=s(35454),d=s(83379),c=s(70586),p=s(78286),h=s(95330),y=s(17452),f=s(5600),m=(s(75215),s(67676),s(52011)),g=s(6570),_=s(33955),b=s(3388),F=s(25278),R=s(74654),S=s(66677),C=s(59431),I=s(82971);const q=new l.X({originalAndCurrentFeatures:"original-and-current-features",none:"none"});async function O(e){return"string"==typeof e?(0,y.sJ)(e)||{data:e}:new Promise(((t,s)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t((0,y.sJ)(r.result)),r.onerror=e=>s(e)}))}const w=new Set(["Feature Layer","Table"]),x=new l.X({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let T=class extends d.Z{constructor(){super(...arguments),this.type="feature-layer",this.refresh=(0,h.Ds)((async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}))}load(e){const t=(0,c.pC)(e)?e.signal:null,s=this.layer.sourceJSON;return this.addResolvingPromise(this._fetchService(s,t)),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:t,dynamicDataSource:s,infoFor3D:r,gdbVersion:a,spatialReference:o,fieldsIndex:n}=this.layer,i=(0,u.Z)("featurelayer-pbf")&&e?.query.supportsFormatPBF&&(0,c.Wi)(r),l=e?.operations?.supportsQueryAttachments??!1;return new R.Z({url:t.path,pbfSupported:i,fieldsIndex:n,infoFor3D:r,dynamicDataSource:s,gdbVersion:a,sourceSpatialReference:o,queryAttachmentsSupported:l})}async addAttachment(e,t){await this.load();const s=e.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+s+"/addAttachment",a=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(t,a.query);try{const e=await(0,o.default)(r,{body:n});return this._createFeatureEditResult(e.data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(s,e)}}async updateAttachment(e,t,s){await this.load();const r=e.attributes[this.layer.objectIdField],a=this.layer.parsedUrl.path+"/"+r+"/updateAttachment",n=this._getLayerRequestOptions({query:{attachmentId:t}}),i=this._getFormDataForAttachment(s,n.query);try{const e=await(0,o.default)(a,{body:i});return this._createFeatureEditResult(e.data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(r,e)}}async applyEdits(e,t){await this.load();const s=this.layer.infoFor3D,r=(0,c.pC)(s),a=r||(t?.globalIdUsed??!1),n=e.addFeatures?.map((e=>this._serializeFeature(e,s))).filter(c.pC)??[],i=e.updateFeatures?.map((e=>this._serializeFeature(e,s))).filter(c.pC)??[],u=this._getFeatureIds(e.deleteFeatures,a);(0,C.P)(n,i,this.layer.spatialReference);const l=[],d=[],p=[...e.deleteAttachments??[]];for(const t of e.addAttachments??[])l.push(await this._serializeAttachment(t));for(const t of e.updateAttachments??[])d.push(await this._serializeAttachment(t));const h=l.length||d.length||p.length?{adds:l,updates:d,deletes:p}:null;let y,f=null;if(r){f=new Map;const t=[];for(const s of e.addAssets??[])t.push(this._serializeAssetMapEditAndUploadAssets(s,f));const s=await Promise.all(t);y=s.length?{adds:s,updates:[],deletes:[]}:void 0}const m={gdbVersion:t?.gdbVersion||this.layer.gdbVersion,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:a,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,sessionId:t?.sessionId};t?.returnServiceEditsOption?(m.edits=JSON.stringify([{id:this.layer.layerId,adds:n,updates:i,deletes:u,attachments:h,assetMaps:(0,c.Wg)(y)}]),m.returnServiceEditsOption=q.toJSON(t?.returnServiceEditsOption),m.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(m.adds=n.length?JSON.stringify(n):null,m.updates=i.length?JSON.stringify(i):null,m.deletes=u.length?a?JSON.stringify(u):u.join(","):null,m.attachments=h&&JSON.stringify(h),m.assetMaps=(0,c.pC)(y)?JSON.stringify(y):void 0);const g=this._getLayerRequestOptions({method:"post",query:m}),_=t?.returnServiceEditsOption?this.layer.url:this.layer.parsedUrl.path,b=await(0,o.default)(_+"/applyEdits",g);if(r&&null!=b.data&&null!=b.data.assetMaps){const e=b.data,t=this.layer.objectIdField,s=[];for(const t of e.addResults)t.success&&s.push(t.objectId);for(const t of e.updateResults)t.success&&s.push(t.objectId);const r=this._createRequestQueryOptions(),a=await(0,o.default)(_+"/query",{...r,query:{f:"json",formatOf3DObjects:"3D_glb",where:`OBJECTID IN (${s.join(",")})`,outFields:`${t}`}});if(a&&a.data&&a.data.assetMaps&&(0,c.pC)(f)){const e=a.data.assetMaps;for(const t of e){const e=f.get(t.parentGlobalId).geometry;(0,c.pC)(e)&&"mesh"===e.type&&e.updateExternalSource({source:[{name:t.assetName,source:t.assetName}],extent:e.extent})}}}return this._createEditsResult(b)}async deleteAttachments(e,t){await this.load();const s=e.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+s+"/deleteAttachments";try{return(await(0,o.default)(r,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(this._createFeatureEditResult)}catch(e){throw this._createAttachmentErrorResult(s,e)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then((async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:r}=this.layer,{data:a}=await(0,o.default)(`${r}/${s}`,t),{id:i,extent:u,fullExtent:l,timeExtent:d}=a,c=u||l;return{id:i,fullExtent:c&&g.Z.fromJSON(c),timeExtent:d&&n.Z.fromJSON({start:d[0],end:d[1]})}}))}async queryAttachments(e,t={}){await this.load();const s=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,s)}async queryFeatures(e,t){return await this.load(),this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!(0,S.M8)(this.layer.url))return"unavailable";const e=(0,y.v_)(this.layer.url,"status"),t=await(0,o.default)(e,{query:{f:"json"}});return x.fromJSON(t.data.status)}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const{data:s}=await(0,o.default)(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:(0,u.Z)("featurelayer-advanced-symbols")?{returnAdvancedSymbols:!0}:{},signal:t}));e=s}this.sourceJSON=this._patchServiceJSON(e);const s=e.type;if(!w.has(s))throw new i.Z("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}_patchServiceJSON(e){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=(0,F.bU)(e.geometryType).renderer;(0,p.RB)("drawingInfo.renderer",t,e)}return"esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),e}_serializeFeature(e,t){const{geometry:s,attributes:r}=e;if((0,c.pC)(t)&&(0,c.pC)(e.geometry)&&"mesh"===e.geometry.type){const s={...r},a=e.geometry,o=a.origin,n=a.transform;if(s[t.transformFieldRoles.originX]=o.x,s[t.transformFieldRoles.originY]=o.y,s[t.transformFieldRoles.originZ]=o.z,(0,c.pC)(n)){const e=n.translation,r=n.scale,a=n.rotation;s[t.transformFieldRoles.translationX]=e[0],s[t.transformFieldRoles.translationY]=-e[2],s[t.transformFieldRoles.translationZ]=e[1],s[t.transformFieldRoles.scaleX]=r[0],s[t.transformFieldRoles.scaleY]=r[1],s[t.transformFieldRoles.scaleZ]=r[2],s[t.transformFieldRoles.rotationX]=a[0],s[t.transformFieldRoles.rotationY]=a[2],s[t.transformFieldRoles.rotationZ]=a[1],s[t.transformFieldRoles.rotationDeg]=a[3]}return{geometry:null,attributes:s}}return(0,c.Wi)(s)?{attributes:r}:"mesh"===s.type||"extent"===s.type?null:{geometry:s.toJSON(),attributes:r}}async _serializeAttachment(e){const{feature:t,attachment:s}=e,{globalId:r,name:a,contentType:o,data:n,uploadId:i}=s,u={globalId:r,parentGlobalId:null,contentType:null,name:null,uploadId:null,data:null};if(t&&(u.parentGlobalId="attributes"in t?t.attributes&&t.attributes[this.layer.globalIdField]:t.globalId),i)u.uploadId=i;else if(n){const e=await O(n);e&&(u.contentType=e.mediaType,u.data=e.data),n instanceof File&&(u.name=n.name)}return a&&(u.name=a),o&&(u.contentType=o),u}async _serializeAssetMapEditAndUploadAssets(e,t){const s=this.layer.url;let r=null;try{const t=new Blob([e.data],{type:e.mimeType}),a=new FormData;a.append("f","json"),a.append("file",t,`${e.assetName}`);const n={body:a,method:"post",responseType:"json"},{data:u}=await(0,o.default)(`${s}/uploads/upload`,n);if(!u.success)throw new i.Z("feature-layer-source:upload-failure","Expected upload to be successfull.");r={assetType:e.assetType,assetUploadId:u.item.itemID}}catch(e){r=null}if((0,c.Wi)(r)){const t=await O(new Blob([e.data]));if(!t.isBase64)throw new i.Z("feature-layer-source:uploadAssets-failure","Expected gltf data in base64 format after conversion.");r={assetType:e.assetType,assetData:t.data}}if((0,c.Wi)(r))throw new i.Z("feature-layer-source:uploadAssets-failure","Unable to prepare uploadAsset request options.");const a={method:"post",query:{f:"json",assets:JSON.stringify([r])},responseType:"json"},n=await(0,o.default)((0,y.v_)(this.layer.parsedUrl.path,"uploadAssets"),a);if(1!==n.data.uploadResults.length||!n.data.uploadResults[0].success)throw new i.Z("feature-layer-source:uploadAssets-failure","Bad response.");const u=n.data.uploadResults[0].assetHash,l=[];e.flags&b.i.PROJECT_VERTICES&&l.push("PROJECT_VERTICES");const d={globalId:e.assetMapGlobalId,parentGlobalId:e.featureGlobalId,assetName:e.assetName,assetHash:u,flags:l};return t.set(e.featureGlobalId,e.feature),d}_getFeatureIds(e,t){const s=e?.[0];return s?this._canUseGlobalIds(t,e)?this._getGlobalIdsFromFeatureIdentifier(e):"objectId"in s?this._getObjectIdsFromFeatureIdentifier(e):this._getIdsFromFeatures(e):[]}_getIdsFromFeatures(e){const t=this.layer.objectIdField;return e.map((e=>e.attributes&&e.attributes[t]))}_canUseGlobalIds(e,t){return e&&"globalId"in t[0]}_getObjectIdsFromFeatureIdentifier(e){return e.map((e=>e.objectId))}_getGlobalIdsFromFeatureIdentifier(e){return e.map((e=>e.globalId))}_createEditsResult(e){const t=e.data,{layerId:s}=this.layer,r=[];let a=null;if(Array.isArray(t))for(const e of t)r.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===s&&(a={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else a=t;const o=a?.attachments,n={addFeatureResults:a?.addResults?.map(this._createFeatureEditResult,this)??[],updateFeatureResults:a?.updateResults?.map(this._createFeatureEditResult,this)??[],deleteFeatureResults:a?.deleteResults?.map(this._createFeatureEditResult,this)??[],addAttachmentResults:o&&o.addResults?o.addResults.map(this._createFeatureEditResult,this):[],updateAttachmentResults:o&&o.updateResults?o.updateResults.map(this._createFeatureEditResult,this):[],deleteAttachmentResults:o&&o.deleteResults?o.deleteResults.map(this._createFeatureEditResult,this):[]};if(a?.editMoment&&(n.editMoment=a.editMoment),r.length>0){n.editedFeatureResults=[];for(const e of r){const{adds:t,updates:s,deletes:r,spatialReference:a}=e.editedFeatures,o=a?new I.Z(a):null;n.editedFeatureResults.push({layerId:e.id,editedFeatures:{adds:t?.map((e=>this._createEditedFeature(e,o)))||[],updates:s?.map((e=>({original:this._createEditedFeature(e[0],o),current:this._createEditedFeature(e[1],o)})))||[],deletes:r?.map((e=>this._createEditedFeature(e,o)))||[],spatialReference:o}})}}return n}_createEditedFeature(e,t){return new a.Z({attributes:e.attributes,geometry:(0,_.im)({...e.geometry,spatialReference:t})})}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new i.Z("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_createAttachmentErrorResult(e,t){const s=t.details.messages&&t.details.messages[0]||t.message,r=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i.Z("feature-layer-source:attachment-failure",s,{code:r})}}_getFormDataForAttachment(e,t){const s=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(s)for(const e in t){const r=t[e];null!=r&&(s.set?s.set(e,r):s.append(e,r))}return s}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:s,dynamicDataSource:r}=this.layer;return{...e,query:{gdbVersion:s,layer:r?JSON.stringify({source:r}):void 0,...t.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}};(0,r._)([(0,f.Cb)()],T.prototype,"type",void 0),(0,r._)([(0,f.Cb)({constructOnly:!0})],T.prototype,"layer",void 0),(0,r._)([(0,f.Cb)({readOnly:!0})],T.prototype,"queryTask",null),T=(0,r._)([(0,m.j)("esri.layers.graphics.sources.FeatureLayerSource")],T);const A=T},74654:(e,t,s)=>{s.d(t,{Z:()=>E});var r=s(43697),a=s(15923),o=s(20102),n=s(80442),i=s(70586),u=s(95330),l=s(17452),d=s(5600),c=(s(75215),s(67676),s(52011)),p=s(10158),h=s(11282),y=s(41818),f=(s(66577),s(34599)),m=s(14165),g=s(6570),_=s(5396),b=s(4967),F=s(69285),R=s(98732);function S(e,t){return t}function C(e,t,s,r){switch(s){case 0:return w(e,t+r,0);case 1:return"lowerLeft"===e.originPosition?w(e,t+r,1):function({translate:e,scale:t},s,r){return e[r]-s*t[r]}(e,t+r,1)}}function I(e,t,s,r){return 2===s?w(e,t,2):C(e,t,s,r)}function q(e,t,s,r){return 2===s?w(e,t,3):C(e,t,s,r)}function O(e,t,s,r){return 3===s?w(e,t,3):I(e,t,s,r)}function w({translate:e,scale:t},s,r){return e[r]+s*t[r]}class x{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=S,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=(0,F.k)(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(!(0,i.Wi)(t))for(const s of e.features)t(s.geometry)}createSpatialReference(){return{}}addField(e,t){const s=e.fields;(0,i.O3)(s),s.push(t);const r=s.map((e=>e.name));this._attributesConstructor=function(){for(const e of r)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,s)=>this.addCoordinatePoint(e,t,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,s)=>this._addCoordinatePolygon(e,t,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,s)=>this._addCoordinatePolyline(e,t,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,s)=>this._addCoordinateMultipoint(e,t,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,s){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:s,queryGeometryType:r}=t,a=(0,R.$g)(s.clone(),s,!1,!1,this._transform),o=(0,R.di)(a,r,!1,!1);e.queryGeometryType=r,e.queryGeometry={...o}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,s){const r=(0,i.s3)(this._transform,"transform");switch(t=this._applyTransform(r,t,s,0),s){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let s=0;t<=1&&(s=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const r=(0,i.s3)(this._transform,"transform");return this._applyTransform(r,e,t,s)}_addCoordinatePolyline(e,t,s){this._dehydratedAddPointsCoordinate(e.paths,t,s)}_addCoordinatePolygon(e,t,s){this._dehydratedAddPointsCoordinate(e.rings,t,s)}_addCoordinateMultipoint(e,t,s){0===s&&e.points.push([]);const r=this._transformPathLikeValue(t,s);e.points[e.points.length-1].push(r)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,s){0===s&&0==this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const r=this._transformPathLikeValue(t,s),a=e[e.length-1];0===s&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),a.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=r}_deriveApplyTransform(e){const{hasZ:t,hasM:s}=e;return t&&s?O:t?I:s?q:C}}var T=s(74889);let A=class extends a.Z{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return(0,l.mN)(this.url)}async execute(e,t){const s=await this.executeJSON(e,t);return this.featureSetFromJSON(e,s,t)}async executeJSON(e,t){const s=this._normalizeQuery(e),r=null!=e.outStatistics?.[0],a=(0,n.Z)("featurelayer-pbf-statistics"),o=!r||a;let i;if(this.pbfSupported&&o)try{i=await async function(e,t,s){const r=(0,h.en)(e),a={...s},o=m.Z.from(t),n=!o.quantizationParameters,{data:i}=await(0,f.qp)(r,o,new x({sourceSpatialReference:o.sourceSpatialReference,applyTransform:n}),a);return i}(this.url,s,t)}catch(e){if("query:parsing-pbf"!==e.name)throw e;this.pbfSupported=!1}return this.pbfSupported&&o||(i=await(0,b.F)(this.url,s,t)),this._normalizeFields(i.fields),i}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||(0,i.Wi)(this.infoFor3D)||!t.assetMaps||!t.features||!t.features.length)return T.Z.fromJSON(t);const{meshFeatureSetFromJSON:a}=await(0,u.Hl)(Promise.all([s.e(6481),s.e(6459),s.e(1932)]).then(s.bind(s,21932)),r);return a(e,this.infoFor3D,t)}executeForCount(e,t){return(0,y.P)(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return async function(e,t,s){const r=(0,h.en)(e);return(0,f.Vr)(r,m.Z.from(t),{...s}).then((e=>({count:e.data.count,extent:g.Z.fromJSON(e.data.extent)})))}(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return(0,_.G)(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:a}]=await(0,u.Hl)(Promise.all([s.e(5935).then(s.bind(s,75935)),s.e(1073).then(s.bind(s,81073))]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),a(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:a}]=await(0,u.Hl)(Promise.all([s.e(5935).then(s.bind(s,75935)),s.e(1073).then(s.bind(s,81073))]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),a(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:a,processAttachmentQueryResult:o}=await(0,u.Hl)(s.e(540).then(s.bind(s,30540)),t),n=(0,h.en)(this.url);return o(n,await(this.queryAttachmentsSupported?r(n,e,t):a(n,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await(0,u.Hl)(s.e(1158).then(s.bind(s,71158)),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await(0,u.Hl)(s.e(3992).then(s.bind(s,33992)),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await(0,u.Hl)(s.e(1790).then(s.bind(s,21790)),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await(0,u.Hl)(s.e(4371).then(s.bind(s,14371)),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=m.Z.from(e);if(t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?p.n.from(e.dynamicDataSource):this.dynamicDataSource),(0,i.pC)(this.infoFor3D)&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;for(const e of this.infoFor3D.queryFormats){if("3D_glb"===e){t.formatOf3DObjects=e;break}"3D_gltf"!==e||t.formatOf3DObjects||(t.formatOf3DObjects=e)}if(!t.formatOf3DObjects)throw new o.Z("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if((0,i.Wi)(t.outFields)||!t.outFields.includes("*")){t=t===e?t.clone():t,(0,i.Wi)(t.outFields)&&(t.outFields=[]);const{originX:s,originY:r,originZ:a,translationX:o,translationY:n,translationZ:u,scaleX:l,scaleY:d,scaleZ:c,rotationX:p,rotationY:h,rotationZ:y,rotationDeg:f}=this.infoFor3D.transformFieldRoles;t.outFields.push(s,r,a,o,n,u,l,d,c,p,h,y,f)}}return t}_normalizeFields(e){if((0,i.pC)(this.fieldsIndex)&&(0,i.pC)(e))for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return(0,i.pC)(this.infoFor3D)&&(0,i.pC)(e.returnGeometry)&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};(0,r._)([(0,d.Cb)({type:p.n})],A.prototype,"dynamicDataSource",void 0),(0,r._)([(0,d.Cb)()],A.prototype,"fieldsIndex",void 0),(0,r._)([(0,d.Cb)()],A.prototype,"gdbVersion",void 0),(0,r._)([(0,d.Cb)()],A.prototype,"infoFor3D",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],A.prototype,"parsedUrl",null),(0,r._)([(0,d.Cb)()],A.prototype,"pbfSupported",void 0),(0,r._)([(0,d.Cb)()],A.prototype,"queryAttachmentsSupported",void 0),(0,r._)([(0,d.Cb)()],A.prototype,"sourceSpatialReference",void 0),(0,r._)([(0,d.Cb)({type:String})],A.prototype,"url",void 0),A=(0,r._)([(0,c.j)("esri.tasks.QueryTask")],A);const E=A},25278:(e,t,s)=>{s.d(t,{Dm:()=>d,Hq:()=>c,MS:()=>p,bU:()=>i});var r=s(80442),a=s(22974),o=s(61159),n=s(58333);function i(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?n.I4:"esriGeometryPolyline"===e?n.ET:n.lF}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let l=1;function d(e,t){if((0,r.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let s=`this.${t} = null;`;for(const t in e)s+=`this${u.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const r=new Function(`\n return class AttributesClass$${l++} {\n constructor() {\n ${s};\n }\n }\n `)();return()=>new r}catch(s){return()=>({[t]:null,...e})}}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,a.d9)(e)}}]}function p(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0},query:o.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1}}}},41818:(e,t,s)=>{s.d(t,{P:()=>n});var r=s(11282),a=s(34599),o=s(14165);async function n(e,t,s){const n=(0,r.en)(e);return(0,a.hH)(n,o.Z.from(t),{...s}).then((e=>e.data.count))}},5396:(e,t,s)=>{s.d(t,{G:()=>n});var r=s(11282),a=s(34599),o=s(14165);async function n(e,t,s){const n=(0,r.en)(e);return(0,a.Ev)(n,o.Z.from(t),{...s}).then((e=>e.data.objectIds))}},4967:(e,t,s)=>{s.d(t,{F:()=>u,e:()=>i});var r=s(11282),a=s(34599),o=s(74889),n=s(14165);async function i(e,t,s){const r=await u(e,t,s);return o.Z.fromJSON(r)}async function u(e,t,s){const o=(0,r.en)(e),i={...s},u=n.Z.from(t),{data:l}=await(0,a.JT)(o,u,u.sourceSpatialReference,i);return l}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6502],{3388:(e,t,s)=>{var r;s.d(t,{i:()=>r}),function(e){e[e.PROJECT_VERTICES=1]="PROJECT_VERTICES"}(r||(r={}))},61159:(e,t,s)=>{s.d(t,{g:()=>r});const r={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},6502:(e,t,s)=>{s.r(t),s.d(t,{default:()=>A});var r=s(43697),a=(s(66577),s(38171)),o=s(3172),n=s(92835),i=s(20102),u=s(80442),l=s(35454),d=s(83379),c=s(70586),p=s(78286),h=s(95330),y=s(17452),f=s(5600),m=(s(75215),s(67676),s(52011)),g=s(6570),_=s(33955),b=s(3388),F=s(25278),R=s(74654),S=s(66677),C=s(59431),I=s(82971);const q=new l.X({originalAndCurrentFeatures:"original-and-current-features",none:"none"});async function O(e){return"string"==typeof e?(0,y.sJ)(e)||{data:e}:new Promise(((t,s)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t((0,y.sJ)(r.result)),r.onerror=e=>s(e)}))}const w=new Set(["Feature Layer","Table"]),x=new l.X({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let T=class extends d.Z{constructor(){super(...arguments),this.type="feature-layer",this.refresh=(0,h.Ds)((async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}))}load(e){const t=(0,c.pC)(e)?e.signal:null,s=this.layer.sourceJSON;return this.addResolvingPromise(this._fetchService(s,t)),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:t,dynamicDataSource:s,infoFor3D:r,gdbVersion:a,spatialReference:o,fieldsIndex:n}=this.layer,i=(0,u.Z)("featurelayer-pbf")&&e?.query.supportsFormatPBF&&(0,c.Wi)(r),l=e?.operations?.supportsQueryAttachments??!1;return new R.Z({url:t.path,pbfSupported:i,fieldsIndex:n,infoFor3D:r,dynamicDataSource:s,gdbVersion:a,sourceSpatialReference:o,queryAttachmentsSupported:l})}async addAttachment(e,t){await this.load();const s=e.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+s+"/addAttachment",a=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(t,a.query);try{const e=await(0,o.default)(r,{body:n});return this._createFeatureEditResult(e.data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(s,e)}}async updateAttachment(e,t,s){await this.load();const r=e.attributes[this.layer.objectIdField],a=this.layer.parsedUrl.path+"/"+r+"/updateAttachment",n=this._getLayerRequestOptions({query:{attachmentId:t}}),i=this._getFormDataForAttachment(s,n.query);try{const e=await(0,o.default)(a,{body:i});return this._createFeatureEditResult(e.data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(r,e)}}async applyEdits(e,t){await this.load();const s=this.layer.infoFor3D,r=(0,c.pC)(s),a=r||(t?.globalIdUsed??!1),n=e.addFeatures?.map((e=>this._serializeFeature(e,s))).filter(c.pC)??[],i=e.updateFeatures?.map((e=>this._serializeFeature(e,s))).filter(c.pC)??[],u=this._getFeatureIds(e.deleteFeatures,a);(0,C.P)(n,i,this.layer.spatialReference);const l=[],d=[],p=[...e.deleteAttachments??[]];for(const t of e.addAttachments??[])l.push(await this._serializeAttachment(t));for(const t of e.updateAttachments??[])d.push(await this._serializeAttachment(t));const h=l.length||d.length||p.length?{adds:l,updates:d,deletes:p}:null;let y,f=null;if(r){f=new Map;const t=[];for(const s of e.addAssets??[])t.push(this._serializeAssetMapEditAndUploadAssets(s,f));const s=await Promise.all(t);y=s.length?{adds:s,updates:[],deletes:[]}:void 0}const m={gdbVersion:t?.gdbVersion||this.layer.gdbVersion,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:a,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,sessionId:t?.sessionId};t?.returnServiceEditsOption?(m.edits=JSON.stringify([{id:this.layer.layerId,adds:n,updates:i,deletes:u,attachments:h,assetMaps:(0,c.Wg)(y)}]),m.returnServiceEditsOption=q.toJSON(t?.returnServiceEditsOption),m.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(m.adds=n.length?JSON.stringify(n):null,m.updates=i.length?JSON.stringify(i):null,m.deletes=u.length?a?JSON.stringify(u):u.join(","):null,m.attachments=h&&JSON.stringify(h),m.assetMaps=(0,c.pC)(y)?JSON.stringify(y):void 0);const g=this._getLayerRequestOptions({method:"post",query:m}),_=t?.returnServiceEditsOption?this.layer.url:this.layer.parsedUrl.path,b=await(0,o.default)(_+"/applyEdits",g);if(r&&null!=b.data&&null!=b.data.assetMaps){const e=b.data,t=this.layer.objectIdField,s=[];for(const t of e.addResults)t.success&&s.push(t.objectId);for(const t of e.updateResults)t.success&&s.push(t.objectId);const r=this._createRequestQueryOptions(),a=await(0,o.default)(_+"/query",{...r,query:{f:"json",formatOf3DObjects:"3D_glb",where:`OBJECTID IN (${s.join(",")})`,outFields:`${t}`}});if(a&&a.data&&a.data.assetMaps&&(0,c.pC)(f)){const e=a.data.assetMaps;for(const t of e){const e=f.get(t.parentGlobalId).geometry;(0,c.pC)(e)&&"mesh"===e.type&&e.updateExternalSource({source:[{name:t.assetName,source:t.assetName}],extent:e.extent})}}}return this._createEditsResult(b)}async deleteAttachments(e,t){await this.load();const s=e.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+s+"/deleteAttachments";try{return(await(0,o.default)(r,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(this._createFeatureEditResult)}catch(e){throw this._createAttachmentErrorResult(s,e)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then((async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:r}=this.layer,{data:a}=await(0,o.default)(`${r}/${s}`,t),{id:i,extent:u,fullExtent:l,timeExtent:d}=a,c=u||l;return{id:i,fullExtent:c&&g.Z.fromJSON(c),timeExtent:d&&n.Z.fromJSON({start:d[0],end:d[1]})}}))}async queryAttachments(e,t={}){await this.load();const s=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,s)}async queryFeatures(e,t){return await this.load(),this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!(0,S.M8)(this.layer.url))return"unavailable";const e=(0,y.v_)(this.layer.url,"status"),t=await(0,o.default)(e,{query:{f:"json"}});return x.fromJSON(t.data.status)}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const{data:s}=await(0,o.default)(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:(0,u.Z)("featurelayer-advanced-symbols")?{returnAdvancedSymbols:!0}:{},signal:t}));e=s}this.sourceJSON=this._patchServiceJSON(e);const s=e.type;if(!w.has(s))throw new i.Z("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}_patchServiceJSON(e){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=(0,F.bU)(e.geometryType).renderer;(0,p.RB)("drawingInfo.renderer",t,e)}return"esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),e}_serializeFeature(e,t){const{geometry:s,attributes:r}=e;if((0,c.pC)(t)&&(0,c.pC)(e.geometry)&&"mesh"===e.geometry.type){const s={...r},a=e.geometry,o=a.origin,n=a.transform;if(s[t.transformFieldRoles.originX]=o.x,s[t.transformFieldRoles.originY]=o.y,s[t.transformFieldRoles.originZ]=o.z,(0,c.pC)(n)){const e=n.translation,r=n.scale,a=n.rotation;s[t.transformFieldRoles.translationX]=e[0],s[t.transformFieldRoles.translationY]=-e[2],s[t.transformFieldRoles.translationZ]=e[1],s[t.transformFieldRoles.scaleX]=r[0],s[t.transformFieldRoles.scaleY]=r[1],s[t.transformFieldRoles.scaleZ]=r[2],s[t.transformFieldRoles.rotationX]=a[0],s[t.transformFieldRoles.rotationY]=a[2],s[t.transformFieldRoles.rotationZ]=a[1],s[t.transformFieldRoles.rotationDeg]=a[3]}return{geometry:null,attributes:s}}return(0,c.Wi)(s)?{attributes:r}:"mesh"===s.type||"extent"===s.type?null:{geometry:s.toJSON(),attributes:r}}async _serializeAttachment(e){const{feature:t,attachment:s}=e,{globalId:r,name:a,contentType:o,data:n,uploadId:i}=s,u={globalId:r,parentGlobalId:null,contentType:null,name:null,uploadId:null,data:null};if(t&&(u.parentGlobalId="attributes"in t?t.attributes&&t.attributes[this.layer.globalIdField]:t.globalId),i)u.uploadId=i;else if(n){const e=await O(n);e&&(u.contentType=e.mediaType,u.data=e.data),n instanceof File&&(u.name=n.name)}return a&&(u.name=a),o&&(u.contentType=o),u}async _serializeAssetMapEditAndUploadAssets(e,t){const s=this.layer.url;let r=null;try{const t=new Blob([e.data],{type:e.mimeType}),a=new FormData;a.append("f","json"),a.append("file",t,`${e.assetName}`);const n={body:a,method:"post",responseType:"json"},{data:u}=await(0,o.default)(`${s}/uploads/upload`,n);if(!u.success)throw new i.Z("feature-layer-source:upload-failure","Expected upload to be successfull.");r={assetType:e.assetType,assetUploadId:u.item.itemID}}catch(e){r=null}if((0,c.Wi)(r)){const t=await O(new Blob([e.data]));if(!t.isBase64)throw new i.Z("feature-layer-source:uploadAssets-failure","Expected gltf data in base64 format after conversion.");r={assetType:e.assetType,assetData:t.data}}if((0,c.Wi)(r))throw new i.Z("feature-layer-source:uploadAssets-failure","Unable to prepare uploadAsset request options.");const a={method:"post",query:{f:"json",assets:JSON.stringify([r])},responseType:"json"},n=await(0,o.default)((0,y.v_)(this.layer.parsedUrl.path,"uploadAssets"),a);if(1!==n.data.uploadResults.length||!n.data.uploadResults[0].success)throw new i.Z("feature-layer-source:uploadAssets-failure","Bad response.");const u=n.data.uploadResults[0].assetHash,l=[];e.flags&b.i.PROJECT_VERTICES&&l.push("PROJECT_VERTICES");const d={globalId:e.assetMapGlobalId,parentGlobalId:e.featureGlobalId,assetName:e.assetName,assetHash:u,flags:l};return t.set(e.featureGlobalId,e.feature),d}_getFeatureIds(e,t){const s=e?.[0];return s?this._canUseGlobalIds(t,e)?this._getGlobalIdsFromFeatureIdentifier(e):"objectId"in s?this._getObjectIdsFromFeatureIdentifier(e):this._getIdsFromFeatures(e):[]}_getIdsFromFeatures(e){const t=this.layer.objectIdField;return e.map((e=>e.attributes&&e.attributes[t]))}_canUseGlobalIds(e,t){return e&&"globalId"in t[0]}_getObjectIdsFromFeatureIdentifier(e){return e.map((e=>e.objectId))}_getGlobalIdsFromFeatureIdentifier(e){return e.map((e=>e.globalId))}_createEditsResult(e){const t=e.data,{layerId:s}=this.layer,r=[];let a=null;if(Array.isArray(t))for(const e of t)r.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===s&&(a={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else a=t;const o=a?.attachments,n={addFeatureResults:a?.addResults?.map(this._createFeatureEditResult,this)??[],updateFeatureResults:a?.updateResults?.map(this._createFeatureEditResult,this)??[],deleteFeatureResults:a?.deleteResults?.map(this._createFeatureEditResult,this)??[],addAttachmentResults:o&&o.addResults?o.addResults.map(this._createFeatureEditResult,this):[],updateAttachmentResults:o&&o.updateResults?o.updateResults.map(this._createFeatureEditResult,this):[],deleteAttachmentResults:o&&o.deleteResults?o.deleteResults.map(this._createFeatureEditResult,this):[]};if(a?.editMoment&&(n.editMoment=a.editMoment),r.length>0){n.editedFeatureResults=[];for(const e of r){const{adds:t,updates:s,deletes:r,spatialReference:a}=e.editedFeatures,o=a?new I.Z(a):null;n.editedFeatureResults.push({layerId:e.id,editedFeatures:{adds:t?.map((e=>this._createEditedFeature(e,o)))||[],updates:s?.map((e=>({original:this._createEditedFeature(e[0],o),current:this._createEditedFeature(e[1],o)})))||[],deletes:r?.map((e=>this._createEditedFeature(e,o)))||[],spatialReference:o}})}}return n}_createEditedFeature(e,t){return new a.Z({attributes:e.attributes,geometry:(0,_.im)({...e.geometry,spatialReference:t})})}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new i.Z("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_createAttachmentErrorResult(e,t){const s=t.details.messages&&t.details.messages[0]||t.message,r=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i.Z("feature-layer-source:attachment-failure",s,{code:r})}}_getFormDataForAttachment(e,t){const s=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(s)for(const e in t){const r=t[e];null!=r&&(s.set?s.set(e,r):s.append(e,r))}return s}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:s,dynamicDataSource:r}=this.layer;return{...e,query:{gdbVersion:s,layer:r?JSON.stringify({source:r}):void 0,...t.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}};(0,r._)([(0,f.Cb)()],T.prototype,"type",void 0),(0,r._)([(0,f.Cb)({constructOnly:!0})],T.prototype,"layer",void 0),(0,r._)([(0,f.Cb)({readOnly:!0})],T.prototype,"queryTask",null),T=(0,r._)([(0,m.j)("esri.layers.graphics.sources.FeatureLayerSource")],T);const A=T},74654:(e,t,s)=>{s.d(t,{Z:()=>E});var r=s(43697),a=s(15923),o=s(20102),n=s(80442),i=s(70586),u=s(95330),l=s(17452),d=s(5600),c=(s(75215),s(67676),s(52011)),p=s(10158),h=s(11282),y=s(41818),f=(s(66577),s(34599)),m=s(14165),g=s(6570),_=s(5396),b=s(4967),F=s(69285),R=s(98732);function S(e,t){return t}function C(e,t,s,r){switch(s){case 0:return w(e,t+r,0);case 1:return"lowerLeft"===e.originPosition?w(e,t+r,1):function({translate:e,scale:t},s,r){return e[r]-s*t[r]}(e,t+r,1)}}function I(e,t,s,r){return 2===s?w(e,t,2):C(e,t,s,r)}function q(e,t,s,r){return 2===s?w(e,t,3):C(e,t,s,r)}function O(e,t,s,r){return 3===s?w(e,t,3):I(e,t,s,r)}function w({translate:e,scale:t},s,r){return e[r]+s*t[r]}class x{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=S,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=(0,F.k)(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(!(0,i.Wi)(t))for(const s of e.features)t(s.geometry)}createSpatialReference(){return{}}addField(e,t){const s=e.fields;(0,i.O3)(s),s.push(t);const r=s.map((e=>e.name));this._attributesConstructor=function(){for(const e of r)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,s)=>this.addCoordinatePoint(e,t,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,s)=>this._addCoordinatePolygon(e,t,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,s)=>this._addCoordinatePolyline(e,t,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,s)=>this._addCoordinateMultipoint(e,t,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,s){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:s,queryGeometryType:r}=t,a=(0,R.$g)(s.clone(),s,!1,!1,this._transform),o=(0,R.di)(a,r,!1,!1);e.queryGeometryType=r,e.queryGeometry={...o}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,s){const r=(0,i.s3)(this._transform,"transform");switch(t=this._applyTransform(r,t,s,0),s){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let s=0;t<=1&&(s=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const r=(0,i.s3)(this._transform,"transform");return this._applyTransform(r,e,t,s)}_addCoordinatePolyline(e,t,s){this._dehydratedAddPointsCoordinate(e.paths,t,s)}_addCoordinatePolygon(e,t,s){this._dehydratedAddPointsCoordinate(e.rings,t,s)}_addCoordinateMultipoint(e,t,s){0===s&&e.points.push([]);const r=this._transformPathLikeValue(t,s);e.points[e.points.length-1].push(r)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,s){0===s&&0==this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const r=this._transformPathLikeValue(t,s),a=e[e.length-1];0===s&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),a.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=r}_deriveApplyTransform(e){const{hasZ:t,hasM:s}=e;return t&&s?O:t?I:s?q:C}}var T=s(74889);let A=class extends a.Z{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return(0,l.mN)(this.url)}async execute(e,t){const s=await this.executeJSON(e,t);return this.featureSetFromJSON(e,s,t)}async executeJSON(e,t){const s=this._normalizeQuery(e),r=null!=e.outStatistics?.[0],a=(0,n.Z)("featurelayer-pbf-statistics"),o=!r||a;let i;if(this.pbfSupported&&o)try{i=await async function(e,t,s){const r=(0,h.en)(e),a={...s},o=m.Z.from(t),n=!o.quantizationParameters,{data:i}=await(0,f.qp)(r,o,new x({sourceSpatialReference:o.sourceSpatialReference,applyTransform:n}),a);return i}(this.url,s,t)}catch(e){if("query:parsing-pbf"!==e.name)throw e;this.pbfSupported=!1}return this.pbfSupported&&o||(i=await(0,b.F)(this.url,s,t)),this._normalizeFields(i.fields),i}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||(0,i.Wi)(this.infoFor3D)||!t.assetMaps||!t.features||!t.features.length)return T.Z.fromJSON(t);const{meshFeatureSetFromJSON:a}=await(0,u.Hl)(Promise.all([s.e(6481),s.e(6459),s.e(1932)]).then(s.bind(s,21932)),r);return a(e,this.infoFor3D,t)}executeForCount(e,t){return(0,y.P)(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return async function(e,t,s){const r=(0,h.en)(e);return(0,f.Vr)(r,m.Z.from(t),{...s}).then((e=>({count:e.data.count,extent:g.Z.fromJSON(e.data.extent)})))}(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return(0,_.G)(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:a}]=await(0,u.Hl)(Promise.all([s.e(5935).then(s.bind(s,75935)),s.e(1073).then(s.bind(s,81073))]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),a(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:a}]=await(0,u.Hl)(Promise.all([s.e(5935).then(s.bind(s,75935)),s.e(1073).then(s.bind(s,81073))]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),a(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:a,processAttachmentQueryResult:o}=await(0,u.Hl)(s.e(540).then(s.bind(s,30540)),t),n=(0,h.en)(this.url);return o(n,await(this.queryAttachmentsSupported?r(n,e,t):a(n,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await(0,u.Hl)(s.e(1158).then(s.bind(s,71158)),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await(0,u.Hl)(s.e(3992).then(s.bind(s,33992)),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await(0,u.Hl)(s.e(1790).then(s.bind(s,21790)),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await(0,u.Hl)(s.e(4371).then(s.bind(s,14371)),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=m.Z.from(e);if(t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?p.n.from(e.dynamicDataSource):this.dynamicDataSource),(0,i.pC)(this.infoFor3D)&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;for(const e of this.infoFor3D.queryFormats){if("3D_glb"===e){t.formatOf3DObjects=e;break}"3D_gltf"!==e||t.formatOf3DObjects||(t.formatOf3DObjects=e)}if(!t.formatOf3DObjects)throw new o.Z("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if((0,i.Wi)(t.outFields)||!t.outFields.includes("*")){t=t===e?t.clone():t,(0,i.Wi)(t.outFields)&&(t.outFields=[]);const{originX:s,originY:r,originZ:a,translationX:o,translationY:n,translationZ:u,scaleX:l,scaleY:d,scaleZ:c,rotationX:p,rotationY:h,rotationZ:y,rotationDeg:f}=this.infoFor3D.transformFieldRoles;t.outFields.push(s,r,a,o,n,u,l,d,c,p,h,y,f)}}return t}_normalizeFields(e){if((0,i.pC)(this.fieldsIndex)&&(0,i.pC)(e))for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return(0,i.pC)(this.infoFor3D)&&!0===e.returnGeometry&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};(0,r._)([(0,d.Cb)({type:p.n})],A.prototype,"dynamicDataSource",void 0),(0,r._)([(0,d.Cb)()],A.prototype,"fieldsIndex",void 0),(0,r._)([(0,d.Cb)()],A.prototype,"gdbVersion",void 0),(0,r._)([(0,d.Cb)()],A.prototype,"infoFor3D",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],A.prototype,"parsedUrl",null),(0,r._)([(0,d.Cb)()],A.prototype,"pbfSupported",void 0),(0,r._)([(0,d.Cb)()],A.prototype,"queryAttachmentsSupported",void 0),(0,r._)([(0,d.Cb)()],A.prototype,"sourceSpatialReference",void 0),(0,r._)([(0,d.Cb)({type:String})],A.prototype,"url",void 0),A=(0,r._)([(0,c.j)("esri.tasks.QueryTask")],A);const E=A},25278:(e,t,s)=>{s.d(t,{Dm:()=>d,Hq:()=>c,MS:()=>p,bU:()=>i});var r=s(80442),a=s(22974),o=s(61159),n=s(58333);function i(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?n.I4:"esriGeometryPolyline"===e?n.ET:n.lF}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let l=1;function d(e,t){if((0,r.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let s=`this.${t} = null;`;for(const t in e)s+=`this${u.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const r=new Function(`\n return class AttributesClass$${l++} {\n constructor() {\n ${s};\n }\n }\n `)();return()=>new r}catch(s){return()=>({[t]:null,...e})}}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,a.d9)(e)}}]}function p(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0},query:o.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1}}}},41818:(e,t,s)=>{s.d(t,{P:()=>n});var r=s(11282),a=s(34599),o=s(14165);async function n(e,t,s){const n=(0,r.en)(e);return(0,a.hH)(n,o.Z.from(t),{...s}).then((e=>e.data.count))}},5396:(e,t,s)=>{s.d(t,{G:()=>n});var r=s(11282),a=s(34599),o=s(14165);async function n(e,t,s){const n=(0,r.en)(e);return(0,a.Ev)(n,o.Z.from(t),{...s}).then((e=>e.data.objectIds))}},4967:(e,t,s)=>{s.d(t,{F:()=>u,e:()=>i});var r=s(11282),a=s(34599),o=s(74889),n=s(14165);async function i(e,t,s){const r=await u(e,t,s);return o.Z.fromJSON(r)}async function u(e,t,s){const o=(0,r.en)(e),i={...s},u=n.Z.from(t),{data:l}=await(0,a.JT)(o,u,u.sourceSpatialReference,i);return l}}}]);
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Error.js";import has from"../../../../core/has.js";import{isNone as o,isSome as s}from"../../../../core/maybe.js";import{whenOrAbort as i}from"../../../../core/promiseUtils.js";import{urlToObject as u}from"../../../../core/urlUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{DataLayerSource as c}from"../../../support/source/DataLayerSource.js";import{parseUrl as p}from"../../../../rest/utils.js";import{executeForCount as l}from"../../../../rest/query/executeForCount.js";import{executeForExtent as m}from"../../../../rest/query/executeForExtent.js";import{executeForIds as y}from"../../../../rest/query/executeForIds.js";import{executeRawQueryJSON as d}from"../../../../rest/query/executeQueryJSON.js";import{executeRawQueryPBF as f}from"../../../../rest/query/executeQueryPBF.js";import h from"../../../../rest/support/FeatureSet.js";import S from"../../../../rest/support/Query.js";let F=class extends t{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return u(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),o=null!=e.outStatistics?.[0],s=has("featurelayer-pbf-statistics"),i=!o||s;let u;if(this.pbfSupported&&i)try{u=await f(this.url,r,t)}catch(a){if("query:parsing-pbf"!==a.name)throw a;this.pbfSupported=!1}return this.pbfSupported&&i||(u=await d(this.url,r,t)),this._normalizeFields(u.fields),u}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||o(this.infoFor3D)||!t.assetMaps||!t.features||!t.features.length)return h.fromJSON(t);const{meshFeatureSetFromJSON:s}=await i(import("../../../../rest/support/meshFeatureSet.js"),r);return s(e,this.infoFor3D,t)}executeForCount(e,t){return l(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return m(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return y(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:o}]=await i(Promise.all([import("../../../../rest/support/RelationshipQuery.js"),import("../../../../rest/query/executeRelationshipQuery.js")]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:o}]=await i(Promise.all([import("../../../../rest/support/RelationshipQuery.js"),import("../../../../rest/query/executeRelationshipQuery.js")]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:o,processAttachmentQueryResult:s}=await i(import("../../../../rest/query/operations/queryAttachments.js"),t),u=p(this.url);return s(u,await(this.queryAttachmentsSupported?r(u,e,t):o(u,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await i(import("../../../../rest/query/executeTopFeaturesQuery.js"),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await i(import("../../../../rest/query/executeForTopIds.js"),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await i(import("../../../../rest/query/executeForTopExtents.js"),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await i(import("../../../../rest/query/executeForTopCount.js"),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=S.from(e);if(t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?c.from(e.dynamicDataSource):this.dynamicDataSource),s(this.infoFor3D)&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;for(const e of this.infoFor3D.queryFormats){if("3D_glb"===e){t.formatOf3DObjects=e;break}"3D_gltf"!==e||t.formatOf3DObjects||(t.formatOf3DObjects=e)}if(!t.formatOf3DObjects)throw new r("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(o(t.outFields)||!t.outFields.includes("*")){t=t===e?t.clone():t,o(t.outFields)&&(t.outFields=[]);const{originX:r,originY:s,originZ:i,translationX:u,translationY:a,translationZ:n,scaleX:c,scaleY:p,scaleZ:l,rotationX:m,rotationY:y,rotationZ:d,rotationDeg:f}=this.infoFor3D.transformFieldRoles;t.outFields.push(r,s,i,u,a,n,c,p,l,m,y,d,f)}}return t}_normalizeFields(e){if(s(this.fieldsIndex)&&s(e))for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return s(this.infoFor3D)&&s(e.returnGeometry)&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};e([a({type:c})],F.prototype,"dynamicDataSource",void 0),e([a()],F.prototype,"fieldsIndex",void 0),e([a()],F.prototype,"gdbVersion",void 0),e([a()],F.prototype,"infoFor3D",void 0),e([a({readOnly:!0})],F.prototype,"parsedUrl",null),e([a()],F.prototype,"pbfSupported",void 0),e([a()],F.prototype,"queryAttachmentsSupported",void 0),e([a()],F.prototype,"sourceSpatialReference",void 0),e([a({type:String})],F.prototype,"url",void 0),F=e([n("esri.tasks.QueryTask")],F);const x=F;export{x as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Error.js";import has from"../../../../core/has.js";import{isNone as o,isSome as s}from"../../../../core/maybe.js";import{whenOrAbort as i}from"../../../../core/promiseUtils.js";import{urlToObject as u}from"../../../../core/urlUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{DataLayerSource as c}from"../../../support/source/DataLayerSource.js";import{parseUrl as p}from"../../../../rest/utils.js";import{executeForCount as l}from"../../../../rest/query/executeForCount.js";import{executeForExtent as m}from"../../../../rest/query/executeForExtent.js";import{executeForIds as y}from"../../../../rest/query/executeForIds.js";import{executeRawQueryJSON as d}from"../../../../rest/query/executeQueryJSON.js";import{executeRawQueryPBF as f}from"../../../../rest/query/executeQueryPBF.js";import h from"../../../../rest/support/FeatureSet.js";import S from"../../../../rest/support/Query.js";let F=class extends t{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return u(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),o=null!=e.outStatistics?.[0],s=has("featurelayer-pbf-statistics"),i=!o||s;let u;if(this.pbfSupported&&i)try{u=await f(this.url,r,t)}catch(a){if("query:parsing-pbf"!==a.name)throw a;this.pbfSupported=!1}return this.pbfSupported&&i||(u=await d(this.url,r,t)),this._normalizeFields(u.fields),u}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||o(this.infoFor3D)||!t.assetMaps||!t.features||!t.features.length)return h.fromJSON(t);const{meshFeatureSetFromJSON:s}=await i(import("../../../../rest/support/meshFeatureSet.js"),r);return s(e,this.infoFor3D,t)}executeForCount(e,t){return l(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return m(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return y(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:o}]=await i(Promise.all([import("../../../../rest/support/RelationshipQuery.js"),import("../../../../rest/query/executeRelationshipQuery.js")]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:o}]=await i(Promise.all([import("../../../../rest/support/RelationshipQuery.js"),import("../../../../rest/query/executeRelationshipQuery.js")]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:o,processAttachmentQueryResult:s}=await i(import("../../../../rest/query/operations/queryAttachments.js"),t),u=p(this.url);return s(u,await(this.queryAttachmentsSupported?r(u,e,t):o(u,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await i(import("../../../../rest/query/executeTopFeaturesQuery.js"),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await i(import("../../../../rest/query/executeForTopIds.js"),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await i(import("../../../../rest/query/executeForTopExtents.js"),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await i(import("../../../../rest/query/executeForTopCount.js"),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=S.from(e);if(t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?c.from(e.dynamicDataSource):this.dynamicDataSource),s(this.infoFor3D)&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;for(const e of this.infoFor3D.queryFormats){if("3D_glb"===e){t.formatOf3DObjects=e;break}"3D_gltf"!==e||t.formatOf3DObjects||(t.formatOf3DObjects=e)}if(!t.formatOf3DObjects)throw new r("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(o(t.outFields)||!t.outFields.includes("*")){t=t===e?t.clone():t,o(t.outFields)&&(t.outFields=[]);const{originX:r,originY:s,originZ:i,translationX:u,translationY:a,translationZ:n,scaleX:c,scaleY:p,scaleZ:l,rotationX:m,rotationY:y,rotationZ:d,rotationDeg:f}=this.infoFor3D.transformFieldRoles;t.outFields.push(r,s,i,u,a,n,c,p,l,m,y,d,f)}}return t}_normalizeFields(e){if(s(this.fieldsIndex)&&s(e))for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return s(this.infoFor3D)&&!0===e.returnGeometry&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};e([a({type:c})],F.prototype,"dynamicDataSource",void 0),e([a()],F.prototype,"fieldsIndex",void 0),e([a()],F.prototype,"gdbVersion",void 0),e([a()],F.prototype,"infoFor3D",void 0),e([a({readOnly:!0})],F.prototype,"parsedUrl",null),e([a()],F.prototype,"pbfSupported",void 0),e([a()],F.prototype,"queryAttachmentsSupported",void 0),e([a()],F.prototype,"sourceSpatialReference",void 0),e([a({type:String})],F.prototype,"url",void 0),F=e([n("esri.tasks.QueryTask")],F);const x=F;export{x as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{JSONSupport as s}from"../../../core/JSONSupport.js";import{isSome as e,isNone as r}from"../../../core/maybe.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../../core/accessorSupport/decorators/cast.js";import"../../../core/arrayUtils.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";let a=class extends s{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}bind(t,s=!1,r=-1){this.id=r+1;const i=this._getRasterValues();let n=!0;for(let o=0;o<i.length;o++){const r=i[o];if(e(r)&&this._isRasterFunctionValue(r)){const e=r.bind(t,s,this.id+o);if(!e.success)return this._bindingResult=e,e;n=n&&e.supportsGPU}}return!this.rasterInfo||s?(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),this._bindingResult.supportsGPU=n&&this._bindingResult.supportsGPU,this.processInputBandIds(),this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},this.processInputBandIds(),this._bindingResult)}process(t){const s=this._getRasterValues(),e=0===s.length?t.pixelBlocks??t.primaryPixelBlocks:s.map((s=>this._readRasterValue(s,t)));return this._processPixels({...t,pixelBlocks:e})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let s;if(t.length>1){const s=t.map((t=>t.processInputBandIds()[0]));this.rawInputBandIds=s,this.isInputBandIdsSwizzled=this.rawInputBandIds.some(((t,s)=>t!==s));const e=t.filter((t=>"ExtractBand"===t.functionName));return e.length&&e.forEach(((t,s)=>{t.isInputBandIdsSwizzled=!0,t.swizzledBandSelection=[s,s,s]})),this.rawInputBandIds}const e=t[0];if(e){if(s=e.processInputBandIds(),e.isInputBandIdsSwizzled)return this.rawInputBandIds=s,s}else{s=[];const{bandCount:t}=this.sourceRasterInfos[0];for(let e=0;e<t;e++)s.push(e)}const r=this._getInputBandIds(s);return this.isInputBandIdsSwizzled=r.some(((t,s)=>t!==s)),this.rawInputBandIds=r,this.rawInputBandIds}getPrimaryRasters(){const t=[],s=[];return this._getPrimaryRasters(this,t,s),{rasters:t,rasterIds:s}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:s,rasters:e}=this.functionArguments;return e&&Array.isArray(e)&&e.length?(t.rasters=e.map((t=>this._isRasterFunctionValue(t)?t.getWebGLProcessorDefinition():"number"==typeof t?{name:"Constant",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1})),t.rasters.some((t=>null!=t))||(t.rasters=null)):this._isRasterFunctionValue(s)&&(t.raster=s.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getFlatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const s=[t],{parameters:e}=t;let r=e.rasters||e.raster&&[e.raster];for(;r?.length;){s.unshift(...r);const t=[];for(let s=0;s<r.length;s++){const{parameters:e}=r[s],i=e.rasters||e.raster&&[e.raster];i?.length&&t.push(...i)}r=t}for(let n=s.length-1;n>=0;n--)s[n].isNoopProcess&&s.splice(n,1);let i=!1;for(let n=0;n<s.length;n++){const t=s[n];t.id=s.length-n-1;const{rasters:e}=t.parameters;i=i||null!=e&&e.length>1}return{hasBranches:i,functions:s}}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_isOutputRoundingNeeded(){const{outputPixelType:t}=this;return(t?.startsWith("u")||t?.startsWith("s"))??!1}_getRasterValues(){const{rasterArgumentNames:t}=this;return"rasters"===t[0]?this.functionArguments.rasters??[]:t.map((t=>this.functionArguments[t]))}_getSourceRasterInfos(t){const s=this._getRasterValues(),{rasterInfos:e,rasterIds:r}=t;return 0===s.length?e:s.map((t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&r.includes(t)?e[r.indexOf(t)]:e[0]))}_getPrimaryRasterId(t){return t?.url}_getPrimaryRasters(t,s=[],e=[]){for(let r=0;r<t.sourceRasters.length;r++){const i=t.sourceRasters[r];if("number"!=typeof i)if("bind"in i)this._getPrimaryRasters(i,s,e);else{const t=i,r=this._getPrimaryRasterId(t);if(null==r)continue;e.includes(r)||(this.mainPrimaryRasterId===r?(s.unshift(t),e.unshift(r)):(s.push(t),e.push(r)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,s){const{primaryPixelBlocks:e}=s;if(r(t)||"$$"===t){const t=e[0];return r(t)?null:t.clone()}if("string"==typeof t){const r=s.primaryRasterIds.indexOf(t);return-1===r?null:e[r]}if("number"==typeof t){const s=e[0];if(r(s))return null;const i=new Float32Array(s.width*s.height);i.fill(t);const n=s.clone();return n.pixels=n.pixels.map((()=>i)),n}return t.process(s)}};t([i({json:{write:!0}})],a.prototype,"functionName",void 0),t([i({json:{write:!0}})],a.prototype,"functionArguments",void 0),t([i()],a.prototype,"rasterArgumentNames",void 0),t([i({json:{write:!0}}),n((t=>t?.toLowerCase()))],a.prototype,"outputPixelType",void 0),t([i({json:{write:!0}})],a.prototype,"mainPrimaryRasterId",void 0),t([i()],a.prototype,"sourceRasters",void 0),t([i({json:{write:!0}})],a.prototype,"sourceRasterInfos",void 0),t([i({json:{write:!0}})],a.prototype,"rasterInfo",void 0),t([i({json:{write:!0}})],a.prototype,"readingBufferSize",void 0),t([i({json:{write:!0}})],a.prototype,"id",void 0),t([i()],a.prototype,"isNoopProcess",void 0),t([i()],a.prototype,"supportsGPU",null),t([i()],a.prototype,"rawInputBandIds",void 0),t([i()],a.prototype,"isInputBandIdsSwizzled",void 0),t([i()],a.prototype,"swizzledBandSelection",void 0),t([i()],a.prototype,"isBranch",void 0),t([i()],a.prototype,"_bindingResult",void 0),a=t([o("esri.layers.support.rasterFunctions.BaseRasterFunction")],a);const u=a;export{u as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{JSONSupport as s}from"../../../core/JSONSupport.js";import{isSome as e,isNone as r}from"../../../core/maybe.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../../core/accessorSupport/decorators/cast.js";import"../../../core/arrayUtils.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../PixelBlock.js";import u from"../RasterInfo.js";let p=class extends s{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}bind(t,s=!1,r=-1){this.id=r+1;const i=this._getRasterValues();let n=!0;for(let o=0;o<i.length;o++){const r=i[o];if(e(r)&&this._isRasterFunctionValue(r)){const e=r.bind(t,s,this.id+o);if(!e.success)return this._bindingResult=e,e;n=n&&e.supportsGPU}}return!this.rasterInfo||s?(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),this._bindingResult.supportsGPU=n&&this._bindingResult.supportsGPU,this.processInputBandIds(),this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},this.processInputBandIds(),this._bindingResult)}process(t){const s=this._getRasterValues(),e=0===s.length?t.pixelBlocks??t.primaryPixelBlocks:s.map((s=>this._readRasterValue(s,t)));return this._processPixels({...t,pixelBlocks:e})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let s;if(t.length>1){const s=t.map((t=>t.processInputBandIds()[0]));this.rawInputBandIds=s,this.isInputBandIdsSwizzled=this.rawInputBandIds.some(((t,s)=>t!==s));const e=t.filter((t=>"ExtractBand"===t.functionName));return e.length&&e.forEach(((t,s)=>{t.isInputBandIdsSwizzled=!0,t.swizzledBandSelection=[s,s,s]})),this.rawInputBandIds}const e=t[0];if(e){if(s=e.processInputBandIds(),e.isInputBandIdsSwizzled)return this.rawInputBandIds=s,s}else{s=[];const{bandCount:t}=this.sourceRasterInfos[0];for(let e=0;e<t;e++)s.push(e)}const r=this._getInputBandIds(s);return this.isInputBandIdsSwizzled=r.some(((t,s)=>t!==s)),this.rawInputBandIds=r,this.rawInputBandIds}getPrimaryRasters(){const t=[],s=[];return this._getPrimaryRasters(this,t,s),{rasters:t,rasterIds:s}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:s,rasters:e}=this.functionArguments;return e&&Array.isArray(e)&&e.length?(t.rasters=e.map((t=>this._isRasterFunctionValue(t)?t.getWebGLProcessorDefinition():"number"==typeof t?{name:"Constant",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1})),t.rasters.some((t=>null!=t))||(t.rasters=null)):this._isRasterFunctionValue(s)&&(t.raster=s.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getFlatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const s=[t],{parameters:e}=t;let r=e.rasters||e.raster&&[e.raster];for(;r?.length;){s.unshift(...r);const t=[];for(let s=0;s<r.length;s++){const{parameters:e}=r[s],i=e.rasters||e.raster&&[e.raster];i?.length&&t.push(...i)}r=t}for(let n=s.length-1;n>=0;n--)s[n].isNoopProcess&&s.splice(n,1);let i=!1;for(let n=0;n<s.length;n++){const t=s[n];t.id=s.length-n-1;const{rasters:e}=t.parameters;i=i||null!=e&&e.length>1}return{hasBranches:i,functions:s}}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_isOutputRoundingNeeded(){const{outputPixelType:t}=this;return(t?.startsWith("u")||t?.startsWith("s"))??!1}_getRasterValues(){const{rasterArgumentNames:t}=this;return"rasters"===t[0]?this.functionArguments.rasters??[]:t.map((t=>this.functionArguments[t]))}_getSourceRasterInfos(t){const s=this._getRasterValues(),{rasterInfos:e,rasterIds:r}=t;if(0===s.length)return e;const i=s.map((t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&r.includes(t)?e[r.indexOf(t)]:"number"!=typeof t?e[0]:void 0)),n=i.find((t=>t))??e[0];return i.forEach(((t,s)=>{void 0===t&&(i[s]=n)})),i}_getPrimaryRasterId(t){return t?.url}_getPrimaryRasters(t,s=[],e=[]){for(let r=0;r<t.sourceRasters.length;r++){const i=t.sourceRasters[r];if("number"!=typeof i)if("bind"in i)this._getPrimaryRasters(i,s,e);else{const t=i,r=this._getPrimaryRasterId(t);if(null==r)continue;e.includes(r)||(this.mainPrimaryRasterId===r?(s.unshift(t),e.unshift(r)):(s.push(t),e.push(r)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,s){const{primaryPixelBlocks:e}=s;if(r(t)||"$$"===t){const t=e[0];return r(t)?null:t.clone()}if("string"==typeof t){const r=s.primaryRasterIds.indexOf(t);return-1===r?null:e[r]}if("number"==typeof t){const s=e[0];if(r(s))return null;const{width:i,height:n,pixelType:o,mask:u}=s,p=u?new Uint8Array(u):null,l=new Float32Array(i*n);l.fill(t);const d=this.sourceRasterInfos[0].bandCount,c=new Array(d).fill(l);return new a({width:i,height:n,pixelType:o,pixels:c,mask:p})}return t.process(s)}};t([i({json:{write:!0}})],p.prototype,"functionName",void 0),t([i({json:{write:!0}})],p.prototype,"functionArguments",void 0),t([i()],p.prototype,"rasterArgumentNames",void 0),t([i({json:{write:!0}}),n((t=>t?.toLowerCase()))],p.prototype,"outputPixelType",void 0),t([i({json:{write:!0}})],p.prototype,"mainPrimaryRasterId",void 0),t([i()],p.prototype,"sourceRasters",void 0),t([i({type:[u],json:{write:!0}})],p.prototype,"sourceRasterInfos",void 0),t([i({json:{write:!0}})],p.prototype,"rasterInfo",void 0),t([i({json:{write:!0}})],p.prototype,"readingBufferSize",void 0),t([i({json:{write:!0}})],p.prototype,"id",void 0),t([i()],p.prototype,"isNoopProcess",void 0),t([i()],p.prototype,"supportsGPU",null),t([i()],p.prototype,"rawInputBandIds",void 0),t([i()],p.prototype,"isInputBandIdsSwizzled",void 0),t([i()],p.prototype,"swizzledBandSelection",void 0),t([i()],p.prototype,"isBranch",void 0),t([i()],p.prototype,"_bindingResult",void 0),p=t([o("esri.layers.support.rasterFunctions.BaseRasterFunction")],p);const l=p;export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{isNone as s}from"../../../core/maybe.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{localOperators as r}from"../rasterFunctionConstants.js";import{getPixelValueRange as n}from"../rasterFormats/pixelRangeUtils.js";import i from"./BaseRasterFunction.js";import u from"./LocalFunctionArguments.js";import{operandsCount as a,getOutputDomain as c,local as p}from"./localUtils.js";let m=class extends i{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,s=t[0],{bandCount:e}=s,{processAsMultiband:o}=this.functionArguments;if(o&&t.some((t=>t.bandCount!==e)))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:n}=this.functionArguments,i=a[r];if(!(999===i||n.length===i||n.length<=1&&1===i))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${i}`};this.outputPixelType=this._getOutputPixelType("f32");const u=s.clone();u.pixelType=this.outputPixelType,u.statistics=null,u.histograms=null,u.colormap=null,u.attributeTable=null,o||(u.bandCount=1);const p=c(r);if(p){u.statistics=[];for(let t=0;t<u.bandCount;t++)u.statistics[t]={min:p[0],max:p[1],avg:(p[0]+p[1])/2,stddev:(p[0]+p[1])/10}}this.rasterInfo=u;return{success:!0,supportsGPU:!o&&i<=3&&(r<11||r>16)}}_processPixels(t){const{pixelBlocks:e}=t;return s(e)||e.some((t=>s(t)))?null:p(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,s=a[t],e=Object.keys(r).find((s=>r[s]===t))?.toLowerCase()??"undefined",o=this.outputPixelType??"f32";let[i,u]=n(o);const c=o.startsWith("u")||o.startsWith("s");return c&&(i-=1e-4,u+=1e-4),{imageCount:s,operationName:e,domainRange:[i,u],isOutputRounded:c}}};t([e({json:{write:!0,name:"rasterFunction"}})],m.prototype,"functionName",void 0),t([e({type:u,json:{write:!0,name:"rasterFunctionArguments"}})],m.prototype,"functionArguments",void 0),t([e()],m.prototype,"rasterArgumentNames",void 0),m=t([o("esri.layers.support.rasterFunctions.LocalFunction")],m);const l=m;export{l as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{isNone as s}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{localOperators as r}from"../rasterFunctionConstants.js";import{getPixelValueRange as n}from"../rasterFormats/pixelRangeUtils.js";import i from"./BaseRasterFunction.js";import u from"./LocalFunctionArguments.js";import{operandsCount as a,getOutputDomain as c,local as p}from"./localUtils.js";let m=class extends i{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,s=t[0],{bandCount:o}=s,{processAsMultiband:e}=this.functionArguments;if(t.some((t=>t.bandCount!==o)))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:n}=this.functionArguments,i=a[r];if(!(999===i||n.length===i||n.length<=1&&1===i))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${i}`};this.outputPixelType=this._getOutputPixelType("f32");const u=s.clone();u.pixelType=this.outputPixelType,u.statistics=null,u.histograms=null,u.colormap=null,u.attributeTable=null,u.bandCount=999!==i||e?o:1;const p=c(r);if(p){u.statistics=[];for(let t=0;t<u.bandCount;t++)u.statistics[t]={min:p[0],max:p[1],avg:(p[0]+p[1])/2,stddev:(p[0]+p[1])/10}}this.rasterInfo=u;return{success:!0,supportsGPU:1===u.bandCount&&i<=3&&(r<11||r>16)}}_processPixels(t){const{pixelBlocks:o}=t;return s(o)||o.some((t=>s(t)))?null:p(o,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,s=a[t],o=Object.keys(r).find((s=>r[s]===t))?.toLowerCase()??"undefined",e=this.outputPixelType??"f32";let[i,u]=n(e);const c=e.startsWith("u")||e.startsWith("s");return c&&(i-=1e-4,u+=1e-4),{imageCount:s,operationName:o,domainRange:[i,u],isOutputRounded:c}}};t([o({json:{write:!0,name:"rasterFunction"}})],m.prototype,"functionName",void 0),t([o({type:u,json:{write:!0,name:"rasterFunctionArguments"}})],m.prototype,"functionArguments",void 0),t([o()],m.prototype,"rasterArgumentNames",void 0),m=t([e("esri.layers.support.rasterFunctions.LocalFunction")],m);const l=m;export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../../chunks/tslib.es6.js";import{clone as s}from"../../../core/lang.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{writer as e}from"../../../core/accessorSupport/decorators/writer.js";import p from"./BaseFunctionArguments.js";var a;let i=a=class extends p{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!1}writeRasters(r,s){s.rasters=r.map((r=>"number"==typeof r||"string"==typeof r?r:r.toJSON()))}clone(){return new a({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:s(this.rasters)})}};r([o({json:{write:!0}})],i.prototype,"operation",void 0),r([o({json:{write:!0}})],i.prototype,"rasters",void 0),r([e("rasters")],i.prototype,"writeRasters",null),r([o({json:{write:!0}})],i.prototype,"processAsMultiband",void 0),i=a=r([t("esri.layers.support.rasterFunctions.LocalFunctionArguments")],i);const c=i;export{c as default};
5
+ import{_ as r}from"../../../chunks/tslib.es6.js";import{clone as s}from"../../../core/lang.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import{writer as e}from"../../../core/accessorSupport/decorators/writer.js";import p from"./BaseFunctionArguments.js";var a;let i=a=class extends p{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(r,s){s.rasters=r.map((r=>"number"==typeof r||"string"==typeof r?r:r.toJSON()))}clone(){return new a({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:s(this.rasters)})}};r([o({json:{write:!0}})],i.prototype,"operation",void 0),r([o({json:{write:!0}})],i.prototype,"rasters",void 0),r([e("rasters")],i.prototype,"writeRasters",null),r([o({json:{write:!0}})],i.prototype,"processAsMultiband",void 0),i=a=r([t("esri.layers.support.rasterFunctions.LocalFunctionArguments")],i);const c=i;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t}from"../../../core/maybe.js";import e from"../PixelBlock.js";import{localTrigonometricOperation as n,localLogicalOperation as r,localConditionalOperation as o}from"../rasterFunctionConstants.js";import{getPixelValueRange as s}from"../rasterFormats/pixelRangeUtils.js";const a=new Map;function l(t){return a.get(t)}a.set(n.acos,[0,Math.PI]),a.set(n.asin,[-Math.PI/2,Math.PI/2]),a.set(n.atan,[-Math.PI/2,Math.PI/2]),a.set(n.cos,[-1,1]),a.set(n.sin,[-1,1]),a.set(r.booleanAnd,[0,1]),a.set(r.booleanNot,[0,1]),a.set(r.booleanOr,[0,1]),a.set(r.booleanXOr,[0,1]),a.set(r.equalTo,[0,1]),a.set(r.notEqual,[0,1]),a.set(r.greaterThan,[0,1]),a.set(r.greaterThanEqual,[0,1]),a.set(r.lessThan,[0,1]),a.set(r.lessThanEqual,[0,1]),a.set(r.isNull,[0,1]);const c=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function f(e,n=!1){const r=e.map((t=>t.mask)),o=r.filter((e=>t(e))),s=e[0].pixels[0].length;if(0===o.length)return new Uint8Array(s).fill(255);const a=o[0],l=new Uint8Array(a);if(1===o.length)return l;if(!n){for(let t=1;t<o.length;t++){const e=o[t];for(let t=0;t<l.length;t++)l[t]&&(l[t]=e[t]?255:0)}return l}if(o.length!==r.length)return new Uint8Array(s).fill(255);for(let t=1;t<o.length;t++){const e=o[t];for(let t=0;t<l.length;t++)0===l[t]&&(l[t]=e[t]?255:0)}return l}function u(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]+s[e]);return l}function h(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand("f32",s);return a.set(o),a}function i(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]-s[e]);return l}function g(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]*s[e]);return l}function p(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand(r,s);for(let e=0;e<s;e++)n&&!n[e]||(a[e]=Math.sign(o[e])*Math.floor(Math.abs(o[e])));return a}function m(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]/s[e]);return l}function y(t,e,n){return m(t,e,"f32")}function d(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=Math.floor(o[e]/s[e]));return l}function M(t,r,o,s){const a=t[0],l=a.length,c=e.createEmptyBand(o,l);if(s===n.atanh){for(let t=0;t<l;t++)if(r[t]){const e=a[t];Math.abs(e)>=1?r[t]=0:c[t]=Math.atanh(e)}return c}const f=s===n.asin?Math.asin:Math.acos;for(let e=0;e<l;e++)if(r[e]){const t=a[e];Math.abs(t)>1?r[e]=0:c[e]=f(t)}return c}function E(t,n,r,o){const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o(s[e]));return l}function B(t,n,r,o){const[s,a]=t,l=s.length,c=e.createEmptyBand(r,l);for(let e=0;e<l;e++)n&&!n[e]||(c[e]=o(s[e],a[e]));return c}function w(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]&s[e]);return l}function b(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]<<s[e]);return l}function x(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand(r,s);for(let e=0;e<s;e++)n&&!n[e]||(a[e]=~o[e]);return a}function A(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]|s[e]);return l}function k(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]>>s[e]);return l}function N(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]^s[e]);return l}function P(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]&&s[e]?1:0);return l}function T(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand(r,s);for(let e=0;e<s;e++)n&&!n[e]||(a[e]=o[e]?0:1);return a}function q(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]||s[e]?1:0);return l}function U(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=(o[e]?1:0)^(s[e]?1:0));return l}function I(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]===s[e]?1:0);return l}function j(t,n,r,o){const[s]=t,a=s.length,l=e.createEmptyBand(r,a),c=o===Math.E;for(let e=0;e<a;e++)n&&!n[e]||(l[e]=c?Math.exp(s[e]):o**s[e]);return l}function F(t,e,n){return j(t,e,n,10)}function z(t,e,n){return j(t,e,n,2)}function O(t,e,n){return j(t,e,n,Math.E)}function W(t,n,r,o){const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(s[e]<=0?n[e]=0:l[e]=o(s[e]));return l}function C(t,e,n){return W(t,e,n,Math.log10)}function R(t,e,n){return W(t,e,n,Math.log2)}function S(t,e,n){return W(t,e,n,Math.log)}function X(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]>s[e]?1:0);return l}function v(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]>=s[e]?1:0);return l}function D(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]<s[e]?1:0);return l}function G(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]<=s[e]?1:0);return l}function H(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand(r,s);if(!n)return a;for(let e=0;e<s;e++)a[e]=n[e]?0:1;return a}function J(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]%s[e]);return l}function K(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand(r,s);for(let e=0;e<s;e++)n&&!n[e]||(a[e]=-o[e]);return a}function L(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]===s[e]?0:1);return l}function Q(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a),c=new Uint8Array(a);for(let e=0;e<a;e++)null!=n&&!n[e]||0!==o[e]||(l[e]=s[e],c[e]=255);return{band:l,mask:c}}function V(t,n,r){const[o,s,a]=t,l=o.length,c=e.createEmptyBand(r,l);for(let e=0;e<l;e++)n&&!n[e]||(c[e]=o[e]?s[e]:a[e]);return c}function Y(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e]){let n=s[e];for(let r=1;r<o;r++){const o=t[r][e];n<o&&(n=o)}l[e]=n}return l}function Z(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e]){let n=s[e];for(let r=1;r<o;r++){const o=t[r][e];n>o&&(n=o)}l[e]=n}return l}function $(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e]){let n=s[e],r=n;for(let s=1;s<o;s++){const o=t[s][e];r<o?r=o:n>o&&(n=o)}l[e]=r-n}return l}function _(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e]){let n=0;for(let r=0;r<o;r++)n+=t[r][e];l[e]=n/o}return l}function tt(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e])for(let n=0;n<o;n++){const r=t[n];l[e]+=r[e]}return l}function et(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e]){const n=new Float32Array(o);let r=0;for(let a=0;a<o;a++){const o=t[a];r+=o[e],n[a]=o[e]}r/=o;let s=0;for(let t=0;t<o;t++)s+=(n[t]-r)**2;l[e]=Math.sqrt(s/o)}return l}function nt(t,n,r){const o=t.length;if(o<2)return t[0];const s=Math.floor(o/2),[a]=t,l=a.length,c=e.createEmptyBand(r,l),f=new Float32Array(o),u=o%2==1;for(let e=0;e<l;e++)if(!n||n[e]){for(let n=0;n<o;n++)f[n]=t[n][e];f.sort(),c[e]=u?f[s]:(f[s]+f[s-1])/2}return c}function rt(t,n,r){const[o,s]=t;if(null==s)return o;const a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n[e]&&(o[e]===s[e]?l[e]=o[e]:n[e]=0);return l}function ot(t,n,r){const o=t.length;if(o<=2)return rt(t,n,r);const s=t[0].length,a=e.createEmptyBand(r,s),l=new Map;for(let e=0;e<s;e++)if(!n||n[e]){let n;l.clear();for(let a=0;a<o;a++)n=t[a][e],l.set(n,l.has(n)?l.get(n)+1:1);let r=0,s=0;for(const t of l.keys())r=l.get(t),r>s&&(s=r,n=t);a[e]=n}return a}function st(t,n,r){const o=t.length;if(o<=2)return rt(t,n,r);const s=t[0].length,a=e.createEmptyBand(r,s),l=new Map;for(let e=0;e<s;e++)if(!n||n[e]){let n;l.clear();for(let a=0;a<o;a++)n=t[a][e],l.set(n,l.has(n)?l.get(n)+1:1);let r=0,s=t.length;for(const t of l.keys())r=l.get(t),r<s&&(s=r,n=t);a[e]=n}return a}function at(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a),c=new Set;for(let e=0;e<a;e++)if(!n||n[e]){let n;c.clear();for(let r=0;r<o;r++)n=t[r][e],c.add(n);l[e]=c.size}return l}const lt=new Map,ct=new Map,ft=new Map,ut=new Map;function ht(){lt.size||(lt.set(4,Math.sqrt),lt.set(6,Math.acos),lt.set(7,Math.asin),lt.set(8,Math.atan),lt.set(9,Math.atanh),lt.set(10,Math.abs),lt.set(21,Math.cos),lt.set(22,Math.cosh),lt.set(48,Math.floor),lt.set(49,Math.ceil),lt.set(51,Math.sin),lt.set(52,Math.sinh),lt.set(56,Math.tan),lt.set(57,Math.tanh),lt.set(59,Math.acosh),lt.set(60,Math.asinh),lt.set(65,Math.floor),ct.set(5,Math.pow),ct.set(61,Math.atan2),ft.set(1,u),ft.set(2,i),ft.set(3,g),ft.set(11,w),ft.set(12,b),ft.set(12,b),ft.set(13,x),ft.set(14,A),ft.set(15,k),ft.set(16,N),ft.set(17,P),ft.set(18,T),ft.set(19,q),ft.set(20,U),ft.set(23,m),ft.set(24,I),ft.set(25,O),ft.set(26,F),ft.set(27,z),ft.set(28,X),ft.set(29,v),ft.set(30,p),ft.set(31,H),ft.set(32,h),ft.set(33,D),ft.set(34,G),ft.set(35,S),ft.set(36,C),ft.set(37,R),ft.set(44,J),ft.set(45,K),ft.set(46,L),ft.set(64,y),ft.set(65,d),ft.set(76,V),ft.set(78,V),ut.set(38,ot),ut.set(39,Y),ut.set(40,_),ut.set(41,nt),ut.set(42,Z),ut.set(43,st),ut.set(47,$),ut.set(54,et),ut.set(55,tt),ut.set(58,at),ut.set(66,ot),ut.set(67,Y),ut.set(68,_),ut.set(69,nt),ut.set(70,Z),ut.set(71,st),ut.set(72,$),ut.set(73,et),ut.set(74,tt),ut.set(75,at))}function it(t,e,n,r){let[o,a]=s(n);const l=n.startsWith("u")||n.startsWith("s");l&&(o-=1e-5,a+=1e-5);for(let s=0;s<e.length;s++)if(e[s]){const n=t[s];isNaN(n)||n<o||n>a?e[s]=0:r[s]=l?Math.round(n):n}}function gt(t,s,l={}){ht();let c=f(t,s>=66&&s<=75);const{processAsMultiband:u,outputPixelType:h="f32"}=l,i=u?t[0].pixels.length:1,g=[];for(let f=0;f<i;f++){const l=ut.has(s)&&!u?t.flatMap((t=>t.pixels)):t.map((t=>t.pixels[f]));let i,p=!0;if(s===o.setNull){const t=Q(l,c,h);i=t.band,c=t.mask,p=!1}else if(ft.has(s)){i=ft.get(s)(l,c,"f64")}else if(lt.has(s))i=s===n.asin||s===n.acos||s===n.atanh?M(l,c,"f64",s):E(l,c,"f64",lt.get(s));else if(ct.has(s))i=B(l,c,"f64",ct.get(s));else if(ut.has(s)){i=ut.get(s)(l,c,"f64")}else i=l[0],p=!1;if(p&&s!==r.isNull&&!a.has(s)){const t=e.createEmptyBand(h,i.length);c||(c=new Uint8Array(i.length).fill(255)),it(i,c,h,t),i=t}g.push(i)}const p=t[0];return new e({width:p.width,height:p.height,pixelType:h,mask:s===r.isNull?null:c,pixels:g})}export{l as getOutputDomain,gt as local,c as operandsCount};
5
+ import{isSome as t}from"../../../core/maybe.js";import e from"../PixelBlock.js";import{localTrigonometricOperation as n,localLogicalOperation as r,localConditionalOperation as o}from"../rasterFunctionConstants.js";import{getPixelValueRange as s}from"../rasterFormats/pixelRangeUtils.js";const a=new Map;function l(t){return a.get(t)}a.set(n.acos,[0,Math.PI]),a.set(n.asin,[-Math.PI/2,Math.PI/2]),a.set(n.atan,[-Math.PI/2,Math.PI/2]),a.set(n.cos,[-1,1]),a.set(n.sin,[-1,1]),a.set(r.booleanAnd,[0,1]),a.set(r.booleanNot,[0,1]),a.set(r.booleanOr,[0,1]),a.set(r.booleanXOr,[0,1]),a.set(r.equalTo,[0,1]),a.set(r.notEqual,[0,1]),a.set(r.greaterThan,[0,1]),a.set(r.greaterThanEqual,[0,1]),a.set(r.lessThan,[0,1]),a.set(r.lessThanEqual,[0,1]),a.set(r.isNull,[0,1]);const c=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function f(e,n=!1){const r=e.map((t=>t.mask)),o=r.filter((e=>t(e))),s=e[0].pixels[0].length;if(0===o.length)return new Uint8Array(s).fill(255);const a=o[0],l=new Uint8Array(a);if(1===o.length)return l;if(!n){for(let t=1;t<o.length;t++){const e=o[t];for(let t=0;t<l.length;t++)l[t]&&(l[t]=e[t]?255:0)}return l}if(o.length!==r.length)return new Uint8Array(s).fill(255);for(let t=1;t<o.length;t++){const e=o[t];for(let t=0;t<l.length;t++)0===l[t]&&(l[t]=e[t]?255:0)}return l}function u(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]+s[e]);return l}function h(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand("f32",s);return a.set(o),a}function i(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]-s[e]);return l}function g(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]*s[e]);return l}function p(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand(r,s);for(let e=0;e<s;e++)n&&!n[e]||(a[e]=Math.sign(o[e])*Math.floor(Math.abs(o[e])));return a}function m(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]/s[e]);return l}function y(t,e,n){return m(t,e,"f32")}function d(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=Math.floor(o[e]/s[e]));return l}function M(t,r,o,s){const a=t[0],l=a.length,c=e.createEmptyBand(o,l);if(s===n.atanh){for(let t=0;t<l;t++)if(r[t]){const e=a[t];Math.abs(e)>=1?r[t]=0:c[t]=Math.atanh(e)}return c}const f=s===n.asin?Math.asin:Math.acos;for(let e=0;e<l;e++)if(r[e]){const t=a[e];Math.abs(t)>1?r[e]=0:c[e]=f(t)}return c}function E(t,n,r,o){const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o(s[e]));return l}function B(t,n,r,o){const[s,a]=t,l=s.length,c=e.createEmptyBand(r,l);for(let e=0;e<l;e++)n&&!n[e]||(c[e]=o(s[e],a[e]));return c}function w(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]&s[e]);return l}function b(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]<<s[e]);return l}function x(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand(r,s);for(let e=0;e<s;e++)n&&!n[e]||(a[e]=~o[e]);return a}function A(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]|s[e]);return l}function k(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]>>s[e]);return l}function N(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]^s[e]);return l}function P(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]&&s[e]?1:0);return l}function T(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand(r,s);for(let e=0;e<s;e++)n&&!n[e]||(a[e]=o[e]?0:1);return a}function q(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]||s[e]?1:0);return l}function U(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=(o[e]?1:0)^(s[e]?1:0));return l}function I(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]===s[e]?1:0);return l}function j(t,n,r,o){const[s]=t,a=s.length,l=e.createEmptyBand(r,a),c=o===Math.E;for(let e=0;e<a;e++)n&&!n[e]||(l[e]=c?Math.exp(s[e]):o**s[e]);return l}function F(t,e,n){return j(t,e,n,10)}function z(t,e,n){return j(t,e,n,2)}function O(t,e,n){return j(t,e,n,Math.E)}function W(t,n,r,o){const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(s[e]<=0?n[e]=0:l[e]=o(s[e]));return l}function C(t,e,n){return W(t,e,n,Math.log10)}function R(t,e,n){return W(t,e,n,Math.log2)}function S(t,e,n){return W(t,e,n,Math.log)}function X(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]>s[e]?1:0);return l}function v(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]>=s[e]?1:0);return l}function D(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]<s[e]?1:0);return l}function G(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]<=s[e]?1:0);return l}function H(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand(r,s);if(!n)return a;for(let e=0;e<s;e++)a[e]=n[e]?0:1;return a}function J(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]%s[e]);return l}function K(t,n,r){const[o]=t,s=o.length,a=e.createEmptyBand(r,s);for(let e=0;e<s;e++)n&&!n[e]||(a[e]=-o[e]);return a}function L(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n&&!n[e]||(l[e]=o[e]===s[e]?0:1);return l}function Q(t,n,r){const[o,s]=t,a=o.length,l=e.createEmptyBand(r,a),c=new Uint8Array(a);for(let e=0;e<a;e++)null!=n&&!n[e]||0!==o[e]||(l[e]=s[e],c[e]=255);return{band:l,mask:c}}function V(t,n,r){const[o,s,a]=t,l=o.length,c=e.createEmptyBand(r,l);for(let e=0;e<l;e++)n&&!n[e]||(c[e]=o[e]?s[e]:a[e]);return c}function Y(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e]){let n=s[e];for(let r=1;r<o;r++){const o=t[r][e];n<o&&(n=o)}l[e]=n}return l}function Z(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e]){let n=s[e];for(let r=1;r<o;r++){const o=t[r][e];n>o&&(n=o)}l[e]=n}return l}function $(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e]){let n=s[e],r=n;for(let s=1;s<o;s++){const o=t[s][e];r<o?r=o:n>o&&(n=o)}l[e]=r-n}return l}function _(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e]){let n=0;for(let r=0;r<o;r++)n+=t[r][e];l[e]=n/o}return l}function tt(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e])for(let n=0;n<o;n++){const r=t[n];l[e]+=r[e]}return l}function et(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)if(!n||n[e]){const n=new Float32Array(o);let r=0;for(let a=0;a<o;a++){const o=t[a];r+=o[e],n[a]=o[e]}r/=o;let s=0;for(let t=0;t<o;t++)s+=(n[t]-r)**2;l[e]=Math.sqrt(s/o)}return l}function nt(t,n,r){const o=t.length;if(o<2)return t[0];const s=Math.floor(o/2),[a]=t,l=a.length,c=e.createEmptyBand(r,l),f=new Float32Array(o),u=o%2==1;for(let e=0;e<l;e++)if(!n||n[e]){for(let n=0;n<o;n++)f[n]=t[n][e];f.sort(),c[e]=u?f[s]:(f[s]+f[s-1])/2}return c}function rt(t,n,r){const[o,s]=t;if(null==s)return o;const a=o.length,l=e.createEmptyBand(r,a);for(let e=0;e<a;e++)n[e]&&(o[e]===s[e]?l[e]=o[e]:n[e]=0);return l}function ot(t,n,r){const o=t.length;if(o<=2)return rt(t,n,r);const s=t[0].length,a=e.createEmptyBand(r,s),l=new Map;for(let e=0;e<s;e++)if(!n||n[e]){let n;l.clear();for(let a=0;a<o;a++)n=t[a][e],l.set(n,l.has(n)?l.get(n)+1:1);let r=0,s=0;for(const t of l.keys())r=l.get(t),r>s&&(s=r,n=t);a[e]=n}return a}function st(t,n,r){const o=t.length;if(o<=2)return rt(t,n,r);const s=t[0].length,a=e.createEmptyBand(r,s),l=new Map;for(let e=0;e<s;e++)if(!n||n[e]){let n;l.clear();for(let a=0;a<o;a++)n=t[a][e],l.set(n,l.has(n)?l.get(n)+1:1);let r=0,s=t.length;for(const t of l.keys())r=l.get(t),r<s&&(s=r,n=t);a[e]=n}return a}function at(t,n,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=e.createEmptyBand(r,a),c=new Set;for(let e=0;e<a;e++)if(!n||n[e]){let n;c.clear();for(let r=0;r<o;r++)n=t[r][e],c.add(n);l[e]=c.size}return l}const lt=new Map,ct=new Map,ft=new Map,ut=new Map;function ht(){lt.size||(lt.set(4,Math.sqrt),lt.set(6,Math.acos),lt.set(7,Math.asin),lt.set(8,Math.atan),lt.set(9,Math.atanh),lt.set(10,Math.abs),lt.set(21,Math.cos),lt.set(22,Math.cosh),lt.set(48,Math.floor),lt.set(49,Math.ceil),lt.set(51,Math.sin),lt.set(52,Math.sinh),lt.set(56,Math.tan),lt.set(57,Math.tanh),lt.set(59,Math.acosh),lt.set(60,Math.asinh),lt.set(65,Math.floor),ct.set(5,Math.pow),ct.set(61,Math.atan2),ft.set(1,u),ft.set(2,i),ft.set(3,g),ft.set(11,w),ft.set(12,b),ft.set(12,b),ft.set(13,x),ft.set(14,A),ft.set(15,k),ft.set(16,N),ft.set(17,P),ft.set(18,T),ft.set(19,q),ft.set(20,U),ft.set(23,m),ft.set(24,I),ft.set(25,O),ft.set(26,F),ft.set(27,z),ft.set(28,X),ft.set(29,v),ft.set(30,p),ft.set(31,H),ft.set(32,h),ft.set(33,D),ft.set(34,G),ft.set(35,S),ft.set(36,C),ft.set(37,R),ft.set(44,J),ft.set(45,K),ft.set(46,L),ft.set(64,y),ft.set(65,d),ft.set(76,V),ft.set(78,V),ut.set(38,ot),ut.set(39,Y),ut.set(40,_),ut.set(41,nt),ut.set(42,Z),ut.set(43,st),ut.set(47,$),ut.set(54,et),ut.set(55,tt),ut.set(58,at),ut.set(66,ot),ut.set(67,Y),ut.set(68,_),ut.set(69,nt),ut.set(70,Z),ut.set(71,st),ut.set(72,$),ut.set(73,et),ut.set(74,tt),ut.set(75,at))}function it(t,e,n,r){let[o,a]=s(n);const l=n.startsWith("u")||n.startsWith("s");l&&(o-=1e-5,a+=1e-5);for(let s=0;s<e.length;s++)if(e[s]){const n=t[s];isNaN(n)||n<o||n>a?e[s]=0:r[s]=l?Math.round(n):n}}function gt(t,s,l={}){ht();let c=f(t,s>=66&&s<=75);const{outputPixelType:u="f32"}=l,h=!ut.has(s)||l.processAsMultiband,i=h?t[0].pixels.length:1,g=[];for(let f=0;f<i;f++){const l=ut.has(s)&&!h?t.flatMap((t=>t.pixels)):t.map((t=>t.pixels[f]));let i,p=!0;if(s===o.setNull){const t=Q(l,c,u);i=t.band,c=t.mask,p=!1}else if(ft.has(s)){i=ft.get(s)(l,c,"f64")}else if(lt.has(s))i=s===n.asin||s===n.acos||s===n.atanh?M(l,c,"f64",s):E(l,c,"f64",lt.get(s));else if(ct.has(s))i=B(l,c,"f64",ct.get(s));else if(ut.has(s)){i=ut.get(s)(l,c,"f64")}else i=l[0],p=!1;if(p&&s!==r.isNull&&!a.has(s)){const t=e.createEmptyBand(u,i.length);c||(c=new Uint8Array(i.length).fill(255)),it(i,c,u,t),i=t}g.push(i)}const p=t[0];return new e({width:p.width,height:p.height,pixelType:u,mask:s===r.isNull?null:c,pixels:g})}export{l as getOutputDomain,gt as local,c as operandsCount};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.26.0-next.20230213",
3
+ "version": "4.26.0-next.20230214",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as t}from"../assets.js";import i from"../core/Error.js";import{JSONSupportMixin as r}from"../core/JSONSupport.js";import{clone as o,fixJson as s}from"../core/lang.js";import a from"../core/Loadable.js";import{isSome as n,unwrapOrThrow as l}from"../core/maybe.js";import{isDataProtocol as p,makeAbsolute as c}from"../core/urlUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{ensureClass as u}from"../core/accessorSupport/ensureType.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import g from"../geometry/Extent.js";import y from"./Portal.js";import w from"./PortalItemResource.js";import v from"./PortalRating.js";var f;const b=new Set(["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","GeoJson","CSV","KML","WFS","WMTS","WMS","Feed"]),k=new Set(["KML","GeoJson","CSV"]);let S=f=class extends(r(a)){static from(e){return u(f,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":"Image Service"===e?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Video Service"===e?i="Video Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e&&this.portal&&this.portal.isPortal?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":"Geocoding Service"===e?i="Locator":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e&&e.toLowerCase().includes("add in")?i=e.replace(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.includes("configurableApp")&&(i="Instant App"),i}readExtent(e){return e&&e.length?new g(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",i=this.typeKeywords||[],r="esri/images/portal/",o="16";let s,a=!1,n=!1,l=!1,p=!1,c=!1,d=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(a=i.includes("Hosted Service"),"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(n=i.includes("Table"),l=i.includes("Route Layer"),p=i.includes("Markup"),c=i.includes("Spatiotemporal"),d=i.includes("UtilityNetwork"),s=c&&n?"spatiotemporaltable":n?"table":l?"routelayer":p?"markup":c?"spatiotemporal":a?"featureshosted":d?"utilitynetwork":"features"):s="map service"===e||"wms"===e||"wmts"===e?a||i.includes("Tiled")||"wmts"===e?"maptiles":"mapimages":"scene service"===e?i.includes("Line")?"sceneweblayerline":i.includes("3DObject")?"sceneweblayermultipatch":i.includes("Point")?"sceneweblayerpoint":i.includes("IntegratedMesh")?"sceneweblayermesh":i.includes("PointCloud")?"sceneweblayerpointcloud":i.includes("Polygon")?"sceneweblayerpolygon":i.includes("Building")?"sceneweblayerbuilding":i.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":"image service"===e?i.includes("Elevation 3D Layer")?"elevationlayer":i.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"video service"===e?"mediaservice":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e?i.includes("Web Tool")&&this.portal&&this.portal.isPortal?"tool":"layers":"geodata service"===e?"geodataservice":"layers"):s="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?i.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":"web mapping application"===e&&i.includes("configurableApp")?"instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?"apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&i.includes("ArcGIS Pro")||"explorer map"===e&&i.indexOf("Explorer Document")?"mapsgray":"service definition"===e||"csv"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"360 vr experience"===e||"netcdf"===e||"administrative report"===e?"datafiles":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?"appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?"addindesktop":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"form"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"image"===e||"workflow manager package"===e||"explorer map"===e&&i.includes("Explorer Mapping Application")||i.includes("Document")?"datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?"toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?"layersgray":"scene package"===e?"scenepackage":"mobile scene package"===e?"mobilescenepackage":"tile package"===e||"compact tile package"===e?"tilepackage":"task file"===e?"taskfile":"report template"===e?"report-template":"statistical data collection"===e?"statisticaldatacollection":"insights workbook"===e?"workbook":"insights model"===e?"insightsmodel":"insights page"===e?"insightspage":"insights theme"===e?"insightstheme":"hub initiative"===e?"hubinitiative":"hubpage"===e?"hubpage":"hub event"===e?"hubevent":"hub site application"===e?"hubsite":"hub project"===e?"hubproject":"relational database connection"===e?"relationaldatabaseconnection":"big data file share"===e?"datastorecollection":"image collection"===e?"imagecollection":"style"===e?"style":"desktop style"===e?"desktopstyle":"dashboard"===e?"dashboard":"raster function template"===e?"rasterprocessingtemplate":"vector tile package"===e?"vectortilepackage":"ortho mapping project"===e?"orthomappingproject":"ortho mapping template"===e?"orthomappingtemplate":"solution"===e?"solutions":"geopackage"===e?"geopackage":"deep learning package"===e?"deeplearningpackage":"real time analytic"===e?"realtimeanalytics":"big data analytic"===e?"bigdataanalytics":"feed"===e?"feed":"excalibur imagery project"===e?"excaliburimageryproject":"notebook"===e?"notebook":"storymap"===e?"storymap":"survey123 add in"===e?"survey123addin":"mission"===e?"mission":"mission report"===e?"missionreport":"quickcapture project"===e?"quickcaptureproject":"pro report"===e?"proreport":"pro report template"===e?"proreporttemplate":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"experience builder widget"===e?"experiencebuilderwidget":"experience builder widget package"===e?"experiencebuilderwidgetpackage":"workflow"===e?"workflow":"insights script"===e?"insightsscript":"kernel gateway connection"===e?"kernelgatewayconnection":"hub initiative template"===e?"hubinitiativetemplate":"storymap theme"===e?"storymaptheme":"knowledge graph"===e?"knowledgegraph":"native application"===e?"nativeapp":"native application installer"===e?"nativeappinstaller":"link chart"===e?"linkchart":"investigation"===e?"investigation":"ogcfeatureserver"===e?"features":"pro project"===e?"proproject":"insights workbook package"===e?"insightsworkbookpackage":"apache parquet"===e?"apacheparquet":"notebook code snippets"===e||"notebook code snippet library"===e?"notebookcodesnippets":"suitability model"===e?"suitabilitymodel":"esri classifier definition"===e?"classifierdefinition":"esri classification schema"===e?"classificationschema":"insights data engineering workbook"===e?"dataengineeringworkbook":"insights data engineering model"===e?"dataengineeringmodel":"deep learning studio project"===e?"deeplearningproject":"discussion"===e?"discussion":"allsource project"===e?"allsourceproject":"api key"===e?"apikey":"maps",s?t(r+s+o+".png"):null}get isLayer(){return null!=this.type&&b.has(this.type)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");if(!t)return null;return`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`}load(e){const t=this.portal??(this.portal=y.getDefault()),i=t.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:n(e)?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof v&&(e=e.rating),null==e||isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new v({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:o(this.applicationProxies),avgRating:this.avgRating,categories:o(this.categories),created:o(this.created),culture:this.culture,description:this.description,extent:o(this.extent),groupCategories:o(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:o(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:o(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new f({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const i of["tags","typeKeywords","categories"])e[i]&&(e[i]=e[i].join(", "));const{extent:t}=e;return t&&(e.extent=JSON.stringify(t)),e}async deleteRating(){await l(this.portal).request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return l(this.portal).request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await l(this.portal).request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return null!=t.rating?(t.created=new Date(t.created),new v(t)):null}fetchRelatedItems(e,t){return l(this.portal).requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},f)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return l(this.portal).request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>l(this.portal).signIn())).then((()=>{const t=e&&e.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,i).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new i("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await l(t).signIn();const{copyResources:o,folder:s,tags:a,title:n}=e||{},p={method:"post",query:{copyPrivateResources:"all"===o,folder:"string"==typeof s?s:s?.id,includeResources:!!o,tags:a?.join(","),title:n}},{itemId:c}=await t.request(`${r}/copy`,p);return new f({id:c,portal:t})}updateThumbnail(e){return this.id?this.load().then((()=>this.portal.signIn())).then((()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)p(t)?r.query={data:t}:r.query={url:c(t)},n(i)&&(r.query.filename=i);else{const e=new FormData;n(i)?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){return(await import("./support/resourceUtils.js")).fetchResources(this,e,t)}async addResource(e,t,i){const r=await import("./support/resourceUtils.js");return e.portalItem=this,r.addOrUpdateResource(e,"add",t,i)}async removeResource(e,t){const r=await import("./support/resourceUtils.js");if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new i("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r.removeResource(this,e,t)}async removeAllResources(e){return(await import("./support/resourceUtils.js")).removeAllResources(this,e)}resourceFromPath(e){return new w({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:o(this.categories),created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};return s(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new f({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};e([d({type:["private","shared","org","public"]})],S.prototype,"access",void 0),e([d()],S.prototype,"accessInformation",void 0),e([d({type:String})],S.prototype,"apiKey",void 0),e([d({json:{read:{source:"appProxies"}}})],S.prototype,"applicationProxies",void 0),e([d()],S.prototype,"avgRating",void 0),e([d()],S.prototype,"categories",void 0),e([d({type:Date})],S.prototype,"created",void 0),e([d()],S.prototype,"culture",void 0),e([d()],S.prototype,"description",void 0),e([d({readOnly:!0})],S.prototype,"displayName",null),e([d({type:g})],S.prototype,"extent",void 0),e([m("extent")],S.prototype,"readExtent",null),e([d()],S.prototype,"groupCategories",void 0),e([d({readOnly:!0})],S.prototype,"iconUrl",null),e([d()],S.prototype,"id",void 0),e([d({readOnly:!0})],S.prototype,"isLayer",null),e([d({type:Boolean,readOnly:!0})],S.prototype,"isOrgItem",void 0),e([d()],S.prototype,"itemControl",void 0),e([d({readOnly:!0})],S.prototype,"itemPageUrl",null),e([d({readOnly:!0})],S.prototype,"itemUrl",null),e([d()],S.prototype,"licenseInfo",void 0),e([d({type:Date})],S.prototype,"modified",void 0),e([d()],S.prototype,"name",void 0),e([d()],S.prototype,"numComments",void 0),e([d()],S.prototype,"numRatings",void 0),e([d()],S.prototype,"numViews",void 0),e([d()],S.prototype,"owner",void 0),e([d()],S.prototype,"ownerFolder",void 0),e([d({type:y})],S.prototype,"portal",void 0),e([d()],S.prototype,"screenshots",void 0),e([d()],S.prototype,"size",void 0),e([d()],S.prototype,"snippet",void 0),e([d()],S.prototype,"sourceJSON",void 0),e([d({type:String})],S.prototype,"sourceUrl",void 0),e([d({type:String})],S.prototype,"spatialReference",void 0),e([d()],S.prototype,"tags",void 0),e([d()],S.prototype,"thumbnail",void 0),e([d({readOnly:!0})],S.prototype,"thumbnailUrl",null),e([d()],S.prototype,"title",void 0),e([d()],S.prototype,"type",void 0),e([d()],S.prototype,"typeKeywords",void 0),e([d({type:String,json:{read(e,t){if(k.has(t.type)){const t=this.portal?.restUrl;e||(e=t&&this.id?`${t}/content/items/${this.id}/data`:null)}return e}}})],S.prototype,"url",void 0),e([d({readOnly:!0})],S.prototype,"userItemUrl",null),S=f=e([h("esri.portal.PortalItem")],S);const x=S;export{x as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as t}from"../assets.js";import i from"../core/Error.js";import{JSONSupportMixin as r}from"../core/JSONSupport.js";import{clone as o,fixJson as s}from"../core/lang.js";import a from"../core/Loadable.js";import{isSome as n,unwrapOrThrow as l}from"../core/maybe.js";import{isDataProtocol as p,makeAbsolute as c}from"../core/urlUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{ensureClass as u}from"../core/accessorSupport/ensureType.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import g from"../geometry/Extent.js";import y from"./Portal.js";import w from"./PortalItemResource.js";import v from"./PortalRating.js";var f;const b=new Set(["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","GeoJson","CSV","KML","WFS","WMTS","WMS","Feed"]),k=new Set(["KML","GeoJson","CSV"]);let S=f=class extends(r(a)){static from(e){return u(f,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":"Image Service"===e?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Video Service"===e?i="Video Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e&&this.portal&&this.portal.isPortal?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":"Geocoding Service"===e?i="Locator":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e&&e.toLowerCase().includes("add in")?i=e.replace(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.includes("configurableApp")?i="Instant App":"Insights Page"===e&&(i="Insights Report"),i}readExtent(e){return e&&e.length?new g(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",i=this.typeKeywords||[],r="esri/images/portal/",o="16";let s,a=!1,n=!1,l=!1,p=!1,c=!1,d=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(a=i.includes("Hosted Service"),"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(n=i.includes("Table"),l=i.includes("Route Layer"),p=i.includes("Markup"),c=i.includes("Spatiotemporal"),d=i.includes("UtilityNetwork"),s=c&&n?"spatiotemporaltable":n?"table":l?"routelayer":p?"markup":c?"spatiotemporal":a?"featureshosted":d?"utilitynetwork":"features"):s="map service"===e||"wms"===e||"wmts"===e?a||i.includes("Tiled")||"wmts"===e?"maptiles":"mapimages":"scene service"===e?i.includes("Line")?"sceneweblayerline":i.includes("3DObject")?"sceneweblayermultipatch":i.includes("Point")?"sceneweblayerpoint":i.includes("IntegratedMesh")?"sceneweblayermesh":i.includes("PointCloud")?"sceneweblayerpointcloud":i.includes("Polygon")?"sceneweblayerpolygon":i.includes("Building")?"sceneweblayerbuilding":i.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":"image service"===e?i.includes("Elevation 3D Layer")?"elevationlayer":i.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"video service"===e?"mediaservice":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e?i.includes("Web Tool")&&this.portal&&this.portal.isPortal?"tool":"layers":"geodata service"===e?"geodataservice":"layers"):s="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?i.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":"web mapping application"===e&&i.includes("configurableApp")?"instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?"apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&i.includes("ArcGIS Pro")||"explorer map"===e&&i.indexOf("Explorer Document")?"mapsgray":"service definition"===e||"csv"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"360 vr experience"===e||"netcdf"===e||"administrative report"===e?"datafiles":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?"appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?"addindesktop":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"form"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"image"===e||"workflow manager package"===e||"explorer map"===e&&i.includes("Explorer Mapping Application")||i.includes("Document")?"datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?"toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?"layersgray":"scene package"===e?"scenepackage":"mobile scene package"===e?"mobilescenepackage":"tile package"===e||"compact tile package"===e?"tilepackage":"task file"===e?"taskfile":"report template"===e?"report-template":"statistical data collection"===e?"statisticaldatacollection":"insights workbook"===e?"workbook":"insights model"===e?"insightsmodel":"insights page"===e?"insightspage":"insights theme"===e?"insightstheme":"hub initiative"===e?"hubinitiative":"hubpage"===e?"hubpage":"hub event"===e?"hubevent":"hub site application"===e?"hubsite":"hub project"===e?"hubproject":"relational database connection"===e?"relationaldatabaseconnection":"big data file share"===e?"datastorecollection":"image collection"===e?"imagecollection":"style"===e?"style":"desktop style"===e?"desktopstyle":"dashboard"===e?"dashboard":"raster function template"===e?"rasterprocessingtemplate":"vector tile package"===e?"vectortilepackage":"ortho mapping project"===e?"orthomappingproject":"ortho mapping template"===e?"orthomappingtemplate":"solution"===e?"solutions":"geopackage"===e?"geopackage":"deep learning package"===e?"deeplearningpackage":"real time analytic"===e?"realtimeanalytics":"big data analytic"===e?"bigdataanalytics":"feed"===e?"feed":"excalibur imagery project"===e?"excaliburimageryproject":"notebook"===e?"notebook":"storymap"===e?"storymap":"survey123 add in"===e?"survey123addin":"mission"===e?"mission":"mission report"===e?"missionreport":"quickcapture project"===e?"quickcaptureproject":"pro report"===e?"proreport":"pro report template"===e?"proreporttemplate":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"experience builder widget"===e?"experiencebuilderwidget":"experience builder widget package"===e?"experiencebuilderwidgetpackage":"workflow"===e?"workflow":"insights script"===e?"insightsscript":"kernel gateway connection"===e?"kernelgatewayconnection":"hub initiative template"===e?"hubinitiativetemplate":"storymap theme"===e?"storymaptheme":"knowledge graph"===e?"knowledgegraph":"native application"===e?"nativeapp":"native application installer"===e?"nativeappinstaller":"link chart"===e?"linkchart":"investigation"===e?"investigation":"ogcfeatureserver"===e?"features":"pro project"===e?"proproject":"insights workbook package"===e?"insightsworkbookpackage":"apache parquet"===e?"apacheparquet":"notebook code snippets"===e||"notebook code snippet library"===e?"notebookcodesnippets":"suitability model"===e?"suitabilitymodel":"esri classifier definition"===e?"classifierdefinition":"esri classification schema"===e?"classificationschema":"insights data engineering workbook"===e?"dataengineeringworkbook":"insights data engineering model"===e?"dataengineeringmodel":"deep learning studio project"===e?"deeplearningproject":"discussion"===e?"discussion":"allsource project"===e?"allsourceproject":"api key"===e?"apikey":"maps",s?t(r+s+o+".png"):null}get isLayer(){return null!=this.type&&b.has(this.type)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");if(!t)return null;return`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`}load(e){const t=this.portal??(this.portal=y.getDefault()),i=t.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:n(e)?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof v&&(e=e.rating),null==e||isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new v({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:o(this.applicationProxies),avgRating:this.avgRating,categories:o(this.categories),created:o(this.created),culture:this.culture,description:this.description,extent:o(this.extent),groupCategories:o(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:o(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:o(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new f({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const i of["tags","typeKeywords","categories"])e[i]&&(e[i]=e[i].join(", "));const{extent:t}=e;return t&&(e.extent=JSON.stringify(t)),e}async deleteRating(){await l(this.portal).request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return l(this.portal).request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await l(this.portal).request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return null!=t.rating?(t.created=new Date(t.created),new v(t)):null}fetchRelatedItems(e,t){return l(this.portal).requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},f)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return l(this.portal).request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>l(this.portal).signIn())).then((()=>{const t=e&&e.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,i).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new i("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await l(t).signIn();const{copyResources:o,folder:s,tags:a,title:n}=e||{},p={method:"post",query:{copyPrivateResources:"all"===o,folder:"string"==typeof s?s:s?.id,includeResources:!!o,tags:a?.join(","),title:n}},{itemId:c}=await t.request(`${r}/copy`,p);return new f({id:c,portal:t})}updateThumbnail(e){return this.id?this.load().then((()=>this.portal.signIn())).then((()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)p(t)?r.query={data:t}:r.query={url:c(t)},n(i)&&(r.query.filename=i);else{const e=new FormData;n(i)?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then((()=>this.reload()))})):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){return(await import("./support/resourceUtils.js")).fetchResources(this,e,t)}async addResource(e,t,i){const r=await import("./support/resourceUtils.js");return e.portalItem=this,r.addOrUpdateResource(e,"add",t,i)}async removeResource(e,t){const r=await import("./support/resourceUtils.js");if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new i("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r.removeResource(this,e,t)}async removeAllResources(e){return(await import("./support/resourceUtils.js")).removeAllResources(this,e)}resourceFromPath(e){return new w({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:o(this.categories),created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};return s(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new f({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};e([d({type:["private","shared","org","public"]})],S.prototype,"access",void 0),e([d()],S.prototype,"accessInformation",void 0),e([d({type:String})],S.prototype,"apiKey",void 0),e([d({json:{read:{source:"appProxies"}}})],S.prototype,"applicationProxies",void 0),e([d()],S.prototype,"avgRating",void 0),e([d()],S.prototype,"categories",void 0),e([d({type:Date})],S.prototype,"created",void 0),e([d()],S.prototype,"culture",void 0),e([d()],S.prototype,"description",void 0),e([d({readOnly:!0})],S.prototype,"displayName",null),e([d({type:g})],S.prototype,"extent",void 0),e([m("extent")],S.prototype,"readExtent",null),e([d()],S.prototype,"groupCategories",void 0),e([d({readOnly:!0})],S.prototype,"iconUrl",null),e([d()],S.prototype,"id",void 0),e([d({readOnly:!0})],S.prototype,"isLayer",null),e([d({type:Boolean,readOnly:!0})],S.prototype,"isOrgItem",void 0),e([d()],S.prototype,"itemControl",void 0),e([d({readOnly:!0})],S.prototype,"itemPageUrl",null),e([d({readOnly:!0})],S.prototype,"itemUrl",null),e([d()],S.prototype,"licenseInfo",void 0),e([d({type:Date})],S.prototype,"modified",void 0),e([d()],S.prototype,"name",void 0),e([d()],S.prototype,"numComments",void 0),e([d()],S.prototype,"numRatings",void 0),e([d()],S.prototype,"numViews",void 0),e([d()],S.prototype,"owner",void 0),e([d()],S.prototype,"ownerFolder",void 0),e([d({type:y})],S.prototype,"portal",void 0),e([d()],S.prototype,"screenshots",void 0),e([d()],S.prototype,"size",void 0),e([d()],S.prototype,"snippet",void 0),e([d()],S.prototype,"sourceJSON",void 0),e([d({type:String})],S.prototype,"sourceUrl",void 0),e([d({type:String})],S.prototype,"spatialReference",void 0),e([d()],S.prototype,"tags",void 0),e([d()],S.prototype,"thumbnail",void 0),e([d({readOnly:!0})],S.prototype,"thumbnailUrl",null),e([d()],S.prototype,"title",void 0),e([d()],S.prototype,"type",void 0),e([d()],S.prototype,"typeKeywords",void 0),e([d({type:String,json:{read(e,t){if(k.has(t.type)){const t=this.portal?.restUrl;e||(e=t&&this.id?`${t}/content/items/${this.id}/data`:null)}return e}}})],S.prototype,"url",void 0),e([d({readOnly:!0})],S.prototype,"userItemUrl",null),S=f=e([h("esri.portal.PortalItem")],S);const x=S;export{x as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Error.js";import has from"../../core/has.js";import{isSome as o,isNone as r}from"../../core/maybe.js";import{whenOrAbort as e}from"../../core/promiseUtils.js";import{DataLayerSource as a}from"../../layers/support/source/DataLayerSource.js";import{executeRawQueryJSON as s}from"./executeQueryJSON.js";import{executeRawQueryPBF as n}from"./executeQueryPBF.js";import i from"../support/FeatureSet.js";import f from"../support/Query.js";async function c(t,o,r,e){return u(t,o,r,e).then((t=>l(o,t,r,e)))}async function u(t,o,r,e){const a={...e},i=p(o,r),f=null!=o.outStatistics?.[0],c=has("featurelayer-pbf-statistics"),u=!f||c;let l;if("pbf"===r?.format&&u)try{l=await n(t,i,a)}catch(d){if("query:parsing-pbf"!==d.name)throw d;r.format="json"}return"json"!==r?.format&&u||(l=await s(t,i,a)),m(r?.fieldsIndex,l.fields),l}function m(t,r){if(o(t)&&o(r))for(const o of r){const r=t.get(o.name);r&&Object.assign(o,r.toJSON())}}async function l(t,o,a,s){const n=a?.infoFor3D;if(!d(t,n)||r(n)||!o.assetMaps||!o.features||!o.features.length)return i.fromJSON(o);const{meshFeatureSetFromJSON:f}=await e(import("../support/meshFeatureSet.js"),s);return f(t,n,o)}function p(e,s){let n=f.from(e);n.sourceSpatialReference=n.sourceSpatialReference??s?.sourceSpatialReference??null,(s?.gdbVersion||s?.dynamicDataSource)&&(n=n===e?n.clone():n,n.gdbVersion=e.gdbVersion||s.gdbVersion,n.dynamicDataSource=e.dynamicDataSource?a.from(e.dynamicDataSource):s.dynamicDataSource);const i=s?.infoFor3D;if(o(i)&&d(e,i)){n=n===e?n.clone():n,n.formatOf3DObjects=null;for(const t of i.queryFormats){if("3D_glb"===t){n.formatOf3DObjects=t;break}"3D_gltf"!==t||n.formatOf3DObjects||(n.formatOf3DObjects=t)}if(!n.formatOf3DObjects)throw new t("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(r(n.outFields)||!n.outFields.includes("*")){n=n===e?n.clone():n,r(n.outFields)&&(n.outFields=[]);const{originX:t,originY:o,originZ:a,translationX:s,translationY:f,translationZ:c,scaleX:u,scaleY:m,scaleZ:l,rotationX:p,rotationY:d,rotationZ:y,rotationDeg:j}=i.transformFieldRoles;n.outFields.push(t,o,a,s,f,c,u,m,l,p,d,y,j)}}return n}function d(t,r){return o(r)&&o(t.returnGeometry)&&"xyFootprint"!==t.multipatchOption&&!t.outStatistics}export{c as executeQuery,u as executeRawQuery,m as normalizeFields};
5
+ import t from"../../core/Error.js";import has from"../../core/has.js";import{isSome as o,isNone as r}from"../../core/maybe.js";import{whenOrAbort as e}from"../../core/promiseUtils.js";import{DataLayerSource as a}from"../../layers/support/source/DataLayerSource.js";import{executeRawQueryJSON as s}from"./executeQueryJSON.js";import{executeRawQueryPBF as n}from"./executeQueryPBF.js";import i from"../support/FeatureSet.js";import f from"../support/Query.js";async function c(t,o,r,e){return u(t,o,r,e).then((t=>l(o,t,r,e)))}async function u(t,o,r,e){const a={...e},i=p(o,r),f=null!=o.outStatistics?.[0],c=has("featurelayer-pbf-statistics"),u=!f||c;let l;if("pbf"===r?.format&&u)try{l=await n(t,i,a)}catch(d){if("query:parsing-pbf"!==d.name)throw d;r.format="json"}return"json"!==r?.format&&u||(l=await s(t,i,a)),m(r?.fieldsIndex,l.fields),l}function m(t,r){if(o(t)&&o(r))for(const o of r){const r=t.get(o.name);r&&Object.assign(o,r.toJSON())}}async function l(t,o,a,s){const n=a?.infoFor3D;if(!d(t,n)||r(n)||!o.assetMaps||!o.features||!o.features.length)return i.fromJSON(o);const{meshFeatureSetFromJSON:f}=await e(import("../support/meshFeatureSet.js"),s);return f(t,n,o)}function p(e,s){let n=f.from(e);n.sourceSpatialReference=n.sourceSpatialReference??s?.sourceSpatialReference??null,(s?.gdbVersion||s?.dynamicDataSource)&&(n=n===e?n.clone():n,n.gdbVersion=e.gdbVersion||s.gdbVersion,n.dynamicDataSource=e.dynamicDataSource?a.from(e.dynamicDataSource):s.dynamicDataSource);const i=s?.infoFor3D;if(o(i)&&d(e,i)){n=n===e?n.clone():n,n.formatOf3DObjects=null;for(const t of i.queryFormats){if("3D_glb"===t){n.formatOf3DObjects=t;break}"3D_gltf"!==t||n.formatOf3DObjects||(n.formatOf3DObjects=t)}if(!n.formatOf3DObjects)throw new t("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(r(n.outFields)||!n.outFields.includes("*")){n=n===e?n.clone():n,r(n.outFields)&&(n.outFields=[]);const{originX:t,originY:o,originZ:a,translationX:s,translationY:f,translationZ:c,scaleX:u,scaleY:m,scaleZ:l,rotationX:p,rotationY:d,rotationZ:y,rotationDeg:j}=i.transformFieldRoles;n.outFields.push(t,o,a,s,f,c,u,m,l,p,d,y,j)}}return n}function d(t,r){return o(r)&&!0===t.returnGeometry&&"xyFootprint"!==t.multipatchOption&&!t.outStatistics}export{c as executeQuery,u as executeRawQuery,m as normalizeFields};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- const b="20230213",d="b666db1b1129517663ed8d4504de2bc3fc4407f5";export{b as buildDate,d as commitHash};
5
+ const d="20230214",e="f7de8ec3d40ebb2edff5c9b8167b178c88dfd970";export{d as buildDate,e as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.26/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Collection.js";import r from"../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../core/MapUtils.js";import{isSome as i,isNone as n}from"../../../core/maybe.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{on as l}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{create as c}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as h}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as u}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as f}from"../../../layers/support/MediaElementView.js";import"../tiling/PagedTileQueue.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import d from"../tiling/TileQueue.js";import p from"../tiling/TileStrategy.js";import y from"../engine/webgl/Overlay.js";import _ from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as g}from"./LayerView2D.js";import v from"../../layers/LayerView.js";import j from"../../../geometry/Extent.js";let w=class extends(g(v)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this.layer=null,this.elements=new t}attach(){this.addAttachHandles([l((()=>this.layer.effectiveSource),"refresh",(()=>{for(const e of this._tileStrategy.tiles)this._updateTile(e);this.requestUpdate()})),l((()=>this.layer.effectiveSource),"change",(({element:e})=>this._elementUpdateHandler(e)))]),this._overlayContainer=new _,this.container.addChild(this._overlayContainer),this._fetchQueue=new d({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t)}),this._tileStrategy=new p({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear()}supportsSpatialReference(e){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e)}async hitTest(e,t){const r=[],s=e.normalize(),n=[s.x,s.y];for(const{projectedElement:{normalizedCoords:o,element:l}}of this._elementReferences.values())i(o)&&h(o.rings,n)&&r.push({type:"media",element:l,layer:this.layer,mapPoint:e});return r.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._updateTile(e)))}_acquireTile(e){const t=new R(e.clone());return this._updateTile(t),t}_updateTile(e){this.updatingHandles.addPromise(this._fetchQueue.push(e.key).then((t=>{const[r,s]=e.setElements(t);this._referenceElements(e,r),this._dereferenceElements(e,s),this.requestUpdate()}),(e=>{o(e)||r.getLogger(this.declaredClass).error(e)})))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const r=this.layer.effectiveSource;if(n(r))return[];this.view.featuresTilingScheme.getTileBounds(E,e,!0);const s=new j({xmin:E[0],ymin:E[1],xmax:E[2],ymax:E[3],spatialReference:this.view.spatialReference});return r.queryElements(s,t)}_referenceElements(e,t){const r=this.layer.source;if(!n(r))for(const s of t)this._referenceElement(e,s)}_referenceElement(e,t){s(this._elementReferences,t.uid,(()=>{const e=new f({element:t,spatialReference:this.view.spatialReference}),r=new y(e);return this._overlayContainer.addChild(r),this.elements.add(t),{tiles:new Set,projectedElement:e,overlay:r}})).tiles.add(e)}_dereferenceElements(e,t){for(const r of t)this._dereferenceElement(e,r)}_dereferenceElement(e,t){const r=this._elementReferences.get(t.uid);r.tiles.delete(e),r.tiles.size||(this._overlayContainer.removeChild(r.overlay),r.overlay.destroy(),r.projectedElement.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t))}_elementUpdateHandler(e){const t=this._elementReferences.get(e.uid);if(t){const r=t.projectedElement.normalizedCoords;if(n(r))return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.projectedElement.destroy(),this._elementReferences.delete(e.uid),void this.elements.remove(e);const s=[],i=[];for(const e of this._tileStrategy.tiles){const n=T(this.view.featuresTilingScheme,e,r);t.tiles.has(e)?n||i.push(e):n&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of i)this._dereferenceElement(t,e);return}const r=new f({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(i(r))for(const s of this._tileStrategy.tiles){T(this.view.featuresTilingScheme,s,r)&&this._referenceElement(s,e)}}};e([a()],w.prototype,"_fetchQueue",void 0),e([a()],w.prototype,"layer",void 0),e([a({readOnly:!0})],w.prototype,"elements",void 0),w=e([m("esri.views.2d.layers.MediaLayerView2D")],w);const E=c(),S={xmin:0,ymin:0,xmax:0,ymax:0};function T(e,t,r){return e.getTileBounds(E,t.key,!0),S.xmin=E[0],S.ymin=E[1],S.xmax=E[2],S.ymax=E[3],u(S,r)}class R{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],r=new Set(this.elements);this.elements=e;for(const s of e)r.has(s)?r.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(r)]}}const C=w;export{C as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import"../../../Graphic.js";import"../../../renderers/ClassBreaksRenderer.js";import"../../../renderers/DictionaryRenderer.js";import"../../../renderers/DotDensityRenderer.js";import"../../../renderers/HeatmapRenderer.js";import"../../../renderers/PieChartRenderer.js";import"../../../renderers/Renderer.js";import"../../../renderers/SimpleRenderer.js";import"../../../renderers/UniqueValueRenderer.js";import"../../../renderers/support/jsonUtils.js";import"../../../symbols.js";import t from"../../../core/Collection.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../core/MapUtils.js";import{isSome as i,isNone as n}from"../../../core/maybe.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{on as l}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{create as p}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as c}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as h}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as u}from"../../../layers/support/MediaElementView.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../request.js";import"../../../chunks/index2.js";import"../../../core/urlUtils.js";import"../../../chunks/index3.js";import"../../../layers/effects/EffectView.js";import"../engine/DisplayObject.js";import"../engine/webgl/effects/highlight/HighlightGradient.js";import"../engine/webgl/BufferPool.js";import"../engine/webgl/enums.js";import"../engine/webgl/brushes/BrushBitmap.js";import"../../../chunks/vec4f32.js";import"../engine/webgl/Utils.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/enums.js";import"../../webgl/checkWebGLError.js";import"../../webgl/context-util.js";import"../../../chunks/builtins.js";import"../../../core/RandomLCG.js";import"../engine/webgl/materialKey/MaterialKey.js";import"../engine/webgl/techniques/Technique.js";import"../engine/webgl/techniques/dotDensity/TechniqueDotDensity.js";import"../engine/webgl/techniques/heatmap/TechniqueHeatmap.js";import"../engine/webgl/techniques/pieChart/TechniquePieChart.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Texture.js";import"../../webgl/VertexArrayObject.js";import"../engine/webgl/brushes/WGLBrushHeatmap.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../engine/webgl/brushes/WGLGeometryBrushMarker.js";import"../../../core/mathUtils.js";import"../engine/webgl/number.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../../../chunks/vec2f32.js";import"../engine/vectorTiles/enums.js";import"../engine/vectorTiles/shaders/sources/resolver.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../engine/webgl/shaders/sources/resolver.js";import"../engine/webgl/TextureManager.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/effects/BlendEffect.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../engine/webgl/Profiler.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/interfaces.js";import"../../../core/floatRGBA.js";import"../../3d/webgl-engine/lib/OrderIndependentTransparency.js";import"../../../chunks/webgl-debug.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../engine/webgl/AttributeStoreView.js";import"../../../chunks/earcut.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../core/unitUtils.js";import"../../../renderers/support/lengthUtils.js";import"../../../chunks/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../engine/webgl/shaders/MagnifierPrograms.js";import"../tiling/PagedTileQueue.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import d from"../tiling/TileQueue.js";import g from"../tiling/TileStrategy.js";import f from"../engine/webgl/Overlay.js";import j from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as y}from"./LayerView2D.js";import w from"../../layers/LayerView.js";import b from"../../../geometry/Extent.js";let _=class extends(y(w)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this.layer=null,this.elements=new t}attach(){this.addAttachHandles([l((()=>this.layer.effectiveSource),"refresh",(()=>{for(const e of this._tileStrategy.tiles)this._updateTile(e);this.requestUpdate()})),l((()=>this.layer.effectiveSource),"change",(({element:e})=>this._elementUpdateHandler(e)))]),this._overlayContainer=new j,this.container.addChild(this._overlayContainer),this._fetchQueue=new d({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t)}),this._tileStrategy=new g({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const r=[],s=e.normalize(),n=[s.x,s.y];for(const{projectedElement:{normalizedCoords:o,element:l}}of this._elementReferences.values())i(o)&&c(o.rings,n)&&r.push({type:"media",element:l,layer:this.layer,mapPoint:e});return r.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._updateTile(e)))}_acquireTile(e){const t=new E(e.clone());return this._updateTile(t),t}_updateTile(e){this.updatingHandles.addPromise(this._fetchQueue.push(e.key).then((t=>{const[r,s]=e.setElements(t);this._referenceElements(e,r),this._dereferenceElements(e,s),this.requestUpdate()}),(e=>{o(e)||r.getLogger(this.declaredClass).error(e)})))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const r=this.layer.effectiveSource;if(n(r))return[];this.view.featuresTilingScheme.getTileBounds(v,e,!0);const s=new b({xmin:v[0],ymin:v[1],xmax:v[2],ymax:v[3],spatialReference:this.view.spatialReference});return r.queryElements(s,t)}_referenceElements(e,t){const r=this.layer.source;if(!n(r))for(const s of t)this._referenceElement(e,s)}_referenceElement(e,t){s(this._elementReferences,t.uid,(()=>{const e=new u({element:t,spatialReference:this.view.spatialReference}),r=new f(e);this._overlayContainer.addChild(r),this.elements.add(t);let s=null;return{tiles:new Set,projectedElement:e,overlay:r,debugGraphic:s}})).tiles.add(e)}_dereferenceElements(e,t){for(const r of t)this._dereferenceElement(e,r)}_dereferenceElement(e,t){const r=this._elementReferences.get(t.uid);r.tiles.delete(e),r.tiles.size||(this._overlayContainer.removeChild(r.overlay),r.overlay.destroy(),r.projectedElement.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(r.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.projectedElement.normalizedCoords;if(n(r))return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],i=[];for(const e of this._tileStrategy.tiles){const n=R(this.view.featuresTilingScheme,e,r);t.tiles.has(e)?n||i.push(e):n&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of i)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const r=new u({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(i(r))for(const s of this._tileStrategy.tiles){R(this.view.featuresTilingScheme,s,r)&&this._referenceElement(s,e)}}};e([a()],_.prototype,"_fetchQueue",void 0),e([a()],_.prototype,"layer",void 0),e([a({readOnly:!0})],_.prototype,"elements",void 0),_=e([m("esri.views.2d.layers.MediaLayerView2D")],_);const v=p(),T={xmin:0,ymin:0,xmax:0,ymax:0};function R(e,t,r){return e.getTileBounds(v,t.key,!0),T.xmin=v[0],T.ymin=v[1],T.xmax=v[2],T.ymax=v[3],h(T,r)}class E{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],r=new Set(this.elements);this.elements=e;for(const s of e)r.has(s)?r.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(r)]}destroy(){}}const S=_;export{S as default};